@dxos/plugin-simple-layout 0.8.4-main.fcc0d83b33 → 0.8.4-staging.60fe92afc8
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/{node-esm/index.mjs → neutral/SimpleLayoutPlugin.mjs} +6 -4
- package/dist/lib/{node-esm/index.mjs.map → neutral/SimpleLayoutPlugin.mjs.map} +3 -3
- package/dist/lib/neutral/app-graph-builder-MSPO34DT.mjs +21 -0
- package/dist/lib/neutral/app-graph-builder-MSPO34DT.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +21 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-7UDV3JDT.mjs +22 -0
- package/dist/lib/neutral/chunk-7UDV3JDT.mjs.map +7 -0
- package/dist/lib/neutral/chunk-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-NKAPURKM.mjs +8 -0
- package/dist/lib/neutral/chunk-NKAPURKM.mjs.map +7 -0
- package/dist/lib/neutral/chunk-OK5336TS.mjs +22 -0
- package/dist/lib/neutral/chunk-OK5336TS.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 +929 -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-Y4KNROHW.mjs +62 -0
- package/dist/lib/neutral/open-Y4KNROHW.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-EAIE7KPR.mjs +13 -0
- package/dist/lib/neutral/operation-handler-EAIE7KPR.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/operations/index.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-root-VE265VX4.mjs +18 -0
- package/dist/lib/neutral/react-root-VE265VX4.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-N3PGKIYV.mjs +46 -0
- package/dist/lib/neutral/react-surface-N3PGKIYV.mjs.map +7 -0
- package/dist/lib/neutral/revert-workspace-ST6NZUNG.mjs +22 -0
- package/dist/lib/neutral/revert-workspace-ST6NZUNG.mjs.map +7 -0
- package/dist/lib/neutral/set-6ZRLWPJS.mjs +22 -0
- package/dist/lib/neutral/set-6ZRLWPJS.mjs.map +7 -0
- package/dist/lib/neutral/set-layout-mode-L22HRCKS.mjs +13 -0
- package/dist/lib/neutral/set-layout-mode-L22HRCKS.mjs.map +7 -0
- package/dist/lib/neutral/spotlight-dismiss-EIYW5E7M.mjs +58 -0
- package/dist/lib/neutral/spotlight-dismiss-EIYW5E7M.mjs.map +7 -0
- package/dist/lib/neutral/state-7NXKBLPY.mjs +47 -0
- package/dist/lib/neutral/state-7NXKBLPY.mjs.map +7 -0
- package/dist/lib/neutral/switch-workspace-PYWPTMFO.mjs +25 -0
- package/dist/lib/neutral/switch-workspace-PYWPTMFO.mjs.map +7 -0
- package/dist/lib/{browser → neutral}/translations.mjs +2 -0
- package/dist/lib/neutral/types/index.mjs +10 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/lib/neutral/update-complementary-HKWF5OXT.mjs +33 -0
- package/dist/lib/neutral/update-complementary-HKWF5OXT.mjs.map +7 -0
- package/dist/lib/neutral/update-dialog-P4ASXCE7.mjs +30 -0
- package/dist/lib/neutral/update-dialog-P4ASXCE7.mjs.map +7 -0
- package/dist/lib/neutral/update-popover-REAKC2GN.mjs +34 -0
- package/dist/lib/neutral/update-popover-REAKC2GN.mjs.map +7 -0
- package/dist/lib/neutral/update-sidebar-O5SQPR6Q.mjs +12 -0
- package/dist/lib/neutral/update-sidebar-O5SQPR6Q.mjs.map +7 -0
- package/dist/lib/neutral/url-handler-DGZ4WISE.mjs +129 -0
- package/dist/lib/neutral/url-handler-DGZ4WISE.mjs.map +7 -0
- package/dist/types/src/SimpleLayoutPlugin.d.ts +1 -0
- 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/state.d.ts +3 -3
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/components/MobileLayout/MobileLayout.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/AppBar.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/NavBar.d.ts.map +1 -1
- package/dist/types/src/hooks/actions.d.ts +3 -3
- package/dist/types/src/hooks/actions.d.ts.map +1 -1
- package/dist/types/src/hooks/useSimpleLayoutState.d.ts +3 -3
- package/dist/types/src/hooks/useSimpleLayoutState.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/open.d.ts.map +1 -1
- package/dist/types/src/operations/state-access.d.ts +3 -3
- package/dist/types/src/operations/state-access.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/types/{capabilities.d.ts → SimpleLayoutCapabilities.d.ts} +2 -8
- package/dist/types/src/types/SimpleLayoutCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/SimpleLayoutEvents.d.ts +4 -0
- package/dist/types/src/types/SimpleLayoutEvents.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +81 -48
- package/src/SimpleLayoutPlugin.ts +3 -1
- package/src/capabilities/app-graph-builder.ts +1 -1
- package/src/capabilities/react-surface.tsx +3 -3
- package/src/capabilities/state.tsx +5 -6
- package/src/capabilities/url-handler.ts +18 -15
- package/src/components/Home/Home.tsx +3 -3
- package/src/components/Loading/Loading.tsx +1 -1
- package/src/components/MobileLayout/MobileLayout.tsx +0 -2
- package/src/components/NavBranch/NavBranch.tsx +3 -3
- package/src/components/Popover/Popover.tsx +7 -5
- package/src/components/SimpleLayout/AppBar.tsx +44 -41
- package/src/components/SimpleLayout/NavBar.tsx +1 -1
- package/src/components/SimpleLayout/SimpleLayout.stories.tsx +3 -3
- package/src/hooks/actions.ts +6 -4
- package/src/hooks/useAppBarProps.ts +2 -2
- package/src/hooks/useDrawerActions.ts +2 -2
- package/src/hooks/useNavbarActions.ts +2 -2
- package/src/hooks/useSimpleLayoutState.ts +7 -5
- package/src/index.ts +2 -1
- package/src/meta.ts +7 -4
- package/src/operations/open.ts +24 -5
- package/src/operations/state-access.ts +5 -3
- package/src/plugin.ts +11 -0
- package/src/types/{capabilities.ts → SimpleLayoutCapabilities.ts} +3 -15
- package/src/types/SimpleLayoutEvents.ts +15 -0
- package/src/types/index.ts +2 -2
- package/dist/lib/browser/index.mjs +0 -48
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/translations.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/translations.mjs +0 -36
- package/dist/types/src/types/capabilities.d.ts.map +0 -1
- package/dist/types/src/types/events.d.ts +0 -6
- package/dist/types/src/types/events.d.ts.map +0 -1
- package/src/types/events.ts +0 -15
- /package/dist/lib/{node-esm → neutral}/translations.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-
|
|
3
|
+
"version": "0.8.4-staging.60fe92afc8",
|
|
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",
|
|
@@ -8,31 +8,67 @@
|
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "https://github.com/dxos/dxos"
|
|
10
10
|
},
|
|
11
|
-
"license": "
|
|
11
|
+
"license": "FSL-1.1-Apache-2.0",
|
|
12
12
|
"author": "DXOS.org",
|
|
13
13
|
"sideEffects": true,
|
|
14
14
|
"type": "module",
|
|
15
15
|
"imports": {
|
|
16
|
-
"#capabilities":
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"#
|
|
22
|
-
|
|
16
|
+
"#capabilities": {
|
|
17
|
+
"source": "./src/capabilities/index.ts",
|
|
18
|
+
"types": "./dist/types/src/capabilities/index.d.ts",
|
|
19
|
+
"default": "./dist/lib/neutral/capabilities/index.mjs"
|
|
20
|
+
},
|
|
21
|
+
"#components": {
|
|
22
|
+
"source": "./src/components/index.ts",
|
|
23
|
+
"types": "./dist/types/src/components/index.d.ts",
|
|
24
|
+
"default": "./dist/lib/neutral/components/index.mjs"
|
|
25
|
+
},
|
|
26
|
+
"#hooks": {
|
|
27
|
+
"source": "./src/hooks/index.ts",
|
|
28
|
+
"types": "./dist/types/src/hooks/index.d.ts",
|
|
29
|
+
"default": "./dist/lib/neutral/hooks/index.mjs"
|
|
30
|
+
},
|
|
31
|
+
"#meta": {
|
|
32
|
+
"source": "./src/meta.ts",
|
|
33
|
+
"types": "./dist/types/src/meta.d.ts",
|
|
34
|
+
"default": "./dist/lib/neutral/meta.mjs"
|
|
35
|
+
},
|
|
36
|
+
"#operations": {
|
|
37
|
+
"source": "./src/operations/index.ts",
|
|
38
|
+
"types": "./dist/types/src/operations/index.d.ts",
|
|
39
|
+
"default": "./dist/lib/neutral/operations/index.mjs"
|
|
40
|
+
},
|
|
41
|
+
"#plugin": {
|
|
42
|
+
"source": "./src/SimpleLayoutPlugin.ts",
|
|
43
|
+
"types": "./dist/types/src/SimpleLayoutPlugin.d.ts",
|
|
44
|
+
"default": "./dist/lib/neutral/SimpleLayoutPlugin.mjs"
|
|
45
|
+
},
|
|
46
|
+
"#translations": {
|
|
47
|
+
"source": "./src/translations.ts",
|
|
48
|
+
"types": "./dist/types/src/translations.d.ts",
|
|
49
|
+
"default": "./dist/lib/neutral/translations.mjs"
|
|
50
|
+
},
|
|
51
|
+
"#types": {
|
|
52
|
+
"source": "./src/types/index.ts",
|
|
53
|
+
"types": "./dist/types/src/types/index.d.ts",
|
|
54
|
+
"default": "./dist/lib/neutral/types/index.mjs"
|
|
55
|
+
}
|
|
23
56
|
},
|
|
24
57
|
"exports": {
|
|
25
58
|
".": {
|
|
26
59
|
"source": "./src/index.ts",
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
|
|
60
|
+
"types": "./dist/types/src/index.d.ts",
|
|
61
|
+
"default": "./dist/lib/neutral/index.mjs"
|
|
62
|
+
},
|
|
63
|
+
"./plugin": {
|
|
64
|
+
"source": "./src/plugin.ts",
|
|
65
|
+
"types": "./dist/types/src/plugin.d.ts",
|
|
66
|
+
"default": "./dist/lib/neutral/plugin.mjs"
|
|
30
67
|
},
|
|
31
68
|
"./translations": {
|
|
32
69
|
"source": "./src/translations.ts",
|
|
33
70
|
"types": "./dist/types/src/translations.d.ts",
|
|
34
|
-
"
|
|
35
|
-
"node": "./dist/lib/node-esm/translations.mjs"
|
|
71
|
+
"default": "./dist/lib/neutral/translations.mjs"
|
|
36
72
|
}
|
|
37
73
|
},
|
|
38
74
|
"types": "dist/types/src/index.d.ts",
|
|
@@ -41,52 +77,49 @@
|
|
|
41
77
|
"src"
|
|
42
78
|
],
|
|
43
79
|
"dependencies": {
|
|
44
|
-
"@effect-atom/atom": "^0.5.1",
|
|
45
80
|
"@effect-atom/atom-react": "^0.5.0",
|
|
46
81
|
"@radix-ui/react-context": "1.1.1",
|
|
47
|
-
"@tauri-apps/plugin-deep-link": "^2.
|
|
48
|
-
"@
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/app-toolkit": "0.8.4-
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/echo": "0.8.4-
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/plugin-
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/react-ui-attention": "0.8.4-
|
|
60
|
-
"@dxos/react-ui-menu": "0.8.4-
|
|
61
|
-
"@dxos/react-ui-mosaic": "0.8.4-
|
|
62
|
-
"@dxos/react-ui-
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/schema": "0.8.4-main.fcc0d83b33",
|
|
65
|
-
"@dxos/util": "0.8.4-main.fcc0d83b33"
|
|
82
|
+
"@tauri-apps/plugin-deep-link": "^2.4.9",
|
|
83
|
+
"@dxos/app-framework": "0.8.4-staging.60fe92afc8",
|
|
84
|
+
"@dxos/compute": "0.8.4-staging.60fe92afc8",
|
|
85
|
+
"@dxos/app-toolkit": "0.8.4-staging.60fe92afc8",
|
|
86
|
+
"@dxos/context": "0.8.4-staging.60fe92afc8",
|
|
87
|
+
"@dxos/echo": "0.8.4-staging.60fe92afc8",
|
|
88
|
+
"@dxos/log": "0.8.4-staging.60fe92afc8",
|
|
89
|
+
"@dxos/keys": "0.8.4-staging.60fe92afc8",
|
|
90
|
+
"@dxos/plugin-client": "0.8.4-staging.60fe92afc8",
|
|
91
|
+
"@dxos/plugin-graph": "0.8.4-staging.60fe92afc8",
|
|
92
|
+
"@dxos/effect": "0.8.4-staging.60fe92afc8",
|
|
93
|
+
"@dxos/async": "0.8.4-staging.60fe92afc8",
|
|
94
|
+
"@dxos/react-ui-attention": "0.8.4-staging.60fe92afc8",
|
|
95
|
+
"@dxos/react-ui-menu": "0.8.4-staging.60fe92afc8",
|
|
96
|
+
"@dxos/react-ui-mosaic": "0.8.4-staging.60fe92afc8",
|
|
97
|
+
"@dxos/react-ui-search": "0.8.4-staging.60fe92afc8",
|
|
98
|
+
"@dxos/util": "0.8.4-staging.60fe92afc8"
|
|
66
99
|
},
|
|
67
100
|
"devDependencies": {
|
|
68
101
|
"@types/react": "~19.2.7",
|
|
69
102
|
"@types/react-dom": "~19.2.3",
|
|
70
|
-
"effect": "3.
|
|
103
|
+
"effect": "3.21.3",
|
|
71
104
|
"react": "~19.2.3",
|
|
72
105
|
"react-dom": "~19.2.3",
|
|
73
|
-
"vite": "^8.0.
|
|
74
|
-
"@dxos/app-graph": "0.8.4-
|
|
75
|
-
"@dxos/plugin-preview": "0.8.4-
|
|
76
|
-
"@dxos/plugin-
|
|
77
|
-
"@dxos/plugin-
|
|
78
|
-
"@dxos/react-ui": "0.8.4-
|
|
79
|
-
"@dxos/
|
|
80
|
-
"@dxos/
|
|
81
|
-
"@dxos/
|
|
82
|
-
"@dxos/
|
|
106
|
+
"vite": "^8.0.16",
|
|
107
|
+
"@dxos/app-graph": "0.8.4-staging.60fe92afc8",
|
|
108
|
+
"@dxos/plugin-preview": "0.8.4-staging.60fe92afc8",
|
|
109
|
+
"@dxos/plugin-testing": "0.8.4-staging.60fe92afc8",
|
|
110
|
+
"@dxos/plugin-space": "0.8.4-staging.60fe92afc8",
|
|
111
|
+
"@dxos/react-ui": "0.8.4-staging.60fe92afc8",
|
|
112
|
+
"@dxos/schema": "0.8.4-staging.60fe92afc8",
|
|
113
|
+
"@dxos/storybook-utils": "0.8.4-staging.60fe92afc8",
|
|
114
|
+
"@dxos/ui-theme": "0.8.4-staging.60fe92afc8",
|
|
115
|
+
"@dxos/plugin-search": "0.8.4-staging.60fe92afc8"
|
|
83
116
|
},
|
|
84
117
|
"peerDependencies": {
|
|
85
|
-
"effect": "3.
|
|
118
|
+
"effect": "3.21.3",
|
|
86
119
|
"react": "~19.2.3",
|
|
87
120
|
"react-dom": "~19.2.3",
|
|
88
|
-
"@dxos/
|
|
89
|
-
"@dxos/ui
|
|
121
|
+
"@dxos/ui-theme": "0.8.4-staging.60fe92afc8",
|
|
122
|
+
"@dxos/react-ui": "0.8.4-staging.60fe92afc8"
|
|
90
123
|
},
|
|
91
124
|
"publishConfig": {
|
|
92
125
|
"access": "public"
|
|
@@ -50,8 +50,10 @@ export const SimpleLayoutPlugin = Plugin.define<SimpleLayoutPluginOptions>(meta)
|
|
|
50
50
|
}),
|
|
51
51
|
Plugin.addModule({
|
|
52
52
|
id: Capability.getModuleTag(UrlHandler),
|
|
53
|
-
activatesOn: ActivationEvent.allOf(ActivationEvents.
|
|
53
|
+
activatesOn: ActivationEvent.allOf(ActivationEvents.ProcessManagerReady, SimpleLayoutEvents.StateReady),
|
|
54
54
|
activate: UrlHandler,
|
|
55
55
|
}),
|
|
56
56
|
Plugin.make,
|
|
57
57
|
);
|
|
58
|
+
|
|
59
|
+
export default SimpleLayoutPlugin;
|
|
@@ -11,7 +11,7 @@ import { GraphBuilder, NodeMatcher } from '@dxos/plugin-graph';
|
|
|
11
11
|
export default Capability.makeModule(
|
|
12
12
|
Effect.fnUntraced(function* () {
|
|
13
13
|
const extensions = yield* GraphBuilder.createExtension({
|
|
14
|
-
id: 'org.dxos.plugin.
|
|
14
|
+
id: 'org.dxos.plugin.simpleLayout.notFound',
|
|
15
15
|
match: NodeMatcher.whenRoot,
|
|
16
16
|
connector: () => Effect.succeed([AppNode.makeNotFound()]),
|
|
17
17
|
});
|
|
@@ -30,15 +30,15 @@ export default Capability.makeModule(() =>
|
|
|
30
30
|
component: () => <Home />,
|
|
31
31
|
}),
|
|
32
32
|
Surface.create({
|
|
33
|
-
id: '
|
|
33
|
+
id: 'notFound',
|
|
34
34
|
role: 'article',
|
|
35
35
|
filter: (data): data is SurfaceData => data.attendableId === NOT_FOUND_PATH,
|
|
36
36
|
component: () => <NotFoundArticle />,
|
|
37
37
|
}),
|
|
38
38
|
Surface.create({
|
|
39
|
-
id: '
|
|
39
|
+
id: 'navBranch',
|
|
40
40
|
role: 'article',
|
|
41
|
-
position: '
|
|
41
|
+
position: 'last',
|
|
42
42
|
filter: (data): data is SurfaceData => {
|
|
43
43
|
const props = data.properties as Record<string, any>;
|
|
44
44
|
return ALLOWED_DISPOSITIONS.includes(props?.disposition) || props?.role === 'branch';
|
|
@@ -9,10 +9,9 @@ import { Capability } from '@dxos/app-framework';
|
|
|
9
9
|
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
10
10
|
import { Node } from '@dxos/plugin-graph';
|
|
11
11
|
|
|
12
|
-
import {
|
|
13
|
-
import { SimpleLayoutState as SimpleLayoutStateCapability } from '#types';
|
|
12
|
+
import { SimpleLayoutCapabilities } from '#types';
|
|
14
13
|
|
|
15
|
-
const defaultState: SimpleLayoutState = {
|
|
14
|
+
const defaultState: SimpleLayoutCapabilities.SimpleLayoutState = {
|
|
16
15
|
dialogOpen: false,
|
|
17
16
|
workspace: Node.RootId,
|
|
18
17
|
previousWorkspace: Node.RootId,
|
|
@@ -23,12 +22,12 @@ const defaultState: SimpleLayoutState = {
|
|
|
23
22
|
};
|
|
24
23
|
|
|
25
24
|
export type SimpleLayoutStateOptions = {
|
|
26
|
-
initialState?: Partial<SimpleLayoutState>;
|
|
25
|
+
initialState?: Partial<SimpleLayoutCapabilities.SimpleLayoutState>;
|
|
27
26
|
};
|
|
28
27
|
|
|
29
28
|
export default Capability.makeModule(({ initialState }: SimpleLayoutStateOptions = {}) =>
|
|
30
29
|
Effect.sync(() => {
|
|
31
|
-
const stateAtom = Atom.make<SimpleLayoutState>({ ...defaultState, ...initialState });
|
|
30
|
+
const stateAtom = Atom.make<SimpleLayoutCapabilities.SimpleLayoutState>({ ...defaultState, ...initialState });
|
|
32
31
|
|
|
33
32
|
const layoutAtom = Atom.make((get): AppCapabilities.Layout => {
|
|
34
33
|
const state = get(stateAtom);
|
|
@@ -45,7 +44,7 @@ export default Capability.makeModule(({ initialState }: SimpleLayoutStateOptions
|
|
|
45
44
|
});
|
|
46
45
|
|
|
47
46
|
return [
|
|
48
|
-
Capability.contributes(
|
|
47
|
+
Capability.contributes(SimpleLayoutCapabilities.State, stateAtom),
|
|
49
48
|
Capability.contributes(AppCapabilities.Layout, layoutAtom),
|
|
50
49
|
];
|
|
51
50
|
}),
|
|
@@ -6,11 +6,11 @@ import * as Effect from 'effect/Effect';
|
|
|
6
6
|
|
|
7
7
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
8
|
import { AppCapabilities, LayoutOperation, fromUrlPath, getWorkspaceFromPath, toUrlPath } from '@dxos/app-toolkit';
|
|
9
|
-
import {
|
|
9
|
+
import { EffectEx } from '@dxos/effect';
|
|
10
10
|
import { log } from '@dxos/log';
|
|
11
11
|
import { isTauri } from '@dxos/util';
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import { SimpleLayoutCapabilities } from '#types';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* URL handler for simple layout that syncs browser URL with layout state.
|
|
@@ -32,7 +32,7 @@ export default Capability.makeModule(
|
|
|
32
32
|
handlers.map((handler) => handler(url)),
|
|
33
33
|
{ concurrency: 'unbounded' },
|
|
34
34
|
);
|
|
35
|
-
}).pipe(Effect.provideService(Capability.Service, capabilities), runAndForwardErrors);
|
|
35
|
+
}).pipe(Effect.provideService(Capability.Service, capabilities), EffectEx.runAndForwardErrors);
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* Handle navigation from a URL.
|
|
@@ -99,19 +99,22 @@ export default Capability.makeModule(
|
|
|
99
99
|
// Sync URL with layout state changes.
|
|
100
100
|
let lastWorkspace: string | undefined;
|
|
101
101
|
let lastActive: string | undefined;
|
|
102
|
-
const unsubscribe = yield* Capabilities.subscribeAtom(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
102
|
+
const unsubscribe = yield* Capabilities.subscribeAtom(
|
|
103
|
+
SimpleLayoutCapabilities.State,
|
|
104
|
+
(state: SimpleLayoutCapabilities.SimpleLayoutState) => {
|
|
105
|
+
const { workspace, active } = state;
|
|
106
|
+
|
|
107
|
+
if (workspace !== lastWorkspace || active !== lastActive) {
|
|
108
|
+
lastWorkspace = workspace;
|
|
109
|
+
lastActive = active;
|
|
110
|
+
|
|
111
|
+
const path = active ? toUrlPath(active) : toUrlPath(workspace);
|
|
112
|
+
if (window.location.pathname !== path) {
|
|
113
|
+
history.pushState(null, '', `${path}${window.location.search}`);
|
|
114
|
+
}
|
|
112
115
|
}
|
|
113
|
-
}
|
|
114
|
-
|
|
116
|
+
},
|
|
117
|
+
);
|
|
115
118
|
|
|
116
119
|
return Capability.contributes(Capabilities.Null, null, () =>
|
|
117
120
|
Effect.sync(() => {
|
|
@@ -100,11 +100,11 @@ const WorkspaceTile: MosaicStackTileComponent<Node.Node> = (props) => {
|
|
|
100
100
|
fullWidth
|
|
101
101
|
tabIndex={-1} // TODO(burdon): Use Mosaic.Focus.
|
|
102
102
|
data-selected={isSelected}
|
|
103
|
-
classNames={mx('dx-focus-ring', isSelected && 'bg-
|
|
103
|
+
classNames={mx('dx-focus-ring', isSelected && 'bg-selected-surface')}
|
|
104
104
|
onClick={handleSelect}
|
|
105
105
|
ref={cardRef}
|
|
106
106
|
>
|
|
107
|
-
<Card.
|
|
107
|
+
<Card.Header density='md'>
|
|
108
108
|
<Avatar.Root>
|
|
109
109
|
<Avatar.Content
|
|
110
110
|
icon={data.properties.icon}
|
|
@@ -117,7 +117,7 @@ const WorkspaceTile: MosaicStackTileComponent<Node.Node> = (props) => {
|
|
|
117
117
|
<Avatar.Label classNames='cursor-pointer'>{name}</Avatar.Label>
|
|
118
118
|
<Icon icon='ph--caret-right--regular' />
|
|
119
119
|
</Avatar.Root>
|
|
120
|
-
</Card.
|
|
120
|
+
</Card.Header>
|
|
121
121
|
</Card.Root>
|
|
122
122
|
);
|
|
123
123
|
};
|
|
@@ -6,5 +6,5 @@ import React from 'react';
|
|
|
6
6
|
|
|
7
7
|
// TODO(burdon): Show skeleton: https://github.com/dxos/dxos/issues/8259
|
|
8
8
|
export const Loading = () => {
|
|
9
|
-
return <div
|
|
9
|
+
return <div className='grid place-items-center dx-attention-surface' />;
|
|
10
10
|
};
|
|
@@ -56,7 +56,6 @@ const MobileLayoutRoot = forwardRef<HTMLDivElement, MobileLayoutRootProps>(
|
|
|
56
56
|
<MobileLayoutProvider keyboardOpen={keyboardOpen}>
|
|
57
57
|
<div
|
|
58
58
|
{...props}
|
|
59
|
-
role='none'
|
|
60
59
|
style={{
|
|
61
60
|
height: 'calc(100vh - var(--kb-height, 0px))',
|
|
62
61
|
transition: `height ${keyboardOpen ? 0 : transition}ms ease-out`,
|
|
@@ -95,7 +94,6 @@ const MobileLayoutPanel = forwardRef<HTMLDivElement, MobileLayoutPanelProps>(
|
|
|
95
94
|
return (
|
|
96
95
|
<div
|
|
97
96
|
{...props}
|
|
98
|
-
role='none'
|
|
99
97
|
style={{
|
|
100
98
|
paddingTop: safe?.top ? 'env(safe-area-inset-top)' : undefined,
|
|
101
99
|
paddingBottom: safe?.bottom ? `calc((1 - var(--kb-open, 0)) * env(safe-area-inset-bottom))` : undefined,
|
|
@@ -102,10 +102,10 @@ const NavBranchTile: MosaicStackTileComponent<Node.Node> = (props) => {
|
|
|
102
102
|
fullWidth
|
|
103
103
|
tabIndex={-1} // TODO(burdon): Use Mosaic.Focus.
|
|
104
104
|
data-selected={isSelected}
|
|
105
|
-
classNames={mx('dx-focus-ring cursor-pointer', isSelected && 'bg-
|
|
105
|
+
classNames={mx('dx-focus-ring cursor-pointer', isSelected && 'bg-selected-surface')}
|
|
106
106
|
onClick={handleSelect}
|
|
107
107
|
>
|
|
108
|
-
<Card.
|
|
108
|
+
<Card.Header>
|
|
109
109
|
<Avatar.Root>
|
|
110
110
|
<Avatar.Content
|
|
111
111
|
hue={data.properties.hue}
|
|
@@ -118,7 +118,7 @@ const NavBranchTile: MosaicStackTileComponent<Node.Node> = (props) => {
|
|
|
118
118
|
<Avatar.Label>{name}</Avatar.Label>
|
|
119
119
|
<Icon icon='ph--caret-right--regular' />
|
|
120
120
|
</Avatar.Root>
|
|
121
|
-
</Card.
|
|
121
|
+
</Card.Header>
|
|
122
122
|
</Card.Root>
|
|
123
123
|
);
|
|
124
124
|
};
|
|
@@ -84,6 +84,7 @@ export const PopoverContent = () => {
|
|
|
84
84
|
[handleClose],
|
|
85
85
|
);
|
|
86
86
|
|
|
87
|
+
/* TODO(thure): Make this a constant and document it. */
|
|
87
88
|
const collisionBoundaries: HTMLElement[] = useMemo(() => {
|
|
88
89
|
const closest = state.popoverAnchor?.closest('[data-popover-collision-boundary]') as HTMLElement | null | undefined;
|
|
89
90
|
return closest ? [closest] : [];
|
|
@@ -96,6 +97,7 @@ export const PopoverContent = () => {
|
|
|
96
97
|
sticky='always'
|
|
97
98
|
hideWhenDetached
|
|
98
99
|
collisionBoundary={collisionBoundaries}
|
|
100
|
+
onOpenAutoFocus={(event) => event.preventDefault()}
|
|
99
101
|
onInteractOutside={handleInteractOutside}
|
|
100
102
|
onEscapeKeyDown={handleInteractOutside}
|
|
101
103
|
>
|
|
@@ -105,12 +107,12 @@ export const PopoverContent = () => {
|
|
|
105
107
|
)}
|
|
106
108
|
{state.popoverKind === 'card' && (
|
|
107
109
|
<Card.Root border={false} classNames='dx-card-popover'>
|
|
108
|
-
<Card.
|
|
109
|
-
{/*
|
|
110
|
-
<
|
|
110
|
+
<Card.Header>
|
|
111
|
+
{/* Disabled drag handle keeps the toolbar slot layout consistent with regular cards. */}
|
|
112
|
+
<Card.DragHandle />
|
|
111
113
|
{state.popoverTitle ? <Card.Title>{toLocalizedString(state.popoverTitle, t)}</Card.Title> : <span />}
|
|
112
|
-
<Card.
|
|
113
|
-
</Card.
|
|
114
|
+
<Card.ActionIconButton action='close' onClick={handleClose} />
|
|
115
|
+
</Card.Header>
|
|
114
116
|
{state.popoverContent && 'subject' in state.popoverContent && (
|
|
115
117
|
<Surface.Surface type={AppSurface.Card} data={state.popoverContent} limit={1} />
|
|
116
118
|
)}
|
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
import { type Atom, useAtomValue } from '@effect-atom/atom-react';
|
|
6
6
|
import React, { Fragment } from 'react';
|
|
7
7
|
|
|
8
|
-
import { IconButton, Popover, Toolbar, useTranslation } from '@dxos/react-ui';
|
|
8
|
+
import { DensityProvider, IconButton, Popover, Toolbar, useTranslation } from '@dxos/react-ui';
|
|
9
|
+
import { composable, composableProps } from '@dxos/react-ui';
|
|
9
10
|
import { type ActionExecutor, type ActionGraphProps, Menu, useMenuActions } from '@dxos/react-ui-menu';
|
|
10
|
-
import {
|
|
11
|
+
import { osTranslations } from '@dxos/ui-theme';
|
|
11
12
|
|
|
12
13
|
import { meta } from '#meta';
|
|
13
14
|
|
|
@@ -48,45 +49,47 @@ export const AppBar = composable<HTMLDivElement, AppBarProps>(
|
|
|
48
49
|
const AnchorRoot = popoverAnchorId ? Popover.Anchor : Fragment;
|
|
49
50
|
|
|
50
51
|
return (
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
<
|
|
75
|
-
<Menu.
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
52
|
+
<DensityProvider density='md'>
|
|
53
|
+
<Toolbar.Root
|
|
54
|
+
{...composableProps(props, {
|
|
55
|
+
role: 'banner',
|
|
56
|
+
classNames: 'grid grid-cols-[var(--dx-rail-size)_1fr_var(--dx-rail-size)] items-center dx-density-md',
|
|
57
|
+
})}
|
|
58
|
+
ref={forwardedRef}
|
|
59
|
+
>
|
|
60
|
+
{keyboardOpen ? (
|
|
61
|
+
<IconButton variant='ghost' icon='ph--x--regular' iconOnly label={t('done.label')} />
|
|
62
|
+
) : showBackButton ? (
|
|
63
|
+
<IconButton
|
|
64
|
+
variant='ghost'
|
|
65
|
+
icon='ph--caret-left--regular'
|
|
66
|
+
iconOnly
|
|
67
|
+
label={t('back.label')}
|
|
68
|
+
onClick={onBack}
|
|
69
|
+
/>
|
|
70
|
+
) : (
|
|
71
|
+
<div />
|
|
72
|
+
)}
|
|
73
|
+
<h1 className='text-center truncate font-thin uppercase'>{displayTitle}</h1>
|
|
74
|
+
{hasActions ? (
|
|
75
|
+
<AnchorRoot>
|
|
76
|
+
<Menu.Root {...menuActions} caller={meta.id} onAction={onAction}>
|
|
77
|
+
<Menu.Trigger asChild>
|
|
78
|
+
<IconButton
|
|
79
|
+
variant='ghost'
|
|
80
|
+
icon='ph--dots-three-vertical--regular'
|
|
81
|
+
iconOnly
|
|
82
|
+
label={t('actions-menu.label')}
|
|
83
|
+
/>
|
|
84
|
+
</Menu.Trigger>
|
|
85
|
+
<Menu.Content />
|
|
86
|
+
</Menu.Root>
|
|
87
|
+
</AnchorRoot>
|
|
88
|
+
) : (
|
|
89
|
+
<span />
|
|
90
|
+
)}
|
|
91
|
+
</Toolbar.Root>
|
|
92
|
+
</DensityProvider>
|
|
90
93
|
);
|
|
91
94
|
},
|
|
92
95
|
);
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import { type Atom } from '@effect-atom/atom-react';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
|
+
import { composable, composableProps } from '@dxos/react-ui';
|
|
8
9
|
import { type ActionExecutor, type ActionGraphProps, Menu, useMenuActions } from '@dxos/react-ui-menu';
|
|
9
|
-
import { composable, composableProps } from '@dxos/ui-theme';
|
|
10
10
|
|
|
11
11
|
const NAVBAR_NAME = 'SimpleLayout.NavBar';
|
|
12
12
|
|
|
@@ -9,9 +9,9 @@ import { ActivationEvents, Capability, Plugin } from '@dxos/app-framework';
|
|
|
9
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
10
|
import { AppActivationEvents } from '@dxos/app-toolkit';
|
|
11
11
|
import { Collection } from '@dxos/echo';
|
|
12
|
-
import { ClientPlugin } from '@dxos/plugin-client';
|
|
13
|
-
import { SearchPlugin } from '@dxos/plugin-search';
|
|
14
|
-
import { SpacePlugin } from '@dxos/plugin-space';
|
|
12
|
+
import { ClientPlugin } from '@dxos/plugin-client/testing';
|
|
13
|
+
import { SearchPlugin } from '@dxos/plugin-search/testing';
|
|
14
|
+
import { SpacePlugin } from '@dxos/plugin-space/testing';
|
|
15
15
|
import { corePlugins } from '@dxos/plugin-testing';
|
|
16
16
|
import { translations as searchTranslation } from '@dxos/react-ui-search/translations';
|
|
17
17
|
import { withLayout } from '@dxos/react-ui/testing';
|
package/src/hooks/actions.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { getLinkedVariant } from '@dxos/react-ui-attention';
|
|
|
11
11
|
import { type ActionGraphProps } from '@dxos/react-ui-menu';
|
|
12
12
|
import { byPosition } from '@dxos/util';
|
|
13
13
|
|
|
14
|
-
import {
|
|
14
|
+
import { SimpleLayoutCapabilities } from '#types';
|
|
15
15
|
|
|
16
16
|
// TODO(wittjosiah): Factor out to shared location with plugin-deck.
|
|
17
17
|
export const PLANK_COMPANION_TYPE = 'org.dxos.plugin.deck.plank-companion';
|
|
@@ -22,7 +22,9 @@ export type CompanionActionsConfig = {
|
|
|
22
22
|
/** Optional: highlight companion with this variant */
|
|
23
23
|
selectedVariant?: string;
|
|
24
24
|
/** State updater for toggling the drawer. */
|
|
25
|
-
updateState: (
|
|
25
|
+
updateState: (
|
|
26
|
+
fn: (state: SimpleLayoutCapabilities.SimpleLayoutState) => SimpleLayoutCapabilities.SimpleLayoutState,
|
|
27
|
+
) => void;
|
|
26
28
|
};
|
|
27
29
|
|
|
28
30
|
/**
|
|
@@ -32,7 +34,7 @@ export type CompanionActionsConfig = {
|
|
|
32
34
|
// TODO(burdon): Use builder pattern.
|
|
33
35
|
export const createCompanionActions = (
|
|
34
36
|
graph: AppCapabilities.AppGraph['graph'],
|
|
35
|
-
stateAtom: Atom.Atom<SimpleLayoutState>,
|
|
37
|
+
stateAtom: Atom.Atom<SimpleLayoutCapabilities.SimpleLayoutState>,
|
|
36
38
|
get: (atom: Atom.Atom<any>) => any,
|
|
37
39
|
config: CompanionActionsConfig,
|
|
38
40
|
): Pick<ActionGraphProps, 'nodes' | 'edges'> => {
|
|
@@ -57,7 +59,7 @@ export const createCompanionActions = (
|
|
|
57
59
|
id: `${idPrefix}-companion-${companion.id}`,
|
|
58
60
|
type: Node.ActionType,
|
|
59
61
|
properties: {
|
|
60
|
-
icon: companion.properties.icon ?? 'ph--
|
|
62
|
+
icon: companion.properties.icon ?? 'ph--circle-dashed--regular',
|
|
61
63
|
label: companion.properties.label,
|
|
62
64
|
iconOnly: true,
|
|
63
65
|
...(selectedVariant !== undefined && {
|
|
@@ -15,7 +15,7 @@ import { type ActionGraphProps } from '@dxos/react-ui-menu';
|
|
|
15
15
|
|
|
16
16
|
import { type AppBarProps } from '#components';
|
|
17
17
|
import { meta } from '#meta';
|
|
18
|
-
import {
|
|
18
|
+
import { SimpleLayoutCapabilities } from '#types';
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Hook that computes all AppBar props from the app graph.
|
|
@@ -23,7 +23,7 @@ import { SimpleLayoutState as SimpleLayoutStateCapability } from '#types';
|
|
|
23
23
|
*/
|
|
24
24
|
export const useAppBarProps = (): Omit<AppBarProps, 'classNames'> => {
|
|
25
25
|
const { t } = useTranslation(meta.id);
|
|
26
|
-
const stateAtom = useCapability(
|
|
26
|
+
const stateAtom = useCapability(SimpleLayoutCapabilities.State);
|
|
27
27
|
const state = useAtomValue(stateAtom);
|
|
28
28
|
const { graph } = useAppGraph();
|
|
29
29
|
const { invokePromise } = useOperationInvoker();
|
|
@@ -14,7 +14,7 @@ import { type ActionExecutor, type ActionGraphProps, createGapSeparator } from '
|
|
|
14
14
|
|
|
15
15
|
import { useMobileLayout } from '#components';
|
|
16
16
|
import { meta } from '#meta';
|
|
17
|
-
import {
|
|
17
|
+
import { SimpleLayoutCapabilities } from '#types';
|
|
18
18
|
|
|
19
19
|
import { createCompanionActions } from './actions';
|
|
20
20
|
import { useSimpleLayoutState } from './useSimpleLayoutState';
|
|
@@ -31,7 +31,7 @@ export type DrawerActions = {
|
|
|
31
31
|
*/
|
|
32
32
|
export const useDrawerActions = (consumerName: string): DrawerActions => {
|
|
33
33
|
const { t } = useTranslation(meta.id);
|
|
34
|
-
const stateAtom = useCapability(
|
|
34
|
+
const stateAtom = useCapability(SimpleLayoutCapabilities.State);
|
|
35
35
|
const { graph } = useAppGraph();
|
|
36
36
|
const runAction = useActionRunner();
|
|
37
37
|
const { updateState } = useSimpleLayoutState();
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from '@dxos/react-ui-menu';
|
|
18
18
|
|
|
19
19
|
import { meta } from '#meta';
|
|
20
|
-
import {
|
|
20
|
+
import { SimpleLayoutCapabilities } from '#types';
|
|
21
21
|
|
|
22
22
|
import { createCompanionActions } from './actions';
|
|
23
23
|
import { useSimpleLayoutState } from './useSimpleLayoutState';
|
|
@@ -39,7 +39,7 @@ export const useNavbarActions = (): NavbarActions => {
|
|
|
39
39
|
const { t } = useTranslation(meta.id);
|
|
40
40
|
const { graph } = useAppGraph();
|
|
41
41
|
const runAction = useActionRunner();
|
|
42
|
-
const stateAtom = useCapability(
|
|
42
|
+
const stateAtom = useCapability(SimpleLayoutCapabilities.State);
|
|
43
43
|
const { updateState } = useSimpleLayoutState();
|
|
44
44
|
|
|
45
45
|
// Create a computed atom that derives everything from graph connections and state.
|