@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,49 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
import { X } from '@phosphor-icons/react';
|
|
5
|
+
import React, { cloneElement, type ForwardedRef, forwardRef } from 'react';
|
|
6
|
+
|
|
7
|
+
import { Button, useTranslation } from '@dxos/react-ui';
|
|
8
|
+
import { descriptionText, getSize, mx } from '@dxos/react-ui-theme';
|
|
9
|
+
|
|
10
|
+
import { type JoinPanelMode } from './JoinPanelProps';
|
|
11
|
+
import { Heading } from '../../components';
|
|
12
|
+
|
|
13
|
+
export interface JoinSpaceHeadingProps {
|
|
14
|
+
mode?: JoinPanelMode;
|
|
15
|
+
titleId: string;
|
|
16
|
+
onExit?: () => void;
|
|
17
|
+
exitActionParent?: Parameters<typeof cloneElement>[0];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// TODO(wittjosiah): Accesses the space properties directly which will trigger ECHO warnings without observer.
|
|
21
|
+
export const JoinHeading = forwardRef(
|
|
22
|
+
({ mode, titleId, onExit, exitActionParent }: JoinSpaceHeadingProps, forwardedRef: ForwardedRef<HTMLDivElement>) => {
|
|
23
|
+
const { t } = useTranslation('os');
|
|
24
|
+
|
|
25
|
+
const exitButton = (
|
|
26
|
+
<Button
|
|
27
|
+
variant='ghost'
|
|
28
|
+
{...(onExit && { onClick: onExit })}
|
|
29
|
+
classNames={mx(descriptionText, 'plb-0 pli-2 absolute block-start-0 inline-end-0 z-[1]')}
|
|
30
|
+
data-testid='join-exit'
|
|
31
|
+
>
|
|
32
|
+
<X weight='bold' className={getSize(4)} />
|
|
33
|
+
<span className='sr-only'>{t('exit label')}</span>
|
|
34
|
+
</Button>
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<Heading
|
|
39
|
+
ref={forwardedRef}
|
|
40
|
+
titleId={titleId}
|
|
41
|
+
title={t(mode === 'halo-only' ? 'selecting identity heading' : 'joining space heading')}
|
|
42
|
+
{...(mode === 'halo-only'
|
|
43
|
+
? { titleSrOnly: true }
|
|
44
|
+
: { corner: exitActionParent ? cloneElement(exitActionParent, {}, exitButton) : exitButton })}
|
|
45
|
+
titleSrOnly={mode === 'halo-only'}
|
|
46
|
+
/>
|
|
47
|
+
);
|
|
48
|
+
},
|
|
49
|
+
);
|
|
@@ -0,0 +1,91 @@
|
|
|
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 { JoinPanelImpl } from './JoinPanel';
|
|
12
|
+
import { type JoinPanelImplProps } from './JoinPanelProps';
|
|
13
|
+
import { IdentityInputImpl, ResetIdentityImpl } from './steps';
|
|
14
|
+
import { StorybookDialog } from '../../components/StorybookDialog';
|
|
15
|
+
|
|
16
|
+
const noOpProps: JoinPanelImplProps = {
|
|
17
|
+
titleId: 'storybookJoinPanel__title',
|
|
18
|
+
send: () => {},
|
|
19
|
+
activeView: 'create identity input',
|
|
20
|
+
failed: new Set(),
|
|
21
|
+
pending: false,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const JoinDialog = (args: Partial<JoinPanelImplProps>) => (
|
|
25
|
+
<StorybookDialog inOverlayLayout>
|
|
26
|
+
<JoinPanelImpl {...noOpProps} {...args} />
|
|
27
|
+
</StorybookDialog>
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
export default {
|
|
31
|
+
title: 'react-shell/JoinPanel',
|
|
32
|
+
component: JoinDialog,
|
|
33
|
+
decorators: [withTheme],
|
|
34
|
+
parameters: { chromatic: { disableSnapshot: false } },
|
|
35
|
+
args: {
|
|
36
|
+
IdentityInput: IdentityInputImpl,
|
|
37
|
+
ResetIdentity: ResetIdentityImpl,
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const AdditionMethodChooser = {
|
|
42
|
+
args: { mode: 'halo-only', activeView: 'addition method chooser' },
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const ResetIdentity = {
|
|
46
|
+
args: { mode: 'halo-only', activeView: 'reset identity confirmation' },
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const CreateIdentityInput = {
|
|
50
|
+
args: { mode: 'halo-only', activeView: 'create identity input' },
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const RecoverIdentityInput = {
|
|
54
|
+
args: { mode: 'halo-only', activeView: 'recover identity input' },
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const HaloInvitationInput = {
|
|
58
|
+
args: { mode: 'halo-only', activeView: 'halo invitation input' },
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const HaloInvitationRescuer = {
|
|
62
|
+
args: { mode: 'halo-only', activeView: 'halo invitation rescuer' },
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const HaloInvitationAuthenticator = {
|
|
66
|
+
args: { mode: 'halo-only', activeView: 'halo invitation authenticator' },
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const HaloInvitationAccepted = {
|
|
70
|
+
args: { mode: 'halo-only', activeView: 'halo invitation accepted' },
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const IdentityAdded = {
|
|
74
|
+
args: { mode: 'halo-only', activeView: 'identity added' },
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const SpaceInvitationInput = {
|
|
78
|
+
args: { activeView: 'space invitation input' },
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export const SpaceInvitationRescuer = {
|
|
82
|
+
args: { activeView: 'space invitation rescuer' },
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export const SpaceInvitationAuthenticator = {
|
|
86
|
+
args: { activeView: 'space invitation authenticator' },
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export const SpaceInvitationAccepted = {
|
|
90
|
+
args: { activeView: 'space invitation accepted' },
|
|
91
|
+
};
|
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
import React, { useCallback, useEffect, useMemo } from 'react';
|
|
5
|
+
|
|
6
|
+
import { log } from '@dxos/log';
|
|
7
|
+
import { useClient, useMulticastObservable } from '@dxos/react-client';
|
|
8
|
+
import { useIdentity } from '@dxos/react-client/halo';
|
|
9
|
+
import { DensityProvider, useId, useThemeContext } from '@dxos/react-ui';
|
|
10
|
+
|
|
11
|
+
import { JoinHeading } from './JoinHeading';
|
|
12
|
+
import { type JoinPanelImplProps, type JoinPanelProps } from './JoinPanelProps';
|
|
13
|
+
import { useJoinMachine } from './joinMachine';
|
|
14
|
+
import {
|
|
15
|
+
AdditionMethodChooser,
|
|
16
|
+
IdentityInput,
|
|
17
|
+
IdentityAdded,
|
|
18
|
+
InvitationAuthenticator,
|
|
19
|
+
InvitationRescuer,
|
|
20
|
+
InvitationInput,
|
|
21
|
+
InvitationAccepted,
|
|
22
|
+
ResetIdentity,
|
|
23
|
+
} from './steps';
|
|
24
|
+
import { Viewport } from '../../components';
|
|
25
|
+
import { stepStyles } from '../../styles';
|
|
26
|
+
|
|
27
|
+
export const JoinPanelImpl = (props: JoinPanelImplProps) => {
|
|
28
|
+
const {
|
|
29
|
+
titleId,
|
|
30
|
+
send,
|
|
31
|
+
activeView,
|
|
32
|
+
failed,
|
|
33
|
+
mode,
|
|
34
|
+
unredeemedCodes,
|
|
35
|
+
invitationStates,
|
|
36
|
+
succeededKeys,
|
|
37
|
+
failReasons,
|
|
38
|
+
onExit,
|
|
39
|
+
onHaloDone,
|
|
40
|
+
onSpaceDone,
|
|
41
|
+
exitActionParent,
|
|
42
|
+
doneActionParent,
|
|
43
|
+
onHaloInvitationCancel,
|
|
44
|
+
onSpaceInvitationCancel,
|
|
45
|
+
onHaloInvitationAuthenticate,
|
|
46
|
+
onSpaceInvitationAuthenticate,
|
|
47
|
+
IdentityInput: IdentityInputComponent = IdentityInput,
|
|
48
|
+
ResetIdentity: ResetIdentityComponent = ResetIdentity,
|
|
49
|
+
} = props;
|
|
50
|
+
return (
|
|
51
|
+
<DensityProvider density='fine'>
|
|
52
|
+
{mode !== 'halo-only' && <JoinHeading {...{ titleId, mode, onExit, exitActionParent }} />}
|
|
53
|
+
<Viewport.Root focusManaged activeView={activeView}>
|
|
54
|
+
<Viewport.Views>
|
|
55
|
+
<Viewport.View classNames={stepStyles} id='addition method chooser'>
|
|
56
|
+
<AdditionMethodChooser send={send} active={activeView === 'addition method chooser'} />
|
|
57
|
+
</Viewport.View>
|
|
58
|
+
<Viewport.View classNames={stepStyles} id='reset identity confirmation'>
|
|
59
|
+
<ResetIdentityComponent
|
|
60
|
+
send={send}
|
|
61
|
+
method='reset identity'
|
|
62
|
+
active={activeView === 'reset identity confirmation'}
|
|
63
|
+
/>
|
|
64
|
+
</Viewport.View>
|
|
65
|
+
<Viewport.View classNames={stepStyles} id='create identity input'>
|
|
66
|
+
<IdentityInputComponent
|
|
67
|
+
send={send}
|
|
68
|
+
method='create identity'
|
|
69
|
+
active={activeView === 'create identity input'}
|
|
70
|
+
/>
|
|
71
|
+
</Viewport.View>
|
|
72
|
+
<Viewport.View classNames={stepStyles} id='recover identity input'>
|
|
73
|
+
<IdentityInputComponent
|
|
74
|
+
send={send}
|
|
75
|
+
method='recover identity'
|
|
76
|
+
active={activeView === 'recover identity input'}
|
|
77
|
+
/>
|
|
78
|
+
</Viewport.View>
|
|
79
|
+
<Viewport.View classNames={stepStyles} id='halo invitation input'>
|
|
80
|
+
<InvitationInput
|
|
81
|
+
send={send}
|
|
82
|
+
Kind='Halo'
|
|
83
|
+
active={activeView === 'halo invitation input'}
|
|
84
|
+
{...(unredeemedCodes?.Halo && { unredeemedCode: unredeemedCodes.Halo })}
|
|
85
|
+
{...(succeededKeys?.Halo && { succeededKeys: succeededKeys.Halo })}
|
|
86
|
+
/>
|
|
87
|
+
</Viewport.View>
|
|
88
|
+
<Viewport.View classNames={stepStyles} id='halo invitation rescuer'>
|
|
89
|
+
<InvitationRescuer
|
|
90
|
+
send={send}
|
|
91
|
+
Kind='Halo'
|
|
92
|
+
active={activeView === 'halo invitation rescuer'}
|
|
93
|
+
invitationState={invitationStates?.Halo}
|
|
94
|
+
onInvitationCancel={onHaloInvitationCancel}
|
|
95
|
+
failReason={failReasons?.Halo}
|
|
96
|
+
/>
|
|
97
|
+
</Viewport.View>
|
|
98
|
+
<Viewport.View classNames={stepStyles} id='halo invitation authenticator'>
|
|
99
|
+
<InvitationAuthenticator
|
|
100
|
+
send={send}
|
|
101
|
+
Kind='Halo'
|
|
102
|
+
active={activeView === 'halo invitation authenticator'}
|
|
103
|
+
onInvitationCancel={onHaloInvitationCancel}
|
|
104
|
+
onInvitationAuthenticate={onHaloInvitationAuthenticate}
|
|
105
|
+
{...(failed.has('Halo') && { failed: true })}
|
|
106
|
+
/>
|
|
107
|
+
</Viewport.View>
|
|
108
|
+
<Viewport.View classNames={stepStyles} id='halo invitation accepted'>
|
|
109
|
+
<InvitationAccepted
|
|
110
|
+
{...{
|
|
111
|
+
send,
|
|
112
|
+
Kind: 'Halo',
|
|
113
|
+
active: activeView === 'halo invitation accepted',
|
|
114
|
+
doneActionParent,
|
|
115
|
+
onDone: onHaloDone,
|
|
116
|
+
}}
|
|
117
|
+
/>
|
|
118
|
+
</Viewport.View>
|
|
119
|
+
<Viewport.View classNames={stepStyles} id='identity added'>
|
|
120
|
+
<IdentityAdded
|
|
121
|
+
{...{ send, mode, active: activeView === 'identity added', doneActionParent, onDone: onHaloDone }}
|
|
122
|
+
/>
|
|
123
|
+
</Viewport.View>
|
|
124
|
+
<Viewport.View classNames={stepStyles} id='space invitation input'>
|
|
125
|
+
<InvitationInput
|
|
126
|
+
send={send}
|
|
127
|
+
Kind='Space'
|
|
128
|
+
active={activeView === 'space invitation input'}
|
|
129
|
+
{...(unredeemedCodes?.Space && { unredeemedCode: unredeemedCodes.Space })}
|
|
130
|
+
{...(succeededKeys?.Space && { succeededKeys: succeededKeys.Space })}
|
|
131
|
+
onExit={onExit}
|
|
132
|
+
exitActionParent={exitActionParent}
|
|
133
|
+
/>
|
|
134
|
+
</Viewport.View>
|
|
135
|
+
<Viewport.View classNames={stepStyles} id='space invitation rescuer'>
|
|
136
|
+
<InvitationRescuer
|
|
137
|
+
send={send}
|
|
138
|
+
Kind='Space'
|
|
139
|
+
active={activeView === 'space invitation rescuer'}
|
|
140
|
+
invitationState={invitationStates?.Space}
|
|
141
|
+
onInvitationCancel={onSpaceInvitationCancel}
|
|
142
|
+
failReason={failReasons?.Space}
|
|
143
|
+
/>
|
|
144
|
+
</Viewport.View>
|
|
145
|
+
<Viewport.View classNames={stepStyles} id='space invitation authenticator'>
|
|
146
|
+
<InvitationAuthenticator
|
|
147
|
+
send={send}
|
|
148
|
+
Kind='Space'
|
|
149
|
+
active={activeView === 'space invitation authenticator'}
|
|
150
|
+
onInvitationCancel={onSpaceInvitationCancel}
|
|
151
|
+
onInvitationAuthenticate={onSpaceInvitationAuthenticate}
|
|
152
|
+
{...(failed.has('Space') && { failed: true })}
|
|
153
|
+
/>
|
|
154
|
+
</Viewport.View>
|
|
155
|
+
<Viewport.View classNames={stepStyles} id='space invitation accepted'>
|
|
156
|
+
<InvitationAccepted
|
|
157
|
+
{...{
|
|
158
|
+
send,
|
|
159
|
+
Kind: 'Space',
|
|
160
|
+
active: activeView === 'space invitation accepted',
|
|
161
|
+
doneActionParent,
|
|
162
|
+
onDone: onSpaceDone,
|
|
163
|
+
}}
|
|
164
|
+
/>
|
|
165
|
+
</Viewport.View>
|
|
166
|
+
</Viewport.Views>
|
|
167
|
+
</Viewport.Root>
|
|
168
|
+
</DensityProvider>
|
|
169
|
+
);
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
export const JoinPanel = ({
|
|
173
|
+
titleId: propsTitleId,
|
|
174
|
+
mode = 'default',
|
|
175
|
+
initialInvitationCode,
|
|
176
|
+
exitActionParent,
|
|
177
|
+
onExit,
|
|
178
|
+
doneActionParent,
|
|
179
|
+
onDone: propsOnDone,
|
|
180
|
+
}: JoinPanelProps) => {
|
|
181
|
+
const client = useClient();
|
|
182
|
+
const identity = useIdentity();
|
|
183
|
+
const { hasIosKeyboard } = useThemeContext();
|
|
184
|
+
const titleId = useId('joinPanel__heading', propsTitleId);
|
|
185
|
+
|
|
186
|
+
const [joinState, joinSend, joinService] = useJoinMachine(client, {
|
|
187
|
+
context: {
|
|
188
|
+
mode,
|
|
189
|
+
identity,
|
|
190
|
+
...(initialInvitationCode && {
|
|
191
|
+
[mode === 'halo-only' ? 'halo' : 'space']: { unredeemedCode: initialInvitationCode },
|
|
192
|
+
}),
|
|
193
|
+
},
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
console.log('[joinState]', joinState);
|
|
197
|
+
|
|
198
|
+
useEffect(() => {
|
|
199
|
+
const subscription = joinService.subscribe((state) => {
|
|
200
|
+
log('[state]', state);
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
return subscription.unsubscribe;
|
|
204
|
+
}, [joinService]);
|
|
205
|
+
|
|
206
|
+
useEffect(() => {
|
|
207
|
+
const stateStack = joinState.configuration[0].id.split('.');
|
|
208
|
+
const innermostState = stateStack[stateStack.length - 1];
|
|
209
|
+
const autoFocusValue = innermostState === 'finishingJoining' ? 'successSpaceInvitation' : innermostState;
|
|
210
|
+
const $nextAutofocus: HTMLElement | null = document.querySelector(`[data-autofocus~="${autoFocusValue}"]`);
|
|
211
|
+
if ($nextAutofocus && !(hasIosKeyboard && $nextAutofocus.hasAttribute('data-prevent-ios-autofocus'))) {
|
|
212
|
+
$nextAutofocus.focus();
|
|
213
|
+
}
|
|
214
|
+
}, [joinState.value, hasIosKeyboard]);
|
|
215
|
+
|
|
216
|
+
const activeView = useMemo(() => {
|
|
217
|
+
switch (true) {
|
|
218
|
+
case joinState.matches({ choosingIdentity: 'choosingAuthMethod' }):
|
|
219
|
+
return 'addition method chooser';
|
|
220
|
+
case joinState.matches('resettingIdentity'):
|
|
221
|
+
return 'reset identity confirmation';
|
|
222
|
+
case joinState.matches({ choosingIdentity: 'creatingIdentity' }):
|
|
223
|
+
return 'create identity input';
|
|
224
|
+
case joinState.matches({ choosingIdentity: 'recoveringIdentity' }):
|
|
225
|
+
return 'recover identity input';
|
|
226
|
+
case joinState.matches({
|
|
227
|
+
choosingIdentity: { acceptingHaloInvitation: 'inputtingHaloInvitationCode' },
|
|
228
|
+
}):
|
|
229
|
+
return 'halo invitation input';
|
|
230
|
+
case [
|
|
231
|
+
{
|
|
232
|
+
choosingIdentity: {
|
|
233
|
+
acceptingHaloInvitation: { acceptingRedeemedHaloInvitation: 'connectingHaloInvitation' },
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
choosingIdentity: {
|
|
238
|
+
acceptingHaloInvitation: { acceptingRedeemedHaloInvitation: 'failingHaloInvitation' },
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
].some(joinState.matches):
|
|
242
|
+
return 'halo invitation rescuer';
|
|
243
|
+
case [
|
|
244
|
+
{
|
|
245
|
+
choosingIdentity: {
|
|
246
|
+
acceptingHaloInvitation: { acceptingRedeemedHaloInvitation: 'inputtingHaloVerificationCode' },
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
choosingIdentity: {
|
|
251
|
+
acceptingHaloInvitation: { acceptingRedeemedHaloInvitation: 'authenticatingHaloVerificationCode' },
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
choosingIdentity: {
|
|
256
|
+
acceptingHaloInvitation: {
|
|
257
|
+
acceptingRedeemedHaloInvitation: 'authenticationFailingHaloVerificationCode',
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
].some(joinState.matches):
|
|
262
|
+
return 'halo invitation authenticator';
|
|
263
|
+
case [
|
|
264
|
+
{
|
|
265
|
+
choosingIdentity: {
|
|
266
|
+
acceptingHaloInvitation: { acceptingRedeemedHaloInvitation: 'successHaloInvitation' },
|
|
267
|
+
},
|
|
268
|
+
},
|
|
269
|
+
'finishingJoiningHalo',
|
|
270
|
+
].some(joinState.matches):
|
|
271
|
+
return 'halo invitation accepted';
|
|
272
|
+
case joinState.matches({
|
|
273
|
+
choosingIdentity: 'confirmingAddedIdentity',
|
|
274
|
+
}):
|
|
275
|
+
return 'identity added';
|
|
276
|
+
case joinState.matches({
|
|
277
|
+
acceptingSpaceInvitation: 'inputtingSpaceInvitationCode',
|
|
278
|
+
}):
|
|
279
|
+
return 'space invitation input';
|
|
280
|
+
case [
|
|
281
|
+
{
|
|
282
|
+
acceptingSpaceInvitation: { acceptingRedeemedSpaceInvitation: 'connectingSpaceInvitation' },
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
acceptingSpaceInvitation: { acceptingRedeemedSpaceInvitation: 'failingSpaceInvitation' },
|
|
286
|
+
},
|
|
287
|
+
].some(joinState.matches):
|
|
288
|
+
return 'space invitation rescuer';
|
|
289
|
+
case [
|
|
290
|
+
{
|
|
291
|
+
acceptingSpaceInvitation: { acceptingRedeemedSpaceInvitation: 'inputtingSpaceVerificationCode' },
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
acceptingSpaceInvitation: { acceptingRedeemedSpaceInvitation: 'authenticatingSpaceVerificationCode' },
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
acceptingSpaceInvitation: {
|
|
298
|
+
acceptingRedeemedSpaceInvitation: 'authenticationFailingSpaceVerificationCode',
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
].some(joinState.matches):
|
|
302
|
+
return 'space invitation authenticator';
|
|
303
|
+
case joinState.matches('finishingJoiningSpace'):
|
|
304
|
+
return 'space invitation accepted';
|
|
305
|
+
default:
|
|
306
|
+
return 'never';
|
|
307
|
+
}
|
|
308
|
+
}, [joinState]);
|
|
309
|
+
|
|
310
|
+
const failed = useMemo(() => {
|
|
311
|
+
const result: JoinPanelImplProps['failed'] = new Set();
|
|
312
|
+
switch (true) {
|
|
313
|
+
case joinState.matches({
|
|
314
|
+
choosingIdentity: {
|
|
315
|
+
acceptingHaloInvitation: {
|
|
316
|
+
acceptingRedeemedHaloInvitation: 'authenticationFailingHaloVerificationCode',
|
|
317
|
+
},
|
|
318
|
+
},
|
|
319
|
+
}):
|
|
320
|
+
result.add('Halo');
|
|
321
|
+
break;
|
|
322
|
+
case joinState.matches({
|
|
323
|
+
acceptingSpaceInvitation: {
|
|
324
|
+
acceptingRedeemedSpaceInvitation: 'authenticationFailingSpaceVerificationCode',
|
|
325
|
+
},
|
|
326
|
+
}):
|
|
327
|
+
result.add('Space');
|
|
328
|
+
break;
|
|
329
|
+
}
|
|
330
|
+
return result;
|
|
331
|
+
}, [joinState]);
|
|
332
|
+
|
|
333
|
+
const unredeemedCodes = useMemo(
|
|
334
|
+
() => ({
|
|
335
|
+
Halo: joinState.context.halo.unredeemedCode,
|
|
336
|
+
Space: joinState.context.space.unredeemedCode,
|
|
337
|
+
}),
|
|
338
|
+
[joinState],
|
|
339
|
+
);
|
|
340
|
+
|
|
341
|
+
const spaces = useMulticastObservable(client.spaces);
|
|
342
|
+
|
|
343
|
+
const succeededKeys = useMemo(
|
|
344
|
+
() => ({
|
|
345
|
+
Space: spaces ? new Set(spaces.map(({ key }) => key.toHex())) : undefined,
|
|
346
|
+
}),
|
|
347
|
+
[spaces],
|
|
348
|
+
);
|
|
349
|
+
|
|
350
|
+
const invitationStates = useMemo(
|
|
351
|
+
() => ({
|
|
352
|
+
Halo: joinState.context.halo.invitationObservable?.get().state,
|
|
353
|
+
Space: joinState.context.space.invitationObservable?.get().state,
|
|
354
|
+
}),
|
|
355
|
+
[joinState],
|
|
356
|
+
);
|
|
357
|
+
|
|
358
|
+
const failReasons = useMemo(
|
|
359
|
+
() => ({
|
|
360
|
+
Halo: joinState.context.halo.failReason,
|
|
361
|
+
Space: joinState.context.space.failReason,
|
|
362
|
+
}),
|
|
363
|
+
[joinState],
|
|
364
|
+
);
|
|
365
|
+
|
|
366
|
+
const onHaloDone = useCallback(() => {
|
|
367
|
+
propsOnDone?.({
|
|
368
|
+
identityKey: joinState.context.halo.invitation?.identityKey ?? null,
|
|
369
|
+
swarmKey: joinState.context.halo.invitation?.swarmKey ?? null,
|
|
370
|
+
spaceKey: joinState.context.halo.invitation?.spaceKey ?? null,
|
|
371
|
+
});
|
|
372
|
+
}, [joinState, propsOnDone]);
|
|
373
|
+
|
|
374
|
+
const onSpaceDone = useCallback(() => {
|
|
375
|
+
propsOnDone?.({
|
|
376
|
+
identityKey: joinState.context.space.invitation?.identityKey ?? null,
|
|
377
|
+
swarmKey: joinState.context.space.invitation?.swarmKey ?? null,
|
|
378
|
+
spaceKey: joinState.context.space.invitation?.spaceKey ?? null,
|
|
379
|
+
});
|
|
380
|
+
}, [joinState, propsOnDone]);
|
|
381
|
+
|
|
382
|
+
return (
|
|
383
|
+
<JoinPanelImpl
|
|
384
|
+
{...{
|
|
385
|
+
titleId,
|
|
386
|
+
mode,
|
|
387
|
+
send: joinSend,
|
|
388
|
+
activeView,
|
|
389
|
+
failed,
|
|
390
|
+
failReasons,
|
|
391
|
+
pending: ['connecting', 'authenticating'].some((str) => joinState?.configuration[0].id.includes(str)),
|
|
392
|
+
unredeemedCodes,
|
|
393
|
+
invitationStates,
|
|
394
|
+
succeededKeys,
|
|
395
|
+
identity,
|
|
396
|
+
onExit,
|
|
397
|
+
exitActionParent,
|
|
398
|
+
doneActionParent,
|
|
399
|
+
onHaloDone,
|
|
400
|
+
onSpaceDone,
|
|
401
|
+
onHaloInvitationCancel: () => joinState.context.halo.invitationObservable?.cancel(),
|
|
402
|
+
onSpaceInvitationCancel: () => joinState.context.space.invitationObservable?.cancel(),
|
|
403
|
+
onHaloInvitationAuthenticate: (authCode: string) => {
|
|
404
|
+
// todo(thure): Is this necessary? Shouldn’t the observable emit this?
|
|
405
|
+
joinSend({ type: 'authenticateHaloVerificationCode' });
|
|
406
|
+
return joinState.context.halo.invitationObservable?.authenticate(authCode);
|
|
407
|
+
},
|
|
408
|
+
onSpaceInvitationAuthenticate: (authCode: string) => {
|
|
409
|
+
joinSend({ type: 'authenticateSpaceVerificationCode' });
|
|
410
|
+
return joinState.context.space.invitationObservable?.authenticate(authCode);
|
|
411
|
+
},
|
|
412
|
+
}}
|
|
413
|
+
/>
|
|
414
|
+
);
|
|
415
|
+
};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type cloneElement } from 'react';
|
|
6
|
+
|
|
7
|
+
import type { Identity } from '@dxos/react-client/halo';
|
|
8
|
+
import type { Invitation, AuthenticatingInvitationObservable, InvitationResult } from '@dxos/react-client/invitations';
|
|
9
|
+
|
|
10
|
+
import { type JoinSend } from './joinMachine';
|
|
11
|
+
import { type ResetIdentityProps, type IdentityInputProps } from './steps';
|
|
12
|
+
import { type StepProps } from '../../steps';
|
|
13
|
+
import { type FailReason } from '../../types';
|
|
14
|
+
|
|
15
|
+
export type JoinPanelMode = 'default' | 'halo-only';
|
|
16
|
+
|
|
17
|
+
export type JoinStepProps = Omit<StepProps, 'send' | 'onDone'> & {
|
|
18
|
+
send: JoinSend;
|
|
19
|
+
onDone?: (result: InvitationResult | null) => void;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export interface JoinPanelProps {
|
|
23
|
+
mode?: JoinPanelMode;
|
|
24
|
+
initialInvitationCode?: string;
|
|
25
|
+
titleId?: string;
|
|
26
|
+
exitActionParent?: Parameters<typeof cloneElement>[0];
|
|
27
|
+
doneActionParent?: Parameters<typeof cloneElement>[0];
|
|
28
|
+
onExit?: () => void;
|
|
29
|
+
onDone?: (result: InvitationResult | null) => void;
|
|
30
|
+
parseInvitationCodeInput?: (invitationCodeInput: string) => string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type JoinPanelImplProps = Pick<
|
|
34
|
+
JoinPanelProps,
|
|
35
|
+
'mode' | 'onExit' | 'onDone' | 'exitActionParent' | 'doneActionParent'
|
|
36
|
+
> & {
|
|
37
|
+
send: JoinSend;
|
|
38
|
+
titleId: string;
|
|
39
|
+
activeView: string;
|
|
40
|
+
failed: Set<'Halo' | 'Space'>;
|
|
41
|
+
pending: boolean;
|
|
42
|
+
unredeemedCodes?: Partial<{
|
|
43
|
+
Halo: string;
|
|
44
|
+
Space: string;
|
|
45
|
+
}>;
|
|
46
|
+
invitationStates?: Partial<{
|
|
47
|
+
Halo: Invitation.State;
|
|
48
|
+
Space: Invitation.State;
|
|
49
|
+
}>;
|
|
50
|
+
succeededKeys?: Partial<{
|
|
51
|
+
Halo: Set<string>;
|
|
52
|
+
Space: Set<string>;
|
|
53
|
+
}>;
|
|
54
|
+
failReasons?: Partial<{
|
|
55
|
+
Halo: FailReason | null;
|
|
56
|
+
Space: FailReason | null;
|
|
57
|
+
}>;
|
|
58
|
+
onHaloDone?: () => void;
|
|
59
|
+
onSpaceDone?: () => void;
|
|
60
|
+
onHaloInvitationCancel?: () => Promise<void> | undefined;
|
|
61
|
+
onSpaceInvitationCancel?: () => Promise<void> | undefined;
|
|
62
|
+
onHaloInvitationAuthenticate?: (authCode: string) => Promise<void> | undefined;
|
|
63
|
+
onSpaceInvitationAuthenticate?: (authCode: string) => Promise<void> | undefined;
|
|
64
|
+
IdentityInput?: React.FC<IdentityInputProps>;
|
|
65
|
+
ResetIdentity?: React.FC<ResetIdentityProps>;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export interface IdentityAction {
|
|
69
|
+
type: 'select identity' | 'added identity';
|
|
70
|
+
identity: Identity;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface EmptyJoinAction {
|
|
74
|
+
type: 'deselect identity' | 'cancel addition' | 'add identity';
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface EmptyInvitationAction {
|
|
78
|
+
type:
|
|
79
|
+
| 'authenticating invitation'
|
|
80
|
+
| 'authenticate invitation'
|
|
81
|
+
| 'cancel invitation'
|
|
82
|
+
| 'cancelled invitation'
|
|
83
|
+
| 'connect invitation'
|
|
84
|
+
| 'fail invitation'
|
|
85
|
+
| 'accepted invitation'
|
|
86
|
+
| 'timeout invitation'
|
|
87
|
+
| 'reset invitation';
|
|
88
|
+
from: 'space' | 'halo';
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface InvitationCodeAction {
|
|
92
|
+
type: 'connecting invitation';
|
|
93
|
+
from: 'space' | 'halo';
|
|
94
|
+
invitation: AuthenticatingInvitationObservable;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export type InvitationAction = EmptyInvitationAction | InvitationCodeAction;
|
|
98
|
+
|
|
99
|
+
export interface AdditionMethodAction {
|
|
100
|
+
type: 'select addition method';
|
|
101
|
+
method: 'recover identity' | 'accept device invitation' | 'create identity';
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export type JoinAction = IdentityAction | EmptyJoinAction | AdditionMethodAction | InvitationAction;
|
|
105
|
+
|
|
106
|
+
export type InvitationView =
|
|
107
|
+
| 'invitation input'
|
|
108
|
+
| 'invitation rescuer'
|
|
109
|
+
| 'invitation authenticator'
|
|
110
|
+
| 'invitation accepted';
|
|
111
|
+
|
|
112
|
+
export type JoinView =
|
|
113
|
+
| 'identity selector'
|
|
114
|
+
| 'addition method chooser'
|
|
115
|
+
| 'identity input'
|
|
116
|
+
| 'identity added'
|
|
117
|
+
| 'space invitation acceptor'
|
|
118
|
+
| 'halo invitation acceptor';
|
|
119
|
+
|
|
120
|
+
export interface JoinStateContext {
|
|
121
|
+
activeView: JoinView;
|
|
122
|
+
unredeemedSpaceInvitationCode?: string;
|
|
123
|
+
spaceInvitation?: AuthenticatingInvitationObservable;
|
|
124
|
+
spaceViewState: InvitationView;
|
|
125
|
+
spaceInvitationAnnotation?: 'authenticating' | 'authentication failed';
|
|
126
|
+
unredeemedHaloInvitationCode?: string;
|
|
127
|
+
haloInvitation?: AuthenticatingInvitationObservable;
|
|
128
|
+
haloViewState: InvitationView;
|
|
129
|
+
haloInvitationAnnotation?: 'authenticating' | 'authentication failed';
|
|
130
|
+
selectedIdentity?: Identity;
|
|
131
|
+
additionMethod?: AdditionMethodAction['method'];
|
|
132
|
+
}
|