@dxos/plugin-navtree 0.7.5-labs.a279d8c → 0.7.5-labs.ea4b4c2
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-OF4MMBLH.mjs → app-graph-builder-BL7LRXCM.mjs} +7 -5
- package/dist/lib/browser/{app-graph-builder-OF4MMBLH.mjs.map → app-graph-builder-BL7LRXCM.mjs.map} +3 -3
- package/dist/lib/browser/chunk-54MPRXMH.mjs +1109 -0
- package/dist/lib/browser/chunk-54MPRXMH.mjs.map +7 -0
- package/dist/lib/browser/{chunk-OI7AAA6Q.mjs → chunk-AOAGODQB.mjs} +1 -1
- package/dist/lib/browser/chunk-AOAGODQB.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +21 -26
- 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/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-HT65TAYL.mjs → state-65TQKYX7.mjs} +6 -9
- package/dist/lib/browser/state-65TQKYX7.mjs.map +7 -0
- package/dist/types/src/NavTreePlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +22 -22
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +3 -2
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +88 -32
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +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/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 +1 -1
- package/dist/types/src/components/NavTreeItemAction.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/index.d.ts +2 -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/hooks.d.ts +3 -0
- package/dist/types/src/hooks.d.ts.map +1 -0
- 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 -6
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +2 -1
- 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 -1
- package/package.json +33 -31
- package/src/NavTreePlugin.tsx +8 -10
- package/src/capabilities/app-graph-builder.ts +6 -4
- package/src/capabilities/capabilities.ts +3 -2
- package/src/capabilities/intent-resolver.ts +22 -16
- package/src/capabilities/react-surface.tsx +15 -41
- package/src/capabilities/state.ts +5 -8
- package/src/components/CommandsDialog.tsx +3 -4
- package/src/components/CommandsTrigger.tsx +7 -5
- 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 -116
- package/src/components/NavTreeContainer.tsx +106 -32
- package/src/components/NavTreeContext.tsx +13 -0
- package/src/components/NavTreeItemAction.tsx +12 -4
- package/src/components/NavTreeItemColumns.tsx +71 -0
- package/src/components/NotchStart.tsx +2 -2
- package/src/components/index.ts +2 -0
- package/src/components/types.ts +33 -0
- package/src/hooks.ts +21 -0
- package/src/stories/Graph.stories.tsx +5 -4
- package/src/stories/StorybookNavTree.tsx +63 -0
- package/src/translations.ts +0 -6
- package/src/types.ts +2 -1
- package/src/util.ts +54 -0
- package/dist/lib/browser/chunk-IMGT2LAL.mjs +0 -658
- package/dist/lib/browser/chunk-IMGT2LAL.mjs.map +0 -7
- package/dist/lib/browser/chunk-OI7AAA6Q.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-74JPWYBP.mjs +0 -42
- package/dist/lib/browser/intent-resolver-74JPWYBP.mjs.map +0 -7
- package/dist/lib/browser/react-surface-6QWXI53A.mjs +0 -189
- package/dist/lib/browser/react-surface-6QWXI53A.mjs.map +0 -7
- package/dist/lib/browser/state-HT65TAYL.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 -161
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { formatDistance } from 'date-fns/formatDistance';
|
|
6
|
-
import React from 'react';
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
type LayoutPart,
|
|
10
|
-
SettingsAction,
|
|
11
|
-
useIntentDispatcher,
|
|
12
|
-
createIntent,
|
|
13
|
-
usePluginManager,
|
|
14
|
-
} from '@dxos/app-framework';
|
|
15
|
-
import { useConfig } from '@dxos/react-client';
|
|
16
|
-
import {
|
|
17
|
-
Button,
|
|
18
|
-
Link,
|
|
19
|
-
Message,
|
|
20
|
-
Popover,
|
|
21
|
-
Tooltip,
|
|
22
|
-
Trans,
|
|
23
|
-
useDefaultValue,
|
|
24
|
-
useSidebars,
|
|
25
|
-
useTranslation,
|
|
26
|
-
Icon,
|
|
27
|
-
IconButton,
|
|
28
|
-
} from '@dxos/react-ui';
|
|
29
|
-
import { LayoutControls } from '@dxos/react-ui-stack';
|
|
30
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
31
|
-
|
|
32
|
-
import { NAVTREE_PLUGIN } from '../meta';
|
|
33
|
-
|
|
34
|
-
const buttonStyles = '!pli-1.5 text-xs font-normal';
|
|
35
|
-
|
|
36
|
-
const repo = 'https://github.com/dxos/dxos';
|
|
37
|
-
|
|
38
|
-
const VERSION_REGEX = /([\d.]+)/;
|
|
39
|
-
|
|
40
|
-
export const NavTreeFooter = (props: { layoutPart?: LayoutPart }) => {
|
|
41
|
-
const layoutPart = useDefaultValue(props.layoutPart, () => 'sidebar');
|
|
42
|
-
const config = useConfig();
|
|
43
|
-
const { t } = useTranslation(NAVTREE_PLUGIN);
|
|
44
|
-
const { navigationSidebarOpen } = useSidebars(NAVTREE_PLUGIN);
|
|
45
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
46
|
-
const { version, timestamp, commitHash } = config.values.runtime?.app?.build ?? {};
|
|
47
|
-
const manager = usePluginManager();
|
|
48
|
-
const [_, v] = version?.match(VERSION_REGEX) ?? [];
|
|
49
|
-
|
|
50
|
-
const releaseUrl =
|
|
51
|
-
config.values.runtime?.app?.env?.DX_ENVIRONMENT === 'production'
|
|
52
|
-
? `${repo}/releases/tag/v${version}`
|
|
53
|
-
: `${repo}/commit/${commitHash}`;
|
|
54
|
-
|
|
55
|
-
const previewUrl = 'https://docs.dxos.org/composer#technology-preview';
|
|
56
|
-
|
|
57
|
-
return (
|
|
58
|
-
<div
|
|
59
|
-
role='none'
|
|
60
|
-
className={mx(
|
|
61
|
-
'flex pbe-[env(safe-area-inset-bottom)] box-content justify-end',
|
|
62
|
-
layoutPart === 'complementary' && 'md:justify-end flex-row-reverse',
|
|
63
|
-
)}
|
|
64
|
-
>
|
|
65
|
-
<Popover.Root>
|
|
66
|
-
<Popover.Trigger asChild>
|
|
67
|
-
<Button variant='ghost' classNames={buttonStyles} {...(!navigationSidebarOpen && { tabIndex: -1 })}>
|
|
68
|
-
v{v}
|
|
69
|
-
</Button>
|
|
70
|
-
</Popover.Trigger>
|
|
71
|
-
<Popover.Portal>
|
|
72
|
-
<Popover.Content
|
|
73
|
-
side='top'
|
|
74
|
-
role='message'
|
|
75
|
-
classNames='z-[12] bg-warning-500 max-is-[min(calc(100vw-16px),40ch)]'
|
|
76
|
-
>
|
|
77
|
-
<Message.Root valence='warning' className='rounded-be-none p-5'>
|
|
78
|
-
<Message.Title>
|
|
79
|
-
<Icon icon='ph--warning--duotone' size={6} classNames='inline mie-2' />
|
|
80
|
-
<span>{t('warning title')}</span>
|
|
81
|
-
</Message.Title>
|
|
82
|
-
<Message.Body>
|
|
83
|
-
{t('technology preview message')}
|
|
84
|
-
<br />
|
|
85
|
-
<Link href={previewUrl} target='_blank' rel='noreferrer' variant='neutral'>
|
|
86
|
-
{t('learn more label')}
|
|
87
|
-
<Icon icon='ph--arrow-square-out--bold' classNames='inline mis-1' />
|
|
88
|
-
</Link>
|
|
89
|
-
</Message.Body>
|
|
90
|
-
</Message.Root>
|
|
91
|
-
<div role='none' className='plb-4 pli-5 space-b-2 text-baseText'>
|
|
92
|
-
{timestamp && (
|
|
93
|
-
<p>
|
|
94
|
-
{t('released message', {
|
|
95
|
-
released: formatDistance(new Date(timestamp), new Date(), { addSuffix: true }),
|
|
96
|
-
})}
|
|
97
|
-
<br />
|
|
98
|
-
<Link href={releaseUrl} target='_blank' rel='noreferrer' variant='neutral'>
|
|
99
|
-
{t('see release label')}
|
|
100
|
-
<Icon icon='ph--arrow-square-out--bold' classNames='inline mis-1' />
|
|
101
|
-
</Link>
|
|
102
|
-
</p>
|
|
103
|
-
)}
|
|
104
|
-
<p>
|
|
105
|
-
<Trans
|
|
106
|
-
{...{
|
|
107
|
-
t,
|
|
108
|
-
i18nKey: 'powered by dxos message',
|
|
109
|
-
components: {
|
|
110
|
-
dxos: <Link href='https://dxos.org' target='_blank' rel='noreferrer' variant='neutral' />,
|
|
111
|
-
},
|
|
112
|
-
}}
|
|
113
|
-
/>
|
|
114
|
-
</p>
|
|
115
|
-
</div>
|
|
116
|
-
<Popover.Arrow />
|
|
117
|
-
</Popover.Content>
|
|
118
|
-
</Popover.Portal>
|
|
119
|
-
</Popover.Root>
|
|
120
|
-
|
|
121
|
-
<Tooltip.Root>
|
|
122
|
-
<Tooltip.Trigger asChild>
|
|
123
|
-
{/* TODO(burdon): Reconcile with action created by LayoutPlugin. */}
|
|
124
|
-
<IconButton
|
|
125
|
-
icon='ph--gear-six--regular'
|
|
126
|
-
iconOnly
|
|
127
|
-
label={t('open settings label')}
|
|
128
|
-
size={4}
|
|
129
|
-
variant='ghost'
|
|
130
|
-
classNames={buttonStyles}
|
|
131
|
-
data-testid='treeView.openSettings'
|
|
132
|
-
data-joyride='welcome/settings'
|
|
133
|
-
{...(!navigationSidebarOpen && { tabIndex: -1 })}
|
|
134
|
-
iconClassNames='rotate-90'
|
|
135
|
-
onClick={() => dispatch(createIntent(SettingsAction.Open))}
|
|
136
|
-
/>
|
|
137
|
-
</Tooltip.Trigger>
|
|
138
|
-
<Tooltip.Portal>
|
|
139
|
-
<Tooltip.Content classNames='z-[12]'>
|
|
140
|
-
{t('open settings label')}
|
|
141
|
-
<Tooltip.Arrow />
|
|
142
|
-
</Tooltip.Content>
|
|
143
|
-
</Tooltip.Portal>
|
|
144
|
-
</Tooltip.Root>
|
|
145
|
-
|
|
146
|
-
{/* NOTE(thure): Unpinning from the NavTree’s default position in Deck is temporarily disabled. */}
|
|
147
|
-
{manager.enabled.includes('dxos.org/plugin/deck') && (
|
|
148
|
-
<LayoutControls
|
|
149
|
-
variant='hide-disabled'
|
|
150
|
-
capabilities={{
|
|
151
|
-
incrementStart: false,
|
|
152
|
-
incrementEnd: false,
|
|
153
|
-
}}
|
|
154
|
-
onClick={(_type) => {
|
|
155
|
-
// TODO(Zan): If we inmplement pinning again, we should dispatch here.
|
|
156
|
-
}}
|
|
157
|
-
/>
|
|
158
|
-
)}
|
|
159
|
-
</div>
|
|
160
|
-
);
|
|
161
|
-
};
|