@dxos/react-ui-chat 0.8.4-main.bc674ce → 0.8.4-main.c351d160a8
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 +16 -13
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +16 -13
- 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.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +26 -26
- package/src/components/ChatDialog/ChatDialog.stories.tsx +3 -3
- package/src/components/ChatDialog/ChatDialog.tsx +23 -13
- package/src/components/ChatEditor/ChatEditor.stories.tsx +2 -2
- package/src/components/ChatEditor/references.ts +1 -1
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.c351d160a8",
|
|
4
4
|
"description": "Chat components.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -36,41 +36,41 @@
|
|
|
36
36
|
"@fluentui/react-tabster": "9.26.11",
|
|
37
37
|
"@radix-ui/react-accordion": "1.2.3",
|
|
38
38
|
"@radix-ui/react-context": "1.1.1",
|
|
39
|
-
"@dxos/async": "0.8.4-main.
|
|
40
|
-
"@dxos/debug": "0.8.4-main.
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
44
|
-
"@dxos/log": "0.8.4-main.
|
|
45
|
-
"@dxos/react-ui-
|
|
46
|
-
"@dxos/react-ui-editor": "0.8.4-main.
|
|
47
|
-
"@dxos/react-ui-
|
|
48
|
-
"@dxos/react-ui-
|
|
49
|
-
"@dxos/react-ui-
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/ui-
|
|
52
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
53
|
-
"@dxos/util": "0.8.4-main.
|
|
54
|
-
"@dxos/ui-types": "0.8.4-main.
|
|
39
|
+
"@dxos/async": "0.8.4-main.c351d160a8",
|
|
40
|
+
"@dxos/debug": "0.8.4-main.c351d160a8",
|
|
41
|
+
"@dxos/echo": "0.8.4-main.c351d160a8",
|
|
42
|
+
"@dxos/invariant": "0.8.4-main.c351d160a8",
|
|
43
|
+
"@dxos/react-ui": "0.8.4-main.c351d160a8",
|
|
44
|
+
"@dxos/log": "0.8.4-main.c351d160a8",
|
|
45
|
+
"@dxos/react-ui-components": "0.8.4-main.c351d160a8",
|
|
46
|
+
"@dxos/react-ui-editor": "0.8.4-main.c351d160a8",
|
|
47
|
+
"@dxos/react-ui-dnd": "0.8.4-main.c351d160a8",
|
|
48
|
+
"@dxos/react-ui-sfx": "0.8.4-main.c351d160a8",
|
|
49
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.4-main.c351d160a8",
|
|
50
|
+
"@dxos/ui-editor": "0.8.4-main.c351d160a8",
|
|
51
|
+
"@dxos/react-ui-text-tooltip": "0.8.4-main.c351d160a8",
|
|
52
|
+
"@dxos/ui-theme": "0.8.4-main.c351d160a8",
|
|
53
|
+
"@dxos/util": "0.8.4-main.c351d160a8",
|
|
54
|
+
"@dxos/ui-types": "0.8.4-main.c351d160a8"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@types/react": "~19.2.7",
|
|
58
58
|
"@types/react-dom": "~19.2.3",
|
|
59
|
-
"effect": "3.19.
|
|
59
|
+
"effect": "3.19.16",
|
|
60
60
|
"react": "~19.2.3",
|
|
61
61
|
"react-dom": "~19.2.3",
|
|
62
|
-
"vite": "7.1.
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/react-client": "0.8.4-main.
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
62
|
+
"vite": "^7.1.11",
|
|
63
|
+
"@dxos/echo": "0.8.4-main.c351d160a8",
|
|
64
|
+
"@dxos/react-client": "0.8.4-main.c351d160a8",
|
|
65
|
+
"@dxos/random": "0.8.4-main.c351d160a8",
|
|
66
|
+
"@dxos/storybook-utils": "0.8.4-main.c351d160a8"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"effect": "3.19.
|
|
69
|
+
"effect": "3.19.16",
|
|
70
70
|
"react": "~19.2.3",
|
|
71
71
|
"react-dom": "~19.2.3",
|
|
72
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
73
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
72
|
+
"@dxos/react-ui": "0.8.4-main.c351d160a8",
|
|
73
|
+
"@dxos/ui-theme": "0.8.4-main.c351d160a8"
|
|
74
74
|
},
|
|
75
75
|
"publishConfig": {
|
|
76
76
|
"access": "public"
|
|
@@ -37,12 +37,12 @@ const meta = {
|
|
|
37
37
|
<ChatDialog.Header title='Chat' />
|
|
38
38
|
<ChatDialog.Content>
|
|
39
39
|
{items.map((item) => (
|
|
40
|
-
<div key={item} className='
|
|
40
|
+
<div key={item} className='ps-4 pb-1'>
|
|
41
41
|
{item}
|
|
42
42
|
</div>
|
|
43
43
|
))}
|
|
44
44
|
</ChatDialog.Content>
|
|
45
|
-
<ChatDialog.Footer classNames='
|
|
45
|
+
<ChatDialog.Footer classNames='px-2 items-center'>
|
|
46
46
|
<Input.Root>
|
|
47
47
|
<Input.TextInput classNames='border-none' placeholder='Test' />
|
|
48
48
|
</Input.Root>
|
|
@@ -51,7 +51,7 @@ const meta = {
|
|
|
51
51
|
</>
|
|
52
52
|
);
|
|
53
53
|
},
|
|
54
|
-
decorators: [withTheme, withLayout({ layout: 'column' })],
|
|
54
|
+
decorators: [withTheme(), withLayout({ layout: 'column' })],
|
|
55
55
|
parameters: {
|
|
56
56
|
translations,
|
|
57
57
|
},
|
|
@@ -14,7 +14,9 @@ const preventDefault = (event: Event) => event.preventDefault();
|
|
|
14
14
|
// TODO(burdon): Factor out.
|
|
15
15
|
const Endcap = ({ children }: PropsWithChildren) => {
|
|
16
16
|
return (
|
|
17
|
-
<div className='grid
|
|
17
|
+
<div className='grid w-[var(--dx-rail-action)] h-[var(--dx-rail-action)] items-center justify-center'>
|
|
18
|
+
{children}
|
|
19
|
+
</div>
|
|
18
20
|
);
|
|
19
21
|
};
|
|
20
22
|
|
|
@@ -71,10 +73,10 @@ const ChatDialogRoot = ({
|
|
|
71
73
|
<Dialog.Root modal={false} open={open} onOpenChange={setOpen}>
|
|
72
74
|
<div role='none' className='dx-dialog__overlay bg-transparent pointer-events-none' data-block-align='end'>
|
|
73
75
|
<Dialog.Content
|
|
76
|
+
size='md'
|
|
74
77
|
inOverlayLayout
|
|
75
78
|
classNames={[
|
|
76
|
-
'grid grid-rows-[var(--rail-action)_1fr_min-content] p-0 overflow-hidden',
|
|
77
|
-
'box-content md:is-[35rem] md:max-is-none pointer-events-auto',
|
|
79
|
+
'grid grid-rows-[var(--dx-rail-action)_1fr_min-content] p-0 overflow-hidden box-content pointer-events-auto',
|
|
78
80
|
]}
|
|
79
81
|
onEscapeKeyDown={onEscape}
|
|
80
82
|
onInteractOutside={preventDefault}
|
|
@@ -93,22 +95,26 @@ ChatDialogRoot.displayName = 'ChatDialog.Root';
|
|
|
93
95
|
// Header
|
|
94
96
|
//
|
|
95
97
|
|
|
98
|
+
const CHAT_DIALOG_HEADER_NAME = 'ChatDialog.Header';
|
|
99
|
+
|
|
96
100
|
type ChatDialogHeaderProps = ThemedClassName<{
|
|
97
101
|
title?: string;
|
|
98
102
|
}>;
|
|
99
103
|
|
|
100
104
|
const ChatDialogHeader = ({ classNames, title }: ChatDialogHeaderProps) => {
|
|
101
|
-
const { expanded, setExpanded } = useChatDialogContext(
|
|
105
|
+
const { expanded, setExpanded } = useChatDialogContext(CHAT_DIALOG_HEADER_NAME);
|
|
102
106
|
|
|
103
107
|
return (
|
|
104
|
-
<div
|
|
108
|
+
<div
|
|
109
|
+
className={mx('grid grid-cols-[var(--dx-rail-action)_1fr_min-content] items-center overflow-hidden', classNames)}
|
|
110
|
+
>
|
|
105
111
|
<Endcap>
|
|
106
112
|
<Dialog.Close>
|
|
107
113
|
<Icon icon='ph--x--regular' />
|
|
108
114
|
</Dialog.Close>
|
|
109
115
|
</Endcap>
|
|
110
116
|
<Dialog.Title
|
|
111
|
-
classNames='flex
|
|
117
|
+
classNames='flex w-full justify-center text-sm text-subdued select-none cursor-pointer'
|
|
112
118
|
onClick={() => setExpanded((expanded) => !expanded)}
|
|
113
119
|
>
|
|
114
120
|
{title}
|
|
@@ -118,7 +124,7 @@ const ChatDialogHeader = ({ classNames, title }: ChatDialogHeaderProps) => {
|
|
|
118
124
|
variant='ghost'
|
|
119
125
|
icon='ph--caret-up--regular'
|
|
120
126
|
iconOnly
|
|
121
|
-
classNames={mx('
|
|
127
|
+
classNames={mx('p-1! [&>svg]:transition [&>svg]:duration-200', expanded && '[&>svg]:rotate-180')}
|
|
122
128
|
label={expanded ? 'Close' : 'Open'}
|
|
123
129
|
onClick={() => setExpanded((expanded) => !expanded)}
|
|
124
130
|
/>
|
|
@@ -127,16 +133,18 @@ const ChatDialogHeader = ({ classNames, title }: ChatDialogHeaderProps) => {
|
|
|
127
133
|
);
|
|
128
134
|
};
|
|
129
135
|
|
|
130
|
-
ChatDialogHeader.displayName =
|
|
136
|
+
ChatDialogHeader.displayName = CHAT_DIALOG_HEADER_NAME;
|
|
131
137
|
|
|
132
138
|
//
|
|
133
139
|
// Content
|
|
134
140
|
//
|
|
135
141
|
|
|
142
|
+
const CHAT_DIALOG_CONTENT_NAME = 'ChatDialog.Content';
|
|
143
|
+
|
|
136
144
|
type ChatDialogContentProps = ThemedClassName<PropsWithChildren>;
|
|
137
145
|
|
|
138
146
|
const ChatDialogContent = ({ children, classNames }: ChatDialogContentProps) => {
|
|
139
|
-
const { expanded, size, setSize } = useChatDialogContext(
|
|
147
|
+
const { expanded, size, setSize } = useChatDialogContext(CHAT_DIALOG_CONTENT_NAME);
|
|
140
148
|
useEffect(() => {
|
|
141
149
|
setSize(expanded ? 'min-content' : 0);
|
|
142
150
|
}, [expanded]);
|
|
@@ -144,8 +152,8 @@ const ChatDialogContent = ({ children, classNames }: ChatDialogContentProps) =>
|
|
|
144
152
|
return (
|
|
145
153
|
<div
|
|
146
154
|
className={mx(
|
|
147
|
-
'
|
|
148
|
-
'transition
|
|
155
|
+
'border-t border-b border-subdued-separator',
|
|
156
|
+
'transition ease-in-out duration-0 [&:not([data-dx-resizing="true"])]:duration-200',
|
|
149
157
|
classNames,
|
|
150
158
|
)}
|
|
151
159
|
style={{
|
|
@@ -167,19 +175,21 @@ const ChatDialogContent = ({ children, classNames }: ChatDialogContentProps) =>
|
|
|
167
175
|
);
|
|
168
176
|
};
|
|
169
177
|
|
|
170
|
-
ChatDialogContent.displayName =
|
|
178
|
+
ChatDialogContent.displayName = CHAT_DIALOG_CONTENT_NAME;
|
|
171
179
|
|
|
172
180
|
//
|
|
173
181
|
// Footer
|
|
174
182
|
//
|
|
175
183
|
|
|
184
|
+
const CHAT_DIALOG_FOOTER_NAME = 'ChatDialog.Footer';
|
|
185
|
+
|
|
176
186
|
type ChatDialogFooterProps = ThemedClassName<PropsWithChildren>;
|
|
177
187
|
|
|
178
188
|
const ChatDialogFooter = ({ children, classNames }: ChatDialogFooterProps) => {
|
|
179
189
|
return <div className={mx(classNames)}>{children}</div>;
|
|
180
190
|
};
|
|
181
191
|
|
|
182
|
-
ChatDialogFooter.displayName =
|
|
192
|
+
ChatDialogFooter.displayName = CHAT_DIALOG_FOOTER_NAME;
|
|
183
193
|
|
|
184
194
|
//
|
|
185
195
|
// 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,
|
|
@@ -24,7 +24,7 @@ const meta = {
|
|
|
24
24
|
|
|
25
25
|
export default meta;
|
|
26
26
|
|
|
27
|
-
const classNames = '
|
|
27
|
+
const classNames = 'w-[20rem] p-2 border border-separator';
|
|
28
28
|
|
|
29
29
|
type Story = StoryObj<typeof meta>;
|
|
30
30
|
|
|
@@ -130,7 +130,7 @@ export const references = ({ provider, triggerCharacter = '@', debug = false }:
|
|
|
130
130
|
}),
|
|
131
131
|
|
|
132
132
|
autocompletion({
|
|
133
|
-
tooltipClass: () => 'shadow rounded',
|
|
133
|
+
tooltipClass: () => 'shadow rounded-sm',
|
|
134
134
|
activateOnTyping: true,
|
|
135
135
|
aboveCursor: true,
|
|
136
136
|
closeOnBlur: !debug,
|