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

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 (523) hide show
  1. package/dist/lib/browser/add-toast-QUWRKFDD.mjs +24 -0
  2. package/dist/lib/browser/add-toast-QUWRKFDD.mjs.map +7 -0
  3. package/dist/lib/browser/adjust-J6F24WWJ.mjs +96 -0
  4. package/dist/lib/browser/adjust-J6F24WWJ.mjs.map +7 -0
  5. package/dist/lib/browser/change-companion-EZI57WDZ.mjs +34 -0
  6. package/dist/lib/browser/change-companion-EZI57WDZ.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-2YNVGCOQ.mjs +88 -0
  8. package/dist/lib/browser/chunk-2YNVGCOQ.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-AYFQHPPP.mjs +69 -0
  10. package/dist/lib/browser/chunk-AYFQHPPP.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-GCDWE37Y.mjs +220 -0
  12. package/dist/lib/browser/chunk-GCDWE37Y.mjs.map +7 -0
  13. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  14. package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
  15. package/dist/lib/browser/chunk-KUTDCWZF.mjs +30 -0
  16. package/dist/lib/browser/chunk-KUTDCWZF.mjs.map +7 -0
  17. package/dist/lib/browser/chunk-OHKLENIG.mjs +45 -0
  18. package/dist/lib/browser/chunk-OHKLENIG.mjs.map +7 -0
  19. package/dist/lib/browser/close-6RB62DEY.mjs +44 -0
  20. package/dist/lib/browser/close-6RB62DEY.mjs.map +7 -0
  21. package/dist/lib/browser/index.mjs +161 -126
  22. package/dist/lib/browser/index.mjs.map +4 -4
  23. package/dist/lib/browser/meta.json +1 -1
  24. package/dist/lib/browser/open-YL3JKXGK.mjs +115 -0
  25. package/dist/lib/browser/open-YL3JKXGK.mjs.map +7 -0
  26. package/dist/lib/browser/operations/index.mjs +13 -0
  27. package/dist/lib/browser/operations/index.mjs.map +7 -0
  28. package/dist/lib/browser/revert-workspace-JC66YMWB.mjs +21 -0
  29. package/dist/lib/browser/revert-workspace-JC66YMWB.mjs.map +7 -0
  30. package/dist/lib/browser/scroll-into-view-QSSFZ3KD.mjs +21 -0
  31. package/dist/lib/browser/scroll-into-view-QSSFZ3KD.mjs.map +7 -0
  32. package/dist/lib/browser/set-LPAGXY3F.mjs +37 -0
  33. package/dist/lib/browser/set-LPAGXY3F.mjs.map +7 -0
  34. package/dist/lib/browser/set-layout-mode-XZ4VHS2X.mjs +90 -0
  35. package/dist/lib/browser/set-layout-mode-XZ4VHS2X.mjs.map +7 -0
  36. package/dist/lib/browser/show-undo-IWX4S777.mjs +59 -0
  37. package/dist/lib/browser/show-undo-IWX4S777.mjs.map +7 -0
  38. package/dist/lib/browser/switch-workspace-5RKQ2LVK.mjs +68 -0
  39. package/dist/lib/browser/switch-workspace-5RKQ2LVK.mjs.map +7 -0
  40. package/dist/lib/browser/types/index.mjs +8 -15
  41. package/dist/lib/browser/update-complementary-QIIZWLGY.mjs +28 -0
  42. package/dist/lib/browser/update-complementary-QIIZWLGY.mjs.map +7 -0
  43. package/dist/lib/browser/update-dialog-5IKCWFPW.mjs +29 -0
  44. package/dist/lib/browser/update-dialog-5IKCWFPW.mjs.map +7 -0
  45. package/dist/lib/browser/update-plank-size-YDM67P65.mjs +28 -0
  46. package/dist/lib/browser/update-plank-size-YDM67P65.mjs.map +7 -0
  47. package/dist/lib/browser/update-popover-AUVAWH3D.mjs +33 -0
  48. package/dist/lib/browser/update-popover-AUVAWH3D.mjs.map +7 -0
  49. package/dist/lib/browser/update-sidebar-BT3L5GJN.mjs +25 -0
  50. package/dist/lib/browser/update-sidebar-BT3L5GJN.mjs.map +7 -0
  51. package/dist/lib/node-esm/add-toast-MR53ZMTS.mjs +25 -0
  52. package/dist/lib/node-esm/add-toast-MR53ZMTS.mjs.map +7 -0
  53. package/dist/lib/node-esm/adjust-IXRBIVAO.mjs +97 -0
  54. package/dist/lib/node-esm/adjust-IXRBIVAO.mjs.map +7 -0
  55. package/dist/lib/node-esm/change-companion-RLMI5EYL.mjs +35 -0
  56. package/dist/lib/node-esm/change-companion-RLMI5EYL.mjs.map +7 -0
  57. package/dist/lib/node-esm/chunk-7BNWWWAF.mjs +221 -0
  58. package/dist/lib/node-esm/chunk-7BNWWWAF.mjs.map +7 -0
  59. package/dist/lib/node-esm/chunk-C2AWKR2S.mjs +71 -0
  60. package/dist/lib/node-esm/chunk-C2AWKR2S.mjs.map +7 -0
  61. package/dist/lib/node-esm/chunk-GI5JXNBT.mjs +89 -0
  62. package/dist/lib/node-esm/chunk-GI5JXNBT.mjs.map +7 -0
  63. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  64. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
  65. package/dist/lib/node-esm/chunk-MLVJ2ODW.mjs +32 -0
  66. package/dist/lib/node-esm/chunk-MLVJ2ODW.mjs.map +7 -0
  67. package/dist/lib/node-esm/chunk-TFFZ7NWH.mjs +47 -0
  68. package/dist/lib/node-esm/chunk-TFFZ7NWH.mjs.map +7 -0
  69. package/dist/lib/node-esm/close-UD7KBYZP.mjs +45 -0
  70. package/dist/lib/node-esm/close-UD7KBYZP.mjs.map +7 -0
  71. package/dist/lib/node-esm/index.mjs +161 -126
  72. package/dist/lib/node-esm/index.mjs.map +4 -4
  73. package/dist/lib/node-esm/meta.json +1 -1
  74. package/dist/lib/node-esm/open-XZ7YGVPZ.mjs +116 -0
  75. package/dist/lib/node-esm/open-XZ7YGVPZ.mjs.map +7 -0
  76. package/dist/lib/node-esm/operations/index.mjs +14 -0
  77. package/dist/lib/node-esm/operations/index.mjs.map +7 -0
  78. package/dist/lib/node-esm/revert-workspace-F3FUP4ZL.mjs +22 -0
  79. package/dist/lib/node-esm/revert-workspace-F3FUP4ZL.mjs.map +7 -0
  80. package/dist/lib/node-esm/scroll-into-view-24TF2WYQ.mjs +22 -0
  81. package/dist/lib/node-esm/scroll-into-view-24TF2WYQ.mjs.map +7 -0
  82. package/dist/lib/node-esm/set-F2QWLSJR.mjs +38 -0
  83. package/dist/lib/node-esm/set-F2QWLSJR.mjs.map +7 -0
  84. package/dist/lib/node-esm/set-layout-mode-Z54OX33H.mjs +91 -0
  85. package/dist/lib/node-esm/set-layout-mode-Z54OX33H.mjs.map +7 -0
  86. package/dist/lib/node-esm/show-undo-B2XVCKGX.mjs +60 -0
  87. package/dist/lib/node-esm/show-undo-B2XVCKGX.mjs.map +7 -0
  88. package/dist/lib/node-esm/switch-workspace-PM57REEV.mjs +69 -0
  89. package/dist/lib/node-esm/switch-workspace-PM57REEV.mjs.map +7 -0
  90. package/dist/lib/node-esm/types/index.mjs +8 -15
  91. package/dist/lib/node-esm/update-complementary-26H5UYJP.mjs +29 -0
  92. package/dist/lib/node-esm/update-complementary-26H5UYJP.mjs.map +7 -0
  93. package/dist/lib/node-esm/update-dialog-EYP3QNFG.mjs +30 -0
  94. package/dist/lib/node-esm/update-dialog-EYP3QNFG.mjs.map +7 -0
  95. package/dist/lib/node-esm/update-plank-size-LLFUB57G.mjs +29 -0
  96. package/dist/lib/node-esm/update-plank-size-LLFUB57G.mjs.map +7 -0
  97. package/dist/lib/node-esm/update-popover-G55PS7T4.mjs +34 -0
  98. package/dist/lib/node-esm/update-popover-G55PS7T4.mjs.map +7 -0
  99. package/dist/lib/node-esm/update-sidebar-W4ND5MUL.mjs +26 -0
  100. package/dist/lib/node-esm/update-sidebar-W4ND5MUL.mjs.map +7 -0
  101. package/dist/types/src/DeckPlugin.d.ts.map +1 -1
  102. package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
  103. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  104. package/dist/types/src/capabilities/check-app-scheme.d.ts +19 -0
  105. package/dist/types/src/capabilities/check-app-scheme.d.ts.map +1 -0
  106. package/dist/types/src/capabilities/index.d.ts +198 -9
  107. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  108. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  109. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  110. package/dist/types/src/capabilities/{react-root/react-root.d.ts → react-root.d.ts} +1 -1
  111. package/dist/types/src/capabilities/react-root.d.ts.map +1 -0
  112. package/dist/types/src/capabilities/react-surface.d.ts +5 -0
  113. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  114. package/dist/types/src/capabilities/{settings/settings.d.ts → settings.d.ts} +4 -3
  115. package/dist/types/src/capabilities/settings.d.ts.map +1 -0
  116. package/dist/types/src/capabilities/{state/state.d.ts → state.d.ts} +11 -11
  117. package/dist/types/src/capabilities/state.d.ts.map +1 -0
  118. package/dist/types/src/capabilities/{tools/tools.d.ts → tools.d.ts} +2 -2
  119. package/dist/types/src/capabilities/tools.d.ts.map +1 -0
  120. package/dist/types/src/capabilities/url-handler.d.ts +5 -0
  121. package/dist/types/src/capabilities/url-handler.d.ts.map +1 -0
  122. package/dist/types/src/components/DeckSettings/DeckSettings.d.ts +4 -6
  123. package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +1 -1
  124. package/dist/types/src/components/DeckSettings/DeckSettings.stories.d.ts +85 -0
  125. package/dist/types/src/components/DeckSettings/DeckSettings.stories.d.ts.map +1 -0
  126. package/dist/types/src/components/DeckSettings/index.d.ts +2 -1
  127. package/dist/types/src/components/DeckSettings/index.d.ts.map +1 -1
  128. package/dist/types/src/components/Matrix/Matrix.d.ts +49 -0
  129. package/dist/types/src/components/Matrix/Matrix.d.ts.map +1 -0
  130. package/dist/types/src/components/Matrix/Matrix.stories.d.ts +17 -0
  131. package/dist/types/src/components/Matrix/Matrix.stories.d.ts.map +1 -0
  132. package/dist/types/src/components/Matrix/index.d.ts +3 -0
  133. package/dist/types/src/components/Matrix/index.d.ts.map +1 -0
  134. package/dist/types/src/components/index.d.ts +3 -2
  135. package/dist/types/src/components/index.d.ts.map +1 -1
  136. package/dist/types/src/containers/Deck/Banner.d.ts.map +1 -0
  137. package/dist/types/src/containers/Deck/Deck.d.ts +25 -0
  138. package/dist/types/src/containers/Deck/Deck.d.ts.map +1 -0
  139. package/dist/types/src/containers/Deck/Deck.stories.d.ts +85 -0
  140. package/dist/types/src/containers/Deck/Deck.stories.d.ts.map +1 -0
  141. package/dist/types/src/containers/Deck/DeckContent.d.ts +7 -0
  142. package/dist/types/src/containers/Deck/DeckContent.d.ts.map +1 -0
  143. package/dist/types/src/containers/Deck/DeckRoot.d.ts +42 -0
  144. package/dist/types/src/containers/Deck/DeckRoot.d.ts.map +1 -0
  145. package/dist/types/src/containers/Deck/DeckViewport.d.ts +19 -0
  146. package/dist/types/src/containers/Deck/DeckViewport.d.ts.map +1 -0
  147. package/dist/types/src/containers/Deck/StatusBar.d.ts.map +1 -0
  148. package/dist/types/src/containers/Deck/index.d.ts +2 -0
  149. package/dist/types/src/containers/Deck/index.d.ts.map +1 -0
  150. package/dist/types/src/containers/DeckLayout/ActiveNode.d.ts.map +1 -0
  151. package/dist/types/src/containers/DeckLayout/DeckLayout.d.ts.map +1 -0
  152. package/dist/types/src/containers/DeckLayout/DeckLayout.stories.d.ts +87 -0
  153. package/dist/types/src/containers/DeckLayout/DeckLayout.stories.d.ts.map +1 -0
  154. package/dist/types/src/{components → containers}/DeckLayout/Dialog.d.ts.map +1 -1
  155. package/dist/types/src/containers/DeckLayout/Fallback.d.ts +2 -0
  156. package/dist/types/src/containers/DeckLayout/Fallback.d.ts.map +1 -0
  157. package/dist/types/src/containers/DeckLayout/Popover.d.ts +5 -0
  158. package/dist/types/src/containers/DeckLayout/Popover.d.ts.map +1 -0
  159. package/dist/types/src/{components → containers}/DeckLayout/Toast.d.ts +3 -3
  160. package/dist/types/src/containers/DeckLayout/Toast.d.ts.map +1 -0
  161. package/dist/types/src/containers/DeckLayout/constants.d.ts.map +1 -0
  162. package/dist/types/src/containers/DeckLayout/index.d.ts +4 -0
  163. package/dist/types/src/containers/DeckLayout/index.d.ts.map +1 -0
  164. package/dist/types/src/containers/Plank/Plank.d.ts +21 -0
  165. package/dist/types/src/containers/Plank/Plank.d.ts.map +1 -0
  166. package/dist/types/src/containers/Plank/Plank.stories.d.ts +84 -0
  167. package/dist/types/src/containers/Plank/Plank.stories.d.ts.map +1 -0
  168. package/dist/types/src/containers/Plank/PlankComponent.d.ts +15 -0
  169. package/dist/types/src/containers/Plank/PlankComponent.d.ts.map +1 -0
  170. package/dist/types/src/containers/Plank/PlankContent.d.ts +14 -0
  171. package/dist/types/src/containers/Plank/PlankContent.d.ts.map +1 -0
  172. package/dist/types/src/{components → containers}/Plank/PlankControls.d.ts +5 -6
  173. package/dist/types/src/containers/Plank/PlankControls.d.ts.map +1 -0
  174. package/dist/types/src/containers/Plank/PlankError.d.ts +15 -0
  175. package/dist/types/src/containers/Plank/PlankError.d.ts.map +1 -0
  176. package/dist/types/src/{components → containers}/Plank/PlankHeading.d.ts +1 -1
  177. package/dist/types/src/containers/Plank/PlankHeading.d.ts.map +1 -0
  178. package/dist/types/src/{components → containers}/Plank/PlankLoading.d.ts.map +1 -1
  179. package/dist/types/src/containers/Plank/PlankRoot.d.ts +37 -0
  180. package/dist/types/src/containers/Plank/PlankRoot.d.ts.map +1 -0
  181. package/dist/types/src/containers/Plank/index.d.ts +4 -0
  182. package/dist/types/src/containers/Plank/index.d.ts.map +1 -0
  183. package/dist/types/src/containers/Sidebar/ComplementarySidebar.d.ts.map +1 -0
  184. package/dist/types/src/{components → containers}/Sidebar/Sidebar.d.ts.map +1 -1
  185. package/dist/types/src/{components → containers}/Sidebar/SidebarButton.d.ts.map +1 -1
  186. package/dist/types/src/{components → containers}/Sidebar/index.d.ts.map +1 -1
  187. package/dist/types/src/containers/index.d.ts +6 -0
  188. package/dist/types/src/containers/index.d.ts.map +1 -0
  189. package/dist/types/src/hooks/index.d.ts +1 -0
  190. package/dist/types/src/hooks/index.d.ts.map +1 -1
  191. package/dist/types/src/hooks/useDeckCompanions.d.ts +0 -1
  192. package/dist/types/src/hooks/useDeckCompanions.d.ts.map +1 -1
  193. package/dist/types/src/hooks/useDeckState.d.ts +3 -3
  194. package/dist/types/src/hooks/useDeckState.d.ts.map +1 -1
  195. package/dist/types/src/hooks/useHoistStatusbar.d.ts +1 -1
  196. package/dist/types/src/hooks/useHoistStatusbar.d.ts.map +1 -1
  197. package/dist/types/src/hooks/useMainSize.d.ts +2 -2
  198. package/dist/types/src/hooks/useSelectedCompanion.d.ts +13 -0
  199. package/dist/types/src/hooks/useSelectedCompanion.d.ts.map +1 -0
  200. package/dist/types/src/layout.d.ts +3 -9
  201. package/dist/types/src/layout.d.ts.map +1 -1
  202. package/dist/types/src/operations/add-toast.d.ts +5 -0
  203. package/dist/types/src/operations/add-toast.d.ts.map +1 -0
  204. package/dist/types/src/operations/adjust.d.ts +5 -0
  205. package/dist/types/src/operations/adjust.d.ts.map +1 -0
  206. package/dist/types/src/operations/change-companion.d.ts +5 -0
  207. package/dist/types/src/operations/change-companion.d.ts.map +1 -0
  208. package/dist/types/src/operations/close.d.ts +5 -0
  209. package/dist/types/src/operations/close.d.ts.map +1 -0
  210. package/dist/types/src/operations/definitions.d.ts +18 -0
  211. package/dist/types/src/operations/definitions.d.ts.map +1 -0
  212. package/dist/types/src/operations/helpers.d.ts +3 -0
  213. package/dist/types/src/operations/helpers.d.ts.map +1 -0
  214. package/dist/types/src/operations/index.d.ts +4 -0
  215. package/dist/types/src/operations/index.d.ts.map +1 -0
  216. package/dist/types/src/operations/open.d.ts +5 -0
  217. package/dist/types/src/operations/open.d.ts.map +1 -0
  218. package/dist/types/src/operations/revert-workspace.d.ts +5 -0
  219. package/dist/types/src/operations/revert-workspace.d.ts.map +1 -0
  220. package/dist/types/src/operations/scroll-into-view.d.ts +5 -0
  221. package/dist/types/src/operations/scroll-into-view.d.ts.map +1 -0
  222. package/dist/types/src/operations/set-layout-mode.d.ts +9 -0
  223. package/dist/types/src/operations/set-layout-mode.d.ts.map +1 -0
  224. package/dist/types/src/operations/set.d.ts +5 -0
  225. package/dist/types/src/operations/set.d.ts.map +1 -0
  226. package/dist/types/src/operations/show-undo.d.ts +5 -0
  227. package/dist/types/src/operations/show-undo.d.ts.map +1 -0
  228. package/dist/types/src/operations/switch-workspace.d.ts +5 -0
  229. package/dist/types/src/operations/switch-workspace.d.ts.map +1 -0
  230. package/dist/types/src/operations/update-complementary.d.ts +5 -0
  231. package/dist/types/src/operations/update-complementary.d.ts.map +1 -0
  232. package/dist/types/src/operations/update-dialog.d.ts +5 -0
  233. package/dist/types/src/operations/update-dialog.d.ts.map +1 -0
  234. package/dist/types/src/operations/update-plank-size.d.ts +5 -0
  235. package/dist/types/src/operations/update-plank-size.d.ts.map +1 -0
  236. package/dist/types/src/operations/update-popover.d.ts +5 -0
  237. package/dist/types/src/operations/update-popover.d.ts.map +1 -0
  238. package/dist/types/src/operations/update-sidebar.d.ts +5 -0
  239. package/dist/types/src/operations/update-sidebar.d.ts.map +1 -0
  240. package/dist/types/src/testing/DeckLayoutStoryNavigation.d.ts +10 -0
  241. package/dist/types/src/testing/DeckLayoutStoryNavigation.d.ts.map +1 -0
  242. package/dist/types/src/testing/index.d.ts +2 -0
  243. package/dist/types/src/testing/index.d.ts.map +1 -0
  244. package/dist/types/src/translations.d.ts +66 -54
  245. package/dist/types/src/translations.d.ts.map +1 -1
  246. package/dist/types/src/types/Settings.d.ts +16 -0
  247. package/dist/types/src/types/Settings.d.ts.map +1 -0
  248. package/dist/types/src/types/capabilities.d.ts +11 -11
  249. package/dist/types/src/types/capabilities.d.ts.map +1 -1
  250. package/dist/types/src/types/events.d.ts.map +1 -1
  251. package/dist/types/src/types/index.d.ts +1 -0
  252. package/dist/types/src/types/index.d.ts.map +1 -1
  253. package/dist/types/src/types/schema.d.ts +38 -94
  254. package/dist/types/src/types/schema.d.ts.map +1 -1
  255. package/dist/types/src/util/index.d.ts +1 -0
  256. package/dist/types/src/util/index.d.ts.map +1 -1
  257. package/dist/types/src/util/layoutAppliesTopbar.d.ts +1 -1
  258. package/dist/types/src/util/layoutAppliesTopbar.d.ts.map +1 -1
  259. package/dist/types/src/util/sanitize-persisted-state.d.ts +19 -0
  260. package/dist/types/src/util/sanitize-persisted-state.d.ts.map +1 -0
  261. package/dist/types/src/util/sanitize-persisted-state.test.d.ts +2 -0
  262. package/dist/types/src/util/sanitize-persisted-state.test.d.ts.map +1 -0
  263. package/dist/types/src/util/set-active.d.ts +2 -2
  264. package/dist/types/src/util/set-active.d.ts.map +1 -1
  265. package/dist/types/src/util/set-active.test.d.ts +2 -0
  266. package/dist/types/src/util/set-active.test.d.ts.map +1 -0
  267. package/dist/types/tsconfig.tsbuildinfo +1 -1
  268. package/package.json +77 -44
  269. package/src/DeckPlugin.ts +18 -22
  270. package/src/capabilities/app-graph-builder.ts +127 -0
  271. package/src/capabilities/check-app-scheme.ts +139 -0
  272. package/src/capabilities/index.ts +14 -10
  273. package/src/capabilities/operation-handler.ts +16 -0
  274. package/src/capabilities/{react-root/react-root.tsx → react-root.tsx} +5 -5
  275. package/src/capabilities/react-surface.tsx +38 -0
  276. package/src/capabilities/{settings/settings.ts → settings.ts} +8 -7
  277. package/src/capabilities/{state/state.ts → state.ts} +17 -31
  278. package/src/capabilities/{tools/tools.ts → tools.ts} +4 -5
  279. package/src/capabilities/url-handler.ts +209 -0
  280. package/src/components/DeckSettings/DeckSettings.stories.tsx +40 -0
  281. package/src/components/DeckSettings/DeckSettings.tsx +103 -93
  282. package/src/components/DeckSettings/index.ts +4 -2
  283. package/src/components/Matrix/Matrix.stories.tsx +213 -0
  284. package/src/components/Matrix/Matrix.tsx +205 -0
  285. package/src/components/Matrix/SPEC.md +219 -0
  286. package/src/components/Matrix/index.ts +6 -0
  287. package/src/components/index.ts +6 -3
  288. package/src/{components/DeckLayout → containers/Deck}/Banner.tsx +10 -9
  289. package/src/containers/Deck/Deck.stories.tsx +85 -0
  290. package/src/containers/Deck/Deck.tsx +21 -0
  291. package/src/containers/Deck/DeckContent.tsx +104 -0
  292. package/src/containers/Deck/DeckRoot.tsx +49 -0
  293. package/src/containers/Deck/DeckViewport.tsx +397 -0
  294. package/src/{components/DeckLayout → containers/Deck}/StatusBar.tsx +4 -4
  295. package/src/containers/Deck/index.ts +5 -0
  296. package/src/{components → containers}/DeckLayout/ActiveNode.tsx +4 -3
  297. package/src/containers/DeckLayout/DeckLayout.stories.tsx +174 -0
  298. package/src/containers/DeckLayout/DeckLayout.tsx +62 -0
  299. package/src/{components → containers}/DeckLayout/Dialog.tsx +11 -5
  300. package/src/containers/DeckLayout/Fallback.tsx +24 -0
  301. package/src/{components → containers}/DeckLayout/Popover.tsx +58 -18
  302. package/src/{components → containers}/DeckLayout/Toast.tsx +4 -4
  303. package/src/{components → containers}/DeckLayout/constants.ts +1 -0
  304. package/src/{components → containers}/DeckLayout/index.ts +3 -2
  305. package/src/containers/Plank/Plank.stories.tsx +105 -0
  306. package/src/containers/Plank/Plank.tsx +22 -0
  307. package/src/containers/Plank/PlankComponent.tsx +179 -0
  308. package/src/containers/Plank/PlankContent.tsx +45 -0
  309. package/src/{components → containers}/Plank/PlankControls.tsx +41 -34
  310. package/src/containers/Plank/PlankError.tsx +79 -0
  311. package/src/{components → containers}/Plank/PlankHeading.tsx +36 -45
  312. package/src/{components → containers}/Plank/PlankLoading.tsx +1 -1
  313. package/src/containers/Plank/PlankRoot.tsx +49 -0
  314. package/src/{components → containers}/Plank/index.ts +0 -2
  315. package/src/containers/Sidebar/ComplementarySidebar.tsx +209 -0
  316. package/src/{components → containers}/Sidebar/Sidebar.tsx +8 -8
  317. package/src/{components → containers}/Sidebar/SidebarButton.tsx +19 -19
  318. package/src/containers/index.ts +11 -0
  319. package/src/hooks/index.ts +1 -0
  320. package/src/hooks/useCompanions.ts +3 -3
  321. package/src/hooks/useDeckCompanions.ts +3 -8
  322. package/src/hooks/useDeckState.ts +14 -23
  323. package/src/hooks/useHoistStatusbar.ts +2 -2
  324. package/src/hooks/useMainSize.ts +2 -2
  325. package/src/hooks/useNodeActionExpander.ts +1 -1
  326. package/src/hooks/useSelectedCompanion.ts +32 -0
  327. package/src/layout.ts +3 -16
  328. package/src/meta.ts +1 -1
  329. package/src/operations/add-toast.ts +24 -0
  330. package/src/operations/adjust.ts +83 -0
  331. package/src/operations/change-companion.ts +35 -0
  332. package/src/operations/close.ts +35 -0
  333. package/src/operations/definitions.ts +61 -0
  334. package/src/operations/helpers.ts +22 -0
  335. package/src/operations/index.ts +26 -0
  336. package/src/operations/open.ts +117 -0
  337. package/src/operations/revert-workspace.ts +22 -0
  338. package/src/operations/scroll-into-view.ts +24 -0
  339. package/src/operations/set-layout-mode.ts +84 -0
  340. package/src/operations/set.ts +36 -0
  341. package/src/operations/show-undo.ts +46 -0
  342. package/src/operations/switch-workspace.ts +60 -0
  343. package/src/operations/update-complementary.ts +33 -0
  344. package/src/operations/update-dialog.ts +34 -0
  345. package/src/operations/update-plank-size.ts +29 -0
  346. package/src/operations/update-popover.ts +36 -0
  347. package/src/operations/update-sidebar.ts +28 -0
  348. package/src/testing/DeckLayoutStoryNavigation.tsx +57 -0
  349. package/src/testing/index.ts +5 -0
  350. package/src/translations.ts +67 -54
  351. package/src/types/Settings.ts +26 -0
  352. package/src/types/capabilities.ts +9 -8
  353. package/src/types/events.ts +6 -5
  354. package/src/types/index.ts +1 -0
  355. package/src/types/schema.ts +35 -110
  356. package/src/util/index.ts +1 -0
  357. package/src/util/layoutAppliesTopbar.ts +1 -1
  358. package/src/util/overscroll.ts +3 -3
  359. package/src/util/sanitize-persisted-state.test.ts +79 -0
  360. package/src/util/sanitize-persisted-state.ts +52 -0
  361. package/src/util/set-active.test.ts +106 -0
  362. package/src/util/set-active.ts +2 -2
  363. package/src/vite-env.d.ts +5 -0
  364. package/dist/lib/browser/app-graph-builder-DTVCULQ4.mjs +0 -120
  365. package/dist/lib/browser/app-graph-builder-DTVCULQ4.mjs.map +0 -7
  366. package/dist/lib/browser/check-app-scheme-JSRXXIYF.mjs +0 -32
  367. package/dist/lib/browser/check-app-scheme-JSRXXIYF.mjs.map +0 -7
  368. package/dist/lib/browser/chunk-ATFPDN6J.mjs +0 -292
  369. package/dist/lib/browser/chunk-ATFPDN6J.mjs.map +0 -7
  370. package/dist/lib/browser/chunk-NHABISX2.mjs +0 -152
  371. package/dist/lib/browser/chunk-NHABISX2.mjs.map +0 -7
  372. package/dist/lib/browser/chunk-S4A5UO4K.mjs +0 -1448
  373. package/dist/lib/browser/chunk-S4A5UO4K.mjs.map +0 -7
  374. package/dist/lib/browser/chunk-UNG4CLLP.mjs +0 -161
  375. package/dist/lib/browser/chunk-UNG4CLLP.mjs.map +0 -7
  376. package/dist/lib/browser/operation-resolver-CDYBLZJ4.mjs +0 -595
  377. package/dist/lib/browser/operation-resolver-CDYBLZJ4.mjs.map +0 -7
  378. package/dist/lib/browser/react-root-XDCMNENQ.mjs +0 -47
  379. package/dist/lib/browser/react-root-XDCMNENQ.mjs.map +0 -7
  380. package/dist/lib/browser/react-surface-HODERLOL.mjs +0 -42
  381. package/dist/lib/browser/react-surface-HODERLOL.mjs.map +0 -7
  382. package/dist/lib/browser/settings-OMHVGZ6V.mjs +0 -37
  383. package/dist/lib/browser/settings-OMHVGZ6V.mjs.map +0 -7
  384. package/dist/lib/browser/state-OC3BSB6E.mjs +0 -103
  385. package/dist/lib/browser/state-OC3BSB6E.mjs.map +0 -7
  386. package/dist/lib/browser/toolkit-R53LD3EA.mjs +0 -53
  387. package/dist/lib/browser/toolkit-R53LD3EA.mjs.map +0 -7
  388. package/dist/lib/browser/url-handler-53TE6JZO.mjs +0 -93
  389. package/dist/lib/browser/url-handler-53TE6JZO.mjs.map +0 -7
  390. package/dist/lib/node-esm/app-graph-builder-473BNZDJ.mjs +0 -121
  391. package/dist/lib/node-esm/app-graph-builder-473BNZDJ.mjs.map +0 -7
  392. package/dist/lib/node-esm/check-app-scheme-IVYRHKRH.mjs +0 -33
  393. package/dist/lib/node-esm/check-app-scheme-IVYRHKRH.mjs.map +0 -7
  394. package/dist/lib/node-esm/chunk-ADPMWKLL.mjs +0 -154
  395. package/dist/lib/node-esm/chunk-ADPMWKLL.mjs.map +0 -7
  396. package/dist/lib/node-esm/chunk-D34L3ECT.mjs +0 -1449
  397. package/dist/lib/node-esm/chunk-D34L3ECT.mjs.map +0 -7
  398. package/dist/lib/node-esm/chunk-SKEVPQ7E.mjs +0 -162
  399. package/dist/lib/node-esm/chunk-SKEVPQ7E.mjs.map +0 -7
  400. package/dist/lib/node-esm/chunk-XAKTY3EB.mjs +0 -294
  401. package/dist/lib/node-esm/chunk-XAKTY3EB.mjs.map +0 -7
  402. package/dist/lib/node-esm/operation-resolver-WUOE33ID.mjs +0 -596
  403. package/dist/lib/node-esm/operation-resolver-WUOE33ID.mjs.map +0 -7
  404. package/dist/lib/node-esm/react-root-O6GZO62Z.mjs +0 -48
  405. package/dist/lib/node-esm/react-root-O6GZO62Z.mjs.map +0 -7
  406. package/dist/lib/node-esm/react-surface-IHDJDGC5.mjs +0 -43
  407. package/dist/lib/node-esm/react-surface-IHDJDGC5.mjs.map +0 -7
  408. package/dist/lib/node-esm/settings-2HB6FKIK.mjs +0 -38
  409. package/dist/lib/node-esm/settings-2HB6FKIK.mjs.map +0 -7
  410. package/dist/lib/node-esm/state-JRQ45ACJ.mjs +0 -104
  411. package/dist/lib/node-esm/state-JRQ45ACJ.mjs.map +0 -7
  412. package/dist/lib/node-esm/toolkit-JLPZNNKB.mjs +0 -54
  413. package/dist/lib/node-esm/toolkit-JLPZNNKB.mjs.map +0 -7
  414. package/dist/lib/node-esm/url-handler-QGF2R24T.mjs +0 -94
  415. package/dist/lib/node-esm/url-handler-QGF2R24T.mjs.map +0 -7
  416. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +0 -6
  417. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
  418. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
  419. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
  420. package/dist/types/src/capabilities/check-app-scheme/check-app-scheme.d.ts +0 -5
  421. package/dist/types/src/capabilities/check-app-scheme/check-app-scheme.d.ts.map +0 -1
  422. package/dist/types/src/capabilities/check-app-scheme/index.d.ts +0 -3
  423. package/dist/types/src/capabilities/check-app-scheme/index.d.ts.map +0 -1
  424. package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
  425. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
  426. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
  427. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
  428. package/dist/types/src/capabilities/react-root/index.d.ts +0 -6
  429. package/dist/types/src/capabilities/react-root/index.d.ts.map +0 -1
  430. package/dist/types/src/capabilities/react-root/react-root.d.ts.map +0 -1
  431. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
  432. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  433. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
  434. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  435. package/dist/types/src/capabilities/settings/index.d.ts +0 -19
  436. package/dist/types/src/capabilities/settings/index.d.ts.map +0 -1
  437. package/dist/types/src/capabilities/settings/settings.d.ts.map +0 -1
  438. package/dist/types/src/capabilities/state/index.d.ts +0 -172
  439. package/dist/types/src/capabilities/state/index.d.ts.map +0 -1
  440. package/dist/types/src/capabilities/state/state.d.ts.map +0 -1
  441. package/dist/types/src/capabilities/toolkit/index.d.ts +0 -3
  442. package/dist/types/src/capabilities/toolkit/index.d.ts.map +0 -1
  443. package/dist/types/src/capabilities/toolkit/toolkit.d.ts +0 -26
  444. package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +0 -1
  445. package/dist/types/src/capabilities/tools/index.d.ts +0 -3
  446. package/dist/types/src/capabilities/tools/index.d.ts.map +0 -1
  447. package/dist/types/src/capabilities/tools/tools.d.ts.map +0 -1
  448. package/dist/types/src/capabilities/url-handler/index.d.ts +0 -3
  449. package/dist/types/src/capabilities/url-handler/index.d.ts.map +0 -1
  450. package/dist/types/src/capabilities/url-handler/url-handler.d.ts +0 -5
  451. package/dist/types/src/capabilities/url-handler/url-handler.d.ts.map +0 -1
  452. package/dist/types/src/components/DeckLayout/ActiveNode.d.ts.map +0 -1
  453. package/dist/types/src/components/DeckLayout/Banner.d.ts.map +0 -1
  454. package/dist/types/src/components/DeckLayout/ContentEmpty.d.ts +0 -3
  455. package/dist/types/src/components/DeckLayout/ContentEmpty.d.ts.map +0 -1
  456. package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +0 -1
  457. package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts +0 -74
  458. package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts.map +0 -1
  459. package/dist/types/src/components/DeckLayout/DeckMain.d.ts +0 -3
  460. package/dist/types/src/components/DeckLayout/DeckMain.d.ts.map +0 -1
  461. package/dist/types/src/components/DeckLayout/Fallback.d.ts +0 -3
  462. package/dist/types/src/components/DeckLayout/Fallback.d.ts.map +0 -1
  463. package/dist/types/src/components/DeckLayout/Popover.d.ts +0 -5
  464. package/dist/types/src/components/DeckLayout/Popover.d.ts.map +0 -1
  465. package/dist/types/src/components/DeckLayout/StatusBar.d.ts.map +0 -1
  466. package/dist/types/src/components/DeckLayout/Toast.d.ts.map +0 -1
  467. package/dist/types/src/components/DeckLayout/Topbar.d.ts +0 -3
  468. package/dist/types/src/components/DeckLayout/Topbar.d.ts.map +0 -1
  469. package/dist/types/src/components/DeckLayout/constants.d.ts.map +0 -1
  470. package/dist/types/src/components/DeckLayout/index.d.ts +0 -4
  471. package/dist/types/src/components/DeckLayout/index.d.ts.map +0 -1
  472. package/dist/types/src/components/Plank/Plank.d.ts +0 -27
  473. package/dist/types/src/components/Plank/Plank.d.ts.map +0 -1
  474. package/dist/types/src/components/Plank/Plank.stories.d.ts +0 -107
  475. package/dist/types/src/components/Plank/Plank.stories.d.ts.map +0 -1
  476. package/dist/types/src/components/Plank/PlankControls.d.ts.map +0 -1
  477. package/dist/types/src/components/Plank/PlankError.d.ts +0 -13
  478. package/dist/types/src/components/Plank/PlankError.d.ts.map +0 -1
  479. package/dist/types/src/components/Plank/PlankHeading.d.ts.map +0 -1
  480. package/dist/types/src/components/Plank/index.d.ts +0 -6
  481. package/dist/types/src/components/Plank/index.d.ts.map +0 -1
  482. package/dist/types/src/components/Sidebar/ComplementarySidebar.d.ts.map +0 -1
  483. package/dist/types/src/components/fragments.d.ts +0 -4
  484. package/dist/types/src/components/fragments.d.ts.map +0 -1
  485. package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -118
  486. package/src/capabilities/app-graph-builder/index.ts +0 -7
  487. package/src/capabilities/check-app-scheme/check-app-scheme.ts +0 -41
  488. package/src/capabilities/check-app-scheme/index.ts +0 -7
  489. package/src/capabilities/operation-resolver/index.ts +0 -10
  490. package/src/capabilities/operation-resolver/operation-resolver.ts +0 -555
  491. package/src/capabilities/react-root/index.ts +0 -7
  492. package/src/capabilities/react-surface/index.ts +0 -7
  493. package/src/capabilities/react-surface/react-surface.tsx +0 -37
  494. package/src/capabilities/settings/index.ts +0 -7
  495. package/src/capabilities/state/index.ts +0 -7
  496. package/src/capabilities/toolkit/index.ts +0 -7
  497. package/src/capabilities/toolkit/toolkit.ts +0 -63
  498. package/src/capabilities/tools/index.ts +0 -7
  499. package/src/capabilities/url-handler/index.ts +0 -7
  500. package/src/capabilities/url-handler/url-handler.ts +0 -95
  501. package/src/components/DeckLayout/ContentEmpty.tsx +0 -30
  502. package/src/components/DeckLayout/DeckLayout.stories.tsx +0 -51
  503. package/src/components/DeckLayout/DeckLayout.tsx +0 -34
  504. package/src/components/DeckLayout/DeckMain.tsx +0 -286
  505. package/src/components/DeckLayout/Fallback.tsx +0 -28
  506. package/src/components/DeckLayout/Topbar.tsx +0 -11
  507. package/src/components/Plank/Plank.stories.tsx +0 -62
  508. package/src/components/Plank/Plank.tsx +0 -299
  509. package/src/components/Plank/PlankError.tsx +0 -49
  510. package/src/components/Sidebar/ComplementarySidebar.tsx +0 -221
  511. package/src/components/fragments.ts +0 -14
  512. /package/dist/types/src/{components/DeckLayout → containers/Deck}/Banner.d.ts +0 -0
  513. /package/dist/types/src/{components/DeckLayout → containers/Deck}/StatusBar.d.ts +0 -0
  514. /package/dist/types/src/{components → containers}/DeckLayout/ActiveNode.d.ts +0 -0
  515. /package/dist/types/src/{components → containers}/DeckLayout/DeckLayout.d.ts +0 -0
  516. /package/dist/types/src/{components → containers}/DeckLayout/Dialog.d.ts +0 -0
  517. /package/dist/types/src/{components → containers}/DeckLayout/constants.d.ts +0 -0
  518. /package/dist/types/src/{components → containers}/Plank/PlankLoading.d.ts +0 -0
  519. /package/dist/types/src/{components → containers}/Sidebar/ComplementarySidebar.d.ts +0 -0
  520. /package/dist/types/src/{components → containers}/Sidebar/Sidebar.d.ts +0 -0
  521. /package/dist/types/src/{components → containers}/Sidebar/SidebarButton.d.ts +0 -0
  522. /package/dist/types/src/{components → containers}/Sidebar/index.d.ts +0 -0
  523. /package/src/{components → containers}/Sidebar/index.ts +0 -0
