@dxos/plugin-deck 0.8.4-main.7ace549 → 0.8.4-main.937b3ca

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 (267) hide show
  1. package/dist/lib/browser/app-graph-builder-DTVCULQ4.mjs +120 -0
  2. package/dist/lib/browser/app-graph-builder-DTVCULQ4.mjs.map +7 -0
  3. package/dist/lib/browser/{check-app-scheme-HIEVFAAX.mjs → check-app-scheme-JSRXXIYF.mjs} +9 -9
  4. package/dist/lib/browser/check-app-scheme-JSRXXIYF.mjs.map +7 -0
  5. package/dist/lib/browser/{chunk-F3VCCHVL.mjs → chunk-ATFPDN6J.mjs} +149 -19
  6. package/dist/lib/browser/chunk-ATFPDN6J.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-EREEXCHO.mjs +1448 -0
  8. package/dist/lib/browser/chunk-EREEXCHO.mjs.map +7 -0
  9. package/dist/lib/browser/{chunk-CNTGBCMK.mjs → chunk-NHABISX2.mjs} +40 -33
  10. package/dist/lib/browser/chunk-NHABISX2.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-UNG4CLLP.mjs +161 -0
  12. package/dist/lib/browser/chunk-UNG4CLLP.mjs.map +7 -0
  13. package/dist/lib/browser/index.mjs +71 -65
  14. package/dist/lib/browser/index.mjs.map +4 -4
  15. package/dist/lib/browser/meta.json +1 -1
  16. package/dist/lib/browser/operation-resolver-CDYBLZJ4.mjs +595 -0
  17. package/dist/lib/browser/operation-resolver-CDYBLZJ4.mjs.map +7 -0
  18. package/dist/lib/browser/react-root-LYNEKGHM.mjs +47 -0
  19. package/dist/lib/browser/react-root-LYNEKGHM.mjs.map +7 -0
  20. package/dist/lib/browser/react-surface-RPKD7XUR.mjs +42 -0
  21. package/dist/lib/browser/react-surface-RPKD7XUR.mjs.map +7 -0
  22. package/dist/lib/browser/settings-OMHVGZ6V.mjs +37 -0
  23. package/dist/lib/browser/settings-OMHVGZ6V.mjs.map +7 -0
  24. package/dist/lib/browser/state-OC3BSB6E.mjs +103 -0
  25. package/dist/lib/browser/state-OC3BSB6E.mjs.map +7 -0
  26. package/dist/lib/browser/{toolkit-L5CFXJCF.mjs → toolkit-R53LD3EA.mjs} +16 -15
  27. package/dist/lib/browser/toolkit-R53LD3EA.mjs.map +7 -0
  28. package/dist/lib/browser/types/index.mjs +11 -4
  29. package/dist/lib/browser/url-handler-53TE6JZO.mjs +93 -0
  30. package/dist/lib/browser/url-handler-53TE6JZO.mjs.map +7 -0
  31. package/dist/lib/node-esm/app-graph-builder-473BNZDJ.mjs +121 -0
  32. package/dist/lib/node-esm/app-graph-builder-473BNZDJ.mjs.map +7 -0
  33. package/dist/lib/node-esm/check-app-scheme-IVYRHKRH.mjs +33 -0
  34. package/dist/lib/node-esm/check-app-scheme-IVYRHKRH.mjs.map +7 -0
  35. package/dist/lib/node-esm/chunk-ADPMWKLL.mjs +154 -0
  36. package/dist/lib/node-esm/chunk-ADPMWKLL.mjs.map +7 -0
  37. package/dist/lib/node-esm/chunk-SKEVPQ7E.mjs +162 -0
  38. package/dist/lib/node-esm/chunk-SKEVPQ7E.mjs.map +7 -0
  39. package/dist/lib/node-esm/chunk-V6VEXRD4.mjs +1449 -0
  40. package/dist/lib/node-esm/chunk-V6VEXRD4.mjs.map +7 -0
  41. package/dist/lib/node-esm/chunk-XAKTY3EB.mjs +294 -0
  42. package/dist/lib/node-esm/chunk-XAKTY3EB.mjs.map +7 -0
  43. package/dist/lib/node-esm/index.mjs +181 -0
  44. package/dist/lib/node-esm/index.mjs.map +7 -0
  45. package/dist/lib/node-esm/meta.json +1 -0
  46. package/dist/lib/node-esm/operation-resolver-WUOE33ID.mjs +596 -0
  47. package/dist/lib/node-esm/operation-resolver-WUOE33ID.mjs.map +7 -0
  48. package/dist/lib/node-esm/react-root-L7H43AS3.mjs +48 -0
  49. package/dist/lib/node-esm/react-root-L7H43AS3.mjs.map +7 -0
  50. package/dist/lib/node-esm/react-surface-77DKVMDV.mjs +43 -0
  51. package/dist/lib/node-esm/react-surface-77DKVMDV.mjs.map +7 -0
  52. package/dist/lib/node-esm/settings-2HB6FKIK.mjs +38 -0
  53. package/dist/lib/node-esm/settings-2HB6FKIK.mjs.map +7 -0
  54. package/dist/lib/node-esm/state-JRQ45ACJ.mjs +104 -0
  55. package/dist/lib/node-esm/state-JRQ45ACJ.mjs.map +7 -0
  56. package/dist/lib/node-esm/toolkit-JLPZNNKB.mjs +54 -0
  57. package/dist/lib/node-esm/toolkit-JLPZNNKB.mjs.map +7 -0
  58. package/dist/lib/node-esm/types/index.mjs +40 -0
  59. package/dist/lib/node-esm/url-handler-QGF2R24T.mjs +94 -0
  60. package/dist/lib/node-esm/url-handler-QGF2R24T.mjs.map +7 -0
  61. package/dist/types/src/DeckPlugin.d.ts +2 -1
  62. package/dist/types/src/DeckPlugin.d.ts.map +1 -1
  63. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
  64. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  65. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  66. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  67. package/dist/types/src/capabilities/check-app-scheme/check-app-scheme.d.ts +5 -0
  68. package/dist/types/src/capabilities/check-app-scheme/check-app-scheme.d.ts.map +1 -0
  69. package/dist/types/src/capabilities/check-app-scheme/index.d.ts +3 -0
  70. package/dist/types/src/capabilities/check-app-scheme/index.d.ts.map +1 -0
  71. package/dist/types/src/capabilities/index.d.ts +8 -13
  72. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  73. package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
  74. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
  75. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
  76. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
  77. package/dist/types/src/capabilities/react-root/index.d.ts +6 -0
  78. package/dist/types/src/capabilities/react-root/index.d.ts.map +1 -0
  79. package/dist/types/src/capabilities/react-root/react-root.d.ts +9 -0
  80. package/dist/types/src/capabilities/react-root/react-root.d.ts.map +1 -0
  81. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  82. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  83. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  84. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  85. package/dist/types/src/capabilities/settings/index.d.ts +19 -0
  86. package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
  87. package/dist/types/src/capabilities/settings/settings.d.ts +21 -0
  88. package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
  89. package/dist/types/src/capabilities/state/index.d.ts +172 -0
  90. package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
  91. package/dist/types/src/capabilities/state/state.d.ts +175 -0
  92. package/dist/types/src/capabilities/state/state.d.ts.map +1 -0
  93. package/dist/types/src/capabilities/toolkit/index.d.ts +3 -0
  94. package/dist/types/src/capabilities/toolkit/index.d.ts.map +1 -0
  95. package/dist/types/src/capabilities/{toolkit.d.ts → toolkit/toolkit.d.ts} +5 -4
  96. package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +1 -0
  97. package/dist/types/src/capabilities/tools/index.d.ts +3 -0
  98. package/dist/types/src/capabilities/tools/index.d.ts.map +1 -0
  99. package/dist/types/src/capabilities/tools/tools.d.ts +12 -0
  100. package/dist/types/src/capabilities/tools/tools.d.ts.map +1 -0
  101. package/dist/types/src/capabilities/url-handler/index.d.ts +3 -0
  102. package/dist/types/src/capabilities/url-handler/index.d.ts.map +1 -0
  103. package/dist/types/src/capabilities/url-handler/url-handler.d.ts +5 -0
  104. package/dist/types/src/capabilities/url-handler/url-handler.d.ts.map +1 -0
  105. package/dist/types/src/components/DeckLayout/ContentEmpty.d.ts.map +1 -1
  106. package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
  107. package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts.map +1 -1
  108. package/dist/types/src/components/DeckLayout/DeckMain.d.ts.map +1 -1
  109. package/dist/types/src/components/DeckLayout/Dialog.d.ts.map +1 -1
  110. package/dist/types/src/components/DeckLayout/Popover.d.ts.map +1 -1
  111. package/dist/types/src/components/DeckLayout/Toast.d.ts +3 -3
  112. package/dist/types/src/components/DeckLayout/Toast.d.ts.map +1 -1
  113. package/dist/types/src/components/DeckSettings/DeckSettings.d.ts +4 -2
  114. package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +1 -1
  115. package/dist/types/src/components/Plank/Plank.d.ts +3 -3
  116. package/dist/types/src/components/Plank/Plank.d.ts.map +1 -1
  117. package/dist/types/src/components/Plank/Plank.stories.d.ts +22 -4
  118. package/dist/types/src/components/Plank/Plank.stories.d.ts.map +1 -1
  119. package/dist/types/src/components/Plank/PlankControls.d.ts +1 -1
  120. package/dist/types/src/components/Plank/PlankControls.d.ts.map +1 -1
  121. package/dist/types/src/components/Plank/PlankError.d.ts +1 -1
  122. package/dist/types/src/components/Plank/PlankError.d.ts.map +1 -1
  123. package/dist/types/src/components/Plank/PlankHeading.d.ts +2 -2
  124. package/dist/types/src/components/Plank/PlankHeading.d.ts.map +1 -1
  125. package/dist/types/src/components/Sidebar/ComplementarySidebar.d.ts.map +1 -1
  126. package/dist/types/src/components/Sidebar/Sidebar.d.ts.map +1 -1
  127. package/dist/types/src/components/Sidebar/SidebarButton.d.ts.map +1 -1
  128. package/dist/types/src/hooks/index.d.ts +1 -0
  129. package/dist/types/src/hooks/index.d.ts.map +1 -1
  130. package/dist/types/src/hooks/useDeckCompanions.d.ts +3 -3
  131. package/dist/types/src/hooks/useDeckCompanions.d.ts.map +1 -1
  132. package/dist/types/src/hooks/useDeckState.d.ts +17 -0
  133. package/dist/types/src/hooks/useDeckState.d.ts.map +1 -0
  134. package/dist/types/src/hooks/useHoistStatusbar.d.ts +1 -1
  135. package/dist/types/src/hooks/useHoistStatusbar.d.ts.map +1 -1
  136. package/dist/types/src/hooks/useNodeActionExpander.d.ts +1 -1
  137. package/dist/types/src/hooks/useNodeActionExpander.d.ts.map +1 -1
  138. package/dist/types/src/index.d.ts +1 -2
  139. package/dist/types/src/index.d.ts.map +1 -1
  140. package/dist/types/src/meta.d.ts +2 -2
  141. package/dist/types/src/meta.d.ts.map +1 -1
  142. package/dist/types/src/{capabilities → types}/capabilities.d.ts +96 -90
  143. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  144. package/dist/types/src/types/events.d.ts +7 -0
  145. package/dist/types/src/types/events.d.ts.map +1 -0
  146. package/dist/types/src/types/index.d.ts +2 -0
  147. package/dist/types/src/types/index.d.ts.map +1 -1
  148. package/dist/types/src/types/schema.d.ts +86 -27
  149. package/dist/types/src/types/schema.d.ts.map +1 -1
  150. package/dist/types/src/util/set-active.d.ts +18 -3
  151. package/dist/types/src/util/set-active.d.ts.map +1 -1
  152. package/dist/types/tsconfig.tsbuildinfo +1 -1
  153. package/package.json +53 -47
  154. package/src/DeckPlugin.ts +27 -48
  155. package/src/capabilities/app-graph-builder/app-graph-builder.ts +118 -0
  156. package/src/capabilities/app-graph-builder/index.ts +7 -0
  157. package/src/capabilities/{check-app-scheme.ts → check-app-scheme/check-app-scheme.ts} +12 -11
  158. package/src/capabilities/check-app-scheme/index.ts +7 -0
  159. package/src/capabilities/index.ts +9 -14
  160. package/src/capabilities/operation-resolver/index.ts +10 -0
  161. package/src/capabilities/operation-resolver/operation-resolver.ts +555 -0
  162. package/src/capabilities/react-root/index.ts +7 -0
  163. package/src/capabilities/react-root/react-root.tsx +47 -0
  164. package/src/capabilities/react-surface/index.ts +7 -0
  165. package/src/capabilities/react-surface/react-surface.tsx +37 -0
  166. package/src/capabilities/settings/index.ts +7 -0
  167. package/src/capabilities/settings/settings.ts +38 -0
  168. package/src/capabilities/state/index.ts +7 -0
  169. package/src/capabilities/state/state.ts +104 -0
  170. package/src/capabilities/toolkit/index.ts +7 -0
  171. package/src/capabilities/{toolkit.ts → toolkit/toolkit.ts} +18 -21
  172. package/src/capabilities/tools/index.ts +7 -0
  173. package/src/capabilities/tools/tools.ts +92 -0
  174. package/src/capabilities/url-handler/index.ts +7 -0
  175. package/src/capabilities/url-handler/url-handler.ts +95 -0
  176. package/src/components/DeckLayout/Banner.tsx +2 -2
  177. package/src/components/DeckLayout/ContentEmpty.tsx +3 -4
  178. package/src/components/DeckLayout/DeckLayout.stories.tsx +16 -28
  179. package/src/components/DeckLayout/DeckLayout.tsx +13 -11
  180. package/src/components/DeckLayout/DeckMain.tsx +41 -36
  181. package/src/components/DeckLayout/Dialog.tsx +13 -10
  182. package/src/components/DeckLayout/Fallback.tsx +1 -1
  183. package/src/components/DeckLayout/Popover.tsx +43 -22
  184. package/src/components/DeckLayout/Toast.tsx +4 -4
  185. package/src/components/DeckSettings/DeckSettings.tsx +18 -8
  186. package/src/components/Plank/Plank.stories.tsx +14 -6
  187. package/src/components/Plank/Plank.tsx +19 -19
  188. package/src/components/Plank/PlankControls.tsx +5 -6
  189. package/src/components/Plank/PlankError.tsx +2 -2
  190. package/src/components/Plank/PlankHeading.tsx +28 -34
  191. package/src/components/Sidebar/ComplementarySidebar.tsx +26 -19
  192. package/src/components/Sidebar/Sidebar.tsx +4 -4
  193. package/src/components/Sidebar/SidebarButton.tsx +30 -24
  194. package/src/components/fragments.ts +1 -1
  195. package/src/hooks/index.ts +1 -0
  196. package/src/hooks/useDeckCompanions.ts +5 -4
  197. package/src/hooks/useDeckState.ts +82 -0
  198. package/src/hooks/useHoistStatusbar.ts +3 -6
  199. package/src/hooks/useNodeActionExpander.ts +4 -4
  200. package/src/index.ts +1 -2
  201. package/src/meta.ts +2 -2
  202. package/src/types/capabilities.ts +33 -0
  203. package/src/types/events.ts +20 -0
  204. package/src/types/index.ts +2 -0
  205. package/src/types/schema.ts +81 -11
  206. package/src/util/layoutAppliesTopbar.ts +1 -1
  207. package/src/util/set-active.ts +49 -29
  208. package/dist/lib/browser/app-graph-builder-D74NTOMK.mjs +0 -128
  209. package/dist/lib/browser/app-graph-builder-D74NTOMK.mjs.map +0 -7
  210. package/dist/lib/browser/check-app-scheme-HIEVFAAX.mjs.map +0 -7
  211. package/dist/lib/browser/chunk-5KMJPIQC.mjs +0 -16
  212. package/dist/lib/browser/chunk-5KMJPIQC.mjs.map +0 -7
  213. package/dist/lib/browser/chunk-CNTGBCMK.mjs.map +0 -7
  214. package/dist/lib/browser/chunk-F3VCCHVL.mjs.map +0 -7
  215. package/dist/lib/browser/chunk-QKCGZ45E.mjs +0 -128
  216. package/dist/lib/browser/chunk-QKCGZ45E.mjs.map +0 -7
  217. package/dist/lib/browser/chunk-UXLU6CMW.mjs +0 -16
  218. package/dist/lib/browser/chunk-UXLU6CMW.mjs.map +0 -7
  219. package/dist/lib/browser/chunk-VBYJ664A.mjs +0 -132
  220. package/dist/lib/browser/chunk-VBYJ664A.mjs.map +0 -7
  221. package/dist/lib/browser/chunk-VUJ6UNIJ.mjs +0 -1553
  222. package/dist/lib/browser/chunk-VUJ6UNIJ.mjs.map +0 -7
  223. package/dist/lib/browser/intent-resolver-UA4YQGAC.mjs +0 -524
  224. package/dist/lib/browser/intent-resolver-UA4YQGAC.mjs.map +0 -7
  225. package/dist/lib/browser/react-root-JAMHKYWN.mjs +0 -44
  226. package/dist/lib/browser/react-root-JAMHKYWN.mjs.map +0 -7
  227. package/dist/lib/browser/react-surface-6LW337ZT.mjs +0 -40
  228. package/dist/lib/browser/react-surface-6LW337ZT.mjs.map +0 -7
  229. package/dist/lib/browser/settings-SDPTOCCM.mjs +0 -30
  230. package/dist/lib/browser/settings-SDPTOCCM.mjs.map +0 -7
  231. package/dist/lib/browser/state-7IFAGZQO.mjs +0 -12
  232. package/dist/lib/browser/toolkit-L5CFXJCF.mjs.map +0 -7
  233. package/dist/lib/browser/url-handler-QEYGYE2H.mjs +0 -70
  234. package/dist/lib/browser/url-handler-QEYGYE2H.mjs.map +0 -7
  235. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  236. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  237. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  238. package/dist/types/src/capabilities/check-app-scheme.d.ts +0 -4
  239. package/dist/types/src/capabilities/check-app-scheme.d.ts.map +0 -1
  240. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  241. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  242. package/dist/types/src/capabilities/react-root.d.ts +0 -7
  243. package/dist/types/src/capabilities/react-root.d.ts.map +0 -1
  244. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  245. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  246. package/dist/types/src/capabilities/settings.d.ts +0 -4
  247. package/dist/types/src/capabilities/settings.d.ts.map +0 -1
  248. package/dist/types/src/capabilities/state.d.ts +0 -104
  249. package/dist/types/src/capabilities/state.d.ts.map +0 -1
  250. package/dist/types/src/capabilities/toolkit.d.ts.map +0 -1
  251. package/dist/types/src/capabilities/tools.d.ts +0 -11
  252. package/dist/types/src/capabilities/tools.d.ts.map +0 -1
  253. package/dist/types/src/capabilities/url-handler.d.ts +0 -4
  254. package/dist/types/src/capabilities/url-handler.d.ts.map +0 -1
  255. package/dist/types/src/events.d.ts +0 -4
  256. package/dist/types/src/events.d.ts.map +0 -1
  257. package/src/capabilities/app-graph-builder.ts +0 -143
  258. package/src/capabilities/capabilities.ts +0 -14
  259. package/src/capabilities/intent-resolver.ts +0 -471
  260. package/src/capabilities/react-root.tsx +0 -40
  261. package/src/capabilities/react-surface.tsx +0 -30
  262. package/src/capabilities/settings.ts +0 -27
  263. package/src/capabilities/state.ts +0 -113
  264. package/src/capabilities/tools.ts +0 -84
  265. package/src/capabilities/url-handler.ts +0 -60
  266. package/src/events.ts +0 -11
  267. /package/dist/lib/{browser/state-7IFAGZQO.mjs.map → node-esm/types/index.mjs.map} +0 -0
