@homecode/ui 5.10.0 → 5.12.0

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.
Files changed (28) hide show
  1. package/dist/esm/index.js +1 -0
  2. package/dist/esm/src/components/Autocomplete/Autocomplete.js +1 -1
  3. package/dist/esm/src/components/Chat/ChatFormattedText.js +4 -319
  4. package/dist/esm/src/components/Expand/Expand.styl.js +1 -1
  5. package/dist/esm/src/components/FormattedText/FormattedText.js +334 -0
  6. package/dist/esm/src/components/FormattedText/FormattedText.styl.js +7 -0
  7. package/dist/esm/src/components/Input/Input.js +73 -2
  8. package/dist/esm/src/components/InputFile/InputFile.js +1 -1
  9. package/dist/esm/src/components/Menu/Menu.styl.js +1 -1
  10. package/dist/esm/src/components/NestedMenu/NestedMenu.styl.js +1 -1
  11. package/dist/esm/src/components/PromptComposer/PromptComposer.styl.js +2 -2
  12. package/dist/esm/src/components/Select/Select2.js +1 -1
  13. package/dist/esm/src/components/TextWithDeferTooltip/TextWithDeferTooltip.js +34 -3
  14. package/dist/esm/src/components/Tooltip/TooltipSimple.js +4 -4
  15. package/dist/esm/src/tiptap/slash-mention/SlashSuggestionList.styl.js +1 -1
  16. package/dist/esm/types/src/components/Chat/Chat.types.d.ts +2 -8
  17. package/dist/esm/types/src/components/Chat/ChatFormattedText.d.ts +1 -2
  18. package/dist/esm/types/src/components/FormattedText/FormattedText.d.ts +3 -0
  19. package/dist/esm/types/src/components/FormattedText/FormattedText.test.d.ts +1 -0
  20. package/dist/esm/types/src/components/FormattedText/FormattedText.types.d.ts +8 -0
  21. package/dist/esm/types/src/components/FormattedText/index.d.ts +2 -0
  22. package/dist/esm/types/src/components/Input/Input.d.ts +1 -0
  23. package/dist/esm/types/src/components/Input/Input.test.d.ts +1 -0
  24. package/dist/esm/types/src/components/Input/Input.types.d.ts +2 -0
  25. package/dist/esm/types/src/components/Select/Select.d.ts +1 -0
  26. package/dist/esm/types/src/components/index.d.ts +1 -0
  27. package/package.json +1 -1
  28. package/dist/esm/src/components/Chat/ChatFormattedText.styl.js +0 -7
package/dist/esm/index.js CHANGED
@@ -21,6 +21,7 @@ export { DropZone } from './src/components/DropZone/DropZone.js';
21
21
  export { Expand } from './src/components/Expand/Expand.js';
22
22
  export { Flex } from './src/components/Flex/Flex.js';
23
23
  export { Form } from './src/components/Form/Form.js';
24
+ export { FormattedText } from './src/components/FormattedText/FormattedText.js';
24
25
  export { Gap } from './src/components/Gap/Gap.js';
25
26
  export { Gallery, normalizeGalleryItem } from './src/components/Gallery/Gallery.js';
26
27
  export { GridLayout } from './src/components/GridLayout/GridLayout.js';
@@ -32,7 +32,7 @@ import '../Router/Link/Link.styl.js';
32
32
  import '../Portal/Portal.js';
33
33
  import '../Paranja/Paranja.styl.js';
34
34
  import '../Table/Table.styl.js';
35
- import '../Chat/ChatFormattedText.styl.js';
35
+ import '../FormattedText/FormattedText.styl.js';
36
36
  import '../Expand/Expand.styl.js';
37
37
  import '../Chat/ChatMessage.styl.js';
38
38
  import '../PromptComposer/PromptComposer.js';
@@ -1,323 +1,8 @@
1
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import React__default from 'react';
3
- import { Button } from '../Button/Button.js';
4
- import { Link } from '../Router/Link/Link.js';
5
- import { Table } from '../Table/Table.js';
6
- import { Tooltip } from '../Tooltip/Tooltip.js';
7
- import S from './ChatFormattedText.styl.js';
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { FormattedText } from '../FormattedText/FormattedText.js';
8
3
 
