@dxos/plugin-testing 0.8.4-main.c85a9c8dae → 0.8.4-main.d9fc60f731

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 (165) hide show
  1. package/LICENSE +102 -5
  2. package/dist/lib/neutral/StorybookPlugin.mjs +10 -0
  3. package/dist/lib/neutral/StorybookPlugin.mjs.map +7 -0
  4. package/dist/lib/neutral/add-toast-Z2RXG4RX.mjs +23 -0
  5. package/dist/lib/neutral/add-toast-Z2RXG4RX.mjs.map +7 -0
  6. package/dist/lib/neutral/capabilities/index.mjs +11 -0
  7. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  8. package/dist/lib/neutral/chunk-C7HWAFWJ.mjs +21 -0
  9. package/dist/lib/neutral/chunk-C7HWAFWJ.mjs.map +7 -0
  10. package/dist/lib/{browser/chunk-YHPXIILW.mjs → neutral/chunk-HI5MWUZZ.mjs} +8 -10
  11. package/dist/lib/neutral/chunk-HI5MWUZZ.mjs.map +7 -0
  12. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
  13. package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
  14. package/dist/lib/neutral/chunk-NZ2VT6N2.mjs +17 -0
  15. package/dist/lib/neutral/chunk-NZ2VT6N2.mjs.map +7 -0
  16. package/dist/lib/neutral/chunk-R7AV233N.mjs +31 -0
  17. package/dist/lib/neutral/chunk-R7AV233N.mjs.map +7 -0
  18. package/dist/lib/neutral/chunk-S4IEYCPX.mjs +8 -0
  19. package/dist/lib/neutral/chunk-S4IEYCPX.mjs.map +7 -0
  20. package/dist/lib/neutral/chunk-ULNF6GTG.mjs +21 -0
  21. package/dist/lib/neutral/chunk-ULNF6GTG.mjs.map +7 -0
  22. package/dist/lib/neutral/close-L3FBJQ3J.mjs +12 -0
  23. package/dist/lib/neutral/close-L3FBJQ3J.mjs.map +7 -0
  24. package/dist/lib/{browser → neutral/components}/index.mjs +53 -77
  25. package/dist/lib/neutral/components/index.mjs.map +7 -0
  26. package/dist/lib/neutral/core.mjs +8 -0
  27. package/dist/lib/neutral/core.mjs.map +7 -0
  28. package/dist/lib/neutral/harness.mjs +36 -0
  29. package/dist/lib/neutral/harness.mjs.map +7 -0
  30. package/dist/lib/neutral/index.mjs +20 -0
  31. package/dist/lib/neutral/index.mjs.map +7 -0
  32. package/dist/lib/neutral/meta.json +1 -0
  33. package/dist/lib/neutral/meta.mjs +8 -0
  34. package/dist/lib/neutral/meta.mjs.map +7 -0
  35. package/dist/lib/neutral/open-O5FFJF2B.mjs +17 -0
  36. package/dist/lib/neutral/open-O5FFJF2B.mjs.map +7 -0
  37. package/dist/lib/neutral/operation-handler-LQIWHQVY.mjs +13 -0
  38. package/dist/lib/neutral/operation-handler-LQIWHQVY.mjs.map +7 -0
  39. package/dist/lib/neutral/operations/index.mjs +8 -0
  40. package/dist/lib/neutral/operations/index.mjs.map +7 -0
  41. package/dist/lib/neutral/plugin.mjs +16 -0
  42. package/dist/lib/neutral/plugin.mjs.map +7 -0
  43. package/dist/lib/neutral/scroll-into-view-BKOOOECC.mjs +12 -0
  44. package/dist/lib/neutral/scroll-into-view-BKOOOECC.mjs.map +7 -0
  45. package/dist/lib/neutral/set-layout-mode-2KHD2AEY.mjs +12 -0
  46. package/dist/lib/neutral/set-layout-mode-2KHD2AEY.mjs.map +7 -0
  47. package/dist/lib/{browser/state-MIKI67FF.mjs → neutral/state-AJ62JEEG.mjs} +6 -6
  48. package/dist/lib/neutral/state-AJ62JEEG.mjs.map +7 -0
  49. package/dist/lib/neutral/switch-workspace-SAT2NGXV.mjs +20 -0
  50. package/dist/lib/neutral/switch-workspace-SAT2NGXV.mjs.map +7 -0
  51. package/dist/lib/neutral/types/index.mjs +8 -0
  52. package/dist/lib/neutral/types/index.mjs.map +7 -0
  53. package/dist/lib/neutral/update-complementary-JP2OL73Z.mjs +26 -0
  54. package/dist/lib/neutral/update-complementary-JP2OL73Z.mjs.map +7 -0
  55. package/dist/lib/neutral/update-dialog-MX6IKKJX.mjs +28 -0
  56. package/dist/lib/neutral/update-dialog-MX6IKKJX.mjs.map +7 -0
  57. package/dist/lib/neutral/update-popover-DOORE3TD.mjs +46 -0
  58. package/dist/lib/neutral/update-popover-DOORE3TD.mjs.map +7 -0
  59. package/dist/lib/neutral/update-sidebar-LWQ3IA6S.mjs +26 -0
  60. package/dist/lib/neutral/update-sidebar-LWQ3IA6S.mjs.map +7 -0
  61. package/dist/types/src/StorybookPlugin.d.ts +3 -2
  62. package/dist/types/src/StorybookPlugin.d.ts.map +1 -1
  63. package/dist/types/src/capabilities/index.d.ts +15 -2
  64. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  65. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  66. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  67. package/dist/types/src/capabilities/{state/state.d.ts → state.d.ts} +3 -3
  68. package/dist/types/src/capabilities/state.d.ts.map +1 -0
  69. package/dist/types/src/components/Layout/Layout.d.ts.map +1 -0
  70. package/dist/types/src/components/Layout/index.d.ts +2 -0
  71. package/dist/types/src/components/Layout/index.d.ts.map +1 -0
  72. package/dist/types/src/core.d.ts +1 -7
  73. package/dist/types/src/core.d.ts.map +1 -1
  74. package/dist/types/src/harness.d.ts +20 -0
  75. package/dist/types/src/harness.d.ts.map +1 -0
  76. package/dist/types/src/index.d.ts +1 -0
  77. package/dist/types/src/index.d.ts.map +1 -1
  78. package/dist/types/src/meta.d.ts +1 -1
  79. package/dist/types/src/meta.d.ts.map +1 -1
  80. package/dist/types/src/operations/add-toast.d.ts +5 -0
  81. package/dist/types/src/operations/add-toast.d.ts.map +1 -0
  82. package/dist/types/src/operations/close.d.ts +5 -0
  83. package/dist/types/src/operations/close.d.ts.map +1 -0
  84. package/dist/types/src/operations/index.d.ts +3 -0
  85. package/dist/types/src/operations/index.d.ts.map +1 -0
  86. package/dist/types/src/operations/open.d.ts +5 -0
  87. package/dist/types/src/operations/open.d.ts.map +1 -0
  88. package/dist/types/src/operations/scroll-into-view.d.ts +5 -0
  89. package/dist/types/src/operations/scroll-into-view.d.ts.map +1 -0
  90. package/dist/types/src/operations/set-layout-mode.d.ts +5 -0
  91. package/dist/types/src/operations/set-layout-mode.d.ts.map +1 -0
  92. package/dist/types/src/operations/switch-workspace.d.ts +5 -0
  93. package/dist/types/src/operations/switch-workspace.d.ts.map +1 -0
  94. package/dist/types/src/operations/update-complementary.d.ts +5 -0
  95. package/dist/types/src/operations/update-complementary.d.ts.map +1 -0
  96. package/dist/types/src/operations/update-dialog.d.ts +5 -0
  97. package/dist/types/src/operations/update-dialog.d.ts.map +1 -0
  98. package/dist/types/src/operations/update-popover.d.ts +5 -0
  99. package/dist/types/src/operations/update-popover.d.ts.map +1 -0
  100. package/dist/types/src/operations/update-sidebar.d.ts +5 -0
  101. package/dist/types/src/operations/update-sidebar.d.ts.map +1 -0
  102. package/dist/types/src/operations/update-state.d.ts +5 -0
  103. package/dist/types/src/operations/update-state.d.ts.map +1 -0
  104. package/dist/types/src/plugin.d.ts +5 -0
  105. package/dist/types/src/plugin.d.ts.map +1 -0
  106. package/dist/types/src/types/{capabilities.d.ts → StorybookCapabilities.d.ts} +3 -1
  107. package/dist/types/src/types/StorybookCapabilities.d.ts.map +1 -0
  108. package/dist/types/src/types/index.d.ts +1 -1
  109. package/dist/types/src/types/index.d.ts.map +1 -1
  110. package/dist/types/tsconfig.tsbuildinfo +1 -1
  111. package/package.json +63 -21
  112. package/src/StorybookPlugin.ts +10 -8
  113. package/src/capabilities/index.ts +8 -2
  114. package/src/capabilities/operation-handler.ts +16 -0
  115. package/src/capabilities/{state/state.tsx → state.tsx} +9 -5
  116. package/src/components/Layout/Layout.tsx +228 -0
  117. package/src/components/Layout/index.ts +5 -0
  118. package/src/core.ts +20 -13
  119. package/src/harness.ts +51 -0
  120. package/src/index.ts +6 -0
  121. package/src/meta.ts +6 -4
  122. package/src/operations/add-toast.ts +22 -0
  123. package/src/operations/close.ts +14 -0
  124. package/src/operations/index.ts +18 -0
  125. package/src/operations/open.ts +20 -0
  126. package/src/operations/scroll-into-view.ts +14 -0
  127. package/src/operations/set-layout-mode.ts +14 -0
  128. package/src/operations/switch-workspace.ts +20 -0
  129. package/src/operations/update-complementary.ts +27 -0
  130. package/src/operations/update-dialog.ts +27 -0
  131. package/src/operations/update-popover.ts +37 -0
  132. package/src/operations/update-sidebar.ts +26 -0
  133. package/src/operations/update-state.ts +19 -0
  134. package/src/plugin.ts +12 -0
  135. package/src/types/{capabilities.ts → StorybookCapabilities.ts} +7 -2
  136. package/src/types/index.ts +1 -1
  137. package/dist/lib/browser/chunk-YHPXIILW.mjs.map +0 -7
  138. package/dist/lib/browser/index.mjs.map +0 -7
  139. package/dist/lib/browser/meta.json +0 -1
  140. package/dist/lib/browser/operation-resolver-FLU4ZARD.mjs +0 -112
  141. package/dist/lib/browser/operation-resolver-FLU4ZARD.mjs.map +0 -7
  142. package/dist/lib/browser/state-MIKI67FF.mjs.map +0 -7
  143. package/dist/lib/node-esm/chunk-OWK6XE6C.mjs +0 -23
  144. package/dist/lib/node-esm/chunk-OWK6XE6C.mjs.map +0 -7
  145. package/dist/lib/node-esm/index.mjs +0 -206
  146. package/dist/lib/node-esm/index.mjs.map +0 -7
  147. package/dist/lib/node-esm/meta.json +0 -1
  148. package/dist/lib/node-esm/operation-resolver-NWF6KBHP.mjs +0 -113
  149. package/dist/lib/node-esm/operation-resolver-NWF6KBHP.mjs.map +0 -7
  150. package/dist/lib/node-esm/state-JQVVUKO2.mjs +0 -44
  151. package/dist/lib/node-esm/state-JQVVUKO2.mjs.map +0 -7
  152. package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
  153. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
  154. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
  155. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
  156. package/dist/types/src/capabilities/state/index.d.ts +0 -14
  157. package/dist/types/src/capabilities/state/index.d.ts.map +0 -1
  158. package/dist/types/src/capabilities/state/state.d.ts.map +0 -1
  159. package/dist/types/src/components/Layout.d.ts.map +0 -1
  160. package/dist/types/src/types/capabilities.d.ts.map +0 -1
  161. package/src/capabilities/operation-resolver/index.ts +0 -7
  162. package/src/capabilities/operation-resolver/operation-resolver.ts +0 -99
  163. package/src/capabilities/state/index.ts +0 -7
  164. package/src/components/Layout.tsx +0 -176
  165. /package/dist/types/src/components/{Layout.d.ts → Layout/Layout.d.ts} +0 -0
