@vunk/form 1.1.81 → 1.1.83

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.
@@ -1004,7 +1004,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
1004
1004
  createVNode(_component_ViewerVue, {
1005
1005
  view: _ctx.view,
1006
1006
  "view-component": _ctx.viewComponent,
1007
- viewComponentAttrs: _ctx.viewComponentAttrs
1007
+ "view-component-attrs": _ctx.viewComponentAttrs
1008
1008
  }, {
1009
1009
  default: withCtx(() => [
1010
1010
  createVNode(_component_VaGraphicsLayer, {
@@ -1021,9 +1021,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
1021
1021
  multiple: _ctx.multiple,
1022
1022
  "available-creature-tools": _ctx.availableCreatureTools,
1023
1023
  "model-value": _ctx.sketchValue,
1024
+ "visible-elements": _ctx.visibleElements,
1024
1025
  "onUpdate:modelValue": _ctx.handleUpdateSketchValue,
1025
- onLoad: _ctx.sketchLoad,
1026
- visibleElements: _ctx.visibleElements
1026
+ onLoad: _ctx.sketchLoad
1027
1027
  }, {
1028
1028
  default: withCtx(() => [
1029
1029
  !_ctx.skipSave && _ctx.shetchPanel ? (openBlock(), createBlock(_component_VkAsyncTeleport, {
@@ -1048,7 +1048,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
1048
1048
  ]),
1049
1049
  _: 1
1050
1050
  /* STABLE */
1051
- }, 8, ["view-model-active-fill-symbol", "view-model-active-line-symbol", "view-model-active-point-symbol", "multiple", "available-creature-tools", "model-value", "onUpdate:modelValue", "onLoad", "visibleElements"])) : createCommentVNode("v-if", true)
1051
+ }, 8, ["view-model-active-fill-symbol", "view-model-active-line-symbol", "view-model-active-point-symbol", "multiple", "available-creature-tools", "model-value", "visible-elements", "onUpdate:modelValue", "onLoad"])) : createCommentVNode("v-if", true)
1052
1052
  ]),
1053
1053
  _: 1
1054
1054
  /* STABLE */
@@ -1056,7 +1056,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
1056
1056
  ]),
1057
1057
  _: 1
1058
1058
  /* STABLE */
1059
- }, 8, ["view", "view-component", "viewComponentAttrs"])
1059
+ }, 8, ["view", "view-component", "view-component-attrs"])
1060
1060
  ]),
1061
1061
  _: 1
1062
1062
  /* STABLE */
@@ -0,0 +1,12 @@
1
+ .vkf-vditor ul,li {
2
+ list-style: initial;
3
+ }
4
+ .vkf-vditor ol,li {
5
+ list-style: decimal;
6
+ }
7
+ .vkf-vditor.vditor{
8
+ --textarea-background-color: var(--el-fill-color-extra-light);
9
+ }
10
+ .vkf-vditor-footer.is-textarea-focus{
11
+ background-color: var(--textarea-background-color);
12
+ }
@@ -1,58 +1,435 @@
1
1
  import Vditor from 'vditor';
2
- import { defineComponent, ref, onMounted, provide, openBlock, createElementBlock } from 'vue';
2
+ import { inject, unref, ref, getCurrentScope, onScopeDispose, watch, defineComponent, nextTick, shallowRef, provide, onMounted, resolveComponent, openBlock, createElementBlock, Fragment, createElementVNode, createBlock, withCtx, normalizeClass, renderSlot, createCommentVNode } from 'vue';
3
3
  import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
4
+ import { VkAsyncTeleport } from '@vunk/core';
4
5
 
5
6
  const props = {
6
7
  modelValue: {
7
- type: Object,
8
- default: () => ({})
8
+ type: String,
9
+ default: ""
9
10
  },
10
11
  defaultOptions: {
11
12
  type: Object,
12
13
  default: () => ({})
14
+ },
15
+ placeholder: {
16
+ type: String,
17
+ default: "\u95EE\u6211\u4EFB\u4F55\u95EE\u9898...(Crtl + Enter \u53D1\u9001)"
18
+ },
19
+ toolbar: {
20
+ type: Array,
21
+ default: () => [
22
+ "headings",
23
+ "bold",
24
+ "italic",
25
+ "strike",
26
+ "link",
27
+ "|",
28
+ "list",
29
+ "ordered-list",
30
+ "outdent",
31
+ "indent",
32
+ "|",
33
+ "line",
34
+ "code",
35
+ "inline-code",
36
+ "insert-before",
37
+ "insert-after",
38
+ "|",
39
+ "table",
40
+ "|",
41
+ "undo",
42
+ "redo",
43
+ "|",
44
+ "fullscreen",
45
+ "outline",
46
+ "export",
47
+ "|"
48
+ ]
49
+ },
50
+ fullscreen: {
51
+ type: Boolean,
52
+ default: false
13
53
  }
14
54
  };
