@dxos/plugin-client 0.8.1-staging.5be625a → 0.8.1-staging.9eaf14f
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/lib/browser/app-graph-builder-WAS4YZNA.mjs +119 -0
- package/dist/lib/browser/app-graph-builder-WAS4YZNA.mjs.map +7 -0
- package/dist/lib/browser/{chunk-VZ5F6WXE.mjs → chunk-AN7FJKIJ.mjs} +20 -3
- package/dist/lib/browser/{chunk-VZ5F6WXE.mjs.map → chunk-AN7FJKIJ.mjs.map} +3 -3
- package/dist/lib/browser/chunk-XZ4TQC56.mjs +619 -0
- package/dist/lib/browser/chunk-XZ4TQC56.mjs.map +7 -0
- package/dist/lib/browser/{client-OE5TVJAO.mjs → client-LV67Q3R7.mjs} +2 -2
- package/dist/lib/browser/{client-OE5TVJAO.mjs.map → client-LV67Q3R7.mjs.map} +3 -3
- package/dist/lib/browser/index.mjs +45 -16
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/{intent-resolver-SC35ILQN.mjs → intent-resolver-NCISOZW4.mjs} +62 -24
- package/dist/lib/browser/intent-resolver-NCISOZW4.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-J7SZR2J6.mjs +66 -0
- package/dist/lib/browser/react-surface-J7SZR2J6.mjs.map +7 -0
- package/dist/lib/browser/types.mjs +3 -1
- package/dist/lib/node/app-graph-builder-PXOJZJO5.cjs +130 -0
- package/dist/lib/node/app-graph-builder-PXOJZJO5.cjs.map +7 -0
- package/dist/lib/node/chunk-3JE5BFCT.cjs +644 -0
- package/dist/lib/node/chunk-3JE5BFCT.cjs.map +7 -0
- package/dist/lib/node/{chunk-2MVZ5CAW.cjs → chunk-FROKBEVH.cjs} +23 -5
- package/dist/lib/node/chunk-FROKBEVH.cjs.map +7 -0
- package/dist/lib/node/{client-4L2EFL2K.cjs → client-BKTGRBYM.cjs} +5 -5
- package/dist/lib/node/{client-4L2EFL2K.cjs.map → client-BKTGRBYM.cjs.map} +3 -3
- package/dist/lib/node/index.cjs +45 -16
- package/dist/lib/node/index.cjs.map +2 -2
- package/dist/lib/node/{intent-resolver-HT7A7YJC.cjs → intent-resolver-U2576ALY.cjs} +72 -35
- package/dist/lib/node/intent-resolver-U2576ALY.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-UW35ICXB.cjs → react-surface-BSTIXMER.cjs} +33 -25
- package/dist/lib/node/react-surface-BSTIXMER.cjs.map +7 -0
- package/dist/lib/node/types.cjs +4 -2
- package/dist/lib/node/types.cjs.map +2 -2
- package/dist/lib/node-esm/app-graph-builder-KIN6NWFI.mjs +120 -0
- package/dist/lib/node-esm/app-graph-builder-KIN6NWFI.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-TBU6HCXG.mjs → chunk-AD5W5QCQ.mjs} +20 -3
- package/dist/lib/node-esm/{chunk-TBU6HCXG.mjs.map → chunk-AD5W5QCQ.mjs.map} +3 -3
- package/dist/lib/node-esm/chunk-LZN2UNN7.mjs +620 -0
- package/dist/lib/node-esm/chunk-LZN2UNN7.mjs.map +7 -0
- package/dist/lib/node-esm/{client-M52MGTIR.mjs → client-QQD6WFOB.mjs} +2 -2
- package/dist/lib/node-esm/{client-M52MGTIR.mjs.map → client-QQD6WFOB.mjs.map} +3 -3
- package/dist/lib/node-esm/index.mjs +45 -16
- package/dist/lib/node-esm/index.mjs.map +2 -2
- package/dist/lib/node-esm/{intent-resolver-JZLW7ZY3.mjs → intent-resolver-G25U4UGI.mjs} +62 -24
- package/dist/lib/node-esm/intent-resolver-G25U4UGI.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-surface-ZPI7T4EM.mjs +67 -0
- package/dist/lib/node-esm/react-surface-ZPI7T4EM.mjs.map +7 -0
- package/dist/lib/node-esm/types.mjs +3 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +4 -4
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +2 -3
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/DevicesContainer.d.ts +5 -0
- package/dist/types/src/components/DevicesContainer.d.ts.map +1 -0
- package/dist/types/src/components/DevicesContainer.stories.d.ts +8 -0
- package/dist/types/src/components/DevicesContainer.stories.d.ts.map +1 -0
- package/dist/types/src/components/ProfileContainer.d.ts +3 -0
- package/dist/types/src/components/ProfileContainer.d.ts.map +1 -0
- package/dist/types/src/components/ProfileContainer.stories.d.ts +8 -0
- package/dist/types/src/components/ProfileContainer.stories.d.ts.map +1 -0
- package/dist/types/src/components/RecoveryCodeDialog.d.ts +1 -1
- package/dist/types/src/components/RecoveryCodeDialog.d.ts.map +1 -1
- package/dist/types/src/components/RecoveryCredentialsContainer.d.ts +4 -0
- package/dist/types/src/components/RecoveryCredentialsContainer.d.ts.map +1 -0
- package/dist/types/src/components/RecoveryCredentialsContainer.stories.d.ts +8 -0
- package/dist/types/src/components/RecoveryCredentialsContainer.stories.d.ts.map +1 -0
- package/dist/types/src/components/ResetDialog.d.ts +7 -0
- package/dist/types/src/components/ResetDialog.d.ts.map +1 -0
- package/dist/types/src/components/ResetDialog.stories.d.ts +10 -0
- package/dist/types/src/components/ResetDialog.stories.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +4 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +28 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +17 -1
- package/dist/types/src/types.d.ts.map +1 -1
- package/package.json +26 -19
- package/src/ClientPlugin.ts +2 -2
- package/src/capabilities/app-graph-builder.ts +62 -6
- package/src/capabilities/client.ts +1 -1
- package/src/capabilities/intent-resolver.ts +68 -23
- package/src/capabilities/react-surface.tsx +32 -24
- package/src/components/DevicesContainer.stories.tsx +45 -0
- package/src/components/DevicesContainer.tsx +270 -0
- package/src/components/ProfileContainer.stories.tsx +29 -0
- package/src/components/ProfileContainer.tsx +163 -0
- package/src/components/RecoveryCodeDialog.stories.tsx +2 -2
- package/src/components/RecoveryCodeDialog.tsx +1 -2
- package/src/components/{ManageCredentialsDialog.stories.tsx → RecoveryCredentialsContainer.stories.tsx} +4 -17
- package/src/components/RecoveryCredentialsContainer.tsx +74 -0
- package/src/components/ResetDialog.stories.tsx +47 -0
- package/src/components/ResetDialog.tsx +49 -0
- package/src/components/index.ts +4 -2
- package/src/translations.ts +45 -9
- package/src/types.ts +20 -1
- package/dist/lib/browser/app-graph-builder-AYO4YOHF.mjs +0 -44
- package/dist/lib/browser/app-graph-builder-AYO4YOHF.mjs.map +0 -7
- package/dist/lib/browser/chunk-RVH34XOH.mjs +0 -281
- package/dist/lib/browser/chunk-RVH34XOH.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-SC35ILQN.mjs.map +0 -7
- package/dist/lib/browser/react-surface-BSCIKZIB.mjs +0 -57
- package/dist/lib/browser/react-surface-BSCIKZIB.mjs.map +0 -7
- package/dist/lib/node/app-graph-builder-LYPDRPML.cjs +0 -58
- package/dist/lib/node/app-graph-builder-LYPDRPML.cjs.map +0 -7
- package/dist/lib/node/chunk-2MVZ5CAW.cjs.map +0 -7
- package/dist/lib/node/chunk-BGAW4D7O.cjs +0 -309
- package/dist/lib/node/chunk-BGAW4D7O.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-HT7A7YJC.cjs.map +0 -7
- package/dist/lib/node/react-surface-UW35ICXB.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-RAWYJUPF.mjs +0 -45
- package/dist/lib/node-esm/app-graph-builder-RAWYJUPF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-IRS6TBYR.mjs +0 -282
- package/dist/lib/node-esm/chunk-IRS6TBYR.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-JZLW7ZY3.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-6TPONAIZ.mjs +0 -58
- package/dist/lib/node-esm/react-surface-6TPONAIZ.mjs.map +0 -7
- package/dist/types/src/components/IdentityDialog.d.ts +0 -5
- package/dist/types/src/components/IdentityDialog.d.ts.map +0 -1
- package/dist/types/src/components/ManageCredentialsDialog.d.ts +0 -4
- package/dist/types/src/components/ManageCredentialsDialog.d.ts.map +0 -1
- package/dist/types/src/components/ManageCredentialsDialog.stories.d.ts +0 -8
- package/dist/types/src/components/ManageCredentialsDialog.stories.d.ts.map +0 -1
- package/dist/types/src/components/RecoverySetupDialog.d.ts +0 -4
- package/dist/types/src/components/RecoverySetupDialog.d.ts.map +0 -1
- package/dist/types/src/components/RecoverySetupDialog.stories.d.ts +0 -8
- package/dist/types/src/components/RecoverySetupDialog.stories.d.ts.map +0 -1
- package/src/components/IdentityDialog.tsx +0 -75
- package/src/components/ManageCredentialsDialog.tsx +0 -64
- package/src/components/RecoverySetupDialog.stories.tsx +0 -77
- package/src/components/RecoverySetupDialog.tsx +0 -52
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Receipt, Key } from '@phosphor-icons/react';
|
|
6
|
-
import React, { useMemo } from 'react';
|
|
7
|
-
|
|
8
|
-
import { createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
9
|
-
import { useCredentials } from '@dxos/react-client/halo';
|
|
10
|
-
import { Dialog, Icon, List, ListItem, useTranslation } from '@dxos/react-ui';
|
|
11
|
-
import { BifurcatedAction, type ActionMenuItem } from '@dxos/shell/react';
|
|
12
|
-
|
|
13
|
-
import { CLIENT_PLUGIN } from '../meta';
|
|
14
|
-
import { ClientAction } from '../types';
|
|
15
|
-
|
|
16
|
-
export const MANAGE_CREDENTIALS_DIALOG = `${CLIENT_PLUGIN}/ManageCredentialsDialog`;
|
|
17
|
-
|
|
18
|
-
// TODO(wittjosiah): Factor panel out to @dxos/shell.
|
|
19
|
-
export const ManageCredentialsDialog = () => {
|
|
20
|
-
const { t } = useTranslation(CLIENT_PLUGIN);
|
|
21
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
22
|
-
const credentials = useCredentials();
|
|
23
|
-
const recoveryCredentials = credentials.filter(
|
|
24
|
-
(credential) => credential.subject.assertion['@type'] === 'dxos.halo.credentials.IdentityRecovery',
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
// TODO(wittjosiah): Reconsile w/ RecoverySetupDialog actions.
|
|
28
|
-
const actions: Record<string, ActionMenuItem> = useMemo(
|
|
29
|
-
() => ({
|
|
30
|
-
createPasskey: {
|
|
31
|
-
label: t('create passkey label'),
|
|
32
|
-
description: t('create passkey description'),
|
|
33
|
-
// TODO(wittjosiah): Ideally this would be a `user-key` icon.
|
|
34
|
-
icon: Key,
|
|
35
|
-
onClick: () => dispatch(createIntent(ClientAction.CreatePasskey)),
|
|
36
|
-
},
|
|
37
|
-
createRecoveryCode: {
|
|
38
|
-
label: t('create recovery code label'),
|
|
39
|
-
description: t('create recovery code description'),
|
|
40
|
-
icon: Receipt,
|
|
41
|
-
onClick: () => dispatch(createIntent(ClientAction.CreateRecoveryCode)),
|
|
42
|
-
},
|
|
43
|
-
}),
|
|
44
|
-
[t],
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
return (
|
|
48
|
-
<Dialog.Content classNames='bs-content min-bs-[15rem] max-bs-full md:max-is-[25rem] overflow-hidden'>
|
|
49
|
-
<Dialog.Title>{t('manage credentials dialog title')}</Dialog.Title>
|
|
50
|
-
<List classNames='py-4'>
|
|
51
|
-
{recoveryCredentials.map((credential) => (
|
|
52
|
-
<ListItem.Root key={credential.id?.toHex()}>
|
|
53
|
-
<ListItem.Endcap>
|
|
54
|
-
<Icon icon='ph--key--regular' size={5} />
|
|
55
|
-
</ListItem.Endcap>
|
|
56
|
-
<ListItem.Heading>{credential.issuanceDate.toLocaleString()}</ListItem.Heading>
|
|
57
|
-
</ListItem.Root>
|
|
58
|
-
))}
|
|
59
|
-
</List>
|
|
60
|
-
<div className='grow' />
|
|
61
|
-
<BifurcatedAction actions={actions} />
|
|
62
|
-
</Dialog.Content>
|
|
63
|
-
);
|
|
64
|
-
};
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
|
-
import { type StoryObj, type Meta } from '@storybook/react';
|
|
8
|
-
import React from 'react';
|
|
9
|
-
|
|
10
|
-
import { createResolver, contributes, Capabilities, IntentPlugin, LayoutAction } from '@dxos/app-framework';
|
|
11
|
-
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
12
|
-
import { S } from '@dxos/echo-schema';
|
|
13
|
-
import { create } from '@dxos/live-object';
|
|
14
|
-
import { AlertDialog } from '@dxos/react-ui';
|
|
15
|
-
import { withTheme, withLayout } from '@dxos/storybook-utils';
|
|
16
|
-
|
|
17
|
-
import { RECOVER_CODE_DIALOG, RecoveryCodeDialog } from './RecoveryCodeDialog';
|
|
18
|
-
import { RecoverySetupDialog } from './RecoverySetupDialog';
|
|
19
|
-
import { ClientPlugin } from '../ClientPlugin';
|
|
20
|
-
import translations from '../translations';
|
|
21
|
-
|
|
22
|
-
const state = create<{ recoveryCode?: string }>({});
|
|
23
|
-
|
|
24
|
-
const Render = () => {
|
|
25
|
-
return (
|
|
26
|
-
<AlertDialog.Root open>
|
|
27
|
-
<AlertDialog.Overlay>
|
|
28
|
-
{state.recoveryCode ? <RecoveryCodeDialog code={state.recoveryCode} /> : <RecoverySetupDialog />}
|
|
29
|
-
</AlertDialog.Overlay>
|
|
30
|
-
</AlertDialog.Root>
|
|
31
|
-
);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const meta: Meta = {
|
|
35
|
-
title: 'plugins/plugin-client/RecoverySetupDialog',
|
|
36
|
-
component: RecoverySetupDialog,
|
|
37
|
-
render: Render,
|
|
38
|
-
decorators: [
|
|
39
|
-
withPluginManager({
|
|
40
|
-
plugins: [
|
|
41
|
-
IntentPlugin(),
|
|
42
|
-
ClientPlugin({
|
|
43
|
-
onClientInitialized: async (_, client) => {
|
|
44
|
-
await client.halo.createIdentity();
|
|
45
|
-
},
|
|
46
|
-
}),
|
|
47
|
-
],
|
|
48
|
-
capabilities: [
|
|
49
|
-
contributes(
|
|
50
|
-
Capabilities.IntentResolver,
|
|
51
|
-
createResolver({
|
|
52
|
-
intent: LayoutAction.UpdateLayout,
|
|
53
|
-
filter: (data): data is S.Schema.Type<typeof LayoutAction.UpdateDialog.fields.input> =>
|
|
54
|
-
S.is(LayoutAction.UpdateDialog.fields.input)(data),
|
|
55
|
-
resolve: (data) => {
|
|
56
|
-
if (data.subject === RECOVER_CODE_DIALOG) {
|
|
57
|
-
state.recoveryCode = data.options?.props?.code;
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
}),
|
|
61
|
-
),
|
|
62
|
-
],
|
|
63
|
-
}),
|
|
64
|
-
withTheme,
|
|
65
|
-
withLayout({ tooltips: true }),
|
|
66
|
-
],
|
|
67
|
-
parameters: {
|
|
68
|
-
layout: 'fullscreen',
|
|
69
|
-
translations,
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export default meta;
|
|
74
|
-
|
|
75
|
-
type Story = StoryObj<typeof RecoverySetupDialog>;
|
|
76
|
-
|
|
77
|
-
export const Default: Story = {};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Key, Receipt } from '@phosphor-icons/react';
|
|
6
|
-
import React, { useMemo } from 'react';
|
|
7
|
-
|
|
8
|
-
import { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';
|
|
9
|
-
import { AlertDialog, useTranslation } from '@dxos/react-ui';
|
|
10
|
-
import { type ActionMenuItem, BifurcatedAction } from '@dxos/shell/react';
|
|
11
|
-
|
|
12
|
-
import { CLIENT_PLUGIN } from '../meta';
|
|
13
|
-
import { ClientAction } from '../types';
|
|
14
|
-
|
|
15
|
-
export const RECOVER_SETUP_DIALOG = `${CLIENT_PLUGIN}/RecoverySetupDialog`;
|
|
16
|
-
|
|
17
|
-
// TODO(wittjosiah): Factor panel out to @dxos/shell.
|
|
18
|
-
export const RecoverySetupDialog = () => {
|
|
19
|
-
const { t } = useTranslation(CLIENT_PLUGIN);
|
|
20
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
21
|
-
|
|
22
|
-
const actions: Record<string, ActionMenuItem> = useMemo(
|
|
23
|
-
() => ({
|
|
24
|
-
createPasskey: {
|
|
25
|
-
label: t('create passkey label'),
|
|
26
|
-
description: t('create passkey description'),
|
|
27
|
-
// TODO(wittjosiah): Ideally this would be a `user-key` icon.
|
|
28
|
-
icon: Key,
|
|
29
|
-
onClick: async () => {
|
|
30
|
-
await dispatch(createIntent(ClientAction.CreatePasskey));
|
|
31
|
-
await dispatch(createIntent(LayoutAction.UpdateDialog, { part: 'dialog', options: { state: false } }));
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
createRecoveryCode: {
|
|
35
|
-
label: t('create recovery code label'),
|
|
36
|
-
description: t('create recovery code description'),
|
|
37
|
-
icon: Receipt,
|
|
38
|
-
onClick: () => dispatch(createIntent(ClientAction.CreateRecoveryCode)),
|
|
39
|
-
},
|
|
40
|
-
}),
|
|
41
|
-
[t],
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
return (
|
|
45
|
-
<AlertDialog.Content classNames='bs-content min-bs-[15rem] max-bs-full md:max-is-[25rem] overflow-hidden'>
|
|
46
|
-
<AlertDialog.Title>{t('recovery setup dialog title')}</AlertDialog.Title>
|
|
47
|
-
<p className='py-4'>{t('recovery setup dialog description')}</p>
|
|
48
|
-
<div className='grow' />
|
|
49
|
-
<BifurcatedAction actions={actions} />
|
|
50
|
-
</AlertDialog.Content>
|
|
51
|
-
);
|
|
52
|
-
};
|