@@ -4,18 +4,18 @@
4
4
 
5
5
  import React, { Fragment, type MouseEvent, memo, useCallback, useEffect, useMemo } from 'react';
6
6
 
7
- import { LayoutAction, createIntent } from '@dxos/app-framework';
8
- import { Surface, useAppGraph, useIntentDispatcher } from '@dxos/app-framework/react';
9
- import { type Node } from '@dxos/plugin-graph';
7
+ import { Common } from '@dxos/app-framework';
8
+ import { Surface, useAppGraph, useOperationInvoker } from '@dxos/app-framework/react';
9
+ import { Graph, type Node, useActionRunner } from '@dxos/plugin-graph';
10
10
  import { Icon, IconButton, Popover, toLocalizedString, useTranslation } from '@dxos/react-ui';
11
11
  import { StackItem, type StackItemSigilAction } from '@dxos/react-ui-stack';
12
12
  import { TextTooltip } from '@dxos/react-ui-text-tooltip';
13
- import { hoverableControls, hoverableFocusedWithinControls } from '@dxos/react-ui-theme';
13
+ import { hoverableControls, hoverableFocusedWithinControls } from '@dxos/ui-theme';
14
14
 
15
15
  import { useBreakpoints } from '../../hooks';
16
16
  import { parseEntryId } from '../../layout';
