@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.
- package/dist/lib/browser/chunk-J5FQ32AV.mjs +1256 -0
- package/dist/lib/browser/chunk-J5FQ32AV.mjs.map +7 -0
- package/dist/lib/browser/{chunk-CLPGTNWJ.mjs → chunk-MRR7PXSM.mjs} +5 -5
- package/dist/lib/browser/chunk-MRR7PXSM.mjs.map +7 -0
- package/dist/lib/browser/chunk-XJVW3PRY.mjs +22 -0
- package/dist/lib/browser/chunk-XJVW3PRY.mjs.map +7 -0
- package/dist/lib/browser/close-OT5JOGVY.mjs +34 -0
- package/dist/lib/browser/close-OT5JOGVY.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +40 -32
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/open-4FQ44Z5G.mjs +31 -0
- package/dist/lib/browser/open-4FQ44Z5G.mjs.map +7 -0
- package/dist/lib/browser/operation-handler-OAD7LISD.mjs +16 -0
- package/dist/lib/browser/operation-handler-OAD7LISD.mjs.map +7 -0
- package/dist/lib/browser/{react-root-6ARAPH3O.mjs → react-root-6KIGPLUT.mjs} +5 -5
- package/dist/lib/browser/react-root-6KIGPLUT.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-SO7B23GS.mjs → react-surface-JLIEQGOL.mjs} +18 -13
- package/dist/lib/browser/react-surface-JLIEQGOL.mjs.map +7 -0
- package/dist/lib/browser/revert-workspace-DLE265AN.mjs +21 -0
- package/dist/lib/browser/revert-workspace-DLE265AN.mjs.map +7 -0
- package/dist/lib/browser/set-52HGTSH4.mjs +21 -0
- package/dist/lib/browser/set-52HGTSH4.mjs.map +7 -0
- package/dist/lib/browser/set-layout-mode-T6QI3DGU.mjs +11 -0
- package/dist/lib/browser/set-layout-mode-T6QI3DGU.mjs.map +7 -0
- package/dist/lib/browser/{spotlight-dismiss-VSNOPETH.mjs → spotlight-dismiss-67PHYS5B.mjs} +3 -3
- package/dist/lib/browser/spotlight-dismiss-67PHYS5B.mjs.map +7 -0
- package/dist/lib/browser/{state-H4IGICBB.mjs → state-TXSMUWYI.mjs} +8 -5
- package/dist/lib/browser/state-TXSMUWYI.mjs.map +7 -0
- package/dist/lib/browser/switch-workspace-5Y6T4BWJ.mjs +24 -0
- package/dist/lib/browser/switch-workspace-5Y6T4BWJ.mjs.map +7 -0
- package/dist/lib/browser/update-complementary-MX3TTVAB.mjs +31 -0
- package/dist/lib/browser/update-complementary-MX3TTVAB.mjs.map +7 -0
- package/dist/lib/browser/update-dialog-FPAPZXKO.mjs +29 -0
- package/dist/lib/browser/update-dialog-FPAPZXKO.mjs.map +7 -0
- package/dist/lib/browser/update-popover-6V5ZTIYN.mjs +33 -0
- package/dist/lib/browser/update-popover-6V5ZTIYN.mjs.map +7 -0
- package/dist/lib/browser/update-sidebar-WHDKYMV7.mjs +10 -0
- package/dist/lib/browser/update-sidebar-WHDKYMV7.mjs.map +7 -0
- package/dist/lib/browser/url-handler-GUJ3L7Y3.mjs +163 -0
- package/dist/lib/browser/url-handler-GUJ3L7Y3.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-27K22G6S.mjs +23 -0
- package/dist/lib/node-esm/chunk-27K22G6S.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-EXNDYZTP.mjs +1257 -0
- package/dist/lib/node-esm/chunk-EXNDYZTP.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-MUVVYBUE.mjs → chunk-WMNTJ2MK.mjs} +5 -5
- package/dist/lib/node-esm/chunk-WMNTJ2MK.mjs.map +7 -0
- package/dist/lib/node-esm/close-PEVHREL2.mjs +35 -0
- package/dist/lib/node-esm/close-PEVHREL2.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +40 -32
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/open-LMJY7JCJ.mjs +32 -0
- package/dist/lib/node-esm/open-LMJY7JCJ.mjs.map +7 -0
- package/dist/lib/node-esm/operation-handler-A2DC4WHC.mjs +18 -0
- package/dist/lib/node-esm/operation-handler-A2DC4WHC.mjs.map +7 -0
- package/dist/lib/node-esm/{react-root-2CPA2ZUS.mjs → react-root-5SCW2KTH.mjs} +5 -5
- package/dist/lib/node-esm/react-root-5SCW2KTH.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-FKAV56MO.mjs → react-surface-WLKB6AET.mjs} +18 -13
- package/dist/lib/node-esm/react-surface-WLKB6AET.mjs.map +7 -0
- package/dist/lib/node-esm/revert-workspace-XZXT64YA.mjs +22 -0
- package/dist/lib/node-esm/revert-workspace-XZXT64YA.mjs.map +7 -0
- package/dist/lib/node-esm/set-5I6LFH5L.mjs +22 -0
- package/dist/lib/node-esm/set-5I6LFH5L.mjs.map +7 -0
- package/dist/lib/node-esm/set-layout-mode-F5B6QLZM.mjs +13 -0
- package/dist/lib/node-esm/set-layout-mode-F5B6QLZM.mjs.map +7 -0
- package/dist/lib/node-esm/{spotlight-dismiss-L5PCWIJG.mjs → spotlight-dismiss-RMLRZUVY.mjs} +3 -3
- package/dist/lib/node-esm/spotlight-dismiss-RMLRZUVY.mjs.map +7 -0
- package/dist/lib/node-esm/{state-QIU2LMLT.mjs → state-JMX6FAG4.mjs} +8 -5
- package/dist/lib/node-esm/state-JMX6FAG4.mjs.map +7 -0
- package/dist/lib/node-esm/switch-workspace-PB6T2SGY.mjs +25 -0
- package/dist/lib/node-esm/switch-workspace-PB6T2SGY.mjs.map +7 -0
- package/dist/lib/node-esm/update-complementary-FTW423IY.mjs +32 -0
- package/dist/lib/node-esm/update-complementary-FTW423IY.mjs.map +7 -0
- package/dist/lib/node-esm/update-dialog-ID267DCL.mjs +30 -0
- package/dist/lib/node-esm/update-dialog-ID267DCL.mjs.map +7 -0
- package/dist/lib/node-esm/update-popover-RLHU2HF4.mjs +34 -0
- package/dist/lib/node-esm/update-popover-RLHU2HF4.mjs.map +7 -0
- package/dist/lib/node-esm/update-sidebar-BJ7HTNZ4.mjs +12 -0
- package/dist/lib/node-esm/update-sidebar-BJ7HTNZ4.mjs.map +7 -0
- package/dist/lib/node-esm/url-handler-WMONO2T6.mjs +164 -0
- package/dist/lib/node-esm/url-handler-WMONO2T6.mjs.map +7 -0
- package/dist/types/src/SimpleLayoutPlugin.d.ts +1 -1
- package/dist/types/src/SimpleLayoutPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +1 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler/index.d.ts +4 -0
- package/dist/types/src/capabilities/operation-handler/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-root/react-root.d.ts +1 -1
- package/dist/types/src/capabilities/react-root/react-root.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +2 -2
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/spotlight-dismiss/index.d.ts +1 -1
- package/dist/types/src/capabilities/spotlight-dismiss/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/spotlight-dismiss/spotlight-dismiss.d.ts +1 -1
- package/dist/types/src/capabilities/spotlight-dismiss/spotlight-dismiss.d.ts.map +1 -1
- package/dist/types/src/capabilities/state/index.d.ts +1 -1
- package/dist/types/src/capabilities/state/state.d.ts +1 -1
- package/dist/types/src/capabilities/state/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/url-handler/url-handler.d.ts +5 -3
- package/dist/types/src/capabilities/url-handler/url-handler.d.ts.map +1 -1
- package/dist/types/src/components/ContentError.stories.d.ts +13 -4
- package/dist/types/src/components/ContentError.stories.d.ts.map +1 -1
- package/dist/types/src/components/DebugOverlay/DebugOverlay.d.ts +19 -0
- package/dist/types/src/components/DebugOverlay/DebugOverlay.d.ts.map +1 -0
- package/dist/types/src/components/DebugOverlay/index.d.ts +2 -0
- package/dist/types/src/components/DebugOverlay/index.d.ts.map +1 -0
- package/dist/types/src/components/Home/Home.d.ts.map +1 -1
- package/dist/types/src/components/Loading/Loading.d.ts +3 -0
- package/dist/types/src/components/Loading/Loading.d.ts.map +1 -0
- package/dist/types/src/components/{ContentLoading.stories.d.ts → Loading/Loading.stories.d.ts} +1 -1
- package/dist/types/src/components/Loading/Loading.stories.d.ts.map +1 -0
- package/dist/types/src/components/Loading/index.d.ts +2 -0
- package/dist/types/src/components/Loading/index.d.ts.map +1 -0
- package/dist/types/src/components/MobileLayout/MobileLayout.d.ts +35 -0
- package/dist/types/src/components/MobileLayout/MobileLayout.d.ts.map +1 -0
- package/dist/types/src/components/MobileLayout/MobileLayout.stories.d.ts +7 -0
- package/dist/types/src/components/MobileLayout/MobileLayout.stories.d.ts.map +1 -0
- package/dist/types/src/components/MobileLayout/index.d.ts +2 -0
- package/dist/types/src/components/MobileLayout/index.d.ts.map +1 -0
- package/dist/types/src/components/NavBranch/NavBranch.d.ts +11 -0
- package/dist/types/src/components/NavBranch/NavBranch.d.ts.map +1 -0
- package/dist/types/src/components/NavBranch/index.d.ts +2 -0
- package/dist/types/src/components/NavBranch/index.d.ts.map +1 -0
- package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/AppBar.d.ts +28 -0
- package/dist/types/src/components/SimpleLayout/AppBar.d.ts.map +1 -0
- package/dist/types/src/components/SimpleLayout/AppBar.stories.d.ts +52 -0
- package/dist/types/src/components/SimpleLayout/AppBar.stories.d.ts.map +1 -0
- package/dist/types/src/components/SimpleLayout/Drawer.d.ts +9 -0
- package/dist/types/src/components/SimpleLayout/Drawer.d.ts.map +1 -0
- package/dist/types/src/components/SimpleLayout/Main.d.ts +1 -1
- package/dist/types/src/components/SimpleLayout/Main.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/NavBar.d.ts +18 -6
- package/dist/types/src/components/SimpleLayout/NavBar.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/NavBar.stories.d.ts +22 -10
- package/dist/types/src/components/SimpleLayout/NavBar.stories.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/SimpleLayout.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/SimpleLayout.stories.d.ts +16 -7
- package/dist/types/src/components/SimpleLayout/SimpleLayout.stories.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/index.d.ts +3 -0
- package/dist/types/src/components/SimpleLayout/index.d.ts.map +1 -1
- package/dist/types/src/components/hooks.d.ts +4 -2
- package/dist/types/src/components/hooks.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +4 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/actions.d.ts +19 -0
- package/dist/types/src/hooks/actions.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +5 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useAppBarProps.d.ts +7 -0
- package/dist/types/src/hooks/useAppBarProps.d.ts.map +1 -0
- package/dist/types/src/hooks/useCompanions.d.ts +12 -0
- package/dist/types/src/hooks/useCompanions.d.ts.map +1 -0
- package/dist/types/src/hooks/useDrawerActions.d.ts +13 -0
- package/dist/types/src/hooks/useDrawerActions.d.ts.map +1 -0
- package/dist/types/src/hooks/useNavbarActions.d.ts +14 -0
- package/dist/types/src/hooks/useNavbarActions.d.ts.map +1 -0
- package/dist/types/src/hooks/useSimpleLayoutState.d.ts +3 -3
- package/dist/types/src/hooks/useSimpleLayoutState.d.ts.map +1 -1
- package/dist/types/src/operations/close.d.ts +5 -0
- package/dist/types/src/operations/close.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/open.d.ts +5 -0
- package/dist/types/src/operations/open.d.ts.map +1 -0
- package/dist/types/src/operations/revert-workspace.d.ts +5 -0
- package/dist/types/src/operations/revert-workspace.d.ts.map +1 -0
- package/dist/types/src/operations/set-layout-mode.d.ts +5 -0
- package/dist/types/src/operations/set-layout-mode.d.ts.map +1 -0
- package/dist/types/src/operations/set.d.ts +5 -0
- package/dist/types/src/operations/set.d.ts.map +1 -0
- package/dist/types/src/operations/state-access.d.ts +8 -0
- package/dist/types/src/operations/state-access.d.ts.map +1 -0
- package/dist/types/src/operations/switch-workspace.d.ts +5 -0
- package/dist/types/src/operations/switch-workspace.d.ts.map +1 -0
- package/dist/types/src/operations/update-complementary.d.ts +5 -0
- package/dist/types/src/operations/update-complementary.d.ts.map +1 -0
- package/dist/types/src/operations/update-dialog.d.ts +5 -0
- package/dist/types/src/operations/update-dialog.d.ts.map +1 -0
- package/dist/types/src/operations/update-popover.d.ts +5 -0
- package/dist/types/src/operations/update-popover.d.ts.map +1 -0
- package/dist/types/src/operations/update-sidebar.d.ts +5 -0
- package/dist/types/src/operations/update-sidebar.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +12 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +8 -3
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/events.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +36 -30
- package/src/SimpleLayoutPlugin.ts +12 -11
- package/src/capabilities/index.ts +1 -1
- package/src/capabilities/operation-handler/index.ts +9 -0
- package/src/capabilities/operation-handler/operation-handler.ts +14 -0
- package/src/capabilities/react-root/react-root.tsx +2 -2
- package/src/capabilities/react-surface/react-surface.tsx +14 -11
- package/src/capabilities/spotlight-dismiss/spotlight-dismiss.ts +2 -2
- package/src/capabilities/state/state.tsx +6 -3
- package/src/capabilities/url-handler/url-handler.ts +110 -45
- package/src/components/ContentError.stories.tsx +8 -7
- package/src/components/DebugOverlay/DebugOverlay.tsx +96 -0
- package/src/components/DebugOverlay/index.ts +5 -0
- package/src/components/Dialog/Dialog.tsx +5 -5
- package/src/components/Home/Home.tsx +49 -42
- package/src/components/{ContentLoading.stories.tsx → Loading/Loading.stories.tsx} +5 -5
- package/src/components/{ContentLoading.tsx → Loading/Loading.tsx} +2 -2
- package/src/components/Loading/index.ts +5 -0
- package/src/components/MobileLayout/MobileLayout.stories.tsx +133 -0
- package/src/components/MobileLayout/MobileLayout.tsx +374 -0
- package/src/components/MobileLayout/index.ts +5 -0
- package/src/components/NavBranch/NavBranch.tsx +127 -0
- package/src/components/{Workspace → NavBranch}/index.ts +1 -1
- package/src/components/Popover/Popover.tsx +7 -7
- package/src/components/SimpleLayout/AppBar.stories.tsx +144 -0
- package/src/components/SimpleLayout/AppBar.tsx +93 -0
- package/src/components/SimpleLayout/Drawer.tsx +96 -0
- package/src/components/SimpleLayout/Main.tsx +45 -48
- package/src/components/SimpleLayout/NavBar.stories.tsx +131 -26
- package/src/components/SimpleLayout/NavBar.tsx +21 -62
- package/src/components/SimpleLayout/SimpleLayout.stories.tsx +43 -53
- package/src/components/SimpleLayout/SimpleLayout.tsx +44 -6
- package/src/components/SimpleLayout/index.ts +3 -0
- package/src/components/hooks.ts +10 -14
- package/src/components/index.ts +4 -2
- package/src/hooks/actions.ts +83 -0
- package/src/hooks/index.ts +5 -0
- package/src/hooks/useAppBarProps.ts +115 -0
- package/src/hooks/useCompanions.ts +22 -0
- package/src/hooks/useDrawerActions.ts +100 -0
- package/src/hooks/useNavbarActions.ts +87 -0
- package/src/hooks/useSimpleLayoutState.ts +5 -5
- package/src/meta.ts +1 -1
- package/src/operations/close.ts +34 -0
- package/src/operations/index.ts +16 -0
- package/src/operations/open.ts +32 -0
- package/src/operations/revert-workspace.ts +22 -0
- package/src/operations/set-layout-mode.ts +12 -0
- package/src/operations/set.ts +23 -0
- package/src/operations/state-access.ts +19 -0
- package/src/operations/switch-workspace.ts +26 -0
- package/src/operations/update-complementary.ts +34 -0
- package/src/operations/update-dialog.ts +28 -0
- package/src/operations/update-popover.ts +35 -0
- package/src/operations/update-sidebar.ts +12 -0
- package/src/translations.ts +8 -1
- package/src/types/capabilities.ts +13 -4
- package/src/types/events.ts +3 -2
- package/dist/lib/browser/chunk-CLPGTNWJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-FK4M7GJV.mjs +0 -613
- package/dist/lib/browser/chunk-FK4M7GJV.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-LTB63NKP.mjs +0 -168
- package/dist/lib/browser/operation-resolver-LTB63NKP.mjs.map +0 -7
- package/dist/lib/browser/react-root-6ARAPH3O.mjs.map +0 -7
- package/dist/lib/browser/react-surface-SO7B23GS.mjs.map +0 -7
- package/dist/lib/browser/spotlight-dismiss-VSNOPETH.mjs.map +0 -7
- package/dist/lib/browser/state-H4IGICBB.mjs.map +0 -7
- package/dist/lib/browser/url-handler-7CFGTLNG.mjs +0 -54
- package/dist/lib/browser/url-handler-7CFGTLNG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-EGFZAVBD.mjs +0 -614
- package/dist/lib/node-esm/chunk-EGFZAVBD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MUVVYBUE.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-7O6O7T4Q.mjs +0 -169
- package/dist/lib/node-esm/operation-resolver-7O6O7T4Q.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-2CPA2ZUS.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-FKAV56MO.mjs.map +0 -7
- package/dist/lib/node-esm/spotlight-dismiss-L5PCWIJG.mjs.map +0 -7
- package/dist/lib/node-esm/state-QIU2LMLT.mjs.map +0 -7
- package/dist/lib/node-esm/url-handler-4LYP3JM7.mjs +0 -55
- package/dist/lib/node-esm/url-handler-4LYP3JM7.mjs.map +0 -7
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/dist/types/src/components/ContentError.d.ts +0 -5
- package/dist/types/src/components/ContentError.d.ts.map +0 -1
- package/dist/types/src/components/ContentLoading.d.ts +0 -3
- package/dist/types/src/components/ContentLoading.d.ts.map +0 -1
- package/dist/types/src/components/ContentLoading.stories.d.ts.map +0 -1
- package/dist/types/src/components/SimpleLayout/Banner.d.ts +0 -8
- package/dist/types/src/components/SimpleLayout/Banner.d.ts.map +0 -1
- package/dist/types/src/components/Workspace/Workspace.d.ts +0 -9
- package/dist/types/src/components/Workspace/Workspace.d.ts.map +0 -1
- package/dist/types/src/components/Workspace/index.d.ts +0 -2
- package/dist/types/src/components/Workspace/index.d.ts.map +0 -1
- package/src/capabilities/operation-resolver/index.ts +0 -10
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -178
- package/src/components/ContentError.tsx +0 -23
- package/src/components/SimpleLayout/Banner.tsx +0 -82
- package/src/components/Workspace/Workspace.tsx +0 -115
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-simple-layout",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.7996785055",
|
|
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",
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"exports": {
|
|
16
16
|
".": {
|
|
17
17
|
"source": "./src/index.ts",
|
|
18
|
-
"types": "./dist/types/src/index.d.ts",
|
|
19
18
|
"browser": "./dist/lib/browser/index.mjs",
|
|
20
|
-
"node": "./dist/lib/node-esm/index.mjs"
|
|
19
|
+
"node": "./dist/lib/node-esm/index.mjs",
|
|
20
|
+
"types": "./dist/types/src/index.d.ts"
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"types": "dist/types/src/index.d.ts",
|
|
@@ -26,44 +26,50 @@
|
|
|
26
26
|
"src"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@effect-atom/atom": "^0.
|
|
30
|
-
"@effect-atom/atom-react": "^0.
|
|
29
|
+
"@effect-atom/atom": "^0.5.1",
|
|
30
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
31
31
|
"@radix-ui/react-context": "1.1.1",
|
|
32
|
-
"@
|
|
33
|
-
"@
|
|
34
|
-
"@dxos/
|
|
35
|
-
"@dxos/
|
|
36
|
-
"@dxos/
|
|
37
|
-
"@dxos/
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/react-ui-
|
|
40
|
-
"@dxos/react-ui-
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
32
|
+
"@tauri-apps/plugin-deep-link": "^2.2.0",
|
|
33
|
+
"@tauri-apps/plugin-haptics": "^2.3.2",
|
|
34
|
+
"@dxos/app-framework": "0.8.4-main.7996785055",
|
|
35
|
+
"@dxos/echo": "0.8.4-main.7996785055",
|
|
36
|
+
"@dxos/async": "0.8.4-main.7996785055",
|
|
37
|
+
"@dxos/log": "0.8.4-main.7996785055",
|
|
38
|
+
"@dxos/plugin-graph": "0.8.4-main.7996785055",
|
|
39
|
+
"@dxos/react-ui-menu": "0.8.4-main.7996785055",
|
|
40
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.7996785055",
|
|
41
|
+
"@dxos/react-ui-search": "0.8.4-main.7996785055",
|
|
42
|
+
"@dxos/react-ui-stack": "0.8.4-main.7996785055",
|
|
43
|
+
"@dxos/react-ui-attention": "0.8.4-main.7996785055",
|
|
44
|
+
"@dxos/schema": "0.8.4-main.7996785055",
|
|
45
|
+
"@dxos/util": "0.8.4-main.7996785055",
|
|
46
|
+
"@dxos/operation": "0.8.4-main.7996785055",
|
|
47
|
+
"@dxos/app-toolkit": "0.8.4-main.7996785055"
|
|
43
48
|
},
|
|
44
49
|
"devDependencies": {
|
|
45
50
|
"@types/react": "~19.2.7",
|
|
46
51
|
"@types/react-dom": "~19.2.3",
|
|
47
|
-
"effect": "3.
|
|
52
|
+
"effect": "3.20.0",
|
|
48
53
|
"react": "~19.2.3",
|
|
49
54
|
"react-dom": "~19.2.3",
|
|
50
|
-
"vite": "7.1.
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/plugin-
|
|
53
|
-
"@dxos/plugin-
|
|
54
|
-
"@dxos/plugin-
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/plugin-testing": "0.8.4-main.
|
|
57
|
-
"@dxos/schema": "0.8.4-main.
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/
|
|
55
|
+
"vite": "^7.1.11",
|
|
56
|
+
"@dxos/app-graph": "0.8.4-main.7996785055",
|
|
57
|
+
"@dxos/plugin-client": "0.8.4-main.7996785055",
|
|
58
|
+
"@dxos/plugin-preview": "0.8.4-main.7996785055",
|
|
59
|
+
"@dxos/plugin-search": "0.8.4-main.7996785055",
|
|
60
|
+
"@dxos/plugin-space": "0.8.4-main.7996785055",
|
|
61
|
+
"@dxos/plugin-testing": "0.8.4-main.7996785055",
|
|
62
|
+
"@dxos/schema": "0.8.4-main.7996785055",
|
|
63
|
+
"@dxos/ui-theme": "0.8.4-main.7996785055",
|
|
64
|
+
"@dxos/storybook-utils": "0.8.4-main.7996785055",
|
|
65
|
+
"@dxos/react-ui": "0.8.4-main.7996785055"
|
|
60
66
|
},
|
|
61
67
|
"peerDependencies": {
|
|
62
|
-
"effect": "3.
|
|
68
|
+
"effect": "3.20.0",
|
|
63
69
|
"react": "~19.2.3",
|
|
64
70
|
"react-dom": "~19.2.3",
|
|
65
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
66
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
71
|
+
"@dxos/react-ui": "0.8.4-main.7996785055",
|
|
72
|
+
"@dxos/ui-theme": "0.8.4-main.7996785055"
|
|
67
73
|
},
|
|
68
74
|
"publishConfig": {
|
|
69
75
|
"access": "public"
|
|
@@ -2,46 +2,47 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { ActivationEvent,
|
|
5
|
+
import { ActivationEvent, ActivationEvents, Capability, Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { AppActivationEvents, AppPlugin } from '@dxos/app-toolkit';
|
|
6
7
|
|
|
7
|
-
import {
|
|
8
|
+
import { OperationHandler, ReactRoot, ReactSurface, SpotlightDismiss, State, UrlHandler } from './capabilities';
|
|
8
9
|
import { meta } from './meta';
|
|
9
10
|
import { translations } from './translations';
|
|
10
11
|
import { SimpleLayoutEvents } from './types';
|
|
11
12
|
|
|
12
13
|
export type SimpleLayoutPluginOptions = {
|
|
13
|
-
/**
|
|
14
|
+
/** Determines if running in popover window context (hides mobile-specific UI). */
|
|
14
15
|
isPopover?: boolean;
|
|
15
16
|
};
|
|
16
17
|
|
|
17
18
|
export const SimpleLayoutPlugin = Plugin.define<SimpleLayoutPluginOptions>(meta).pipe(
|
|
19
|
+
AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
|
|
20
|
+
AppPlugin.addTranslationsModule({ translations }),
|
|
18
21
|
Plugin.addModule(({ isPopover = false }) => ({
|
|
19
22
|
id: Capability.getModuleTag(State),
|
|
20
|
-
activatesOn:
|
|
21
|
-
activatesAfter: [SimpleLayoutEvents.StateReady,
|
|
23
|
+
activatesOn: ActivationEvents.Startup,
|
|
24
|
+
activatesAfter: [SimpleLayoutEvents.StateReady, AppActivationEvents.LayoutReady],
|
|
22
25
|
activate: () => State({ initialState: { isPopover } }),
|
|
23
26
|
})),
|
|
24
27
|
Plugin.addModule(({ isPopover = false }) => ({
|
|
25
28
|
id: Capability.getModuleTag(SpotlightDismiss),
|
|
26
|
-
activatesOn:
|
|
29
|
+
activatesOn: ActivationEvents.Startup,
|
|
27
30
|
activate: () => SpotlightDismiss({ isPopover }),
|
|
28
31
|
})),
|
|
29
32
|
Plugin.addModule({
|
|
30
33
|
id: Capability.getModuleTag(ReactRoot),
|
|
31
|
-
activatesOn:
|
|
34
|
+
activatesOn: ActivationEvents.Startup,
|
|
32
35
|
activate: ReactRoot,
|
|
33
36
|
}),
|
|
34
37
|
Plugin.addModule({
|
|
35
38
|
id: Capability.getModuleTag(ReactSurface),
|
|
36
|
-
activatesOn:
|
|
39
|
+
activatesOn: ActivationEvents.Startup,
|
|
37
40
|
activate: ReactSurface,
|
|
38
41
|
}),
|
|
39
42
|
Plugin.addModule({
|
|
40
43
|
id: Capability.getModuleTag(UrlHandler),
|
|
41
|
-
activatesOn: ActivationEvent.allOf(
|
|
44
|
+
activatesOn: ActivationEvent.allOf(ActivationEvents.OperationInvokerReady, SimpleLayoutEvents.StateReady),
|
|
42
45
|
activate: UrlHandler,
|
|
43
46
|
}),
|
|
44
|
-
Common.Plugin.addOperationResolverModule({ activate: OperationResolver }),
|
|
45
|
-
Common.Plugin.addTranslationsModule({ translations }),
|
|
46
47
|
Plugin.make,
|
|
47
48
|
);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright 2025 DXOS.org
|
|
2
|
+
|
|
3
|
+
import { Capability } from '@dxos/app-framework';
|
|
4
|
+
import { OperationHandlerSet } from '@dxos/operation';
|
|
5
|
+
|
|
6
|
+
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
7
|
+
'OperationHandler',
|
|
8
|
+
() => import('./operation-handler'),
|
|
9
|
+
);
|
|
@@ -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/operation';
|
|
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
|
+
);
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
9
|
|
|
10
10
|
import { SimpleLayout } from '../../components';
|
|
11
11
|
import { meta } from '../../meta';
|
|
12
12
|
|
|
13
13
|
export default Capability.makeModule(() =>
|
|
14
14
|
Effect.succeed(
|
|
15
|
-
Capability.contributes(
|
|
15
|
+
Capability.contributes(Capabilities.ReactRoot, {
|
|
16
16
|
id: meta.id,
|
|
17
17
|
root: () => {
|
|
18
18
|
return <SimpleLayout />;
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
9
10
|
import { Node } from '@dxos/plugin-graph';
|
|
10
11
|
|
|
11
|
-
import { Home,
|
|
12
|
+
import { Home, NavBranch } from '../../components';
|
|
12
13
|
import { meta } from '../../meta';
|
|
13
14
|
|
|
14
15
|
type SurfaceData = {
|
|
@@ -16,24 +17,26 @@ type SurfaceData = {
|
|
|
16
17
|
properties: Record<string, any>;
|
|
17
18
|
};
|
|
18
19
|
|
|
19
|
-
const ALLOWED_DISPOSITIONS = ['workspace', 'user-account', 'pin-end'];
|
|
20
|
+
const ALLOWED_DISPOSITIONS = ['workspace', 'user-account', 'pin-end', 'alternate-tree'];
|
|
20
21
|
|
|
21
22
|
export default Capability.makeModule(() =>
|
|
22
23
|
Effect.succeed(
|
|
23
|
-
Capability.contributes(
|
|
24
|
-
|
|
25
|
-
id: `${meta.id}
|
|
24
|
+
Capability.contributes(Capabilities.ReactSurface, [
|
|
25
|
+
Surface.create({
|
|
26
|
+
id: `${meta.id}.home`,
|
|
26
27
|
role: 'article',
|
|
27
28
|
filter: (data): data is SurfaceData => data.attendableId === Node.RootId,
|
|
28
29
|
component: () => <Home />,
|
|
29
30
|
}),
|
|
30
|
-
|
|
31
|
-
id: `${meta.id}
|
|
31
|
+
Surface.create({
|
|
32
|
+
id: `${meta.id}.nav-branch`,
|
|
32
33
|
role: 'article',
|
|
33
34
|
position: 'fallback',
|
|
34
|
-
filter: (data): data is SurfaceData =>
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
filter: (data): data is SurfaceData => {
|
|
36
|
+
const props = data.properties as Record<string, any>;
|
|
37
|
+
return ALLOWED_DISPOSITIONS.includes(props?.disposition) || props?.role === 'branch';
|
|
38
|
+
},
|
|
39
|
+
component: ({ data }) => <NavBranch id={data.attendableId} />,
|
|
37
40
|
}),
|
|
38
41
|
]),
|
|
39
42
|
),
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import * as Effect from 'effect/Effect';
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
11
11
|
import { log } from '@dxos/log';
|
|
12
12
|
import { isTauri } from '@dxos/util';
|
|
13
13
|
|
|
@@ -76,7 +76,7 @@ export default Capability.makeModule(({ isPopover = false }: SpotlightDismissOpt
|
|
|
76
76
|
};
|
|
77
77
|
window.addEventListener('keydown', handleKeyDown);
|
|
78
78
|
|
|
79
|
-
return Capability.contributes(
|
|
79
|
+
return Capability.contributes(Capabilities.Null, null, () =>
|
|
80
80
|
Effect.sync(() => {
|
|
81
81
|
focusCleanup?.();
|
|
82
82
|
window.removeEventListener('keydown', handleKeyDown);
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
import { Atom } from '@effect-atom/atom-react';
|
|
6
6
|
import * as Effect from 'effect/Effect';
|
|
7
7
|
|
|
8
|
-
import { Capability
|
|
8
|
+
import { Capability } from '@dxos/app-framework';
|
|
9
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
9
10
|
import { Node } from '@dxos/plugin-graph';
|
|
10
11
|
|
|
11
12
|
import { type SimpleLayoutState } from '../../types';
|
|
@@ -17,6 +18,8 @@ const defaultState: SimpleLayoutState = {
|
|
|
17
18
|
previousWorkspace: Node.RootId,
|
|
18
19
|
history: [],
|
|
19
20
|
isPopover: false,
|
|
21
|
+
companionVariant: undefined,
|
|
22
|
+
drawerState: 'closed',
|
|
20
23
|
};
|
|
21
24
|
|
|
22
25
|
export type SimpleLayoutStateOptions = {
|
|
@@ -27,7 +30,7 @@ export default Capability.makeModule(({ initialState }: SimpleLayoutStateOptions
|
|
|
27
30
|
Effect.sync(() => {
|
|
28
31
|
const stateAtom = Atom.make<SimpleLayoutState>({ ...defaultState, ...initialState });
|
|
29
32
|
|
|
30
|
-
const layoutAtom = Atom.make((get):
|
|
33
|
+
const layoutAtom = Atom.make((get): AppCapabilities.Layout => {
|
|
31
34
|
const state = get(stateAtom);
|
|
32
35
|
return {
|
|
33
36
|
mode: 'simple',
|
|
@@ -43,7 +46,7 @@ export default Capability.makeModule(({ initialState }: SimpleLayoutStateOptions
|
|
|
43
46
|
|
|
44
47
|
return [
|
|
45
48
|
Capability.contributes(SimpleLayoutStateCapability, stateAtom),
|
|
46
|
-
Capability.contributes(
|
|
49
|
+
Capability.contributes(AppCapabilities.Layout, layoutAtom),
|
|
47
50
|
];
|
|
48
51
|
}),
|
|
49
52
|
);
|
|
@@ -4,77 +4,142 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import { LayoutOperation, fromUrlPath, getWorkspaceFromPath, toUrlPath } from '@dxos/app-toolkit';
|
|
9
|
+
import { log } from '@dxos/log';
|
|
10
|
+
import { isTauri } from '@dxos/util';
|
|
9
11
|
|
|
10
12
|
import { type SimpleLayoutState, SimpleLayoutState as SimpleLayoutStateCapability } from '../../types';
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
15
|
* URL handler for simple layout that syncs browser URL with layout state.
|
|
14
|
-
* URL
|
|
15
|
-
* Root is represented as
|
|
16
|
+
* URL paths map directly to qualified graph IDs with the leading `root` segment stripped.
|
|
17
|
+
* Root is represented as `/`.
|
|
18
|
+
*
|
|
19
|
+
* On mobile Tauri, also listens for deep links via the deep-link plugin.
|
|
16
20
|
*/
|
|
17
21
|
export default Capability.makeModule(
|
|
18
22
|
Effect.fnUntraced(function* () {
|
|
19
|
-
const {
|
|
23
|
+
const { invokePromise } = yield* Capability.get(Capabilities.OperationInvoker);
|
|
20
24
|
|
|
21
25
|
/**
|
|
22
|
-
* Handle navigation
|
|
23
|
-
*
|
|
26
|
+
* Handle navigation from a pathname.
|
|
27
|
+
* Restores the qualified graph ID and dispatches layout operations.
|
|
24
28
|
*/
|
|
25
|
-
const
|
|
26
|
-
|
|
29
|
+
const handlePathNavigation = (pathname: string) => {
|
|
30
|
+
if (isFilePath(pathname)) {
|
|
31
|
+
log.info('[UrlHandler] Skipping file path (not a graph node)', { pathname });
|
|
32
|
+
pathname = '/';
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
log.info('[UrlHandler] Navigating to path', { pathname });
|
|
27
36
|
|
|
28
|
-
|
|
29
|
-
const
|
|
37
|
+
const qualifiedId = fromUrlPath(pathname);
|
|
38
|
+
const workspace = getWorkspaceFromPath(qualifiedId);
|
|
30
39
|
|
|
31
|
-
|
|
32
|
-
const targetWorkspace = !nextWorkspace || nextWorkspace === 'root' ? Node.RootId : nextWorkspace;
|
|
40
|
+
void invokePromise(LayoutOperation.SwitchWorkspace, { subject: workspace });
|
|
33
41
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
invokeSync(Common.LayoutOperation.Open, { subject: [nextActive] });
|
|
42
|
+
const activeId = qualifiedId !== workspace ? qualifiedId : undefined;
|
|
43
|
+
if (activeId) {
|
|
44
|
+
void invokePromise(LayoutOperation.Open, { subject: [activeId] });
|
|
38
45
|
}
|
|
39
46
|
};
|
|
40
47
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
48
|
+
const onNavigation = handleNavigation(handlePathNavigation);
|
|
49
|
+
|
|
50
|
+
yield* Effect.sync(() => onNavigation());
|
|
51
|
+
window.addEventListener('popstate', onNavigation);
|
|
52
|
+
|
|
53
|
+
let unlistenDeepLink: (() => void) | undefined;
|
|
54
|
+
if (isTauri()) {
|
|
55
|
+
yield* Effect.tryPromise({
|
|
56
|
+
try: async () => {
|
|
57
|
+
const { getCurrent, onOpenUrl } = await import('@tauri-apps/plugin-deep-link');
|
|
58
|
+
|
|
59
|
+
const launchUrls = await getCurrent();
|
|
60
|
+
if (launchUrls && launchUrls.length > 0) {
|
|
61
|
+
log.info('[UrlHandler] App launched with deep links', { urls: launchUrls });
|
|
62
|
+
for (const url of launchUrls) {
|
|
63
|
+
handleDeepLink(url, handlePathNavigation);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
unlistenDeepLink = await onOpenUrl((urls) => {
|
|
68
|
+
log.info('[UrlHandler] Deep links received', { urls });
|
|
69
|
+
for (const url of urls) {
|
|
70
|
+
handleDeepLink(url, handlePathNavigation);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
log.info('[UrlHandler] Deep link listener initialized');
|
|
75
|
+
},
|
|
76
|
+
catch: (error) => {
|
|
77
|
+
log.warn('[UrlHandler] Failed to initialize deep link listener', { error });
|
|
78
|
+
return error;
|
|
79
|
+
},
|
|
80
|
+
}).pipe(Effect.catchAll(() => Effect.void));
|
|
81
|
+
}
|
|
44
82
|
|
|
45
|
-
// Subscribe to state changes to update the URL.
|
|
46
83
|
let lastWorkspace: string | undefined;
|
|
47
84
|
let lastActive: string | undefined;
|
|
48
|
-
const unsubscribe = yield*
|
|
49
|
-
|
|
50
|
-
(state: SimpleLayoutState) => {
|
|
51
|
-
const { workspace, active } = state;
|
|
52
|
-
|
|
53
|
-
// Only update URL if relevant state changed.
|
|
54
|
-
if (workspace !== lastWorkspace || active !== lastActive) {
|
|
55
|
-
lastWorkspace = workspace;
|
|
56
|
-
lastActive = active;
|
|
57
|
-
|
|
58
|
-
// Build path: root is represented as /, other workspaces as /{workspace}.
|
|
59
|
-
let path: string;
|
|
60
|
-
if (workspace === Node.RootId) {
|
|
61
|
-
path = active ? `/${Node.RootId}/${active}` : '/';
|
|
62
|
-
} else {
|
|
63
|
-
path = active ? `/${workspace}/${active}` : `/${workspace}`;
|
|
64
|
-
}
|
|
85
|
+
const unsubscribe = yield* Capabilities.subscribeAtom(SimpleLayoutStateCapability, (state: SimpleLayoutState) => {
|
|
86
|
+
const { workspace, active } = state;
|
|
65
87
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
88
|
+
if (workspace !== lastWorkspace || active !== lastActive) {
|
|
89
|
+
lastWorkspace = workspace;
|
|
90
|
+
lastActive = active;
|
|
91
|
+
|
|
92
|
+
const path = active ? toUrlPath(active) : toUrlPath(workspace);
|
|
93
|
+
if (window.location.pathname !== path) {
|
|
94
|
+
history.pushState(null, '', `${path}${window.location.search}`);
|
|
69
95
|
}
|
|
70
|
-
}
|
|
71
|
-
);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
72
98
|
|
|
73
|
-
return Capability.contributes(
|
|
99
|
+
return Capability.contributes(Capabilities.Null, null, () =>
|
|
74
100
|
Effect.sync(() => {
|
|
75
|
-
window.removeEventListener('popstate',
|
|
101
|
+
window.removeEventListener('popstate', onNavigation);
|
|
76
102
|
unsubscribe();
|
|
103
|
+
unlistenDeepLink?.();
|
|
77
104
|
}),
|
|
78
105
|
);
|
|
79
106
|
}),
|
|
80
107
|
);
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Check if a path is a special redirect path that shouldn't be navigated to.
|
|
111
|
+
* These paths are handled by other systems (e.g., OAuth).
|
|
112
|
+
*/
|
|
113
|
+
const isRedirectPath = (pathname: string): boolean => pathname.startsWith('/redirect/');
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Paths with file extensions (e.g., `/iframe.html`) are not graph node paths.
|
|
117
|
+
* This guards against embedded contexts like Storybook iframes interpreting
|
|
118
|
+
* the host pathname as a navigation target.
|
|
119
|
+
*/
|
|
120
|
+
const isFilePath = (pathname: string): boolean => /\.[a-z]+$/i.test(pathname);
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Returns a handler for navigation events (initial load and popstate) that navigates to current pathname.
|
|
124
|
+
*/
|
|
125
|
+
const handleNavigation =
|
|
126
|
+
(navigate: (pathname: string) => void): (() => void) =>
|
|
127
|
+
() =>
|
|
128
|
+
navigate(window.location.pathname);
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Handle deep link URL from Tauri. Parses the URL and calls navigate unless it's a redirect path.
|
|
132
|
+
*/
|
|
133
|
+
const handleDeepLink = (urlString: string, navigate: (pathname: string) => void): void => {
|
|
134
|
+
log.info('[UrlHandler] Deep link received', { url: urlString });
|
|
135
|
+
try {
|
|
136
|
+
const url = new URL(urlString);
|
|
137
|
+
if (isRedirectPath(url.pathname)) {
|
|
138
|
+
log.info('[UrlHandler] Skipping redirect path (handled elsewhere)', { pathname: url.pathname });
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
navigate(url.pathname);
|
|
142
|
+
} catch (error) {
|
|
143
|
+
log.warn('[UrlHandler] Failed to parse deep link URL', { urlString, error });
|
|
144
|
+
}
|
|
145
|
+
};
|
|
@@ -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
10
|
import { translations } from '../translations';
|
|
10
11
|
|
|
11
|
-
import { ContentError } from './ContentError';
|
|
12
|
-
|
|
13
12
|
const meta = {
|
|
14
|
-
title: 'plugins/plugin-simple-layout/
|
|
15
|
-
component:
|
|
16
|
-
decorators: [withTheme],
|
|
13
|
+
title: 'plugins/plugin-simple-layout/components/ErrorFallback',
|
|
14
|
+
component: ErrorFallback,
|
|
15
|
+
decorators: [withTheme()],
|
|
17
16
|
parameters: {
|
|
18
17
|
layout: 'centered',
|
|
19
18
|
translations,
|
|
20
19
|
},
|
|
21
|
-
} satisfies Meta<typeof
|
|
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 };
|