@dxos/shell 0.4.10-main.d560ca0 → 0.4.10-main.f68a1ca
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 +8261 -8194
- package/dist/bundle/shell.mjs.map +1 -1
- package/dist/bundle/shell.umd.js +53 -53
- package/dist/bundle/shell.umd.js.map +1 -1
- package/dist/bundle/style.css +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react.mjs +417 -328
- package/dist/lib/browser/react.mjs.map +4 -4
- package/dist/types/src/composites/IdentityDialog/IdentityDialog.js +1 -1
- package/dist/types/src/composites/IdentityDialog/IdentityDialog.js.map +1 -1
- package/dist/types/src/composites/Shell/Shell.d.ts.map +1 -1
- package/dist/types/src/composites/Shell/Shell.js +18 -6
- package/dist/types/src/composites/Shell/Shell.js.map +1 -1
- package/dist/types/src/composites/StatusDialog/StatusDialog.d.ts +2 -0
- package/dist/types/src/composites/StatusDialog/StatusDialog.d.ts.map +1 -0
- package/dist/types/src/composites/StatusDialog/StatusDialog.js +22 -0
- package/dist/types/src/composites/StatusDialog/StatusDialog.js.map +1 -0
- package/dist/types/src/composites/StatusDialog/index.d.ts +2 -0
- package/dist/types/src/composites/StatusDialog/index.d.ts.map +1 -0
- package/dist/types/src/composites/StatusDialog/index.js +21 -0
- package/dist/types/src/composites/StatusDialog/index.js.map +1 -0
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.d.ts +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js +15 -8
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.d.ts +5 -3
- package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/identityMachine.d.ts +3 -1
- package/dist/types/src/panels/IdentityPanel/identityMachine.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/identityMachine.js +15 -2
- package/dist/types/src/panels/IdentityPanel/identityMachine.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js +9 -5
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/index.d.ts +0 -1
- package/dist/types/src/panels/IdentityPanel/steps/index.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/index.js +0 -1
- package/dist/types/src/panels/IdentityPanel/steps/index.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.d.ts +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.js +12 -5
- 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.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.stories.js +2 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.stories.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanelProps.d.ts +8 -3
- package/dist/types/src/panels/JoinPanel/JoinPanelProps.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/joinMachine.d.ts +3 -2
- package/dist/types/src/panels/JoinPanel/joinMachine.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/joinMachine.js +7 -0
- package/dist/types/src/panels/JoinPanel/joinMachine.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/index.d.ts +0 -1
- package/dist/types/src/panels/JoinPanel/steps/index.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/index.js +0 -1
- package/dist/types/src/panels/JoinPanel/steps/index.js.map +1 -1
- package/dist/types/src/panels/StatusPanel/StatusPanel.d.ts +4 -0
- package/dist/types/src/panels/StatusPanel/StatusPanel.d.ts.map +1 -0
- package/dist/types/src/panels/StatusPanel/StatusPanel.js +19 -0
- package/dist/types/src/panels/StatusPanel/StatusPanel.js.map +1 -0
- package/dist/types/src/panels/StatusPanel/index.d.ts +2 -0
- package/dist/types/src/panels/StatusPanel/index.d.ts.map +1 -0
- package/dist/types/src/panels/StatusPanel/index.js +21 -0
- package/dist/types/src/panels/StatusPanel/index.js.map +1 -0
- package/dist/types/src/panels/index.d.ts +1 -0
- package/dist/types/src/panels/index.d.ts.map +1 -1
- package/dist/types/src/panels/index.js +1 -0
- package/dist/types/src/panels/index.js.map +1 -1
- package/dist/types/src/steps/ConfirmReset.d.ts +16 -0
- package/dist/types/src/steps/ConfirmReset.d.ts.map +1 -0
- package/dist/types/src/steps/ConfirmReset.js +70 -0
- package/dist/types/src/steps/ConfirmReset.js.map +1 -0
- package/dist/types/src/steps/StepProps.d.ts +4 -1
- package/dist/types/src/steps/StepProps.d.ts.map +1 -1
- package/dist/types/src/steps/index.d.ts +1 -0
- package/dist/types/src/steps/index.d.ts.map +1 -1
- package/dist/types/src/steps/index.js +1 -0
- package/dist/types/src/steps/index.js.map +1 -1
- package/dist/types/src/translations/locales/en-US.d.ts +4 -1
- package/dist/types/src/translations/locales/en-US.d.ts.map +1 -1
- package/dist/types/src/translations/locales/en-US.js +8 -5
- package/dist/types/src/translations/locales/en-US.js.map +1 -1
- package/package.json +19 -19
- package/src/composites/IdentityDialog/IdentityDialog.tsx +1 -1
- package/src/composites/Shell/Shell.tsx +23 -4
- package/src/composites/StatusDialog/StatusDialog.tsx +24 -0
- package/src/composites/StatusDialog/index.ts +5 -0
- package/src/panels/IdentityPanel/IdentityPanel.tsx +31 -14
- package/src/panels/IdentityPanel/IdentityPanelProps.ts +7 -3
- package/src/panels/IdentityPanel/identityMachine.ts +25 -3
- package/src/panels/IdentityPanel/steps/IdentityActionChooser.tsx +16 -7
- package/src/panels/IdentityPanel/steps/index.ts +0 -1
- package/src/panels/JoinPanel/JoinPanel.stories.tsx +3 -2
- package/src/panels/JoinPanel/JoinPanel.tsx +21 -5
- package/src/panels/JoinPanel/JoinPanelProps.ts +9 -3
- package/src/panels/JoinPanel/joinMachine.ts +12 -2
- package/src/panels/JoinPanel/steps/index.ts +0 -1
- package/src/panels/StatusPanel/StatusPanel.tsx +19 -0
- package/src/panels/StatusPanel/index.ts +5 -0
- package/src/panels/index.ts +1 -0
- package/src/steps/ConfirmReset.tsx +111 -0
- package/src/steps/StepProps.ts +2 -1
- package/src/steps/index.ts +1 -0
- package/src/translations/locales/en-US.ts +9 -5
- package/dist/types/src/panels/IdentityPanel/steps/SignOutChooser.d.ts +0 -16
- package/dist/types/src/panels/IdentityPanel/steps/SignOutChooser.d.ts.map +0 -1
- package/dist/types/src/panels/IdentityPanel/steps/SignOutChooser.js +0 -40
- package/dist/types/src/panels/IdentityPanel/steps/SignOutChooser.js.map +0 -1
- package/dist/types/src/panels/JoinPanel/steps/ResetIdentity.d.ts +0 -13
- package/dist/types/src/panels/JoinPanel/steps/ResetIdentity.d.ts.map +0 -1
- package/dist/types/src/panels/JoinPanel/steps/ResetIdentity.js +0 -66
- package/dist/types/src/panels/JoinPanel/steps/ResetIdentity.js.map +0 -1
- package/src/panels/IdentityPanel/steps/SignOutChooser.tsx +0 -84
- package/src/panels/JoinPanel/steps/ResetIdentity.tsx +0 -80
|
@@ -75,7 +75,8 @@ exports.os = {
|
|
|
75
75
|
'choose add device label': 'Add device',
|
|
76
76
|
'choose devices label': 'Manage devices',
|
|
77
77
|
'choose profile label': 'Edit profile',
|
|
78
|
-
'choose sign out label': '
|
|
78
|
+
'choose sign out label': 'Reset storage',
|
|
79
|
+
'choose join new identity label': 'Join existing device',
|
|
79
80
|
'empty space members message': 'There is nobody in this space yet.',
|
|
80
81
|
'back to all invitations label': 'Back to all invitations',
|
|
81
82
|
'invitation heading': 'Invitation',
|
|
@@ -99,18 +100,20 @@ exports.os = {
|
|
|
99
100
|
'invite options label': 'Change the active invite option.',
|
|
100
101
|
'reset in progress label': 'Resetting...',
|
|
101
102
|
'confirm label': 'Confirm',
|
|
102
|
-
'reset
|
|
103
|
+
'reset storage input label': 'This will clear this device and all associated data. Type {{confirmationValue}} and confirm to continue.',
|
|
104
|
+
'join new identity input label': 'In order to join an existing device, storage on this device must be cleared first. Type {{confirmationValue}} to continue.',
|
|
103
105
|
'failed to reset identity message': 'Failed to reset identity.',
|
|
104
106
|
'confirmation value': 'CONFIRM',
|
|
105
|
-
'sign out chooser title': '
|
|
106
|
-
'sign out chooser message': 'Proceeding with
|
|
107
|
+
'sign out chooser title': 'Danger zone',
|
|
108
|
+
'sign out chooser message': 'Proceeding with the action below will erase all data on this device.',
|
|
107
109
|
'join new identity label': 'Join a new identity',
|
|
108
|
-
'reset device label': 'Reset
|
|
110
|
+
'reset device label': 'Reset storage',
|
|
109
111
|
'reset device confirm message': 'Are you sure you want to reset your device? All data will be lost.',
|
|
110
112
|
'emoji and color label': 'Emoji and color',
|
|
111
113
|
'clear label': 'Use default',
|
|
112
114
|
'select emoji label': 'Choose an emoji to use in your avatar',
|
|
113
115
|
'select hue label': 'Choose a hue to use in your avatar',
|
|
116
|
+
'resetting message': 'One moment while things are reset…',
|
|
114
117
|
'red label': 'Red',
|
|
115
118
|
'orange label': 'Orange',
|
|
116
119
|
'amber label': 'Amber',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en-US.js","sourceRoot":"","sources":["../../../../../src/translations/locales/en-US.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEW,QAAA,EAAE,GAAG;IAChB,sBAAsB,EAAE,iBAAiB;IACzC,8BAA8B,EAAE,SAAS;IACzC,eAAe,EAAE,cAAc;IAC/B,4BAA4B,EAAE,UAAU;IACxC,oBAAoB,EAAE,QAAQ;IAC9B,4BAA4B,EAAE,iBAAiB;IAC/C,wBAAwB,E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AuC;IAC7D,kBAAkB,EAAE,oCAAoC;IACxD,mBAAmB,EAAE,oCAAoC;IACzD,WAAW,EAAE,KAAK;IAClB,cAAc,EAAE,QAAQ;IACxB,aAAa,EAAE,OAAO;IACtB,cAAc,EAAE,QAAQ;IACxB,YAAY,EAAE,MAAM;IACpB,aAAa,EAAE,OAAO;IACtB,eAAe,EAAE,SAAS;IAC1B,YAAY,EAAE,MAAM;IACpB,YAAY,EAAE,MAAM;IACpB,WAAW,EAAE,KAAK;IAClB,YAAY,EAAE,MAAM;IACpB,cAAc,EAAE,QAAQ;IACxB,cAAc,EAAE,QAAQ;IACxB,cAAc,EAAE,QAAQ;IACxB,eAAe,EAAE,SAAS;IAC1B,YAAY,EAAE,MAAM;IACpB,YAAY,EAAE,MAAM;CACrB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/shell",
|
|
3
|
-
"version": "0.4.10-main.
|
|
3
|
+
"version": "0.4.10-main.f68a1ca",
|
|
4
4
|
"description": "DXOS’s OS experiences",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -42,19 +42,19 @@
|
|
|
42
42
|
"react-qr-rounded": "^1.0.0",
|
|
43
43
|
"url-join": "^5.0.0",
|
|
44
44
|
"xstate": "^4.37.0",
|
|
45
|
-
"@dxos/async": "0.4.10-main.
|
|
46
|
-
"@dxos/client-
|
|
47
|
-
"@dxos/client-
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/invariant": "0.4.10-main.
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/react-
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/react-ui
|
|
55
|
-
"@dxos/rpc-tunnel": "0.4.10-main.
|
|
56
|
-
"@dxos/util": "0.4.10-main.
|
|
57
|
-
"@dxos/react-ui-
|
|
45
|
+
"@dxos/async": "0.4.10-main.f68a1ca",
|
|
46
|
+
"@dxos/client-services": "0.4.10-main.f68a1ca",
|
|
47
|
+
"@dxos/client-protocol": "0.4.10-main.f68a1ca",
|
|
48
|
+
"@dxos/debug": "0.4.10-main.f68a1ca",
|
|
49
|
+
"@dxos/display-name": "0.4.10-main.f68a1ca",
|
|
50
|
+
"@dxos/invariant": "0.4.10-main.f68a1ca",
|
|
51
|
+
"@dxos/react-client": "0.4.10-main.f68a1ca",
|
|
52
|
+
"@dxos/react-ui-theme": "0.4.10-main.f68a1ca",
|
|
53
|
+
"@dxos/log": "0.4.10-main.f68a1ca",
|
|
54
|
+
"@dxos/react-ui": "0.4.10-main.f68a1ca",
|
|
55
|
+
"@dxos/rpc-tunnel": "0.4.10-main.f68a1ca",
|
|
56
|
+
"@dxos/util": "0.4.10-main.f68a1ca",
|
|
57
|
+
"@dxos/react-ui-types": "0.4.10-main.f68a1ca"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@phosphor-icons/react": "^2.0.5",
|
|
@@ -65,11 +65,11 @@
|
|
|
65
65
|
"react-dom": "^18.2.0",
|
|
66
66
|
"vite": "^5.1.5",
|
|
67
67
|
"vite-plugin-turbosnap": "^1.0.2",
|
|
68
|
-
"@dxos/config": "0.4.10-main.
|
|
69
|
-
"@dxos/random": "0.4.10-main.
|
|
70
|
-
"@dxos/
|
|
71
|
-
"@dxos/react-
|
|
72
|
-
"@dxos/
|
|
68
|
+
"@dxos/config": "0.4.10-main.f68a1ca",
|
|
69
|
+
"@dxos/random": "0.4.10-main.f68a1ca",
|
|
70
|
+
"@dxos/storybook-utils": "0.4.10-main.f68a1ca",
|
|
71
|
+
"@dxos/react-async": "0.4.10-main.f68a1ca",
|
|
72
|
+
"@dxos/react-ui-theme": "0.4.10-main.f68a1ca"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
75
|
"@phosphor-icons/react": "^2.0.5",
|
|
@@ -16,7 +16,7 @@ export interface IdentityDialogProps
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export const IdentityDialog = (props: IdentityDialogProps) => {
|
|
19
|
-
const titleId = useId('
|
|
19
|
+
const titleId = useId('identityDialog__title', props.title);
|
|
20
20
|
return (
|
|
21
21
|
<Dialog.Root defaultOpen onOpenChange={(open) => open || props.onDone?.()}>
|
|
22
22
|
<Dialog.Portal>
|
|
@@ -11,6 +11,7 @@ import { useSpace } from '@dxos/react-client/echo';
|
|
|
11
11
|
import { IdentityDialog } from '../IdentityDialog';
|
|
12
12
|
import { JoinDialog } from '../JoinDialog';
|
|
13
13
|
import { SpaceDialog } from '../SpaceDialog';
|
|
14
|
+
import { StatusDialog } from '../StatusDialog';
|
|
14
15
|
|
|
15
16
|
export const Shell = ({ runtime, origin }: { runtime: ShellRuntime; origin: string }) => {
|
|
16
17
|
const [{ layout, invitationCode, spaceKey, target }, setLayout] = useState<LayoutRequest>({
|
|
@@ -41,11 +42,18 @@ export const Shell = ({ runtime, origin }: { runtime: ShellRuntime; origin: stri
|
|
|
41
42
|
}, [runtime, layout, space]);
|
|
42
43
|
|
|
43
44
|
switch (layout) {
|
|
45
|
+
case ShellLayout.STATUS:
|
|
46
|
+
return <StatusDialog />;
|
|
44
47
|
case ShellLayout.INITIALIZE_IDENTITY:
|
|
48
|
+
case ShellLayout.INITIALIZE_IDENTITY_FROM_INVITATION:
|
|
45
49
|
return (
|
|
46
50
|
<JoinDialog
|
|
47
51
|
mode='halo-only'
|
|
52
|
+
initialDisposition={
|
|
53
|
+
layout === ShellLayout.INITIALIZE_IDENTITY_FROM_INVITATION ? 'accept-halo-invitation' : 'default'
|
|
54
|
+
}
|
|
48
55
|
initialInvitationCode={invitationCode}
|
|
56
|
+
onCancelResetStorage={() => runtime.setLayout({ layout: ShellLayout.IDENTITY })}
|
|
49
57
|
onDone={() => {
|
|
50
58
|
void runtime.setAppContext({ display: ShellDisplay.NONE });
|
|
51
59
|
runtime.setLayout({ layout: ShellLayout.DEFAULT });
|
|
@@ -53,22 +61,33 @@ export const Shell = ({ runtime, origin }: { runtime: ShellRuntime; origin: stri
|
|
|
53
61
|
/>
|
|
54
62
|
);
|
|
55
63
|
|
|
56
|
-
// TODO(wittjosiah): Jump straight to specific step if SHARE or EDIT are specified.
|
|
57
64
|
case ShellLayout.IDENTITY:
|
|
58
65
|
case ShellLayout.SHARE_IDENTITY:
|
|
59
66
|
case ShellLayout.EDIT_PROFILE:
|
|
60
67
|
return (
|
|
61
68
|
<IdentityDialog
|
|
62
69
|
createInvitationUrl={(invitationCode) => `${origin}?deviceInvitationCode=${invitationCode}`}
|
|
63
|
-
|
|
70
|
+
onResetStorage={async () => {
|
|
71
|
+
runtime.setLayout({ layout: ShellLayout.STATUS });
|
|
64
72
|
await client.reset();
|
|
65
|
-
|
|
73
|
+
return runtime.setAppContext({ display: ShellDisplay.NONE, reload: true });
|
|
74
|
+
}}
|
|
75
|
+
onJoinNewIdentity={async () => {
|
|
76
|
+
runtime.setLayout({ layout: ShellLayout.STATUS });
|
|
77
|
+
await client.reset();
|
|
78
|
+
return runtime.setLayout({ layout: ShellLayout.INITIALIZE_IDENTITY_FROM_INVITATION });
|
|
66
79
|
}}
|
|
67
|
-
onJoinNewIdentity={() => runtime.setLayout({ layout: ShellLayout.INITIALIZE_IDENTITY })}
|
|
68
80
|
onDone={async () => {
|
|
69
81
|
await runtime.setAppContext({ display: ShellDisplay.NONE });
|
|
70
82
|
runtime.setLayout({ layout: ShellLayout.DEFAULT });
|
|
71
83
|
}}
|
|
84
|
+
initialDisposition={
|
|
85
|
+
layout === ShellLayout.SHARE_IDENTITY
|
|
86
|
+
? 'manage-device-invitation'
|
|
87
|
+
: layout === ShellLayout.EDIT_PROFILE
|
|
88
|
+
? 'manage-profile'
|
|
89
|
+
: 'default'
|
|
90
|
+
}
|
|
72
91
|
/>
|
|
73
92
|
);
|
|
74
93
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { AlertDialog, useId } from '@dxos/react-ui';
|
|
8
|
+
|
|
9
|
+
import { StatusPanel } from '../../panels';
|
|
10
|
+
|
|
11
|
+
export const StatusDialog = () => {
|
|
12
|
+
const titleId = useId('statusDialog__title');
|
|
13
|
+
return (
|
|
14
|
+
<AlertDialog.Root open>
|
|
15
|
+
<AlertDialog.Portal>
|
|
16
|
+
<AlertDialog.Overlay>
|
|
17
|
+
<AlertDialog.Content aria-labelledby={titleId}>
|
|
18
|
+
<StatusPanel titleId={titleId} />
|
|
19
|
+
</AlertDialog.Content>
|
|
20
|
+
</AlertDialog.Overlay>
|
|
21
|
+
</AlertDialog.Portal>
|
|
22
|
+
</AlertDialog.Root>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
@@ -18,10 +18,10 @@ import {
|
|
|
18
18
|
type IdentityPanelProps,
|
|
19
19
|
} from './IdentityPanelProps';
|
|
20
20
|
import { useIdentityMachine } from './identityMachine';
|
|
21
|
-
import { AgentForm, DeviceManager, IdentityActionChooser, ProfileForm
|
|
21
|
+
import { AgentForm, DeviceManager, IdentityActionChooser, ProfileForm } from './steps';
|
|
22
22
|
import { useAgentHandlers } from './useAgentHandlers';
|
|
23
23
|
import { Viewport, Heading, CloseButton } from '../../components';
|
|
24
|
-
import { InvitationManager } from '../../steps';
|
|
24
|
+
import { ConfirmReset, InvitationManager } from '../../steps';
|
|
25
25
|
|
|
26
26
|
const viewStyles = 'pbs-1 pbe-3 pli-3';
|
|
27
27
|
|
|
@@ -47,7 +47,7 @@ export const IdentityPanelImpl = (props: IdentityPanelImplProps) => {
|
|
|
47
47
|
titleId,
|
|
48
48
|
activeView,
|
|
49
49
|
onUpdateProfile,
|
|
50
|
-
|
|
50
|
+
onResetStorage,
|
|
51
51
|
onJoinNewIdentity,
|
|
52
52
|
IdentityActionChooser: IdentityActionChooserComponent = IdentityActionChooser,
|
|
53
53
|
InvitationManager: InvitationManagerComponent = InvitationManager,
|
|
@@ -66,6 +66,8 @@ export const IdentityPanelImpl = (props: IdentityPanelImplProps) => {
|
|
|
66
66
|
}
|
|
67
67
|
}, [activeView, t]);
|
|
68
68
|
|
|
69
|
+
const onCancelReset = () => rest.send?.('unchooseAction');
|
|
70
|
+
|
|
69
71
|
return (
|
|
70
72
|
<DensityProvider density='fine'>
|
|
71
73
|
<IdentityHeading {...{ identity, titleId, title, onDone }} />
|
|
@@ -92,17 +94,27 @@ export const IdentityPanelImpl = (props: IdentityPanelImplProps) => {
|
|
|
92
94
|
onUpdateProfile={onUpdateProfile}
|
|
93
95
|
/>
|
|
94
96
|
</Viewport.View>
|
|
95
|
-
<Viewport.View classNames={viewStyles} id='signing out'>
|
|
96
|
-
<SignOutChooser
|
|
97
|
-
send={rest.send}
|
|
98
|
-
active={activeView === 'signing out'}
|
|
99
|
-
onResetDevice={onResetDevice}
|
|
100
|
-
onJoinNewIdentity={onJoinNewIdentity}
|
|
101
|
-
/>
|
|
102
|
-
</Viewport.View>
|
|
103
97
|
<Viewport.View classNames={viewStyles} id='agent manager'>
|
|
104
98
|
<AgentForm send={rest.send} active={activeView === 'agent manager'} {...rest} />
|
|
105
99
|
</Viewport.View>
|
|
100
|
+
<Viewport.View classNames={viewStyles} id='confirm join new identity'>
|
|
101
|
+
<ConfirmReset
|
|
102
|
+
active={activeView === 'confirm join new identity'}
|
|
103
|
+
{...rest}
|
|
104
|
+
mode='join new identity'
|
|
105
|
+
onConfirm={onJoinNewIdentity}
|
|
106
|
+
onCancel={onCancelReset}
|
|
107
|
+
/>
|
|
108
|
+
</Viewport.View>
|
|
109
|
+
<Viewport.View classNames={viewStyles} id='confirm reset storage'>
|
|
110
|
+
<ConfirmReset
|
|
111
|
+
active={activeView === 'confirm reset storage'}
|
|
112
|
+
{...rest}
|
|
113
|
+
mode='reset storage'
|
|
114
|
+
onConfirm={onResetStorage}
|
|
115
|
+
onCancel={onCancelReset}
|
|
116
|
+
/>
|
|
117
|
+
</Viewport.View>
|
|
106
118
|
</Viewport.Views>
|
|
107
119
|
</Viewport.Root>
|
|
108
120
|
</DensityProvider>
|
|
@@ -120,6 +132,7 @@ const IdentityPanelWithInvitationImpl = ({
|
|
|
120
132
|
export const IdentityPanel = ({
|
|
121
133
|
titleId: propsTitleId,
|
|
122
134
|
createInvitationUrl = (code) => code,
|
|
135
|
+
initialDisposition = 'default',
|
|
123
136
|
...props
|
|
124
137
|
}: IdentityPanelProps) => {
|
|
125
138
|
const titleId = useId('identityPanel__heading', propsTitleId);
|
|
@@ -132,7 +145,9 @@ export const IdentityPanel = ({
|
|
|
132
145
|
log.error('IdentityPanel rendered with no active identity.');
|
|
133
146
|
return null;
|
|
134
147
|
}
|
|
135
|
-
const [identityState, identitySend, identityService] = useIdentityMachine(client
|
|
148
|
+
const [identityState, identitySend, identityService] = useIdentityMachine(client, {
|
|
149
|
+
context: { initialDisposition },
|
|
150
|
+
});
|
|
136
151
|
|
|
137
152
|
useEffect(() => {
|
|
138
153
|
const subscription = identityService.subscribe((state) => {
|
|
@@ -152,8 +167,10 @@ export const IdentityPanel = ({
|
|
|
152
167
|
return 'device manager';
|
|
153
168
|
case [{ managingProfile: 'idle' }, { managingProfile: 'pending' }].some(identityState.matches):
|
|
154
169
|
return 'update profile form';
|
|
155
|
-
case identityState.matches('
|
|
156
|
-
return '
|
|
170
|
+
case identityState.matches('confirmingResetStorage'):
|
|
171
|
+
return 'confirm reset storage';
|
|
172
|
+
case identityState.matches('confirmingJoinNewIdentity'):
|
|
173
|
+
return 'confirm join new identity';
|
|
157
174
|
case [{ managingAgent: 'idle' }, { managingAgent: 'pending' }].some(identityState.matches):
|
|
158
175
|
return 'agent manager';
|
|
159
176
|
default:
|
|
@@ -11,6 +11,8 @@ import type { InvitationStatus } from '@dxos/react-client/invitations';
|
|
|
11
11
|
import type { IdentityEvent } from './identityMachine';
|
|
12
12
|
import type { InvitationManagerProps } from '../../steps';
|
|
13
13
|
|
|
14
|
+
export type IdentityPanelInitialDisposition = 'default' | 'manage-device-invitation' | 'manage-profile';
|
|
15
|
+
|
|
14
16
|
export type AgentFormProps = {
|
|
15
17
|
onAgentCreate?: () => Promise<void>;
|
|
16
18
|
onAgentDestroy?: () => Promise<void>;
|
|
@@ -28,12 +30,14 @@ export type IdentityPanelImplProps = {
|
|
|
28
30
|
| 'update profile form'
|
|
29
31
|
| 'device invitation manager'
|
|
30
32
|
| 'identity action chooser'
|
|
31
|
-
| '
|
|
33
|
+
| 'confirm join new identity'
|
|
34
|
+
| 'confirm reset storage';
|
|
35
|
+
initialDisposition?: IdentityPanelInitialDisposition;
|
|
32
36
|
identity: Identity;
|
|
33
37
|
devices: Device[];
|
|
34
38
|
onUpdateProfile?: (profile: NonNullable<Identity['profile']>) => Promise<void>;
|
|
35
|
-
|
|
36
|
-
onJoinNewIdentity?: () => void
|
|
39
|
+
onResetStorage?: () => Promise<void>;
|
|
40
|
+
onJoinNewIdentity?: () => Promise<void>;
|
|
37
41
|
createInvitationUrl: (invitationCode: string) => string;
|
|
38
42
|
send?: (event: SingleOrArray<Event<IdentityEvent>>) => void;
|
|
39
43
|
onDone?: () => void;
|
|
@@ -10,16 +10,24 @@ import { type Client } from '@dxos/react-client';
|
|
|
10
10
|
import { type Identity } from '@dxos/react-client/halo';
|
|
11
11
|
import { type CancellableInvitationObservable } from '@dxos/react-client/invitations';
|
|
12
12
|
|
|
13
|
+
import { type IdentityPanelInitialDisposition } from './IdentityPanelProps';
|
|
13
14
|
import { type StepEvent } from '../../steps';
|
|
14
15
|
|
|
15
16
|
type IdentityMachineContext = {
|
|
17
|
+
initialDisposition?: IdentityPanelInitialDisposition;
|
|
16
18
|
invitation?: CancellableInvitationObservable;
|
|
17
19
|
identity: Identity | null;
|
|
18
20
|
identitySubscribable: Subscribable<SetIdentityEvent> | null;
|
|
19
21
|
};
|
|
20
22
|
|
|
21
23
|
type IdentityChooseActionEvent = {
|
|
22
|
-
type:
|
|
24
|
+
type:
|
|
25
|
+
| 'chooseDevices'
|
|
26
|
+
| 'chooseAgent'
|
|
27
|
+
| 'chooseProfile'
|
|
28
|
+
| 'chooseResetStorage'
|
|
29
|
+
| 'chooseJoinNewIdentity'
|
|
30
|
+
| 'unchooseAction';
|
|
23
31
|
};
|
|
24
32
|
|
|
25
33
|
type IdentitySelectDeviceInvitationEvent = {
|
|
@@ -56,6 +64,13 @@ const identityMachine = createMachine<IdentityMachineContext, IdentityEvent>(
|
|
|
56
64
|
src: (context) => context.identitySubscribable!,
|
|
57
65
|
},
|
|
58
66
|
states: {
|
|
67
|
+
unknown: {
|
|
68
|
+
always: [
|
|
69
|
+
{ cond: 'initiallyManagingDeviceInvitation', target: 'managingDeviceInvitation', actions: 'log' },
|
|
70
|
+
{ cond: 'initiallyManagingProfile', target: 'managingProfile', actions: 'log' },
|
|
71
|
+
{ target: 'choosingAction', actions: 'log' },
|
|
72
|
+
],
|
|
73
|
+
},
|
|
59
74
|
choosingAction: {},
|
|
60
75
|
managingDeviceInvitation: {},
|
|
61
76
|
managingAgent: {
|
|
@@ -77,7 +92,8 @@ const identityMachine = createMachine<IdentityMachineContext, IdentityEvent>(
|
|
|
77
92
|
updateProfile: { target: '.pending', actions: 'log' },
|
|
78
93
|
},
|
|
79
94
|
},
|
|
80
|
-
|
|
95
|
+
confirmingResetStorage: {},
|
|
96
|
+
confirmingJoinNewIdentity: {},
|
|
81
97
|
},
|
|
82
98
|
on: {
|
|
83
99
|
unchooseAction: { target: '.choosingAction', actions: ['unsetInvitation', 'log'] },
|
|
@@ -85,11 +101,17 @@ const identityMachine = createMachine<IdentityMachineContext, IdentityEvent>(
|
|
|
85
101
|
selectInvitation: { target: '.managingDeviceInvitation', actions: ['setInvitation', 'log'] },
|
|
86
102
|
chooseDevices: { target: '.managingDevices', actions: 'log' },
|
|
87
103
|
chooseProfile: { target: '.managingProfile', actions: 'log' },
|
|
88
|
-
|
|
104
|
+
chooseJoinNewIdentity: { target: '.confirmingJoinNewIdentity', actions: 'log' },
|
|
105
|
+
chooseResetStorage: { target: '.confirmingResetStorage', actions: 'log' },
|
|
89
106
|
chooseAgent: { target: '.managingAgent', actions: 'log' },
|
|
90
107
|
},
|
|
91
108
|
},
|
|
92
109
|
{
|
|
110
|
+
guards: {
|
|
111
|
+
initiallyManagingDeviceInvitation: ({ initialDisposition }, _event) =>
|
|
112
|
+
initialDisposition === 'manage-device-invitation',
|
|
113
|
+
initiallyManagingProfile: ({ initialDisposition }, _event) => initialDisposition === 'manage-profile',
|
|
114
|
+
},
|
|
93
115
|
actions: {
|
|
94
116
|
setIdentity: assign<IdentityMachineContext, IdentityEvent>({
|
|
95
117
|
identity: (context, event) => (event as SetIdentityEvent)?.identity ?? null,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { CaretRight, Devices, Plus, Power, UserGear, HardDrive } from '@phosphor-icons/react';
|
|
5
|
+
import { CaretRight, Devices, Plus, Power, UserGear, HardDrive, Intersect } from '@phosphor-icons/react';
|
|
6
6
|
import React, { useCallback } from 'react';
|
|
7
7
|
|
|
8
8
|
import { log } from '@dxos/log';
|
|
@@ -73,6 +73,11 @@ export const IdentityActionChooserImpl = ({
|
|
|
73
73
|
<div role='none' className='grow flex flex-col gap-1'>
|
|
74
74
|
<DensityProvider density='coarse'>
|
|
75
75
|
<div className='grow justify-center flex flex-col gap-1'>
|
|
76
|
+
<Action data-testid='manage-profile' onClick={() => send?.({ type: 'chooseProfile' })} classNames='plb-4'>
|
|
77
|
+
<UserGear className={getSize(6)} />
|
|
78
|
+
<span className='grow mli-3'>{t('choose profile label')}</span>
|
|
79
|
+
<CaretRight weight='bold' className={getSize(4)} />
|
|
80
|
+
</Action>
|
|
76
81
|
{agentHostingEnabled && (
|
|
77
82
|
<Action data-testid='manage-agent' onClick={() => send?.({ type: 'chooseAgent' })} classNames='plb-4'>
|
|
78
83
|
<HardDrive className={getSize(6)} />
|
|
@@ -90,19 +95,23 @@ export const IdentityActionChooserImpl = ({
|
|
|
90
95
|
<span className='grow mli-3'>{t('choose add device label')}</span>
|
|
91
96
|
<CaretRight weight='bold' className={getSize(4)} />
|
|
92
97
|
</Action>
|
|
98
|
+
<Action
|
|
99
|
+
data-testid='devices-panel.join-new-identity'
|
|
100
|
+
onClick={() => send?.({ type: 'chooseJoinNewIdentity' })}
|
|
101
|
+
classNames='plb-4'
|
|
102
|
+
>
|
|
103
|
+
<Intersect className={getSize(6)} />
|
|
104
|
+
<span className='grow mli-3'>{t('choose join new identity label')}</span>
|
|
105
|
+
<CaretRight weight='bold' className={getSize(4)} />
|
|
106
|
+
</Action>
|
|
93
107
|
<Action data-testid='manage-devices' onClick={() => send?.({ type: 'chooseDevices' })} classNames='plb-4'>
|
|
94
108
|
<Devices className={getSize(6)} />
|
|
95
109
|
<span className='grow mli-3'>{t('choose devices label')}</span>
|
|
96
110
|
<CaretRight weight='bold' className={getSize(4)} />
|
|
97
111
|
</Action>
|
|
98
|
-
<Action data-testid='manage-profile' onClick={() => send?.({ type: 'chooseProfile' })} classNames='plb-4'>
|
|
99
|
-
<UserGear className={getSize(6)} />
|
|
100
|
-
<span className='grow mli-3'>{t('choose profile label')}</span>
|
|
101
|
-
<CaretRight weight='bold' className={getSize(4)} />
|
|
102
|
-
</Action>
|
|
103
112
|
<Action
|
|
104
113
|
data-testid='devices-panel.sign-out'
|
|
105
|
-
onClick={() => send?.({ type: '
|
|
114
|
+
onClick={() => send?.({ type: 'chooseResetStorage' })}
|
|
106
115
|
classNames='plb-4'
|
|
107
116
|
>
|
|
108
117
|
<Power className={getSize(6)} />
|
|
@@ -10,8 +10,9 @@ import { withTheme } from '@dxos/storybook-utils';
|
|
|
10
10
|
|
|
11
11
|
import { JoinPanelImpl } from './JoinPanel';
|
|
12
12
|
import { type JoinPanelImplProps } from './JoinPanelProps';
|
|
13
|
-
import { IdentityInputImpl
|
|
13
|
+
import { IdentityInputImpl } from './steps';
|
|
14
14
|
import { StorybookDialog } from '../../components/StorybookDialog';
|
|
15
|
+
import { ConfirmResetImpl } from '../../steps';
|
|
15
16
|
|
|
16
17
|
const noOpProps: JoinPanelImplProps = {
|
|
17
18
|
titleId: 'storybookJoinPanel__title',
|
|
@@ -34,7 +35,7 @@ export default {
|
|
|
34
35
|
parameters: { chromatic: { disableSnapshot: false } },
|
|
35
36
|
args: {
|
|
36
37
|
IdentityInput: IdentityInputImpl,
|
|
37
|
-
ResetIdentity:
|
|
38
|
+
ResetIdentity: ConfirmResetImpl,
|
|
38
39
|
},
|
|
39
40
|
};
|
|
40
41
|
|
|
@@ -19,9 +19,9 @@ import {
|
|
|
19
19
|
InvitationRescuer,
|
|
20
20
|
InvitationInput,
|
|
21
21
|
InvitationAccepted,
|
|
22
|
-
ResetIdentity,
|
|
23
22
|
} from './steps';
|
|
24
23
|
import { Viewport } from '../../components';
|
|
24
|
+
import { ConfirmReset } from '../../steps';
|
|
25
25
|
import { stepStyles } from '../../styles';
|
|
26
26
|
|
|
27
27
|
export const JoinPanelImpl = (props: JoinPanelImplProps) => {
|
|
@@ -44,8 +44,10 @@ export const JoinPanelImpl = (props: JoinPanelImplProps) => {
|
|
|
44
44
|
onSpaceInvitationCancel,
|
|
45
45
|
onHaloInvitationAuthenticate,
|
|
46
46
|
onSpaceInvitationAuthenticate,
|
|
47
|
+
onCancelResetStorage,
|
|
48
|
+
onConfirmResetStorage,
|
|
47
49
|
IdentityInput: IdentityInputComponent = IdentityInput,
|
|
48
|
-
|
|
50
|
+
ConfirmReset: ConfirmResetComponent = ConfirmReset,
|
|
49
51
|
} = props;
|
|
50
52
|
return (
|
|
51
53
|
<DensityProvider density='fine'>
|
|
@@ -55,11 +57,12 @@ export const JoinPanelImpl = (props: JoinPanelImplProps) => {
|
|
|
55
57
|
<Viewport.View classNames={stepStyles} id='addition method chooser'>
|
|
56
58
|
<AdditionMethodChooser send={send} active={activeView === 'addition method chooser'} />
|
|
57
59
|
</Viewport.View>
|
|
58
|
-
<Viewport.View classNames={stepStyles} id='reset
|
|
59
|
-
<
|
|
60
|
+
<Viewport.View classNames={stepStyles} id='reset storage confirmation'>
|
|
61
|
+
<ConfirmResetComponent
|
|
60
62
|
send={send}
|
|
61
|
-
method='reset identity'
|
|
62
63
|
active={activeView === 'reset identity confirmation'}
|
|
64
|
+
onCancel={onCancelResetStorage}
|
|
65
|
+
onConfirm={onConfirmResetStorage}
|
|
63
66
|
/>
|
|
64
67
|
</Viewport.View>
|
|
65
68
|
<Viewport.View classNames={stepStyles} id='create identity input'>
|
|
@@ -172,11 +175,13 @@ export const JoinPanelImpl = (props: JoinPanelImplProps) => {
|
|
|
172
175
|
export const JoinPanel = ({
|
|
173
176
|
titleId: propsTitleId,
|
|
174
177
|
mode = 'default',
|
|
178
|
+
initialDisposition = 'default',
|
|
175
179
|
initialInvitationCode,
|
|
176
180
|
exitActionParent,
|
|
177
181
|
onExit,
|
|
178
182
|
doneActionParent,
|
|
179
183
|
onDone: propsOnDone,
|
|
184
|
+
onCancelResetStorage,
|
|
180
185
|
}: JoinPanelProps) => {
|
|
181
186
|
const client = useClient();
|
|
182
187
|
const identity = useIdentity();
|
|
@@ -186,6 +191,7 @@ export const JoinPanel = ({
|
|
|
186
191
|
const [joinState, joinSend, joinService] = useJoinMachine(client, {
|
|
187
192
|
context: {
|
|
188
193
|
mode,
|
|
194
|
+
initialDisposition,
|
|
189
195
|
identity,
|
|
190
196
|
...(initialInvitationCode && {
|
|
191
197
|
[mode === 'halo-only' ? 'halo' : 'space']: { unredeemedCode: initialInvitationCode },
|
|
@@ -379,6 +385,14 @@ export const JoinPanel = ({
|
|
|
379
385
|
});
|
|
380
386
|
}, [joinState, propsOnDone]);
|
|
381
387
|
|
|
388
|
+
const onConfirmResetStorage = useCallback(
|
|
389
|
+
() =>
|
|
390
|
+
client.reset().then(() => {
|
|
391
|
+
joinSend({ type: 'resetIdentity' });
|
|
392
|
+
}),
|
|
393
|
+
[client, joinSend],
|
|
394
|
+
);
|
|
395
|
+
|
|
382
396
|
return (
|
|
383
397
|
<JoinPanelImpl
|
|
384
398
|
{...{
|
|
@@ -409,6 +423,8 @@ export const JoinPanel = ({
|
|
|
409
423
|
joinSend({ type: 'authenticateSpaceVerificationCode' });
|
|
410
424
|
return joinState.context.space.invitationObservable?.authenticate(authCode);
|
|
411
425
|
},
|
|
426
|
+
onConfirmResetStorage,
|
|
427
|
+
onCancelResetStorage,
|
|
412
428
|
}}
|
|
413
429
|
/>
|
|
414
430
|
);
|
|
@@ -8,12 +8,14 @@ import type { Identity } from '@dxos/react-client/halo';
|
|
|
8
8
|
import type { Invitation, AuthenticatingInvitationObservable, InvitationResult } from '@dxos/react-client/invitations';
|
|
9
9
|
|
|
10
10
|
import { type JoinSend } from './joinMachine';
|
|
11
|
-
import { type
|
|
12
|
-
import { type StepProps } from '../../steps';
|
|
11
|
+
import { type IdentityInputProps } from './steps';
|
|
12
|
+
import { type ConfirmResetProps, type StepProps } from '../../steps';
|
|
13
13
|
import { type FailReason } from '../../types';
|
|
14
14
|
|
|
15
15
|
export type JoinPanelMode = 'default' | 'halo-only';
|
|
16
16
|
|
|
17
|
+
export type JoinPanelInitialDisposition = 'default' | 'accept-halo-invitation';
|
|
18
|
+
|
|
17
19
|
export type JoinStepProps = Omit<StepProps, 'send' | 'onDone'> & {
|
|
18
20
|
send: JoinSend;
|
|
19
21
|
onDone?: (result: InvitationResult | null) => void;
|
|
@@ -21,6 +23,7 @@ export type JoinStepProps = Omit<StepProps, 'send' | 'onDone'> & {
|
|
|
21
23
|
|
|
22
24
|
export interface JoinPanelProps {
|
|
23
25
|
mode?: JoinPanelMode;
|
|
26
|
+
initialDisposition?: JoinPanelInitialDisposition;
|
|
24
27
|
initialInvitationCode?: string;
|
|
25
28
|
titleId?: string;
|
|
26
29
|
exitActionParent?: Parameters<typeof cloneElement>[0];
|
|
@@ -28,6 +31,7 @@ export interface JoinPanelProps {
|
|
|
28
31
|
onExit?: () => void;
|
|
29
32
|
onDone?: (result: InvitationResult | null) => void;
|
|
30
33
|
parseInvitationCodeInput?: (invitationCodeInput: string) => string;
|
|
34
|
+
onCancelResetStorage?: () => void;
|
|
31
35
|
}
|
|
32
36
|
|
|
33
37
|
export type JoinPanelImplProps = Pick<
|
|
@@ -61,8 +65,10 @@ export type JoinPanelImplProps = Pick<
|
|
|
61
65
|
onSpaceInvitationCancel?: () => Promise<void> | undefined;
|
|
62
66
|
onHaloInvitationAuthenticate?: (authCode: string) => Promise<void> | undefined;
|
|
63
67
|
onSpaceInvitationAuthenticate?: (authCode: string) => Promise<void> | undefined;
|
|
68
|
+
onConfirmResetStorage?: () => Promise<void>;
|
|
69
|
+
onCancelResetStorage?: () => void;
|
|
64
70
|
IdentityInput?: React.FC<IdentityInputProps>;
|
|
65
|
-
|
|
71
|
+
ConfirmReset?: React.FC<ConfirmResetProps>;
|
|
66
72
|
};
|
|
67
73
|
|
|
68
74
|
export interface IdentityAction {
|