17
17
  import { meta } from '../../meta';
18
- import { DeckAction, type LayoutMode, PLANK_COMPANION_TYPE, type ResolvedPart } from '../../types';
18
+ import { DeckOperation, type LayoutMode, PLANK_COMPANION_TYPE, type ResolvedPart } from '../../types';
19
19
  import { soloInlinePadding } from '../fragments';
20
20
 
21
21
  import { PlankCompanionControls, PlankControls } from './PlankControls';
@@ -26,7 +26,7 @@ export type PlankHeadingProps = {
26
26
  id: string;
27
27
  part: ResolvedPart;
28
28
  layoutMode?: LayoutMode;
29
- node?: Node;
29
+ node?: Node.Node;
30
30
  deckEnabled?: boolean;
31
31
  canIncrementStart?: boolean;
32
32
  canIncrementEnd?: boolean;
@@ -34,7 +34,7 @@ export type PlankHeadingProps = {
34
34
  primaryId?: string;
35
35
  pending?: boolean;
36
36
  companioned?: 'primary' | 'companion';
37
- companions?: Node[];
37
+ companions?: Node.Node[];
38
38
  actions?: StackItemSigilAction[];
39
39
  };
40
40
 
@@ -55,7 +55,8 @@ export const PlankHeading = memo(
55
55
  actions = [],
56
56
  }: PlankHeadingProps) => {
57
57
  const { t } = useTranslation(meta.id);
58
- const { dispatchPromise: dispatch } = useIntentDispatcher();
58
+ const { invokePromise, invokeSync } = useOperationInvoker();
59
+ const runAction = useActionRunner();
59
60
  const { graph } = useAppGraph();
60
61
  const breakpoint = useBreakpoints();
61
62
  const icon = node?.properties?.icon ?? 'ph--placeholder--regular';
@@ -69,7 +70,7 @@ export const PlankHeading = memo(
69
70
  const frame = requestAnimationFrame(() => {
70
71
  // Load actions for the node.
71
72
  if (node) {
72
- void graph.expand(node.id);
73
+ void Graph.expand(graph, node.id);
73
74
  }
74
75
  });
75
76
 
@@ -98,42 +99,37 @@ export const PlankHeading = memo(
98
99
  } else {
99
100
  return [
100
101
  actions,
101
- graph
102
- .getActions(node.id)
103
- .filter((a) => ['list-item', 'list-item-primary', 'heading-list-item'].includes(a.properties.disposition)),
102
+ Graph.getActions(graph, node.id).filter((a) =>
103
+ ['list-item', 'list-item-primary', 'heading-list-item'].includes(a.properties.disposition),
104
+ ),
104
105
  ].filter((a) => a.length > 0);
105
106
  }
106
107
  }, [actions, node, variant, graph]);
