@uzum-tech/ui 2.3.4 → 2.3.6
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/index.js +6368 -441
- package/dist/index.mjs +6368 -441
- package/dist/index.prod.js +4 -2
- package/dist/index.prod.mjs +4 -2
- package/es/_utils/markdown/constants.d.ts +27 -0
- package/es/_utils/markdown/constants.mjs +26 -0
- package/es/_utils/markdown/create-markdown-renderer.d.ts +3 -0
- package/es/_utils/markdown/create-markdown-renderer.mjs +65 -0
- package/es/_utils/markdown/index.d.ts +2 -0
- package/es/_utils/markdown/index.mjs +1 -0
- package/es/_utils/markdown/interface.d.ts +14 -0
- package/es/_utils/markdown/interface.mjs +7 -0
- package/es/_utils/markdown/render-markdown.d.ts +3 -0
- package/es/_utils/markdown/render-markdown.mjs +31 -0
- package/es/_utils/markdown/rulers/clamp-heading.d.ts +2 -0
- package/es/_utils/markdown/rulers/clamp-heading.mjs +25 -0
- package/es/_utils/markdown/rulers/equals-divider.d.ts +2 -0
- package/es/_utils/markdown/rulers/equals-divider.mjs +19 -0
- package/es/_utils/markdown/rulers/prune-empty-blocks.d.ts +2 -0
- package/es/_utils/markdown/rulers/prune-empty-blocks.mjs +31 -0
- package/es/_utils/markdown/rulers/strikethrough.d.ts +3 -0
- package/es/_utils/markdown/rulers/strikethrough.mjs +38 -0
- package/es/_utils/markdown/rulers/strip-html.d.ts +2 -0
- package/es/_utils/markdown/rulers/strip-html.mjs +7 -0
- package/es/chat/src/Chat.d.ts +515 -23
- package/es/chat/src/Chat.mjs +2 -0
- package/es/chat/src/ChatListItems.d.ts +172 -4
- package/es/chat/src/ChatListItems.mjs +3 -2
- package/es/chat/src/ChatMainArea.d.ts +200 -5
- package/es/chat/src/ChatMainArea.mjs +27 -13
- package/es/chat/src/ChatMessages.d.ts +198 -3
- package/es/chat/src/ChatMessages.mjs +20 -2
- package/es/chat/src/ChatParts/Sidebar.d.ts +28 -0
- package/es/chat/src/interface.d.ts +56 -0
- package/es/chat/src/interface.mjs +8 -0
- package/es/chat/styles/dark.d.ts +14 -0
- package/es/chat/styles/light.d.ts +19 -0
- package/es/chat/styles/light.mjs +5 -0
- package/es/components.d.ts +1452 -456
- package/es/data-table/src/HeaderButton/FilterButton.d.ts +1 -1
- package/es/data-table/src/TableParts/Header.mjs +1 -1
- package/es/data-table/src/use-sorter.d.ts +2 -5
- package/es/data-table/src/use-table-data.d.ts +1 -4
- package/es/image/index.d.ts +2 -2
- package/es/image/index.mjs +2 -1
- package/es/image/src/ImagePreview.d.ts +60 -184
- package/es/image/src/ImagePreview.mjs +12 -18
- package/es/image/src/interface.d.ts +156 -3
- package/es/image/src/interface.mjs +23 -1
- package/es/image/src/public-types.d.ts +11 -5
- package/es/image/src/styles/index.cssr.mjs +11 -1
- package/es/layout/src/LayoutSider.d.ts +1 -1
- package/es/message-bubble/index.d.ts +1 -0
- package/es/message-bubble/src/MessageBubble.d.ts +78 -6
- package/es/message-bubble/src/MessageBubble.mjs +49 -7
- package/es/message-bubble/src/interface.d.ts +36 -0
- package/es/message-bubble/src/interface.mjs +8 -0
- package/es/message-bubble/src/styles/index.cssr.mjs +17 -1
- package/es/message-bubble/styles/dark.d.ts +9 -0
- package/es/message-bubble/styles/light.d.ts +18 -0
- package/es/message-bubble/styles/light.mjs +10 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/lib/_utils/markdown/constants.d.ts +27 -0
- package/lib/_utils/markdown/constants.js +55 -0
- package/lib/_utils/markdown/create-markdown-renderer.d.ts +3 -0
- package/lib/_utils/markdown/create-markdown-renderer.js +84 -0
- package/lib/_utils/markdown/index.d.ts +2 -0
- package/lib/_utils/markdown/index.js +6 -0
- package/lib/_utils/markdown/interface.d.ts +14 -0
- package/lib/_utils/markdown/interface.js +10 -0
- package/lib/_utils/markdown/render-markdown.d.ts +3 -0
- package/lib/_utils/markdown/render-markdown.js +38 -0
- package/lib/_utils/markdown/rulers/clamp-heading.d.ts +2 -0
- package/lib/_utils/markdown/rulers/clamp-heading.js +30 -0
- package/lib/_utils/markdown/rulers/equals-divider.d.ts +2 -0
- package/lib/_utils/markdown/rulers/equals-divider.js +28 -0
- package/lib/_utils/markdown/rulers/prune-empty-blocks.d.ts +2 -0
- package/lib/_utils/markdown/rulers/prune-empty-blocks.js +40 -0
- package/lib/_utils/markdown/rulers/strikethrough.d.ts +3 -0
- package/lib/_utils/markdown/rulers/strikethrough.js +43 -0
- package/lib/_utils/markdown/rulers/strip-html.d.ts +2 -0
- package/lib/_utils/markdown/rulers/strip-html.js +15 -0
- package/lib/chat/src/Chat.d.ts +515 -23
- package/lib/chat/src/Chat.js +2 -0
- package/lib/chat/src/ChatListItems.d.ts +172 -4
- package/lib/chat/src/ChatListItems.js +7 -2
- package/lib/chat/src/ChatMainArea.d.ts +200 -5
- package/lib/chat/src/ChatMainArea.js +26 -14
- package/lib/chat/src/ChatMessages.d.ts +198 -3
- package/lib/chat/src/ChatMessages.js +11 -4
- package/lib/chat/src/ChatParts/Sidebar.d.ts +28 -0
- package/lib/chat/src/interface.d.ts +56 -0
- package/lib/chat/src/interface.js +6 -0
- package/lib/chat/styles/dark.d.ts +14 -0
- package/lib/chat/styles/light.d.ts +19 -0
- package/lib/chat/styles/light.js +5 -0
- package/lib/components.d.ts +1073 -77
- package/lib/data-table/src/HeaderButton/FilterButton.d.ts +1 -1
- package/lib/data-table/src/TableParts/Header.js +1 -1
- package/lib/data-table/src/use-sorter.d.ts +2 -5
- package/lib/data-table/src/use-table-data.d.ts +1 -4
- package/lib/image/index.d.ts +2 -2
- package/lib/image/index.js +3 -2
- package/lib/image/src/ImagePreview.d.ts +60 -184
- package/lib/image/src/ImagePreview.js +18 -17
- package/lib/image/src/interface.d.ts +156 -3
- package/lib/image/src/interface.js +12 -1
- package/lib/image/src/public-types.d.ts +11 -5
- package/lib/image/src/styles/index.cssr.js +11 -1
- package/lib/layout/src/LayoutSider.d.ts +1 -1
- package/lib/message-bubble/index.d.ts +1 -0
- package/lib/message-bubble/src/MessageBubble.d.ts +78 -6
- package/lib/message-bubble/src/MessageBubble.js +39 -7
- package/lib/message-bubble/src/interface.d.ts +36 -0
- package/lib/message-bubble/src/interface.js +6 -0
- package/lib/message-bubble/src/styles/index.cssr.js +17 -1
- package/lib/message-bubble/styles/dark.d.ts +9 -0
- package/lib/message-bubble/styles/light.d.ts +18 -0
- package/lib/message-bubble/styles/light.js +10 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +2 -1
- package/web-types.json +75 -2
|
@@ -41,7 +41,17 @@ export default c([c('body >', [cB('image-container', 'position: fixed;')]), cB('
|
|
|
41
41
|
padding: 0 8px;
|
|
42
42
|
font-size: 28px;
|
|
43
43
|
cursor: pointer;
|
|
44
|
-
`), fadeInTransition()]), cB('image-preview-
|
|
44
|
+
`), fadeInTransition()]), cB('image-preview-loading', `
|
|
45
|
+
position: absolute;
|
|
46
|
+
left: 0;
|
|
47
|
+
right: 0;
|
|
48
|
+
top: 0;
|
|
49
|
+
bottom: 0;
|
|
50
|
+
display: flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
justify-content: center;
|
|
53
|
+
pointer-events: none;
|
|
54
|
+
`), cB('image-preview-wrapper', `
|
|
45
55
|
position: absolute;
|
|
46
56
|
left: 0;
|
|
47
57
|
right: 0;
|
|
@@ -506,7 +506,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
506
506
|
nativeScrollbar: boolean;
|
|
507
507
|
inverted: boolean;
|
|
508
508
|
collapsedWidth: number;
|
|
509
|
-
showTrigger: boolean | "bar" | "
|
|
509
|
+
showTrigger: boolean | "bar" | "arrow-circle" | "sidebar";
|
|
510
510
|
collapseMode: "width" | "transform";
|
|
511
511
|
defaultCollapsed: boolean;
|
|
512
512
|
showCollapsedContent: boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type { MarkdownFeature, MarkdownOptions } from '../_utils/markdown';
|
|
1
2
|
export type { MessageBubbleAction, MessageBubbleAttachment, MessageBubbleId, MessageBubbleMessagePayload, MessageBubbleProps, MessageBubbleRenderContent, MessageBubbleSlots } from './src/interface';
|
|
2
3
|
export { MessageBubbleAttachmentStatus, messageBubbleProps, MessageBubbleServiceVariant, MessageBubbleStatus, MessageBubbleType } from './src/interface';
|
|
3
4
|
export { default as UMessageBubble } from './src/MessageBubble';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { SlotsType, VNodeChild } from 'vue';
|
|
2
2
|
import type { MessageBubbleAttachment, MessageBubbleMessagePayload, MessageBubbleRenderContent, MessageBubbleSlots } from './interface';
|
|
3
|
-
import { MessageBubbleStatus, MessageBubbleType } from './interface';
|
|
3
|
+
import { MessageBubbleServiceVariant, MessageBubbleStatus, MessageBubbleType } from './interface';
|
|
4
4
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
5
|
readonly type: {
|
|
6
6
|
readonly type: import("vue").PropType<MessageBubbleType>;
|
|
7
7
|
readonly default: MessageBubbleType.MESSAGE;
|
|
8
8
|
};
|
|
9
9
|
readonly serviceVariant: {
|
|
10
|
-
readonly type: import("vue").PropType<
|
|
11
|
-
readonly default:
|
|
10
|
+
readonly type: import("vue").PropType<MessageBubbleServiceVariant>;
|
|
11
|
+
readonly default: MessageBubbleServiceVariant.SYSTEM;
|
|
12
12
|
};
|
|
13
13
|
readonly id: {
|
|
14
14
|
readonly type: import("vue").PropType<import("./interface").MessageBubbleId>;
|
|
@@ -26,6 +26,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
26
26
|
readonly type: import("vue").PropType<MessageBubbleRenderContent>;
|
|
27
27
|
readonly default: undefined;
|
|
28
28
|
};
|
|
29
|
+
readonly markdown: {
|
|
30
|
+
readonly type: BooleanConstructor;
|
|
31
|
+
readonly default: false;
|
|
32
|
+
};
|
|
33
|
+
readonly markdownOptions: {
|
|
34
|
+
readonly type: import("vue").PropType<import("..").MarkdownOptions>;
|
|
35
|
+
readonly default: undefined;
|
|
36
|
+
};
|
|
29
37
|
readonly timestamp: {
|
|
30
38
|
readonly type: import("vue").PropType<string | number | Date | (() => VNodeChild)>;
|
|
31
39
|
readonly default: undefined;
|
|
@@ -75,6 +83,15 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
75
83
|
serviceMessageTextColor: string;
|
|
76
84
|
serviceMessageBackgroundColor: string;
|
|
77
85
|
messageTitleColor: string;
|
|
86
|
+
markdownQuoteBorderColorOwn: string;
|
|
87
|
+
markdownQuoteBorderColorOther: string;
|
|
88
|
+
markdownQuoteTextColor: string;
|
|
89
|
+
markdownDividerColorOwn: string;
|
|
90
|
+
markdownDividerColorOther: string;
|
|
91
|
+
markdownH1FontSize: string;
|
|
92
|
+
markdownH2FontSize: string;
|
|
93
|
+
markdownH3FontSize: string;
|
|
94
|
+
markdownTextFontSize: string;
|
|
78
95
|
}, {
|
|
79
96
|
StatusIcon: import("../../_mixins").Theme<"Icon", {
|
|
80
97
|
color: string;
|
|
@@ -102,6 +119,15 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
102
119
|
serviceMessageTextColor: string;
|
|
103
120
|
serviceMessageBackgroundColor: string;
|
|
104
121
|
messageTitleColor: string;
|
|
122
|
+
markdownQuoteBorderColorOwn: string;
|
|
123
|
+
markdownQuoteBorderColorOther: string;
|
|
124
|
+
markdownQuoteTextColor: string;
|
|
125
|
+
markdownDividerColorOwn: string;
|
|
126
|
+
markdownDividerColorOther: string;
|
|
127
|
+
markdownH1FontSize: string;
|
|
128
|
+
markdownH2FontSize: string;
|
|
129
|
+
markdownH3FontSize: string;
|
|
130
|
+
markdownTextFontSize: string;
|
|
105
131
|
}, {
|
|
106
132
|
StatusIcon: import("../../_mixins").Theme<"Icon", {
|
|
107
133
|
color: string;
|
|
@@ -129,6 +155,15 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
129
155
|
serviceMessageTextColor: string;
|
|
130
156
|
serviceMessageBackgroundColor: string;
|
|
131
157
|
messageTitleColor: string;
|
|
158
|
+
markdownQuoteBorderColorOwn: string;
|
|
159
|
+
markdownQuoteBorderColorOther: string;
|
|
160
|
+
markdownQuoteTextColor: string;
|
|
161
|
+
markdownDividerColorOwn: string;
|
|
162
|
+
markdownDividerColorOther: string;
|
|
163
|
+
markdownH1FontSize: string;
|
|
164
|
+
markdownH2FontSize: string;
|
|
165
|
+
markdownH3FontSize: string;
|
|
166
|
+
markdownTextFontSize: string;
|
|
132
167
|
}, {
|
|
133
168
|
StatusIcon: import("../../_mixins").Theme<"Icon", {
|
|
134
169
|
color: string;
|
|
@@ -153,8 +188,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
153
188
|
readonly default: MessageBubbleType.MESSAGE;
|
|
154
189
|
};
|
|
155
190
|
readonly serviceVariant: {
|
|
156
|
-
readonly type: import("vue").PropType<
|
|
157
|
-
readonly default:
|
|
191
|
+
readonly type: import("vue").PropType<MessageBubbleServiceVariant>;
|
|
192
|
+
readonly default: MessageBubbleServiceVariant.SYSTEM;
|
|
158
193
|
};
|
|
159
194
|
readonly id: {
|
|
160
195
|
readonly type: import("vue").PropType<import("./interface").MessageBubbleId>;
|
|
@@ -172,6 +207,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
172
207
|
readonly type: import("vue").PropType<MessageBubbleRenderContent>;
|
|
173
208
|
readonly default: undefined;
|
|
174
209
|
};
|
|
210
|
+
readonly markdown: {
|
|
211
|
+
readonly type: BooleanConstructor;
|
|
212
|
+
readonly default: false;
|
|
213
|
+
};
|
|
214
|
+
readonly markdownOptions: {
|
|
215
|
+
readonly type: import("vue").PropType<import("..").MarkdownOptions>;
|
|
216
|
+
readonly default: undefined;
|
|
217
|
+
};
|
|
175
218
|
readonly timestamp: {
|
|
176
219
|
readonly type: import("vue").PropType<string | number | Date | (() => VNodeChild)>;
|
|
177
220
|
readonly default: undefined;
|
|
@@ -221,6 +264,15 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
221
264
|
serviceMessageTextColor: string;
|
|
222
265
|
serviceMessageBackgroundColor: string;
|
|
223
266
|
messageTitleColor: string;
|
|
267
|
+
markdownQuoteBorderColorOwn: string;
|
|
268
|
+
markdownQuoteBorderColorOther: string;
|
|
269
|
+
markdownQuoteTextColor: string;
|
|
270
|
+
markdownDividerColorOwn: string;
|
|
271
|
+
markdownDividerColorOther: string;
|
|
272
|
+
markdownH1FontSize: string;
|
|
273
|
+
markdownH2FontSize: string;
|
|
274
|
+
markdownH3FontSize: string;
|
|
275
|
+
markdownTextFontSize: string;
|
|
224
276
|
}, {
|
|
225
277
|
StatusIcon: import("../../_mixins").Theme<"Icon", {
|
|
226
278
|
color: string;
|
|
@@ -248,6 +300,15 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
248
300
|
serviceMessageTextColor: string;
|
|
249
301
|
serviceMessageBackgroundColor: string;
|
|
250
302
|
messageTitleColor: string;
|
|
303
|
+
markdownQuoteBorderColorOwn: string;
|
|
304
|
+
markdownQuoteBorderColorOther: string;
|
|
305
|
+
markdownQuoteTextColor: string;
|
|
306
|
+
markdownDividerColorOwn: string;
|
|
307
|
+
markdownDividerColorOther: string;
|
|
308
|
+
markdownH1FontSize: string;
|
|
309
|
+
markdownH2FontSize: string;
|
|
310
|
+
markdownH3FontSize: string;
|
|
311
|
+
markdownTextFontSize: string;
|
|
251
312
|
}, {
|
|
252
313
|
StatusIcon: import("../../_mixins").Theme<"Icon", {
|
|
253
314
|
color: string;
|
|
@@ -275,6 +336,15 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
275
336
|
serviceMessageTextColor: string;
|
|
276
337
|
serviceMessageBackgroundColor: string;
|
|
277
338
|
messageTitleColor: string;
|
|
339
|
+
markdownQuoteBorderColorOwn: string;
|
|
340
|
+
markdownQuoteBorderColorOther: string;
|
|
341
|
+
markdownQuoteTextColor: string;
|
|
342
|
+
markdownDividerColorOwn: string;
|
|
343
|
+
markdownDividerColorOther: string;
|
|
344
|
+
markdownH1FontSize: string;
|
|
345
|
+
markdownH2FontSize: string;
|
|
346
|
+
markdownH3FontSize: string;
|
|
347
|
+
markdownTextFontSize: string;
|
|
278
348
|
}, {
|
|
279
349
|
StatusIcon: import("../../_mixins").Theme<"Icon", {
|
|
280
350
|
color: string;
|
|
@@ -293,9 +363,11 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
293
363
|
readonly status: MessageBubbleStatus;
|
|
294
364
|
readonly actions: import("./interface").MessageBubbleAction[];
|
|
295
365
|
readonly onRetry: (message: MessageBubbleMessagePayload) => void;
|
|
296
|
-
readonly serviceVariant:
|
|
366
|
+
readonly serviceVariant: MessageBubbleServiceVariant;
|
|
297
367
|
readonly id: import("./interface").MessageBubbleId;
|
|
298
368
|
readonly isOwn: boolean;
|
|
369
|
+
readonly markdown: boolean;
|
|
370
|
+
readonly markdownOptions: import("..").MarkdownOptions;
|
|
299
371
|
readonly timestamp: string | number | Date | (() => VNodeChild);
|
|
300
372
|
readonly attachments: MessageBubbleAttachment | MessageBubbleAttachment[];
|
|
301
373
|
readonly uploadProps: Partial<import("../..").UploadProps>;
|
|
@@ -27,12 +27,13 @@ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, gene
|
|
|
27
27
|
};
|
|
28
28
|
import { computed, defineComponent, Fragment, h, nextTick, ref } from 'vue';
|
|
29
29
|
import { useConfig, useTheme, useThemeClass } from "../../_mixins/index.mjs";
|
|
30
|
+
import { renderMarkdown } from "../../_utils/markdown/index.mjs";
|
|
30
31
|
import { UDropdown } from "../../dropdown/index.mjs";
|
|
31
32
|
import { UIcon } from "../../icon/index.mjs";
|
|
32
33
|
import { UText } from "../../typography/index.mjs";
|
|
33
34
|
import { UUpload, UUploadFileList } from "../../upload/index.mjs";
|
|
34
35
|
import { messageBubbleLight } from "../styles/index.mjs";
|
|
35
|
-
import { MessageBubbleAttachmentStatus, messageBubbleProps, MessageBubbleStatus, MessageBubbleType, statusIconMapper } from "./interface.mjs";
|
|
36
|
+
import { MessageBubbleAttachmentStatus, messageBubbleProps, MessageBubbleServiceVariant, MessageBubbleStatus, MessageBubbleType, statusIconMapper } from "./interface.mjs";
|
|
36
37
|
import style from "./styles/index.cssr.mjs";
|
|
37
38
|
export default defineComponent({
|
|
38
39
|
name: 'MessageBubble',
|
|
@@ -64,6 +65,18 @@ export default defineComponent({
|
|
|
64
65
|
status: props.status,
|
|
65
66
|
attachments: normalizedAttachmentsRef.value
|
|
66
67
|
}));
|
|
68
|
+
const markdownContent = computed(() => {
|
|
69
|
+
const content = props.content;
|
|
70
|
+
return props.markdown && typeof content === 'string' ? content : null;
|
|
71
|
+
});
|
|
72
|
+
const markdownActive = computed(() => markdownContent.value !== null);
|
|
73
|
+
const markdownHtmlRef = computed(() => {
|
|
74
|
+
if (!markdownContent.value) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
const html = renderMarkdown(markdownContent.value, props.markdownOptions);
|
|
78
|
+
return html.length > 0 ? html : null;
|
|
79
|
+
});
|
|
67
80
|
const cssVarsRef = computed(() => {
|
|
68
81
|
const {
|
|
69
82
|
common: {
|
|
@@ -85,7 +98,16 @@ export default defineComponent({
|
|
|
85
98
|
unreadNotificationTextColor,
|
|
86
99
|
serviceMessageTextColor,
|
|
87
100
|
serviceMessageBackgroundColor,
|
|
88
|
-
messageTitleColor
|
|
101
|
+
messageTitleColor,
|
|
102
|
+
markdownQuoteBorderColorOwn,
|
|
103
|
+
markdownQuoteBorderColorOther,
|
|
104
|
+
markdownQuoteTextColor,
|
|
105
|
+
markdownDividerColorOwn,
|
|
106
|
+
markdownDividerColorOther,
|
|
107
|
+
markdownH1FontSize,
|
|
108
|
+
markdownH2FontSize,
|
|
109
|
+
markdownH3FontSize,
|
|
110
|
+
markdownTextFontSize
|
|
89
111
|
}
|
|
90
112
|
} = themeRef.value;
|
|
91
113
|
return {
|
|
@@ -105,7 +127,16 @@ export default defineComponent({
|
|
|
105
127
|
'--u-message-bubble-unread-text-color': unreadNotificationTextColor,
|
|
106
128
|
'--u-message-bubble-service-text-color': serviceMessageTextColor,
|
|
107
129
|
'--u-message-bubble-service-background-color': serviceMessageBackgroundColor,
|
|
108
|
-
'--u-message-bubble-title-color': messageTitleColor
|
|
130
|
+
'--u-message-bubble-title-color': messageTitleColor,
|
|
131
|
+
'--u-message-bubble-markdown-quote-border-color-own': markdownQuoteBorderColorOwn,
|
|
132
|
+
'--u-message-bubble-markdown-quote-border-color-other': markdownQuoteBorderColorOther,
|
|
133
|
+
'--u-message-bubble-markdown-quote-text-color': markdownQuoteTextColor,
|
|
134
|
+
'--u-message-bubble-markdown-divider-color-own': markdownDividerColorOwn,
|
|
135
|
+
'--u-message-bubble-markdown-divider-color-other': markdownDividerColorOther,
|
|
136
|
+
'--u-message-bubble-markdown-h1-font-size': markdownH1FontSize,
|
|
137
|
+
'--u-message-bubble-markdown-h2-font-size': markdownH2FontSize,
|
|
138
|
+
'--u-message-bubble-markdown-h3-font-size': markdownH3FontSize,
|
|
139
|
+
'--u-message-bubble-markdown-text-font-size': markdownTextFontSize
|
|
109
140
|
};
|
|
110
141
|
});
|
|
111
142
|
const themeClassHandle = inlineThemeDisabled ? useThemeClass('message-bubble', undefined, cssVarsRef, props) : undefined;
|
|
@@ -248,15 +279,21 @@ export default defineComponent({
|
|
|
248
279
|
const hasTitle = Boolean(props.title || slots.title);
|
|
249
280
|
const afterContentSlot = slots.afterContent || slots['after-content'];
|
|
250
281
|
const hasAfterContent = Boolean(afterContentSlot);
|
|
251
|
-
const
|
|
282
|
+
const hasVisibleTextContent = markdownActive.value ? markdownHtmlRef.value !== null : Boolean(props.content);
|
|
283
|
+
const hasContentInsideBubble = Boolean(hasVisibleTextContent || slots.default || hasAfterContent || hasTitle || normalizedAttachmentsRef.value.length > 1);
|
|
252
284
|
const messageBubbleContent = hasContentInsideBubble ? h("div", {
|
|
253
285
|
class: [`${mergedClsPrefixRef.value}-message-bubble__bubble`, props.isOwn ? `${mergedClsPrefixRef.value}-message-bubble__bubble--own` : `${mergedClsPrefixRef.value}-message-bubble__bubble--other`]
|
|
254
286
|
}, hasTitle && h(UText, {
|
|
255
287
|
class: `${mergedClsPrefixRef.value}-message-bubble__title`,
|
|
256
288
|
variant: "body-l-semi-bold"
|
|
257
|
-
}, slots.title ? slots.title(messagePayloadRef.value) : resolveRenderContent(props.title)), normalizedAttachmentsRef.value.length > 0 && renderAttachment(true), (
|
|
289
|
+
}, slots.title ? slots.title(messagePayloadRef.value) : resolveRenderContent(props.title)), normalizedAttachmentsRef.value.length > 0 && renderAttachment(true), (hasVisibleTextContent || slots.default) && (slots.default ? h("div", {
|
|
290
|
+
class: `${mergedClsPrefixRef.value}-message-bubble__text`
|
|
291
|
+
}, slots.default(messagePayloadRef.value)) : markdownHtmlRef.value !== null ? h("div", {
|
|
292
|
+
class: [`${mergedClsPrefixRef.value}-message-bubble__text`, `${mergedClsPrefixRef.value}-message-bubble__markdown`],
|
|
293
|
+
innerHTML: markdownHtmlRef.value
|
|
294
|
+
}) : h("div", {
|
|
258
295
|
class: `${mergedClsPrefixRef.value}-message-bubble__text`
|
|
259
|
-
},
|
|
296
|
+
}, resolveRenderContent(props.content))), hasAfterContent && h("div", {
|
|
260
297
|
class: `${mergedClsPrefixRef.value}-message-bubble__after-content`
|
|
261
298
|
}, afterContentSlot === null || afterContentSlot === void 0 ? void 0 : afterContentSlot(messagePayloadRef.value))) : normalizedAttachmentsRef.value.length === 1 ? renderAttachment() : null;
|
|
262
299
|
return h("div", {
|
|
@@ -322,9 +359,14 @@ export default defineComponent({
|
|
|
322
359
|
if (slots.service) {
|
|
323
360
|
return slots.service(props.serviceVariant);
|
|
324
361
|
}
|
|
362
|
+
const isMarkdownEligibleVariant = props.serviceVariant === MessageBubbleServiceVariant.SYSTEM || props.serviceVariant === MessageBubbleServiceVariant.EVENT;
|
|
363
|
+
const displayMarkdown = markdownActive.value && isMarkdownEligibleVariant;
|
|
325
364
|
return h("div", {
|
|
326
365
|
class: [`${mergedClsPrefixRef.value}-message-bubble__service`, `${mergedClsPrefixRef.value}-message-bubble__service--${props.serviceVariant}`]
|
|
327
|
-
},
|
|
366
|
+
}, displayMarkdown ? markdownHtmlRef.value && h("span", {
|
|
367
|
+
class: `${mergedClsPrefixRef.value}-message-bubble__markdown`,
|
|
368
|
+
innerHTML: markdownHtmlRef.value
|
|
369
|
+
}) : props.content && h("span", null, resolveRenderContent(props.content)));
|
|
328
370
|
};
|
|
329
371
|
return {
|
|
330
372
|
mergedClsPrefixRef,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Component, PropType, VNodeChild } from 'vue';
|
|
2
2
|
import type { ExtractPublicPropTypes } from '../../_utils';
|
|
3
|
+
import type { MarkdownOptions } from '../../_utils/markdown';
|
|
3
4
|
import type { UploadFileInfo, UploadProps } from '../../upload';
|
|
4
5
|
export declare enum MessageBubbleType {
|
|
5
6
|
MESSAGE = "message",
|
|
@@ -90,6 +91,14 @@ export declare const messageBubbleProps: {
|
|
|
90
91
|
readonly type: PropType<MessageBubbleRenderContent>;
|
|
91
92
|
readonly default: undefined;
|
|
92
93
|
};
|
|
94
|
+
readonly markdown: {
|
|
95
|
+
readonly type: BooleanConstructor;
|
|
96
|
+
readonly default: false;
|
|
97
|
+
};
|
|
98
|
+
readonly markdownOptions: {
|
|
99
|
+
readonly type: PropType<MarkdownOptions>;
|
|
100
|
+
readonly default: undefined;
|
|
101
|
+
};
|
|
93
102
|
readonly timestamp: {
|
|
94
103
|
readonly type: PropType<string | number | Date | (() => VNodeChild)>;
|
|
95
104
|
readonly default: undefined;
|
|
@@ -139,6 +148,15 @@ export declare const messageBubbleProps: {
|
|
|
139
148
|
serviceMessageTextColor: string;
|
|
140
149
|
serviceMessageBackgroundColor: string;
|
|
141
150
|
messageTitleColor: string;
|
|
151
|
+
markdownQuoteBorderColorOwn: string;
|
|
152
|
+
markdownQuoteBorderColorOther: string;
|
|
153
|
+
markdownQuoteTextColor: string;
|
|
154
|
+
markdownDividerColorOwn: string;
|
|
155
|
+
markdownDividerColorOther: string;
|
|
156
|
+
markdownH1FontSize: string;
|
|
157
|
+
markdownH2FontSize: string;
|
|
158
|
+
markdownH3FontSize: string;
|
|
159
|
+
markdownTextFontSize: string;
|
|
142
160
|
}, {
|
|
143
161
|
StatusIcon: import("../../_mixins").Theme<"Icon", {
|
|
144
162
|
color: string;
|
|
@@ -166,6 +184,15 @@ export declare const messageBubbleProps: {
|
|
|
166
184
|
serviceMessageTextColor: string;
|
|
167
185
|
serviceMessageBackgroundColor: string;
|
|
168
186
|
messageTitleColor: string;
|
|
187
|
+
markdownQuoteBorderColorOwn: string;
|
|
188
|
+
markdownQuoteBorderColorOther: string;
|
|
189
|
+
markdownQuoteTextColor: string;
|
|
190
|
+
markdownDividerColorOwn: string;
|
|
191
|
+
markdownDividerColorOther: string;
|
|
192
|
+
markdownH1FontSize: string;
|
|
193
|
+
markdownH2FontSize: string;
|
|
194
|
+
markdownH3FontSize: string;
|
|
195
|
+
markdownTextFontSize: string;
|
|
169
196
|
}, {
|
|
170
197
|
StatusIcon: import("../../_mixins").Theme<"Icon", {
|
|
171
198
|
color: string;
|
|
@@ -193,6 +220,15 @@ export declare const messageBubbleProps: {
|
|
|
193
220
|
serviceMessageTextColor: string;
|
|
194
221
|
serviceMessageBackgroundColor: string;
|
|
195
222
|
messageTitleColor: string;
|
|
223
|
+
markdownQuoteBorderColorOwn: string;
|
|
224
|
+
markdownQuoteBorderColorOther: string;
|
|
225
|
+
markdownQuoteTextColor: string;
|
|
226
|
+
markdownDividerColorOwn: string;
|
|
227
|
+
markdownDividerColorOther: string;
|
|
228
|
+
markdownH1FontSize: string;
|
|
229
|
+
markdownH2FontSize: string;
|
|
230
|
+
markdownH3FontSize: string;
|
|
231
|
+
markdownTextFontSize: string;
|
|
196
232
|
}, {
|
|
197
233
|
StatusIcon: import("../../_mixins").Theme<"Icon", {
|
|
198
234
|
color: string;
|
|
@@ -57,6 +57,14 @@ export const messageBubbleProps = Object.assign(Object.assign({}, useTheme.props
|
|
|
57
57
|
type: [String, Function],
|
|
58
58
|
default: undefined
|
|
59
59
|
},
|
|
60
|
+
markdown: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: false
|
|
63
|
+
},
|
|
64
|
+
markdownOptions: {
|
|
65
|
+
type: Object,
|
|
66
|
+
default: undefined
|
|
67
|
+
},
|
|
60
68
|
timestamp: {
|
|
61
69
|
type: [String, Number, Date, Function],
|
|
62
70
|
default: undefined
|
|
@@ -17,6 +17,15 @@ import { c, cB, cE, cM } from "../../../_utils/cssr/index.mjs";
|
|
|
17
17
|
// --u-message-bubble-service-text-color
|
|
18
18
|
// --u-message-bubble-service-background-color
|
|
19
19
|
// --u-message-bubble-title-color
|
|
20
|
+
// --u-message-bubble-markdown-quote-border-color-own
|
|
21
|
+
// --u-message-bubble-markdown-quote-border-color-other
|
|
22
|
+
// --u-message-bubble-markdown-quote-text-color
|
|
23
|
+
// --u-message-bubble-markdown-divider-color-own
|
|
24
|
+
// --u-message-bubble-markdown-divider-color-other
|
|
25
|
+
// --u-message-bubble-markdown-h1-font-size
|
|
26
|
+
// --u-message-bubble-markdown-h2-font-size
|
|
27
|
+
// --u-message-bubble-markdown-h3-font-size
|
|
28
|
+
// --u-message-bubble-markdown-text-font-size
|
|
20
29
|
export default cB('message-bubble', `
|
|
21
30
|
box-sizing: border-box;
|
|
22
31
|
width: 100%;
|
|
@@ -52,17 +61,24 @@ export default cB('message-bubble', `
|
|
|
52
61
|
flex-direction: column;
|
|
53
62
|
padding: 12px;
|
|
54
63
|
gap: 12px;
|
|
64
|
+
--u-message-bubble-markdown-quote-border-color: var(--u-message-bubble-markdown-quote-border-color-other);
|
|
65
|
+
--u-message-bubble-markdown-divider-color: var(--u-message-bubble-markdown-divider-color-other);
|
|
55
66
|
`, [cM('own', `
|
|
56
67
|
background-color: var(--u-message-bubble-background-color-own);
|
|
57
68
|
color: var(--u-message-bubble-text-color-own);
|
|
58
69
|
border-bottom-left-radius: var(--u-message-bubble-border-radius);
|
|
59
70
|
border-bottom-right-radius: 6px;
|
|
71
|
+
--u-message-bubble-markdown-quote-border-color: var(--u-message-bubble-markdown-quote-border-color-own);
|
|
72
|
+
--u-message-bubble-markdown-divider-color: var(--u-message-bubble-markdown-divider-color-own);
|
|
60
73
|
`)]), cE('title', `
|
|
61
74
|
color: var(--u-message-bubble-title-color);
|
|
62
75
|
white-space: pre-wrap;
|
|
63
76
|
`), cE('text', `
|
|
64
77
|
white-space: pre-wrap;
|
|
65
|
-
`), cE('
|
|
78
|
+
`), cE('markdown', `
|
|
79
|
+
white-space: normal;
|
|
80
|
+
font-size: var(--u-message-bubble-markdown-text-font-size);
|
|
81
|
+
`, [c('h1', 'font-size: var(--u-message-bubble-markdown-h1-font-size);'), c('h2', 'font-size: var(--u-message-bubble-markdown-h2-font-size);'), c('h3', 'font-size: var(--u-message-bubble-markdown-h3-font-size);'), c('& > *:first-child', 'margin-top: 0;'), c('& > *:last-child', 'margin-bottom: 0;')]), cE('after-content', `
|
|
66
82
|
white-space: normal;
|
|
67
83
|
`), cE('meta', `
|
|
68
84
|
display: flex;
|
|
@@ -15,6 +15,15 @@ declare const messageBubbleDark: import("../../_mixins").Theme<"MessageBubble",
|
|
|
15
15
|
serviceMessageTextColor: string;
|
|
16
16
|
serviceMessageBackgroundColor: string;
|
|
17
17
|
messageTitleColor: string;
|
|
18
|
+
markdownQuoteBorderColorOwn: string;
|
|
19
|
+
markdownQuoteBorderColorOther: string;
|
|
20
|
+
markdownQuoteTextColor: string;
|
|
21
|
+
markdownDividerColorOwn: string;
|
|
22
|
+
markdownDividerColorOther: string;
|
|
23
|
+
markdownH1FontSize: string;
|
|
24
|
+
markdownH2FontSize: string;
|
|
25
|
+
markdownH3FontSize: string;
|
|
26
|
+
markdownTextFontSize: string;
|
|
18
27
|
}, {
|
|
19
28
|
StatusIcon: import("../../_mixins").Theme<"Icon", {
|
|
20
29
|
color: string;
|
|
@@ -16,6 +16,15 @@ export declare function self(vars: ThemeCommonVars): {
|
|
|
16
16
|
serviceMessageTextColor: string;
|
|
17
17
|
serviceMessageBackgroundColor: string;
|
|
18
18
|
messageTitleColor: string;
|
|
19
|
+
markdownQuoteBorderColorOwn: string;
|
|
20
|
+
markdownQuoteBorderColorOther: string;
|
|
21
|
+
markdownQuoteTextColor: string;
|
|
22
|
+
markdownDividerColorOwn: string;
|
|
23
|
+
markdownDividerColorOther: string;
|
|
24
|
+
markdownH1FontSize: string;
|
|
25
|
+
markdownH2FontSize: string;
|
|
26
|
+
markdownH3FontSize: string;
|
|
27
|
+
markdownTextFontSize: string;
|
|
19
28
|
};
|
|
20
29
|
declare const messageBubbleLight: import("../../_mixins").Theme<"MessageBubble", {
|
|
21
30
|
messageBubbleBackgroundColorOwn: string;
|
|
@@ -34,6 +43,15 @@ declare const messageBubbleLight: import("../../_mixins").Theme<"MessageBubble",
|
|
|
34
43
|
serviceMessageTextColor: string;
|
|
35
44
|
serviceMessageBackgroundColor: string;
|
|
36
45
|
messageTitleColor: string;
|
|
46
|
+
markdownQuoteBorderColorOwn: string;
|
|
47
|
+
markdownQuoteBorderColorOther: string;
|
|
48
|
+
markdownQuoteTextColor: string;
|
|
49
|
+
markdownDividerColorOwn: string;
|
|
50
|
+
markdownDividerColorOther: string;
|
|
51
|
+
markdownH1FontSize: string;
|
|
52
|
+
markdownH2FontSize: string;
|
|
53
|
+
markdownH3FontSize: string;
|
|
54
|
+
markdownTextFontSize: string;
|
|
37
55
|
}, {
|
|
38
56
|
StatusIcon: import("../../_mixins").Theme<"Icon", {
|
|
39
57
|
color: string;
|
|
@@ -30,7 +30,16 @@ export function self(vars) {
|
|
|
30
30
|
unreadNotificationTextColor: elementsSecondary,
|
|
31
31
|
serviceMessageTextColor: textSecondary,
|
|
32
32
|
serviceMessageBackgroundColor: 'transparent',
|
|
33
|
-
messageTitleColor: textPrimary
|
|
33
|
+
messageTitleColor: textPrimary,
|
|
34
|
+
markdownQuoteBorderColorOwn: textPrimary,
|
|
35
|
+
markdownQuoteBorderColorOther: textPrimary,
|
|
36
|
+
markdownQuoteTextColor: textSecondary,
|
|
37
|
+
markdownDividerColorOwn: textPrimary,
|
|
38
|
+
markdownDividerColorOther: textPrimary,
|
|
39
|
+
markdownH1FontSize: '20px',
|
|
40
|
+
markdownH2FontSize: '18px',
|
|
41
|
+
markdownH3FontSize: '16px',
|
|
42
|
+
markdownTextFontSize: '14px'
|
|
34
43
|
};
|
|
35
44
|
}
|
|
36
45
|
const messageBubbleLight = createTheme({
|
package/es/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "2.3.
|
|
1
|
+
declare const _default: "2.3.6";
|
|
2
2
|
export default _default;
|
package/es/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '2.3.
|
|
1
|
+
export default '2.3.6';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { MarkdownFeature } from '@uzum-tech/ui';
|
|
2
|
+
export declare const HTML_COMMENT_REGEX: RegExp;
|
|
3
|
+
export declare const HTML_CDATA_REGEX: RegExp;
|
|
4
|
+
export declare const HTML_RAW_BLOCK_REGEX: RegExp;
|
|
5
|
+
export declare const HTML_DECLARATION_REGEX: RegExp;
|
|
6
|
+
export declare const HTML_TAG_REGEX: RegExp;
|
|
7
|
+
export declare const ANY_HTML_TAG_REGEX: RegExp;
|
|
8
|
+
export declare const WHITESPACE_REGEX: RegExp;
|
|
9
|
+
export declare const MAX_HEADING_LEVEL = 3;
|
|
10
|
+
export declare const MAX_DIVIDER_INDENT = 4;
|
|
11
|
+
export declare const MIN_DIVIDER_MARKERS = 3;
|
|
12
|
+
export declare const EMPTY_BLOCK_TOKEN_COUNT = 3;
|
|
13
|
+
export declare const CHAR_CODES: {
|
|
14
|
+
TILDE: number;
|
|
15
|
+
EQUALS: number;
|
|
16
|
+
SPACE: number;
|
|
17
|
+
TAB: number;
|
|
18
|
+
};
|
|
19
|
+
export declare const HTML_ENTITY_REPLACEMENTS: Array<[RegExp, string]>;
|
|
20
|
+
export declare const ALL_MARKDOWN_FEATURES: MarkdownFeature[];
|
|
21
|
+
export declare const INVISIBLE_INLINE_TOKEN_TYPES: string[];
|
|
22
|
+
export declare const MARKDOWN_SYMBOL: {
|
|
23
|
+
TILDE: string;
|
|
24
|
+
STRIKETHROUGH_TAG: string;
|
|
25
|
+
PARAGRAPH_TAG: string;
|
|
26
|
+
NEWLINE: string;
|
|
27
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MARKDOWN_SYMBOL = exports.INVISIBLE_INLINE_TOKEN_TYPES = exports.ALL_MARKDOWN_FEATURES = exports.HTML_ENTITY_REPLACEMENTS = exports.CHAR_CODES = exports.EMPTY_BLOCK_TOKEN_COUNT = exports.MIN_DIVIDER_MARKERS = exports.MAX_DIVIDER_INDENT = exports.MAX_HEADING_LEVEL = exports.WHITESPACE_REGEX = exports.ANY_HTML_TAG_REGEX = exports.HTML_TAG_REGEX = exports.HTML_DECLARATION_REGEX = exports.HTML_RAW_BLOCK_REGEX = exports.HTML_CDATA_REGEX = exports.HTML_COMMENT_REGEX = void 0;
|
|
4
|
+
exports.HTML_COMMENT_REGEX = /<!--[\s\S]*?-->/g;
|
|
5
|
+
exports.HTML_CDATA_REGEX = /<!\[CDATA\[[\s\S]*?\]\]>/g;
|
|
6
|
+
exports.HTML_RAW_BLOCK_REGEX = /<(script|style|iframe|object|embed|template|svg|math|noscript)\b[^>]*>[\s\S]*?<\/\1\s*>/gi;
|
|
7
|
+
exports.HTML_DECLARATION_REGEX = /<[!?][^>]*>/g;
|
|
8
|
+
exports.HTML_TAG_REGEX = /<\/?[a-z][\w:-]*(?:\s[^<>]*)?\/?>/gi;
|
|
9
|
+
exports.ANY_HTML_TAG_REGEX = /<[^>]*>/g;
|
|
10
|
+
exports.WHITESPACE_REGEX = /\s+/g;
|
|
11
|
+
exports.MAX_HEADING_LEVEL = 3;
|
|
12
|
+
exports.MAX_DIVIDER_INDENT = 4;
|
|
13
|
+
exports.MIN_DIVIDER_MARKERS = 3;
|
|
14
|
+
exports.EMPTY_BLOCK_TOKEN_COUNT = 3;
|
|
15
|
+
exports.CHAR_CODES = {
|
|
16
|
+
TILDE: 0x7E,
|
|
17
|
+
EQUALS: 0x3D,
|
|
18
|
+
SPACE: 0x20,
|
|
19
|
+
TAB: 0x09
|
|
20
|
+
};
|
|
21
|
+
exports.HTML_ENTITY_REPLACEMENTS = [
|
|
22
|
+
[/</g, '<'],
|
|
23
|
+
[/>/g, '>'],
|
|
24
|
+
[/"/g, '"'],
|
|
25
|
+
[/&/g, '&']
|
|
26
|
+
];
|
|
27
|
+
exports.ALL_MARKDOWN_FEATURES = [
|
|
28
|
+
'bold',
|
|
29
|
+
'italic',
|
|
30
|
+
'strikethrough',
|
|
31
|
+
'heading',
|
|
32
|
+
'orderedList',
|
|
33
|
+
'bulletList',
|
|
34
|
+
'blockquote',
|
|
35
|
+
'divider'
|
|
36
|
+
];
|
|
37
|
+
exports.INVISIBLE_INLINE_TOKEN_TYPES = [
|
|
38
|
+
'softbreak',
|
|
39
|
+
'hardbreak',
|
|
40
|
+
'image',
|
|
41
|
+
'link_open',
|
|
42
|
+
'link_close',
|
|
43
|
+
'strong_open',
|
|
44
|
+
'strong_close',
|
|
45
|
+
'em_open',
|
|
46
|
+
'em_close',
|
|
47
|
+
's_open',
|
|
48
|
+
's_close'
|
|
49
|
+
];
|
|
50
|
+
exports.MARKDOWN_SYMBOL = {
|
|
51
|
+
TILDE: '~',
|
|
52
|
+
STRIKETHROUGH_TAG: 's',
|
|
53
|
+
PARAGRAPH_TAG: 'p',
|
|
54
|
+
NEWLINE: '\n'
|
|
55
|
+
};
|