@dxos/app-framework 0.7.5-main.e9bb01b → 0.7.5-staging.2ff1350
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-F7VZ6LRN.mjs → app-graph-builder-KHO5TBST.mjs} +7 -7
- package/dist/lib/browser/app-graph-builder-KHO5TBST.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ATRNTMSS.mjs → chunk-MMIGFX4P.mjs} +31 -8
- package/dist/lib/browser/chunk-MMIGFX4P.mjs.map +7 -0
- 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/{chunk-WS6SU6HI.mjs → chunk-WZ44ZGQR.mjs} +4 -4
- package/dist/lib/browser/chunk-WZ44ZGQR.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +7 -7
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/{intent-dispatcher-E6J7E5Y5.mjs → intent-dispatcher-62BI3CA7.mjs} +2 -2
- package/dist/lib/browser/{intent-resolver-XLE4L3LS.mjs → intent-resolver-YQHF2RUY.mjs} +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/store-UXQQMUYO.mjs +29 -0
- package/dist/lib/browser/store-UXQQMUYO.mjs.map +7 -0
- package/dist/lib/browser/testing/index.mjs +2 -2
- package/dist/lib/browser/worker.mjs +1 -1
- package/dist/lib/node/{app-graph-builder-JGBADFF7.cjs → app-graph-builder-NMDT3THZ.cjs} +31 -31
- package/dist/lib/node/app-graph-builder-NMDT3THZ.cjs.map +7 -0
- package/dist/lib/node/{chunk-WKC6YMEQ.cjs → chunk-76SSGL6Y.cjs} +34 -11
- package/dist/lib/node/chunk-76SSGL6Y.cjs.map +7 -0
- package/dist/lib/node/{chunk-WRWRZKZU.cjs → chunk-SDAQFZ47.cjs} +19 -19
- package/dist/lib/node/chunk-SDAQFZ47.cjs.map +7 -0
- 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-CFBKDZQR.cjs → intent-dispatcher-RXKIRAMX.cjs} +8 -8
- package/dist/lib/node/{intent-dispatcher-CFBKDZQR.cjs.map → intent-dispatcher-RXKIRAMX.cjs.map} +2 -2
- package/dist/lib/node/{intent-resolver-3TKCXP4S.cjs → intent-resolver-ZTTP6CHV.cjs} +12 -12
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{store-4QMUUU2A.cjs → store-L4MYKQZT.cjs} +19 -9
- package/dist/lib/node/store-L4MYKQZT.cjs.map +7 -0
- package/dist/lib/node/testing/index.cjs +8 -8
- 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-2QEX57NX.mjs → app-graph-builder-JGWPUMUJ.mjs} +7 -7
- package/dist/lib/node-esm/app-graph-builder-JGWPUMUJ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-44J2VZBB.mjs → chunk-4ATU3W7O.mjs} +31 -8
- package/dist/lib/node-esm/chunk-4ATU3W7O.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-HTLXL32I.mjs → chunk-JYLA4IO7.mjs} +4 -4
- package/dist/lib/node-esm/chunk-JYLA4IO7.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-LDQGDZ62.mjs → intent-dispatcher-EYYFA3K2.mjs} +2 -2
- package/dist/lib/node-esm/{intent-resolver-7VJWN67U.mjs → intent-resolver-MEBLJJ6V.mjs} +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/store-UYJKNT6R.mjs +30 -0
- package/dist/lib/node-esm/store-UYJKNT6R.mjs.map +7 -0
- package/dist/lib/node-esm/testing/index.mjs +2 -2
- 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 +11 -0
- package/dist/types/src/common/capabilities.d.ts.map +1 -1
- package/dist/types/src/common/events.d.ts +6 -2
- 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 +1 -2
- package/dist/types/src/playground/debug/Debug.d.ts.map +1 -1
- package/dist/types/src/playground/generator/Main.d.ts +1 -2
- package/dist/types/src/playground/generator/Main.d.ts.map +1 -1
- package/dist/types/src/playground/generator/Toolbar.d.ts +1 -2
- package/dist/types/src/playground/generator/Toolbar.d.ts.map +1 -1
- package/dist/types/src/playground/layout/Layout.d.ts +1 -1
- package/dist/types/src/playground/layout/Layout.d.ts.map +1 -1
- package/dist/types/src/playground/logger/Toolbar.d.ts +1 -2
- package/dist/types/src/playground/logger/Toolbar.d.ts.map +1 -1
- package/dist/types/src/playground/playground.stories.d.ts +1 -2
- package/dist/types/src/playground/playground.stories.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/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 +1 -2
- package/dist/types/src/react/Surface.stories.d.ts.map +1 -1
- package/dist/types/src/react/common.d.ts +1 -0
- package/dist/types/src/react/common.d.ts.map +1 -1
- package/dist/types/src/react/useCapabilities.d.ts.map +1 -1
- package/package.json +20 -18
- package/project.json +1 -0
- package/src/App.tsx +3 -2
- package/src/common/capabilities.ts +10 -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/errors.ts +1 -1
- package/src/plugin-intent/intent-dispatcher.ts +2 -2
- 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/store.ts +15 -5
- package/src/react/useCapabilities.ts +1 -0
- package/tsconfig.json +3 -1
- package/dist/lib/browser/app-graph-builder-F7VZ6LRN.mjs.map +0 -7
- package/dist/lib/browser/chunk-ATRNTMSS.mjs.map +0 -7
- package/dist/lib/browser/chunk-WS6SU6HI.mjs.map +0 -7
- package/dist/lib/browser/store-QU2IKFAI.mjs +0 -19
- package/dist/lib/browser/store-QU2IKFAI.mjs.map +0 -7
- package/dist/lib/node/app-graph-builder-JGBADFF7.cjs.map +0 -7
- package/dist/lib/node/chunk-WKC6YMEQ.cjs.map +0 -7
- package/dist/lib/node/chunk-WRWRZKZU.cjs.map +0 -7
- package/dist/lib/node/store-4QMUUU2A.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-2QEX57NX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-44J2VZBB.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HTLXL32I.mjs.map +0 -7
- package/dist/lib/node-esm/store-VWDAYUQY.mjs +0 -20
- package/dist/lib/node-esm/store-VWDAYUQY.mjs.map +0 -7
- /package/{.eslintrc.js → .eslintrc.cjs} +0 -0
- /package/dist/lib/browser/{intent-dispatcher-E6J7E5Y5.mjs.map → intent-dispatcher-62BI3CA7.mjs.map} +0 -0
- /package/dist/lib/browser/{intent-resolver-XLE4L3LS.mjs.map → intent-resolver-YQHF2RUY.mjs.map} +0 -0
- /package/dist/lib/node/{intent-resolver-3TKCXP4S.cjs.map → intent-resolver-ZTTP6CHV.cjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-dispatcher-LDQGDZ62.mjs.map → intent-dispatcher-EYYFA3K2.mjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-resolver-7VJWN67U.mjs.map → intent-resolver-MEBLJJ6V.mjs.map} +0 -0
|
@@ -6,7 +6,7 @@ export declare namespace Events {
|
|
|
6
6
|
/**
|
|
7
7
|
* Fired to load any newly available surfaces.
|
|
8
8
|
*/
|
|
9
|
-
const
|
|
9
|
+
const SetupReactSurface: import("../core").ActivationEvent;
|
|
10
10
|
/**
|
|
11
11
|
* Fired to load any newly available metadata.
|
|
12
12
|
*/
|
|
@@ -14,7 +14,7 @@ export declare namespace Events {
|
|
|
14
14
|
/**
|
|
15
15
|
* Fired before the intent dispatcher is activated.
|
|
16
16
|
*/
|
|
17
|
-
const
|
|
17
|
+
const SetupIntentResolver: import("../core").ActivationEvent;
|
|
18
18
|
/**
|
|
19
19
|
* Fired before the settings store is activated.
|
|
20
20
|
*/
|
|
@@ -27,6 +27,10 @@ export declare namespace Events {
|
|
|
27
27
|
* Fired before the translations provider is created.
|
|
28
28
|
*/
|
|
29
29
|
const SetupTranslations: import("../core").ActivationEvent;
|
|
30
|
+
/**
|
|
31
|
+
* Fired to load any newly available artifacts definitions.
|
|
32
|
+
*/
|
|
33
|
+
const SetupArtifactDefinition: import("../core").ActivationEvent;
|
|
30
34
|
/**
|
|
31
35
|
* Fired after the intent dispatcher is ready.
|
|
32
36
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../src/common/events.ts"],"names":[],"mappings":"AAOA,yBAAiB,MAAM,CAAC;IACtB;;OAEG;IACI,MAAM,OAAO,mCAAsD,CAAC;IAM3E;;OAEG;IACI,MAAM,
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../src/common/events.ts"],"names":[],"mappings":"AAOA,yBAAiB,MAAM,CAAC;IACtB;;OAEG;IACI,MAAM,OAAO,mCAAsD,CAAC;IAM3E;;OAEG;IACI,MAAM,iBAAiB,mCAAkE,CAAC;IAEjG;;OAEG;IACI,MAAM,aAAa,mCAA6D,CAAC;IAExF;;OAEG;IACI,MAAM,mBAAmB,mCAAoE,CAAC;IAErG;;OAEG;IACI,MAAM,aAAa,mCAA6D,CAAC;IAExF;;OAEG;IACI,MAAM,aAAa,mCAA0D,CAAC;IAErF;;OAEG;IACI,MAAM,iBAAiB,mCAAiE,CAAC;IAEhG;;OAEG;IACI,MAAM,uBAAuB,mCAAwE,CAAC;IAM7G;;OAEG;IACI,MAAM,eAAe,mCAA+D,CAAC;IAE5F;;OAEG;IACI,MAAM,aAAa,mCAA6D,CAAC;IAExF;;OAEG;IACI,MAAM,aAAa,mCAA0D,CAAC;IAErF;;OAEG;IACI,MAAM,gBAAgB,cAAe,MAAM,sCAAiE,CAAC;IAC7G,MAAM,WAAW,mCAAmD,CAAC;CAC7E"}
|
|
@@ -73,7 +73,7 @@ export declare namespace LayoutAction {
|
|
|
73
73
|
subject: S.optional<S.SchemaClass<string, string, never>>;
|
|
74
74
|
options: S.Struct<{
|
|
75
75
|
state: S.optional<S.SchemaClass<boolean, boolean, never>>;
|
|
76
|
-
blockAlign: S.optional<S.Literal<["start", "center"]>>;
|
|
76
|
+
blockAlign: S.optional<S.Literal<["start", "center", "end"]>>;
|
|
77
77
|
type: S.optional<S.Literal<["default", "alert"]>>;
|
|
78
78
|
props: S.optional<S.Record$<typeof S.String, typeof S.Any>>;
|
|
79
79
|
}>;
|
|
@@ -90,6 +90,7 @@ export declare namespace LayoutAction {
|
|
|
90
90
|
subject: S.optional<S.SchemaClass<string, string, never>>;
|
|
91
91
|
options: S.Struct<{
|
|
92
92
|
anchorId: S.SchemaClass<string, string, never>;
|
|
93
|
+
side: S.optional<S.Literal<["top", "right", "bottom", "left"]>>;
|
|
93
94
|
state: S.optional<S.SchemaClass<boolean, boolean, never>>;
|
|
94
95
|
props: S.optional<S.Record$<typeof S.String, typeof S.Any>>;
|
|
95
96
|
}>;
|
|
@@ -174,6 +175,19 @@ export declare namespace LayoutAction {
|
|
|
174
175
|
}>;
|
|
175
176
|
export class SwitchWorkspace extends SwitchWorkspace_base {
|
|
176
177
|
}
|
|
178
|
+
const RevertWorkspace_base: S.TaggedClass<RevertWorkspace, "dxos.org/plugin/layout/action/update-layout", {
|
|
179
|
+
readonly _tag: S.tag<"dxos.org/plugin/layout/action/update-layout">;
|
|
180
|
+
} & {
|
|
181
|
+
input: S.Struct<{
|
|
182
|
+
part: S.Literal<["workspace"]>;
|
|
183
|
+
options: S.Struct<{
|
|
184
|
+
revert: S.Literal<[true]>;
|
|
185
|
+
}>;
|
|
186
|
+
}>;
|
|
187
|
+
output: typeof S.Void;
|
|
188
|
+
}>;
|
|
189
|
+
export class RevertWorkspace extends RevertWorkspace_base {
|
|
190
|
+
}
|
|
177
191
|
const Open_base: S.TaggedClass<Open, "dxos.org/plugin/layout/action/update-layout", {
|
|
178
192
|
readonly _tag: S.tag<"dxos.org/plugin/layout/action/update-layout">;
|
|
179
193
|
} & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../src/common/layout.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,gBAAgB,CAAC;AAI7C,eAAO,MAAM,aAAa,2BAA2B,CAAC;AACtD,eAAO,MAAM,aAAa,kCAA4B,CAAC;AAEvD;;GAEG;AACH,yBAAiB,YAAY,CAAC;IAC5B,MAAM,CAAC,MAAM,aAAa,gDAAmC,CAAC;;;;;;;;;;;IAE9D;;OAEG;IACH,MAAM,OAAO,YAAa,SAAQ,iBAWhC;KAAG;;;;;;;;;;;;;;;IAYL,MAAM,OAAO,aAAc,SAAQ,kBAUjC;KAAG;;;;;;;;;;;;;IAEL,MAAM,OAAO,aAAc,SAAQ,kBAajC;KAAG;;;;;;;;;;;;;IAEL,MAAM,OAAO,mBAAoB,SAAQ,wBAevC;KAAG;;;;;;;;;;;;;;;;IAEL,MAAM,OAAO,YAAa,SAAQ,iBAkBhC;KAAG
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../src/common/layout.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,gBAAgB,CAAC;AAI7C,eAAO,MAAM,aAAa,2BAA2B,CAAC;AACtD,eAAO,MAAM,aAAa,kCAA4B,CAAC;AAEvD;;GAEG;AACH,yBAAiB,YAAY,CAAC;IAC5B,MAAM,CAAC,MAAM,aAAa,gDAAmC,CAAC;;;;;;;;;;;IAE9D;;OAEG;IACH,MAAM,OAAO,YAAa,SAAQ,iBAWhC;KAAG;;;;;;;;;;;;;;;IAYL,MAAM,OAAO,aAAc,SAAQ,kBAUjC;KAAG;;;;;;;;;;;;;IAEL,MAAM,OAAO,aAAc,SAAQ,kBAajC;KAAG;;;;;;;;;;;;;IAEL,MAAM,OAAO,mBAAoB,SAAQ,wBAevC;KAAG;;;;;;;;;;;;;;;;IAEL,MAAM,OAAO,YAAa,SAAQ,iBAkBhC;KAAG;;;;;;;;;;;;;;;;IAEL,MAAM,OAAO,aAAc,SAAQ,kBAkBjC;KAAG;IAEL,MAAM,CAAC,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;MAYhB,CAAC;IAEH,MAAM,WAAW,KAAM,SAAQ,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,KAAK,CAAC,EAAE,UAAU,CAAC;QAC1E,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;KACvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAED,MAAM,OAAO,QAAS,SAAQ,aAM5B;KAAG;;;;;;;;;;IAEL,MAAM,OAAO,eAAgB,SAAQ,oBAMnC;KAAG;;;;;;;;;;;;IAEL,MAAM,OAAO,eAAgB,SAAQ,oBAQnC;KAAG;;;;;;;;;;;;;;;;;IAEL,MAAM,OAAO,IAAK,SAAQ,SAsBxB;KAAG;;;;;;;;;;;;;IAEL,MAAM,OAAO,GAAI,SAAQ,QASvB;KAAG;;;;;;;;;;;;;IAEL,MAAM,OAAO,KAAM,SAAQ,UASzB;KAAG;;;;;;;;;;;IAEL,MAAM,OAAO,cAAe,SAAQ,mBAWlC;KAAG;;;;;;;;;;IAEL,MAAM,OAAO,MAAO,SAAQ,WAM1B;KAAG;;CACN"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { Capabilities } from '../../common';
|
|
3
|
-
export declare const Debug: () =>
|
|
2
|
+
export declare const Debug: () => import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
declare const _default: () => import("../../core").Capability<Capabilities.ReactSurface>;
|
|
5
4
|
export default _default;
|
|
6
5
|
//# sourceMappingURL=Debug.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Debug.d.ts","sourceRoot":"","sources":["../../../../../src/playground/debug/Debug.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Debug.d.ts","sourceRoot":"","sources":["../../../../../src/playground/debug/Debug.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAiB,MAAM,cAAc,CAAC;AAI3D,eAAO,MAAM,KAAK,+CAgBjB,CAAC;;AAEF,wBAQI"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { Capabilities } from '../../common';
|
|
3
|
-
export declare const Main: () =>
|
|
2
|
+
export declare const Main: () => import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
declare const _default: () => import("../../core").Capability<Capabilities.ReactSurface>;
|
|
5
4
|
export default _default;
|
|
6
5
|
//# sourceMappingURL=Main.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Main.d.ts","sourceRoot":"","sources":["../../../../../src/playground/generator/Main.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Main.d.ts","sourceRoot":"","sources":["../../../../../src/playground/generator/Main.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAiC5C,eAAO,MAAM,IAAI,+CAsBhB,CAAC;;AAEF,wBAKK"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { Capabilities } from '../../common';
|
|
3
|
-
export declare const Toolbar: () =>
|
|
2
|
+
export declare const Toolbar: () => import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
declare const _default: () => import("../../core").Capability<Capabilities.ReactSurface>;
|
|
5
4
|
export default _default;
|
|
6
5
|
//# sourceMappingURL=Toolbar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../../../src/playground/generator/Toolbar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../../../src/playground/generator/Toolbar.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAK5C,eAAO,MAAM,OAAO,+CAwBnB,CAAC;;AAEF,wBAKK"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const Layout: () =>
|
|
2
|
+
export declare const Layout: () => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
declare const _default: () => import("../../core").Capability<Readonly<{
|
|
4
4
|
id: string;
|
|
5
5
|
root: React.FC<React.PropsWithChildren>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../../../../src/playground/layout/Layout.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../../../../src/playground/layout/Layout.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,eAAO,MAAM,MAAM,+CAgBlB,CAAC;;;;;AAEF,wBAIK"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { Capabilities } from '../../common';
|
|
3
|
-
export declare const Logger: () =>
|
|
2
|
+
export declare const Logger: () => import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
declare const _default: () => import("../../core").Capability<Capabilities.ReactSurface>;
|
|
5
4
|
export default _default;
|
|
6
5
|
//# sourceMappingURL=Toolbar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../../../src/playground/logger/Toolbar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../../../src/playground/logger/Toolbar.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAiB,MAAM,cAAc,CAAC;AAK3D,eAAO,MAAM,MAAM,+CAIlB,CAAC;;AAEF,wBAQI"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import '@dxos-theme';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
export declare const Playground: {};
|
|
4
3
|
declare const _default: {
|
|
5
4
|
title: string;
|
|
6
|
-
render: () =>
|
|
5
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
decorators: import("@storybook/react/*").Decorator[];
|
|
8
7
|
};
|
|
9
8
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playground.stories.d.ts","sourceRoot":"","sources":["../../../../src/playground/playground.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"playground.stories.d.ts","sourceRoot":"","sources":["../../../../src/playground/playground.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAuBrB,eAAO,MAAM,UAAU,IAAK,CAAC;;;;;;AAE7B,wBAIE"}
|
|
@@ -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 +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,11 +1,10 @@
|
|
|
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
|
-
}) =>
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
8
|
decorators: import("@storybook/react/*").Decorator[];
|
|
10
9
|
args: {
|
|
11
10
|
manager: PluginManager;
|
|
@@ -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 +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,yGAA6C,CAAC;AAEtE,eAAO,MAAM,SAAS
|
|
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,yGAA6C,CAAC;AAEtE,eAAO,MAAM,SAAS;;;;;;;;;EAA2C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCapabilities.d.ts","sourceRoot":"","sources":["../../../../src/react/useCapabilities.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,EAAE,CAAC,SAAS,CAAC,oBAC9B,YAAY,CAAC,CAAC,CAAC,WACpB,CAAC,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,KAAK,UAAU,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"useCapabilities.d.ts","sourceRoot":"","sources":["../../../../src/react/useCapabilities.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,EAAE,CAAC,SAAS,CAAC,oBAC9B,YAAY,CAAC,CAAC,CAAC,WACpB,CAAC,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,KAAK,UAAU,IAAI,CAAC,QAS9D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,EAAE,CAAC,SAAS,CAAC,oBAC5B,YAAY,CAAC,CAAC,CAAC,WACpB,CAAC,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,KAAK,UAAU,IAAI,CAAC,MAK9D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/app-framework",
|
|
3
|
-
"version": "0.7.5-
|
|
3
|
+
"version": "0.7.5-staging.2ff1350",
|
|
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",
|
|
@@ -38,28 +39,29 @@
|
|
|
38
39
|
"dependencies": {
|
|
39
40
|
"@effect/schema": "^0.75.5",
|
|
40
41
|
"@preact/signals-core": "^1.6.0",
|
|
41
|
-
"effect": "^3.12.
|
|
42
|
-
"@dxos/app-graph": "0.7.5-
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/util": "0.7.5-
|
|
42
|
+
"effect": "^3.12.3",
|
|
43
|
+
"@dxos/app-graph": "0.7.5-staging.2ff1350",
|
|
44
|
+
"@dxos/artifact": "0.7.5-staging.2ff1350",
|
|
45
|
+
"@dxos/async": "0.7.5-staging.2ff1350",
|
|
46
|
+
"@dxos/debug": "0.7.5-staging.2ff1350",
|
|
47
|
+
"@dxos/client-protocol": "0.7.5-staging.2ff1350",
|
|
48
|
+
"@dxos/invariant": "0.7.5-staging.2ff1350",
|
|
49
|
+
"@dxos/live-object": "0.7.5-staging.2ff1350",
|
|
50
|
+
"@dxos/local-storage": "0.7.5-staging.2ff1350",
|
|
51
|
+
"@dxos/log": "0.7.5-staging.2ff1350",
|
|
52
|
+
"@dxos/util": "0.7.5-staging.2ff1350",
|
|
53
|
+
"@dxos/react-hooks": "0.7.5-staging.2ff1350"
|
|
52
54
|
},
|
|
53
55
|
"devDependencies": {
|
|
54
56
|
"@phosphor-icons/react": "^2.1.5",
|
|
55
57
|
"@types/react": "~18.2.0",
|
|
56
58
|
"react": "~18.2.0",
|
|
57
|
-
"@dxos/echo-
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/react-ui": "0.7.5-
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/storybook-utils": "0.7.5-
|
|
59
|
+
"@dxos/echo-schema": "0.7.5-staging.2ff1350",
|
|
60
|
+
"@dxos/echo-signals": "0.7.5-staging.2ff1350",
|
|
61
|
+
"@dxos/react-ui-syntax-highlighter": "0.7.5-staging.2ff1350",
|
|
62
|
+
"@dxos/react-ui": "0.7.5-staging.2ff1350",
|
|
63
|
+
"@dxos/random": "0.7.5-staging.2ff1350",
|
|
64
|
+
"@dxos/storybook-utils": "0.7.5-staging.2ff1350"
|
|
63
65
|
},
|
|
64
66
|
"peerDependencies": {
|
|
65
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 () => (
|
|
@@ -6,6 +6,7 @@ import { type Schema as S } from '@effect/schema';
|
|
|
6
6
|
import { type FC, type PropsWithChildren } from 'react';
|
|
7
7
|
|
|
8
8
|
import { type GraphBuilder } from '@dxos/app-graph';
|
|
9
|
+
import { type ArtifactDefinition, type Tool } from '@dxos/artifact';
|
|
9
10
|
import { type Space } from '@dxos/client-protocol';
|
|
10
11
|
import { type RootSettingsStore } from '@dxos/local-storage';
|
|
11
12
|
|
|
@@ -42,6 +43,10 @@ export namespace Capabilities {
|
|
|
42
43
|
dialogOpen: boolean;
|
|
43
44
|
sidebarOpen: boolean;
|
|
44
45
|
complementarySidebarOpen: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* The id of the active workspace, where a workspace is a set of active items.
|
|
48
|
+
*/
|
|
49
|
+
workspace: string;
|
|
45
50
|
/**
|
|
46
51
|
* Identifiers of items which are currently active in the application.
|
|
47
52
|
*/
|
|
@@ -86,6 +91,11 @@ export namespace Capabilities {
|
|
|
86
91
|
export type Metadata = Readonly<{ id: string; metadata: Record<string, any> }>;
|
|
87
92
|
export const Metadata = defineCapability<Metadata>('dxos.org/app-framework/capability/metadata');
|
|
88
93
|
|
|
94
|
+
export const Tools = defineCapability<Tool[]>('dxos.org/app-framework/capability/tools');
|
|
95
|
+
export const ArtifactDefinition = defineCapability<ArtifactDefinition>(
|
|
96
|
+
'dxos.org/app-framework/capability/artifact-definition',
|
|
97
|
+
);
|
|
98
|
+
|
|
89
99
|
export type FileUploader = (file: File, space: Space) => Promise<FileInfo | undefined>;
|
|
90
100
|
export const FileUploader = defineCapability<FileUploader>('dxos.org/app-framework/capability/file-uploader');
|
|
91
101
|
}
|
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
|
@@ -92,7 +92,7 @@ export namespace LayoutAction {
|
|
|
92
92
|
options: S.Struct({
|
|
93
93
|
state: S.optional(S.Boolean.annotations({ description: 'Whether the dialog is open or closed.' })),
|
|
94
94
|
blockAlign: S.optional(
|
|
95
|
-
S.Literal('start', 'center').annotations({ description: 'The alignment of the dialog.' }),
|
|
95
|
+
S.Literal('start', 'center', 'end').annotations({ description: 'The alignment of the dialog.' }),
|
|
96
96
|
),
|
|
97
97
|
type: S.optional(S.Literal('default', 'alert').annotations({ description: 'The type of dialog.' })),
|
|
98
98
|
props: S.optional(
|
|
@@ -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,
|
|
@@ -15,7 +15,7 @@ export class BaseError extends Error {
|
|
|
15
15
|
readonly context?: Record<string, any>,
|
|
16
16
|
) {
|
|
17
17
|
// TODO(dmaretskyi): Error.cause.
|
|
18
|
-
super(message ?? code);
|
|
18
|
+
super(message ?? code, { cause: context });
|
|
19
19
|
this.name = code;
|
|
20
20
|
// NOTE: Restores prototype chain (https://stackoverflow.com/a/48342359).
|
|
21
21
|
Object.setPrototypeOf(this, new.target.prototype);
|
|
@@ -289,12 +289,12 @@ export default (context: PluginsContext) => {
|
|
|
289
289
|
const manager = context.requestCapability(Capabilities.PluginManager);
|
|
290
290
|
state.dispatch = (intentChain, depth) => {
|
|
291
291
|
return Effect.gen(function* () {
|
|
292
|
-
yield* manager._activate(Events.
|
|
292
|
+
yield* manager._activate(Events.SetupIntentResolver);
|
|
293
293
|
return yield* dispatch(intentChain, depth);
|
|
294
294
|
});
|
|
295
295
|
};
|
|
296
296
|
state.dispatchPromise = async (intentChain) => {
|
|
297
|
-
await manager.activate(Events.
|
|
297
|
+
await manager.activate(Events.SetupIntentResolver);
|
|
298
298
|
return await dispatchPromise(intentChain);
|
|
299
299
|
};
|
|
300
300
|
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',
|
|
@@ -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
|
};
|
package/tsconfig.json
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
"extends": "../../../tsconfig.base.json",
|
|
3
3
|
"compilerOptions": {
|
|
4
4
|
"esModuleInterop": true,
|
|
5
|
-
"jsx": "react",
|
|
6
5
|
"lib": [
|
|
7
6
|
"DOM",
|
|
8
7
|
"ESNext"
|
|
@@ -50,6 +49,9 @@
|
|
|
50
49
|
{
|
|
51
50
|
"path": "../../core/echo/live-object"
|
|
52
51
|
},
|
|
52
|
+
{
|
|
53
|
+
"path": "../../experimental/artifact"
|
|
54
|
+
},
|
|
53
55
|
{
|
|
54
56
|
"path": "../../ui/primitives/react-hooks"
|
|
55
57
|
},
|