@vunk/plus 1.12.2 → 1.13.1

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 (173) hide show
  1. package/components/_plugin-vue_export-helper-BHFhmbuH.js +1 -0
  2. package/components/_plugin-vue_export-helper-CHgC5LLL.mjs +9 -0
  3. package/components/agent-chat-provider/index.cjs +1 -0
  4. package/components/agent-chat-provider/index.mjs +113 -187
  5. package/components/agent-chat-provider/src/index.vue.d.ts +3 -2
  6. package/components/avatar/index.cjs +1 -0
  7. package/components/avatar/index.mjs +25 -31
  8. package/components/avatar/src/index.vue.d.ts +40 -39
  9. package/components/broadcasting-markdown/__tests__/const.test.d.ts +1 -0
  10. package/components/broadcasting-markdown/__tests__/utils.test.d.ts +1 -0
  11. package/components/broadcasting-markdown/index.cjs +5 -0
  12. package/components/broadcasting-markdown/index.mjs +346 -4376
  13. package/components/broadcasting-markdown/src/howler-speech.vue.d.ts +18 -24
  14. package/components/broadcasting-markdown/src/index.vue.d.ts +101 -51
  15. package/components/broadcasting-markdown/src/paragraph.vue.d.ts +17 -29
  16. package/components/broadcasting-markdown/src/speech-error.vue.d.ts +2 -59
  17. package/components/bubble-list/index.cjs +1 -0
  18. package/components/bubble-list/index.mjs +220 -302
  19. package/components/bubble-list/src/core/index.vue.d.ts +40 -885
  20. package/components/bubble-list/src/core/loading.vue.d.ts +3 -0
  21. package/components/bubble-list/src/index.vue.d.ts +29 -1321
  22. package/components/bubble-templates/index.cjs +1 -0
  23. package/components/bubble-templates/index.mjs +34 -49
  24. package/components/bubble-templates/src/index.vue.d.ts +3 -224
  25. package/components/chat-independent/index.cjs +1 -0
  26. package/components/chat-independent/index.mjs +105 -212
  27. package/components/chat-independent/src/index.vue.d.ts +20 -2712
  28. package/components/components.css +1 -0
  29. package/components/drawer/index.cjs +1 -0
  30. package/components/drawer/index.mjs +53 -94
  31. package/components/drawer/src/ctx.d.ts +22 -22
  32. package/components/drawer/src/index.vue.d.ts +84 -557
  33. package/components/index.cjs +1 -0
  34. package/components/index.d.ts +1 -0
  35. package/components/lottie-animation/index.cjs +1 -0
  36. package/components/lottie-animation/index.mjs +36 -55
  37. package/components/lottie-animation/src/index.vue.d.ts +3 -2
  38. package/components/metahuman-broadcasting/index.cjs +1 -0
  39. package/components/metahuman-broadcasting/index.mjs +89 -140
  40. package/components/metahuman-broadcasting/src/index.vue.d.ts +16 -718
  41. package/components/monaco-editor/index.cjs +1 -0
  42. package/components/monaco-editor/index.mjs +68 -95
  43. package/components/monaco-editor/src/index.vue.d.ts +3 -2
  44. package/components/monaco-environment/index.cjs +1 -0
  45. package/components/monaco-environment/index.mjs +23 -38
  46. package/components/monaco-environment/src/index.vue.d.ts +2 -1
  47. package/components/pixi-frame/index.cjs +1 -0
  48. package/components/pixi-frame/index.mjs +941 -1969
  49. package/components/pixi-frame/src/apng.vue.d.ts +17 -73
  50. package/components/pixi-frame/src/bitmap-generator.vue.d.ts +24 -66
  51. package/components/pixi-frame/src/bitmap.vue.d.ts +28 -80
  52. package/components/pixi-frame/src/buffer-image.vue.d.ts +29 -97
  53. package/components/pixi-frame/src/core.vue.d.ts +20 -75
  54. package/components/pixi-frame/src/index.vue.d.ts +302 -237
  55. package/components/pixi-frame/src/provider.vue.d.ts +12 -1
  56. package/components/pixi-frame/src/video.vue.d.ts +17 -71
  57. package/components/pixi-frame/src/view.vue.d.ts +4 -16
  58. package/components/recorder-button/index.cjs +1 -0
  59. package/components/recorder-button/index.mjs +140 -269
  60. package/components/recorder-button/src/index.vue.d.ts +67 -66
  61. package/components/routes-menu-content/index.cjs +1 -0
  62. package/components/routes-menu-content/index.mjs +150 -229
  63. package/components/routes-menu-content/src/index.vue.d.ts +27 -26
  64. package/components/routes-menu-content/src/item/core/index.vue.d.ts +27 -26
  65. package/components/routes-menu-content/src/item/index.vue.d.ts +27 -26
  66. package/components/scrollbar/index.cjs +1 -0
  67. package/components/scrollbar/index.mjs +288 -567
  68. package/components/scrollbar/src/bar.vue.d.ts +6 -133
  69. package/components/scrollbar/src/index.vue.d.ts +66 -337
  70. package/components/scrollbar/src/thumb.vue.d.ts +3 -80
  71. package/components/sender/index.cjs +1 -0
  72. package/components/sender/index.mjs +156 -285
  73. package/components/sender/src/SenderHeader.vue.d.ts +14 -221
  74. package/components/sender/src/index.vue.d.ts +16 -505
  75. package/components/speech-button/index.cjs +1 -0
  76. package/components/speech-button/index.mjs +98 -144
  77. package/components/speech-button/src/LoadingIcon.vue.d.ts +2 -1
  78. package/components/speech-button/src/RecordingIcon.vue.d.ts +2 -1
  79. package/components/speech-button/src/index.vue.d.ts +6 -5
  80. package/components/table-columns/index.cjs +1 -0
  81. package/components/table-columns/index.mjs +48 -78
  82. package/components/table-columns/src/ctx.d.ts +10 -10
  83. package/components/table-columns/src/el-ctx.d.ts +1 -1
  84. package/components/table-columns/src/index.vue.d.ts +24 -23
  85. package/components/tables-v1/index.cjs +1 -0
  86. package/components/tables-v1/index.mjs +99 -160
  87. package/components/tables-v1/src/ctx.d.ts +28 -28
  88. package/components/tables-v1/src/el-ctx.d.ts +2 -2
  89. package/components/tables-v1/src/index.vue.d.ts +88 -2243
  90. package/components/tables-v1-checkbox/index.cjs +98 -0
  91. package/components/tables-v1-checkbox/index.mjs +1594 -3735
  92. package/components/tables-v1-checkbox/src/ctx.d.ts +26 -26
  93. package/components/tables-v1-checkbox/src/index.vue.d.ts +176 -2330
  94. package/components/text/index.cjs +1 -0
  95. package/components/text/index.mjs +70 -108
  96. package/components/text/src/ctx.d.ts +31 -31
  97. package/components/text/src/index.vue.d.ts +92 -1819
  98. package/components/thinking/index.cjs +1 -0
  99. package/components/thinking/index.mjs +127 -227
  100. package/components/thinking/src/index.vue.d.ts +22 -2044
  101. package/components/typing-markdown/index.cjs +1 -0
  102. package/components/typing-markdown/index.mjs +61 -201
  103. package/components/typing-markdown/src/index.vue.d.ts +3 -2
  104. package/components/vditor/index.cjs +1 -0
  105. package/components/vditor/index.mjs +121 -195
  106. package/components/vditor/src/ctx.d.ts +2 -2
  107. package/components/vditor/src/handle-fullscreen.vue.d.ts +3 -2
  108. package/components/vditor/src/handle-value.vue.d.ts +3 -2
  109. package/components/vditor/src/index.vue.d.ts +5 -4
  110. package/components/xgplayer/index.cjs +1 -0
  111. package/components/xgplayer/index.mjs +49 -90
  112. package/components/xgplayer/src/core.vue.d.ts +13 -18
  113. package/components/xgplayer/src/index.vue.d.ts +13 -67
  114. package/composables/el-breakpoints/index.cjs +1 -0
  115. package/composables/el-breakpoints/index.d.ts +10 -10
  116. package/composables/el-breakpoints/index.mjs +10 -12
  117. package/composables/index.cjs +1 -0
  118. package/composables/index.d.ts +1 -0
  119. package/composables/recorder/index.cjs +1 -0
  120. package/composables/recorder/index.mjs +9172 -14803
  121. package/element/_plugin-vue_export-helper-BHFhmbuH.js +1 -0
  122. package/element/bubble/index.cjs +3 -0
  123. package/element/bubble/index.d.ts +1 -1
  124. package/element/bubble/index.mjs +1 -1
  125. package/element/bubble/src/index.vue.d.ts +22 -22
  126. package/element/index.css +1 -1
  127. package/element/thinking/index.cjs +1 -0
  128. package/element/thinking/index.d.ts +1 -1
  129. package/element/thinking/index.mjs +1 -1
  130. package/element/thinking/src/index.vue.d.ts +26 -26
  131. package/element/thinking/src/types.d.ts +10 -0
  132. package/icons/_plugin-vue_export-helper-BHFhmbuH.js +1 -0
  133. package/icons/_plugin-vue_export-helper-CHgC5LLL.mjs +9 -0
  134. package/icons/end/index.cjs +1 -0
  135. package/icons/end/index.mjs +21 -26
  136. package/icons/end/src/index.vue.d.ts +3 -0
  137. package/icons/keyboard/index.cjs +1 -0
  138. package/icons/keyboard/index.mjs +21 -26
  139. package/icons/keyboard/src/index.vue.d.ts +3 -0
  140. package/icons/start/index.cjs +1 -0
  141. package/icons/start/index.mjs +21 -26
  142. package/icons/start/src/index.vue.d.ts +3 -0
  143. package/icons/voice/index.cjs +1 -0
  144. package/icons/voice/index.mjs +26 -44
  145. package/icons/voice/src/index.vue.d.ts +2 -3
  146. package/index.css +2 -558
  147. package/index.d.ts +1 -0
  148. package/package.json +78 -87
  149. package/shared/data/index.cjs +1 -0
  150. package/shared/data/index.mjs +16 -22
  151. package/shared/types/index.cjs +1 -0
  152. package/shared/types/index.d.ts +1 -0
  153. package/components/LinkOutlined.mjs +0 -1321
  154. package/components/_commonjsHelpers.mjs +0 -7
  155. package/components/_plugin-vue_export-helper.mjs +0 -9
  156. package/components/bubble-list/index.css +0 -70
  157. package/components/bubble-templates/index.css +0 -4
  158. package/components/chat-independent/index.css +0 -47
  159. package/components/drawer/index.css +0 -124
  160. package/components/index2.mjs +0 -78
  161. package/components/lottie-animation/index.css +0 -4
  162. package/components/monaco-editor/index.css +0 -4
  163. package/components/pixi-frame/index.css +0 -4
  164. package/components/recorder-button/index.css +0 -69
  165. package/components/sender/index.css +0 -22
  166. package/components/speech-button/index.css +0 -10
  167. package/components/tables-v1/index.css +0 -7
  168. package/components/tables-v1-checkbox/index.css +0 -8
  169. package/components/thinking/index.css +0 -125
  170. package/components/typing-markdown/index.css +0 -31
  171. package/components/vditor/index.css +0 -12
  172. package/components/xgplayer/index.css +0 -1
  173. package/icons/_plugin-vue_export-helper.mjs +0 -9
