@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
|
@@ -12,9 +12,6 @@ export interface ImageRenderToolbarProps {
|
|
|
12
12
|
close: VNode;
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
export type ImageRenderToolbar = (props: ImageRenderToolbarProps) => VNodeChild;
|
|
16
|
-
export type ImageGroupRenderToolbarProps = ImageRenderToolbarProps;
|
|
17
|
-
export type ImageGroupRenderToolbar = ImageRenderToolbar;
|
|
18
15
|
export interface ImageInst {
|
|
19
16
|
/** @deprecated Use `showPreview` instead */
|
|
20
17
|
click: () => void;
|
|
@@ -24,8 +21,17 @@ export interface ImageSlots {
|
|
|
24
21
|
placeholder?: ImagePlaceholderSlot;
|
|
25
22
|
error?: ImageErrorSlot;
|
|
26
23
|
}
|
|
27
|
-
export type ImagePlaceholderSlot = () => VNode[];
|
|
28
|
-
export type ImageErrorSlot = () => VNode[];
|
|
29
24
|
export interface ImagePreviewInst {
|
|
30
25
|
setThumbnailEl: (e: HTMLImageElement | null) => void;
|
|
31
26
|
}
|
|
27
|
+
export interface ImagePreviewSlots {
|
|
28
|
+
default?: () => VNode[];
|
|
29
|
+
'spin-default'?: () => VNode[];
|
|
30
|
+
'spin-icon'?: () => VNode[];
|
|
31
|
+
'spin-description'?: () => VNode[];
|
|
32
|
+
}
|
|
33
|
+
export type ImageRenderToolbar = (props: ImageRenderToolbarProps) => VNodeChild;
|
|
34
|
+
export type ImageGroupRenderToolbarProps = ImageRenderToolbarProps;
|
|
35
|
+
export type ImageGroupRenderToolbar = ImageRenderToolbar;
|
|
36
|
+
export type ImagePlaceholderSlot = () => VNode[];
|
|
37
|
+
export type ImageErrorSlot = () => VNode[];
|
|
@@ -46,7 +46,17 @@ exports.default = (0, cssr_1.c)([(0, cssr_1.c)('body >', [(0, cssr_1.cB)('image-
|
|
|
46
46
|
padding: 0 8px;
|
|
47
47
|
font-size: 28px;
|
|
48
48
|
cursor: pointer;
|
|
49
|
-
`), (0, fade_in_cssr_1.fadeInTransition)()]), (0, cssr_1.cB)('image-preview-
|
|
49
|
+
`), (0, fade_in_cssr_1.fadeInTransition)()]), (0, cssr_1.cB)('image-preview-loading', `
|
|
50
|
+
position: absolute;
|
|
51
|
+
left: 0;
|
|
52
|
+
right: 0;
|
|
53
|
+
top: 0;
|
|
54
|
+
bottom: 0;
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
pointer-events: none;
|
|
59
|
+
`), (0, cssr_1.cB)('image-preview-wrapper', `
|
|
50
60
|
position: absolute;
|
|
51
61
|
left: 0;
|
|
52
62
|
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("../../_utils/markdown").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("../../_utils/markdown").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("../../_utils/markdown").MarkdownOptions;
|
|
299
371
|
readonly timestamp: string | number | Date | (() => VNodeChild);
|
|
300
372
|
readonly attachments: MessageBubbleAttachment | MessageBubbleAttachment[];
|
|
301
373
|
readonly uploadProps: Partial<import("../../upload").UploadProps>;
|
|
@@ -14,6 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const vue_1 = require("vue");
|
|
16
16
|
const _mixins_1 = require("../../_mixins");
|
|
17
|
+
const markdown_1 = require("../../_utils/markdown");
|
|
17
18
|
const dropdown_1 = require("../../dropdown");
|
|
18
19
|
const icon_1 = require("../../icon");
|
|
19
20
|
const typography_1 = require("../../typography");
|
|
@@ -46,8 +47,20 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
46
47
|
status: props.status,
|
|
47
48
|
attachments: normalizedAttachmentsRef.value
|
|
48
49
|
}));
|
|
50
|
+
const markdownContent = (0, vue_1.computed)(() => {
|
|
51
|
+
const content = props.content;
|
|
52
|
+
return props.markdown && typeof content === 'string' ? content : null;
|
|
53
|
+
});
|
|
54
|
+
const markdownActive = (0, vue_1.computed)(() => markdownContent.value !== null);
|
|
55
|
+
const markdownHtmlRef = (0, vue_1.computed)(() => {
|
|
56
|
+
if (!markdownContent.value) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
const html = (0, markdown_1.renderMarkdown)(markdownContent.value, props.markdownOptions);
|
|
60
|
+
return html.length > 0 ? html : null;
|
|
61
|
+
});
|
|
49
62
|
const cssVarsRef = (0, vue_1.computed)(() => {
|
|
50
|
-
const { common: { cubicBezierEaseInOut }, self: { messageBubbleBackgroundColorOwn, messageBubbleBackgroundColorOther, messageBubbleTextColorOwn, messageBubbleTextColorOther, messageTimeColor, messageStatusReadColor, messageStatusSuccessColor, attachmentBackgroundColorOwn, attachmentBackgroundColorOther, messageErrorColor, messageBorderRadius, unreadNotificationBackgroundColor, unreadNotificationTextColor, serviceMessageTextColor, serviceMessageBackgroundColor, messageTitleColor } } = themeRef.value;
|
|
63
|
+
const { common: { cubicBezierEaseInOut }, self: { messageBubbleBackgroundColorOwn, messageBubbleBackgroundColorOther, messageBubbleTextColorOwn, messageBubbleTextColorOther, messageTimeColor, messageStatusReadColor, messageStatusSuccessColor, attachmentBackgroundColorOwn, attachmentBackgroundColorOther, messageErrorColor, messageBorderRadius, unreadNotificationBackgroundColor, unreadNotificationTextColor, serviceMessageTextColor, serviceMessageBackgroundColor, messageTitleColor, markdownQuoteBorderColorOwn, markdownQuoteBorderColorOther, markdownQuoteTextColor, markdownDividerColorOwn, markdownDividerColorOther, markdownH1FontSize, markdownH2FontSize, markdownH3FontSize, markdownTextFontSize } } = themeRef.value;
|
|
51
64
|
return {
|
|
52
65
|
'--u-bezier': cubicBezierEaseInOut,
|
|
53
66
|
'--u-message-bubble-background-color-own': messageBubbleBackgroundColorOwn,
|
|
@@ -65,7 +78,16 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
65
78
|
'--u-message-bubble-unread-text-color': unreadNotificationTextColor,
|
|
66
79
|
'--u-message-bubble-service-text-color': serviceMessageTextColor,
|
|
67
80
|
'--u-message-bubble-service-background-color': serviceMessageBackgroundColor,
|
|
68
|
-
'--u-message-bubble-title-color': messageTitleColor
|
|
81
|
+
'--u-message-bubble-title-color': messageTitleColor,
|
|
82
|
+
'--u-message-bubble-markdown-quote-border-color-own': markdownQuoteBorderColorOwn,
|
|
83
|
+
'--u-message-bubble-markdown-quote-border-color-other': markdownQuoteBorderColorOther,
|
|
84
|
+
'--u-message-bubble-markdown-quote-text-color': markdownQuoteTextColor,
|
|
85
|
+
'--u-message-bubble-markdown-divider-color-own': markdownDividerColorOwn,
|
|
86
|
+
'--u-message-bubble-markdown-divider-color-other': markdownDividerColorOther,
|
|
87
|
+
'--u-message-bubble-markdown-h1-font-size': markdownH1FontSize,
|
|
88
|
+
'--u-message-bubble-markdown-h2-font-size': markdownH2FontSize,
|
|
89
|
+
'--u-message-bubble-markdown-h3-font-size': markdownH3FontSize,
|
|
90
|
+
'--u-message-bubble-markdown-text-font-size': markdownTextFontSize
|
|
69
91
|
};
|
|
70
92
|
});
|
|
71
93
|
const themeClassHandle = inlineThemeDisabled
|
|
@@ -189,7 +211,10 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
189
211
|
const hasTitle = Boolean(props.title || slots.title);
|
|
190
212
|
const afterContentSlot = slots.afterContent || slots['after-content'];
|
|
191
213
|
const hasAfterContent = Boolean(afterContentSlot);
|
|
192
|
-
const
|
|
214
|
+
const hasVisibleTextContent = markdownActive.value
|
|
215
|
+
? markdownHtmlRef.value !== null
|
|
216
|
+
: Boolean(props.content);
|
|
217
|
+
const hasContentInsideBubble = Boolean(hasVisibleTextContent
|
|
193
218
|
|| slots.default
|
|
194
219
|
|| hasAfterContent
|
|
195
220
|
|| hasTitle
|
|
@@ -204,9 +229,11 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
204
229
|
? slots.title(messagePayloadRef.value)
|
|
205
230
|
: resolveRenderContent(props.title))),
|
|
206
231
|
normalizedAttachmentsRef.value.length > 0 && renderAttachment(true),
|
|
207
|
-
(
|
|
208
|
-
? slots.default(messagePayloadRef.value)
|
|
209
|
-
|
|
232
|
+
(hasVisibleTextContent || slots.default)
|
|
233
|
+
&& (slots.default ? ((0, vue_1.h)("div", { class: `${mergedClsPrefixRef.value}-message-bubble__text` }, slots.default(messagePayloadRef.value))) : markdownHtmlRef.value !== null ? ((0, vue_1.h)("div", { class: [
|
|
234
|
+
`${mergedClsPrefixRef.value}-message-bubble__text`,
|
|
235
|
+
`${mergedClsPrefixRef.value}-message-bubble__markdown`
|
|
236
|
+
], innerHTML: markdownHtmlRef.value })) : ((0, vue_1.h)("div", { class: `${mergedClsPrefixRef.value}-message-bubble__text` }, resolveRenderContent(props.content)))),
|
|
210
237
|
hasAfterContent && ((0, vue_1.h)("div", { class: `${mergedClsPrefixRef.value}-message-bubble__after-content` }, afterContentSlot === null || afterContentSlot === void 0 ? void 0 : afterContentSlot(messagePayloadRef.value))))) : normalizedAttachmentsRef.value.length === 1 ? (renderAttachment()) : null;
|
|
211
238
|
return ((0, vue_1.h)("div", { class: [
|
|
212
239
|
`${mergedClsPrefixRef.value}-message-bubble__message`,
|
|
@@ -261,10 +288,15 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
261
288
|
if (slots.service) {
|
|
262
289
|
return slots.service(props.serviceVariant);
|
|
263
290
|
}
|
|
291
|
+
const isMarkdownEligibleVariant = props.serviceVariant === interface_1.MessageBubbleServiceVariant.SYSTEM
|
|
292
|
+
|| props.serviceVariant === interface_1.MessageBubbleServiceVariant.EVENT;
|
|
293
|
+
const displayMarkdown = markdownActive.value && isMarkdownEligibleVariant;
|
|
264
294
|
return ((0, vue_1.h)("div", { class: [
|
|
265
295
|
`${mergedClsPrefixRef.value}-message-bubble__service`,
|
|
266
296
|
`${mergedClsPrefixRef.value}-message-bubble__service--${props.serviceVariant}`
|
|
267
|
-
] },
|
|
297
|
+
] }, displayMarkdown
|
|
298
|
+
? markdownHtmlRef.value && ((0, vue_1.h)("span", { class: `${mergedClsPrefixRef.value}-message-bubble__markdown`, innerHTML: markdownHtmlRef.value }))
|
|
299
|
+
: props.content && ((0, vue_1.h)("span", null, resolveRenderContent(props.content)))));
|
|
268
300
|
};
|
|
269
301
|
return {
|
|
270
302
|
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;
|
|
@@ -53,6 +53,12 @@ exports.messageBubbleProps = Object.assign(Object.assign({}, _mixins_1.useTheme.
|
|
|
53
53
|
}, content: {
|
|
54
54
|
type: [String, Function],
|
|
55
55
|
default: undefined
|
|
56
|
+
}, markdown: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: false
|
|
59
|
+
}, markdownOptions: {
|
|
60
|
+
type: Object,
|
|
61
|
+
default: undefined
|
|
56
62
|
}, timestamp: {
|
|
57
63
|
type: [String, Number, Date, Function],
|
|
58
64
|
default: undefined
|
|
@@ -22,6 +22,15 @@ const cssr_1 = require("../../../_utils/cssr");
|
|
|
22
22
|
// --u-message-bubble-service-text-color
|
|
23
23
|
// --u-message-bubble-service-background-color
|
|
24
24
|
// --u-message-bubble-title-color
|
|
25
|
+
// --u-message-bubble-markdown-quote-border-color-own
|
|
26
|
+
// --u-message-bubble-markdown-quote-border-color-other
|
|
27
|
+
// --u-message-bubble-markdown-quote-text-color
|
|
28
|
+
// --u-message-bubble-markdown-divider-color-own
|
|
29
|
+
// --u-message-bubble-markdown-divider-color-other
|
|
30
|
+
// --u-message-bubble-markdown-h1-font-size
|
|
31
|
+
// --u-message-bubble-markdown-h2-font-size
|
|
32
|
+
// --u-message-bubble-markdown-h3-font-size
|
|
33
|
+
// --u-message-bubble-markdown-text-font-size
|
|
25
34
|
exports.default = (0, cssr_1.cB)('message-bubble', `
|
|
26
35
|
box-sizing: border-box;
|
|
27
36
|
width: 100%;
|
|
@@ -57,17 +66,24 @@ exports.default = (0, cssr_1.cB)('message-bubble', `
|
|
|
57
66
|
flex-direction: column;
|
|
58
67
|
padding: 12px;
|
|
59
68
|
gap: 12px;
|
|
69
|
+
--u-message-bubble-markdown-quote-border-color: var(--u-message-bubble-markdown-quote-border-color-other);
|
|
70
|
+
--u-message-bubble-markdown-divider-color: var(--u-message-bubble-markdown-divider-color-other);
|
|
60
71
|
`, [(0, cssr_1.cM)('own', `
|
|
61
72
|
background-color: var(--u-message-bubble-background-color-own);
|
|
62
73
|
color: var(--u-message-bubble-text-color-own);
|
|
63
74
|
border-bottom-left-radius: var(--u-message-bubble-border-radius);
|
|
64
75
|
border-bottom-right-radius: 6px;
|
|
76
|
+
--u-message-bubble-markdown-quote-border-color: var(--u-message-bubble-markdown-quote-border-color-own);
|
|
77
|
+
--u-message-bubble-markdown-divider-color: var(--u-message-bubble-markdown-divider-color-own);
|
|
65
78
|
`)]), (0, cssr_1.cE)('title', `
|
|
66
79
|
color: var(--u-message-bubble-title-color);
|
|
67
80
|
white-space: pre-wrap;
|
|
68
81
|
`), (0, cssr_1.cE)('text', `
|
|
69
82
|
white-space: pre-wrap;
|
|
70
|
-
`), (0, cssr_1.cE)('
|
|
83
|
+
`), (0, cssr_1.cE)('markdown', `
|
|
84
|
+
white-space: normal;
|
|
85
|
+
font-size: var(--u-message-bubble-markdown-text-font-size);
|
|
86
|
+
`, [(0, cssr_1.c)('h1', 'font-size: var(--u-message-bubble-markdown-h1-font-size);'), (0, cssr_1.c)('h2', 'font-size: var(--u-message-bubble-markdown-h2-font-size);'), (0, cssr_1.c)('h3', 'font-size: var(--u-message-bubble-markdown-h3-font-size);'), (0, cssr_1.c)('& > *:first-child', 'margin-top: 0;'), (0, cssr_1.c)('& > *:last-child', 'margin-bottom: 0;')]), (0, cssr_1.cE)('after-content', `
|
|
71
87
|
white-space: normal;
|
|
72
88
|
`), (0, cssr_1.cE)('meta', `
|
|
73
89
|
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;
|
|
@@ -22,7 +22,16 @@ function self(vars) {
|
|
|
22
22
|
unreadNotificationTextColor: elementsSecondary,
|
|
23
23
|
serviceMessageTextColor: textSecondary,
|
|
24
24
|
serviceMessageBackgroundColor: 'transparent',
|
|
25
|
-
messageTitleColor: textPrimary
|
|
25
|
+
messageTitleColor: textPrimary,
|
|
26
|
+
markdownQuoteBorderColorOwn: textPrimary,
|
|
27
|
+
markdownQuoteBorderColorOther: textPrimary,
|
|
28
|
+
markdownQuoteTextColor: textSecondary,
|
|
29
|
+
markdownDividerColorOwn: textPrimary,
|
|
30
|
+
markdownDividerColorOther: textPrimary,
|
|
31
|
+
markdownH1FontSize: '20px',
|
|
32
|
+
markdownH2FontSize: '18px',
|
|
33
|
+
markdownH3FontSize: '16px',
|
|
34
|
+
markdownTextFontSize: '14px'
|
|
26
35
|
};
|
|
27
36
|
}
|
|
28
37
|
const messageBubbleLight = (0, _mixins_1.createTheme)({
|
package/lib/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/lib/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uzum-tech/ui",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.6",
|
|
4
4
|
"packageManager": "pnpm@10.33.0",
|
|
5
5
|
"description": "A Vue 3 Component Library. Fairly Complete, Theme Customizable, Uses TypeScript, Fast",
|
|
6
6
|
"author": {
|
|
@@ -116,6 +116,7 @@
|
|
|
116
116
|
"highlight.js": "11.11.1",
|
|
117
117
|
"lodash": "4.18.1",
|
|
118
118
|
"lodash-es": "4.18.1",
|
|
119
|
+
"markdown-it": "15.0.0",
|
|
119
120
|
"seemly": "0.3.10",
|
|
120
121
|
"treemate": "0.3.11",
|
|
121
122
|
"vdirs": "0.1.8",
|