@dxos/plugin-simple-layout 0.8.4-main.2244d791bb → 0.8.4-main.3fbcb4aa9b

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 (306) hide show
  1. package/dist/lib/neutral/SimpleLayoutPlugin.mjs +52 -0
  2. package/dist/lib/neutral/SimpleLayoutPlugin.mjs.map +7 -0
  3. package/dist/lib/neutral/app-graph-builder-EYQKLRRP.mjs +21 -0
  4. package/dist/lib/neutral/app-graph-builder-EYQKLRRP.mjs.map +7 -0
  5. package/dist/lib/neutral/capabilities/index.mjs +21 -0
  6. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  7. package/dist/lib/neutral/chunk-7UDV3JDT.mjs +22 -0
  8. package/dist/lib/neutral/chunk-7UDV3JDT.mjs.map +7 -0
  9. package/dist/lib/neutral/chunk-AMTEDJHG.mjs +19 -0
  10. package/dist/lib/neutral/chunk-AMTEDJHG.mjs.map +7 -0
  11. package/dist/lib/neutral/chunk-FD2CAY4Q.mjs +26 -0
  12. package/dist/lib/neutral/chunk-FD2CAY4Q.mjs.map +7 -0
  13. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
  14. package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
  15. package/dist/lib/neutral/chunk-XVUAQHKU.mjs +8 -0
  16. package/dist/lib/neutral/chunk-XVUAQHKU.mjs.map +7 -0
  17. package/dist/lib/neutral/close-WKMURGUB.mjs +35 -0
  18. package/dist/lib/neutral/close-WKMURGUB.mjs.map +7 -0
  19. package/dist/lib/neutral/components/index.mjs +924 -0
  20. package/dist/lib/neutral/components/index.mjs.map +7 -0
  21. package/dist/lib/neutral/hooks/index.mjs +332 -0
  22. package/dist/lib/neutral/hooks/index.mjs.map +7 -0
  23. package/dist/lib/neutral/index.mjs +14 -0
  24. package/dist/lib/neutral/index.mjs.map +7 -0
  25. package/dist/lib/neutral/meta.json +1 -0
  26. package/dist/lib/neutral/meta.mjs +8 -0
  27. package/dist/lib/neutral/meta.mjs.map +7 -0
  28. package/dist/lib/neutral/open-XI2T7D5O.mjs +49 -0
  29. package/dist/lib/neutral/open-XI2T7D5O.mjs.map +7 -0
  30. package/dist/lib/neutral/operation-handler-EAIE7KPR.mjs +13 -0
  31. package/dist/lib/neutral/operation-handler-EAIE7KPR.mjs.map +7 -0
  32. package/dist/lib/neutral/operations/index.mjs +8 -0
  33. package/dist/lib/neutral/operations/index.mjs.map +7 -0
  34. package/dist/lib/neutral/plugin.mjs +16 -0
  35. package/dist/lib/neutral/plugin.mjs.map +7 -0
  36. package/dist/lib/{browser/react-root-ZQTWLJYR.mjs → neutral/react-root-VE265VX4.mjs} +5 -8
  37. package/dist/lib/neutral/react-root-VE265VX4.mjs.map +7 -0
  38. package/dist/lib/{node-esm/react-surface-ZAZRIKZQ.mjs → neutral/react-surface-REZMYKQV.mjs} +20 -16
  39. package/dist/lib/neutral/react-surface-REZMYKQV.mjs.map +7 -0
  40. package/dist/lib/neutral/revert-workspace-ST6NZUNG.mjs +22 -0
  41. package/dist/lib/neutral/revert-workspace-ST6NZUNG.mjs.map +7 -0
  42. package/dist/lib/neutral/set-6ZRLWPJS.mjs +22 -0
  43. package/dist/lib/neutral/set-6ZRLWPJS.mjs.map +7 -0
  44. package/dist/lib/neutral/set-layout-mode-L22HRCKS.mjs +13 -0
  45. package/dist/lib/neutral/set-layout-mode-L22HRCKS.mjs.map +7 -0
  46. package/dist/lib/{browser/spotlight-dismiss-67PHYS5B.mjs → neutral/spotlight-dismiss-EIYW5E7M.mjs} +7 -15
  47. package/dist/lib/{node-esm/spotlight-dismiss-RMLRZUVY.mjs.map → neutral/spotlight-dismiss-EIYW5E7M.mjs.map} +3 -3
  48. package/dist/lib/{browser/state-A3PGDWWZ.mjs → neutral/state-7NXKBLPY.mjs} +5 -6
  49. package/dist/lib/neutral/state-7NXKBLPY.mjs.map +7 -0
  50. package/dist/lib/neutral/switch-workspace-PYWPTMFO.mjs +25 -0
  51. package/dist/lib/neutral/switch-workspace-PYWPTMFO.mjs.map +7 -0
  52. package/dist/lib/neutral/translations.mjs +36 -0
  53. package/dist/lib/neutral/translations.mjs.map +7 -0
  54. package/dist/lib/neutral/types/index.mjs +10 -0
  55. package/dist/lib/neutral/types/index.mjs.map +7 -0
  56. package/dist/lib/neutral/update-complementary-HKWF5OXT.mjs +33 -0
  57. package/dist/lib/neutral/update-complementary-HKWF5OXT.mjs.map +7 -0
  58. package/dist/lib/neutral/update-dialog-P4ASXCE7.mjs +30 -0
  59. package/dist/lib/neutral/update-dialog-P4ASXCE7.mjs.map +7 -0
  60. package/dist/lib/neutral/update-popover-REAKC2GN.mjs +34 -0
  61. package/dist/lib/neutral/update-popover-REAKC2GN.mjs.map +7 -0
  62. package/dist/lib/neutral/update-sidebar-O5SQPR6Q.mjs +12 -0
  63. package/dist/lib/neutral/update-sidebar-O5SQPR6Q.mjs.map +7 -0
  64. package/dist/lib/neutral/url-handler-GZXUUAHD.mjs +129 -0
  65. package/dist/lib/neutral/url-handler-GZXUUAHD.mjs.map +7 -0
  66. package/dist/types/src/SimpleLayoutPlugin.d.ts +2 -1
  67. package/dist/types/src/SimpleLayoutPlugin.d.ts.map +1 -1
  68. package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
  69. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  70. package/dist/types/src/capabilities/index.d.ts +21 -6
  71. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  72. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  73. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  74. package/dist/types/src/capabilities/{react-root/react-root.d.ts → react-root.d.ts} +1 -1
  75. package/dist/types/src/capabilities/react-root.d.ts.map +1 -0
  76. package/dist/types/src/capabilities/react-surface.d.ts +5 -0
  77. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  78. package/dist/types/src/capabilities/{spotlight-dismiss/spotlight-dismiss.d.ts → spotlight-dismiss.d.ts} +1 -1
  79. package/dist/types/src/capabilities/spotlight-dismiss.d.ts.map +1 -0
  80. package/dist/types/src/capabilities/state.d.ts +19 -0
  81. package/dist/types/src/capabilities/state.d.ts.map +1 -0
  82. package/dist/types/src/capabilities/url-handler.d.ts +12 -0
  83. package/dist/types/src/capabilities/url-handler.d.ts.map +1 -0
  84. package/dist/types/src/components/ContentError.stories.d.ts +27 -22
  85. package/dist/types/src/components/ContentError.stories.d.ts.map +1 -1
  86. package/dist/types/src/components/DebugOverlay/DebugOverlay.d.ts +19 -0
  87. package/dist/types/src/components/DebugOverlay/DebugOverlay.d.ts.map +1 -0
  88. package/dist/types/src/components/DebugOverlay/index.d.ts +2 -0
  89. package/dist/types/src/components/DebugOverlay/index.d.ts.map +1 -0
  90. package/dist/types/src/components/Dialog/Dialog.d.ts.map +1 -1
  91. package/dist/types/src/components/Home/Home.d.ts.map +1 -1
  92. package/dist/types/src/components/Loading/Loading.d.ts +3 -0
  93. package/dist/types/src/components/Loading/Loading.d.ts.map +1 -0
  94. package/dist/types/src/components/{ContentLoading.stories.d.ts → Loading/Loading.stories.d.ts} +1 -1
  95. package/dist/types/src/components/Loading/Loading.stories.d.ts.map +1 -0
  96. package/dist/types/src/components/Loading/index.d.ts +2 -0
  97. package/dist/types/src/components/Loading/index.d.ts.map +1 -0
  98. package/dist/types/src/components/MobileLayout/MobileLayout.d.ts +2 -2
  99. package/dist/types/src/components/MobileLayout/MobileLayout.d.ts.map +1 -1
  100. package/dist/types/src/components/MobileLayout/MobileLayout.stories.d.ts.map +1 -1
  101. package/dist/types/src/components/NavBranch/NavBranch.d.ts +11 -0
  102. package/dist/types/src/components/NavBranch/NavBranch.d.ts.map +1 -0
  103. package/dist/types/src/components/NavBranch/index.d.ts +2 -0
  104. package/dist/types/src/components/NavBranch/index.d.ts.map +1 -0
  105. package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
  106. package/dist/types/src/components/SimpleLayout/AppBar.d.ts +5 -7
  107. package/dist/types/src/components/SimpleLayout/AppBar.d.ts.map +1 -1
  108. package/dist/types/src/components/SimpleLayout/AppBar.stories.d.ts +29 -22
  109. package/dist/types/src/components/SimpleLayout/AppBar.stories.d.ts.map +1 -1
  110. package/dist/types/src/components/SimpleLayout/Drawer.d.ts +4 -7
  111. package/dist/types/src/components/SimpleLayout/Drawer.d.ts.map +1 -1
  112. package/dist/types/src/components/SimpleLayout/Main.d.ts +4 -7
  113. package/dist/types/src/components/SimpleLayout/Main.d.ts.map +1 -1
  114. package/dist/types/src/components/SimpleLayout/NavBar.d.ts +5 -7
  115. package/dist/types/src/components/SimpleLayout/NavBar.d.ts.map +1 -1
  116. package/dist/types/src/components/SimpleLayout/NavBar.stories.d.ts +29 -23
  117. package/dist/types/src/components/SimpleLayout/NavBar.stories.d.ts.map +1 -1
  118. package/dist/types/src/components/SimpleLayout/SimpleLayout.d.ts.map +1 -1
  119. package/dist/types/src/components/SimpleLayout/SimpleLayout.stories.d.ts +26 -25
  120. package/dist/types/src/components/SimpleLayout/SimpleLayout.stories.d.ts.map +1 -1
  121. package/dist/types/src/components/hooks.d.ts +4 -2
  122. package/dist/types/src/components/hooks.d.ts.map +1 -1
  123. package/dist/types/src/components/index.d.ts +3 -2
  124. package/dist/types/src/components/index.d.ts.map +1 -1
  125. package/dist/types/src/hooks/actions.d.ts +5 -6
  126. package/dist/types/src/hooks/actions.d.ts.map +1 -1
  127. package/dist/types/src/hooks/useAppBarProps.d.ts +2 -2
  128. package/dist/types/src/hooks/useAppBarProps.d.ts.map +1 -1
  129. package/dist/types/src/hooks/useCompanions.d.ts.map +1 -1
  130. package/dist/types/src/hooks/useDrawerActions.d.ts.map +1 -1
  131. package/dist/types/src/hooks/useNavbarActions.d.ts.map +1 -1
  132. package/dist/types/src/hooks/useSimpleLayoutState.d.ts +3 -3
  133. package/dist/types/src/hooks/useSimpleLayoutState.d.ts.map +1 -1
  134. package/dist/types/src/index.d.ts +2 -1
  135. package/dist/types/src/index.d.ts.map +1 -1
  136. package/dist/types/src/meta.d.ts.map +1 -1
  137. package/dist/types/src/operations/close.d.ts +5 -0
  138. package/dist/types/src/operations/close.d.ts.map +1 -0
  139. package/dist/types/src/operations/index.d.ts +3 -0
  140. package/dist/types/src/operations/index.d.ts.map +1 -0
  141. package/dist/types/src/operations/open.d.ts +5 -0
  142. package/dist/types/src/operations/open.d.ts.map +1 -0
  143. package/dist/types/src/operations/revert-workspace.d.ts +5 -0
  144. package/dist/types/src/operations/revert-workspace.d.ts.map +1 -0
  145. package/dist/types/src/operations/set-layout-mode.d.ts +5 -0
  146. package/dist/types/src/operations/set-layout-mode.d.ts.map +1 -0
  147. package/dist/types/src/operations/set.d.ts +5 -0
  148. package/dist/types/src/operations/set.d.ts.map +1 -0
  149. package/dist/types/src/operations/state-access.d.ts +8 -0
  150. package/dist/types/src/operations/state-access.d.ts.map +1 -0
  151. package/dist/types/src/operations/switch-workspace.d.ts +5 -0
  152. package/dist/types/src/operations/switch-workspace.d.ts.map +1 -0
  153. package/dist/types/src/operations/update-complementary.d.ts +5 -0
  154. package/dist/types/src/operations/update-complementary.d.ts.map +1 -0
  155. package/dist/types/src/operations/update-dialog.d.ts +5 -0
  156. package/dist/types/src/operations/update-dialog.d.ts.map +1 -0
  157. package/dist/types/src/operations/update-popover.d.ts +5 -0
  158. package/dist/types/src/operations/update-popover.d.ts.map +1 -0
  159. package/dist/types/src/operations/update-sidebar.d.ts +5 -0
  160. package/dist/types/src/operations/update-sidebar.d.ts.map +1 -0
  161. package/dist/types/src/plugin.d.ts +4 -0
  162. package/dist/types/src/plugin.d.ts.map +1 -0
  163. package/dist/types/src/translations.d.ts +26 -20
  164. package/dist/types/src/translations.d.ts.map +1 -1
  165. package/dist/types/src/types/{capabilities.d.ts → SimpleLayoutCapabilities.d.ts} +12 -10
  166. package/dist/types/src/types/SimpleLayoutCapabilities.d.ts.map +1 -0
  167. package/dist/types/src/types/SimpleLayoutEvents.d.ts +4 -0
  168. package/dist/types/src/types/SimpleLayoutEvents.d.ts.map +1 -0
  169. package/dist/types/src/types/index.d.ts +2 -2
  170. package/dist/types/src/types/index.d.ts.map +1 -1
  171. package/dist/types/tsconfig.tsbuildinfo +1 -1
  172. package/package.json +87 -32
  173. package/src/SimpleLayoutPlugin.ts +18 -7
  174. package/src/capabilities/app-graph-builder.ts +21 -0
  175. package/src/capabilities/index.ts +13 -6
  176. package/src/capabilities/operation-handler.ts +14 -0
  177. package/src/capabilities/{react-root/react-root.tsx → react-root.tsx} +2 -2
  178. package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +17 -8
  179. package/src/capabilities/{state/state.tsx → state.tsx} +5 -6
  180. package/src/capabilities/url-handler.ts +164 -0
  181. package/src/components/ContentError.stories.tsx +8 -7
  182. package/src/components/DebugOverlay/DebugOverlay.tsx +96 -0
  183. package/src/components/DebugOverlay/index.ts +5 -0
  184. package/src/components/Dialog/Dialog.tsx +15 -4
  185. package/src/components/Home/Home.tsx +36 -31
  186. package/src/components/{ContentLoading.stories.tsx → Loading/Loading.stories.tsx} +4 -4
  187. package/src/components/{ContentLoading.tsx → Loading/Loading.tsx} +2 -2
  188. package/src/components/Loading/index.ts +5 -0
  189. package/src/components/MobileLayout/MobileLayout.stories.tsx +38 -30
  190. package/src/components/MobileLayout/MobileLayout.tsx +118 -51
  191. package/src/components/{Workspace/Workspace.tsx → NavBranch/NavBranch.tsx} +43 -39
  192. package/src/components/{Workspace → NavBranch}/index.ts +1 -1
  193. package/src/components/Popover/Popover.tsx +12 -8
  194. package/src/components/SimpleLayout/AppBar.stories.tsx +12 -12
  195. package/src/components/SimpleLayout/AppBar.tsx +56 -59
  196. package/src/components/SimpleLayout/Drawer.tsx +38 -36
  197. package/src/components/SimpleLayout/Main.tsx +22 -25
  198. package/src/components/SimpleLayout/NavBar.stories.tsx +9 -9
  199. package/src/components/SimpleLayout/NavBar.tsx +10 -17
  200. package/src/components/SimpleLayout/SimpleLayout.stories.tsx +48 -71
  201. package/src/components/SimpleLayout/SimpleLayout.tsx +33 -34
  202. package/src/components/hooks.ts +8 -8
  203. package/src/components/index.ts +3 -2
  204. package/src/hooks/actions.ts +20 -19
  205. package/src/hooks/useAppBarProps.ts +15 -32
  206. package/src/hooks/useCompanions.ts +1 -1
  207. package/src/hooks/useDrawerActions.ts +16 -14
  208. package/src/hooks/useNavbarActions.ts +14 -13
  209. package/src/hooks/useSimpleLayoutState.ts +7 -5
  210. package/src/index.ts +2 -1
  211. package/src/meta.ts +2 -1
  212. package/src/operations/close.ts +34 -0
  213. package/src/operations/index.ts +16 -0
  214. package/src/operations/open.ts +63 -0
  215. package/src/operations/revert-workspace.ts +22 -0
  216. package/src/operations/set-layout-mode.ts +12 -0
  217. package/src/operations/set.ts +23 -0
  218. package/src/operations/state-access.ts +21 -0
  219. package/src/operations/switch-workspace.ts +26 -0
  220. package/src/operations/update-complementary.ts +35 -0
  221. package/src/operations/update-dialog.ts +28 -0
  222. package/src/operations/update-popover.ts +35 -0
  223. package/src/operations/update-sidebar.ts +12 -0
  224. package/src/plugin.ts +11 -0
  225. package/src/translations.ts +21 -19
  226. package/src/types/{capabilities.ts → SimpleLayoutCapabilities.ts} +6 -18
  227. package/src/types/SimpleLayoutEvents.ts +15 -0
  228. package/src/types/index.ts +2 -2
  229. package/dist/lib/browser/chunk-7VLT3S46.mjs +0 -29
  230. package/dist/lib/browser/chunk-7VLT3S46.mjs.map +0 -7
  231. package/dist/lib/browser/chunk-U632CHRU.mjs +0 -1167
  232. package/dist/lib/browser/chunk-U632CHRU.mjs.map +0 -7
  233. package/dist/lib/browser/index.mjs +0 -101
  234. package/dist/lib/browser/index.mjs.map +0 -7
  235. package/dist/lib/browser/meta.json +0 -1
  236. package/dist/lib/browser/operation-resolver-BYRIQOQT.mjs +0 -205
  237. package/dist/lib/browser/operation-resolver-BYRIQOQT.mjs.map +0 -7
  238. package/dist/lib/browser/react-root-ZQTWLJYR.mjs.map +0 -7
  239. package/dist/lib/browser/react-surface-IOYDLMNR.mjs +0 -41
  240. package/dist/lib/browser/react-surface-IOYDLMNR.mjs.map +0 -7
  241. package/dist/lib/browser/spotlight-dismiss-67PHYS5B.mjs.map +0 -7
  242. package/dist/lib/browser/state-A3PGDWWZ.mjs.map +0 -7
  243. package/dist/lib/browser/url-handler-HTIUY6WL.mjs +0 -152
  244. package/dist/lib/browser/url-handler-HTIUY6WL.mjs.map +0 -7
  245. package/dist/lib/node-esm/chunk-UXFYLQJA.mjs +0 -1168
  246. package/dist/lib/node-esm/chunk-UXFYLQJA.mjs.map +0 -7
  247. package/dist/lib/node-esm/chunk-VIDE5UMB.mjs +0 -31
  248. package/dist/lib/node-esm/chunk-VIDE5UMB.mjs.map +0 -7
  249. package/dist/lib/node-esm/index.mjs +0 -102
  250. package/dist/lib/node-esm/index.mjs.map +0 -7
  251. package/dist/lib/node-esm/meta.json +0 -1
  252. package/dist/lib/node-esm/operation-resolver-BDTFNCS2.mjs +0 -206
  253. package/dist/lib/node-esm/operation-resolver-BDTFNCS2.mjs.map +0 -7
  254. package/dist/lib/node-esm/react-root-FMAUHDJI.mjs +0 -22
  255. package/dist/lib/node-esm/react-root-FMAUHDJI.mjs.map +0 -7
  256. package/dist/lib/node-esm/react-surface-ZAZRIKZQ.mjs.map +0 -7
  257. package/dist/lib/node-esm/spotlight-dismiss-RMLRZUVY.mjs +0 -68
  258. package/dist/lib/node-esm/state-ZCFZTTPL.mjs +0 -49
  259. package/dist/lib/node-esm/state-ZCFZTTPL.mjs.map +0 -7
  260. package/dist/lib/node-esm/url-handler-WBVVKVPC.mjs +0 -153
  261. package/dist/lib/node-esm/url-handler-WBVVKVPC.mjs.map +0 -7
  262. package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
  263. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
  264. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
  265. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
  266. package/dist/types/src/capabilities/react-root/index.d.ts +0 -6
  267. package/dist/types/src/capabilities/react-root/index.d.ts.map +0 -1
  268. package/dist/types/src/capabilities/react-root/react-root.d.ts.map +0 -1
  269. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
  270. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  271. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
  272. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  273. package/dist/types/src/capabilities/spotlight-dismiss/index.d.ts +0 -3
  274. package/dist/types/src/capabilities/spotlight-dismiss/index.d.ts.map +0 -1
  275. package/dist/types/src/capabilities/spotlight-dismiss/spotlight-dismiss.d.ts.map +0 -1
  276. package/dist/types/src/capabilities/state/index.d.ts +0 -13
  277. package/dist/types/src/capabilities/state/index.d.ts.map +0 -1
  278. package/dist/types/src/capabilities/state/state.d.ts +0 -19
  279. package/dist/types/src/capabilities/state/state.d.ts.map +0 -1
  280. package/dist/types/src/capabilities/url-handler/index.d.ts +0 -3
  281. package/dist/types/src/capabilities/url-handler/index.d.ts.map +0 -1
  282. package/dist/types/src/capabilities/url-handler/url-handler.d.ts +0 -12
  283. package/dist/types/src/capabilities/url-handler/url-handler.d.ts.map +0 -1
  284. package/dist/types/src/components/ContentError.d.ts +0 -5
  285. package/dist/types/src/components/ContentError.d.ts.map +0 -1
  286. package/dist/types/src/components/ContentLoading.d.ts +0 -3
  287. package/dist/types/src/components/ContentLoading.d.ts.map +0 -1
  288. package/dist/types/src/components/ContentLoading.stories.d.ts.map +0 -1
  289. package/dist/types/src/components/Workspace/Workspace.d.ts +0 -11
  290. package/dist/types/src/components/Workspace/Workspace.d.ts.map +0 -1
  291. package/dist/types/src/components/Workspace/index.d.ts +0 -2
  292. package/dist/types/src/components/Workspace/index.d.ts.map +0 -1
  293. package/dist/types/src/types/capabilities.d.ts.map +0 -1
  294. package/dist/types/src/types/events.d.ts +0 -6
  295. package/dist/types/src/types/events.d.ts.map +0 -1
  296. package/src/capabilities/operation-resolver/index.ts +0 -10
  297. package/src/capabilities/operation-resolver/operation-resolver.ts +0 -217
  298. package/src/capabilities/react-root/index.ts +0 -7
  299. package/src/capabilities/react-surface/index.ts +0 -7
  300. package/src/capabilities/spotlight-dismiss/index.ts +0 -7
  301. package/src/capabilities/state/index.ts +0 -9
  302. package/src/capabilities/url-handler/index.ts +0 -7
  303. package/src/capabilities/url-handler/url-handler.ts +0 -157
  304. package/src/components/ContentError.tsx +0 -23
  305. package/src/types/events.ts +0 -15
  306. /package/src/capabilities/{spotlight-dismiss/spotlight-dismiss.ts → spotlight-dismiss.ts} +0 -0