15
55
  const emits = {
16
- load: (e) => e
56
+ load: (e) => e,
57
+ "update:modelValue": (e) => e,
58
+ ctrlEnter: (e) => e,
59
+ "update:fullscreen": (e) => e
60
+ };
61
+
62
+ function mitt(n){return {all:n=n||new Map,on:function(t,e){var i=n.get(t);i?i.push(e):n.set(t,[e]);},off:function(t,e){var i=n.get(t);i&&(e?i.splice(i.indexOf(e)>>>0,1):n.set(t,[]));},emit:function(t,e){var i=n.get(t);i&&i.slice().map(function(n){n(e);}),(i=n.get("*"))&&i.slice().map(function(n){n(t,e);});}}}
63
+
64
+ const useVditor = () => {
65
+ const core = inject("vkfVditorRef", null);
66
+ if (!core) {
67
+ throw new Error("useVditor must be used after VditorProvider");
68
+ }
69
+ return unref(core);
70
+ };
71
+ const useVditorMitter = () => {
72
+ const core = inject("vkfVditorMitter", null);
73
+ if (!core) {
74
+ throw new Error("useVditorMitter must be used after VditorProvider");
75
+ }
76
+ return core;
77
+ };
78
+
79
+ var _a;
80
+ const isClient = typeof window !== "undefined";
81
+ isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
82
+
83
+ function createFilterWrapper(filter, fn) {
84
+ function wrapper(...args) {
85
+ filter(() => fn.apply(this, args), { fn, thisArg: this, args });
86
+ }
87
+ return wrapper;
88
+ }
89
+ const bypassFilter = (invoke) => {
90
+ return invoke();
91
+ };
92
+ function pausableFilter(extendFilter = bypassFilter) {
93
+ const isActive = ref(true);
94
+ function pause() {
95
+ isActive.value = false;
96
+ }
97
+ function resume() {
98
+ isActive.value = true;
99
+ }
100
+ const eventFilter = (...args) => {
101
+ if (isActive.value)
102
+ extendFilter(...args);
103
+ };
104
+ return { isActive, pause, resume, eventFilter };
105
+ }
106
+
107
+ function tryOnScopeDispose(fn) {
108
+ if (getCurrentScope()) {
109
+ onScopeDispose(fn);
110
+ return true;
111
+ }
112
+ return false;
113
+ }
114
+
115
+ var __getOwnPropSymbols$6$1 = Object.getOwnPropertySymbols;
116
+ var __hasOwnProp$6$1 = Object.prototype.hasOwnProperty;
117
+ var __propIsEnum$6$1 = Object.prototype.propertyIsEnumerable;
118
+ var __objRest$5 = (source, exclude) => {
119
+ var target = {};
120
+ for (var prop in source)
121
+ if (__hasOwnProp$6$1.call(source, prop) && exclude.indexOf(prop) < 0)
122
+ target[prop] = source[prop];
123
+ if (source != null && __getOwnPropSymbols$6$1)
124
+ for (var prop of __getOwnPropSymbols$6$1(source)) {
125
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$6$1.call(source, prop))
126
+ target[prop] = source[prop];
127
+ }
128
+ return target;
129
+ };
130
+ function watchWithFilter(source, cb, options = {}) {
131
+ const _a = options, {
132
+ eventFilter = bypassFilter
133
+ } = _a, watchOptions = __objRest$5(_a, [
134
+ "eventFilter"
135
+ ]);
136
+ return watch(source, createFilterWrapper(eventFilter, cb), watchOptions);
137
+ }
138
+
139
+ var __defProp$2 = Object.defineProperty;
140
+ var __defProps$2 = Object.defineProperties;
141
+ var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
142
+ var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
143
+ var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
144
+ var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
145
+ var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
146
+ var __spreadValues$2 = (a, b) => {
147
+ for (var prop in b || (b = {}))
148
+ if (__hasOwnProp$2.call(b, prop))
149
+ __defNormalProp$2(a, prop, b[prop]);
150
+ if (__getOwnPropSymbols$2)
151
+ for (var prop of __getOwnPropSymbols$2(b)) {
152
+ if (__propIsEnum$2.call(b, prop))
153
+ __defNormalProp$2(a, prop, b[prop]);
154
+ }
155
+ return a;
156
+ };
157
+ var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
158
+ var __objRest$1$1 = (source, exclude) => {
159
+ var target = {};
160
+ for (var prop in source)
161
+ if (__hasOwnProp$2.call(source, prop) && exclude.indexOf(prop) < 0)
162
+ target[prop] = source[prop];
163
+ if (source != null && __getOwnPropSymbols$2)
164
+ for (var prop of __getOwnPropSymbols$2(source)) {
165
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$2.call(source, prop))
166
+ target[prop] = source[prop];
167
+ }
168
+ return target;
169
+ };
170
+ function watchPausable(source, cb, options = {}) {
171
+ const _a = options, {
172
+ eventFilter: filter
173
+ } = _a, watchOptions = __objRest$1$1(_a, [
174
+ "eventFilter"
175
+ ]);
176
+ const { eventFilter, pause, resume, isActive } = pausableFilter(filter);
177
+ const stop = watchWithFilter(source, cb, __spreadProps$2(__spreadValues$2({}, watchOptions), {
178
+ eventFilter
179
+ }));
180
+ return { stop, pause, resume, isActive };
181
+ }
182
+
183
+ function unrefElement(elRef) {
184
+ var _a;
185
+ const plain = unref(elRef);
186
+ return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
187
+ }
188
+
189
+ const defaultWindow = isClient ? window : void 0;
190
+
191
+ const _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
192
+ const globalKey = "__vueuse_ssr_handlers__";
193
+ _global[globalKey] = _global[globalKey] || {};
194
+
195
+ var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
196
+ var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
197
+ var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
198
+ var __objRest$1 = (source, exclude) => {
199
+ var target = {};
200
+ for (var prop in source)
201
+ if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
202
+ target[prop] = source[prop];
203
+ if (source != null && __getOwnPropSymbols$6)
204
+ for (var prop of __getOwnPropSymbols$6(source)) {
205
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
206
+ target[prop] = source[prop];
207
+ }
208
+ return target;
17
209
  };