@@ -0,0 +1,209 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import React, { type MouseEvent, useCallback, useEffect, useMemo, useState } from 'react';
6
+
7
+ import { Surface, useOperationInvoker } from '@dxos/app-framework/ui';
8
+ import { LayoutOperation } from '@dxos/app-toolkit';
9
+ import { getLinkedVariant } from '@dxos/react-ui-attention';
10
+ import { IconButton, type Label, Main, Panel, toLocalizedString, Toolbar, useTranslation } from '@dxos/react-ui';
11
+ import { Tabs } from '@dxos/react-ui-tabs';
12
+ import { iconSize, mx } from '@dxos/ui-theme';
13
+
14
+ import { type DeckCompanion, useBreakpoints, useDeckCompanions, useDeckState, useHoistStatusbar } from '#hooks';
15
+ import { meta } from '#meta';
16
+ import { getMode } from '#types';
17
+ import { layoutAppliesTopbar } from '../../util';
18
+ import { PlankErrorFallback, PlankLoading } from '../Plank';
19
+
20
+ import { ToggleComplementarySidebarButton } from './SidebarButton';
21
+
22
+ const label = ['complementary-sidebar.title', { ns: meta.id }] satisfies Label;
23
+
24
+ export type ComplementarySidebarProps = {
25
+ current?: string;
26
+ };
27
+
28
+ export const ComplementarySidebar = ({ current }: ComplementarySidebarProps) => {
29
+ const { invokePromise } = useOperationInvoker();
30
+ const { t } = useTranslation(meta.id);
31
+ const { state, deck, updateState } = useDeckState();
32
+ const layoutMode = getMode(deck);
33
+ const breakpoint = useBreakpoints();
34
+ const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
35
+ const hoistStatusbar = useHoistStatusbar(breakpoint, layoutMode);
36
+
37
+ const companions = useDeckCompanions();
38
+ const activeCompanion = companions.find((companion) => getLinkedVariant(companion.id) === current);
39
+ const activeId = activeCompanion && getLinkedVariant(activeCompanion.id);
40
+ const [internalValue, setInternalValue] = useState(activeId);
41
+
42
+ useEffect(() => {
43
+ setInternalValue(activeId);
44
+ }, [activeId]);
45
+
46
+ const handleTabClick = useCallback(
47
+ (event: MouseEvent) => {
48
+ const nextValue = event.currentTarget.getAttribute('data-value') as string;
49
+ if (nextValue === activeId) {
50
+ updateState((state) => ({
51
+ ...state,
52
+ complementarySidebarState: state.complementarySidebarState === 'expanded' ? 'collapsed' : 'expanded',
53
+ }));
54
+ } else {
55
+ setInternalValue(nextValue);
56
+ updateState((state) => ({ ...state, complementarySidebarState: 'expanded' }));
57
+ void invokePromise(LayoutOperation.UpdateComplementary, { subject: nextValue });
58
+ }
59
+ },
60
+ [state.complementarySidebarState, activeId, invokePromise, updateState],
61
+ );
62
+
63
+ const data = useMemo(
64
+ () =>
65
+ activeCompanion && {
66
+ id: activeCompanion.id,
67
+ subject: activeCompanion.data,
68
+ },
69
+ [activeCompanion?.id, activeCompanion?.data],
70
+ );
71
+
72
+ useEffect(() => {
73
+ if (!activeId) {
74
+ void invokePromise(LayoutOperation.UpdateComplementary, { state: 'collapsed' });
75
+ }
76
+ }, [activeId, invokePromise]);
77
+
78
+ return (
79
+ <Main.ComplementarySidebar
80
+ label={label}
81
+ classNames={[
82
+ topbar && 'top-[calc(env(safe-area-inset-top)+var(--dx-rail-size))]',
83
+ hoistStatusbar && 'bottom-(--dx-statusbar-size)',
84
+ ]}
85
+ >
86
+ {/* R0 Tabs */}
87
+ <Tabs.Root orientation='vertical' value={internalValue} classNames='contents'>
88
+ <div
89
+ data-tauri-drag-region
90
+ role='none'
91
+ style={iconSize(5)}
92
+ className={mx(
93
+ 'absolute z-20 inset-y-0 end-0 w-(--dx-r0-size)!',
94
+ 'py-[env(safe-area-inset-top)] pb-[env(safe-area-inset-bottom)] border-s border-subdued-separator',
95
+ 'grid grid-cols-1 grid-rows-[1fr_min-content] bg-toolbar-surface dx-contain-layout dx-app-drag',
96
+ )}
97
+ >
98
+ {/* TODO(burdon): ScrollArea. */}
99
+ <Tabs.Tablist classNames='grid grid-cols-1 auto-rows-(--dx-rail-action) overflow-y-auto'>
100
+ {companions.map((companion) => (
101
+ <Tabs.Tab key={getLinkedVariant(companion.id)} value={getLinkedVariant(companion.id)} asChild>
102
+ <IconButton
103
+ label={toLocalizedString(companion.properties.label, t)}
104
+ icon={companion.properties.icon}
105
+ iconOnly
106
+ tooltipSide='left'
107
+ data-value={getLinkedVariant(companion.id)}
108
+ variant={
109
+ activeId === getLinkedVariant(companion.id)
110
+ ? state.complementarySidebarState === 'expanded'
111
+ ? 'primary'
112
+ : 'ghost'
113
+ : 'ghost'
114
+ }
115
+ onClick={handleTabClick}
116
+ />
117
+ </Tabs.Tab>
118
+ ))}
119
+ </Tabs.Tablist>
120
+ {!hoistStatusbar && (
121
+ <div
122
+ role='none'
123
+ className='grid grid-cols-1 auto-rows-(--dx-rail-item) gap-0.5 overflow-y-auto'
124
+ style={iconSize(4)}
125
+ >
126
+ <Surface.Surface role='status-indicator' />
127
+ </div>
128
+ )}
129
+ <div role='none' className='hidden lg:grid grid-cols-1 auto-rows-(--dx-rail-action) p-1'>
130
+ <ToggleComplementarySidebarButton />
131
+ </div>
132
+ </div>
133
+
134
+ {/* R1 Content. */}
135
+ {activeId &&
136
+ companions.map((companion) => (
137
+ <Tabs.Panel
138
+ key={getLinkedVariant(companion.id)}
139
+ value={getLinkedVariant(companion.id)}
140
+ classNames={[
141
+ 'absolute data-[state="inactive"]:-z-[1] overflow-hidden',
142
+ 'inset-y-0 start-0 w-[calc(100%-var(--dx-r0-size))] lg:w-(--dx-r1-size)',
143
+ ]}
144
+ {...(state.complementarySidebarState !== 'expanded' && { inert: true })}
145
+ >
146
+ <ComplementarySidebarPanel
147
+ companion={companion}
148
+ activeId={activeId}
149
+ data={data}
150
+ hoistStatusbar={hoistStatusbar}
151
+ />
152
+ </Tabs.Panel>
153
+ ))}
154
+ </Tabs.Root>
155
+ </Main.ComplementarySidebar>
156
+ );
157
+ };
158
+
159
+ type ComplementarySidebarPanelProps = {
160
+ companion: DeckCompanion;
161
+ activeId: string;
162
+ data?: {
163
+ id: string;
164
+ subject: any;
165
+ };
166
+ hoistStatusbar: boolean;
167
+ };
168
+
169
+ const ComplementarySidebarPanel = ({ companion, activeId, data, hoistStatusbar }: ComplementarySidebarPanelProps) => {
170
+ const { t } = useTranslation(meta.id);
171
+
172
+ if (getLinkedVariant(companion.id) !== activeId && !data) {
173
+ return null;
174
+ }
175
+
176
+ return (
177
+ <Panel.Root>
178
+ <Panel.Toolbar asChild size='lg'>
179
+ <Toolbar.Root classNames='bg-modal-surface border-b border-subdued-separator'>
180
+ <IconButton
181
+ label={toLocalizedString(companion.properties.label, t)}
182
+ icon={companion.properties.icon}
183
+ iconOnly
184
+ tooltipSide='left'
185
+ data-value={getLinkedVariant(companion.id)}
186
+ classNames='h-10 w-10'
187
+ variant='default'
188
+ />
189
+ <div role='none' className='px-1'>
190
+ {toLocalizedString(companion.properties.label, t)}
191
+ </div>
192
+ </Toolbar.Root>
193
+ </Panel.Toolbar>
194
+ <Panel.Content classNames='bg-base-surface'>
195
+ <Surface.Surface
196
+ role={`deck-companion--${getLinkedVariant(companion.id)}`}
197
+ data={data}
198
+ fallback={PlankErrorFallback}
199
+ placeholder={<PlankLoading />}
200
+ />
201
+ </Panel.Content>
202
+ {!hoistStatusbar && (
203
+ <Panel.Statusbar classNames='px-1' size='sm'>
204
+ <Surface.Surface role='status-bar--r1-footer' limit={1} />
205
+ </Panel.Statusbar>
206
+ )}
207
+ </Panel.Root>
208
+ );
209
+ };
@@ -4,15 +4,15 @@
4
4
 