@@ -7,11 +7,11 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
7
7
  import React, { useMemo } from 'react';
8
8
  import { type Mock, expect, fn, screen, userEvent, within } from 'storybook/test';
9
9
 
10
- import { withTheme } from '@dxos/react-ui/testing';
11
10
  import { type ActionGraphProps, createGapSeparator, createMenuAction, createMenuItemGroup } from '@dxos/react-ui-menu';
11
+ import { withLayout, withTheme } from '@dxos/react-ui/testing';
12
12
  import { withRegistry } from '@dxos/storybook-utils';
13
13
 
14
- import { translations } from '../../translations';
14
+ import { translations } from '#translations';
15
15
 
16
16
  import { NavBar } from './NavBar';
17
17
 
@@ -39,7 +39,7 @@ const buildCompanionOnlyActions = (): ActionGraphProps => {
39
39
  }),
40
40
  ];
41
41
  result.nodes.push(...companions);
42
- result.edges.push(...companions.map((c) => ({ source: 'root', target: c.id })));
42
+ result.edges.push(...companions.map((c) => ({ source: 'root', target: c.id, relation: 'child' })));
43
43
  return result;
44
44
  };
45
45
 
@@ -81,18 +81,18 @@ const buildDefaultActions = (): ActionGraphProps => {
81
81
  ];
