@dxos/plugin-testing 0.8.4-main.69d29f4 → 0.8.4-main.7996785055

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.
Files changed (144) hide show
  1. package/dist/lib/browser/add-toast-M6ZVP2PQ.mjs +22 -0
  2. package/dist/lib/browser/add-toast-M6ZVP2PQ.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-YHPXIILW.mjs → chunk-F2MMDTKN.mjs} +3 -3
  4. package/dist/lib/browser/chunk-F2MMDTKN.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-M4TYMLOE.mjs +21 -0
  6. package/dist/lib/browser/chunk-M4TYMLOE.mjs.map +7 -0
  7. package/dist/lib/browser/close-M6YHTWUZ.mjs +10 -0
  8. package/dist/lib/browser/close-M6YHTWUZ.mjs.map +7 -0
  9. package/dist/lib/browser/index.mjs +75 -42
  10. package/dist/lib/browser/index.mjs.map +4 -4
  11. package/dist/lib/browser/meta.json +1 -1
  12. package/dist/lib/browser/open-ND4QPYWD.mjs +10 -0
  13. package/dist/lib/browser/open-ND4QPYWD.mjs.map +7 -0
  14. package/dist/lib/browser/operation-handler-DUWMXELV.mjs +16 -0
  15. package/dist/lib/browser/operation-handler-DUWMXELV.mjs.map +7 -0
  16. package/dist/lib/browser/scroll-into-view-UAINWR6E.mjs +10 -0
  17. package/dist/lib/browser/scroll-into-view-UAINWR6E.mjs.map +7 -0
  18. package/dist/lib/browser/set-layout-mode-E6SJ6ATN.mjs +10 -0
  19. package/dist/lib/browser/set-layout-mode-E6SJ6ATN.mjs.map +7 -0
  20. package/dist/lib/browser/{state-2M3RMJYA.mjs → state-MRRN7LZE.mjs} +6 -4
  21. package/dist/lib/browser/state-MRRN7LZE.mjs.map +7 -0
  22. package/dist/lib/browser/switch-workspace-RPYF6M6L.mjs +19 -0
  23. package/dist/lib/browser/switch-workspace-RPYF6M6L.mjs.map +7 -0
  24. package/dist/lib/browser/update-complementary-HNS4FIWF.mjs +25 -0
  25. package/dist/lib/browser/update-complementary-HNS4FIWF.mjs.map +7 -0
  26. package/dist/lib/browser/update-dialog-W7QOCQ2N.mjs +27 -0
  27. package/dist/lib/browser/update-dialog-W7QOCQ2N.mjs.map +7 -0
  28. package/dist/lib/browser/update-popover-UELZDJW6.mjs +45 -0
  29. package/dist/lib/browser/update-popover-UELZDJW6.mjs.map +7 -0
  30. package/dist/lib/browser/update-sidebar-RJZTREDE.mjs +25 -0
  31. package/dist/lib/browser/update-sidebar-RJZTREDE.mjs.map +7 -0
  32. package/dist/lib/node-esm/add-toast-VMEADC7Y.mjs +23 -0
  33. package/dist/lib/node-esm/add-toast-VMEADC7Y.mjs.map +7 -0
  34. package/dist/lib/node-esm/{chunk-OWK6XE6C.mjs → chunk-VDX7GMAD.mjs} +3 -3
  35. package/dist/lib/node-esm/chunk-VDX7GMAD.mjs.map +7 -0
  36. package/dist/lib/node-esm/chunk-ZLM7QUEK.mjs +22 -0
  37. package/dist/lib/node-esm/chunk-ZLM7QUEK.mjs.map +7 -0
  38. package/dist/lib/node-esm/close-B54TW3OK.mjs +12 -0
  39. package/dist/lib/node-esm/close-B54TW3OK.mjs.map +7 -0
  40. package/dist/lib/node-esm/index.mjs +75 -42
  41. package/dist/lib/node-esm/index.mjs.map +4 -4
  42. package/dist/lib/node-esm/meta.json +1 -1
  43. package/dist/lib/node-esm/open-OLJQ7VR3.mjs +12 -0
  44. package/dist/lib/node-esm/open-OLJQ7VR3.mjs.map +7 -0
  45. package/dist/lib/node-esm/operation-handler-TCIEZXBS.mjs +18 -0
  46. package/dist/lib/node-esm/operation-handler-TCIEZXBS.mjs.map +7 -0
  47. package/dist/lib/node-esm/scroll-into-view-C3XK4YMK.mjs +12 -0
  48. package/dist/lib/node-esm/scroll-into-view-C3XK4YMK.mjs.map +7 -0
  49. package/dist/lib/node-esm/set-layout-mode-AEQI6AVR.mjs +12 -0
  50. package/dist/lib/node-esm/set-layout-mode-AEQI6AVR.mjs.map +7 -0
  51. package/dist/lib/node-esm/{state-UF2MWBFU.mjs → state-PVDE6Q6G.mjs} +6 -4
  52. package/dist/lib/node-esm/state-PVDE6Q6G.mjs.map +7 -0
  53. package/dist/lib/node-esm/switch-workspace-ZDUCWF6E.mjs +20 -0
  54. package/dist/lib/node-esm/switch-workspace-ZDUCWF6E.mjs.map +7 -0
  55. package/dist/lib/node-esm/update-complementary-LAPUAZ5I.mjs +26 -0
  56. package/dist/lib/node-esm/update-complementary-LAPUAZ5I.mjs.map +7 -0
  57. package/dist/lib/node-esm/update-dialog-5M7FL4XG.mjs +28 -0
  58. package/dist/lib/node-esm/update-dialog-5M7FL4XG.mjs.map +7 -0
  59. package/dist/lib/node-esm/update-popover-2TDGFHL3.mjs +46 -0
  60. package/dist/lib/node-esm/update-popover-2TDGFHL3.mjs.map +7 -0
  61. package/dist/lib/node-esm/update-sidebar-CU6TUDK5.mjs +26 -0
  62. package/dist/lib/node-esm/update-sidebar-CU6TUDK5.mjs.map +7 -0
  63. package/dist/types/src/StorybookPlugin.d.ts.map +1 -1
  64. package/dist/types/src/capabilities/index.d.ts +1 -1
  65. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  66. package/dist/types/src/capabilities/operation-handler/index.d.ts +4 -0
  67. package/dist/types/src/capabilities/operation-handler/index.d.ts.map +1 -0
  68. package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts +6 -0
  69. package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts.map +1 -0
  70. package/dist/types/src/capabilities/state/index.d.ts +1 -1
  71. package/dist/types/src/capabilities/state/state.d.ts +1 -1
  72. package/dist/types/src/capabilities/state/state.d.ts.map +1 -1
  73. package/dist/types/src/components/{Layout.d.ts → Layout/Layout.d.ts} +1 -1
  74. package/dist/types/src/components/Layout/Layout.d.ts.map +1 -0
  75. package/dist/types/src/components/Layout/index.d.ts +2 -0
  76. package/dist/types/src/components/Layout/index.d.ts.map +1 -0
  77. package/dist/types/src/core.d.ts +1 -6
  78. package/dist/types/src/core.d.ts.map +1 -1
  79. package/dist/types/src/operations/add-toast.d.ts +5 -0
  80. package/dist/types/src/operations/add-toast.d.ts.map +1 -0
  81. package/dist/types/src/operations/close.d.ts +5 -0
  82. package/dist/types/src/operations/close.d.ts.map +1 -0
  83. package/dist/types/src/operations/index.d.ts +3 -0
  84. package/dist/types/src/operations/index.d.ts.map +1 -0
  85. package/dist/types/src/operations/open.d.ts +5 -0
  86. package/dist/types/src/operations/open.d.ts.map +1 -0
  87. package/dist/types/src/operations/scroll-into-view.d.ts +5 -0
  88. package/dist/types/src/operations/scroll-into-view.d.ts.map +1 -0
  89. package/dist/types/src/operations/set-layout-mode.d.ts +5 -0
  90. package/dist/types/src/operations/set-layout-mode.d.ts.map +1 -0
  91. package/dist/types/src/operations/switch-workspace.d.ts +5 -0
  92. package/dist/types/src/operations/switch-workspace.d.ts.map +1 -0
  93. package/dist/types/src/operations/update-complementary.d.ts +5 -0
  94. package/dist/types/src/operations/update-complementary.d.ts.map +1 -0
  95. package/dist/types/src/operations/update-dialog.d.ts +5 -0
  96. package/dist/types/src/operations/update-dialog.d.ts.map +1 -0
  97. package/dist/types/src/operations/update-popover.d.ts +5 -0
  98. package/dist/types/src/operations/update-popover.d.ts.map +1 -0
  99. package/dist/types/src/operations/update-sidebar.d.ts +5 -0
  100. package/dist/types/src/operations/update-sidebar.d.ts.map +1 -0
  101. package/dist/types/src/operations/update-state.d.ts +5 -0
  102. package/dist/types/src/operations/update-state.d.ts.map +1 -0
  103. package/dist/types/src/types/capabilities.d.ts +2 -0
  104. package/dist/types/src/types/capabilities.d.ts.map +1 -1
  105. package/dist/types/tsconfig.tsbuildinfo +1 -1
  106. package/package.json +19 -18
  107. package/src/StorybookPlugin.ts +14 -13
  108. package/src/capabilities/index.ts +1 -1
  109. package/src/capabilities/operation-handler/index.ts +11 -0
  110. package/src/capabilities/operation-handler/operation-handler.ts +16 -0
  111. package/src/capabilities/state/state.tsx +5 -6
  112. package/src/components/Layout/Layout.tsx +230 -0
  113. package/src/components/Layout/index.ts +5 -0
  114. package/src/core.ts +2 -6
  115. package/src/meta.ts +1 -1
  116. package/src/operations/add-toast.ts +22 -0
  117. package/src/operations/close.ts +14 -0
  118. package/src/operations/index.ts +18 -0
  119. package/src/operations/open.ts +14 -0
  120. package/src/operations/scroll-into-view.ts +14 -0
  121. package/src/operations/set-layout-mode.ts +14 -0
  122. package/src/operations/switch-workspace.ts +20 -0
  123. package/src/operations/update-complementary.ts +27 -0
  124. package/src/operations/update-dialog.ts +27 -0
  125. package/src/operations/update-popover.ts +37 -0
  126. package/src/operations/update-sidebar.ts +26 -0
  127. package/src/operations/update-state.ts +17 -0
  128. package/src/types/capabilities.ts +4 -1
  129. package/dist/lib/browser/chunk-YHPXIILW.mjs.map +0 -7
  130. package/dist/lib/browser/operation-resolver-B2DOYB7C.mjs +0 -111
  131. package/dist/lib/browser/operation-resolver-B2DOYB7C.mjs.map +0 -7
  132. package/dist/lib/browser/state-2M3RMJYA.mjs.map +0 -7
  133. package/dist/lib/node-esm/chunk-OWK6XE6C.mjs.map +0 -7
  134. package/dist/lib/node-esm/operation-resolver-DJI7OPBP.mjs +0 -112
  135. package/dist/lib/node-esm/operation-resolver-DJI7OPBP.mjs.map +0 -7
  136. package/dist/lib/node-esm/state-UF2MWBFU.mjs.map +0 -7
  137. package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
  138. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
  139. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
  140. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
  141. package/dist/types/src/components/Layout.d.ts.map +0 -1
  142. package/src/capabilities/operation-resolver/index.ts +0 -7
  143. package/src/capabilities/operation-resolver/operation-resolver.ts +0 -98
  144. package/src/components/Layout.tsx +0 -172
