@dxos/plugin-stack 0.8.4-main.dedc0f3 → 0.8.4-main.dfabb4ec29
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/neutral/StackContainer-KZ5Q5YKJ.mjs +126 -0
- package/dist/lib/neutral/StackContainer-KZ5Q5YKJ.mjs.map +7 -0
- package/dist/lib/neutral/StackPlugin.mjs +22 -0
- package/dist/lib/neutral/StackPlugin.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +7 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/{node-esm/chunk-UN5PA7TK.mjs → neutral/chunk-3ISQZKGO.mjs} +8 -8
- package/dist/lib/neutral/chunk-3ISQZKGO.mjs.map +7 -0
- package/dist/lib/{browser/chunk-IRTROCUQ.mjs → neutral/chunk-IPU3C6TT.mjs} +10 -11
- package/dist/lib/neutral/chunk-IPU3C6TT.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +182 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +7 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +15 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +9 -0
- package/dist/lib/neutral/plugin.mjs +11 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-4ZA44TMR.mjs +23 -0
- package/dist/lib/neutral/react-surface-4ZA44TMR.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +37 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/{browser → neutral}/types/index.mjs +1 -1
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/types/src/StackPlugin.d.ts +3 -1
- package/dist/types/src/StackPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +2 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/{StackContext.d.ts → StackContext/StackContext.d.ts} +2 -1
- package/dist/types/src/components/StackContext/StackContext.d.ts.map +1 -0
- package/dist/types/src/components/StackContext/index.d.ts +2 -0
- package/dist/types/src/components/StackContext/index.d.ts.map +1 -0
- package/dist/types/src/components/{CaretDownUp.d.ts → StackSection/CaretDownUp.d.ts} +1 -1
- package/dist/types/src/components/StackSection/CaretDownUp.d.ts.map +1 -0
- package/dist/types/src/components/{StackSection.d.ts → StackSection/StackSection.d.ts} +1 -1
- package/dist/types/src/components/StackSection/StackSection.d.ts.map +1 -0
- package/dist/types/src/components/StackSection/index.d.ts +2 -0
- package/dist/types/src/components/StackSection/index.d.ts.map +1 -0
- package/dist/types/src/components/{StackSettings.d.ts → StackSettings/StackSettings.d.ts} +1 -1
- package/dist/types/src/components/StackSettings/StackSettings.d.ts.map +1 -0
- package/dist/types/src/components/StackSettings/index.d.ts +2 -0
- package/dist/types/src/components/StackSettings/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +2 -7
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/StackContainer/StackContainer.d.ts +7 -0
- package/dist/types/src/containers/StackContainer/StackContainer.d.ts.map +1 -0
- package/dist/types/src/containers/StackContainer/index.d.ts +2 -0
- package/dist/types/src/containers/StackContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +3 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +3 -4
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +3 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +31 -31
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/stack.d.ts +13 -14
- package/dist/types/src/types/stack.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +3 -3
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +91 -51
- package/src/StackPlugin.ts +14 -46
- package/src/capabilities/index.ts +2 -2
- package/src/capabilities/react-surface.tsx +20 -26
- package/src/components/{StackContext.tsx → StackContext/StackContext.tsx} +3 -1
- package/src/components/StackContext/index.ts +5 -0
- package/src/components/{StackSection.tsx → StackSection/StackSection.tsx} +28 -25
- package/src/components/StackSection/index.ts +5 -0
- package/src/components/StackSettings/StackSettings.tsx +28 -0
- package/src/components/StackSettings/index.ts +5 -0
- package/src/components/index.ts +2 -4
- package/src/containers/StackContainer/StackContainer.tsx +170 -0
- package/src/containers/StackContainer/index.ts +5 -0
- package/src/containers/index.ts +7 -0
- package/src/index.ts +1 -1
- package/src/meta.ts +9 -6
- package/src/plugin.ts +9 -0
- package/src/translations.ts +23 -22
- package/src/types/stack.ts +12 -8
- package/src/types/types.ts +3 -3
- package/dist/lib/browser/StackMain-5DM2ROIH.mjs +0 -299
- package/dist/lib/browser/StackMain-5DM2ROIH.mjs.map +0 -7
- package/dist/lib/browser/chunk-FVB7LGW7.mjs +0 -19
- package/dist/lib/browser/chunk-FVB7LGW7.mjs.map +0 -7
- package/dist/lib/browser/chunk-IRTROCUQ.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -101
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-HHFHCDYN.mjs +0 -46
- package/dist/lib/browser/react-surface-HHFHCDYN.mjs.map +0 -7
- package/dist/lib/node-esm/StackMain-SZBR33SL.mjs +0 -300
- package/dist/lib/node-esm/StackMain-SZBR33SL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-LRAZXJ65.mjs +0 -30
- package/dist/lib/node-esm/chunk-LRAZXJ65.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UN5PA7TK.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -102
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-surface-6EQRTJGA.mjs +0 -47
- package/dist/lib/node-esm/react-surface-6EQRTJGA.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -10
- package/dist/types/src/components/CaretDownUp.d.ts.map +0 -1
- package/dist/types/src/components/StackContext.d.ts.map +0 -1
- package/dist/types/src/components/StackMain.d.ts +0 -9
- package/dist/types/src/components/StackMain.d.ts.map +0 -1
- package/dist/types/src/components/StackSection.d.ts.map +0 -1
- package/dist/types/src/components/StackSettings.d.ts.map +0 -1
- package/src/components/StackMain.tsx +0 -160
- package/src/components/StackSettings.tsx +0 -30
- /package/dist/lib/{browser/types → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/types/index.mjs.map → neutral/meta.mjs.map} +0 -0
- /package/src/components/{CaretDownUp.tsx → StackSection/CaretDownUp.tsx} +0 -0
package/package.json
CHANGED
|
@@ -1,83 +1,123 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-stack",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.dfabb4ec29",
|
|
4
4
|
"description": "DXOS Surface plugin for Stack entities",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/dxos/dxos"
|
|
10
|
+
},
|
|
7
11
|
"license": "MIT",
|
|
8
12
|
"author": "DXOS.org",
|
|
9
13
|
"sideEffects": true,
|
|
10
14
|
"type": "module",
|
|
15
|
+
"imports": {
|
|
16
|
+
"#capabilities": {
|
|
17
|
+
"source": "./src/capabilities/index.ts",
|
|
18
|
+
"types": "./dist/types/src/capabilities/index.d.ts",
|
|
19
|
+
"default": "./dist/lib/neutral/capabilities/index.mjs"
|
|
20
|
+
},
|
|
21
|
+
"#components": {
|
|
22
|
+
"source": "./src/components/index.ts",
|
|
23
|
+
"types": "./dist/types/src/components/index.d.ts",
|
|
24
|
+
"default": "./dist/lib/neutral/components/index.mjs"
|
|
25
|
+
},
|
|
26
|
+
"#containers": {
|
|
27
|
+
"source": "./src/containers/index.ts",
|
|
28
|
+
"types": "./dist/types/src/containers/index.d.ts",
|
|
29
|
+
"default": "./dist/lib/neutral/containers/index.mjs"
|
|
30
|
+
},
|
|
31
|
+
"#meta": {
|
|
32
|
+
"source": "./src/meta.ts",
|
|
33
|
+
"types": "./dist/types/src/meta.d.ts",
|
|
34
|
+
"default": "./dist/lib/neutral/meta.mjs"
|
|
35
|
+
},
|
|
36
|
+
"#plugin": {
|
|
37
|
+
"source": "./src/StackPlugin.ts",
|
|
38
|
+
"types": "./dist/types/src/StackPlugin.d.ts",
|
|
39
|
+
"default": "./dist/lib/neutral/StackPlugin.mjs"
|
|
40
|
+
},
|
|
41
|
+
"#translations": {
|
|
42
|
+
"source": "./src/translations.ts",
|
|
43
|
+
"types": "./dist/types/src/translations.d.ts",
|
|
44
|
+
"default": "./dist/lib/neutral/translations.mjs"
|
|
45
|
+
},
|
|
46
|
+
"#types": {
|
|
47
|
+
"source": "./src/types/index.ts",
|
|
48
|
+
"types": "./dist/types/src/types/index.d.ts",
|
|
49
|
+
"default": "./dist/lib/neutral/types/index.mjs"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
11
52
|
"exports": {
|
|
12
53
|
".": {
|
|
13
54
|
"source": "./src/index.ts",
|
|
14
55
|
"types": "./dist/types/src/index.d.ts",
|
|
15
|
-
"
|
|
16
|
-
"node": "./dist/lib/node-esm/index.mjs"
|
|
56
|
+
"default": "./dist/lib/neutral/index.mjs"
|
|
17
57
|
},
|
|
18
|
-
"./
|
|
19
|
-
"source": "./src/
|
|
20
|
-
"types": "./dist/types/src/
|
|
21
|
-
"
|
|
22
|
-
|
|
58
|
+
"./plugin": {
|
|
59
|
+
"source": "./src/plugin.ts",
|
|
60
|
+
"types": "./dist/types/src/plugin.d.ts",
|
|
61
|
+
"default": "./dist/lib/neutral/plugin.mjs"
|
|
62
|
+
},
|
|
63
|
+
"./translations": {
|
|
64
|
+
"source": "./src/translations.ts",
|
|
65
|
+
"types": "./dist/types/src/translations.d.ts",
|
|
66
|
+
"default": "./dist/lib/neutral/translations.mjs"
|
|
23
67
|
}
|
|
24
68
|
},
|
|
25
69
|
"types": "dist/types/src/index.d.ts",
|
|
26
|
-
"typesVersions": {
|
|
27
|
-
"*": {
|
|
28
|
-
"types": [
|
|
29
|
-
"dist/types/src/types/index.d.ts"
|
|
30
|
-
]
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
70
|
"files": [
|
|
34
71
|
"dist",
|
|
35
72
|
"src"
|
|
36
73
|
],
|
|
37
74
|
"dependencies": {
|
|
38
|
-
"@
|
|
39
|
-
"@
|
|
40
|
-
"@preact/signals-core": "^1.9.0",
|
|
75
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
76
|
+
"@fluentui/react-tabster": "9.26.11",
|
|
41
77
|
"@radix-ui/react-collapsible": "1.1.3",
|
|
42
|
-
"effect": "3.
|
|
78
|
+
"effect": "3.20.0",
|
|
43
79
|
"node-fetch": "^2.6.0",
|
|
44
|
-
"react-is": "~
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/invariant": "0.8.4-main.
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/plugin-
|
|
55
|
-
"@dxos/plugin-graph": "0.8.4-main.
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/react-ui-
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/react-client": "0.8.4-main.
|
|
60
|
-
"@dxos/react-ui-
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/
|
|
80
|
+
"react-is": "~19.2.0",
|
|
81
|
+
"@dxos/async": "0.8.4-main.dfabb4ec29",
|
|
82
|
+
"@dxos/app-framework": "0.8.4-main.dfabb4ec29",
|
|
83
|
+
"@dxos/app-toolkit": "0.8.4-main.dfabb4ec29",
|
|
84
|
+
"@dxos/client": "0.8.4-main.dfabb4ec29",
|
|
85
|
+
"@dxos/invariant": "0.8.4-main.dfabb4ec29",
|
|
86
|
+
"@dxos/echo": "0.8.4-main.dfabb4ec29",
|
|
87
|
+
"@dxos/echo-atom": "0.8.4-main.dfabb4ec29",
|
|
88
|
+
"@dxos/plugin-client": "0.8.4-main.dfabb4ec29",
|
|
89
|
+
"@dxos/operation": "0.8.4-main.dfabb4ec29",
|
|
90
|
+
"@dxos/plugin-deck": "0.8.4-main.dfabb4ec29",
|
|
91
|
+
"@dxos/plugin-graph": "0.8.4-main.dfabb4ec29",
|
|
92
|
+
"@dxos/plugin-space": "0.8.4-main.dfabb4ec29",
|
|
93
|
+
"@dxos/react-ui-attention": "0.8.4-main.dfabb4ec29",
|
|
94
|
+
"@dxos/react-ui-form": "0.8.4-main.dfabb4ec29",
|
|
95
|
+
"@dxos/react-client": "0.8.4-main.dfabb4ec29",
|
|
96
|
+
"@dxos/react-ui-stack": "0.8.4-main.dfabb4ec29",
|
|
97
|
+
"@dxos/react-ui-list": "0.8.4-main.dfabb4ec29",
|
|
98
|
+
"@dxos/schema": "0.8.4-main.dfabb4ec29",
|
|
99
|
+
"@dxos/types": "0.8.4-main.dfabb4ec29",
|
|
100
|
+
"@dxos/util": "0.8.4-main.dfabb4ec29"
|
|
63
101
|
},
|
|
64
102
|
"devDependencies": {
|
|
65
103
|
"@babel/core": "^7.18.13",
|
|
66
|
-
"@types/react": "~
|
|
67
|
-
"@types/react-dom": "~
|
|
68
|
-
"react": "~
|
|
69
|
-
"react-dom": "~
|
|
70
|
-
"vite": "
|
|
71
|
-
"@dxos/
|
|
72
|
-
"@dxos/react-ui
|
|
73
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
104
|
+
"@types/react": "~19.2.7",
|
|
105
|
+
"@types/react-dom": "~19.2.3",
|
|
106
|
+
"react": "~19.2.3",
|
|
107
|
+
"react-dom": "~19.2.3",
|
|
108
|
+
"vite": "^8.0.10",
|
|
109
|
+
"@dxos/plugin-testing": "0.8.4-main.dfabb4ec29",
|
|
110
|
+
"@dxos/react-ui": "0.8.4-main.dfabb4ec29",
|
|
111
|
+
"@dxos/storybook-utils": "0.8.4-main.dfabb4ec29",
|
|
112
|
+
"@dxos/ui-theme": "0.8.4-main.dfabb4ec29"
|
|
74
113
|
},
|
|
75
114
|
"peerDependencies": {
|
|
76
|
-
"effect": "^
|
|
77
|
-
"
|
|
78
|
-
"react
|
|
79
|
-
"
|
|
80
|
-
"@dxos/react-ui
|
|
115
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
116
|
+
"effect": "3.20.0",
|
|
117
|
+
"react": "~19.2.3",
|
|
118
|
+
"react-dom": "~19.2.3",
|
|
119
|
+
"@dxos/react-ui": "0.8.4-main.dfabb4ec29",
|
|
120
|
+
"@dxos/ui-theme": "0.8.4-main.dfabb4ec29"
|
|
81
121
|
},
|
|
82
122
|
"publishConfig": {
|
|
83
123
|
"access": "public"
|
package/src/StackPlugin.ts
CHANGED
|
@@ -2,51 +2,19 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { AppPlugin } from '@dxos/app-toolkit';
|
|
8
7
|
|
|
9
|
-
import { ReactSurface } from '
|
|
10
|
-
import {
|
|
11
|
-
import { translations } from '
|
|
12
|
-
import { StackViewType } from '
|
|
8
|
+
import { ReactSurface } from '#capabilities';
|
|
9
|
+
import { meta } from '#meta';
|
|
10
|
+
import { translations } from '#translations';
|
|
11
|
+
import { StackViewType } from '#types';
|
|
13
12
|
|
|
14
|
-
export const StackPlugin = ()
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
id: `${meta.id}/module/metadata`,
|
|
23
|
-
activatesOn: Events.SetupMetadata,
|
|
24
|
-
activate: () => [
|
|
25
|
-
contributes(Capabilities.Metadata, {
|
|
26
|
-
id: SECTION_IDENTIFIER,
|
|
27
|
-
metadata: {
|
|
28
|
-
parse: (section: { object: Obj.Any }, type: string) => {
|
|
29
|
-
switch (type) {
|
|
30
|
-
case 'node':
|
|
31
|
-
return { id: section.object.id, label: (section.object as any).title, data: section.object };
|
|
32
|
-
case 'object':
|
|
33
|
-
return section.object;
|
|
34
|
-
case 'view-object':
|
|
35
|
-
return section;
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
}),
|
|
40
|
-
],
|
|
41
|
-
}),
|
|
42
|
-
defineModule({
|
|
43
|
-
id: `${meta.id}/module/schema`,
|
|
44
|
-
activatesOn: ClientEvents.SetupSchema,
|
|
45
|
-
activate: () => contributes(ClientCapabilities.Schema, [StackViewType]),
|
|
46
|
-
}),
|
|
47
|
-
defineModule({
|
|
48
|
-
id: `${meta.id}/module/react-surface`,
|
|
49
|
-
activatesOn: Events.SetupReactSurface,
|
|
50
|
-
activate: ReactSurface,
|
|
51
|
-
}),
|
|
52
|
-
]);
|
|
13
|
+
export const StackPlugin = Plugin.define(meta).pipe(
|
|
14
|
+
AppPlugin.addSchemaModule({ schema: [StackViewType] }),
|
|
15
|
+
AppPlugin.addSurfaceModule({ activate: ReactSurface }),
|
|
16
|
+
AppPlugin.addTranslationsModule({ translations }),
|
|
17
|
+
Plugin.make,
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
export default StackPlugin;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
|
-
export const ReactSurface = lazy(() => import('./react-surface'));
|
|
7
|
+
export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
|
|
@@ -2,33 +2,27 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
5
6
|
import React from 'react';
|
|
6
7
|
|
|
7
|
-
import { Capabilities,
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
10
|
+
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
11
|
+
import { Collection } from '@dxos/echo';
|
|
11
12
|
|
|
12
|
-
import {
|
|
13
|
-
import { STACK_PLUGIN } from '../meta';
|
|
13
|
+
import { StackContainer } from '#containers';
|
|
14
14
|
|
|
15
|
-
export default () =>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
<StackMain id={id ?? fullyQualifiedId(data.subject)} collection={data.subject} />
|
|
30
|
-
</div>
|
|
31
|
-
);
|
|
32
|
-
},
|
|
33
|
-
}),
|
|
34
|
-
);
|
|
15
|
+
export default Capability.makeModule(() =>
|
|
16
|
+
Effect.succeed(
|
|
17
|
+
Capability.contributes(
|
|
18
|
+
Capabilities.ReactSurface,
|
|
19
|
+
Surface.create({
|
|
20
|
+
id: 'article',
|
|
21
|
+
filter: AppSurface.object(AppSurface.Article, Collection.Collection),
|
|
22
|
+
component: ({ role, data }) => {
|
|
23
|
+
return <StackContainer attendableId={data.attendableId} role={role} subject={data.subject} />;
|
|
24
|
+
},
|
|
25
|
+
}),
|
|
26
|
+
),
|
|
27
|
+
),
|
|
28
|
+
);
|
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
import { createContext, useContext } from 'react';
|
|
6
6
|
|
|
7
|
-
import { type AddSectionPosition } from '
|
|
7
|
+
import { type AddSectionPosition } from '#types';
|
|
8
8
|
|
|
9
9
|
export type StackContextValue = {
|
|
10
|
+
attendableId: string;
|
|
10
11
|
onCollapse: (id: string, collapsed: boolean) => void;
|
|
11
12
|
onNavigate: (id: string) => Promise<void>;
|
|
12
13
|
onDelete: (id: string) => Promise<void>;
|
|
@@ -14,6 +15,7 @@ export type StackContextValue = {
|
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
export const StackContext = createContext<StackContextValue>({
|
|
18
|
+
attendableId: '',
|
|
17
19
|
onCollapse: () => {},
|
|
18
20
|
onNavigate: async () => {},
|
|
19
21
|
onDelete: async () => {},
|
|
@@ -5,19 +5,20 @@
|
|
|
5
5
|
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
6
6
|
import React, { useMemo, useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import { Surface } from '@dxos/app-framework';
|
|
8
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
9
|
+
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
9
10
|
import { DropdownMenu, Icon, IconButton, useTranslation } from '@dxos/react-ui';
|
|
10
11
|
import { useAttentionAttributes } from '@dxos/react-ui-attention';
|
|
11
12
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
12
|
-
import { getSize, mx
|
|
13
|
+
import { getSize, mx } from '@dxos/ui-theme';
|
|
13
14
|
|
|
14
|
-
import {
|
|
15
|
-
import { type StackSectionItem } from '
|
|
15
|
+
import { meta } from '#meta';
|
|
16
|
+
import { type StackSectionItem } from '#types';
|
|
16
17
|
|
|
18
|
+
import { useStack } from '../StackContext';
|
|
17
19
|
import { CaretDownUp } from './CaretDownUp';
|
|
18
|
-
import { useStack } from './StackContext';
|
|
19
20
|
|
|
20
|
-
const sectionActionDimensions = 'p-1
|
|
21
|
+
const sectionActionDimensions = 'p-1 my-1 shrink-0 min-h-0 w-(--dx-rail-action) h-min';
|
|
21
22
|
|
|
22
23
|
export type StackSectionProps = StackSectionItem;
|
|
23
24
|
|
|
@@ -27,16 +28,18 @@ export const StackSection = ({
|
|
|
27
28
|
object,
|
|
28
29
|
metadata: { icon = 'ph--placeholder--regular' },
|
|
29
30
|
}: StackSectionProps) => {
|
|
30
|
-
const { t } = useTranslation(
|
|
31
|
-
const { onNavigate, onAdd, onCollapse, onDelete } = useStack();
|
|
31
|
+
const { t } = useTranslation(meta.id);
|
|
32
|
+
const { attendableId: parentAttendableId, onNavigate, onAdd, onCollapse, onDelete } = useStack();
|
|
32
33
|
const [optionsMenuOpen, setOptionsMenuOpen] = useState(false);
|
|
33
|
-
const
|
|
34
|
+
const attendableId = `${parentAttendableId}/${object.id}`;
|
|
35
|
+
const attentionAttrs = useAttentionAttributes(attendableId);
|
|
34
36
|
const stackItem = useMemo(() => ({ id }), [id]);
|
|
37
|
+
const data = useMemo(() => ({ attendableId, subject: object }), [object, attendableId]);
|
|
35
38
|
|
|
36
39
|
return (
|
|
37
40
|
<CollapsiblePrimitive.Root asChild open={!view.collapsed} onOpenChange={(nextOpen) => onCollapse?.(id, !nextOpen)}>
|
|
38
41
|
<StackItem.Root item={stackItem} role='section' {...attentionAttrs}>
|
|
39
|
-
<StackItem.Heading classNames='attention-surface'>
|
|
42
|
+
<StackItem.Heading classNames='dx-attention-surface'>
|
|
40
43
|
<span className='sr-only'>{view.title}</span>
|
|
41
44
|
<StackItem.HeadingStickyContent>
|
|
42
45
|
<DropdownMenu.Root
|
|
@@ -47,7 +50,7 @@ export const StackSection = ({
|
|
|
47
50
|
>
|
|
48
51
|
<DropdownMenu.Trigger asChild>
|
|
49
52
|
<StackItem.SigilButton>
|
|
50
|
-
<Icon icon={icon}
|
|
53
|
+
<Icon icon={icon} classNames='transition-opacity' />
|
|
51
54
|
</StackItem.SigilButton>
|
|
52
55
|
</DropdownMenu.Trigger>
|
|
53
56
|
<DropdownMenu.Portal>
|
|
@@ -55,28 +58,28 @@ export const StackSection = ({
|
|
|
55
58
|
<DropdownMenu.Viewport>
|
|
56
59
|
{view.collapsed ? (
|
|
57
60
|
<DropdownMenu.Item onClick={() => onNavigate(id)} data-testid='section.navigate-to'>
|
|
58
|
-
<Icon icon='ph--arrow-right--regular'
|
|
59
|
-
<span className='
|
|
61
|
+
<Icon icon='ph--arrow-right--regular' />
|
|
62
|
+
<span className='ms-2 grow'>{t('navigate-to-section.label')}</span>
|
|
60
63
|
</DropdownMenu.Item>
|
|
61
64
|
) : (
|
|
62
65
|
<CollapsiblePrimitive.Trigger asChild>
|
|
63
66
|
<DropdownMenu.Item>
|
|
64
67
|
<CaretDownUp className={getSize(5)} />
|
|
65
|
-
<span className='
|
|
68
|
+
<span className='ms-2 grow'>{t('collapse.label')}</span>
|
|
66
69
|
</DropdownMenu.Item>
|
|
67
70
|
</CollapsiblePrimitive.Trigger>
|
|
68
71
|
)}
|
|
69
72
|
<DropdownMenu.Item onClick={() => onAdd(id, 'before')} data-testid='section.add-before'>
|
|
70
|
-
<Icon icon='ph--arrow-line-up--regular'
|
|
71
|
-
<span className='
|
|
73
|
+
<Icon icon='ph--arrow-line-up--regular' />
|
|
74
|
+
<span className='ms-2 grow'>{t('add-section-before.label')}</span>
|
|
72
75
|
</DropdownMenu.Item>
|
|
73
76
|
<DropdownMenu.Item onClick={() => onAdd(id, 'after')} data-testid='section.add-after'>
|
|
74
|
-
<Icon icon='ph--arrow-line-down--regular'
|
|
75
|
-
<span className='
|
|
77
|
+
<Icon icon='ph--arrow-line-down--regular' />
|
|
78
|
+
<span className='ms-2 grow'>{t('add-section-after.label')}</span>
|
|
76
79
|
</DropdownMenu.Item>
|
|
77
80
|
<DropdownMenu.Item onClick={() => onDelete(id)} data-testid='section.remove'>
|
|
78
|
-
<Icon icon='ph--trash--regular'
|
|
79
|
-
<span className='
|
|
81
|
+
<Icon icon='ph--trash--regular' />
|
|
82
|
+
<span className='ms-2 grow'>{t('remove-section.label')}</span>
|
|
80
83
|
</DropdownMenu.Item>
|
|
81
84
|
</DropdownMenu.Viewport>
|
|
82
85
|
<DropdownMenu.Arrow />
|
|
@@ -88,7 +91,7 @@ export const StackSection = ({
|
|
|
88
91
|
<IconButton
|
|
89
92
|
iconOnly
|
|
90
93
|
variant='ghost'
|
|
91
|
-
label={t('expand
|
|
94
|
+
label={t('expand.label')}
|
|
92
95
|
icon='ph--caret-up-down--regular'
|
|
93
96
|
classNames={sectionActionDimensions}
|
|
94
97
|
/>
|
|
@@ -98,7 +101,7 @@ export const StackSection = ({
|
|
|
98
101
|
iconOnly
|
|
99
102
|
variant='ghost'
|
|
100
103
|
onClick={() => onNavigate(id)}
|
|
101
|
-
label={t('navigate
|
|
104
|
+
label={t('navigate-to-section.label')}
|
|
102
105
|
icon='ph--arrow-right--regular'
|
|
103
106
|
data-testid='section.navigate-to'
|
|
104
107
|
classNames={sectionActionDimensions}
|
|
@@ -107,11 +110,11 @@ export const StackSection = ({
|
|
|
107
110
|
</StackItem.HeadingStickyContent>
|
|
108
111
|
</StackItem.Heading>
|
|
109
112
|
<CollapsiblePrimitive.Content>
|
|
110
|
-
<Surface
|
|
113
|
+
<Surface.Surface type={AppSurface.Section} data={data} limit={1} placeholder={<></>} />
|
|
111
114
|
</CollapsiblePrimitive.Content>
|
|
112
115
|
{view.collapsed && (
|
|
113
|
-
<StackItem.Content classNames='attention-surface'>
|
|
114
|
-
<h2 className={mx('flex items-center p-4 font-medium'
|
|
116
|
+
<StackItem.Content classNames='dx-attention-surface'>
|
|
117
|
+
<h2 className={mx('flex items-center p-4 font-medium')}>{view.title}</h2>
|
|
115
118
|
</StackItem.Content>
|
|
116
119
|
)}
|
|
117
120
|
</StackItem.Root>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { Input, useTranslation } from '@dxos/react-ui';
|
|
8
|
+
import { Settings as SettingsForm } from '@dxos/react-ui-form';
|
|
9
|
+
|
|
10
|
+
import { meta } from '#meta';
|
|
11
|
+
import { type StackSettingsProps } from '#types';
|
|
12
|
+
|
|
13
|
+
export const StackSettings = ({ settings }: { settings: StackSettingsProps }) => {
|
|
14
|
+
const { t } = useTranslation(meta.id);
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<SettingsForm.Viewport>
|
|
18
|
+
<SettingsForm.Section title={t('settings.title', { ns: meta.id })}>
|
|
19
|
+
<SettingsForm.Item title={t('settings.separation.label')} description={t('settings.separation.description')}>
|
|
20
|
+
<Input.Switch
|
|
21
|
+
checked={settings.separation}
|
|
22
|
+
onCheckedChange={(checked) => (settings.separation = !!checked)}
|
|
23
|
+
/>
|
|
24
|
+
</SettingsForm.Item>
|
|
25
|
+
</SettingsForm.Section>
|
|
26
|
+
</SettingsForm.Viewport>
|
|
27
|
+
);
|
|
28
|
+
};
|
package/src/components/index.ts
CHANGED