@dxos/plugin-client 0.6.12-main.5cc132e → 0.6.12-main.78ddbdf

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.
@@ -5,7 +5,6 @@ import {
5
5
  } from "./chunk-3GFJ7SEI.mjs";
6
6
 
7
7
  // packages/plugins/plugin-client/src/ClientPlugin.tsx
8
- import { AddressBook } from "@phosphor-icons/react";
9
8
  import React from "react";
10
9
  import { filterPlugins, parseIntentPlugin, resolvePlugin } from "@dxos/app-framework";
11
10
  import { Config, Defaults, Envs, Local, Storage } from "@dxos/config";
@@ -71,7 +70,7 @@ var ClientPlugin = ({ appKey, onClientInitialized, onReady, ...options }) => {
71
70
  id: plugin.meta.id
72
71
  }, {
73
72
  F: __dxlog_file,
74
- L: 113,
73
+ L: 112,
75
74
  S: void 0,
76
75
  C: (f, a) => f(...a)
77
76
  });
@@ -108,8 +107,7 @@ var ClientPlugin = ({ appKey, onClientInitialized, onReady, ...options }) => {
108
107
  ns: CLIENT_PLUGIN
109
108
  }
110
109
  ],
111
- icon: (props) => /* @__PURE__ */ React.createElement(AddressBook, props),
112
- iconSymbol: "ph--address-book--regular",
110
+ icon: "ph--address-book--regular",
113
111
  keyBinding: {
114
112
  macos: "meta+shift+.",
115
113
  // TODO(wittjosiah): Test on windows to see if it behaves the same as linux.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/ClientPlugin.tsx", "../../../src/translations.ts", "../../../src/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { AddressBook, type IconProps } from '@phosphor-icons/react';\nimport React from 'react';\n\nimport {\n filterPlugins,\n parseIntentPlugin,\n resolvePlugin,\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 { type S } from '@dxos/echo-schema';\nimport { registerSignalRuntime } from '@dxos/echo-signals/react';\nimport { log } from '@dxos/log';\nimport { createExtension, type Node } from '@dxos/plugin-graph';\nimport { Client, type ClientOptions, ClientProvider } from '@dxos/react-client';\n\nimport meta, { CLIENT_PLUGIN, ClientAction } 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 * 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\nexport type ClientPluginProvides = IntentResolverProvides &\n GraphBuilderProvides &\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 type SchemaProvides = {\n echo: {\n schema: S.Schema<any>[];\n };\n};\n\nexport const parseSchemaPlugin = (plugin?: Plugin) =>\n Array.isArray((plugin?.provides as any).echo?.schema) ? (plugin as Plugin<SchemaProvides>) : undefined;\n\nexport const ClientPlugin = ({\n appKey,\n onClientInitialized,\n onReady,\n ...options\n}: ClientPluginOptions): PluginDefinition<\n Omit<ClientPluginProvides, 'client'>,\n Pick<ClientPluginProvides, 'client'>\n> => {\n registerSignalRuntime();\n\n let client: Client;\n let error: unknown = null;\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 filterPlugins(plugins, parseSchemaPlugin).forEach((plugin) => {\n log('ready', { id: plugin.meta.id });\n client.addTypes(plugin.provides.echo.schema);\n });\n },\n unload: async () => {\n await client.destroy();\n },\n provides: {\n translations,\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.OPEN_SHELL },\n ]);\n },\n properties: {\n label: ['open shell label', { ns: CLIENT_PLUGIN }],\n icon: (props: IconProps) => <AddressBook {...props} />,\n iconSymbol: '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.OPEN_SHELL:\n await client.shell.open(intent.data?.layout);\n return { data: true };\n\n case ClientAction.CREATE_IDENTITY: {\n const data = await client.halo.createIdentity();\n return {\n data,\n intents: [\n [\n {\n // NOTE: This action is hardcoded to avoid circular dependency with observability plugin.\n action: 'dxos.org/plugin/observability/send-event',\n data: {\n name: 'identity.created',\n },\n },\n ],\n ],\n };\n }\n\n case ClientAction.JOIN_IDENTITY: {\n const data = await client.shell.joinIdentity({ invitationCode: intent.data?.invitationCode });\n return {\n data,\n intents: [\n [\n {\n // NOTE: This action is hardcoded to avoid circular dependency with observability plugin.\n action: 'dxos.org/plugin/observability/send-event',\n data: {\n name: 'identity.joined',\n },\n },\n ],\n ],\n };\n }\n\n case ClientAction.SHARE_IDENTITY: {\n const data = await client.shell.shareIdentity();\n return {\n data,\n intents: [\n [\n {\n // NOTE: This action is hardcoded to avoid circular dependency with observability plugin.\n action: 'dxos.org/plugin/observability/send-event',\n data: {\n name: 'identity.shared',\n properties: {\n deviceKey: data.device?.deviceKey.truncate(),\n deviceKind: data.device?.kind,\n error: data.error?.message,\n canceled: data.cancelled,\n },\n },\n },\n ],\n ],\n };\n }\n }\n },\n },\n },\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 },\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": ";;;;;;;AAIA,SAASA,mBAAmC;AAC5C,OAAOC,WAAW;AAElB,SACEC,eACAC,mBACAC,qBAMK;AACP,SAASC,QAAQC,UAAUC,MAAMC,OAAOC,eAAe;AAEvD,SAASC,6BAA6B;AACtC,SAASC,WAAW;AACpB,SAASC,uBAAkC;AAC3C,SAASC,QAA4BC,sBAAsB;;;AChB3D,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACC,aAAAA,GAAgB;QACf,oBAAoB;MACtB;IACF;EACF;;;;;ADsCK,IAAMC,oBAAoB,CAACC,YAC/BA,QAAQC,UAAiBC,kBAAkBC,SAAUH,SAA0CI;AAQ3F,IAAMC,oBAAoB,CAACL,WAChCM,MAAMC,QAASP,QAAQC,SAAiBO,MAAMC,MAAAA,IAAWT,SAAoCI;AAExF,IAAMM,eAAe,CAAC,EAC3BC,QACAC,qBACAC,SACA,GAAGC,QAAAA,MACiB;AAIpBC,wBAAAA;AAEA,MAAIb;AACJ,MAAIc,QAAiB;AAErB,SAAO;IACLC;IACAC,YAAY,YAAA;AACV,YAAMC,SAAS,IAAIC,OAAO,MAAMC,QAAAA,GAAWC,KAAAA,GAAQC,MAAAA,G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AGN;YACF;UACF;QACF;MACF;IACF;EACF;AACF;;;AE3NA,IAAA,cAAeC;",
6
- "names": ["AddressBook", "React", "filterPlugins", "parseIntentPlugin", "resolvePlugin", "Config", "Defaults", "Envs", "Local", "Storage", "registerSignalRuntime", "log", "createExtension", "Client", "ClientProvider", "CLIENT_PLUGIN", "parseClientPlugin", "plugin", "provides", "client", "Client", "undefined", "parseSchemaPlugin", "Array", "isArray", "echo", "schema", "ClientPlugin", "appKey", "onClientInitialized", "onReady", "options", "registerSignalRuntime", "error", "meta", "initialize", "config", "Config", "Storage", "Envs", "Local", "Defaults", "reloaded", "on", "halo", "identity", "subscribe", "window", "location", "href", "origin", "err", "context", "children", "ClientProvider", "ready", "plugins", "filterPlugins", "forEach", "log", "id", "addTypes", "unload", "destroy", "translations", "graph", "builder", "intentPlugin", "resolvePlugin", "parseIntentPlugin", "CLIENT_PLUGIN", "createExtension", "filter", "node", "actions", "data", "intent", "dispatch", "action", "ClientAction", "OPEN_SHELL", "properties", "label", "ns", "icon", "props", "AddressBook", "iconSymbol", "keyBinding", "macos", "windows", "linux", "testId", "resolver", "shell", "open", "layout", "CREATE_IDENTITY", "createIdentity", "intents", "name", "JOIN_IDENTITY", "joinIdentity", "invitationCode", "SHARE_IDENTITY", "shareIdentity", "deviceKey", "device", "truncate", "deviceKind", "kind", "message", "canceled", "cancelled", "ClientPlugin"]
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport {\n filterPlugins,\n parseIntentPlugin,\n resolvePlugin,\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 { type S } from '@dxos/echo-schema';\nimport { registerSignalRuntime } from '@dxos/echo-signals/react';\nimport { log } from '@dxos/log';\nimport { createExtension, type Node } from '@dxos/plugin-graph';\nimport { Client, type ClientOptions, ClientProvider } from '@dxos/react-client';\n\nimport meta, { CLIENT_PLUGIN, ClientAction } 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 * 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\nexport type ClientPluginProvides = IntentResolverProvides &\n GraphBuilderProvides &\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 type SchemaProvides = {\n echo: {\n schema: S.Schema<any>[];\n };\n};\n\nexport const parseSchemaPlugin = (plugin?: Plugin) =>\n Array.isArray((plugin?.provides as any).echo?.schema) ? (plugin as Plugin<SchemaProvides>) : undefined;\n\nexport const ClientPlugin = ({\n appKey,\n onClientInitialized,\n onReady,\n ...options\n}: ClientPluginOptions): PluginDefinition<\n Omit<ClientPluginProvides, 'client'>,\n Pick<ClientPluginProvides, 'client'>\n> => {\n registerSignalRuntime();\n\n let client: Client;\n let error: unknown = null;\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 filterPlugins(plugins, parseSchemaPlugin).forEach((plugin) => {\n log('ready', { id: plugin.meta.id });\n client.addTypes(plugin.provides.echo.schema);\n });\n },\n unload: async () => {\n await client.destroy();\n },\n provides: {\n translations,\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.OPEN_SHELL },\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.OPEN_SHELL:\n await client.shell.open(intent.data?.layout);\n return { data: true };\n\n case ClientAction.CREATE_IDENTITY: {\n const data = await client.halo.createIdentity();\n return {\n data,\n intents: [\n [\n {\n // NOTE: This action is hardcoded to avoid circular dependency with observability plugin.\n action: 'dxos.org/plugin/observability/send-event',\n data: {\n name: 'identity.created',\n },\n },\n ],\n ],\n };\n }\n\n case ClientAction.JOIN_IDENTITY: {\n const data = await client.shell.joinIdentity({ invitationCode: intent.data?.invitationCode });\n return {\n data,\n intents: [\n [\n {\n // NOTE: This action is hardcoded to avoid circular dependency with observability plugin.\n action: 'dxos.org/plugin/observability/send-event',\n data: {\n name: 'identity.joined',\n },\n },\n ],\n ],\n };\n }\n\n case ClientAction.SHARE_IDENTITY: {\n const data = await client.shell.shareIdentity();\n return {\n data,\n intents: [\n [\n {\n // NOTE: This action is hardcoded to avoid circular dependency with observability plugin.\n action: 'dxos.org/plugin/observability/send-event',\n data: {\n name: 'identity.shared',\n properties: {\n deviceKey: data.device?.deviceKey.truncate(),\n deviceKind: data.device?.kind,\n error: data.error?.message,\n canceled: data.cancelled,\n },\n },\n },\n ],\n ],\n };\n }\n }\n },\n },\n },\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 },\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": ";;;;;;;AAIA,OAAOA,WAAW;AAElB,SACEC,eACAC,mBACAC,qBAMK;AACP,SAASC,QAAQC,UAAUC,MAAMC,OAAOC,eAAe;AAEvD,SAASC,6BAA6B;AACtC,SAASC,WAAW;AACpB,SAASC,uBAAkC;AAC3C,SAASC,QAA4BC,sBAAsB;;;ACf3D,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACC,aAAAA,GAAgB;QACf,oBAAoB;MACtB;IACF;EACF;;;;;ADqCK,IAAMC,oBAAoB,CAACC,YAC/BA,QAAQC,UAAiBC,kBAAkBC,SAAUH,SAA0CI;AAQ3F,IAAMC,oBAAoB,CAACL,WAChCM,MAAMC,QAASP,QAAQC,SAAiBO,MAAMC,MAAAA,IAAWT,SAAoCI;AAExF,IAAMM,eAAe,CAAC,EAC3BC,QACAC,qBACAC,SACA,GAAGC,QAAAA,MACiB;AAIpBC,wBAAAA;AAEA,MAAIb;AACJ,MAAIc,QAAiB;AAErB,SAAO;IACLC;IACAC,YAAY,YAAA;AACV,YAAMC,SAAS,IAAIC,OAAO,MAAMC,QAAAA,GAAWC,KAAAA,GAAQC,MAAAA,GAASC,SAAAA,CAAAA;AAC5DtB,eAAS,IAAIC,OAAO;QAAEgB;QAAQ,GAAGL;MAAQ,CAAA;AAEzC,UAAI;AACF,cAAMZ,OAAOgB,WAAU;AACvB,cAAMN,sBAAsBV,MAAAA;AAG5BA,eAAOuB,SAASC,GAA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ACF;MACAb,QAAQ;QACNc,UAAU,OAAOd,WAAAA;AACf,kBAAQA,OAAOE,QAAM;YACnB,KAAKC,aAAaC;AAChB,oBAAM7D,OAAOwE,MAAMC,KAAKhB,OAAOD,MAAMkB,MAAAA;AACrC,qBAAO;gBAAElB,MAAM;cAAK;YAEtB,KAAKI,aAAae,iBAAiB;AACjC,oBAAMnB,OAAO,MAAMxD,OAAOyB,KAAKmD,eAAc;AAC7C,qBAAO;gBACLpB;gBACAqB,SAAS;kBACP;oBACE;;sBAEElB,QAAQ;sBACRH,MAAM;wBACJsB,MAAM;sBACR;oBACF;;;cAGN;YACF;YAEA,KAAKlB,aAAamB,eAAe;AAC/B,oBAAMvB,OAAO,MAAMxD,OAAOwE,MAAMQ,aAAa;gBAAEC,gBAAgBxB,OAAOD,MAAMyB;cAAe,CAAA;AAC3F,qBAAO;gBACLzB;gBACAqB,SAAS;kBACP;oBACE;;sBAEElB,QAAQ;sBACRH,MAAM;wBACJsB,MAAM;sBACR;oBACF;;;cAGN;YACF;YAEA,KAAKlB,aAAasB,gBAAgB;AAChC,oBAAM1B,OAAO,MAAMxD,OAAOwE,MAAMW,cAAa;AAC7C,qBAAO;gBACL3B;gBACAqB,SAAS;kBACP;oBACE;;sBAEElB,QAAQ;sBACRH,MAAM;wBACJsB,MAAM;wBACNhB,YAAY;0BACVsB,WAAW5B,KAAK6B,QAAQD,UAAUE,SAAAA;0BAClCC,YAAY/B,KAAK6B,QAAQG;0BACzB1E,OAAO0C,KAAK1C,OAAO2E;0BACnBC,UAAUlC,KAAKmC;wBACjB;sBACF;oBACF;;;cAGN;YACF;UACF;QACF;MACF;IACF;EACF;AACF;;;AEzNA,IAAA,cAAeC;",
6
+ "names": ["React", "filterPlugins", "parseIntentPlugin", "resolvePlugin", "Config", "Defaults", "Envs", "Local", "Storage", "registerSignalRuntime", "log", "createExtension", "Client", "ClientProvider", "CLIENT_PLUGIN", "parseClientPlugin", "plugin", "provides", "client", "Client", "undefined", "parseSchemaPlugin", "Array", "isArray", "echo", "schema", "ClientPlugin", "appKey", "onClientInitialized", "onReady", "options", "registerSignalRuntime", "error", "meta", "initialize", "config", "Config", "Storage", "Envs", "Local", "Defaults", "reloaded", "on", "halo", "identity", "subscribe", "window", "location", "href", "origin", "err", "context", "children", "ClientProvider", "ready", "plugins", "filterPlugins", "forEach", "log", "id", "addTypes", "unload", "destroy", "translations", "graph", "builder", "intentPlugin", "resolvePlugin", "parseIntentPlugin", "CLIENT_PLUGIN", "createExtension", "filter", "node", "actions", "data", "intent", "dispatch", "action", "ClientAction", "OPEN_SHELL", "properties", "label", "ns", "icon", "keyBinding", "macos", "windows", "linux", "testId", "resolver", "shell", "open", "layout", "CREATE_IDENTITY", "createIdentity", "intents", "name", "JOIN_IDENTITY", "joinIdentity", "invitationCode", "SHARE_IDENTITY", "shareIdentity", "deviceKey", "device", "truncate", "deviceKind", "kind", "message", "canceled", "cancelled", "ClientPlugin"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"packages/plugins/plugin-client/src/meta.ts":{"bytes":2078,"imports":[],"format":"esm"},"packages/plugins/plugin-client/src/translations.ts":{"bytes":1043,"imports":[{"path":"packages/plugins/plugin-client/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-client/src/ClientPlugin.tsx":{"bytes":24772,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"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/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","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"},{"path":"packages/plugins/plugin-client/src/translations.ts","kind":"import-statement","original":"./translations"}],"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/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":12062},"packages/plugins/plugin-client/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/plugin-client/dist/lib/browser/chunk-3GFJ7SEI.mjs","kind":"import-statement"},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"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/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true}],"exports":["ClientPlugin","default","parseClientPlugin","parseSchemaPlugin"],"entryPoint":"packages/plugins/plugin-client/src/index.ts","inputs":{"packages/plugins/plugin-client/src/ClientPlugin.tsx":{"bytesInOutput":6102},"packages/plugins/plugin-client/src/translations.ts":{"bytesInOutput":134},"packages/plugins/plugin-client/src/index.ts":{"bytesInOutput":32}},"bytes":6701},"packages/plugins/plugin-client/dist/lib/browser/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-client/dist/lib/browser/meta.mjs":{"imports":[{"path":"packages/plugins/plugin-client/dist/lib/browser/chunk-3GFJ7SEI.mjs","kind":"import-statement"}],"exports":["CLIENT_PLUGIN","ClientAction","default"],"entryPoint":"packages/plugins/plugin-client/src/meta.ts","inputs":{},"bytes":193},"packages/plugins/plugin-client/dist/lib/browser/chunk-3GFJ7SEI.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":888},"packages/plugins/plugin-client/dist/lib/browser/chunk-3GFJ7SEI.mjs":{"imports":[],"exports":["CLIENT_PLUGIN","ClientAction","meta_default"],"inputs":{"packages/plugins/plugin-client/src/meta.ts":{"bytesInOutput":644}},"bytes":795}}}
1
+ {"inputs":{"packages/plugins/plugin-client/src/meta.ts":{"bytes":2078,"imports":[],"format":"esm"},"packages/plugins/plugin-client/src/translations.ts":{"bytes":1043,"imports":[{"path":"packages/plugins/plugin-client/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-client/src/ClientPlugin.tsx":{"bytes":24255,"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/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","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"},{"path":"packages/plugins/plugin-client/src/translations.ts","kind":"import-statement","original":"./translations"}],"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/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":11784},"packages/plugins/plugin-client/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/plugin-client/dist/lib/browser/chunk-3GFJ7SEI.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/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true}],"exports":["ClientPlugin","default","parseClientPlugin","parseSchemaPlugin"],"entryPoint":"packages/plugins/plugin-client/src/index.ts","inputs":{"packages/plugins/plugin-client/src/ClientPlugin.tsx":{"bytesInOutput":5951},"packages/plugins/plugin-client/src/translations.ts":{"bytesInOutput":134},"packages/plugins/plugin-client/src/index.ts":{"bytesInOutput":32}},"bytes":6550},"packages/plugins/plugin-client/dist/lib/browser/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-client/dist/lib/browser/meta.mjs":{"imports":[{"path":"packages/plugins/plugin-client/dist/lib/browser/chunk-3GFJ7SEI.mjs","kind":"import-statement"}],"exports":["CLIENT_PLUGIN","ClientAction","default"],"entryPoint":"packages/plugins/plugin-client/src/meta.ts","inputs":{},"bytes":193},"packages/plugins/plugin-client/dist/lib/browser/chunk-3GFJ7SEI.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":888},"packages/plugins/plugin-client/dist/lib/browser/chunk-3GFJ7SEI.mjs":{"imports":[],"exports":["CLIENT_PLUGIN","ClientAction","meta_default"],"inputs":{"packages/plugins/plugin-client/src/meta.ts":{"bytesInOutput":644}},"bytes":795}}}
@@ -35,11 +35,10 @@ __export(node_exports, {
35
35
  });
36
36
  module.exports = __toCommonJS(node_exports);
37
37
  var import_chunk_2E5ZNH3H = require("./chunk-2E5ZNH3H.cjs");
38
- var import_react = require("@phosphor-icons/react");
39
- var import_react2 = __toESM(require("react"));
38
+ var import_react = __toESM(require("react"));
40
39
  var import_app_framework = require("@dxos/app-framework");
41
40
  var import_config = require("@dxos/config");
42
- var import_react3 = require("@dxos/echo-signals/react");
41
+ var import_react2 = require("@dxos/echo-signals/react");
43
42
  var import_log = require("@dxos/log");
44
43
  var import_plugin_graph = require("@dxos/plugin-graph");
45
44
  var import_react_client = require("@dxos/react-client");
@@ -56,7 +55,7 @@ var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-client/s
56
55
  var parseClientPlugin = (plugin) => (plugin?.provides).client instanceof import_react_client.Client ? plugin : void 0;
57
56
  var parseSchemaPlugin = (plugin) => Array.isArray(plugin?.provides.echo?.schema) ? plugin : void 0;
58
57
  var ClientPlugin = ({ appKey, onClientInitialized, onReady, ...options }) => {
59
- (0, import_react3.registerSignalRuntime)();
58
+ (0, import_react2.registerSignalRuntime)();
60
59
  let client;
61
60
  let error = null;
62
61
  return {
@@ -82,7 +81,7 @@ var ClientPlugin = ({ appKey, onClientInitialized, onReady, ...options }) => {
82
81
  }
83
82
  return {
84
83
  client,
85
- context: ({ children }) => /* @__PURE__ */ import_react2.default.createElement(import_react_client.ClientProvider, {
84
+ context: ({ children }) => /* @__PURE__ */ import_react.default.createElement(import_react_client.ClientProvider, {
86
85
  client
87
86
  }, children)
88
87
  };
@@ -97,7 +96,7 @@ var ClientPlugin = ({ appKey, onClientInitialized, onReady, ...options }) => {
97
96
  id: plugin.meta.id
98
97
  }, {
99
98
  F: __dxlog_file,
100
- L: 113,
99
+ L: 112,
101
100
  S: void 0,
102
101
  C: (f, a) => f(...a)
103
102
  });
@@ -134,8 +133,7 @@ var ClientPlugin = ({ appKey, onClientInitialized, onReady, ...options }) => {
134
133
  ns: import_chunk_2E5ZNH3H.CLIENT_PLUGIN
135
134
  }
136
135
  ],
137
- icon: (props) => /* @__PURE__ */ import_react2.default.createElement(import_react.AddressBook, props),
138
- iconSymbol: "ph--address-book--regular",
136
+ icon: "ph--address-book--regular",
139
137
  keyBinding: {
140
138
  macos: "meta+shift+.",
141
139
  // TODO(wittjosiah): Test on windows to see if it behaves the same as linux.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/ClientPlugin.tsx", "../../../src/translations.ts", "../../../src/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { AddressBook, type IconProps } from '@phosphor-icons/react';\nimport React from 'react';\n\nimport {\n filterPlugins,\n parseIntentPlugin,\n resolvePlugin,\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 { type S } from '@dxos/echo-schema';\nimport { registerSignalRuntime } from '@dxos/echo-signals/react';\nimport { log } from '@dxos/log';\nimport { createExtension, type Node } from '@dxos/plugin-graph';\nimport { Client, type ClientOptions, ClientProvider } from '@dxos/react-client';\n\nimport meta, { CLIENT_PLUGIN, ClientAction } 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 * 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\nexport type ClientPluginProvides = IntentResolverProvides &\n GraphBuilderProvides &\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 type SchemaProvides = {\n echo: {\n schema: S.Schema<any>[];\n };\n};\n\nexport const parseSchemaPlugin = (plugin?: Plugin) =>\n Array.isArray((plugin?.provides as any).echo?.schema) ? (plugin as Plugin<SchemaProvides>) : undefined;\n\nexport const ClientPlugin = ({\n appKey,\n onClientInitialized,\n onReady,\n ...options\n}: ClientPluginOptions): PluginDefinition<\n Omit<ClientPluginProvides, 'client'>,\n Pick<ClientPluginProvides, 'client'>\n> => {\n registerSignalRuntime();\n\n let client: Client;\n let error: unknown = null;\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 filterPlugins(plugins, parseSchemaPlugin).forEach((plugin) => {\n log('ready', { id: plugin.meta.id });\n client.addTypes(plugin.provides.echo.schema);\n });\n },\n unload: async () => {\n await client.destroy();\n },\n provides: {\n translations,\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.OPEN_SHELL },\n ]);\n },\n properties: {\n label: ['open shell label', { ns: CLIENT_PLUGIN }],\n icon: (props: IconProps) => <AddressBook {...props} />,\n iconSymbol: '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.OPEN_SHELL:\n await client.shell.open(intent.data?.layout);\n return { data: true };\n\n case ClientAction.CREATE_IDENTITY: {\n const data = await client.halo.createIdentity();\n return {\n data,\n intents: [\n [\n {\n // NOTE: This action is hardcoded to avoid circular dependency with observability plugin.\n action: 'dxos.org/plugin/observability/send-event',\n data: {\n name: 'identity.created',\n },\n },\n ],\n ],\n };\n }\n\n case ClientAction.JOIN_IDENTITY: {\n const data = await client.shell.joinIdentity({ invitationCode: intent.data?.invitationCode });\n return {\n data,\n intents: [\n [\n {\n // NOTE: This action is hardcoded to avoid circular dependency with observability plugin.\n action: 'dxos.org/plugin/observability/send-event',\n data: {\n name: 'identity.joined',\n },\n },\n ],\n ],\n };\n }\n\n case ClientAction.SHARE_IDENTITY: {\n const data = await client.shell.shareIdentity();\n return {\n data,\n intents: [\n [\n {\n // NOTE: This action is hardcoded to avoid circular dependency with observability plugin.\n action: 'dxos.org/plugin/observability/send-event',\n data: {\n name: 'identity.shared',\n properties: {\n deviceKey: data.device?.deviceKey.truncate(),\n deviceKind: data.device?.kind,\n error: data.error?.message,\n canceled: data.cancelled,\n },\n },\n },\n ],\n ],\n };\n }\n }\n },\n },\n },\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 },\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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAA4C;AAC5C,IAAAA,gBAAkB;AAElB,2BASO;AACP,oBAAuD;AAEvD,IAAAA,gBAAsC;AACtC,iBAAoB;AACpB,0BAA2C;AAC3C,0BAA2D;AChB3D,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACC,mCAAAA,GAAgB;QACf,oBAAoB;MACtB;IACF;EACF;;;ADsCK,IAAMC,oBAAoB,CAACC,YAC/BA,QAAQC,UAAiBC,kBAAkBC,6BAAUH,SAA0CI;AAQ3F,IAAMC,oBAAoB,CAACL,WAChCM,MAAMC,QAASP,QAAQC,SAAiBO,MAAMC,MAAAA,IAAWT,SAAoCI;AAExF,IAAMM,eAAe,CAAC,EAC3BC,QACAC,qBACAC,SACA,GAAGC,QAAAA,MACiB;AAIpBC,2CAAAA;AAEA,MAAIb;AACJ,MAAIc,QAAiB;AAErB,SAAO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VyB,WAAW/B,KAAKgC,QAAQD,UAAUE,SAAAA;0BAClCC,YAAYlC,KAAKgC,QAAQG;0BACzB7E,OAAO0C,KAAK1C,OAAO8E;0BACnBC,UAAUrC,KAAKsC;wBACjB;sBACF;oBACF;;;cAGN;YACF;UACF;QACF;MACF;IACF;EACF;AACF;AE3NA,IAAA,cAAetF;",
6
- "names": ["import_react", "CLIENT_PLUGIN", "parseClientPlugin", "plugin", "provides", "client", "Client", "undefined", "parseSchemaPlugin", "Array", "isArray", "echo", "schema", "ClientPlugin", "appKey", "onClientInitialized", "onReady", "options", "registerSignalRuntime", "error", "meta", "initialize", "config", "Config", "Storage", "Envs", "Local", "Defaults", "reloaded", "on", "halo", "identity", "subscribe", "window", "location", "href", "origin", "err", "context", "children", "React", "ClientProvider", "ready", "plugins", "filterPlugins", "forEach", "log", "id", "addTypes", "unload", "destroy", "translations", "graph", "builder", "intentPlugin", "resolvePlugin", "parseIntentPlugin", "createExtension", "filter", "node", "actions", "data", "intent", "dispatch", "action", "ClientAction", "OPEN_SHELL", "properties", "label", "ns", "icon", "props", "AddressBook", "iconSymbol", "keyBinding", "macos", "windows", "linux", "testId", "resolver", "shell", "open", "layout", "CREATE_IDENTITY", "createIdentity", "intents", "name", "JOIN_IDENTITY", "joinIdentity", "invitationCode", "SHARE_IDENTITY", "shareIdentity", "deviceKey", "device", "truncate", "deviceKind", "kind", "message", "canceled", "cancelled"]
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport {\n filterPlugins,\n parseIntentPlugin,\n resolvePlugin,\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 { type S } from '@dxos/echo-schema';\nimport { registerSignalRuntime } from '@dxos/echo-signals/react';\nimport { log } from '@dxos/log';\nimport { createExtension, type Node } from '@dxos/plugin-graph';\nimport { Client, type ClientOptions, ClientProvider } from '@dxos/react-client';\n\nimport meta, { CLIENT_PLUGIN, ClientAction } 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 * 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\nexport type ClientPluginProvides = IntentResolverProvides &\n GraphBuilderProvides &\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 type SchemaProvides = {\n echo: {\n schema: S.Schema<any>[];\n };\n};\n\nexport const parseSchemaPlugin = (plugin?: Plugin) =>\n Array.isArray((plugin?.provides as any).echo?.schema) ? (plugin as Plugin<SchemaProvides>) : undefined;\n\nexport const ClientPlugin = ({\n appKey,\n onClientInitialized,\n onReady,\n ...options\n}: ClientPluginOptions): PluginDefinition<\n Omit<ClientPluginProvides, 'client'>,\n Pick<ClientPluginProvides, 'client'>\n> => {\n registerSignalRuntime();\n\n let client: Client;\n let error: unknown = null;\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 filterPlugins(plugins, parseSchemaPlugin).forEach((plugin) => {\n log('ready', { id: plugin.meta.id });\n client.addTypes(plugin.provides.echo.schema);\n });\n },\n unload: async () => {\n await client.destroy();\n },\n provides: {\n translations,\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.OPEN_SHELL },\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.OPEN_SHELL:\n await client.shell.open(intent.data?.layout);\n return { data: true };\n\n case ClientAction.CREATE_IDENTITY: {\n const data = await client.halo.createIdentity();\n return {\n data,\n intents: [\n [\n {\n // NOTE: This action is hardcoded to avoid circular dependency with observability plugin.\n action: 'dxos.org/plugin/observability/send-event',\n data: {\n name: 'identity.created',\n },\n },\n ],\n ],\n };\n }\n\n case ClientAction.JOIN_IDENTITY: {\n const data = await client.shell.joinIdentity({ invitationCode: intent.data?.invitationCode });\n return {\n data,\n intents: [\n [\n {\n // NOTE: This action is hardcoded to avoid circular dependency with observability plugin.\n action: 'dxos.org/plugin/observability/send-event',\n data: {\n name: 'identity.joined',\n },\n },\n ],\n ],\n };\n }\n\n case ClientAction.SHARE_IDENTITY: {\n const data = await client.shell.shareIdentity();\n return {\n data,\n intents: [\n [\n {\n // NOTE: This action is hardcoded to avoid circular dependency with observability plugin.\n action: 'dxos.org/plugin/observability/send-event',\n data: {\n name: 'identity.shared',\n properties: {\n deviceKey: data.device?.deviceKey.truncate(),\n deviceKind: data.device?.kind,\n error: data.error?.message,\n canceled: data.cancelled,\n },\n },\n },\n ],\n ],\n };\n }\n }\n },\n },\n },\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 },\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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAkB;AAElB,2BASO;AACP,oBAAuD;AAEvD,IAAAA,gBAAsC;AACtC,iBAAoB;AACpB,0BAA2C;AAC3C,0BAA2D;ACf3D,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACC,mCAAAA,GAAgB;QACf,oBAAoB;MACtB;IACF;EACF;;;ADqCK,IAAMC,oBAAoB,CAACC,YAC/BA,QAAQC,UAAiBC,kBAAkBC,6BAAUH,SAA0CI;AAQ3F,IAAMC,oBAAoB,CAACL,WAChCM,MAAMC,QAASP,QAAQC,SAAiBO,MAAMC,MAAAA,IAAWT,SAAoCI;AAExF,IAAMM,eAAe,CAAC,EAC3BC,QACAC,qBACAC,SACA,GAAGC,QAAAA,MACiB;AAIpBC,2CAAAA;AAEA,MAAIb;AACJ,MAAIc,QAAiB;AAErB,SAAO;IACLC,MAAAA;IACAC,YAAY,YAAA;AACV,YAAMC,SAAS,IAAIC,qBAAO,UAAMC,uBAAAA,OAAWC,oBAAAA,OAAQC,qBAAAA,OAASC,wBAAAA,CAAAA;AAC5DtB,eAAS,IAAIC,2BAAO;QAAEgB;QAAQ,GAAGL;MAAQ,CAAA;AAEzC,UAAI;AACF,cAAMZ,OAAOgB,WAAU;AACvB,cAAMN,sBAAsBV,MAAAA;AAG5BA,eAAOuB,SAASC,GAAG,MAAA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;UAEJ,CAAA;QACF;MACF;MACAb,QAAQ;QACNc,UAAU,OAAOd,WAAAA;AACf,kBAAQA,OAAOE,QAAM;YACnB,KAAKC,mCAAaC;AAChB,oBAAM7D,OAAOwE,MAAMC,KAAKhB,OAAOD,MAAMkB,MAAAA;AACrC,qBAAO;gBAAElB,MAAM;cAAK;YAEtB,KAAKI,mCAAae,iBAAiB;AACjC,oBAAMnB,OAAO,MAAMxD,OAAOyB,KAAKmD,eAAc;AAC7C,qBAAO;gBACLpB;gBACAqB,SAAS;kBACP;oBACE;;sBAEElB,QAAQ;sBACRH,MAAM;wBACJsB,MAAM;sBACR;oBACF;;;cAGN;YACF;YAEA,KAAKlB,mCAAamB,eAAe;AAC/B,oBAAMvB,OAAO,MAAMxD,OAAOwE,MAAMQ,aAAa;gBAAEC,gBAAgBxB,OAAOD,MAAMyB;cAAe,CAAA;AAC3F,qBAAO;gBACLzB;gBACAqB,SAAS;kBACP;oBACE;;sBAEElB,QAAQ;sBACRH,MAAM;wBACJsB,MAAM;sBACR;oBACF;;;cAGN;YACF;YAEA,KAAKlB,mCAAasB,gBAAgB;AAChC,oBAAM1B,OAAO,MAAMxD,OAAOwE,MAAMW,cAAa;AAC7C,qBAAO;gBACL3B;gBACAqB,SAAS;kBACP;oBACE;;sBAEElB,QAAQ;sBACRH,MAAM;wBACJsB,MAAM;wBACNhB,YAAY;0BACVsB,WAAW5B,KAAK6B,QAAQD,UAAUE,SAAAA;0BAClCC,YAAY/B,KAAK6B,QAAQG;0BACzB1E,OAAO0C,KAAK1C,OAAO2E;0BACnBC,UAAUlC,KAAKmC;wBACjB;sBACF;oBACF;;;cAGN;YACF;UACF;QACF;MACF;IACF;EACF;AACF;AEzNA,IAAA,cAAenF;",
6
+ "names": ["import_react", "CLIENT_PLUGIN", "parseClientPlugin", "plugin", "provides", "client", "Client", "undefined", "parseSchemaPlugin", "Array", "isArray", "echo", "schema", "ClientPlugin", "appKey", "onClientInitialized", "onReady", "options", "registerSignalRuntime", "error", "meta", "initialize", "config", "Config", "Storage", "Envs", "Local", "Defaults", "reloaded", "on", "halo", "identity", "subscribe", "window", "location", "href", "origin", "err", "context", "children", "React", "ClientProvider", "ready", "plugins", "filterPlugins", "forEach", "log", "id", "addTypes", "unload", "destroy", "translations", "graph", "builder", "intentPlugin", "resolvePlugin", "parseIntentPlugin", "createExtension", "filter", "node", "actions", "data", "intent", "dispatch", "action", "ClientAction", "OPEN_SHELL", "properties", "label", "ns", "icon", "keyBinding", "macos", "windows", "linux", "testId", "resolver", "shell", "open", "layout", "CREATE_IDENTITY", "createIdentity", "intents", "name", "JOIN_IDENTITY", "joinIdentity", "invitationCode", "SHARE_IDENTITY", "shareIdentity", "deviceKey", "device", "truncate", "deviceKind", "kind", "message", "canceled", "cancelled"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"packages/plugins/plugin-client/src/meta.ts":{"bytes":2078,"imports":[],"format":"esm"},"packages/plugins/plugin-client/src/translations.ts":{"bytes":1043,"imports":[{"path":"packages/plugins/plugin-client/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-client/src/ClientPlugin.tsx":{"bytes":24772,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"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/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","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"},{"path":"packages/plugins/plugin-client/src/translations.ts","kind":"import-statement","original":"./translations"}],"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/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":12062},"packages/plugins/plugin-client/dist/lib/node/index.cjs":{"imports":[{"path":"packages/plugins/plugin-client/dist/lib/node/chunk-2E5ZNH3H.cjs","kind":"import-statement"},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"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/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true}],"exports":["ClientPlugin","default","parseClientPlugin","parseSchemaPlugin"],"entryPoint":"packages/plugins/plugin-client/src/index.ts","inputs":{"packages/plugins/plugin-client/src/ClientPlugin.tsx":{"bytesInOutput":6102},"packages/plugins/plugin-client/src/translations.ts":{"bytesInOutput":134},"packages/plugins/plugin-client/src/index.ts":{"bytesInOutput":32}},"bytes":6701},"packages/plugins/plugin-client/dist/lib/node/meta.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-client/dist/lib/node/meta.cjs":{"imports":[{"path":"packages/plugins/plugin-client/dist/lib/node/chunk-2E5ZNH3H.cjs","kind":"import-statement"}],"exports":["CLIENT_PLUGIN","ClientAction","default"],"entryPoint":"packages/plugins/plugin-client/src/meta.ts","inputs":{},"bytes":193},"packages/plugins/plugin-client/dist/lib/node/chunk-2E5ZNH3H.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":888},"packages/plugins/plugin-client/dist/lib/node/chunk-2E5ZNH3H.cjs":{"imports":[],"exports":["CLIENT_PLUGIN","ClientAction","meta_default"],"inputs":{"packages/plugins/plugin-client/src/meta.ts":{"bytesInOutput":644}},"bytes":795}}}
1
+ {"inputs":{"packages/plugins/plugin-client/src/meta.ts":{"bytes":2078,"imports":[],"format":"esm"},"packages/plugins/plugin-client/src/translations.ts":{"bytes":1043,"imports":[{"path":"packages/plugins/plugin-client/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-client/src/ClientPlugin.tsx":{"bytes":24255,"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/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","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"},{"path":"packages/plugins/plugin-client/src/translations.ts","kind":"import-statement","original":"./translations"}],"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/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":11784},"packages/plugins/plugin-client/dist/lib/node/index.cjs":{"imports":[{"path":"packages/plugins/plugin-client/dist/lib/node/chunk-2E5ZNH3H.cjs","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/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true}],"exports":["ClientPlugin","default","parseClientPlugin","parseSchemaPlugin"],"entryPoint":"packages/plugins/plugin-client/src/index.ts","inputs":{"packages/plugins/plugin-client/src/ClientPlugin.tsx":{"bytesInOutput":5951},"packages/plugins/plugin-client/src/translations.ts":{"bytesInOutput":134},"packages/plugins/plugin-client/src/index.ts":{"bytesInOutput":32}},"bytes":6550},"packages/plugins/plugin-client/dist/lib/node/meta.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-client/dist/lib/node/meta.cjs":{"imports":[{"path":"packages/plugins/plugin-client/dist/lib/node/chunk-2E5ZNH3H.cjs","kind":"import-statement"}],"exports":["CLIENT_PLUGIN","ClientAction","default"],"entryPoint":"packages/plugins/plugin-client/src/meta.ts","inputs":{},"bytes":193},"packages/plugins/plugin-client/dist/lib/node/chunk-2E5ZNH3H.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":888},"packages/plugins/plugin-client/dist/lib/node/chunk-2E5ZNH3H.cjs":{"imports":[],"exports":["CLIENT_PLUGIN","ClientAction","meta_default"],"inputs":{"packages/plugins/plugin-client/src/meta.ts":{"bytesInOutput":644}},"bytes":795}}}
@@ -1,3 +1,5 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+
1
3
  // packages/plugins/plugin-client/src/meta.ts
2
4
  var CLIENT_PLUGIN = "dxos.org/plugin/client";
3
5
  var meta_default = {
@@ -18,4 +20,4 @@ export {
18
20
  meta_default,
19
21
  ClientAction
20
22
  };
21
- //# sourceMappingURL=chunk-3GFJ7SEI.mjs.map
23
+ //# sourceMappingURL=chunk-4KK5TTC6.mjs.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/meta.ts"],
4
4
  "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nexport const CLIENT_PLUGIN = 'dxos.org/plugin/client';\n\nexport default {\n id: CLIENT_PLUGIN,\n name: 'Client',\n};\n\nconst CLIENT_ACTION = `${CLIENT_PLUGIN}/action`;\nexport enum ClientAction {\n OPEN_SHELL = `${CLIENT_ACTION}/SHELL`,\n CREATE_IDENTITY = `${CLIENT_ACTION}/CREATE_IDENTITY`,\n JOIN_IDENTITY = `${CLIENT_ACTION}/JOIN_IDENTITY`,\n SHARE_IDENTITY = `${CLIENT_ACTION}/SHARE_IDENTITY`,\n}\n"],
5
- "mappings": ";AAIO,IAAMA,gBAAgB;AAE7B,IAAA,eAAe;EACbC,IAAID;EACJE,MAAM;AACR;AAEA,IAAMC,gBAAgB,GAAGH,aAAAA;;UACbI,eAAAA;8CACG,GAAGD,aAAAA,QAAqB,IAAA;mDACnB,GAAGA,aAAAA,kBAA+B,IAAA;iDACpC,GAAGA,aAAAA,gBAA6B,IAAA;kDAC/B,GAAGA,aAAAA,iBAA8B,IAAA;GAJxCC,iBAAAA,eAAAA,CAAAA,EAAAA;",
5
+ "mappings": ";;;AAIO,IAAMA,gBAAgB;AAE7B,IAAA,eAAe;EACbC,IAAID;EACJE,MAAM;AACR;AAEA,IAAMC,gBAAgB,GAAGH,aAAAA;;UACbI,eAAAA;8CACG,GAAGD,aAAAA,QAAqB,IAAA;mDACnB,GAAGA,aAAAA,kBAA+B,IAAA;iDACpC,GAAGA,aAAAA,gBAA6B,IAAA;kDAC/B,GAAGA,aAAAA,iBAA8B,IAAA;GAJxCC,iBAAAA,eAAAA,CAAAA,EAAAA;",
6
6
  "names": ["CLIENT_PLUGIN", "id", "name", "CLIENT_ACTION", "ClientAction"]
7
7
  }
@@ -1,11 +1,11 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
1
2
  import {
2
3
  CLIENT_PLUGIN,
3
4
  ClientAction,
4
5
  meta_default
5
- } from "./chunk-3GFJ7SEI.mjs";
6
+ } from "./chunk-4KK5TTC6.mjs";
6
7
 
7
8
  // packages/plugins/plugin-client/src/ClientPlugin.tsx
8
- import { AddressBook } from "@phosphor-icons/react";
9
9
  import React from "react";
10
10
  import { filterPlugins, parseIntentPlugin, resolvePlugin } from "@dxos/app-framework";
11
11
  import { Config, Defaults, Envs, Local, Storage } from "@dxos/config";
@@ -71,7 +71,7 @@ var ClientPlugin = ({ appKey, onClientInitialized, onReady, ...options }) => {
71
71
  id: plugin.meta.id
72
72
  }, {
73
73
  F: __dxlog_file,
74
- L: 113,
74
+ L: 112,
75
75
  S: void 0,
76
76
  C: (f, a) => f(...a)
77
77
  });
@@ -108,8 +108,7 @@ var ClientPlugin = ({ appKey, onClientInitialized, onReady, ...options }) => {
108
108
  ns: CLIENT_PLUGIN
109
109
  }
110
110
  ],
111
- icon: (props) => /* @__PURE__ */ React.createElement(AddressBook, props),
112
- iconSymbol: "ph--address-book--regular",
111
+ icon: "ph--address-book--regular",
113
112
  keyBinding: {
114
113
  macos: "meta+shift+.",
115
114
  // TODO(wittjosiah): Test on windows to see if it behaves the same as linux.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/ClientPlugin.tsx", "../../../src/translations.ts", "../../../src/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { AddressBook, type IconProps } from '@phosphor-icons/react';\nimport React from 'react';\n\nimport {\n filterPlugins,\n parseIntentPlugin,\n resolvePlugin,\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 { type S } from '@dxos/echo-schema';\nimport { registerSignalRuntime } from '@dxos/echo-signals/react';\nimport { log } from '@dxos/log';\nimport { createExtension, type Node } from '@dxos/plugin-graph';\nimport { Client, type ClientOptions, ClientProvider } from '@dxos/react-client';\n\nimport meta, { CLIENT_PLUGIN, ClientAction } 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 * 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\nexport type ClientPluginProvides = IntentResolverProvides &\n GraphBuilderProvides &\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 type SchemaProvides = {\n echo: {\n schema: S.Schema<any>[];\n };\n};\n\nexport const parseSchemaPlugin = (plugin?: Plugin) =>\n Array.isArray((plugin?.provides as any).echo?.schema) ? (plugin as Plugin<SchemaProvides>) : undefined;\n\nexport const ClientPlugin = ({\n appKey,\n onClientInitialized,\n onReady,\n ...options\n}: ClientPluginOptions): PluginDefinition<\n Omit<ClientPluginProvides, 'client'>,\n Pick<ClientPluginProvides, 'client'>\n> => {\n registerSignalRuntime();\n\n let client: Client;\n let error: unknown = null;\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 filterPlugins(plugins, parseSchemaPlugin).forEach((plugin) => {\n log('ready', { id: plugin.meta.id });\n client.addTypes(plugin.provides.echo.schema);\n });\n },\n unload: async () => {\n await client.destroy();\n },\n provides: {\n translations,\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.OPEN_SHELL },\n ]);\n },\n properties: {\n label: ['open shell label', { ns: CLIENT_PLUGIN }],\n icon: (props: IconProps) => <AddressBook {...props} />,\n iconSymbol: '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.OPEN_SHELL:\n await client.shell.open(intent.data?.layout);\n return { data: true };\n\n case ClientAction.CREATE_IDENTITY: {\n const data = await client.halo.createIdentity();\n return {\n data,\n intents: [\n [\n {\n // NOTE: This action is hardcoded to avoid circular dependency with observability plugin.\n action: 'dxos.org/plugin/observability/send-event',\n data: {\n name: 'identity.created',\n },\n },\n ],\n ],\n };\n }\n\n case ClientAction.JOIN_IDENTITY: {\n const data = await client.shell.joinIdentity({ invitationCode: intent.data?.invitationCode });\n return {\n data,\n intents: [\n [\n {\n // NOTE: This action is hardcoded to avoid circular dependency with observability plugin.\n action: 'dxos.org/plugin/observability/send-event',\n data: {\n name: 'identity.joined',\n },\n },\n ],\n ],\n };\n }\n\n case ClientAction.SHARE_IDENTITY: {\n const data = await client.shell.shareIdentity();\n return {\n data,\n intents: [\n [\n {\n // NOTE: This action is hardcoded to avoid circular dependency with observability plugin.\n action: 'dxos.org/plugin/observability/send-event',\n data: {\n name: 'identity.shared',\n properties: {\n deviceKey: data.device?.deviceKey.truncate(),\n deviceKind: data.device?.kind,\n error: data.error?.message,\n canceled: data.cancelled,\n },\n },\n },\n ],\n ],\n };\n }\n }\n },\n },\n },\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 },\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": ";;;;;;;AAIA,SAASA,mBAAmC;AAC5C,OAAOC,WAAW;AAElB,SACEC,eACAC,mBACAC,qBAMK;AACP,SAASC,QAAQC,UAAUC,MAAMC,OAAOC,eAAe;AAEvD,SAASC,6BAA6B;AACtC,SAASC,WAAW;AACpB,SAASC,uBAAkC;AAC3C,SAASC,QAA4BC,sBAAsB;;;AChB3D,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACC,aAAAA,GAAgB;QACf,oBAAoB;MACtB;IACF;EACF;;;;;ADsCK,IAAMC,oBAAoB,CAACC,YAC/BA,QAAQC,UAAiBC,kBAAkBC,SAAUH,SAA0CI;AAQ3F,IAAMC,oBAAoB,CAACL,WAChCM,MAAMC,QAASP,QAAQC,SAAiBO,MAAMC,MAAAA,IAAWT,SAAoCI;AAExF,IAAMM,eAAe,CAAC,EAC3BC,QACAC,qBACAC,SACA,GAAGC,QAAAA,MACiB;AAIpBC,wBAAAA;AAEA,MAAIb;AACJ,MAAIc,QAAiB;AAErB,SAAO;IACLC;IACAC,YAAY,YAAA;AACV,YAAMC,SAAS,IAAIC,OAAO,MAAMC,QAAAA,GAAWC,KAAAA,GAAQC,MAAAA,GAASC,SAAAA,CAAAA;AAC5DtB,eAAS,IAAIC,OAAO;QAAEgB;QAAQ,GAAGL;MAAQ,CAAA;AAEzC,UAAI;AACF,cAAMZ,OAAOgB,WAAU;AACvB,cAAMN,sBAAsBV,MAAAA;AAG5BA,eAAOuB,SAASC,GAAG,MAAA;AACjBxB,iBAAOyB,KAAKC,SAASC,UAAU,OAAOD,aAAAA;AACpC,gBAAIA,UAAU;AACZE,qBAAOC,SAASC,OAAOF,OAAOC,SAASE;YACzC;UACF,CAAA;QACF,CAAA;MACF,SAASC,KAAK;AACZlB,gBAAQkB;MACV;AAEA,aAAO;QACLhC;QACAiC,SAAS,CA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AAO;gBAAErB,MAAM;cAAK;YAEtB,KAAKI,aAAakB,iBAAiB;AACjC,oBAAMtB,OAAO,MAAMxD,OAAOyB,KAAKsD,eAAc;AAC7C,qBAAO;gBACLvB;gBACAwB,SAAS;kBACP;oBACE;;sBAEErB,QAAQ;sBACRH,MAAM;wBACJyB,MAAM;sBACR;oBACF;;;cAGN;YACF;YAEA,KAAKrB,aAAasB,eAAe;AAC/B,oBAAM1B,OAAO,MAAMxD,OAAO2E,MAAMQ,aAAa;gBAAEC,gBAAgB3B,OAAOD,MAAM4B;cAAe,CAAA;AAC3F,qBAAO;gBACL5B;gBACAwB,SAAS;kBACP;oBACE;;sBAEErB,QAAQ;sBACRH,MAAM;wBACJyB,MAAM;sBACR;oBACF;;;cAGN;YACF;YAEA,KAAKrB,aAAayB,gBAAgB;AAChC,oBAAM7B,OAAO,MAAMxD,OAAO2E,MAAMW,cAAa;AAC7C,qBAAO;gBACL9B;gBACAwB,SAAS;kBACP;oBACE;;sBAEErB,QAAQ;sBACRH,MAAM;wBACJyB,MAAM;wBACNnB,YAAY;0BACVyB,WAAW/B,KAAKgC,QAAQD,UAAUE,SAAAA;0BAClCC,YAAYlC,KAAKgC,QAAQG;0BACzB7E,OAAO0C,KAAK1C,OAAO8E;0BACnBC,UAAUrC,KAAKsC;wBACjB;sBACF;oBACF;;;cAGN;YACF;UACF;QACF;MACF;IACF;EACF;AACF;;;AE3NA,IAAA,cAAeC;",
6
- "names": ["AddressBook", "React", "filterPlugins", "parseIntentPlugin", "resolvePlugin", "Config", "Defaults", "Envs", "Local", "Storage", "registerSignalRuntime", "log", "createExtension", "Client", "ClientProvider", "CLIENT_PLUGIN", "parseClientPlugin", "plugin", "provides", "client", "Client", "undefined", "parseSchemaPlugin", "Array", "isArray", "echo", "schema", "ClientPlugin", "appKey", "onClientInitialized", "onReady", "options", "registerSignalRuntime", "error", "meta", "initialize", "config", "Config", "Storage", "Envs", "Local", "Defaults", "reloaded", "on", "halo", "identity", "subscribe", "window", "location", "href", "origin", "err", "context", "children", "ClientProvider", "ready", "plugins", "filterPlugins", "forEach", "log", "id", "addTypes", "unload", "destroy", "translations", "graph", "builder", "intentPlugin", "resolvePlugin", "parseIntentPlugin", "CLIENT_PLUGIN", "createExtension", "filter", "node", "actions", "data", "intent", "dispatch", "action", "ClientAction", "OPEN_SHELL", "properties", "label", "ns", "icon", "props", "AddressBook", "iconSymbol", "keyBinding", "macos", "windows", "linux", "testId", "resolver", "shell", "open", "layout", "CREATE_IDENTITY", "createIdentity", "intents", "name", "JOIN_IDENTITY", "joinIdentity", "invitationCode", "SHARE_IDENTITY", "shareIdentity", "deviceKey", "device", "truncate", "deviceKind", "kind", "message", "canceled", "cancelled", "ClientPlugin"]
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport {\n filterPlugins,\n parseIntentPlugin,\n resolvePlugin,\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 { type S } from '@dxos/echo-schema';\nimport { registerSignalRuntime } from '@dxos/echo-signals/react';\nimport { log } from '@dxos/log';\nimport { createExtension, type Node } from '@dxos/plugin-graph';\nimport { Client, type ClientOptions, ClientProvider } from '@dxos/react-client';\n\nimport meta, { CLIENT_PLUGIN, ClientAction } 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 * 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\nexport type ClientPluginProvides = IntentResolverProvides &\n GraphBuilderProvides &\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 type SchemaProvides = {\n echo: {\n schema: S.Schema<any>[];\n };\n};\n\nexport const parseSchemaPlugin = (plugin?: Plugin) =>\n Array.isArray((plugin?.provides as any).echo?.schema) ? (plugin as Plugin<SchemaProvides>) : undefined;\n\nexport const ClientPlugin = ({\n appKey,\n onClientInitialized,\n onReady,\n ...options\n}: ClientPluginOptions): PluginDefinition<\n Omit<ClientPluginProvides, 'client'>,\n Pick<ClientPluginProvides, 'client'>\n> => {\n registerSignalRuntime();\n\n let client: Client;\n let error: unknown = null;\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 filterPlugins(plugins, parseSchemaPlugin).forEach((plugin) => {\n log('ready', { id: plugin.meta.id });\n client.addTypes(plugin.provides.echo.schema);\n });\n },\n unload: async () => {\n await client.destroy();\n },\n provides: {\n translations,\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.OPEN_SHELL },\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.OPEN_SHELL:\n await client.shell.open(intent.data?.layout);\n return { data: true };\n\n case ClientAction.CREATE_IDENTITY: {\n const data = await client.halo.createIdentity();\n return {\n data,\n intents: [\n [\n {\n // NOTE: This action is hardcoded to avoid circular dependency with observability plugin.\n action: 'dxos.org/plugin/observability/send-event',\n data: {\n name: 'identity.created',\n },\n },\n ],\n ],\n };\n }\n\n case ClientAction.JOIN_IDENTITY: {\n const data = await client.shell.joinIdentity({ invitationCode: intent.data?.invitationCode });\n return {\n data,\n intents: [\n [\n {\n // NOTE: This action is hardcoded to avoid circular dependency with observability plugin.\n action: 'dxos.org/plugin/observability/send-event',\n data: {\n name: 'identity.joined',\n },\n },\n ],\n ],\n };\n }\n\n case ClientAction.SHARE_IDENTITY: {\n const data = await client.shell.shareIdentity();\n return {\n data,\n intents: [\n [\n {\n // NOTE: This action is hardcoded to avoid circular dependency with observability plugin.\n action: 'dxos.org/plugin/observability/send-event',\n data: {\n name: 'identity.shared',\n properties: {\n deviceKey: data.device?.deviceKey.truncate(),\n deviceKind: data.device?.kind,\n error: data.error?.message,\n canceled: data.cancelled,\n },\n },\n },\n ],\n ],\n };\n }\n }\n },\n },\n },\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 },\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": ";;;;;;;;AAIA,OAAOA,WAAW;AAElB,SACEC,eACAC,mBACAC,qB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AAamB,eAAe;AAC/B,oBAAMvB,OAAO,MAAMxD,OAAOwE,MAAMQ,aAAa;gBAAEC,gBAAgBxB,OAAOD,MAAMyB;cAAe,CAAA;AAC3F,qBAAO;gBACLzB;gBACAqB,SAAS;kBACP;oBACE;;sBAEElB,QAAQ;sBACRH,MAAM;wBACJsB,MAAM;sBACR;oBACF;;;cAGN;YACF;YAEA,KAAKlB,aAAasB,gBAAgB;AAChC,oBAAM1B,OAAO,MAAMxD,OAAOwE,MAAMW,cAAa;AAC7C,qBAAO;gBACL3B;gBACAqB,SAAS;kBACP;oBACE;;sBAEElB,QAAQ;sBACRH,MAAM;wBACJsB,MAAM;wBACNhB,YAAY;0BACVsB,WAAW5B,KAAK6B,QAAQD,UAAUE,SAAAA;0BAClCC,YAAY/B,KAAK6B,QAAQG;0BACzB1E,OAAO0C,KAAK1C,OAAO2E;0BACnBC,UAAUlC,KAAKmC;wBACjB;sBACF;oBACF;;;cAGN;YACF;UACF;QACF;MACF;IACF;EACF;AACF;;;AEzNA,IAAA,cAAeC;",
6
+ "names": ["React", "filterPlugins", "parseIntentPlugin", "resolvePlugin", "Config", "Defaults", "Envs", "Local", "Storage", "registerSignalRuntime", "log", "createExtension", "Client", "ClientProvider", "CLIENT_PLUGIN", "parseClientPlugin", "plugin", "provides", "client", "Client", "undefined", "parseSchemaPlugin", "Array", "isArray", "echo", "schema", "ClientPlugin", "appKey", "onClientInitialized", "onReady", "options", "registerSignalRuntime", "error", "meta", "initialize", "config", "Config", "Storage", "Envs", "Local", "Defaults", "reloaded", "on", "halo", "identity", "subscribe", "window", "location", "href", "origin", "err", "context", "children", "ClientProvider", "ready", "plugins", "filterPlugins", "forEach", "log", "id", "addTypes", "unload", "destroy", "translations", "graph", "builder", "intentPlugin", "resolvePlugin", "parseIntentPlugin", "CLIENT_PLUGIN", "createExtension", "filter", "node", "actions", "data", "intent", "dispatch", "action", "ClientAction", "OPEN_SHELL", "properties", "label", "ns", "icon", "keyBinding", "macos", "windows", "linux", "testId", "resolver", "shell", "open", "layout", "CREATE_IDENTITY", "createIdentity", "intents", "name", "JOIN_IDENTITY", "joinIdentity", "invitationCode", "SHARE_IDENTITY", "shareIdentity", "deviceKey", "device", "truncate", "deviceKind", "kind", "message", "canceled", "cancelled", "ClientPlugin"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"packages/plugins/plugin-client/src/meta.ts":{"bytes":2078,"imports":[],"format":"esm"},"packages/plugins/plugin-client/src/translations.ts":{"bytes":1043,"imports":[{"path":"packages/plugins/plugin-client/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-client/src/ClientPlugin.tsx":{"bytes":24772,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"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/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","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"},{"path":"packages/plugins/plugin-client/src/translations.ts","kind":"import-statement","original":"./translations"}],"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":12062},"packages/plugins/plugin-client/dist/lib/node-esm/index.mjs":{"imports":[{"path":"packages/plugins/plugin-client/dist/lib/node-esm/chunk-3GFJ7SEI.mjs","kind":"import-statement"},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"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/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true}],"exports":["ClientPlugin","default","parseClientPlugin","parseSchemaPlugin"],"entryPoint":"packages/plugins/plugin-client/src/index.ts","inputs":{"packages/plugins/plugin-client/src/ClientPlugin.tsx":{"bytesInOutput":6102},"packages/plugins/plugin-client/src/translations.ts":{"bytesInOutput":134},"packages/plugins/plugin-client/src/index.ts":{"bytesInOutput":32}},"bytes":6701},"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-3GFJ7SEI.mjs","kind":"import-statement"}],"exports":["CLIENT_PLUGIN","ClientAction","default"],"entryPoint":"packages/plugins/plugin-client/src/meta.ts","inputs":{},"bytes":193},"packages/plugins/plugin-client/dist/lib/node-esm/chunk-3GFJ7SEI.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":888},"packages/plugins/plugin-client/dist/lib/node-esm/chunk-3GFJ7SEI.mjs":{"imports":[],"exports":["CLIENT_PLUGIN","ClientAction","meta_default"],"inputs":{"packages/plugins/plugin-client/src/meta.ts":{"bytesInOutput":644}},"bytes":795}}}
1
+ {"inputs":{"packages/plugins/plugin-client/src/meta.ts":{"bytes":2078,"imports":[],"format":"esm"},"packages/plugins/plugin-client/src/translations.ts":{"bytes":1043,"imports":[{"path":"packages/plugins/plugin-client/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-client/src/ClientPlugin.tsx":{"bytes":24255,"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/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","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"},{"path":"packages/plugins/plugin-client/src/translations.ts","kind":"import-statement","original":"./translations"}],"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":11785},"packages/plugins/plugin-client/dist/lib/node-esm/index.mjs":{"imports":[{"path":"packages/plugins/plugin-client/dist/lib/node-esm/chunk-4KK5TTC6.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/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true}],"exports":["ClientPlugin","default","parseClientPlugin","parseSchemaPlugin"],"entryPoint":"packages/plugins/plugin-client/src/index.ts","inputs":{"packages/plugins/plugin-client/src/ClientPlugin.tsx":{"bytesInOutput":5951},"packages/plugins/plugin-client/src/translations.ts":{"bytesInOutput":134},"packages/plugins/plugin-client/src/index.ts":{"bytesInOutput":32}},"bytes":6642},"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-4KK5TTC6.mjs","kind":"import-statement"}],"exports":["CLIENT_PLUGIN","ClientAction","default"],"entryPoint":"packages/plugins/plugin-client/src/meta.ts","inputs":{},"bytes":285},"packages/plugins/plugin-client/dist/lib/node-esm/chunk-4KK5TTC6.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":890},"packages/plugins/plugin-client/dist/lib/node-esm/chunk-4KK5TTC6.mjs":{"imports":[],"exports":["CLIENT_PLUGIN","ClientAction","meta_default"],"inputs":{"packages/plugins/plugin-client/src/meta.ts":{"bytesInOutput":644}},"bytes":888}}}
@@ -1,8 +1,9 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
1
2
  import {
2
3
  CLIENT_PLUGIN,
3
4
  ClientAction,
4
5
  meta_default
5
- } from "./chunk-3GFJ7SEI.mjs";
6
+ } from "./chunk-4KK5TTC6.mjs";
6
7
  export {
7
8
  CLIENT_PLUGIN,
8
9
  ClientAction,
@@ -1 +1 @@
1
- {"version":3,"file":"ClientPlugin.d.ts","sourceRoot":"","sources":["../../../src/ClientPlugin.tsx"],"names":[],"mappings":"AAOA,OAAO,EAIL,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,MAAM,EACX,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EAC1B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAI3C,OAAO,EAAE,MAAM,EAAE,KAAK,aAAa,EAAkB,MAAM,oBAAoB,CAAC;AAKhF,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG;IAChD;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;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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AAC,IAAI,CAAC,CAAC;CAChE,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,sBAAsB,GACvD,oBAAoB,GACpB,oBAAoB,GAAG;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEJ,eAAO,MAAM,iBAAiB,YAAa,MAAM,6CAC0D,CAAC;AAE5G,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE;QACJ,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;KACzB,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,iBAAiB,YAAa,MAAM,uCACuD,CAAC;AAEzG,eAAO,MAAM,YAAY,yDAKtB,mBAAmB,KAAG,gBAAgB,CACvC,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAC,EACpC,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAC,CA0JrC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-client",
3
- "version": "0.6.12-main.5cc132e",
3
+ "version": "0.6.12-main.78ddbdf",
4
4
  "description": "DXOS Surface plugin for DXOS Client",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -38,16 +38,16 @@
38
38
  ],
39
39
  "dependencies": {
40
40
  "@phosphor-icons/react": "^2.1.5",
41
- "@dxos/app-framework": "0.6.12-main.5cc132e",
42
- "@dxos/config": "0.6.12-main.5cc132e",
43
- "@dxos/echo-schema": "0.6.12-main.5cc132e",
44
- "@dxos/echo-signals": "0.6.12-main.5cc132e",
45
- "@dxos/invariant": "0.6.12-main.5cc132e",
46
- "@dxos/local-storage": "0.6.12-main.5cc132e",
47
- "@dxos/react-client": "0.6.12-main.5cc132e",
48
- "@dxos/react-ui": "0.6.12-main.5cc132e",
49
- "@dxos/log": "0.6.12-main.5cc132e",
50
- "@dxos/plugin-graph": "0.6.12-main.5cc132e"
41
+ "@dxos/app-framework": "0.6.12-main.78ddbdf",
42
+ "@dxos/echo-schema": "0.6.12-main.78ddbdf",
43
+ "@dxos/echo-signals": "0.6.12-main.78ddbdf",
44
+ "@dxos/invariant": "0.6.12-main.78ddbdf",
45
+ "@dxos/log": "0.6.12-main.78ddbdf",
46
+ "@dxos/config": "0.6.12-main.78ddbdf",
47
+ "@dxos/local-storage": "0.6.12-main.78ddbdf",
48
+ "@dxos/plugin-graph": "0.6.12-main.78ddbdf",
49
+ "@dxos/react-client": "0.6.12-main.78ddbdf",
50
+ "@dxos/react-ui": "0.6.12-main.78ddbdf"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/react": "~18.2.0",
@@ -55,11 +55,11 @@
55
55
  "react": "~18.2.0",
56
56
  "react-dom": "~18.2.0",
57
57
  "vite": "5.4.7",
58
- "@dxos/storybook-utils": "0.6.12-main.5cc132e"
58
+ "@dxos/storybook-utils": "0.6.12-main.78ddbdf"
59
59
  },
60
60
  "peerDependencies": {
61
- "react": "^18.0.0",
62
- "react-dom": "^18.0.0"
61
+ "react": "~18.2.0",
62
+ "react-dom": "~18.2.0"
63
63
  },
64
64
  "publishConfig": {
65
65
  "access": "public"
@@ -2,7 +2,6 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { AddressBook, type IconProps } from '@phosphor-icons/react';
6
5
  import React from 'react';
7
6
 
8
7
  import {
@@ -137,8 +136,7 @@ export const ClientPlugin = ({
137
136
  },
138
137
  properties: {
139
138
  label: ['open shell label', { ns: CLIENT_PLUGIN }],
140
- icon: (props: IconProps) => <AddressBook {...props} />,
141
- iconSymbol: 'ph--address-book--regular',
139
+ icon: 'ph--address-book--regular',
142
140
  keyBinding: {
143
141
  macos: 'meta+shift+.',
144
142
  // TODO(wittjosiah): Test on windows to see if it behaves the same as linux.