5
5
  import React, { useMemo } from 'react';
6
6
 
7
- import { Surface } from '@dxos/app-framework/react';
7
+ import { Surface } from '@dxos/app-framework/ui';
8
8
  import { type Label, Main } from '@dxos/react-ui';
9
9
 
10
- import { useBreakpoints, useDeckState, useHoistStatusbar } from '../../hooks';
11
- import { meta } from '../../meta';
12
- import { getMode } from '../../types';
10
+ import { useBreakpoints, useDeckState, useHoistStatusbar } from '#hooks';
11
+ import { meta } from '#meta';
12
+ import { getMode } from '#types';
13
13
  import { layoutAppliesTopbar } from '../../util';
14
14
 
15
- const label = ['sidebar title', { ns: meta.id }] satisfies Label;
15
+ const label = ['sidebar.title', { ns: meta.id }] satisfies Label;
16
16
 
17
17
  export const Sidebar = () => {
18
18
  const { state, deck } = useDeckState();
@@ -32,11 +32,11 @@ export const Sidebar = () => {
32
32
  label={label}
33
33
  classNames={[
34
34
  'grid',
35
- topbar && 'block-start-[calc(env(safe-area-inset-top)+var(--rail-size))]',
36
- hoistStatusbar && 'block-end-[--statusbar-size]',
35
+ topbar && 'top-[calc(env(safe-area-inset-top)+var(--dx-rail-size))]',
36
+ hoistStatusbar && 'bottom-(--dx-statusbar-size)',
37
37
  ]}
38
38
  >
39
- <Surface role='navigation' data={navigationData} limit={1} />
39
+ <Surface.Surface role='navigation' data={navigationData} limit={1} />
40
40
  </Main.NavigationSidebar>
41
41
  );
42
42
  };