@@ -0,0 +1,10 @@
1
+ // src/operations/scroll-into-view.ts
2
+ import * as Effect from "effect/Effect";
3
+ import { LayoutOperation } from "@dxos/app-toolkit";
4
+ import { Operation } from "@dxos/operation";
5
+ var handler = LayoutOperation.ScrollIntoView.pipe(Operation.withHandler(() => Effect.void));
6
+ var scroll_into_view_default = handler;
7
+ export {
8
+ scroll_into_view_default as default
9
+ };
10
+ //# sourceMappingURL=scroll-into-view-UAINWR6E.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/operations/scroll-into-view.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\nconst handler: Operation.WithHandler<typeof LayoutOperation.ScrollIntoView> = LayoutOperation.ScrollIntoView.pipe(\n Operation.withHandler(() => Effect.void),\n);\n\nexport default handler;\n"],
5
+ "mappings": ";AAIA,YAAYA,YAAY;AAExB,SAASC,uBAAuB;AAChC,SAASC,iBAAiB;AAE1B,IAAMC,UAAwEC,gBAAgBC,eAAeC,KAC3GC,UAAUC,YAAY,MAAaC,WAAI,CAAA;AAGzC,IAAA,2BAAeN;",
6
+ "names": ["Effect", "LayoutOperation", "Operation", "handler", "LayoutOperation", "ScrollIntoView", "pipe", "Operation", "withHandler", "void"]
7
+ }
@@ -0,0 +1,10 @@
1
+ // src/operations/set-layout-mode.ts
2
+ import * as Effect from "effect/Effect";
3
+ import { LayoutOperation } from "@dxos/app-toolkit";
4
+ import { Operation } from "@dxos/operation";
5
+ var handler = LayoutOperation.SetLayoutMode.pipe(Operation.withHandler(() => Effect.void));
6
+ var set_layout_mode_default = handler;
7
+ export {
8
+ set_layout_mode_default as default
9
+ };
10
+ //# sourceMappingURL=set-layout-mode-E6SJ6ATN.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/operations/set-layout-mode.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\nconst handler: Operation.WithHandler<typeof LayoutOperation.SetLayoutMode> = LayoutOperation.SetLayoutMode.pipe(\n Operation.withHandler(() => Effect.void),\n);\n\nexport default handler;\n"],
5
+ "mappings": ";AAIA,YAAYA,YAAY;AAExB,SAASC,uBAAuB;AAChC,SAASC,iBAAiB;AAE1B,IAAMC,UAAuEC,gBAAgBC,cAAcC,KACzGC,UAAUC,YAAY,MAAaC,WAAI,CAAA;AAGzC,IAAA,0BAAeN;",
6
+ "names": ["Effect", "LayoutOperation", "Operation", "handler", "LayoutOperation", "SetLayoutMode", "pipe", "Operation", "withHandler", "void"]
7
+ }
@@ -1,15 +1,17 @@
1
1
  import {
2
2
  LayoutState
3
- } from "./chunk-YHPXIILW.mjs";
3
+ } from "./chunk-F2MMDTKN.mjs";
4
4
 
