@dxos/app-framework 0.8.1-main.ba2dec9 → 0.8.1-staging.5be625a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{app-graph-builder-IAEV7KKF.mjs → app-graph-builder-OD3G2J2U.mjs} +2 -2
- package/dist/lib/browser/{chunk-PWAAJE2Z.mjs → chunk-CESGLKOM.mjs} +4 -3
- package/dist/lib/browser/{chunk-PWAAJE2Z.mjs.map → chunk-CESGLKOM.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-CIP4C47B.mjs → chunk-KP6FVIAA.mjs} +7 -6
- package/dist/lib/browser/chunk-KP6FVIAA.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +7 -6
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-dispatcher-UR566RVO.mjs → intent-dispatcher-RTXTATZJ.mjs} +2 -2
- package/dist/lib/browser/{intent-resolver-LEJ3X6CP.mjs → intent-resolver-ZL6WBF2L.mjs} +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{store-5TN4OLFQ.mjs → store-JIKLP4JL.mjs} +2 -2
- package/dist/lib/browser/testing/index.mjs +4 -3
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/browser/worker.mjs +1 -1
- package/dist/lib/node/{app-graph-builder-3RWOZENP.cjs → app-graph-builder-S3ER53EH.cjs} +12 -12
- package/dist/lib/node/{chunk-JLQABYHB.cjs → chunk-4YBMWZR3.cjs} +23 -22
- package/dist/lib/node/chunk-4YBMWZR3.cjs.map +7 -0
- package/dist/lib/node/{chunk-XP4TI5DS.cjs → chunk-KRK7EH6Z.cjs} +7 -6
- package/dist/lib/node/{chunk-XP4TI5DS.cjs.map → chunk-KRK7EH6Z.cjs.map} +2 -2
- package/dist/lib/node/index.cjs +68 -67
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-dispatcher-EDW7NFJ4.cjs → intent-dispatcher-TBTSYYGJ.cjs} +8 -8
- package/dist/lib/node/{intent-dispatcher-EDW7NFJ4.cjs.map → intent-dispatcher-TBTSYYGJ.cjs.map} +2 -2
- package/dist/lib/node/{intent-resolver-34J5IM27.cjs → intent-resolver-IYW254AY.cjs} +8 -8
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{store-3I3UFH5D.cjs → store-KGQB37IW.cjs} +7 -7
- package/dist/lib/node/testing/index.cjs +10 -9
- package/dist/lib/node/testing/index.cjs.map +3 -3
- package/dist/lib/node/worker.cjs +37 -37
- package/dist/lib/node/worker.cjs.map +1 -1
- package/dist/lib/node-esm/{app-graph-builder-RG3DT2OD.mjs → app-graph-builder-UP3LWWYO.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-T2URISUU.mjs → chunk-MZCAK52M.mjs} +7 -6
- package/dist/lib/node-esm/chunk-MZCAK52M.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-NIVSBD3D.mjs → chunk-RQWO2T4E.mjs} +4 -3
- package/dist/lib/node-esm/{chunk-NIVSBD3D.mjs.map → chunk-RQWO2T4E.mjs.map} +3 -3
- package/dist/lib/node-esm/index.mjs +7 -6
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-dispatcher-7GCMKMSQ.mjs → intent-dispatcher-7UNJKY3C.mjs} +2 -2
- package/dist/lib/node-esm/{intent-resolver-7T6UOQOS.mjs → intent-resolver-6MHZSVCT.mjs} +2 -2
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{store-PTKVELJP.mjs → store-YSFTF2GM.mjs} +2 -2
- package/dist/lib/node-esm/testing/index.mjs +4 -3
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/lib/node-esm/worker.mjs +1 -1
- package/dist/types/src/common/surface.d.ts +4 -7
- package/dist/types/src/common/surface.d.ts.map +1 -1
- package/dist/types/src/core/plugin.d.ts +1 -1
- package/dist/types/src/core/plugin.d.ts.map +1 -1
- package/dist/types/src/react/Surface.d.ts.map +1 -1
- package/package.json +18 -18
- package/src/common/surface.ts +6 -1
- package/src/core/manager.test.ts +30 -30
- package/src/core/plugin.ts +1 -1
- package/src/playground/debug/plugin.ts +1 -1
- package/src/playground/generator/generator.ts +1 -1
- package/src/playground/generator/plugin.ts +1 -1
- package/src/playground/layout/plugin.ts +1 -1
- package/src/playground/logger/plugin.ts +1 -1
- package/src/plugin-intent/IntentPlugin.tsx +1 -1
- package/src/plugin-settings/SettingsPlugin.ts +1 -1
- package/src/react/Surface.tsx +5 -3
- package/src/testing/withPluginManager.tsx +1 -1
- package/dist/lib/browser/chunk-CIP4C47B.mjs.map +0 -7
- package/dist/lib/node/chunk-JLQABYHB.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-T2URISUU.mjs.map +0 -7
- /package/dist/lib/browser/{app-graph-builder-IAEV7KKF.mjs.map → app-graph-builder-OD3G2J2U.mjs.map} +0 -0
- /package/dist/lib/browser/{intent-dispatcher-UR566RVO.mjs.map → intent-dispatcher-RTXTATZJ.mjs.map} +0 -0
- /package/dist/lib/browser/{intent-resolver-LEJ3X6CP.mjs.map → intent-resolver-ZL6WBF2L.mjs.map} +0 -0
- /package/dist/lib/browser/{store-5TN4OLFQ.mjs.map → store-JIKLP4JL.mjs.map} +0 -0
- /package/dist/lib/node/{app-graph-builder-3RWOZENP.cjs.map → app-graph-builder-S3ER53EH.cjs.map} +0 -0
- /package/dist/lib/node/{intent-resolver-34J5IM27.cjs.map → intent-resolver-IYW254AY.cjs.map} +0 -0
- /package/dist/lib/node/{store-3I3UFH5D.cjs.map → store-KGQB37IW.cjs.map} +0 -0
- /package/dist/lib/node-esm/{app-graph-builder-RG3DT2OD.mjs.map → app-graph-builder-UP3LWWYO.mjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-dispatcher-7GCMKMSQ.mjs.map → intent-dispatcher-7UNJKY3C.mjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-resolver-7T6UOQOS.mjs.map → intent-resolver-6MHZSVCT.mjs.map} +0 -0
- /package/dist/lib/node-esm/{store-PTKVELJP.mjs.map → store-YSFTF2GM.mjs.map} +0 -0
|
@@ -26,8 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_4YBMWZR3_exports = {};
|
|
30
|
+
__export(chunk_4YBMWZR3_exports, {
|
|
31
31
|
ErrorBoundary: () => ErrorBoundary,
|
|
32
32
|
PluginManagerProvider: () => PluginManagerProvider,
|
|
33
33
|
Surface: () => Surface,
|
|
@@ -42,8 +42,8 @@ __export(chunk_JLQABYHB_exports, {
|
|
|
42
42
|
usePluginManager: () => usePluginManager,
|
|
43
43
|
useSurfaces: () => useSurfaces
|
|
44
44
|
});
|
|
45
|
-
module.exports = __toCommonJS(
|
|
46
|
-
var
|
|
45
|
+
module.exports = __toCommonJS(chunk_4YBMWZR3_exports);
|
|
46
|
+
var import_chunk_KRK7EH6Z = require("./chunk-KRK7EH6Z.cjs");
|
|
47
47
|
var import_react = require("react");
|
|
48
48
|
var import_debug = require("@dxos/debug");
|
|
49
49
|
var import_signals_core = require("@preact/signals-core");
|
|
@@ -74,9 +74,9 @@ var useCapability = (interfaceDef, filter) => {
|
|
|
74
74
|
]);
|
|
75
75
|
return signal.value;
|
|
76
76
|
};
|
|
77
|
-
var useIntentDispatcher = () => useCapability(
|
|
78
|
-
var useAppGraph = () => useCapability(
|
|
79
|
-
var useLayout = () => useCapability(
|
|
77
|
+
var useIntentDispatcher = () => useCapability(import_chunk_KRK7EH6Z.Capabilities.IntentDispatcher);
|
|
78
|
+
var useAppGraph = () => useCapability(import_chunk_KRK7EH6Z.Capabilities.AppGraph);
|
|
79
|
+
var useLayout = () => useCapability(import_chunk_KRK7EH6Z.Capabilities.Layout);
|
|
80
80
|
var ErrorBoundary = class extends import_react3.Component {
|
|
81
81
|
constructor(props) {
|
|
82
82
|
super(props);
|
|
@@ -110,8 +110,9 @@ var ErrorBoundary = class extends import_react3.Component {
|
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
112
|
};
|
|
113
|
+
var DEFAULT_PLACEHOLDER = /* @__PURE__ */ import_react4.default.createElement(import_react4.Fragment, null);
|
|
113
114
|
var useSurfaces = () => {
|
|
114
|
-
const surfaces = useCapabilities(
|
|
115
|
+
const surfaces = useCapabilities(import_chunk_KRK7EH6Z.Capabilities.ReactSurface);
|
|
115
116
|
return (0, import_react4.useMemo)(() => surfaces.flat(), [
|
|
116
117
|
surfaces
|
|
117
118
|
]);
|
|
@@ -120,14 +121,14 @@ var findCandidates = (surfaces, { role, data }) => {
|
|
|
120
121
|
return Object.values(surfaces).filter((definition) => Array.isArray(definition.role) ? definition.role.includes(role) : definition.role === role).filter(({ filter }) => filter ? filter(data ?? {}) : true).toSorted(import_util.byPosition);
|
|
121
122
|
};
|
|
122
123
|
var isSurfaceAvailable = (context, { role, data }) => {
|
|
123
|
-
const surfaces = context.requestCapabilities(
|
|
124
|
+
const surfaces = context.requestCapabilities(import_chunk_KRK7EH6Z.Capabilities.ReactSurface);
|
|
124
125
|
const candidates = findCandidates(surfaces.flat(), {
|
|
125
126
|
role,
|
|
126
127
|
data
|
|
127
128
|
});
|
|
128
129
|
return candidates.length > 0;
|
|
129
130
|
};
|
|
130
|
-
var Surface = /* @__PURE__ */ (0, import_react4.memo)(/* @__PURE__ */ (0, import_react4.forwardRef)(({ id: _id, role, data: _data, limit, fallback, placeholder, ...rest }, forwardedRef) => {
|
|
131
|
+
var Surface = /* @__PURE__ */ (0, import_react4.memo)(/* @__PURE__ */ (0, import_react4.forwardRef)(({ id: _id, role, data: _data, limit, fallback, placeholder = DEFAULT_PLACEHOLDER, ...rest }, forwardedRef) => {
|
|
131
132
|
const surfaces = useSurfaces();
|
|
132
133
|
const data = (0, import_react_hooks.useDefaultValue)(_data, () => ({}));
|
|
133
134
|
const definitions = findCandidates(surfaces, {
|
|
@@ -144,9 +145,9 @@ var Surface = /* @__PURE__ */ (0, import_react4.memo)(/* @__PURE__ */ (0, import
|
|
|
144
145
|
limit,
|
|
145
146
|
...rest
|
|
146
147
|
}));
|
|
147
|
-
const suspense =
|
|
148
|
+
const suspense = /* @__PURE__ */ import_react4.default.createElement(import_react4.Suspense, {
|
|
148
149
|
fallback: placeholder
|
|
149
|
-
}, nodes)
|
|
150
|
+
}, nodes);
|
|
150
151
|
return fallback ? /* @__PURE__ */ import_react4.default.createElement(ErrorBoundary, {
|
|
151
152
|
data,
|
|
152
153
|
fallback
|
|
@@ -158,10 +159,10 @@ var useIntentResolver = (module2, resolver) => {
|
|
|
158
159
|
(0, import_react5.useEffect)(() => {
|
|
159
160
|
manager.context.contributeCapability({
|
|
160
161
|
module: module2,
|
|
161
|
-
interface:
|
|
162
|
+
interface: import_chunk_KRK7EH6Z.Capabilities.IntentResolver,
|
|
162
163
|
implementation: resolver
|
|
163
164
|
});
|
|
164
|
-
return () => manager.context.removeCapability(
|
|
165
|
+
return () => manager.context.removeCapability(import_chunk_KRK7EH6Z.Capabilities.IntentResolver, resolver);
|
|
165
166
|
}, [
|
|
166
167
|
module2,
|
|
167
168
|
resolver
|
|
@@ -218,14 +219,14 @@ var createApp = ({ pluginManager, pluginLoader: _pluginLoader, plugins = [], cor
|
|
|
218
219
|
});
|
|
219
220
|
const cached = JSON.parse(localStorage.getItem(ENABLED_KEY) ?? "[]");
|
|
220
221
|
const enabled = cacheEnabled && cached.length > 0 ? cached : defaults;
|
|
221
|
-
const manager = pluginManager ?? new
|
|
222
|
+
const manager = pluginManager ?? new import_chunk_KRK7EH6Z.PluginManager({
|
|
222
223
|
pluginLoader,
|
|
223
224
|
plugins,
|
|
224
225
|
core,
|
|
225
226
|
enabled
|
|
226
227
|
});
|
|
227
228
|
manager.activation.on(({ event, state: _state, error }) => {
|
|
228
|
-
if (!state.ready && event ===
|
|
229
|
+
if (!state.ready && event === import_chunk_KRK7EH6Z.Events.Startup.id) {
|
|
229
230
|
state.ready = _state === "activated";
|
|
230
231
|
}
|
|
231
232
|
if (error && !state.ready && !state.error) {
|
|
@@ -236,13 +237,13 @@ var createApp = ({ pluginManager, pluginLoader: _pluginLoader, plugins = [], cor
|
|
|
236
237
|
cacheEnabled && localStorage.setItem(ENABLED_KEY, JSON.stringify(manager.enabled));
|
|
237
238
|
});
|
|
238
239
|
manager.context.contributeCapability({
|
|
239
|
-
interface:
|
|
240
|
+
interface: import_chunk_KRK7EH6Z.Capabilities.PluginManager,
|
|
240
241
|
implementation: manager,
|
|
241
242
|
module: "dxos.org/app-framework/plugin-manager"
|
|
242
243
|
});
|
|
243
244
|
setupDevtools(manager);
|
|
244
|
-
void manager.activate(
|
|
245
|
-
void manager.activate(
|
|
245
|
+
void manager.activate(import_chunk_KRK7EH6Z.Events.SetupReactSurface);
|
|
246
|
+
void manager.activate(import_chunk_KRK7EH6Z.Events.Startup);
|
|
246
247
|
return () => /* @__PURE__ */ import_react6.default.createElement(ErrorBoundary, {
|
|
247
248
|
fallback
|
|
248
249
|
}, /* @__PURE__ */ import_react6.default.createElement(PluginManagerProvider, {
|
|
@@ -253,8 +254,8 @@ var createApp = ({ pluginManager, pluginLoader: _pluginLoader, plugins = [], cor
|
|
|
253
254
|
})));
|
|
254
255
|
};
|
|
255
256
|
var App = ({ placeholder, state }) => {
|
|
256
|
-
const reactContexts = useCapabilities(
|
|
257
|
-
const reactRoots = useCapabilities(
|
|
257
|
+
const reactContexts = useCapabilities(import_chunk_KRK7EH6Z.Capabilities.ReactContext);
|
|
258
|
+
const reactRoots = useCapabilities(import_chunk_KRK7EH6Z.Capabilities.ReactRoot);
|
|
258
259
|
if (state.error) {
|
|
259
260
|
throw state.error;
|
|
260
261
|
}
|
|
@@ -305,4 +306,4 @@ var setupDevtools = (manager) => {
|
|
|
305
306
|
usePluginManager,
|
|
306
307
|
useSurfaces
|
|
307
308
|
});
|
|
308
|
-
//# sourceMappingURL=chunk-
|
|
309
|
+
//# sourceMappingURL=chunk-4YBMWZR3.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/react/PluginManagerProvider.ts", "../../../src/react/useCapabilities.ts", "../../../src/react/common.ts", "../../../src/react/ErrorBoundary.tsx", "../../../src/react/Surface.tsx", "../../../src/react/useIntentResolver.ts", "../../../src/App.tsx", "../../../src/helpers.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { createContext, useContext } from 'react';\n\nimport { raise } from '@dxos/debug';\n\nimport { type PluginManager } from '../core';\n\nconst PluginManagerContext = createContext<PluginManager | undefined>(undefined);\n\n/**\n * Get the plugin manager.\n */\nexport const usePluginManager = (): PluginManager =>\n useContext(PluginManagerContext) ?? raise(new Error('Missing PluginManagerContext'));\n\n/**\n * Context provider for a plugin manager.\n */\nexport const PluginManagerProvider = PluginManagerContext.Provider;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { computed } from '@preact/signals-core';\nimport { useMemo } from 'react';\n\nimport { usePluginManager } from './PluginManagerProvider';\nimport { type InterfaceDef } from '../core';\n\n/**\n * Hook to request capabilities from the plugin context.\n * @returns An array of capabilities.\n */\nexport const useCapabilities = <T, U extends T = T>(\n interfaceDef: InterfaceDef<T>,\n filter?: (capability: T, moduleId: string) => capability is U,\n) => {\n const manager = usePluginManager();\n const signal = useMemo(\n () => computed(() => manager.context.requestCapabilities(interfaceDef, filter)),\n [interfaceDef],\n );\n\n return signal.value;\n};\n\n/**\n * Hook to request a capability from the plugin context.\n * @returns The capability.\n * @throws If no capability is found.\n */\nexport const useCapability = <T, U extends T = T>(\n interfaceDef: InterfaceDef<T>,\n filter?: (capability: T, moduleId: string) => capability is U,\n) => {\n const manager = usePluginManager();\n const signal = useMemo(() => computed(() => manager.context.requestCapability(interfaceDef, filter)), [interfaceDef]);\n return signal.value;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useCapability } from './useCapabilities';\nimport { Capabilities } from '../common';\n\nexport const useIntentDispatcher = () => useCapability(Capabilities.IntentDispatcher);\n\nexport const useAppGraph = () => useCapability(Capabilities.AppGraph);\n\nexport const useLayout = () => useCapability(Capabilities.Layout);\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<{ data?: any; 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 data={this.props.data} 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 2025 DXOS.org\n//\n\nimport React, { memo, forwardRef, Suspense, useMemo, Fragment } from 'react';\n\nimport { useDefaultValue } from '@dxos/react-hooks';\nimport { byPosition } from '@dxos/util';\n\nimport { ErrorBoundary } from './ErrorBoundary';\nimport { useCapabilities } from './useCapabilities';\nimport { Capabilities, type SurfaceDefinition, type SurfaceProps } from '../common';\nimport { type PluginsContext } from '../core';\n\nconst DEFAULT_PLACEHOLDER = <Fragment />;\n\n/**\n * @internal\n */\nexport const useSurfaces = () => {\n const surfaces = useCapabilities(Capabilities.ReactSurface);\n return useMemo(() => surfaces.flat(), [surfaces]);\n};\n\nconst findCandidates = (surfaces: SurfaceDefinition[], { role, data }: Pick<SurfaceProps, 'role' | 'data'>) => {\n return Object.values(surfaces)\n .filter((definition) =>\n Array.isArray(definition.role) ? definition.role.includes(role) : definition.role === role,\n )\n .filter(({ filter }) => (filter ? filter(data ?? {}) : true))\n .toSorted(byPosition);\n};\n\n/**\n * @returns `true` if there is a contributed surface which matches the specified role & data, `false` otherwise.\n */\nexport const isSurfaceAvailable = (context: PluginsContext, { role, data }: Pick<SurfaceProps, 'role' | 'data'>) => {\n const surfaces = context.requestCapabilities(Capabilities.ReactSurface);\n const candidates = findCandidates(surfaces.flat(), { role, data });\n return candidates.length > 0;\n};\n\n/**\n * A surface is a named region of the screen that can be populated by plugins.\n */\nexport const Surface = memo(\n forwardRef<HTMLElement, SurfaceProps>(\n ({ id: _id, role, data: _data, limit, fallback, placeholder = DEFAULT_PLACEHOLDER, ...rest }, forwardedRef) => {\n // TODO(wittjosiah): This will make all surfaces depend on a single signal.\n // This isn't ideal because it means that any change to the data will cause all surfaces to re-render.\n // This effectively means that plugin modules which contribute surfaces need to all be activated at startup.\n // This should be fine for now because it's how it worked prior to capabilities api anyways.\n // In the future, it would be nice to be able to bucket the surface contributions by role.\n const surfaces = useSurfaces();\n const data = useDefaultValue(_data, () => ({}));\n\n // NOTE: Memoizing the candidates makes the surface not re-render based on reactivity within data.\n const definitions = findCandidates(surfaces, { role, data });\n const candidates = limit ? definitions.slice(0, limit) : definitions;\n const nodes = candidates.map(({ component: Component, id }) => (\n <Component ref={forwardedRef} key={id} id={id} role={role} data={data} limit={limit} {...rest} />\n ));\n\n const suspense = <Suspense fallback={placeholder}>{nodes}</Suspense>;\n\n return fallback ? (\n <ErrorBoundary data={data} fallback={fallback}>\n {suspense}\n </ErrorBoundary>\n ) : (\n suspense\n );\n },\n ),\n);\n\nSurface.displayName = 'Surface';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useEffect } from 'react';\n\nimport { Capabilities } from '../common';\nimport { type AnyIntentResolver } from '../plugin-intent';\nimport { usePluginManager } from '../react';\n\nexport const useIntentResolver = (module: string, resolver: AnyIntentResolver) => {\n const manager = usePluginManager();\n useEffect(() => {\n manager.context.contributeCapability({\n module,\n interface: Capabilities.IntentResolver,\n implementation: resolver,\n });\n\n return () => manager.context.removeCapability(Capabilities.IntentResolver, resolver);\n }, [module, resolver]);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { effect } from '@preact/signals-core';\nimport React, { type PropsWithChildren, type ReactNode } from 'react';\n\nimport { invariant } from '@dxos/invariant';\nimport { create } from '@dxos/live-object';\n\nimport { Capabilities, Events } from './common';\nimport { PluginManager, type PluginManagerOptions, type Plugin } from './core';\nimport { topologicalSort } from './helpers';\nimport { ErrorBoundary, PluginManagerProvider, useCapabilities } from './react';\n\nconst ENABLED_KEY = 'dxos.org/app-framework/enabled';\n\nexport type CreateAppOptions = {\n pluginManager?: PluginManager;\n pluginLoader?: PluginManagerOptions['pluginLoader'];\n plugins?: Plugin[];\n core?: string[];\n defaults?: string[];\n placeholder?: ReactNode;\n fallback?: ErrorBoundary['props']['fallback'];\n cacheEnabled?: boolean;\n};\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 plugins = [LayoutPlugin(), MyPlugin()];\n * const core = [LayoutPluginId];\n * const default = [MyPluginId];\n * const fallback = <div>Initializing Plugins...</div>;\n * const App = createApp({ plugins, core, default, fallback });\n * createRoot(document.getElementById('root')!).render(\n * <StrictMode>\n * <App />\n * </StrictMode>,\n * );\n *\n * @param params.pluginLoader A function which loads new 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.defaults Default plugins are enabled by default but can be disabled by the user.\n * @param params.placeholder Placeholder component to render during startup.\n * @param params.fallback Fallback component to render if an error occurs during startup.\n * @param params.cacheEnabled Whether to cache enabled plugins in localStorage.\n */\nexport const createApp = ({\n pluginManager,\n pluginLoader: _pluginLoader,\n plugins = [],\n core = plugins.map(({ meta }) => meta.id),\n defaults = [],\n placeholder = null,\n fallback = DefaultFallback,\n cacheEnabled = false,\n}: CreateAppOptions) => {\n // TODO(wittjosiah): Provide a custom plugin loader which supports loading via url.\n const pluginLoader =\n _pluginLoader ??\n ((id: string) => {\n const plugin = plugins.find((plugin) => plugin.meta.id === id);\n invariant(plugin, `Plugin not found: ${id}`);\n return plugin;\n });\n\n const state = create({ ready: false, error: null });\n const cached: string[] = JSON.parse(localStorage.getItem(ENABLED_KEY) ?? '[]');\n const enabled = cacheEnabled && cached.length > 0 ? cached : defaults;\n const manager = pluginManager ?? new PluginManager({ pluginLoader, plugins, core, enabled });\n\n manager.activation.on(({ event, state: _state, error }) => {\n // Once the app is ready the first time, don't show the fallback again.\n if (!state.ready && event === Events.Startup.id) {\n state.ready = _state === 'activated';\n }\n\n if (error && !state.ready && !state.error) {\n state.error = error;\n }\n });\n\n effect(() => {\n cacheEnabled && localStorage.setItem(ENABLED_KEY, JSON.stringify(manager.enabled));\n });\n\n manager.context.contributeCapability({\n interface: Capabilities.PluginManager,\n implementation: manager,\n module: 'dxos.org/app-framework/plugin-manager',\n });\n\n setupDevtools(manager);\n\n // TODO(wittjosiah): Factor out such that this could be called per surface role when attempting to render.\n void manager.activate(Events.SetupReactSurface);\n void manager.activate(Events.Startup);\n\n return () => (\n <ErrorBoundary fallback={fallback}>\n <PluginManagerProvider value={manager}>\n <App placeholder={placeholder} state={state} />\n </PluginManagerProvider>\n </ErrorBoundary>\n );\n};\n\ntype AppProps = Required<Pick<CreateAppOptions, 'placeholder'>> & {\n state: { ready: boolean; error: unknown };\n};\n\nconst App = ({ placeholder, state }: AppProps) => {\n const reactContexts = useCapabilities(Capabilities.ReactContext);\n const reactRoots = useCapabilities(Capabilities.ReactRoot);\n\n if (state.error) {\n // This trigger the error boundary to provide UI feedback for the startup error.\n throw state.error;\n }\n\n // TODO(wittjosiah): Consider using Suspense instead?\n if (!state.ready) {\n return <>{placeholder}</>;\n }\n\n const ComposedContext = composeContexts(reactContexts);\n return (\n <ComposedContext>\n {reactRoots.map(({ id, root: Component }) => (\n <Component key={id} />\n ))}\n </ComposedContext>\n );\n};\n\n// Default fallback does not use tailwind or theme.\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\nconst composeContexts = (contexts: Capabilities.ReactContext[]) => {\n if (contexts.length === 0) {\n return ({ children }: PropsWithChildren) => <>{children}</>;\n }\n\n return topologicalSort(contexts)\n .map(({ context }) => context)\n .reduce((Acc, Next) => ({ children }) => (\n <Acc>\n <Next>{children}</Next>\n </Acc>\n ));\n};\n\nconst setupDevtools = (manager: PluginManager) => {\n (globalThis as any).composer ??= {};\n (globalThis as any).composer.manager = manager;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\ntype DependencyNode = {\n id: string;\n dependsOn?: string[];\n};\n\n/**\n * Topologically sorts a list of nodes based on their dependencies.\n */\n// TODO(wittjosiah): Factor out?\nexport const topologicalSort = <T extends DependencyNode>(nodes: T[]): T[] => {\n const getDependencies = (nodeId: string, seen = new Set<string>(), path = new Set<string>()): string[] => {\n if (path.has(nodeId)) {\n throw new Error(`Circular dependency detected involving ${nodeId}`);\n }\n if (seen.has(nodeId)) {\n return [];\n }\n\n const node = nodes.find((n) => n.id === nodeId);\n if (!node) {\n throw new Error(`Node ${nodeId} not found but is listed as a dependency`);\n }\n\n const newPath = new Set([...path, nodeId]);\n const newSeen = new Set([...seen, nodeId]);\n\n const dependsOn = node.dependsOn ?? [];\n return [...dependsOn.flatMap((depId) => getDependencies(depId, newSeen, newPath)), nodeId];\n };\n\n // Get all unique dependencies.\n const allDependencies = nodes\n .map((node) => node.id)\n .flatMap((id) => getDependencies(id))\n .filter((id, index, self) => self.indexOf(id) === index);\n\n // Map back to original nodes\n return allDependencies\n .map((id) => nodes.find((node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AAmBC,aAAa,CAAC;AACjCD,aAAmBC,SAAS/J,UAAUA;AACzC;",
|
|
6
|
+
"names": ["import_react", "import_signals_core", "PluginManagerContext", "createContext", "undefined", "usePluginManager", "useContext", "raise", "Error", "PluginManagerProvider", "Provider", "useCapabilities", "interfaceDef", "filter", "manager", "signal", "useMemo", "computed", "context", "requestCapabilities", "value", "useCapability", "requestCapability", "useIntentDispatcher", "Capabilities", "IntentDispatcher", "useAppGraph", "AppGraph", "useLayout", "Layout", "ErrorBoundary", "Component", "constructor", "props", "state", "error", "getDerivedStateFromError", "componentDidUpdate", "prevProps", "data", "resetError", "render", "React", "this", "fallback", "reset", "children", "setState", "DEFAULT_PLACEHOLDER", "Fragment", "useSurfaces", "surfaces", "ReactSurface", "flat", "findCandidates", "role", "Object", "values", "definition", "Array", "isArray", "includes", "toSorted", "byPosition", "isSurfaceAvailable", "candidates", "length", "Surface", "memo", "forwardRef", "id", "_id", "_data", "limit", "placeholder", "rest", "forwardedRef", "useDefaultValue", "definitions", "slice", "nodes", "map", "component", "ref", "key", "suspense", "Suspense", "displayName", "useIntentResolver", "module", "resolver", "useEffect", "contributeCapability", "interface", "IntentResolver", "implementation", "removeCapability", "topologicalSort", "getDependencies", "nodeId", "seen", "Set", "path", "has", "node", "find", "n", "newPath", "newSeen", "dependsOn", "flatMap", "depId", "allDependencies", "index", "self", "indexOf", "ENABLED_KEY", "createApp", "pluginManager", "pluginLoader", "_pluginLoader", "plugins", "core", "meta", "defaults", "DefaultFallback", "cacheEnabled", "plugin", "invariant", "create", "ready", "cached", "JSON", "parse", "localStorage", "getItem", "enabled", "PluginManager", "activation", "on", "event", "_state", "Events", "Startup", "effect", "setItem", "stringify", "setupDevtools", "activate", "SetupReactSurface", "App", "reactContexts", "ReactContext", "reactRoots", "ReactRoot", "ComposedContext", "composeContexts", "root", "div", "style", "padding", "h1", "fontSize", "fontWeight", "margin", "message", "pre", "stack", "contexts", "reduce", "Acc", "Next", "globalThis", "composer"]
|
|
7
|
+
}
|
|
@@ -26,8 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_KRK7EH6Z_exports = {};
|
|
30
|
+
__export(chunk_KRK7EH6Z_exports, {
|
|
31
31
|
Capabilities: () => Capabilities,
|
|
32
32
|
Events: () => Events,
|
|
33
33
|
FileInfoSchema: () => FileInfoSchema,
|
|
@@ -66,7 +66,7 @@ __export(chunk_XP4TI5DS_exports, {
|
|
|
66
66
|
lazy: () => lazy,
|
|
67
67
|
oneOf: () => oneOf
|
|
68
68
|
});
|
|
69
|
-
module.exports = __toCommonJS(
|
|
69
|
+
module.exports = __toCommonJS(chunk_KRK7EH6Z_exports);
|
|
70
70
|
var import_effect = require("effect");
|
|
71
71
|
var import_live_object = require("@dxos/live-object");
|
|
72
72
|
var import_log = require("@dxos/log");
|
|
@@ -932,7 +932,8 @@ var FileInfoSchema = import_effect5.Schema.Struct({
|
|
|
932
932
|
cid: import_effect5.Schema.optional(import_effect5.Schema.String)
|
|
933
933
|
});
|
|
934
934
|
var IntentPlugin = () => definePlugin({
|
|
935
|
-
id: INTENT_PLUGIN
|
|
935
|
+
id: INTENT_PLUGIN,
|
|
936
|
+
name: "Intent"
|
|
936
937
|
}, [
|
|
937
938
|
defineModule({
|
|
938
939
|
id: `${INTENT_PLUGIN}/module/dispatcher`,
|
|
@@ -943,7 +944,7 @@ var IntentPlugin = () => definePlugin({
|
|
|
943
944
|
activatesAfter: [
|
|
944
945
|
Events.DispatcherReady
|
|
945
946
|
],
|
|
946
|
-
activate: lazy(() => import("./intent-dispatcher-
|
|
947
|
+
activate: lazy(() => import("./intent-dispatcher-TBTSYYGJ.cjs"))
|
|
947
948
|
})
|
|
948
949
|
]);
|
|
949
950
|
var LAYOUT_PLUGIN = "dxos.org/plugin/layout";
|
|
@@ -1463,4 +1464,4 @@ var intent_dispatcher_default = (context) => {
|
|
|
1463
1464
|
lazy,
|
|
1464
1465
|
oneOf
|
|
1465
1466
|
});
|
|
1466
|
-
//# sourceMappingURL=chunk-
|
|
1467
|
+
//# sourceMappingURL=chunk-KRK7EH6Z.cjs.map
|