@dxos/plugin-navtree 0.7.4 → 0.7.5-labs.071a3e2
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/app-graph-builder-BL7LRXCM.mjs +44 -0
- package/dist/lib/browser/app-graph-builder-BL7LRXCM.mjs.map +7 -0
- package/dist/lib/browser/chunk-54MPRXMH.mjs +1109 -0
- package/dist/lib/browser/chunk-54MPRXMH.mjs.map +7 -0
- package/dist/lib/browser/chunk-AOAGODQB.mjs +15 -0
- package/dist/lib/browser/chunk-AOAGODQB.mjs.map +7 -0
- package/dist/lib/browser/{chunk-PSVCPL4T.mjs → chunk-KOXMEAOS.mjs} +5 -3
- package/dist/lib/browser/chunk-KOXMEAOS.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +107 -1218
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/intent-resolver-U25VBFH3.mjs +47 -0
- package/dist/lib/browser/intent-resolver-U25VBFH3.mjs.map +7 -0
- package/dist/lib/browser/keyboard-MUBRTPI5.mjs +46 -0
- package/dist/lib/browser/keyboard-MUBRTPI5.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-LNRTNSM6.mjs +57 -0
- package/dist/lib/browser/react-surface-LNRTNSM6.mjs.map +7 -0
- package/dist/lib/browser/state-65TQKYX7.mjs +108 -0
- package/dist/lib/browser/state-65TQKYX7.mjs.map +7 -0
- package/dist/types/src/NavTreePlugin.d.ts +1 -3
- package/dist/types/src/NavTreePlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +181 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/capabilities.d.ts +18 -0
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +251 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts +4 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/keyboard.d.ts +4 -0
- package/dist/types/src/capabilities/keyboard.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +4 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/state.d.ts +17 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/components/CommandsDialog.d.ts.map +1 -1
- package/dist/types/src/components/CommandsTrigger.d.ts.map +1 -1
- package/dist/types/src/components/L0Menu.d.ts +9 -0
- package/dist/types/src/components/L0Menu.d.ts.map +1 -0
- package/dist/types/src/components/L1Panels.d.ts +8 -0
- package/dist/types/src/components/L1Panels.d.ts.map +1 -0
- package/dist/types/src/components/NavTree.d.ts +3 -20
- package/dist/types/src/components/NavTree.d.ts.map +1 -1
- package/dist/types/src/components/NavTree.stories.d.ts +2 -2
- package/dist/types/src/components/NavTree.stories.d.ts.map +1 -1
- package/dist/types/src/components/NavTreeContainer.d.ts +4 -3
- package/dist/types/src/components/NavTreeContainer.d.ts.map +1 -1
- package/dist/types/src/components/NavTreeContext.d.ts +4 -0
- package/dist/types/src/components/NavTreeContext.d.ts.map +1 -0
- package/dist/types/src/components/NavTreeItemAction.d.ts +4 -8
- package/dist/types/src/components/NavTreeItemAction.d.ts.map +1 -1
- package/dist/types/src/components/NavTreeItemAction.stories.d.ts +0 -5
- package/dist/types/src/components/NavTreeItemAction.stories.d.ts.map +1 -1
- package/dist/types/src/components/NavTreeItemColumns.d.ts +4 -0
- package/dist/types/src/components/NavTreeItemColumns.d.ts.map +1 -0
- package/dist/types/src/components/NotchStart.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/types.d.ts +25 -0
- package/dist/types/src/components/types.d.ts.map +1 -0
- package/dist/types/src/events.d.ts +4 -0
- package/dist/types/src/events.d.ts.map +1 -0
- package/dist/types/src/hooks.d.ts +3 -0
- package/dist/types/src/hooks.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +3 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/stories/Graph.stories.d.ts +2 -2
- package/dist/types/src/stories/Graph.stories.d.ts.map +1 -1
- package/dist/types/src/stories/StorybookNavTree.d.ts +4 -0
- package/dist/types/src/stories/StorybookNavTree.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +0 -7
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +3 -2
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +9 -0
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +34 -39
- package/src/NavTreePlugin.tsx +68 -287
- package/src/capabilities/app-graph-builder.ts +42 -0
- package/src/capabilities/capabilities.ts +19 -0
- package/src/capabilities/index.ts +13 -0
- package/src/capabilities/intent-resolver.ts +36 -0
- package/src/capabilities/keyboard.ts +54 -0
- package/src/capabilities/react-surface.tsx +56 -0
- package/src/capabilities/state.ts +97 -0
- package/src/components/CommandsDialog.tsx +4 -5
- package/src/components/CommandsTrigger.tsx +13 -8
- package/src/components/L0Menu.tsx +210 -0
- package/src/components/L1Panels.tsx +100 -0
- package/src/components/NavTree.stories.tsx +5 -5
- package/src/components/NavTree.tsx +26 -121
- package/src/components/NavTreeContainer.tsx +109 -69
- package/src/components/NavTreeContext.tsx +13 -0
- package/src/components/NavTreeItemAction.stories.tsx +0 -2
- package/src/components/NavTreeItemAction.tsx +58 -316
- package/src/components/NavTreeItemColumns.tsx +71 -0
- package/src/components/NotchStart.tsx +9 -8
- package/src/components/index.ts +3 -0
- package/src/components/types.ts +33 -0
- package/src/events.ts +11 -0
- package/src/hooks.ts +21 -0
- package/src/index.ts +3 -4
- package/src/meta.ts +3 -1
- package/src/stories/Graph.stories.tsx +5 -4
- package/src/stories/StorybookNavTree.tsx +63 -0
- package/src/translations.ts +0 -7
- package/src/types.ts +3 -2
- package/src/util.ts +54 -0
- package/dist/lib/browser/chunk-PSVCPL4T.mjs.map +0 -7
- package/dist/lib/browser/meta.mjs +0 -11
- package/dist/lib/browser/meta.mjs.map +0 -7
- package/dist/types/src/components/NavTreeFooter.d.ts +0 -6
- package/dist/types/src/components/NavTreeFooter.d.ts.map +0 -1
- package/src/components/NavTreeFooter.tsx +0 -158
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useMemo, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { NavTree, NavTreeContext, type NavTreeContextValue, type NavTreeProps } from '../components';
|
|
8
|
+
import { type NavTreeItemGraphNode } from '../types';
|
|
9
|
+
|
|
10
|
+
export const StorybookNavTree = ({
|
|
11
|
+
getActions,
|
|
12
|
+
loadDescendents,
|
|
13
|
+
renderItemEnd,
|
|
14
|
+
popoverAnchorId,
|
|
15
|
+
getItems,
|
|
16
|
+
getProps,
|
|
17
|
+
isCurrent,
|
|
18
|
+
canDrop,
|
|
19
|
+
onSelect,
|
|
20
|
+
isOpen,
|
|
21
|
+
onOpenChange,
|
|
22
|
+
...props
|
|
23
|
+
}: NavTreeProps & NavTreeContextValue) => {
|
|
24
|
+
const [tab, setTab] = useState('never');
|
|
25
|
+
|
|
26
|
+
const contextValue = useMemo(
|
|
27
|
+
() => ({
|
|
28
|
+
tab,
|
|
29
|
+
onTabChange: (node: NavTreeItemGraphNode) => setTab(node.id),
|
|
30
|
+
getActions,
|
|
31
|
+
loadDescendents,
|
|
32
|
+
renderItemEnd,
|
|
33
|
+
popoverAnchorId,
|
|
34
|
+
getItems,
|
|
35
|
+
getProps,
|
|
36
|
+
isCurrent,
|
|
37
|
+
isOpen,
|
|
38
|
+
onOpenChange,
|
|
39
|
+
canDrop,
|
|
40
|
+
onSelect,
|
|
41
|
+
}),
|
|
42
|
+
[
|
|
43
|
+
tab,
|
|
44
|
+
setTab,
|
|
45
|
+
getActions,
|
|
46
|
+
loadDescendents,
|
|
47
|
+
renderItemEnd,
|
|
48
|
+
popoverAnchorId,
|
|
49
|
+
getItems,
|
|
50
|
+
getProps,
|
|
51
|
+
isCurrent,
|
|
52
|
+
isOpen,
|
|
53
|
+
onOpenChange,
|
|
54
|
+
canDrop,
|
|
55
|
+
onSelect,
|
|
56
|
+
],
|
|
57
|
+
);
|
|
58
|
+
return (
|
|
59
|
+
<NavTreeContext.Provider value={contextValue}>
|
|
60
|
+
<NavTree {...props} />
|
|
61
|
+
</NavTreeContext.Provider>
|
|
62
|
+
);
|
|
63
|
+
};
|
package/src/translations.ts
CHANGED
|
@@ -13,14 +13,7 @@ export default [
|
|
|
13
13
|
'commands dialog title': 'Commands',
|
|
14
14
|
'command list input placeholder': 'Search for commands…',
|
|
15
15
|
'node actions menu invoker label': 'More options',
|
|
16
|
-
'warning title': 'WARNING',
|
|
17
|
-
'technology preview message': 'Composer is still in technology preview.',
|
|
18
|
-
'learn more label': 'Learn more',
|
|
19
|
-
'released message': 'This version released {{released}}.',
|
|
20
|
-
'see release label': 'See release on GitHub',
|
|
21
|
-
'powered by dxos message': 'Powered by <dxos>DXOS</dxos>',
|
|
22
16
|
'tree item actions label': 'More actions',
|
|
23
|
-
'tree item searchlist input placeholder': 'Search for actions…',
|
|
24
17
|
'empty branch message': ' ',
|
|
25
18
|
},
|
|
26
19
|
},
|
package/src/types.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { type Action, type ActionLike, type Node } from '@dxos/app-graph';
|
|
6
6
|
import { type Label } from '@dxos/react-ui';
|
|
7
|
-
import { type MaybePromise } from '@dxos/util';
|
|
7
|
+
import { type MaybePromise, type Position } from '@dxos/util';
|
|
8
8
|
|
|
9
9
|
export type NavTreeItemGraphNode = Node<
|
|
10
10
|
any,
|
|
@@ -31,6 +31,7 @@ type SharedProperties = {
|
|
|
31
31
|
label: Label;
|
|
32
32
|
icon?: string;
|
|
33
33
|
disabled?: boolean;
|
|
34
|
+
position?: Position;
|
|
34
35
|
testId?: string;
|
|
35
36
|
className?: string;
|
|
36
37
|
headingClassName?: string;
|
|
@@ -47,7 +48,7 @@ export type ActionProperties = SharedProperties & {
|
|
|
47
48
|
disposition?: string;
|
|
48
49
|
hidden?: boolean;
|
|
49
50
|
caller?: string;
|
|
50
|
-
menuType?: '
|
|
51
|
+
menuType?: 'dropdown';
|
|
51
52
|
keyBinding?: string | KeyBinding;
|
|
52
53
|
};
|
|
53
54
|
|
package/src/util.ts
CHANGED
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
ACTION_TYPE,
|
|
11
11
|
ACTION_GROUP_TYPE,
|
|
12
12
|
isAction,
|
|
13
|
+
isActionLike,
|
|
13
14
|
} from '@dxos/app-graph';
|
|
14
15
|
import { nonNullable } from '@dxos/util';
|
|
15
16
|
|
|
@@ -126,3 +127,56 @@ export const expandChildren = (graph: Graph, node: Node) => {
|
|
|
126
127
|
export const expandActions = (graph: Graph, node: Node) => {
|
|
127
128
|
return Promise.all([graph.expand(node, 'outbound', ACTION_TYPE), graph.expand(node, 'outbound', ACTION_GROUP_TYPE)]);
|
|
128
129
|
};
|
|
130
|
+
|
|
131
|
+
export const l0ItemType = (item: Node<any>) => {
|
|
132
|
+
if (item.properties.disposition === 'collection') {
|
|
133
|
+
return 'collection';
|
|
134
|
+
} else if (isActionLike(item)) {
|
|
135
|
+
return 'action';
|
|
136
|
+
} else if (item.properties.disposition === 'navigation') {
|
|
137
|
+
return 'link';
|
|
138
|
+
} else {
|
|
139
|
+
return 'tab';
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
// Regular expression to match renderable characters
|
|
144
|
+
// Excludes control characters, combining marks, and other non-renderable characters
|
|
145
|
+
const renderableCharRegex =
|
|
146
|
+
/^(?![\p{Control}\p{Mark}\p{Separator}\p{Surrogate}\p{Unassigned}])[\p{L}\p{N}\p{P}\p{S}\p{Emoji}]$/u;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Returns the first two renderable characters from a string that are separated by non-word characters.
|
|
150
|
+
* Handles Unicode characters correctly.
|
|
151
|
+
*
|
|
152
|
+
* @param {string} label - The input string to process
|
|
153
|
+
* @returns {[string, string]} Array containing the two characters, or empty strings if not found
|
|
154
|
+
*/
|
|
155
|
+
export const getFirstTwoRenderableChars = (label: string) => {
|
|
156
|
+
// Convert string to array of Unicode characters
|
|
157
|
+
const characters = Array.from(label);
|
|
158
|
+
|
|
159
|
+
// Keep track of found renderable characters
|
|
160
|
+
const result = ['', ''];
|
|
161
|
+
let foundFirst = false;
|
|
162
|
+
|
|
163
|
+
for (let i = 0; i < characters.length; i++) {
|
|
164
|
+
const char = characters[i];
|
|
165
|
+
|
|
166
|
+
if (renderableCharRegex.test(char)) {
|
|
167
|
+
if (!foundFirst) {
|
|
168
|
+
result[0] = char;
|
|
169
|
+
foundFirst = true;
|
|
170
|
+
} else {
|
|
171
|
+
// Check if there's at least one non-word character between the first and current char
|
|
172
|
+
const textBetween = characters.slice(result[0].length, i).join('');
|
|
173
|
+
if (/[^\p{L}\p{N}_]/u.test(textBetween)) {
|
|
174
|
+
result[1] = char;
|
|
175
|
+
break;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
return result;
|
|
182
|
+
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const NAVTREE_PLUGIN = 'dxos.org/plugin/navtree';\n\n// TODO(wittjosiah): Factor out.\nexport const KEY_BINDING = 'KeyBinding';\n\nexport default {\n id: NAVTREE_PLUGIN,\n} satisfies PluginMeta;\n"],
|
|
5
|
-
"mappings": ";AAMO,IAAMA,iBAAiB;AAGvB,IAAMC,cAAc;AAE3B,IAAA,eAAe;EACbC,IAAIF;AACN;",
|
|
6
|
-
"names": ["NAVTREE_PLUGIN", "KEY_BINDING", "id"]
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NavTreeFooter.d.ts","sourceRoot":"","sources":["../../../../src/components/NavTreeFooter.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,KAAK,UAAU,EAKhB,MAAM,qBAAqB,CAAC;AAwB7B,eAAO,MAAM,aAAa,UAAW;IAAE,UAAU,CAAC,EAAE,UAAU,CAAA;CAAE,sBAuH/D,CAAC"}
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { ArrowSquareOut, GearSix, Warning } from '@phosphor-icons/react';
|
|
6
|
-
import { formatDistance } from 'date-fns/formatDistance';
|
|
7
|
-
import React from 'react';
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
type LayoutPart,
|
|
11
|
-
SettingsAction,
|
|
12
|
-
parseNavigationPlugin,
|
|
13
|
-
useResolvePlugin,
|
|
14
|
-
useIntentDispatcher,
|
|
15
|
-
} from '@dxos/app-framework';
|
|
16
|
-
import { useConfig } from '@dxos/react-client';
|
|
17
|
-
import {
|
|
18
|
-
Button,
|
|
19
|
-
Link,
|
|
20
|
-
Message,
|
|
21
|
-
Popover,
|
|
22
|
-
Tooltip,
|
|
23
|
-
Trans,
|
|
24
|
-
useDefaultValue,
|
|
25
|
-
useSidebars,
|
|
26
|
-
useTranslation,
|
|
27
|
-
} from '@dxos/react-ui';
|
|
28
|
-
import { LayoutControls } from '@dxos/react-ui-stack';
|
|
29
|
-
import { getSize, mx } from '@dxos/react-ui-theme';
|
|
30
|
-
|
|
31
|
-
import { NAVTREE_PLUGIN } from '../meta';
|
|
32
|
-
|
|
33
|
-
const buttonStyles = 'pli-1.5 text-xs font-normal';
|
|
34
|
-
|
|
35
|
-
const repo = 'https://github.com/dxos/dxos';
|
|
36
|
-
|
|
37
|
-
const VERSION_REGEX = /([\d.]+)/;
|
|
38
|
-
|
|
39
|
-
export const NavTreeFooter = (props: { layoutPart?: LayoutPart }) => {
|
|
40
|
-
const layoutPart = useDefaultValue(props.layoutPart, () => 'sidebar');
|
|
41
|
-
const config = useConfig();
|
|
42
|
-
const { t } = useTranslation(NAVTREE_PLUGIN);
|
|
43
|
-
const { navigationSidebarOpen } = useSidebars(NAVTREE_PLUGIN);
|
|
44
|
-
const dispatch = useIntentDispatcher();
|
|
45
|
-
const { version, timestamp, commitHash } = config.values.runtime?.app?.build ?? {};
|
|
46
|
-
const navigationPlugin = useResolvePlugin(parseNavigationPlugin);
|
|
47
|
-
const [_, v] = version?.match(VERSION_REGEX) ?? [];
|
|
48
|
-
|
|
49
|
-
const releaseUrl =
|
|
50
|
-
config.values.runtime?.app?.env?.DX_ENVIRONMENT === 'production'
|
|
51
|
-
? `${repo}/releases/tag/v${version}`
|
|
52
|
-
: `${repo}/commit/${commitHash}`;
|
|
53
|
-
|
|
54
|
-
const previewUrl = 'https://docs.dxos.org/composer#technology-preview';
|
|
55
|
-
|
|
56
|
-
return (
|
|
57
|
-
<div
|
|
58
|
-
role='none'
|
|
59
|
-
className={mx(
|
|
60
|
-
'flex bs-[--rail-size] pbe-[env(safe-area-inset-bottom)] box-content justify-end',
|
|
61
|
-
layoutPart === 'complementary' && 'md:justify-end flex-row-reverse',
|
|
62
|
-
)}
|
|
63
|
-
>
|
|
64
|
-
<Popover.Root>
|
|
65
|
-
<Popover.Trigger asChild>
|
|
66
|
-
<Button variant='ghost' classNames={buttonStyles} {...(!navigationSidebarOpen && { tabIndex: -1 })}>
|
|
67
|
-
v{v}
|
|
68
|
-
</Button>
|
|
69
|
-
</Popover.Trigger>
|
|
70
|
-
<Popover.Portal>
|
|
71
|
-
<Popover.Content
|
|
72
|
-
side='top'
|
|
73
|
-
role='message'
|
|
74
|
-
classNames='z-[12] bg-warning-500 max-is-[min(calc(100vw-16px),40ch)]'
|
|
75
|
-
>
|
|
76
|
-
<Message.Root valence='warning' className='rounded-be-none p-5'>
|
|
77
|
-
<Message.Title>
|
|
78
|
-
<Warning weight='duotone' className='inline mie-2 is-6 bs-6' />
|
|
79
|
-
<span>{t('warning title')}</span>
|
|
80
|
-
</Message.Title>
|
|
81
|
-
<Message.Body>
|
|
82
|
-
{t('technology preview message')}
|
|
83
|
-
<br />
|
|
84
|
-
<Link href={previewUrl} target='_blank' rel='noreferrer' variant='neutral'>
|
|
85
|
-
{t('learn more label')}
|
|
86
|
-
<ArrowSquareOut className='inline mis-1' weight='bold' />
|
|
87
|
-
</Link>
|
|
88
|
-
</Message.Body>
|
|
89
|
-
</Message.Root>
|
|
90
|
-
<div role='none' className='plb-4 pli-5 space-b-2 text-baseText'>
|
|
91
|
-
{timestamp && (
|
|
92
|
-
<p>
|
|
93
|
-
{t('released message', {
|
|
94
|
-
released: formatDistance(new Date(timestamp), new Date(), { addSuffix: true }),
|
|
95
|
-
})}
|
|
96
|
-
<br />
|
|
97
|
-
<Link href={releaseUrl} target='_blank' rel='noreferrer' variant='neutral'>
|
|
98
|
-
{t('see release label')}
|
|
99
|
-
<ArrowSquareOut className='inline mis-1' weight='bold' />
|
|
100
|
-
</Link>
|
|
101
|
-
</p>
|
|
102
|
-
)}
|
|
103
|
-
<p>
|
|
104
|
-
<Trans
|
|
105
|
-
{...{
|
|
106
|
-
t,
|
|
107
|
-
i18nKey: 'powered by dxos message',
|
|
108
|
-
components: {
|
|
109
|
-
dxos: <Link href='https://dxos.org' target='_blank' rel='noreferrer' variant='neutral' />,
|
|
110
|
-
},
|
|
111
|
-
}}
|
|
112
|
-
/>
|
|
113
|
-
</p>
|
|
114
|
-
</div>
|
|
115
|
-
<Popover.Arrow />
|
|
116
|
-
</Popover.Content>
|
|
117
|
-
</Popover.Portal>
|
|
118
|
-
</Popover.Root>
|
|
119
|
-
|
|
120
|
-
<Tooltip.Root>
|
|
121
|
-
<Tooltip.Trigger asChild>
|
|
122
|
-
{/* TODO(burdon): Reconcile with action created by LayoutPlugin. */}
|
|
123
|
-
<Button
|
|
124
|
-
variant='ghost'
|
|
125
|
-
classNames={buttonStyles}
|
|
126
|
-
data-testid='treeView.openSettings'
|
|
127
|
-
data-joyride='welcome/settings'
|
|
128
|
-
{...(!navigationSidebarOpen && { tabIndex: -1 })}
|
|
129
|
-
onClick={() => dispatch({ action: SettingsAction.OPEN })}
|
|
130
|
-
>
|
|
131
|
-
<span className='sr-only'>{t('open settings label')}</span>
|
|
132
|
-
<GearSix className={mx(getSize(5), 'rotate-90')} />
|
|
133
|
-
</Button>
|
|
134
|
-
</Tooltip.Trigger>
|
|
135
|
-
<Tooltip.Portal>
|
|
136
|
-
<Tooltip.Content classNames='z-[12]'>
|
|
137
|
-
{t('open settings label')}
|
|
138
|
-
<Tooltip.Arrow />
|
|
139
|
-
</Tooltip.Content>
|
|
140
|
-
</Tooltip.Portal>
|
|
141
|
-
</Tooltip.Root>
|
|
142
|
-
|
|
143
|
-
{/* NOTE(thure): Unpinning from the NavTree’s default position in Deck is temporarily disabled. */}
|
|
144
|
-
{navigationPlugin?.meta.id === 'dxos.org/plugin/deck' && (
|
|
145
|
-
<LayoutControls
|
|
146
|
-
variant='hide-disabled'
|
|
147
|
-
capabilities={{
|
|
148
|
-
incrementStart: false,
|
|
149
|
-
incrementEnd: false,
|
|
150
|
-
}}
|
|
151
|
-
onClick={(_type) => {
|
|
152
|
-
// TODO(Zan): If we inmplement pinning again, we should dispatch here.
|
|
153
|
-
}}
|
|
154
|
-
/>
|
|
155
|
-
)}
|
|
156
|
-
</div>
|
|
157
|
-
);
|
|
158
|
-
};
|