@dxos/plugin-deck 0.8.4-main.b97322e → 0.8.4-main.bc674ce

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 (277) 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-57U62A3A.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-F5BQOOEG.mjs → chunk-ATFPDN6J.mjs} +155 -23
  6. package/dist/lib/browser/chunk-ATFPDN6J.mjs.map +7 -0
  7. package/dist/lib/browser/{chunk-CNTGBCMK.mjs → chunk-NHABISX2.mjs} +40 -33
  8. package/dist/lib/browser/chunk-NHABISX2.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-S4A5UO4K.mjs +1448 -0
  10. package/dist/lib/browser/chunk-S4A5UO4K.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 +79 -67
  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-XDCMNENQ.mjs +47 -0
  19. package/dist/lib/browser/react-root-XDCMNENQ.mjs.map +7 -0
  20. package/dist/lib/browser/react-surface-HODERLOL.mjs +42 -0
  21. package/dist/lib/browser/react-surface-HODERLOL.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-R53LD3EA.mjs +53 -0
  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-D34L3ECT.mjs +1449 -0
  38. package/dist/lib/node-esm/chunk-D34L3ECT.mjs.map +7 -0
  39. package/dist/lib/node-esm/chunk-SKEVPQ7E.mjs +162 -0
  40. package/dist/lib/node-esm/chunk-SKEVPQ7E.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-O6GZO62Z.mjs +48 -0
  49. package/dist/lib/node-esm/react-root-O6GZO62Z.mjs.map +7 -0
  50. package/dist/lib/node-esm/react-surface-IHDJDGC5.mjs +43 -0
  51. package/dist/lib/node-esm/react-surface-IHDJDGC5.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/toolkit.d.ts +26 -0
  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/Banner.d.ts.map +1 -1
  106. package/dist/types/src/components/DeckLayout/ContentEmpty.d.ts.map +1 -1
  107. package/dist/types/src/components/DeckLayout/DeckLayout.d.ts +2 -3
  108. package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
  109. package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts +74 -0
  110. package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts.map +1 -0
  111. package/dist/types/src/components/DeckLayout/DeckMain.d.ts +3 -0
  112. package/dist/types/src/components/DeckLayout/DeckMain.d.ts.map +1 -0
  113. package/dist/types/src/components/DeckLayout/Dialog.d.ts.map +1 -1
  114. package/dist/types/src/components/DeckLayout/Popover.d.ts.map +1 -1
  115. package/dist/types/src/components/DeckLayout/Toast.d.ts +7 -2
  116. package/dist/types/src/components/DeckLayout/Toast.d.ts.map +1 -1
  117. package/dist/types/src/components/DeckSettings/DeckSettings.d.ts +4 -2
  118. package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +1 -1
  119. package/dist/types/src/components/Plank/Plank.d.ts +4 -4
  120. package/dist/types/src/components/Plank/Plank.d.ts.map +1 -1
  121. package/dist/types/src/components/Plank/Plank.stories.d.ts +104 -5
  122. package/dist/types/src/components/Plank/Plank.stories.d.ts.map +1 -1
  123. package/dist/types/src/components/Plank/PlankControls.d.ts +1 -1
  124. package/dist/types/src/components/Plank/PlankControls.d.ts.map +1 -1
  125. package/dist/types/src/components/Plank/PlankError.d.ts +1 -1
  126. package/dist/types/src/components/Plank/PlankError.d.ts.map +1 -1
  127. package/dist/types/src/components/Plank/PlankHeading.d.ts +3 -3
  128. package/dist/types/src/components/Plank/PlankHeading.d.ts.map +1 -1
  129. package/dist/types/src/components/Sidebar/ComplementarySidebar.d.ts.map +1 -1
  130. package/dist/types/src/components/Sidebar/Sidebar.d.ts.map +1 -1
  131. package/dist/types/src/components/Sidebar/SidebarButton.d.ts.map +1 -1
  132. package/dist/types/src/hooks/index.d.ts +1 -0
  133. package/dist/types/src/hooks/index.d.ts.map +1 -1
  134. package/dist/types/src/hooks/useDeckCompanions.d.ts +3 -3
  135. package/dist/types/src/hooks/useDeckCompanions.d.ts.map +1 -1
  136. package/dist/types/src/hooks/useDeckState.d.ts +17 -0
  137. package/dist/types/src/hooks/useDeckState.d.ts.map +1 -0
  138. package/dist/types/src/hooks/useHoistStatusbar.d.ts +1 -1
  139. package/dist/types/src/hooks/useHoistStatusbar.d.ts.map +1 -1
  140. package/dist/types/src/hooks/useNodeActionExpander.d.ts +1 -1
  141. package/dist/types/src/hooks/useNodeActionExpander.d.ts.map +1 -1
  142. package/dist/types/src/index.d.ts +1 -2
  143. package/dist/types/src/index.d.ts.map +1 -1
  144. package/dist/types/src/meta.d.ts +2 -3
  145. package/dist/types/src/meta.d.ts.map +1 -1
  146. package/dist/types/src/translations.d.ts +3 -1
  147. package/dist/types/src/translations.d.ts.map +1 -1
  148. package/dist/types/src/{capabilities → types}/capabilities.d.ts +96 -90
  149. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  150. package/dist/types/src/types/events.d.ts +7 -0
  151. package/dist/types/src/types/events.d.ts.map +1 -0
  152. package/dist/types/src/types/index.d.ts +2 -0
  153. package/dist/types/src/types/index.d.ts.map +1 -1
  154. package/dist/types/src/types/schema.d.ts +90 -30
  155. package/dist/types/src/types/schema.d.ts.map +1 -1
  156. package/dist/types/src/util/set-active.d.ts +18 -3
  157. package/dist/types/src/util/set-active.d.ts.map +1 -1
  158. package/dist/types/tsconfig.tsbuildinfo +1 -1
  159. package/package.json +56 -46
  160. package/src/DeckPlugin.ts +45 -61
  161. package/src/capabilities/app-graph-builder/app-graph-builder.ts +118 -0
  162. package/src/capabilities/app-graph-builder/index.ts +7 -0
  163. package/src/capabilities/{check-app-scheme.ts → check-app-scheme/check-app-scheme.ts} +12 -11
  164. package/src/capabilities/check-app-scheme/index.ts +7 -0
  165. package/src/capabilities/index.ts +9 -13
  166. package/src/capabilities/operation-resolver/index.ts +10 -0
  167. package/src/capabilities/operation-resolver/operation-resolver.ts +555 -0
  168. package/src/capabilities/react-root/index.ts +7 -0
  169. package/src/capabilities/react-root/react-root.tsx +47 -0
  170. package/src/capabilities/react-surface/index.ts +7 -0
  171. package/src/capabilities/react-surface/react-surface.tsx +37 -0
  172. package/src/capabilities/settings/index.ts +7 -0
  173. package/src/capabilities/settings/settings.ts +38 -0
  174. package/src/capabilities/state/index.ts +7 -0
  175. package/src/capabilities/state/state.ts +104 -0
  176. package/src/capabilities/toolkit/index.ts +7 -0
  177. package/src/capabilities/toolkit/toolkit.ts +63 -0
  178. package/src/capabilities/tools/index.ts +7 -0
  179. package/src/capabilities/tools/tools.ts +92 -0
  180. package/src/capabilities/url-handler/index.ts +7 -0
  181. package/src/capabilities/url-handler/url-handler.ts +95 -0
  182. package/src/components/DeckLayout/ActiveNode.tsx +1 -1
  183. package/src/components/DeckLayout/Banner.tsx +6 -6
  184. package/src/components/DeckLayout/ContentEmpty.tsx +4 -5
  185. package/src/components/DeckLayout/DeckLayout.stories.tsx +51 -0
  186. package/src/components/DeckLayout/DeckLayout.tsx +18 -285
  187. package/src/components/DeckLayout/DeckMain.tsx +286 -0
  188. package/src/components/DeckLayout/Dialog.tsx +13 -10
  189. package/src/components/DeckLayout/Fallback.tsx +4 -4
  190. package/src/components/DeckLayout/Popover.tsx +44 -32
  191. package/src/components/DeckLayout/StatusBar.tsx +1 -1
  192. package/src/components/DeckLayout/Toast.tsx +30 -5
  193. package/src/components/DeckSettings/DeckSettings.tsx +91 -66
  194. package/src/components/Plank/Plank.stories.tsx +23 -16
  195. package/src/components/Plank/Plank.tsx +89 -56
  196. package/src/components/Plank/PlankControls.tsx +9 -9
  197. package/src/components/Plank/PlankError.tsx +5 -4
  198. package/src/components/Plank/PlankHeading.tsx +38 -42
  199. package/src/components/Sidebar/ComplementarySidebar.tsx +61 -33
  200. package/src/components/Sidebar/Sidebar.tsx +6 -6
  201. package/src/components/Sidebar/SidebarButton.tsx +39 -32
  202. package/src/components/fragments.ts +1 -1
  203. package/src/hooks/index.ts +1 -0
  204. package/src/hooks/useCompanions.ts +1 -1
  205. package/src/hooks/useDeckCompanions.ts +7 -5
  206. package/src/hooks/useDeckState.ts +82 -0
  207. package/src/hooks/useHoistStatusbar.ts +4 -5
  208. package/src/hooks/useNodeActionExpander.ts +4 -4
  209. package/src/index.ts +1 -2
  210. package/src/meta.ts +8 -5
  211. package/src/translations.ts +3 -1
  212. package/src/types/capabilities.ts +33 -0
  213. package/src/types/events.ts +20 -0
  214. package/src/types/index.ts +2 -0
  215. package/src/types/schema.ts +86 -14
  216. package/src/util/layoutAppliesTopbar.ts +1 -1
  217. package/src/util/set-active.ts +49 -29
  218. package/dist/lib/browser/app-graph-builder-JTFSDT2I.mjs +0 -152
  219. package/dist/lib/browser/app-graph-builder-JTFSDT2I.mjs.map +0 -7
  220. package/dist/lib/browser/check-app-scheme-57U62A3A.mjs.map +0 -7
  221. package/dist/lib/browser/chunk-CNTGBCMK.mjs.map +0 -7
  222. package/dist/lib/browser/chunk-D7KTFCUV.mjs +0 -1494
  223. package/dist/lib/browser/chunk-D7KTFCUV.mjs.map +0 -7
  224. package/dist/lib/browser/chunk-F5BQOOEG.mjs.map +0 -7
  225. package/dist/lib/browser/chunk-JFTXENFN.mjs +0 -129
  226. package/dist/lib/browser/chunk-JFTXENFN.mjs.map +0 -7
  227. package/dist/lib/browser/chunk-M57WD3V6.mjs +0 -16
  228. package/dist/lib/browser/chunk-M57WD3V6.mjs.map +0 -7
  229. package/dist/lib/browser/chunk-QDZO4AJ4.mjs +0 -127
  230. package/dist/lib/browser/chunk-QDZO4AJ4.mjs.map +0 -7
  231. package/dist/lib/browser/chunk-Z5KITAZW.mjs +0 -13
  232. package/dist/lib/browser/chunk-Z5KITAZW.mjs.map +0 -7
  233. package/dist/lib/browser/intent-resolver-P2OBK5HK.mjs +0 -521
  234. package/dist/lib/browser/intent-resolver-P2OBK5HK.mjs.map +0 -7
  235. package/dist/lib/browser/react-root-PO64J7ML.mjs +0 -43
  236. package/dist/lib/browser/react-root-PO64J7ML.mjs.map +0 -7
  237. package/dist/lib/browser/react-surface-E45YOVF5.mjs +0 -40
  238. package/dist/lib/browser/react-surface-E45YOVF5.mjs.map +0 -7
  239. package/dist/lib/browser/settings-6AJZPZPM.mjs +0 -29
  240. package/dist/lib/browser/settings-6AJZPZPM.mjs.map +0 -7
  241. package/dist/lib/browser/state-MVDYX77Y.mjs +0 -12
  242. package/dist/lib/browser/tools-TKQDPCHJ.mjs +0 -88
  243. package/dist/lib/browser/tools-TKQDPCHJ.mjs.map +0 -7
  244. package/dist/lib/browser/url-handler-7L7M6IKH.mjs +0 -70
  245. package/dist/lib/browser/url-handler-7L7M6IKH.mjs.map +0 -7
  246. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  247. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  248. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  249. package/dist/types/src/capabilities/check-app-scheme.d.ts +0 -4
  250. package/dist/types/src/capabilities/check-app-scheme.d.ts.map +0 -1
  251. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  252. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  253. package/dist/types/src/capabilities/react-root.d.ts +0 -7
  254. package/dist/types/src/capabilities/react-root.d.ts.map +0 -1
  255. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  256. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  257. package/dist/types/src/capabilities/settings.d.ts +0 -4
  258. package/dist/types/src/capabilities/settings.d.ts.map +0 -1
  259. package/dist/types/src/capabilities/state.d.ts +0 -101
  260. package/dist/types/src/capabilities/state.d.ts.map +0 -1
  261. package/dist/types/src/capabilities/tools.d.ts +0 -11
  262. package/dist/types/src/capabilities/tools.d.ts.map +0 -1
  263. package/dist/types/src/capabilities/url-handler.d.ts +0 -4
  264. package/dist/types/src/capabilities/url-handler.d.ts.map +0 -1
  265. package/dist/types/src/events.d.ts +0 -4
  266. package/dist/types/src/events.d.ts.map +0 -1
  267. package/src/capabilities/app-graph-builder.ts +0 -141
  268. package/src/capabilities/capabilities.ts +0 -14
  269. package/src/capabilities/intent-resolver.ts +0 -468
  270. package/src/capabilities/react-root.tsx +0 -38
  271. package/src/capabilities/react-surface.tsx +0 -30
  272. package/src/capabilities/settings.ts +0 -26
  273. package/src/capabilities/state.ts +0 -104
  274. package/src/capabilities/tools.ts +0 -81
  275. package/src/capabilities/url-handler.ts +0 -59
  276. package/src/events.ts +0 -11
  277. /package/dist/lib/{browser/state-MVDYX77Y.mjs.map → node-esm/types/index.mjs.map} +0 -0
