@dxos/plugin-client 0.7.4 → 0.7.5-main.9cb18ac
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/chunk-52IJQ35F.mjs +78 -0
- package/dist/lib/browser/chunk-52IJQ35F.mjs.map +7 -0
- package/dist/lib/browser/chunk-X4QUPYC6.mjs +12 -0
- package/dist/lib/browser/chunk-X4QUPYC6.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +163 -221
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/meta.mjs +1 -5
- package/dist/lib/browser/types.mjs +10 -0
- package/dist/lib/browser/types.mjs.map +7 -0
- package/dist/lib/node/chunk-NFO3ADQC.cjs +98 -0
- package/dist/lib/node/chunk-NFO3ADQC.cjs.map +7 -0
- package/dist/lib/node/chunk-RUA5KXVW.cjs +35 -0
- package/dist/lib/node/chunk-RUA5KXVW.cjs.map +7 -0
- package/dist/lib/node/index.cjs +165 -224
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.cjs +4 -8
- package/dist/lib/node/meta.cjs.map +2 -2
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/types.cjs +32 -0
- package/dist/lib/node/types.cjs.map +7 -0
- package/dist/lib/node-esm/chunk-GMGRQ5Q7.mjs +14 -0
- package/dist/lib/node-esm/chunk-GMGRQ5Q7.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-TI4GNGMM.mjs +79 -0
- package/dist/lib/node-esm/chunk-TI4GNGMM.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +163 -221
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/meta.mjs +1 -5
- package/dist/lib/node-esm/types.mjs +11 -0
- package/dist/lib/node-esm/types.mjs.map +7 -0
- package/dist/types/src/ClientPlugin.d.ts +2 -35
- package/dist/types/src/ClientPlugin.d.ts.map +1 -1
- package/dist/types/src/components/IdentityDialog.d.ts +1 -0
- package/dist/types/src/components/IdentityDialog.d.ts.map +1 -1
- package/dist/types/src/components/JoinDialog.d.ts +1 -0
- package/dist/types/src/components/JoinDialog.d.ts.map +1 -1
- package/dist/types/src/components/RecoveryCodeDialog.d.ts +1 -0
- package/dist/types/src/components/RecoveryCodeDialog.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +0 -10
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +110 -0
- package/dist/types/src/types.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +22 -13
- package/src/ClientPlugin.tsx +111 -200
- package/src/components/IdentityDialog.tsx +13 -11
- package/src/components/JoinDialog.tsx +13 -19
- package/src/components/RecoveryCodeDialog.tsx +3 -1
- package/src/meta.ts +0 -14
- package/src/types.ts +115 -0
- package/dist/lib/browser/chunk-FGUXUNOK.mjs +0 -26
- package/dist/lib/browser/chunk-FGUXUNOK.mjs.map +0 -7
- package/dist/lib/node/chunk-XYLDQWFV.cjs +0 -51
- package/dist/lib/node/chunk-XYLDQWFV.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-C6X363FK.mjs +0 -28
- package/dist/lib/node-esm/chunk-C6X363FK.mjs.map +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/ClientPlugin.tsx", "../../../src/components/IdentityDialog.tsx", "../../../src/components/JoinDialog.tsx", "../../../src/components/RecoveryCodeDialog.tsx", "../../../src/translations.ts", "../../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport {\n LayoutAction,\n parseIntentPlugin,\n resolvePlugin,\n type SurfaceProvides,\n type GraphBuilderProvides,\n type IntentResolverProvides,\n type Plugin,\n type PluginDefinition,\n type TranslationsProvides,\n} from '@dxos/app-framework';\nimport { Config, Defaults, Envs, Local, Storage } from '@dxos/config';\nimport { registerSignalsRuntime } from '@dxos/echo-signals/react';\nimport { invariant } from '@dxos/invariant';\nimport { createExtension, type Node } from '@dxos/plugin-graph';\nimport { Client, type ClientOptions, ClientProvider } from '@dxos/react-client';\nimport { type IdentityPanelProps, type JoinPanelProps } from '@dxos/shell/react';\n\nimport { IdentityDialog, JoinDialog, RecoveryCodeDialog, type RecoveryCodeDialogProps } from './components';\nimport meta, { CLIENT_PLUGIN, ClientAction, OBSERVABILITY_ACTION } from './meta';\nimport translations from './translations';\n\nexport type ClientPluginOptions = ClientOptions & {\n /**\n * Used to track app-specific state in spaces.\n */\n appKey: string;\n\n /**\n * Base URL for the invitation link.\n */\n invitationUrl?: string;\n\n /**\n * Query parameter for the invitation code.\n */\n invitationParam?: string;\n\n /**\n * Run after the client has been initialized.\n */\n onClientInitialized?: (client: Client) => Promise<void>;\n\n /**\n * Run after the identity has been successfully initialized.\n * Run with client during plugin ready phase.\n */\n onReady?: (client: Client, plugins: Plugin[]) => Promise<void>;\n\n /**\n * Called when the client is reset.\n */\n onReset?: (params: { target?: string }) => Promise<void>;\n};\n\nexport type ClientPluginProvides = IntentResolverProvides &\n GraphBuilderProvides &\n SurfaceProvides &\n TranslationsProvides & {\n client: Client;\n };\n\nexport const parseClientPlugin = (plugin?: Plugin) =>\n (plugin?.provides as any).client instanceof Client ? (plugin as Plugin<ClientPluginProvides>) : undefined;\n\nexport const ClientPlugin = ({\n appKey,\n invitationUrl = window.location.origin,\n invitationParam = 'deviceInvitationCode',\n onClientInitialized,\n onReady,\n onReset,\n ...options\n}: ClientPluginOptions): PluginDefinition<\n Omit<ClientPluginProvides, 'client'>,\n Pick<ClientPluginProvides, 'client'>\n> => {\n registerSignalsRuntime();\n\n let client: Client;\n let error: unknown = null;\n\n const createDeviceInvitationUrl = (invitationCode: string) => {\n const baseUrl = new URL(invitationUrl);\n baseUrl.searchParams.set(invitationParam, invitationCode);\n return baseUrl.toString();\n };\n\n return {\n meta,\n initialize: async () => {\n const config = new Config(await Storage(), Envs(), Local(), Defaults());\n client = new Client({ config, ...options });\n\n try {\n await client.initialize();\n await onClientInitialized?.(client);\n\n // TODO(wittjosiah): Remove. This is a hack to get the app to boot with the new identity after a reset.\n client.reloaded.on(() => {\n client.halo.identity.subscribe(async (identity) => {\n if (identity) {\n window.location.href = window.location.origin;\n }\n });\n });\n } catch (err) {\n error = err;\n }\n\n return {\n client,\n context: ({ children }) => <ClientProvider client={client}>{children}</ClientProvider>,\n };\n },\n ready: async (plugins) => {\n if (error) {\n throw error;\n }\n\n await onReady?.(client, plugins);\n },\n unload: async () => {\n await client.destroy();\n },\n provides: {\n translations,\n surface: {\n component: ({ data, role, ...rest }) => {\n switch (role) {\n case 'dialog':\n if (data.component === 'dxos.org/plugin/client/IdentityDialog') {\n return (\n <IdentityDialog\n {...(data.subject as IdentityPanelProps)}\n createInvitationUrl={createDeviceInvitationUrl}\n />\n );\n } else if (data.component === 'dxos.org/plugin/client/JoinDialog') {\n return <JoinDialog {...(data.subject as JoinPanelProps)} />;\n } else if (data.component === 'dxos.org/plugin/client/RecoveryCodeDialog') {\n return <RecoveryCodeDialog {...(data.subject as RecoveryCodeDialogProps)} />;\n }\n break;\n }\n\n return null;\n },\n },\n graph: {\n builder: (plugins) => {\n const intentPlugin = resolvePlugin(plugins, parseIntentPlugin);\n const id = `${CLIENT_PLUGIN}/open-shell`;\n\n return createExtension({\n id: CLIENT_PLUGIN,\n filter: (node): node is Node<null> => node.id === 'root',\n actions: () => [\n {\n id,\n data: async () => {\n await intentPlugin?.provides.intent.dispatch([\n { plugin: CLIENT_PLUGIN, action: ClientAction.SHARE_IDENTITY },\n ]);\n },\n properties: {\n label: ['open shell label', { ns: CLIENT_PLUGIN }],\n icon: 'ph--address-book--regular',\n keyBinding: {\n macos: 'meta+shift+.',\n // TODO(wittjosiah): Test on windows to see if it behaves the same as linux.\n windows: 'alt+shift+.',\n linux: 'alt+shift+>',\n },\n testId: 'clientPlugin.openShell',\n },\n },\n ],\n });\n },\n },\n intent: {\n resolver: async (intent) => {\n switch (intent.action) {\n case ClientAction.CREATE_IDENTITY: {\n const data = await client.halo.createIdentity();\n return {\n data,\n intents: [\n [\n {\n action: OBSERVABILITY_ACTION,\n data: {\n name: 'identity.create',\n },\n },\n ],\n ],\n };\n }\n\n case ClientAction.JOIN_IDENTITY: {\n return {\n data: true,\n intents: [\n [\n {\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'dialog',\n component: 'dxos.org/plugin/client/JoinDialog',\n dialogBlockAlign: 'start',\n subject: {\n initialInvitationCode: intent.data?.invitationCode,\n initialDisposition: 'accept-halo-invitation',\n } satisfies Partial<JoinPanelProps>,\n },\n },\n ],\n ],\n };\n }\n\n case ClientAction.SHARE_IDENTITY: {\n return {\n data: true,\n intents: [\n [\n {\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'dialog',\n component: 'dxos.org/plugin/client/IdentityDialog',\n dialogBlockAlign: 'start',\n },\n },\n ],\n [\n {\n action: OBSERVABILITY_ACTION,\n data: {\n name: 'identity.share',\n },\n },\n ],\n ],\n };\n }\n\n case ClientAction.RECOVER_IDENTITY: {\n return {\n data: true,\n intents: [\n [\n {\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'dialog',\n component: 'dxos.org/plugin/client/JoinDialog',\n dialogBlockAlign: 'start',\n subject: {\n initialDisposition: 'recover-identity',\n } satisfies Partial<JoinPanelProps>,\n },\n },\n ],\n ],\n };\n }\n\n case ClientAction.RESET_STORAGE: {\n await onReset?.({ target: intent.data?.target });\n return { data: true };\n }\n\n case ClientAction.CREATE_AGENT: {\n invariant(client.services.services.EdgeAgentService, 'Missing EdgeAgentService');\n await client.services.services.EdgeAgentService.createAgent(null as any, { timeout: 10_000 });\n return { data: true };\n }\n\n case ClientAction.CREATE_RECOVERY_CODE: {\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n // TODO(wittjosiah): This needs a proper api. Rename property.\n const { seedphrase } = await client.services.services.IdentityService.createRecoveryPhrase();\n return {\n data: true,\n intents: [\n [\n {\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'dialog',\n dialogBlockAlign: 'start',\n dialogType: 'alert',\n state: true,\n component: 'dxos.org/plugin/client/RecoveryCodeDialog',\n subject: { code: seedphrase },\n },\n },\n ],\n ],\n };\n }\n }\n },\n },\n },\n };\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { useClient } from '@dxos/react-client';\nimport { Clipboard, Dialog } from '@dxos/react-ui';\nimport { IdentityPanel, type IdentityPanelProps } from '@dxos/shell/react';\n\nimport { ClientAction } from '../meta';\n\nexport const IdentityDialog = (props: IdentityPanelProps) => {\n const dispatch = useIntentDispatcher();\n const client = useClient();\n\n const handleDone = useCallback(\n () =>\n dispatch({\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'dialog',\n state: false,\n },\n }),\n [dispatch],\n );\n\n const handleResetStorage = useCallback(async () => {\n await client.reset();\n await dispatch({ action: ClientAction.RESET_STORAGE });\n }, [dispatch]);\n\n const handleRecover = useCallback(async () => {\n await client.reset();\n await dispatch({ action: ClientAction.RESET_STORAGE, data: { target: 'recoverIdentity' } });\n }, [dispatch]);\n\n const handleJoinNewIdentity = useCallback(async () => {\n await client.reset();\n await dispatch({ action: ClientAction.RESET_STORAGE, data: { target: 'deviceInvitation' } });\n }, [dispatch]);\n\n return (\n <Dialog.Content>\n <Clipboard.Provider>\n <IdentityPanel\n {...props}\n doneActionParent={<Dialog.Close asChild />}\n onDone={handleDone}\n onResetStorage={handleResetStorage}\n onRecover={handleRecover}\n onJoinNewIdentity={handleJoinNewIdentity}\n />\n </Clipboard.Provider>\n </Dialog.Content>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { type InvitationResult } from '@dxos/react-client/invitations';\nimport { Dialog } from '@dxos/react-ui';\nimport { JoinPanel, type JoinPanelProps } from '@dxos/shell/react';\n\nimport { CLIENT_PLUGIN, ClientAction, OBSERVABILITY_ACTION } from '../meta';\n\nexport const JoinDialog = (props: JoinPanelProps) => {\n const dispatch = useIntentDispatcher();\n\n const handleCancelResetStorage = useCallback(\n () => dispatch({ plugin: CLIENT_PLUGIN, action: ClientAction.SHARE_IDENTITY }),\n [dispatch],\n );\n\n const handleDone = useCallback(\n async (result: InvitationResult | null) => {\n if (result?.identityKey) {\n await Promise.all([\n dispatch({\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'dialog',\n state: false,\n },\n }),\n dispatch({\n action: OBSERVABILITY_ACTION,\n data: {\n name: props.initialDisposition === 'recover-identity' ? 'identity.recover' : 'identity.join',\n },\n }),\n ]);\n }\n },\n [dispatch],\n );\n\n return (\n <Dialog.Content>\n <JoinPanel\n mode='halo-only'\n {...props}\n exitActionParent={<Dialog.Close asChild />}\n doneActionParent={<Dialog.Close asChild />}\n onCancelResetStorage={handleCancelResetStorage}\n onDone={handleDone}\n />\n </Dialog.Content>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback, useState } from 'react';\n\nimport { AlertDialog, Button, Clipboard, Input, useTranslation } from '@dxos/react-ui';\n\nimport { CLIENT_PLUGIN } from '../meta';\n\nexport type RecoveryCodeDialogProps = {\n code: string;\n};\n\nexport const RecoveryCodeDialog = ({ code }: RecoveryCodeDialogProps) => {\n const { t } = useTranslation(CLIENT_PLUGIN);\n const [confirmation, setConfirmation] = useState(false);\n\n const handleConfirmation = useCallback((checked: boolean) => setConfirmation(checked), []);\n\n return (\n <AlertDialog.Content classNames='bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden'>\n <AlertDialog.Title classNames=''>{t('recovery code dialog title')}</AlertDialog.Title>\n <p className='py-4'>{t('recovery code dialog description')}</p>\n <Clipboard.Provider>\n <Code code={code} />\n </Clipboard.Provider>\n <div className='flex flex-col py-4 gap-2'>\n <p>{t('recovery code dialog warning 1')}</p>\n <p>{t('recovery code dialog warning 2')}</p>\n </div>\n <div className='flex items-center gap-2 pbe-4'>\n <Input.Root>\n <Input.Checkbox\n data-testid='recoveryCode.confirm'\n checked={confirmation}\n onCheckedChange={handleConfirmation}\n />\n <Input.Label>{t('recovery code confirmation label')}</Input.Label>\n </Input.Root>\n </div>\n <div className='flex justify-end'>\n <AlertDialog.Action asChild>\n <Button data-testid='recoveryCode.continue' variant='primary' disabled={!confirmation}>\n {t('continue label')}\n </Button>\n </AlertDialog.Action>\n </div>\n </AlertDialog.Content>\n );\n};\n\nconst Code = ({ code }: { code: string }) => {\n const words = code.split(' ');\n return (\n <div className='relative p-2 border border-separator rounded group'>\n <Clipboard.IconButton value={code} classNames='absolute top-2 right-2 invisible group-hover:visible' />\n <div className='grid grid-cols-4'>\n {words.map((word, i) => (\n <div key={i} className='flex items-center p-2 gap-2 items-center'>\n <div className='w-4 text-xs text-center text-subdued'>{i + 1}</div>\n <div className='text-sm'>{word}</div>\n </div>\n ))}\n </div>\n </div>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { CLIENT_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [CLIENT_PLUGIN]: {\n 'open shell label': 'Open HALO',\n 'recovery code dialog title': 'Account Recovery',\n 'recovery code dialog description':\n 'This is your identity recovery code, store it in a safe place. You can use it to recover your identity if you ever lose access to your devices.',\n 'recovery code dialog warning 1': 'NOTE: This code will not be displayed again.',\n 'recovery code dialog warning 2':\n 'It is your private key for recovering DXOS data. Anyone with this key will be able to gain access to your account.',\n 'recovery code confirmation label': 'Please confirm you have saved the code.',\n 'continue label': 'Continue',\n },\n },\n },\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { ClientPlugin } from './ClientPlugin';\n\nexport default ClientPlugin;\n\nexport * from './ClientPlugin';\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["React", "LayoutAction", "parseIntentPlugin", "resolvePlugin", "Config", "Defaults", "Envs", "Local", "Storage", "registerSignalsRuntime", "invariant", "createExtension", "Client", "ClientProvider", "React", "useCallback", "LayoutAction", "useIntentDispatcher", "useClient", "Clipboard", "Dialog", "IdentityPanel", "IdentityDialog", "props", "dispatch", "useIntentDispatcher", "client", "useClient", "handleDone", "useCallback", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport {\n LayoutAction,\n parseIntentPlugin,\n resolvePlugin,\n type PluginDefinition,\n createSurface,\n createIntent,\n createResolver,\n} from '@dxos/app-framework';\nimport { Config, Defaults, Envs, Local, Storage } from '@dxos/config';\nimport { registerSignalsRuntime } from '@dxos/echo-signals/react';\nimport { invariant } from '@dxos/invariant';\nimport { createExtension, type Node } from '@dxos/plugin-graph';\nimport { ObservabilityAction } from '@dxos/plugin-observability/types';\nimport { Client, ClientProvider } from '@dxos/react-client';\nimport { type IdentityPanelProps, type JoinPanelProps } from '@dxos/shell/react';\n\nimport {\n IDENTITY_DIALOG,\n IdentityDialog,\n JOIN_DIALOG,\n JoinDialog,\n RECOVER_CODE_DIALOG,\n RecoveryCodeDialog,\n type RecoveryCodeDialogProps,\n} from './components';\nimport meta, { CLIENT_PLUGIN } from './meta';\nimport translations from './translations';\nimport { ClientAction, type ClientPluginOptions, type ClientPluginProvides } from './types';\n\nexport const ClientPlugin = ({\n appKey,\n invitationUrl = window.location.origin,\n invitationParam = 'deviceInvitationCode',\n onClientInitialized,\n onReady,\n onReset,\n ...options\n}: ClientPluginOptions): PluginDefinition<\n Omit<ClientPluginProvides, 'client'>,\n Pick<ClientPluginProvides, 'client'>\n> => {\n registerSignalsRuntime();\n\n let client: Client;\n let error: unknown = null;\n\n const createDeviceInvitationUrl = (invitationCode: string) => {\n const baseUrl = new URL(invitationUrl);\n baseUrl.searchParams.set(invitationParam, invitationCode);\n return baseUrl.toString();\n };\n\n return {\n meta,\n initialize: async () => {\n const config = new Config(await Storage(), Envs(), Local(), Defaults());\n client = new Client({ config, ...options });\n\n try {\n await client.initialize();\n await onClientInitialized?.(client);\n\n // TODO(wittjosiah): Remove. This is a hack to get the app to boot with the new identity after a reset.\n client.reloaded.on(() => {\n client.halo.identity.subscribe(async (identity) => {\n if (identity) {\n window.location.href = window.location.origin;\n }\n });\n });\n } catch (err) {\n error = err;\n }\n\n return {\n client,\n context: ({ children }) => <ClientProvider client={client}>{children}</ClientProvider>,\n };\n },\n ready: async ({ plugins }) => {\n if (error) {\n throw error;\n }\n\n await onReady?.(client, plugins);\n },\n unload: async () => {\n await client.destroy();\n },\n provides: {\n translations,\n surface: {\n definitions: () => [\n createSurface({\n id: IDENTITY_DIALOG,\n role: 'dialog',\n filter: (data): data is { subject: IdentityPanelProps } => data.component === IDENTITY_DIALOG,\n component: ({ data }) => (\n <IdentityDialog {...data.subject} createInvitationUrl={createDeviceInvitationUrl} />\n ),\n }),\n createSurface({\n id: JOIN_DIALOG,\n role: 'dialog',\n filter: (data): data is { subject: JoinPanelProps } => data.component === JOIN_DIALOG,\n component: ({ data }) => <JoinDialog {...data.subject} />,\n }),\n createSurface({\n id: RECOVER_CODE_DIALOG,\n role: 'dialog',\n filter: (data): data is { subject: RecoveryCodeDialogProps } => data.component === RECOVER_CODE_DIALOG,\n component: ({ data }) => <RecoveryCodeDialog {...data.subject} />,\n }),\n ],\n },\n graph: {\n builder: (plugins) => {\n const dispatch = resolvePlugin(plugins, parseIntentPlugin)?.provides.intent.dispatchPromise;\n const id = `${CLIENT_PLUGIN}/open-shell`;\n\n return createExtension({\n id: CLIENT_PLUGIN,\n filter: (node): node is Node<null> => node.id === 'root',\n actions: () => [\n {\n id,\n data: async () => {\n await dispatch?.(createIntent(ClientAction.ShareIdentity));\n },\n properties: {\n label: ['open shell label', { ns: CLIENT_PLUGIN }],\n icon: 'ph--address-book--regular',\n keyBinding: {\n macos: 'meta+shift+.',\n // TODO(wittjosiah): Test on windows to see if it behaves the same as linux.\n windows: 'alt+shift+.',\n linux: 'alt+shift+>',\n },\n testId: 'clientPlugin.openShell',\n },\n },\n ],\n });\n },\n },\n intent: {\n resolvers: () => [\n createResolver(ClientAction.CreateIdentity, async () => {\n const data = await client.halo.createIdentity();\n return { data, intents: [createIntent(ObservabilityAction.SendEvent, { name: 'identity.create' })] };\n }),\n createResolver(ClientAction.JoinIdentity, async (data) => {\n return {\n intents: [\n createIntent(LayoutAction.SetLayout, {\n element: 'dialog',\n component: JOIN_DIALOG,\n dialogBlockAlign: 'start',\n subject: {\n initialInvitationCode: data.invitationCode,\n initialDisposition: 'accept-halo-invitation',\n } satisfies Partial<JoinPanelProps>,\n }),\n ],\n };\n }),\n createResolver(ClientAction.ShareIdentity, async () => {\n return {\n intents: [\n createIntent(LayoutAction.SetLayout, {\n element: 'dialog',\n component: IDENTITY_DIALOG,\n dialogBlockAlign: 'start',\n }),\n createIntent(ObservabilityAction.SendEvent, { name: 'identity.share' }),\n ],\n };\n }),\n createResolver(ClientAction.RecoverIdentity, async () => {\n return {\n intents: [\n createIntent(LayoutAction.SetLayout, {\n element: 'dialog',\n component: JOIN_DIALOG,\n dialogBlockAlign: 'start',\n subject: { initialDisposition: 'recover-identity' } satisfies Partial<JoinPanelProps>,\n }),\n ],\n };\n }),\n createResolver(ClientAction.ResetStorage, async (data) => {\n await onReset?.({ target: data.target });\n return {};\n }),\n createResolver(ClientAction.CreateAgent, async () => {\n invariant(client.services.services.EdgeAgentService, 'Missing EdgeAgentService');\n await client.services.services.EdgeAgentService.createAgent(null as any, { timeout: 10_000 });\n }),\n createResolver(ClientAction.CreateRecoveryCode, async () => {\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n // TODO(wittjosiah): This needs a proper api. Rename property.\n const { seedphrase } = await client.services.services.IdentityService.createRecoveryPhrase();\n return {\n intents: [\n createIntent(LayoutAction.SetLayout, {\n element: 'dialog',\n dialogBlockAlign: 'start',\n dialogType: 'alert',\n state: true,\n component: RECOVER_CODE_DIALOG,\n subject: { code: seedphrase },\n }),\n ],\n };\n }),\n ],\n },\n },\n };\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { useClient } from '@dxos/react-client';\nimport { Clipboard, Dialog } from '@dxos/react-ui';\nimport { IdentityPanel, type IdentityPanelProps } from '@dxos/shell/react';\n\nimport { CLIENT_PLUGIN } from '../meta';\nimport { ClientAction } from '../types';\n\nexport const IDENTITY_DIALOG = `${CLIENT_PLUGIN}/IdentityDialog`;\n\nexport const IdentityDialog = (props: IdentityPanelProps) => {\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const client = useClient();\n\n const handleDone = useCallback(\n () =>\n dispatch(\n createIntent(LayoutAction.SetLayout, {\n element: 'dialog',\n state: false,\n }),\n ),\n [dispatch],\n );\n\n const handleResetStorage = useCallback(async () => {\n await client.reset();\n await dispatch(createIntent(ClientAction.ResetStorage));\n }, [dispatch]);\n\n const handleRecover = useCallback(async () => {\n await client.reset();\n await dispatch(createIntent(ClientAction.ResetStorage, { target: 'recoverIdentity' }));\n }, [dispatch]);\n\n const handleJoinNewIdentity = useCallback(async () => {\n await client.reset();\n await dispatch(createIntent(ClientAction.ResetStorage, { target: 'deviceInvitation' }));\n }, [dispatch]);\n\n return (\n <Dialog.Content>\n <Clipboard.Provider>\n <IdentityPanel\n {...props}\n doneActionParent={<Dialog.Close asChild />}\n onDone={handleDone}\n onResetStorage={handleResetStorage}\n onRecover={handleRecover}\n onJoinNewIdentity={handleJoinNewIdentity}\n />\n </Clipboard.Provider>\n </Dialog.Content>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { ObservabilityAction } from '@dxos/plugin-observability/types';\nimport { type InvitationResult } from '@dxos/react-client/invitations';\nimport { Dialog } from '@dxos/react-ui';\nimport { JoinPanel, type JoinPanelProps } from '@dxos/shell/react';\n\nimport { CLIENT_PLUGIN } from '../meta';\nimport { ClientAction } from '../types';\n\nexport const JOIN_DIALOG = `${CLIENT_PLUGIN}/JoinDialog`;\n\nexport const JoinDialog = (props: JoinPanelProps) => {\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n\n const handleCancelResetStorage = useCallback(() => dispatch(createIntent(ClientAction.ShareIdentity)), [dispatch]);\n\n const handleDone = useCallback(\n async (result: InvitationResult | null) => {\n if (result?.identityKey) {\n await Promise.all([\n dispatch(createIntent(LayoutAction.SetLayout, { element: 'dialog', state: false })),\n dispatch(\n createIntent(ObservabilityAction.SendEvent, {\n name: props.initialDisposition === 'recover-identity' ? 'identity.recover' : 'identity.join',\n }),\n ),\n ]);\n }\n },\n [dispatch],\n );\n\n return (\n <Dialog.Content>\n <JoinPanel\n mode='halo-only'\n {...props}\n exitActionParent={<Dialog.Close asChild />}\n doneActionParent={<Dialog.Close asChild />}\n onCancelResetStorage={handleCancelResetStorage}\n onDone={handleDone}\n />\n </Dialog.Content>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback, useState } from 'react';\n\nimport { AlertDialog, Button, Clipboard, Input, useTranslation } from '@dxos/react-ui';\n\nimport { CLIENT_PLUGIN } from '../meta';\n\nexport const RECOVER_CODE_DIALOG = `${CLIENT_PLUGIN}/RecoveryCodeDialog`;\n\nexport type RecoveryCodeDialogProps = {\n code: string;\n};\n\nexport const RecoveryCodeDialog = ({ code }: RecoveryCodeDialogProps) => {\n const { t } = useTranslation(CLIENT_PLUGIN);\n const [confirmation, setConfirmation] = useState(false);\n\n const handleConfirmation = useCallback((checked: boolean) => setConfirmation(checked), []);\n\n return (\n <AlertDialog.Content classNames='bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden'>\n <AlertDialog.Title>{t('recovery code dialog title')}</AlertDialog.Title>\n <p className='py-4'>{t('recovery code dialog description')}</p>\n <Clipboard.Provider>\n <Code code={code} />\n </Clipboard.Provider>\n <div className='flex flex-col py-4 gap-2'>\n <p>{t('recovery code dialog warning 1')}</p>\n <p>{t('recovery code dialog warning 2')}</p>\n </div>\n <div className='flex items-center gap-2 pbe-4'>\n <Input.Root>\n <Input.Checkbox\n data-testid='recoveryCode.confirm'\n checked={confirmation}\n onCheckedChange={handleConfirmation}\n />\n <Input.Label>{t('recovery code confirmation label')}</Input.Label>\n </Input.Root>\n </div>\n <div className='flex justify-end'>\n <AlertDialog.Action asChild>\n <Button data-testid='recoveryCode.continue' variant='primary' disabled={!confirmation}>\n {t('continue label')}\n </Button>\n </AlertDialog.Action>\n </div>\n </AlertDialog.Content>\n );\n};\n\nconst Code = ({ code }: { code: string }) => {\n const words = code.split(' ');\n return (\n <div className='relative p-2 border border-separator rounded group'>\n <Clipboard.IconButton value={code} classNames='absolute top-2 right-2 invisible group-hover:visible' />\n <div className='grid grid-cols-4'>\n {words.map((word, i) => (\n <div key={i} className='flex items-center p-2 gap-2 items-center'>\n <div className='w-4 text-xs text-center text-subdued'>{i + 1}</div>\n <div className='text-sm'>{word}</div>\n </div>\n ))}\n </div>\n </div>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { CLIENT_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [CLIENT_PLUGIN]: {\n 'open shell label': 'Open HALO',\n 'recovery code dialog title': 'Account Recovery',\n 'recovery code dialog description':\n 'This is your identity recovery code, store it in a safe place. You can use it to recover your identity if you ever lose access to your devices.',\n 'recovery code dialog warning 1': 'NOTE: This code will not be displayed again.',\n 'recovery code dialog warning 2':\n 'It is your private key for recovering DXOS data. Anyone with this key will be able to gain access to your account.',\n 'recovery code confirmation label': 'Please confirm you have saved the code.',\n 'continue label': 'Continue',\n },\n },\n },\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { ClientPlugin } from './ClientPlugin';\n\nexport default ClientPlugin;\n\nexport * from './ClientPlugin';\n"],
|
|
5
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AAA;AAC3C,mBAAO;cACLX,SAAS;gBACPhB,cAAaqB,cAAaC,WAAW;kBACnCC,SAAS;kBACT1C,WAAWI;kBACXuC,kBAAkB;kBAClBzC,SAAS;oBAAE2C,oBAAoB;kBAAmB;gBACpD,CAAA;;YAEJ;UACF,CAAA;UACAb,eAAeZ,aAAa2B,cAAc,OAAOhD,SAAAA;AAC/C,kBAAM7C,UAAU;cAAE8F,QAAQjD,KAAKiD;YAAO,CAAA;AACtC,mBAAO,CAAC;UACV,CAAA;UACAhB,eAAeZ,aAAa6B,aAAa,YAAA;AACvCC,sBAAU7F,OAAO8F,SAASA,SAASC,kBAAkB,4BAAA;;;;;;;;;AACrD,kBAAM/F,OAAO8F,SAASA,SAASC,iBAAiBC,YAAY,MAAa;cAAEC,SAAS;YAAO,CAAA;UAC7F,CAAA;UACAtB,eAAeZ,aAAamC,oBAAoB,YAAA;AAC9CL,sBAAU7F,OAAO8F,SAASA,SAASK,iBAAiB,iCAAA;;;;;;;;;AAEpD,kBAAM,EAAEC,WAAU,IAAK,MAAMpG,OAAO8F,SAASA,SAASK,gBAAgBE,qBAAoB;AAC1F,mBAAO;cACLvB,SAAS;gBACPhB,cAAaqB,cAAaC,WAAW;kBACnCC,SAAS;kBACTC,kBAAkB;kBAClBgB,YAAY;kBACZC,OAAO;kBACP5D,WAAWM;kBACXJ,SAAS;oBAAE2D,MAAMJ;kBAAW;gBAC9B,CAAA;;YAEJ;UACF,CAAA;;MAEJ;IACF;EACF;AACF;;;AK5NA,IAAA,cAAeK;",
|
|
6
|
+
"names": ["React", "LayoutAction", "parseIntentPlugin", "resolvePlugin", "createSurface", "createIntent", "createResolver", "Config", "Defaults", "Envs", "Local", "Storage", "registerSignalsRuntime", "invariant", "createExtension", "ObservabilityAction", "Client", "ClientProvider", "React", "useCallback", "createIntent", "LayoutAction", "useIntentDispatcher", "useClient", "Clipboard", "Dialog", "IdentityPanel", "IDENTITY_DIALOG", "CLIENT_PLUGIN", "IdentityDialog", "props", "dispatchPromise", "dispatch", "useIntentDispatcher", "client", "useClient", "handleDone", "useCallback", "createIntent", "LayoutAction", "SetLayout", "element", "state", "handleResetStorage", "reset", "ClientAction", "ResetStorage", "handleRecover", "target", "handleJoinNewIdentity", "Dialog", "Content", "Clipboard", "Provider", "IdentityPanel", "doneActionParent", "Close", "asChild", "onDone", "onResetStorage", "onRecover", "onJoinNewIdentity", "React", "useCallback", "createIntent", "LayoutAction", "useIntentDispatcher", "ObservabilityAction", "Dialog", "JoinPanel", "JOIN_DIALOG", "CLIENT_PLUGIN", "JoinDialog", "props", "dispatchPromise", "dispatch", "useIntentDispatcher", "handleCancelResetStorage", "useCallback", "createIntent", "ClientAction", "ShareIdentity", "handleDone", "result", "identityKey", "Promise", "all", "LayoutAction", "SetLayout", "element", "state", "ObservabilityAction", "SendEvent", "name", "initialDisposition", "React", "Dialog", "Content", "JoinPanel", "mode", "exitActionParent", "Close", "asChild", "doneActionParent", "onCancelResetStorage", "onDone", "React", "useCallback", "useState", "AlertDialog", "Button", "Clipboard", "Input", "useTranslation", "RECOVER_CODE_DIALOG", "CLIENT_PLUGIN", "RecoveryCodeDialog", "code", "t", "useTranslation", "confirmation", "setConfirmation", "useState", "handleConfirmation", "useCallback", "checked", "React", "AlertDialog", "Content", "classNames", "Title", "p", "className", "Clipboard", "Provider", "Code", "div", "Input", "Root", "Checkbox", "data-testid", "onCheckedChange", "Label", "Action", "asChild", "Button", "variant", "disabled", "words", "split", "IconButton", "value", "map", "word", "i", "key", "CLIENT_PLUGIN", "ClientPlugin", "appKey", "invitationUrl", "window", "location", "origin", "invitationParam", "onClientInitialized", "onReady", "onReset", "options", "registerSignalsRuntime", "client", "error", "createDeviceInvitationUrl", "invitationCode", "baseUrl", "URL", "searchParams", "set", "toString", "meta", "initialize", "config", "Config", "Storage", "Envs", "Local", "Defaults", "Client", "reloaded", "on", "halo", "identity", "subscribe", "href", "err", "context", "children", "React", "ClientProvider", "ready", "plugins", "unload", "destroy", "provides", "translations", "surface", "definitions", "createSurface", "id", "IDENTITY_DIALOG", "role", "filter", "data", "component", "IdentityDialog", "subject", "createInvitationUrl", "JOIN_DIALOG", "JoinDialog", "RECOVER_CODE_DIALOG", "RecoveryCodeDialog", "graph", "builder", "dispatch", "resolvePlugin", "parseIntentPlugin", "intent", "dispatchPromise", "CLIENT_PLUGIN", "createExtension", "node", "actions", "createIntent", "ClientAction", "ShareIdentity", "properties", "label", "ns", "icon", "keyBinding", "macos", "windows", "linux", "testId", "resolvers", "createResolver", "CreateIdentity", "createIdentity", "intents", "ObservabilityAction", "SendEvent", "name", "JoinIdentity", "LayoutAction", "SetLayout", "element", "dialogBlockAlign", "initialInvitationCode", "initialDisposition", "RecoverIdentity", "ResetStorage", "target", "CreateAgent", "invariant", "services", "EdgeAgentService", "createAgent", "timeout", "CreateRecoveryCode", "IdentityService", "seedphrase", "createRecoveryPhrase", "dialogType", "state", "code", "ClientPlugin"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/plugins/plugin-client/src/meta.ts":{"bytes":
|
|
1
|
+
{"inputs":{"packages/plugins/plugin-client/src/meta.ts":{"bytes":938,"imports":[],"format":"esm"},"packages/plugins/plugin-client/src/types.ts":{"bytes":10056,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-client/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-client/src/components/IdentityDialog.tsx":{"bytes":6849,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/shell/react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-client/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-client/src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-client/src/components/JoinDialog.tsx":{"bytes":6207,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-observability/types","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/shell/react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-client/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-client/src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-client/src/components/RecoveryCodeDialog.tsx":{"bytes":8973,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-client/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-client/src/components/index.ts":{"bytes":739,"imports":[{"path":"packages/plugins/plugin-client/src/components/IdentityDialog.tsx","kind":"import-statement","original":"./IdentityDialog"},{"path":"packages/plugins/plugin-client/src/components/JoinDialog.tsx","kind":"import-statement","original":"./JoinDialog"},{"path":"packages/plugins/plugin-client/src/components/RecoveryCodeDialog.tsx","kind":"import-statement","original":"./RecoveryCodeDialog"}],"format":"esm"},"packages/plugins/plugin-client/src/translations.ts":{"bytes":2699,"imports":[{"path":"packages/plugins/plugin-client/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-client/src/ClientPlugin.tsx":{"bytes":30134,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/config","kind":"import-statement","external":true},{"path":"@dxos/echo-signals/react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-observability/types","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-client/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-client/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-client/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/plugin-client/src/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-client/src/index.ts":{"bytes":782,"imports":[{"path":"packages/plugins/plugin-client/src/ClientPlugin.tsx","kind":"import-statement","original":"./ClientPlugin"},{"path":"packages/plugins/plugin-client/src/ClientPlugin.tsx","kind":"import-statement","original":"./ClientPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-client/dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":26416},"packages/plugins/plugin-client/dist/lib/node-esm/index.mjs":{"imports":[{"path":"packages/plugins/plugin-client/dist/lib/node-esm/chunk-TI4GNGMM.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-client/dist/lib/node-esm/chunk-GMGRQ5Q7.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/config","kind":"import-statement","external":true},{"path":"@dxos/echo-signals/react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-observability/types","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/shell/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-observability/types","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/shell/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"exports":["ClientPlugin","default"],"entryPoint":"packages/plugins/plugin-client/src/index.ts","inputs":{"packages/plugins/plugin-client/src/ClientPlugin.tsx":{"bytesInOutput":7912},"packages/plugins/plugin-client/src/components/IdentityDialog.tsx":{"bytesInOutput":1654},"packages/plugins/plugin-client/src/components/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-client/src/components/JoinDialog.tsx":{"bytesInOutput":1552},"packages/plugins/plugin-client/src/components/RecoveryCodeDialog.tsx":{"bytesInOutput":2774},"packages/plugins/plugin-client/src/translations.ts":{"bytesInOutput":758},"packages/plugins/plugin-client/src/index.ts":{"bytesInOutput":32}},"bytes":15411},"packages/plugins/plugin-client/dist/lib/node-esm/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-client/dist/lib/node-esm/meta.mjs":{"imports":[{"path":"packages/plugins/plugin-client/dist/lib/node-esm/chunk-GMGRQ5Q7.mjs","kind":"import-statement"}],"exports":["CLIENT_PLUGIN","default"],"entryPoint":"packages/plugins/plugin-client/src/meta.ts","inputs":{},"bytes":253},"packages/plugins/plugin-client/dist/lib/node-esm/types.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-client/dist/lib/node-esm/types.mjs":{"imports":[{"path":"packages/plugins/plugin-client/dist/lib/node-esm/chunk-TI4GNGMM.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-client/dist/lib/node-esm/chunk-GMGRQ5Q7.mjs","kind":"import-statement"}],"exports":["ClientAction","parseClientPlugin"],"entryPoint":"packages/plugins/plugin-client/src/types.ts","inputs":{},"bytes":282},"packages/plugins/plugin-client/dist/lib/node-esm/chunk-TI4GNGMM.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5432},"packages/plugins/plugin-client/dist/lib/node-esm/chunk-TI4GNGMM.mjs":{"imports":[{"path":"packages/plugins/plugin-client/dist/lib/node-esm/chunk-GMGRQ5Q7.mjs","kind":"import-statement"},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true}],"exports":["ClientAction","parseClientPlugin"],"inputs":{"packages/plugins/plugin-client/src/types.ts":{"bytesInOutput":2064}},"bytes":2353},"packages/plugins/plugin-client/dist/lib/node-esm/chunk-GMGRQ5Q7.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":449},"packages/plugins/plugin-client/dist/lib/node-esm/chunk-GMGRQ5Q7.mjs":{"imports":[],"exports":["CLIENT_PLUGIN","meta_default"],"inputs":{"packages/plugins/plugin-client/src/meta.ts":{"bytesInOutput":108}},"bytes":336}}}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
CLIENT_PLUGIN,
|
|
4
|
-
ClientAction,
|
|
5
|
-
OBSERVABILITY_ACTION,
|
|
6
4
|
meta_default
|
|
7
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-GMGRQ5Q7.mjs";
|
|
8
6
|
export {
|
|
9
7
|
CLIENT_PLUGIN,
|
|
10
|
-
ClientAction,
|
|
11
|
-
OBSERVABILITY_ACTION,
|
|
12
8
|
meta_default as default
|
|
13
9
|
};
|
|
14
10
|
//# sourceMappingURL=meta.mjs.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
ClientAction,
|
|
4
|
+
parseClientPlugin
|
|
5
|
+
} from "./chunk-TI4GNGMM.mjs";
|
|
6
|
+
import "./chunk-GMGRQ5Q7.mjs";
|
|
7
|
+
export {
|
|
8
|
+
ClientAction,
|
|
9
|
+
parseClientPlugin
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=types.mjs.map
|
|
@@ -1,37 +1,4 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import {
|
|
3
|
-
export type ClientPluginOptions = ClientOptions & {
|
|
4
|
-
/**
|
|
5
|
-
* Used to track app-specific state in spaces.
|
|
6
|
-
*/
|
|
7
|
-
appKey: string;
|
|
8
|
-
/**
|
|
9
|
-
* Base URL for the invitation link.
|
|
10
|
-
*/
|
|
11
|
-
invitationUrl?: string;
|
|
12
|
-
/**
|
|
13
|
-
* Query parameter for the invitation code.
|
|
14
|
-
*/
|
|
15
|
-
invitationParam?: string;
|
|
16
|
-
/**
|
|
17
|
-
* Run after the client has been initialized.
|
|
18
|
-
*/
|
|
19
|
-
onClientInitialized?: (client: Client) => Promise<void>;
|
|
20
|
-
/**
|
|
21
|
-
* Run after the identity has been successfully initialized.
|
|
22
|
-
* Run with client during plugin ready phase.
|
|
23
|
-
*/
|
|
24
|
-
onReady?: (client: Client, plugins: Plugin[]) => Promise<void>;
|
|
25
|
-
/**
|
|
26
|
-
* Called when the client is reset.
|
|
27
|
-
*/
|
|
28
|
-
onReset?: (params: {
|
|
29
|
-
target?: string;
|
|
30
|
-
}) => Promise<void>;
|
|
31
|
-
};
|
|
32
|
-
export type ClientPluginProvides = IntentResolverProvides & GraphBuilderProvides & SurfaceProvides & TranslationsProvides & {
|
|
33
|
-
client: Client;
|
|
34
|
-
};
|
|
35
|
-
export declare const parseClientPlugin: (plugin?: Plugin) => Plugin<ClientPluginProvides> | undefined;
|
|
1
|
+
import { type PluginDefinition } from '@dxos/app-framework';
|
|
2
|
+
import { type ClientPluginOptions, type ClientPluginProvides } from './types';
|
|
36
3
|
export declare const ClientPlugin: ({ appKey, invitationUrl, invitationParam, onClientInitialized, onReady, onReset, ...options }: ClientPluginOptions) => PluginDefinition<Omit<ClientPluginProvides, "client">, Pick<ClientPluginProvides, "client">>;
|
|
37
4
|
//# sourceMappingURL=ClientPlugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientPlugin.d.ts","sourceRoot":"","sources":["../../../src/ClientPlugin.tsx"],"names":[],"mappings":"AAMA,OAAO,EAIL,KAAK,
|
|
1
|
+
{"version":3,"file":"ClientPlugin.d.ts","sourceRoot":"","sources":["../../../src/ClientPlugin.tsx"],"names":[],"mappings":"AAMA,OAAO,EAIL,KAAK,gBAAgB,EAItB,MAAM,qBAAqB,CAAC;AAoB7B,OAAO,EAAgB,KAAK,mBAAmB,EAAE,KAAK,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE5F,eAAO,MAAM,YAAY,kGAQtB,mBAAmB,KAAG,gBAAgB,CACvC,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAC,EACpC,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAC,CAoLrC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type IdentityPanelProps } from '@dxos/shell/react';
|
|
3
|
+
export declare const IDENTITY_DIALOG = "dxos.org/plugin/client/IdentityDialog";
|
|
3
4
|
export declare const IdentityDialog: (props: IdentityPanelProps) => React.JSX.Element;
|
|
4
5
|
//# sourceMappingURL=IdentityDialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdentityDialog.d.ts","sourceRoot":"","sources":["../../../../src/components/IdentityDialog.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAK3C,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"IdentityDialog.d.ts","sourceRoot":"","sources":["../../../../src/components/IdentityDialog.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAK3C,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAK3E,eAAO,MAAM,eAAe,0CAAoC,CAAC;AAEjE,eAAO,MAAM,cAAc,UAAW,kBAAkB,sBA4CvD,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type JoinPanelProps } from '@dxos/shell/react';
|
|
3
|
+
export declare const JOIN_DIALOG = "dxos.org/plugin/client/JoinDialog";
|
|
3
4
|
export declare const JoinDialog: (props: JoinPanelProps) => React.JSX.Element;
|
|
4
5
|
//# sourceMappingURL=JoinDialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JoinDialog.d.ts","sourceRoot":"","sources":["../../../../src/components/JoinDialog.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"JoinDialog.d.ts","sourceRoot":"","sources":["../../../../src/components/JoinDialog.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAM3C,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAKnE,eAAO,MAAM,WAAW,sCAAgC,CAAC;AAEzD,eAAO,MAAM,UAAU,UAAW,cAAc,sBAiC/C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecoveryCodeDialog.d.ts","sourceRoot":"","sources":["../../../../src/components/RecoveryCodeDialog.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAMrD,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,kBAAkB,aAAc,uBAAuB,sBAoCnE,CAAC"}
|
|
1
|
+
{"version":3,"file":"RecoveryCodeDialog.d.ts","sourceRoot":"","sources":["../../../../src/components/RecoveryCodeDialog.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAMrD,eAAO,MAAM,mBAAmB,8CAAwC,CAAC;AAEzE,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,kBAAkB,aAAc,uBAAuB,sBAoCnE,CAAC"}
|
package/dist/types/src/meta.d.ts
CHANGED
|
@@ -4,14 +4,4 @@ declare const _default: {
|
|
|
4
4
|
name: string;
|
|
5
5
|
};
|
|
6
6
|
export default _default;
|
|
7
|
-
export declare enum ClientAction {
|
|
8
|
-
CREATE_IDENTITY = "dxos.org/plugin/client/action/CREATE_IDENTITY",
|
|
9
|
-
JOIN_IDENTITY = "dxos.org/plugin/client/action/JOIN_IDENTITY",
|
|
10
|
-
SHARE_IDENTITY = "dxos.org/plugin/client/action/SHARE_IDENTITY",
|
|
11
|
-
RECOVER_IDENTITY = "dxos.org/plugin/client/action/RECOVER_IDENTITY",
|
|
12
|
-
RESET_STORAGE = "dxos.org/plugin/client/action/RESET_STORAGE",
|
|
13
|
-
CREATE_AGENT = "dxos.org/plugin/client/action/CREATE_AGENT",
|
|
14
|
-
CREATE_RECOVERY_CODE = "dxos.org/plugin/client/action/CREATE_RECOVERY_CODE"
|
|
15
|
-
}
|
|
16
|
-
export declare const OBSERVABILITY_ACTION = "dxos.org/plugin/observability/send-event";
|
|
17
7
|
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa,2BAA2B,CAAC;;;;;AAEtD,wBAGuB
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa,2BAA2B,CAAC;;;;;AAEtD,wBAGuB"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { type GraphBuilderProvides, type IntentResolverProvides, type Plugin, type SurfaceProvides, type TranslationsProvides } from '@dxos/app-framework';
|
|
2
|
+
import { S } from '@dxos/echo-schema';
|
|
3
|
+
import { Client, PublicKey, type ClientOptions } from '@dxos/react-client';
|
|
4
|
+
export declare namespace ClientAction {
|
|
5
|
+
const CreateIdentity_base: S.TaggedClass<CreateIdentity, "dxos.org/plugin/client/action/create-identity", {
|
|
6
|
+
readonly _tag: S.tag<"dxos.org/plugin/client/action/create-identity">;
|
|
7
|
+
} & {
|
|
8
|
+
input: S.Struct<{
|
|
9
|
+
displayName: S.optional<typeof S.String>;
|
|
10
|
+
}>;
|
|
11
|
+
output: S.Struct<{
|
|
12
|
+
identityKey: S.instanceOf<PublicKey>;
|
|
13
|
+
spaceKey: S.optional<S.instanceOf<PublicKey>>;
|
|
14
|
+
profile: S.optional<S.Struct<{
|
|
15
|
+
displayName: S.optional<typeof S.String>;
|
|
16
|
+
avatarCid: S.optional<typeof S.String>;
|
|
17
|
+
data: S.optional<S.Record$<typeof S.String, typeof S.Any>>;
|
|
18
|
+
}>>;
|
|
19
|
+
}>;
|
|
20
|
+
}>;
|
|
21
|
+
export class CreateIdentity extends CreateIdentity_base {
|
|
22
|
+
}
|
|
23
|
+
const JoinIdentity_base: S.TaggedClass<JoinIdentity, "dxos.org/plugin/client/action/join-identity", {
|
|
24
|
+
readonly _tag: S.tag<"dxos.org/plugin/client/action/join-identity">;
|
|
25
|
+
} & {
|
|
26
|
+
input: S.Struct<{
|
|
27
|
+
invitationCode: typeof S.String;
|
|
28
|
+
}>;
|
|
29
|
+
output: typeof S.Void;
|
|
30
|
+
}>;
|
|
31
|
+
export class JoinIdentity extends JoinIdentity_base {
|
|
32
|
+
}
|
|
33
|
+
const ShareIdentity_base: S.TaggedClass<ShareIdentity, "dxos.org/plugin/client/action/share-identity", {
|
|
34
|
+
readonly _tag: S.tag<"dxos.org/plugin/client/action/share-identity">;
|
|
35
|
+
} & {
|
|
36
|
+
input: typeof S.Void;
|
|
37
|
+
output: typeof S.Void;
|
|
38
|
+
}>;
|
|
39
|
+
export class ShareIdentity extends ShareIdentity_base {
|
|
40
|
+
}
|
|
41
|
+
const RecoverIdentity_base: S.TaggedClass<RecoverIdentity, "dxos.org/plugin/client/action/recover-identity", {
|
|
42
|
+
readonly _tag: S.tag<"dxos.org/plugin/client/action/recover-identity">;
|
|
43
|
+
} & {
|
|
44
|
+
input: typeof S.Void;
|
|
45
|
+
output: typeof S.Void;
|
|
46
|
+
}>;
|
|
47
|
+
export class RecoverIdentity extends RecoverIdentity_base {
|
|
48
|
+
}
|
|
49
|
+
const ResetStorage_base: S.TaggedClass<ResetStorage, "dxos.org/plugin/client/action/reset-storage", {
|
|
50
|
+
readonly _tag: S.tag<"dxos.org/plugin/client/action/reset-storage">;
|
|
51
|
+
} & {
|
|
52
|
+
input: S.Struct<{
|
|
53
|
+
target: S.optional<typeof S.String>;
|
|
54
|
+
}>;
|
|
55
|
+
output: typeof S.Void;
|
|
56
|
+
}>;
|
|
57
|
+
export class ResetStorage extends ResetStorage_base {
|
|
58
|
+
}
|
|
59
|
+
const CreateAgent_base: S.TaggedClass<CreateAgent, "dxos.org/plugin/client/action/create-agent", {
|
|
60
|
+
readonly _tag: S.tag<"dxos.org/plugin/client/action/create-agent">;
|
|
61
|
+
} & {
|
|
62
|
+
input: typeof S.Void;
|
|
63
|
+
output: typeof S.Void;
|
|
64
|
+
}>;
|
|
65
|
+
export class CreateAgent extends CreateAgent_base {
|
|
66
|
+
}
|
|
67
|
+
const CreateRecoveryCode_base: S.TaggedClass<CreateRecoveryCode, "dxos.org/plugin/client/action/create-recovery-code", {
|
|
68
|
+
readonly _tag: S.tag<"dxos.org/plugin/client/action/create-recovery-code">;
|
|
69
|
+
} & {
|
|
70
|
+
input: typeof S.Void;
|
|
71
|
+
output: typeof S.Void;
|
|
72
|
+
}>;
|
|
73
|
+
export class CreateRecoveryCode extends CreateRecoveryCode_base {
|
|
74
|
+
}
|
|
75
|
+
export {};
|
|
76
|
+
}
|
|
77
|
+
export type ClientPluginOptions = ClientOptions & {
|
|
78
|
+
/**
|
|
79
|
+
* Used to track app-specific state in spaces.
|
|
80
|
+
*/
|
|
81
|
+
appKey: string;
|
|
82
|
+
/**
|
|
83
|
+
* Base URL for the invitation link.
|
|
84
|
+
*/
|
|
85
|
+
invitationUrl?: string;
|
|
86
|
+
/**
|
|
87
|
+
* Query parameter for the invitation code.
|
|
88
|
+
*/
|
|
89
|
+
invitationParam?: string;
|
|
90
|
+
/**
|
|
91
|
+
* Run after the client has been initialized.
|
|
92
|
+
*/
|
|
93
|
+
onClientInitialized?: (client: Client) => Promise<void>;
|
|
94
|
+
/**
|
|
95
|
+
* Run after the identity has been successfully initialized.
|
|
96
|
+
* Run with client during plugin ready phase.
|
|
97
|
+
*/
|
|
98
|
+
onReady?: (client: Client, plugins: Plugin[]) => Promise<void>;
|
|
99
|
+
/**
|
|
100
|
+
* Called when the client is reset.
|
|
101
|
+
*/
|
|
102
|
+
onReset?: (params: {
|
|
103
|
+
target?: string;
|
|
104
|
+
}) => Promise<void>;
|
|
105
|
+
};
|
|
106
|
+
export type ClientPluginProvides = IntentResolverProvides & GraphBuilderProvides & SurfaceProvides & TranslationsProvides & {
|
|
107
|
+
client: Client;
|
|
108
|
+
};
|
|
109
|
+
export declare const parseClientPlugin: (plugin?: Plugin) => Plugin<ClientPluginProvides> | undefined;
|
|
110
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,MAAM,EACX,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAC1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAkB3E,yBAAiB,YAAY,CAAC;;;;;;;;;;;;;;;;;IAC5B,MAAM,OAAO,cAAe,SAAQ,mBAKlC;KAAG;;;;;;;;;IAEL,MAAM,OAAO,YAAa,SAAQ,iBAKhC;KAAG;;;;;;;IAEL,MAAM,OAAO,aAAc,SAAQ,kBAGjC;KAAG;;;;;;;IAEL,MAAM,OAAO,eAAgB,SAAQ,oBAGnC;KAAG;;;;;;;;;IAEL,MAAM,OAAO,YAAa,SAAQ,iBAKhC;KAAG;;;;;;;IAEL,MAAM,OAAO,WAAY,SAAQ,gBAG/B;KAAG;;;;;;;IAEL,MAAM,OAAO,kBAAmB,SAAQ,uBAGtC;KAAG;;CACN;AAED,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG;IAChD;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,mBAAmB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAExD;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/D;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1D,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,sBAAsB,GACvD,oBAAoB,GACpB,eAAe,GACf,oBAAoB,GAAG;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEJ,eAAO,MAAM,iBAAiB,YAAa,MAAM,6CAC0D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":"5.7.2"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-client",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.5-main.9cb18ac",
|
|
4
4
|
"description": "DXOS Surface plugin for DXOS Client",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
"types": "./dist/types/src/meta.d.ts",
|
|
18
18
|
"browser": "./dist/lib/browser/meta.mjs",
|
|
19
19
|
"node": "./dist/lib/node-esm/meta.mjs"
|
|
20
|
+
},
|
|
21
|
+
"./types": {
|
|
22
|
+
"types": "./dist/types/src/types.d.ts",
|
|
23
|
+
"browser": "./dist/lib/browser/types.mjs",
|
|
24
|
+
"node": "./dist/lib/node-esm/types.mjs"
|
|
20
25
|
}
|
|
21
26
|
},
|
|
22
27
|
"types": "dist/types/src/index.d.ts",
|
|
@@ -24,6 +29,9 @@
|
|
|
24
29
|
"*": {
|
|
25
30
|
"meta": [
|
|
26
31
|
"dist/types/src/meta.d.ts"
|
|
32
|
+
],
|
|
33
|
+
"types": [
|
|
34
|
+
"dist/types/src/types.d.ts"
|
|
27
35
|
]
|
|
28
36
|
}
|
|
29
37
|
},
|
|
@@ -33,17 +41,18 @@
|
|
|
33
41
|
],
|
|
34
42
|
"dependencies": {
|
|
35
43
|
"@phosphor-icons/react": "^2.1.5",
|
|
36
|
-
"@dxos/
|
|
37
|
-
"@dxos/echo-schema": "0.7.
|
|
38
|
-
"@dxos/echo-signals": "0.7.
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/local-storage": "0.7.
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/react-client": "0.7.
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
44
|
+
"@dxos/app-framework": "0.7.5-main.9cb18ac",
|
|
45
|
+
"@dxos/echo-schema": "0.7.5-main.9cb18ac",
|
|
46
|
+
"@dxos/echo-signals": "0.7.5-main.9cb18ac",
|
|
47
|
+
"@dxos/invariant": "0.7.5-main.9cb18ac",
|
|
48
|
+
"@dxos/local-storage": "0.7.5-main.9cb18ac",
|
|
49
|
+
"@dxos/config": "0.7.5-main.9cb18ac",
|
|
50
|
+
"@dxos/plugin-graph": "0.7.5-main.9cb18ac",
|
|
51
|
+
"@dxos/log": "0.7.5-main.9cb18ac",
|
|
52
|
+
"@dxos/react-client": "0.7.5-main.9cb18ac",
|
|
53
|
+
"@dxos/plugin-observability": "0.7.5-main.9cb18ac",
|
|
54
|
+
"@dxos/react-ui": "0.7.5-main.9cb18ac",
|
|
55
|
+
"@dxos/shell": "0.7.5-main.9cb18ac"
|
|
47
56
|
},
|
|
48
57
|
"devDependencies": {
|
|
49
58
|
"@types/react": "~18.2.0",
|
|
@@ -51,7 +60,7 @@
|
|
|
51
60
|
"react": "~18.2.0",
|
|
52
61
|
"react-dom": "~18.2.0",
|
|
53
62
|
"vite": "5.4.7",
|
|
54
|
-
"@dxos/storybook-utils": "0.7.
|
|
63
|
+
"@dxos/storybook-utils": "0.7.5-main.9cb18ac"
|
|
55
64
|
},
|
|
56
65
|
"peerDependencies": {
|
|
57
66
|
"@phosphor-icons/react": "^2.1.5",
|