@dxos/plugin-stack 0.8.4-main.8360d9e660 → 0.8.4-main.8baae0fced
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/LICENSE +102 -5
- package/README.md +1 -1
- package/dist/lib/neutral/StackArticle-3FE52PUH.mjs +126 -0
- package/dist/lib/neutral/StackArticle-3FE52PUH.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/{browser/chunk-YPQYUBQP.mjs → neutral/chunk-IPU3C6TT.mjs} +2 -2
- package/dist/lib/{browser/chunk-YPQYUBQP.mjs.map → neutral/chunk-IPU3C6TT.mjs.map} +3 -3
- package/dist/lib/{browser/chunk-G4CLPE5A.mjs → neutral/chunk-LAZU5N5N.mjs} +3 -2
- package/dist/lib/neutral/chunk-LAZU5N5N.mjs.map +7 -0
- package/dist/lib/{browser/StackContainer-RE6RUEUV.mjs → neutral/components/index.mjs} +34 -146
- 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-MD3CVY2N.mjs +23 -0
- package/dist/lib/neutral/react-surface-MD3CVY2N.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 +1 -0
- 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.map +1 -0
- package/dist/types/src/components/StackContext/StackContext.d.ts +1 -1
- package/dist/types/src/components/StackContext/StackContext.d.ts.map +1 -1
- package/dist/types/src/components/StackSection/CaretDownUp.d.ts +1 -1
- package/dist/types/src/components/StackSection/CaretDownUp.d.ts.map +1 -1
- package/dist/types/src/components/StackSection/StackSection.d.ts +1 -1
- package/dist/types/src/components/StackSection/StackSection.d.ts.map +1 -1
- package/dist/types/src/components/StackSettings/StackSettings.d.ts +1 -1
- package/dist/types/src/components/StackSettings/StackSettings.d.ts.map +1 -1
- package/dist/types/src/containers/StackArticle/StackArticle.d.ts +7 -0
- package/dist/types/src/containers/StackArticle/StackArticle.d.ts.map +1 -0
- package/dist/types/src/containers/StackArticle/index.d.ts +2 -0
- package/dist/types/src/containers/StackArticle/index.d.ts.map +1 -0
- 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/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -1
- 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 +30 -30
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +1 -2
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +78 -44
- package/src/StackPlugin.ts +6 -22
- package/src/capabilities/index.ts +3 -1
- package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +5 -8
- package/src/components/StackContext/StackContext.tsx +1 -1
- package/src/components/StackSection/StackSection.tsx +17 -16
- package/src/components/StackSettings/StackSettings.tsx +13 -15
- package/src/containers/{StackContainer/StackContainer.tsx → StackArticle/StackArticle.tsx} +14 -16
- package/src/containers/StackArticle/index.ts +5 -0
- package/src/containers/index.ts +1 -1
- package/src/index.ts +1 -1
- package/src/meta.ts +2 -1
- package/src/plugin.ts +9 -0
- package/src/translations.ts +23 -22
- package/src/types/stack.ts +1 -1
- package/src/types/types.ts +1 -2
- package/dist/lib/browser/StackContainer-RE6RUEUV.mjs.map +0 -7
- package/dist/lib/browser/chunk-G4CLPE5A.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -84
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-FZ42XC67.mjs +0 -33
- package/dist/lib/browser/react-surface-FZ42XC67.mjs.map +0 -7
- package/dist/lib/node-esm/StackContainer-OPQ76B4H.mjs +0 -295
- package/dist/lib/node-esm/StackContainer-OPQ76B4H.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-LELGTQAL.mjs +0 -29
- package/dist/lib/node-esm/chunk-LELGTQAL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-LOZ6GH5A.mjs +0 -23
- package/dist/lib/node-esm/chunk-LOZ6GH5A.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -85
- 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-CYNJK3QD.mjs +0 -34
- package/dist/lib/node-esm/react-surface-CYNJK3QD.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -10
- 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/containers/StackContainer/StackContainer.d.ts +0 -7
- package/dist/types/src/containers/StackContainer/StackContainer.d.ts.map +0 -1
- package/dist/types/src/containers/StackContainer/index.d.ts +0 -3
- package/dist/types/src/containers/StackContainer/index.d.ts.map +0 -1
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/containers/StackContainer/index.ts +0 -7
- /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/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-stack",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.8baae0fced",
|
|
4
4
|
"description": "DXOS Surface plugin for Stack entities",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -8,32 +8,65 @@
|
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "https://github.com/dxos/dxos"
|
|
10
10
|
},
|
|
11
|
-
"license": "
|
|
11
|
+
"license": "FSL-1.1-Apache-2.0",
|
|
12
12
|
"author": "DXOS.org",
|
|
13
13
|
"sideEffects": true,
|
|
14
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
|
+
},
|
|
15
52
|
"exports": {
|
|
16
53
|
".": {
|
|
17
54
|
"source": "./src/index.ts",
|
|
18
55
|
"types": "./dist/types/src/index.d.ts",
|
|
19
|
-
"
|
|
20
|
-
"node": "./dist/lib/node-esm/index.mjs"
|
|
56
|
+
"default": "./dist/lib/neutral/index.mjs"
|
|
21
57
|
},
|
|
22
|
-
"./
|
|
23
|
-
"source": "./src/
|
|
24
|
-
"types": "./dist/types/src/
|
|
25
|
-
"
|
|
26
|
-
|
|
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"
|
|
27
67
|
}
|
|
28
68
|
},
|
|
29
69
|
"types": "dist/types/src/index.d.ts",
|
|
30
|
-
"typesVersions": {
|
|
31
|
-
"*": {
|
|
32
|
-
"types": [
|
|
33
|
-
"dist/types/src/types/index.d.ts"
|
|
34
|
-
]
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
70
|
"files": [
|
|
38
71
|
"dist",
|
|
39
72
|
"src"
|
|
@@ -42,29 +75,29 @@
|
|
|
42
75
|
"@effect-atom/atom-react": "^0.5.0",
|
|
43
76
|
"@fluentui/react-tabster": "9.26.11",
|
|
44
77
|
"@radix-ui/react-collapsible": "1.1.3",
|
|
45
|
-
"effect": "3.
|
|
78
|
+
"effect": "3.20.0",
|
|
46
79
|
"node-fetch": "^2.6.0",
|
|
47
80
|
"react-is": "~19.2.0",
|
|
48
|
-
"@dxos/app-toolkit": "0.8.4-main.
|
|
49
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/echo-atom": "0.8.4-main.
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/plugin-
|
|
58
|
-
"@dxos/plugin-graph": "0.8.4-main.
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/react-
|
|
61
|
-
"@dxos/react-ui-
|
|
62
|
-
"@dxos/react-ui-
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/
|
|
81
|
+
"@dxos/app-toolkit": "0.8.4-main.8baae0fced",
|
|
82
|
+
"@dxos/app-framework": "0.8.4-main.8baae0fced",
|
|
83
|
+
"@dxos/client": "0.8.4-main.8baae0fced",
|
|
84
|
+
"@dxos/echo-atom": "0.8.4-main.8baae0fced",
|
|
85
|
+
"@dxos/async": "0.8.4-main.8baae0fced",
|
|
86
|
+
"@dxos/invariant": "0.8.4-main.8baae0fced",
|
|
87
|
+
"@dxos/operation": "0.8.4-main.8baae0fced",
|
|
88
|
+
"@dxos/plugin-client": "0.8.4-main.8baae0fced",
|
|
89
|
+
"@dxos/echo": "0.8.4-main.8baae0fced",
|
|
90
|
+
"@dxos/plugin-deck": "0.8.4-main.8baae0fced",
|
|
91
|
+
"@dxos/plugin-graph": "0.8.4-main.8baae0fced",
|
|
92
|
+
"@dxos/plugin-space": "0.8.4-main.8baae0fced",
|
|
93
|
+
"@dxos/react-client": "0.8.4-main.8baae0fced",
|
|
94
|
+
"@dxos/react-ui-attention": "0.8.4-main.8baae0fced",
|
|
95
|
+
"@dxos/react-ui-list": "0.8.4-main.8baae0fced",
|
|
96
|
+
"@dxos/react-ui-form": "0.8.4-main.8baae0fced",
|
|
97
|
+
"@dxos/react-ui-stack": "0.8.4-main.8baae0fced",
|
|
98
|
+
"@dxos/schema": "0.8.4-main.8baae0fced",
|
|
99
|
+
"@dxos/types": "0.8.4-main.8baae0fced",
|
|
100
|
+
"@dxos/util": "0.8.4-main.8baae0fced"
|
|
68
101
|
},
|
|
69
102
|
"devDependencies": {
|
|
70
103
|
"@babel/core": "^7.18.13",
|
|
@@ -72,18 +105,19 @@
|
|
|
72
105
|
"@types/react-dom": "~19.2.3",
|
|
73
106
|
"react": "~19.2.3",
|
|
74
107
|
"react-dom": "~19.2.3",
|
|
75
|
-
"vite": "^
|
|
76
|
-
"@dxos/
|
|
77
|
-
"@dxos/
|
|
78
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
108
|
+
"vite": "^8.0.13",
|
|
109
|
+
"@dxos/plugin-testing": "0.8.4-main.8baae0fced",
|
|
110
|
+
"@dxos/react-ui": "0.8.4-main.8baae0fced",
|
|
111
|
+
"@dxos/ui-theme": "0.8.4-main.8baae0fced",
|
|
112
|
+
"@dxos/storybook-utils": "0.8.4-main.8baae0fced"
|
|
79
113
|
},
|
|
80
114
|
"peerDependencies": {
|
|
81
115
|
"@effect-atom/atom-react": "^0.5.0",
|
|
82
|
-
"effect": "3.
|
|
116
|
+
"effect": "3.20.0",
|
|
83
117
|
"react": "~19.2.3",
|
|
84
118
|
"react-dom": "~19.2.3",
|
|
85
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
86
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
119
|
+
"@dxos/react-ui": "0.8.4-main.8baae0fced",
|
|
120
|
+
"@dxos/ui-theme": "0.8.4-main.8baae0fced"
|
|
87
121
|
},
|
|
88
122
|
"publishConfig": {
|
|
89
123
|
"access": "public"
|
package/src/StackPlugin.ts
CHANGED
|
@@ -4,33 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
import { Plugin } from '@dxos/app-framework';
|
|
6
6
|
import { AppPlugin } from '@dxos/app-toolkit';
|
|
7
|
-
import { type Obj } from '@dxos/echo';
|
|
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
13
|
export const StackPlugin = Plugin.define(meta).pipe(
|
|
15
|
-
AppPlugin.addMetadataModule({
|
|
16
|
-
metadata: {
|
|
17
|
-
id: SECTION_IDENTIFIER,
|
|
18
|
-
metadata: {
|
|
19
|
-
parse: (section: { object: Obj.Unknown }, type: string) => {
|
|
20
|
-
switch (type) {
|
|
21
|
-
case 'node':
|
|
22
|
-
return { id: section.object.id, label: (section.object as any).title, data: section.object };
|
|
23
|
-
case 'object':
|
|
24
|
-
return section.object;
|
|
25
|
-
case 'view-object':
|
|
26
|
-
return section;
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
}),
|
|
32
14
|
AppPlugin.addSchemaModule({ schema: [StackViewType] }),
|
|
33
15
|
AppPlugin.addSurfaceModule({ activate: ReactSurface }),
|
|
34
16
|
AppPlugin.addTranslationsModule({ translations }),
|
|
35
17
|
Plugin.make,
|
|
36
18
|
);
|
|
19
|
+
|
|
20
|
+
export default StackPlugin;
|
|
@@ -7,23 +7,20 @@ import React from 'react';
|
|
|
7
7
|
|
|
8
8
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
9
|
import { Surface } from '@dxos/app-framework/ui';
|
|
10
|
-
import {
|
|
10
|
+
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
11
11
|
import { Collection } from '@dxos/echo';
|
|
12
12
|
|
|
13
|
-
import {
|
|
14
|
-
import { meta } from '../../meta';
|
|
13
|
+
import { StackArticle } from '#containers';
|
|
15
14
|
|
|
16
15
|
export default Capability.makeModule(() =>
|
|
17
16
|
Effect.succeed(
|
|
18
17
|
Capability.contributes(
|
|
19
18
|
Capabilities.ReactSurface,
|
|
20
19
|
Surface.create({
|
|
21
|
-
id:
|
|
22
|
-
|
|
23
|
-
filter: (data): data is { attendableId: string; subject: Collection.Collection } =>
|
|
24
|
-
typeof data.attendableId === 'string' && Obj.instanceOf(Collection.Collection, data.subject),
|
|
20
|
+
id: 'article',
|
|
21
|
+
filter: AppSurface.object(AppSurface.Article, Collection.Collection),
|
|
25
22
|
component: ({ role, data }) => {
|
|
26
|
-
return <
|
|
23
|
+
return <StackArticle attendableId={data.attendableId} role={role} subject={data.subject} />;
|
|
27
24
|
},
|
|
28
25
|
}),
|
|
29
26
|
),
|
|
@@ -6,16 +6,17 @@ import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
|
6
6
|
import React, { useMemo, useState } from 'react';
|
|
7
7
|
|
|
8
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
13
|
import { getSize, mx } from '@dxos/ui-theme';
|
|
13
14
|
|
|
14
|
-
import { meta } from '
|
|
15
|
-
import { type StackSectionItem } from '
|
|
15
|
+
import { meta } from '#meta';
|
|
16
|
+
import { type StackSectionItem } from '#types';
|
|
16
17
|
|
|
17
|
-
import { CaretDownUp } from './CaretDownUp';
|
|
18
18
|
import { useStack } from '../StackContext';
|
|
19
|
+
import { CaretDownUp } from './CaretDownUp';
|
|
19
20
|
|
|
20
21
|
const sectionActionDimensions = 'p-1 my-1 shrink-0 min-h-0 w-(--dx-rail-action) h-min';
|
|
21
22
|
|
|
@@ -49,7 +50,7 @@ export const StackSection = ({
|
|
|
49
50
|
>
|
|
50
51
|
<DropdownMenu.Trigger asChild>
|
|
51
52
|
<StackItem.SigilButton>
|
|
52
|
-
<Icon icon={icon}
|
|
53
|
+
<Icon icon={icon} classNames='transition-opacity' />
|
|
53
54
|
</StackItem.SigilButton>
|
|
54
55
|
</DropdownMenu.Trigger>
|
|
55
56
|
<DropdownMenu.Portal>
|
|
@@ -57,28 +58,28 @@ export const StackSection = ({
|
|
|
57
58
|
<DropdownMenu.Viewport>
|
|
58
59
|
{view.collapsed ? (
|
|
59
60
|
<DropdownMenu.Item onClick={() => onNavigate(id)} data-testid='section.navigate-to'>
|
|
60
|
-
<Icon icon='ph--arrow-right--regular'
|
|
61
|
-
<span className='ms-2 grow'>{t('navigate
|
|
61
|
+
<Icon icon='ph--arrow-right--regular' />
|
|
62
|
+
<span className='ms-2 grow'>{t('navigate-to-section.label')}</span>
|
|
62
63
|
</DropdownMenu.Item>
|
|
63
64
|
) : (
|
|
64
65
|
<CollapsiblePrimitive.Trigger asChild>
|
|
65
66
|
<DropdownMenu.Item>
|
|
66
67
|
<CaretDownUp className={getSize(5)} />
|
|
67
|
-
<span className='ms-2 grow'>{t('collapse
|
|
68
|
+
<span className='ms-2 grow'>{t('collapse.label')}</span>
|
|
68
69
|
</DropdownMenu.Item>
|
|
69
70
|
</CollapsiblePrimitive.Trigger>
|
|
70
71
|
)}
|
|
71
72
|
<DropdownMenu.Item onClick={() => onAdd(id, 'before')} data-testid='section.add-before'>
|
|
72
|
-
<Icon icon='ph--arrow-line-up--regular'
|
|
73
|
-
<span className='ms-2 grow'>{t('add
|
|
73
|
+
<Icon icon='ph--arrow-line-up--regular' />
|
|
74
|
+
<span className='ms-2 grow'>{t('add-section-before.label')}</span>
|
|
74
75
|
</DropdownMenu.Item>
|
|
75
76
|
<DropdownMenu.Item onClick={() => onAdd(id, 'after')} data-testid='section.add-after'>
|
|
76
|
-
<Icon icon='ph--arrow-line-down--regular'
|
|
77
|
-
<span className='ms-2 grow'>{t('add
|
|
77
|
+
<Icon icon='ph--arrow-line-down--regular' />
|
|
78
|
+
<span className='ms-2 grow'>{t('add-section-after.label')}</span>
|
|
78
79
|
</DropdownMenu.Item>
|
|
79
80
|
<DropdownMenu.Item onClick={() => onDelete(id)} data-testid='section.remove'>
|
|
80
|
-
<Icon icon='ph--trash--regular'
|
|
81
|
-
<span className='ms-2 grow'>{t('remove
|
|
81
|
+
<Icon icon='ph--trash--regular' />
|
|
82
|
+
<span className='ms-2 grow'>{t('remove-section.label')}</span>
|
|
82
83
|
</DropdownMenu.Item>
|
|
83
84
|
</DropdownMenu.Viewport>
|
|
84
85
|
<DropdownMenu.Arrow />
|
|
@@ -90,7 +91,7 @@ export const StackSection = ({
|
|
|
90
91
|
<IconButton
|
|
91
92
|
iconOnly
|
|
92
93
|
variant='ghost'
|
|
93
|
-
label={t('expand
|
|
94
|
+
label={t('expand.label')}
|
|
94
95
|
icon='ph--caret-up-down--regular'
|
|
95
96
|
classNames={sectionActionDimensions}
|
|
96
97
|
/>
|
|
@@ -100,7 +101,7 @@ export const StackSection = ({
|
|
|
100
101
|
iconOnly
|
|
101
102
|
variant='ghost'
|
|
102
103
|
onClick={() => onNavigate(id)}
|
|
103
|
-
label={t('navigate
|
|
104
|
+
label={t('navigate-to-section.label')}
|
|
104
105
|
icon='ph--arrow-right--regular'
|
|
105
106
|
data-testid='section.navigate-to'
|
|
106
107
|
classNames={sectionActionDimensions}
|
|
@@ -109,7 +110,7 @@ export const StackSection = ({
|
|
|
109
110
|
</StackItem.HeadingStickyContent>
|
|
110
111
|
</StackItem.Heading>
|
|
111
112
|
<CollapsiblePrimitive.Content>
|
|
112
|
-
<Surface.Surface
|
|
113
|
+
<Surface.Surface type={AppSurface.Section} data={data} limit={1} placeholder={<></>} />
|
|
113
114
|
</CollapsiblePrimitive.Content>
|
|
114
115
|
{view.collapsed && (
|
|
115
116
|
<StackItem.Content classNames='dx-attention-surface'>
|
|
@@ -5,26 +5,24 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { Input, useTranslation } from '@dxos/react-ui';
|
|
8
|
-
import { Settings } from '@dxos/react-ui-form';
|
|
8
|
+
import { Settings as SettingsForm } from '@dxos/react-ui-form';
|
|
9
9
|
|
|
10
|
-
import { meta } from '
|
|
11
|
-
import { type StackSettingsProps } from '
|
|
10
|
+
import { meta } from '#meta';
|
|
11
|
+
import { type StackSettingsProps } from '#types';
|
|
12
12
|
|
|
13
13
|
export const StackSettings = ({ settings }: { settings: StackSettingsProps }) => {
|
|
14
14
|
const { t } = useTranslation(meta.id);
|
|
15
15
|
|
|
16
16
|
return (
|
|
17
|
-
<
|
|
18
|
-
<
|
|
19
|
-
<
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</Settings.Section>
|
|
28
|
-
</Settings.Root>
|
|
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>
|
|
29
27
|
);
|
|
30
28
|
};
|
|
@@ -6,28 +6,26 @@ import { Atom, useAtomValue } from '@effect-atom/atom-react';
|
|
|
6
6
|
import * as Option from 'effect/Option';
|
|
7
7
|
import React, { useCallback, useState } from 'react';
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { type
|
|
12
|
-
import {
|
|
13
|
-
import { Obj, type Ref } from '@dxos/echo';
|
|
14
|
-
import { type Collection } from '@dxos/echo';
|
|
9
|
+
import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
10
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
11
|
+
import { useAppGraph, type AppSurface } from '@dxos/app-toolkit/ui';
|
|
12
|
+
import { Annotation, type Collection, Obj, type Ref } from '@dxos/echo';
|
|
15
13
|
import { AtomObj } from '@dxos/echo-atom';
|
|
16
14
|
import { Graph } from '@dxos/plugin-graph';
|
|
17
|
-
import { SpaceOperation } from '@dxos/plugin-space
|
|
15
|
+
import { SpaceOperation } from '@dxos/plugin-space';
|
|
18
16
|
import { Toolbar, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
19
17
|
import { Stack, StackItem } from '@dxos/react-ui-stack';
|
|
20
18
|
import { isNonNullable } from '@dxos/util';
|
|
21
19
|
|
|
22
|
-
import { StackContext, StackSection } from '
|
|
23
|
-
import { meta } from '
|
|
20
|
+
import { StackContext, StackSection } from '#components';
|
|
21
|
+
import { meta } from '#meta';
|
|
24
22
|
import {
|
|
25
23
|
type AddSectionPosition,
|
|
26
24
|
type CollapsedSections,
|
|
27
25
|
type StackSectionItem,
|
|
28
26
|
type StackSectionMetadata,
|
|
29
27
|
type StackSectionView,
|
|
30
|
-
} from '
|
|
28
|
+
} from '#types';
|
|
31
29
|
|
|
32
30
|
const collectionObjectsFamily = Atom.family((collection: Collection.Collection) =>
|
|
33
31
|
Atom.make((get) => {
|
|
@@ -41,13 +39,12 @@ const collectionObjectsFamily = Atom.family((collection: Collection.Collection)
|
|
|
41
39
|
}),
|
|
42
40
|
);
|
|
43
41
|
|
|
44
|
-
type
|
|
42
|
+
type StackArticleProps = AppSurface.ObjectArticleProps<Collection.Collection>;
|
|
45
43
|
|
|
46
|
-
export const
|
|
44
|
+
export const StackArticle = ({ attendableId, subject: collection }: StackArticleProps) => {
|
|
47
45
|
const { invokePromise } = useOperationInvoker();
|
|
48
46
|
const { graph } = useAppGraph();
|
|
49
47
|
const { t } = useTranslation(meta.id);
|
|
50
|
-
const allMetadata = useCapabilities(AppCapabilities.Metadata);
|
|
51
48
|
const [collapsedSections, setCollapsedSections] = useState<CollapsedSections>({});
|
|
52
49
|
|
|
53
50
|
// TODO(wittjosiah): Re-implement stack views with relations.
|
|
@@ -61,8 +58,9 @@ export const StackContainer = ({ attendableId, subject: collection }: StackConta
|
|
|
61
58
|
|
|
62
59
|
const collectionObjects = useAtomValue(collectionObjectsFamily(collection));
|
|
63
60
|
const items = collectionObjects.map((object: Obj.Unknown) => {
|
|
64
|
-
const
|
|
65
|
-
|
|
61
|
+
const schema = Obj.getSchema(object);
|
|
62
|
+
const iconAnnotation = schema ? Option.getOrUndefined(Annotation.IconAnnotation.get(schema)) : undefined;
|
|
63
|
+
const metadata: StackSectionMetadata = { icon: iconAnnotation?.icon };
|
|
66
64
|
const view = {
|
|
67
65
|
// ...stack.sections[object.id],
|
|
68
66
|
collapsed: collapsedSections[Obj.getDXN(object).toString()],
|
|
@@ -147,7 +145,7 @@ export const StackContainer = ({ attendableId, subject: collection }: StackConta
|
|
|
147
145
|
</Toolbar.Root>
|
|
148
146
|
<StackContext.Provider
|
|
149
147
|
value={{
|
|
150
|
-
attendableId
|
|
148
|
+
attendableId,
|
|
151
149
|
onCollapse: handleCollapse,
|
|
152
150
|
onNavigate: handleNavigate,
|
|
153
151
|
onDelete: handleDelete,
|
package/src/containers/index.ts
CHANGED
package/src/index.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -5,13 +5,14 @@
|
|
|
5
5
|
import { type Plugin } from '@dxos/app-framework';
|
|
6
6
|
import { trim } from '@dxos/util';
|
|
7
7
|
|
|
8
|
-
export const SECTION_IDENTIFIER = 'org.dxos.type.
|
|
8
|
+
export const SECTION_IDENTIFIER = 'org.dxos.type.stackSection';
|
|
9
9
|
|
|
10
10
|
export const meta: Plugin.Meta = {
|
|
11
11
|
id: 'org.dxos.plugin.stack',
|
|
12
12
|
// TODO(wittjosiah): Prevents "stacks" language from being exposed to users in settings panel.
|
|
13
13
|
// Conside renaming this to the collection plugin and trying to factor more collections logic from the space plugin.
|
|
14
14
|
name: 'Collections',
|
|
15
|
+
author: 'DXOS',
|
|
15
16
|
description: trim`
|
|
16
17
|
Organize and view curated collections of workspace objects in customizable layouts.
|
|
17
18
|
Group related items together and manage collections with sections and filtering.
|
package/src/plugin.ts
ADDED
package/src/translations.ts
CHANGED
|
@@ -3,34 +3,35 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type Resource } from '@dxos/react-ui';
|
|
6
|
-
import { translations as stackTranslations } from '@dxos/react-ui-stack';
|
|
6
|
+
import { translations as stackTranslations } from '@dxos/react-ui-stack/translations';
|
|
7
7
|
|
|
8
|
-
import { meta } from '
|
|
8
|
+
import { meta } from '#meta';
|
|
9
9
|
|
|
10
10
|
export const translations = [
|
|
11
11
|
{
|
|
12
12
|
'en-US': {
|
|
13
13
|
[meta.id]: {
|
|
14
|
-
'plugin
|
|
15
|
-
'settings
|
|
16
|
-
'settings
|
|
17
|
-
'
|
|
18
|
-
'add
|
|
19
|
-
'add
|
|
20
|
-
'add
|
|
21
|
-
'add
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
'
|
|
25
|
-
'
|
|
26
|
-
'
|
|
27
|
-
'
|
|
28
|
-
'
|
|
29
|
-
'add
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
'
|
|
33
|
-
'
|
|
14
|
+
'plugin.name': 'Stacks',
|
|
15
|
+
'settings.title': 'Stack settings',
|
|
16
|
+
'settings.separation.label': 'Separate sections',
|
|
17
|
+
'settings.separation.description': 'Add visual dividers between sections in stacks.',
|
|
18
|
+
'add-section-beforeAll-dialog.title': 'Add a section to the start',
|
|
19
|
+
'add-section-afterAll-dialog.title': 'Add a section to the end',
|
|
20
|
+
'add-section-before-dialog.title': 'Add a section',
|
|
21
|
+
'add-section-after-dialog.title': 'Add a section',
|
|
22
|
+
'add-section-input.placeholder': 'Find the type of section to add',
|
|
23
|
+
'upload-file.label': 'Add file',
|
|
24
|
+
'add-section.label': 'Add section',
|
|
25
|
+
'empty-stack.message': 'Drag objects into the stack.',
|
|
26
|
+
'remove-section.label': 'Delete',
|
|
27
|
+
'navigate-to-section.label': 'Navigate to object',
|
|
28
|
+
'untitled-section.title': 'Untitled section',
|
|
29
|
+
'add-section-before.label': 'Add before',
|
|
30
|
+
'add-section-after.label': 'Add after',
|
|
31
|
+
'expand.label': 'Expand',
|
|
32
|
+
'collapse.label': 'Collapse',
|
|
33
|
+
'open-chat-thread.label': 'Open chat thread',
|
|
34
|
+
'drag-handle.label': 'Press space or enter to begin dragging this object.',
|
|
34
35
|
},
|
|
35
36
|
},
|
|
36
37
|
},
|
package/src/types/stack.ts
CHANGED
|
@@ -23,7 +23,7 @@ export const StackViewType = Schema.Struct({
|
|
|
23
23
|
sections: Schema.Record({ key: Schema.String, value: SectionSchema }),
|
|
24
24
|
}).pipe(
|
|
25
25
|
Type.object({
|
|
26
|
-
typename: 'org.dxos.type.
|
|
26
|
+
typename: 'org.dxos.type.stackView',
|
|
27
27
|
version: '0.1.0',
|
|
28
28
|
}),
|
|
29
29
|
);
|
package/src/types/types.ts
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { type FC } from 'react';
|
|
6
6
|
|
|
7
|
-
import { type Obj } from '@dxos/echo';
|
|
8
|
-
import { type Collection } from '@dxos/echo';
|
|
7
|
+
import { type Collection, type Obj } from '@dxos/echo';
|
|
9
8
|
import { type Label } from '@dxos/react-ui';
|
|
10
9
|
import { type StackItemSize } from '@dxos/react-ui-stack';
|
|
11
10
|
|