@dxos/app-framework 0.8.3 → 0.8.4-main.2e9d522
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/.swc/plugins/v7_linux_x86_64_13.0.0/f45bdff002284d9e8f9ef3f0be909de12da36c049cbcf261ac78fc00abb09a2d +0 -0
- package/.swc/plugins/v7_linux_x86_64_13.0.0/fce1bdb8e20a094e4af08bad09cc81497ed0e2e7c51223b07d371063cca18429 +0 -0
- package/README.md +0 -8
- package/dist/lib/browser/{app-graph-builder-BI4VVKSW.mjs → app-graph-builder-LYF7EKNN.mjs} +4 -4
- package/dist/lib/browser/{chunk-EHM4UI3V.mjs → chunk-FMN65HSW.mjs} +26 -25
- package/dist/lib/browser/{chunk-EHM4UI3V.mjs.map → chunk-FMN65HSW.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-DIBVO47Z.mjs → chunk-FO2PH7M3.mjs} +27 -18
- package/dist/lib/browser/{chunk-DIBVO47Z.mjs.map → chunk-FO2PH7M3.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-WWEJRWFX.mjs → chunk-ORWHM7CO.mjs} +2 -2
- package/dist/lib/browser/index.mjs +10 -10
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-dispatcher-XVBOMF2Y.mjs → intent-dispatcher-LSYQZSEB.mjs} +2 -2
- package/dist/lib/browser/{intent-resolver-3QMBXLIY.mjs → intent-resolver-ZTNOSO3A.mjs} +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{store-5H7XPJGA.mjs → store-KML2R4IE.mjs} +3 -3
- package/dist/lib/browser/testing/index.mjs +3 -3
- package/dist/lib/browser/worker.mjs +1 -1
- package/dist/lib/node-esm/{app-graph-builder-NROP6RPQ.mjs → app-graph-builder-SAOWGJDK.mjs} +4 -4
- package/dist/lib/node-esm/{chunk-FHNZZWP4.mjs → chunk-73HGSHKE.mjs} +27 -18
- package/dist/lib/node-esm/{chunk-FHNZZWP4.mjs.map → chunk-73HGSHKE.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-I6BVZMAH.mjs → chunk-UMZQERLE.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-2J6FVECI.mjs → chunk-ZEZ4FVEU.mjs} +26 -25
- package/dist/lib/node-esm/{chunk-2J6FVECI.mjs.map → chunk-ZEZ4FVEU.mjs.map} +3 -3
- package/dist/lib/node-esm/index.mjs +10 -10
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-dispatcher-7JPGLCQ5.mjs → intent-dispatcher-6CYNGPSW.mjs} +2 -2
- package/dist/lib/node-esm/{intent-resolver-VY4X5UHN.mjs → intent-resolver-W7Z7WFFM.mjs} +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{store-UKD2R2KA.mjs → store-QEXGXLWZ.mjs} +3 -3
- package/dist/lib/node-esm/testing/index.mjs +3 -3
- package/dist/lib/node-esm/worker.mjs +1 -1
- package/dist/types/src/common/capabilities.d.ts +4 -2
- package/dist/types/src/common/capabilities.d.ts.map +1 -1
- package/dist/types/src/common/index.d.ts +1 -1
- package/dist/types/src/common/index.d.ts.map +1 -1
- package/dist/types/src/plugin-settings/translations.d.ts +7 -8
- package/dist/types/src/plugin-settings/translations.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/moon.yml +14 -0
- package/package.json +28 -28
- package/src/App.tsx +3 -3
- package/src/common/capabilities.ts +9 -3
- package/src/common/index.ts +1 -1
- package/src/core/manager.test.ts +1 -2
- package/src/plugin-settings/SettingsPlugin.ts +1 -1
- package/src/plugin-settings/translations.ts +4 -2
- package/tsconfig.json +4 -1
- package/vitest.config.ts +5 -2
- package/.eslintrc.cjs +0 -9
- package/README.yml +0 -5
- package/dist/lib/node/app-graph-builder-H7QVE4MJ.cjs +0 -146
- package/dist/lib/node/app-graph-builder-H7QVE4MJ.cjs.map +0 -7
- package/dist/lib/node/chunk-G774ASXO.cjs +0 -58
- package/dist/lib/node/chunk-G774ASXO.cjs.map +0 -7
- package/dist/lib/node/chunk-VSOSVDQ3.cjs +0 -1551
- package/dist/lib/node/chunk-VSOSVDQ3.cjs.map +0 -7
- package/dist/lib/node/chunk-YGAY3H34.cjs +0 -429
- package/dist/lib/node/chunk-YGAY3H34.cjs.map +0 -7
- package/dist/lib/node/index.cjs +0 -193
- package/dist/lib/node/index.cjs.map +0 -7
- package/dist/lib/node/intent-dispatcher-C3SVKJ62.cjs +0 -32
- package/dist/lib/node/intent-dispatcher-C3SVKJ62.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-IOJDYO34.cjs +0 -46
- package/dist/lib/node/intent-resolver-IOJDYO34.cjs.map +0 -7
- package/dist/lib/node/meta.json +0 -1
- package/dist/lib/node/store-ESF5VR57.cjs +0 -45
- package/dist/lib/node/store-ESF5VR57.cjs.map +0 -7
- package/dist/lib/node/testing/index.cjs +0 -119
- package/dist/lib/node/testing/index.cjs.map +0 -7
- package/dist/lib/node/worker.cjs +0 -101
- package/dist/lib/node/worker.cjs.map +0 -7
- package/project.json +0 -29
- package/typedoc/.nojekyll +0 -1
- package/typedoc/assets/hierarchy.js +0 -1
- package/typedoc/assets/highlight.css +0 -106
- package/typedoc/assets/icons.js +0 -18
- package/typedoc/assets/icons.svg +0 -1
- package/typedoc/assets/main.js +0 -60
- package/typedoc/assets/navigation.js +0 -1
- package/typedoc/assets/search.js +0 -1
- package/typedoc/assets/style.css +0 -1640
- package/typedoc/classes/CollaborationActions.InsertContent.html +0 -421
- package/typedoc/classes/ErrorBoundary.html +0 -125
- package/typedoc/classes/IntentAction.ShowUndo.html +0 -227
- package/typedoc/classes/IntentAction.Track.html +0 -266
- package/typedoc/classes/LayoutAction.AddToast.html +0 -265
- package/typedoc/classes/LayoutAction.Close.html +0 -382
- package/typedoc/classes/LayoutAction.Expose.html +0 -265
- package/typedoc/classes/LayoutAction.Open.html +0 -1123
- package/typedoc/classes/LayoutAction.RevertWorkspace.html +0 -343
- package/typedoc/classes/LayoutAction.ScrollIntoView.html +0 -460
- package/typedoc/classes/LayoutAction.Set.html +0 -460
- package/typedoc/classes/LayoutAction.SetLayoutMode.html +0 -499
- package/typedoc/classes/LayoutAction.SwitchWorkspace.html +0 -265
- package/typedoc/classes/LayoutAction.UpdateComplementary.html +0 -616
- package/typedoc/classes/LayoutAction.UpdateDialog.html +0 -1123
- package/typedoc/classes/LayoutAction.UpdateLayout.html +0 -461
- package/typedoc/classes/LayoutAction.UpdatePopover.html +0 -1435
- package/typedoc/classes/LayoutAction.UpdateSidebar.html +0 -616
- package/typedoc/classes/Plugin.html +0 -6
- package/typedoc/classes/PluginContext.html +0 -38
- package/typedoc/classes/PluginManager.html +0 -43
- package/typedoc/classes/PluginModule.html +0 -18
- package/typedoc/classes/SettingsAction.Open.html +0 -226
- package/typedoc/classes/SettingsAction.OpenPluginRegistry.html +0 -265
- package/typedoc/functions/Events.createStateEvent.html +0 -2
- package/typedoc/functions/IntentPlugin.html +0 -1
- package/typedoc/functions/SettingsPlugin.html +0 -1
- package/typedoc/functions/allOf.html +0 -2
- package/typedoc/functions/chain.html +0 -3
- package/typedoc/functions/contributes.html +0 -2
- package/typedoc/functions/createDispatcher.html +0 -3
- package/typedoc/functions/createIntent.html +0 -6
- package/typedoc/functions/createResolver.html +0 -2
- package/typedoc/functions/createSurface.html +0 -2
- package/typedoc/functions/defineCapability.html +0 -2
- package/typedoc/functions/defineEvent.html +0 -2
- package/typedoc/functions/defineModule.html +0 -2
- package/typedoc/functions/definePlugin.html +0 -2
- package/typedoc/functions/eventKey.html +0 -2
- package/typedoc/functions/getEvents.html +0 -2
- package/typedoc/functions/isAllOf.html +0 -2
- package/typedoc/functions/isOneOf.html +0 -2
- package/typedoc/functions/isSurfaceAvailable.html +0 -2
- package/typedoc/functions/lazy.html +0 -2
- package/typedoc/functions/oneOf.html +0 -2
- package/typedoc/functions/useApp.html +0 -6
- package/typedoc/functions/useAppGraph.html +0 -1
- package/typedoc/functions/useCapabilities.html +0 -3
- package/typedoc/functions/useCapability.html +0 -4
- package/typedoc/functions/useIntentDispatcher.html +0 -1
- package/typedoc/functions/useIntentResolver.html +0 -1
- package/typedoc/functions/useLayout.html +0 -1
- package/typedoc/functions/usePluginManager.html +0 -2
- package/typedoc/hierarchy.html +0 -1
- package/typedoc/index.html +0 -16
- package/typedoc/interfaces/LayoutAction.Toast.html +0 -10
- package/typedoc/media/LICENSE +0 -8
- package/typedoc/modules/Capabilities.html +0 -1
- package/typedoc/modules/CollaborationActions.html +0 -1
- package/typedoc/modules/Events.html +0 -1
- package/typedoc/modules/IntentAction.html +0 -1
- package/typedoc/modules/LayoutAction.html +0 -2
- package/typedoc/modules/SettingsAction.html +0 -1
- package/typedoc/modules.html +0 -1
- package/typedoc/types/ActivationEvent.html +0 -8
- package/typedoc/types/ActivationEvents.html +0 -2
- package/typedoc/types/AnyCapability.html +0 -1
- package/typedoc/types/AnyIntent.html +0 -1
- package/typedoc/types/AnyIntentChain.html +0 -1
- package/typedoc/types/AnyIntentEffectResult.html +0 -1
- package/typedoc/types/AnyIntentResolver.html +0 -1
- package/typedoc/types/AnyIntentResult.html +0 -1
- package/typedoc/types/Capabilities.FileUploader.html +0 -1
- package/typedoc/types/Capabilities.IntentResolver.html +0 -1
- package/typedoc/types/Capabilities.Layout.html +0 -1
- package/typedoc/types/Capabilities.Metadata.html +0 -1
- package/typedoc/types/Capabilities.ReactContext.html +0 -1
- package/typedoc/types/Capabilities.ReactRoot.html +0 -1
- package/typedoc/types/Capabilities.ReactSurface.html +0 -1
- package/typedoc/types/Capabilities.Settings.html +0 -4
- package/typedoc/types/Capability.html +0 -9
- package/typedoc/types/CreateAppOptions.html +0 -10
- package/typedoc/types/FileInfo.html +0 -1
- package/typedoc/types/Intent.html +0 -10
- package/typedoc/types/IntentChain.html +0 -6
- package/typedoc/types/IntentContext.html +0 -5
- package/typedoc/types/IntentData.html +0 -1
- package/typedoc/types/IntentDispatcher.html +0 -2
- package/typedoc/types/IntentDispatcherResult.html +0 -2
- package/typedoc/types/IntentEffectDefinition.html +0 -2
- package/typedoc/types/IntentEffectResult.html +0 -15
- package/typedoc/types/IntentParams.html +0 -3
- package/typedoc/types/IntentResolver.html +0 -2
- package/typedoc/types/IntentResultData.html +0 -1
- package/typedoc/types/IntentSchema.html +0 -1
- package/typedoc/types/IntentUndo.html +0 -2
- package/typedoc/types/InterfaceDef.html +0 -4
- package/typedoc/types/Label.html +0 -1
- package/typedoc/types/NodeSerializer.html +0 -8
- package/typedoc/types/PluginManagerOptions.html +0 -6
- package/typedoc/types/PluginMeta.html +0 -21
- package/typedoc/types/PromiseIntentDispatcher.html +0 -2
- package/typedoc/types/PromiseIntentUndo.html +0 -2
- package/typedoc/types/Resource.html +0 -1
- package/typedoc/types/ResourceKey.html +0 -1
- package/typedoc/types/ResourceLanguage.html +0 -1
- package/typedoc/types/SerializedNode.html +0 -4
- package/typedoc/types/SurfaceComponent.html +0 -2
- package/typedoc/types/SurfaceDefinition.html +0 -2
- package/typedoc/types/SurfaceProps.html +0 -4
- package/typedoc/variables/Capabilities.AnchorSort.html +0 -1
- package/typedoc/variables/Capabilities.AppGraph.html +0 -1
- package/typedoc/variables/Capabilities.AppGraphBuilder.html +0 -1
- package/typedoc/variables/Capabilities.AppGraphSerializer.html +0 -1
- package/typedoc/variables/Capabilities.ArtifactDefinition.html +0 -1
- package/typedoc/variables/Capabilities.FileUploader.html +0 -1
- package/typedoc/variables/Capabilities.IntentDispatcher.html +0 -1
- package/typedoc/variables/Capabilities.IntentResolver.html +0 -1
- package/typedoc/variables/Capabilities.Layout.html +0 -1
- package/typedoc/variables/Capabilities.Metadata.html +0 -1
- package/typedoc/variables/Capabilities.Null.html +0 -1
- package/typedoc/variables/Capabilities.PluginManager.html +0 -1
- package/typedoc/variables/Capabilities.ReactContext.html +0 -1
- package/typedoc/variables/Capabilities.ReactRoot.html +0 -1
- package/typedoc/variables/Capabilities.ReactSurface.html +0 -1
- package/typedoc/variables/Capabilities.RxRegistry.html +0 -1
- package/typedoc/variables/Capabilities.Settings.html +0 -1
- package/typedoc/variables/Capabilities.SettingsStore.html +0 -1
- package/typedoc/variables/Capabilities.Tools.html +0 -1
- package/typedoc/variables/Capabilities.Translations.html +0 -1
- package/typedoc/variables/Events.AppGraphReady.html +0 -2
- package/typedoc/variables/Events.DispatcherReady.html +0 -2
- package/typedoc/variables/Events.LayoutReady.html +0 -1
- package/typedoc/variables/Events.SettingsReady.html +0 -2
- package/typedoc/variables/Events.SetupAppGraph.html +0 -2
- package/typedoc/variables/Events.SetupArtifactDefinition.html +0 -2
- package/typedoc/variables/Events.SetupIntentResolver.html +0 -2
- package/typedoc/variables/Events.SetupMetadata.html +0 -2
- package/typedoc/variables/Events.SetupReactSurface.html +0 -2
- package/typedoc/variables/Events.SetupSettings.html +0 -2
- package/typedoc/variables/Events.SetupTranslations.html +0 -2
- package/typedoc/variables/Events.Startup.html +0 -2
- package/typedoc/variables/FileInfoSchema.html +0 -1
- package/typedoc/variables/INTENT_ACTION.html +0 -1
- package/typedoc/variables/INTENT_PLUGIN.html +0 -1
- package/typedoc/variables/LAYOUT_ACTION.html +0 -1
- package/typedoc/variables/LAYOUT_PLUGIN.html +0 -1
- package/typedoc/variables/Label.html +0 -1
- package/typedoc/variables/LayoutAction.Toast.html +0 -1
- package/typedoc/variables/LayoutAction.UPDATE_LAYOUT.html +0 -1
- package/typedoc/variables/PluginManagerProvider.html +0 -2
- package/typedoc/variables/Resource.html +0 -2
- package/typedoc/variables/ResourceKey.html +0 -1
- package/typedoc/variables/ResourceLanguage.html +0 -1
- package/typedoc/variables/SETTINGS_ACTION.html +0 -1
- package/typedoc/variables/SETTINGS_ID.html +0 -1
- package/typedoc/variables/SETTINGS_KEY.html +0 -1
- package/typedoc/variables/SETTINGS_PLUGIN.html +0 -1
- package/typedoc/variables/Surface.html +0 -2
- package/typedoc/variables/defaultFileTypes.html +0 -1
- /package/dist/lib/browser/{app-graph-builder-BI4VVKSW.mjs.map → app-graph-builder-LYF7EKNN.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-WWEJRWFX.mjs.map → chunk-ORWHM7CO.mjs.map} +0 -0
- /package/dist/lib/browser/{intent-dispatcher-XVBOMF2Y.mjs.map → intent-dispatcher-LSYQZSEB.mjs.map} +0 -0
- /package/dist/lib/browser/{intent-resolver-3QMBXLIY.mjs.map → intent-resolver-ZTNOSO3A.mjs.map} +0 -0
- /package/dist/lib/browser/{store-5H7XPJGA.mjs.map → store-KML2R4IE.mjs.map} +0 -0
- /package/dist/lib/node-esm/{app-graph-builder-NROP6RPQ.mjs.map → app-graph-builder-SAOWGJDK.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-I6BVZMAH.mjs.map → chunk-UMZQERLE.mjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-dispatcher-7JPGLCQ5.mjs.map → intent-dispatcher-6CYNGPSW.mjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-resolver-VY4X5UHN.mjs.map → intent-resolver-W7Z7WFFM.mjs.map} +0 -0
- /package/dist/lib/node-esm/{store-UKD2R2KA.mjs.map → store-QEXGXLWZ.mjs.map} +0 -0
|
@@ -1,429 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var chunk_YGAY3H34_exports = {};
|
|
30
|
-
__export(chunk_YGAY3H34_exports, {
|
|
31
|
-
ErrorBoundary: () => ErrorBoundary,
|
|
32
|
-
PluginManagerProvider: () => PluginManagerProvider,
|
|
33
|
-
Surface: () => Surface,
|
|
34
|
-
isSurfaceAvailable: () => isSurfaceAvailable,
|
|
35
|
-
useApp: () => useApp,
|
|
36
|
-
useAppGraph: () => useAppGraph,
|
|
37
|
-
useCapabilities: () => useCapabilities,
|
|
38
|
-
useCapability: () => useCapability,
|
|
39
|
-
useIntentDispatcher: () => useIntentDispatcher,
|
|
40
|
-
useIntentResolver: () => useIntentResolver,
|
|
41
|
-
useLayout: () => useLayout,
|
|
42
|
-
usePluginManager: () => usePluginManager,
|
|
43
|
-
useSurfaces: () => useSurfaces
|
|
44
|
-
});
|
|
45
|
-
module.exports = __toCommonJS(chunk_YGAY3H34_exports);
|
|
46
|
-
var import_chunk_VSOSVDQ3 = require("./chunk-VSOSVDQ3.cjs");
|
|
47
|
-
var import_react = require("react");
|
|
48
|
-
var import_debug = require("@dxos/debug");
|
|
49
|
-
var import_rx_react = require("@effect-rx/rx-react");
|
|
50
|
-
var import_invariant = require("@dxos/invariant");
|
|
51
|
-
var import_react2 = __toESM(require("react"));
|
|
52
|
-
var import_tracking = require("@preact-signals/safe-react/tracking");
|
|
53
|
-
var import_react3 = __toESM(require("react"));
|
|
54
|
-
var import_react_hooks = require("@dxos/react-hooks");
|
|
55
|
-
var import_util = require("@dxos/util");
|
|
56
|
-
var import_react4 = require("react");
|
|
57
|
-
var import_tracking2 = require("@preact-signals/safe-react/tracking");
|
|
58
|
-
var import_rx_react2 = require("@effect-rx/rx-react");
|
|
59
|
-
var import_signals_core = require("@preact/signals-core");
|
|
60
|
-
var import_react5 = __toESM(require("react"));
|
|
61
|
-
var import_invariant2 = require("@dxos/invariant");
|
|
62
|
-
var import_live_object = require("@dxos/live-object");
|
|
63
|
-
var import_react_hooks2 = require("@dxos/react-hooks");
|
|
64
|
-
var PluginManagerContext = (0, import_react.createContext)(void 0);
|
|
65
|
-
var usePluginManager = () => (0, import_react.useContext)(PluginManagerContext) ?? (0, import_debug.raise)(new Error("Missing PluginManagerContext"));
|
|
66
|
-
var PluginManagerProvider = PluginManagerContext.Provider;
|
|
67
|
-
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/app-framework/src/react/useCapabilities.ts";
|
|
68
|
-
var useCapabilities = (interfaceDef) => {
|
|
69
|
-
const manager = usePluginManager();
|
|
70
|
-
return (0, import_rx_react.useRxValue)(manager.context.capabilities(interfaceDef));
|
|
71
|
-
};
|
|
72
|
-
var useCapability = (interfaceDef) => {
|
|
73
|
-
const capabilities = useCapabilities(interfaceDef);
|
|
74
|
-
(0, import_invariant.invariant)(capabilities.length > 0, `No capability found for ${interfaceDef.identifier}`, {
|
|
75
|
-
F: __dxlog_file,
|
|
76
|
-
L: 28,
|
|
77
|
-
S: void 0,
|
|
78
|
-
A: [
|
|
79
|
-
"capabilities.length > 0",
|
|
80
|
-
"`No capability found for ${interfaceDef.identifier}`"
|
|
81
|
-
]
|
|
82
|
-
});
|
|
83
|
-
return capabilities[0];
|
|
84
|
-
};
|
|
85
|
-
var useIntentDispatcher = () => useCapability(import_chunk_VSOSVDQ3.Capabilities.IntentDispatcher);
|
|
86
|
-
var useAppGraph = () => useCapability(import_chunk_VSOSVDQ3.Capabilities.AppGraph);
|
|
87
|
-
var useLayout = () => useCapability(import_chunk_VSOSVDQ3.Capabilities.Layout);
|
|
88
|
-
var ErrorBoundary = class extends import_react2.Component {
|
|
89
|
-
constructor(props) {
|
|
90
|
-
super(props);
|
|
91
|
-
this.state = {
|
|
92
|
-
error: void 0
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
static getDerivedStateFromError(error) {
|
|
96
|
-
return {
|
|
97
|
-
error
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
componentDidUpdate(prevProps) {
|
|
101
|
-
if (prevProps.data !== this.props.data) {
|
|
102
|
-
this.resetError();
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
render() {
|
|
106
|
-
if (this.state.error) {
|
|
107
|
-
return /* @__PURE__ */ import_react2.default.createElement(this.props.fallback, {
|
|
108
|
-
data: this.props.data,
|
|
109
|
-
error: this.state.error,
|
|
110
|
-
reset: this.resetError
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
return this.props.children;
|
|
114
|
-
}
|
|
115
|
-
resetError() {
|
|
116
|
-
this.setState({
|
|
117
|
-
error: void 0
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
var DEFAULT_PLACEHOLDER = /* @__PURE__ */ import_react3.default.createElement(import_react3.Fragment, null);
|
|
122
|
-
var useSurfaces = () => {
|
|
123
|
-
const surfaces = useCapabilities(import_chunk_VSOSVDQ3.Capabilities.ReactSurface);
|
|
124
|
-
return (0, import_react3.useMemo)(() => surfaces.flat(), [
|
|
125
|
-
surfaces
|
|
126
|
-
]);
|
|
127
|
-
};
|
|
128
|
-
var findCandidates = (surfaces, { role, data }) => {
|
|
129
|
-
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);
|
|
130
|
-
};
|
|
131
|
-
var isSurfaceAvailable = (context, { role, data }) => {
|
|
132
|
-
const surfaces = context.getCapabilities(import_chunk_VSOSVDQ3.Capabilities.ReactSurface);
|
|
133
|
-
const candidates = findCandidates(surfaces.flat(), {
|
|
134
|
-
role,
|
|
135
|
-
data
|
|
136
|
-
});
|
|
137
|
-
return candidates.length > 0;
|
|
138
|
-
};
|
|
139
|
-
var Surface = /* @__PURE__ */ (0, import_react3.memo)(/* @__PURE__ */ (0, import_react3.forwardRef)(({ id: _id, role, data: _data, limit, fallback, placeholder = DEFAULT_PLACEHOLDER, ...rest }, forwardedRef) => {
|
|
140
|
-
var _effect = (0, import_tracking.useSignals)();
|
|
141
|
-
try {
|
|
142
|
-
const surfaces = useSurfaces();
|
|
143
|
-
const data = (0, import_react_hooks.useDefaultValue)(_data, () => ({}));
|
|
144
|
-
const definitions = findCandidates(surfaces, {
|
|
145
|
-
role,
|
|
146
|
-
data
|
|
147
|
-
});
|
|
148
|
-
const candidates = limit ? definitions.slice(0, limit) : definitions;
|
|
149
|
-
const nodes = candidates.map(({ component: Component2, id }) => /* @__PURE__ */ import_react3.default.createElement(Component2, {
|
|
150
|
-
ref: forwardedRef,
|
|
151
|
-
key: id,
|
|
152
|
-
id,
|
|
153
|
-
role,
|
|
154
|
-
data,
|
|
155
|
-
limit,
|
|
156
|
-
...rest
|
|
157
|
-
}));
|
|
158
|
-
const suspense = /* @__PURE__ */ import_react3.default.createElement(import_react3.Suspense, {
|
|
159
|
-
fallback: placeholder
|
|
160
|
-
}, nodes);
|
|
161
|
-
return fallback ? /* @__PURE__ */ import_react3.default.createElement(ErrorBoundary, {
|
|
162
|
-
data,
|
|
163
|
-
fallback
|
|
164
|
-
}, suspense) : suspense;
|
|
165
|
-
} finally {
|
|
166
|
-
_effect.f();
|
|
167
|
-
}
|
|
168
|
-
}));
|
|
169
|
-
Surface.displayName = "Surface";
|
|
170
|
-
var useIntentResolver = (module2, resolver) => {
|
|
171
|
-
const manager = usePluginManager();
|
|
172
|
-
(0, import_react4.useEffect)(() => {
|
|
173
|
-
manager.context.contributeCapability({
|
|
174
|
-
module: module2,
|
|
175
|
-
interface: import_chunk_VSOSVDQ3.Capabilities.IntentResolver,
|
|
176
|
-
implementation: resolver
|
|
177
|
-
});
|
|
178
|
-
return () => manager.context.removeCapability(import_chunk_VSOSVDQ3.Capabilities.IntentResolver, resolver);
|
|
179
|
-
}, [
|
|
180
|
-
module2,
|
|
181
|
-
resolver
|
|
182
|
-
]);
|
|
183
|
-
};
|
|
184
|
-
var topologicalSort = (nodes) => {
|
|
185
|
-
const getDependencies = (nodeId, seen = /* @__PURE__ */ new Set(), path = /* @__PURE__ */ new Set()) => {
|
|
186
|
-
if (path.has(nodeId)) {
|
|
187
|
-
throw new Error(`Circular dependency detected involving ${nodeId}`);
|
|
188
|
-
}
|
|
189
|
-
if (seen.has(nodeId)) {
|
|
190
|
-
return [];
|
|
191
|
-
}
|
|
192
|
-
const node = nodes.find((n) => n.id === nodeId);
|
|
193
|
-
if (!node) {
|
|
194
|
-
throw new Error(`Node ${nodeId} not found but is listed as a dependency`);
|
|
195
|
-
}
|
|
196
|
-
const newPath = /* @__PURE__ */ new Set([
|
|
197
|
-
...path,
|
|
198
|
-
nodeId
|
|
199
|
-
]);
|
|
200
|
-
const newSeen = /* @__PURE__ */ new Set([
|
|
201
|
-
...seen,
|
|
202
|
-
nodeId
|
|
203
|
-
]);
|
|
204
|
-
const dependsOn = node.dependsOn ?? [];
|
|
205
|
-
return [
|
|
206
|
-
...dependsOn.flatMap((depId) => getDependencies(depId, newSeen, newPath)),
|
|
207
|
-
nodeId
|
|
208
|
-
];
|
|
209
|
-
};
|
|
210
|
-
const allDependencies = nodes.map((node) => node.id).flatMap((id) => getDependencies(id)).filter((id, index, self) => self.indexOf(id) === index);
|
|
211
|
-
return allDependencies.map((id) => nodes.find((node) => node.id === id)).filter((node) => node !== void 0);
|
|
212
|
-
};
|
|
213
|
-
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/app-framework/src/App.tsx";
|
|
214
|
-
var ENABLED_KEY = "dxos.org/app-framework/enabled";
|
|
215
|
-
var useApp = ({ pluginManager, pluginLoader: _pluginLoader, plugins: _plugins, core: _core, defaults: _defaults, placeholder, fallback = DefaultFallback, cacheEnabled = false, safeMode = false }) => {
|
|
216
|
-
const plugins = (0, import_react_hooks2.useDefaultValue)(_plugins, () => []);
|
|
217
|
-
const core = (0, import_react_hooks2.useDefaultValue)(_core, () => plugins.map(({ meta }) => meta.id));
|
|
218
|
-
const defaults = (0, import_react_hooks2.useDefaultValue)(_defaults, () => []);
|
|
219
|
-
const pluginLoader = (0, import_react5.useMemo)(() => _pluginLoader ?? ((id) => {
|
|
220
|
-
const plugin = plugins.find((plugin2) => plugin2.meta.id === id);
|
|
221
|
-
(0, import_invariant2.invariant)(plugin, `Plugin not found: ${id}`, {
|
|
222
|
-
F: __dxlog_file2,
|
|
223
|
-
L: 78,
|
|
224
|
-
S: void 0,
|
|
225
|
-
A: [
|
|
226
|
-
"plugin",
|
|
227
|
-
"`Plugin not found: ${id}`"
|
|
228
|
-
]
|
|
229
|
-
});
|
|
230
|
-
return plugin;
|
|
231
|
-
}), [
|
|
232
|
-
_pluginLoader,
|
|
233
|
-
plugins
|
|
234
|
-
]);
|
|
235
|
-
const state = (0, import_react5.useMemo)(() => (0, import_live_object.live)({
|
|
236
|
-
ready: false,
|
|
237
|
-
error: null
|
|
238
|
-
}), []);
|
|
239
|
-
const cached = (0, import_react5.useMemo)(() => JSON.parse(localStorage.getItem(ENABLED_KEY) ?? "[]"), []);
|
|
240
|
-
const enabled = (0, import_react5.useMemo)(() => safeMode ? [] : cacheEnabled && cached.length > 0 ? cached : defaults, [
|
|
241
|
-
safeMode,
|
|
242
|
-
cacheEnabled,
|
|
243
|
-
cached,
|
|
244
|
-
defaults
|
|
245
|
-
]);
|
|
246
|
-
const manager = (0, import_react5.useMemo)(() => pluginManager ?? new import_chunk_VSOSVDQ3.PluginManager({
|
|
247
|
-
pluginLoader,
|
|
248
|
-
plugins,
|
|
249
|
-
core,
|
|
250
|
-
enabled
|
|
251
|
-
}), [
|
|
252
|
-
pluginManager,
|
|
253
|
-
pluginLoader,
|
|
254
|
-
plugins,
|
|
255
|
-
core,
|
|
256
|
-
enabled
|
|
257
|
-
]);
|
|
258
|
-
(0, import_react5.useEffect)(() => {
|
|
259
|
-
return manager.activation.on(({ event, state: _state, error }) => {
|
|
260
|
-
if (!state.ready && event === import_chunk_VSOSVDQ3.Events.Startup.id) {
|
|
261
|
-
state.ready = _state === "activated";
|
|
262
|
-
}
|
|
263
|
-
if (error && !state.ready && !state.error) {
|
|
264
|
-
state.error = error;
|
|
265
|
-
}
|
|
266
|
-
});
|
|
267
|
-
}, [
|
|
268
|
-
manager,
|
|
269
|
-
state
|
|
270
|
-
]);
|
|
271
|
-
(0, import_react5.useEffect)(() => {
|
|
272
|
-
(0, import_signals_core.effect)(() => {
|
|
273
|
-
cacheEnabled && localStorage.setItem(ENABLED_KEY, JSON.stringify(manager.enabled));
|
|
274
|
-
});
|
|
275
|
-
}, [
|
|
276
|
-
cacheEnabled,
|
|
277
|
-
manager
|
|
278
|
-
]);
|
|
279
|
-
(0, import_react5.useEffect)(() => {
|
|
280
|
-
manager.context.contributeCapability({
|
|
281
|
-
interface: import_chunk_VSOSVDQ3.Capabilities.PluginManager,
|
|
282
|
-
implementation: manager,
|
|
283
|
-
module: "dxos.org/app-framework/plugin-manager"
|
|
284
|
-
});
|
|
285
|
-
manager.context.contributeCapability({
|
|
286
|
-
interface: import_chunk_VSOSVDQ3.Capabilities.RxRegistry,
|
|
287
|
-
implementation: manager.registry,
|
|
288
|
-
module: "dxos.org/app-framework/rx-registry"
|
|
289
|
-
});
|
|
290
|
-
return () => {
|
|
291
|
-
manager.context.removeCapability(import_chunk_VSOSVDQ3.Capabilities.PluginManager, manager);
|
|
292
|
-
manager.context.removeCapability(import_chunk_VSOSVDQ3.Capabilities.RxRegistry, manager.registry);
|
|
293
|
-
};
|
|
294
|
-
}, [
|
|
295
|
-
manager
|
|
296
|
-
]);
|
|
297
|
-
(0, import_react5.useEffect)(() => {
|
|
298
|
-
setupDevtools(manager);
|
|
299
|
-
}, [
|
|
300
|
-
manager
|
|
301
|
-
]);
|
|
302
|
-
(0, import_react5.useEffect)(() => {
|
|
303
|
-
const timeout = setTimeout(async () => {
|
|
304
|
-
await Promise.all([
|
|
305
|
-
// TODO(wittjosiah): Factor out such that this could be called per surface role when attempting to render.
|
|
306
|
-
manager.activate(import_chunk_VSOSVDQ3.Events.SetupReactSurface),
|
|
307
|
-
manager.activate(import_chunk_VSOSVDQ3.Events.Startup)
|
|
308
|
-
]);
|
|
309
|
-
});
|
|
310
|
-
return () => clearTimeout(timeout);
|
|
311
|
-
}, [
|
|
312
|
-
manager
|
|
313
|
-
]);
|
|
314
|
-
return (0, import_react5.useCallback)(() => /* @__PURE__ */ import_react5.default.createElement(ErrorBoundary, {
|
|
315
|
-
fallback
|
|
316
|
-
}, /* @__PURE__ */ import_react5.default.createElement(PluginManagerProvider, {
|
|
317
|
-
value: manager
|
|
318
|
-
}, /* @__PURE__ */ import_react5.default.createElement(import_rx_react2.RegistryContext.Provider, {
|
|
319
|
-
value: manager.registry
|
|
320
|
-
}, /* @__PURE__ */ import_react5.default.createElement(App, {
|
|
321
|
-
placeholder,
|
|
322
|
-
state
|
|
323
|
-
})))), [
|
|
324
|
-
fallback,
|
|
325
|
-
manager,
|
|
326
|
-
placeholder,
|
|
327
|
-
state
|
|
328
|
-
]);
|
|
329
|
-
};
|
|
330
|
-
var DELAY_PLACEHOLDER = 2e3;
|
|
331
|
-
var useLoading = (state) => {
|
|
332
|
-
const [stage, setStage] = (0, import_react5.useState)(0);
|
|
333
|
-
(0, import_react5.useEffect)(() => {
|
|
334
|
-
const i = setInterval(() => {
|
|
335
|
-
setStage((tick) => {
|
|
336
|
-
switch (tick) {
|
|
337
|
-
case 0:
|
|
338
|
-
if (!state.ready) {
|
|
339
|
-
return 1;
|
|
340
|
-
} else {
|
|
341
|
-
clearInterval(i);
|
|
342
|
-
return 3;
|
|
343
|
-
}
|
|
344
|
-
case 1:
|
|
345
|
-
if (state.ready) {
|
|
346
|
-
return 2;
|
|
347
|
-
}
|
|
348
|
-
break;
|
|
349
|
-
case 2:
|
|
350
|
-
clearInterval(i);
|
|
351
|
-
return 3;
|
|
352
|
-
}
|
|
353
|
-
return tick;
|
|
354
|
-
});
|
|
355
|
-
}, DELAY_PLACEHOLDER);
|
|
356
|
-
return () => clearInterval(i);
|
|
357
|
-
}, []);
|
|
358
|
-
return stage;
|
|
359
|
-
};
|
|
360
|
-
var App = ({ placeholder: Placeholder, state }) => {
|
|
361
|
-
var _effect = (0, import_tracking2.useSignals)();
|
|
362
|
-
try {
|
|
363
|
-
const reactContexts = useCapabilities(import_chunk_VSOSVDQ3.Capabilities.ReactContext);
|
|
364
|
-
const reactRoots = useCapabilities(import_chunk_VSOSVDQ3.Capabilities.ReactRoot);
|
|
365
|
-
const stage = useLoading(state);
|
|
366
|
-
if (state.error) {
|
|
367
|
-
throw state.error;
|
|
368
|
-
}
|
|
369
|
-
if (stage < 3) {
|
|
370
|
-
if (!Placeholder) {
|
|
371
|
-
return null;
|
|
372
|
-
}
|
|
373
|
-
return /* @__PURE__ */ import_react5.default.createElement(Placeholder, {
|
|
374
|
-
stage
|
|
375
|
-
});
|
|
376
|
-
}
|
|
377
|
-
const ComposedContext = composeContexts(reactContexts);
|
|
378
|
-
return /* @__PURE__ */ import_react5.default.createElement(ComposedContext, null, reactRoots.map(({ id, root: Component2 }) => /* @__PURE__ */ import_react5.default.createElement(Component2, {
|
|
379
|
-
key: id
|
|
380
|
-
})));
|
|
381
|
-
} finally {
|
|
382
|
-
_effect.f();
|
|
383
|
-
}
|
|
384
|
-
};
|
|
385
|
-
var DefaultFallback = ({ error }) => {
|
|
386
|
-
var _effect = (0, import_tracking2.useSignals)();
|
|
387
|
-
try {
|
|
388
|
-
return /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
389
|
-
style: {
|
|
390
|
-
padding: "1rem"
|
|
391
|
-
}
|
|
392
|
-
}, /* @__PURE__ */ import_react5.default.createElement("h1", {
|
|
393
|
-
style: {
|
|
394
|
-
fontSize: "1.2rem",
|
|
395
|
-
fontWeight: 700,
|
|
396
|
-
margin: "0.5rem 0"
|
|
397
|
-
}
|
|
398
|
-
}, error.message), /* @__PURE__ */ import_react5.default.createElement("pre", null, error.stack));
|
|
399
|
-
} finally {
|
|
400
|
-
_effect.f();
|
|
401
|
-
}
|
|
402
|
-
};
|
|
403
|
-
var composeContexts = (contexts) => {
|
|
404
|
-
if (contexts.length === 0) {
|
|
405
|
-
return ({ children }) => /* @__PURE__ */ import_react5.default.createElement(import_react5.default.Fragment, null, children);
|
|
406
|
-
}
|
|
407
|
-
return topologicalSort(contexts).map(({ context }) => context).reduce((Acc, Next) => ({ children }) => /* @__PURE__ */ import_react5.default.createElement(Acc, null, /* @__PURE__ */ import_react5.default.createElement(Next, null, children)));
|
|
408
|
-
};
|
|
409
|
-
var setupDevtools = (manager) => {
|
|
410
|
-
globalThis.composer ??= {};
|
|
411
|
-
globalThis.composer.manager = manager;
|
|
412
|
-
};
|
|
413
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
414
|
-
0 && (module.exports = {
|
|
415
|
-
ErrorBoundary,
|
|
416
|
-
PluginManagerProvider,
|
|
417
|
-
Surface,
|
|
418
|
-
isSurfaceAvailable,
|
|
419
|
-
useApp,
|
|
420
|
-
useAppGraph,
|
|
421
|
-
useCapabilities,
|
|
422
|
-
useCapability,
|
|
423
|
-
useIntentDispatcher,
|
|
424
|
-
useIntentResolver,
|
|
425
|
-
useLayout,
|
|
426
|
-
usePluginManager,
|
|
427
|
-
useSurfaces
|
|
428
|
-
});
|
|
429
|
-
//# sourceMappingURL=chunk-YGAY3H34.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
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 { useRxValue } from '@effect-rx/rx-react';\n\nimport { invariant } from '@dxos/invariant';\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>(interfaceDef: InterfaceDef<T>) => {\n const manager = usePluginManager();\n return useRxValue(manager.context.capabilities(interfaceDef));\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>(interfaceDef: InterfaceDef<T>) => {\n const capabilities = useCapabilities(interfaceDef);\n invariant(capabilities.length > 0, `No capability found for ${interfaceDef.identifier}`);\n return capabilities[0];\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): { 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(): string | number | boolean | React.JSX.Element | Iterable<React.ReactNode> | null | undefined {\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(): void {\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 PluginContext } 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: PluginContext, { role, data }: Pick<SurfaceProps, 'role' | 'data'>) => {\n const surfaces = context.getCapabilities(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 { RegistryContext } from '@effect-rx/rx-react';\nimport { effect } from '@preact/signals-core';\nimport React, { useCallback, useEffect, useMemo, useState, type FC, type PropsWithChildren } from 'react';\n\nimport { invariant } from '@dxos/invariant';\nimport { live } from '@dxos/live-object';\nimport { useDefaultValue } from '@dxos/react-hooks';\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?: FC<{ stage: number }>;\n fallback?: ErrorBoundary['props']['fallback'];\n cacheEnabled?: boolean;\n safeMode?: 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 * @param params.safeMode Whether to enable safe mode, which disables optional plugins.\n */\nexport const useApp = ({\n pluginManager,\n pluginLoader: _pluginLoader,\n plugins: _plugins,\n core: _core,\n defaults: _defaults,\n placeholder,\n fallback = DefaultFallback,\n cacheEnabled = false,\n safeMode = false,\n}: CreateAppOptions) => {\n const plugins = useDefaultValue(_plugins, () => []);\n const core = useDefaultValue(_core, () => plugins.map(({ meta }) => meta.id));\n const defaults = useDefaultValue(_defaults, () => []);\n\n // TODO(wittjosiah): Provide a custom plugin loader which supports loading via url.\n const pluginLoader = useMemo(\n () =>\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 [_pluginLoader, plugins],\n );\n\n const state = useMemo(() => live({ ready: false, error: null }), []);\n const cached: string[] = useMemo(() => JSON.parse(localStorage.getItem(ENABLED_KEY) ?? '[]'), []);\n const enabled = useMemo(\n () => (safeMode ? [] : cacheEnabled && cached.length > 0 ? cached : defaults),\n [safeMode, cacheEnabled, cached, defaults],\n );\n const manager = useMemo(\n () => pluginManager ?? new PluginManager({ pluginLoader, plugins, core, enabled }),\n [pluginManager, pluginLoader, plugins, core, enabled],\n );\n\n useEffect(() => {\n return 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 }, [manager, state]);\n\n useEffect(() => {\n effect(() => {\n cacheEnabled && localStorage.setItem(ENABLED_KEY, JSON.stringify(manager.enabled));\n });\n }, [cacheEnabled, manager]);\n\n useEffect(() => {\n manager.context.contributeCapability({\n interface: Capabilities.PluginManager,\n implementation: manager,\n module: 'dxos.org/app-framework/plugin-manager',\n });\n\n manager.context.contributeCapability({\n interface: Capabilities.RxRegistry,\n implementation: manager.registry,\n module: 'dxos.org/app-framework/rx-registry',\n });\n\n return () => {\n manager.context.removeCapability(Capabilities.PluginManager, manager);\n manager.context.removeCapability(Capabilities.RxRegistry, manager.registry);\n };\n }, [manager]);\n\n useEffect(() => {\n setupDevtools(manager);\n }, [manager]);\n\n useEffect(() => {\n const timeout = setTimeout(async () => {\n await Promise.all([\n // TODO(wittjosiah): Factor out such that this could be called per surface role when attempting to render.\n manager.activate(Events.SetupReactSurface),\n manager.activate(Events.Startup),\n ]);\n });\n\n return () => clearTimeout(timeout);\n }, [manager]);\n\n return useCallback(\n () => (\n <ErrorBoundary fallback={fallback}>\n <PluginManagerProvider value={manager}>\n <RegistryContext.Provider value={manager.registry}>\n <App placeholder={placeholder} state={state} />\n </RegistryContext.Provider>\n </PluginManagerProvider>\n </ErrorBoundary>\n ),\n [fallback, manager, placeholder, state],\n );\n};\n\nconst DELAY_PLACEHOLDER = 2_000;\n\nenum LoadingState {\n Loading = 0,\n FadeIn = 1,\n FadeOut = 2,\n Done = 3,\n}\n\n/**\n * To avoid \"flashing\" the placeholder, we wait a period of time before starting the loading animation.\n * If loading completes during this time the placehoder is not shown, otherwise is it displayed for a minimum period of time.\n *\n * States:\n * 0: Loading - Wait for a period of time before starting the loading animation.\n * 1: Fade-in - Display a loading animation.\n * 2: Fade-out - Fade out the loading animation.\n * 3: Done - Remove the placeholder.\n */\nconst useLoading = (state: AppProps['state']) => {\n const [stage, setStage] = useState<LoadingState>(LoadingState.Loading);\n useEffect(() => {\n const i = setInterval(() => {\n setStage((tick) => {\n switch (tick) {\n case LoadingState.Loading:\n if (!state.ready) {\n return LoadingState.FadeIn;\n } else {\n clearInterval(i);\n return LoadingState.Done;\n }\n case LoadingState.FadeIn:\n if (state.ready) {\n return LoadingState.FadeOut;\n }\n break;\n case LoadingState.FadeOut:\n clearInterval(i);\n return LoadingState.Done;\n }\n\n return tick;\n });\n }, DELAY_PLACEHOLDER);\n\n return () => clearInterval(i);\n }, []);\n\n return stage;\n};\n\ntype AppProps = Pick<CreateAppOptions, 'placeholder'> & {\n state: { ready: boolean; error: unknown };\n};\n\nconst App = ({ placeholder: Placeholder, state }: AppProps) => {\n const reactContexts = useCapabilities(Capabilities.ReactContext);\n const reactRoots = useCapabilities(Capabilities.ReactRoot);\n const stage = useLoading(state);\n\n if (state.error) {\n // This triggers 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 (stage < LoadingState.Done) {\n if (!Placeholder) {\n return null;\n }\n\n return <Placeholder stage={stage} />;\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) => node.id === id))\n .filter((node): node is T => node !== undefined);\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAA0C;AAE1C,mBAAsB;ACFtB,sBAA2B;AAE3B,uBAA0B;AEF1B,IAAAA,gBAAkE;;ACAlE,IAAAA,gBAAqE;AAErE,yBAAgC;AAChC,kBAA2B;ACH3B,IAAAA,gBAA0B;;ACA1B,IAAAC,mBAAgC;AAChC,0BAAuB;AACvB,IAAAD,gBAAkG;AAElG,IAAAE,oBAA0B;AAC1B,yBAAqB;AACrB,IAAAC,sBAAgC;ANAhC,IAAMC,2BAAuBC,4BAAyCC,MAAAA;AAK/D,IAAMC,mBAAmB,UAC9BC,yBAAWJ,oBAAAA,SAAyBK,oBAAM,IAAIC,MAAM,8BAAA,CAAA;AAK/C,IAAMC,wBAAwBP,qBAAqBQ;;ACNnD,IAAMC,kBAAkB,CAAIC,iBAAAA;AACjC,QAAMC,UAAUR,iBAAAA;AAChB,aAAOS,4BAAWD,QAAQE,QAAQC,aAAaJ,YAAAA,CAAAA;AACjD;AAOO,IAAMK,gBAAgB,CAAIL,iBAAAA;AAC/B,QAAMI,eAAeL,gBAAgBC,YAAAA;AACrCM,kCAAUF,aAAaG,SAAS,GAAG,2BAA2BP,aAAaQ,UAAU,IAAE;;;;;;;;;AACvF,SAAOJ,aAAa,CAAA;AACtB;ACtBO,IAAMK,sBAAsB,MAAMJ,cAAcK,mCAAaC,gBAAgB;AAE7E,IAAMC,cAAc,MAAMP,cAAcK,mCAAaG,QAAQ;AAE7D,IAAMC,YAAY,MAAMT,cAAcK,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AA,cAACV,YAAAA;MAAUsD,KAAKd;;;;;AAIxB;AAGA,IAAMyD,kBAAkB,CAAC,EAAE9F,MAAK,MAAoB;;;AAClD,WACEO,8BAAAA,QAAA,cAAC6I,OAAAA;MAAIC,OAAO;QAAEC,SAAS;MAAO;OAE5B/I,8BAAAA,QAAA,cAACgJ,MAAAA;MAAGF,OAAO;QAAEG,UAAU;QAAUC,YAAY;QAAKC,QAAQ;MAAW;OAAI1J,MAAM2J,OAAO,GACtFpJ,8BAAAA,QAAA,cAACqJ,OAAAA,MAAK5J,MAAM6J,KAAK,CAAA;;;;AAGvB;AAEA,IAAMX,kBAAkB,CAACY,aAAAA;AACvB,MAAIA,SAAS3K,WAAW,GAAG;AACzB,WAAO,CAAC,EAAEwB,SAAQ,MAA0BJ,8BAAAA,QAAA,cAAAA,cAAAA,QAAA,UAAA,MAAGI,QAAAA;EACjD;AAEA,SAAOqD,gBAAgB8F,QAAAA,EACpB9G,IAAI,CAAC,EAAEjE,QAAO,MAAOA,OAAAA,EACrBgL,OAAO,CAACC,KAAKC,SAAS,CAAC,EAAEtJ,SAAQ,MAChCJ,8BAAAA,QAAA,cAACyJ,KAAAA,MACCzJ,8BAAAA,QAAA,cAAC0J,MAAAA,MAAMtJ,QAAAA,CAAAA,CAAAA;AAGf;AAEA,IAAM4G,gBAAgB,CAAC1I,YAAAA;AACpBqL,aAAmBC,aAAa,CAAC;AACjCD,aAAmBC,SAAStL,UAAUA;AACzC;",
|
|
6
|
-
"names": ["import_react", "import_rx_react", "import_invariant", "import_react_hooks", "PluginManagerContext", "createContext", "undefined", "usePluginManager", "useContext", "raise", "Error", "PluginManagerProvider", "Provider", "useCapabilities", "interfaceDef", "manager", "useRxValue", "context", "capabilities", "useCapability", "invariant", "length", "identifier", "useIntentDispatcher", "Capabilities", "IntentDispatcher", "useAppGraph", "AppGraph", "useLayout", "Layout", "ErrorBoundary", "Component", "props", "state", "error", "getDerivedStateFromError", "componentDidUpdate", "prevProps", "data", "resetError", "render", "React", "this", "fallback", "reset", "children", "setState", "DEFAULT_PLACEHOLDER", "Fragment", "useSurfaces", "surfaces", "ReactSurface", "useMemo", "flat", "findCandidates", "role", "Object", "values", "filter", "definition", "Array", "isArray", "includes", "toSorted", "byPosition", "isSurfaceAvailable", "getCapabilities", "candidates", "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", "useApp", "pluginManager", "pluginLoader", "_pluginLoader", "plugins", "_plugins", "core", "_core", "defaults", "_defaults", "DefaultFallback", "cacheEnabled", "safeMode", "meta", "plugin", "live", "ready", "cached", "JSON", "parse", "localStorage", "getItem", "enabled", "PluginManager", "activation", "on", "event", "_state", "Events", "Startup", "effect", "setItem", "stringify", "RxRegistry", "registry", "setupDevtools", "timeout", "setTimeout", "Promise", "all", "activate", "SetupReactSurface", "clearTimeout", "useCallback", "value", "RegistryContext", "App", "DELAY_PLACEHOLDER", "useLoading", "stage", "setStage", "useState", "i", "setInterval", "tick", "clearInterval", "Placeholder", "reactContexts", "ReactContext", "reactRoots", "ReactRoot", "ComposedContext", "composeContexts", "root", "div", "style", "padding", "h1", "fontSize", "fontWeight", "margin", "message", "pre", "stack", "contexts", "reduce", "Acc", "Next", "globalThis", "composer"]
|
|
7
|
-
}
|