@dxos/shell 0.7.5-labs.e27f9b9 → 0.7.5-labs.f400bbc
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/dist/bundle/{shell.mjs → shell.js} +7142 -7159
- package/dist/bundle/shell.js.map +1 -0
- package/dist/bundle/shell.umd.cjs +1045 -0
- package/dist/bundle/shell.umd.cjs.map +1 -0
- package/dist/bundle/style.css +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react.mjs +53 -37
- package/dist/lib/browser/react.mjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/react.cjs +49 -33
- package/dist/lib/node/react.cjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react.mjs +53 -37
- package/dist/lib/node-esm/react.mjs.map +3 -3
- package/dist/types/src/components/AgentConfig.d.ts +1 -2
- package/dist/types/src/components/AgentConfig.d.ts.map +1 -1
- package/dist/types/src/components/AgentConfig.js +20 -50
- package/dist/types/src/components/AgentConfig.js.map +1 -1
- package/dist/types/src/components/AuthCode.d.ts +2 -2
- package/dist/types/src/components/AuthCode.d.ts.map +1 -1
- package/dist/types/src/components/AuthCode.js +6 -44
- package/dist/types/src/components/AuthCode.js.map +1 -1
- package/dist/types/src/components/CompoundButton/CompoundButton.d.ts +2 -2
- package/dist/types/src/components/CompoundButton/CompoundButton.d.ts.map +1 -1
- package/dist/types/src/components/CompoundButton/CompoundButton.js +9 -24
- package/dist/types/src/components/CompoundButton/CompoundButton.js.map +1 -1
- package/dist/types/src/components/CompoundButton/CompoundButton.stories.d.ts +8 -9
- package/dist/types/src/components/CompoundButton/CompoundButton.stories.d.ts.map +1 -1
- package/dist/types/src/components/CompoundButton/CompoundButton.stories.js +17 -25
- package/dist/types/src/components/CompoundButton/CompoundButton.stories.js.map +1 -1
- package/dist/types/src/components/CompoundButton/index.js +1 -17
- package/dist/types/src/components/CompoundButton/index.js.map +1 -1
- package/dist/types/src/components/DeviceList/DeviceList.d.ts +1 -2
- package/dist/types/src/components/DeviceList/DeviceList.d.ts.map +1 -1
- package/dist/types/src/components/DeviceList/DeviceList.js +10 -24
- package/dist/types/src/components/DeviceList/DeviceList.js.map +1 -1
- package/dist/types/src/components/DeviceList/DeviceListItem.d.ts +1 -1
- package/dist/types/src/components/DeviceList/DeviceListItem.js +18 -73
- package/dist/types/src/components/DeviceList/DeviceListItem.js.map +1 -1
- package/dist/types/src/components/DeviceList/DeviceListProps.js +0 -2
- package/dist/types/src/components/DeviceList/DeviceListProps.js.map +1 -1
- package/dist/types/src/components/DeviceList/index.js +2 -18
- package/dist/types/src/components/DeviceList/index.js.map +1 -1
- package/dist/types/src/components/IdentityList/IdentityListItem.d.ts +1 -1
- package/dist/types/src/components/IdentityList/IdentityListItem.js +12 -51
- package/dist/types/src/components/IdentityList/IdentityListItem.js.map +1 -1
- package/dist/types/src/components/IdentityList/SpaceMemberList.d.ts +2 -3
- package/dist/types/src/components/IdentityList/SpaceMemberList.d.ts.map +1 -1
- package/dist/types/src/components/IdentityList/SpaceMemberList.js +17 -55
- package/dist/types/src/components/IdentityList/SpaceMemberList.js.map +1 -1
- package/dist/types/src/components/IdentityList/SpaceMemberList.stories.d.ts +3 -4
- package/dist/types/src/components/IdentityList/SpaceMemberList.stories.d.ts.map +1 -1
- package/dist/types/src/components/IdentityList/SpaceMemberList.stories.js +10 -17
- package/dist/types/src/components/IdentityList/SpaceMemberList.stories.js.map +1 -1
- package/dist/types/src/components/IdentityList/index.js +2 -18
- package/dist/types/src/components/IdentityList/index.js.map +1 -1
- package/dist/types/src/components/InvitationList/InvitationList.d.ts +2 -2
- package/dist/types/src/components/InvitationList/InvitationList.d.ts.map +1 -1
- package/dist/types/src/components/InvitationList/InvitationList.js +10 -20
- package/dist/types/src/components/InvitationList/InvitationList.js.map +1 -1
- package/dist/types/src/components/InvitationList/InvitationList.stories.d.ts +3 -4
- package/dist/types/src/components/InvitationList/InvitationList.stories.d.ts.map +1 -1
- package/dist/types/src/components/InvitationList/InvitationList.stories.js +20 -27
- package/dist/types/src/components/InvitationList/InvitationList.stories.js.map +1 -1
- package/dist/types/src/components/InvitationList/InvitationListContainer.d.ts +1 -2
- package/dist/types/src/components/InvitationList/InvitationListContainer.d.ts.map +1 -1
- package/dist/types/src/components/InvitationList/InvitationListContainer.js +9 -45
- package/dist/types/src/components/InvitationList/InvitationListContainer.js.map +1 -1
- package/dist/types/src/components/InvitationList/InvitationListItem.d.ts +3 -3
- package/dist/types/src/components/InvitationList/InvitationListItem.d.ts.map +1 -1
- package/dist/types/src/components/InvitationList/InvitationListItem.js +32 -99
- package/dist/types/src/components/InvitationList/InvitationListItem.js.map +1 -1
- package/dist/types/src/components/InvitationList/InvitationListProps.js +0 -2
- package/dist/types/src/components/InvitationList/index.js +3 -19
- package/dist/types/src/components/InvitationList/index.js.map +1 -1
- package/dist/types/src/components/Panel/Action.js +15 -68
- package/dist/types/src/components/Panel/Action.js.map +1 -1
- package/dist/types/src/components/Panel/Actions.js +6 -41
- package/dist/types/src/components/Panel/Actions.js.map +1 -1
- package/dist/types/src/components/Panel/CloseButton.d.ts +1 -2
- package/dist/types/src/components/Panel/CloseButton.d.ts.map +1 -1
- package/dist/types/src/components/Panel/CloseButton.js +7 -16
- package/dist/types/src/components/Panel/CloseButton.js.map +1 -1
- package/dist/types/src/components/Panel/Emoji.d.ts +3 -3
- package/dist/types/src/components/Panel/Emoji.d.ts.map +1 -1
- package/dist/types/src/components/Panel/Emoji.js +6 -19
- package/dist/types/src/components/Panel/Emoji.js.map +1 -1
- package/dist/types/src/components/Panel/Heading.js +5 -44
- package/dist/types/src/components/Panel/Heading.js.map +1 -1
- package/dist/types/src/components/Panel/Input.d.ts +2 -2
- package/dist/types/src/components/Panel/Input.d.ts.map +1 -1
- package/dist/types/src/components/Panel/Input.js +4 -17
- package/dist/types/src/components/Panel/Input.js.map +1 -1
- package/dist/types/src/components/Panel/Label.d.ts +2 -2
- package/dist/types/src/components/Panel/Label.d.ts.map +1 -1
- package/dist/types/src/components/Panel/Label.js +4 -14
- package/dist/types/src/components/Panel/Label.js.map +1 -1
- package/dist/types/src/components/Panel/Panel.stories.d.ts +4 -5
- package/dist/types/src/components/Panel/Panel.stories.d.ts.map +1 -1
- package/dist/types/src/components/Panel/Panel.stories.js +15 -35
- package/dist/types/src/components/Panel/Panel.stories.js.map +1 -1
- package/dist/types/src/components/Panel/StepHeading.js +5 -40
- package/dist/types/src/components/Panel/StepHeading.js.map +1 -1
- package/dist/types/src/components/Panel/index.js +8 -24
- package/dist/types/src/components/Panel/index.js.map +1 -1
- package/dist/types/src/components/SpaceListItem.js +10 -49
- package/dist/types/src/components/SpaceListItem.js.map +1 -1
- package/dist/types/src/components/StorybookDialog.d.ts +2 -2
- package/dist/types/src/components/StorybookDialog.d.ts.map +1 -1
- package/dist/types/src/components/StorybookDialog.js +5 -18
- package/dist/types/src/components/StorybookDialog.js.map +1 -1
- package/dist/types/src/components/Viewport/Viewport.d.ts +2 -2
- package/dist/types/src/components/Viewport/Viewport.js +18 -55
- package/dist/types/src/components/Viewport/Viewport.js.map +1 -1
- package/dist/types/src/components/Viewport/Viewport.stories.d.ts +2 -3
- package/dist/types/src/components/Viewport/Viewport.stories.d.ts.map +1 -1
- package/dist/types/src/components/Viewport/Viewport.stories.js +12 -37
- package/dist/types/src/components/Viewport/Viewport.stories.js.map +1 -1
- package/dist/types/src/components/Viewport/index.js +1 -17
- package/dist/types/src/components/Viewport/index.js.map +1 -1
- package/dist/types/src/components/index.js +9 -25
- package/dist/types/src/components/index.js.map +1 -1
- package/dist/types/src/composites/IdentityDialog/IdentityDialog.d.ts +1 -2
- package/dist/types/src/composites/IdentityDialog/IdentityDialog.d.ts.map +1 -1
- package/dist/types/src/composites/IdentityDialog/IdentityDialog.js +7 -22
- package/dist/types/src/composites/IdentityDialog/IdentityDialog.js.map +1 -1
- package/dist/types/src/composites/IdentityDialog/index.js +1 -17
- package/dist/types/src/composites/IdentityDialog/index.js.map +1 -1
- package/dist/types/src/composites/JoinDialog/JoinDialog.d.ts +1 -2
- package/dist/types/src/composites/JoinDialog/JoinDialog.d.ts.map +1 -1
- package/dist/types/src/composites/JoinDialog/JoinDialog.js +9 -23
- package/dist/types/src/composites/JoinDialog/JoinDialog.js.map +1 -1
- package/dist/types/src/composites/JoinDialog/index.js +1 -17
- package/dist/types/src/composites/JoinDialog/index.js.map +1 -1
- package/dist/types/src/composites/Shell/Shell.d.ts +1 -2
- package/dist/types/src/composites/Shell/Shell.d.ts.map +1 -1
- package/dist/types/src/composites/Shell/Shell.js +54 -90
- package/dist/types/src/composites/Shell/Shell.js.map +1 -1
- package/dist/types/src/composites/Shell/ShellContext.d.ts +2 -2
- package/dist/types/src/composites/Shell/ShellContext.d.ts.map +1 -1
- package/dist/types/src/composites/Shell/ShellContext.js +32 -72
- package/dist/types/src/composites/Shell/ShellContext.js.map +1 -1
- package/dist/types/src/composites/Shell/index.js +3 -19
- package/dist/types/src/composites/Shell/index.js.map +1 -1
- package/dist/types/src/composites/Shell/memory-shell-runtime.js +7 -11
- package/dist/types/src/composites/Shell/memory-shell-runtime.js.map +1 -1
- package/dist/types/src/composites/Shell/run-shell.js +18 -67
- package/dist/types/src/composites/Shell/run-shell.js.map +1 -1
- package/dist/types/src/composites/Shell/shell-runtime.js +13 -17
- package/dist/types/src/composites/Shell/shell-runtime.js.map +1 -1
- package/dist/types/src/composites/SpaceDialog/SpaceDialog.d.ts +1 -2
- package/dist/types/src/composites/SpaceDialog/SpaceDialog.d.ts.map +1 -1
- package/dist/types/src/composites/SpaceDialog/SpaceDialog.js +7 -22
- package/dist/types/src/composites/SpaceDialog/SpaceDialog.js.map +1 -1
- package/dist/types/src/composites/SpaceDialog/index.js +1 -17
- package/dist/types/src/composites/SpaceDialog/index.js.map +1 -1
- package/dist/types/src/composites/StatusDialog/StatusDialog.d.ts +1 -2
- package/dist/types/src/composites/StatusDialog/StatusDialog.d.ts.map +1 -1
- package/dist/types/src/composites/StatusDialog/StatusDialog.js +6 -20
- package/dist/types/src/composites/StatusDialog/StatusDialog.js.map +1 -1
- package/dist/types/src/composites/StatusDialog/index.js +1 -17
- package/dist/types/src/composites/StatusDialog/index.js.map +1 -1
- package/dist/types/src/composites/index.js +4 -20
- package/dist/types/src/composites/index.js.map +1 -1
- package/dist/types/src/index.js +2 -6
- package/dist/types/src/index.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.d.ts +2 -3
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js +63 -138
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.d.ts +11 -12
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.js +39 -56
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.d.ts +2 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.js +0 -2
- package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/identityMachine.js +10 -14
- package/dist/types/src/panels/IdentityPanel/identityMachine.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/index.js +2 -18
- package/dist/types/src/panels/IdentityPanel/index.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.d.ts +2 -3
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js +16 -29
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.d.ts +1 -2
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.js +27 -73
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/index.js +2 -18
- package/dist/types/src/panels/IdentityPanel/steps/index.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/useAgentHandlers.js +7 -11
- package/dist/types/src/panels/IdentityPanel/useAgentHandlers.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/useEdgeAgentsHandlers.js +19 -23
- package/dist/types/src/panels/IdentityPanel/useEdgeAgentsHandlers.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/useKubeAgentHandlers.js +19 -23
- package/dist/types/src/panels/IdentityPanel/useKubeAgentHandlers.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinHeading.js +11 -48
- package/dist/types/src/panels/JoinPanel/JoinHeading.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.d.ts +2 -3
- package/dist/types/src/panels/JoinPanel/JoinPanel.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.js +38 -100
- package/dist/types/src/panels/JoinPanel/JoinPanel.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.stories.d.ts +15 -16
- package/dist/types/src/panels/JoinPanel/JoinPanel.stories.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.stories.js +25 -45
- package/dist/types/src/panels/JoinPanel/JoinPanel.stories.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanelProps.js +0 -2
- package/dist/types/src/panels/JoinPanel/JoinPanelProps.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/index.js +2 -18
- package/dist/types/src/panels/JoinPanel/index.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/joinMachine.js +49 -54
- package/dist/types/src/panels/JoinPanel/joinMachine.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/AdditionMethodChooser.d.ts +1 -2
- package/dist/types/src/panels/JoinPanel/steps/AdditionMethodChooser.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/AdditionMethodChooser.js +9 -21
- package/dist/types/src/panels/JoinPanel/steps/AdditionMethodChooser.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/IdentityAdded.d.ts +1 -2
- package/dist/types/src/panels/JoinPanel/steps/IdentityAdded.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/IdentityAdded.js +14 -58
- package/dist/types/src/panels/JoinPanel/steps/IdentityAdded.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/IdentityInput.d.ts +2 -3
- package/dist/types/src/panels/JoinPanel/steps/IdentityInput.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/IdentityInput.js +19 -60
- package/dist/types/src/panels/JoinPanel/steps/IdentityInput.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/InvitationAccepted.d.ts +2 -2
- package/dist/types/src/panels/JoinPanel/steps/InvitationAccepted.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/InvitationAccepted.js +8 -47
- package/dist/types/src/panels/JoinPanel/steps/InvitationAccepted.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/InvitationAuthenticator.d.ts +1 -2
- package/dist/types/src/panels/JoinPanel/steps/InvitationAuthenticator.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/InvitationAuthenticator.js +22 -73
- package/dist/types/src/panels/JoinPanel/steps/InvitationAuthenticator.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/InvitationInput.d.ts +1 -2
- package/dist/types/src/panels/JoinPanel/steps/InvitationInput.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/InvitationInput.js +18 -59
- package/dist/types/src/panels/JoinPanel/steps/InvitationInput.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/InvitationRescuer.d.ts +1 -2
- package/dist/types/src/panels/JoinPanel/steps/InvitationRescuer.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/InvitationRescuer.js +14 -37
- package/dist/types/src/panels/JoinPanel/steps/InvitationRescuer.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/index.js +7 -23
- package/dist/types/src/panels/JoinPanel/steps/index.js.map +1 -1
- package/dist/types/src/panels/Panels.stories.d.ts +4 -4
- package/dist/types/src/panels/Panels.stories.d.ts.map +1 -1
- package/dist/types/src/panels/Panels.stories.js +13 -58
- package/dist/types/src/panels/Panels.stories.js.map +1 -1
- package/dist/types/src/panels/SpacePanel/SpacePanel.d.ts +2 -3
- package/dist/types/src/panels/SpacePanel/SpacePanel.d.ts.map +1 -1
- package/dist/types/src/panels/SpacePanel/SpacePanel.js +25 -72
- package/dist/types/src/panels/SpacePanel/SpacePanel.js.map +1 -1
- package/dist/types/src/panels/SpacePanel/SpacePanel.stories.d.ts +18 -19
- package/dist/types/src/panels/SpacePanel/SpacePanel.stories.d.ts.map +1 -1
- package/dist/types/src/panels/SpacePanel/SpacePanel.stories.js +96 -126
- package/dist/types/src/panels/SpacePanel/SpacePanel.stories.js.map +1 -1
- package/dist/types/src/panels/SpacePanel/SpacePanelProps.js +0 -2
- package/dist/types/src/panels/SpacePanel/SpacePanelProps.js.map +1 -1
- package/dist/types/src/panels/SpacePanel/index.js +2 -18
- package/dist/types/src/panels/SpacePanel/index.js.map +1 -1
- package/dist/types/src/panels/SpacePanel/spaceMachine.js +9 -13
- package/dist/types/src/panels/SpacePanel/spaceMachine.js.map +1 -1
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.d.ts +3 -3
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.d.ts.map +1 -1
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.js +33 -81
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.js.map +1 -1
- package/dist/types/src/panels/SpacePanel/steps/index.js +1 -17
- package/dist/types/src/panels/SpacePanel/steps/index.js.map +1 -1
- package/dist/types/src/panels/StatusPanel/StatusPanel.d.ts +1 -2
- package/dist/types/src/panels/StatusPanel/StatusPanel.d.ts.map +1 -1
- package/dist/types/src/panels/StatusPanel/StatusPanel.js +5 -17
- package/dist/types/src/panels/StatusPanel/StatusPanel.js.map +1 -1
- package/dist/types/src/panels/StatusPanel/index.js +1 -17
- package/dist/types/src/panels/StatusPanel/index.js.map +1 -1
- package/dist/types/src/panels/index.js +4 -20
- package/dist/types/src/panels/index.js.map +1 -1
- package/dist/types/src/playwright/invitations-manager.js +11 -15
- package/dist/types/src/playwright/invitations-manager.js.map +1 -1
- package/dist/types/src/playwright/invitations.spec.js +64 -66
- package/dist/types/src/playwright/invitations.spec.js.map +1 -1
- package/dist/types/src/react.js +6 -22
- package/dist/types/src/react.js.map +1 -1
- package/dist/types/src/steps/ConfirmReset.d.ts +2 -3
- package/dist/types/src/steps/ConfirmReset.d.ts.map +1 -1
- package/dist/types/src/steps/ConfirmReset.js +23 -70
- package/dist/types/src/steps/ConfirmReset.js.map +1 -1
- package/dist/types/src/steps/InvitationManager.d.ts +1 -2
- package/dist/types/src/steps/InvitationManager.d.ts.map +1 -1
- package/dist/types/src/steps/InvitationManager.js +17 -71
- package/dist/types/src/steps/InvitationManager.js.map +1 -1
- package/dist/types/src/steps/StepProps.js +0 -2
- package/dist/types/src/steps/StepProps.js.map +1 -1
- package/dist/types/src/steps/index.js +3 -19
- package/dist/types/src/steps/index.js.map +1 -1
- package/dist/types/src/stories/Invitations.e2e-stories.d.ts +2 -3
- package/dist/types/src/stories/Invitations.e2e-stories.d.ts.map +1 -1
- package/dist/types/src/stories/Invitations.e2e-stories.js +50 -113
- package/dist/types/src/stories/Invitations.e2e-stories.js.map +1 -1
- package/dist/types/src/styles/index.js +2 -18
- package/dist/types/src/styles/index.js.map +1 -1
- package/dist/types/src/styles/invitationStatusStyles.js +31 -37
- package/dist/types/src/styles/invitationStatusStyles.js.map +1 -1
- package/dist/types/src/styles/panelStyles.js +1 -4
- package/dist/types/src/styles/panelStyles.js.map +1 -1
- package/dist/types/src/testing/fixtures/identities.js +8 -11
- package/dist/types/src/testing/fixtures/identities.js.map +1 -1
- package/dist/types/src/testing/fixtures/index.js +2 -18
- package/dist/types/src/testing/fixtures/index.js.map +1 -1
- package/dist/types/src/testing/fixtures/invitations.js +8 -12
- package/dist/types/src/testing/fixtures/invitations.js.map +1 -1
- package/dist/types/src/testing/index.js +2 -18
- package/dist/types/src/testing/index.js.map +1 -1
- package/dist/types/src/testing/scoped-shell-manager.js +1 -5
- package/dist/types/src/testing/scoped-shell-manager.js.map +1 -1
- package/dist/types/src/testing/shell-manager.js +11 -15
- package/dist/types/src/testing/shell-manager.js.map +1 -1
- package/dist/types/src/translations/index.js +2 -38
- package/dist/types/src/translations/index.js.map +1 -1
- package/dist/types/src/translations/locales/en-US.d.ts +5 -1
- package/dist/types/src/translations/locales/en-US.d.ts.map +1 -1
- package/dist/types/src/translations/locales/en-US.js +9 -7
- package/dist/types/src/translations/locales/en-US.js.map +1 -1
- package/dist/types/src/types/FailReason.js +0 -2
- package/dist/types/src/types/FailReason.js.map +1 -1
- package/dist/types/src/types/IInvitation.js +0 -2
- package/dist/types/src/types/IInvitation.js.map +1 -1
- package/dist/types/src/types/index.js +2 -18
- package/dist/types/src/types/index.js.map +1 -1
- package/dist/types/src/util/index.js +1 -17
- package/dist/types/src/util/index.js.map +1 -1
- package/dist/types/src/util/invitationStatusValue.js +11 -14
- package/dist/types/src/util/invitationStatusValue.js.map +1 -1
- package/package.json +31 -27
- package/src/panels/IdentityPanel/IdentityPanel.stories.tsx +1 -0
- package/src/panels/IdentityPanel/IdentityPanel.tsx +49 -33
- package/src/panels/IdentityPanel/IdentityPanelProps.ts +8 -1
- package/src/panels/IdentityPanel/steps/ProfileForm.tsx +2 -7
- package/src/translations/locales/en-US.ts +10 -3
- package/dist/bundle/shell.mjs.map +0 -1
- package/dist/bundle/shell.umd.js +0 -1045
- package/dist/bundle/shell.umd.js.map +0 -1
- package/dist/types/src/playwright/playwright.config.d.ts +0 -3
- package/dist/types/src/playwright/playwright.config.d.ts.map +0 -1
- package/dist/types/src/playwright/playwright.config.js +0 -18
- package/dist/types/src/playwright/playwright.config.js.map +0 -1
- /package/src/playwright/{playwright.config.ts → playwright.config.cts} +0 -0
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2023 DXOS.org
|
|
4
3
|
//
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const log_1 = require("@dxos/log");
|
|
10
|
-
const identityMachine = (0, xstate_1.createMachine)({
|
|
4
|
+
import { useMachine } from '@xstate/react';
|
|
5
|
+
import { assign, createMachine } from 'xstate';
|
|
6
|
+
import { log } from '@dxos/log';
|
|
7
|
+
const identityMachine = createMachine({
|
|
11
8
|
id: 'identity',
|
|
12
9
|
predictableActionArguments: true,
|
|
13
10
|
context: {
|
|
@@ -44,26 +41,25 @@ const identityMachine = (0, xstate_1.createMachine)({
|
|
|
44
41
|
initiallyManagingDeviceInvitation: ({ initialDisposition }, _event) => initialDisposition === 'manage-device-invitation',
|
|
45
42
|
},
|
|
46
43
|
actions: {
|
|
47
|
-
setIdentity:
|
|
44
|
+
setIdentity: assign({
|
|
48
45
|
identity: (context, event) => { var _a; return (_a = event === null || event === void 0 ? void 0 : event.identity) !== null && _a !== void 0 ? _a : null; },
|
|
49
46
|
}),
|
|
50
|
-
setInvitation:
|
|
47
|
+
setInvitation: assign({
|
|
51
48
|
invitation: (context, event) => { var _a; return (_a = event === null || event === void 0 ? void 0 : event.invitation) !== null && _a !== void 0 ? _a : null; },
|
|
52
49
|
}),
|
|
53
|
-
unsetInvitation:
|
|
50
|
+
unsetInvitation: assign({
|
|
54
51
|
invitation: () => undefined,
|
|
55
52
|
}),
|
|
56
53
|
log: (context, event) => {
|
|
57
|
-
|
|
54
|
+
log('[transition]', {
|
|
58
55
|
event,
|
|
59
56
|
context,
|
|
60
57
|
});
|
|
61
58
|
},
|
|
62
59
|
},
|
|
63
60
|
});
|
|
64
|
-
exports.identityMachine = identityMachine;
|
|
65
61
|
const useIdentityMachine = (client, options) => {
|
|
66
|
-
return
|
|
62
|
+
return useMachine(identityMachine, {
|
|
67
63
|
...options,
|
|
68
64
|
context: {
|
|
69
65
|
...options === null || options === void 0 ? void 0 : options.context,
|
|
@@ -75,5 +71,5 @@ const useIdentityMachine = (client, options) => {
|
|
|
75
71
|
},
|
|
76
72
|
});
|
|
77
73
|
};
|
|
78
|
-
|
|
74
|
+
export { identityMachine, useIdentityMachine };
|
|
79
75
|
//# sourceMappingURL=identityMachine.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identityMachine.js","sourceRoot":"","sources":["../../../../../src/panels/IdentityPanel/identityMachine.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"identityMachine.js","sourceRoot":"","sources":["../../../../../src/panels/IdentityPanel/identityMachine.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,aAAa,EAA2D,MAAM,QAAQ,CAAC;AAExG,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAwChC,MAAM,eAAe,GAAG,aAAa,CACnC;IACE,EAAE,EAAE,UAAU;IACd,0BAA0B,EAAE,IAAI;IAChC,OAAO,EAAE;QACP,QAAQ,EAAE,IAAI;QACd,oBAAoB,EAAE,IAAI;KAC3B;IACD,OAAO,EAAE,gBAAgB;IACzB,MAAM,EAAE;QACN,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,oBAAqB;KAChD;IACD,MAAM,EAAE;QACN,OAAO,EAAE;YACP,MAAM,EAAE;gBACN,EAAE,IAAI,EAAE,mCAAmC,EAAE,MAAM,EAAE,0BAA0B,EA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,OAAA,MAAC,KAA6C,aAA7C,KAAK,uBAAL,KAAK,CAA0C,UAAU,mCAAI,IAAI,CAAA,EAAA;SACnG,CAAC;QACF,eAAe,EAAE,MAAM,CAAwC;YAC7D,UAAU,EAAE,GAAG,EAAE,CAAC,SAAS;SAC5B,CAAC;QACF,GAAG,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;YACtB,GAAG,CAAC,cAAc,EAAE;gBAClB,KAAK;gBACL,OAAO;aACR,CAAC,CAAC;QACL,CAAC;KACF;CACF,CACF,CAAC;AAOF,MAAM,kBAAkB,GAAG,CAAC,MAAc,EAAE,OAA2D,EAAE,EAAE;IACzG,OAAO,UAAU,CAAC,eAAe,EAAE;QACjC,GAAG,OAAO;QACV,OAAO,EAAE;YACP,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO;YACnB,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE;YACpC,oBAAoB,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;gBAC5D,IAAI,EAAE,aAAa;gBACnB,QAAQ;aACT,CAAC,CAA0C;SAC7C;KACF,CAAC,CAAC;AACL,CAAC,CAAC;AAUF,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -1,22 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2023 DXOS.org
|
|
4
3
|
//
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
-
}
|
|
11
|
-
Object.defineProperty(o, k2, desc);
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
|
-
};
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
__exportStar(require("./IdentityPanel"), exports);
|
|
21
|
-
__exportStar(require("./IdentityPanelProps"), exports);
|
|
4
|
+
export * from './IdentityPanel';
|
|
5
|
+
export * from './IdentityPanelProps';
|
|
22
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/panels/IdentityPanel/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/panels/IdentityPanel/index.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { type AgentFormProps, type DeviceListProps } from '../../../components';
|
|
3
2
|
import { type IdentityPanelStepProps } from '../IdentityPanelProps';
|
|
4
3
|
export type IdentityActionChooserProps = IdentityPanelStepProps;
|
|
5
|
-
export declare const IdentityActionChooser: (props: IdentityPanelStepProps) =>
|
|
4
|
+
export declare const IdentityActionChooser: (props: IdentityPanelStepProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
export type IdentityActionChooserImplProps = IdentityActionChooserProps & Partial<AgentFormProps> & Pick<DeviceListProps, 'onClickAdd' | 'onClickJoinExisting' | 'onClickRecover' | 'onClickReset'>;
|
|
7
|
-
export declare const IdentityActionChooserImpl: ({ devices, connectionState, agentHostingEnabled, onClickAdd, onClickJoinExisting, onClickRecover, onClickReset, ...agentProps }: IdentityActionChooserImplProps) =>
|
|
6
|
+
export declare const IdentityActionChooserImpl: ({ devices, connectionState, agentHostingEnabled, onClickAdd, onClickJoinExisting, onClickRecover, onClickReset, ...agentProps }: IdentityActionChooserImplProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
7
|
//# sourceMappingURL=IdentityActionChooser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdentityActionChooser.d.ts","sourceRoot":"","sources":["../../../../../../src/panels/IdentityPanel/steps/IdentityActionChooser.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IdentityActionChooser.d.ts","sourceRoot":"","sources":["../../../../../../src/panels/IdentityPanel/steps/IdentityActionChooser.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAe,KAAK,cAAc,EAAc,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACzG,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAEpE,MAAM,MAAM,0BAA0B,GAAG,sBAAsB,CAAC;AAEhE,eAAO,MAAM,qBAAqB,UAAW,sBAAsB,4CA6BlE,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,0BAA0B,GACrE,OAAO,CAAC,cAAc,CAAC,GACvB,IAAI,CAAC,eAAe,EAAE,YAAY,GAAG,qBAAqB,GAAG,gBAAgB,GAAG,cAAc,CAAC,CAAC;AAElG,eAAO,MAAM,yBAAyB,oIASnC,8BAA8B,4CAkBhC,CAAC"}
|
|
@@ -1,23 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.IdentityActionChooserImpl = exports.IdentityActionChooser = void 0;
|
|
10
|
-
const react_1 = __importDefault(require("react"));
|
|
11
|
-
const log_1 = require("@dxos/log");
|
|
12
|
-
const react_client_1 = require("@dxos/react-client");
|
|
13
|
-
const halo_1 = require("@dxos/react-client/halo");
|
|
14
|
-
const invitations_1 = require("@dxos/react-client/invitations");
|
|
15
|
-
const components_1 = require("../../../components");
|
|
16
|
-
const IdentityActionChooser = (props) => {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { log } from '@dxos/log';
|
|
3
|
+
import { useClient } from '@dxos/react-client';
|
|
4
|
+
import { useHaloInvitations, DeviceType } from '@dxos/react-client/halo';
|
|
5
|
+
import { Invitation, InvitationEncoder } from '@dxos/react-client/invitations';
|
|
6
|
+
import { AgentConfig, DeviceList } from '../../../components';
|
|
7
|
+
export const IdentityActionChooser = (props) => {
|
|
17
8
|
var _a, _b, _c;
|
|
18
9
|
const { send } = props;
|
|
19
|
-
const client =
|
|
20
|
-
const invitations =
|
|
10
|
+
const client = useClient();
|
|
11
|
+
const invitations = useHaloInvitations();
|
|
21
12
|
const createInvitation = () => {
|
|
22
13
|
var _a, _b, _c;
|
|
23
14
|
invitations.forEach((invitation) => invitation.cancel());
|
|
@@ -25,9 +16,9 @@ const IdentityActionChooser = (props) => {
|
|
|
25
16
|
const invitation = client.halo.share();
|
|
26
17
|
if (((_c = (_b = (_a = client.config.values.runtime) === null || _a === void 0 ? void 0 : _a.app) === null || _b === void 0 ? void 0 : _b.env) === null || _c === void 0 ? void 0 : _c.DX_ENVIRONMENT) !== 'production') {
|
|
27
18
|
const subscription = invitation.subscribe((invitation) => {
|
|
28
|
-
const invitationCode =
|
|
29
|
-
if (invitation.state ===
|
|
30
|
-
|
|
19
|
+
const invitationCode = InvitationEncoder.encode(invitation);
|
|
20
|
+
if (invitation.state === Invitation.State.CONNECTING) {
|
|
21
|
+
log.info(JSON.stringify({ invitationCode, authCode: invitation.authCode }));
|
|
31
22
|
subscription.unsubscribe();
|
|
32
23
|
}
|
|
33
24
|
});
|
|
@@ -35,14 +26,10 @@ const IdentityActionChooser = (props) => {
|
|
|
35
26
|
send === null || send === void 0 ? void 0 : send({ type: 'selectInvitation', invitation });
|
|
36
27
|
};
|
|
37
28
|
const isProduction = ((_c = (_b = (_a = client.config.values.runtime) === null || _a === void 0 ? void 0 : _a.app) === null || _b === void 0 ? void 0 : _b.env) === null || _c === void 0 ? void 0 : _c.DX_ENVIRONMENT) === 'production';
|
|
38
|
-
return (
|
|
29
|
+
return (_jsx(IdentityActionChooserImpl, { ...props, onClickAdd: createInvitation, onClickJoinExisting: () => send === null || send === void 0 ? void 0 : send({ type: 'chooseJoinNewIdentity' }), onClickRecover: isProduction ? undefined : () => send === null || send === void 0 ? void 0 : send({ type: 'chooseRecoverIdentity' }), onClickReset: () => send === null || send === void 0 ? void 0 : send({ type: 'chooseResetStorage' }) }));
|
|
39
30
|
};
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
return (react_1.default.createElement("div", { role: 'none', className: 'bs-40 grow overflow-y-auto' },
|
|
44
|
-
react_1.default.createElement(components_1.DeviceList, { devices: devices, connectionState: connectionState, onClickAdd: onClickAdd, onClickJoinExisting: onClickJoinExisting, onClickRecover: agentProps.agentStatus === 'created' ? onClickRecover : undefined, onClickReset: onClickReset, onAgentDestroy: agentProps.onAgentDestroy }),
|
|
45
|
-
!edgeDeviceAvailable && agentHostingEnabled && react_1.default.createElement(components_1.AgentConfig, { ...agentProps })));
|
|
31
|
+
export const IdentityActionChooserImpl = ({ devices, connectionState, agentHostingEnabled, onClickAdd, onClickJoinExisting, onClickRecover, onClickReset, ...agentProps }) => {
|
|
32
|
+
const edgeDeviceAvailable = devices.find((device) => { var _a, _b, _c; return ((_a = device.profile) === null || _a === void 0 ? void 0 : _a.type) === DeviceType.AGENT_MANAGED && ((_c = (_b = device.profile) === null || _b === void 0 ? void 0 : _b.os) === null || _c === void 0 ? void 0 : _c.toUpperCase()) === 'EDGE'; });
|
|
33
|
+
return (_jsxs("div", { role: 'none', className: 'bs-40 grow overflow-y-auto', children: [_jsx(DeviceList, { devices: devices, connectionState: connectionState, onClickAdd: onClickAdd, onClickJoinExisting: onClickJoinExisting, onClickRecover: agentProps.agentStatus === 'created' ? onClickRecover : undefined, onClickReset: onClickReset, onAgentDestroy: agentProps.onAgentDestroy }), !edgeDeviceAvailable && agentHostingEnabled && _jsx(AgentConfig, { ...agentProps })] }));
|
|
46
34
|
};
|
|
47
|
-
exports.IdentityActionChooserImpl = IdentityActionChooserImpl;
|
|
48
35
|
//# sourceMappingURL=IdentityActionChooser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdentityActionChooser.js","sourceRoot":"","sources":["../../../../../../src/panels/IdentityPanel/steps/IdentityActionChooser.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"IdentityActionChooser.js","sourceRoot":"","sources":["../../../../../../src/panels/IdentityPanel/steps/IdentityActionChooser.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAE/E,OAAO,EAAE,WAAW,EAAuB,UAAU,EAAwB,MAAM,qBAAqB,CAAC;AAKzG,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,KAA6B,EAAE,EAAE;;IACrE,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IACvB,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,WAAW,GAAG,kBAAkB,EAAE,CAAC;IACzC,MAAM,gBAAgB,GAAG,GAAG,EAAE;;QAC5B,WAAW,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC;QACzD,2DAA2D;QAC3D,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK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GAAG,EAAE,CAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAG,EAAE,IAAI,EAAE,oBAAoB,EAAE,CAAC,GAC1D,CACH,CAAC;AACJ,CAAC,CAAC;AAMF,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,EACxC,OAAO,EACP,eAAe,EACf,mBAAmB,EACnB,UAAU,EACV,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,GAAG,UAAU,EACkB,EAAE,EAAE;IACnC,MAAM,mBAAmB,GAAG,OAAO,CAAC,IAAI,CACtC,CAAC,MAAM,EAAE,EAAE,mBAAC,OAAA,CAAA,MAAA,MAAM,CAAC,OAAO,0CAAE,IAAI,MAAK,UAAU,CAAC,aAAa,IAAI,CAAA,MAAA,MAAA,MAAM,CAAC,OAAO,0CAAE,EAAE,0CAAE,WAAW,EAAE,MAAK,MAAM,CAAA,EAAA,CAC9G,CAAC;IACF,OAAO,CACL,eAAK,IAAI,EAAC,MAAM,EAAC,SAAS,EAAC,4BAA4B,aACrD,KAAC,UAAU,IACT,OAAO,EAAE,OAAO,EAChB,eAAe,EAAE,eAAe,EAChC,UAAU,EAAE,UAAU,EACtB,mBAAmB,EAAE,mBAAmB,EACxC,cAAc,EAAE,UAAU,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,EACjF,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,UAAU,CAAC,cAAe,GAC1C,EACD,CAAC,mBAAmB,IAAI,mBAAmB,IAAI,KAAC,WAAW,OAAM,UAA6B,GAAI,IAC/F,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { type Event, type SingleOrArray } from 'xstate';
|
|
3
2
|
import { type Identity } from '@dxos/react-client/halo';
|
|
4
3
|
import { type IdentityPanelStepProps } from '../IdentityPanelProps';
|
|
@@ -11,5 +10,5 @@ export interface ProfileFormProps extends Omit<IdentityPanelStepProps, 'send' |
|
|
|
11
10
|
export type ProfileFormImplProps = ProfileFormProps & {
|
|
12
11
|
validationMessage?: string;
|
|
13
12
|
};
|
|
14
|
-
export declare const ProfileForm: (props: ProfileFormProps) =>
|
|
13
|
+
export declare const ProfileForm: (props: ProfileFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
14
|
//# sourceMappingURL=ProfileForm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileForm.d.ts","sourceRoot":"","sources":["../../../../../../src/panels/IdentityPanel/steps/ProfileForm.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProfileForm.d.ts","sourceRoot":"","sources":["../../../../../../src/panels/IdentityPanel/steps/ProfileForm.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,aAAa,EAAE,MAAM,QAAQ,CAAC;AAGxD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAMxD,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,sBAAsB,EAAE,MAAM,GAAG,SAAS,CAAC;IACxF,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,KAAK,IAAI,CAAC;IAC5D,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/E,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,GAAG;IACpD,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,WAAW,UAAW,gBAAgB,4CAWlD,CAAC"}
|
|
@@ -1,93 +1,47 @@
|
|
|
1
|
-
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
//
|
|
3
3
|
// Copyright 2023 DXOS.org
|
|
4
4
|
//
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
-
}) : function(o, v) {
|
|
19
|
-
o["default"] = v;
|
|
20
|
-
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
-
var ownKeys = function(o) {
|
|
23
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
-
var ar = [];
|
|
25
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
-
return ar;
|
|
27
|
-
};
|
|
28
|
-
return ownKeys(o);
|
|
29
|
-
};
|
|
30
|
-
return function (mod) {
|
|
31
|
-
if (mod && mod.__esModule) return mod;
|
|
32
|
-
var result = {};
|
|
33
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
-
__setModuleDefault(result, mod);
|
|
35
|
-
return result;
|
|
36
|
-
};
|
|
37
|
-
})();
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.ProfileForm = void 0;
|
|
40
|
-
const react_1 = __importStar(require("react"));
|
|
41
|
-
const log_1 = require("@dxos/log");
|
|
42
|
-
const react_ui_1 = require("@dxos/react-ui");
|
|
43
|
-
const react_ui_pickers_1 = require("@dxos/react-ui-pickers");
|
|
44
|
-
const util_1 = require("@dxos/util");
|
|
45
|
-
const components_1 = require("../../../components");
|
|
46
|
-
const ProfileForm = (props) => {
|
|
5
|
+
import { useState } from 'react';
|
|
6
|
+
import { log } from '@dxos/log';
|
|
7
|
+
import { useClipboard, useTranslation } from '@dxos/react-ui';
|
|
8
|
+
import { EmojiPickerBlock, HuePicker } from '@dxos/react-ui-pickers';
|
|
9
|
+
import { hexToEmoji, hexToHue } from '@dxos/util';
|
|
10
|
+
import { Action, Actions, StepHeading, Input } from '../../../components';
|
|
11
|
+
export const ProfileForm = (props) => {
|
|
47
12
|
const { onUpdateProfile } = props;
|
|
48
|
-
const { t } =
|
|
49
|
-
const [validationMessage, setValidationMessage] =
|
|
13
|
+
const { t } = useTranslation('os');
|
|
14
|
+
const [validationMessage, setValidationMessage] = useState('');
|
|
50
15
|
const handleUpdateProfile = async (profile) => {
|
|
51
16
|
await (onUpdateProfile === null || onUpdateProfile === void 0 ? void 0 : onUpdateProfile(profile).catch((error) => {
|
|
52
|
-
|
|
17
|
+
log.catch(error);
|
|
53
18
|
setValidationMessage(t('failed to update profile message'));
|
|
54
19
|
}));
|
|
55
20
|
};
|
|
56
|
-
return
|
|
21
|
+
return _jsx(ProfileFormImpl, { ...props, onUpdateProfile: handleUpdateProfile, validationMessage: validationMessage });
|
|
57
22
|
};
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
const getEmojiValue = (identity) => { var _a, _b, _c; return ((_b = (_a = identity === null || identity === void 0 ? void 0 : identity.profile) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.emoji) || (0, util_1.hexToEmoji)((_c = identity === null || identity === void 0 ? void 0 : identity.identityKey.toHex()) !== null && _c !== void 0 ? _c : '0'); };
|
|
23
|
+
const getHueValue = (identity) => { var _a, _b, _c; return ((_b = (_a = identity === null || identity === void 0 ? void 0 : identity.profile) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.hue) || hexToHue((_c = identity === null || identity === void 0 ? void 0 : identity.identityKey.toHex()) !== null && _c !== void 0 ? _c : '0'); };
|
|
24
|
+
const getEmojiValue = (identity) => { var _a, _b, _c; return ((_b = (_a = identity === null || identity === void 0 ? void 0 : identity.profile) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.emoji) || hexToEmoji((_c = identity === null || identity === void 0 ? void 0 : identity.identityKey.toHex()) !== null && _c !== void 0 ? _c : '0'); };
|
|
61
25
|
// TODO(zhenyasav): impl shouldn't need send()
|
|
62
26
|
const ProfileFormImpl = (props) => {
|
|
63
27
|
var _a;
|
|
64
28
|
const { active, identity, send, onUpdateProfile, validationMessage } = props;
|
|
65
29
|
const profile = identity === null || identity === void 0 ? void 0 : identity.profile;
|
|
66
30
|
const disabled = !active;
|
|
67
|
-
const { t } =
|
|
68
|
-
const [displayName, setDisplayName] =
|
|
69
|
-
const [hue, setHue] =
|
|
70
|
-
const [emoji, setEmoji] =
|
|
71
|
-
const { textValue, setTextValue } =
|
|
31
|
+
const { t } = useTranslation('os');
|
|
32
|
+
const [displayName, setDisplayName] = useState((_a = profile === null || profile === void 0 ? void 0 : profile.displayName) !== null && _a !== void 0 ? _a : '');
|
|
33
|
+
const [hue, setHue] = useState(getHueValue(identity));
|
|
34
|
+
const [emoji, setEmoji] = useState(getEmojiValue(identity));
|
|
35
|
+
const { textValue, setTextValue } = useClipboard();
|
|
72
36
|
const identityHex = identity === null || identity === void 0 ? void 0 : identity.identityKey.toHex();
|
|
73
37
|
const copied = textValue === identityHex;
|
|
74
|
-
return (
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
react_1.default.createElement(components_1.Action, { variant: 'ghost', disabled: disabled, onClick: () => {
|
|
83
|
-
if (identityHex) {
|
|
84
|
-
void setTextValue(identityHex);
|
|
85
|
-
}
|
|
86
|
-
}, "data-testid": 'update-profile-form-copy-key' }, t(copied ? 'copy success label' : 'copy self public key label')),
|
|
87
|
-
react_1.default.createElement(components_1.Action, { variant: 'ghost', disabled: disabled, onClick: () => send === null || send === void 0 ? void 0 : send({ type: 'unchooseAction' }), "data-testid": 'update-profile-form-back' }, t('back label')),
|
|
88
|
-
react_1.default.createElement(components_1.Action, { variant: 'primary', disabled: disabled, onClick: () => onUpdateProfile === null || onUpdateProfile === void 0 ? void 0 : onUpdateProfile({
|
|
89
|
-
...(displayName && { displayName }),
|
|
90
|
-
...((emoji || hue) && { data: { ...(emoji && { emoji }), ...(hue && { hue }) } }),
|
|
91
|
-
}), "data-testid": 'update-profile-form-continue' }, t('done label')))));
|
|
38
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { role: 'none', className: 'grow flex flex-col justify-center', children: [_jsx(Input, { validationMessage, label: _jsx(StepHeading, { className: 'm-0', children: t('display name input label') }), disabled: disabled, "data-testid": 'display-name-input', placeholder: t('display name input placeholder'), value: displayName, onChange: ({ target: { value } }) => setDisplayName(value) }), _jsx(StepHeading, { className: 'mbe-2', children: t('emoji and color label') }), _jsxs("div", { role: 'none', className: 'grid grid-cols-[1fr_min-content] gap-y-2', children: [_jsx(EmojiPickerBlock, { emoji: emoji, onChangeEmoji: setEmoji, disabled: disabled, onClickClear: () => setEmoji(getEmojiValue(identity)) }), _jsx(HuePicker, { disabled: disabled, value: hue, onChange: setHue, onReset: () => setHue(getHueValue(identity)) })] })] }), _jsxs(Actions, { children: [_jsx(Action, { variant: 'ghost', disabled: disabled, onClick: () => {
|
|
39
|
+
if (identityHex) {
|
|
40
|
+
void setTextValue(identityHex);
|
|
41
|
+
}
|
|
42
|
+
}, "data-testid": 'update-profile-form-copy-key', children: t(copied ? 'copy success label' : 'copy self public key label') }), _jsx(Action, { variant: 'ghost', disabled: disabled, onClick: () => send === null || send === void 0 ? void 0 : send({ type: 'unchooseAction' }), "data-testid": 'update-profile-form-back', children: t('back label') }), _jsx(Action, { variant: 'primary', disabled: disabled, onClick: () => onUpdateProfile === null || onUpdateProfile === void 0 ? void 0 : onUpdateProfile({
|
|
43
|
+
...(displayName && { displayName }),
|
|
44
|
+
...((emoji || hue) && { data: { ...(emoji && { emoji }), ...(hue && { hue }) } }),
|
|
45
|
+
}), "data-testid": 'update-profile-form-continue', children: t('done label') })] })] }));
|
|
92
46
|
};
|
|
93
47
|
//# sourceMappingURL=ProfileForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileForm.js","sourceRoot":"","sources":["../../../../../../src/panels/IdentityPanel/steps/ProfileForm.tsx"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE
|
|
1
|
+
{"version":3,"file":"ProfileForm.js","sourceRoot":"","sources":["../../../../../../src/panels/IdentityPanel/steps/ProfileForm.tsx"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGxC,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAEhC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAElD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAc1E,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAuB,EAAE,EAAE;IACrD,MAAM,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAClC,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;IACnC,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC/D,MA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AAE,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;yBAClF,CAAC,iBAEQ,8BAA8B,YAEzC,CAAC,CAAC,YAAY,CAAC,GACT,IACD,IACT,CACJ,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,22 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2023 DXOS.org
|
|
4
3
|
//
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
-
}
|
|
11
|
-
Object.defineProperty(o, k2, desc);
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
|
-
};
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
__exportStar(require("./IdentityActionChooser"), exports);
|
|
21
|
-
__exportStar(require("./ProfileForm"), exports);
|
|
4
|
+
export * from './IdentityActionChooser';
|
|
5
|
+
export * from './ProfileForm';
|
|
22
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/panels/IdentityPanel/steps/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/panels/IdentityPanel/steps/index.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC"}
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2024 DXOS.org
|
|
4
3
|
//
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const useKubeAgentHandlers_1 = require("./useKubeAgentHandlers");
|
|
10
|
-
const useAgentHandlers = (params) => {
|
|
4
|
+
import { useClient } from '@dxos/react-client';
|
|
5
|
+
import { useEdgeAgentHandlers } from './useEdgeAgentsHandlers';
|
|
6
|
+
import { useKubeAgentHandlers } from './useKubeAgentHandlers';
|
|
7
|
+
export const useAgentHandlers = (params) => {
|
|
11
8
|
var _a, _b, _c, _d;
|
|
12
|
-
const client =
|
|
9
|
+
const client = useClient();
|
|
13
10
|
if ((_d = (_c = (_b = (_a = client.config.values) === null || _a === void 0 ? void 0 : _a.runtime) === null || _b === void 0 ? void 0 : _b.client) === null || _c === void 0 ? void 0 : _c.edgeFeatures) === null || _d === void 0 ? void 0 : _d.agents) {
|
|
14
|
-
return
|
|
11
|
+
return useEdgeAgentHandlers(params);
|
|
15
12
|
}
|
|
16
13
|
else {
|
|
17
|
-
return
|
|
14
|
+
return useKubeAgentHandlers(params);
|
|
18
15
|
}
|
|
19
16
|
};
|
|
20
|
-
exports.useAgentHandlers = useAgentHandlers;
|
|
21
17
|
//# sourceMappingURL=useAgentHandlers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAgentHandlers.js","sourceRoot":"","sources":["../../../../../src/panels/IdentityPanel/useAgentHandlers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useAgentHandlers.js","sourceRoot":"","sources":["../../../../../src/panels/IdentityPanel/useAgentHandlers.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAGF,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG9D,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAGhC,EAAkB,EAAE;;IACnB,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,IAAI,MAAA,MAAA,MAAA,MAAA,MAAM,CAAC,MAAM,CAAC,MAAM,0CAAE,OAAO,0CAAE,MAAM,0CAAE,YAAY,0CAAE,MAAM,EAAE,CAAC;QAChE,OAAO,oBAAoB,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;SAAM,CAAC;QACN,OAAO,oBAAoB,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -1,38 +1,35 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2024 DXOS.org
|
|
4
3
|
//
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
const react_client_1 = require("@dxos/react-client");
|
|
13
|
-
const useEdgeAgentHandlers = ({ identity, }) => {
|
|
4
|
+
import { useEffect, useState } from 'react';
|
|
5
|
+
import { invariant } from '@dxos/invariant';
|
|
6
|
+
import { log } from '@dxos/log';
|
|
7
|
+
import { QueryAgentStatusResponse } from '@dxos/protocols/proto/dxos/client/services';
|
|
8
|
+
import { EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata';
|
|
9
|
+
import { useClient } from '@dxos/react-client';
|
|
10
|
+
export const useEdgeAgentHandlers = ({ identity, }) => {
|
|
14
11
|
var _a, _b, _c;
|
|
15
|
-
const [validationMessage, setValidationMessage] =
|
|
16
|
-
const [lastReceivedStatus, setLastReceivedStatus] =
|
|
17
|
-
const [agentStatus, setAgentStatus] =
|
|
18
|
-
const client =
|
|
12
|
+
const [validationMessage, setValidationMessage] = useState('');
|
|
13
|
+
const [lastReceivedStatus, setLastReceivedStatus] = useState(QueryAgentStatusResponse.AgentStatus.UNKNOWN);
|
|
14
|
+
const [agentStatus, setAgentStatus] = useState('getting');
|
|
15
|
+
const client = useClient();
|
|
19
16
|
// TODO(wittjosiah): This should be based on HALO credentials.
|
|
20
17
|
const agentHostingEnabled = Boolean((_c = (_b = (_a = client.config.values.runtime) === null || _a === void 0 ? void 0 : _a.client) === null || _b === void 0 ? void 0 : _b.edgeFeatures) === null || _c === void 0 ? void 0 : _c.agents);
|
|
21
18
|
const handleStatus = (status) => {
|
|
22
19
|
switch (status) {
|
|
23
|
-
case
|
|
24
|
-
case
|
|
20
|
+
case QueryAgentStatusResponse.AgentStatus.ACTIVE:
|
|
21
|
+
case QueryAgentStatusResponse.AgentStatus.INACTIVE:
|
|
25
22
|
setAgentStatus('created');
|
|
26
23
|
break;
|
|
27
|
-
case
|
|
24
|
+
case QueryAgentStatusResponse.AgentStatus.NOT_FOUND:
|
|
28
25
|
setAgentStatus('creatable');
|
|
29
26
|
break;
|
|
30
|
-
case
|
|
27
|
+
case QueryAgentStatusResponse.AgentStatus.UNKNOWN:
|
|
31
28
|
setAgentStatus('getting');
|
|
32
29
|
break;
|
|
33
30
|
}
|
|
34
31
|
};
|
|
35
|
-
|
|
32
|
+
useEffect(() => {
|
|
36
33
|
var _a;
|
|
37
34
|
const stream = (_a = client.services.services.EdgeAgentService) === null || _a === void 0 ? void 0 : _a.queryAgentStatus();
|
|
38
35
|
stream === null || stream === void 0 ? void 0 : stream.subscribe(({ status }) => {
|
|
@@ -44,7 +41,7 @@ const useEdgeAgentHandlers = ({ identity, }) => {
|
|
|
44
41
|
};
|
|
45
42
|
}, []);
|
|
46
43
|
const onAgentCreate = async () => {
|
|
47
|
-
|
|
44
|
+
invariant(identity, 'Identity not found');
|
|
48
45
|
const service = client.services.services.EdgeAgentService;
|
|
49
46
|
if (!service) {
|
|
50
47
|
setAgentStatus('error');
|
|
@@ -62,11 +59,11 @@ const useEdgeAgentHandlers = ({ identity, }) => {
|
|
|
62
59
|
await service.createAgent(null, { timeout: 7500 });
|
|
63
60
|
await Promise.all(client.spaces
|
|
64
61
|
.get()
|
|
65
|
-
.map((space) => space === null || space === void 0 ? void 0 : space.internal.setEdgeReplicationPreference(
|
|
62
|
+
.map((space) => space === null || space === void 0 ? void 0 : space.internal.setEdgeReplicationPreference(EdgeReplicationSetting.ENABLED)));
|
|
66
63
|
setAgentStatus('created');
|
|
67
64
|
}
|
|
68
65
|
catch (err) {
|
|
69
|
-
|
|
66
|
+
log.catch(err);
|
|
70
67
|
setAgentStatus('error');
|
|
71
68
|
setValidationMessage(`Error creating an agent: ${err.message}`);
|
|
72
69
|
}
|
|
@@ -87,5 +84,4 @@ const useEdgeAgentHandlers = ({ identity, }) => {
|
|
|
87
84
|
agentHostingEnabled,
|
|
88
85
|
};
|
|
89
86
|
};
|
|
90
|
-
exports.useEdgeAgentHandlers = useEdgeAgentHandlers;
|
|
91
87
|
//# sourceMappingURL=useEdgeAgentsHandlers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEdgeAgentsHandlers.js","sourceRoot":"","sources":["../../../../../src/panels/IdentityPanel/useEdgeAgentsHandlers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useEdgeAgentsHandlers.js","sourceRoot":"","sources":["../../../../../src/panels/IdentityPanel/useEdgeAgentsHandlers.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG5C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,wBAAwB,EAAE,MAAM,4CAA4C,CAAC;AACtF,OAAO,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAClF,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;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