@dxos/shell 0.4.10-main.cd13a57 → 0.4.10-main.d2a7fe7
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 +8269 -8202
- 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 +418 -328
- package/dist/lib/browser/react.mjs.map +4 -4
- package/dist/lib/browser/testing/index.mjs +5 -7
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- 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 +71 -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/testing/shell-manager.d.ts.map +1 -1
- package/dist/types/src/testing/shell-manager.js +5 -7
- package/dist/types/src/testing/shell-manager.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 +112 -0
- package/src/steps/StepProps.ts +2 -1
- package/src/steps/index.ts +1 -0
- package/src/testing/shell-manager.ts +5 -7
- 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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ResetIdentity.js","sourceRoot":"","sources":["../../../../../../src/panels/JoinPanel/steps/ResetIdentity.tsx"],"names":[],"mappings":";AAAA,EAA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
|
-
import React from 'react';
|
|
7
|
-
import { type Event, type SingleOrArray } from 'xstate';
|
|
8
|
-
|
|
9
|
-
import { Message, useTranslation } from '@dxos/react-ui';
|
|
10
|
-
import { getSize, mx } from '@dxos/react-ui-theme';
|
|
11
|
-
|
|
12
|
-
import { Action, Actions } from '../../../components';
|
|
13
|
-
import { type IdentityPanelStepProps } from '../IdentityPanelProps';
|
|
14
|
-
import { type IdentityEvent } from '../identityMachine';
|
|
15
|
-
|
|
16
|
-
export interface SignOutChooserProps extends Omit<IdentityPanelStepProps, 'send'> {
|
|
17
|
-
send?: (event: SingleOrArray<Event<IdentityEvent>>) => void;
|
|
18
|
-
onResetDevice?: () => Promise<void>;
|
|
19
|
-
onJoinNewIdentity?: () => void;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export const SignOutChooser = (props: SignOutChooserProps) => {
|
|
23
|
-
const { t } = useTranslation('os');
|
|
24
|
-
const onResetDevice = () => {
|
|
25
|
-
if (window.confirm(t('reset device confirm message'))) {
|
|
26
|
-
void props.onResetDevice?.();
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
return (
|
|
30
|
-
<SignOutChooserImpl
|
|
31
|
-
disabled={!props.active}
|
|
32
|
-
onBack={() => props.send?.({ type: 'unchooseAction' })}
|
|
33
|
-
onResetDevice={onResetDevice}
|
|
34
|
-
onJoinNewIdentity={props.onJoinNewIdentity}
|
|
35
|
-
/>
|
|
36
|
-
);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export type SignOutChooserImplProps = {
|
|
40
|
-
disabled?: boolean;
|
|
41
|
-
onResetDevice?: () => void;
|
|
42
|
-
onJoinNewIdentity?: () => void;
|
|
43
|
-
onBack?: () => void;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
const SignOutChooserImpl = ({ disabled, onResetDevice, onJoinNewIdentity, onBack }: SignOutChooserImplProps) => {
|
|
47
|
-
const { t } = useTranslation('os');
|
|
48
|
-
return (
|
|
49
|
-
<>
|
|
50
|
-
<div role='none' className='grow flex flex-col justify-center'>
|
|
51
|
-
<Message.Root valence='error'>
|
|
52
|
-
<Message.Title>
|
|
53
|
-
<Warning className={mx(getSize(6), 'inline mie-2')} />
|
|
54
|
-
{t('sign out chooser title')}
|
|
55
|
-
</Message.Title>
|
|
56
|
-
<Message.Body>{t('sign out chooser message')}</Message.Body>
|
|
57
|
-
</Message.Root>
|
|
58
|
-
</div>
|
|
59
|
-
<Actions>
|
|
60
|
-
<Action disabled={disabled} onClick={onBack}>
|
|
61
|
-
{t('back label')}
|
|
62
|
-
</Action>
|
|
63
|
-
<Action
|
|
64
|
-
variant='primary'
|
|
65
|
-
data-testid='sign-out.join-new-identity'
|
|
66
|
-
classNames='!bg-error-500 hover:!bg-error-550'
|
|
67
|
-
disabled={disabled}
|
|
68
|
-
onClick={onJoinNewIdentity}
|
|
69
|
-
>
|
|
70
|
-
{t('join new identity label')}
|
|
71
|
-
</Action>
|
|
72
|
-
<Action
|
|
73
|
-
variant='primary'
|
|
74
|
-
data-testid='sign-out.reset-device'
|
|
75
|
-
classNames='!bg-error-500 hover:!bg-error-550'
|
|
76
|
-
disabled={disabled}
|
|
77
|
-
onClick={onResetDevice}
|
|
78
|
-
>
|
|
79
|
-
{t('reset device label')}
|
|
80
|
-
</Action>
|
|
81
|
-
</Actions>
|
|
82
|
-
</>
|
|
83
|
-
);
|
|
84
|
-
};
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { useState } from 'react';
|
|
6
|
-
|
|
7
|
-
import { log } from '@dxos/log';
|
|
8
|
-
import { useClient } from '@dxos/react-client';
|
|
9
|
-
import { useTranslation } from '@dxos/react-ui';
|
|
10
|
-
|
|
11
|
-
import { Action, Actions, StepHeading, Input } from '../../../components';
|
|
12
|
-
import { type JoinStepProps } from '../JoinPanelProps';
|
|
13
|
-
|
|
14
|
-
export type ResetIdentityProps = JoinStepProps & {
|
|
15
|
-
method: 'reset identity';
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export type ResetIdentityImplProps = {
|
|
19
|
-
disabled?: boolean;
|
|
20
|
-
pending?: boolean;
|
|
21
|
-
validationMessage?: string;
|
|
22
|
-
onConfirm?: () => void;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const ResetIdentity = ({ send, active }: ResetIdentityProps) => {
|
|
26
|
-
const client = useClient();
|
|
27
|
-
const { t } = useTranslation('os');
|
|
28
|
-
const [validationMessage, setValidationMessage] = useState('');
|
|
29
|
-
const [pending, setPending] = useState(false);
|
|
30
|
-
const resetIdentity = () => {
|
|
31
|
-
setPending(true);
|
|
32
|
-
void client.reset().then(
|
|
33
|
-
() => send?.({ type: 'resetIdentity' }),
|
|
34
|
-
(error) => {
|
|
35
|
-
log.catch(error);
|
|
36
|
-
setValidationMessage(t('failed to reset identity message'));
|
|
37
|
-
setPending(false);
|
|
38
|
-
},
|
|
39
|
-
);
|
|
40
|
-
};
|
|
41
|
-
return (
|
|
42
|
-
<ResetIdentityImpl
|
|
43
|
-
disabled={!active}
|
|
44
|
-
pending={pending}
|
|
45
|
-
validationMessage={validationMessage}
|
|
46
|
-
onConfirm={() => resetIdentity()}
|
|
47
|
-
/>
|
|
48
|
-
);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export const ResetIdentityImpl = ({ disabled, pending, validationMessage, onConfirm }: ResetIdentityImplProps) => {
|
|
52
|
-
const { t } = useTranslation('os');
|
|
53
|
-
const confirmationValue = t('confirmation value');
|
|
54
|
-
const [inputValue, setInputValue] = useState('');
|
|
55
|
-
return (
|
|
56
|
-
<>
|
|
57
|
-
<div role='none' className='grow flex flex-col justify-center'>
|
|
58
|
-
<Input
|
|
59
|
-
{...{ validationMessage }}
|
|
60
|
-
label={<StepHeading>{t('reset identity input label', { confirmationValue })}</StepHeading>}
|
|
61
|
-
disabled={disabled}
|
|
62
|
-
data-testid='reset-identity-input'
|
|
63
|
-
placeholder={confirmationValue}
|
|
64
|
-
onChange={({ target: { value } }) => setInputValue(value)}
|
|
65
|
-
/>
|
|
66
|
-
</div>
|
|
67
|
-
<Actions>
|
|
68
|
-
<Action
|
|
69
|
-
// TODO(wittjosiah): Probably make this red?
|
|
70
|
-
variant='primary'
|
|
71
|
-
disabled={disabled || pending || inputValue !== confirmationValue}
|
|
72
|
-
onClick={() => onConfirm?.()}
|
|
73
|
-
data-testid='reset-identity-input-confirm'
|
|
74
|
-
>
|
|
75
|
-
{pending ? t('reset in progress label') : t('confirm label')}
|
|
76
|
-
</Action>
|
|
77
|
-
</Actions>
|
|
78
|
-
</>
|
|
79
|
-
);
|
|
80
|
-
};
|