@uzum-tech/ui 2.3.0 → 2.3.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 (80) hide show
  1. package/dist/index.js +564 -499
  2. package/dist/index.mjs +564 -499
  3. package/dist/index.prod.js +2 -2
  4. package/dist/index.prod.mjs +2 -2
  5. package/es/chat/src/Chat.d.ts +1074 -0
  6. package/es/chat/src/ChatListItems.d.ts +360 -0
  7. package/es/chat/src/ChatMainArea.d.ts +360 -0
  8. package/es/chat/src/ChatMainArea.mjs +1 -0
  9. package/es/chat/src/ChatMessages.d.ts +360 -0
  10. package/es/chat/src/ChatMessages.mjs +30 -3
  11. package/es/chat/src/ChatParts/Sidebar.d.ts +78 -0
  12. package/es/chat/src/interface.d.ts +1 -0
  13. package/es/chat/styles/dark.d.ts +27 -0
  14. package/es/chat/styles/dark.mjs +2 -0
  15. package/es/chat/styles/light.d.ts +27 -0
  16. package/es/chat/styles/light.mjs +2 -0
  17. package/es/components.d.ts +1840 -7
  18. package/es/image/src/ImagePreview.d.ts +1 -0
  19. package/es/image/src/ImagePreview.mjs +7 -35
  20. package/es/image/src/public-types.d.ts +4 -4
  21. package/es/message-bubble/src/MessageBubble.mjs +16 -5
  22. package/es/message-bubble/src/interface.d.ts +2 -0
  23. package/es/message-bubble/src/styles/index.cssr.mjs +5 -7
  24. package/es/upload/index.d.ts +2 -1
  25. package/es/upload/index.mjs +2 -1
  26. package/es/upload/src/Upload.d.ts +73 -1007
  27. package/es/upload/src/Upload.mjs +43 -124
  28. package/es/upload/src/UploadFile.d.ts +1 -1
  29. package/es/upload/src/UploadFile.mjs +8 -2
  30. package/es/upload/src/UploadFileList.mjs +17 -2
  31. package/es/upload/src/UploadProgress.d.ts +3 -2
  32. package/es/upload/src/interface.d.ts +1086 -92
  33. package/es/upload/src/interface.mjs +117 -1
  34. package/es/upload/src/public-types.d.ts +17 -2
  35. package/es/upload/src/useUploadActionsRender.d.ts +2 -27
  36. package/es/upload/src/useUploadActionsRender.mjs +2 -2
  37. package/es/upload/src/useUploadInternals.d.ts +2 -25
  38. package/es/upload/src/utils.d.ts +2 -0
  39. package/es/upload/src/utils.mjs +7 -0
  40. package/es/version.d.ts +1 -1
  41. package/es/version.mjs +1 -1
  42. package/lib/chat/src/Chat.d.ts +1074 -0
  43. package/lib/chat/src/ChatListItems.d.ts +360 -0
  44. package/lib/chat/src/ChatMainArea.d.ts +360 -0
  45. package/lib/chat/src/ChatMainArea.js +1 -0
  46. package/lib/chat/src/ChatMessages.d.ts +360 -0
  47. package/lib/chat/src/ChatMessages.js +10 -3
  48. package/lib/chat/src/ChatParts/Sidebar.d.ts +78 -0
  49. package/lib/chat/src/interface.d.ts +1 -0
  50. package/lib/chat/styles/dark.d.ts +27 -0
  51. package/lib/chat/styles/dark.js +6 -4
  52. package/lib/chat/styles/light.d.ts +27 -0
  53. package/lib/chat/styles/light.js +6 -4
  54. package/lib/components.d.ts +1840 -7
  55. package/lib/image/src/ImagePreview.d.ts +1 -0
  56. package/lib/image/src/ImagePreview.js +3 -19
  57. package/lib/image/src/public-types.d.ts +4 -4
  58. package/lib/message-bubble/src/MessageBubble.js +15 -5
  59. package/lib/message-bubble/src/interface.d.ts +2 -0
  60. package/lib/message-bubble/src/styles/index.cssr.js +5 -7
  61. package/lib/upload/index.d.ts +2 -1
  62. package/lib/upload/index.js +2 -1
  63. package/lib/upload/src/Upload.d.ts +73 -1007
  64. package/lib/upload/src/Upload.js +40 -68
  65. package/lib/upload/src/UploadFile.d.ts +1 -1
  66. package/lib/upload/src/UploadFile.js +12 -4
  67. package/lib/upload/src/UploadFileList.js +8 -1
  68. package/lib/upload/src/UploadProgress.d.ts +3 -2
  69. package/lib/upload/src/interface.d.ts +1086 -92
  70. package/lib/upload/src/interface.js +59 -1
  71. package/lib/upload/src/public-types.d.ts +17 -2
  72. package/lib/upload/src/useUploadActionsRender.d.ts +2 -27
  73. package/lib/upload/src/useUploadActionsRender.js +2 -2
  74. package/lib/upload/src/useUploadInternals.d.ts +2 -25
  75. package/lib/upload/src/utils.d.ts +2 -0
  76. package/lib/upload/src/utils.js +10 -0
  77. package/lib/version.d.ts +1 -1
  78. package/lib/version.js +1 -1
  79. package/package.json +1 -1
  80. package/web-types.json +113 -36