107
108
 
108
109
  const handleAction = useCallback(
109
110
  (action: StackItemSigilAction) => {
110
- typeof action.data === 'function' && void action.data?.({ parent: node, caller: meta.id });
111
+ if (typeof action.data === 'function') {
112
+ void runAction(action as Node.Action, { parent: node, caller: meta.id });
113
+ }
111
114
  },
112
- [node],
115
+ [node, runAction],
113
116
  );
114
117
 
115
118
  const handlePlankAction = useCallback(
116
- (eventType: DeckAction.PartAdjustment) => {
119
+ (eventType: DeckOperation.PartAdjustment) => {
117
120
  if (eventType.startsWith('solo')) {
118
- return dispatch(createIntent(DeckAction.Adjust, { type: eventType, id }));
121
+ return invokePromise(DeckOperation.Adjust, { type: eventType, id });
119
122
  } else if (eventType === 'close') {
120
123
  if (part === 'complementary') {
121
- return dispatch(
122
- createIntent(LayoutAction.UpdateComplementary, {
123
- part: 'complementary',
124
- options: { state: 'collapsed' },
125
- }),
126
- );
124
+ return invokeSync(Common.LayoutOperation.UpdateComplementary, { state: 'collapsed' });
127
125
  } else {
128
- return dispatch(
129
- createIntent(LayoutAction.Close, { part: 'main', subject: [id], options: { state: false } }),
130
- );
126
+ return invokeSync(Common.LayoutOperation.Close, { subject: [id] });
131
127
  }
132
128
  } else {
133
- return dispatch(createIntent(DeckAction.Adjust, { type: eventType, id }));
129
+ return invokePromise(DeckOperation.Adjust, { type: eventType, id });
134
130
  }
135
131
  },
136
- [dispatch, id, part],
132
+ [invokePromise, invokeSync, id, part],
137
133
  );
138
134
 
139
135
  const ActionRoot = node && popoverAnchorId === `dxos.org/ui/${meta.id}/${node.id}` ? Popover.Anchor : Fragment;
@@ -143,15 +139,13 @@ export const PlankHeading = memo(
143
139
  const target = (event.target as HTMLElement).closest('[data-id]') as HTMLElement | null;
144
140
  const tabId = target?.dataset?.id;
145
141
  if (primaryId && tabId) {
146
- void dispatch(
147
- createIntent(DeckAction.ChangeCompanion, {
148
- primary: primaryId,
149
- companion: tabId,
150
- }),
151
- );
142
+ void invokePromise(DeckOperation.ChangeCompanion, {
143
+ primary: primaryId,
144
+ companion: tabId,
145
+ });
152
146
  }
153
147
  },
154
- [primaryId],
148
+ [primaryId, invokePromise],
155
149
  );
