@vueup/vue-quill 1.5.0 → 1.5.2
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 +67 -28
- package/dist/vue-quill.cjs.prod.js +3 -3
- package/dist/vue-quill.d.ts +7 -2
- package/dist/vue-quill.esm-browser.js +70 -31
- package/dist/vue-quill.esm-browser.prod.js +3 -3
- package/dist/vue-quill.esm-bundler.js +67 -28
- package/dist/vue-quill.esm-bundler.prod.js +3 -3
- package/dist/vue-quill.global.js +70 -31
- package/dist/vue-quill.global.prod.js +3 -3
- package/package.json +1 -1
package/dist/vue-quill.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VueQuill @vueup/vue-quill v1.5.
|
|
2
|
+
* VueQuill @vueup/vue-quill v1.5.2
|
|
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-
|
|
10
|
+
* Date: 2026-06-02T23:50:41.596Z
|
|
11
11
|
*/
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
@@ -97,6 +97,55 @@ const Quill = new Proxy(function QuillProxy() { }, {
|
|
|
97
97
|
},
|
|
98
98
|
});
|
|
99
99
|
|
|
100
|
+
const quillRegistrationPathPrefixes = new Set([
|
|
101
|
+
'attributors',
|
|
102
|
+
'blots',
|
|
103
|
+
'formats',
|
|
104
|
+
'modules',
|
|
105
|
+
'themes',
|
|
106
|
+
'ui',
|
|
107
|
+
]);
|
|
108
|
+
const isQuillRegistrationPath = (name) => {
|
|
109
|
+
const [prefix] = name.split('/');
|
|
110
|
+
return quillRegistrationPathPrefixes.has(prefix);
|
|
111
|
+
};
|
|
112
|
+
const getModuleRegistrationName = (name) => {
|
|
113
|
+
return isQuillRegistrationPath(name) ? name : `modules/${name}`;
|
|
114
|
+
};
|
|
115
|
+
const getModuleOptionName = (name) => {
|
|
116
|
+
const registrationName = getModuleRegistrationName(name);
|
|
117
|
+
const modulePrefix = 'modules/';
|
|
118
|
+
return registrationName.startsWith(modulePrefix)
|
|
119
|
+
? registrationName.slice(modulePrefix.length)
|
|
120
|
+
: undefined;
|
|
121
|
+
};
|
|
122
|
+
const globalRegistryPathPrefixes = new Set(['attributors', 'blots', 'formats']);
|
|
123
|
+
const usesParchmentRegistry = (name) => {
|
|
124
|
+
const [prefix] = name.split('/');
|
|
125
|
+
return globalRegistryPathPrefixes.has(prefix);
|
|
126
|
+
};
|
|
127
|
+
const getModuleOptions = (modules) => {
|
|
128
|
+
var _a;
|
|
129
|
+
const modulesOption = {};
|
|
130
|
+
const registrations = Array.isArray(modules) ? modules : [modules];
|
|
131
|
+
for (const module of registrations) {
|
|
132
|
+
const optionName = getModuleOptionName(module.name);
|
|
133
|
+
if (optionName)
|
|
134
|
+
modulesOption[optionName] = (_a = module.options) !== null && _a !== void 0 ? _a : {};
|
|
135
|
+
}
|
|
136
|
+
return Object.keys(modulesOption).length > 0 ? modulesOption : undefined;
|
|
137
|
+
};
|
|
138
|
+
const registerModule = (Quill, module, registry) => {
|
|
139
|
+
const moduleName = getModuleRegistrationName(module.name);
|
|
140
|
+
const quillImports = Quill.imports;
|
|
141
|
+
if (!quillImports || !(moduleName in quillImports)) {
|
|
142
|
+
Quill.register(moduleName, module.module);
|
|
143
|
+
}
|
|
144
|
+
if (registry && usesParchmentRegistry(moduleName)) {
|
|
145
|
+
registry.register(module.module);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
|
|
100
149
|
const QuillEditor = vue.defineComponent({
|
|
101
150
|
name: 'QuillEditor',
|
|
102
151
|
inheritAttrs: false,
|
|
@@ -131,9 +180,12 @@ const QuillEditor = vue.defineComponent({
|
|
|
131
180
|
},
|
|
132
181
|
},
|
|
133
182
|
toolbar: {
|
|
134
|
-
type: [String, Array, Object],
|
|
183
|
+
type: [String, Array, Object, Boolean],
|
|
135
184
|
required: false,
|
|
185
|
+
default: undefined,
|
|
136
186
|
validator: (value) => {
|
|
187
|
+
if (typeof value === 'boolean')
|
|
188
|
+
return value === false;
|
|
137
189
|
if (typeof value === 'string' && value !== '') {
|
|
138
190
|
return value.charAt(0) === '#'
|
|
139
191
|
? true
|
|
@@ -177,14 +229,6 @@ const QuillEditor = vue.defineComponent({
|
|
|
177
229
|
let quill;
|
|
178
230
|
let options;
|
|
179
231
|
const editor = vue.ref();
|
|
180
|
-
// Register Module if not already registered
|
|
181
|
-
const registerModule = (Quill, moduleName, module) => {
|
|
182
|
-
const quillImports = Quill.imports;
|
|
183
|
-
if (quillImports && moduleName in quillImports) {
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
Quill.register(moduleName, module);
|
|
187
|
-
};
|
|
188
232
|
// Initialize Quill
|
|
189
233
|
const initialize = async () => {
|
|
190
234
|
var _a, _b;
|
|
@@ -199,11 +243,11 @@ const QuillEditor = vue.defineComponent({
|
|
|
199
243
|
if (props.modules) {
|
|
200
244
|
if (Array.isArray(props.modules)) {
|
|
201
245
|
for (const module of props.modules) {
|
|
202
|
-
registerModule(Quill,
|
|
246
|
+
registerModule(Quill, module, options.registry);
|
|
203
247
|
}
|
|
204
248
|
}
|
|
205
249
|
else {
|
|
206
|
-
registerModule(Quill,
|
|
250
|
+
registerModule(Quill, props.modules, options.registry);
|
|
207
251
|
}
|
|
208
252
|
}
|
|
209
253
|
// Create new Quill instance
|
|
@@ -235,7 +279,12 @@ const QuillEditor = vue.defineComponent({
|
|
|
235
279
|
clientOptions.readOnly = props.readOnly;
|
|
236
280
|
if (props.placeholder)
|
|
237
281
|
clientOptions.placeholder = props.placeholder;
|
|
238
|
-
if (props.toolbar
|
|
282
|
+
if (props.toolbar === false) {
|
|
283
|
+
clientOptions.modules = {
|
|
284
|
+
toolbar: false,
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
else if (props.toolbar && props.toolbar !== '') {
|
|
239
288
|
clientOptions.modules = {
|
|
240
289
|
toolbar: (() => {
|
|
241
290
|
if (typeof props.toolbar === 'object') {
|
|
@@ -252,20 +301,10 @@ const QuillEditor = vue.defineComponent({
|
|
|
252
301
|
};
|
|
253
302
|
}
|
|
254
303
|
if (props.modules) {
|
|
255
|
-
const modules = (
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
for (const module of props.modules) {
|
|
260
|
-
modulesOption[module.name] = (_a = module.options) !== null && _a !== void 0 ? _a : {};
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
else {
|
|
264
|
-
modulesOption[props.modules.name] = (_b = props.modules.options) !== null && _b !== void 0 ? _b : {};
|
|
265
|
-
}
|
|
266
|
-
return modulesOption;
|
|
267
|
-
})();
|
|
268
|
-
clientOptions.modules = Object.assign({}, clientOptions.modules, modules);
|
|
304
|
+
const modules = getModuleOptions(props.modules);
|
|
305
|
+
if (modules) {
|
|
306
|
+
clientOptions.modules = Object.assign({}, clientOptions.modules, modules);
|
|
307
|
+
}
|
|
269
308
|
}
|
|
270
309
|
return Object.assign({}, props.globalOptions, props.options, clientOptions);
|
|
271
310
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VueQuill @vueup/vue-quill v1.5.
|
|
2
|
+
* VueQuill @vueup/vue-quill v1.5.2
|
|
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-
|
|
10
|
+
* Date: 2026-06-02T23:50:41.596Z
|
|
11
11
|
*/
|
|
12
|
-
"use strict";var e=require("quill-delta"),t=require("vue");const o={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 n,l,r=[];const i=()=>"undefined"!=typeof document,a=async()=>{if(n)return n;if(!i())throw new Error("@vueup/vue-quill: Quill can only be loaded in a browser environment.");return null!=l||(l=import("quill").then(({default:e})=>(n=e,(e=>{const t=r;r=[];for(const o of t)e.register(...o)})(e),e))),l},s=()=>{if(n)return n;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.")},u=new Proxy(function(){},{get(e,t){if("register"===t)return(...e)=>{if(n)return n.register(...e);r.push(e),i()&&a()};const o=s(),l=o[t];return"function"==typeof l?l.bind(o):l},construct:(e,t)=>new(s())(...t)}),d=t.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(o).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:(n,l)=>{t.onMounted(()=>{s=!1,
|
|
12
|
+
"use strict";var e=require("quill-delta"),t=require("vue");const o={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 n,l,r=[];const i=()=>"undefined"!=typeof document,a=async()=>{if(n)return n;if(!i())throw new Error("@vueup/vue-quill: Quill can only be loaded in a browser environment.");return null!=l||(l=import("quill").then(({default:e})=>(n=e,(e=>{const t=r;r=[];for(const o of t)e.register(...o)})(e),e))),l},s=()=>{if(n)return n;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.")},u=new Proxy(function(){},{get(e,t){if("register"===t)return(...e)=>{if(n)return n.register(...e);r.push(e),i()&&a()};const o=s(),l=o[t];return"function"==typeof l?l.bind(o):l},construct:(e,t)=>new(s())(...t)}),d=new Set(["attributors","blots","formats","modules","themes","ui"]),c=e=>(e=>{const[t]=e.split("/");return d.has(t)})(e)?e:`modules/${e}`,b=e=>{const t=c(e),o="modules/";return t.startsWith(o)?t.slice(8):void 0},p=new Set(["attributors","blots","formats"]),h=(e,t,o)=>{const n=c(t.name),l=e.imports;l&&n in l||e.register(n,t.module),o&&(e=>{const[t]=e.split("/");return p.has(t)})(n)&&o.register(t.module)},f=t.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,Boolean],required:!1,default:void 0,validator:e=>"boolean"==typeof e?!1===e:"string"!=typeof e||""===e||("#"===e.charAt(0)||-1!==Object.keys(o).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:(n,l)=>{t.onMounted(()=>{s=!1,d()}),t.onBeforeUnmount(()=>{r=null,s=!0});let r,i,s=!1;const u=t.ref(),d=async()=>{var e,t;if(!u.value)return;const o=u.value,d=await a();if(!s&&u.value&&u.value===o){if(i=c(),n.modules)if(Array.isArray(n.modules))for(const e of n.modules)h(d,e,i.registry);else h(d,n.modules,i.registry);r=new d(u.value,i),O(n.content),r.on("text-change",g),r.on("selection-change",w),r.on("editor-change",x),"bubble"!==n.theme&&u.value.classList.remove("ql-bubble"),"snow"!==n.theme&&u.value.classList.remove("ql-snow"),null===(t=null===(e=f())||void 0===e?void 0:e.container)||void 0===t||t.addEventListener("mousedown",e=>{e.preventDefault()}),l.emit("ready",r)}},c=()=>{const e={};if(""!==n.theme&&(e.theme=n.theme),n.readOnly&&(e.readOnly=n.readOnly),n.placeholder&&(e.placeholder=n.placeholder),!1===n.toolbar?e.modules={toolbar:!1}:n.toolbar&&""!==n.toolbar&&(e.modules={toolbar:(()=>{if("object"==typeof n.toolbar)return n.toolbar;if("string"==typeof n.toolbar){return"#"===n.toolbar.charAt(0)?n.toolbar:o[n.toolbar]}})()}),n.modules){const t=(e=>{var t;const o={},n=Array.isArray(e)?e:[e];for(const l of n){const e=b(l.name);e&&(o[e]=null!==(t=l.options)&&void 0!==t?t:{})}return Object.keys(o).length>0?o:void 0})(n.modules);t&&(e.modules=Object.assign({},e.modules,t))}return Object.assign({},n.globalOptions,n.options,e)},p=e=>"object"==typeof e&&e?e.slice():e,f=()=>null==r?void 0:r.getModule("toolbar");let v;const m=e=>{if(typeof v==typeof e){if(e===v)return!0;if("object"==typeof e&&e&&"object"==typeof v&&v)return t=v.diff(e),!Object.values(t.ops).some(e=>!e.retain||1!==Object.keys(e).length)}var t;return!1},g=(e,t,o)=>{v=p(T()),m(n.content)||l.emit("update:content",v),l.emit("textChange",{delta:e,oldContents:t,source:o})},y=t.ref(),w=(e,t,o)=>{y.value=!!(null==r?void 0:r.hasFocus()),l.emit("selectionChange",{range:e,oldRange:t,source:o})};t.watch(y,e=>{l.emit(e?"focus":"blur",u)});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]})},T=(e,t)=>"html"===n.contentType?k():"text"===n.contentType?q(e,t):null==r?void 0:r.getContents(e,t),O=(t,o="api")=>{const l=t||("delta"===n.contentType?new e:"");"html"===n.contentType?C(l):"text"===n.contentType?j(l,o):null==r||r.setContents(l,o),v=p(l)},q=(e,t)=>{var o;return null!==(o=null==r?void 0:r.getText(e,t))&&void 0!==o?o:""},j=(e,t="api")=>{null==r||r.setText(e,t)},k=()=>{var e;return null!==(e=null==r?void 0:r.root.innerHTML)&&void 0!==e?e:""},C=e=>{r&&(r.root.innerHTML=e)};return t.watch(()=>n.content,e=>{if(!r||!e||m(e))return;const o=r.getSelection();o&&t.nextTick(()=>null==r?void 0:r.setSelection(o)),O(e)},{deep:!0}),t.watch(()=>n.enable,e=>{r&&r.enable(e)}),{editor:u,getEditor:()=>u.value,getToolbar:()=>{var e;return null===(e=f())||void 0===e?void 0:e.container},getQuill:()=>{if(r)return r;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:T,setContents:O,getHTML:k,setHTML:C,pasteHTML:(e,t="api")=>{const o=null==r?void 0:r.clipboard.convert({html:e});o&&(null==r||r.setContents(o,t))},focus:()=>{null==r||r.focus()},getText:q,setText:j,reinit:()=>{t.nextTick(()=>{var e,t;!l.slots.toolbar&&r&&(null===(t=null===(e=f())||void 0===e?void 0:e.container)||void 0===t||t.remove()),d()})}}},render(){var e,o;return[null===(o=(e=this.$slots).toolbar)||void 0===o?void 0:o.call(e),t.h("div",{ref:"editor",...this.$attrs})]}});exports.Delta=e,exports.Quill=u,exports.QuillEditor=f,exports.getLoadedQuill=()=>n,exports.loadQuill=a;
|
package/dist/vue-quill.d.ts
CHANGED
|
@@ -56,8 +56,9 @@ default: string;
|
|
|
56
56
|
validator: (value: string) => boolean;
|
|
57
57
|
};
|
|
58
58
|
toolbar: {
|
|
59
|
-
type:
|
|
59
|
+
type: PropType<ToolbarPropType>;
|
|
60
60
|
required: false;
|
|
61
|
+
default: undefined;
|
|
61
62
|
validator: (value: string | unknown) => boolean;
|
|
62
63
|
};
|
|
63
64
|
modules: {
|
|
@@ -113,8 +114,9 @@ default: string;
|
|
|
113
114
|
validator: (value: string) => boolean;
|
|
114
115
|
};
|
|
115
116
|
toolbar: {
|
|
116
|
-
type:
|
|
117
|
+
type: PropType<ToolbarPropType>;
|
|
117
118
|
required: false;
|
|
119
|
+
default: undefined;
|
|
118
120
|
validator: (value: string | unknown) => boolean;
|
|
119
121
|
};
|
|
120
122
|
modules: {
|
|
@@ -142,6 +144,9 @@ contentType: "delta" | "html" | "text";
|
|
|
142
144
|
enable: boolean;
|
|
143
145
|
readOnly: boolean;
|
|
144
146
|
theme: "" | "snow" | "bubble";
|
|
147
|
+
toolbar: ToolbarPropType;
|
|
145
148
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
146
149
|
|
|
150
|
+
declare type ToolbarPropType = string | unknown[] | Record<string, unknown> | false;
|
|
151
|
+
|
|
147
152
|
export { }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VueQuill @vueup/vue-quill v1.5.
|
|
2
|
+
* VueQuill @vueup/vue-quill v1.5.2
|
|
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-
|
|
10
|
+
* Date: 2026-06-02T23:50:41.596Z
|
|
11
11
|
*/
|
|
12
12
|
import { defineComponent, h, onMounted, onBeforeUnmount, ref, watch, nextTick } from 'vue';
|
|
13
13
|
|
|
@@ -5596,6 +5596,55 @@ const Quill$1 = new Proxy(function QuillProxy() { }, {
|
|
|
5596
5596
|
},
|
|
5597
5597
|
});
|
|
5598
5598
|
|
|
5599
|
+
const quillRegistrationPathPrefixes = new Set([
|
|
5600
|
+
'attributors',
|
|
5601
|
+
'blots',
|
|
5602
|
+
'formats',
|
|
5603
|
+
'modules',
|
|
5604
|
+
'themes',
|
|
5605
|
+
'ui',
|
|
5606
|
+
]);
|
|
5607
|
+
const isQuillRegistrationPath = (name) => {
|
|
5608
|
+
const [prefix] = name.split('/');
|
|
5609
|
+
return quillRegistrationPathPrefixes.has(prefix);
|
|
5610
|
+
};
|
|
5611
|
+
const getModuleRegistrationName = (name) => {
|
|
5612
|
+
return isQuillRegistrationPath(name) ? name : `modules/${name}`;
|
|
5613
|
+
};
|
|
5614
|
+
const getModuleOptionName = (name) => {
|
|
5615
|
+
const registrationName = getModuleRegistrationName(name);
|
|
5616
|
+
const modulePrefix = 'modules/';
|
|
5617
|
+
return registrationName.startsWith(modulePrefix)
|
|
5618
|
+
? registrationName.slice(modulePrefix.length)
|
|
5619
|
+
: undefined;
|
|
5620
|
+
};
|
|
5621
|
+
const globalRegistryPathPrefixes = new Set(['attributors', 'blots', 'formats']);
|
|
5622
|
+
const usesParchmentRegistry = (name) => {
|
|
5623
|
+
const [prefix] = name.split('/');
|
|
5624
|
+
return globalRegistryPathPrefixes.has(prefix);
|
|
5625
|
+
};
|
|
5626
|
+
const getModuleOptions = (modules) => {
|
|
5627
|
+
var _a;
|
|
5628
|
+
const modulesOption = {};
|
|
5629
|
+
const registrations = Array.isArray(modules) ? modules : [modules];
|
|
5630
|
+
for (const module of registrations) {
|
|
5631
|
+
const optionName = getModuleOptionName(module.name);
|
|
5632
|
+
if (optionName)
|
|
5633
|
+
modulesOption[optionName] = (_a = module.options) !== null && _a !== void 0 ? _a : {};
|
|
5634
|
+
}
|
|
5635
|
+
return Object.keys(modulesOption).length > 0 ? modulesOption : undefined;
|
|
5636
|
+
};
|
|
5637
|
+
const registerModule = (Quill, module, registry) => {
|
|
5638
|
+
const moduleName = getModuleRegistrationName(module.name);
|
|
5639
|
+
const quillImports = Quill.imports;
|
|
5640
|
+
if (!quillImports || !(moduleName in quillImports)) {
|
|
5641
|
+
Quill.register(moduleName, module.module);
|
|
5642
|
+
}
|
|
5643
|
+
if (registry && usesParchmentRegistry(moduleName)) {
|
|
5644
|
+
registry.register(module.module);
|
|
5645
|
+
}
|
|
5646
|
+
};
|
|
5647
|
+
|
|
5599
5648
|
const QuillEditor = defineComponent({
|
|
5600
5649
|
name: 'QuillEditor',
|
|
5601
5650
|
inheritAttrs: false,
|
|
@@ -5630,9 +5679,12 @@ const QuillEditor = defineComponent({
|
|
|
5630
5679
|
},
|
|
5631
5680
|
},
|
|
5632
5681
|
toolbar: {
|
|
5633
|
-
type: [String, Array, Object],
|
|
5682
|
+
type: [String, Array, Object, Boolean],
|
|
5634
5683
|
required: false,
|
|
5684
|
+
default: undefined,
|
|
5635
5685
|
validator: (value) => {
|
|
5686
|
+
if (typeof value === 'boolean')
|
|
5687
|
+
return value === false;
|
|
5636
5688
|
if (typeof value === 'string' && value !== '') {
|
|
5637
5689
|
return value.charAt(0) === '#'
|
|
5638
5690
|
? true
|
|
@@ -5676,14 +5728,6 @@ const QuillEditor = defineComponent({
|
|
|
5676
5728
|
let quill;
|
|
5677
5729
|
let options;
|
|
5678
5730
|
const editor = ref();
|
|
5679
|
-
// Register Module if not already registered
|
|
5680
|
-
const registerModule = (Quill, moduleName, module) => {
|
|
5681
|
-
const quillImports = Quill.imports;
|
|
5682
|
-
if (quillImports && moduleName in quillImports) {
|
|
5683
|
-
return;
|
|
5684
|
-
}
|
|
5685
|
-
Quill.register(moduleName, module);
|
|
5686
|
-
};
|
|
5687
5731
|
// Initialize Quill
|
|
5688
5732
|
const initialize = async () => {
|
|
5689
5733
|
var _a, _b;
|
|
@@ -5698,11 +5742,11 @@ const QuillEditor = defineComponent({
|
|
|
5698
5742
|
if (props.modules) {
|
|
5699
5743
|
if (Array.isArray(props.modules)) {
|
|
5700
5744
|
for (const module of props.modules) {
|
|
5701
|
-
registerModule(Quill,
|
|
5745
|
+
registerModule(Quill, module, options.registry);
|
|
5702
5746
|
}
|
|
5703
5747
|
}
|
|
5704
5748
|
else {
|
|
5705
|
-
registerModule(Quill,
|
|
5749
|
+
registerModule(Quill, props.modules, options.registry);
|
|
5706
5750
|
}
|
|
5707
5751
|
}
|
|
5708
5752
|
// Create new Quill instance
|
|
@@ -5734,7 +5778,12 @@ const QuillEditor = defineComponent({
|
|
|
5734
5778
|
clientOptions.readOnly = props.readOnly;
|
|
5735
5779
|
if (props.placeholder)
|
|
5736
5780
|
clientOptions.placeholder = props.placeholder;
|
|
5737
|
-
if (props.toolbar
|
|
5781
|
+
if (props.toolbar === false) {
|
|
5782
|
+
clientOptions.modules = {
|
|
5783
|
+
toolbar: false,
|
|
5784
|
+
};
|
|
5785
|
+
}
|
|
5786
|
+
else if (props.toolbar && props.toolbar !== '') {
|
|
5738
5787
|
clientOptions.modules = {
|
|
5739
5788
|
toolbar: (() => {
|
|
5740
5789
|
if (typeof props.toolbar === 'object') {
|
|
@@ -5751,20 +5800,10 @@ const QuillEditor = defineComponent({
|
|
|
5751
5800
|
};
|
|
5752
5801
|
}
|
|
5753
5802
|
if (props.modules) {
|
|
5754
|
-
const modules = (
|
|
5755
|
-
|
|
5756
|
-
|
|
5757
|
-
|
|
5758
|
-
for (const module of props.modules) {
|
|
5759
|
-
modulesOption[module.name] = (_a = module.options) !== null && _a !== void 0 ? _a : {};
|
|
5760
|
-
}
|
|
5761
|
-
}
|
|
5762
|
-
else {
|
|
5763
|
-
modulesOption[props.modules.name] = (_b = props.modules.options) !== null && _b !== void 0 ? _b : {};
|
|
5764
|
-
}
|
|
5765
|
-
return modulesOption;
|
|
5766
|
-
})();
|
|
5767
|
-
clientOptions.modules = Object.assign({}, clientOptions.modules, modules);
|
|
5803
|
+
const modules = getModuleOptions(props.modules);
|
|
5804
|
+
if (modules) {
|
|
5805
|
+
clientOptions.modules = Object.assign({}, clientOptions.modules, modules);
|
|
5806
|
+
}
|
|
5768
5807
|
}
|
|
5769
5808
|
return Object.assign({}, props.globalOptions, props.options, clientOptions);
|
|
5770
5809
|
};
|
|
@@ -7936,7 +7975,7 @@ var DataView = getNative(root, 'DataView');
|
|
|
7936
7975
|
var Promise$1 = getNative(root, 'Promise');
|
|
7937
7976
|
|
|
7938
7977
|
/* Built-in method references that are verified to be native. */
|
|
7939
|
-
var Set = getNative(root, 'Set');
|
|
7978
|
+
var Set$1 = getNative(root, 'Set');
|
|
7940
7979
|
|
|
7941
7980
|
/** `Object#toString` result references. */
|
|
7942
7981
|
var mapTag$4 = '[object Map]',
|
|
@@ -7951,7 +7990,7 @@ var dataViewTag$3 = '[object DataView]';
|
|
|
7951
7990
|
var dataViewCtorString = toSource(DataView),
|
|
7952
7991
|
mapCtorString = toSource(Map),
|
|
7953
7992
|
promiseCtorString = toSource(Promise$1),
|
|
7954
|
-
setCtorString = toSource(Set),
|
|
7993
|
+
setCtorString = toSource(Set$1),
|
|
7955
7994
|
weakMapCtorString = toSource(WeakMap$1);
|
|
7956
7995
|
|
|
7957
7996
|
/**
|
|
@@ -7967,7 +8006,7 @@ var getTag = baseGetTag;
|
|
|
7967
8006
|
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag$3) ||
|
|
7968
8007
|
(Map && getTag(new Map) != mapTag$4) ||
|
|
7969
8008
|
(Promise$1 && getTag(Promise$1.resolve()) != promiseTag) ||
|
|
7970
|
-
(Set && getTag(new Set) != setTag$4) ||
|
|
8009
|
+
(Set$1 && getTag(new Set$1) != setTag$4) ||
|
|
7971
8010
|
(WeakMap$1 && getTag(new WeakMap$1) != weakMapTag$1)) {
|
|
7972
8011
|
getTag = function(value) {
|
|
7973
8012
|
var result = baseGetTag(value),
|