@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-simple-layout",
3
- "version": "0.8.4-main.2244d791bb",
3
+ "version": "0.8.4-main.3fbcb4aa9b",
4
4
  "description": "Simple layout plugin for minimal UI contexts like popover windows.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -12,12 +12,63 @@
12
12
  "author": "DXOS.org",
13
13
  "sideEffects": true,
14
14
  "type": "module",
15
+ "imports": {
16
+ "#capabilities": {
17
+ "source": "./src/capabilities/index.ts",
18
+ "types": "./dist/types/src/capabilities/index.d.ts",
19
+ "default": "./dist/lib/neutral/capabilities/index.mjs"
20
+ },
21
+ "#components": {
22
+ "source": "./src/components/index.ts",
23
+ "types": "./dist/types/src/components/index.d.ts",
24
+ "default": "./dist/lib/neutral/components/index.mjs"
25
+ },
26
+ "#hooks": {
27
+ "source": "./src/hooks/index.ts",
28
+ "types": "./dist/types/src/hooks/index.d.ts",
29
+ "default": "./dist/lib/neutral/hooks/index.mjs"
30
+ },
31
+ "#meta": {
32
+ "source": "./src/meta.ts",
33
+ "types": "./dist/types/src/meta.d.ts",
34
+ "default": "./dist/lib/neutral/meta.mjs"
35
+ },
36
+ "#operations": {
37
+ "source": "./src/operations/index.ts",
38
+ "types": "./dist/types/src/operations/index.d.ts",
39
+ "default": "./dist/lib/neutral/operations/index.mjs"
40
+ },
41
+ "#plugin": {
42
+ "source": "./src/SimpleLayoutPlugin.ts",
43
+ "types": "./dist/types/src/SimpleLayoutPlugin.d.ts",
44
+ "default": "./dist/lib/neutral/SimpleLayoutPlugin.mjs"
45
+ },
46
+ "#translations": {
47
+ "source": "./src/translations.ts",
48
+ "types": "./dist/types/src/translations.d.ts",
49
+ "default": "./dist/lib/neutral/translations.mjs"
50
+ },
51
+ "#types": {
52
+ "source": "./src/types/index.ts",
53
+ "types": "./dist/types/src/types/index.d.ts",
54
+ "default": "./dist/lib/neutral/types/index.mjs"
55
+ }
56
+ },
15
57
  "exports": {
16
58
  ".": {
17
- "browser": "./dist/lib/browser/index.mjs",
18
- "node": "./dist/lib/node-esm/index.mjs",
19
59
  "source": "./src/index.ts",
20
- "types": "./dist/types/src/index.d.ts"
60
+ "types": "./dist/types/src/index.d.ts",
61
+ "default": "./dist/lib/neutral/index.mjs"
62
+ },
63
+ "./plugin": {
64
+ "source": "./src/plugin.ts",
65
+ "types": "./dist/types/src/plugin.d.ts",
66
+ "default": "./dist/lib/neutral/plugin.mjs"
67
+ },
68
+ "./translations": {
69
+ "source": "./src/translations.ts",
70
+ "types": "./dist/types/src/translations.d.ts",
71
+ "default": "./dist/lib/neutral/translations.mjs"
21
72
  }
22
73
  },
23
74
  "types": "dist/types/src/index.d.ts",
@@ -31,44 +82,48 @@
31
82
  "@radix-ui/react-context": "1.1.1",
32
83
  "@tauri-apps/plugin-deep-link": "^2.2.0",
33
84
  "@tauri-apps/plugin-haptics": "^2.3.2",
