@vunk/plus 1.12.2 → 1.13.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 (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 +501 -1978
  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 +1 -0
  91. package/components/tables-v1-checkbox/index.mjs +116 -4043
  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
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("@vueuse/core"),h=require("@vunk/core/composables"),y=require("@vunk/shared/function"),t=require("vue"),k=require("@vunk/shared/markdown/shiki"),m=require("markdown-it-async"),p=require("../_plugin-vue_export-helper-BHFhmbuH.js"),b=k.highlight({dark:"github-dark",light:"github-light"},{},{warn:c.noop});async function _(){const[e]=await b,a=m({highlight:e});return a.core.ruler.after("inline","add-is-last-class",n=>{const o=n.tokens;let s=-1;for(let i=o.length-1;i>=0;i--){const r=o[i];if(r.nesting===1&&!r.hidden){s=i;break}}s!==-1&&o[s].attrSet("class","is-last")}),a}const w=_(),T={source:{type:String,default:""},delay:{type:Number,default:60},pause:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},markdownItSetup:{type:Function,default:null},finished:{type:Boolean},loading:{type:Boolean,default:!1}},v={typing:null,"update:finished":null},M=t.defineComponent({name:"VkTypingMarkdown",props:T,emits:v,setup(e,{emit:a}){const n=t.ref(0),o=t.computed(()=>e.disabled?e.source:e.source.substring(0,n.value)),s=w.then(l=>(e.markdownItSetup?.(l),l)),i=c.computedAsync(async()=>(y.noop(o.value),(await s).render(o.value)),""),r=t.computed(()=>!e.pause&&!e.disabled&&n.value!==e.source.length),g=c.debouncedRef(r,100),f=h.useModelComputed({default:!1,key:"finished"},e,a);function d(){e.pause||e.disabled||e.source.length===0||(n.value<e.source.length?(n.value++,a("typing"),setTimeout(d,e.delay)):f.value=!0)}return t.watch(()=>e.pause||e.disabled,l=>{l||d()},{flush:"post",immediate:!0}),t.watch(()=>n.value<e.source.length,()=>{f.value=!1,d()}),{htmlText:i,isDebouncedTyping:g}}}),I=["innerHTML"];function S(e,a,n,o,s,i){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["vk-typing-markdown",{"is-typing":e.isDebouncedTyping,"is-loading":e.loading}]),innerHTML:e.htmlText},null,10,I)}const u=p._export_sfc(M,[["render",S]]),q=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));u.install=e=>{e.component(u.name||"VkTypingMarkdown",u)};exports.VkTypingMarkdown=u;exports.__VkTypingMarkdown=q;exports.default=u;
@@ -1,135 +1,34 @@
1
- import { noop, computedAsync, debouncedRef } from '@vueuse/core';
2
- import { useModelComputed } from '@vunk/core/composables';
3
- import { noop as noop$1 } from '@vunk/shared/function';
4
- import { defineComponent, ref, computed, watch, openBlock, createElementBlock, normalizeClass } from 'vue';
5
- import { highlight } from '@vunk/shared/markdown/shiki';
6
- import MarkdownIt from 'markdown-it';
7
- import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
8
-
9
- const placeholder = (id, code) => `<pre><!--::markdown-it-async::${id}::--><code>${code}</code></pre>`;
10
- const placeholderRe = /<pre><!--::markdown-it-async::(\w+)::--><code>[\s\S]*?<\/code><\/pre>/g;
11
- function randStr() {
12
- return Math.random().toString(36).slice(2) + Math.random().toString(36).slice(2);
13
- }
14
- class MarkdownItAsync extends MarkdownIt {
15
- placeholderMap;
16
- disableWarn = false;
17
- constructor(...args) {
18
- const map = /* @__PURE__ */ new Map();
19
- const options = args.length === 2 ? args[1] : args[0];
20
- if (options && "highlight" in options)
21
- options.highlight = wrapHightlight(options.highlight, map);
22
- super(...args);
23
- this.placeholderMap = map;
24
- }
25
- // implementation
26
- use(plugin, ...params) {
27
- return super.use(plugin, ...params);
28
- }
29
- render(src, env) {
30
- if (this.options.warnOnSyncRender && !this.disableWarn) {
31
- console.warn("[markdown-it-async] Please use `md.renderAsync` instead of `md.render`");
32
- }
33
- return super.render(src, env);
34
- }
35
- async renderAsync(src, env) {
36
- this.options.highlight = wrapHightlight(this.options.highlight, this.placeholderMap);
37
- this.disableWarn = true;
38
- const result = this.render(src, env);
39
- this.disableWarn = false;
40
- return replaceAsync(result, placeholderRe, async (match, id) => {
41
- if (!this.placeholderMap.has(id))
42
- throw new Error(`Unknown highlight placeholder id: ${id}`);
43
- const [promise, _str, lang, _attrs] = this.placeholderMap.get(id);
44
- const result2 = await promise || "";
45
- this.placeholderMap.delete(id);
46
- if (result2.startsWith("<pre"))
47
- return result2;
48
- else
49
- return `<pre><code class="language-${lang}">${result2}</code></pre>`;
50
- });
51
- }
52
- }
53
- function createMarkdownItAsync(...args) {
54
- return new MarkdownItAsync(...args);
55
- }
56
- function replaceAsync(string, searchValue, replacer) {
57
- try {
58
- if (typeof replacer === "function") {
59
- const values = [];
60
- String.prototype.replace.call(string, searchValue, (...args) => {
61
- values.push(replacer(...args));
62
- return "";
63
- });
64
- return Promise.all(values).then((resolvedValues) => {
65
- return String.prototype.replace.call(string, searchValue, () => {
66
- return resolvedValues.shift() || "";
67
- });
68
- });
69
- } else {
70
- return Promise.resolve(
71
- String.prototype.replace.call(string, searchValue, replacer)
72
- );
73
- }
74
- } catch (error) {
75
- return Promise.reject(error);
76
- }
77
- }
78
- const wrappedSet = /* @__PURE__ */ new WeakSet();
79
- function escapeHtml(unsafe) {
80
- return unsafe.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
81
- }
82
- function wrapHightlight(highlight, map) {
83
- if (!highlight)
84
- return void 0;
85
- if (wrappedSet.has(highlight))
86
- return highlight;
87
- const wrapped = (str, lang, attrs) => {
88
- const promise = highlight(str, lang, attrs);
89
- if (typeof promise === "string")
90
- return promise;
91
- const id = randStr();
92
- map.set(id, [promise, str, lang, attrs]);
93
- let code = str;
94
- if (code.endsWith("\n"))
95
- code = code.slice(0, -1);
96
- code = escapeHtml(code);
97
- return placeholder(id, code);
98
- };
99
- wrappedSet.add(wrapped);
100
- return wrapped;
101
- }
102
-
103
- const highlightInfo = highlight({
1
+ import { noop as g, computedAsync as h, debouncedRef as y } from "@vueuse/core";
2
+ import { useModelComputed as k } from "@vunk/core/composables";
3
+ import { noop as p } from "@vunk/shared/function";
4
+ import { defineComponent as b, ref as w, computed as c, watch as f, createElementBlock as T, openBlock as _, normalizeClass as v } from "vue";
5
+ import { highlight as M } from "@vunk/shared/markdown/shiki";
6
+ import I from "markdown-it-async";
7
+ import { _ as B } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
8
+ const S = M({
104
9
  dark: "github-dark",
105
10
  light: "github-light"
106
11
  }, {}, {
107
- warn: noop
12
+ warn: g
108
13
  });
109
- async function createMarkdownIt() {
110
- const [highlight] = await highlightInfo;
111
- const md = createMarkdownItAsync({
112
- highlight
14
+ async function x() {
15
+ const [e] = await S, a = I({
16
+ highlight: e
113
17
  });
114
- md.core.ruler.after("inline", "add-is-last-class", (state) => {
115
- const tokens = state.tokens;
116
- let lastTagIndex = -1;
117
- for (let i = tokens.length - 1; i >= 0; i--) {
118
- const token = tokens[i];
119
- if (token.nesting === 1 && !token.hidden) {
120
- lastTagIndex = i;
18
+ return a.core.ruler.after("inline", "add-is-last-class", (t) => {
19
+ const n = t.tokens;
20
+ let i = -1;
21
+ for (let o = n.length - 1; o >= 0; o--) {
22
+ const s = n[o];
23
+ if (s.nesting === 1 && !s.hidden) {
24
+ i = o;
121
25
  break;
122
26
  }
123
27
  }
124
- if (lastTagIndex !== -1) {
125
- tokens[lastTagIndex].attrSet("class", "is-last");
126
- }
127
- });
128
- return md;
28
+ i !== -1 && n[i].attrSet("class", "is-last");
29
+ }), a;
129
30
  }
130
- const markdownItPromise = createMarkdownIt();
131
-
132
- const props = {
31
+ const $ = x(), V = {
133
32
  source: {
134
33
  type: String,
135
34
  default: ""
@@ -141,14 +40,14 @@ const props = {
141
40
  // 暂停
142
41
  pause: {
143
42
  type: Boolean,
144
- default: false
43
+ default: !1
145
44
  },
146
45
  /**
147
46
  * 禁用typing
148
47
  */
149
48
  disabled: {
150
49
  type: Boolean,
151
- default: false
50
+ default: !1
152
51
  },
153
52
  /**
154
53
  * @description markdown-it 配置
@@ -162,92 +61,53 @@ const props = {
162
61
  },
163
62
  loading: {
164
63
  type: Boolean,
165
- default: false
64
+ default: !1
166
65
  }
167
- };
168
- const emits = {
169
- "typing": null,
66
+ }, C = {
67
+ typing: null,
170
68
  "update:finished": null
171
- };
172
-
173
- var _sfc_main = defineComponent({
69
+ }, j = b({
174
70
  name: "VkTypingMarkdown",
175
- props,
176
- emits,
177
- setup(props2, { emit }) {
178
- const currentIndex = ref(0);
179
- const currentText = computed(() => {
180
- if (props2.disabled) {
181
- return props2.source;
182
- }
183
- return props2.source.substring(0, currentIndex.value);
184
- });
185
- const theMarkdownIt = markdownItPromise.then((md) => {
186
- props2.markdownItSetup?.(md);
187
- return md;
188
- });
189
- const htmlText = computedAsync(async () => {
190
- noop$1(currentText.value);
191
- const md = await theMarkdownIt;
192
- return md.render(currentText.value);
193
- }, "");
194
- const isTyping = computed(() => {
195
- return !props2.pause && !props2.disabled && currentIndex.value !== props2.source.length;
196
- });
197
- const isDebouncedTyping = debouncedRef(isTyping, 100);
198
- const isFinished = useModelComputed({
199
- default: false,
71
+ props: V,
72
+ emits: C,
73
+ setup(e, { emit: a }) {
74
+ const t = w(0), n = c(() => e.disabled ? e.source : e.source.substring(0, t.value)), i = $.then((l) => (e.markdownItSetup?.(l), l)), o = h(async () => (p(n.value), (await i).render(n.value)), ""), s = c(() => !e.pause && !e.disabled && t.value !== e.source.length), m = y(s, 100), d = k({
75
+ default: !1,
200
76
  key: "finished"
201
- }, props2, emit);
202
- function typeWriter() {
203
- if (props2.pause || props2.disabled || props2.source.length === 0) {
204
- return;
205
- }
206
- if (currentIndex.value < props2.source.length) {
207
- currentIndex.value++;
208
- emit("typing");
209
- setTimeout(typeWriter, props2.delay);
210
- } else {
211
- isFinished.value = true;
212
- }
77
+ }, e, a);
78
+ function r() {
79
+ e.pause || e.disabled || e.source.length === 0 || (t.value < e.source.length ? (t.value++, a("typing"), setTimeout(r, e.delay)) : d.value = !0);
213
80
  }
214
- watch(() => props2.pause || props2.disabled, (v) => {
215
- if (!v) {
216
- typeWriter();
217
- }
81
+ return f(() => e.pause || e.disabled, (l) => {
82
+ l || r();
218
83
  }, {
219
84
  flush: "post",
220
- immediate: true
221
- });
222
- watch(() => currentIndex.value < props2.source.length, () => {
223
- isFinished.value = false;
224
- typeWriter();
225
- });
226
- return {
227
- htmlText,
228
- isDebouncedTyping
85
+ immediate: !0
86
+ }), f(() => t.value < e.source.length, () => {
87
+ d.value = !1, r();
88
+ }), {
89
+ htmlText: o,
90
+ isDebouncedTyping: m
229
91
  };
230
92
  }
231
- });
232
-
233
- const _hoisted_1 = ["innerHTML"];
234
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
235
- return openBlock(), createElementBlock("div", {
236
- class: normalizeClass(["vk-typing-markdown", {
237
- "is-typing": _ctx.isDebouncedTyping,
238
- "is-loading": _ctx.loading
93
+ }), z = ["innerHTML"];
94
+ function A(e, a, t, n, i, o) {
95
+ return _(), T("div", {
96
+ class: v(["vk-typing-markdown", {
97
+ "is-typing": e.isDebouncedTyping,
98
+ "is-loading": e.loading
239
99
  }]),
240
- innerHTML: _ctx.htmlText
241
- }, null, 10, _hoisted_1);
100
+ innerHTML: e.htmlText
101
+ }, null, 10, z);
242
102
  }
243
- var VkTypingMarkdown = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/typing-markdown/src/index.vue"]]);
244
-
245
- var types = /*#__PURE__*/Object.freeze({
103
+ const u = /* @__PURE__ */ B(j, [["render", A]]), N = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
246
104
  __proto__: null
247
- });
248
-
249
- VkTypingMarkdown.install = (app) => {
250
- app.component(VkTypingMarkdown.name || "VkTypingMarkdown", VkTypingMarkdown);
105
+ }, Symbol.toStringTag, { value: "Module" }));
106
+ u.install = (e) => {
107
+ e.component(u.name || "VkTypingMarkdown", u);
108
+ };
109
+ export {
110
+ u as VkTypingMarkdown,
111
+ N as __VkTypingMarkdown,
112
+ u as default
251
113
  };
252
-
253
- export { VkTypingMarkdown, types as __VkTypingMarkdown, VkTypingMarkdown as default };
@@ -1,4 +1,6 @@
1
- declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
1
+ declare const _default: typeof __VLS_export;
2
+ export default _default;
3
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
4
  source: {
3
5
  type: StringConstructor;
4
6
  default: string;
@@ -72,4 +74,3 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
72
74
  markdownItSetup: (md: import("markdown-it-async").MarkdownItAsync) => void;
73
75
  finished: boolean;
74
76
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
75
- export default _default;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const k=require("vditor"),p=require("@vunk/core/shared/utils-vue"),t=require("vue"),y=require("mitt"),V=require("@vueuse/core"),b=require("@vunk/core"),_=require("../_plugin-vue_export-helper-BHFhmbuH.js"),C=["headings","bold","italic","strike","link","|","list","ordered-list","outdent","indent","|","line","code","inline-code","insert-before","insert-after","|","table","|","undo","redo","|","fullscreen","outline","export","|"],f={modelValue:{type:String,default:""},defaultOptions:{type:Object,default:()=>({})},placeholder:{type:String,default:"Crtl + Enter 发送; Enter 换行"},toolbar:{type:Array,default:()=>C},fullscreen:{type:Boolean,default:!1}},O=p.bindPropsFactory(f),m={load:e=>e,"update:modelValue":e=>e,ctrlEnter:e=>e,"update:fullscreen":e=>e},E=p.onEmitsFactory(m),h=Object.freeze(Object.defineProperty({__proto__:null,createBindProps:O,createOnEmits:E,emits:m,props:f},Symbol.toStringTag,{value:"Module"})),v=()=>{const e=t.inject("vkVditorRef",null);if(!e)throw new Error("useVditor must be used after VditorProvider");return t.unref(e)},g=()=>{const e=t.inject("vkVditorMitter",null);if(!e)throw new Error("useVditorMitter must be used after VditorProvider");return e},w=t.defineComponent({props:{modelValue:{type:String,default:""}},emits:{"update:modelValue":null},setup(e,{emit:o}){const u=v(),s=g();e.modelValue&&u.setValue(e.modelValue,!0);const{pause:n,resume:a}=V.watchPausable(()=>e.modelValue,r=>{u.setValue(r,!0)});return s.on("input",r=>{n(),o("update:modelValue",r),t.nextTick(a)}),()=>null}}),B=t.defineComponent({props:{fullscreen:{type:Boolean,default:!1}},emits:{"update:fullscreen":null},setup(e,{emit:o}){const u=v(),s=u.vditor.element,n=t.ref(!1);return V.useMutationObserver(s,()=>{s.classList.contains("vditor--fullscreen")?n.value=!0:n.value=!1},{attributes:!0}),t.watch(()=>e.fullscreen,a=>{if(a!==n.value){const r=u.vditor.ir?.element;if(!r)return;r.dispatchEvent(new KeyboardEvent("keydown",{key:"'",ctrlKey:!0}))}},{immediate:!0}),t.watch(()=>n.value,a=>{o("update:fullscreen",a)}),()=>null}}),S=t.defineComponent({name:"VkVditor",components:{HandleValue:w,HandleFullscreen:B,VkAsyncTeleport:b.VkAsyncTeleport},props:f,emits:m,setup(e,{emit:o}){const u=t.ref(),s=t.ref(!1),n=y(),a=t.shallowRef(),r=t.ref(!1);return t.provide("vkVditorMitter",n),t.provide("vkVditorRef",a),t.onMounted(()=>{const i=new k(u.value,{...e.defaultOptions,placeholder:e.placeholder,cache:{enable:!0,id:"VkVditorCache",...e.defaultOptions.cache||{}},after(){a.value=i,s.value=!0,o("load",i),e.defaultOptions.after?.()},input(l){n.emit("input",l),e.defaultOptions.input?.(l)},ctrlEnter(l){o("update:modelValue",l),o("ctrlEnter",l)},focus(l){r.value=!0,e.defaultOptions.focus?.(l)},blur(l){r.value=!1,e.defaultOptions.blur?.(l)},toolbar:e.toolbar})}),{vditorNode:u,isTextareaFocus:r,ready:s}}}),T={ref:"vditorNode",class:"vkf-vditor"};function $(e,o,u,s,n,a){const r=t.resolveComponent("VkAsyncTeleport"),i=t.resolveComponent("HandleValue"),l=t.resolveComponent("HandleFullscreen");return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",T,null,512),e.ready?(t.openBlock(),t.createBlock(r,{key:0,to:e.vditorNode},{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["vkf-vditor-footer",{"is-textarea-focus":e.isTextareaFocus}])},[t.renderSlot(e.$slots,"footer")],2)]),_:3},8,["to"])):t.createCommentVNode("",!0),e.ready?(t.openBlock(),t.createBlock(i,{key:1,"model-value":e.modelValue,"onUpdate:modelValue":o[0]||(o[0]=c=>e.$emit("update:modelValue",c))},null,8,["model-value"])):t.createCommentVNode("",!0),e.ready?(t.openBlock(),t.createBlock(l,{key:2,fullscreen:e.fullscreen,"onUpdate:fullscreen":o[1]||(o[1]=c=>e.$emit("update:fullscreen",c))},null,8,["fullscreen"])):t.createCommentVNode("",!0),e.ready?t.renderSlot(e.$slots,"default",{key:3}):t.createCommentVNode("",!0)],64)}const d=_._export_sfc(S,[["render",$]]),M=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));d.install=e=>{e.component(d.name||"VkVditor",d)};exports.VkVditor=d;exports._VkVditorCtx=h;exports.__VkVditor=M;exports.default=d;