@dxos/plugin-simple-layout 0.8.4-main.abd8ff62ef → 0.8.4-main.bc2380dfbc
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/{browser/SimpleLayoutPlugin-Q5BZE6KD.mjs → neutral/SimpleLayoutPlugin.mjs} +3 -1
- 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/{browser/index.mjs → neutral/chunk-AMTEDJHG.mjs} +5 -8
- 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 +926 -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/neutral/react-root-VE265VX4.mjs +18 -0
- package/dist/lib/neutral/react-root-VE265VX4.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-REZMYKQV.mjs +46 -0
- 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/neutral/spotlight-dismiss-EIYW5E7M.mjs +58 -0
- package/dist/lib/neutral/spotlight-dismiss-EIYW5E7M.mjs.map +7 -0
- package/dist/lib/neutral/state-7NXKBLPY.mjs +47 -0
- 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/{browser → neutral}/translations.mjs +2 -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/capabilities/index.d.ts +1 -1
- package/dist/types/src/capabilities/state.d.ts +3 -3
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/components/MobileLayout/MobileLayout.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.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/useSimpleLayoutState.d.ts +3 -3
- package/dist/types/src/hooks/useSimpleLayoutState.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -2
- 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/state-access.d.ts +3 -3
- package/dist/types/src/operations/state-access.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/types/{capabilities.d.ts → SimpleLayoutCapabilities.d.ts} +2 -8
- 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 +81 -45
- package/src/capabilities/state.tsx +5 -6
- package/src/capabilities/url-handler.ts +16 -13
- package/src/components/Home/Home.tsx +1 -1
- package/src/components/Loading/Loading.tsx +1 -1
- package/src/components/MobileLayout/MobileLayout.tsx +0 -2
- package/src/components/NavBranch/NavBranch.tsx +1 -1
- package/src/components/Popover/Popover.tsx +1 -0
- package/src/components/SimpleLayout/AppBar.tsx +42 -40
- package/src/components/SimpleLayout/SimpleLayout.stories.tsx +3 -3
- package/src/hooks/actions.ts +5 -3
- package/src/hooks/useAppBarProps.ts +2 -2
- package/src/hooks/useDrawerActions.ts +2 -2
- package/src/hooks/useNavbarActions.ts +2 -2
- package/src/hooks/useSimpleLayoutState.ts +7 -5
- package/src/index.ts +1 -6
- package/src/meta.ts +1 -0
- package/src/operations/open.ts +1 -1
- package/src/operations/state-access.ts +5 -3
- package/src/plugin.ts +11 -0
- package/src/types/{capabilities.ts → SimpleLayoutCapabilities.ts} +3 -15
- package/src/types/SimpleLayoutEvents.ts +15 -0
- package/src/types/index.ts +2 -2
- package/dist/lib/browser/SimpleLayoutPlugin-Q5BZE6KD.mjs.map +0 -7
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/translations.mjs.map +0 -7
- package/dist/lib/node-esm/SimpleLayoutPlugin-OD45TNPO.mjs +0 -52
- package/dist/lib/node-esm/index.mjs +0 -24
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/translations.mjs +0 -36
- 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/types/events.ts +0 -15
- /package/dist/lib/{node-esm/SimpleLayoutPlugin-OD45TNPO.mjs.map → neutral/SimpleLayoutPlugin.mjs.map} +0 -0
- /package/dist/lib/{node-esm → neutral}/translations.mjs.map +0 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/capabilities/spotlight-dismiss.ts
|
|
4
|
+
import * as Effect from "effect/Effect";
|
|
5
|
+
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
6
|
+
import { log } from "@dxos/log";
|
|
7
|
+
import { isTauri } from "@dxos/util";
|
|
8
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-simple-layout/src/capabilities/spotlight-dismiss.ts";
|
|
9
|
+
var getTauriWindow = () => {
|
|
10
|
+
const tauri = globalThis.__TAURI__;
|
|
11
|
+
return tauri?.window;
|
|
12
|
+
};
|
|
13
|
+
var getTauriCore = () => {
|
|
14
|
+
const tauri = globalThis.__TAURI__;
|
|
15
|
+
return tauri?.core;
|
|
16
|
+
};
|
|
17
|
+
var spotlight_dismiss_default = Capability.makeModule(({ isPopover = false } = {}) => Effect.promise(async () => {
|
|
18
|
+
if (!isPopover || !isTauri()) {
|
|
19
|
+
return [];
|
|
20
|
+
}
|
|
21
|
+
let focusCleanup;
|
|
22
|
+
try {
|
|
23
|
+
const tauriWindow = getTauriWindow();
|
|
24
|
+
const tauriCore = getTauriCore();
|
|
25
|
+
if (tauriWindow && tauriCore) {
|
|
26
|
+
const win = tauriWindow.getCurrentWindow();
|
|
27
|
+
focusCleanup = await win.onFocusChanged(async ({ payload }) => {
|
|
28
|
+
if (!payload) {
|
|
29
|
+
await tauriCore.invoke("hide_spotlight");
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
} catch (err) {
|
|
34
|
+
log.catch(err, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 44, S: void 0 });
|
|
35
|
+
}
|
|
36
|
+
const handleKeyDown = async (event) => {
|
|
37
|
+
if (event.key === "Escape") {
|
|
38
|
+
event.preventDefault();
|
|
39
|
+
try {
|
|
40
|
+
const tauriCore = getTauriCore();
|
|
41
|
+
if (tauriCore) {
|
|
42
|
+
await tauriCore.invoke("hide_spotlight");
|
|
43
|
+
}
|
|
44
|
+
} catch (err) {
|
|
45
|
+
log.catch(err, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 56, S: void 0 });
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
50
|
+
return Capability.contributes(Capabilities.Null, null, () => Effect.sync(() => {
|
|
51
|
+
focusCleanup?.();
|
|
52
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
53
|
+
}));
|
|
54
|
+
}));
|
|
55
|
+
export {
|
|
56
|
+
spotlight_dismiss_default as default
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=spotlight-dismiss-EIYW5E7M.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/spotlight-dismiss.ts"],
|
|
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;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
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/capabilities/state.tsx
|
|
4
|
+
import { Atom } from "@effect-atom/atom-react";
|
|
5
|
+
import * as Effect from "effect/Effect";
|
|
6
|
+
import { Capability } from "@dxos/app-framework";
|
|
7
|
+
import { AppCapabilities } from "@dxos/app-toolkit";
|
|
8
|
+
import { Node } from "@dxos/plugin-graph";
|
|
9
|
+
import { SimpleLayoutCapabilities } from "#types";
|
|
10
|
+
var defaultState = {
|
|
11
|
+
dialogOpen: false,
|
|
12
|
+
workspace: Node.RootId,
|
|
13
|
+
previousWorkspace: Node.RootId,
|
|
14
|
+
history: [],
|
|
15
|
+
isPopover: false,
|
|
16
|
+
companionVariant: void 0,
|
|
17
|
+
drawerState: "closed"
|
|
18
|
+
};
|
|
19
|
+
var state_default = Capability.makeModule(({ initialState } = {}) => Effect.sync(() => {
|
|
20
|
+
const stateAtom = Atom.make({
|
|
21
|
+
...defaultState,
|
|
22
|
+
...initialState
|
|
23
|
+
});
|
|
24
|
+
const layoutAtom = Atom.make((get) => {
|
|
25
|
+
const state = get(stateAtom);
|
|
26
|
+
return {
|
|
27
|
+
mode: "simple",
|
|
28
|
+
dialogOpen: state.dialogOpen,
|
|
29
|
+
sidebarOpen: false,
|
|
30
|
+
complementarySidebarOpen: false,
|
|
31
|
+
workspace: state.workspace,
|
|
32
|
+
active: state.active ? [
|
|
33
|
+
state.active
|
|
34
|
+
] : [],
|
|
35
|
+
inactive: [],
|
|
36
|
+
scrollIntoView: void 0
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
return [
|
|
40
|
+
Capability.contributes(SimpleLayoutCapabilities.State, stateAtom),
|
|
41
|
+
Capability.contributes(AppCapabilities.Layout, layoutAtom)
|
|
42
|
+
];
|
|
43
|
+
}));
|
|
44
|
+
export {
|
|
45
|
+
state_default as default
|
|
46
|
+
};
|
|
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,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
|
+
}
|
|
@@ -8,7 +8,7 @@ export declare const ReactRoot: Capability.LazyCapability<void, Capability.Capab
|
|
|
8
8
|
}>>>, Error>;
|
|
9
9
|
export declare const ReactSurface: Capability.LazyCapability<void, Capability.Capability<Capability.InterfaceDef<import("@dxos/app-framework/Capabilities").ReactSurface>>, Error>;
|
|
10
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").SimpleLayoutState, import("../types").SimpleLayoutState>>>, Capability.Capability<Capability.InterfaceDef<import("@effect-atom/atom/Atom").Atom<Readonly<{
|
|
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
12
|
mode: string;
|
|
13
13
|
dialogOpen: boolean;
|
|
14
14
|
sidebarOpen: boolean;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Atom } from '@effect-atom/atom-react';
|
|
2
2
|
import * as Effect from 'effect/Effect';
|
|
3
3
|
import { Capability } from '@dxos/app-framework';
|
|
4
|
-
import {
|
|
4
|
+
import { SimpleLayoutCapabilities } from '#types';
|
|
5
5
|
export type SimpleLayoutStateOptions = {
|
|
6
|
-
initialState?: Partial<SimpleLayoutState>;
|
|
6
|
+
initialState?: Partial<SimpleLayoutCapabilities.SimpleLayoutState>;
|
|
7
7
|
};
|
|
8
|
-
declare const _default: (props: SimpleLayoutStateOptions | undefined) => Effect.Effect<[Capability.Capability<Capability.InterfaceDef<Atom.Writable<SimpleLayoutState, SimpleLayoutState>>>, Capability.Capability<Capability.InterfaceDef<Atom.Atom<Readonly<{
|
|
8
|
+
declare const _default: (props: SimpleLayoutStateOptions | undefined) => Effect.Effect<[Capability.Capability<Capability.InterfaceDef<Atom.Writable<SimpleLayoutCapabilities.SimpleLayoutState, SimpleLayoutCapabilities.SimpleLayoutState>>>, Capability.Capability<Capability.InterfaceDef<Atom.Atom<Readonly<{
|
|
9
9
|
mode: string;
|
|
10
10
|
dialogOpen: boolean;
|
|
11
11
|
sidebarOpen: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/state.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAIjD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/state.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAIjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,QAAQ,CAAC;AAYlD,MAAM,MAAM,wBAAwB,GAAG;IACrC,YAAY,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,iBAAiB,CAAC,CAAC;CACpE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileLayout.d.ts","sourceRoot":"","sources":["../../../../../src/components/MobileLayout/MobileLayout.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAoD,MAAM,OAAO,CAAC;AAIxG,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAatD,KAAK,wBAAwB,GAAG;IAC9B,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,QAAA,MAA6B,eAAe,oDAA+D,CAAC;AAM5G,KAAK,qBAAqB,GAAG,eAAe,CAC1C,iBAAiB,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oBAAoB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CACrD,CAAC,CACH,CAAC;
|
|
1
|
+
{"version":3,"file":"MobileLayout.d.ts","sourceRoot":"","sources":["../../../../../src/components/MobileLayout/MobileLayout.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAoD,MAAM,OAAO,CAAC;AAIxG,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAatD,KAAK,wBAAwB,GAAG;IAC9B,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,QAAA,MAA6B,eAAe,oDAA+D,CAAC;AAM5G,KAAK,qBAAqB,GAAG,eAAe,CAC1C,iBAAiB,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oBAAoB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CACrD,CAAC,CACH,CAAC;AA0CF,KAAK,sBAAsB,GAAG,eAAe,CAC3C,iBAAiB,CAAC;IAChB,IAAI,CAAC,EAAE;QACL,GAAG,EAAE,OAAO,CAAC;QACb,MAAM,EAAE,OAAO,CAAC;KACjB,CAAC;CACH,CAAC,CACH,CAAC;AA6BF,eAAO,MAAM,YAAY;IACvB,IAAI;qBAlFW,MAAM;+BACI,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI;;;;IAkFrD,KAAK;eApCI;YACL,GAAG,EAAE,OAAO,CAAC;YACb,MAAM,EAAE,OAAO,CAAC;SACjB;;;;CAkCJ,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,YAAY,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../../../../../src/components/Popover/Popover.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAqD,MAAM,OAAO,CAAC;AAkBzG,eAAO,MAAM,WAAW,iBAAkB,iBAAiB,sBA+B1D,CAAC;AAEF,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../../../../../src/components/Popover/Popover.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAqD,MAAM,OAAO,CAAC;AAkBzG,eAAO,MAAM,WAAW,iBAAkB,iBAAiB,sBA+B1D,CAAC;AAEF,eAAO,MAAM,cAAc,yBAoE1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppBar.d.ts","sourceRoot":"","sources":["../../../../../src/components/SimpleLayout/AppBar.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAgB,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,gBAAgB,EAAwB,MAAM,qBAAqB,CAAC;AASvG,MAAM,MAAM,WAAW,GAAG;IACxB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACrC,uCAAuC;IACvC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kDAAkD;IAClD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,MAAM;;
|
|
1
|
+
{"version":3,"file":"AppBar.d.ts","sourceRoot":"","sources":["../../../../../src/components/SimpleLayout/AppBar.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAgB,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,gBAAgB,EAAwB,MAAM,qBAAqB,CAAC;AASvG,MAAM,MAAM,WAAW,GAAG;IACxB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACrC,uCAAuC;IACvC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kDAAkD;IAClD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,MAAM;;2HA0DlB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Atom } from '@effect-atom/atom-react';
|
|
2
2
|
import { type AppCapabilities } from '@dxos/app-toolkit';
|
|
3
3
|
import { type ActionGraphProps } from '@dxos/react-ui-menu';
|
|
4
|
-
import {
|
|
4
|
+
import { SimpleLayoutCapabilities } from '#types';
|
|
5
5
|
export declare const PLANK_COMPANION_TYPE = "org.dxos.plugin.deck.plank-companion";
|
|
6
6
|
export type CompanionActionsConfig = {
|
|
7
7
|
/** Prefix for companion action IDs (e.g. 'navbar' or 'drawer') */
|
|
@@ -9,11 +9,11 @@ export type CompanionActionsConfig = {
|
|
|
9
9
|
/** Optional: highlight companion with this variant */
|
|
10
10
|
selectedVariant?: string;
|
|
11
11
|
/** State updater for toggling the drawer. */
|
|
12
|
-
updateState: (fn: (state: SimpleLayoutState) => SimpleLayoutState) => void;
|
|
12
|
+
updateState: (fn: (state: SimpleLayoutCapabilities.SimpleLayoutState) => SimpleLayoutCapabilities.SimpleLayoutState) => void;
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
15
|
* Creates action graph nodes and edges for companion actions.
|
|
16
16
|
* Shared logic between useNavbarActions and useDrawerActions.
|
|
17
17
|
*/
|
|
18
|
-
export declare const createCompanionActions: (graph: AppCapabilities.AppGraph['graph'], stateAtom: Atom.Atom<SimpleLayoutState>, get: (atom: Atom.Atom<any>) => any, config: CompanionActionsConfig) => Pick<ActionGraphProps, 'nodes' | 'edges'>;
|
|
18
|
+
export declare const createCompanionActions: (graph: AppCapabilities.AppGraph['graph'], stateAtom: Atom.Atom<SimpleLayoutCapabilities.SimpleLayoutState>, get: (atom: Atom.Atom<any>) => any, config: CompanionActionsConfig) => Pick<ActionGraphProps, 'nodes' | 'edges'>;
|
|
19
19
|
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../../src/hooks/actions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAGpD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGzD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../../src/hooks/actions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAGpD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGzD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,QAAQ,CAAC;AAGlD,eAAO,MAAM,oBAAoB,yCAAyC,CAAC;AAE3E,MAAM,MAAM,sBAAsB,GAAG;IACnC,kEAAkE;IAClE,QAAQ,EAAE,MAAM,CAAC;IACjB,sDAAsD;IACtD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,6CAA6C;IAC7C,WAAW,EAAE,CACX,EAAE,EAAE,CAAC,KAAK,EAAE,wBAAwB,CAAC,iBAAiB,KAAK,wBAAwB,CAAC,iBAAiB,KAClG,IAAI,CAAC;CACX,CAAC;AAEF;;;GAGG;AAEH,eAAO,MAAM,sBAAsB,UAC1B,eAAe,CAAC,QAAQ,CAAC,OAAO,CAAC,aAC7B,IAAI,CAAC,IAAI,CAAC,wBAAwB,CAAC,iBAAiB,CAAC,OAC3D,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,UAC1B,sBAAsB,KAC7B,IAAI,CAAC,gBAAgB,EAAE,OAAO,GAAG,OAAO,CA8C1C,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SimpleLayoutCapabilities } from '#types';
|
|
2
2
|
export type UseSimpleLayoutState = {
|
|
3
|
-
state: SimpleLayoutState;
|
|
4
|
-
updateState: (fn: (current: SimpleLayoutState) => SimpleLayoutState) => void;
|
|
3
|
+
state: SimpleLayoutCapabilities.SimpleLayoutState;
|
|
4
|
+
updateState: (fn: (current: SimpleLayoutCapabilities.SimpleLayoutState) => SimpleLayoutCapabilities.SimpleLayoutState) => void;
|
|
5
5
|
};
|
|
6
6
|
export declare const useSimpleLayoutState: () => UseSimpleLayoutState;
|
|
7
7
|
//# sourceMappingURL=useSimpleLayoutState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSimpleLayoutState.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useSimpleLayoutState.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"useSimpleLayoutState.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useSimpleLayoutState.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,wBAAwB,EAAE,MAAM,QAAQ,CAAC;AAElD,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,wBAAwB,CAAC,iBAAiB,CAAC;IAClD,WAAW,EAAE,CACX,EAAE,EAAE,CAAC,OAAO,EAAE,wBAAwB,CAAC,iBAAiB,KAAK,wBAAwB,CAAC,iBAAiB,KACpG,IAAI,CAAC;CACX,CAAC;AAEF,eAAO,MAAM,oBAAoB,QAAO,oBAavC,CAAC"}
|