@dxos/plugin-simple-layout 0.8.4-main.7996785055 → 0.8.4-main.8baae0fced
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/LICENSE +102 -5
- package/dist/lib/neutral/SimpleLayoutPlugin.mjs +52 -0
- package/dist/lib/neutral/SimpleLayoutPlugin.mjs.map +7 -0
- package/dist/lib/neutral/app-graph-builder-EYQKLRRP.mjs +21 -0
- package/dist/lib/neutral/app-graph-builder-EYQKLRRP.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +21 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-5LQGH5KW.mjs +20 -0
- package/dist/lib/neutral/chunk-5LQGH5KW.mjs.map +7 -0
- package/dist/lib/{browser/chunk-XJVW3PRY.mjs → neutral/chunk-7UDV3JDT.mjs} +4 -4
- package/dist/lib/neutral/chunk-7UDV3JDT.mjs.map +7 -0
- package/dist/lib/neutral/chunk-FD2CAY4Q.mjs +26 -0
- package/dist/lib/neutral/chunk-FD2CAY4Q.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/neutral/chunk-Y2QR5SYD.mjs +8 -0
- package/dist/lib/neutral/chunk-Y2QR5SYD.mjs.map +7 -0
- package/dist/lib/{browser/close-OT5JOGVY.mjs → neutral/close-WKMURGUB.mjs} +5 -4
- package/dist/lib/{node-esm/close-PEVHREL2.mjs.map → neutral/close-WKMURGUB.mjs.map} +1 -1
- package/dist/lib/{browser/chunk-J5FQ32AV.mjs → neutral/components/index.mjs} +261 -591
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +332 -0
- package/dist/lib/neutral/hooks/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +14 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/meta.mjs.map +7 -0
- package/dist/lib/neutral/open-PEVXNVTV.mjs +51 -0
- package/dist/lib/neutral/open-PEVXNVTV.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-EAIE7KPR.mjs +13 -0
- package/dist/lib/neutral/operation-handler-EAIE7KPR.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/operations/index.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/{browser/react-root-6KIGPLUT.mjs → neutral/react-root-VE265VX4.mjs} +5 -8
- package/dist/lib/neutral/react-root-VE265VX4.mjs.map +7 -0
- package/dist/lib/{node-esm/react-surface-WLKB6AET.mjs → neutral/react-surface-YHXOHJI7.mjs} +16 -15
- package/dist/lib/neutral/react-surface-YHXOHJI7.mjs.map +7 -0
- package/dist/lib/{browser/revert-workspace-DLE265AN.mjs → neutral/revert-workspace-ST6NZUNG.mjs} +5 -4
- package/dist/lib/{node-esm/revert-workspace-XZXT64YA.mjs.map → neutral/revert-workspace-ST6NZUNG.mjs.map} +1 -1
- package/dist/lib/{browser/set-52HGTSH4.mjs → neutral/set-6ZRLWPJS.mjs} +5 -4
- package/dist/lib/{node-esm/set-5I6LFH5L.mjs.map → neutral/set-6ZRLWPJS.mjs.map} +1 -1
- package/dist/lib/{browser/set-layout-mode-T6QI3DGU.mjs → neutral/set-layout-mode-L22HRCKS.mjs} +4 -2
- package/dist/lib/neutral/set-layout-mode-L22HRCKS.mjs.map +7 -0
- package/dist/lib/{browser/spotlight-dismiss-67PHYS5B.mjs → neutral/spotlight-dismiss-EIYW5E7M.mjs} +7 -15
- package/dist/lib/{node-esm/spotlight-dismiss-RMLRZUVY.mjs.map → neutral/spotlight-dismiss-EIYW5E7M.mjs.map} +3 -3
- package/dist/lib/{browser/state-TXSMUWYI.mjs → neutral/state-7NXKBLPY.mjs} +5 -6
- package/dist/lib/neutral/state-7NXKBLPY.mjs.map +7 -0
- package/dist/lib/{browser/switch-workspace-5Y6T4BWJ.mjs → neutral/switch-workspace-PYWPTMFO.mjs} +5 -4
- package/dist/lib/{node-esm/switch-workspace-PB6T2SGY.mjs.map → neutral/switch-workspace-PYWPTMFO.mjs.map} +1 -1
- package/dist/lib/neutral/translations.mjs +36 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +10 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/lib/{browser/update-complementary-MX3TTVAB.mjs → neutral/update-complementary-HKWF5OXT.mjs} +8 -6
- package/dist/lib/neutral/update-complementary-HKWF5OXT.mjs.map +7 -0
- package/dist/lib/{browser/update-dialog-FPAPZXKO.mjs → neutral/update-dialog-P4ASXCE7.mjs} +5 -4
- package/dist/lib/{node-esm/update-dialog-ID267DCL.mjs.map → neutral/update-dialog-P4ASXCE7.mjs.map} +1 -1
- package/dist/lib/{browser/update-popover-6V5ZTIYN.mjs → neutral/update-popover-REAKC2GN.mjs} +5 -4
- package/dist/lib/{node-esm/update-popover-RLHU2HF4.mjs.map → neutral/update-popover-REAKC2GN.mjs.map} +1 -1
- package/dist/lib/{browser/update-sidebar-WHDKYMV7.mjs → neutral/update-sidebar-O5SQPR6Q.mjs} +4 -2
- package/dist/lib/neutral/update-sidebar-O5SQPR6Q.mjs.map +7 -0
- package/dist/lib/{node-esm/url-handler-WMONO2T6.mjs → neutral/url-handler-GZXUUAHD.mjs} +45 -80
- package/dist/lib/neutral/url-handler-GZXUUAHD.mjs.map +7 -0
- package/dist/types/src/SimpleLayoutPlugin.d.ts +1 -0
- package/dist/types/src/SimpleLayoutPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +21 -6
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/{operation-handler/operation-handler.d.ts → operation-handler.d.ts} +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/{spotlight-dismiss/spotlight-dismiss.d.ts → spotlight-dismiss.d.ts} +1 -1
- package/dist/types/src/capabilities/spotlight-dismiss.d.ts.map +1 -0
- package/dist/types/src/capabilities/{state/state.d.ts → state.d.ts} +3 -3
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/{url-handler/url-handler.d.ts → url-handler.d.ts} +1 -1
- package/dist/types/src/capabilities/url-handler.d.ts.map +1 -0
- package/dist/types/src/components/ContentError.stories.d.ts +21 -19
- package/dist/types/src/components/ContentError.stories.d.ts.map +1 -1
- package/dist/types/src/components/DebugOverlay/DebugOverlay.d.ts.map +1 -1
- package/dist/types/src/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/types/src/components/Home/Home.d.ts.map +1 -1
- package/dist/types/src/components/Loading/Loading.stories.d.ts.map +1 -1
- package/dist/types/src/components/MobileLayout/MobileLayout.d.ts +2 -2
- package/dist/types/src/components/MobileLayout/MobileLayout.d.ts.map +1 -1
- package/dist/types/src/components/MobileLayout/MobileLayout.stories.d.ts.map +1 -1
- package/dist/types/src/components/NavBranch/NavBranch.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/AppBar.d.ts +1 -5
- package/dist/types/src/components/SimpleLayout/AppBar.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/AppBar.stories.d.ts +21 -19
- package/dist/types/src/components/SimpleLayout/AppBar.stories.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/Drawer.d.ts +4 -7
- package/dist/types/src/components/SimpleLayout/Drawer.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/Main.d.ts +4 -7
- package/dist/types/src/components/SimpleLayout/Main.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/NavBar.d.ts +1 -5
- package/dist/types/src/components/SimpleLayout/NavBar.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/NavBar.stories.d.ts +22 -24
- package/dist/types/src/components/SimpleLayout/NavBar.stories.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/SimpleLayout.stories.d.ts +21 -19
- package/dist/types/src/components/SimpleLayout/SimpleLayout.stories.d.ts.map +1 -1
- package/dist/types/src/components/hooks.d.ts.map +1 -1
- package/dist/types/src/hooks/actions.d.ts +3 -3
- package/dist/types/src/hooks/actions.d.ts.map +1 -1
- package/dist/types/src/hooks/useAppBarProps.d.ts +2 -2
- package/dist/types/src/hooks/useAppBarProps.d.ts.map +1 -1
- package/dist/types/src/hooks/useCompanions.d.ts.map +1 -1
- package/dist/types/src/hooks/useDrawerActions.d.ts.map +1 -1
- 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/index.d.ts +2 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/close.d.ts +1 -1
- package/dist/types/src/operations/close.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +1 -1
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/operations/open.d.ts +1 -1
- package/dist/types/src/operations/open.d.ts.map +1 -1
- package/dist/types/src/operations/revert-workspace.d.ts +1 -1
- package/dist/types/src/operations/revert-workspace.d.ts.map +1 -1
- package/dist/types/src/operations/set-layout-mode.d.ts +1 -1
- package/dist/types/src/operations/set-layout-mode.d.ts.map +1 -1
- package/dist/types/src/operations/set.d.ts +1 -1
- package/dist/types/src/operations/set.d.ts.map +1 -1
- package/dist/types/src/operations/state-access.d.ts +3 -3
- package/dist/types/src/operations/state-access.d.ts.map +1 -1
- package/dist/types/src/operations/switch-workspace.d.ts +1 -1
- package/dist/types/src/operations/switch-workspace.d.ts.map +1 -1
- package/dist/types/src/operations/update-complementary.d.ts +1 -1
- package/dist/types/src/operations/update-complementary.d.ts.map +1 -1
- package/dist/types/src/operations/update-dialog.d.ts +1 -1
- package/dist/types/src/operations/update-dialog.d.ts.map +1 -1
- package/dist/types/src/operations/update-popover.d.ts +1 -1
- package/dist/types/src/operations/update-popover.d.ts.map +1 -1
- package/dist/types/src/operations/update-sidebar.d.ts +1 -1
- package/dist/types/src/operations/update-sidebar.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +21 -20
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/{capabilities.d.ts → SimpleLayoutCapabilities.d.ts} +12 -10
- package/dist/types/src/types/SimpleLayoutCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/SimpleLayoutEvents.d.ts +4 -0
- package/dist/types/src/types/SimpleLayoutEvents.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +87 -33
- package/src/SimpleLayoutPlugin.ts +17 -6
- package/src/capabilities/app-graph-builder.ts +21 -0
- package/src/capabilities/index.ts +13 -6
- package/src/capabilities/{operation-handler/operation-handler.ts → operation-handler.ts} +2 -2
- package/src/capabilities/{react-root/react-root.tsx → react-root.tsx} +2 -2
- package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +13 -6
- package/src/capabilities/{state/state.tsx → state.tsx} +5 -6
- package/src/capabilities/url-handler.ts +164 -0
- package/src/components/ContentError.stories.tsx +1 -1
- package/src/components/Dialog/Dialog.tsx +14 -3
- package/src/components/Home/Home.tsx +3 -2
- package/src/components/Loading/Loading.tsx +1 -1
- package/src/components/MobileLayout/MobileLayout.stories.tsx +13 -13
- package/src/components/MobileLayout/MobileLayout.tsx +0 -2
- package/src/components/NavBranch/NavBranch.tsx +4 -7
- package/src/components/Popover/Popover.tsx +10 -5
- package/src/components/SimpleLayout/AppBar.stories.tsx +7 -7
- package/src/components/SimpleLayout/AppBar.tsx +45 -42
- package/src/components/SimpleLayout/Drawer.tsx +24 -16
- package/src/components/SimpleLayout/Main.tsx +5 -5
- package/src/components/SimpleLayout/NavBar.stories.tsx +2 -2
- package/src/components/SimpleLayout/SimpleLayout.stories.tsx +10 -10
- package/src/components/SimpleLayout/SimpleLayout.tsx +9 -9
- package/src/components/hooks.ts +1 -1
- package/src/hooks/actions.ts +8 -5
- package/src/hooks/useAppBarProps.ts +4 -24
- package/src/hooks/useDrawerActions.ts +6 -6
- package/src/hooks/useNavbarActions.ts +4 -4
- package/src/hooks/useSimpleLayoutState.ts +7 -5
- package/src/index.ts +2 -1
- package/src/meta.ts +3 -1
- package/src/operations/close.ts +1 -1
- package/src/operations/index.ts +1 -1
- package/src/operations/open.ts +36 -3
- package/src/operations/revert-workspace.ts +1 -1
- package/src/operations/set-layout-mode.ts +1 -1
- package/src/operations/set.ts +1 -1
- package/src/operations/state-access.ts +5 -3
- package/src/operations/switch-workspace.ts +1 -1
- package/src/operations/update-complementary.ts +4 -3
- package/src/operations/update-dialog.ts +1 -1
- package/src/operations/update-popover.ts +1 -1
- package/src/operations/update-sidebar.ts +1 -1
- package/src/plugin.ts +11 -0
- package/src/translations.ts +20 -19
- package/src/types/{capabilities.ts → SimpleLayoutCapabilities.ts} +6 -18
- package/src/types/SimpleLayoutEvents.ts +15 -0
- package/src/types/index.ts +2 -2
- package/dist/lib/browser/chunk-J5FQ32AV.mjs.map +0 -7
- package/dist/lib/browser/chunk-MRR7PXSM.mjs +0 -29
- package/dist/lib/browser/chunk-MRR7PXSM.mjs.map +0 -7
- package/dist/lib/browser/chunk-XJVW3PRY.mjs.map +0 -7
- package/dist/lib/browser/close-OT5JOGVY.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -102
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/open-4FQ44Z5G.mjs +0 -31
- package/dist/lib/browser/open-4FQ44Z5G.mjs.map +0 -7
- package/dist/lib/browser/operation-handler-OAD7LISD.mjs +0 -16
- package/dist/lib/browser/operation-handler-OAD7LISD.mjs.map +0 -7
- package/dist/lib/browser/react-root-6KIGPLUT.mjs.map +0 -7
- package/dist/lib/browser/react-surface-JLIEQGOL.mjs +0 -44
- package/dist/lib/browser/react-surface-JLIEQGOL.mjs.map +0 -7
- package/dist/lib/browser/revert-workspace-DLE265AN.mjs.map +0 -7
- package/dist/lib/browser/set-52HGTSH4.mjs.map +0 -7
- package/dist/lib/browser/set-layout-mode-T6QI3DGU.mjs.map +0 -7
- package/dist/lib/browser/spotlight-dismiss-67PHYS5B.mjs.map +0 -7
- package/dist/lib/browser/state-TXSMUWYI.mjs.map +0 -7
- package/dist/lib/browser/switch-workspace-5Y6T4BWJ.mjs.map +0 -7
- package/dist/lib/browser/update-complementary-MX3TTVAB.mjs.map +0 -7
- package/dist/lib/browser/update-dialog-FPAPZXKO.mjs.map +0 -7
- package/dist/lib/browser/update-popover-6V5ZTIYN.mjs.map +0 -7
- package/dist/lib/browser/update-sidebar-WHDKYMV7.mjs.map +0 -7
- package/dist/lib/browser/url-handler-GUJ3L7Y3.mjs +0 -163
- package/dist/lib/browser/url-handler-GUJ3L7Y3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-27K22G6S.mjs +0 -23
- package/dist/lib/node-esm/chunk-27K22G6S.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-EXNDYZTP.mjs +0 -1257
- package/dist/lib/node-esm/chunk-EXNDYZTP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-WMNTJ2MK.mjs +0 -31
- package/dist/lib/node-esm/chunk-WMNTJ2MK.mjs.map +0 -7
- package/dist/lib/node-esm/close-PEVHREL2.mjs +0 -35
- package/dist/lib/node-esm/index.mjs +0 -103
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/open-LMJY7JCJ.mjs +0 -32
- package/dist/lib/node-esm/open-LMJY7JCJ.mjs.map +0 -7
- package/dist/lib/node-esm/operation-handler-A2DC4WHC.mjs +0 -18
- package/dist/lib/node-esm/operation-handler-A2DC4WHC.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-5SCW2KTH.mjs +0 -22
- package/dist/lib/node-esm/react-root-5SCW2KTH.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-WLKB6AET.mjs.map +0 -7
- package/dist/lib/node-esm/revert-workspace-XZXT64YA.mjs +0 -22
- package/dist/lib/node-esm/set-5I6LFH5L.mjs +0 -22
- package/dist/lib/node-esm/set-layout-mode-F5B6QLZM.mjs +0 -13
- package/dist/lib/node-esm/set-layout-mode-F5B6QLZM.mjs.map +0 -7
- package/dist/lib/node-esm/spotlight-dismiss-RMLRZUVY.mjs +0 -68
- package/dist/lib/node-esm/state-JMX6FAG4.mjs +0 -49
- package/dist/lib/node-esm/state-JMX6FAG4.mjs.map +0 -7
- package/dist/lib/node-esm/switch-workspace-PB6T2SGY.mjs +0 -25
- package/dist/lib/node-esm/update-complementary-FTW423IY.mjs +0 -32
- package/dist/lib/node-esm/update-complementary-FTW423IY.mjs.map +0 -7
- package/dist/lib/node-esm/update-dialog-ID267DCL.mjs +0 -30
- package/dist/lib/node-esm/update-popover-RLHU2HF4.mjs +0 -34
- package/dist/lib/node-esm/update-sidebar-BJ7HTNZ4.mjs +0 -12
- package/dist/lib/node-esm/update-sidebar-BJ7HTNZ4.mjs.map +0 -7
- package/dist/lib/node-esm/url-handler-WMONO2T6.mjs.map +0 -7
- package/dist/types/src/capabilities/operation-handler/index.d.ts +0 -4
- package/dist/types/src/capabilities/operation-handler/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-root/index.d.ts +0 -6
- package/dist/types/src/capabilities/react-root/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-root/react-root.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/spotlight-dismiss/index.d.ts +0 -3
- package/dist/types/src/capabilities/spotlight-dismiss/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/spotlight-dismiss/spotlight-dismiss.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/index.d.ts +0 -13
- package/dist/types/src/capabilities/state/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/state.d.ts.map +0 -1
- package/dist/types/src/capabilities/url-handler/index.d.ts +0 -3
- package/dist/types/src/capabilities/url-handler/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/url-handler/url-handler.d.ts.map +0 -1
- package/dist/types/src/types/capabilities.d.ts.map +0 -1
- package/dist/types/src/types/events.d.ts +0 -6
- package/dist/types/src/types/events.d.ts.map +0 -1
- package/src/capabilities/operation-handler/index.ts +0 -9
- package/src/capabilities/react-root/index.ts +0 -7
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/spotlight-dismiss/index.ts +0 -7
- package/src/capabilities/state/index.ts +0 -9
- package/src/capabilities/url-handler/index.ts +0 -7
- package/src/capabilities/url-handler/url-handler.ts +0 -145
- package/src/types/events.ts +0 -15
- /package/dist/types/src/capabilities/{react-root/react-root.d.ts → react-root.d.ts} +0 -0
- /package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
- /package/src/capabilities/{spotlight-dismiss/spotlight-dismiss.ts → spotlight-dismiss.ts} +0 -0
|
@@ -1,10 +1,52 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from "
|
|
1
|
+
import "../chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/components/DebugOverlay/DebugOverlay.tsx
|
|
4
|
+
import { createContext } from "@radix-ui/react-context";
|
|
5
|
+
import React, { useCallback, useRef } from "react";
|
|
6
|
+
var DEBUG_OVERLAY_NAME = "DebugOverlay";
|
|
7
|
+
var [DebugOverlayProvider, useDebugLog] = createContext(DEBUG_OVERLAY_NAME, {
|
|
8
|
+
dbg: () => {
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
var DebugOverlayRoot = ({ children, enabled = true, maxLines = 10 }) => {
|
|
12
|
+
const overlayRef = useRef(null);
|
|
13
|
+
const dbg = useCallback((msg) => {
|
|
14
|
+
if (!overlayRef.current) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const line = document.createElement("pre");
|
|
18
|
+
line.textContent = `${(performance.now() / 1e3).toFixed(2).padStart(8, " ")} ${msg}`;
|
|
19
|
+
overlayRef.current.prepend(line);
|
|
20
|
+
while (overlayRef.current.children.length > maxLines) {
|
|
21
|
+
overlayRef.current.lastChild?.remove();
|
|
22
|
+
}
|
|
23
|
+
}, []);
|
|
24
|
+
return /* @__PURE__ */ React.createElement(DebugOverlayProvider, {
|
|
25
|
+
dbg
|
|
26
|
+
}, children, enabled && /* @__PURE__ */ React.createElement("div", {
|
|
27
|
+
ref: overlayRef,
|
|
28
|
+
style: {
|
|
29
|
+
position: "fixed",
|
|
30
|
+
bottom: "calc(var(--kb-height, 0px) + 8px)",
|
|
31
|
+
left: 8,
|
|
32
|
+
right: 8,
|
|
33
|
+
background: "rgba(0,0,0,0.8)",
|
|
34
|
+
color: "#0f0",
|
|
35
|
+
fontSize: 10,
|
|
36
|
+
fontFamily: "monospace",
|
|
37
|
+
padding: 6,
|
|
38
|
+
borderRadius: 4,
|
|
39
|
+
zIndex: 9999,
|
|
40
|
+
pointerEvents: "none"
|
|
41
|
+
}
|
|
42
|
+
}));
|
|
43
|
+
};
|
|
44
|
+
var DebugOverlay = {
|
|
45
|
+
Root: DebugOverlayRoot
|
|
46
|
+
};
|
|
5
47
|
|
|
6
48
|
// src/components/Home/Home.tsx
|
|
7
|
-
import
|
|
49
|
+
import React2, { useCallback as useCallback2, useEffect as useEffect2, useMemo, useRef as useRef2 } from "react";
|
|
8
50
|
import { useOperationInvoker } from "@dxos/app-framework/ui";
|
|
9
51
|
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
10
52
|
import { useAppGraph as useAppGraph2 } from "@dxos/app-toolkit/ui";
|
|
@@ -15,12 +57,13 @@ import { Mosaic } from "@dxos/react-ui-mosaic";
|
|
|
15
57
|
import { SearchPanel, useSearchListItem, useSearchListResults } from "@dxos/react-ui-search";
|
|
16
58
|
import { mx } from "@dxos/ui-theme";
|
|
17
59
|
import { byPosition, getHostPlatform, isTauri } from "@dxos/util";
|
|
60
|
+
import { meta } from "#meta";
|
|
18
61
|
|
|
19
62
|
// src/components/hooks.ts
|
|
20
63
|
import { useEffect } from "react";
|
|
21
|
-
import { expandAttendableId } from "@dxos/react-ui-attention";
|
|
22
64
|
import { useAppGraph } from "@dxos/app-toolkit/ui";
|
|
23
65
|
import { Graph } from "@dxos/plugin-graph";
|
|
66
|
+
import { expandAttendableId } from "@dxos/react-ui-attention";
|
|
24
67
|
var useExpandPath = (nodeId) => {
|
|
25
68
|
const { graph } = useAppGraph();
|
|
26
69
|
useEffect(() => {
|
|
@@ -58,15 +101,15 @@ var Home = (_) => {
|
|
|
58
101
|
extract: (node) => toLocalizedString(node.properties.label, t)
|
|
59
102
|
});
|
|
60
103
|
const autoFocus = !isTauri() || getHostPlatform() !== "ios";
|
|
61
|
-
return /* @__PURE__ */
|
|
104
|
+
return /* @__PURE__ */ React2.createElement(SearchPanel, {
|
|
62
105
|
onSearch: handleSearch
|
|
63
|
-
}, /* @__PURE__ */
|
|
106
|
+
}, /* @__PURE__ */ React2.createElement(Mosaic.Container, {
|
|
64
107
|
asChild: true
|
|
65
|
-
}, /* @__PURE__ */
|
|
108
|
+
}, /* @__PURE__ */ React2.createElement(ScrollArea.Root, {
|
|
66
109
|
centered: true,
|
|
67
110
|
padding: true,
|
|
68
111
|
thin: true
|
|
69
|
-
}, /* @__PURE__ */
|
|
112
|
+
}, /* @__PURE__ */ React2.createElement(ScrollArea.Viewport, null, /* @__PURE__ */ React2.createElement(Mosaic.Stack, {
|
|
70
113
|
classNames: "gap-1",
|
|
71
114
|
draggable: false,
|
|
72
115
|
items: results,
|
|
@@ -81,9 +124,9 @@ var WorkspaceTile = (props) => {
|
|
|
81
124
|
const { selectedValue, registerItem, unregisterItem } = useSearchListItem();
|
|
82
125
|
const name = toLocalizedString(data.properties.label, t);
|
|
83
126
|
const isSelected = selectedValue === data.id;
|
|
84
|
-
const cardRef =
|
|
127
|
+
const cardRef = useRef2(null);
|
|
85
128
|
useExpandPath(data.id);
|
|
86
|
-
const handleSelect =
|
|
129
|
+
const handleSelect = useCallback2(() => invokePromise(LayoutOperation.SwitchWorkspace, {
|
|
87
130
|
subject: data.id
|
|
88
131
|
}), [
|
|
89
132
|
invokePromise,
|
|
@@ -110,26 +153,26 @@ var WorkspaceTile = (props) => {
|
|
|
110
153
|
}, [
|
|
111
154
|
isSelected
|
|
112
155
|
]);
|
|
113
|
-
return /* @__PURE__ */
|
|
156
|
+
return /* @__PURE__ */ React2.createElement(Card.Root, {
|
|
114
157
|
role: "button",
|
|
115
158
|
fullWidth: true,
|
|
116
159
|
tabIndex: -1,
|
|
117
160
|
"data-selected": isSelected,
|
|
118
|
-
classNames: mx("dx-focus-ring", isSelected && "bg-
|
|
161
|
+
classNames: mx("dx-focus-ring", isSelected && "bg-selected-surface"),
|
|
119
162
|
onClick: handleSelect,
|
|
120
163
|
ref: cardRef
|
|
121
|
-
}, /* @__PURE__ */
|
|
164
|
+
}, /* @__PURE__ */ React2.createElement(Card.Toolbar, {
|
|
122
165
|
density: "fine"
|
|
123
|
-
}, /* @__PURE__ */
|
|
166
|
+
}, /* @__PURE__ */ React2.createElement(Avatar.Root, null, /* @__PURE__ */ React2.createElement(Avatar.Content, {
|
|
124
167
|
icon: data.properties.icon,
|
|
125
168
|
hue: data.properties.hue,
|
|
126
169
|
hueVariant: "transparent",
|
|
127
170
|
variant: "square",
|
|
128
171
|
size: 8,
|
|
129
172
|
fallback: name
|
|
130
|
-
}), /* @__PURE__ */
|
|
173
|
+
}), /* @__PURE__ */ React2.createElement(Avatar.Label, {
|
|
131
174
|
classNames: "cursor-pointer"
|
|
132
|
-
}, name), /* @__PURE__ */
|
|
175
|
+
}, name), /* @__PURE__ */ React2.createElement(Icon, {
|
|
133
176
|
icon: "ph--caret-right--regular"
|
|
134
177
|
}))));
|
|
135
178
|
};
|
|
@@ -149,239 +192,10 @@ var useItemsByDisposition = (disposition, sort = false) => {
|
|
|
149
192
|
]);
|
|
150
193
|
};
|
|
151
194
|
|
|
152
|
-
// src/components/SimpleLayout/SimpleLayout.tsx
|
|
153
|
-
import React12, { useLayoutEffect as useLayoutEffect2, useRef as useRef5, useState as useState3 } from "react";
|
|
154
|
-
import { Splitter } from "@dxos/react-ui";
|
|
155
|
-
import { Mosaic as Mosaic3 } from "@dxos/react-ui-mosaic";
|
|
156
|
-
|
|
157
|
-
// src/hooks/useAppBarProps.ts
|
|
158
|
-
import { Atom, useAtomValue } from "@effect-atom/atom-react";
|
|
159
|
-
import * as Effect from "effect/Effect";
|
|
160
|
-
import * as Option from "effect/Option";
|
|
161
|
-
import { useCallback as useCallback2, useMemo as useMemo2 } from "react";
|
|
162
|
-
import { useCapability, useOperationInvoker as useOperationInvoker2 } from "@dxos/app-framework/ui";
|
|
163
|
-
import { LayoutOperation as LayoutOperation2 } from "@dxos/app-toolkit";
|
|
164
|
-
import { useAppGraph as useAppGraph3 } from "@dxos/app-toolkit/ui";
|
|
165
|
-
import { Graph as Graph2, Node as Node2, useActionRunner, useNode } from "@dxos/plugin-graph";
|
|
166
|
-
import { toLocalizedString as toLocalizedString2, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
167
|
-
var useAppBarProps = () => {
|
|
168
|
-
const { t } = useTranslation2(meta.id);
|
|
169
|
-
const stateAtom = useCapability(SimpleLayoutState);
|
|
170
|
-
const state = useAtomValue(stateAtom);
|
|
171
|
-
const { graph } = useAppGraph3();
|
|
172
|
-
const { invokePromise } = useOperationInvoker2();
|
|
173
|
-
const runAction = useActionRunner();
|
|
174
|
-
const activeId = state.active ?? state.workspace;
|
|
175
|
-
const node = useNode(graph, activeId);
|
|
176
|
-
const title = node ? toLocalizedString2(node.properties.label, t) : void 0;
|
|
177
|
-
const actionsAtom = useMemo2(() => Atom.make((get) => {
|
|
178
|
-
const state2 = get(stateAtom);
|
|
179
|
-
const activeId2 = state2.active ?? state2.workspace;
|
|
180
|
-
const allActions = activeId2 ? get(graph.actions(activeId2)) : [];
|
|
181
|
-
const filtered = allActions.filter((action) => [
|
|
182
|
-
"list-item",
|
|
183
|
-
"list-item-primary",
|
|
184
|
-
"heading-list-item"
|
|
185
|
-
].includes(action.properties.disposition));
|
|
186
|
-
const nodes = filtered;
|
|
187
|
-
const edges = filtered.map((action) => ({
|
|
188
|
-
source: "root",
|
|
189
|
-
target: action.id,
|
|
190
|
-
relation: "child"
|
|
191
|
-
}));
|
|
192
|
-
const workspaceConnections = state2.workspace ? get(graph.connections(state2.workspace, "child")) : [];
|
|
193
|
-
const alternateTreeNode = workspaceConnections.find((node2) => node2.properties.disposition === "alternate-tree");
|
|
194
|
-
if (alternateTreeNode && activeId2 !== alternateTreeNode.id) {
|
|
195
|
-
const settingsAction = {
|
|
196
|
-
id: `appbar-settings-${alternateTreeNode.id}`,
|
|
197
|
-
type: Node2.ActionType,
|
|
198
|
-
data: () => Effect.promise(() => invokePromise(LayoutOperation2.Open, {
|
|
199
|
-
subject: [
|
|
200
|
-
alternateTreeNode.id
|
|
201
|
-
]
|
|
202
|
-
})),
|
|
203
|
-
properties: {
|
|
204
|
-
label: alternateTreeNode.properties.label ?? alternateTreeNode.id,
|
|
205
|
-
icon: alternateTreeNode.properties.icon ?? "ph--placeholder--regular"
|
|
206
|
-
}
|
|
207
|
-
};
|
|
208
|
-
nodes.push(settingsAction);
|
|
209
|
-
edges.push({
|
|
210
|
-
source: "root",
|
|
211
|
-
target: settingsAction.id,
|
|
212
|
-
relation: "child"
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
return {
|
|
216
|
-
nodes,
|
|
217
|
-
edges
|
|
218
|
-
};
|
|
219
|
-
}), [
|
|
220
|
-
graph,
|
|
221
|
-
stateAtom
|
|
222
|
-
]);
|
|
223
|
-
const showBackButton = activeId !== void 0 && activeId !== Node2.RootId;
|
|
224
|
-
const onBack = useCallback2(() => {
|
|
225
|
-
if (state.active) {
|
|
226
|
-
const isWorkspace = Graph2.getNode(graph, state.active).pipe(Option.map((node2) => node2.properties.disposition === "workspace"), Option.getOrElse(() => false));
|
|
227
|
-
if (state.history.length === 0 && isWorkspace) {
|
|
228
|
-
void invokePromise(LayoutOperation2.SwitchWorkspace, {
|
|
229
|
-
subject: Node2.RootId
|
|
230
|
-
});
|
|
231
|
-
} else {
|
|
232
|
-
void invokePromise(LayoutOperation2.Close, {
|
|
233
|
-
subject: [
|
|
234
|
-
state.active
|
|
235
|
-
]
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
} else {
|
|
239
|
-
void invokePromise(LayoutOperation2.SwitchWorkspace, {
|
|
240
|
-
subject: Node2.RootId
|
|
241
|
-
});
|
|
242
|
-
}
|
|
243
|
-
}, [
|
|
244
|
-
graph,
|
|
245
|
-
invokePromise,
|
|
246
|
-
state.active,
|
|
247
|
-
state.history.length
|
|
248
|
-
]);
|
|
249
|
-
const popoverAnchorId = node && state.popoverAnchorId === `${meta.id}:${node.id}` ? state.popoverAnchorId : void 0;
|
|
250
|
-
return {
|
|
251
|
-
title,
|
|
252
|
-
actions: actionsAtom,
|
|
253
|
-
showBackButton,
|
|
254
|
-
popoverAnchorId,
|
|
255
|
-
onBack,
|
|
256
|
-
onAction: runAction
|
|
257
|
-
};
|
|
258
|
-
};
|
|
259
|
-
|
|
260
|
-
// src/hooks/useCompanions.ts
|
|
261
|
-
import { useMemo as useMemo3 } from "react";
|
|
262
|
-
import { useAppGraph as useAppGraph4 } from "@dxos/app-toolkit/ui";
|
|
263
|
-
import { useConnections as useConnections2 } from "@dxos/plugin-graph";
|
|
264
|
-
import { byPosition as byPosition3 } from "@dxos/util";
|
|
265
|
-
|
|
266
|
-
// src/hooks/actions.ts
|
|
267
|
-
import * as Effect2 from "effect/Effect";
|
|
268
|
-
import { getCompanionVariant } from "@dxos/app-toolkit";
|
|
269
|
-
import { Node as Node3 } from "@dxos/plugin-graph";
|
|
270
|
-
import { byPosition as byPosition2 } from "@dxos/util";
|
|
271
|
-
var PLANK_COMPANION_TYPE = "org.dxos.plugin.deck.plank-companion";
|
|
272
|
-
var createCompanionActions = (graph, stateAtom, get, config) => {
|
|
273
|
-
const { idPrefix, selectedVariant, updateState } = config;
|
|
274
|
-
const state = get(stateAtom);
|
|
275
|
-
const activeId = state.active ?? state.workspace;
|
|
276
|
-
const activeConnections = activeId ? get(graph.connections(activeId, "child")) : [];
|
|
277
|
-
const companions = activeConnections.filter((node) => node.type === PLANK_COMPANION_TYPE).toSorted((a, b) => byPosition2(a.properties, b.properties));
|
|
278
|
-
const nodes = [];
|
|
279
|
-
const edges = [];
|
|
280
|
-
companions.forEach((companion) => {
|
|
281
|
-
const companionVariant = getCompanionVariant(companion.id);
|
|
282
|
-
const companionAction = {
|
|
283
|
-
id: `${idPrefix}-companion-${companion.id}`,
|
|
284
|
-
type: Node3.ActionType,
|
|
285
|
-
properties: {
|
|
286
|
-
icon: companion.properties.icon ?? "ph--placeholder--regular",
|
|
287
|
-
label: companion.properties.label,
|
|
288
|
-
iconOnly: true,
|
|
289
|
-
...selectedVariant !== void 0 && {
|
|
290
|
-
variant: selectedVariant === companionVariant ? "primary" : "ghost"
|
|
291
|
-
}
|
|
292
|
-
},
|
|
293
|
-
data: () => Effect2.sync(() => updateState((current) => {
|
|
294
|
-
const closing = current.companionVariant === companionVariant && current.drawerState !== "closed";
|
|
295
|
-
return {
|
|
296
|
-
...current,
|
|
297
|
-
companionVariant: closing ? void 0 : companionVariant,
|
|
298
|
-
drawerState: closing ? "closed" : "open"
|
|
299
|
-
};
|
|
300
|
-
}))
|
|
301
|
-
};
|
|
302
|
-
nodes.push(companionAction);
|
|
303
|
-
edges.push({
|
|
304
|
-
source: "root",
|
|
305
|
-
target: companionAction.id,
|
|
306
|
-
relation: "child"
|
|
307
|
-
});
|
|
308
|
-
});
|
|
309
|
-
return {
|
|
310
|
-
nodes,
|
|
311
|
-
edges
|
|
312
|
-
};
|
|
313
|
-
};
|
|
314
|
-
|
|
315
|
-
// src/hooks/useCompanions.ts
|
|
316
|
-
var useCompanions = (nodeId) => {
|
|
317
|
-
const { graph } = useAppGraph4();
|
|
318
|
-
const nodes = useConnections2(graph, nodeId, "child");
|
|
319
|
-
const companions = nodes.filter((node) => node.type === PLANK_COMPANION_TYPE);
|
|
320
|
-
return useMemo3(() => companions.toSorted((a, b) => byPosition3(a.properties, b.properties)), [
|
|
321
|
-
companions
|
|
322
|
-
]);
|
|
323
|
-
};
|
|
324
|
-
|
|
325
|
-
// src/hooks/useDrawerActions.ts
|
|
326
|
-
import { Atom as Atom2 } from "@effect-atom/atom-react";
|
|
327
|
-
import * as Effect3 from "effect/Effect";
|
|
328
|
-
import { useMemo as useMemo7 } from "react";
|
|
329
|
-
import { useCapability as useCapability3 } from "@dxos/app-framework/ui";
|
|
330
|
-
import { useAppGraph as useAppGraph7 } from "@dxos/app-toolkit/ui";
|
|
331
|
-
import { Node as Node4, useActionRunner as useActionRunner2 } from "@dxos/plugin-graph";
|
|
332
|
-
import { useTranslation as useTranslation6 } from "@dxos/react-ui";
|
|
333
|
-
import { createGapSeparator } from "@dxos/react-ui-menu";
|
|
334
|
-
|
|
335
|
-
// src/components/DebugOverlay/DebugOverlay.tsx
|
|
336
|
-
import { createContext } from "@radix-ui/react-context";
|
|
337
|
-
import React2, { useCallback as useCallback3, useRef as useRef2 } from "react";
|
|
338
|
-
var DEBUG_OVERLAY_NAME = "DebugOverlay";
|
|
339
|
-
var [DebugOverlayProvider, useDebugLog] = createContext(DEBUG_OVERLAY_NAME, {
|
|
340
|
-
dbg: () => {
|
|
341
|
-
}
|
|
342
|
-
});
|
|
343
|
-
var DebugOverlayRoot = ({ children, enabled = true, maxLines = 10 }) => {
|
|
344
|
-
const overlayRef = useRef2(null);
|
|
345
|
-
const dbg = useCallback3((msg) => {
|
|
346
|
-
if (!overlayRef.current) {
|
|
347
|
-
return;
|
|
348
|
-
}
|
|
349
|
-
const line = document.createElement("pre");
|
|
350
|
-
line.textContent = `${(performance.now() / 1e3).toFixed(2).padStart(8, " ")} ${msg}`;
|
|
351
|
-
overlayRef.current.prepend(line);
|
|
352
|
-
while (overlayRef.current.children.length > maxLines) {
|
|
353
|
-
overlayRef.current.lastChild?.remove();
|
|
354
|
-
}
|
|
355
|
-
}, []);
|
|
356
|
-
return /* @__PURE__ */ React2.createElement(DebugOverlayProvider, {
|
|
357
|
-
dbg
|
|
358
|
-
}, children, enabled && /* @__PURE__ */ React2.createElement("div", {
|
|
359
|
-
ref: overlayRef,
|
|
360
|
-
style: {
|
|
361
|
-
position: "fixed",
|
|
362
|
-
bottom: "calc(var(--kb-height, 0px) + 8px)",
|
|
363
|
-
left: 8,
|
|
364
|
-
right: 8,
|
|
365
|
-
background: "rgba(0,0,0,0.8)",
|
|
366
|
-
color: "#0f0",
|
|
367
|
-
fontSize: 10,
|
|
368
|
-
fontFamily: "monospace",
|
|
369
|
-
padding: 6,
|
|
370
|
-
borderRadius: 4,
|
|
371
|
-
zIndex: 9999,
|
|
372
|
-
pointerEvents: "none"
|
|
373
|
-
}
|
|
374
|
-
}));
|
|
375
|
-
};
|
|
376
|
-
var DebugOverlay = {
|
|
377
|
-
Root: DebugOverlayRoot
|
|
378
|
-
};
|
|
379
|
-
|
|
380
195
|
// src/components/Loading/Loading.tsx
|
|
381
196
|
import React3 from "react";
|
|
382
197
|
var Loading = () => {
|
|
383
198
|
return /* @__PURE__ */ React3.createElement("div", {
|
|
384
|
-
role: "none",
|
|
385
199
|
className: "grid place-items-center dx-attention-surface"
|
|
386
200
|
});
|
|
387
201
|
};
|
|
@@ -409,7 +223,6 @@ var MobileLayoutRoot = /* @__PURE__ */ forwardRef(({ classNames, children, trans
|
|
|
409
223
|
keyboardOpen
|
|
410
224
|
}, /* @__PURE__ */ React4.createElement("div", {
|
|
411
225
|
...props,
|
|
412
|
-
role: "none",
|
|
413
226
|
style: {
|
|
414
227
|
height: "calc(100vh - var(--kb-height, 0px))",
|
|
415
228
|
transition: `height ${keyboardOpen ? 0 : transition}ms ease-out`
|
|
@@ -422,7 +235,6 @@ MobileLayoutRoot.displayName = MOBILE_LAYOUT_ROOT_NAME;
|
|
|
422
235
|
var MobileLayoutPanel = /* @__PURE__ */ forwardRef(({ classNames, children, safe, ...props }, forwardedRef) => {
|
|
423
236
|
return /* @__PURE__ */ React4.createElement("div", {
|
|
424
237
|
...props,
|
|
425
|
-
role: "none",
|
|
426
238
|
style: {
|
|
427
239
|
paddingTop: safe?.top ? "env(safe-area-inset-top)" : void 0,
|
|
428
240
|
paddingBottom: safe?.bottom ? `calc((1 - var(--kb-open, 0)) * env(safe-area-inset-bottom))` : void 0
|
|
@@ -558,12 +370,7 @@ var useIOSKeyboard = () => {
|
|
|
558
370
|
keyboardHeight,
|
|
559
371
|
keyboardOpen,
|
|
560
372
|
animationDuration
|
|
561
|
-
}, {
|
|
562
|
-
F: __dxlog_file,
|
|
563
|
-
L: 318,
|
|
564
|
-
S: void 0,
|
|
565
|
-
C: (f, a) => f(...a)
|
|
566
|
-
});
|
|
373
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 211, S: void 0 });
|
|
567
374
|
};
|
|
568
375
|
let rafId;
|
|
569
376
|
return combine(
|
|
@@ -577,12 +384,7 @@ var useIOSKeyboard = () => {
|
|
|
577
384
|
type,
|
|
578
385
|
height: height2,
|
|
579
386
|
duration: duration2
|
|
580
|
-
}, {
|
|
581
|
-
F: __dxlog_file,
|
|
582
|
-
L: 338,
|
|
583
|
-
S: void 0,
|
|
584
|
-
C: (f, a) => f(...a)
|
|
585
|
-
});
|
|
387
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 228, S: void 0 });
|
|
586
388
|
updateState(height2, type === "show", durationMs);
|
|
587
389
|
const end = performance.now() + durationMs + 300;
|
|
588
390
|
let prevOffsetTop = vp?.offsetTop ?? 0;
|
|
@@ -622,10 +424,13 @@ var useIOSKeyboard = () => {
|
|
|
622
424
|
|
|
623
425
|
// src/components/Popover/Popover.tsx
|
|
624
426
|
import { createContext as createContext3 } from "@radix-ui/react-context";
|
|
625
|
-
import React5, { useCallback as
|
|
427
|
+
import React5, { useCallback as useCallback3, useEffect as useEffect4, useMemo as useMemo2, useRef as useRef3, useState as useState2 } from "react";
|
|
626
428
|
import { Surface } from "@dxos/app-framework/ui";
|
|
627
|
-
import {
|
|
429
|
+
import { AppSurface } from "@dxos/app-toolkit/ui";
|
|
430
|
+
import { Popover, toLocalizedString as toLocalizedString2, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
628
431
|
import { Card as Card2 } from "@dxos/react-ui";
|
|
432
|
+
import { useSimpleLayoutState } from "#hooks";
|
|
433
|
+
import { meta as meta2 } from "#meta";
|
|
629
434
|
var DEBOUNCE_DELAY = 40;
|
|
630
435
|
var [LayoutPopoverProvider, useLayoutPopoverContext] = createContext3("LayoutPopover");
|
|
631
436
|
var PopoverRoot = ({ children }) => {
|
|
@@ -663,10 +468,10 @@ var PopoverRoot = ({ children }) => {
|
|
|
663
468
|
}), children));
|
|
664
469
|
};
|
|
665
470
|
var PopoverContent = () => {
|
|
666
|
-
const { t } =
|
|
471
|
+
const { t } = useTranslation2(meta2.id);
|
|
667
472
|
const { state, updateState } = useSimpleLayoutState();
|
|
668
473
|
const { setOpen } = useLayoutPopoverContext("PopoverContent");
|
|
669
|
-
const handleClose =
|
|
474
|
+
const handleClose = useCallback3(() => {
|
|
670
475
|
setOpen(false);
|
|
671
476
|
updateState((s) => ({
|
|
672
477
|
...s,
|
|
@@ -679,7 +484,7 @@ var PopoverContent = () => {
|
|
|
679
484
|
setOpen,
|
|
680
485
|
updateState
|
|
681
486
|
]);
|
|
682
|
-
const handleInteractOutside =
|
|
487
|
+
const handleInteractOutside = useCallback3((event) => {
|
|
683
488
|
if (
|
|
684
489
|
// TODO(thure): CodeMirror should not focus itself when it updates.
|
|
685
490
|
event.type === "dismissableLayer.focusOutside" && event.currentTarget?.classList.contains("cm-content")
|
|
@@ -691,7 +496,7 @@ var PopoverContent = () => {
|
|
|
691
496
|
}, [
|
|
692
497
|
handleClose
|
|
693
498
|
]);
|
|
694
|
-
const collisionBoundaries =
|
|
499
|
+
const collisionBoundaries = useMemo2(() => {
|
|
695
500
|
const closest = state.popoverAnchor?.closest("[data-popover-collision-boundary]");
|
|
696
501
|
return closest ? [
|
|
697
502
|
closest
|
|
@@ -706,40 +511,43 @@ var PopoverContent = () => {
|
|
|
706
511
|
collisionBoundary: collisionBoundaries,
|
|
707
512
|
onInteractOutside: handleInteractOutside,
|
|
708
513
|
onEscapeKeyDown: handleInteractOutside
|
|
709
|
-
}, /* @__PURE__ */ React5.createElement(Popover.Viewport, null, state.popoverKind === "base" && /* @__PURE__ */ React5.createElement(Surface.Surface, {
|
|
710
|
-
|
|
514
|
+
}, /* @__PURE__ */ React5.createElement(Popover.Viewport, null, state.popoverKind === "base" && state.popoverContent && "component" in state.popoverContent && /* @__PURE__ */ React5.createElement(Surface.Surface, {
|
|
515
|
+
type: AppSurface.Popover,
|
|
711
516
|
data: state.popoverContent,
|
|
712
517
|
limit: 1
|
|
713
518
|
}), state.popoverKind === "card" && /* @__PURE__ */ React5.createElement(Card2.Root, {
|
|
714
519
|
border: false,
|
|
715
520
|
classNames: "dx-card-popover"
|
|
716
|
-
}, /* @__PURE__ */ React5.createElement(Card2.Toolbar, null, /* @__PURE__ */ React5.createElement("span", null), state.popoverTitle ? /* @__PURE__ */ React5.createElement(Card2.Title, null,
|
|
521
|
+
}, /* @__PURE__ */ React5.createElement(Card2.Toolbar, null, /* @__PURE__ */ React5.createElement("span", null), state.popoverTitle ? /* @__PURE__ */ React5.createElement(Card2.Title, null, toLocalizedString2(state.popoverTitle, t)) : /* @__PURE__ */ React5.createElement("span", null), /* @__PURE__ */ React5.createElement(Card2.CloseIconButton, {
|
|
717
522
|
onClick: handleClose
|
|
718
|
-
})), /* @__PURE__ */ React5.createElement(Surface.Surface, {
|
|
719
|
-
|
|
523
|
+
})), state.popoverContent && "subject" in state.popoverContent && /* @__PURE__ */ React5.createElement(Surface.Surface, {
|
|
524
|
+
type: AppSurface.Card,
|
|
720
525
|
data: state.popoverContent,
|
|
721
526
|
limit: 1
|
|
722
527
|
}))), /* @__PURE__ */ React5.createElement(Popover.Arrow, null)));
|
|
723
528
|
};
|
|
724
529
|
|
|
725
530
|
// src/components/SimpleLayout/AppBar.tsx
|
|
726
|
-
import { useAtomValue
|
|
531
|
+
import { useAtomValue } from "@effect-atom/atom-react";
|
|
727
532
|
import React6, { Fragment } from "react";
|
|
728
|
-
import { IconButton, Popover as Popover2, Toolbar, useTranslation as
|
|
533
|
+
import { DensityProvider, IconButton, Popover as Popover2, Toolbar, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
729
534
|
import { Menu, useMenuActions } from "@dxos/react-ui-menu";
|
|
730
535
|
import { composable, composableProps, osTranslations } from "@dxos/ui-theme";
|
|
536
|
+
import { meta as meta3 } from "#meta";
|
|
731
537
|
var APP_BAR_NAME = "SimpleLayout.AppBar";
|
|
732
538
|
var AppBar = composable(({ classNames, title, actions, showBackButton, popoverAnchorId, onAction, onBack, ...props }, forwardedRef) => {
|
|
733
|
-
const { t } =
|
|
539
|
+
const { t } = useTranslation3(meta3.id);
|
|
734
540
|
const menuActions = useMenuActions(actions);
|
|
735
|
-
const actionsValue =
|
|
541
|
+
const actionsValue = useAtomValue(actions);
|
|
736
542
|
const hasActions = actionsValue.nodes.length > 0;
|
|
737
543
|
const { keyboardOpen } = useMobileLayout(APP_BAR_NAME);
|
|
738
|
-
const displayTitle = title ?? t("current
|
|
544
|
+
const displayTitle = title ?? t("current-app.name", {
|
|
739
545
|
ns: osTranslations
|
|
740
546
|
});
|
|
741
547
|
const AnchorRoot = popoverAnchorId ? Popover2.Anchor : Fragment;
|
|
742
|
-
return /* @__PURE__ */ React6.createElement(
|
|
548
|
+
return /* @__PURE__ */ React6.createElement(DensityProvider, {
|
|
549
|
+
density: "fine"
|
|
550
|
+
}, /* @__PURE__ */ React6.createElement(Toolbar.Root, {
|
|
743
551
|
...composableProps(props, {
|
|
744
552
|
role: "banner",
|
|
745
553
|
classNames: "grid grid-cols-[var(--dx-rail-size)_1fr_var(--dx-rail-size)] items-center dx-density-fine"
|
|
@@ -749,18 +557,18 @@ var AppBar = composable(({ classNames, title, actions, showBackButton, popoverAn
|
|
|
749
557
|
variant: "ghost",
|
|
750
558
|
icon: "ph--x--regular",
|
|
751
559
|
iconOnly: true,
|
|
752
|
-
label: t("done
|
|
560
|
+
label: t("done.label")
|
|
753
561
|
}) : showBackButton ? /* @__PURE__ */ React6.createElement(IconButton, {
|
|
754
562
|
variant: "ghost",
|
|
755
563
|
icon: "ph--caret-left--regular",
|
|
756
564
|
iconOnly: true,
|
|
757
|
-
label: t("back
|
|
565
|
+
label: t("back.label"),
|
|
758
566
|
onClick: onBack
|
|
759
567
|
}) : /* @__PURE__ */ React6.createElement("div", null), /* @__PURE__ */ React6.createElement("h1", {
|
|
760
568
|
className: "text-center truncate font-thin uppercase"
|
|
761
569
|
}, displayTitle), hasActions ? /* @__PURE__ */ React6.createElement(AnchorRoot, null, /* @__PURE__ */ React6.createElement(Menu.Root, {
|
|
762
570
|
...menuActions,
|
|
763
|
-
caller:
|
|
571
|
+
caller: meta3.id,
|
|
764
572
|
onAction
|
|
765
573
|
}, /* @__PURE__ */ React6.createElement(Menu.Trigger, {
|
|
766
574
|
asChild: true
|
|
@@ -768,18 +576,19 @@ var AppBar = composable(({ classNames, title, actions, showBackButton, popoverAn
|
|
|
768
576
|
variant: "ghost",
|
|
769
577
|
icon: "ph--dots-three-vertical--regular",
|
|
770
578
|
iconOnly: true,
|
|
771
|
-
label: t("actions
|
|
772
|
-
})), /* @__PURE__ */ React6.createElement(Menu.Content, null))) : /* @__PURE__ */ React6.createElement("span", null));
|
|
579
|
+
label: t("actions-menu.label")
|
|
580
|
+
})), /* @__PURE__ */ React6.createElement(Menu.Content, null))) : /* @__PURE__ */ React6.createElement("span", null)));
|
|
773
581
|
});
|
|
774
582
|
AppBar.displayName = APP_BAR_NAME;
|
|
775
583
|
|
|
776
584
|
// src/components/SimpleLayout/Main.tsx
|
|
777
|
-
import React8, { useMemo as
|
|
585
|
+
import React8, { useMemo as useMemo3 } from "react";
|
|
778
586
|
import { Surface as Surface2 } from "@dxos/app-framework/ui";
|
|
779
|
-
import { useAppGraph as
|
|
780
|
-
import { useNode
|
|
587
|
+
import { AppSurface as AppSurface2, useAppGraph as useAppGraph3 } from "@dxos/app-toolkit/ui";
|
|
588
|
+
import { useNode } from "@dxos/plugin-graph";
|
|
781
589
|
import { ErrorFallback, Panel } from "@dxos/react-ui";
|
|
782
590
|
import { useAttentionAttributes } from "@dxos/react-ui-attention";
|
|
591
|
+
import { useAppBarProps, useNavbarActions, useSimpleLayoutState as useSimpleLayoutState2 } from "#hooks";
|
|
783
592
|
|
|
784
593
|
// src/components/SimpleLayout/NavBar.tsx
|
|
785
594
|
import React7 from "react";
|
|
@@ -802,16 +611,16 @@ NavBar.displayName = NAVBAR_NAME;
|
|
|
802
611
|
// src/components/SimpleLayout/Main.tsx
|
|
803
612
|
var MAIN_NAME = "SimpleLayout.Main";
|
|
804
613
|
var Main = () => {
|
|
805
|
-
const { state } =
|
|
614
|
+
const { state } = useSimpleLayoutState2();
|
|
806
615
|
const id = state.active ?? state.workspace;
|
|
807
616
|
const attentionAttrs = useAttentionAttributes(id);
|
|
808
617
|
const { keyboardOpen } = useMobileLayout(MAIN_NAME);
|
|
809
618
|
const { actions, onAction } = useNavbarActions();
|
|
810
619
|
const appBarProps = useAppBarProps();
|
|
811
|
-
const placeholder =
|
|
812
|
-
const { graph } =
|
|
813
|
-
const node =
|
|
814
|
-
const data =
|
|
620
|
+
const placeholder = useMemo3(() => /* @__PURE__ */ React8.createElement(Loading, null), []);
|
|
621
|
+
const { graph } = useAppGraph3();
|
|
622
|
+
const node = useNode(graph, id);
|
|
623
|
+
const data = useMemo3(() => {
|
|
815
624
|
return node && {
|
|
816
625
|
attendableId: id,
|
|
817
626
|
subject: node.data,
|
|
@@ -837,7 +646,7 @@ var Main = () => {
|
|
|
837
646
|
className: "bg-base-surface"
|
|
838
647
|
}, /* @__PURE__ */ React8.createElement(Surface2.Surface, {
|
|
839
648
|
key: id,
|
|
840
|
-
|
|
649
|
+
type: AppSurface2.Article,
|
|
841
650
|
data,
|
|
842
651
|
limit: 1,
|
|
843
652
|
fallback: ErrorFallback,
|
|
@@ -851,314 +660,71 @@ var Main = () => {
|
|
|
851
660
|
};
|
|
852
661
|
Main.displayName = MAIN_NAME;
|
|
853
662
|
|
|
854
|
-
// src/components/
|
|
855
|
-
import
|
|
856
|
-
import {
|
|
857
|
-
import { LayoutOperation as LayoutOperation3 } from "@dxos/app-toolkit";
|
|
858
|
-
import { useAppGraph as useAppGraph6 } from "@dxos/app-toolkit/ui";
|
|
859
|
-
import { useConnections as useConnections3 } from "@dxos/plugin-graph";
|
|
860
|
-
import { Avatar as Avatar2, Icon as Icon2, ScrollArea as ScrollArea2, toLocalizedString as toLocalizedString4, useTranslation as useTranslation5 } from "@dxos/react-ui";
|
|
861
|
-
import { Card as Card3 } from "@dxos/react-ui";
|
|
663
|
+
// src/components/SimpleLayout/SimpleLayout.tsx
|
|
664
|
+
import React11, { useLayoutEffect as useLayoutEffect2, useRef as useRef4, useState as useState3 } from "react";
|
|
665
|
+
import { Splitter } from "@dxos/react-ui";
|
|
862
666
|
import { Mosaic as Mosaic2 } from "@dxos/react-ui-mosaic";
|
|
863
|
-
import {
|
|
864
|
-
import { mx as mx3 } from "@dxos/ui-theme";
|
|
865
|
-
var NavBranch = ({ id }) => {
|
|
866
|
-
const { t } = useTranslation5(meta.id);
|
|
867
|
-
const { graph } = useAppGraph6();
|
|
868
|
-
useExpandPath(id);
|
|
869
|
-
const children = useConnections3(graph, id, "child");
|
|
870
|
-
const visibleChildren = useMemo6(() => children.filter((node) => node.properties.disposition !== "alternate-tree" && node.properties.disposition !== "hidden"), [
|
|
871
|
-
children
|
|
872
|
-
]);
|
|
873
|
-
const { results, handleSearch } = useSearchListResults2({
|
|
874
|
-
items: visibleChildren,
|
|
875
|
-
extract: (child) => toLocalizedString4(child.properties.label, t)
|
|
876
|
-
});
|
|
877
|
-
return /* @__PURE__ */ React9.createElement(SearchPanel2, {
|
|
878
|
-
onSearch: handleSearch
|
|
879
|
-
}, /* @__PURE__ */ React9.createElement(Mosaic2.Container, {
|
|
880
|
-
asChild: true
|
|
881
|
-
}, /* @__PURE__ */ React9.createElement(ScrollArea2.Root, {
|
|
882
|
-
centered: true,
|
|
883
|
-
padding: true,
|
|
884
|
-
thin: true
|
|
885
|
-
}, /* @__PURE__ */ React9.createElement(ScrollArea2.Viewport, null, /* @__PURE__ */ React9.createElement(Mosaic2.Stack, {
|
|
886
|
-
classNames: "gap-1",
|
|
887
|
-
draggable: false,
|
|
888
|
-
items: results,
|
|
889
|
-
getId: (item) => item.id,
|
|
890
|
-
Tile: NavBranchTile
|
|
891
|
-
})))));
|
|
892
|
-
};
|
|
893
|
-
var NavBranchTile = (props) => {
|
|
894
|
-
const data = props.data;
|
|
895
|
-
const { t } = useTranslation5(meta.id);
|
|
896
|
-
const { invokePromise } = useOperationInvoker3();
|
|
897
|
-
const ref = useRef4(null);
|
|
898
|
-
const { selectedValue, registerItem, unregisterItem } = useSearchListItem2();
|
|
899
|
-
const isSelected = selectedValue === data.id;
|
|
900
|
-
const name = toLocalizedString4(data.properties.label, t);
|
|
901
|
-
const handleSelect = useCallback5(() => void invokePromise(LayoutOperation3.Open, {
|
|
902
|
-
subject: [
|
|
903
|
-
data.id
|
|
904
|
-
]
|
|
905
|
-
}), [
|
|
906
|
-
invokePromise,
|
|
907
|
-
data.id
|
|
908
|
-
]);
|
|
909
|
-
useEffect5(() => {
|
|
910
|
-
if (ref.current) {
|
|
911
|
-
registerItem(data.id, ref.current, handleSelect);
|
|
912
|
-
}
|
|
913
|
-
return () => unregisterItem(data.id);
|
|
914
|
-
}, [
|
|
915
|
-
data.id,
|
|
916
|
-
handleSelect,
|
|
917
|
-
registerItem,
|
|
918
|
-
unregisterItem
|
|
919
|
-
]);
|
|
920
|
-
useEffect5(() => {
|
|
921
|
-
if (isSelected && ref.current) {
|
|
922
|
-
ref.current.scrollIntoView({
|
|
923
|
-
block: "nearest",
|
|
924
|
-
behavior: "smooth"
|
|
925
|
-
});
|
|
926
|
-
}
|
|
927
|
-
}, [
|
|
928
|
-
isSelected
|
|
929
|
-
]);
|
|
930
|
-
return /* @__PURE__ */ React9.createElement(Card3.Root, {
|
|
931
|
-
ref,
|
|
932
|
-
role: "button",
|
|
933
|
-
fullWidth: true,
|
|
934
|
-
tabIndex: -1,
|
|
935
|
-
"data-selected": isSelected,
|
|
936
|
-
classNames: mx3("dx-focus-ring cursor-pointer", isSelected && "bg-hover-overlay"),
|
|
937
|
-
onClick: handleSelect
|
|
938
|
-
}, /* @__PURE__ */ React9.createElement(Card3.Toolbar, null, /* @__PURE__ */ React9.createElement(Avatar2.Root, null, /* @__PURE__ */ React9.createElement(Avatar2.Content, {
|
|
939
|
-
hue: data.properties.hue,
|
|
940
|
-
icon: data.properties.icon,
|
|
941
|
-
hueVariant: "transparent",
|
|
942
|
-
variant: "square",
|
|
943
|
-
size: 8,
|
|
944
|
-
fallback: name
|
|
945
|
-
}), /* @__PURE__ */ React9.createElement(Avatar2.Label, null, name), /* @__PURE__ */ React9.createElement(Icon2, {
|
|
946
|
-
icon: "ph--caret-right--regular"
|
|
947
|
-
}))));
|
|
948
|
-
};
|
|
949
|
-
|
|
950
|
-
// src/hooks/useSimpleLayoutState.ts
|
|
951
|
-
import { RegistryContext, useAtomValue as useAtomValue3 } from "@effect-atom/atom-react";
|
|
952
|
-
import { useCallback as useCallback6, useContext } from "react";
|
|
953
|
-
import { useCapability as useCapability2 } from "@dxos/app-framework/ui";
|
|
954
|
-
var useSimpleLayoutState = () => {
|
|
955
|
-
const registry = useContext(RegistryContext);
|
|
956
|
-
const stateAtom = useCapability2(SimpleLayoutState);
|
|
957
|
-
const state = useAtomValue3(stateAtom);
|
|
958
|
-
const updateState = useCallback6((fn) => {
|
|
959
|
-
registry.set(stateAtom, fn(registry.get(stateAtom)));
|
|
960
|
-
}, [
|
|
961
|
-
registry,
|
|
962
|
-
stateAtom
|
|
963
|
-
]);
|
|
964
|
-
return {
|
|
965
|
-
state,
|
|
966
|
-
updateState
|
|
967
|
-
};
|
|
968
|
-
};
|
|
969
|
-
|
|
970
|
-
// src/hooks/useDrawerActions.ts
|
|
971
|
-
var useDrawerActions = (consumerName) => {
|
|
972
|
-
const { t } = useTranslation6(meta.id);
|
|
973
|
-
const stateAtom = useCapability3(SimpleLayoutState);
|
|
974
|
-
const { graph } = useAppGraph7();
|
|
975
|
-
const runAction = useActionRunner2();
|
|
976
|
-
const { updateState } = useSimpleLayoutState();
|
|
977
|
-
const { keyboardOpen } = useMobileLayout(consumerName);
|
|
978
|
-
const actionsAtom = useMemo7(() => Atom2.make((get) => {
|
|
979
|
-
const state = get(stateAtom);
|
|
980
|
-
const { nodes, edges } = createCompanionActions(graph, stateAtom, get, {
|
|
981
|
-
idPrefix: "drawer",
|
|
982
|
-
selectedVariant: state.drawerState !== "closed" ? state.companionVariant : void 0,
|
|
983
|
-
updateState
|
|
984
|
-
});
|
|
985
|
-
const gapSeparator = createGapSeparator("drawer-gap");
|
|
986
|
-
nodes.push(...gapSeparator.nodes);
|
|
987
|
-
edges.push(...gapSeparator.edges);
|
|
988
|
-
if (!keyboardOpen) {
|
|
989
|
-
const isExpanded = state.drawerState === "expanded";
|
|
990
|
-
const toggleExpandAction = {
|
|
991
|
-
id: "drawer-toggle-expand",
|
|
992
|
-
type: Node4.ActionType,
|
|
993
|
-
properties: {
|
|
994
|
-
icon: isExpanded ? "ph--arrow-down--regular" : "ph--arrow-up--regular",
|
|
995
|
-
label: isExpanded ? t("collapse drawer label") : t("expand drawer label"),
|
|
996
|
-
iconOnly: true
|
|
997
|
-
},
|
|
998
|
-
data: () => Effect3.sync(() => updateState((state2) => ({
|
|
999
|
-
...state2,
|
|
1000
|
-
drawerState: isExpanded ? "open" : "expanded"
|
|
1001
|
-
})))
|
|
1002
|
-
};
|
|
1003
|
-
nodes.push(toggleExpandAction);
|
|
1004
|
-
edges.push({
|
|
1005
|
-
source: "root",
|
|
1006
|
-
target: toggleExpandAction.id,
|
|
1007
|
-
relation: "child"
|
|
1008
|
-
});
|
|
1009
|
-
}
|
|
1010
|
-
const closeAction = {
|
|
1011
|
-
id: "drawer-close",
|
|
1012
|
-
type: Node4.ActionType,
|
|
1013
|
-
properties: {
|
|
1014
|
-
icon: "ph--x--regular",
|
|
1015
|
-
label: t("close drawer label"),
|
|
1016
|
-
iconOnly: true
|
|
1017
|
-
},
|
|
1018
|
-
data: () => Effect3.sync(() => updateState((state2) => ({
|
|
1019
|
-
...state2,
|
|
1020
|
-
drawerState: "closed",
|
|
1021
|
-
companionVariant: void 0
|
|
1022
|
-
})))
|
|
1023
|
-
};
|
|
1024
|
-
nodes.push(closeAction);
|
|
1025
|
-
edges.push({
|
|
1026
|
-
source: "root",
|
|
1027
|
-
target: closeAction.id,
|
|
1028
|
-
relation: "child"
|
|
1029
|
-
});
|
|
1030
|
-
return {
|
|
1031
|
-
nodes,
|
|
1032
|
-
edges
|
|
1033
|
-
};
|
|
1034
|
-
}), [
|
|
1035
|
-
graph,
|
|
1036
|
-
stateAtom,
|
|
1037
|
-
updateState,
|
|
1038
|
-
keyboardOpen,
|
|
1039
|
-
t
|
|
1040
|
-
]);
|
|
1041
|
-
return {
|
|
1042
|
-
actions: actionsAtom,
|
|
1043
|
-
onAction: runAction
|
|
1044
|
-
};
|
|
1045
|
-
};
|
|
1046
|
-
|
|
1047
|
-
// src/hooks/useNavbarActions.ts
|
|
1048
|
-
import { Atom as Atom3 } from "@effect-atom/atom-react";
|
|
1049
|
-
import { useMemo as useMemo8 } from "react";
|
|
1050
|
-
import { useCapability as useCapability4 } from "@dxos/app-framework/ui";
|
|
1051
|
-
import { useAppGraph as useAppGraph8 } from "@dxos/app-toolkit/ui";
|
|
1052
|
-
import { Node as Node5, useActionRunner as useActionRunner3 } from "@dxos/plugin-graph";
|
|
1053
|
-
import { useTranslation as useTranslation7 } from "@dxos/react-ui";
|
|
1054
|
-
import { createGapSeparator as createGapSeparator2, createMenuItemGroup } from "@dxos/react-ui-menu";
|
|
1055
|
-
var MAIN_MENU_GROUP_ID = "navbar-main-menu";
|
|
1056
|
-
var useNavbarActions = () => {
|
|
1057
|
-
const { t } = useTranslation7(meta.id);
|
|
1058
|
-
const { graph } = useAppGraph8();
|
|
1059
|
-
const runAction = useActionRunner3();
|
|
1060
|
-
const stateAtom = useCapability4(SimpleLayoutState);
|
|
1061
|
-
const { updateState } = useSimpleLayoutState();
|
|
1062
|
-
const actionsAtom = useMemo8(() => Atom3.make((get) => {
|
|
1063
|
-
const { nodes, edges } = createCompanionActions(graph, stateAtom, get, {
|
|
1064
|
-
idPrefix: "navbar",
|
|
1065
|
-
updateState
|
|
1066
|
-
});
|
|
1067
|
-
const gapSeparator = createGapSeparator2("navbar-gap");
|
|
1068
|
-
nodes.push(...gapSeparator.nodes);
|
|
1069
|
-
edges.push(...gapSeparator.edges);
|
|
1070
|
-
const mainMenuGroup = createMenuItemGroup(MAIN_MENU_GROUP_ID, {
|
|
1071
|
-
variant: "dropdownMenu",
|
|
1072
|
-
icon: "ph--list--regular",
|
|
1073
|
-
iconOnly: true,
|
|
1074
|
-
label: t("main menu label"),
|
|
1075
|
-
testId: "simpleLayoutPlugin.addSpace"
|
|
1076
|
-
});
|
|
1077
|
-
nodes.push(mainMenuGroup);
|
|
1078
|
-
edges.push({
|
|
1079
|
-
source: "root",
|
|
1080
|
-
target: mainMenuGroup.id,
|
|
1081
|
-
relation: "child"
|
|
1082
|
-
});
|
|
1083
|
-
const rootActions = get(graph.actions(Node5.RootId));
|
|
1084
|
-
const menuActions = rootActions.filter((node) => node.properties.disposition === "menu");
|
|
1085
|
-
menuActions.forEach((menuAction) => {
|
|
1086
|
-
nodes.push(menuAction);
|
|
1087
|
-
edges.push({
|
|
1088
|
-
source: MAIN_MENU_GROUP_ID,
|
|
1089
|
-
target: menuAction.id,
|
|
1090
|
-
relation: "child"
|
|
1091
|
-
});
|
|
1092
|
-
});
|
|
1093
|
-
return {
|
|
1094
|
-
nodes,
|
|
1095
|
-
edges
|
|
1096
|
-
};
|
|
1097
|
-
}), [
|
|
1098
|
-
graph,
|
|
1099
|
-
stateAtom,
|
|
1100
|
-
updateState,
|
|
1101
|
-
t
|
|
1102
|
-
]);
|
|
1103
|
-
return {
|
|
1104
|
-
actions: actionsAtom,
|
|
1105
|
-
onAction: runAction
|
|
1106
|
-
};
|
|
1107
|
-
};
|
|
667
|
+
import { useSimpleLayoutState as useSimpleLayoutState5 } from "#hooks";
|
|
1108
668
|
|
|
1109
669
|
// src/components/Dialog/Dialog.tsx
|
|
1110
|
-
import
|
|
670
|
+
import React9 from "react";
|
|
1111
671
|
import { Surface as Surface3 } from "@dxos/app-framework/ui";
|
|
672
|
+
import { AppSurface as AppSurface3 } from "@dxos/app-toolkit/ui";
|
|
1112
673
|
import { AlertDialog, Dialog as NaturalDialog } from "@dxos/react-ui";
|
|
1113
674
|
import { ErrorFallback as ErrorFallback2 } from "@dxos/react-ui";
|
|
675
|
+
import { useSimpleLayoutState as useSimpleLayoutState3 } from "#hooks";
|
|
1114
676
|
var Dialog = () => {
|
|
1115
|
-
const { state, updateState } =
|
|
677
|
+
const { state, updateState } = useSimpleLayoutState3();
|
|
1116
678
|
const DialogRoot = state.dialogType === "alert" ? AlertDialog.Root : NaturalDialog.Root;
|
|
1117
679
|
const DialogOverlay = state.dialogType === "alert" ? AlertDialog.Overlay : NaturalDialog.Overlay;
|
|
1118
|
-
return /* @__PURE__ */
|
|
680
|
+
return /* @__PURE__ */ React9.createElement(DialogRoot, {
|
|
1119
681
|
modal: state.dialogBlockAlign !== "end",
|
|
1120
682
|
open: state.dialogOpen,
|
|
1121
683
|
onOpenChange: (nextOpen) => updateState((state2) => ({
|
|
1122
684
|
...state2,
|
|
1123
685
|
dialogOpen: nextOpen
|
|
1124
686
|
}))
|
|
1125
|
-
}, state.dialogBlockAlign === "end" ? /* @__PURE__ */
|
|
1126
|
-
|
|
1127
|
-
data: state.dialogContent,
|
|
687
|
+
}, state.dialogBlockAlign === "end" ? /* @__PURE__ */ React9.createElement(Surface3.Surface, {
|
|
688
|
+
type: AppSurface3.Dialog,
|
|
689
|
+
data: state.dialogContent ?? void 0,
|
|
1128
690
|
limit: 1,
|
|
1129
691
|
fallback: ErrorFallback2
|
|
1130
|
-
}) : /* @__PURE__ */
|
|
692
|
+
}) : /* @__PURE__ */ React9.createElement(DialogOverlay, {
|
|
1131
693
|
blockAlign: state.dialogBlockAlign,
|
|
1132
694
|
classNames: state.dialogOverlayClasses,
|
|
1133
695
|
style: state.dialogOverlayStyle
|
|
1134
|
-
}, /* @__PURE__ */
|
|
1135
|
-
|
|
1136
|
-
data: state.dialogContent,
|
|
696
|
+
}, /* @__PURE__ */ React9.createElement(Surface3.Surface, {
|
|
697
|
+
type: AppSurface3.Dialog,
|
|
698
|
+
data: state.dialogContent ?? void 0,
|
|
1137
699
|
limit: 1,
|
|
1138
700
|
fallback: ErrorFallback2
|
|
1139
701
|
})));
|
|
1140
702
|
};
|
|
1141
703
|
|
|
1142
704
|
// src/components/SimpleLayout/Drawer.tsx
|
|
1143
|
-
import
|
|
705
|
+
import React10, { useMemo as useMemo4 } from "react";
|
|
1144
706
|
import { Surface as Surface4 } from "@dxos/app-framework/ui";
|
|
1145
|
-
import {
|
|
1146
|
-
import {
|
|
1147
|
-
import { useNode as useNode3 } from "@dxos/plugin-graph";
|
|
707
|
+
import { AppSurface as AppSurface4, useAppGraph as useAppGraph4 } from "@dxos/app-toolkit/ui";
|
|
708
|
+
import { useNode as useNode2 } from "@dxos/plugin-graph";
|
|
1148
709
|
import { ErrorFallback as ErrorFallback3, Panel as Panel2 } from "@dxos/react-ui";
|
|
710
|
+
import { getLinkedVariant } from "@dxos/react-ui-attention";
|
|
1149
711
|
import { Menu as Menu3, useMenuActions as useMenuActions3 } from "@dxos/react-ui-menu";
|
|
712
|
+
import { useCompanions, useDrawerActions, useSimpleLayoutState as useSimpleLayoutState4 } from "#hooks";
|
|
1150
713
|
var DRAWER_NAME = "SimpleLayout.Drawer";
|
|
1151
714
|
var Drawer = () => {
|
|
1152
|
-
const { graph } =
|
|
1153
|
-
const { state: layoutState } =
|
|
1154
|
-
const placeholder =
|
|
715
|
+
const { graph } = useAppGraph4();
|
|
716
|
+
const { state: layoutState } = useSimpleLayoutState4();
|
|
717
|
+
const placeholder = useMemo4(() => /* @__PURE__ */ React10.createElement(Loading, null), []);
|
|
1155
718
|
const activeId = layoutState.active ?? layoutState.workspace;
|
|
1156
719
|
const companions = useCompanions(activeId);
|
|
1157
720
|
const { companionId, variant } = useSelectedCompanion(companions, layoutState.companionVariant);
|
|
1158
|
-
const node =
|
|
1159
|
-
const parentNode =
|
|
1160
|
-
const data =
|
|
1161
|
-
|
|
721
|
+
const node = useNode2(graph, companionId);
|
|
722
|
+
const parentNode = useNode2(graph, activeId);
|
|
723
|
+
const data = useMemo4(() => {
|
|
724
|
+
if (!node || !companionId) {
|
|
725
|
+
return void 0;
|
|
726
|
+
}
|
|
727
|
+
return {
|
|
1162
728
|
attendableId: companionId,
|
|
1163
729
|
subject: node.data,
|
|
1164
730
|
companionTo: parentNode?.data,
|
|
@@ -1173,12 +739,12 @@ var Drawer = () => {
|
|
|
1173
739
|
]);
|
|
1174
740
|
const { actions, onAction } = useDrawerActions(DRAWER_NAME);
|
|
1175
741
|
const menuActions = useMenuActions3(actions);
|
|
1176
|
-
return /* @__PURE__ */
|
|
742
|
+
return /* @__PURE__ */ React10.createElement(Panel2.Root, null, /* @__PURE__ */ React10.createElement(Panel2.Toolbar, null, /* @__PURE__ */ React10.createElement(Menu3.Root, {
|
|
1177
743
|
...menuActions,
|
|
1178
744
|
alwaysActive: true,
|
|
1179
745
|
onAction
|
|
1180
|
-
}, /* @__PURE__ */
|
|
1181
|
-
|
|
746
|
+
}, /* @__PURE__ */ React10.createElement(Menu3.Toolbar, null))), /* @__PURE__ */ React10.createElement(Panel2.Content, null, /* @__PURE__ */ React10.createElement(Surface4.Surface, {
|
|
747
|
+
type: AppSurface4.Article,
|
|
1182
748
|
data,
|
|
1183
749
|
limit: 1,
|
|
1184
750
|
fallback: ErrorFallback3,
|
|
@@ -1187,12 +753,12 @@ var Drawer = () => {
|
|
|
1187
753
|
};
|
|
1188
754
|
Drawer.displayName = DRAWER_NAME;
|
|
1189
755
|
var useSelectedCompanion = (companions, preferredVariant) => {
|
|
1190
|
-
const selectedCompanion =
|
|
756
|
+
const selectedCompanion = useMemo4(() => {
|
|
1191
757
|
if (companions.length === 0) {
|
|
1192
758
|
return void 0;
|
|
1193
759
|
}
|
|
1194
760
|
if (preferredVariant) {
|
|
1195
|
-
const preferred = companions.find((c) =>
|
|
761
|
+
const preferred = companions.find((c) => getLinkedVariant(c.id) === preferredVariant);
|
|
1196
762
|
if (preferred) {
|
|
1197
763
|
return preferred;
|
|
1198
764
|
}
|
|
@@ -1203,7 +769,7 @@ var useSelectedCompanion = (companions, preferredVariant) => {
|
|
|
1203
769
|
preferredVariant
|
|
1204
770
|
]);
|
|
1205
771
|
const companionId = selectedCompanion?.id;
|
|
1206
|
-
const variant = companionId ?
|
|
772
|
+
const variant = companionId ? getLinkedVariant(companionId) : void 0;
|
|
1207
773
|
return {
|
|
1208
774
|
selectedCompanion,
|
|
1209
775
|
companionId,
|
|
@@ -1213,44 +779,148 @@ var useSelectedCompanion = (companions, preferredVariant) => {
|
|
|
1213
779
|
|
|
1214
780
|
// src/components/SimpleLayout/SimpleLayout.tsx
|
|
1215
781
|
var SimpleLayout = () => {
|
|
1216
|
-
const { state } =
|
|
782
|
+
const { state } = useSimpleLayoutState5();
|
|
1217
783
|
const [keyboardOpen, setKeyboardOpen] = useState3(false);
|
|
1218
|
-
const [splitterMode, setSplitterMode] = useState3("
|
|
1219
|
-
const drawerRef =
|
|
784
|
+
const [splitterMode, setSplitterMode] = useState3("top");
|
|
785
|
+
const drawerRef = useRef4(null);
|
|
1220
786
|
useLayoutEffect2(() => {
|
|
1221
787
|
if (!keyboardOpen) {
|
|
1222
|
-
setSplitterMode(state.drawerState === "closed" ? "
|
|
788
|
+
setSplitterMode(state.drawerState === "closed" ? "top" : state.drawerState === "open" ? "split" : "bottom");
|
|
1223
789
|
}
|
|
1224
790
|
}, [
|
|
1225
791
|
state.drawerState,
|
|
1226
792
|
keyboardOpen
|
|
1227
793
|
]);
|
|
1228
|
-
return /* @__PURE__ */
|
|
794
|
+
return /* @__PURE__ */ React11.createElement(DebugOverlay.Root, {
|
|
1229
795
|
enabled: false
|
|
1230
|
-
}, /* @__PURE__ */
|
|
1231
|
-
classNames: "dx-container grid relative"
|
|
1232
|
-
}, /* @__PURE__ */ React12.createElement(MobileLayout.Root, {
|
|
1233
|
-
classNames: "bg-toolbar-surface",
|
|
796
|
+
}, /* @__PURE__ */ React11.createElement(PopoverRoot, null, /* @__PURE__ */ React11.createElement(Mosaic2.Root, null, /* @__PURE__ */ React11.createElement(MobileLayout.Root, {
|
|
797
|
+
classNames: "dx-container grid relative bg-toolbar-surface",
|
|
1234
798
|
onKeyboardOpenChange: (nextKeyboardOpen) => setKeyboardOpen(nextKeyboardOpen)
|
|
1235
|
-
}, /* @__PURE__ */
|
|
799
|
+
}, /* @__PURE__ */ React11.createElement(MobileLayout.Panel, {
|
|
1236
800
|
safe: {
|
|
1237
801
|
top: true,
|
|
1238
|
-
bottom: splitterMode === "
|
|
802
|
+
bottom: splitterMode === "top"
|
|
1239
803
|
}
|
|
1240
|
-
}, /* @__PURE__ */
|
|
804
|
+
}, /* @__PURE__ */ React11.createElement(Splitter.Root, {
|
|
1241
805
|
mode: splitterMode,
|
|
1242
806
|
ratio: 0.55
|
|
1243
|
-
}, /* @__PURE__ */
|
|
1244
|
-
position: "
|
|
1245
|
-
}, /* @__PURE__ */
|
|
1246
|
-
position: "
|
|
807
|
+
}, /* @__PURE__ */ React11.createElement(Splitter.Panel, {
|
|
808
|
+
position: "top"
|
|
809
|
+
}, /* @__PURE__ */ React11.createElement(Main, null)), /* @__PURE__ */ React11.createElement(Splitter.Panel, {
|
|
810
|
+
position: "bottom",
|
|
1247
811
|
ref: drawerRef
|
|
1248
|
-
}, /* @__PURE__ */
|
|
812
|
+
}, /* @__PURE__ */ React11.createElement(Drawer, null))), /* @__PURE__ */ React11.createElement(Dialog, null), /* @__PURE__ */ React11.createElement(PopoverContent, null))))));
|
|
1249
813
|
};
|
|
1250
814
|
|
|
815
|
+
// src/components/NavBranch/NavBranch.tsx
|
|
816
|
+
import React12, { useCallback as useCallback4, useEffect as useEffect5, useMemo as useMemo5, useRef as useRef5 } from "react";
|
|
817
|
+
import { useOperationInvoker as useOperationInvoker2 } from "@dxos/app-framework/ui";
|
|
818
|
+
import { LayoutOperation as LayoutOperation2 } from "@dxos/app-toolkit";
|
|
819
|
+
import { useAppGraph as useAppGraph5 } from "@dxos/app-toolkit/ui";
|
|
820
|
+
import { useConnections as useConnections2 } from "@dxos/plugin-graph";
|
|
821
|
+
import { Avatar as Avatar2, Icon as Icon2, ScrollArea as ScrollArea2, toLocalizedString as toLocalizedString3, useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
822
|
+
import { Card as Card3 } from "@dxos/react-ui";
|
|
823
|
+
import { Mosaic as Mosaic3 } from "@dxos/react-ui-mosaic";
|
|
824
|
+
import { SearchPanel as SearchPanel2, useSearchListItem as useSearchListItem2, useSearchListResults as useSearchListResults2 } from "@dxos/react-ui-search";
|
|
825
|
+
import { mx as mx3 } from "@dxos/ui-theme";
|
|
826
|
+
import { meta as meta4 } from "#meta";
|
|
827
|
+
var NavBranch = ({ id }) => {
|
|
828
|
+
const { t } = useTranslation4(meta4.id);
|
|
829
|
+
const { graph } = useAppGraph5();
|
|
830
|
+
useExpandPath(id);
|
|
831
|
+
const children = useConnections2(graph, id, "child");
|
|
832
|
+
const visibleChildren = useMemo5(() => children.filter((node) => node.properties.disposition !== "hidden"), [
|
|
833
|
+
children
|
|
834
|
+
]);
|
|
835
|
+
const { results, handleSearch } = useSearchListResults2({
|
|
836
|
+
items: visibleChildren,
|
|
837
|
+
extract: (child) => toLocalizedString3(child.properties.label, t)
|
|
838
|
+
});
|
|
839
|
+
return /* @__PURE__ */ React12.createElement(SearchPanel2, {
|
|
840
|
+
onSearch: handleSearch
|
|
841
|
+
}, /* @__PURE__ */ React12.createElement(Mosaic3.Container, {
|
|
842
|
+
asChild: true
|
|
843
|
+
}, /* @__PURE__ */ React12.createElement(ScrollArea2.Root, {
|
|
844
|
+
centered: true,
|
|
845
|
+
padding: true,
|
|
846
|
+
thin: true
|
|
847
|
+
}, /* @__PURE__ */ React12.createElement(ScrollArea2.Viewport, null, /* @__PURE__ */ React12.createElement(Mosaic3.Stack, {
|
|
848
|
+
classNames: "gap-1",
|
|
849
|
+
draggable: false,
|
|
850
|
+
items: results,
|
|
851
|
+
getId: (item) => item.id,
|
|
852
|
+
Tile: NavBranchTile
|
|
853
|
+
})))));
|
|
854
|
+
};
|
|
855
|
+
var NavBranchTile = (props) => {
|
|
856
|
+
const data = props.data;
|
|
857
|
+
const { t } = useTranslation4(meta4.id);
|
|
858
|
+
const { invokePromise } = useOperationInvoker2();
|
|
859
|
+
const ref = useRef5(null);
|
|
860
|
+
const { selectedValue, registerItem, unregisterItem } = useSearchListItem2();
|
|
861
|
+
const isSelected = selectedValue === data.id;
|
|
862
|
+
const name = toLocalizedString3(data.properties.label, t);
|
|
863
|
+
const handleSelect = useCallback4(() => void invokePromise(LayoutOperation2.Open, {
|
|
864
|
+
subject: [
|
|
865
|
+
data.id
|
|
866
|
+
]
|
|
867
|
+
}), [
|
|
868
|
+
invokePromise,
|
|
869
|
+
data.id
|
|
870
|
+
]);
|
|
871
|
+
useEffect5(() => {
|
|
872
|
+
if (ref.current) {
|
|
873
|
+
registerItem(data.id, ref.current, handleSelect);
|
|
874
|
+
}
|
|
875
|
+
return () => unregisterItem(data.id);
|
|
876
|
+
}, [
|
|
877
|
+
data.id,
|
|
878
|
+
handleSelect,
|
|
879
|
+
registerItem,
|
|
880
|
+
unregisterItem
|
|
881
|
+
]);
|
|
882
|
+
useEffect5(() => {
|
|
883
|
+
if (isSelected && ref.current) {
|
|
884
|
+
ref.current.scrollIntoView({
|
|
885
|
+
block: "nearest",
|
|
886
|
+
behavior: "smooth"
|
|
887
|
+
});
|
|
888
|
+
}
|
|
889
|
+
}, [
|
|
890
|
+
isSelected
|
|
891
|
+
]);
|
|
892
|
+
return /* @__PURE__ */ React12.createElement(Card3.Root, {
|
|
893
|
+
ref,
|
|
894
|
+
role: "button",
|
|
895
|
+
fullWidth: true,
|
|
896
|
+
tabIndex: -1,
|
|
897
|
+
"data-selected": isSelected,
|
|
898
|
+
classNames: mx3("dx-focus-ring cursor-pointer", isSelected && "bg-selected-surface"),
|
|
899
|
+
onClick: handleSelect
|
|
900
|
+
}, /* @__PURE__ */ React12.createElement(Card3.Toolbar, null, /* @__PURE__ */ React12.createElement(Avatar2.Root, null, /* @__PURE__ */ React12.createElement(Avatar2.Content, {
|
|
901
|
+
hue: data.properties.hue,
|
|
902
|
+
icon: data.properties.icon,
|
|
903
|
+
hueVariant: "transparent",
|
|
904
|
+
variant: "square",
|
|
905
|
+
size: 8,
|
|
906
|
+
fallback: name
|
|
907
|
+
}), /* @__PURE__ */ React12.createElement(Avatar2.Label, null, name), /* @__PURE__ */ React12.createElement(Icon2, {
|
|
908
|
+
icon: "ph--caret-right--regular"
|
|
909
|
+
}))));
|
|
910
|
+
};
|
|
1251
911
|
export {
|
|
912
|
+
AppBar,
|
|
913
|
+
DebugOverlay,
|
|
1252
914
|
Home,
|
|
915
|
+
Loading,
|
|
916
|
+
Main,
|
|
917
|
+
MobileLayout,
|
|
918
|
+
NavBar,
|
|
919
|
+
NavBranch,
|
|
920
|
+
PopoverContent,
|
|
921
|
+
PopoverRoot,
|
|
1253
922
|
SimpleLayout,
|
|
1254
|
-
|
|
923
|
+
useDebugLog,
|
|
924
|
+
useMobileLayout
|
|
1255
925
|
};
|
|
1256
|
-
//# sourceMappingURL=
|
|
926
|
+
//# sourceMappingURL=index.mjs.map
|