@vueup/vue-quill 1.0.1 → 1.1.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.
- package/dist/vue-quill.cjs.js +27 -20
- package/dist/vue-quill.cjs.prod.js +4 -4
- package/dist/vue-quill.d.ts +5 -6
- package/dist/vue-quill.esm-browser.js +26 -19
- package/dist/vue-quill.esm-browser.prod.js +4 -4
- package/dist/vue-quill.esm-bundler.js +25 -17
- package/dist/vue-quill.esm-bundler.prod.js +4 -4
- package/dist/vue-quill.global.js +26 -19
- package/dist/vue-quill.global.prod.js +4 -4
- package/package.json +1 -1
package/dist/vue-quill.cjs.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VueQuill @vueup/vue-quill v1.
|
|
2
|
+
* VueQuill @vueup/vue-quill v1.1.1
|
|
3
3
|
* https://vueup.github.io/vue-quill/
|
|
4
4
|
*
|
|
5
5
|
* Includes quill v1.3.7
|
|
6
6
|
* https://quilljs.com/
|
|
7
7
|
*
|
|
8
|
-
* Copyright (c)
|
|
8
|
+
* Copyright (c) 2023 Ahmad Luthfi Masruri
|
|
9
9
|
* Released under the MIT license
|
|
10
|
-
* Date:
|
|
10
|
+
* Date: 2023-03-08T12:39:52.151Z
|
|
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
|
|
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
|
|
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,
|
|
@@ -212,28 +211,31 @@ const QuillEditor = vue.defineComponent({
|
|
|
212
211
|
}
|
|
213
212
|
return Object.assign({}, props.globalOptions, props.options, clientOptions);
|
|
214
213
|
};
|
|
214
|
+
const maybeClone = (delta) => {
|
|
215
|
+
return typeof delta === 'object' && delta ? delta.slice() : delta;
|
|
216
|
+
};
|
|
215
217
|
const deltaHasValuesOtherThanRetain = (delta) => {
|
|
216
|
-
return Object.values(delta).some((v) => !v.retain);
|
|
218
|
+
return Object.values(delta.ops).some((v) => !v.retain || Object.keys(v).length !== 1);
|
|
217
219
|
};
|
|
218
|
-
//
|
|
219
|
-
let internalModel
|
|
220
|
+
// Doesn't need reactivity, but does need to be cloned to avoid deep mutations always registering as equal
|
|
221
|
+
let internalModel;
|
|
220
222
|
const internalModelEquals = (against) => {
|
|
221
223
|
if (typeof internalModel === typeof against) {
|
|
222
224
|
if (against === internalModel) {
|
|
223
225
|
return true;
|
|
224
226
|
}
|
|
225
227
|
// Ref/Proxy does not support instanceof, so do a loose check
|
|
226
|
-
if (typeof against === 'object' &&
|
|
228
|
+
if (typeof against === 'object' &&
|
|
229
|
+
against &&
|
|
230
|
+
typeof internalModel === 'object' &&
|
|
231
|
+
internalModel) {
|
|
227
232
|
return !deltaHasValuesOtherThanRetain(internalModel.diff(against));
|
|
228
233
|
}
|
|
229
234
|
}
|
|
230
235
|
return false;
|
|
231
236
|
};
|
|
232
237
|
const handleTextChange = (delta, oldContents, source) => {
|
|
233
|
-
|
|
234
|
-
// so content should not be undefined but let's make ts and eslint happy
|
|
235
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
236
|
-
internalModel = getContents();
|
|
238
|
+
internalModel = maybeClone(getContents());
|
|
237
239
|
// Update v-model:content when text changes
|
|
238
240
|
if (!internalModelEquals(props.content)) {
|
|
239
241
|
ctx.emit('update:content', internalModel);
|
|
@@ -293,15 +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(
|
|
304
|
+
setHTML(normalizedContent);
|
|
298
305
|
}
|
|
299
306
|
else if (props.contentType === 'text') {
|
|
300
|
-
setText(
|
|
307
|
+
setText(normalizedContent, source);
|
|
301
308
|
}
|
|
302
309
|
else {
|
|
303
|
-
quill === null || quill === void 0 ? void 0 : quill.setContents(
|
|
310
|
+
quill === null || quill === void 0 ? void 0 : quill.setContents(normalizedContent, source);
|
|
304
311
|
}
|
|
312
|
+
internalModel = maybeClone(normalizedContent);
|
|
305
313
|
};
|
|
306
314
|
const getText = (index, length) => {
|
|
307
315
|
var _a;
|
|
@@ -334,14 +342,13 @@ const QuillEditor = vue.defineComponent({
|
|
|
334
342
|
vue.watch(() => props.content, (newContent) => {
|
|
335
343
|
if (!quill || !newContent || internalModelEquals(newContent))
|
|
336
344
|
return;
|
|
337
|
-
internalModel = newContent;
|
|
338
345
|
// Restore the selection and cursor position after updating the content
|
|
339
346
|
const selection = quill.getSelection();
|
|
340
347
|
if (selection) {
|
|
341
348
|
vue.nextTick(() => quill === null || quill === void 0 ? void 0 : quill.setSelection(selection));
|
|
342
349
|
}
|
|
343
350
|
setContents(newContent);
|
|
344
|
-
});
|
|
351
|
+
}, { deep: true });
|
|
345
352
|
vue.watch(() => props.enable, (newValue) => {
|
|
346
353
|
if (quill)
|
|
347
354
|
quill.enable(newValue);
|
|
@@ -371,5 +378,5 @@ const QuillEditor = vue.defineComponent({
|
|
|
371
378
|
});
|
|
372
379
|
|
|
373
380
|
exports.Quill = Quill__default;
|
|
374
|
-
exports.Delta =
|
|
381
|
+
exports.Delta = Delta__default;
|
|
375
382
|
exports.QuillEditor = QuillEditor;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VueQuill @vueup/vue-quill v1.
|
|
2
|
+
* VueQuill @vueup/vue-quill v1.1.1
|
|
3
3
|
* https://vueup.github.io/vue-quill/
|
|
4
4
|
*
|
|
5
5
|
* Includes quill v1.3.7
|
|
6
6
|
* https://quilljs.com/
|
|
7
7
|
*
|
|
8
|
-
* Copyright (c)
|
|
8
|
+
* Copyright (c) 2023 Ahmad Luthfi Masruri
|
|
9
9
|
* Released under the MIT license
|
|
10
|
-
* Date:
|
|
10
|
+
* Date: 2023-03-08T12:39:52.151Z
|
|
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]
|
|
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))},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;
|
package/dist/vue-quill.d.ts
CHANGED
|
@@ -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<
|
|
27
|
-
default: () => void;
|
|
28
|
+
type: PropType<ContentPropType>;
|
|
28
29
|
};
|
|
29
30
|
contentType: {
|
|
30
31
|
type: PropType<"delta" | "html" | "text">;
|
|
@@ -71,7 +72,7 @@ getEditor: () => Element;
|
|
|
71
72
|
getToolbar: () => Element;
|
|
72
73
|
getQuill: () => Quill;
|
|
73
74
|
getContents: (index?: number, length?: number) => string | Delta | undefined;
|
|
74
|
-
setContents: (content:
|
|
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;
|
|
@@ -80,8 +81,7 @@ setText: (text: string, source?: Sources) => void;
|
|
|
80
81
|
reinit: () => void;
|
|
81
82
|
}, 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
83
|
content: {
|
|
83
|
-
type: PropType<
|
|
84
|
-
default: () => void;
|
|
84
|
+
type: PropType<ContentPropType>;
|
|
85
85
|
};
|
|
86
86
|
contentType: {
|
|
87
87
|
type: PropType<"delta" | "html" | "text">;
|
|
@@ -131,7 +131,6 @@ onFocus?: ((...args: any[]) => any) | undefined;
|
|
|
131
131
|
onBlur?: ((...args: any[]) => any) | undefined;
|
|
132
132
|
onReady?: ((...args: any[]) => any) | undefined;
|
|
133
133
|
}, {
|
|
134
|
-
content: string | Delta;
|
|
135
134
|
contentType: "delta" | "html" | "text";
|
|
136
135
|
enable: boolean;
|
|
137
136
|
readOnly: boolean;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VueQuill @vueup/vue-quill v1.
|
|
2
|
+
* VueQuill @vueup/vue-quill v1.1.1
|
|
3
3
|
* https://vueup.github.io/vue-quill/
|
|
4
4
|
*
|
|
5
5
|
* Includes quill v1.3.7
|
|
6
6
|
* https://quilljs.com/
|
|
7
7
|
*
|
|
8
|
-
* Copyright (c)
|
|
8
|
+
* Copyright (c) 2023 Ahmad Luthfi Masruri
|
|
9
9
|
* Released under the MIT license
|
|
10
|
-
* Date:
|
|
10
|
+
* Date: 2023-03-08T12:39:52.151Z
|
|
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
|
|
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,
|
|
@@ -18605,28 +18604,31 @@ const QuillEditor = defineComponent({
|
|
|
18605
18604
|
}
|
|
18606
18605
|
return Object.assign({}, props.globalOptions, props.options, clientOptions);
|
|
18607
18606
|
};
|
|
18607
|
+
const maybeClone = (delta) => {
|
|
18608
|
+
return typeof delta === 'object' && delta ? delta.slice() : delta;
|
|
18609
|
+
};
|
|
18608
18610
|
const deltaHasValuesOtherThanRetain = (delta) => {
|
|
18609
|
-
return Object.values(delta).some((v) => !v.retain);
|
|
18611
|
+
return Object.values(delta.ops).some((v) => !v.retain || Object.keys(v).length !== 1);
|
|
18610
18612
|
};
|
|
18611
|
-
//
|
|
18612
|
-
let internalModel
|
|
18613
|
+
// Doesn't need reactivity, but does need to be cloned to avoid deep mutations always registering as equal
|
|
18614
|
+
let internalModel;
|
|
18613
18615
|
const internalModelEquals = (against) => {
|
|
18614
18616
|
if (typeof internalModel === typeof against) {
|
|
18615
18617
|
if (against === internalModel) {
|
|
18616
18618
|
return true;
|
|
18617
18619
|
}
|
|
18618
18620
|
// Ref/Proxy does not support instanceof, so do a loose check
|
|
18619
|
-
if (typeof against === 'object' &&
|
|
18621
|
+
if (typeof against === 'object' &&
|
|
18622
|
+
against &&
|
|
18623
|
+
typeof internalModel === 'object' &&
|
|
18624
|
+
internalModel) {
|
|
18620
18625
|
return !deltaHasValuesOtherThanRetain(internalModel.diff(against));
|
|
18621
18626
|
}
|
|
18622
18627
|
}
|
|
18623
18628
|
return false;
|
|
18624
18629
|
};
|
|
18625
18630
|
const handleTextChange = (delta, oldContents, source) => {
|
|
18626
|
-
|
|
18627
|
-
// so content should not be undefined but let's make ts and eslint happy
|
|
18628
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
18629
|
-
internalModel = getContents();
|
|
18631
|
+
internalModel = maybeClone(getContents());
|
|
18630
18632
|
// Update v-model:content when text changes
|
|
18631
18633
|
if (!internalModelEquals(props.content)) {
|
|
18632
18634
|
ctx.emit('update:content', internalModel);
|
|
@@ -18686,15 +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(
|
|
18697
|
+
setHTML(normalizedContent);
|
|
18691
18698
|
}
|
|
18692
18699
|
else if (props.contentType === 'text') {
|
|
18693
|
-
setText(
|
|
18700
|
+
setText(normalizedContent, source);
|
|
18694
18701
|
}
|
|
18695
18702
|
else {
|
|
18696
|
-
quill === null || quill === void 0 ? void 0 : quill.setContents(
|
|
18703
|
+
quill === null || quill === void 0 ? void 0 : quill.setContents(normalizedContent, source);
|
|
18697
18704
|
}
|
|
18705
|
+
internalModel = maybeClone(normalizedContent);
|
|
18698
18706
|
};
|
|
18699
18707
|
const getText = (index, length) => {
|
|
18700
18708
|
var _a;
|
|
@@ -18727,14 +18735,13 @@ const QuillEditor = defineComponent({
|
|
|
18727
18735
|
watch(() => props.content, (newContent) => {
|
|
18728
18736
|
if (!quill || !newContent || internalModelEquals(newContent))
|
|
18729
18737
|
return;
|
|
18730
|
-
internalModel = newContent;
|
|
18731
18738
|
// Restore the selection and cursor position after updating the content
|
|
18732
18739
|
const selection = quill.getSelection();
|
|
18733
18740
|
if (selection) {
|
|
18734
18741
|
nextTick(() => quill === null || quill === void 0 ? void 0 : quill.setSelection(selection));
|
|
18735
18742
|
}
|
|
18736
18743
|
setContents(newContent);
|
|
18737
|
-
});
|
|
18744
|
+
}, { deep: true });
|
|
18738
18745
|
watch(() => props.enable, (newValue) => {
|
|
18739
18746
|
if (quill)
|
|
18740
18747
|
quill.enable(newValue);
|
|
@@ -18763,4 +18770,4 @@ const QuillEditor = defineComponent({
|
|
|
18763
18770
|
},
|
|
18764
18771
|
});
|
|
18765
18772
|
|
|
18766
|
-
export {
|
|
18773
|
+
export { Delta$1 as Delta, Quill, QuillEditor };
|