210
+ function useMutationObserver(target, callback, options = {}) {
211
+ const _a = options, { window = defaultWindow } = _a, mutationOptions = __objRest$1(_a, ["window"]);
212
+ let observer;
213
+ const isSupported = window && "MutationObserver" in window;
214
+ const cleanup = () => {
215
+ if (observer) {
216
+ observer.disconnect();
217
+ observer = void 0;
218
+ }
219
+ };
220
+ const stopWatch = watch(() => unrefElement(target), (el) => {
221
+ cleanup();
222
+ if (isSupported && window && el) {
223
+ observer = new MutationObserver(callback);
224
+ observer.observe(el, mutationOptions);
225
+ }
226
+ }, { immediate: true });
227
+ const stop = () => {
228
+ cleanup();
229
+ stopWatch();
230
+ };
231
+ tryOnScopeDispose(stop);
232
+ return {
233
+ isSupported,
234
+ stop
235
+ };
236
+ }
237
+
238
+ var SwipeDirection;
239
+ (function(SwipeDirection2) {
240
+ SwipeDirection2["UP"] = "UP";
241
+ SwipeDirection2["RIGHT"] = "RIGHT";
242
+ SwipeDirection2["DOWN"] = "DOWN";
243
+ SwipeDirection2["LEFT"] = "LEFT";
244
+ SwipeDirection2["NONE"] = "NONE";
245
+ })(SwipeDirection || (SwipeDirection = {}));
246
+
247
+ var _sfc_main$2 = defineComponent({
248
+ props: {
249
+ modelValue: {
250
+ type: String,
251
+ default: ""
252
+ }
253
+ },
254
+ emits: {
255
+ "update:modelValue": null
256
+ },
257
+ setup(props, { emit }) {
258
+ const vditor = useVditor();
259
+ const mitter = useVditorMitter();
260
+ if (props.modelValue) {
261
+ vditor.setValue(props.modelValue, true);
262
+ }
263
+ const { pause, resume } = watchPausable(() => props.modelValue, (value) => {
264
+ vditor.setValue(value, true);
265
+ });
266
+ mitter.on("input", (value) => {
267
+ pause();
268
+ emit("update:modelValue", value);
269
+ nextTick(resume);
270
+ });
271
+ return () => null;
272
+ }
273
+ });
274
+
275
+ var HandleValue = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/vditor/src/handle-value.vue"]]);
276
+
277
+ var _sfc_main$1 = defineComponent({
278
+ props: {
279
+ fullscreen: {
280
+ type: Boolean,
281
+ default: false
282
+ }
283
+ },
284
+ emits: {
285
+ "update:fullscreen": null
286
+ },
287
+ setup(props, { emit }) {
288
+ const vditor = useVditor();
289
+ const el = vditor.vditor.element;
290
+ const domFullscreen = ref(false);
291
+ useMutationObserver(el, () => {
292
+ if (el.classList.contains("vditor--fullscreen")) {
293
+ domFullscreen.value = true;
294
+ } else {
295
+ domFullscreen.value = false;
296
+ }
297
+ }, {
298
+ attributes: true
299
+ });
300
+ watch(() => props.fullscreen, (value) => {
301
+ if (value !== domFullscreen.value) {
302
+ const ir = vditor.vditor.ir?.element;
303
+ if (!ir) return;
304
+ ir.dispatchEvent(new KeyboardEvent("keydown", {
305
+ key: "'",
306
+ ctrlKey: true
307
+ }));
308
+ }
309
+ }, { immediate: true });
310
+ watch(() => domFullscreen.value, (value) => {
311
+ emit("update:fullscreen", value);
312
+ });
313
+ return () => null;
314
+ }
315
+ });
316
+
317
+ var HandleFullscreen = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/vditor/src/handle-fullscreen.vue"]]);
18
318
 
