@dxos/plugin-simple-layout 0.8.4-main.69d29f4 → 0.8.4-main.7996785055

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 (294) hide show
  1. package/dist/lib/browser/chunk-J5FQ32AV.mjs +1256 -0
  2. package/dist/lib/browser/chunk-J5FQ32AV.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-CLPGTNWJ.mjs → chunk-MRR7PXSM.mjs} +5 -5
  4. package/dist/lib/browser/chunk-MRR7PXSM.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-XJVW3PRY.mjs +22 -0
  6. package/dist/lib/browser/chunk-XJVW3PRY.mjs.map +7 -0
  7. package/dist/lib/browser/close-OT5JOGVY.mjs +34 -0
  8. package/dist/lib/browser/close-OT5JOGVY.mjs.map +7 -0
  9. package/dist/lib/browser/index.mjs +40 -32
  10. package/dist/lib/browser/index.mjs.map +4 -4
  11. package/dist/lib/browser/meta.json +1 -1
  12. package/dist/lib/browser/open-4FQ44Z5G.mjs +31 -0
  13. package/dist/lib/browser/open-4FQ44Z5G.mjs.map +7 -0
  14. package/dist/lib/browser/operation-handler-OAD7LISD.mjs +16 -0
  15. package/dist/lib/browser/operation-handler-OAD7LISD.mjs.map +7 -0
  16. package/dist/lib/browser/{react-root-6ARAPH3O.mjs → react-root-6KIGPLUT.mjs} +5 -5
  17. package/dist/lib/browser/react-root-6KIGPLUT.mjs.map +7 -0
  18. package/dist/lib/browser/{react-surface-SO7B23GS.mjs → react-surface-JLIEQGOL.mjs} +18 -13
  19. package/dist/lib/browser/react-surface-JLIEQGOL.mjs.map +7 -0
  20. package/dist/lib/browser/revert-workspace-DLE265AN.mjs +21 -0
  21. package/dist/lib/browser/revert-workspace-DLE265AN.mjs.map +7 -0
  22. package/dist/lib/browser/set-52HGTSH4.mjs +21 -0
  23. package/dist/lib/browser/set-52HGTSH4.mjs.map +7 -0
  24. package/dist/lib/browser/set-layout-mode-T6QI3DGU.mjs +11 -0
  25. package/dist/lib/browser/set-layout-mode-T6QI3DGU.mjs.map +7 -0
  26. package/dist/lib/browser/{spotlight-dismiss-VSNOPETH.mjs → spotlight-dismiss-67PHYS5B.mjs} +3 -3
  27. package/dist/lib/browser/spotlight-dismiss-67PHYS5B.mjs.map +7 -0
  28. package/dist/lib/browser/{state-H4IGICBB.mjs → state-TXSMUWYI.mjs} +8 -5
  29. package/dist/lib/browser/state-TXSMUWYI.mjs.map +7 -0
  30. package/dist/lib/browser/switch-workspace-5Y6T4BWJ.mjs +24 -0
  31. package/dist/lib/browser/switch-workspace-5Y6T4BWJ.mjs.map +7 -0
  32. package/dist/lib/browser/update-complementary-MX3TTVAB.mjs +31 -0
  33. package/dist/lib/browser/update-complementary-MX3TTVAB.mjs.map +7 -0
  34. package/dist/lib/browser/update-dialog-FPAPZXKO.mjs +29 -0
  35. package/dist/lib/browser/update-dialog-FPAPZXKO.mjs.map +7 -0
  36. package/dist/lib/browser/update-popover-6V5ZTIYN.mjs +33 -0
  37. package/dist/lib/browser/update-popover-6V5ZTIYN.mjs.map +7 -0
  38. package/dist/lib/browser/update-sidebar-WHDKYMV7.mjs +10 -0
  39. package/dist/lib/browser/update-sidebar-WHDKYMV7.mjs.map +7 -0
  40. package/dist/lib/browser/url-handler-GUJ3L7Y3.mjs +163 -0
  41. package/dist/lib/browser/url-handler-GUJ3L7Y3.mjs.map +7 -0
  42. package/dist/lib/node-esm/chunk-27K22G6S.mjs +23 -0
  43. package/dist/lib/node-esm/chunk-27K22G6S.mjs.map +7 -0
  44. package/dist/lib/node-esm/chunk-EXNDYZTP.mjs +1257 -0
  45. package/dist/lib/node-esm/chunk-EXNDYZTP.mjs.map +7 -0
  46. package/dist/lib/node-esm/{chunk-MUVVYBUE.mjs → chunk-WMNTJ2MK.mjs} +5 -5
  47. package/dist/lib/node-esm/chunk-WMNTJ2MK.mjs.map +7 -0
  48. package/dist/lib/node-esm/close-PEVHREL2.mjs +35 -0
  49. package/dist/lib/node-esm/close-PEVHREL2.mjs.map +7 -0
  50. package/dist/lib/node-esm/index.mjs +40 -32
  51. package/dist/lib/node-esm/index.mjs.map +4 -4
  52. package/dist/lib/node-esm/meta.json +1 -1
  53. package/dist/lib/node-esm/open-LMJY7JCJ.mjs +32 -0
  54. package/dist/lib/node-esm/open-LMJY7JCJ.mjs.map +7 -0
  55. package/dist/lib/node-esm/operation-handler-A2DC4WHC.mjs +18 -0
  56. package/dist/lib/node-esm/operation-handler-A2DC4WHC.mjs.map +7 -0
  57. package/dist/lib/node-esm/{react-root-2CPA2ZUS.mjs → react-root-5SCW2KTH.mjs} +5 -5
  58. package/dist/lib/node-esm/react-root-5SCW2KTH.mjs.map +7 -0
  59. package/dist/lib/node-esm/{react-surface-FKAV56MO.mjs → react-surface-WLKB6AET.mjs} +18 -13
  60. package/dist/lib/node-esm/react-surface-WLKB6AET.mjs.map +7 -0
  61. package/dist/lib/node-esm/revert-workspace-XZXT64YA.mjs +22 -0
  62. package/dist/lib/node-esm/revert-workspace-XZXT64YA.mjs.map +7 -0
  63. package/dist/lib/node-esm/set-5I6LFH5L.mjs +22 -0
  64. package/dist/lib/node-esm/set-5I6LFH5L.mjs.map +7 -0
  65. package/dist/lib/node-esm/set-layout-mode-F5B6QLZM.mjs +13 -0
  66. package/dist/lib/node-esm/set-layout-mode-F5B6QLZM.mjs.map +7 -0
  67. package/dist/lib/node-esm/{spotlight-dismiss-L5PCWIJG.mjs → spotlight-dismiss-RMLRZUVY.mjs} +3 -3
  68. package/dist/lib/node-esm/spotlight-dismiss-RMLRZUVY.mjs.map +7 -0
  69. package/dist/lib/node-esm/{state-QIU2LMLT.mjs → state-JMX6FAG4.mjs} +8 -5
  70. package/dist/lib/node-esm/state-JMX6FAG4.mjs.map +7 -0
  71. package/dist/lib/node-esm/switch-workspace-PB6T2SGY.mjs +25 -0
  72. package/dist/lib/node-esm/switch-workspace-PB6T2SGY.mjs.map +7 -0
  73. package/dist/lib/node-esm/update-complementary-FTW423IY.mjs +32 -0
  74. package/dist/lib/node-esm/update-complementary-FTW423IY.mjs.map +7 -0
  75. package/dist/lib/node-esm/update-dialog-ID267DCL.mjs +30 -0
  76. package/dist/lib/node-esm/update-dialog-ID267DCL.mjs.map +7 -0
  77. package/dist/lib/node-esm/update-popover-RLHU2HF4.mjs +34 -0
  78. package/dist/lib/node-esm/update-popover-RLHU2HF4.mjs.map +7 -0
  79. package/dist/lib/node-esm/update-sidebar-BJ7HTNZ4.mjs +12 -0
  80. package/dist/lib/node-esm/update-sidebar-BJ7HTNZ4.mjs.map +7 -0
  81. package/dist/lib/node-esm/url-handler-WMONO2T6.mjs +164 -0
  82. package/dist/lib/node-esm/url-handler-WMONO2T6.mjs.map +7 -0
  83. package/dist/types/src/SimpleLayoutPlugin.d.ts +1 -1
  84. package/dist/types/src/SimpleLayoutPlugin.d.ts.map +1 -1
  85. package/dist/types/src/capabilities/index.d.ts +1 -1
  86. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  87. package/dist/types/src/capabilities/operation-handler/index.d.ts +4 -0
  88. package/dist/types/src/capabilities/operation-handler/index.d.ts.map +1 -0
  89. package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts +6 -0
  90. package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts.map +1 -0
  91. package/dist/types/src/capabilities/react-root/react-root.d.ts +1 -1
  92. package/dist/types/src/capabilities/react-root/react-root.d.ts.map +1 -1
  93. package/dist/types/src/capabilities/react-surface/index.d.ts +1 -1
  94. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -1
  95. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +2 -2
  96. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -1
  97. package/dist/types/src/capabilities/spotlight-dismiss/index.d.ts +1 -1
  98. package/dist/types/src/capabilities/spotlight-dismiss/index.d.ts.map +1 -1
  99. package/dist/types/src/capabilities/spotlight-dismiss/spotlight-dismiss.d.ts +1 -1
  100. package/dist/types/src/capabilities/spotlight-dismiss/spotlight-dismiss.d.ts.map +1 -1
  101. package/dist/types/src/capabilities/state/index.d.ts +1 -1
  102. package/dist/types/src/capabilities/state/state.d.ts +1 -1
  103. package/dist/types/src/capabilities/state/state.d.ts.map +1 -1
  104. package/dist/types/src/capabilities/url-handler/url-handler.d.ts +5 -3
  105. package/dist/types/src/capabilities/url-handler/url-handler.d.ts.map +1 -1
  106. package/dist/types/src/components/ContentError.stories.d.ts +13 -4
  107. package/dist/types/src/components/ContentError.stories.d.ts.map +1 -1
  108. package/dist/types/src/components/DebugOverlay/DebugOverlay.d.ts +19 -0
  109. package/dist/types/src/components/DebugOverlay/DebugOverlay.d.ts.map +1 -0
  110. package/dist/types/src/components/DebugOverlay/index.d.ts +2 -0
  111. package/dist/types/src/components/DebugOverlay/index.d.ts.map +1 -0
  112. package/dist/types/src/components/Home/Home.d.ts.map +1 -1
  113. package/dist/types/src/components/Loading/Loading.d.ts +3 -0
  114. package/dist/types/src/components/Loading/Loading.d.ts.map +1 -0
  115. package/dist/types/src/components/{ContentLoading.stories.d.ts → Loading/Loading.stories.d.ts} +1 -1
  116. package/dist/types/src/components/Loading/Loading.stories.d.ts.map +1 -0
  117. package/dist/types/src/components/Loading/index.d.ts +2 -0
  118. package/dist/types/src/components/Loading/index.d.ts.map +1 -0
  119. package/dist/types/src/components/MobileLayout/MobileLayout.d.ts +35 -0
  120. package/dist/types/src/components/MobileLayout/MobileLayout.d.ts.map +1 -0
  121. package/dist/types/src/components/MobileLayout/MobileLayout.stories.d.ts +7 -0
  122. package/dist/types/src/components/MobileLayout/MobileLayout.stories.d.ts.map +1 -0
  123. package/dist/types/src/components/MobileLayout/index.d.ts +2 -0
  124. package/dist/types/src/components/MobileLayout/index.d.ts.map +1 -0
  125. package/dist/types/src/components/NavBranch/NavBranch.d.ts +11 -0
  126. package/dist/types/src/components/NavBranch/NavBranch.d.ts.map +1 -0
  127. package/dist/types/src/components/NavBranch/index.d.ts +2 -0
  128. package/dist/types/src/components/NavBranch/index.d.ts.map +1 -0
  129. package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
  130. package/dist/types/src/components/SimpleLayout/AppBar.d.ts +28 -0
  131. package/dist/types/src/components/SimpleLayout/AppBar.d.ts.map +1 -0
  132. package/dist/types/src/components/SimpleLayout/AppBar.stories.d.ts +52 -0
  133. package/dist/types/src/components/SimpleLayout/AppBar.stories.d.ts.map +1 -0
  134. package/dist/types/src/components/SimpleLayout/Drawer.d.ts +9 -0
  135. package/dist/types/src/components/SimpleLayout/Drawer.d.ts.map +1 -0
  136. package/dist/types/src/components/SimpleLayout/Main.d.ts +1 -1
  137. package/dist/types/src/components/SimpleLayout/Main.d.ts.map +1 -1
  138. package/dist/types/src/components/SimpleLayout/NavBar.d.ts +18 -6
  139. package/dist/types/src/components/SimpleLayout/NavBar.d.ts.map +1 -1
  140. package/dist/types/src/components/SimpleLayout/NavBar.stories.d.ts +22 -10
  141. package/dist/types/src/components/SimpleLayout/NavBar.stories.d.ts.map +1 -1
  142. package/dist/types/src/components/SimpleLayout/SimpleLayout.d.ts.map +1 -1
  143. package/dist/types/src/components/SimpleLayout/SimpleLayout.stories.d.ts +16 -7
  144. package/dist/types/src/components/SimpleLayout/SimpleLayout.stories.d.ts.map +1 -1
  145. package/dist/types/src/components/SimpleLayout/index.d.ts +3 -0
  146. package/dist/types/src/components/SimpleLayout/index.d.ts.map +1 -1
  147. package/dist/types/src/components/hooks.d.ts +4 -2
  148. package/dist/types/src/components/hooks.d.ts.map +1 -1
  149. package/dist/types/src/components/index.d.ts +4 -2
  150. package/dist/types/src/components/index.d.ts.map +1 -1
  151. package/dist/types/src/hooks/actions.d.ts +19 -0
  152. package/dist/types/src/hooks/actions.d.ts.map +1 -0
  153. package/dist/types/src/hooks/index.d.ts +5 -0
  154. package/dist/types/src/hooks/index.d.ts.map +1 -1
  155. package/dist/types/src/hooks/useAppBarProps.d.ts +7 -0
  156. package/dist/types/src/hooks/useAppBarProps.d.ts.map +1 -0
  157. package/dist/types/src/hooks/useCompanions.d.ts +12 -0
  158. package/dist/types/src/hooks/useCompanions.d.ts.map +1 -0
  159. package/dist/types/src/hooks/useDrawerActions.d.ts +13 -0
  160. package/dist/types/src/hooks/useDrawerActions.d.ts.map +1 -0
  161. package/dist/types/src/hooks/useNavbarActions.d.ts +14 -0
  162. package/dist/types/src/hooks/useNavbarActions.d.ts.map +1 -0
  163. package/dist/types/src/hooks/useSimpleLayoutState.d.ts +3 -3
  164. package/dist/types/src/hooks/useSimpleLayoutState.d.ts.map +1 -1
  165. package/dist/types/src/operations/close.d.ts +5 -0
  166. package/dist/types/src/operations/close.d.ts.map +1 -0
  167. package/dist/types/src/operations/index.d.ts +3 -0
  168. package/dist/types/src/operations/index.d.ts.map +1 -0
  169. package/dist/types/src/operations/open.d.ts +5 -0
  170. package/dist/types/src/operations/open.d.ts.map +1 -0
  171. package/dist/types/src/operations/revert-workspace.d.ts +5 -0
  172. package/dist/types/src/operations/revert-workspace.d.ts.map +1 -0
  173. package/dist/types/src/operations/set-layout-mode.d.ts +5 -0
  174. package/dist/types/src/operations/set-layout-mode.d.ts.map +1 -0
  175. package/dist/types/src/operations/set.d.ts +5 -0
  176. package/dist/types/src/operations/set.d.ts.map +1 -0
  177. package/dist/types/src/operations/state-access.d.ts +8 -0
  178. package/dist/types/src/operations/state-access.d.ts.map +1 -0
  179. package/dist/types/src/operations/switch-workspace.d.ts +5 -0
  180. package/dist/types/src/operations/switch-workspace.d.ts.map +1 -0
  181. package/dist/types/src/operations/update-complementary.d.ts +5 -0
  182. package/dist/types/src/operations/update-complementary.d.ts.map +1 -0
  183. package/dist/types/src/operations/update-dialog.d.ts +5 -0
  184. package/dist/types/src/operations/update-dialog.d.ts.map +1 -0
  185. package/dist/types/src/operations/update-popover.d.ts +5 -0
  186. package/dist/types/src/operations/update-popover.d.ts.map +1 -0
  187. package/dist/types/src/operations/update-sidebar.d.ts +5 -0
  188. package/dist/types/src/operations/update-sidebar.d.ts.map +1 -0
  189. package/dist/types/src/translations.d.ts +12 -1
  190. package/dist/types/src/translations.d.ts.map +1 -1
  191. package/dist/types/src/types/capabilities.d.ts +8 -3
  192. package/dist/types/src/types/capabilities.d.ts.map +1 -1
  193. package/dist/types/src/types/events.d.ts.map +1 -1
  194. package/dist/types/tsconfig.tsbuildinfo +1 -1
  195. package/package.json +36 -30
  196. package/src/SimpleLayoutPlugin.ts +12 -11
  197. package/src/capabilities/index.ts +1 -1
  198. package/src/capabilities/operation-handler/index.ts +9 -0
  199. package/src/capabilities/operation-handler/operation-handler.ts +14 -0
  200. package/src/capabilities/react-root/react-root.tsx +2 -2
  201. package/src/capabilities/react-surface/react-surface.tsx +14 -11
  202. package/src/capabilities/spotlight-dismiss/spotlight-dismiss.ts +2 -2
  203. package/src/capabilities/state/state.tsx +6 -3
  204. package/src/capabilities/url-handler/url-handler.ts +110 -45
  205. package/src/components/ContentError.stories.tsx +8 -7
  206. package/src/components/DebugOverlay/DebugOverlay.tsx +96 -0
  207. package/src/components/DebugOverlay/index.ts +5 -0
  208. package/src/components/Dialog/Dialog.tsx +5 -5
  209. package/src/components/Home/Home.tsx +49 -42
  210. package/src/components/{ContentLoading.stories.tsx → Loading/Loading.stories.tsx} +5 -5
  211. package/src/components/{ContentLoading.tsx → Loading/Loading.tsx} +2 -2
  212. package/src/components/Loading/index.ts +5 -0
  213. package/src/components/MobileLayout/MobileLayout.stories.tsx +133 -0
  214. package/src/components/MobileLayout/MobileLayout.tsx +374 -0
  215. package/src/components/MobileLayout/index.ts +5 -0
  216. package/src/components/NavBranch/NavBranch.tsx +127 -0
  217. package/src/components/{Workspace → NavBranch}/index.ts +1 -1
  218. package/src/components/Popover/Popover.tsx +7 -7
  219. package/src/components/SimpleLayout/AppBar.stories.tsx +144 -0
  220. package/src/components/SimpleLayout/AppBar.tsx +93 -0
  221. package/src/components/SimpleLayout/Drawer.tsx +96 -0
  222. package/src/components/SimpleLayout/Main.tsx +45 -48
  223. package/src/components/SimpleLayout/NavBar.stories.tsx +131 -26
  224. package/src/components/SimpleLayout/NavBar.tsx +21 -62
  225. package/src/components/SimpleLayout/SimpleLayout.stories.tsx +43 -53
  226. package/src/components/SimpleLayout/SimpleLayout.tsx +44 -6
  227. package/src/components/SimpleLayout/index.ts +3 -0
  228. package/src/components/hooks.ts +10 -14
  229. package/src/components/index.ts +4 -2
  230. package/src/hooks/actions.ts +83 -0
  231. package/src/hooks/index.ts +5 -0
  232. package/src/hooks/useAppBarProps.ts +115 -0
  233. package/src/hooks/useCompanions.ts +22 -0
  234. package/src/hooks/useDrawerActions.ts +100 -0
  235. package/src/hooks/useNavbarActions.ts +87 -0
  236. package/src/hooks/useSimpleLayoutState.ts +5 -5
  237. package/src/meta.ts +1 -1
  238. package/src/operations/close.ts +34 -0
  239. package/src/operations/index.ts +16 -0
  240. package/src/operations/open.ts +32 -0
  241. package/src/operations/revert-workspace.ts +22 -0
  242. package/src/operations/set-layout-mode.ts +12 -0
  243. package/src/operations/set.ts +23 -0
  244. package/src/operations/state-access.ts +19 -0
  245. package/src/operations/switch-workspace.ts +26 -0
  246. package/src/operations/update-complementary.ts +34 -0
  247. package/src/operations/update-dialog.ts +28 -0
  248. package/src/operations/update-popover.ts +35 -0
  249. package/src/operations/update-sidebar.ts +12 -0
  250. package/src/translations.ts +8 -1
  251. package/src/types/capabilities.ts +13 -4
  252. package/src/types/events.ts +3 -2
  253. package/dist/lib/browser/chunk-CLPGTNWJ.mjs.map +0 -7
  254. package/dist/lib/browser/chunk-FK4M7GJV.mjs +0 -613
  255. package/dist/lib/browser/chunk-FK4M7GJV.mjs.map +0 -7
  256. package/dist/lib/browser/operation-resolver-LTB63NKP.mjs +0 -168
  257. package/dist/lib/browser/operation-resolver-LTB63NKP.mjs.map +0 -7
  258. package/dist/lib/browser/react-root-6ARAPH3O.mjs.map +0 -7
  259. package/dist/lib/browser/react-surface-SO7B23GS.mjs.map +0 -7
  260. package/dist/lib/browser/spotlight-dismiss-VSNOPETH.mjs.map +0 -7
  261. package/dist/lib/browser/state-H4IGICBB.mjs.map +0 -7
  262. package/dist/lib/browser/url-handler-7CFGTLNG.mjs +0 -54
  263. package/dist/lib/browser/url-handler-7CFGTLNG.mjs.map +0 -7
  264. package/dist/lib/node-esm/chunk-EGFZAVBD.mjs +0 -614
  265. package/dist/lib/node-esm/chunk-EGFZAVBD.mjs.map +0 -7
  266. package/dist/lib/node-esm/chunk-MUVVYBUE.mjs.map +0 -7
  267. package/dist/lib/node-esm/operation-resolver-7O6O7T4Q.mjs +0 -169
  268. package/dist/lib/node-esm/operation-resolver-7O6O7T4Q.mjs.map +0 -7
  269. package/dist/lib/node-esm/react-root-2CPA2ZUS.mjs.map +0 -7
  270. package/dist/lib/node-esm/react-surface-FKAV56MO.mjs.map +0 -7
  271. package/dist/lib/node-esm/spotlight-dismiss-L5PCWIJG.mjs.map +0 -7
  272. package/dist/lib/node-esm/state-QIU2LMLT.mjs.map +0 -7
  273. package/dist/lib/node-esm/url-handler-4LYP3JM7.mjs +0 -55
  274. package/dist/lib/node-esm/url-handler-4LYP3JM7.mjs.map +0 -7
  275. package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
  276. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
  277. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
  278. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
  279. package/dist/types/src/components/ContentError.d.ts +0 -5
  280. package/dist/types/src/components/ContentError.d.ts.map +0 -1
  281. package/dist/types/src/components/ContentLoading.d.ts +0 -3
  282. package/dist/types/src/components/ContentLoading.d.ts.map +0 -1
  283. package/dist/types/src/components/ContentLoading.stories.d.ts.map +0 -1
  284. package/dist/types/src/components/SimpleLayout/Banner.d.ts +0 -8
  285. package/dist/types/src/components/SimpleLayout/Banner.d.ts.map +0 -1
  286. package/dist/types/src/components/Workspace/Workspace.d.ts +0 -9
  287. package/dist/types/src/components/Workspace/Workspace.d.ts.map +0 -1
  288. package/dist/types/src/components/Workspace/index.d.ts +0 -2
  289. package/dist/types/src/components/Workspace/index.d.ts.map +0 -1
  290. package/src/capabilities/operation-resolver/index.ts +0 -10
  291. package/src/capabilities/operation-resolver/operation-resolver.ts +0 -178
  292. package/src/components/ContentError.tsx +0 -23
  293. package/src/components/SimpleLayout/Banner.tsx +0 -82
  294. package/src/components/Workspace/Workspace.tsx +0 -115
