@dxos/plugin-simple-layout 0.8.4-main.d05673bc65 → 0.8.4-main.effb148878
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +102 -5
- package/dist/lib/neutral/SimpleLayoutPlugin.mjs +52 -0
- package/dist/lib/neutral/SimpleLayoutPlugin.mjs.map +7 -0
- package/dist/lib/neutral/app-graph-builder-EYQKLRRP.mjs +21 -0
- package/dist/lib/neutral/app-graph-builder-EYQKLRRP.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +21 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-5LQGH5KW.mjs +20 -0
- package/dist/lib/neutral/chunk-5LQGH5KW.mjs.map +7 -0
- package/dist/lib/neutral/chunk-7UDV3JDT.mjs +22 -0
- package/dist/lib/neutral/chunk-7UDV3JDT.mjs.map +7 -0
- package/dist/lib/neutral/chunk-FD2CAY4Q.mjs +26 -0
- package/dist/lib/neutral/chunk-FD2CAY4Q.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/neutral/chunk-Y2QR5SYD.mjs +8 -0
- package/dist/lib/neutral/chunk-Y2QR5SYD.mjs.map +7 -0
- package/dist/lib/neutral/close-WKMURGUB.mjs +35 -0
- package/dist/lib/neutral/close-WKMURGUB.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +928 -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-PEVXNVTV.mjs +51 -0
- package/dist/lib/neutral/open-PEVXNVTV.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-EAIE7KPR.mjs +13 -0
- package/dist/lib/neutral/operation-handler-EAIE7KPR.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/operations/index.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/{browser/react-root-WVQYY2JA.mjs → neutral/react-root-VE265VX4.mjs} +5 -8
- package/dist/lib/neutral/react-root-VE265VX4.mjs.map +7 -0
- package/dist/lib/{browser/react-surface-VLBR37ED.mjs → neutral/react-surface-YHXOHJI7.mjs} +16 -14
- package/dist/lib/neutral/react-surface-YHXOHJI7.mjs.map +7 -0
- package/dist/lib/neutral/revert-workspace-ST6NZUNG.mjs +22 -0
- package/dist/lib/neutral/revert-workspace-ST6NZUNG.mjs.map +7 -0
- package/dist/lib/neutral/set-6ZRLWPJS.mjs +22 -0
- package/dist/lib/neutral/set-6ZRLWPJS.mjs.map +7 -0
- package/dist/lib/neutral/set-layout-mode-L22HRCKS.mjs +13 -0
- package/dist/lib/neutral/set-layout-mode-L22HRCKS.mjs.map +7 -0
- package/dist/lib/{browser/spotlight-dismiss-67PHYS5B.mjs → neutral/spotlight-dismiss-EIYW5E7M.mjs} +7 -15
- package/dist/lib/{node-esm/spotlight-dismiss-RMLRZUVY.mjs.map → neutral/spotlight-dismiss-EIYW5E7M.mjs.map} +3 -3
- package/dist/lib/{browser/state-TXSMUWYI.mjs → neutral/state-7NXKBLPY.mjs} +5 -6
- package/dist/lib/neutral/state-7NXKBLPY.mjs.map +7 -0
- package/dist/lib/neutral/switch-workspace-PYWPTMFO.mjs +25 -0
- package/dist/lib/neutral/switch-workspace-PYWPTMFO.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +36 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +10 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/lib/neutral/update-complementary-HKWF5OXT.mjs +33 -0
- package/dist/lib/neutral/update-complementary-HKWF5OXT.mjs.map +7 -0
- package/dist/lib/neutral/update-dialog-P4ASXCE7.mjs +30 -0
- package/dist/lib/neutral/update-dialog-P4ASXCE7.mjs.map +7 -0
- package/dist/lib/neutral/update-popover-REAKC2GN.mjs +34 -0
- package/dist/lib/neutral/update-popover-REAKC2GN.mjs.map +7 -0
- package/dist/lib/neutral/update-sidebar-O5SQPR6Q.mjs +12 -0
- package/dist/lib/neutral/update-sidebar-O5SQPR6Q.mjs.map +7 -0
- package/dist/lib/neutral/url-handler-GZXUUAHD.mjs +129 -0
- package/dist/lib/neutral/url-handler-GZXUUAHD.mjs.map +7 -0
- package/dist/types/src/SimpleLayoutPlugin.d.ts +2 -1
- package/dist/types/src/SimpleLayoutPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +21 -6
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/{spotlight-dismiss/spotlight-dismiss.d.ts → spotlight-dismiss.d.ts} +1 -1
- package/dist/types/src/capabilities/spotlight-dismiss.d.ts.map +1 -0
- package/dist/types/src/capabilities/{state/state.d.ts → state.d.ts} +3 -3
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/{url-handler/url-handler.d.ts → url-handler.d.ts} +1 -1
- package/dist/types/src/capabilities/url-handler.d.ts.map +1 -0
- package/dist/types/src/components/ContentError.stories.d.ts +26 -19
- package/dist/types/src/components/ContentError.stories.d.ts.map +1 -1
- package/dist/types/src/components/DebugOverlay/DebugOverlay.d.ts +19 -0
- package/dist/types/src/components/DebugOverlay/DebugOverlay.d.ts.map +1 -0
- package/dist/types/src/components/DebugOverlay/index.d.ts +2 -0
- package/dist/types/src/components/DebugOverlay/index.d.ts.map +1 -0
- package/dist/types/src/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/types/src/components/Home/Home.d.ts.map +1 -1
- package/dist/types/src/components/Loading/Loading.d.ts +3 -0
- package/dist/types/src/components/Loading/Loading.d.ts.map +1 -0
- package/dist/types/src/components/{ContentLoading/ContentLoading.stories.d.ts → Loading/Loading.stories.d.ts} +1 -1
- package/dist/types/src/components/Loading/Loading.stories.d.ts.map +1 -0
- package/dist/types/src/components/Loading/index.d.ts +2 -0
- package/dist/types/src/components/Loading/index.d.ts.map +1 -0
- package/dist/types/src/components/MobileLayout/MobileLayout.d.ts +2 -2
- package/dist/types/src/components/MobileLayout/MobileLayout.d.ts.map +1 -1
- package/dist/types/src/components/MobileLayout/MobileLayout.stories.d.ts.map +1 -1
- package/dist/types/src/components/NavBranch/NavBranch.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/AppBar.d.ts +5 -7
- package/dist/types/src/components/SimpleLayout/AppBar.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/AppBar.stories.d.ts +29 -22
- package/dist/types/src/components/SimpleLayout/AppBar.stories.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/Drawer.d.ts +4 -7
- package/dist/types/src/components/SimpleLayout/Drawer.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/Main.d.ts +4 -7
- package/dist/types/src/components/SimpleLayout/Main.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/NavBar.d.ts +5 -7
- package/dist/types/src/components/SimpleLayout/NavBar.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/NavBar.stories.d.ts +29 -23
- package/dist/types/src/components/SimpleLayout/NavBar.stories.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/SimpleLayout.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/SimpleLayout.stories.d.ts +26 -25
- package/dist/types/src/components/SimpleLayout/SimpleLayout.stories.d.ts.map +1 -1
- package/dist/types/src/components/hooks.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/actions.d.ts +3 -3
- package/dist/types/src/hooks/actions.d.ts.map +1 -1
- package/dist/types/src/hooks/useAppBarProps.d.ts +2 -2
- package/dist/types/src/hooks/useAppBarProps.d.ts.map +1 -1
- package/dist/types/src/hooks/useCompanions.d.ts.map +1 -1
- package/dist/types/src/hooks/useDrawerActions.d.ts.map +1 -1
- package/dist/types/src/hooks/useSimpleLayoutState.d.ts +3 -3
- package/dist/types/src/hooks/useSimpleLayoutState.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/close.d.ts +5 -0
- package/dist/types/src/operations/close.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/open.d.ts +5 -0
- package/dist/types/src/operations/open.d.ts.map +1 -0
- package/dist/types/src/operations/revert-workspace.d.ts +5 -0
- package/dist/types/src/operations/revert-workspace.d.ts.map +1 -0
- package/dist/types/src/operations/set-layout-mode.d.ts +5 -0
- package/dist/types/src/operations/set-layout-mode.d.ts.map +1 -0
- package/dist/types/src/operations/set.d.ts +5 -0
- package/dist/types/src/operations/set.d.ts.map +1 -0
- package/dist/types/src/operations/state-access.d.ts +8 -0
- package/dist/types/src/operations/state-access.d.ts.map +1 -0
- package/dist/types/src/operations/switch-workspace.d.ts +5 -0
- package/dist/types/src/operations/switch-workspace.d.ts.map +1 -0
- package/dist/types/src/operations/update-complementary.d.ts +5 -0
- package/dist/types/src/operations/update-complementary.d.ts.map +1 -0
- package/dist/types/src/operations/update-dialog.d.ts +5 -0
- package/dist/types/src/operations/update-dialog.d.ts.map +1 -0
- package/dist/types/src/operations/update-popover.d.ts +5 -0
- package/dist/types/src/operations/update-popover.d.ts.map +1 -0
- package/dist/types/src/operations/update-sidebar.d.ts +5 -0
- package/dist/types/src/operations/update-sidebar.d.ts.map +1 -0
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +26 -20
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/{capabilities.d.ts → SimpleLayoutCapabilities.d.ts} +12 -10
- package/dist/types/src/types/SimpleLayoutCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/SimpleLayoutEvents.d.ts +4 -0
- package/dist/types/src/types/SimpleLayoutEvents.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +89 -35
- package/src/SimpleLayoutPlugin.ts +19 -8
- package/src/capabilities/app-graph-builder.ts +21 -0
- package/src/capabilities/index.ts +13 -6
- package/src/capabilities/operation-handler.ts +14 -0
- package/src/capabilities/{react-root/react-root.tsx → react-root.tsx} +2 -2
- package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +13 -6
- package/src/capabilities/{state/state.tsx → state.tsx} +5 -6
- package/src/capabilities/url-handler.ts +164 -0
- package/src/components/ContentError.stories.tsx +1 -1
- package/src/components/DebugOverlay/DebugOverlay.tsx +96 -0
- package/src/components/DebugOverlay/index.ts +5 -0
- package/src/components/Dialog/Dialog.tsx +14 -3
- package/src/components/Home/Home.tsx +31 -31
- package/src/components/{ContentLoading/ContentLoading.stories.tsx → Loading/Loading.stories.tsx} +4 -4
- package/src/components/{ContentLoading/ContentLoading.tsx → Loading/Loading.tsx} +2 -2
- package/src/components/{ContentLoading → Loading}/index.ts +1 -1
- package/src/components/MobileLayout/MobileLayout.stories.tsx +21 -17
- package/src/components/MobileLayout/MobileLayout.tsx +118 -51
- package/src/components/NavBranch/NavBranch.tsx +27 -33
- package/src/components/Popover/Popover.tsx +14 -19
- package/src/components/SimpleLayout/AppBar.stories.tsx +10 -10
- package/src/components/SimpleLayout/AppBar.tsx +63 -60
- package/src/components/SimpleLayout/Drawer.tsx +30 -22
- package/src/components/SimpleLayout/Main.tsx +19 -23
- package/src/components/SimpleLayout/NavBar.stories.tsx +2 -2
- package/src/components/SimpleLayout/NavBar.tsx +8 -9
- package/src/components/SimpleLayout/SimpleLayout.stories.tsx +46 -69
- package/src/components/SimpleLayout/SimpleLayout.tsx +33 -34
- package/src/components/hooks.ts +1 -1
- package/src/components/index.ts +2 -1
- package/src/hooks/actions.ts +9 -6
- package/src/hooks/useAppBarProps.ts +9 -29
- package/src/hooks/useDrawerActions.ts +7 -7
- package/src/hooks/useNavbarActions.ts +4 -4
- package/src/hooks/useSimpleLayoutState.ts +7 -5
- package/src/index.ts +2 -1
- package/src/meta.ts +3 -1
- package/src/operations/close.ts +34 -0
- package/src/operations/index.ts +16 -0
- package/src/operations/open.ts +65 -0
- package/src/operations/revert-workspace.ts +22 -0
- package/src/operations/set-layout-mode.ts +12 -0
- package/src/operations/set.ts +23 -0
- package/src/operations/state-access.ts +21 -0
- package/src/operations/switch-workspace.ts +26 -0
- package/src/operations/update-complementary.ts +35 -0
- package/src/operations/update-dialog.ts +28 -0
- package/src/operations/update-popover.ts +35 -0
- package/src/operations/update-sidebar.ts +12 -0
- package/src/plugin.ts +11 -0
- package/src/translations.ts +21 -19
- package/src/types/{capabilities.ts → SimpleLayoutCapabilities.ts} +6 -18
- package/src/types/SimpleLayoutEvents.ts +15 -0
- package/src/types/index.ts +2 -2
- package/dist/lib/browser/chunk-MDPEKLKR.mjs +0 -1163
- package/dist/lib/browser/chunk-MDPEKLKR.mjs.map +0 -7
- package/dist/lib/browser/chunk-MRR7PXSM.mjs +0 -29
- package/dist/lib/browser/chunk-MRR7PXSM.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -101
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/operation-resolver-VTZ6HZ4B.mjs +0 -194
- package/dist/lib/browser/operation-resolver-VTZ6HZ4B.mjs.map +0 -7
- package/dist/lib/browser/react-root-WVQYY2JA.mjs.map +0 -7
- package/dist/lib/browser/react-surface-VLBR37ED.mjs.map +0 -7
- package/dist/lib/browser/spotlight-dismiss-67PHYS5B.mjs.map +0 -7
- package/dist/lib/browser/state-TXSMUWYI.mjs.map +0 -7
- package/dist/lib/browser/url-handler-RBRONH7S.mjs +0 -151
- package/dist/lib/browser/url-handler-RBRONH7S.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DCKASLMP.mjs +0 -1164
- package/dist/lib/node-esm/chunk-DCKASLMP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-WMNTJ2MK.mjs +0 -31
- package/dist/lib/node-esm/chunk-WMNTJ2MK.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -102
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/operation-resolver-R7CQ6ERU.mjs +0 -195
- package/dist/lib/node-esm/operation-resolver-R7CQ6ERU.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-XBNDM7BE.mjs +0 -22
- package/dist/lib/node-esm/react-root-XBNDM7BE.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-U5NHA367.mjs +0 -45
- package/dist/lib/node-esm/react-surface-U5NHA367.mjs.map +0 -7
- package/dist/lib/node-esm/spotlight-dismiss-RMLRZUVY.mjs +0 -68
- package/dist/lib/node-esm/state-JMX6FAG4.mjs +0 -49
- package/dist/lib/node-esm/state-JMX6FAG4.mjs.map +0 -7
- package/dist/lib/node-esm/url-handler-QSMCH3JB.mjs +0 -152
- package/dist/lib/node-esm/url-handler-QSMCH3JB.mjs.map +0 -7
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-root/index.d.ts +0 -6
- package/dist/types/src/capabilities/react-root/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-root/react-root.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/spotlight-dismiss/index.d.ts +0 -3
- package/dist/types/src/capabilities/spotlight-dismiss/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/spotlight-dismiss/spotlight-dismiss.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/index.d.ts +0 -13
- package/dist/types/src/capabilities/state/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/state.d.ts.map +0 -1
- package/dist/types/src/capabilities/url-handler/index.d.ts +0 -3
- package/dist/types/src/capabilities/url-handler/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/url-handler/url-handler.d.ts.map +0 -1
- package/dist/types/src/components/ContentLoading/ContentLoading.d.ts +0 -3
- package/dist/types/src/components/ContentLoading/ContentLoading.d.ts.map +0 -1
- package/dist/types/src/components/ContentLoading/ContentLoading.stories.d.ts.map +0 -1
- package/dist/types/src/components/ContentLoading/index.d.ts +0 -2
- package/dist/types/src/components/ContentLoading/index.d.ts.map +0 -1
- package/dist/types/src/types/capabilities.d.ts.map +0 -1
- package/dist/types/src/types/events.d.ts +0 -6
- package/dist/types/src/types/events.d.ts.map +0 -1
- package/src/capabilities/operation-resolver/index.ts +0 -10
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -202
- package/src/capabilities/react-root/index.ts +0 -7
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/spotlight-dismiss/index.ts +0 -7
- package/src/capabilities/state/index.ts +0 -9
- package/src/capabilities/url-handler/index.ts +0 -7
- package/src/capabilities/url-handler/url-handler.ts +0 -133
- package/src/types/events.ts +0 -15
- /package/dist/types/src/capabilities/{react-root/react-root.d.ts → react-root.d.ts} +0 -0
- /package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
- /package/src/capabilities/{spotlight-dismiss/spotlight-dismiss.ts → spotlight-dismiss.ts} +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Copyright 2025 DXOS.org
|
|
2
|
+
|
|
3
|
+
import * as Effect from 'effect/Effect';
|
|
4
|
+
|
|
5
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
6
|
+
import { Operation } from '@dxos/compute';
|
|
7
|
+
|
|
8
|
+
import { layoutStateAccess } from './state-access';
|
|
9
|
+
|
|
10
|
+
const handler: Operation.WithHandler<typeof LayoutOperation.RevertWorkspace> = LayoutOperation.RevertWorkspace.pipe(
|
|
11
|
+
Operation.withHandler(
|
|
12
|
+
Effect.fnUntraced(function* () {
|
|
13
|
+
const { getState } = yield* layoutStateAccess;
|
|
14
|
+
const state = getState();
|
|
15
|
+
yield* Operation.invoke(LayoutOperation.SwitchWorkspace, {
|
|
16
|
+
subject: state.previousWorkspace,
|
|
17
|
+
});
|
|
18
|
+
}),
|
|
19
|
+
),
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
export default handler;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Copyright 2025 DXOS.org
|
|
2
|
+
|
|
3
|
+
import * as Effect from 'effect/Effect';
|
|
4
|
+
|
|
5
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
6
|
+
import { Operation } from '@dxos/compute';
|
|
7
|
+
|
|
8
|
+
const handler: Operation.WithHandler<typeof LayoutOperation.SetLayoutMode> = LayoutOperation.SetLayoutMode.pipe(
|
|
9
|
+
Operation.withHandler(Effect.fnUntraced(function* () {})),
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
export default handler;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Copyright 2025 DXOS.org
|
|
2
|
+
|
|
3
|
+
import * as Effect from 'effect/Effect';
|
|
4
|
+
|
|
5
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
6
|
+
import { Operation } from '@dxos/compute';
|
|
7
|
+
|
|
8
|
+
import { layoutStateAccess } from './state-access';
|
|
9
|
+
|
|
10
|
+
const handler: Operation.WithHandler<typeof LayoutOperation.Set> = LayoutOperation.Set.pipe(
|
|
11
|
+
Operation.withHandler(
|
|
12
|
+
Effect.fnUntraced(function* (input) {
|
|
13
|
+
const { updateState } = yield* layoutStateAccess;
|
|
14
|
+
|
|
15
|
+
updateState((state) => ({
|
|
16
|
+
...state,
|
|
17
|
+
active: input.subject[0],
|
|
18
|
+
}));
|
|
19
|
+
}),
|
|
20
|
+
),
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
export default handler;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Copyright 2025 DXOS.org
|
|
2
|
+
|
|
3
|
+
import * as Effect from 'effect/Effect';
|
|
4
|
+
|
|
5
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { SimpleLayoutCapabilities } from '../types';
|
|
8
|
+
|
|
9
|
+
export const layoutStateAccess = Effect.gen(function* () {
|
|
10
|
+
const registry = yield* Capability.get(Capabilities.AtomRegistry);
|
|
11
|
+
const stateAtom = yield* Capability.get(SimpleLayoutCapabilities.State);
|
|
12
|
+
|
|
13
|
+
return {
|
|
14
|
+
getState: () => registry.get(stateAtom),
|
|
15
|
+
updateState: (
|
|
16
|
+
fn: (current: SimpleLayoutCapabilities.SimpleLayoutState) => SimpleLayoutCapabilities.SimpleLayoutState,
|
|
17
|
+
) => {
|
|
18
|
+
registry.set(stateAtom, fn(registry.get(stateAtom)));
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Copyright 2025 DXOS.org
|
|
2
|
+
|
|
3
|
+
import * as Effect from 'effect/Effect';
|
|
4
|
+
|
|
5
|
+
import { isPinnedWorkspace, LayoutOperation } from '@dxos/app-toolkit';
|
|
6
|
+
import { Operation } from '@dxos/compute';
|
|
7
|
+
|
|
8
|
+
import { layoutStateAccess } from './state-access';
|
|
9
|
+
|
|
10
|
+
const handler: Operation.WithHandler<typeof LayoutOperation.SwitchWorkspace> = LayoutOperation.SwitchWorkspace.pipe(
|
|
11
|
+
Operation.withHandler(
|
|
12
|
+
Effect.fnUntraced(function* (input) {
|
|
13
|
+
const { updateState } = yield* layoutStateAccess;
|
|
14
|
+
|
|
15
|
+
updateState((state) => ({
|
|
16
|
+
...state,
|
|
17
|
+
previousWorkspace: !isPinnedWorkspace(state.workspace) ? state.workspace : state.previousWorkspace,
|
|
18
|
+
workspace: input.subject,
|
|
19
|
+
active: undefined,
|
|
20
|
+
history: [],
|
|
21
|
+
}));
|
|
22
|
+
}),
|
|
23
|
+
),
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
export default handler;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Copyright 2025 DXOS.org
|
|
2
|
+
|
|
3
|
+
import * as Effect from 'effect/Effect';
|
|
4
|
+
|
|
5
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
6
|
+
import { Operation } from '@dxos/compute';
|
|
7
|
+
import { getLinkedVariant } from '@dxos/react-ui-attention';
|
|
8
|
+
|
|
9
|
+
import { layoutStateAccess } from './state-access';
|
|
10
|
+
|
|
11
|
+
const handler: Operation.WithHandler<typeof LayoutOperation.UpdateComplementary> =
|
|
12
|
+
LayoutOperation.UpdateComplementary.pipe(
|
|
13
|
+
Operation.withHandler(
|
|
14
|
+
Effect.fnUntraced(function* (input) {
|
|
15
|
+
const { updateState } = yield* layoutStateAccess;
|
|
16
|
+
|
|
17
|
+
if (input.state === 'closed') {
|
|
18
|
+
updateState((state) => ({
|
|
19
|
+
...state,
|
|
20
|
+
drawerState: 'closed',
|
|
21
|
+
companionVariant: undefined,
|
|
22
|
+
}));
|
|
23
|
+
} else if (input.subject) {
|
|
24
|
+
const variant = getLinkedVariant(input.subject);
|
|
25
|
+
updateState((state) => ({
|
|
26
|
+
...state,
|
|
27
|
+
companionVariant: variant,
|
|
28
|
+
drawerState: input.state === 'expanded' ? 'expanded' : 'open',
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
}),
|
|
32
|
+
),
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
export default handler;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Copyright 2025 DXOS.org
|
|
2
|
+
|
|
3
|
+
import * as Effect from 'effect/Effect';
|
|
4
|
+
|
|
5
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
6
|
+
import { Operation } from '@dxos/compute';
|
|
7
|
+
|
|
8
|
+
import { layoutStateAccess } from './state-access';
|
|
9
|
+
|
|
10
|
+
const handler: Operation.WithHandler<typeof LayoutOperation.UpdateDialog> = LayoutOperation.UpdateDialog.pipe(
|
|
11
|
+
Operation.withHandler(
|
|
12
|
+
Effect.fnUntraced(function* (input) {
|
|
13
|
+
const { updateState } = yield* layoutStateAccess;
|
|
14
|
+
|
|
15
|
+
updateState((state) => ({
|
|
16
|
+
...state,
|
|
17
|
+
dialogOpen: input.state ?? Boolean(input.subject),
|
|
18
|
+
dialogType: input.type ?? 'default',
|
|
19
|
+
dialogBlockAlign: input.blockAlign ?? 'center',
|
|
20
|
+
dialogOverlayClasses: input.overlayClasses,
|
|
21
|
+
dialogOverlayStyle: input.overlayStyle,
|
|
22
|
+
dialogContent: input.subject ? { component: input.subject, props: input.props } : undefined,
|
|
23
|
+
}));
|
|
24
|
+
}),
|
|
25
|
+
),
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
export default handler;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Copyright 2025 DXOS.org
|
|
2
|
+
|
|
3
|
+
import * as Effect from 'effect/Effect';
|
|
4
|
+
|
|
5
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
6
|
+
import { Operation } from '@dxos/compute';
|
|
7
|
+
|
|
8
|
+
import { layoutStateAccess } from './state-access';
|
|
9
|
+
|
|
10
|
+
const handler: Operation.WithHandler<typeof LayoutOperation.UpdatePopover> = LayoutOperation.UpdatePopover.pipe(
|
|
11
|
+
Operation.withHandler(
|
|
12
|
+
Effect.fnUntraced(function* (input) {
|
|
13
|
+
const { updateState } = yield* layoutStateAccess;
|
|
14
|
+
|
|
15
|
+
updateState((state) => ({
|
|
16
|
+
...state,
|
|
17
|
+
popoverOpen: input.state ?? Boolean(input.subject),
|
|
18
|
+
popoverKind: input.kind ?? 'base',
|
|
19
|
+
popoverTitle: input.kind === 'card' ? input.title : undefined,
|
|
20
|
+
popoverContent:
|
|
21
|
+
typeof input.subject === 'string'
|
|
22
|
+
? { component: input.subject, props: input.props }
|
|
23
|
+
: input.subject
|
|
24
|
+
? { subject: input.subject }
|
|
25
|
+
: undefined,
|
|
26
|
+
popoverSide: input.side,
|
|
27
|
+
popoverVariant: input.variant,
|
|
28
|
+
popoverAnchor: input.variant === 'virtual' ? input.anchor : state.popoverAnchor,
|
|
29
|
+
popoverAnchorId: input.variant !== 'virtual' ? input.anchorId : state.popoverAnchorId,
|
|
30
|
+
}));
|
|
31
|
+
}),
|
|
32
|
+
),
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
export default handler;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Copyright 2025 DXOS.org
|
|
2
|
+
|
|
3
|
+
import * as Effect from 'effect/Effect';
|
|
4
|
+
|
|
5
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
6
|
+
import { Operation } from '@dxos/compute';
|
|
7
|
+
|
|
8
|
+
const handler: Operation.WithHandler<typeof LayoutOperation.UpdateSidebar> = LayoutOperation.UpdateSidebar.pipe(
|
|
9
|
+
Operation.withHandler(() => Effect.void),
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
export default handler;
|
package/src/plugin.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { meta } from './meta';
|
|
8
|
+
|
|
9
|
+
export const SimpleLayoutPlugin = Plugin.lazy(meta, () => import('#plugin'));
|
|
10
|
+
|
|
11
|
+
export { SimpleLayoutOperationHandlerSet } from './operations';
|
package/src/translations.ts
CHANGED
|
@@ -3,31 +3,33 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type Resource } from '@dxos/react-ui';
|
|
6
|
+
import { translations as searchTranslations } from '@dxos/react-ui-search/translations';
|
|
6
7
|
|
|
7
|
-
import { meta } from '
|
|
8
|
+
import { meta } from '#meta';
|
|
8
9
|
|
|
9
10
|
export const translations = [
|
|
11
|
+
...searchTranslations,
|
|
10
12
|
{
|
|
11
13
|
'en-US': {
|
|
12
14
|
[meta.id]: {
|
|
13
|
-
'plugin
|
|
14
|
-
'settings
|
|
15
|
-
'workspaces
|
|
16
|
-
'settings
|
|
17
|
-
'back
|
|
18
|
-
'browse
|
|
19
|
-
'notifications
|
|
20
|
-
'profile
|
|
21
|
-
'app
|
|
22
|
-
'main
|
|
23
|
-
'companions
|
|
24
|
-
'error
|
|
25
|
-
'
|
|
26
|
-
'drawer
|
|
27
|
-
'
|
|
28
|
-
'
|
|
29
|
-
'
|
|
30
|
-
'
|
|
15
|
+
'plugin.name': 'Simple layout',
|
|
16
|
+
'settings.title': 'Simple layout settings',
|
|
17
|
+
'workspaces.heading': 'Workspaces',
|
|
18
|
+
'settings.heading': 'Settings',
|
|
19
|
+
'back.label': 'Back',
|
|
20
|
+
'browse.label': 'Browse',
|
|
21
|
+
'notifications.label': 'Notifications',
|
|
22
|
+
'profile.label': 'Profile',
|
|
23
|
+
'app-menu.label': 'App menu',
|
|
24
|
+
'main-menu.label': 'Main menu',
|
|
25
|
+
'companions-menu.label': 'Companions',
|
|
26
|
+
'error-fallback.message': 'An error occurred',
|
|
27
|
+
'drawer.label': 'Drawer',
|
|
28
|
+
'close-drawer.label': 'Close drawer',
|
|
29
|
+
'expand-drawer.label': 'Expand drawer',
|
|
30
|
+
'collapse-drawer.label': 'Collapse drawer',
|
|
31
|
+
'actions-menu.label': 'Actions',
|
|
32
|
+
'done.label': 'Done',
|
|
31
33
|
},
|
|
32
34
|
},
|
|
33
35
|
},
|
|
@@ -2,32 +2,28 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
5
7
|
import { type Atom } from '@effect-atom/atom-react';
|
|
6
8
|
|
|
7
9
|
import { Capability } from '@dxos/app-framework';
|
|
8
10
|
import { type Label } from '@dxos/react-ui';
|
|
9
11
|
|
|
10
|
-
import { meta } from '
|
|
12
|
+
import { meta } from '#meta';
|
|
11
13
|
|
|
12
14
|
export type DrawerState = 'closed' | 'open' | 'expanded';
|
|
13
15
|
|
|
14
|
-
// TODO(wittjosiah): Handle toasts.
|
|
15
16
|
export type SimpleLayoutState = {
|
|
16
|
-
/** Data to be passed to the main content Surface. */
|
|
17
17
|
content?: any;
|
|
18
|
-
|
|
19
18
|
previousWorkspace: string;
|
|
20
19
|
workspace: string;
|
|
21
20
|
active?: string;
|
|
22
|
-
|
|
23
21
|
dialogOpen: boolean;
|
|
24
22
|
dialogType?: 'default' | 'alert';
|
|
25
23
|
dialogBlockAlign?: 'start' | 'center' | 'end';
|
|
26
24
|
dialogOverlayClasses?: string;
|
|
27
25
|
dialogOverlayStyle?: Record<string, any>;
|
|
28
|
-
|
|
29
|
-
dialogContent?: any;
|
|
30
|
-
|
|
26
|
+
dialogContent?: { component: string; props?: any } | null;
|
|
31
27
|
popoverOpen?: boolean;
|
|
32
28
|
popoverSide?: 'top' | 'right' | 'bottom' | 'left';
|
|
33
29
|
popoverVariant?: 'virtual' | 'react';
|
|
@@ -35,19 +31,11 @@ export type SimpleLayoutState = {
|
|
|
35
31
|
popoverAnchorId?: string;
|
|
36
32
|
popoverKind?: 'base' | 'card';
|
|
37
33
|
popoverTitle?: Label;
|
|
38
|
-
popoverContent?: any;
|
|
39
|
-
|
|
40
|
-
/** Bottom drawer state. */
|
|
34
|
+
popoverContent?: { component: string; props?: any } | { subject: any } | null;
|
|
41
35
|
drawerState: DrawerState;
|
|
42
|
-
|
|
43
|
-
/** Stack of previously active item IDs for back navigation. */
|
|
44
36
|
history: string[];
|
|
45
|
-
|
|
46
|
-
/** Whether running in popover window context (hides mobile-specific UI). */
|
|
47
37
|
isPopover?: boolean;
|
|
48
|
-
|
|
49
|
-
/** Variant of the companion to display in the drawer (e.g., "comments", "assistant-chat"). */
|
|
50
38
|
companionVariant?: string;
|
|
51
39
|
};
|
|
52
40
|
|
|
53
|
-
export const
|
|
41
|
+
export const State = Capability.make<Atom.Writable<SimpleLayoutState>>(`${meta.id}.state`);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
7
|
+
import { type ActivationEvent } from '@dxos/app-framework';
|
|
8
|
+
import { AppActivationEvents } from '@dxos/app-toolkit';
|
|
9
|
+
|
|
10
|
+
import * as SimpleLayoutCapabilities from './SimpleLayoutCapabilities';
|
|
11
|
+
|
|
12
|
+
/** Fired when State capability is ready. */
|
|
13
|
+
export const StateReady: ActivationEvent.ActivationEvent = AppActivationEvents.createStateEvent(
|
|
14
|
+
SimpleLayoutCapabilities.State.identifier,
|
|
15
|
+
);
|
package/src/types/index.ts
CHANGED