@dxos/plugin-testing 0.8.4-main.7996785055 → 0.8.4-main.8baae0fced
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/LICENSE +102 -5
- package/dist/lib/neutral/StorybookPlugin.mjs +10 -0
- package/dist/lib/neutral/StorybookPlugin.mjs.map +7 -0
- package/dist/lib/{browser/add-toast-M6ZVP2PQ.mjs → neutral/add-toast-Z2RXG4RX.mjs} +5 -4
- package/dist/lib/{node-esm/add-toast-VMEADC7Y.mjs.map → neutral/add-toast-Z2RXG4RX.mjs.map} +1 -1
- package/dist/lib/neutral/capabilities/index.mjs +11 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-7PCQ6HGV.mjs +21 -0
- package/dist/lib/neutral/chunk-7PCQ6HGV.mjs.map +7 -0
- package/dist/lib/{browser/chunk-F2MMDTKN.mjs → neutral/chunk-G6UPW2TF.mjs} +3 -7
- package/dist/lib/neutral/chunk-G6UPW2TF.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -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-S4IEYCPX.mjs +8 -0
- package/dist/lib/neutral/chunk-S4IEYCPX.mjs.map +7 -0
- package/dist/lib/{browser/chunk-M4TYMLOE.mjs → neutral/chunk-ULNF6GTG.mjs} +4 -4
- package/dist/lib/neutral/chunk-ULNF6GTG.mjs.map +7 -0
- package/dist/lib/{browser/close-M6YHTWUZ.mjs → neutral/close-L3FBJQ3J.mjs} +4 -2
- package/dist/lib/neutral/close-L3FBJQ3J.mjs.map +7 -0
- package/dist/lib/{browser → neutral/components}/index.mjs +12 -64
- 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/neutral/harness.mjs +36 -0
- 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-O5FFJF2B.mjs +17 -0
- package/dist/lib/neutral/open-O5FFJF2B.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/{browser/scroll-into-view-UAINWR6E.mjs → neutral/scroll-into-view-BKOOOECC.mjs} +4 -2
- package/dist/lib/neutral/scroll-into-view-BKOOOECC.mjs.map +7 -0
- package/dist/lib/{browser/set-layout-mode-E6SJ6ATN.mjs → neutral/set-layout-mode-2KHD2AEY.mjs} +4 -2
- package/dist/lib/neutral/set-layout-mode-2KHD2AEY.mjs.map +7 -0
- package/dist/lib/{browser/state-MRRN7LZE.mjs → neutral/state-AJ62JEEG.mjs} +5 -6
- package/dist/lib/neutral/state-AJ62JEEG.mjs.map +7 -0
- package/dist/lib/{browser/switch-workspace-RPYF6M6L.mjs → neutral/switch-workspace-SAT2NGXV.mjs} +5 -4
- package/dist/lib/{node-esm/switch-workspace-ZDUCWF6E.mjs.map → neutral/switch-workspace-SAT2NGXV.mjs.map} +1 -1
- package/dist/lib/neutral/types/index.mjs +8 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/lib/{browser/update-complementary-HNS4FIWF.mjs → neutral/update-complementary-JP2OL73Z.mjs} +5 -4
- package/dist/lib/{node-esm/update-complementary-LAPUAZ5I.mjs.map → neutral/update-complementary-JP2OL73Z.mjs.map} +1 -1
- package/dist/lib/{browser/update-dialog-W7QOCQ2N.mjs → neutral/update-dialog-MX6IKKJX.mjs} +5 -4
- package/dist/lib/{node-esm/update-dialog-5M7FL4XG.mjs.map → neutral/update-dialog-MX6IKKJX.mjs.map} +1 -1
- package/dist/lib/{browser/update-popover-UELZDJW6.mjs → neutral/update-popover-DOORE3TD.mjs} +5 -4
- package/dist/lib/neutral/update-popover-DOORE3TD.mjs.map +7 -0
- package/dist/lib/{browser/update-sidebar-RJZTREDE.mjs → neutral/update-sidebar-LWQ3IA6S.mjs} +5 -4
- package/dist/lib/{node-esm/update-sidebar-CU6TUDK5.mjs.map → neutral/update-sidebar-LWQ3IA6S.mjs.map} +1 -1
- 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 +15 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/{operation-handler/operation-handler.d.ts → operation-handler.d.ts} +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/{state/state.d.ts → state.d.ts} +3 -3
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- 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 +20 -0
- package/dist/types/src/harness.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.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 +60 -17
- package/src/StorybookPlugin.ts +8 -6
- package/src/capabilities/index.ts +8 -2
- package/src/capabilities/{operation-handler/operation-handler.ts → operation-handler.ts} +2 -2
- package/src/capabilities/{state/state.tsx → state.tsx} +8 -5
- package/src/components/Layout/Layout.tsx +16 -10
- package/src/core.ts +19 -7
- package/src/harness.ts +51 -0
- package/src/index.ts +6 -0
- package/src/meta.ts +1 -0
- 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 +8 -2
- 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} +3 -1
- package/src/types/index.ts +1 -1
- package/dist/lib/browser/add-toast-M6ZVP2PQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-F2MMDTKN.mjs.map +0 -7
- package/dist/lib/browser/chunk-M4TYMLOE.mjs.map +0 -7
- package/dist/lib/browser/close-M6YHTWUZ.mjs.map +0 -7
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/open-ND4QPYWD.mjs +0 -10
- package/dist/lib/browser/open-ND4QPYWD.mjs.map +0 -7
- package/dist/lib/browser/operation-handler-DUWMXELV.mjs +0 -16
- package/dist/lib/browser/operation-handler-DUWMXELV.mjs.map +0 -7
- package/dist/lib/browser/scroll-into-view-UAINWR6E.mjs.map +0 -7
- package/dist/lib/browser/set-layout-mode-E6SJ6ATN.mjs.map +0 -7
- package/dist/lib/browser/state-MRRN7LZE.mjs.map +0 -7
- package/dist/lib/browser/switch-workspace-RPYF6M6L.mjs.map +0 -7
- package/dist/lib/browser/update-complementary-HNS4FIWF.mjs.map +0 -7
- package/dist/lib/browser/update-dialog-W7QOCQ2N.mjs.map +0 -7
- package/dist/lib/browser/update-popover-UELZDJW6.mjs.map +0 -7
- package/dist/lib/browser/update-sidebar-RJZTREDE.mjs.map +0 -7
- package/dist/lib/node-esm/add-toast-VMEADC7Y.mjs +0 -23
- package/dist/lib/node-esm/chunk-VDX7GMAD.mjs +0 -23
- package/dist/lib/node-esm/chunk-VDX7GMAD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZLM7QUEK.mjs +0 -22
- package/dist/lib/node-esm/chunk-ZLM7QUEK.mjs.map +0 -7
- package/dist/lib/node-esm/close-B54TW3OK.mjs +0 -12
- package/dist/lib/node-esm/close-B54TW3OK.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -236
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/open-OLJQ7VR3.mjs +0 -12
- package/dist/lib/node-esm/open-OLJQ7VR3.mjs.map +0 -7
- package/dist/lib/node-esm/operation-handler-TCIEZXBS.mjs +0 -18
- package/dist/lib/node-esm/operation-handler-TCIEZXBS.mjs.map +0 -7
- package/dist/lib/node-esm/scroll-into-view-C3XK4YMK.mjs +0 -12
- package/dist/lib/node-esm/scroll-into-view-C3XK4YMK.mjs.map +0 -7
- package/dist/lib/node-esm/set-layout-mode-AEQI6AVR.mjs +0 -12
- package/dist/lib/node-esm/set-layout-mode-AEQI6AVR.mjs.map +0 -7
- package/dist/lib/node-esm/state-PVDE6Q6G.mjs +0 -45
- package/dist/lib/node-esm/state-PVDE6Q6G.mjs.map +0 -7
- package/dist/lib/node-esm/switch-workspace-ZDUCWF6E.mjs +0 -20
- package/dist/lib/node-esm/update-complementary-LAPUAZ5I.mjs +0 -26
- package/dist/lib/node-esm/update-dialog-5M7FL4XG.mjs +0 -28
- package/dist/lib/node-esm/update-popover-2TDGFHL3.mjs +0 -46
- package/dist/lib/node-esm/update-popover-2TDGFHL3.mjs.map +0 -7
- package/dist/lib/node-esm/update-sidebar-CU6TUDK5.mjs +0 -26
- package/dist/types/src/capabilities/operation-handler/index.d.ts +0 -4
- package/dist/types/src/capabilities/operation-handler/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/index.d.ts +0 -14
- package/dist/types/src/capabilities/state/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/state.d.ts.map +0 -1
- package/dist/types/src/types/capabilities.d.ts.map +0 -1
- package/src/capabilities/operation-handler/index.ts +0 -11
- package/src/capabilities/state/index.ts +0 -7
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.8baae0fced",
|
|
4
4
|
"description": "Plugin testing utils",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -8,15 +8,57 @@
|
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "https://github.com/dxos/dxos"
|
|
10
10
|
},
|
|
11
|
-
"license": "
|
|
11
|
+
"license": "FSL-1.1-Apache-2.0",
|
|
12
12
|
"author": "DXOS.org",
|
|
13
13
|
"sideEffects": true,
|
|
14
14
|
"type": "module",
|
|
15
|
+
"imports": {
|
|
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
|
+
}
|
|
46
|
+
},
|
|
15
47
|
"exports": {
|
|
16
48
|
".": {
|
|
17
49
|
"source": "./src/index.ts",
|
|
18
50
|
"types": "./dist/types/src/index.d.ts",
|
|
19
|
-
"
|
|
51
|
+
"default": "./dist/lib/neutral/index.mjs"
|
|
52
|
+
},
|
|
53
|
+
"./harness": {
|
|
54
|
+
"source": "./src/harness.ts",
|
|
55
|
+
"types": "./dist/types/src/harness.d.ts",
|
|
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"
|
|
20
62
|
}
|
|
21
63
|
},
|
|
22
64
|
"types": "dist/types/src/index.d.ts",
|
|
@@ -27,15 +69,16 @@
|
|
|
27
69
|
"dependencies": {
|
|
28
70
|
"@effect-atom/atom": "^0.5.1",
|
|
29
71
|
"@effect-atom/atom-react": "^0.5.0",
|
|
30
|
-
"@dxos/app-
|
|
31
|
-
"@dxos/
|
|
32
|
-
"@dxos/plugin-attention": "0.8.4-main.
|
|
33
|
-
"@dxos/
|
|
34
|
-
"@dxos/
|
|
35
|
-
"@dxos/
|
|
36
|
-
"@dxos/plugin-theme": "0.8.4-main.
|
|
37
|
-
"@dxos/
|
|
38
|
-
"@dxos/
|
|
72
|
+
"@dxos/app-toolkit": "0.8.4-main.8baae0fced",
|
|
73
|
+
"@dxos/log": "0.8.4-main.8baae0fced",
|
|
74
|
+
"@dxos/plugin-attention": "0.8.4-main.8baae0fced",
|
|
75
|
+
"@dxos/compute": "0.8.4-main.8baae0fced",
|
|
76
|
+
"@dxos/app-framework": "0.8.4-main.8baae0fced",
|
|
77
|
+
"@dxos/plugin-graph": "0.8.4-main.8baae0fced",
|
|
78
|
+
"@dxos/plugin-theme": "0.8.4-main.8baae0fced",
|
|
79
|
+
"@dxos/util": "0.8.4-main.8baae0fced",
|
|
80
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.8baae0fced",
|
|
81
|
+
"@dxos/plugin-settings": "0.8.4-main.8baae0fced"
|
|
39
82
|
},
|
|
40
83
|
"devDependencies": {
|
|
41
84
|
"@types/react": "~19.2.7",
|
|
@@ -43,16 +86,16 @@
|
|
|
43
86
|
"effect": "3.20.0",
|
|
44
87
|
"react": "~19.2.3",
|
|
45
88
|
"react-dom": "~19.2.3",
|
|
46
|
-
"vite": "^
|
|
47
|
-
"@dxos/ui
|
|
48
|
-
"@dxos/
|
|
89
|
+
"vite": "^8.0.13",
|
|
90
|
+
"@dxos/react-ui": "0.8.4-main.8baae0fced",
|
|
91
|
+
"@dxos/ui-theme": "0.8.4-main.8baae0fced"
|
|
49
92
|
},
|
|
50
93
|
"peerDependencies": {
|
|
51
94
|
"effect": "3.20.0",
|
|
52
95
|
"react": "~19.2.3",
|
|
53
96
|
"react-dom": "~19.2.3",
|
|
54
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
55
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
97
|
+
"@dxos/react-ui": "0.8.4-main.8baae0fced",
|
|
98
|
+
"@dxos/ui-theme": "0.8.4-main.8baae0fced"
|
|
56
99
|
},
|
|
57
100
|
"publishConfig": {
|
|
58
101
|
"access": "public"
|
package/src/StorybookPlugin.ts
CHANGED
|
@@ -7,13 +7,13 @@ import * as Effect from 'effect/Effect';
|
|
|
7
7
|
import { ActivationEvents, Capabilities, Capability, Plugin } from '@dxos/app-framework';
|
|
8
8
|
import { AppActivationEvents, AppPlugin } from '@dxos/app-toolkit';
|
|
9
9
|
|
|
10
|
-
import { OperationHandler, State } from '
|
|
11
|
-
import { Layout } from '
|
|
12
|
-
import { meta } from '
|
|
13
|
-
import {
|
|
10
|
+
import { OperationHandler, State } from '#capabilities';
|
|
11
|
+
import { Layout } from '#components';
|
|
12
|
+
import { meta } from '#meta';
|
|
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(
|
|
@@ -32,8 +32,10 @@ export const StorybookPlugin = Plugin.define<StorybookPluginOptions>(meta).pipe(
|
|
|
32
32
|
Plugin.addModule(({ initialState }) => ({
|
|
33
33
|
id: Capability.getModuleTag(State),
|
|
34
34
|
activatesOn: ActivationEvents.Startup,
|
|
35
|
-
|
|
35
|
+
firesAfterActivation: [AppActivationEvents.LayoutReady],
|
|
36
36
|
activate: () => State({ initialState }),
|
|
37
37
|
})),
|
|
38
38
|
Plugin.make,
|
|
39
39
|
);
|
|
40
|
+
|
|
41
|
+
export default StorybookPlugin;
|
|
@@ -2,5 +2,11 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
|
+
import { OperationHandlerSet } from '@dxos/compute';
|
|
7
|
+
|
|
8
|
+
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
9
|
+
'OperationHandler',
|
|
10
|
+
() => import('./operation-handler'),
|
|
11
|
+
);
|
|
12
|
+
export const State = Capability.lazy('State', () => import('./state'));
|
|
@@ -5,9 +5,9 @@
|
|
|
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
|
-
import { TestingOperationHandlerSet } from '
|
|
10
|
+
import { TestingOperationHandlerSet } from '#operations';
|
|
11
11
|
|
|
12
12
|
export default Capability.makeModule<OperationHandlerSet.OperationHandlerSet>(
|
|
13
13
|
Effect.fnUntraced(function* () {
|
|
@@ -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
|
);
|
|
@@ -7,6 +7,7 @@ import React, { type PropsWithChildren, useCallback, useContext, useEffect, useR
|
|
|
7
7
|
|
|
8
8
|
import { Surface, useCapability } from '@dxos/app-framework/ui';
|
|
9
9
|
import { type LayoutOperation } from '@dxos/app-toolkit';
|
|
10
|
+
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
10
11
|
import {
|
|
11
12
|
AlertDialog,
|
|
12
13
|
Button,
|
|
@@ -23,8 +24,8 @@ import { Card } from '@dxos/react-ui';
|
|
|
23
24
|
import { Mosaic } from '@dxos/react-ui-mosaic';
|
|
24
25
|
import { descriptionMessage, mx } from '@dxos/ui-theme';
|
|
25
26
|
|
|
26
|
-
import { meta } from '
|
|
27
|
-
import {
|
|
27
|
+
import { meta } from '#meta';
|
|
28
|
+
import { StorybookCapabilities } from '#types';
|
|
28
29
|
|
|
29
30
|
const debounce_delay = 100;
|
|
30
31
|
|
|
@@ -70,14 +71,14 @@ export const Layout = ({ children }: PropsWithChildren<{}>) => {
|
|
|
70
71
|
const { t } = useTranslation(meta.id);
|
|
71
72
|
const trigger = useRef<HTMLButtonElement | null>(null);
|
|
72
73
|
const registry = useContext(RegistryContext);
|
|
73
|
-
const stateAtom = useCapability(LayoutState);
|
|
74
|
+
const stateAtom = useCapability(StorybookCapabilities.LayoutState);
|
|
74
75
|
const layout = useAtomValue(stateAtom);
|
|
75
76
|
const [iter, setIter] = useState(0);
|
|
76
77
|
const [open, setOpen] = useState(false);
|
|
77
78
|
const debounceRef = useRef<NodeJS.Timeout | null>(null);
|
|
78
79
|
|
|
79
80
|
const updateState = useCallback(
|
|
80
|
-
(updates: Partial<LayoutStateProps>) => {
|
|
81
|
+
(updates: Partial<StorybookCapabilities.LayoutStateProps>) => {
|
|
81
82
|
const current = registry.get(stateAtom);
|
|
82
83
|
registry.set(stateAtom, { ...current, ...updates });
|
|
83
84
|
},
|
|
@@ -134,7 +135,7 @@ export const Layout = ({ children }: PropsWithChildren<{}>) => {
|
|
|
134
135
|
|
|
135
136
|
return (
|
|
136
137
|
<Toast.Provider>
|
|
137
|
-
<div
|
|
138
|
+
<div className='fixed inset-0 flex overflow-hidden'>
|
|
138
139
|
<Mosaic.Root>
|
|
139
140
|
<Popover.Root open={open}>
|
|
140
141
|
<Main.Root
|
|
@@ -153,7 +154,7 @@ export const Layout = ({ children }: PropsWithChildren<{}>) => {
|
|
|
153
154
|
>
|
|
154
155
|
{layout.dialogBlockAlign === 'end' ? (
|
|
155
156
|
<Surface.Surface
|
|
156
|
-
|
|
157
|
+
type={AppSurface.Dialog}
|
|
157
158
|
data={layout.dialogContent}
|
|
158
159
|
limit={1}
|
|
159
160
|
fallback={ErrorFallback}
|
|
@@ -165,7 +166,12 @@ export const Layout = ({ children }: PropsWithChildren<{}>) => {
|
|
|
165
166
|
classNames={layout.dialogOverlayClasses}
|
|
166
167
|
style={layout.dialogOverlayStyle}
|
|
167
168
|
>
|
|
168
|
-
<Surface.Surface
|
|
169
|
+
<Surface.Surface
|
|
170
|
+
type={AppSurface.Dialog}
|
|
171
|
+
data={layout.dialogContent}
|
|
172
|
+
limit={1}
|
|
173
|
+
fallback={ErrorFallback}
|
|
174
|
+
/>
|
|
169
175
|
</DialogOverlay>
|
|
170
176
|
)}
|
|
171
177
|
</DialogRoot>
|
|
@@ -192,11 +198,11 @@ export const Layout = ({ children }: PropsWithChildren<{}>) => {
|
|
|
192
198
|
)}
|
|
193
199
|
<Card.CloseIconButton onClick={handleClose} />
|
|
194
200
|
</Card.Toolbar>
|
|
195
|
-
<Surface.Surface
|
|
201
|
+
<Surface.Surface type={AppSurface.Card} data={layout.popoverContent} limit={1} />
|
|
196
202
|
</Card.Root>
|
|
197
203
|
)}
|
|
198
204
|
{layout.popoverKind === 'base' && (
|
|
199
|
-
<Surface.Surface
|
|
205
|
+
<Surface.Surface type={AppSurface.Popover} data={layout.popoverContent} limit={1} />
|
|
200
206
|
)}
|
|
201
207
|
</Popover.Viewport>
|
|
202
208
|
<Popover.Arrow />
|
|
@@ -223,7 +229,7 @@ export const ErrorFallback = ({ error }: { error?: Error }) => {
|
|
|
223
229
|
className={mx('overflow-auto p-8 dx-attention-surface grid place-items-center')}
|
|
224
230
|
>
|
|
225
231
|
<p className={mx(descriptionMessage, 'break-words rounded-md p-8', errorString.length < 256 && 'text-lg')}>
|
|
226
|
-
{error ? errorString : t('error
|
|
232
|
+
{error ? errorString : t('error-fallback.message')}
|
|
227
233
|
</p>
|
|
228
234
|
</div>
|
|
229
235
|
);
|
package/src/core.ts
CHANGED
|
@@ -2,11 +2,24 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import
|
|
9
|
-
import
|
|
5
|
+
import { type Plugin, ProcessManagerPlugin } from '@dxos/app-framework';
|
|
6
|
+
// `/testing` entrypoints re-export the plugin eagerly (without `Plugin.lazy`).
|
|
7
|
+
// The default `.` and `/plugin` exports wrap each plugin in a lazy stub
|
|
8
|
+
// (`() => import('./XPlugin')`), which webkit cannot reliably resolve under
|
|
9
|
+
// vite-dev: the dynamic-import promise can settle with a partially-evaluated
|
|
10
|
+
// namespace, throwing `ReferenceError: Cannot access 'default' before
|
|
11
|
+
// initialization` from the loader's `mod.default` access. Storybook runs
|
|
12
|
+
// inside `storybook dev` (vite-dev) and is currently the only host that hits
|
|
13
|
+
// this. Production hosts (composer-app via `vite preview`) keep using the
|
|
14
|
+
// lazy `.` exports and their associated code splitting.
|
|
15
|
+
//
|
|
16
|
+
// Use these `/testing` entrypoints from any storybook `withPluginManager`
|
|
17
|
+
// setup. The single-line `export * from './XPlugin'` re-exports avoid the
|
|
18
|
+
// dynamic-import path entirely — see e.g. `plugin-attention/src/testing.ts`.
|
|
19
|
+
import { AttentionPlugin } from '@dxos/plugin-attention/testing';
|
|
20
|
+
import { GraphPlugin } from '@dxos/plugin-graph/testing';
|
|
21
|
+
import { SettingsPlugin } from '@dxos/plugin-settings/testing';
|
|
22
|
+
import { ThemePlugin } from '@dxos/plugin-theme/testing';
|
|
10
23
|
import { defaultTx } from '@dxos/ui-theme';
|
|
11
24
|
|
|
12
25
|
/**
|
|
@@ -17,8 +30,7 @@ import { defaultTx } from '@dxos/ui-theme';
|
|
|
17
30
|
export const corePlugins = (): Plugin.Plugin[] => [
|
|
18
31
|
AttentionPlugin(),
|
|
19
32
|
GraphPlugin(),
|
|
20
|
-
|
|
21
|
-
RuntimePlugin(),
|
|
33
|
+
ProcessManagerPlugin(),
|
|
22
34
|
SettingsPlugin(),
|
|
23
35
|
ThemePlugin({ tx: defaultTx }),
|
|
24
36
|
];
|
package/src/harness.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Plugin, ProcessManagerPlugin } from '@dxos/app-framework';
|
|
6
|
+
import { createTestApp, type TestAppOptions, type TestHarness } from '@dxos/app-framework/testing';
|
|
7
|
+
import { AttentionPlugin } from '@dxos/plugin-attention/testing';
|
|
8
|
+
import { GraphPlugin } from '@dxos/plugin-graph/testing';
|
|
9
|
+
import { SettingsPlugin } from '@dxos/plugin-settings/testing';
|
|
10
|
+
|
|
11
|
+
export type ComposerTestAppOptions = Omit<TestAppOptions, 'plugins'> & {
|
|
12
|
+
/** Plugins to register in addition to the Composer core plugins. */
|
|
13
|
+
plugins?: Plugin.Plugin[];
|
|
14
|
+
/**
|
|
15
|
+
* Whether to include `ThemePlugin` in the core plugin set.
|
|
16
|
+
* Defaults to `false` — `ThemePlugin` requires a browser DOM and breaks Node-only tests.
|
|
17
|
+
* Set to `true` (with jsdom/happy-dom) when rendering React surfaces.
|
|
18
|
+
*/
|
|
19
|
+
theme?: boolean;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Headless core plugins for the test harness — the subset of `corePlugins()`
|
|
24
|
+
* that can be activated without a browser DOM.
|
|
25
|
+
*/
|
|
26
|
+
const headlessCorePlugins = (): Plugin.Plugin[] => [
|
|
27
|
+
AttentionPlugin(),
|
|
28
|
+
GraphPlugin(),
|
|
29
|
+
ProcessManagerPlugin(),
|
|
30
|
+
SettingsPlugin(),
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Creates a TestHarness pre-loaded with the Composer core plugins
|
|
35
|
+
* (Attention, Graph, ProcessManager, Settings, optionally Theme).
|
|
36
|
+
*
|
|
37
|
+
* For a ClientPlugin-backed harness, pass `ClientPlugin({ ... })` via `plugins`.
|
|
38
|
+
*/
|
|
39
|
+
export const createComposerTestApp = async (opts: ComposerTestAppOptions = {}): Promise<TestHarness> => {
|
|
40
|
+
const { plugins = [], theme = false, ...rest } = opts;
|
|
41
|
+
const core = headlessCorePlugins();
|
|
42
|
+
if (theme) {
|
|
43
|
+
const { ThemePlugin } = await import('@dxos/plugin-theme/testing');
|
|
44
|
+
const { defaultTx } = await import('@dxos/ui-theme');
|
|
45
|
+
core.push(ThemePlugin({ tx: defaultTx }));
|
|
46
|
+
}
|
|
47
|
+
return createTestApp({
|
|
48
|
+
...rest,
|
|
49
|
+
plugins: [...core, ...plugins],
|
|
50
|
+
});
|
|
51
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -4,5 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
export * from './core';
|
|
6
6
|
export * from './meta';
|
|
7
|
+
export * from './types';
|
|
7
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.
|
|
8
14
|
export * from './StorybookPlugin';
|
package/src/meta.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { trim } from '@dxos/util';
|
|
|
8
8
|
export const meta: Plugin.Meta = {
|
|
9
9
|
id: 'org.dxos.plugin.storybook-layout',
|
|
10
10
|
name: 'Storybook',
|
|
11
|
+
author: 'DXOS',
|
|
11
12
|
description: trim`
|
|
12
13
|
Development layout optimized for Storybook component testing and documentation.
|
|
13
14
|
Provides specialized views for component development and design system exploration.
|
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,10 +5,16 @@
|
|
|
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
|
+
import { log } from '@dxos/log';
|
|
9
10
|
|
|
10
11
|
const handler: Operation.WithHandler<typeof LayoutOperation.Open> = LayoutOperation.Open.pipe(
|
|
11
|
-
Operation.withHandler(
|
|
12
|
+
Operation.withHandler(
|
|
13
|
+
Effect.fnUntraced(function* (input) {
|
|
14
|
+
log('LayoutOperation.Open handler start');
|
|
15
|
+
return input.subject;
|
|
16
|
+
}),
|
|
17
|
+
),
|
|
12
18
|
);
|
|
13
19
|
|
|
14
20
|
export default handler;
|
|
@@ -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';
|
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
5
7
|
import { type Atom } from '@effect-atom/atom-react';
|
|
6
8
|
|
|
7
9
|
import { Capability } from '@dxos/app-framework';
|
|
8
10
|
import { type LayoutOperation } from '@dxos/app-toolkit';
|
|
9
11
|
import { type Label } from '@dxos/react-ui';
|
|
10
12
|
|
|
11
|
-
import { meta } from '
|
|
13
|
+
import { meta } from '#meta';
|
|
12
14
|
|
|
13
15
|
export type LayoutStateProps = {
|
|
14
16
|
sidebarState?: 'expanded' | 'collapsed' | 'closed';
|
package/src/types/index.ts
CHANGED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/operations/add-toast.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/operation';\n\nimport { updateState } from './update-state';\n\nconst handler: Operation.WithHandler<typeof LayoutOperation.AddToast> = LayoutOperation.AddToast.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* (input) {\n yield* updateState((state) => ({\n toasts: [...state.toasts, input as LayoutOperation.Toast],\n }));\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,uBAAuB;AAChC,SAASC,iBAAiB;AAI1B,IAAMC,UAAkEC,gBAAgBC,SAASC,KAC/FC,UAAUC,YACDC,kBAAW,WAAWC,OAAK;AAChC,SAAOC,YAAY,CAACC,WAAW;IAC7BC,QAAQ;SAAID,MAAMC;MAAQH;;EAC5B,EAAA;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,oBAAeP;",
|
|
6
|
-
"names": ["Effect", "LayoutOperation", "Operation", "handler", "LayoutOperation", "AddToast", "pipe", "Operation", "withHandler", "fnUntraced", "input", "updateState", "state", "toasts"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts", "../../../src/types/capabilities.ts"],
|
|
4
|
-
"sourcesContent": ["//\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 2025 DXOS.org\n//\n\nimport { type Atom } from '@effect-atom/atom-react';\n\nimport { Capability } from '@dxos/app-framework';\nimport { type LayoutOperation } from '@dxos/app-toolkit';\nimport { type Label } from '@dxos/react-ui';\n\nimport { meta } from '../meta';\n\nexport type LayoutStateProps = {\n sidebarState?: 'expanded' | 'collapsed' | 'closed';\n complementarySidebarState?: 'expanded' | 'collapsed' | 'closed';\n\n dialogOpen: boolean;\n dialogType?: 'default' | 'alert';\n dialogBlockAlign?: 'start' | 'center' | 'end';\n dialogOverlayClasses?: string;\n dialogOverlayStyle?: Record<string, any>;\n /** Data to be passed to the dialog Surface. */\n dialogContent?: any;\n\n popoverOpen?: boolean;\n popoverSide?: 'top' | 'right' | 'bottom' | 'left';\n popoverVariant?: 'virtual' | 'react';\n popoverAnchor?: HTMLButtonElement;\n popoverAnchorId?: string;\n popoverKind?: 'base' | 'card';\n popoverTitle?: Label;\n popoverContent?: any;\n\n toasts: LayoutOperation.Toast[];\n\n workspace: string;\n};\n\nexport const LayoutState = Capability.make<Atom.Writable<LayoutStateProps>>(`${meta.id}.state`);\n"],
|
|
5
|
-
"mappings": ";AAKA,SAASA,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;EAIbC,QAAQ;AACV;;;ACTA,SAASC,kBAAkB;AAgCpB,IAAMC,cAAcC,WAAWC,KAAsC,GAAGC,KAAKC,EAAE,QAAQ;",
|
|
6
|
-
"names": ["trim", "meta", "id", "name", "description", "trim", "source", "Capability", "LayoutState", "Capability", "make", "meta", "id"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/operations/update-state.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\n\nimport { LayoutState, type LayoutStateProps } from '../types';\n\nexport const updateState = (fn: (state: LayoutStateProps) => Partial<LayoutStateProps>) =>\n Effect.gen(function* () {\n const registry = yield* Capability.get(Capabilities.AtomRegistry);\n const stateAtom = yield* Capability.get(LayoutState);\n const current = registry.get(stateAtom);\n registry.set(stateAtom, { ...current, ...fn(current) });\n });\n"],
|
|
5
|
-
"mappings": ";;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AAIlC,IAAMC,cAAc,CAACC,OACnBC,WAAI,aAAA;AACT,QAAMC,WAAW,OAAOC,WAAWC,IAAIC,aAAaC,YAAY;AAChE,QAAMC,YAAY,OAAOJ,WAAWC,IAAII,WAAAA;AACxC,QAAMC,UAAUP,SAASE,IAAIG,SAAAA;AAC7BL,WAASQ,IAAIH,WAAW;IAAE,GAAGE;IAAS,GAAGT,GAAGS,OAAAA;EAAS,CAAA;AACvD,CAAA;",
|
|
6
|
-
"names": ["Effect", "Capabilities", "Capability", "updateState", "fn", "gen", "registry", "Capability", "get", "Capabilities", "AtomRegistry", "stateAtom", "LayoutState", "current", "set"]
|
|
7
|
-
}
|