@@ -0,0 +1,555 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+ import * as Function from 'effect/Function';
7
+ import * as Option from 'effect/Option';
8
+
9
+ import { Capability, Common } from '@dxos/app-framework';
10
+ import { Obj } from '@dxos/echo';
11
+ import { invariant } from '@dxos/invariant';
12
+ import { log } from '@dxos/log';
13
+ import { OperationResolver } from '@dxos/operation';
14
+ import { Operation } from '@dxos/operation';
15
+ import { AttentionCapabilities } from '@dxos/plugin-attention';
16
+ import { Graph, Node } from '@dxos/plugin-graph';
17
+ import { ObservabilityOperation } from '@dxos/plugin-observability/types';
18
+ import { byPosition, isNonNullable } from '@dxos/util';
19
+
20
+ import { closeEntry, createEntryId, incrementPlank, openEntry } from '../../layout';
21
+ import { meta } from '../../meta';
22
+ import {
23
+ DeckCapabilities,
24
+ DeckOperation,
25
+ type DeckState,
26
+ type DeckStateProps,
27
+ type LayoutMode,
28
+ PLANK_COMPANION_TYPE,
29
+ defaultDeck,
30
+ getMode,
31
+ isLayoutMode,
32
+ } from '../../types';
33
+ import { computeActiveUpdates } from '../../util';
34
+
35
+ /**
36
+ * Helper to update the active deck within the persisted state.
37
+ */
38
+ const updateActiveDeck = (current: DeckStateProps, deckUpdates: Partial<DeckState>): DeckStateProps => {
39
+ const currentDeck = current.decks[current.activeDeck];
40
+ invariant(currentDeck, `Deck not found: ${current.activeDeck}`);
41
+ return {
42
+ ...current,
43
+ decks: {
44
+ ...current.decks,
45
+ [current.activeDeck]: {
46
+ ...currentDeck,
47
+ ...deckUpdates,
48
+ },
49
+ },
50
+ };
51
+ };
52
+
53
+ export default Capability.makeModule(
54
+ Effect.fnUntraced(function* () {
55
+ return Capability.contributes(Common.Capability.OperationResolver, [
56
+ //
57
+ // UpdateSidebar
58
+ //
59
+ OperationResolver.make({
60
+ operation: Common.LayoutOperation.UpdateSidebar,
61
+ handler: Effect.fnUntraced(function* (input) {
62
+ const state = yield* Common.Capability.getAtomValue(DeckCapabilities.State);
63
+ const next = input.state ?? state.sidebarState;
64
+ if (next !== state.sidebarState) {
65
+ yield* Common.Capability.updateAtomValue(DeckCapabilities.State, (s) => ({ ...s, sidebarState: next }));
66
+ }
67
+ }),
68
+ }),
69
+
70
+ //
71
+ // UpdateComplementary
72
+ //
73
+ OperationResolver.make({
74
+ operation: Common.LayoutOperation.UpdateComplementary,
75
+ handler: Effect.fnUntraced(function* (input) {
76
+ const state = yield* Common.Capability.getAtomValue(DeckCapabilities.State);
77
+ const panelChanged = state.complementarySidebarPanel !== input.subject;
78
+ const next = input.subject ? 'expanded' : (input.state ?? state.complementarySidebarState);
79
+ const stateChanged = next !== state.complementarySidebarState;
80
+
81
+ if (panelChanged || stateChanged) {
82
+ yield* Common.Capability.updateAtomValue(DeckCapabilities.State, (s) => ({
83
+ ...s,
84
+ complementarySidebarPanel: panelChanged ? input.subject : s.complementarySidebarPanel,
85
+ complementarySidebarState: stateChanged ? next : s.complementarySidebarState,
86
+ }));
87
+ }
88
+ }),
89
+ }),
90
+
91
+ //
92
+ // UpdateDialog
93
+ //
94
+ OperationResolver.make({
95
+ operation: Common.LayoutOperation.UpdateDialog,
96
+ handler: Effect.fnUntraced(function* (input) {
97
+ yield* Common.Capability.updateAtomValue(DeckCapabilities.EphemeralState, (s) => ({
98
+ ...s,
99
+ dialogOpen: input.state ?? Boolean(input.subject),
100
+ dialogType: input.type ?? 'default',
101
+ dialogBlockAlign: input.blockAlign ?? 'center',
102
+ dialogOverlayClasses: input.overlayClasses,
103
+ dialogOverlayStyle: input.overlayStyle,
104
+ dialogContent: input.subject ? { component: input.subject, props: input.props } : null,
105
+ }));
106
+ }),
107
+ }),
108
+
109
+ //
110
+ // UpdatePopover
111
+ //
112
+ OperationResolver.make({
113
+ operation: Common.LayoutOperation.UpdatePopover,
114
+ handler: Effect.fnUntraced(function* (input) {
115
+ yield* Common.Capability.updateAtomValue(DeckCapabilities.EphemeralState, (s) => ({
116
+ ...s,
117
+ popoverOpen: input.state ?? Boolean(input.subject),
118
+ popoverKind: input.kind ?? 'base',
119
+ popoverTitle: input.kind === 'card' ? input.title : undefined,
120
+ popoverContent:
121
+ typeof input.subject === 'string'
122
+ ? { component: input.subject, props: input.props }
123
+ : input.subject
124
+ ? { subject: input.subject }
125
+ : null,
126
+ popoverSide: input.side,
127
+ popoverAnchor: input.variant === 'virtual' ? input.anchor : s.popoverAnchor,
128
+ popoverAnchorId: input.variant !== 'virtual' ? input.anchorId : s.popoverAnchorId,
129
+ }));
130
+ }),
131
+ }),
132
+
133
+ //
134
+ // AddToast
135
+ //
136
+ OperationResolver.make({
137
+ operation: Common.LayoutOperation.AddToast,
138
+ handler: Effect.fnUntraced(function* (input) {
139
+ yield* Common.Capability.updateAtomValue(DeckCapabilities.EphemeralState, (s) => ({
140
+ ...s,
141
+ toasts: [...s.toasts, input as Common.LayoutOperation.Toast],
142
+ }));
143
+ }),
144
+ }),
145
+
146
+ //
147
+ // ShowUndo
148
+ //
149
+ OperationResolver.make({
150
+ operation: Common.UndoOperation.ShowUndo,
151
+ handler: Effect.fnUntraced(function* (input) {
152
+ const historyTracker = yield* Capability.get(Common.Capability.HistoryTracker);
153
+
154
+ const newUndoId = `show-undo-${Date.now()}`;
155
+ // TODO(wittjosiah): Support undoing further back than the last action.
156
+ yield* Common.Capability.updateAtomValue(DeckCapabilities.EphemeralState, (s) => {
157
+ const filteredToasts = s.currentUndoId
158
+ ? s.toasts.filter((toast) => toast.id !== s.currentUndoId)
159
+ : s.toasts;
160
+
161
+ const toast: Common.LayoutOperation.Toast = {
162
+ id: newUndoId,
163
+ title: input.message ?? ['undo available label', { ns: meta.id }],
164
+ duration: 10_000,
165
+ actionLabel: ['undo action label', { ns: meta.id }],
166
+ actionAlt: ['undo action alt', { ns: meta.id }],
167
+ closeLabel: ['undo close label', { ns: meta.id }],
168
+ onAction: () => historyTracker.undoPromise(),
169
+ };
170
+
171
+ return {
172
+ ...s,
173
+ currentUndoId: newUndoId,
174
+ toasts: [...filteredToasts, toast],
175
+ };
176
+ });
177
+ }),
178
+ }),
179
+
180
+ //
181
+ // SetLayoutMode
182
+ //
183
+ OperationResolver.make({
184
+ operation: Common.LayoutOperation.SetLayoutMode,
185
+ filter: (input) => {
186
+ if ('mode' in input) {
187
+ return isLayoutMode(input.mode);
188
+ }
189
+ return true;
190
+ },
191
+ handler: Effect.fnUntraced(function* (input) {
192
+ const state = yield* Common.Capability.getAtomValue(DeckCapabilities.State);
193
+ const deck = yield* DeckCapabilities.getDeck();
194
+
195
+ const computeModeUpdate = (mode: LayoutMode, subject?: string): Partial<DeckState> => {
196
+ const current = deck.solo ? [deck.solo] : deck.active;
197
+ // When un-soloing, the solo entry is added to the deck.
198
+ const next = (
199
+ mode !== 'deck' ? [subject ?? deck.solo ?? deck.active[0]] : [...deck.active, deck.solo]
200
+ ).filter(isNonNullable);
201
+
202
+ const removed = current.filter((id: string) => !next.includes(id));
203
+ const closed = Array.from(
204
+ new Set([...deck.inactive.filter((id: string) => !next.includes(id)), ...removed]),
205
+ );
206
+
207
+ // Build deckUpdates object without mutating.
208
+ const soloUpdate =
209
+ mode !== 'deck' && next[0]
210
+ ? { solo: next[0] }
211
+ : mode === 'deck' && deck.solo
212
+ ? { solo: undefined, initialized: true }
213
+ : {};
214
+
215
+ const fullscreenUpdate = mode === 'solo--fullscreen' ? { fullscreen: !deck.fullscreen } : {};
216
+
217
+ return {
218
+ inactive: closed,
219
+ ...soloUpdate,
220
+ ...fullscreenUpdate,
221
+ };
222
+ };
223
+
224
+ if ('mode' in input) {
225
+ const currentMode = getMode(deck);
226
+ const deckUpdates = computeModeUpdate(
227
+ input.mode as LayoutMode,
228
+ 'subject' in input ? input.subject : undefined,
229
+ );
230
+
231
+ yield* Common.Capability.updateAtomValue(DeckCapabilities.State, (s) => {
232
+ const newPreviousMode =
233
+ currentMode !== input.mode ? { ...s.previousMode, [s.activeDeck]: currentMode } : s.previousMode;
234
+ return {
235
+ ...updateActiveDeck(s, deckUpdates),
236
+ previousMode: newPreviousMode,
237
+ };
238
+ });
239
+ } else if ('revert' in input) {
240
+ const last = state.previousMode[state.activeDeck];
241
+ const deckUpdates = computeModeUpdate(last ?? 'solo');
242
+ yield* Common.Capability.updateAtomValue(DeckCapabilities.State, (s) => updateActiveDeck(s, deckUpdates));
243
+ } else {
244
+ log.warn('Invalid layout mode', input);
245
+ }
246
+ }),
247
+ }),
248
+
249
+ //
250
+ // SwitchWorkspace
251
+ //
252
+ OperationResolver.make({
253
+ operation: Common.LayoutOperation.SwitchWorkspace,
254
+ handler: Effect.fnUntraced(function* (input) {
255
+ const { graph } = yield* Capability.get(Common.Capability.AppGraph);
256
+
257
+ {
258
+ const state = yield* Common.Capability.getAtomValue(DeckCapabilities.State);
259
+ // TODO(wittjosiah): This is a hack to prevent the previous deck from being set for pinned items.
260
+ // Ideally this should be worked into the data model in a generic way.
261
+ const shouldUpdatePrevious = !state.activeDeck.startsWith('!');
262
+
263
+ yield* Common.Capability.updateAtomValue(DeckCapabilities.State, (s) => {
264
+ const newDecks = s.decks[input.subject] ? s.decks : { ...s.decks, [input.subject]: { ...defaultDeck } };
265
+ return {
266
+ ...s,
267
+ previousDeck: shouldUpdatePrevious ? s.activeDeck : s.previousDeck,
268
+ activeDeck: input.subject,
269
+ decks: newDecks,
270
+ };
271
+ });
272
+ }
273
+
274
+ {
275
+ const state = yield* Common.Capability.getAtomValue(DeckCapabilities.State);
276
+ const deck = state.decks[input.subject];
277
+ invariant(deck, `Deck not found: ${input.subject}`);
278
+
279
+ const first = deck.solo ? deck.solo : deck.active[0];
280
+ if (first) {
281
+ yield* Operation.schedule(Common.LayoutOperation.ScrollIntoView, { subject: first });
282
+ } else {
283
+ const [item] = Graph.getConnections(graph, input.subject).filter(
284
+ (node) => !Node.isActionLike(node) && !node.properties.disposition,
285
+ );
286
+ if (item) {
287
+ yield* Operation.schedule(Common.LayoutOperation.Open, { subject: [item.id] });
288
+ }
289
+ }
290
+ }
291
+ }),
292
+ }),
293
+
294
+ //
295
+ // RevertWorkspace
296
+ //
297
+ OperationResolver.make({
298
+ operation: Common.LayoutOperation.RevertWorkspace,
299
+ handler: Effect.fnUntraced(function* () {
300
+ const state = yield* Common.Capability.getAtomValue(DeckCapabilities.State);
301
+ yield* Operation.invoke(Common.LayoutOperation.SwitchWorkspace, { subject: state.previousDeck });
302
+ }),
303
+ }),
304
+
305
+ //
306
+ // Open
307
+ //
308
+ OperationResolver.make({
309
+ operation: Common.LayoutOperation.Open,
310
+ handler: Effect.fnUntraced(function* (input) {
311
+ const { graph } = yield* Capability.get(Common.Capability.AppGraph);
312
+ const attention = yield* Capability.get(AttentionCapabilities.Attention);
313
+ const settings = yield* Common.Capability.getAtomValue(DeckCapabilities.Settings);
314
+
315
+ {
316
+ const state = yield* Common.Capability.getAtomValue(DeckCapabilities.State);
317
+ if (input.workspace && state.activeDeck !== input.workspace) {
318
+ yield* Operation.invoke(Common.LayoutOperation.SwitchWorkspace, { subject: input.workspace });
319
+ }
320
+ }
321
+
322
+ let previouslyOpenIds: Set<string>;
323
+ {
324
+ const deck = yield* DeckCapabilities.getDeck();
325
+ previouslyOpenIds = new Set<string>(deck.solo ? [deck.solo] : deck.active);
326
+ const next = deck.solo
327
+ ? input.subject.map((id) => createEntryId(id, input.variant))
328
+ : input.subject.reduce(
329
+ (acc, entryId) =>
330
+ openEntry(acc, entryId, {
331
+ key: input.key,
332
+ positioning: input.positioning ?? settings?.newPlankPositioning,
333
+ pivotId: input.pivotId,
334
+ variant: input.variant,
335
+ }),
336
+ deck.active,
337
+ );
338
+
339
+ const { deckUpdates, toAttend: _toAttend } = computeActiveUpdates({ next, deck, attention });
340
+ yield* Common.Capability.updateAtomValue(DeckCapabilities.State, (s) => updateActiveDeck(s, deckUpdates));
341
+ }
342
+
343
+ {
344
+ const deck = yield* DeckCapabilities.getDeck();
345
+ const ids = deck.solo ? [deck.solo] : deck.active;
346
+ const newlyOpen = ids.filter((i: string) => !previouslyOpenIds.has(i));
347
+
348
+ if (input.scrollIntoView !== false && (newlyOpen[0] ?? input.subject[0])) {
349
+ yield* Operation.schedule(Common.LayoutOperation.ScrollIntoView, {
350
+ subject: newlyOpen[0] ?? input.subject[0],
351
+ });
352
+ }
353
+
354
+ if (newlyOpen[0] ?? input.subject[0]) {
355
+ yield* Operation.schedule(Common.LayoutOperation.Expose, { subject: newlyOpen[0] ?? input.subject[0] });
356
+ }
357
+
358
+ // Send analytics events for newly opened items.
359
+ for (const subjectId of newlyOpen) {
360
+ const typename = Option.match(Graph.getNode(graph, subjectId), {
361
+ onNone: () => undefined,
362
+ onSome: (node) => {
363
+ const active = node.data;
364
+ return Obj.isObject(active) ? Obj.getTypename(active) : undefined;
365
+ },
366
+ });
367
+ yield* Operation.schedule(ObservabilityOperation.SendEvent, {
368
+ name: 'navigation.activate',
369
+ properties: { subjectId, typename },
370
+ });
371
+ }
372
+ }
373
+ }),
374
+ }),
375
+
376
+ //
377
+ // UpdatePlankSize
378
+ //
379
+ OperationResolver.make({
380
+ operation: DeckOperation.UpdatePlankSize,
381
+ handler: Effect.fnUntraced(function* (input) {
382
+ yield* Common.Capability.updateAtomValue(DeckCapabilities.State, (s) =>
383
+ updateActiveDeck(s, {
384
+ plankSizing: {
385
+ ...s.decks[s.activeDeck]?.plankSizing,
386
+ [input.id]: input.size,
387
+ },
388
+ }),
389
+ );
390
+ }),
391
+ }),
392
+
393
+ //
394
+ // Adjust
395
+ //
396
+ OperationResolver.make({
397
+ operation: DeckOperation.Adjust,
398
+ handler: Effect.fnUntraced(function* (input) {
399
+ const _state = yield* Common.Capability.getAtomValue(DeckCapabilities.State);
400
+ const deck = yield* DeckCapabilities.getDeck();
401
+ const attention = yield* Capability.get(AttentionCapabilities.Attention);
402
+ const { graph } = yield* Capability.get(Common.Capability.AppGraph);
403
+
404
+ // Collect layout operations to run after state updates.
405
+ let soloOperation:
406
+ | { type: 'solo'; entryId: string; mode: string }
407
+ | { type: 'unsolo'; entryId: string }
408
+ | undefined;
409
+
410
+ if (input.type === 'increment-end' || input.type === 'increment-start') {
411
+ const next = incrementPlank(deck.active, input);
412
+ const { deckUpdates } = computeActiveUpdates({ next, deck, attention });
413
+ yield* Common.Capability.updateAtomValue(DeckCapabilities.State, (s) => updateActiveDeck(s, deckUpdates));
414
+ }
415
+
416
+ if (input.type.startsWith('solo')) {
417
+ const entryId = input.id;
418
+ if (!deck.solo) {
419
+ // Solo the entry.
420
+ soloOperation = { type: 'solo', entryId, mode: input.type };
421
+ } else {
422
+ if (input.type === 'solo--fullscreen') {
423
+ // Toggle fullscreen on the current entry.
424
+ soloOperation = { type: 'solo', entryId, mode: 'solo--fullscreen' };
425
+ } else if (input.type === 'solo') {
426
+ // Un-solo the current entry and open it.
427
+ soloOperation = { type: 'unsolo', entryId };
428
+ }
429
+ }
430
+ }
431
+
432
+ // Run collected solo operations.
433
+ if (soloOperation?.type === 'solo') {
434
+ yield* Operation.invoke(Common.LayoutOperation.SetLayoutMode, {
435
+ subject: soloOperation.entryId,
436
+ mode: soloOperation.mode,
437
+ });
438
+ } else if (soloOperation?.type === 'unsolo') {
439
+ yield* Operation.invoke(Common.LayoutOperation.SetLayoutMode, { mode: 'deck' });
440
+ yield* Operation.invoke(Common.LayoutOperation.Open, { subject: [soloOperation.entryId] });
441
+ }
442
+
443
+ if (input.type === 'companion') {
444
+ const companion = Function.pipe(
445
+ Graph.getNode(graph, input.id),
446
+ Option.map((node) =>
447
+ Graph.getConnections(graph, node.id)
448
+ .filter((n) => n.type === PLANK_COMPANION_TYPE)
449
+ .toSorted((a, b) => byPosition(a.properties, b.properties)),
450
+ ),
451
+ Option.flatMap((companions) => (companions.length > 0 ? Option.some(companions[0]) : Option.none())),
452
+ );
453
+
454
+ if (Option.isSome(companion)) {
455
+ // TODO(wittjosiah): This should remember the previously selected companion.
456
+ yield* Operation.invoke(DeckOperation.ChangeCompanion, {
457
+ primary: input.id,
458
+ companion: companion.value.id,
459
+ });
460
+ }
461
+ }
462
+ }),
463
+ }),
464
+
465
+ //
466
+ // ChangeCompanion
467
+ //
468
+ OperationResolver.make({
469
+ operation: DeckOperation.ChangeCompanion,
470
+ handler: Effect.fnUntraced(function* (input) {
471
+ const deck = yield* DeckCapabilities.getDeck();
472
+ if (input.companion === null) {
473
+ const { [input.primary]: _, ...nextActiveCompanions } = deck.activeCompanions ?? {};
474
+ yield* Common.Capability.updateAtomValue(DeckCapabilities.State, (s) =>
475
+ updateActiveDeck(s, { activeCompanions: nextActiveCompanions }),
476
+ );
477
+ } else {
478
+ const companion = input.companion;
479
+ invariant(companion !== input.primary);
480
+ yield* Common.Capability.updateAtomValue(DeckCapabilities.State, (s) =>
481
+ updateActiveDeck(s, {
482
+ activeCompanions: {
483
+ ...deck.activeCompanions,
484
+ [input.primary]: companion,
485
+ },
486
+ }),
487
+ );
488
+ }
489
+ }),
490
+ }),
491
+
492
+ //
493
+ // Close
494
+ //
495
+ OperationResolver.make({
496
+ operation: Common.LayoutOperation.Close,
497
+ handler: Effect.fnUntraced(function* (input) {
498
+ const deck = yield* DeckCapabilities.getDeck();
499
+ const attention = yield* Capability.get(AttentionCapabilities.Attention);
500
+
501
+ const active = deck.solo ? [deck.solo] : deck.active;
502
+ const next = input.subject.reduce((acc, id) => closeEntry(acc, id), active);
503
+ const { deckUpdates, toAttend } = computeActiveUpdates({ next, deck, attention });
504
+ yield* Common.Capability.updateAtomValue(DeckCapabilities.State, (s) => updateActiveDeck(s, deckUpdates));
505
+
506
+ // Clear companions for closed entries.
507
+ for (const id of input.subject) {
508
+ if (deck.activeCompanions && id in deck.activeCompanions) {
509
+ yield* Operation.invoke(DeckOperation.ChangeCompanion, { primary: id, companion: null });
510
+ }
511
+ }
512
+
513
+ if (toAttend) {
514
+ yield* Operation.schedule(Common.LayoutOperation.ScrollIntoView, { subject: toAttend });
515
+ }
516
+ }),
517
+ }),
518
+
519
+ //
520
+ // Set
521
+ //
522
+ OperationResolver.make({
523
+ operation: Common.LayoutOperation.Set,
524
+ handler: Effect.fnUntraced(function* (input) {
525
+ const deck = yield* DeckCapabilities.getDeck();
526
+ const attention = yield* Capability.get(AttentionCapabilities.Attention);
527
+
528
+ const { deckUpdates, toAttend } = computeActiveUpdates({
529
+ next: input.subject as string[],
530
+ deck,
531
+ attention,
532
+ });
533
+ yield* Common.Capability.updateAtomValue(DeckCapabilities.State, (s) => updateActiveDeck(s, deckUpdates));
534
+
535
+ if (toAttend) {
536
+ yield* Operation.schedule(Common.LayoutOperation.ScrollIntoView, { subject: toAttend });
537
+ }
538
+ }),
539
+ }),
540
+
541
+ //
542
+ // ScrollIntoView
543
+ //
544
+ OperationResolver.make({
545
+ operation: Common.LayoutOperation.ScrollIntoView,
546
+ handler: Effect.fnUntraced(function* (input) {
547
+ yield* Common.Capability.updateAtomValue(DeckCapabilities.EphemeralState, (s) => ({
548
+ ...s,
549
+ scrollIntoView: input.subject,
550
+ }));
551
+ }),
552
+ }),
553
+ ]);
554
+ }),
555
+ );
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Capability } from '@dxos/app-framework';
6
+
7
+ export const ReactRoot = Capability.lazy('ReactRoot', () => import('./react-root'));
@@ -0,0 +1,47 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+ import React, { useCallback } from 'react';
7
+
8
+ import { Capability, Common } from '@dxos/app-framework';
9
+
10
+ import { DeckLayout } from '../../components';
11
+ import { useDeckState } from '../../hooks';
12
+ import { meta } from '../../meta';
13
+
14
+ export default Capability.makeModule(() =>
15
+ Effect.succeed(
16
+ Capability.contributes(Common.Capability.ReactRoot, {
17
+ id: meta.id,
18
+ root: () => {
19
+ const { state, updateEphemeral } = useDeckState();
20
+
21
+ const handleDismissToast = useCallback(
22
+ (id: string) => {
23
+ const index = state.toasts.findIndex((toast) => toast.id === id);
24
+ if (index !== -1) {
25
+ // Allow time for the toast to animate out.
26
+ // TODO(burdon): Factor out and unregister timeout.
27
+ setTimeout(() => {
28
+ updateEphemeral((s) => {
29
+ const toastToRemove = s.toasts[index];
30
+ const newCurrentUndoId = toastToRemove?.id === s.currentUndoId ? undefined : s.currentUndoId;
31
+ return {
32
+ ...s,
33
+ currentUndoId: newCurrentUndoId,
34
+ toasts: s.toasts.filter((_, i) => i !== index),
35
+ };
36
+ });
37
+ }, 1_000);
38
+ }
39
+ },
40
+ [state.toasts, updateEphemeral],
41
+ );
42
+
43
+ return <DeckLayout onDismissToast={handleDismissToast} />;
44
+ },
45
+ }),
46
+ ),
47
+ );
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Capability } from '@dxos/app-framework';
6
+
7
+ export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
@@ -0,0 +1,37 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+ import React from 'react';
7
+
8
+ import { Capability, Common } from '@dxos/app-framework';
9
+ import { useSettingsState } from '@dxos/app-framework/react';
10
+
11
+ import { Banner, DeckSettings } from '../../components';
12
+ import { meta } from '../../meta';
13
+ import { type DeckSettingsProps } from '../../types';
14
+
15
+ export default Capability.makeModule(() =>
16
+ Effect.succeed(
17
+ Capability.contributes(Common.Capability.ReactSurface, [
18
+ Common.createSurface({
19
+ id: `${meta.id}/plugin-settings`,
20
+ role: 'article',
21
+ filter: (data): data is { subject: Common.Capability.Settings } =>
22
+ Common.Capability.isSettings(data.subject) && data.subject.prefix === meta.id,
23
+ component: ({ data: { subject } }) => {
24
+ const { settings, updateSettings } = useSettingsState<DeckSettingsProps>(subject.atom);
25
+ return <DeckSettings settings={settings} onSettingsChange={updateSettings} />;
26
+ },
27
+ }),
28
+ Common.createSurface({
29
+ id: `${meta.id}/banner`,
30
+ role: 'banner',
31
+ component: ({ data }: { data: { variant?: 'topbar' | 'sidebar' } }) => {
32
+ return <Banner variant={data.variant} />;
33
+ },
34
+ }),
35
+ ]),
36
+ ),
37
+ );
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Capability } from '@dxos/app-framework';
6
+
7
+ export const DeckSettings = Capability.lazy('DeckSettings', () => import('./settings'));