@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.
Files changed (130) hide show
  1. package/dist/index.js +173 -76
  2. package/dist/index.mjs +174 -77
  3. package/dist/index.prod.js +3 -3
  4. package/dist/index.prod.mjs +3 -3
  5. package/es/_utils/index.d.ts +1 -1
  6. package/es/_utils/index.mjs +1 -1
  7. package/es/_utils/markdown/constants.d.ts +1 -0
  8. package/es/_utils/markdown/constants.mjs +1 -0
  9. package/es/_utils/markdown/index.d.ts +1 -1
  10. package/es/_utils/markdown/index.mjs +1 -1
  11. package/es/_utils/markdown/render-markdown.d.ts +3 -0
  12. package/es/_utils/markdown/render-markdown.mjs +18 -3
  13. package/es/_utils/vue/index.d.ts +1 -0
  14. package/es/_utils/vue/index.mjs +1 -0
  15. package/es/_utils/vue/resolve-reactive.d.ts +3 -0
  16. package/es/_utils/vue/resolve-reactive.mjs +9 -0
  17. package/es/chat/src/ChatListItems.mjs +16 -11
  18. package/es/chat/src/ChatMainArea.mjs +2 -1
  19. package/es/chat/src/ChatMessages.d.ts +1 -1
  20. package/es/chat/src/ChatMessages.mjs +6 -5
  21. package/es/chat/src/ChatParts/ChatAttachmentButton/ChatAttachmentButton.mjs +1 -2
  22. package/es/chat/src/ChatParts/ChatEditingBlock/ChatEditingBlock.mjs +2 -1
  23. package/es/chat/src/ChatParts/ChatHeader/ChatHeader.mjs +3 -6
  24. package/es/chat/src/ChatParts/ChatLegacyInput/ChatLegacyInput.mjs +2 -1
  25. package/es/chat/src/interface.d.ts +17 -34
  26. package/es/chat/src/styles/index.cssr.mjs +11 -12
  27. package/es/chat/styles/light.mjs +2 -1
  28. package/es/chat/tests/utils/constants.d.ts +12 -0
  29. package/es/chat/tests/utils/constants.mjs +12 -0
  30. package/es/chat/tests/utils/create-chat-item-mock.d.ts +2 -0
  31. package/es/chat/tests/utils/create-chat-item-mock.mjs +9 -0
  32. package/es/chat/tests/utils/create-chat-message-mock.d.ts +2 -0
  33. package/es/chat/tests/utils/create-chat-message-mock.mjs +13 -0
  34. package/es/components.d.ts +87 -4
  35. package/es/config-provider/src/ConfigProvider.mjs +6 -2
  36. package/es/editor/index.d.ts +1 -1
  37. package/es/editor/src/Editor.d.ts +26 -0
  38. package/es/editor/src/Editor.mjs +25 -3
  39. package/es/editor/src/EditorParts/EditorContent/EditorContent.d.ts +24 -0
  40. package/es/editor/src/EditorParts/EditorContent/interface.d.ts +12 -0
  41. package/es/editor/src/EditorParts/EditorToolbar/EditorToolbar.d.ts +24 -0
  42. package/es/editor/src/EditorParts/EditorToolbar/composables/use-editor-toolbar-customization.mjs +2 -0
  43. package/es/editor/src/EditorParts/EditorToolbar/interface.d.ts +12 -0
  44. package/es/editor/src/EditorParts/SendButton/SendButton.mjs +3 -1
  45. package/es/editor/src/composables/use-editor-css-vars.mjs +8 -0
  46. package/es/editor/src/extensions.d.ts +1 -1
  47. package/es/editor/src/extensions.mjs +8 -2
  48. package/es/editor/src/interface.d.ts +19 -1
  49. package/es/editor/src/interface.mjs +1 -0
  50. package/es/editor/src/styles/index.cssr.mjs +14 -2
  51. package/es/editor/styles/dark.d.ts +4 -0
  52. package/es/editor/styles/light.d.ts +8 -0
  53. package/es/editor/styles/light.mjs +4 -0
  54. package/es/locales/common/enUS.d.ts +1 -0
  55. package/es/locales/common/enUS.mjs +1 -0
  56. package/es/locales/common/ruRU.mjs +6 -7
  57. package/es/locales/common/uzUZ.mjs +1 -0
  58. package/es/locales/common/zhCN.mjs +1 -0
  59. package/es/locales/utils/date-locale.d.ts +2 -0
  60. package/es/locales/utils/date-locale.mjs +8 -0
  61. package/es/message-bubble/src/MessageBubble.d.ts +19 -10
  62. package/es/message-bubble/src/MessageBubble.mjs +21 -24
  63. package/es/message-bubble/src/interface.d.ts +9 -5
  64. package/es/message-bubble/src/interface.mjs +7 -3
  65. package/es/version.d.ts +1 -1
  66. package/es/version.mjs +1 -1
  67. package/lib/_utils/index.d.ts +1 -1
  68. package/lib/_utils/index.js +3 -1
  69. package/lib/_utils/markdown/constants.d.ts +1 -0
  70. package/lib/_utils/markdown/constants.js +2 -1
  71. package/lib/_utils/markdown/index.d.ts +1 -1
  72. package/lib/_utils/markdown/index.js +4 -1
  73. package/lib/_utils/markdown/render-markdown.d.ts +3 -0
  74. package/lib/_utils/markdown/render-markdown.js +20 -2
  75. package/lib/_utils/vue/index.d.ts +1 -0
  76. package/lib/_utils/vue/index.js +4 -1
  77. package/lib/_utils/vue/resolve-reactive.d.ts +3 -0
  78. package/lib/_utils/vue/resolve-reactive.js +17 -0
  79. package/lib/chat/src/ChatListItems.js +20 -17
  80. package/lib/chat/src/ChatMainArea.js +2 -2
  81. package/lib/chat/src/ChatMessages.d.ts +1 -1
  82. package/lib/chat/src/ChatMessages.js +6 -5
  83. package/lib/chat/src/ChatParts/ChatAttachmentButton/ChatAttachmentButton.js +2 -2
  84. package/lib/chat/src/ChatParts/ChatEditingBlock/ChatEditingBlock.js +4 -1
  85. package/lib/chat/src/ChatParts/ChatHeader/ChatHeader.js +2 -2
  86. package/lib/chat/src/ChatParts/ChatLegacyInput/ChatLegacyInput.js +2 -2
  87. package/lib/chat/src/interface.d.ts +17 -34
  88. package/lib/chat/src/styles/index.cssr.js +11 -12
  89. package/lib/chat/styles/light.js +3 -1
  90. package/lib/chat/tests/utils/constants.d.ts +12 -0
  91. package/lib/chat/tests/utils/constants.js +15 -0
  92. package/lib/chat/tests/utils/create-chat-item-mock.d.ts +2 -0
  93. package/lib/chat/tests/utils/create-chat-item-mock.js +10 -0
  94. package/lib/chat/tests/utils/create-chat-message-mock.d.ts +2 -0
  95. package/lib/chat/tests/utils/create-chat-message-mock.js +14 -0
  96. package/lib/components.d.ts +87 -4
  97. package/lib/config-provider/src/ConfigProvider.js +7 -4
  98. package/lib/editor/index.d.ts +1 -1
  99. package/lib/editor/src/Editor.d.ts +28 -2
  100. package/lib/editor/src/Editor.js +22 -2
  101. package/lib/editor/src/EditorParts/EditorContent/EditorContent.d.ts +24 -0
  102. package/lib/editor/src/EditorParts/EditorContent/interface.d.ts +12 -0
  103. package/lib/editor/src/EditorParts/EditorToolbar/EditorToolbar.d.ts +24 -0
  104. package/lib/editor/src/EditorParts/EditorToolbar/composables/use-editor-toolbar-customization.js +1 -1
  105. package/lib/editor/src/EditorParts/EditorToolbar/interface.d.ts +12 -0
  106. package/lib/editor/src/EditorParts/SendButton/SendButton.js +1 -1
  107. package/lib/editor/src/composables/use-editor-css-vars.js +5 -1
  108. package/lib/editor/src/extensions.d.ts +1 -1
  109. package/lib/editor/src/extensions.js +8 -3
  110. package/lib/editor/src/interface.d.ts +19 -1
  111. package/lib/editor/src/interface.js +1 -1
  112. package/lib/editor/src/styles/index.cssr.js +14 -2
  113. package/lib/editor/styles/dark.d.ts +4 -0
  114. package/lib/editor/styles/light.d.ts +8 -0
  115. package/lib/editor/styles/light.js +4 -0
  116. package/lib/locales/common/enUS.d.ts +1 -0
  117. package/lib/locales/common/enUS.js +1 -0
  118. package/lib/locales/common/ruRU.js +6 -7
  119. package/lib/locales/common/uzUZ.js +1 -0
  120. package/lib/locales/common/zhCN.js +1 -0
  121. package/lib/locales/utils/date-locale.d.ts +2 -0
  122. package/lib/locales/utils/date-locale.js +14 -0
  123. package/lib/message-bubble/src/MessageBubble.d.ts +19 -10
  124. package/lib/message-bubble/src/MessageBubble.js +26 -25
  125. package/lib/message-bubble/src/interface.d.ts +9 -5
  126. package/lib/message-bubble/src/interface.js +6 -3
  127. package/lib/version.d.ts +1 -1
  128. package/lib/version.js +1 -1
  129. package/package.json +1 -1
  130. package/web-types.json +26 -9
