@dxos/react-ui-chat 0.8.4-main.dedc0f3 → 0.8.4-main.ead640a
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 +29 -7
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +29 -7
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/ChatDialog/ChatDialog.stories.d.ts +0 -1
- package/dist/types/src/components/ChatDialog/ChatDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatEditor/ChatEditor.d.ts.map +1 -1
- package/dist/types/src/components/ChatEditor/ChatEditor.stories.d.ts +0 -1
- package/dist/types/src/components/ChatEditor/ChatEditor.stories.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +35 -34
- package/src/components/ChatDialog/ChatDialog.stories.tsx +2 -4
- package/src/components/ChatEditor/ChatEditor.stories.tsx +1 -3
- package/src/components/ChatEditor/ChatEditor.tsx +25 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui-chat",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.ead640a",
|
|
4
4
|
"description": "Chat components.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -24,50 +24,51 @@
|
|
|
24
24
|
"src"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@codemirror/autocomplete": "^6.
|
|
27
|
+
"@codemirror/autocomplete": "^6.19.0",
|
|
28
28
|
"@codemirror/language": "^6.11.3",
|
|
29
29
|
"@codemirror/search": "^6.5.11",
|
|
30
30
|
"@codemirror/state": "^6.5.2",
|
|
31
|
-
"@codemirror/view": "^6.38.
|
|
31
|
+
"@codemirror/view": "^6.38.4",
|
|
32
|
+
"@fluentui/react-tabster": "^9.24.2",
|
|
32
33
|
"@preact-signals/safe-react": "^0.9.0",
|
|
33
|
-
"@preact/signals-core": "^1.
|
|
34
|
+
"@preact/signals-core": "^1.12.1",
|
|
34
35
|
"@radix-ui/react-accordion": "1.2.3",
|
|
35
36
|
"@radix-ui/react-context": "1.1.1",
|
|
36
|
-
"@dxos/async": "0.8.4-main.
|
|
37
|
-
"@dxos/debug": "0.8.4-main.
|
|
38
|
-
"@dxos/echo
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/react-ui-dnd": "0.8.4-main.
|
|
45
|
-
"@dxos/react-ui-
|
|
46
|
-
"@dxos/react-ui-
|
|
47
|
-
"@dxos/react-ui-syntax-highlighter": "0.8.4-main.
|
|
48
|
-
"@dxos/react-ui-text-tooltip": "0.8.4-main.
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/react-ui-types": "0.8.4-main.
|
|
51
|
-
"@dxos/
|
|
37
|
+
"@dxos/async": "0.8.4-main.ead640a",
|
|
38
|
+
"@dxos/debug": "0.8.4-main.ead640a",
|
|
39
|
+
"@dxos/echo": "0.8.4-main.ead640a",
|
|
40
|
+
"@dxos/live-object": "0.8.4-main.ead640a",
|
|
41
|
+
"@dxos/log": "0.8.4-main.ead640a",
|
|
42
|
+
"@dxos/react-ui": "0.8.4-main.ead640a",
|
|
43
|
+
"@dxos/react-ui-components": "0.8.4-main.ead640a",
|
|
44
|
+
"@dxos/invariant": "0.8.4-main.ead640a",
|
|
45
|
+
"@dxos/react-ui-dnd": "0.8.4-main.ead640a",
|
|
46
|
+
"@dxos/react-ui-sfx": "0.8.4-main.ead640a",
|
|
47
|
+
"@dxos/react-ui-editor": "0.8.4-main.ead640a",
|
|
48
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.4-main.ead640a",
|
|
49
|
+
"@dxos/react-ui-text-tooltip": "0.8.4-main.ead640a",
|
|
50
|
+
"@dxos/util": "0.8.4-main.ead640a",
|
|
51
|
+
"@dxos/react-ui-types": "0.8.4-main.ead640a",
|
|
52
|
+
"@dxos/react-ui-theme": "0.8.4-main.ead640a"
|
|
52
53
|
},
|
|
53
54
|
"devDependencies": {
|
|
54
|
-
"@types/react": "~
|
|
55
|
-
"@types/react-dom": "~
|
|
56
|
-
"effect": "3.
|
|
57
|
-
"react": "~
|
|
58
|
-
"react-dom": "~
|
|
59
|
-
"vite": "7.1.
|
|
60
|
-
"@dxos/echo": "0.8.4-main.
|
|
61
|
-
"@dxos/random": "0.8.4-main.
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
55
|
+
"@types/react": "~19.2.2",
|
|
56
|
+
"@types/react-dom": "~19.2.1",
|
|
57
|
+
"effect": "3.18.3",
|
|
58
|
+
"react": "~19.2.0",
|
|
59
|
+
"react-dom": "~19.2.0",
|
|
60
|
+
"vite": "7.1.9",
|
|
61
|
+
"@dxos/echo": "0.8.4-main.ead640a",
|
|
62
|
+
"@dxos/random": "0.8.4-main.ead640a",
|
|
63
|
+
"@dxos/storybook-utils": "0.8.4-main.ead640a",
|
|
64
|
+
"@dxos/react-client": "0.8.4-main.ead640a"
|
|
64
65
|
},
|
|
65
66
|
"peerDependencies": {
|
|
66
67
|
"effect": "^3.13.3",
|
|
67
|
-
"react": "
|
|
68
|
-
"react-dom": "
|
|
69
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
70
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
68
|
+
"react": "^19.0.0",
|
|
69
|
+
"react-dom": "^19.0.0",
|
|
70
|
+
"@dxos/react-ui": "0.8.4-main.ead640a",
|
|
71
|
+
"@dxos/react-ui-theme": "0.8.4-main.ead640a"
|
|
71
72
|
},
|
|
72
73
|
"publishConfig": {
|
|
73
74
|
"access": "public"
|
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React, { useState } from 'react';
|
|
9
7
|
|
|
10
8
|
import { Input, Toolbar } from '@dxos/react-ui';
|
|
11
|
-
import { withLayout, withTheme } from '@dxos/
|
|
9
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
12
10
|
|
|
13
11
|
import { translations } from '../../translations';
|
|
14
12
|
|
|
@@ -53,7 +51,7 @@ const meta = {
|
|
|
53
51
|
</>
|
|
54
52
|
);
|
|
55
53
|
},
|
|
56
|
-
decorators: [withTheme, withLayout({
|
|
54
|
+
decorators: [withTheme, withLayout({ container: 'column' })],
|
|
57
55
|
parameters: {
|
|
58
56
|
translations,
|
|
59
57
|
},
|
|
@@ -2,12 +2,10 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
|
|
9
7
|
import { log } from '@dxos/log';
|
|
10
|
-
import { withTheme } from '@dxos/
|
|
8
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
11
9
|
|
|
12
10
|
import { translations } from '../../translations';
|
|
13
11
|
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type Extension } from '@codemirror/state';
|
|
6
|
+
import { keymap } from '@codemirror/view';
|
|
7
|
+
import { useFocusFinders } from '@fluentui/react-tabster';
|
|
6
8
|
import React, { forwardRef, useImperativeHandle } from 'react';
|
|
7
9
|
|
|
8
10
|
import { type ThemedClassName, useThemeContext } from '@dxos/react-ui';
|
|
@@ -16,7 +18,7 @@ import {
|
|
|
16
18
|
useTextEditor,
|
|
17
19
|
} from '@dxos/react-ui-editor';
|
|
18
20
|
import { mx } from '@dxos/react-ui-theme';
|
|
19
|
-
import {
|
|
21
|
+
import { isTruthy } from '@dxos/util';
|
|
20
22
|
|
|
21
23
|
import { type ReferencesOptions, references as referencesExtension } from './references';
|
|
22
24
|
|
|
@@ -41,22 +43,37 @@ export const ChatEditor = forwardRef<ChatEditorController, ChatEditorProps>(
|
|
|
41
43
|
forwardRef,
|
|
42
44
|
) => {
|
|
43
45
|
const { themeMode } = useThemeContext();
|
|
44
|
-
|
|
46
|
+
const { findNextFocusable, findPrevFocusable } = useFocusFinders();
|
|
45
47
|
const { parentRef, view } = useTextEditor(
|
|
46
48
|
() => ({
|
|
47
49
|
debug: true,
|
|
48
50
|
autoFocus,
|
|
49
51
|
extensions: [
|
|
50
52
|
createThemeExtensions({ themeMode }),
|
|
53
|
+
createBasicExtensions({ bracketMatching: false, lineWrapping, placeholder }),
|
|
51
54
|
autocomplete({ onSubmit, onSuggest, onCancel }),
|
|
52
55
|
references ? referencesExtension({ provider: references.provider }) : [],
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
// TODO(burdon): Standardize.
|
|
57
|
+
keymap.of([
|
|
58
|
+
{
|
|
59
|
+
key: 'Tab',
|
|
60
|
+
preventDefault: true,
|
|
61
|
+
run: (view) => {
|
|
62
|
+
findNextFocusable(view.dom)?.focus();
|
|
63
|
+
return true;
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
key: 'Shift-Tab',
|
|
68
|
+
preventDefault: true,
|
|
69
|
+
run: (view) => {
|
|
70
|
+
findPrevFocusable(view.dom)?.focus();
|
|
71
|
+
return true;
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
]),
|
|
58
75
|
extensions,
|
|
59
|
-
].filter(
|
|
76
|
+
].filter(isTruthy),
|
|
60
77
|
}),
|
|
61
78
|
[themeMode, extensions, onSubmit, onSuggest, onCancel],
|
|
62
79
|
);
|