@dxos/app-framework 0.7.5-labs.ea4b4c2 → 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-FKJO22ZQ.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-4VFJRQG5.mjs → chunk-BCMEJONP.mjs} +38 -9
- package/dist/lib/browser/chunk-BCMEJONP.mjs.map +7 -0
- package/dist/lib/browser/{chunk-EJQEJKYV.mjs → chunk-QS4J6O47.mjs} +4 -4
- package/dist/lib/browser/{chunk-EJQEJKYV.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-AZMM7UEL.mjs → intent-dispatcher-GFBH7T2J.mjs} +2 -2
- package/dist/lib/browser/{intent-resolver-DPZ7H4US.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-4MZN2QDW.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-7QM2UK3H.cjs → chunk-7Y6KJ3OK.cjs} +65 -36
- package/dist/lib/node/chunk-7Y6KJ3OK.cjs.map +7 -0
- package/dist/lib/node/{chunk-ENNQHSAF.cjs → chunk-B65NJEIJ.cjs} +19 -19
- package/dist/lib/node/{chunk-ENNQHSAF.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-HCIHZFG5.cjs → intent-dispatcher-PRCC4KZT.cjs} +8 -8
- package/dist/lib/node/{intent-dispatcher-HCIHZFG5.cjs.map → intent-dispatcher-PRCC4KZT.cjs.map} +2 -2
- package/dist/lib/node/{intent-resolver-QTMN3UL7.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-CMXLIKTO.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-Q2RQKKOT.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-FGFGXXDU.mjs → chunk-JDAHZRYQ.mjs} +4 -4
- package/dist/lib/node-esm/{chunk-FGFGXXDU.mjs.map → chunk-JDAHZRYQ.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-SGUPFJDE.mjs → chunk-TVIR2PHY.mjs} +38 -9
- 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-A4DEMSFG.mjs → intent-dispatcher-LGACN32C.mjs} +2 -2
- package/dist/lib/node-esm/{intent-resolver-6IUNTD6Z.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 +14 -0
- 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 +13 -0
- 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-FKJO22ZQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-4VFJRQG5.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-DPZ7H4US.mjs.map +0 -7
- package/dist/lib/browser/store-MNPEQWEA.mjs +0 -19
- package/dist/lib/browser/store-MNPEQWEA.mjs.map +0 -7
- package/dist/lib/node/app-graph-builder-4MZN2QDW.cjs.map +0 -7
- package/dist/lib/node/chunk-7QM2UK3H.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-QTMN3UL7.cjs.map +0 -7
- package/dist/lib/node/store-CMXLIKTO.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-Q2RQKKOT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SGUPFJDE.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-6IUNTD6Z.mjs.map +0 -7
- package/dist/lib/node-esm/store-Q6QU5OV4.mjs +0 -20
- package/dist/lib/node-esm/store-Q6QU5OV4.mjs.map +0 -7
- /package/{.eslintrc.js → .eslintrc.cjs} +0 -0
- /package/dist/lib/browser/{intent-dispatcher-AZMM7UEL.mjs.map → intent-dispatcher-GFBH7T2J.mjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-dispatcher-A4DEMSFG.mjs.map → intent-dispatcher-LGACN32C.mjs.map} +0 -0
|
@@ -108,6 +108,6 @@ export declare const createDispatcher: (getResolvers: (module?: string) => AnyIn
|
|
|
108
108
|
executionLimit?: number | undefined;
|
|
109
109
|
historyLimit?: number | undefined;
|
|
110
110
|
}) => IntentContext;
|
|
111
|
-
declare const _default: (context: PluginsContext) => import("
|
|
111
|
+
declare const _default: (context: PluginsContext) => import("..").Capability<import("@dxos/live-object").ReactiveObject<IntentContext>>;
|
|
112
112
|
export default _default;
|
|
113
113
|
//# sourceMappingURL=intent-dispatcher.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intent-dispatcher.d.ts","sourceRoot":"","sources":["../../../../src/plugin-intent/intent-dispatcher.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAqB,MAAM,QAAQ,CAAC;AACnD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"intent-dispatcher.d.ts","sourceRoot":"","sources":["../../../../src/plugin-intent/intent-dispatcher.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAqB,MAAM,QAAQ,CAAC;AACnD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAI7C,OAAO,EAAc,KAAK,YAAY,EAAE,KAAK,QAAQ,EAAE,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAI5F,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,KAAK,EACX,MAAM,UAAU,CAAC;AAElB,OAAO,EAAe,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAK3D;;GAEG;AACH,MAAM,MAAM,kBAAkB,CAAC,KAAK,EAAE,MAAM,IAAI;IAC9C;;;;OAIG;IACH,IAAI,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C;CAC9B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,CAAC,sBAAsB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAEhF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AAQzD,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,eAAe,EAAE,uBAAuB,CAAC;IACzC,IAAI,EAAE,UAAU,CAAC;IACjB,WAAW,EAAE,iBAAiB,CAAC;CAChC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,iBACb,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,iBAAiB,EAAE;;;MAErD,aAoGF,CAAC;kCAKuB,cAAc;AAAvC,wBAgCE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SettingsPlugin: () => import("
|
|
1
|
+
export declare const SettingsPlugin: () => import("..").Plugin;
|
|
2
2
|
//# sourceMappingURL=SettingsPlugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsPlugin.d.ts","sourceRoot":"","sources":["../../../../src/plugin-settings/SettingsPlugin.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"SettingsPlugin.d.ts","sourceRoot":"","sources":["../../../../src/plugin-settings/SettingsPlugin.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,cAAc,2BAwBvB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Schema as S } from '@effect/schema';
|
|
2
2
|
export declare const SETTINGS_PLUGIN = "dxos.org/plugin/settings";
|
|
3
3
|
export declare const SETTINGS_ACTION = "dxos.org/plugin/settings/action";
|
|
4
|
-
export declare const SETTINGS_ID = "dxos:settings";
|
|
4
|
+
export declare const SETTINGS_ID = "!dxos:settings";
|
|
5
5
|
export declare const SETTINGS_KEY = "settings";
|
|
6
6
|
export declare namespace SettingsAction {
|
|
7
7
|
const Open_base: S.TaggedClass<Open, "dxos.org/plugin/settings/action/open", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../../src/plugin-settings/actions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,gBAAgB,CAAC;AAE7C,eAAO,MAAM,eAAe,6BAA6B,CAAC;AAC1D,eAAO,MAAM,eAAe,oCAA8B,CAAC;AAC3D,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../../src/plugin-settings/actions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,gBAAgB,CAAC;AAE7C,eAAO,MAAM,eAAe,6BAA6B,CAAC;AAC1D,eAAO,MAAM,eAAe,oCAA8B,CAAC;AAC3D,eAAO,MAAM,WAAW,mBAAmB,CAAC;AAC5C,eAAO,MAAM,YAAY,aAAa,CAAC;AAEvC,yBAAiB,cAAc,CAAC;;;;;;;;;IAC9B,MAAM,OAAO,IAAK,SAAQ,SAKxB;KAAG;;;;;;;IAEL,MAAM,OAAO,kBAAmB,SAAQ,uBAMvC;KAAG;;CACL"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Node } from '@dxos/app-graph';
|
|
2
2
|
import { type PluginsContext } from '../core';
|
|
3
|
-
declare const _default: (context: PluginsContext) => import("
|
|
3
|
+
declare const _default: (context: PluginsContext) => import("..").Capability<Readonly<{
|
|
4
4
|
id: string;
|
|
5
5
|
position: import("@dxos/util").Position;
|
|
6
6
|
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Capabilities } from '../common';
|
|
2
|
-
declare const _default: () => import("
|
|
2
|
+
declare const _default: () => import("..").Capability<Capabilities.IntentResolver>;
|
|
3
3
|
export default _default;
|
|
4
4
|
//# sourceMappingURL=intent-resolver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intent-resolver.d.ts","sourceRoot":"","sources":["../../../../src/plugin-settings/intent-resolver.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAgB,MAAM,WAAW,CAAC;;AAIvD,
|
|
1
|
+
{"version":3,"file":"intent-resolver.d.ts","sourceRoot":"","sources":["../../../../src/plugin-settings/intent-resolver.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAgB,MAAM,WAAW,CAAC;;AAIvD,wBAsBI"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RootSettingsStore } from '@dxos/local-storage';
|
|
2
2
|
import { type PluginsContext } from '../core';
|
|
3
|
-
declare const _default: (context: PluginsContext) => import("
|
|
3
|
+
declare const _default: (context: PluginsContext) => import("..").Capability<RootSettingsStore>;
|
|
4
4
|
export default _default;
|
|
5
5
|
//# sourceMappingURL=store.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../src/plugin-settings/store.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../src/plugin-settings/store.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,OAAO,EAAe,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;kCAElC,cAAc;AAAvC,wBAkBE"}
|
|
@@ -24,7 +24,7 @@ export declare class ErrorBoundary extends Component<Props, State> {
|
|
|
24
24
|
error: Error;
|
|
25
25
|
};
|
|
26
26
|
componentDidUpdate(prevProps: Props): void;
|
|
27
|
-
render(): string | number | boolean | Iterable<React.ReactNode> |
|
|
27
|
+
render(): string | number | boolean | Iterable<React.ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
28
28
|
private resetError;
|
|
29
29
|
}
|
|
30
30
|
export {};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import '@dxos-theme';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import { type PluginManager } from '../core';
|
|
4
3
|
declare const _default: {
|
|
5
4
|
title: string;
|
|
6
5
|
render: ({ manager }: {
|
|
7
6
|
manager: PluginManager;
|
|
8
|
-
}) =>
|
|
9
|
-
decorators: import("@storybook/react
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
decorators: import("@storybook/react").Decorator[];
|
|
10
9
|
args: {
|
|
11
10
|
manager: PluginManager;
|
|
12
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Surface.stories.d.ts","sourceRoot":"","sources":["../../../../src/react/Surface.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Surface.stories.d.ts","sourceRoot":"","sources":["../../../../src/react/Surface.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAWrB,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;;;0BAkErB;QAAE,OAAO,EAAE,aAAa,CAAA;KAAE;;;;;;AAFlD,wBAcE;AAEF,eAAO,MAAM,OAAO,IAAK,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export declare const useIntentDispatcher: () => import("..").IntentContext;
|
|
2
|
-
export declare const useAppGraph: () => Readonly<Pick<import("
|
|
2
|
+
export declare const useAppGraph: () => Readonly<Pick<import("@dxos/app-graph").GraphBuilder, "graph" | "explore">>;
|
|
3
3
|
export declare const useLayout: () => Readonly<{
|
|
4
4
|
mode: string;
|
|
5
5
|
dialogOpen: boolean;
|
|
6
6
|
sidebarOpen: boolean;
|
|
7
7
|
complementarySidebarOpen: boolean;
|
|
8
|
+
workspace: string;
|
|
8
9
|
active: string[];
|
|
9
10
|
inactive: string[];
|
|
10
11
|
scrollIntoView: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/react/common.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,mBAAmB,kCAAqD,CAAC;AAEtF,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/react/common.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,mBAAmB,kCAAqD,CAAC;AAEtF,eAAO,MAAM,WAAW,mFAA6C,CAAC;AAEtE,eAAO,MAAM,SAAS;;;;;;;;;EAA2C,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { type Decorator } from '@storybook/react';
|
|
2
2
|
import { type CreateAppOptions } from '../App';
|
|
3
|
-
import { type AnyCapability } from '../core';
|
|
3
|
+
import { type ActivationEvent, type AnyCapability } from '../core';
|
|
4
|
+
export type WithPluginManagerOptions = CreateAppOptions & {
|
|
5
|
+
capabilities?: AnyCapability[];
|
|
6
|
+
fireEvents?: (ActivationEvent | string)[];
|
|
7
|
+
};
|
|
4
8
|
/**
|
|
5
9
|
* Wraps a story with a plugin manager.
|
|
6
10
|
*/
|
|
7
|
-
export declare const withPluginManager: (options?:
|
|
8
|
-
capabilities?: AnyCapability[];
|
|
9
|
-
}) => Decorator;
|
|
11
|
+
export declare const withPluginManager: (options?: WithPluginManagerOptions) => Decorator;
|
|
10
12
|
//# sourceMappingURL=withPluginManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withPluginManager.d.ts","sourceRoot":"","sources":["../../../../src/testing/withPluginManager.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAKlD,OAAO,EAAa,KAAK,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAE1D,OAAO,
|
|
1
|
+
{"version":3,"file":"withPluginManager.d.ts","sourceRoot":"","sources":["../../../../src/testing/withPluginManager.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAKlD,OAAO,EAAa,KAAK,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAE1D,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,aAAa,EAKnB,MAAM,SAAS,CAAC;AA+BjB,MAAM,MAAM,wBAAwB,GAAG,gBAAgB,GAAG;IACxD,YAAY,CAAC,EAAE,aAAa,EAAE,CAAC;IAC/B,UAAU,CAAC,EAAE,CAAC,eAAe,GAAG,MAAM,CAAC,EAAE,CAAC;CAC3C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,aAAa,wBAAwB,KAAQ,SAyB1E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/app-framework",
|
|
3
|
-
"version": "0.7.5-labs.
|
|
3
|
+
"version": "0.7.5-labs.f400bbc",
|
|
4
4
|
"description": "A framework for building applications from composible plugins.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"author": "DXOS.org",
|
|
9
9
|
"sideEffects": true,
|
|
10
|
+
"type": "module",
|
|
10
11
|
"exports": {
|
|
11
12
|
".": {
|
|
12
13
|
"types": "./dist/types/src/index.d.ts",
|
|
@@ -39,28 +40,28 @@
|
|
|
39
40
|
"@effect/schema": "^0.75.5",
|
|
40
41
|
"@preact/signals-core": "^1.6.0",
|
|
41
42
|
"effect": "^3.12.3",
|
|
42
|
-
"@dxos/app-graph": "0.7.5-labs.
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/async": "0.7.5-labs.
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/react-hooks": "0.7.5-labs.
|
|
52
|
-
"@dxos/util": "0.7.5-labs.
|
|
43
|
+
"@dxos/app-graph": "0.7.5-labs.f400bbc",
|
|
44
|
+
"@dxos/client-protocol": "0.7.5-labs.f400bbc",
|
|
45
|
+
"@dxos/async": "0.7.5-labs.f400bbc",
|
|
46
|
+
"@dxos/artifact": "0.7.5-labs.f400bbc",
|
|
47
|
+
"@dxos/debug": "0.7.5-labs.f400bbc",
|
|
48
|
+
"@dxos/invariant": "0.7.5-labs.f400bbc",
|
|
49
|
+
"@dxos/live-object": "0.7.5-labs.f400bbc",
|
|
50
|
+
"@dxos/log": "0.7.5-labs.f400bbc",
|
|
51
|
+
"@dxos/local-storage": "0.7.5-labs.f400bbc",
|
|
52
|
+
"@dxos/react-hooks": "0.7.5-labs.f400bbc",
|
|
53
|
+
"@dxos/util": "0.7.5-labs.f400bbc"
|
|
53
54
|
},
|
|
54
55
|
"devDependencies": {
|
|
55
56
|
"@phosphor-icons/react": "^2.1.5",
|
|
56
57
|
"@types/react": "~18.2.0",
|
|
57
58
|
"react": "~18.2.0",
|
|
58
|
-
"@dxos/echo-schema": "0.7.5-labs.
|
|
59
|
-
"@dxos/echo-signals": "0.7.5-labs.
|
|
60
|
-
"@dxos/random": "0.7.5-labs.
|
|
61
|
-
"@dxos/react-ui": "0.7.5-labs.
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
59
|
+
"@dxos/echo-schema": "0.7.5-labs.f400bbc",
|
|
60
|
+
"@dxos/echo-signals": "0.7.5-labs.f400bbc",
|
|
61
|
+
"@dxos/random": "0.7.5-labs.f400bbc",
|
|
62
|
+
"@dxos/react-ui": "0.7.5-labs.f400bbc",
|
|
63
|
+
"@dxos/react-ui-syntax-highlighter": "0.7.5-labs.f400bbc",
|
|
64
|
+
"@dxos/storybook-utils": "0.7.5-labs.f400bbc"
|
|
64
65
|
},
|
|
65
66
|
"peerDependencies": {
|
|
66
67
|
"react": "~18.2.0"
|
package/project.json
CHANGED
package/src/App.tsx
CHANGED
|
@@ -75,7 +75,8 @@ export const createApp = ({
|
|
|
75
75
|
const manager = pluginManager ?? new PluginManager({ pluginLoader, plugins, core, enabled });
|
|
76
76
|
|
|
77
77
|
manager.activation.on(({ event, state: _state, error }) => {
|
|
78
|
-
|
|
78
|
+
// Once the app is ready the first time, don't show the fallback again.
|
|
79
|
+
if (!state.ready && event === Events.Startup.id) {
|
|
79
80
|
state.ready = _state === 'activated';
|
|
80
81
|
}
|
|
81
82
|
|
|
@@ -97,7 +98,7 @@ export const createApp = ({
|
|
|
97
98
|
setupDevtools(manager);
|
|
98
99
|
|
|
99
100
|
// TODO(wittjosiah): Factor out such that this could be called per surface role when attempting to render.
|
|
100
|
-
void manager.activate(Events.
|
|
101
|
+
void manager.activate(Events.SetupReactSurface);
|
|
101
102
|
void manager.activate(Events.Startup);
|
|
102
103
|
|
|
103
104
|
return () => (
|
|
@@ -43,6 +43,10 @@ export namespace Capabilities {
|
|
|
43
43
|
dialogOpen: boolean;
|
|
44
44
|
sidebarOpen: boolean;
|
|
45
45
|
complementarySidebarOpen: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* The id of the active workspace, where a workspace is a set of active items.
|
|
48
|
+
*/
|
|
49
|
+
workspace: string;
|
|
46
50
|
/**
|
|
47
51
|
* Identifiers of items which are currently active in the application.
|
|
48
52
|
*/
|
package/src/common/events.ts
CHANGED
|
@@ -18,7 +18,7 @@ export namespace Events {
|
|
|
18
18
|
/**
|
|
19
19
|
* Fired to load any newly available surfaces.
|
|
20
20
|
*/
|
|
21
|
-
export const
|
|
21
|
+
export const SetupReactSurface = defineEvent('dxos.org/app-framework/event/setup-react-surface');
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* Fired to load any newly available metadata.
|
|
@@ -28,7 +28,7 @@ export namespace Events {
|
|
|
28
28
|
/**
|
|
29
29
|
* Fired before the intent dispatcher is activated.
|
|
30
30
|
*/
|
|
31
|
-
export const
|
|
31
|
+
export const SetupIntentResolver = defineEvent('dxos.org/app-framework/event/setup-intent-resolver');
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Fired before the settings store is activated.
|
|
@@ -45,6 +45,11 @@ export namespace Events {
|
|
|
45
45
|
*/
|
|
46
46
|
export const SetupTranslations = defineEvent('dxos.org/app-framework/event/setup-translations');
|
|
47
47
|
|
|
48
|
+
/**
|
|
49
|
+
* Fired to load any newly available artifacts definitions.
|
|
50
|
+
*/
|
|
51
|
+
export const SetupArtifactDefinition = defineEvent('dxos.org/app-framework/event/setup-artifact-definition');
|
|
52
|
+
|
|
48
53
|
//
|
|
49
54
|
// Triggered Events
|
|
50
55
|
//
|
package/src/common/layout.ts
CHANGED
|
@@ -111,6 +111,9 @@ export namespace LayoutAction {
|
|
|
111
111
|
subject: S.optional(S.String.annotations({ description: 'URI of the component to display in the popover.' })),
|
|
112
112
|
options: S.Struct({
|
|
113
113
|
anchorId: S.String.annotations({ description: 'The id of the element to anchor the popover to.' }),
|
|
114
|
+
side: S.optional(
|
|
115
|
+
S.Literal('top', 'right', 'bottom', 'left').annotations({ description: 'The side of the anchor.' }),
|
|
116
|
+
),
|
|
114
117
|
state: S.optional(S.Boolean.annotations({ description: 'Whether the popover is open or closed.' })),
|
|
115
118
|
props: S.optional(
|
|
116
119
|
S.Record({ key: S.String, value: S.Any }).annotations({
|
|
@@ -156,6 +159,16 @@ export namespace LayoutAction {
|
|
|
156
159
|
output: S.Void,
|
|
157
160
|
}) {}
|
|
158
161
|
|
|
162
|
+
export class RevertWorkspace extends S.TaggedClass<RevertWorkspace>()(UPDATE_LAYOUT, {
|
|
163
|
+
input: S.Struct({
|
|
164
|
+
part: S.Literal('workspace').annotations({ description: 'Switching the workspace.' }),
|
|
165
|
+
options: S.Struct({
|
|
166
|
+
revert: S.Literal(true).annotations({ description: 'Revert to the previous workspace.' }),
|
|
167
|
+
}),
|
|
168
|
+
}),
|
|
169
|
+
output: S.Void,
|
|
170
|
+
}) {}
|
|
171
|
+
|
|
159
172
|
export class Open extends S.TaggedClass<Open>()(UPDATE_LAYOUT, {
|
|
160
173
|
input: S.Struct({
|
|
161
174
|
part: S.Literal('main').annotations({ description: 'Opening an item in the main content area.' }),
|
|
@@ -15,7 +15,7 @@ export const LoggerPlugin = () =>
|
|
|
15
15
|
definePlugin({ id: 'dxos.org/test/logger' }, [
|
|
16
16
|
defineModule({
|
|
17
17
|
id: 'dxos.org/test/logger/intents',
|
|
18
|
-
activatesOn: Events.
|
|
18
|
+
activatesOn: Events.SetupIntentResolver,
|
|
19
19
|
activate: () => [
|
|
20
20
|
contributes(
|
|
21
21
|
Capabilities.IntentResolver,
|
|
@@ -6,6 +6,7 @@ import { Effect, Option, pipe, Ref } from 'effect';
|
|
|
6
6
|
import { type Simplify } from 'effect/Types';
|
|
7
7
|
|
|
8
8
|
import { create } from '@dxos/live-object';
|
|
9
|
+
import { log } from '@dxos/log';
|
|
9
10
|
import { byPosition, type MaybePromise, type Position, type GuardedType } from '@dxos/util';
|
|
10
11
|
|
|
11
12
|
import { IntentAction } from './actions';
|
|
@@ -236,7 +237,10 @@ export const createDispatcher = (
|
|
|
236
237
|
const dispatchPromise: PromiseIntentDispatcher = (intentChain) => {
|
|
237
238
|
return Effect.runPromise(dispatch(intentChain))
|
|
238
239
|
.then((data) => ({ data }))
|
|
239
|
-
.catch((error) =>
|
|
240
|
+
.catch((error) => {
|
|
241
|
+
log.catch(error);
|
|
242
|
+
return { error };
|
|
243
|
+
});
|
|
240
244
|
};
|
|
241
245
|
|
|
242
246
|
const undo: IntentUndo = () => {
|
|
@@ -289,12 +293,12 @@ export default (context: PluginsContext) => {
|
|
|
289
293
|
const manager = context.requestCapability(Capabilities.PluginManager);
|
|
290
294
|
state.dispatch = (intentChain, depth) => {
|
|
291
295
|
return Effect.gen(function* () {
|
|
292
|
-
yield* manager._activate(Events.
|
|
296
|
+
yield* manager._activate(Events.SetupIntentResolver);
|
|
293
297
|
return yield* dispatch(intentChain, depth);
|
|
294
298
|
});
|
|
295
299
|
};
|
|
296
300
|
state.dispatchPromise = async (intentChain) => {
|
|
297
|
-
await manager.activate(Events.
|
|
301
|
+
await manager.activate(Events.SetupIntentResolver);
|
|
298
302
|
return await dispatchPromise(intentChain);
|
|
299
303
|
};
|
|
300
304
|
state.undo = undo;
|
|
@@ -24,7 +24,7 @@ export const SettingsPlugin = () =>
|
|
|
24
24
|
}),
|
|
25
25
|
defineModule({
|
|
26
26
|
id: `${SETTINGS_PLUGIN}/module/intent-resolver`,
|
|
27
|
-
activatesOn: Events.
|
|
27
|
+
activatesOn: Events.SetupIntentResolver,
|
|
28
28
|
activate: lazy(() => import('./intent-resolver')),
|
|
29
29
|
}),
|
|
30
30
|
defineModule({
|
|
@@ -6,7 +6,7 @@ import { Schema as S } from '@effect/schema';
|
|
|
6
6
|
|
|
7
7
|
export const SETTINGS_PLUGIN = 'dxos.org/plugin/settings';
|
|
8
8
|
export const SETTINGS_ACTION = `${SETTINGS_PLUGIN}/action`;
|
|
9
|
-
export const SETTINGS_ID = 'dxos:settings';
|
|
9
|
+
export const SETTINGS_ID = '!dxos:settings';
|
|
10
10
|
export const SETTINGS_KEY = 'settings';
|
|
11
11
|
|
|
12
12
|
export namespace SettingsAction {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { createExtension, type Node } from '@dxos/app-graph';
|
|
6
6
|
import { type SettingsStore, type SettingsValue } from '@dxos/local-storage';
|
|
7
|
-
import {
|
|
7
|
+
import { isNonNullable } from '@dxos/util';
|
|
8
8
|
|
|
9
9
|
import { SETTINGS_ID, SETTINGS_KEY, SETTINGS_PLUGIN, SettingsAction } from './actions';
|
|
10
10
|
import { Capabilities } from '../common';
|
|
@@ -45,7 +45,7 @@ export default (context: PluginsContext) =>
|
|
|
45
45
|
label: ['app settings label', { ns: SETTINGS_PLUGIN }],
|
|
46
46
|
icon: 'ph--gear--regular',
|
|
47
47
|
disposition: 'pin-end',
|
|
48
|
-
position: '
|
|
48
|
+
position: 'hoist',
|
|
49
49
|
testId: 'treeView.appSettings',
|
|
50
50
|
},
|
|
51
51
|
},
|
|
@@ -68,7 +68,7 @@ export default (context: PluginsContext) =>
|
|
|
68
68
|
|
|
69
69
|
return [plugin.meta, settings];
|
|
70
70
|
})
|
|
71
|
-
.filter(
|
|
71
|
+
.filter(isNonNullable)
|
|
72
72
|
.map(([meta, settings]) => ({
|
|
73
73
|
id: `${SETTINGS_KEY}:${meta.id.replaceAll('/', ':')}`,
|
|
74
74
|
type: 'category',
|
|
@@ -107,7 +107,7 @@ export default (context: PluginsContext) =>
|
|
|
107
107
|
|
|
108
108
|
return [plugin.meta, settings];
|
|
109
109
|
})
|
|
110
|
-
.filter(
|
|
110
|
+
.filter(isNonNullable)
|
|
111
111
|
.map(([meta, settings]) => ({
|
|
112
112
|
id: `${SETTINGS_KEY}:${meta.id.replaceAll('/', ':')}`,
|
|
113
113
|
type: 'category',
|
|
@@ -15,12 +15,18 @@ export default () =>
|
|
|
15
15
|
createResolver({
|
|
16
16
|
intent: SettingsAction.Open,
|
|
17
17
|
resolve: ({ plugin }) => {
|
|
18
|
+
const openSettings = createIntent(LayoutAction.SwitchWorkspace, { part: 'workspace', subject: SETTINGS_ID });
|
|
18
19
|
return {
|
|
19
20
|
intents: [
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
plugin
|
|
22
|
+
? pipe(
|
|
23
|
+
openSettings,
|
|
24
|
+
chain(LayoutAction.Open, {
|
|
25
|
+
part: 'main',
|
|
26
|
+
subject: [`${SETTINGS_KEY}:${plugin.replaceAll('/', ':')}`],
|
|
27
|
+
}),
|
|
28
|
+
)
|
|
29
|
+
: openSettings,
|
|
24
30
|
],
|
|
25
31
|
};
|
|
26
32
|
},
|
|
@@ -2,19 +2,29 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { effect } from '@preact/signals-core';
|
|
6
|
+
|
|
5
7
|
import { RootSettingsStore } from '@dxos/local-storage';
|
|
6
8
|
|
|
7
9
|
import { Capabilities } from '../common';
|
|
8
10
|
import { contributes, type PluginsContext } from '../core';
|
|
9
11
|
|
|
10
12
|
export default (context: PluginsContext) => {
|
|
11
|
-
// TODO(wittjosiah): This should subscribe to capabilities and create stores for newly added settings objects.
|
|
12
|
-
const allSettings = context.requestCapabilities(Capabilities.Settings);
|
|
13
13
|
const settingsStore = new RootSettingsStore();
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
let previous: Capabilities.Settings[] = [];
|
|
16
|
+
const unsubscribe = effect(() => {
|
|
17
|
+
const allSettings = context.requestCapabilities(Capabilities.Settings);
|
|
18
|
+
const added = allSettings.filter((setting) => !previous.includes(setting));
|
|
19
|
+
const removed = previous.filter((setting) => !allSettings.includes(setting));
|
|
20
|
+
previous = allSettings;
|
|
21
|
+
added.forEach((setting) => {
|
|
22
|
+
settingsStore.createStore(setting as any);
|
|
23
|
+
});
|
|
24
|
+
removed.forEach((setting) => {
|
|
25
|
+
settingsStore.removeStore(setting.prefix);
|
|
26
|
+
});
|
|
17
27
|
});
|
|
18
28
|
|
|
19
|
-
return contributes(Capabilities.SettingsStore, settingsStore);
|
|
29
|
+
return contributes(Capabilities.SettingsStore, settingsStore, () => unsubscribe());
|
|
20
30
|
};
|
|
@@ -9,7 +9,14 @@ import { raise } from '@dxos/debug';
|
|
|
9
9
|
|
|
10
10
|
import { createApp, type CreateAppOptions } from '../App';
|
|
11
11
|
import { Capabilities, Events } from '../common';
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
type ActivationEvent,
|
|
14
|
+
type AnyCapability,
|
|
15
|
+
contributes,
|
|
16
|
+
defineModule,
|
|
17
|
+
definePlugin,
|
|
18
|
+
PluginManager,
|
|
19
|
+
} from '../core';
|
|
13
20
|
|
|
14
21
|
/**
|
|
15
22
|
* @internal
|
|
@@ -40,13 +47,22 @@ export const setupPluginManager = ({
|
|
|
40
47
|
return pluginManager;
|
|
41
48
|
};
|
|
42
49
|
|
|
50
|
+
export type WithPluginManagerOptions = CreateAppOptions & {
|
|
51
|
+
capabilities?: AnyCapability[];
|
|
52
|
+
fireEvents?: (ActivationEvent | string)[];
|
|
53
|
+
};
|
|
54
|
+
|
|
43
55
|
/**
|
|
44
56
|
* Wraps a story with a plugin manager.
|
|
45
57
|
*/
|
|
46
|
-
export const withPluginManager = (options:
|
|
58
|
+
export const withPluginManager = (options: WithPluginManagerOptions = {}): Decorator => {
|
|
47
59
|
const pluginManager = setupPluginManager(options);
|
|
48
60
|
const App = createApp({ pluginManager });
|
|
49
61
|
|
|
62
|
+
options.fireEvents?.forEach((event) => {
|
|
63
|
+
void pluginManager.activate(event);
|
|
64
|
+
});
|
|
65
|
+
|
|
50
66
|
return (Story, context) => {
|
|
51
67
|
useEffect(() => {
|
|
52
68
|
const capability = contributes(Capabilities.ReactRoot, {
|
package/tsconfig.json
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"extends": "../../../tsconfig.base.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"esModuleInterop": true,
|
|
5
|
-
"jsx": "react",
|
|
6
|
-
"lib": [
|
|
7
|
-
"DOM",
|
|
8
|
-
"ESNext"
|
|
9
|
-
],
|
|
10
|
-
"module": "ESNext",
|
|
11
|
-
"outDir": "./dist/types"
|
|
12
|
-
},
|
|
3
|
+
"compilerOptions": {},
|
|
13
4
|
"exclude": [
|
|
14
5
|
"/node_modules/"
|
|
15
6
|
],
|
|
@@ -1,7 +0,0 @@
|
|
|
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 { nonNullable } 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: 'fallback',\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(nonNullable)\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(nonNullable)\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": ";;;;;;;;;;;;;AAIA,SAASA,uBAAkC;AAE3C,SAASC,mBAAmB;AAO5B,IAAA,4BAAe,CAACC,YACdC,YAAYC,aAAaC,iBAAiB;EACxCC,gBAAgB;IACdC,IAAI,GAAGC,eAAAA;IACPC,QAAQ,CAACC,SAA6BA,KAAKH,OAAO;IAClDI,SAAS,MAAM;MACb;QACEJ,IAAIC;QACJI,MAAM,YAAA;AACJ,gBAAM,EAAEC,iBAAiBC,SAAQ,IAAKZ,QAAQa,kBAAkBX,aAAaY,gBAAgB;AAC7F,gBAAMF,SAASG,aAAaC,eAAeC,IAAI,CAAA;QACjD;QACAC,YAAY;UACVC,OAAO;YAAC;YAAuB;cAAEC,IAAId;YAAgB;;UAC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B;;YACtDe,MAAM;YACN2B,MAAM;UACR;QACF;;IAEJ;EACF,CAAA;EACA5C,gBAAgB;IACdC,IAAI,GAAGC,eAAAA;IACPC,QAAQ,CAACC,SAA6BA,KAAKH,OAAO,GAAGwC,YAAAA;IACrDpB,WAAW,MAAA;AACT,YAAMM,UAAU/B,QAAQa,kBAAkBX,aAAa8B,aAAa;AACpE,YAAM,CAACC,aAAAA,IAAiBjC,QAAQkC,oBAAoBhC,aAAaiC,aAAa;AAC9E,aAAOJ,QAAQK,QACZ7B,OAAO,CAAC8B,WAAW,CAACN,QAAQO,KAAKC,SAASF,OAAOG,KAAKnC,EAAE,CAAA,EACxDoC,IAAI,CAACJ,WAAAA;AACJ,cAAMK,WAAWT,eAAeU,SAASN,OAAOG,KAAKnC,EAAE;AACvD,YAAI,CAACqC,UAAU;AACb,iBAAO;QACT;AAEA,eAAO;UAACL,OAAOG;UAAME;;MACvB,CAAA,EACCnC,OAAOqC,WAAAA,EACPH,IAAI,CAAC,CAACD,MAAME,QAAAA,OAAe;QAC1BrC,IAAI,GAAGwC,YAAAA,IAAgBL,KAAKnC,GAAGyC,WAAW,KAAK,GAAA,CAAA;QAC/CnB,MAAM;QACNjB,MAAMgC;QACNxB,YAAY;UACVC,OAAOqB,KAAKO,QAAQP,KAAKnC;UACzBgB,MAAMmB,KAAKnB,QAAQ;QACrB;MACF,EAAA;IACJ;EACF,CAAA;CACD;",
|
|
6
|
-
"names": ["createExtension", "nonNullable", "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", "nonNullable", "SETTINGS_KEY", "replaceAll", "name", "role"]
|
|
7
|
-
}
|