@dxos/react-ui-chat 0.8.4-main.3c1ae3b → 0.8.4-main.3eb6e50203

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,9 +1,13 @@
1
1
  {
2
2
  "name": "@dxos/react-ui-chat",
3
- "version": "0.8.4-main.3c1ae3b",
3
+ "version": "0.8.4-main.3eb6e50203",
4
4
  "description": "Chat components.",
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
  "type": "module",
@@ -29,46 +33,44 @@
29
33
  "@codemirror/search": "^6.5.11",
30
34
  "@codemirror/state": "^6.5.2",
31
35
  "@codemirror/view": "^6.38.4",
32
- "@fluentui/react-tabster": "^9.24.2",
33
- "@preact-signals/safe-react": "^0.9.0",
34
- "@preact/signals-core": "^1.12.1",
36
+ "@fluentui/react-tabster": "9.26.11",
35
37
  "@radix-ui/react-accordion": "1.2.3",
36
38
  "@radix-ui/react-context": "1.1.1",
37
- "@dxos/debug": "0.8.4-main.3c1ae3b",
38
- "@dxos/async": "0.8.4-main.3c1ae3b",
39
- "@dxos/echo": "0.8.4-main.3c1ae3b",
40
- "@dxos/log": "0.8.4-main.3c1ae3b",
41
- "@dxos/invariant": "0.8.4-main.3c1ae3b",
42
- "@dxos/live-object": "0.8.4-main.3c1ae3b",
43
- "@dxos/react-ui-components": "0.8.4-main.3c1ae3b",
44
- "@dxos/react-ui": "0.8.4-main.3c1ae3b",
45
- "@dxos/react-ui-dnd": "0.8.4-main.3c1ae3b",
46
- "@dxos/react-ui-sfx": "0.8.4-main.3c1ae3b",
47
- "@dxos/react-ui-editor": "0.8.4-main.3c1ae3b",
48
- "@dxos/react-ui-syntax-highlighter": "0.8.4-main.3c1ae3b",
49
- "@dxos/react-ui-theme": "0.8.4-main.3c1ae3b",
50
- "@dxos/react-ui-types": "0.8.4-main.3c1ae3b",
51
- "@dxos/react-ui-text-tooltip": "0.8.4-main.3c1ae3b",
52
- "@dxos/util": "0.8.4-main.3c1ae3b"
39
+ "@dxos/async": "0.8.4-main.3eb6e50203",
40
+ "@dxos/debug": "0.8.4-main.3eb6e50203",
41
+ "@dxos/echo": "0.8.4-main.3eb6e50203",
42
+ "@dxos/log": "0.8.4-main.3eb6e50203",
43
+ "@dxos/react-ui": "0.8.4-main.3eb6e50203",
44
+ "@dxos/invariant": "0.8.4-main.3eb6e50203",
45
+ "@dxos/react-ui-components": "0.8.4-main.3eb6e50203",
46
+ "@dxos/react-ui-dnd": "0.8.4-main.3eb6e50203",
47
+ "@dxos/react-ui-editor": "0.8.4-main.3eb6e50203",
48
+ "@dxos/react-ui-sfx": "0.8.4-main.3eb6e50203",
49
+ "@dxos/react-ui-syntax-highlighter": "0.8.4-main.3eb6e50203",
50
+ "@dxos/react-ui-text-tooltip": "0.8.4-main.3eb6e50203",
51
+ "@dxos/ui-editor": "0.8.4-main.3eb6e50203",
52
+ "@dxos/ui-types": "0.8.4-main.3eb6e50203",
53
+ "@dxos/util": "0.8.4-main.3eb6e50203",
54
+ "@dxos/ui-theme": "0.8.4-main.3eb6e50203"
53
55
  },
54
56
  "devDependencies": {
55
- "@types/react": "~19.2.2",
56
- "@types/react-dom": "~19.2.2",
57
- "effect": "3.18.3",
58
- "react": "~19.2.0",
59
- "react-dom": "~19.2.0",
57
+ "@types/react": "~19.2.7",
58
+ "@types/react-dom": "~19.2.3",
59
+ "effect": "3.19.16",
60
+ "react": "~19.2.3",
61
+ "react-dom": "~19.2.3",
60
62
  "vite": "7.1.9",
61
- "@dxos/echo": "0.8.4-main.3c1ae3b",
62
- "@dxos/random": "0.8.4-main.3c1ae3b",
63
- "@dxos/react-client": "0.8.4-main.3c1ae3b",
64
- "@dxos/storybook-utils": "0.8.4-main.3c1ae3b"
63
+ "@dxos/random": "0.8.4-main.3eb6e50203",
64
+ "@dxos/echo": "0.8.4-main.3eb6e50203",
65
+ "@dxos/react-client": "0.8.4-main.3eb6e50203",
66
+ "@dxos/storybook-utils": "0.8.4-main.3eb6e50203"
65
67
  },