9
- function findJsonEndExclusive(content, start) {
10
- const first = content[start];
11
- if (first !== '{' && first !== '[')
12
- return -1;
13
- const stack = first === '{' ? ['}'] : [']'];
14
- let i = start + 1;
15
- let inString = false;
16
- let escape = false;
17
- while (i < content.length && stack.length > 0) {
18
- const c = content[i];
19
- if (inString) {
20
- if (escape)
21
- escape = false;
22
- else if (c === '\\')
23
- escape = true;
24
- else if (c === '"')
25
- inString = false;
26
- i++;
27
- continue;
28
- }
29
- if (c === '"') {
30
- inString = true;
31
- i++;
32
- continue;
33
- }
34
- if (c === '{') {
35
- stack.push('}');
36
- i++;
37
- continue;
38
- }
39
- if (c === '[') {
40
- stack.push(']');
41
- i++;
42
- continue;
43
- }
44
- if (c === '}' || c === ']') {
45
- if (c !== stack[stack.length - 1])
46
- return -1;
47
- stack.pop();
48
- i++;
49
- continue;
50
- }
51
- i++;
52
- }
53
- return stack.length > 0 ? -1 : i;
54
- }
55
- function applyInjectors(text, injectors) {
56
- let result = [text];
57
- injectors.forEach(fn => {
58
- let i = 0;
59
- while (i < result.length) {
60
- const item = result[i];
61
- if (typeof item === 'string') {
62
- const res = fn(item);
63
- if (!res) {
64
- i++;
65
- continue;
66
- }
67
- const { elem, index, length } = res;
68
- if (index >= 0) {
69
- const before = item.substring(0, index);
70
- const after = item.substring(index + length);
71
- result.splice(i, 1, before, elem, after);
72
- if (after.length > 0)
73
- continue;
74
- }
75
- }
76
- i++;
77
- }
78
- });
79
- return result;
80
- }
81
- function ChatFormattedText({ text, className, onButtonClick, }) {
82
- const injectLines = (content) => {
83
- const matches = content.match(/\n---\n/);
84
- if (!matches)
85
- return null;
86
- return {
87
- elem: jsx("div", { className: S.line }),
88
- index: matches.index,
89
- length: matches[0].length,
90
- };
91
- };
92
- const injectBullet = (content) => {
93
- const matches = content.match(/(\n|^)([ \t]*)(-|\*|\+)\s/);
94
- if (!matches)
95
- return null;
96
- return {
97
- elem: (jsxs(Fragment, { children: [matches[1] === '\n' && jsx("br", {}), jsx("div", { className: S.bullet })] })),
98
- index: matches.index,
99
- length: matches[0].length,
100
- };
101
- };
102
- const injectNumbered = (content) => {
103
- const matches = content.match(/(\n|^)([ \t]*)(\d+)\.\s+/);
104
- if (!matches)
105
- return null;
106
- return {
107
- elem: (jsxs(Fragment, { children: [matches[1] === '\n' && jsx("br", {}), jsxs("span", { className: S.numberedIndex, children: [matches[3], "."] })] })),
108
- index: matches.index,
109
- length: matches[0].length,
110
- };
111
- };
112
- const injectBold = (content) => {
113
- const matches = content.match(/\*\*(.*?)\*\*/);
114
- if (!matches)
115
- return null;
116
- return {
117
- elem: jsx("strong", { children: matches[1] }),
118
- index: matches.index,
119
- length: matches[0].length,
120
- };
121
- };
122
- const injectItalic = (content) => {
123
- const matches = content.match(/\*(.*?)\*/);
124
- if (!matches)
125
- return null;
126
- return {
127
- elem: jsx("em", { children: matches[1] }),
128
- index: matches.index,
129
- length: matches[0].length,
130
- };
131
- };
132
- const injectCodeBlock = (content) => {
133
- const multiline = content.match(/```(\w+)?[\s\n]*([\s\S]*?)```/);
134
- if (multiline) {
135
- return {
136
- elem: jsx("code", { className: S.codeBlock, children: multiline[2].trim() }),
137
- index: multiline.index,
138
- length: multiline[0].length,
139
- };
140
- }
141
- const inline = content.match(/`([^`\n]+)`/);
142
- if (!inline)
143
- return null;
144
- return {
145
- elem: jsx("code", { className: S.codeInline, children: inline[1] }),
146
- index: inline.index,
147
- length: inline[0].length,
148
- };
149
- };
150
- const injectPrettyJson = (content) => {
151
- let searchFrom = 0;
152
- while (searchFrom < content.length) {
153
- let start = -1;
154
- for (let j = searchFrom; j < content.length; j++) {
155
- if (content[j] === '{' || content[j] === '[') {
156
- start = j;
157
- break;
158
- }
159
- }
160
- if (start < 0)
161
- return null;
162
- const endExclusive = findJsonEndExclusive(content, start);
163
- if (endExclusive < 0) {
164
- searchFrom = start + 1;
165
- continue;
166
- }
167
- const slice = content.slice(start, endExclusive);
168
- try {
169
- const parsed = JSON.parse(slice);
170
- return {
171
- elem: (jsx("pre", { className: S.jsonPre, children: JSON.stringify(parsed, null, 2) })),
172
- index: start,
173
- length: slice.length,
174
- };
175
- }
176
- catch {
177
- searchFrom = start + 1;
178
- }
179
- }
180
- return null;
181
- };
182
- const injectLinks = (content) => {
183
- const markdown = content.match(/\[([^\]]+)\]\(([^)]+)\)/);
184
- if (markdown) {
185
- let url = markdown[2];
186
- if (url.startsWith('www.'))
187
- url = `https://${url}`;
188
- return {
189
- elem: (jsx(Tooltip, { content: url, direction: "top", children: jsx(Link, { href: url, inline: true, target: "_blank", children: markdown[1] }) })),
190
- index: markdown.index,
191
- length: markdown[0].length,
192
- };
193
- }
194
- const bareDomainTlds = 'com|org|net|edu|gov|mil|int|info|biz|co|io|ai|app|dev|me|tv|cc|ly|sh|so|gg|fm|ws|xyz|tech|cloud|store|online|site|shop|blog|news|link|page|uk|us|ca|de|fr|jp|cn|ru|br|in|au|it|es|nl|se|no|fi|pl|ch|be|at|dk|cz|gr|hu|ie|pt|ro|tr|kr|mx|za|sg|hk|tw|nz|il|ae|ua';
195
- const matches = content.match(new RegExp(`(https?:\\/\\/[^\\s<>"']+|www\\.[^\\s<>"']+|[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\\.(?:${bareDomainTlds})\\b[^\\s<>"']*)`, 'i'));
196
- if (!matches)
197
- return null;
198
- let url = matches[0];
199
- if (url.startsWith('www.'))
200
- url = `https://${url}`;
201
- return {
202
- elem: (jsx(Tooltip, { content: url, direction: "top", children: jsx(Link, { href: url, inline: true, target: "_blank", children: matches[0] }) })),
203
- index: matches.index,
204
- length: matches[0].length,
205
- };
206
- };
207
- const injectButtons = (content) => {
208
- if (!onButtonClick)
209
- return null;
210
- const matches = content.match(/\[(.*?):(.*?)\|([^\]]+)\]/);
211
- if (!matches)
212
- return null;
213
- const [data, label] = matches[0]
214
- .replace('[', '')
215
- .replace(']', '')
216
- .split('|');
217
- const [varName, value] = data.split(':');
218
- return {
219
- elem: (jsx(Button, { variant: "default", size: "s", round: true, onClick: () => onButtonClick({ text: label, [varName]: value }), children: label })),
220
- index: matches.index,
221
- length: matches[0].length,
222
- };
223
- };
224
- const headingTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
225
- const processCellContent = (value, depth = 0) => applyInjectors(value, [
226
- injectCodeBlock,
227
- injectPrettyJson,
228
- ...(depth === 0
229
- ? [
230
- (content) => {
231
- const matches = content.match(/(^|\n)(#{1,6})\s+([^\n]+)/);
232
- if (!matches)
233
- return null;
234
- const Tag = headingTags[Math.min(matches[2].length, 6) - 1];
235
- return {
236
- elem: React__default.createElement(Tag, {}, ...processCellContent(matches[3], depth + 1)),
237
- index: matches.index,
238
- length: matches[0].length,
239
- };
240
- },
241
- ]
242
- : []),
243
- injectLines,
244
- injectLinks,
245
- injectBold,
246
- injectItalic,
247
- injectBullet,
248
- injectNumbered,
249
- injectButtons,
250
- ]);
251
- const injectHeading = (content) => {
252
- const matches = content.match(/(^|\n)(#{1,6})\s+([^\n]+)/);
253
- if (!matches)
254
- return null;
255
- const Tag = headingTags[Math.min(matches[2].length, 6) - 1];
256
- return {
257
- elem: React__default.createElement(Tag, {}, ...processCellContent(matches[3], 1)),
258
- index: matches.index,
259
- length: matches[0].length,
260
- };
261
- };
262
- const injectTables = (content) => {
263
- const withSep = content.match(/(\n|^)(\|[^\n]+\|\s*\n)(\|[\s:-]+(?:\|[\s:-]+)*\|\s*\n)((?:\|[^\n]+\|\s*\n?)+)/);
264
- const withoutSep = withSep
265
- ? null
266
- : content.match(/(\n|^)(\|[^\n]+\|\s*\n)((?:\|[^\n]+\|\s*\n?)+)/);
267
- const matches = withSep || withoutSep;
268
- if (!matches)
269
- return null;
270
- const hasSeparator = Boolean(withSep);
271
- const headerRow = matches[2].trim();
272
- const dataRows = (hasSeparator ? matches[4] : matches[3]).trim();
273
- const headers = headerRow.split('|').map(cell => cell.trim()).slice(1, -1);
274
- if (headers.length === 0)
275
- return null;
276
- const rows = dataRows
277
- .split('\n')
278
- .map(row => row.trim())
279
- .filter(row => row.startsWith('|') && row.endsWith('|'))
280
- .map(row => row.split('|').map(cell => cell.trim()).slice(1, -1))
281
- .filter(row => row.length > 0);
282
- if (rows.length === 0)
283
- return null;
284
- const maxCols = Math.max(headers.length, ...rows.map(row => row.length));
285
- const paddedHeaders = [
286
- ...headers,
287
- ...Array(maxCols - headers.length).fill(''),
288
- ];
289
- const columns = paddedHeaders.map((header, idx) => ({
290
- id: `col-${idx}`,
291
- label: processCellContent(header),
292
- dataField: `col-${idx}`,
293
- render: (data) => processCellContent(data[`col-${idx}`] || ''),
294
- }));
295
- const tableData = rows.map((row, rowIdx) => {
296
- const rowData = { id: `row-${rowIdx}` };
297
- paddedHeaders.forEach((_, colIdx) => {
298
- rowData[`col-${colIdx}`] = row[colIdx] || '';
299
- });
300
- return rowData;
301
- });
302
- return {
303
- elem: (jsx(Table, { size: "s", variant: "plain", columns: columns, data: tableData, className: S.table })),
304
- index: matches.index + (matches[1]?.length || 0),
305
- length: matches[0].length - (matches[1]?.length || 0),
306
- };
307
- };
308
- return (jsx("div", { className: className, children: applyInjectors(text, [
309
- injectTables,
310
- injectCodeBlock,
311
- injectPrettyJson,
312
- injectHeading,
313
- injectLines,
314
- injectLinks,
315
- injectBold,
316
- injectItalic,
317
- injectBullet,
318
- injectNumbered,
319
- injectButtons,
320
- ]) }));
4
+ function ChatFormattedText(props) {
5
+ return jsx(FormattedText, { ...props });
321
6
  }
322
7
 
323
8
  export { ChatFormattedText };
@@ -1,6 +1,6 @@
1
1
  import styleInject from '../../../node_modules/style-inject/dist/style-inject.es.js';
2
2
 
3
- var css_248z = ".Expand_root__zxSvx{display:flex;flex-direction:column}.Expand_root__zxSvx+.Expand_root__zxSvx{margin-top:var(--p-3)}.Expand_header__LxAel{justify-content:space-between}.Expand_headerIcon__CXlwY{transition:transform .2s ease-out}.Expand_isOpen__k6lyZ .Expand_header__LxAel{background-color:var(--active-color-alpha-500)}.Expand_isOpen__k6lyZ .Expand_headerIcon__CXlwY{transform:rotate(90deg)}";
3
+ var css_248z = ".Expand_root__zxSvx{display:flex;flex-direction:column}.Expand_root__zxSvx+.Expand_root__zxSvx{margin-top:var(--p-3)}.Expand_header__LxAel{justify-content:space-between}.Expand_headerIcon__CXlwY{opacity:.4;transform:scale(.7);transition:transform .2s ease-out,opacity .2s ease-out}.Expand_header__LxAel:hover .Expand_headerIcon__CXlwY{opacity:1}.Expand_isOpen__k6lyZ .Expand_header__LxAel{background-color:var(--active-color-alpha-500)}.Expand_isOpen__k6lyZ .Expand_headerIcon__CXlwY{transform:scale(.7) rotate(90deg)}";
4
4
  var S = {"root":"Expand_root__zxSvx","header":"Expand_header__LxAel","headerIcon":"Expand_headerIcon__CXlwY","isOpen":"Expand_isOpen__k6lyZ"};
5
5
  styleInject(css_248z);
6
6
 
@@ -0,0 +1,334 @@
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import React__default from 'react';
3
+ import { Button } from '../Button/Button.js';
4
+ import { Link } from '../Router/Link/Link.js';
5
+ import { Table } from '../Table/Table.js';
6
+ import { Tooltip } from '../Tooltip/Tooltip.js';
7
+ import S from './FormattedText.styl.js';
8
+
9
+ function findJsonEndExclusive(content, start) {
10
+ const first = content[start];
11
+ if (first !== '{' && first !== '[')
12
+ return -1;
13
+ const stack = first === '{' ? ['}'] : [']'];
14
+ let i = start + 1;
15
+ let inString = false;
16
+ let escape = false;
17
+ while (i < content.length && stack.length > 0) {
18
+ const c = content[i];
19
+ if (inString) {
20
+ if (escape)
21
+ escape = false;
22
+ else if (c === '\\')
23
+ escape = true;
24
+ else if (c === '"')
25
+ inString = false;
26
+ i++;
27
+ continue;
28
+ }
29
+ if (c === '"') {
30
+ inString = true;
31
+ i++;
32
+ continue;
33
+ }
34
+ if (c === '{') {
35
+ stack.push('}');
36
+ i++;
37
+ continue;
38
+ }
39
+ if (c === '[') {
40
+ stack.push(']');
41
+ i++;
42
+ continue;
43
+ }
44
+ if (c === '}' || c === ']') {
45
+ if (c !== stack[stack.length - 1])
46
+ return -1;
47
+ stack.pop();
48
+ i++;
49
+ continue;
50
+ }
51
+ i++;
52
+ }
53
+ return stack.length > 0 ? -1 : i;
54
+ }
55
+ function applyInjectors(text, injectors) {
56
+ let result = [text];
57
+ injectors.forEach(fn => {
58
+ let i = 0;
59
+ while (i < result.length) {
60
+ const item = result[i];
61
+ if (typeof item === 'string') {
62
+ const res = fn(item);
63
+ if (!res) {
64
+ i++;
65
+ continue;
66
+ }
67
+ const { elem, index, length } = res;
68
+ if (index >= 0) {
69
+ const before = item.substring(0, index);
70
+ const after = item.substring(index + length);
71
+ result.splice(i, 1, before, elem, after);
72
+ if (after.length > 0)
73
+ continue;
74
+ }
75
+ }
76
+ i++;
77
+ }
78
+ });
79
+ return result;
80
+ }
81
+ function FormattedText({ text, className, onButtonClick, }) {
82
+ const injectLines = (content) => {
83
+ const matches = content.match(/(^|\n)---[ \t]*(?:\n|$)/);
84
+ if (!matches)
85
+ return null;
86
+ return {
87
+ elem: jsx("div", { className: S.line }),
88
+ index: matches.index,
89
+ length: matches[0].length,
90
+ };
91
+ };
92
+ const injectBullet = (content) => {
93
+ const matches = content.match(/(\n|^)([ \t]*)(-|\*|\+)\s/);
94
+ if (!matches)
95
+ return null;
96
+ return {
97
+ elem: (jsxs(Fragment, { children: [matches[1] === '\n' && jsx("br", {}), jsx("div", { className: S.bullet })] })),
98
+ index: matches.index,
99
+ length: matches[0].length,
100
+ };
101
+ };
102
+ const injectNumbered = (content) => {
103
+ const matches = content.match(/(\n|^)([ \t]*)(\d+)\.\s+/);
104
+ if (!matches)
105
+ return null;
106
+ return {
107
+ elem: (jsxs(Fragment, { children: [matches[1] === '\n' && jsx("br", {}), jsxs("span", { className: S.numberedIndex, children: [matches[3], "."] })] })),
108
+ index: matches.index,
109
+ length: matches[0].length,
110
+ };
111
+ };
112
+ const injectBold = (content) => {
113
+ const matches = content.match(/\*\*(.*?)\*\*/);
114
+ if (!matches)
115
+ return null;
116
+ return {
117
+ elem: jsx("strong", { children: matches[1] }),
118
+ index: matches.index,
119
+ length: matches[0].length,
120
+ };
121
+ };
122
+ const injectItalic = (content) => {
123
+ const matches = content.match(/\*(.*?)\*/);
124
+ if (!matches)
125
+ return null;
126
+ return {
127
+ elem: jsx("em", { children: matches[1] }),
128
+ index: matches.index,
129
+ length: matches[0].length,
130
+ };
131
+ };
132
+ const injectCodeBlock = (content) => {
133
+ const multiline = content.match(/```(\w+)?[\s\n]*([\s\S]*?)```/);
134
+ if (multiline) {
135
+ return {
136
+ elem: jsx("code", { className: S.codeBlock, children: multiline[2].trim() }),
137
+ index: multiline.index,
138
+ length: multiline[0].length,
139
+ };
140
+ }
141
+ const inline = content.match(/`([^`\n]+)`/);
142
+ if (!inline)
143
+ return null;
144
+ return {
145
+ elem: jsx("code", { className: S.codeInline, children: inline[1] }),
146
+ index: inline.index,
147
+ length: inline[0].length,
148
+ };
149
+ };
150
+ const injectPrettyJson = (content) => {
151
+ let searchFrom = 0;
152
+ while (searchFrom < content.length) {
153
+ let start = -1;
154
+ for (let j = searchFrom; j < content.length; j++) {
155
+ if (content[j] === '{' || content[j] === '[') {
156
+ start = j;
157
+ break;
158
+ }
159
+ }
160
+ if (start < 0)
161
+ return null;
162
+ const endExclusive = findJsonEndExclusive(content, start);
163
+ if (endExclusive < 0) {
164
+ searchFrom = start + 1;
165
+ continue;
166
+ }
167
+ const slice = content.slice(start, endExclusive);
168
+ try {
169
+ const parsed = JSON.parse(slice);
170
+ return {
171
+ elem: (jsx("pre", { className: S.jsonPre, children: JSON.stringify(parsed, null, 2) })),
172
+ index: start,
173
+ length: slice.length,
174
+ };
175
+ }
176
+ catch {
177
+ searchFrom = start + 1;
178
+ }
179
+ }
180
+ return null;
181
+ };
182
+ const injectLinks = (content) => {
183
+ const markdown = content.match(/\[([^\]]+)\]\(([^)]+)\)/);
184
+ if (markdown) {
185
+ let url = markdown[2];
186
+ if (url.startsWith('www.'))
187
+ url = `https://${url}`;
188
+ return {
189
+ elem: (jsx(Tooltip, { content: url, direction: "top", children: jsx(Link, { href: url, inline: true, target: "_blank", children: markdown[1] }) })),
190
+ index: markdown.index,
191
+ length: markdown[0].length,
192
+ };
193
+ }
194
+ const bareDomainTlds = 'com|org|net|edu|gov|mil|int|info|biz|co|io|ai|app|dev|me|tv|cc|ly|sh|so|gg|fm|ws|xyz|tech|cloud|store|online|site|shop|blog|news|link|page|uk|us|ca|de|fr|jp|cn|ru|br|in|au|it|es|nl|se|no|fi|pl|ch|be|at|dk|cz|gr|hu|ie|pt|ro|tr|kr|mx|za|sg|hk|tw|nz|il|ae|ua';
195
+ const matches = content.match(new RegExp(`(https?:\\/\\/[^\\s<>"']+|www\\.[^\\s<>"']+|[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\\.(?:${bareDomainTlds})\\b[^\\s<>"']*)`, 'i'));
196
+ if (!matches)
197
+ return null;
198
+ let url = matches[0];
199
+ if (url.startsWith('www.'))
200
+ url = `https://${url}`;
201
+ return {
202
+ elem: (jsx(Tooltip, { content: url, direction: "top", children: jsx(Link, { href: url, inline: true, target: "_blank", children: matches[0] }) })),
203
+ index: matches.index,
204
+ length: matches[0].length,
205
+ };
206
+ };
207
+ const injectBreaks = (content) => {
208
+ const index = content.indexOf('\n');
209
+ if (index < 0)
210
+ return null;
211
+ return {
212
+ elem: jsx("br", {}),
213
+ index,
214
+ length: 1,
215
+ };
216
+ };
217
+ const injectButtons = (content) => {
218
+ const matches = content.match(/\[(.*?):(.*?)\|([^\]]+)\]/);
219
+ if (!matches)
220
+ return null;
221
+ const [data, label] = matches[0]
222
+ .replace('[', '')
223
+ .replace(']', '')
224
+ .split('|');
225
+ const [varName, value] = data.split(':');
226
+ return {
227
+ elem: (jsx(Button, { variant: "default", size: "s", round: true, onClick: onButtonClick
228
+ ? () => onButtonClick({ text: label, [varName]: value })
229
+ : undefined, children: label })),
230
+ index: matches.index,
231
+ length: matches[0].length,
232
+ };
233
+ };
234
+ const headingTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
235
+ const processCellContent = (value, depth = 0) => applyInjectors(value, [
236
+ injectCodeBlock,
237
+ injectPrettyJson,
238
+ ...(depth === 0
239
+ ? [
240
+ (content) => {
241
+ const matches = content.match(/(^|\n)(#{1,6})\s+([^\n]+)/);
242
+ if (!matches)
243
+ return null;
244
+ const Tag = headingTags[Math.min(matches[2].length, 6) - 1];
245
+ return {
246
+ elem: React__default.createElement(Tag, {}, ...processCellContent(matches[3], depth + 1)),
247
+ index: matches.index,
248
+ length: matches[0].length,
249
+ };
250
+ },
251
+ ]
252
+ : []),
253
+ injectLines,
254
+ injectLinks,
255
+ injectBold,
256
+ injectItalic,
257
+ injectBullet,
258
+ injectNumbered,
259
+ injectButtons,
260
+ ]);
261
+ const injectHeading = (content) => {
262
+ const matches = content.match(/(^|\n)(#{1,6})\s+([^\n]+)/);
263
+ if (!matches)
264
+ return null;
265
+ const Tag = headingTags[Math.min(matches[2].length, 6) - 1];
266
+ return {
267
+ elem: React__default.createElement(Tag, {}, ...processCellContent(matches[3], 1)),
268
+ index: matches.index,
269
+ length: matches[0].length,
270
+ };
271
+ };
272
+ const injectTables = (content) => {
273
+ const withSep = content.match(/(\n|^)(\|[^\n]+\|[ \t]*\n)(\|[\t :-]+(?:\|[\t :-]+)*\|[ \t]*\n)((?:\|[^\n]+\|[ \t]*\n?)+)/);
274
+ const withoutSep = withSep
275
+ ? null
276
+ : content.match(/(\n|^)(\|[^\n]+\|[ \t]*\n)((?:\|[^\n]+\|[ \t]*\n?)+)/);
277
+ const matches = withSep || withoutSep;
278
+ if (!matches)
279
+ return null;
280
+ const hasSeparator = Boolean(withSep);
281
+ const headerRow = matches[2].trim();
282
+ const dataRows = (hasSeparator ? matches[4] : matches[3]).trim();
283
+ const headers = headerRow.split('|').map(cell => cell.trim()).slice(1, -1);
284
+ if (headers.length === 0)
285
+ return null;
286
+ const rows = dataRows
287
+ .split('\n')
288
+ .map(row => row.trim())
289
+ .filter(row => row.startsWith('|') && row.endsWith('|'))
290
+ .map(row => row.split('|').map(cell => cell.trim()).slice(1, -1))
291
+ .filter(row => row.length > 0);
292
+ if (rows.length === 0)
293
+ return null;
294
+ const maxCols = Math.max(headers.length, ...rows.map(row => row.length));
295
+ const paddedHeaders = [
296
+ ...headers,
297
+ ...Array(maxCols - headers.length).fill(''),
298
+ ];
299
+ const columns = paddedHeaders.map((header, idx) => ({
300
+ id: `col-${idx}`,
301
+ label: processCellContent(header),
302
+ dataField: `col-${idx}`,
303
+ render: (data) => processCellContent(data[`col-${idx}`] || ''),
304
+ }));
305
+ const tableData = rows.map((row, rowIdx) => {
306
+ const rowData = { id: `row-${rowIdx}` };
307
+ paddedHeaders.forEach((_, colIdx) => {
308
+ rowData[`col-${colIdx}`] = row[colIdx] || '';
309
+ });
310
+ return rowData;
311
+ });
312
+ return {
313
+ elem: (jsx(Table, { size: "s", variant: "plain", columns: columns, data: tableData, className: S.table })),
314
+ index: matches.index + (matches[1]?.length || 0),
315
+ length: matches[0].length - (matches[1]?.length || 0),
316
+ };
317
+ };
318
+ return (jsx("div", { className: className, children: applyInjectors(text, [
319
+ injectTables,
320
+ injectCodeBlock,
321
+ injectPrettyJson,
322
+ injectHeading,
323
+ injectLines,
324
+ injectLinks,
325
+ injectBold,
326
+ injectItalic,
327
+ injectBullet,
328
+ injectNumbered,
329
+ injectButtons,
330
+ injectBreaks,
331
+ ]) }));
332
+ }
333
+
334
+ export { FormattedText };
@@ -0,0 +1,7 @@
1
+ import styleInject from '../../../node_modules/style-inject/dist/style-inject.es.js';
2
+
3
+ var css_248z = ".FormattedText_bullet__vbqlq{display:inline-block;margin-bottom:2px;margin-left:var(--p-2);margin-right:2px}.FormattedText_bullet__vbqlq:before{background-color:var(--accent-color);border-radius:50%;content:\"\";display:block;height:6px;margin:0 4px;width:6px}.FormattedText_numberedIndex__rZ6Kt{font-feature-settings:\"tnum\";color:var(--accent-color);display:inline-block;font-variant-numeric:tabular-nums;margin-left:var(--p-2);margin-right:6px;min-width:1.25em}.FormattedText_line__c2bmE{background-color:var(--accent-color-alpha-200);border-radius:2px;height:2px;margin:var(--p-2) 0;width:100%}.FormattedText_codeBlock__Xrbvn,.FormattedText_codeInline__jCbNL{background-color:var(--decent-color-alpha-400);border-radius:var(--p-2);box-shadow:0 1px 1px var(--accent-color-alpha-50),inset 0 1px 1px var(--decent-color-alpha-500);font-family:monospace;-webkit-user-select:text;-moz-user-select:text;user-select:text}.FormattedText_codeInline__jCbNL{border-radius:3px;display:inline;font-size:90%;padding:0 4px}.FormattedText_codeBlock__Xrbvn,.FormattedText_jsonPre__qOGmo{display:block;font-size:90%;margin:var(--p-2) 0;overflow-x:auto;padding:var(--p-2);white-space:pre-wrap}.FormattedText_jsonPre__qOGmo{background-color:var(--decent-color-alpha-300);border-radius:var(--p-2);box-shadow:0 1px 1px var(--accent-color-alpha-50),inset 0 1px 1px var(--accent-color-alpha-50);font-family:monospace;max-width:100%;-webkit-user-select:text;-moz-user-select:text;user-select:text}.FormattedText_table__ipMMS{margin-bottom:10px}";
4
+ var S = {"bullet":"FormattedText_bullet__vbqlq","numberedIndex":"FormattedText_numberedIndex__rZ6Kt","line":"FormattedText_line__c2bmE","codeInline":"FormattedText_codeInline__jCbNL","codeBlock":"FormattedText_codeBlock__Xrbvn","jsonPre":"FormattedText_jsonPre__qOGmo","table":"FormattedText_table__ipMMS"};
5
+ styleInject(css_248z);
6
+
7
+ export { S as default };
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
- import { forwardRef, useRef, useState, useMemo, useEffect, createElement } from 'react';
2
+ import { forwardRef, useRef, useState, useMemo, useEffect, useLayoutEffect, createElement } from 'react';
3
3
  import cn from 'classnames';
4
4
  import { Label } from '../Label/Label.js';
5
5
  import { RequiredStar } from '../RequiredStar/RequiredStar.js';
@@ -16,6 +16,38 @@ const TEXTAREA_SCROLL_TOP_OFFSET = {
16
16
  m: 40,
17
17
  l: 50,
18
18
  };
19
+ function isNativeTextField(el) {
20
+ return el instanceof HTMLInputElement || el instanceof HTMLTextAreaElement;
21
+ }
22
+ function resolveNativeTextField(el) {
23
+ if (isNativeTextField(el))
24
+ return el;
25
+ if (el instanceof Element) {
26
+ const nested = el.querySelector('input, textarea');
27
+ if (isNativeTextField(nested))
28
+ return nested;
29
+ }
30
+ return null;
31
+ }
32
+ function selectContentEditable(el) {
33
+ const selection = window.getSelection();
34
+ if (!selection)
35
+ return;
36
+ const range = document.createRange();
37
+ range.selectNodeContents(el);
38
+ selection.removeAllRanges();
39
+ selection.addRange(range);
40
+ }
41
+ function selectAllOnElement(el) {
42
+ const field = resolveNativeTextField(el);
43
+ if (field && typeof field.select === 'function') {
44
+ field.select();
45
+ return;
46
+ }
47
+ if (el instanceof HTMLElement && el.isContentEditable) {
48
+ selectContentEditable(el);
49
+ }
50
+ }
19
51
  const Input = forwardRef((props, ref) => {
20
52
  const inputRef = useRef(null);
21
53
  const setRef = (element) => {
@@ -27,7 +59,7 @@ const Input = forwardRef((props, ref) => {
27
59
  ref.current = element;
28
60
  }
29
61
  };
30
- const { type = 'text', size = 'm', variant = 'default', value, defaultValue = '', onChange, onFocus, onBlur, onClear, onInput, changeOnEnd, checkAutofill, hasClear, required, hideRequiredStar, disabled, error, label, placeholder, addonLeft, addonRight, clearPaddingLeft, clearPaddingRight, forceLabelOnTop, scrollProps, step = 1, round, autoFocus, className, fitContentWidth, } = props;
62
+ const { type = 'text', size = 'm', variant = 'default', value, defaultValue = '', onChange, onFocus, onBlur, onClear, onInput, changeOnEnd, checkAutofill, hasClear, required, hideRequiredStar, disabled, error, label, placeholder, addonLeft, addonRight, clearPaddingLeft, clearPaddingRight, forceLabelOnTop, scrollProps, step = 1, round, autoFocus, className, fitContentWidth, selectAllOnFocus, } = props;
31
63
  const updateAutoComplete = () => {
32
64
  const form = inputRef.current?.closest('form');
33
65
  const val = form?.getAttribute('autocomplete');
@@ -39,6 +71,8 @@ const Input = forwardRef((props, ref) => {
39
71
  const elem = inputRef.current;
40
72
  if (!isFocused || !elem || type !== 'text')
41
73
  return;
74
+ if (elem.selectionStart !== elem.selectionEnd)
75
+ return;
42
76
  elem.selectionStart = cursorPos.current;
43
77
  elem.selectionEnd = cursorPos.current;
44
78
  };
@@ -57,6 +91,7 @@ const Input = forwardRef((props, ref) => {
57
91
  const hasValue = isNumber || Boolean(value || inputValue || defaultValue);
58
92
  const isLabelOnTop = forceLabelOnTop || Boolean(addonLeft) || hasValue || isFocused;
59
93
  const cursorPos = useRef(0);
94
+ const selectAllOnFocusPending = useRef(false);
60
95
  const getValue = (val = inputValue) => {
61
96
  if (type === 'number') {
62
97
  if (val)
@@ -136,6 +171,7 @@ const Input = forwardRef((props, ref) => {
136
171
  onChangeValue(val, e);
137
172
  };
138
173
  const onChangeValue = (value, e) => {
174
+ selectAllOnFocusPending.current = false;
139
175
  if (!isNumber && inputRef.current) {
140
176
  cursorPos.current = inputRef.current.selectionStart;
141
177
  }
@@ -159,8 +195,23 @@ const Input = forwardRef((props, ref) => {
159
195
  const handleFocus = e => {
160
196
  setIsFocused(true);
161
197
  onFocus?.(e);
198
+ if (!selectAllOnFocus)
199
+ return;
200
+ selectAllOnFocusPending.current = true;
201
+ selectAllOnElement(inputRef.current ?? e.target);
202
+ };
203
+ const handleMouseDown = e => {
204
+ props.controlProps?.onMouseDown?.(e);
205
+ if (!selectAllOnFocus || isFocusedRef.current)
206
+ return;
207
+ e.preventDefault();
208
+ const el = e.currentTarget;
209
+ if (el instanceof HTMLElement)
210
+ el.focus();
211
+ selectAllOnElement(el);
162
212
  };
163
213
  const handleBlur = e => {
214
+ selectAllOnFocusPending.current = false;
164
215
  if (changeOnEnd)
165
216
  onTypingEnd();
166
217
  const val = getValue(e?.target?.value);
@@ -181,6 +232,7 @@ const Input = forwardRef((props, ref) => {
181
232
  onChange: handleChange,
182
233
  onFocus: handleFocus,
183
234
  onBlur: handleBlur,
235
+ ...(selectAllOnFocus ? { onMouseDown: handleMouseDown } : null),
184
236
  };
185
237
  if (isTextArea) {
186
238
  controlProps.contentEditable = true;
@@ -208,8 +260,10 @@ const Input = forwardRef((props, ref) => {
208
260
  disabled,
209
261
  props.controlProps,
210
262
  handleChange,
263
+ handleMouseDown,
211
264
  onFocus,
212
265
  onBlur,
266
+ selectAllOnFocus,
213
267
  isTextArea,
214
268
  onTextAreaInput,
215
269
  placeholder,
@@ -271,6 +325,23 @@ const Input = forwardRef((props, ref) => {
271
325
  if (isTextArea)
272
326
  setTextareaValue(String(value ?? ''));
273
327
  }, []);
328
+ useLayoutEffect(() => {
329
+ if (!selectAllOnFocus || !selectAllOnFocusPending.current)
330
+ return;
331
+ if (!isFocused)
332
+ return;
333
+ const field = resolveNativeTextField(inputRef.current);
334
+ if (field) {
335
+ if (!field.value || typeof field.select !== 'function')
336
+ return;
337
+ field.select();
338
+ return;
339
+ }
340
+ const node = inputRef.current;
341
+ if (node instanceof HTMLElement && node.isContentEditable && node.innerText) {
342
+ selectContentEditable(node);
343
+ }
344
+ });
274
345
  const Control = isTextArea ? 'span' : 'input';
275
346
  const classes = cn(S.root, isTextArea && S.isTextArea, S[`size-${size}`], S[`variant-${variant}`], isFocused && S.isFocused, error && S.hasError, hasClear && S.hasClear, disabled && S.isDisabled, round && S.round, fitContentWidth && !isTextArea && S.fitContentWidth, className);
276
347
  return (jsxs("div", { className: classes, children: [jsxs("label", { className: cn(S.main, clearPaddingLeft && S.clearPaddingLeft, clearPaddingRight && S.clearPaddingRight), children: [jsx("div", { className: S.border, suppressHydrationWarning: true, style: { clipPath: labelClipPath } }, "border"), renderAddon('left'), wrapControl(jsxs(Fragment, { children: [createElement(Control, { ...controlProps, className: cn(S.control, controlProps?.className), ref: setRef, key: "control" }), isTextArea &&
@@ -35,7 +35,7 @@ import '../Card/Card.js';
35
35
  import '../Router/context.js';
36
36
  import '../Router/Link/Link.styl.js';
37
37
  import '../Table/Table.styl.js';
38
- import '../Chat/ChatFormattedText.styl.js';
38
+ import '../FormattedText/FormattedText.styl.js';
39
39
  import '../Expand/Expand.styl.js';
40
40
  import '../Chat/ChatMessage.styl.js';
41
41
  import '../PromptComposer/PromptComposer.js';
@@ -1,6 +1,6 @@
1
1
  import styleInject from '../../../node_modules/style-inject/dist/style-inject.es.js';
2
2
 
3
- var css_248z = ".Menu_root__xhtlo{max-height:200px;width:100%}.keyboard .Menu_root__xhtlo{pointer-events:none}.Menu_item__VtmwS{align-items:center;animation:Menu_fadeIn__XRZkT .3s ease-out;cursor:pointer;display:flex;overflow:hidden;padding-bottom:0!important;padding-top:0!important;position:relative;text-align:left;text-overflow:ellipsis;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap;width:100%}.Menu_item__VtmwS:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.Menu_item__VtmwS:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.Menu_size-xs__MSbRQ .Menu_item__VtmwS{font-size:14px;height:24px;padding:0 8px}.Menu_size-s__DA0r3 .Menu_item__VtmwS{font-size:16px;height:32px;padding:0 12px}.Menu_size-m__0EI47 .Menu_item__VtmwS{font-size:18px;height:40px;padding:0 16px}.Menu_size-l__PXpIm .Menu_item__VtmwS{font-size:22px;height:48px;padding:0 20px}.Menu_size-xl__U1WW8 .Menu_item__VtmwS{font-size:26px;height:56px;padding:0 24px}.Menu_item__VtmwS.Menu_selected__V71xy{background-color:var(--active-color-alpha-500)}.Menu_item__VtmwS.Menu_disabled__5afRm{cursor:not-allowed;opacity:.4}.keyboard .Menu_item__VtmwS.Menu_focused__FLWqW,.pointer .Menu_item__VtmwS:hover{box-shadow:inset 100vw 0 0 0 var(--accent-color-alpha-200)}.Menu_textOverflow__udsHR .Menu_item__VtmwS>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.Menu_group__6e-Ef{background-color:var(--decent-color);color:var(--accent-color);font-size:14px;font-weight:500;padding:8px 12px;pointer-events:none;position:sticky;top:0;z-index:1}.Menu_levelIndent__S6HXJ{--menu-indent-size:var(--p-3)}.Menu_levelIndent__S6HXJ.Menu_level-1__kueO2{padding-left:calc(var(--menu-indent-size)*2)}.Menu_levelIndent__S6HXJ.Menu_level-2__JZGkJ{padding-left:calc(var(--menu-indent-size)*3)}.Menu_levelIndent__S6HXJ.Menu_level-3__LFd-F{padding-left:calc(var(--menu-indent-size)*4)}.Menu_levelIndent__S6HXJ.Menu_level-4__2DUMl{padding-left:calc(var(--menu-indent-size)*5)}.Menu_levelIndent__S6HXJ.Menu_level-5__xpgvQ{padding-left:calc(var(--menu-indent-size)*6)}@keyframes Menu_fadeIn__XRZkT{0%{opacity:0}10%{opacity:0}to{opacity:1}}";
3
+ var css_248z = ".Menu_root__xhtlo{max-height:200px;width:100%}.keyboard .Menu_root__xhtlo{pointer-events:none}.Menu_item__VtmwS{align-items:center;animation:Menu_fadeIn__XRZkT .3s ease-out;cursor:pointer;display:flex;overflow:hidden;padding-bottom:0!important;padding-top:0!important;position:relative;text-align:left;text-overflow:ellipsis;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap;width:100%}.Menu_item__VtmwS:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.Menu_item__VtmwS:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.Menu_size-xs__MSbRQ .Menu_item__VtmwS{font-size:14px;height:24px;padding:0 8px}.Menu_size-s__DA0r3 .Menu_item__VtmwS{font-size:16px;height:32px;padding:0 12px}.Menu_size-m__0EI47 .Menu_item__VtmwS{font-size:18px;height:40px;padding:0 16px}.Menu_size-l__PXpIm .Menu_item__VtmwS{font-size:22px;height:48px;padding:0 20px}.Menu_size-xl__U1WW8 .Menu_item__VtmwS{font-size:26px;height:56px;padding:0 24px}.Menu_item__VtmwS.Menu_selected__V71xy{background-color:var(--active-color-alpha-500)}.Menu_item__VtmwS.Menu_disabled__5afRm{cursor:not-allowed;opacity:.4}.keyboard .Menu_item__VtmwS.Menu_focused__FLWqW,.pointer .Menu_item__VtmwS:hover{box-shadow:inset 100vw 0 0 0 var(--active-color-alpha-200)}.Menu_textOverflow__udsHR .Menu_item__VtmwS>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.Menu_group__6e-Ef{background-color:var(--decent-color);color:var(--accent-color);font-size:14px;font-weight:500;padding:8px 12px;pointer-events:none;position:sticky;top:0;z-index:1}.Menu_levelIndent__S6HXJ{--menu-indent-size:var(--p-3)}.Menu_levelIndent__S6HXJ.Menu_level-1__kueO2{padding-left:calc(var(--menu-indent-size)*2)}.Menu_levelIndent__S6HXJ.Menu_level-2__JZGkJ{padding-left:calc(var(--menu-indent-size)*3)}.Menu_levelIndent__S6HXJ.Menu_level-3__LFd-F{padding-left:calc(var(--menu-indent-size)*4)}.Menu_levelIndent__S6HXJ.Menu_level-4__2DUMl{padding-left:calc(var(--menu-indent-size)*5)}.Menu_levelIndent__S6HXJ.Menu_level-5__xpgvQ{padding-left:calc(var(--menu-indent-size)*6)}@keyframes Menu_fadeIn__XRZkT{0%{opacity:0}10%{opacity:0}to{opacity:1}}";
4
4
  var S = {"root":"Menu_root__xhtlo","item":"Menu_item__VtmwS","fadeIn":"Menu_fadeIn__XRZkT","size-xs":"Menu_size-xs__MSbRQ","size-s":"Menu_size-s__DA0r3","size-m":"Menu_size-m__0EI47","size-l":"Menu_size-l__PXpIm","size-xl":"Menu_size-xl__U1WW8","selected":"Menu_selected__V71xy","disabled":"Menu_disabled__5afRm","focused":"Menu_focused__FLWqW","textOverflow":"Menu_textOverflow__udsHR","group":"Menu_group__6e-Ef","levelIndent":"Menu_levelIndent__S6HXJ","level-1":"Menu_level-1__kueO2","level-2":"Menu_level-2__JZGkJ","level-3":"Menu_level-3__LFd-F","level-4":"Menu_level-4__2DUMl","level-5":"Menu_level-5__xpgvQ"};
5
5
  styleInject(css_248z);
6
6
 
@@ -1,6 +1,6 @@
1
1
  import styleInject from '../../../node_modules/style-inject/dist/style-inject.es.js';
2
2
 
3
- var css_248z = ".NestedMenu_root__ybyGA{display:inline-flex;position:relative}.NestedMenu_trigger__zBeNI{display:inline-flex}.NestedMenu_popup__q0uYO{background:var(--decent-color);border:1px solid var(--accent-color-alpha-200);border-radius:10px;box-shadow:0 8px 28px rgba(0,0,0,.45);left:0;max-width:280px;min-width:200px;padding:4px;position:absolute;top:calc(100% + 6px);z-index:20}.NestedMenu_alignEnd__L4AZi{left:auto;right:0}.NestedMenu_itemWrap__Qmc0B{position:relative}.NestedMenu_back__dNsDV,.NestedMenu_item__tgbZm,.NestedMenu_row__48g5c{align-items:center;background:none;border:none;border-radius:6px;color:inherit;cursor:pointer;display:flex;font:inherit;font-size:13px;font-weight:500;gap:8px;letter-spacing:.01em;line-height:1.3;padding:6px 10px;text-align:left;text-decoration:none;width:100%}.NestedMenu_back__dNsDV.NestedMenu_itemActive__RfPZH,.NestedMenu_back__dNsDV:hover,.NestedMenu_item__tgbZm.NestedMenu_itemActive__RfPZH,.NestedMenu_item__tgbZm:hover,.NestedMenu_row__48g5c.NestedMenu_itemActive__RfPZH,.NestedMenu_row__48g5c:hover{background:var(--accent-color-alpha-100)}.NestedMenu_back__dNsDV.NestedMenu_itemDisabled__evVk1,.NestedMenu_back__dNsDV:disabled,.NestedMenu_item__tgbZm.NestedMenu_itemDisabled__evVk1,.NestedMenu_item__tgbZm:disabled,.NestedMenu_row__48g5c.NestedMenu_itemDisabled__evVk1,.NestedMenu_row__48g5c:disabled{cursor:default;opacity:.55;pointer-events:none}.NestedMenu_itemDanger__oAJbP{color:var(--active-color)}.NestedMenu_itemDanger__oAJbP .NestedMenu_icon__4g2Yp{color:inherit;opacity:1}.NestedMenu_icon__4g2Yp{display:inline-flex;flex-shrink:0;opacity:.55}.NestedMenu_icon__4g2Yp svg{display:block}.NestedMenu_label__Jnm6l{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.NestedMenu_hint__hotNP{flex-shrink:0;font-weight:400;opacity:.5}.NestedMenu_multiline__MDdk-{grid-row-gap:2px;align-items:start;display:grid;grid-template-columns:auto minmax(0,1fr);min-width:252px;row-gap:2px}.NestedMenu_multiline__MDdk- .NestedMenu_label__Jnm6l{overflow:visible;text-overflow:clip}.NestedMenu_multiline__MDdk- .NestedMenu_hint__hotNP{grid-column:2;min-width:0;white-space:normal}.NestedMenu_chevron__8i-Po{flex-shrink:0;opacity:.45}.NestedMenu_row__48g5c svg{color:var(--active-color);flex-shrink:0}.NestedMenu_submenu__Tx1Ll{background:var(--decent-color);border:1px solid var(--accent-color-alpha-200);border-radius:10px;box-shadow:0 8px 28px rgba(0,0,0,.45);left:calc(100% + 6px);max-height:min(360px,calc(100vh - 24px));max-width:280px;min-width:220px;overflow-x:hidden;overflow-y:auto;padding:4px;position:absolute;top:-4px;z-index:21}.NestedMenu_submenu__Tx1Ll:before{bottom:0;content:\"\";left:-6px;position:absolute;top:0;width:6px}.NestedMenu_submenuLeft__y18Nb{left:auto;right:calc(100% + 6px)}.NestedMenu_submenuLeft__y18Nb:before{left:auto;right:-6px}.NestedMenu_stacked__rMiOi{display:flex;flex-direction:column;max-height:min(360px,calc(100vh - 24px));overflow-y:auto}.NestedMenu_back__dNsDV{font-weight:650;margin-bottom:2px}.NestedMenu_stackedBody__Fbkma{min-width:0}";
3
+ var css_248z = ".NestedMenu_root__ybyGA{display:inline-flex;position:relative}.NestedMenu_trigger__zBeNI{display:inline-flex}.NestedMenu_popup__q0uYO{background:var(--decent-color);border:1px solid var(--accent-color-alpha-200);border-radius:10px;box-shadow:0 8px 28px rgba(0,0,0,.45);display:flex;flex-direction:column;gap:1px;left:0;max-width:280px;min-width:200px;padding:4px;position:absolute;top:calc(100% + 6px);z-index:20}.NestedMenu_alignEnd__L4AZi{left:auto;right:0}.NestedMenu_itemWrap__Qmc0B{position:relative}.NestedMenu_back__dNsDV,.NestedMenu_item__tgbZm,.NestedMenu_row__48g5c{align-items:center;background:none;border:none;border-radius:6px;color:inherit;cursor:pointer;display:flex;font:inherit;font-size:13px;font-weight:500;gap:8px;letter-spacing:.01em;line-height:1.3;padding:6px 10px;text-align:left;text-decoration:none;width:100%}.NestedMenu_back__dNsDV:hover,.NestedMenu_item__tgbZm:hover,.NestedMenu_row__48g5c:hover{background:var(--accent-color-alpha-50)}.NestedMenu_back__dNsDV.NestedMenu_itemActive__RfPZH,.NestedMenu_item__tgbZm.NestedMenu_itemActive__RfPZH,.NestedMenu_row__48g5c.NestedMenu_itemActive__RfPZH{background:var(--accent-color-alpha-100)}.NestedMenu_back__dNsDV.NestedMenu_itemDisabled__evVk1,.NestedMenu_back__dNsDV:disabled,.NestedMenu_item__tgbZm.NestedMenu_itemDisabled__evVk1,.NestedMenu_item__tgbZm:disabled,.NestedMenu_row__48g5c.NestedMenu_itemDisabled__evVk1,.NestedMenu_row__48g5c:disabled{cursor:default;opacity:.55;pointer-events:none}.NestedMenu_itemDanger__oAJbP{color:var(--active-color)}.NestedMenu_itemDanger__oAJbP .NestedMenu_icon__4g2Yp{color:inherit;opacity:1}.NestedMenu_icon__4g2Yp{display:inline-flex;flex-shrink:0;opacity:.55}.NestedMenu_icon__4g2Yp svg{display:block}.NestedMenu_label__Jnm6l{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.NestedMenu_hint__hotNP{flex-shrink:0;font-weight:400;opacity:.5}.NestedMenu_multiline__MDdk-{grid-row-gap:2px;align-items:start;display:grid;grid-template-columns:auto minmax(0,1fr);min-width:252px;row-gap:2px}.NestedMenu_multiline__MDdk- .NestedMenu_label__Jnm6l{overflow:visible;text-overflow:clip}.NestedMenu_multiline__MDdk- .NestedMenu_hint__hotNP{grid-column:2;min-width:0;white-space:normal}.NestedMenu_chevron__8i-Po{flex-shrink:0;opacity:.45}.NestedMenu_row__48g5c svg{color:var(--active-color);flex-shrink:0}.NestedMenu_submenu__Tx1Ll{background:var(--decent-color);border:1px solid var(--accent-color-alpha-200);border-radius:10px;box-shadow:0 8px 28px rgba(0,0,0,.45);left:calc(100% + 6px);max-height:min(360px,calc(100vh - 24px));max-width:280px;min-width:220px;overflow-x:hidden;overflow-y:auto;padding:4px;position:absolute;top:-4px;z-index:21}.NestedMenu_submenu__Tx1Ll:before{bottom:0;content:\"\";left:-6px;position:absolute;top:0;width:6px}.NestedMenu_submenuLeft__y18Nb{left:auto;right:calc(100% + 6px)}.NestedMenu_submenuLeft__y18Nb:before{left:auto;right:-6px}.NestedMenu_stacked__rMiOi{display:flex;flex-direction:column;max-height:min(360px,calc(100vh - 24px));overflow-y:auto}.NestedMenu_back__dNsDV{font-weight:650;margin-bottom:2px}.NestedMenu_stackedBody__Fbkma{min-width:0}";
4
4
  var S = {"root":"NestedMenu_root__ybyGA","trigger":"NestedMenu_trigger__zBeNI","popup":"NestedMenu_popup__q0uYO","alignEnd":"NestedMenu_alignEnd__L4AZi","itemWrap":"NestedMenu_itemWrap__Qmc0B","item":"NestedMenu_item__tgbZm","row":"NestedMenu_row__48g5c","back":"NestedMenu_back__dNsDV","itemActive":"NestedMenu_itemActive__RfPZH","itemDisabled":"NestedMenu_itemDisabled__evVk1","itemDanger":"NestedMenu_itemDanger__oAJbP","icon":"NestedMenu_icon__4g2Yp","label":"NestedMenu_label__Jnm6l","hint":"NestedMenu_hint__hotNP","multiline":"NestedMenu_multiline__MDdk-","chevron":"NestedMenu_chevron__8i-Po","submenu":"NestedMenu_submenu__Tx1Ll","submenuLeft":"NestedMenu_submenuLeft__y18Nb","stacked":"NestedMenu_stacked__rMiOi","stackedBody":"NestedMenu_stackedBody__Fbkma"};
5
5
  styleInject(css_248z);
6
6
 
@@ -1,7 +1,7 @@
1
1
  import styleInject from '../../../node_modules/style-inject/dist/style-inject.es.js';
2
2
 
3
- var css_248z = ".PromptComposer_root__gfdXN{width:100%}.PromptComposer_scroller__Sueif{flex:1;max-height:200px;min-height:40px;width:100%}.PromptComposer_editorMount__B9G-o{background:transparent;border:none;border-radius:0!important;box-shadow:none!important;display:flex;flex:1;flex-direction:column;min-height:40px;min-width:0;padding:0!important}.PromptComposer_editorMount__B9G-o:focus-within{box-shadow:none!important}.PromptComposer_editorMount__B9G-o .PromptComposer_promptComposerEditor__yQIpq{border:none!important;box-shadow:none!important;flex:1;margin:0;min-height:40px!important;outline:none!important;overflow:hidden!important;padding:var(--p-2) 0 0!important;resize:none!important;transition:opacity .1s ease-out;white-space:pre-wrap;word-break:break-word}.PromptComposer_editorMount__B9G-o .PromptComposer_promptComposerEditor__yQIpq a{color:var(--link-color)}.PromptComposer_editorMount__B9G-o .PromptComposer_promptComposerEditor__yQIpq a:hover{cursor:pointer;opacity:.8}.PromptComposer_editorMount__B9G-o .PromptComposer_promptComposerEmptyEditor__VrwNe .PromptComposer_promptComposerEmptyNode__62Ylm:before{color:var(--muted-foreground);content:attr(data-placeholder);float:left;height:0;pointer-events:none}";
4
- var S = {"root":"PromptComposer_root__gfdXN","scroller":"PromptComposer_scroller__Sueif","editorMount":"PromptComposer_editorMount__B9G-o","promptComposerEditor":"PromptComposer_promptComposerEditor__yQIpq","promptComposerEmptyEditor":"PromptComposer_promptComposerEmptyEditor__VrwNe","promptComposerEmptyNode":"PromptComposer_promptComposerEmptyNode__62Ylm"};
3
+ var css_248z = ".PromptComposer_root__gfdXN{width:100%}.PromptComposer_scroller__Sueif{flex:1;max-height:200px;min-height:40px;width:100%}.PromptComposer_editorMount__B9G-o{background:transparent;border:none;border-radius:0!important;box-shadow:none!important;display:flex;flex:1;flex-direction:column;min-height:40px;min-width:0;padding:0!important}.PromptComposer_editorMount__B9G-o:focus-within{box-shadow:none!important}.PromptComposer_editorMount__B9G-o .PromptComposer_promptComposerEditor__yQIpq{border:none!important;box-shadow:none!important;flex:1;margin:0;min-height:40px!important;outline:none!important;overflow:hidden!important;padding:var(--p-2) 0 0!important;resize:none!important;transition:opacity .1s ease-out;white-space:pre-wrap;word-break:break-word}.PromptComposer_editorMount__B9G-o .PromptComposer_promptComposerEditor__yQIpq a{color:var(--link-color)}.PromptComposer_editorMount__B9G-o .PromptComposer_promptComposerEditor__yQIpq a:hover{cursor:pointer;opacity:.8}.PromptComposer_editorMount__B9G-o .PromptComposer_promptComposerEmptyNode__62Ylm:before{color:var(--muted-foreground);content:attr(data-placeholder);float:left;height:0;pointer-events:none}";
4
+ var S = {"root":"PromptComposer_root__gfdXN","scroller":"PromptComposer_scroller__Sueif","editorMount":"PromptComposer_editorMount__B9G-o","promptComposerEditor":"PromptComposer_promptComposerEditor__yQIpq","promptComposerEmptyNode":"PromptComposer_promptComposerEmptyNode__62Ylm"};
5
5
  styleInject(css_248z);
6
6
 
7
7
  export { S as default };
@@ -245,7 +245,7 @@ function Select2(props) {
245
245
  const inputValue = isSearching ? searchVal : isMultiple$1 ? '' : selectedLabel;
246
246
  return (jsx(Input, { ...triggerProps, ...inputProps,
247
247
  // TODO: autoComplete
248
- addonRight: triggerArrow, error: isErrorVisible, value: inputValue, onChange: handleSearchChange, label: getFieldLabel(label), placeholder: hasChips && !inputValue ? '' : inputProps?.placeholder }));
248
+ addonRight: triggerArrow, error: isErrorVisible, value: inputValue, onChange: handleSearchChange, selectAllOnFocus: true, label: getFieldLabel(label), placeholder: hasChips && !inputValue ? '' : inputProps?.placeholder }));
249
249
  };
250
250
  const renderTriggerButton = () => {
251
251
  const { label, className, ...rest } = triggerProps;
@@ -3,6 +3,39 @@ import { useState, useRef } from 'react';
3
3
  import { Tooltip } from '../Tooltip/Tooltip.js';
4
4
  import S from './TextWithDeferTooltip.styl.js';
5
5
 
6
+ function clipsOverflow(style, axis) {
7
+ const overflow = axis === 'x' ? style.overflowX : style.overflowY;
8
+ if (overflow === 'hidden' || overflow === 'auto' || overflow === 'scroll') {
9
+ return true;
10
+ }
11
+ if (axis === 'x' && style.textOverflow === 'ellipsis')
12
+ return true;
13
+ if (axis === 'y' &&
14
+ style.webkitLineClamp &&
15
+ style.webkitLineClamp !== 'none') {
16
+ return true;
17
+ }
18
+ return false;
19
+ }
20
+ function isNodeOverflowing(node) {
21
+ const style = getComputedStyle(node);
22
+ if (clipsOverflow(style, 'x') && node.scrollWidth - node.clientWidth > 1) {
23
+ return true;
24
+ }
25
+ if (clipsOverflow(style, 'y') && node.scrollHeight - node.clientHeight > 1) {
26
+ return true;
27
+ }
28
+ return false;
29
+ }
30
+ function isTextOverflowing(root) {
31
+ if (isNodeOverflowing(root))
32
+ return true;
33
+ for (const child of root.querySelectorAll('*')) {
34
+ if (isNodeOverflowing(child))
35
+ return true;
36
+ }
37
+ return false;
38
+ }
6
39
  function TextWithDeferTooltip({ className, children, width, maxWidth, side = 'bottom', overTrigger = false, ...props }) {
7
40
  const [withTooltip, setWithTooltip] = useState(false);
8
41
  const [tooltipWidth, setTooltipWidth] = useState();
@@ -11,9 +44,7 @@ function TextWithDeferTooltip({ className, children, width, maxWidth, side = 'bo
11
44
  const handleMouseEnter = () => {
12
45
  if (!ref.current)
13
46
  return;
14
- const isOverflowingHorizontally = ref.current.scrollWidth - ref.current.clientWidth > 3;
15
- const isOverflowingVertically = ref.current.scrollHeight - ref.current.clientHeight > 3;
16
- if (isOverflowingHorizontally || isOverflowingVertically) {
47
+ if (isTextOverflowing(ref.current)) {
17
48
  if (width != null) {
18
49
  setTooltipWidth(width);
19
50
  }
@@ -53,15 +53,15 @@ const useSimplePositionSetup = ({ triggerRef, tooltipRef, content, delay, direct
53
53
  };
54
54
  trigger.addEventListener('mouseenter', showTooltip);
55
55
  trigger.addEventListener('mouseleave', hideTooltip);
56
- trigger.addEventListener('focus', showTooltip);
57
- trigger.addEventListener('blur', hideTooltip);
56
+ trigger.addEventListener('focusin', showTooltip);
57
+ trigger.addEventListener('focusout', hideTooltip);
58
58
  return () => {
59
59
  clearTimeout(timeoutRef.current);
60
60
  clearTriggerTextStyles(tooltip);
61
61
  trigger.removeEventListener('mouseenter', showTooltip);
62
62
  trigger.removeEventListener('mouseleave', hideTooltip);
63
- trigger.removeEventListener('focus', showTooltip);
64
- trigger.removeEventListener('blur', hideTooltip);
63
+ trigger.removeEventListener('focusin', showTooltip);
64
+ trigger.removeEventListener('focusout', hideTooltip);
65
65
  };
66
66
  }, [content, delay, direction, tooltipRef, triggerRef]);
67
67
  };
@@ -1,6 +1,6 @@
1
1
  import styleInject from '../../../node_modules/style-inject/dist/style-inject.es.js';
2
2
 
3
- var css_248z = ".SlashSuggestionList_root__9KCb1{-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);background-color:var(--decent-color-alpha-700);border-radius:8px;border-radius:var(--radius-lg,8px);box-shadow:inset 0 0 0 1px var(--accent-color-alpha-50),0 8px 24px rgba(0,0,0,.2);color:var(--foreground);max-width:90vw;min-width:220px;overflow:hidden;position:relative}.SlashSuggestionList_root__9KCb1:before{background-color:var(--accent-color-alpha-50);bottom:0;content:\"\";left:0;pointer-events:none;position:absolute;right:0;top:0}.dark .SlashSuggestionList_root__9KCb1{box-shadow:inset 0 0 0 1px var(--accent-color-alpha-50),0 8px 24px rgba(0,0,0,.5)}.SlashSuggestionList_menu__s-jK3{margin:0;max-height:40vh}.SlashSuggestionList_item__9JBeY{align-items:center;border-radius:var(--p-2);display:flex;flex-direction:row;gap:var(--p-2);height:auto!important;justify-content:flex-start;min-height:0;overflow:visible!important;padding:var(--p-1) var(--p-2)!important;position:relative;text-overflow:clip!important;white-space:normal!important;width:100%}.SlashSuggestionList_itemHighlighted__cStZr{box-shadow:inset 100vw 0 0 0 var(--accent-color-alpha-200)}.SlashSuggestionList_itemIcon__hTtxe{color:var(--accent-color-alpha-800);flex-shrink:0}.SlashSuggestionList_itemText__uwNbZ{align-items:flex-start;display:flex;flex-direction:column;min-width:0}.SlashSuggestionList_itemLabel__OMaov{font-weight:600}.SlashSuggestionList_itemDesc__fAdcA{color:var(--accent-color-alpha-600);font-size:80%;white-space:normal}.SlashSuggestionList_mention__aT45p{align-items:center;background:var(--muted);border-radius:var(--p-1);display:inline-flex;line-height:1.4;margin:0 var(--p-1);padding:0 var(--p-1);transition:background-color .1s ease-in-out;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:baseline;white-space:nowrap}.SlashSuggestionList_mention__aT45p:hover{background-color:var(--accent-color-alpha-200)}";
3
+ var css_248z = ".SlashSuggestionList_root__9KCb1{-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);background-color:var(--decent-color-alpha-700);border-radius:8px;border-radius:var(--radius-lg,8px);box-shadow:inset 0 0 0 1px var(--accent-color-alpha-50),0 8px 24px rgba(0,0,0,.2);color:var(--foreground);max-width:90vw;min-width:220px;overflow:hidden;position:relative}.SlashSuggestionList_root__9KCb1:before{background-color:var(--accent-color-alpha-50);bottom:0;content:\"\";left:0;pointer-events:none;position:absolute;right:0;top:0}.dark .SlashSuggestionList_root__9KCb1{box-shadow:inset 0 0 0 1px var(--accent-color-alpha-50),0 8px 24px rgba(0,0,0,.5)}.SlashSuggestionList_menu__s-jK3{margin:0;max-height:40vh}.SlashSuggestionList_item__9JBeY{align-items:center;border-radius:var(--p-2);display:flex;flex-direction:row;gap:var(--p-2);height:auto!important;justify-content:flex-start;min-height:0;overflow:visible!important;padding:var(--p-1) var(--p-2)!important;position:relative;text-overflow:clip!important;white-space:normal!important;width:100%}.SlashSuggestionList_itemHighlighted__cStZr{box-shadow:inset 100vw 0 0 0 var(--active-color-alpha-200)}.SlashSuggestionList_itemIcon__hTtxe{color:var(--accent-color-alpha-800);flex-shrink:0}.SlashSuggestionList_itemText__uwNbZ{align-items:flex-start;display:flex;flex-direction:column;min-width:0}.SlashSuggestionList_itemLabel__OMaov{font-weight:600}.SlashSuggestionList_itemDesc__fAdcA{color:var(--accent-color-alpha-600);font-size:80%;white-space:normal}.SlashSuggestionList_mention__aT45p{align-items:center;background:var(--muted);border-radius:var(--p-1);display:inline-flex;line-height:1.4;margin:0 var(--p-1);padding:0 var(--p-1);transition:background-color .1s ease-in-out;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:baseline;white-space:nowrap}.SlashSuggestionList_mention__aT45p:hover{background-color:var(--active-color-alpha-200)}";
4
4
  var S = {"root":"SlashSuggestionList_root__9KCb1","menu":"SlashSuggestionList_menu__s-jK3","item":"SlashSuggestionList_item__9JBeY","itemHighlighted":"SlashSuggestionList_itemHighlighted__cStZr","itemIcon":"SlashSuggestionList_itemIcon__hTtxe","itemText":"SlashSuggestionList_itemText__uwNbZ","itemLabel":"SlashSuggestionList_itemLabel__OMaov","itemDesc":"SlashSuggestionList_itemDesc__fAdcA","mention":"SlashSuggestionList_mention__aT45p"};
5
5
  styleInject(css_248z);
6
6
 
@@ -1,4 +1,5 @@
1
1
  import type { ReactNode } from 'react';
2
+ import type { FormattedTextProps } from '../FormattedText/FormattedText.types';
2
3
  export type ChatRole = 'USER' | 'AGENT' | 'SYSTEM';
3
4
  export type ChatContentPart = {
4
5
  type: string;
@@ -28,14 +29,7 @@ export type ChatMessageData = {
28
29
  content: string;
29
30
  createdAt?: string | Date;
30
31
  };
31
- export type ChatFormattedTextProps = {
32
- text: string;
33
- className?: string;
34
- onButtonClick?: (params: {
35
- text: string;
36
- [name: string]: string;
37
- }) => void;
38
- };
32
+ export type ChatFormattedTextProps = FormattedTextProps;
39
33
  export type ChatMessageProps = {
40
34
  data: ChatMessageData;
41
35
  isStacked?: boolean;
@@ -1,3 +1,2 @@
1
- import React from 'react';
2
1
  import type { ChatFormattedTextProps } from './types';
3
- export declare function ChatFormattedText({ text, className, onButtonClick, }: ChatFormattedTextProps): React.JSX.Element;
2
+ export declare function ChatFormattedText(props: ChatFormattedTextProps): import("react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import type { FormattedTextProps } from './FormattedText.types';
3
+ export declare function FormattedText({ text, className, onButtonClick, }: FormattedTextProps): React.JSX.Element;
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1,8 @@
1
+ export type FormattedTextProps = {
2
+ text: string;
3
+ className?: string;
4
+ onButtonClick?: (params: {
5
+ text: string;
6
+ [name: string]: string;
7
+ }) => void;
8
+ };
@@ -0,0 +1,2 @@
1
+ export { FormattedText } from './FormattedText';
2
+ export type { FormattedTextProps } from './FormattedText.types';
@@ -24,4 +24,5 @@ export declare const Input: import("react").ForwardRefExoticComponent<Omit<impor
24
24
  checkAutofill?: boolean;
25
25
  scrollProps?: Partial<import("../Scroll/Scroll.types").Props>;
26
26
  fitContentWidth?: boolean;
27
+ selectAllOnFocus?: boolean;
27
28
  } & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -28,4 +28,6 @@ export type Props = Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> & Om
28
28
  scrollProps?: Partial<ScrollProps>;
29
29
  /** When true, width follows text via CSS `field-sizing: content` (non-textarea only). */
30
30
  fitContentWidth?: boolean;
31
+ /** Select the current value when the field is focused. */
32
+ selectAllOnFocus?: boolean;
31
33
  };
@@ -28,6 +28,7 @@ export declare class Select extends Component<T.Props, T.State> {
28
28
  checkAutofill?: boolean;
29
29
  scrollProps?: Partial<import("../Scroll/Scroll.types").Props>;
30
30
  fitContentWidth?: boolean;
31
+ selectAllOnFocus?: boolean;
31
32
  } & import("react").RefAttributes<HTMLInputElement>>>;
32
33
  triggerInputRef: import("react").RefObject<HTMLDivElement>;
33
34
  contentRef: import("react").RefObject<HTMLDivElement>;
@@ -17,6 +17,7 @@ export * from './DropZone/DropZone';
17
17
  export * from './Expand/Expand';
18
18
  export * from './Flex/Flex';
19
19
  export * from './Form/Form';
20
+ export * from './FormattedText';
20
21
  export * from './Gap/Gap';
21
22
  export * from './Gallery/Gallery';
22
23
  export * from './GridLayout/GridLayout';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homecode/ui",
3
- "version": "5.10.0",
3
+ "version": "5.12.0",
4
4
  "description": "React UI components library",
5
5
  "scripts": {
6
6
  "tests": "jest",
@@ -1,7 +0,0 @@
1
- import styleInject from '../../../node_modules/style-inject/dist/style-inject.es.js';
2
-
3
- var css_248z = ".ChatFormattedText_bullet__CdKe7{display:inline-block;margin-bottom:2px;margin-left:var(--p-2);margin-right:2px}.ChatFormattedText_bullet__CdKe7:before{background-color:var(--accent-color);border-radius:50%;content:\"\";display:block;height:6px;margin:0 4px;width:6px}.ChatFormattedText_numberedIndex__bejS0{font-feature-settings:\"tnum\";color:var(--accent-color);display:inline-block;font-variant-numeric:tabular-nums;margin-left:var(--p-2);margin-right:6px;min-width:1.25em}.ChatFormattedText_line__1j8Sx{background-color:var(--accent-color-alpha-200);border-radius:2px;height:2px;margin:var(--p-2) 0;width:100%}.ChatFormattedText_codeBlock__Mm7Um,.ChatFormattedText_codeInline__gqRjp{background-color:var(--decent-color-alpha-400);border-radius:var(--p-2);box-shadow:0 1px 1px var(--accent-color-alpha-50),inset 0 1px 1px var(--decent-color-alpha-500);font-family:monospace;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ChatFormattedText_codeInline__gqRjp{border-radius:3px;display:inline;font-size:90%;padding:0 4px}.ChatFormattedText_codeBlock__Mm7Um,.ChatFormattedText_jsonPre__m4NwI{display:block;font-size:90%;margin:var(--p-2) 0;overflow-x:auto;padding:var(--p-2);white-space:pre-wrap}.ChatFormattedText_jsonPre__m4NwI{background-color:var(--decent-color-alpha-300);border-radius:var(--p-2);box-shadow:0 1px 1px var(--accent-color-alpha-50),inset 0 1px 1px var(--accent-color-alpha-50);font-family:monospace;max-width:100%;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ChatFormattedText_table__1rTGx{margin-bottom:10px}";
4
- var S = {"bullet":"ChatFormattedText_bullet__CdKe7","numberedIndex":"ChatFormattedText_numberedIndex__bejS0","line":"ChatFormattedText_line__1j8Sx","codeInline":"ChatFormattedText_codeInline__gqRjp","codeBlock":"ChatFormattedText_codeBlock__Mm7Um","jsonPre":"ChatFormattedText_jsonPre__m4NwI","table":"ChatFormattedText_table__1rTGx"};
5
- styleInject(css_248z);
6
-
7
- export { S as default };