@vueup/vue-quill 1.1.0 → 1.2.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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * VueQuill @vueup/vue-quill v1.1.0
2
+ * VueQuill @vueup/vue-quill v1.2.0
3
3
  * https://vueup.github.io/vue-quill/
4
4
  *
5
5
  * Includes quill v1.3.7
@@ -7,20 +7,20 @@
7
7
  *
8
8
  * Copyright (c) 2023 Ahmad Luthfi Masruri
9
9
  * Released under the MIT license
10
- * Date: 2023-02-04T04:01:16.430Z
10
+ * Date: 2023-05-12T08:44:03.742Z
11
11
  */
12
12
  'use strict';
13
13
 
14
14
  Object.defineProperty(exports, '__esModule', { value: true });
15
15
 
16
16
  var Quill = require('quill');
17
- var quillDelta = require('quill-delta');
17
+ var Delta = require('quill-delta');
18
18
  var vue = require('vue');
19
19
 
20
20
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e["default"] : e; }
21
21
 
22
22
  var Quill__default = /*#__PURE__*/_interopDefaultLegacy(Quill);
23
- var quillDelta__default = /*#__PURE__*/_interopDefaultLegacy(quillDelta);
23
+ var Delta__default = /*#__PURE__*/_interopDefaultLegacy(Delta);
24
24
 
