@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
package/dist/index.js CHANGED
@@ -11106,6 +11106,15 @@
11106
11106
  }
11107
11107
  }
11108
11108
 
11109
+ function resolveReactiveContent(content) {
11110
+ const value = vue.isRef(content) ? content.value : typeof content === "function" ? content() : content;
11111
+ return value instanceof Date ? value.toString() : value;
11112
+ }
11113
+ function resolveReactiveText(content) {
11114
+ const value = resolveReactiveContent(content);
11115
+ return typeof value === "string" ? value : "";
11116
+ }
11117
+
11109
11118
  function ensureValidVNode(vnodes) {
11110
11119
  return vnodes.some(child => {
11111
11120
  if (!vue.isVNode(child)) {
@@ -11441,6 +11450,7 @@
11441
11450
  uploading: "Uploading"
11442
11451
  },
11443
11452
  Editor: {
11453
+ placeholder: "Type a message...",
11444
11454
  sendTooltip: "Send",
11445
11455
  boldTooltip: "Bold",
11446
11456
  strikethroughTooltip: "Strikethrough",
@@ -11526,17 +11536,15 @@
11526
11536
  datePlaceholder: "\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0434\u0430\u0442\u0443",
11527
11537
  datetimePlaceholder: "\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0434\u0430\u0442\u0443 \u0438 \u0432\u0440\u0435\u043C\u044F",
11528
11538
  monthPlaceholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043C\u0435\u0441\u044F\u0446",
11529
- // FIXME: translation needed
11530
- yearPlaceholder: "Select Year",
11531
- quarterPlaceholder: "Select Quarter",
11532
- weekPlaceholder: "Select Week",
11539
+ yearPlaceholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0433\u043E\u0434",
11540
+ quarterPlaceholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043A\u0432\u0430\u0440\u0442\u0430\u043B",
11541
+ weekPlaceholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043D\u0435\u0434\u0435\u043B\u044E",
11533
11542
  startDatePlaceholder: "\u0414\u0430\u0442\u0430 \u043D\u0430\u0447\u0430\u043B\u0430",
11534
11543
  endDatePlaceholder: "\u0414\u0430\u0442\u0430 \u043E\u043A\u043E\u043D\u0447\u0430\u043D\u0438\u044F",
11535
11544
  startDatetimePlaceholder: "\u0414\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F \u043D\u0430\u0447\u0430\u043B\u0430",
11536
11545
  endDatetimePlaceholder: "\u0414\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F \u043E\u043A\u043E\u043D\u0447\u0430\u043D\u0438\u044F",
11537
- // FIXME: translation needed
11538
- startMonthPlaceholder: "Start Month",
11539
- endMonthPlaceholder: "End Month",
11546
+ startMonthPlaceholder: "\u041C\u0435\u0441\u044F\u0446 \u043D\u0430\u0447\u0430\u043B\u0430",
11547
+ endMonthPlaceholder: "\u041C\u0435\u0441\u044F\u0446 \u043E\u043A\u043E\u043D\u0447\u0430\u043D\u0438\u044F",
11540
11548
  monthBeforeYear: true,
11541
11549
  firstDayOfWeek: 0,
11542
11550
  today: "\u0421\u0435\u0433\u043E\u0434\u043D\u044F"
@@ -11630,6 +11638,7 @@
11630
11638
  uploading: "\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044F"
11631
11639
  },
11632
11640
  Editor: {
11641
+ placeholder: "\u041D\u0430\u043F\u0438\u0441\u0430\u0442\u044C \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435...",
11633
11642
  sendTooltip: "\u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C",
11634
11643
  boldTooltip: "\u0416\u0438\u0440\u043D\u044B\u0439",
11635
11644
  strikethroughTooltip: "\u0417\u0430\u0447\u0451\u0440\u043A\u043D\u0443\u0442\u044B\u0439",
@@ -11814,6 +11823,7 @@
11814
11823
  uploading: "Yuklanmoqda"
11815
11824
  },
11816
11825
  Editor: {
11826
+ placeholder: "Xabar yozing...",
11817
11827
  sendTooltip: "Yuborish",
11818
11828
  boldTooltip: "Qalin",
11819
11829
  strikethroughTooltip: "Chizib o'tilgan",
@@ -11998,6 +12008,7 @@
11998
12008
  uploading: "\u4E0A\u4F20\u4E2D"
11999
12009
  },
12000
12010
  Editor: {
12011
+ placeholder: "\u8F93\u5165\u6D88\u606F...",
12001
12012
  sendTooltip: "\u53D1\u9001",
12002
12013
  boldTooltip: "\u52A0\u7C97",
12003
12014
  strikethroughTooltip: "\u5220\u9664\u7EBF",
@@ -45883,7 +45894,6 @@
45883
45894
  ...originalInputSelf,
45884
45895
  color: elementsTertiary,
45885
45896
  colorFocus: elementsTertiary,
45886
- heightMedium: "45px",
45887
45897
  border: "none",
45888
45898
  borderFocus: "none",
45889
45899
  borderHover: "none",
@@ -45981,6 +45991,8 @@
45981
45991
  colorPressed: "transparent",
45982
45992
  colorFocus: "transparent",
45983
45993
  colorDisabled: "transparent",
45994
+ rippleColor: themeVars.sendButtonRippleColor,
45995
+ waveOpacity: themeVars.sendButtonWaveOpacity,
45984
45996
  textColor: themeVars.sendButtonColor,
45985
45997
  textColorHover: themeVars.sendButtonColor,
45986
45998
  textColorPressed: themeVars.sendButtonColor,
@@ -51613,6 +51625,7 @@
51613
51625
  };
51614
51626
  }
51615
51627
 
51628
+ const MARKDOWN_OPTIONS_KEYS_SEPARATOR = "|";
51616
51629
  const HTML_COMMENT_REGEX = /<!--[\s\S]*?-->/g;
51617
51630
  const HTML_CDATA_REGEX = /<!\[CDATA\[[\s\S]*?\]\]>/g;
51618
51631
  const HTML_RAW_BLOCK_REGEX = /<(script|style|iframe|object|embed|template|svg|math|noscript)\b[^>]*>[\s\S]*?<\/\1\s*>/gi;
@@ -51800,12 +51813,21 @@
51800
51813
  breaks: options?.breaks ?? true
51801
51814
  };
51802
51815
  }
