@vueup/vue-quill 1.1.1 → 1.2.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 +18 -6
- package/dist/vue-quill.cjs.prod.js +4 -4
- package/dist/vue-quill.d.ts +1 -0
- package/dist/vue-quill.esm-browser.js +18 -6
- package/dist/vue-quill.esm-browser.prod.js +4 -4
- package/dist/vue-quill.esm-bundler.js +18 -6
- package/dist/vue-quill.esm-bundler.prod.js +4 -4
- package/dist/vue-quill.global.js +18 -6
- package/dist/vue-quill.global.prod.js +4 -4
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VueQuill @vueup/vue-quill v1.
|
|
2
|
+
* VueQuill @vueup/vue-quill v1.2.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) 2026 Ahmad Luthfi Masruri
|
|
9
9
|
* Released under the MIT license
|
|
10
|
-
* Date:
|
|
10
|
+
* Date: 2026-06-01T03:41:54.233Z
|
|
11
11
|
*/
|
|
12
12
|
import Quill from 'quill';
|
|
13
13
|
export { default as Quill } from 'quill';
|
|
@@ -123,6 +123,14 @@ const QuillEditor = defineComponent({
|
|
|
123
123
|
let quill;
|
|
124
124
|
let options;
|
|
125
125
|
const editor = ref();
|
|
126
|
+
// Register Module if not already registered
|
|
127
|
+
const registerModule = (moduleName, module) => {
|
|
128
|
+
const quillImports = Quill.imports;
|
|
129
|
+
if (quillImports && moduleName in quillImports) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
Quill.register(moduleName, module);
|
|
133
|
+
};
|
|
126
134
|
// Initialize Quill
|
|
127
135
|
const initialize = () => {
|
|
128
136
|
var _a;
|
|
@@ -133,11 +141,11 @@ const QuillEditor = defineComponent({
|
|
|
133
141
|
if (props.modules) {
|
|
134
142
|
if (Array.isArray(props.modules)) {
|
|
135
143
|
for (const module of props.modules) {
|
|
136
|
-
|
|
144
|
+
registerModule(`modules/${module.name}`, module.module);
|
|
137
145
|
}
|
|
138
146
|
}
|
|
139
147
|
else {
|
|
140
|
-
|
|
148
|
+
registerModule(`modules/${props.modules.name}`, props.modules.module);
|
|
141
149
|
}
|
|
142
150
|
}
|
|
143
151
|
// Create new Quill instance
|
|
@@ -274,7 +282,7 @@ const QuillEditor = defineComponent({
|
|
|
274
282
|
if (quill)
|
|
275
283
|
return quill;
|
|
276
284
|
else
|
|
277
|
-
throw `The quill editor hasn't been instantiated yet,
|
|
285
|
+
throw `The quill editor hasn't been instantiated yet,
|
|
278
286
|
make sure to call this method when the editor ready
|
|
279
287
|
or use v-on:ready="onReady(quill)" event instead.`;
|
|
280
288
|
};
|
|
@@ -324,6 +332,9 @@ const QuillEditor = defineComponent({
|
|
|
324
332
|
if (delta)
|
|
325
333
|
quill === null || quill === void 0 ? void 0 : quill.setContents(delta, source);
|
|
326
334
|
};
|
|
335
|
+
const focus = () => {
|
|
336
|
+
quill === null || quill === void 0 ? void 0 : quill.focus();
|
|
337
|
+
};
|
|
327
338
|
const reinit = () => {
|
|
328
339
|
nextTick(() => {
|
|
329
340
|
var _a;
|
|
@@ -356,6 +367,7 @@ const QuillEditor = defineComponent({
|
|
|
356
367
|
getHTML,
|
|
357
368
|
setHTML,
|
|
358
369
|
pasteHTML,
|
|
370
|
+
focus,
|
|
359
371
|
getText,
|
|
360
372
|
setText,
|
|
361
373
|
reinit,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VueQuill @vueup/vue-quill v1.
|
|
2
|
+
* VueQuill @vueup/vue-quill v1.2.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) 2026 Ahmad Luthfi Masruri
|
|
9
9
|
* Released under the MIT license
|
|
10
|
-
* Date:
|
|
10
|
+
* Date: 2026-06-01T03:41:54.233Z
|
|
11
11
|
*/
|
|
12
|
-
import e from"quill";export{default as Quill}from"quill";import t from"quill-delta";export{default as Delta}from"quill-delta";import{defineComponent as o,onMounted as l,onBeforeUnmount as n,ref as r,watch as i,nextTick as a,h as
|
|
12
|
+
import e from"quill";export{default as Quill}from"quill";import t from"quill-delta";export{default as Delta}from"quill-delta";import{defineComponent as o,onMounted as l,onBeforeUnmount as n,ref as r,watch as i,nextTick as a,h as s}from"vue";const d={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"]]},u=o({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(d).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:(o,s)=>{let u,c;l((()=>{p()})),n((()=>{u=null}));const m=r(),b=(t,o)=>{const l=e.imports;l&&t in l||e.register(t,o)},p=()=>{var t;if(m.value){if(c=g(),o.modules)if(Array.isArray(o.modules))for(const e of o.modules)b(`modules/${e.name}`,e.module);else b(`modules/${o.modules.name}`,o.modules.module);u=new e(m.value,c),j(o.content),u.on("text-change",y),u.on("selection-change",T),u.on("editor-change",q),"bubble"!==o.theme&&m.value.classList.remove("ql-bubble"),"snow"!==o.theme&&m.value.classList.remove("ql-snow"),null===(t=u.getModule("toolbar"))||void 0===t||t.container.addEventListener("mousedown",(e=>{e.preventDefault()})),s.emit("ready",u)}},g=()=>{const e={};if(""!==o.theme&&(e.theme=o.theme),o.readOnly&&(e.readOnly=o.readOnly),o.placeholder&&(e.placeholder=o.placeholder),o.toolbar&&""!==o.toolbar&&(e.modules={toolbar:(()=>{if("object"==typeof o.toolbar)return o.toolbar;if("string"==typeof o.toolbar){return"#"===o.toolbar.charAt(0)?o.toolbar:d[o.toolbar]}})()}),o.modules){const t=(()=>{var e,t;const l={};if(Array.isArray(o.modules))for(const n of o.modules)l[n.name]=null!==(e=n.options)&&void 0!==e?e:{};else l[o.modules.name]=null!==(t=o.modules.options)&&void 0!==t?t:{};return l})();e.modules=Object.assign({},e.modules,t)}return Object.assign({},o.globalOptions,o.options,e)},f=e=>"object"==typeof e&&e?e.slice():e;let h;const v=e=>{if(typeof h==typeof e){if(e===h)return!0;if("object"==typeof e&&e&&"object"==typeof h&&h)return t=h.diff(e),!Object.values(t.ops).some((e=>!e.retain||1!==Object.keys(e).length))}var t;return!1},y=(e,t,l)=>{h=f(x()),v(o.content)||s.emit("update:content",h),s.emit("textChange",{delta:e,oldContents:t,source:l})},O=r(),T=(e,t,o)=>{O.value=!!(null==u?void 0:u.hasFocus()),s.emit("selectionChange",{range:e,oldRange:t,source:o})};i(O,(e=>{s.emit(e?"focus":"blur",m)}));const q=(...e)=>{"text-change"===e[0]&&s.emit("editorChange",{name:e[0],delta:e[1],oldContents:e[2],source:e[3]}),"selection-change"===e[0]&&s.emit("editorChange",{name:e[0],range:e[1],oldRange:e[2],source:e[3]})},x=(e,t)=>"html"===o.contentType?w():"text"===o.contentType?C(e,t):null==u?void 0:u.getContents(e,t),j=(e,l="api")=>{const n=e||("delta"===o.contentType?new t:"");"html"===o.contentType?A(n):"text"===o.contentType?k(n,l):null==u||u.setContents(n,l),h=f(n)},C=(e,t)=>{var o;return null!==(o=null==u?void 0:u.getText(e,t))&&void 0!==o?o:""},k=(e,t="api")=>{null==u||u.setText(e,t)},w=()=>{var e;return null!==(e=null==u?void 0:u.root.innerHTML)&&void 0!==e?e:""},A=e=>{u&&(u.root.innerHTML=e)};return i((()=>o.content),(e=>{if(!u||!e||v(e))return;const t=u.getSelection();t&&a((()=>null==u?void 0:u.setSelection(t))),j(e)}),{deep:!0}),i((()=>o.enable),(e=>{u&&u.enable(e)})),{editor:m,getEditor:()=>m.value,getToolbar:()=>{var e;return null===(e=null==u?void 0:u.getModule("toolbar"))||void 0===e?void 0:e.container},getQuill:()=>{if(u)return u;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:x,setContents:j,getHTML:w,setHTML:A,pasteHTML:(e,t="api")=>{const o=null==u?void 0:u.clipboard.convert(e);o&&(null==u||u.setContents(o,t))},focus:()=>{null==u||u.focus()},getText:C,setText:k,reinit:()=>{a((()=>{var e;!s.slots.toolbar&&u&&(null===(e=u.getModule("toolbar"))||void 0===e||e.container.remove()),p()}))}}},render(){var e,t;return[null===(t=(e=this.$slots).toolbar)||void 0===t?void 0:t.call(e),s("div",{ref:"editor",...this.$attrs})]}});export{u as QuillEditor};
|
package/dist/vue-quill.global.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VueQuill @vueup/vue-quill v1.
|
|
2
|
+
* VueQuill @vueup/vue-quill v1.2.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) 2026 Ahmad Luthfi Masruri
|
|
9
9
|
* Released under the MIT license
|
|
10
|
-
* Date:
|
|
10
|
+
* Date: 2026-06-01T03:41:54.233Z
|
|
11
11
|
*/
|
|
12
12
|
(function (global, factory) {
|
|
13
13
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) :
|
|
@@ -18527,6 +18527,14 @@
|
|
|
18527
18527
|
let quill;
|
|
18528
18528
|
let options;
|
|
18529
18529
|
const editor = vue.ref();
|
|
18530
|
+
// Register Module if not already registered
|
|
18531
|
+
const registerModule = (moduleName, module) => {
|
|
18532
|
+
const quillImports = Quill.imports;
|
|
18533
|
+
if (quillImports && moduleName in quillImports) {
|
|
18534
|
+
return;
|
|
18535
|
+
}
|
|
18536
|
+
Quill.register(moduleName, module);
|
|
18537
|
+
};
|
|
18530
18538
|
// Initialize Quill
|
|
18531
18539
|
const initialize = () => {
|
|
18532
18540
|
var _a;
|
|
@@ -18537,11 +18545,11 @@
|
|
|
18537
18545
|
if (props.modules) {
|
|
18538
18546
|
if (Array.isArray(props.modules)) {
|
|
18539
18547
|
for (const module of props.modules) {
|
|
18540
|
-
|
|
18548
|
+
registerModule(`modules/${module.name}`, module.module);
|
|
18541
18549
|
}
|
|
18542
18550
|
}
|
|
18543
18551
|
else {
|
|
18544
|
-
|
|
18552
|
+
registerModule(`modules/${props.modules.name}`, props.modules.module);
|
|
18545
18553
|
}
|
|
18546
18554
|
}
|
|
18547
18555
|
// Create new Quill instance
|
|
@@ -18678,7 +18686,7 @@
|
|
|
18678
18686
|
if (quill)
|
|
18679
18687
|
return quill;
|
|
18680
18688
|
else
|
|
18681
|
-
throw `The quill editor hasn't been instantiated yet,
|
|
18689
|
+
throw `The quill editor hasn't been instantiated yet,
|
|
18682
18690
|
make sure to call this method when the editor ready
|
|
18683
18691
|
or use v-on:ready="onReady(quill)" event instead.`;
|
|
18684
18692
|
};
|
|
@@ -18728,6 +18736,9 @@
|
|
|
18728
18736
|
if (delta)
|
|
18729
18737
|
quill === null || quill === void 0 ? void 0 : quill.setContents(delta, source);
|
|
18730
18738
|
};
|
|
18739
|
+
const focus = () => {
|
|
18740
|
+
quill === null || quill === void 0 ? void 0 : quill.focus();
|
|
18741
|
+
};
|
|
18731
18742
|
const reinit = () => {
|
|
18732
18743
|
vue.nextTick(() => {
|
|
18733
18744
|
var _a;
|
|
@@ -18760,6 +18771,7 @@
|
|
|
18760
18771
|
getHTML,
|
|
18761
18772
|
setHTML,
|
|
18762
18773
|
pasteHTML,
|
|
18774
|
+
focus,
|
|
18763
18775
|
getText,
|
|
18764
18776
|
setText,
|
|
18765
18777
|
reinit,
|