@vueup/vue-quill 1.2.1 → 1.3.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.
- package/dist/vue-quill.bubble.css +188 -91
- package/dist/vue-quill.bubble.prod.css +1 -1
- package/dist/vue-quill.cjs.js +371 -373
- package/dist/vue-quill.cjs.prod.js +4 -4
- package/dist/vue-quill.core.css +172 -81
- package/dist/vue-quill.core.prod.css +1 -1
- package/dist/vue-quill.d.ts +20 -21
- package/dist/vue-quill.esm-browser.js +15898 -18028
- package/dist/vue-quill.esm-browser.prod.js +4 -4
- package/dist/vue-quill.esm-bundler.js +370 -365
- package/dist/vue-quill.esm-bundler.prod.js +4 -4
- package/dist/vue-quill.global.js +16602 -18734
- package/dist/vue-quill.global.prod.js +4 -4
- package/package.json +3 -3
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VueQuill @vueup/vue-quill v1.
|
|
2
|
+
* VueQuill @vueup/vue-quill v1.3.0
|
|
3
3
|
* https://vueup.github.io/vue-quill/
|
|
4
4
|
*
|
|
5
|
-
* Includes quill
|
|
5
|
+
* Includes quill v2.0.2 || >=2.0.4 <3
|
|
6
6
|
* https://quilljs.com/
|
|
7
7
|
*
|
|
8
8
|
* Copyright (c) 2026 Ahmad Luthfi Masruri
|
|
9
9
|
* Released under the MIT license
|
|
10
|
-
* Date: 2026-06-
|
|
10
|
+
* Date: 2026-06-01T10:26:31.645Z
|
|
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,
|
|
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,h as l,onMounted as n,onBeforeUnmount as r,ref as i,watch as a,nextTick 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,l)=>{let u,c;n(()=>{p()}),r(()=>{u=null});const m=i(),b=(t,o)=>{const l=e.imports;l&&t in l||e.register(t,o)},p=()=>{var t,n;if(m.value){if(c=v(),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),C(o.content),u.on("text-change",O),u.on("selection-change",q),u.on("editor-change",x),"bubble"!==o.theme&&m.value.classList.remove("ql-bubble"),"snow"!==o.theme&&m.value.classList.remove("ql-snow"),null===(n=null===(t=f())||void 0===t?void 0:t.container)||void 0===n||n.addEventListener("mousedown",e=>{e.preventDefault()}),l.emit("ready",u)}},v=()=>{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)},h=e=>"object"==typeof e&&e?e.slice():e,f=()=>null==u?void 0:u.getModule("toolbar");let g;const y=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,t,n)=>{g=h(j()),y(o.content)||l.emit("update:content",g),l.emit("textChange",{delta:e,oldContents:t,source:n})},T=i(),q=(e,t,o)=>{T.value=!!(null==u?void 0:u.hasFocus()),l.emit("selectionChange",{range:e,oldRange:t,source:o})};a(T,e=>{l.emit(e?"focus":"blur",m)});const x=(...e)=>{"text-change"===e[0]&&l.emit("editorChange",{name:e[0],delta:e[1],oldContents:e[2],source:e[3]}),"selection-change"===e[0]&&l.emit("editorChange",{name:e[0],range:e[1],oldRange:e[2],source:e[3]})},j=(e,t)=>"html"===o.contentType?A():"text"===o.contentType?k(e,t):null==u?void 0:u.getContents(e,t),C=(e,l="api")=>{const n=e||("delta"===o.contentType?new t:"");"html"===o.contentType?L(n):"text"===o.contentType?w(n,l):null==u||u.setContents(n,l),g=h(n)},k=(e,t)=>{var o;return null!==(o=null==u?void 0:u.getText(e,t))&&void 0!==o?o:""},w=(e,t="api")=>{null==u||u.setText(e,t)},A=()=>{var e;return null!==(e=null==u?void 0:u.root.innerHTML)&&void 0!==e?e:""},L=e=>{u&&(u.root.innerHTML=e)};return a(()=>o.content,e=>{if(!u||!e||y(e))return;const t=u.getSelection();t&&s(()=>null==u?void 0:u.setSelection(t)),C(e)},{deep:!0}),a(()=>o.enable,e=>{u&&u.enable(e)}),{editor:m,getEditor:()=>m.value,getToolbar:()=>{var e;return null===(e=f())||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:A,setHTML:L,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:w,reinit:()=>{s(()=>{var e,t;!l.slots.toolbar&&u&&(null===(t=null===(e=f())||void 0===e?void 0:e.container)||void 0===t||t.remove()),p()})}}},render(){var e,t;return[null===(t=(e=this.$slots).toolbar)||void 0===t?void 0:t.call(e),l("div",{ref:"editor",...this.$attrs})]}});export{u as QuillEditor};
|