@@ -4,24 +4,25 @@
4
4
 
5
5
  import React, { useCallback } from 'react';
6
6
 
7
- import { Common } from '@dxos/app-framework';
8
- import { useOperationInvoker } from '@dxos/app-framework/react';
7
+ import { useOperationInvoker } from '@dxos/app-framework/ui';
8
+ import { LayoutOperation } from '@dxos/app-toolkit';
9
+ import { getLinkedVariant } from '@dxos/react-ui-attention';
9
10
  import { IconButton, type IconButtonProps, type ThemedClassName, useTranslation } from '@dxos/react-ui';
10
11
 
11
- import { getCompanionId, useDeckCompanions, useDeckState } from '../../hooks';
12
- import { meta } from '../../meta';
12
+ import { useDeckCompanions, useDeckState } from '#hooks';
13
+ import { meta } from '#meta';
13
14
 
14
15
  export const ToggleSidebarButton = ({
15
16
  classNames,
16
17
  variant = 'ghost',
17
18
  }: ThemedClassName<Pick<IconButtonProps, 'variant'>>) => {
18
- const { state, updateState } = useDeckState();
19
+ const { updateState } = useDeckState();
19
20
  const { t } = useTranslation(meta.id);
20
21
 
21
22
  const handleClick = useCallback(() => {
22
- updateState((s) => ({
23
- ...s,
24
- sidebarState: s.sidebarState === 'expanded' ? 'collapsed' : 'expanded',
23
+ updateState((state) => ({
24
+ ...state,
25
+ sidebarState: state.sidebarState === 'expanded' ? 'collapsed' : 'expanded',
25
26
  }));
26
27
  }, [updateState]);
27
28
 
@@ -31,7 +32,7 @@ export const ToggleSidebarButton = ({
31
32
  icon='ph--sidebar--regular'
32
33
  iconOnly
33
34
  size={4}
34
- label={t('open navigation sidebar label')}
35
+ label={t('open-navigation-sidebar.label')}
35
36
  onClick={handleClick}
36
37
  classNames={classNames}
37
38
  />
@@ -43,7 +44,7 @@ export const CloseSidebarButton = () => {
43
44
  const { t } = useTranslation(meta.id);
44
45
 
45
46
  const handleClick = useCallback(() => {
46
- updateState((s) => ({ ...s, sidebarState: 'collapsed' }));
47
+ updateState((state) => ({ ...state, sidebarState: 'collapsed' }));
47
48
  }, [updateState]);
48
49
 
49
50
  return (
@@ -52,9 +53,9 @@ export const CloseSidebarButton = () => {
52
53
  icon='ph--caret-line-left--regular'
53
54
  iconOnly
54
55
  size={4}
55
- label={t('close navigation sidebar label')}
56
+ label={t('close-navigation-sidebar.button')}
56
57
  onClick={handleClick}
57
- classNames='rounded-none pli-1 dx-focus-ring-inset pie-[max(.5rem,env(safe-area-inset-left))]'
58
+ classNames='rounded-none px-1 dx-focus-ring-inset pe-[max(.5rem,env(safe-area-inset-left))]'
58
59
  />
59
60
  );
60
61
  };
@@ -64,20 +65,20 @@ export const ToggleComplementarySidebarButton = ({
64
65
  classNames,
65
66
  current,
66
67
  }: ThemedClassName<{ inR0?: boolean; current?: string }>) => {
67
- const { invokeSync } = useOperationInvoker();
68
+ const { invokePromise } = useOperationInvoker();
68
69
  const { state, updateState } = useDeckState();
69
70
  const { t } = useTranslation(meta.id);
70
71
 
71
72
  const companions = useDeckCompanions();
72
73
  const handleClick = useCallback(() => {
73
74
  const nextState = state.complementarySidebarState === 'expanded' ? 'collapsed' : 'expanded';
74
- updateState((s) => ({ ...s, complementarySidebarState: nextState }));
75
+ updateState((state) => ({ ...state, complementarySidebarState: nextState }));
75
76
 
76
- const subject = state.complementarySidebarPanel ?? (companions[0] && getCompanionId(companions[0].id));
77
+ const subject = state.complementarySidebarPanel ?? (companions[0] && getLinkedVariant(companions[0].id));
77
78
  if (nextState === 'expanded' && !current && subject) {
78
- invokeSync(Common.LayoutOperation.UpdateComplementary, { subject });
79
+ void invokePromise(LayoutOperation.UpdateComplementary, { subject });
79
80
  }
80
- }, [state, updateState, current, companions, invokeSync]);
81
+ }, [state, updateState, current, companions, invokePromise]);
81
82
 
82
83
  return (
83
84
  <IconButton
@@ -85,8 +86,7 @@ export const ToggleComplementarySidebarButton = ({
85
86
  classNames={['[&>svg]:-scale-x-100', classNames]}
86
87
  icon='ph--sidebar-simple--regular'
87
88
  iconOnly
88
- label={t('open complementary sidebar label')}
89
- size={inR0 ? 5 : 4}
89
+ label={t('open-complementary-sidebar.label')}
90
90
  tooltipSide={inR0 ? 'left' : undefined}
91
91
  onClick={handleClick}
92
92
  />
@@ -0,0 +1,11 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { type ComponentType, lazy } from 'react';
6
+
7
+ export * from './Deck';
8
+ export * from './Plank';
9
+ export * from './Sidebar';
10
+
11
+ export const DeckLayout: ComponentType<any> = lazy(() => import('./DeckLayout'));
@@ -9,3 +9,4 @@ export * from './useDeckState';
9
9
  export * from './useHoistStatusbar';
10
10
  export * from './useMainSize';
11
11
  export * from './useNodeActionExpander';
12
+ export * from './useSelectedCompanion';
@@ -4,15 +4,15 @@
4
4
 
5
5
  import { useMemo } from 'react';
6
6
 
7
- import { useAppGraph } from '@dxos/app-framework/react';
7
+ import { useAppGraph } from '@dxos/app-toolkit/ui';
8
8
  import { useConnections } from '@dxos/plugin-graph';
9
9
  import { byPosition } from '@dxos/util';
10
10
 
11
- import { PLANK_COMPANION_TYPE } from '../types';
11
+ import { PLANK_COMPANION_TYPE } from '#types';
12
12
 
13
13
  export const useCompanions = (id?: string) => {
14
14
  const { graph } = useAppGraph();
15
- const nodes = useConnections(graph, id);
15
+ const nodes = useConnections(graph, id, 'child');
16
16
  const companions = nodes.filter((node) => node.type === PLANK_COMPANION_TYPE);
17
17
  return useMemo(() => companions.toSorted((a, b) => byPosition(a.properties, b.properties)), [companions]);
18
18
  };
@@ -2,18 +2,13 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { useAppGraph } from '@dxos/app-framework/react';
5
+ import { useAppGraph } from '@dxos/app-toolkit/ui';
6
6
  import { Node, type Node as NodeType } from '@dxos/plugin-graph';
7
7
  import { useConnections } from '@dxos/plugin-graph';
8
8
  import { type Label } from '@dxos/ui-types';
9
9
  import { type Position, byPosition } from '@dxos/util';
10
10
 
11
- import { ATTENDABLE_PATH_SEPARATOR, DECK_COMPANION_TYPE } from '../types';
12
-
13
- export const getCompanionId = (id: string) => {
14
- const [_, companionId] = id.split(ATTENDABLE_PATH_SEPARATOR);
15
- return companionId ?? 'never';
16
- };
11
+ import { DECK_COMPANION_TYPE } from '#types';
17
12
 
18
13
  export type DeckCompanion = NodeType.Node<
19
14
  any,
@@ -29,7 +24,7 @@ export type DeckCompanion = NodeType.Node<
29
24
 
30
25
  export const useDeckCompanions = (): DeckCompanion[] => {
31
26
  const { graph } = useAppGraph();
32
- const connections = useConnections(graph, Node.RootId);
27
+ const connections = useConnections(graph, Node.RootId, 'child');
33
28
  const companions = connections.filter((node) => node.type === DECK_COMPANION_TYPE) as DeckCompanion[];
34
29
  return companions.toSorted((a, b) => byPosition(a.properties, b.properties));
35
30
  };
@@ -5,17 +5,17 @@
5
5
  import { useAtomValue } from '@effect-atom/atom-react';
6
6
  import { useCallback, useMemo } from 'react';
7
7
 
8
- import { Common } from '@dxos/app-framework';
9
- import { useCapability } from '@dxos/app-framework/react';
8
+ import { Capabilities } from '@dxos/app-framework';
9
+ import { useCapability } from '@dxos/app-framework/ui';
10
10
  import { invariant } from '@dxos/invariant';
11
11
 
12
12
  import {
13
13
  DeckCapabilities,
14
- type DeckEphemeralStateProps,
14
+ type EphemeralDeckState,
15
15
  type DeckPluginState,
16
16
  type DeckState,
17
- type DeckStateProps,
18
- } from '../types';
17
+ type StoredDeckState,
18
+ } from '#types';
19
19
 
20
20
  export type DeckStateHook = {
21
21
  /** Combined state value (reactive). Includes both persisted and ephemeral state. */
@@ -23,9 +23,9 @@ export type DeckStateHook = {
23
23
  /** The active deck, computed from decks[activeDeck]. */
24
24
  deck: DeckState;
25
25
  /** Update persisted state. */
26
- updateState: (fn: (current: DeckStateProps) => DeckStateProps) => void;
26
+ updateState: (fn: (current: StoredDeckState) => StoredDeckState) => void;
27
27
  /** Update ephemeral state. */
28
- updateEphemeral: (fn: (current: DeckEphemeralStateProps) => DeckEphemeralStateProps) => void;
28
+ updateEphemeral: (fn: (current: EphemeralDeckState) => EphemeralDeckState) => void;
29
29
  };
30
30
 
31
31
  /**
@@ -33,18 +33,17 @@ export type DeckStateHook = {
33
33
  * Returns the combined state, the active deck, and update functions for each atom.
34
34
  */
35
35
  export const useDeckState = (): DeckStateHook => {
36
- const registry = useCapability(Common.Capability.AtomRegistry);
36
+ const registry = useCapability(Capabilities.AtomRegistry);
37
37
  const stateAtom = useCapability(DeckCapabilities.State);
38
38
  const ephemeralAtom = useCapability(DeckCapabilities.EphemeralState);
39
-
40
39
  const persistedState = useAtomValue(stateAtom);
41
40
  const ephemeralState = useAtomValue(ephemeralAtom);
42
41
 
43
42
  // Compute deck from decks[activeDeck] to ensure it's always current.
44
43
  const deck = useMemo(() => {
45
- const d = persistedState.decks[persistedState.activeDeck];
46
- invariant(d, `Deck not found: ${persistedState.activeDeck}`);
47
- return d;
44
+ const deck = persistedState.decks[persistedState.activeDeck];
45
+ invariant(deck, `Deck not found: ${persistedState.activeDeck}`);
46
+ return deck;
48
47
  }, [persistedState.decks, persistedState.activeDeck]);
49
48
 
50
49
  // Combine persisted and ephemeral state into a unified view.
@@ -57,26 +56,18 @@ export const useDeckState = (): DeckStateHook => {
57
56
  );
58
57
 
59
58
  const updateState = useCallback(
60
- (fn: (current: DeckStateProps) => DeckStateProps) => {
59
+ (fn: (current: StoredDeckState) => StoredDeckState) => {
61
60
  registry.set(stateAtom, fn(registry.get(stateAtom)));
62
61
  },
63
62
  [registry, stateAtom],
64
63
  );
65
64
 
66
65
  const updateEphemeral = useCallback(
67
- (fn: (current: DeckEphemeralStateProps) => DeckEphemeralStateProps) => {
66
+ (fn: (current: EphemeralDeckState) => EphemeralDeckState) => {
68
67
  registry.set(ephemeralAtom, fn(registry.get(ephemeralAtom)));
69
68
  },
70
69
  [registry, ephemeralAtom],
71
70
  );
72
71
 
73
- return useMemo(
74
- () => ({
75
- state,
76
- deck,
77
- updateState,
78
- updateEphemeral,
79
- }),
80
- [state, deck, updateState, updateEphemeral],
81
- );
72
+ return useMemo(() => ({ state, deck, updateState, updateEphemeral }), [state, deck, updateState, updateEphemeral]);
82
73
  };
@@ -4,10 +4,10 @@
4
4
 
5
5
  import { useMemo } from 'react';
6
6
 
7
- import { useAtomCapability } from '@dxos/app-framework/react';
7
+ import { useAtomCapability } from '@dxos/app-framework/ui';
8
8
  import { useThemeContext } from '@dxos/react-ui';
9
9
 
10
- import { DeckCapabilities, type LayoutMode } from '../types';
10
+ import { DeckCapabilities, type LayoutMode } from '#types';
11
11
 
12
12
  export const useHoistStatusbar = (breakpoint: string, layoutMode?: LayoutMode): boolean => {
13
13
  const { safeAreaPadding } = useThemeContext();
@@ -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
  };
@@ -11,7 +11,7 @@ export const useNodeActionExpander = (node?: Node.Node) => {
11
11
  if (node) {
12
12
  const frame = requestAnimationFrame(() => {
13
13
  const graph = Graph.getGraph(node);
14
- void Graph.expand(graph, node.id);
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 { getLinkedVariant } from '@dxos/react-ui-attention';
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) => getLinkedVariant(companion.id) === preferredVariant);
23
+ if (preferred) {
24
+ return { companionId: preferred.id, variant: getLinkedVariant(preferred.id) };
25
+ }
26
+ }
27
+
28
+ // Fallback to first companion.
29
+ const first = companions[0];
30
+ return { companionId: first.id, variant: getLinkedVariant(first.id) };
31
+ }, [companions, preferredVariant]);
32
+ };
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
- import { type DeckAction, type NewPlankPositioning } from './types';
10
-
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
- };
7
+ import { type DeckAction, type Settings } from '#types';
18
8
 
19
9
  type OpenLayoutEntryOptions = {
20
10
  key?: string;
21
- positioning?: NewPlankPositioning;
11
+ positioning?: Settings.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
@@ -6,7 +6,7 @@ import { type Plugin } from '@dxos/app-framework';
6
6
  import { trim } from '@dxos/util';
7
7
 
8
8
  export const meta: Plugin.Meta = {
9
- id: 'dxos.org/plugin/deck',
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.
@@ -0,0 +1,24 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capabilities } from '@dxos/app-framework';
8
+ import { LayoutOperation } from '@dxos/app-toolkit';
9
+ import { Operation } from '@dxos/operation';
10
+
11
+ import { DeckCapabilities } from '../types';
12
+
13
+ const handler: Operation.WithHandler<typeof LayoutOperation.AddToast> = LayoutOperation.AddToast.pipe(
14
+ Operation.withHandler(
15
+ Effect.fnUntraced(function* (input) {
16
+ yield* Capabilities.updateAtomValue(DeckCapabilities.EphemeralState, (state) => ({
17
+ ...state,
18
+ toasts: [...state.toasts, input as LayoutOperation.Toast],
19
+ }));
20
+ }),
21
+ ),
22
+ );
23
+
24
+ export default handler;