@@ -1,206 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- LayoutState,
4
- meta
5
- } from "./chunk-OWK6XE6C.mjs";
6
-
7
- // src/core.ts
8
- import { OperationPlugin, RuntimePlugin } from "@dxos/app-framework";
9
- import { AttentionPlugin } from "@dxos/plugin-attention";
10
- import { ClientPlugin } from "@dxos/plugin-client";
11
- import { GraphPlugin } from "@dxos/plugin-graph";
12
- import { SettingsPlugin } from "@dxos/plugin-settings";
13
- import { ThemePlugin } from "@dxos/plugin-theme";
14
- import { defaultTx } from "@dxos/ui-theme";
15
- var corePlugins = () => [
16
- AttentionPlugin(),
17
- GraphPlugin(),
18
- OperationPlugin(),
19
- RuntimePlugin(),
20
- SettingsPlugin(),
21
- ThemePlugin({
22
- tx: defaultTx
23
- })
24
- ];
25
-
26
- // src/StorybookPlugin.ts
27
- import * as Effect from "effect/Effect";
28
- import { ActivationEvents, Capabilities, Capability as Capability3, Plugin } from "@dxos/app-framework";
29
- import { AppActivationEvents, AppPlugin } from "@dxos/app-toolkit";
30
-
31
- // src/capabilities/operation-resolver/index.ts
32
- import { Capability } from "@dxos/app-framework";
33
- var OperationResolver = Capability.lazy("OperationResolver", () => import("./operation-resolver-NWF6KBHP.mjs"));
34
-
35
- // src/capabilities/state/index.ts
36
- import { Capability as Capability2 } from "@dxos/app-framework";
37
- var State = Capability2.lazy("State", () => import("./state-JQVVUKO2.mjs"));
38
-
39
- // src/components/Layout.tsx
40
- import { RegistryContext, useAtomValue } from "@effect-atom/atom-react";
41
- import React, { useCallback, useContext, useEffect, useRef, useState } from "react";
42
- import { Surface, useCapability } from "@dxos/app-framework/ui";
43
- import { AlertDialog, Dialog, Main, Popover, toLocalizedString, useTranslation } from "@dxos/react-ui";
44
- import { Card } from "@dxos/react-ui";
45
- import { Mosaic } from "@dxos/react-ui-mosaic";
46
- import { descriptionMessage, mx } from "@dxos/ui-theme";
47
- var debounce_delay = 100;
48
- var Layout = ({ children }) => {
49
- const { t } = useTranslation(meta.id);
50
- const trigger = useRef(null);
51
- const registry = useContext(RegistryContext);
52
- const stateAtom = useCapability(LayoutState);
53
- const layout = useAtomValue(stateAtom);
54
- const [iter, setIter] = useState(0);
55
- const [open, setOpen] = useState(false);
56
- const debounceRef = useRef(null);
57
- const updateState = useCallback((updates) => {
58
- const current = registry.get(stateAtom);
59
- registry.set(stateAtom, {
60
- ...current,
61
- ...updates
62
- });
63
- }, [
64
- registry,
65
- stateAtom
66
- ]);
67
- useEffect(() => {
68
- setOpen(false);
69
- if (debounceRef.current) {
70
- clearTimeout(debounceRef.current);
71
- debounceRef.current = null;
72
- }
73
- trigger.current = layout.popoverAnchor ?? null;
74
- setIter((iter2) => iter2 + 1);
75
- if (layout.popoverOpen) {
76
- debounceRef.current = setTimeout(() => setOpen(true), debounce_delay);
77
- }
78
- }, [
79
- layout.popoverAnchor,
80
- layout.popoverContent,
81
- layout.popoverOpen
82
- ]);
83
- const handleClose = useCallback(() => {
84
- setOpen(false);
85
- updateState({
86
- popoverOpen: false,
87
- popoverAnchor: void 0,
88
- popoverAnchorId: void 0,
89
- popoverSide: void 0
90
- });
91
- }, [
92
- updateState
93
- ]);
94
- const handleInteractOutside = useCallback((event) => {
95
- if (
96
- // TODO(thure): CodeMirror should not focus itself when it updates.
97
- event.type === "dismissableLayer.focusOutside" && event.currentTarget?.classList.contains("cm-content")
98
- ) {
99
- event.preventDefault();
100
- } else {
101
- handleClose();
102
- }
103
- }, [
104
- handleClose
105
- ]);
106
- const DialogRoot = layout.dialogType === "alert" ? AlertDialog.Root : Dialog.Root;
107
- const DialogOverlay = layout.dialogType === "alert" ? AlertDialog.Overlay : Dialog.Overlay;
108
- return /* @__PURE__ */ React.createElement("div", {
109
- role: "none",
110
- className: "fixed inset-0 flex overflow-hidden"
111
- }, /* @__PURE__ */ React.createElement(Mosaic.Root, null, /* @__PURE__ */ React.createElement(Popover.Root, {
112
- open
113
- }, /* @__PURE__ */ React.createElement(Main.Root, {
114
- navigationSidebarState: layout.sidebarState,
115
- complementarySidebarState: layout.complementarySidebarState,
116
- onNavigationSidebarStateChange: (next) => updateState({
117
- sidebarState: next
118
- }),
119
- onComplementarySidebarStateChange: (next) => updateState({
120
- complementarySidebarState: next
121
- })
122
- }, children), /* @__PURE__ */ React.createElement(DialogRoot, {
123
- modal: layout.dialogBlockAlign !== "end",
124
- open: layout.dialogOpen,
125
- onOpenChange: (nextOpen) => updateState({
126
- dialogOpen: nextOpen
127
- })
128
- }, layout.dialogBlockAlign === "end" ? /* @__PURE__ */ React.createElement(Surface.Surface, {
129
- role: "dialog",
130
- data: layout.dialogContent,
131
- limit: 1,
132
- fallback: ErrorFallback,
133
- placeholder: /* @__PURE__ */ React.createElement("div", null)
134
- }) : /* @__PURE__ */ React.createElement(DialogOverlay, {
135
- blockAlign: layout.dialogBlockAlign,
136
- classNames: layout.dialogOverlayClasses,
137
- style: layout.dialogOverlayStyle
138
- }, /* @__PURE__ */ React.createElement(Surface.Surface, {
139
- role: "dialog",
140
- data: layout.dialogContent,
141
- limit: 1,
142
- fallback: ErrorFallback
143
- }))), /* @__PURE__ */ React.createElement(Popover.VirtualTrigger, {
144
- key: iter,
145
- virtualRef: trigger
146
- }), /* @__PURE__ */ React.createElement(Popover.Portal, null, /* @__PURE__ */ React.createElement(Popover.Content, {
147
- side: layout.popoverSide,
148
- onInteractOutside: handleInteractOutside,
149
- onEscapeKeyDown: handleInteractOutside,
150
- sticky: "always",
151
- hideWhenDetached: true
152
- }, /* @__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, {
153
- onClick: handleClose
154
- })), /* @__PURE__ */ React.createElement(Surface.Surface, {
155
- role: "card--content",
156
- data: layout.popoverContent,
157
- limit: 1
158
- })), layout.popoverKind === "base" && /* @__PURE__ */ React.createElement(Surface.Surface, {
159
- role: "popover",
160
- data: layout.popoverContent,
161
- limit: 1
162
- })), /* @__PURE__ */ React.createElement(Popover.Arrow, null))))));
163
- };
164
- var ErrorFallback = ({ error }) => {
165
- const { t } = useTranslation(meta.id);
166
- const errorString = error?.toString() ?? "";
167
- return /* @__PURE__ */ React.createElement("div", {
168
- role: "alert",
169
- "data-testid": "error-boundary-fallback",
170
- className: mx("overflow-auto p-8 dx-attention-surface grid place-items-center")
171
- }, /* @__PURE__ */ React.createElement("p", {
172
- className: mx(descriptionMessage, "break-words rounded-md p-8", errorString.length < 256 && "text-lg")
173
- }, error ? errorString : t("error fallback message")));
174
- };
175
-
176
- // src/StorybookPlugin.ts
177
- var StorybookPlugin = Plugin.define(meta).pipe(AppPlugin.addOperationResolverModule({
178
- activate: OperationResolver
179
- }), AppPlugin.addReactContextModule({
180
- activate: () => Effect.succeed(Capability3.contributes(Capabilities.ReactContext, {
181
- id: "storybook-layout",
182
- context: Layout
183
- }))
184
- }), Plugin.addModule(({ initialState }) => ({
185
- id: Capability3.getModuleTag(State),
186
- activatesOn: ActivationEvents.Startup,
187
- activatesAfter: [
188
- AppActivationEvents.LayoutReady
189
- ],
190
- activate: () => State({
191
- initialState
192
- })
193
- })), Plugin.make);
194
- export {
195
- AttentionPlugin,
196
- ClientPlugin,
197
- GraphPlugin,
198
- OperationPlugin,
199
- RuntimePlugin,
200
- SettingsPlugin,
201
- StorybookPlugin,
202
- ThemePlugin,
203
- corePlugins,
204
- meta
205
- };
206
- //# sourceMappingURL=index.mjs.map
@@ -1,7 +0,0 @@
1
- {
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.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;AA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IAAChB,MAAK;IAAUiB,MAAMxD,OAAOmB;IAAgBuC,OAAO;OAGxE,sBAAA,cAAChB,QAAQ6C,OAAK,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAO5B;AAEO,IAAM3B,gBAAgB,CAAC,EAAE4B,MAAK,MAAqB;AACxD,QAAM,EAAEpG,EAAC,IAAKC,eAAeC,KAAKC,EAAE;AACpC,QAAMkG,cAAcD,OAAOE,SAAAA,KAAc;AACzC,SACE,sBAAA,cAACpD,OAAAA;IACCC,MAAK;IACLoD,eAAY;IACZnD,WAAWoD,GAAG,gEAAA;KAEd,sBAAA,cAACC,KAAAA;IAAErD,WAAWoD,GAAGE,oBAAoB,8BAA8BL,YAAYM,SAAS,OAAO,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"]
7
- }
@@ -1 +0,0 @@
1
- {"inputs":{"src/core.ts":{"bytes":3429,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-attention","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-settings","kind":"import-statement","external":true},{"path":"@dxos/plugin-theme","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"format":"esm"},"src/meta.ts":{"bytes":1661,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/types/capabilities.ts":{"bytes":2133,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"src/types/index.ts":{"bytes":476,"imports":[{"path":"src/types/capabilities.ts","kind":"import-statement","original":"./capabilities"}],"format":"esm"},"src/capabilities/operation-resolver/operation-resolver.ts":{"bytes":13577,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/operation","kind":"import-statement","external":true},{"path":"src/types/index.ts","kind":"import-statement","original":"../../types"}],"format":"esm"},"src/capabilities/operation-resolver/index.ts":{"bytes":963,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/operation-resolver/operation-resolver.ts","kind":"dynamic-import","original":"./operation-resolver"}],"format":"esm"},"src/capabilities/state/state.tsx":{"bytes":4774,"imports":[{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"src/types/index.ts","kind":"import-statement","original":"../../types"}],"format":"esm"},"src/capabilities/state/index.ts":{"bytes":837,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/state/state.tsx","kind":"dynamic-import","original":"./state"}],"format":"esm"},"src/capabilities/index.ts":{"bytes":578,"imports":[{"path":"src/capabilities/operation-resolver/index.ts","kind":"import-statement","original":"./operation-resolver"},{"path":"src/capabilities/state/index.ts","kind":"import-statement","original":"./state"}],"format":"esm"},"src/components/Layout.tsx":{"bytes":21229,"imports":[{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/components/index.ts":{"bytes":467,"imports":[{"path":"src/components/Layout.tsx","kind":"import-statement","original":"./Layout"}],"format":"esm"},"src/StorybookPlugin.ts":{"bytes":4319,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"src/index.ts":{"bytes":637,"imports":[{"path":"src/core.ts","kind":"import-statement","original":"./core"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/StorybookPlugin.ts","kind":"import-statement","original":"./StorybookPlugin"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":16075},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-OWK6XE6C.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-attention","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-settings","kind":"import-statement","external":true},{"path":"@dxos/plugin-theme","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/node-esm/operation-resolver-NWF6KBHP.mjs","kind":"dynamic-import"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/node-esm/state-JQVVUKO2.mjs","kind":"dynamic-import"},{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"exports":["AttentionPlugin","ClientPlugin","GraphPlugin","OperationPlugin","RuntimePlugin","SettingsPlugin","StorybookPlugin","ThemePlugin","corePlugins","meta"],"entryPoint":"src/index.ts","inputs":{"src/core.ts":{"bytesInOutput":546},"src/index.ts":{"bytesInOutput":0},"src/StorybookPlugin.ts":{"bytesInOutput":762},"src/capabilities/operation-resolver/index.ts":{"bytesInOutput":163},"src/capabilities/index.ts":{"bytesInOutput":0},"src/capabilities/state/index.ts":{"bytesInOutput":142},"src/components/Layout.tsx":{"bytesInOutput":5528},"src/components/index.ts":{"bytesInOutput":0}},"bytes":7687},"dist/lib/node-esm/operation-resolver-NWF6KBHP.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6708},"dist/lib/node-esm/operation-resolver-NWF6KBHP.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-OWK6XE6C.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/operation","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/operation-resolver/operation-resolver.ts","inputs":{"src/capabilities/operation-resolver/operation-resolver.ts":{"bytesInOutput":3417}},"bytes":3734},"dist/lib/node-esm/state-JQVVUKO2.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2537},"dist/lib/node-esm/state-JQVVUKO2.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-OWK6XE6C.mjs","kind":"import-statement"},{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/state/state.tsx","inputs":{"src/capabilities/state/state.tsx":{"bytesInOutput":1058}},"bytes":1324},"dist/lib/node-esm/chunk-OWK6XE6C.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2022},"dist/lib/node-esm/chunk-OWK6XE6C.mjs":{"imports":[{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"exports":["LayoutState","meta"],"inputs":{"src/meta.ts":{"bytesInOutput":395},"src/types/capabilities.ts":{"bytesInOutput":105},"src/types/index.ts":{"bytesInOutput":0}},"bytes":717}}}
@@ -1,113 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- LayoutState
4
- } from "./chunk-OWK6XE6C.mjs";
5
-
6
- // src/capabilities/operation-resolver/operation-resolver.ts
7
- import * as Effect from "effect/Effect";
8
- import { Capabilities, Capability } from "@dxos/app-framework";
9
- import { LayoutOperation } from "@dxos/app-toolkit";
10
- import { OperationResolver } from "@dxos/operation";
11
- var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(function* () {
12
- const registry = yield* Capability.get(Capabilities.AtomRegistry);
13
- const stateAtom = yield* Capability.get(LayoutState);
14
- const updateState = (fn) => {
15
- const current = registry.get(stateAtom);
16
- registry.set(stateAtom, {
17
- ...current,
18
- ...fn(current)
19
- });
20
- };
21
- return Capability.contributes(Capabilities.OperationResolver, [
22
- OperationResolver.make({
23
- operation: LayoutOperation.UpdateSidebar,
24
- handler: Effect.fnUntraced(function* ({ state }) {
25
- updateState((layout) => {
26
- const next = state ?? layout.sidebarState;
27
- if (next !== layout.sidebarState) {
28
- return {
29
- sidebarState: next
30
- };
31
- }
32
- return {};
33
- });
34
- })
35
- }),
36
- OperationResolver.make({
37
- operation: LayoutOperation.UpdateComplementary,
38
- handler: Effect.fnUntraced(function* ({ state }) {
39
- updateState((layout) => {
40
- const next = state ?? layout.complementarySidebarState;
41
- if (next !== layout.complementarySidebarState) {
42
- return {
43
- complementarySidebarState: next
44
- };
45
- }
46
- return {};
47
- });
48
- })
49
- }),
50
- OperationResolver.make({
51
- operation: LayoutOperation.UpdateDialog,
52
- handler: Effect.fnUntraced(function* ({ subject, state, type, blockAlign, overlayClasses, overlayStyle, props }) {
53
- updateState(() => ({
54
- dialogOpen: state ?? Boolean(subject),
55
- dialogType: type ?? "default",
56
- dialogBlockAlign: blockAlign ?? "center",
57
- dialogOverlayClasses: overlayClasses,
58
- dialogOverlayStyle: overlayStyle,
59
- dialogContent: subject ? {
60
- component: subject,
61
- props
62
- } : null
63
- }));
64
- })
65
- }),
66
- OperationResolver.make({
67
- operation: LayoutOperation.UpdatePopover,
68
- handler: Effect.fnUntraced(function* (input) {
69
- const { subject, state, side, kind, props } = input;
70
- updateState(() => {
71
- const base = {
72
- popoverKind: kind ?? "base",
73
- popoverTitle: kind === "card" ? input.title : void 0,
74
- popoverContent: typeof subject === "string" ? {
75
- component: subject,
76
- props
77
- } : subject ? {
78
- subject
79
- } : void 0,
80
- popoverOpen: state ?? Boolean(subject),
81
- popoverSide: side
82
- };
83
- if ("variant" in input && input.variant === "virtual") {
84
- return {
85
- ...base,
86
- popoverVariant: "virtual",
87
- popoverAnchor: input.anchor
88
- };
89
- } else if ("anchorId" in input) {
90
- return {
91
- ...base,
92
- popoverVariant: "react",
93
- popoverAnchorId: input.anchorId
94
- };
95
- }
96
- return base;
97
- });
98
- })
99
- }),
100
- OperationResolver.make({
101
- operation: LayoutOperation.SwitchWorkspace,
102
- handler: Effect.fnUntraced(function* ({ subject }) {
103
- updateState(() => ({
104
- workspace: subject
105
- }));
106
- })
107
- })
108
- ]);
109
- }));
110
- export {
111
- operation_resolver_default as default
112
- };
113
- //# sourceMappingURL=operation-resolver-NWF6KBHP.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/operation-resolver/operation-resolver.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { OperationResolver } from '@dxos/operation';\n\nimport { LayoutState, type LayoutStateProps } from '../../types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const registry = yield* Capability.get(Capabilities.AtomRegistry);\n const stateAtom = yield* Capability.get(LayoutState);\n\n const updateState = (fn: (state: LayoutStateProps) => Partial<LayoutStateProps>) => {\n const current = registry.get(stateAtom);\n registry.set(stateAtom, { ...current, ...fn(current) });\n };\n\n return Capability.contributes(Capabilities.OperationResolver, [\n OperationResolver.make({\n operation: LayoutOperation.UpdateSidebar,\n handler: Effect.fnUntraced(function* ({ state }) {\n updateState((layout) => {\n const next = state ?? layout.sidebarState;\n if (next !== layout.sidebarState) {\n return { sidebarState: next };\n }\n return {};\n });\n }),\n }),\n OperationResolver.make({\n operation: LayoutOperation.UpdateComplementary,\n handler: Effect.fnUntraced(function* ({ state }) {\n updateState((layout) => {\n const next = state ?? layout.complementarySidebarState;\n if (next !== layout.complementarySidebarState) {\n return { complementarySidebarState: next };\n }\n return {};\n });\n }),\n }),\n OperationResolver.make({\n operation: LayoutOperation.UpdateDialog,\n handler: Effect.fnUntraced(function* ({\n subject,\n state,\n type,\n blockAlign,\n overlayClasses,\n overlayStyle,\n props,\n }) {\n 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 OperationResolver.make({\n operation: LayoutOperation.UpdatePopover,\n handler: Effect.fnUntraced(function* (input) {\n const { subject, state, side, kind, props } = input;\n 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 OperationResolver.make({\n operation: LayoutOperation.SwitchWorkspace,\n handler: Effect.fnUntraced(function* ({ subject }) {\n updateState(() => ({ workspace: subject }));\n }),\n }),\n ]);\n }),\n);\n"],
5
- "mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,uBAAuB;AAChC,SAASC,yBAAyB;AAIlC,IAAA,6BAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,QAAMC,WAAW,OAAOH,WAAWI,IAAIC,aAAaC,YAAY;AAChE,QAAMC,YAAY,OAAOP,WAAWI,IAAII,WAAAA;AAExC,QAAMC,cAAc,CAACC,OAAAA;AACnB,UAAMC,UAAUR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,MAAK,IAAKU;AAC9CjC,oBAAY,MAAA;AACV,gBAAMoC,OAAkC;YACtCC,aAAaF,QAAQ;YACrBG,cAAcH,SAAS,SAASF,MAAMM,QAAQC;YAC9CC,gBACE,OAAOvB,YAAY,WAAW;cAAEa,WAAWb;cAASK;YAAM,IAAIL,UAAU;cAAEA;YAAQ,IAAIsB;YACxFE,aAAa/B,SAASc,QAAQP,OAAAA;YAC9ByB,aAAaT;UACf;AACA,cAAI,aAAaD,SAASA,MAAMW,YAAY,WAAW;AACrD,mBAAO;cAAE,GAAGR;cAAMS,gBAAgB;cAAWC,eAAeb,MAAMc;YAAO;UAC3E,WAAW,cAAcd,OAAO;AAC9B,mBAAO;cAAE,GAAGG;cAAMS,gBAAgB;cAASG,iBAAiBf,MAAMgB;YAAS;UAC7E;AACA,iBAAOb;QACT,CAAA;MACF,CAAA;IACF,CAAA;IACA/B,kBAAkBC,KAAK;MACrBC,WAAWC,gBAAgB0C;MAC3BxC,SAAgBjB,kBAAW,WAAW,EAAEyB,QAAO,GAAE;AAC/ClB,oBAAY,OAAO;UAAEmD,WAAWjC;QAAQ,EAAA;MAC1C,CAAA;IACF,CAAA;GACD;AACH,CAAA,CAAA;",
6
- "names": ["Effect", "Capabilities", "Capability", "LayoutOperation", "OperationResolver", "Capability", "makeModule", "fnUntraced", "registry", "get", "Capabilities", "AtomRegistry", "stateAtom", "LayoutState", "updateState", "fn", "current", "set", "contributes", "OperationResolver", "make", "operation", "LayoutOperation", "UpdateSidebar", "handler", "state", "layout", "next", "sidebarState", "UpdateComplementary", "complementarySidebarState", "UpdateDialog", "subject", "type", "blockAlign", "overlayClasses", "overlayStyle", "props", "dialogOpen", "Boolean", "dialogType", "dialogBlockAlign", "dialogOverlayClasses", "dialogOverlayStyle", "dialogContent", "component", "UpdatePopover", "input", "side", "kind", "base", "popoverKind", "popoverTitle", "title", "undefined", "popoverContent", "popoverOpen", "popoverSide", "variant", "popoverVariant", "popoverAnchor", "anchor", "popoverAnchorId", "anchorId", "SwitchWorkspace", "workspace"]
7
- }
@@ -1,44 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- LayoutState
4
- } from "./chunk-OWK6XE6C.mjs";
5
-
6
- // src/capabilities/state/state.tsx
7
- import { Atom } from "@effect-atom/atom-react";
8
- import * as Effect from "effect/Effect";
9
- import { Capability } from "@dxos/app-framework";
10
- import { AppCapabilities } from "@dxos/app-toolkit";
11
- var defaultState = {
12
- sidebarState: "closed",
13
- complementarySidebarState: "closed",
14
- dialogOpen: false,
15
- workspace: "default"
16
- };
17
- var state_default = Capability.makeModule(Effect.fnUntraced(function* (props) {
18
- const { initialState } = props ?? {};
19
- const stateAtom = Atom.make({
20
- ...defaultState,
21
- ...initialState
22
- });
23
- const layoutAtom = Atom.make((get) => {
24
- const state = get(stateAtom);
25
- return {
26
- mode: "storybook",
27
- dialogOpen: state.dialogOpen,
28
- sidebarOpen: state.sidebarState === "expanded",
29
- complementarySidebarOpen: state.complementarySidebarState === "expanded",
30
- workspace: state.workspace,
31
- active: [],
32
- inactive: [],
33
- scrollIntoView: void 0
34
- };
35
- });
36
- return [
37
- Capability.contributes(LayoutState, stateAtom),
38
- Capability.contributes(AppCapabilities.Layout, layoutAtom)
39
- ];
40
- }));
41
- export {
42
- state_default as default
43
- };
44
- //# sourceMappingURL=state-JQVVUKO2.mjs.map
@@ -1,7 +0,0 @@
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 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,WAAW;AACb;AAEA,IAAA,gBAAeC,WAAWC,WACjBC,kBAAW,WAAWC,OAAoD;AAC/E,QAAM,EAAEC,aAAY,IAAKD,SAAS,CAAC;AACnC,QAAME,YAAYC,KAAKC,KAAuB;IAAE,GAAGZ;IAAc,GAAGS;EAAa,CAAA;AAEjF,QAAMI,aAAaF,KAAKC,KAAK,CAACE,QAAAA;AAC5B,UAAMC,QAAQD,IAAIJ,SAAAA;AAClB,WAAO;MACLM,MAAM;MACNb,YAAYY,MAAMZ;MAClBc,aAAaF,MAAMd,iBAAiB;MACpCiB,0BAA0BH,MAAMb,8BAA8B;MAC9DE,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", "workspace", "Capability", "makeModule", "fnUntraced", "props", "initialState", "stateAtom", "Atom", "make", "layoutAtom", "get", "state", "mode", "sidebarOpen", "complementarySidebarOpen", "active", "inactive", "scrollIntoView", "undefined", "contributes", "LayoutState", "AppCapabilities", "Layout"]
7
- }
@@ -1,3 +0,0 @@
1
- import { Capability } from '@dxos/app-framework';
2
- export declare const OperationResolver: Capability.LazyCapability<void, Capability.Capability<Capability.InterfaceDef<import("@dxos/app-framework/Capabilities").OperationResolver[]>>, Error>;
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/operation-resolver/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,iBAAiB,wJAA6E,CAAC"}
@@ -1,5 +0,0 @@
1
- import * as Effect from 'effect/Effect';
2
- import { Capabilities, Capability } from '@dxos/app-framework';
3
- declare const _default: (props: void) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<Capabilities.OperationResolver[]>>, Error, Capability.Service>;
4
- export default _default;
5
- //# sourceMappingURL=operation-resolver.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"operation-resolver.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/operation-resolver/operation-resolver.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;;AAM/D,wBAsFE"}
@@ -1,14 +0,0 @@
1
- import { Capability } from '@dxos/app-framework';
2
- export declare const State: Capability.LazyCapability<{
3
- initialState?: Partial<import("../../types").LayoutStateProps>;
4
- } | undefined, [Capability.Capability<Capability.InterfaceDef<import("@effect-atom/atom/Atom").Writable<import("../../types").LayoutStateProps, import("../../types").LayoutStateProps>>>, Capability.Capability<Capability.InterfaceDef<import("@effect-atom/atom/Atom").Atom<Readonly<{
5
- mode: string;
6
- dialogOpen: boolean;
7
- sidebarOpen: boolean;
8
- complementarySidebarOpen: boolean;
9
- workspace: string;
10
- active: string[];
11
- inactive: string[];
12
- scrollIntoView: string | undefined;
13
- }>>>>], Error>;
14
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/state/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,KAAK;;;;;;;;;;;cAAoD,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/state/state.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;;mBAUT,OAAO,CAAC,gBAAgB,CAAC;;;;;;;;;;;AADjF,wBAqBE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAwD,MAAM,OAAO,CAAC;AAsB5G,eAAO,MAAM,MAAM,GAAI,cAAc,iBAAiB,CAAC,EAAE,CAAC,sBAoIzD,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,WAAW;IAAE,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,sBAczD,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../../../src/types/capabilities.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAI5C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,YAAY,CAAC,EAAE,UAAU,GAAG,WAAW,GAAG,QAAQ,CAAC;IACnD,yBAAyB,CAAC,EAAE,UAAU,GAAG,WAAW,GAAG,QAAQ,CAAC;IAEhE,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IACjC,gBAAgB,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IAC9C,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACzC,+CAA+C;IAC/C,aAAa,CAAC,EAAE,GAAG,CAAC;IAEpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAClD,cAAc,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IACrC,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,cAAc,CAAC,EAAE,GAAG,CAAC;IAErB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,WAAW,4EAAuE,CAAC"}
@@ -1,7 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Capability } from '@dxos/app-framework';
6
-
7
- export const OperationResolver = Capability.lazy('OperationResolver', () => import('./operation-resolver'));
@@ -1,99 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import * as Effect from 'effect/Effect';
6
-
7
- import { Capabilities, Capability } from '@dxos/app-framework';
8
- import { LayoutOperation } from '@dxos/app-toolkit';
9
- import { OperationResolver } from '@dxos/operation';
10
-
11
- import { LayoutState, type LayoutStateProps } from '../../types';
12
-
13
- export default Capability.makeModule(
14
- Effect.fnUntraced(function* () {
15
- const registry = yield* Capability.get(Capabilities.AtomRegistry);
16
- const stateAtom = yield* Capability.get(LayoutState);
17
-
18
- const updateState = (fn: (state: LayoutStateProps) => Partial<LayoutStateProps>) => {
19
- const current = registry.get(stateAtom);
20
- registry.set(stateAtom, { ...current, ...fn(current) });
21
- };
22
-
23
- return Capability.contributes(Capabilities.OperationResolver, [
24
- OperationResolver.make({
25
- operation: LayoutOperation.UpdateSidebar,
26
- handler: Effect.fnUntraced(function* ({ state }) {
27
- updateState((layout) => {
28
- const next = state ?? layout.sidebarState;
29
- if (next !== layout.sidebarState) {
30
- return { sidebarState: next };
31
- }
32
- return {};
33
- });
34
- }),
35
- }),
36
- OperationResolver.make({
37
- operation: LayoutOperation.UpdateComplementary,
38
- handler: Effect.fnUntraced(function* ({ state }) {
39
- updateState((layout) => {
40
- const next = state ?? layout.complementarySidebarState;
41
- if (next !== layout.complementarySidebarState) {
42
- return { complementarySidebarState: next };
43
- }
44
- return {};
45
- });
46
- }),
47
- }),
48
- OperationResolver.make({
49
- operation: LayoutOperation.UpdateDialog,
50
- handler: Effect.fnUntraced(function* ({
51
- subject,
52
- state,
53
- type,
54
- blockAlign,
55
- overlayClasses,
56
- overlayStyle,
57
- props,
58
- }) {
59
- updateState(() => ({
60
- dialogOpen: state ?? Boolean(subject),
61
- dialogType: type ?? 'default',
62
- dialogBlockAlign: blockAlign ?? 'center',
63
- dialogOverlayClasses: overlayClasses,
64
- dialogOverlayStyle: overlayStyle,
65
- dialogContent: subject ? { component: subject, props } : null,
66
- }));
67
- }),
68
- }),
69
- OperationResolver.make({
70
- operation: LayoutOperation.UpdatePopover,
71
- handler: Effect.fnUntraced(function* (input) {
72
- const { subject, state, side, kind, props } = input;
73
- updateState(() => {
74
- const base: Partial<LayoutStateProps> = {
75
- popoverKind: kind ?? 'base',
76
- popoverTitle: kind === 'card' ? input.title : undefined,
77
- popoverContent:
78
- typeof subject === 'string' ? { component: subject, props } : subject ? { subject } : undefined,
79
- popoverOpen: state ?? Boolean(subject),
80
- popoverSide: side,
81
- };
82
- if ('variant' in input && input.variant === 'virtual') {
83
- return { ...base, popoverVariant: 'virtual', popoverAnchor: input.anchor };
84
- } else if ('anchorId' in input) {
85
- return { ...base, popoverVariant: 'react', popoverAnchorId: input.anchorId };
86
- }
87
- return base;
88
- });
89
- }),
90
- }),
91
- OperationResolver.make({
92
- operation: LayoutOperation.SwitchWorkspace,
93
- handler: Effect.fnUntraced(function* ({ subject }) {
94
- updateState(() => ({ workspace: subject }));
95
- }),
96
- }),
97
- ]);
98
- }),
99
- );