@dxos/app-framework 0.8.1-main.ae460ac → 0.8.1-staging.31c3ee1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{app-graph-builder-IAEV7KKF.mjs → app-graph-builder-576BHZC7.mjs} +3 -3
- package/dist/lib/browser/{chunk-PWAAJE2Z.mjs → chunk-6AVTZPMT.mjs} +65 -45
- package/dist/lib/browser/chunk-6AVTZPMT.mjs.map +7 -0
- package/dist/lib/browser/{chunk-CIP4C47B.mjs → chunk-PPIBZ5N4.mjs} +55 -11
- package/dist/lib/browser/chunk-PPIBZ5N4.mjs.map +7 -0
- package/dist/lib/browser/{chunk-CB3W6T5E.mjs → chunk-SFPT4Z2C.mjs} +1 -1
- package/dist/lib/browser/{chunk-CB3W6T5E.mjs.map → chunk-SFPT4Z2C.mjs.map} +2 -2
- package/dist/lib/browser/index.mjs +8 -7
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-dispatcher-UR566RVO.mjs → intent-dispatcher-3Q67MHZZ.mjs} +2 -2
- package/dist/lib/browser/{intent-resolver-LEJ3X6CP.mjs → intent-resolver-O763LCLG.mjs} +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{store-5TN4OLFQ.mjs → store-URSN7DZI.mjs} +2 -2
- package/dist/lib/browser/testing/index.mjs +4 -3
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/browser/worker.mjs +1 -1
- package/dist/lib/node/{app-graph-builder-3RWOZENP.cjs → app-graph-builder-JZCSKYPY.cjs} +28 -28
- package/dist/lib/node/{chunk-SCHC4AZQ.cjs → chunk-JUSEAFDU.cjs} +4 -4
- package/dist/lib/node/{chunk-SCHC4AZQ.cjs.map → chunk-JUSEAFDU.cjs.map} +2 -2
- package/dist/lib/node/{chunk-XP4TI5DS.cjs → chunk-YIFTVCOR.cjs} +191 -171
- package/dist/lib/node/chunk-YIFTVCOR.cjs.map +7 -0
- package/dist/lib/node/{chunk-JLQABYHB.cjs → chunk-YNTKVTVX.cjs} +70 -26
- package/dist/lib/node/chunk-YNTKVTVX.cjs.map +7 -0
- package/dist/lib/node/index.cjs +79 -78
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-dispatcher-EDW7NFJ4.cjs → intent-dispatcher-H334XLFD.cjs} +8 -8
- package/dist/lib/node/{intent-dispatcher-EDW7NFJ4.cjs.map → intent-dispatcher-H334XLFD.cjs.map} +2 -2
- package/dist/lib/node/{intent-resolver-34J5IM27.cjs → intent-resolver-3F4POWAM.cjs} +12 -12
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{store-3I3UFH5D.cjs → store-OFDHTDCB.cjs} +7 -7
- package/dist/lib/node/testing/index.cjs +10 -9
- package/dist/lib/node/testing/index.cjs.map +3 -3
- package/dist/lib/node/worker.cjs +37 -37
- package/dist/lib/node/worker.cjs.map +1 -1
- package/dist/lib/node-esm/{app-graph-builder-RG3DT2OD.mjs → app-graph-builder-VYKLSMSZ.mjs} +3 -3
- package/dist/lib/node-esm/{chunk-NIVSBD3D.mjs → chunk-AHKIPS2L.mjs} +65 -45
- package/dist/lib/node-esm/chunk-AHKIPS2L.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-BSYAFUZ7.mjs → chunk-PHOUQACM.mjs} +1 -1
- package/dist/lib/node-esm/{chunk-BSYAFUZ7.mjs.map → chunk-PHOUQACM.mjs.map} +2 -2
- package/dist/lib/node-esm/{chunk-T2URISUU.mjs → chunk-R6A7Z4LU.mjs} +55 -11
- package/dist/lib/node-esm/chunk-R6A7Z4LU.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +8 -7
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-dispatcher-7GCMKMSQ.mjs → intent-dispatcher-YDE2ONZA.mjs} +2 -2
- package/dist/lib/node-esm/{intent-resolver-7T6UOQOS.mjs → intent-resolver-LAGJ7LXM.mjs} +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{store-PTKVELJP.mjs → store-EYSUVNCS.mjs} +2 -2
- package/dist/lib/node-esm/testing/index.mjs +4 -3
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/lib/node-esm/worker.mjs +1 -1
- package/dist/types/src/App.d.ts +5 -3
- package/dist/types/src/App.d.ts.map +1 -1
- package/dist/types/src/common/layout.d.ts +21 -20
- package/dist/types/src/common/layout.d.ts.map +1 -1
- package/dist/types/src/common/surface.d.ts +4 -7
- package/dist/types/src/common/surface.d.ts.map +1 -1
- package/dist/types/src/core/capabilities.d.ts +5 -3
- package/dist/types/src/core/capabilities.d.ts.map +1 -1
- package/dist/types/src/core/plugin.d.ts +1 -1
- package/dist/types/src/core/plugin.d.ts.map +1 -1
- package/dist/types/src/playground/debug/Debug.d.ts +2 -1
- package/dist/types/src/playground/debug/Debug.d.ts.map +1 -1
- package/dist/types/src/playground/generator/Main.d.ts +2 -1
- package/dist/types/src/playground/generator/Main.d.ts.map +1 -1
- package/dist/types/src/playground/generator/Toolbar.d.ts +2 -1
- 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 +2 -1
- package/dist/types/src/playground/logger/Toolbar.d.ts.map +1 -1
- package/dist/types/src/playground/playground.stories.d.ts +2 -1
- package/dist/types/src/playground/playground.stories.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/actions.d.ts +16 -2
- package/dist/types/src/plugin-intent/actions.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-intent/intent.d.ts +2 -2
- package/dist/types/src/plugin-intent/intent.d.ts.map +1 -1
- package/dist/types/src/plugin-settings/actions.d.ts.map +1 -1
- package/dist/types/src/react/ErrorBoundary.d.ts +1 -1
- package/dist/types/src/react/Surface.d.ts.map +1 -1
- package/dist/types/src/react/Surface.stories.d.ts +2 -1
- package/dist/types/src/react/Surface.stories.d.ts.map +1 -1
- package/package.json +20 -19
- package/src/App.tsx +65 -8
- package/src/common/layout.ts +1 -0
- package/src/common/surface.ts +6 -1
- package/src/core/capabilities.test.ts +3 -2
- package/src/core/capabilities.ts +11 -3
- package/src/core/manager.test.ts +30 -30
- package/src/core/manager.ts +2 -2
- package/src/core/plugin.ts +1 -1
- package/src/playground/debug/plugin.ts +1 -1
- package/src/playground/generator/generator.ts +1 -1
- package/src/playground/generator/plugin.ts +1 -1
- package/src/playground/layout/plugin.ts +1 -1
- package/src/playground/logger/plugin.ts +1 -1
- package/src/playground/playground.stories.tsx +5 -1
- package/src/plugin-intent/IntentPlugin.tsx +1 -1
- package/src/plugin-intent/actions.ts +11 -0
- package/src/plugin-intent/intent-dispatcher.ts +18 -5
- package/src/plugin-settings/SettingsPlugin.ts +1 -1
- package/src/plugin-settings/actions.ts +2 -0
- package/src/react/Surface.tsx +5 -3
- package/src/testing/withPluginManager.stories.tsx +2 -2
- package/src/testing/withPluginManager.tsx +1 -1
- package/dist/lib/browser/chunk-CIP4C47B.mjs.map +0 -7
- package/dist/lib/browser/chunk-PWAAJE2Z.mjs.map +0 -7
- package/dist/lib/node/chunk-JLQABYHB.cjs.map +0 -7
- package/dist/lib/node/chunk-XP4TI5DS.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-NIVSBD3D.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-T2URISUU.mjs.map +0 -7
- /package/dist/lib/browser/{app-graph-builder-IAEV7KKF.mjs.map → app-graph-builder-576BHZC7.mjs.map} +0 -0
- /package/dist/lib/browser/{intent-dispatcher-UR566RVO.mjs.map → intent-dispatcher-3Q67MHZZ.mjs.map} +0 -0
- /package/dist/lib/browser/{intent-resolver-LEJ3X6CP.mjs.map → intent-resolver-O763LCLG.mjs.map} +0 -0
- /package/dist/lib/browser/{store-5TN4OLFQ.mjs.map → store-URSN7DZI.mjs.map} +0 -0
- /package/dist/lib/node/{app-graph-builder-3RWOZENP.cjs.map → app-graph-builder-JZCSKYPY.cjs.map} +0 -0
- /package/dist/lib/node/{intent-resolver-34J5IM27.cjs.map → intent-resolver-3F4POWAM.cjs.map} +0 -0
- /package/dist/lib/node/{store-3I3UFH5D.cjs.map → store-OFDHTDCB.cjs.map} +0 -0
- /package/dist/lib/node-esm/{app-graph-builder-RG3DT2OD.mjs.map → app-graph-builder-VYKLSMSZ.mjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-dispatcher-7GCMKMSQ.mjs.map → intent-dispatcher-YDE2ONZA.mjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-resolver-7T6UOQOS.mjs.map → intent-resolver-LAGJ7LXM.mjs.map} +0 -0
- /package/dist/lib/node-esm/{store-PTKVELJP.mjs.map → store-EYSUVNCS.mjs.map} +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { Capabilities } from '../../common';
|
|
2
|
-
export declare const Logger: () =>
|
|
3
|
+
export declare const Logger: () => React.JSX.Element;
|
|
3
4
|
declare const _default: () => import("../..").Capability<Capabilities.ReactSurface>;
|
|
4
5
|
export default _default;
|
|
5
6
|
//# 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":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAK3C,OAAO,EAAE,YAAY,EAAiB,MAAM,cAAc,CAAC;AAK3D,eAAO,MAAM,MAAM,yBAIlB,CAAC;;AAEF,wBAQI"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import '@dxos-theme';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
export declare const Playground: {};
|
|
3
4
|
declare const _default: {
|
|
4
5
|
title: string;
|
|
5
|
-
render: () =>
|
|
6
|
+
render: () => React.JSX.Element;
|
|
6
7
|
decorators: import("@storybook/react").Decorator[];
|
|
7
8
|
};
|
|
8
9
|
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;AAErB,OAAO,KAAK,MAAM,OAAO,CAAC;AAyB1B,eAAO,MAAM,UAAU,IAAK,CAAC;;;;;;AAE7B,wBAIE"}
|
|
@@ -2,14 +2,28 @@ import { Schema as S } from 'effect';
|
|
|
2
2
|
export declare const INTENT_PLUGIN = "dxos.org/plugin/intent";
|
|
3
3
|
export declare const INTENT_ACTION = "dxos.org/plugin/intent/action";
|
|
4
4
|
export declare namespace IntentAction {
|
|
5
|
+
const Track_base: S.TaggedClass<Track, "dxos.org/plugin/intent/action/track", {
|
|
6
|
+
readonly _tag: S.tag<"dxos.org/plugin/intent/action/track">;
|
|
7
|
+
} & {
|
|
8
|
+
input: S.Struct<{
|
|
9
|
+
intents: S.Array$<typeof S.String>;
|
|
10
|
+
error: S.optional<typeof S.String>;
|
|
11
|
+
}>;
|
|
12
|
+
output: typeof S.Void;
|
|
13
|
+
}>;
|
|
14
|
+
/**
|
|
15
|
+
* Log an intent.
|
|
16
|
+
*/
|
|
17
|
+
export class Track extends Track_base {
|
|
18
|
+
}
|
|
5
19
|
const ShowUndo_base: S.TaggedClass<ShowUndo, "dxos.org/plugin/intent/action/show-undo", {
|
|
6
20
|
readonly _tag: S.tag<"dxos.org/plugin/intent/action/show-undo">;
|
|
7
21
|
} & {
|
|
8
22
|
input: S.Struct<{
|
|
9
|
-
message: S.Union<[typeof S.String, S.mutable<S.
|
|
23
|
+
message: S.Union<[typeof S.String, S.mutable<S.Tuple2<typeof S.String, S.mutable<S.Struct<{
|
|
10
24
|
ns: typeof S.String;
|
|
11
25
|
count: S.optional<typeof S.Number>;
|
|
12
|
-
}
|
|
26
|
+
}>>>>]>;
|
|
13
27
|
}>;
|
|
14
28
|
output: typeof S.Void;
|
|
15
29
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../../src/plugin-intent/actions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAC;AAIrC,eAAO,MAAM,aAAa,2BAA2B,CAAC;AACtD,eAAO,MAAM,aAAa,kCAA4B,CAAC;AAEvD,yBAAiB,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../../src/plugin-intent/actions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAC;AAIrC,eAAO,MAAM,aAAa,2BAA2B,CAAC;AACtD,eAAO,MAAM,aAAa,kCAA4B,CAAC;AAEvD,yBAAiB,YAAY,CAAC;;;;;;;;;;IAC5B;;OAEG;IACH,MAAM,OAAO,KAAM,SAAQ,UAMzB;KAAG;;;;;;;;;;;;IAEL;;OAEG;IACH,MAAM,OAAO,QAAS,SAAQ,aAK5B;KAAG;;CACN"}
|
|
@@ -47,7 +47,7 @@ export type IntentDispatcherResult<Input, Output> = Pick<IntentEffectResult<Inpu
|
|
|
47
47
|
/**
|
|
48
48
|
* The implementation of an intent effect.
|
|
49
49
|
*/
|
|
50
|
-
export type IntentEffectDefinition<Input, Output> = (data: Input, undo: boolean) => MaybePromise<IntentEffectResult<Input, Output> | void> | Effect.Effect<IntentEffectResult<Input, Output> | void>;
|
|
50
|
+
export type IntentEffectDefinition<Input, Output> = (data: Input, undo: boolean) => MaybePromise<IntentEffectResult<Input, Output> | void> | Effect.Effect<IntentEffectResult<Input, Output> | void, Error>;
|
|
51
51
|
/**
|
|
52
52
|
* Intent resolver to match intents to their effects.
|
|
53
53
|
*/
|
|
@@ -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;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,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,QAAQ,CAAC,EAAE;QACT;;WAEG;QACH,OAAO,EAAE,KAAK,CAAC;QAEf;;WAEG;QACH,IAAI,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;KACvB,CAAC;IAEF;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IAEd;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,EAAE,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,kBAAkB,CAAC,GAAG,EAAE,GAAG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AAC;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,aA+GF,CAAC;kCAKuB,cAAc;AAAvC,wBAgCE"}
|
|
@@ -60,9 +60,9 @@ export declare const createIntent: <Tag extends string, Fields extends IntentPar
|
|
|
60
60
|
* NOTE: Chaining of intents depends on the data inputs and outputs being structs.
|
|
61
61
|
*/
|
|
62
62
|
export declare const chain: <FirstTag extends string, NextTag extends string, FirstFields extends IntentParams, LastFields extends IntentParams, NextFields extends IntentParams>(schema: IntentSchema<NextTag, NextFields>, data?: Omit<IntentData<NextFields>, keyof IntentResultData<LastFields>>, params?: Pick<AnyIntent, "module" | "undo">) => (intent: IntentChain<FirstTag, any, FirstFields, LastFields>) => IntentChain<FirstTag, NextTag, FirstFields, NextFields>;
|
|
63
|
-
export declare const Label: S.Union<[typeof S.String, S.mutable<S.
|
|
63
|
+
export declare const Label: S.Union<[typeof S.String, S.mutable<S.Tuple2<typeof S.String, S.mutable<S.Struct<{
|
|
64
64
|
ns: typeof S.String;
|
|
65
65
|
count: S.optional<typeof S.Number>;
|
|
66
|
-
}
|
|
66
|
+
}>>>>]>;
|
|
67
67
|
export type Label = S.Schema.Type<typeof Label>;
|
|
68
68
|
//# sourceMappingURL=intent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intent.d.ts","sourceRoot":"","sources":["../../../../src/plugin-intent/intent.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAC;AAErC,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,KA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/B,UAAU,SAAS,YAAY,UAEvB,YAAY,CAAC,OAAO,EAAE,UAAU,CAAC,SACnC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,MAAM,gBAAgB,CAAC,UAAU,CAAC,CAAC,WAC9D,IAAI,CAAC,SAAS,EAAE,QAAQ,GAAG,MAAM,CAAC,cAGlC,WAAW,CAAC,QAAQ,EAAE,GAAG,EAAE,WAAW,EAAE,UAAU,CAAC,KAC1D,WAAW,CAAC,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,CAexD,CAAC;AAQJ,eAAO,MAAM,KAAK;;;OAGjB,CAAC;AACF,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,KAAK,CAAC,CAAC"}
|
|
@@ -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,QAAQ,CAAC;AAErC,eAAO,MAAM,eAAe,6BAA6B,CAAC;AAC1D,eAAO,MAAM,eAAe,oCAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../../src/plugin-settings/actions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAC;AAErC,eAAO,MAAM,eAAe,6BAA6B,CAAC;AAC1D,eAAO,MAAM,eAAe,oCAA8B,CAAC;AAG3D,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"}
|
|
@@ -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> | React.JSX.Element | null | undefined;
|
|
28
28
|
private resetError;
|
|
29
29
|
}
|
|
30
30
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Surface.d.ts","sourceRoot":"","sources":["../../../../src/react/Surface.tsx"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"Surface.d.ts","sourceRoot":"","sources":["../../../../src/react/Surface.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAwD,MAAM,OAAO,CAAC;AAO7E,OAAO,EAAwC,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AACpF,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAqB9C;;GAEG;AACH,eAAO,MAAM,kBAAkB,YAAa,cAAc,kBAAkB,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC,YAI9G,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,0HA6BnB,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import '@dxos-theme';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import { type PluginManager } from '../core';
|
|
3
4
|
declare const _default: {
|
|
4
5
|
title: string;
|
|
5
6
|
render: ({ manager }: {
|
|
6
7
|
manager: PluginManager;
|
|
7
|
-
}) =>
|
|
8
|
+
}) => React.JSX.Element;
|
|
8
9
|
decorators: import("@storybook/react").Decorator[];
|
|
9
10
|
args: {
|
|
10
11
|
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;AAErB,OAAO,KAAgC,MAAM,OAAO,CAAC;AASrD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;;;0BAkErB;QAAE,OAAO,EAAE,aAAa,CAAA;KAAE;;;;;;AAFlD,wBAcE;AAEF,eAAO,MAAM,OAAO,IAAK,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/app-framework",
|
|
3
|
-
"version": "0.8.1-
|
|
3
|
+
"version": "0.8.1-staging.31c3ee1",
|
|
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",
|
|
@@ -38,31 +38,32 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@preact/signals-core": "^1.6.0",
|
|
41
|
-
"
|
|
42
|
-
"@dxos/artifact": "0.8.1-
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/client-protocol": "0.8.1-
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/live-object": "0.8.1-
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/log": "0.8.1-
|
|
51
|
-
"@dxos/util": "0.8.1-
|
|
52
|
-
"@dxos/react-hooks": "0.8.1-main.ae460ac"
|
|
41
|
+
"@dxos/app-graph": "0.8.1-staging.31c3ee1",
|
|
42
|
+
"@dxos/artifact": "0.8.1-staging.31c3ee1",
|
|
43
|
+
"@dxos/async": "0.8.1-staging.31c3ee1",
|
|
44
|
+
"@dxos/client-protocol": "0.8.1-staging.31c3ee1",
|
|
45
|
+
"@dxos/debug": "0.8.1-staging.31c3ee1",
|
|
46
|
+
"@dxos/local-storage": "0.8.1-staging.31c3ee1",
|
|
47
|
+
"@dxos/invariant": "0.8.1-staging.31c3ee1",
|
|
48
|
+
"@dxos/live-object": "0.8.1-staging.31c3ee1",
|
|
49
|
+
"@dxos/react-hooks": "0.8.1-staging.31c3ee1",
|
|
50
|
+
"@dxos/log": "0.8.1-staging.31c3ee1",
|
|
51
|
+
"@dxos/util": "0.8.1-staging.31c3ee1"
|
|
53
52
|
},
|
|
54
53
|
"devDependencies": {
|
|
55
54
|
"@phosphor-icons/react": "^2.1.5",
|
|
56
55
|
"@types/react": "~18.2.0",
|
|
56
|
+
"effect": "3.13.3",
|
|
57
57
|
"react": "~18.2.0",
|
|
58
|
-
"@dxos/echo-schema": "0.8.1-
|
|
59
|
-
"@dxos/echo-signals": "0.8.1-
|
|
60
|
-
"@dxos/random": "0.8.1-
|
|
61
|
-
"@dxos/react-ui": "0.8.1-
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
58
|
+
"@dxos/echo-schema": "0.8.1-staging.31c3ee1",
|
|
59
|
+
"@dxos/echo-signals": "0.8.1-staging.31c3ee1",
|
|
60
|
+
"@dxos/random": "0.8.1-staging.31c3ee1",
|
|
61
|
+
"@dxos/react-ui": "0.8.1-staging.31c3ee1",
|
|
62
|
+
"@dxos/storybook-utils": "0.8.1-staging.31c3ee1",
|
|
63
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.1-staging.31c3ee1"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
|
+
"effect": "3.13.3",
|
|
66
67
|
"react": "~18.2.0"
|
|
67
68
|
},
|
|
68
69
|
"publishConfig": {
|
package/src/App.tsx
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { effect } from '@preact/signals-core';
|
|
6
|
-
import React, { type
|
|
6
|
+
import React, { useEffect, useState, type FC, type PropsWithChildren } from 'react';
|
|
7
7
|
|
|
8
8
|
import { invariant } from '@dxos/invariant';
|
|
9
9
|
import { create } from '@dxos/live-object';
|
|
@@ -21,7 +21,7 @@ export type CreateAppOptions = {
|
|
|
21
21
|
plugins?: Plugin[];
|
|
22
22
|
core?: string[];
|
|
23
23
|
defaults?: string[];
|
|
24
|
-
placeholder?:
|
|
24
|
+
placeholder?: FC<{ stage: number }>;
|
|
25
25
|
fallback?: ErrorBoundary['props']['fallback'];
|
|
26
26
|
cacheEnabled?: boolean;
|
|
27
27
|
};
|
|
@@ -56,7 +56,7 @@ export const createApp = ({
|
|
|
56
56
|
plugins = [],
|
|
57
57
|
core = plugins.map(({ meta }) => meta.id),
|
|
58
58
|
defaults = [],
|
|
59
|
-
placeholder
|
|
59
|
+
placeholder,
|
|
60
60
|
fallback = DefaultFallback,
|
|
61
61
|
cacheEnabled = false,
|
|
62
62
|
}: CreateAppOptions) => {
|
|
@@ -110,22 +110,79 @@ export const createApp = ({
|
|
|
110
110
|
);
|
|
111
111
|
};
|
|
112
112
|
|
|
113
|
-
|
|
113
|
+
const DELAY_PLACEHOLDER = 2_000;
|
|
114
|
+
|
|
115
|
+
enum LoadingState {
|
|
116
|
+
Loading = 0,
|
|
117
|
+
FadeIn = 1,
|
|
118
|
+
FadeOut = 2,
|
|
119
|
+
Done = 3,
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* To avoid "flashing" the placeholder, we wait a period of time before starting the loading animation.
|
|
124
|
+
* If loading completes during this time the placehoder is not shown, otherwise is it displayed for a minimum period of time.
|
|
125
|
+
*
|
|
126
|
+
* States:
|
|
127
|
+
* 0: Loading - Wait for a period of time before starting the loading animation.
|
|
128
|
+
* 1: Fade-in - Display a loading animation.
|
|
129
|
+
* 2: Fade-out - Fade out the loading animation.
|
|
130
|
+
* 3: Done - Remove the placeholder.
|
|
131
|
+
*/
|
|
132
|
+
const useLoading = (state: AppProps['state']) => {
|
|
133
|
+
const [stage, setStage] = useState<LoadingState>(LoadingState.Loading);
|
|
134
|
+
useEffect(() => {
|
|
135
|
+
const i = setInterval(() => {
|
|
136
|
+
setStage((tick) => {
|
|
137
|
+
switch (tick) {
|
|
138
|
+
case LoadingState.Loading:
|
|
139
|
+
if (!state.ready) {
|
|
140
|
+
return LoadingState.FadeIn;
|
|
141
|
+
} else {
|
|
142
|
+
clearInterval(i);
|
|
143
|
+
return LoadingState.Done;
|
|
144
|
+
}
|
|
145
|
+
case LoadingState.FadeIn:
|
|
146
|
+
if (state.ready) {
|
|
147
|
+
return LoadingState.FadeOut;
|
|
148
|
+
}
|
|
149
|
+
break;
|
|
150
|
+
case LoadingState.FadeOut:
|
|
151
|
+
clearInterval(i);
|
|
152
|
+
return LoadingState.Done;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return tick;
|
|
156
|
+
});
|
|
157
|
+
}, DELAY_PLACEHOLDER);
|
|
158
|
+
|
|
159
|
+
return () => clearInterval(i);
|
|
160
|
+
}, []);
|
|
161
|
+
|
|
162
|
+
return stage;
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
type AppProps = Pick<CreateAppOptions, 'placeholder'> & {
|
|
114
166
|
state: { ready: boolean; error: unknown };
|
|
115
167
|
};
|
|
116
168
|
|
|
117
|
-
const App = ({ placeholder, state }: AppProps) => {
|
|
169
|
+
const App = ({ placeholder: Placeholder, state }: AppProps) => {
|
|
118
170
|
const reactContexts = useCapabilities(Capabilities.ReactContext);
|
|
119
171
|
const reactRoots = useCapabilities(Capabilities.ReactRoot);
|
|
172
|
+
const stage = useLoading(state);
|
|
120
173
|
|
|
121
174
|
if (state.error) {
|
|
122
|
-
// This
|
|
175
|
+
// This triggers the error boundary to provide UI feedback for the startup error.
|
|
123
176
|
throw state.error;
|
|
124
177
|
}
|
|
125
178
|
|
|
126
179
|
// TODO(wittjosiah): Consider using Suspense instead?
|
|
127
|
-
if (
|
|
128
|
-
|
|
180
|
+
if (stage < LoadingState.Done) {
|
|
181
|
+
if (!Placeholder) {
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return <Placeholder stage={stage} />;
|
|
129
186
|
}
|
|
130
187
|
|
|
131
188
|
const ComposedContext = composeContexts(reactContexts);
|
package/src/common/layout.ts
CHANGED
|
@@ -176,6 +176,7 @@ export namespace LayoutAction {
|
|
|
176
176
|
options: S.optional(
|
|
177
177
|
S.Struct({
|
|
178
178
|
state: S.optional(S.Literal(true).annotations({ description: 'The items are being added.' })),
|
|
179
|
+
variant: S.optional(S.String.annotations({ description: 'The variant of the item to open.' })),
|
|
179
180
|
key: S.optional(
|
|
180
181
|
S.String.annotations({ description: 'If provided, will replace item with a matching key (id prefix).' }),
|
|
181
182
|
),
|
package/src/common/surface.ts
CHANGED
|
@@ -78,4 +78,9 @@ export type SurfaceDefinition<T extends Record<string, any> = any> = Readonly<{
|
|
|
78
78
|
component: SurfaceComponent<GuardedType<SurfaceDefinition<T>['filter']>>;
|
|
79
79
|
}>;
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
/**
|
|
82
|
+
* Creates a surface definition.
|
|
83
|
+
*/
|
|
84
|
+
export const createSurface = <T extends Record<string, any> = any>(
|
|
85
|
+
definition: SurfaceDefinition<T>,
|
|
86
|
+
): SurfaceDefinition<T> => definition;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Effect } from 'effect';
|
|
5
6
|
import { describe, expect, it } from 'vitest';
|
|
6
7
|
|
|
7
8
|
import { updateCounter } from '@dxos/echo-schema/testing';
|
|
@@ -12,8 +13,8 @@ import { defineCapability, PluginsContext } from './capabilities';
|
|
|
12
13
|
registerSignalsRuntime();
|
|
13
14
|
|
|
14
15
|
const defaultOptions = {
|
|
15
|
-
activate: () =>
|
|
16
|
-
reset: () =>
|
|
16
|
+
activate: () => Effect.succeed(false),
|
|
17
|
+
reset: () => Effect.succeed(false),
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
describe('PluginsContext', () => {
|
package/src/core/capabilities.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
//
|
|
7
7
|
|
|
8
8
|
import { effect, untracked } from '@preact/signals-core';
|
|
9
|
-
import {
|
|
9
|
+
import { Effect } from 'effect';
|
|
10
10
|
|
|
11
11
|
import { Trigger } from '@dxos/async';
|
|
12
12
|
import { invariant } from '@dxos/invariant';
|
|
@@ -56,8 +56,8 @@ export type Capability<T> = {
|
|
|
56
56
|
export type AnyCapability = Capability<any>;
|
|
57
57
|
|
|
58
58
|
type PluginsContextOptions = {
|
|
59
|
-
activate: (event: ActivationEvent) =>
|
|
60
|
-
reset: (event: ActivationEvent) =>
|
|
59
|
+
activate: (event: ActivationEvent) => Effect.Effect<boolean, Error>;
|
|
60
|
+
reset: (event: ActivationEvent) => Effect.Effect<boolean, Error>;
|
|
61
61
|
};
|
|
62
62
|
|
|
63
63
|
// NOTE: This is implemented as a class to prevent it from being proxied by PluginManager state.
|
|
@@ -219,4 +219,12 @@ export class PluginsContext {
|
|
|
219
219
|
unsubscribe();
|
|
220
220
|
return capability;
|
|
221
221
|
}
|
|
222
|
+
|
|
223
|
+
async activatePromise(event: ActivationEvent): Promise<boolean> {
|
|
224
|
+
return this.activate(event).pipe(Effect.runPromise);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
async resetPromise(event: ActivationEvent): Promise<boolean> {
|
|
228
|
+
return this.reset(event).pipe(Effect.runPromise);
|
|
229
|
+
}
|
|
222
230
|
}
|
package/src/core/manager.test.ts
CHANGED
|
@@ -28,7 +28,7 @@ const Total = defineCapability<{ total: number }>('dxos.org/test/total');
|
|
|
28
28
|
const CountEvent = defineEvent('dxos.org/test/count');
|
|
29
29
|
const FailEvent = defineEvent('dxos.org/test/fail');
|
|
30
30
|
|
|
31
|
-
const testMeta = { id: 'dxos.org/plugin/test' };
|
|
31
|
+
const testMeta = { id: 'dxos.org/plugin/test', name: 'Test' };
|
|
32
32
|
|
|
33
33
|
describe('PluginManager', () => {
|
|
34
34
|
let plugins: Plugin[] = [];
|
|
@@ -180,46 +180,46 @@ describe('PluginManager', () => {
|
|
|
180
180
|
});
|
|
181
181
|
|
|
182
182
|
it('should be able to fire custom activation events', async () => {
|
|
183
|
-
const
|
|
183
|
+
const Plugin1 = definePlugin({ id: 'dxos.org/test/plugin-1', name: 'Plugin 1' }, [
|
|
184
184
|
defineModule({
|
|
185
|
-
id: 'dxos.org/test/
|
|
185
|
+
id: 'dxos.org/test/plugin-1',
|
|
186
186
|
activatesOn: CountEvent,
|
|
187
187
|
activate: () => [contributes(Number, { number: 1 })],
|
|
188
188
|
}),
|
|
189
189
|
]);
|
|
190
|
-
const
|
|
190
|
+
const Plugin2 = definePlugin({ id: 'dxos.org/test/plugin-2', name: 'Plugin 2' }, [
|
|
191
191
|
defineModule({
|
|
192
|
-
id: 'dxos.org/test/
|
|
192
|
+
id: 'dxos.org/test/plugin-2',
|
|
193
193
|
activatesOn: CountEvent,
|
|
194
194
|
activate: () => [contributes(Number, { number: 2 })],
|
|
195
195
|
}),
|
|
196
196
|
]);
|
|
197
|
-
const
|
|
197
|
+
const Plugin3 = definePlugin({ id: 'dxos.org/test/plugin-3', name: 'Plugin 3' }, [
|
|
198
198
|
defineModule({
|
|
199
|
-
id: 'dxos.org/test/
|
|
199
|
+
id: 'dxos.org/test/plugin-3',
|
|
200
200
|
activatesOn: CountEvent,
|
|
201
201
|
activate: () => [contributes(Number, { number: 3 })],
|
|
202
202
|
}),
|
|
203
203
|
]);
|
|
204
|
-
plugins = [
|
|
204
|
+
plugins = [Plugin1, Plugin2, Plugin3];
|
|
205
205
|
|
|
206
206
|
const manager = new PluginManager({ pluginLoader });
|
|
207
207
|
expect(manager.active).toEqual([]);
|
|
208
208
|
expect(manager.context.requestCapabilities(Number)).toHaveLength(0);
|
|
209
209
|
|
|
210
|
-
await manager.add(
|
|
210
|
+
await manager.add(Plugin1.meta.id);
|
|
211
211
|
await manager.activate(CountEvent);
|
|
212
|
-
expect(manager.active).toEqual([
|
|
212
|
+
expect(manager.active).toEqual([Plugin1.meta.id]);
|
|
213
213
|
expect(manager.context.requestCapabilities(Number)).toHaveLength(1);
|
|
214
214
|
|
|
215
|
-
await manager.add(
|
|
215
|
+
await manager.add(Plugin2.meta.id);
|
|
216
216
|
await manager.activate(CountEvent);
|
|
217
|
-
expect(manager.active).toEqual([
|
|
217
|
+
expect(manager.active).toEqual([Plugin1.meta.id, Plugin2.meta.id]);
|
|
218
218
|
expect(manager.context.requestCapabilities(Number)).toHaveLength(2);
|
|
219
219
|
|
|
220
|
-
await manager.add(
|
|
220
|
+
await manager.add(Plugin3.meta.id);
|
|
221
221
|
await manager.activate(CountEvent);
|
|
222
|
-
expect(manager.active).toEqual([
|
|
222
|
+
expect(manager.active).toEqual([Plugin1.meta.id, Plugin2.meta.id, Plugin3.meta.id]);
|
|
223
223
|
expect(manager.context.requestCapabilities(Number)).toHaveLength(3);
|
|
224
224
|
});
|
|
225
225
|
|
|
@@ -283,7 +283,7 @@ describe('PluginManager', () => {
|
|
|
283
283
|
state.total = numbers.reduce((acc, n) => acc + n.number, 0);
|
|
284
284
|
};
|
|
285
285
|
|
|
286
|
-
const Count = definePlugin({ id: 'dxos.org/test/count' }, [
|
|
286
|
+
const Count = definePlugin({ id: 'dxos.org/test/count', name: 'Count' }, [
|
|
287
287
|
defineModule({
|
|
288
288
|
id: 'dxos.org/test/count',
|
|
289
289
|
activatesOn: Events.Startup,
|
|
@@ -297,17 +297,17 @@ describe('PluginManager', () => {
|
|
|
297
297
|
|
|
298
298
|
const Test = definePlugin(testMeta, [
|
|
299
299
|
defineModule({
|
|
300
|
-
id: 'dxos.org/test/
|
|
300
|
+
id: 'dxos.org/test/plugin-1',
|
|
301
301
|
activatesOn: CountEvent,
|
|
302
302
|
activate: () => contributes(Number, { number: 1 }),
|
|
303
303
|
}),
|
|
304
304
|
defineModule({
|
|
305
|
-
id: 'dxos.org/test/
|
|
305
|
+
id: 'dxos.org/test/plugin-2',
|
|
306
306
|
activatesOn: CountEvent,
|
|
307
307
|
activate: () => contributes(Number, { number: 2 }),
|
|
308
308
|
}),
|
|
309
309
|
defineModule({
|
|
310
|
-
id: 'dxos.org/test/
|
|
310
|
+
id: 'dxos.org/test/plugin-3',
|
|
311
311
|
activatesOn: CountEvent,
|
|
312
312
|
activate: () => contributes(Number, { number: 3 }),
|
|
313
313
|
}),
|
|
@@ -390,28 +390,28 @@ describe('PluginManager', () => {
|
|
|
390
390
|
});
|
|
391
391
|
|
|
392
392
|
it('should be reactive', async () => {
|
|
393
|
-
const
|
|
393
|
+
const Plugin1 = definePlugin({ id: 'dxos.org/test/plugin-1', name: 'Plugin 1' }, [
|
|
394
394
|
defineModule({
|
|
395
|
-
id: 'dxos.org/test/
|
|
395
|
+
id: 'dxos.org/test/plugin-1',
|
|
396
396
|
activatesOn: CountEvent,
|
|
397
397
|
activate: () => [contributes(Number, { number: 1 })],
|
|
398
398
|
}),
|
|
399
399
|
]);
|
|
400
|
-
const
|
|
400
|
+
const Plugin2 = definePlugin({ id: 'dxos.org/test/plugin-2', name: 'Plugin 2' }, [
|
|
401
401
|
defineModule({
|
|
402
|
-
id: 'dxos.org/test/
|
|
402
|
+
id: 'dxos.org/test/plugin-2',
|
|
403
403
|
activatesOn: CountEvent,
|
|
404
404
|
activate: () => [contributes(Number, { number: 2 })],
|
|
405
405
|
}),
|
|
406
406
|
]);
|
|
407
|
-
const
|
|
407
|
+
const Plugin3 = definePlugin({ id: 'dxos.org/test/plugin-3', name: 'Plugin 3' }, [
|
|
408
408
|
defineModule({
|
|
409
|
-
id: 'dxos.org/test/
|
|
409
|
+
id: 'dxos.org/test/plugin-3',
|
|
410
410
|
activatesOn: CountEvent,
|
|
411
411
|
activate: () => [contributes(Number, { number: 3 })],
|
|
412
412
|
}),
|
|
413
413
|
]);
|
|
414
|
-
plugins = [
|
|
414
|
+
plugins = [Plugin1, Plugin2, Plugin3];
|
|
415
415
|
|
|
416
416
|
const manager = new PluginManager({ pluginLoader });
|
|
417
417
|
using pluginUpdates = updateCounter(() => {
|
|
@@ -439,7 +439,7 @@ describe('PluginManager', () => {
|
|
|
439
439
|
expect(eventsFiredUpdates.count).toEqual(0);
|
|
440
440
|
expect(pendingResetUpdates.count).toEqual(0);
|
|
441
441
|
|
|
442
|
-
await manager.add(
|
|
442
|
+
await manager.add(Plugin1.meta.id);
|
|
443
443
|
expect(pluginUpdates.count).toEqual(1);
|
|
444
444
|
expect(enabledUpdates.count).toEqual(1);
|
|
445
445
|
expect(modulesUpdates.count).toEqual(1);
|
|
@@ -455,7 +455,7 @@ describe('PluginManager', () => {
|
|
|
455
455
|
expect(eventsFiredUpdates.count).toEqual(1);
|
|
456
456
|
expect(pendingResetUpdates.count).toEqual(0);
|
|
457
457
|
|
|
458
|
-
await manager.add(
|
|
458
|
+
await manager.add(Plugin2.meta.id);
|
|
459
459
|
expect(pluginUpdates.count).toEqual(2);
|
|
460
460
|
expect(enabledUpdates.count).toEqual(2);
|
|
461
461
|
expect(modulesUpdates.count).toEqual(2);
|
|
@@ -471,7 +471,7 @@ describe('PluginManager', () => {
|
|
|
471
471
|
expect(eventsFiredUpdates.count).toEqual(1);
|
|
472
472
|
expect(pendingResetUpdates.count).toEqual(2);
|
|
473
473
|
|
|
474
|
-
await manager.add(
|
|
474
|
+
await manager.add(Plugin3.meta.id);
|
|
475
475
|
expect(pluginUpdates.count).toEqual(3);
|
|
476
476
|
expect(enabledUpdates.count).toEqual(3);
|
|
477
477
|
expect(modulesUpdates.count).toEqual(3);
|
|
@@ -488,7 +488,7 @@ describe('PluginManager', () => {
|
|
|
488
488
|
expect(eventsFiredUpdates.count).toEqual(1);
|
|
489
489
|
expect(pendingResetUpdates.count).toEqual(4);
|
|
490
490
|
|
|
491
|
-
await manager.disable(
|
|
491
|
+
await manager.disable(Plugin1.meta.id);
|
|
492
492
|
expect(pluginUpdates.count).toEqual(3);
|
|
493
493
|
expect(enabledUpdates.count).toEqual(4);
|
|
494
494
|
expect(modulesUpdates.count).toEqual(4);
|
|
@@ -496,7 +496,7 @@ describe('PluginManager', () => {
|
|
|
496
496
|
expect(eventsFiredUpdates.count).toEqual(1);
|
|
497
497
|
expect(pendingResetUpdates.count).toEqual(4);
|
|
498
498
|
|
|
499
|
-
await manager.remove(
|
|
499
|
+
await manager.remove(Plugin1.meta.id);
|
|
500
500
|
expect(pluginUpdates.count).toEqual(4);
|
|
501
501
|
expect(enabledUpdates.count).toEqual(4);
|
|
502
502
|
expect(modulesUpdates.count).toEqual(4);
|
package/src/core/manager.ts
CHANGED
|
@@ -45,8 +45,8 @@ export class PluginManager {
|
|
|
45
45
|
readonly activation = new Event<{ event: string; state: 'activating' | 'activated' | 'error'; error?: any }>();
|
|
46
46
|
|
|
47
47
|
readonly context = new PluginsContext({
|
|
48
|
-
activate: (event) => this.
|
|
49
|
-
reset: (id) => this.
|
|
48
|
+
activate: (event) => this._activate(event),
|
|
49
|
+
reset: (id) => this._reset(id),
|
|
50
50
|
});
|
|
51
51
|
|
|
52
52
|
private readonly _state: ReactiveObject<PluginManagerState>;
|
package/src/core/plugin.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { defineModule, definePlugin, lazy } from '../../core';
|
|
|
8
8
|
const Debug = lazy(() => import('./Debug'));
|
|
9
9
|
|
|
10
10
|
export const DebugPlugin = () =>
|
|
11
|
-
definePlugin({ id: 'dxos.org/test/debug' }, [
|
|
11
|
+
definePlugin({ id: 'dxos.org/test/plugin-debug', name: 'Debug' }, [
|
|
12
12
|
defineModule({
|
|
13
13
|
id: 'dxos.org/test/debug/main',
|
|
14
14
|
activatesOn: Events.Startup,
|
|
@@ -26,7 +26,7 @@ export const createGeneratorIntent = (id: string) => {
|
|
|
26
26
|
export const createNumberPlugin = (id: string) => {
|
|
27
27
|
const number = Math.floor(Math.random() * 100);
|
|
28
28
|
|
|
29
|
-
return definePlugin({ id }, [
|
|
29
|
+
return definePlugin({ id, name: `Plugin ${id}` }, [
|
|
30
30
|
defineModule({
|
|
31
31
|
id: `${id}/main`,
|
|
32
32
|
activatesOn: CountEvent,
|