@dxos/plugin-deck 0.8.4-main.7ace549 → 0.8.4-main.8360d9e660

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 (324) hide show
  1. package/dist/lib/browser/Banner-AJW6225V.mjs +14 -0
  2. package/dist/lib/browser/Banner-AJW6225V.mjs.map +7 -0
  3. package/dist/lib/browser/DeckSettings-HSSQKFNE.mjs +96 -0
  4. package/dist/lib/browser/DeckSettings-HSSQKFNE.mjs.map +7 -0
  5. package/dist/lib/browser/app-graph-builder-MP6INIM2.mjs +123 -0
  6. package/dist/lib/browser/app-graph-builder-MP6INIM2.mjs.map +7 -0
  7. package/dist/lib/browser/check-app-scheme-AUNCD2Y6.mjs +33 -0
  8. package/dist/lib/browser/check-app-scheme-AUNCD2Y6.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-3P2FJVXC.mjs +278 -0
  10. package/dist/lib/browser/chunk-3P2FJVXC.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-BJDEG7YZ.mjs +74 -0
  12. package/dist/lib/browser/chunk-BJDEG7YZ.mjs.map +7 -0
  13. package/dist/lib/browser/{chunk-UXLU6CMW.mjs → chunk-L3RYMAV7.mjs} +2 -2
  14. package/dist/lib/browser/chunk-L3RYMAV7.mjs.map +7 -0
  15. package/dist/lib/browser/chunk-TAHLKBDO.mjs +187 -0
  16. package/dist/lib/browser/chunk-TAHLKBDO.mjs.map +7 -0
  17. package/dist/lib/browser/chunk-WTNYSXY5.mjs +1388 -0
  18. package/dist/lib/browser/chunk-WTNYSXY5.mjs.map +7 -0
  19. package/dist/lib/browser/index.mjs +82 -72
  20. package/dist/lib/browser/index.mjs.map +4 -4
  21. package/dist/lib/browser/meta.json +1 -1
  22. package/dist/lib/browser/operation-resolver-2TEGT4PG.mjs +639 -0
  23. package/dist/lib/browser/operation-resolver-2TEGT4PG.mjs.map +7 -0
  24. package/dist/lib/browser/react-root-XBFHPSCP.mjs +48 -0
  25. package/dist/lib/browser/react-root-XBFHPSCP.mjs.map +7 -0
  26. package/dist/lib/browser/react-surface-4J3BZNT2.mjs +44 -0
  27. package/dist/lib/browser/react-surface-4J3BZNT2.mjs.map +7 -0
  28. package/dist/lib/browser/settings-PTMGCSJH.mjs +40 -0
  29. package/dist/lib/browser/settings-PTMGCSJH.mjs.map +7 -0
  30. package/dist/lib/browser/state-MA4SQ7BE.mjs +106 -0
  31. package/dist/lib/browser/state-MA4SQ7BE.mjs.map +7 -0
  32. package/dist/lib/browser/toolkit-6B34QFU3.mjs +55 -0
  33. package/dist/lib/browser/toolkit-6B34QFU3.mjs.map +7 -0
  34. package/dist/lib/browser/types/index.mjs +14 -8
  35. package/dist/lib/browser/url-handler-FEUFPQIP.mjs +98 -0
  36. package/dist/lib/browser/url-handler-FEUFPQIP.mjs.map +7 -0
  37. package/dist/lib/node-esm/Banner-XBH2IIDR.mjs +15 -0
  38. package/dist/lib/node-esm/Banner-XBH2IIDR.mjs.map +7 -0
  39. package/dist/lib/node-esm/DeckSettings-DJRFLKQS.mjs +97 -0
  40. package/dist/lib/node-esm/DeckSettings-DJRFLKQS.mjs.map +7 -0
  41. package/dist/lib/node-esm/app-graph-builder-ACHG5HY7.mjs +124 -0
  42. package/dist/lib/node-esm/app-graph-builder-ACHG5HY7.mjs.map +7 -0
  43. package/dist/lib/node-esm/check-app-scheme-WN76GWVC.mjs +34 -0
  44. package/dist/lib/node-esm/check-app-scheme-WN76GWVC.mjs.map +7 -0
  45. package/dist/lib/node-esm/chunk-CQ3XYTNJ.mjs +1389 -0
  46. package/dist/lib/node-esm/chunk-CQ3XYTNJ.mjs.map +7 -0
  47. package/dist/lib/node-esm/chunk-DGTRKKWZ.mjs +76 -0
  48. package/dist/lib/node-esm/chunk-DGTRKKWZ.mjs.map +7 -0
  49. package/dist/lib/node-esm/chunk-EMU4VIPH.mjs +188 -0
  50. package/dist/lib/node-esm/chunk-EMU4VIPH.mjs.map +7 -0
  51. package/dist/lib/node-esm/chunk-GZJAQ5IP.mjs +279 -0
  52. package/dist/lib/node-esm/chunk-GZJAQ5IP.mjs.map +7 -0
  53. package/dist/lib/node-esm/chunk-XCNF4COU.mjs +18 -0
  54. package/dist/lib/node-esm/chunk-XCNF4COU.mjs.map +7 -0
  55. package/dist/lib/node-esm/index.mjs +185 -0
  56. package/dist/lib/node-esm/index.mjs.map +7 -0
  57. package/dist/lib/node-esm/meta.json +1 -0
  58. package/dist/lib/node-esm/operation-resolver-GCMCCI7A.mjs +640 -0
  59. package/dist/lib/node-esm/operation-resolver-GCMCCI7A.mjs.map +7 -0
  60. package/dist/lib/node-esm/react-root-32LZ6APH.mjs +49 -0
  61. package/dist/lib/node-esm/react-root-32LZ6APH.mjs.map +7 -0
  62. package/dist/lib/node-esm/react-surface-CO4ZDZKM.mjs +45 -0
  63. package/dist/lib/node-esm/react-surface-CO4ZDZKM.mjs.map +7 -0
  64. package/dist/lib/node-esm/settings-LPPFLXNJ.mjs +41 -0
  65. package/dist/lib/node-esm/settings-LPPFLXNJ.mjs.map +7 -0
  66. package/dist/lib/node-esm/state-KNRU3GDC.mjs +107 -0
  67. package/dist/lib/node-esm/state-KNRU3GDC.mjs.map +7 -0
  68. package/dist/lib/node-esm/toolkit-SOWYKJY3.mjs +56 -0
  69. package/dist/lib/node-esm/toolkit-SOWYKJY3.mjs.map +7 -0
  70. package/dist/lib/node-esm/types/index.mjs +39 -0
  71. package/dist/lib/node-esm/url-handler-4LEB7UWF.mjs +99 -0
  72. package/dist/lib/node-esm/url-handler-4LEB7UWF.mjs.map +7 -0
  73. package/dist/types/src/DeckPlugin.d.ts +2 -1
  74. package/dist/types/src/DeckPlugin.d.ts.map +1 -1
  75. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
  76. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  77. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  78. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  79. package/dist/types/src/capabilities/check-app-scheme/check-app-scheme.d.ts +5 -0
  80. package/dist/types/src/capabilities/check-app-scheme/check-app-scheme.d.ts.map +1 -0
  81. package/dist/types/src/capabilities/check-app-scheme/index.d.ts +3 -0
  82. package/dist/types/src/capabilities/check-app-scheme/index.d.ts.map +1 -0
  83. package/dist/types/src/capabilities/index.d.ts +8 -13
  84. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  85. package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
  86. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
  87. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
  88. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
  89. package/dist/types/src/capabilities/react-root/index.d.ts +6 -0
  90. package/dist/types/src/capabilities/react-root/index.d.ts.map +1 -0
  91. package/dist/types/src/capabilities/react-root/react-root.d.ts +9 -0
  92. package/dist/types/src/capabilities/react-root/react-root.d.ts.map +1 -0
  93. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  94. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  95. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  96. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  97. package/dist/types/src/capabilities/settings/index.d.ts +19 -0
  98. package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
  99. package/dist/types/src/capabilities/settings/settings.d.ts +22 -0
  100. package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
  101. package/dist/types/src/capabilities/state/index.d.ts +172 -0
  102. package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
  103. package/dist/types/src/capabilities/state/state.d.ts +175 -0
  104. package/dist/types/src/capabilities/state/state.d.ts.map +1 -0
  105. package/dist/types/src/capabilities/toolkit/index.d.ts +3 -0
  106. package/dist/types/src/capabilities/toolkit/index.d.ts.map +1 -0
  107. package/dist/types/src/capabilities/{toolkit.d.ts → toolkit/toolkit.d.ts} +6 -4
  108. package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +1 -0
  109. package/dist/types/src/capabilities/tools/index.d.ts +3 -0
  110. package/dist/types/src/capabilities/tools/index.d.ts.map +1 -0
  111. package/dist/types/src/capabilities/tools/tools.d.ts +12 -0
  112. package/dist/types/src/capabilities/tools/tools.d.ts.map +1 -0
  113. package/dist/types/src/capabilities/url-handler/index.d.ts +3 -0
  114. package/dist/types/src/capabilities/url-handler/index.d.ts.map +1 -0
  115. package/dist/types/src/capabilities/url-handler/url-handler.d.ts +5 -0
  116. package/dist/types/src/capabilities/url-handler/url-handler.d.ts.map +1 -0
  117. package/dist/types/src/components/DeckLayout/ActiveNode.d.ts.map +1 -1
  118. package/dist/types/src/components/DeckLayout/ContentEmpty.d.ts.map +1 -1
  119. package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
  120. package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts +1 -0
  121. package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts.map +1 -1
  122. package/dist/types/src/components/DeckLayout/DeckMain.d.ts.map +1 -1
  123. package/dist/types/src/components/DeckLayout/Dialog.d.ts.map +1 -1
  124. package/dist/types/src/components/DeckLayout/Fallback.d.ts.map +1 -1
  125. package/dist/types/src/components/DeckLayout/Popover.d.ts.map +1 -1
  126. package/dist/types/src/components/DeckLayout/Toast.d.ts +3 -3
  127. package/dist/types/src/components/DeckLayout/Toast.d.ts.map +1 -1
  128. package/dist/types/src/components/Plank/Plank.d.ts +5 -5
  129. package/dist/types/src/components/Plank/Plank.d.ts.map +1 -1
  130. package/dist/types/src/components/Plank/Plank.stories.d.ts +25 -6
  131. package/dist/types/src/components/Plank/Plank.stories.d.ts.map +1 -1
  132. package/dist/types/src/components/Plank/PlankControls.d.ts +1 -1
  133. package/dist/types/src/components/Plank/PlankControls.d.ts.map +1 -1
  134. package/dist/types/src/components/Plank/PlankError.d.ts +6 -4
  135. package/dist/types/src/components/Plank/PlankError.d.ts.map +1 -1
  136. package/dist/types/src/components/Plank/PlankHeading.d.ts +2 -2
  137. package/dist/types/src/components/Plank/PlankHeading.d.ts.map +1 -1
  138. package/dist/types/src/components/Sidebar/ComplementarySidebar.d.ts.map +1 -1
  139. package/dist/types/src/components/Sidebar/Sidebar.d.ts.map +1 -1
  140. package/dist/types/src/components/Sidebar/SidebarButton.d.ts.map +1 -1
  141. package/dist/types/src/components/fragments.d.ts +4 -1
  142. package/dist/types/src/components/fragments.d.ts.map +1 -1
  143. package/dist/types/src/components/index.d.ts +0 -1
  144. package/dist/types/src/components/index.d.ts.map +1 -1
  145. package/dist/types/src/containers/Banner/Banner.d.ts +2 -0
  146. package/dist/types/src/containers/Banner/Banner.d.ts.map +1 -0
  147. package/dist/types/src/containers/Banner/index.d.ts +3 -0
  148. package/dist/types/src/containers/Banner/index.d.ts.map +1 -0
  149. package/dist/types/src/containers/DeckSettings/DeckSettings.d.ts +8 -0
  150. package/dist/types/src/containers/DeckSettings/DeckSettings.d.ts.map +1 -0
  151. package/dist/types/src/containers/DeckSettings/index.d.ts +3 -0
  152. package/dist/types/src/containers/DeckSettings/index.d.ts.map +1 -0
  153. package/dist/types/src/containers/index.d.ts +4 -0
  154. package/dist/types/src/containers/index.d.ts.map +1 -0
  155. package/dist/types/src/hooks/index.d.ts +2 -0
  156. package/dist/types/src/hooks/index.d.ts.map +1 -1
  157. package/dist/types/src/hooks/useDeckCompanions.d.ts +3 -4
  158. package/dist/types/src/hooks/useDeckCompanions.d.ts.map +1 -1
  159. package/dist/types/src/hooks/useDeckState.d.ts +17 -0
  160. package/dist/types/src/hooks/useDeckState.d.ts.map +1 -0
  161. package/dist/types/src/hooks/useHoistStatusbar.d.ts +1 -1
  162. package/dist/types/src/hooks/useHoistStatusbar.d.ts.map +1 -1
  163. package/dist/types/src/hooks/useMainSize.d.ts +2 -2
  164. package/dist/types/src/hooks/useNodeActionExpander.d.ts +1 -1
  165. package/dist/types/src/hooks/useNodeActionExpander.d.ts.map +1 -1
  166. package/dist/types/src/hooks/useSelectedCompanion.d.ts +13 -0
  167. package/dist/types/src/hooks/useSelectedCompanion.d.ts.map +1 -0
  168. package/dist/types/src/index.d.ts +1 -2
  169. package/dist/types/src/index.d.ts.map +1 -1
  170. package/dist/types/src/layout.d.ts +1 -7
  171. package/dist/types/src/layout.d.ts.map +1 -1
  172. package/dist/types/src/meta.d.ts +2 -2
  173. package/dist/types/src/meta.d.ts.map +1 -1
  174. package/dist/types/src/translations.d.ts +1 -0
  175. package/dist/types/src/translations.d.ts.map +1 -1
  176. package/dist/types/src/{capabilities → types}/capabilities.d.ts +96 -90
  177. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  178. package/dist/types/src/types/events.d.ts +7 -0
  179. package/dist/types/src/types/events.d.ts.map +1 -0
  180. package/dist/types/src/types/index.d.ts +2 -0
  181. package/dist/types/src/types/index.d.ts.map +1 -1
  182. package/dist/types/src/types/schema.d.ts +99 -38
  183. package/dist/types/src/types/schema.d.ts.map +1 -1
  184. package/dist/types/src/util/set-active.d.ts +18 -3
  185. package/dist/types/src/util/set-active.d.ts.map +1 -1
  186. package/dist/types/tsconfig.tsbuildinfo +1 -1
  187. package/package.json +59 -49
  188. package/src/DeckPlugin.ts +28 -48
  189. package/src/capabilities/app-graph-builder/app-graph-builder.ts +119 -0
  190. package/src/capabilities/app-graph-builder/index.ts +7 -0
  191. package/src/capabilities/check-app-scheme/check-app-scheme.ts +45 -0
  192. package/src/capabilities/check-app-scheme/index.ts +7 -0
  193. package/src/capabilities/index.ts +9 -14
  194. package/src/capabilities/operation-resolver/index.ts +10 -0
  195. package/src/capabilities/operation-resolver/operation-resolver.ts +558 -0
  196. package/src/capabilities/react-root/index.ts +7 -0
  197. package/src/capabilities/react-root/react-root.tsx +47 -0
  198. package/src/capabilities/react-surface/index.ts +7 -0
  199. package/src/capabilities/react-surface/react-surface.tsx +38 -0
  200. package/src/capabilities/settings/index.ts +7 -0
  201. package/src/capabilities/settings/settings.ts +39 -0
  202. package/src/capabilities/state/index.ts +7 -0
  203. package/src/capabilities/state/state.ts +105 -0
  204. package/src/capabilities/toolkit/index.ts +7 -0
  205. package/src/capabilities/{toolkit.ts → toolkit/toolkit.ts} +20 -22
  206. package/src/capabilities/tools/index.ts +7 -0
  207. package/src/capabilities/tools/tools.ts +91 -0
  208. package/src/capabilities/url-handler/index.ts +7 -0
  209. package/src/capabilities/url-handler/url-handler.ts +98 -0
  210. package/src/components/DeckLayout/ActiveNode.tsx +3 -2
  211. package/src/components/DeckLayout/Banner.tsx +9 -9
  212. package/src/components/DeckLayout/ContentEmpty.tsx +5 -6
  213. package/src/components/DeckLayout/DeckLayout.stories.tsx +21 -31
  214. package/src/components/DeckLayout/DeckLayout.tsx +13 -11
  215. package/src/components/DeckLayout/DeckMain.tsx +64 -58
  216. package/src/components/DeckLayout/Dialog.tsx +22 -13
  217. package/src/components/DeckLayout/Fallback.tsx +2 -6
  218. package/src/components/DeckLayout/Popover.tsx +75 -22
  219. package/src/components/DeckLayout/StatusBar.tsx +4 -4
  220. package/src/components/DeckLayout/Toast.tsx +4 -4
  221. package/src/components/Plank/Plank.stories.tsx +19 -9
  222. package/src/components/Plank/Plank.tsx +46 -38
  223. package/src/components/Plank/PlankControls.tsx +8 -11
  224. package/src/components/Plank/PlankError.tsx +31 -17
  225. package/src/components/Plank/PlankHeading.tsx +39 -47
  226. package/src/components/Plank/PlankLoading.tsx +1 -1
  227. package/src/components/Sidebar/ComplementarySidebar.tsx +57 -51
  228. package/src/components/Sidebar/Sidebar.tsx +7 -7
  229. package/src/components/Sidebar/SidebarButton.tsx +31 -25
  230. package/src/components/fragments.ts +10 -5
  231. package/src/components/index.ts +0 -1
  232. package/src/containers/Banner/Banner.tsx +5 -0
  233. package/src/containers/Banner/index.ts +7 -0
  234. package/src/{components → containers}/DeckSettings/DeckSettings.tsx +41 -31
  235. package/src/containers/DeckSettings/index.ts +7 -0
  236. package/src/containers/index.ts +8 -0
  237. package/src/hooks/index.ts +2 -0
  238. package/src/hooks/useCompanions.ts +2 -2
  239. package/src/hooks/useDeckCompanions.ts +7 -11
  240. package/src/hooks/useDeckState.ts +82 -0
  241. package/src/hooks/useHoistStatusbar.ts +3 -6
  242. package/src/hooks/useMainSize.ts +2 -2
  243. package/src/hooks/useNodeActionExpander.ts +4 -4
  244. package/src/hooks/useSelectedCompanion.ts +32 -0
  245. package/src/index.ts +1 -2
  246. package/src/layout.ts +1 -14
  247. package/src/meta.ts +3 -3
  248. package/src/translations.ts +1 -0
  249. package/src/types/capabilities.ts +33 -0
  250. package/src/types/events.ts +21 -0
  251. package/src/types/index.ts +2 -0
  252. package/src/types/schema.ts +96 -25
  253. package/src/util/layoutAppliesTopbar.ts +1 -1
  254. package/src/util/overscroll.ts +3 -3
  255. package/src/util/set-active.ts +49 -29
  256. package/dist/lib/browser/app-graph-builder-D74NTOMK.mjs +0 -128
  257. package/dist/lib/browser/app-graph-builder-D74NTOMK.mjs.map +0 -7
  258. package/dist/lib/browser/check-app-scheme-HIEVFAAX.mjs +0 -32
  259. package/dist/lib/browser/check-app-scheme-HIEVFAAX.mjs.map +0 -7
  260. package/dist/lib/browser/chunk-5KMJPIQC.mjs +0 -16
  261. package/dist/lib/browser/chunk-5KMJPIQC.mjs.map +0 -7
  262. package/dist/lib/browser/chunk-CNTGBCMK.mjs +0 -145
  263. package/dist/lib/browser/chunk-CNTGBCMK.mjs.map +0 -7
  264. package/dist/lib/browser/chunk-F3VCCHVL.mjs +0 -162
  265. package/dist/lib/browser/chunk-F3VCCHVL.mjs.map +0 -7
  266. package/dist/lib/browser/chunk-QKCGZ45E.mjs +0 -128
  267. package/dist/lib/browser/chunk-QKCGZ45E.mjs.map +0 -7
  268. package/dist/lib/browser/chunk-UXLU6CMW.mjs.map +0 -7
  269. package/dist/lib/browser/chunk-VBYJ664A.mjs +0 -132
  270. package/dist/lib/browser/chunk-VBYJ664A.mjs.map +0 -7
  271. package/dist/lib/browser/chunk-VUJ6UNIJ.mjs +0 -1553
  272. package/dist/lib/browser/chunk-VUJ6UNIJ.mjs.map +0 -7
  273. package/dist/lib/browser/intent-resolver-UA4YQGAC.mjs +0 -524
  274. package/dist/lib/browser/intent-resolver-UA4YQGAC.mjs.map +0 -7
  275. package/dist/lib/browser/react-root-JAMHKYWN.mjs +0 -44
  276. package/dist/lib/browser/react-root-JAMHKYWN.mjs.map +0 -7
  277. package/dist/lib/browser/react-surface-6LW337ZT.mjs +0 -40
  278. package/dist/lib/browser/react-surface-6LW337ZT.mjs.map +0 -7
  279. package/dist/lib/browser/settings-SDPTOCCM.mjs +0 -30
  280. package/dist/lib/browser/settings-SDPTOCCM.mjs.map +0 -7
  281. package/dist/lib/browser/state-7IFAGZQO.mjs +0 -12
  282. package/dist/lib/browser/toolkit-L5CFXJCF.mjs +0 -52
  283. package/dist/lib/browser/toolkit-L5CFXJCF.mjs.map +0 -7
  284. package/dist/lib/browser/url-handler-QEYGYE2H.mjs +0 -70
  285. package/dist/lib/browser/url-handler-QEYGYE2H.mjs.map +0 -7
  286. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  287. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  288. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  289. package/dist/types/src/capabilities/check-app-scheme.d.ts +0 -4
  290. package/dist/types/src/capabilities/check-app-scheme.d.ts.map +0 -1
  291. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  292. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  293. package/dist/types/src/capabilities/react-root.d.ts +0 -7
  294. package/dist/types/src/capabilities/react-root.d.ts.map +0 -1
  295. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  296. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  297. package/dist/types/src/capabilities/settings.d.ts +0 -4
  298. package/dist/types/src/capabilities/settings.d.ts.map +0 -1
  299. package/dist/types/src/capabilities/state.d.ts +0 -104
  300. package/dist/types/src/capabilities/state.d.ts.map +0 -1
  301. package/dist/types/src/capabilities/toolkit.d.ts.map +0 -1
  302. package/dist/types/src/capabilities/tools.d.ts +0 -11
  303. package/dist/types/src/capabilities/tools.d.ts.map +0 -1
  304. package/dist/types/src/capabilities/url-handler.d.ts +0 -4
  305. package/dist/types/src/capabilities/url-handler.d.ts.map +0 -1
  306. package/dist/types/src/components/DeckSettings/DeckSettings.d.ts +0 -6
  307. package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +0 -1
  308. package/dist/types/src/components/DeckSettings/index.d.ts +0 -2
  309. package/dist/types/src/components/DeckSettings/index.d.ts.map +0 -1
  310. package/dist/types/src/events.d.ts +0 -4
  311. package/dist/types/src/events.d.ts.map +0 -1
  312. package/src/capabilities/app-graph-builder.ts +0 -143
  313. package/src/capabilities/capabilities.ts +0 -14
  314. package/src/capabilities/check-app-scheme.ts +0 -40
  315. package/src/capabilities/intent-resolver.ts +0 -471
  316. package/src/capabilities/react-root.tsx +0 -40
  317. package/src/capabilities/react-surface.tsx +0 -30
  318. package/src/capabilities/settings.ts +0 -27
  319. package/src/capabilities/state.ts +0 -113
  320. package/src/capabilities/tools.ts +0 -84
  321. package/src/capabilities/url-handler.ts +0 -60
  322. package/src/components/DeckSettings/index.ts +0 -5
  323. package/src/events.ts +0 -11
  324. /package/dist/lib/{browser/state-7IFAGZQO.mjs.map → node-esm/types/index.mjs.map} +0 -0