51816
+ function getMarkdownOptionsKey(options) {
51817
+ const tags = {
51818
+ features: [...new Set(options.features)].sort().join(","),
51819
+ maxHeadingLevel: String(options.maxHeadingLevel),
51820
+ breaks: options.breaks ? "1" : "0"
51821
+ };
51822
+ return [tags.features, tags.maxHeadingLevel, tags.breaks].join(MARKDOWN_OPTIONS_KEYS_SEPARATOR);
51823
+ }
51803
51824
  function getMarkdownRenderer(options) {
51804
51825
  const normalizedOptions = normalizeOptions(options);
51805
- const instance = rendererCache.get(normalizedOptions);
51826
+ const key = getMarkdownOptionsKey(normalizedOptions);
51827
+ const instance = rendererCache.get(key);
51806
51828
  if (!instance) {
51807
51829
  const renderer = createMarkdownRenderer(normalizedOptions);
51808
- rendererCache.set(normalizedOptions, renderer);
51830
+ rendererCache.set(key, renderer);
51809
51831
  return renderer;
51810
51832
  }
51811
51833
  return instance;
@@ -54255,6 +54277,8 @@
54255
54277
  toolbarDividerColor: elementsQuaternary,
54256
54278
  toolbarButtonColorActive: elementsQuaternary,
54257
54279
  toolbarButtonColorHover: elementsQuaternary,
54280
+ toolbarButtonRippleColor: elementsQuaternary,
54281
+ toolbarButtonWaveOpacity: "0.6",
54258
54282
  toolbarIconColorDisabled: elementsQuinary,
54259
54283
  toolbarIconColorActive: brandPrimary500,
54260
54284
  toolbarIconColorHover: textPrimary,
@@ -54264,6 +54288,8 @@
54264
54288
  placeholderColor: textTertiary,
54265
54289
  sendButtonColor: brandPrimary400,
54266
54290
  sendButtonColorDisabled: elementsQuinary,
54291
+ sendButtonRippleColor: brandPrimary400,
54292
+ sendButtonWaveOpacity: "0.6",
54267
54293
  sendButtonIconSize: iconMedium,
54268
54294
  blockTypeTriggerHeight: heightMini,
54269
54295
  blockTypeTriggerPadding: "0 8px 0 0",
@@ -58708,11 +58734,11 @@
58708
58734
  default: false
58709
58735
  },
58710
58736
  title: {
58711
- type: [String, Function],
58737
+ type: [String, Object, Function],
58712
58738
  default: void 0
58713
58739
  },
58714
58740
  content: {
58715
- type: [String, Function],
58741
+ type: [String, Object, Function],
58716
58742
  default: void 0
58717
58743
  },
58718
58744
  markdown: {
@@ -58723,8 +58749,12 @@
58723
58749
  type: Object,
58724
58750
  default: void 0
58725
58751
  },
58752
+ markdownProps: {
58753
+ type: Object,
58754
+ default: void 0
58755
+ },
58726
58756
  timestamp: {
58727
- type: [String, Number, Date, Function],
58757
+ type: [String, Number, Date, Object, Function],
58728
58758
  default: void 0
58729
58759
  },