34
- "@dxos/app-framework": "0.8.4-main.2244d791bb",
35
- "@dxos/async": "0.8.4-main.2244d791bb",
36
- "@dxos/app-toolkit": "0.8.4-main.2244d791bb",
37
- "@dxos/log": "0.8.4-main.2244d791bb",
38
- "@dxos/operation": "0.8.4-main.2244d791bb",
39
- "@dxos/plugin-graph": "0.8.4-main.2244d791bb",
40
- "@dxos/react-ui-attention": "0.8.4-main.2244d791bb",
41
- "@dxos/react-ui-menu": "0.8.4-main.2244d791bb",
42
- "@dxos/react-ui-mosaic": "0.8.4-main.2244d791bb",
43
- "@dxos/react-ui-searchlist": "0.8.4-main.2244d791bb",
44
- "@dxos/react-ui-stack": "0.8.4-main.2244d791bb",
45
- "@dxos/schema": "0.8.4-main.2244d791bb",
46
- "@dxos/util": "0.8.4-main.2244d791bb"
85
+ "@dxos/app-toolkit": "0.8.4-main.3fbcb4aa9b",
86
+ "@dxos/app-framework": "0.8.4-main.3fbcb4aa9b",
87
+ "@dxos/async": "0.8.4-main.3fbcb4aa9b",
88
+ "@dxos/compute": "0.8.4-main.3fbcb4aa9b",
89
+ "@dxos/effect": "0.8.4-main.3fbcb4aa9b",
90
+ "@dxos/log": "0.8.4-main.3fbcb4aa9b",
91
+ "@dxos/context": "0.8.4-main.3fbcb4aa9b",
92
+ "@dxos/plugin-client": "0.8.4-main.3fbcb4aa9b",
93
+ "@dxos/plugin-graph": "0.8.4-main.3fbcb4aa9b",
94
+ "@dxos/react-ui-menu": "0.8.4-main.3fbcb4aa9b",
95
+ "@dxos/react-ui-list": "0.8.4-main.3fbcb4aa9b",
96
+ "@dxos/react-ui-attention": "0.8.4-main.3fbcb4aa9b",
97
+ "@dxos/react-ui-mosaic": "0.8.4-main.3fbcb4aa9b",
98
+ "@dxos/react-ui-search": "0.8.4-main.3fbcb4aa9b",
99
+ "@dxos/util": "0.8.4-main.3fbcb4aa9b",
100
+ "@dxos/schema": "0.8.4-main.3fbcb4aa9b",
101
+ "@dxos/echo": "0.8.4-main.3fbcb4aa9b",
102
+ "@dxos/react-ui-stack": "0.8.4-main.3fbcb4aa9b"
47
103
  },
48
104
  "devDependencies": {
49
105
  "@types/react": "~19.2.7",
50
106
  "@types/react-dom": "~19.2.3",
51
- "effect": "3.19.16",
107
+ "effect": "3.20.0",
52
108
  "react": "~19.2.3",
53
109
  "react-dom": "~19.2.3",
54
- "vite": "7.1.9",
55
- "@dxos/app-graph": "0.8.4-main.2244d791bb",
56
- "@dxos/plugin-preview": "0.8.4-main.2244d791bb",
57
- "@dxos/plugin-client": "0.8.4-main.2244d791bb",
58
- "@dxos/plugin-search": "0.8.4-main.2244d791bb",
59
- "@dxos/plugin-space": "0.8.4-main.2244d791bb",
60
- "@dxos/react-ui": "0.8.4-main.2244d791bb",
61
- "@dxos/plugin-testing": "0.8.4-main.2244d791bb",
62
- "@dxos/storybook-utils": "0.8.4-main.2244d791bb",
63
- "@dxos/schema": "0.8.4-main.2244d791bb",
64
- "@dxos/ui-theme": "0.8.4-main.2244d791bb"
110
+ "vite": "^8.0.10",
111
+ "@dxos/plugin-preview": "0.8.4-main.3fbcb4aa9b",
112
+ "@dxos/app-graph": "0.8.4-main.3fbcb4aa9b",
113
+ "@dxos/plugin-search": "0.8.4-main.3fbcb4aa9b",
114
+ "@dxos/plugin-testing": "0.8.4-main.3fbcb4aa9b",
115
+ "@dxos/react-ui": "0.8.4-main.3fbcb4aa9b",
116
+ "@dxos/schema": "0.8.4-main.3fbcb4aa9b",
117
+ "@dxos/plugin-space": "0.8.4-main.3fbcb4aa9b",
118
+ "@dxos/storybook-utils": "0.8.4-main.3fbcb4aa9b",
119
+ "@dxos/ui-theme": "0.8.4-main.3fbcb4aa9b"
65
120
  },
66
121
  "peerDependencies": {
67
- "effect": "3.19.16",
122
+ "effect": "3.20.0",
68
123
  "react": "~19.2.3",
69
124
  "react-dom": "~19.2.3",
70
- "@dxos/react-ui": "0.8.4-main.2244d791bb",
71
- "@dxos/ui-theme": "0.8.4-main.2244d791bb"
125
+ "@dxos/ui-theme": "0.8.4-main.3fbcb4aa9b",
126
+ "@dxos/react-ui": "0.8.4-main.3fbcb4aa9b"
72
127
  },