@@ -1,613 +0,0 @@
1
- import {
2
- SimpleLayoutState,
3
- meta
4
- } from "./chunk-CLPGTNWJ.mjs";
5
-
6
- // src/components/Home/Home.tsx
7
- import React, { useCallback, useEffect as useEffect2, useMemo, useRef } from "react";
8
- import { Common } from "@dxos/app-framework";
9
- import { useAppGraph as useAppGraph2, useOperationInvoker } from "@dxos/app-framework/react";
10
- import { Node, useConnections } from "@dxos/plugin-graph";
11
- import { Avatar, Icon, Toolbar, toLocalizedString, useTranslation } from "@dxos/react-ui";
12
- import { Card, Layout, Mosaic } from "@dxos/react-ui-mosaic";
13
- import { SearchList, useSearchListItem, useSearchListResults } from "@dxos/react-ui-searchlist";
14
- import { mx } from "@dxos/ui-theme";
15
- import { byPosition } from "@dxos/util";
16
-
17
- // src/components/hooks.ts
18
- import { useEffect } from "react";
19
- import { useAppGraph } from "@dxos/app-framework/react";
20
- import { Graph } from "@dxos/plugin-graph";
21
- var useLoadDescendents = (nodeId) => {
22
- const { graph } = useAppGraph();
23
- useEffect(() => {
24
- const frame = requestAnimationFrame(() => {
25
- if (nodeId) {
26
- Graph.expand(graph, nodeId, "outbound");
27
- Graph.getConnections(graph, nodeId, "outbound").forEach((child) => {
28
- Graph.expand(graph, child.id, "outbound");
29
- });
30
- }
31
- });
32
- return () => cancelAnimationFrame(frame);
33
- }, [
34
- nodeId,
35
- graph
36
- ]);
37
- };
38
-
39
- // src/components/Home/Home.tsx
40
- var Home = (_) => {
41
- const { t } = useTranslation(meta.id);
42
- const userAccountItem = useItemsByDisposition("user-account")[0];
43
- const pinnedItems = useItemsByDisposition("pin-end", true);
44
- const workspaceItems = useItemsByDisposition("workspace");
45
- useLoadDescendents(Node.RootId);
46
- const items = useMemo(() => [
47
- ...userAccountItem ? [
48
- userAccountItem
49
- ] : [],
50
- ...pinnedItems,
51
- ...workspaceItems
52
- ], [
53
- userAccountItem,
54
- pinnedItems,
55
- workspaceItems
56
- ]);
57
- const { results, handleSearch } = useSearchListResults({
58
- items,
59
- extract: (node) => toLocalizedString(node.properties.label, t)
60
- });
61
- return /* @__PURE__ */ React.createElement(Layout.Main, {
62
- toolbar: true
63
- }, /* @__PURE__ */ React.createElement(SearchList.Root, {
64
- onSearch: handleSearch
65
- }, /* @__PURE__ */ React.createElement(Toolbar.Root, null, /* @__PURE__ */ React.createElement(SearchList.Input, {
66
- placeholder: t("search placeholder"),
67
- autoFocus: true
68
- })), /* @__PURE__ */ React.createElement(SearchList.Content, null, /* @__PURE__ */ React.createElement(Mosaic.Container, {
69
- asChild: true
70
- }, /* @__PURE__ */ React.createElement(Mosaic.Viewport, {
71
- padding: true
72
- }, /* @__PURE__ */ React.createElement(Mosaic.Stack, {
73
- items: results,
74
- getId: (node) => node.id,
75
- Tile: WorkspaceTile
76
- }))))));
77
- };
78
- var WorkspaceTile = ({ data }) => {
79
- const { t } = useTranslation(meta.id);
80
- const { invokePromise } = useOperationInvoker();
81
- const { selectedValue, registerItem, unregisterItem } = useSearchListItem();
82
- const ref = useRef(null);
83
- const handleSelect = useCallback(() => invokePromise(Common.LayoutOperation.SwitchWorkspace, {
84
- subject: data.id
85
- }), [
86
- invokePromise,
87
- data.id
88
- ]);
89
- useLoadDescendents(data.id);
90
- const name = toLocalizedString(data.properties.label, t);
91
- const isSelected = selectedValue === data.id;
92
- useEffect2(() => {
93
- if (ref.current) {
94
- registerItem(data.id, ref.current, handleSelect);
95
- }
96
- return () => unregisterItem(data.id);
97
- }, [
98
- data.id,
99
- handleSelect,
100
- registerItem,
101
- unregisterItem
102
- ]);
103
- useEffect2(() => {
104
- if (isSelected && ref.current) {
105
- ref.current.scrollIntoView({
106
- block: "nearest",
107
- behavior: "smooth"
108
- });
109
- }
110
- }, [
111
- isSelected
112
- ]);
113
- return /* @__PURE__ */ React.createElement(Card.Root, {
114
- ref,
115
- role: "button",
116
- fullWidth: true,
117
- tabIndex: -1,
118
- "data-selected": isSelected,
119
- classNames: mx("dx-focus-ring", isSelected && "bg-hoverOverlay"),
120
- onClick: handleSelect
121
- }, /* @__PURE__ */ React.createElement(Card.Toolbar, {
122
- density: "coarse"
123
- }, /* @__PURE__ */ React.createElement(Avatar.Root, null, /* @__PURE__ */ React.createElement(Avatar.Content, {
124
- icon: data.properties.icon,
125
- hue: data.properties.hue,
126
- hueVariant: "transparent",
127
- variant: "square",
128
- size: 12,
129
- fallback: name
130
- }), /* @__PURE__ */ React.createElement(Avatar.Label, null, name), /* @__PURE__ */ React.createElement(Icon, {
131
- icon: "ph--caret-right--regular"
132
- }))));
133
- };
134
- var filterItems = (node, disposition) => {
135
- return node.properties.disposition === disposition;
136
- };
137
- var useItemsByDisposition = (disposition, sort = false) => {
138
- const { graph } = useAppGraph2();
139
- const connections = useConnections(graph, Node.RootId);
140
- const filtered = connections.filter((node) => filterItems(node, disposition));
141
- return sort ? filtered.toSorted((a, b) => byPosition(a.properties, b.properties)) : filtered;
142
- };
143
-
144
- // src/components/SimpleLayout/SimpleLayout.tsx
145
- import React9 from "react";
146
-
147
- // src/components/Dialog/Dialog.tsx
148
- import React3 from "react";
149
- import { Surface } from "@dxos/app-framework/react";
150
- import { AlertDialog, Dialog as NaturalDialog } from "@dxos/react-ui";
151
-
152
- // src/hooks/useSimpleLayoutState.ts
153
- import { RegistryContext, useAtomValue } from "@effect-atom/atom-react";
154
- import { useCallback as useCallback2, useContext } from "react";
155
- import { useCapability } from "@dxos/app-framework/react";
156
- var useSimpleLayoutState = () => {
157
- const registry = useContext(RegistryContext);
158
- const stateAtom = useCapability(SimpleLayoutState);
159
- const state = useAtomValue(stateAtom);
160
- const updateState = useCallback2((fn) => {
161
- registry.set(stateAtom, fn(registry.get(stateAtom)));
162
- }, [
163
- registry,
164
- stateAtom
165
- ]);
166
- return {
167
- state,
168
- updateState
169
- };
170
- };
171
-
172
- // src/components/ContentError.tsx
173
- import React2 from "react";
174
- import { useTranslation as useTranslation2 } from "@dxos/react-ui";
175
- import { descriptionMessage, mx as mx2 } from "@dxos/ui-theme";
176
- var ContentError = ({ error }) => {
177
- const { t } = useTranslation2(meta.id);
178
- const errorString = error?.toString() ?? "";
179
- return /* @__PURE__ */ React2.createElement("div", {
180
- role: "none",
181
- className: "grid place-items-center overflow-y-auto attention-surface"
182
- }, /* @__PURE__ */ React2.createElement("p", {
183
- role: "alert",
184
- className: mx2(descriptionMessage, "p-2 break-all rounded-sm")
185
- }, error ? errorString : t("error fallback message")));
186
- };
187
-
188
- // src/components/Dialog/Dialog.tsx
189
- var Dialog = () => {
190
- const { state, updateState } = useSimpleLayoutState();
191
- const DialogRoot = state.dialogType === "alert" ? AlertDialog.Root : NaturalDialog.Root;
192
- const DialogOverlay = state.dialogType === "alert" ? AlertDialog.Overlay : NaturalDialog.Overlay;
193
- return /* @__PURE__ */ React3.createElement(DialogRoot, {
194
- modal: state.dialogBlockAlign !== "end",
195
- open: state.dialogOpen,
196
- onOpenChange: (nextOpen) => updateState((s) => ({
197
- ...s,
198
- dialogOpen: nextOpen
199
- }))
200
- }, state.dialogBlockAlign === "end" ? /* @__PURE__ */ React3.createElement(Surface, {
201
- role: "dialog",
202
- data: state.dialogContent,
203
- limit: 1,
204
- fallback: ContentError
205
- }) : /* @__PURE__ */ React3.createElement(DialogOverlay, {
206
- blockAlign: state.dialogBlockAlign,
207
- classNames: state.dialogOverlayClasses,
208
- style: state.dialogOverlayStyle
209
- }, /* @__PURE__ */ React3.createElement(Surface, {
210
- role: "dialog",
211
- data: state.dialogContent,
212
- limit: 1,
213
- fallback: ContentError
214
- })));
215
- };
216
-
217
- // src/components/Popover/Popover.tsx
218
- import { createContext } from "@radix-ui/react-context";
219
- import React4, { useCallback as useCallback3, useEffect as useEffect3, useMemo as useMemo2, useRef as useRef2, useState } from "react";
220
- import { Surface as Surface2 } from "@dxos/app-framework/react";
221
- import { Popover, toLocalizedString as toLocalizedString2, useTranslation as useTranslation3 } from "@dxos/react-ui";
222
- import { Card as Card2 } from "@dxos/react-ui-mosaic";
223
- var DEBOUNCE_DELAY = 40;
224
- var [LayoutPopoverProvider, useLayoutPopoverContext] = createContext("LayoutPopover");
225
- var PopoverRoot = ({ children }) => {
226
- const { state } = useSimpleLayoutState();
227
- const [open, setOpen] = useState(false);
228
- const virtualRef = useRef2(null);
229
- const [virtualIter, setVirtualIter] = useState(0);
230
- const debounceRef = useRef2(null);
231
- useEffect3(() => {
232
- setOpen(false);
233
- if (state.popoverOpen) {
234
- if (debounceRef.current) {
235
- clearTimeout(debounceRef.current);
236
- }
237
- if (state.popoverAnchor && virtualRef.current !== state.popoverAnchor) {
238
- virtualRef.current = state.popoverAnchor ?? null;
239
- setVirtualIter((iter) => iter + 1);
240
- }
241
- debounceRef.current = setTimeout(() => setOpen(true), DEBOUNCE_DELAY);
242
- }
243
- }, [
244
- state.popoverOpen,
245
- state.popoverAnchorId,
246
- state.popoverAnchor,
247
- state.popoverContent
248
- ]);
249
- return /* @__PURE__ */ React4.createElement(LayoutPopoverProvider, {
250
- setOpen
251
- }, /* @__PURE__ */ React4.createElement(Popover.Root, {
252
- modal: false,
253
- open
254
- }, state.popoverAnchor && /* @__PURE__ */ React4.createElement(Popover.VirtualTrigger, {
255
- key: virtualIter,
256
- virtualRef
257
- }), children));
258
- };
259
- var PopoverContent = () => {
260
- const { t } = useTranslation3(meta.id);
261
- const { state, updateState } = useSimpleLayoutState();
262
- const { setOpen } = useLayoutPopoverContext("PopoverContent");
263
- const handleClose = useCallback3(() => {
264
- setOpen(false);
265
- updateState((s) => ({
266
- ...s,
267
- popoverOpen: false,
268
- popoverAnchor: void 0,
269
- popoverAnchorId: void 0,
270
- popoverSide: void 0
271
- }));
272
- }, [
273
- setOpen,
274
- updateState
275
- ]);
276
- const handleInteractOutside = useCallback3((event) => {
277
- if (
278
- // TODO(thure): CodeMirror should not focus itself when it updates.
279
- event.type === "dismissableLayer.focusOutside" && event.currentTarget?.classList.contains("cm-content")
280
- ) {
281
- event.preventDefault();
282
- } else {
283
- handleClose();
284
- }
285
- }, [
286
- handleClose
287
- ]);
288
- const collisionBoundaries = useMemo2(() => {
289
- const closest = state.popoverAnchor?.closest("[data-popover-collision-boundary]");
290
- return closest ? [
291
- closest
292
- ] : [];
293
- }, [
294
- state.popoverAnchor
295
- ]);
296
- return /* @__PURE__ */ React4.createElement(Popover.Portal, null, /* @__PURE__ */ React4.createElement(Popover.Content, {
297
- side: state.popoverSide,
298
- sticky: "always",
299
- hideWhenDetached: true,
300
- collisionBoundary: collisionBoundaries,
301
- onInteractOutside: handleInteractOutside,
302
- onEscapeKeyDown: handleInteractOutside
303
- }, /* @__PURE__ */ React4.createElement(Popover.Viewport, null, state.popoverKind === "card" && /* @__PURE__ */ React4.createElement(Card2.Root, null, /* @__PURE__ */ React4.createElement(Card2.Toolbar, null, /* @__PURE__ */ React4.createElement("span", null), state.popoverTitle ? /* @__PURE__ */ React4.createElement(Card2.Title, null, toLocalizedString2(state.popoverTitle, t)) : /* @__PURE__ */ React4.createElement("span", null), /* @__PURE__ */ React4.createElement(Card2.Close, {
304
- onClick: handleClose
305
- })), /* @__PURE__ */ React4.createElement(Surface2, {
306
- role: "card--content",
307
- data: state.popoverContent,
308
- limit: 1
309
- })), state.popoverKind === "base" && /* @__PURE__ */ React4.createElement(Surface2, {
310
- role: "popover",
311
- data: state.popoverContent,
312
- limit: 1
313
- })), /* @__PURE__ */ React4.createElement(Popover.Arrow, null)));
314
- };
315
-
316
- // src/components/SimpleLayout/Main.tsx
317
- import React8, { useCallback as useCallback5, useMemo as useMemo4 } from "react";
318
- import { Surface as Surface3, useAppGraph as useAppGraph5 } from "@dxos/app-framework/react";
319
- import { log } from "@dxos/log";
320
- import { useNode } from "@dxos/plugin-graph";
321
- import { Main as NaturalMain } from "@dxos/react-ui";
322
- import { ATTENDABLE_PATH_SEPARATOR } from "@dxos/react-ui-attention";
323
- import { Mosaic as Mosaic2 } from "@dxos/react-ui-mosaic";
324
- import { mx as mx5 } from "@dxos/ui-theme";
325
-
326
- // src/components/ContentLoading.tsx
327
- import React5 from "react";
328
- var ContentLoading = () => {
329
- return /* @__PURE__ */ React5.createElement("div", {
330
- role: "none",
331
- className: "grid place-items-center attention-surface"
332
- });
333
- };
334
-
335
- // src/components/SimpleLayout/Banner.tsx
336
- import React6, { useCallback as useCallback4, useMemo as useMemo3 } from "react";
337
- import { Common as Common2 } from "@dxos/app-framework";
338
- import { useAppGraph as useAppGraph3, useOperationInvoker as useOperationInvoker2 } from "@dxos/app-framework/react";
339
- import { Graph as Graph2, Node as Node2 } from "@dxos/plugin-graph";
340
- import { IconButton, Toolbar as Toolbar2, toLocalizedString as toLocalizedString3, useTranslation as useTranslation4 } from "@dxos/react-ui";
341
- import { mx as mx3, osTranslations } from "@dxos/ui-theme";
342
- var isWorkspaceOrCollectionChild = (graph, itemId) => {
343
- const parents = Graph2.getConnections(graph, itemId, "inbound");
344
- return parents.some((node) => node.properties.disposition === "workspace" || node.properties.disposition === "collection");
345
- };
346
- var Banner = ({ node, classNames }) => {
347
- const { t } = useTranslation4(meta.id);
348
- const { state } = useSimpleLayoutState();
349
- const { invokePromise } = useOperationInvoker2();
350
- const { graph } = useAppGraph3();
351
- const label = (node && toLocalizedString3(node.properties.label, t)) ?? t("current app name", {
352
- ns: osTranslations
353
- });
354
- const isTopLevelItem = useMemo3(() => {
355
- if (!state.active) {
356
- return false;
357
- }
358
- return isWorkspaceOrCollectionChild(graph, state.active);
359
- }, [
360
- graph,
361
- state.active
362
- ]);
363
- const handleClick = useCallback4(async () => {
364
- if (state.active) {
365
- if (state.history.length === 0 && isTopLevelItem) {
366
- await invokePromise(Common2.LayoutOperation.SwitchWorkspace, {
367
- subject: Node2.RootId
368
- });
369
- } else {
370
- await invokePromise(Common2.LayoutOperation.Close, {
371
- subject: [
372
- state.active
373
- ]
374
- });
375
- }
376
- } else {
377
- await invokePromise(Common2.LayoutOperation.SwitchWorkspace, {
378
- subject: Node2.RootId
379
- });
380
- }
381
- }, [
382
- invokePromise,
383
- state.active,
384
- state.history.length,
385
- isTopLevelItem
386
- ]);
387
- if (!node) {
388
- return null;
389
- }
390
- return /* @__PURE__ */ React6.createElement(Toolbar2.Root, {
391
- role: "banner",
392
- classNames: mx3("grid grid-cols-[var(--rail-size)_1fr_var(--rail-size)]", classNames)
393
- }, node.id !== Node2.RootId ? /* @__PURE__ */ React6.createElement(IconButton, {
394
- iconOnly: true,
395
- variant: "ghost",
396
- icon: "ph--caret-left--regular",
397
- label: t("back label"),
398
- onClick: handleClick
399
- }) : /* @__PURE__ */ React6.createElement("div", null), /* @__PURE__ */ React6.createElement("h1", {
400
- className: "grow text-center truncate font-medium"
401
- }, label), /* @__PURE__ */ React6.createElement(IconButton, {
402
- iconOnly: true,
403
- variant: "ghost",
404
- icon: "ph--dots-three-vertical--regular",
405
- label: t("menu label")
406
- }));
407
- };
408
-
409
- // src/components/SimpleLayout/NavBar.tsx
410
- import React7 from "react";
411
- import { useAppGraph as useAppGraph4 } from "@dxos/app-framework/react";
412
- import { Node as Node3, useActionRunner, useConnections as useConnections2 } from "@dxos/plugin-graph";
413
- import { IconButton as IconButton2, Toolbar as Toolbar3, Tooltip, useTranslation as useTranslation5 } from "@dxos/react-ui";
414
- import { DropdownMenu, MenuProvider } from "@dxos/react-ui-menu";
415
- import { mx as mx4 } from "@dxos/ui-theme";
416
- var NavBar = ({ classNames, activeId, onActiveIdChange }) => {
417
- const { t } = useTranslation5(meta.id);
418
- const { graph } = useAppGraph4();
419
- const runAction = useActionRunner();
420
- const connections = useConnections2(graph, Node3.RootId);
421
- const menuActions = connections.filter((node) => node.properties.disposition === "menu");
422
- const isBrowseActive = activeId !== "notifications" && activeId !== "profile";
423
- return /* @__PURE__ */ React7.createElement(Toolbar3.Root, {
424
- classNames: mx4("justify-center", classNames)
425
- }, /* @__PURE__ */ React7.createElement(MenuProvider, {
426
- onAction: runAction
427
- }, /* @__PURE__ */ React7.createElement(DropdownMenu.Root, {
428
- items: menuActions
429
- }, /* @__PURE__ */ React7.createElement(Tooltip.Trigger, {
430
- asChild: true,
431
- content: t("app menu label")
432
- }, /* @__PURE__ */ React7.createElement(DropdownMenu.Trigger, {
433
- asChild: true,
434
- "data-testid": "spacePlugin.addSpace"
435
- }, /* @__PURE__ */ React7.createElement(IconButton2, {
436
- icon: "ph--plus--regular",
437
- iconOnly: true,
438
- label: t("main menu label")
439
- }))))));
440
- };
441
-
442
- // src/components/SimpleLayout/Main.tsx
443
- var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-simple-layout/src/components/SimpleLayout/Main.tsx";
444
- var Main = () => {
445
- const { state } = useSimpleLayoutState();
446
- const id = state.active ?? state.workspace;
447
- const showNavBar = !state.isPopover;
448
- const { graph } = useAppGraph5();
449
- const node = useNode(graph, id);
450
- const placeholder = useMemo4(() => /* @__PURE__ */ React8.createElement(ContentLoading, null), []);
451
- const data = useMemo4(() => {
452
- const { variant } = parseEntryId(id);
453
- return node && {
454
- attendableId: id,
455
- subject: node.data,
456
- properties: node.properties,
457
- popoverAnchorId: state.popoverAnchorId,
458
- variant
459
- };
460
- }, [
461
- id,
462
- node,
463
- node?.data,
464
- node?.properties,
465
- state.popoverAnchorId
466
- ]);
467
- const handleActiveIdChange = useCallback5((nextActiveId) => {
468
- log.info("navigate", {
469
- nextActiveId
470
- }, {
471
- F: __dxlog_file,
472
- L: 48,
473
- S: void 0,
474
- C: (f, a) => f(...a)
475
- });
476
- }, []);
477
- return /* @__PURE__ */ React8.createElement(Mosaic2.Root, null, /* @__PURE__ */ React8.createElement(NaturalMain.Root, {
478
- complementarySidebarState: "closed",
479
- navigationSidebarState: "closed"
480
- }, /* @__PURE__ */ React8.createElement(NaturalMain.Content, {
481
- bounce: true,
482
- classNames: mx5("dx-mobile-main dx-mobile-main-scroll-area--flush", "grid bs-full overflow-hidden", showNavBar ? "grid-rows-[min-content_1fr_min-content]" : "grid-rows-[min-content_1fr]")
483
- }, /* @__PURE__ */ React8.createElement(Banner, {
484
- classNames: "border-be border-separator",
485
- node
486
- }), /* @__PURE__ */ React8.createElement("article", {
487
- className: "contents"
488
- }, /* @__PURE__ */ React8.createElement(Surface3, {
489
- key: id,
490
- role: "article",
491
- data,
492
- limit: 1,
493
- fallback: ContentError,
494
- placeholder
495
- })), showNavBar && /* @__PURE__ */ React8.createElement(NavBar, {
496
- classNames: "border-bs border-separator",
497
- activeId: id,
498
- onActiveIdChange: handleActiveIdChange
499
- }))));
500
- };
501
- var parseEntryId = (entryId) => {
502
- const [id, variant] = entryId.split(ATTENDABLE_PATH_SEPARATOR);
503
- return {
504
- id,
505
- variant
506
- };
507
- };
508
- Main.displayName = "SimpleLayout.Main";
509
-
510
- // src/components/SimpleLayout/SimpleLayout.tsx
511
- var SimpleLayout = () => {
512
- return /* @__PURE__ */ React9.createElement(PopoverRoot, null, /* @__PURE__ */ React9.createElement(Main, null), /* @__PURE__ */ React9.createElement(Dialog, null), /* @__PURE__ */ React9.createElement(PopoverContent, null));
513
- };
514
-
515
- // src/components/Workspace/Workspace.tsx
516
- import React10, { useCallback as useCallback6, useEffect as useEffect4, useRef as useRef3 } from "react";
517
- import { Common as Common3 } from "@dxos/app-framework";
518
- import { useAppGraph as useAppGraph6, useOperationInvoker as useOperationInvoker3 } from "@dxos/app-framework/react";
519
- import { useConnections as useConnections3 } from "@dxos/plugin-graph";
520
- import { Avatar as Avatar2, Icon as Icon2, Toolbar as Toolbar4, toLocalizedString as toLocalizedString4, useTranslation as useTranslation6 } from "@dxos/react-ui";
521
- import { Card as Card3, Layout as Layout2, Mosaic as Mosaic3 } from "@dxos/react-ui-mosaic";
522
- import { SearchList as SearchList2, useSearchListItem as useSearchListItem2, useSearchListResults as useSearchListResults2 } from "@dxos/react-ui-searchlist";
523
- import { mx as mx6 } from "@dxos/ui-theme";
524
- var Workspace = ({ id }) => {
525
- const { t } = useTranslation6(meta.id);
526
- const { graph } = useAppGraph6();
527
- useLoadDescendents(id);
528
- const children = useConnections3(graph, id, "outbound");
529
- const { results, handleSearch } = useSearchListResults2({
530
- items: children,
531
- extract: (child) => toLocalizedString4(child.properties.label, t)
532
- });
533
- return /* @__PURE__ */ React10.createElement(Layout2.Main, {
534
- toolbar: true
535
- }, /* @__PURE__ */ React10.createElement(SearchList2.Root, {
536
- onSearch: handleSearch
537
- }, /* @__PURE__ */ React10.createElement(Toolbar4.Root, null, /* @__PURE__ */ React10.createElement(SearchList2.Input, {
538
- placeholder: t("search placeholder"),
539
- autoFocus: true
540
- })), /* @__PURE__ */ React10.createElement(SearchList2.Content, null, /* @__PURE__ */ React10.createElement(Mosaic3.Container, {
541
- asChild: true
542
- }, /* @__PURE__ */ React10.createElement(Mosaic3.Viewport, {
543
- padding: true
544
- }, /* @__PURE__ */ React10.createElement(Mosaic3.Stack, {
545
- items: results,
546
- getId: (child) => child.id,
547
- Tile: WorkspaceChildTile
548
- }))))));
549
- };
550
- var WorkspaceChildTile = ({ data }) => {
551
- const { t } = useTranslation6(meta.id);
552
- const { invokeSync } = useOperationInvoker3();
553
- const ref = useRef3(null);
554
- const { selectedValue, registerItem, unregisterItem } = useSearchListItem2();
555
- const isSelected = selectedValue === data.id;
556
- const name = toLocalizedString4(data.properties.label, t);
557
- const handleSelect = useCallback6(() => invokeSync(Common3.LayoutOperation.Open, {
558
- subject: [
559
- data.id
560
- ]
561
- }), [
562
- invokeSync,
563
- data.id
564
- ]);
565
- useEffect4(() => {
566
- if (ref.current) {
567
- registerItem(data.id, ref.current, handleSelect);
568
- }
569
- return () => unregisterItem(data.id);
570
- }, [
571
- data.id,
572
- handleSelect,
573
- registerItem,
574
- unregisterItem
575
- ]);
576
- useEffect4(() => {
577
- if (isSelected && ref.current) {
578
- ref.current.scrollIntoView({
579
- block: "nearest",
580
- behavior: "smooth"
581
- });
582
- }
583
- }, [
584
- isSelected
585
- ]);
586
- return /* @__PURE__ */ React10.createElement(Card3.Root, {
587
- ref,
588
- role: "button",
589
- fullWidth: true,
590
- tabIndex: -1,
591
- "data-selected": isSelected,
592
- classNames: mx6("dx-focus-ring", isSelected && "bg-hoverOverlay"),
593
- onClick: handleSelect
594
- }, /* @__PURE__ */ React10.createElement(Card3.Toolbar, {
595
- density: "coarse"
596
- }, /* @__PURE__ */ React10.createElement(Avatar2.Root, null, /* @__PURE__ */ React10.createElement(Avatar2.Content, {
597
- hue: data.properties.hue,
598
- icon: data.properties.icon,
599
- hueVariant: "transparent",
600
- variant: "square",
601
- size: 12,
602
- fallback: name
603
- }), /* @__PURE__ */ React10.createElement(Avatar2.Label, null, name), /* @__PURE__ */ React10.createElement(Icon2, {
604
- icon: "ph--caret-right--regular"
605
- }))));
606
- };
607
-
608
- export {
609
- Home,
610
- SimpleLayout,
611
- Workspace
612
- };
613
- //# sourceMappingURL=chunk-FK4M7GJV.mjs.map