@dxos/plugin-testing 0.8.4-main.422d1c7879 → 0.8.4-main.4f23b4e393
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/neutral/StorybookPlugin.mjs +10 -0
- package/dist/lib/neutral/add-toast-Z2RXG4RX.mjs +23 -0
- package/dist/lib/neutral/add-toast-Z2RXG4RX.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +11 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-7UPIIIZM.mjs +22 -0
- package/dist/lib/neutral/chunk-7UPIIIZM.mjs.map +7 -0
- package/dist/lib/neutral/chunk-E4LBVPH5.mjs +8 -0
- package/dist/lib/neutral/chunk-E4LBVPH5.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-NZ2VT6N2.mjs +17 -0
- package/dist/lib/neutral/chunk-NZ2VT6N2.mjs.map +7 -0
- package/dist/lib/neutral/chunk-R7AV233N.mjs +31 -0
- package/dist/lib/neutral/chunk-R7AV233N.mjs.map +7 -0
- package/dist/lib/neutral/chunk-ULNF6GTG.mjs +21 -0
- package/dist/lib/neutral/chunk-ULNF6GTG.mjs.map +7 -0
- package/dist/lib/neutral/chunk-ZVN23V74.mjs +16 -0
- package/dist/lib/neutral/chunk-ZVN23V74.mjs.map +7 -0
- package/dist/lib/neutral/close-L3FBJQ3J.mjs +12 -0
- package/dist/lib/neutral/close-L3FBJQ3J.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +183 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/core.mjs +8 -0
- package/dist/lib/neutral/core.mjs.map +7 -0
- package/dist/lib/{browser/chunk-G2BI2IZM.mjs → neutral/harness.mjs} +7 -6
- package/dist/lib/neutral/harness.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +20 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/meta.mjs.map +7 -0
- package/dist/lib/neutral/open-WBONYQ47.mjs +14 -0
- package/dist/lib/neutral/open-WBONYQ47.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-LQIWHQVY.mjs +13 -0
- package/dist/lib/neutral/operation-handler-LQIWHQVY.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/operations/index.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/scroll-into-view-BKOOOECC.mjs +12 -0
- package/dist/lib/neutral/scroll-into-view-BKOOOECC.mjs.map +7 -0
- package/dist/lib/neutral/set-layout-mode-2KHD2AEY.mjs +12 -0
- package/dist/lib/neutral/set-layout-mode-2KHD2AEY.mjs.map +7 -0
- package/dist/lib/neutral/state-AJ62JEEG.mjs +43 -0
- package/dist/lib/neutral/state-AJ62JEEG.mjs.map +7 -0
- package/dist/lib/neutral/switch-workspace-SAT2NGXV.mjs +20 -0
- package/dist/lib/neutral/switch-workspace-SAT2NGXV.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +8 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/lib/neutral/update-complementary-JP2OL73Z.mjs +26 -0
- package/dist/lib/neutral/update-complementary-JP2OL73Z.mjs.map +7 -0
- package/dist/lib/neutral/update-dialog-MX6IKKJX.mjs +28 -0
- package/dist/lib/neutral/update-dialog-MX6IKKJX.mjs.map +7 -0
- package/dist/lib/neutral/update-popover-DOORE3TD.mjs +46 -0
- package/dist/lib/neutral/update-popover-DOORE3TD.mjs.map +7 -0
- package/dist/lib/neutral/update-sidebar-LWQ3IA6S.mjs +26 -0
- package/dist/lib/neutral/update-sidebar-LWQ3IA6S.mjs.map +7 -0
- package/dist/types/src/StorybookPlugin.d.ts +3 -2
- package/dist/types/src/StorybookPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +3 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +3 -3
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/components/Layout/Layout.d.ts.map +1 -1
- package/dist/types/src/core.d.ts.map +1 -1
- package/dist/types/src/harness.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/operations/add-toast.d.ts +1 -1
- package/dist/types/src/operations/add-toast.d.ts.map +1 -1
- package/dist/types/src/operations/close.d.ts +1 -1
- package/dist/types/src/operations/close.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +1 -1
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/operations/open.d.ts +1 -1
- package/dist/types/src/operations/open.d.ts.map +1 -1
- package/dist/types/src/operations/scroll-into-view.d.ts +1 -1
- package/dist/types/src/operations/scroll-into-view.d.ts.map +1 -1
- package/dist/types/src/operations/set-layout-mode.d.ts +1 -1
- package/dist/types/src/operations/set-layout-mode.d.ts.map +1 -1
- package/dist/types/src/operations/switch-workspace.d.ts +1 -1
- package/dist/types/src/operations/switch-workspace.d.ts.map +1 -1
- package/dist/types/src/operations/update-complementary.d.ts +1 -1
- package/dist/types/src/operations/update-complementary.d.ts.map +1 -1
- package/dist/types/src/operations/update-dialog.d.ts +1 -1
- package/dist/types/src/operations/update-dialog.d.ts.map +1 -1
- package/dist/types/src/operations/update-popover.d.ts +1 -1
- package/dist/types/src/operations/update-popover.d.ts.map +1 -1
- package/dist/types/src/operations/update-sidebar.d.ts +1 -1
- package/dist/types/src/operations/update-sidebar.d.ts.map +1 -1
- package/dist/types/src/operations/update-state.d.ts +2 -2
- package/dist/types/src/operations/update-state.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +5 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/types/{capabilities.d.ts → StorybookCapabilities.d.ts} +1 -1
- package/dist/types/src/types/StorybookCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +1 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +52 -23
- package/src/StorybookPlugin.ts +4 -2
- package/src/capabilities/index.ts +1 -1
- package/src/capabilities/operation-handler.ts +1 -1
- package/src/capabilities/state.tsx +8 -5
- package/src/components/Layout/Layout.tsx +4 -4
- package/src/core.ts +19 -4
- package/src/harness.ts +4 -4
- package/src/index.ts +6 -1
- package/src/operations/add-toast.ts +1 -1
- package/src/operations/close.ts +1 -1
- package/src/operations/index.ts +1 -1
- package/src/operations/open.ts +1 -1
- package/src/operations/scroll-into-view.ts +1 -1
- package/src/operations/set-layout-mode.ts +1 -1
- package/src/operations/switch-workspace.ts +1 -1
- package/src/operations/update-complementary.ts +1 -1
- package/src/operations/update-dialog.ts +1 -1
- package/src/operations/update-popover.ts +3 -3
- package/src/operations/update-sidebar.ts +1 -1
- package/src/operations/update-state.ts +5 -3
- package/src/plugin.ts +12 -0
- package/src/types/{capabilities.ts → StorybookCapabilities.ts} +2 -0
- package/src/types/index.ts +1 -1
- package/dist/lib/browser/chunk-G2BI2IZM.mjs.map +0 -7
- package/dist/lib/browser/harness.mjs +0 -7
- package/dist/lib/browser/index.mjs +0 -65
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/node-esm/chunk-U342VJPQ.mjs +0 -38
- package/dist/lib/node-esm/chunk-U342VJPQ.mjs.map +0 -7
- package/dist/lib/node-esm/harness.mjs +0 -8
- package/dist/lib/node-esm/index.mjs +0 -66
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/types/src/types/capabilities.d.ts.map +0 -1
- /package/dist/lib/{browser/harness.mjs.map → neutral/StorybookPlugin.mjs.map} +0 -0
- /package/dist/lib/{node-esm/harness.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-testing",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.4f23b4e393",
|
|
4
4
|
"description": "Plugin testing utils",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -13,23 +13,52 @@
|
|
|
13
13
|
"sideEffects": true,
|
|
14
14
|
"type": "module",
|
|
15
15
|
"imports": {
|
|
16
|
-
"#capabilities":
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
"#capabilities": {
|
|
17
|
+
"source": "./src/capabilities/index.ts",
|
|
18
|
+
"types": "./dist/types/src/capabilities/index.d.ts",
|
|
19
|
+
"default": "./dist/lib/neutral/capabilities/index.mjs"
|
|
20
|
+
},
|
|
21
|
+
"#components": {
|
|
22
|
+
"source": "./src/components/index.ts",
|
|
23
|
+
"types": "./dist/types/src/components/index.d.ts",
|
|
24
|
+
"default": "./dist/lib/neutral/components/index.mjs"
|
|
25
|
+
},
|
|
26
|
+
"#meta": {
|
|
27
|
+
"source": "./src/meta.ts",
|
|
28
|
+
"types": "./dist/types/src/meta.d.ts",
|
|
29
|
+
"default": "./dist/lib/neutral/meta.mjs"
|
|
30
|
+
},
|
|
31
|
+
"#operations": {
|
|
32
|
+
"source": "./src/operations/index.ts",
|
|
33
|
+
"types": "./dist/types/src/operations/index.d.ts",
|
|
34
|
+
"default": "./dist/lib/neutral/operations/index.mjs"
|
|
35
|
+
},
|
|
36
|
+
"#plugin": {
|
|
37
|
+
"source": "./src/StorybookPlugin.ts",
|
|
38
|
+
"types": "./dist/types/src/StorybookPlugin.d.ts",
|
|
39
|
+
"default": "./dist/lib/neutral/StorybookPlugin.mjs"
|
|
40
|
+
},
|
|
41
|
+
"#types": {
|
|
42
|
+
"source": "./src/types/index.ts",
|
|
43
|
+
"types": "./dist/types/src/types/index.d.ts",
|
|
44
|
+
"default": "./dist/lib/neutral/types/index.mjs"
|
|
45
|
+
}
|
|
21
46
|
},
|
|
22
47
|
"exports": {
|
|
23
48
|
".": {
|
|
24
49
|
"source": "./src/index.ts",
|
|
25
50
|
"types": "./dist/types/src/index.d.ts",
|
|
26
|
-
"
|
|
51
|
+
"default": "./dist/lib/neutral/index.mjs"
|
|
27
52
|
},
|
|
28
53
|
"./harness": {
|
|
29
54
|
"source": "./src/harness.ts",
|
|
30
55
|
"types": "./dist/types/src/harness.d.ts",
|
|
31
|
-
"
|
|
32
|
-
|
|
56
|
+
"default": "./dist/lib/neutral/harness.mjs"
|
|
57
|
+
},
|
|
58
|
+
"./plugin": {
|
|
59
|
+
"source": "./src/plugin.ts",
|
|
60
|
+
"types": "./dist/types/src/plugin.d.ts",
|
|
61
|
+
"default": "./dist/lib/neutral/plugin.mjs"
|
|
33
62
|
}
|
|
34
63
|
},
|
|
35
64
|
"types": "dist/types/src/index.d.ts",
|
|
@@ -40,15 +69,15 @@
|
|
|
40
69
|
"dependencies": {
|
|
41
70
|
"@effect-atom/atom": "^0.5.1",
|
|
42
71
|
"@effect-atom/atom-react": "^0.5.0",
|
|
43
|
-
"@dxos/app-
|
|
44
|
-
"@dxos/app-
|
|
45
|
-
"@dxos/plugin-
|
|
46
|
-
"@dxos/plugin-
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/plugin-
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
72
|
+
"@dxos/app-framework": "0.8.4-main.4f23b4e393",
|
|
73
|
+
"@dxos/app-toolkit": "0.8.4-main.4f23b4e393",
|
|
74
|
+
"@dxos/plugin-attention": "0.8.4-main.4f23b4e393",
|
|
75
|
+
"@dxos/plugin-settings": "0.8.4-main.4f23b4e393",
|
|
76
|
+
"@dxos/plugin-theme": "0.8.4-main.4f23b4e393",
|
|
77
|
+
"@dxos/plugin-graph": "0.8.4-main.4f23b4e393",
|
|
78
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.4f23b4e393",
|
|
79
|
+
"@dxos/util": "0.8.4-main.4f23b4e393",
|
|
80
|
+
"@dxos/compute": "0.8.4-main.4f23b4e393"
|
|
52
81
|
},
|
|
53
82
|
"devDependencies": {
|
|
54
83
|
"@types/react": "~19.2.7",
|
|
@@ -56,16 +85,16 @@
|
|
|
56
85
|
"effect": "3.20.0",
|
|
57
86
|
"react": "~19.2.3",
|
|
58
87
|
"react-dom": "~19.2.3",
|
|
59
|
-
"vite": "^
|
|
60
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
61
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
88
|
+
"vite": "^8.0.10",
|
|
89
|
+
"@dxos/react-ui": "0.8.4-main.4f23b4e393",
|
|
90
|
+
"@dxos/ui-theme": "0.8.4-main.4f23b4e393"
|
|
62
91
|
},
|
|
63
92
|
"peerDependencies": {
|
|
64
93
|
"effect": "3.20.0",
|
|
65
94
|
"react": "~19.2.3",
|
|
66
95
|
"react-dom": "~19.2.3",
|
|
67
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
68
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
96
|
+
"@dxos/react-ui": "0.8.4-main.4f23b4e393",
|
|
97
|
+
"@dxos/ui-theme": "0.8.4-main.4f23b4e393"
|
|
69
98
|
},
|
|
70
99
|
"publishConfig": {
|
|
71
100
|
"access": "public"
|
package/src/StorybookPlugin.ts
CHANGED
|
@@ -10,10 +10,10 @@ import { AppActivationEvents, AppPlugin } from '@dxos/app-toolkit';
|
|
|
10
10
|
import { OperationHandler, State } from '#capabilities';
|
|
11
11
|
import { Layout } from '#components';
|
|
12
12
|
import { meta } from '#meta';
|
|
13
|
-
import {
|
|
13
|
+
import { StorybookCapabilities } from '#types';
|
|
14
14
|
|
|
15
15
|
export type StorybookPluginOptions = {
|
|
16
|
-
initialState?: Partial<LayoutStateProps>;
|
|
16
|
+
initialState?: Partial<StorybookCapabilities.LayoutStateProps>;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export const StorybookPlugin = Plugin.define<StorybookPluginOptions>(meta).pipe(
|
|
@@ -37,3 +37,5 @@ export const StorybookPlugin = Plugin.define<StorybookPluginOptions>(meta).pipe(
|
|
|
37
37
|
})),
|
|
38
38
|
Plugin.make,
|
|
39
39
|
);
|
|
40
|
+
|
|
41
|
+
export default StorybookPlugin;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Capability } from '@dxos/app-framework';
|
|
6
|
-
import { OperationHandlerSet } from '@dxos/
|
|
6
|
+
import { OperationHandlerSet } from '@dxos/compute';
|
|
7
7
|
|
|
8
8
|
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
9
9
|
'OperationHandler',
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
7
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
-
import type { OperationHandlerSet } from '@dxos/
|
|
8
|
+
import type { OperationHandlerSet } from '@dxos/compute';
|
|
9
9
|
|
|
10
10
|
import { TestingOperationHandlerSet } from '#operations';
|
|
11
11
|
|
|
@@ -8,9 +8,9 @@ import * as Effect from 'effect/Effect';
|
|
|
8
8
|
import { Capability } from '@dxos/app-framework';
|
|
9
9
|
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { StorybookCapabilities } from '#types';
|
|
12
12
|
|
|
13
|
-
const defaultState: LayoutStateProps = {
|
|
13
|
+
const defaultState: StorybookCapabilities.LayoutStateProps = {
|
|
14
14
|
sidebarState: 'closed',
|
|
15
15
|
complementarySidebarState: 'closed',
|
|
16
16
|
dialogOpen: false,
|
|
@@ -19,9 +19,9 @@ const defaultState: LayoutStateProps = {
|
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
export default Capability.makeModule(
|
|
22
|
-
Effect.fnUntraced(function* (props?: { initialState?: Partial<LayoutStateProps> }) {
|
|
22
|
+
Effect.fnUntraced(function* (props?: { initialState?: Partial<StorybookCapabilities.LayoutStateProps> }) {
|
|
23
23
|
const { initialState } = props ?? {};
|
|
24
|
-
const stateAtom = Atom.make<LayoutStateProps>({ ...defaultState, ...initialState });
|
|
24
|
+
const stateAtom = Atom.make<StorybookCapabilities.LayoutStateProps>({ ...defaultState, ...initialState });
|
|
25
25
|
|
|
26
26
|
const layoutAtom = Atom.make((get): AppCapabilities.Layout => {
|
|
27
27
|
const state = get(stateAtom);
|
|
@@ -37,6 +37,9 @@ export default Capability.makeModule(
|
|
|
37
37
|
};
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
-
return [
|
|
40
|
+
return [
|
|
41
|
+
Capability.contributes(StorybookCapabilities.LayoutState, stateAtom),
|
|
42
|
+
Capability.contributes(AppCapabilities.Layout, layoutAtom),
|
|
43
|
+
];
|
|
41
44
|
}),
|
|
42
45
|
);
|
|
@@ -25,7 +25,7 @@ import { Mosaic } from '@dxos/react-ui-mosaic';
|
|
|
25
25
|
import { descriptionMessage, mx } from '@dxos/ui-theme';
|
|
26
26
|
|
|
27
27
|
import { meta } from '#meta';
|
|
28
|
-
import {
|
|
28
|
+
import { StorybookCapabilities } from '#types';
|
|
29
29
|
|
|
30
30
|
const debounce_delay = 100;
|
|
31
31
|
|
|
@@ -71,14 +71,14 @@ export const Layout = ({ children }: PropsWithChildren<{}>) => {
|
|
|
71
71
|
const { t } = useTranslation(meta.id);
|
|
72
72
|
const trigger = useRef<HTMLButtonElement | null>(null);
|
|
73
73
|
const registry = useContext(RegistryContext);
|
|
74
|
-
const stateAtom = useCapability(LayoutState);
|
|
74
|
+
const stateAtom = useCapability(StorybookCapabilities.LayoutState);
|
|
75
75
|
const layout = useAtomValue(stateAtom);
|
|
76
76
|
const [iter, setIter] = useState(0);
|
|
77
77
|
const [open, setOpen] = useState(false);
|
|
78
78
|
const debounceRef = useRef<NodeJS.Timeout | null>(null);
|
|
79
79
|
|
|
80
80
|
const updateState = useCallback(
|
|
81
|
-
(updates: Partial<LayoutStateProps>) => {
|
|
81
|
+
(updates: Partial<StorybookCapabilities.LayoutStateProps>) => {
|
|
82
82
|
const current = registry.get(stateAtom);
|
|
83
83
|
registry.set(stateAtom, { ...current, ...updates });
|
|
84
84
|
},
|
|
@@ -135,7 +135,7 @@ export const Layout = ({ children }: PropsWithChildren<{}>) => {
|
|
|
135
135
|
|
|
136
136
|
return (
|
|
137
137
|
<Toast.Provider>
|
|
138
|
-
<div
|
|
138
|
+
<div className='fixed inset-0 flex overflow-hidden'>
|
|
139
139
|
<Mosaic.Root>
|
|
140
140
|
<Popover.Root open={open}>
|
|
141
141
|
<Main.Root
|
package/src/core.ts
CHANGED
|
@@ -3,10 +3,25 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { OperationPlugin, type Plugin, RuntimePlugin } from '@dxos/app-framework';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
// `/plugin` entrypoints — `@dxos/plugin-attention/plugin`, `/plugin-client/plugin`,
|
|
7
|
+
// `/plugin-graph/plugin`, `/plugin-preview/plugin`, `/plugin-settings/plugin`,
|
|
8
|
+
// `/plugin-space/plugin`, `/plugin-theme/plugin` — re-export the plugin eagerly
|
|
9
|
+
// (without `Plugin.lazy`). The default `.` export wraps each plugin in a lazy
|
|
10
|
+
// stub (`() => import('./XPlugin')`), which webkit cannot reliably resolve
|
|
11
|
+
// under vite-dev: the dynamic-import promise can settle with a
|
|
12
|
+
// partially-evaluated namespace, throwing `ReferenceError: Cannot access
|
|
13
|
+
// 'default' before initialization` from the loader's `mod.default` access.
|
|
14
|
+
// Storybook runs inside `storybook dev` (vite-dev) and is currently the only
|
|
15
|
+
// host that hits this. Production hosts (composer-app via `vite preview`)
|
|
16
|
+
// keep using the lazy `.` exports and their associated code splitting.
|
|
17
|
+
//
|
|
18
|
+
// Use these `/plugin` entrypoints from any storybook `withPluginManager`
|
|
19
|
+
// setup. The single-line `export * from './XPlugin'` re-exports avoid the
|
|
20
|
+
// dynamic-import path entirely — see e.g. `plugin-attention/src/plugin.ts`.
|
|
21
|
+
import { AttentionPlugin } from '@dxos/plugin-attention/testing';
|
|
22
|
+
import { GraphPlugin } from '@dxos/plugin-graph/testing';
|
|
23
|
+
import { SettingsPlugin } from '@dxos/plugin-settings/testing';
|
|
24
|
+
import { ThemePlugin } from '@dxos/plugin-theme/plugin';
|
|
10
25
|
import { defaultTx } from '@dxos/ui-theme';
|
|
11
26
|
|
|
12
27
|
/**
|
package/src/harness.ts
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
import { OperationPlugin, type Plugin, RuntimePlugin } from '@dxos/app-framework';
|
|
6
6
|
import { createTestApp, type TestAppOptions, type TestHarness } from '@dxos/app-framework/testing';
|
|
7
|
-
import { AttentionPlugin } from '@dxos/plugin-attention';
|
|
8
|
-
import { GraphPlugin } from '@dxos/plugin-graph';
|
|
9
|
-
import { SettingsPlugin } from '@dxos/plugin-settings';
|
|
7
|
+
import { AttentionPlugin } from '@dxos/plugin-attention/plugin';
|
|
8
|
+
import { GraphPlugin } from '@dxos/plugin-graph/plugin';
|
|
9
|
+
import { SettingsPlugin } from '@dxos/plugin-settings/plugin';
|
|
10
10
|
|
|
11
11
|
export type ComposerTestAppOptions = Omit<TestAppOptions, 'plugins'> & {
|
|
12
12
|
/** Plugins to register in addition to the Composer core plugins. */
|
|
@@ -41,7 +41,7 @@ export const createComposerTestApp = async (opts: ComposerTestAppOptions = {}):
|
|
|
41
41
|
const { plugins = [], theme = false, ...rest } = opts;
|
|
42
42
|
const core = headlessCorePlugins();
|
|
43
43
|
if (theme) {
|
|
44
|
-
const { ThemePlugin } = await import('@dxos/plugin-theme');
|
|
44
|
+
const { ThemePlugin } = await import('@dxos/plugin-theme/plugin');
|
|
45
45
|
const { defaultTx } = await import('@dxos/ui-theme');
|
|
46
46
|
core.push(ThemePlugin({ tx: defaultTx }));
|
|
47
47
|
}
|
package/src/index.ts
CHANGED
|
@@ -3,7 +3,12 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
export * from './core';
|
|
6
|
-
export * from './harness';
|
|
7
6
|
export * from './meta';
|
|
7
|
+
export * from './types';
|
|
8
8
|
|
|
9
|
+
// `@dxos/plugin-testing` is a testing-only package, so `StorybookPlugin` is
|
|
10
|
+
// exported eagerly from the `.` entrypoint (no `Plugin.lazy` indirection).
|
|
11
|
+
// Storybook on webkit + vite-dev cannot reliably resolve the lazy form's
|
|
12
|
+
// dynamic `import()` — see `./core.ts` for the underlying chunk-init issue
|
|
13
|
+
// — and there is no production code-splitting benefit to recover here.
|
|
9
14
|
export * from './StorybookPlugin';
|
package/src/operations/close.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
7
|
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
8
|
-
import { Operation } from '@dxos/
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
9
|
|
|
10
10
|
const handler: Operation.WithHandler<typeof LayoutOperation.Close> = LayoutOperation.Close.pipe(
|
|
11
11
|
Operation.withHandler(() => Effect.void),
|
package/src/operations/index.ts
CHANGED
package/src/operations/open.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
7
|
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
8
|
-
import { Operation } from '@dxos/
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
9
|
|
|
10
10
|
const handler: Operation.WithHandler<typeof LayoutOperation.Open> = LayoutOperation.Open.pipe(
|
|
11
11
|
Operation.withHandler(
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
7
|
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
8
|
-
import { Operation } from '@dxos/
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
9
|
|
|
10
10
|
const handler: Operation.WithHandler<typeof LayoutOperation.ScrollIntoView> = LayoutOperation.ScrollIntoView.pipe(
|
|
11
11
|
Operation.withHandler(() => Effect.void),
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
7
|
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
8
|
-
import { Operation } from '@dxos/
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
9
|
|
|
10
10
|
const handler: Operation.WithHandler<typeof LayoutOperation.SetLayoutMode> = LayoutOperation.SetLayoutMode.pipe(
|
|
11
11
|
Operation.withHandler(() => Effect.void),
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
7
|
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
8
|
-
import { Operation } from '@dxos/
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { StorybookCapabilities } from '../types';
|
|
11
11
|
import { updateState } from './update-state';
|
|
12
12
|
|
|
13
13
|
const handler: Operation.WithHandler<typeof LayoutOperation.UpdatePopover> = LayoutOperation.UpdatePopover.pipe(
|
|
@@ -15,7 +15,7 @@ const handler: Operation.WithHandler<typeof LayoutOperation.UpdatePopover> = Lay
|
|
|
15
15
|
Effect.fnUntraced(function* (input) {
|
|
16
16
|
const { subject, state, side, kind, props } = input;
|
|
17
17
|
yield* updateState(() => {
|
|
18
|
-
const base: Partial<LayoutStateProps> = {
|
|
18
|
+
const base: Partial<StorybookCapabilities.LayoutStateProps> = {
|
|
19
19
|
popoverKind: kind ?? 'base',
|
|
20
20
|
popoverTitle: kind === 'card' ? input.title : undefined,
|
|
21
21
|
popoverContent:
|
|
@@ -6,12 +6,14 @@ import * as Effect from 'effect/Effect';
|
|
|
6
6
|
|
|
7
7
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { StorybookCapabilities } from '../types';
|
|
10
10
|
|
|
11
|
-
export const updateState = (
|
|
11
|
+
export const updateState = (
|
|
12
|
+
fn: (state: StorybookCapabilities.LayoutStateProps) => Partial<StorybookCapabilities.LayoutStateProps>,
|
|
13
|
+
) =>
|
|
12
14
|
Effect.gen(function* () {
|
|
13
15
|
const registry = yield* Capability.get(Capabilities.AtomRegistry);
|
|
14
|
-
const stateAtom = yield* Capability.get(LayoutState);
|
|
16
|
+
const stateAtom = yield* Capability.get(StorybookCapabilities.LayoutState);
|
|
15
17
|
const current = registry.get(stateAtom);
|
|
16
18
|
registry.set(stateAtom, { ...current, ...fn(current) });
|
|
17
19
|
});
|
package/src/plugin.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { meta } from './meta';
|
|
8
|
+
|
|
9
|
+
export const StorybookPlugin = Plugin.lazy(meta, () => import('#plugin'));
|
|
10
|
+
export type { StorybookPluginOptions } from '#plugin';
|
|
11
|
+
|
|
12
|
+
export { TestingOperationHandlerSet } from './operations';
|
package/src/types/index.ts
CHANGED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/harness.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport { OperationPlugin, type Plugin, RuntimePlugin } from '@dxos/app-framework';\nimport { createTestApp, type TestAppOptions, type TestHarness } from '@dxos/app-framework/testing';\nimport { AttentionPlugin } from '@dxos/plugin-attention';\nimport { GraphPlugin } from '@dxos/plugin-graph';\nimport { SettingsPlugin } from '@dxos/plugin-settings';\n\nexport type ComposerTestAppOptions = Omit<TestAppOptions, 'plugins'> & {\n /** Plugins to register in addition to the Composer core plugins. */\n plugins?: Plugin.Plugin[];\n /**\n * Whether to include `ThemePlugin` in the core plugin set.\n * Defaults to `false` — `ThemePlugin` requires a browser DOM and breaks Node-only tests.\n * Set to `true` (with jsdom/happy-dom) when rendering React surfaces.\n */\n theme?: boolean;\n};\n\n/**\n * Headless core plugins for the test harness — the subset of `corePlugins()`\n * that can be activated without a browser DOM.\n */\nconst headlessCorePlugins = (): Plugin.Plugin[] => [\n AttentionPlugin(),\n GraphPlugin(),\n OperationPlugin(),\n RuntimePlugin(),\n SettingsPlugin(),\n];\n\n/**\n * Creates a TestHarness pre-loaded with the Composer core plugins\n * (Attention, Graph, Operation, Runtime, Settings, optionally Theme).\n *\n * For a ClientPlugin-backed harness, pass `ClientPlugin({ ... })` via `plugins`.\n */\nexport const createComposerTestApp = async (opts: ComposerTestAppOptions = {}): Promise<TestHarness> => {\n const { plugins = [], theme = false, ...rest } = opts;\n const core = headlessCorePlugins();\n if (theme) {\n const { ThemePlugin } = await import('@dxos/plugin-theme');\n const { defaultTx } = await import('@dxos/ui-theme');\n core.push(ThemePlugin({ tx: defaultTx }));\n }\n return createTestApp({\n ...rest,\n plugins: [...core, ...plugins],\n });\n};\n"],
|
|
5
|
-
"mappings": ";AAIA,SAASA,iBAA8BC,qBAAqB;AAC5D,SAASC,qBAA4D;AACrE,SAASC,uBAAuB;AAChC,SAASC,mBAAmB;AAC5B,SAASC,sBAAsB;AAiB/B,IAAMC,sBAAsB,MAAuB;EACjDC,gBAAAA;EACAC,YAAAA;EACAC,gBAAAA;EACAC,cAAAA;EACAC,eAAAA;;AASK,IAAMC,wBAAwB,OAAOC,OAA+B,CAAC,MAAC;AAC3E,QAAM,EAAEC,UAAU,CAAA,GAAIC,QAAQ,OAAO,GAAGC,KAAAA,IAASH;AACjD,QAAMI,OAAOX,oBAAAA;AACb,MAAIS,OAAO;AACT,UAAM,EAAEG,YAAW,IAAK,MAAM,OAAO,oBAAA;AACrC,UAAM,EAAEC,UAAS,IAAK,MAAM,OAAO,gBAAA;AACnCF,SAAKG,KAAKF,YAAY;MAAEG,IAAIF;IAAU,CAAA,CAAA;EACxC;AACA,SAAOG,cAAc;IACnB,GAAGN;IACHF,SAAS;SAAIG;SAASH;;EACxB,CAAA;AACF;",
|
|
6
|
-
"names": ["OperationPlugin", "RuntimePlugin", "createTestApp", "AttentionPlugin", "GraphPlugin", "SettingsPlugin", "headlessCorePlugins", "AttentionPlugin", "GraphPlugin", "OperationPlugin", "RuntimePlugin", "SettingsPlugin", "createComposerTestApp", "opts", "plugins", "theme", "rest", "core", "ThemePlugin", "defaultTx", "push", "tx", "createTestApp"]
|
|
7
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createComposerTestApp
|
|
3
|
-
} from "./chunk-G2BI2IZM.mjs";
|
|
4
|
-
|
|
5
|
-
// src/core.ts
|
|
6
|
-
import { OperationPlugin, RuntimePlugin } from "@dxos/app-framework";
|
|
7
|
-
import { AttentionPlugin } from "@dxos/plugin-attention";
|
|
8
|
-
import { GraphPlugin } from "@dxos/plugin-graph";
|
|
9
|
-
import { SettingsPlugin } from "@dxos/plugin-settings";
|
|
10
|
-
import { ThemePlugin } from "@dxos/plugin-theme";
|
|
11
|
-
import { defaultTx } from "@dxos/ui-theme";
|
|
12
|
-
var corePlugins = () => [
|
|
13
|
-
AttentionPlugin(),
|
|
14
|
-
GraphPlugin(),
|
|
15
|
-
OperationPlugin(),
|
|
16
|
-
RuntimePlugin(),
|
|
17
|
-
SettingsPlugin(),
|
|
18
|
-
ThemePlugin({
|
|
19
|
-
tx: defaultTx
|
|
20
|
-
})
|
|
21
|
-
];
|
|
22
|
-
|
|
23
|
-
// src/meta.ts
|
|
24
|
-
import { trim } from "@dxos/util";
|
|
25
|
-
var meta = {
|
|
26
|
-
id: "org.dxos.plugin.storybook-layout",
|
|
27
|
-
name: "Storybook",
|
|
28
|
-
description: trim`
|
|
29
|
-
Development layout optimized for Storybook component testing and documentation.
|
|
30
|
-
Provides specialized views for component development and design system exploration.
|
|
31
|
-
`,
|
|
32
|
-
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-testing"
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
// src/StorybookPlugin.ts
|
|
36
|
-
import * as Effect from "effect/Effect";
|
|
37
|
-
import { ActivationEvents, Capabilities, Capability, Plugin } from "@dxos/app-framework";
|
|
38
|
-
import { AppActivationEvents, AppPlugin } from "@dxos/app-toolkit";
|
|
39
|
-
import { OperationHandler, State } from "#capabilities";
|
|
40
|
-
import { Layout } from "#components";
|
|
41
|
-
import { meta as meta2 } from "#meta";
|
|
42
|
-
var StorybookPlugin = Plugin.define(meta2).pipe(AppPlugin.addOperationHandlerModule({
|
|
43
|
-
activate: OperationHandler
|
|
44
|
-
}), AppPlugin.addReactContextModule({
|
|
45
|
-
activate: () => Effect.succeed(Capability.contributes(Capabilities.ReactContext, {
|
|
46
|
-
id: "storybook-layout",
|
|
47
|
-
context: Layout
|
|
48
|
-
}))
|
|
49
|
-
}), Plugin.addModule(({ initialState }) => ({
|
|
50
|
-
id: Capability.getModuleTag(State),
|
|
51
|
-
activatesOn: ActivationEvents.Startup,
|
|
52
|
-
firesAfterActivation: [
|
|
53
|
-
AppActivationEvents.LayoutReady
|
|
54
|
-
],
|
|
55
|
-
activate: () => State({
|
|
56
|
-
initialState
|
|
57
|
-
})
|
|
58
|
-
})), Plugin.make);
|
|
59
|
-
export {
|
|
60
|
-
StorybookPlugin,
|
|
61
|
-
corePlugins,
|
|
62
|
-
createComposerTestApp,
|
|
63
|
-
meta
|
|
64
|
-
};
|
|
65
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/core.ts", "../../../src/meta.ts", "../../../src/StorybookPlugin.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { OperationPlugin, type Plugin, RuntimePlugin } from '@dxos/app-framework';\nimport { AttentionPlugin } from '@dxos/plugin-attention';\nimport { GraphPlugin } from '@dxos/plugin-graph';\nimport { SettingsPlugin } from '@dxos/plugin-settings';\nimport { ThemePlugin } from '@dxos/plugin-theme';\nimport { defaultTx } from '@dxos/ui-theme';\n\n/**\n * Core plugins for testing/storybook environments.\n * NOTE: Does not include SpacePlugin to avoid circular dependencies.\n * Import SpacePlugin directly in your stories if needed.\n */\nexport const corePlugins = (): Plugin.Plugin[] => [\n AttentionPlugin(),\n GraphPlugin(),\n OperationPlugin(),\n RuntimePlugin(),\n SettingsPlugin(),\n ThemePlugin({ tx: defaultTx }),\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'org.dxos.plugin.storybook-layout',\n name: 'Storybook',\n description: trim`\n Development layout optimized for Storybook component testing and documentation.\n Provides specialized views for component development and design system exploration.\n `,\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-testing',\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { ActivationEvents, Capabilities, Capability, Plugin } from '@dxos/app-framework';\nimport { AppActivationEvents, AppPlugin } from '@dxos/app-toolkit';\n\nimport { OperationHandler, State } from '#capabilities';\nimport { Layout } from '#components';\nimport { meta } from '#meta';\nimport { type LayoutStateProps } from '#types';\n\nexport type StorybookPluginOptions = {\n initialState?: Partial<LayoutStateProps>;\n};\n\nexport const StorybookPlugin = Plugin.define<StorybookPluginOptions>(meta).pipe(\n AppPlugin.addOperationHandlerModule({\n activate: OperationHandler,\n }),\n AppPlugin.addReactContextModule({\n activate: () =>\n Effect.succeed(\n Capability.contributes(Capabilities.ReactContext, {\n id: 'storybook-layout',\n context: Layout,\n }),\n ),\n }),\n Plugin.addModule(({ initialState }) => ({\n id: Capability.getModuleTag(State),\n activatesOn: ActivationEvents.Startup,\n firesAfterActivation: [AppActivationEvents.LayoutReady],\n activate: () => State({ initialState }),\n })),\n Plugin.make,\n);\n"],
|
|
5
|
-
"mappings": ";;;;;AAIA,SAASA,iBAA8BC,qBAAqB;AAC5D,SAASC,uBAAuB;AAChC,SAASC,mBAAmB;AAC5B,SAASC,sBAAsB;AAC/B,SAASC,mBAAmB;AAC5B,SAASC,iBAAiB;AAOnB,IAAMC,cAAc,MAAuB;EAChDC,gBAAAA;EACAC,YAAAA;EACAC,gBAAAA;EACAC,cAAAA;EACAC,eAAAA;EACAC,YAAY;IAAEC,IAAIC;EAAU,CAAA;;;;ACjB9B,SAASC,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;EAIbC,QAAQ;AACV;;;ACXA,YAAYC,YAAY;AAExB,SAASC,kBAAkBC,cAAcC,YAAYC,cAAc;AACnE,SAASC,qBAAqBC,iBAAiB;AAE/C,SAASC,kBAAkBC,aAAa;AACxC,SAASC,cAAc;AACvB,SAASC,QAAAA,aAAY;AAOd,IAAMC,kBAAkBC,OAAOC,OAA+BC,KAAAA,EAAMC,KACzEC,UAAUC,0BAA0B;EAClCC,UAAUC;AACZ,CAAA,GACAH,UAAUI,sBAAsB;EAC9BF,UAAU,MACDG,eACLC,WAAWC,YAAYC,aAAaC,cAAc;IAChDC,IAAI;IACJC,SAASC;EACX,CAAA,CAAA;AAEN,CAAA,GACAhB,OAAOiB,UAAU,CAAC,EAAEC,aAAY,OAAQ;EACtCJ,IAAIJ,WAAWS,aAAaC,KAAAA;EAC5BC,aAAaC,iBAAiBC;EAC9BC,sBAAsB;IAACC,oBAAoBC;;EAC3CpB,UAAU,MAAMc,MAAM;IAAEF;EAAa,CAAA;AACvC,EAAA,GACAlB,OAAO2B,IAAI;",
|
|
6
|
-
"names": ["OperationPlugin", "RuntimePlugin", "AttentionPlugin", "GraphPlugin", "SettingsPlugin", "ThemePlugin", "defaultTx", "corePlugins", "AttentionPlugin", "GraphPlugin", "OperationPlugin", "RuntimePlugin", "SettingsPlugin", "ThemePlugin", "tx", "defaultTx", "trim", "meta", "id", "name", "description", "trim", "source", "Effect", "ActivationEvents", "Capabilities", "Capability", "Plugin", "AppActivationEvents", "AppPlugin", "OperationHandler", "State", "Layout", "meta", "StorybookPlugin", "Plugin", "define", "meta", "pipe", "AppPlugin", "addOperationHandlerModule", "activate", "OperationHandler", "addReactContextModule", "succeed", "Capability", "contributes", "Capabilities", "ReactContext", "id", "context", "Layout", "addModule", "initialState", "getModuleTag", "State", "activatesOn", "ActivationEvents", "Startup", "firesAfterActivation", "AppActivationEvents", "LayoutReady", "make"]
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"inputs":{"src/core.ts":{"bytes":2660,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-attention","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-settings","kind":"import-statement","external":true},{"path":"@dxos/plugin-theme","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"format":"esm"},"src/harness.ts":{"bytes":5259,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/testing","kind":"import-statement","external":true},{"path":"@dxos/plugin-attention","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-settings","kind":"import-statement","external":true},{"path":"@dxos/plugin-theme","kind":"dynamic-import","external":true},{"path":"@dxos/ui-theme","kind":"dynamic-import","external":true}],"format":"esm"},"src/meta.ts":{"bytes":1661,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/StorybookPlugin.ts":{"bytes":4323,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#components","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":724,"imports":[{"path":"src/core.ts","kind":"import-statement","original":"./core"},{"path":"src/harness.ts","kind":"import-statement","original":"./harness"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/StorybookPlugin.ts","kind":"import-statement","original":"./StorybookPlugin"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4424},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-G2BI2IZM.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-attention","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-settings","kind":"import-statement","external":true},{"path":"@dxos/plugin-theme","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#components","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"exports":["StorybookPlugin","corePlugins","createComposerTestApp","meta"],"entryPoint":"src/index.ts","inputs":{"src/core.ts":{"bytesInOutput":494},"src/index.ts":{"bytesInOutput":0},"src/meta.ts":{"bytesInOutput":395},"src/StorybookPlugin.ts":{"bytesInOutput":884}},"bytes":2009},"dist/lib/browser/harness.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/harness.mjs":{"imports":[{"path":"dist/lib/browser/chunk-G2BI2IZM.mjs","kind":"import-statement"}],"exports":["createComposerTestApp"],"entryPoint":"src/harness.ts","inputs":{},"bytes":137},"dist/lib/browser/chunk-G2BI2IZM.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2872},"dist/lib/browser/chunk-G2BI2IZM.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/testing","kind":"import-statement","external":true},{"path":"@dxos/plugin-attention","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-settings","kind":"import-statement","external":true},{"path":"@dxos/plugin-theme","kind":"dynamic-import","external":true},{"path":"@dxos/ui-theme","kind":"dynamic-import","external":true}],"exports":["createComposerTestApp"],"inputs":{"src/harness.ts":{"bytesInOutput":873}},"bytes":972}}}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
|
|
3
|
-
// src/harness.ts
|
|
4
|
-
import { OperationPlugin, RuntimePlugin } from "@dxos/app-framework";
|
|
5
|
-
import { createTestApp } from "@dxos/app-framework/testing";
|
|
6
|
-
import { AttentionPlugin } from "@dxos/plugin-attention";
|
|
7
|
-
import { GraphPlugin } from "@dxos/plugin-graph";
|
|
8
|
-
import { SettingsPlugin } from "@dxos/plugin-settings";
|
|
9
|
-
var headlessCorePlugins = () => [
|
|
10
|
-
AttentionPlugin(),
|
|
11
|
-
GraphPlugin(),
|
|
12
|
-
OperationPlugin(),
|
|
13
|
-
RuntimePlugin(),
|
|
14
|
-
SettingsPlugin()
|
|
15
|
-
];
|
|
16
|
-
var createComposerTestApp = async (opts = {}) => {
|
|
17
|
-
const { plugins = [], theme = false, ...rest } = opts;
|
|
18
|
-
const core = headlessCorePlugins();
|
|
19
|
-
if (theme) {
|
|
20
|
-
const { ThemePlugin } = await import("@dxos/plugin-theme");
|
|
21
|
-
const { defaultTx } = await import("@dxos/ui-theme");
|
|
22
|
-
core.push(ThemePlugin({
|
|
23
|
-
tx: defaultTx
|
|
24
|
-
}));
|
|
25
|
-
}
|
|
26
|
-
return createTestApp({
|
|
27
|
-
...rest,
|
|
28
|
-
plugins: [
|
|
29
|
-
...core,
|
|
30
|
-
...plugins
|
|
31
|
-
]
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export {
|
|
36
|
-
createComposerTestApp
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=chunk-U342VJPQ.mjs.map
|