@king-design/vue 3.7.0 → 3.8.0-beta.0

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 (227) hide show
  1. package/__tests__/__snapshots__/Vue Next Demos.md +399 -0
  2. package/components/bubble/bubble.d.ts +61 -0
  3. package/components/bubble/bubble.js +81 -0
  4. package/components/bubble/bubble.vdt.js +85 -0
  5. package/components/bubble/index.d.ts +1 -0
  6. package/components/bubble/index.js +1 -0
  7. package/components/bubble/index.spec.d.ts +1 -0
  8. package/components/bubble/index.spec.js +771 -0
  9. package/components/bubble/styles.d.ts +5 -0
  10. package/components/bubble/styles.js +53 -0
  11. package/components/bubble/useBubbleDisplay.d.ts +18 -0
  12. package/components/bubble/useBubbleDisplay.js +300 -0
  13. package/components/bubbleList/bubbleList.d.ts +87 -0
  14. package/components/bubbleList/bubbleList.js +75 -0
  15. package/components/bubbleList/bubbleList.vdt.js +143 -0
  16. package/components/bubbleList/index.d.ts +1 -0
  17. package/components/bubbleList/index.js +1 -0
  18. package/components/bubbleList/index.spec.d.ts +1 -0
  19. package/components/bubbleList/index.spec.js +1268 -0
  20. package/components/bubbleList/item.d.ts +16 -0
  21. package/components/bubbleList/item.js +27 -0
  22. package/components/bubbleList/item.vdt.js +36 -0
  23. package/components/bubbleList/styles.d.ts +5 -0
  24. package/components/bubbleList/styles.js +33 -0
  25. package/components/bubbleList/useBubbleList.d.ts +28 -0
  26. package/components/bubbleList/useBubbleList.js +455 -0
  27. package/components/checkbox/index.d.ts +3 -3
  28. package/components/fileCard/fileCard.d.ts +65 -0
  29. package/components/fileCard/fileCard.js +72 -0
  30. package/components/fileCard/fileCard.vdt.js +161 -0
  31. package/components/fileCard/fileCardAssets.d.ts +1 -0
  32. package/components/fileCard/fileCardAssets.js +54 -0
  33. package/components/fileCard/fileCardUtils.d.ts +14 -0
  34. package/components/fileCard/fileCardUtils.js +94 -0
  35. package/components/fileCard/index.d.ts +2 -0
  36. package/components/fileCard/index.js +2 -0
  37. package/components/fileCard/index.spec.d.ts +1 -0
  38. package/components/fileCard/index.spec.js +1096 -0
  39. package/components/fileCard/list.d.ts +29 -0
  40. package/components/fileCard/list.js +46 -0
  41. package/components/fileCard/list.vdt.js +71 -0
  42. package/components/fileCard/styles.d.ts +5 -0
  43. package/components/fileCard/styles.js +83 -0
  44. package/components/fileCard/useFileCard.d.ts +45 -0
  45. package/components/fileCard/useFileCard.js +330 -0
  46. package/components/fileCard/useFileCardList.d.ts +14 -0
  47. package/components/fileCard/useFileCardList.js +49 -0
  48. package/components/form/form.js +2 -1
  49. package/components/media/context.d.ts +6 -0
  50. package/components/media/context.js +2 -0
  51. package/components/media/group.d.ts +12 -0
  52. package/components/media/group.js +32 -0
  53. package/components/media/group.vdt.js +50 -0
  54. package/components/media/index.d.ts +2 -0
  55. package/components/media/index.js +2 -0
  56. package/components/media/index.spec.d.ts +1 -0
  57. package/components/media/index.spec.js +1691 -0
  58. package/components/media/media.d.ts +37 -0
  59. package/components/media/media.js +67 -0
  60. package/components/media/media.vdt.js +202 -0
  61. package/components/media/mediaAssets.d.ts +4 -0
  62. package/components/media/mediaAssets.js +9 -0
  63. package/components/media/mediaUtils.d.ts +6 -0
  64. package/components/media/mediaUtils.js +66 -0
  65. package/components/media/styles.d.ts +13 -0
  66. package/components/media/styles.js +52 -0
  67. package/components/media/types.d.ts +37 -0
  68. package/components/media/types.js +1 -0
  69. package/components/media/useMedia.d.ts +70 -0
  70. package/components/media/useMedia.js +471 -0
  71. package/components/media/useMediaGroup.d.ts +15 -0
  72. package/components/media/useMediaGroup.js +136 -0
  73. package/components/media/useMediaViewer.d.ts +14 -0
  74. package/components/media/useMediaViewer.js +129 -0
  75. package/components/media/viewer.d.ts +24 -0
  76. package/components/media/viewer.js +54 -0
  77. package/components/media/viewer.vdt.js +100 -0
  78. package/components/radio/index.d.ts +3 -3
  79. package/components/sender/icons.d.ts +3 -0
  80. package/components/sender/icons.js +17 -0
  81. package/components/sender/index.d.ts +1 -0
  82. package/components/sender/index.js +1 -0
  83. package/components/sender/index.spec.d.ts +1 -0
  84. package/components/sender/index.spec.js +1597 -0
  85. package/components/sender/sender.d.ts +104 -0
  86. package/components/sender/sender.js +111 -0
  87. package/components/sender/sender.vdt.js +230 -0
  88. package/components/sender/styles.d.ts +5 -0
  89. package/components/sender/styles.js +56 -0
  90. package/components/sender/useAutoResize.d.ts +4 -0
  91. package/components/sender/useAutoResize.js +99 -0
  92. package/components/sender/useSenderDrag.d.ts +6 -0
  93. package/components/sender/useSenderDrag.js +320 -0
  94. package/components/sender/useSenderInput.d.ts +16 -0
  95. package/components/sender/useSenderInput.js +101 -0
  96. package/components/sender/useSenderPaste.d.ts +5 -0
  97. package/components/sender/useSenderPaste.js +36 -0
  98. package/components/sender/useSenderUpload.d.ts +11 -0
  99. package/components/sender/useSenderUpload.js +395 -0
  100. package/components/skeleton/skeleton.d.ts +2 -1
  101. package/components/skeleton/skeleton.js +1 -1
  102. package/components/think/index.d.ts +1 -0
  103. package/components/think/index.js +1 -0
  104. package/components/think/index.spec.d.ts +1 -0
  105. package/components/think/index.spec.js +345 -0
  106. package/components/think/index.vdt.js +82 -0
  107. package/components/think/styles.d.ts +5 -0
  108. package/components/think/styles.js +25 -0
  109. package/components/think/think.d.ts +28 -0
  110. package/components/think/think.js +48 -0
  111. package/components/think/useThinkExpand.d.ts +10 -0
  112. package/components/think/useThinkExpand.js +56 -0
  113. package/components/types.d.ts +4 -2
  114. package/components/upload/ajaxUploader.d.ts +1 -0
  115. package/components/upload/ajaxUploader.js +6 -0
  116. package/components/xmarkdown/index.d.ts +2 -0
  117. package/components/xmarkdown/index.js +1 -0
  118. package/components/xmarkdown/index.spec.d.ts +1 -0
  119. package/components/xmarkdown/index.spec.js +1666 -0
  120. package/components/xmarkdown/markdown/codeBlockRenderer.d.ts +8 -0
  121. package/components/xmarkdown/markdown/codeBlockRenderer.js +52 -0
  122. package/components/xmarkdown/markdown/codeblock.d.ts +8 -0
  123. package/components/xmarkdown/markdown/codeblock.js +74 -0
  124. package/components/xmarkdown/markdown/highlight.d.ts +17 -0
  125. package/components/xmarkdown/markdown/highlight.js +83 -0
  126. package/components/xmarkdown/markdown/index.d.ts +14 -0
  127. package/components/xmarkdown/markdown/index.js +14 -0
  128. package/components/xmarkdown/markdown/mermaid.d.ts +8 -0
  129. package/components/xmarkdown/markdown/mermaid.js +104 -0
  130. package/components/xmarkdown/markdown/renderTree.d.ts +54 -0
  131. package/components/xmarkdown/markdown/renderTree.js +386 -0
  132. package/components/xmarkdown/markdown/renderer.d.ts +18 -0
  133. package/components/xmarkdown/markdown/renderer.js +461 -0
  134. package/components/xmarkdown/markdown/streaming.d.ts +24 -0
  135. package/components/xmarkdown/markdown/streaming.js +513 -0
  136. package/components/xmarkdown/markdown/types.d.ts +124 -0
  137. package/components/xmarkdown/markdown/types.js +6 -0
  138. package/components/xmarkdown/markdown/utils.d.ts +7 -0
  139. package/components/xmarkdown/markdown/utils.js +9 -0
  140. package/components/xmarkdown/markdown.d.ts +1 -0
  141. package/components/xmarkdown/markdown.js +1 -0
  142. package/components/xmarkdown/styles.d.ts +5 -0
  143. package/components/xmarkdown/styles.js +50 -0
  144. package/components/xmarkdown/useMermaid.d.ts +27 -0
  145. package/components/xmarkdown/useMermaid.js +745 -0
  146. package/components/xmarkdown/useXMarkdownContent.d.ts +14 -0
  147. package/components/xmarkdown/useXMarkdownContent.js +218 -0
  148. package/components/xmarkdown/useXMarkdownDisplay.d.ts +26 -0
  149. package/components/xmarkdown/useXMarkdownDisplay.js +569 -0
  150. package/components/xmarkdown/xmarkdown.d.ts +61 -0
  151. package/components/xmarkdown/xmarkdown.js +109 -0
  152. package/components/xmarkdown/xmarkdown.vdt.js +43 -0
  153. package/dist/fonts/KaTeX_AMS-Regular.ttf +0 -0
  154. package/dist/fonts/KaTeX_AMS-Regular.woff +0 -0
  155. package/dist/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  156. package/dist/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
  157. package/dist/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
  158. package/dist/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  159. package/dist/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
  160. package/dist/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
  161. package/dist/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  162. package/dist/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
  163. package/dist/fonts/KaTeX_Fraktur-Bold.woff +0 -0
  164. package/dist/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  165. package/dist/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
  166. package/dist/fonts/KaTeX_Fraktur-Regular.woff +0 -0
  167. package/dist/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  168. package/dist/fonts/KaTeX_Main-Bold.ttf +0 -0
  169. package/dist/fonts/KaTeX_Main-Bold.woff +0 -0
  170. package/dist/fonts/KaTeX_Main-Bold.woff2 +0 -0
  171. package/dist/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
  172. package/dist/fonts/KaTeX_Main-BoldItalic.woff +0 -0
  173. package/dist/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  174. package/dist/fonts/KaTeX_Main-Italic.ttf +0 -0
  175. package/dist/fonts/KaTeX_Main-Italic.woff +0 -0
  176. package/dist/fonts/KaTeX_Main-Italic.woff2 +0 -0
  177. package/dist/fonts/KaTeX_Main-Regular.ttf +0 -0
  178. package/dist/fonts/KaTeX_Main-Regular.woff +0 -0
  179. package/dist/fonts/KaTeX_Main-Regular.woff2 +0 -0
  180. package/dist/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
  181. package/dist/fonts/KaTeX_Math-BoldItalic.woff +0 -0
  182. package/dist/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  183. package/dist/fonts/KaTeX_Math-Italic.ttf +0 -0
  184. package/dist/fonts/KaTeX_Math-Italic.woff +0 -0
  185. package/dist/fonts/KaTeX_Math-Italic.woff2 +0 -0
  186. package/dist/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
  187. package/dist/fonts/KaTeX_SansSerif-Bold.woff +0 -0
  188. package/dist/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  189. package/dist/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
  190. package/dist/fonts/KaTeX_SansSerif-Italic.woff +0 -0
  191. package/dist/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  192. package/dist/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
  193. package/dist/fonts/KaTeX_SansSerif-Regular.woff +0 -0
  194. package/dist/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  195. package/dist/fonts/KaTeX_Script-Regular.ttf +0 -0
  196. package/dist/fonts/KaTeX_Script-Regular.woff +0 -0
  197. package/dist/fonts/KaTeX_Script-Regular.woff2 +0 -0
  198. package/dist/fonts/KaTeX_Size1-Regular.ttf +0 -0
  199. package/dist/fonts/KaTeX_Size1-Regular.woff +0 -0
  200. package/dist/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  201. package/dist/fonts/KaTeX_Size2-Regular.ttf +0 -0
  202. package/dist/fonts/KaTeX_Size2-Regular.woff +0 -0
  203. package/dist/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  204. package/dist/fonts/KaTeX_Size3-Regular.ttf +0 -0
  205. package/dist/fonts/KaTeX_Size3-Regular.woff +0 -0
  206. package/dist/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  207. package/dist/fonts/KaTeX_Size4-Regular.ttf +0 -0
  208. package/dist/fonts/KaTeX_Size4-Regular.woff +0 -0
  209. package/dist/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  210. package/dist/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
  211. package/dist/fonts/KaTeX_Typewriter-Regular.woff +0 -0
  212. package/dist/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  213. package/dist/i18n/en-US.js +29 -1
  214. package/dist/i18n/en-US.js.map +1 -1
  215. package/dist/i18n/en-US.min.js +1 -1
  216. package/dist/index.js +100506 -37457
  217. package/dist/index.js.map +1 -1
  218. package/dist/index.min.js +1569 -1
  219. package/dist/kpc.css +4 -0
  220. package/dist/ksyun.css +4 -0
  221. package/i18n/en-US.d.ts +27 -0
  222. package/i18n/en-US.js +29 -1
  223. package/index.d.ts +9 -2
  224. package/index.js +9 -2
  225. package/package.json +8 -2
  226. package/styles/global.js +12 -6
  227. package/yarn-error.log +0 -1012
