@dxos/shell 0.4.10-main.fa5a270 → 0.4.10-main.fd8ea31
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/index-Cms4wG79.mjs +110 -0
- package/dist/bundle/index-Cms4wG79.mjs.map +1 -0
- package/dist/bundle/index-DACjPI-n.mjs +96625 -0
- package/dist/bundle/index-DACjPI-n.mjs.map +1 -0
- package/dist/bundle/shell.mjs +9 -80814
- package/dist/bundle/shell.mjs.map +1 -1
- package/dist/bundle/shell.umd.js +156 -85
- 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 +1177 -1034
- package/dist/lib/browser/react.mjs.map +4 -4
- package/dist/lib/browser/testing/index.mjs +10 -9
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/types/src/components/AgentConfig.d.ts +3 -0
- package/dist/types/src/components/AgentConfig.d.ts.map +1 -0
- package/dist/types/src/components/AgentConfig.js +37 -0
- package/dist/types/src/components/AgentConfig.js.map +1 -0
- package/dist/types/src/components/DeviceList/DeviceList.d.ts +3 -0
- package/dist/types/src/components/DeviceList/DeviceList.d.ts.map +1 -0
- package/dist/types/src/components/DeviceList/DeviceList.js +29 -0
- package/dist/types/src/components/DeviceList/DeviceList.js.map +1 -0
- package/dist/types/src/components/DeviceList/DeviceListItem.d.ts +6 -0
- package/dist/types/src/components/DeviceList/DeviceListItem.d.ts.map +1 -0
- package/dist/types/src/components/DeviceList/DeviceListItem.js +72 -0
- package/dist/types/src/components/DeviceList/DeviceListItem.js.map +1 -0
- package/dist/types/src/components/DeviceList/DeviceListProps.d.ts +27 -0
- package/dist/types/src/components/DeviceList/DeviceListProps.d.ts.map +1 -0
- package/dist/types/src/components/DeviceList/DeviceListProps.js +6 -0
- package/dist/types/src/components/DeviceList/DeviceListProps.js.map +1 -0
- package/dist/types/src/components/DeviceList/index.d.ts +3 -0
- package/dist/types/src/components/DeviceList/index.d.ts.map +1 -0
- package/dist/types/src/components/DeviceList/index.js +22 -0
- package/dist/types/src/components/DeviceList/index.js.map +1 -0
- package/dist/types/src/components/EmojiPicker.d.ts +9 -2
- package/dist/types/src/components/EmojiPicker.d.ts.map +1 -1
- package/dist/types/src/components/EmojiPicker.js +59 -4
- package/dist/types/src/components/EmojiPicker.js.map +1 -1
- package/dist/types/src/components/HuePicker.d.ts +9 -2
- package/dist/types/src/components/HuePicker.d.ts.map +1 -1
- package/dist/types/src/components/HuePicker.js +75 -6
- package/dist/types/src/components/HuePicker.js.map +1 -1
- package/dist/types/src/components/IdentityList/index.d.ts +0 -1
- package/dist/types/src/components/IdentityList/index.d.ts.map +1 -1
- package/dist/types/src/components/IdentityList/index.js +0 -1
- package/dist/types/src/components/IdentityList/index.js.map +1 -1
- package/dist/types/src/components/InvitationList/InvitationListItem.js +5 -5
- package/dist/types/src/components/InvitationList/InvitationListItem.js.map +1 -1
- package/dist/types/src/components/Panel/Action.d.ts +2 -2
- package/dist/types/src/components/Viewport/Viewport.d.ts +1 -1
- package/dist/types/src/components/index.d.ts +2 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/index.js +2 -0
- package/dist/types/src/components/index.js.map +1 -1
- 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 +14 -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 +89 -42
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.d.ts +0 -3
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.js +1 -43
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.d.ts +11 -12
- 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 +13 -24
- package/dist/types/src/panels/IdentityPanel/identityMachine.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.d.ts +4 -4
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js +9 -39
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.d.ts +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.js +6 -3
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/index.d.ts +0 -3
- package/dist/types/src/panels/IdentityPanel/steps/index.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/index.js +0 -3
- package/dist/types/src/panels/IdentityPanel/steps/index.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/useAgentHandlers.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/useAgentHandlers.js +5 -1
- package/dist/types/src/panels/IdentityPanel/useAgentHandlers.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/SpacePanel/steps/SpaceManager.d.ts.map +1 -1
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.js +3 -1
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.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/playwright/invitations.spec.js +3 -1
- package/dist/types/src/playwright/invitations.spec.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 +71 -0
- package/dist/types/src/steps/ConfirmReset.js.map +1 -0
- package/dist/types/src/steps/InvitationManager.d.ts +1 -1
- package/dist/types/src/steps/InvitationManager.d.ts.map +1 -1
- package/dist/types/src/steps/InvitationManager.js +3 -4
- package/dist/types/src/steps/InvitationManager.js.map +1 -1
- 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/stories/Invitations.e2e-stories.d.ts.map +1 -1
- package/dist/types/src/stories/Invitations.e2e-stories.js +5 -2
- package/dist/types/src/stories/Invitations.e2e-stories.js.map +1 -1
- package/dist/types/src/testing/shell-manager.d.ts.map +1 -1
- package/dist/types/src/testing/shell-manager.js +10 -9
- package/dist/types/src/testing/shell-manager.js.map +1 -1
- package/dist/types/src/translations/locales/en-US.d.ts +16 -3
- package/dist/types/src/translations/locales/en-US.d.ts.map +1 -1
- package/dist/types/src/translations/locales/en-US.js +20 -7
- package/dist/types/src/translations/locales/en-US.js.map +1 -1
- package/dist/types/src/types/index.js +1 -0
- package/dist/types/src/types/index.js.map +1 -1
- package/package.json +22 -21
- package/src/components/AgentConfig.tsx +66 -0
- package/src/components/DeviceList/DeviceList.tsx +54 -0
- package/src/components/DeviceList/DeviceListItem.tsx +120 -0
- package/src/components/DeviceList/DeviceListProps.ts +33 -0
- package/src/components/DeviceList/index.ts +6 -0
- package/src/components/EmojiPicker.tsx +103 -4
- package/src/components/HuePicker.tsx +99 -5
- package/src/components/IdentityList/index.ts +0 -1
- package/src/components/InvitationList/InvitationListItem.tsx +5 -5
- package/src/components/index.ts +2 -0
- package/src/composites/IdentityDialog/IdentityDialog.tsx +1 -1
- package/src/composites/Shell/Shell.tsx +17 -4
- package/src/composites/StatusDialog/StatusDialog.tsx +24 -0
- package/src/composites/StatusDialog/index.ts +5 -0
- package/src/panels/IdentityPanel/IdentityPanel.stories.tsx +0 -63
- package/src/panels/IdentityPanel/IdentityPanel.tsx +149 -43
- package/src/panels/IdentityPanel/IdentityPanelProps.ts +15 -15
- package/src/panels/IdentityPanel/identityMachine.ts +17 -25
- package/src/panels/IdentityPanel/steps/IdentityActionChooser.tsx +23 -67
- package/src/panels/IdentityPanel/steps/ProfileForm.tsx +18 -5
- package/src/panels/IdentityPanel/steps/index.ts +0 -3
- package/src/panels/IdentityPanel/useAgentHandlers.ts +5 -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/SpacePanel/steps/SpaceManager.tsx +3 -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/playwright/invitations.spec.ts +3 -1
- package/src/steps/ConfirmReset.tsx +112 -0
- package/src/steps/InvitationManager.tsx +4 -4
- package/src/steps/StepProps.ts +2 -1
- package/src/steps/index.ts +1 -0
- package/src/stories/Invitations.e2e-stories.tsx +6 -3
- package/src/testing/shell-manager.ts +10 -9
- package/src/translations/locales/en-US.ts +22 -7
- package/src/types/index.ts +2 -0
- package/dist/types/src/components/IdentityList/DeviceList.d.ts +0 -7
- package/dist/types/src/components/IdentityList/DeviceList.d.ts.map +0 -1
- package/dist/types/src/components/IdentityList/DeviceList.js +0 -34
- package/dist/types/src/components/IdentityList/DeviceList.js.map +0 -1
- package/dist/types/src/panels/IdentityPanel/steps/AgentForm.d.ts +0 -3
- package/dist/types/src/panels/IdentityPanel/steps/AgentForm.d.ts.map +0 -1
- package/dist/types/src/panels/IdentityPanel/steps/AgentForm.js +0 -26
- package/dist/types/src/panels/IdentityPanel/steps/AgentForm.js.map +0 -1
- package/dist/types/src/panels/IdentityPanel/steps/DeviceManager.d.ts +0 -10
- package/dist/types/src/panels/IdentityPanel/steps/DeviceManager.d.ts.map +0 -1
- package/dist/types/src/panels/IdentityPanel/steps/DeviceManager.js +0 -23
- package/dist/types/src/panels/IdentityPanel/steps/DeviceManager.js.map +0 -1
- 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/components/IdentityList/DeviceList.tsx +0 -49
- package/src/panels/IdentityPanel/steps/AgentForm.tsx +0 -61
- package/src/panels/IdentityPanel/steps/DeviceManager.tsx +0 -41
- package/src/panels/IdentityPanel/steps/SignOutChooser.tsx +0 -84
- package/src/panels/JoinPanel/steps/ResetIdentity.tsx +0 -80
|
@@ -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 {
|
|
@@ -19,7 +19,7 @@ import { type Client, AlreadyJoinedError } from '@dxos/react-client';
|
|
|
19
19
|
import { type Identity } from '@dxos/react-client/halo';
|
|
20
20
|
import { type AuthenticatingInvitationObservable, Invitation, InvitationEncoder } from '@dxos/react-client/invitations';
|
|
21
21
|
|
|
22
|
-
import { type JoinPanelMode } from './JoinPanelProps';
|
|
22
|
+
import { type JoinPanelInitialDisposition, type JoinPanelMode } from './JoinPanelProps';
|
|
23
23
|
import { type FailReason } from '../../types';
|
|
24
24
|
|
|
25
25
|
type InvitationKindContext = Partial<{
|
|
@@ -33,6 +33,7 @@ type InvitationKindContext = Partial<{
|
|
|
33
33
|
|
|
34
34
|
type JoinMachineContext = {
|
|
35
35
|
mode: JoinPanelMode;
|
|
36
|
+
initialDisposition: JoinPanelInitialDisposition;
|
|
36
37
|
identity: Identity | null;
|
|
37
38
|
halo: InvitationKindContext;
|
|
38
39
|
space: InvitationKindContext;
|
|
@@ -74,7 +75,8 @@ type EmptyInvitationEvent = {
|
|
|
74
75
|
| 'authenticateHaloVerificationCode'
|
|
75
76
|
| 'authenticateSpaceVerificationCode'
|
|
76
77
|
| 'resetHaloInvitation'
|
|
77
|
-
| 'resetSpaceInvitation'
|
|
78
|
+
| 'resetSpaceInvitation'
|
|
79
|
+
| 'deselectInvitation';
|
|
78
80
|
};
|
|
79
81
|
|
|
80
82
|
type InvitationEvent = FailInvitationEvent | SetInvitationCodeEvent | SetInvitationEvent | EmptyInvitationEvent;
|
|
@@ -294,6 +296,7 @@ const joinMachine = createMachine<JoinMachineContext, JoinEvent>(
|
|
|
294
296
|
id: 'join',
|
|
295
297
|
predictableActionArguments: true,
|
|
296
298
|
context: {
|
|
299
|
+
initialDisposition: 'default',
|
|
297
300
|
mode: 'default',
|
|
298
301
|
identity: null,
|
|
299
302
|
halo: {},
|
|
@@ -304,6 +307,11 @@ const joinMachine = createMachine<JoinMachineContext, JoinEvent>(
|
|
|
304
307
|
unknown: {
|
|
305
308
|
always: [
|
|
306
309
|
{ cond: 'existingIdentity', target: 'resettingIdentity', actions: 'log' },
|
|
310
|
+
{
|
|
311
|
+
cond: 'initiallyAcceptingHaloInvitation',
|
|
312
|
+
target: '#join.choosingIdentity.acceptingHaloInvitation',
|
|
313
|
+
actions: 'log',
|
|
314
|
+
},
|
|
307
315
|
{ cond: 'noSelectedIdentity', target: 'choosingIdentity', actions: 'log' },
|
|
308
316
|
{ target: 'acceptingSpaceInvitation', actions: 'log' },
|
|
309
317
|
],
|
|
@@ -352,6 +360,8 @@ const joinMachine = createMachine<JoinMachineContext, JoinEvent>(
|
|
|
352
360
|
guards: {
|
|
353
361
|
existingIdentity: ({ identity, mode }, _event) => mode === 'halo-only' && !!identity,
|
|
354
362
|
noSelectedIdentity: ({ identity }, _event) => !identity,
|
|
363
|
+
initiallyAcceptingHaloInvitation: ({ identity, initialDisposition }, _event) =>
|
|
364
|
+
!identity && initialDisposition === 'accept-halo-invitation',
|
|
355
365
|
hasHaloUnredeemedCode: ({ halo }, _event) => !!halo.unredeemedCode,
|
|
356
366
|
noSpaceInvitation: ({ space }, _event) => !space.invitation && !space.unredeemedCode,
|
|
357
367
|
},
|
|
@@ -59,6 +59,7 @@ export const SpaceManager = (props: SpaceManagerProps) => {
|
|
|
59
59
|
const invitation = space.share?.({
|
|
60
60
|
type: Invitation.Type.INTERACTIVE,
|
|
61
61
|
authMethod: Invitation.AuthMethod.SHARED_SECRET,
|
|
62
|
+
multiUse: false,
|
|
62
63
|
target,
|
|
63
64
|
});
|
|
64
65
|
if (invitation && config.values.runtime?.app?.env?.DX_ENVIRONMENT !== 'production') {
|
|
@@ -72,8 +73,9 @@ export const SpaceManager = (props: SpaceManagerProps) => {
|
|
|
72
73
|
icon: UsersThree,
|
|
73
74
|
onClick: useCallback(() => {
|
|
74
75
|
const invitation = space.share?.({
|
|
75
|
-
type: Invitation.Type.
|
|
76
|
+
type: Invitation.Type.INTERACTIVE,
|
|
76
77
|
authMethod: Invitation.AuthMethod.NONE,
|
|
78
|
+
multiUse: true,
|
|
77
79
|
target,
|
|
78
80
|
});
|
|
79
81
|
if (invitation && config.values.runtime?.app?.env?.DX_ENVIRONMENT !== 'production') {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { Status, useTranslation } from '@dxos/react-ui';
|
|
8
|
+
|
|
9
|
+
export const StatusPanel = ({ titleId }: { titleId?: string }) => {
|
|
10
|
+
const { t } = useTranslation('os');
|
|
11
|
+
return (
|
|
12
|
+
<div className='grid place-items-center p-2 gap-2'>
|
|
13
|
+
<p id={titleId} className='font-medium text-center'>
|
|
14
|
+
{t('resetting message')}
|
|
15
|
+
</p>
|
|
16
|
+
<Status indeterminate>{t('resetting message')}</Status>
|
|
17
|
+
</div>
|
|
18
|
+
);
|
|
19
|
+
};
|
package/src/panels/index.ts
CHANGED
|
@@ -15,7 +15,9 @@ test.describe('Invitations', () => {
|
|
|
15
15
|
let manager: InvitationsManager;
|
|
16
16
|
|
|
17
17
|
// TODO(wittjosiah): Storybook takes a bit to be ready for testing against.
|
|
18
|
-
test.beforeAll(async ({ browser }) => {
|
|
18
|
+
test.beforeAll(async ({ browser, browserName }) => {
|
|
19
|
+
// TODO(wittjosiah): Storybook is broken in Safari/Webkit.
|
|
20
|
+
test.skip(browserName === 'webkit');
|
|
19
21
|
test.setTimeout(60_000);
|
|
20
22
|
manager = new InvitationsManager(browser);
|
|
21
23
|
await manager.init();
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Warning } from '@phosphor-icons/react';
|
|
6
|
+
import React, { useState } from 'react';
|
|
7
|
+
|
|
8
|
+
import { log } from '@dxos/log';
|
|
9
|
+
import { Message, useTranslation } from '@dxos/react-ui';
|
|
10
|
+
import { getSize, mx } from '@dxos/react-ui-theme';
|
|
11
|
+
|
|
12
|
+
import { type StepProps } from './StepProps';
|
|
13
|
+
import { Action, Actions, StepHeading, Input } from '../components';
|
|
14
|
+
|
|
15
|
+
type ConfirmResetOptions = Partial<{
|
|
16
|
+
onCancel: () => void;
|
|
17
|
+
onConfirm: () => Promise<void>;
|
|
18
|
+
mode: 'join new identity' | 'reset storage';
|
|
19
|
+
}>;
|
|
20
|
+
|
|
21
|
+
export type ConfirmResetProps = StepProps & ConfirmResetOptions;
|
|
22
|
+
|
|
23
|
+
export type ConfirmResetImplProps = ConfirmResetOptions & {
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
pending?: boolean;
|
|
26
|
+
validationMessage?: string;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const ConfirmReset = ({ active, onCancel, onConfirm, mode }: ConfirmResetProps) => {
|
|
30
|
+
const { t } = useTranslation('os');
|
|
31
|
+
const [validationMessage, setValidationMessage] = useState('');
|
|
32
|
+
const [pending, setPending] = useState(false);
|
|
33
|
+
const processReset = async () => {
|
|
34
|
+
setPending(true);
|
|
35
|
+
return onConfirm?.().then(
|
|
36
|
+
() => setPending(false),
|
|
37
|
+
(error) => {
|
|
38
|
+
log.catch(error);
|
|
39
|
+
setValidationMessage(t('failed to reset identity message'));
|
|
40
|
+
setPending(false);
|
|
41
|
+
},
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
return (
|
|
45
|
+
<ConfirmResetImpl
|
|
46
|
+
disabled={!active}
|
|
47
|
+
pending={pending}
|
|
48
|
+
validationMessage={validationMessage}
|
|
49
|
+
onConfirm={processReset}
|
|
50
|
+
onCancel={onCancel}
|
|
51
|
+
mode={mode}
|
|
52
|
+
/>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const ConfirmResetImpl = ({
|
|
57
|
+
disabled,
|
|
58
|
+
pending,
|
|
59
|
+
validationMessage,
|
|
60
|
+
onConfirm,
|
|
61
|
+
onCancel,
|
|
62
|
+
mode,
|
|
63
|
+
}: ConfirmResetImplProps) => {
|
|
64
|
+
const { t } = useTranslation('os');
|
|
65
|
+
const confirmationValue = t('confirmation value');
|
|
66
|
+
const [inputValue, setInputValue] = useState('');
|
|
67
|
+
const testIdAffix = mode === 'join new identity' ? 'join-new-identity' : 'reset-storage';
|
|
68
|
+
return (
|
|
69
|
+
<>
|
|
70
|
+
<div role='none' className='grow flex flex-col gap-2 justify-center'>
|
|
71
|
+
<Message.Root valence='error'>
|
|
72
|
+
<Message.Title>
|
|
73
|
+
<Warning className={mx(getSize(6), 'inline mie-2')} />
|
|
74
|
+
{t('sign out chooser title')}
|
|
75
|
+
</Message.Title>
|
|
76
|
+
<Message.Body>{t('sign out chooser message')}</Message.Body>
|
|
77
|
+
</Message.Root>
|
|
78
|
+
<Input
|
|
79
|
+
{...{ validationMessage }}
|
|
80
|
+
label={
|
|
81
|
+
<StepHeading className='text-start mlb-2'>
|
|
82
|
+
{t(mode === 'join new identity' ? 'join new identity input label' : 'reset storage input label', {
|
|
83
|
+
confirmationValue,
|
|
84
|
+
})}
|
|
85
|
+
</StepHeading>
|
|
86
|
+
}
|
|
87
|
+
disabled={disabled}
|
|
88
|
+
data-testid={`${testIdAffix}.reset-identity-input`}
|
|
89
|
+
placeholder={confirmationValue}
|
|
90
|
+
onChange={({ target: { value } }) => setInputValue(value)}
|
|
91
|
+
/>
|
|
92
|
+
</div>
|
|
93
|
+
<Actions>
|
|
94
|
+
{onCancel && (
|
|
95
|
+
<Action disabled={disabled} onClick={onCancel} data-testid={`${testIdAffix}.reset-identity-cancel`}>
|
|
96
|
+
{t('cancel label')}
|
|
97
|
+
</Action>
|
|
98
|
+
)}
|
|
99
|
+
{onConfirm && (
|
|
100
|
+
<Action
|
|
101
|
+
variant='destructive'
|
|
102
|
+
disabled={disabled || pending || inputValue !== confirmationValue}
|
|
103
|
+
onClick={onConfirm}
|
|
104
|
+
data-testid={`${testIdAffix}.reset-identity-confirm`}
|
|
105
|
+
>
|
|
106
|
+
{pending ? t('reset in progress label') : t('reset device label')}
|
|
107
|
+
</Action>
|
|
108
|
+
)}
|
|
109
|
+
</Actions>
|
|
110
|
+
</>
|
|
111
|
+
);
|
|
112
|
+
};
|
|
@@ -6,7 +6,7 @@ import { Check, X } from '@phosphor-icons/react';
|
|
|
6
6
|
import React, { useMemo } from 'react';
|
|
7
7
|
import { QR } from 'react-qr-rounded';
|
|
8
8
|
|
|
9
|
-
import { type InvitationStatus
|
|
9
|
+
import { type InvitationStatus } from '@dxos/react-client/invitations';
|
|
10
10
|
import { useId, useTranslation } from '@dxos/react-ui';
|
|
11
11
|
import { descriptionText, getSize, mx } from '@dxos/react-ui-theme';
|
|
12
12
|
import { hexToEmoji } from '@dxos/util';
|
|
@@ -43,13 +43,13 @@ export const InvitationManager = ({
|
|
|
43
43
|
active,
|
|
44
44
|
send,
|
|
45
45
|
status,
|
|
46
|
-
|
|
46
|
+
multiUse,
|
|
47
47
|
authCode,
|
|
48
48
|
id = '0',
|
|
49
49
|
}: InvitationManagerProps) => {
|
|
50
50
|
const { t } = useTranslation('os');
|
|
51
51
|
const qrLabel = useId('invitation-manager__qr-code');
|
|
52
|
-
const statusValue =
|
|
52
|
+
const statusValue = multiUse ? 0 : invitationStatusValue.get(status!) ?? 0;
|
|
53
53
|
const showAuthCode = statusValue === 3;
|
|
54
54
|
const emoji = hexToEmoji(id);
|
|
55
55
|
const activeView = useMemo(() => {
|
|
@@ -69,7 +69,7 @@ export const InvitationManager = ({
|
|
|
69
69
|
<Viewport.Views>
|
|
70
70
|
<InvitationManagerView id='showing qr' emoji={emoji}>
|
|
71
71
|
<p className='text-sm mlb-1 font-normal text-center'>
|
|
72
|
-
{t(
|
|
72
|
+
{t(multiUse ? 'invite many qr label' : 'invite one qr label')}
|
|
73
73
|
</p>
|
|
74
74
|
<div role='none' className={mx(descriptionText, 'is-full max-is-[14rem] relative')}>
|
|
75
75
|
<QR
|
package/src/steps/StepProps.ts
CHANGED
|
@@ -6,8 +6,9 @@ import { type cloneElement } from 'react';
|
|
|
6
6
|
import { type Event, type SingleOrArray } from 'xstate';
|
|
7
7
|
|
|
8
8
|
type StepDeselectInvitationEvent = { type: 'deselectInvitation' };
|
|
9
|
+
type StepResetIdentityEvent = { type: 'resetIdentity' };
|
|
9
10
|
|
|
10
|
-
export type StepEvent = StepDeselectInvitationEvent;
|
|
11
|
+
export type StepEvent = StepDeselectInvitationEvent | StepResetIdentityEvent;
|
|
11
12
|
|
|
12
13
|
export type StepProps = {
|
|
13
14
|
active?: boolean;
|
package/src/steps/index.ts
CHANGED
|
@@ -10,7 +10,7 @@ import React, { useMemo, useState } from 'react';
|
|
|
10
10
|
import { log } from '@dxos/log';
|
|
11
11
|
import { faker } from '@dxos/random';
|
|
12
12
|
import { useClient } from '@dxos/react-client';
|
|
13
|
-
import { type Space, type SpaceMember,
|
|
13
|
+
import { type Space, type SpaceMember, useSpaces } from '@dxos/react-client/echo';
|
|
14
14
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
15
15
|
import { Invitation, InvitationEncoder } from '@dxos/react-client/invitations';
|
|
16
16
|
import { ConnectionState, useNetworkStatus } from '@dxos/react-client/mesh';
|
|
@@ -36,7 +36,7 @@ const Panel = ({ id, panel, setPanel }: { id: number; panel?: PanelType; setPane
|
|
|
36
36
|
const spaces = useSpaces();
|
|
37
37
|
|
|
38
38
|
useMemo(() => {
|
|
39
|
-
if (panel
|
|
39
|
+
if (panel && typeof panel !== 'string') {
|
|
40
40
|
(window as any)[`peer${id}CreateSpaceInvitation`] = (options?: Partial<Invitation>) => {
|
|
41
41
|
const invitation = panel.share(options);
|
|
42
42
|
|
|
@@ -50,7 +50,7 @@ const Panel = ({ id, panel, setPanel }: { id: number; panel?: PanelType; setPane
|
|
|
50
50
|
}
|
|
51
51
|
}, [panel]);
|
|
52
52
|
|
|
53
|
-
if (panel
|
|
53
|
+
if (panel && typeof panel !== 'string') {
|
|
54
54
|
return <SpacePanel space={panel} createInvitationUrl={createInvitationUrl} />;
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -216,6 +216,9 @@ const Invitations = (args: { id: number; count: number }) => {
|
|
|
216
216
|
);
|
|
217
217
|
};
|
|
218
218
|
|
|
219
|
+
// TODO(wittjosiah): This story fails to start in Safari/Webkit.
|
|
220
|
+
// The issue appears to be related to dynamic imports during client initialization.
|
|
221
|
+
// This does not seem to be a problem in other browsers nor in Safari in the app.
|
|
219
222
|
export const Default = {
|
|
220
223
|
render: (args: { id: number }) => (
|
|
221
224
|
<ClipboardProvider>
|
|
@@ -65,17 +65,17 @@ export class ShellManager extends ScopedShellManager {
|
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
this.page.on('dialog', handleDialog);
|
|
68
|
-
await this.shell.getByTestId('
|
|
69
|
-
await this.shell.getByTestId('
|
|
70
|
-
this.
|
|
68
|
+
await this.shell.getByTestId('device-list-item-current.options').click();
|
|
69
|
+
await this.shell.getByTestId('device-list-item-current.reset').click();
|
|
70
|
+
await this.shell.getByTestId('reset-storage.reset-identity-input').fill('CONFIRM');
|
|
71
|
+
await this.shell.getByTestId('reset-storage.reset-identity-confirm').click();
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
async joinNewIdentity(invitationCode: string) {
|
|
74
|
-
await this.shell.getByTestId('
|
|
75
|
-
await this.shell.getByTestId('
|
|
76
|
-
await this.shell.getByTestId('reset-identity-input').fill('CONFIRM');
|
|
77
|
-
await this.shell.getByTestId('reset-identity-
|
|
78
|
-
await this.shell.getByTestId('identity-chooser.join-identity').click();
|
|
75
|
+
await this.shell.getByTestId('device-list-item-current.options').click();
|
|
76
|
+
await this.shell.getByTestId('device-list-item-current.join-existing').click();
|
|
77
|
+
await this.shell.getByTestId('join-new-identity.reset-identity-input').fill('CONFIRM');
|
|
78
|
+
await this.shell.getByTestId('join-new-identity.reset-identity-confirm').click();
|
|
79
79
|
await this.inputInvitation('device', invitationCode, this.shell);
|
|
80
80
|
}
|
|
81
81
|
|
|
@@ -117,7 +117,8 @@ export class ShellManager extends ScopedShellManager {
|
|
|
117
117
|
|
|
118
118
|
private async _onConsoleMessage(message: ConsoleMessage) {
|
|
119
119
|
try {
|
|
120
|
-
const
|
|
120
|
+
const text = message.text();
|
|
121
|
+
const json = JSON.parse(text.slice(text.indexOf('{')));
|
|
121
122
|
if (json.invitationCode) {
|
|
122
123
|
this._invitationCode.wake(json.invitationCode);
|
|
123
124
|
}
|
|
@@ -45,8 +45,6 @@ export const os = {
|
|
|
45
45
|
'connected status label': 'Enter confirmation PIN',
|
|
46
46
|
'authenticating status label': 'Enter confirmation PIN',
|
|
47
47
|
'success status label': 'Success',
|
|
48
|
-
'connect label': 'Connect',
|
|
49
|
-
'reconnect label': 'Reconnect',
|
|
50
48
|
'cancel label': 'Cancel',
|
|
51
49
|
'done label': 'Done',
|
|
52
50
|
'reset label': 'Start over',
|
|
@@ -73,7 +71,8 @@ export const os = {
|
|
|
73
71
|
'choose add device label': 'Add device',
|
|
74
72
|
'choose devices label': 'Manage devices',
|
|
75
73
|
'choose profile label': 'Edit profile',
|
|
76
|
-
'choose sign out label': '
|
|
74
|
+
'choose sign out label': 'Reset storage',
|
|
75
|
+
'choose join new identity label': 'Join existing device',
|
|
77
76
|
'empty space members message': 'There is nobody in this space yet.',
|
|
78
77
|
'back to all invitations label': 'Back to all invitations',
|
|
79
78
|
'invitation heading': 'Invitation',
|
|
@@ -97,19 +96,22 @@ export const os = {
|
|
|
97
96
|
'invite options label': 'Change the active invite option.',
|
|
98
97
|
'reset in progress label': 'Resetting...',
|
|
99
98
|
'confirm label': 'Confirm',
|
|
100
|
-
'reset
|
|
99
|
+
'reset storage input label':
|
|
101
100
|
'This will clear this device and all associated data. Type {{confirmationValue}} and confirm to continue.',
|
|
101
|
+
'join new identity input label':
|
|
102
|
+
'In order to join an existing device, storage on this device must be cleared first. Type {{confirmationValue}} to continue.',
|
|
102
103
|
'failed to reset identity message': 'Failed to reset identity.',
|
|
103
104
|
'confirmation value': 'CONFIRM',
|
|
104
|
-
'sign out chooser title': '
|
|
105
|
-
'sign out chooser message': 'Proceeding with
|
|
105
|
+
'sign out chooser title': 'Danger zone',
|
|
106
|
+
'sign out chooser message': 'Proceeding with the action below will erase all data on this device.',
|
|
106
107
|
'join new identity label': 'Join a new identity',
|
|
107
|
-
'reset device label': 'Reset
|
|
108
|
+
'reset device label': 'Reset storage',
|
|
108
109
|
'reset device confirm message': 'Are you sure you want to reset your device? All data will be lost.',
|
|
109
110
|
'emoji and color label': 'Emoji and color',
|
|
110
111
|
'clear label': 'Use default',
|
|
111
112
|
'select emoji label': 'Choose an emoji to use in your avatar',
|
|
112
113
|
'select hue label': 'Choose a hue to use in your avatar',
|
|
114
|
+
'resetting message': 'One moment while things are reset…',
|
|
113
115
|
'red label': 'Red',
|
|
114
116
|
'orange label': 'Orange',
|
|
115
117
|
'amber label': 'Amber',
|
|
@@ -127,4 +129,17 @@ export const os = {
|
|
|
127
129
|
'fuchsia label': 'Fuchsia',
|
|
128
130
|
'pink label': 'Pink',
|
|
129
131
|
'rose label': 'Rose',
|
|
132
|
+
'current device tag label': 'This device',
|
|
133
|
+
'device name placeholder': '{{platform}} on {{os}}',
|
|
134
|
+
'more options label': 'More options',
|
|
135
|
+
'disconnect label': 'Currently online. Click to go offline.',
|
|
136
|
+
'connect label': 'Currently offline. Click to go online.',
|
|
137
|
+
'edit device label': 'Edit device name & avatar',
|
|
138
|
+
'agent heading': 'Agent',
|
|
139
|
+
'agent message title': 'About creating an agent',
|
|
140
|
+
'agent message body':
|
|
141
|
+
'Creating an agent helps keep your devices and peers in-sync. An agent is like any other device, but since it’s always online your changes will sync even when all your physical devices are asleep.',
|
|
142
|
+
'create agent label': 'Start an agent',
|
|
143
|
+
'destroy agent label': 'Shut down agent',
|
|
144
|
+
'agent device label': 'Your agent',
|
|
130
145
|
};
|
package/src/types/index.ts
CHANGED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type Device } from '@dxos/react-client/halo';
|
|
2
|
-
export interface DeviceListProps {
|
|
3
|
-
devices: Device[];
|
|
4
|
-
onSelect?: (device: Device) => void;
|
|
5
|
-
}
|
|
6
|
-
export declare const DeviceList: ({ devices, onSelect }: DeviceListProps) => JSX.Element;
|
|
7
|
-
//# sourceMappingURL=DeviceList.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceList.d.ts","sourceRoot":"","sources":["../../../../../src/components/IdentityList/DeviceList.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,MAAM,EAAc,MAAM,yBAAyB,CAAC;AAMlE,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;AAED,eAAO,MAAM,UAAU,0BAA2B,eAAe,gBA8BhE,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
//
|
|
3
|
-
// Copyright 2023 DXOS.org
|
|
4
|
-
//
|
|
5
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.DeviceList = void 0;
|
|
10
|
-
const react_1 = __importDefault(require("react"));
|
|
11
|
-
const display_name_1 = require("@dxos/display-name");
|
|
12
|
-
const halo_1 = require("@dxos/react-client/halo");
|
|
13
|
-
const react_ui_1 = require("@dxos/react-ui");
|
|
14
|
-
const react_ui_theme_1 = require("@dxos/react-ui-theme");
|
|
15
|
-
const IdentityListItem_1 = require("./IdentityListItem");
|
|
16
|
-
const DeviceList = ({ devices, onSelect }) => {
|
|
17
|
-
const { t } = (0, react_ui_1.useTranslation)('os');
|
|
18
|
-
return devices.length > 0 ? (react_1.default.createElement(react_ui_1.List, { classNames: 'flex flex-col gap-2' }, devices.map((device) => {
|
|
19
|
-
var _a, _b;
|
|
20
|
-
// TODO(wittjosiah): Render this better. Consider communicating these as apps rather than devices.
|
|
21
|
-
const deviceType = ((_a = device.profile) === null || _a === void 0 ? void 0 : _a.type) || halo_1.DeviceType.UNKNOWN;
|
|
22
|
-
const displayName = ((_b = device.profile) === null || _b === void 0 ? void 0 : _b.label)
|
|
23
|
-
? `${device.profile.label} (${halo_1.DeviceType[deviceType]})`
|
|
24
|
-
: (0, display_name_1.generateName)(device.deviceKey.toHex());
|
|
25
|
-
const identity = {
|
|
26
|
-
identityKey: device.deviceKey,
|
|
27
|
-
profile: { displayName },
|
|
28
|
-
};
|
|
29
|
-
return (react_1.default.createElement(IdentityListItem_1.IdentityListItem, { key: device.deviceKey.toHex(), identity: identity, presence: device.presence, onClick: onSelect && (() => onSelect(device)) }));
|
|
30
|
-
}))) : (react_1.default.createElement("div", { role: 'none', className: 'grow flex items-center p-2' },
|
|
31
|
-
react_1.default.createElement("p", { className: (0, react_ui_theme_1.mx)(react_ui_theme_1.descriptionText, 'text-center is-full') }, t('empty device list message'))));
|
|
32
|
-
};
|
|
33
|
-
exports.DeviceList = DeviceList;
|
|
34
|
-
//# sourceMappingURL=DeviceList.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceList.js","sourceRoot":"","sources":["../../../../../src/components/IdentityList/DeviceList.tsx"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,kDAA0B;AAE1B,qDAAkD;AAClD,kDAAkE;AAClE,6CAAsD;AACtD,yDAA2D;AAE3D,yDAAsD;AAO/C,MAAM,UAAU,GAAG,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAmB,EAAE,EAAE;IACnE,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,yBAAc,EAAC,IAAI,CAAC,CAAC;IACnC,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAC1B,8BAAC,eAAI,IAAC,UAAU,EAAC,qBAAqB,IACnC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;;QACtB,kGAAkG;QAClG,MAAM,UAAU,GAAG,CAAA,MAAA,MAAM,CAAC,OAAO,0CAAE,IAAI,KAAI,iBAAU,CAAC,OAAO,CAAC;QAC9D,MAAM,WAAW,GAAG,CAAA,MAAA,MAAM,CAAC,OAAO,0CAAE,KAAK;YACvC,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,KAAK,iBAAU,CAAC,UAAU,CAAC,GAAG;YACvD,CAAC,CAAC,IAAA,2BAAY,EAAC,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC;QAE3C,MAAM,QAAQ,GAAG;YACf,WAAW,EAAE,MAAM,CAAC,SAAS;YAC7B,OAAO,EAAE,EAAE,WAAW,EAAE;SACzB,CAAC;QACF,OAAO,CACL,8BAAC,mCAAgB,IACf,GAAG,EAAE,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,EAC7B,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,OAAO,EAAE,QAAQ,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,GAC7C,CACH,CAAC;IACJ,CAAC,CAAC,CACG,CACR,CAAC,CAAC,CAAC,CACF,uCAAK,IAAI,EAAC,MAAM,EAAC,SAAS,EAAC,4BAA4B;QACrD,qCAAG,SAAS,EAAE,IAAA,mBAAE,EAAC,gCAAe,EAAE,qBAAqB,CAAC,IAAG,CAAC,CAAC,2BAA2B,CAAC,CAAK,CAC1F,CACP,CAAC;AACJ,CAAC,CAAC;AA9BW,QAAA,UAAU,cA8BrB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AgentForm.d.ts","sourceRoot":"","sources":["../../../../../../src/panels/IdentityPanel/steps/AgentForm.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAEzF,eAAO,MAAM,SAAS,UAAW,sBAAsB,GAAG,cAAc,gBAiDvE,CAAC"}
|