@@ -313,6 +313,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
313
313
  '--u-toolbar-color': string;
314
314
  '--u-toolbar-border-radius': string;
315
315
  '--u-toolbar-box-shadow': string;
316
+ '--u-overlay-color': string;
316
317
  }> | undefined;
317
318
  themeClass: import("vue").Ref<string, string> | undefined;
318
319
  onRender: (() => void) | undefined;
@@ -6,12 +6,12 @@ import { useIsMounted, useMergedState } from 'vooks';
6
6
  import { computed, defineComponent, Fragment, h, inject, normalizeStyle, onBeforeUnmount, ref, toRef, toRefs, Transition, vShow, watch, withDirectives } from 'vue';
7
7
  import { LazyTeleport } from 'vueuc';
8
8
  import { UBaseIcon } from "../../_internal/index.mjs";
9
- import { ResizeSmallIcon, RotateClockwiseIcon, RotateCounterclockwiseIcon, ZoomInIcon, ZoomOutIcon } from "../../_internal/icons/index.mjs";
9
+ import { RotateClockwiseIcon, RotateCounterclockwiseIcon, ZoomInIcon, ZoomOutIcon } from "../../_internal/icons/index.mjs";
10
10
  import { useConfig, useLocale, useTheme, useThemeClass } from "../../_mixins/index.mjs";
11
11
  import { call, download } from "../../_utils/index.mjs";
12
12
  import { UTooltip } from "../../tooltip/index.mjs";
13
13
  import { imageLight } from "../styles/index.mjs";
14
- import { closeIcon, downloadIcon, nextIcon, prevIcon } from "./icons.mjs";
14
+ import { closeIcon } from "./icons.mjs";
15
15
  import { imageContextKey, imagePreviewSharedProps } from "./interface.mjs";
16
16
  import style from "./styles/index.cssr.mjs";
17
17
  const BLEEDING = 32;
@@ -404,7 +404,8 @@ export default defineComponent({
404
404
  toolbarIconColor,
405
405
  toolbarBorderRadius,
406
406
  toolbarBoxShadow,
407
- toolbarColor
407
+ toolbarColor,
408
+ overlayColor
408
409
  }
409
410
  } = themeRef.value;
410
411
  return {
@@ -412,7 +413,8 @@ export default defineComponent({
412
413
  '--u-toolbar-icon-color': toolbarIconColor,
413
414
  '--u-toolbar-color': toolbarColor,
414
415
  '--u-toolbar-border-radius': toolbarBorderRadius,
415
- '--u-toolbar-box-shadow': toolbarBoxShadow
416
+ '--u-toolbar-box-shadow': toolbarBoxShadow,
417
+ '--u-overlay-color': overlayColor
416
418
  };
417
419
  });
