@dxos/plugin-deck 0.8.4-main.3f58842 → 0.8.4-main.52d7546f51

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