@dxos/plugin-navtree 0.8.4-main.4a85c3132b → 0.8.4-main.51f1e5ca51
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/index.mjs +115 -74
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/translations.mjs +21 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +7 -5
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/keyboard.d.ts.map +1 -0
- 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-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/{state/state.d.ts → state.d.ts} +1 -1
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/components/NavTree/NavTree.d.ts.map +1 -1
- package/dist/types/src/components/NavTree/NavTree.stories.d.ts +9 -11
- package/dist/types/src/components/NavTree/NavTree.stories.d.ts.map +1 -1
- package/dist/types/src/components/{NavTreeContext.d.ts → NavTreeContext/NavTreeContext.d.ts} +1 -1
- package/dist/types/src/components/NavTreeContext/NavTreeContext.d.ts.map +1 -0
- package/dist/types/src/components/NavTreeContext/index.d.ts +2 -0
- package/dist/types/src/components/NavTreeContext/index.d.ts.map +1 -0
- package/dist/types/src/components/NavTreeItem/NavTreeItemAction.d.ts +7 -3
- package/dist/types/src/components/NavTreeItem/NavTreeItemAction.d.ts.map +1 -1
- package/dist/types/src/components/NavTreeItem/NavTreeItemAction.stories.d.ts +1 -1
- package/dist/types/src/components/NavTreeItem/NavTreeItemAction.stories.d.ts.map +1 -1
- package/dist/types/src/components/NavTreeItem/NavTreeItemColumns.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/L0Menu.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/L1Panel.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/L1Tabs.d.ts.map +1 -1
- package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.d.ts.map +1 -1
- package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.stories.d.ts.map +1 -1
- package/dist/types/src/components/types.d.ts +1 -2
- package/dist/types/src/components/types.d.ts.map +1 -1
- package/dist/types/src/containers/CommandsDialogContent/CommandsDialogContent.d.ts.map +1 -1
- package/dist/types/src/containers/CommandsDialogContent/CommandsDialogContent.stories.d.ts +28 -0
- package/dist/types/src/containers/CommandsDialogContent/CommandsDialogContent.stories.d.ts.map +1 -0
- package/dist/types/src/containers/CommandsDialogContent/index.d.ts +1 -2
- package/dist/types/src/containers/CommandsDialogContent/index.d.ts.map +1 -1
- package/dist/types/src/containers/CommandsTrigger/CommandsTrigger.d.ts.map +1 -1
- package/dist/types/src/containers/CommandsTrigger/index.d.ts +1 -2
- package/dist/types/src/containers/CommandsTrigger/index.d.ts.map +1 -1
- package/dist/types/src/containers/NavTreeContainer/NavTreeContainer.d.ts.map +1 -1
- package/dist/types/src/containers/NavTreeContainer/index.d.ts +2 -2
- package/dist/types/src/containers/NavTreeContainer/index.d.ts.map +1 -1
- package/dist/types/src/containers/NavTreeDocumentTitle/NavTreeDocumentTitle.d.ts.map +1 -1
- package/dist/types/src/containers/NavTreeDocumentTitle/index.d.ts +1 -2
- package/dist/types/src/containers/NavTreeDocumentTitle/index.d.ts.map +1 -1
- package/dist/types/src/containers/index.d.ts +1 -1
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/experimental/Tree.d.ts +2 -2
- package/dist/types/src/experimental/Tree.d.ts.map +1 -1
- package/dist/types/src/experimental/Tree.stories.d.ts.map +1 -1
- package/dist/types/src/hooks/useActions.d.ts +2 -4
- package/dist/types/src/hooks/useActions.d.ts.map +1 -1
- package/dist/types/src/hooks/useLoadDescendents.d.ts.map +1 -1
- package/dist/types/src/hooks/useNavTreeModel.d.ts +1 -1
- package/dist/types/src/hooks/useNavTreeModel.d.ts.map +1 -1
- package/dist/types/src/hooks/useNavTreeState.d.ts +2 -6
- package/dist/types/src/hooks/useNavTreeState.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/expose.d.ts +5 -0
- package/dist/types/src/operations/expose.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/testing/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/testing/generator.d.ts.map +1 -1
- package/dist/types/src/testing/update-state.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +8 -11
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +1 -2
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/events.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +2 -2
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +57 -43
- package/src/NavTreePlugin.tsx +7 -7
- package/src/capabilities/{app-graph-builder/app-graph-builder.ts → app-graph-builder.ts} +7 -7
- package/src/capabilities/index.ts +11 -5
- package/src/capabilities/{keyboard/keyboard.ts → keyboard.ts} +2 -2
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +8 -8
- package/src/capabilities/{state/state.ts → state.ts} +5 -5
- package/src/components/NavTree/NavTree.stories.tsx +17 -16
- package/src/components/NavTree/NavTree.tsx +3 -2
- package/src/components/{NavTreeContext.tsx → NavTreeContext/NavTreeContext.tsx} +1 -1
- package/src/components/NavTreeContext/index.ts +5 -0
- package/src/components/NavTreeItem/NavTreeItemAction.stories.tsx +6 -8
- package/src/components/NavTreeItem/NavTreeItemAction.tsx +62 -45
- package/src/components/NavTreeItem/NavTreeItemColumns.tsx +7 -5
- package/src/components/Sidebar/L0Menu.tsx +49 -74
- package/src/components/Sidebar/L1Panel.tsx +97 -134
- package/src/components/Sidebar/L1Tabs.tsx +0 -1
- package/src/components/types.ts +1 -2
- package/src/containers/CommandsDialogContent/CommandsDialogContent.stories.tsx +46 -0
- package/src/containers/CommandsDialogContent/CommandsDialogContent.tsx +52 -58
- package/src/containers/CommandsDialogContent/index.ts +1 -3
- package/src/containers/CommandsTrigger/CommandsTrigger.tsx +7 -5
- package/src/containers/CommandsTrigger/index.ts +1 -3
- package/src/containers/NavTreeContainer/NavTreeContainer.tsx +28 -27
- package/src/containers/NavTreeContainer/index.ts +2 -3
- package/src/containers/NavTreeDocumentTitle/NavTreeDocumentTitle.tsx +2 -2
- package/src/containers/NavTreeDocumentTitle/index.ts +1 -3
- package/src/containers/index.ts +1 -1
- package/src/experimental/Tree.stories.tsx +27 -27
- package/src/hooks/useActions.ts +18 -22
- package/src/hooks/useNavTreeModel.ts +10 -4
- package/src/hooks/useNavTreeState.ts +2 -9
- package/src/meta.ts +2 -2
- package/src/operations/expose.ts +42 -0
- package/src/operations/index.ts +7 -0
- package/src/testing/app-graph-builder.ts +40 -36
- package/src/testing/generator.ts +22 -22
- package/src/translations.ts +8 -10
- package/src/types/capabilities.ts +4 -4
- package/src/types/events.ts +1 -1
- package/src/util.ts +2 -2
- package/dist/lib/browser/CommandsDialogContent-A27AKTHH.mjs +0 -111
- package/dist/lib/browser/CommandsDialogContent-A27AKTHH.mjs.map +0 -7
- package/dist/lib/browser/CommandsTrigger-HBZYQCGV.mjs +0 -33
- package/dist/lib/browser/CommandsTrigger-HBZYQCGV.mjs.map +0 -7
- package/dist/lib/browser/NavTreeContainer-B5K4FUJS.mjs +0 -12
- package/dist/lib/browser/NavTreeContainer-B5K4FUJS.mjs.map +0 -7
- package/dist/lib/browser/NavTreeDocumentTitle-GEE3URWH.mjs +0 -26
- package/dist/lib/browser/NavTreeDocumentTitle-GEE3URWH.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-XGA4GPGL.mjs +0 -44
- package/dist/lib/browser/app-graph-builder-XGA4GPGL.mjs.map +0 -7
- package/dist/lib/browser/chunk-DQCYMXEU.mjs +0 -1426
- package/dist/lib/browser/chunk-DQCYMXEU.mjs.map +0 -7
- package/dist/lib/browser/chunk-H3OJ4WLF.mjs +0 -14
- package/dist/lib/browser/chunk-H3OJ4WLF.mjs.map +0 -7
- package/dist/lib/browser/chunk-X2HDG62A.mjs +0 -23
- package/dist/lib/browser/chunk-X2HDG62A.mjs.map +0 -7
- package/dist/lib/browser/chunk-YKTYPINZ.mjs +0 -19
- package/dist/lib/browser/chunk-YKTYPINZ.mjs.map +0 -7
- package/dist/lib/browser/keyboard-OJZC54PK.mjs +0 -54
- package/dist/lib/browser/keyboard-OJZC54PK.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-BNAMYOHF.mjs +0 -53
- package/dist/lib/browser/operation-resolver-BNAMYOHF.mjs.map +0 -7
- package/dist/lib/browser/react-surface-AYHOAJ4I.mjs +0 -59
- package/dist/lib/browser/react-surface-AYHOAJ4I.mjs.map +0 -7
- package/dist/lib/browser/state-AC3EETN7.mjs +0 -131
- package/dist/lib/browser/state-AC3EETN7.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/keyboard/index.d.ts +0 -3
- package/dist/types/src/capabilities/keyboard/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/keyboard/keyboard.d.ts.map +0 -1
- 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-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/state/index.d.ts +0 -3
- 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/components/NavTreeContext.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder/index.ts +0 -7
- package/src/capabilities/keyboard/index.ts +0 -7
- package/src/capabilities/operation-resolver/index.ts +0 -7
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -44
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/state/index.ts +0 -7
- /package/dist/types/src/capabilities/{app-graph-builder/app-graph-builder.d.ts → app-graph-builder.d.ts} +0 -0
- /package/dist/types/src/capabilities/{keyboard/keyboard.d.ts → keyboard.d.ts} +0 -0
- /package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
|
@@ -7,8 +7,8 @@ import * as Effect from 'effect/Effect';
|
|
|
7
7
|
|
|
8
8
|
import { type BuilderExtensions } from '@dxos/app-graph';
|
|
9
9
|
import { log } from '@dxos/log';
|
|
10
|
-
import { GraphBuilder, NodeMatcher } from '@dxos/plugin-graph';
|
|
11
|
-
import {
|
|
10
|
+
import { GraphBuilder, Node, NodeMatcher } from '@dxos/plugin-graph';
|
|
11
|
+
import { random } from '@dxos/random';
|
|
12
12
|
|
|
13
13
|
export const storybookGraphBuilders = (): BuilderExtensions => {
|
|
14
14
|
const propertiesCache = new Map<string, Record<string, unknown>>();
|
|
@@ -31,13 +31,13 @@ export const storybookGraphBuilders = (): BuilderExtensions => {
|
|
|
31
31
|
actions: () =>
|
|
32
32
|
Effect.succeed(
|
|
33
33
|
Array.from({ length: 5 }, (_, i) => ({
|
|
34
|
-
id: `
|
|
34
|
+
id: `action-${i}`,
|
|
35
35
|
data: Effect.fnUntraced(function* () {
|
|
36
36
|
log.info('action', { id: 'app-menu', index: i });
|
|
37
37
|
}),
|
|
38
38
|
properties: {
|
|
39
39
|
label: `Action ${i}`,
|
|
40
|
-
icon:
|
|
40
|
+
icon: random.properties.icon(),
|
|
41
41
|
disposition: 'menu',
|
|
42
42
|
},
|
|
43
43
|
})),
|
|
@@ -49,7 +49,7 @@ export const storybookGraphBuilders = (): BuilderExtensions => {
|
|
|
49
49
|
match: NodeMatcher.whenRoot,
|
|
50
50
|
connector: () =>
|
|
51
51
|
Effect.succeed([
|
|
52
|
-
{
|
|
52
|
+
Node.make({
|
|
53
53
|
id: 'user-account',
|
|
54
54
|
type: 'user-account',
|
|
55
55
|
properties: {
|
|
@@ -57,37 +57,37 @@ export const storybookGraphBuilders = (): BuilderExtensions => {
|
|
|
57
57
|
icon: 'ph--user--regular',
|
|
58
58
|
disposition: 'user-account',
|
|
59
59
|
userId: '1234567890ABCDEF',
|
|
60
|
-
hue:
|
|
61
|
-
emoji:
|
|
60
|
+
hue: random.properties.hue(),
|
|
61
|
+
emoji: random.properties.emoji(),
|
|
62
62
|
status: 'active',
|
|
63
63
|
},
|
|
64
64
|
nodes: [
|
|
65
|
-
{
|
|
65
|
+
Node.make({
|
|
66
66
|
id: 'profile',
|
|
67
67
|
type: 'profile',
|
|
68
68
|
properties: {
|
|
69
69
|
label: 'Profile',
|
|
70
70
|
icon: 'ph--user--regular',
|
|
71
71
|
},
|
|
72
|
-
},
|
|
73
|
-
{
|
|
72
|
+
}),
|
|
73
|
+
Node.make({
|
|
74
74
|
id: 'devices',
|
|
75
75
|
type: 'devices',
|
|
76
76
|
properties: {
|
|
77
77
|
label: 'Devices',
|
|
78
78
|
icon: 'ph--devices--regular',
|
|
79
79
|
},
|
|
80
|
-
},
|
|
81
|
-
{
|
|
80
|
+
}),
|
|
81
|
+
Node.make({
|
|
82
82
|
id: 'security',
|
|
83
83
|
type: 'security',
|
|
84
84
|
properties: {
|
|
85
85
|
label: 'Security',
|
|
86
86
|
icon: 'ph--key--regular',
|
|
87
87
|
},
|
|
88
|
-
},
|
|
88
|
+
}),
|
|
89
89
|
],
|
|
90
|
-
},
|
|
90
|
+
}),
|
|
91
91
|
]),
|
|
92
92
|
}),
|
|
93
93
|
// Create space (workspace) nodes directly under root.
|
|
@@ -111,16 +111,18 @@ export const storybookGraphBuilders = (): BuilderExtensions => {
|
|
|
111
111
|
return value;
|
|
112
112
|
});
|
|
113
113
|
|
|
114
|
-
return Array.from({ length: get(count) }, (_, i) =>
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
114
|
+
return Array.from({ length: get(count) }, (_, i) =>
|
|
115
|
+
Node.make({
|
|
116
|
+
id: `space-${i}`,
|
|
117
|
+
type: 'space',
|
|
118
|
+
properties: getProperties(`space-${i}`, {
|
|
119
|
+
label: `Space ${i}`,
|
|
120
|
+
icon: random.properties.icon(),
|
|
121
|
+
hue: random.properties.hue(),
|
|
122
|
+
disposition: 'workspace',
|
|
123
|
+
}),
|
|
122
124
|
}),
|
|
123
|
-
|
|
125
|
+
);
|
|
124
126
|
}),
|
|
125
127
|
}),
|
|
126
128
|
// Create space actions.
|
|
@@ -130,13 +132,13 @@ export const storybookGraphBuilders = (): BuilderExtensions => {
|
|
|
130
132
|
actions: () =>
|
|
131
133
|
Effect.succeed(
|
|
132
134
|
Array.from({ length: 5 }, (_, i) => ({
|
|
133
|
-
id: `
|
|
135
|
+
id: `action-${i}`,
|
|
134
136
|
data: Effect.fnUntraced(function* () {
|
|
135
137
|
log.info('action', { id: 'space-actions', index: i });
|
|
136
138
|
}),
|
|
137
|
-
properties: getProperties(`
|
|
139
|
+
properties: getProperties(`action-${i}`, {
|
|
138
140
|
label: `Action ${i}`,
|
|
139
|
-
icon:
|
|
141
|
+
icon: random.properties.icon(),
|
|
140
142
|
}),
|
|
141
143
|
})),
|
|
142
144
|
),
|
|
@@ -162,14 +164,16 @@ export const storybookGraphBuilders = (): BuilderExtensions => {
|
|
|
162
164
|
return value;
|
|
163
165
|
});
|
|
164
166
|
|
|
165
|
-
return Array.from({ length: get(count) }, (_, i) =>
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
167
|
+
return Array.from({ length: get(count) }, (_, i) =>
|
|
168
|
+
Node.make({
|
|
169
|
+
id: `object-${i}`,
|
|
170
|
+
type: 'object',
|
|
171
|
+
properties: getProperties(`object-${i}`, {
|
|
172
|
+
label: `Object ${i}`,
|
|
173
|
+
icon: random.properties.icon(),
|
|
174
|
+
}),
|
|
171
175
|
}),
|
|
172
|
-
|
|
176
|
+
);
|
|
173
177
|
}),
|
|
174
178
|
}),
|
|
175
179
|
// Create object actions.
|
|
@@ -179,13 +183,13 @@ export const storybookGraphBuilders = (): BuilderExtensions => {
|
|
|
179
183
|
actions: () =>
|
|
180
184
|
Effect.succeed(
|
|
181
185
|
Array.from({ length: 5 }, (_, i) => ({
|
|
182
|
-
id: `
|
|
186
|
+
id: `action-${i}`,
|
|
183
187
|
data: Effect.fnUntraced(function* () {
|
|
184
188
|
log.info('action', { id: 'object-actions', index: i });
|
|
185
189
|
}),
|
|
186
|
-
properties: getProperties(`
|
|
190
|
+
properties: getProperties(`action-${i}`, {
|
|
187
191
|
label: `Action ${i}`,
|
|
188
|
-
icon:
|
|
192
|
+
icon: random.properties.icon(),
|
|
189
193
|
}),
|
|
190
194
|
})),
|
|
191
195
|
),
|
package/src/testing/generator.ts
CHANGED
|
@@ -7,7 +7,7 @@ import * as Schema from 'effect/Schema';
|
|
|
7
7
|
import { type Node } from '@dxos/app-graph';
|
|
8
8
|
import { Obj, Type } from '@dxos/echo';
|
|
9
9
|
import { TestSchema } from '@dxos/echo/testing';
|
|
10
|
-
import {
|
|
10
|
+
import { random } from '@dxos/random';
|
|
11
11
|
import { range } from '@dxos/util';
|
|
12
12
|
|
|
13
13
|
// TODO(burdon): Reconcile with @dxos/plugin-debug, @dxos/react-ui/testing.
|
|
@@ -43,16 +43,16 @@ export const Priority = [1, 2, 3, 4, 5];
|
|
|
43
43
|
export const defaultGenerators: { [type: string]: ObjectDataGenerator } = {
|
|
44
44
|
document: {
|
|
45
45
|
createData: () => ({
|
|
46
|
-
title:
|
|
47
|
-
body:
|
|
46
|
+
title: random.lorem.sentence(3),
|
|
47
|
+
body: random.lorem.sentences({ min: 1, max: random.number.int({ min: 1, max: 3 }) }),
|
|
48
48
|
}),
|
|
49
49
|
},
|
|
50
50
|
|
|
51
51
|
image: {
|
|
52
52
|
createData: () => ({
|
|
53
|
-
title:
|
|
54
|
-
image:
|
|
55
|
-
body:
|
|
53
|
+
title: random.lorem.sentence(3),
|
|
54
|
+
image: random.helpers.arrayElement(data.images),
|
|
55
|
+
body: random.datatype.boolean() ? random.lorem.sentences() : undefined,
|
|
56
56
|
}),
|
|
57
57
|
},
|
|
58
58
|
|
|
@@ -65,16 +65,16 @@ export const defaultGenerators: { [type: string]: ObjectDataGenerator } = {
|
|
|
65
65
|
priority: Schema.Number,
|
|
66
66
|
}).pipe(
|
|
67
67
|
Type.object({
|
|
68
|
-
typename: 'example.
|
|
68
|
+
typename: 'com.example.type.project',
|
|
69
69
|
version: '0.1.0',
|
|
70
70
|
}),
|
|
71
71
|
),
|
|
72
72
|
|
|
73
73
|
createData: () => ({
|
|
74
|
-
title:
|
|
75
|
-
repo:
|
|
76
|
-
status:
|
|
77
|
-
priority:
|
|
74
|
+
title: random.commerce.productName(),
|
|
75
|
+
repo: random.datatype.boolean({ probability: 0.3 }) ? random.internet.url() : undefined,
|
|
76
|
+
status: random.helpers.arrayElement(Status),
|
|
77
|
+
priority: random.helpers.arrayElement(Priority),
|
|
78
78
|
}),
|
|
79
79
|
},
|
|
80
80
|
};
|
|
@@ -99,7 +99,7 @@ export class TestObjectGenerator {
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
createObject({ types }: { types?: string[] } = {}) {
|
|
102
|
-
const type =
|
|
102
|
+
const type = random.helpers.arrayElement(types ?? Object.keys(this.factories));
|
|
103
103
|
const factory = this.factories[type];
|
|
104
104
|
return factory?.createObject();
|
|
105
105
|
}
|
|
@@ -136,7 +136,7 @@ export const createTree = () => {
|
|
|
136
136
|
nodes: [...Array(4)].map(() => {
|
|
137
137
|
const l0 = generator.createObject();
|
|
138
138
|
return {
|
|
139
|
-
id:
|
|
139
|
+
id: random.string.uuid(),
|
|
140
140
|
data: null,
|
|
141
141
|
type: 'category',
|
|
142
142
|
properties: {
|
|
@@ -148,7 +148,7 @@ export const createTree = () => {
|
|
|
148
148
|
...[...Array(4)].map(() => {
|
|
149
149
|
const l1 = generator.createObject();
|
|
150
150
|
return {
|
|
151
|
-
id:
|
|
151
|
+
id: random.string.uuid(),
|
|
152
152
|
data: null,
|
|
153
153
|
type: 'document',
|
|
154
154
|
properties: {
|
|
@@ -157,20 +157,20 @@ export const createTree = () => {
|
|
|
157
157
|
},
|
|
158
158
|
nodes: [
|
|
159
159
|
{
|
|
160
|
-
id: `${
|
|
160
|
+
id: `${random.string.uuid()}__a1`,
|
|
161
161
|
data: () => {},
|
|
162
162
|
type: 'action',
|
|
163
163
|
properties: {
|
|
164
|
-
label:
|
|
164
|
+
label: random.lorem.words(2),
|
|
165
165
|
icon: 'ph--boat--regular',
|
|
166
166
|
},
|
|
167
167
|
},
|
|
168
168
|
{
|
|
169
|
-
id: `${
|
|
169
|
+
id: `${random.string.uuid()}__a2`,
|
|
170
170
|
data: () => {},
|
|
171
171
|
type: 'action',
|
|
172
172
|
properties: {
|
|
173
|
-
label:
|
|
173
|
+
label: random.lorem.words(2),
|
|
174
174
|
icon: 'ph--train-simple--regular',
|
|
175
175
|
},
|
|
176
176
|
},
|
|
@@ -178,20 +178,20 @@ export const createTree = () => {
|
|
|
178
178
|
} satisfies Node.NodeArg<any>;
|
|
179
179
|
}),
|
|
180
180
|
{
|
|
181
|
-
id: `${
|
|
181
|
+
id: `${random.string.uuid()}__a1`,
|
|
182
182
|
data: () => {},
|
|
183
183
|
type: 'action',
|
|
184
184
|
properties: {
|
|
185
|
-
label:
|
|
185
|
+
label: random.lorem.words(2),
|
|
186
186
|
icon: 'ph--boat--regular',
|
|
187
187
|
},
|
|
188
188
|
},
|
|
189
189
|
{
|
|
190
|
-
id: `${
|
|
190
|
+
id: `${random.string.uuid()}__a2`,
|
|
191
191
|
data: () => {},
|
|
192
192
|
type: 'action',
|
|
193
193
|
properties: {
|
|
194
|
-
label:
|
|
194
|
+
label: random.lorem.words(2),
|
|
195
195
|
icon: 'ph--train-simple--regular',
|
|
196
196
|
},
|
|
197
197
|
},
|
package/src/translations.ts
CHANGED
|
@@ -4,21 +4,19 @@
|
|
|
4
4
|
|
|
5
5
|
import { type Resource } from '@dxos/react-ui';
|
|
6
6
|
|
|
7
|
-
import { meta } from '
|
|
7
|
+
import { meta } from '#meta';
|
|
8
8
|
|
|
9
9
|
export const translations = [
|
|
10
10
|
{
|
|
11
11
|
'en-US': {
|
|
12
12
|
[meta.id]: {
|
|
13
|
-
'app
|
|
14
|
-
'open
|
|
15
|
-
'
|
|
16
|
-
'
|
|
17
|
-
'
|
|
18
|
-
'
|
|
19
|
-
'
|
|
20
|
-
'empty branch message': ' ',
|
|
21
|
-
'button back': 'Back to Space',
|
|
13
|
+
'app-menu.label': 'App menu',
|
|
14
|
+
'open-commands.label': 'Search commands',
|
|
15
|
+
'commands-dialog.title': 'Commands',
|
|
16
|
+
'command-list-input.placeholder': 'Search for commands…',
|
|
17
|
+
'node-actions-menu-invoker.label': 'More options',
|
|
18
|
+
'tree-item-actions.label': 'More actions',
|
|
19
|
+
'button-back.button': 'Back to Space',
|
|
22
20
|
},
|
|
23
21
|
},
|
|
24
22
|
},
|
|
@@ -6,16 +6,16 @@ import { type Atom } from '@effect-atom/atom-react';
|
|
|
6
6
|
|
|
7
7
|
import { Capability } from '@dxos/app-framework';
|
|
8
8
|
|
|
9
|
-
import { meta } from '
|
|
9
|
+
import { meta } from '#meta';
|
|
10
10
|
|
|
11
11
|
export namespace NavTreeCapabilities {
|
|
12
|
-
export type NavTreeItemState = { open: boolean; current: boolean
|
|
12
|
+
export type NavTreeItemState = { open: boolean; current: boolean };
|
|
13
13
|
|
|
14
14
|
export type NavTreeStateStore = {
|
|
15
15
|
getItem: (path: string[]) => NavTreeItemState;
|
|
16
16
|
getItemAtom: (path: string[]) => Atom.Atom<NavTreeItemState>;
|
|
17
|
-
setItem: (path: string[], key: 'open' | 'current'
|
|
17
|
+
setItem: (path: string[], key: 'open' | 'current', next: boolean) => void;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
export const State = Capability.make<NavTreeStateStore>(`${meta.id}
|
|
20
|
+
export const State = Capability.make<NavTreeStateStore>(`${meta.id}.capability.state`);
|
|
21
21
|
}
|
package/src/types/events.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { type ActivationEvent } from '@dxos/app-framework';
|
|
6
6
|
import { AppActivationEvents } from '@dxos/app-toolkit';
|
|
7
7
|
|
|
8
|
-
import { meta } from '
|
|
8
|
+
import { meta } from '#meta';
|
|
9
9
|
|
|
10
10
|
export namespace NavTreeEvents {
|
|
11
11
|
export const StateReady: ActivationEvent.ActivationEvent = AppActivationEvents.createStateEvent(meta.id);
|
package/src/util.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { Graph, Node } from '@dxos/plugin-graph';
|
|
6
6
|
import { isNonNullable } from '@dxos/util';
|
|
7
7
|
|
|
8
|
-
import { type NavTreeItemGraphNode } from '
|
|
8
|
+
import { type NavTreeItemGraphNode } from '#types';
|
|
9
9
|
|
|
10
10
|
export const getParent = (
|
|
11
11
|
graph: Graph.ReadableGraph,
|
|
@@ -93,7 +93,7 @@ export const getChildren = (
|
|
|
93
93
|
* Determines whether a node should be visible based on its disposition.
|
|
94
94
|
*/
|
|
95
95
|
export const filterItems = (node: Node.Node, disposition?: string) => {
|
|
96
|
-
if (!disposition &&
|
|
96
|
+
if (!disposition && node.properties.disposition === 'hidden') {
|
|
97
97
|
return false;
|
|
98
98
|
} else if (!disposition) {
|
|
99
99
|
const action = Node.isAction(node);
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
KEY_BINDING,
|
|
3
|
-
meta
|
|
4
|
-
} from "./chunk-YKTYPINZ.mjs";
|
|
5
|
-
|
|
6
|
-
// src/containers/CommandsDialogContent/CommandsDialogContent.tsx
|
|
7
|
-
import React, { forwardRef, useMemo, useState } from "react";
|
|
8
|
-
import { useOperationInvoker } from "@dxos/app-framework/ui";
|
|
9
|
-
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
10
|
-
import { useAppGraph } from "@dxos/app-toolkit/ui";
|
|
11
|
-
import { Keyboard, keySymbols } from "@dxos/keyboard";
|
|
12
|
-
import { Graph, Node, useActionRunner } from "@dxos/plugin-graph";
|
|
13
|
-
import { useActions } from "@dxos/plugin-graph";
|
|
14
|
-
import { Button, Dialog, toLocalizedString, useTranslation } from "@dxos/react-ui";
|
|
15
|
-
import { SearchList, useSearchListResults } from "@dxos/react-ui-searchlist";
|
|
16
|
-
import { osTranslations } from "@dxos/ui-theme";
|
|
17
|
-
import { getHostPlatform } from "@dxos/util";
|
|
18
|
-
var CommandsDialogContent = /* @__PURE__ */ forwardRef(({ selected: initial }, forwardedRef) => {
|
|
19
|
-
const { t } = useTranslation(meta.id);
|
|
20
|
-
const { invokeSync } = useOperationInvoker();
|
|
21
|
-
const runAction = useActionRunner();
|
|
22
|
-
const { graph } = useAppGraph();
|
|
23
|
-
const [selected, setSelected] = useState(initial);
|
|
24
|
-
const allActions = useMemo(() => {
|
|
25
|
-
const current = Keyboard.singleton.getCurrentContext();
|
|
26
|
-
const actionMap = /* @__PURE__ */ new Set();
|
|
27
|
-
const actions2 = [];
|
|
28
|
-
Graph.traverse(graph, {
|
|
29
|
-
relation: "child",
|
|
30
|
-
visitor: (node, path) => {
|
|
31
|
-
if ((Node.isAction(node) || Node.isActionGroup(node)) && !actionMap.has(node.id) && current.startsWith(path.slice(0, -1).join("/"))) {
|
|
32
|
-
actionMap.add(node.id);
|
|
33
|
-
actions2.push(node);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
actions2.sort((a, b) => {
|
|
38
|
-
return toLocalizedString(a.properties.label, t)?.toLowerCase().localeCompare(toLocalizedString(b.properties.label, t)?.toLowerCase());
|
|
39
|
-
});
|
|
40
|
-
return actions2;
|
|
41
|
-
}, [
|
|
42
|
-
graph
|
|
43
|
-
]);
|
|
44
|
-
const group = allActions.find(({ id }) => id === selected);
|
|
45
|
-
const groupActions = useActions(graph, group?.id);
|
|
46
|
-
const actions = Node.isActionGroup(group) ? groupActions : allActions;
|
|
47
|
-
const { results, handleSearch } = useSearchListResults({
|
|
48
|
-
items: actions,
|
|
49
|
-
extract: (action) => toLocalizedString(action.properties.label, t)
|
|
50
|
-
});
|
|
51
|
-
return /* @__PURE__ */ React.createElement(Dialog.Content, {
|
|
52
|
-
ref: forwardedRef
|
|
53
|
-
}, /* @__PURE__ */ React.createElement(Dialog.Title, null, t("commands dialog title", {
|
|
54
|
-
ns: meta.id
|
|
55
|
-
})), /* @__PURE__ */ React.createElement(SearchList.Root, {
|
|
56
|
-
onSearch: handleSearch
|
|
57
|
-
}, /* @__PURE__ */ React.createElement(SearchList.Content, null, /* @__PURE__ */ React.createElement(SearchList.Input, {
|
|
58
|
-
placeholder: t("command list input placeholder")
|
|
59
|
-
}), /* @__PURE__ */ React.createElement(SearchList.Viewport, null, results.map((action) => {
|
|
60
|
-
const shortcut = typeof action.properties.keyBinding === "string" ? action.properties.keyBinding : action.properties.keyBinding?.[getHostPlatform()];
|
|
61
|
-
return /* @__PURE__ */ React.createElement(SearchList.Item, {
|
|
62
|
-
value: action.id,
|
|
63
|
-
key: action.id,
|
|
64
|
-
label: toLocalizedString(action.properties.label, t),
|
|
65
|
-
icon: action.properties.icon,
|
|
66
|
-
suffix: shortcut ? keySymbols(shortcut).join("") : void 0,
|
|
67
|
-
onSelect: () => {
|
|
68
|
-
if (action.properties.disabled) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
if (Node.isActionGroup(action)) {
|
|
72
|
-
setSelected(action.id);
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
invokeSync(LayoutOperation.UpdateDialog, {
|
|
76
|
-
state: false
|
|
77
|
-
});
|
|
78
|
-
setTimeout(() => {
|
|
79
|
-
const node = Graph.getConnections(graph, group?.id ?? action.id, Node.childRelation("inbound"))[0];
|
|
80
|
-
if (node && Node.isAction(action)) {
|
|
81
|
-
void runAction(action, {
|
|
82
|
-
parent: node,
|
|
83
|
-
caller: KEY_BINDING
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
},
|
|
88
|
-
classNames: "flex items-center gap-2",
|
|
89
|
-
disabled: action.properties.disabled,
|
|
90
|
-
...action.properties?.testId && {
|
|
91
|
-
"data-testid": action.properties.testId
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
})))), /* @__PURE__ */ React.createElement("div", {
|
|
95
|
-
role: "none",
|
|
96
|
-
className: "p-form-padding"
|
|
97
|
-
}, /* @__PURE__ */ React.createElement(Dialog.Close, {
|
|
98
|
-
asChild: true
|
|
99
|
-
}, /* @__PURE__ */ React.createElement(Button, {
|
|
100
|
-
classNames: "w-full"
|
|
101
|
-
}, t("close label", {
|
|
102
|
-
ns: osTranslations
|
|
103
|
-
})))));
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
// src/containers/CommandsDialogContent/index.ts
|
|
107
|
-
var CommandsDialogContent_default = CommandsDialogContent;
|
|
108
|
-
export {
|
|
109
|
-
CommandsDialogContent_default as default
|
|
110
|
-
};
|
|
111
|
-
//# sourceMappingURL=CommandsDialogContent-A27AKTHH.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/containers/CommandsDialogContent/CommandsDialogContent.tsx", "../../../src/containers/CommandsDialogContent/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { forwardRef, useMemo, useState } from 'react';\n\nimport { useOperationInvoker } from '@dxos/app-framework/ui';\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { useAppGraph } from '@dxos/app-toolkit/ui';\nimport { Keyboard, keySymbols } from '@dxos/keyboard';\nimport { Graph, Node, useActionRunner } from '@dxos/plugin-graph';\nimport { useActions } from '@dxos/plugin-graph';\nimport { Button, Dialog, toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { SearchList, useSearchListResults } from '@dxos/react-ui-searchlist';\nimport { osTranslations } from '@dxos/ui-theme';\nimport { getHostPlatform } from '@dxos/util';\n\nimport { KEY_BINDING, meta } from '../../meta';\n\nexport type CommandsDialogContentProps = {\n selected?: string;\n};\n\n// TODO(wittjosiah): This probably deserves its own plugin but for now it lives here w/ other navigation UI.\nexport const CommandsDialogContent = forwardRef<HTMLDivElement, CommandsDialogContentProps>(\n ({ selected: initial }, forwardedRef) => {\n const { t } = useTranslation(meta.id);\n const { invokeSync } = useOperationInvoker();\n const runAction = useActionRunner();\n const { graph } = useAppGraph();\n const [selected, setSelected] = useState<string | undefined>(initial);\n\n // Traverse graph.\n // TODO(burdon): Factor out commonality with shortcut dialog.\n const allActions = useMemo(() => {\n // TODO(burdon): Get from navtree (not keyboard).\n const current = Keyboard.singleton.getCurrentContext();\n const actionMap = new Set<string>();\n const actions: Node.ActionLike[] = [];\n Graph.traverse(graph, {\n relation: 'child',\n visitor: (node, path) => {\n if (\n (Node.isAction(node) || Node.isActionGroup(node)) &&\n !actionMap.has(node.id) &&\n current.startsWith(path.slice(0, -1).join('/'))\n ) {\n actionMap.add(node.id);\n actions.push(node);\n }\n },\n });\n\n actions.sort((a, b) => {\n return toLocalizedString(a.properties.label, t)\n ?.toLowerCase()\n .localeCompare(toLocalizedString(b.properties.label, t)?.toLowerCase());\n });\n\n return actions;\n }, [graph]);\n\n const group = allActions.find(({ id }) => id === selected);\n const groupActions = useActions(graph, group?.id);\n const actions = Node.isActionGroup(group) ? groupActions : allActions;\n\n const { results, handleSearch } = useSearchListResults({\n items: actions,\n extract: (action) => toLocalizedString(action.properties.label, t),\n });\n\n return (\n <Dialog.Content ref={forwardedRef}>\n <Dialog.Title>{t('commands dialog title', { ns: meta.id })}</Dialog.Title>\n <SearchList.Root onSearch={handleSearch}>\n <SearchList.Content>\n <SearchList.Input placeholder={t('command list input placeholder')} />\n <SearchList.Viewport>\n {results.map((action) => {\n const shortcut =\n typeof action.properties.keyBinding === 'string'\n ? action.properties.keyBinding\n : action.properties.keyBinding?.[getHostPlatform()];\n\n return (\n <SearchList.Item\n value={action.id}\n key={action.id}\n label={toLocalizedString(action.properties.label, t)}\n icon={action.properties.icon}\n suffix={shortcut ? keySymbols(shortcut).join('') : undefined}\n onSelect={() => {\n if (action.properties.disabled) {\n return;\n }\n\n if (Node.isActionGroup(action)) {\n setSelected(action.id);\n return;\n }\n\n invokeSync(LayoutOperation.UpdateDialog, { state: false });\n setTimeout(() => {\n const node = Graph.getConnections(\n graph,\n group?.id ?? action.id,\n Node.childRelation('inbound'),\n )[0];\n if (node && Node.isAction(action)) {\n void runAction(action, { parent: node, caller: KEY_BINDING });\n }\n });\n }}\n classNames='flex items-center gap-2'\n disabled={action.properties.disabled}\n {...(action.properties?.testId && {\n 'data-testid': action.properties.testId,\n })}\n />\n );\n })}\n </SearchList.Viewport>\n </SearchList.Content>\n </SearchList.Root>\n <div role='none' className='p-form-padding'>\n <Dialog.Close asChild>\n <Button classNames='w-full'>{t('close label', { ns: osTranslations })}</Button>\n </Dialog.Close>\n </div>\n </Dialog.Content>\n );\n },\n);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { CommandsDialogContent } from './CommandsDialogContent';\n\nexport default CommandsDialogContent;\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": ["React", "forwardRef", "useMemo", "useState", "useOperationInvoker", "LayoutOperation", "useAppGraph", "Keyboard", "keySymbols", "Graph", "Node", "useActionRunner", "useActions", "Button", "Dialog", "toLocalizedString", "useTranslation", "SearchList", "useSearchListResults", "osTranslations", "getHostPlatform", "CommandsDialogContent", "forwardRef", "selected", "initial", "forwardedRef", "t", "useTranslation", "meta", "id", "invokeSync", "useOperationInvoker", "runAction", "useActionRunner", "graph", "useAppGraph", "setSelected", "useState", "allActions", "useMemo", "current", "Keyboard", "singleton", "getCurrentContext", "actionMap", "Set", "actions", "Graph", "traverse", "relation", "visitor", "node", "path", "Node", "isAction", "isActionGroup", "has", "startsWith", "slice", "join", "add", "push", "sort", "a", "b", "toLocalizedString", "properties", "label", "toLowerCase", "localeCompare", "group", "find", "groupActions", "useActions", "results", "handleSearch", "useSearchListResults", "items", "extract", "action", "Dialog", "Content", "ref", "Title", "ns", "SearchList", "Root", "onSearch", "Input", "placeholder", "Viewport", "map", "shortcut", "keyBinding", "getHostPlatform", "Item", "value", "key", "icon", "suffix", "keySymbols", "undefined", "onSelect", "disabled", "LayoutOperation", "UpdateDialog", "state", "setTimeout", "getConnections", "childRelation", "parent", "caller", "KEY_BINDING", "classNames", "testId", "div", "role", "className", "Close", "asChild", "Button", "osTranslations", "CommandsDialogContent"]
|
|
7
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
COMMANDS_DIALOG,
|
|
3
|
-
meta
|
|
4
|
-
} from "./chunk-YKTYPINZ.mjs";
|
|
5
|
-
|
|
6
|
-
// src/containers/CommandsTrigger/CommandsTrigger.tsx
|
|
7
|
-
import React from "react";
|
|
8
|
-
import { useOperationInvoker } from "@dxos/app-framework/ui";
|
|
9
|
-
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
10
|
-
import { Button, Icon, useTranslation } from "@dxos/react-ui";
|
|
11
|
-
var CommandsTrigger = () => {
|
|
12
|
-
const { invokeSync } = useOperationInvoker();
|
|
13
|
-
const { t } = useTranslation(meta.id);
|
|
14
|
-
return /* @__PURE__ */ React.createElement(Button, {
|
|
15
|
-
classNames: "m-1 px-1 lg:px-2",
|
|
16
|
-
onClick: () => invokeSync(LayoutOperation.UpdateDialog, {
|
|
17
|
-
subject: COMMANDS_DIALOG,
|
|
18
|
-
blockAlign: "start"
|
|
19
|
-
})
|
|
20
|
-
}, /* @__PURE__ */ React.createElement("span", {
|
|
21
|
-
className: "text-description font-normal grow text-start"
|
|
22
|
-
}, t("command list input placeholder")), /* @__PURE__ */ React.createElement(Icon, {
|
|
23
|
-
icon: "ph--magnifying-glass--regular",
|
|
24
|
-
size: 5
|
|
25
|
-
}));
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
// src/containers/CommandsTrigger/index.ts
|
|
29
|
-
var CommandsTrigger_default = CommandsTrigger;
|
|
30
|
-
export {
|
|
31
|
-
CommandsTrigger_default as default
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=CommandsTrigger-HBZYQCGV.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/containers/CommandsTrigger/CommandsTrigger.tsx", "../../../src/containers/CommandsTrigger/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { useOperationInvoker } from '@dxos/app-framework/ui';\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { Button, Icon, useTranslation } from '@dxos/react-ui';\n\nimport { COMMANDS_DIALOG, meta } from '../../meta';\n\n// TODO(thure): Refactor to be handled by a more appropriate plugin.\nexport const CommandsTrigger = () => {\n const { invokeSync } = useOperationInvoker();\n const { t } = useTranslation(meta.id);\n return (\n <Button\n classNames='m-1 px-1 lg:px-2'\n onClick={() => invokeSync(LayoutOperation.UpdateDialog, { subject: COMMANDS_DIALOG, blockAlign: 'start' })}\n >\n <span className='text-description font-normal grow text-start'>{t('command list input placeholder')}</span>\n <Icon icon='ph--magnifying-glass--regular' size={5} />\n </Button>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { CommandsTrigger } from './CommandsTrigger';\n\nexport default CommandsTrigger;\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,2BAA2B;AACpC,SAASC,uBAAuB;AAChC,SAASC,QAAQC,MAAMC,sBAAsB;AAKtC,IAAMC,kBAAkB,MAAA;AAC7B,QAAM,EAAEC,WAAU,IAAKC,oBAAAA;AACvB,QAAM,EAAEC,EAAC,IAAKC,eAAeC,KAAKC,EAAE;AACpC,SACE,sBAAA,cAACC,QAAAA;IACCC,YAAW;IACXC,SAAS,MAAMR,WAAWS,gBAAgBC,cAAc;MAAEC,SAASC;MAAiBC,YAAY;IAAQ,CAAA;KAExG,sBAAA,cAACC,QAAAA;IAAKC,WAAU;KAAgDb,EAAE,gCAAA,CAAA,GAClE,sBAAA,cAACc,MAAAA;IAAKC,MAAK;IAAgCC,MAAM;;AAGvD;;;ACnBA,IAAA,0BAAeC;",
|
|
6
|
-
"names": ["React", "useOperationInvoker", "LayoutOperation", "Button", "Icon", "useTranslation", "CommandsTrigger", "invokeSync", "useOperationInvoker", "t", "useTranslation", "meta", "id", "Button", "classNames", "onClick", "LayoutOperation", "UpdateDialog", "subject", "COMMANDS_DIALOG", "blockAlign", "span", "className", "Icon", "icon", "size", "CommandsTrigger"]
|
|
7
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
NavTreeContainer
|
|
3
|
-
} from "./chunk-DQCYMXEU.mjs";
|
|
4
|
-
import "./chunk-X2HDG62A.mjs";
|
|
5
|
-
import "./chunk-YKTYPINZ.mjs";
|
|
6
|
-
|
|
7
|
-
// src/containers/NavTreeContainer/index.ts
|
|
8
|
-
var NavTreeContainer_default = NavTreeContainer;
|
|
9
|
-
export {
|
|
10
|
-
NavTreeContainer_default as default
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=NavTreeContainer-B5K4FUJS.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/containers/NavTreeContainer/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { NavTreeContainer } from './NavTreeContainer';\n\nexport default NavTreeContainer;\n"],
|
|
5
|
-
"mappings": ";;;;;;;AAMA,IAAA,2BAAeA;",
|
|
6
|
-
"names": ["NavTreeContainer"]
|
|
7
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
meta
|
|
3
|
-
} from "./chunk-YKTYPINZ.mjs";
|
|
4
|
-
|
|
5
|
-
// src/containers/NavTreeDocumentTitle/NavTreeDocumentTitle.tsx
|
|
6
|
-
import { useEffect } from "react";
|
|
7
|
-
import { toLocalizedString, useTranslation } from "@dxos/react-ui";
|
|
8
|
-
import { osTranslations } from "@dxos/ui-theme";
|
|
9
|
-
var NavTreeDocumentTitle = ({ node }) => {
|
|
10
|
-
const { t } = useTranslation(meta.id);
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
document.title = node ? toLocalizedString(node.properties.label, t) : t("current app name", {
|
|
13
|
-
ns: osTranslations
|
|
14
|
-
});
|
|
15
|
-
}, [
|
|
16
|
-
node?.properties?.label
|
|
17
|
-
]);
|
|
18
|
-
return null;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
// src/containers/NavTreeDocumentTitle/index.ts
|
|
22
|
-
var NavTreeDocumentTitle_default = NavTreeDocumentTitle;
|
|
23
|
-
export {
|
|
24
|
-
NavTreeDocumentTitle_default as default
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=NavTreeDocumentTitle-GEE3URWH.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/containers/NavTreeDocumentTitle/NavTreeDocumentTitle.tsx", "../../../src/containers/NavTreeDocumentTitle/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\nimport { useEffect } from 'react';\n\nimport { type Node } from '@dxos/app-graph';\nimport { toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { osTranslations } from '@dxos/ui-theme';\n\nimport { meta } from '../../meta';\n\nexport const NavTreeDocumentTitle = ({ node }: { node?: Node.Node }) => {\n const { t } = useTranslation(meta.id);\n useEffect(() => {\n document.title = node ? toLocalizedString(node.properties.label, t) : t('current app name', { ns: osTranslations });\n }, [node?.properties?.label]);\n return null;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { NavTreeDocumentTitle } from './NavTreeDocumentTitle';\n\nexport default NavTreeDocumentTitle;\n"],
|
|
5
|
-
"mappings": ";;;;;AAGA,SAASA,iBAAiB;AAG1B,SAASC,mBAAmBC,sBAAsB;AAClD,SAASC,sBAAsB;AAIxB,IAAMC,uBAAuB,CAAC,EAAEC,KAAI,MAAwB;AACjE,QAAM,EAAEC,EAAC,IAAKC,eAAeC,KAAKC,EAAE;AACpCC,YAAU,MAAA;AACRC,aAASC,QAAQP,OAAOQ,kBAAkBR,KAAKS,WAAWC,OAAOT,CAAAA,IAAKA,EAAE,oBAAoB;MAAEU,IAAIC;IAAe,CAAA;EACnH,GAAG;IAACZ,MAAMS,YAAYC;GAAM;AAC5B,SAAO;AACT;;;ACXA,IAAA,+BAAeG;",
|
|
6
|
-
"names": ["useEffect", "toLocalizedString", "useTranslation", "osTranslations", "NavTreeDocumentTitle", "node", "t", "useTranslation", "meta", "id", "useEffect", "document", "title", "toLocalizedString", "properties", "label", "ns", "osTranslations", "NavTreeDocumentTitle"]
|
|
7
|
-
}
|