@@ -0,0 +1,65 @@
1
+ import { Component, TypeDefs } from 'intact-vue-next';
2
+ import type { Events } from '../types';
3
+ import type { ResolvedFileCardType } from './fileCardUtils';
4
+ import type { MediaMaskValue } from '../media';
5
+ export type { ResolvedFileCardType } from './fileCardUtils';
6
+ export type FileCardType = 'file' | 'image' | 'video' | 'audio' | string;
7
+ export type FileCardStatus = 'default' | 'loading' | 'error' | 'done';
8
+ export type FileCardSize = 'mini' | 'small' | 'default' | 'large';
9
+ export type FileCardNativeProps = Record<string, any>;
10
+ export type FileCardValue = {
11
+ name?: string;
12
+ type?: FileCardType;
13
+ resolvedType: ResolvedFileCardType;
14
+ status: FileCardStatus;
15
+ src?: string;
16
+ poster?: string;
17
+ description?: string;
18
+ errorText?: string;
19
+ loadingText?: string;
20
+ byte?: number;
21
+ percent?: number;
22
+ size: FileCardSize;
23
+ };
24
+ export type FileCardMaskValue = FileCardValue & {
25
+ canPreview?: MediaMaskValue['canPreview'];
26
+ preview?: MediaMaskValue['preview'];
27
+ };
28
+ export interface FileCardProps {
29
+ name?: string;
30
+ type?: FileCardType;
31
+ status?: FileCardStatus;
32
+ src?: string;
33
+ poster?: string;
34
+ description?: string;
35
+ errorText?: string;
36
+ loadingText?: string;
37
+ byte?: number;
38
+ percent?: number;
39
+ showPreview?: boolean;
40
+ showNameTooltip?: boolean;
41
+ showDelIcon?: boolean;
42
+ icon?: string;
43
+ size?: FileCardSize;
44
+ imageProps?: FileCardNativeProps;
45
+ videoProps?: FileCardNativeProps;
46
+ audioProps?: FileCardNativeProps;
47
+ }
48
+ export interface FileCardEvents {
49
+ click: [FileCardValue, MouseEvent];
50
+ preview: [FileCardValue, MouseEvent];
51
+ delete: [FileCardValue, MouseEvent];
52
+ }
53
+ export interface FileCardBlocks {
54
+ icon: null;
55
+ description: null;
56
+ mask: FileCardMaskValue;
57
+ }
58
+ export declare class FileCard extends Component<FileCardProps, FileCardEvents, FileCardBlocks> {
59
+ static template: string | import('intact-vue-next').Template<any>;
60
+ static typeDefs: Required<TypeDefs<FileCardProps>>;
61
+ static defaults: () => Partial<FileCardProps>;
62
+ static events: Events<FileCardEvents>;
63
+ private config;
64
+ private model;
65
+ }
@@ -0,0 +1,72 @@
1
+ import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
2
+ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
3
+ import { Component } from 'intact-vue-next';
4
+ import template from './fileCard.vdt';
5
+ import { useConfigContext } from '../config';
6
+ import { useFileCard } from './useFileCard';
7
+ var typeDefs = {
8
+ name: String,
9
+ type: String,
10
+ status: ['default', 'loading', 'error', 'done'],
11
+ src: String,
12
+ poster: String,
13
+ description: String,
14
+ errorText: String,
15
+ loadingText: String,
16
+ byte: Number,
17
+ percent: Number,
18
+ showPreview: Boolean,
19
+ showNameTooltip: Boolean,
20
+ showDelIcon: Boolean,
21
+ icon: String,
22
+ size: ['mini', 'small', 'default', 'large'],
23
+ imageProps: Object,
24
+ videoProps: Object,
25
+ audioProps: Object
26
+ };
27
+ var defaults = function defaults() {
28
+ return {
29
+ name: undefined,
30
+ type: undefined,
31
+ status: 'default',
32
+ src: undefined,
33
+ poster: undefined,
34
+ description: undefined,
35
+ errorText: undefined,
36
+ loadingText: undefined,
37
+ byte: undefined,
38
+ percent: undefined,
39
+ showPreview: true,
40
+ showNameTooltip: false,
41
+ showDelIcon: false,
42
+ icon: undefined,
43
+ size: 'default',
44
+ imageProps: undefined,
45
+ videoProps: undefined,
46
+ audioProps: undefined
47
+ };
48
+ };
49
+ var events = {
50
+ click: true,
51
+ preview: true,
52
+ delete: true
53
+ };
54
+ export var FileCard = /*#__PURE__*/function (_Component) {
55
+ _inheritsLoose(FileCard, _Component);
56
+ function FileCard() {
57
+ var _context;
58
+ var _this;
59
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
60
+ args[_key] = arguments[_key];
61
+ }
62
+ _this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
63
+ _this.config = useConfigContext();
64
+ _this.model = useFileCard();
65
+ return _this;
66
+ }
67
+ return FileCard;
68
+ }(Component);
69
+ FileCard.template = template;
70
+ FileCard.typeDefs = typeDefs;
71
+ FileCard.defaults = defaults;
72
+ FileCard.events = events;
@@ -0,0 +1,161 @@
1
+ import _extends from "@babel/runtime-corejs3/helpers/extends";
2
+ import { createVNode as _$cv, className as _$cn, createElementVNode as _$ce, createUnknownComponentVNode as _$cc, extend as _$ex, EMPTY_OBJ as _$em, noop as _$no } from 'intact-vue-next';
3
+ import { Icon } from '../icon';
4
+ import { Media } from '../media';
5
+ import { getRestProps, isEmptyString } from '../utils';
6
+ import { makeStyles } from './styles';
7
+ import { _$ } from '../../i18n';
8
+ import { isInvalid, noop } from 'intact-shared';
9
+ export default function ($props, $blocks, $__proto__) {
10
+ var _extends2, _$cn2, _$cn3;
11
+ $blocks || ($blocks = {});
12
+ $props || ($props = {});
13
+ var $this = this;
14
+ var _$blocks = {};
15
+ var __$blocks = {};
16
+ var _this$model = this.model,
17
+ getRootClassNameObj = _this$model.getRootClassNameObj,
18
+ getProgressStyle = _this$model.getProgressStyle,
19
+ onClick = _this$model.onClick,
20
+ isMediaType = _this$model.isMediaType,
21
+ shouldShowDeleteButton = _this$model.shouldShowDeleteButton,
22
+ onDelete = _this$model.onDelete,
23
+ getValue = _this$model.getValue,
24
+ onPreview = _this$model.onPreview,
25
+ isError = _this$model.isError,
26
+ getMediaLoadingText = _this$model.getMediaLoadingText,
27
+ getMediaErrorText = _this$model.getMediaErrorText,
28
+ getMediaErrorArtworkIconSrc = _this$model.getMediaErrorArtworkIconSrc,
29
+ shouldShowMediaStatusLayer = _this$model.shouldShowMediaStatusLayer,
30
+ shouldRenderMediaErrorArtwork = _this$model.shouldRenderMediaErrorArtwork,
31
+ shouldUseMediaErrorArtworkLayout = _this$model.shouldUseMediaErrorArtworkLayout,
32
+ shouldShowVisualMediaProgressText = _this$model.shouldShowVisualMediaProgressText,
33
+ getMediaProgressText = _this$model.getMediaProgressText,
34
+ getFileBadgeClassName = _this$model.getFileBadgeClassName,
35
+ getFileBadgeText = _this$model.getFileBadgeText,
36
+ hasCustomIcon = _this$model.hasCustomIcon,
37
+ getIconSource = _this$model.getIconSource,
38
+ hasBuiltinIcon = _this$model.hasBuiltinIcon,
39
+ getBuiltinIconSource = _this$model.getBuiltinIconSource,
40
+ getFileName = _this$model.getFileName,
41
+ getFileTitleText = _this$model.getFileTitleText,
42
+ getNamePrefix = _this$model.getNamePrefix,
43
+ hasNameSuffix = _this$model.hasNameSuffix,
44
+ getNameSuffix = _this$model.getNameSuffix,
45
+ shouldShowMiniFileStatusTitle = _this$model.shouldShowMiniFileStatusTitle,
46
+ getDisplayDescription = _this$model.getDisplayDescription,
47
+ getMediaType = _this$model.getMediaType,
48
+ getFileMediaType = _this$model.getFileMediaType,
49
+ getMediaStatus = _this$model.getMediaStatus,
50
+ getMediaShowPreview = _this$model.getMediaShowPreview,
51
+ onMediaError = _this$model.onMediaError,
52
+ getMediaSize = _this$model.getMediaSize,
53
+ getFileMediaSize = _this$model.getFileMediaSize,
54
+ shouldShowFileMedia = _this$model.shouldShowFileMedia;
55
+ var _this$get = this.get(),
56
+ className = _this$get.className,
57
+ style = _this$get.style;
58
+ var k = this.config.k;
59
+ var maskBlock = $blocks.mask;
60
+ var isEmptySlot = function isEmptySlot(value) {
61
+ if (isInvalid(value) || isEmptyString(value)) return true;
62
+ if (Array.isArray(value)) return value.every(function (item) {
63
+ return isEmptySlot(item);
64
+ });
65
+ if (value && value.type === 1) return isEmptySlot(value.children);
66
+ return false;
67
+ };
68
+ var value = getValue();
69
+ var shouldShowFileContent = !isMediaType();
70
+ var descriptionSlot = shouldShowFileContent && $blocks.description ? $blocks.description(noop, value) : undefined;
71
+ var fileMaskSlot = shouldShowFileContent && maskBlock ? maskBlock(noop, value) : undefined;
72
+ var hasDescriptionSlot = !isEmptySlot(descriptionSlot);
73
+ var hasFileMaskSlot = !isEmptySlot(fileMaskSlot);
74
+ var isMini = (this.get('size') || 'default') === 'mini';
75
+ var showDescription = !isMini && (hasDescriptionSlot || !!getDisplayDescription());
76
+ var classNameObj = _extends((_extends2 = {}, _extends2[k + "-file-card"] = true, _extends2[className] = className, _extends2[makeStyles(k)] = true, _extends2), getRootClassNameObj());
77
+ return _$cv('div', _extends({
78
+ 'className': _$cn(classNameObj)
79
+ }, getRestProps(this), {
80
+ 'style': style,
81
+ 'ev-click': onClick
82
+ }), [shouldShowDeleteButton() ? _$ce(2, 'div', _$cc(Icon, {
83
+ 'className': _$cn(k + "-icon-close-bold"),
84
+ 'color': 'inherit'
85
+ }), 2, _$cn(k + "-file-card-delete"), {
86
+ 'title': _$('删除'),
87
+ 'ev-click': onDelete
88
+ }) : undefined, !shouldShowFileContent ? _$ce(2, 'div', [_$cc(Media, {
89
+ 'className': _$cn(k + "-file-card-media-view"),
90
+ 'name': getFileName(),
91
+ 'type': getMediaType(),
92
+ 'status': getMediaStatus(),
93
+ 'src': this.get('src'),
94
+ 'poster': this.get('poster'),
95
+ 'size': getMediaSize(),
96
+ 'showPreview': getMediaShowPreview(),
97
+ 'showNameTooltip': this.get('showNameTooltip'),
98
+ 'imageProps': this.get('imageProps'),
99
+ 'videoProps': this.get('videoProps'),
100
+ 'audioProps': this.get('audioProps'),
101
+ 'ev-preview': onPreview,
102
+ 'ev-loadError': onMediaError,
103
+ '$blocks': function ($blocks) {
104
+ var _$blocks = {},
105
+ __$blocks = _$ex({}, $blocks);
106
+ return (_$blocks['error'] = function ($super) {
107
+ return shouldRenderMediaErrorArtwork() ? _$ce(2, 'div', [_$ce(2, 'img', null, 1, _$cn(k + "-file-card-media-error-artwork-icon"), {
108
+ 'src': getMediaErrorArtworkIconSrc(),
109
+ 'alt': '',
110
+ 'draggable': false
111
+ }), _$ce(2, 'span', getMediaErrorText(), 0, _$cn(k + "-file-card-error-text " + k + "-file-card-media-error-artwork-text"))], 4, _$cn(k + "-file-card-media-error-artwork-content")) : undefined;
112
+ }, __$blocks['error'] = function ($super, data) {
113
+ var block = $blocks['error'];
114
+ var callBlock = function callBlock() {
115
+ return _$blocks['error'].call($this, $super, data);
116
+ };
117
+ return block ? block.call($this, callBlock, data) : callBlock();
118
+ }), (_$blocks['mask'] = function ($super, media) {
119
+ return maskBlock && maskBlock(noop, media);
120
+ }, __$blocks['mask'] = function ($super, data) {
121
+ var block = $blocks['mask'];
122
+ var callBlock = function callBlock() {
123
+ return _$blocks['mask'].call($this, $super, data);
124
+ };
125
+ return block ? block.call($this, callBlock, data) : callBlock();
126
+ }), __$blocks;
127
+ }.call($this, _$em)
128
+ }), shouldShowMediaStatusLayer() && !shouldUseMediaErrorArtworkLayout() ? _$ce(2, 'div', _$ce(2, 'span', isError() ? getMediaErrorText() : getMediaLoadingText(), 0, _$cn((_$cn2 = {}, _$cn2[k + "-file-card-media-loading-text"] = !isError(), _$cn2[k + "-file-card-error-text"] = isError(), _$cn2))), 2, _$cn(k + "-file-card-media-status-layer")) : undefined, shouldShowVisualMediaProgressText() ? _$ce(2, 'div', getMediaProgressText(), 0, _$cn(k + "-file-card-media-progress-text")) : undefined], 0, _$cn(k + "-file-card-media-shell")) : _$ce(2, 'div', [_$ce(2, 'div', [shouldShowFileMedia() ? _$cc(Media, {
129
+ 'className': _$cn(k + "-file-card-file-media-view"),
130
+ 'name': getFileName(),
131
+ 'type': getFileMediaType(),
132
+ 'src': this.get('src'),
133
+ 'poster': this.get('poster'),
134
+ 'size': getFileMediaSize(),
135
+ 'showPreview': this.get('showPreview'),
136
+ 'showNameTooltip': false,
137
+ 'imageProps': this.get('imageProps'),
138
+ 'videoProps': this.get('videoProps'),
139
+ 'audioProps': this.get('audioProps'),
140
+ 'ev-preview': onPreview
141
+ }) : _$ce(2, 'div', hasCustomIcon() ? _$ce(2, 'img', null, 1, _$cn(k + "-file-card-file-icon-img"), {
142
+ 'src': getIconSource(),
143
+ 'alt': getFileName()
144
+ }) : $blocks.icon ? (_$blocks['icon'] = function ($super) {
145
+ return null;
146
+ }, __$blocks['icon'] = function ($super, data) {
147
+ var block = $blocks['icon'];
148
+ var callBlock = function callBlock() {
149
+ return _$blocks['icon'].call($this, $super, data);
150
+ };
151
+ return block ? block.call($this, callBlock, data) : callBlock();
152
+ }, __$blocks['icon'](_$no, getValue())) : hasBuiltinIcon() ? _$ce(2, 'img', null, 1, _$cn(k + "-file-card-file-icon-img"), {
153
+ 'src': getBuiltinIconSource(),
154
+ 'alt': getFileName()
155
+ }) : _$ce(2, 'span', getFileBadgeText(), 0), 0, _$cn(k + "-file-card-file-icon " + k + "-file-card-file-icon-" + getFileBadgeClassName())), _$ce(2, 'div', [_$ce(2, 'div', shouldShowMiniFileStatusTitle() ? _$ce(2, 'span', getFileTitleText(), 0, _$cn((_$cn3 = {}, _$cn3[k + "-file-card-title-prefix"] = true, _$cn3[k + "-file-card-title-status"] = true, _$cn3[k + "-file-card-title-status-error"] = isError(), _$cn3))) : [_$ce(2, 'span', getNamePrefix(), 0, _$cn(k + "-file-card-title-prefix")), hasNameSuffix() ? _$ce(2, 'span', getNameSuffix(), 0, _$cn(k + "-file-card-title-suffix")) : undefined], 0, _$cn(k + "-file-card-title"), {
156
+ 'title': getFileTitleText()
157
+ }), showDescription ? _$ce(2, 'div', hasDescriptionSlot ? descriptionSlot : _$ce(2, 'span', getDisplayDescription(), 0), 0, _$cn(k + "-file-card-description")) : undefined], 0, _$cn(k + "-file-card-file-content"))], 4, _$cn(k + "-file-card-file-main")), hasFileMaskSlot ? _$ce(2, 'div', fileMaskSlot, 0, _$cn(k + "-file-card-mask " + k + "-file-card-file-mask")) : undefined], 0, _$cn(k + "-file-card-file-shell"), {
158
+ 'style': getProgressStyle()
159
+ })]);
160
+ }
161
+ ;
@@ -0,0 +1 @@
1
+ export declare function getBuiltinFileIconByExtension(ext: string, resolvedType?: 'file' | 'image' | 'video' | 'audio'): string;
@@ -0,0 +1,54 @@
1
+ import _Set from "@babel/runtime-corejs3/core-js/set";
2
+ var fileIconWordSvg = "<svg width=\"31\" height=\"32\" viewBox=\"0 0 31 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g clip-path=\"url(#clip0_25057_14426)\">\n<path d=\"M1 4C1 1.79086 2.79086 0 5 0H18.7245L30 11.1914V28C30 30.2091 28.2091 32 26 32H5C2.79086 32 1 30.2091 1 28V4Z\" fill=\"url(#paint0_linear_25057_14426)\"/>\n<path d=\"M20.4315 23.5996C20.2061 23.5996 19.9844 23.513 19.8179 23.3494L15.514 19.1232L11.1806 23.3512C11.058 23.4709 10.9026 23.5519 10.7338 23.5841C10.565 23.6162 10.3903 23.5982 10.2319 23.5321C10.0733 23.4661 9.93795 23.3551 9.84275 23.213C9.74755 23.0708 9.69676 22.9039 9.69678 22.7332V12.466C9.69678 11.9877 10.0875 11.5996 10.5692 11.5996C11.0508 11.5996 11.4416 11.9877 11.4416 12.466V20.6676L14.9044 17.2886C15.2446 16.9568 15.7902 16.9576 16.129 17.2904L19.5587 20.6582V12.4898C19.5587 12.0115 19.9495 11.6234 20.4311 11.6234C20.9128 11.6234 21.3036 12.0115 21.3036 12.4898V22.7332C21.3036 23.0827 21.092 23.3982 20.7674 23.5328C20.6609 23.5768 20.5468 23.5995 20.4315 23.5996Z\" fill=\"white\"/>\n<g filter=\"url(#filter0_f_25057_14426)\">\n<path d=\"M17.9165 0L29.9998 12H21.9165C19.7074 12 17.9165 10.2091 17.9165 8V0Z\" fill=\"#196FF1\"/>\n</g>\n<path d=\"M18.7222 0L29.9999 11.2H22.7222C20.513 11.2 18.7222 9.40914 18.7222 7.2V0Z\" fill=\"#B3DAFF\"/>\n</g>\n<defs>\n<filter id=\"filter0_f_25057_14426\" x=\"12.9165\" y=\"-5\" width=\"22.0835\" height=\"22\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\">\n<feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/>\n<feBlend mode=\"normal\" in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"/>\n<feGaussianBlur stdDeviation=\"2.5\" result=\"effect1_foregroundBlur_25057_14426\"/>\n</filter>\n<linearGradient id=\"paint0_linear_25057_14426\" x1=\"1\" y1=\"0\" x2=\"32.9992\" y2=\"32.2214\" gradientUnits=\"userSpaceOnUse\">\n<stop stop-color=\"#76B4FD\"/>\n<stop offset=\"1\" stop-color=\"#4C89FF\"/>\n</linearGradient>\n<clipPath id=\"clip0_25057_14426\">\n<rect width=\"31\" height=\"32\" fill=\"white\"/>\n</clipPath>\n</defs>\n</svg>";
3
+ var fileIconExcelSvg = "<svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g clip-path=\"url(#clip0_25057_14408)\">\n<path d=\"M1.6001 3.2C1.6001 1.43269 3.03279 0 4.8001 0H19.2024L30.4001 11.1914V28.8C30.4001 30.5673 28.9674 32 27.2001 32H4.8001C3.03279 32 1.6001 30.5673 1.6001 28.8V3.2Z\" fill=\"url(#paint0_linear_25057_14408)\"/>\n<path d=\"M17.3426 17.5996L21.7224 13.2197C22.0929 12.8492 22.0929 12.2481 21.7224 11.8775C21.3518 11.507 20.7507 11.507 20.3802 11.8775L16.0003 16.2573L11.6205 11.8775C11.25 11.507 10.6489 11.507 10.2783 11.8775C9.90776 12.2481 9.90776 12.8492 10.2783 13.2197L14.6581 17.5996L10.2779 21.9794C9.90736 22.3499 9.90736 22.951 10.2779 23.3216C10.4634 23.5071 10.7062 23.5996 10.949 23.5996C11.1918 23.5996 11.4347 23.5071 11.6201 23.3216L16.0003 18.9418L20.3798 23.3216C20.5652 23.5071 20.8081 23.5996 21.0509 23.5996C21.2937 23.5996 21.5365 23.5071 21.722 23.3216C22.0925 22.951 22.0925 22.3499 21.722 21.9794L17.3426 17.5996Z\" fill=\"white\"/>\n<g filter=\"url(#filter0_f_25057_14408)\">\n<path d=\"M18.3999 0L30.3999 12H21.5999C19.8326 12 18.3999 10.5673 18.3999 8.8V0Z\" fill=\"#15C46F\"/>\n</g>\n<path d=\"M19.2002 0L30.4002 11.2H22.4002C20.6329 11.2 19.2002 9.76731 19.2002 8V0Z\" fill=\"#A4F8D0\"/>\n</g>\n<defs>\n<filter id=\"filter0_f_25057_14408\" x=\"14.3999\" y=\"-4\" width=\"20\" height=\"20\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\">\n<feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/>\n<feBlend mode=\"normal\" in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"/>\n<feGaussianBlur stdDeviation=\"2\" result=\"effect1_foregroundBlur_25057_14408\"/>\n</filter>\n<linearGradient id=\"paint0_linear_25057_14408\" x1=\"1.6001\" y1=\"0\" x2=\"33.6001\" y2=\"32\" gradientUnits=\"userSpaceOnUse\">\n<stop stop-color=\"#6CE4A3\"/>\n<stop offset=\"1\" stop-color=\"#15D076\"/>\n</linearGradient>\n<clipPath id=\"clip0_25057_14408\">\n<rect width=\"32\" height=\"32\" fill=\"white\"/>\n</clipPath>\n</defs>\n</svg>";
4
+ var fileIconTxtSvg = "<svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g clip-path=\"url(#clip0_25057_14410)\">\n<path d=\"M1.5 4C1.5 1.79086 3.29086 0 5.5 0H19.2245L30.5 11.1914V28C30.5 30.2091 28.7091 32 26.5 32H5.5C3.29086 32 1.5 30.2091 1.5 28V4Z\" fill=\"url(#paint0_linear_25057_14410)\"/>\n<path d=\"M21.2412 12.1295H16.1613C16.055 12.1079 15.9453 12.1079 15.839 12.1295H10.7591C10.3171 12.1295 9.9585 12.4857 9.9585 12.9246C9.9585 13.3636 10.3171 13.7197 10.7591 13.7197H15.1995V22.2912C15.1995 22.7301 15.5582 23.0863 16.0002 23.0863C16.4422 23.0863 16.8008 22.7301 16.8008 22.2912V13.7197H21.2412C21.6832 13.7197 22.0418 13.3636 22.0418 12.9246C22.0418 12.4857 21.6832 12.1295 21.2412 12.1295Z\" fill=\"white\"/>\n<g filter=\"url(#filter0_f_25057_14410)\">\n<path d=\"M18.4165 0L30.4998 12H22.4165C20.2074 12 18.4165 10.2091 18.4165 8V0Z\" fill=\"#35B4F0\"/>\n</g>\n<path d=\"M19.2222 0L30.4999 11.2H23.2222C21.013 11.2 19.2222 9.40914 19.2222 7.2V0Z\" fill=\"#ACEFFA\"/>\n</g>\n<defs>\n<filter id=\"filter0_f_25057_14410\" x=\"13.4165\" y=\"-5\" width=\"22.0835\" height=\"22\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\">\n<feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/>\n<feBlend mode=\"normal\" in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"/>\n<feGaussianBlur stdDeviation=\"2.5\" result=\"effect1_foregroundBlur_25057_14410\"/>\n</filter>\n<linearGradient id=\"paint0_linear_25057_14410\" x1=\"1.5\" y1=\"0\" x2=\"33.4992\" y2=\"32.2214\" gradientUnits=\"userSpaceOnUse\">\n<stop stop-color=\"#77DFFE\"/>\n<stop offset=\"1\" stop-color=\"#4AC5FD\"/>\n</linearGradient>\n<clipPath id=\"clip0_25057_14410\">\n<rect width=\"32\" height=\"32\" fill=\"white\"/>\n</clipPath>\n</defs>\n</svg>";
5
+ var fileIconPdfSvg = "<svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g clip-path=\"url(#clip0_25057_14412)\">\n<path d=\"M1.6001 3.2C1.6001 1.43269 3.03279 0 4.8001 0H19.2024L30.4001 11.1914V28.8C30.4001 30.5673 28.9674 32 27.2001 32H4.8001C3.03279 32 1.6001 30.5673 1.6001 28.8V3.2Z\" fill=\"url(#paint0_linear_25057_14412)\"/>\n<g clip-path=\"url(#clip1_25057_14412)\">\n<path d=\"M20.6223 21.564C19.6623 21.4929 18.7379 21.1373 17.9912 20.4973C16.5334 20.8173 15.1468 21.2795 13.7601 21.8484C12.6579 23.804 11.6268 24.7995 10.7379 24.7995C10.5601 24.7995 10.3468 24.764 10.2045 24.6573C9.81343 24.4795 9.6001 24.0884 9.6001 23.6973C9.6001 23.3773 9.67121 22.4884 13.049 21.0306C13.8312 19.6084 14.4357 18.1506 14.9334 16.6218C14.5068 15.7684 13.5823 13.6706 14.2223 12.604C14.4357 12.2129 14.8623 11.9995 15.3245 12.0351C15.6801 12.0351 16.0357 12.2129 16.249 12.4973C16.7112 13.1373 16.6757 14.4884 16.0712 16.4795C16.6401 17.5462 17.3868 18.5062 18.2757 19.324C19.0223 19.1818 19.769 19.0751 20.5157 19.0751C22.1868 19.1106 22.4357 19.8929 22.4001 20.3551C22.4001 21.564 21.2268 21.564 20.6223 21.564ZM10.6668 23.7684L10.7734 23.7329C11.2712 23.5551 11.6623 23.1995 11.9468 22.7373C11.4134 22.9506 10.9868 23.3062 10.6668 23.7684ZM15.3957 13.1018H15.289C15.2534 13.1018 15.1823 13.1018 15.1468 13.1373C15.0045 13.7418 15.1112 14.3818 15.3601 14.9506C15.5734 14.3462 15.5734 13.7062 15.3957 13.1018ZM15.6445 18.2573L15.609 18.3284L15.5734 18.2929C15.2534 19.1106 14.8979 19.9284 14.5068 20.7106L14.5779 20.6751V20.7462C15.3601 20.4618 16.2134 20.2129 16.9957 20.0351L16.9601 19.9995H17.0668C16.5334 19.4662 16.0357 18.8618 15.6445 18.2573ZM20.4801 20.1418C20.1601 20.1418 19.8757 20.1418 19.5557 20.2129C19.9112 20.3906 20.2668 20.4618 20.6223 20.4973C20.8712 20.5329 21.1201 20.4973 21.3334 20.4262C21.3334 20.3195 21.1912 20.1418 20.4801 20.1418Z\" fill=\"white\"/>\n</g>\n<g filter=\"url(#filter0_f_25057_14412)\">\n<path d=\"M18.3999 0L30.3999 12H21.5999C19.8326 12 18.3999 10.5673 18.3999 8.8V0Z\" fill=\"#F61E22\"/>\n</g>\n<path d=\"M19.2002 0L30.4002 11.2H22.4002C20.6329 11.2 19.2002 9.76731 19.2002 8V0Z\" fill=\"#FCAFB0\"/>\n</g>\n<defs>\n<filter id=\"filter0_f_25057_14412\" x=\"14.3999\" y=\"-4\" width=\"20\" height=\"20\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\">\n<feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/>\n<feBlend mode=\"normal\" in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"/>\n<feGaussianBlur stdDeviation=\"2\" result=\"effect1_foregroundBlur_25057_14412\"/>\n</filter>\n<linearGradient id=\"paint0_linear_25057_14412\" x1=\"1.6001\" y1=\"0\" x2=\"33.6001\" y2=\"32\" gradientUnits=\"userSpaceOnUse\">\n<stop stop-color=\"#FF7375\"/>\n<stop offset=\"1\" stop-color=\"#FF4447\"/>\n</linearGradient>\n<clipPath id=\"clip0_25057_14412\">\n<rect width=\"32\" height=\"32\" fill=\"white\"/>\n</clipPath>\n<clipPath id=\"clip1_25057_14412\">\n<rect width=\"12.8\" height=\"12.8\" fill=\"white\" transform=\"translate(9.6001 12)\"/>\n</clipPath>\n</defs>\n</svg>";
6
+ var fileIconMarkdownSvg = "<svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g clip-path=\"url(#clip0_25057_14428)\">\n<path d=\"M1.6001 3.2C1.6001 1.43269 3.03279 0 4.8001 0H19.2024L30.4001 11.1914V28.8C30.4001 30.5673 28.9674 32 27.2001 32H4.8001C3.03279 32 1.6001 30.5673 1.6001 28.8V3.2Z\" fill=\"url(#paint0_linear_25057_14428)\"/>\n<path d=\"M11.103 11.5996C11.3268 11.5996 11.547 11.6863 11.7123 11.8498L15.9866 16.076L20.2901 11.848C20.4118 11.7283 20.5662 11.6473 20.7338 11.6152C20.9015 11.583 21.0749 11.6011 21.2323 11.6671C21.3897 11.7331 21.5242 11.8441 21.6187 11.9863C21.7133 12.1284 21.7637 12.2953 21.7637 12.466L21.7637 22.7332C21.7637 23.2115 21.3756 23.5996 20.8973 23.5996C20.4189 23.5996 20.0309 23.2115 20.0309 22.7332L20.0309 14.5317L16.592 17.9106C16.2541 18.2424 15.7122 18.2416 15.3758 17.9088L11.9697 14.541L11.9697 22.7094C11.9697 23.1877 11.5817 23.5758 11.1033 23.5758C10.625 23.5758 10.2369 23.1877 10.2369 22.7094L10.2369 12.466C10.2369 12.1166 10.447 11.8011 10.7694 11.6664C10.8751 11.6224 10.9885 11.5997 11.103 11.5996Z\" fill=\"white\"/>\n<g filter=\"url(#filter0_f_25057_14428)\">\n<path d=\"M18.3999 0L30.3999 12H21.5999C19.8326 12 18.3999 10.5673 18.3999 8.8V0Z\" fill=\"#7319F1\"/>\n</g>\n<path d=\"M19.2002 0L30.4002 11.2H22.4002C20.6329 11.2 19.2002 9.76731 19.2002 8V0Z\" fill=\"#C2B3FF\"/>\n</g>\n<defs>\n<filter id=\"filter0_f_25057_14428\" x=\"14.3999\" y=\"-4\" width=\"20\" height=\"20\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\">\n<feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/>\n<feBlend mode=\"normal\" in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"/>\n<feGaussianBlur stdDeviation=\"2\" result=\"effect1_foregroundBlur_25057_14428\"/>\n</filter>\n<linearGradient id=\"paint0_linear_25057_14428\" x1=\"1.6001\" y1=\"0\" x2=\"33.6001\" y2=\"32\" gradientUnits=\"userSpaceOnUse\">\n<stop stop-color=\"#A176FD\"/>\n<stop offset=\"1\" stop-color=\"#974CFF\"/>\n</linearGradient>\n<clipPath id=\"clip0_25057_14428\">\n<rect width=\"32\" height=\"32\" fill=\"white\"/>\n</clipPath>\n</defs>\n</svg>";
7
+ var fileIconCodeSvg = "<svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g clip-path=\"url(#clip0_25057_14430)\">\n<path d=\"M1.6001 3.2C1.6001 1.43269 3.03279 0 4.8001 0H19.2024L30.4001 11.1914V28.8C30.4001 30.5673 28.9674 32 27.2001 32H4.8001C3.03279 32 1.6001 30.5673 1.6001 28.8V3.2Z\" fill=\"url(#paint0_linear_25057_14430)\"/>\n<path d=\"M12.99 12.5654C12.8248 12.4187 12.5721 12.4336 12.4253 12.5987L8.73621 16.7491C8.6015 16.9006 8.6015 17.129 8.73621 17.2805L12.4253 21.4309C12.5721 21.596 12.8248 21.6109 12.99 21.4642L13.5134 20.9991C13.6786 20.8523 13.6935 20.5994 13.5467 20.4343L10.7432 17.2806C10.6085 17.129 10.6085 16.9006 10.7432 16.7491L13.5467 13.5953C13.6935 13.4302 13.6786 13.1773 13.5134 13.0306L12.99 12.5654ZM19.3868 12.5988C19.24 12.4336 18.9872 12.4188 18.8221 12.5656L18.299 13.0306C18.1338 13.1773 18.119 13.4302 18.2658 13.5953L21.0693 16.7491C21.204 16.9006 21.204 17.129 21.0693 17.2806L18.2658 20.4343C18.119 20.5995 18.1338 20.8523 18.299 20.9991L18.8221 21.4641C18.9872 21.6108 19.24 21.596 19.3868 21.4309L23.0762 17.2806C23.211 17.129 23.211 16.9006 23.0762 16.749L19.3868 12.5988Z\" fill=\"white\"/>\n<g filter=\"url(#filter0_f_25057_14430)\">\n<path d=\"M18.3999 0L30.3999 12H21.5999C19.8326 12 18.3999 10.5673 18.3999 8.8V0Z\" fill=\"#3396FD\"/>\n</g>\n<path d=\"M19.2002 0L30.4002 11.2H22.4002C20.6329 11.2 19.2002 9.76731 19.2002 8V0Z\" fill=\"#9FD3FB\"/>\n</g>\n<defs>\n<filter id=\"filter0_f_25057_14430\" x=\"14.3999\" y=\"-4\" width=\"20\" height=\"20\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\">\n<feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/>\n<feBlend mode=\"normal\" in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"/>\n<feGaussianBlur stdDeviation=\"2\" result=\"effect1_foregroundBlur_25057_14430\"/>\n</filter>\n<linearGradient id=\"paint0_linear_25057_14430\" x1=\"1.6001\" y1=\"0\" x2=\"33.6001\" y2=\"32\" gradientUnits=\"userSpaceOnUse\">\n<stop stop-color=\"#44B6FB\"/>\n<stop offset=\"1\" stop-color=\"#58A2FF\"/>\n</linearGradient>\n<clipPath id=\"clip0_25057_14430\">\n<rect width=\"32\" height=\"32\" fill=\"white\"/>\n</clipPath>\n</defs>\n</svg>";
8
+ var fileIconPptSvg = "<svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g clip-path=\"url(#clip0_25057_14414)\">\n<path d=\"M1.6001 3.2C1.6001 1.43269 3.03279 0 4.8001 0H19.2024L30.4001 11.1914V28.8C30.4001 30.5673 28.9674 32 27.2001 32H4.8001C3.03279 32 1.6001 30.5673 1.6001 28.8V3.2Z\" fill=\"url(#paint0_linear_25057_14414)\"/>\n<path d=\"M17.3009 11.5996H11.2913C10.838 11.5996 10.4702 11.9674 10.4702 12.4207V22.7785C10.4702 23.2318 10.838 23.5996 11.2913 23.5996C11.7447 23.5996 12.1125 23.2318 12.1125 22.7785V20.0578H17.3009C19.6329 20.0578 21.53 18.1607 21.53 15.8287C21.53 13.4967 19.6329 11.5996 17.3009 11.5996ZM17.3009 18.4156H12.1125V13.2419H17.3009C18.7273 13.2419 19.8878 14.4024 19.8878 15.8287C19.8878 17.2551 18.7273 18.4156 17.3009 18.4156Z\" fill=\"white\"/>\n<g filter=\"url(#filter0_f_25057_14414)\">\n<path d=\"M18.3999 0L30.3999 12H21.5999C19.8326 12 18.3999 10.5673 18.3999 8.8V0Z\" fill=\"#F6791E\"/>\n</g>\n<path d=\"M19.2002 0L30.4002 11.2H22.4002C20.6329 11.2 19.2002 9.76731 19.2002 8V0Z\" fill=\"#FCCBAF\"/>\n</g>\n<defs>\n<filter id=\"filter0_f_25057_14414\" x=\"14.3999\" y=\"-4\" width=\"20\" height=\"20\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\">\n<feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/>\n<feBlend mode=\"normal\" in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"/>\n<feGaussianBlur stdDeviation=\"2\" result=\"effect1_foregroundBlur_25057_14414\"/>\n</filter>\n<linearGradient id=\"paint0_linear_25057_14414\" x1=\"1.6001\" y1=\"0\" x2=\"33.6001\" y2=\"32\" gradientUnits=\"userSpaceOnUse\">\n<stop stop-color=\"#FFA573\"/>\n<stop offset=\"1\" stop-color=\"#FF7C44\"/>\n</linearGradient>\n<clipPath id=\"clip0_25057_14414\">\n<rect width=\"32\" height=\"32\" fill=\"white\"/>\n</clipPath>\n</defs>\n</svg>";
9
+ var fileIconImageSvg = "<svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g clip-path=\"url(#clip0_25057_14416)\">\n<path d=\"M1.6001 3.2C1.6001 1.43269 3.03279 0 4.8001 0H19.2024L30.4001 11.1914V28.8C30.4001 30.5673 28.9674 32 27.2001 32H4.8001C3.03279 32 1.6001 30.5673 1.6001 28.8V3.2Z\" fill=\"url(#paint0_linear_25057_14416)\"/>\n<path d=\"M8.24289 22.3479L11.1107 18.1328C11.1475 18.0788 11.1956 18.0335 11.2518 18.0001C11.3079 17.9668 11.3707 17.9461 11.4357 17.9397C11.5007 17.9333 11.5664 17.9413 11.628 17.9631C11.6895 17.9848 11.7456 18.0199 11.7921 18.0657L13.6875 19.9227L17.8459 13.4047C17.8871 13.34 17.9442 13.287 18.0119 13.2509C18.0795 13.2147 18.1553 13.1966 18.232 13.1984C18.3086 13.2001 18.3835 13.2215 18.4495 13.2607C18.5154 13.2998 18.5701 13.3553 18.6084 13.4218L23.7752 22.376C23.8144 22.4438 23.8351 22.5208 23.8351 22.5991C23.8352 22.6774 23.8146 22.7544 23.7754 22.8222C23.7362 22.8901 23.6799 22.9464 23.612 22.9855C23.5441 23.0246 23.4672 23.0452 23.3888 23.0451H8.61173C8.53054 23.0452 8.45085 23.0232 8.38126 22.9814C8.31167 22.9396 8.25481 22.8796 8.21683 22.8079C8.17885 22.7361 8.16118 22.6553 8.16574 22.5743C8.1703 22.4932 8.19691 22.415 8.2427 22.3479H8.24289Z\" fill=\"white\"/>\n<path d=\"M9.10156 12.8039C9.10156 13.4001 9.33843 13.972 9.76005 14.3936C10.1817 14.8152 10.7535 15.0521 11.3498 15.0521C11.946 15.0521 12.5179 14.8152 12.9395 14.3936C13.3611 13.972 13.598 13.4001 13.598 12.8039C13.598 12.2076 13.3611 11.6358 12.9395 11.2141C12.5179 10.7925 11.946 10.5557 11.3498 10.5557C10.7535 10.5557 10.1817 10.7925 9.76005 11.2141C9.33843 11.6358 9.10156 12.2076 9.10156 12.8039Z\" fill=\"white\"/>\n<g filter=\"url(#filter0_f_25057_14416)\">\n<path d=\"M18.3999 0L30.3999 12H21.5999C19.8326 12 18.3999 10.5673 18.3999 8.8V0Z\" fill=\"#EFB323\"/>\n</g>\n<path d=\"M19.2002 0L30.4002 11.2H22.4002C20.6329 11.2 19.2002 9.76731 19.2002 8V0Z\" fill=\"#FEE7B5\"/>\n</g>\n<defs>\n<filter id=\"filter0_f_25057_14416\" x=\"14.3999\" y=\"-4\" width=\"20\" height=\"20\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\">\n<feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/>\n<feBlend mode=\"normal\" in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"/>\n<feGaussianBlur stdDeviation=\"2\" result=\"effect1_foregroundBlur_25057_14416\"/>\n</filter>\n<linearGradient id=\"paint0_linear_25057_14416\" x1=\"1.6001\" y1=\"0\" x2=\"33.6001\" y2=\"32\" gradientUnits=\"userSpaceOnUse\">\n<stop stop-color=\"#FED067\"/>\n<stop offset=\"1\" stop-color=\"#FEB646\"/>\n</linearGradient>\n<clipPath id=\"clip0_25057_14416\">\n<rect width=\"32\" height=\"32\" fill=\"white\"/>\n</clipPath>\n</defs>\n</svg>";
10
+ var fileIconAudioSvg = "<svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g clip-path=\"url(#clip0_25057_14418)\">\n<path d=\"M1.6001 3.2C1.6001 1.43269 3.03279 0 4.8001 0H19.2024L30.4001 11.1914V28.8C30.4001 30.5673 28.9674 32 27.2001 32H4.8001C3.03279 32 1.6001 30.5673 1.6001 28.8V3.2Z\" fill=\"url(#paint0_linear_25057_14418)\"/>\n<path d=\"M21.0555 13.7107C20.2303 13.7107 19.439 13.3829 18.8556 12.7995C18.2721 12.2161 17.9443 11.4247 17.9443 10.5996H16.3888V18.1907C15.74 17.7572 14.9649 17.5529 14.1867 17.6104C13.4084 17.6679 12.6717 17.9837 12.0936 18.5078C11.5155 19.0319 11.1291 19.7342 10.9958 20.503C10.8625 21.2719 10.99 22.0633 11.3579 22.7514C11.7259 23.4395 12.3133 23.9849 13.0268 24.301C13.7402 24.617 14.5388 24.6856 15.2957 24.4958C16.0526 24.306 16.7244 23.8686 17.2043 23.2533C17.6841 22.638 17.9446 21.8799 17.9443 21.0996V14.0724C18.7991 14.8397 19.9068 15.2648 21.0555 15.2663V13.7107Z\" fill=\"white\"/>\n<g filter=\"url(#filter0_f_25057_14418)\">\n<path d=\"M18.3999 0L30.3999 12H21.5999C19.8326 12 18.3999 10.5673 18.3999 8.8V0Z\" fill=\"#FA655E\"/>\n</g>\n<path d=\"M19.2002 0L30.4002 11.2H22.4002C20.6329 11.2 19.2002 9.76731 19.2002 8V0Z\" fill=\"#FEC6C2\"/>\n</g>\n<defs>\n<filter id=\"filter0_f_25057_14418\" x=\"14.3999\" y=\"-4\" width=\"20\" height=\"20\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\">\n<feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/>\n<feBlend mode=\"normal\" in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"/>\n<feGaussianBlur stdDeviation=\"2\" result=\"effect1_foregroundBlur_25057_14418\"/>\n</filter>\n<linearGradient id=\"paint0_linear_25057_14418\" x1=\"1.6001\" y1=\"0\" x2=\"33.6001\" y2=\"32\" gradientUnits=\"userSpaceOnUse\">\n<stop stop-color=\"#FDA79C\"/>\n<stop offset=\"1\" stop-color=\"#FF8787\"/>\n</linearGradient>\n<clipPath id=\"clip0_25057_14418\">\n<rect width=\"32\" height=\"32\" fill=\"white\"/>\n</clipPath>\n</defs>\n</svg>";
11
+ var fileIconVideoSvg = "<svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g clip-path=\"url(#clip0_25057_14420)\">\n<path d=\"M1.6001 3.2C1.6001 1.43269 3.03279 0 4.8001 0H19.2024L30.4001 11.1914V28.8C30.4001 30.5673 28.9674 32 27.2001 32H4.8001C3.03279 32 1.6001 30.5673 1.6001 28.8V3.2Z\" fill=\"url(#paint0_linear_25057_14420)\"/>\n<path d=\"M13.4813 12.9902C13.215 12.821 12.8667 13.0123 12.8667 13.3278V21.8714C12.8667 22.187 13.215 22.3783 13.4813 22.209L20.2022 17.9372C20.4495 17.78 20.4495 17.4192 20.2022 17.262L13.4813 12.9902Z\" fill=\"white\"/>\n<g filter=\"url(#filter0_f_25057_14420)\">\n<path d=\"M18.3999 0L30.3999 12H21.5999C19.8326 12 18.3999 10.5673 18.3999 8.8V0Z\" fill=\"#F6791E\"/>\n</g>\n<path d=\"M19.2002 0L30.4002 11.2H22.4002C20.6329 11.2 19.2002 9.76731 19.2002 8V0Z\" fill=\"#FCCFAF\"/>\n</g>\n<defs>\n<filter id=\"filter0_f_25057_14420\" x=\"14.3999\" y=\"-4\" width=\"20\" height=\"20\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\">\n<feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/>\n<feBlend mode=\"normal\" in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"/>\n<feGaussianBlur stdDeviation=\"2\" result=\"effect1_foregroundBlur_25057_14420\"/>\n</filter>\n<linearGradient id=\"paint0_linear_25057_14420\" x1=\"1.6001\" y1=\"0\" x2=\"33.6001\" y2=\"32\" gradientUnits=\"userSpaceOnUse\">\n<stop stop-color=\"#FFBF83\"/>\n<stop offset=\"1\" stop-color=\"#FF9C54\"/>\n</linearGradient>\n<clipPath id=\"clip0_25057_14420\">\n<rect width=\"32\" height=\"32\" fill=\"white\"/>\n</clipPath>\n</defs>\n</svg>";
12
+ var fileIconZipSvg = "<svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g clip-path=\"url(#clip0_25057_14422)\">\n<g filter=\"url(#filter0_i_25057_14422)\">\n<path d=\"M0 3.99297C0 2.22566 1.43269 0.792969 3.2 0.792969H28.8C30.5673 0.792969 32 2.22566 32 3.99297V10.9263H0V3.99297Z\" fill=\"url(#paint0_linear_25057_14422)\"/>\n</g>\n<rect y=\"10.9268\" width=\"32\" height=\"10.1333\" fill=\"url(#paint1_linear_25057_14422)\"/>\n<path d=\"M0 21.0596H32V27.9929C32 29.7602 30.5673 31.1929 28.8 31.1929H3.2C1.43269 31.1929 0 29.7602 0 27.9929V21.0596Z\" fill=\"url(#paint2_linear_25057_14422)\"/>\n<rect x=\"10.3999\" y=\"0.807617\" width=\"11.2\" height=\"30.4\" fill=\"url(#paint3_linear_25057_14422)\"/>\n<rect x=\"9.5999\" y=\"11.2\" width=\"12.8\" height=\"9.6\" rx=\"2.4\" stroke=\"white\" stroke-width=\"1.6\"/>\n</g>\n<defs>\n<filter id=\"filter0_i_25057_14422\" x=\"0\" y=\"0.792969\" width=\"32\" height=\"11.7338\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\">\n<feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/>\n<feBlend mode=\"normal\" in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"/>\n<feColorMatrix in=\"SourceAlpha\" type=\"matrix\" values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0\" result=\"hardAlpha\"/>\n<feOffset dy=\"1.6\"/>\n<feGaussianBlur stdDeviation=\"0.8\"/>\n<feComposite in2=\"hardAlpha\" operator=\"arithmetic\" k2=\"-1\" k3=\"1\"/>\n<feColorMatrix type=\"matrix\" values=\"0 0 0 0 0.609328 0 0 0 0 0.882798 0 0 0 0 1 0 0 0 0.6 0\"/>\n<feBlend mode=\"normal\" in2=\"shape\" result=\"effect1_innerShadow_25057_14422\"/>\n</filter>\n<linearGradient id=\"paint0_linear_25057_14422\" x1=\"0\" y1=\"0.792969\" x2=\"7.48984\" y2=\"19.5629\" gradientUnits=\"userSpaceOnUse\">\n<stop stop-color=\"#66D3F9\"/>\n<stop offset=\"1\" stop-color=\"#4BC1FB\"/>\n</linearGradient>\n<linearGradient id=\"paint1_linear_25057_14422\" x1=\"0\" y1=\"10.9268\" x2=\"7.48984\" y2=\"29.6967\" gradientUnits=\"userSpaceOnUse\">\n<stop stop-color=\"#FD836F\"/>\n<stop offset=\"1\" stop-color=\"#FF5F5D\"/>\n</linearGradient>\n<linearGradient id=\"paint2_linear_25057_14422\" x1=\"0\" y1=\"21.0596\" x2=\"7.48984\" y2=\"39.8295\" gradientUnits=\"userSpaceOnUse\">\n<stop stop-color=\"#7BE0B1\"/>\n<stop offset=\"1\" stop-color=\"#51B783\"/>\n</linearGradient>\n<linearGradient id=\"paint3_linear_25057_14422\" x1=\"10.3999\" y1=\"0.807617\" x2=\"27.9819\" y2=\"5.94811\" gradientUnits=\"userSpaceOnUse\">\n<stop stop-color=\"#FFD26D\"/>\n<stop offset=\"1\" stop-color=\"#FFB340\"/>\n</linearGradient>\n<clipPath id=\"clip0_25057_14422\">\n<rect width=\"32\" height=\"32\" fill=\"white\"/>\n</clipPath>\n</defs>\n</svg>";
13
+ var fileIconDefaultSvg = "<svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g clip-path=\"url(#clip0_25057_14424)\">\n<path d=\"M1.6001 3.2C1.6001 1.43269 3.03279 0 4.8001 0H19.2024L30.4001 11.1914V28.8C30.4001 30.5673 28.9674 32 27.2001 32H4.8001C3.03279 32 1.6001 30.5673 1.6001 28.8V3.2Z\" fill=\"url(#paint0_linear_25057_14424)\"/>\n<rect x=\"9.87842\" y=\"11.3555\" width=\"8\" height=\"1.6\" rx=\"0.4\" fill=\"white\"/>\n<rect x=\"9.87842\" y=\"16.8574\" width=\"12.2432\" height=\"1.6\" rx=\"0.4\" fill=\"white\"/>\n<rect x=\"9.87842\" y=\"22.3594\" width=\"11.3717\" height=\"1.48611\" rx=\"0.4\" fill=\"white\"/>\n<g filter=\"url(#filter0_f_25057_14424)\">\n<path d=\"M18.3999 0L30.3999 12H21.5999C19.8326 12 18.3999 10.5673 18.3999 8.8V0Z\" fill=\"#94B9DB\"/>\n</g>\n<path d=\"M19.2002 0L30.4002 11.2H22.4002C20.6329 11.2 19.2002 9.76731 19.2002 8V0Z\" fill=\"#DBEAFC\"/>\n</g>\n<defs>\n<filter id=\"filter0_f_25057_14424\" x=\"14.3999\" y=\"-4\" width=\"20\" height=\"20\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\">\n<feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/>\n<feBlend mode=\"normal\" in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"/>\n<feGaussianBlur stdDeviation=\"2\" result=\"effect1_foregroundBlur_25057_14424\"/>\n</filter>\n<linearGradient id=\"paint0_linear_25057_14424\" x1=\"1.6001\" y1=\"0\" x2=\"33.6001\" y2=\"32\" gradientUnits=\"userSpaceOnUse\">\n<stop stop-color=\"#C7DFF2\"/>\n<stop offset=\"1\" stop-color=\"#ABC3DD\"/>\n</linearGradient>\n<clipPath id=\"clip0_25057_14424\">\n<rect width=\"32\" height=\"32\" fill=\"white\"/>\n</clipPath>\n</defs>\n</svg>";
14
+ function toDataUrl(svg) {
15
+ return "data:image/svg+xml;charset=UTF-8," + encodeURIComponent(svg);
16
+ }
17
+ var BUILTIN_FILE_ICON_URLS = {
18
+ word: toDataUrl(fileIconWordSvg),
19
+ excel: toDataUrl(fileIconExcelSvg),
20
+ txt: toDataUrl(fileIconTxtSvg),
21
+ pdf: toDataUrl(fileIconPdfSvg),
22
+ markdown: toDataUrl(fileIconMarkdownSvg),
23
+ code: toDataUrl(fileIconCodeSvg),
24
+ ppt: toDataUrl(fileIconPptSvg),
25
+ zip: toDataUrl(fileIconZipSvg),
26
+ image: toDataUrl(fileIconImageSvg),
27
+ audio: toDataUrl(fileIconAudioSvg),
28
+ video: toDataUrl(fileIconVideoSvg),
29
+ default: toDataUrl(fileIconDefaultSvg)
30
+ };
31
+ var WORD_EXTENSIONS = new _Set(['doc', 'docx', 'pages']);
32
+ var EXCEL_EXTENSIONS = new _Set(['xls', 'xlsx', 'csv', 'numbers']);
33
+ var TXT_EXTENSIONS = new _Set(['txt', 'log', 'rtf']);
34
+ var MARKDOWN_EXTENSIONS = new _Set(['md', 'mdx', 'markdown']);
35
+ var CODE_EXTENSIONS = new _Set(['js', 'mjs', 'cjs', 'jsx', 'ts', 'tsx', 'vue', 'html', 'htm', 'css', 'scss', 'sass', 'less', 'json', 'yaml', 'yml', 'xml', 'java', 'kt', 'go', 'rs', 'py', 'rb', 'php', 'c', 'cc', 'cpp', 'h', 'hpp', 'swift', 'sh', 'bash', 'zsh', 'sql']);
36
+ var PPT_EXTENSIONS = new _Set(['ppt', 'pptx', 'key']);
37
+ var ZIP_EXTENSIONS = new _Set(['zip', 'rar', '7z', 'tar', 'gz', 'tgz', 'bz2', 'xz']);
38
+ export function getBuiltinFileIconByExtension(ext, resolvedType) {
39
+ if (resolvedType === void 0) {
40
+ resolvedType = 'file';
41
+ }
42
+ if (WORD_EXTENSIONS.has(ext)) return BUILTIN_FILE_ICON_URLS.word;
43
+ if (EXCEL_EXTENSIONS.has(ext)) return BUILTIN_FILE_ICON_URLS.excel;
44
+ if (TXT_EXTENSIONS.has(ext)) return BUILTIN_FILE_ICON_URLS.txt;
45
+ if (ext === 'pdf') return BUILTIN_FILE_ICON_URLS.pdf;
46
+ if (MARKDOWN_EXTENSIONS.has(ext)) return BUILTIN_FILE_ICON_URLS.markdown;
47
+ if (CODE_EXTENSIONS.has(ext)) return BUILTIN_FILE_ICON_URLS.code;
48
+ if (PPT_EXTENSIONS.has(ext)) return BUILTIN_FILE_ICON_URLS.ppt;
49
+ if (ZIP_EXTENSIONS.has(ext)) return BUILTIN_FILE_ICON_URLS.zip;
50
+ if (resolvedType === 'image') return BUILTIN_FILE_ICON_URLS.image;
51
+ if (resolvedType === 'audio') return BUILTIN_FILE_ICON_URLS.audio;
52
+ if (resolvedType === 'video') return BUILTIN_FILE_ICON_URLS.video;
53
+ return BUILTIN_FILE_ICON_URLS.default;
54
+ }
@@ -0,0 +1,14 @@
1
+ export type ResolvedFileCardType = 'file' | 'image' | 'video' | 'audio';
2
+ export declare const IMAGE_EXTENSIONS: string[];
3
+ export declare const VIDEO_EXTENSIONS: string[];
4
+ export declare const AUDIO_EXTENSIONS: string[];
5
+ export declare function formatBytes(bytes: number): string;
6
+ export declare function deriveNameFromSrc(src: string): string;
7
+ export declare function getFileCardDisplayName(name: string | undefined, src: string | undefined): string;
8
+ export declare function splitFileName(name: string): {
9
+ prefix: string;
10
+ suffix: string;
11
+ };
12
+ export declare function guessFileExtension(rawTypeIn: string | undefined, fileName: string): string;
13
+ export declare function resolveFileCardType(rawTypeIn: string | undefined, displayName: string, src?: string): ResolvedFileCardType;
14
+ export declare function fileBadgeClassName(ext: string, resolvedType: ResolvedFileCardType): "default" | "audio" | "video" | "image" | "slide" | "sheet" | "pdf" | "doc" | "archive";
@@ -0,0 +1,94 @@
1
+ import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js/instance/slice";
2
+ import _trimInstanceProperty from "@babel/runtime-corejs3/core-js/instance/trim";
3
+ import _includesInstanceProperty from "@babel/runtime-corejs3/core-js/instance/includes";
4
+ import _startsWithInstanceProperty from "@babel/runtime-corejs3/core-js/instance/starts-with";
5
+ import { _$ } from '../../i18n';
6
+ export var IMAGE_EXTENSIONS = ['png', 'jpg', 'jpeg', 'gif', 'webp', 'bmp', 'svg', 'avif'];
7
+ export var VIDEO_EXTENSIONS = ['mp4', 'mov', 'm4v', 'webm', 'mkv', 'avi'];
8
+ export var AUDIO_EXTENSIONS = ['mp3', 'wav', 'ogg', 'm4a', 'aac', 'flac'];
9
+ export function formatBytes(bytes) {
10
+ if (!bytes) return '0 B';
11
+ var units = ['B', 'KB', 'MB', 'GB', 'TB'];
12
+ var value = bytes;
13
+ var unitIndex = 0;
14
+ while (value >= 1024 && unitIndex < units.length - 1) {
15
+ value /= 1024;
16
+ unitIndex++;
17
+ }
18
+ var fixed = value >= 10 || unitIndex === 0 ? 0 : 1;
19
+ return value.toFixed(fixed) + " " + units[unitIndex];
20
+ }
21
+ export function deriveNameFromSrc(src) {
22
+ if (!src) return '';
23
+ var withoutHash = src.split('#')[0];
24
+ var withoutQuery = withoutHash.split('?')[0];
25
+ var segments = withoutQuery.split('/');
26
+ return decodeURIComponent(segments[segments.length - 1] || '');
27
+ }
28
+ export function getFileCardDisplayName(name, src) {
29
+ return name || deriveNameFromSrc(src || '') || _$('未命名文件');
30
+ }
31
+ // 文件名拆成主体和后缀,便于只让主体部分省略。
32
+ export function splitFileName(name) {
33
+ var index = name.lastIndexOf('.');
34
+ if (index <= 0 || index >= name.length - 1) {
35
+ return {
36
+ prefix: name,
37
+ suffix: ''
38
+ };
39
+ }
40
+ return {
41
+ prefix: _sliceInstanceProperty(name).call(name, 0, index),
42
+ suffix: _sliceInstanceProperty(name).call(name, index)
43
+ };
44
+ }
45
+ export function guessFileExtension(rawTypeIn, fileName) {
46
+ var _context;
47
+ var rawType = _trimInstanceProperty(_context = (rawTypeIn || '').toLowerCase()).call(_context);
48
+ if (_includesInstanceProperty(rawType).call(rawType, '/')) {
49
+ var _rawType$split = rawType.split('/'),
50
+ kind = _rawType$split[0],
51
+ ext = _rawType$split[1];
52
+ if (kind && ext && ext !== '*') return ext;
53
+ }
54
+ if (rawType === 'folder') return '';
55
+ if (rawType && rawType !== 'file' && rawType !== 'image' && rawType !== 'video' && rawType !== 'audio') {
56
+ return rawType.replace(/^\./, '');
57
+ }
58
+ var match = fileName.match(/\.([^.]+)$/);
59
+ return match ? match[1].toLowerCase() : '';
60
+ }
61
+ // 优先尊重显式 type;未指定时再从展示名和 src 推断资源类型。
62
+ export function resolveFileCardType(rawTypeIn, displayName, src) {
63
+ var _context2;
64
+ var rawType = _trimInstanceProperty(_context2 = (rawTypeIn || '').toLowerCase()).call(_context2);
65
+ if (rawType === 'file') return 'file';
66
+ if (rawType === 'folder') return 'file';
67
+ if (rawType === 'image' || _startsWithInstanceProperty(rawType).call(rawType, 'image/')) return 'image';
68
+ if (rawType === 'video' || _startsWithInstanceProperty(rawType).call(rawType, 'video/')) return 'video';
69
+ if (rawType === 'audio' || _startsWithInstanceProperty(rawType).call(rawType, 'audio/')) return 'audio';
70
+ if (_includesInstanceProperty(IMAGE_EXTENSIONS).call(IMAGE_EXTENSIONS, rawType)) return 'image';
71
+ if (_includesInstanceProperty(VIDEO_EXTENSIONS).call(VIDEO_EXTENSIONS, rawType)) return 'video';
72
+ if (_includesInstanceProperty(AUDIO_EXTENSIONS).call(AUDIO_EXTENSIONS, rawType)) return 'audio';
73
+ var ext = guessFileExtension(rawTypeIn, displayName);
74
+ if (_includesInstanceProperty(IMAGE_EXTENSIONS).call(IMAGE_EXTENSIONS, ext)) return 'image';
75
+ if (_includesInstanceProperty(VIDEO_EXTENSIONS).call(VIDEO_EXTENSIONS, ext)) return 'video';
76
+ if (_includesInstanceProperty(AUDIO_EXTENSIONS).call(AUDIO_EXTENSIONS, ext)) return 'audio';
77
+ var srcExt = src ? guessFileExtension(undefined, deriveNameFromSrc(src)) : '';
78
+ if (_includesInstanceProperty(IMAGE_EXTENSIONS).call(IMAGE_EXTENSIONS, srcExt)) return 'image';
79
+ if (_includesInstanceProperty(VIDEO_EXTENSIONS).call(VIDEO_EXTENSIONS, srcExt)) return 'video';
80
+ if (_includesInstanceProperty(AUDIO_EXTENSIONS).call(AUDIO_EXTENSIONS, srcExt)) return 'audio';
81
+ return 'file';
82
+ }
83
+ export function fileBadgeClassName(ext, resolvedType) {
84
+ var _context3, _context4, _context5, _context6, _context7;
85
+ if (_includesInstanceProperty(_context3 = ['pdf']).call(_context3, ext)) return 'pdf';
86
+ if (_includesInstanceProperty(_context4 = ['doc', 'docx', 'pages', 'txt', 'md', 'rtf']).call(_context4, ext)) return 'doc';
87
+ if (_includesInstanceProperty(_context5 = ['xls', 'xlsx', 'csv', 'numbers']).call(_context5, ext)) return 'sheet';
88
+ if (_includesInstanceProperty(_context6 = ['ppt', 'pptx', 'key']).call(_context6, ext)) return 'slide';
89
+ if (_includesInstanceProperty(_context7 = ['zip', 'rar', '7z', 'tar', 'gz']).call(_context7, ext)) return 'archive';
90
+ if (resolvedType === 'image') return 'image';
91
+ if (resolvedType === 'video') return 'video';
92
+ if (resolvedType === 'audio') return 'audio';
93
+ return 'default';
94
+ }
@@ -0,0 +1,2 @@
1
+ export * from './fileCard';
2
+ export * from './list';
@@ -0,0 +1,2 @@
1
+ export * from './fileCard';
2
+ export * from './list';
@@ -0,0 +1 @@
1
+ export {};