@vueup/vue-quill 1.4.0 → 1.5.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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * VueQuill @vueup/vue-quill v1.4.0
2
+ * VueQuill @vueup/vue-quill v1.5.1
3
3
  * https://vueup.github.io/vue-quill/
4
4
  *
5
5
  * Includes quill v2.0.2 || >=2.0.4 <3
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * Copyright (c) 2026 Ahmad Luthfi Masruri
9
9
  * Released under the MIT license
10
- * Date: 2026-06-02T00:10:10.011Z
10
+ * Date: 2026-06-02T03:36:43.438Z
11
11
  */
12
12
  import Delta from 'quill-delta';
13
13
  export { default as Delta } from 'quill-delta';
@@ -130,9 +130,12 @@ const QuillEditor = defineComponent({
130
130
  },
131
131
  },
132
132
  toolbar: {
133
- type: [String, Array, Object],
133
+ type: [String, Array, Object, Boolean],
134
134
  required: false,
135
+ default: undefined,
135
136
  validator: (value) => {
137
+ if (typeof value === 'boolean')
138
+ return value === false;
136
139
  if (typeof value === 'string' && value !== '') {
137
140
  return value.charAt(0) === '#'
138
141
  ? true
@@ -234,7 +237,12 @@ const QuillEditor = defineComponent({
234
237
  clientOptions.readOnly = props.readOnly;
235
238
  if (props.placeholder)
236
239
  clientOptions.placeholder = props.placeholder;
237
- if (props.toolbar && props.toolbar !== '') {
240
+ if (props.toolbar === false) {
241
+ clientOptions.modules = {
242
+ toolbar: false,
243
+ };
244
+ }
245
+ else if (props.toolbar && props.toolbar !== '') {
238
246
  clientOptions.modules = {
239
247
  toolbar: (() => {
240
248
  if (typeof props.toolbar === 'object') {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * VueQuill @vueup/vue-quill v1.4.0
2
+ * VueQuill @vueup/vue-quill v1.5.1
3
3
  * https://vueup.github.io/vue-quill/
4
4
  *
5
5
  * Includes quill v2.0.2 || >=2.0.4 <3
@@ -7,6 +7,6 @@
7
7
  *
8
8
  * Copyright (c) 2026 Ahmad Luthfi Masruri
9
9
  * Released under the MIT license
10
- * Date: 2026-06-02T00:10:10.011Z
10
+ * Date: 2026-06-02T03:36:43.438Z
11
11
  */
12
- import e from"quill-delta";export{default as Delta}from"quill-delta";import{defineComponent as t,h as o,onMounted as n,onBeforeUnmount as l,ref as r,watch as i,nextTick as a}from"vue";const s={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"]]};let u,d,c=[];const m=()=>"undefined"!=typeof document,b=async()=>{if(u)return u;if(!m())throw new Error("@vueup/vue-quill: Quill can only be loaded in a browser environment.");return null!=d||(d=import("quill").then(({default:e})=>(u=e,(e=>{const t=c;c=[];for(const o of t)e.register(...o)})(e),e))),d},p=()=>u,f=()=>{if(u)return u;throw new Error("@vueup/vue-quill: Quill is not loaded yet. Use loadQuill() in a browser-only lifecycle hook, or access the Quill instance from the ready event.")},v=new Proxy(function(){},{get(e,t){if("register"===t)return(...e)=>{if(u)return u.register(...e);c.push(e),m()&&b()};const o=f(),n=o[t];return"function"==typeof n?n.bind(o):n},construct:(e,t)=>new(f())(...t)}),h=t({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(s).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:(t,o)=>{n(()=>{c=!1,f()}),l(()=>{u=null,c=!0});let u,d,c=!1;const m=r(),p=(e,t,o)=>{const n=e.imports;n&&t in n||e.register(t,o)},f=async()=>{var e,n;if(!m.value)return;const l=m.value,r=await b();if(!c&&m.value&&m.value===l){if(d=v(),t.modules)if(Array.isArray(t.modules))for(const e of t.modules)p(r,`modules/${e.name}`,e.module);else p(r,`modules/${t.modules.name}`,t.modules.module);u=new r(m.value,d),C(t.content),u.on("text-change",O),u.on("selection-change",q),u.on("editor-change",x),"bubble"!==t.theme&&m.value.classList.remove("ql-bubble"),"snow"!==t.theme&&m.value.classList.remove("ql-snow"),null===(n=null===(e=y())||void 0===e?void 0:e.container)||void 0===n||n.addEventListener("mousedown",e=>{e.preventDefault()}),o.emit("ready",u)}},v=()=>{const e={};if(""!==t.theme&&(e.theme=t.theme),t.readOnly&&(e.readOnly=t.readOnly),t.placeholder&&(e.placeholder=t.placeholder),t.toolbar&&""!==t.toolbar&&(e.modules={toolbar:(()=>{if("object"==typeof t.toolbar)return t.toolbar;if("string"==typeof t.toolbar){return"#"===t.toolbar.charAt(0)?t.toolbar:s[t.toolbar]}})()}),t.modules){const o=(()=>{var e,o;const n={};if(Array.isArray(t.modules))for(const l of t.modules)n[l.name]=null!==(e=l.options)&&void 0!==e?e:{};else n[t.modules.name]=null!==(o=t.modules.options)&&void 0!==o?o:{};return n})();e.modules=Object.assign({},e.modules,o)}return Object.assign({},t.globalOptions,t.options,e)},h=e=>"object"==typeof e&&e?e.slice():e,y=()=>null==u?void 0:u.getModule("toolbar");let g;const w=e=>{if(typeof g==typeof e){if(e===g)return!0;if("object"==typeof e&&e&&"object"==typeof g&&g)return t=g.diff(e),!Object.values(t.ops).some(e=>!e.retain||1!==Object.keys(e).length)}var t;return!1},O=(e,n,l)=>{g=h(j()),w(t.content)||o.emit("update:content",g),o.emit("textChange",{delta:e,oldContents:n,source:l})},T=r(),q=(e,t,n)=>{T.value=!!(null==u?void 0:u.hasFocus()),o.emit("selectionChange",{range:e,oldRange:t,source:n})};i(T,e=>{o.emit(e?"focus":"blur",m)});const x=(...e)=>{"text-change"===e[0]&&o.emit("editorChange",{name:e[0],delta:e[1],oldContents:e[2],source:e[3]}),"selection-change"===e[0]&&o.emit("editorChange",{name:e[0],range:e[1],oldRange:e[2],source:e[3]})},j=(e,o)=>"html"===t.contentType?L():"text"===t.contentType?k(e,o):null==u?void 0:u.getContents(e,o),C=(o,n="api")=>{const l=o||("delta"===t.contentType?new e:"");"html"===t.contentType?S(l):"text"===t.contentType?A(l,n):null==u||u.setContents(l,n),g=h(l)},k=(e,t)=>{var o;return null!==(o=null==u?void 0:u.getText(e,t))&&void 0!==o?o:""},A=(e,t="api")=>{null==u||u.setText(e,t)},L=()=>{var e;return null!==(e=null==u?void 0:u.root.innerHTML)&&void 0!==e?e:""},S=e=>{u&&(u.root.innerHTML=e)};return i(()=>t.content,e=>{if(!u||!e||w(e))return;const t=u.getSelection();t&&a(()=>null==u?void 0:u.setSelection(t)),C(e)},{deep:!0}),i(()=>t.enable,e=>{u&&u.enable(e)}),{editor:m,getEditor:()=>m.value,getToolbar:()=>{var e;return null===(e=y())||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:j,setContents:C,getHTML:L,setHTML:S,pasteHTML:(e,t="api")=>{const o=null==u?void 0:u.clipboard.convert({html:e});o&&(null==u||u.setContents(o,t))},focus:()=>{null==u||u.focus()},getText:k,setText:A,reinit:()=>{a(()=>{var e,t;!o.slots.toolbar&&u&&(null===(t=null===(e=y())||void 0===e?void 0:e.container)||void 0===t||t.remove()),f()})}}},render(){var e,t;return[null===(t=(e=this.$slots).toolbar)||void 0===t?void 0:t.call(e),o("div",{ref:"editor",...this.$attrs})]}});export{v as Quill,h as QuillEditor,p as getLoadedQuill,b as loadQuill};
12
+ import e from"quill-delta";export{default as Delta}from"quill-delta";import{defineComponent as t,h as o,onMounted as n,onBeforeUnmount as l,ref as r,watch as i,nextTick as a}from"vue";const s={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"]]};let u,d,c=[];const b=()=>"undefined"!=typeof document,m=async()=>{if(u)return u;if(!b())throw new Error("@vueup/vue-quill: Quill can only be loaded in a browser environment.");return null!=d||(d=import("quill").then(({default:e})=>(u=e,(e=>{const t=c;c=[];for(const o of t)e.register(...o)})(e),e))),d},p=()=>u,f=()=>{if(u)return u;throw new Error("@vueup/vue-quill: Quill is not loaded yet. Use loadQuill() in a browser-only lifecycle hook, or access the Quill instance from the ready event.")},v=new Proxy(function(){},{get(e,t){if("register"===t)return(...e)=>{if(u)return u.register(...e);c.push(e),b()&&m()};const o=f(),n=o[t];return"function"==typeof n?n.bind(o):n},construct:(e,t)=>new(f())(...t)}),h=t({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,Boolean],required:!1,default:void 0,validator:e=>"boolean"==typeof e?!1===e:"string"!=typeof e||""===e||("#"===e.charAt(0)||-1!==Object.keys(s).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:(t,o)=>{n(()=>{c=!1,f()}),l(()=>{u=null,c=!0});let u,d,c=!1;const b=r(),p=(e,t,o)=>{const n=e.imports;n&&t in n||e.register(t,o)},f=async()=>{var e,n;if(!b.value)return;const l=b.value,r=await m();if(!c&&b.value&&b.value===l){if(d=v(),t.modules)if(Array.isArray(t.modules))for(const e of t.modules)p(r,`modules/${e.name}`,e.module);else p(r,`modules/${t.modules.name}`,t.modules.module);u=new r(b.value,d),C(t.content),u.on("text-change",O),u.on("selection-change",q),u.on("editor-change",x),"bubble"!==t.theme&&b.value.classList.remove("ql-bubble"),"snow"!==t.theme&&b.value.classList.remove("ql-snow"),null===(n=null===(e=y())||void 0===e?void 0:e.container)||void 0===n||n.addEventListener("mousedown",e=>{e.preventDefault()}),o.emit("ready",u)}},v=()=>{const e={};if(""!==t.theme&&(e.theme=t.theme),t.readOnly&&(e.readOnly=t.readOnly),t.placeholder&&(e.placeholder=t.placeholder),!1===t.toolbar?e.modules={toolbar:!1}:t.toolbar&&""!==t.toolbar&&(e.modules={toolbar:(()=>{if("object"==typeof t.toolbar)return t.toolbar;if("string"==typeof t.toolbar){return"#"===t.toolbar.charAt(0)?t.toolbar:s[t.toolbar]}})()}),t.modules){const o=(()=>{var e,o;const n={};if(Array.isArray(t.modules))for(const l of t.modules)n[l.name]=null!==(e=l.options)&&void 0!==e?e:{};else n[t.modules.name]=null!==(o=t.modules.options)&&void 0!==o?o:{};return n})();e.modules=Object.assign({},e.modules,o)}return Object.assign({},t.globalOptions,t.options,e)},h=e=>"object"==typeof e&&e?e.slice():e,y=()=>null==u?void 0:u.getModule("toolbar");let g;const w=e=>{if(typeof g==typeof e){if(e===g)return!0;if("object"==typeof e&&e&&"object"==typeof g&&g)return t=g.diff(e),!Object.values(t.ops).some(e=>!e.retain||1!==Object.keys(e).length)}var t;return!1},O=(e,n,l)=>{g=h(j()),w(t.content)||o.emit("update:content",g),o.emit("textChange",{delta:e,oldContents:n,source:l})},T=r(),q=(e,t,n)=>{T.value=!!(null==u?void 0:u.hasFocus()),o.emit("selectionChange",{range:e,oldRange:t,source:n})};i(T,e=>{o.emit(e?"focus":"blur",b)});const x=(...e)=>{"text-change"===e[0]&&o.emit("editorChange",{name:e[0],delta:e[1],oldContents:e[2],source:e[3]}),"selection-change"===e[0]&&o.emit("editorChange",{name:e[0],range:e[1],oldRange:e[2],source:e[3]})},j=(e,o)=>"html"===t.contentType?L():"text"===t.contentType?k(e,o):null==u?void 0:u.getContents(e,o),C=(o,n="api")=>{const l=o||("delta"===t.contentType?new e:"");"html"===t.contentType?S(l):"text"===t.contentType?A(l,n):null==u||u.setContents(l,n),g=h(l)},k=(e,t)=>{var o;return null!==(o=null==u?void 0:u.getText(e,t))&&void 0!==o?o:""},A=(e,t="api")=>{null==u||u.setText(e,t)},L=()=>{var e;return null!==(e=null==u?void 0:u.root.innerHTML)&&void 0!==e?e:""},S=e=>{u&&(u.root.innerHTML=e)};return i(()=>t.content,e=>{if(!u||!e||w(e))return;const t=u.getSelection();t&&a(()=>null==u?void 0:u.setSelection(t)),C(e)},{deep:!0}),i(()=>t.enable,e=>{u&&u.enable(e)}),{editor:b,getEditor:()=>b.value,getToolbar:()=>{var e;return null===(e=y())||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:j,setContents:C,getHTML:L,setHTML:S,pasteHTML:(e,t="api")=>{const o=null==u?void 0:u.clipboard.convert({html:e});o&&(null==u||u.setContents(o,t))},focus:()=>{null==u||u.focus()},getText:k,setText:A,reinit:()=>{a(()=>{var e,t;!o.slots.toolbar&&u&&(null===(t=null===(e=y())||void 0===e?void 0:e.container)||void 0===t||t.remove()),f()})}}},render(){var e,t;return[null===(t=(e=this.$slots).toolbar)||void 0===t?void 0:t.call(e),o("div",{ref:"editor",...this.$attrs})]}});export{v as Quill,h as QuillEditor,p as getLoadedQuill,m as loadQuill};
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * VueQuill @vueup/vue-quill v1.4.0
2
+ * VueQuill @vueup/vue-quill v1.5.1
3
3
  * https://vueup.github.io/vue-quill/
4
4
  *
5
5
  * Includes quill v2.0.2 || >=2.0.4 <3
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * Copyright (c) 2026 Ahmad Luthfi Masruri
9
9
  * Released under the MIT license
10
- * Date: 2026-06-02T00:10:10.011Z
10
+ * Date: 2026-06-02T03:36:43.438Z
11
11
  */
12
12
  (function (global, factory) {
13
13
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) :
@@ -5634,9 +5634,12 @@
5634
5634
  },
5635
5635
  },
5636
5636
  toolbar: {
5637
- type: [String, Array, Object],
5637
+ type: [String, Array, Object, Boolean],
5638
5638
  required: false,
5639
+ default: undefined,
5639
5640
  validator: (value) => {
5641
+ if (typeof value === 'boolean')
5642
+ return value === false;
5640
5643
  if (typeof value === 'string' && value !== '') {
5641
5644
  return value.charAt(0) === '#'
5642
5645
  ? true
@@ -5738,7 +5741,12 @@
5738
5741
  clientOptions.readOnly = props.readOnly;
5739
5742
  if (props.placeholder)
5740
5743
  clientOptions.placeholder = props.placeholder;
5741
- if (props.toolbar && props.toolbar !== '') {
5744
+ if (props.toolbar === false) {
5745
+ clientOptions.modules = {
5746
+ toolbar: false,
5747
+ };
5748
+ }
5749
+ else if (props.toolbar && props.toolbar !== '') {
5742
5750
  clientOptions.modules = {
5743
5751
  toolbar: (() => {
5744
5752
  if (typeof props.toolbar === 'object') {