@dxos/plugin-stack 0.12.0-next-2800d0376abcc62d5544afdd744b16b2b960434e → 0.13.0
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/PLUGIN.mdl +72 -9
- package/dist/lib/capabilities.browser.mjs +18 -0
- package/dist/lib/capabilities.browser.mjs.map +1 -0
- package/dist/lib/capabilities.mjs +2 -2
- package/dist/lib/capabilities.mjs.map +1 -1
- package/dist/lib/capabilities.node.mjs.map +1 -1
- package/dist/lib/capabilities.tauri.mjs +18 -0
- package/dist/lib/capabilities.tauri.mjs.map +1 -0
- package/dist/lib/capabilities.workerd.mjs.map +1 -1
- package/dist/lib/chunk-PLUGIN.mjs +6 -0
- package/dist/lib/chunk-PLUGIN.mjs.map +1 -0
- package/dist/lib/chunk-StackArticle.mjs +16 -17
- package/dist/lib/chunk-StackArticle.mjs.map +1 -1
- package/dist/lib/chunk-react-surface.mjs +2 -2
- package/dist/lib/chunk-react-surface.mjs.map +1 -1
- package/dist/lib/components.mjs +62 -52
- package/dist/lib/components.mjs.map +1 -1
- package/dist/lib/containers.mjs.map +1 -1
- package/dist/lib/index.mjs +0 -1
- package/dist/lib/meta.mjs.map +1 -1
- package/dist/lib/translations.mjs.map +1 -1
- package/dist/types/src/capabilities/gen/browser.d.ts +5 -0
- package/dist/types/src/capabilities/gen/browser.d.ts.map +1 -0
- package/dist/types/src/capabilities/gen/node.d.ts.map +1 -1
- package/dist/types/src/capabilities/gen/tauri.d.ts +5 -0
- package/dist/types/src/capabilities/gen/tauri.d.ts.map +1 -0
- package/dist/types/src/capabilities/gen/workerd.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/components/Stack/Stack.d.ts +4 -13
- package/dist/types/src/components/Stack/Stack.d.ts.map +1 -1
- package/dist/types/src/components/Stack/StackContext.d.ts +1 -1
- package/dist/types/src/components/Stack/StackContext.d.ts.map +1 -1
- package/dist/types/src/components/Stack/index.d.ts +2 -2
- package/dist/types/src/components/Stack/index.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/StackArticle/StackArticle.d.ts +1 -1
- package/dist/types/src/containers/StackArticle/StackArticle.d.ts.map +1 -1
- package/dist/types/src/containers/StackArticle/StackArticle.stories.d.ts +1 -1
- package/dist/types/src/containers/StackArticle/StackArticle.stories.d.ts.map +1 -1
- package/dist/types/src/containers/StackArticle/index.d.ts +1 -1
- package/dist/types/src/containers/StackArticle/index.d.ts.map +1 -1
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- 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 +34 -32
- package/src/capabilities/gen/browser.ts +27 -0
- package/src/capabilities/gen/node.ts +1 -1
- package/src/capabilities/gen/tauri.ts +27 -0
- package/src/capabilities/gen/workerd.ts +1 -1
- package/src/capabilities/index.ts +2 -2
- package/src/capabilities/react-surface.ts +2 -2
- package/src/components/Stack/Stack.tsx +67 -62
- package/src/components/Stack/StackContext.ts +1 -1
- package/src/components/Stack/index.ts +2 -2
- package/src/components/index.ts +1 -1
- package/src/containers/StackArticle/StackArticle.stories.tsx +4 -4
- package/src/containers/StackArticle/StackArticle.tsx +24 -26
- package/src/containers/StackArticle/index.ts +1 -1
- package/src/containers/index.ts +1 -1
- package/src/index.ts +1 -2
- package/src/meta.ts +1 -1
- package/src/translations.ts +2 -2
- package/src/types/index.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-stack",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "DXOS Surface plugin for Stack entities",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -10,19 +10,21 @@
|
|
|
10
10
|
},
|
|
11
11
|
"license": "FSL-1.1-Apache-2.0",
|
|
12
12
|
"author": "DXOS.org",
|
|
13
|
-
"sideEffects":
|
|
13
|
+
"sideEffects": false,
|
|
14
14
|
"type": "module",
|
|
15
15
|
"imports": {
|
|
16
16
|
"#capabilities": {
|
|
17
17
|
"source": {
|
|
18
18
|
"workerd": "./src/capabilities/gen/workerd.ts",
|
|
19
19
|
"node": "./src/capabilities/gen/node.ts",
|
|
20
|
-
"
|
|
20
|
+
"tauri": "./src/capabilities/gen/tauri.ts",
|
|
21
|
+
"browser": "./src/capabilities/gen/browser.ts"
|
|
21
22
|
},
|
|
22
23
|
"types": "./dist/types/src/capabilities/index.d.ts",
|
|
23
24
|
"workerd": "./dist/lib/capabilities.workerd.mjs",
|
|
24
25
|
"node": "./dist/lib/capabilities.node.mjs",
|
|
25
|
-
"
|
|
26
|
+
"tauri": "./dist/lib/capabilities.tauri.mjs",
|
|
27
|
+
"browser": "./dist/lib/capabilities.browser.mjs"
|
|
26
28
|
},
|
|
27
29
|
"#components": {
|
|
28
30
|
"source": "./src/components/index.ts",
|
|
@@ -102,44 +104,44 @@
|
|
|
102
104
|
"PLUGIN.mdl"
|
|
103
105
|
],
|
|
104
106
|
"dependencies": {
|
|
105
|
-
"@effect/atom-react": "4.0.0
|
|
106
|
-
"effect": "4.0.0
|
|
107
|
-
"@dxos/app-framework": "0.
|
|
108
|
-
"@dxos/app-toolkit": "0.
|
|
109
|
-
"@dxos/
|
|
110
|
-
"@dxos/
|
|
111
|
-
"@dxos/
|
|
112
|
-
"@dxos/react-ui-
|
|
113
|
-
"@dxos/react-ui-
|
|
114
|
-
"@dxos/react-ui-
|
|
115
|
-
"@dxos/
|
|
116
|
-
"@dxos/
|
|
107
|
+
"@effect/atom-react": "4.0.0",
|
|
108
|
+
"effect": "4.0.0",
|
|
109
|
+
"@dxos/app-framework": "0.13.0",
|
|
110
|
+
"@dxos/app-toolkit": "0.13.0",
|
|
111
|
+
"@dxos/plugin-space": "0.13.0",
|
|
112
|
+
"@dxos/react-ui-attention": "0.13.0",
|
|
113
|
+
"@dxos/keys": "0.13.0",
|
|
114
|
+
"@dxos/react-ui-dnd": "0.13.0",
|
|
115
|
+
"@dxos/react-ui-menu": "0.13.0",
|
|
116
|
+
"@dxos/react-ui-mosaic": "0.13.0",
|
|
117
|
+
"@dxos/util": "0.13.0",
|
|
118
|
+
"@dxos/echo": "0.13.0"
|
|
117
119
|
},
|
|
118
120
|
"devDependencies": {
|
|
119
|
-
"@storybook/react-vite": "^10.
|
|
121
|
+
"@storybook/react-vite": "^10.6.0",
|
|
120
122
|
"@types/react": "~19.2.17",
|
|
121
123
|
"@types/react-dom": "~19.2.3",
|
|
122
124
|
"react": "~19.2.7",
|
|
123
125
|
"react-dom": "~19.2.7",
|
|
124
|
-
"vite": "^8.2.
|
|
125
|
-
"@dxos/echo-react": "0.
|
|
126
|
-
"@dxos/plugin-illustrator": "0.
|
|
127
|
-
"@dxos/plugin-markdown": "0.
|
|
128
|
-
"@dxos/plugin-
|
|
129
|
-
"@dxos/plugin-tldraw": "0.
|
|
130
|
-
"@dxos/
|
|
131
|
-
"@dxos/random": "0.
|
|
132
|
-
"@dxos/
|
|
133
|
-
"@dxos/ui
|
|
134
|
-
"@dxos/
|
|
126
|
+
"vite": "^8.2.2",
|
|
127
|
+
"@dxos/echo-react": "0.13.0",
|
|
128
|
+
"@dxos/plugin-illustrator": "0.13.0",
|
|
129
|
+
"@dxos/plugin-markdown": "0.13.0",
|
|
130
|
+
"@dxos/plugin-testing": "0.13.0",
|
|
131
|
+
"@dxos/plugin-tldraw": "0.13.0",
|
|
132
|
+
"@dxos/react-client": "0.13.0",
|
|
133
|
+
"@dxos/random": "0.13.0",
|
|
134
|
+
"@dxos/plugin-client": "0.13.0",
|
|
135
|
+
"@dxos/react-ui": "0.13.0",
|
|
136
|
+
"@dxos/ui-theme": "0.13.0"
|
|
135
137
|
},
|
|
136
138
|
"peerDependencies": {
|
|
137
|
-
"@effect/atom-react": "4.0.0
|
|
138
|
-
"effect": "4.0.0
|
|
139
|
+
"@effect/atom-react": "4.0.0",
|
|
140
|
+
"effect": "4.0.0",
|
|
139
141
|
"react": "~19.2.7",
|
|
140
142
|
"react-dom": "~19.2.7",
|
|
141
|
-
"@dxos/react-ui": "^0.
|
|
142
|
-
"@dxos/ui-theme": "^0.
|
|
143
|
+
"@dxos/react-ui": "^0.13.0",
|
|
144
|
+
"@dxos/ui-theme": "^0.13.0"
|
|
143
145
|
},
|
|
144
146
|
"publishConfig": {
|
|
145
147
|
"access": "public"
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// GENERATED by dx-plugin — do not edit. Sliced from ../index.ts for the 'browser' condition.
|
|
6
|
+
|
|
7
|
+
import * as AppCapability from '@dxos/app-toolkit/AppCapability';
|
|
8
|
+
|
|
9
|
+
import { meta } from '#meta';
|
|
10
|
+
import { translations } from '#translations';
|
|
11
|
+
|
|
12
|
+
import pluginSpec from '../../../PLUGIN.mdl?raw';
|
|
13
|
+
|
|
14
|
+
export const PluginAsset = AppCapability.pluginAsset({
|
|
15
|
+
pluginId: meta.profile.key,
|
|
16
|
+
path: 'PLUGIN.mdl',
|
|
17
|
+
content: pluginSpec,
|
|
18
|
+
mimeType: 'application/x-mdl',
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export const ReactSurface = AppCapability.surface(() => import('../react-surface.ts'), {
|
|
22
|
+
roles: ['org.dxos.role.article'],
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export const Schema = AppCapability.schema(() => import('../schema.ts'));
|
|
26
|
+
|
|
27
|
+
export const Translations = AppCapability.translations(translations);
|
|
@@ -8,7 +8,7 @@ import * as AppCapability from '@dxos/app-toolkit/AppCapability';
|
|
|
8
8
|
|
|
9
9
|
import { translations } from '#translations';
|
|
10
10
|
|
|
11
|
-
export const Schema = AppCapability.schema(() => import('../schema'));
|
|
11
|
+
export const Schema = AppCapability.schema(() => import('../schema.ts'));
|
|
12
12
|
|
|
13
13
|
export const Translations = AppCapability.translations(translations);
|
|
14
14
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// GENERATED by dx-plugin — do not edit. Sliced from ../index.ts for the 'tauri' condition.
|
|
6
|
+
|
|
7
|
+
import * as AppCapability from '@dxos/app-toolkit/AppCapability';
|
|
8
|
+
|
|
9
|
+
import { meta } from '#meta';
|
|
10
|
+
import { translations } from '#translations';
|
|
11
|
+
|
|
12
|
+
import pluginSpec from '../../../PLUGIN.mdl?raw';
|
|
13
|
+
|
|
14
|
+
export const PluginAsset = AppCapability.pluginAsset({
|
|
15
|
+
pluginId: meta.profile.key,
|
|
16
|
+
path: 'PLUGIN.mdl',
|
|
17
|
+
content: pluginSpec,
|
|
18
|
+
mimeType: 'application/x-mdl',
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export const ReactSurface = AppCapability.surface(() => import('../react-surface.ts'), {
|
|
22
|
+
roles: ['org.dxos.role.article'],
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export const Schema = AppCapability.schema(() => import('../schema.ts'));
|
|
26
|
+
|
|
27
|
+
export const Translations = AppCapability.translations(translations);
|
|
@@ -8,7 +8,7 @@ import * as AppCapability from '@dxos/app-toolkit/AppCapability';
|
|
|
8
8
|
|
|
9
9
|
import { translations } from '#translations';
|
|
10
10
|
|
|
11
|
-
export const Schema = AppCapability.schema(() => import('../schema'));
|
|
11
|
+
export const Schema = AppCapability.schema(() => import('../schema.ts'));
|
|
12
12
|
|
|
13
13
|
export const Translations = AppCapability.translations(translations);
|
|
14
14
|
|
|
@@ -16,8 +16,8 @@ export const PluginAsset = AppCapability.pluginAsset({
|
|
|
16
16
|
content: pluginSpec,
|
|
17
17
|
mimeType: 'application/x-mdl',
|
|
18
18
|
});
|
|
19
|
-
export const ReactSurface = AppCapability.surface(() => import('./react-surface'), {
|
|
19
|
+
export const ReactSurface = AppCapability.surface(() => import('./react-surface.ts'), {
|
|
20
20
|
roles: ['org.dxos.role.article'],
|
|
21
21
|
});
|
|
22
|
-
export const Schema = AppCapability.schema(() => import('./schema'));
|
|
22
|
+
export const Schema = AppCapability.schema(() => import('./schema.ts'));
|
|
23
23
|
export const Translations = AppCapability.translations(translations);
|
|
@@ -6,8 +6,8 @@ import * as Effect from 'effect/Effect';
|
|
|
6
6
|
|
|
7
7
|
import * as Capabilities from '@dxos/app-framework/Capabilities';
|
|
8
8
|
import * as Capability from '@dxos/app-framework/Capability';
|
|
9
|
-
import
|
|
10
|
-
import
|
|
9
|
+
import * as Surface from '@dxos/app-framework/Surface';
|
|
10
|
+
import * as AppSurface from '@dxos/app-toolkit/AppSurface';
|
|
11
11
|
import { Collection } from '@dxos/echo';
|
|
12
12
|
|
|
13
13
|
import { StackArticle } from '#containers';
|
|
@@ -12,25 +12,23 @@ import React, {
|
|
|
12
12
|
useState,
|
|
13
13
|
} from 'react';
|
|
14
14
|
|
|
15
|
-
import
|
|
15
|
+
import * as Surface from '@dxos/app-framework/Surface';
|
|
16
|
+
import * as AppSurface from '@dxos/app-toolkit/AppSurface';
|
|
17
|
+
import * as AttentionSigil from '@dxos/app-toolkit/AttentionSigil';
|
|
16
18
|
import * as GraphPath from '@dxos/app-toolkit/GraphPath';
|
|
17
|
-
import { AppSurface, AttentionSigilButton } from '@dxos/app-toolkit/ui';
|
|
18
19
|
import { Obj } from '@dxos/echo';
|
|
19
|
-
import {
|
|
20
|
-
DropdownMenu,
|
|
21
|
-
Icon,
|
|
22
|
-
ScrollArea,
|
|
23
|
-
ScrollAreaRootProps,
|
|
24
|
-
type ThemedClassName,
|
|
25
|
-
useTranslation,
|
|
26
|
-
} from '@dxos/react-ui';
|
|
27
20
|
import { useAttentionAttributes } from '@dxos/react-ui-attention';
|
|
28
21
|
import { type DndContainerHandler } from '@dxos/react-ui-dnd';
|
|
29
22
|
import { Mosaic, type MosaicTileProps } from '@dxos/react-ui-mosaic';
|
|
23
|
+
import * as Hooks from '@dxos/react-ui/Hooks';
|
|
24
|
+
import * as Icon from '@dxos/react-ui/Icon';
|
|
25
|
+
import * as Menu from '@dxos/react-ui/Menu';
|
|
26
|
+
import * as ScrollArea from '@dxos/react-ui/ScrollArea';
|
|
27
|
+
import type * as Util from '@dxos/react-ui/Util';
|
|
30
28
|
|
|
31
29
|
import { meta } from '#meta';
|
|
32
30
|
|
|
33
|
-
import { StackContext, useStack, useStackContext } from './StackContext';
|
|
31
|
+
import { StackContext, useStack, useStackContext } from './StackContext.ts';
|
|
34
32
|
|
|
35
33
|
//
|
|
36
34
|
// Types
|
|
@@ -119,9 +117,7 @@ StackRoot.displayName = 'Stack.Root';
|
|
|
119
117
|
// Content
|
|
120
118
|
//
|
|
121
119
|
|
|
122
|
-
type StackContentProps = ThemedClassName<
|
|
123
|
-
ComponentPropsWithoutRef<'div'> & Pick<ScrollAreaRootProps, 'centered' | 'thin' | 'padding'>
|
|
124
|
-
>;
|
|
120
|
+
type StackContentProps = Util.ThemedClassName<ComponentPropsWithoutRef<'div'>>;
|
|
125
121
|
|
|
126
122
|
const StackContent = forwardRef<HTMLDivElement, StackContentProps>(({ children, ...props }, forwardedRef) => {
|
|
127
123
|
const { eventHandler, viewport } = useStackContext('Stack.Content');
|
|
@@ -140,7 +136,7 @@ StackContent.displayName = 'Stack.Content';
|
|
|
140
136
|
// Viewport
|
|
141
137
|
//
|
|
142
138
|
|
|
143
|
-
type StackViewportProps = ThemedClassName<PropsWithChildren>;
|
|
139
|
+
type StackViewportProps = Util.ThemedClassName<PropsWithChildren>;
|
|
144
140
|
|
|
145
141
|
const StackViewport = forwardRef<HTMLDivElement, StackViewportProps>(
|
|
146
142
|
({ classNames, children }, forwardedRef: ForwardedRef<HTMLDivElement>) => {
|
|
@@ -185,7 +181,7 @@ type StackSectionProps = MosaicTileProps<StackSectionItem>;
|
|
|
185
181
|
// Inline grip glyph for the drag preview. The native drag image does not rasterize external SVG sprite
|
|
186
182
|
// `<use>` icons (e.g. `@dxos/react-ui` `Icon`), so the preview uses plain inline SVG circles instead.
|
|
187
183
|
const DragHandleGlyph = () => (
|
|
188
|
-
<svg width={10} height={16} viewBox='0 0 10 16' aria-hidden className='shrink-0 text-
|
|
184
|
+
<svg width={10} height={16} viewBox='0 0 10 16' aria-hidden className='shrink-0 text-fg-muted'>
|
|
189
185
|
{[3, 8, 13].flatMap((cy) =>
|
|
190
186
|
[2.5, 7.5].map((cx) => <circle key={`${cx}-${cy}`} cx={cx} cy={cy} r={1.1} fill='currentColor' />),
|
|
191
187
|
)}
|
|
@@ -194,7 +190,7 @@ const DragHandleGlyph = () => (
|
|
|
194
190
|
|
|
195
191
|
const StackSection = ({ data, ...tileProps }: StackSectionProps) => {
|
|
196
192
|
const { id, object } = data;
|
|
197
|
-
const { t } = useTranslation(meta.profile.key);
|
|
193
|
+
const { t } = Hooks.useTranslation(meta.profile.key);
|
|
198
194
|
const { attendableId: parentAttendableId, collapsed, onAdd, onMoveUp, onMoveDown, onCollapse, onDelete } = useStack();
|
|
199
195
|
const [optionsMenuOpen, setOptionsMenuOpen] = useState(false);
|
|
200
196
|
const attendableId = GraphPath.getCollectionObjectPath(parentAttendableId, object.id);
|
|
@@ -207,49 +203,58 @@ const StackSection = ({ data, ...tileProps }: StackSectionProps) => {
|
|
|
207
203
|
const rail = (
|
|
208
204
|
<div className='grid grid-rows-[min-content_1fr]'>
|
|
209
205
|
<div className='p-1 dx-toolbar-surface'>
|
|
210
|
-
<
|
|
211
|
-
<
|
|
212
|
-
<
|
|
213
|
-
<Icon icon={icon} classNames='transition-opacity' />
|
|
214
|
-
</
|
|
215
|
-
</
|
|
216
|
-
<
|
|
217
|
-
|
|
218
|
-
<
|
|
219
|
-
{
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
)
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
206
|
+
<Menu.Root open={optionsMenuOpen} onOpenChange={({ open }) => setOptionsMenuOpen(open)}>
|
|
207
|
+
<Menu.Trigger asChild>
|
|
208
|
+
<AttentionSigil.Button size='md' attendableId={attendableId}>
|
|
209
|
+
<Icon.Icon icon={icon} classNames='transition-opacity' />
|
|
210
|
+
</AttentionSigil.Button>
|
|
211
|
+
</Menu.Trigger>
|
|
212
|
+
<Menu.Content>
|
|
213
|
+
{isCollapsed ? (
|
|
214
|
+
<Menu.Item
|
|
215
|
+
item={{
|
|
216
|
+
value: 'section.expand',
|
|
217
|
+
label: t('expand.label'),
|
|
218
|
+
icon: 'ph--arrows-out-line-vertical--regular',
|
|
219
|
+
}}
|
|
220
|
+
onClick={() => onCollapse(id, false)}
|
|
221
|
+
data-testid='section.expand'
|
|
222
|
+
/>
|
|
223
|
+
) : (
|
|
224
|
+
<Menu.Item
|
|
225
|
+
item={{
|
|
226
|
+
value: 'section.collapse',
|
|
227
|
+
label: t('collapse.label'),
|
|
228
|
+
icon: 'ph--arrows-in-line-vertical--regular',
|
|
229
|
+
}}
|
|
230
|
+
onClick={() => onCollapse(id, true)}
|
|
231
|
+
data-testid='section.collapse'
|
|
232
|
+
/>
|
|
233
|
+
)}
|
|
234
|
+
<Menu.Separator />
|
|
235
|
+
<Menu.Item
|
|
236
|
+
item={{ value: 'section.add', label: t('add-section.label'), icon: 'ph--plus--regular' }}
|
|
237
|
+
onClick={() => onAdd(id)}
|
|
238
|
+
data-testid='section.add'
|
|
239
|
+
/>
|
|
240
|
+
<Menu.Item
|
|
241
|
+
item={{ value: 'section.move-up', label: t('move-up.label'), icon: 'ph--arrow-line-up--regular' }}
|
|
242
|
+
onClick={() => onMoveUp(id)}
|
|
243
|
+
data-testid='section.move-up'
|
|
244
|
+
/>
|
|
245
|
+
<Menu.Item
|
|
246
|
+
item={{ value: 'section.move-down', label: t('move-down.label'), icon: 'ph--arrow-line-down--regular' }}
|
|
247
|
+
onClick={() => onMoveDown(id)}
|
|
248
|
+
data-testid='section.move-down'
|
|
249
|
+
/>
|
|
250
|
+
<Menu.Separator />
|
|
251
|
+
<Menu.Item
|
|
252
|
+
item={{ value: 'section.remove', label: t('remove-section.label'), icon: 'ph--trash--regular' }}
|
|
253
|
+
onClick={() => onDelete(id)}
|
|
254
|
+
data-testid='section.remove'
|
|
255
|
+
/>
|
|
256
|
+
</Menu.Content>
|
|
257
|
+
</Menu.Root>
|
|
253
258
|
</div>
|
|
254
259
|
<div className='p-1'>
|
|
255
260
|
{/* Inline glyph (not a sprite `Icon`) so the handle stays visible in the tile's native drag image. */}
|
|
@@ -268,9 +273,9 @@ const StackSection = ({ data, ...tileProps }: StackSectionProps) => {
|
|
|
268
273
|
<Mosaic.Tile
|
|
269
274
|
{...tileProps}
|
|
270
275
|
data={data}
|
|
271
|
-
classNames='grid grid-cols-[var(--dx-rail-action)_1fr] dx-attention-surface border border-
|
|
276
|
+
classNames='grid grid-cols-[var(--dx-rail-action)_1fr] dx-attention-surface border border-separator-subtle'
|
|
272
277
|
>
|
|
273
|
-
<div className='border-e border-
|
|
278
|
+
<div className='border-e border-separator-subtle'>
|
|
274
279
|
<div className='sticky top-0 flex flex-col items-center'>{rail}</div>
|
|
275
280
|
</div>
|
|
276
281
|
<div {...attentionAttrs} className='min-w-0'>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { createContext, useContext } from 'react';
|
|
6
6
|
|
|
7
|
-
import { type StackContextType, type StackContextValue } from './Stack';
|
|
7
|
+
import { type StackContextType, type StackContextValue } from './Stack.tsx';
|
|
8
8
|
|
|
9
9
|
// Kept out of `Stack.tsx`: react-refresh only fast-refreshes a module whose exports are all
|
|
10
10
|
// components, so a context and its hook exported beside them force a full page reload on every edit.
|
package/src/components/index.ts
CHANGED
|
@@ -9,7 +9,7 @@ import React from 'react';
|
|
|
9
9
|
import * as Capability from '@dxos/app-framework/Capability';
|
|
10
10
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
11
11
|
import * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';
|
|
12
|
-
import
|
|
12
|
+
import * as AppSurface from '@dxos/app-toolkit/AppSurface';
|
|
13
13
|
import { Collection, Filter, Ref } from '@dxos/echo';
|
|
14
14
|
import { useQuery } from '@dxos/echo-react';
|
|
15
15
|
import { ClientPlugin, initializeIdentity } from '@dxos/plugin-client/testing';
|
|
@@ -18,7 +18,7 @@ import * as IllustratorPlugin from '@dxos/plugin-illustrator/IllustratorPlugin';
|
|
|
18
18
|
import * as Markdown from '@dxos/plugin-markdown/Markdown';
|
|
19
19
|
import { MarkdownPlugin } from '@dxos/plugin-markdown/testing';
|
|
20
20
|
import { SpacePlugin } from '@dxos/plugin-space/testing';
|
|
21
|
-
import
|
|
21
|
+
import * as CorePlugins from '@dxos/plugin-testing/CorePlugins';
|
|
22
22
|
import * as StorybookPlugin from '@dxos/plugin-testing/StorybookPlugin';
|
|
23
23
|
import * as Tldraw from '@dxos/plugin-tldraw/Tldraw';
|
|
24
24
|
import * as TldrawModel from '@dxos/plugin-tldraw/TldrawModel';
|
|
@@ -30,7 +30,7 @@ import { Loading, withLayout } from '@dxos/react-ui/testing';
|
|
|
30
30
|
|
|
31
31
|
import { translations } from '#translations';
|
|
32
32
|
|
|
33
|
-
import { StackArticle, type StackArticleProps } from './StackArticle';
|
|
33
|
+
import { StackArticle, type StackArticleProps } from './StackArticle.tsx';
|
|
34
34
|
|
|
35
35
|
// A minimal sketch (tldraw `tldraw.com/2`) snapshot, used as a test image.
|
|
36
36
|
const SKETCH_CONTENT = new TldrawModel.RecordBuilder()
|
|
@@ -60,7 +60,7 @@ const meta: Meta<typeof StackArticle> = {
|
|
|
60
60
|
withPluginManager({
|
|
61
61
|
capabilities: [Capability.contribute(AppCapabilities.Translations, translations)],
|
|
62
62
|
plugins: [
|
|
63
|
-
...
|
|
63
|
+
...CorePlugins.make(),
|
|
64
64
|
ClientPlugin.make({
|
|
65
65
|
types: [Collection.Collection, Markdown.Document, Drawing.Drawing, Drawing.Canvas],
|
|
66
66
|
onClientInitialized: ({ client }) =>
|
|
@@ -3,17 +3,20 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { useAtomValue } from '@effect/atom-react/Hooks';
|
|
6
|
-
import * as Atom from 'effect/
|
|
6
|
+
import * as Atom from 'effect/reactivity/Atom';
|
|
7
7
|
import React, { useCallback, useId, useMemo, useState } from 'react';
|
|
8
8
|
|
|
9
|
-
import
|
|
10
|
-
import
|
|
9
|
+
import * as Hooks from '@dxos/app-framework/Hooks';
|
|
10
|
+
import type * as AppSurface from '@dxos/app-toolkit/AppSurface';
|
|
11
11
|
import { type Collection, Obj } from '@dxos/echo';
|
|
12
12
|
import * as SpaceOperation from '@dxos/plugin-space/SpaceOperation';
|
|
13
|
-
import { Panel, Toolbar, useTranslation } from '@dxos/react-ui';
|
|
14
13
|
import { type DndContainerHandler } from '@dxos/react-ui-dnd';
|
|
15
|
-
import {
|
|
14
|
+
import { ActionMenu, createMenuAction } from '@dxos/react-ui-menu';
|
|
16
15
|
import { Mosaic } from '@dxos/react-ui-mosaic';
|
|
16
|
+
import * as Button from '@dxos/react-ui/Button';
|
|
17
|
+
import * as UiHooks from '@dxos/react-ui/Hooks';
|
|
18
|
+
import * as Panel from '@dxos/react-ui/Panel';
|
|
19
|
+
import * as Toolbar from '@dxos/react-ui/Toolbar';
|
|
17
20
|
import { arrayMove, isNonNullable } from '@dxos/util';
|
|
18
21
|
|
|
19
22
|
import { Stack, type StackSectionItem } from '#components';
|
|
@@ -22,8 +25,8 @@ import { meta } from '#meta';
|
|
|
22
25
|
export type StackArticleProps = AppSurface.ObjectArticleProps<Collection.Collection>;
|
|
23
26
|
|
|
24
27
|
export const StackArticle = ({ attendableId, subject: collection }: StackArticleProps) => {
|
|
25
|
-
const { invokePromise } = useOperationInvoker();
|
|
26
|
-
const { t } = useTranslation(meta.profile.key);
|
|
28
|
+
const { invokePromise } = Hooks.useOperationInvoker();
|
|
29
|
+
const { t } = UiHooks.useTranslation(meta.profile.key);
|
|
27
30
|
const [collapsedSections, setCollapsedSections] = useState<Record<string, boolean>>({});
|
|
28
31
|
|
|
29
32
|
const collectionObjects = useAtomValue(createCollectionObjects(collection));
|
|
@@ -177,10 +180,9 @@ export const StackArticle = ({ attendableId, subject: collection }: StackArticle
|
|
|
177
180
|
|
|
178
181
|
return (
|
|
179
182
|
<Panel.Root>
|
|
180
|
-
<Panel.
|
|
183
|
+
<Panel.Header classNames='dx-toolbar-surface'>
|
|
181
184
|
<Toolbar.Root classNames='dx-document'>
|
|
182
|
-
<
|
|
183
|
-
square
|
|
185
|
+
<Button.Root
|
|
184
186
|
icon='ph--plus--regular'
|
|
185
187
|
iconOnly
|
|
186
188
|
label={t('add-section.label')}
|
|
@@ -188,21 +190,17 @@ export const StackArticle = ({ attendableId, subject: collection }: StackArticle
|
|
|
188
190
|
onClick={handleAddSection}
|
|
189
191
|
/>
|
|
190
192
|
<Toolbar.Separator />
|
|
191
|
-
<
|
|
192
|
-
<
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
/>
|
|
200
|
-
</Menu.Trigger>
|
|
201
|
-
<Menu.Content items={optionsMenu} />
|
|
202
|
-
</Menu.Root>
|
|
193
|
+
<ActionMenu actions={optionsMenu}>
|
|
194
|
+
<Button.Root
|
|
195
|
+
icon='ph--dots-three-vertical--regular'
|
|
196
|
+
iconOnly
|
|
197
|
+
label={t('options.label')}
|
|
198
|
+
data-testid='stack.options'
|
|
199
|
+
/>
|
|
200
|
+
</ActionMenu>
|
|
203
201
|
</Toolbar.Root>
|
|
204
|
-
</Panel.
|
|
205
|
-
<Panel.
|
|
202
|
+
</Panel.Header>
|
|
203
|
+
<Panel.Body>
|
|
206
204
|
<Stack.Root
|
|
207
205
|
id={Obj.getURI(collection)}
|
|
208
206
|
attendableId={attendableId}
|
|
@@ -214,13 +212,13 @@ export const StackArticle = ({ attendableId, subject: collection }: StackArticle
|
|
|
214
212
|
onMoveDown={handleMoveDown}
|
|
215
213
|
onDelete={handleDelete}
|
|
216
214
|
>
|
|
217
|
-
<Stack.Content
|
|
215
|
+
<Stack.Content data-testid='main.stack'>
|
|
218
216
|
<Stack.Viewport>
|
|
219
217
|
<Mosaic.Stack classNames='dx-document' items={items} getId={getId} Tile={Stack.Section} />
|
|
220
218
|
</Stack.Viewport>
|
|
221
219
|
</Stack.Content>
|
|
222
220
|
</Stack.Root>
|
|
223
|
-
</Panel.
|
|
221
|
+
</Panel.Body>
|
|
224
222
|
</Panel.Root>
|
|
225
223
|
);
|
|
226
224
|
};
|
package/src/containers/index.ts
CHANGED
package/src/index.ts
CHANGED
package/src/meta.ts
CHANGED
package/src/translations.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import type * as Theme from '@dxos/react-ui/Theme';
|
|
6
6
|
|
|
7
7
|
import { meta } from '#meta';
|
|
8
8
|
|
|
@@ -36,4 +36,4 @@ export const translations = [
|
|
|
36
36
|
},
|
|
37
37
|
},
|
|
38
38
|
},
|
|
39
|
-
] as const satisfies Resource[];
|
|
39
|
+
] as const satisfies Theme.Resource[];
|
package/src/types/index.ts
CHANGED