@dxos/plugin-thread 0.10.0 → 0.11.1
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/ThreadPlugin.mjs → ThreadPlugin.mjs} +26 -66
- package/dist/lib/ThreadPlugin.mjs.map +1 -0
- package/dist/lib/ThreadPlugin.node.mjs +19 -0
- package/dist/lib/ThreadPlugin.node.mjs.map +1 -0
- package/dist/lib/ThreadPlugin.workerd.mjs +19 -0
- package/dist/lib/ThreadPlugin.workerd.mjs.map +1 -0
- package/dist/lib/capabilities/node.mjs +8 -0
- package/dist/lib/capabilities/node.mjs.map +1 -0
- package/dist/lib/capabilities.mjs +11 -0
- package/dist/lib/capabilities.mjs.map +1 -0
- package/dist/lib/chunk-ChannelArticle.mjs +104 -0
- package/dist/lib/chunk-ChannelArticle.mjs.map +1 -0
- package/dist/lib/chunk-ChannelCreatePanel.mjs +41 -0
- package/dist/lib/chunk-ChannelCreatePanel.mjs.map +1 -0
- package/dist/lib/chunk-ThreadArticle.mjs +58 -0
- package/dist/lib/chunk-ThreadArticle.mjs.map +1 -0
- package/dist/lib/chunk-app-graph-builder.mjs +49 -0
- package/dist/lib/chunk-app-graph-builder.mjs.map +1 -0
- package/dist/lib/chunk-append-channel-message.mjs +30 -0
- package/dist/lib/chunk-append-channel-message.mjs.map +1 -0
- package/dist/lib/chunk-channel-backend-feed.mjs +68 -0
- package/dist/lib/chunk-channel-backend-feed.mjs.map +1 -0
- package/dist/lib/chunk-create-channel.mjs +31 -0
- package/dist/lib/chunk-create-channel.mjs.map +1 -0
- package/dist/lib/chunk-create-object.mjs +36 -0
- package/dist/lib/chunk-create-object.mjs.map +1 -0
- package/dist/lib/{neutral/chunk-A5JYVGL2.mjs → chunk-meta.mjs} +20 -25
- package/dist/lib/chunk-meta.mjs.map +1 -0
- package/dist/lib/chunk-operation-handler.mjs +11 -0
- package/dist/lib/chunk-operation-handler.mjs.map +1 -0
- package/dist/lib/chunk-paths.mjs +8 -0
- package/dist/lib/chunk-paths.mjs.map +1 -0
- package/dist/lib/chunk-react-surface.mjs +38 -0
- package/dist/lib/chunk-react-surface.mjs.map +1 -0
- package/dist/lib/chunk-types.mjs +99 -0
- package/dist/lib/chunk-types.mjs.map +1 -0
- package/dist/lib/components.mjs +105 -0
- package/dist/lib/components.mjs.map +1 -0
- package/dist/lib/containers.mjs +9 -0
- package/dist/lib/containers.mjs.map +1 -0
- package/dist/lib/hooks.mjs +45 -0
- package/dist/lib/hooks.mjs.map +1 -0
- package/dist/lib/index.mjs +5 -0
- package/dist/lib/meta.mjs +2 -0
- package/dist/lib/operations.mjs +7 -0
- package/dist/lib/operations.mjs.map +1 -0
- package/dist/lib/plugin.mjs +9 -0
- package/dist/lib/plugin.mjs.map +1 -0
- package/dist/lib/translations.mjs +84 -0
- package/dist/lib/translations.mjs.map +1 -0
- package/dist/lib/types.mjs +2 -0
- package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
- package/dist/types/src/ThreadPlugin.node.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/channel-backend-feed.d.ts +1 -1
- package/dist/types/src/capabilities/channel-backend-feed.d.ts.map +1 -1
- package/dist/types/src/capabilities/create-object.d.ts +1 -1
- package/dist/types/src/capabilities/index.d.ts +0 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/node.d.ts +5 -0
- package/dist/types/src/capabilities/node.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/{Chat/Chat.d.ts → MessageThread/MessageThread.d.ts} +11 -12
- package/dist/types/src/components/MessageThread/MessageThread.d.ts.map +1 -0
- package/dist/types/src/components/MessageThread/index.d.ts +2 -0
- package/dist/types/src/components/MessageThread/index.d.ts.map +1 -0
- 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/ChannelArticle/ChannelArticle.d.ts +4 -9
- package/dist/types/src/containers/ChannelArticle/ChannelArticle.d.ts.map +1 -1
- package/dist/types/src/containers/ChannelArticle/ChannelArticle.stories.d.ts +4 -1
- package/dist/types/src/containers/ChannelArticle/ChannelArticle.stories.d.ts.map +1 -1
- package/dist/types/src/containers/ChannelCreatePanel/ChannelCreatePanel.d.ts +4 -8
- package/dist/types/src/containers/ChannelCreatePanel/ChannelCreatePanel.d.ts.map +1 -1
- package/dist/types/src/containers/ThreadArticle/ThreadArticle.d.ts +1 -3
- package/dist/types/src/containers/ThreadArticle/ThreadArticle.d.ts.map +1 -1
- package/dist/types/src/containers/ThreadArticle/ThreadArticle.stories.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +14 -3
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dx.config.ts +2 -1
- package/package.json +54 -46
- package/src/ThreadPlugin.node.ts +1 -2
- package/src/ThreadPlugin.test.ts +5 -2
- package/src/ThreadPlugin.tsx +1 -10
- package/src/capabilities/app-graph-builder.ts +5 -3
- package/src/capabilities/index.ts +0 -1
- package/src/capabilities/node.ts +18 -0
- package/src/capabilities/{react-surface.tsx → react-surface.ts} +6 -14
- package/src/components/{Chat/Chat.tsx → MessageThread/MessageThread.tsx} +20 -17
- package/src/components/{Chat → MessageThread}/index.ts +1 -1
- package/src/components/index.ts +1 -1
- package/src/containers/ChannelArticle/ChannelArticle.stories.tsx +4 -1
- package/src/containers/ChannelArticle/ChannelArticle.tsx +6 -4
- package/src/containers/ChannelCreatePanel/ChannelCreatePanel.tsx +4 -3
- package/src/containers/ThreadArticle/ThreadArticle.stories.tsx +4 -2
- package/src/containers/ThreadArticle/ThreadArticle.tsx +30 -18
- package/src/paths.ts +3 -3
- package/src/util.ts +21 -7
- package/dist/lib/neutral/ChannelArticle-CTYSCRTR.mjs +0 -122
- package/dist/lib/neutral/ChannelArticle-CTYSCRTR.mjs.map +0 -7
- package/dist/lib/neutral/ChannelCreatePanel-NUXXKHZQ.mjs +0 -38
- package/dist/lib/neutral/ChannelCreatePanel-NUXXKHZQ.mjs.map +0 -7
- package/dist/lib/neutral/ThreadArticle-ROQXQLEZ.mjs +0 -57
- package/dist/lib/neutral/ThreadArticle-ROQXQLEZ.mjs.map +0 -7
- package/dist/lib/neutral/ThreadPlugin.mjs.map +0 -7
- package/dist/lib/neutral/ThreadPlugin.node.mjs +0 -29
- package/dist/lib/neutral/ThreadPlugin.node.mjs.map +0 -7
- package/dist/lib/neutral/ThreadPlugin.workerd.mjs +0 -27
- package/dist/lib/neutral/ThreadPlugin.workerd.mjs.map +0 -7
- package/dist/lib/neutral/app-graph-builder-NZOWDFE5.mjs +0 -65
- package/dist/lib/neutral/app-graph-builder-NZOWDFE5.mjs.map +0 -7
- package/dist/lib/neutral/append-channel-message-YIIJY6GX.mjs +0 -34
- package/dist/lib/neutral/append-channel-message-YIIJY6GX.mjs.map +0 -7
- package/dist/lib/neutral/capabilities/index.mjs +0 -19
- package/dist/lib/neutral/capabilities/index.mjs.map +0 -7
- package/dist/lib/neutral/channel-backend-feed-TOS55NID.mjs +0 -57
- package/dist/lib/neutral/channel-backend-feed-TOS55NID.mjs.map +0 -7
- package/dist/lib/neutral/chunk-5VTDNDBV.mjs +0 -109
- package/dist/lib/neutral/chunk-5VTDNDBV.mjs.map +0 -7
- package/dist/lib/neutral/chunk-A5JYVGL2.mjs.map +0 -7
- package/dist/lib/neutral/chunk-GM3SGQMJ.mjs +0 -69
- package/dist/lib/neutral/chunk-GM3SGQMJ.mjs.map +0 -7
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +0 -10
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +0 -7
- package/dist/lib/neutral/chunk-J7OTCRYF.mjs +0 -12
- package/dist/lib/neutral/chunk-J7OTCRYF.mjs.map +0 -7
- package/dist/lib/neutral/chunk-XPUQE4Y7.mjs +0 -8
- package/dist/lib/neutral/chunk-XPUQE4Y7.mjs.map +0 -7
- package/dist/lib/neutral/components/index.mjs +0 -96
- package/dist/lib/neutral/components/index.mjs.map +0 -7
- package/dist/lib/neutral/containers/index.mjs +0 -13
- package/dist/lib/neutral/containers/index.mjs.map +0 -7
- package/dist/lib/neutral/create-channel-4CA7P2M5.mjs +0 -41
- package/dist/lib/neutral/create-channel-4CA7P2M5.mjs.map +0 -7
- package/dist/lib/neutral/create-object-O3TZ2MCJ.mjs +0 -45
- package/dist/lib/neutral/create-object-O3TZ2MCJ.mjs.map +0 -7
- package/dist/lib/neutral/hooks/index.mjs +0 -11
- package/dist/lib/neutral/hooks/index.mjs.map +0 -7
- package/dist/lib/neutral/index.mjs +0 -34
- package/dist/lib/neutral/index.mjs.map +0 -7
- package/dist/lib/neutral/meta.json +0 -1
- package/dist/lib/neutral/meta.mjs +0 -10
- package/dist/lib/neutral/meta.mjs.map +0 -7
- package/dist/lib/neutral/navigation-resolver-LSTZL32O.mjs +0 -18
- package/dist/lib/neutral/navigation-resolver-LSTZL32O.mjs.map +0 -7
- package/dist/lib/neutral/operation-handler-RU6K2S4L.mjs +0 -13
- package/dist/lib/neutral/operation-handler-RU6K2S4L.mjs.map +0 -7
- package/dist/lib/neutral/operations/index.mjs +0 -8
- package/dist/lib/neutral/operations/index.mjs.map +0 -7
- package/dist/lib/neutral/plugin.mjs +0 -16
- package/dist/lib/neutral/plugin.mjs.map +0 -7
- package/dist/lib/neutral/react-surface-H2EKIMSK.mjs +0 -49
- package/dist/lib/neutral/react-surface-H2EKIMSK.mjs.map +0 -7
- package/dist/lib/neutral/translations.mjs +0 -91
- package/dist/lib/neutral/translations.mjs.map +0 -7
- package/dist/lib/neutral/types/index.mjs +0 -16
- package/dist/lib/neutral/types/index.mjs.map +0 -7
- package/dist/types/src/capabilities/navigation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/navigation-resolver.d.ts.map +0 -1
- package/dist/types/src/components/Chat/Chat.d.ts.map +0 -1
- package/dist/types/src/components/Chat/index.d.ts +0 -2
- package/dist/types/src/components/Chat/index.d.ts.map +0 -1
- package/src/capabilities/navigation-resolver.ts +0 -20
package/dx.config.ts
CHANGED
|
@@ -24,10 +24,11 @@ export default Config2.make({
|
|
|
24
24
|
|
|
25
25
|
The shared message and thread UI comes from @dxos/react-ui-thread; the Channel,
|
|
26
26
|
Message, and Thread schema come from @dxos/types. Document comments and the
|
|
27
|
-
comment-thread AI agent live in the @dxos/plugin-
|
|
27
|
+
comment-thread AI agent live in the @dxos/plugin-review plugin.
|
|
28
28
|
`,
|
|
29
29
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-thread',
|
|
30
30
|
icon: { key: 'ph--video-conference--regular', hue: 'rose' },
|
|
31
31
|
spec: 'PLUGIN.mdl',
|
|
32
|
+
tags: ['alpha'],
|
|
32
33
|
},
|
|
33
34
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-thread",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"description": "DXOS Threads Surface plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -14,34 +14,38 @@
|
|
|
14
14
|
"type": "module",
|
|
15
15
|
"imports": {
|
|
16
16
|
"#capabilities": {
|
|
17
|
-
"source":
|
|
17
|
+
"source": {
|
|
18
|
+
"node": "./src/capabilities/node.ts",
|
|
19
|
+
"default": "./src/capabilities/index.ts"
|
|
20
|
+
},
|
|
18
21
|
"types": "./dist/types/src/capabilities/index.d.ts",
|
|
19
|
-
"
|
|
22
|
+
"node": "./dist/lib/capabilities/node.mjs",
|
|
23
|
+
"default": "./dist/lib/capabilities.mjs"
|
|
20
24
|
},
|
|
21
25
|
"#components": {
|
|
22
26
|
"source": "./src/components/index.ts",
|
|
23
27
|
"types": "./dist/types/src/components/index.d.ts",
|
|
24
|
-
"default": "./dist/lib/
|
|
28
|
+
"default": "./dist/lib/components.mjs"
|
|
25
29
|
},
|
|
26
30
|
"#containers": {
|
|
27
31
|
"source": "./src/containers/index.ts",
|
|
28
32
|
"types": "./dist/types/src/containers/index.d.ts",
|
|
29
|
-
"default": "./dist/lib/
|
|
33
|
+
"default": "./dist/lib/containers.mjs"
|
|
30
34
|
},
|
|
31
35
|
"#hooks": {
|
|
32
36
|
"source": "./src/hooks/index.ts",
|
|
33
37
|
"types": "./dist/types/src/hooks/index.d.ts",
|
|
34
|
-
"default": "./dist/lib/
|
|
38
|
+
"default": "./dist/lib/hooks.mjs"
|
|
35
39
|
},
|
|
36
40
|
"#meta": {
|
|
37
41
|
"source": "./src/meta.ts",
|
|
38
42
|
"types": "./dist/types/src/meta.d.ts",
|
|
39
|
-
"default": "./dist/lib/
|
|
43
|
+
"default": "./dist/lib/meta.mjs"
|
|
40
44
|
},
|
|
41
45
|
"#operations": {
|
|
42
46
|
"source": "./src/operations/index.ts",
|
|
43
47
|
"types": "./dist/types/src/operations/index.d.ts",
|
|
44
|
-
"default": "./dist/lib/
|
|
48
|
+
"default": "./dist/lib/operations.mjs"
|
|
45
49
|
},
|
|
46
50
|
"#plugin": {
|
|
47
51
|
"source": {
|
|
@@ -50,42 +54,42 @@
|
|
|
50
54
|
"default": "./src/ThreadPlugin.tsx"
|
|
51
55
|
},
|
|
52
56
|
"types": "./dist/types/src/ThreadPlugin.d.ts",
|
|
53
|
-
"workerd": "./dist/lib/
|
|
54
|
-
"node": "./dist/lib/
|
|
55
|
-
"default": "./dist/lib/
|
|
57
|
+
"workerd": "./dist/lib/ThreadPlugin.workerd.mjs",
|
|
58
|
+
"node": "./dist/lib/ThreadPlugin.node.mjs",
|
|
59
|
+
"default": "./dist/lib/ThreadPlugin.mjs"
|
|
56
60
|
},
|
|
57
61
|
"#translations": {
|
|
58
62
|
"source": "./src/translations.ts",
|
|
59
63
|
"types": "./dist/types/src/translations.d.ts",
|
|
60
|
-
"default": "./dist/lib/
|
|
64
|
+
"default": "./dist/lib/translations.mjs"
|
|
61
65
|
},
|
|
62
66
|
"#types": {
|
|
63
67
|
"source": "./src/types/index.ts",
|
|
64
68
|
"types": "./dist/types/src/types/index.d.ts",
|
|
65
|
-
"default": "./dist/lib/
|
|
69
|
+
"default": "./dist/lib/types.mjs"
|
|
66
70
|
}
|
|
67
71
|
},
|
|
68
72
|
"exports": {
|
|
69
73
|
".": {
|
|
70
74
|
"source": "./src/index.ts",
|
|
71
75
|
"types": "./dist/types/src/index.d.ts",
|
|
72
|
-
"
|
|
76
|
+
"import": "./dist/lib/index.mjs"
|
|
73
77
|
},
|
|
74
78
|
"./assets/PLUGIN.mdl": "./PLUGIN.mdl",
|
|
75
79
|
"./plugin": {
|
|
76
80
|
"source": "./src/plugin.ts",
|
|
77
81
|
"types": "./dist/types/src/plugin.d.ts",
|
|
78
|
-
"
|
|
82
|
+
"import": "./dist/lib/plugin.mjs"
|
|
79
83
|
},
|
|
80
84
|
"./translations": {
|
|
81
85
|
"source": "./src/translations.ts",
|
|
82
86
|
"types": "./dist/types/src/translations.d.ts",
|
|
83
|
-
"
|
|
87
|
+
"import": "./dist/lib/translations.mjs"
|
|
84
88
|
},
|
|
85
89
|
"./types": {
|
|
86
90
|
"source": "./src/types/index.ts",
|
|
87
91
|
"types": "./dist/types/src/types/index.d.ts",
|
|
88
|
-
"
|
|
92
|
+
"import": "./dist/lib/types.mjs"
|
|
89
93
|
}
|
|
90
94
|
},
|
|
91
95
|
"types": "dist/types/src/index.d.ts",
|
|
@@ -97,25 +101,28 @@
|
|
|
97
101
|
],
|
|
98
102
|
"dependencies": {
|
|
99
103
|
"@effect-atom/atom-react": "^0.5.0",
|
|
100
|
-
"@dxos/app-framework": "0.
|
|
101
|
-
"@dxos/
|
|
102
|
-
"@dxos/
|
|
103
|
-
"@dxos/client": "0.
|
|
104
|
-
"@dxos/
|
|
105
|
-
"@dxos/
|
|
106
|
-
"@dxos/
|
|
107
|
-
"@dxos/echo-client": "0.
|
|
108
|
-
"@dxos/
|
|
109
|
-
"@dxos/
|
|
110
|
-
"@dxos/invariant": "0.
|
|
111
|
-
"@dxos/
|
|
112
|
-
"@dxos/
|
|
113
|
-
"@dxos/plugin-
|
|
114
|
-
"@dxos/
|
|
115
|
-
"@dxos/
|
|
116
|
-
"@dxos/
|
|
117
|
-
"@dxos/
|
|
118
|
-
"@dxos/
|
|
104
|
+
"@dxos/app-framework": "0.11.1",
|
|
105
|
+
"@dxos/app-toolkit": "0.11.1",
|
|
106
|
+
"@dxos/client": "0.11.1",
|
|
107
|
+
"@dxos/client-protocol": "0.11.1",
|
|
108
|
+
"@dxos/compute": "0.11.1",
|
|
109
|
+
"@dxos/display-name": "0.11.1",
|
|
110
|
+
"@dxos/echo": "0.11.1",
|
|
111
|
+
"@dxos/echo-client": "0.11.1",
|
|
112
|
+
"@dxos/echo-react": "0.11.1",
|
|
113
|
+
"@dxos/halo": "0.11.1",
|
|
114
|
+
"@dxos/invariant": "0.11.1",
|
|
115
|
+
"@dxos/keys": "0.11.1",
|
|
116
|
+
"@dxos/halo-react": "0.11.1",
|
|
117
|
+
"@dxos/plugin-calls": "0.11.1",
|
|
118
|
+
"@dxos/plugin-graph": "0.11.1",
|
|
119
|
+
"@dxos/plugin-client": "0.11.1",
|
|
120
|
+
"@dxos/plugin-space": "0.11.1",
|
|
121
|
+
"@dxos/react-client": "0.11.1",
|
|
122
|
+
"@dxos/react-ui-thread": "0.11.1",
|
|
123
|
+
"@dxos/util": "0.11.1",
|
|
124
|
+
"@dxos/random": "0.11.1",
|
|
125
|
+
"@dxos/types": "0.11.1"
|
|
119
126
|
},
|
|
120
127
|
"devDependencies": {
|
|
121
128
|
"@types/react": "~19.2.17",
|
|
@@ -123,22 +130,23 @@
|
|
|
123
130
|
"effect": "3.21.4",
|
|
124
131
|
"react": "~19.2.7",
|
|
125
132
|
"react-dom": "~19.2.7",
|
|
126
|
-
"vite": "^8.
|
|
127
|
-
"@dxos/
|
|
128
|
-
"@dxos/react-ui": "0.
|
|
129
|
-
"@dxos/react-ui-menu": "0.
|
|
130
|
-
"@dxos/
|
|
131
|
-
"@dxos/react-ui-
|
|
133
|
+
"vite": "^8.1.4",
|
|
134
|
+
"@dxos/react-ui": "0.11.1",
|
|
135
|
+
"@dxos/react-ui-form": "0.11.1",
|
|
136
|
+
"@dxos/react-ui-menu": "0.11.1",
|
|
137
|
+
"@dxos/plugin-testing": "0.11.1",
|
|
138
|
+
"@dxos/react-ui-mosaic": "0.11.1",
|
|
139
|
+
"@dxos/ui-theme": "0.11.1"
|
|
132
140
|
},
|
|
133
141
|
"peerDependencies": {
|
|
134
142
|
"@effect-atom/atom-react": "^0.5.0",
|
|
135
143
|
"effect": "3.21.4",
|
|
136
144
|
"react": "~19.2.7",
|
|
137
145
|
"react-dom": "~19.2.7",
|
|
138
|
-
"@dxos/react-ui": "0.
|
|
139
|
-
"@dxos/react-ui
|
|
140
|
-
"@dxos/ui-
|
|
141
|
-
"@dxos/
|
|
146
|
+
"@dxos/react-ui-form": "^0.11.1",
|
|
147
|
+
"@dxos/react-ui": "^0.11.1",
|
|
148
|
+
"@dxos/react-ui-menu": "^0.11.1",
|
|
149
|
+
"@dxos/ui-theme": "^0.11.1"
|
|
142
150
|
},
|
|
143
151
|
"publishConfig": {
|
|
144
152
|
"access": "public"
|
package/src/ThreadPlugin.node.ts
CHANGED
|
@@ -6,11 +6,10 @@ import { ActivationEvents, Plugin } from '@dxos/app-framework';
|
|
|
6
6
|
import { AppPlugin } from '@dxos/app-toolkit';
|
|
7
7
|
import { Channel, Message, Thread } from '@dxos/types';
|
|
8
8
|
|
|
9
|
-
import { ChannelBackendFeed,
|
|
9
|
+
import { ChannelBackendFeed, OperationHandler } from '#capabilities';
|
|
10
10
|
import { meta } from '#meta';
|
|
11
11
|
|
|
12
12
|
export const ThreadPlugin = Plugin.define(meta).pipe(
|
|
13
|
-
AppPlugin.addCreateObjectModule({ activate: CreateObject }),
|
|
14
13
|
AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
|
|
15
14
|
AppPlugin.addSchemaModule({
|
|
16
15
|
schema: [Channel.Channel, Message.Message, Thread.Thread],
|
package/src/ThreadPlugin.test.ts
CHANGED
|
@@ -19,9 +19,12 @@ describe('ThreadPlugin', () => {
|
|
|
19
19
|
plugins: [ClientPlugin({}), ThreadPlugin()],
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
-
// After autoStart:
|
|
22
|
+
// After autoStart: schema and OperationHandler auto-cascade. `CreateObject` is browser-only —
|
|
23
|
+
// its `CreateObjectEntry` carries a `customPanel` React component — so the node variant this
|
|
24
|
+
// test resolves does not contribute it.
|
|
23
25
|
expect(harness.manager.getActive()).toEqual(
|
|
24
|
-
expect.arrayContaining([moduleId('
|
|
26
|
+
expect.arrayContaining([moduleId('schema'), moduleId('OperationHandler')]),
|
|
25
27
|
);
|
|
28
|
+
expect(harness.manager.getActive()).not.toContain(moduleId('CreateObject'));
|
|
26
29
|
});
|
|
27
30
|
});
|
package/src/ThreadPlugin.tsx
CHANGED
|
@@ -4,18 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
import { ActivationEvents, Plugin } from '@dxos/app-framework';
|
|
6
6
|
import { AppPlugin } from '@dxos/app-toolkit';
|
|
7
|
-
import { ClientEvents } from '@dxos/plugin-client';
|
|
8
7
|
import { translations as threadTranslations } from '@dxos/react-ui-thread/translations';
|
|
9
8
|
import { Channel, Message, Thread } from '@dxos/types';
|
|
10
9
|
|
|
11
|
-
import {
|
|
12
|
-
AppGraphBuilder,
|
|
13
|
-
ChannelBackendFeed,
|
|
14
|
-
CreateObject,
|
|
15
|
-
NavigationResolver,
|
|
16
|
-
OperationHandler,
|
|
17
|
-
ReactSurface,
|
|
18
|
-
} from '#capabilities';
|
|
10
|
+
import { AppGraphBuilder, ChannelBackendFeed, CreateObject, OperationHandler, ReactSurface } from '#capabilities';
|
|
19
11
|
import { meta } from '#meta';
|
|
20
12
|
import { translations } from '#translations';
|
|
21
13
|
|
|
@@ -26,7 +18,6 @@ import pluginSpec from '../PLUGIN.mdl?raw';
|
|
|
26
18
|
|
|
27
19
|
export const ThreadPlugin = Plugin.define(meta).pipe(
|
|
28
20
|
AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),
|
|
29
|
-
AppPlugin.addNavigationResolverModule({ activatesOn: ClientEvents.ClientReady, activate: NavigationResolver }),
|
|
30
21
|
AppPlugin.addCreateObjectModule({ activate: CreateObject }),
|
|
31
22
|
AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
|
|
32
23
|
AppPlugin.addSchemaModule({
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
7
|
import { Capability } from '@dxos/app-framework';
|
|
8
|
-
import { AppCapabilities, AppNode, AppNodeMatcher,
|
|
8
|
+
import { AppCapabilities, AppNode, AppNodeMatcher, GraphPath, TypeSection } from '@dxos/app-toolkit';
|
|
9
9
|
import { Operation } from '@dxos/compute';
|
|
10
10
|
import { Obj, Type } from '@dxos/echo';
|
|
11
11
|
import { CallsCapabilities } from '@dxos/plugin-calls/types';
|
|
@@ -26,7 +26,9 @@ export default Capability.makeModule(
|
|
|
26
26
|
|
|
27
27
|
const extensions = yield* Effect.all([
|
|
28
28
|
TypeSection.createTypeSectionExtension(Channel.Channel, {
|
|
29
|
-
|
|
29
|
+
urlKey: 'channel',
|
|
30
|
+
match: AppNodeMatcher.whenNavTreeGroup(GraphPath.GroupTypes.communications),
|
|
31
|
+
groupSegment: GraphPath.GroupSegments.communications,
|
|
30
32
|
createObject: (space) =>
|
|
31
33
|
Operation.invoke(SpaceOperation.OpenCreateObject, {
|
|
32
34
|
target: space.db,
|
|
@@ -51,7 +53,7 @@ export default Capability.makeModule(
|
|
|
51
53
|
|
|
52
54
|
return Effect.succeed([
|
|
53
55
|
AppNode.makeCompanion({
|
|
54
|
-
|
|
56
|
+
variant: 'chat',
|
|
55
57
|
label: ['channel-companion.label', { ns: meta.profile.key }],
|
|
56
58
|
icon: 'ph--hash--regular',
|
|
57
59
|
data: 'chat',
|
|
@@ -6,7 +6,6 @@ import { Capability } from '@dxos/app-framework';
|
|
|
6
6
|
import type { OperationHandlerSet } from '@dxos/compute';
|
|
7
7
|
|
|
8
8
|
export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
|
|
9
|
-
export const NavigationResolver = Capability.lazy('NavigationResolver', () => import('./navigation-resolver'));
|
|
10
9
|
export const ChannelBackendFeed = Capability.lazy('ChannelBackendFeed', () => import('./channel-backend-feed'));
|
|
11
10
|
export const CreateObject = Capability.lazy('CreateObject', () => import('./create-object'));
|
|
12
11
|
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
|
+
import type { OperationHandlerSet } from '@dxos/compute';
|
|
7
|
+
|
|
8
|
+
// The capabilities `ThreadPlugin.node` activates, and only those. `Capability.lazy` defers the
|
|
9
|
+
// import at runtime but a bundler still walks it, so listing the React surfaces here would pull
|
|
10
|
+
// the plugin's components into every node and bun build. `CreateObject` is omitted: its
|
|
11
|
+
// `CreateObjectEntry` carries a `customPanel` React component alongside the object factory.
|
|
12
|
+
// TODO(wittjosiah): Split the panel out of the entry so node can contribute the factory.
|
|
13
|
+
|
|
14
|
+
export const ChannelBackendFeed = Capability.lazy('ChannelBackendFeed', () => import('./channel-backend-feed'));
|
|
15
|
+
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
16
|
+
'OperationHandler',
|
|
17
|
+
() => import('./operation-handler'),
|
|
18
|
+
);
|
|
@@ -3,12 +3,10 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
|
-
import React from 'react';
|
|
7
6
|
|
|
8
7
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
8
|
import { Surface } from '@dxos/app-framework/ui';
|
|
10
9
|
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
11
|
-
import { getSpace } from '@dxos/react-client/echo';
|
|
12
10
|
import { Channel, Thread } from '@dxos/types';
|
|
13
11
|
|
|
14
12
|
import { ChannelArticle, ThreadArticle } from '#containers';
|
|
@@ -19,9 +17,8 @@ export default Capability.makeModule(() =>
|
|
|
19
17
|
Surface.create({
|
|
20
18
|
id: 'channel',
|
|
21
19
|
filter: AppSurface.object(AppSurface.Article, Channel.Channel),
|
|
22
|
-
component:
|
|
23
|
-
|
|
24
|
-
),
|
|
20
|
+
component: ChannelArticle,
|
|
21
|
+
props: ({ role, data: { subject, attendableId } }) => ({ role, subject, attendableId }),
|
|
25
22
|
}),
|
|
26
23
|
Surface.create({
|
|
27
24
|
id: 'chatCompanion',
|
|
@@ -29,20 +26,15 @@ export default Capability.makeModule(() =>
|
|
|
29
26
|
AppSurface.literal(AppSurface.Article, 'chat'),
|
|
30
27
|
AppSurface.companion(AppSurface.Article, Channel.Channel),
|
|
31
28
|
),
|
|
32
|
-
component:
|
|
29
|
+
component: ChannelArticle,
|
|
30
|
+
props: ({ data: { companionTo } }) => ({ subject: companionTo, chatOnly: true }),
|
|
33
31
|
}),
|
|
34
32
|
// TODO(burdon): Disambiguate with Channel.
|
|
35
33
|
Surface.create({
|
|
36
34
|
id: 'thread',
|
|
37
35
|
filter: AppSurface.object(AppSurface.Article, Thread.Thread),
|
|
38
|
-
component:
|
|
39
|
-
|
|
40
|
-
if (!space || !subject) {
|
|
41
|
-
return null;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return <ThreadArticle space={space} thread={subject} />;
|
|
45
|
-
},
|
|
36
|
+
component: ThreadArticle,
|
|
37
|
+
props: ({ data: { subject } }) => ({ thread: subject }),
|
|
46
38
|
}),
|
|
47
39
|
]),
|
|
48
40
|
),
|
|
@@ -6,9 +6,7 @@ import React, { useCallback, useMemo } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { Surface } from '@dxos/app-framework/ui';
|
|
8
8
|
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
9
|
-
import {
|
|
10
|
-
import { type SpaceMember } from '@dxos/react-client/echo';
|
|
11
|
-
import { type Identity } from '@dxos/react-client/halo';
|
|
9
|
+
import { type Identity, type Space } from '@dxos/halo';
|
|
12
10
|
import { Card, type ThemedClassName, composable, useTranslation } from '@dxos/react-ui';
|
|
13
11
|
import { type ObjectTileComponent, Thread } from '@dxos/react-ui-thread';
|
|
14
12
|
import { type Message } from '@dxos/types';
|
|
@@ -18,13 +16,13 @@ import { meta } from '#meta';
|
|
|
18
16
|
|
|
19
17
|
import { getMessageMetadata } from '../../util';
|
|
20
18
|
|
|
21
|
-
export type
|
|
19
|
+
export type MessageThreadProps = ThemedClassName<{
|
|
22
20
|
/** Stable id used for the underlying thread root and message metadata. */
|
|
23
21
|
id: string;
|
|
24
22
|
/** Identity used to attribute outgoing messages in the textbox metadata. */
|
|
25
|
-
identity?: Identity;
|
|
23
|
+
identity?: Identity.Info;
|
|
26
24
|
/** Space members for rendering sender names/avatars on incoming messages. */
|
|
27
|
-
members:
|
|
25
|
+
members: readonly Space.Member[];
|
|
28
26
|
/** Messages to render in order. */
|
|
29
27
|
messages: readonly Message.Message[];
|
|
30
28
|
/** Activity indicator (e.g. processing) shown beneath the textbox. */
|
|
@@ -48,12 +46,12 @@ export type ChatProps = ThemedClassName<{
|
|
|
48
46
|
}>;
|
|
49
47
|
|
|
50
48
|
/**
|
|
51
|
-
* Pure
|
|
52
|
-
* the `@dxos/react-ui-thread` primitives. Does not load
|
|
53
|
-
* operations — the caller passes messages and an `onSend`
|
|
54
|
-
* `ChannelArticle` and `ThreadArticle`.
|
|
49
|
+
* Pure message-thread UI: message list + composer textbox + activity
|
|
50
|
+
* indicator, built on the `@dxos/react-ui-thread` primitives. Does not load
|
|
51
|
+
* data or invoke operations — the caller passes messages and an `onSend`
|
|
52
|
+
* callback. Used by `ChannelArticle` and `ThreadArticle`.
|
|
55
53
|
*/
|
|
56
|
-
export const
|
|
54
|
+
export const MessageThread = composable<HTMLDivElement, MessageThreadProps>(
|
|
57
55
|
({ id, identity, members, messages, activity, onSend, autoFocus, current, readOnly, classNames }, forwardedRef) => {
|
|
58
56
|
const { t } = useTranslation(meta.profile.key);
|
|
59
57
|
|
|
@@ -66,22 +64,27 @@ export const Chat = composable<HTMLDivElement, ChatProps>(
|
|
|
66
64
|
// TODO(burdon): Factor out.
|
|
67
65
|
const sender = members.find(
|
|
68
66
|
(member) =>
|
|
69
|
-
(message.sender.identityDid && member.
|
|
70
|
-
(message.sender.identityKey &&
|
|
67
|
+
(message.sender.identityDid && member.did === message.sender.identityDid) ||
|
|
68
|
+
(message.sender.identityKey && member.identityKey === message.sender.identityKey),
|
|
71
69
|
);
|
|
72
70
|
|
|
73
71
|
// Pass `message.sender` as the fallback so externally-synced messages
|
|
74
72
|
// (Slack, etc.) display the source-side sender name instead of "Anonymous"
|
|
75
73
|
// when no DXOS identity matches.
|
|
76
|
-
return getMessageMetadata(message.id, sender
|
|
74
|
+
return getMessageMetadata(message.id, sender, message.sender, message.created);
|
|
77
75
|
},
|
|
78
76
|
[members],
|
|
79
77
|
);
|
|
80
78
|
|
|
81
79
|
return (
|
|
82
80
|
<Thread.Root getMetadata={getMetadata} components={components} identityDid={identity?.did} editable={false}>
|
|
83
|
-
<Thread.Content
|
|
84
|
-
|
|
81
|
+
<Thread.Content
|
|
82
|
+
id={id}
|
|
83
|
+
current={current}
|
|
84
|
+
classNames={['dx-container h-full border', classNames]}
|
|
85
|
+
ref={forwardedRef}
|
|
86
|
+
>
|
|
87
|
+
<Thread.Messages id={id} messages={messages} />
|
|
85
88
|
{!readOnly && (
|
|
86
89
|
<>
|
|
87
90
|
<Thread.Textbox
|
|
@@ -107,7 +110,7 @@ export const Chat = composable<HTMLDivElement, ChatProps>(
|
|
|
107
110
|
const ObjectTile: ObjectTileComponent = ({ subject }) => {
|
|
108
111
|
const Fallback = useCallback(() => <span className='p-1 text-sm text-description'>{subject.id}</span>, [subject]);
|
|
109
112
|
return (
|
|
110
|
-
<Card.Root
|
|
113
|
+
<Card.Root classNames={mx('grid col-span-3 py-1 pr-4', hoverableControls, hoverableFocusedWithinControls)}>
|
|
111
114
|
<Surface.Surface
|
|
112
115
|
type={AppSurface.CardContent}
|
|
113
116
|
limit={1}
|
package/src/components/index.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { withPluginManager } from '@dxos/app-framework/testing';
|
|
|
11
11
|
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
12
12
|
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
13
13
|
import { Database, Feed, Query } from '@dxos/echo';
|
|
14
|
+
import { useQuery } from '@dxos/echo-react';
|
|
14
15
|
import { invariant } from '@dxos/invariant';
|
|
15
16
|
import { CallsPlugin } from '@dxos/plugin-calls/plugin';
|
|
16
17
|
import { ClientPlugin } from '@dxos/plugin-client/testing';
|
|
@@ -18,7 +19,8 @@ import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
|
18
19
|
import { SpacePlugin } from '@dxos/plugin-space/testing';
|
|
19
20
|
import { corePlugins } from '@dxos/plugin-testing';
|
|
20
21
|
import { Config } from '@dxos/react-client';
|
|
21
|
-
import {
|
|
22
|
+
import { useSpaces } from '@dxos/react-client/echo';
|
|
23
|
+
import { withMosaic } from '@dxos/react-ui-mosaic/testing';
|
|
22
24
|
import { Loading, withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
23
25
|
import { Channel, Message, Thread } from '@dxos/types';
|
|
24
26
|
|
|
@@ -43,6 +45,7 @@ const meta = {
|
|
|
43
45
|
component: ChannelArticle,
|
|
44
46
|
render: DefaultStory,
|
|
45
47
|
decorators: [
|
|
48
|
+
withMosaic(),
|
|
46
49
|
withTheme(),
|
|
47
50
|
withLayout({ layout: 'column' }),
|
|
48
51
|
withPluginManager({
|
|
@@ -8,14 +8,14 @@ import React, { useCallback } from 'react';
|
|
|
8
8
|
import { Surface, useCapabilities, useOperationInvoker } from '@dxos/app-framework/ui';
|
|
9
9
|
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
10
10
|
import { Obj } from '@dxos/echo';
|
|
11
|
+
import { useIdentity, useMembers } from '@dxos/halo-react';
|
|
11
12
|
import { CallsCapabilities } from '@dxos/plugin-calls/types';
|
|
12
|
-
import { getSpace
|
|
13
|
-
import { useIdentity } from '@dxos/react-client/halo';
|
|
13
|
+
import { getSpace } from '@dxos/react-client/echo';
|
|
14
14
|
import { Panel } from '@dxos/react-ui';
|
|
15
15
|
import { Menu, MenuBuilder, useMenuBuilder } from '@dxos/react-ui-menu';
|
|
16
16
|
import { type Channel } from '@dxos/types';
|
|
17
17
|
|
|
18
|
-
import {
|
|
18
|
+
import { MessageThread } from '#components';
|
|
19
19
|
import { useMessages, useStatus } from '#hooks';
|
|
20
20
|
import { meta } from '#meta';
|
|
21
21
|
import { ThreadCapabilities, ThreadOperation, resolveProvider } from '#types';
|
|
@@ -118,7 +118,7 @@ export const ChannelArticle = ({ role, subject: channel, attendableId, chatOnly
|
|
|
118
118
|
</Panel.Content>
|
|
119
119
|
) : (
|
|
120
120
|
<Panel.Content asChild>
|
|
121
|
-
<
|
|
121
|
+
<MessageThread
|
|
122
122
|
id={id}
|
|
123
123
|
classNames='dx-document'
|
|
124
124
|
identity={identity ?? undefined}
|
|
@@ -133,3 +133,5 @@ export const ChannelArticle = ({ role, subject: channel, attendableId, chatOnly
|
|
|
133
133
|
</Panel.Root>
|
|
134
134
|
);
|
|
135
135
|
};
|
|
136
|
+
|
|
137
|
+
ChannelArticle.displayName = 'ChannelArticle';
|
|
@@ -7,7 +7,6 @@ import React, { useCallback, useMemo } from 'react';
|
|
|
7
7
|
import { useCapabilities } from '@dxos/app-framework/ui';
|
|
8
8
|
import { Obj } from '@dxos/echo';
|
|
9
9
|
import { type SpaceCapabilities } from '@dxos/plugin-space';
|
|
10
|
-
import { Column } from '@dxos/react-ui';
|
|
11
10
|
import { Form } from '@dxos/react-ui-form';
|
|
12
11
|
|
|
13
12
|
import { ThreadCapabilities, buildChannelFormSchema } from '#types';
|
|
@@ -41,12 +40,14 @@ export const ChannelCreatePanel = ({ target, onCreateObject }: SpaceCapabilities
|
|
|
41
40
|
onSave={handleSave}
|
|
42
41
|
testId='create-channel-form'
|
|
43
42
|
>
|
|
44
|
-
<
|
|
43
|
+
<Form.Viewport>
|
|
45
44
|
<Form.Content>
|
|
46
45
|
<Form.FieldSet />
|
|
47
46
|
<Form.Submit />
|
|
48
47
|
</Form.Content>
|
|
49
|
-
</
|
|
48
|
+
</Form.Viewport>
|
|
50
49
|
</Form.Root>
|
|
51
50
|
);
|
|
52
51
|
};
|
|
52
|
+
|
|
53
|
+
ChannelCreatePanel.displayName = 'ChannelCreatePanel';
|
|
@@ -16,6 +16,7 @@ import { type Space } from '@dxos/react-client/echo';
|
|
|
16
16
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
17
17
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
18
18
|
import { useAsyncEffect } from '@dxos/react-ui';
|
|
19
|
+
import { withMosaic } from '@dxos/react-ui-mosaic/testing';
|
|
19
20
|
import { Thread as ThreadComponent } from '@dxos/react-ui-thread';
|
|
20
21
|
import { Loading, withLayout } from '@dxos/react-ui/testing';
|
|
21
22
|
import { Message, Thread } from '@dxos/types';
|
|
@@ -45,7 +46,7 @@ const DefaultStory = () => {
|
|
|
45
46
|
return <Loading data={{ identity: !!identity, space: !!space, thread: !!thread }} />;
|
|
46
47
|
}
|
|
47
48
|
|
|
48
|
-
return <ThreadArticle
|
|
49
|
+
return <ThreadArticle thread={thread} />;
|
|
49
50
|
};
|
|
50
51
|
|
|
51
52
|
const meta = {
|
|
@@ -53,9 +54,10 @@ const meta = {
|
|
|
53
54
|
component: ThreadComponent.Root as any,
|
|
54
55
|
render: DefaultStory,
|
|
55
56
|
decorators: [
|
|
57
|
+
withMosaic(),
|
|
56
58
|
withLayout({ layout: 'column' }),
|
|
57
59
|
// TODO(wittjosiah): This shouldn't depend on app framework (use withClientProvider instead).
|
|
58
|
-
// Currently this is required because
|
|
60
|
+
// Currently this is required because MessageThread renders an object tile via a Surface.
|
|
59
61
|
withPluginManager({
|
|
60
62
|
plugins: corePlugins(),
|
|
61
63
|
capabilities: [
|