@dxos/plugin-deck 0.9.0 → 0.9.1-staging.ee54ba693a

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 (314) hide show
  1. package/PLUGIN.mdl +3 -1
  2. package/dist/lib/neutral/{DeckLayout-DEURA3KR.mjs → DeckLayout-B3RUUV5P.mjs} +36 -22
  3. package/dist/lib/neutral/DeckLayout-B3RUUV5P.mjs.map +7 -0
  4. package/dist/lib/neutral/DeckPlugin.mjs +4 -8
  5. package/dist/lib/neutral/DeckPlugin.mjs.map +4 -4
  6. package/dist/lib/neutral/DeckSettings-Z7GMB7XJ.mjs +32 -0
  7. package/dist/lib/neutral/DeckSettings-Z7GMB7XJ.mjs.map +7 -0
  8. package/dist/lib/neutral/{add-toast-TNB6DXWU.mjs → add-toast-BHNEH5UY.mjs} +2 -2
  9. package/dist/lib/neutral/{adjust-HNU5CCRO.mjs → adjust-MJB6UMRQ.mjs} +16 -10
  10. package/dist/lib/neutral/adjust-MJB6UMRQ.mjs.map +7 -0
  11. package/dist/lib/neutral/{app-graph-builder-HMLT627T.mjs → app-graph-builder-2F7P4IFQ.mjs} +8 -7
  12. package/dist/lib/neutral/app-graph-builder-2F7P4IFQ.mjs.map +7 -0
  13. package/dist/lib/neutral/capabilities/index.mjs +8 -8
  14. package/dist/lib/neutral/{check-app-scheme-INSOF72J.mjs → check-app-scheme-HSAORHHX.mjs} +2 -2
  15. package/dist/lib/neutral/chunk-FKGYHBUB.mjs +8 -0
  16. package/dist/lib/neutral/{chunk-BS4EOYMK.mjs → chunk-ICOJ4GMB.mjs} +37 -19
  17. package/dist/lib/neutral/chunk-ICOJ4GMB.mjs.map +7 -0
  18. package/dist/lib/neutral/chunk-KY7LMF4D.mjs +46 -0
  19. package/dist/lib/neutral/chunk-KY7LMF4D.mjs.map +7 -0
  20. package/dist/lib/neutral/{chunk-324PPIZB.mjs → chunk-KZFJ4PBT.mjs} +4 -4
  21. package/dist/lib/neutral/chunk-KZFJ4PBT.mjs.map +7 -0
  22. package/dist/lib/neutral/{chunk-GBIGQKYW.mjs → chunk-PP32NEVY.mjs} +4 -4
  23. package/dist/lib/neutral/chunk-PP32NEVY.mjs.map +7 -0
  24. package/dist/lib/neutral/chunk-SONATB35.mjs +20 -0
  25. package/dist/lib/neutral/chunk-SONATB35.mjs.map +7 -0
  26. package/dist/lib/neutral/chunk-Z2B5RSVI.mjs +1096 -0
  27. package/dist/lib/neutral/chunk-Z2B5RSVI.mjs.map +7 -0
  28. package/dist/lib/neutral/{close-ASKR22A6.mjs → close-2YGB5IIP.mjs} +4 -3
  29. package/dist/lib/neutral/{close-ASKR22A6.mjs.map → close-2YGB5IIP.mjs.map} +1 -1
  30. package/dist/lib/neutral/components/index.mjs +201 -16
  31. package/dist/lib/neutral/components/index.mjs.map +4 -4
  32. package/dist/lib/neutral/containers/index.mjs +6 -11
  33. package/dist/lib/neutral/containers/index.mjs.map +3 -3
  34. package/dist/lib/neutral/hooks/index.mjs +101 -17
  35. package/dist/lib/neutral/hooks/index.mjs.map +4 -4
  36. package/dist/lib/neutral/index.mjs +18 -2
  37. package/dist/lib/neutral/meta.json +1 -1
  38. package/dist/lib/neutral/meta.mjs +1 -1
  39. package/dist/lib/neutral/{notification-tracker-P36322BH.mjs → notification-tracker-Y5CRTWJM.mjs} +12 -10
  40. package/dist/lib/neutral/notification-tracker-Y5CRTWJM.mjs.map +7 -0
  41. package/dist/lib/neutral/{open-5OYNO3RT.mjs → open-P6XQ56M7.mjs} +8 -7
  42. package/dist/lib/neutral/open-P6XQ56M7.mjs.map +7 -0
  43. package/dist/lib/neutral/operations/index.mjs +1 -1
  44. package/dist/lib/neutral/plugin.mjs +2 -2
  45. package/dist/lib/neutral/{react-root-HH5DEUOG.mjs → react-root-E6TAFHX6.mjs} +2 -2
  46. package/dist/lib/neutral/react-root-E6TAFHX6.mjs.map +7 -0
  47. package/dist/lib/neutral/{react-surface-3UVVCK3O.mjs → react-surface-H63FXUK3.mjs} +5 -6
  48. package/dist/lib/neutral/react-surface-H63FXUK3.mjs.map +7 -0
  49. package/dist/lib/neutral/{revert-workspace-B2QLT2C4.mjs → revert-workspace-RXWP2TEE.mjs} +2 -2
  50. package/dist/lib/neutral/{scroll-into-view-B52C3PJO.mjs → scroll-into-view-HFV5EGYZ.mjs} +2 -2
  51. package/dist/lib/neutral/{set-PA35ONXO.mjs → set-HOOVB7E4.mjs} +4 -3
  52. package/dist/lib/neutral/{set-PA35ONXO.mjs.map → set-HOOVB7E4.mjs.map} +1 -1
  53. package/dist/lib/neutral/{set-layout-mode-RPCCPQRB.mjs → set-layout-mode-XAGSZZGB.mjs} +2 -2
  54. package/dist/lib/neutral/{settings-EGNYUM4T.mjs → settings-6CDQEB6B.mjs} +3 -3
  55. package/dist/lib/neutral/settings-6CDQEB6B.mjs.map +7 -0
  56. package/dist/lib/neutral/{state-IIDXMQUO.mjs → state-F4X5GPGZ.mjs} +4 -3
  57. package/dist/lib/neutral/state-F4X5GPGZ.mjs.map +7 -0
  58. package/dist/lib/neutral/{switch-workspace-LZF4KZXH.mjs → switch-workspace-PA7N6EUX.mjs} +4 -4
  59. package/dist/lib/neutral/switch-workspace-PA7N6EUX.mjs.map +7 -0
  60. package/dist/lib/neutral/translations.mjs +3 -3
  61. package/dist/lib/neutral/translations.mjs.map +3 -3
  62. package/dist/lib/neutral/types/index.mjs +11 -1
  63. package/dist/lib/neutral/{update-companion-YUCZZVGY.mjs → update-companion-6A2SKQAI.mjs} +14 -6
  64. package/dist/lib/neutral/update-companion-6A2SKQAI.mjs.map +7 -0
  65. package/dist/lib/neutral/{update-complementary-7FZNB55J.mjs → update-complementary-K55I5EV5.mjs} +2 -2
  66. package/dist/lib/neutral/{update-dialog-FNQTSSAP.mjs → update-dialog-Z3GEXMVV.mjs} +2 -2
  67. package/dist/lib/neutral/{update-plank-size-3YW4NXEY.mjs → update-plank-size-BTESVV7N.mjs} +2 -2
  68. package/dist/lib/neutral/{update-popover-G2VUD7E6.mjs → update-popover-QEVDSZSH.mjs} +2 -2
  69. package/dist/lib/neutral/{update-sidebar-KRHPUHUB.mjs → update-sidebar-VSRCN47U.mjs} +2 -2
  70. package/dist/lib/neutral/{url-handler-A6HLW4RB.mjs → url-handler-ERZXXEYR.mjs} +11 -10
  71. package/dist/lib/neutral/url-handler-ERZXXEYR.mjs.map +7 -0
  72. package/dist/types/dx.config.d.ts +28 -0
  73. package/dist/types/dx.config.d.ts.map +1 -0
  74. package/dist/types/src/DeckPlugin.d.ts.map +1 -1
  75. package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -2
  76. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  77. package/dist/types/src/capabilities/index.d.ts +8 -196
  78. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  79. package/dist/types/src/capabilities/notification-tracker.d.ts +1 -1
  80. package/dist/types/src/capabilities/notification-tracker.d.ts.map +1 -1
  81. package/dist/types/src/capabilities/react-root.d.ts +1 -5
  82. package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
  83. package/dist/types/src/capabilities/react-surface.d.ts +2 -2
  84. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  85. package/dist/types/src/capabilities/settings.d.ts +1 -3
  86. package/dist/types/src/capabilities/settings.d.ts.map +1 -1
  87. package/dist/types/src/capabilities/state.d.ts +1 -187
  88. package/dist/types/src/capabilities/state.d.ts.map +1 -1
  89. package/dist/types/src/capabilities/tools.d.ts +1 -1
  90. package/dist/types/src/capabilities/url-handler.d.ts +1 -1
  91. package/dist/types/src/components/Companion/Companion.d.ts +17 -0
  92. package/dist/types/src/components/Companion/Companion.d.ts.map +1 -0
  93. package/dist/types/src/components/Companion/index.d.ts +2 -0
  94. package/dist/types/src/components/Companion/index.d.ts.map +1 -0
  95. package/dist/types/src/components/Matrix/Matrix.d.ts +1 -1
  96. package/dist/types/src/components/Matrix/Matrix.d.ts.map +1 -1
  97. package/dist/types/src/components/Matrix/Matrix.stories.d.ts +2 -2
  98. package/dist/types/src/components/Matrix/Matrix.stories.d.ts.map +1 -1
  99. package/dist/types/src/components/Matrix/index.d.ts +1 -1
  100. package/dist/types/src/components/Matrix/index.d.ts.map +1 -1
  101. package/dist/types/src/components/Pane/Pane.d.ts +45 -0
  102. package/dist/types/src/components/Pane/Pane.d.ts.map +1 -0
  103. package/dist/types/src/components/Pane/Pane.stories.d.ts +7 -0
  104. package/dist/types/src/components/Pane/Pane.stories.d.ts.map +1 -0
  105. package/dist/types/src/components/Pane/index.d.ts +2 -0
  106. package/dist/types/src/components/Pane/index.d.ts.map +1 -0
  107. package/dist/types/src/components/Plank/Plank.d.ts +74 -0
  108. package/dist/types/src/components/Plank/Plank.d.ts.map +1 -0
  109. package/dist/types/src/components/Plank/Plank.stories.d.ts +6 -0
  110. package/dist/types/src/components/Plank/Plank.stories.d.ts.map +1 -0
  111. package/dist/types/src/components/Plank/index.d.ts +2 -0
  112. package/dist/types/src/components/Plank/index.d.ts.map +1 -0
  113. package/dist/types/src/components/index.d.ts +3 -2
  114. package/dist/types/src/components/index.d.ts.map +1 -1
  115. package/dist/types/src/containers/Deck/Banner.d.ts.map +1 -1
  116. package/dist/types/src/containers/Deck/Deck.d.ts +1 -1
  117. package/dist/types/src/containers/Deck/Deck.d.ts.map +1 -1
  118. package/dist/types/src/containers/Deck/Deck.stories.d.ts +2 -2
  119. package/dist/types/src/containers/Deck/DeckPlank.d.ts +21 -0
  120. package/dist/types/src/containers/Deck/DeckPlank.d.ts.map +1 -0
  121. package/dist/types/src/containers/Deck/DeckViewport.d.ts +3 -1
  122. package/dist/types/src/containers/Deck/DeckViewport.d.ts.map +1 -1
  123. package/dist/types/src/containers/{Plank → Deck}/PlankControls.d.ts +3 -10
  124. package/dist/types/src/containers/Deck/PlankControls.d.ts.map +1 -0
  125. package/dist/types/src/containers/Deck/PlankFallback.d.ts +6 -0
  126. package/dist/types/src/containers/Deck/PlankFallback.d.ts.map +1 -0
  127. package/dist/types/src/containers/Deck/StatusBar.d.ts.map +1 -1
  128. package/dist/types/src/containers/Deck/useDeckPlank.d.ts +49 -0
  129. package/dist/types/src/containers/Deck/useDeckPlank.d.ts.map +1 -0
  130. package/dist/types/src/containers/DeckLayout/DeckLayout.stories.d.ts +2 -2
  131. package/dist/types/src/containers/DeckLayout/DeckLayout.stories.d.ts.map +1 -1
  132. package/dist/types/src/containers/DeckLayout/Popover.d.ts.map +1 -1
  133. package/dist/types/src/{components → containers}/DeckSettings/DeckSettings.d.ts +1 -1
  134. package/dist/types/src/containers/DeckSettings/DeckSettings.d.ts.map +1 -0
  135. package/dist/types/src/{components → containers}/DeckSettings/DeckSettings.stories.d.ts +2 -2
  136. package/dist/types/src/{components → containers}/DeckSettings/DeckSettings.stories.d.ts.map +1 -1
  137. package/dist/types/src/containers/DeckSettings/index.d.ts.map +1 -0
  138. package/dist/types/src/containers/Sidebar/ComplementarySidebar.d.ts.map +1 -1
  139. package/dist/types/src/containers/index.d.ts +1 -1
  140. package/dist/types/src/containers/index.d.ts.map +1 -1
  141. package/dist/types/src/hooks/index.d.ts +2 -0
  142. package/dist/types/src/hooks/index.d.ts.map +1 -1
  143. package/dist/types/src/hooks/useCompanionSplit.d.ts +28 -0
  144. package/dist/types/src/hooks/useCompanionSplit.d.ts.map +1 -0
  145. package/dist/types/src/hooks/useCompanions.d.ts +11 -7
  146. package/dist/types/src/hooks/useCompanions.d.ts.map +1 -1
  147. package/dist/types/src/hooks/useDeckCompanions.d.ts +2 -2
  148. package/dist/types/src/hooks/useDeckCompanions.d.ts.map +1 -1
  149. package/dist/types/src/hooks/useDeckState.d.ts +1 -1
  150. package/dist/types/src/hooks/useDeckState.d.ts.map +1 -1
  151. package/dist/types/src/hooks/useSelectedCompanionVariant.d.ts +6 -0
  152. package/dist/types/src/hooks/useSelectedCompanionVariant.d.ts.map +1 -0
  153. package/dist/types/src/index.d.ts +1 -0
  154. package/dist/types/src/index.d.ts.map +1 -1
  155. package/dist/types/src/meta.d.ts +32 -2
  156. package/dist/types/src/meta.d.ts.map +1 -1
  157. package/dist/types/src/operations/adjust.d.ts.map +1 -1
  158. package/dist/types/src/operations/open.d.ts.map +1 -1
  159. package/dist/types/src/operations/switch-workspace.d.ts.map +1 -1
  160. package/dist/types/src/operations/update-companion.d.ts.map +1 -1
  161. package/dist/types/src/translations.d.ts +2 -2
  162. package/dist/types/src/translations.d.ts.map +1 -1
  163. package/dist/types/src/types/DeckCapabilities.d.ts +4 -4
  164. package/dist/types/src/types/DeckCapabilities.d.ts.map +1 -1
  165. package/dist/types/src/types/DeckOperation.d.ts +2 -2
  166. package/dist/types/src/types/DeckOperation.d.ts.map +1 -1
  167. package/dist/types/src/types/index.d.ts +1 -0
  168. package/dist/types/src/types/index.d.ts.map +1 -1
  169. package/dist/types/src/types/schema.d.ts +11 -9
  170. package/dist/types/src/types/schema.d.ts.map +1 -1
  171. package/dist/types/src/types/surface.d.ts +12 -0
  172. package/dist/types/src/types/surface.d.ts.map +1 -0
  173. package/dist/types/src/util/companion-view-state.d.ts +16 -0
  174. package/dist/types/src/util/companion-view-state.d.ts.map +1 -0
  175. package/dist/types/src/util/index.d.ts +1 -0
  176. package/dist/types/src/util/index.d.ts.map +1 -1
  177. package/dist/types/src/util/plank-url-params.d.ts +2 -0
  178. package/dist/types/src/util/plank-url-params.d.ts.map +1 -1
  179. package/dist/types/tsconfig.tsbuildinfo +1 -1
  180. package/dx.config.ts +35 -0
  181. package/package.json +50 -48
  182. package/src/DeckPlugin.test.ts +1 -1
  183. package/src/DeckPlugin.ts +2 -3
  184. package/src/capabilities/app-graph-builder.ts +7 -6
  185. package/src/capabilities/check-app-scheme.ts +3 -3
  186. package/src/capabilities/notification-tracker.ts +11 -9
  187. package/src/capabilities/react-root.tsx +1 -1
  188. package/src/capabilities/react-surface.tsx +4 -5
  189. package/src/capabilities/settings.ts +2 -2
  190. package/src/capabilities/state.ts +1 -1
  191. package/src/capabilities/url-handler.ts +7 -15
  192. package/src/components/Companion/Companion.tsx +91 -0
  193. package/src/components/Companion/index.ts +5 -0
  194. package/src/components/Matrix/Matrix.stories.tsx +15 -27
  195. package/src/components/Matrix/Matrix.tsx +3 -3
  196. package/src/components/Matrix/SPEC.md +1 -1
  197. package/src/components/Matrix/index.ts +1 -1
  198. package/src/components/Pane/Pane.stories.tsx +92 -0
  199. package/src/components/Pane/Pane.tsx +178 -0
  200. package/src/components/Pane/index.ts +5 -0
  201. package/src/components/Plank/Plank.stories.tsx +103 -0
  202. package/src/components/Plank/Plank.tsx +149 -0
  203. package/src/components/Plank/index.ts +5 -0
  204. package/src/components/index.ts +3 -4
  205. package/src/containers/Deck/Banner.tsx +5 -4
  206. package/src/containers/Deck/Deck.tsx +3 -3
  207. package/src/containers/Deck/DeckPlank.tsx +187 -0
  208. package/src/containers/Deck/DeckViewport.tsx +118 -246
  209. package/src/containers/{Plank → Deck}/PlankControls.tsx +21 -19
  210. package/src/containers/Deck/PlankFallback.tsx +42 -0
  211. package/src/containers/Deck/StatusBar.tsx +4 -2
  212. package/src/containers/Deck/useDeckPlank.ts +219 -0
  213. package/src/containers/DeckLayout/DeckLayout.stories.tsx +44 -60
  214. package/src/containers/DeckLayout/Dialog.tsx +1 -1
  215. package/src/containers/DeckLayout/Fallback.tsx +1 -1
  216. package/src/containers/DeckLayout/Popover.tsx +37 -20
  217. package/src/containers/DeckLayout/Toast.tsx +1 -1
  218. package/src/{components → containers}/DeckSettings/DeckSettings.stories.tsx +1 -1
  219. package/src/containers/DeckSettings/DeckSettings.tsx +42 -0
  220. package/src/containers/Sidebar/ComplementarySidebar.tsx +8 -7
  221. package/src/containers/Sidebar/Sidebar.tsx +1 -1
  222. package/src/containers/Sidebar/SidebarButton.tsx +3 -3
  223. package/src/containers/index.ts +1 -1
  224. package/src/hooks/index.ts +2 -0
  225. package/src/hooks/useCompanionSplit.ts +78 -0
  226. package/src/hooks/useCompanions.ts +39 -7
  227. package/src/hooks/useDeckCompanions.ts +3 -3
  228. package/src/hooks/useDeckState.ts +1 -1
  229. package/src/hooks/useSelectedCompanionVariant.ts +14 -0
  230. package/src/index.ts +7 -0
  231. package/src/meta.ts +2 -27
  232. package/src/operations/adjust.ts +23 -12
  233. package/src/operations/open.ts +12 -10
  234. package/src/operations/switch-workspace.ts +2 -2
  235. package/src/operations/update-companion.ts +10 -6
  236. package/src/translations.ts +3 -3
  237. package/src/types/DeckCapabilities.ts +6 -4
  238. package/src/types/DeckEvents.ts +1 -1
  239. package/src/types/DeckOperation.ts +3 -2
  240. package/src/types/index.ts +1 -0
  241. package/src/types/schema.ts +21 -16
  242. package/src/types/surface.ts +28 -0
  243. package/src/util/companion-view-state.ts +28 -0
  244. package/src/util/index.ts +1 -0
  245. package/src/util/plank-url-params.test.ts +5 -0
  246. package/src/util/plank-url-params.ts +5 -3
  247. package/src/util/sanitize-persisted-state.test.ts +1 -1
  248. package/src/util/set-active.test.ts +1 -1
  249. package/dist/lib/neutral/DeckLayout-DEURA3KR.mjs.map +0 -7
  250. package/dist/lib/neutral/DeckSettings-W5I57OXM.mjs +0 -27
  251. package/dist/lib/neutral/DeckSettings-W5I57OXM.mjs.map +0 -7
  252. package/dist/lib/neutral/adjust-HNU5CCRO.mjs.map +0 -7
  253. package/dist/lib/neutral/app-graph-builder-HMLT627T.mjs.map +0 -7
  254. package/dist/lib/neutral/chunk-324PPIZB.mjs.map +0 -7
  255. package/dist/lib/neutral/chunk-BS4EOYMK.mjs.map +0 -7
  256. package/dist/lib/neutral/chunk-GBIGQKYW.mjs.map +0 -7
  257. package/dist/lib/neutral/chunk-PYEY5SEC.mjs +0 -37
  258. package/dist/lib/neutral/chunk-PYEY5SEC.mjs.map +0 -7
  259. package/dist/lib/neutral/chunk-Q4W6B4IB.mjs +0 -8
  260. package/dist/lib/neutral/chunk-WAXJPQJI.mjs +0 -1306
  261. package/dist/lib/neutral/chunk-WAXJPQJI.mjs.map +0 -7
  262. package/dist/lib/neutral/notification-tracker-P36322BH.mjs.map +0 -7
  263. package/dist/lib/neutral/open-5OYNO3RT.mjs.map +0 -7
  264. package/dist/lib/neutral/react-root-HH5DEUOG.mjs.map +0 -7
  265. package/dist/lib/neutral/react-surface-3UVVCK3O.mjs.map +0 -7
  266. package/dist/lib/neutral/settings-EGNYUM4T.mjs.map +0 -7
  267. package/dist/lib/neutral/state-IIDXMQUO.mjs.map +0 -7
  268. package/dist/lib/neutral/switch-workspace-LZF4KZXH.mjs.map +0 -7
  269. package/dist/lib/neutral/update-companion-YUCZZVGY.mjs.map +0 -7
  270. package/dist/lib/neutral/url-handler-A6HLW4RB.mjs.map +0 -7
  271. package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +0 -1
  272. package/dist/types/src/components/DeckSettings/index.d.ts.map +0 -1
  273. package/dist/types/src/containers/Plank/Plank.d.ts +0 -17
  274. package/dist/types/src/containers/Plank/Plank.d.ts.map +0 -1
  275. package/dist/types/src/containers/Plank/Plank.stories.d.ts +0 -67
  276. package/dist/types/src/containers/Plank/Plank.stories.d.ts.map +0 -1
  277. package/dist/types/src/containers/Plank/PlankComponent.d.ts +0 -17
  278. package/dist/types/src/containers/Plank/PlankComponent.d.ts.map +0 -1
  279. package/dist/types/src/containers/Plank/PlankContent.d.ts +0 -10
  280. package/dist/types/src/containers/Plank/PlankContent.d.ts.map +0 -1
  281. package/dist/types/src/containers/Plank/PlankControls.d.ts.map +0 -1
  282. package/dist/types/src/containers/Plank/PlankError.d.ts +0 -15
  283. package/dist/types/src/containers/Plank/PlankError.d.ts.map +0 -1
  284. package/dist/types/src/containers/Plank/PlankHeading.d.ts +0 -22
  285. package/dist/types/src/containers/Plank/PlankHeading.d.ts.map +0 -1
  286. package/dist/types/src/containers/Plank/PlankLoading.d.ts +0 -3
  287. package/dist/types/src/containers/Plank/PlankLoading.d.ts.map +0 -1
  288. package/dist/types/src/containers/Plank/PlankRoot.d.ts +0 -37
  289. package/dist/types/src/containers/Plank/PlankRoot.d.ts.map +0 -1
  290. package/dist/types/src/containers/Plank/index.d.ts +0 -4
  291. package/dist/types/src/containers/Plank/index.d.ts.map +0 -1
  292. package/src/components/DeckSettings/DeckSettings.tsx +0 -34
  293. package/src/containers/Plank/Plank.stories.tsx +0 -108
  294. package/src/containers/Plank/Plank.tsx +0 -22
  295. package/src/containers/Plank/PlankComponent.tsx +0 -223
  296. package/src/containers/Plank/PlankContent.tsx +0 -45
  297. package/src/containers/Plank/PlankError.tsx +0 -82
  298. package/src/containers/Plank/PlankHeading.tsx +0 -237
  299. package/src/containers/Plank/PlankLoading.tsx +0 -10
  300. package/src/containers/Plank/PlankRoot.tsx +0 -49
  301. package/src/containers/Plank/index.ts +0 -7
  302. /package/dist/lib/neutral/{add-toast-TNB6DXWU.mjs.map → add-toast-BHNEH5UY.mjs.map} +0 -0
  303. /package/dist/lib/neutral/{check-app-scheme-INSOF72J.mjs.map → check-app-scheme-HSAORHHX.mjs.map} +0 -0
  304. /package/dist/lib/neutral/{chunk-Q4W6B4IB.mjs.map → chunk-FKGYHBUB.mjs.map} +0 -0
  305. /package/dist/lib/neutral/{revert-workspace-B2QLT2C4.mjs.map → revert-workspace-RXWP2TEE.mjs.map} +0 -0
  306. /package/dist/lib/neutral/{scroll-into-view-B52C3PJO.mjs.map → scroll-into-view-HFV5EGYZ.mjs.map} +0 -0
  307. /package/dist/lib/neutral/{set-layout-mode-RPCCPQRB.mjs.map → set-layout-mode-XAGSZZGB.mjs.map} +0 -0
  308. /package/dist/lib/neutral/{update-complementary-7FZNB55J.mjs.map → update-complementary-K55I5EV5.mjs.map} +0 -0
  309. /package/dist/lib/neutral/{update-dialog-FNQTSSAP.mjs.map → update-dialog-Z3GEXMVV.mjs.map} +0 -0
  310. /package/dist/lib/neutral/{update-plank-size-3YW4NXEY.mjs.map → update-plank-size-BTESVV7N.mjs.map} +0 -0
  311. /package/dist/lib/neutral/{update-popover-G2VUD7E6.mjs.map → update-popover-QEVDSZSH.mjs.map} +0 -0
  312. /package/dist/lib/neutral/{update-sidebar-KRHPUHUB.mjs.map → update-sidebar-VSRCN47U.mjs.map} +0 -0
  313. /package/dist/types/src/{components → containers}/DeckSettings/index.d.ts +0 -0
  314. /package/src/{components → containers}/DeckSettings/index.ts +0 -0