@@ -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 { Capabilities } from '@dxos/app-framework';
9
+ import { useCapability } from '@dxos/app-framework/ui';
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(Capabilities.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/ui';
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 (
@@ -7,7 +7,7 @@ import { useMainContext } from '@dxos/react-ui';
7
7
  export const useMainSize = () => {
8
8
  const { navigationSidebarState, complementarySidebarState } = useMainContext('DeckPluginPlank');
9
9
  return {
10
- 'data-sidebar-inline-start-state': navigationSidebarState,
11
- 'data-sidebar-inline-end-state': complementarySidebarState,
10
+ 'data-sidebar-left-state': navigationSidebarState,
11
+ 'data-sidebar-right-state': complementarySidebarState,
12
12
  };
13
13
  };
@@ -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, 'action');
15
15
  });
16
16
  return () => cancelAnimationFrame(frame);
17
17
  }
@@ -0,0 +1,32 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import { useMemo } from 'react';
6
+
7
+ import { getCompanionVariant } from '@dxos/app-toolkit';
8
+ import { type Node } from '@dxos/plugin-graph';
9
+
10
+ /**
11
+ * Resolves which companion to show based on variant preference.
12
+ * Falls back to first available if preferred variant not found.
13
+ */
14
+ export const useSelectedCompanion = (companions: Node.Node[], preferredVariant?: string) => {
15
+ return useMemo(() => {
16
+ if (companions.length === 0) {
17
+ return { companionId: undefined, variant: undefined };
18
+ }
19
+
20
+ // Try to find companion matching the preferred variant.
21
+ if (preferredVariant) {
22
+ const preferred = companions.find((companion) => getCompanionVariant(companion.id) === preferredVariant);
23
+ if (preferred) {
24
+ return { companionId: preferred.id, variant: getCompanionVariant(preferred.id) };
25
+ }
26
+ }
27
+
28
+ // Fallback to first companion.
29
+ const first = companions[0];
30
+ return { companionId: first.id, variant: getCompanionVariant(first.id) };
31
+ }, [companions, preferredVariant]);
32
+ };
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/layout.ts CHANGED
@@ -4,29 +4,16 @@
4
4
 
