@tailor-cms/ce-quill-html-edit 0.0.7 → 0.1.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/components/Edit.vue.d.ts +5 -7
- package/dist/components/QuillEditor.vue.d.ts +1 -71
- package/dist/components/TopToolbar.vue.d.ts +1 -1
- package/dist/components/theme/index.d.ts +2 -1
- package/dist/index.cjs +364 -472
- package/dist/index.css +6 -6
- package/dist/index.js +364 -472
- package/package.json +19 -16
- package/dist/components/Edit.vue.js +0 -106
- package/dist/components/QuillEditor.vue.js +0 -117
- package/dist/components/TopToolbar.vue.js +0 -214
- package/dist/components/theme/index.js +0 -157
- package/dist/components/theme/modules/image-embed.js +0 -18
- package/dist/components/theme/toolbar-icons.js +0 -69
- package/dist/components/theme/ui/color-picker.js +0 -54
- package/dist/components/theme/ui/image-embed-tooltip.js +0 -84
- package/dist/components/theme/ui/tooltip.js +0 -31
package/dist/index.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
1
|
import "./index.css";
|
|
5
2
|
import { defineComponent, ref, createElementBlock, watch, onBeforeUnmount, openBlock, onMounted, createBlock, unref, computed, createElementVNode, withModifiers, createStaticVNode } from "vue";
|
|
6
3
|
var type = "HTML";
|
|
@@ -23,203 +20,6 @@ var manifest$1 = {
|
|
|
23
20
|
ui
|
|
24
21
|
};
|
|
25
22
|
var index_default = manifest$1;
|
|
26
|
-
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
27
|
-
function getDefaultExportFromCjs(x) {
|
|
28
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
29
|
-
}
|
|
30
|
-
function isObject$3(value) {
|
|
31
|
-
var type2 = typeof value;
|
|
32
|
-
return value != null && (type2 == "object" || type2 == "function");
|
|
33
|
-
}
|
|
34
|
-
var isObject_1 = isObject$3;
|
|
35
|
-
var freeGlobal$2 = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
36
|
-
var _freeGlobal = freeGlobal$2;
|
|
37
|
-
var freeGlobal$1 = _freeGlobal;
|
|
38
|
-
var freeSelf$1 = typeof self == "object" && self && self.Object === Object && self;
|
|
39
|
-
var root$3 = freeGlobal$1 || freeSelf$1 || Function("return this")();
|
|
40
|
-
var _root = root$3;
|
|
41
|
-
var root$2 = _root;
|
|
42
|
-
var now$1 = function() {
|
|
43
|
-
return root$2.Date.now();
|
|
44
|
-
};
|
|
45
|
-
var now_1 = now$1;
|
|
46
|
-
var reWhitespace = /\s/;
|
|
47
|
-
function trimmedEndIndex$1(string) {
|
|
48
|
-
var index = string.length;
|
|
49
|
-
while (index-- && reWhitespace.test(string.charAt(index))) {
|
|
50
|
-
}
|
|
51
|
-
return index;
|
|
52
|
-
}
|
|
53
|
-
var _trimmedEndIndex = trimmedEndIndex$1;
|
|
54
|
-
var trimmedEndIndex = _trimmedEndIndex;
|
|
55
|
-
var reTrimStart = /^\s+/;
|
|
56
|
-
function baseTrim$1(string) {
|
|
57
|
-
return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
|
|
58
|
-
}
|
|
59
|
-
var _baseTrim = baseTrim$1;
|
|
60
|
-
var root$1 = _root;
|
|
61
|
-
var Symbol$4 = root$1.Symbol;
|
|
62
|
-
var _Symbol = Symbol$4;
|
|
63
|
-
var Symbol$3 = _Symbol;
|
|
64
|
-
var objectProto$h = Object.prototype;
|
|
65
|
-
var hasOwnProperty$e = objectProto$h.hasOwnProperty;
|
|
66
|
-
var nativeObjectToString$3 = objectProto$h.toString;
|
|
67
|
-
var symToStringTag$3 = Symbol$3 ? Symbol$3.toStringTag : void 0;
|
|
68
|
-
function getRawTag$2(value) {
|
|
69
|
-
var isOwn = hasOwnProperty$e.call(value, symToStringTag$3), tag = value[symToStringTag$3];
|
|
70
|
-
try {
|
|
71
|
-
value[symToStringTag$3] = void 0;
|
|
72
|
-
var unmasked = true;
|
|
73
|
-
} catch (e) {
|
|
74
|
-
}
|
|
75
|
-
var result = nativeObjectToString$3.call(value);
|
|
76
|
-
if (unmasked) {
|
|
77
|
-
if (isOwn) {
|
|
78
|
-
value[symToStringTag$3] = tag;
|
|
79
|
-
} else {
|
|
80
|
-
delete value[symToStringTag$3];
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return result;
|
|
84
|
-
}
|
|
85
|
-
var _getRawTag = getRawTag$2;
|
|
86
|
-
var objectProto$g = Object.prototype;
|
|
87
|
-
var nativeObjectToString$2 = objectProto$g.toString;
|
|
88
|
-
function objectToString$2(value) {
|
|
89
|
-
return nativeObjectToString$2.call(value);
|
|
90
|
-
}
|
|
91
|
-
var _objectToString = objectToString$2;
|
|
92
|
-
var Symbol$2 = _Symbol, getRawTag$1 = _getRawTag, objectToString$1 = _objectToString;
|
|
93
|
-
var nullTag$1 = "[object Null]", undefinedTag$1 = "[object Undefined]";
|
|
94
|
-
var symToStringTag$2 = Symbol$2 ? Symbol$2.toStringTag : void 0;
|
|
95
|
-
function baseGetTag$2(value) {
|
|
96
|
-
if (value == null) {
|
|
97
|
-
return value === void 0 ? undefinedTag$1 : nullTag$1;
|
|
98
|
-
}
|
|
99
|
-
return symToStringTag$2 && symToStringTag$2 in Object(value) ? getRawTag$1(value) : objectToString$1(value);
|
|
100
|
-
}
|
|
101
|
-
var _baseGetTag = baseGetTag$2;
|
|
102
|
-
function isObjectLike$2(value) {
|
|
103
|
-
return value != null && typeof value == "object";
|
|
104
|
-
}
|
|
105
|
-
var isObjectLike_1 = isObjectLike$2;
|
|
106
|
-
var baseGetTag$1 = _baseGetTag, isObjectLike$1 = isObjectLike_1;
|
|
107
|
-
var symbolTag$3 = "[object Symbol]";
|
|
108
|
-
function isSymbol$1(value) {
|
|
109
|
-
return typeof value == "symbol" || isObjectLike$1(value) && baseGetTag$1(value) == symbolTag$3;
|
|
110
|
-
}
|
|
111
|
-
var isSymbol_1 = isSymbol$1;
|
|
112
|
-
var baseTrim = _baseTrim, isObject$2 = isObject_1, isSymbol = isSymbol_1;
|
|
113
|
-
var NAN = 0 / 0;
|
|
114
|
-
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
|
115
|
-
var reIsBinary = /^0b[01]+$/i;
|
|
116
|
-
var reIsOctal = /^0o[0-7]+$/i;
|
|
117
|
-
var freeParseInt = parseInt;
|
|
118
|
-
function toNumber$1(value) {
|
|
119
|
-
if (typeof value == "number") {
|
|
120
|
-
return value;
|
|
121
|
-
}
|
|
122
|
-
if (isSymbol(value)) {
|
|
123
|
-
return NAN;
|
|
124
|
-
}
|
|
125
|
-
if (isObject$2(value)) {
|
|
126
|
-
var other = typeof value.valueOf == "function" ? value.valueOf() : value;
|
|
127
|
-
value = isObject$2(other) ? other + "" : other;
|
|
128
|
-
}
|
|
129
|
-
if (typeof value != "string") {
|
|
130
|
-
return value === 0 ? value : +value;
|
|
131
|
-
}
|
|
132
|
-
value = baseTrim(value);
|
|
133
|
-
var isBinary = reIsBinary.test(value);
|
|
134
|
-
return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
|
|
135
|
-
}
|
|
136
|
-
var toNumber_1 = toNumber$1;
|
|
137
|
-
var isObject$1 = isObject_1, now = now_1, toNumber = toNumber_1;
|
|
138
|
-
var FUNC_ERROR_TEXT = "Expected a function";
|
|
139
|
-
var nativeMax$1 = Math.max, nativeMin = Math.min;
|
|
140
|
-
function debounce$2(func, wait, options) {
|
|
141
|
-
var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
|
|
142
|
-
if (typeof func != "function") {
|
|
143
|
-
throw new TypeError(FUNC_ERROR_TEXT);
|
|
144
|
-
}
|
|
145
|
-
wait = toNumber(wait) || 0;
|
|
146
|
-
if (isObject$1(options)) {
|
|
147
|
-
leading = !!options.leading;
|
|
148
|
-
maxing = "maxWait" in options;
|
|
149
|
-
maxWait = maxing ? nativeMax$1(toNumber(options.maxWait) || 0, wait) : maxWait;
|
|
150
|
-
trailing = "trailing" in options ? !!options.trailing : trailing;
|
|
151
|
-
}
|
|
152
|
-
function invokeFunc(time) {
|
|
153
|
-
var args = lastArgs, thisArg = lastThis;
|
|
154
|
-
lastArgs = lastThis = void 0;
|
|
155
|
-
lastInvokeTime = time;
|
|
156
|
-
result = func.apply(thisArg, args);
|
|
157
|
-
return result;
|
|
158
|
-
}
|
|
159
|
-
function leadingEdge(time) {
|
|
160
|
-
lastInvokeTime = time;
|
|
161
|
-
timerId = setTimeout(timerExpired, wait);
|
|
162
|
-
return leading ? invokeFunc(time) : result;
|
|
163
|
-
}
|
|
164
|
-
function remainingWait(time) {
|
|
165
|
-
var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
|
|
166
|
-
return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
|
|
167
|
-
}
|
|
168
|
-
function shouldInvoke(time) {
|
|
169
|
-
var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
|
|
170
|
-
return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
|
|
171
|
-
}
|
|
172
|
-
function timerExpired() {
|
|
173
|
-
var time = now();
|
|
174
|
-
if (shouldInvoke(time)) {
|
|
175
|
-
return trailingEdge(time);
|
|
176
|
-
}
|
|
177
|
-
timerId = setTimeout(timerExpired, remainingWait(time));
|
|
178
|
-
}
|
|
179
|
-
function trailingEdge(time) {
|
|
180
|
-
timerId = void 0;
|
|
181
|
-
if (trailing && lastArgs) {
|
|
182
|
-
return invokeFunc(time);
|
|
183
|
-
}
|
|
184
|
-
lastArgs = lastThis = void 0;
|
|
185
|
-
return result;
|
|
186
|
-
}
|
|
187
|
-
function cancel() {
|
|
188
|
-
if (timerId !== void 0) {
|
|
189
|
-
clearTimeout(timerId);
|
|
190
|
-
}
|
|
191
|
-
lastInvokeTime = 0;
|
|
192
|
-
lastArgs = lastCallTime = lastThis = timerId = void 0;
|
|
193
|
-
}
|
|
194
|
-
function flush() {
|
|
195
|
-
return timerId === void 0 ? result : trailingEdge(now());
|
|
196
|
-
}
|
|
197
|
-
function debounced() {
|
|
198
|
-
var time = now(), isInvoking = shouldInvoke(time);
|
|
199
|
-
lastArgs = arguments;
|
|
200
|
-
lastThis = this;
|
|
201
|
-
lastCallTime = time;
|
|
202
|
-
if (isInvoking) {
|
|
203
|
-
if (timerId === void 0) {
|
|
204
|
-
return leadingEdge(lastCallTime);
|
|
205
|
-
}
|
|
206
|
-
if (maxing) {
|
|
207
|
-
clearTimeout(timerId);
|
|
208
|
-
timerId = setTimeout(timerExpired, wait);
|
|
209
|
-
return invokeFunc(lastCallTime);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
if (timerId === void 0) {
|
|
213
|
-
timerId = setTimeout(timerExpired, wait);
|
|
214
|
-
}
|
|
215
|
-
return result;
|
|
216
|
-
}
|
|
217
|
-
debounced.cancel = cancel;
|
|
218
|
-
debounced.flush = flush;
|
|
219
|
-
return debounced;
|
|
220
|
-
}
|
|
221
|
-
var debounce_1 = debounce$2;
|
|
222
|
-
const debounce$3 = /* @__PURE__ */ getDefaultExportFromCjs(debounce_1);
|
|
223
23
|
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
224
24
|
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
225
25
|
var root = freeGlobal || freeSelf || Function("return this")();
|
|
@@ -261,11 +61,49 @@ function baseGetTag(value) {
|
|
|
261
61
|
function isObjectLike(value) {
|
|
262
62
|
return value != null && typeof value == "object";
|
|
263
63
|
}
|
|
64
|
+
var symbolTag$3 = "[object Symbol]";
|
|
65
|
+
function isSymbol(value) {
|
|
66
|
+
return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag$3;
|
|
67
|
+
}
|
|
264
68
|
var isArray = Array.isArray;
|
|
69
|
+
var reWhitespace = /\s/;
|
|
70
|
+
function trimmedEndIndex(string) {
|
|
71
|
+
var index = string.length;
|
|
72
|
+
while (index-- && reWhitespace.test(string.charAt(index))) {
|
|
73
|
+
}
|
|
74
|
+
return index;
|
|
75
|
+
}
|
|
76
|
+
var reTrimStart = /^\s+/;
|
|
77
|
+
function baseTrim(string) {
|
|
78
|
+
return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
|
|
79
|
+
}
|
|
265
80
|
function isObject(value) {
|
|
266
81
|
var type2 = typeof value;
|
|
267
82
|
return value != null && (type2 == "object" || type2 == "function");
|
|
268
83
|
}
|
|
84
|
+
var NAN = 0 / 0;
|
|
85
|
+
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
|
86
|
+
var reIsBinary = /^0b[01]+$/i;
|
|
87
|
+
var reIsOctal = /^0o[0-7]+$/i;
|
|
88
|
+
var freeParseInt = parseInt;
|
|
89
|
+
function toNumber(value) {
|
|
90
|
+
if (typeof value == "number") {
|
|
91
|
+
return value;
|
|
92
|
+
}
|
|
93
|
+
if (isSymbol(value)) {
|
|
94
|
+
return NAN;
|
|
95
|
+
}
|
|
96
|
+
if (isObject(value)) {
|
|
97
|
+
var other = typeof value.valueOf == "function" ? value.valueOf() : value;
|
|
98
|
+
value = isObject(other) ? other + "" : other;
|
|
99
|
+
}
|
|
100
|
+
if (typeof value != "string") {
|
|
101
|
+
return value === 0 ? value : +value;
|
|
102
|
+
}
|
|
103
|
+
value = baseTrim(value);
|
|
104
|
+
var isBinary = reIsBinary.test(value);
|
|
105
|
+
return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
|
|
106
|
+
}
|
|
269
107
|
function identity(value) {
|
|
270
108
|
return value;
|
|
271
109
|
}
|
|
@@ -457,11 +295,11 @@ function copyObject(source, props, object, customizer) {
|
|
|
457
295
|
}
|
|
458
296
|
return object;
|
|
459
297
|
}
|
|
460
|
-
var nativeMax = Math.max;
|
|
298
|
+
var nativeMax$1 = Math.max;
|
|
461
299
|
function overRest(func, start2, transform) {
|
|
462
|
-
start2 = nativeMax(start2 === void 0 ? func.length - 1 : start2, 0);
|
|
300
|
+
start2 = nativeMax$1(start2 === void 0 ? func.length - 1 : start2, 0);
|
|
463
301
|
return function() {
|
|
464
|
-
var args = arguments, index = -1, length = nativeMax(args.length - start2, 0), array = Array(length);
|
|
302
|
+
var args = arguments, index = -1, length = nativeMax$1(args.length - start2, 0), array = Array(length);
|
|
465
303
|
while (++index < length) {
|
|
466
304
|
array[index] = args[start2 + index];
|
|
467
305
|
}
|
|
@@ -858,7 +696,7 @@ Stack.prototype.set = stackSet;
|
|
|
858
696
|
var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
|
|
859
697
|
var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
|
|
860
698
|
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
861
|
-
var
|
|
699
|
+
var Buffer = moduleExports ? root.Buffer : void 0, allocUnsafe = Buffer ? Buffer.allocUnsafe : void 0;
|
|
862
700
|
function cloneBuffer(buffer, isDeep) {
|
|
863
701
|
if (isDeep) {
|
|
864
702
|
return buffer.slice();
|
|
@@ -936,10 +774,10 @@ function initCloneArray(array) {
|
|
|
936
774
|
}
|
|
937
775
|
return result;
|
|
938
776
|
}
|
|
939
|
-
var
|
|
777
|
+
var Uint8Array = root.Uint8Array;
|
|
940
778
|
function cloneArrayBuffer(arrayBuffer) {
|
|
941
779
|
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
|
942
|
-
new
|
|
780
|
+
new Uint8Array(result).set(new Uint8Array(arrayBuffer));
|
|
943
781
|
return result;
|
|
944
782
|
}
|
|
945
783
|
function cloneDataView(dataView, isDeep) {
|
|
@@ -1171,7 +1009,7 @@ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
|
|
|
1171
1009
|
object = object.buffer;
|
|
1172
1010
|
other = other.buffer;
|
|
1173
1011
|
case arrayBufferTag:
|
|
1174
|
-
if (object.byteLength != other.byteLength || !equalFunc(new
|
|
1012
|
+
if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
|
|
1175
1013
|
return false;
|
|
1176
1014
|
}
|
|
1177
1015
|
return true;
|
|
@@ -1310,6 +1148,92 @@ function createBaseFor(fromRight) {
|
|
|
1310
1148
|
};
|
|
1311
1149
|
}
|
|
1312
1150
|
var baseFor = createBaseFor();
|
|
1151
|
+
var now = function() {
|
|
1152
|
+
return root.Date.now();
|
|
1153
|
+
};
|
|
1154
|
+
var FUNC_ERROR_TEXT = "Expected a function";
|
|
1155
|
+
var nativeMax = Math.max, nativeMin = Math.min;
|
|
1156
|
+
function debounce$2(func, wait, options) {
|
|
1157
|
+
var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
|
|
1158
|
+
if (typeof func != "function") {
|
|
1159
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
1160
|
+
}
|
|
1161
|
+
wait = toNumber(wait) || 0;
|
|
1162
|
+
if (isObject(options)) {
|
|
1163
|
+
leading = !!options.leading;
|
|
1164
|
+
maxing = "maxWait" in options;
|
|
1165
|
+
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
|
|
1166
|
+
trailing = "trailing" in options ? !!options.trailing : trailing;
|
|
1167
|
+
}
|
|
1168
|
+
function invokeFunc(time) {
|
|
1169
|
+
var args = lastArgs, thisArg = lastThis;
|
|
1170
|
+
lastArgs = lastThis = void 0;
|
|
1171
|
+
lastInvokeTime = time;
|
|
1172
|
+
result = func.apply(thisArg, args);
|
|
1173
|
+
return result;
|
|
1174
|
+
}
|
|
1175
|
+
function leadingEdge(time) {
|
|
1176
|
+
lastInvokeTime = time;
|
|
1177
|
+
timerId = setTimeout(timerExpired, wait);
|
|
1178
|
+
return leading ? invokeFunc(time) : result;
|
|
1179
|
+
}
|
|
1180
|
+
function remainingWait(time) {
|
|
1181
|
+
var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
|
|
1182
|
+
return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
|
|
1183
|
+
}
|
|
1184
|
+
function shouldInvoke(time) {
|
|
1185
|
+
var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
|
|
1186
|
+
return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
|
|
1187
|
+
}
|
|
1188
|
+
function timerExpired() {
|
|
1189
|
+
var time = now();
|
|
1190
|
+
if (shouldInvoke(time)) {
|
|
1191
|
+
return trailingEdge(time);
|
|
1192
|
+
}
|
|
1193
|
+
timerId = setTimeout(timerExpired, remainingWait(time));
|
|
1194
|
+
}
|
|
1195
|
+
function trailingEdge(time) {
|
|
1196
|
+
timerId = void 0;
|
|
1197
|
+
if (trailing && lastArgs) {
|
|
1198
|
+
return invokeFunc(time);
|
|
1199
|
+
}
|
|
1200
|
+
lastArgs = lastThis = void 0;
|
|
1201
|
+
return result;
|
|
1202
|
+
}
|
|
1203
|
+
function cancel() {
|
|
1204
|
+
if (timerId !== void 0) {
|
|
1205
|
+
clearTimeout(timerId);
|
|
1206
|
+
}
|
|
1207
|
+
lastInvokeTime = 0;
|
|
1208
|
+
lastArgs = lastCallTime = lastThis = timerId = void 0;
|
|
1209
|
+
}
|
|
1210
|
+
function flush() {
|
|
1211
|
+
return timerId === void 0 ? result : trailingEdge(now());
|
|
1212
|
+
}
|
|
1213
|
+
function debounced() {
|
|
1214
|
+
var time = now(), isInvoking = shouldInvoke(time);
|
|
1215
|
+
lastArgs = arguments;
|
|
1216
|
+
lastThis = this;
|
|
1217
|
+
lastCallTime = time;
|
|
1218
|
+
if (isInvoking) {
|
|
1219
|
+
if (timerId === void 0) {
|
|
1220
|
+
return leadingEdge(lastCallTime);
|
|
1221
|
+
}
|
|
1222
|
+
if (maxing) {
|
|
1223
|
+
clearTimeout(timerId);
|
|
1224
|
+
timerId = setTimeout(timerExpired, wait);
|
|
1225
|
+
return invokeFunc(lastCallTime);
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
if (timerId === void 0) {
|
|
1229
|
+
timerId = setTimeout(timerExpired, wait);
|
|
1230
|
+
}
|
|
1231
|
+
return result;
|
|
1232
|
+
}
|
|
1233
|
+
debounced.cancel = cancel;
|
|
1234
|
+
debounced.flush = flush;
|
|
1235
|
+
return debounced;
|
|
1236
|
+
}
|
|
1313
1237
|
function assignMergeValue(object, key, value) {
|
|
1314
1238
|
if (value !== void 0 && !eq(object[key], value) || value === void 0 && !(key in object)) {
|
|
1315
1239
|
baseAssignValue(object, key, value);
|
|
@@ -2243,6 +2167,10 @@ const Parchment = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePro
|
|
|
2243
2167
|
StyleAttributor: StyleAttributor$1,
|
|
2244
2168
|
TextBlot: TextBlot$1
|
|
2245
2169
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2170
|
+
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
2171
|
+
function getDefaultExportFromCjs(x) {
|
|
2172
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
2173
|
+
}
|
|
2246
2174
|
var Delta$1 = { exports: {} };
|
|
2247
2175
|
var DIFF_DELETE = -1;
|
|
2248
2176
|
var DIFF_INSERT = 1;
|
|
@@ -3109,8 +3037,8 @@ lodash_clonedeep.exports;
|
|
|
3109
3037
|
var reIsNative2 = RegExp(
|
|
3110
3038
|
"^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar2, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
3111
3039
|
);
|
|
3112
|
-
var
|
|
3113
|
-
var nativeGetSymbols2 = Object.getOwnPropertySymbols, nativeIsBuffer2 =
|
|
3040
|
+
var Buffer2 = moduleExports2 ? root2.Buffer : void 0, Symbol2 = root2.Symbol, Uint8Array2 = root2.Uint8Array, getPrototype2 = overArg2(Object.getPrototypeOf, Object), objectCreate2 = Object.create, propertyIsEnumerable2 = objectProto2.propertyIsEnumerable, splice2 = arrayProto2.splice;
|
|
3041
|
+
var nativeGetSymbols2 = Object.getOwnPropertySymbols, nativeIsBuffer2 = Buffer2 ? Buffer2.isBuffer : void 0, nativeKeys2 = overArg2(Object.keys, Object);
|
|
3114
3042
|
var DataView2 = getNative2(root2, "DataView"), Map2 = getNative2(root2, "Map"), Promise2 = getNative2(root2, "Promise"), Set2 = getNative2(root2, "Set"), WeakMap2 = getNative2(root2, "WeakMap"), nativeCreate2 = getNative2(Object, "create");
|
|
3115
3043
|
var dataViewCtorString2 = toSource2(DataView2), mapCtorString2 = toSource2(Map2), promiseCtorString2 = toSource2(Promise2), setCtorString2 = toSource2(Set2), weakMapCtorString2 = toSource2(WeakMap2);
|
|
3116
3044
|
var symbolProto2 = Symbol2 ? Symbol2.prototype : void 0, symbolValueOf2 = symbolProto2 ? symbolProto2.valueOf : void 0;
|
|
@@ -3383,7 +3311,7 @@ lodash_clonedeep.exports;
|
|
|
3383
3311
|
}
|
|
3384
3312
|
function cloneArrayBuffer2(arrayBuffer) {
|
|
3385
3313
|
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
|
3386
|
-
new
|
|
3314
|
+
new Uint8Array2(result).set(new Uint8Array2(arrayBuffer));
|
|
3387
3315
|
return result;
|
|
3388
3316
|
}
|
|
3389
3317
|
function cloneDataView2(dataView, isDeep) {
|
|
@@ -3683,8 +3611,8 @@ lodash_isequal.exports;
|
|
|
3683
3611
|
var reIsNative2 = RegExp(
|
|
3684
3612
|
"^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar2, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
3685
3613
|
);
|
|
3686
|
-
var
|
|
3687
|
-
var nativeGetSymbols2 = Object.getOwnPropertySymbols, nativeIsBuffer2 =
|
|
3614
|
+
var Buffer2 = moduleExports2 ? root2.Buffer : void 0, Symbol2 = root2.Symbol, Uint8Array2 = root2.Uint8Array, propertyIsEnumerable2 = objectProto2.propertyIsEnumerable, splice2 = arrayProto2.splice, symToStringTag2 = Symbol2 ? Symbol2.toStringTag : void 0;
|
|
3615
|
+
var nativeGetSymbols2 = Object.getOwnPropertySymbols, nativeIsBuffer2 = Buffer2 ? Buffer2.isBuffer : void 0, nativeKeys2 = overArg2(Object.keys, Object);
|
|
3688
3616
|
var DataView2 = getNative2(root2, "DataView"), Map2 = getNative2(root2, "Map"), Promise2 = getNative2(root2, "Promise"), Set2 = getNative2(root2, "Set"), WeakMap2 = getNative2(root2, "WeakMap"), nativeCreate2 = getNative2(Object, "create");
|
|
3689
3617
|
var dataViewCtorString2 = toSource2(DataView2), mapCtorString2 = toSource2(Map2), promiseCtorString2 = toSource2(Promise2), setCtorString2 = toSource2(Set2), weakMapCtorString2 = toSource2(WeakMap2);
|
|
3690
3618
|
var symbolProto2 = Symbol2 ? Symbol2.prototype : void 0, symbolValueOf2 = symbolProto2 ? symbolProto2.valueOf : void 0;
|
|
@@ -4016,7 +3944,7 @@ lodash_isequal.exports;
|
|
|
4016
3944
|
object = object.buffer;
|
|
4017
3945
|
other = other.buffer;
|
|
4018
3946
|
case arrayBufferTag2:
|
|
4019
|
-
if (object.byteLength != other.byteLength || !equalFunc(new
|
|
3947
|
+
if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
|
|
4020
3948
|
return false;
|
|
4021
3949
|
}
|
|
4022
3950
|
return true;
|
|
@@ -4873,10 +4801,26 @@ const entityMap = {
|
|
|
4873
4801
|
function escapeText(text) {
|
|
4874
4802
|
return text.replace(/[&<>"']/g, (s) => entityMap[s]);
|
|
4875
4803
|
}
|
|
4876
|
-
|
|
4804
|
+
class Inline extends InlineBlot$1 {
|
|
4805
|
+
static allowedChildren = [Inline, Break, EmbedBlot$1, Text$1];
|
|
4806
|
+
// Lower index means deeper in the DOM tree, since not found (-1) is for embeds
|
|
4807
|
+
static order = [
|
|
4808
|
+
"cursor",
|
|
4809
|
+
"inline",
|
|
4810
|
+
// Must be lower
|
|
4811
|
+
"link",
|
|
4812
|
+
// Chrome wants <a> to be lower
|
|
4813
|
+
"underline",
|
|
4814
|
+
"strike",
|
|
4815
|
+
"italic",
|
|
4816
|
+
"bold",
|
|
4817
|
+
"script",
|
|
4818
|
+
"code"
|
|
4819
|
+
// Must be higher
|
|
4820
|
+
];
|
|
4877
4821
|
static compare(self2, other) {
|
|
4878
|
-
const selfIndex =
|
|
4879
|
-
const otherIndex =
|
|
4822
|
+
const selfIndex = Inline.order.indexOf(self2);
|
|
4823
|
+
const otherIndex = Inline.order.indexOf(other);
|
|
4880
4824
|
if (selfIndex >= 0 || otherIndex >= 0) {
|
|
4881
4825
|
return selfIndex - otherIndex;
|
|
4882
4826
|
}
|
|
@@ -4889,7 +4833,7 @@ const _Inline = class _Inline extends InlineBlot$1 {
|
|
|
4889
4833
|
return 1;
|
|
4890
4834
|
}
|
|
4891
4835
|
formatAt(index, length, name2, value) {
|
|
4892
|
-
if (
|
|
4836
|
+
if (Inline.compare(this.statics.blotName, name2) < 0 && this.scroll.query(name2, Scope.BLOT)) {
|
|
4893
4837
|
const blot = this.isolate(index, length);
|
|
4894
4838
|
if (value) {
|
|
4895
4839
|
blot.wrap(name2, value);
|
|
@@ -4900,36 +4844,16 @@ const _Inline = class _Inline extends InlineBlot$1 {
|
|
|
4900
4844
|
}
|
|
4901
4845
|
optimize(context) {
|
|
4902
4846
|
super.optimize(context);
|
|
4903
|
-
if (this.parent instanceof
|
|
4847
|
+
if (this.parent instanceof Inline && Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) {
|
|
4904
4848
|
const parent = this.parent.isolate(this.offset(), this.length());
|
|
4905
4849
|
this.moveChildren(parent);
|
|
4906
4850
|
parent.wrap(this);
|
|
4907
4851
|
}
|
|
4908
4852
|
}
|
|
4909
|
-
}
|
|
4910
|
-
__publicField(_Inline, "allowedChildren", [_Inline, Break, EmbedBlot$1, Text$1]);
|
|
4911
|
-
// Lower index means deeper in the DOM tree, since not found (-1) is for embeds
|
|
4912
|
-
__publicField(_Inline, "order", [
|
|
4913
|
-
"cursor",
|
|
4914
|
-
"inline",
|
|
4915
|
-
// Must be lower
|
|
4916
|
-
"link",
|
|
4917
|
-
// Chrome wants <a> to be lower
|
|
4918
|
-
"underline",
|
|
4919
|
-
"strike",
|
|
4920
|
-
"italic",
|
|
4921
|
-
"bold",
|
|
4922
|
-
"script",
|
|
4923
|
-
"code"
|
|
4924
|
-
// Must be higher
|
|
4925
|
-
]);
|
|
4926
|
-
let Inline = _Inline;
|
|
4853
|
+
}
|
|
4927
4854
|
const NEWLINE_LENGTH = 1;
|
|
4928
4855
|
class Block extends BlockBlot$1 {
|
|
4929
|
-
|
|
4930
|
-
super(...arguments);
|
|
4931
|
-
__publicField(this, "cache", {});
|
|
4932
|
-
}
|
|
4856
|
+
cache = {};
|
|
4933
4857
|
delta() {
|
|
4934
4858
|
if (this.cache.delta == null) {
|
|
4935
4859
|
this.cache.delta = blockDelta(this);
|
|
@@ -5095,7 +5019,11 @@ function bubbleFormats(blot) {
|
|
|
5095
5019
|
}
|
|
5096
5020
|
return bubbleFormats(blot.parent, formats, filter);
|
|
5097
5021
|
}
|
|
5098
|
-
|
|
5022
|
+
class Cursor extends EmbedBlot$1 {
|
|
5023
|
+
static blotName = "cursor";
|
|
5024
|
+
static className = "ql-cursor";
|
|
5025
|
+
static tagName = "span";
|
|
5026
|
+
static CONTENTS = "\uFEFF";
|
|
5099
5027
|
// Zero width no break space
|
|
5100
5028
|
static value() {
|
|
5101
5029
|
return void 0;
|
|
@@ -5103,7 +5031,7 @@ const _Cursor = class _Cursor extends EmbedBlot$1 {
|
|
|
5103
5031
|
constructor(scroll, domNode, selection) {
|
|
5104
5032
|
super(scroll, domNode);
|
|
5105
5033
|
this.selection = selection;
|
|
5106
|
-
this.textNode = document.createTextNode(
|
|
5034
|
+
this.textNode = document.createTextNode(Cursor.CONTENTS);
|
|
5107
5035
|
this.domNode.appendChild(this.textNode);
|
|
5108
5036
|
this.savedLength = 0;
|
|
5109
5037
|
}
|
|
@@ -5122,9 +5050,9 @@ const _Cursor = class _Cursor extends EmbedBlot$1 {
|
|
|
5122
5050
|
target = target.parent;
|
|
5123
5051
|
}
|
|
5124
5052
|
if (target != null) {
|
|
5125
|
-
this.savedLength =
|
|
5053
|
+
this.savedLength = Cursor.CONTENTS.length;
|
|
5126
5054
|
target.optimize();
|
|
5127
|
-
target.formatAt(index,
|
|
5055
|
+
target.formatAt(index, Cursor.CONTENTS.length, name2, value);
|
|
5128
5056
|
this.savedLength = 0;
|
|
5129
5057
|
}
|
|
5130
5058
|
}
|
|
@@ -5155,8 +5083,8 @@ const _Cursor = class _Cursor extends EmbedBlot$1 {
|
|
|
5155
5083
|
const {
|
|
5156
5084
|
textNode
|
|
5157
5085
|
} = this;
|
|
5158
|
-
const newText = textNode.data.split(
|
|
5159
|
-
textNode.data =
|
|
5086
|
+
const newText = textNode.data.split(Cursor.CONTENTS).join("");
|
|
5087
|
+
textNode.data = Cursor.CONTENTS;
|
|
5160
5088
|
let mergedTextBlot;
|
|
5161
5089
|
if (prevTextBlot) {
|
|
5162
5090
|
mergedTextBlot = prevTextBlot;
|
|
@@ -5226,7 +5154,7 @@ const _Cursor = class _Cursor extends EmbedBlot$1 {
|
|
|
5226
5154
|
} = this;
|
|
5227
5155
|
while (parent) {
|
|
5228
5156
|
if (parent.domNode.tagName === "A") {
|
|
5229
|
-
this.savedLength =
|
|
5157
|
+
this.savedLength = Cursor.CONTENTS.length;
|
|
5230
5158
|
parent.isolate(this.offset(parent), this.length()).unwrap();
|
|
5231
5159
|
this.savedLength = 0;
|
|
5232
5160
|
break;
|
|
@@ -5237,12 +5165,7 @@ const _Cursor = class _Cursor extends EmbedBlot$1 {
|
|
|
5237
5165
|
value() {
|
|
5238
5166
|
return "";
|
|
5239
5167
|
}
|
|
5240
|
-
}
|
|
5241
|
-
__publicField(_Cursor, "blotName", "cursor");
|
|
5242
|
-
__publicField(_Cursor, "className", "ql-cursor");
|
|
5243
|
-
__publicField(_Cursor, "tagName", "span");
|
|
5244
|
-
__publicField(_Cursor, "CONTENTS", "\uFEFF");
|
|
5245
|
-
let Cursor = _Cursor;
|
|
5168
|
+
}
|
|
5246
5169
|
var eventemitter3 = { exports: {} };
|
|
5247
5170
|
(function(module2) {
|
|
5248
5171
|
var has = Object.prototype.hasOwnProperty, prefix = "~";
|
|
@@ -5441,6 +5364,26 @@ EVENTS.forEach((eventName) => {
|
|
|
5441
5364
|
});
|
|
5442
5365
|
});
|
|
5443
5366
|
class Emitter extends EventEmitter {
|
|
5367
|
+
static events = {
|
|
5368
|
+
EDITOR_CHANGE: "editor-change",
|
|
5369
|
+
SCROLL_BEFORE_UPDATE: "scroll-before-update",
|
|
5370
|
+
SCROLL_BLOT_MOUNT: "scroll-blot-mount",
|
|
5371
|
+
SCROLL_BLOT_UNMOUNT: "scroll-blot-unmount",
|
|
5372
|
+
SCROLL_OPTIMIZE: "scroll-optimize",
|
|
5373
|
+
SCROLL_UPDATE: "scroll-update",
|
|
5374
|
+
SCROLL_EMBED_UPDATE: "scroll-embed-update",
|
|
5375
|
+
SELECTION_CHANGE: "selection-change",
|
|
5376
|
+
TEXT_CHANGE: "text-change",
|
|
5377
|
+
COMPOSITION_BEFORE_START: "composition-before-start",
|
|
5378
|
+
COMPOSITION_START: "composition-start",
|
|
5379
|
+
COMPOSITION_BEFORE_END: "composition-before-end",
|
|
5380
|
+
COMPOSITION_END: "composition-end"
|
|
5381
|
+
};
|
|
5382
|
+
static sources = {
|
|
5383
|
+
API: "api",
|
|
5384
|
+
SILENT: "silent",
|
|
5385
|
+
USER: "user"
|
|
5386
|
+
};
|
|
5444
5387
|
constructor() {
|
|
5445
5388
|
super();
|
|
5446
5389
|
this.domListeners = {};
|
|
@@ -5477,26 +5420,6 @@ class Emitter extends EventEmitter {
|
|
|
5477
5420
|
});
|
|
5478
5421
|
}
|
|
5479
5422
|
}
|
|
5480
|
-
__publicField(Emitter, "events", {
|
|
5481
|
-
EDITOR_CHANGE: "editor-change",
|
|
5482
|
-
SCROLL_BEFORE_UPDATE: "scroll-before-update",
|
|
5483
|
-
SCROLL_BLOT_MOUNT: "scroll-blot-mount",
|
|
5484
|
-
SCROLL_BLOT_UNMOUNT: "scroll-blot-unmount",
|
|
5485
|
-
SCROLL_OPTIMIZE: "scroll-optimize",
|
|
5486
|
-
SCROLL_UPDATE: "scroll-update",
|
|
5487
|
-
SCROLL_EMBED_UPDATE: "scroll-embed-update",
|
|
5488
|
-
SELECTION_CHANGE: "selection-change",
|
|
5489
|
-
TEXT_CHANGE: "text-change",
|
|
5490
|
-
COMPOSITION_BEFORE_START: "composition-before-start",
|
|
5491
|
-
COMPOSITION_START: "composition-start",
|
|
5492
|
-
COMPOSITION_BEFORE_END: "composition-before-end",
|
|
5493
|
-
COMPOSITION_END: "composition-end"
|
|
5494
|
-
});
|
|
5495
|
-
__publicField(Emitter, "sources", {
|
|
5496
|
-
API: "api",
|
|
5497
|
-
SILENT: "silent",
|
|
5498
|
-
USER: "user"
|
|
5499
|
-
});
|
|
5500
5423
|
const debug$4 = namespace("quill:selection");
|
|
5501
5424
|
class Range {
|
|
5502
5425
|
constructor(index) {
|
|
@@ -6038,7 +5961,7 @@ class Editor {
|
|
|
6038
5961
|
if (this.scroll.children.length === 0) return true;
|
|
6039
5962
|
if (this.scroll.children.length > 1) return false;
|
|
6040
5963
|
const blot = this.scroll.children.head;
|
|
6041
|
-
if (
|
|
5964
|
+
if (blot?.statics.blotName !== Block.blotName) return false;
|
|
6042
5965
|
const block = blot;
|
|
6043
5966
|
if (block.children.length > 1) return false;
|
|
6044
5967
|
return block.children.head instanceof Break;
|
|
@@ -6230,13 +6153,13 @@ function splitOpLines(ops) {
|
|
|
6230
6153
|
return split;
|
|
6231
6154
|
}
|
|
6232
6155
|
class Module {
|
|
6156
|
+
static DEFAULTS = {};
|
|
6233
6157
|
constructor(quill) {
|
|
6234
6158
|
let options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
6235
6159
|
this.quill = quill;
|
|
6236
6160
|
this.options = options;
|
|
6237
6161
|
}
|
|
6238
6162
|
}
|
|
6239
|
-
__publicField(Module, "DEFAULTS", {});
|
|
6240
6163
|
const GUARD_TEXT = "\uFEFF";
|
|
6241
6164
|
class Embed extends EmbedBlot$1 {
|
|
6242
6165
|
constructor(scroll, node) {
|
|
@@ -6306,8 +6229,8 @@ class Embed extends EmbedBlot$1 {
|
|
|
6306
6229
|
}
|
|
6307
6230
|
}
|
|
6308
6231
|
class Composition {
|
|
6232
|
+
isComposing = false;
|
|
6309
6233
|
constructor(scroll, emitter) {
|
|
6310
|
-
__publicField(this, "isComposing", false);
|
|
6311
6234
|
this.scroll = scroll;
|
|
6312
6235
|
this.emitter = emitter;
|
|
6313
6236
|
this.setupListeners();
|
|
@@ -6342,9 +6265,15 @@ class Composition {
|
|
|
6342
6265
|
this.isComposing = false;
|
|
6343
6266
|
}
|
|
6344
6267
|
}
|
|
6345
|
-
|
|
6268
|
+
class Theme {
|
|
6269
|
+
static DEFAULTS = {
|
|
6270
|
+
modules: {}
|
|
6271
|
+
};
|
|
6272
|
+
static themes = {
|
|
6273
|
+
default: Theme
|
|
6274
|
+
};
|
|
6275
|
+
modules = {};
|
|
6346
6276
|
constructor(quill, options) {
|
|
6347
|
-
__publicField(this, "modules", {});
|
|
6348
6277
|
this.quill = quill;
|
|
6349
6278
|
this.options = options;
|
|
6350
6279
|
}
|
|
@@ -6360,14 +6289,7 @@ const _Theme = class _Theme {
|
|
|
6360
6289
|
this.modules[name2] = new ModuleClass(this.quill, this.options.modules[name2] || {});
|
|
6361
6290
|
return this.modules[name2];
|
|
6362
6291
|
}
|
|
6363
|
-
}
|
|
6364
|
-
__publicField(_Theme, "DEFAULTS", {
|
|
6365
|
-
modules: {}
|
|
6366
|
-
});
|
|
6367
|
-
__publicField(_Theme, "themes", {
|
|
6368
|
-
default: _Theme
|
|
6369
|
-
});
|
|
6370
|
-
let Theme = _Theme;
|
|
6292
|
+
}
|
|
6371
6293
|
const getParentElement = (element) => element.parentElement || element.getRootNode().host || null;
|
|
6372
6294
|
const getElementRect = (element) => {
|
|
6373
6295
|
const rect = element.getBoundingClientRect();
|
|
@@ -6397,7 +6319,6 @@ const getScrollDistance = (targetStart, targetEnd, scrollStart, scrollEnd, scrol
|
|
|
6397
6319
|
return 0;
|
|
6398
6320
|
};
|
|
6399
6321
|
const scrollRectIntoView = (root2, targetRect) => {
|
|
6400
|
-
var _a, _b, _c;
|
|
6401
6322
|
const document2 = root2.ownerDocument;
|
|
6402
6323
|
let rect = targetRect;
|
|
6403
6324
|
let current = root2;
|
|
@@ -6405,8 +6326,8 @@ const scrollRectIntoView = (root2, targetRect) => {
|
|
|
6405
6326
|
const isDocumentBody = current === document2.body;
|
|
6406
6327
|
const bounding = isDocumentBody ? {
|
|
6407
6328
|
top: 0,
|
|
6408
|
-
right:
|
|
6409
|
-
bottom:
|
|
6329
|
+
right: window.visualViewport?.width ?? document2.documentElement.clientWidth,
|
|
6330
|
+
bottom: window.visualViewport?.height ?? document2.documentElement.clientHeight,
|
|
6410
6331
|
left: 0
|
|
6411
6332
|
} : getElementRect(current);
|
|
6412
6333
|
const style = getComputedStyle(current);
|
|
@@ -6414,7 +6335,7 @@ const scrollRectIntoView = (root2, targetRect) => {
|
|
|
6414
6335
|
const scrollDistanceY = getScrollDistance(rect.top, rect.bottom, bounding.top, bounding.bottom, paddingValueToInt(style.scrollPaddingTop), paddingValueToInt(style.scrollPaddingBottom));
|
|
6415
6336
|
if (scrollDistanceX || scrollDistanceY) {
|
|
6416
6337
|
if (isDocumentBody) {
|
|
6417
|
-
|
|
6338
|
+
document2.defaultView?.scrollBy(scrollDistanceX, scrollDistanceY);
|
|
6418
6339
|
} else {
|
|
6419
6340
|
const {
|
|
6420
6341
|
scrollLeft,
|
|
@@ -6468,7 +6389,29 @@ const createRegistryWithFormats = (formats, sourceRegistry, debug2) => {
|
|
|
6468
6389
|
const debug$3 = namespace("quill");
|
|
6469
6390
|
const globalRegistry = new Registry();
|
|
6470
6391
|
ParentBlot$1.uiClass = "ql-ui";
|
|
6471
|
-
|
|
6392
|
+
class Quill {
|
|
6393
|
+
static DEFAULTS = {
|
|
6394
|
+
bounds: null,
|
|
6395
|
+
modules: {
|
|
6396
|
+
clipboard: true,
|
|
6397
|
+
keyboard: true,
|
|
6398
|
+
history: true,
|
|
6399
|
+
uploader: true
|
|
6400
|
+
},
|
|
6401
|
+
placeholder: "",
|
|
6402
|
+
readOnly: false,
|
|
6403
|
+
registry: globalRegistry,
|
|
6404
|
+
theme: "default"
|
|
6405
|
+
};
|
|
6406
|
+
static events = Emitter.events;
|
|
6407
|
+
static sources = Emitter.sources;
|
|
6408
|
+
static version = "2.0.3";
|
|
6409
|
+
static imports = {
|
|
6410
|
+
delta: Delta,
|
|
6411
|
+
parchment: Parchment,
|
|
6412
|
+
"core/module": Module,
|
|
6413
|
+
"core/theme": Theme
|
|
6414
|
+
};
|
|
6472
6415
|
static debug(limit) {
|
|
6473
6416
|
if (limit === true) {
|
|
6474
6417
|
limit = "log";
|
|
@@ -6522,7 +6465,7 @@ const _Quill = class _Quill {
|
|
|
6522
6465
|
return;
|
|
6523
6466
|
}
|
|
6524
6467
|
if (this.options.debug) {
|
|
6525
|
-
|
|
6468
|
+
Quill.debug(this.options.debug);
|
|
6526
6469
|
}
|
|
6527
6470
|
const html = this.container.innerHTML.trim();
|
|
6528
6471
|
this.container.classList.add("ql-container");
|
|
@@ -6576,7 +6519,7 @@ const _Quill = class _Quill {
|
|
|
6576
6519
|
[blot.statics.blotName]: delta
|
|
6577
6520
|
});
|
|
6578
6521
|
return this.editor.update(change, [], selectionInfo);
|
|
6579
|
-
},
|
|
6522
|
+
}, Quill.sources.USER);
|
|
6580
6523
|
});
|
|
6581
6524
|
if (html) {
|
|
6582
6525
|
const contents = this.clipboard.convert({
|
|
@@ -6768,7 +6711,7 @@ const _Quill = class _Quill {
|
|
|
6768
6711
|
return this.selection.hasFocus();
|
|
6769
6712
|
}
|
|
6770
6713
|
insertEmbed(index, embed, value) {
|
|
6771
|
-
let source = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] :
|
|
6714
|
+
let source = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : Quill.sources.API;
|
|
6772
6715
|
return modify.call(this, () => {
|
|
6773
6716
|
return this.editor.insertEmbed(index, embed, value);
|
|
6774
6717
|
}, source, index);
|
|
@@ -6832,7 +6775,7 @@ const _Quill = class _Quill {
|
|
|
6832
6775
|
}
|
|
6833
6776
|
setSelection(index, length, source) {
|
|
6834
6777
|
if (index == null) {
|
|
6835
|
-
this.selection.setRange(null, length ||
|
|
6778
|
+
this.selection.setRange(null, length || Quill.sources.API);
|
|
6836
6779
|
} else {
|
|
6837
6780
|
[index, length, , source] = overload(index, length, source);
|
|
6838
6781
|
this.selection.setRange(new Range(Math.max(0, index), length), source);
|
|
@@ -6859,30 +6802,7 @@ const _Quill = class _Quill {
|
|
|
6859
6802
|
return this.editor.applyDelta(delta);
|
|
6860
6803
|
}, source, true);
|
|
6861
6804
|
}
|
|
6862
|
-
}
|
|
6863
|
-
__publicField(_Quill, "DEFAULTS", {
|
|
6864
|
-
bounds: null,
|
|
6865
|
-
modules: {
|
|
6866
|
-
clipboard: true,
|
|
6867
|
-
keyboard: true,
|
|
6868
|
-
history: true,
|
|
6869
|
-
uploader: true
|
|
6870
|
-
},
|
|
6871
|
-
placeholder: "",
|
|
6872
|
-
readOnly: false,
|
|
6873
|
-
registry: globalRegistry,
|
|
6874
|
-
theme: "default"
|
|
6875
|
-
});
|
|
6876
|
-
__publicField(_Quill, "events", Emitter.events);
|
|
6877
|
-
__publicField(_Quill, "sources", Emitter.sources);
|
|
6878
|
-
__publicField(_Quill, "version", "2.0.3");
|
|
6879
|
-
__publicField(_Quill, "imports", {
|
|
6880
|
-
delta: Delta,
|
|
6881
|
-
parchment: Parchment,
|
|
6882
|
-
"core/module": Module,
|
|
6883
|
-
"core/theme": Theme
|
|
6884
|
-
});
|
|
6885
|
-
let Quill = _Quill;
|
|
6805
|
+
}
|
|
6886
6806
|
function resolveSelector(selector) {
|
|
6887
6807
|
return typeof selector === "string" ? document.querySelector(selector) : selector;
|
|
6888
6808
|
}
|
|
@@ -7050,6 +6970,11 @@ function isUpdatable(blot) {
|
|
|
7050
6970
|
return typeof blot.updateContent === "function";
|
|
7051
6971
|
}
|
|
7052
6972
|
class Scroll extends ScrollBlot$1 {
|
|
6973
|
+
static blotName = "scroll";
|
|
6974
|
+
static className = "ql-editor";
|
|
6975
|
+
static tagName = "DIV";
|
|
6976
|
+
static defaultChild = Block;
|
|
6977
|
+
static allowedChildren = [Block, BlockEmbed, Container];
|
|
7053
6978
|
constructor(registry, domNode, _ref) {
|
|
7054
6979
|
let {
|
|
7055
6980
|
emitter
|
|
@@ -7273,7 +7198,7 @@ class Scroll extends ScrollBlot$1 {
|
|
|
7273
7198
|
const renderBlocks = [];
|
|
7274
7199
|
let currentBlockDelta = new Delta();
|
|
7275
7200
|
delta.forEach((op) => {
|
|
7276
|
-
const insert = op
|
|
7201
|
+
const insert = op?.insert;
|
|
7277
7202
|
if (!insert) return;
|
|
7278
7203
|
if (typeof insert === "string") {
|
|
7279
7204
|
const splitted = insert.split("\n");
|
|
@@ -7344,11 +7269,6 @@ class Scroll extends ScrollBlot$1 {
|
|
|
7344
7269
|
return block;
|
|
7345
7270
|
}
|
|
7346
7271
|
}
|
|
7347
|
-
__publicField(Scroll, "blotName", "scroll");
|
|
7348
|
-
__publicField(Scroll, "className", "ql-editor");
|
|
7349
|
-
__publicField(Scroll, "tagName", "DIV");
|
|
7350
|
-
__publicField(Scroll, "defaultChild", Block);
|
|
7351
|
-
__publicField(Scroll, "allowedChildren", [Block, BlockEmbed, Container]);
|
|
7352
7272
|
function insertInlineContents(parent, index, inlineContents) {
|
|
7353
7273
|
inlineContents.reduce((index2, op) => {
|
|
7354
7274
|
const length = DeltaExports.Op.length(op);
|
|
@@ -7422,11 +7342,11 @@ ${escapeText(this.code(index, length))}
|
|
|
7422
7342
|
}
|
|
7423
7343
|
}
|
|
7424
7344
|
class CodeBlock extends Block {
|
|
7345
|
+
static TAB = " ";
|
|
7425
7346
|
static register() {
|
|
7426
7347
|
Quill.register(CodeBlockContainer);
|
|
7427
7348
|
}
|
|
7428
7349
|
}
|
|
7429
|
-
__publicField(CodeBlock, "TAB", " ");
|
|
7430
7350
|
class Code extends Inline {
|
|
7431
7351
|
}
|
|
7432
7352
|
Code.blotName = "code";
|
|
@@ -8139,19 +8059,14 @@ const isBlockElement = (element) => {
|
|
|
8139
8059
|
};
|
|
8140
8060
|
const normalizeEmptyLines = (doc) => {
|
|
8141
8061
|
Array.from(doc.querySelectorAll("br")).filter((br) => isBlockElement(br.previousElementSibling) && isBlockElement(br.nextElementSibling)).forEach((br) => {
|
|
8142
|
-
|
|
8143
|
-
(_a = br.parentNode) == null ? void 0 : _a.removeChild(br);
|
|
8062
|
+
br.parentNode?.removeChild(br);
|
|
8144
8063
|
});
|
|
8145
8064
|
};
|
|
8146
8065
|
const normalizeFontWeight = (doc) => {
|
|
8147
|
-
Array.from(doc.querySelectorAll('b[style*="font-weight"]')).filter((node) => {
|
|
8148
|
-
var _a;
|
|
8149
|
-
return (_a = node.getAttribute("style")) == null ? void 0 : _a.match(normalWeightRegexp);
|
|
8150
|
-
}).forEach((node) => {
|
|
8151
|
-
var _a;
|
|
8066
|
+
Array.from(doc.querySelectorAll('b[style*="font-weight"]')).filter((node) => node.getAttribute("style")?.match(normalWeightRegexp)).forEach((node) => {
|
|
8152
8067
|
const fragment = doc.createDocumentFragment();
|
|
8153
8068
|
fragment.append(...node.childNodes);
|
|
8154
|
-
|
|
8069
|
+
node.parentNode?.replaceChild(fragment, node);
|
|
8155
8070
|
});
|
|
8156
8071
|
};
|
|
8157
8072
|
function normalize$1(doc) {
|
|
@@ -8165,12 +8080,12 @@ const idRegexp = /\bmso-list:[^;]*\bl(\d+)/i;
|
|
|
8165
8080
|
const indentRegexp = /\bmso-list:[^;]*\blevel(\d+)/i;
|
|
8166
8081
|
const parseListItem = (element, html) => {
|
|
8167
8082
|
const style = element.getAttribute("style");
|
|
8168
|
-
const idMatch = style
|
|
8083
|
+
const idMatch = style?.match(idRegexp);
|
|
8169
8084
|
if (!idMatch) {
|
|
8170
8085
|
return null;
|
|
8171
8086
|
}
|
|
8172
8087
|
const id = Number(idMatch[1]);
|
|
8173
|
-
const indentMatch = style
|
|
8088
|
+
const indentMatch = style?.match(indentRegexp);
|
|
8174
8089
|
const indent = indentMatch ? Number(indentMatch[1]) : 1;
|
|
8175
8090
|
const typeRegexp = new RegExp(`@list l${id}:level${indent}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`, "i");
|
|
8176
8091
|
const typeMatch = html.match(typeRegexp);
|
|
@@ -8183,7 +8098,6 @@ const parseListItem = (element, html) => {
|
|
|
8183
8098
|
};
|
|
8184
8099
|
};
|
|
8185
8100
|
const normalizeListItem = (doc) => {
|
|
8186
|
-
var _a, _b;
|
|
8187
8101
|
const msoList = Array.from(doc.querySelectorAll("[style*=mso-list]"));
|
|
8188
8102
|
const ignored = [];
|
|
8189
8103
|
const others = [];
|
|
@@ -8195,10 +8109,7 @@ const normalizeListItem = (doc) => {
|
|
|
8195
8109
|
others.push(node);
|
|
8196
8110
|
}
|
|
8197
8111
|
});
|
|
8198
|
-
ignored.forEach((node) =>
|
|
8199
|
-
var _a2;
|
|
8200
|
-
return (_a2 = node.parentNode) == null ? void 0 : _a2.removeChild(node);
|
|
8201
|
-
});
|
|
8112
|
+
ignored.forEach((node) => node.parentNode?.removeChild(node));
|
|
8202
8113
|
const html = doc.documentElement.innerHTML;
|
|
8203
8114
|
const listItems = others.map((element) => parseListItem(element, html)).filter((parsed) => parsed);
|
|
8204
8115
|
while (listItems.length) {
|
|
@@ -8206,7 +8117,7 @@ const normalizeListItem = (doc) => {
|
|
|
8206
8117
|
let current = listItems.shift();
|
|
8207
8118
|
while (current) {
|
|
8208
8119
|
childListItems.push(current);
|
|
8209
|
-
current = listItems.length &&
|
|
8120
|
+
current = listItems.length && listItems[0]?.element === current.element.nextElementSibling && // Different id means the next item doesn't belong to this group.
|
|
8210
8121
|
listItems[0].id === current.id ? listItems.shift() : null;
|
|
8211
8122
|
}
|
|
8212
8123
|
const ul = document.createElement("ul");
|
|
@@ -8219,18 +8130,18 @@ const normalizeListItem = (doc) => {
|
|
|
8219
8130
|
li.innerHTML = listItem.element.innerHTML;
|
|
8220
8131
|
ul.appendChild(li);
|
|
8221
8132
|
});
|
|
8222
|
-
const element =
|
|
8133
|
+
const element = childListItems[0]?.element;
|
|
8223
8134
|
const {
|
|
8224
8135
|
parentNode
|
|
8225
8136
|
} = element ?? {};
|
|
8226
8137
|
if (element) {
|
|
8227
|
-
parentNode
|
|
8138
|
+
parentNode?.replaceChild(ul, element);
|
|
8228
8139
|
}
|
|
8229
8140
|
childListItems.slice(1).forEach((_ref) => {
|
|
8230
8141
|
let {
|
|
8231
8142
|
element: e
|
|
8232
8143
|
} = _ref;
|
|
8233
|
-
parentNode
|
|
8144
|
+
parentNode?.removeChild(e);
|
|
8234
8145
|
});
|
|
8235
8146
|
}
|
|
8236
8147
|
};
|
|
@@ -8258,6 +8169,9 @@ const STYLE_ATTRIBUTORS = [AlignStyle, BackgroundStyle, ColorStyle, DirectionSty
|
|
|
8258
8169
|
return memo;
|
|
8259
8170
|
}, {});
|
|
8260
8171
|
class Clipboard extends Module {
|
|
8172
|
+
static DEFAULTS = {
|
|
8173
|
+
matchers: []
|
|
8174
|
+
};
|
|
8261
8175
|
constructor(quill, options) {
|
|
8262
8176
|
super(quill, options);
|
|
8263
8177
|
this.quill.root.addEventListener("copy", (e) => this.onCaptureCopy(e, false));
|
|
@@ -8322,7 +8236,6 @@ class Clipboard extends Module {
|
|
|
8322
8236
|
}
|
|
8323
8237
|
}
|
|
8324
8238
|
onCaptureCopy(e) {
|
|
8325
|
-
var _a, _b;
|
|
8326
8239
|
let isCut = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
|
|
8327
8240
|
if (e.defaultPrevented) return;
|
|
8328
8241
|
e.preventDefault();
|
|
@@ -8332,8 +8245,8 @@ class Clipboard extends Module {
|
|
|
8332
8245
|
html,
|
|
8333
8246
|
text
|
|
8334
8247
|
} = this.onCopy(range, isCut);
|
|
8335
|
-
|
|
8336
|
-
|
|
8248
|
+
e.clipboardData?.setData("text/plain", text);
|
|
8249
|
+
e.clipboardData?.setData("text/html", html);
|
|
8337
8250
|
if (isCut) {
|
|
8338
8251
|
deleteRange({
|
|
8339
8252
|
range,
|
|
@@ -8348,27 +8261,26 @@ class Clipboard extends Module {
|
|
|
8348
8261
|
return urlList.split(/\r?\n/).filter((url) => url[0] !== "#").join("\n");
|
|
8349
8262
|
}
|
|
8350
8263
|
onCapturePaste(e) {
|
|
8351
|
-
var _a, _b, _c, _d, _e;
|
|
8352
8264
|
if (e.defaultPrevented || !this.quill.isEnabled()) return;
|
|
8353
8265
|
e.preventDefault();
|
|
8354
8266
|
const range = this.quill.getSelection(true);
|
|
8355
8267
|
if (range == null) return;
|
|
8356
|
-
const html =
|
|
8357
|
-
let text =
|
|
8268
|
+
const html = e.clipboardData?.getData("text/html");
|
|
8269
|
+
let text = e.clipboardData?.getData("text/plain");
|
|
8358
8270
|
if (!html && !text) {
|
|
8359
|
-
const urlList =
|
|
8271
|
+
const urlList = e.clipboardData?.getData("text/uri-list");
|
|
8360
8272
|
if (urlList) {
|
|
8361
8273
|
text = this.normalizeURIList(urlList);
|
|
8362
8274
|
}
|
|
8363
8275
|
}
|
|
8364
|
-
const files = Array.from(
|
|
8276
|
+
const files = Array.from(e.clipboardData?.files || []);
|
|
8365
8277
|
if (!html && files.length > 0) {
|
|
8366
8278
|
this.quill.uploader.upload(range, files);
|
|
8367
8279
|
return;
|
|
8368
8280
|
}
|
|
8369
8281
|
if (html && files.length > 0) {
|
|
8370
8282
|
const doc = new DOMParser().parseFromString(html, "text/html");
|
|
8371
|
-
if (doc.body.childElementCount === 1 &&
|
|
8283
|
+
if (doc.body.childElementCount === 1 && doc.body.firstElementChild?.tagName === "IMG") {
|
|
8372
8284
|
this.quill.uploader.upload(range, files);
|
|
8373
8285
|
return;
|
|
8374
8286
|
}
|
|
@@ -8421,7 +8333,7 @@ class Clipboard extends Module {
|
|
|
8421
8333
|
Array.from(container.querySelectorAll(selector)).forEach((node) => {
|
|
8422
8334
|
if (nodeMatches.has(node)) {
|
|
8423
8335
|
const matches = nodeMatches.get(node);
|
|
8424
|
-
matches
|
|
8336
|
+
matches?.push(matcher);
|
|
8425
8337
|
} else {
|
|
8426
8338
|
nodeMatches.set(node, [matcher]);
|
|
8427
8339
|
}
|
|
@@ -8432,9 +8344,6 @@ class Clipboard extends Module {
|
|
|
8432
8344
|
return [elementMatchers, textMatchers];
|
|
8433
8345
|
}
|
|
8434
8346
|
}
|
|
8435
|
-
__publicField(Clipboard, "DEFAULTS", {
|
|
8436
|
-
matchers: []
|
|
8437
|
-
});
|
|
8438
8347
|
function applyFormat(delta, format, value, scroll) {
|
|
8439
8348
|
if (!scroll.query(format)) {
|
|
8440
8349
|
return delta;
|
|
@@ -8627,7 +8536,6 @@ function matchNewline(node, delta, scroll) {
|
|
|
8627
8536
|
return delta;
|
|
8628
8537
|
}
|
|
8629
8538
|
function matchStyles(node, delta, scroll) {
|
|
8630
|
-
var _a;
|
|
8631
8539
|
const formats = {};
|
|
8632
8540
|
const style = node.style || {};
|
|
8633
8541
|
if (style.fontStyle === "italic") {
|
|
@@ -8639,7 +8547,7 @@ function matchStyles(node, delta, scroll) {
|
|
|
8639
8547
|
if (style.textDecoration === "line-through") {
|
|
8640
8548
|
formats.strike = true;
|
|
8641
8549
|
}
|
|
8642
|
-
if (
|
|
8550
|
+
if (style.fontWeight?.startsWith("bold") || // @ts-expect-error Fix me later
|
|
8643
8551
|
parseInt(style.fontWeight, 10) >= 700) {
|
|
8644
8552
|
formats.bold = true;
|
|
8645
8553
|
}
|
|
@@ -8653,8 +8561,7 @@ function matchStyles(node, delta, scroll) {
|
|
|
8653
8561
|
return delta;
|
|
8654
8562
|
}
|
|
8655
8563
|
function matchTable(node, delta, scroll) {
|
|
8656
|
-
|
|
8657
|
-
const table = ((_a = node.parentElement) == null ? void 0 : _a.tagName) === "TABLE" ? node.parentElement : (_b = node.parentElement) == null ? void 0 : _b.parentElement;
|
|
8564
|
+
const table = node.parentElement?.tagName === "TABLE" ? node.parentElement : node.parentElement?.parentElement;
|
|
8658
8565
|
if (table != null) {
|
|
8659
8566
|
const rows = Array.from(table.querySelectorAll("tr"));
|
|
8660
8567
|
const row = rows.indexOf(node) + 1;
|
|
@@ -8663,9 +8570,8 @@ function matchTable(node, delta, scroll) {
|
|
|
8663
8570
|
return delta;
|
|
8664
8571
|
}
|
|
8665
8572
|
function matchText(node, delta, scroll) {
|
|
8666
|
-
var _a;
|
|
8667
8573
|
let text = node.data;
|
|
8668
|
-
if (
|
|
8574
|
+
if (node.parentElement?.tagName === "O:P") {
|
|
8669
8575
|
return delta.insert(text.trim());
|
|
8670
8576
|
}
|
|
8671
8577
|
if (!isPre(node)) {
|
|
@@ -8685,15 +8591,20 @@ function matchText(node, delta, scroll) {
|
|
|
8685
8591
|
return delta.insert(text);
|
|
8686
8592
|
}
|
|
8687
8593
|
class History extends Module {
|
|
8594
|
+
static DEFAULTS = {
|
|
8595
|
+
delay: 1e3,
|
|
8596
|
+
maxStack: 100,
|
|
8597
|
+
userOnly: false
|
|
8598
|
+
};
|
|
8599
|
+
lastRecorded = 0;
|
|
8600
|
+
ignoreChange = false;
|
|
8601
|
+
stack = {
|
|
8602
|
+
undo: [],
|
|
8603
|
+
redo: []
|
|
8604
|
+
};
|
|
8605
|
+
currentRange = null;
|
|
8688
8606
|
constructor(quill, options) {
|
|
8689
8607
|
super(quill, options);
|
|
8690
|
-
__publicField(this, "lastRecorded", 0);
|
|
8691
|
-
__publicField(this, "ignoreChange", false);
|
|
8692
|
-
__publicField(this, "stack", {
|
|
8693
|
-
undo: [],
|
|
8694
|
-
redo: []
|
|
8695
|
-
});
|
|
8696
|
-
__publicField(this, "currentRange", null);
|
|
8697
8608
|
this.quill.on(Quill.events.EDITOR_CHANGE, (eventName, value, oldValue, source) => {
|
|
8698
8609
|
if (eventName === Quill.events.SELECTION_CHANGE) {
|
|
8699
8610
|
if (value && source !== Quill.sources.SILENT) {
|
|
@@ -8806,11 +8717,6 @@ class History extends Module {
|
|
|
8806
8717
|
}
|
|
8807
8718
|
}
|
|
8808
8719
|
}
|
|
8809
|
-
__publicField(History, "DEFAULTS", {
|
|
8810
|
-
delay: 1e3,
|
|
8811
|
-
maxStack: 100,
|
|
8812
|
-
userOnly: false
|
|
8813
|
-
});
|
|
8814
8720
|
function transformStack(stack, delta) {
|
|
8815
8721
|
let remoteDelta = delta;
|
|
8816
8722
|
for (let i = stack.length - 1; i >= 0; i -= 1) {
|
|
@@ -8861,7 +8767,6 @@ class Uploader extends Module {
|
|
|
8861
8767
|
constructor(quill, options) {
|
|
8862
8768
|
super(quill, options);
|
|
8863
8769
|
quill.root.addEventListener("drop", (e) => {
|
|
8864
|
-
var _a;
|
|
8865
8770
|
e.preventDefault();
|
|
8866
8771
|
let native = null;
|
|
8867
8772
|
if (document.caretRangeFromPoint) {
|
|
@@ -8875,7 +8780,7 @@ class Uploader extends Module {
|
|
|
8875
8780
|
const normalized = native && quill.selection.normalizeNative(native);
|
|
8876
8781
|
if (normalized) {
|
|
8877
8782
|
const range = quill.selection.normalizedToRange(normalized);
|
|
8878
|
-
if (
|
|
8783
|
+
if (e.dataTransfer?.files) {
|
|
8879
8784
|
this.upload(range, e.dataTransfer.files);
|
|
8880
8785
|
}
|
|
8881
8786
|
}
|
|
@@ -8884,8 +8789,7 @@ class Uploader extends Module {
|
|
|
8884
8789
|
upload(range, files) {
|
|
8885
8790
|
const uploads = [];
|
|
8886
8791
|
Array.from(files).forEach((file) => {
|
|
8887
|
-
|
|
8888
|
-
if (file && ((_a = this.options.mimetypes) == null ? void 0 : _a.includes(file.type))) {
|
|
8792
|
+
if (file && this.options.mimetypes?.includes(file.type)) {
|
|
8889
8793
|
uploads.push(file);
|
|
8890
8794
|
}
|
|
8891
8795
|
});
|
|
@@ -8978,11 +8882,10 @@ class Input extends Module {
|
|
|
8978
8882
|
}
|
|
8979
8883
|
}
|
|
8980
8884
|
function getPlainTextFromInputEvent(event) {
|
|
8981
|
-
var _a;
|
|
8982
8885
|
if (typeof event.data === "string") {
|
|
8983
8886
|
return event.data;
|
|
8984
8887
|
}
|
|
8985
|
-
if (
|
|
8888
|
+
if (event.dataTransfer?.types.includes("text/plain")) {
|
|
8986
8889
|
return event.dataTransfer.getData("text/plain");
|
|
8987
8890
|
}
|
|
8988
8891
|
return null;
|
|
@@ -9000,10 +8903,10 @@ const canMoveCaretBeforeUINode = (event) => {
|
|
|
9000
8903
|
return false;
|
|
9001
8904
|
};
|
|
9002
8905
|
class UINode extends Module {
|
|
8906
|
+
isListening = false;
|
|
8907
|
+
selectionChangeDeadline = 0;
|
|
9003
8908
|
constructor(quill, options) {
|
|
9004
8909
|
super(quill, options);
|
|
9005
|
-
__publicField(this, "isListening", false);
|
|
9006
|
-
__publicField(this, "selectionChangeDeadline", 0);
|
|
9007
8910
|
this.handleArrowKeys();
|
|
9008
8911
|
this.handleNavigationShortcuts();
|
|
9009
8912
|
}
|
|
@@ -9115,16 +9018,16 @@ const IndentClass = new IndentAttributor("indent", "ql-indent", {
|
|
|
9115
9018
|
whitelist: [1, 2, 3, 4, 5, 6, 7, 8]
|
|
9116
9019
|
});
|
|
9117
9020
|
class Blockquote extends Block {
|
|
9021
|
+
static blotName = "blockquote";
|
|
9022
|
+
static tagName = "blockquote";
|
|
9118
9023
|
}
|
|
9119
|
-
__publicField(Blockquote, "blotName", "blockquote");
|
|
9120
|
-
__publicField(Blockquote, "tagName", "blockquote");
|
|
9121
9024
|
class Header extends Block {
|
|
9025
|
+
static blotName = "header";
|
|
9026
|
+
static tagName = ["H1", "H2", "H3", "H4", "H5", "H6"];
|
|
9122
9027
|
static formats(domNode) {
|
|
9123
9028
|
return this.tagName.indexOf(domNode.tagName) + 1;
|
|
9124
9029
|
}
|
|
9125
9030
|
}
|
|
9126
|
-
__publicField(Header, "blotName", "header");
|
|
9127
|
-
__publicField(Header, "tagName", ["H1", "H2", "H3", "H4", "H5", "H6"]);
|
|
9128
9031
|
class ListContainer extends Container {
|
|
9129
9032
|
}
|
|
9130
9033
|
ListContainer.blotName = "list-container";
|
|
@@ -9172,6 +9075,8 @@ ListItem.tagName = "LI";
|
|
|
9172
9075
|
ListContainer.allowedChildren = [ListItem];
|
|
9173
9076
|
ListItem.requiredContainer = ListContainer;
|
|
9174
9077
|
class Bold extends Inline {
|
|
9078
|
+
static blotName = "bold";
|
|
9079
|
+
static tagName = ["STRONG", "B"];
|
|
9175
9080
|
static create() {
|
|
9176
9081
|
return super.create();
|
|
9177
9082
|
}
|
|
@@ -9185,13 +9090,15 @@ class Bold extends Inline {
|
|
|
9185
9090
|
}
|
|
9186
9091
|
}
|
|
9187
9092
|
}
|
|
9188
|
-
__publicField(Bold, "blotName", "bold");
|
|
9189
|
-
__publicField(Bold, "tagName", ["STRONG", "B"]);
|
|
9190
9093
|
class Italic extends Bold {
|
|
9094
|
+
static blotName = "italic";
|
|
9095
|
+
static tagName = ["EM", "I"];
|
|
9191
9096
|
}
|
|
9192
|
-
__publicField(Italic, "blotName", "italic");
|
|
9193
|
-
__publicField(Italic, "tagName", ["EM", "I"]);
|
|
9194
9097
|
class Link extends Inline {
|
|
9098
|
+
static blotName = "link";
|
|
9099
|
+
static tagName = "A";
|
|
9100
|
+
static SANITIZED_URL = "about:blank";
|
|
9101
|
+
static PROTOCOL_WHITELIST = ["http", "https", "mailto", "tel", "sms"];
|
|
9195
9102
|
static create(value) {
|
|
9196
9103
|
const node = super.create(value);
|
|
9197
9104
|
node.setAttribute("href", this.sanitize(value));
|
|
@@ -9213,10 +9120,6 @@ class Link extends Inline {
|
|
|
9213
9120
|
}
|
|
9214
9121
|
}
|
|
9215
9122
|
}
|
|
9216
|
-
__publicField(Link, "blotName", "link");
|
|
9217
|
-
__publicField(Link, "tagName", "A");
|
|
9218
|
-
__publicField(Link, "SANITIZED_URL", "about:blank");
|
|
9219
|
-
__publicField(Link, "PROTOCOL_WHITELIST", ["http", "https", "mailto", "tel", "sms"]);
|
|
9220
9123
|
function sanitize(url, protocols) {
|
|
9221
9124
|
const anchor = document.createElement("a");
|
|
9222
9125
|
anchor.href = url;
|
|
@@ -9224,6 +9127,8 @@ function sanitize(url, protocols) {
|
|
|
9224
9127
|
return protocols.indexOf(protocol) > -1;
|
|
9225
9128
|
}
|
|
9226
9129
|
class Script extends Inline {
|
|
9130
|
+
static blotName = "script";
|
|
9131
|
+
static tagName = ["SUB", "SUP"];
|
|
9227
9132
|
static create(value) {
|
|
9228
9133
|
if (value === "super") {
|
|
9229
9134
|
return document.createElement("sup");
|
|
@@ -9239,17 +9144,18 @@ class Script extends Inline {
|
|
|
9239
9144
|
return void 0;
|
|
9240
9145
|
}
|
|
9241
9146
|
}
|
|
9242
|
-
__publicField(Script, "blotName", "script");
|
|
9243
|
-
__publicField(Script, "tagName", ["SUB", "SUP"]);
|
|
9244
9147
|
class Strike extends Bold {
|
|
9148
|
+
static blotName = "strike";
|
|
9149
|
+
static tagName = ["S", "STRIKE"];
|
|
9245
9150
|
}
|
|
9246
|
-
__publicField(Strike, "blotName", "strike");
|
|
9247
|
-
__publicField(Strike, "tagName", ["S", "STRIKE"]);
|
|
9248
9151
|
class Underline extends Inline {
|
|
9152
|
+
static blotName = "underline";
|
|
9153
|
+
static tagName = "U";
|
|
9249
9154
|
}
|
|
9250
|
-
__publicField(Underline, "blotName", "underline");
|
|
9251
|
-
__publicField(Underline, "tagName", "U");
|
|
9252
9155
|
class Formula extends Embed {
|
|
9156
|
+
static blotName = "formula";
|
|
9157
|
+
static className = "ql-formula";
|
|
9158
|
+
static tagName = "SPAN";
|
|
9253
9159
|
static create(value) {
|
|
9254
9160
|
if (window.katex == null) {
|
|
9255
9161
|
throw new Error("Formula module requires KaTeX.");
|
|
@@ -9274,11 +9180,10 @@ class Formula extends Embed {
|
|
|
9274
9180
|
return `<span>${formula}</span>`;
|
|
9275
9181
|
}
|
|
9276
9182
|
}
|
|
9277
|
-
__publicField(Formula, "blotName", "formula");
|
|
9278
|
-
__publicField(Formula, "className", "ql-formula");
|
|
9279
|
-
__publicField(Formula, "tagName", "SPAN");
|
|
9280
9183
|
const ATTRIBUTES$1 = ["alt", "height", "width"];
|
|
9281
9184
|
class Image extends EmbedBlot$1 {
|
|
9185
|
+
static blotName = "image";
|
|
9186
|
+
static tagName = "IMG";
|
|
9282
9187
|
static create(value) {
|
|
9283
9188
|
const node = super.create(value);
|
|
9284
9189
|
if (typeof value === "string") {
|
|
@@ -9315,10 +9220,11 @@ class Image extends EmbedBlot$1 {
|
|
|
9315
9220
|
}
|
|
9316
9221
|
}
|
|
9317
9222
|
}
|
|
9318
|
-
__publicField(Image, "blotName", "image");
|
|
9319
|
-
__publicField(Image, "tagName", "IMG");
|
|
9320
9223
|
const ATTRIBUTES = ["height", "width"];
|
|
9321
9224
|
class Video extends BlockEmbed {
|
|
9225
|
+
static blotName = "video";
|
|
9226
|
+
static className = "ql-video";
|
|
9227
|
+
static tagName = "IFRAME";
|
|
9322
9228
|
static create(value) {
|
|
9323
9229
|
const node = super.create(value);
|
|
9324
9230
|
node.setAttribute("frameborder", "0");
|
|
@@ -9358,9 +9264,6 @@ class Video extends BlockEmbed {
|
|
|
9358
9264
|
return `<a href="${video}">${video}</a>`;
|
|
9359
9265
|
}
|
|
9360
9266
|
}
|
|
9361
|
-
__publicField(Video, "blotName", "video");
|
|
9362
|
-
__publicField(Video, "className", "ql-video");
|
|
9363
|
-
__publicField(Video, "tagName", "IFRAME");
|
|
9364
9267
|
const TokenAttributor = new ClassAttributor$1("code-token", "hljs", {
|
|
9365
9268
|
scope: Scope.INLINE
|
|
9366
9269
|
});
|
|
@@ -9666,7 +9569,9 @@ Syntax.DEFAULTS = {
|
|
|
9666
9569
|
label: "SQL"
|
|
9667
9570
|
}]
|
|
9668
9571
|
};
|
|
9669
|
-
|
|
9572
|
+
class TableCell extends Block {
|
|
9573
|
+
static blotName = "table";
|
|
9574
|
+
static tagName = "TD";
|
|
9670
9575
|
static create(value) {
|
|
9671
9576
|
const node = super.create();
|
|
9672
9577
|
if (value) {
|
|
@@ -9689,7 +9594,7 @@ const _TableCell = class _TableCell extends Block {
|
|
|
9689
9594
|
return -1;
|
|
9690
9595
|
}
|
|
9691
9596
|
format(name2, value) {
|
|
9692
|
-
if (name2 ===
|
|
9597
|
+
if (name2 === TableCell.blotName && value) {
|
|
9693
9598
|
this.domNode.setAttribute("data-row", value);
|
|
9694
9599
|
} else {
|
|
9695
9600
|
super.format(name2, value);
|
|
@@ -9707,11 +9612,10 @@ const _TableCell = class _TableCell extends Block {
|
|
|
9707
9612
|
table() {
|
|
9708
9613
|
return this.row() && this.row().table();
|
|
9709
9614
|
}
|
|
9710
|
-
}
|
|
9711
|
-
__publicField(_TableCell, "blotName", "table");
|
|
9712
|
-
__publicField(_TableCell, "tagName", "TD");
|
|
9713
|
-
let TableCell = _TableCell;
|
|
9615
|
+
}
|
|
9714
9616
|
class TableRow extends Container {
|
|
9617
|
+
static blotName = "table-row";
|
|
9618
|
+
static tagName = "TR";
|
|
9715
9619
|
checkMerge() {
|
|
9716
9620
|
if (super.checkMerge() && this.next.children.head != null) {
|
|
9717
9621
|
const thisHead = this.children.head.formats();
|
|
@@ -9749,13 +9653,13 @@ class TableRow extends Container {
|
|
|
9749
9653
|
return this.parent && this.parent.parent;
|
|
9750
9654
|
}
|
|
9751
9655
|
}
|
|
9752
|
-
__publicField(TableRow, "blotName", "table-row");
|
|
9753
|
-
__publicField(TableRow, "tagName", "TR");
|
|
9754
9656
|
class TableBody extends Container {
|
|
9657
|
+
static blotName = "table-body";
|
|
9658
|
+
static tagName = "TBODY";
|
|
9755
9659
|
}
|
|
9756
|
-
__publicField(TableBody, "blotName", "table-body");
|
|
9757
|
-
__publicField(TableBody, "tagName", "TBODY");
|
|
9758
9660
|
class TableContainer extends Container {
|
|
9661
|
+
static blotName = "table-container";
|
|
9662
|
+
static tagName = "TABLE";
|
|
9759
9663
|
balanceCells() {
|
|
9760
9664
|
const rows = this.descendants(TableRow);
|
|
9761
9665
|
const maxColumns = rows.reduce((max2, row) => {
|
|
@@ -9814,8 +9718,6 @@ class TableContainer extends Container {
|
|
|
9814
9718
|
return body.children.map((row) => row);
|
|
9815
9719
|
}
|
|
9816
9720
|
}
|
|
9817
|
-
__publicField(TableContainer, "blotName", "table-container");
|
|
9818
|
-
__publicField(TableContainer, "tagName", "TABLE");
|
|
9819
9721
|
TableContainer.allowedChildren = [TableBody];
|
|
9820
9722
|
TableBody.requiredContainer = TableContainer;
|
|
9821
9723
|
TableBody.allowedChildren = [TableRow];
|
|
@@ -9944,13 +9846,12 @@ class Table extends Module {
|
|
|
9944
9846
|
const debug = namespace("quill:toolbar");
|
|
9945
9847
|
class Toolbar extends Module {
|
|
9946
9848
|
constructor(quill, options) {
|
|
9947
|
-
var _a, _b;
|
|
9948
9849
|
super(quill, options);
|
|
9949
9850
|
if (Array.isArray(this.options.container)) {
|
|
9950
9851
|
const container = document.createElement("div");
|
|
9951
9852
|
container.setAttribute("role", "toolbar");
|
|
9952
9853
|
addControls(container, this.options.container);
|
|
9953
|
-
|
|
9854
|
+
quill.container?.parentNode?.insertBefore(container, quill.container);
|
|
9954
9855
|
this.container = container;
|
|
9955
9856
|
} else if (typeof this.options.container === "string") {
|
|
9956
9857
|
this.container = document.querySelector(this.options.container);
|
|
@@ -9966,8 +9867,7 @@ class Toolbar extends Module {
|
|
|
9966
9867
|
this.handlers = {};
|
|
9967
9868
|
if (this.options.handlers) {
|
|
9968
9869
|
Object.keys(this.options.handlers).forEach((format) => {
|
|
9969
|
-
|
|
9970
|
-
const handler = (_a2 = this.options.handlers) == null ? void 0 : _a2[format];
|
|
9870
|
+
const handler = this.options.handlers?.[format];
|
|
9971
9871
|
if (handler) {
|
|
9972
9872
|
this.addHandler(format, handler);
|
|
9973
9873
|
}
|
|
@@ -10753,6 +10653,7 @@ const TOOLBAR_CONFIG$1 = [["bold", "italic", "link"], [{
|
|
|
10753
10653
|
header: 2
|
|
10754
10654
|
}, "blockquote"]];
|
|
10755
10655
|
class BubbleTooltip extends BaseTooltip {
|
|
10656
|
+
static TEMPLATE = ['<span class="ql-tooltip-arrow"></span>', '<div class="ql-tooltip-editor">', '<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">', '<a class="ql-close"></a>', "</div>"].join("");
|
|
10756
10657
|
constructor(quill, bounds) {
|
|
10757
10658
|
super(quill, bounds);
|
|
10758
10659
|
this.quill.on(Emitter.events.EDITOR_CHANGE, (type2, range, oldRange, source) => {
|
|
@@ -10813,7 +10714,6 @@ class BubbleTooltip extends BaseTooltip {
|
|
|
10813
10714
|
return shift;
|
|
10814
10715
|
}
|
|
10815
10716
|
}
|
|
10816
|
-
__publicField(BubbleTooltip, "TEMPLATE", ['<span class="ql-tooltip-arrow"></span>', '<div class="ql-tooltip-editor">', '<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">', '<a class="ql-close"></a>', "</div>"].join(""));
|
|
10817
10717
|
class BubbleTheme extends BaseTheme {
|
|
10818
10718
|
constructor(quill, options) {
|
|
10819
10719
|
if (options.modules.toolbar != null && options.modules.toolbar.container == null) {
|
|
@@ -10854,10 +10754,8 @@ const TOOLBAR_CONFIG = [[{
|
|
|
10854
10754
|
list: "bullet"
|
|
10855
10755
|
}], ["clean"]];
|
|
10856
10756
|
class SnowTooltip extends BaseTooltip {
|
|
10857
|
-
|
|
10858
|
-
|
|
10859
|
-
__publicField(this, "preview", this.root.querySelector("a.ql-preview"));
|
|
10860
|
-
}
|
|
10757
|
+
static TEMPLATE = ['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>', '<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">', '<a class="ql-action"></a>', '<a class="ql-remove"></a>'].join("");
|
|
10758
|
+
preview = this.root.querySelector("a.ql-preview");
|
|
10861
10759
|
listen() {
|
|
10862
10760
|
super.listen();
|
|
10863
10761
|
this.root.querySelector("a.ql-action").addEventListener("click", (event) => {
|
|
@@ -10905,7 +10803,6 @@ class SnowTooltip extends BaseTooltip {
|
|
|
10905
10803
|
this.root.removeAttribute("data-mode");
|
|
10906
10804
|
}
|
|
10907
10805
|
}
|
|
10908
|
-
__publicField(SnowTooltip, "TEMPLATE", ['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>', '<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">', '<a class="ql-action"></a>', '<a class="ql-remove"></a>'].join(""));
|
|
10909
10806
|
class SnowTheme extends BaseTheme {
|
|
10910
10807
|
constructor(quill, options) {
|
|
10911
10808
|
if (options.modules.toolbar != null && options.modules.toolbar.container == null) {
|
|
@@ -13737,10 +13634,10 @@ function getMdiIcon(name2, value = "") {
|
|
|
13737
13634
|
}
|
|
13738
13635
|
const className = (...names) => names.join(" ");
|
|
13739
13636
|
class ExtendedColorPicker extends ColorPicker {
|
|
13637
|
+
quill;
|
|
13638
|
+
type;
|
|
13740
13639
|
constructor(quill, options) {
|
|
13741
13640
|
super(options.select, options.label);
|
|
13742
|
-
__publicField(this, "quill");
|
|
13743
|
-
__publicField(this, "type");
|
|
13744
13641
|
this.quill = quill;
|
|
13745
13642
|
this.type = options.type;
|
|
13746
13643
|
}
|
|
@@ -13777,9 +13674,9 @@ function createIcon(name2) {
|
|
|
13777
13674
|
return icon;
|
|
13778
13675
|
}
|
|
13779
13676
|
class ExtendedTooltip extends Tooltip {
|
|
13677
|
+
isOpen;
|
|
13780
13678
|
constructor(quill, bounds) {
|
|
13781
13679
|
super(quill, bounds);
|
|
13782
|
-
__publicField(this, "isOpen");
|
|
13783
13680
|
this._onClick = this._onClick.bind(this);
|
|
13784
13681
|
this.isOpen = false;
|
|
13785
13682
|
}
|
|
@@ -13804,20 +13701,26 @@ class ExtendedTooltip extends Tooltip {
|
|
|
13804
13701
|
}
|
|
13805
13702
|
}
|
|
13806
13703
|
class ImageEmbedTooltip extends ExtendedTooltip {
|
|
13704
|
+
static TEMPLATE = `
|
|
13705
|
+
<div class="controls">
|
|
13706
|
+
<label>Enter image url:</label>
|
|
13707
|
+
<input class="url" type="text">
|
|
13708
|
+
<a class="action">Save</a>
|
|
13709
|
+
</div>
|
|
13710
|
+
`;
|
|
13711
|
+
padding;
|
|
13712
|
+
textbox;
|
|
13713
|
+
btnAction;
|
|
13807
13714
|
constructor(quill, bounds, { spacing = 0 } = {}) {
|
|
13808
13715
|
super(quill, bounds);
|
|
13809
|
-
__publicField(this, "padding");
|
|
13810
|
-
__publicField(this, "textbox");
|
|
13811
|
-
__publicField(this, "btnAction");
|
|
13812
13716
|
this.padding = " ".repeat(spacing);
|
|
13813
13717
|
this.textbox = this.root.querySelector("input.url");
|
|
13814
13718
|
this.btnAction = this.root.querySelector("a.action");
|
|
13815
13719
|
this.listen();
|
|
13816
13720
|
}
|
|
13817
13721
|
listen() {
|
|
13818
|
-
|
|
13819
|
-
|
|
13820
|
-
(_b = this.textbox) == null ? void 0 : _b.addEventListener("keydown", (e) => {
|
|
13722
|
+
this.btnAction?.addEventListener("click", () => this.embedImage());
|
|
13723
|
+
this.textbox?.addEventListener("keydown", (e) => {
|
|
13821
13724
|
if (Keyboard.match(e, { key: "enter" })) {
|
|
13822
13725
|
this.embedImage();
|
|
13823
13726
|
e.preventDefault();
|
|
@@ -13828,14 +13731,12 @@ class ImageEmbedTooltip extends ExtendedTooltip {
|
|
|
13828
13731
|
});
|
|
13829
13732
|
}
|
|
13830
13733
|
show() {
|
|
13831
|
-
var _a;
|
|
13832
13734
|
super.show();
|
|
13833
13735
|
this.root.classList.add("ql-image-embed");
|
|
13834
|
-
|
|
13736
|
+
this.textbox?.select();
|
|
13835
13737
|
}
|
|
13836
13738
|
embedImage() {
|
|
13837
|
-
|
|
13838
|
-
const url = (_a = this.textbox) == null ? void 0 : _a.value;
|
|
13739
|
+
const url = this.textbox?.value;
|
|
13839
13740
|
if (!url) return;
|
|
13840
13741
|
const { quill } = this;
|
|
13841
13742
|
const range = quill.getSelection(true);
|
|
@@ -13855,14 +13756,8 @@ class ImageEmbedTooltip extends ExtendedTooltip {
|
|
|
13855
13756
|
this.hide();
|
|
13856
13757
|
}
|
|
13857
13758
|
}
|
|
13858
|
-
__publicField(ImageEmbedTooltip, "TEMPLATE", `
|
|
13859
|
-
<div class="controls">
|
|
13860
|
-
<label>Enter image url:</label>
|
|
13861
|
-
<input class="url" type="text">
|
|
13862
|
-
<a class="action">Save</a>
|
|
13863
|
-
</div>
|
|
13864
|
-
`);
|
|
13865
13759
|
class ImageEmbed extends Module {
|
|
13760
|
+
static NAME = "imageEmbed";
|
|
13866
13761
|
constructor(quill, options = {}) {
|
|
13867
13762
|
super(quill, options);
|
|
13868
13763
|
const { bounds } = quill.options;
|
|
@@ -13871,7 +13766,6 @@ class ImageEmbed extends Module {
|
|
|
13871
13766
|
toolbar.handlers.image = () => tooltip.show();
|
|
13872
13767
|
}
|
|
13873
13768
|
}
|
|
13874
|
-
__publicField(ImageEmbed, "NAME", "imageEmbed");
|
|
13875
13769
|
const colors = [
|
|
13876
13770
|
"#000000",
|
|
13877
13771
|
"#e60000",
|
|
@@ -13926,10 +13820,16 @@ const createTooltip = (input, showDelay = 350) => {
|
|
|
13926
13820
|
});
|
|
13927
13821
|
};
|
|
13928
13822
|
const createCustomTheme = () => {
|
|
13929
|
-
var _a;
|
|
13930
13823
|
Quill.register(`modules/${ImageEmbed.NAME}`, ImageEmbed, true);
|
|
13931
13824
|
const { toolbar } = SnowTheme.DEFAULTS.modules;
|
|
13932
|
-
return
|
|
13825
|
+
return class TailorTheme extends SnowTheme {
|
|
13826
|
+
static NAME = "tailor";
|
|
13827
|
+
static DEFAULTS = {
|
|
13828
|
+
modules: {
|
|
13829
|
+
toolbar,
|
|
13830
|
+
[ImageEmbed.NAME]: true
|
|
13831
|
+
}
|
|
13832
|
+
};
|
|
13933
13833
|
extendToolbar(toolbar2) {
|
|
13934
13834
|
super.extendToolbar(toolbar2);
|
|
13935
13835
|
this.pickers.forEach((picker) => createTooltip(picker));
|
|
@@ -13983,12 +13883,7 @@ const createCustomTheme = () => {
|
|
|
13983
13883
|
this.pickers.push(new IconPicker(align, icons2));
|
|
13984
13884
|
}
|
|
13985
13885
|
}
|
|
13986
|
-
}
|
|
13987
|
-
modules: {
|
|
13988
|
-
toolbar,
|
|
13989
|
-
[ImageEmbed.NAME]: true
|
|
13990
|
-
}
|
|
13991
|
-
}), _a;
|
|
13886
|
+
};
|
|
13992
13887
|
};
|
|
13993
13888
|
function buildButton(button) {
|
|
13994
13889
|
let name2 = Array.from(button.classList).find(
|
|
@@ -14042,10 +13937,10 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
14042
13937
|
container: "#quillToolbar",
|
|
14043
13938
|
handlers: {
|
|
14044
13939
|
redo() {
|
|
14045
|
-
quill
|
|
13940
|
+
quill?.history.redo();
|
|
14046
13941
|
},
|
|
14047
13942
|
undo() {
|
|
14048
|
-
quill
|
|
13943
|
+
quill?.history.undo();
|
|
14049
13944
|
}
|
|
14050
13945
|
}
|
|
14051
13946
|
}
|
|
@@ -14060,8 +13955,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
14060
13955
|
}
|
|
14061
13956
|
};
|
|
14062
13957
|
onMounted(() => {
|
|
14063
|
-
|
|
14064
|
-
quill = ((_a = editor.value) == null ? void 0 : _a.initialize(Quill)) ?? null;
|
|
13958
|
+
quill = editor.value?.initialize(Quill) ?? null;
|
|
14065
13959
|
});
|
|
14066
13960
|
return (_ctx, _cache) => {
|
|
14067
13961
|
return openBlock(), createBlock(unref(y), {
|
|
@@ -14089,10 +13983,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
14089
13983
|
__name: "Edit",
|
|
14090
13984
|
props: {
|
|
14091
13985
|
element: {},
|
|
14092
|
-
isFocused: { type: Boolean, default: false },
|
|
14093
|
-
isDisabled: { type: Boolean, default: false },
|
|
14094
13986
|
isDragged: { type: Boolean, default: false },
|
|
14095
|
-
|
|
13987
|
+
isFocused: { type: Boolean, default: false },
|
|
13988
|
+
isReadonly: { type: Boolean, default: false }
|
|
14096
13989
|
},
|
|
14097
13990
|
emits: ["save"],
|
|
14098
13991
|
setup(__props, { emit: __emit }) {
|
|
@@ -14101,8 +13994,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
14101
13994
|
const content = ref(props.element.data.content ?? "");
|
|
14102
13995
|
const isEmpty = computed(() => !content.value.replace(/<[^>]*>/g, ""));
|
|
14103
13996
|
const hasChanges = computed(() => {
|
|
14104
|
-
|
|
14105
|
-
const previousValue = ((_b = (_a = props.element) == null ? void 0 : _a.data) == null ? void 0 : _b.content) ?? "";
|
|
13997
|
+
const previousValue = props.element?.data?.content ?? "";
|
|
14106
13998
|
return previousValue !== content.value;
|
|
14107
13999
|
});
|
|
14108
14000
|
const save = () => {
|
|
@@ -14116,7 +14008,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
14116
14008
|
);
|
|
14117
14009
|
watch(
|
|
14118
14010
|
content,
|
|
14119
|
-
debounce$
|
|
14011
|
+
debounce$2(() => save(), 4e3)
|
|
14120
14012
|
);
|
|
14121
14013
|
return (_ctx, _cache) => {
|
|
14122
14014
|
return openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
@@ -14142,7 +14034,7 @@ const _export_sfc = (sfc, props) => {
|
|
|
14142
14034
|
}
|
|
14143
14035
|
return target;
|
|
14144
14036
|
};
|
|
14145
|
-
const Edit = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
14037
|
+
const Edit = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-2683bfaf"]]);
|
|
14146
14038
|
const _sfc_main = {};
|
|
14147
14039
|
const _hoisted_1 = { class: "tce-html-toolbar" };
|
|
14148
14040
|
function _sfc_render(_ctx, _cache) {
|