@uzum-tech/ui 2.4.0 → 2.4.2
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 +173 -76
- package/dist/index.mjs +174 -77
- package/dist/index.prod.js +3 -3
- package/dist/index.prod.mjs +3 -3
- package/es/_utils/index.d.ts +1 -1
- package/es/_utils/index.mjs +1 -1
- package/es/_utils/markdown/constants.d.ts +1 -0
- package/es/_utils/markdown/constants.mjs +1 -0
- package/es/_utils/markdown/index.d.ts +1 -1
- package/es/_utils/markdown/index.mjs +1 -1
- package/es/_utils/markdown/render-markdown.d.ts +3 -0
- package/es/_utils/markdown/render-markdown.mjs +18 -3
- package/es/_utils/vue/index.d.ts +1 -0
- package/es/_utils/vue/index.mjs +1 -0
- package/es/_utils/vue/resolve-reactive.d.ts +3 -0
- package/es/_utils/vue/resolve-reactive.mjs +9 -0
- package/es/chat/src/ChatListItems.mjs +16 -11
- package/es/chat/src/ChatMainArea.mjs +2 -1
- package/es/chat/src/ChatMessages.d.ts +1 -1
- package/es/chat/src/ChatMessages.mjs +6 -5
- package/es/chat/src/ChatParts/ChatAttachmentButton/ChatAttachmentButton.mjs +1 -2
- package/es/chat/src/ChatParts/ChatEditingBlock/ChatEditingBlock.mjs +2 -1
- package/es/chat/src/ChatParts/ChatHeader/ChatHeader.mjs +3 -6
- package/es/chat/src/ChatParts/ChatLegacyInput/ChatLegacyInput.mjs +2 -1
- package/es/chat/src/interface.d.ts +17 -34
- package/es/chat/src/styles/index.cssr.mjs +11 -12
- package/es/chat/styles/light.mjs +2 -1
- package/es/chat/tests/utils/constants.d.ts +12 -0
- package/es/chat/tests/utils/constants.mjs +12 -0
- package/es/chat/tests/utils/create-chat-item-mock.d.ts +2 -0
- package/es/chat/tests/utils/create-chat-item-mock.mjs +9 -0
- package/es/chat/tests/utils/create-chat-message-mock.d.ts +2 -0
- package/es/chat/tests/utils/create-chat-message-mock.mjs +13 -0
- package/es/components.d.ts +87 -4
- package/es/config-provider/src/ConfigProvider.mjs +6 -2
- package/es/editor/index.d.ts +1 -1
- package/es/editor/src/Editor.d.ts +26 -0
- package/es/editor/src/Editor.mjs +25 -3
- package/es/editor/src/EditorParts/EditorContent/EditorContent.d.ts +24 -0
- package/es/editor/src/EditorParts/EditorContent/interface.d.ts +12 -0
- package/es/editor/src/EditorParts/EditorToolbar/EditorToolbar.d.ts +24 -0
- package/es/editor/src/EditorParts/EditorToolbar/composables/use-editor-toolbar-customization.mjs +2 -0
- package/es/editor/src/EditorParts/EditorToolbar/interface.d.ts +12 -0
- package/es/editor/src/EditorParts/SendButton/SendButton.mjs +3 -1
- package/es/editor/src/composables/use-editor-css-vars.mjs +8 -0
- package/es/editor/src/extensions.d.ts +1 -1
- package/es/editor/src/extensions.mjs +8 -2
- package/es/editor/src/interface.d.ts +19 -1
- package/es/editor/src/interface.mjs +1 -0
- package/es/editor/src/styles/index.cssr.mjs +14 -2
- package/es/editor/styles/dark.d.ts +4 -0
- package/es/editor/styles/light.d.ts +8 -0
- package/es/editor/styles/light.mjs +4 -0
- package/es/locales/common/enUS.d.ts +1 -0
- package/es/locales/common/enUS.mjs +1 -0
- package/es/locales/common/ruRU.mjs +6 -7
- package/es/locales/common/uzUZ.mjs +1 -0
- package/es/locales/common/zhCN.mjs +1 -0
- package/es/locales/utils/date-locale.d.ts +2 -0
- package/es/locales/utils/date-locale.mjs +8 -0
- package/es/message-bubble/src/MessageBubble.d.ts +19 -10
- package/es/message-bubble/src/MessageBubble.mjs +21 -24
- package/es/message-bubble/src/interface.d.ts +9 -5
- package/es/message-bubble/src/interface.mjs +7 -3
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/lib/_utils/index.d.ts +1 -1
- package/lib/_utils/index.js +3 -1
- package/lib/_utils/markdown/constants.d.ts +1 -0
- package/lib/_utils/markdown/constants.js +2 -1
- package/lib/_utils/markdown/index.d.ts +1 -1
- package/lib/_utils/markdown/index.js +4 -1
- package/lib/_utils/markdown/render-markdown.d.ts +3 -0
- package/lib/_utils/markdown/render-markdown.js +20 -2
- package/lib/_utils/vue/index.d.ts +1 -0
- package/lib/_utils/vue/index.js +4 -1
- package/lib/_utils/vue/resolve-reactive.d.ts +3 -0
- package/lib/_utils/vue/resolve-reactive.js +17 -0
- package/lib/chat/src/ChatListItems.js +20 -17
- package/lib/chat/src/ChatMainArea.js +2 -2
- package/lib/chat/src/ChatMessages.d.ts +1 -1
- package/lib/chat/src/ChatMessages.js +6 -5
- package/lib/chat/src/ChatParts/ChatAttachmentButton/ChatAttachmentButton.js +2 -2
- package/lib/chat/src/ChatParts/ChatEditingBlock/ChatEditingBlock.js +4 -1
- package/lib/chat/src/ChatParts/ChatHeader/ChatHeader.js +2 -2
- package/lib/chat/src/ChatParts/ChatLegacyInput/ChatLegacyInput.js +2 -2
- package/lib/chat/src/interface.d.ts +17 -34
- package/lib/chat/src/styles/index.cssr.js +11 -12
- package/lib/chat/styles/light.js +3 -1
- package/lib/chat/tests/utils/constants.d.ts +12 -0
- package/lib/chat/tests/utils/constants.js +15 -0
- package/lib/chat/tests/utils/create-chat-item-mock.d.ts +2 -0
- package/lib/chat/tests/utils/create-chat-item-mock.js +10 -0
- package/lib/chat/tests/utils/create-chat-message-mock.d.ts +2 -0
- package/lib/chat/tests/utils/create-chat-message-mock.js +14 -0
- package/lib/components.d.ts +87 -4
- package/lib/config-provider/src/ConfigProvider.js +7 -4
- package/lib/editor/index.d.ts +1 -1
- package/lib/editor/src/Editor.d.ts +28 -2
- package/lib/editor/src/Editor.js +22 -2
- package/lib/editor/src/EditorParts/EditorContent/EditorContent.d.ts +24 -0
- package/lib/editor/src/EditorParts/EditorContent/interface.d.ts +12 -0
- package/lib/editor/src/EditorParts/EditorToolbar/EditorToolbar.d.ts +24 -0
- package/lib/editor/src/EditorParts/EditorToolbar/composables/use-editor-toolbar-customization.js +1 -1
- package/lib/editor/src/EditorParts/EditorToolbar/interface.d.ts +12 -0
- package/lib/editor/src/EditorParts/SendButton/SendButton.js +1 -1
- package/lib/editor/src/composables/use-editor-css-vars.js +5 -1
- package/lib/editor/src/extensions.d.ts +1 -1
- package/lib/editor/src/extensions.js +8 -3
- package/lib/editor/src/interface.d.ts +19 -1
- package/lib/editor/src/interface.js +1 -1
- package/lib/editor/src/styles/index.cssr.js +14 -2
- package/lib/editor/styles/dark.d.ts +4 -0
- package/lib/editor/styles/light.d.ts +8 -0
- package/lib/editor/styles/light.js +4 -0
- package/lib/locales/common/enUS.d.ts +1 -0
- package/lib/locales/common/enUS.js +1 -0
- package/lib/locales/common/ruRU.js +6 -7
- package/lib/locales/common/uzUZ.js +1 -0
- package/lib/locales/common/zhCN.js +1 -0
- package/lib/locales/utils/date-locale.d.ts +2 -0
- package/lib/locales/utils/date-locale.js +14 -0
- package/lib/message-bubble/src/MessageBubble.d.ts +19 -10
- package/lib/message-bubble/src/MessageBubble.js +26 -25
- package/lib/message-bubble/src/interface.d.ts +9 -5
- package/lib/message-bubble/src/interface.js +6 -3
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/web-types.json +26 -9
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.resolveDateLocale = resolveDateLocale;
|
|
7
|
+
const enUS_1 = __importDefault(require("../date/enUS"));
|
|
8
|
+
const ruRU_1 = __importDefault(require("../date/ruRU"));
|
|
9
|
+
const uzUZ_1 = __importDefault(require("../date/uzUZ"));
|
|
10
|
+
const zhCN_1 = __importDefault(require("../date/zhCN"));
|
|
11
|
+
const dateLocales = [enUS_1.default, ruRU_1.default, uzUZ_1.default, zhCN_1.default];
|
|
12
|
+
function resolveDateLocale(name) {
|
|
13
|
+
return dateLocales.find(dateLocale => dateLocale.name === name);
|
|
14
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SlotsType, VNodeChild } from 'vue';
|
|
2
|
-
import type { MessageBubbleAttachment, MessageBubbleMessagePayload,
|
|
2
|
+
import type { MessageBubbleAttachment, MessageBubbleMessagePayload, MessageBubbleSlots } from './interface';
|
|
3
3
|
import { MessageBubbleServiceVariant, MessageBubbleStatus, MessageBubbleType } from './interface';
|
|
4
4
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
5
|
readonly type: {
|
|
@@ -19,11 +19,11 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
19
19
|
readonly default: false;
|
|
20
20
|
};
|
|
21
21
|
readonly title: {
|
|
22
|
-
readonly type: import("vue").PropType<MessageBubbleRenderContent>;
|
|
22
|
+
readonly type: import("vue").PropType<import("./interface").MessageBubbleRenderContent>;
|
|
23
23
|
readonly default: undefined;
|
|
24
24
|
};
|
|
25
25
|
readonly content: {
|
|
26
|
-
readonly type: import("vue").PropType<MessageBubbleRenderContent>;
|
|
26
|
+
readonly type: import("vue").PropType<import("./interface").MessageBubbleRenderContent>;
|
|
27
27
|
readonly default: undefined;
|
|
28
28
|
};
|
|
29
29
|
readonly markdown: {
|
|
@@ -34,8 +34,12 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
34
34
|
readonly type: import("vue").PropType<import("../../_utils/markdown").MarkdownOptions>;
|
|
35
35
|
readonly default: undefined;
|
|
36
36
|
};
|
|
37
|
+
readonly markdownProps: {
|
|
38
|
+
readonly type: import("vue").PropType<import("vue").HTMLAttributes>;
|
|
39
|
+
readonly default: undefined;
|
|
40
|
+
};
|
|
37
41
|
readonly timestamp: {
|
|
38
|
-
readonly type: import("vue").PropType<string | number | Date | (() => VNodeChild)>;
|
|
42
|
+
readonly type: import("vue").PropType<import("vue").MaybeRefOrGetter<string | number | Date> | (() => VNodeChild)>;
|
|
39
43
|
readonly default: undefined;
|
|
40
44
|
};
|
|
41
45
|
readonly status: {
|
|
@@ -206,11 +210,11 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
206
210
|
readonly default: false;
|
|
207
211
|
};
|
|
208
212
|
readonly title: {
|
|
209
|
-
readonly type: import("vue").PropType<MessageBubbleRenderContent>;
|
|
213
|
+
readonly type: import("vue").PropType<import("./interface").MessageBubbleRenderContent>;
|
|
210
214
|
readonly default: undefined;
|
|
211
215
|
};
|
|
212
216
|
readonly content: {
|
|
213
|
-
readonly type: import("vue").PropType<MessageBubbleRenderContent>;
|
|
217
|
+
readonly type: import("vue").PropType<import("./interface").MessageBubbleRenderContent>;
|
|
214
218
|
readonly default: undefined;
|
|
215
219
|
};
|
|
216
220
|
readonly markdown: {
|
|
@@ -221,8 +225,12 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
221
225
|
readonly type: import("vue").PropType<import("../../_utils/markdown").MarkdownOptions>;
|
|
222
226
|
readonly default: undefined;
|
|
223
227
|
};
|
|
228
|
+
readonly markdownProps: {
|
|
229
|
+
readonly type: import("vue").PropType<import("vue").HTMLAttributes>;
|
|
230
|
+
readonly default: undefined;
|
|
231
|
+
};
|
|
224
232
|
readonly timestamp: {
|
|
225
|
-
readonly type: import("vue").PropType<string | number | Date | (() => VNodeChild)>;
|
|
233
|
+
readonly type: import("vue").PropType<import("vue").MaybeRefOrGetter<string | number | Date> | (() => VNodeChild)>;
|
|
226
234
|
readonly default: undefined;
|
|
227
235
|
};
|
|
228
236
|
readonly status: {
|
|
@@ -368,10 +376,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
368
376
|
}, any>;
|
|
369
377
|
}>>>;
|
|
370
378
|
}>> & Readonly<{}>, {
|
|
371
|
-
readonly title: MessageBubbleRenderContent;
|
|
379
|
+
readonly title: import("./interface").MessageBubbleRenderContent;
|
|
372
380
|
readonly retryText: string;
|
|
373
381
|
readonly type: MessageBubbleType;
|
|
374
|
-
readonly content: MessageBubbleRenderContent;
|
|
382
|
+
readonly content: import("./interface").MessageBubbleRenderContent;
|
|
375
383
|
readonly status: MessageBubbleStatus;
|
|
376
384
|
readonly actions: import("./interface").MessageBubbleAction[];
|
|
377
385
|
readonly onRetry: (message: MessageBubbleMessagePayload) => void;
|
|
@@ -380,7 +388,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
380
388
|
readonly isOwn: boolean;
|
|
381
389
|
readonly markdown: boolean;
|
|
382
390
|
readonly markdownOptions: import("../../_utils/markdown").MarkdownOptions;
|
|
383
|
-
readonly
|
|
391
|
+
readonly markdownProps: import("vue").HTMLAttributes;
|
|
392
|
+
readonly timestamp: import("vue").MaybeRefOrGetter<string | number | Date> | (() => VNodeChild);
|
|
384
393
|
readonly attachments: MessageBubbleAttachment | MessageBubbleAttachment[];
|
|
385
394
|
readonly uploadProps: Partial<import("../../upload").UploadProps>;
|
|
386
395
|
readonly onAttachmentDownload: (attachment: MessageBubbleAttachment) => Promise<void> | void;
|
|
@@ -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 _utils_1 = require("../../_utils");
|
|
17
18
|
const markdown_1 = require("../../_utils/markdown");
|
|
18
19
|
const dropdown_1 = require("../../dropdown");
|
|
19
20
|
const icon_1 = require("../../icon");
|
|
@@ -47,8 +48,10 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
47
48
|
status: props.status,
|
|
48
49
|
attachments: normalizedAttachmentsRef.value
|
|
49
50
|
}));
|
|
51
|
+
const resolvedContentRef = (0, vue_1.computed)(() => (0, _utils_1.resolveReactiveContent)(props.content));
|
|
52
|
+
const resolvedTitleRef = (0, vue_1.computed)(() => (0, _utils_1.resolveReactiveContent)(props.title));
|
|
50
53
|
const markdownContent = (0, vue_1.computed)(() => {
|
|
51
|
-
const content =
|
|
54
|
+
const content = resolvedContentRef.value;
|
|
52
55
|
return props.markdown && typeof content === 'string' ? content : null;
|
|
53
56
|
});
|
|
54
57
|
const markdownActive = (0, vue_1.computed)(() => markdownContent.value !== null);
|
|
@@ -106,20 +109,11 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
106
109
|
}
|
|
107
110
|
result.push({
|
|
108
111
|
key: action.key,
|
|
109
|
-
label:
|
|
112
|
+
label: () => (0, _utils_1.resolveReactiveContent)(action.label)
|
|
110
113
|
});
|
|
111
114
|
}
|
|
112
115
|
return result;
|
|
113
116
|
});
|
|
114
|
-
const resolveRenderContent = (content) => {
|
|
115
|
-
if (typeof content === 'function') {
|
|
116
|
-
return content();
|
|
117
|
-
}
|
|
118
|
-
if (content instanceof Date) {
|
|
119
|
-
return content.toString();
|
|
120
|
-
}
|
|
121
|
-
return content;
|
|
122
|
-
};
|
|
123
117
|
const getThumbnailUrl = (attachment) => {
|
|
124
118
|
const url = [attachment.preview, attachment.thumbnail].find(value => typeof value === 'string');
|
|
125
119
|
return url !== null && url !== void 0 ? url : null;
|
|
@@ -207,15 +201,15 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
207
201
|
return uploadComponent;
|
|
208
202
|
};
|
|
209
203
|
const renderMessage = () => {
|
|
210
|
-
var _a;
|
|
204
|
+
var _a, _b;
|
|
211
205
|
const hasBubbleActionsSlot = slots.bubbleActions !== undefined;
|
|
212
206
|
const hasBubbleActionsConfig = Boolean(props.actions && props.actions.length > 0);
|
|
213
|
-
const hasTitle = Boolean(
|
|
207
|
+
const hasTitle = Boolean(resolvedTitleRef.value || slots.title);
|
|
214
208
|
const afterContentSlot = slots.afterContent || slots['after-content'];
|
|
215
209
|
const hasAfterContent = Boolean(afterContentSlot);
|
|
216
210
|
const hasVisibleTextContent = markdownActive.value
|
|
217
211
|
? markdownHtmlRef.value !== null
|
|
218
|
-
: Boolean(
|
|
212
|
+
: Boolean(resolvedContentRef.value);
|
|
219
213
|
const hasContentInsideBubble = Boolean(hasVisibleTextContent
|
|
220
214
|
|| slots.default
|
|
221
215
|
|| hasAfterContent
|
|
@@ -227,15 +221,18 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
227
221
|
? `${mergedClsPrefixRef.value}-message-bubble__bubble--own`
|
|
228
222
|
: `${mergedClsPrefixRef.value}-message-bubble__bubble--other`
|
|
229
223
|
] },
|
|
230
|
-
hasTitle && ((0, vue_1.h)(typography_1.UText, { class: `${mergedClsPrefixRef.value}-message-bubble__title`, variant: "body-l-semi-bold" },
|
|
231
|
-
|
|
232
|
-
|
|
224
|
+
hasTitle && ((0, vue_1.h)(typography_1.UText, { class: `${mergedClsPrefixRef.value}-message-bubble__title`, variant: "body-l-semi-bold" }, {
|
|
225
|
+
default: () => slots.title
|
|
226
|
+
? slots.title(messagePayloadRef.value)
|
|
227
|
+
: resolvedTitleRef.value
|
|
228
|
+
})),
|
|
233
229
|
normalizedAttachmentsRef.value.length > 0 && renderAttachment(true),
|
|
234
230
|
(hasVisibleTextContent || slots.default)
|
|
235
|
-
&& (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: [
|
|
231
|
+
&& (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", Object.assign({}, props.markdownProps, { class: [
|
|
236
232
|
`${mergedClsPrefixRef.value}-message-bubble__text`,
|
|
237
|
-
`${mergedClsPrefixRef.value}-message-bubble__markdown
|
|
238
|
-
|
|
233
|
+
`${mergedClsPrefixRef.value}-message-bubble__markdown`,
|
|
234
|
+
(_a = props.markdownProps) === null || _a === void 0 ? void 0 : _a.class
|
|
235
|
+
], innerHTML: markdownHtmlRef.value }))) : ((0, vue_1.h)("div", { class: `${mergedClsPrefixRef.value}-message-bubble__text` }, resolvedContentRef.value))),
|
|
239
236
|
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;
|
|
240
237
|
return ((0, vue_1.h)("div", { class: [
|
|
241
238
|
`${mergedClsPrefixRef.value}-message-bubble__message`,
|
|
@@ -255,8 +252,8 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
255
252
|
void (0, vue_1.nextTick)().then(() => {
|
|
256
253
|
contextMenuShow.value = true;
|
|
257
254
|
});
|
|
258
|
-
} }, (
|
|
259
|
-
|
|
255
|
+
} }, (_b = slots.bubbleActions) === null || _b === void 0 ? void 0 :
|
|
256
|
+
_b.call(slots, messagePayloadRef.value),
|
|
260
257
|
messageBubbleContent)) : hasBubbleActionsConfig ? ((0, vue_1.h)(dropdown_1.UDropdown, { show: contextMenuShow.value, trigger: "manual", placement: "bottom-start", options: messageContextMenuOptions.value, onSelect: handleContextMenuSelect, onUpdateShow: (show) => {
|
|
261
258
|
contextMenuShow.value = show;
|
|
262
259
|
}, onClickoutside: () => {
|
|
@@ -278,7 +275,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
278
275
|
] }, props.status === interface_1.MessageBubbleStatus.RETRY ? ((0, vue_1.h)("div", { class: `${mergedClsPrefixRef.value}-message-bubble__retry`, onClick: handleRetryClick },
|
|
279
276
|
(0, vue_1.h)(icon_1.UIcon, { size: 16, component: interface_1.statusIconMapper[interface_1.MessageBubbleStatus.RETRY], class: `${mergedClsPrefixRef.value}-message-bubble__retry-icon`, theme: themeRef.value.peers.StatusIcon, themeOverrides: themeRef.value.peerOverrides.StatusIcon }),
|
|
280
277
|
(0, vue_1.h)("span", { class: `${mergedClsPrefixRef.value}-message-bubble__retry-text` }, mergedRetryTextRef.value))) : ((0, vue_1.h)(vue_1.Fragment, null,
|
|
281
|
-
(0, vue_1.h)("span", { class: `${mergedClsPrefixRef.value}-message-bubble__time` },
|
|
278
|
+
(0, vue_1.h)("span", { class: `${mergedClsPrefixRef.value}-message-bubble__time` }, (0, _utils_1.resolveReactiveContent)(props.timestamp)),
|
|
282
279
|
props.isOwn && props.status && ((0, vue_1.h)("div", { class: `${mergedClsPrefixRef.value}-message-bubble__status` }, slots.messageStatus
|
|
283
280
|
? slots.messageStatus(messagePayloadRef.value)
|
|
284
281
|
: interface_1.statusIconMapper[props.status] && ((0, vue_1.h)(icon_1.UIcon, { size: 16, component: interface_1.statusIconMapper[props.status], class: [
|
|
@@ -287,6 +284,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
287
284
|
], theme: themeRef.value.peers.StatusIcon, themeOverrides: themeRef.value.peerOverrides.StatusIcon }))))))))));
|
|
288
285
|
};
|
|
289
286
|
const renderService = () => {
|
|
287
|
+
var _a;
|
|
290
288
|
if (slots.service) {
|
|
291
289
|
return slots.service(props.serviceVariant);
|
|
292
290
|
}
|
|
@@ -297,8 +295,11 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
297
295
|
`${mergedClsPrefixRef.value}-message-bubble__service`,
|
|
298
296
|
`${mergedClsPrefixRef.value}-message-bubble__service--${props.serviceVariant}`
|
|
299
297
|
] }, displayMarkdown
|
|
300
|
-
? markdownHtmlRef.value && ((0, vue_1.h)("span", {
|
|
301
|
-
|
|
298
|
+
? markdownHtmlRef.value && ((0, vue_1.h)("span", Object.assign({}, props.markdownProps, { class: [
|
|
299
|
+
`${mergedClsPrefixRef.value}-message-bubble__markdown`,
|
|
300
|
+
(_a = props.markdownProps) === null || _a === void 0 ? void 0 : _a.class
|
|
301
|
+
], innerHTML: markdownHtmlRef.value })))
|
|
302
|
+
: resolvedContentRef.value && ((0, vue_1.h)("span", null, resolvedContentRef.value))));
|
|
302
303
|
};
|
|
303
304
|
return {
|
|
304
305
|
mergedClsPrefixRef,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Component, PropType, VNodeChild } from 'vue';
|
|
1
|
+
import type { Component, HTMLAttributes, MaybeRefOrGetter, PropType, VNodeChild } from 'vue';
|
|
2
2
|
import type { ExtractPublicPropTypes } from '../../_utils';
|
|
3
3
|
import type { MarkdownOptions } from '../../_utils/markdown';
|
|
4
4
|
import type { UploadFileInfo, UploadProps } from '../../upload';
|
|
@@ -52,18 +52,18 @@ export interface MessageBubbleMessagePayload {
|
|
|
52
52
|
isOwn: boolean;
|
|
53
53
|
title?: MessageBubbleRenderContent;
|
|
54
54
|
content?: MessageBubbleRenderContent;
|
|
55
|
-
timestamp?: string | number | Date | (() => VNodeChild);
|
|
55
|
+
timestamp?: MaybeRefOrGetter<string | number | Date> | (() => VNodeChild);
|
|
56
56
|
status?: MessageBubbleStatus;
|
|
57
57
|
attachments: MessageBubbleAttachment[];
|
|
58
58
|
}
|
|
59
59
|
export interface MessageBubbleAction {
|
|
60
60
|
key: string;
|
|
61
|
-
label:
|
|
61
|
+
label: MessageBubbleRenderContent;
|
|
62
62
|
handler: (message: MessageBubbleMessagePayload) => void;
|
|
63
63
|
visible?: (message: MessageBubbleMessagePayload) => boolean;
|
|
64
64
|
}
|
|
65
65
|
export type MessageBubbleId = string | number | symbol;
|
|
66
|
-
export type MessageBubbleRenderContent = string | (() => VNodeChild);
|
|
66
|
+
export type MessageBubbleRenderContent = MaybeRefOrGetter<string> | (() => VNodeChild);
|
|
67
67
|
export type MessageBubbleProps = ExtractPublicPropTypes<typeof messageBubbleProps>;
|
|
68
68
|
export declare const statusIconMapper: Partial<Record<MessageBubbleStatus, Component>>;
|
|
69
69
|
export declare const messageBubbleProps: {
|
|
@@ -99,8 +99,12 @@ export declare const messageBubbleProps: {
|
|
|
99
99
|
readonly type: PropType<MarkdownOptions>;
|
|
100
100
|
readonly default: undefined;
|
|
101
101
|
};
|
|
102
|
+
readonly markdownProps: {
|
|
103
|
+
readonly type: PropType<HTMLAttributes>;
|
|
104
|
+
readonly default: undefined;
|
|
105
|
+
};
|
|
102
106
|
readonly timestamp: {
|
|
103
|
-
readonly type: PropType<string | number | Date | (() => VNodeChild)>;
|
|
107
|
+
readonly type: PropType<MaybeRefOrGetter<string | number | Date> | (() => VNodeChild)>;
|
|
104
108
|
readonly default: undefined;
|
|
105
109
|
};
|
|
106
110
|
readonly status: {
|
|
@@ -48,10 +48,10 @@ exports.messageBubbleProps = Object.assign(Object.assign({}, _mixins_1.useTheme.
|
|
|
48
48
|
type: Boolean,
|
|
49
49
|
default: false
|
|
50
50
|
}, title: {
|
|
51
|
-
type: [String, Function],
|
|
51
|
+
type: [String, Object, Function],
|
|
52
52
|
default: undefined
|
|
53
53
|
}, content: {
|
|
54
|
-
type: [String, Function],
|
|
54
|
+
type: [String, Object, Function],
|
|
55
55
|
default: undefined
|
|
56
56
|
}, markdown: {
|
|
57
57
|
type: Boolean,
|
|
@@ -59,8 +59,11 @@ exports.messageBubbleProps = Object.assign(Object.assign({}, _mixins_1.useTheme.
|
|
|
59
59
|
}, markdownOptions: {
|
|
60
60
|
type: Object,
|
|
61
61
|
default: undefined
|
|
62
|
+
}, markdownProps: {
|
|
63
|
+
type: Object,
|
|
64
|
+
default: undefined
|
|
62
65
|
}, timestamp: {
|
|
63
|
-
type: [String, Number, Date, Function],
|
|
66
|
+
type: [String, Number, Date, Object, Function],
|
|
64
67
|
default: undefined
|
|
65
68
|
}, status: {
|
|
66
69
|
type: String,
|
package/lib/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "2.4.
|
|
1
|
+
declare const _default: "2.4.2";
|
|
2
2
|
export default _default;
|
package/lib/version.js
CHANGED
package/package.json
CHANGED
package/web-types.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"framework": "vue",
|
|
4
4
|
"name": "@uzum-tech/ui",
|
|
5
|
-
"version": "2.4.
|
|
5
|
+
"version": "2.4.2",
|
|
6
6
|
"js-types-syntax": "typescript",
|
|
7
7
|
"contributions": {
|
|
8
8
|
"html": {
|
|
@@ -5528,8 +5528,8 @@
|
|
|
5528
5528
|
"name": "placeholder",
|
|
5529
5529
|
"doc-url": "https://uzum-ui.kapitalbank.uz/en-US/os-theme/components/editor",
|
|
5530
5530
|
"type": "string",
|
|
5531
|
-
"description": "Hint shown while the editor is empty.
|
|
5532
|
-
"default": "
|
|
5531
|
+
"description": "Hint shown while the editor is empty. Reactive: follows both the prop and the locale of the config provider.",
|
|
5532
|
+
"default": "locale",
|
|
5533
5533
|
"description-sections": {
|
|
5534
5534
|
"since": "2.4.0"
|
|
5535
5535
|
}
|
|
@@ -5634,6 +5634,16 @@
|
|
|
5634
5634
|
"since": "2.4.0"
|
|
5635
5635
|
}
|
|
5636
5636
|
},
|
|
5637
|
+
{
|
|
5638
|
+
"name": "node-props",
|
|
5639
|
+
"doc-url": "https://uzum-ui.kapitalbank.uz/en-US/os-theme/components/editor",
|
|
5640
|
+
"type": "{ bulletList?: HTMLAttributes, orderedList?: HTMLAttributes }",
|
|
5641
|
+
"description": "Attributes put on the list elements of the document, most notably `class`, so the content can be styled from the outside. _At creation._",
|
|
5642
|
+
"default": "undefined",
|
|
5643
|
+
"description-sections": {
|
|
5644
|
+
"since": "2.4.1"
|
|
5645
|
+
}
|
|
5646
|
+
},
|
|
5637
5647
|
{
|
|
5638
5648
|
"name": "toolbar-button-props",
|
|
5639
5649
|
"doc-url": "https://uzum-ui.kapitalbank.uz/en-US/os-theme/components/editor",
|
|
@@ -10867,22 +10877,22 @@
|
|
|
10867
10877
|
{
|
|
10868
10878
|
"name": "title",
|
|
10869
10879
|
"doc-url": "https://uzum-ui.kapitalbank.uz/en-US/os-theme/components/message-bubble",
|
|
10870
|
-
"type": "string | (() => VNodeChild)",
|
|
10871
|
-
"description": "Optional title rendered above message content.",
|
|
10880
|
+
"type": "MaybeRefOrGetter<string> | (() => VNodeChild)",
|
|
10881
|
+
"description": "Optional title rendered above message content. Pass a `string` for static text, or a `ref`/`computed`/getter to re-render it when your app's locale changes. A getter may return arbitrary markup.",
|
|
10872
10882
|
"default": "undefined"
|
|
10873
10883
|
},
|
|
10874
10884
|
{
|
|
10875
10885
|
"name": "content",
|
|
10876
10886
|
"doc-url": "https://uzum-ui.kapitalbank.uz/en-US/os-theme/components/message-bubble",
|
|
10877
|
-
"type": "string | (() => VNodeChild)",
|
|
10878
|
-
"description": "Message or service content.",
|
|
10887
|
+
"type": "MaybeRefOrGetter<string> | (() => VNodeChild)",
|
|
10888
|
+
"description": "Message or service content. Pass a `string` for static text, or a `ref`/`computed`/getter to re-render it when your app's locale changes. A getter may return arbitrary markup.",
|
|
10879
10889
|
"default": "undefined"
|
|
10880
10890
|
},
|
|
10881
10891
|
{
|
|
10882
10892
|
"name": "markdown",
|
|
10883
10893
|
"doc-url": "https://uzum-ui.kapitalbank.uz/en-US/os-theme/components/message-bubble",
|
|
10884
10894
|
"type": "boolean",
|
|
10885
|
-
"description": "Render `content` (when
|
|
10895
|
+
"description": "Render `content` (when the resolved value is a string) as sanitized Markdown. Only a safe subset of syntax is supported — see the Markdown Support section below.",
|
|
10886
10896
|
"default": "false"
|
|
10887
10897
|
},
|
|
10888
10898
|
{
|
|
@@ -10892,10 +10902,17 @@
|
|
|
10892
10902
|
"description": "Options to customize Markdown rendering — see MarkdownOptions Type below.",
|
|
10893
10903
|
"default": "undefined"
|
|
10894
10904
|
},
|
|
10905
|
+
{
|
|
10906
|
+
"name": "markdown-props",
|
|
10907
|
+
"doc-url": "https://uzum-ui.kapitalbank.uz/en-US/os-theme/components/message-bubble",
|
|
10908
|
+
"type": "HTMLAttributes",
|
|
10909
|
+
"description": "Attributes for the Markdown container, most notably `class`. A selector rooted in that class — `.your-class ul { padding-inline-start: 24px }` — outweighs the tag rules of the library. List indentation itself is left to the browser default, so a project with a CSS reset should set it this way.",
|
|
10910
|
+
"default": "undefined"
|
|
10911
|
+
},
|
|
10895
10912
|
{
|
|
10896
10913
|
"name": "timestamp",
|
|
10897
10914
|
"doc-url": "https://uzum-ui.kapitalbank.uz/en-US/os-theme/components/message-bubble",
|
|
10898
|
-
"type": "string | number | Date | (() => VNodeChild)",
|
|
10915
|
+
"type": "MaybeRefOrGetter<string | number | Date> | (() => VNodeChild)",
|
|
10899
10916
|
"description": "Message time.",
|
|
10900
10917
|
"default": "undefined"
|
|
10901
10918
|
},
|