19
319
  var _sfc_main = defineComponent({
20
320
  name: "VkfVditor",
21
- emits,
321
+ components: {
322
+ HandleValue,
323
+ HandleFullscreen,
324
+ VkAsyncTeleport
325
+ },
22
326
  props,
327
+ emits,
23
328
  setup(props2, { emit }) {
24
329
  const vditorNode = ref();
25
330
  const ready = ref(false);
331
+ const mitter = mitt();
332
+ const vditorRef = shallowRef();
333
+ const isTextareaFocus = ref(false);
334
+ provide("vkfVditorMitter", mitter);
335
+ provide("vkfVditorRef", vditorRef);
26
336
  onMounted(() => {
27
337
  const vditor = new Vditor(vditorNode.value, {
28
338
  ...props2.defaultOptions,
339
+ placeholder: props2.placeholder,
29
340
  cache: {
30
341
  enable: true,
31
342
  id: "VkfVditorCache",
32
343
  ...props2.defaultOptions.cache || {}
33
344
  },
34
345
  after() {
346
+ vditorRef.value = vditor;
35
347
  ready.value = true;
36
348
  emit("load", vditor);
37
- provide("vkfVditor", vditor);
38
349
  props2.defaultOptions.after?.();
39
- }
350
+ },
351
+ input(value) {
352
+ mitter.emit("input", value);
353
+ props2.defaultOptions.input?.(value);
354
+ },
355
+ ctrlEnter(value) {
356
+ emit("update:modelValue", value);
357
+ emit("ctrlEnter", value);
358
+ },
359
+ focus(v) {
360
+ isTextareaFocus.value = true;
361
+ props2.defaultOptions.focus?.(v);
362
+ },
363
+ blur(v) {
364
+ isTextareaFocus.value = false;
365
+ props2.defaultOptions.blur?.(v);
366
+ },
367
+ toolbar: props2.toolbar
40
368
  });
41
369
  });
42
370
  return {
43
- vditorNode
371
+ vditorNode,
372
+ isTextareaFocus,
373
+ ready
44
374
  };
45
375
  }
46
376
  });
47
377
 