58730
58760
  status: {
@@ -60667,8 +60697,14 @@
60667
60697
  status: props.status,
60668
60698
  attachments: normalizedAttachmentsRef.value
60669
60699
  }));
60700
+ const resolvedContentRef = vue.computed(
60701
+ () => resolveReactiveContent(props.content)
60702
+ );
60703
+ const resolvedTitleRef = vue.computed(
60704
+ () => resolveReactiveContent(props.title)
60705
+ );
60670
60706
  const markdownContent = vue.computed(() => {
60671
- const content = props.content;
60707
+ const content = resolvedContentRef.value;
60672
60708
  return props.markdown && typeof content === "string" ? content : null;
60673
60709
  });
60674
60710
  const markdownActive = vue.computed(
@@ -60757,20 +60793,11 @@
60757
60793
  }
60758
60794
  result.push({
60759
60795
  key: action.key,
60760
- label: typeof action.label === "function" ? action.label() : action.label
60796
+ label: () => resolveReactiveContent(action.label)
60761
60797
  });
60762
60798
  }
60763
60799
  return result;
60764
60800
  });
60765
- const resolveRenderContent = (content) => {
60766
- if (typeof content === "function") {
60767
- return content();
60768
- }
60769
- if (content instanceof Date) {
60770
- return content.toString();
60771
- }
60772
- return content;
60773
- };
60774
60801
  const getThumbnailUrl = (attachment) => {
60775
60802
  const url = [attachment.preview, attachment.thumbnail].find(
60776
60803
  (value) => typeof value === "string"
@@ -60875,10 +60902,10 @@
60875
60902
  const hasBubbleActionsConfig = Boolean(
60876
60903
  props.actions && props.actions.length > 0
60877
60904
  );
60878
- const hasTitle = Boolean(props.title || slots.title);
60905
+ const hasTitle = Boolean(resolvedTitleRef.value || slots.title);
60879
60906
  const afterContentSlot = slots.afterContent || slots["after-content"];
60880
60907
  const hasAfterContent = Boolean(afterContentSlot);
60881
- const hasVisibleTextContent = markdownActive.value ? markdownHtmlRef.value !== null : Boolean(props.content);
60908
+ const hasVisibleTextContent = markdownActive.value ? markdownHtmlRef.value !== null : Boolean(resolvedContentRef.value);
60882
60909
  const hasContentInsideBubble = Boolean(
60883
60910
  hasVisibleTextContent || slots.default || hasAfterContent || hasTitle || normalizedAttachmentsRef.value.length > 1
60884
60911
  );
@@ -60896,19 +60923,23 @@
60896
60923
  class: `${mergedClsPrefixRef.value}-message-bubble__title`,
60897
60924
  variant: "body-l-semi-bold"
60898
60925
  },
60899
- slots.title ? slots.title(messagePayloadRef.value) : resolveRenderContent(props.title)
60926
+ {
60927
+ default: () => slots.title ? slots.title(messagePayloadRef.value) : resolvedTitleRef.value
60928
+ }
60900
60929
  ),
60901
60930
  normalizedAttachmentsRef.value.length > 0 && renderAttachment(true),
60902
60931
  (hasVisibleTextContent || slots.default) && (slots.default ? /* @__PURE__ */ vue.h("div", { class: `${mergedClsPrefixRef.value}-message-bubble__text` }, slots.default(messagePayloadRef.value)) : markdownHtmlRef.value !== null ? /* @__PURE__ */ vue.h(
60903
60932
  "div",
60904
60933
  {
60934
+ ...props.markdownProps,
60905
60935
  class: [
60906
60936
  `${mergedClsPrefixRef.value}-message-bubble__text`,
60907
- `${mergedClsPrefixRef.value}-message-bubble__markdown`
60937
+ `${mergedClsPrefixRef.value}-message-bubble__markdown`,
60938
+ props.markdownProps?.class
60908
60939
  ],
60909
60940
  innerHTML: markdownHtmlRef.value
60910
60941
  }
60911
- ) : /* @__PURE__ */ vue.h("div", { class: `${mergedClsPrefixRef.value}-message-bubble__text` }, resolveRenderContent(props.content))),
60942
+ ) : /* @__PURE__ */ vue.h("div", { class: `${mergedClsPrefixRef.value}-message-bubble__text` }, resolvedContentRef.value)),
60912
60943
  hasAfterContent && /* @__PURE__ */ vue.h(
60913
60944
  "div",
60914
60945
  {
@@ -61013,7 +61044,7 @@
61013
61044
  {
61014
61045
  class: `${mergedClsPrefixRef.value}-message-bubble__time`
61015
61046
  },
61016
- resolveRenderContent(props.timestamp)
61047
+ resolveReactiveContent(props.timestamp)
61017
61048
  ), props.isOwn && props.status && /* @__PURE__ */ vue.h(
61018
61049
  "div",
61019
61050
  {
@@ -61054,10 +61085,14 @@
61054
61085
  displayMarkdown ? markdownHtmlRef.value && /* @__PURE__ */ vue.h(
61055
61086
  "span",
61056
61087
  {
61057
- class: `${mergedClsPrefixRef.value}-message-bubble__markdown`,
61088
+ ...props.markdownProps,
61089
+ class: [
61090
+ `${mergedClsPrefixRef.value}-message-bubble__markdown`,
61091
+ props.markdownProps?.class
61092
+ ],
61058
61093
  innerHTML: markdownHtmlRef.value
61059
61094
  }
61060
- ) : props.content && /* @__PURE__ */ vue.h("span", null, resolveRenderContent(props.content))
61095
+ ) : resolvedContentRef.value && /* @__PURE__ */ vue.h("span", null, resolvedContentRef.value)
61061
61096
  );
61062
61097
  };
