@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-simple-layout",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.7996785055",
|
|
4
4
|
"description": "Simple layout plugin for minimal UI contexts like popover windows.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -31,45 +31,45 @@
|
|
|
31
31
|
"@radix-ui/react-context": "1.1.1",
|
|
32
32
|
"@tauri-apps/plugin-deep-link": "^2.2.0",
|
|
33
33
|
"@tauri-apps/plugin-haptics": "^2.3.2",
|
|
34
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
35
|
-
"@dxos/
|
|
36
|
-
"@dxos/
|
|
37
|
-
"@dxos/log": "0.8.4-main.
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/react-ui-
|
|
42
|
-
"@dxos/react-ui-
|
|
43
|
-
"@dxos/react-ui-attention": "0.8.4-main.
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
34
|
+
"@dxos/app-framework": "0.8.4-main.7996785055",
|
|
35
|
+
"@dxos/echo": "0.8.4-main.7996785055",
|
|
36
|
+
"@dxos/async": "0.8.4-main.7996785055",
|
|
37
|
+
"@dxos/log": "0.8.4-main.7996785055",
|
|
38
|
+
"@dxos/plugin-graph": "0.8.4-main.7996785055",
|
|
39
|
+
"@dxos/react-ui-menu": "0.8.4-main.7996785055",
|
|
40
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.7996785055",
|
|
41
|
+
"@dxos/react-ui-search": "0.8.4-main.7996785055",
|
|
42
|
+
"@dxos/react-ui-stack": "0.8.4-main.7996785055",
|
|
43
|
+
"@dxos/react-ui-attention": "0.8.4-main.7996785055",
|
|
44
|
+
"@dxos/schema": "0.8.4-main.7996785055",
|
|
45
|
+
"@dxos/util": "0.8.4-main.7996785055",
|
|
46
|
+
"@dxos/operation": "0.8.4-main.7996785055",
|
|
47
|
+
"@dxos/app-toolkit": "0.8.4-main.7996785055"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/react": "~19.2.7",
|
|
51
51
|
"@types/react-dom": "~19.2.3",
|
|
52
|
-
"effect": "3.
|
|
52
|
+
"effect": "3.20.0",
|
|
53
53
|
"react": "~19.2.3",
|
|
54
54
|
"react-dom": "~19.2.3",
|
|
55
55
|
"vite": "^7.1.11",
|
|
56
|
-
"@dxos/app-graph": "0.8.4-main.
|
|
57
|
-
"@dxos/plugin-client": "0.8.4-main.
|
|
58
|
-
"@dxos/plugin-preview": "0.8.4-main.
|
|
59
|
-
"@dxos/plugin-search": "0.8.4-main.
|
|
60
|
-
"@dxos/plugin-
|
|
61
|
-
"@dxos/plugin-
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/ui
|
|
56
|
+
"@dxos/app-graph": "0.8.4-main.7996785055",
|
|
57
|
+
"@dxos/plugin-client": "0.8.4-main.7996785055",
|
|
58
|
+
"@dxos/plugin-preview": "0.8.4-main.7996785055",
|
|
59
|
+
"@dxos/plugin-search": "0.8.4-main.7996785055",
|
|
60
|
+
"@dxos/plugin-space": "0.8.4-main.7996785055",
|
|
61
|
+
"@dxos/plugin-testing": "0.8.4-main.7996785055",
|
|
62
|
+
"@dxos/schema": "0.8.4-main.7996785055",
|
|
63
|
+
"@dxos/ui-theme": "0.8.4-main.7996785055",
|
|
64
|
+
"@dxos/storybook-utils": "0.8.4-main.7996785055",
|
|
65
|
+
"@dxos/react-ui": "0.8.4-main.7996785055"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
|
-
"effect": "3.
|
|
68
|
+
"effect": "3.20.0",
|
|
69
69
|
"react": "~19.2.3",
|
|
70
70
|
"react-dom": "~19.2.3",
|
|
71
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
72
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
71
|
+
"@dxos/react-ui": "0.8.4-main.7996785055",
|
|
72
|
+
"@dxos/ui-theme": "0.8.4-main.7996785055"
|
|
73
73
|
},
|
|
74
74
|
"publishConfig": {
|
|
75
75
|
"access": "public"
|
|
@@ -5,18 +5,18 @@
|
|
|
5
5
|
import { ActivationEvent, ActivationEvents, Capability, Plugin } from '@dxos/app-framework';
|
|
6
6
|
import { AppActivationEvents, AppPlugin } from '@dxos/app-toolkit';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { OperationHandler, ReactRoot, ReactSurface, SpotlightDismiss, State, UrlHandler } from './capabilities';
|
|
9
9
|
import { meta } from './meta';
|
|
10
10
|
import { translations } from './translations';
|
|
11
11
|
import { SimpleLayoutEvents } from './types';
|
|
12
12
|
|
|
13
13
|
export type SimpleLayoutPluginOptions = {
|
|
14
|
-
/**
|
|
14
|
+
/** Determines if running in popover window context (hides mobile-specific UI). */
|
|
15
15
|
isPopover?: boolean;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
export const SimpleLayoutPlugin = Plugin.define<SimpleLayoutPluginOptions>(meta).pipe(
|
|
19
|
-
AppPlugin.
|
|
19
|
+
AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
|
|
20
20
|
AppPlugin.addTranslationsModule({ translations }),
|
|
21
21
|
Plugin.addModule(({ isPopover = false }) => ({
|
|
22
22
|
id: Capability.getModuleTag(State),
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright 2025 DXOS.org
|
|
2
|
+
|
|
3
|
+
import { Capability } from '@dxos/app-framework';
|
|
4
|
+
import { OperationHandlerSet } from '@dxos/operation';
|
|
5
|
+
|
|
6
|
+
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
7
|
+
'OperationHandler',
|
|
8
|
+
() => import('./operation-handler'),
|
|
9
|
+
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright 2025 DXOS.org
|
|
2
|
+
|
|
3
|
+
import * as Effect from 'effect/Effect';
|
|
4
|
+
|
|
5
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
6
|
+
import type { OperationHandlerSet } from '@dxos/operation';
|
|
7
|
+
|
|
8
|
+
import { SimpleLayoutOperationHandlerSet } from '../../operations';
|
|
9
|
+
|
|
10
|
+
export default Capability.makeModule<OperationHandlerSet.OperationHandlerSet>(
|
|
11
|
+
Effect.fnUntraced(function* () {
|
|
12
|
+
return Capability.contributes(Capabilities.OperationHandler, SimpleLayoutOperationHandlerSet);
|
|
13
|
+
}),
|
|
14
|
+
);
|
|
@@ -20,23 +20,28 @@ import { type SimpleLayoutState, SimpleLayoutState as SimpleLayoutStateCapabilit
|
|
|
20
20
|
*/
|
|
21
21
|
export default Capability.makeModule(
|
|
22
22
|
Effect.fnUntraced(function* () {
|
|
23
|
-
const {
|
|
23
|
+
const { invokePromise } = yield* Capability.get(Capabilities.OperationInvoker);
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Handle navigation from a pathname.
|
|
27
27
|
* Restores the qualified graph ID and dispatches layout operations.
|
|
28
28
|
*/
|
|
29
29
|
const handlePathNavigation = (pathname: string) => {
|
|
30
|
+
if (isFilePath(pathname)) {
|
|
31
|
+
log.info('[UrlHandler] Skipping file path (not a graph node)', { pathname });
|
|
32
|
+
pathname = '/';
|
|
33
|
+
}
|
|
34
|
+
|
|
30
35
|
log.info('[UrlHandler] Navigating to path', { pathname });
|
|
31
36
|
|
|
32
37
|
const qualifiedId = fromUrlPath(pathname);
|
|
33
38
|
const workspace = getWorkspaceFromPath(qualifiedId);
|
|
34
39
|
|
|
35
|
-
|
|
40
|
+
void invokePromise(LayoutOperation.SwitchWorkspace, { subject: workspace });
|
|
36
41
|
|
|
37
42
|
const activeId = qualifiedId !== workspace ? qualifiedId : undefined;
|
|
38
43
|
if (activeId) {
|
|
39
|
-
|
|
44
|
+
void invokePromise(LayoutOperation.Open, { subject: [activeId] });
|
|
40
45
|
}
|
|
41
46
|
};
|
|
42
47
|
|
|
@@ -107,6 +112,13 @@ export default Capability.makeModule(
|
|
|
107
112
|
*/
|
|
108
113
|
const isRedirectPath = (pathname: string): boolean => pathname.startsWith('/redirect/');
|
|
109
114
|
|
|
115
|
+
/**
|
|
116
|
+
* Paths with file extensions (e.g., `/iframe.html`) are not graph node paths.
|
|
117
|
+
* This guards against embedded contexts like Storybook iframes interpreting
|
|
118
|
+
* the host pathname as a navigation target.
|
|
119
|
+
*/
|
|
120
|
+
const isFilePath = (pathname: string): boolean => /\.[a-z]+$/i.test(pathname);
|
|
121
|
+
|
|
110
122
|
/**
|
|
111
123
|
* Returns a handler for navigation events (initial load and popstate) that navigates to current pathname.
|
|
112
124
|
*/
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { createContext } from '@radix-ui/react-context';
|
|
6
|
+
import React, { type PropsWithChildren, useCallback, useRef } from 'react';
|
|
7
|
+
|
|
8
|
+
const DEBUG_OVERLAY_NAME = 'DebugOverlay';
|
|
9
|
+
|
|
10
|
+
//
|
|
11
|
+
// Context
|
|
12
|
+
//
|
|
13
|
+
|
|
14
|
+
type DebugOverlayContextValue = {
|
|
15
|
+
/** Log a timestamped message to the on-screen debug overlay. */
|
|
16
|
+
dbg: (msg: string) => void;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// Default to a no-op so hooks can call useDebugLog() safely outside of a provider.
|
|
20
|
+
const [DebugOverlayProvider, useDebugLog] = createContext<DebugOverlayContextValue>(DEBUG_OVERLAY_NAME, {
|
|
21
|
+
dbg: () => {},
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
//
|
|
25
|
+
// Root
|
|
26
|
+
//
|
|
27
|
+
|
|
28
|
+
type DebugOverlayRootProps = PropsWithChildren<{
|
|
29
|
+
/**
|
|
30
|
+
* When true (default), renders the on-screen log panel.
|
|
31
|
+
* Set to false to suppress the overlay while keeping the context available.
|
|
32
|
+
*/
|
|
33
|
+
enabled?: boolean;
|
|
34
|
+
maxLines?: number;
|
|
35
|
+
}>;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Establishes a debug overlay context.
|
|
39
|
+
*
|
|
40
|
+
* When enabled, renders an on-screen monospaced log panel anchored just above
|
|
41
|
+
* the keyboard (via --kb-height CSS variable). Descendants can call
|
|
42
|
+
* useDebugLog() to obtain the dbg() function for logging.
|
|
43
|
+
*
|
|
44
|
+
* Intended for transient mobile debugging in the iOS Simulator where DevTools
|
|
45
|
+
* console output may not be accessible.
|
|
46
|
+
*/
|
|
47
|
+
const DebugOverlayRoot = ({ children, enabled = true, maxLines = 10 }: DebugOverlayRootProps) => {
|
|
48
|
+
const overlayRef = useRef<HTMLDivElement>(null);
|
|
49
|
+
|
|
50
|
+
const dbg = useCallback((msg: string) => {
|
|
51
|
+
if (!overlayRef.current) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const line = document.createElement('pre');
|
|
55
|
+
line.textContent = `${(performance.now() / 1000).toFixed(2).padStart(8, ' ')} ${msg}`;
|
|
56
|
+
overlayRef.current.prepend(line);
|
|
57
|
+
while (overlayRef.current.children.length > maxLines) {
|
|
58
|
+
overlayRef.current.lastChild?.remove();
|
|
59
|
+
}
|
|
60
|
+
}, []);
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<DebugOverlayProvider dbg={dbg}>
|
|
64
|
+
{children}
|
|
65
|
+
{enabled && (
|
|
66
|
+
<div
|
|
67
|
+
ref={overlayRef}
|
|
68
|
+
style={{
|
|
69
|
+
position: 'fixed',
|
|
70
|
+
bottom: 'calc(var(--kb-height, 0px) + 8px)',
|
|
71
|
+
left: 8,
|
|
72
|
+
right: 8,
|
|
73
|
+
background: 'rgba(0,0,0,0.8)',
|
|
74
|
+
color: '#0f0',
|
|
75
|
+
fontSize: 10,
|
|
76
|
+
fontFamily: 'monospace',
|
|
77
|
+
padding: 6,
|
|
78
|
+
borderRadius: 4,
|
|
79
|
+
zIndex: 9999,
|
|
80
|
+
pointerEvents: 'none',
|
|
81
|
+
}}
|
|
82
|
+
/>
|
|
83
|
+
)}
|
|
84
|
+
</DebugOverlayProvider>
|
|
85
|
+
);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
//
|
|
89
|
+
// Exports
|
|
90
|
+
//
|
|
91
|
+
|
|
92
|
+
export const DebugOverlay = {
|
|
93
|
+
Root: DebugOverlayRoot,
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export { useDebugLog };
|
|
@@ -8,12 +8,12 @@ import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
|
8
8
|
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
9
9
|
import { useAppGraph } from '@dxos/app-toolkit/ui';
|
|
10
10
|
import { Node, useConnections } from '@dxos/plugin-graph';
|
|
11
|
-
import { Avatar, Icon,
|
|
11
|
+
import { Avatar, Icon, ScrollArea, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
12
12
|
import { Card } from '@dxos/react-ui';
|
|
13
13
|
import { Mosaic, type MosaicStackTileComponent } from '@dxos/react-ui-mosaic';
|
|
14
|
-
import {
|
|
14
|
+
import { SearchPanel, useSearchListItem, useSearchListResults } from '@dxos/react-ui-search';
|
|
15
15
|
import { mx } from '@dxos/ui-theme';
|
|
16
|
-
import { byPosition } from '@dxos/util';
|
|
16
|
+
import { byPosition, getHostPlatform, isTauri } from '@dxos/util';
|
|
17
17
|
|
|
18
18
|
import { meta } from '../../meta';
|
|
19
19
|
import { useExpandPath } from '../hooks';
|
|
@@ -40,27 +40,24 @@ export const Home = (_: HomeProps) => {
|
|
|
40
40
|
extract: (node) => toLocalizedString(node.properties.label, t),
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
+
const autoFocus = !isTauri() || getHostPlatform() !== 'ios';
|
|
44
|
+
|
|
43
45
|
return (
|
|
44
|
-
<
|
|
45
|
-
<
|
|
46
|
-
<
|
|
47
|
-
<
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
</Mosaic.Container>
|
|
60
|
-
</SearchList.Content>
|
|
61
|
-
</Panel.Content>
|
|
62
|
-
</Panel.Root>
|
|
63
|
-
</SearchList.Root>
|
|
46
|
+
<SearchPanel onSearch={handleSearch}>
|
|
47
|
+
<Mosaic.Container asChild>
|
|
48
|
+
<ScrollArea.Root centered padding thin>
|
|
49
|
+
<ScrollArea.Viewport>
|
|
50
|
+
<Mosaic.Stack
|
|
51
|
+
classNames='gap-1'
|
|
52
|
+
draggable={false}
|
|
53
|
+
items={results}
|
|
54
|
+
getId={(item) => item.id}
|
|
55
|
+
Tile={WorkspaceTile}
|
|
56
|
+
/>
|
|
57
|
+
</ScrollArea.Viewport>
|
|
58
|
+
</ScrollArea.Root>
|
|
59
|
+
</Mosaic.Container>
|
|
60
|
+
</SearchPanel>
|
|
64
61
|
);
|
|
65
62
|
};
|
|
66
63
|
|
|
@@ -106,17 +103,17 @@ const WorkspaceTile: MosaicStackTileComponent<Node.Node> = (props) => {
|
|
|
106
103
|
onClick={handleSelect}
|
|
107
104
|
ref={cardRef}
|
|
108
105
|
>
|
|
109
|
-
<Card.Toolbar density='
|
|
106
|
+
<Card.Toolbar density='fine'>
|
|
110
107
|
<Avatar.Root>
|
|
111
108
|
<Avatar.Content
|
|
112
109
|
icon={data.properties.icon}
|
|
113
110
|
hue={data.properties.hue}
|
|
114
111
|
hueVariant='transparent'
|
|
115
112
|
variant='square'
|
|
116
|
-
size={
|
|
113
|
+
size={8}
|
|
117
114
|
fallback={name}
|
|
118
115
|
/>
|
|
119
|
-
<Avatar.Label>{name}</Avatar.Label>
|
|
116
|
+
<Avatar.Label classNames='cursor-pointer'>{name}</Avatar.Label>
|
|
120
117
|
<Icon icon='ph--caret-right--regular' />
|
|
121
118
|
</Avatar.Root>
|
|
122
119
|
</Card.Toolbar>
|
|
@@ -133,6 +130,8 @@ const filterItems = (node: Node.Node, disposition: string) => {
|
|
|
133
130
|
const useItemsByDisposition = (disposition: string, sort = false) => {
|
|
134
131
|
const { graph } = useAppGraph();
|
|
135
132
|
const connections = useConnections(graph, Node.RootId, 'child');
|
|
136
|
-
|
|
137
|
-
|
|
133
|
+
return useMemo(() => {
|
|
134
|
+
const filtered = connections.filter((node) => filterItems(node, disposition));
|
|
135
|
+
return sort ? filtered.toSorted((a, b) => byPosition(a.properties, b.properties)) : filtered;
|
|
136
|
+
}, [connections, disposition, sort]);
|
|
138
137
|
};
|
package/src/components/{ContentLoading/ContentLoading.stories.tsx → Loading/Loading.stories.tsx}
RENAMED
|
@@ -6,16 +6,16 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
|
6
6
|
|
|
7
7
|
import { withTheme } from '@dxos/react-ui/testing';
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { Loading } from './Loading';
|
|
10
10
|
|
|
11
11
|
const meta = {
|
|
12
|
-
title: 'plugins/plugin-simple-layout/components/
|
|
13
|
-
component:
|
|
12
|
+
title: 'plugins/plugin-simple-layout/components/Loading',
|
|
13
|
+
component: Loading,
|
|
14
14
|
decorators: [withTheme()],
|
|
15
15
|
parameters: {
|
|
16
16
|
layout: 'centered',
|
|
17
17
|
},
|
|
18
|
-
} satisfies Meta<typeof
|
|
18
|
+
} satisfies Meta<typeof Loading>;
|
|
19
19
|
|
|
20
20
|
export default meta;
|
|
21
21
|
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
// TODO(burdon): Show skeleton: https://github.com/dxos/dxos/issues/8259
|
|
8
|
-
export const
|
|
8
|
+
export const Loading = () => {
|
|
9
9
|
return <div role='none' className='grid place-items-center dx-attention-surface' />;
|
|
10
10
|
};
|
|
@@ -6,7 +6,7 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
|
6
6
|
import React, { type PropsWithChildren, useEffect, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { addEventListener, combine } from '@dxos/async';
|
|
9
|
-
import { Flex, Input, Panel, Splitter, type SplitterMode, Toolbar } from '@dxos/react-ui';
|
|
9
|
+
import { Column, Flex, Input, Panel, Splitter, type SplitterMode, Toolbar } from '@dxos/react-ui';
|
|
10
10
|
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
11
11
|
|
|
12
12
|
import { MobileLayout, type MobileLayoutRootProps } from './MobileLayout';
|
|
@@ -65,11 +65,15 @@ const StoryPanel = ({ children, label }: PropsWithChildren<{ label: string }>) =
|
|
|
65
65
|
</Toolbar.Root>
|
|
66
66
|
</Panel.Toolbar>
|
|
67
67
|
<Panel.Content asChild>
|
|
68
|
-
<
|
|
69
|
-
<
|
|
70
|
-
<
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
<Column.Root gutter='xs' classNames='py-form-chrome'>
|
|
69
|
+
<Column.Content>
|
|
70
|
+
<Flex column>
|
|
71
|
+
<Input.Root>
|
|
72
|
+
<Input.TextInput placeholder={label} />
|
|
73
|
+
</Input.Root>
|
|
74
|
+
</Flex>
|
|
75
|
+
</Column.Content>
|
|
76
|
+
</Column.Root>
|
|
73
77
|
</Panel.Content>
|
|
74
78
|
</Panel.Root>
|
|
75
79
|
);
|