@dxos/app-framework 0.7.5-labs.e27f9b9 → 0.7.5-labs.f400bbc
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-MOLT4EHG.mjs → app-graph-builder-S4MYSHQA.mjs} +7 -7
- package/dist/lib/browser/app-graph-builder-S4MYSHQA.mjs.map +7 -0
- package/dist/lib/browser/{chunk-G3HBVVT5.mjs → chunk-BCMEJONP.mjs} +39 -10
- package/dist/lib/browser/chunk-BCMEJONP.mjs.map +7 -0
- package/dist/lib/browser/{chunk-TGOF2WQZ.mjs → chunk-QS4J6O47.mjs} +4 -4
- package/dist/lib/browser/{chunk-TGOF2WQZ.mjs.map → chunk-QS4J6O47.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-LDJ3T4V3.mjs → chunk-SRZH2PQ2.mjs} +2 -2
- package/dist/lib/browser/{chunk-LDJ3T4V3.mjs.map → chunk-SRZH2PQ2.mjs.map} +1 -1
- package/dist/lib/browser/index.mjs +7 -7
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/{intent-dispatcher-LJKNIGAM.mjs → intent-dispatcher-GFBH7T2J.mjs} +2 -2
- package/dist/lib/browser/{intent-resolver-Z724VAMC.mjs → intent-resolver-KAFM7CQH.mjs} +9 -8
- package/dist/lib/browser/intent-resolver-KAFM7CQH.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/store-L3VRR7II.mjs +29 -0
- package/dist/lib/browser/store-L3VRR7II.mjs.map +7 -0
- package/dist/lib/browser/testing/index.mjs +5 -2
- 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-G7SRXDFD.cjs → app-graph-builder-VMHWFCTP.cjs} +31 -31
- package/dist/lib/node/app-graph-builder-VMHWFCTP.cjs.map +7 -0
- package/dist/lib/node/{chunk-55KIQ6YK.cjs → chunk-7Y6KJ3OK.cjs} +66 -37
- package/dist/lib/node/chunk-7Y6KJ3OK.cjs.map +7 -0
- package/dist/lib/node/{chunk-5GABBW2Q.cjs → chunk-B65NJEIJ.cjs} +19 -19
- package/dist/lib/node/{chunk-5GABBW2Q.cjs.map → chunk-B65NJEIJ.cjs.map} +3 -3
- package/dist/lib/node/{chunk-QLVQ6PND.cjs → chunk-VCIHQZSN.cjs} +5 -5
- package/dist/lib/node/{chunk-QLVQ6PND.cjs.map → chunk-VCIHQZSN.cjs.map} +1 -1
- package/dist/lib/node/index.cjs +78 -78
- package/dist/lib/node/index.cjs.map +2 -2
- package/dist/lib/node/{intent-dispatcher-CGUK3BCJ.cjs → intent-dispatcher-PRCC4KZT.cjs} +8 -8
- package/dist/lib/node/{intent-dispatcher-CGUK3BCJ.cjs.map → intent-dispatcher-PRCC4KZT.cjs.map} +2 -2
- package/dist/lib/node/{intent-resolver-7GNKPRWT.cjs → intent-resolver-OZDKCHPW.cjs} +15 -14
- package/dist/lib/node/intent-resolver-OZDKCHPW.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{store-WMJSEQPC.cjs → store-BVUKNVKL.cjs} +19 -9
- package/dist/lib/node/store-BVUKNVKL.cjs.map +7 -0
- package/dist/lib/node/testing/index.cjs +11 -8
- 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-MKLYH3NE.mjs → app-graph-builder-XHI5IIXQ.mjs} +7 -7
- package/dist/lib/node-esm/app-graph-builder-XHI5IIXQ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-CNJYZNSL.mjs → chunk-CBT75GCX.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-CNJYZNSL.mjs.map → chunk-CBT75GCX.mjs.map} +1 -1
- package/dist/lib/node-esm/{chunk-47FG42II.mjs → chunk-JDAHZRYQ.mjs} +4 -4
- package/dist/lib/node-esm/{chunk-47FG42II.mjs.map → chunk-JDAHZRYQ.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-ZTB4TA6Q.mjs → chunk-TVIR2PHY.mjs} +39 -10
- package/dist/lib/node-esm/chunk-TVIR2PHY.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +7 -7
- package/dist/lib/node-esm/index.mjs.map +2 -2
- package/dist/lib/node-esm/{intent-dispatcher-RZAWA4XD.mjs → intent-dispatcher-LGACN32C.mjs} +2 -2
- package/dist/lib/node-esm/{intent-resolver-UIU37CKJ.mjs → intent-resolver-RBNG76ZX.mjs} +9 -8
- package/dist/lib/node-esm/intent-resolver-RBNG76ZX.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/store-PHTOEREN.mjs +30 -0
- package/dist/lib/node-esm/store-PHTOEREN.mjs.map +7 -0
- package/dist/lib/node-esm/testing/index.mjs +5 -2
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/lib/node-esm/worker.mjs +1 -1
- package/dist/types/src/App.d.ts +2 -2
- package/dist/types/src/App.d.ts.map +1 -1
- package/dist/types/src/common/capabilities.d.ts +50 -42
- package/dist/types/src/common/capabilities.d.ts.map +1 -1
- package/dist/types/src/common/events.d.ts +16 -12
- package/dist/types/src/common/events.d.ts.map +1 -1
- package/dist/types/src/common/layout.d.ts +15 -1
- package/dist/types/src/common/layout.d.ts.map +1 -1
- package/dist/types/src/playground/debug/Debug.d.ts +2 -3
- package/dist/types/src/playground/debug/Debug.d.ts.map +1 -1
- package/dist/types/src/playground/debug/plugin.d.ts +1 -1
- package/dist/types/src/playground/debug/plugin.d.ts.map +1 -1
- package/dist/types/src/playground/generator/Main.d.ts +2 -3
- package/dist/types/src/playground/generator/Main.d.ts.map +1 -1
- package/dist/types/src/playground/generator/Toolbar.d.ts +2 -3
- package/dist/types/src/playground/generator/Toolbar.d.ts.map +1 -1
- package/dist/types/src/playground/generator/generator.d.ts +3 -3
- package/dist/types/src/playground/generator/generator.d.ts.map +1 -1
- package/dist/types/src/playground/generator/plugin.d.ts +1 -1
- package/dist/types/src/playground/generator/plugin.d.ts.map +1 -1
- package/dist/types/src/playground/layout/Layout.d.ts +2 -2
- package/dist/types/src/playground/layout/Layout.d.ts.map +1 -1
- package/dist/types/src/playground/layout/plugin.d.ts +1 -1
- package/dist/types/src/playground/layout/plugin.d.ts.map +1 -1
- package/dist/types/src/playground/logger/Toolbar.d.ts +2 -3
- package/dist/types/src/playground/logger/Toolbar.d.ts.map +1 -1
- package/dist/types/src/playground/logger/plugin.d.ts +1 -1
- package/dist/types/src/playground/logger/plugin.d.ts.map +1 -1
- package/dist/types/src/playground/playground.stories.d.ts +2 -3
- package/dist/types/src/playground/playground.stories.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/IntentPlugin.d.ts +1 -1
- package/dist/types/src/plugin-intent/IntentPlugin.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +1 -1
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +1 -1
- package/dist/types/src/plugin-settings/SettingsPlugin.d.ts +1 -1
- package/dist/types/src/plugin-settings/SettingsPlugin.d.ts.map +1 -1
- package/dist/types/src/plugin-settings/actions.d.ts +1 -1
- package/dist/types/src/plugin-settings/actions.d.ts.map +1 -1
- package/dist/types/src/plugin-settings/app-graph-builder.d.ts +1 -1
- package/dist/types/src/plugin-settings/intent-resolver.d.ts +1 -1
- package/dist/types/src/plugin-settings/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/plugin-settings/store.d.ts +1 -1
- package/dist/types/src/plugin-settings/store.d.ts.map +1 -1
- package/dist/types/src/react/ErrorBoundary.d.ts +1 -1
- package/dist/types/src/react/Surface.stories.d.ts +2 -3
- package/dist/types/src/react/Surface.stories.d.ts.map +1 -1
- package/dist/types/src/react/common.d.ts +2 -1
- package/dist/types/src/react/common.d.ts.map +1 -1
- package/dist/types/src/testing/withPluginManager.d.ts +6 -4
- package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
- package/package.json +19 -18
- package/project.json +1 -0
- package/src/App.tsx +3 -2
- package/src/common/capabilities.ts +4 -0
- package/src/common/events.ts +7 -2
- package/src/common/layout.ts +14 -1
- package/src/playground/generator/generator.ts +1 -1
- package/src/playground/logger/plugin.ts +1 -1
- package/src/plugin-intent/intent-dispatcher.ts +7 -3
- package/src/plugin-settings/SettingsPlugin.ts +1 -1
- package/src/plugin-settings/actions.ts +1 -1
- package/src/plugin-settings/app-graph-builder.ts +4 -4
- package/src/plugin-settings/intent-resolver.ts +10 -4
- package/src/plugin-settings/store.ts +15 -5
- package/src/testing/withPluginManager.tsx +18 -2
- package/tsconfig.json +1 -10
- package/dist/lib/browser/app-graph-builder-MOLT4EHG.mjs.map +0 -7
- package/dist/lib/browser/chunk-G3HBVVT5.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-Z724VAMC.mjs.map +0 -7
- package/dist/lib/browser/store-NWCY7LAP.mjs +0 -19
- package/dist/lib/browser/store-NWCY7LAP.mjs.map +0 -7
- package/dist/lib/node/app-graph-builder-G7SRXDFD.cjs.map +0 -7
- package/dist/lib/node/chunk-55KIQ6YK.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-7GNKPRWT.cjs.map +0 -7
- package/dist/lib/node/store-WMJSEQPC.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-MKLYH3NE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZTB4TA6Q.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-UIU37CKJ.mjs.map +0 -7
- package/dist/lib/node-esm/store-YUWINFBN.mjs +0 -20
- package/dist/lib/node-esm/store-YUWINFBN.mjs.map +0 -7
- /package/{.eslintrc.js → .eslintrc.cjs} +0 -0
- /package/dist/lib/browser/{intent-dispatcher-LJKNIGAM.mjs.map → intent-dispatcher-GFBH7T2J.mjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-dispatcher-RZAWA4XD.mjs.map → intent-dispatcher-LGACN32C.mjs.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/testing/withPluginManager.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Decorator } from '@storybook/react';\nimport React, { useEffect } from 'react';\n\nimport { raise } from '@dxos/debug';\n\nimport { createApp, type CreateAppOptions } from '../App';\nimport { Capabilities, Events } from '../common';\nimport { type AnyCapability
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;AAKA,OAAOA,SAASC,iBAAiB;AAEjC,SAASC,aAAa;
|
|
6
|
-
"names": ["React", "useEffect", "raise", "setupPluginManager", "capabilities", "plugins", "core", "map", "meta", "id", "options", "pluginManager", "PluginManager", "pluginLoader", "raise", "Error", "StoryPlugin", "STORY_PLUGIN", "forEach", "capability", "context", "contributeCapability", "interface", "implementation", "module", "withPluginManager", "App", "createApp", "Story", "useEffect", "contributes", "Capabilities", "ReactRoot", "root", "removeCapability", "definePlugin", "defineModule", "activatesOn", "Events", "Startup"
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Decorator } from '@storybook/react';\nimport React, { useEffect } from 'react';\n\nimport { raise } from '@dxos/debug';\n\nimport { createApp, type CreateAppOptions } from '../App';\nimport { Capabilities, Events } from '../common';\nimport {\n type ActivationEvent,\n type AnyCapability,\n contributes,\n defineModule,\n definePlugin,\n PluginManager,\n} from '../core';\n\n/**\n * @internal\n */\nexport const setupPluginManager = ({\n capabilities,\n plugins = [],\n core = plugins.map(({ meta }) => meta.id),\n ...options\n}: CreateAppOptions & { capabilities?: AnyCapability[] } = {}) => {\n const pluginManager = new PluginManager({\n pluginLoader: () => raise(new Error('Not implemented')),\n plugins: [StoryPlugin(), ...plugins],\n core: [STORY_PLUGIN, ...core],\n ...options,\n });\n\n if (capabilities) {\n capabilities.forEach((capability) => {\n pluginManager.context.contributeCapability({\n interface: capability.interface,\n implementation: capability.implementation,\n module: 'story',\n });\n });\n }\n\n return pluginManager;\n};\n\nexport type WithPluginManagerOptions = CreateAppOptions & {\n capabilities?: AnyCapability[];\n fireEvents?: (ActivationEvent | string)[];\n};\n\n/**\n * Wraps a story with a plugin manager.\n */\nexport const withPluginManager = (options: WithPluginManagerOptions = {}): Decorator => {\n const pluginManager = setupPluginManager(options);\n const App = createApp({ pluginManager });\n\n options.fireEvents?.forEach((event) => {\n void pluginManager.activate(event);\n });\n\n return (Story, context) => {\n useEffect(() => {\n const capability = contributes(Capabilities.ReactRoot, {\n id: context.id,\n root: () => <Story />,\n });\n\n pluginManager.context.contributeCapability({\n ...capability,\n module: 'dxos.org/app-framework/withPluginManager',\n });\n\n return () => pluginManager.context.removeCapability(capability.interface, capability.implementation);\n }, []);\n\n return <App />;\n };\n};\n\n// No-op plugin to ensure there exists at least one plugin for the startup event.\n// This is necessary because `createApp` expects the startup event to complete before the app is ready.\nconst STORY_PLUGIN = 'dxos.org/app-framework/story';\nconst StoryPlugin = () =>\n definePlugin({ id: STORY_PLUGIN }, [\n defineModule({ id: STORY_PLUGIN, activatesOn: Events.Startup, activate: () => [] }),\n ]);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;AAKA,OAAOA,SAASC,iBAAiB;AAEjC,SAASC,aAAa;AAgBf,IAAMC,qBAAqB,CAAC,EACjCC,cACAC,UAAU,CAAA,GACVC,OAAOD,QAAQE,IAAI,CAAC,EAAEC,KAAI,MAAOA,KAAKC,EAAE,GACxC,GAAGC,QAAAA,IACsD,CAAC,MAAC;AAC3D,QAAMC,gBAAgB,IAAIC,cAAc;IACtCC,cAAc,MAAMC,MAAM,IAAIC,MAAM,iBAAA,CAAA;IACpCV,SAAS;MAACW,YAAAA;SAAkBX;;IAC5BC,MAAM;MAACW;SAAiBX;;IACxB,GAAGI;EACL,CAAA;AAEA,MAAIN,cAAc;AAChBA,iBAAac,QAAQ,CAACC,eAAAA;AACpBR,oBAAcS,QAAQC,qBAAqB;QACzCC,WAAWH,WAAWG;QACtBC,gBAAgBJ,WAAWI;QAC3BC,QAAQ;MACV,CAAA;IACF,CAAA;EACF;AAEA,SAAOb;AACT;AAUO,IAAMc,oBAAoB,CAACf,UAAoC,CAAC,MAAC;AACtE,QAAMC,gBAAgBR,mBAAmBO,OAAAA;AACzC,QAAMgB,MAAMC,UAAU;IAAEhB;EAAc,CAAA;AAEtCD,UAAQkB,YAAYV,QAAQ,CAACW,UAAAA;AAC3B,SAAKlB,cAAcmB,SAASD,KAAAA;EAC9B,CAAA;AAEA,SAAO,CAACE,OAAOX,YAAAA;AACbY,cAAU,MAAA;AACR,YAAMb,aAAac,YAAYC,aAAaC,WAAW;QACrD1B,IAAIW,QAAQX;QACZ2B,MAAM,MAAM,sBAAA,cAACL,OAAAA,IAAAA;MACf,CAAA;AAEApB,oBAAcS,QAAQC,qBAAqB;QACzC,GAAGF;QACHK,QAAQ;MACV,CAAA;AAEA,aAAO,MAAMb,cAAcS,QAAQiB,iBAAiBlB,WAAWG,WAAWH,WAAWI,cAAc;IACrG,GAAG,CAAA,CAAE;AAEL,WAAO,sBAAA,cAACG,KAAAA,IAAAA;EACV;AACF;AAIA,IAAMT,eAAe;AACrB,IAAMD,cAAc,MAClBsB,aAAa;EAAE7B,IAAIQ;AAAa,GAAG;EACjCsB,aAAa;IAAE9B,IAAIQ;IAAcuB,aAAaC,OAAOC;IAASZ,UAAU,MAAM,CAAA;EAAG,CAAA;CAClF;",
|
|
6
|
+
"names": ["React", "useEffect", "raise", "setupPluginManager", "capabilities", "plugins", "core", "map", "meta", "id", "options", "pluginManager", "PluginManager", "pluginLoader", "raise", "Error", "StoryPlugin", "STORY_PLUGIN", "forEach", "capability", "context", "contributeCapability", "interface", "implementation", "module", "withPluginManager", "App", "createApp", "fireEvents", "event", "activate", "Story", "useEffect", "contributes", "Capabilities", "ReactRoot", "root", "removeCapability", "definePlugin", "defineModule", "activatesOn", "Events", "Startup"]
|
|
7
7
|
}
|
|
@@ -16,31 +16,31 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var app_graph_builder_VMHWFCTP_exports = {};
|
|
20
|
+
__export(app_graph_builder_VMHWFCTP_exports, {
|
|
21
21
|
default: () => app_graph_builder_default
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
25
|
-
var
|
|
23
|
+
module.exports = __toCommonJS(app_graph_builder_VMHWFCTP_exports);
|
|
24
|
+
var import_chunk_VCIHQZSN = require("./chunk-VCIHQZSN.cjs");
|
|
25
|
+
var import_chunk_7Y6KJ3OK = require("./chunk-7Y6KJ3OK.cjs");
|
|
26
26
|
var import_app_graph = require("@dxos/app-graph");
|
|
27
27
|
var import_util = require("@dxos/util");
|
|
28
|
-
var app_graph_builder_default = (context) => (0,
|
|
28
|
+
var app_graph_builder_default = (context) => (0, import_chunk_7Y6KJ3OK.contributes)(import_chunk_7Y6KJ3OK.Capabilities.AppGraphBuilder, [
|
|
29
29
|
(0, import_app_graph.createExtension)({
|
|
30
|
-
id: `${
|
|
30
|
+
id: `${import_chunk_VCIHQZSN.SETTINGS_PLUGIN}/action`,
|
|
31
31
|
filter: (node) => node.id === "root",
|
|
32
32
|
actions: () => [
|
|
33
33
|
{
|
|
34
|
-
id:
|
|
34
|
+
id: import_chunk_VCIHQZSN.SETTINGS_PLUGIN,
|
|
35
35
|
data: async () => {
|
|
36
|
-
const { dispatchPromise: dispatch } = context.requestCapability(
|
|
37
|
-
await dispatch((0,
|
|
36
|
+
const { dispatchPromise: dispatch } = context.requestCapability(import_chunk_7Y6KJ3OK.Capabilities.IntentDispatcher);
|
|
37
|
+
await dispatch((0, import_chunk_7Y6KJ3OK.createIntent)(import_chunk_VCIHQZSN.SettingsAction.Open));
|
|
38
38
|
},
|
|
39
39
|
properties: {
|
|
40
40
|
label: [
|
|
41
41
|
"open settings label",
|
|
42
42
|
{
|
|
43
|
-
ns:
|
|
43
|
+
ns: import_chunk_VCIHQZSN.SETTINGS_PLUGIN
|
|
44
44
|
}
|
|
45
45
|
],
|
|
46
46
|
icon: "ph--gear--regular",
|
|
@@ -53,33 +53,33 @@ var app_graph_builder_default = (context) => (0, import_chunk_55KIQ6YK.contribut
|
|
|
53
53
|
]
|
|
54
54
|
}),
|
|
55
55
|
(0, import_app_graph.createExtension)({
|
|
56
|
-
id: `${
|
|
56
|
+
id: `${import_chunk_VCIHQZSN.SETTINGS_PLUGIN}/core`,
|
|
57
57
|
filter: (node) => node.id === "root",
|
|
58
58
|
connector: () => [
|
|
59
59
|
{
|
|
60
|
-
id:
|
|
61
|
-
type:
|
|
60
|
+
id: import_chunk_VCIHQZSN.SETTINGS_ID,
|
|
61
|
+
type: import_chunk_VCIHQZSN.SETTINGS_PLUGIN,
|
|
62
62
|
properties: {
|
|
63
63
|
label: [
|
|
64
64
|
"app settings label",
|
|
65
65
|
{
|
|
66
|
-
ns:
|
|
66
|
+
ns: import_chunk_VCIHQZSN.SETTINGS_PLUGIN
|
|
67
67
|
}
|
|
68
68
|
],
|
|
69
69
|
icon: "ph--gear--regular",
|
|
70
70
|
disposition: "pin-end",
|
|
71
|
-
position: "
|
|
71
|
+
position: "hoist",
|
|
72
72
|
testId: "treeView.appSettings"
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
]
|
|
76
76
|
}),
|
|
77
77
|
(0, import_app_graph.createExtension)({
|
|
78
|
-
id: `${
|
|
79
|
-
filter: (node) => node.id ===
|
|
78
|
+
id: `${import_chunk_VCIHQZSN.SETTINGS_PLUGIN}/core-plugins`,
|
|
79
|
+
filter: (node) => node.id === import_chunk_VCIHQZSN.SETTINGS_ID,
|
|
80
80
|
connector: () => {
|
|
81
|
-
const manager = context.requestCapability(
|
|
82
|
-
const [settingsStore] = context.requestCapabilities(
|
|
81
|
+
const manager = context.requestCapability(import_chunk_7Y6KJ3OK.Capabilities.PluginManager);
|
|
82
|
+
const [settingsStore] = context.requestCapabilities(import_chunk_7Y6KJ3OK.Capabilities.SettingsStore);
|
|
83
83
|
return [
|
|
84
84
|
...manager.plugins.filter((plugin) => manager.core.includes(plugin.meta.id)).map((plugin) => {
|
|
85
85
|
const settings = settingsStore?.getStore(plugin.meta.id);
|
|
@@ -90,8 +90,8 @@ var app_graph_builder_default = (context) => (0, import_chunk_55KIQ6YK.contribut
|
|
|
90
90
|
plugin.meta,
|
|
91
91
|
settings
|
|
92
92
|
];
|
|
93
|
-
}).filter(import_util.
|
|
94
|
-
id: `${
|
|
93
|
+
}).filter(import_util.isNonNullable).map(([meta, settings]) => ({
|
|
94
|
+
id: `${import_chunk_VCIHQZSN.SETTINGS_KEY}:${meta.id.replaceAll("/", ":")}`,
|
|
95
95
|
type: "category",
|
|
96
96
|
data: settings,
|
|
97
97
|
properties: {
|
|
@@ -100,13 +100,13 @@ var app_graph_builder_default = (context) => (0, import_chunk_55KIQ6YK.contribut
|
|
|
100
100
|
}
|
|
101
101
|
})),
|
|
102
102
|
{
|
|
103
|
-
id: `${
|
|
103
|
+
id: `${import_chunk_VCIHQZSN.SETTINGS_KEY}:custom-plugins`,
|
|
104
104
|
type: "collection",
|
|
105
105
|
properties: {
|
|
106
106
|
label: [
|
|
107
107
|
"custom plugins label",
|
|
108
108
|
{
|
|
109
|
-
ns:
|
|
109
|
+
ns: import_chunk_VCIHQZSN.SETTINGS_PLUGIN
|
|
110
110
|
}
|
|
111
111
|
],
|
|
112
112
|
icon: "ph--squares-four--regular",
|
|
@@ -117,11 +117,11 @@ var app_graph_builder_default = (context) => (0, import_chunk_55KIQ6YK.contribut
|
|
|
117
117
|
}
|
|
118
118
|
}),
|
|
119
119
|
(0, import_app_graph.createExtension)({
|
|
120
|
-
id: `${
|
|
121
|
-
filter: (node) => node.id === `${
|
|
120
|
+
id: `${import_chunk_VCIHQZSN.SETTINGS_PLUGIN}/custom-plugins`,
|
|
121
|
+
filter: (node) => node.id === `${import_chunk_VCIHQZSN.SETTINGS_KEY}:custom-plugins`,
|
|
122
122
|
connector: () => {
|
|
123
|
-
const manager = context.requestCapability(
|
|
124
|
-
const [settingsStore] = context.requestCapabilities(
|
|
123
|
+
const manager = context.requestCapability(import_chunk_7Y6KJ3OK.Capabilities.PluginManager);
|
|
124
|
+
const [settingsStore] = context.requestCapabilities(import_chunk_7Y6KJ3OK.Capabilities.SettingsStore);
|
|
125
125
|
return manager.plugins.filter((plugin) => !manager.core.includes(plugin.meta.id)).map((plugin) => {
|
|
126
126
|
const settings = settingsStore?.getStore(plugin.meta.id);
|
|
127
127
|
if (!settings) {
|
|
@@ -131,8 +131,8 @@ var app_graph_builder_default = (context) => (0, import_chunk_55KIQ6YK.contribut
|
|
|
131
131
|
plugin.meta,
|
|
132
132
|
settings
|
|
133
133
|
];
|
|
134
|
-
}).filter(import_util.
|
|
135
|
-
id: `${
|
|
134
|
+
}).filter(import_util.isNonNullable).map(([meta, settings]) => ({
|
|
135
|
+
id: `${import_chunk_VCIHQZSN.SETTINGS_KEY}:${meta.id.replaceAll("/", ":")}`,
|
|
136
136
|
type: "category",
|
|
137
137
|
data: settings,
|
|
138
138
|
properties: {
|
|
@@ -143,4 +143,4 @@ var app_graph_builder_default = (context) => (0, import_chunk_55KIQ6YK.contribut
|
|
|
143
143
|
}
|
|
144
144
|
})
|
|
145
145
|
]);
|
|
146
|
-
//# sourceMappingURL=app-graph-builder-
|
|
146
|
+
//# sourceMappingURL=app-graph-builder-VMHWFCTP.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/plugin-settings/app-graph-builder.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { createExtension, type Node } from '@dxos/app-graph';\nimport { type SettingsStore, type SettingsValue } from '@dxos/local-storage';\nimport { isNonNullable } from '@dxos/util';\n\nimport { SETTINGS_ID, SETTINGS_KEY, SETTINGS_PLUGIN, SettingsAction } from './actions';\nimport { Capabilities } from '../common';\nimport { contributes, type PluginMeta, type PluginsContext } from '../core';\nimport { createIntent } from '../plugin-intent';\n\nexport default (context: PluginsContext) =>\n contributes(Capabilities.AppGraphBuilder, [\n createExtension({\n id: `${SETTINGS_PLUGIN}/action`,\n filter: (node): node is Node<null> => node.id === 'root',\n actions: () => [\n {\n id: SETTINGS_PLUGIN,\n data: async () => {\n const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);\n await dispatch(createIntent(SettingsAction.Open));\n },\n properties: {\n label: ['open settings label', { ns: SETTINGS_PLUGIN }],\n icon: 'ph--gear--regular',\n keyBinding: {\n macos: 'meta+,',\n windows: 'alt+,',\n },\n },\n },\n ],\n }),\n createExtension({\n id: `${SETTINGS_PLUGIN}/core`,\n filter: (node): node is Node<null> => node.id === 'root',\n connector: () => [\n {\n id: SETTINGS_ID,\n type: SETTINGS_PLUGIN,\n properties: {\n label: ['app settings label', { ns: SETTINGS_PLUGIN }],\n icon: 'ph--gear--regular',\n disposition: 'pin-end',\n position: 'hoist',\n testId: 'treeView.appSettings',\n },\n },\n ],\n }),\n createExtension({\n id: `${SETTINGS_PLUGIN}/core-plugins`,\n filter: (node): node is Node<null> => node.id === SETTINGS_ID,\n connector: () => {\n const manager = context.requestCapability(Capabilities.PluginManager);\n const [settingsStore] = context.requestCapabilities(Capabilities.SettingsStore);\n return [\n ...manager.plugins\n .filter((plugin) => manager.core.includes(plugin.meta.id))\n .map((plugin): [PluginMeta, SettingsStore<SettingsValue>] | null => {\n const settings = settingsStore?.getStore(plugin.meta.id);\n if (!settings) {\n return null;\n }\n\n return [plugin.meta, settings];\n })\n .filter(isNonNullable)\n .map(([meta, settings]) => ({\n id: `${SETTINGS_KEY}:${meta.id.replaceAll('/', ':')}`,\n type: 'category',\n data: settings,\n properties: {\n label: meta.name ?? meta.id,\n icon: meta.icon ?? 'ph--circle--regular',\n },\n })),\n\n {\n id: `${SETTINGS_KEY}:custom-plugins`,\n type: 'collection',\n properties: {\n label: ['custom plugins label', { ns: SETTINGS_PLUGIN }],\n icon: 'ph--squares-four--regular',\n role: 'branch',\n },\n },\n ];\n },\n }),\n createExtension({\n id: `${SETTINGS_PLUGIN}/custom-plugins`,\n filter: (node): node is Node<null> => node.id === `${SETTINGS_KEY}:custom-plugins`,\n connector: () => {\n const manager = context.requestCapability(Capabilities.PluginManager);\n const [settingsStore] = context.requestCapabilities(Capabilities.SettingsStore);\n return manager.plugins\n .filter((plugin) => !manager.core.includes(plugin.meta.id))\n .map((plugin): [PluginMeta, SettingsStore<SettingsValue>] | null => {\n const settings = settingsStore?.getStore(plugin.meta.id);\n if (!settings) {\n return null;\n }\n\n return [plugin.meta, settings];\n })\n .filter(isNonNullable)\n .map(([meta, settings]) => ({\n id: `${SETTINGS_KEY}:${meta.id.replaceAll('/', ':')}`,\n type: 'category',\n data: settings,\n properties: {\n label: meta.name ?? meta.id,\n icon: meta.icon ?? 'ph--circle--regular',\n },\n }));\n },\n }),\n ]);\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "SETTINGS_PLUGIN", "filter", "node", "actions", "data", "dispatchPromise", "dispatch", "requestCapability", "IntentDispatcher", "createIntent", "SettingsAction", "Open", "properties", "label", "ns", "icon", "keyBinding", "macos", "windows", "connector", "SETTINGS_ID", "type", "disposition", "position", "testId", "manager", "PluginManager", "settingsStore", "requestCapabilities", "SettingsStore", "plugins", "plugin", "core", "includes", "meta", "map", "settings", "getStore", "isNonNullable", "SETTINGS_KEY", "replaceAll", "name", "role"]
|
|
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_7Y6KJ3OK_exports = {};
|
|
30
|
+
__export(chunk_7Y6KJ3OK_exports, {
|
|
31
31
|
Capabilities: () => Capabilities,
|
|
32
32
|
Events: () => Events,
|
|
33
33
|
FileInfoSchema: () => FileInfoSchema,
|
|
@@ -66,9 +66,10 @@ __export(chunk_55KIQ6YK_exports, {
|
|
|
66
66
|
lazy: () => lazy,
|
|
67
67
|
oneOf: () => oneOf
|
|
68
68
|
});
|
|
69
|
-
module.exports = __toCommonJS(
|
|
69
|
+
module.exports = __toCommonJS(chunk_7Y6KJ3OK_exports);
|
|
70
70
|
var import_effect = require("effect");
|
|
71
71
|
var import_live_object = require("@dxos/live-object");
|
|
72
|
+
var import_log = require("@dxos/log");
|
|
72
73
|
var import_util = require("@dxos/util");
|
|
73
74
|
var import_schema = require("@effect/schema");
|
|
74
75
|
var import_schema2 = require("@effect/schema");
|
|
@@ -76,12 +77,12 @@ var import_signals_core = require("@preact/signals-core");
|
|
|
76
77
|
var import_async = require("@dxos/async");
|
|
77
78
|
var import_invariant = require("@dxos/invariant");
|
|
78
79
|
var import_live_object2 = require("@dxos/live-object");
|
|
79
|
-
var
|
|
80
|
+
var import_log2 = require("@dxos/log");
|
|
80
81
|
var import_signals_core2 = require("@preact/signals-core");
|
|
81
82
|
var import_effect2 = require("effect");
|
|
82
83
|
var import_async2 = require("@dxos/async");
|
|
83
84
|
var import_live_object3 = require("@dxos/live-object");
|
|
84
|
-
var
|
|
85
|
+
var import_log3 = require("@dxos/log");
|
|
85
86
|
var import_schema3 = require("@effect/schema");
|
|
86
87
|
var import_schema4 = require("@effect/schema");
|
|
87
88
|
var import_schema5 = require("@effect/schema");
|
|
@@ -204,7 +205,7 @@ var PluginsContext = class {
|
|
|
204
205
|
this._definedCapabilities.set(interfaceDef.identifier, current);
|
|
205
206
|
}
|
|
206
207
|
current.push(new CapabilityImpl(moduleId, implementation));
|
|
207
|
-
(0,
|
|
208
|
+
(0, import_log2.log)("capability contributed", {
|
|
208
209
|
id: interfaceDef.identifier,
|
|
209
210
|
moduleId,
|
|
210
211
|
count: (0, import_signals_core.untracked)(() => current.length)
|
|
@@ -226,7 +227,7 @@ var PluginsContext = class {
|
|
|
226
227
|
const index = current.findIndex((i) => i.implementation === implementation);
|
|
227
228
|
if (index !== -1) {
|
|
228
229
|
current.splice(index, 1);
|
|
229
|
-
(0,
|
|
230
|
+
(0, import_log2.log)("capability removed", {
|
|
230
231
|
id: interfaceDef.identifier,
|
|
231
232
|
count: (0, import_signals_core.untracked)(() => current.length)
|
|
232
233
|
}, {
|
|
@@ -236,7 +237,7 @@ var PluginsContext = class {
|
|
|
236
237
|
C: (f, a) => f(...a)
|
|
237
238
|
});
|
|
238
239
|
} else {
|
|
239
|
-
|
|
240
|
+
import_log2.log.warn("capability not removed", {
|
|
240
241
|
id: interfaceDef.identifier
|
|
241
242
|
}, {
|
|
242
243
|
F: __dxlog_file,
|
|
@@ -407,7 +408,7 @@ var PluginManager = class {
|
|
|
407
408
|
*/
|
|
408
409
|
async add(id) {
|
|
409
410
|
return (0, import_signals_core2.untracked)(async () => {
|
|
410
|
-
(0,
|
|
411
|
+
(0, import_log3.log)("add plugin", {
|
|
411
412
|
id
|
|
412
413
|
}, {
|
|
413
414
|
F: __dxlog_file2,
|
|
@@ -426,7 +427,7 @@ var PluginManager = class {
|
|
|
426
427
|
*/
|
|
427
428
|
enable(id) {
|
|
428
429
|
return (0, import_signals_core2.untracked)(async () => {
|
|
429
|
-
(0,
|
|
430
|
+
(0, import_log3.log)("enable plugin", {
|
|
430
431
|
id
|
|
431
432
|
}, {
|
|
432
433
|
F: __dxlog_file2,
|
|
@@ -445,7 +446,7 @@ var PluginManager = class {
|
|
|
445
446
|
this._addModule(module2);
|
|
446
447
|
this._setPendingResetByModule(module2);
|
|
447
448
|
});
|
|
448
|
-
(0,
|
|
449
|
+
(0, import_log3.log)("pending reset", {
|
|
449
450
|
events: [
|
|
450
451
|
...this.pendingReset
|
|
451
452
|
]
|
|
@@ -467,7 +468,7 @@ var PluginManager = class {
|
|
|
467
468
|
*/
|
|
468
469
|
remove(id) {
|
|
469
470
|
return (0, import_signals_core2.untracked)(() => {
|
|
470
|
-
(0,
|
|
471
|
+
(0, import_log3.log)("remove plugin", {
|
|
471
472
|
id
|
|
472
473
|
}, {
|
|
473
474
|
F: __dxlog_file2,
|
|
@@ -489,7 +490,7 @@ var PluginManager = class {
|
|
|
489
490
|
*/
|
|
490
491
|
disable(id) {
|
|
491
492
|
return (0, import_signals_core2.untracked)(async () => {
|
|
492
|
-
(0,
|
|
493
|
+
(0, import_log3.log)("disable plugin", {
|
|
493
494
|
id
|
|
494
495
|
}, {
|
|
495
496
|
F: __dxlog_file2,
|
|
@@ -541,7 +542,7 @@ var PluginManager = class {
|
|
|
541
542
|
}
|
|
542
543
|
_addPlugin(plugin) {
|
|
543
544
|
(0, import_signals_core2.untracked)(() => {
|
|
544
|
-
(0,
|
|
545
|
+
(0, import_log3.log)("add plugin", {
|
|
545
546
|
id: plugin.meta.id
|
|
546
547
|
}, {
|
|
547
548
|
F: __dxlog_file2,
|
|
@@ -556,7 +557,7 @@ var PluginManager = class {
|
|
|
556
557
|
}
|
|
557
558
|
_removePlugin(id) {
|
|
558
559
|
(0, import_signals_core2.untracked)(() => {
|
|
559
|
-
(0,
|
|
560
|
+
(0, import_log3.log)("remove plugin", {
|
|
560
561
|
id
|
|
561
562
|
}, {
|
|
562
563
|
F: __dxlog_file2,
|
|
@@ -572,7 +573,7 @@ var PluginManager = class {
|
|
|
572
573
|
}
|
|
573
574
|
_addModule(module2) {
|
|
574
575
|
(0, import_signals_core2.untracked)(() => {
|
|
575
|
-
(0,
|
|
576
|
+
(0, import_log3.log)("add module", {
|
|
576
577
|
id: module2.id
|
|
577
578
|
}, {
|
|
578
579
|
F: __dxlog_file2,
|
|
@@ -587,7 +588,7 @@ var PluginManager = class {
|
|
|
587
588
|
}
|
|
588
589
|
_removeModule(id) {
|
|
589
590
|
(0, import_signals_core2.untracked)(() => {
|
|
590
|
-
(0,
|
|
591
|
+
(0, import_log3.log)("remove module", {
|
|
591
592
|
id
|
|
592
593
|
}, {
|
|
593
594
|
F: __dxlog_file2,
|
|
@@ -621,7 +622,7 @@ var PluginManager = class {
|
|
|
621
622
|
const activationEvents = getEvents(module2.activatesOn).map(eventKey).filter((key) => this._state.eventsFired.includes(key));
|
|
622
623
|
const pendingReset = Array.from(new Set(activationEvents)).filter((event) => !this._state.pendingReset.includes(event));
|
|
623
624
|
if (pendingReset.length > 0) {
|
|
624
|
-
(0,
|
|
625
|
+
(0, import_log3.log)("pending reset", {
|
|
625
626
|
events: pendingReset
|
|
626
627
|
}, {
|
|
627
628
|
F: __dxlog_file2,
|
|
@@ -640,7 +641,7 @@ var PluginManager = class {
|
|
|
640
641
|
_activate(event) {
|
|
641
642
|
return import_effect2.Effect.gen(this, function* () {
|
|
642
643
|
const key = typeof event === "string" ? event : eventKey(event);
|
|
643
|
-
(0,
|
|
644
|
+
(0, import_log3.log)("activating", {
|
|
644
645
|
key
|
|
645
646
|
}, {
|
|
646
647
|
F: __dxlog_file2,
|
|
@@ -661,7 +662,7 @@ var PluginManager = class {
|
|
|
661
662
|
return events.every((event2) => this._state.eventsFired.includes(eventKey(event2)));
|
|
662
663
|
});
|
|
663
664
|
if (modules.length === 0) {
|
|
664
|
-
(0,
|
|
665
|
+
(0, import_log3.log)("no modules to activate", {
|
|
665
666
|
key
|
|
666
667
|
}, {
|
|
667
668
|
F: __dxlog_file2,
|
|
@@ -674,7 +675,7 @@ var PluginManager = class {
|
|
|
674
675
|
}
|
|
675
676
|
return false;
|
|
676
677
|
}
|
|
677
|
-
(0,
|
|
678
|
+
(0, import_log3.log)("activating modules", {
|
|
678
679
|
key,
|
|
679
680
|
modules: modules.map((module2) => module2.id)
|
|
680
681
|
}, {
|
|
@@ -717,7 +718,7 @@ var PluginManager = class {
|
|
|
717
718
|
event: key,
|
|
718
719
|
state: "activated"
|
|
719
720
|
});
|
|
720
|
-
(0,
|
|
721
|
+
(0, import_log3.log)("activated", {
|
|
721
722
|
key
|
|
722
723
|
}, {
|
|
723
724
|
F: __dxlog_file2,
|
|
@@ -733,7 +734,7 @@ var PluginManager = class {
|
|
|
733
734
|
yield* import_effect2.Effect.all(module2.activatesBefore?.map((event) => this._activate(event)) ?? [], {
|
|
734
735
|
concurrency: "unbounded"
|
|
735
736
|
});
|
|
736
|
-
(0,
|
|
737
|
+
(0, import_log3.log)("activating module...", {
|
|
737
738
|
module: module2.id
|
|
738
739
|
}, {
|
|
739
740
|
F: __dxlog_file2,
|
|
@@ -762,7 +763,7 @@ var PluginManager = class {
|
|
|
762
763
|
});
|
|
763
764
|
this._state.active.push(module2.id);
|
|
764
765
|
this._capabilities.set(module2.id, capabilities);
|
|
765
|
-
(0,
|
|
766
|
+
(0, import_log3.log)("activated module", {
|
|
766
767
|
module: module2.id
|
|
767
768
|
}, {
|
|
768
769
|
F: __dxlog_file2,
|
|
@@ -791,7 +792,7 @@ var PluginManager = class {
|
|
|
791
792
|
_deactivateModule(module2) {
|
|
792
793
|
return import_effect2.Effect.gen(this, function* () {
|
|
793
794
|
const id = module2.id;
|
|
794
|
-
(0,
|
|
795
|
+
(0, import_log3.log)("deactivating", {
|
|
795
796
|
id
|
|
796
797
|
}, {
|
|
797
798
|
F: __dxlog_file2,
|
|
@@ -815,7 +816,7 @@ var PluginManager = class {
|
|
|
815
816
|
if (activeIndex !== -1) {
|
|
816
817
|
this._state.active.splice(activeIndex, 1);
|
|
817
818
|
}
|
|
818
|
-
(0,
|
|
819
|
+
(0, import_log3.log)("deactivated", {
|
|
819
820
|
id
|
|
820
821
|
}, {
|
|
821
822
|
F: __dxlog_file2,
|
|
@@ -829,7 +830,7 @@ var PluginManager = class {
|
|
|
829
830
|
_reset(event) {
|
|
830
831
|
return import_effect2.Effect.gen(this, function* () {
|
|
831
832
|
const key = typeof event === "string" ? event : eventKey(event);
|
|
832
|
-
(0,
|
|
833
|
+
(0, import_log3.log)("reset", {
|
|
833
834
|
key
|
|
834
835
|
}, {
|
|
835
836
|
F: __dxlog_file2,
|
|
@@ -892,12 +893,13 @@ var Capabilities;
|
|
|
892
893
|
var Events;
|
|
893
894
|
(function(Events2) {
|
|
894
895
|
Events2.Startup = defineEvent("dxos.org/app-framework/event/startup");
|
|
895
|
-
Events2.
|
|
896
|
+
Events2.SetupReactSurface = defineEvent("dxos.org/app-framework/event/setup-react-surface");
|
|
896
897
|
Events2.SetupMetadata = defineEvent("dxos.org/app-framework/event/setup-metadata");
|
|
897
|
-
Events2.
|
|
898
|
+
Events2.SetupIntentResolver = defineEvent("dxos.org/app-framework/event/setup-intent-resolver");
|
|
898
899
|
Events2.SetupSettings = defineEvent("dxos.org/app-framework/event/setup-settings");
|
|
899
900
|
Events2.SetupAppGraph = defineEvent("dxos.org/app-framework/event/setup-graph");
|
|
900
901
|
Events2.SetupTranslations = defineEvent("dxos.org/app-framework/event/setup-translations");
|
|
902
|
+
Events2.SetupArtifactDefinition = defineEvent("dxos.org/app-framework/event/setup-artifact-definition");
|
|
901
903
|
Events2.DispatcherReady = defineEvent("dxos.org/app-framework/event/dispatcher-ready");
|
|
902
904
|
Events2.SettingsReady = defineEvent("dxos.org/app-framework/event/settings-ready");
|
|
903
905
|
Events2.AppGraphReady = defineEvent("dxos.org/app-framework/event/graph-ready");
|
|
@@ -941,7 +943,7 @@ var IntentPlugin = () => definePlugin({
|
|
|
941
943
|
activatesAfter: [
|
|
942
944
|
Events.DispatcherReady
|
|
943
945
|
],
|
|
944
|
-
activate: lazy(() => import("./intent-dispatcher-
|
|
946
|
+
activate: lazy(() => import("./intent-dispatcher-PRCC4KZT.cjs"))
|
|
945
947
|
})
|
|
946
948
|
]);
|
|
947
949
|
var LAYOUT_PLUGIN = "dxos.org/plugin/layout";
|
|
@@ -1038,7 +1040,7 @@ var LayoutAction;
|
|
|
1038
1040
|
state: import_schema4.Schema.optional(import_schema4.Schema.Boolean.annotations({
|
|
1039
1041
|
description: "Whether the dialog is open or closed."
|
|
1040
1042
|
})),
|
|
1041
|
-
blockAlign: import_schema4.Schema.optional(import_schema4.Schema.Literal("start", "center").annotations({
|
|
1043
|
+
blockAlign: import_schema4.Schema.optional(import_schema4.Schema.Literal("start", "center", "end").annotations({
|
|
1042
1044
|
description: "The alignment of the dialog."
|
|
1043
1045
|
})),
|
|
1044
1046
|
type: import_schema4.Schema.optional(import_schema4.Schema.Literal("default", "alert").annotations({
|
|
@@ -1068,6 +1070,9 @@ var LayoutAction;
|
|
|
1068
1070
|
anchorId: import_schema4.Schema.String.annotations({
|
|
1069
1071
|
description: "The id of the element to anchor the popover to."
|
|
1070
1072
|
}),
|
|
1073
|
+
side: import_schema4.Schema.optional(import_schema4.Schema.Literal("top", "right", "bottom", "left").annotations({
|
|
1074
|
+
description: "The side of the anchor."
|
|
1075
|
+
})),
|
|
1071
1076
|
state: import_schema4.Schema.optional(import_schema4.Schema.Boolean.annotations({
|
|
1072
1077
|
description: "Whether the popover is open or closed."
|
|
1073
1078
|
})),
|
|
@@ -1138,6 +1143,21 @@ var LayoutAction;
|
|
|
1138
1143
|
}) {
|
|
1139
1144
|
}
|
|
1140
1145
|
LayoutAction2.SwitchWorkspace = SwitchWorkspace;
|
|
1146
|
+
class RevertWorkspace extends import_schema4.Schema.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1147
|
+
input: import_schema4.Schema.Struct({
|
|
1148
|
+
part: import_schema4.Schema.Literal("workspace").annotations({
|
|
1149
|
+
description: "Switching the workspace."
|
|
1150
|
+
}),
|
|
1151
|
+
options: import_schema4.Schema.Struct({
|
|
1152
|
+
revert: import_schema4.Schema.Literal(true).annotations({
|
|
1153
|
+
description: "Revert to the previous workspace."
|
|
1154
|
+
})
|
|
1155
|
+
})
|
|
1156
|
+
}),
|
|
1157
|
+
output: import_schema4.Schema.Void
|
|
1158
|
+
}) {
|
|
1159
|
+
}
|
|
1160
|
+
LayoutAction2.RevertWorkspace = RevertWorkspace;
|
|
1141
1161
|
class Open extends import_schema4.Schema.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1142
1162
|
input: import_schema4.Schema.Struct({
|
|
1143
1163
|
part: import_schema4.Schema.Literal("main").annotations({
|
|
@@ -1252,6 +1272,7 @@ var Resource = import_schema5.Schema.Record({
|
|
|
1252
1272
|
key: import_schema5.Schema.String,
|
|
1253
1273
|
value: ResourceLanguage
|
|
1254
1274
|
});
|
|
1275
|
+
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/app-framework/src/plugin-intent/intent-dispatcher.ts";
|
|
1255
1276
|
var EXECUTION_LIMIT = 100;
|
|
1256
1277
|
var HISTORY_LIMIT = 100;
|
|
1257
1278
|
var createResolver = (resolver) => resolver;
|
|
@@ -1321,9 +1342,17 @@ var createDispatcher = (getResolvers, { executionLimit = EXECUTION_LIMIT, histor
|
|
|
1321
1342
|
const dispatchPromise = (intentChain) => {
|
|
1322
1343
|
return import_effect.Effect.runPromise(dispatch(intentChain)).then((data) => ({
|
|
1323
1344
|
data
|
|
1324
|
-
})).catch((error) =>
|
|
1325
|
-
error
|
|
1326
|
-
|
|
1345
|
+
})).catch((error) => {
|
|
1346
|
+
import_log.log.catch(error, void 0, {
|
|
1347
|
+
F: __dxlog_file3,
|
|
1348
|
+
L: 241,
|
|
1349
|
+
S: void 0,
|
|
1350
|
+
C: (f, a) => f(...a)
|
|
1351
|
+
});
|
|
1352
|
+
return {
|
|
1353
|
+
error
|
|
1354
|
+
};
|
|
1355
|
+
});
|
|
1327
1356
|
};
|
|
1328
1357
|
const undo = () => {
|
|
1329
1358
|
return import_effect.Effect.gen(function* () {
|
|
@@ -1382,12 +1411,12 @@ var intent_dispatcher_default = (context) => {
|
|
|
1382
1411
|
const manager = context.requestCapability(Capabilities.PluginManager);
|
|
1383
1412
|
state.dispatch = (intentChain, depth) => {
|
|
1384
1413
|
return import_effect.Effect.gen(function* () {
|
|
1385
|
-
yield* manager._activate(Events.
|
|
1414
|
+
yield* manager._activate(Events.SetupIntentResolver);
|
|
1386
1415
|
return yield* dispatch(intentChain, depth);
|
|
1387
1416
|
});
|
|
1388
1417
|
};
|
|
1389
1418
|
state.dispatchPromise = async (intentChain) => {
|
|
1390
|
-
await manager.activate(Events.
|
|
1419
|
+
await manager.activate(Events.SetupIntentResolver);
|
|
1391
1420
|
return await dispatchPromise(intentChain);
|
|
1392
1421
|
};
|
|
1393
1422
|
state.undo = undo;
|
|
@@ -1434,4 +1463,4 @@ var intent_dispatcher_default = (context) => {
|
|
|
1434
1463
|
lazy,
|
|
1435
1464
|
oneOf
|
|
1436
1465
|
});
|
|
1437
|
-
//# sourceMappingURL=chunk-
|
|
1466
|
+
//# sourceMappingURL=chunk-7Y6KJ3OK.cjs.map
|