@dxos/plugin-testing 0.8.4-main.6fa680abb7 → 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 (134) 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-NWOKPVNQ.mjs → chunk-F2MMDTKN.mjs} +1 -1
  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 +47 -17
  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-TCYYH5JN.mjs → state-MRRN7LZE.mjs} +3 -2
  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-NWN7D2LS.mjs → chunk-VDX7GMAD.mjs} +1 -1
  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 +47 -17
  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-ZJEK6SP7.mjs → state-PVDE6Q6G.mjs} +3 -2
  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/capabilities/index.d.ts +1 -1
  64. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  65. package/dist/types/src/capabilities/operation-handler/index.d.ts +4 -0
  66. package/dist/types/src/capabilities/operation-handler/index.d.ts.map +1 -0
  67. package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts +6 -0
  68. package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts.map +1 -0
  69. package/dist/types/src/capabilities/state/state.d.ts.map +1 -1
  70. package/dist/types/src/components/Layout/Layout.d.ts.map +1 -1
  71. package/dist/types/src/core.d.ts +1 -7
  72. package/dist/types/src/core.d.ts.map +1 -1
  73. package/dist/types/src/operations/add-toast.d.ts +5 -0
  74. package/dist/types/src/operations/add-toast.d.ts.map +1 -0
  75. package/dist/types/src/operations/close.d.ts +5 -0
  76. package/dist/types/src/operations/close.d.ts.map +1 -0
  77. package/dist/types/src/operations/index.d.ts +3 -0
  78. package/dist/types/src/operations/index.d.ts.map +1 -0
  79. package/dist/types/src/operations/open.d.ts +5 -0
  80. package/dist/types/src/operations/open.d.ts.map +1 -0
  81. package/dist/types/src/operations/scroll-into-view.d.ts +5 -0
  82. package/dist/types/src/operations/scroll-into-view.d.ts.map +1 -0
  83. package/dist/types/src/operations/set-layout-mode.d.ts +5 -0
  84. package/dist/types/src/operations/set-layout-mode.d.ts.map +1 -0
  85. package/dist/types/src/operations/switch-workspace.d.ts +5 -0
  86. package/dist/types/src/operations/switch-workspace.d.ts.map +1 -0
  87. package/dist/types/src/operations/update-complementary.d.ts +5 -0
  88. package/dist/types/src/operations/update-complementary.d.ts.map +1 -0
  89. package/dist/types/src/operations/update-dialog.d.ts +5 -0
  90. package/dist/types/src/operations/update-dialog.d.ts.map +1 -0
  91. package/dist/types/src/operations/update-popover.d.ts +5 -0
  92. package/dist/types/src/operations/update-popover.d.ts.map +1 -0
  93. package/dist/types/src/operations/update-sidebar.d.ts +5 -0
  94. package/dist/types/src/operations/update-sidebar.d.ts.map +1 -0
  95. package/dist/types/src/operations/update-state.d.ts +5 -0
  96. package/dist/types/src/operations/update-state.d.ts.map +1 -0
  97. package/dist/types/src/types/capabilities.d.ts +2 -0
  98. package/dist/types/src/types/capabilities.d.ts.map +1 -1
  99. package/dist/types/tsconfig.tsbuildinfo +1 -1
  100. package/package.json +16 -17
  101. package/src/StorybookPlugin.ts +3 -3
  102. package/src/capabilities/index.ts +1 -1
  103. package/src/capabilities/operation-handler/index.ts +11 -0
  104. package/src/capabilities/operation-handler/operation-handler.ts +16 -0
  105. package/src/capabilities/state/state.tsx +1 -0
  106. package/src/components/Layout/Layout.tsx +124 -70
  107. package/src/core.ts +0 -5
  108. package/src/operations/add-toast.ts +22 -0
  109. package/src/operations/close.ts +14 -0
  110. package/src/operations/index.ts +18 -0
  111. package/src/operations/open.ts +14 -0
  112. package/src/operations/scroll-into-view.ts +14 -0
  113. package/src/operations/set-layout-mode.ts +14 -0
  114. package/src/operations/switch-workspace.ts +20 -0
  115. package/src/operations/update-complementary.ts +27 -0
  116. package/src/operations/update-dialog.ts +27 -0
  117. package/src/operations/update-popover.ts +37 -0
  118. package/src/operations/update-sidebar.ts +26 -0
  119. package/src/operations/update-state.ts +17 -0
  120. package/src/types/capabilities.ts +3 -0
  121. package/dist/lib/browser/chunk-NWOKPVNQ.mjs.map +0 -7
  122. package/dist/lib/browser/operation-resolver-SR4GZ7Q5.mjs +0 -112
  123. package/dist/lib/browser/operation-resolver-SR4GZ7Q5.mjs.map +0 -7
  124. package/dist/lib/browser/state-TCYYH5JN.mjs.map +0 -7
  125. package/dist/lib/node-esm/chunk-NWN7D2LS.mjs.map +0 -7
  126. package/dist/lib/node-esm/operation-resolver-A6XLCTWX.mjs +0 -113
  127. package/dist/lib/node-esm/operation-resolver-A6XLCTWX.mjs.map +0 -7
  128. package/dist/lib/node-esm/state-ZJEK6SP7.mjs.map +0 -7
  129. package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
  130. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
  131. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
  132. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
  133. package/src/capabilities/operation-resolver/index.ts +0 -7
  134. package/src/capabilities/operation-resolver/operation-resolver.ts +0 -99
