@dxos/shell 0.3.11-main.1caa3af
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +8 -0
- package/README.md +21 -0
- package/dist/lib/browser/chunk-ZSTKOCBT.mjs +10 -0
- package/dist/lib/browser/chunk-ZSTKOCBT.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -0
- package/dist/lib/browser/react.mjs +3617 -0
- package/dist/lib/browser/react.mjs.map +7 -0
- package/dist/lib/browser/testing/index.mjs +179 -0
- package/dist/lib/browser/testing/index.mjs.map +7 -0
- package/dist/types/src/components/AuthCode.d.ts +8 -0
- package/dist/types/src/components/AuthCode.d.ts.map +1 -0
- package/dist/types/src/components/AuthCode.js +26 -0
- package/dist/types/src/components/AuthCode.js.map +1 -0
- package/dist/types/src/components/Clipboard/ClipboardProvider.d.ts +9 -0
- package/dist/types/src/components/Clipboard/ClipboardProvider.d.ts.map +1 -0
- package/dist/types/src/components/Clipboard/ClipboardProvider.js +46 -0
- package/dist/types/src/components/Clipboard/ClipboardProvider.js.map +1 -0
- package/dist/types/src/components/Clipboard/CopyButton.d.ts +9 -0
- package/dist/types/src/components/Clipboard/CopyButton.d.ts.map +1 -0
- package/dist/types/src/components/Clipboard/CopyButton.js +65 -0
- package/dist/types/src/components/Clipboard/CopyButton.js.map +1 -0
- package/dist/types/src/components/Clipboard/index.d.ts +3 -0
- package/dist/types/src/components/Clipboard/index.d.ts.map +1 -0
- package/dist/types/src/components/Clipboard/index.js +22 -0
- package/dist/types/src/components/Clipboard/index.js.map +1 -0
- package/dist/types/src/components/CompoundButton/CompoundButton.d.ts +17 -0
- package/dist/types/src/components/CompoundButton/CompoundButton.d.ts.map +1 -0
- package/dist/types/src/components/CompoundButton/CompoundButton.js +29 -0
- package/dist/types/src/components/CompoundButton/CompoundButton.js.map +1 -0
- package/dist/types/src/components/CompoundButton/CompoundButton.stories.d.ts +35 -0
- package/dist/types/src/components/CompoundButton/CompoundButton.stories.d.ts.map +1 -0
- package/dist/types/src/components/CompoundButton/CompoundButton.stories.js +45 -0
- package/dist/types/src/components/CompoundButton/CompoundButton.stories.js.map +1 -0
- package/dist/types/src/components/CompoundButton/index.d.ts +2 -0
- package/dist/types/src/components/CompoundButton/index.d.ts.map +1 -0
- package/dist/types/src/components/CompoundButton/index.js +21 -0
- package/dist/types/src/components/CompoundButton/index.js.map +1 -0
- package/dist/types/src/components/IdentityList/DeviceList.d.ts +7 -0
- package/dist/types/src/components/IdentityList/DeviceList.d.ts.map +1 -0
- package/dist/types/src/components/IdentityList/DeviceList.js +29 -0
- package/dist/types/src/components/IdentityList/DeviceList.js.map +1 -0
- package/dist/types/src/components/IdentityList/IdentityListItem.d.ts +11 -0
- package/dist/types/src/components/IdentityList/IdentityListItem.d.ts.map +1 -0
- package/dist/types/src/components/IdentityList/IdentityListItem.js +47 -0
- package/dist/types/src/components/IdentityList/IdentityListItem.js.map +1 -0
- package/dist/types/src/components/IdentityList/SpaceMemberList.d.ts +13 -0
- package/dist/types/src/components/IdentityList/SpaceMemberList.d.ts.map +1 -0
- package/dist/types/src/components/IdentityList/SpaceMemberList.js +54 -0
- package/dist/types/src/components/IdentityList/SpaceMemberList.js.map +1 -0
- package/dist/types/src/components/IdentityList/SpaceMemberList.stories.d.ts +17 -0
- package/dist/types/src/components/IdentityList/SpaceMemberList.stories.d.ts.map +1 -0
- package/dist/types/src/components/IdentityList/SpaceMemberList.stories.js +26 -0
- package/dist/types/src/components/IdentityList/SpaceMemberList.stories.js.map +1 -0
- package/dist/types/src/components/IdentityList/index.d.ts +4 -0
- package/dist/types/src/components/IdentityList/index.d.ts.map +1 -0
- package/dist/types/src/components/IdentityList/index.js +23 -0
- package/dist/types/src/components/IdentityList/index.js.map +1 -0
- package/dist/types/src/components/InvitationList/InvitationList.d.ts +11 -0
- package/dist/types/src/components/InvitationList/InvitationList.d.ts.map +1 -0
- package/dist/types/src/components/InvitationList/InvitationList.js +22 -0
- package/dist/types/src/components/InvitationList/InvitationList.js.map +1 -0
- package/dist/types/src/components/InvitationList/InvitationList.stories.d.ts +17 -0
- package/dist/types/src/components/InvitationList/InvitationList.stories.d.ts.map +1 -0
- package/dist/types/src/components/InvitationList/InvitationList.stories.js +39 -0
- package/dist/types/src/components/InvitationList/InvitationList.stories.js.map +1 -0
- package/dist/types/src/components/InvitationList/InvitationListContainer.d.ts +7 -0
- package/dist/types/src/components/InvitationList/InvitationListContainer.d.ts.map +1 -0
- package/dist/types/src/components/InvitationList/InvitationListContainer.js +42 -0
- package/dist/types/src/components/InvitationList/InvitationListContainer.js.map +1 -0
- package/dist/types/src/components/InvitationList/InvitationListItem.d.ts +12 -0
- package/dist/types/src/components/InvitationList/InvitationListItem.d.ts.map +1 -0
- package/dist/types/src/components/InvitationList/InvitationListItem.js +103 -0
- package/dist/types/src/components/InvitationList/InvitationListItem.js.map +1 -0
- package/dist/types/src/components/InvitationList/InvitationListProps.d.ts +9 -0
- package/dist/types/src/components/InvitationList/InvitationListProps.d.ts.map +1 -0
- package/dist/types/src/components/InvitationList/InvitationListProps.js +3 -0
- package/dist/types/src/components/InvitationList/InvitationListProps.js.map +1 -0
- package/dist/types/src/components/InvitationList/index.d.ts +4 -0
- package/dist/types/src/components/InvitationList/index.d.ts.map +1 -0
- package/dist/types/src/components/InvitationList/index.js +23 -0
- package/dist/types/src/components/InvitationList/index.js.map +1 -0
- package/dist/types/src/components/Panel/Action.d.ts +20 -0
- package/dist/types/src/components/Panel/Action.d.ts.map +1 -0
- package/dist/types/src/components/Panel/Action.js +93 -0
- package/dist/types/src/components/Panel/Action.js.map +1 -0
- package/dist/types/src/components/Panel/Actions.d.ts +11 -0
- package/dist/types/src/components/Panel/Actions.d.ts.map +1 -0
- package/dist/types/src/components/Panel/Actions.js +36 -0
- package/dist/types/src/components/Panel/Actions.js.map +1 -0
- package/dist/types/src/components/Panel/CloseButton.d.ts +5 -0
- package/dist/types/src/components/Panel/CloseButton.d.ts.map +1 -0
- package/dist/types/src/components/Panel/CloseButton.js +21 -0
- package/dist/types/src/components/Panel/CloseButton.js.map +1 -0
- package/dist/types/src/components/Panel/Emoji.d.ts +7 -0
- package/dist/types/src/components/Panel/Emoji.d.ts.map +1 -0
- package/dist/types/src/components/Panel/Emoji.js +24 -0
- package/dist/types/src/components/Panel/Emoji.js.map +1 -0
- package/dist/types/src/components/Panel/Heading.d.ts +16 -0
- package/dist/types/src/components/Panel/Heading.d.ts.map +1 -0
- package/dist/types/src/components/Panel/Heading.js +39 -0
- package/dist/types/src/components/Panel/Heading.js.map +1 -0
- package/dist/types/src/components/Panel/Input.d.ts +11 -0
- package/dist/types/src/components/Panel/Input.d.ts.map +1 -0
- package/dist/types/src/components/Panel/Input.js +19 -0
- package/dist/types/src/components/Panel/Input.js.map +1 -0
- package/dist/types/src/components/Panel/Label.d.ts +4 -0
- package/dist/types/src/components/Panel/Label.d.ts.map +1 -0
- package/dist/types/src/components/Panel/Label.js +17 -0
- package/dist/types/src/components/Panel/Label.js.map +1 -0
- package/dist/types/src/components/Panel/Panel.stories.d.ts +13 -0
- package/dist/types/src/components/Panel/Panel.stories.d.ts.map +1 -0
- package/dist/types/src/components/Panel/Panel.stories.js +44 -0
- package/dist/types/src/components/Panel/Panel.stories.js.map +1 -0
- package/dist/types/src/components/Panel/StepHeading.d.ts +5 -0
- package/dist/types/src/components/Panel/StepHeading.d.ts.map +1 -0
- package/dist/types/src/components/Panel/StepHeading.js +35 -0
- package/dist/types/src/components/Panel/StepHeading.js.map +1 -0
- package/dist/types/src/components/Panel/index.d.ts +9 -0
- package/dist/types/src/components/Panel/index.d.ts.map +1 -0
- package/dist/types/src/components/Panel/index.js +28 -0
- package/dist/types/src/components/Panel/index.js.map +1 -0
- package/dist/types/src/components/SpaceListItem.d.ts +7 -0
- package/dist/types/src/components/SpaceListItem.d.ts.map +1 -0
- package/dist/types/src/components/SpaceListItem.js +46 -0
- package/dist/types/src/components/SpaceListItem.js.map +1 -0
- package/dist/types/src/components/StorybookDialog.d.ts +6 -0
- package/dist/types/src/components/StorybookDialog.d.ts.map +1 -0
- package/dist/types/src/components/StorybookDialog.js +23 -0
- package/dist/types/src/components/StorybookDialog.js.map +1 -0
- package/dist/types/src/components/Viewport/Viewport.d.ts +39 -0
- package/dist/types/src/components/Viewport/Viewport.d.ts.map +1 -0
- package/dist/types/src/components/Viewport/Viewport.js +73 -0
- package/dist/types/src/components/Viewport/Viewport.js.map +1 -0
- package/dist/types/src/components/Viewport/Viewport.stories.d.ts +17 -0
- package/dist/types/src/components/Viewport/Viewport.stories.d.ts.map +1 -0
- package/dist/types/src/components/Viewport/Viewport.stories.js +51 -0
- package/dist/types/src/components/Viewport/Viewport.stories.js.map +1 -0
- package/dist/types/src/components/Viewport/index.d.ts +2 -0
- package/dist/types/src/components/Viewport/index.d.ts.map +1 -0
- package/dist/types/src/components/Viewport/index.js +21 -0
- package/dist/types/src/components/Viewport/index.js.map +1 -0
- package/dist/types/src/components/index.d.ts +9 -0
- package/dist/types/src/components/index.d.ts.map +1 -0
- package/dist/types/src/components/index.js +28 -0
- package/dist/types/src/components/index.js.map +1 -0
- package/dist/types/src/composites/IdentityDialog/IdentityDialog.d.ts +7 -0
- package/dist/types/src/composites/IdentityDialog/IdentityDialog.d.ts.map +1 -0
- package/dist/types/src/composites/IdentityDialog/IdentityDialog.js +26 -0
- package/dist/types/src/composites/IdentityDialog/IdentityDialog.js.map +1 -0
- package/dist/types/src/composites/IdentityDialog/index.d.ts +2 -0
- package/dist/types/src/composites/IdentityDialog/index.d.ts.map +1 -0
- package/dist/types/src/composites/IdentityDialog/index.js +21 -0
- package/dist/types/src/composites/IdentityDialog/index.js.map +1 -0
- package/dist/types/src/composites/JoinDialog/JoinDialog.d.ts +6 -0
- package/dist/types/src/composites/JoinDialog/JoinDialog.d.ts.map +1 -0
- package/dist/types/src/composites/JoinDialog/JoinDialog.js +27 -0
- package/dist/types/src/composites/JoinDialog/JoinDialog.js.map +1 -0
- package/dist/types/src/composites/JoinDialog/index.d.ts +2 -0
- package/dist/types/src/composites/JoinDialog/index.d.ts.map +1 -0
- package/dist/types/src/composites/JoinDialog/index.js +21 -0
- package/dist/types/src/composites/JoinDialog/index.js.map +1 -0
- package/dist/types/src/composites/Shell/Shell.d.ts +6 -0
- package/dist/types/src/composites/Shell/Shell.d.ts.map +1 -0
- package/dist/types/src/composites/Shell/Shell.js +90 -0
- package/dist/types/src/composites/Shell/Shell.js.map +1 -0
- package/dist/types/src/composites/Shell/ShellContext.d.ts +30 -0
- package/dist/types/src/composites/Shell/ShellContext.d.ts.map +1 -0
- package/dist/types/src/composites/Shell/ShellContext.js +129 -0
- package/dist/types/src/composites/Shell/ShellContext.js.map +1 -0
- package/dist/types/src/composites/Shell/index.d.ts +4 -0
- package/dist/types/src/composites/Shell/index.d.ts.map +1 -0
- package/dist/types/src/composites/Shell/index.js +23 -0
- package/dist/types/src/composites/Shell/index.js.map +1 -0
- package/dist/types/src/composites/Shell/memory-shell-runtime.d.ts +16 -0
- package/dist/types/src/composites/Shell/memory-shell-runtime.d.ts.map +1 -0
- package/dist/types/src/composites/Shell/memory-shell-runtime.js +38 -0
- package/dist/types/src/composites/Shell/memory-shell-runtime.js.map +1 -0
- package/dist/types/src/composites/Shell/run-shell.d.ts +3 -0
- package/dist/types/src/composites/Shell/run-shell.d.ts.map +1 -0
- package/dist/types/src/composites/Shell/run-shell.js +54 -0
- package/dist/types/src/composites/Shell/run-shell.js.map +1 -0
- package/dist/types/src/composites/SpaceDialog/SpaceDialog.d.ts +6 -0
- package/dist/types/src/composites/SpaceDialog/SpaceDialog.d.ts.map +1 -0
- package/dist/types/src/composites/SpaceDialog/SpaceDialog.js +26 -0
- package/dist/types/src/composites/SpaceDialog/SpaceDialog.js.map +1 -0
- package/dist/types/src/composites/SpaceDialog/index.d.ts +2 -0
- package/dist/types/src/composites/SpaceDialog/index.d.ts.map +1 -0
- package/dist/types/src/composites/SpaceDialog/index.js +21 -0
- package/dist/types/src/composites/SpaceDialog/index.js.map +1 -0
- package/dist/types/src/composites/index.d.ts +5 -0
- package/dist/types/src/composites/index.d.ts.map +1 -0
- package/dist/types/src/composites/index.js +24 -0
- package/dist/types/src/composites/index.js.map +1 -0
- package/dist/types/src/index.d.ts +3 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/src/index.js +10 -0
- package/dist/types/src/index.js.map +1 -0
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.d.ts +4 -0
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.d.ts.map +1 -0
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js +124 -0
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js.map +1 -0
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.d.ts +22 -0
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.d.ts.map +1 -0
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.js +86 -0
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.js.map +1 -0
- package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.d.ts +27 -0
- package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.d.ts.map +1 -0
- package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.js +6 -0
- package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.js.map +1 -0
- package/dist/types/src/panels/IdentityPanel/identityMachine.d.ts +46 -0
- package/dist/types/src/panels/IdentityPanel/identityMachine.d.ts.map +1 -0
- package/dist/types/src/panels/IdentityPanel/identityMachine.js +79 -0
- package/dist/types/src/panels/IdentityPanel/identityMachine.js.map +1 -0
- package/dist/types/src/panels/IdentityPanel/index.d.ts +3 -0
- package/dist/types/src/panels/IdentityPanel/index.d.ts.map +1 -0
- package/dist/types/src/panels/IdentityPanel/index.js +22 -0
- package/dist/types/src/panels/IdentityPanel/index.js.map +1 -0
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.d.ts +9 -0
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.d.ts.map +1 -0
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js +85 -0
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js.map +1 -0
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.d.ts +15 -0
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.d.ts.map +1 -0
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.js +62 -0
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.js.map +1 -0
- package/dist/types/src/panels/IdentityPanel/steps/index.d.ts +3 -0
- package/dist/types/src/panels/IdentityPanel/steps/index.d.ts.map +1 -0
- package/dist/types/src/panels/IdentityPanel/steps/index.js +22 -0
- package/dist/types/src/panels/IdentityPanel/steps/index.js.map +1 -0
- package/dist/types/src/panels/JoinPanel/JoinHeading.d.ts +10 -0
- package/dist/types/src/panels/JoinPanel/JoinHeading.d.ts.map +1 -0
- package/dist/types/src/panels/JoinPanel/JoinHeading.js +45 -0
- package/dist/types/src/panels/JoinPanel/JoinHeading.js.map +1 -0
- package/dist/types/src/panels/JoinPanel/JoinPanel.d.ts +4 -0
- package/dist/types/src/panels/JoinPanel/JoinPanel.d.ts.map +1 -0
- package/dist/types/src/panels/JoinPanel/JoinPanel.js +293 -0
- package/dist/types/src/panels/JoinPanel/JoinPanel.js.map +1 -0
- package/dist/types/src/panels/JoinPanel/JoinPanel.stories.d.ts +92 -0
- package/dist/types/src/panels/JoinPanel/JoinPanel.stories.d.ts.map +1 -0
- package/dist/types/src/panels/JoinPanel/JoinPanel.stories.js +74 -0
- package/dist/types/src/panels/JoinPanel/JoinPanel.stories.js.map +1 -0
- package/dist/types/src/panels/JoinPanel/JoinPanelProps.d.ts +91 -0
- package/dist/types/src/panels/JoinPanel/JoinPanelProps.d.ts.map +1 -0
- package/dist/types/src/panels/JoinPanel/JoinPanelProps.js +6 -0
- package/dist/types/src/panels/JoinPanel/JoinPanelProps.js.map +1 -0
- package/dist/types/src/panels/JoinPanel/index.d.ts +3 -0
- package/dist/types/src/panels/JoinPanel/index.d.ts.map +1 -0
- package/dist/types/src/panels/JoinPanel/index.js +22 -0
- package/dist/types/src/panels/JoinPanel/index.js.map +1 -0
- package/dist/types/src/panels/JoinPanel/joinMachine.d.ts +87 -0
- package/dist/types/src/panels/JoinPanel/joinMachine.d.ts.map +1 -0
- package/dist/types/src/panels/JoinPanel/joinMachine.js +402 -0
- package/dist/types/src/panels/JoinPanel/joinMachine.js.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/AdditionMethodChooser.d.ts +4 -0
- package/dist/types/src/panels/JoinPanel/steps/AdditionMethodChooser.d.ts.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/AdditionMethodChooser.js +34 -0
- package/dist/types/src/panels/JoinPanel/steps/AdditionMethodChooser.js.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/IdentityAdded.d.ts +8 -0
- package/dist/types/src/panels/JoinPanel/steps/IdentityAdded.d.ts.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/IdentityAdded.js +56 -0
- package/dist/types/src/panels/JoinPanel/steps/IdentityAdded.js.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/IdentityInput.d.ts +12 -0
- package/dist/types/src/panels/JoinPanel/steps/IdentityInput.d.ts.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/IdentityInput.js +67 -0
- package/dist/types/src/panels/JoinPanel/steps/IdentityInput.js.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/InvitationAccepted.d.ts +9 -0
- package/dist/types/src/panels/JoinPanel/steps/InvitationAccepted.d.ts.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/InvitationAccepted.js +44 -0
- package/dist/types/src/panels/JoinPanel/steps/InvitationAccepted.js.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/InvitationAuthenticator.d.ts +11 -0
- package/dist/types/src/panels/JoinPanel/steps/InvitationAuthenticator.d.ts.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/InvitationAuthenticator.js +72 -0
- package/dist/types/src/panels/JoinPanel/steps/InvitationAuthenticator.js.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/InvitationInput.d.ts +8 -0
- package/dist/types/src/panels/JoinPanel/steps/InvitationInput.d.ts.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/InvitationInput.js +68 -0
- package/dist/types/src/panels/JoinPanel/steps/InvitationInput.js.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/InvitationRescuer.d.ts +11 -0
- package/dist/types/src/panels/JoinPanel/steps/InvitationRescuer.d.ts.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/InvitationRescuer.js +49 -0
- package/dist/types/src/panels/JoinPanel/steps/InvitationRescuer.js.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/ResetIdentity.d.ts +12 -0
- package/dist/types/src/panels/JoinPanel/steps/ResetIdentity.d.ts.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/ResetIdentity.js +63 -0
- package/dist/types/src/panels/JoinPanel/steps/ResetIdentity.js.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/index.d.ts +9 -0
- package/dist/types/src/panels/JoinPanel/steps/index.d.ts.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/index.js +28 -0
- package/dist/types/src/panels/JoinPanel/steps/index.js.map +1 -0
- package/dist/types/src/panels/Panels.stories.d.ts +22 -0
- package/dist/types/src/panels/Panels.stories.d.ts.map +1 -0
- package/dist/types/src/panels/Panels.stories.js +71 -0
- package/dist/types/src/panels/Panels.stories.js.map +1 -0
- package/dist/types/src/panels/SpacePanel/SpacePanel.d.ts +4 -0
- package/dist/types/src/panels/SpacePanel/SpacePanel.d.ts.map +1 -0
- package/dist/types/src/panels/SpacePanel/SpacePanel.js +93 -0
- package/dist/types/src/panels/SpacePanel/SpacePanel.js.map +1 -0
- package/dist/types/src/panels/SpacePanel/SpacePanel.stories.d.ts +30 -0
- package/dist/types/src/panels/SpacePanel/SpacePanel.stories.d.ts.map +1 -0
- package/dist/types/src/panels/SpacePanel/SpacePanel.stories.js +183 -0
- package/dist/types/src/panels/SpacePanel/SpacePanel.stories.js.map +1 -0
- package/dist/types/src/panels/SpacePanel/SpacePanelProps.d.ts +30 -0
- package/dist/types/src/panels/SpacePanel/SpacePanelProps.d.ts.map +1 -0
- package/dist/types/src/panels/SpacePanel/SpacePanelProps.js +6 -0
- package/dist/types/src/panels/SpacePanel/SpacePanelProps.js.map +1 -0
- package/dist/types/src/panels/SpacePanel/index.d.ts +3 -0
- package/dist/types/src/panels/SpacePanel/index.d.ts.map +1 -0
- package/dist/types/src/panels/SpacePanel/index.js +22 -0
- package/dist/types/src/panels/SpacePanel/index.js.map +1 -0
- package/dist/types/src/panels/SpacePanel/spaceMachine.d.ts +35 -0
- package/dist/types/src/panels/SpacePanel/spaceMachine.d.ts.map +1 -0
- package/dist/types/src/panels/SpacePanel/spaceMachine.js +46 -0
- package/dist/types/src/panels/SpacePanel/spaceMachine.js.map +1 -0
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.d.ts +15 -0
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.d.ts.map +1 -0
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.js +120 -0
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.js.map +1 -0
- package/dist/types/src/panels/SpacePanel/steps/index.d.ts +2 -0
- package/dist/types/src/panels/SpacePanel/steps/index.d.ts.map +1 -0
- package/dist/types/src/panels/SpacePanel/steps/index.js +21 -0
- package/dist/types/src/panels/SpacePanel/steps/index.js.map +1 -0
- package/dist/types/src/panels/index.d.ts +4 -0
- package/dist/types/src/panels/index.d.ts.map +1 -0
- package/dist/types/src/panels/index.js +23 -0
- package/dist/types/src/panels/index.js.map +1 -0
- package/dist/types/src/playwright/invitations-manager.d.ts +26 -0
- package/dist/types/src/playwright/invitations-manager.d.ts.map +1 -0
- package/dist/types/src/playwright/invitations-manager.js +142 -0
- package/dist/types/src/playwright/invitations-manager.js.map +1 -0
- package/dist/types/src/playwright/invitations.spec.d.ts +2 -0
- package/dist/types/src/playwright/invitations.spec.d.ts.map +1 -0
- package/dist/types/src/playwright/invitations.spec.js +298 -0
- package/dist/types/src/playwright/invitations.spec.js.map +1 -0
- package/dist/types/src/playwright/playwright.config.d.ts +3 -0
- package/dist/types/src/playwright/playwright.config.d.ts.map +1 -0
- package/dist/types/src/playwright/playwright.config.js +8 -0
- package/dist/types/src/playwright/playwright.config.js.map +1 -0
- package/dist/types/src/react.d.ts +6 -0
- package/dist/types/src/react.d.ts.map +1 -0
- package/dist/types/src/react.js +25 -0
- package/dist/types/src/react.js.map +1 -0
- package/dist/types/src/steps/InvitationManager.d.ts +7 -0
- package/dist/types/src/steps/InvitationManager.d.ts.map +1 -0
- package/dist/types/src/steps/InvitationManager.js +80 -0
- package/dist/types/src/steps/InvitationManager.js.map +1 -0
- package/dist/types/src/steps/StepProps.d.ts +14 -0
- package/dist/types/src/steps/StepProps.d.ts.map +1 -0
- package/dist/types/src/steps/StepProps.js +6 -0
- package/dist/types/src/steps/StepProps.js.map +1 -0
- package/dist/types/src/steps/index.d.ts +3 -0
- package/dist/types/src/steps/index.d.ts.map +1 -0
- package/dist/types/src/steps/index.js +22 -0
- package/dist/types/src/steps/index.js.map +1 -0
- package/dist/types/src/stories/Invitations.e2e-stories.d.ts +22 -0
- package/dist/types/src/stories/Invitations.e2e-stories.d.ts.map +1 -0
- package/dist/types/src/stories/Invitations.e2e-stories.js +146 -0
- package/dist/types/src/stories/Invitations.e2e-stories.js.map +1 -0
- package/dist/types/src/styles/index.d.ts +3 -0
- package/dist/types/src/styles/index.d.ts.map +1 -0
- package/dist/types/src/styles/index.js +22 -0
- package/dist/types/src/styles/index.js.map +1 -0
- package/dist/types/src/styles/invitationStatusStyles.d.ts +20 -0
- package/dist/types/src/styles/invitationStatusStyles.d.ts.map +1 -0
- package/dist/types/src/styles/invitationStatusStyles.js +41 -0
- package/dist/types/src/styles/invitationStatusStyles.js.map +1 -0
- package/dist/types/src/styles/panelStyles.d.ts +2 -0
- package/dist/types/src/styles/panelStyles.d.ts.map +1 -0
- package/dist/types/src/styles/panelStyles.js +8 -0
- package/dist/types/src/styles/panelStyles.js.map +1 -0
- package/dist/types/src/testing/fixtures/identities.d.ts +3 -0
- package/dist/types/src/testing/fixtures/identities.d.ts.map +1 -0
- package/dist/types/src/testing/fixtures/identities.js +18 -0
- package/dist/types/src/testing/fixtures/identities.js.map +1 -0
- package/dist/types/src/testing/fixtures/index.d.ts +3 -0
- package/dist/types/src/testing/fixtures/index.d.ts.map +1 -0
- package/dist/types/src/testing/fixtures/index.js +22 -0
- package/dist/types/src/testing/fixtures/index.js.map +1 -0
- package/dist/types/src/testing/fixtures/invitations.d.ts +3 -0
- package/dist/types/src/testing/fixtures/invitations.d.ts.map +1 -0
- package/dist/types/src/testing/fixtures/invitations.js +25 -0
- package/dist/types/src/testing/fixtures/invitations.js.map +1 -0
- package/dist/types/src/testing/index.d.ts +4 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/testing/index.js +23 -0
- package/dist/types/src/testing/index.js.map +1 -0
- package/dist/types/src/testing/scoped-shell-manager.d.ts +17 -0
- package/dist/types/src/testing/scoped-shell-manager.d.ts.map +1 -0
- package/dist/types/src/testing/scoped-shell-manager.js +71 -0
- package/dist/types/src/testing/scoped-shell-manager.js.map +1 -0
- package/dist/types/src/testing/shell-manager.d.ts +24 -0
- package/dist/types/src/testing/shell-manager.d.ts.map +1 -0
- package/dist/types/src/testing/shell-manager.js +85 -0
- package/dist/types/src/testing/shell-manager.js.map +1 -0
- package/dist/types/src/translations/index.d.ts +5 -0
- package/dist/types/src/translations/index.d.ts.map +1 -0
- package/dist/types/src/translations/index.js +32 -0
- package/dist/types/src/translations/index.js.map +1 -0
- package/dist/types/src/translations/locales/en-US.d.ts +97 -0
- package/dist/types/src/translations/locales/en-US.d.ts.map +1 -0
- package/dist/types/src/translations/locales/en-US.js +103 -0
- package/dist/types/src/translations/locales/en-US.js.map +1 -0
- package/dist/types/src/types/FailReason.d.ts +2 -0
- package/dist/types/src/types/FailReason.d.ts.map +1 -0
- package/dist/types/src/types/FailReason.js +6 -0
- package/dist/types/src/types/FailReason.js.map +1 -0
- package/dist/types/src/types/IInvitation.d.ts +7 -0
- package/dist/types/src/types/IInvitation.d.ts.map +1 -0
- package/dist/types/src/types/IInvitation.js +6 -0
- package/dist/types/src/types/IInvitation.js.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/src/types/index.js +22 -0
- package/dist/types/src/types/index.js.map +1 -0
- package/dist/types/src/util/index.d.ts +3 -0
- package/dist/types/src/util/index.d.ts.map +1 -0
- package/dist/types/src/util/index.js +22 -0
- package/dist/types/src/util/index.js.map +1 -0
- package/dist/types/src/util/invitationStatusValue.d.ts +8 -0
- package/dist/types/src/util/invitationStatusValue.d.ts.map +1 -0
- package/dist/types/src/util/invitationStatusValue.js +24 -0
- package/dist/types/src/util/invitationStatusValue.js.map +1 -0
- package/dist/types/src/util/toEmoji.d.ts +2 -0
- package/dist/types/src/util/toEmoji.d.ts.map +1 -0
- package/dist/types/src/util/toEmoji.js +26 -0
- package/dist/types/src/util/toEmoji.js.map +1 -0
- package/package.json +79 -0
- package/src/components/AuthCode.tsx +36 -0
- package/src/components/Clipboard/ClipboardProvider.tsx +26 -0
- package/src/components/Clipboard/CopyButton.tsx +70 -0
- package/src/components/Clipboard/index.ts +6 -0
- package/src/components/CompoundButton/CompoundButton.stories.tsx +49 -0
- package/src/components/CompoundButton/CompoundButton.tsx +89 -0
- package/src/components/CompoundButton/index.ts +5 -0
- package/src/components/IdentityList/DeviceList.tsx +45 -0
- package/src/components/IdentityList/IdentityListItem.tsx +42 -0
- package/src/components/IdentityList/SpaceMemberList.stories.tsx +24 -0
- package/src/components/IdentityList/SpaceMemberList.tsx +65 -0
- package/src/components/IdentityList/index.ts +7 -0
- package/src/components/InvitationList/InvitationList.stories.tsx +44 -0
- package/src/components/InvitationList/InvitationList.tsx +31 -0
- package/src/components/InvitationList/InvitationListContainer.tsx +27 -0
- package/src/components/InvitationList/InvitationListItem.tsx +183 -0
- package/src/components/InvitationList/InvitationListProps.ts +9 -0
- package/src/components/InvitationList/index.ts +7 -0
- package/src/components/Panel/Action.tsx +142 -0
- package/src/components/Panel/Actions.tsx +31 -0
- package/src/components/Panel/CloseButton.tsx +24 -0
- package/src/components/Panel/Emoji.tsx +36 -0
- package/src/components/Panel/Heading.tsx +32 -0
- package/src/components/Panel/Input.tsx +27 -0
- package/src/components/Panel/Label.tsx +14 -0
- package/src/components/Panel/Panel.stories.tsx +52 -0
- package/src/components/Panel/StepHeading.tsx +17 -0
- package/src/components/Panel/index.ts +12 -0
- package/src/components/SpaceListItem.tsx +35 -0
- package/src/components/StorybookDialog.tsx +33 -0
- package/src/components/Viewport/Viewport.stories.tsx +66 -0
- package/src/components/Viewport/Viewport.tsx +120 -0
- package/src/components/Viewport/index.tsx +5 -0
- package/src/components/index.ts +12 -0
- package/src/composites/IdentityDialog/IdentityDialog.tsx +39 -0
- package/src/composites/IdentityDialog/index.ts +5 -0
- package/src/composites/JoinDialog/JoinDialog.tsx +40 -0
- package/src/composites/JoinDialog/index.ts +5 -0
- package/src/composites/Shell/Shell.tsx +98 -0
- package/src/composites/Shell/ShellContext.tsx +163 -0
- package/src/composites/Shell/index.ts +7 -0
- package/src/composites/Shell/memory-shell-runtime.ts +50 -0
- package/src/composites/Shell/run-shell.tsx +38 -0
- package/src/composites/SpaceDialog/SpaceDialog.tsx +37 -0
- package/src/composites/SpaceDialog/index.ts +5 -0
- package/src/composites/index.ts +8 -0
- package/src/index.ts +7 -0
- package/src/panels/IdentityPanel/IdentityPanel.stories.tsx +113 -0
- package/src/panels/IdentityPanel/IdentityPanel.tsx +158 -0
- package/src/panels/IdentityPanel/IdentityPanelProps.ts +36 -0
- package/src/panels/IdentityPanel/identityMachine.ts +131 -0
- package/src/panels/IdentityPanel/index.ts +6 -0
- package/src/panels/IdentityPanel/steps/IdentityActionChooser.tsx +96 -0
- package/src/panels/IdentityPanel/steps/ProfileForm.tsx +79 -0
- package/src/panels/IdentityPanel/steps/index.ts +6 -0
- package/src/panels/JoinPanel/JoinHeading.tsx +49 -0
- package/src/panels/JoinPanel/JoinPanel.stories.tsx +91 -0
- package/src/panels/JoinPanel/JoinPanel.tsx +415 -0
- package/src/panels/JoinPanel/JoinPanelProps.ts +132 -0
- package/src/panels/JoinPanel/index.ts +6 -0
- package/src/panels/JoinPanel/joinMachine.ts +536 -0
- package/src/panels/JoinPanel/steps/AdditionMethodChooser.tsx +65 -0
- package/src/panels/JoinPanel/steps/IdentityAdded.tsx +75 -0
- package/src/panels/JoinPanel/steps/IdentityInput.tsx +86 -0
- package/src/panels/JoinPanel/steps/InvitationAccepted.tsx +43 -0
- package/src/panels/JoinPanel/steps/InvitationAuthenticator.tsx +99 -0
- package/src/panels/JoinPanel/steps/InvitationInput.tsx +102 -0
- package/src/panels/JoinPanel/steps/InvitationRescuer.tsx +102 -0
- package/src/panels/JoinPanel/steps/ResetIdentity.tsx +71 -0
- package/src/panels/JoinPanel/steps/index.ts +12 -0
- package/src/panels/Panels.stories.tsx +61 -0
- package/src/panels/SpacePanel/SpacePanel.stories.tsx +328 -0
- package/src/panels/SpacePanel/SpacePanel.tsx +122 -0
- package/src/panels/SpacePanel/SpacePanelProps.ts +40 -0
- package/src/panels/SpacePanel/index.ts +6 -0
- package/src/panels/SpacePanel/spaceMachine.ts +72 -0
- package/src/panels/SpacePanel/steps/SpaceManager.tsx +157 -0
- package/src/panels/SpacePanel/steps/index.ts +5 -0
- package/src/panels/index.ts +7 -0
- package/src/playwright/invitations-manager.ts +168 -0
- package/src/playwright/invitations.spec.ts +364 -0
- package/src/playwright/playwright.config.ts +7 -0
- package/src/react.ts +9 -0
- package/src/steps/InvitationManager.tsx +116 -0
- package/src/steps/StepProps.ts +17 -0
- package/src/steps/index.ts +6 -0
- package/src/stories/Invitations.e2e-stories.tsx +231 -0
- package/src/styles/index.ts +6 -0
- package/src/styles/invitationStatusStyles.ts +42 -0
- package/src/styles/panelStyles.ts +5 -0
- package/src/testing/fixtures/identities.ts +16 -0
- package/src/testing/fixtures/index.ts +6 -0
- package/src/testing/fixtures/invitations.ts +23 -0
- package/src/testing/index.ts +7 -0
- package/src/testing/scoped-shell-manager.ts +79 -0
- package/src/testing/shell-manager.ts +102 -0
- package/src/translations/index.ts +7 -0
- package/src/translations/locales/en-US.ts +101 -0
- package/src/types/FailReason.ts +5 -0
- package/src/types/IInvitation.ts +14 -0
- package/src/types/index.ts +6 -0
- package/src/util/index.ts +6 -0
- package/src/util/invitationStatusValue.ts +22 -0
- package/src/util/toEmoji.ts +22 -0
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import '@dxosTheme';
|
|
6
|
+
|
|
7
|
+
import React from 'react';
|
|
8
|
+
|
|
9
|
+
import { PublicKey } from '@dxos/keys';
|
|
10
|
+
import { SpaceMember } from '@dxos/react-client/echo';
|
|
11
|
+
import { Invitation } from '@dxos/react-client/invitations';
|
|
12
|
+
import { withTheme } from '@dxos/storybook-utils';
|
|
13
|
+
|
|
14
|
+
import { SpacePanelImpl } from './SpacePanel';
|
|
15
|
+
import { type SpacePanelImplProps } from './SpacePanelProps';
|
|
16
|
+
import { SpaceManagerImpl } from './steps';
|
|
17
|
+
import { InvitationListItemImpl, SpaceMemberListImpl, InvitationList } from '../../components';
|
|
18
|
+
import { StorybookDialog } from '../../components/StorybookDialog';
|
|
19
|
+
import { InvitationManager, type InvitationManagerProps } from '../../steps';
|
|
20
|
+
import { inviteWithState } from '../../testing';
|
|
21
|
+
|
|
22
|
+
const noOpProps: SpacePanelImplProps = {
|
|
23
|
+
titleId: 'storybookSpacePanel__title',
|
|
24
|
+
send: () => {},
|
|
25
|
+
createInvitationUrl: (code: string) => code,
|
|
26
|
+
activeView: 'space manager',
|
|
27
|
+
space: { key: PublicKey.random(), properties: { name: 'Example space' } },
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default {
|
|
31
|
+
title: 'react-shell/SpacePanel',
|
|
32
|
+
component: SpacePanelImpl,
|
|
33
|
+
decorators: [withTheme],
|
|
34
|
+
parameters: { chromatic: { disableSnapshot: false } },
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const SpaceManager = () => {
|
|
38
|
+
return (
|
|
39
|
+
<StorybookDialog inOverlayLayout>
|
|
40
|
+
<SpacePanelImpl
|
|
41
|
+
{...noOpProps}
|
|
42
|
+
activeView='space manager'
|
|
43
|
+
SpaceManager={(props) => {
|
|
44
|
+
return (
|
|
45
|
+
<SpaceManagerImpl
|
|
46
|
+
{...props}
|
|
47
|
+
invitations={[]}
|
|
48
|
+
SpaceMemberList={(props) => <SpaceMemberListImpl {...props} members={[]} />}
|
|
49
|
+
/>
|
|
50
|
+
);
|
|
51
|
+
}}
|
|
52
|
+
/>
|
|
53
|
+
</StorybookDialog>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const SpaceManagerWithInvites = () => {
|
|
58
|
+
return (
|
|
59
|
+
<StorybookDialog inOverlayLayout>
|
|
60
|
+
<SpacePanelImpl
|
|
61
|
+
{...noOpProps}
|
|
62
|
+
activeView='space manager'
|
|
63
|
+
SpaceManager={(props) => {
|
|
64
|
+
return (
|
|
65
|
+
<SpaceManagerImpl
|
|
66
|
+
{...props}
|
|
67
|
+
invitations={[inviteWithState(Invitation.State.INIT)]}
|
|
68
|
+
SpaceMemberList={(props) => <SpaceMemberListImpl {...props} members={[]} />}
|
|
69
|
+
/>
|
|
70
|
+
);
|
|
71
|
+
}}
|
|
72
|
+
/>
|
|
73
|
+
</StorybookDialog>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const SpaceManagerWithMoreInvites = () => {
|
|
78
|
+
return (
|
|
79
|
+
<StorybookDialog inOverlayLayout>
|
|
80
|
+
<SpacePanelImpl
|
|
81
|
+
{...noOpProps}
|
|
82
|
+
activeView='space manager'
|
|
83
|
+
SpaceManager={(props) => {
|
|
84
|
+
return (
|
|
85
|
+
<SpaceManagerImpl
|
|
86
|
+
{...props}
|
|
87
|
+
invitations={[
|
|
88
|
+
inviteWithState(Invitation.State.INIT),
|
|
89
|
+
inviteWithState(Invitation.State.CONNECTING),
|
|
90
|
+
inviteWithState(Invitation.State.CONNECTED),
|
|
91
|
+
]}
|
|
92
|
+
SpaceMemberList={(props) => <SpaceMemberListImpl {...props} members={[]} />}
|
|
93
|
+
/>
|
|
94
|
+
);
|
|
95
|
+
}}
|
|
96
|
+
/>
|
|
97
|
+
</StorybookDialog>
|
|
98
|
+
);
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export const SpaceManagerWithEvenMoreInvites = () => {
|
|
102
|
+
return (
|
|
103
|
+
<StorybookDialog inOverlayLayout>
|
|
104
|
+
<SpacePanelImpl
|
|
105
|
+
{...noOpProps}
|
|
106
|
+
activeView='space manager'
|
|
107
|
+
SpaceManager={(props) => {
|
|
108
|
+
return (
|
|
109
|
+
<SpaceManagerImpl
|
|
110
|
+
{...props}
|
|
111
|
+
invitations={[
|
|
112
|
+
inviteWithState(Invitation.State.INIT),
|
|
113
|
+
inviteWithState(Invitation.State.READY_FOR_AUTHENTICATION),
|
|
114
|
+
inviteWithState(Invitation.State.AUTHENTICATING),
|
|
115
|
+
inviteWithState(Invitation.State.SUCCESS),
|
|
116
|
+
inviteWithState(Invitation.State.ERROR),
|
|
117
|
+
inviteWithState(Invitation.State.TIMEOUT),
|
|
118
|
+
inviteWithState(Invitation.State.CANCELLED),
|
|
119
|
+
]}
|
|
120
|
+
InvitationList={(props) => (
|
|
121
|
+
<InvitationList
|
|
122
|
+
{...props}
|
|
123
|
+
InvitationListItem={(props) => {
|
|
124
|
+
const invitation = props.invitation.get();
|
|
125
|
+
const {
|
|
126
|
+
authMethod,
|
|
127
|
+
invitationId: id,
|
|
128
|
+
state,
|
|
129
|
+
identityKey = PublicKey.random(),
|
|
130
|
+
swarmKey,
|
|
131
|
+
spaceKey = PublicKey.random(),
|
|
132
|
+
} = invitation;
|
|
133
|
+
return (
|
|
134
|
+
<InvitationListItemImpl
|
|
135
|
+
{...props}
|
|
136
|
+
createInvitationUrl={(code) => code}
|
|
137
|
+
invitationStatus={{
|
|
138
|
+
status: state,
|
|
139
|
+
authMethod,
|
|
140
|
+
invitationCode: id,
|
|
141
|
+
authCode: state === Invitation.State.READY_FOR_AUTHENTICATION ? '123414' : undefined,
|
|
142
|
+
id,
|
|
143
|
+
result: { identityKey, swarmKey, spaceKey },
|
|
144
|
+
cancel: () => {},
|
|
145
|
+
authenticate: async (authCode: string) => {},
|
|
146
|
+
connect: () => {},
|
|
147
|
+
}}
|
|
148
|
+
/>
|
|
149
|
+
);
|
|
150
|
+
}}
|
|
151
|
+
/>
|
|
152
|
+
)}
|
|
153
|
+
SpaceMemberList={(props) => <SpaceMemberListImpl {...props} members={[]} />}
|
|
154
|
+
/>
|
|
155
|
+
);
|
|
156
|
+
}}
|
|
157
|
+
/>
|
|
158
|
+
</StorybookDialog>
|
|
159
|
+
);
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
export const SpaceManagerWithMember = () => {
|
|
163
|
+
return (
|
|
164
|
+
<StorybookDialog inOverlayLayout>
|
|
165
|
+
<SpacePanelImpl
|
|
166
|
+
{...noOpProps}
|
|
167
|
+
activeView='space manager'
|
|
168
|
+
SpaceManager={(props) => {
|
|
169
|
+
return (
|
|
170
|
+
<SpaceManagerImpl
|
|
171
|
+
{...props}
|
|
172
|
+
invitations={[]}
|
|
173
|
+
SpaceMemberList={(props) => (
|
|
174
|
+
<SpaceMemberListImpl
|
|
175
|
+
{...props}
|
|
176
|
+
members={[
|
|
177
|
+
{
|
|
178
|
+
presence: SpaceMember.PresenceState.ONLINE,
|
|
179
|
+
identity: {
|
|
180
|
+
identityKey: PublicKey.random(),
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
]}
|
|
184
|
+
/>
|
|
185
|
+
)}
|
|
186
|
+
/>
|
|
187
|
+
);
|
|
188
|
+
}}
|
|
189
|
+
/>
|
|
190
|
+
</StorybookDialog>
|
|
191
|
+
);
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
export const SpaceManagerWithMembers = () => {
|
|
195
|
+
return (
|
|
196
|
+
<StorybookDialog inOverlayLayout>
|
|
197
|
+
<SpacePanelImpl
|
|
198
|
+
{...noOpProps}
|
|
199
|
+
activeView='space manager'
|
|
200
|
+
SpaceManager={(props) => {
|
|
201
|
+
return (
|
|
202
|
+
<SpaceManagerImpl
|
|
203
|
+
{...props}
|
|
204
|
+
invitations={[]}
|
|
205
|
+
SpaceMemberList={(props) => (
|
|
206
|
+
<SpaceMemberListImpl
|
|
207
|
+
{...props}
|
|
208
|
+
members={[
|
|
209
|
+
{
|
|
210
|
+
presence: SpaceMember.PresenceState.ONLINE,
|
|
211
|
+
identity: {
|
|
212
|
+
identityKey: PublicKey.random(),
|
|
213
|
+
profile: {
|
|
214
|
+
displayName: 'John Doe',
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
]}
|
|
219
|
+
/>
|
|
220
|
+
)}
|
|
221
|
+
/>
|
|
222
|
+
);
|
|
223
|
+
}}
|
|
224
|
+
/>
|
|
225
|
+
</StorybookDialog>
|
|
226
|
+
);
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
export const SpaceManagerWithMoreMembers = () => {
|
|
230
|
+
return (
|
|
231
|
+
<StorybookDialog inOverlayLayout>
|
|
232
|
+
<SpacePanelImpl
|
|
233
|
+
{...noOpProps}
|
|
234
|
+
activeView='space manager'
|
|
235
|
+
SpaceManager={(props) => {
|
|
236
|
+
return (
|
|
237
|
+
<SpaceManagerImpl
|
|
238
|
+
{...props}
|
|
239
|
+
invitations={[
|
|
240
|
+
inviteWithState(Invitation.State.SUCCESS),
|
|
241
|
+
inviteWithState(Invitation.State.READY_FOR_AUTHENTICATION),
|
|
242
|
+
inviteWithState(Invitation.State.AUTHENTICATING),
|
|
243
|
+
]}
|
|
244
|
+
SpaceMemberList={(props) => (
|
|
245
|
+
<SpaceMemberListImpl
|
|
246
|
+
{...props}
|
|
247
|
+
members={[
|
|
248
|
+
{
|
|
249
|
+
presence: SpaceMember.PresenceState.ONLINE,
|
|
250
|
+
identity: {
|
|
251
|
+
identityKey: PublicKey.random(),
|
|
252
|
+
profile: {
|
|
253
|
+
displayName: 'John Doe',
|
|
254
|
+
},
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
presence: SpaceMember.PresenceState.OFFLINE,
|
|
259
|
+
identity: {
|
|
260
|
+
identityKey: PublicKey.random(),
|
|
261
|
+
profile: {
|
|
262
|
+
displayName: 'Alice Wong',
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
presence: SpaceMember.PresenceState.OFFLINE,
|
|
268
|
+
identity: {
|
|
269
|
+
identityKey: PublicKey.random(),
|
|
270
|
+
profile: {
|
|
271
|
+
displayName: 'Steel Nickels',
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
},
|
|
275
|
+
]}
|
|
276
|
+
/>
|
|
277
|
+
)}
|
|
278
|
+
/>
|
|
279
|
+
);
|
|
280
|
+
}}
|
|
281
|
+
/>
|
|
282
|
+
</StorybookDialog>
|
|
283
|
+
);
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
const SpaceInvitationManagerState = (extraprops?: Partial<InvitationManagerProps>) => {
|
|
287
|
+
return (
|
|
288
|
+
<StorybookDialog inOverlayLayout>
|
|
289
|
+
<SpacePanelImpl
|
|
290
|
+
{...noOpProps}
|
|
291
|
+
activeView='space invitation manager'
|
|
292
|
+
SpaceManager={(props) => {
|
|
293
|
+
return (
|
|
294
|
+
<SpaceManagerImpl
|
|
295
|
+
{...props}
|
|
296
|
+
invitations={[]}
|
|
297
|
+
SpaceMemberList={(props) => <SpaceMemberListImpl {...props} members={[]} />}
|
|
298
|
+
/>
|
|
299
|
+
);
|
|
300
|
+
}}
|
|
301
|
+
InvitationManager={(props) => <InvitationManager {...props} {...extraprops} />}
|
|
302
|
+
/>
|
|
303
|
+
</StorybookDialog>
|
|
304
|
+
);
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
export const SpaceInvitationManagerInit = () => SpaceInvitationManagerState({ status: Invitation.State.INIT, id: '0' });
|
|
308
|
+
|
|
309
|
+
export const SpaceInvitationManagerConnecting = () =>
|
|
310
|
+
SpaceInvitationManagerState({ status: Invitation.State.CONNECTING, id: '1' });
|
|
311
|
+
|
|
312
|
+
export const SpaceInvitationManagerConnected = () =>
|
|
313
|
+
SpaceInvitationManagerState({ status: Invitation.State.CONNECTED, id: '2' });
|
|
314
|
+
|
|
315
|
+
export const SpaceInvitationManagerReadyForAuthentication = () =>
|
|
316
|
+
SpaceInvitationManagerState({ status: Invitation.State.READY_FOR_AUTHENTICATION, authCode: '123451', id: '3' });
|
|
317
|
+
|
|
318
|
+
export const SpaceInvitationManagerAuthenticating = () =>
|
|
319
|
+
SpaceInvitationManagerState({ status: Invitation.State.AUTHENTICATING, id: '4' });
|
|
320
|
+
|
|
321
|
+
export const SpaceInvitationManagerSuccess = () => SpaceInvitationManagerState({ status: Invitation.State.SUCCESS });
|
|
322
|
+
|
|
323
|
+
export const SpaceInvitationManagerError = () => SpaceInvitationManagerState({ status: Invitation.State.ERROR });
|
|
324
|
+
|
|
325
|
+
export const SpaceInvitationManagerTimeout = () => SpaceInvitationManagerState({ status: Invitation.State.TIMEOUT });
|
|
326
|
+
|
|
327
|
+
export const SpaceInvitationManagerCancelled = () =>
|
|
328
|
+
SpaceInvitationManagerState({ status: Invitation.State.CANCELLED });
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Planet } from '@phosphor-icons/react';
|
|
6
|
+
import React, { useEffect, useMemo } from 'react';
|
|
7
|
+
|
|
8
|
+
import { log } from '@dxos/log';
|
|
9
|
+
import { useInvitationStatus } from '@dxos/react-client/invitations';
|
|
10
|
+
import type { CancellableInvitationObservable } from '@dxos/react-client/invitations';
|
|
11
|
+
import { DensityProvider, useId, useTranslation } from '@dxos/react-ui';
|
|
12
|
+
|
|
13
|
+
import { type SpacePanelHeadingProps, type SpacePanelImplProps, type SpacePanelProps } from './SpacePanelProps';
|
|
14
|
+
import { useSpaceMachine } from './spaceMachine';
|
|
15
|
+
import { SpaceManager } from './steps';
|
|
16
|
+
import { Heading, CloseButton, Viewport } from '../../components';
|
|
17
|
+
import { InvitationManager } from '../../steps';
|
|
18
|
+
import { stepStyles } from '../../styles';
|
|
19
|
+
|
|
20
|
+
const SpacePanelHeading = ({ titleId, space, onDone }: SpacePanelHeadingProps) => {
|
|
21
|
+
const { t } = useTranslation('os');
|
|
22
|
+
const name = space.properties.name;
|
|
23
|
+
return (
|
|
24
|
+
<Heading
|
|
25
|
+
titleId={titleId}
|
|
26
|
+
title={t('space panel heading')}
|
|
27
|
+
corner={<CloseButton data-testid='identity-panel-done' onDone={onDone} />}
|
|
28
|
+
>
|
|
29
|
+
<div role='none' className='flex gap-4 items-center justify-center mlb-4'>
|
|
30
|
+
<Planet size={32} />
|
|
31
|
+
<div className='block text-start font-light text-xl'>{name ?? space.key.truncate()}</div>
|
|
32
|
+
</div>
|
|
33
|
+
</Heading>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const SpacePanelImpl = (props: SpacePanelImplProps) => {
|
|
38
|
+
const {
|
|
39
|
+
titleId,
|
|
40
|
+
activeView,
|
|
41
|
+
space,
|
|
42
|
+
SpaceManager: SpaceManagerComponent = SpaceManager,
|
|
43
|
+
InvitationManager: InvitationManagerComponent = InvitationManager,
|
|
44
|
+
...rest
|
|
45
|
+
} = props;
|
|
46
|
+
return (
|
|
47
|
+
<DensityProvider density='fine'>
|
|
48
|
+
<SpacePanelHeading {...rest} {...{ titleId, space }} />
|
|
49
|
+
<Viewport.Root activeView={activeView}>
|
|
50
|
+
<Viewport.Views>
|
|
51
|
+
<Viewport.View id='space manager' classNames={stepStyles}>
|
|
52
|
+
<SpaceManagerComponent active={activeView === 'space manager'} space={space} {...rest} />
|
|
53
|
+
</Viewport.View>
|
|
54
|
+
<Viewport.View id='space invitation manager' classNames={stepStyles}>
|
|
55
|
+
<InvitationManagerComponent
|
|
56
|
+
active={activeView === 'space invitation manager'}
|
|
57
|
+
{...rest}
|
|
58
|
+
invitationUrl={props.invitationUrl}
|
|
59
|
+
/>
|
|
60
|
+
</Viewport.View>
|
|
61
|
+
</Viewport.Views>
|
|
62
|
+
</Viewport.Root>
|
|
63
|
+
</DensityProvider>
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const SpacePanelWithInvitationImpl = ({
|
|
68
|
+
invitation,
|
|
69
|
+
...props
|
|
70
|
+
}: SpacePanelImplProps & { invitation: CancellableInvitationObservable }) => {
|
|
71
|
+
const invitationStatus = useInvitationStatus(invitation);
|
|
72
|
+
return (
|
|
73
|
+
<SpacePanelImpl
|
|
74
|
+
{...props}
|
|
75
|
+
{...invitationStatus}
|
|
76
|
+
invitationUrl={props.createInvitationUrl(invitationStatus.invitationCode!)}
|
|
77
|
+
/>
|
|
78
|
+
);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export const SpacePanel = ({
|
|
82
|
+
titleId: propsTitleId,
|
|
83
|
+
createInvitationUrl = (code) => code,
|
|
84
|
+
...props
|
|
85
|
+
}: SpacePanelProps) => {
|
|
86
|
+
const titleId = useId('spacePanel__heading', propsTitleId);
|
|
87
|
+
|
|
88
|
+
const [spaceState, spaceSend, spaceService] = useSpaceMachine({ context: { space: props.space } });
|
|
89
|
+
|
|
90
|
+
useEffect(() => {
|
|
91
|
+
const subscription = spaceService.subscribe((state) => {
|
|
92
|
+
log('[state]', state);
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
return subscription.unsubscribe;
|
|
96
|
+
}, [spaceService]);
|
|
97
|
+
|
|
98
|
+
const activeView = useMemo(() => {
|
|
99
|
+
switch (true) {
|
|
100
|
+
case spaceState.matches('managingSpace'):
|
|
101
|
+
return 'space manager';
|
|
102
|
+
case spaceState.matches('managingSpaceInvitation'):
|
|
103
|
+
return 'space invitation manager';
|
|
104
|
+
default:
|
|
105
|
+
return 'never';
|
|
106
|
+
}
|
|
107
|
+
}, [spaceState]);
|
|
108
|
+
|
|
109
|
+
const implProps = {
|
|
110
|
+
...props,
|
|
111
|
+
activeView,
|
|
112
|
+
send: spaceSend,
|
|
113
|
+
titleId,
|
|
114
|
+
createInvitationUrl,
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
return spaceState.context.invitation ? (
|
|
118
|
+
<SpacePanelWithInvitationImpl {...implProps} invitation={spaceState.context.invitation} />
|
|
119
|
+
) : (
|
|
120
|
+
<SpacePanelImpl {...implProps} />
|
|
121
|
+
);
|
|
122
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type cloneElement } from 'react';
|
|
6
|
+
import { type SingleOrArray, type Event } from 'xstate';
|
|
7
|
+
|
|
8
|
+
import { type Space } from '@dxos/react-client/echo';
|
|
9
|
+
|
|
10
|
+
import { type SpaceManagerProps } from './steps';
|
|
11
|
+
import { type InvitationManagerProps } from '../../steps';
|
|
12
|
+
|
|
13
|
+
export type ErsatzSpace = Pick<Space, 'key'> & Partial<Pick<Space, 'share'>> & { properties: { name?: string } };
|
|
14
|
+
|
|
15
|
+
export type SpacePanelImplProps = {
|
|
16
|
+
titleId: string;
|
|
17
|
+
activeView: string;
|
|
18
|
+
send: (event: SingleOrArray<Event<any>>) => void;
|
|
19
|
+
createInvitationUrl: (invitationCode: string) => string;
|
|
20
|
+
space: ErsatzSpace | Space;
|
|
21
|
+
invitationUrl?: string;
|
|
22
|
+
authCode?: string;
|
|
23
|
+
onDone?: () => void;
|
|
24
|
+
doneActionParent?: Parameters<typeof cloneElement>[0];
|
|
25
|
+
DoneAction?: React.FC;
|
|
26
|
+
SpaceManager?: React.FC<SpaceManagerProps>;
|
|
27
|
+
InvitationManager?: React.FC<InvitationManagerProps>;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export type SpacePanelProps = Pick<SpacePanelImplProps, 'space'> &
|
|
31
|
+
Partial<Omit<SpacePanelImplProps, 'send' | 'activeView' | 'space'>>;
|
|
32
|
+
|
|
33
|
+
export type SpacePanelHeadingProps = Pick<SpacePanelImplProps, 'titleId' | 'space' | 'onDone' | 'doneActionParent'>;
|
|
34
|
+
|
|
35
|
+
export type SpacePanelStepProps = Pick<
|
|
36
|
+
SpacePanelImplProps,
|
|
37
|
+
'space' | 'createInvitationUrl' | 'send' | 'onDone' | 'doneActionParent' | 'DoneAction'
|
|
38
|
+
> & {
|
|
39
|
+
active?: boolean;
|
|
40
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { useMachine } from '@xstate/react';
|
|
6
|
+
import { assign, createMachine, type InterpreterFrom, type StateFrom } from 'xstate';
|
|
7
|
+
|
|
8
|
+
import { log } from '@dxos/log';
|
|
9
|
+
import { type Space } from '@dxos/react-client/echo';
|
|
10
|
+
import { type CancellableInvitationObservable } from '@dxos/react-client/invitations';
|
|
11
|
+
|
|
12
|
+
import { type ErsatzSpace } from './SpacePanelProps';
|
|
13
|
+
import { type StepEvent } from '../../steps';
|
|
14
|
+
|
|
15
|
+
type SpaceMachineContext = {
|
|
16
|
+
invitation?: CancellableInvitationObservable;
|
|
17
|
+
space: ErsatzSpace | Space | null;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
type SpaceSelectInvitationEvent = {
|
|
21
|
+
type: 'selectInvitation';
|
|
22
|
+
invitation: CancellableInvitationObservable;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
type SpaceEvent = SpaceSelectInvitationEvent | StepEvent;
|
|
26
|
+
|
|
27
|
+
const spaceMachine = createMachine<SpaceMachineContext, SpaceEvent>(
|
|
28
|
+
{
|
|
29
|
+
id: 'space',
|
|
30
|
+
predictableActionArguments: true,
|
|
31
|
+
context: {
|
|
32
|
+
space: null,
|
|
33
|
+
},
|
|
34
|
+
initial: 'managingSpace',
|
|
35
|
+
states: {
|
|
36
|
+
managingSpace: {},
|
|
37
|
+
managingSpaceInvitation: {},
|
|
38
|
+
},
|
|
39
|
+
on: {
|
|
40
|
+
deselectInvitation: { target: '.managingSpace', actions: ['unsetInvitation', 'log'] },
|
|
41
|
+
selectInvitation: { target: '.managingSpaceInvitation', actions: ['setInvitation', 'log'] },
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
actions: {
|
|
46
|
+
setInvitation: assign<SpaceMachineContext, SpaceEvent>({
|
|
47
|
+
invitation: (context, event) => (event as SpaceSelectInvitationEvent)?.invitation ?? null,
|
|
48
|
+
}),
|
|
49
|
+
unsetInvitation: assign<SpaceMachineContext, SpaceEvent>({
|
|
50
|
+
invitation: () => undefined,
|
|
51
|
+
}),
|
|
52
|
+
log: (context, event) => {
|
|
53
|
+
log('[transition]', {
|
|
54
|
+
event,
|
|
55
|
+
context,
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
type SpaceMachine = typeof spaceMachine;
|
|
63
|
+
|
|
64
|
+
type SpaceState = StateFrom<SpaceMachine>;
|
|
65
|
+
type SpaceSend = InterpreterFrom<SpaceMachine>['send'];
|
|
66
|
+
|
|
67
|
+
const useSpaceMachine = (options?: Parameters<typeof useMachine<SpaceMachine>>[1]) => {
|
|
68
|
+
return useMachine(spaceMachine, { ...options, context: { ...options?.context } });
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export type { SpaceMachine, SpaceEvent, SpaceMachineContext, SpaceState, SpaceSend };
|
|
72
|
+
export { spaceMachine, useSpaceMachine };
|