48
- const _hoisted_1 = { ref: "vditorNode" };
378
+ const _hoisted_1 = {
379
+ ref: "vditorNode",
380
+ class: "vkf-vditor"
381
+ };
49
382
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
383
+ const _component_VkAsyncTeleport = resolveComponent("VkAsyncTeleport");
384
+ const _component_HandleValue = resolveComponent("HandleValue");
385
+ const _component_HandleFullscreen = resolveComponent("HandleFullscreen");
50
386
  return openBlock(), createElementBlock(
51
- "div",
52
- _hoisted_1,
387
+ Fragment,
53
388
  null,
54
- 512
55
- /* NEED_PATCH */
389
+ [
390
+ createElementVNode(
391
+ "div",
392
+ _hoisted_1,
393
+ null,
394
+ 512
395
+ /* NEED_PATCH */
396
+ ),
397
+ _ctx.ready ? (openBlock(), createBlock(_component_VkAsyncTeleport, {
398
+ key: 0,
399
+ to: _ctx.vditorNode
400
+ }, {
401
+ default: withCtx(() => [
402
+ createElementVNode(
403
+ "div",
404
+ {
405
+ class: normalizeClass(["vkf-vditor-footer", {
406
+ "is-textarea-focus": _ctx.isTextareaFocus
407
+ }])
408
+ },
409
+ [
410
+ renderSlot(_ctx.$slots, "footer")
411
+ ],
412
+ 2
413
+ /* CLASS */
414
+ )
415
+ ]),
416
+ _: 3
417
+ /* FORWARDED */
418
+ }, 8, ["to"])) : createCommentVNode("v-if", true),
419
+ _ctx.ready ? (openBlock(), createBlock(_component_HandleValue, {
420
+ key: 1,
421
+ "model-value": _ctx.modelValue,
422
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", $event))
423
+ }, null, 8, ["model-value"])) : createCommentVNode("v-if", true),
424
+ _ctx.ready ? (openBlock(), createBlock(_component_HandleFullscreen, {
425
+ key: 2,
426
+ fullscreen: _ctx.fullscreen,
427
+ "onUpdate:fullscreen": _cache[1] || (_cache[1] = ($event) => _ctx.$emit("update:fullscreen", $event))
428
+ }, null, 8, ["fullscreen"])) : createCommentVNode("v-if", true),
429
+ _ctx.ready ? renderSlot(_ctx.$slots, "default", { key: 3 }) : createCommentVNode("v-if", true)
430
+ ],
431
+ 64
432
+ /* STABLE_FRAGMENT */
56
433
  );
57
434
  }
58
435
  var VkfVditor = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/vditor/src/index.vue"]]);
@@ -62,7 +439,7 @@ var types = /*#__PURE__*/Object.freeze({
62
439
  });
63
440
 
64
441
  VkfVditor.install = (app) => {
65
- app.component(VkfVditor.name, VkfVditor);
442
+ app.component(VkfVditor.name || "VkfVditor", VkfVditor);
66
443
  };
67
444
 
68
445
  export { VkfVditor, types as __VkfVditor, VkfVditor as default };
@@ -3,14 +3,29 @@ import { DefaultOptions } from './types';
3
3
  import Vditor from 'vditor';
4
4
  export declare const props: {
5
5
  modelValue: {
6
- type: PropType<unknown>;
7
- default: () => {};
6
+ type: StringConstructor;
7
+ default: string;
8
8
  };
9
9
  defaultOptions: {
10
10
  type: PropType<DefaultOptions>;
11
11
  default: () => IOptions;
12
12
  };
13
+ placeholder: {
14
+ type: StringConstructor;
15
+ default: string;
16
+ };
17
+ toolbar: {
18
+ type: PropType<string[]>;
19
+ default: () => string[];
20
+ };
21
+ fullscreen: {
22
+ type: BooleanConstructor;
23
+ default: boolean;
24
+ };
13
25
  };
14
26
  export declare const emits: {
15
27
  load: (e: Vditor) => Vditor;
28
+ 'update:modelValue': (e: string) => string;
29
+ ctrlEnter: (e: string) => string;
30
+ 'update:fullscreen': (e: boolean) => boolean;
16
31
  };
@@ -0,0 +1,18 @@
1
+ declare const _default: import("vue").DefineComponent<{
2
+ fullscreen: {
3
+ type: BooleanConstructor;
4
+ default: boolean;
5
+ };
6
+ }, () => any, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
+ 'update:fullscreen': any;
8
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
9
+ fullscreen: {
10
+ type: BooleanConstructor;
11
+ default: boolean;
12
+ };
13
+ }>> & {
14
+ "onUpdate:fullscreen"?: (...args: any[] | unknown[]) => any;
15
+ }, {
16
+ fullscreen: boolean;
17
+ }, {}>;
18
+ export default _default;
@@ -0,0 +1,18 @@
1
+ declare const _default: import("vue").DefineComponent<{
2
+ modelValue: {
3
+ type: StringConstructor;
4
+ default: string;
5
+ };
6
+ }, () => any, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
+ 'update:modelValue': any;
8
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
9
+ modelValue: {
10
+ type: StringConstructor;
11
+ default: string;
12
+ };
13
+ }>> & {
14
+ "onUpdate:modelValue"?: (...args: any[] | unknown[]) => any;
15
+ }, {
16
+ modelValue: string;
17
+ }, {}>;
18
+ export default _default;
@@ -2,30 +2,65 @@ import Vditor from 'vditor';
2
2
  import { Ref } from 'vue';
