@dxos/plugin-simple-layout 0.8.4-main.6fa680abb7 → 0.8.4-main.7996785055
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{chunk-MDPEKLKR.mjs → chunk-J5FQ32AV.mjs} +302 -209
- package/dist/lib/browser/chunk-J5FQ32AV.mjs.map +7 -0
- package/dist/lib/browser/chunk-XJVW3PRY.mjs +22 -0
- package/dist/lib/browser/chunk-XJVW3PRY.mjs.map +7 -0
- package/dist/lib/browser/close-OT5JOGVY.mjs +34 -0
- package/dist/lib/browser/close-OT5JOGVY.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +23 -22
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/open-4FQ44Z5G.mjs +31 -0
- package/dist/lib/browser/open-4FQ44Z5G.mjs.map +7 -0
- package/dist/lib/browser/operation-handler-OAD7LISD.mjs +16 -0
- package/dist/lib/browser/operation-handler-OAD7LISD.mjs.map +7 -0
- package/dist/lib/browser/{react-root-WVQYY2JA.mjs → react-root-6KIGPLUT.mjs} +2 -2
- package/dist/lib/browser/{react-surface-VLBR37ED.mjs → react-surface-JLIEQGOL.mjs} +2 -2
- package/dist/lib/browser/revert-workspace-DLE265AN.mjs +21 -0
- package/dist/lib/browser/revert-workspace-DLE265AN.mjs.map +7 -0
- package/dist/lib/browser/set-52HGTSH4.mjs +21 -0
- package/dist/lib/browser/set-52HGTSH4.mjs.map +7 -0
- package/dist/lib/browser/set-layout-mode-T6QI3DGU.mjs +11 -0
- package/dist/lib/browser/set-layout-mode-T6QI3DGU.mjs.map +7 -0
- package/dist/lib/browser/switch-workspace-5Y6T4BWJ.mjs +24 -0
- package/dist/lib/browser/switch-workspace-5Y6T4BWJ.mjs.map +7 -0
- package/dist/lib/browser/update-complementary-MX3TTVAB.mjs +31 -0
- package/dist/lib/browser/update-complementary-MX3TTVAB.mjs.map +7 -0
- package/dist/lib/browser/update-dialog-FPAPZXKO.mjs +29 -0
- package/dist/lib/browser/update-dialog-FPAPZXKO.mjs.map +7 -0
- package/dist/lib/browser/update-popover-6V5ZTIYN.mjs +33 -0
- package/dist/lib/browser/update-popover-6V5ZTIYN.mjs.map +7 -0
- package/dist/lib/browser/update-sidebar-WHDKYMV7.mjs +10 -0
- package/dist/lib/browser/update-sidebar-WHDKYMV7.mjs.map +7 -0
- package/dist/lib/browser/{url-handler-RBRONH7S.mjs → url-handler-GUJ3L7Y3.mjs} +24 -12
- package/dist/lib/browser/url-handler-GUJ3L7Y3.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-27K22G6S.mjs +23 -0
- package/dist/lib/node-esm/chunk-27K22G6S.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-DCKASLMP.mjs → chunk-EXNDYZTP.mjs} +302 -209
- package/dist/lib/node-esm/chunk-EXNDYZTP.mjs.map +7 -0
- package/dist/lib/node-esm/close-PEVHREL2.mjs +35 -0
- package/dist/lib/node-esm/close-PEVHREL2.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +23 -22
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/open-LMJY7JCJ.mjs +32 -0
- package/dist/lib/node-esm/open-LMJY7JCJ.mjs.map +7 -0
- package/dist/lib/node-esm/operation-handler-A2DC4WHC.mjs +18 -0
- package/dist/lib/node-esm/operation-handler-A2DC4WHC.mjs.map +7 -0
- package/dist/lib/node-esm/{react-root-XBNDM7BE.mjs → react-root-5SCW2KTH.mjs} +2 -2
- package/dist/lib/node-esm/{react-surface-U5NHA367.mjs → react-surface-WLKB6AET.mjs} +2 -2
- package/dist/lib/node-esm/revert-workspace-XZXT64YA.mjs +22 -0
- package/dist/lib/node-esm/revert-workspace-XZXT64YA.mjs.map +7 -0
- package/dist/lib/node-esm/set-5I6LFH5L.mjs +22 -0
- package/dist/lib/node-esm/set-5I6LFH5L.mjs.map +7 -0
- package/dist/lib/node-esm/set-layout-mode-F5B6QLZM.mjs +13 -0
- package/dist/lib/node-esm/set-layout-mode-F5B6QLZM.mjs.map +7 -0
- package/dist/lib/node-esm/switch-workspace-PB6T2SGY.mjs +25 -0
- package/dist/lib/node-esm/switch-workspace-PB6T2SGY.mjs.map +7 -0
- package/dist/lib/node-esm/update-complementary-FTW423IY.mjs +32 -0
- package/dist/lib/node-esm/update-complementary-FTW423IY.mjs.map +7 -0
- package/dist/lib/node-esm/update-dialog-ID267DCL.mjs +30 -0
- package/dist/lib/node-esm/update-dialog-ID267DCL.mjs.map +7 -0
- package/dist/lib/node-esm/update-popover-RLHU2HF4.mjs +34 -0
- package/dist/lib/node-esm/update-popover-RLHU2HF4.mjs.map +7 -0
- package/dist/lib/node-esm/update-sidebar-BJ7HTNZ4.mjs +12 -0
- package/dist/lib/node-esm/update-sidebar-BJ7HTNZ4.mjs.map +7 -0
- package/dist/lib/node-esm/{url-handler-QSMCH3JB.mjs → url-handler-WMONO2T6.mjs} +24 -12
- package/dist/lib/node-esm/url-handler-WMONO2T6.mjs.map +7 -0
- package/dist/types/src/SimpleLayoutPlugin.d.ts +1 -1
- package/dist/types/src/SimpleLayoutPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +1 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler/index.d.ts +4 -0
- package/dist/types/src/capabilities/operation-handler/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/url-handler/url-handler.d.ts.map +1 -1
- package/dist/types/src/components/ContentError.stories.d.ts +6 -1
- package/dist/types/src/components/ContentError.stories.d.ts.map +1 -1
- package/dist/types/src/components/DebugOverlay/DebugOverlay.d.ts +19 -0
- package/dist/types/src/components/DebugOverlay/DebugOverlay.d.ts.map +1 -0
- package/dist/types/src/components/DebugOverlay/index.d.ts +2 -0
- package/dist/types/src/components/DebugOverlay/index.d.ts.map +1 -0
- package/dist/types/src/components/Home/Home.d.ts.map +1 -1
- package/dist/types/src/components/Loading/Loading.d.ts +3 -0
- package/dist/types/src/components/Loading/Loading.d.ts.map +1 -0
- package/dist/types/src/components/{ContentLoading/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.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 +9 -7
- package/dist/types/src/components/SimpleLayout/AppBar.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/AppBar.stories.d.ts +9 -4
- package/dist/types/src/components/SimpleLayout/AppBar.stories.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/Main.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/NavBar.d.ts +9 -7
- package/dist/types/src/components/SimpleLayout/NavBar.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/NavBar.stories.d.ts +13 -5
- 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 +10 -11
- package/dist/types/src/components/SimpleLayout/SimpleLayout.stories.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/operations/close.d.ts +5 -0
- package/dist/types/src/operations/close.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/open.d.ts +5 -0
- package/dist/types/src/operations/open.d.ts.map +1 -0
- package/dist/types/src/operations/revert-workspace.d.ts +5 -0
- package/dist/types/src/operations/revert-workspace.d.ts.map +1 -0
- package/dist/types/src/operations/set-layout-mode.d.ts +5 -0
- package/dist/types/src/operations/set-layout-mode.d.ts.map +1 -0
- package/dist/types/src/operations/set.d.ts +5 -0
- package/dist/types/src/operations/set.d.ts.map +1 -0
- package/dist/types/src/operations/state-access.d.ts +8 -0
- package/dist/types/src/operations/state-access.d.ts.map +1 -0
- package/dist/types/src/operations/switch-workspace.d.ts +5 -0
- package/dist/types/src/operations/switch-workspace.d.ts.map +1 -0
- package/dist/types/src/operations/update-complementary.d.ts +5 -0
- package/dist/types/src/operations/update-complementary.d.ts.map +1 -0
- package/dist/types/src/operations/update-dialog.d.ts +5 -0
- package/dist/types/src/operations/update-dialog.d.ts.map +1 -0
- package/dist/types/src/operations/update-popover.d.ts +5 -0
- package/dist/types/src/operations/update-popover.d.ts.map +1 -0
- package/dist/types/src/operations/update-sidebar.d.ts +5 -0
- package/dist/types/src/operations/update-sidebar.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +6 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +29 -29
- package/src/SimpleLayoutPlugin.ts +3 -3
- package/src/capabilities/index.ts +1 -1
- package/src/capabilities/operation-handler/index.ts +9 -0
- package/src/capabilities/operation-handler/operation-handler.ts +14 -0
- package/src/capabilities/url-handler/url-handler.ts +15 -3
- package/src/components/DebugOverlay/DebugOverlay.tsx +96 -0
- package/src/components/DebugOverlay/index.ts +5 -0
- package/src/components/Home/Home.tsx +27 -28
- package/src/components/{ContentLoading/ContentLoading.stories.tsx → Loading/Loading.stories.tsx} +4 -4
- package/src/components/{ContentLoading/ContentLoading.tsx → Loading/Loading.tsx} +1 -1
- package/src/components/{ContentLoading → Loading}/index.ts +1 -1
- package/src/components/MobileLayout/MobileLayout.stories.tsx +10 -6
- package/src/components/MobileLayout/MobileLayout.tsx +118 -49
- package/src/components/NavBranch/NavBranch.tsx +27 -30
- package/src/components/Popover/Popover.tsx +2 -12
- package/src/components/SimpleLayout/AppBar.stories.tsx +3 -3
- package/src/components/SimpleLayout/AppBar.tsx +58 -59
- package/src/components/SimpleLayout/Drawer.tsx +6 -6
- package/src/components/SimpleLayout/Main.tsx +15 -19
- package/src/components/SimpleLayout/NavBar.tsx +8 -9
- package/src/components/SimpleLayout/SimpleLayout.stories.tsx +41 -64
- package/src/components/SimpleLayout/SimpleLayout.tsx +29 -30
- package/src/components/index.ts +2 -1
- package/src/hooks/useAppBarProps.ts +6 -6
- package/src/hooks/useDrawerActions.ts +1 -1
- package/src/operations/close.ts +34 -0
- package/src/operations/index.ts +16 -0
- package/src/operations/open.ts +32 -0
- package/src/operations/revert-workspace.ts +22 -0
- package/src/operations/set-layout-mode.ts +12 -0
- package/src/operations/set.ts +23 -0
- package/src/operations/state-access.ts +19 -0
- package/src/operations/switch-workspace.ts +26 -0
- package/src/operations/update-complementary.ts +34 -0
- package/src/operations/update-dialog.ts +28 -0
- package/src/operations/update-popover.ts +35 -0
- package/src/operations/update-sidebar.ts +12 -0
- package/src/translations.ts +2 -1
- package/dist/lib/browser/chunk-MDPEKLKR.mjs.map +0 -7
- 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/url-handler-RBRONH7S.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DCKASLMP.mjs.map +0 -7
- 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/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/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/src/capabilities/operation-resolver/index.ts +0 -10
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -202
- /package/dist/lib/browser/{react-root-WVQYY2JA.mjs.map → react-root-6KIGPLUT.mjs.map} +0 -0
- /package/dist/lib/browser/{react-surface-VLBR37ED.mjs.map → react-surface-JLIEQGOL.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-root-XBNDM7BE.mjs.map → react-root-5SCW2KTH.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-surface-U5NHA367.mjs.map → react-surface-WLKB6AET.mjs.map} +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
layoutStateAccess
|
|
3
|
+
} from "./chunk-XJVW3PRY.mjs";
|
|
4
|
+
import "./chunk-MRR7PXSM.mjs";
|
|
5
|
+
|
|
6
|
+
// src/operations/update-complementary.ts
|
|
7
|
+
import * as Effect from "effect/Effect";
|
|
8
|
+
import { getCompanionVariant, LayoutOperation } from "@dxos/app-toolkit";
|
|
9
|
+
import { Operation } from "@dxos/operation";
|
|
10
|
+
var handler = LayoutOperation.UpdateComplementary.pipe(Operation.withHandler(Effect.fnUntraced(function* (input) {
|
|
11
|
+
const { updateState } = yield* layoutStateAccess;
|
|
12
|
+
if (input.state === "closed") {
|
|
13
|
+
updateState((state) => ({
|
|
14
|
+
...state,
|
|
15
|
+
drawerState: "closed",
|
|
16
|
+
companionVariant: void 0
|
|
17
|
+
}));
|
|
18
|
+
} else if (input.subject) {
|
|
19
|
+
const variant = getCompanionVariant(input.subject);
|
|
20
|
+
updateState((state) => ({
|
|
21
|
+
...state,
|
|
22
|
+
companionVariant: variant,
|
|
23
|
+
drawerState: input.state === "expanded" ? "expanded" : "open"
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
})));
|
|
27
|
+
var update_complementary_default = handler;
|
|
28
|
+
export {
|
|
29
|
+
update_complementary_default as default
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=update-complementary-MX3TTVAB.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 { getCompanionVariant, LayoutOperation } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/operation';\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 = getCompanionVariant(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,qBAAqBC,uBAAuB;AACrD,SAASC,iBAAiB;AAI1B,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,oBAAoBT,MAAMO,OAAO;AACjDN,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", "getCompanionVariant", "LayoutOperation", "Operation", "handler", "LayoutOperation", "UpdateComplementary", "pipe", "Operation", "withHandler", "fnUntraced", "input", "updateState", "layoutStateAccess", "state", "drawerState", "companionVariant", "undefined", "subject", "variant", "getCompanionVariant"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
layoutStateAccess
|
|
3
|
+
} from "./chunk-XJVW3PRY.mjs";
|
|
4
|
+
import "./chunk-MRR7PXSM.mjs";
|
|
5
|
+
|
|
6
|
+
// src/operations/update-dialog.ts
|
|
7
|
+
import * as Effect from "effect/Effect";
|
|
8
|
+
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
9
|
+
import { Operation } from "@dxos/operation";
|
|
10
|
+
var handler = LayoutOperation.UpdateDialog.pipe(Operation.withHandler(Effect.fnUntraced(function* (input) {
|
|
11
|
+
const { updateState } = yield* layoutStateAccess;
|
|
12
|
+
updateState((state) => ({
|
|
13
|
+
...state,
|
|
14
|
+
dialogOpen: input.state ?? Boolean(input.subject),
|
|
15
|
+
dialogType: input.type ?? "default",
|
|
16
|
+
dialogBlockAlign: input.blockAlign ?? "center",
|
|
17
|
+
dialogOverlayClasses: input.overlayClasses,
|
|
18
|
+
dialogOverlayStyle: input.overlayStyle,
|
|
19
|
+
dialogContent: input.subject ? {
|
|
20
|
+
component: input.subject,
|
|
21
|
+
props: input.props
|
|
22
|
+
} : void 0
|
|
23
|
+
}));
|
|
24
|
+
})));
|
|
25
|
+
var update_dialog_default = handler;
|
|
26
|
+
export {
|
|
27
|
+
update_dialog_default as default
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=update-dialog-FPAPZXKO.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/operation';\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,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
layoutStateAccess
|
|
3
|
+
} from "./chunk-XJVW3PRY.mjs";
|
|
4
|
+
import "./chunk-MRR7PXSM.mjs";
|
|
5
|
+
|
|
6
|
+
// src/operations/update-popover.ts
|
|
7
|
+
import * as Effect from "effect/Effect";
|
|
8
|
+
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
9
|
+
import { Operation } from "@dxos/operation";
|
|
10
|
+
var handler = LayoutOperation.UpdatePopover.pipe(Operation.withHandler(Effect.fnUntraced(function* (input) {
|
|
11
|
+
const { updateState } = yield* layoutStateAccess;
|
|
12
|
+
updateState((state) => ({
|
|
13
|
+
...state,
|
|
14
|
+
popoverOpen: input.state ?? Boolean(input.subject),
|
|
15
|
+
popoverKind: input.kind ?? "base",
|
|
16
|
+
popoverTitle: input.kind === "card" ? input.title : void 0,
|
|
17
|
+
popoverContent: typeof input.subject === "string" ? {
|
|
18
|
+
component: input.subject,
|
|
19
|
+
props: input.props
|
|
20
|
+
} : input.subject ? {
|
|
21
|
+
subject: input.subject
|
|
22
|
+
} : void 0,
|
|
23
|
+
popoverSide: input.side,
|
|
24
|
+
popoverVariant: input.variant,
|
|
25
|
+
popoverAnchor: input.variant === "virtual" ? input.anchor : state.popoverAnchor,
|
|
26
|
+
popoverAnchorId: input.variant !== "virtual" ? input.anchorId : state.popoverAnchorId
|
|
27
|
+
}));
|
|
28
|
+
})));
|
|
29
|
+
var update_popover_default = handler;
|
|
30
|
+
export {
|
|
31
|
+
update_popover_default as default
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=update-popover-6V5ZTIYN.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/operation';\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,10 @@
|
|
|
1
|
+
// src/operations/update-sidebar.ts
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
4
|
+
import { Operation } from "@dxos/operation";
|
|
5
|
+
var handler = LayoutOperation.UpdateSidebar.pipe(Operation.withHandler(() => Effect.void));
|
|
6
|
+
var update_sidebar_default = handler;
|
|
7
|
+
export {
|
|
8
|
+
update_sidebar_default as default
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=update-sidebar-WHDKYMV7.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/operation';\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,UAAuEC,gBAAgBC,cAAcC,KACzGC,UAAUC,YAAY,MAAaC,WAAI,CAAA;AAGzC,IAAA,yBAAeN;",
|
|
6
|
+
"names": ["Effect", "LayoutOperation", "Operation", "handler", "LayoutOperation", "UpdateSidebar", "pipe", "Operation", "withHandler", "void"]
|
|
7
|
+
}
|
|
@@ -10,24 +10,35 @@ import { log } from "@dxos/log";
|
|
|
10
10
|
import { isTauri } from "@dxos/util";
|
|
11
11
|
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-simple-layout/src/capabilities/url-handler/url-handler.ts";
|
|
12
12
|
var url_handler_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
13
|
-
const {
|
|
13
|
+
const { invokePromise } = yield* Capability.get(Capabilities.OperationInvoker);
|
|
14
14
|
const handlePathNavigation = (pathname) => {
|
|
15
|
+
if (isFilePath(pathname)) {
|
|
16
|
+
log.info("[UrlHandler] Skipping file path (not a graph node)", {
|
|
17
|
+
pathname
|
|
18
|
+
}, {
|
|
19
|
+
F: __dxlog_file,
|
|
20
|
+
L: 31,
|
|
21
|
+
S: this,
|
|
22
|
+
C: (f, a) => f(...a)
|
|
23
|
+
});
|
|
24
|
+
pathname = "/";
|
|
25
|
+
}
|
|
15
26
|
log.info("[UrlHandler] Navigating to path", {
|
|
16
27
|
pathname
|
|
17
28
|
}, {
|
|
18
29
|
F: __dxlog_file,
|
|
19
|
-
L:
|
|
30
|
+
L: 35,
|
|
20
31
|
S: this,
|
|
21
32
|
C: (f, a) => f(...a)
|
|
22
33
|
});
|
|
23
34
|
const qualifiedId = fromUrlPath(pathname);
|
|
24
35
|
const workspace = getWorkspaceFromPath(qualifiedId);
|
|
25
|
-
|
|
36
|
+
void invokePromise(LayoutOperation.SwitchWorkspace, {
|
|
26
37
|
subject: workspace
|
|
27
38
|
});
|
|
28
39
|
const activeId = qualifiedId !== workspace ? qualifiedId : void 0;
|
|
29
40
|
if (activeId) {
|
|
30
|
-
|
|
41
|
+
void invokePromise(LayoutOperation.Open, {
|
|
31
42
|
subject: [
|
|
32
43
|
activeId
|
|
33
44
|
]
|
|
@@ -48,7 +59,7 @@ var url_handler_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
|
48
59
|
urls: launchUrls
|
|
49
60
|
}, {
|
|
50
61
|
F: __dxlog_file,
|
|
51
|
-
L:
|
|
62
|
+
L: 61,
|
|
52
63
|
S: this,
|
|
53
64
|
C: (f, a) => f(...a)
|
|
54
65
|
});
|
|
@@ -61,7 +72,7 @@ var url_handler_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
|
61
72
|
urls
|
|
62
73
|
}, {
|
|
63
74
|
F: __dxlog_file,
|
|
64
|
-
L:
|
|
75
|
+
L: 68,
|
|
65
76
|
S: this,
|
|
66
77
|
C: (f, a) => f(...a)
|
|
67
78
|
});
|
|
@@ -71,7 +82,7 @@ var url_handler_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
|
71
82
|
});
|
|
72
83
|
log.info("[UrlHandler] Deep link listener initialized", void 0, {
|
|
73
84
|
F: __dxlog_file,
|
|
74
|
-
L:
|
|
85
|
+
L: 74,
|
|
75
86
|
S: this,
|
|
76
87
|
C: (f, a) => f(...a)
|
|
77
88
|
});
|
|
@@ -81,7 +92,7 @@ var url_handler_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
|
81
92
|
error
|
|
82
93
|
}, {
|
|
83
94
|
F: __dxlog_file,
|
|
84
|
-
L:
|
|
95
|
+
L: 77,
|
|
85
96
|
S: this,
|
|
86
97
|
C: (f, a) => f(...a)
|
|
87
98
|
});
|
|
@@ -109,13 +120,14 @@ var url_handler_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
|
109
120
|
}));
|
|
110
121
|
}));
|
|
111
122
|
var isRedirectPath = (pathname) => pathname.startsWith("/redirect/");
|
|
123
|
+
var isFilePath = (pathname) => /\.[a-z]+$/i.test(pathname);
|
|
112
124
|
var handleNavigation = (navigate) => () => navigate(window.location.pathname);
|
|
113
125
|
var handleDeepLink = (urlString, navigate) => {
|
|
114
126
|
log.info("[UrlHandler] Deep link received", {
|
|
115
127
|
url: urlString
|
|
116
128
|
}, {
|
|
117
129
|
F: __dxlog_file,
|
|
118
|
-
L:
|
|
130
|
+
L: 134,
|
|
119
131
|
S: void 0,
|
|
120
132
|
C: (f, a) => f(...a)
|
|
121
133
|
});
|
|
@@ -126,7 +138,7 @@ var handleDeepLink = (urlString, navigate) => {
|
|
|
126
138
|
pathname: url.pathname
|
|
127
139
|
}, {
|
|
128
140
|
F: __dxlog_file,
|
|
129
|
-
L:
|
|
141
|
+
L: 138,
|
|
130
142
|
S: void 0,
|
|
131
143
|
C: (f, a) => f(...a)
|
|
132
144
|
});
|
|
@@ -139,7 +151,7 @@ var handleDeepLink = (urlString, navigate) => {
|
|
|
139
151
|
error
|
|
140
152
|
}, {
|
|
141
153
|
F: __dxlog_file,
|
|
142
|
-
L:
|
|
154
|
+
L: 143,
|
|
143
155
|
S: void 0,
|
|
144
156
|
C: (f, a) => f(...a)
|
|
145
157
|
});
|
|
@@ -148,4 +160,4 @@ var handleDeepLink = (urlString, navigate) => {
|
|
|
148
160
|
export {
|
|
149
161
|
url_handler_default as default
|
|
150
162
|
};
|
|
151
|
-
//# sourceMappingURL=url-handler-
|
|
163
|
+
//# sourceMappingURL=url-handler-GUJ3L7Y3.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/url-handler/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 { LayoutOperation, fromUrlPath, getWorkspaceFromPath, toUrlPath } from '@dxos/app-toolkit';\nimport { log } from '@dxos/log';\nimport { isTauri } from '@dxos/util';\n\nimport { type SimpleLayoutState, SimpleLayoutState as SimpleLayoutStateCapability } 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 mobile 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\n /**\n * Handle navigation from a pathname.\n * Restores the qualified graph ID and dispatches layout operations.\n */\n const handlePathNavigation = (pathname: string) => {\n if (isFilePath(pathname)) {\n log.info('[UrlHandler] Skipping file path (not a graph node)', { pathname });\n pathname = '/';\n }\n\n log.info('[UrlHandler] Navigating to path', { pathname });\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 onNavigation = handleNavigation(handlePathNavigation);\n\n yield* Effect.sync(() => onNavigation());\n window.addEventListener('popstate', onNavigation);\n\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 url of launchUrls) {\n handleDeepLink(url, handlePathNavigation);\n }\n }\n\n unlistenDeepLink = await onOpenUrl((urls) => {\n log.info('[UrlHandler] Deep links received', { urls });\n for (const url of urls) {\n handleDeepLink(url, handlePathNavigation);\n }\n });\n\n log.info('[UrlHandler] Deep link listener initialized');\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 let lastWorkspace: string | undefined;\n let lastActive: string | undefined;\n const unsubscribe = yield* Capabilities.subscribeAtom(SimpleLayoutStateCapability, (state: 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 return Capability.contributes(Capabilities.Null, null, () =>\n Effect.sync(() => {\n window.removeEventListener('popstate', onNavigation);\n unsubscribe();\n unlistenDeepLink?.();\n }),\n );\n }),\n);\n\n/**\n * Check if a path is a special redirect path that shouldn't be navigated to.\n * These paths are handled by other systems (e.g., OAuth).\n */\nconst isRedirectPath = (pathname: string): boolean => pathname.startsWith('/redirect/');\n\n/**\n * Paths with file extensions (e.g., `/iframe.html`) are not graph node paths.\n * This guards against embedded contexts like Storybook iframes interpreting\n * the host pathname as a navigation target.\n */\nconst isFilePath = (pathname: string): boolean => /\\.[a-z]+$/i.test(pathname);\n\n/**\n * Returns a handler for navigation events (initial load and popstate) that navigates to current pathname.\n */\nconst handleNavigation =\n (navigate: (pathname: string) => void): (() => void) =>\n () =>\n navigate(window.location.pathname);\n\n/**\n * Handle deep link URL from Tauri. Parses the URL and calls navigate unless it's a redirect path.\n */\nconst handleDeepLink = (urlString: string, navigate: (pathname: string) => void): void => {\n log.info('[UrlHandler] Deep link received', { url: urlString });\n try {\n const url = new URL(urlString);\n if (isRedirectPath(url.pathname)) {\n log.info('[UrlHandler] Skipping redirect path (handled elsewhere)', { pathname: url.pathname });\n return;\n }\n navigate(url.pathname);\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", "LayoutOperation", "fromUrlPath", "getWorkspaceFromPath", "toUrlPath", "log", "isTauri", "Capability", "makeModule", "fnUntraced", "invokePromise", "get", "Capabilities", "OperationInvoker", "handlePathNavigation", "pathname", "isFilePath", "log", "info", "qualifiedId", "fromUrlPath", "workspace", "getWorkspaceFromPath", "LayoutOperation", "SwitchWorkspace", "subject", "activeId", "undefined", "Open", "onNavigation", "handleNavigation", "sync", "window", "addEventListener", "unlistenDeepLink", "isTauri", "tryPromise", "try", "getCurrent", "onOpenUrl", "launchUrls", "length", "urls", "url", "handleDeepLink", "catch", "error", "warn", "pipe", "catchAll", "void", "lastWorkspace", "lastActive", "unsubscribe", "subscribeAtom", "SimpleLayoutStateCapability", "state", "active", "path", "toUrlPath", "location", "history", "pushState", "search", "contributes", "Null", "removeEventListener", "isRedirectPath", "startsWith", "test", "navigate", "urlString", "URL"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
SimpleLayoutState
|
|
4
|
+
} from "./chunk-WMNTJ2MK.mjs";
|
|
5
|
+
|
|
6
|
+
// src/operations/state-access.ts
|
|
7
|
+
import * as Effect from "effect/Effect";
|
|
8
|
+
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
9
|
+
var layoutStateAccess = Effect.gen(function* () {
|
|
10
|
+
const registry = yield* Capability.get(Capabilities.AtomRegistry);
|
|
11
|
+
const stateAtom = yield* Capability.get(SimpleLayoutState);
|
|
12
|
+
return {
|
|
13
|
+
getState: () => registry.get(stateAtom),
|
|
14
|
+
updateState: (fn) => {
|
|
15
|
+
registry.set(stateAtom, fn(registry.get(stateAtom)));
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export {
|
|
21
|
+
layoutStateAccess
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=chunk-27K22G6S.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/state-access.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright 2025 DXOS.org\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\n\nimport { type SimpleLayoutState, SimpleLayoutState as SimpleLayoutStateCapability } from '../types';\n\nexport const layoutStateAccess = Effect.gen(function* () {\n const registry = yield* Capability.get(Capabilities.AtomRegistry);\n const stateAtom = yield* Capability.get(SimpleLayoutStateCapability);\n\n return {\n getState: () => registry.get(stateAtom),\n updateState: (fn: (current: SimpleLayoutState) => SimpleLayoutState) => {\n registry.set(stateAtom, fn(registry.get(stateAtom)));\n },\n };\n});\n"],
|
|
5
|
+
"mappings": ";;;;;;AAEA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AAIlC,IAAMC,oBAA2BC,WAAI,aAAA;AAC1C,QAAMC,WAAW,OAAOC,WAAWC,IAAIC,aAAaC,YAAY;AAChE,QAAMC,YAAY,OAAOJ,WAAWC,IAAII,iBAAAA;AAExC,SAAO;IACLC,UAAU,MAAMP,SAASE,IAAIG,SAAAA;IAC7BG,aAAa,CAACC,OAAAA;AACZT,eAASU,IAAIL,WAAWI,GAAGT,SAASE,IAAIG,SAAAA,CAAAA,CAAAA;IAC1C;EACF;AACF,CAAA;",
|
|
6
|
+
"names": ["Effect", "Capabilities", "Capability", "layoutStateAccess", "gen", "registry", "Capability", "get", "Capabilities", "AtomRegistry", "stateAtom", "SimpleLayoutStateCapability", "getState", "updateState", "fn", "set"]
|
|
7
|
+
}
|