@dxos/shell 0.7.5-staging.b81e783 → 0.8.0
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.js +2510 -2492
- package/dist/bundle/shell.js.map +1 -1
- package/dist/bundle/shell.umd.cjs +44 -44
- package/dist/bundle/shell.umd.cjs.map +1 -1
- package/dist/bundle/style.css +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react.mjs +20 -10
- package/dist/lib/browser/react.mjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/react.cjs +27 -17
- 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 +20 -10
- package/dist/lib/node-esm/react.mjs.map +3 -3
- package/dist/types/src/components/AgentConfig.js +11 -15
- package/dist/types/src/components/AgentConfig.js.map +1 -1
- package/dist/types/src/components/AuthCode.js +6 -10
- package/dist/types/src/components/AuthCode.js.map +1 -1
- package/dist/types/src/components/CompoundButton/CompoundButton.js +9 -13
- package/dist/types/src/components/CompoundButton/CompoundButton.js.map +1 -1
- package/dist/types/src/components/CompoundButton/CompoundButton.stories.d.ts +1 -1
- package/dist/types/src/components/CompoundButton/CompoundButton.stories.js +17 -20
- 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.js +10 -14
- 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 -21
- 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 -15
- package/dist/types/src/components/IdentityList/IdentityListItem.js.map +1 -1
- package/dist/types/src/components/IdentityList/SpaceMemberList.js +17 -22
- package/dist/types/src/components/IdentityList/SpaceMemberList.js.map +1 -1
- package/dist/types/src/components/IdentityList/SpaceMemberList.stories.d.ts +1 -1
- package/dist/types/src/components/IdentityList/SpaceMemberList.stories.js +10 -14
- 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.js +8 -12
- package/dist/types/src/components/InvitationList/InvitationList.js.map +1 -1
- package/dist/types/src/components/InvitationList/InvitationList.stories.d.ts +1 -1
- package/dist/types/src/components/InvitationList/InvitationList.stories.js +20 -24
- package/dist/types/src/components/InvitationList/InvitationList.stories.js.map +1 -1
- package/dist/types/src/components/InvitationList/InvitationListContainer.js +9 -13
- package/dist/types/src/components/InvitationList/InvitationListContainer.js.map +1 -1
- package/dist/types/src/components/InvitationList/InvitationListItem.js +32 -37
- 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 -18
- package/dist/types/src/components/Panel/Action.js.map +1 -1
- package/dist/types/src/components/Panel/Actions.js +6 -9
- package/dist/types/src/components/Panel/Actions.js.map +1 -1
- package/dist/types/src/components/Panel/CloseButton.js +7 -11
- package/dist/types/src/components/Panel/CloseButton.js.map +1 -1
- package/dist/types/src/components/Panel/Emoji.js +6 -11
- package/dist/types/src/components/Panel/Emoji.js.map +1 -1
- package/dist/types/src/components/Panel/Heading.js +5 -8
- package/dist/types/src/components/Panel/Heading.js.map +1 -1
- package/dist/types/src/components/Panel/Input.js +4 -8
- package/dist/types/src/components/Panel/Input.js.map +1 -1
- package/dist/types/src/components/Panel/Label.js +4 -8
- package/dist/types/src/components/Panel/Label.js.map +1 -1
- package/dist/types/src/components/Panel/Panel.stories.d.ts +1 -1
- package/dist/types/src/components/Panel/Panel.stories.js +15 -20
- package/dist/types/src/components/Panel/Panel.stories.js.map +1 -1
- package/dist/types/src/components/Panel/StepHeading.js +5 -8
- 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 -13
- package/dist/types/src/components/SpaceListItem.js.map +1 -1
- package/dist/types/src/components/StorybookDialog.js +5 -9
- package/dist/types/src/components/StorybookDialog.js.map +1 -1
- package/dist/types/src/components/Viewport/Viewport.js +18 -22
- package/dist/types/src/components/Viewport/Viewport.js.map +1 -1
- package/dist/types/src/components/Viewport/Viewport.stories.d.ts +1 -1
- package/dist/types/src/components/Viewport/Viewport.stories.js +12 -15
- 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.js +7 -11
- 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.js +9 -13
- 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.js +54 -58
- package/dist/types/src/composites/Shell/Shell.js.map +1 -1
- package/dist/types/src/composites/Shell/ShellContext.js +32 -37
- 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 -22
- 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.js +7 -11
- 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.js +6 -10
- 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.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js +55 -54
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.d.ts +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.js +38 -51
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.js.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.js +16 -21
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.js +21 -25
- 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 -14
- package/dist/types/src/panels/JoinPanel/JoinHeading.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.js +38 -43
- package/dist/types/src/panels/JoinPanel/JoinPanel.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.stories.d.ts +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.stories.js +25 -41
- 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.js +9 -13
- package/dist/types/src/panels/JoinPanel/steps/AdditionMethodChooser.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/IdentityAdded.js +14 -18
- package/dist/types/src/panels/JoinPanel/steps/IdentityAdded.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/IdentityInput.js +19 -24
- package/dist/types/src/panels/JoinPanel/steps/IdentityInput.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/InvitationAccepted.js +8 -12
- package/dist/types/src/panels/JoinPanel/steps/InvitationAccepted.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/InvitationAuthenticator.js +13 -17
- package/dist/types/src/panels/JoinPanel/steps/InvitationAuthenticator.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/InvitationInput.js +15 -19
- package/dist/types/src/panels/JoinPanel/steps/InvitationInput.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/InvitationRescuer.js +11 -15
- 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 +1 -1
- package/dist/types/src/panels/Panels.stories.js +13 -50
- package/dist/types/src/panels/Panels.stories.js.map +1 -1
- package/dist/types/src/panels/SpacePanel/SpacePanel.js +25 -30
- package/dist/types/src/panels/SpacePanel/SpacePanel.js.map +1 -1
- package/dist/types/src/panels/SpacePanel/SpacePanel.stories.d.ts +1 -1
- package/dist/types/src/panels/SpacePanel/SpacePanel.stories.js +89 -108
- 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.js +33 -38
- 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.js +5 -9
- 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.js +18 -23
- package/dist/types/src/steps/ConfirmReset.js.map +1 -1
- package/dist/types/src/steps/InvitationManager.js +17 -21
- 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 +1 -1
- package/dist/types/src/stories/Invitations.e2e-stories.js +50 -53
- 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 +1 -0
- package/dist/types/src/translations/locales/en-US.d.ts.map +1 -1
- package/dist/types/src/translations/locales/en-US.js +4 -6
- 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 +30 -27
- package/src/panels/IdentityPanel/IdentityPanel.tsx +19 -5
- package/src/translations/locales/en-US.ts +3 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '@dxos-theme';
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
|
-
decorators: import("@storybook/react
|
|
4
|
+
decorators: import("@storybook/react").Decorator[];
|
|
5
5
|
parameters: {
|
|
6
6
|
translations: {
|
|
7
7
|
'en-US': typeof import("../../translations/locales/en-US");
|
|
@@ -1,85 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DeviceInvitationManagerCancelled = exports.DeviceInvitationManagerTimeout = exports.DeviceInvitationManagerError = exports.DeviceInvitationManagerSuccess = exports.DeviceInvitationManagerAuthenticating = exports.DeviceInvitationManagerReady = exports.DeviceInvitationManagerConnected = exports.DeviceInvitationManagerConnecting = exports.DeviceInvitationManager = exports.IdentityActionChooser = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
2
|
//
|
|
6
3
|
// Copyright 2023 DXOS.org
|
|
7
4
|
//
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
5
|
+
import '@dxos-theme';
|
|
6
|
+
import { IdentityDid } from '@dxos/keys';
|
|
7
|
+
import { ConnectionState } from '@dxos/protocols/proto/dxos/client/services';
|
|
8
|
+
import { faker } from '@dxos/random';
|
|
9
|
+
import { PublicKey } from '@dxos/react-client';
|
|
10
|
+
import { Invitation } from '@dxos/react-client/invitations';
|
|
11
|
+
import { withTheme } from '@dxos/storybook-utils';
|
|
12
|
+
import { IdentityPanelImpl } from './IdentityPanel';
|
|
13
|
+
import { IdentityActionChooserImpl } from './steps';
|
|
14
|
+
import { StorybookDialog } from '../../components/StorybookDialog';
|
|
15
|
+
import { InvitationManager } from '../../steps';
|
|
16
|
+
import { osTranslations } from '../../translations';
|
|
17
|
+
faker.seed(1234);
|
|
21
18
|
const noOpProps = {
|
|
22
19
|
titleId: 'storybookIdentityPanel',
|
|
23
20
|
send: () => { },
|
|
24
21
|
activeView: 'identity action chooser',
|
|
25
22
|
createInvitationUrl: (code) => code,
|
|
26
23
|
identity: {
|
|
27
|
-
did:
|
|
28
|
-
identityKey:
|
|
24
|
+
did: IdentityDid.random(),
|
|
25
|
+
identityKey: PublicKey.random(),
|
|
29
26
|
profile: {
|
|
30
|
-
displayName:
|
|
27
|
+
displayName: faker.person.firstName(),
|
|
31
28
|
},
|
|
32
29
|
},
|
|
33
30
|
devices: [],
|
|
34
|
-
connectionState:
|
|
31
|
+
connectionState: ConnectionState.ONLINE,
|
|
35
32
|
onManageCredentials: async () => console.log('manage credentials'),
|
|
36
33
|
};
|
|
37
|
-
|
|
34
|
+
export default {
|
|
38
35
|
title: 'sdk/shell/IdentityPanel',
|
|
39
|
-
decorators: [
|
|
36
|
+
decorators: [withTheme],
|
|
40
37
|
parameters: {
|
|
41
|
-
translations: [
|
|
38
|
+
translations: [osTranslations],
|
|
42
39
|
chromatic: {
|
|
43
40
|
disableSnapshot: false,
|
|
44
41
|
},
|
|
45
42
|
},
|
|
46
43
|
};
|
|
47
|
-
const IdentityActionChooser = () => {
|
|
48
|
-
return ((
|
|
44
|
+
export const IdentityActionChooser = () => {
|
|
45
|
+
return (_jsx(StorybookDialog, { inOverlayLayout: true, children: _jsx(IdentityPanelImpl, { ...noOpProps, activeView: 'identity action chooser', IdentityActionChooser: IdentityActionChooserImpl }) }));
|
|
49
46
|
};
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
const DeviceInvitationManagerConnecting = () => DeviceInvitationManagerWithState({
|
|
55
|
-
status: invitations_1.Invitation.State.CONNECTING,
|
|
47
|
+
const DeviceInvitationManagerWithState = (extraProps) => (_jsx(StorybookDialog, { inOverlayLayout: true, children: _jsx(IdentityPanelImpl, { ...noOpProps, activeView: 'device invitation manager', IdentityActionChooser: IdentityActionChooserImpl, InvitationManager: (props) => _jsx(InvitationManager, { ...props, ...extraProps }) }) }));
|
|
48
|
+
export const DeviceInvitationManager = () => DeviceInvitationManagerWithState({ status: Invitation.State.INIT, id: '0' });
|
|
49
|
+
export const DeviceInvitationManagerConnecting = () => DeviceInvitationManagerWithState({
|
|
50
|
+
status: Invitation.State.CONNECTING,
|
|
56
51
|
id: '1',
|
|
57
52
|
});
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
status: invitations_1.Invitation.State.CONNECTED,
|
|
53
|
+
export const DeviceInvitationManagerConnected = () => DeviceInvitationManagerWithState({
|
|
54
|
+
status: Invitation.State.CONNECTED,
|
|
61
55
|
id: '2',
|
|
62
56
|
});
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
status: invitations_1.Invitation.State.READY_FOR_AUTHENTICATION,
|
|
57
|
+
export const DeviceInvitationManagerReady = () => DeviceInvitationManagerWithState({
|
|
58
|
+
status: Invitation.State.READY_FOR_AUTHENTICATION,
|
|
66
59
|
authCode: '123123',
|
|
67
60
|
id: '3',
|
|
68
61
|
});
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
status: invitations_1.Invitation.State.AUTHENTICATING,
|
|
62
|
+
export const DeviceInvitationManagerAuthenticating = () => DeviceInvitationManagerWithState({
|
|
63
|
+
status: Invitation.State.AUTHENTICATING,
|
|
72
64
|
id: '4',
|
|
73
65
|
});
|
|
74
|
-
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
const DeviceInvitationManagerTimeout = () => DeviceInvitationManagerWithState({ status: invitations_1.Invitation.State.TIMEOUT });
|
|
80
|
-
exports.DeviceInvitationManagerTimeout = DeviceInvitationManagerTimeout;
|
|
81
|
-
const DeviceInvitationManagerCancelled = () => DeviceInvitationManagerWithState({
|
|
82
|
-
status: invitations_1.Invitation.State.CANCELLED,
|
|
66
|
+
export const DeviceInvitationManagerSuccess = () => DeviceInvitationManagerWithState({ status: Invitation.State.SUCCESS });
|
|
67
|
+
export const DeviceInvitationManagerError = () => DeviceInvitationManagerWithState({ status: Invitation.State.ERROR });
|
|
68
|
+
export const DeviceInvitationManagerTimeout = () => DeviceInvitationManagerWithState({ status: Invitation.State.TIMEOUT });
|
|
69
|
+
export const DeviceInvitationManagerCancelled = () => DeviceInvitationManagerWithState({
|
|
70
|
+
status: Invitation.State.CANCELLED,
|
|
83
71
|
});
|
|
84
|
-
exports.DeviceInvitationManagerCancelled = DeviceInvitationManagerCancelled;
|
|
85
72
|
//# sourceMappingURL=IdentityPanel.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdentityPanel.stories.js","sourceRoot":"","sources":["../../../../../src/panels/IdentityPanel/IdentityPanel.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IdentityPanel.stories.js","sourceRoot":"","sources":["../../../../../src/panels/IdentityPanel/IdentityPanel.stories.tsx"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,OAAO,aAAa,CAAC;AAIrB,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAA+B,MAAM,aAAa,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEjB,MAAM,SAAS,GAA2B;IACxC,OAAO,EAAE,wBAAwB;IACjC,IAAI,EAAE,GAAG,EAAE,GAAE,CAAC;IACd,UAAU,EAAE,yBA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KAAK,CAAC,SAAS;CACnC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdentityPanelProps.js","sourceRoot":"","sources":["../../../../../src/panels/IdentityPanel/IdentityPanelProps.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IdentityPanelProps.js","sourceRoot":"","sources":["../../../../../src/panels/IdentityPanel/IdentityPanelProps.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE"}
|
|
@@ -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;K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,CAAA,EAAA;SAC5E,CAAC;QACF,aAAa,EAAE,MAAM,CAAwC;YAC3D,UAAU,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,WAAC,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,17 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const invitations_1 = require("@dxos/react-client/invitations");
|
|
9
|
-
const components_1 = require("../../../components");
|
|
10
|
-
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) => {
|
|
11
8
|
var _a, _b, _c;
|
|
12
9
|
const { send } = props;
|
|
13
|
-
const client =
|
|
14
|
-
const invitations =
|
|
10
|
+
const client = useClient();
|
|
11
|
+
const invitations = useHaloInvitations();
|
|
15
12
|
const createInvitation = () => {
|
|
16
13
|
var _a, _b, _c;
|
|
17
14
|
invitations.forEach((invitation) => invitation.cancel());
|
|
@@ -19,9 +16,9 @@ const IdentityActionChooser = (props) => {
|
|
|
19
16
|
const invitation = client.halo.share();
|
|
20
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') {
|
|
21
18
|
const subscription = invitation.subscribe((invitation) => {
|
|
22
|
-
const invitationCode =
|
|
23
|
-
if (invitation.state ===
|
|
24
|
-
|
|
19
|
+
const invitationCode = InvitationEncoder.encode(invitation);
|
|
20
|
+
if (invitation.state === Invitation.State.CONNECTING) {
|
|
21
|
+
log.info(JSON.stringify({ invitationCode, authCode: invitation.authCode }));
|
|
25
22
|
subscription.unsubscribe();
|
|
26
23
|
}
|
|
27
24
|
});
|
|
@@ -29,12 +26,10 @@ const IdentityActionChooser = (props) => {
|
|
|
29
26
|
send === null || send === void 0 ? void 0 : send({ type: 'selectInvitation', invitation });
|
|
30
27
|
};
|
|
31
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';
|
|
32
|
-
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' }) }));
|
|
33
30
|
};
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
return ((0, jsx_runtime_1.jsxs)("div", { role: 'none', className: 'bs-40 grow overflow-y-auto', children: [(0, jsx_runtime_1.jsx)(components_1.DeviceList, { devices: devices, connectionState: connectionState, onClickAdd: onClickAdd, onClickJoinExisting: onClickJoinExisting, onClickRecover: agentProps.agentStatus === 'created' ? onClickRecover : undefined, onClickReset: onClickReset, onAgentDestroy: agentProps.onAgentDestroy }), !edgeDeviceAvailable && agentHostingEnabled && (0, jsx_runtime_1.jsx)(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 })] }));
|
|
38
34
|
};
|
|
39
|
-
exports.IdentityActionChooserImpl = IdentityActionChooserImpl;
|
|
40
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,EAAE,CAAC;QACvC,IAAI,CAAA,MAAA,MAAA,MAAA,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,0CAAE,GAAG,0CAAE,GAAG,0CAAE,cAAc,MAAK,YAAY,EAAE,CAAC;YAC5E,MAAM,YAAY,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,UAAsB,EAAE,EAAE;gBACnE,MAAM,cAAc,GAAG,iBAAiB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;gBAC5D,IAAI,UAAU,CAAC,KAAK,KAAK,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AI,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,49 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProfileForm = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
5
2
|
//
|
|
6
3
|
// Copyright 2023 DXOS.org
|
|
7
4
|
//
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
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) => {
|
|
15
12
|
const { onUpdateProfile } = props;
|
|
16
|
-
const { t } =
|
|
17
|
-
const [validationMessage, setValidationMessage] =
|
|
13
|
+
const { t } = useTranslation('os');
|
|
14
|
+
const [validationMessage, setValidationMessage] = useState('');
|
|
18
15
|
const handleUpdateProfile = async (profile) => {
|
|
19
16
|
await (onUpdateProfile === null || onUpdateProfile === void 0 ? void 0 : onUpdateProfile(profile).catch((error) => {
|
|
20
|
-
|
|
17
|
+
log.catch(error);
|
|
21
18
|
setValidationMessage(t('failed to update profile message'));
|
|
22
19
|
}));
|
|
23
20
|
};
|
|
24
|
-
return (
|
|
21
|
+
return _jsx(ProfileFormImpl, { ...props, onUpdateProfile: handleUpdateProfile, validationMessage: validationMessage });
|
|
25
22
|
};
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
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'); };
|
|
29
25
|
// TODO(zhenyasav): impl shouldn't need send()
|
|
30
26
|
const ProfileFormImpl = (props) => {
|
|
31
27
|
var _a;
|
|
32
28
|
const { active, identity, send, onUpdateProfile, validationMessage } = props;
|
|
33
29
|
const profile = identity === null || identity === void 0 ? void 0 : identity.profile;
|
|
34
30
|
const disabled = !active;
|
|
35
|
-
const { t } =
|
|
36
|
-
const [displayName, setDisplayName] =
|
|
37
|
-
const [hue, setHue] =
|
|
38
|
-
const [emoji, setEmoji] =
|
|
39
|
-
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();
|
|
40
36
|
const identityHex = identity === null || identity === void 0 ? void 0 : identity.identityKey.toHex();
|
|
41
37
|
const copied = textValue === identityHex;
|
|
42
|
-
return ((
|
|
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: () => {
|
|
43
39
|
if (identityHex) {
|
|
44
40
|
void setTextValue(identityHex);
|
|
45
41
|
}
|
|
46
|
-
}, "data-testid": 'update-profile-form-copy-key', children: t(copied ? 'copy success label' : 'copy self public key label') }), (
|
|
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({
|
|
47
43
|
...(displayName && { displayName }),
|
|
48
44
|
...((emoji || hue) && { data: { ...(emoji && { emoji }), ...(hue && { hue }) } }),
|
|
49
45
|
}), "data-testid": 'update-profile-form-continue', children: t('done label') })] })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileForm.js","sourceRoot":"","sources":["../../../../../../src/panels/IdentityPanel/steps/ProfileForm.tsx"],"names":[],"mappings":"
|
|
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,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OAAO,EAAE,GAAG,EAAE,CACZ,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAG;4BAChB,GAAG,CAAC,WAAW,IAAI,EAAE,WAAW,EAAE,CAAC;4BACnC,GAAG,CAAC,CAAC,KAAK,IAAI,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,GAAG,CAAC,KAAK,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,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"}
|