@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,86 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { log } from '@dxos/log';
|
|
8
|
+
import { useClient } from '@dxos/react-client';
|
|
9
|
+
import { useTranslation } from '@dxos/react-ui';
|
|
10
|
+
|
|
11
|
+
import { Action, Actions, StepHeading, Input } from '../../../components';
|
|
12
|
+
import { type JoinStepProps } from '../JoinPanelProps';
|
|
13
|
+
|
|
14
|
+
export interface IdentityCreatorProps extends JoinStepProps {
|
|
15
|
+
method: 'recover identity' | 'create identity';
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type IdentityInputProps = IdentityCreatorProps;
|
|
19
|
+
|
|
20
|
+
export type IdentityInputImplProps = IdentityCreatorProps & {
|
|
21
|
+
onDisplayNameConfirm?: (displayName: string) => void;
|
|
22
|
+
validationMessage?: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const IdentityInput = (props: IdentityInputProps) => {
|
|
26
|
+
const { send, method } = props;
|
|
27
|
+
const isRecover = method === 'recover identity';
|
|
28
|
+
const client = useClient();
|
|
29
|
+
const { t } = useTranslation('os');
|
|
30
|
+
const [validationMessage, setValidationMessage] = useState('');
|
|
31
|
+
const createIdentity = (displayName: string) => {
|
|
32
|
+
void client.halo.createIdentity({ [isRecover ? 'seedphrase' : 'displayName']: displayName }).then(
|
|
33
|
+
(identity) => {
|
|
34
|
+
send?.({ type: 'selectIdentity' as const, identity });
|
|
35
|
+
},
|
|
36
|
+
(error) => {
|
|
37
|
+
log.catch(error);
|
|
38
|
+
setValidationMessage(t(isRecover ? 'failed to recover identity message' : 'failed to create identity message'));
|
|
39
|
+
},
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
return <IdentityInputImpl {...props} onDisplayNameConfirm={createIdentity} validationMessage={validationMessage} />;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// TODO(zhenyasav): impl shouldn't need send()
|
|
46
|
+
export const IdentityInputImpl = (props: IdentityInputImplProps) => {
|
|
47
|
+
const { method, send, active, onDisplayNameConfirm, validationMessage } = props;
|
|
48
|
+
const disabled = !active;
|
|
49
|
+
const { t } = useTranslation('os');
|
|
50
|
+
const [inputValue, setInputValue] = useState('');
|
|
51
|
+
const isRecover = method === 'recover identity';
|
|
52
|
+
return (
|
|
53
|
+
<>
|
|
54
|
+
<div role='none' className='grow flex flex-col justify-center'>
|
|
55
|
+
<Input
|
|
56
|
+
{...{ validationMessage }}
|
|
57
|
+
label={
|
|
58
|
+
<StepHeading>{t(isRecover ? 'recover identity input label' : 'new identity input label')}</StepHeading>
|
|
59
|
+
}
|
|
60
|
+
disabled={disabled}
|
|
61
|
+
data-testid='identity-input'
|
|
62
|
+
placeholder={isRecover ? 'Type your recovery phrase' : 'Type a display name'}
|
|
63
|
+
onChange={({ target: { value } }) => setInputValue(value)}
|
|
64
|
+
/>
|
|
65
|
+
</div>
|
|
66
|
+
<Actions>
|
|
67
|
+
<Action
|
|
68
|
+
variant='ghost'
|
|
69
|
+
disabled={disabled}
|
|
70
|
+
onClick={() => send?.({ type: 'deselectAuthMethod' })}
|
|
71
|
+
data-testid={`${method === 'recover identity' ? 'recover' : 'create'}-identity-input-back`}
|
|
72
|
+
>
|
|
73
|
+
{t('back label')}
|
|
74
|
+
</Action>
|
|
75
|
+
<Action
|
|
76
|
+
variant='primary'
|
|
77
|
+
disabled={disabled}
|
|
78
|
+
onClick={() => onDisplayNameConfirm?.(inputValue)}
|
|
79
|
+
data-testid={`${method === 'recover identity' ? 'recover' : 'create'}-identity-input-continue`}
|
|
80
|
+
>
|
|
81
|
+
{t('continue label')}
|
|
82
|
+
</Action>
|
|
83
|
+
</Actions>
|
|
84
|
+
</>
|
|
85
|
+
);
|
|
86
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { cloneElement } from 'react';
|
|
6
|
+
|
|
7
|
+
import { useTranslation } from '@dxos/react-ui';
|
|
8
|
+
|
|
9
|
+
import { Actions, Action } from '../../../components';
|
|
10
|
+
import { type JoinStepProps } from '../JoinPanelProps';
|
|
11
|
+
|
|
12
|
+
export interface InvitationAcceptedProps extends JoinStepProps {
|
|
13
|
+
Kind: 'Space' | 'Halo';
|
|
14
|
+
doneActionParent?: Parameters<typeof cloneElement>[0];
|
|
15
|
+
onDone?: () => void;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const InvitationAccepted = (props: InvitationAcceptedProps) => {
|
|
19
|
+
const { active, Kind, doneActionParent, onDone } = props;
|
|
20
|
+
const disabled = !active;
|
|
21
|
+
const { t } = useTranslation('os');
|
|
22
|
+
|
|
23
|
+
const doneAction = (
|
|
24
|
+
<Action
|
|
25
|
+
variant='primary'
|
|
26
|
+
onClick={onDone}
|
|
27
|
+
disabled={disabled}
|
|
28
|
+
data-autofocus={`success${Kind}Invitation finishingJoining${Kind}`}
|
|
29
|
+
data-testid={`${Kind.toLowerCase()}-invitation-accepted-done`}
|
|
30
|
+
>
|
|
31
|
+
{t('done label')}
|
|
32
|
+
</Action>
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<>
|
|
37
|
+
<div role='none' className='grow flex flex-col justify-center'>
|
|
38
|
+
<p className='text-center text-sm font-normal'>{t('welcome message')}</p>
|
|
39
|
+
</div>
|
|
40
|
+
<Actions>{doneActionParent ? cloneElement(doneActionParent, {}, doneAction) : doneAction}</Actions>
|
|
41
|
+
</>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { type ChangeEvent, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { Input, useTranslation } from '@dxos/react-ui';
|
|
8
|
+
|
|
9
|
+
import { Actions, Action, Emoji, StepHeading } from '../../../components';
|
|
10
|
+
import { toEmoji } from '../../../util';
|
|
11
|
+
import { type JoinStepProps } from '../JoinPanelProps';
|
|
12
|
+
|
|
13
|
+
const pinLength = 6;
|
|
14
|
+
|
|
15
|
+
export interface InvitationAuthenticatorProps extends JoinStepProps {
|
|
16
|
+
Kind: 'Space' | 'Halo';
|
|
17
|
+
failed?: boolean;
|
|
18
|
+
pending?: boolean;
|
|
19
|
+
invitationId?: string;
|
|
20
|
+
onInvitationCancel?: () => Promise<void> | undefined;
|
|
21
|
+
onInvitationAuthenticate?: (authCode: string) => Promise<void> | undefined;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const InvitationAuthenticator = ({
|
|
25
|
+
failed,
|
|
26
|
+
Kind,
|
|
27
|
+
active,
|
|
28
|
+
pending,
|
|
29
|
+
invitationId,
|
|
30
|
+
onInvitationAuthenticate,
|
|
31
|
+
onInvitationCancel,
|
|
32
|
+
}: InvitationAuthenticatorProps) => {
|
|
33
|
+
const disabled = !active || pending;
|
|
34
|
+
const { t } = useTranslation('os');
|
|
35
|
+
const invitationType = Kind.toLowerCase() as 'space' | 'halo';
|
|
36
|
+
const [authCode, setAuthCode] = useState('');
|
|
37
|
+
|
|
38
|
+
const onChange = ({ target: { value } }: ChangeEvent<HTMLInputElement>) => {
|
|
39
|
+
setAuthCode(value);
|
|
40
|
+
if (value.length === pinLength) {
|
|
41
|
+
(document.querySelector(`[data-autofocus-pinlength="${invitationType}"]`) as HTMLElement | null)?.focus();
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<>
|
|
47
|
+
<div role='none' className='grow flex flex-col justify-center'>
|
|
48
|
+
{invitationId && <Emoji text={toEmoji(invitationId)} />}
|
|
49
|
+
<Input.Root
|
|
50
|
+
{...(failed && {
|
|
51
|
+
validationValence: 'error',
|
|
52
|
+
})}
|
|
53
|
+
>
|
|
54
|
+
<Input.Label asChild>
|
|
55
|
+
<StepHeading>{t('auth code input label')}</StepHeading>
|
|
56
|
+
</Input.Label>
|
|
57
|
+
<Input.PinInput
|
|
58
|
+
{...{
|
|
59
|
+
disabled,
|
|
60
|
+
length: pinLength,
|
|
61
|
+
onChange,
|
|
62
|
+
inputMode: 'numeric',
|
|
63
|
+
autoComplete: 'off',
|
|
64
|
+
pattern: '\\d*',
|
|
65
|
+
'data-autofocus': `connecting${Kind}Invitation inputting${Kind}VerificationCode authenticationFailing${Kind}VerificationCode authenticating${Kind}VerificationCode`,
|
|
66
|
+
'data-prevent-ios-autofocus': true,
|
|
67
|
+
'data-testid': `${invitationType}-auth-code-input`,
|
|
68
|
+
'data-1p-ignore': true,
|
|
69
|
+
}}
|
|
70
|
+
/>
|
|
71
|
+
{failed && (
|
|
72
|
+
<Input.DescriptionAndValidation classNames='text-center'>
|
|
73
|
+
<Input.Validation>{t('failed to authenticate message')}</Input.Validation>
|
|
74
|
+
</Input.DescriptionAndValidation>
|
|
75
|
+
)}
|
|
76
|
+
</Input.Root>
|
|
77
|
+
</div>
|
|
78
|
+
<Actions>
|
|
79
|
+
<Action
|
|
80
|
+
variant='ghost'
|
|
81
|
+
disabled={disabled}
|
|
82
|
+
onClick={() => onInvitationCancel?.()}
|
|
83
|
+
data-testid={`${invitationType}-invitation-authenticator-cancel`}
|
|
84
|
+
>
|
|
85
|
+
{t('cancel label')}
|
|
86
|
+
</Action>
|
|
87
|
+
<Action
|
|
88
|
+
variant='primary'
|
|
89
|
+
disabled={disabled}
|
|
90
|
+
onClick={() => onInvitationAuthenticate?.(authCode)}
|
|
91
|
+
data-autofocus-pinlength={invitationType}
|
|
92
|
+
data-testid={`${invitationType}-invitation-authenticator-next`}
|
|
93
|
+
>
|
|
94
|
+
{t('next label')}
|
|
95
|
+
</Action>
|
|
96
|
+
</Actions>
|
|
97
|
+
</>
|
|
98
|
+
);
|
|
99
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useState, useEffect, cloneElement } from 'react';
|
|
6
|
+
|
|
7
|
+
import { log } from '@dxos/log';
|
|
8
|
+
import { useTranslation } from '@dxos/react-ui';
|
|
9
|
+
|
|
10
|
+
import { Actions, StepHeading, Action, Input } from '../../../components';
|
|
11
|
+
import { type JoinPanelProps, type JoinStepProps } from '../JoinPanelProps';
|
|
12
|
+
|
|
13
|
+
export interface InvitationInputProps extends JoinStepProps, Pick<JoinPanelProps, 'onExit' | 'exitActionParent'> {
|
|
14
|
+
Kind: 'Space' | 'Halo';
|
|
15
|
+
unredeemedCode?: string;
|
|
16
|
+
succeededKeys?: Set<string>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const invitationCodeFromUrl = (text: string) => {
|
|
20
|
+
try {
|
|
21
|
+
const searchParams = new URLSearchParams(text.substring(text.lastIndexOf('?')));
|
|
22
|
+
const invitation = searchParams.get('spaceInvitationCode') ?? searchParams.get('deviceInvitationCode');
|
|
23
|
+
return invitation ?? text;
|
|
24
|
+
} catch (err) {
|
|
25
|
+
log.catch(err);
|
|
26
|
+
return text;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const InvitationInput = (props: InvitationInputProps) => {
|
|
31
|
+
const { Kind, active, send, unredeemedCode, onExit, exitActionParent, onDone, doneActionParent, succeededKeys } =
|
|
32
|
+
props;
|
|
33
|
+
const disabled = !active;
|
|
34
|
+
const { t } = useTranslation('os');
|
|
35
|
+
|
|
36
|
+
const [inputValue, setInputValue] = useState(unredeemedCode ?? '');
|
|
37
|
+
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
unredeemedCode && setInputValue(unredeemedCode ?? '');
|
|
40
|
+
}, [unredeemedCode]);
|
|
41
|
+
|
|
42
|
+
const handleNext = () =>
|
|
43
|
+
send({
|
|
44
|
+
type: `set${Kind}InvitationCode`,
|
|
45
|
+
code: invitationCodeFromUrl(inputValue),
|
|
46
|
+
...(Kind === 'Space' && { succeededKeys }),
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const exitAction = (
|
|
50
|
+
<Action
|
|
51
|
+
variant='ghost'
|
|
52
|
+
disabled={disabled}
|
|
53
|
+
{...(onExit ? { onClick: () => onExit() } : { onClick: () => onDone?.(null) })}
|
|
54
|
+
data-testid='join-exit'
|
|
55
|
+
>
|
|
56
|
+
{t('cancel label')}
|
|
57
|
+
</Action>
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<>
|
|
62
|
+
<div role='none' className='grow flex flex-col justify-center'>
|
|
63
|
+
<Input
|
|
64
|
+
label={<StepHeading>{t('invitation input label')}</StepHeading>}
|
|
65
|
+
placeholder='Type an invitation code'
|
|
66
|
+
disabled={disabled}
|
|
67
|
+
value={inputValue}
|
|
68
|
+
onChange={({ target: { value } }) => setInputValue(value)}
|
|
69
|
+
data-autofocus={`inputting${Kind}InvitationCode`}
|
|
70
|
+
data-testid={`${Kind.toLowerCase()}-invitation-input`}
|
|
71
|
+
onKeyUp={({ key }) => key === 'Enter' && handleNext()}
|
|
72
|
+
/>
|
|
73
|
+
</div>
|
|
74
|
+
<Actions>
|
|
75
|
+
{Kind === 'Halo' ? (
|
|
76
|
+
<Action
|
|
77
|
+
variant='ghost'
|
|
78
|
+
disabled={disabled}
|
|
79
|
+
onClick={() => send({ type: 'deselectAuthMethod' })}
|
|
80
|
+
data-testid={`${Kind.toLowerCase()}-invitation-input-back`}
|
|
81
|
+
>
|
|
82
|
+
{t('back label')}
|
|
83
|
+
</Action>
|
|
84
|
+
) : exitActionParent ? (
|
|
85
|
+
cloneElement(exitActionParent, {}, exitAction)
|
|
86
|
+
) : doneActionParent ? (
|
|
87
|
+
cloneElement(doneActionParent, {}, exitAction)
|
|
88
|
+
) : (
|
|
89
|
+
exitAction
|
|
90
|
+
)}
|
|
91
|
+
<Action
|
|
92
|
+
variant='primary'
|
|
93
|
+
disabled={disabled}
|
|
94
|
+
onClick={handleNext}
|
|
95
|
+
data-testid={`${Kind.toLowerCase()}-invitation-input-continue`}
|
|
96
|
+
>
|
|
97
|
+
{t('continue label')}
|
|
98
|
+
</Action>
|
|
99
|
+
</Actions>
|
|
100
|
+
</>
|
|
101
|
+
);
|
|
102
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { type Invitation } from '@dxos/react-client/invitations';
|
|
8
|
+
import { useTranslation } from '@dxos/react-ui';
|
|
9
|
+
import { descriptionText } from '@dxos/react-ui-theme';
|
|
10
|
+
|
|
11
|
+
import { Action, Actions, StepHeading } from '../../../components';
|
|
12
|
+
import { type FailReason } from '../../../types';
|
|
13
|
+
import { type JoinStepProps } from '../JoinPanelProps';
|
|
14
|
+
|
|
15
|
+
export interface InvitationRescuerProps extends JoinStepProps {
|
|
16
|
+
Kind: 'Space' | 'Halo';
|
|
17
|
+
invitationState?: Invitation.State;
|
|
18
|
+
onInvitationCancel?: () => Promise<void> | undefined;
|
|
19
|
+
failReason?: FailReason | null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const InvitationActions = ({
|
|
23
|
+
// `invitationState` does report correct state, but here we evaluate whether `failReason` is a better source of truth
|
|
24
|
+
// for the UI in particular.
|
|
25
|
+
invitationState,
|
|
26
|
+
onInvitationCancel,
|
|
27
|
+
active,
|
|
28
|
+
send,
|
|
29
|
+
Kind,
|
|
30
|
+
failReason,
|
|
31
|
+
}: InvitationRescuerProps) => {
|
|
32
|
+
const { t } = useTranslation('os');
|
|
33
|
+
|
|
34
|
+
if (failReason) {
|
|
35
|
+
return (
|
|
36
|
+
<>
|
|
37
|
+
<StepHeading className={descriptionText}>
|
|
38
|
+
{t(
|
|
39
|
+
failReason === 'timeout'
|
|
40
|
+
? 'timeout status label'
|
|
41
|
+
: failReason === 'cancelled'
|
|
42
|
+
? 'cancelled status label'
|
|
43
|
+
: 'error status label',
|
|
44
|
+
)}
|
|
45
|
+
</StepHeading>
|
|
46
|
+
<div role='none' className='grow' />
|
|
47
|
+
<Actions>
|
|
48
|
+
<Action
|
|
49
|
+
disabled={!active}
|
|
50
|
+
onClick={() => send({ type: `reset${Kind}Invitation` })}
|
|
51
|
+
data-testid='invitation-rescuer-reset'
|
|
52
|
+
>
|
|
53
|
+
{t('reset label')}
|
|
54
|
+
</Action>
|
|
55
|
+
</Actions>
|
|
56
|
+
</>
|
|
57
|
+
);
|
|
58
|
+
} else {
|
|
59
|
+
return (
|
|
60
|
+
<>
|
|
61
|
+
<StepHeading className={descriptionText}>{t('connecting status label')}</StepHeading>
|
|
62
|
+
<div role='none' className='grow' />
|
|
63
|
+
<Actions>
|
|
64
|
+
<Action disabled classNames='order-2' data-testid='next'>
|
|
65
|
+
{t('next label')}
|
|
66
|
+
</Action>
|
|
67
|
+
<Action disabled={!active} onClick={onInvitationCancel} data-testid='invitation-rescuer-cancel'>
|
|
68
|
+
{t('cancel label')}
|
|
69
|
+
</Action>
|
|
70
|
+
</Actions>
|
|
71
|
+
</>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export const InvitationRescuer = (props: InvitationRescuerProps) => {
|
|
77
|
+
const { Kind, invitationState, active, send } = props;
|
|
78
|
+
const { t } = useTranslation('os');
|
|
79
|
+
|
|
80
|
+
return (
|
|
81
|
+
<>
|
|
82
|
+
{typeof invitationState === 'undefined' ? (
|
|
83
|
+
<>
|
|
84
|
+
<div role='none' className='grow flex flex-col justify-center'>
|
|
85
|
+
<StepHeading className={descriptionText}>There was a problem joining the space</StepHeading>
|
|
86
|
+
</div>
|
|
87
|
+
<Actions>
|
|
88
|
+
<Action
|
|
89
|
+
disabled={!active}
|
|
90
|
+
data-testid='invitation-rescuer-blank-reset'
|
|
91
|
+
onClick={() => send({ type: `reset${Kind}Invitation` })}
|
|
92
|
+
>
|
|
93
|
+
{t('reset label')}
|
|
94
|
+
</Action>
|
|
95
|
+
</Actions>
|
|
96
|
+
</>
|
|
97
|
+
) : (
|
|
98
|
+
<InvitationActions {...props} />
|
|
99
|
+
)}
|
|
100
|
+
</>
|
|
101
|
+
);
|
|
102
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { log } from '@dxos/log';
|
|
8
|
+
import { useClient } from '@dxos/react-client';
|
|
9
|
+
import { useTranslation } from '@dxos/react-ui';
|
|
10
|
+
|
|
11
|
+
import { Action, Actions, StepHeading, Input } from '../../../components';
|
|
12
|
+
import { type JoinStepProps } from '../JoinPanelProps';
|
|
13
|
+
|
|
14
|
+
export type ResetIdentityProps = JoinStepProps & {
|
|
15
|
+
method: 'reset identity';
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type ResetIdentityImplProps = {
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
validationMessage?: string;
|
|
21
|
+
onConfirm?: () => void;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const ResetIdentity = ({ send, active }: ResetIdentityProps) => {
|
|
25
|
+
const client = useClient();
|
|
26
|
+
const { t } = useTranslation('os');
|
|
27
|
+
const [validationMessage, setValidationMessage] = useState('');
|
|
28
|
+
const resetIdentity = () => {
|
|
29
|
+
void client.reset().then(
|
|
30
|
+
() => send?.({ type: 'resetIdentity' }),
|
|
31
|
+
(error) => {
|
|
32
|
+
log.catch(error);
|
|
33
|
+
setValidationMessage(t('failed to reset identity message'));
|
|
34
|
+
},
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
return (
|
|
38
|
+
<ResetIdentityImpl disabled={!active} validationMessage={validationMessage} onConfirm={() => resetIdentity()} />
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const ResetIdentityImpl = ({ disabled, validationMessage, onConfirm }: ResetIdentityImplProps) => {
|
|
43
|
+
const { t } = useTranslation('os');
|
|
44
|
+
const confirmationValue = t('confirmation value');
|
|
45
|
+
const [inputValue, setInputValue] = useState('');
|
|
46
|
+
return (
|
|
47
|
+
<>
|
|
48
|
+
<div role='none' className='grow flex flex-col justify-center'>
|
|
49
|
+
<Input
|
|
50
|
+
{...{ validationMessage }}
|
|
51
|
+
label={<StepHeading>{t('reset identity input label', { confirmationValue })}</StepHeading>}
|
|
52
|
+
disabled={disabled}
|
|
53
|
+
data-testid='identity-input'
|
|
54
|
+
placeholder={confirmationValue}
|
|
55
|
+
onChange={({ target: { value } }) => setInputValue(value)}
|
|
56
|
+
/>
|
|
57
|
+
</div>
|
|
58
|
+
<Actions>
|
|
59
|
+
<Action
|
|
60
|
+
// TODO(wittjosiah): Probably make this red?
|
|
61
|
+
variant='primary'
|
|
62
|
+
disabled={disabled || inputValue !== confirmationValue}
|
|
63
|
+
onClick={() => onConfirm?.()}
|
|
64
|
+
data-testid='reset-identity-input-confirm'
|
|
65
|
+
>
|
|
66
|
+
{t('confirm label')}
|
|
67
|
+
</Action>
|
|
68
|
+
</Actions>
|
|
69
|
+
</>
|
|
70
|
+
);
|
|
71
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
export * from './AdditionMethodChooser';
|
|
6
|
+
export * from './IdentityAdded';
|
|
7
|
+
export * from './IdentityInput';
|
|
8
|
+
export * from './InvitationAccepted';
|
|
9
|
+
export * from './InvitationInput';
|
|
10
|
+
export * from './InvitationRescuer';
|
|
11
|
+
export * from './InvitationAuthenticator';
|
|
12
|
+
export * from './ResetIdentity';
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import '@dxosTheme';
|
|
6
|
+
|
|
7
|
+
import React from 'react';
|
|
8
|
+
|
|
9
|
+
import { withTheme } from '@dxos/storybook-utils';
|
|
10
|
+
|
|
11
|
+
import * as IdentityPanels from './IdentityPanel/IdentityPanel.stories';
|
|
12
|
+
import * as JoinPanels from './JoinPanel/JoinPanel.stories';
|
|
13
|
+
import * as SpacePanels from './SpacePanel/SpacePanel.stories';
|
|
14
|
+
|
|
15
|
+
const getComponentNames = (module: any): string[] =>
|
|
16
|
+
module?.__namedExportsOrder ??
|
|
17
|
+
Object.getOwnPropertyNames(module).filter((name) => !(name === 'default' || name.startsWith('__')));
|
|
18
|
+
|
|
19
|
+
const getComponents = (module: any): React.FC[] => {
|
|
20
|
+
const components = getComponentNames(module).map((name) => module[name]);
|
|
21
|
+
console.log(module);
|
|
22
|
+
return components;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const camelCaseToSpacedName = (camelCase: string) => {
|
|
26
|
+
return camelCase.replace(/([a-z0-9])([A-Z])/g, '$1 $2').replace(/([A-Z])([A-Z][a-z])/g, '$1 $2');
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const StoryRow = ({ components }: { components: React.FC[] }) => {
|
|
30
|
+
return (
|
|
31
|
+
<tr style={{ whiteSpace: 'nowrap' }}>
|
|
32
|
+
{components?.map((Comp) => (
|
|
33
|
+
<td key={Comp.name}>
|
|
34
|
+
<div className='bg-zinc-500 text-zinc-200 p-3 text-sm text-center'>{camelCaseToSpacedName(Comp.name)}</div>
|
|
35
|
+
<Comp />
|
|
36
|
+
</td>
|
|
37
|
+
))}
|
|
38
|
+
</tr>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const Default = (props: any) => {
|
|
43
|
+
return (
|
|
44
|
+
<table className='bg-body'>
|
|
45
|
+
<tbody>
|
|
46
|
+
<StoryRow components={getComponents(IdentityPanels)} />
|
|
47
|
+
<StoryRow components={getComponents(SpacePanels)} />
|
|
48
|
+
<StoryRow components={getComponents(JoinPanels)} />
|
|
49
|
+
</tbody>
|
|
50
|
+
</table>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
Default.parameters = { layout: 'fullscreen' };
|
|
55
|
+
|
|
56
|
+
export default {
|
|
57
|
+
title: 'react-shell/All',
|
|
58
|
+
decorators: [withTheme],
|
|
59
|
+
component: StoryRow,
|
|
60
|
+
parameters: { chromatic: { disableSnapshot: false } },
|
|
61
|
+
};
|