@dxos/react-ui-thread 0.8.4-main.a4bbb77 → 0.8.4-main.ae835ea

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/react-ui-thread",
3
- "version": "0.8.4-main.a4bbb77",
3
+ "version": "0.8.4-main.ae835ea",
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/util": "0.8.4-main.a4bbb77",
31
- "@dxos/react-ui-editor": "0.8.4-main.a4bbb77"
30
+ "@dxos/react-ui-editor": "0.8.4-main.ae835ea",
31
+ "@dxos/util": "0.8.4-main.ae835ea"
32
32
  },
33
33
  "devDependencies": {
34
- "@types/react": "~19.2.0",
35
- "@types/react-dom": "~19.2.0",
34
+ "@types/react": "~19.2.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-schema": "0.8.4-main.a4bbb77",
40
- "@dxos/live-object": "0.8.4-main.a4bbb77",
41
- "@dxos/echo-db": "0.8.4-main.a4bbb77",
42
- "@dxos/log": "0.8.4-main.a4bbb77",
43
- "@dxos/keys": "0.8.4-main.a4bbb77",
44
- "@dxos/react-ui-theme": "0.8.4-main.a4bbb77",
45
- "@dxos/react-ui": "0.8.4-main.a4bbb77",
46
- "@dxos/random": "0.8.4-main.a4bbb77",
47
- "@dxos/storybook-utils": "0.8.4-main.a4bbb77"
39
+ "@dxos/echo": "0.8.4-main.ae835ea",
40
+ "@dxos/echo-db": "0.8.4-main.ae835ea",
41
+ "@dxos/keys": "0.8.4-main.ae835ea",
42
+ "@dxos/random": "0.8.4-main.ae835ea",
43
+ "@dxos/log": "0.8.4-main.ae835ea",
44
+ "@dxos/react-ui-theme": "0.8.4-main.ae835ea",
45
+ "@dxos/storybook-utils": "0.8.4-main.ae835ea",
46
+ "@dxos/react-ui": "0.8.4-main.ae835ea",
47
+ "@dxos/live-object": "0.8.4-main.ae835ea"
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.a4bbb77",
53
- "@dxos/react-ui-theme": "0.8.4-main.a4bbb77"
52
+ "@dxos/react-ui": "0.8.4-main.ae835ea",
53
+ "@dxos/react-ui-theme": "0.8.4-main.ae835ea"
54
54
  },
55
55
  "publishConfig": {
56
56
  "access": "public"
@@ -149,7 +149,7 @@ export const MessageTextbox = ({
149
149
  extensions: [
150
150
  keymap.of(keyBindings({ onSend, onClear })),
151
151
  listener({
152
- onFocus: (focusing) => {
152
+ onFocus: ({ focusing }) => {
153
153
  if (focusing) {
154
154
  onEditorFocus?.();
155
155
  }
@@ -5,10 +5,10 @@
5
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
6
6
  import React, { type FC, useEffect, useMemo, useRef, useState } from 'react';
7
7
 
8
+ import { Expando } from '@dxos/echo/internal';
9
+ import { live } from '@dxos/echo/internal';
8
10
  import { createDocAccessor, createObject } from '@dxos/echo-db';
9
- import { Expando } from '@dxos/echo-schema';
10
11
  import { PublicKey } from '@dxos/keys';
11
- import { live } from '@dxos/live-object';
12
12
  import { log } from '@dxos/log';
13
13
  import { faker } from '@dxos/random';
14
14
  import { Button, Icon, useThemeContext } from '@dxos/react-ui';
@@ -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 [_count, _setCount] = useState(0);
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({ onChange: (text) => (messageRef.current = text) }),
127
+ listener({
128
+ onChange: ({ text }) => (messageRef.current = text),
129
+ }),
128
130
  ],
129
- [themeMode, _count],
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
- rerenderEditor();
156
+ setState({});
155
157
  }
156
158
  };
157
159