418
420
  const {
@@ -468,18 +470,6 @@ export default defineComponent({
468
470
  renderToolbar,
469
471
  withTooltip
470
472
  } = this;
471
- const prevNode = withTooltip(h(UBaseIcon, {
472
- clsPrefix: clsPrefix,
473
- onClick: this.handleSwitchPrev
474
- }, {
475
- default: () => prevIcon
476
- }), 'tipPrevious');
477
- const nextNode = withTooltip(h(UBaseIcon, {
478
- clsPrefix: clsPrefix,
479
- onClick: this.handleSwitchNext
480
- }, {
481
- default: () => nextIcon
482
- }), 'tipNext');
483
473
  const rotateCounterclockwiseNode = withTooltip(h(UBaseIcon, {
484
474
  clsPrefix: clsPrefix,
485
475
  onClick: this.rotateCounterclockwise
@@ -492,26 +482,12 @@ export default defineComponent({
492
482
  }, {
493
483
  default: () => h(RotateClockwiseIcon, null)
494
484
  }), 'tipClockwise');
495
- const originalSizeNode = withTooltip(h(UBaseIcon, {
496
- clsPrefix: clsPrefix,
497
- onClick: this.resizeToOrignalImageSize
498
- }, {
499
- default: () => {
500
- return h(ResizeSmallIcon, null);
501
- }
502
- }), 'tipOriginalSize');
503
485
  const zoomOutNode = withTooltip(h(UBaseIcon, {
504
486
  clsPrefix: clsPrefix,
505
487
  onClick: this.zoomOut
506
488
  }, {
507
489
  default: () => h(ZoomOutIcon, null)
508
490
  }), 'tipZoomOut');
509
- const downloadNode = withTooltip(h(UBaseIcon, {
510
- clsPrefix: clsPrefix,
511
- onClick: this.handleDownloadClick
512
- }, {
513
- default: () => downloadIcon
514
- }), 'tipDownload');
515
491
  const closeNode = withTooltip(h(UBaseIcon, {
516
492
  clsPrefix: clsPrefix,
517
493
  onClick: () => this.close()
@@ -556,17 +532,13 @@ export default defineComponent({
556
532
  class: `${clsPrefix}-image-preview-toolbar`
557
533
  }, renderToolbar ? renderToolbar({
558
534
  nodes: {
559
- prev: prevNode,
560
- next: nextNode,
561
535
  rotateCounterclockwise: rotateCounterclockwiseNode,
562
536
  rotateClockwise: rotateClockwiseNode,
563
- resizeToOriginalSize: originalSizeNode,
564
537
  zoomOut: zoomOutNode,
565
538
  zoomIn: zoomInNode,
566
- download: downloadNode,
567
539
  close: closeNode
568
540
  }
569
- }) : h(Fragment, null, this.onPrev ? h(Fragment, null, prevNode, nextNode) : null, rotateCounterclockwiseNode, rotateClockwiseNode, originalSizeNode, zoomOutNode, zoomInNode, downloadNode, closeNode));
541
+ }) : h(Fragment, null, rotateCounterclockwiseNode, rotateClockwiseNode, zoomOutNode, zoomInNode, closeNode));
570
542
  }
571
543
  }) : null, h(Transition, {
572
544
  name: "fade-in-scale-up-transition",
@@ -1,14 +1,14 @@
1
1
  import type { VNode, VNodeChild } from 'vue';
2
2
  export interface ImageRenderToolbarProps {
3
3
  nodes: {
4
- prev: VNode;
5
- next: VNode;
4
+ prev?: VNode;
5
+ next?: VNode;
6
6
  rotateCounterclockwise: VNode;
7
7
  rotateClockwise: VNode;
8
- resizeToOriginalSize: VNode;
8
+ resizeToOriginalSize?: VNode;
9
9
  zoomOut: VNode;
10
10
  zoomIn: VNode;
11
- download: VNode;
11
+ download?: VNode;
12
12
  close: VNode;
13
13
  };
14
14
  }
@@ -138,6 +138,11 @@ export default defineComponent({
138
138
  const url = [attachment.preview, attachment.thumbnail].find(value => typeof value === 'string');
139
139
  return url !== null && url !== void 0 ? url : null;
140
140
  };
141
+ const getAttachmentUrl = attachment => {
142
+ if (!attachment.url || attachment.url === '#') return null;
143
+ return attachment.url;
144
+ };
145
+ const isAttachmentPreviewable = file => Boolean(file.thumbnailUrl);
141
146
  const handleAttachmentDownload = file => __awaiter(this, void 0, void 0, function* () {
142
147
  if (props.onAttachmentDownload) {
143
148
  const attachment = normalizedAttachmentsRef.value.find(item => item.name === file.name);
@@ -172,21 +177,23 @@ export default defineComponent({
172
177
  return slots.messageAttachment(messagePayloadRef.value);
173
178
  }
174
179
  const fileList = normalizedAttachmentsRef.value.map(attachment => {
175
- var _a, _b, _c;
180
+ var _a, _b;
176
181
  return {
177
182
  id: String(attachment.id),
178
183
  name: attachment.name,
179
184
  status: attachment.status || MessageBubbleAttachmentStatus.FINISHED,
180
185
  percentage: (_a = attachment.percentage) !== null && _a !== void 0 ? _a : null,
181
- url: (_b = attachment.url) !== null && _b !== void 0 ? _b : null,
186
+ url: getAttachmentUrl(attachment),
182
187
  thumbnailUrl: getThumbnailUrl(attachment),
183
- type: (_c = attachment.type) !== null && _c !== void 0 ? _c : null,
188
+ type: (_b = attachment.type) !== null && _b !== void 0 ? _b : null,
184
189
  file: null,
185
190
  batchId: null
186
191
  };
187
192
  });
188
193
  const uploadComponent = h(UUpload, Object.assign({
189
194
  abstract: true,
195
+ listType: "preview-list",
196
+ shouldUseThumbnailUrl: isAttachmentPreviewable,
190
197
  fileList: fileList,
191
198
  fileListStyle: withPadding ? {
192
199
  display: 'flex',
@@ -239,7 +246,9 @@ export default defineComponent({
239
246
  const hasBubbleActionsSlot = slots.bubbleActions !== undefined;
240
247
  const hasBubbleActionsConfig = Boolean(props.actions && props.actions.length > 0);
241
248
  const hasTitle = Boolean(props.title || slots.title);
242
- const hasContentInsideBubble = Boolean(props.content || slots.default || hasTitle || normalizedAttachmentsRef.value.length > 1);
249
+ const afterContentSlot = slots.afterContent || slots['after-content'];
250
+ const hasAfterContent = Boolean(afterContentSlot);
251
+ const hasContentInsideBubble = Boolean(props.content || slots.default || hasAfterContent || hasTitle || normalizedAttachmentsRef.value.length > 1);
243
252
  const messageBubbleContent = hasContentInsideBubble ? h("div", {
244
253
  class: [`${mergedClsPrefixRef.value}-message-bubble__bubble`, props.isOwn ? `${mergedClsPrefixRef.value}-message-bubble__bubble--own` : `${mergedClsPrefixRef.value}-message-bubble__bubble--other`]
245
254
  }, hasTitle && h(UText, {
@@ -247,7 +256,9 @@ export default defineComponent({
247
256
  variant: "body-l-semi-bold"
248
257
  }, slots.title ? slots.title(messagePayloadRef.value) : resolveRenderContent(props.title)), normalizedAttachmentsRef.value.length > 0 && renderAttachment(true), (props.content || slots.default) && h("div", {
249
258
  class: `${mergedClsPrefixRef.value}-message-bubble__text`
250
- }, slots.default ? slots.default(messagePayloadRef.value) : resolveRenderContent(props.content))) : normalizedAttachmentsRef.value.length === 1 ? renderAttachment() : null;
259
+ }, slots.default ? slots.default(messagePayloadRef.value) : resolveRenderContent(props.content)), hasAfterContent && h("div", {
260
+ class: `${mergedClsPrefixRef.value}-message-bubble__after-content`
261
+ }, afterContentSlot === null || afterContentSlot === void 0 ? void 0 : afterContentSlot(messagePayloadRef.value))) : normalizedAttachmentsRef.value.length === 1 ? renderAttachment() : null;
251
262
  return h("div", {
252
263
  class: [`${mergedClsPrefixRef.value}-message-bubble__message`, props.isOwn ? `${mergedClsPrefixRef.value}-message-bubble__message--own` : `${mergedClsPrefixRef.value}-message-bubble__message--other`]
253
264
  }, h("div", {
@@ -26,6 +26,8 @@ export declare enum MessageBubbleAttachmentStatus {
26
26
  export interface MessageBubbleSlots {
27
27
  default?: (message: MessageBubbleMessagePayload) => VNodeChild;
28
28
  title?: (message: MessageBubbleMessagePayload) => VNodeChild;
29
+ afterContent?: (message: MessageBubbleMessagePayload) => VNodeChild;
30
+ 'after-content'?: (message: MessageBubbleMessagePayload) => VNodeChild;
29
31
  service?: (variant: MessageBubbleServiceVariant) => VNodeChild;
30
32
  messageStatus?: (message: MessageBubbleMessagePayload) => VNodeChild;
31
33
  bubbleActions?: (message: MessageBubbleMessagePayload) => VNodeChild;
@@ -50,6 +50,8 @@ export default cB('message-bubble', `
50
50
  width: fit-content;
51
51
  display: flex;
52
52
  flex-direction: column;
53
+ padding: 12px;
54
+ gap: 12px;
53
55
  `, [cM('own', `
54
56
  background-color: var(--u-message-bubble-background-color-own);
55
57
  color: var(--u-message-bubble-text-color-own);
@@ -57,16 +59,12 @@ export default cB('message-bubble', `
57
59
  border-bottom-right-radius: 6px;
58
60
  `)]), cE('title', `
59
61
  color: var(--u-message-bubble-title-color);
60
- padding: 12px 16px 0;
61
62
  white-space: pre-wrap;
62
63
  `), cE('text', `
63
- padding: 12px 16px;
64
64
  white-space: pre-wrap;
65
- `), cE('text', `
66
- padding-top: 8px;
67
- `, [c('&&:first-child', `
68
- padding-top: 12px;
69
- `)]), cE('meta', `
65
+ `), cE('after-content', `
66
+ white-space: normal;
67
+ `), cE('meta', `
70
68
  display: flex;
71
69
  align-items: center;
72
70
  gap: 4px;
@@ -1,7 +1,8 @@
1
1
  export { publicDownload as uploadDownload } from '../_utils/dom/download';
2
2
  export type { CustomRequestOptions as UploadCustomRequestOptions, FileInfo as UploadFileInfo, UploadInst, SettledFileInfo as UploadSettledFileInfo } from './src/interface';
3
+ export { uploadProps, type UploadProps } from './src/interface';
3
4
  export type * from './src/public-types';
4
- export { uploadProps, type UploadProps, default as UUpload } from './src/Upload';
5
+ export { default as UUpload } from './src/Upload';
5
6
  export { default as UUploadDragger } from './src/UploadDragger';
6
7
  export { default as UUploadFileList } from './src/UploadFileList';
7
8
  export { default as UUploadTrigger } from './src/UploadTrigger';
@@ -1,5 +1,6 @@
1
1
  export { publicDownload as uploadDownload } from "../_utils/dom/download.mjs";
2
- export { uploadProps, default as UUpload } from "./src/Upload.mjs";
2
+ export { uploadProps } from "./src/interface.mjs";
3
+ export { default as UUpload } from "./src/Upload.mjs";
3
4
  export { default as UUploadDragger } from "./src/UploadDragger.mjs";
4
5
  export { default as UUploadFileList } from "./src/UploadFileList.mjs";
5
6
  export { default as UUploadTrigger } from "./src/UploadTrigger.mjs";