Skip to content

Commit

Permalink
Add alpha version of Spaces SDK (#513)
Browse files Browse the repository at this point in the history
* refactor: added initial SpacesUI class architecture

* Update packages/uiweb/src/lib/components/space/SpacesUI.tsx

Co-authored-by: Arnab Chatterjee <[email protected]>

* Update packages/uiweb/src/lib/components/space/SpacesUI.tsx

Co-authored-by: Arnab Chatterjee <[email protected]>

* fix: refine code structure

* refactor: change structure and added a test sample

* feat: added themeprovider for spaces ui components (#436)

* feat: feat: add themeprovider for spaces

* fix: resolved conflicts

* refactor: cleaned up provider

* refactor: resolved comments

* feat: added colors and themeing in demoreactapp

* refactor: cleaned code

* refactor: resolved comments

* refactor: added a basic style structure for ease of use (#453)

* feat: SpaceBanner Component (#438)

* feat: SpaceBanner

* refactor: removed-optionals

* feat: space-banner functionality

* fix: reverted app.tsx

* fix: reverted app.tsx

* fix: removed test svg file

* refactor: change structure and added a test sample

* feat: space-banner functionality

* refactor: api-implementation

* fix: removed-svg

* refactor: mobile version

* Revert "fix: removed test svg file"

This reverts commit 7af756b.

* Revert "refactor: change structure and added a test sample"

This reverts commit b1e8745.

* fix: revert

* refactor: lastest-pull

* feat: added-spaceBanner-test

* refactor: cache-to-context

* refactor: custom hook added for data

* refactor: spaceDTO

* fix: SpaceDTO implementation

* refactor: participant-container

* refactor: cleanups

* fix: ui-fixes

* fix: EOF newlines

* fix: overflow-fixed

* refactor: tweaked context structure a bit

---------

Co-authored-by: Samarendra Gouda <[email protected]>
Co-authored-by: Nilesh Gupta <[email protected]>

* refactor: updated theme object along with light and dark theme

* feat: Create Space Component (#454)

* refactor: resolved merge conflicts

* feat: added modals and modal behaviour logic

* feat: modal inputs

* feat: change modal logic + integr8 API

* feat: added CSS for modals and inputs

* fix: resolved PR comments

* refactor: improve css

* refactor: rft create modal

* feat: added search input component

* Refactor/space widget component (#458)

* refactor: added basic design

* refactor: added full widget with style

* refactor: reduced fixed height of scheduled widget content

* refactor: changes requested

* refactor: resolved review comments

* feat: add spaces info component (#474)

* Feat/added members modal (#477)

* refactor: added modal

* refactor: added members modal

* refactor: review comments

* refactor: resolve review comments

* fix: review comments

* 424 spaces functions webrtc logic (#482)

* fix: add spaces for functions

* fix: Separate page for space in the demo react APP

* fix: start/stop spaces functions

* fix: fix image and description types

* fix: added functions to add and remove members from group

* fix: spaces functions

* fix: spaces functions refactoring

* fix: few more changes

* fix: spaces function testing

* fix: spaces functions

* fix: SDK bug fixes

* fix: SDK bug fixes

* fix: minor fixes

* fix: minor fix

* fix: minor fix

* feat(video): add create mesh connection logic in Video class

* feat(spaces): make video mesh compatible & add spaces class

* feat(spaces): add backend methods in Space class

---------

Co-authored-by: Shoaib Mohammed <[email protected]>
Co-authored-by: Madhur Gupta <[email protected]>

* refactor: spaces UI Components refactor (#478)

> replaced hardcoded styles with context theme >added smoother animations on collapsoble components
>added profile cards to invite modal

* refactor: added spaceUI class variables into context as well (#488)

* refactor: added spaceUI class variables into context as well

* refactor: resolve review comments

* refactor: added a clickHandler in spaceBanner component for extra flexibility (#489)

* fix(spaces): fix console errs and refactor create, update methods (#492)

* fix: add spaces for functions

* fix: Separate page for space in the demo react APP

* fix: start/stop spaces functions

* fix: fix image and description types

* fix: added functions to add and remove members from group

* fix: spaces functions

* fix: spaces functions refactoring

* fix: few more changes

* fix: spaces function testing

* fix: spaces functions

* fix: SDK bug fixes

* fix: SDK bug fixes

* fix: minor fixes

* fix: minor fix

* fix: minor fix

* feat(video): add create mesh connection logic in Video class

* feat(spaces): make video mesh compatible & add spaces class

* feat(spaces): add backend methods in Space class

* fix: Merge branch 'alpha' into 424-spaces-functions-webrtc-logic

* fix(spaces): fix console errors and move out create, update functions from Space class

---------

Co-authored-by: Shoaib Mohammed <[email protected]>

* refactor: modified init class method

* refactor/added-space-feed-component(#481)

* feat: space-feed

* refactor: space-feed

* Deployment (#440)

* ci(restapi): 🎉 cut release to restapi-v1.0.0

* fix(component): dummy

* ci(restapi): 🎉 cut release to restapi-v1.0.0

* fix(component): dummy

* ci(restapi): 🎉 cut release to restapi-v1.0.1

* ci(restapi): 🎉 cut release to restapi-v1.0.1

* fix(component): dummy

* ci(restapi): 🎉 cut release to restapi-v1.0.2

* fix(component): dummy

* ci(restapi): 🎉 cut release to restapi-v1.0.2

* fix(component): dummy

* ci(restapi): 🎉 cut release to restapi-v1.0.3

* fix: success progressHook

* ci(restapi): 🎉 cut release to restapi-v1.0.4

* ci(restapi): 🎉 cut release to restapi-v1.1.0

* ci(restapi): 🎉 cut release to restapi-v1.2.0

* ci(restapi): 🎉 cut release to restapi-v1.2.0

* ci(restapi): 🎉 cut release to restapi-v1.0.0

* fix(component): dummy

* fix(component): dummy

* fix(component): dummy

* ci(restapi): 🎉 cut release to restapi-v1.0.2

* fix(component): dummy

* ci(restapi): 🎉 cut release to restapi-v1.0.3

* ci(restapi): 🎉 cut release to restapi-v1.0.4

* ci(restapi): 🎉 cut release to restapi-v1.2.1

* fix: local for local development (#295)

Co-Authored-By: aman035 <[email protected]>

* fix: version update

* ci(restapi): 🎉 cut release to restapi-v1.2.2

* ci(restapi): 🎉 cut release to restapi-v1.2.3

* ci(restapi): 🎉 cut release to restapi-v1.2.4

* ci(restapi): 🎉 cut release to restapi-v1.2.5

* ci(restapi): 🎉 cut release to restapi-v1.2.6

* ci(restapi): 🎉 cut release to restapi-v1.2.7

* ci(socket): 🎉 cut release to socket-v0.5.0

* fix: test commit

* ci(restapi): 🎉 cut release to restapi-v1.2.8

* ci(uiweb): 🎉 cut release to uiweb-v1.0.0

* ci(uiweb): 🎉 cut release to uiweb-v1.0.0

* ci(uiweb): 🎉 cut release to uiweb-v1.0.1

* fix: added ci-version-beta

* fix: added ci-version-beta

* ci(restapi): 🎉 cut beta release to restapi-v1.2.9

* fix: added releaseType

* ci(restapi): 🎉 cut beta release to restapi-v0.0.1-beta.0

* ci(restapi): 🎉 cut beta release to restapi-v0.0.1-beta.0

* ci(restapi): 🎉 cut release to restapi-v1.2.10

* ci(restapi): 🎉 cut release to restapi-v1.2.10

* ci(restapi): 🎉 cut beta release to restapi-v0.0.1-beta.1

* ci(restapi): 🎉 cut release to restapi-v1.2.11

* fix: linkedListHash test cases removed & CI version corrected

* fix: update name to beta

* ci(restapi): 🎉 cut release to restapi-v1.2.12

* ci(restapi): 🎉 cut release to restapi-v1.2.12

* ci(restapi): 🎉 cut release to restapi-v1.2.13

* ci(restapi): 🎉 cut release to restapi-v1.2.14

* ci(restapi): 🎉 cut release to restapi-v1.2.15

* fix: update package json

* fix: updated socket version

* ci(uiweb): 🎉 cut release to uiweb-v1.0.2

* fix: socket lib update

* ci(uiweb): 🎉 cut release to uiweb-v1.0.2

* ci(restapi): 🎉 cut release to restapi-v1.2.16

* ci(restapi): 🎉 cut release to restapi-v1.3.0

* ci(restapi): 🎉 cut release to restapi-v1.3.1

* ci(socket): 🎉 cut release to socket-v0.5.1

* ci(restapi): 🎉 cut release to restapi-v1.3.2

* ci(restapi): 🎉 cut release to restapi-v1.3.3

* ci(restapi): 🎉 cut release to restapi-v1.3.4

---------

Co-authored-by: aman035 <[email protected]>

* feat: space-feed

* refactor: space-feed

* fix: api-call-custom-hooks

* fix: api-call

* refactor: enums/changes

* fix: scrollable

* fix: scrolling-issue

* feat: filter-changes

* fix: added types

* fix: loader-issue

* fix: tab-button-color

* feat: new-filter and prop

* fix: ended-logic && participant-number logic

* refactor: add onBannerClick

* fix: conflicts

* revert: messed-up spaceBanner

* fix: onClick issue

* fix: onClick and cleanups

* refactor: new pagination interface

* fix: scroll-logic

* fix: scroll-final

* fix: ..

* fix: removed any

* fix: onClick-issue

* fix: loading-context-to-state

* refactor: add-NoSpaceIcons

* refactor: new-ui-layout

* refactor: new-ui-layout

---------

Co-authored-by: Mohammed S <[email protected]>
Co-authored-by: aman035 <[email protected]>
Co-authored-by: Nilesh Gupta <[email protected]>

* refactor: added structure for spaces invites modal component

* refactor: invite-component

* fix: minor-bug

* feat: Create Space API Integration (#494)

* feat: create spaces integration

* feat: added datetime picker

* feat: completed create space API integration

* feat: changed flow and time component

* feat(spaces): initiate livepeer playback in start method (#499)

* fix: add spaces for functions

* fix: Separate page for space in the demo react APP

* fix: start/stop spaces functions

* fix: fix image and description types

* fix: added functions to add and remove members from group

* fix: spaces functions

* fix: spaces functions refactoring

* fix: few more changes

* fix: spaces function testing

* fix: spaces functions

* fix: SDK bug fixes

* fix: SDK bug fixes

* fix: minor fixes

* fix: minor fix

* fix: minor fix

* feat(video): add create mesh connection logic in Video class

* feat(spaces): make video mesh compatible & add spaces class

* feat(spaces): add backend methods in Space class

* fix: Merge branch 'alpha' into 424-spaces-functions-webrtc-logic

* fix(spaces): fix console errors and move out create, update functions from Space class

* feat(spaces): initiate livepeer playback in start method

* feat(spaces): store livepeer playback id in space description

---------

Co-authored-by: Shoaib Mohammed <[email protected]>

* Add initialize method (#505)

* fix: add spaces for functions

* fix: Separate page for space in the demo react APP

* fix: start/stop spaces functions

* fix: fix image and description types

* fix: added functions to add and remove members from group

* fix: spaces functions

* fix: spaces functions refactoring

* fix: few more changes

* fix: spaces function testing

* fix: spaces functions

* fix: SDK bug fixes

* fix: SDK bug fixes

* fix: minor fixes

* fix: minor fix

* fix: minor fix

* feat(video): add create mesh connection logic in Video class

* feat(spaces): make video mesh compatible & add spaces class

* feat(spaces): add backend methods in Space class

* fix: Merge branch 'alpha' into 424-spaces-functions-webrtc-logic

* fix(spaces): fix console errors and move out create, update functions from Space class

* feat(spaces): initiate livepeer playback in start method

* feat(spaces): store livepeer playback id in space description

* feat(spaces): add intitialize method

---------

Co-authored-by: Shoaib Mohammed <[email protected]>

* refactor: resolved css in space banner

* refactor: added a skeleton loading effect on space Banner component

* feat: add invite functionality to create space (#506)

* feat: added invite functionality

* fix: add logic for time selector

* fix: css fixes

* refactor: info-on-widget (#504)

* refactor: info-on-widget

* refactor: add Space class to context

* fix: padding, added new mic icons

* fix: added-ref to context

* feat: start added

* fix: remove optional spaceId

* fix: inf-bug

* fix: effectAdded

* fix(spaces): add is supported check in start

* refactor: added-join-functionalities (#507)

* refactor: added-join-functionalities

* fix: screens

* fix(spaces): fix livepeer stream creation in start

---------

Co-authored-by: Madhur Gupta <[email protected]>

* Fix join and pgpPrivateKey in demoreact (#508)

* refactor: info-on-widget

* refactor: add Space class to context

* fix: padding, added new mic icons

* fix: added-ref to context

* feat: start added

* fix: remove optional spaceId

* fix: inf-bug

* fix: effectAdded

* fix(spaces): add is supported check in start

* refactor: added-join-functionalities

* fix: screens

* refactor: added-join-functionalities (#507)

* refactor: added-join-functionalities

* fix: screens

* fix(spaces): fix livepeer stream creation in start

* fix: join function

---------

Co-authored-by: samarendra-push <[email protected]>
Co-authored-by: Samarendra Gouda <[email protected]>

* refactor: added feature of triggering widget from sdk

* fix(spaces): fix join as speaker and listner

* fix: resolved updating env and other class variables

* Spaces/UI migration (#510)

* fix: ui-migration

* fix: migration fixes

* refactor: added notification socket for space in uiweb

* feat: add remove and admin func to invite modal (#509)

* feat: add remove and admin func to invite modal

* fix: fix null

* fix(spaces): fix start

* feat: add join functionality to invited spaces (#512)

* feat: add join functionality to invited spaces

* fix: open space widget after joining

* refactor: add audio playback from space speakers (#511)

* refactor: added a hidden Video container

* fix: migrated initSpaceObject to parent component

* feat(spaces): add user feeds socket handler logic

---------

Co-authored-by: Nilesh Gupta <[email protected]>
Co-authored-by: Arnab Chatterjee <[email protected]>
Co-authored-by: Samarendra Gouda <[email protected]>
Co-authored-by: Samarendra Gouda <[email protected]>
Co-authored-by: Shoaib Mohammed <[email protected]>
Co-authored-by: aman035 <[email protected]>
Co-authored-by: samarendra-push <[email protected]>
  • Loading branch information
8 people authored Jul 10, 2023
1 parent 942cc65 commit 6aad1b0
Show file tree
Hide file tree
Showing 176 changed files with 10,739 additions and 2,355 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -288,3 +288,4 @@ buck-out/
packages/restapi/yarn.lock
yarn.lock
*.env
**/.next
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ const AddSpeakersToSpaceTest = () => {
spaceId: spaceId,
speakers: speakerAddress ? speakerAddress.split(',') : [],
env,
account: account,
signer: librarySigner,
});
setSendResponse(response);
Expand Down
1 change: 0 additions & 1 deletion packages/demoreact/src/app/SpaceTest/CreateSpaceTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ const CreateSpaceTest = () => {
numberOfNFTs: numberOfNFTs != null ? Number(numberOfNFTs) : undefined,
contractAddressERC20,
numberOfERC20: numberOfERC20 != null ? Number(numberOfERC20) : undefined,
account: isCAIP ? walletToPCAIP10(account) : account,
signer: librarySigner,
env,
meta: meta,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ const RemoveSpeakersFromSpaceTest = () => {
spaceId: spaceId,
speakers: speakerAddress ? speakerAddress.split(',') : [],
env,
account: account,
signer: librarySigner,
});
setSendResponse(response);
Expand Down
12 changes: 6 additions & 6 deletions packages/demoreact/src/app/SpaceTest/StartSpaceTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ const StartSpaceTest = () => {
setLoading(true);
const librarySigner = await library.getSigner();

const response = await PushAPI.space.start({
spaceId: spaceId,
signer: librarySigner,
env: env,
});
setSendResponse(response);
// const response = await PushAPI.space.start({
// spaceId: spaceId,
// signer: librarySigner,
// env: env,
// });
// setSendResponse(response);

} catch (e) {
console.error(e);
Expand Down
12 changes: 6 additions & 6 deletions packages/demoreact/src/app/SpaceTest/StopSpaceTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ const StopSpaceTest = () => {
setLoading(true);
const librarySigner = await library.getSigner();

const response = await PushAPI.space.stop({
spaceId: spaceId,
signer: librarySigner,
env: env,
});
setSendResponse(response);
// const response = await PushAPI.space.stop({
// spaceId: spaceId,
// signer: librarySigner,
// env: env,
// });
// setSendResponse(response);

} catch (e) {
console.error(e);
Expand Down
5 changes: 2 additions & 3 deletions packages/demoreact/src/app/SpaceTest/UpdateSpaceTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const UpdateSpaceTest = () => {
setMembers((e.target as HTMLInputElement).value);
};


const updateAdmins= (e: React.SyntheticEvent<HTMLElement>) => {
setAdmins((e.target as HTMLInputElement).value);
};
Expand Down Expand Up @@ -81,7 +81,6 @@ const UpdateSpaceTest = () => {
spaceDescription,
members: members.split(','),
admins: admins.split(','),
account: isCAIP ? walletToPCAIP10(account) : account,
signer: librarySigner,
env,
scheduleAt: new Date(scheduleAt) ,
Expand Down Expand Up @@ -148,7 +147,7 @@ const UpdateSpaceTest = () => {
style={{ width: 400, height: 30 }}
/>
</SectionItem>

<SectionItem style={{ marginTop: 20 }}>
<label>members</label>
<input
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { useSpaceComponents } from "./useSpaceComponents"

export const CreateSpaceComponent = () => {
const { CreateSpaceComponent } = useSpaceComponents();

return <CreateSpaceComponent />
}
63 changes: 63 additions & 0 deletions packages/demoreact/src/app/SpaceUITest/SpaceBanner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import React, { useState } from 'react';

import { useSpaceComponents } from './useSpaceComponents';
import { Section, SectionItem } from '../components/StyledComponents';
import Dropdown from '../components/Dropdown';

export const SpaceBanner = () => {
const { SpaceBannerComponent } = useSpaceComponents();

const [spaceId, setSpaceId] = useState<string>('');
const [orientation, setOrientation] = useState('maximized');

const updateSpaceId = (e: React.SyntheticEvent<HTMLElement>) => {
setSpaceId((e.target as HTMLInputElement).value);
};

const updateOrientation = (e: any) => {
setOrientation(e.target.value);
};

const onClickHandler = (arg: string) => {
console.log(arg);
}

return (
<div>
<Section>
<SectionItem>
<label>spaceId</label>
<input
type="text"
onChange={updateSpaceId}
value={spaceId}
style={{ width: 400, height: 30 }}
/>
</SectionItem>
<Dropdown
label="orientation"
options={[
{ label: 'maximized', value: 'maximized' },
{ label: 'minimized', value: 'minimized' },
{ label: 'pill', value: 'pill' },
]}
value={orientation}
onChange={updateOrientation}
/>
</Section>
<SpaceBannerComponent
spaceId={spaceId}
onBannerClick={onClickHandler}
orientation={
orientation === 'maximized'
? 'maximized'
: orientation === 'minimized'
? 'minimized'
: orientation === 'pill'
? 'pill'
: undefined
}
/>
</div>
);
};
85 changes: 85 additions & 0 deletions packages/demoreact/src/app/SpaceUITest/SpaceFeed.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import React, { useState } from 'react';
import { useSpaceComponents } from './useSpaceComponents';
import { Checkbox } from '../components/Checkbox';

export const SpaceFeed = () => {
const { SpaceFeedComponent } = useSpaceComponents();
const [address, setAddress] = useState<string>();
const [showTab, setShowTab] = useState<boolean>(true);
const [horizontal, setHorizontal] = useState<boolean>(false);
const [width, setWidth] = useState<number>();
const [height, setHeight] = useState<number>(500);
const [sortingOrder, setSortingOrder] = useState<string[]>([]);

const handleShowTab = () => {
setShowTab(!showTab);
};

const handleHorizontal = () => {
setHorizontal(!horizontal);
};

const handleAddressChange = (e: React.SyntheticEvent<HTMLElement>) => {
setAddress((e.target as HTMLInputElement).value);
};

const handleWidthChange = (e: React.SyntheticEvent<HTMLElement>) => {
setWidth((e.target as HTMLInputElement).value as unknown as number);
};

const handleHeightChange = (e: React.SyntheticEvent<HTMLElement>) => {
setHeight((e.target as HTMLInputElement).value as unknown as number);
};

return (
<>
<Checkbox
id=""
label="Show Tabs"
value={showTab}
onChange={handleShowTab}
/>
<Checkbox
id=""
label="Horizontal?"
value={horizontal}
onChange={handleHorizontal}
/>
<label>Address</label>
<br />
<input
type="text"
onChange={handleAddressChange}
value={address}
style={{ width: 400, height: 30 }}
/>
<br />
<label>Width</label>
<br />
<input
type="number"
onChange={handleWidthChange}
value={width as number}
style={{ width: 400, height: 30 }}
/>
<br />
<label>Height</label>
<br />
<input
type="number"
onChange={handleHeightChange}
value={height as number}
style={{ width: 400, height: 30 }}
/>
<SpaceFeedComponent
showTabs={showTab}
orientation={horizontal ? 'horizontal' : 'vertical'}
width={width}
height={height}
onBannerClickHandler={(spaceId: string) => {
console.log('spaceId: ', spaceId);
}}
/>
</>
);
};
9 changes: 9 additions & 0 deletions packages/demoreact/src/app/SpaceUITest/SpaceInvites.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { useSpaceComponents } from "./useSpaceComponents"

export const SpaceInvitesComponent = () => {
const { SpaceInvitesComponent } = useSpaceComponents();

return (
<SpaceInvitesComponent />
)
}
52 changes: 52 additions & 0 deletions packages/demoreact/src/app/SpaceUITest/SpaceUITest.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { useState } from 'react';
import styled from 'styled-components';
import { Link } from 'react-router-dom';
import {
Section,
} from '../components/StyledComponents';
import Loader from '../components/Loader';

const SpaceUITest = () => {
const [isLoading, setIsLoading] = useState(false);

const NavMenu = styled.div`
display: flex;
flex-wrap: wrap;
gap: 30px;
justify-content: center;
@media only screen and (max-width: 900px) {
flex-direction: column;
}
`;

return (
<div>
<h2>Space UI Test page</h2>

<Loader show={isLoading} />

<Section>
<NavMenu>
<Link to="/spaceWidget" className="nav-button">
SPACES WIDGET
</Link>
<Link to="/spaceFeed" className="nav-button">
SPACES FEED
</Link>
<Link to="/spaceBanner" className="nav-button">
SPACES BANNER
</Link>
<Link to="/createSpaceUI" className="nav-button">
CREATE SPACE
</Link>
<Link to="/spaceInvites" className="nav-button">
SPACES INVITES
</Link>
</NavMenu>
</Section>
</div>
);
};

export default SpaceUITest;
Loading

0 comments on commit 6aad1b0

Please sign in to comment.