25
25
  const toolbarOptions = {
26
26
  essential: [
@@ -59,7 +59,6 @@ const QuillEditor = vue.defineComponent({
59
59
  props: {
60
60
  content: {
61
61
  type: [String, Object],
62
- default: () => { },
63
62
  },
64
63
  contentType: {
65
64
  type: String,
@@ -213,7 +212,7 @@ const QuillEditor = vue.defineComponent({
213
212
  return Object.assign({}, props.globalOptions, props.options, clientOptions);
214
213
  };
215
214
  const maybeClone = (delta) => {
216
- return typeof delta === 'object' ? delta.slice() : delta;
215
+ return typeof delta === 'object' && delta ? delta.slice() : delta;
217
216
  };
218
217
  const deltaHasValuesOtherThanRetain = (delta) => {
219
218
  return Object.values(delta.ops).some((v) => !v.retain || Object.keys(v).length !== 1);
@@ -226,7 +225,10 @@ const QuillEditor = vue.defineComponent({
226
225
  return true;
227
226
  }
228
227
  // Ref/Proxy does not support instanceof, so do a loose check
229
- if (typeof against === 'object' && typeof internalModel === 'object') {
228
+ if (typeof against === 'object' &&
229
+ against &&
230
+ typeof internalModel === 'object' &&
231
+ internalModel) {
230
232
  return !deltaHasValuesOtherThanRetain(internalModel.diff(against));
231
233
  }
232
234
  }
@@ -279,7 +281,7 @@ const QuillEditor = vue.defineComponent({
279
281
  if (quill)
280
282
  return quill;
281
283
  else
282
- throw `The quill editor hasn't been instantiated yet,
284
+ throw `The quill editor hasn't been instantiated yet,
283
285
  make sure to call this method when the editor ready
284
286
  or use v-on:ready="onReady(quill)" event instead.`;
285
287
  };
@@ -293,16 +295,21 @@ const QuillEditor = vue.defineComponent({
293
295
  return quill === null || quill === void 0 ? void 0 : quill.getContents(index, length);
294
296
  };
295
297
  const setContents = (content, source = 'api') => {
298
+ const normalizedContent = !content
299
+ ? props.contentType === 'delta'
300
+ ? new Delta__default()
301
+ : ''
302
+ : content;
296
303
  if (props.contentType === 'html') {
297
- setHTML(content);
304
+ setHTML(normalizedContent);
298
305
  }
299
306
  else if (props.contentType === 'text') {
300
- setText(content, source);
307
+ setText(normalizedContent, source);
301
308
  }
302
309
  else {
303
- quill === null || quill === void 0 ? void 0 : quill.setContents(content, source);
310
+ quill === null || quill === void 0 ? void 0 : quill.setContents(normalizedContent, source);
304
311
  }
305
- internalModel = maybeClone(content);
312
+ internalModel = maybeClone(normalizedContent);
306
313
  };
307
314
  const getText = (index, length) => {
308
315
  var _a;
@@ -324,6 +331,9 @@ const QuillEditor = vue.defineComponent({
324
331
  if (delta)
325
332
  quill === null || quill === void 0 ? void 0 : quill.setContents(delta, source);
326
333
  };
334
+ const focus = () => {
335
+ quill === null || quill === void 0 ? void 0 : quill.focus();
336
+ };
327
337
  const reinit = () => {
328
338
  vue.nextTick(() => {
329
339
  var _a;
@@ -356,6 +366,7 @@ const QuillEditor = vue.defineComponent({
356
366
  getHTML,
357
367
  setHTML,
358
368
  pasteHTML,
369
+ focus,
359
370
  getText,
360
371
  setText,
361
372
  reinit,
@@ -371,5 +382,5 @@ const QuillEditor = vue.defineComponent({
371
382
  });
372
383
 
373
384
  exports.Quill = Quill__default;
374
- exports.Delta = quillDelta__default;
385
+ exports.Delta = Delta__default;
375
386
  exports.QuillEditor = QuillEditor;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * VueQuill @vueup/vue-quill v1.1.0
2
+ * VueQuill @vueup/vue-quill v1.2.0
3
3
  * https://vueup.github.io/vue-quill/
4
4
  *
5
5
  * Includes quill v1.3.7
@@ -7,6 +7,6 @@
7
7
  *
8
8
  * Copyright (c) 2023 Ahmad Luthfi Masruri
9
9
  * Released under the MIT license
10
- * Date: 2023-02-04T04:01:16.430Z
10
+ * Date: 2023-05-12T08:44:03.742Z
11
11
  */
12
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("quill"),t=require("quill-delta"),o=require("vue");function l(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var n=l(e),r=l(t);const i={essential:[[{header:[1,2,3,4,5,6,!1]}],["bold","italic","underline"],[{list:"ordered"},{list:"bullet"},{align:[]}],["blockquote","code-block","link"],[{color:[]},"clean"]],minimal:[[{header:1},{header:2}],["bold","italic","underline"],[{list:"ordered"},{list:"bullet"},{align:[]}]],full:[["bold","italic","underline","strike"],["blockquote","code-block"],[{header:1},{header:2}],[{list:"ordered"},{list:"bullet"}],[{script:"sub"},{script:"super"}],[{indent:"-1"},{indent:"+1"}],[{direction:"rtl"}],[{size:["small",!1,"large","huge"]}],[{header:[1,2,3,4,5,6,!1]}],[{color:[]},{background:[]}],[{font:[]}],[{align:[]}],["link","video","image"],["clean"]]},a=o.defineComponent({name:"QuillEditor",inheritAttrs:!1,props:{content:{type:[String,Object],default:()=>{}},contentType:{type:String,default:"delta",validator:e=>["delta","html","text"].includes(e)},enable:{type:Boolean,default:!0},readOnly:{type:Boolean,default:!1},placeholder:{type:String,required:!1},theme:{type:String,default:"snow",validator:e=>["snow","bubble",""].includes(e)},toolbar:{type:[String,Array,Object],required:!1,validator:e=>"string"!=typeof e||""===e||("#"===e.charAt(0)||-1!==Object.keys(i).indexOf(e))},modules:{type:Object,required:!1},options:{type:Object,required:!1},globalOptions:{type:Object,required:!1}},emits:["textChange","selectionChange","editorChange","update:content","focus","blur","ready"],setup:(e,t)=>{let l,r;o.onMounted((()=>{d()})),o.onBeforeUnmount((()=>{l=null}));const a=o.ref(),d=()=>{var o;if(a.value){if(r=s(),e.modules)if(Array.isArray(e.modules))for(const t of e.modules)n.register(`modules/${t.name}`,t.module);else n.register(`modules/${e.modules.name}`,e.modules.module);l=new n(a.value,r),f(e.content),l.on("text-change",p),l.on("selection-change",h),l.on("editor-change",g),"bubble"!==e.theme&&a.value.classList.remove("ql-bubble"),"snow"!==e.theme&&a.value.classList.remove("ql-snow"),null===(o=l.getModule("toolbar"))||void 0===o||o.container.addEventListener("mousedown",(e=>{e.preventDefault()})),t.emit("ready",l)}},s=()=>{const t={};if(""!==e.theme&&(t.theme=e.theme),e.readOnly&&(t.readOnly=e.readOnly),e.placeholder&&(t.placeholder=e.placeholder),e.toolbar&&""!==e.toolbar&&(t.modules={toolbar:(()=>{if("object"==typeof e.toolbar)return e.toolbar;if("string"==typeof e.toolbar){return"#"===e.toolbar.charAt(0)?e.toolbar:i[e.toolbar]}})()}),e.modules){const o=(()=>{var t,o;const l={};if(Array.isArray(e.modules))for(const n of e.modules)l[n.name]=null!==(t=n.options)&&void 0!==t?t:{};else l[e.modules.name]=null!==(o=e.modules.options)&&void 0!==o?o:{};return l})();t.modules=Object.assign({},t.modules,o)}return Object.assign({},e.globalOptions,e.options,t)},u=e=>"object"==typeof e?e.slice():e;let c;const b=e=>{if(typeof c==typeof e){if(e===c)return!0;if("object"==typeof e&&"object"==typeof c)return t=c.diff(e),!Object.values(t.ops).some((e=>!e.retain||1!==Object.keys(e).length))}var t;return!1},p=(o,l,n)=>{c=u(v()),b(e.content)||t.emit("update:content",c),t.emit("textChange",{delta:o,oldContents:l,source:n})},m=o.ref(),h=(e,o,n)=>{m.value=!!(null==l?void 0:l.hasFocus()),t.emit("selectionChange",{range:e,oldRange:o,source:n})};o.watch(m,(e=>{t.emit(e?"focus":"blur",a)}));const g=(...e)=>{"text-change"===e[0]&&t.emit("editorChange",{name:e[0],delta:e[1],oldContents:e[2],source:e[3]}),"selection-change"===e[0]&&t.emit("editorChange",{name:e[0],range:e[1],oldRange:e[2],source:e[3]})},v=(t,o)=>"html"===e.contentType?O():"text"===e.contentType?y(t,o):null==l?void 0:l.getContents(t,o),f=(t,o="api")=>{"html"===e.contentType?T(t):"text"===e.contentType?x(t,o):null==l||l.setContents(t,o),c=u(t)},y=(e,t)=>{var o;return null!==(o=null==l?void 0:l.getText(e,t))&&void 0!==o?o:""},x=(e,t="api")=>{null==l||l.setText(e,t)},O=()=>{var e;return null!==(e=null==l?void 0:l.root.innerHTML)&&void 0!==e?e:""},T=e=>{l&&(l.root.innerHTML=e)};return o.watch((()=>e.content),(e=>{if(!l||!e||b(e))return;const t=l.getSelection();t&&o.nextTick((()=>null==l?void 0:l.setSelection(t))),f(e)}),{deep:!0}),o.watch((()=>e.enable),(e=>{l&&l.enable(e)})),{editor:a,getEditor:()=>a.value,getToolbar:()=>{var e;return null===(e=null==l?void 0:l.getModule("toolbar"))||void 0===e?void 0:e.container},getQuill:()=>{if(l)return l;throw'The quill editor hasn\'t been instantiated yet, \n make sure to call this method when the editor ready\n or use v-on:ready="onReady(quill)" event instead.'},getContents:v,setContents:f,getHTML:O,setHTML:T,pasteHTML:(e,t="api")=>{const o=null==l?void 0:l.clipboard.convert(e);o&&(null==l||l.setContents(o,t))},getText:y,setText:x,reinit:()=>{o.nextTick((()=>{var e;!t.slots.toolbar&&l&&(null===(e=l.getModule("toolbar"))||void 0===e||e.container.remove()),d()}))}}},render(){var e,t;return[null===(t=(e=this.$slots).toolbar)||void 0===t?void 0:t.call(e),o.h("div",{ref:"editor",...this.$attrs})]}});exports.Quill=n,exports.Delta=r,exports.QuillEditor=a;
12
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("quill"),t=require("quill-delta"),o=require("vue");function l(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var n=l(e),r=l(t);const i={essential:[[{header:[1,2,3,4,5,6,!1]}],["bold","italic","underline"],[{list:"ordered"},{list:"bullet"},{align:[]}],["blockquote","code-block","link"],[{color:[]},"clean"]],minimal:[[{header:1},{header:2}],["bold","italic","underline"],[{list:"ordered"},{list:"bullet"},{align:[]}]],full:[["bold","italic","underline","strike"],["blockquote","code-block"],[{header:1},{header:2}],[{list:"ordered"},{list:"bullet"}],[{script:"sub"},{script:"super"}],[{indent:"-1"},{indent:"+1"}],[{direction:"rtl"}],[{size:["small",!1,"large","huge"]}],[{header:[1,2,3,4,5,6,!1]}],[{color:[]},{background:[]}],[{font:[]}],[{align:[]}],["link","video","image"],["clean"]]},a=o.defineComponent({name:"QuillEditor",inheritAttrs:!1,props:{content:{type:[String,Object]},contentType:{type:String,default:"delta",validator:e=>["delta","html","text"].includes(e)},enable:{type:Boolean,default:!0},readOnly:{type:Boolean,default:!1},placeholder:{type:String,required:!1},theme:{type:String,default:"snow",validator:e=>["snow","bubble",""].includes(e)},toolbar:{type:[String,Array,Object],required:!1,validator:e=>"string"!=typeof e||""===e||("#"===e.charAt(0)||-1!==Object.keys(i).indexOf(e))},modules:{type:Object,required:!1},options:{type:Object,required:!1},globalOptions:{type:Object,required:!1}},emits:["textChange","selectionChange","editorChange","update:content","focus","blur","ready"],setup:(e,t)=>{let l,a;o.onMounted((()=>{d()})),o.onBeforeUnmount((()=>{l=null}));const s=o.ref(),d=()=>{var o;if(s.value){if(a=u(),e.modules)if(Array.isArray(e.modules))for(const t of e.modules)n.register(`modules/${t.name}`,t.module);else n.register(`modules/${e.modules.name}`,e.modules.module);l=new n(s.value,a),y(e.content),l.on("text-change",m),l.on("selection-change",g),l.on("editor-change",v),"bubble"!==e.theme&&s.value.classList.remove("ql-bubble"),"snow"!==e.theme&&s.value.classList.remove("ql-snow"),null===(o=l.getModule("toolbar"))||void 0===o||o.container.addEventListener("mousedown",(e=>{e.preventDefault()})),t.emit("ready",l)}},u=()=>{const t={};if(""!==e.theme&&(t.theme=e.theme),e.readOnly&&(t.readOnly=e.readOnly),e.placeholder&&(t.placeholder=e.placeholder),e.toolbar&&""!==e.toolbar&&(t.modules={toolbar:(()=>{if("object"==typeof e.toolbar)return e.toolbar;if("string"==typeof e.toolbar){return"#"===e.toolbar.charAt(0)?e.toolbar:i[e.toolbar]}})()}),e.modules){const o=(()=>{var t,o;const l={};if(Array.isArray(e.modules))for(const n of e.modules)l[n.name]=null!==(t=n.options)&&void 0!==t?t:{};else l[e.modules.name]=null!==(o=e.modules.options)&&void 0!==o?o:{};return l})();t.modules=Object.assign({},t.modules,o)}return Object.assign({},e.globalOptions,e.options,t)},c=e=>"object"==typeof e&&e?e.slice():e;let b;const p=e=>{if(typeof b==typeof e){if(e===b)return!0;if("object"==typeof e&&e&&"object"==typeof b&&b)return t=b.diff(e),!Object.values(t.ops).some((e=>!e.retain||1!==Object.keys(e).length))}var t;return!1},m=(o,l,n)=>{b=c(f()),p(e.content)||t.emit("update:content",b),t.emit("textChange",{delta:o,oldContents:l,source:n})},h=o.ref(),g=(e,o,n)=>{h.value=!!(null==l?void 0:l.hasFocus()),t.emit("selectionChange",{range:e,oldRange:o,source:n})};o.watch(h,(e=>{t.emit(e?"focus":"blur",s)}));const v=(...e)=>{"text-change"===e[0]&&t.emit("editorChange",{name:e[0],delta:e[1],oldContents:e[2],source:e[3]}),"selection-change"===e[0]&&t.emit("editorChange",{name:e[0],range:e[1],oldRange:e[2],source:e[3]})},f=(t,o)=>"html"===e.contentType?O():"text"===e.contentType?T(t,o):null==l?void 0:l.getContents(t,o),y=(t,o="api")=>{const n=t||("delta"===e.contentType?new r:"");"html"===e.contentType?j(n):"text"===e.contentType?x(n,o):null==l||l.setContents(n,o),b=c(n)},T=(e,t)=>{var o;return null!==(o=null==l?void 0:l.getText(e,t))&&void 0!==o?o:""},x=(e,t="api")=>{null==l||l.setText(e,t)},O=()=>{var e;return null!==(e=null==l?void 0:l.root.innerHTML)&&void 0!==e?e:""},j=e=>{l&&(l.root.innerHTML=e)};return o.watch((()=>e.content),(e=>{if(!l||!e||p(e))return;const t=l.getSelection();t&&o.nextTick((()=>null==l?void 0:l.setSelection(t))),y(e)}),{deep:!0}),o.watch((()=>e.enable),(e=>{l&&l.enable(e)})),{editor:s,getEditor:()=>s.value,getToolbar:()=>{var e;return null===(e=null==l?void 0:l.getModule("toolbar"))||void 0===e?void 0:e.container},getQuill:()=>{if(l)return l;throw'The quill editor hasn\'t been instantiated yet,\n make sure to call this method when the editor ready\n or use v-on:ready="onReady(quill)" event instead.'},getContents:f,setContents:y,getHTML:O,setHTML:j,pasteHTML:(e,t="api")=>{const o=null==l?void 0:l.clipboard.convert(e);o&&(null==l||l.setContents(o,t))},focus:()=>{null==l||l.focus()},getText:T,setText:x,reinit:()=>{o.nextTick((()=>{var e;!t.slots.toolbar&&l&&(null===(e=l.getModule("toolbar"))||void 0===e||e.container.remove()),d()}))}}},render(){var e,t;return[null===(t=(e=this.$slots).toolbar)||void 0===t?void 0:t.call(e),o.h("div",{ref:"editor",...this.$attrs})]}});exports.Quill=n,exports.Delta=r,exports.QuillEditor=a;
@@ -11,6 +11,8 @@ import { Ref } from 'vue';
11
11
  import { Sources } from 'quill';
12
12
  import { VNodeProps } from 'vue';
13
13
 
14
+ declare type ContentPropType = string | Delta | undefined | null;
15
+
14
16
  export { Delta }
15
17
 
16
18
  declare type Module = {
@@ -23,8 +25,7 @@ export { Quill }
23
25
 
24
26
  export declare const QuillEditor: DefineComponent< {
25
27
  content: {
26
- type: PropType<string | Delta>;
27
- default: () => void;
28
+ type: PropType<ContentPropType>;
28
29
  };
29
30
  contentType: {
30
31
  type: PropType<"delta" | "html" | "text">;
@@ -71,17 +72,17 @@ getEditor: () => Element;
71
72
  getToolbar: () => Element;
72
73
  getQuill: () => Quill;
73
74
  getContents: (index?: number, length?: number) => string | Delta | undefined;
74
- setContents: (content: string | Delta, source?: Sources) => void;
75
+ setContents: (content: ContentPropType, source?: Sources) => void;
75
76
  getHTML: () => string;
76
77
  setHTML: (html: string) => void;
77
78
  pasteHTML: (html: string, source?: Sources) => void;
79
+ focus: () => void;
78
80
  getText: (index?: number, length?: number) => string;
79
81
  setText: (text: string, source?: Sources) => void;
80
82
  reinit: () => void;
81
83
  }, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ("textChange" | "selectionChange" | "editorChange" | "update:content" | "focus" | "blur" | "ready")[], "textChange" | "selectionChange" | "editorChange" | "update:content" | "focus" | "blur" | "ready", VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes< {
82
84
  content: {
83
- type: PropType<string | Delta>;
84
- default: () => void;
85
+ type: PropType<ContentPropType>;
85
86
  };
86
87
  contentType: {
87
88
  type: PropType<"delta" | "html" | "text">;
@@ -131,7 +132,6 @@ onFocus?: ((...args: any[]) => any) | undefined;
131
132
  onBlur?: ((...args: any[]) => any) | undefined;
132
133
  onReady?: ((...args: any[]) => any) | undefined;
133
134
  }, {
134
- content: string | Delta;
135
135
  contentType: "delta" | "html" | "text";
136
136
  enable: boolean;
137
137
  readOnly: boolean;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * VueQuill @vueup/vue-quill v1.1.0
2
+ * VueQuill @vueup/vue-quill v1.2.0
3
3
  * https://vueup.github.io/vue-quill/
4
4
  *
5
5
  * Includes quill v1.3.7
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * Copyright (c) 2023 Ahmad Luthfi Masruri
9
9
  * Released under the MIT license
10
- * Date: 2023-02-04T04:01:16.430Z
10
+ * Date: 2023-05-12T08:44:03.742Z
11
11
  */
12
12
  import { defineComponent, onMounted, onBeforeUnmount, ref, watch, nextTick, h } from 'vue';
13
13
 
@@ -18413,7 +18413,7 @@ var Delta = /** @class */ (function () {
18413
18413
  var Delta_1 = Delta;
18414
18414
 
18415
18415
 
18416
- var Delta_1$1 = Delta_1;
18416
+ var Delta$1 = Delta_1;
18417
18417
 
18418
18418
  const toolbarOptions = {
18419
18419
  essential: [
@@ -18452,7 +18452,6 @@ const QuillEditor = defineComponent({
18452
18452
  props: {
18453
18453
  content: {
18454
18454
  type: [String, Object],
18455
- default: () => { },
18456
18455
  },
18457
18456
  contentType: {
18458
18457
  type: String,
@@ -18606,7 +18605,7 @@ const QuillEditor = defineComponent({
18606
18605
  return Object.assign({}, props.globalOptions, props.options, clientOptions);
18607
18606
  };
18608
18607
  const maybeClone = (delta) => {
18609
- return typeof delta === 'object' ? delta.slice() : delta;
18608
+ return typeof delta === 'object' && delta ? delta.slice() : delta;
18610
18609
  };
18611
18610
  const deltaHasValuesOtherThanRetain = (delta) => {
18612
18611
  return Object.values(delta.ops).some((v) => !v.retain || Object.keys(v).length !== 1);
@@ -18619,7 +18618,10 @@ const QuillEditor = defineComponent({
18619
18618
  return true;
18620
18619
  }
18621
18620
  // Ref/Proxy does not support instanceof, so do a loose check
18622
- if (typeof against === 'object' && typeof internalModel === 'object') {
18621
+ if (typeof against === 'object' &&
18622
+ against &&
18623
+ typeof internalModel === 'object' &&
18624
+ internalModel) {
18623
18625
  return !deltaHasValuesOtherThanRetain(internalModel.diff(against));
18624
18626
  }
18625
18627
  }
@@ -18672,7 +18674,7 @@ const QuillEditor = defineComponent({
18672
18674
  if (quill)
18673
18675
  return quill;
18674
18676
  else
18675
- throw `The quill editor hasn't been instantiated yet,
18677
+ throw `The quill editor hasn't been instantiated yet,
18676
18678
  make sure to call this method when the editor ready
18677
18679
  or use v-on:ready="onReady(quill)" event instead.`;
18678
18680
  };
@@ -18686,16 +18688,21 @@ const QuillEditor = defineComponent({
18686
18688
  return quill === null || quill === void 0 ? void 0 : quill.getContents(index, length);
18687
18689
  };
18688
18690
  const setContents = (content, source = 'api') => {
18691
+ const normalizedContent = !content
18692
+ ? props.contentType === 'delta'
18693
+ ? new Delta$1()
18694
+ : ''
18695
+ : content;
18689
18696
  if (props.contentType === 'html') {
18690
- setHTML(content);
18697
+ setHTML(normalizedContent);
18691
18698
  }
18692
18699
  else if (props.contentType === 'text') {
18693
- setText(content, source);
18700
+ setText(normalizedContent, source);
18694
18701
  }
18695
18702
  else {
18696
- quill === null || quill === void 0 ? void 0 : quill.setContents(content, source);
18703
+ quill === null || quill === void 0 ? void 0 : quill.setContents(normalizedContent, source);
18697
18704
  }
18698
- internalModel = maybeClone(content);
18705
+ internalModel = maybeClone(normalizedContent);
18699
18706
  };
18700
18707
  const getText = (index, length) => {
18701
18708
  var _a;
@@ -18717,6 +18724,9 @@ const QuillEditor = defineComponent({
18717
18724
  if (delta)
18718
18725
  quill === null || quill === void 0 ? void 0 : quill.setContents(delta, source);
18719
18726
  };
18727
+ const focus = () => {
18728
+ quill === null || quill === void 0 ? void 0 : quill.focus();
18729
+ };
18720
18730
  const reinit = () => {
18721
18731
  nextTick(() => {
18722
18732
  var _a;
@@ -18749,6 +18759,7 @@ const QuillEditor = defineComponent({
18749
18759
  getHTML,
18750
18760
  setHTML,
18751
18761
  pasteHTML,
18762
+ focus,
18752
18763
  getText,
18753
18764
  setText,
18754
18765
  reinit,
@@ -18763,4 +18774,4 @@ const QuillEditor = defineComponent({
18763
18774
  },
18764
18775
  });
18765
18776
 
18766
- export { Delta_1$1 as Delta, Quill, QuillEditor };
18777
+ export { Delta$1 as Delta, Quill, QuillEditor };