@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;
@@ -352,13 +352,14 @@ exports.default = (0, vue_1.defineComponent)({
352
352
  }
353
353
  }
354
354
  const cssVarsRef = (0, vue_1.computed)(() => {
355
- const { common: { cubicBezierEaseInOut }, self: { toolbarIconColor, toolbarBorderRadius, toolbarBoxShadow, toolbarColor } } = themeRef.value;
355
+ const { common: { cubicBezierEaseInOut }, self: { toolbarIconColor, toolbarBorderRadius, toolbarBoxShadow, toolbarColor, overlayColor } } = themeRef.value;
356
356
  return {
357
357
  '--u-bezier': cubicBezierEaseInOut,
358
358
  '--u-toolbar-icon-color': toolbarIconColor,
359
359
  '--u-toolbar-color': toolbarColor,
360
360
  '--u-toolbar-border-radius': toolbarBorderRadius,
361
- '--u-toolbar-box-shadow': toolbarBoxShadow
361
+ '--u-toolbar-box-shadow': toolbarBoxShadow,
362
+ '--u-overlay-color': overlayColor
362
363
  };
363
364
  });
364
365
  const { inlineThemeDisabled } = (0, _mixins_1.useConfig)();
@@ -394,21 +395,13 @@ exports.default = (0, vue_1.defineComponent)({
394
395
  render() {
395
396
  var _a, _b;
396
397
  const { clsPrefix, renderToolbar, withTooltip } = this;
397
- const prevNode = withTooltip((0, vue_1.h)(_internal_1.UBaseIcon, { clsPrefix: clsPrefix, onClick: this.handleSwitchPrev }, { default: () => icons_2.prevIcon }), 'tipPrevious');
398
- const nextNode = withTooltip((0, vue_1.h)(_internal_1.UBaseIcon, { clsPrefix: clsPrefix, onClick: this.handleSwitchNext }, { default: () => icons_2.nextIcon }), 'tipNext');
399
398
  const rotateCounterclockwiseNode = withTooltip((0, vue_1.h)(_internal_1.UBaseIcon, { clsPrefix: clsPrefix, onClick: this.rotateCounterclockwise }, {
400
399
  default: () => (0, vue_1.h)(icons_1.RotateCounterclockwiseIcon, null)
401
400
  }), 'tipCounterclockwise');
402
401
  const rotateClockwiseNode = withTooltip((0, vue_1.h)(_internal_1.UBaseIcon, { clsPrefix: clsPrefix, onClick: this.rotateClockwise }, {
403
402
  default: () => (0, vue_1.h)(icons_1.RotateClockwiseIcon, null)
404
403
  }), 'tipClockwise');
405
- const originalSizeNode = withTooltip((0, vue_1.h)(_internal_1.UBaseIcon, { clsPrefix: clsPrefix, onClick: this.resizeToOrignalImageSize }, {
406
- default: () => {
407
- return (0, vue_1.h)(icons_1.ResizeSmallIcon, null);
408
- }
409
- }), 'tipOriginalSize');
410
404
  const zoomOutNode = withTooltip((0, vue_1.h)(_internal_1.UBaseIcon, { clsPrefix: clsPrefix, onClick: this.zoomOut }, { default: () => (0, vue_1.h)(icons_1.ZoomOutIcon, null) }), 'tipZoomOut');
411
- const downloadNode = withTooltip((0, vue_1.h)(_internal_1.UBaseIcon, { clsPrefix: clsPrefix, onClick: this.handleDownloadClick }, { default: () => icons_2.downloadIcon }), 'tipDownload');
412
405
  const closeNode = withTooltip((0, vue_1.h)(_internal_1.UBaseIcon, { clsPrefix: clsPrefix, onClick: () => this.close() }, { default: () => icons_2.closeIcon }), 'tipClose');
413
406
  const zoomInNode = withTooltip((0, vue_1.h)(_internal_1.UBaseIcon, { clsPrefix: clsPrefix, onClick: this.zoomIn }, { default: () => (0, vue_1.h)(icons_1.ZoomInIcon, null) }), 'tipZoomIn');
414
407
  return ((0, vue_1.h)(vue_1.Fragment, null, (_b = (_a = this.$slots).default) === null || _b === void 0 ? void 0 :
@@ -433,26 +426,17 @@ exports.default = (0, vue_1.defineComponent)({
433
426
  return null;
434
427
  return ((0, vue_1.h)("div", { class: `${clsPrefix}-image-preview-toolbar` }, renderToolbar ? (renderToolbar({
435
428
  nodes: {
436
- prev: prevNode,
437
- next: nextNode,
438
429
  rotateCounterclockwise: rotateCounterclockwiseNode,
439
430
  rotateClockwise: rotateClockwiseNode,
440
- resizeToOriginalSize: originalSizeNode,
441
431
  zoomOut: zoomOutNode,
442
432
  zoomIn: zoomInNode,
443
- download: downloadNode,
444
433
  close: closeNode
445
434
  }
446
435
  })) : ((0, vue_1.h)(vue_1.Fragment, null,
447
- this.onPrev ? ((0, vue_1.h)(vue_1.Fragment, null,
448
- prevNode,
449
- nextNode)) : null,
450
436
  rotateCounterclockwiseNode,
451
437
  rotateClockwiseNode,
452
- originalSizeNode,
453
438
  zoomOutNode,
454
439
  zoomInNode,
455
- downloadNode,
456
440
  closeNode))));
457
441
  }
458
442
  })) : null,
@@ -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
  }
@@ -100,6 +100,12 @@ exports.default = (0, vue_1.defineComponent)({
100
100
  const url = [attachment.preview, attachment.thumbnail].find(value => typeof value === 'string');
101
101
  return url !== null && url !== void 0 ? url : null;
102
102
  };
103
+ const getAttachmentUrl = (attachment) => {
104
+ if (!attachment.url || attachment.url === '#')
105
+ return null;
106
+ return attachment.url;
107
+ };
108
+ const isAttachmentPreviewable = (file) => Boolean(file.thumbnailUrl);
103
109
  const handleAttachmentDownload = (file) => __awaiter(this, void 0, void 0, function* () {
104
110
  if (props.onAttachmentDownload) {
105
111
  const attachment = normalizedAttachmentsRef.value.find(item => item.name === file.name);
@@ -135,20 +141,20 @@ exports.default = (0, vue_1.defineComponent)({
135
141
  return slots.messageAttachment(messagePayloadRef.value);
136
142
  }
137
143
  const fileList = normalizedAttachmentsRef.value.map(attachment => {
138
- var _a, _b, _c;
144
+ var _a, _b;
139
145
  return ({
140
146
  id: String(attachment.id),
141
147
  name: attachment.name,
142
148
  status: attachment.status || interface_1.MessageBubbleAttachmentStatus.FINISHED,
143
149
  percentage: (_a = attachment.percentage) !== null && _a !== void 0 ? _a : null,
144
- url: (_b = attachment.url) !== null && _b !== void 0 ? _b : null,
150
+ url: getAttachmentUrl(attachment),
145
151
  thumbnailUrl: getThumbnailUrl(attachment),
146
- type: (_c = attachment.type) !== null && _c !== void 0 ? _c : null,
152
+ type: (_b = attachment.type) !== null && _b !== void 0 ? _b : null,
147
153
  file: null,
148
154
  batchId: null
149
155
  });
150
156
  });
151
- const uploadComponent = ((0, vue_1.h)(upload_1.UUpload, Object.assign({ abstract: true, fileList: fileList, fileListStyle: withPadding
157
+ const uploadComponent = ((0, vue_1.h)(upload_1.UUpload, Object.assign({ abstract: true, listType: "preview-list", shouldUseThumbnailUrl: isAttachmentPreviewable, fileList: fileList, fileListStyle: withPadding
152
158
  ? {
153
159
  display: 'flex',
154
160
  flexDirection: 'column',
@@ -181,8 +187,11 @@ exports.default = (0, vue_1.defineComponent)({
181
187
  const hasBubbleActionsSlot = slots.bubbleActions !== undefined;
182
188
  const hasBubbleActionsConfig = Boolean(props.actions && props.actions.length > 0);
183
189
  const hasTitle = Boolean(props.title || slots.title);
190
+ const afterContentSlot = slots.afterContent || slots['after-content'];
191
+ const hasAfterContent = Boolean(afterContentSlot);
184
192
  const hasContentInsideBubble = Boolean(props.content
185
193
  || slots.default
194
+ || hasAfterContent
186
195
  || hasTitle
187
196
  || normalizedAttachmentsRef.value.length > 1);
188
197
  const messageBubbleContent = hasContentInsideBubble ? ((0, vue_1.h)("div", { class: [
@@ -197,7 +206,8 @@ exports.default = (0, vue_1.defineComponent)({
197
206
  normalizedAttachmentsRef.value.length > 0 && renderAttachment(true),
198
207
  (props.content || slots.default) && ((0, vue_1.h)("div", { class: `${mergedClsPrefixRef.value}-message-bubble__text` }, slots.default
199
208
  ? slots.default(messagePayloadRef.value)
200
- : resolveRenderContent(props.content))))) : normalizedAttachmentsRef.value.length === 1 ? (renderAttachment()) : null;
209
+ : resolveRenderContent(props.content))),
210
+ 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;
201
211
  return ((0, vue_1.h)("div", { class: [
202
212
  `${mergedClsPrefixRef.value}-message-bubble__message`,
203
213
  props.isOwn
@@ -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;
@@ -55,6 +55,8 @@ exports.default = (0, cssr_1.cB)('message-bubble', `
55
55
  width: fit-content;
56
56
  display: flex;
57
57
  flex-direction: column;
58
+ padding: 12px;
59
+ gap: 12px;
58
60
  `, [(0, cssr_1.cM)('own', `
59
61
  background-color: var(--u-message-bubble-background-color-own);
60
62
  color: var(--u-message-bubble-text-color-own);
@@ -62,16 +64,12 @@ exports.default = (0, cssr_1.cB)('message-bubble', `
62
64
  border-bottom-right-radius: 6px;
63
65
  `)]), (0, cssr_1.cE)('title', `
64
66
  color: var(--u-message-bubble-title-color);
65
- padding: 12px 16px 0;
66
67
  white-space: pre-wrap;
67
68
  `), (0, cssr_1.cE)('text', `
68
- padding: 12px 16px;
69
69
  white-space: pre-wrap;
70
- `), (0, cssr_1.cE)('text', `
71
- padding-top: 8px;
72
- `, [(0, cssr_1.c)('&&:first-child', `
73
- padding-top: 12px;
74
- `)]), (0, cssr_1.cE)('meta', `
70
+ `), (0, cssr_1.cE)('after-content', `
71
+ white-space: normal;
72
+ `), (0, cssr_1.cE)('meta', `
75
73
  display: flex;
76
74
  align-items: center;
77
75
  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';
@@ -6,8 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.UUploadTrigger = exports.UUploadFileList = exports.UUploadDragger = exports.UUpload = exports.uploadProps = exports.uploadDownload = void 0;
7
7
  var download_1 = require("../_utils/dom/download");
8
8
  Object.defineProperty(exports, "uploadDownload", { enumerable: true, get: function () { return download_1.publicDownload; } });
9
+ var interface_1 = require("./src/interface");
10
+ Object.defineProperty(exports, "uploadProps", { enumerable: true, get: function () { return interface_1.uploadProps; } });
9
11
  var Upload_1 = require("./src/Upload");
10
- Object.defineProperty(exports, "uploadProps", { enumerable: true, get: function () { return Upload_1.uploadProps; } });
11
12
  Object.defineProperty(exports, "UUpload", { enumerable: true, get: function () { return __importDefault(Upload_1).default; } });
12
13
  var UploadDragger_1 = require("./src/UploadDragger");
13
14
  Object.defineProperty(exports, "UUploadDragger", { enumerable: true, get: function () { return __importDefault(UploadDragger_1).default; } });