@dxos/plugin-simple-layout 0.8.4-main.d05673bc65 → 0.8.4-main.dfabb4ec29
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/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-7UDV3JDT.mjs +22 -0
- package/dist/lib/neutral/chunk-7UDV3JDT.mjs.map +7 -0
- package/dist/lib/neutral/chunk-AMTEDJHG.mjs +19 -0
- package/dist/lib/neutral/chunk-AMTEDJHG.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-XVUAQHKU.mjs +8 -0
- package/dist/lib/neutral/chunk-XVUAQHKU.mjs.map +7 -0
- package/dist/lib/neutral/close-WKMURGUB.mjs +35 -0
- package/dist/lib/neutral/close-WKMURGUB.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +924 -0
- 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-XI2T7D5O.mjs +49 -0
- package/dist/lib/neutral/open-XI2T7D5O.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-WVQYY2JA.mjs → neutral/react-root-VE265VX4.mjs} +5 -8
- package/dist/lib/neutral/react-root-VE265VX4.mjs.map +7 -0
- package/dist/lib/{browser/react-surface-VLBR37ED.mjs → neutral/react-surface-REZMYKQV.mjs} +15 -13
- package/dist/lib/neutral/react-surface-REZMYKQV.mjs.map +7 -0
- package/dist/lib/neutral/revert-workspace-ST6NZUNG.mjs +22 -0
- package/dist/lib/neutral/revert-workspace-ST6NZUNG.mjs.map +7 -0
- package/dist/lib/neutral/set-6ZRLWPJS.mjs +22 -0
- package/dist/lib/neutral/set-6ZRLWPJS.mjs.map +7 -0
- package/dist/lib/neutral/set-layout-mode-L22HRCKS.mjs +13 -0
- 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/neutral/switch-workspace-PYWPTMFO.mjs +25 -0
- package/dist/lib/neutral/switch-workspace-PYWPTMFO.mjs.map +7 -0
- 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/neutral/update-complementary-HKWF5OXT.mjs +33 -0
- package/dist/lib/neutral/update-complementary-HKWF5OXT.mjs.map +7 -0
- package/dist/lib/neutral/update-dialog-P4ASXCE7.mjs +30 -0
- package/dist/lib/neutral/update-dialog-P4ASXCE7.mjs.map +7 -0
- package/dist/lib/neutral/update-popover-REAKC2GN.mjs +34 -0
- package/dist/lib/neutral/update-popover-REAKC2GN.mjs.map +7 -0
- package/dist/lib/neutral/update-sidebar-O5SQPR6Q.mjs +12 -0
- package/dist/lib/neutral/update-sidebar-O5SQPR6Q.mjs.map +7 -0
- package/dist/lib/neutral/url-handler-GZXUUAHD.mjs +129 -0
- package/dist/lib/neutral/url-handler-GZXUUAHD.mjs.map +7 -0
- package/dist/types/src/SimpleLayoutPlugin.d.ts +2 -1
- 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.d.ts +6 -0
- 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 +26 -19
- 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/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.d.ts +3 -0
- package/dist/types/src/components/Loading/Loading.d.ts.map +1 -0
- package/dist/types/src/components/{ContentLoading/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 +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 +5 -7
- package/dist/types/src/components/SimpleLayout/AppBar.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/AppBar.stories.d.ts +29 -22
- 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 +5 -7
- package/dist/types/src/components/SimpleLayout/NavBar.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/NavBar.stories.d.ts +29 -23
- 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 +26 -25
- 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/components/index.d.ts +2 -1
- package/dist/types/src/components/index.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 +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/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +26 -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 +18 -7
- package/src/capabilities/app-graph-builder.ts +21 -0
- package/src/capabilities/index.ts +13 -6
- package/src/capabilities/operation-handler.ts +14 -0
- package/src/capabilities/{react-root/react-root.tsx → react-root.tsx} +2 -2
- package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +12 -5
- 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/DebugOverlay/DebugOverlay.tsx +96 -0
- package/src/components/DebugOverlay/index.ts +5 -0
- package/src/components/Dialog/Dialog.tsx +14 -3
- package/src/components/Home/Home.tsx +29 -29
- package/src/components/{ContentLoading/ContentLoading.stories.tsx → Loading/Loading.stories.tsx} +4 -4
- package/src/components/{ContentLoading/ContentLoading.tsx → Loading/Loading.tsx} +2 -2
- package/src/components/{ContentLoading → Loading}/index.ts +1 -1
- package/src/components/MobileLayout/MobileLayout.stories.tsx +21 -17
- package/src/components/MobileLayout/MobileLayout.tsx +118 -51
- package/src/components/NavBranch/NavBranch.tsx +26 -32
- package/src/components/Popover/Popover.tsx +10 -16
- package/src/components/SimpleLayout/AppBar.stories.tsx +10 -10
- package/src/components/SimpleLayout/AppBar.tsx +60 -60
- package/src/components/SimpleLayout/Drawer.tsx +30 -22
- package/src/components/SimpleLayout/Main.tsx +19 -23
- package/src/components/SimpleLayout/NavBar.stories.tsx +2 -2
- package/src/components/SimpleLayout/NavBar.tsx +8 -9
- package/src/components/SimpleLayout/SimpleLayout.stories.tsx +46 -69
- package/src/components/SimpleLayout/SimpleLayout.tsx +33 -34
- package/src/components/hooks.ts +1 -1
- package/src/components/index.ts +2 -1
- package/src/hooks/actions.ts +8 -5
- package/src/hooks/useAppBarProps.ts +9 -29
- package/src/hooks/useDrawerActions.ts +7 -7
- package/src/hooks/useNavbarActions.ts +4 -4
- package/src/hooks/useSimpleLayoutState.ts +7 -5
- package/src/index.ts +2 -1
- package/src/meta.ts +2 -1
- package/src/operations/close.ts +34 -0
- package/src/operations/index.ts +16 -0
- package/src/operations/open.ts +63 -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 +21 -0
- package/src/operations/switch-workspace.ts +26 -0
- package/src/operations/update-complementary.ts +35 -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/plugin.ts +11 -0
- package/src/translations.ts +21 -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-MDPEKLKR.mjs +0 -1163
- package/dist/lib/browser/chunk-MDPEKLKR.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/index.mjs +0 -101
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/operation-resolver-VTZ6HZ4B.mjs +0 -194
- package/dist/lib/browser/operation-resolver-VTZ6HZ4B.mjs.map +0 -7
- package/dist/lib/browser/react-root-WVQYY2JA.mjs.map +0 -7
- package/dist/lib/browser/react-surface-VLBR37ED.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/url-handler-RBRONH7S.mjs +0 -151
- package/dist/lib/browser/url-handler-RBRONH7S.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DCKASLMP.mjs +0 -1164
- package/dist/lib/node-esm/chunk-DCKASLMP.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/index.mjs +0 -102
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/operation-resolver-R7CQ6ERU.mjs +0 -195
- package/dist/lib/node-esm/operation-resolver-R7CQ6ERU.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-XBNDM7BE.mjs +0 -22
- package/dist/lib/node-esm/react-root-XBNDM7BE.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-U5NHA367.mjs +0 -45
- package/dist/lib/node-esm/react-surface-U5NHA367.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/url-handler-QSMCH3JB.mjs +0 -152
- package/dist/lib/node-esm/url-handler-QSMCH3JB.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/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/components/ContentLoading/ContentLoading.d.ts +0 -3
- package/dist/types/src/components/ContentLoading/ContentLoading.d.ts.map +0 -1
- package/dist/types/src/components/ContentLoading/ContentLoading.stories.d.ts.map +0 -1
- package/dist/types/src/components/ContentLoading/index.d.ts +0 -2
- package/dist/types/src/components/ContentLoading/index.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-resolver/index.ts +0 -10
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -202
- 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 -133
- 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
package/dist/lib/{browser/spotlight-dismiss-67PHYS5B.mjs → neutral/spotlight-dismiss-EIYW5E7M.mjs}
RENAMED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/capabilities/spotlight-dismiss.ts
|
|
2
4
|
import * as Effect from "effect/Effect";
|
|
3
5
|
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
4
6
|
import { log } from "@dxos/log";
|
|
5
7
|
import { isTauri } from "@dxos/util";
|
|
6
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-simple-layout/src/capabilities/spotlight-dismiss
|
|
8
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-simple-layout/src/capabilities/spotlight-dismiss.ts";
|
|
7
9
|
var getTauriWindow = () => {
|
|
8
10
|
const tauri = globalThis.__TAURI__;
|
|
9
11
|
return tauri?.window;
|
|
@@ -29,12 +31,7 @@ var spotlight_dismiss_default = Capability.makeModule(({ isPopover = false } = {
|
|
|
29
31
|
});
|
|
30
32
|
}
|
|
31
33
|
} catch (err) {
|
|
32
|
-
log.catch(err, void 0, {
|
|
33
|
-
F: __dxlog_file,
|
|
34
|
-
L: 60,
|
|
35
|
-
S: void 0,
|
|
36
|
-
C: (f, a) => f(...a)
|
|
37
|
-
});
|
|
34
|
+
log.catch(err, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 44, S: void 0 });
|
|
38
35
|
}
|
|
39
36
|
const handleKeyDown = async (event) => {
|
|
40
37
|
if (event.key === "Escape") {
|
|
@@ -45,12 +42,7 @@ var spotlight_dismiss_default = Capability.makeModule(({ isPopover = false } = {
|
|
|
45
42
|
await tauriCore.invoke("hide_spotlight");
|
|
46
43
|
}
|
|
47
44
|
} catch (err) {
|
|
48
|
-
log.catch(err, void 0, {
|
|
49
|
-
F: __dxlog_file,
|
|
50
|
-
L: 73,
|
|
51
|
-
S: void 0,
|
|
52
|
-
C: (f, a) => f(...a)
|
|
53
|
-
});
|
|
45
|
+
log.catch(err, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 56, S: void 0 });
|
|
54
46
|
}
|
|
55
47
|
}
|
|
56
48
|
};
|
|
@@ -63,4 +55,4 @@ var spotlight_dismiss_default = Capability.makeModule(({ isPopover = false } = {
|
|
|
63
55
|
export {
|
|
64
56
|
spotlight_dismiss_default as default
|
|
65
57
|
};
|
|
66
|
-
//# sourceMappingURL=spotlight-dismiss-
|
|
58
|
+
//# sourceMappingURL=spotlight-dismiss-EIYW5E7M.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/spotlight-dismiss
|
|
3
|
+
"sources": ["../../../src/capabilities/spotlight-dismiss.ts"],
|
|
4
4
|
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\n// Based on the frontend-driven dismiss pattern from:\n// https://github.com/Jedliu/tauri-template-demo\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { log } from '@dxos/log';\nimport { isTauri } from '@dxos/util';\n\n/**\n * Get the Tauri window API from the global object.\n */\nconst getTauriWindow = (): any => {\n const tauri = (globalThis as any).__TAURI__;\n return tauri?.window;\n};\n\n/**\n * Get the Tauri core API (invoke) from the global object.\n */\nconst getTauriCore = (): any => {\n const tauri = (globalThis as any).__TAURI__;\n return tauri?.core;\n};\n\nexport type SpotlightDismissOptions = {\n /** Whether running in popover window context. */\n isPopover?: boolean;\n};\n\n/**\n * Capability that sets up spotlight panel dismiss behavior.\n * When running in Tauri popover mode, listens for focus loss and Escape key\n * to dismiss the spotlight panel. Runs at startup before React renders.\n */\nexport default Capability.makeModule(({ isPopover = false }: SpotlightDismissOptions = {}) =>\n Effect.promise(async () => {\n if (!isPopover || !isTauri()) {\n return [];\n }\n\n // Set up focus listener.\n let focusCleanup: (() => void) | undefined;\n try {\n const tauriWindow = getTauriWindow();\n const tauriCore = getTauriCore();\n if (tauriWindow && tauriCore) {\n const win = tauriWindow.getCurrentWindow();\n focusCleanup = await win.onFocusChanged(async ({ payload }: { payload: boolean }) => {\n if (!payload) {\n await tauriCore.invoke('hide_spotlight');\n }\n });\n }\n } catch (err) {\n log.catch(err);\n }\n\n // Set up Escape key listener.\n const handleKeyDown = async (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n event.preventDefault();\n try {\n const tauriCore = getTauriCore();\n if (tauriCore) {\n await tauriCore.invoke('hide_spotlight');\n }\n } catch (err) {\n log.catch(err);\n }\n }\n };\n window.addEventListener('keydown', handleKeyDown);\n\n return Capability.contributes(Capabilities.Null, null, () =>\n Effect.sync(() => {\n focusCleanup?.();\n window.removeEventListener('keydown', handleKeyDown);\n }),\n );\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;AAOA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,WAAW;AACpB,SAASC,eAAe
|
|
6
|
-
"names": ["Effect", "Capabilities", "Capability", "log", "isTauri", "
|
|
5
|
+
"mappings": ";;;AAOA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,WAAW;AACpB,SAASC,eAAe;AAExB,IAAA,eAAA;AAKE,IAAA,iBAAcC,MAAAA;AAChB,QAAA,QAAA,WAAA;AAEA,SAAA,OAAA;;AAKE,IAAA,eAAcC,MAAAA;AAChB,QAAA,QAAA,WAAA;AAOA,SAAA,OAAA;;gCAQa,WAAE,WAAA,CAAA,EAAA,YAAA,MAAA,IAAA,CAAA,MAAA,eAAA,YAAA;AACX,MAAA,CAAA,aAAA,CAAA,QAAA,GAAA;AAEA,WAAA,CAAA;EACA;MAEE;MACA;AACA,UAAIC,cAAeC,eAAW;UAC5B,YAAYD,aAAYE;QACxBC,eAAe,WAAUC;YACvB,MAAKC,YAAS,iBAAA;qBACNJ,MAAAA,IAAUK,eAAO,OAAA,EAAA,QAAA,MAAA;AACzB,YAAA,CAAA,SAAA;AACF,gBAAA,UAAA,OAAA,gBAAA;QACF;MACA,CAAOC;IACPX;EACF,SAAA,KAAA;AAEA,QAAA,MAAA,KAAA,QAAA,EAAA,YAA8B,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,OAAA,CAAA;EAC9B;wBAEUY,OAAc,UAAA;QACpB,MAAI,QAAA,UAAA;YACF,eAAMP;UACN;cACE,YAAMA,aAAiB;AACzB,YAAA,WAAA;AACA,gBAAY,UAAA,OAAA,gBAAA;QACZL;MACF,SAAA,KAAA;AACF,YAAA,MAAA,KAAA,QAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,OAAA,CAAA;MACF;IACAE;EAEA;0BAEIK,WAAAA,aAAAA;oBACOM,YAAAA,aAAoB,MAAWC,MAAAA,MAAAA,YAAAA,MAAAA;AACxC,mBAAA;AAGJ,WAAA,oBAAA,WAAA,aAAA;;;",
|
|
6
|
+
"names": ["Effect", "Capabilities", "Capability", "log", "isTauri", "window", "core", "tauriWindow", "tauriCore", "getCurrentWindow", "focusCleanup", "onFocusChanged", "payload", "invoke", "err", "preventDefault", "removeEventListener", "handleKeyDown"]
|
|
7
7
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
SimpleLayoutState
|
|
3
|
-
} from "./chunk-MRR7PXSM.mjs";
|
|
1
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
4
2
|
|
|
5
|
-
// src/capabilities/state
|
|
3
|
+
// src/capabilities/state.tsx
|
|
6
4
|
import { Atom } from "@effect-atom/atom-react";
|
|
7
5
|
import * as Effect from "effect/Effect";
|
|
8
6
|
import { Capability } from "@dxos/app-framework";
|
|
9
7
|
import { AppCapabilities } from "@dxos/app-toolkit";
|
|
10
8
|
import { Node } from "@dxos/plugin-graph";
|
|
9
|
+
import { SimpleLayoutCapabilities } from "#types";
|
|
11
10
|
var defaultState = {
|
|
12
11
|
dialogOpen: false,
|
|
13
12
|
workspace: Node.RootId,
|
|
@@ -38,11 +37,11 @@ var state_default = Capability.makeModule(({ initialState } = {}) => Effect.sync
|
|
|
38
37
|
};
|
|
39
38
|
});
|
|
40
39
|
return [
|
|
41
|
-
Capability.contributes(
|
|
40
|
+
Capability.contributes(SimpleLayoutCapabilities.State, stateAtom),
|
|
42
41
|
Capability.contributes(AppCapabilities.Layout, layoutAtom)
|
|
43
42
|
];
|
|
44
43
|
}));
|
|
45
44
|
export {
|
|
46
45
|
state_default as default
|
|
47
46
|
};
|
|
48
|
-
//# sourceMappingURL=state-
|
|
47
|
+
//# sourceMappingURL=state-7NXKBLPY.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/state.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Atom } from '@effect-atom/atom-react';\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { AppCapabilities } from '@dxos/app-toolkit';\nimport { Node } from '@dxos/plugin-graph';\n\nimport { SimpleLayoutCapabilities } from '#types';\n\nconst defaultState: SimpleLayoutCapabilities.SimpleLayoutState = {\n dialogOpen: false,\n workspace: Node.RootId,\n previousWorkspace: Node.RootId,\n history: [],\n isPopover: false,\n companionVariant: undefined,\n drawerState: 'closed',\n};\n\nexport type SimpleLayoutStateOptions = {\n initialState?: Partial<SimpleLayoutCapabilities.SimpleLayoutState>;\n};\n\nexport default Capability.makeModule(({ initialState }: SimpleLayoutStateOptions = {}) =>\n Effect.sync(() => {\n const stateAtom = Atom.make<SimpleLayoutCapabilities.SimpleLayoutState>({ ...defaultState, ...initialState });\n\n const layoutAtom = Atom.make((get): AppCapabilities.Layout => {\n const state = get(stateAtom);\n return {\n mode: 'simple',\n dialogOpen: state.dialogOpen,\n sidebarOpen: false,\n complementarySidebarOpen: false,\n workspace: state.workspace,\n active: state.active ? [state.active] : [],\n inactive: [],\n scrollIntoView: undefined,\n };\n });\n\n return [\n Capability.contributes(SimpleLayoutCapabilities.State, stateAtom),\n Capability.contributes(AppCapabilities.Layout, layoutAtom),\n ];\n }),\n);\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAASA,YAAY;AACrB,YAAYC,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,uBAAuB;AAChC,SAASC,YAAY;AAErB,SAASC,gCAAgC;AAEzC,IAAMC,eAA2D;EAC/DC,YAAY;EACZC,WAAWJ,KAAKK;EAChBC,mBAAmBN,KAAKK;EACxBE,SAAS,CAAA;EACTC,WAAW;EACXC,kBAAkBC;EAClBC,aAAa;AACf;AAMA,IAAA,gBAAeb,WAAWc,WAAW,CAAC,EAAEC,aAAY,IAA+B,CAAC,MAC3EC,YAAK,MAAA;AACV,QAAMC,YAAYnB,KAAKoB,KAAiD;IAAE,GAAGd;IAAc,GAAGW;EAAa,CAAA;AAE3G,QAAMI,aAAarB,KAAKoB,KAAK,CAACE,QAAAA;AAC5B,UAAMC,QAAQD,IAAIH,SAAAA;AAClB,WAAO;MACLK,MAAM;MACNjB,YAAYgB,MAAMhB;MAClBkB,aAAa;MACbC,0BAA0B;MAC1BlB,WAAWe,MAAMf;MACjBmB,QAAQJ,MAAMI,SAAS;QAACJ,MAAMI;UAAU,CAAA;MACxCC,UAAU,CAAA;MACVC,gBAAgBf;IAClB;EACF,CAAA;AAEA,SAAO;IACLZ,WAAW4B,YAAYzB,yBAAyB0B,OAAOZ,SAAAA;IACvDjB,WAAW4B,YAAY3B,gBAAgB6B,QAAQX,UAAAA;;AAEnD,CAAA,CAAA;",
|
|
6
|
+
"names": ["Atom", "Effect", "Capability", "AppCapabilities", "Node", "SimpleLayoutCapabilities", "defaultState", "dialogOpen", "workspace", "RootId", "previousWorkspace", "history", "isPopover", "companionVariant", "undefined", "drawerState", "makeModule", "initialState", "sync", "stateAtom", "make", "layoutAtom", "get", "state", "mode", "sidebarOpen", "complementarySidebarOpen", "active", "inactive", "scrollIntoView", "contributes", "State", "Layout"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
layoutStateAccess
|
|
3
|
+
} from "./chunk-7UDV3JDT.mjs";
|
|
4
|
+
import "./chunk-FD2CAY4Q.mjs";
|
|
5
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
6
|
+
|
|
7
|
+
// src/operations/switch-workspace.ts
|
|
8
|
+
import * as Effect from "effect/Effect";
|
|
9
|
+
import { isPinnedWorkspace, LayoutOperation } from "@dxos/app-toolkit";
|
|
10
|
+
import { Operation } from "@dxos/compute";
|
|
11
|
+
var handler = LayoutOperation.SwitchWorkspace.pipe(Operation.withHandler(Effect.fnUntraced(function* (input) {
|
|
12
|
+
const { updateState } = yield* layoutStateAccess;
|
|
13
|
+
updateState((state) => ({
|
|
14
|
+
...state,
|
|
15
|
+
previousWorkspace: !isPinnedWorkspace(state.workspace) ? state.workspace : state.previousWorkspace,
|
|
16
|
+
workspace: input.subject,
|
|
17
|
+
active: void 0,
|
|
18
|
+
history: []
|
|
19
|
+
}));
|
|
20
|
+
})));
|
|
21
|
+
var switch_workspace_default = handler;
|
|
22
|
+
export {
|
|
23
|
+
switch_workspace_default as default
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=switch-workspace-PYWPTMFO.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/switch-workspace.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright 2025 DXOS.org\n\nimport * as Effect from 'effect/Effect';\n\nimport { isPinnedWorkspace, LayoutOperation } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/compute';\n\nimport { layoutStateAccess } from './state-access';\n\nconst handler: Operation.WithHandler<typeof LayoutOperation.SwitchWorkspace> = LayoutOperation.SwitchWorkspace.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* (input) {\n const { updateState } = yield* layoutStateAccess;\n\n updateState((state) => ({\n ...state,\n previousWorkspace: !isPinnedWorkspace(state.workspace) ? state.workspace : state.previousWorkspace,\n workspace: input.subject,\n active: undefined,\n history: [],\n }));\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
+
"mappings": ";;;;;;;AAEA,YAAYA,YAAY;AAExB,SAASC,mBAAmBC,uBAAuB;AACnD,SAASC,iBAAiB;AAI1B,IAAMC,UAAyEC,gBAAgBC,gBAAgBC,KAC7GC,UAAUC,YACDC,kBAAW,WAAWC,OAAK;AAChC,QAAM,EAAEC,YAAW,IAAK,OAAOC;AAE/BD,cAAY,CAACE,WAAW;IACtB,GAAGA;IACHC,mBAAmB,CAACC,kBAAkBF,MAAMG,SAAS,IAAIH,MAAMG,YAAYH,MAAMC;IACjFE,WAAWN,MAAMO;IACjBC,QAAQC;IACRC,SAAS,CAAA;EACX,EAAA;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,2BAAejB;",
|
|
6
|
+
"names": ["Effect", "isPinnedWorkspace", "LayoutOperation", "Operation", "handler", "LayoutOperation", "SwitchWorkspace", "pipe", "Operation", "withHandler", "fnUntraced", "input", "updateState", "layoutStateAccess", "state", "previousWorkspace", "isPinnedWorkspace", "workspace", "subject", "active", "undefined", "history"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/translations.ts
|
|
4
|
+
import { translations as searchTranslations } from "@dxos/react-ui-search/translations";
|
|
5
|
+
import { meta } from "#meta";
|
|
6
|
+
var translations = [
|
|
7
|
+
...searchTranslations,
|
|
8
|
+
{
|
|
9
|
+
"en-US": {
|
|
10
|
+
[meta.id]: {
|
|
11
|
+
"plugin.name": "Simple layout",
|
|
12
|
+
"settings.title": "Simple layout settings",
|
|
13
|
+
"workspaces.heading": "Workspaces",
|
|
14
|
+
"settings.heading": "Settings",
|
|
15
|
+
"back.label": "Back",
|
|
16
|
+
"browse.label": "Browse",
|
|
17
|
+
"notifications.label": "Notifications",
|
|
18
|
+
"profile.label": "Profile",
|
|
19
|
+
"app-menu.label": "App menu",
|
|
20
|
+
"main-menu.label": "Main menu",
|
|
21
|
+
"companions-menu.label": "Companions",
|
|
22
|
+
"error-fallback.message": "An error occurred",
|
|
23
|
+
"drawer.label": "Drawer",
|
|
24
|
+
"close-drawer.label": "Close drawer",
|
|
25
|
+
"expand-drawer.label": "Expand drawer",
|
|
26
|
+
"collapse-drawer.label": "Collapse drawer",
|
|
27
|
+
"actions-menu.label": "Actions",
|
|
28
|
+
"done.label": "Done"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
];
|
|
33
|
+
export {
|
|
34
|
+
translations
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=translations.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/translations.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\nimport { translations as searchTranslations } from '@dxos/react-ui-search/translations';\n\nimport { meta } from '#meta';\n\nexport const translations = [\n ...searchTranslations,\n {\n 'en-US': {\n [meta.id]: {\n 'plugin.name': 'Simple layout',\n 'settings.title': 'Simple layout settings',\n 'workspaces.heading': 'Workspaces',\n 'settings.heading': 'Settings',\n 'back.label': 'Back',\n 'browse.label': 'Browse',\n 'notifications.label': 'Notifications',\n 'profile.label': 'Profile',\n 'app-menu.label': 'App menu',\n 'main-menu.label': 'Main menu',\n 'companions-menu.label': 'Companions',\n 'error-fallback.message': 'An error occurred',\n 'drawer.label': 'Drawer',\n 'close-drawer.label': 'Close drawer',\n 'expand-drawer.label': 'Expand drawer',\n 'collapse-drawer.label': 'Collapse drawer',\n 'actions-menu.label': 'Actions',\n 'done.label': 'Done',\n },\n },\n },\n] as const satisfies Resource[];\n"],
|
|
5
|
+
"mappings": ";;;AAKA,SAASA,gBAAgBC,0BAA0B;AAEnD,SAASC,YAAY;AAEd,IAAMF,eAAe;KACvBC;EACH;IACE,SAAS;MACP,CAACC,KAAKC,EAAE,GAAG;QACT,eAAe;QACf,kBAAkB;QAClB,sBAAsB;QACtB,oBAAoB;QACpB,cAAc;QACd,gBAAgB;QAChB,uBAAuB;QACvB,iBAAiB;QACjB,kBAAkB;QAClB,mBAAmB;QACnB,yBAAyB;QACzB,0BAA0B;QAC1B,gBAAgB;QAChB,sBAAsB;QACtB,uBAAuB;QACvB,yBAAyB;QACzB,sBAAsB;QACtB,cAAc;MAChB;IACF;EACF;;",
|
|
6
|
+
"names": ["translations", "searchTranslations", "meta", "id"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SimpleLayoutCapabilities_exports,
|
|
3
|
+
SimpleLayoutEvents_exports
|
|
4
|
+
} from "../chunk-FD2CAY4Q.mjs";
|
|
5
|
+
import "../chunk-J5LGTIGS.mjs";
|
|
6
|
+
export {
|
|
7
|
+
SimpleLayoutCapabilities_exports as SimpleLayoutCapabilities,
|
|
8
|
+
SimpleLayoutEvents_exports as SimpleLayoutEvents
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
layoutStateAccess
|
|
3
|
+
} from "./chunk-7UDV3JDT.mjs";
|
|
4
|
+
import "./chunk-FD2CAY4Q.mjs";
|
|
5
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
6
|
+
|
|
7
|
+
// src/operations/update-complementary.ts
|
|
8
|
+
import * as Effect from "effect/Effect";
|
|
9
|
+
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
10
|
+
import { Operation } from "@dxos/compute";
|
|
11
|
+
import { getLinkedVariant } from "@dxos/react-ui-attention";
|
|
12
|
+
var handler = LayoutOperation.UpdateComplementary.pipe(Operation.withHandler(Effect.fnUntraced(function* (input) {
|
|
13
|
+
const { updateState } = yield* layoutStateAccess;
|
|
14
|
+
if (input.state === "closed") {
|
|
15
|
+
updateState((state) => ({
|
|
16
|
+
...state,
|
|
17
|
+
drawerState: "closed",
|
|
18
|
+
companionVariant: void 0
|
|
19
|
+
}));
|
|
20
|
+
} else if (input.subject) {
|
|
21
|
+
const variant = getLinkedVariant(input.subject);
|
|
22
|
+
updateState((state) => ({
|
|
23
|
+
...state,
|
|
24
|
+
companionVariant: variant,
|
|
25
|
+
drawerState: input.state === "expanded" ? "expanded" : "open"
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
28
|
+
})));
|
|
29
|
+
var update_complementary_default = handler;
|
|
30
|
+
export {
|
|
31
|
+
update_complementary_default as default
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=update-complementary-HKWF5OXT.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/update-complementary.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright 2025 DXOS.org\n\nimport * as Effect from 'effect/Effect';\n\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/compute';\nimport { getLinkedVariant } from '@dxos/react-ui-attention';\n\nimport { layoutStateAccess } from './state-access';\n\nconst handler: Operation.WithHandler<typeof LayoutOperation.UpdateComplementary> =\n LayoutOperation.UpdateComplementary.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* (input) {\n const { updateState } = yield* layoutStateAccess;\n\n if (input.state === 'closed') {\n updateState((state) => ({\n ...state,\n drawerState: 'closed',\n companionVariant: undefined,\n }));\n } else if (input.subject) {\n const variant = getLinkedVariant(input.subject);\n updateState((state) => ({\n ...state,\n companionVariant: variant,\n drawerState: input.state === 'expanded' ? 'expanded' : 'open',\n }));\n }\n }),\n ),\n );\n\nexport default handler;\n"],
|
|
5
|
+
"mappings": ";;;;;;;AAEA,YAAYA,YAAY;AAExB,SAASC,uBAAuB;AAChC,SAASC,iBAAiB;AAC1B,SAASC,wBAAwB;AAIjC,IAAMC,UACJC,gBAAgBC,oBAAoBC,KAClCC,UAAUC,YACDC,kBAAW,WAAWC,OAAK;AAChC,QAAM,EAAEC,YAAW,IAAK,OAAOC;AAE/B,MAAIF,MAAMG,UAAU,UAAU;AAC5BF,gBAAY,CAACE,WAAW;MACtB,GAAGA;MACHC,aAAa;MACbC,kBAAkBC;IACpB,EAAA;EACF,WAAWN,MAAMO,SAAS;AACxB,UAAMC,UAAUC,iBAAiBT,MAAMO,OAAO;AAC9CN,gBAAY,CAACE,WAAW;MACtB,GAAGA;MACHE,kBAAkBG;MAClBJ,aAAaJ,MAAMG,UAAU,aAAa,aAAa;IACzD,EAAA;EACF;AACF,CAAA,CAAA,CAAA;AAIN,IAAA,+BAAeV;",
|
|
6
|
+
"names": ["Effect", "LayoutOperation", "Operation", "getLinkedVariant", "handler", "LayoutOperation", "UpdateComplementary", "pipe", "Operation", "withHandler", "fnUntraced", "input", "updateState", "layoutStateAccess", "state", "drawerState", "companionVariant", "undefined", "subject", "variant", "getLinkedVariant"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
layoutStateAccess
|
|
3
|
+
} from "./chunk-7UDV3JDT.mjs";
|
|
4
|
+
import "./chunk-FD2CAY4Q.mjs";
|
|
5
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
6
|
+
|
|
7
|
+
// src/operations/update-dialog.ts
|
|
8
|
+
import * as Effect from "effect/Effect";
|
|
9
|
+
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
10
|
+
import { Operation } from "@dxos/compute";
|
|
11
|
+
var handler = LayoutOperation.UpdateDialog.pipe(Operation.withHandler(Effect.fnUntraced(function* (input) {
|
|
12
|
+
const { updateState } = yield* layoutStateAccess;
|
|
13
|
+
updateState((state) => ({
|
|
14
|
+
...state,
|
|
15
|
+
dialogOpen: input.state ?? Boolean(input.subject),
|
|
16
|
+
dialogType: input.type ?? "default",
|
|
17
|
+
dialogBlockAlign: input.blockAlign ?? "center",
|
|
18
|
+
dialogOverlayClasses: input.overlayClasses,
|
|
19
|
+
dialogOverlayStyle: input.overlayStyle,
|
|
20
|
+
dialogContent: input.subject ? {
|
|
21
|
+
component: input.subject,
|
|
22
|
+
props: input.props
|
|
23
|
+
} : void 0
|
|
24
|
+
}));
|
|
25
|
+
})));
|
|
26
|
+
var update_dialog_default = handler;
|
|
27
|
+
export {
|
|
28
|
+
update_dialog_default as default
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=update-dialog-P4ASXCE7.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/update-dialog.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright 2025 DXOS.org\n\nimport * as Effect from 'effect/Effect';\n\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/compute';\n\nimport { layoutStateAccess } from './state-access';\n\nconst handler: Operation.WithHandler<typeof LayoutOperation.UpdateDialog> = LayoutOperation.UpdateDialog.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* (input) {\n const { updateState } = yield* layoutStateAccess;\n\n updateState((state) => ({\n ...state,\n dialogOpen: input.state ?? Boolean(input.subject),\n dialogType: input.type ?? 'default',\n dialogBlockAlign: input.blockAlign ?? 'center',\n dialogOverlayClasses: input.overlayClasses,\n dialogOverlayStyle: input.overlayStyle,\n dialogContent: input.subject ? { component: input.subject, props: input.props } : undefined,\n }));\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
+
"mappings": ";;;;;;;AAEA,YAAYA,YAAY;AAExB,SAASC,uBAAuB;AAChC,SAASC,iBAAiB;AAI1B,IAAMC,UAAsEC,gBAAgBC,aAAaC,KACvGC,UAAUC,YACDC,kBAAW,WAAWC,OAAK;AAChC,QAAM,EAAEC,YAAW,IAAK,OAAOC;AAE/BD,cAAY,CAACE,WAAW;IACtB,GAAGA;IACHC,YAAYJ,MAAMG,SAASE,QAAQL,MAAMM,OAAO;IAChDC,YAAYP,MAAMQ,QAAQ;IAC1BC,kBAAkBT,MAAMU,cAAc;IACtCC,sBAAsBX,MAAMY;IAC5BC,oBAAoBb,MAAMc;IAC1BC,eAAef,MAAMM,UAAU;MAAEU,WAAWhB,MAAMM;MAASW,OAAOjB,MAAMiB;IAAM,IAAIC;EACpF,EAAA;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,wBAAezB;",
|
|
6
|
+
"names": ["Effect", "LayoutOperation", "Operation", "handler", "LayoutOperation", "UpdateDialog", "pipe", "Operation", "withHandler", "fnUntraced", "input", "updateState", "layoutStateAccess", "state", "dialogOpen", "Boolean", "subject", "dialogType", "type", "dialogBlockAlign", "blockAlign", "dialogOverlayClasses", "overlayClasses", "dialogOverlayStyle", "overlayStyle", "dialogContent", "component", "props", "undefined"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {
|
|
2
|
+
layoutStateAccess
|
|
3
|
+
} from "./chunk-7UDV3JDT.mjs";
|
|
4
|
+
import "./chunk-FD2CAY4Q.mjs";
|
|
5
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
6
|
+
|
|
7
|
+
// src/operations/update-popover.ts
|
|
8
|
+
import * as Effect from "effect/Effect";
|
|
9
|
+
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
10
|
+
import { Operation } from "@dxos/compute";
|
|
11
|
+
var handler = LayoutOperation.UpdatePopover.pipe(Operation.withHandler(Effect.fnUntraced(function* (input) {
|
|
12
|
+
const { updateState } = yield* layoutStateAccess;
|
|
13
|
+
updateState((state) => ({
|
|
14
|
+
...state,
|
|
15
|
+
popoverOpen: input.state ?? Boolean(input.subject),
|
|
16
|
+
popoverKind: input.kind ?? "base",
|
|
17
|
+
popoverTitle: input.kind === "card" ? input.title : void 0,
|
|
18
|
+
popoverContent: typeof input.subject === "string" ? {
|
|
19
|
+
component: input.subject,
|
|
20
|
+
props: input.props
|
|
21
|
+
} : input.subject ? {
|
|
22
|
+
subject: input.subject
|
|
23
|
+
} : void 0,
|
|
24
|
+
popoverSide: input.side,
|
|
25
|
+
popoverVariant: input.variant,
|
|
26
|
+
popoverAnchor: input.variant === "virtual" ? input.anchor : state.popoverAnchor,
|
|
27
|
+
popoverAnchorId: input.variant !== "virtual" ? input.anchorId : state.popoverAnchorId
|
|
28
|
+
}));
|
|
29
|
+
})));
|
|
30
|
+
var update_popover_default = handler;
|
|
31
|
+
export {
|
|
32
|
+
update_popover_default as default
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=update-popover-REAKC2GN.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/update-popover.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright 2025 DXOS.org\n\nimport * as Effect from 'effect/Effect';\n\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/compute';\n\nimport { layoutStateAccess } from './state-access';\n\nconst handler: Operation.WithHandler<typeof LayoutOperation.UpdatePopover> = LayoutOperation.UpdatePopover.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* (input) {\n const { updateState } = yield* layoutStateAccess;\n\n updateState((state) => ({\n ...state,\n popoverOpen: input.state ?? Boolean(input.subject),\n popoverKind: input.kind ?? 'base',\n popoverTitle: input.kind === 'card' ? input.title : undefined,\n popoverContent:\n typeof input.subject === 'string'\n ? { component: input.subject, props: input.props }\n : input.subject\n ? { subject: input.subject }\n : undefined,\n popoverSide: input.side,\n popoverVariant: input.variant,\n popoverAnchor: input.variant === 'virtual' ? input.anchor : state.popoverAnchor,\n popoverAnchorId: input.variant !== 'virtual' ? input.anchorId : state.popoverAnchorId,\n }));\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
+
"mappings": ";;;;;;;AAEA,YAAYA,YAAY;AAExB,SAASC,uBAAuB;AAChC,SAASC,iBAAiB;AAI1B,IAAMC,UAAuEC,gBAAgBC,cAAcC,KACzGC,UAAUC,YACDC,kBAAW,WAAWC,OAAK;AAChC,QAAM,EAAEC,YAAW,IAAK,OAAOC;AAE/BD,cAAY,CAACE,WAAW;IACtB,GAAGA;IACHC,aAAaJ,MAAMG,SAASE,QAAQL,MAAMM,OAAO;IACjDC,aAAaP,MAAMQ,QAAQ;IAC3BC,cAAcT,MAAMQ,SAAS,SAASR,MAAMU,QAAQC;IACpDC,gBACE,OAAOZ,MAAMM,YAAY,WACrB;MAAEO,WAAWb,MAAMM;MAASQ,OAAOd,MAAMc;IAAM,IAC/Cd,MAAMM,UACJ;MAAEA,SAASN,MAAMM;IAAQ,IACzBK;IACRI,aAAaf,MAAMgB;IACnBC,gBAAgBjB,MAAMkB;IACtBC,eAAenB,MAAMkB,YAAY,YAAYlB,MAAMoB,SAASjB,MAAMgB;IAClEE,iBAAiBrB,MAAMkB,YAAY,YAAYlB,MAAMsB,WAAWnB,MAAMkB;EACxE,EAAA;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,yBAAe5B;",
|
|
6
|
+
"names": ["Effect", "LayoutOperation", "Operation", "handler", "LayoutOperation", "UpdatePopover", "pipe", "Operation", "withHandler", "fnUntraced", "input", "updateState", "layoutStateAccess", "state", "popoverOpen", "Boolean", "subject", "popoverKind", "kind", "popoverTitle", "title", "undefined", "popoverContent", "component", "props", "popoverSide", "side", "popoverVariant", "variant", "popoverAnchor", "anchor", "popoverAnchorId", "anchorId"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/operations/update-sidebar.ts
|
|
4
|
+
import * as Effect from "effect/Effect";
|
|
5
|
+
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
6
|
+
import { Operation } from "@dxos/compute";
|
|
7
|
+
var handler = LayoutOperation.UpdateSidebar.pipe(Operation.withHandler(() => Effect.void));
|
|
8
|
+
var update_sidebar_default = handler;
|
|
9
|
+
export {
|
|
10
|
+
update_sidebar_default as default
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=update-sidebar-O5SQPR6Q.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/update-sidebar.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright 2025 DXOS.org\n\nimport * as Effect from 'effect/Effect';\n\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/compute';\n\nconst handler: Operation.WithHandler<typeof LayoutOperation.UpdateSidebar> = LayoutOperation.UpdateSidebar.pipe(\n Operation.withHandler(() => Effect.void),\n);\n\nexport default handler;\n"],
|
|
5
|
+
"mappings": ";;;AAEA,YAAYA,YAAY;AAExB,SAASC,uBAAuB;AAChC,SAASC,iBAAiB;AAE1B,IAAMC,UAAuEF,gBAAgBG,cAAcC,KACzGH,UAAUI,YAAY,MAAaC,WAAI,CAAA;AAGzC,IAAA,yBAAeJ;",
|
|
6
|
+
"names": ["Effect", "LayoutOperation", "Operation", "handler", "UpdateSidebar", "pipe", "withHandler", "void"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/capabilities/url-handler.ts
|
|
4
|
+
import * as Effect from "effect/Effect";
|
|
5
|
+
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
6
|
+
import { AppCapabilities, LayoutOperation, fromUrlPath, getWorkspaceFromPath, toUrlPath } from "@dxos/app-toolkit";
|
|
7
|
+
import { runAndForwardErrors } from "@dxos/effect";
|
|
8
|
+
import { log } from "@dxos/log";
|
|
9
|
+
import { isTauri } from "@dxos/util";
|
|
10
|
+
import { SimpleLayoutCapabilities } from "#types";
|
|
11
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-simple-layout/src/capabilities/url-handler.ts";
|
|
12
|
+
var url_handler_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
13
|
+
const { invokePromise } = yield* Capability.get(Capabilities.OperationInvoker);
|
|
14
|
+
const capabilities = yield* Capability.Service;
|
|
15
|
+
const dispatchNavigationHandlers = (url) => Effect.gen(function* () {
|
|
16
|
+
const handlers = yield* Capability.getAll(AppCapabilities.NavigationHandler);
|
|
17
|
+
yield* Effect.all(handlers.map((handler) => handler(url)), {
|
|
18
|
+
concurrency: "unbounded"
|
|
19
|
+
});
|
|
20
|
+
}).pipe(Effect.provideService(Capability.Service, capabilities), runAndForwardErrors);
|
|
21
|
+
const handlePathNavigation = (url) => {
|
|
22
|
+
const resolvedUrl = url ?? new URL(window.location.href);
|
|
23
|
+
void dispatchNavigationHandlers(resolvedUrl);
|
|
24
|
+
let pathname = resolvedUrl.pathname;
|
|
25
|
+
if (isFilePath(pathname)) {
|
|
26
|
+
log.info("[UrlHandler] Skipping file path (not a graph node)", {
|
|
27
|
+
pathname
|
|
28
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 34, S: this });
|
|
29
|
+
pathname = "/";
|
|
30
|
+
}
|
|
31
|
+
const qualifiedId = fromUrlPath(pathname);
|
|
32
|
+
const workspace = getWorkspaceFromPath(qualifiedId);
|
|
33
|
+
void invokePromise(LayoutOperation.SwitchWorkspace, {
|
|
34
|
+
subject: workspace
|
|
35
|
+
});
|
|
36
|
+
const activeId = qualifiedId !== workspace ? qualifiedId : void 0;
|
|
37
|
+
if (activeId) {
|
|
38
|
+
void invokePromise(LayoutOperation.Open, {
|
|
39
|
+
subject: [
|
|
40
|
+
activeId
|
|
41
|
+
]
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const onPopState = () => {
|
|
46
|
+
handlePathNavigation();
|
|
47
|
+
};
|
|
48
|
+
yield* Effect.sync(() => handlePathNavigation());
|
|
49
|
+
window.addEventListener("popstate", onPopState);
|
|
50
|
+
let unlistenDeepLink;
|
|
51
|
+
if (isTauri()) {
|
|
52
|
+
yield* Effect.tryPromise({
|
|
53
|
+
try: async () => {
|
|
54
|
+
const { getCurrent, onOpenUrl } = await import("@tauri-apps/plugin-deep-link");
|
|
55
|
+
const launchUrls = await getCurrent();
|
|
56
|
+
if (launchUrls && launchUrls.length > 0) {
|
|
57
|
+
log.info("[UrlHandler] App launched with deep links", {
|
|
58
|
+
urls: launchUrls
|
|
59
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 67, S: this });
|
|
60
|
+
for (const urlString of launchUrls) {
|
|
61
|
+
handleDeepLink(urlString, handlePathNavigation);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
unlistenDeepLink = await onOpenUrl((urls) => {
|
|
65
|
+
log.info("[UrlHandler] Deep links received", {
|
|
66
|
+
urls
|
|
67
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 75, S: this });
|
|
68
|
+
for (const urlString of urls) {
|
|
69
|
+
handleDeepLink(urlString, handlePathNavigation);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
},
|
|
73
|
+
catch: (error) => {
|
|
74
|
+
log.warn("[UrlHandler] Failed to initialize deep link listener", {
|
|
75
|
+
error
|
|
76
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 84, S: this });
|
|
77
|
+
return error;
|
|
78
|
+
}
|
|
79
|
+
}).pipe(Effect.catchAll(() => Effect.void));
|
|
80
|
+
}
|
|
81
|
+
let lastWorkspace;
|
|
82
|
+
let lastActive;
|
|
83
|
+
const unsubscribe = yield* Capabilities.subscribeAtom(SimpleLayoutCapabilities.State, (state) => {
|
|
84
|
+
const { workspace, active } = state;
|
|
85
|
+
if (workspace !== lastWorkspace || active !== lastActive) {
|
|
86
|
+
lastWorkspace = workspace;
|
|
87
|
+
lastActive = active;
|
|
88
|
+
const path = active ? toUrlPath(active) : toUrlPath(workspace);
|
|
89
|
+
if (window.location.pathname !== path) {
|
|
90
|
+
history.pushState(null, "", `${path}${window.location.search}`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
return Capability.contributes(Capabilities.Null, null, () => Effect.sync(() => {
|
|
95
|
+
window.removeEventListener("popstate", onPopState);
|
|
96
|
+
unsubscribe();
|
|
97
|
+
unlistenDeepLink?.();
|
|
98
|
+
}));
|
|
99
|
+
}));
|
|
100
|
+
var isRedirectPath = (pathname) => pathname.startsWith("/redirect/");
|
|
101
|
+
var isFilePath = (pathname) => /\.[a-z]+$/i.test(pathname);
|
|
102
|
+
var handleDeepLink = (urlString, navigate) => {
|
|
103
|
+
log.info("[UrlHandler] Deep link received", {
|
|
104
|
+
url: urlString
|
|
105
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 114, S: void 0 });
|
|
106
|
+
try {
|
|
107
|
+
const deepLinkUrl = new URL(urlString);
|
|
108
|
+
const fullPath = deepLinkUrl.protocol !== "https:" && deepLinkUrl.protocol !== "http:" && deepLinkUrl.hostname ? "/" + deepLinkUrl.hostname + deepLinkUrl.pathname : deepLinkUrl.pathname;
|
|
109
|
+
if (isRedirectPath(fullPath)) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
const current = new URL(window.location.href);
|
|
113
|
+
if (deepLinkUrl.search) {
|
|
114
|
+
deepLinkUrl.searchParams.forEach((value, key) => current.searchParams.set(key, value));
|
|
115
|
+
}
|
|
116
|
+
current.pathname = fullPath;
|
|
117
|
+
history.replaceState(null, "", current.pathname + current.search);
|
|
118
|
+
navigate(current);
|
|
119
|
+
} catch (error) {
|
|
120
|
+
log.warn("[UrlHandler] Failed to parse deep link URL", {
|
|
121
|
+
urlString,
|
|
122
|
+
error
|
|
123
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 134, S: void 0 });
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
export {
|
|
127
|
+
url_handler_default as default
|
|
128
|
+
};
|
|
129
|
+
//# sourceMappingURL=url-handler-GZXUUAHD.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/url-handler.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { AppCapabilities, LayoutOperation, fromUrlPath, getWorkspaceFromPath, toUrlPath } from '@dxos/app-toolkit';\nimport { runAndForwardErrors } from '@dxos/effect';\nimport { log } from '@dxos/log';\nimport { isTauri } from '@dxos/util';\n\nimport { SimpleLayoutCapabilities } from '#types';\n\n/**\n * URL handler for simple layout that syncs browser URL with layout state.\n * URL paths map directly to qualified graph IDs with the leading `root` segment stripped.\n * Root is represented as `/`.\n *\n * On Tauri, also listens for deep links via the deep-link plugin.\n */\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const { invokePromise } = yield* Capability.get(Capabilities.OperationInvoker);\n const capabilities = yield* Capability.Service;\n\n /** Dispatch all NavigationHandler contributions with a given URL. */\n const dispatchNavigationHandlers = (url: URL) =>\n Effect.gen(function* () {\n const handlers = yield* Capability.getAll(AppCapabilities.NavigationHandler);\n yield* Effect.all(\n handlers.map((handler) => handler(url)),\n { concurrency: 'unbounded' },\n );\n }).pipe(Effect.provideService(Capability.Service, capabilities), runAndForwardErrors);\n\n /**\n * Handle navigation from a URL.\n * Dispatches to NavigationHandler contributions, then handles pathname routing.\n */\n const handlePathNavigation = (url?: URL) => {\n const resolvedUrl = url ?? new URL(window.location.href);\n void dispatchNavigationHandlers(resolvedUrl);\n\n let pathname = resolvedUrl.pathname;\n if (isFilePath(pathname)) {\n log.info('[UrlHandler] Skipping file path (not a graph node)', { pathname });\n pathname = '/';\n }\n\n const qualifiedId = fromUrlPath(pathname);\n const workspace = getWorkspaceFromPath(qualifiedId);\n\n void invokePromise(LayoutOperation.SwitchWorkspace, { subject: workspace });\n\n const activeId = qualifiedId !== workspace ? qualifiedId : undefined;\n if (activeId) {\n void invokePromise(LayoutOperation.Open, { subject: [activeId] });\n }\n };\n\n const onPopState = () => {\n handlePathNavigation();\n };\n\n // Initial navigation.\n yield* Effect.sync(() => handlePathNavigation());\n window.addEventListener('popstate', onPopState);\n\n // Tauri deep link support.\n let unlistenDeepLink: (() => void) | undefined;\n if (isTauri()) {\n yield* Effect.tryPromise({\n try: async () => {\n const { getCurrent, onOpenUrl } = await import('@tauri-apps/plugin-deep-link');\n\n const launchUrls = await getCurrent();\n if (launchUrls && launchUrls.length > 0) {\n log.info('[UrlHandler] App launched with deep links', { urls: launchUrls });\n for (const urlString of launchUrls) {\n handleDeepLink(urlString, handlePathNavigation);\n }\n }\n\n unlistenDeepLink = await onOpenUrl((urls) => {\n log.info('[UrlHandler] Deep links received', { urls });\n for (const urlString of urls) {\n handleDeepLink(urlString, handlePathNavigation);\n }\n });\n },\n catch: (error) => {\n log.warn('[UrlHandler] Failed to initialize deep link listener', { error });\n return error;\n },\n }).pipe(Effect.catchAll(() => Effect.void));\n }\n\n // Sync URL with layout state changes.\n let lastWorkspace: string | undefined;\n let lastActive: string | undefined;\n const unsubscribe = yield* Capabilities.subscribeAtom(\n SimpleLayoutCapabilities.State,\n (state: SimpleLayoutCapabilities.SimpleLayoutState) => {\n const { workspace, active } = state;\n\n if (workspace !== lastWorkspace || active !== lastActive) {\n lastWorkspace = workspace;\n lastActive = active;\n\n const path = active ? toUrlPath(active) : toUrlPath(workspace);\n if (window.location.pathname !== path) {\n history.pushState(null, '', `${path}${window.location.search}`);\n }\n }\n },\n );\n\n return Capability.contributes(Capabilities.Null, null, () =>\n Effect.sync(() => {\n window.removeEventListener('popstate', onPopState);\n unsubscribe();\n unlistenDeepLink?.();\n }),\n );\n }),\n);\n\n/** Check if a path is a redirect path handled elsewhere (e.g., OAuth). */\nconst isRedirectPath = (pathname: string): boolean => pathname.startsWith('/redirect/');\n\n/** Paths with file extensions are not graph node paths. */\nconst isFilePath = (pathname: string): boolean => /\\.[a-z]+$/i.test(pathname);\n\n/** Handle a deep link URL string. Merges query params into window.location and navigates. */\nconst handleDeepLink = (urlString: string, navigate: (url?: URL) => void): void => {\n log.info('[UrlHandler] Deep link received', { url: urlString });\n try {\n const deepLinkUrl = new URL(urlString);\n\n // For custom schemes (e.g., composer://a/b/c), new URL() treats the first segment as the\n // hostname. Reconstruct the full path from hostname + pathname.\n const fullPath =\n deepLinkUrl.protocol !== 'https:' && deepLinkUrl.protocol !== 'http:' && deepLinkUrl.hostname\n ? '/' + deepLinkUrl.hostname + deepLinkUrl.pathname\n : deepLinkUrl.pathname;\n\n if (isRedirectPath(fullPath)) {\n return;\n }\n\n // Merge deep link query params into the current window URL so handlers can read them.\n const current = new URL(window.location.href);\n if (deepLinkUrl.search) {\n deepLinkUrl.searchParams.forEach((value, key) => current.searchParams.set(key, value));\n }\n current.pathname = fullPath;\n history.replaceState(null, '', current.pathname + current.search);\n\n navigate(current);\n } catch (error) {\n log.warn('[UrlHandler] Failed to parse deep link URL', { urlString, error });\n }\n};\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["Effect", "Capabilities", "Capability", "AppCapabilities", "LayoutOperation", "fromUrlPath", "getWorkspaceFromPath", "toUrlPath", "runAndForwardErrors", "log", "isTauri", "SimpleLayoutCapabilities", "capabilities", "Service", "dispatchNavigationHandlers", "handlers", "concurrency", "provideService", "resolvedUrl", "pathname", "isFilePath", "qualifiedId", "invokePromise", "SwitchWorkspace", "subject", "workspace", "activeId", "unlistenDeepLink", "try", "getCurrent", "launchUrls", "length", "handleDeepLink", "urlString", "handlePathNavigation", "urls", "catch", "error", "catchAll", "lastWorkspace", "active", "lastActive", "location", "history", "pushState", "path", "window", "search", "unsubscribe", "navigate", "deepLinkUrl", "searchParams", "forEach", "value", "current", "fullPath"]
|
|
7
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Plugin } from '@dxos/app-framework';
|
|
2
2
|
export type SimpleLayoutPluginOptions = {
|
|
3
|
-
/**
|
|
3
|
+
/** Determines if running in popover window context (hides mobile-specific UI). */
|
|
4
4
|
isPopover?: boolean;
|
|
5
5
|
};
|
|
6
6
|
export declare const SimpleLayoutPlugin: Plugin.PluginFactory<SimpleLayoutPluginOptions>;
|
|
7
|
+
export default SimpleLayoutPlugin;
|
|
7
8
|
//# sourceMappingURL=SimpleLayoutPlugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleLayoutPlugin.d.ts","sourceRoot":"","sources":["../../../src/SimpleLayoutPlugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAiD,MAAM,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"SimpleLayoutPlugin.d.ts","sourceRoot":"","sources":["../../../src/SimpleLayoutPlugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAiD,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAgB5F,MAAM,MAAM,yBAAyB,GAAG;IACtC,kFAAkF;IAClF,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,kBAAkB,iDA+B9B,CAAC;eAEa,kBAAkB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import { Capability } from '@dxos/app-framework';
|
|
3
|
+
import { GraphBuilder } from '@dxos/plugin-graph';
|
|
4
|
+
declare const _default: (props: void) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<GraphBuilder.BuilderExtensions>>, never, never>;
|
|
5
|
+
export default _default;
|
|
6
|
+
//# sourceMappingURL=app-graph-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-graph-builder.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/app-graph-builder.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAe,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,7 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
|
|
1
|
+
import { Capability } from '@dxos/app-framework';
|
|
2
|
+
import { OperationHandlerSet } from '@dxos/compute';
|
|
3
|
+
export declare const AppGraphBuilder: Capability.LazyCapability<void, Capability.Capability<Capability.InterfaceDef<import("@dxos/app-graph").BuilderExtensions>>, Error>;
|
|
4
|
+
export declare const OperationHandler: Capability.LazyCapability<OperationHandlerSet.OperationHandlerSet, Capability.ModuleReturn, Error>;
|
|
5
|
+
export declare const ReactRoot: Capability.LazyCapability<void, Capability.Capability<Capability.InterfaceDef<Readonly<{
|
|
6
|
+
id: string;
|
|
7
|
+
root: import("react").FC<import("react").PropsWithChildren>;
|
|
8
|
+
}>>>, Error>;
|
|
9
|
+
export declare const ReactSurface: Capability.LazyCapability<void, Capability.Capability<Capability.InterfaceDef<import("@dxos/app-framework/Capabilities").ReactSurface>>, Error>;
|
|
10
|
+
export declare const SpotlightDismiss: Capability.LazyCapability<import("./spotlight-dismiss").SpotlightDismissOptions | undefined, Capability.Capability<Capability.InterfaceDef<null>> | [], Error>;
|
|
11
|
+
export declare const State: Capability.LazyCapability<import("./state").SimpleLayoutStateOptions | undefined, [Capability.Capability<Capability.InterfaceDef<import("@effect-atom/atom/Atom").Writable<import("../types/SimpleLayoutCapabilities").SimpleLayoutState, import("../types/SimpleLayoutCapabilities").SimpleLayoutState>>>, Capability.Capability<Capability.InterfaceDef<import("@effect-atom/atom/Atom").Atom<Readonly<{
|
|
12
|
+
mode: string;
|
|
13
|
+
dialogOpen: boolean;
|
|
14
|
+
sidebarOpen: boolean;
|
|
15
|
+
complementarySidebarOpen: boolean;
|
|
16
|
+
workspace: string;
|
|
17
|
+
active: string[];
|
|
18
|
+
inactive: string[];
|
|
19
|
+
scrollIntoView: string | undefined;
|
|
20
|
+
}>>>>], Error>;
|
|
21
|
+
export declare const UrlHandler: Capability.LazyCapability<void, Capability.Capability<Capability.InterfaceDef<null>>, Error>;
|
|
7
22
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/index.ts"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD,eAAO,MAAM,eAAe,qIAA0E,CAAC;AACvG,eAAO,MAAM,gBAAgB,oGAG5B,CAAC;AACF,eAAO,MAAM,SAAS;;;YAA6D,CAAC;AACpF,eAAO,MAAM,YAAY,iJAAmE,CAAC;AAC7F,eAAO,MAAM,gBAAgB,gKAA2E,CAAC;AACzG,eAAO,MAAM,KAAK;;;;;;;;;cAAoD,CAAC;AACvE,eAAO,MAAM,UAAU,8FAA+D,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import { Capability } from '@dxos/app-framework';
|
|
3
|
+
import type { OperationHandlerSet } from '@dxos/compute';
|
|
4
|
+
declare const _default: (props: OperationHandlerSet.OperationHandlerSet) => Effect.Effect<Capability.ModuleReturn, Error, Capability.Service>;
|
|
5
|
+
export default _default;
|
|
6
|
+
//# sourceMappingURL=operation-handler.d.ts.map
|