73
128
  "publishConfig": {
74
129
  "access": "public"
@@ -5,23 +5,32 @@
5
5
  import { ActivationEvent, ActivationEvents, Capability, Plugin } from '@dxos/app-framework';
6
6
  import { AppActivationEvents, AppPlugin } from '@dxos/app-toolkit';
7
7
 
8
- import { OperationResolver, ReactRoot, ReactSurface, SpotlightDismiss, State, UrlHandler } from './capabilities';
9
- import { meta } from './meta';
10
- import { translations } from './translations';
11
- import { SimpleLayoutEvents } from './types';
8
+ import {
9
+ AppGraphBuilder,
10
+ OperationHandler,
11
+ ReactRoot,
12
+ ReactSurface,
13
+ SpotlightDismiss,
14
+ State,
15
+ UrlHandler,
16
+ } from '#capabilities';
17
+ import { meta } from '#meta';
18
+ import { translations } from '#translations';
19
+ import { SimpleLayoutEvents } from '#types';
12
20
 
13
21
  export type SimpleLayoutPluginOptions = {
14
- /** Whether running in popover window context (hides mobile-specific UI). */
22
+ /** Determines if running in popover window context (hides mobile-specific UI). */
15
23
  isPopover?: boolean;
16
24
  };
17
25
 
18
26
  export const SimpleLayoutPlugin = Plugin.define<SimpleLayoutPluginOptions>(meta).pipe(
19
- AppPlugin.addOperationResolverModule({ activate: OperationResolver }),
27
+ AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),
28
+ AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
20
29
  AppPlugin.addTranslationsModule({ translations }),
21
30
  Plugin.addModule(({ isPopover = false }) => ({
22
31
  id: Capability.getModuleTag(State),
23
32
  activatesOn: ActivationEvents.Startup,
24
- activatesAfter: [SimpleLayoutEvents.StateReady, AppActivationEvents.LayoutReady],
33
+ firesAfterActivation: [SimpleLayoutEvents.StateReady, AppActivationEvents.LayoutReady],
25
34
  activate: () => State({ initialState: { isPopover } }),
26
35
  })),
27
36
  Plugin.addModule(({ isPopover = false }) => ({
@@ -46,3 +55,5 @@ export const SimpleLayoutPlugin = Plugin.define<SimpleLayoutPluginOptions>(meta)
46
55
  }),
47
56
  Plugin.make,
48
57
  );
58
+
59
+ export default SimpleLayoutPlugin;
@@ -0,0 +1,21 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capability } from '@dxos/app-framework';
8
+ import { AppCapabilities, AppNode } from '@dxos/app-toolkit';
9
+ import { GraphBuilder, NodeMatcher } from '@dxos/plugin-graph';
10
+
11
+ export default Capability.makeModule(
12
+ Effect.fnUntraced(function* () {
13
+ const extensions = yield* GraphBuilder.createExtension({
14
+ id: 'org.dxos.plugin.simpleLayout.not-found',
15
+ match: NodeMatcher.whenRoot,
16
+ connector: () => Effect.succeed([AppNode.makeNotFound()]),
17
+ });
18
+
19
+ return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
20
+ }),
21
+ );
@@ -2,9 +2,16 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- export * from './operation-resolver';
6
- export * from './react-root';
7
- export * from './react-surface';
8
- export * from './spotlight-dismiss';
9
- export * from './state';
10
- export * from './url-handler';
5
+ import { Capability } from '@dxos/app-framework';
6
+ import { OperationHandlerSet } from '@dxos/compute';
7
+
8
+ export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
9
+ export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
10
+ 'OperationHandler',
11
+ () => import('./operation-handler'),
12
+ );
13
+ export const ReactRoot = Capability.lazy('ReactRoot', () => import('./react-root'));
14
+ export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
15
+ export const SpotlightDismiss = Capability.lazy('SpotlightDismiss', () => import('./spotlight-dismiss'));
16
+ export const State = Capability.lazy('State', () => import('./state'));
17
+ export const UrlHandler = Capability.lazy('UrlHandler', () => import('./url-handler'));
@@ -0,0 +1,14 @@
1
+ // Copyright 2025 DXOS.org
2
+
3
+ import * as Effect from 'effect/Effect';
4
+
5
+ import { Capabilities, Capability } from '@dxos/app-framework';
6
+ import type { OperationHandlerSet } from '@dxos/compute';
7
+
8
+ import { SimpleLayoutOperationHandlerSet } from '#operations';
9
+
10
+ export default Capability.makeModule<OperationHandlerSet.OperationHandlerSet>(
11
+ Effect.fnUntraced(function* () {
12
+ return Capability.contributes(Capabilities.OperationHandler, SimpleLayoutOperationHandlerSet);
13
+ }),
14
+ );
@@ -7,8 +7,8 @@ import React from 'react';
7
7
 