156
150
 
157
151
  return (
@@ -12,14 +12,20 @@ import React, {
12
12
  useState,
13
13
  } from 'react';
14
14
 
15
- import { LayoutAction, createIntent } from '@dxos/app-framework';
16
- import { Surface, useCapability, useIntentDispatcher } from '@dxos/app-framework/react';
15
+ import { Common } from '@dxos/app-framework';
16
+ import { Surface, useOperationInvoker } from '@dxos/app-framework/react';
17
17
  import { IconButton, type Label, Main, toLocalizedString, useTranslation } from '@dxos/react-ui';
18
18
  import { Tabs } from '@dxos/react-ui-tabs';
19
- import { mx } from '@dxos/react-ui-theme';
20
-
21
- import { DeckCapabilities } from '../../capabilities';
22
- import { type DeckCompanion, getCompanionId, useBreakpoints, useDeckCompanions, useHoistStatusbar } from '../../hooks';
19
+ import { mx } from '@dxos/ui-theme';
20
+
21
+ import {
22
+ type DeckCompanion,
23
+ getCompanionId,
24
+ useBreakpoints,
25
+ useDeckCompanions,
26
+ useDeckState,
27
+ useHoistStatusbar,
28
+ } from '../../hooks';
23
29
  import { meta } from '../../meta';
24
30
  import { getMode } from '../../types';
25
31
  import { layoutAppliesTopbar } from '../../util';
@@ -35,9 +41,9 @@ export type ComplementarySidebarProps = {
35
41
 
36
42
  export const ComplementarySidebar = ({ current }: ComplementarySidebarProps) => {
37
43
  const { t } = useTranslation(meta.id);
38
- const { dispatchPromise: dispatch } = useIntentDispatcher();
39
- const layout = useCapability(DeckCapabilities.MutableDeckState);
40
- const layoutMode = getMode(layout.deck);
44
+ const { invokeSync } = useOperationInvoker();
45
+ const { state, deck, updateState } = useDeckState();
46
+ const layoutMode = getMode(deck);
41
47
  const breakpoint = useBreakpoints();
42
48
  const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
43
49
  const hoistStatusbar = useHoistStatusbar(breakpoint, layoutMode);
@@ -55,14 +61,17 @@ export const ComplementarySidebar = ({ current }: ComplementarySidebarProps) =>
55
61
  (event: MouseEvent) => {
56
62
  const nextValue = event.currentTarget.getAttribute('data-value') as string;
57
63
  if (nextValue === activeId) {
58
- layout.complementarySidebarState = layout.complementarySidebarState === 'expanded' ? 'collapsed' : 'expanded';
64
+ updateState((s) => ({
65
+ ...s,
66
+ complementarySidebarState: s.complementarySidebarState === 'expanded' ? 'collapsed' : 'expanded',
67
+ }));
59
68
  } else {
60
69
  setInternalValue(nextValue);
61
- layout.complementarySidebarState = 'expanded';
62
- void dispatch(createIntent(LayoutAction.UpdateComplementary, { part: 'complementary', subject: nextValue }));
70
+ updateState((s) => ({ ...s, complementarySidebarState: 'expanded' }));
71
+ invokeSync(Common.LayoutOperation.UpdateComplementary, { subject: nextValue });
63
72
  }
64
73
  },
65
- [layout, activeId, dispatch],
74
+ [state.complementarySidebarState, activeId, invokeSync, updateState],
66
75
  );
67
76
 
68
77
  const data = useMemo(
@@ -76,11 +85,9 @@ export const ComplementarySidebar = ({ current }: ComplementarySidebarProps) =>
76
85
 
77
86
  useEffect(() => {
78
87
  if (!activeId) {
79
- void dispatch(
80
- createIntent(LayoutAction.UpdateComplementary, { part: 'complementary', options: { state: 'collapsed' } }),
81
- );
88
+ invokeSync(Common.LayoutOperation.UpdateComplementary, { state: 'collapsed' });
82
89
  }
83
- }, [activeId, dispatch]);
90
+ }, [activeId, invokeSync]);
84
91
 
85
92
  return (
86
93
  <Main.ComplementarySidebar
@@ -110,7 +117,7 @@ export const ComplementarySidebar = ({ current }: ComplementarySidebarProps) =>
110
117
  data-value={getCompanionId(companion.id)}
111
118
  variant={
112
119
  activeId === getCompanionId(companion.id)
113
- ? layout.complementarySidebarState === 'expanded'
120
+ ? state.complementarySidebarState === 'expanded'
114
121
  ? 'primary'
115
122
  : 'default'
116
123
  : 'ghost'
@@ -139,7 +146,7 @@ export const ComplementarySidebar = ({ current }: ComplementarySidebarProps) =>
139
146
  'inset-block-0 inline-start-0 is-[calc(100%-var(--r0-size))] lg:is-[--r1-size]',
140
147
  'grid grid-cols-1 grid-rows-[var(--rail-size)_1fr_min-content] pbs-[env(safe-area-inset-top)]',
141
148
  ]}
142
- {...(layout.complementarySidebarState !== 'expanded' && { inert: true })}
149
+ {...(state.complementarySidebarState !== 'expanded' && { inert: true })}
143
150
  >
144
151
  <ComplementarySidebarPanel
145
152
  companion={companion}
@@ -4,11 +4,10 @@
4
4
 
5
5
  import React, { useMemo } from 'react';
6
6
 
7
- import { Surface, useCapability } from '@dxos/app-framework/react';
7
+ import { Surface } from '@dxos/app-framework/react';
8
8
  import { type Label, Main } from '@dxos/react-ui';
9
9
 
10
- import { DeckCapabilities } from '../../capabilities';
11
- import { useBreakpoints, useHoistStatusbar } from '../../hooks';
10
+ import { useBreakpoints, useDeckState, useHoistStatusbar } from '../../hooks';
12
11
  import { meta } from '../../meta';
13
12
  import { getMode } from '../../types';
14
13
  import { layoutAppliesTopbar } from '../../util';
@@ -16,7 +15,8 @@ import { layoutAppliesTopbar } from '../../util';
16
15
  const label = ['sidebar title', { ns: meta.id }] satisfies Label;
17
16
 
18
17
  export const Sidebar = () => {
19
- const { popoverAnchorId, activeDeck: current, deck } = useCapability(DeckCapabilities.DeckState);
18
+ const { state, deck } = useDeckState();
19
+ const { popoverAnchorId, activeDeck: current } = state;
20
20
  const breakpoint = useBreakpoints();
21
21
  const layoutMode = getMode(deck);
22
22
  const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
@@ -4,20 +4,27 @@
4
4
 
5
5
  import React, { useCallback } from 'react';
6
6
 
7
- import { LayoutAction, createIntent } from '@dxos/app-framework';
8
- import { useCapability, useIntentDispatcher } from '@dxos/app-framework/react';
7
+ import { Common } from '@dxos/app-framework';
8
+ import { useOperationInvoker } from '@dxos/app-framework/react';
9
9
  import { IconButton, type IconButtonProps, type ThemedClassName, useTranslation } from '@dxos/react-ui';
10
10
 
11
- import { DeckCapabilities } from '../../capabilities';
12
- import { getCompanionId, useDeckCompanions } from '../../hooks';
11
+ import { getCompanionId, useDeckCompanions, useDeckState } from '../../hooks';
13
12
  import { meta } from '../../meta';
14
13
 
15
14
  export const ToggleSidebarButton = ({
16
15
  classNames,
17
16
  variant = 'ghost',
18
17
  }: ThemedClassName<Pick<IconButtonProps, 'variant'>>) => {
19
- const layoutContext = useCapability(DeckCapabilities.MutableDeckState);
18
+ const { state, updateState } = useDeckState();
20
19
  const { t } = useTranslation(meta.id);
20
+
21
+ const handleClick = useCallback(() => {
22
+ updateState((s) => ({
23
+ ...s,
24
+ sidebarState: s.sidebarState === 'expanded' ? 'collapsed' : 'expanded',
25
+ }));
26
+ }, [updateState]);
27
+
21
28
  return (
22
29
  <IconButton
23
30
  variant={variant}
@@ -25,17 +32,20 @@ export const ToggleSidebarButton = ({
25
32
  iconOnly
26
33
  size={4}
27
34
  label={t('open navigation sidebar label')}
28
- onClick={() =>
29
- (layoutContext.sidebarState = layoutContext.sidebarState === 'expanded' ? 'collapsed' : 'expanded')
30
- }
35
+ onClick={handleClick}
31
36
  classNames={classNames}
32
37
  />
33
38
  );
34
39
  };
35
40
 
36
41
  export const CloseSidebarButton = () => {
37
- const layoutContext = useCapability(DeckCapabilities.MutableDeckState);
42
+ const { updateState } = useDeckState();
38
43
  const { t } = useTranslation(meta.id);
44
+
45
+ const handleClick = useCallback(() => {
46
+ updateState((s) => ({ ...s, sidebarState: 'collapsed' }));
47
+ }, [updateState]);
48
+
39
49
  return (
40
50
  <IconButton
41
51
  variant='ghost'
@@ -43,7 +53,7 @@ export const CloseSidebarButton = () => {
43
53
  iconOnly
44
54
  size={4}
45
55
  label={t('close navigation sidebar label')}
46
- onClick={() => (layoutContext.sidebarState = 'collapsed')}
56
+ onClick={handleClick}
47
57
  classNames='rounded-none pli-1 dx-focus-ring-inset pie-[max(.5rem,env(safe-area-inset-left))]'
48
58
  />
49
59
  );
@@ -54,24 +64,20 @@ export const ToggleComplementarySidebarButton = ({
54
64
  classNames,
55
65
  current,
56
66
  }: ThemedClassName<{ inR0?: boolean; current?: string }>) => {
57
- const { dispatchPromise: dispatch } = useIntentDispatcher();
58
- const layoutContext = useCapability(DeckCapabilities.MutableDeckState);
67
+ const { invokeSync } = useOperationInvoker();
68
+ const { state, updateState } = useDeckState();
59
69
  const { t } = useTranslation(meta.id);
60
70
 
61
71
  const companions = useDeckCompanions();
62
- const handleClick = useCallback(async () => {
63
- layoutContext.complementarySidebarState =
64
- layoutContext.complementarySidebarState === 'expanded' ? 'collapsed' : 'expanded';
65
- const subject = layoutContext.complementarySidebarPanel ?? (companions[0] && getCompanionId(companions[0].id));
66
- if (layoutContext.complementarySidebarState === 'expanded' && !current && subject) {
67
- await dispatch(
68
- createIntent(LayoutAction.UpdateComplementary, {
69
- part: 'complementary',
70
- subject,
71
- }),
72
- );
72
+ const handleClick = useCallback(() => {
73
+ const nextState = state.complementarySidebarState === 'expanded' ? 'collapsed' : 'expanded';
74
+ updateState((s) => ({ ...s, complementarySidebarState: nextState }));
75
+
76
+ const subject = state.complementarySidebarPanel ?? (companions[0] && getCompanionId(companions[0].id));
77
+ if (nextState === 'expanded' && !current && subject) {
78
+ invokeSync(Common.LayoutOperation.UpdateComplementary, { subject });
73
79
  }
74
- }, [layoutContext, current, companions, dispatch]);
80
+ }, [state, updateState, current, companions, invokeSync]);
75
81
 
76
82
  return (
77
83
  <IconButton
@@ -2,7 +2,7 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { mx } from '@dxos/react-ui-theme';
5
+ import { mx } from '@dxos/ui-theme';
6
6
 
7
7
  export const soloInlinePadding =
8
8
  'pis-[calc(env(safe-area-inset-left)+.25rem)] pie-[calc(env(safe-area-inset-left)+.25rem)]';
@@ -5,6 +5,7 @@
5
5
  export * from './useBreakpoints';
6
6
  export * from './useCompanions';
7
7
  export * from './useDeckCompanions';
8
+ export * from './useDeckState';
8
9
  export * from './useHoistStatusbar';
9
10
  export * from './useMainSize';
10
11
  export * from './useNodeActionExpander';
@@ -2,9 +2,10 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { type Label } from '@dxos/app-framework';
6
5
  import { useAppGraph } from '@dxos/app-framework/react';
7
- import { type Node, ROOT_ID, useConnections } from '@dxos/plugin-graph';
6
+ import { Node, type Node as NodeType } from '@dxos/plugin-graph';
7
+ import { useConnections } from '@dxos/plugin-graph';
8
+ import { type Label } from '@dxos/ui-types';
8
9
  import { type Position, byPosition } from '@dxos/util';
9
10
 
10
11
  import { ATTENDABLE_PATH_SEPARATOR, DECK_COMPANION_TYPE } from '../types';
@@ -14,7 +15,7 @@ export const getCompanionId = (id: string) => {
14
15
  return companionId ?? 'never';
15
16
  };
16
17
 
17
- export type DeckCompanion = Node<
18
+ export type DeckCompanion = NodeType.Node<
18
19
  any,
19
20
  {
20
21
  label: Label;
@@ -28,7 +29,7 @@ export type DeckCompanion = Node<
28
29
 
29
30
  export const useDeckCompanions = (): DeckCompanion[] => {
30
31
  const { graph } = useAppGraph();
31
- const connections = useConnections(graph, ROOT_ID);
32
+ const connections = useConnections(graph, Node.RootId);
32
33
  const companions = connections.filter((node) => node.type === DECK_COMPANION_TYPE) as DeckCompanion[];
33
34
  return companions.toSorted((a, b) => byPosition(a.properties, b.properties));
34
35
  };
@@ -0,0 +1,82 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { useAtomValue } from '@effect-atom/atom-react';
6
+ import { useCallback, useMemo } from 'react';
7
+
8
+ import { Common } from '@dxos/app-framework';
9
+ import { useCapability } from '@dxos/app-framework/react';
10
+ import { invariant } from '@dxos/invariant';
11
+
12
+ import {
13
+ DeckCapabilities,
14
+ type DeckEphemeralStateProps,
15
+ type DeckPluginState,
16
+ type DeckState,
17
+ type DeckStateProps,
18
+ } from '../types';
19
+
20
+ export type DeckStateHook = {
21
+ /** Combined state value (reactive). Includes both persisted and ephemeral state. */
22
+ state: DeckPluginState;
23
+ /** The active deck, computed from decks[activeDeck]. */
24
+ deck: DeckState;
25
+ /** Update persisted state. */
26
+ updateState: (fn: (current: DeckStateProps) => DeckStateProps) => void;
27
+ /** Update ephemeral state. */
28
+ updateEphemeral: (fn: (current: DeckEphemeralStateProps) => DeckEphemeralStateProps) => void;
29
+ };
30
+
31
+ /**
32
+ * Hook to access the deck plugin state reactively.
33
+ * Returns the combined state, the active deck, and update functions for each atom.
34
+ */
35
+ export const useDeckState = (): DeckStateHook => {
36
+ const registry = useCapability(Common.Capability.AtomRegistry);
37
+ const stateAtom = useCapability(DeckCapabilities.State);
38
+ const ephemeralAtom = useCapability(DeckCapabilities.EphemeralState);
39
+
40
+ const persistedState = useAtomValue(stateAtom);
41
+ const ephemeralState = useAtomValue(ephemeralAtom);
42
+
43
+ // Compute deck from decks[activeDeck] to ensure it's always current.
44
+ const deck = useMemo(() => {
45
+ const d = persistedState.decks[persistedState.activeDeck];
46
+ invariant(d, `Deck not found: ${persistedState.activeDeck}`);
47
+ return d;
48
+ }, [persistedState.decks, persistedState.activeDeck]);
49
+
50
+ // Combine persisted and ephemeral state into a unified view.
51
+ const state = useMemo(
52
+ (): DeckPluginState => ({
53
+ ...persistedState,
54
+ ...ephemeralState,
55
+ }),
56
+ [persistedState, ephemeralState],
57
+ );
58
+
59
+ const updateState = useCallback(
60
+ (fn: (current: DeckStateProps) => DeckStateProps) => {
61
+ registry.set(stateAtom, fn(registry.get(stateAtom)));
62
+ },
63
+ [registry, stateAtom],
64
+ );
65
+
66
+ const updateEphemeral = useCallback(
67
+ (fn: (current: DeckEphemeralStateProps) => DeckEphemeralStateProps) => {
68
+ registry.set(ephemeralAtom, fn(registry.get(ephemeralAtom)));
69
+ },
70
+ [registry, ephemeralAtom],
71
+ );
72
+
73
+ return useMemo(
74
+ () => ({
75
+ state,
76
+ deck,
77
+ updateState,
78
+ updateEphemeral,
79
+ }),
80
+ [state, deck, updateState, updateEphemeral],
81
+ );
82
+ };
@@ -4,17 +4,14 @@
4
4
 
5
5
  import { useMemo } from 'react';
6
6
 
7
- import { Capabilities } from '@dxos/app-framework';
8
- import { useCapability } from '@dxos/app-framework/react';
7
+ import { useAtomCapability } from '@dxos/app-framework/react';
9
8
  import { useThemeContext } from '@dxos/react-ui';
10
9
 
11
- import { meta } from '../meta';
12
- import type { DeckSettingsProps, LayoutMode } from '../types';
10
+ import { DeckCapabilities, type LayoutMode } from '../types';
13
11
 
14
12
  export const useHoistStatusbar = (breakpoint: string, layoutMode?: LayoutMode): boolean => {
15
13
  const { safeAreaPadding } = useThemeContext();
16
- const enableStatusbar = useCapability(Capabilities.SettingsStore).getStore<DeckSettingsProps>(meta.id)?.value
17
- .enableStatusbar;
14
+ const enableStatusbar = useAtomCapability(DeckCapabilities.Settings).enableStatusbar;
18
15
 
19
16
  return useMemo(() => {
20
17
  return (
@@ -4,14 +4,14 @@
4
4
 
5
5
  import { useEffect } from 'react';
6
6
 
7
- import { type Node, getGraph } from '@dxos/plugin-graph';
7
+ import { Graph, type Node } from '@dxos/plugin-graph';
8
8
 
9
- export const useNodeActionExpander = (node?: Node) => {
9
+ export const useNodeActionExpander = (node?: Node.Node) => {
10
10
  useEffect(() => {
11
11
  if (node) {
12
12
  const frame = requestAnimationFrame(() => {
13
- const graph = getGraph(node);
14
- void graph.expand(node.id);
13
+ const graph = Graph.getGraph(node);
14
+ void Graph.expand(graph, node.id);
15
15
  });
16
16
  return () => cancelAnimationFrame(frame);
17
17
  }
package/src/index.ts CHANGED
@@ -2,8 +2,7 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- export { DeckCapabilities } from './capabilities';
6
- export { DeckEvents } from './events';
5
+ export { DeckCapabilities, DeckEvents } from './types';
7
6
  export * from './DeckPlugin';
8
7
  export * from './meta';
9
8
  export { useCompanions } from './hooks';
package/src/meta.ts CHANGED
@@ -2,10 +2,10 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { type PluginMeta } from '@dxos/app-framework';
5
+ import { type Plugin } from '@dxos/app-framework';
6
6
  import { trim } from '@dxos/util';
7
7
 
8
- export const meta: PluginMeta = {
8
+ export const meta: Plugin.Meta = {
9
9
  id: 'dxos.org/plugin/deck',
10
10
  name: 'Layout',
11
11
  description: trim`
@@ -0,0 +1,33 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { type Atom } from '@effect-atom/atom-react';
6
+ import * as Effect from 'effect/Effect';
7
+
8
+ import { Capability, Common } from '@dxos/app-framework';
9
+ import { invariant } from '@dxos/invariant';
10
+
11
+ import { meta } from '../meta';
12
+ import { type DeckEphemeralStateProps, type DeckSettingsProps, type DeckState, type DeckStateProps } from '../types';
13
+
14
+ export namespace DeckCapabilities {
15
+ export const Settings = Capability.make<Atom.Writable<DeckSettingsProps>>(`${meta.id}/capability/settings`);
16
+
17
+ /** Persisted state (stored in KVS/localStorage). */
18
+ export const State = Capability.make<Atom.Writable<DeckStateProps>>(`${meta.id}/capability/state`);
19
+
20
+ /** Transient/ephemeral state (not persisted). */
21
+ export const EphemeralState = Capability.make<Atom.Writable<DeckEphemeralStateProps>>(
22
+ `${meta.id}/capability/ephemeral-state`,
23
+ );
24
+
25
+ /** Get the current active deck from state. */
26
+ export const getDeck = (): Effect.Effect<DeckState, Error, Capability.Service> =>
27
+ Effect.gen(function* () {
28
+ const state = yield* Common.Capability.getAtomValue(State);
29
+ const deck = state.decks[state.activeDeck];
30
+ invariant(deck, `Deck not found: ${state.activeDeck}`);
31
+ return deck;
32
+ });
33
+ }
@@ -0,0 +1,20 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { type ActivationEvent, Common } from '@dxos/app-framework';
6
+
7
+ import { meta } from '../meta';
8
+
9
+ import { DeckCapabilities } from './capabilities';
10
+
11
+ export namespace DeckEvents {
12
+ export const StateReady: ActivationEvent.ActivationEvent = Common.ActivationEvent.createStateEvent(
13
+ `${meta.id}/state-ready`,
14
+ );
15
+
16
+ /** Fired when DeckSettings capability is ready. */
17
+ export const SettingsReady: ActivationEvent.ActivationEvent = Common.ActivationEvent.createSettingsEvent(
18
+ DeckCapabilities.Settings.identifier,
19
+ );
20
+ }
@@ -2,4 +2,6 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ export * from './capabilities';
6
+ export * from './events';
5
7
  export * from './schema';