3
3
  declare const _default: import("vue").DefineComponent<{
4
4
  modelValue: {
5
- type: import("vue").PropType<unknown>;
6
- default: () => {};
5
+ type: StringConstructor;
6
+ default: string;
7
7
  };
8
8
  defaultOptions: {
9
9
  type: import("vue").PropType<import("./types").DefaultOptions>;
10
10
  default: () => IOptions;
11
11
  };
12
+ placeholder: {
13
+ type: StringConstructor;
14
+ default: string;
15
+ };
16
+ toolbar: {
17
+ type: import("vue").PropType<string[]>;
18
+ default: () => string[];
19
+ };
20
+ fullscreen: {
21
+ type: BooleanConstructor;
22
+ default: boolean;
23
+ };
12
24
  }, {
13
25
  vditorNode: Ref<HTMLDivElement>;
26
+ isTextareaFocus: Ref<boolean>;
27
+ ready: Ref<boolean>;
14
28
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
15
29
  load: (e: Vditor) => Vditor;
30
+ 'update:modelValue': (e: string) => string;
31
+ ctrlEnter: (e: string) => string;
32
+ 'update:fullscreen': (e: boolean) => boolean;
16
33
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
17
34
  modelValue: {
18
- type: import("vue").PropType<unknown>;
19
- default: () => {};
35
+ type: StringConstructor;
36
+ default: string;
20
37
  };
21
38
  defaultOptions: {
22
39
  type: import("vue").PropType<import("./types").DefaultOptions>;
23
40
  default: () => IOptions;
24
41
  };
42
+ placeholder: {
43
+ type: StringConstructor;
44
+ default: string;
45
+ };
46
+ toolbar: {
47
+ type: import("vue").PropType<string[]>;
48
+ default: () => string[];
49
+ };
50
+ fullscreen: {
51
+ type: BooleanConstructor;
52
+ default: boolean;
53
+ };
25
54
  }>> & {
55
+ "onUpdate:modelValue"?: (e: string) => any;
26
56
  onLoad?: (e: Vditor) => any;
57
+ "onUpdate:fullscreen"?: (e: boolean) => any;
58
+ onCtrlEnter?: (e: string) => any;
27
59
  }, {
28
- modelValue: {};
60
+ placeholder: string;
61
+ modelValue: string;
29
62
  defaultOptions: IOptions;
63
+ fullscreen: boolean;
64
+ toolbar: string[];
30
65
  }, {}>;
31
66
  export default _default;
@@ -1,4 +1,9 @@
1
1
  import { NonVoidable } from '@vunk/core';
2
2
  import Vditor from 'vditor';
3
+ import { Emitter } from 'mitt';
3
4
  export type DefaultOptions = NonVoidable<ConstructorParameters<typeof Vditor>[1]>;
5
+ export type Toolbar = DefaultOptions['toolbar'];
6
+ export type Mitter = Emitter<{
7
+ input: string;
8
+ }>;
4
9
  export {};
@@ -0,0 +1,4 @@
1
+ import Vditor from 'vditor';
2
+ import { Mitter } from './types';
3
+ export declare const useVditor: () => Vditor;
4
+ export declare const useVditorMitter: () => Mitter;
package/index.css CHANGED
@@ -439,3 +439,16 @@
439
439
  padding-left: var(--date-picker-title-padding);
440
440
  padding-right: var(--date-picker-title-padding);
441
441
  }
442
+
443
+ .vkf-vditor ul,li {
444
+ list-style: initial;
445
+ }
446
+ .vkf-vditor ol,li {
447
+ list-style: decimal;
448
+ }
449
+ .vkf-vditor.vditor{
450
+ --textarea-background-color: var(--el-fill-color-extra-light);
451
+ }
452
+ .vkf-vditor-footer.is-textarea-focus{
453
+ background-color: var(--textarea-background-color);
454
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vunk/form",
3
- "version": "1.1.81",
3
+ "version": "1.1.83",
4
4
  "description": "",
5
5
  "main": "index.esm.js",
6
6
  "scripts": {
@@ -213,6 +213,9 @@
213
213
  "./index.css": {
214
214
  "import": "./index.css"
215
215
  },
216
+ "./components/vditor/index.css": {
217
+ "import": "./components/vditor/index.css"
218
+ },
216
219
  "./components/var-datetime-picker/index.css": {
217
220
  "import": "./components/var-datetime-picker/index.css"
218
221
  },