5
5
  import { produce } from 'immer';
6
6
 
7
- import { ATTENDABLE_PATH_SEPARATOR } from '@dxos/react-ui-attention';
8
-
9
7
  import { type DeckAction, type NewPlankPositioning } from './types';
10
8
 
11
- export const createEntryId = (entryId: string, variant?: string) =>
12
- variant ? `${entryId}${ATTENDABLE_PATH_SEPARATOR}${variant}` : entryId;
13
-
14
- export const parseEntryId = (entryId: string) => {
15
- const [id, variant] = entryId.split(ATTENDABLE_PATH_SEPARATOR);
16
- return { id, variant };
17
- };
18
-
19
9
  type OpenLayoutEntryOptions = {
20
10
  key?: string;
21
11
  positioning?: NewPlankPositioning;
22
12
  pivotId?: string;
23
- variant?: string;
24
13
  };
25
14
 
26
- export const openEntry = (deck: string[], _entryId: string, options?: OpenLayoutEntryOptions): string[] => {
15
+ export const openEntry = (deck: string[], entryId: string, options?: OpenLayoutEntryOptions): string[] => {
27
16
  return produce(deck, (draft) => {
28
- const entryId = createEntryId(_entryId, options?.variant);
29
-
30
17
  // Check that the entry is not already in the part
31
18
  if (draft.find((id) => id === entryId)) {
32
19
  return;
package/src/meta.ts CHANGED
@@ -2,11 +2,11 @@
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 = {
9
- id: 'dxos.org/plugin/deck',
8
+ export const meta: Plugin.Meta = {
9
+ id: 'org.dxos.plugin.deck',
10
10
  name: 'Layout',
11
11
  description: trim`
12
12
  Flexible layout system for arranging workspace views in tabs, splits, and panels.
@@ -64,6 +64,7 @@ export const translations = [
64
64
  'close others label': 'Close other planks',
65
65
  'close all label': 'Close all planks',
66
66
  'companion plank heading fallback label': 'Related',
67
+ 'open item label': 'Open',
67
68
  },
68
69
  },
69
70
  },
@@ -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 { Capabilities, Capability } 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* Capabilities.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,21 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { type ActivationEvent } from '@dxos/app-framework';
6
+ import { AppActivationEvents } from '@dxos/app-toolkit';
7
+
8
+ import { meta } from '../meta';
9
+
10
+ import { DeckCapabilities } from './capabilities';
11
+
12
+ export namespace DeckEvents {
13
+ export const StateReady: ActivationEvent.ActivationEvent = AppActivationEvents.createStateEvent(
14
+ `${meta.id}.state-ready`,
15
+ );
16
+
17
+ /** Fired when DeckSettings capability is ready. */
18
+ export const SettingsReady: ActivationEvent.ActivationEvent = AppActivationEvents.createSettingsEvent(
19
+ DeckCapabilities.Settings.identifier,
20
+ );
21
+ }
@@ -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';
@@ -4,22 +4,22 @@
4
4
 
5
5
  import * as Schema from 'effect/Schema';
6
6
 
7
- import { LayoutAction } from '@dxos/app-framework';
7
+ import { Capability } from '@dxos/app-framework';
8
+ import { Label, LayoutOperation } from '@dxos/app-toolkit';
9
+ import { Operation } from '@dxos/operation';
8
10
  import { type DeepReadonly } from '@dxos/util';
9
11
 
10
12
  import { meta } from '../meta';
11
13
 
12
- export { ATTENDABLE_PATH_SEPARATOR } from '@dxos/react-ui-attention';
13
-
14
- export const PLANK_COMPANION_TYPE = `${meta.id}/plank-companion`;
15
- export const DECK_COMPANION_TYPE = `${meta.id}/deck-companion`;
14
+ export const PLANK_COMPANION_TYPE = `${meta.id}.plank-companion`;
15
+ export const DECK_COMPANION_TYPE = `${meta.id}.deck-companion`;
16
16
 
17
17
  // TODO(Zan): In the future we should consider adding new planks adjacent to the attended plank.
18
18
  export const NewPlankPositions = ['start', 'end'] as const;
19
19
  export type NewPlankPositioning = (typeof NewPlankPositions)[number];
20
20
 
21
- export const OverscrollOptions = ['none', 'centering'] as const;
22
- export type Overscroll = (typeof OverscrollOptions)[number];
21
+ export const OverScrollToProps = ['none', 'centering'] as const;
22
+ export type Overscroll = (typeof OverScrollToProps)[number];
23
23
 
24
24
  export type Part = 'solo' | 'deck' | 'complementary';
25
25
  export type ResolvedPart = Part | 'solo-primary' | 'solo-companion';
@@ -30,7 +30,7 @@ export const DeckSettingsSchema = Schema.Struct({
30
30
  enableStatusbar: Schema.optional(Schema.Boolean),
31
31
  enableNativeRedirect: Schema.optional(Schema.Boolean),
32
32
  newPlankPositioning: Schema.optional(Schema.Literal(...NewPlankPositions)),
33
- overscroll: Schema.optional(Schema.Literal(...OverscrollOptions)),
33
+ overscroll: Schema.optional(Schema.Literal(...OverScrollToProps)),
34
34
  // TODO(burdon): Rename layoutMode? (e.g., bento | encapsulated?)
35
35
  encapsulatedPlanks: Schema.optional(Schema.Boolean),
36
36
  }).pipe(Schema.mutable);
@@ -44,8 +44,8 @@ export const DeckState = Schema.Struct({
44
44
  /** If false, the deck has not yet left solo mode and new planks should be soloed. */
45
45
  initialized: Schema.Boolean,
46
46
  active: Schema.mutable(Schema.Array(Schema.String)),
47
- // TODO(wittjosiah): Piping into both mutable and optional caused invalid typescript output.
48
- activeCompanions: Schema.optional(Schema.mutable(Schema.Record({ key: Schema.String, value: Schema.String }))),
47
+ companionOpen: Schema.Boolean,
48
+ companionVariant: Schema.optional(Schema.String),
49
49
  inactive: Schema.mutable(Schema.Array(Schema.String)),
50
50
  solo: Schema.optional(Schema.String),
51
51
  fullscreen: Schema.Boolean,
@@ -57,7 +57,8 @@ export type DeckState = Schema.Schema.Type<typeof DeckState>;
57
57
  export const defaultDeck: DeckState = {
58
58
  initialized: false,
59
59
  active: [],
60
- activeCompanions: {},
60
+ companionOpen: false,
61
+ companionVariant: undefined,
61
62
  inactive: [],
62
63
  solo: undefined,
63
64
  fullscreen: false,
@@ -77,12 +78,21 @@ export const getMode = (deck: DeckState | DeepReadonly<DeckState>): LayoutMode =
77
78
  return 'deck';
78
79
  };
79
80
 
80
- // State of the deck plugin.
81
- export const DeckPluginState = Schema.Struct({
81
+ // Persisted plugin state (stored in KVS/localStorage).
82
+ export const DeckStateSchema = Schema.Struct({
82
83
  sidebarState: Schema.Literal('closed', 'collapsed', 'expanded'),
83
84
  complementarySidebarState: Schema.Literal('closed', 'collapsed', 'expanded'),
84
85
  complementarySidebarPanel: Schema.optional(Schema.String),
86
+ activeDeck: Schema.String,
87
+ previousDeck: Schema.String,
88
+ decks: Schema.mutable(Schema.Record({ key: Schema.String, value: Schema.mutable(DeckState) })),
89
+ previousMode: Schema.mutable(Schema.Record({ key: Schema.String, value: LayoutMode })),
90
+ }).pipe(Schema.mutable);
91
+ export type DeckStateProps = Schema.Schema.Type<typeof DeckStateSchema>;
85
92
 
93
+ // TODO(burdon): Factor out state (in common with other layouts?)
94
+ // Transient/ephemeral plugin state (not persisted).
95
+ export const DeckEphemeralStateSchema = Schema.Struct({
86
96
  dialogOpen: Schema.Boolean,
87
97
  dialogType: Schema.optional(Schema.Literal('default', 'alert')),
88
98
  dialogBlockAlign: Schema.optional(Schema.Literal('start', 'center', 'end')),
@@ -95,23 +105,23 @@ export const DeckPluginState = Schema.Struct({
95
105
  popoverSide: Schema.optional(Schema.Literal('top', 'right', 'bottom', 'left')),
96
106
  popoverAnchor: Schema.optional(Schema.Any),
97
107
  popoverAnchorId: Schema.optional(Schema.String),
108
+ popoverKind: Schema.optional(Schema.Literal('base', 'card')),
109
+ popoverTitle: Schema.optional(Label.annotations({ description: 'The title of the popover.' })),
110
+ /** Ref of the subject to be passed to the popover Surface. */
111
+ popoverContentRef: Schema.optional(Schema.String),
98
112
  /** Data to be passed to the popover Surface. */
99
113
  popoverContent: Schema.optional(Schema.Any),
100
114
 
101
- toasts: Schema.mutable(Schema.Array(LayoutAction.Toast)),
115
+ toasts: Schema.mutable(Schema.Array(LayoutOperation.Toast)),
102
116
  currentUndoId: Schema.optional(Schema.String),
103
117
 
104
- activeDeck: Schema.String,
105
- previousDeck: Schema.String,
106
- decks: Schema.mutable(Schema.Record({ key: Schema.String, value: Schema.mutable(DeckState) })),
107
- previousMode: Schema.mutable(Schema.Record({ key: Schema.String, value: LayoutMode })),
108
- deck: Schema.mutable(DeckState),
109
-
110
118
  /** The identifier of a component to scroll into view when it is mounted. */
111
119
  scrollIntoView: Schema.optional(Schema.String),
112
120
  }).pipe(Schema.mutable);
121
+ export type DeckEphemeralStateProps = Schema.Schema.Type<typeof DeckEphemeralStateSchema>;
113
122
 
114
- export type DeckPluginState = Schema.Schema.Type<typeof DeckPluginState>;
123
+ // Combined state type (for convenience in components that need both).
124
+ export type DeckPluginState = DeckStateProps & DeckEphemeralStateProps;
115
125
 
116
126
  export namespace DeckAction {
117
127
  const PartAdjustmentSchema = Schema.Union(
@@ -127,12 +137,12 @@ export namespace DeckAction {
127
137
  export type Adjustment = Schema.Schema.Type<typeof Adjustment>;
128
138
 
129
139
  // An atomic transaction to apply to the deck, describing which element to move to which location.
130
- export class Adjust extends Schema.TaggedClass<Adjust>()(`${meta.id}/action/adjust`, {
140
+ export class Adjust extends Schema.TaggedClass<Adjust>()(`${meta.id}.action.adjust`, {
131
141
  input: Adjustment,
132
142
  output: Schema.Void,
133
143
  }) {}
134
144
 
135
- export class UpdatePlankSize extends Schema.TaggedClass<UpdatePlankSize>()(`${meta.id}/action/update-plank-size`, {
145
+ export class UpdatePlankSize extends Schema.TaggedClass<UpdatePlankSize>()(`${meta.id}.action.update-plank-size`, {
136
146
  input: Schema.Struct({
137
147
  id: Schema.String,
138
148
  size: Schema.Number,
@@ -140,11 +150,72 @@ export namespace DeckAction {
140
150
  output: Schema.Void,
141
151
  }) {}
142
152
 
143
- export class ChangeCompanion extends Schema.TaggedClass<ChangeCompanion>()(`${meta.id}/action/change-companion`, {
153
+ export class ChangeCompanion extends Schema.TaggedClass<ChangeCompanion>()(`${meta.id}.action.change-companion`, {
144
154
  input: Schema.Struct({
145
- primary: Schema.String,
146
155
  companion: Schema.Union(Schema.String, Schema.Null),
147
156
  }),
148
157
  output: Schema.Void,
149
158
  }) {}
150
159
  }
160
+
161
+ /**
162
+ * Operations for the Deck plugin.
163
+ */
164
+ export namespace DeckOperation {
165
+ const PartAdjustmentSchema = Schema.Union(
166
+ Schema.Literal('close').annotations({ description: 'Close the plank.' }),
167
+ Schema.Literal('companion').annotations({ description: 'Open the companion plank.' }),
168
+ Schema.Literal('solo').annotations({ description: 'Solo the plank.' }),
169
+ Schema.Literal('solo--fullscreen').annotations({ description: 'Fullscreen the plank.' }),
170
+ Schema.Literal('increment-start').annotations({ description: 'Move the plank towards the start of the deck.' }),
171
+ Schema.Literal('increment-end').annotations({ description: 'Move the plank towards the end of the deck.' }),
172
+ );
173
+ export type PartAdjustment = Schema.Schema.Type<typeof PartAdjustmentSchema>;
174
+
175
+ export const Adjust = Operation.make({
176
+ meta: {
177
+ key: `${meta.id}.operation.adjust`,
178
+ name: 'Adjust',
179
+ description: 'Adjust the layout of a plank.',
180
+ },
181
+ services: [Capability.Service],
182
+ schema: {
183
+ input: Schema.Struct({
184
+ id: Schema.String.annotations({ description: 'The id of the plank to adjust.' }),
185
+ type: PartAdjustmentSchema.annotations({ description: 'The type of adjustment to make.' }),
186
+ }),
187
+ output: Schema.Void,
188
+ },
189
+ });
190
+
191
+ export const UpdatePlankSize = Operation.make({
192
+ meta: {
193
+ key: `${meta.id}.operation.update-plank-size`,
194
+ name: 'Update Plank Size',
195
+ description: 'Update the size of a plank.',
196
+ },
197
+ services: [Capability.Service],
198
+ schema: {
199
+ input: Schema.Struct({
200
+ id: Schema.String.annotations({ description: 'The id of the plank to resize.' }),
201
+ size: Schema.Number.annotations({ description: 'The new size of the plank.' }),
202
+ }),
203
+ output: Schema.Void,
204
+ },
205
+ });
206
+
207
+ export const ChangeCompanion = Operation.make({
208
+ meta: {
209
+ key: `${meta.id}.operation.change-companion`,
210
+ name: 'Change Companion',
211
+ description: 'Change the companion plank for a primary plank.',
212
+ },
213
+ services: [Capability.Service],
214
+ schema: {
215
+ input: Schema.Struct({
216
+ companion: Schema.Union(Schema.String, Schema.Null),
217
+ }),
218
+ output: Schema.Void,
219
+ },
220
+ });
221
+ }
@@ -6,7 +6,7 @@ import { type LayoutMode } from '../types';
6
6
 
7
7
  export const layoutAppliesTopbar = (breakpoint: string, layoutMode?: LayoutMode) => {
8
8
  return (
9
- document.body.getAttribute('data-platform') === 'win' &&
9
+ document.body.getAttribute('data-platform') === 'windows' &&
10
10
  breakpoint === 'desktop' &&
11
11
  layoutMode !== 'solo--fullscreen'
12
12
  );
@@ -56,14 +56,14 @@ export const calculateOverscroll = (
56
56
  }
57
57
  if (planksCount === 1) {
58
58
  const overscrollPadding =
59
- 'max(0px, calc(((100dvw - var(--dx-main-sidebarWidth) - var(--dx-main-complementaryWidth) - (var(--dx-main-contentFirstWidth) + 1px)) / 2)))';
59
+ 'max(0px, calc(((100dvw - var(--dx-main-sidebar-width) - var(--dx-main-complementary-width) - (var(--dx-main-content-first-width) + 1px)) / 2)))';
60
60
  return { paddingInlineStart: overscrollPadding, paddingInlineEnd: overscrollPadding };
61
61
  } else {
62
62
  return {
63
63
  paddingInlineStart:
64
- 'max(0px, calc(((100dvw - (var(--dx-main-contentFirstWidth) + 1px)) / 2) - var(--dx-main-sidebarWidth)))',
64
+ 'max(0px, calc(((100dvw - (var(--dx-main-content-first-width) + 1px)) / 2) - var(--dx-main-sidebar-width)))',
65
65
  paddingInlineEnd:
66
- 'max(0px, calc(((100dvw - (var(--dx-main-contentLastWidth) + 1px)) / 2) - var(--dx-main-complementaryWidth)))',
66
+ 'max(0px, calc(((100dvw - (var(--dx-main-content-last-width) + 1px)) / 2) - var(--dx-main-complementary-width)))',
67
67
  };
68
68
  }
69
69
  };
@@ -2,46 +2,66 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { batch } from '@preact/signals-core';
6
-
7
5
  import { type AttentionManager } from '@dxos/plugin-attention';
8
6
 
9
- import { type DeckPluginState } from '../types';
7
+ import { type DeckState } from '../types';
10
8
 
11
9
  export type SetActiveOptions = {
12
10
  next: string[];
13
- state: DeckPluginState;
11
+ deck: DeckState;
14
12
  attention?: AttentionManager;
15
13
  };
16
14
 
17
- export const setActive = ({ next, state, attention }: SetActiveOptions) => {
18
- return batch(() => {
19
- const active = state.deck.solo ? [state.deck.solo] : state.deck.active;
20
- const removed = active.filter((id) => !next.includes(id));
21
- const closed = Array.from(new Set([...state.deck.inactive.filter((id) => !next.includes(id)), ...removed]));
15
+ export type SetActiveResult = {
16
+ /** Updates to apply to the deck. */
17
+ deckUpdates: {
18
+ inactive: string[];
19
+ solo: string | undefined;
20
+ active: string[];
21
+ fullscreen: boolean;
22
+ };
23
+ /** ID of the item to attend (scroll into view) if attention changed. */
24
+ toAttend?: string;
25
+ };
22
26
 
23
- state.deck.inactive = closed;
27
+ /**
28
+ * Computes the new active state for the deck without mutating.
29
+ * Returns the updates to apply and optionally an item to attend.
30
+ */
31
+ export const computeActiveUpdates = ({ next, deck, attention }: SetActiveOptions): SetActiveResult => {
32
+ const active = deck.solo ? [deck.solo] : deck.active;
33
+ const removed = active.filter((id) => !next.includes(id));
34
+ const closed = Array.from(new Set([...deck.inactive.filter((id) => !next.includes(id)), ...removed]));
24
35
 
25
- if (state.deck.solo || !state.deck.initialized) {
26
- state.deck.solo = next[0];
27
- } else {
28
- state.deck.active = next;
29
- }
36
+ const updates = {
37
+ inactive: closed,
38
+ solo: deck.solo,
39
+ active: deck.active,
40
+ fullscreen: deck.fullscreen,
41
+ };
30
42
 
31
- if (state.deck.fullscreen && !state.deck.solo) {
32
- state.deck.fullscreen = false;
33
- }
43
+ if (deck.solo || !deck.initialized) {
44
+ updates.solo = next[0];
45
+ } else {
46
+ updates.active = next;
47
+ }
48
+
49
+ if (deck.fullscreen && !updates.solo) {
50
+ updates.fullscreen = false;
51
+ }
34
52
 
35
- if (attention) {
36
- const attended = attention.current;
37
- const [attendedId] = Array.from(attended);
38
- const isAttendedAvailable = !!attendedId && next.includes(attendedId);
39
- if (!isAttendedAvailable) {
40
- const attendedIndex = active.indexOf(attendedId);
41
- // If outside of bounds, focus on the first/last plank, otherwise focus on the new plank in the same position.
42
- const index = attendedIndex === -1 ? 0 : attendedIndex >= next.length ? next.length - 1 : attendedIndex;
43
- return next[index];
44
- }
53
+ let toAttend: string | undefined;
54
+ if (attention) {
55
+ const attended = attention.getCurrent();
56
+ const [attendedId] = Array.from(attended);
57
+ const isAttendedAvailable = !!attendedId && next.includes(attendedId);
58
+ if (!isAttendedAvailable) {
59
+ const attendedIndex = active.indexOf(attendedId);
60
+ // If outside of bounds, focus on the first/last plank, otherwise focus on the new plank in the same position.
61
+ const index = attendedIndex === -1 ? 0 : attendedIndex >= next.length ? next.length - 1 : attendedIndex;
62
+ toAttend = next[index];
45
63
  }
46
- });
64
+ }
65
+
66
+ return { deckUpdates: updates, toAttend };
47
67
  };