@@ -1,67 +0,0 @@
1
- import { type StoryObj } from '@storybook/react-vite';
2
- import React from 'react';
3
- declare const meta: {
4
- title: string;
5
- component: () => React.JSX.Element;
6
- decorators: import("@storybook/react").Decorator[];
7
- parameters: {
8
- layout: string;
9
- translations: [{
10
- readonly 'en-US': {
11
- readonly [x: string]: {
12
- readonly 'plugin.name': 'Deck';
13
- readonly 'settings.title': 'Deck settings';
14
- readonly 'main-header.label': 'Main header';
15
- readonly 'open-navigation-sidebar.label': 'Open sidebar';
16
- readonly 'collapse-navigation-sidebar.label': 'Close sidebar';
17
- readonly 'open-complementary-sidebar.label': 'Open context sidebar';
18
- readonly 'close-complementary-sidebar.label': 'Close context sidebar';
19
- readonly 'sidebar.title': 'Navigation sidebar';
20
- readonly 'complementary-sidebar.title': 'Context sidebar';
21
- readonly 'plugin-error.message': 'Content failed to render.';
22
- readonly 'content-fallback.message': 'Unsupported';
23
- readonly 'content-fallback.description': 'No plugin had a response for the address you navigated\u00A0to. Double-check the URL, and ensure you\u2019ve enabled a plugin that supports the\u00A0object.';
24
- readonly 'toggle-fullscreen.label': 'Toggle fullscreen';
25
- readonly 'undo-available.label': 'Click to undo previous action.';
26
- readonly 'undo-action.label': 'Undo';
27
- readonly 'undo-action.alt': 'Undo previous action';
28
- readonly 'undo-close.label': 'Dismiss';
29
- readonly 'error-fallback.message': 'Unable to open this object';
30
- readonly 'error-fallback.copy.label': 'Copy';
31
- readonly 'plank-heading-fallback.label': 'Untitled';
32
- readonly 'actions-menu.label': 'Options';
33
- readonly 'settings.deck.label': 'Disable deck';
34
- readonly 'pending.heading': 'Loading\u2026';
35
- readonly 'insert-plank.label': 'Open';
36
- readonly 'resize.label': 'Drag to resize';
37
- readonly 'pin-start.label': 'Pin to the left sidebar';
38
- readonly 'pin-end.label': 'Pin to the right sidebar';
39
- readonly 'increment-start.label': 'Move to the left';
40
- readonly 'increment-end.label': 'Move to the right';
41
- readonly 'show-deck-plank.label': 'Return to deck';
42
- readonly 'show-solo-plank.label': 'Maximize';
43
- readonly 'exit-fullscreen.label': 'Exit fullscreen';
44
- readonly 'show-fullscreen-plank.label': 'Fullscreen';
45
- readonly 'close.label': 'Close';
46
- readonly 'minify.label': 'Minify';
47
- readonly 'open-companion.label': 'Open companion';
48
- readonly 'close-companion.label': 'Close companion';
49
- readonly 'close-current.label': 'Close current plank';
50
- readonly 'close-others.label': 'Close other planks';
51
- readonly 'close-all.label': 'Close all planks';
52
- readonly 'close-navigation-sidebar.button': 'Close';
53
- readonly 'companion-plank-heading-fallback.label': 'Related';
54
- readonly 'popover-no-preview.message': 'No preview available.';
55
- readonly 'plugin-failure.title': 'A plugin failed to activate';
56
- readonly 'plugin-failure.description': 'See Plugin Registry for details.';
57
- readonly 'plugin-failure-action.label': 'Open Registry';
58
- readonly 'plugin-failure-action.alt': 'Open Plugin Registry';
59
- };
60
- };
61
- }];
62
- };
63
- };
64
- export default meta;
65
- type Story = StoryObj<typeof meta>;
66
- export declare const Default: Story;
67
- //# sourceMappingURL=Plank.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Plank.stories.d.ts","sourceRoot":"","sources":["../../../../../src/containers/Plank/Plank.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAkB,MAAM,OAAO,CAAC;AAkFvC,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAc2B,CAAC;eAEvB,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
@@ -1,17 +0,0 @@
1
- import React from 'react';
2
- import { type Node } from '@dxos/plugin-graph';
3
- import { PlankRootProps } from './PlankRoot';
4
- export declare const DEFAULT_SIZE = 48;
5
- export declare const DEFAULT_COMPANION_SIZE = 35;
6
- export type PlankComponentProps = Pick<PlankRootProps, 'part'> & {
7
- id: string;
8
- path?: string[];
9
- order?: number;
10
- active?: string[];
11
- node?: Node.Node;
12
- primary?: Node.Node;
13
- companions?: Node.Node[];
14
- companioned?: 'primary' | 'companion';
15
- };
16
- export declare const PlankComponent: React.MemoExoticComponent<({ part, id, path, order, active, node, primary, companions, companioned }: PlankComponentProps) => React.JSX.Element>;
17
- //# sourceMappingURL=PlankComponent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PlankComponent.d.ts","sourceRoot":"","sources":["../../../../../src/containers/Plank/PlankComponent.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAkF,MAAM,OAAO,CAAC;AAKvG,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAa/C,OAAO,EAAE,cAAc,EAAmB,MAAM,aAAa,CAAC;AAyB9D,eAAO,MAAM,YAAY,KAA6B,CAAC;AACvD,eAAO,MAAM,sBAAsB,KAA6B,CAAC;AAEjE,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,GAAG;IAC/D,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC;IACjB,OAAO,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;IACzB,WAAW,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;CACvC,CAAC;AAEF,eAAO,MAAM,cAAc,wGACmD,mBAAmB,uBA+JhG,CAAC"}
@@ -1,10 +0,0 @@
1
- import React, { type PropsWithChildren } from 'react';
2
- export type PlankContentProps = PropsWithChildren<{
3
- solo: boolean;
4
- companion: boolean;
5
- encapsulate: boolean;
6
- }>;
7
- export declare const PlankContent: React.ForwardRefExoticComponent<Omit<PlankContentProps, "className"> & {
8
- classNames?: import("@dxos/ui-types").ClassNameValue;
9
- } & Pick<React.HTMLAttributes<Element>, "children" | "className" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
10
- //# sourceMappingURL=PlankContent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PlankContent.d.ts","sourceRoot":"","sources":["../../../../../src/containers/Plank/PlankContent.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAOtD,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,CAAC;IAChD,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC,CAAC;AAEH,eAAO,MAAM,YAAY;;2HA2BxB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PlankControls.d.ts","sourceRoot":"","sources":["../../../../../src/containers/Plank/PlankControls.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAkC,MAAM,OAAO,CAAC;AAIvD,OAAO,EAAe,KAAK,gBAAgB,EAAgD,MAAM,gBAAgB,CAAC;AAGlH,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,QAAQ,CAAC;AAE1D,MAAM,MAAM,mBAAmB,GAAG,CAAC,KAAK,EAAE,UAAU,CAAC,cAAc,KAAK,IAAI,CAAC;AAE7E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAQF,MAAM,MAAM,2BAA2B,GAAG;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,sBAAsB,oGAmBlC,CAAC;AAUF,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,GAAG;IACnE,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC;IACtC,KAAK,CAAC,EAAE,OAAO,GAAG,cAAc,GAAG,YAAY,CAAC;IAChD,YAAY,EAAE,iBAAiB,CAAC;IAChC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,GAAG,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;CAChC,CAAC;AAKF,eAAO,MAAM,aAAa,wGAyGzB,CAAC"}
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import { type Node } from '@dxos/plugin-graph';
3
- import { type ErrorFallbackProps } from '@dxos/react-ui';
4
- import { type PlankHeadingProps } from './PlankHeading';
5
- export declare const PlankError: ({ id, part, node, error: errorProp, }: {
6
- id: string;
7
- part: PlankHeadingProps['part'];
8
- node?: Node.Node;
9
- error?: Error;
10
- }) => React.JSX.Element;
11
- /**
12
- * User facing error fallback.
13
- */
14
- export declare const PlankErrorFallback: ({ error }: ErrorFallbackProps) => React.JSX.Element;
15
- //# sourceMappingURL=PlankError.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PlankError.d.ts","sourceRoot":"","sources":["../../../../../src/containers/Plank/PlankError.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAI5D,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAiB,KAAK,kBAAkB,EAAkB,MAAM,gBAAgB,CAAC;AAKxF,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGtE,eAAO,MAAM,UAAU,0CAKpB;IACD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAChC,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC;IACjB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,sBAqBA,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,cAAe,kBAAkB,sBA4B/D,CAAC"}
@@ -1,22 +0,0 @@
1
- import React from 'react';
2
- import { type Node } from '@dxos/plugin-graph';
3
- import { type StackItemSigilAction } from '@dxos/react-ui-stack';
4
- import { type LayoutMode, type ResolvedPart } from '#types';
5
- export type PlankHeadingProps = {
6
- id: string;
7
- part: ResolvedPart;
8
- layoutMode?: LayoutMode;
9
- node?: Node.Node;
10
- deckEnabled?: boolean;
11
- canIncrementStart?: boolean;
12
- canIncrementEnd?: boolean;
13
- popoverAnchorId?: string;
14
- primaryId?: string;
15
- pending?: boolean;
16
- companioned?: 'primary' | 'companion';
17
- companions?: Node.Node[];
18
- actions?: StackItemSigilAction[];
19
- debug?: boolean;
20
- };
21
- export declare const PlankHeading: React.MemoExoticComponent<({ id, part, node, deckEnabled, canIncrementStart, canIncrementEnd, popoverAnchorId, primaryId, pending, companioned, companions, layoutMode, actions, debug, }: PlankHeadingProps) => React.JSX.Element>;
22
- //# sourceMappingURL=PlankHeading.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PlankHeading.d.ts","sourceRoot":"","sources":["../../../../../src/containers/Plank/PlankHeading.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA2E,MAAM,OAAO,CAAC;AAIhG,OAAO,EAAS,KAAK,IAAI,EAAmB,MAAM,oBAAoB,CAAC;AAGvE,OAAO,EAAa,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAO5E,OAAO,EAAE,KAAK,UAAU,EAAwB,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAC;AAOlF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,YAAY,CAAC;IACnB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;IACtC,UAAU,CAAC,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;IACzB,OAAO,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACjC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,YAAY,6LAgBpB,iBAAiB,uBAkLrB,CAAC"}
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- export declare const PlankLoading: () => React.JSX.Element;
3
- //# sourceMappingURL=PlankLoading.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PlankLoading.d.ts","sourceRoot":"","sources":["../../../../../src/containers/Plank/PlankLoading.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,eAAO,MAAM,YAAY,yBAExB,CAAC"}
@@ -1,37 +0,0 @@
1
- import React, { PropsWithChildren } from 'react';
2
- import { type Graph } from '@dxos/plugin-graph';
3
- import { type DeckOperation } from '#types';
4
- import { type LayoutMode, type PlankSizing, type ResolvedPart, type Settings } from '#types';
5
- export type PlankContextValue = {
6
- /** The application graph. */
7
- graph: Graph.ExpandableGraph;
8
- /** Which part of the layout this plank occupies. */
9
- part: ResolvedPart;
10
- /** Current layout mode. */
11
- layoutMode: LayoutMode;
12
- /** Deck settings. */
13
- settings?: Settings.Settings;
14
- /** Popover anchor ID for heading menus. */
15
- popoverAnchorId?: string;
16
- /** ID of plank that should be scrolled into view. */
17
- scrollIntoView?: string;
18
- /** Persisted plank sizes keyed by plank ID. */
19
- plankSizing?: PlankSizing;
20
- /** Callback for plank adjustments (close, solo, increment, companion). */
21
- onAdjust?: (id: string, type: DeckOperation.PartAdjustment) => void;
22
- /** Callback for plank resize. */
23
- onResize?: (id: string, size: number) => void;
24
- /** Callback to clear scroll-into-view state. */
25
- onScrollIntoView?: (id?: string) => void;
26
- /** Callback to update the companion. */
27
- onUpdateCompanion?: (companion: string | null) => void;
28
- };
29
- export declare const PlankProvider: React.FC<PlankContextValue & {
30
- children: React.ReactNode;
31
- }>, usePlankContext: (consumerName: string) => PlankContextValue;
32
- export type PlankRootProps = PropsWithChildren<PlankContextValue>;
33
- /**
34
- * Headless root that provides plank context.
35
- */
36
- export declare const PlankRoot: ({ children, ...context }: PlankRootProps) => React.JSX.Element;
37
- //# sourceMappingURL=PlankRoot.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PlankRoot.d.ts","sourceRoot":"","sources":["../../../../../src/containers/Plank/PlankRoot.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAI7F,MAAM,MAAM,iBAAiB,GAAG;IAC9B,6BAA6B;IAC7B,KAAK,EAAE,KAAK,CAAC,eAAe,CAAC;IAC7B,oDAAoD;IACpD,IAAI,EAAE,YAAY,CAAC;IACnB,2BAA2B;IAC3B,UAAU,EAAE,UAAU,CAAC;IACvB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAC7B,2CAA2C;IAC3C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qDAAqD;IACrD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,+CAA+C;IAC/C,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,CAAC,cAAc,KAAK,IAAI,CAAC;IACpE,iCAAiC;IACjC,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,gDAAgD;IAChD,gBAAgB,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,wCAAwC;IACxC,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACxD,CAAC;AAEF,eAAO,MAAO,aAAa;;IAAE,eAAe,6CAAgD,CAAC;AAE7F,MAAM,MAAM,cAAc,GAAG,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;AAElE;;GAEG;AACH,eAAO,MAAM,SAAS,6BAA8B,cAAc,sBAEjE,CAAC"}
@@ -1,4 +0,0 @@
1
- export * from './Plank';
2
- export * from './PlankError';
3
- export * from './PlankLoading';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/containers/Plank/index.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
@@ -1,34 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
-
5
- import React from 'react';
6
-
7
- import { type AppSurface } from '@dxos/app-toolkit/ui';
8
- import { useTranslation } from '@dxos/react-ui';
9
- import { Settings as SettingsForm } from '@dxos/react-ui-form';
10
-
11
- import { meta } from '#meta';
12
- import { Settings } from '#types';
13
-
14
- const isSocket = !!(globalThis as any).__args;
15
-
16
- export type DeckSettingsProps = AppSurface.SettingsArticleProps<Settings.Settings>;
17
-
18
- export const DeckSettings = ({ settings, onSettingsChange }: DeckSettingsProps) => {
19
- const { t } = useTranslation(meta.id);
20
-
21
- return (
22
- <SettingsForm.Viewport>
23
- <SettingsForm.Section title={t('settings.title', { ns: meta.id })}>
24
- <SettingsForm.FieldSet
25
- readonly={!onSettingsChange}
26
- schema={Settings.Settings}
27
- visible={(path) => path !== 'enableNativeRedirect' || !isSocket}
28
- values={settings}
29
- onValuesChanged={(values) => onSettingsChange?.(() => values)}
30
- />
31
- </SettingsForm.Section>
32
- </SettingsForm.Viewport>
33
- );
34
- };
@@ -1,108 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { type Meta, type StoryObj } from '@storybook/react-vite';
6
- import React, { useMemo } from 'react';
7
-
8
- import { Capabilities, Capability, Plugin } from '@dxos/app-framework';
9
- import { withPluginManager } from '@dxos/app-framework/testing';
10
- import { Surface } from '@dxos/app-framework/ui';
11
- import { AppActivationEvents } from '@dxos/app-toolkit';
12
- import { useAppGraph } from '@dxos/app-toolkit/ui';
13
- import { corePlugins } from '@dxos/plugin-testing';
14
- import { random } from '@dxos/random';
15
- import { Main } from '@dxos/react-ui';
16
- import { StackContext } from '@dxos/react-ui-stack';
17
- import { Syntax } from '@dxos/react-ui-syntax-highlighter';
18
- import { Loading } from '@dxos/react-ui/testing';
19
- import { Organization } from '@dxos/types';
20
-
21
- import { DeckSettings, DeckState } from '#capabilities';
22
- import { meta as pluginMeta } from '#meta';
23
- import { translations } from '#translations';
24
-
25
- import { Plank } from './Plank';
26
-
27
- const TestPlugin = Plugin.define(pluginMeta).pipe(
28
- Plugin.addModule({
29
- activatesOn: AppActivationEvents.SetupSettings,
30
- activate: DeckSettings,
31
- }),
32
- Plugin.addModule({
33
- id: Capability.getModuleTag(DeckState),
34
- activatesOn: AppActivationEvents.AppGraphReady,
35
- activate: () => DeckState(),
36
- }),
37
- Plugin.make,
38
- );
39
-
40
- random.seed(101);
41
-
42
- const storySurfaceExtension = Capability.contributes(
43
- Capabilities.ReactSurface,
44
- Surface.create({
45
- id: 'storyArticle',
46
- role: 'article',
47
- component: ({ data }) => {
48
- const subject = (data as any)?.subject;
49
- if (!subject) {
50
- return <Loading />;
51
- }
52
-
53
- return (
54
- <Syntax.Root data={subject}>
55
- <Syntax.Content>
56
- <Syntax.Viewport>
57
- <Syntax.Code />
58
- </Syntax.Viewport>
59
- </Syntax.Content>
60
- </Syntax.Root>
61
- );
62
- },
63
- }),
64
- );
65
-
66
- const DefaultStory = () => {
67
- const { graph } = useAppGraph();
68
- const item = useMemo(() => Organization.make({ name: random.company.name() }), []);
69
- const node = useMemo(() => ({ id: item.id, data: item, type: 'test', properties: { label: item.name } }), [item]);
70
-
71
- return (
72
- <Main.Root>
73
- <Main.Content bounce handlesFocus classNames='grid' style={{ '--main-spacing': '0' } as any}>
74
- <div className='relative overflow-hidden bg-deck-surface'>
75
- <StackContext.Provider value={{ orientation: 'horizontal', size: 'contain', rail: true }}>
76
- <Plank.Root graph={graph} part='solo' layoutMode='solo'>
77
- <Plank.Content solo companion={false} encapsulate={false}>
78
- <Plank.Component id={item.id} part='solo-primary' node={node as any} />
79
- </Plank.Content>
80
- </Plank.Root>
81
- </StackContext.Provider>
82
- </div>
83
- </Main.Content>
84
- </Main.Root>
85
- );
86
- };
87
-
88
- const meta = {
89
- title: 'plugins/plugin-deck/containers/Plank',
90
- component: DefaultStory,
91
- decorators: [
92
- withPluginManager({
93
- plugins: [...corePlugins(), TestPlugin()],
94
- capabilities: [storySurfaceExtension],
95
- setupEvents: [AppActivationEvents.SetupSettings],
96
- }),
97
- ],
98
- parameters: {
99
- layout: 'fullscreen',
100
- translations,
101
- },
102
- } satisfies Meta<typeof DefaultStory>;
103
-
104
- export default meta;
105
-
106
- type Story = StoryObj<typeof meta>;
107
-
108
- export const Default: Story = {};
@@ -1,22 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
-
5
- import { PlankComponent, PlankComponentProps } from './PlankComponent';
6
- import { PlankContent, PlankContentProps } from './PlankContent';
7
- import { PlankControls } from './PlankControls';
8
- import { PlankHeading } from './PlankHeading';
9
- import { PlankRoot, PlankRootProps } from './PlankRoot';
10
-
11
- /**
12
- * Radix-style composite Plank component.
13
- */
14
- export const Plank = {
15
- Root: PlankRoot,
16
- Content: PlankContent,
17
- Component: PlankComponent,
18
- Heading: PlankHeading,
19
- Controls: PlankControls,
20
- };
21
-
22
- export type { PlankRootProps, PlankComponentProps, PlankContentProps };
@@ -1,223 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
-
5
- import { useFocusFinders } from '@fluentui/react-tabster';
6
- import React, { type KeyboardEvent, memo, useCallback, useLayoutEffect, useMemo, useRef } from 'react';
7
-
8
- import { Surface } from '@dxos/app-framework/ui';
9
- import { AppSurface } from '@dxos/app-toolkit/ui';
10
- import { debounce } from '@dxos/async';
11
- import { type Node } from '@dxos/plugin-graph';
12
- import { mainIntrinsicSize } from '@dxos/react-ui';
13
- import { getLinkedVariant } from '@dxos/react-ui-attention';
14
- import { useAttentionAttributes } from '@dxos/react-ui-attention';
15
- import { StackItem, type StackItemSize, railGridHorizontal } from '@dxos/react-ui-stack';
16
- import { mx } from '@dxos/ui-theme';
17
-
18
- import { useMainSize } from '#hooks';
19
- import { PLANK_COMPANION_TYPE } from '#types';
20
-
21
- import { PlankError, PlankErrorFallback } from './PlankError';
22
- import { PlankHeading } from './PlankHeading';
23
- import { PlankLoading } from './PlankLoading';
24
- import { PlankRootProps, usePlankContext } from './PlankRoot';
25
-
26
- /**
27
- * JS-based smooth scroll that won't be interrupted by MutationObserver or layout changes.
28
- */
29
- const smoothScrollTo = (element: HTMLElement, target: number, duration: number) => {
30
- const start = element.scrollLeft;
31
- const distance = target - start;
32
- const startTime = performance.now();
33
-
34
- const step = (currentTime: number) => {
35
- const elapsed = currentTime - startTime;
36
- const progress = Math.min(elapsed / duration, 1);
37
- // Ease-out cubic.
38
- const eased = 1 - Math.pow(1 - progress, 3);
39
- element.scrollLeft = start + distance * eased;
40
- if (progress < 1) {
41
- requestAnimationFrame(step);
42
- }
43
- };
44
-
45
- requestAnimationFrame(step);
46
- };
47
-
48
- // NOTE: Calibrated to show PLANK + COMPANION on MBP 16" screen.
49
- export const DEFAULT_SIZE = 48 satisfies StackItemSize;
50
- export const DEFAULT_COMPANION_SIZE = 35 satisfies StackItemSize;
51
-
52
- export type PlankComponentProps = Pick<PlankRootProps, 'part'> & {
53
- id: string;
54
- path?: string[];
55
- order?: number;
56
- active?: string[];
57
- node?: Node.Node;
58
- primary?: Node.Node;
59
- companions?: Node.Node[];
60
- companioned?: 'primary' | 'companion';
61
- };
62
-
63
- export const PlankComponent = memo(
64
- ({ part, id, path, order, active, node, primary, companions, companioned }: PlankComponentProps) => {
65
- const { layoutMode, settings, popoverAnchorId, scrollIntoView, plankSizing, onResize, onScrollIntoView } =
66
- usePlankContext('PlankComponent');
67
-
68
- const canResize = layoutMode === 'multi';
69
- const { findFirstFocusable } = useFocusFinders();
70
- const isCompanion = companioned === 'companion';
71
- // Companions share attention with their primary; non-companions key attention to their own id.
72
- const attentionId = isCompanion ? (primary?.id ?? id) : id;
73
- const attentionAttrs = useAttentionAttributes(attentionId);
74
- const orderId = isCompanion ? primary?.id : id;
75
- const index = orderId && active ? active.findIndex((entryId) => entryId === orderId) : -1;
76
- const length = active?.length ?? 1;
77
- const isOrdered = !!active && index >= 0;
78
- const canIncrementStart = isOrdered && index > 0;
79
- const canIncrementEnd = isOrdered && index < length - 1;
80
- const rootElement = useRef<HTMLDivElement | null>(null);
81
- const variant = node?.type === PLANK_COMPANION_TYPE ? getLinkedVariant(id) : undefined;
82
-
83
- // Sizing.
84
- const sizeAttrs = useMainSize();
85
- const sizeKey = id.split('+')[0];
86
- const size = isCompanion
87
- ? DEFAULT_COMPANION_SIZE
88
- : ((plankSizing?.[sizeKey] as number | undefined) ?? DEFAULT_SIZE);
89
- const handleSizeChange = useCallback(
90
- debounce((nextSize: number) => {
91
- const size = Math.round(nextSize);
92
- onResize?.(sizeKey, size);
93
- }, 200),
94
- [sizeKey, onResize],
95
- );
96
-
97
- // TODO(thure): Tabster's focus group should handle moving focus to Main, but something is blocking it.
98
- const handleKeyDown = useCallback((event: KeyboardEvent) => {
99
- if (event.target === event.currentTarget) {
100
- switch (event.key) {
101
- case 'Escape':
102
- rootElement.current?.closest('main')?.focus();
103
- break;
104
- case 'Enter':
105
- rootElement.current && findFirstFocusable(rootElement.current)?.focus();
106
- break;
107
- }
108
- }
109
- }, []);
110
-
111
- useLayoutEffect(() => {
112
- if (scrollIntoView === id && layoutMode === 'multi' && rootElement.current) {
113
- const element = rootElement.current;
114
- const scrollParent = element.closest('[style*="overflow"], .overflow-x-auto') as HTMLElement | null;
115
- if (scrollParent) {
116
- const elementRect = element.getBoundingClientRect();
117
- const parentRect = scrollParent.getBoundingClientRect();
118
- const targetScrollLeft = scrollParent.scrollLeft + (elementRect.left - parentRect.left);
119
-
120
- smoothScrollTo(scrollParent, targetScrollLeft, 300);
121
- }
122
-
123
- onScrollIntoView?.(undefined);
124
- }
125
- }, [id, scrollIntoView, layoutMode, onScrollIntoView]);
126
-
127
- const isSolo = layoutMode.startsWith('solo') && part === 'solo';
128
- const isAttendable =
129
- (layoutMode.startsWith('solo') && part.startsWith('solo')) || (layoutMode === 'multi' && part === 'multi');
130
-
131
- // Companions share attention with their primary, so they attend to the primary's id
132
- // (matching the plank's attention container, which keys to `primary?.id ?? id`).
133
- const attendableId = isCompanion ? (primary?.id ?? id) : id;
134
- const data = useMemo<AppSurface.ArticleData | undefined>(
135
- () =>
136
- node && {
137
- attendableId,
138
- subject: node.data,
139
- companionTo: primary?.data,
140
- properties: node.properties,
141
- variant,
142
- path,
143
- popoverAnchorId,
144
- },
145
- [node, node?.data, node?.properties, path, popoverAnchorId, primary?.data, variant, attendableId],
146
- );
147
-
148
- // TODO(wittjosiah): Change prop to accept a component.
149
- const placeholder = useMemo(() => <PlankLoading />, []);
150
-
151
- const Root = part.startsWith('solo') ? 'article' : StackItem.Root;
152
- const fullscreen = layoutMode === 'solo--fullscreen';
153
- const classNames = [
154
- 'dx-attention-surface relative dx-focus-ring-inset-over-all dx-density-lg',
155
- isSolo && 'absolute inset-0',
156
- isSolo && mainIntrinsicSize,
157
- railGridHorizontal,
158
- part.startsWith('solo') && 'grid',
159
- part.startsWith('solo-') && 'grid-rows-subgrid row-span-2 min-w-0',
160
- fullscreen && 'grid-rows-1',
161
- part === 'multi' && (isCompanion ? 'border-separator! border-e' : 'border-separator! border-x'),
162
- part === 'solo-companion' && 'border-separator! border-s',
163
- settings?.encapsulatedPlanks &&
164
- !part.startsWith('solo') &&
165
- 'mx-(--main-spacing) border-separator! border rounded-sm overflow-hidden',
166
- ];
167
-
168
- return (
169
- <Root
170
- ref={rootElement}
171
- data-testid='deck.plank'
172
- data-popover-collision-boundary={true}
173
- tabIndex={0}
174
- {...(part.startsWith('solo')
175
- ? ({
176
- className: mx(classNames),
177
- ...sizeAttrs,
178
- } as any)
179
- : {
180
- role: 'article',
181
- item: { id },
182
- classNames,
183
- order,
184
- size,
185
- onSizeChange: handleSizeChange,
186
- })}
187
- {...(isAttendable ? attentionAttrs : {})}
188
- onKeyDown={handleKeyDown}
189
- >
190
- {node ? (
191
- <>
192
- {!fullscreen && (
193
- <PlankHeading
194
- id={id}
195
- part={part.startsWith('solo-') ? 'solo' : part}
196
- node={node}
197
- layoutMode={layoutMode}
198
- deckEnabled={settings?.enableDeck}
199
- canIncrementStart={canIncrementStart}
200
- canIncrementEnd={canIncrementEnd}
201
- popoverAnchorId={popoverAnchorId}
202
- primaryId={primary?.id}
203
- companioned={companioned}
204
- companions={companions}
205
- />
206
- )}
207
- <Surface.Surface
208
- key={node.id}
209
- type={AppSurface.Article}
210
- data={data}
211
- limit={1}
212
- fallback={PlankErrorFallback}
213
- placeholder={placeholder}
214
- />
215
- </>
216
- ) : (
217
- <PlankError id={id} part={part} />
218
- )}
219
- {canResize && <StackItem.ResizeHandle />}
220
- </Root>
221
- );
222
- },
223
- );
@@ -1,45 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
-
5
- import React, { type PropsWithChildren } from 'react';
6
-
7
- import { composable, composableProps, mainIntrinsicSize } from '@dxos/react-ui';
8
- import { railGridHorizontal } from '@dxos/react-ui-stack';
9
-
10
- import { useMainSize } from '#hooks';
11
-
12
- export type PlankContentProps = PropsWithChildren<{
13
- solo: boolean;
14
- companion: boolean;
15
- encapsulate: boolean;
16
- }>;
17
-
18
- export const PlankContent = composable<HTMLDivElement, PlankContentProps>(
19
- ({ children, solo, companion, encapsulate, ...props }, forwardedRef) => {
20
- const sizeAttrs = useMainSize();
21
- if (!solo) {
22
- return children;
23
- }
24
-
25
- return (
26
- <div
27
- {...sizeAttrs}
28
- {...composableProps(props, {
29
- role: 'none',
30
- classNames: [
31
- 'absolute inset-(--main-spacing) grid',
32
- railGridHorizontal,
33
- mainIntrinsicSize,
34
- companion && 'grid-cols-[6fr_4fr]', // Ration of primary to companion.
35
- encapsulate && 'border border-separator rounded-sm overflow-hidden',
36
- ],
37
- })}
38
- data-popover-collision-boundary={true}
39
- ref={forwardedRef}
40
- >
41
- {children}
42
- </div>
43
- );
44
- },
45
- );