66
68
  "peerDependencies": {
67
- "effect": "^3.13.3",
68
- "react": "^19.0.0",
69
- "react-dom": "^19.0.0",
70
- "@dxos/react-ui": "0.8.4-main.3c1ae3b",
71
- "@dxos/react-ui-theme": "0.8.4-main.3c1ae3b"
69
+ "effect": "3.19.16",
70
+ "react": "~19.2.3",
71
+ "react-dom": "~19.2.3",
72
+ "@dxos/react-ui": "0.8.4-main.3eb6e50203",
73
+ "@dxos/ui-theme": "0.8.4-main.3eb6e50203"
72
74
  },
73
75
  "publishConfig": {
74
76
  "access": "public"
@@ -51,7 +51,7 @@ const meta = {
51
51
  </>
52
52
  );
53
53
  },
54
- decorators: [withTheme, withLayout({ container: 'column' })],
54
+ decorators: [withTheme(), withLayout({ layout: 'column' })],
55
55
  parameters: {
56
56
  translations,
57
57
  },
@@ -7,7 +7,7 @@ import React, { type Dispatch, type PropsWithChildren, type SetStateAction, useE
7
7
 
8
8
  import { Dialog, Icon, IconButton, type ThemedClassName, useControlledState } from '@dxos/react-ui';
9
9
  import { ResizeHandle, type Size, resizeAttributes, sizeStyle } from '@dxos/react-ui-dnd';
10
- import { mx } from '@dxos/react-ui-theme';
10
+ import { mx } from '@dxos/ui-theme';
11
11
 
12
12
  const preventDefault = (event: Event) => event.preventDefault();
13
13
 
@@ -47,15 +47,15 @@ type ChatDialogRootProps = PropsWithChildren<{
47
47
 
48
48
  const ChatDialogRoot = ({
49
49
  children,
50
- open: openParam = false,
51
- expanded: expandedParam = false,
50
+ open: openProp = false,
51
+ expanded: expandedProp = false,
52
52
  onOpenChange,
53
53
  onExpandedChange,
54
54
  onEscape,
55
55
  }: ChatDialogRootProps) => {
56
56
  const [size, setSize] = useState<Size>('min-content');
57
- const [open, setOpen] = useControlledState<boolean>(openParam, onOpenChange);
58
- const [expanded, setExpanded] = useControlledState<boolean>(expandedParam, onExpandedChange);
57
+ const [open, setOpen] = useControlledState<boolean>(openProp, onOpenChange);
58
+ const [expanded, setExpanded] = useControlledState<boolean>(expandedProp, onExpandedChange);
59
59
 
60
60
  // NOTE: We set the min size to 5rem (80px), and the header and prompt bar to 40px (i.e., the rail-size) each.
61
61
  // The dialog has no vertical padding and has box-content so that when closed it collapses to the size of the header and prompt bar.
@@ -93,12 +93,14 @@ ChatDialogRoot.displayName = 'ChatDialog.Root';
93
93
  // Header
94
94
  //
95
95
 
96
+ const CHAT_DIALOG_HEADER_NAME = 'ChatDialog.Header';
97
+
96
98
  type ChatDialogHeaderProps = ThemedClassName<{
97
99
  title?: string;
98
100
  }>;
99
101
 
100
102
  const ChatDialogHeader = ({ classNames, title }: ChatDialogHeaderProps) => {
101
- const { expanded, setExpanded } = useChatDialogContext(ChatDialogHeader.displayName);
103
+ const { expanded, setExpanded } = useChatDialogContext(CHAT_DIALOG_HEADER_NAME);
102
104
 
103
105
  return (
104
106
  <div className={mx('grid grid-cols-[var(--rail-action)_1fr_min-content] items-center overflow-hidden', classNames)}>
@@ -127,16 +129,18 @@ const ChatDialogHeader = ({ classNames, title }: ChatDialogHeaderProps) => {
127
129
  );
128
130
  };
129
131
 
130
- ChatDialogHeader.displayName = 'ChatDialog.Header';
132
+ ChatDialogHeader.displayName = CHAT_DIALOG_HEADER_NAME;
131
133
 
132
134
  //
133
135
  // Content
134
136
  //
135
137
 
138
+ const CHAT_DIALOG_CONTENT_NAME = 'ChatDialog.Content';
139
+
136
140
  type ChatDialogContentProps = ThemedClassName<PropsWithChildren>;
137
141
 
138
142
  const ChatDialogContent = ({ children, classNames }: ChatDialogContentProps) => {
139
- const { expanded, size, setSize } = useChatDialogContext(ChatDialogContent.displayName);
143
+ const { expanded, size, setSize } = useChatDialogContext(CHAT_DIALOG_CONTENT_NAME);
140
144
  useEffect(() => {
141
145
  setSize(expanded ? 'min-content' : 0);
142
146
  }, [expanded]);
@@ -144,7 +148,7 @@ const ChatDialogContent = ({ children, classNames }: ChatDialogContentProps) =>
144
148
  return (
145
149
  <div
146
150
  className={mx(
147
- 'flex flex-col overflow-y-auto border-t border-be border-subduedSeparator',
151
+ 'border-bs border-be border-subduedSeparator',
148
152
  'transition-[block-size] ease-in-out duration-0 [&:not([data-dx-resizing="true"])]:duration-200',
149
153
  classNames,
150
154
  )}
@@ -167,19 +171,21 @@ const ChatDialogContent = ({ children, classNames }: ChatDialogContentProps) =>
167
171
  );
168
172
  };
169
173
 
170
- ChatDialogContent.displayName = 'ChatDialog.Content';
174
+ ChatDialogContent.displayName = CHAT_DIALOG_CONTENT_NAME;
171
175
 
172
176
  //
173
177
  // Footer
174
178
  //
175
179
 
180
+ const CHAT_DIALOG_FOOTER_NAME = 'ChatDialog.Footer';
181
+
176
182
  type ChatDialogFooterProps = ThemedClassName<PropsWithChildren>;
177
183
 
178
184
  const ChatDialogFooter = ({ children, classNames }: ChatDialogFooterProps) => {
179
185
  return <div className={mx(classNames)}>{children}</div>;
180
186
  };
181
187
 
182
- ChatDialogFooter.displayName = 'ChatDialog.Footer';
188
+ ChatDialogFooter.displayName = CHAT_DIALOG_FOOTER_NAME;
183
189
 
184
190
  //
185
191
  // ChatDialog
@@ -15,7 +15,7 @@ import { type ReferenceData } from './references';
15
15
  const meta = {
16
16
  title: 'ui/react-ui-chat/ChatEditor',
17
17
  component: ChatEditor,
18
- decorators: [withTheme],
18
+ decorators: [withTheme()],
19
19
  parameters: {
20
20
  layout: 'centered',
21
21
  translations,
@@ -6,16 +6,14 @@ import { type Extension } from '@codemirror/state';
6
6
  import React, { forwardRef, useMemo } from 'react';
7
7
 
8
8
  import { type ThemedClassName, useThemeContext } from '@dxos/react-ui';
9
+ import { Editor, type EditorController, type UseTextEditorProps } from '@dxos/react-ui-editor';
9
10
  import {
10
11
  type BasicExtensionsOptions,
11
- Editor,
12
- type EditorController,
13
12
  type SubmitOptions,
14
- type UseTextEditorProps,
15
13
  createBasicExtensions,
16
14
  createThemeExtensions,
17
15
  submit,
18
- } from '@dxos/react-ui-editor';
16
+ } from '@dxos/ui-editor';
19
17
  import { isTruthy } from '@dxos/util';
20
18
 
21
19
  import { type ReferencesOptions } from './references';
@@ -46,8 +44,8 @@ export const useChatExtensions = ({ extensions, lineWrapping = false, placeholde
46
44
  };
47
45
 
48
46
  export const ChatEditor = forwardRef<ChatEditorController, ChatEditorProps>(
49
- ({ classNames, autoFocus, extensions: extensionsParam, lineWrapping = false, placeholder, onSubmit }, forwardRef) => {
50
- const extensions = useChatExtensions({ extensions: extensionsParam, lineWrapping, placeholder, onSubmit });
47
+ ({ classNames, autoFocus, extensions: extensionsProp, lineWrapping = false, placeholder, onSubmit }, forwardRef) => {
48
+ const extensions = useChatExtensions({ extensions: extensionsProp, lineWrapping, placeholder, onSubmit });
51
49
 
52
50
  // TODO(burdon): Popover.
53
51
  return (
@@ -4,7 +4,7 @@
4
4
 
5
5
  import { type Resource } from '@dxos/react-ui';
6
6
 
7
- export const translationKey = 'react-ui-chat';
7
+ export const translationKey = '@dxos/react-ui-chat';
8
8
 
9
9
  export const translations = [
10
10
  {