@@ -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
+ }
@@ -20,4 +20,4 @@ export {
20
20
  meta,
21
21
  LayoutState
22
22
  };
23
- //# sourceMappingURL=chunk-NWN7D2LS.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,12 +2,11 @@ import { createRequire } from 'node:module';const require = createRequire(import
2
2
  import {
3
3
  LayoutState,
4
4
  meta
5
- } from "./chunk-NWN7D2LS.mjs";
5
+ } from "./chunk-VDX7GMAD.mjs";
6
6
 
7
7
  // src/core.ts
8
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";
12
11
  import { SettingsPlugin } from "@dxos/plugin-settings";
13
12
  import { ThemePlugin } from "@dxos/plugin-theme";
@@ -28,23 +27,49 @@ import * as Effect from "effect/Effect";
28
27
  import { ActivationEvents, Capabilities, Capability as Capability3, Plugin } from "@dxos/app-framework";
29
28
  import { AppActivationEvents, AppPlugin } from "@dxos/app-toolkit";
30
29
 
31
- // src/capabilities/operation-resolver/index.ts
30
+ // src/capabilities/operation-handler/index.ts
32
31
  import { Capability } from "@dxos/app-framework";
33
- var OperationResolver = Capability.lazy("OperationResolver", () => import("./operation-resolver-A6XLCTWX.mjs"));
32
+ var OperationHandler = Capability.lazy("OperationHandler", () => import("./operation-handler-TCIEZXBS.mjs"));
34
33
 
35
34
  // src/capabilities/state/index.ts
36
35
  import { Capability as Capability2 } from "@dxos/app-framework";
37
- var State = Capability2.lazy("State", () => import("./state-ZJEK6SP7.mjs"));
36
+ var State = Capability2.lazy("State", () => import("./state-PVDE6Q6G.mjs"));
38
37
 
39
38
  // src/components/Layout/Layout.tsx
40
39
  import { RegistryContext, useAtomValue } from "@effect-atom/atom-react";
41
40
  import React, { useCallback, useContext, useEffect, useRef, useState } from "react";
42
41
  import { Surface, useCapability } from "@dxos/app-framework/ui";
43
- import { AlertDialog, Dialog, Main, Popover, toLocalizedString, useTranslation } from "@dxos/react-ui";
42
+ import { AlertDialog, Button, Dialog, Icon, Main, Popover, Toast, toLocalizedString, useTranslation } from "@dxos/react-ui";
44
43
  import { Card } from "@dxos/react-ui";
45
44
  import { Mosaic } from "@dxos/react-ui-mosaic";
46
45
  import { descriptionMessage, mx } from "@dxos/ui-theme";
47
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
+ };
48
73
  var Layout = ({ children }) => {
49
74
  const { t } = useTranslation(meta.id);
50
75
  const trigger = useRef(null);
@@ -103,9 +128,17 @@ var Layout = ({ children }) => {
103
128
  }, [
104
129
  handleClose
105
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
+ ]);
106
139
  const DialogRoot = layout.dialogType === "alert" ? AlertDialog.Root : Dialog.Root;
107
140
  const DialogOverlay = layout.dialogType === "alert" ? AlertDialog.Overlay : Dialog.Overlay;