5
5
  // src/capabilities/state/state.tsx
6
6
  import { Atom } from "@effect-atom/atom-react";
7
7
  import * as Effect from "effect/Effect";
8
- import { Capability, Common } from "@dxos/app-framework";
8
+ import { Capability } from "@dxos/app-framework";
9
+ import { AppCapabilities } from "@dxos/app-toolkit";
9
10
  var defaultState = {
10
11
  sidebarState: "closed",
11
12
  complementarySidebarState: "closed",
12
13
  dialogOpen: false,
14
+ toasts: [],
13
15
  workspace: "default"
14
16
  };
15
17
  var state_default = Capability.makeModule(Effect.fnUntraced(function* (props) {
@@ -33,10 +35,10 @@ var state_default = Capability.makeModule(Effect.fnUntraced(function* (props) {
33
35
  });
34
36
  return [
35
37
  Capability.contributes(LayoutState, stateAtom),
36
- Capability.contributes(Common.Capability.Layout, layoutAtom)
38
+ Capability.contributes(AppCapabilities.Layout, layoutAtom)
37
39
  ];
38
40
  }));
39
41
  export {
40
42
  state_default as default
41
43
  };
42
- //# sourceMappingURL=state-2M3RMJYA.mjs.map
44
+ //# sourceMappingURL=state-MRRN7LZE.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/state/state.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Atom } from '@effect-atom/atom-react';\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { AppCapabilities } from '@dxos/app-toolkit';\n\nimport { LayoutState, type LayoutStateProps } from '../../types';\n\nconst defaultState: LayoutStateProps = {\n sidebarState: 'closed',\n complementarySidebarState: 'closed',\n dialogOpen: false,\n toasts: [],\n workspace: 'default',\n};\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* (props?: { initialState?: Partial<LayoutStateProps> }) {\n const { initialState } = props ?? {};\n const stateAtom = Atom.make<LayoutStateProps>({ ...defaultState, ...initialState });\n\n const layoutAtom = Atom.make((get): AppCapabilities.Layout => {\n const state = get(stateAtom);\n return {\n mode: 'storybook',\n dialogOpen: state.dialogOpen,\n sidebarOpen: state.sidebarState === 'expanded',\n complementarySidebarOpen: state.complementarySidebarState === 'expanded',\n workspace: state.workspace,\n active: [],\n inactive: [],\n scrollIntoView: undefined,\n };\n });\n\n return [Capability.contributes(LayoutState, stateAtom), Capability.contributes(AppCapabilities.Layout, layoutAtom)];\n }),\n);\n"],
5
+ "mappings": ";;;;;AAIA,SAASA,YAAY;AACrB,YAAYC,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,uBAAuB;AAIhC,IAAMC,eAAiC;EACrCC,cAAc;EACdC,2BAA2B;EAC3BC,YAAY;EACZC,QAAQ,CAAA;EACRC,WAAW;AACb;AAEA,IAAA,gBAAeC,WAAWC,WACjBC,kBAAW,WAAWC,OAAoD;AAC/E,QAAM,EAAEC,aAAY,IAAKD,SAAS,CAAC;AACnC,QAAME,YAAYC,KAAKC,KAAuB;IAAE,GAAGb;IAAc,GAAGU;EAAa,CAAA;AAEjF,QAAMI,aAAaF,KAAKC,KAAK,CAACE,QAAAA;AAC5B,UAAMC,QAAQD,IAAIJ,SAAAA;AAClB,WAAO;MACLM,MAAM;MACNd,YAAYa,MAAMb;MAClBe,aAAaF,MAAMf,iBAAiB;MACpCkB,0BAA0BH,MAAMd,8BAA8B;MAC9DG,WAAWW,MAAMX;MACjBe,QAAQ,CAAA;MACRC,UAAU,CAAA;MACVC,gBAAgBC;IAClB;EACF,CAAA;AAEA,SAAO;IAACjB,WAAWkB,YAAYC,aAAad,SAAAA;IAAYL,WAAWkB,YAAYE,gBAAgBC,QAAQb,UAAAA;;AACzG,CAAA,CAAA;",
6
+ "names": ["Atom", "Effect", "Capability", "AppCapabilities", "defaultState", "sidebarState", "complementarySidebarState", "dialogOpen", "toasts", "workspace", "Capability", "makeModule", "fnUntraced", "props", "initialState", "stateAtom", "Atom", "make", "layoutAtom", "get", "state", "mode", "sidebarOpen", "complementarySidebarOpen", "active", "inactive", "scrollIntoView", "undefined", "contributes", "LayoutState", "AppCapabilities", "Layout"]
7
+ }
@@ -0,0 +1,19 @@
1
+ import {
2
+ updateState
3
+ } from "./chunk-M4TYMLOE.mjs";
4
+ import "./chunk-F2MMDTKN.mjs";
5
+
6
+ // src/operations/switch-workspace.ts
7
+ import * as Effect from "effect/Effect";
8
+ import { LayoutOperation } from "@dxos/app-toolkit";
9
+ import { Operation } from "@dxos/operation";
10
+ var handler = LayoutOperation.SwitchWorkspace.pipe(Operation.withHandler(Effect.fnUntraced(function* ({ subject }) {
11
+ yield* updateState(() => ({
12
+ workspace: subject
13
+ }));
14
+ })));
15
+ var switch_workspace_default = handler;
16
+ export {
17
+ switch_workspace_default as default
18
+ };
19
+ //# sourceMappingURL=switch-workspace-RPYF6M6L.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/operations/switch-workspace.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.SwitchWorkspace> = LayoutOperation.SwitchWorkspace.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ subject }) {\n yield* updateState(() => ({ workspace: subject }));\n }),\n ),\n);\n\nexport default handler;\n"],
5
+ "mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,uBAAuB;AAChC,SAASC,iBAAiB;AAI1B,IAAMC,UAAyEC,gBAAgBC,gBAAgBC,KAC7GC,UAAUC,YACDC,kBAAW,WAAW,EAAEC,QAAO,GAAE;AACtC,SAAOC,YAAY,OAAO;IAAEC,WAAWF;EAAQ,EAAA;AACjD,CAAA,CAAA,CAAA;AAIJ,IAAA,2BAAeP;",
6
+ "names": ["Effect", "LayoutOperation", "Operation", "handler", "LayoutOperation", "SwitchWorkspace", "pipe", "Operation", "withHandler", "fnUntraced", "subject", "updateState", "workspace"]
7
+ }
@@ -0,0 +1,25 @@
1
+ import {
2
+ updateState
3
+ } from "./chunk-M4TYMLOE.mjs";
4
+ import "./chunk-F2MMDTKN.mjs";
5
+
6
+ // src/operations/update-complementary.ts
7
+ import * as Effect from "effect/Effect";
8
+ import { LayoutOperation } from "@dxos/app-toolkit";
9
+ import { Operation } from "@dxos/operation";
10
+ var handler = LayoutOperation.UpdateComplementary.pipe(Operation.withHandler(Effect.fnUntraced(function* ({ state }) {
11
+ yield* updateState((layout) => {
12
+ const next = state ?? layout.complementarySidebarState;
13
+ if (next !== layout.complementarySidebarState) {
14
+ return {
15
+ complementarySidebarState: next
16
+ };
17
+ }
18
+ return {};
19
+ });
20
+ })));
21
+ var update_complementary_default = handler;
22
+ export {
23
+ update_complementary_default as default
24
+ };
25
+ //# sourceMappingURL=update-complementary-HNS4FIWF.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/operations/update-complementary.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.UpdateComplementary> =\n LayoutOperation.UpdateComplementary.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ state }) {\n yield* updateState((layout) => {\n const next = state ?? layout.complementarySidebarState;\n if (next !== layout.complementarySidebarState) {\n return { complementarySidebarState: next };\n }\n return {};\n });\n }),\n ),\n );\n\nexport default handler;\n"],
5
+ "mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,uBAAuB;AAChC,SAASC,iBAAiB;AAI1B,IAAMC,UACJC,gBAAgBC,oBAAoBC,KAClCC,UAAUC,YACDC,kBAAW,WAAW,EAAEC,MAAK,GAAE;AACpC,SAAOC,YAAY,CAACC,WAAAA;AAClB,UAAMC,OAAOH,SAASE,OAAOE;AAC7B,QAAID,SAASD,OAAOE,2BAA2B;AAC7C,aAAO;QAAEA,2BAA2BD;MAAK;IAC3C;AACA,WAAO,CAAC;EACV,CAAA;AACF,CAAA,CAAA,CAAA;AAIN,IAAA,+BAAeV;",
6
+ "names": ["Effect", "LayoutOperation", "Operation", "handler", "LayoutOperation", "UpdateComplementary", "pipe", "Operation", "withHandler", "fnUntraced", "state", "updateState", "layout", "next", "complementarySidebarState"]
7
+ }
@@ -0,0 +1,27 @@
1
+ import {
2
+ updateState
3
+ } from "./chunk-M4TYMLOE.mjs";
4
+ import "./chunk-F2MMDTKN.mjs";
5
+
6
+ // src/operations/update-dialog.ts
7
+ import * as Effect from "effect/Effect";
8
+ import { LayoutOperation } from "@dxos/app-toolkit";
9
+ import { Operation } from "@dxos/operation";
10
+ var handler = LayoutOperation.UpdateDialog.pipe(Operation.withHandler(Effect.fnUntraced(function* ({ subject, state, type, blockAlign, overlayClasses, overlayStyle, props }) {
11
+ yield* updateState(() => ({
12
+ dialogOpen: state ?? Boolean(subject),
13
+ dialogType: type ?? "default",
14
+ dialogBlockAlign: blockAlign ?? "center",
15
+ dialogOverlayClasses: overlayClasses,
16
+ dialogOverlayStyle: overlayStyle,
17
+ dialogContent: subject ? {
18
+ component: subject,
19
+ props
20
+ } : null
21
+ }));
22
+ })));
23
+ var update_dialog_default = handler;
24
+ export {
25
+ update_dialog_default as default
26
+ };
27
+ //# sourceMappingURL=update-dialog-W7QOCQ2N.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/operations/update-dialog.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.UpdateDialog> = LayoutOperation.UpdateDialog.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ subject, state, type, blockAlign, overlayClasses, overlayStyle, props }) {\n yield* updateState(() => ({\n dialogOpen: state ?? Boolean(subject),\n dialogType: type ?? 'default',\n dialogBlockAlign: blockAlign ?? 'center',\n dialogOverlayClasses: overlayClasses,\n dialogOverlayStyle: overlayStyle,\n dialogContent: subject ? { component: subject, props } : null,\n }));\n }),\n ),\n);\n\nexport default handler;\n"],
5
+ "mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,uBAAuB;AAChC,SAASC,iBAAiB;AAI1B,IAAMC,UAAsEC,gBAAgBC,aAAaC,KACvGC,UAAUC,YACDC,kBAAW,WAAW,EAAEC,SAASC,OAAOC,MAAMC,YAAYC,gBAAgBC,cAAcC,MAAK,GAAE;AACpG,SAAOC,YAAY,OAAO;IACxBC,YAAYP,SAASQ,QAAQT,OAAAA;IAC7BU,YAAYR,QAAQ;IACpBS,kBAAkBR,cAAc;IAChCS,sBAAsBR;IACtBS,oBAAoBR;IACpBS,eAAed,UAAU;MAAEe,WAAWf;MAASM;IAAM,IAAI;EAC3D,EAAA;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,wBAAeb;",
6
+ "names": ["Effect", "LayoutOperation", "Operation", "handler", "LayoutOperation", "UpdateDialog", "pipe", "Operation", "withHandler", "fnUntraced", "subject", "state", "type", "blockAlign", "overlayClasses", "overlayStyle", "props", "updateState", "dialogOpen", "Boolean", "dialogType", "dialogBlockAlign", "dialogOverlayClasses", "dialogOverlayStyle", "dialogContent", "component"]
7
+ }
@@ -0,0 +1,45 @@
1
+ import {
2
+ updateState
3
+ } from "./chunk-M4TYMLOE.mjs";
4
+ import "./chunk-F2MMDTKN.mjs";
5
+
6
+ // src/operations/update-popover.ts
7
+ import * as Effect from "effect/Effect";
8
+ import { LayoutOperation } from "@dxos/app-toolkit";
9
+ import { Operation } from "@dxos/operation";
10
+ var handler = LayoutOperation.UpdatePopover.pipe(Operation.withHandler(Effect.fnUntraced(function* (input) {
11
+ const { subject, state, side, kind, props } = input;
12
+ yield* updateState(() => {
13
+ const base = {
14
+ popoverKind: kind ?? "base",
15
+ popoverTitle: kind === "card" ? input.title : void 0,
16
+ popoverContent: typeof subject === "string" ? {
17
+ component: subject,
18
+ props
19
+ } : subject ? {
20
+ subject
21
+ } : void 0,
22
+ popoverOpen: state ?? Boolean(subject),
23
+ popoverSide: side
24
+ };
25
+ if ("variant" in input && input.variant === "virtual") {
26
+ return {
27
+ ...base,
28
+ popoverVariant: "virtual",
29
+ popoverAnchor: input.anchor
30
+ };
31
+ } else if ("anchorId" in input) {
32
+ return {
33
+ ...base,
34
+ popoverVariant: "react",
35
+ popoverAnchorId: input.anchorId
36
+ };
37
+ }
38
+ return base;
39
+ });
40
+ })));
41
+ var update_popover_default = handler;
42
+ export {
43
+ update_popover_default as default
44
+ };
45
+ //# sourceMappingURL=update-popover-UELZDJW6.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/operations/update-popover.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 { type LayoutStateProps } from '../types';\nimport { updateState } from './update-state';\n\nconst handler: Operation.WithHandler<typeof LayoutOperation.UpdatePopover> = LayoutOperation.UpdatePopover.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* (input) {\n const { subject, state, side, kind, props } = input;\n yield* updateState(() => {\n const base: Partial<LayoutStateProps> = {\n popoverKind: kind ?? 'base',\n popoverTitle: kind === 'card' ? input.title : undefined,\n popoverContent:\n typeof subject === 'string' ? { component: subject, props } : subject ? { subject } : undefined,\n popoverOpen: state ?? Boolean(subject),\n popoverSide: side,\n };\n if ('variant' in input && input.variant === 'virtual') {\n return { ...base, popoverVariant: 'virtual', popoverAnchor: input.anchor };\n } else if ('anchorId' in input) {\n return { ...base, popoverVariant: 'react', popoverAnchorId: input.anchorId };\n }\n return base;\n });\n }),\n ),\n);\n\nexport default handler;\n"],
5
+ "mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,uBAAuB;AAChC,SAASC,iBAAiB;AAK1B,IAAMC,UAAuEC,gBAAgBC,cAAcC,KACzGC,UAAUC,YACDC,kBAAW,WAAWC,OAAK;AAChC,QAAM,EAAEC,SAASC,OAAOC,MAAMC,MAAMC,MAAK,IAAKL;AAC9C,SAAOM,YAAY,MAAA;AACjB,UAAMC,OAAkC;MACtCC,aAAaJ,QAAQ;MACrBK,cAAcL,SAAS,SAASJ,MAAMU,QAAQC;MAC9CC,gBACE,OAAOX,YAAY,WAAW;QAAEY,WAAWZ;QAASI;MAAM,IAAIJ,UAAU;QAAEA;MAAQ,IAAIU;MACxFG,aAAaZ,SAASa,QAAQd,OAAAA;MAC9Be,aAAab;IACf;AACA,QAAI,aAAaH,SAASA,MAAMiB,YAAY,WAAW;AACrD,aAAO;QAAE,GAAGV;QAAMW,gBAAgB;QAAWC,eAAenB,MAAMoB;MAAO;IAC3E,WAAW,cAAcpB,OAAO;AAC9B,aAAO;QAAE,GAAGO;QAAMW,gBAAgB;QAASG,iBAAiBrB,MAAMsB;MAAS;IAC7E;AACA,WAAOf;EACT,CAAA;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,yBAAed;",
6
+ "names": ["Effect", "LayoutOperation", "Operation", "handler", "LayoutOperation", "UpdatePopover", "pipe", "Operation", "withHandler", "fnUntraced", "input", "subject", "state", "side", "kind", "props", "updateState", "base", "popoverKind", "popoverTitle", "title", "undefined", "popoverContent", "component", "popoverOpen", "Boolean", "popoverSide", "variant", "popoverVariant", "popoverAnchor", "anchor", "popoverAnchorId", "anchorId"]
7
+ }
@@ -0,0 +1,25 @@
1
+ import {
2
+ updateState
3
+ } from "./chunk-M4TYMLOE.mjs";
4
+ import "./chunk-F2MMDTKN.mjs";
5
+
6
+ // src/operations/update-sidebar.ts
7
+ import * as Effect from "effect/Effect";
8
+ import { LayoutOperation } from "@dxos/app-toolkit";
9
+ import { Operation } from "@dxos/operation";
10
+ var handler = LayoutOperation.UpdateSidebar.pipe(Operation.withHandler(Effect.fnUntraced(function* ({ state }) {
11
+ yield* updateState((layout) => {
12
+ const next = state ?? layout.sidebarState;
13
+ if (next !== layout.sidebarState) {
14
+ return {
15
+ sidebarState: next
16
+ };
17
+ }
18
+ return {};
19
+ });
20
+ })));
21
+ var update_sidebar_default = handler;
22
+ export {
23
+ update_sidebar_default as default
24
+ };
25
+ //# sourceMappingURL=update-sidebar-RJZTREDE.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/operations/update-sidebar.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.UpdateSidebar> = LayoutOperation.UpdateSidebar.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ state }) {\n yield* updateState((layout) => {\n const next = state ?? layout.sidebarState;\n if (next !== layout.sidebarState) {\n return { sidebarState: next };\n }\n return {};\n });\n }),\n ),\n);\n\nexport default handler;\n"],
5
+ "mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,uBAAuB;AAChC,SAASC,iBAAiB;AAI1B,IAAMC,UAAuEC,gBAAgBC,cAAcC,KACzGC,UAAUC,YACDC,kBAAW,WAAW,EAAEC,MAAK,GAAE;AACpC,SAAOC,YAAY,CAACC,WAAAA;AAClB,UAAMC,OAAOH,SAASE,OAAOE;AAC7B,QAAID,SAASD,OAAOE,cAAc;AAChC,aAAO;QAAEA,cAAcD;MAAK;IAC9B;AACA,WAAO,CAAC;EACV,CAAA;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,yBAAeV;",
6
+ "names": ["Effect", "LayoutOperation", "Operation", "handler", "LayoutOperation", "UpdateSidebar", "pipe", "Operation", "withHandler", "fnUntraced", "state", "updateState", "layout", "next", "sidebarState"]
7
+ }
@@ -0,0 +1,23 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ import {
3
+ updateState
4
+ } from "./chunk-ZLM7QUEK.mjs";
5
+ import "./chunk-VDX7GMAD.mjs";
6
+
7
+ // src/operations/add-toast.ts
8
+ import * as Effect from "effect/Effect";
9
+ import { LayoutOperation } from "@dxos/app-toolkit";
10
+ import { Operation } from "@dxos/operation";
11
+ var handler = LayoutOperation.AddToast.pipe(Operation.withHandler(Effect.fnUntraced(function* (input) {
12
+ yield* updateState((state) => ({
13
+ toasts: [
14
+ ...state.toasts,
15
+ input
16
+ ]
17
+ }));
18
+ })));
19
+ var add_toast_default = handler;
20
+ export {
21
+ add_toast_default as default
22
+ };
23
+ //# sourceMappingURL=add-toast-VMEADC7Y.mjs.map
@@ -0,0 +1,7 @@
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
+ }
@@ -3,7 +3,7 @@ import { createRequire } from 'node:module';const require = createRequire(import
3
3
  // src/meta.ts
4
4
  import { trim } from "@dxos/util";
5
5
  var meta = {
6
- id: "dxos.org/plugin/storybook-layout",
6
+ id: "org.dxos.plugin.storybook-layout",
7
7
  name: "Storybook",
8
8
  description: trim`
9
9
  Development layout optimized for Storybook component testing and documentation.
@@ -14,10 +14,10 @@ var meta = {
14
14
 
15
15
  // src/types/capabilities.ts
16
16
  import { Capability } from "@dxos/app-framework";
17
- var LayoutState = Capability.make(`${meta.id}/state`);
17
+ var LayoutState = Capability.make(`${meta.id}.state`);
18
18
 
19
19
  export {
20
20
  meta,
21
21
  LayoutState
22
22
  };
23
- //# sourceMappingURL=chunk-OWK6XE6C.mjs.map
23
+ //# sourceMappingURL=chunk-VDX7GMAD.mjs.map
@@ -0,0 +1,7 @@
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
+ }
@@ -0,0 +1,22 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ import {
3
+ LayoutState
4
+ } from "./chunk-VDX7GMAD.mjs";
5
+
6
+ // src/operations/update-state.ts
7
+ import * as Effect from "effect/Effect";
8
+ import { Capabilities, Capability } from "@dxos/app-framework";
9
+ var updateState = (fn) => Effect.gen(function* () {
10
+ const registry = yield* Capability.get(Capabilities.AtomRegistry);
11
+ const stateAtom = yield* Capability.get(LayoutState);
12
+ const current = registry.get(stateAtom);
13
+ registry.set(stateAtom, {
14
+ ...current,
15
+ ...fn(current)
16
+ });
17
+ });
18
+
19
+ export {
20
+ updateState
21
+ };
22
+ //# sourceMappingURL=chunk-ZLM7QUEK.mjs.map
@@ -0,0 +1,7 @@
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
+ }
@@ -0,0 +1,12 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+
3
+ // src/operations/close.ts
4
+ import * as Effect from "effect/Effect";
5
+ import { LayoutOperation } from "@dxos/app-toolkit";
6
+ import { Operation } from "@dxos/operation";
7
+ var handler = LayoutOperation.Close.pipe(Operation.withHandler(() => Effect.void));
8
+ var close_default = handler;
9
+ export {
10
+ close_default as default
11
+ };
12
+ //# sourceMappingURL=close-B54TW3OK.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/operations/close.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\nconst handler: Operation.WithHandler<typeof LayoutOperation.Close> = LayoutOperation.Close.pipe(\n Operation.withHandler(() => Effect.void),\n);\n\nexport default handler;\n"],
5
+ "mappings": ";;;AAIA,YAAYA,YAAY;AAExB,SAASC,uBAAuB;AAChC,SAASC,iBAAiB;AAE1B,IAAMC,UAA+DC,gBAAgBC,MAAMC,KACzFC,UAAUC,YAAY,MAAaC,WAAI,CAAA;AAGzC,IAAA,gBAAeN;",
6
+ "names": ["Effect", "LayoutOperation", "Operation", "handler", "LayoutOperation", "Close", "pipe", "Operation", "withHandler", "void"]
7
+ }
@@ -2,13 +2,13 @@ import { createRequire } from 'node:module';const require = createRequire(import
2
2
  import {
3
3
  LayoutState,
4
4
  meta
5
- } from "./chunk-OWK6XE6C.mjs";
5
+ } from "./chunk-VDX7GMAD.mjs";
6
6
 
7
7
  // src/core.ts
8
- import { OperationPlugin, RuntimePlugin, SettingsPlugin } from "@dxos/app-framework";
8
+ import { OperationPlugin, RuntimePlugin } from "@dxos/app-framework";
9
9
  import { AttentionPlugin } from "@dxos/plugin-attention";
10
- import { ClientPlugin } from "@dxos/plugin-client";
11
10
  import { GraphPlugin } from "@dxos/plugin-graph";
11
+ import { SettingsPlugin } from "@dxos/plugin-settings";
12
12
  import { ThemePlugin } from "@dxos/plugin-theme";
13
13
  import { defaultTx } from "@dxos/ui-theme";
14
14
  var corePlugins = () => [
@@ -24,24 +24,52 @@ var corePlugins = () => [
24
24
 
25
25
  // src/StorybookPlugin.ts
26
26
  import * as Effect from "effect/Effect";
27
- import { Capability as Capability3, Common, Plugin } from "@dxos/app-framework";
27
+ import { ActivationEvents, Capabilities, Capability as Capability3, Plugin } from "@dxos/app-framework";
28
+ import { AppActivationEvents, AppPlugin } from "@dxos/app-toolkit";
28
29
 
29
- // src/capabilities/operation-resolver/index.ts
30
+ // src/capabilities/operation-handler/index.ts
30
31
  import { Capability } from "@dxos/app-framework";
31
- var OperationResolver = Capability.lazy("OperationResolver", () => import("./operation-resolver-DJI7OPBP.mjs"));
32
+ var OperationHandler = Capability.lazy("OperationHandler", () => import("./operation-handler-TCIEZXBS.mjs"));
32
33
 
33
34
  // src/capabilities/state/index.ts
34
35
  import { Capability as Capability2 } from "@dxos/app-framework";
35
- var State = Capability2.lazy("State", () => import("./state-UF2MWBFU.mjs"));
36
+ var State = Capability2.lazy("State", () => import("./state-PVDE6Q6G.mjs"));
36
37
 
37
- // src/components/Layout.tsx
38
+ // src/components/Layout/Layout.tsx
38
39
  import { RegistryContext, useAtomValue } from "@effect-atom/atom-react";
39
40
  import React, { useCallback, useContext, useEffect, useRef, useState } from "react";
40
- import { Surface, useCapability } from "@dxos/app-framework/react";
41
- import { AlertDialog, Dialog, Main, Popover, toLocalizedString, useTranslation } from "@dxos/react-ui";
42
- import { Card, Mosaic } from "@dxos/react-ui-mosaic";
41
+ import { Surface, useCapability } from "@dxos/app-framework/ui";
42
+ import { AlertDialog, Button, Dialog, Icon, Main, Popover, Toast, toLocalizedString, useTranslation } from "@dxos/react-ui";
43
+ import { Card } from "@dxos/react-ui";
44
+ import { Mosaic } from "@dxos/react-ui-mosaic";
43
45
  import { descriptionMessage, mx } from "@dxos/ui-theme";
44
46
  var debounce_delay = 100;
47
+ var StoryToast = ({ toast, onDismiss }) => {
48
+ const { t } = useTranslation(meta.id);
49
+ return /* @__PURE__ */ React.createElement(Toast.Root, {
50
+ "data-testid": toast.id,
51
+ defaultOpen: true,
52
+ duration: toast.duration,
53
+ onOpenChange: (open) => {
54
+ if (!open) {
55
+ onDismiss(toast.id);
56
+ }
57
+ }
58
+ }, /* @__PURE__ */ React.createElement(Toast.Body, null, /* @__PURE__ */ React.createElement(Toast.Title, {
59
+ classNames: "items-center"
60
+ }, toast.icon && /* @__PURE__ */ React.createElement(Icon, {
61
+ icon: toast.icon,
62
+ classNames: "inline mr-1"
63
+ }), toast.title && /* @__PURE__ */ React.createElement("span", null, toLocalizedString(toast.title, t))), toast.description && /* @__PURE__ */ React.createElement(Toast.Description, null, toLocalizedString(toast.description, t))), /* @__PURE__ */ React.createElement(Toast.Actions, null, toast.onAction && toast.actionAlt && toast.actionLabel && /* @__PURE__ */ React.createElement(Toast.Action, {
64
+ altText: toLocalizedString(toast.actionAlt, t),
65
+ asChild: true
66
+ }, /* @__PURE__ */ React.createElement(Button, {
67
+ variant: "primary",
68
+ onClick: () => toast.onAction?.()
69
+ }, toLocalizedString(toast.actionLabel, t))), toast.closeLabel && /* @__PURE__ */ React.createElement(Toast.Close, {
70
+ asChild: true
71
+ }, /* @__PURE__ */ React.createElement(Button, null, toLocalizedString(toast.closeLabel, t)))));
72
+ };
45
73
  var Layout = ({ children }) => {
46
74
  const { t } = useTranslation(meta.id);
47
75
  const trigger = useRef(null);
@@ -100,9 +128,17 @@ var Layout = ({ children }) => {
100
128
  }, [
101
129
  handleClose
102
130
  ]);
131
+ const handleDismissToast = useCallback((id) => {
132
+ updateState({
133
+ toasts: layout.toasts.filter((toast) => toast.id !== id)
134
+ });
135
+ }, [
136
+ updateState,
137
+ layout.toasts
138
+ ]);
103
139
  const DialogRoot = layout.dialogType === "alert" ? AlertDialog.Root : Dialog.Root;
104
140
  const DialogOverlay = layout.dialogType === "alert" ? AlertDialog.Overlay : Dialog.Overlay;
105
- return /* @__PURE__ */ React.createElement("div", {
141
+ return /* @__PURE__ */ React.createElement(Toast.Provider, null, /* @__PURE__ */ React.createElement("div", {
106
142
  role: "none",
107
143
  className: "fixed inset-0 flex overflow-hidden"
108
144
  }, /* @__PURE__ */ React.createElement(Mosaic.Root, null, /* @__PURE__ */ React.createElement(Popover.Root, {
@@ -122,21 +158,21 @@ var Layout = ({ children }) => {
122
158
  onOpenChange: (nextOpen) => updateState({
123
159
  dialogOpen: nextOpen
124
160
  })
125
- }, layout.dialogBlockAlign === "end" ? /* @__PURE__ */ React.createElement(Surface, {
161
+ }, layout.dialogBlockAlign === "end" ? /* @__PURE__ */ React.createElement(Surface.Surface, {
126
162
  role: "dialog",
127
163
  data: layout.dialogContent,
128
164
  limit: 1,
129
- fallback: ContentError,
165
+ fallback: ErrorFallback,
130
166
  placeholder: /* @__PURE__ */ React.createElement("div", null)
131
167
  }) : /* @__PURE__ */ React.createElement(DialogOverlay, {
132
168
  blockAlign: layout.dialogBlockAlign,
133
169
  classNames: layout.dialogOverlayClasses,
134
170
  style: layout.dialogOverlayStyle
135
- }, /* @__PURE__ */ React.createElement(Surface, {
171
+ }, /* @__PURE__ */ React.createElement(Surface.Surface, {
136
172
  role: "dialog",
137
173
  data: layout.dialogContent,
138
174
  limit: 1,
139
- fallback: ContentError
175
+ fallback: ErrorFallback
140
176
  }))), /* @__PURE__ */ React.createElement(Popover.VirtualTrigger, {
141
177
  key: iter,
142
178
  virtualRef: trigger
@@ -146,57 +182,54 @@ var Layout = ({ children }) => {
146
182
  onEscapeKeyDown: handleInteractOutside,
147
183
  sticky: "always",
148
184
  hideWhenDetached: true
149
- }, /* @__PURE__ */ React.createElement(Popover.Viewport, null, layout.popoverKind === "card" && /* @__PURE__ */ React.createElement(Card.Root, null, /* @__PURE__ */ React.createElement(Card.Toolbar, null, /* @__PURE__ */ React.createElement("span", null), layout.popoverTitle ? /* @__PURE__ */ React.createElement(Card.Title, null, toLocalizedString(layout.popoverTitle, t)) : /* @__PURE__ */ React.createElement("span", null), /* @__PURE__ */ React.createElement(Card.Close, {
185
+ }, /* @__PURE__ */ React.createElement(Popover.Viewport, null, layout.popoverKind === "card" && /* @__PURE__ */ React.createElement(Card.Root, null, /* @__PURE__ */ React.createElement(Card.Toolbar, null, /* @__PURE__ */ React.createElement("span", null), layout.popoverTitle ? /* @__PURE__ */ React.createElement(Card.Title, null, toLocalizedString(layout.popoverTitle, t)) : /* @__PURE__ */ React.createElement("span", null), /* @__PURE__ */ React.createElement(Card.CloseIconButton, {
150
186
  onClick: handleClose
151
- })), /* @__PURE__ */ React.createElement(Surface, {
187
+ })), /* @__PURE__ */ React.createElement(Surface.Surface, {
152
188
  role: "card--content",
153
189
  data: layout.popoverContent,
154
190
  limit: 1
155
- })), layout.popoverKind === "base" && /* @__PURE__ */ React.createElement(Surface, {
191
+ })), layout.popoverKind === "base" && /* @__PURE__ */ React.createElement(Surface.Surface, {
156
192
  role: "popover",
157
193
  data: layout.popoverContent,
158
194
  limit: 1
159
- })), /* @__PURE__ */ React.createElement(Popover.Arrow, null))))));
195
+ })), /* @__PURE__ */ React.createElement(Popover.Arrow, null))))), layout.toasts.map((toast) => /* @__PURE__ */ React.createElement(StoryToast, {
196
+ key: toast.id,
197
+ toast,
198
+ onDismiss: handleDismissToast
199
+ })), /* @__PURE__ */ React.createElement(Toast.Viewport, null)));
160
200
  };
161
- var ContentError = ({ error }) => {
201
+ var ErrorFallback = ({ error }) => {
162
202
  const { t } = useTranslation(meta.id);
163
203
  const errorString = error?.toString() ?? "";
164
204
  return /* @__PURE__ */ React.createElement("div", {
165
- role: "none",
166
- className: "overflow-auto p-8 attention-surface grid place-items-center"
167
- }, /* @__PURE__ */ React.createElement("p", {
168
205
  role: "alert",
206
+ "data-testid": "error-boundary-fallback",
207
+ className: mx("overflow-auto p-8 dx-attention-surface grid place-items-center")
208
+ }, /* @__PURE__ */ React.createElement("p", {
169
209
  className: mx(descriptionMessage, "break-words rounded-md p-8", errorString.length < 256 && "text-lg")
170
210
  }, error ? errorString : t("error fallback message")));
171
211
  };
172
212
 
173
213
  // src/StorybookPlugin.ts
174
- var StorybookPlugin = Plugin.define(meta).pipe(Plugin.addModule(({ initialState }) => ({
214
+ var StorybookPlugin = Plugin.define(meta).pipe(AppPlugin.addOperationHandlerModule({
215
+ activate: OperationHandler
216
+ }), AppPlugin.addReactContextModule({
217
+ activate: () => Effect.succeed(Capability3.contributes(Capabilities.ReactContext, {
218
+ id: "storybook-layout",
219
+ context: Layout
220
+ }))
221
+ }), Plugin.addModule(({ initialState }) => ({
175
222
  id: Capability3.getModuleTag(State),
176
- activatesOn: Common.ActivationEvent.Startup,
223
+ activatesOn: ActivationEvents.Startup,
177
224
  activatesAfter: [
178
- Common.ActivationEvent.LayoutReady
225
+ AppActivationEvents.LayoutReady
179
226
  ],
180
227
  activate: () => State({
181
228
  initialState
182
229
  })
183
- })), Common.Plugin.addReactContextModule({
184
- activate: () => Effect.succeed(Capability3.contributes(Common.Capability.ReactContext, {
185
- id: "storybook-layout",
186
- context: Layout
187
- }))
188
- }), Common.Plugin.addOperationResolverModule({
189
- activate: OperationResolver
190
- }), Plugin.make);
230
+ })), Plugin.make);
191
231
  export {
192
- AttentionPlugin,
193
- ClientPlugin,
194
- GraphPlugin,
195
- OperationPlugin,
196
- RuntimePlugin,
197
- SettingsPlugin,
198
232
  StorybookPlugin,
199
- ThemePlugin,
200
233
  corePlugins,
201
234
  meta
202
235
  };