8
8
  import { Capabilities, Capability } from '@dxos/app-framework';
9
9
 
10
- import { SimpleLayout } from '../../components';
11
- import { meta } from '../../meta';
10
+ import { SimpleLayout } from '#components';
11
+ import { meta } from '#meta';
12
12
 
13
13
  export default Capability.makeModule(() =>
14
14
  Effect.succeed(
@@ -7,34 +7,43 @@ import React from 'react';
7
7
 
8
8
  import { Capabilities, Capability } from '@dxos/app-framework';
9
9
  import { Surface } from '@dxos/app-framework/ui';
10
+ import { NOT_FOUND_PATH } from '@dxos/app-toolkit';
11
+ import { NotFoundArticle } from '@dxos/app-toolkit/ui';
10
12
  import { Node } from '@dxos/plugin-graph';
11
13
 
12
- import { Home, Workspace } from '../../components';
13
- import { meta } from '../../meta';
14
+ import { Home, NavBranch } from '#components';
14
15
 
15
16
  type SurfaceData = {
16
17
  attendableId: string;
17
18
  properties: Record<string, any>;
18
19
  };
19
20
 
20
- const ALLOWED_DISPOSITIONS = ['workspace', 'user-account', 'pin-end', 'alternate-tree'];
21
+ const ALLOWED_DISPOSITIONS = ['workspace', 'user-account', 'pin-end'];
21
22
 
22
23
  export default Capability.makeModule(() =>
23
24
  Effect.succeed(
24
25
  Capability.contributes(Capabilities.ReactSurface, [
25
26
  Surface.create({
26
- id: `${meta.id}/home`,
27
+ id: 'home',
27
28
  role: 'article',
28
29
  filter: (data): data is SurfaceData => data.attendableId === Node.RootId,
29
30
  component: () => <Home />,
30
31
  }),
31
32
  Surface.create({
32
- id: `${meta.id}/workspace-article`,
33
+ id: 'not-found',
34
+ role: 'article',
35
+ filter: (data): data is SurfaceData => data.attendableId === NOT_FOUND_PATH,
36
+ component: () => <NotFoundArticle />,
37
+ }),
38
+ Surface.create({
39
+ id: 'nav-branch',
33
40
  role: 'article',
34
41
  position: 'fallback',
35
- filter: (data): data is SurfaceData =>
36
- ALLOWED_DISPOSITIONS.includes((data.properties as Record<string, any>)?.disposition),
37
- component: ({ data }) => <Workspace id={data.attendableId} />,
42
+ filter: (data): data is SurfaceData => {
43
+ const props = data.properties as Record<string, any>;
44
+ return ALLOWED_DISPOSITIONS.includes(props?.disposition) || props?.role === 'branch';
45
+ },
46
+ component: ({ data }) => <NavBranch id={data.attendableId} />,
38
47
  }),
39
48
  ]),
40
49
  ),
@@ -9,10 +9,9 @@ import { Capability } from '@dxos/app-framework';
9
9
  import { AppCapabilities } from '@dxos/app-toolkit';
10
10
  import { Node } from '@dxos/plugin-graph';
11
11
 
12
- import { type SimpleLayoutState } from '../../types';
13
- import { SimpleLayoutState as SimpleLayoutStateCapability } from '../../types';
12
+ import { SimpleLayoutCapabilities } from '#types';
14
13
 
15
- const defaultState: SimpleLayoutState = {
14
+ const defaultState: SimpleLayoutCapabilities.SimpleLayoutState = {
16
15
  dialogOpen: false,
17
16
  workspace: Node.RootId,
18
17
  previousWorkspace: Node.RootId,
@@ -23,12 +22,12 @@ const defaultState: SimpleLayoutState = {
23
22
  };
24
23
 
25
24
  export type SimpleLayoutStateOptions = {
26
- initialState?: Partial<SimpleLayoutState>;
25
+ initialState?: Partial<SimpleLayoutCapabilities.SimpleLayoutState>;
27
26
  };
28
27
 
29
28
  export default Capability.makeModule(({ initialState }: SimpleLayoutStateOptions = {}) =>
30
29
  Effect.sync(() => {
31
- const stateAtom = Atom.make<SimpleLayoutState>({ ...defaultState, ...initialState });
30
+ const stateAtom = Atom.make<SimpleLayoutCapabilities.SimpleLayoutState>({ ...defaultState, ...initialState });
32
31
 
33
32
  const layoutAtom = Atom.make((get): AppCapabilities.Layout => {
34
33
  const state = get(stateAtom);
@@ -45,7 +44,7 @@ export default Capability.makeModule(({ initialState }: SimpleLayoutStateOptions
45
44
  });
46
45
 
47
46
  return [
48
- Capability.contributes(SimpleLayoutStateCapability, stateAtom),
47
+ Capability.contributes(SimpleLayoutCapabilities.State, stateAtom),
49
48
  Capability.contributes(AppCapabilities.Layout, layoutAtom),
50
49
  ];
51
50
  }),
@@ -0,0 +1,164 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capabilities, Capability } from '@dxos/app-framework';
8
+ import { AppCapabilities, LayoutOperation, fromUrlPath, getWorkspaceFromPath, toUrlPath } from '@dxos/app-toolkit';
9
+ import { runAndForwardErrors } from '@dxos/effect';
10
+ import { log } from '@dxos/log';
11
+ import { isTauri } from '@dxos/util';
12
+
13
+ import { SimpleLayoutCapabilities } from '#types';
14
+
15
+ /**
16
+ * URL handler for simple layout that syncs browser URL with layout state.
17
+ * URL paths map directly to qualified graph IDs with the leading `root` segment stripped.
18
+ * Root is represented as `/`.
19
+ *
20
+ * On Tauri, also listens for deep links via the deep-link plugin.
21
+ */
22
+ export default Capability.makeModule(
23
+ Effect.fnUntraced(function* () {
24
+ const { invokePromise } = yield* Capability.get(Capabilities.OperationInvoker);
25
+ const capabilities = yield* Capability.Service;
26
+
27
+ /** Dispatch all NavigationHandler contributions with a given URL. */
28
+ const dispatchNavigationHandlers = (url: URL) =>
29
+ Effect.gen(function* () {
30
+ const handlers = yield* Capability.getAll(AppCapabilities.NavigationHandler);
31
+ yield* Effect.all(
32
+ handlers.map((handler) => handler(url)),
33
+ { concurrency: 'unbounded' },
34
+ );
35
+ }).pipe(Effect.provideService(Capability.Service, capabilities), runAndForwardErrors);
36
+
37
+ /**
38
+ * Handle navigation from a URL.
39
+ * Dispatches to NavigationHandler contributions, then handles pathname routing.
40
+ */
41
+ const handlePathNavigation = (url?: URL) => {
42
+ const resolvedUrl = url ?? new URL(window.location.href);
43
+ void dispatchNavigationHandlers(resolvedUrl);
44
+
45
+ let pathname = resolvedUrl.pathname;
46
+ if (isFilePath(pathname)) {
47
+ log.info('[UrlHandler] Skipping file path (not a graph node)', { pathname });
48
+ pathname = '/';
49
+ }
50
+
51
+ const qualifiedId = fromUrlPath(pathname);
52
+ const workspace = getWorkspaceFromPath(qualifiedId);
53
+
54
+ void invokePromise(LayoutOperation.SwitchWorkspace, { subject: workspace });
55
+
56
+ const activeId = qualifiedId !== workspace ? qualifiedId : undefined;
57
+ if (activeId) {
58
+ void invokePromise(LayoutOperation.Open, { subject: [activeId] });
59
+ }
60
+ };
61
+
62
+ const onPopState = () => {
63
+ handlePathNavigation();
64
+ };
65
+
66
+ // Initial navigation.
67
+ yield* Effect.sync(() => handlePathNavigation());
68
+ window.addEventListener('popstate', onPopState);
69
+
70
+ // Tauri deep link support.
71
+ let unlistenDeepLink: (() => void) | undefined;
72
+ if (isTauri()) {
73
+ yield* Effect.tryPromise({
74
+ try: async () => {
75
+ const { getCurrent, onOpenUrl } = await import('@tauri-apps/plugin-deep-link');
76
+
77
+ const launchUrls = await getCurrent();
78
+ if (launchUrls && launchUrls.length > 0) {
79
+ log.info('[UrlHandler] App launched with deep links', { urls: launchUrls });
80
+ for (const urlString of launchUrls) {
81
+ handleDeepLink(urlString, handlePathNavigation);
82
+ }
83
+ }
84
+
85
+ unlistenDeepLink = await onOpenUrl((urls) => {
86
+ log.info('[UrlHandler] Deep links received', { urls });
87
+ for (const urlString of urls) {
88
+ handleDeepLink(urlString, handlePathNavigation);
89
+ }
90
+ });
91
+ },
92
+ catch: (error) => {
93
+ log.warn('[UrlHandler] Failed to initialize deep link listener', { error });
94
+ return error;
95
+ },
96
+ }).pipe(Effect.catchAll(() => Effect.void));
97
+ }
98
+
99
+ // Sync URL with layout state changes.
100
+ let lastWorkspace: string | undefined;
101
+ let lastActive: string | undefined;
102
+ const unsubscribe = yield* Capabilities.subscribeAtom(
103
+ SimpleLayoutCapabilities.State,
104
+ (state: SimpleLayoutCapabilities.SimpleLayoutState) => {
105
+ const { workspace, active } = state;
106
+
107
+ if (workspace !== lastWorkspace || active !== lastActive) {
108
+ lastWorkspace = workspace;
109
+ lastActive = active;
110
+
111
+ const path = active ? toUrlPath(active) : toUrlPath(workspace);
112
+ if (window.location.pathname !== path) {
113
+ history.pushState(null, '', `${path}${window.location.search}`);
114
+ }
115
+ }
116
+ },
117
+ );
118
+
119
+ return Capability.contributes(Capabilities.Null, null, () =>
120
+ Effect.sync(() => {
121
+ window.removeEventListener('popstate', onPopState);
122
+ unsubscribe();
123
+ unlistenDeepLink?.();
124
+ }),
125
+ );
126
+ }),
127
+ );
128
+
129
+ /** Check if a path is a redirect path handled elsewhere (e.g., OAuth). */
130
+ const isRedirectPath = (pathname: string): boolean => pathname.startsWith('/redirect/');
131
+
132
+ /** Paths with file extensions are not graph node paths. */
133
+ const isFilePath = (pathname: string): boolean => /\.[a-z]+$/i.test(pathname);
134
+
135
+ /** Handle a deep link URL string. Merges query params into window.location and navigates. */
136
+ const handleDeepLink = (urlString: string, navigate: (url?: URL) => void): void => {
137
+ log.info('[UrlHandler] Deep link received', { url: urlString });
138
+ try {
139
+ const deepLinkUrl = new URL(urlString);
140
+
141
+ // For custom schemes (e.g., composer://a/b/c), new URL() treats the first segment as the
142
+ // hostname. Reconstruct the full path from hostname + pathname.
143
+ const fullPath =
144
+ deepLinkUrl.protocol !== 'https:' && deepLinkUrl.protocol !== 'http:' && deepLinkUrl.hostname
145
+ ? '/' + deepLinkUrl.hostname + deepLinkUrl.pathname
146
+ : deepLinkUrl.pathname;
147
+
148
+ if (isRedirectPath(fullPath)) {
149
+ return;
150
+ }
151
+
152
+ // Merge deep link query params into the current window URL so handlers can read them.
153
+ const current = new URL(window.location.href);
154
+ if (deepLinkUrl.search) {
155
+ deepLinkUrl.searchParams.forEach((value, key) => current.searchParams.set(key, value));
156
+ }
157
+ current.pathname = fullPath;
158
+ history.replaceState(null, '', current.pathname + current.search);
159
+
160
+ navigate(current);
161
+ } catch (error) {
162
+ log.warn('[UrlHandler] Failed to parse deep link URL', { urlString, error });
163
+ }
164
+ };
@@ -4,28 +4,29 @@
4
4
 
5
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
6
6
 
7
+ import { ErrorFallback } from '@dxos/react-ui';
7
8
  import { withTheme } from '@dxos/react-ui/testing';
8
9
 
9
- import { translations } from '../translations';
10
-
11
- import { ContentError } from './ContentError';
10
+ import { translations } from '#translations';
12
11
 
13
12
  const meta = {
14
- title: 'plugins/plugin-simple-layout/ContentError',
15
- component: ContentError,
13
+ title: 'plugins/plugin-simple-layout/components/ErrorFallback',
14
+ component: ErrorFallback,
16
15
  decorators: [withTheme()],
17
16
  parameters: {
18
17
  layout: 'centered',
19
18
  translations,
20
19
  },
21
- } satisfies Meta<typeof ContentError>;
20
+ } satisfies Meta<typeof ErrorFallback>;
22
21
 
23
22
  export default meta;
24
23
 
25
24
  type Story = StoryObj<typeof meta>;
26
25
 
27
26
  export const Default: Story = {
28
- args: {},
27
+ args: {
28
+ error: new Error('An unexpected error occurred'),
29
+ },
29
30
  };
30
31
 
31
32
  export const WithError: Story = {
@@ -0,0 +1,96 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { createContext } from '@radix-ui/react-context';
6
+ import React, { type PropsWithChildren, useCallback, useRef } from 'react';
7
+
8
+ const DEBUG_OVERLAY_NAME = 'DebugOverlay';
9
+
10
+ //
11
+ // Context
12
+ //
13
+
14
+ type DebugOverlayContextValue = {
15
+ /** Log a timestamped message to the on-screen debug overlay. */
16
+ dbg: (msg: string) => void;
17
+ };
18
+
19
+ // Default to a no-op so hooks can call useDebugLog() safely outside of a provider.
20
+ const [DebugOverlayProvider, useDebugLog] = createContext<DebugOverlayContextValue>(DEBUG_OVERLAY_NAME, {
21
+ dbg: () => {},
22
+ });
23
+
24
+ //
25
+ // Root
26
+ //
27
+
28
+ type DebugOverlayRootProps = PropsWithChildren<{
29
+ /**
30
+ * When true (default), renders the on-screen log panel.
31
+ * Set to false to suppress the overlay while keeping the context available.
32
+ */
33
+ enabled?: boolean;
34
+ maxLines?: number;
35
+ }>;
36
+
37
+ /**
38
+ * Establishes a debug overlay context.
39
+ *
40
+ * When enabled, renders an on-screen monospaced log panel anchored just above
41
+ * the keyboard (via --kb-height CSS variable). Descendants can call
42
+ * useDebugLog() to obtain the dbg() function for logging.
43
+ *
44
+ * Intended for transient mobile debugging in the iOS Simulator where DevTools
45
+ * console output may not be accessible.
46
+ */
47
+ const DebugOverlayRoot = ({ children, enabled = true, maxLines = 10 }: DebugOverlayRootProps) => {
48
+ const overlayRef = useRef<HTMLDivElement>(null);
49
+
50
+ const dbg = useCallback((msg: string) => {
51
+ if (!overlayRef.current) {
52
+ return;
53
+ }
54
+ const line = document.createElement('pre');
55
+ line.textContent = `${(performance.now() / 1000).toFixed(2).padStart(8, ' ')} ${msg}`;
56
+ overlayRef.current.prepend(line);
57
+ while (overlayRef.current.children.length > maxLines) {
58
+ overlayRef.current.lastChild?.remove();
59
+ }
60
+ }, []);
61
+
62
+ return (
63
+ <DebugOverlayProvider dbg={dbg}>
64
+ {children}
65
+ {enabled && (
66
+ <div
67
+ ref={overlayRef}
68
+ style={{
69
+ position: 'fixed',
70
+ bottom: 'calc(var(--kb-height, 0px) + 8px)',
71
+ left: 8,
72
+ right: 8,
73
+ background: 'rgba(0,0,0,0.8)',
74
+ color: '#0f0',
75
+ fontSize: 10,
76
+ fontFamily: 'monospace',
77
+ padding: 6,
78
+ borderRadius: 4,
79
+ zIndex: 9999,
80
+ pointerEvents: 'none',
81
+ }}
82
+ />
83
+ )}
84
+ </DebugOverlayProvider>
85
+ );
86
+ };
87
+
88
+ //
89
+ // Exports
90
+ //
91
+
92
+ export const DebugOverlay = {
93
+ Root: DebugOverlayRoot,
94
+ };
95
+
96
+ export { useDebugLog };
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export { DebugOverlay, useDebugLog } from './DebugOverlay';