82
82
  result.nodes.push(...companions, ...gapSeparator.nodes, mainMenuGroup, ...menuActions);
83
83
  result.edges.push(
84
- ...companions.map((c) => ({ source: 'root', target: c.id })),
84
+ ...companions.map((c) => ({ source: 'root', target: c.id, relation: 'child' })),
85
85
  ...gapSeparator.edges,
86
- { source: 'root', target: mainMenuGroup.id },
87
- ...menuActions.map((action) => ({ source: MAIN_MENU_GROUP_ID, target: action.id })),
86
+ { source: 'root', target: mainMenuGroup.id, relation: 'child' },
87
+ ...menuActions.map((action) => ({ source: MAIN_MENU_GROUP_ID, target: action.id, relation: 'child' })),
88
88
  );
89
89
  return result;
90
90
  };
91
91
 
92
92
  const meta = {
93
- title: 'plugins/plugin-simple-layout/NavBar',
93
+ title: 'plugins/plugin-simple-layout/components/NavBar',
94
94
  component: NavBar,
95
- decorators: [withTheme(), withRegistry],
95
+ decorators: [withTheme(), withLayout({ layout: 'fullscreen' }), withRegistry],
96
96
  parameters: {
97
97
  layout: 'fullscreen',
98
98
  translations,
@@ -106,7 +106,7 @@ type Story = StoryObj<typeof meta>;
106
106
  const DefaultStory = ({ onAction }: { onAction: (action: { id: string }) => void }) => {
107
107
  const actions = useMemo(() => Atom.make(buildDefaultActions()).pipe(Atom.keepAlive), []);
108
108
 
109
- return <NavBar classNames='border-bs border-separator' actions={actions} onAction={onAction} />;
109
+ return <NavBar classNames='border-y border-separator' actions={actions} onAction={onAction} />;
110
110
  };
111
111
 
112
112
  export const Default: Story = {
@@ -5,36 +5,29 @@
5
5
  import { type Atom } from '@effect-atom/atom-react';
6
6
  import React from 'react';
7
7
 
8
- import { type ThemedClassName } from '@dxos/react-ui';
9
- import {
10
- type ActionExecutor,
11
- type ActionGraphProps,
12
- MenuProvider,
13
- ToolbarMenu,
14
- useMenuActions,
15
- } from '@dxos/react-ui-menu';
16
- import { mx } from '@dxos/ui-theme';
8
+ import { type ActionExecutor, type ActionGraphProps, Menu, useMenuActions } from '@dxos/react-ui-menu';
9
+ import { composable, composableProps } from '@dxos/ui-theme';
17
10
 
18
11
  const NAVBAR_NAME = 'SimpleLayout.NavBar';
19
12
 
20
- export type NavBarProps = ThemedClassName<{
13
+ export type NavBarProps = {
21
14
  /** Action graph atom for the toolbar. */
22
15
  actions: Atom.Atom<ActionGraphProps>;
23
16
  /** Action executor callback. */
24
17
  onAction?: ActionExecutor;
25
- }>;
18
+ };
26
19
 
27
20
  /**
28
21
  * Presentational navbar component that renders a toolbar from an action graph.
29
22
  */
30
- export const NavBar = ({ classNames, actions, onAction }: NavBarProps) => {
31
- const menu = useMenuActions(actions);
23
+ export const NavBar = composable<HTMLDivElement, NavBarProps>(({ actions, onAction, ...props }, forwardedRef) => {
24
+ const menuActions = useMenuActions(actions);
32
25
 
33
26
  return (
34
- <MenuProvider {...menu} onAction={onAction} alwaysActive>
35
- <ToolbarMenu density='coarse' classNames={mx(classNames)} />
36
- </MenuProvider>
27
+ <Menu.Root {...menuActions} alwaysActive onAction={onAction}>
28
+ <Menu.Toolbar {...composableProps(props)} ref={forwardedRef} />
29
+ </Menu.Root>
37
30
  );
38
- };
31
+ });
39
32
 
40
33
  NavBar.displayName = NAVBAR_NAME;
@@ -5,82 +5,71 @@
5
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
6
6
  import * as Effect from 'effect/Effect';
7
7
 
8
- import { ActivationEvents, Capabilities, Capability, Plugin } from '@dxos/app-framework';
8
+ import { ActivationEvents, Capability, Plugin } from '@dxos/app-framework';
9
9
  import { withPluginManager } from '@dxos/app-framework/testing';
10
- import { AppActivationEvents, AppPlugin } from '@dxos/app-toolkit';
11
- import { ClientOperation, ClientPlugin } from '@dxos/plugin-client';
12
- import { SearchPlugin } from '@dxos/plugin-search';
13
- import { SpacePlugin } from '@dxos/plugin-space';
14
- import { SpaceOperation } from '@dxos/plugin-space/types';
10
+ import { AppActivationEvents } from '@dxos/app-toolkit';
11
+ import { Collection } from '@dxos/echo';
12
+ import { ClientPlugin } from '@dxos/plugin-client/plugin';
13
+ import { SearchPlugin } from '@dxos/plugin-search/plugin';
14
+ import { SpacePlugin } from '@dxos/plugin-space/plugin';
15
15
  import { corePlugins } from '@dxos/plugin-testing';
16
- import { withLayout, withTheme } from '@dxos/react-ui/testing';
17
- import { translations as searchTranslation } from '@dxos/react-ui-searchlist';
18
- import { Collection } from '@dxos/schema';
16
+ import { translations as searchTranslation } from '@dxos/react-ui-search/translations';
17
+ import { withLayout } from '@dxos/react-ui/testing';
19
18
 
20
- import { OperationResolver, type SimpleLayoutStateOptions, State } from '../../capabilities';
21
- import { meta as pluginMeta } from '../../meta';
22
- import { type SimpleLayoutPluginOptions } from '../../SimpleLayoutPlugin';
23
- import { translations } from '../../translations';
19
+ import { ReactRoot, ReactSurface, State } from '#capabilities';
20
+ import { meta as pluginMeta } from '#meta';
21
+ import { translations } from '#translations';
22
+ import { SimpleLayoutEvents } from '#types';
24
23
 
24
+ import { type SimpleLayoutPluginOptions } from '../../SimpleLayoutPlugin';
25
25
  import { SimpleLayout } from './SimpleLayout';
26
26
 
27
- const TestPlugin = Plugin.define<SimpleLayoutPluginOptions>(pluginMeta).pipe(
28
- AppPlugin.addOperationResolverModule({ activate: OperationResolver }),
29
- Plugin.addModule(({ isPopover = false }) => ({
30
- id: Capability.getModuleTag(State),
31
- activatesOn: ActivationEvents.Startup,
32
- activatesAfter: [AppActivationEvents.LayoutReady],
33
- activate: () => State({ initialState: { isPopover } } satisfies SimpleLayoutStateOptions),
34
- })),
35
- Plugin.addModule({
36
- id: 'setup',
37
- activatesOn: ActivationEvents.OperationInvokerReady,
38
- activate: Effect.fnUntraced(function* () {
39
- const { invoke } = yield* Capability.get(Capabilities.OperationInvoker);
40
- yield* invoke(ClientOperation.CreateIdentity, {});
41
- const { space: work } = yield* invoke(SpaceOperation.Create, { name: 'Work Space' });
42
- const { space: sharedProject } = yield* invoke(SpaceOperation.Create, { name: 'Shared Project' });
43
-
44
- // Add collections to Work Space.
45
- yield* invoke(SpaceOperation.AddObject, {
46
- target: work.db,
47
- object: Collection.make({ name: 'Projects', objects: [] }),
48
- });
49
- yield* invoke(SpaceOperation.AddObject, {
50
- target: work.db,
51
- object: Collection.make({ name: 'Documents', objects: [] }),
52
- });
53
-
54
- // Add collections to Shared Project.
55
- yield* invoke(SpaceOperation.AddObject, {
56
- target: sharedProject.db,
57
- object: Collection.make({ name: 'Tasks', objects: [] }),
58
- });
59
- yield* invoke(SpaceOperation.AddObject, {
60
- target: sharedProject.db,
61
- object: Collection.make({ name: 'Notes', objects: [] }),
62
- });
63
- }),
64
- }),
65
- Plugin.make,
66
- );
67
-
68
- const createPluginManager = ({ isPopover }: { isPopover: boolean }) => {
27
+ const createPluginManager = ({ isPopover }: { isPopover?: boolean }) => {
69
28
  return withPluginManager({
29
+ setupEvents: [AppActivationEvents.SetupSettings],
70
30
  plugins: [
71
31
  ...corePlugins(),
72
32
  ClientPlugin({
73
33
  types: [Collection.Collection],
34
+ onClientInitialized: ({ client }) =>
35
+ Effect.gen(function* () {
36
+ yield* Effect.promise(() => client.halo.createIdentity());
37
+ }),
74
38
  }),
39
+
75
40
  SearchPlugin(),
76
41
  SpacePlugin({}),
77
- TestPlugin({ isPopover }),
42
+
43
+ // TODO(burdon): This should be factored ouf from SimpleLayoutPlugin.
44
+ Plugin.define<SimpleLayoutPluginOptions>(pluginMeta).pipe(
45
+ Plugin.addModule(({ isPopover = false }) => ({
46
+ id: Capability.getModuleTag(State),
47
+ activatesOn: ActivationEvents.Startup,
48
+ firesAfterActivation: [SimpleLayoutEvents.StateReady, AppActivationEvents.LayoutReady],
49
+ activate: () => State({ initialState: { isPopover } }),
50
+ })),
51
+ Plugin.addModule({
52
+ id: Capability.getModuleTag(ReactRoot),
53
+ activatesOn: ActivationEvents.Startup,
54
+ activate: ReactRoot,
55
+ }),
56
+ Plugin.addModule({
57
+ id: Capability.getModuleTag(ReactSurface),
58
+ activatesOn: ActivationEvents.Startup,
59
+ activate: ReactSurface,
60
+ }),
61
+ Plugin.make,
62
+ )({ isPopover }),
78
63
  ],
79
64
  });
80
65
  };
81
66
 
67
+ /**
68
+ * NOTE: To expose to iphone on network:
69
+ * `moon run storybook-react:serve dev -H 0.0.0.0`
70
+ */
82
71
  const meta = {
83
- title: 'plugins/plugin-simple-layout/SimpleLayout',
72
+ title: 'plugins/plugin-simple-layout/components/SimpleLayout',
84
73
  component: SimpleLayout,
85
74
  parameters: {
86
75
  layout: 'fullscreen',
@@ -92,22 +81,10 @@ export default meta;
92
81
 
93
82
  type Story = StoryObj<typeof meta>;
94
83
 
95
- /**
96
- * NOTE: To expose to iphone on network:
97
- * `moon run storybook-react:serve dev -H 0.0.0.0`
98
- */
99
84
  export const Default: Story = {
100
- decorators: [
101
- withTheme(),
102
- withLayout({ layout: 'column', classNames: 'relative' }),
103
- createPluginManager({ isPopover: false }),
104
- ],
85
+ decorators: [withLayout({ layout: 'column', classNames: 'relative' }), createPluginManager({})],
105
86
  };
106
87
 
107
88
  export const Popover: Story = {
108
- decorators: [
109
- withTheme(),
110
- withLayout({ layout: 'column', classNames: 'relative' }),
111
- createPluginManager({ isPopover: true }),
112
- ],
89
+ decorators: [withLayout({ layout: 'column', classNames: 'relative' }), createPluginManager({ isPopover: true })],
113
90
  };
@@ -2,58 +2,57 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import React, { useEffect, useRef, useState } from 'react';
5
+ import React, { useLayoutEffect, useRef, useState } from 'react';
6
6
 
7
7
  import { Splitter, type SplitterMode } from '@dxos/react-ui';
8
8
  import { Mosaic } from '@dxos/react-ui-mosaic';
9
9
 
10
- import { useSimpleLayoutState } from '../../hooks';
10
+ import { useSimpleLayoutState } from '#hooks';
11
+
12
+ import { DebugOverlay } from '../DebugOverlay';
11
13
  import { Dialog } from '../Dialog';
12
14
  import { MobileLayout } from '../MobileLayout';
13
15
  import { PopoverContent, PopoverRoot } from '../Popover';
14
-
15
16
  import { Drawer } from './Drawer';
16
17
  import { Main } from './Main';
17
18
 
18
- // TODO(burdon): Mobile/Desktop variance?
19
19
  export const SimpleLayout = () => {
20
20
  const { state } = useSimpleLayoutState();
21
21
  const [keyboardOpen, setKeyboardOpen] = useState(false);
22
- const [splitterMode, setSplitterMode] = useState<SplitterMode>('upper');
22
+ const [splitterMode, setSplitterMode] = useState<SplitterMode>('top');
23
23
 
24
24
  const drawerRef = useRef<HTMLDivElement>(null);
25
- useEffect(() => {
26
- if (keyboardOpen) {
27
- // Determine which panel has focus and expand that one.
28
- const activeElement = document.activeElement;
29
- const drawerHasFocus = drawerRef.current?.contains(activeElement);
30
- setSplitterMode(drawerHasFocus ? 'lower' : 'upper');
31
- } else {
32
- setSplitterMode(state.drawerState === 'closed' ? 'upper' : state.drawerState === 'open' ? 'both' : 'lower');
25
+
26
+ // Restore Splitter mode when keyboard closes.
27
+ useLayoutEffect(() => {
28
+ if (!keyboardOpen) {
29
+ setSplitterMode(state.drawerState === 'closed' ? 'top' : state.drawerState === 'open' ? 'split' : 'bottom');
33
30
  }
34
31
  }, [state.drawerState, keyboardOpen]);
35
32
 
36
33
  return (
37
- <Mosaic.Root classNames='contents'>
38
- <MobileLayout.Root
39
- classNames='bg-toolbarSurface'
40
- onKeyboardOpenChange={(keyboardOpen: boolean) => setKeyboardOpen(keyboardOpen)}
41
- >
42
- <MobileLayout.Panel safe={{ top: true, bottom: splitterMode === 'upper' }}>
43
- <PopoverRoot>
44
- <Splitter.Root mode={splitterMode} ratio={0.55}>
45
- <Splitter.Panel position='upper'>
46
- <Main />
47
- </Splitter.Panel>
48
- <Splitter.Panel position='lower' ref={drawerRef}>
49
- <Drawer />
50
- </Splitter.Panel>
51
- </Splitter.Root>
52
- <Dialog />
53
- <PopoverContent />
54
- </PopoverRoot>
55
- </MobileLayout.Panel>
56
- </MobileLayout.Root>
57
- </Mosaic.Root>
34
+ <DebugOverlay.Root enabled={false}>
35
+ <PopoverRoot>
36
+ <Mosaic.Root>
37
+ <MobileLayout.Root
38
+ classNames='dx-container grid relative bg-toolbar-surface'
39
+ onKeyboardOpenChange={(nextKeyboardOpen) => setKeyboardOpen(nextKeyboardOpen)}
40
+ >
41
+ <MobileLayout.Panel safe={{ top: true, bottom: splitterMode === 'top' }}>
42
+ <Splitter.Root mode={splitterMode} ratio={0.55}>
43
+ <Splitter.Panel position='top'>
44
+ <Main />
45
+ </Splitter.Panel>
46
+ <Splitter.Panel position='bottom' ref={drawerRef}>
47
+ <Drawer />
48
+ </Splitter.Panel>
49
+ </Splitter.Root>
50
+ <Dialog />
51
+ <PopoverContent />
52
+ </MobileLayout.Panel>
53
+ </MobileLayout.Root>
54
+ </Mosaic.Root>
55
+ </PopoverRoot>
56
+ </DebugOverlay.Root>
58
57
  );
59
58
  };
@@ -6,21 +6,21 @@ import { useEffect } from 'react';
6
6
 
7
7
  import { useAppGraph } from '@dxos/app-toolkit/ui';
8
8
  import { Graph } from '@dxos/plugin-graph';
9
+ import { expandAttendableId } from '@dxos/react-ui-attention';
9
10
 
10
11
  /**
11
- * Hook to expand graph nodes two levels deep when directly linked to.
12
+ * Expand graph nodes along the full path from root to the given node ID.
13
+ * Walks each progressive prefix, ensuring ancestor nodes are materialized
14
+ * before attempting to access their children.
12
15
  */
13
- export const useLoadDescendents = (nodeId?: string) => {
16
+ export const useExpandPath = (nodeId?: string) => {
14
17
  const { graph } = useAppGraph();
15
18
 
16
19
  useEffect(() => {
17
20
  if (nodeId) {
18
- // First level: expand the node itself.
19
- Graph.expand(graph, nodeId, 'outbound');
20
- // Second level: expand each child.
21
- Graph.getConnections(graph, nodeId, 'outbound').forEach((child) => {
22
- Graph.expand(graph, child.id, 'outbound');
23
- });
21
+ for (const prefix of expandAttendableId(nodeId)) {
22
+ Graph.expand(graph, prefix, 'child');
23
+ }
24
24
  }
25
25
  }, [nodeId, graph]);
26
26
  };
@@ -2,9 +2,10 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- export * from './ContentLoading';
5
+ export * from './DebugOverlay';
6
6
  export * from './Home';
7
+ export * from './Loading';
7
8
  export * from './MobileLayout';
8
9
  export * from './Popover';
9
10
  export * from './SimpleLayout';
10
- export * from './Workspace';
11
+ export * from './NavBranch';
@@ -5,25 +5,26 @@
5
5
  import { type Atom } from '@effect-atom/atom-react';
6
6
  import * as Effect from 'effect/Effect';
7
7
 
8
- import { type Capabilities } from '@dxos/app-framework';
9
- import { type AppCapabilities, LayoutOperation } from '@dxos/app-toolkit';
8
+ import { type AppCapabilities } from '@dxos/app-toolkit';
10
9
  import { Node } from '@dxos/plugin-graph';
11
- import { ATTENDABLE_PATH_SEPARATOR } from '@dxos/react-ui-attention';
10
+ import { getLinkedVariant } from '@dxos/react-ui-attention';
12
11
  import { type ActionGraphProps } from '@dxos/react-ui-menu';
13
12
  import { byPosition } from '@dxos/util';
14
13
 
15
- import { type SimpleLayoutState } from '../types';
14
+ import { SimpleLayoutCapabilities } from '#types';
16
15
 
17
16
  // TODO(wittjosiah): Factor out to shared location with plugin-deck.
18
- export const PLANK_COMPANION_TYPE = 'dxos.org/plugin/deck/plank-companion';
17
+ export const PLANK_COMPANION_TYPE = 'org.dxos.plugin.deck.plank-companion';
19
18
 
20
19
  export type CompanionActionsConfig = {
21
20
  /** Prefix for companion action IDs (e.g. 'navbar' or 'drawer') */
22
21
  idPrefix: string;
23
22
  /** Optional: highlight companion with this variant */
24
23
  selectedVariant?: string;
25
- /** invokeSync function for dispatching operations */
26
- invokeSync: Capabilities.OperationInvoker['invokeSync'];
24
+ /** State updater for toggling the drawer. */
25
+ updateState: (
26
+ fn: (state: SimpleLayoutCapabilities.SimpleLayoutState) => SimpleLayoutCapabilities.SimpleLayoutState,
27
+ ) => void;
27
28
  };
28
29
 
29
30
  /**
@@ -33,18 +34,18 @@ export type CompanionActionsConfig = {
33
34
  // TODO(burdon): Use builder pattern.
34
35
  export const createCompanionActions = (
35
36
  graph: AppCapabilities.AppGraph['graph'],
36
- stateAtom: Atom.Atom<SimpleLayoutState>,
37
+ stateAtom: Atom.Atom<SimpleLayoutCapabilities.SimpleLayoutState>,
37
38
  get: (atom: Atom.Atom<any>) => any,
38
39
  config: CompanionActionsConfig,
39
40
  ): Pick<ActionGraphProps, 'nodes' | 'edges'> => {
40
- const { idPrefix, selectedVariant, invokeSync } = config;
41
+ const { idPrefix, selectedVariant, updateState } = config;
41
42
 
42
43
  // Derive activeId from state atom.
43
44
  const state = get(stateAtom);
44
45
  const activeId = state.active ?? state.workspace;
45
46
 
46
47
  // Get companions from graph connections for activeId.
47
- const activeConnections = activeId ? get(graph.connections(activeId)) : [];
48
+ const activeConnections = activeId ? get(graph.connections(activeId, 'child')) : [];
48
49
  const companions = activeConnections
49
50
  .filter((node: Node.Node) => node.type === PLANK_COMPANION_TYPE)
50
51
  .toSorted((a: Node.Node, b: Node.Node) => byPosition(a.properties, b.properties));
@@ -52,12 +53,8 @@ export const createCompanionActions = (
52
53
  const nodes: ActionGraphProps['nodes'] = [];
53
54
  const edges: ActionGraphProps['edges'] = [];
54
55
 
55
- // Add companion actions.
56
- // TODO(burdon): Cap at 6 items.
57
56
  companions.forEach((companion: Node.Node) => {
58
- // Extract variant for highlighting if needed.
59
- const [, companionVariant] = companion.id.split(ATTENDABLE_PATH_SEPARATOR);
60
-
57
+ const companionVariant = getLinkedVariant(companion.id);
61
58
  const companionAction = {
62
59
  id: `${idPrefix}-companion-${companion.id}`,
63
60
  type: Node.ActionType,
@@ -65,20 +62,24 @@ export const createCompanionActions = (
65
62
  icon: companion.properties.icon ?? 'ph--placeholder--regular',
66
63
  label: companion.properties.label,
67
64
  iconOnly: true,
68
- // Conditionally add variant highlighting.
69
65
  ...(selectedVariant !== undefined && {
70
66
  variant: selectedVariant === companionVariant ? 'primary' : 'ghost',
71
67
  }),
72
68
  },
73
69
  data: () =>
74
70
  Effect.sync(() =>
75
- invokeSync(LayoutOperation.Open, {
76
- subject: [companion.id],
71
+ updateState((current) => {
72
+ const closing = current.companionVariant === companionVariant && current.drawerState !== 'closed';
73
+ return {
74
+ ...current,
75
+ companionVariant: closing ? undefined : companionVariant,
76
+ drawerState: closing ? 'closed' : 'open',
77
+ };
77
78
  }),
78
79
  ),
79
80
  };
80
81
  nodes.push(companionAction);
81
- edges.push({ source: 'root', target: companionAction.id });
82
+ edges.push({ source: 'root', target: companionAction.id, relation: 'child' });
82
83
  });
83
84
 
84
85
  return { nodes, edges };
@@ -3,7 +3,6 @@
3
3
  //
4
4
 
5
5
  import { Atom, useAtomValue } from '@effect-atom/atom-react';
6
- import * as Effect from 'effect/Effect';
7
6
  import * as Option from 'effect/Option';
8
7
  import { useCallback, useMemo } from 'react';
9
8
 
@@ -14,9 +13,9 @@ import { Graph, Node, useActionRunner, useNode } from '@dxos/plugin-graph';
14
13
  import { toLocalizedString, useTranslation } from '@dxos/react-ui';
15
14
  import { type ActionGraphProps } from '@dxos/react-ui-menu';
16
15
 
17
- import { type AppBarProps } from '../components';
18
- import { meta } from '../meta';
19
- import { SimpleLayoutState as SimpleLayoutStateCapability } from '../types';
16
+ import { type AppBarProps } from '#components';
17
+ import { meta } from '#meta';
18
+ import { SimpleLayoutCapabilities } from '#types';
20
19
 
21
20
  /**
22
21
  * Hook that computes all AppBar props from the app graph.
@@ -24,10 +23,10 @@ import { SimpleLayoutState as SimpleLayoutStateCapability } from '../types';
24
23
  */
25
24
  export const useAppBarProps = (): Omit<AppBarProps, 'classNames'> => {
26
25
  const { t } = useTranslation(meta.id);
27
- const stateAtom = useCapability(SimpleLayoutStateCapability);
26
+ const stateAtom = useCapability(SimpleLayoutCapabilities.State);
28
27
  const state = useAtomValue(stateAtom);
29
28
  const { graph } = useAppGraph();
30
- const { invokeSync } = useOperationInvoker();
29
+ const { invokePromise } = useOperationInvoker();
31
30
  const runAction = useActionRunner();
32
31
 
33
32
  // Derive activeId from state.
@@ -49,26 +48,11 @@ export const useAppBarProps = (): Omit<AppBarProps, 'classNames'> => {
49
48
  ['list-item', 'list-item-primary', 'heading-list-item'].includes(action.properties.disposition),
50
49
  );
51
50
  const nodes: ActionGraphProps['nodes'] = filtered as ActionGraphProps['nodes'];
52
- const edges: ActionGraphProps['edges'] = filtered.map((action) => ({ source: 'root', target: action.id }));
53
-
54
- // Add alternate-tree action (e.g. Settings) from the workspace node.
55
- const workspaceConnections = state.workspace ? get(graph.connections(state.workspace)) : [];
56
- const alternateTreeNode = workspaceConnections.find(
57
- (node: Node.Node) => node.properties.disposition === 'alternate-tree',
58
- );
59
- if (alternateTreeNode && activeId !== alternateTreeNode.id) {
60
- const settingsAction = {
61
- id: `appbar-settings-${alternateTreeNode.id}`,
62
- type: Node.ActionType,
63
- data: () => Effect.sync(() => invokeSync(LayoutOperation.Open, { subject: [alternateTreeNode.id] })),
64
- properties: {
65
- label: alternateTreeNode.properties.label ?? alternateTreeNode.id,
66
- icon: alternateTreeNode.properties.icon ?? 'ph--placeholder--regular',
67
- },
68
- };
69
- nodes.push(settingsAction);
70
- edges.push({ source: 'root', target: settingsAction.id });
71
- }
51
+ const edges: ActionGraphProps['edges'] = filtered.map((action) => ({
52
+ source: 'root',
53
+ target: action.id,
54
+ relation: 'child',
55
+ }));
72
56
 
73
57
  return { nodes, edges };
74
58
  }),
@@ -87,19 +71,18 @@ export const useAppBarProps = (): Omit<AppBarProps, 'classNames'> => {
87
71
 
88
72
  // If history is empty and this is a workspace, go to home.
89
73
  if (state.history.length === 0 && isWorkspace) {
90
- invokeSync(LayoutOperation.SwitchWorkspace, { subject: Node.RootId });
74
+ void invokePromise(LayoutOperation.SwitchWorkspace, { subject: Node.RootId });
91
75
  } else {
92
76
  // Otherwise, close (which will pop from history or clear active).
93
- invokeSync(LayoutOperation.Close, { subject: [state.active] });
77
+ void invokePromise(LayoutOperation.Close, { subject: [state.active] });
94
78
  }
95
79
  } else {
96
- invokeSync(LayoutOperation.SwitchWorkspace, { subject: Node.RootId });
80
+ void invokePromise(LayoutOperation.SwitchWorkspace, { subject: Node.RootId });
97
81
  }
98
- }, [graph, invokeSync, state.active, state.history.length]);
82
+ }, [graph, invokePromise, state.active, state.history.length]);
99
83
 
100
84
  // Compute popover anchor ID.
101
- const popoverAnchorId =
102
- node && state.popoverAnchorId === `dxos.org/ui/${meta.id}/${node.id}` ? state.popoverAnchorId : undefined;
85
+ const popoverAnchorId = node && state.popoverAnchorId === `${meta.id}:${node.id}` ? state.popoverAnchorId : undefined;
103
86
 
104
87
  return {
105
88
  title,
@@ -16,7 +16,7 @@ import { PLANK_COMPANION_TYPE } from './actions';
16
16
  */
17
17
  export const useCompanions = (nodeId?: string) => {
18
18
  const { graph } = useAppGraph();
19
- const nodes = useConnections(graph, nodeId);
19
+ const nodes = useConnections(graph, nodeId, 'child');
20
20
  const companions = nodes.filter((node) => node.type === PLANK_COMPANION_TYPE);
21
21
  return useMemo(() => companions.toSorted((a, b) => byPosition(a.properties, b.properties)), [companions]);
22
22
  };