@dxos/app-framework 0.4.8-main.ec0899a → 0.4.8-next.fff1521
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/index.mjs +12 -11
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{plugin-FYTGDFFS.mjs → plugin-KEA4MEHK.mjs} +3 -3
- package/dist/lib/browser/plugin-KEA4MEHK.mjs.map +7 -0
- package/dist/lib/browser/{plugin-6XDXQ3BN.mjs → plugin-VCIF47DJ.mjs} +5 -5
- package/dist/lib/browser/plugin-VCIF47DJ.mjs.map +7 -0
- package/dist/lib/node/index.cjs +43 -42
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{plugin-VEIZZVQP.cjs → plugin-3K3YXM6Z.cjs} +8 -8
- package/dist/lib/node/plugin-3K3YXM6Z.cjs.map +7 -0
- package/dist/lib/node/{plugin-ZJ26B7E5.cjs → plugin-ROMMITVM.cjs} +10 -10
- package/dist/lib/node/plugin-ROMMITVM.cjs.map +7 -0
- package/dist/types/src/plugins/PluginHost/PluginHost.d.ts.map +1 -1
- package/dist/types/src/plugins/SurfacePlugin/plugin.d.ts.map +1 -1
- package/dist/types/src/plugins/common/file.d.ts +1 -0
- package/dist/types/src/plugins/common/file.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/plugins/IntentPlugin/plugin.tsx +2 -2
- package/src/plugins/PluginHost/PluginHost.tsx +5 -5
- package/src/plugins/SurfacePlugin/plugin.tsx +6 -7
- package/src/plugins/common/file.ts +4 -1
- package/tsconfig.json +3 -0
- package/dist/lib/browser/plugin-6XDXQ3BN.mjs.map +0 -7
- package/dist/lib/browser/plugin-FYTGDFFS.mjs.map +0 -7
- package/dist/lib/node/plugin-VEIZZVQP.cjs.map +0 -7
- package/dist/lib/node/plugin-ZJ26B7E5.cjs.map +0 -7
package/dist/lib/node/index.cjs
CHANGED
|
@@ -86,21 +86,21 @@ var import_zod = require("zod");
|
|
|
86
86
|
var import_zod2 = require("zod");
|
|
87
87
|
var import_zod3 = require("zod");
|
|
88
88
|
var import_react = require("react");
|
|
89
|
-
var import_react2 = require("
|
|
90
|
-
var import_react3 = __toESM(require("react"));
|
|
89
|
+
var import_react2 = __toESM(require("react"));
|
|
91
90
|
var import_local_storage = require("@dxos/local-storage");
|
|
92
91
|
var import_log = require("@dxos/log");
|
|
92
|
+
var import_react3 = __toESM(require("react"));
|
|
93
93
|
var import_react4 = __toESM(require("react"));
|
|
94
|
-
var import_react5 =
|
|
95
|
-
var import_react6 = require("react");
|
|
94
|
+
var import_react5 = require("react");
|
|
96
95
|
var import_debug = require("@dxos/debug");
|
|
97
|
-
var
|
|
96
|
+
var import_react6 = __toESM(require("react"));
|
|
98
97
|
var import_invariant = require("@dxos/invariant");
|
|
99
98
|
var defaultFileTypes = {
|
|
100
99
|
images: [
|
|
101
100
|
"png",
|
|
102
101
|
"jpg",
|
|
103
|
-
"jpeg"
|
|
102
|
+
"jpeg",
|
|
103
|
+
"gif"
|
|
104
104
|
],
|
|
105
105
|
media: [
|
|
106
106
|
"mp3",
|
|
@@ -219,7 +219,7 @@ var useResolvePlugin = (predicate) => {
|
|
|
219
219
|
};
|
|
220
220
|
var PluginProvider = PluginContext.Provider;
|
|
221
221
|
var isObject = (data) => !!data && typeof data === "object";
|
|
222
|
-
var ErrorBoundary = class extends
|
|
222
|
+
var ErrorBoundary = class extends import_react3.Component {
|
|
223
223
|
constructor(props) {
|
|
224
224
|
super(props);
|
|
225
225
|
this.state = {
|
|
@@ -238,7 +238,7 @@ var ErrorBoundary = class extends import_react4.Component {
|
|
|
238
238
|
}
|
|
239
239
|
render() {
|
|
240
240
|
if (this.state.error) {
|
|
241
|
-
return /* @__PURE__ */
|
|
241
|
+
return /* @__PURE__ */ import_react3.default.createElement(this.props.fallback, {
|
|
242
242
|
error: this.state.error,
|
|
243
243
|
reset: this.resetError
|
|
244
244
|
});
|
|
@@ -251,32 +251,32 @@ var ErrorBoundary = class extends import_react4.Component {
|
|
|
251
251
|
});
|
|
252
252
|
}
|
|
253
253
|
};
|
|
254
|
-
var Surface = /* @__PURE__ */ (0,
|
|
254
|
+
var Surface = /* @__PURE__ */ (0, import_react4.forwardRef)(({ role, name = role, fallback, placeholder, ...rest }, forwardedRef) => {
|
|
255
255
|
const props = {
|
|
256
256
|
role,
|
|
257
257
|
name,
|
|
258
258
|
fallback,
|
|
259
259
|
...rest
|
|
260
260
|
};
|
|
261
|
-
const context = (0,
|
|
261
|
+
const context = (0, import_react5.useContext)(SurfaceContext);
|
|
262
262
|
const data = props.data ?? (name && context?.surfaces?.[name]?.data || {});
|
|
263
|
-
const resolver = /* @__PURE__ */
|
|
263
|
+
const resolver = /* @__PURE__ */ import_react4.default.createElement(SurfaceResolver, {
|
|
264
264
|
...props,
|
|
265
265
|
ref: forwardedRef
|
|
266
266
|
});
|
|
267
|
-
const suspense = placeholder ? /* @__PURE__ */
|
|
267
|
+
const suspense = placeholder ? /* @__PURE__ */ import_react4.default.createElement(import_react4.Suspense, {
|
|
268
268
|
fallback: placeholder
|
|
269
269
|
}, resolver) : resolver;
|
|
270
|
-
return fallback ? /* @__PURE__ */
|
|
270
|
+
return fallback ? /* @__PURE__ */ import_react4.default.createElement(ErrorBoundary, {
|
|
271
271
|
data,
|
|
272
272
|
fallback
|
|
273
273
|
}, suspense) : suspense;
|
|
274
274
|
});
|
|
275
|
-
var SurfaceContext = /* @__PURE__ */ (0,
|
|
276
|
-
var useSurface = () => (0,
|
|
277
|
-
var SurfaceResolver = /* @__PURE__ */ (0,
|
|
275
|
+
var SurfaceContext = /* @__PURE__ */ (0, import_react5.createContext)(null);
|
|
276
|
+
var useSurface = () => (0, import_react5.useContext)(SurfaceContext) ?? (0, import_debug.raise)(new Error("Surface context not found"));
|
|
277
|
+
var SurfaceResolver = /* @__PURE__ */ (0, import_react4.forwardRef)((props, forwardedRef) => {
|
|
278
278
|
const { components } = (0, import_chunk_BTZLKXA2.useSurfaceRoot)();
|
|
279
|
-
const parent = (0,
|
|
279
|
+
const parent = (0, import_react5.useContext)(SurfaceContext);
|
|
280
280
|
const nodes = resolveNodes(components, props, parent, forwardedRef);
|
|
281
281
|
const currentContext = {
|
|
282
282
|
...props,
|
|
@@ -285,7 +285,7 @@ var SurfaceResolver = /* @__PURE__ */ (0, import_react5.forwardRef)((props, forw
|
|
|
285
285
|
...props.surfaces
|
|
286
286
|
}
|
|
287
287
|
};
|
|
288
|
-
return /* @__PURE__ */
|
|
288
|
+
return /* @__PURE__ */ import_react4.default.createElement(SurfaceContext.Provider, {
|
|
289
289
|
value: currentContext
|
|
290
290
|
}, nodes);
|
|
291
291
|
});
|
|
@@ -305,7 +305,7 @@ var resolveNodes = (components, props, context, forwardedRef) => {
|
|
|
305
305
|
return "node" in result ? [
|
|
306
306
|
key,
|
|
307
307
|
result
|
|
308
|
-
] : /* @__PURE__ */ (0,
|
|
308
|
+
] : /* @__PURE__ */ (0, import_react4.isValidElement)(result) ? [
|
|
309
309
|
key,
|
|
310
310
|
{
|
|
311
311
|
node: result
|
|
@@ -322,7 +322,7 @@ var resolveNodes = (components, props, context, forwardedRef) => {
|
|
|
322
322
|
return 1;
|
|
323
323
|
}
|
|
324
324
|
return 0;
|
|
325
|
-
}).map(([key, result]) => /* @__PURE__ */
|
|
325
|
+
}).map(([key, result]) => /* @__PURE__ */ import_react4.default.createElement(import_react4.Fragment, {
|
|
326
326
|
key
|
|
327
327
|
}, result.node));
|
|
328
328
|
return props.limit ? nodes.slice(0, props.limit) : nodes;
|
|
@@ -340,16 +340,17 @@ var PluginHost = ({ order, plugins: definitions, core = [], defaults = [], fallb
|
|
|
340
340
|
available: order.filter(({ id }) => !core.includes(id)),
|
|
341
341
|
setPlugin: (id, enabled) => {
|
|
342
342
|
if (enabled) {
|
|
343
|
-
state.values.enabled
|
|
344
|
-
...state.values.enabled,
|
|
345
|
-
id
|
|
346
|
-
];
|
|
343
|
+
state.values.enabled.push(id);
|
|
347
344
|
} else {
|
|
348
|
-
|
|
345
|
+
const index = state.values.enabled.findIndex((enabled2) => enabled2 === id);
|
|
346
|
+
index !== -1 && state.values.enabled.splice(index, 1);
|
|
349
347
|
}
|
|
350
348
|
}
|
|
351
349
|
});
|
|
352
|
-
state.prop(
|
|
350
|
+
state.prop({
|
|
351
|
+
key: "enabled",
|
|
352
|
+
type: import_local_storage.LocalStorageStore.json()
|
|
353
|
+
});
|
|
353
354
|
return {
|
|
354
355
|
meta: {
|
|
355
356
|
id: PLUGIN_HOST,
|
|
@@ -357,13 +358,13 @@ var PluginHost = ({ order, plugins: definitions, core = [], defaults = [], fallb
|
|
|
357
358
|
},
|
|
358
359
|
provides: {
|
|
359
360
|
plugins: state.values,
|
|
360
|
-
context: ({ children }) => /* @__PURE__ */
|
|
361
|
+
context: ({ children }) => /* @__PURE__ */ import_react2.default.createElement(PluginProvider, {
|
|
361
362
|
value: state.values
|
|
362
363
|
}, children),
|
|
363
364
|
root: () => {
|
|
364
|
-
return /* @__PURE__ */
|
|
365
|
+
return /* @__PURE__ */ import_react2.default.createElement(ErrorBoundary, {
|
|
365
366
|
fallback
|
|
366
|
-
}, /* @__PURE__ */
|
|
367
|
+
}, /* @__PURE__ */ import_react2.default.createElement(Root, {
|
|
367
368
|
order,
|
|
368
369
|
core,
|
|
369
370
|
definitions,
|
|
@@ -375,21 +376,21 @@ var PluginHost = ({ order, plugins: definitions, core = [], defaults = [], fallb
|
|
|
375
376
|
};
|
|
376
377
|
};
|
|
377
378
|
var DefaultFallback = ({ error }) => {
|
|
378
|
-
return /* @__PURE__ */
|
|
379
|
+
return /* @__PURE__ */ import_react2.default.createElement("div", {
|
|
379
380
|
style: {
|
|
380
381
|
padding: "1rem"
|
|
381
382
|
}
|
|
382
|
-
}, /* @__PURE__ */
|
|
383
|
+
}, /* @__PURE__ */ import_react2.default.createElement("h1", {
|
|
383
384
|
style: {
|
|
384
385
|
fontSize: "1.2rem",
|
|
385
386
|
fontWeight: 700,
|
|
386
387
|
margin: "0.5rem 0"
|
|
387
388
|
}
|
|
388
|
-
}, error.message), /* @__PURE__ */
|
|
389
|
+
}, error.message), /* @__PURE__ */ import_react2.default.createElement("pre", null, error.stack));
|
|
389
390
|
};
|
|
390
391
|
var Root = ({ order, core: corePluginIds, definitions, state, placeholder }) => {
|
|
391
|
-
const [error, setError] = (0,
|
|
392
|
-
(0,
|
|
392
|
+
const [error, setError] = (0, import_react2.useState)();
|
|
393
|
+
(0, import_react2.useEffect)(() => {
|
|
393
394
|
(0, import_log.log)("initializing plugins", {
|
|
394
395
|
enabled: state.enabled
|
|
395
396
|
}, {
|
|
@@ -441,7 +442,7 @@ var Root = ({ order, core: corePluginIds, definitions, state, placeholder }) =>
|
|
|
441
442
|
S: void 0,
|
|
442
443
|
C: (f, a) => f(...a)
|
|
443
444
|
});
|
|
444
|
-
state.plugins =
|
|
445
|
+
state.plugins = plugins;
|
|
445
446
|
state.ready = true;
|
|
446
447
|
} catch (err) {
|
|
447
448
|
setError(err);
|
|
@@ -456,10 +457,10 @@ var Root = ({ order, core: corePluginIds, definitions, state, placeholder }) =>
|
|
|
456
457
|
throw error;
|
|
457
458
|
}
|
|
458
459
|
if (!state.ready) {
|
|
459
|
-
return /* @__PURE__ */
|
|
460
|
+
return /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, placeholder);
|
|
460
461
|
}
|
|
461
462
|
const ComposedContext = composeContext(state.plugins);
|
|
462
|
-
return /* @__PURE__ */
|
|
463
|
+
return /* @__PURE__ */ import_react2.default.createElement(ComposedContext, null, rootComponents(state.plugins));
|
|
463
464
|
};
|
|
464
465
|
var initializePlugin = async (pluginDefinition) => {
|
|
465
466
|
const provides = await pluginDefinition.initialize?.();
|
|
@@ -475,7 +476,7 @@ var rootComponents = (plugins) => {
|
|
|
475
476
|
return plugins.map((plugin) => {
|
|
476
477
|
const Component2 = plugin.provides.root;
|
|
477
478
|
if (Component2) {
|
|
478
|
-
return /* @__PURE__ */
|
|
479
|
+
return /* @__PURE__ */ import_react2.default.createElement(Component2, {
|
|
479
480
|
key: plugin.meta.id
|
|
480
481
|
});
|
|
481
482
|
} else {
|
|
@@ -489,7 +490,7 @@ var composeContext = (plugins) => {
|
|
|
489
490
|
var compose = (contexts) => {
|
|
490
491
|
return [
|
|
491
492
|
...contexts
|
|
492
|
-
].reduce((Acc, Next) => ({ children }) => /* @__PURE__ */
|
|
493
|
+
].reduce((Acc, Next) => ({ children }) => /* @__PURE__ */ import_react2.default.createElement(Acc, null, /* @__PURE__ */ import_react2.default.createElement(Next, null, children)));
|
|
493
494
|
};
|
|
494
495
|
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/app-framework/src/App.tsx";
|
|
495
496
|
var createApp = ({ order, plugins, core = order.map(({ id }) => id), ...params }) => {
|
|
@@ -501,8 +502,8 @@ var createApp = ({ order, plugins, core = order.map(({ id }) => id), ...params }
|
|
|
501
502
|
],
|
|
502
503
|
plugins: {
|
|
503
504
|
...plugins,
|
|
504
|
-
[import_chunk_BTZLKXA2.meta_default.id]: Plugin.lazy(() => import("./plugin-
|
|
505
|
-
[import_chunk_DFST5IG5.meta_default.id]: Plugin.lazy(() => import("./plugin-
|
|
505
|
+
[import_chunk_BTZLKXA2.meta_default.id]: Plugin.lazy(() => import("./plugin-ROMMITVM.cjs")),
|
|
506
|
+
[import_chunk_DFST5IG5.meta_default.id]: Plugin.lazy(() => import("./plugin-3K3YXM6Z.cjs"))
|
|
506
507
|
},
|
|
507
508
|
core: [
|
|
508
509
|
import_chunk_BTZLKXA2.meta_default.id,
|
|
@@ -531,7 +532,7 @@ var createApp = ({ order, plugins, core = order.map(({ id }) => id), ...params }
|
|
|
531
532
|
});
|
|
532
533
|
const Context = host.provides.context;
|
|
533
534
|
const Root2 = host.provides.root;
|
|
534
|
-
return () => /* @__PURE__ */
|
|
535
|
+
return () => /* @__PURE__ */ import_react6.default.createElement(Context, null, /* @__PURE__ */ import_react6.default.createElement(Root2, null));
|
|
535
536
|
};
|
|
536
537
|
// Annotate the CommonJS export names for ESM import in node:
|
|
537
538
|
0 && (module.exports = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/plugins/common/file.ts", "../../../src/plugins/common/graph.ts", "../../../src/plugins/common/layout.ts", "../../../src/plugins/common/metadata.ts", "../../../src/plugins/common/navigation.ts", "../../../src/plugins/common/settings.ts", "../../../src/plugins/common/translations.ts", "../../../src/plugins/PluginHost/plugin.ts", "../../../src/plugins/PluginHost/PluginContext.tsx", "../../../src/plugins/PluginHost/PluginHost.tsx", "../../../src/plugins/SurfacePlugin/helpers.ts", "../../../src/plugins/SurfacePlugin/ErrorBoundary.tsx", "../../../src/plugins/SurfacePlugin/Surface.tsx", "../../../src/App.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { type Plugin } from '../PluginHost';\n\nexport const defaultFileTypes = {\n images: ['png', 'jpg', 'jpeg'],\n media: ['mp3', 'mp4', 'mov', 'avi'],\n text: ['pdf', 'txt', 'md'],\n};\n\nexport type FileInfo = {\n cid?: string; // TODO(burdon): Meta key? Or other common properties with other file management system?\n};\n\nexport type FileUploader = (file: File) => Promise<FileInfo | undefined>;\n\nexport type FileManagerProvides = {\n file: {\n upload?: FileUploader;\n };\n};\n\n// TODO(burdon): Better match against interface? and Return provided service type. What if multiple?\nexport const parseFileManagerPlugin = (plugin: Plugin) => {\n return (plugin.provides as any).file ? (plugin as Plugin<FileManagerProvides>) : undefined;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { Graph } from '@dxos/app-graph';\nimport type { UnsubscribeCallback } from '@dxos/async';\n\nimport type { Plugin } from '../PluginHost';\n\n/**\n * Provides for a plugin that exposes the application graph.\n */\nexport type GraphProvides = {\n graph: Graph;\n};\n\nexport type GraphBuilderProvides = {\n graph: {\n builder: (plugins: Plugin[], graph: Graph) => UnsubscribeCallback | void;\n };\n};\n\n/**\n * Type guard for graph plugins.\n */\nexport const parseGraphPlugin = (plugin: Plugin) =>\n (plugin.provides as any).graph?.root ? (plugin as Plugin<GraphProvides>) : undefined;\n\n/**\n * Type guard for graph builder plugins.\n */\nexport const parseGraphBuilderPlugin = (plugin: Plugin) =>\n (plugin.provides as any).graph?.builder ? (plugin as Plugin<GraphBuilderProvides>) : undefined;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { z } from 'zod';\n\nimport { type IntentData } from '../IntentPlugin';\nimport type { Plugin } from '../PluginHost';\n\n//\n// Provides\n//\n\nexport const Toast = z.object({\n id: z.string(),\n title: z.string().optional(),\n description: z.string().optional(),\n // TODO(wittjosiah): `icon` should be string to be parsed by an `Icon` component.\n icon: z.any().optional(),\n duration: z.number().optional(),\n closeLabel: z.string().optional(),\n actionLabel: z.string().optional(),\n actionAlt: z.string().optional(),\n onAction: z.function().optional(),\n});\n\nexport type Toast = z.infer<typeof Toast>;\n\n/**\n * Basic state provided by a layout plugin.\n *\n * Layout provides the state of global UI landmarks, such as the sidebar, dialog, and popover.\n * Generally only one dialog or popover should be open at a time, a layout plugin should manage this.\n * For other landmarks, such as toasts, rendering them in the layout prevents them from unmounting when navigating.\n */\n// TODO(wittjosiah): Replace Zod w/ Effect Schema to align with ECHO.\nexport const Layout = z.object({\n fullscreen: z.boolean(),\n sidebarOpen: z.boolean(),\n\n complementarySidebarOpen: z.boolean(),\n complementarySidebarContent: z.any().optional().describe('Data to be passed to the complementary sidebar Surface.'),\n\n dialogOpen: z.boolean(),\n dialogContent: z.any().optional().describe('Data to be passed to the dialog Surface.'),\n\n popoverOpen: z.boolean(),\n popoverContent: z.any().optional().describe('Data to be passed to the popover Surface.'),\n popoverAnchorId: z.string().optional(),\n\n toasts: z.array(Toast),\n});\n\nexport type Layout = z.infer<typeof Layout>;\n\n/**\n * Provides for a plugin that can manage the app layout.\n */\nexport type LayoutProvides = {\n layout: Readonly<Layout>;\n};\n\n/**\n * Type guard for layout plugins.\n */\nexport const parseLayoutPlugin = (plugin: Plugin) => {\n const { success } = Layout.safeParse((plugin.provides as any).layout);\n return success ? (plugin as Plugin<LayoutProvides>) : undefined;\n};\n\n//\n// Intents\n//\n\nconst LAYOUT_ACTION = 'dxos.org/plugin/layout';\nexport enum LayoutAction {\n SET_LAYOUT = `${LAYOUT_ACTION}/set-layout`,\n\n /** @deprecated */\n // TODO(wittjosiah): At minimum this should be renamed, \"focus\" means something very specific on a web page.\n // Consider removing this action entirely, it's maybe not generic enough to live here.\n FOCUS = `${LAYOUT_ACTION}/focus`,\n}\n\n/**\n * Expected payload for layout actions.\n */\nexport namespace LayoutAction {\n export type SetLayout = IntentData<{\n /**\n * Element to set the state of.\n */\n element: 'fullscreen' | 'sidebar' | 'complementary' | 'dialog' | 'popover' | 'toast';\n\n /**\n * Whether the element is on or off.\n *\n * If omitted, the element's state will be toggled or set based on other provided data.\n * For example, if `component` is provided, the state will be set to `true`.\n */\n state?: boolean;\n\n /**\n * Component to render in the dialog or popover.\n */\n component?: string;\n\n /**\n * Data to be passed to the dialog or popover Surface.\n */\n subject?: any;\n\n /**\n * Anchor ID for the popover.\n */\n anchorId?: string;\n }>;\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '../PluginHost';\n\nexport type Metadata = Record<string, any>;\n\nexport type MetadataRecordsProvides = {\n metadata: {\n records: Record<string, Metadata>;\n };\n};\n\nexport type MetadataResolver = (type: string) => Metadata;\n\nexport type MetadataResolverProvides = {\n metadata: {\n resolver: MetadataResolver;\n };\n};\n\nexport const parseMetadataRecordsPlugin = (plugin: Plugin) => {\n return (plugin.provides as any).metadata?.records ? (plugin as Plugin<MetadataRecordsProvides>) : undefined;\n};\n\nexport const parseMetadataResolverPlugin = (plugin: Plugin) => {\n return (plugin.provides as any).metadata?.resolver ? (plugin as Plugin<MetadataResolverProvides>) : undefined;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { z } from 'zod';\n\nimport type { IntentData } from '../IntentPlugin';\nimport type { Plugin } from '../PluginHost';\n\n//\n// Provides\n//\n\n/**\n * Basic state provided by a navigation plugin.\n */\n// TODO(wittjosiah): Replace Zod w/ Effect Schema to align with ECHO.\n// TODO(wittjosiah): We should align this more with `window.location` along the lines of what React Router does.\nexport const Location = z.object({\n active: z.string().optional().describe('Id of the currently active item.'),\n // TODO(wittjosiah): History?\n previous: z.string().optional(),\n});\n\nexport type Location = z.infer<typeof Location>;\n\n/**\n * Provides for a plugin that can manage the app navigation.\n */\nexport type LocationProvides = {\n location: Readonly<Location>;\n};\n\n/**\n * Type guard for layout plugins.\n */\nexport const parseNavigationPlugin = (plugin: Plugin) => {\n const { success } = Location.safeParse((plugin.provides as any).location);\n return success ? (plugin as Plugin<LocationProvides>) : undefined;\n};\n\n//\n// Intents\n//\n\nconst NAVIGATION_ACTION = 'dxos.org/plugin/navigation';\nexport enum NavigationAction {\n ACTIVATE = `${NAVIGATION_ACTION}/activate`,\n}\n\n/**\n * Expected payload for navigation actions.\n */\nexport namespace NavigationAction {\n export type Activate = IntentData<{\n /**\n * Id to set as active.\n */\n id: string;\n\n /**\n * Location of the active item.\n * Defaults to 'main'.\n */\n key?: string;\n }>;\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '../PluginHost';\n\n// TODO(burdon): Plugins should export ts-effect object (see local-storage).\n// TODO(burdon): Auto generate form.\n// TODO(burdon): Set surface's data.type to plugin id (allow custom settings surface).\n\nexport type SettingsProvides<T extends Record<string, any> = Record<string, any>> = {\n settings: T; // TODO(burdon): Read-only.\n};\n\nexport const parseSettingsPlugin = (plugin: Plugin) => {\n return typeof (plugin.provides as any).settings === 'object' ? (plugin as Plugin<SettingsProvides>) : undefined;\n};\n\nconst SETTINGS_ACTION = 'dxos.org/plugin/settings';\nexport enum SettingsAction {\n OPEN = `${SETTINGS_ACTION}/open`,\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { z } from 'zod';\n\nimport type { Plugin } from '../PluginHost';\n\nexport const ResourceKey = z.union([z.string(), z.record(z.any())]);\nexport type ResourceKey = z.infer<typeof ResourceKey>;\n\nexport const ResourceLanguage = z.record(ResourceKey);\nexport type ResourceLanguage = z.infer<typeof ResourceLanguage>;\n\n/**\n * A resource is a collection of translations for a language.\n */\nexport const Resource = z.record(ResourceLanguage);\nexport type Resource = z.infer<typeof Resource>;\n\n/**\n * Provides for a plugin that exposes translations.\n */\n// TODO(wittjosiah): Rename to TranslationResourcesProvides.\nexport type TranslationsProvides = {\n translations: Readonly<Resource[]>;\n};\n\n// TODO(wittjosiah): Add TranslationsProvides.\n// export type TranslationsProvides = {\n// translations: {\n// t: TFunction;\n// };\n// };\n\n/**\n * Type guard for translation plugins.\n */\nexport const parseTranslationsPlugin = (plugin: Plugin) => {\n const { success } = z.array(Resource).safeParse((plugin.provides as any).translations);\n return success ? (plugin as Plugin<TranslationsProvides>) : undefined;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { IconProps } from '@phosphor-icons/react';\nimport type { FC, PropsWithChildren } from 'react';\n\n/**\n * Capabilities provided by a plugin.\n * The base surface capabilities are always included.\n */\nexport type PluginProvides<TProvides> = TProvides & {\n /**\n * React Context which is wrapped around the application to enable any hooks the plugin may provide.\n */\n context?: FC<PropsWithChildren>;\n\n /*\n * React component which is rendered at the root of the application.\n */\n root?: FC<PropsWithChildren>;\n};\n\n/**\n * A unit of containment of modular functionality that can be provided to an application.\n * Plugins provide things like components, state, actions, etc. to the application.\n */\nexport type Plugin<TProvides = {}> = {\n meta: {\n /**\n * Globally unique ID.\n *\n * Expected to be in the form of a valid URL.\n *\n * @example dxos.org/plugin/example\n */\n id: string;\n\n /**\n * Short ID for use in URLs.\n *\n * NOTE: This is especially experimental and likely to change.\n */\n // TODO(wittjosiah): How should these be managed?\n shortId?: string;\n\n /**\n * Human-readable name.\n */\n name?: string;\n\n /**\n * Short description of plugin functionality.\n */\n description?: string;\n\n /**\n * URL of home page.\n */\n homePage?: string;\n\n /**\n * Tags to help categorize the plugin.\n */\n tags?: string[];\n\n /**\n * Component to render icon for the plugin when displayed in a list.\n */\n // TODO(wittjosiah): Convert to `icon` and make serializable.\n iconComponent?: FC<IconProps>;\n };\n\n /**\n * Capabilities provided by the plugin.\n */\n provides: PluginProvides<TProvides>;\n};\n\n/**\n * Plugin definitions extend the base `Plugin` interface with additional lifecycle methods.\n */\nexport type PluginDefinition<TProvides = {}, TInitializeProvides = {}> = Omit<Plugin, 'provides'> & {\n /**\n * Capabilities provided by the plugin.\n */\n provides?: Plugin<TProvides>['provides'];\n\n /**\n * Initialize any async behavior required by the plugin.\n *\n * @return Capabilities provided by the plugin which are merged with base capabilities.\n */\n initialize?: () => Promise<PluginProvides<TInitializeProvides> | void>;\n\n /**\n * Called once all plugins have been initialized.\n * This is the place to do any initialization which requires other plugins to be ready.\n *\n * @param plugins All plugins which successfully initialized.\n */\n // TODO(wittjosiah): Rename `ready` to a verb?\n ready?: (plugins: Plugin[]) => Promise<void>;\n\n /**\n * Called when the plugin is unloaded.\n * This is the place to do any cleanup required by the plugin.\n */\n unload?: () => Promise<void>;\n};\n\nexport const pluginMeta = (meta: Plugin['meta']) => meta;\n\ntype LazyPlugin<T> = () => Promise<{ default: (props: T) => PluginDefinition }>;\n\nexport namespace Plugin {\n export const lazy = <T>(p: LazyPlugin<T>, props?: T) => {\n return () =>\n p().then(({ default: definition }) => {\n return definition(props as T);\n });\n };\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Context, type Provider, createContext, useContext } from 'react';\n\nimport { type Plugin } from './plugin';\nimport { findPlugin, resolvePlugin } from '../helpers';\n\nexport type PluginContext = {\n /**\n * All plugins are ready.\n */\n ready: boolean;\n\n /**\n * Ids of plugins which are enabled on this device.\n */\n enabled: string[];\n\n /**\n * Initialized and ready plugins.\n */\n plugins: Plugin[];\n\n /**\n * All available plugins.\n */\n available: Plugin['meta'][];\n\n /**\n * Mark plugin as enabled.\n * Requires reload to take effect.\n */\n setPlugin: (id: string, enabled: boolean) => void;\n};\n\nconst PluginContext: Context<PluginContext> = createContext<PluginContext>({\n ready: false,\n enabled: [],\n plugins: [],\n available: [],\n setPlugin: () => {},\n});\n\n/**\n * Get all plugins.\n */\nexport const usePlugins = (): PluginContext => useContext(PluginContext);\n\n/**\n * Get a plugin by ID.\n */\nexport const usePlugin = <T,>(id: string): Plugin<T> | undefined => {\n const { plugins } = usePlugins();\n return findPlugin<T>(plugins, id);\n};\n\n/**\n * Resolve a plugin by predicate.\n */\nexport const useResolvePlugin = <T,>(predicate: (plugin: Plugin) => Plugin<T> | undefined): Plugin<T> | undefined => {\n const { plugins } = usePlugins();\n return resolvePlugin(plugins, predicate);\n};\n\nexport const PluginProvider: Provider<PluginContext> = PluginContext.Provider;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { shallow } from 'deepsignal/react';\nimport React, { useEffect, type FC, type PropsWithChildren, type ReactNode, useState } from 'react';\n\nimport { LocalStorageStore } from '@dxos/local-storage';\nimport { log } from '@dxos/log';\n\nimport { type PluginContext, PluginProvider } from './PluginContext';\nimport { type Plugin, type PluginDefinition, type PluginProvides } from './plugin';\nimport { ErrorBoundary } from '../SurfacePlugin';\n\nexport type BootstrapPluginsParams = {\n order: PluginDefinition['meta'][];\n plugins: Record<string, () => Promise<PluginDefinition>>;\n core?: string[];\n defaults?: string[];\n fallback?: ErrorBoundary['props']['fallback'];\n placeholder?: ReactNode;\n};\n\nexport type PluginHostProvides = {\n plugins: PluginContext;\n};\n\nexport const parsePluginHost = (plugin: Plugin) =>\n (plugin.provides as PluginHostProvides).plugins ? (plugin as Plugin<PluginHostProvides>) : undefined;\n\nconst PLUGIN_HOST = 'dxos.org/plugin/host';\n\n/**\n * Bootstraps an application by initializing plugins and rendering root components.\n */\nexport const PluginHost = ({\n order,\n plugins: definitions,\n core = [],\n defaults = [],\n fallback = DefaultFallback,\n placeholder = null,\n}: BootstrapPluginsParams): PluginDefinition<PluginHostProvides> => {\n const state = new LocalStorageStore<PluginContext>(PLUGIN_HOST, {\n ready: false,\n enabled: [...defaults],\n plugins: [],\n available: order.filter(({ id }) => !core.includes(id)),\n setPlugin: (id: string, enabled: boolean) => {\n if (enabled) {\n state.values.enabled = [...state.values.enabled, id];\n } else {\n state.values.enabled = state.values.enabled.filter((enabled) => enabled !== id);\n }\n },\n });\n\n state.prop(state.values.$enabled!, 'enabled', LocalStorageStore.json);\n\n return {\n meta: {\n id: PLUGIN_HOST,\n name: 'Plugin host',\n },\n provides: {\n plugins: state.values,\n context: ({ children }) => <PluginProvider value={state.values}>{children}</PluginProvider>,\n root: () => {\n return (\n <ErrorBoundary fallback={fallback}>\n <Root order={order} core={core} definitions={definitions} state={state.values} placeholder={placeholder} />\n </ErrorBoundary>\n );\n },\n },\n };\n};\n\nconst DefaultFallback = ({ error }: { error: Error }) => {\n return (\n <div style={{ padding: '1rem' }}>\n {/* TODO(wittjosiah): Link to docs for replacing default. */}\n <h1 style={{ fontSize: '1.2rem', fontWeight: 700, margin: '0.5rem 0' }}>{error.message}</h1>\n <pre>{error.stack}</pre>\n </div>\n );\n};\n\ntype RootProps = {\n order: PluginDefinition['meta'][];\n state: PluginContext;\n definitions: Record<string, () => Promise<PluginDefinition>>;\n core: string[];\n placeholder: ReactNode;\n};\n\nconst Root = ({ order, core: corePluginIds, definitions, state, placeholder }: RootProps) => {\n const [error, setError] = useState<unknown>();\n\n useEffect(() => {\n log('initializing plugins', { enabled: state.enabled });\n const timeout = setTimeout(async () => {\n try {\n const enabledIds = [...corePluginIds, ...state.enabled].sort((a, b) => {\n const indexA = order.findIndex(({ id }) => id === a);\n const indexB = order.findIndex(({ id }) => id === b);\n return indexA - indexB;\n });\n\n const enabled = await Promise.all(\n enabledIds\n .map((id) => definitions[id])\n // If local storage indicates a plugin is enabled, but it is not available, ignore it.\n .filter((definition): definition is () => Promise<PluginDefinition> => Boolean(definition))\n .map((definition) => definition()),\n );\n\n const plugins = await Promise.all(\n enabled.map(async (definition) => {\n const plugin = await initializePlugin(definition).catch((err) => {\n log.error('Failed to initialize plugin:', { id: definition.meta.id, err });\n return undefined;\n });\n return plugin;\n }),\n ).then((plugins) => plugins.filter((plugin): plugin is Plugin => Boolean(plugin)));\n log('plugins initialized', { plugins });\n\n await Promise.all(enabled.map((pluginDefinition) => pluginDefinition.ready?.(plugins)));\n log('plugins ready', { plugins });\n\n state.plugins = shallow(plugins);\n state.ready = true;\n } catch (err) {\n setError(err);\n }\n });\n\n return () => {\n clearTimeout(timeout);\n state.ready = false;\n // TODO(wittjosiah): Does this ever need to be called prior to having dynamic plugins?\n // void Promise.all(enabled.map((definition) => definition.unload?.()));\n };\n }, []);\n\n if (error) {\n throw error;\n }\n\n if (!state.ready) {\n return <>{placeholder}</>;\n }\n\n const ComposedContext = composeContext(state.plugins);\n\n return <ComposedContext>{rootComponents(state.plugins)}</ComposedContext>;\n};\n\n/**\n * Resolve a `PluginDefinition` into a fully initialized `Plugin`.\n */\nexport const initializePlugin = async <T, U>(pluginDefinition: PluginDefinition<T, U>): Promise<Plugin<T & U>> => {\n const provides = await pluginDefinition.initialize?.();\n return {\n ...pluginDefinition,\n provides: {\n ...pluginDefinition.provides,\n ...provides,\n } as PluginProvides<T & U>,\n };\n};\n\nconst rootComponents = (plugins: Plugin[]) => {\n return plugins\n .map((plugin) => {\n const Component = plugin.provides.root;\n if (Component) {\n return <Component key={plugin.meta.id} />;\n } else {\n return null;\n }\n })\n .filter((node): node is JSX.Element => Boolean(node));\n};\n\nconst composeContext = (plugins: Plugin[]) => {\n return compose(plugins.map((p) => p.provides.context!).filter(Boolean));\n};\n\nconst compose = (contexts: FC<PropsWithChildren>[]) => {\n return [...contexts].reduce((Acc, Next) => ({ children }) => (\n <Acc>\n <Next>{children}</Next>\n </Acc>\n ));\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\n/**\n * Checks if the given data is an object and not null.\n *\n * Useful inside surface component resolvers as a type guard.\n *\n * @example\n * ```ts\n * const old =\n * data.content &&\n * typeof data.content === 'object' &&\n * 'id' in data.content &&\n * typeof data.content.id === 'string';\n *\n * // becomes\n * const new = isObject(data.content) && typeof data.content.id === 'string';\n * ```\n */\nexport const isObject = (data: unknown): data is { [key: string]: unknown } => !!data && typeof data === 'object';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { Component, type FC, type PropsWithChildren } from 'react';\n\ntype Props = PropsWithChildren<{ data?: any; fallback: FC<{ error: Error; reset: () => void }> }>;\ntype State = { error: Error | undefined };\n\n/**\n * Surface error boundary.\n *\n * For basic usage prefer providing a fallback component to `Surface`.\n *\n * For more information on error boundaries, see:\n * https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary\n */\nexport class ErrorBoundary extends Component<Props, State> {\n constructor(props: Props) {\n super(props);\n this.state = { error: undefined };\n }\n\n static getDerivedStateFromError(error: Error) {\n return { error };\n }\n\n override componentDidUpdate(prevProps: Props): void {\n if (prevProps.data !== this.props.data) {\n this.resetError();\n }\n }\n\n override render() {\n if (this.state.error) {\n return <this.props.fallback error={this.state.error} reset={this.resetError} />;\n }\n\n return this.props.children;\n }\n\n private resetError() {\n this.setState({ error: undefined });\n }\n}\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport React, {\n forwardRef,\n type ReactNode,\n Fragment,\n type ForwardedRef,\n type PropsWithChildren,\n isValidElement,\n Suspense,\n} from 'react';\nimport { createContext, useContext } from 'react';\n\nimport { raise } from '@dxos/debug';\n\nimport { ErrorBoundary } from './ErrorBoundary';\nimport { type SurfaceComponent, type SurfaceResult, useSurfaceRoot } from './SurfaceRootContext';\n\n/**\n * Direction determines how multiple components are laid out.\n */\nexport type Direction = 'inline' | 'inline-reverse' | 'block' | 'block-reverse';\n\n/**\n * SurfaceProps are the props that are passed to the Surface component.\n */\nexport type SurfaceProps = PropsWithChildren<{\n /**\n * Role defines how the data should be rendered.\n */\n role?: string;\n\n /**\n * Names allow nested surfaces to be specified in the parent context, similar to a slot.\n * Defaults to the value of `role` if not specified.\n */\n name?: string;\n\n /**\n * The data to be rendered by the surface.\n */\n data?: Record<string, unknown>;\n\n /**\n * Configure nested surfaces (indexed by the surface's `name`).\n */\n surfaces?: Record<string, Pick<SurfaceProps, 'data' | 'surfaces'>>;\n\n /**\n * If specified, the Surface will be wrapped in an error boundary.\n * The fallback component will be rendered if an error occurs.\n */\n fallback?: ErrorBoundary['props']['fallback'];\n\n /**\n * If specified, the Surface will be wrapped in a suspense boundary.\n * The placeholder component will be rendered while the surface component is loading.\n */\n placeholder?: ReactNode;\n\n /**\n * If more than one component is resolved, the limit determines how many are rendered.\n */\n limit?: number | undefined;\n\n /**\n * If more than one component is resolved, the direction determines how they are laid out.\n * NOTE: This is not yet implemented.\n */\n direction?: Direction;\n\n /**\n * Additional props to pass to the component.\n * These props are not used by Surface itself but may be used by components which resolve the surface.\n */\n [key: string]: unknown;\n}>;\n\n/**\n * A surface is a named region of the screen that can be populated by plugins.\n */\nexport const Surface = forwardRef<HTMLElement, SurfaceProps>(\n ({ role, name = role, fallback, placeholder, ...rest }, forwardedRef) => {\n const props = { role, name, fallback, ...rest };\n const context = useContext(SurfaceContext);\n const data = props.data ?? ((name && context?.surfaces?.[name]?.data) || {});\n\n const resolver = <SurfaceResolver {...props} ref={forwardedRef} />;\n const suspense = placeholder ? <Suspense fallback={placeholder}>{resolver}</Suspense> : resolver;\n\n return fallback ? (\n <ErrorBoundary data={data} fallback={fallback}>\n {suspense}\n </ErrorBoundary>\n ) : (\n suspense\n );\n },\n);\n\nconst SurfaceContext = createContext<SurfaceProps | null>(null);\n\nexport const useSurface = (): SurfaceProps =>\n useContext(SurfaceContext) ?? raise(new Error('Surface context not found'));\n\nconst SurfaceResolver = forwardRef<HTMLElement, SurfaceProps>((props, forwardedRef) => {\n const { components } = useSurfaceRoot();\n const parent = useContext(SurfaceContext);\n const nodes = resolveNodes(components, props, parent, forwardedRef);\n const currentContext: SurfaceProps = {\n ...props,\n surfaces: {\n ...((props.name && parent?.surfaces?.[props.name]?.surfaces) || {}),\n ...props.surfaces,\n },\n };\n\n return <SurfaceContext.Provider value={currentContext}>{nodes}</SurfaceContext.Provider>;\n});\n\nconst resolveNodes = (\n components: Record<string, SurfaceComponent>,\n props: SurfaceProps,\n context: SurfaceProps | null,\n forwardedRef: ForwardedRef<HTMLElement>,\n): ReactNode[] => {\n const data = {\n ...((props.name && context?.surfaces?.[props.name]?.data) || {}),\n ...props.data,\n };\n\n const nodes = Object.entries(components)\n .map(([key, component]): [string, SurfaceResult] | undefined => {\n const result = component({ ...props, data }, forwardedRef);\n if (!result || typeof result !== 'object') {\n return undefined;\n }\n\n return 'node' in result ? [key, result] : isValidElement(result) ? [key, { node: result }] : undefined;\n })\n .filter((result): result is [string, SurfaceResult] => Boolean(result))\n .sort(([, a], [, b]) => {\n const aDisposition = a.disposition ?? 'default';\n const bDisposition = b.disposition ?? 'default';\n\n if (aDisposition === bDisposition) {\n return 0;\n } else if (aDisposition === 'hoist' || bDisposition === 'fallback') {\n return -1;\n } else if (bDisposition === 'hoist' || aDisposition === 'fallback') {\n return 1;\n }\n\n return 0;\n })\n .map(([key, result]) => <Fragment key={key}>{result.node}</Fragment>);\n\n return props.limit ? nodes.slice(0, props.limit) : nodes;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { invariant } from '@dxos/invariant';\n\nimport { type BootstrapPluginsParams, PluginHost, Plugin } from './plugins';\nimport IntentMeta from './plugins/IntentPlugin/meta';\nimport SurfaceMeta from './plugins/SurfacePlugin/meta';\n\n/**\n * Expected usage is for this to be the entrypoint of the application.\n * Initializes plugins and renders the root components.\n *\n * @example\n * const order = [LayoutMeta, MyPluginMeta];\n * const plugins = {\n * [LayoutMeta.id]: Plugin.lazy(() => import('./plugins/LayoutPlugin/plugin')),\n * [MyPluginMeta.id]: Plugin.lazy(() => import('./plugins/MyPlugin/plugin')),\n * };\n * const core = [LayoutMeta.id];\n * const default = [MyPluginMeta.id];\n * const fallback = <div>Initializing Plugins...</div>;\n * const App = createApp({ order, plugins, core, default, fallback });\n * createRoot(document.getElementById('root')!).render(\n * <StrictMode>\n * <App />\n * </StrictMode>,\n * );\n *\n * @param params.order Total ordering of plugins.\n * @param params.plugins All plugins available to the application.\n * @param params.core Core plugins which will always be enabled.\n * @param params.default Default plugins are enabled by default but can be disabled by the user.\n * @param params.fallback Fallback component to render while plugins are initializing.\n */\nexport const createApp = ({ order, plugins, core = order.map(({ id }) => id), ...params }: BootstrapPluginsParams) => {\n const host = PluginHost({\n order: [SurfaceMeta, IntentMeta, ...order],\n plugins: {\n ...plugins,\n [SurfaceMeta.id]: Plugin.lazy(() => import('./plugins/SurfacePlugin/plugin')),\n [IntentMeta.id]: Plugin.lazy(() => import('./plugins/IntentPlugin/plugin')),\n },\n core: [SurfaceMeta.id, IntentMeta.id, ...core],\n ...params,\n });\n\n invariant(host.provides?.context);\n invariant(host.provides?.root);\n const Context = host.provides.context;\n const Root = host.provides.root;\n\n return () => (\n <Context>\n <Root />\n </Context>\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEIA,iBAAkB;AEAlB,IAAAA,cAAkB;AEAlB,IAAAA,cAAkB;AEAlB,mBAAuE;ACAvE,IAAAC,gBAAwB;AACxB,IAAAA,gBAA4F;AAE5F,2BAAkC;AAClC,iBAAoB;AEJpB,IAAAA,gBAAkE;ACAlE,IAAAA,gBAQO;AACP,IAAAA,gBAA0C;AAE1C,mBAAsB;ACXtB,IAAAA,gBAAkB;AAElB,uBAA0B;AbAnB,IAAMC,mBAAmB;EAC9BC,QAAQ;IAAC;IAAO;IAAO;;EACvBC,OAAO;IAAC;IAAO;IAAO;IAAO;;EAC7BC,MAAM;IAAC;IAAO;IAAO;;AACvB;AAeO,IAAMC,yBAAyB,CAACC,WAAAA;AACrC,SAAQA,OAAOC,SAAiBC,OAAQF,SAAyCG;AACnF;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,QAAA,cAAC4G,SAAAA,MACC5G,8BAAAA,QAAA,cAAC+D,OAAAA,IAAAA,CAAAA;AAGP;",
|
|
6
|
-
"names": ["import_zod", "import_react", "defaultFileTypes", "images", "media", "text", "parseFileManagerPlugin", "plugin", "provides", "file", "undefined", "parseGraphPlugin", "graph", "root", "parseGraphBuilderPlugin", "builder", "Toast", "z", "object", "id", "string", "title", "optional", "description", "icon", "any", "duration", "number", "closeLabel", "actionLabel", "actionAlt", "onAction", "function", "Layout", "fullscreen", "boolean", "sidebarOpen", "complementarySidebarOpen", "complementarySidebarContent", "describe", "dialogOpen", "dialogContent", "popoverOpen", "popoverContent", "popoverAnchorId", "toasts", "array", "parseLayoutPlugin", "success", "safeParse", "layout", "LAYOUT_ACTION", "LayoutAction", "parseMetadataRecordsPlugin", "metadata", "records", "parseMetadataResolverPlugin", "resolver", "Location", "active", "previous", "parseNavigationPlugin", "location", "NAVIGATION_ACTION", "NavigationAction", "parseSettingsPlugin", "settings", "SETTINGS_ACTION", "SettingsAction", "ResourceKey", "union", "record", "ResourceLanguage", "Resource", "parseTranslationsPlugin", "translations", "pluginMeta", "meta", "Plugin", "lazy", "p", "props", "then", "default", "definition", "PluginContext", "createContext", "ready", "enabled", "plugins", "available", "setPlugin", "usePlugins", "useContext", "usePlugin", "findPlugin", "useResolvePlugin", "predicate", "resolvePlugin", "PluginProvider", "Provider", "isObject", "data", "ErrorBoundary", "Component", "constructor", "state", "error", "getDerivedStateFromError", "componentDidUpdate", "prevProps", "resetError", "render", "React", "this", "fallback", "reset", "children", "setState", "Surface", "forwardRef", "role", "name", "placeholder", "rest", "forwardedRef", "context", "SurfaceContext", "surfaces", "SurfaceResolver", "ref", "suspense", "Suspense", "useSurface", "raise", "Error", "components", "useSurfaceRoot", "parent", "nodes", "resolveNodes", "currentContext", "value", "Object", "entries", "map", "key", "component", "result", "isValidElement", "node", "filter", "Boolean", "sort", "a", "b", "aDisposition", "disposition", "bDisposition", "Fragment", "limit", "slice", "parsePluginHost", "PLUGIN_HOST", "PluginHost", "order", "definitions", "core", "defaults", "DefaultFallback", "LocalStorageStore", "includes", "values", "prop", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { type Plugin } from '../PluginHost';\n\n// TODO(burdon): See Accept attribute (uses MIME types).\n// E.g., 'image/*': ['.jpg', '.jpeg', '.png', '.gif'],\nexport const defaultFileTypes = {\n images: ['png', 'jpg', 'jpeg', 'gif'],\n media: ['mp3', 'mp4', 'mov', 'avi'],\n text: ['pdf', 'txt', 'md'],\n};\n\nexport type FileInfo = {\n url?: string;\n cid?: string; // TODO(burdon): Meta key? Or other common properties with other file management system?\n};\n\nexport type FileUploader = (file: File) => Promise<FileInfo | undefined>;\n\nexport type FileManagerProvides = {\n file: {\n upload?: FileUploader;\n };\n};\n\n// TODO(burdon): Better match against interface? and Return provided service type. What if multiple?\nexport const parseFileManagerPlugin = (plugin: Plugin) => {\n return (plugin.provides as any).file ? (plugin as Plugin<FileManagerProvides>) : undefined;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { Graph } from '@dxos/app-graph';\nimport type { UnsubscribeCallback } from '@dxos/async';\n\nimport type { Plugin } from '../PluginHost';\n\n/**\n * Provides for a plugin that exposes the application graph.\n */\nexport type GraphProvides = {\n graph: Graph;\n};\n\nexport type GraphBuilderProvides = {\n graph: {\n builder: (plugins: Plugin[], graph: Graph) => UnsubscribeCallback | void;\n };\n};\n\n/**\n * Type guard for graph plugins.\n */\nexport const parseGraphPlugin = (plugin: Plugin) =>\n (plugin.provides as any).graph?.root ? (plugin as Plugin<GraphProvides>) : undefined;\n\n/**\n * Type guard for graph builder plugins.\n */\nexport const parseGraphBuilderPlugin = (plugin: Plugin) =>\n (plugin.provides as any).graph?.builder ? (plugin as Plugin<GraphBuilderProvides>) : undefined;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { z } from 'zod';\n\nimport { type IntentData } from '../IntentPlugin';\nimport type { Plugin } from '../PluginHost';\n\n//\n// Provides\n//\n\nexport const Toast = z.object({\n id: z.string(),\n title: z.string().optional(),\n description: z.string().optional(),\n // TODO(wittjosiah): `icon` should be string to be parsed by an `Icon` component.\n icon: z.any().optional(),\n duration: z.number().optional(),\n closeLabel: z.string().optional(),\n actionLabel: z.string().optional(),\n actionAlt: z.string().optional(),\n onAction: z.function().optional(),\n});\n\nexport type Toast = z.infer<typeof Toast>;\n\n/**\n * Basic state provided by a layout plugin.\n *\n * Layout provides the state of global UI landmarks, such as the sidebar, dialog, and popover.\n * Generally only one dialog or popover should be open at a time, a layout plugin should manage this.\n * For other landmarks, such as toasts, rendering them in the layout prevents them from unmounting when navigating.\n */\n// TODO(wittjosiah): Replace Zod w/ Effect Schema to align with ECHO.\nexport const Layout = z.object({\n fullscreen: z.boolean(),\n sidebarOpen: z.boolean(),\n\n complementarySidebarOpen: z.boolean(),\n complementarySidebarContent: z.any().optional().describe('Data to be passed to the complementary sidebar Surface.'),\n\n dialogOpen: z.boolean(),\n dialogContent: z.any().optional().describe('Data to be passed to the dialog Surface.'),\n\n popoverOpen: z.boolean(),\n popoverContent: z.any().optional().describe('Data to be passed to the popover Surface.'),\n popoverAnchorId: z.string().optional(),\n\n toasts: z.array(Toast),\n});\n\nexport type Layout = z.infer<typeof Layout>;\n\n/**\n * Provides for a plugin that can manage the app layout.\n */\nexport type LayoutProvides = {\n layout: Readonly<Layout>;\n};\n\n/**\n * Type guard for layout plugins.\n */\nexport const parseLayoutPlugin = (plugin: Plugin) => {\n const { success } = Layout.safeParse((plugin.provides as any).layout);\n return success ? (plugin as Plugin<LayoutProvides>) : undefined;\n};\n\n//\n// Intents\n//\n\nconst LAYOUT_ACTION = 'dxos.org/plugin/layout';\nexport enum LayoutAction {\n SET_LAYOUT = `${LAYOUT_ACTION}/set-layout`,\n\n /** @deprecated */\n // TODO(wittjosiah): At minimum this should be renamed, \"focus\" means something very specific on a web page.\n // Consider removing this action entirely, it's maybe not generic enough to live here.\n FOCUS = `${LAYOUT_ACTION}/focus`,\n}\n\n/**\n * Expected payload for layout actions.\n */\nexport namespace LayoutAction {\n export type SetLayout = IntentData<{\n /**\n * Element to set the state of.\n */\n element: 'fullscreen' | 'sidebar' | 'complementary' | 'dialog' | 'popover' | 'toast';\n\n /**\n * Whether the element is on or off.\n *\n * If omitted, the element's state will be toggled or set based on other provided data.\n * For example, if `component` is provided, the state will be set to `true`.\n */\n state?: boolean;\n\n /**\n * Component to render in the dialog or popover.\n */\n component?: string;\n\n /**\n * Data to be passed to the dialog or popover Surface.\n */\n subject?: any;\n\n /**\n * Anchor ID for the popover.\n */\n anchorId?: string;\n }>;\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '../PluginHost';\n\nexport type Metadata = Record<string, any>;\n\nexport type MetadataRecordsProvides = {\n metadata: {\n records: Record<string, Metadata>;\n };\n};\n\nexport type MetadataResolver = (type: string) => Metadata;\n\nexport type MetadataResolverProvides = {\n metadata: {\n resolver: MetadataResolver;\n };\n};\n\nexport const parseMetadataRecordsPlugin = (plugin: Plugin) => {\n return (plugin.provides as any).metadata?.records ? (plugin as Plugin<MetadataRecordsProvides>) : undefined;\n};\n\nexport const parseMetadataResolverPlugin = (plugin: Plugin) => {\n return (plugin.provides as any).metadata?.resolver ? (plugin as Plugin<MetadataResolverProvides>) : undefined;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { z } from 'zod';\n\nimport type { IntentData } from '../IntentPlugin';\nimport type { Plugin } from '../PluginHost';\n\n//\n// Provides\n//\n\n/**\n * Basic state provided by a navigation plugin.\n */\n// TODO(wittjosiah): Replace Zod w/ Effect Schema to align with ECHO.\n// TODO(wittjosiah): We should align this more with `window.location` along the lines of what React Router does.\nexport const Location = z.object({\n active: z.string().optional().describe('Id of the currently active item.'),\n // TODO(wittjosiah): History?\n previous: z.string().optional(),\n});\n\nexport type Location = z.infer<typeof Location>;\n\n/**\n * Provides for a plugin that can manage the app navigation.\n */\nexport type LocationProvides = {\n location: Readonly<Location>;\n};\n\n/**\n * Type guard for layout plugins.\n */\nexport const parseNavigationPlugin = (plugin: Plugin) => {\n const { success } = Location.safeParse((plugin.provides as any).location);\n return success ? (plugin as Plugin<LocationProvides>) : undefined;\n};\n\n//\n// Intents\n//\n\nconst NAVIGATION_ACTION = 'dxos.org/plugin/navigation';\nexport enum NavigationAction {\n ACTIVATE = `${NAVIGATION_ACTION}/activate`,\n}\n\n/**\n * Expected payload for navigation actions.\n */\nexport namespace NavigationAction {\n export type Activate = IntentData<{\n /**\n * Id to set as active.\n */\n id: string;\n\n /**\n * Location of the active item.\n * Defaults to 'main'.\n */\n key?: string;\n }>;\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '../PluginHost';\n\n// TODO(burdon): Plugins should export ts-effect object (see local-storage).\n// TODO(burdon): Auto generate form.\n// TODO(burdon): Set surface's data.type to plugin id (allow custom settings surface).\n\nexport type SettingsProvides<T extends Record<string, any> = Record<string, any>> = {\n settings: T; // TODO(burdon): Read-only.\n};\n\nexport const parseSettingsPlugin = (plugin: Plugin) => {\n return typeof (plugin.provides as any).settings === 'object' ? (plugin as Plugin<SettingsProvides>) : undefined;\n};\n\nconst SETTINGS_ACTION = 'dxos.org/plugin/settings';\nexport enum SettingsAction {\n OPEN = `${SETTINGS_ACTION}/open`,\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { z } from 'zod';\n\nimport type { Plugin } from '../PluginHost';\n\nexport const ResourceKey = z.union([z.string(), z.record(z.any())]);\nexport type ResourceKey = z.infer<typeof ResourceKey>;\n\nexport const ResourceLanguage = z.record(ResourceKey);\nexport type ResourceLanguage = z.infer<typeof ResourceLanguage>;\n\n/**\n * A resource is a collection of translations for a language.\n */\nexport const Resource = z.record(ResourceLanguage);\nexport type Resource = z.infer<typeof Resource>;\n\n/**\n * Provides for a plugin that exposes translations.\n */\n// TODO(wittjosiah): Rename to TranslationResourcesProvides.\nexport type TranslationsProvides = {\n translations: Readonly<Resource[]>;\n};\n\n// TODO(wittjosiah): Add TranslationsProvides.\n// export type TranslationsProvides = {\n// translations: {\n// t: TFunction;\n// };\n// };\n\n/**\n * Type guard for translation plugins.\n */\nexport const parseTranslationsPlugin = (plugin: Plugin) => {\n const { success } = z.array(Resource).safeParse((plugin.provides as any).translations);\n return success ? (plugin as Plugin<TranslationsProvides>) : undefined;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { IconProps } from '@phosphor-icons/react';\nimport type { FC, PropsWithChildren } from 'react';\n\n/**\n * Capabilities provided by a plugin.\n * The base surface capabilities are always included.\n */\nexport type PluginProvides<TProvides> = TProvides & {\n /**\n * React Context which is wrapped around the application to enable any hooks the plugin may provide.\n */\n context?: FC<PropsWithChildren>;\n\n /*\n * React component which is rendered at the root of the application.\n */\n root?: FC<PropsWithChildren>;\n};\n\n/**\n * A unit of containment of modular functionality that can be provided to an application.\n * Plugins provide things like components, state, actions, etc. to the application.\n */\nexport type Plugin<TProvides = {}> = {\n meta: {\n /**\n * Globally unique ID.\n *\n * Expected to be in the form of a valid URL.\n *\n * @example dxos.org/plugin/example\n */\n id: string;\n\n /**\n * Short ID for use in URLs.\n *\n * NOTE: This is especially experimental and likely to change.\n */\n // TODO(wittjosiah): How should these be managed?\n shortId?: string;\n\n /**\n * Human-readable name.\n */\n name?: string;\n\n /**\n * Short description of plugin functionality.\n */\n description?: string;\n\n /**\n * URL of home page.\n */\n homePage?: string;\n\n /**\n * Tags to help categorize the plugin.\n */\n tags?: string[];\n\n /**\n * Component to render icon for the plugin when displayed in a list.\n */\n // TODO(wittjosiah): Convert to `icon` and make serializable.\n iconComponent?: FC<IconProps>;\n };\n\n /**\n * Capabilities provided by the plugin.\n */\n provides: PluginProvides<TProvides>;\n};\n\n/**\n * Plugin definitions extend the base `Plugin` interface with additional lifecycle methods.\n */\nexport type PluginDefinition<TProvides = {}, TInitializeProvides = {}> = Omit<Plugin, 'provides'> & {\n /**\n * Capabilities provided by the plugin.\n */\n provides?: Plugin<TProvides>['provides'];\n\n /**\n * Initialize any async behavior required by the plugin.\n *\n * @return Capabilities provided by the plugin which are merged with base capabilities.\n */\n initialize?: () => Promise<PluginProvides<TInitializeProvides> | void>;\n\n /**\n * Called once all plugins have been initialized.\n * This is the place to do any initialization which requires other plugins to be ready.\n *\n * @param plugins All plugins which successfully initialized.\n */\n // TODO(wittjosiah): Rename `ready` to a verb?\n ready?: (plugins: Plugin[]) => Promise<void>;\n\n /**\n * Called when the plugin is unloaded.\n * This is the place to do any cleanup required by the plugin.\n */\n unload?: () => Promise<void>;\n};\n\nexport const pluginMeta = (meta: Plugin['meta']) => meta;\n\ntype LazyPlugin<T> = () => Promise<{ default: (props: T) => PluginDefinition }>;\n\nexport namespace Plugin {\n export const lazy = <T>(p: LazyPlugin<T>, props?: T) => {\n return () =>\n p().then(({ default: definition }) => {\n return definition(props as T);\n });\n };\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Context, type Provider, createContext, useContext } from 'react';\n\nimport { type Plugin } from './plugin';\nimport { findPlugin, resolvePlugin } from '../helpers';\n\nexport type PluginContext = {\n /**\n * All plugins are ready.\n */\n ready: boolean;\n\n /**\n * Ids of plugins which are enabled on this device.\n */\n enabled: string[];\n\n /**\n * Initialized and ready plugins.\n */\n plugins: Plugin[];\n\n /**\n * All available plugins.\n */\n available: Plugin['meta'][];\n\n /**\n * Mark plugin as enabled.\n * Requires reload to take effect.\n */\n setPlugin: (id: string, enabled: boolean) => void;\n};\n\nconst PluginContext: Context<PluginContext> = createContext<PluginContext>({\n ready: false,\n enabled: [],\n plugins: [],\n available: [],\n setPlugin: () => {},\n});\n\n/**\n * Get all plugins.\n */\nexport const usePlugins = (): PluginContext => useContext(PluginContext);\n\n/**\n * Get a plugin by ID.\n */\nexport const usePlugin = <T,>(id: string): Plugin<T> | undefined => {\n const { plugins } = usePlugins();\n return findPlugin<T>(plugins, id);\n};\n\n/**\n * Resolve a plugin by predicate.\n */\nexport const useResolvePlugin = <T,>(predicate: (plugin: Plugin) => Plugin<T> | undefined): Plugin<T> | undefined => {\n const { plugins } = usePlugins();\n return resolvePlugin(plugins, predicate);\n};\n\nexport const PluginProvider: Provider<PluginContext> = PluginContext.Provider;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useEffect, type FC, type PropsWithChildren, type ReactNode, useState } from 'react';\n\nimport { LocalStorageStore } from '@dxos/local-storage';\nimport { log } from '@dxos/log';\n\nimport { type PluginContext, PluginProvider } from './PluginContext';\nimport { type Plugin, type PluginDefinition, type PluginProvides } from './plugin';\nimport { ErrorBoundary } from '../SurfacePlugin';\n\nexport type BootstrapPluginsParams = {\n order: PluginDefinition['meta'][];\n plugins: Record<string, () => Promise<PluginDefinition>>;\n core?: string[];\n defaults?: string[];\n fallback?: ErrorBoundary['props']['fallback'];\n placeholder?: ReactNode;\n};\n\nexport type PluginHostProvides = {\n plugins: PluginContext;\n};\n\nexport const parsePluginHost = (plugin: Plugin) =>\n (plugin.provides as PluginHostProvides).plugins ? (plugin as Plugin<PluginHostProvides>) : undefined;\n\nconst PLUGIN_HOST = 'dxos.org/plugin/host';\n\n/**\n * Bootstraps an application by initializing plugins and rendering root components.\n */\nexport const PluginHost = ({\n order,\n plugins: definitions,\n core = [],\n defaults = [],\n fallback = DefaultFallback,\n placeholder = null,\n}: BootstrapPluginsParams): PluginDefinition<PluginHostProvides> => {\n const state = new LocalStorageStore<PluginContext>(PLUGIN_HOST, {\n ready: false,\n enabled: [...defaults],\n plugins: [],\n available: order.filter(({ id }) => !core.includes(id)),\n setPlugin: (id: string, enabled: boolean) => {\n if (enabled) {\n state.values.enabled.push(id);\n } else {\n const index = state.values.enabled.findIndex((enabled) => enabled === id);\n index !== -1 && state.values.enabled.splice(index, 1);\n }\n },\n });\n\n state.prop({ key: 'enabled', type: LocalStorageStore.json<string[]>() });\n\n return {\n meta: {\n id: PLUGIN_HOST,\n name: 'Plugin host',\n },\n provides: {\n plugins: state.values,\n context: ({ children }) => <PluginProvider value={state.values}>{children}</PluginProvider>,\n root: () => {\n return (\n <ErrorBoundary fallback={fallback}>\n <Root order={order} core={core} definitions={definitions} state={state.values} placeholder={placeholder} />\n </ErrorBoundary>\n );\n },\n },\n };\n};\n\nconst DefaultFallback = ({ error }: { error: Error }) => {\n return (\n <div style={{ padding: '1rem' }}>\n {/* TODO(wittjosiah): Link to docs for replacing default. */}\n <h1 style={{ fontSize: '1.2rem', fontWeight: 700, margin: '0.5rem 0' }}>{error.message}</h1>\n <pre>{error.stack}</pre>\n </div>\n );\n};\n\ntype RootProps = {\n order: PluginDefinition['meta'][];\n state: PluginContext;\n definitions: Record<string, () => Promise<PluginDefinition>>;\n core: string[];\n placeholder: ReactNode;\n};\n\nconst Root = ({ order, core: corePluginIds, definitions, state, placeholder }: RootProps) => {\n const [error, setError] = useState<unknown>();\n\n useEffect(() => {\n log('initializing plugins', { enabled: state.enabled });\n const timeout = setTimeout(async () => {\n try {\n const enabledIds = [...corePluginIds, ...state.enabled].sort((a, b) => {\n const indexA = order.findIndex(({ id }) => id === a);\n const indexB = order.findIndex(({ id }) => id === b);\n return indexA - indexB;\n });\n\n const enabled = await Promise.all(\n enabledIds\n .map((id) => definitions[id])\n // If local storage indicates a plugin is enabled, but it is not available, ignore it.\n .filter((definition): definition is () => Promise<PluginDefinition> => Boolean(definition))\n .map((definition) => definition()),\n );\n\n const plugins = await Promise.all(\n enabled.map(async (definition) => {\n const plugin = await initializePlugin(definition).catch((err) => {\n log.error('Failed to initialize plugin:', { id: definition.meta.id, err });\n return undefined;\n });\n return plugin;\n }),\n ).then((plugins) => plugins.filter((plugin): plugin is Plugin => Boolean(plugin)));\n log('plugins initialized', { plugins });\n\n await Promise.all(enabled.map((pluginDefinition) => pluginDefinition.ready?.(plugins)));\n log('plugins ready', { plugins });\n\n state.plugins = plugins;\n state.ready = true;\n } catch (err) {\n setError(err);\n }\n });\n\n return () => {\n clearTimeout(timeout);\n state.ready = false;\n // TODO(wittjosiah): Does this ever need to be called prior to having dynamic plugins?\n // void Promise.all(enabled.map((definition) => definition.unload?.()));\n };\n }, []);\n\n if (error) {\n throw error;\n }\n\n if (!state.ready) {\n return <>{placeholder}</>;\n }\n\n const ComposedContext = composeContext(state.plugins);\n\n return <ComposedContext>{rootComponents(state.plugins)}</ComposedContext>;\n};\n\n/**\n * Resolve a `PluginDefinition` into a fully initialized `Plugin`.\n */\nexport const initializePlugin = async <T, U>(pluginDefinition: PluginDefinition<T, U>): Promise<Plugin<T & U>> => {\n const provides = await pluginDefinition.initialize?.();\n return {\n ...pluginDefinition,\n provides: {\n ...pluginDefinition.provides,\n ...provides,\n } as PluginProvides<T & U>,\n };\n};\n\nconst rootComponents = (plugins: Plugin[]) => {\n return plugins\n .map((plugin) => {\n const Component = plugin.provides.root;\n if (Component) {\n return <Component key={plugin.meta.id} />;\n } else {\n return null;\n }\n })\n .filter((node): node is JSX.Element => Boolean(node));\n};\n\nconst composeContext = (plugins: Plugin[]) => {\n return compose(plugins.map((p) => p.provides.context!).filter(Boolean));\n};\n\nconst compose = (contexts: FC<PropsWithChildren>[]) => {\n return [...contexts].reduce((Acc, Next) => ({ children }) => (\n <Acc>\n <Next>{children}</Next>\n </Acc>\n ));\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\n/**\n * Checks if the given data is an object and not null.\n *\n * Useful inside surface component resolvers as a type guard.\n *\n * @example\n * ```ts\n * const old =\n * data.content &&\n * typeof data.content === 'object' &&\n * 'id' in data.content &&\n * typeof data.content.id === 'string';\n *\n * // becomes\n * const new = isObject(data.content) && typeof data.content.id === 'string';\n * ```\n */\nexport const isObject = (data: unknown): data is { [key: string]: unknown } => !!data && typeof data === 'object';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { Component, type FC, type PropsWithChildren } from 'react';\n\ntype Props = PropsWithChildren<{ data?: any; fallback: FC<{ error: Error; reset: () => void }> }>;\ntype State = { error: Error | undefined };\n\n/**\n * Surface error boundary.\n *\n * For basic usage prefer providing a fallback component to `Surface`.\n *\n * For more information on error boundaries, see:\n * https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary\n */\nexport class ErrorBoundary extends Component<Props, State> {\n constructor(props: Props) {\n super(props);\n this.state = { error: undefined };\n }\n\n static getDerivedStateFromError(error: Error) {\n return { error };\n }\n\n override componentDidUpdate(prevProps: Props): void {\n if (prevProps.data !== this.props.data) {\n this.resetError();\n }\n }\n\n override render() {\n if (this.state.error) {\n return <this.props.fallback error={this.state.error} reset={this.resetError} />;\n }\n\n return this.props.children;\n }\n\n private resetError() {\n this.setState({ error: undefined });\n }\n}\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport React, {\n forwardRef,\n type ReactNode,\n Fragment,\n type ForwardedRef,\n type PropsWithChildren,\n isValidElement,\n Suspense,\n} from 'react';\nimport { createContext, useContext } from 'react';\n\nimport { raise } from '@dxos/debug';\n\nimport { ErrorBoundary } from './ErrorBoundary';\nimport { type SurfaceComponent, type SurfaceResult, useSurfaceRoot } from './SurfaceRootContext';\n\n/**\n * Direction determines how multiple components are laid out.\n */\nexport type Direction = 'inline' | 'inline-reverse' | 'block' | 'block-reverse';\n\n/**\n * SurfaceProps are the props that are passed to the Surface component.\n */\nexport type SurfaceProps = PropsWithChildren<{\n /**\n * Role defines how the data should be rendered.\n */\n role?: string;\n\n /**\n * Names allow nested surfaces to be specified in the parent context, similar to a slot.\n * Defaults to the value of `role` if not specified.\n */\n name?: string;\n\n /**\n * The data to be rendered by the surface.\n */\n data?: Record<string, unknown>;\n\n /**\n * Configure nested surfaces (indexed by the surface's `name`).\n */\n surfaces?: Record<string, Pick<SurfaceProps, 'data' | 'surfaces'>>;\n\n /**\n * If specified, the Surface will be wrapped in an error boundary.\n * The fallback component will be rendered if an error occurs.\n */\n fallback?: ErrorBoundary['props']['fallback'];\n\n /**\n * If specified, the Surface will be wrapped in a suspense boundary.\n * The placeholder component will be rendered while the surface component is loading.\n */\n placeholder?: ReactNode;\n\n /**\n * If more than one component is resolved, the limit determines how many are rendered.\n */\n limit?: number | undefined;\n\n /**\n * If more than one component is resolved, the direction determines how they are laid out.\n * NOTE: This is not yet implemented.\n */\n direction?: Direction;\n\n /**\n * Additional props to pass to the component.\n * These props are not used by Surface itself but may be used by components which resolve the surface.\n */\n [key: string]: unknown;\n}>;\n\n/**\n * A surface is a named region of the screen that can be populated by plugins.\n */\nexport const Surface = forwardRef<HTMLElement, SurfaceProps>(\n ({ role, name = role, fallback, placeholder, ...rest }, forwardedRef) => {\n const props = { role, name, fallback, ...rest };\n const context = useContext(SurfaceContext);\n const data = props.data ?? ((name && context?.surfaces?.[name]?.data) || {});\n\n const resolver = <SurfaceResolver {...props} ref={forwardedRef} />;\n const suspense = placeholder ? <Suspense fallback={placeholder}>{resolver}</Suspense> : resolver;\n\n return fallback ? (\n <ErrorBoundary data={data} fallback={fallback}>\n {suspense}\n </ErrorBoundary>\n ) : (\n suspense\n );\n },\n);\n\nconst SurfaceContext = createContext<SurfaceProps | null>(null);\n\nexport const useSurface = (): SurfaceProps =>\n useContext(SurfaceContext) ?? raise(new Error('Surface context not found'));\n\nconst SurfaceResolver = forwardRef<HTMLElement, SurfaceProps>((props, forwardedRef) => {\n const { components } = useSurfaceRoot();\n const parent = useContext(SurfaceContext);\n const nodes = resolveNodes(components, props, parent, forwardedRef);\n const currentContext: SurfaceProps = {\n ...props,\n surfaces: {\n ...((props.name && parent?.surfaces?.[props.name]?.surfaces) || {}),\n ...props.surfaces,\n },\n };\n\n return <SurfaceContext.Provider value={currentContext}>{nodes}</SurfaceContext.Provider>;\n});\n\nconst resolveNodes = (\n components: Record<string, SurfaceComponent>,\n props: SurfaceProps,\n context: SurfaceProps | null,\n forwardedRef: ForwardedRef<HTMLElement>,\n): ReactNode[] => {\n const data = {\n ...((props.name && context?.surfaces?.[props.name]?.data) || {}),\n ...props.data,\n };\n\n const nodes = Object.entries(components)\n .map(([key, component]): [string, SurfaceResult] | undefined => {\n const result = component({ ...props, data }, forwardedRef);\n if (!result || typeof result !== 'object') {\n return undefined;\n }\n\n return 'node' in result ? [key, result] : isValidElement(result) ? [key, { node: result }] : undefined;\n })\n .filter((result): result is [string, SurfaceResult] => Boolean(result))\n .sort(([, a], [, b]) => {\n const aDisposition = a.disposition ?? 'default';\n const bDisposition = b.disposition ?? 'default';\n\n if (aDisposition === bDisposition) {\n return 0;\n } else if (aDisposition === 'hoist' || bDisposition === 'fallback') {\n return -1;\n } else if (bDisposition === 'hoist' || aDisposition === 'fallback') {\n return 1;\n }\n\n return 0;\n })\n .map(([key, result]) => <Fragment key={key}>{result.node}</Fragment>);\n\n return props.limit ? nodes.slice(0, props.limit) : nodes;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { invariant } from '@dxos/invariant';\n\nimport { type BootstrapPluginsParams, PluginHost, Plugin } from './plugins';\nimport IntentMeta from './plugins/IntentPlugin/meta';\nimport SurfaceMeta from './plugins/SurfacePlugin/meta';\n\n/**\n * Expected usage is for this to be the entrypoint of the application.\n * Initializes plugins and renders the root components.\n *\n * @example\n * const order = [LayoutMeta, MyPluginMeta];\n * const plugins = {\n * [LayoutMeta.id]: Plugin.lazy(() => import('./plugins/LayoutPlugin/plugin')),\n * [MyPluginMeta.id]: Plugin.lazy(() => import('./plugins/MyPlugin/plugin')),\n * };\n * const core = [LayoutMeta.id];\n * const default = [MyPluginMeta.id];\n * const fallback = <div>Initializing Plugins...</div>;\n * const App = createApp({ order, plugins, core, default, fallback });\n * createRoot(document.getElementById('root')!).render(\n * <StrictMode>\n * <App />\n * </StrictMode>,\n * );\n *\n * @param params.order Total ordering of plugins.\n * @param params.plugins All plugins available to the application.\n * @param params.core Core plugins which will always be enabled.\n * @param params.default Default plugins are enabled by default but can be disabled by the user.\n * @param params.fallback Fallback component to render while plugins are initializing.\n */\nexport const createApp = ({ order, plugins, core = order.map(({ id }) => id), ...params }: BootstrapPluginsParams) => {\n const host = PluginHost({\n order: [SurfaceMeta, IntentMeta, ...order],\n plugins: {\n ...plugins,\n [SurfaceMeta.id]: Plugin.lazy(() => import('./plugins/SurfacePlugin/plugin')),\n [IntentMeta.id]: Plugin.lazy(() => import('./plugins/IntentPlugin/plugin')),\n },\n core: [SurfaceMeta.id, IntentMeta.id, ...core],\n ...params,\n });\n\n invariant(host.provides?.context);\n invariant(host.provides?.root);\n const Context = host.provides.context;\n const Root = host.provides.root;\n\n return () => (\n <Context>\n <Root />\n </Context>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEIA,iBAAkB;AEAlB,IAAAA,cAAkB;AEAlB,IAAAA,cAAkB;AEAlB,mBAAuE;ACAvE,IAAAC,gBAA4F;AAE5F,2BAAkC;AAClC,iBAAoB;AEHpB,IAAAA,gBAAkE;ACAlE,IAAAA,gBAQO;AACP,IAAAA,gBAA0C;AAE1C,mBAAsB;ACXtB,IAAAA,gBAAkB;AAElB,uBAA0B;AbEnB,IAAMC,mBAAmB;EAC9BC,QAAQ;IAAC;IAAO;IAAO;IAAQ;;EAC/BC,OAAO;IAAC;IAAO;IAAO;IAAO;;EAC7BC,MAAM;IAAC;IAAO;IAAO;;AACvB;AAgBO,IAAMC,yBAAyB,CAACC,WAAAA;AACrC,SAAQA,OAAOC,SAAiBC,OAAQF,SAAyCG;AACnF;ACLO,IAAMC,mBAAmB,CAACJ,WAC9BA,OAAOC,SAAiBI,OAAOC,OAAQN,SAAmCG;AAKtE,IAAMI,0BAA0B,CAACP,WACrCA,OAAOC,SAAiBI,OAAOG,UAAWR,SAA0CG;ACnBhF,IAAMM,QAAQC,aAAEC,OAAO;EAC5BC,IAAIF,aAAEG,OAAM;EACZC,OAAOJ,aAAEG,OAAM,EAAGE,SAAQ;EAC1BC,aAAaN,aAAEG,OAAM,EAAGE,SAAQ;;EAEhCE,MAAMP,aAAEQ,IAAG,EAAGH,SAAQ;EACtBI,UAAUT,aAAEU,OAAM,EAAGL,SAAQ;E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C,OAAO,CAACC,KAAKC,SAAS,CAAC,EAAEnG,SAAQ,MACpDJ,8BAAAA,QAAA,cAACsG,KAAAA,MACCtG,8BAAAA,QAAA,cAACuG,MAAAA,MAAMnG,QAAAA,CAAAA,CAAAA;AAGb;;AI9JO,IAAMoG,YAAY,CAAC,EAAEpD,OAAO5E,SAAS8E,OAAOF,MAAMpB,IAAI,CAAC,EAAE9H,GAAE,MAAOA,EAAAA,GAAK,GAAGuM,OAAAA,MAAgC;AAC/G,QAAMC,OAAOvD,WAAW;IACtBC,OAAO;MAACuD,sBAAAA;MAAaC;SAAexD;;IACpC5E,SAAS;MACP,GAAGA;MACH,CAACmI,sBAAAA,aAAYzM,EAAE,GAAG2D,OAAOC,KAAK,MAAM,OAAO,uBAAA,CAAA;MAC3C,CAAC8I,mCAAW1M,EAAE,GAAG2D,OAAOC,KAAK,MAAM,OAAO,uBAAA,CAAA;IAC5C;IACAwF,MAAM;MAACqD,sBAAAA,aAAYzM;MAAI0M,mCAAW1M;SAAOoJ;;IACzC,GAAGmD;EACL,CAAA;AAEAI,kCAAUH,KAAKnN,UAAUsH,SAAAA,QAAAA;;;;;;;;;AACzBgG,kCAAUH,KAAKnN,UAAUK,MAAAA,QAAAA;;;;;;;;;AACzB,QAAMkN,UAAUJ,KAAKnN,SAASsH;AAC9B,QAAMsD,QAAOuC,KAAKnN,SAASK;AAE3B,SAAO,MACLoG,8BAAAA,QAAA,cAAC8G,SAAAA,MACC9G,8BAAAA,QAAA,cAACmE,OAAAA,IAAAA,CAAAA;AAGP;",
|
|
6
|
+
"names": ["import_zod", "import_react", "defaultFileTypes", "images", "media", "text", "parseFileManagerPlugin", "plugin", "provides", "file", "undefined", "parseGraphPlugin", "graph", "root", "parseGraphBuilderPlugin", "builder", "Toast", "z", "object", "id", "string", "title", "optional", "description", "icon", "any", "duration", "number", "closeLabel", "actionLabel", "actionAlt", "onAction", "function", "Layout", "fullscreen", "boolean", "sidebarOpen", "complementarySidebarOpen", "complementarySidebarContent", "describe", "dialogOpen", "dialogContent", "popoverOpen", "popoverContent", "popoverAnchorId", "toasts", "array", "parseLayoutPlugin", "success", "safeParse", "layout", "LAYOUT_ACTION", "LayoutAction", "parseMetadataRecordsPlugin", "metadata", "records", "parseMetadataResolverPlugin", "resolver", "Location", "active", "previous", "parseNavigationPlugin", "location", "NAVIGATION_ACTION", "NavigationAction", "parseSettingsPlugin", "settings", "SETTINGS_ACTION", "SettingsAction", "ResourceKey", "union", "record", "ResourceLanguage", "Resource", "parseTranslationsPlugin", "translations", "pluginMeta", "meta", "Plugin", "lazy", "p", "props", "then", "default", "definition", "PluginContext", "createContext", "ready", "enabled", "plugins", "available", "setPlugin", "usePlugins", "useContext", "usePlugin", "findPlugin", "useResolvePlugin", "predicate", "resolvePlugin", "PluginProvider", "Provider", "isObject", "data", "ErrorBoundary", "Component", "constructor", "state", "error", "getDerivedStateFromError", "componentDidUpdate", "prevProps", "resetError", "render", "React", "this", "fallback", "reset", "children", "setState", "Surface", "forwardRef", "role", "name", "placeholder", "rest", "forwardedRef", "context", "SurfaceContext", "surfaces", "SurfaceResolver", "ref", "suspense", "Suspense", "useSurface", "raise", "Error", "components", "useSurfaceRoot", "parent", "nodes", "resolveNodes", "currentContext", "value", "Object", "entries", "map", "key", "component", "result", "isValidElement", "node", "filter", "Boolean", "sort", "a", "b", "aDisposition", "disposition", "bDisposition", "Fragment", "limit", "slice", "parsePluginHost", "PLUGIN_HOST", "PluginHost", "order", "definitions", "core", "defaults", "DefaultFallback", "LocalStorageStore", "includes", "values", "push", "index", "findIndex", "splice", "prop", "type", "json", "Root", "div", "style", "padding", "h1", "fontSize", "fontWeight", "margin", "message", "pre", "stack", "corePluginIds", "setError", "useState", "useEffect", "log", "timeout", "setTimeout", "enabledIds", "indexA", "indexB", "Promise", "all", "initializePlugin", "catch", "err", "pluginDefinition", "clearTimeout", "ComposedContext", "composeContext", "rootComponents", "initialize", "compose", "contexts", "reduce", "Acc", "Next", "createApp", "params", "host", "SurfaceMeta", "IntentMeta", "invariant", "Context"]
|
|
7
7
|
}
|
package/dist/lib/node/meta.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/sdk/app-framework/src/plugins/common/file.ts":{"bytes":2319,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/graph.ts":{"bytes":2173,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/layout.ts":{"bytes":9327,"imports":[{"path":"zod","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/metadata.ts":{"bytes":2058,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/navigation.ts":{"bytes":4314,"imports":[{"path":"zod","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/settings.ts":{"bytes":2053,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/translations.ts":{"bytes":3465,"imports":[{"path":"zod","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/index.ts":{"bytes":1006,"imports":[{"path":"packages/sdk/app-framework/src/plugins/common/file.ts","kind":"import-statement","original":"./file"},{"path":"packages/sdk/app-framework/src/plugins/common/graph.ts","kind":"import-statement","original":"./graph"},{"path":"packages/sdk/app-framework/src/plugins/common/layout.ts","kind":"import-statement","original":"./layout"},{"path":"packages/sdk/app-framework/src/plugins/common/metadata.ts","kind":"import-statement","original":"./metadata"},{"path":"packages/sdk/app-framework/src/plugins/common/navigation.ts","kind":"import-statement","original":"./navigation"},{"path":"packages/sdk/app-framework/src/plugins/common/settings.ts","kind":"import-statement","original":"./settings"},{"path":"packages/sdk/app-framework/src/plugins/common/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/helpers.ts":{"bytes":4350,"imports":[{"path":"@dxos/debug","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/intent.ts":{"bytes":3705,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/provides.ts":{"bytes":2675,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/IntentContext.tsx":{"bytes":4026,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/index.ts":{"bytes":678,"imports":[{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/intent.ts","kind":"import-statement","original":"./intent"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/provides.ts","kind":"import-statement","original":"./provides"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/IntentContext.tsx","kind":"import-statement","original":"./IntentContext"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/PluginHost/plugin.ts":{"bytes":5280,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/PluginHost/PluginContext.tsx":{"bytes":4030,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/helpers.ts","kind":"import-statement","original":"../helpers"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/helpers.ts":{"bytes":1765,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/provides.ts":{"bytes":1938,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/ErrorBoundary.tsx":{"bytes":4120,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/SurfaceRootContext.tsx":{"bytes":2763,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/Surface.tsx":{"bytes":13757,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/ErrorBoundary.tsx","kind":"import-statement","original":"./ErrorBoundary"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/SurfaceRootContext.tsx","kind":"import-statement","original":"./SurfaceRootContext"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/index.ts":{"bytes":881,"imports":[{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/provides.ts","kind":"import-statement","original":"./provides"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/ErrorBoundary.tsx","kind":"import-statement","original":"./ErrorBoundary"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/Surface.tsx","kind":"import-statement","original":"./Surface"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/SurfaceRootContext.tsx","kind":"import-statement","original":"./SurfaceRootContext"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/PluginHost/PluginHost.tsx":{"bytes":21289,"imports":[{"path":"deepsignal/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/PluginHost/PluginContext.tsx","kind":"import-statement","original":"./PluginContext"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/index.ts","kind":"import-statement","original":"../SurfacePlugin"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/PluginHost/index.ts":{"bytes":678,"imports":[{"path":"packages/sdk/app-framework/src/plugins/PluginHost/plugin.ts","kind":"import-statement","original":"./plugin"},{"path":"packages/sdk/app-framework/src/plugins/PluginHost/PluginContext.tsx","kind":"import-statement","original":"./PluginContext"},{"path":"packages/sdk/app-framework/src/plugins/PluginHost/PluginHost.tsx","kind":"import-statement","original":"./PluginHost"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/index.ts":{"bytes":854,"imports":[{"path":"packages/sdk/app-framework/src/plugins/common/index.ts","kind":"import-statement","original":"./common"},{"path":"packages/sdk/app-framework/src/plugins/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/index.ts","kind":"import-statement","original":"./IntentPlugin"},{"path":"packages/sdk/app-framework/src/plugins/PluginHost/index.ts","kind":"import-statement","original":"./PluginHost"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/index.ts","kind":"import-statement","original":"./SurfacePlugin"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/meta.ts":{"bytes":690,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/meta.ts":{"bytes":698,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/plugin.tsx":{"bytes":4010,"imports":[{"path":"deepsignal/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/SurfaceRootContext.tsx","kind":"import-statement","original":"./SurfaceRootContext"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/provides.ts","kind":"import-statement","original":"./provides"},{"path":"packages/sdk/app-framework/src/plugins/helpers.ts","kind":"import-statement","original":"../helpers"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/helpers.ts":{"bytes":1138,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/plugin.tsx":{"bytes":18871,"imports":[{"path":"deepsignal/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/IntentContext.tsx","kind":"import-statement","original":"./IntentContext"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/provides.ts","kind":"import-statement","original":"./provides"},{"path":"packages/sdk/app-framework/src/plugins/helpers.ts","kind":"import-statement","original":"../helpers"}],"format":"esm"},"packages/sdk/app-framework/src/App.tsx":{"bytes":6903,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/index.ts","kind":"import-statement","original":"./plugins"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/meta.ts","kind":"import-statement","original":"./plugins/IntentPlugin/meta"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/meta.ts","kind":"import-statement","original":"./plugins/SurfacePlugin/meta"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/plugin.tsx","kind":"dynamic-import","original":"./plugins/SurfacePlugin/plugin"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/plugin.tsx","kind":"dynamic-import","original":"./plugins/IntentPlugin/plugin"}],"format":"esm"},"packages/sdk/app-framework/src/index.ts":{"bytes":544,"imports":[{"path":"packages/sdk/app-framework/src/plugins/index.ts","kind":"import-statement","original":"./plugins"},{"path":"packages/sdk/app-framework/src/App.tsx","kind":"import-statement","original":"./App"}],"format":"esm"}},"outputs":{"packages/sdk/app-framework/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":43695},"packages/sdk/app-framework/dist/lib/node/index.cjs":{"imports":[{"path":"packages/sdk/app-framework/dist/lib/node/chunk-BTZLKXA2.cjs","kind":"import-statement"},{"path":"packages/sdk/app-framework/dist/lib/node/chunk-DFST5IG5.cjs","kind":"import-statement"},{"path":"packages/sdk/app-framework/dist/lib/node/chunk-62W6CMGM.cjs","kind":"import-statement"},{"path":"zod","kind":"import-statement","external":true},{"path":"zod","kind":"import-statement","external":true},{"path":"zod","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"deepsignal/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/dist/lib/node/plugin-ZJ26B7E5.cjs","kind":"dynamic-import"},{"path":"packages/sdk/app-framework/dist/lib/node/plugin-VEIZZVQP.cjs","kind":"dynamic-import"}],"exports":["ErrorBoundary","IntentAction","IntentProvider","Layout","LayoutAction","Location","NavigationAction","Plugin","PluginHost","PluginProvider","Resource","ResourceKey","ResourceLanguage","SettingsAction","Surface","SurfaceProvider","Toast","createApp","defaultFileTypes","definePlugin","filterPlugins","findPlugin","getPlugin","initializePlugin","isObject","parseFileManagerPlugin","parseGraphBuilderPlugin","parseGraphPlugin","parseIntentPlugin","parseIntentResolverPlugin","parseLayoutPlugin","parseMetadataRecordsPlugin","parseMetadataResolverPlugin","parseNavigationPlugin","parsePluginHost","parseRootSurfacePlugin","parseSettingsPlugin","parseSurfacePlugin","parseTranslationsPlugin","pluginMeta","resolvePlugin","useIntent","useIntentDispatcher","useIntentResolver","usePlugin","usePlugins","useResolvePlugin","useSurface","useSurfaceRoot"],"entryPoint":"packages/sdk/app-framework/src/index.ts","inputs":{"packages/sdk/app-framework/src/plugins/common/file.ts":{"bytesInOutput":277},"packages/sdk/app-framework/src/plugins/common/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/plugins/common/graph.ts":{"bytesInOutput":174},"packages/sdk/app-framework/src/plugins/common/layout.ts":{"bytesInOutput":1425},"packages/sdk/app-framework/src/plugins/common/metadata.ts":{"bytesInOutput":226},"packages/sdk/app-framework/src/plugins/common/navigation.ts":{"bytesInOutput":612},"packages/sdk/app-framework/src/plugins/common/settings.ts":{"bytesInOutput":341},"packages/sdk/app-framework/src/plugins/common/translations.ts":{"bytesInOutput":357},"packages/sdk/app-framework/src/plugins/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/plugins/IntentPlugin/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/plugins/PluginHost/plugin.ts":{"bytesInOutput":230},"packages/sdk/app-framework/src/plugins/PluginHost/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/plugins/PluginHost/PluginContext.tsx":{"bytesInOutput":512},"packages/sdk/app-framework/src/plugins/PluginHost/PluginHost.tsx":{"bytesInOutput":5237},"packages/sdk/app-framework/src/plugins/SurfacePlugin/helpers.ts":{"bytesInOutput":61},"packages/sdk/app-framework/src/plugins/SurfacePlugin/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/plugins/SurfacePlugin/ErrorBoundary.tsx":{"bytesInOutput":674},"packages/sdk/app-framework/src/plugins/SurfacePlugin/Surface.tsx":{"bytesInOutput":2735},"packages/sdk/app-framework/src/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/App.tsx":{"bytesInOutput":1153}},"bytes":16383},"packages/sdk/app-framework/dist/lib/node/plugin-ZJ26B7E5.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2039},"packages/sdk/app-framework/dist/lib/node/plugin-ZJ26B7E5.cjs":{"imports":[{"path":"packages/sdk/app-framework/dist/lib/node/chunk-BTZLKXA2.cjs","kind":"import-statement"},{"path":"packages/sdk/app-framework/dist/lib/node/chunk-62W6CMGM.cjs","kind":"import-statement"},{"path":"deepsignal/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/sdk/app-framework/src/plugins/SurfacePlugin/plugin.tsx","inputs":{"packages/sdk/app-framework/src/plugins/SurfacePlugin/plugin.tsx":{"bytesInOutput":680}},"bytes":985},"packages/sdk/app-framework/dist/lib/node/chunk-BTZLKXA2.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3074},"packages/sdk/app-framework/dist/lib/node/chunk-BTZLKXA2.cjs":{"imports":[{"path":"react","kind":"import-statement","external":true}],"exports":["SurfaceProvider","meta_default","parseRootSurfacePlugin","parseSurfacePlugin","useSurfaceRoot"],"inputs":{"packages/sdk/app-framework/src/plugins/SurfacePlugin/provides.ts":{"bytesInOutput":191},"packages/sdk/app-framework/src/plugins/SurfacePlugin/SurfaceRootContext.tsx":{"bytesInOutput":239},"packages/sdk/app-framework/src/plugins/SurfacePlugin/meta.ts":{"bytesInOutput":87}},"bytes":887},"packages/sdk/app-framework/dist/lib/node/plugin-VEIZZVQP.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":9329},"packages/sdk/app-framework/dist/lib/node/plugin-VEIZZVQP.cjs":{"imports":[{"path":"packages/sdk/app-framework/dist/lib/node/chunk-DFST5IG5.cjs","kind":"import-statement"},{"path":"packages/sdk/app-framework/dist/lib/node/chunk-62W6CMGM.cjs","kind":"import-statement"},{"path":"deepsignal/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/sdk/app-framework/src/plugins/IntentPlugin/plugin.tsx","inputs":{"packages/sdk/app-framework/src/plugins/IntentPlugin/plugin.tsx":{"bytesInOutput":4551},"packages/sdk/app-framework/src/plugins/IntentPlugin/helpers.ts":{"bytesInOutput":94}},"bytes":5119},"packages/sdk/app-framework/dist/lib/node/chunk-DFST5IG5.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3904},"packages/sdk/app-framework/dist/lib/node/chunk-DFST5IG5.cjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["IntentAction","IntentProvider","meta_default","parseIntentPlugin","parseIntentResolverPlugin","useIntent","useIntentDispatcher","useIntentResolver"],"inputs":{"packages/sdk/app-framework/src/plugins/IntentPlugin/provides.ts":{"bytesInOutput":406},"packages/sdk/app-framework/src/plugins/IntentPlugin/IntentContext.tsx":{"bytesInOutput":637},"packages/sdk/app-framework/src/plugins/IntentPlugin/meta.ts":{"bytesInOutput":84}},"bytes":1545},"packages/sdk/app-framework/dist/lib/node/chunk-62W6CMGM.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2286},"packages/sdk/app-framework/dist/lib/node/chunk-62W6CMGM.cjs":{"imports":[{"path":"@dxos/debug","kind":"import-statement","external":true}],"exports":["definePlugin","filterPlugins","findPlugin","getPlugin","resolvePlugin"],"inputs":{"packages/sdk/app-framework/src/plugins/helpers.ts":{"bytesInOutput":564}},"bytes":750}}}
|
|
1
|
+
{"inputs":{"packages/sdk/app-framework/src/plugins/common/file.ts":{"bytes":2670,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/graph.ts":{"bytes":2173,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/layout.ts":{"bytes":9327,"imports":[{"path":"zod","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/metadata.ts":{"bytes":2058,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/navigation.ts":{"bytes":4314,"imports":[{"path":"zod","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/settings.ts":{"bytes":2053,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/translations.ts":{"bytes":3465,"imports":[{"path":"zod","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/index.ts":{"bytes":1006,"imports":[{"path":"packages/sdk/app-framework/src/plugins/common/file.ts","kind":"import-statement","original":"./file"},{"path":"packages/sdk/app-framework/src/plugins/common/graph.ts","kind":"import-statement","original":"./graph"},{"path":"packages/sdk/app-framework/src/plugins/common/layout.ts","kind":"import-statement","original":"./layout"},{"path":"packages/sdk/app-framework/src/plugins/common/metadata.ts","kind":"import-statement","original":"./metadata"},{"path":"packages/sdk/app-framework/src/plugins/common/navigation.ts","kind":"import-statement","original":"./navigation"},{"path":"packages/sdk/app-framework/src/plugins/common/settings.ts","kind":"import-statement","original":"./settings"},{"path":"packages/sdk/app-framework/src/plugins/common/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/helpers.ts":{"bytes":4350,"imports":[{"path":"@dxos/debug","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/intent.ts":{"bytes":3705,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/provides.ts":{"bytes":2675,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/IntentContext.tsx":{"bytes":4026,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/index.ts":{"bytes":678,"imports":[{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/intent.ts","kind":"import-statement","original":"./intent"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/provides.ts","kind":"import-statement","original":"./provides"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/IntentContext.tsx","kind":"import-statement","original":"./IntentContext"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/PluginHost/plugin.ts":{"bytes":5280,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/PluginHost/PluginContext.tsx":{"bytes":4030,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/helpers.ts","kind":"import-statement","original":"../helpers"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/helpers.ts":{"bytes":1765,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/provides.ts":{"bytes":1938,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/ErrorBoundary.tsx":{"bytes":4120,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/SurfaceRootContext.tsx":{"bytes":2763,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/Surface.tsx":{"bytes":13757,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/ErrorBoundary.tsx","kind":"import-statement","original":"./ErrorBoundary"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/SurfaceRootContext.tsx","kind":"import-statement","original":"./SurfaceRootContext"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/index.ts":{"bytes":881,"imports":[{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/provides.ts","kind":"import-statement","original":"./provides"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/ErrorBoundary.tsx","kind":"import-statement","original":"./ErrorBoundary"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/Surface.tsx","kind":"import-statement","original":"./Surface"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/SurfaceRootContext.tsx","kind":"import-statement","original":"./SurfaceRootContext"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/PluginHost/PluginHost.tsx":{"bytes":21198,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/PluginHost/PluginContext.tsx","kind":"import-statement","original":"./PluginContext"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/index.ts","kind":"import-statement","original":"../SurfacePlugin"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/PluginHost/index.ts":{"bytes":678,"imports":[{"path":"packages/sdk/app-framework/src/plugins/PluginHost/plugin.ts","kind":"import-statement","original":"./plugin"},{"path":"packages/sdk/app-framework/src/plugins/PluginHost/PluginContext.tsx","kind":"import-statement","original":"./PluginContext"},{"path":"packages/sdk/app-framework/src/plugins/PluginHost/PluginHost.tsx","kind":"import-statement","original":"./PluginHost"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/index.ts":{"bytes":854,"imports":[{"path":"packages/sdk/app-framework/src/plugins/common/index.ts","kind":"import-statement","original":"./common"},{"path":"packages/sdk/app-framework/src/plugins/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/index.ts","kind":"import-statement","original":"./IntentPlugin"},{"path":"packages/sdk/app-framework/src/plugins/PluginHost/index.ts","kind":"import-statement","original":"./PluginHost"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/index.ts","kind":"import-statement","original":"./SurfacePlugin"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/meta.ts":{"bytes":690,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/meta.ts":{"bytes":698,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/plugin.tsx":{"bytes":3906,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema/schema","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/SurfaceRootContext.tsx","kind":"import-statement","original":"./SurfaceRootContext"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/provides.ts","kind":"import-statement","original":"./provides"},{"path":"packages/sdk/app-framework/src/plugins/helpers.ts","kind":"import-statement","original":"../helpers"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/helpers.ts":{"bytes":1138,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/plugin.tsx":{"bytes":18873,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema/schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/IntentContext.tsx","kind":"import-statement","original":"./IntentContext"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/provides.ts","kind":"import-statement","original":"./provides"},{"path":"packages/sdk/app-framework/src/plugins/helpers.ts","kind":"import-statement","original":"../helpers"}],"format":"esm"},"packages/sdk/app-framework/src/App.tsx":{"bytes":6903,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/index.ts","kind":"import-statement","original":"./plugins"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/meta.ts","kind":"import-statement","original":"./plugins/IntentPlugin/meta"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/meta.ts","kind":"import-statement","original":"./plugins/SurfacePlugin/meta"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/plugin.tsx","kind":"dynamic-import","original":"./plugins/SurfacePlugin/plugin"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/plugin.tsx","kind":"dynamic-import","original":"./plugins/IntentPlugin/plugin"}],"format":"esm"},"packages/sdk/app-framework/src/index.ts":{"bytes":544,"imports":[{"path":"packages/sdk/app-framework/src/plugins/index.ts","kind":"import-statement","original":"./plugins"},{"path":"packages/sdk/app-framework/src/App.tsx","kind":"import-statement","original":"./App"}],"format":"esm"}},"outputs":{"packages/sdk/app-framework/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":43837},"packages/sdk/app-framework/dist/lib/node/index.cjs":{"imports":[{"path":"packages/sdk/app-framework/dist/lib/node/chunk-BTZLKXA2.cjs","kind":"import-statement"},{"path":"packages/sdk/app-framework/dist/lib/node/chunk-DFST5IG5.cjs","kind":"import-statement"},{"path":"packages/sdk/app-framework/dist/lib/node/chunk-62W6CMGM.cjs","kind":"import-statement"},{"path":"zod","kind":"import-statement","external":true},{"path":"zod","kind":"import-statement","external":true},{"path":"zod","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/dist/lib/node/plugin-ROMMITVM.cjs","kind":"dynamic-import"},{"path":"packages/sdk/app-framework/dist/lib/node/plugin-3K3YXM6Z.cjs","kind":"dynamic-import"}],"exports":["ErrorBoundary","IntentAction","IntentProvider","Layout","LayoutAction","Location","NavigationAction","Plugin","PluginHost","PluginProvider","Resource","ResourceKey","ResourceLanguage","SettingsAction","Surface","SurfaceProvider","Toast","createApp","defaultFileTypes","definePlugin","filterPlugins","findPlugin","getPlugin","initializePlugin","isObject","parseFileManagerPlugin","parseGraphBuilderPlugin","parseGraphPlugin","parseIntentPlugin","parseIntentResolverPlugin","parseLayoutPlugin","parseMetadataRecordsPlugin","parseMetadataResolverPlugin","parseNavigationPlugin","parsePluginHost","parseRootSurfacePlugin","parseSettingsPlugin","parseSurfacePlugin","parseTranslationsPlugin","pluginMeta","resolvePlugin","useIntent","useIntentDispatcher","useIntentResolver","usePlugin","usePlugins","useResolvePlugin","useSurface","useSurfaceRoot"],"entryPoint":"packages/sdk/app-framework/src/index.ts","inputs":{"packages/sdk/app-framework/src/plugins/common/file.ts":{"bytesInOutput":288},"packages/sdk/app-framework/src/plugins/common/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/plugins/common/graph.ts":{"bytesInOutput":174},"packages/sdk/app-framework/src/plugins/common/layout.ts":{"bytesInOutput":1425},"packages/sdk/app-framework/src/plugins/common/metadata.ts":{"bytesInOutput":226},"packages/sdk/app-framework/src/plugins/common/navigation.ts":{"bytesInOutput":612},"packages/sdk/app-framework/src/plugins/common/settings.ts":{"bytesInOutput":341},"packages/sdk/app-framework/src/plugins/common/translations.ts":{"bytesInOutput":357},"packages/sdk/app-framework/src/plugins/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/plugins/IntentPlugin/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/plugins/PluginHost/plugin.ts":{"bytesInOutput":230},"packages/sdk/app-framework/src/plugins/PluginHost/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/plugins/PluginHost/PluginContext.tsx":{"bytesInOutput":512},"packages/sdk/app-framework/src/plugins/PluginHost/PluginHost.tsx":{"bytesInOutput":5192},"packages/sdk/app-framework/src/plugins/SurfacePlugin/helpers.ts":{"bytesInOutput":61},"packages/sdk/app-framework/src/plugins/SurfacePlugin/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/plugins/SurfacePlugin/ErrorBoundary.tsx":{"bytesInOutput":674},"packages/sdk/app-framework/src/plugins/SurfacePlugin/Surface.tsx":{"bytesInOutput":2735},"packages/sdk/app-framework/src/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/App.tsx":{"bytesInOutput":1153}},"bytes":16349},"packages/sdk/app-framework/dist/lib/node/plugin-ROMMITVM.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1945},"packages/sdk/app-framework/dist/lib/node/plugin-ROMMITVM.cjs":{"imports":[{"path":"packages/sdk/app-framework/dist/lib/node/chunk-BTZLKXA2.cjs","kind":"import-statement"},{"path":"packages/sdk/app-framework/dist/lib/node/chunk-62W6CMGM.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema/schema","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/sdk/app-framework/src/plugins/SurfacePlugin/plugin.tsx","inputs":{"packages/sdk/app-framework/src/plugins/SurfacePlugin/plugin.tsx":{"bytesInOutput":660}},"bytes":965},"packages/sdk/app-framework/dist/lib/node/chunk-BTZLKXA2.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3074},"packages/sdk/app-framework/dist/lib/node/chunk-BTZLKXA2.cjs":{"imports":[{"path":"react","kind":"import-statement","external":true}],"exports":["SurfaceProvider","meta_default","parseRootSurfacePlugin","parseSurfacePlugin","useSurfaceRoot"],"inputs":{"packages/sdk/app-framework/src/plugins/SurfacePlugin/provides.ts":{"bytesInOutput":191},"packages/sdk/app-framework/src/plugins/SurfacePlugin/SurfaceRootContext.tsx":{"bytesInOutput":239},"packages/sdk/app-framework/src/plugins/SurfacePlugin/meta.ts":{"bytesInOutput":87}},"bytes":887},"packages/sdk/app-framework/dist/lib/node/plugin-3K3YXM6Z.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":9312},"packages/sdk/app-framework/dist/lib/node/plugin-3K3YXM6Z.cjs":{"imports":[{"path":"packages/sdk/app-framework/dist/lib/node/chunk-DFST5IG5.cjs","kind":"import-statement"},{"path":"packages/sdk/app-framework/dist/lib/node/chunk-62W6CMGM.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema/schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/sdk/app-framework/src/plugins/IntentPlugin/plugin.tsx","inputs":{"packages/sdk/app-framework/src/plugins/IntentPlugin/plugin.tsx":{"bytesInOutput":4549},"packages/sdk/app-framework/src/plugins/IntentPlugin/helpers.ts":{"bytesInOutput":94}},"bytes":5117},"packages/sdk/app-framework/dist/lib/node/chunk-DFST5IG5.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3904},"packages/sdk/app-framework/dist/lib/node/chunk-DFST5IG5.cjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["IntentAction","IntentProvider","meta_default","parseIntentPlugin","parseIntentResolverPlugin","useIntent","useIntentDispatcher","useIntentResolver"],"inputs":{"packages/sdk/app-framework/src/plugins/IntentPlugin/provides.ts":{"bytesInOutput":406},"packages/sdk/app-framework/src/plugins/IntentPlugin/IntentContext.tsx":{"bytesInOutput":637},"packages/sdk/app-framework/src/plugins/IntentPlugin/meta.ts":{"bytesInOutput":84}},"bytes":1545},"packages/sdk/app-framework/dist/lib/node/chunk-62W6CMGM.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2286},"packages/sdk/app-framework/dist/lib/node/chunk-62W6CMGM.cjs":{"imports":[{"path":"@dxos/debug","kind":"import-statement","external":true}],"exports":["definePlugin","filterPlugins","findPlugin","getPlugin","resolvePlugin"],"inputs":{"packages/sdk/app-framework/src/plugins/helpers.ts":{"bytesInOutput":564}},"bytes":750}}}
|