61063
61098
  return {
@@ -61714,6 +61749,7 @@
61714
61749
  padding: 16px 0px;
61715
61750
  `), cE("input", `
61716
61751
  flex: 1;
61752
+ --u-chat-input-padding-vertical: calc((var(--u-height) - var(--u-line-height-textarea)) / 2);
61717
61753
  `, [c$1(".u-input-wrapper", `
61718
61754
  flex-wrap: wrap;
61719
61755
  padding: 0 4px;
@@ -61721,34 +61757,32 @@
61721
61757
  `, [c$1(".u-input__prefix", `
61722
61758
  width: 100%;
61723
61759
  margin: 0;
61724
- margin-top: 4px;
61725
61760
  white-space: wrap;
61726
- `, [c$1("ul", `
61761
+ `, [c$1("&:has(*)", `
61762
+ margin-top: 4px;
61763
+ `), c$1("ul", `
61727
61764
  border-top-left-radius: 12px;
61728
61765
  border-top-right-radius: 12px;
61729
61766
  `), c$1("li", `
61730
61767
  padding: 12px;
61731
- `)]), c$1(".u-input__textarea-el", `
61732
- padding-top: 12px;
61733
- padding-left: 12px;
61734
- padding-right: 48px;
61735
- `), c$1(".u-input__placeholder", `
61736
- padding-top: 12px;
61768
+ `)]), c$1(".u-input__textarea-el, .u-input__textarea-mirror, .u-input__placeholder", `
61769
+ padding-top: var(--u-chat-input-padding-vertical);
61770
+ padding-bottom: var(--u-chat-input-padding-vertical);
61771
+ `), c$1(".u-input__textarea-el, .u-input__placeholder", `
61737
61772
  padding-left: 12px;
61738
61773
  padding-right: 48px;
61739
61774
  `)])]), cE("editing-block", `
61740
61775
  width: 100%;
61741
61776
  `), cE("input-suffix", `
61742
61777
  position: absolute;
61743
- right: 12px;
61744
- bottom: 12px;
61778
+ right: 8px;
61779
+ bottom: 10px;
61745
61780
  color: var(--u-input-suffix-color) !important;
61746
61781
  cursor: pointer;
61747
- margin-right: 4px;
61748
61782
  `), cE("attach-btn", `
61749
61783
  margin-left: 4px;
61750
61784
  flex-shrink: 0;
61751
- padding: 0 12px;
61785
+ padding: 0 10px;
61752
61786
  `)]), c$1("*", `
61753
61787
  box-sizing: border-box;
61754
61788
  `), c$1(".u-list-item .u-list-item__text", `
@@ -61820,7 +61854,6 @@
61820
61854
  Button,
61821
61855
  {
61822
61856
  secondary: true,
61823
- size: "large",
61824
61857
  class: `${mergedClsPrefix}-chat-main__attach-btn`,
61825
61858
  disabled: this.mergedDisabled,
61826
61859
  theme: mergedTheme.peers.Button,
@@ -61832,7 +61865,7 @@
61832
61865
  default: () => /* @__PURE__ */ vue.h(
61833
61866
  UIcon$1,
61834
61867
  {
61835
- size: 24,
61868
+ size: 20,
61836
61869
  theme: mergedTheme.peers.FooterAttachIcon,
61837
61870
  themeOverrides: mergedTheme.peerOverrides.FooterAttachIcon,
61838
61871
  ...this.mergedIconProps
@@ -62576,7 +62609,9 @@
62576
62609
  _UListItem,
62577
62610
  {
62578
62611
  header: { text: this.mergedTitle },
62579
- description: { text: this.message?.content || "" }
62612
+ description: {
62613
+ text: resolveReactiveText(this.message?.content)
62614
+ }
62580
62615
  },
62581
62616
  {
62582
62617
  suffix: () => /* @__PURE__ */ vue.h(
@@ -82584,6 +82619,8 @@ img.ProseMirror-separator {
82584
82619
  toolbarDividerColor,
82585
82620
  toolbarButtonColorActive,
82586
82621
  toolbarButtonColorHover,
82622
+ toolbarButtonRippleColor,
82623
+ toolbarButtonWaveOpacity,
82587
82624
  toolbarIconColorDisabled,
82588
82625
  toolbarIconColorActive,
82589
82626
  toolbarIconColorHover,
@@ -82592,6 +82629,8 @@ img.ProseMirror-separator {
82592
82629
  contentTextColor,
82593
82630
  placeholderColor,
82594
82631
  sendButtonColor,
82632
+ sendButtonRippleColor,
82633
+ sendButtonWaveOpacity,
82595
82634
  blockTypeMenuWidth,
82596
82635
  blockTypeMenuColor,
82597
82636
  blockTypeMenuBorderColor,
@@ -82620,6 +82659,8 @@ img.ProseMirror-separator {
82620
82659
  "--u-editor-toolbar-divider-color": toolbarDividerColor,
82621
82660
  "--u-editor-toolbar-button-color-active": toolbarButtonColorActive,
82622
82661
  "--u-editor-toolbar-button-color-hover": toolbarButtonColorHover,
82662
+ "--u-editor-toolbar-button-ripple-color": toolbarButtonRippleColor,
82663
+ "--u-editor-toolbar-button-wave-opacity": toolbarButtonWaveOpacity,
82623
82664
  "--u-editor-toolbar-icon-color-disabled": toolbarIconColorDisabled,
82624
82665
  "--u-editor-toolbar-icon-color-active": toolbarIconColorActive,
82625
82666
  "--u-editor-toolbar-icon-color-hover": toolbarIconColorHover,
@@ -82628,6 +82669,8 @@ img.ProseMirror-separator {
82628
82669
  "--u-editor-content-text-color": contentTextColor,
82629
82670
  "--u-editor-placeholder-color": placeholderColor,
82630
82671
  "--u-editor-send-button-color": sendButtonColor,
82672
+ "--u-editor-send-button-ripple-color": sendButtonRippleColor,
82673
+ "--u-editor-send-button-wave-opacity": sendButtonWaveOpacity,
82631
82674
  "--u-editor-block-type-menu-width": blockTypeMenuWidth,
82632
82675
  "--u-editor-block-type-menu-color": blockTypeMenuColor,
82633
82676
  "--u-editor-block-type-menu-border-color": blockTypeMenuBorderColor,
@@ -82695,6 +82738,7 @@ img.ProseMirror-separator {
82695
82738
  type: Array,
82696
82739
  default: () => []
82697
82740
  },
82741
+ nodeProps: Object,
82698
82742
  onSend: [Function, Array],
82699
82743
  onFocus: [Function, Array],
82700
82744
  onBlur: [Function, Array],
@@ -82720,10 +82764,14 @@ img.ProseMirror-separator {
82720
82764
  `), cE("toolbar-block-type", `
82721
82765
  width: 71px;
82722
82766
  `)]), cE("content-wrapper", `
82767
+ position: relative;
82768
+ box-sizing: border-box;
82723
82769
  display: flex;
82724
- align-items: flex-start;
82770
+ align-items: center;
82725
82771
  gap: 8px;
82726
- padding: 8px 10px;
82772
+ min-height: 40px;
82773
+ padding: 6px 10px;
82774
+ padding-right: 24px;
82727
82775
  border: 2px solid var(--u-editor-border-color);
82728
82776
  border-bottom-left-radius: 12px;
82729
82777
  border-bottom-right-radius: 12px;
@@ -82732,6 +82780,10 @@ img.ProseMirror-separator {
82732
82780
  min-width: 0;
82733
82781
  height: auto;
82734
82782
  `), cE("send-button", `
82783
+ position: absolute;
82784
+ align-items: flex-start;
82785
+ right: 6px;
82786
+ top: 6px;
82735
82787
  flex-shrink: 0;
82736
82788
  `)]), cE("content", `
82737
82789
  white-space: normal;
@@ -82822,7 +82874,7 @@ img.ProseMirror-separator {
82822
82874
  ...this.buttonProps
82823
82875
  },
82824
82876
  {
82825
- icon: () => /* @__PURE__ */ vue.h(UIcon$1, { ...this.iconProps }, {
82877
+ icon: () => /* @__PURE__ */ vue.h(UIcon$1, { ...this.iconProps, size: 20 }, {
82826
82878
  default: () => this.$slots.icon?.() ?? /* @__PURE__ */ vue.h(SendFilled, null)
82827
82879
  })
82828
82880
  }
@@ -84758,6 +84810,8 @@ img.ProseMirror-separator {
84758
84810
  colorPressed: themeVars.toolbarButtonColorActive,
84759
84811
  colorFocus: active ? themeVars.toolbarButtonColorActive : "transparent",
84760
84812
  colorDisabled: "transparent",
84813
+ rippleColor: themeVars.toolbarButtonRippleColor,
84814
+ waveOpacity: themeVars.toolbarButtonWaveOpacity,
84761
84815
  textColor: active ? themeVars.toolbarIconColorActive : themeVars.toolbarIconColor,
84762
84816
  textColorHover: active ? themeVars.toolbarIconColorActive : themeVars.toolbarIconColorHover,
84763
84817
  textColorPressed: themeVars.toolbarIconColorActive,
@@ -93004,6 +93058,7 @@ img.ProseMirror-separator {
93004
93058
  placeholder = "",
93005
93059
  markdownOptions,
93006
93060
  extensions = [],
93061
+ nodeProps,
93007
93062
  maxLength,
93008
93063
  onSendShortcut
93009
93064
  } = {}) {
@@ -93022,8 +93077,12 @@ img.ProseMirror-separator {
93022
93077
  heading: features.has("heading") && {
93023
93078
  levels: headingLevels
93024
93079
  },
93025
- bulletList: features.has("bulletList") && {},
93026
- orderedList: features.has("orderedList") && {},
93080
+ bulletList: features.has("bulletList") && {
93081
+ HTMLAttributes: nodeProps?.bulletList ?? {}
93082
+ },
93083
+ orderedList: features.has("orderedList") && {
93084
+ HTMLAttributes: nodeProps?.orderedList ?? {}
93085
+ },
93027
93086
  blockquote: features.has("blockquote") && {},
93028
93087
  horizontalRule: features.has("divider") && {},
93029
93088
  listItem: lists && {},
@@ -93128,15 +93187,21 @@ img.ProseMirror-separator {
93128
93187
  vue.toRef(props, "value"),
93129
93188
  uncontrolledValueRef
93130
93189
  );
93190
+ const parserRef = vue.shallowRef();
93191
+ const parserKeyRef = vue.shallowRef();
93131
93192
  const serializer = createMarkdownSerializer(props.markdownOptions);
93132
93193
  const sourceMarkdownRef = vue.ref(mergedValueRef.value ?? "");
93133
93194
  const loadedDocumentRef = vue.ref(null);
93134
93195
  const editableRef = vue.computed(() => !props.disabled && !props.readonly);
93196
+ const mergedPlaceholderRef = vue.computed(
93197
+ () => props.placeholder ?? localeRef.value.placeholder
93198
+ );
93135
93199
  const editorRef = useEditor({
93136
93200
  extensions: createEditorExtensions({
93137
- placeholder: props.placeholder,
93201
+ placeholder: () => mergedPlaceholderRef.value,
93138
93202
  markdownOptions: props.markdownOptions,
93139
93203
  extensions: props.extensions,
93204
+ nodeProps: props.nodeProps,
93140
93205
  maxLength: props.maxLength,
93141
93206
  onSendShortcut: props.sendOnEnter ? handleSend : void 0
93142
93207
  }),
@@ -93174,13 +93239,22 @@ img.ProseMirror-separator {
93174
93239
  if (props["onUpdate:value"])
93175
93240
  call(props["onUpdate:value"], value);
93176
93241
  }
93242
+ function getParser(instance) {
93243
+ const normalizedOptions = normalizeOptions(props.markdownOptions);
93244
+ const key = getMarkdownOptionsKey(normalizedOptions);
93245
+ if (!parserRef.value || parserKeyRef.value !== key) {
93246
+ parserKeyRef.value = key;
93247
+ parserRef.value = createMarkdownParser(
93248
+ instance.schema,
93249
+ props.markdownOptions
93250
+ );
93251
+ }
93252
+ return parserRef.value;
93253
+ }
93177
93254
  function setMarkdown(markdown, instance = editorRef.value, addToHistory = true) {
93178
93255
  if (!instance)
93179
93256
  return;
93180
- const document = createMarkdownParser(
93181
- instance.schema,
93182
- props.markdownOptions
93183
- ).parse(markdown);
93257
+ const document = getParser(instance).parse(markdown);
93184
93258
  sourceMarkdownRef.value = markdown;
93185
93259
  loadedDocumentRef.value = document;
93186
93260
  instance.chain().setMeta("addToHistory", addToHistory).setContent(document.toJSON(), { emitUpdate: false }).run();
@@ -93210,6 +93284,12 @@ img.ProseMirror-separator {
93210
93284
  vue.watch(editableRef, (editable) => {
93211
93285
  editorRef.value?.setEditable(editable);
93212
93286
  });
93287
+ vue.watch(mergedPlaceholderRef, () => {
93288
+ const editor = editorRef.value;
93289
+ if (!editor)
93290
+ return;
93291
+ editor.view.dispatch(editor.state.tr.setMeta("addToHistory", false));
93292
+ });
93213
93293
  function focus() {
93214
93294
  editorRef.value?.commands.focus();
93215
93295
  }
@@ -93492,6 +93572,7 @@ img.ProseMirror-separator {
93492
93572
  UInput$1,
93493
93573
  {
93494
93574
  ref: "inputInstRef",
93575
+ size: "small",
93495
93576
  value: this.value,
93496
93577
  placeholder: this.mergedPlaceholder,
93497
93578
  class: `${mergedClsPrefix}-chat-main__input`,
@@ -93511,7 +93592,7 @@ img.ProseMirror-separator {
93511
93592
  suffix: () => /* @__PURE__ */ vue.h(
93512
93593
  UIcon$1,
93513
93594
  {
93514
- size: 24,
93595
+ size: 20,
93515
93596
  class: `${mergedClsPrefix}-chat-main__input-suffix`,
93516
93597
  theme: mergedTheme.peers.FooterSuffixIcon,
93517
93598
  themeOverrides: mergedTheme.peerOverrides.FooterSuffixIcon,
@@ -93841,7 +93922,7 @@ img.ProseMirror-separator {
93841
93922
  render() {
93842
93923
  const { mergedClsPrefix, mergedTheme, selectedChat } = this;
93843
93924
  const keyId = this.toKeyString(selectedChat?.id);
93844
- const keyTitle = this.toKeyString(selectedChat?.title);
93925
+ const keyTitle = resolveReactiveText(selectedChat?.title);
93845
93926
  const renderDefaultActions = () => [
93846
93927
  /* @__PURE__ */ vue.h(_UTooltip, null, {
93847
93928
  trigger: () => /* @__PURE__ */ vue.h(
@@ -93927,7 +94008,7 @@ img.ProseMirror-separator {
93927
94008
  themeOverrides: mergedTheme.peerOverrides.Typography
93928
94009
  },
93929
94010
  {
93930
- default: () => selectedChat?.title ?? ""
94011
+ default: () => resolveReactiveContent(selectedChat?.title)
93931
94012
  }
93932
94013
  ), this.typing && /* @__PURE__ */ vue.h(
93933
94014
  _UText,
@@ -94150,7 +94231,7 @@ img.ProseMirror-separator {
94150
94231
  }));
94151
94232
  };
94152
94233
  const renderDateSeparator = (date) => {
94153
- return /* @__PURE__ */ vue.h("div", { class: `${mergedClsPrefixRef.value}-chat-main__date-separator` }, /* @__PURE__ */ vue.h("span", null, date));
94234
+ return /* @__PURE__ */ vue.h("div", { class: `${mergedClsPrefixRef.value}-chat-main__date-separator` }, /* @__PURE__ */ vue.h("span", null, resolveReactiveContent(date)));
94154
94235
  };
94155
94236
  const renderUnreadNotification = () => {
94156
94237
  const count = props.unreadNotificationCount ?? unreadMessagesCount.value;
@@ -94332,14 +94413,14 @@ img.ProseMirror-separator {
94332
94413
  let currentDate = "";
94333
94414
  let unreadNotificationInserted = false;
94334
94415
  this.messages?.forEach((message, index) => {
94335
- const messageDate = message.date || "";
94336
- if (messageDate !== currentDate) {
94416
+ const messageDateText = resolveReactiveText(message.date);
94417
+ if (messageDateText !== currentDate) {
94337
94418
  messagesWithDates.push({
94338
94419
  type: "date-separator",
94339
- date: messageDate,
94420
+ date: message.date,
94340
94421
  id: `date-${String(index)}`
94341
94422
  });
94342
- currentDate = messageDate;
94423
+ currentDate = messageDateText;
94343
94424
  }
94344
94425
  if (!unreadNotificationInserted && !message.isOwn && message.status === MessageStatus.UNREAD && this.showUnreadNotification) {
94345
94426
  messagesWithDates.push({
@@ -95039,7 +95120,7 @@ img.ProseMirror-separator {
95039
95120
  if (editMessageIdRef) {
95040
95121
  editMessageIdRef.value = message.id;
95041
95122
  }
95042
- inputValue.value = typeof message.content === "string" ? message.content : "";
95123
+ inputValue.value = resolveReactiveText(message.content);
95043
95124
  attachmentFileList.value = [];
95044
95125
  uploadedAttachmentsMap.value.clear();
95045
95126
  };
@@ -95505,10 +95586,9 @@ img.ProseMirror-separator {
95505
95586
  const renderChatItem = (item) => {
95506
95587
  const isSelected = props.selectedChatId === item.id;
95507
95588
  const isTyping = props.typingChatIds?.includes(item.id) ?? false;
95508
- const { id, title, subtitle } = item;
95509
- const keyId = toKeyString(id);
95510
- const keyTitle = toKeyString(title);
95511
- const keySubtitle = toKeyString(subtitle);
95589
+ const keyId = toKeyString(item.id);
95590
+ const keyTitle = resolveReactiveText(item.title);
95591
+ const keySubtitle = resolveReactiveText(item.subtitle);
95512
95592
  return /* @__PURE__ */ vue.h(
95513
95593
  _UListItem,
95514
95594
  {
@@ -95544,7 +95624,10 @@ img.ProseMirror-separator {
95544
95624
  variant: "body-l-medium"
95545
95625
  },
95546
95626
  {
95547
- default: () => typeof item.title === "function" ? item.title() : typeof item.title === "string" ? sanitizeMarkdown(item.title) : item.title
95627
+ default: () => {
95628
+ const title = resolveReactiveContent(item.title);
95629
+ return typeof title === "string" ? sanitizeMarkdown(title) : title;
95630
+ }
95548
95631
  }
95549
95632
  ),
95550
95633
  description: () => /* @__PURE__ */ vue.h(
@@ -95557,7 +95640,13 @@ img.ProseMirror-separator {
95557
95640
  variant: "body-m-medium"
95558
95641
  },
95559
95642
  {
95560
- default: () => isTyping ? mergedTypingTextRef.value : typeof item.subtitle === "string" ? sanitizeMarkdown(item.subtitle) : typeof item.subtitle === "function" ? item.subtitle() : item.subtitle
95643
+ default: () => {
95644
+ if (isTyping) {
95645
+ return mergedTypingTextRef.value;
95646
+ }
95647
+ const subTitle = resolveReactiveContent(item.subtitle);
95648
+ return typeof subTitle === "string" ? sanitizeMarkdown(subTitle) : subTitle;
95649
+ }
95561
95650
  }
95562
95651
  ),
95563
95652
  suffix: () => {
@@ -95574,7 +95663,7 @@ img.ProseMirror-separator {
95574
95663
  {
95575
95664
  class: `${mergedClsPrefixRef.value}-chat-sidebar__item-time`
95576
95665
  },
95577
- item.datetime
95666
+ resolveReactiveContent(item.datetime)
95578
95667
  ), /* @__PURE__ */ vue.h(
95579
95668
  "div",
95580
95669
  {
@@ -98914,6 +99003,11 @@ img.ProseMirror-separator {
98914
99003
  }
98915
99004
  });
98916
99005
 
99006
+ const dateLocales = [dateEnUs, dateRuRU, dateUzUZ, dateZhCN];
99007
+ function resolveDateLocale(name) {
99008
+ return dateLocales.find(dateLocale => dateLocale.name === name);
99009
+ }
99010
+
98917
99011
  const configProviderProps = {
98918
99012
  abstract: Boolean,
98919
99013
  bordered: {
@@ -99214,10 +99308,13 @@ img.ProseMirror-separator {
99214
99308
  }),
99215
99309
  mergedDateLocaleRef: vue.computed(() => {
99216
99310
  const {
99217
- dateLocale
99311
+ dateLocale,
99312
+ locale
99218
99313
  } = props;
99219
99314
  if (dateLocale === null) return;
99220
- return dateLocale === void 0 ? UConfigProvider?.mergedDateLocaleRef.value : dateLocale;
99315
+ if (dateLocale !== void 0) return dateLocale;
99316
+ if (locale !== void 0) return locale === null ? void 0 : resolveDateLocale(locale.name);
99317
+ return UConfigProvider?.mergedDateLocaleRef.value;
99221
99318
  }),
99222
99319
  mergedHljsRef: vue.computed(() => {
99223
99320
  const {
@@ -154680,7 +154777,7 @@ ${icon.label}`.toLowerCase()
154680
154777
  });
154681
154778
  }
154682
154779
 
154683
- var version = "2.4.0";
154780
+ var version = "2.4.2";
154684
154781
 
154685
154782
  function create({
154686
154783
  componentPrefix = "U",