108
- return /* @__PURE__ */ React.createElement("div", {
141
+ return /* @__PURE__ */ React.createElement(Toast.Provider, null, /* @__PURE__ */ React.createElement("div", {
109
142
  role: "none",
110
143
  className: "fixed inset-0 flex overflow-hidden"
111
144
  }, /* @__PURE__ */ React.createElement(Mosaic.Root, null, /* @__PURE__ */ React.createElement(Popover.Root, {
@@ -159,7 +192,11 @@ var Layout = ({ children }) => {
159
192
  role: "popover",
160
193
  data: layout.popoverContent,
161
194
  limit: 1
162
- })), /* @__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)));
163
200
  };
164
201
  var ErrorFallback = ({ error }) => {
165
202
  const { t } = useTranslation(meta.id);
@@ -174,8 +211,8 @@ var ErrorFallback = ({ error }) => {
174
211
  };
175
212
 
176
213
  // src/StorybookPlugin.ts
177
- var StorybookPlugin = Plugin.define(meta).pipe(AppPlugin.addOperationResolverModule({
178
- activate: OperationResolver
214
+ var StorybookPlugin = Plugin.define(meta).pipe(AppPlugin.addOperationHandlerModule({
215
+ activate: OperationHandler
179
216
  }), AppPlugin.addReactContextModule({
180
217
  activate: () => Effect.succeed(Capability3.contributes(Capabilities.ReactContext, {
181
218
  id: "storybook-layout",
@@ -192,14 +229,7 @@ var StorybookPlugin = Plugin.define(meta).pipe(AppPlugin.addOperationResolverMod
192
229
  })
193
230
  })), Plugin.make);
194
231
  export {
195
- AttentionPlugin,
196
- ClientPlugin,
197
- GraphPlugin,
198
- OperationPlugin,
199
- RuntimePlugin,
200
- SettingsPlugin,
201
232
  StorybookPlugin,
202
- ThemePlugin,
203
233
  corePlugins,
204
234
  meta
205
235
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/core.ts", "../../../src/StorybookPlugin.ts", "../../../src/capabilities/operation-resolver/index.ts", "../../../src/capabilities/state/index.ts", "../../../src/components/Layout/Layout.tsx"],
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 { ClientPlugin } from '@dxos/plugin-client';\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// TODO(burdon): Remove this.\n// Re-export common framework plugins.\nexport { AttentionPlugin, ClientPlugin, GraphPlugin, OperationPlugin, RuntimePlugin, SettingsPlugin, ThemePlugin };\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 * as Effect from 'effect/Effect';\n\nimport { ActivationEvents, Capabilities, Capability, Plugin } from '@dxos/app-framework';\nimport { AppActivationEvents, AppPlugin } from '@dxos/app-toolkit';\n\nimport { OperationResolver, 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.addOperationResolverModule({\n activate: OperationResolver,\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 activatesAfter: [AppActivationEvents.LayoutReady],\n activate: () => State({ initialState }),\n })),\n Plugin.make,\n);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const OperationResolver = Capability.lazy('OperationResolver', () => import('./operation-resolver'));\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const State = Capability.lazy('State', () => import('./state'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { RegistryContext, useAtomValue } from '@effect-atom/atom-react';\nimport React, { type PropsWithChildren, useCallback, useContext, useEffect, useRef, useState } from 'react';\n\nimport { Surface, useCapability } from '@dxos/app-framework/ui';\nimport {\n AlertDialog,\n Dialog,\n Main,\n Popover,\n type PopoverContentInteractOutsideEvent,\n toLocalizedString,\n useTranslation,\n} from '@dxos/react-ui';\nimport { Card } from '@dxos/react-ui';\nimport { Mosaic } from '@dxos/react-ui-mosaic';\nimport { descriptionMessage, mx } from '@dxos/ui-theme';\n\nimport { meta } from '../../meta';\nimport { LayoutState, type LayoutStateProps } from '../../types';\n\nconst debounce_delay = 100;\n\n// TODO(wittjosiah): Support dialogs, tooltips, maybe toast.\nexport const Layout = ({ children }: PropsWithChildren<{}>) => {\n const { t } = useTranslation(meta.id);\n const trigger = useRef<HTMLButtonElement | null>(null);\n const registry = useContext(RegistryContext);\n const stateAtom = useCapability(LayoutState);\n const layout = useAtomValue(stateAtom);\n const [iter, setIter] = useState(0);\n const [open, setOpen] = useState(false);\n const debounceRef = useRef<NodeJS.Timeout | null>(null);\n\n const updateState = useCallback(\n (updates: Partial<LayoutStateProps>) => {\n const current = registry.get(stateAtom);\n registry.set(stateAtom, { ...current, ...updates });\n },\n [registry, stateAtom],\n );\n\n useEffect(() => {\n setOpen(false);\n if (debounceRef.current) {\n clearTimeout(debounceRef.current);\n debounceRef.current = null;\n }\n trigger.current = layout.popoverAnchor ?? null;\n setIter((iter) => iter + 1);\n if (layout.popoverOpen) {\n debounceRef.current = setTimeout(() => setOpen(true), debounce_delay);\n }\n }, [layout.popoverAnchor, layout.popoverContent, layout.popoverOpen]);\n\n const handleClose = useCallback(() => {\n setOpen(false);\n updateState({\n popoverOpen: false,\n popoverAnchor: undefined,\n popoverAnchorId: undefined,\n popoverSide: undefined,\n });\n }, [updateState]);\n\n const handleInteractOutside = useCallback(\n (event: KeyboardEvent | PopoverContentInteractOutsideEvent) => {\n if (\n // TODO(thure): CodeMirror should not focus itself when it updates.\n event.type === 'dismissableLayer.focusOutside' &&\n (event.currentTarget as HTMLElement | undefined)?.classList.contains('cm-content')\n ) {\n event.preventDefault();\n } else {\n handleClose();\n }\n },\n [handleClose],\n );\n\n const DialogRoot = layout.dialogType === 'alert' ? AlertDialog.Root : Dialog.Root;\n const DialogOverlay = layout.dialogType === 'alert' ? AlertDialog.Overlay : Dialog.Overlay;\n\n return (\n <div role='none' className='fixed inset-0 flex overflow-hidden'>\n <Mosaic.Root>\n <Popover.Root open={open}>\n <Main.Root\n navigationSidebarState={layout.sidebarState}\n complementarySidebarState={layout.complementarySidebarState}\n onNavigationSidebarStateChange={(next) => updateState({ sidebarState: next })}\n onComplementarySidebarStateChange={(next) => updateState({ complementarySidebarState: next })}\n >\n {children}\n </Main.Root>\n\n <DialogRoot\n modal={layout.dialogBlockAlign !== 'end'}\n open={layout.dialogOpen}\n onOpenChange={(nextOpen) => updateState({ dialogOpen: nextOpen })}\n >\n {layout.dialogBlockAlign === 'end' ? (\n <Surface.Surface\n role='dialog'\n data={layout.dialogContent}\n limit={1}\n fallback={ErrorFallback}\n placeholder={<div />}\n />\n ) : (\n <DialogOverlay\n blockAlign={layout.dialogBlockAlign}\n classNames={layout.dialogOverlayClasses}\n style={layout.dialogOverlayStyle}\n >\n <Surface.Surface role='dialog' data={layout.dialogContent} limit={1} fallback={ErrorFallback} />\n </DialogOverlay>\n )}\n </DialogRoot>\n\n <Popover.VirtualTrigger key={iter} virtualRef={trigger} />\n <Popover.Portal>\n <Popover.Content\n side={layout.popoverSide}\n onInteractOutside={handleInteractOutside}\n onEscapeKeyDown={handleInteractOutside}\n sticky='always'\n hideWhenDetached\n >\n <Popover.Viewport>\n {layout.popoverKind === 'card' && (\n <Card.Root>\n <Card.Toolbar>\n {/* TODO(wittjosiah): Cleaner way to handle no drag handle in toolbar? */}\n <span />\n {layout.popoverTitle ? (\n <Card.Title>{toLocalizedString(layout.popoverTitle, t)}</Card.Title>\n ) : (\n <span />\n )}\n <Card.CloseIconButton onClick={handleClose} />\n </Card.Toolbar>\n <Surface.Surface role='card--content' data={layout.popoverContent} limit={1} />\n </Card.Root>\n )}\n {layout.popoverKind === 'base' && (\n <Surface.Surface role='popover' data={layout.popoverContent} limit={1} />\n )}\n </Popover.Viewport>\n <Popover.Arrow />\n </Popover.Content>\n </Popover.Portal>\n </Popover.Root>\n </Mosaic.Root>\n </div>\n );\n};\n\nexport const ErrorFallback = ({ error }: { error?: Error }) => {\n const { t } = useTranslation(meta.id);\n const errorString = error?.toString() ?? '';\n return (\n <div\n role='alert'\n data-testid='error-boundary-fallback'\n className={mx('overflow-auto p-8 dx-attention-surface grid place-items-center')}\n >\n <p className={mx(descriptionMessage, 'break-words rounded-md p-8', errorString.length < 256 && 'text-lg')}>\n {error ? errorString : t('error fallback message')}\n </p>\n </div>\n );\n};\n"],
5
- "mappings": ";;;;;;;AAIA,SAASA,iBAA8BC,qBAAqB;AAC5D,SAASC,uBAAuB;AAChC,SAASC,oBAAoB;AAC7B,SAASC,mBAAmB;AAC5B,SAASC,sBAAsB;AAC/B,SAASC,mBAAmB;AAC5B,SAASC,iBAAiB;AAWnB,IAAMC,cAAc,MAAuB;EAChDC,gBAAAA;EACAC,YAAAA;EACAC,gBAAAA;EACAC,cAAAA;EACAC,eAAAA;EACAC,YAAY;IAAEC,IAAIC;EAAU,CAAA;;;;ACvB9B,YAAYC,YAAY;AAExB,SAASC,kBAAkBC,cAAcC,cAAAA,aAAYC,cAAc;AACnE,SAASC,qBAAqBC,iBAAiB;;;ACH/C,SAASC,kBAAkB;AAEpB,IAAMC,oBAAoBC,WAAWC,KAAK,qBAAqB,MAAM,OAAO,mCAAA,CAAA;;;ACFnF,SAASC,cAAAA,mBAAkB;AAEpB,IAAMC,QAAQC,YAAWC,KAAK,SAAS,MAAM,OAAO,sBAAA,CAAA;;;ACF3D,SAASC,iBAAiB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,SAAA;KAC5FP,QAAQC,cAAcrG,EAAE,wBAAA,CAAA,CAAA;AAIjC;;;AH7JO,IAAM4G,kBAAkBC,OAAOC,OAA+BC,IAAAA,EAAMC,KACzEC,UAAUC,2BAA2B;EACnCC,UAAUC;AACZ,CAAA,GACAH,UAAUI,sBAAsB;EAC9BF,UAAU,MACDG,eACLC,YAAWC,YAAYC,aAAaC,cAAc;IAChDC,IAAI;IACJC,SAASC;EACX,CAAA,CAAA;AAEN,CAAA,GACAhB,OAAOiB,UAAU,CAAC,EAAEC,aAAY,OAAQ;EACtCJ,IAAIJ,YAAWS,aAAaC,KAAAA;EAC5BC,aAAaC,iBAAiBC;EAC9BC,gBAAgB;IAACC,oBAAoBC;;EACrCpB,UAAU,MAAMc,MAAM;IAAEF;EAAa,CAAA;AACvC,EAAA,GACAlB,OAAO2B,IAAI;",
6
- "names": ["OperationPlugin", "RuntimePlugin", "AttentionPlugin", "ClientPlugin", "GraphPlugin", "SettingsPlugin", "ThemePlugin", "defaultTx", "corePlugins", "AttentionPlugin", "GraphPlugin", "OperationPlugin", "RuntimePlugin", "SettingsPlugin", "ThemePlugin", "tx", "defaultTx", "Effect", "ActivationEvents", "Capabilities", "Capability", "Plugin", "AppActivationEvents", "AppPlugin", "Capability", "OperationResolver", "Capability", "lazy", "Capability", "State", "Capability", "lazy", "RegistryContext", "useAtomValue", "React", "useCallback", "useContext", "useEffect", "useRef", "useState", "Surface", "useCapability", "AlertDialog", "Dialog", "Main", "Popover", "toLocalizedString", "useTranslation", "Card", "Mosaic", "descriptionMessage", "mx", "debounce_delay", "Layout", "children", "t", "useTranslation", "meta", "id", "trigger", "useRef", "registry", "useContext", "RegistryContext", "stateAtom", "useCapability", "LayoutState", "layout", "useAtomValue", "iter", "setIter", "useState", "open", "setOpen", "debounceRef", "updateState", "useCallback", "updates", "current", "get", "set", "useEffect", "clearTimeout", "popoverAnchor", "popoverOpen", "setTimeout", "popoverContent", "handleClose", "undefined", "popoverAnchorId", "popoverSide", "handleInteractOutside", "event", "type", "currentTarget", "classList", "contains", "preventDefault", "DialogRoot", "dialogType", "AlertDialog", "Root", "Dialog", "DialogOverlay", "Overlay", "div", "role", "className", "Mosaic", "Popover", "Main", "navigationSidebarState", "sidebarState", "complementarySidebarState", "onNavigationSidebarStateChange", "next", "onComplementarySidebarStateChange", "modal", "dialogBlockAlign", "dialogOpen", "onOpenChange", "nextOpen", "Surface", "data", "dialogContent", "limit", "fallback", "ErrorFallback", "placeholder", "blockAlign", "classNames", "dialogOverlayClasses", "style", "dialogOverlayStyle", "VirtualTrigger", "key", "virtualRef", "Portal", "Content", "side", "onInteractOutside", "onEscapeKeyDown", "sticky", "hideWhenDetached", "Viewport", "popoverKind", "Card", "Toolbar", "span", "popoverTitle", "Title", "toLocalizedString", "CloseIconButton", "onClick", "Arrow", "error", "errorString", "toString", "data-testid", "mx", "p", "descriptionMessage", "length", "StorybookPlugin", "Plugin", "define", "meta", "pipe", "AppPlugin", "addOperationResolverModule", "activate", "OperationResolver", "addReactContextModule", "succeed", "Capability", "contributes", "Capabilities", "ReactContext", "id", "context", "Layout", "addModule", "initialState", "getModuleTag", "State", "activatesOn", "ActivationEvents", "Startup", "activatesAfter", "AppActivationEvents", "LayoutReady", "make"]
3
+ "sources": ["../../../src/core.ts", "../../../src/StorybookPlugin.ts", "../../../src/capabilities/operation-handler/index.ts", "../../../src/capabilities/state/index.ts", "../../../src/components/Layout/Layout.tsx"],
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 * 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 activatesAfter: [AppActivationEvents.LayoutReady],\n activate: () => State({ initialState }),\n })),\n Plugin.make,\n);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\nimport { OperationHandlerSet } from '@dxos/operation';\n\nexport const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(\n 'OperationHandler',\n () => import('./operation-handler'),\n);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const State = Capability.lazy('State', () => import('./state'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { RegistryContext, useAtomValue } from '@effect-atom/atom-react';\nimport React, { type PropsWithChildren, useCallback, useContext, useEffect, useRef, useState } from 'react';\n\nimport { Surface, useCapability } from '@dxos/app-framework/ui';\nimport { type LayoutOperation } from '@dxos/app-toolkit';\nimport {\n AlertDialog,\n Button,\n Dialog,\n Icon,\n Main,\n Popover,\n type PopoverContentInteractOutsideEvent,\n Toast,\n toLocalizedString,\n useTranslation,\n} from '@dxos/react-ui';\nimport { Card } from '@dxos/react-ui';\nimport { Mosaic } from '@dxos/react-ui-mosaic';\nimport { descriptionMessage, mx } from '@dxos/ui-theme';\n\nimport { meta } from '../../meta';\nimport { LayoutState, type LayoutStateProps } from '../../types';\n\nconst debounce_delay = 100;\n\nconst StoryToast = ({ toast, onDismiss }: { toast: LayoutOperation.Toast; onDismiss: (id: string) => void }) => {\n const { t } = useTranslation(meta.id);\n return (\n <Toast.Root\n data-testid={toast.id}\n defaultOpen\n duration={toast.duration}\n onOpenChange={(open) => {\n if (!open) {\n onDismiss(toast.id);\n }\n }}\n >\n <Toast.Body>\n <Toast.Title classNames='items-center'>\n {toast.icon && <Icon icon={toast.icon} classNames='inline mr-1' />}\n {toast.title && <span>{toLocalizedString(toast.title, t)}</span>}\n </Toast.Title>\n {toast.description && <Toast.Description>{toLocalizedString(toast.description, t)}</Toast.Description>}\n </Toast.Body>\n <Toast.Actions>\n {toast.onAction && toast.actionAlt && toast.actionLabel && (\n <Toast.Action altText={toLocalizedString(toast.actionAlt, t)} asChild>\n <Button variant='primary' onClick={() => toast.onAction?.()}>\n {toLocalizedString(toast.actionLabel, t)}\n </Button>\n </Toast.Action>\n )}\n {toast.closeLabel && (\n <Toast.Close asChild>\n <Button>{toLocalizedString(toast.closeLabel, t)}</Button>\n </Toast.Close>\n )}\n </Toast.Actions>\n </Toast.Root>\n );\n};\n\nexport const Layout = ({ children }: PropsWithChildren<{}>) => {\n const { t } = useTranslation(meta.id);\n const trigger = useRef<HTMLButtonElement | null>(null);\n const registry = useContext(RegistryContext);\n const stateAtom = useCapability(LayoutState);\n const layout = useAtomValue(stateAtom);\n const [iter, setIter] = useState(0);\n const [open, setOpen] = useState(false);\n const debounceRef = useRef<NodeJS.Timeout | null>(null);\n\n const updateState = useCallback(\n (updates: Partial<LayoutStateProps>) => {\n const current = registry.get(stateAtom);\n registry.set(stateAtom, { ...current, ...updates });\n },\n [registry, stateAtom],\n );\n\n useEffect(() => {\n setOpen(false);\n if (debounceRef.current) {\n clearTimeout(debounceRef.current);\n debounceRef.current = null;\n }\n trigger.current = layout.popoverAnchor ?? null;\n setIter((iter) => iter + 1);\n if (layout.popoverOpen) {\n debounceRef.current = setTimeout(() => setOpen(true), debounce_delay);\n }\n }, [layout.popoverAnchor, layout.popoverContent, layout.popoverOpen]);\n\n const handleClose = useCallback(() => {\n setOpen(false);\n updateState({\n popoverOpen: false,\n popoverAnchor: undefined,\n popoverAnchorId: undefined,\n popoverSide: undefined,\n });\n }, [updateState]);\n\n const handleInteractOutside = useCallback(\n (event: KeyboardEvent | PopoverContentInteractOutsideEvent) => {\n if (\n // TODO(thure): CodeMirror should not focus itself when it updates.\n event.type === 'dismissableLayer.focusOutside' &&\n (event.currentTarget as HTMLElement | undefined)?.classList.contains('cm-content')\n ) {\n event.preventDefault();\n } else {\n handleClose();\n }\n },\n [handleClose],\n );\n\n const handleDismissToast = useCallback(\n (id: string) => {\n updateState({ toasts: layout.toasts.filter((toast) => toast.id !== id) });\n },\n [updateState, layout.toasts],\n );\n\n const DialogRoot = layout.dialogType === 'alert' ? AlertDialog.Root : Dialog.Root;\n const DialogOverlay = layout.dialogType === 'alert' ? AlertDialog.Overlay : Dialog.Overlay;\n\n return (\n <Toast.Provider>\n <div role='none' className='fixed inset-0 flex overflow-hidden'>\n <Mosaic.Root>\n <Popover.Root open={open}>\n <Main.Root\n navigationSidebarState={layout.sidebarState}\n complementarySidebarState={layout.complementarySidebarState}\n onNavigationSidebarStateChange={(next) => updateState({ sidebarState: next })}\n onComplementarySidebarStateChange={(next) => updateState({ complementarySidebarState: next })}\n >\n {children}\n </Main.Root>\n\n <DialogRoot\n modal={layout.dialogBlockAlign !== 'end'}\n open={layout.dialogOpen}\n onOpenChange={(nextOpen) => updateState({ dialogOpen: nextOpen })}\n >\n {layout.dialogBlockAlign === 'end' ? (\n <Surface.Surface\n role='dialog'\n data={layout.dialogContent}\n limit={1}\n fallback={ErrorFallback}\n placeholder={<div />}\n />\n ) : (\n <DialogOverlay\n blockAlign={layout.dialogBlockAlign}\n classNames={layout.dialogOverlayClasses}\n style={layout.dialogOverlayStyle}\n >\n <Surface.Surface role='dialog' data={layout.dialogContent} limit={1} fallback={ErrorFallback} />\n </DialogOverlay>\n )}\n </DialogRoot>\n\n <Popover.VirtualTrigger key={iter} virtualRef={trigger} />\n <Popover.Portal>\n <Popover.Content\n side={layout.popoverSide}\n onInteractOutside={handleInteractOutside}\n onEscapeKeyDown={handleInteractOutside}\n sticky='always'\n hideWhenDetached\n >\n <Popover.Viewport>\n {layout.popoverKind === 'card' && (\n <Card.Root>\n <Card.Toolbar>\n {/* TODO(wittjosiah): Cleaner way to handle no drag handle in toolbar? */}\n <span />\n {layout.popoverTitle ? (\n <Card.Title>{toLocalizedString(layout.popoverTitle, t)}</Card.Title>\n ) : (\n <span />\n )}\n <Card.CloseIconButton onClick={handleClose} />\n </Card.Toolbar>\n <Surface.Surface role='card--content' data={layout.popoverContent} limit={1} />\n </Card.Root>\n )}\n {layout.popoverKind === 'base' && (\n <Surface.Surface role='popover' data={layout.popoverContent} limit={1} />\n )}\n </Popover.Viewport>\n <Popover.Arrow />\n </Popover.Content>\n </Popover.Portal>\n </Popover.Root>\n </Mosaic.Root>\n {layout.toasts.map((toast) => (\n <StoryToast key={toast.id} toast={toast} onDismiss={handleDismissToast} />\n ))}\n <Toast.Viewport />\n </div>\n </Toast.Provider>\n );\n};\n\nexport const ErrorFallback = ({ error }: { error?: Error }) => {\n const { t } = useTranslation(meta.id);\n const errorString = error?.toString() ?? '';\n return (\n <div\n role='alert'\n data-testid='error-boundary-fallback'\n className={mx('overflow-auto p-8 dx-attention-surface grid place-items-center')}\n >\n <p className={mx(descriptionMessage, 'break-words rounded-md p-8', errorString.length < 256 && 'text-lg')}>\n {error ? errorString : t('error fallback message')}\n </p>\n </div>\n );\n};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,CAAA,GACAhB,OAAOiB,UAAU,CAAC,EAAEC,aAAY,OAAQ;EACtCJ,IAAIJ,YAAWS,aAAaC,KAAAA;EAC5BC,aAAaC,iBAAiBC;EAC9BC,gBAAgB;IAACC,oBAAoBC;;EACrCpB,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", "Effect", "ActivationEvents", "Capabilities", "Capability", "Plugin", "AppActivationEvents", "AppPlugin", "Capability", "OperationHandler", "Capability", "lazy", "Capability", "State", "Capability", "lazy", "RegistryContext", "useAtomValue", "React", "useCallback", "useContext", "useEffect", "useRef", "useState", "Surface", "useCapability", "AlertDialog", "Button", "Dialog", "Icon", "Main", "Popover", "Toast", "toLocalizedString", "useTranslation", "Card", "Mosaic", "descriptionMessage", "mx", "debounce_delay", "StoryToast", "toast", "onDismiss", "t", "useTranslation", "meta", "id", "Toast", "Root", "data-testid", "defaultOpen", "duration", "onOpenChange", "open", "Body", "Title", "classNames", "icon", "Icon", "title", "span", "toLocalizedString", "description", "Description", "Actions", "onAction", "actionAlt", "actionLabel", "Action", "altText", "asChild", "Button", "variant", "onClick", "closeLabel", "Close", "Layout", "children", "trigger", "useRef", "registry", "useContext", "RegistryContext", "stateAtom", "useCapability", "LayoutState", "layout", "useAtomValue", "iter", "setIter", "useState", "setOpen", "debounceRef", "updateState", "useCallback", "updates", "current", "get", "set", "useEffect", "clearTimeout", "popoverAnchor", "popoverOpen", "setTimeout", "popoverContent", "handleClose", "undefined", "popoverAnchorId", "popoverSide", "handleInteractOutside", "event", "type", "currentTarget", "classList", "contains", "preventDefault", "handleDismissToast", "toasts", "filter", "DialogRoot", "dialogType", "AlertDialog", "Dialog", "DialogOverlay", "Overlay", "Provider", "div", "role", "className", "Mosaic", "Popover", "Main", "navigationSidebarState", "sidebarState", "complementarySidebarState", "onNavigationSidebarStateChange", "next", "onComplementarySidebarStateChange", "modal", "dialogBlockAlign", "dialogOpen", "nextOpen", "Surface", "data", "dialogContent", "limit", "fallback", "ErrorFallback", "placeholder", "blockAlign", "dialogOverlayClasses", "style", "dialogOverlayStyle", "VirtualTrigger", "key", "virtualRef", "Portal", "Content", "side", "onInteractOutside", "onEscapeKeyDown", "sticky", "hideWhenDetached", "Viewport", "popoverKind", "Card", "Toolbar", "popoverTitle", "CloseIconButton", "Arrow", "map", "error", "errorString", "toString", "mx", "p", "descriptionMessage", "length", "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", "activatesAfter", "AppActivationEvents", "LayoutReady", "make"]
7
7
  }