@@ -1,4 +1,4 @@
1
- declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
1
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
2
  vertical: BooleanConstructor;
3
3
  size: StringConstructor;
4
4
  move: NumberConstructor;
@@ -11,85 +11,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
11
11
  type: NumberConstructor;
12
12
  default: number;
13
13
  };
14
- }>, {
15
- props: import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
16
- vertical: BooleanConstructor;
17
- size: StringConstructor;
18
- move: NumberConstructor;
19
- ratio: {
20
- type: NumberConstructor;
21
- required: true;
22
- };
23
- always: BooleanConstructor;
24
- hideAfter: {
25
- type: NumberConstructor;
26
- default: number;
27
- };
28
- }>> & Readonly<{}> & {}>;
29
- scrollbar: import("element-plus").ScrollbarContext;
30
- ns: {
31
- namespace: import("vue").ComputedRef<string>;
32
- b: (blockSuffix?: string) => string;
33
- e: (element?: string) => string;
34
- m: (modifier?: string) => string;
35
- be: (blockSuffix?: string, element?: string) => string;
36
- em: (element?: string, modifier?: string) => string;
37
- bm: (blockSuffix?: string, modifier?: string) => string;
38
- bem: (blockSuffix?: string, element?: string, modifier?: string) => string;
39
- is: {
40
- (name: string, state: boolean | undefined): string;
41
- (name: string): string;
42
- };
43
- cssVar: (object: Record<string, string>) => Record<string, string>;
44
- cssVarName: (name: string) => string;
45
- cssVarBlock: (object: Record<string, string>) => Record<string, string>;
46
- cssVarBlockName: (name: string) => string;
47
- };
48
- instance: import("vue").Ref<HTMLDivElement | undefined, HTMLDivElement | undefined>;
49
- thumb: import("vue").Ref<HTMLDivElement | undefined, HTMLDivElement | undefined>;
50
- thumbState: import("vue").Ref<{
51
- X?: number | undefined;
52
- Y?: number | undefined;
53
- }, Partial<Record<"X" | "Y", number>> | {
54
- X?: number | undefined;
55
- Y?: number | undefined;
56
- }>;
57
- visible: import("vue").Ref<boolean, boolean>;
58
- cursorDown: boolean;
59
- cursorLeave: boolean;
60
- baseScrollHeight: number;
61
- baseScrollWidth: number;
62
- originalOnSelectStart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
63
- bar: import("vue").ComputedRef<{
64
- readonly offset: "offsetHeight";
65
- readonly scroll: "scrollTop";
66
- readonly scrollSize: "scrollHeight";
67
- readonly size: "height";
68
- readonly key: "vertical";
69
- readonly axis: "Y";
70
- readonly client: "clientY";
71
- readonly direction: "top";
72
- } | {
73
- readonly offset: "offsetWidth";
74
- readonly scroll: "scrollLeft";
75
- readonly scrollSize: "scrollWidth";
76
- readonly size: "width";
77
- readonly key: "horizontal";
78
- readonly axis: "X";
79
- readonly client: "clientX";
80
- readonly direction: "left";
81
- }>;
82
- thumbStyle: import("vue").ComputedRef<import("vue").CSSProperties>;
83
- offsetRatio: import("vue").ComputedRef<number>;
84
- clickThumbHandler: (e: MouseEvent) => void;
85
- clickTrackHandler: (e: MouseEvent) => void;
86
- startDrag: (e: MouseEvent) => void;
87
- mouseMoveDocumentHandler: (e: MouseEvent) => void;
88
- mouseUpDocumentHandler: () => void;
89
- mouseMoveScrollbarHandler: () => void;
90
- mouseLeaveScrollbarHandler: () => void;
91
- restoreOnselectstart: () => void;
92
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
14
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
93
15
  vertical: BooleanConstructor;
