@dxos/react-ui-thread 0.8.4-main.406dc2a → 0.8.4-main.548089c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/index.mjs +2 -2
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/types/src/Thread/Comments.stories.d.ts.map +1 -1
- package/dist/types/src/Thread/Thread.d.ts +1 -1
- package/dist/types/src/Thread/Thread.d.ts.map +1 -1
- package/dist/types/src/testing.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +15 -15
- package/src/Message/Message.tsx +1 -1
- package/src/Thread/Comments.stories.tsx +17 -10
- package/src/Thread/Thread.tsx +2 -2
- package/src/testing.tsx +6 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui-thread",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.548089c",
|
|
4
4
|
"description": "A set of components to use with threads, including comments and messages.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -27,30 +27,30 @@
|
|
|
27
27
|
"@preact-signals/safe-react": "^0.9.0",
|
|
28
28
|
"@radix-ui/react-primitive": "2.0.2",
|
|
29
29
|
"date-fns": "^3.3.1",
|
|
30
|
-
"@dxos/react-ui-editor": "0.8.4-main.
|
|
31
|
-
"@dxos/util": "0.8.4-main.
|
|
30
|
+
"@dxos/react-ui-editor": "0.8.4-main.548089c",
|
|
31
|
+
"@dxos/util": "0.8.4-main.548089c"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/react": "~19.2.2",
|
|
35
|
-
"@types/react-dom": "~19.2.
|
|
35
|
+
"@types/react-dom": "~19.2.2",
|
|
36
36
|
"react": "~19.2.0",
|
|
37
37
|
"react-dom": "~19.2.0",
|
|
38
38
|
"vite": "7.1.9",
|
|
39
|
-
"@dxos/echo": "0.8.4-main.
|
|
40
|
-
"@dxos/echo-db": "0.8.4-main.
|
|
41
|
-
"@dxos/live-object": "0.8.4-main.
|
|
42
|
-
"@dxos/keys": "0.8.4-main.
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
39
|
+
"@dxos/echo": "0.8.4-main.548089c",
|
|
40
|
+
"@dxos/echo-db": "0.8.4-main.548089c",
|
|
41
|
+
"@dxos/live-object": "0.8.4-main.548089c",
|
|
42
|
+
"@dxos/keys": "0.8.4-main.548089c",
|
|
43
|
+
"@dxos/react-ui": "0.8.4-main.548089c",
|
|
44
|
+
"@dxos/react-ui-theme": "0.8.4-main.548089c",
|
|
45
|
+
"@dxos/storybook-utils": "0.8.4-main.548089c",
|
|
46
|
+
"@dxos/log": "0.8.4-main.548089c",
|
|
47
|
+
"@dxos/random": "0.8.4-main.548089c"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"react": "^19.0.0",
|
|
51
51
|
"react-dom": "^19.0.0",
|
|
52
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
53
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
52
|
+
"@dxos/react-ui": "0.8.4-main.548089c",
|
|
53
|
+
"@dxos/react-ui-theme": "0.8.4-main.548089c"
|
|
54
54
|
},
|
|
55
55
|
"publishConfig": {
|
|
56
56
|
"access": "public"
|
package/src/Message/Message.tsx
CHANGED
|
@@ -11,7 +11,7 @@ import { createDocAccessor, createObject } from '@dxos/echo-db';
|
|
|
11
11
|
import { PublicKey } from '@dxos/keys';
|
|
12
12
|
import { log } from '@dxos/log';
|
|
13
13
|
import { faker } from '@dxos/random';
|
|
14
|
-
import {
|
|
14
|
+
import { Icon, IconButton, useThemeContext } from '@dxos/react-ui';
|
|
15
15
|
import { withTheme } from '@dxos/react-ui/testing';
|
|
16
16
|
import {
|
|
17
17
|
type Comment,
|
|
@@ -114,19 +114,21 @@ const StoryThread: FC<{
|
|
|
114
114
|
onSelect: () => void;
|
|
115
115
|
onResolve: () => void;
|
|
116
116
|
}> = ({ thread, selected, onSelect, onResolve }) => {
|
|
117
|
-
const containerRef = useRef<HTMLDivElement>(null);
|
|
118
117
|
const { themeMode } = useThemeContext();
|
|
118
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
119
|
+
|
|
119
120
|
// TODO(wittjosiah): This is a hack to reset the editor after a message is sent.
|
|
120
|
-
const [
|
|
121
|
-
const rerenderEditor = () => _setCount((count) => count + 1);
|
|
121
|
+
const [state, setState] = useState({});
|
|
122
122
|
const messageRef = useRef('');
|
|
123
123
|
const extensions = useMemo(
|
|
124
124
|
() => [
|
|
125
125
|
createBasicExtensions({ placeholder: 'Enter comment' }),
|
|
126
126
|
createThemeExtensions({ themeMode }),
|
|
127
|
-
listener({
|
|
127
|
+
listener({
|
|
128
|
+
onChange: ({ text }) => (messageRef.current = text),
|
|
129
|
+
}),
|
|
128
130
|
],
|
|
129
|
-
[themeMode,
|
|
131
|
+
[themeMode, state],
|
|
130
132
|
);
|
|
131
133
|
|
|
132
134
|
const [autoFocus, setAutoFocus] = useState(false);
|
|
@@ -151,7 +153,7 @@ const StoryThread: FC<{
|
|
|
151
153
|
|
|
152
154
|
messageRef.current = '';
|
|
153
155
|
setAutoFocus(true);
|
|
154
|
-
|
|
156
|
+
setState({});
|
|
155
157
|
}
|
|
156
158
|
};
|
|
157
159
|
|
|
@@ -185,9 +187,14 @@ const StoryThread: FC<{
|
|
|
185
187
|
onSend={handleCreateMessage}
|
|
186
188
|
/>
|
|
187
189
|
<Thread.Status />
|
|
188
|
-
<
|
|
189
|
-
|
|
190
|
-
|
|
190
|
+
<IconButton
|
|
191
|
+
variant='ghost'
|
|
192
|
+
icon='ph--check--regular'
|
|
193
|
+
iconOnly
|
|
194
|
+
classNames='pli-1'
|
|
195
|
+
label='Resolve'
|
|
196
|
+
onClick={onResolve}
|
|
197
|
+
/>
|
|
191
198
|
</div>
|
|
192
199
|
</Thread.Root>
|
|
193
200
|
);
|
package/src/Thread/Thread.tsx
CHANGED
|
@@ -45,10 +45,10 @@ const ThreadRoot = forwardRef<HTMLDivElement, ThreadRootProps>(
|
|
|
45
45
|
// Heading
|
|
46
46
|
//
|
|
47
47
|
|
|
48
|
-
type ThreadHeaderProps =
|
|
48
|
+
type ThreadHeaderProps = ComponentPropsWithRef<'div'> & { detached?: boolean };
|
|
49
49
|
|
|
50
50
|
const ThreadHeader = forwardRef<HTMLParagraphElement, ThreadHeaderProps>(
|
|
51
|
-
({
|
|
51
|
+
({ children, detached, ...props }, forwardedRef) => {
|
|
52
52
|
return (
|
|
53
53
|
<>
|
|
54
54
|
<div role='none' className='flex items-center justify-center text-description'>
|
package/src/testing.tsx
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { IconButton } from '@dxos/react-ui';
|
|
8
8
|
import { hoverableControlItem, hoverableControls, hoverableFocusedWithinControls, mx } from '@dxos/react-ui-theme';
|
|
9
9
|
|
|
10
10
|
import { MessageBody, MessageHeading } from './Message';
|
|
@@ -25,13 +25,14 @@ export const MessageStoryText = ({ text, onDelete, authorName, timestamp }: Mess
|
|
|
25
25
|
<>
|
|
26
26
|
<MessageHeading authorName={authorName} timestamp={timestamp}>
|
|
27
27
|
{onDelete && (
|
|
28
|
-
<
|
|
28
|
+
<IconButton
|
|
29
|
+
icon='ph--x--regular'
|
|
30
|
+
iconOnly
|
|
31
|
+
label='Delete'
|
|
29
32
|
variant='ghost'
|
|
30
33
|
classNames={['p-1.5 min-bs-0 mie-1 items-start transition-opacity', hoverableControlItem]}
|
|
31
34
|
onClick={() => onDelete()}
|
|
32
|
-
|
|
33
|
-
<Icon icon='ph--x--regular' />
|
|
34
|
-
</Button>
|
|
35
|
+
/>
|
|
35
36
|
)}
|
|
36
37
|
</MessageHeading>
|
|
37
38
|
<MessageBody>{text}</MessageBody>
|