@@ -138,6 +138,7 @@ const zhCN = {
138
138
  uploading: '上传中'
139
139
  },
140
140
  Editor: {
141
+ placeholder: '输入消息...',
141
142
  sendTooltip: '发送',
142
143
  boldTooltip: '加粗',
143
144
  strikethroughTooltip: '删除线',
@@ -0,0 +1,2 @@
1
+ import type { UDateLocale } from '../date/enUS';
2
+ export declare function resolveDateLocale(name?: string): UDateLocale | undefined;
@@ -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, MessageBubbleRenderContent, MessageBubbleSlots } from './interface';
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 timestamp: string | number | Date | (() => VNodeChild);
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 = props.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: typeof action.label === 'function' ? action.label() : action.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(props.title || slots.title);
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(props.content);
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" }, slots.title
231
- ? slots.title(messagePayloadRef.value)
232
- : resolveRenderContent(props.title))),
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
- ], innerHTML: markdownHtmlRef.value })) : ((0, vue_1.h)("div", { class: `${mergedClsPrefixRef.value}-message-bubble__text` }, resolveRenderContent(props.content)))),
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
- } }, (_a = slots.bubbleActions) === null || _a === void 0 ? void 0 :
259
- _a.call(slots, messagePayloadRef.value),
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` }, resolveRenderContent(props.timestamp)),
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", { class: `${mergedClsPrefixRef.value}-message-bubble__markdown`, innerHTML: markdownHtmlRef.value }))
301
- : props.content && ((0, vue_1.h)("span", null, resolveRenderContent(props.content)))));
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: string | (() => VNodeChild);
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.0";
1
+ declare const _default: "2.4.2";
2
2
  export default _default;
package/lib/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = '2.4.0';
3
+ exports.default = '2.4.2';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uzum-tech/ui",
3
- "version": "2.4.0",
3
+ "version": "2.4.2",
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": {
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.0",
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. _At creation._",
5532
- "default": "undefined",
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 it's a string) as sanitized Markdown. Only a safe subset of syntax is supported — see the Markdown Support section below.",
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
  },