94
16
  size: StringConstructor;
95
17
  move: NumberConstructor;
@@ -107,4 +29,5 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
107
29
  always: boolean;
108
30
  hideAfter: number;
109
31
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
32
+ declare const _default: typeof __VLS_export;
110
33
  export default _default;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),f=require("@ant-design/icons-vue"),c=require("@vunk/core/composables"),B=require("ant-design-vue"),k=require("ant-design-x-vue"),O=require("@vunk/shared/function"),q=require("element-plus"),E={fileList:{type:Array,default:void 0},action:{type:String,default:""},modelValue:{type:String,default:""},loading:{type:Boolean,default:void 0},modules:{type:Array,default:()=>[]},sendDisabled:{type:Boolean,default:!1},attachmentsVisible:{type:Boolean,default:void 0},createSendButton:{type:Function,default:void 0},createAttachmentsButton:{type:Function,default:void 0},autoSize:{type:Object,default:void 0},attachmentsProps:{type:Object,default:()=>({})},attachmentsPlaceholder:{type:String,default:"点击上传或拖拽文件到此处"}},L={"update:fileList":o=>!0,"update:modelValue":o=>!0,"update:attachmentsVisible":o=>!0,submit:o=>!0,cancel:null},R={class:"ant-sender-header-header"},z={class:"ant-sender-header-header-title"},F={class:"ant-sender-header-header-close"},b=e.defineComponent({name:"AXSenderHeader",inheritAttrs:!1,__name:"SenderHeader",props:{modelValue:{type:Boolean,default:!1},title:{type:String,default:"Sender"},contentRef:{type:Function,default:O.noop}},emits:{"update:modelValue":null},setup(o){return(r,a)=>(e.openBlock(),e.createBlock(e.unref(q.ElCollapseTransition),null,{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",e.mergeProps({class:"ant-sender-header"},r.$attrs),[e.createElementVNode("div",R,[e.createElementVNode("div",z,e.toDisplayString(o.title),1),e.createElementVNode("div",F,[e.createVNode(e.unref(B.Button),{type:"text",size:"small",onClick:a[0]||(a[0]=u=>r.$emit("update:modelValue",!1))},{icon:e.withCtx(()=>[e.createVNode(e.unref(f.CloseOutlined))]),_:1})])]),e.createElementVNode("div",{ref:o.contentRef,class:"ant-sender-header-content"},[e.renderSlot(r.$slots,"default")],512)],16),[[e.vShow,o.modelValue]])]),_:3}))}}),d=e.defineComponent({name:"VkSender",__name:"index",props:E,emits:L,setup(o,{emit:r}){const a=o,u=r,m=e.useSlots(),p=e.computed(()=>a.modules.includes("Attachments")),h=c.useModelComputed({key:"loading",default:!1},a,u),s=c.useModelComputed({key:"attachmentsVisible",default:!1},a,u);function g(t={}){const{SendButton:l,LoadingButton:n}=t;return h.value?e.createVNode(n,null,null):e.createVNode(l,{disabled:a.sendDisabled},null)}function v(t){return(a.createSendButton||g)(t)}function C(){return e.createVNode(B.Button,{type:"text",onClick:()=>s.value=!s.value},{icon:()=>e.createVNode(f.LinkOutlined,null,null)})}function V(){const t=a.createAttachmentsButton||C;return p.value?t():null}const N=(t,l)=>{const{SendButton:n,LoadingButton:i}=l.components,A=v({SendButton:n,LoadingButton:i});return e.createVNode("div",{class:"vk-sender-actions"},[e.createVNode("div",{class:"vk-sender-actions__before"},[m.actions_before?.()]),e.createVNode("div",{class:"vk-sender-actions__after"},[m.actions_after?.()??A])])},_=t=>t==="drop"?{title:"请将文件拖到此处"}:{icon:e.createVNode(f.CloudUploadOutlined,null,null),title:"上传文件",description:a.attachmentsPlaceholder},y=c.useModelComputed({key:"fileList",default:[]},a,u),w=e.ref(),S=c.useDeferred(),D=S.resolve;async function $(t){s.value=!0;const l=await S.promise;await e.nextTick();const n=l.querySelector('input[type="file"]');if(n){const i=new DataTransfer;i.items.add(t),n.files=i.files,n.dispatchEvent(new Event("change",{bubbles:!0}))}}function P(t){y.value=t.fileList}return(t,l)=>(e.openBlock(),e.createBlock(e.unref(k.Sender),{class:"vk-sender",value:t.modelValue,loading:e.unref(h),"allow-speech":!0,actions:N,"on-submit":n=>{!t.sendDisabled&&t.$emit("submit",n)},"on-cancel":()=>t.$emit("cancel"),"auto-size":t.autoSize,"onUpdate:value":l[1]||(l[1]=n=>t.$emit("update:modelValue",n)),onPasteFile:$},e.createSlots({header:e.withCtx(()=>[p.value?(e.openBlock(),e.createBlock(b,{key:0,modelValue:e.unref(s),"onUpdate:modelValue":l[0]||(l[0]=n=>e.isRef(s)?s.value=n:null),title:"附件","content-ref":e.unref(D)},{default:e.withCtx(()=>[e.createVNode(e.unref(k.Attachments),e.mergeProps({ref_key:"attachmentsRef",ref:w,items:e.unref(y),placeholder:_,action:t.action,multiple:""},t.attachmentsProps,{onChange:P}),null,16,["items","action"])]),_:1},8,["modelValue","content-ref"])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"header")]),prefix:e.withCtx(()=>[t.$slots.prefix?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(V()),{key:0})),e.renderSlot(t.$slots,"prefix")]),_:2},[t.$slots.footer?{name:"footer",fn:e.withCtx(({info:n})=>[e.renderSlot(t.$slots,"footer",{sendButton:v(n.components),attachmentsButton:V(),info:n})]),key:"0"}:void 0]),1032,["value","loading","on-submit","on-cancel","auto-size"]))}}),M=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));d.install=o=>{o.component(d.name||"VkSender",d)};exports.VkSender=d;exports.VkSenderHeader=b;exports.__VkSender=M;exports.default=d;
@@ -1,13 +1,11 @@
1
- import { defineComponent, openBlock, createBlock, withCtx, withDirectives, createElementVNode, mergeProps, toDisplayString, createVNode, renderSlot, vShow, useSlots, computed, ref, nextTick, createSlots, createCommentVNode, resolveDynamicComponent } from 'vue';
2
- import { useModelComputed, useDeferred } from '@vunk/core/composables';
3
- import { Button } from 'ant-design-vue';
4
- import { Attachments, Sender } from 'ant-design-x-vue';
5
- import { noop } from '@vunk/shared/function';
6
- import { ElCollapseTransition } from 'element-plus';
7
- import { C as CloseOutlined, L as LinkOutlined, a as CloudUploadOutlined } from '../LinkOutlined.mjs';
8
- import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
9
-
10
- const props = {
1
+ import { defineComponent as C, createBlock as m, openBlock as p, unref as s, withCtx as i, withDirectives as E, createElementVNode as u, mergeProps as A, toDisplayString as H, createVNode as l, renderSlot as h, vShow as N, useSlots as U, computed as W, ref as M, createSlots as q, createCommentVNode as $, resolveDynamicComponent as I, isRef as X, nextTick as G } from "vue";
2
+ import { CloseOutlined as J, CloudUploadOutlined as K, LinkOutlined as Q } from "@ant-design/icons-vue";
3
+ import { useModelComputed as v, useDeferred as Y } from "@vunk/core/composables";
4
+ import { Button as D } from "ant-design-vue";
5
+ import { Sender as Z, Attachments as x } from "ant-design-x-vue";
6
+ import { noop as ee } from "@vunk/shared/function";
7
+ import { ElCollapseTransition as te } from "element-plus";
8
+ const ne = {
11
9
  /**
12
10
  * @description v-model 绑定文件列表
13
11
  */
@@ -48,7 +46,7 @@ const props = {
48
46
  */
49
47
  sendDisabled: {
50
48
  type: Boolean,
51
- default: false
49
+ default: !1
52
50
  },
53
51
  /**
54
52
  * @description v-model attachments显隐 在 Attachments 模块存在时有效
@@ -87,27 +85,28 @@ const props = {
87
85
  },
88
86
  attachmentsPlaceholder: {
89
87
  type: String,
90
- default: "\u70B9\u51FB\u4E0A\u4F20\u6216\u62D6\u62FD\u6587\u4EF6\u5230\u6B64\u5904"
88
+ default: "点击上传或拖拽文件到此处"
91
89
  }
92
- };
93
- const emits = {
94
- "update:fileList": (_) => true,
95
- "update:modelValue": (_) => true,
96
- "update:attachmentsVisible": (_) => true,
97
- "submit": (_) => true,
98
- "cancel": null
99
- };
100
-
101
- var _sfc_main$1 = /* @__PURE__ */defineComponent({
102
- ...{
103
- name: "AXSenderHeader",
104
- inheritAttrs: false
105
- },
90
+ }, ae = {
91
+ "update:fileList": (n) => !0,
92
+ "update:modelValue": (n) => !0,
93
+ "update:attachmentsVisible": (n) => !0,
94
+ submit: (n) => !0,
95
+ cancel: null
96
+ }, oe = {
97
+ class: "ant-sender-header-header"
98
+ }, le = {
99
+ class: "ant-sender-header-header-title"
100
+ }, se = {
101
+ class: "ant-sender-header-header-close"
102
+ }, re = /* @__PURE__ */ C({
103
+ name: "AXSenderHeader",
104
+ inheritAttrs: !1,
106
105
  __name: "SenderHeader",
107
106
  props: {
108
107
  modelValue: {
109
108
  type: Boolean,
110
- default: false
109
+ default: !1
111
110
  },
112
111
  title: {
113
112
  type: String,
@@ -115,295 +114,167 @@ var _sfc_main$1 = /* @__PURE__ */defineComponent({
115
114
  },
116
115
  contentRef: {
117
116
  type: Function,
118
- default: noop
117
+ default: ee
119
118
  }
120
119
  },
121
120
  emits: {
122
121
  "update:modelValue": null
123
122
  },
124
- setup(__props, {
125
- expose: __expose
126
- }) {
127
- __expose();
128
- const __returned__ = {
129
- get CloseOutlined() {
130
- return CloseOutlined;
131
- },
132
- get AntButton() {
133
- return Button;
134
- },
135
- get ElCollapseTransition() {
136
- return ElCollapseTransition;
137
- }
138
- };
139
- Object.defineProperty(__returned__, "__isScriptSetup", {
140
- enumerable: false,
141
- value: true
142
- });
143
- return __returned__;
123
+ setup(n) {
124
+ return (d, a) => (p(), m(s(te), null, {
125
+ default: i(() => [E(u("div", A({
126
+ class: "ant-sender-header"
127
+ }, d.$attrs), [u("div", oe, [u("div", le, H(n.title), 1), u("div", se, [l(s(D), {
128
+ type: "text",
129
+ size: "small",
130
+ onClick: a[0] || (a[0] = (c) => d.$emit("update:modelValue", !1))
131
+ }, {
132
+ icon: i(() => [l(s(J))]),
133
+ _: 1
134
+ })])]), u("div", {
135
+ ref: n.contentRef,
136
+ class: "ant-sender-header-content"
137
+ }, [h(d.$slots, "default")], 512)], 16), [[N, n.modelValue]])]),
138
+ _: 3
139
+ }));
144
140
  }
145
- });
146
-
147
- const _hoisted_1 = { class: "ant-sender-header-header" };
148
- const _hoisted_2 = { class: "ant-sender-header-header-title" };
149
- const _hoisted_3 = { class: "ant-sender-header-header-close" };
150
- function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
151
- return openBlock(), createBlock($setup["ElCollapseTransition"], null, {
152
- default: withCtx(() => [
153
- withDirectives(createElementVNode(
154
- "div",
155
- mergeProps({ class: "ant-sender-header" }, _ctx.$attrs),
156
- [
157
- createElementVNode("div", _hoisted_1, [
158
- createElementVNode(
159
- "div",
160
- _hoisted_2,
161
- toDisplayString($props.title),
162
- 1
163
- /* TEXT */
164
- ),
165
- createElementVNode("div", _hoisted_3, [
166
- createVNode($setup["AntButton"], {
167
- type: "text",
168
- size: "small",
169
- onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", false))
170
- }, {
171
- icon: withCtx(() => [
172
- createVNode($setup["CloseOutlined"])
173
- ]),
174
- _: 1
175
- /* STABLE */
176
- })
177
- ])
178
- ]),
179
- createElementVNode(
180
- "div",
181
- {
182
- ref: $props.contentRef,
183
- class: "ant-sender-header-content"
184
- },
185
- [
186
- renderSlot(_ctx.$slots, "default")
187
- ],
188
- 512
189
- /* NEED_PATCH */
190
- )
191
- ],
192
- 16
193
- /* FULL_PROPS */
194
- ), [
195
- [vShow, $props.modelValue]
196
- ])
197
- ]),
198
- _: 3
199
- /* FORWARDED */
200
- });
201
- }
202
- var SenderHeader = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/sender/src/SenderHeader.vue"]]);
203
-
204
- var _sfc_main = /* @__PURE__ */defineComponent({
205
- ...{
206
- name: "VkSender"
207
- },
141
+ }), y = /* @__PURE__ */ C({
142
+ name: "VkSender",
208
143
  __name: "index",
209
- props: props,
210
- emits,
211
- setup(__props, {
212
- expose: __expose,
213
- emit: __emit
144
+ props: ne,
145
+ emits: ae,
146
+ setup(n, {
147
+ emit: d
214
148
  }) {
215
- __expose();
216
- const props = __props;
217
- const emit = __emit;
218
- const slots = useSlots();
219
- const hasAttachments = computed(() => props.modules.includes("Attachments"));
220
- const loading = useModelComputed({
149
+ const a = n, c = d, S = U(), k = W(() => a.modules.includes("Attachments")), V = v({
221
150
  key: "loading",
222
- default: false
223
- }, props, emit);
224
- const headerOpen = useModelComputed({
151
+ default: !1
152
+ }, a, c), r = v({
225
153
  key: "attachmentsVisible",
226
- default: false
227
- }, props, emit);
228
- function createSendButtonDefault(components = {}) {
154
+ default: !1
155
+ }, a, c);
156
+ function P(e = {}) {
229
157
  const {
230
- SendButton,
231
- LoadingButton
232
- } = components;
233
- return loading.value ? createVNode(LoadingButton, null, null) : createVNode(SendButton, {
234
- "disabled": props.sendDisabled
158
+ SendButton: o,
159
+ LoadingButton: t
160
+ } = e;
161
+ return V.value ? l(t, null, null) : l(o, {
162
+ disabled: a.sendDisabled
235
163
  }, null);
236
164
  }
237
- function createSendButton(components) {
238
- const fn = props.createSendButton || createSendButtonDefault;
239
- return fn(components);
165
+ function b(e) {
166
+ return (a.createSendButton || P)(e);
240
167
  }
241
- function createAttachmentsButtonDefault() {
242
- return createVNode(Button, {
243
- "type": "text",
244
- "onClick": () => headerOpen.value = !headerOpen.value
168
+ function w() {
169
+ return l(D, {
170
+ type: "text",
171
+ onClick: () => r.value = !r.value
245
172
  }, {
246
- icon: () => createVNode(LinkOutlined, null, null)
173
+ icon: () => l(Q, null, null)
247
174
  });
248
175
  }
249
- function createAttachmentsButton() {
250
- const fn = props.createAttachmentsButton || createAttachmentsButtonDefault;
251
- return hasAttachments.value ? fn() : null;
176
+ function B() {
177
+ const e = a.createAttachmentsButton || w;
178
+ return k.value ? e() : null;
252
179
  }
253
- const actionsRender = (_, info) => {
180
+ const L = (e, o) => {
254
181
  const {
255
- SendButton,
256
- LoadingButton
257
- } = info.components;
258
- const send = createSendButton({
259
- SendButton,
260
- LoadingButton
182
+ SendButton: t,
183
+ LoadingButton: f
184
+ } = o.components, j = b({
185
+ SendButton: t,
186
+ LoadingButton: f
261
187
  });
262
- return createVNode("div", {
263
- "class": "vk-sender-actions"
264
- }, [createVNode("div", {
265
- "class": "vk-sender-actions__before"
266
- }, [slots.actions_before?.()]), createVNode("div", {
267
- "class": "vk-sender-actions__after"
268
- }, [slots.actions_after?.() ?? send])]);
269
- };
270
- const attachmentsPlaceholder = type => {
271
- if (type === "drop") {
272
- return {
273
- title: "\u8BF7\u5C06\u6587\u4EF6\u62D6\u5230\u6B64\u5904"
274
- };
275
- } else {
276
- return {
277
- icon: createVNode(CloudUploadOutlined, null, null),
278
- title: "\u4E0A\u4F20\u6587\u4EF6",
279
- description: props.attachmentsPlaceholder
280
- };
281
- }
282
- };
283
- const theFileList = useModelComputed({
188
+ return l("div", {
189
+ class: "vk-sender-actions"
190
+ }, [l("div", {
191
+ class: "vk-sender-actions__before"
192
+ }, [S.actions_before?.()]), l("div", {
193
+ class: "vk-sender-actions__after"
194
+ }, [S.actions_after?.() ?? j])]);
195
+ }, O = (e) => e === "drop" ? {
196
+ title: "请将文件拖到此处"
197
+ } : {
198
+ icon: l(K, null, null),
199
+ title: "上传文件",
200
+ description: a.attachmentsPlaceholder
201
+ }, g = v({
284
202
  key: "fileList",
285
203
  default: []
286
- }, props, emit);
287
- const attachmentsRef = ref();
288
- const attachmentWrapDef = useDeferred();
289
- const attachmentWrapResolve = attachmentWrapDef.resolve;
290
- async function handlePasteFile(file) {
291
- headerOpen.value = true;
292
- const attachmentWrap = await attachmentWrapDef.promise;
293
- await nextTick();
294
- const fileInput = attachmentWrap.querySelector('input[type="file"]');
295
- if (fileInput) {
296
- const dataTransfer = new DataTransfer();
297
- dataTransfer.items.add(file);
298
- fileInput.files = dataTransfer.files;
299
- fileInput.dispatchEvent(new Event("change", {
300
- bubbles: true
204
+ }, a, c), R = M(), _ = Y(), z = _.resolve;
205
+ async function F(e) {
206
+ r.value = !0;
207
+ const o = await _.promise;
208
+ await G();
209
+ const t = o.querySelector('input[type="file"]');
210
+ if (t) {
211
+ const f = new DataTransfer();
212
+ f.items.add(e), t.files = f.files, t.dispatchEvent(new Event("change", {
213
+ bubbles: !0
301
214
  }));
302
215
  }
303
216
  }
304
- function handleChange(e) {
305
- theFileList.value = e.fileList;
217
+ function T(e) {
218
+ g.value = e.fileList;
306
219
  }
307
- const __returned__ = {
308
- props,
309
- emit,
310
- slots,
311
- hasAttachments,
312
- loading,
313
- headerOpen,
314
- createSendButtonDefault,
315
- createSendButton,
316
- createAttachmentsButtonDefault,
317
- createAttachmentsButton,
318
- actionsRender,
319
- attachmentsPlaceholder,
320
- theFileList,
321
- attachmentsRef,
322
- attachmentWrapDef,
323
- attachmentWrapResolve,
324
- handlePasteFile,
325
- handleChange,
326
- get Attachments() {
327
- return Attachments;
328
- },
329
- get Sender() {
330
- return Sender;
220
+ return (e, o) => (p(), m(s(Z), {
221
+ class: "vk-sender",
222
+ value: e.modelValue,
223
+ loading: s(V),
224
+ "allow-speech": !0,
225
+ actions: L,
226
+ "on-submit": (t) => {
227
+ !e.sendDisabled && e.$emit("submit", t);
331
228
  },
332
- SenderHeader
333
- };
334
- Object.defineProperty(__returned__, "__isScriptSetup", {
335
- enumerable: false,
336
- value: true
337
- });
338
- return __returned__;
339
- }
340
- });
341
-
342
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
343
- return openBlock(), createBlock($setup["Sender"], {
344
- class: "vk-sender",
345
- value: _ctx.modelValue,
346
- loading: $setup.loading,
347
- "allow-speech": true,
348
- actions: $setup.actionsRender,
349
- "on-submit": (e) => {
350
- !_ctx.sendDisabled && _ctx.$emit("submit", e);
351
- },
352
- "on-cancel": () => _ctx.$emit("cancel"),
353
- "auto-size": _ctx.autoSize,
354
- "onUpdate:value": _cache[1] || (_cache[1] = ($event) => _ctx.$emit("update:modelValue", $event)),
355
- onPasteFile: $setup.handlePasteFile
356
- }, createSlots({
357
- header: withCtx(() => [
358
- $setup.hasAttachments ? (openBlock(), createBlock($setup["SenderHeader"], {
229
+ "on-cancel": () => e.$emit("cancel"),
230
+ "auto-size": e.autoSize,
231
+ "onUpdate:value": o[1] || (o[1] = (t) => e.$emit("update:modelValue", t)),
232
+ onPasteFile: F
233
+ }, q({
234
+ header: i(() => [k.value ? (p(), m(re, {
359
235
  key: 0,
360
- modelValue: $setup.headerOpen,
361
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.headerOpen = $event),
362
- title: "\u9644\u4EF6",
363
- "content-ref": $setup.attachmentWrapResolve
236
+ modelValue: s(r),
237
+ "onUpdate:modelValue": o[0] || (o[0] = (t) => X(r) ? r.value = t : null),
238
+ title: "附件",
239
+ "content-ref": s(z)
364
240
  }, {
365
- default: withCtx(() => [
366
- createVNode($setup["Attachments"], mergeProps({
367
- ref: "attachmentsRef",
368
- items: $setup.theFileList,
369
- placeholder: $setup.attachmentsPlaceholder,
370
- action: _ctx.action,
371
- multiple: ""
372
- }, _ctx.attachmentsProps, { onChange: $setup.handleChange }), null, 16, ["items", "action"])
373
- ]),
241
+ default: i(() => [l(s(x), A({
242
+ ref_key: "attachmentsRef",
243
+ ref: R,
244
+ items: s(g),
245
+ placeholder: O,
246
+ action: e.action,
247
+ multiple: ""
248
+ }, e.attachmentsProps, {
249
+ onChange: T
250
+ }), null, 16, ["items", "action"])]),
374
251
  _: 1
375
- /* STABLE */
376
- }, 8, ["modelValue", "content-ref"])) : createCommentVNode("v-if", true),
377
- renderSlot(_ctx.$slots, "header")
378
- ]),
379
- prefix: withCtx(() => [
380
- !_ctx.$slots.prefix ? (openBlock(), createBlock(resolveDynamicComponent($setup.createAttachmentsButton()), { key: 0 })) : createCommentVNode("v-if", true),
381
- renderSlot(_ctx.$slots, "prefix")
382
- ]),
383
- _: 2
384
- /* DYNAMIC */
385
- }, [
386
- _ctx.$slots.footer ? {
252
+ }, 8, ["modelValue", "content-ref"])) : $("", !0), h(e.$slots, "header")]),
253
+ prefix: i(() => [e.$slots.prefix ? $("", !0) : (p(), m(I(B()), {
254
+ key: 0
255
+ })), h(e.$slots, "prefix")]),
256
+ _: 2
257
+ }, [e.$slots.footer ? {
387
258
  name: "footer",
388
- fn: withCtx(({ info }) => [
389
- renderSlot(_ctx.$slots, "footer", {
390
- sendButton: $setup.createSendButton(info.components),
391
- attachmentsButton: $setup.createAttachmentsButton(),
392
- info
393
- })
394
- ]),
259
+ fn: i(({
260
+ info: t
261
+ }) => [h(e.$slots, "footer", {
262
+ sendButton: b(t.components),
263
+ attachmentsButton: B(),
264
+ info: t
265
+ })]),
395
266
  key: "0"
396
- } : void 0
397
- ]), 1032, ["value", "loading", "on-submit", "on-cancel", "auto-size"]);
398
- }
399
- var VkSender = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/sender/src/index.vue"]]);
400
-
401
- var types = /*#__PURE__*/Object.freeze({
267
+ } : void 0]), 1032, ["value", "loading", "on-submit", "on-cancel", "auto-size"]));
268
+ }
269
+ }), he = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
402
270
  __proto__: null
403
- });
404
-
405
- VkSender.install = (app) => {
406
- app.component(VkSender.name || "VkSender", VkSender);
271
+ }, Symbol.toStringTag, { value: "Module" }));
272
+ y.install = (n) => {
273
+ n.component(y.name || "VkSender", y);
274
+ };
275
+ export {
276
+ y as VkSender,
277
+ re as VkSenderHeader,
278
+ he as __VkSender,
279
+ y as default
407
280
  };
408
-
409
- export { VkSender, SenderHeader as VkSenderHeader, types as __VkSender, VkSender as default };