@harbour-enterprises/superdoc 0.20.0-next.4 → 0.20.0-next.5
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/chunks/{PdfViewer-Ne_-LxpG.cjs → PdfViewer-Blwty0A0.cjs} +1 -1
- package/dist/chunks/{PdfViewer-BjZBgs8x.es.js → PdfViewer-DcPZsBsK.es.js} +1 -1
- package/dist/chunks/{index-OFvCtpf7.cjs → index-BB5vhzVT.cjs} +2 -2
- package/dist/chunks/{index-BVjAJUtV.es.js → index-BZzn2Rcn.es.js} +2 -2
- package/dist/chunks/{super-editor.es-DgTNVbvS.es.js → super-editor.es-BTcVSa_f.es.js} +1056 -843
- package/dist/chunks/{super-editor.es-CCU9etUT.cjs → super-editor.es-BgBNGRxg.cjs} +1056 -843
- package/dist/core/SuperDoc.d.ts.map +1 -1
- package/dist/super-editor/ai-writer.es.js +1 -1
- package/dist/super-editor/chunks/{editor-C1C_smD4.js → editor-hh7sL4Wv.js} +632 -432
- package/dist/super-editor/chunks/{toolbar-pP4CmNcz.js → toolbar-B-apzt27.js} +1 -1
- package/dist/super-editor/editor.es.js +1 -1
- package/dist/super-editor/src/extensions/image/imageHelpers/handleBase64.d.ts +1 -0
- package/dist/super-editor/src/extensions/image/imageHelpers/handleUrl.d.ts +2 -0
- package/dist/super-editor/src/extensions/image/imageHelpers/imageRegistrationPlugin.d.ts +11 -0
- package/dist/super-editor/src/extensions/image/imageHelpers/index.d.ts +1 -1
- package/dist/super-editor/src/extensions/image/imageHelpers/processUploadedImage.d.ts +2 -2
- package/dist/super-editor/src/extensions/image/imageHelpers/startImageUpload.d.ts +18 -23
- package/dist/super-editor/super-editor.es.js +60 -45
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +1 -1
- package/dist/super-editor.es.js +1 -1
- package/dist/superdoc.cjs +2 -2
- package/dist/superdoc.es.js +2 -2
- package/dist/superdoc.umd.js +1684 -1471
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
- package/dist/super-editor/src/extensions/image/imageHelpers/imagePlaceholderPlugin.d.ts +0 -5
|
@@ -22,8 +22,8 @@ var __defProp$2 = Object.defineProperty;
|
|
|
22
22
|
var __typeError$2 = (msg2) => {
|
|
23
23
|
throw TypeError(msg2);
|
|
24
24
|
};
|
|
25
|
-
var __defNormalProp$2 = (obj,
|
|
26
|
-
var __publicField$2 = (obj,
|
|
25
|
+
var __defNormalProp$2 = (obj, key2, value) => key2 in obj ? __defProp$2(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value;
|
|
26
|
+
var __publicField$2 = (obj, key2, value) => __defNormalProp$2(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value);
|
|
27
27
|
var __accessCheck$2 = (obj, member, msg2) => member.has(obj) || __typeError$2("Cannot " + msg2);
|
|
28
28
|
var __privateAdd$2 = (obj, member, value) => member.has(obj) ? __typeError$2("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
29
29
|
var __privateMethod$2 = (obj, member, method) => (__accessCheck$2(obj, member, "access private method"), method);
|
|
@@ -2045,11 +2045,11 @@ function requireEvents() {
|
|
|
2045
2045
|
}
|
|
2046
2046
|
if (arguments.length === 0) {
|
|
2047
2047
|
var keys2 = Object.keys(events2);
|
|
2048
|
-
var
|
|
2048
|
+
var key2;
|
|
2049
2049
|
for (i = 0; i < keys2.length; ++i) {
|
|
2050
|
-
|
|
2051
|
-
if (
|
|
2052
|
-
this.removeAllListeners(
|
|
2050
|
+
key2 = keys2[i];
|
|
2051
|
+
if (key2 === "removeListener") continue;
|
|
2052
|
+
this.removeAllListeners(key2);
|
|
2053
2053
|
}
|
|
2054
2054
|
this.removeAllListeners("removeListener");
|
|
2055
2055
|
this._events = /* @__PURE__ */ Object.create(null);
|
|
@@ -6133,8 +6133,8 @@ function requireUtil() {
|
|
|
6133
6133
|
if (array) {
|
|
6134
6134
|
output = formatArray(ctx2, value, recurseTimes, visibleKeys, keys2);
|
|
6135
6135
|
} else {
|
|
6136
|
-
output = keys2.map(function(
|
|
6137
|
-
return formatProperty(ctx2, value, recurseTimes, visibleKeys,
|
|
6136
|
+
output = keys2.map(function(key2) {
|
|
6137
|
+
return formatProperty(ctx2, value, recurseTimes, visibleKeys, key2, array);
|
|
6138
6138
|
});
|
|
6139
6139
|
}
|
|
6140
6140
|
ctx2.seen.pop();
|
|
@@ -6173,23 +6173,23 @@ function requireUtil() {
|
|
|
6173
6173
|
output.push("");
|
|
6174
6174
|
}
|
|
6175
6175
|
}
|
|
6176
|
-
keys2.forEach(function(
|
|
6177
|
-
if (!
|
|
6176
|
+
keys2.forEach(function(key2) {
|
|
6177
|
+
if (!key2.match(/^\d+$/)) {
|
|
6178
6178
|
output.push(formatProperty(
|
|
6179
6179
|
ctx2,
|
|
6180
6180
|
value,
|
|
6181
6181
|
recurseTimes,
|
|
6182
6182
|
visibleKeys,
|
|
6183
|
-
|
|
6183
|
+
key2,
|
|
6184
6184
|
true
|
|
6185
6185
|
));
|
|
6186
6186
|
}
|
|
6187
6187
|
});
|
|
6188
6188
|
return output;
|
|
6189
6189
|
}
|
|
6190
|
-
function formatProperty(ctx2, value, recurseTimes, visibleKeys,
|
|
6190
|
+
function formatProperty(ctx2, value, recurseTimes, visibleKeys, key2, array) {
|
|
6191
6191
|
var name, str, desc;
|
|
6192
|
-
desc = Object.getOwnPropertyDescriptor(value,
|
|
6192
|
+
desc = Object.getOwnPropertyDescriptor(value, key2) || { value: value[key2] };
|
|
6193
6193
|
if (desc.get) {
|
|
6194
6194
|
if (desc.set) {
|
|
6195
6195
|
str = ctx2.stylize("[Getter/Setter]", "special");
|
|
@@ -6201,8 +6201,8 @@ function requireUtil() {
|
|
|
6201
6201
|
str = ctx2.stylize("[Setter]", "special");
|
|
6202
6202
|
}
|
|
6203
6203
|
}
|
|
6204
|
-
if (!hasOwnProperty2(visibleKeys,
|
|
6205
|
-
name = "[" +
|
|
6204
|
+
if (!hasOwnProperty2(visibleKeys, key2)) {
|
|
6205
|
+
name = "[" + key2 + "]";
|
|
6206
6206
|
}
|
|
6207
6207
|
if (!str) {
|
|
6208
6208
|
if (ctx2.seen.indexOf(desc.value) < 0) {
|
|
@@ -6227,10 +6227,10 @@ function requireUtil() {
|
|
|
6227
6227
|
}
|
|
6228
6228
|
}
|
|
6229
6229
|
if (isUndefined(name)) {
|
|
6230
|
-
if (array &&
|
|
6230
|
+
if (array && key2.match(/^\d+$/)) {
|
|
6231
6231
|
return str;
|
|
6232
6232
|
}
|
|
6233
|
-
name = JSON.stringify("" +
|
|
6233
|
+
name = JSON.stringify("" + key2);
|
|
6234
6234
|
if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
|
|
6235
6235
|
name = name.slice(1, -1);
|
|
6236
6236
|
name = ctx2.stylize(name, "name");
|
|
@@ -6475,20 +6475,20 @@ function requireBuffer_list() {
|
|
|
6475
6475
|
function _objectSpread(target) {
|
|
6476
6476
|
for (var i = 1; i < arguments.length; i++) {
|
|
6477
6477
|
var source = null != arguments[i] ? arguments[i] : {};
|
|
6478
|
-
i % 2 ? ownKeys(Object(source), true).forEach(function(
|
|
6479
|
-
_defineProperty(target,
|
|
6480
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(
|
|
6481
|
-
Object.defineProperty(target,
|
|
6478
|
+
i % 2 ? ownKeys(Object(source), true).forEach(function(key2) {
|
|
6479
|
+
_defineProperty(target, key2, source[key2]);
|
|
6480
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key2) {
|
|
6481
|
+
Object.defineProperty(target, key2, Object.getOwnPropertyDescriptor(source, key2));
|
|
6482
6482
|
});
|
|
6483
6483
|
}
|
|
6484
6484
|
return target;
|
|
6485
6485
|
}
|
|
6486
|
-
function _defineProperty(obj,
|
|
6487
|
-
|
|
6488
|
-
if (
|
|
6489
|
-
Object.defineProperty(obj,
|
|
6486
|
+
function _defineProperty(obj, key2, value) {
|
|
6487
|
+
key2 = _toPropertyKey(key2);
|
|
6488
|
+
if (key2 in obj) {
|
|
6489
|
+
Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true });
|
|
6490
6490
|
} else {
|
|
6491
|
-
obj[
|
|
6491
|
+
obj[key2] = value;
|
|
6492
6492
|
}
|
|
6493
6493
|
return obj;
|
|
6494
6494
|
}
|
|
@@ -6512,8 +6512,8 @@ function requireBuffer_list() {
|
|
|
6512
6512
|
return Constructor;
|
|
6513
6513
|
}
|
|
6514
6514
|
function _toPropertyKey(arg) {
|
|
6515
|
-
var
|
|
6516
|
-
return typeof
|
|
6515
|
+
var key2 = _toPrimitive(arg, "string");
|
|
6516
|
+
return typeof key2 === "symbol" ? key2 : String(key2);
|
|
6517
6517
|
}
|
|
6518
6518
|
function _toPrimitive(input, hint) {
|
|
6519
6519
|
if (typeof input !== "object" || input === null) return input;
|
|
@@ -7426,7 +7426,7 @@ function require_stream_duplex() {
|
|
|
7426
7426
|
hasRequired_stream_duplex = 1;
|
|
7427
7427
|
var objectKeys = Object.keys || function(obj) {
|
|
7428
7428
|
var keys3 = [];
|
|
7429
|
-
for (var
|
|
7429
|
+
for (var key2 in obj) keys3.push(key2);
|
|
7430
7430
|
return keys3;
|
|
7431
7431
|
};
|
|
7432
7432
|
_stream_duplex = Duplex;
|
|
@@ -7519,8 +7519,8 @@ function requireSafeBuffer() {
|
|
|
7519
7519
|
var buffer2 = requireDist();
|
|
7520
7520
|
var Buffer3 = buffer2.Buffer;
|
|
7521
7521
|
function copyProps(src, dst) {
|
|
7522
|
-
for (var
|
|
7523
|
-
dst[
|
|
7522
|
+
for (var key2 in src) {
|
|
7523
|
+
dst[key2] = src[key2];
|
|
7524
7524
|
}
|
|
7525
7525
|
}
|
|
7526
7526
|
if (Buffer3.from && Buffer3.alloc && Buffer3.allocUnsafe && Buffer3.allocUnsafeSlow) {
|
|
@@ -7902,18 +7902,18 @@ function requireAsync_iterator() {
|
|
|
7902
7902
|
if (hasRequiredAsync_iterator) return async_iterator;
|
|
7903
7903
|
hasRequiredAsync_iterator = 1;
|
|
7904
7904
|
var _Object$setPrototypeO;
|
|
7905
|
-
function _defineProperty(obj,
|
|
7906
|
-
|
|
7907
|
-
if (
|
|
7908
|
-
Object.defineProperty(obj,
|
|
7905
|
+
function _defineProperty(obj, key2, value) {
|
|
7906
|
+
key2 = _toPropertyKey(key2);
|
|
7907
|
+
if (key2 in obj) {
|
|
7908
|
+
Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true });
|
|
7909
7909
|
} else {
|
|
7910
|
-
obj[
|
|
7910
|
+
obj[key2] = value;
|
|
7911
7911
|
}
|
|
7912
7912
|
return obj;
|
|
7913
7913
|
}
|
|
7914
7914
|
function _toPropertyKey(arg) {
|
|
7915
|
-
var
|
|
7916
|
-
return typeof
|
|
7915
|
+
var key2 = _toPrimitive(arg, "string");
|
|
7916
|
+
return typeof key2 === "symbol" ? key2 : String(key2);
|
|
7917
7917
|
}
|
|
7918
7918
|
function _toPrimitive(input, hint) {
|
|
7919
7919
|
if (typeof input !== "object" || input === null) return input;
|
|
@@ -9692,10 +9692,10 @@ function requireSax() {
|
|
|
9692
9692
|
"hearts": 9829,
|
|
9693
9693
|
"diams": 9830
|
|
9694
9694
|
};
|
|
9695
|
-
Object.keys(sax2.ENTITIES).forEach(function(
|
|
9696
|
-
var e = sax2.ENTITIES[
|
|
9695
|
+
Object.keys(sax2.ENTITIES).forEach(function(key2) {
|
|
9696
|
+
var e = sax2.ENTITIES[key2];
|
|
9697
9697
|
var s2 = typeof e === "number" ? String.fromCharCode(e) : e;
|
|
9698
|
-
sax2.ENTITIES[
|
|
9698
|
+
sax2.ENTITIES[key2] = s2;
|
|
9699
9699
|
});
|
|
9700
9700
|
for (var s in sax2.STATE) {
|
|
9701
9701
|
sax2.STATE[sax2.STATE[s]] = s;
|
|
@@ -10579,10 +10579,10 @@ function requireOptionsHelper() {
|
|
|
10579
10579
|
var isArray2 = requireArrayHelper().isArray;
|
|
10580
10580
|
optionsHelper = {
|
|
10581
10581
|
copyOptions: function(options) {
|
|
10582
|
-
var
|
|
10583
|
-
for (
|
|
10584
|
-
if (options.hasOwnProperty(
|
|
10585
|
-
copy2[
|
|
10582
|
+
var key2, copy2 = {};
|
|
10583
|
+
for (key2 in options) {
|
|
10584
|
+
if (options.hasOwnProperty(key2)) {
|
|
10585
|
+
copy2[key2] = options[key2];
|
|
10586
10586
|
}
|
|
10587
10587
|
}
|
|
10588
10588
|
return copy2;
|
|
@@ -10602,13 +10602,13 @@ function requireOptionsHelper() {
|
|
|
10602
10602
|
options.alwaysArray = false;
|
|
10603
10603
|
}
|
|
10604
10604
|
},
|
|
10605
|
-
ensureKeyExists: function(
|
|
10606
|
-
if (!(
|
|
10607
|
-
options[
|
|
10605
|
+
ensureKeyExists: function(key2, options) {
|
|
10606
|
+
if (!(key2 + "Key" in options) || typeof options[key2 + "Key"] !== "string") {
|
|
10607
|
+
options[key2 + "Key"] = options.compact ? "_" + key2 : key2;
|
|
10608
10608
|
}
|
|
10609
10609
|
},
|
|
10610
|
-
checkFnExists: function(
|
|
10611
|
-
return
|
|
10610
|
+
checkFnExists: function(key2, options) {
|
|
10611
|
+
return key2 + "Fn" in options;
|
|
10612
10612
|
}
|
|
10613
10613
|
};
|
|
10614
10614
|
return optionsHelper;
|
|
@@ -10679,7 +10679,7 @@ function requireXml2js() {
|
|
|
10679
10679
|
return value;
|
|
10680
10680
|
}
|
|
10681
10681
|
function addField(type2, value) {
|
|
10682
|
-
var
|
|
10682
|
+
var key2;
|
|
10683
10683
|
if (options.compact) {
|
|
10684
10684
|
if (!currentElement[options[type2 + "Key"]] && (isArray2(options.alwaysArray) ? options.alwaysArray.indexOf(options[type2 + "Key"]) !== -1 : options.alwaysArray)) {
|
|
10685
10685
|
currentElement[options[type2 + "Key"]] = [];
|
|
@@ -10691,14 +10691,14 @@ function requireXml2js() {
|
|
|
10691
10691
|
value = options[type2 + "Fn"](value, currentElement);
|
|
10692
10692
|
}
|
|
10693
10693
|
if (type2 === "instruction" && ("instructionFn" in options || "instructionNameFn" in options)) {
|
|
10694
|
-
for (
|
|
10695
|
-
if (value.hasOwnProperty(
|
|
10694
|
+
for (key2 in value) {
|
|
10695
|
+
if (value.hasOwnProperty(key2)) {
|
|
10696
10696
|
if ("instructionFn" in options) {
|
|
10697
|
-
value[
|
|
10697
|
+
value[key2] = options.instructionFn(value[key2], key2, currentElement);
|
|
10698
10698
|
} else {
|
|
10699
|
-
var temp = value[
|
|
10700
|
-
delete value[
|
|
10701
|
-
value[options.instructionNameFn(
|
|
10699
|
+
var temp = value[key2];
|
|
10700
|
+
delete value[key2];
|
|
10701
|
+
value[options.instructionNameFn(key2, temp, currentElement)] = temp;
|
|
10702
10702
|
}
|
|
10703
10703
|
}
|
|
10704
10704
|
}
|
|
@@ -10715,22 +10715,22 @@ function requireXml2js() {
|
|
|
10715
10715
|
var element = {};
|
|
10716
10716
|
element[options.typeKey] = type2;
|
|
10717
10717
|
if (type2 === "instruction") {
|
|
10718
|
-
for (
|
|
10719
|
-
if (value.hasOwnProperty(
|
|
10718
|
+
for (key2 in value) {
|
|
10719
|
+
if (value.hasOwnProperty(key2)) {
|
|
10720
10720
|
break;
|
|
10721
10721
|
}
|
|
10722
10722
|
}
|
|
10723
|
-
element[options.nameKey] = "instructionNameFn" in options ? options.instructionNameFn(
|
|
10723
|
+
element[options.nameKey] = "instructionNameFn" in options ? options.instructionNameFn(key2, value, currentElement) : key2;
|
|
10724
10724
|
if (options.instructionHasAttributes) {
|
|
10725
|
-
element[options.attributesKey] = value[
|
|
10725
|
+
element[options.attributesKey] = value[key2][options.attributesKey];
|
|
10726
10726
|
if ("instructionFn" in options) {
|
|
10727
|
-
element[options.attributesKey] = options.instructionFn(element[options.attributesKey],
|
|
10727
|
+
element[options.attributesKey] = options.instructionFn(element[options.attributesKey], key2, currentElement);
|
|
10728
10728
|
}
|
|
10729
10729
|
} else {
|
|
10730
10730
|
if ("instructionFn" in options) {
|
|
10731
|
-
value[
|
|
10731
|
+
value[key2] = options.instructionFn(value[key2], key2, currentElement);
|
|
10732
10732
|
}
|
|
10733
|
-
element[options.instructionKey] = value[
|
|
10733
|
+
element[options.instructionKey] = value[key2];
|
|
10734
10734
|
}
|
|
10735
10735
|
} else {
|
|
10736
10736
|
if (type2 + "Fn" in options) {
|
|
@@ -10749,18 +10749,18 @@ function requireXml2js() {
|
|
|
10749
10749
|
attributes = options.attributesFn(attributes, currentElement);
|
|
10750
10750
|
}
|
|
10751
10751
|
if ((options.trim || "attributeValueFn" in options || "attributeNameFn" in options || options.nativeTypeAttributes) && attributes) {
|
|
10752
|
-
var
|
|
10753
|
-
for (
|
|
10754
|
-
if (attributes.hasOwnProperty(
|
|
10755
|
-
if (options.trim) attributes[
|
|
10752
|
+
var key2;
|
|
10753
|
+
for (key2 in attributes) {
|
|
10754
|
+
if (attributes.hasOwnProperty(key2)) {
|
|
10755
|
+
if (options.trim) attributes[key2] = attributes[key2].trim();
|
|
10756
10756
|
if (options.nativeTypeAttributes) {
|
|
10757
|
-
attributes[
|
|
10757
|
+
attributes[key2] = nativeType(attributes[key2]);
|
|
10758
10758
|
}
|
|
10759
|
-
if ("attributeValueFn" in options) attributes[
|
|
10759
|
+
if ("attributeValueFn" in options) attributes[key2] = options.attributeValueFn(attributes[key2], key2, currentElement);
|
|
10760
10760
|
if ("attributeNameFn" in options) {
|
|
10761
|
-
var temp = attributes[
|
|
10762
|
-
delete attributes[
|
|
10763
|
-
attributes[options.attributeNameFn(
|
|
10761
|
+
var temp = attributes[key2];
|
|
10762
|
+
delete attributes[key2];
|
|
10763
|
+
attributes[options.attributeNameFn(key2, attributes[key2], currentElement)] = temp;
|
|
10764
10764
|
}
|
|
10765
10765
|
}
|
|
10766
10766
|
}
|
|
@@ -10819,10 +10819,10 @@ function requireXml2js() {
|
|
|
10819
10819
|
element = {};
|
|
10820
10820
|
if (!options.ignoreAttributes && attributes && Object.keys(attributes).length) {
|
|
10821
10821
|
element[options.attributesKey] = {};
|
|
10822
|
-
var
|
|
10823
|
-
for (
|
|
10824
|
-
if (attributes.hasOwnProperty(
|
|
10825
|
-
element[options.attributesKey][
|
|
10822
|
+
var key2;
|
|
10823
|
+
for (key2 in attributes) {
|
|
10824
|
+
if (attributes.hasOwnProperty(key2)) {
|
|
10825
|
+
element[options.attributesKey][key2] = attributes[key2];
|
|
10826
10826
|
}
|
|
10827
10827
|
}
|
|
10828
10828
|
}
|
|
@@ -11029,15 +11029,15 @@ function requireJs2xml() {
|
|
|
11029
11029
|
if ("attributesFn" in options) {
|
|
11030
11030
|
attributes = options.attributesFn(attributes, currentElementName, currentElement);
|
|
11031
11031
|
}
|
|
11032
|
-
var
|
|
11033
|
-
for (
|
|
11034
|
-
if (attributes.hasOwnProperty(
|
|
11035
|
-
quote = options.noQuotesForNativeAttributes && typeof attributes[
|
|
11036
|
-
attr = "" + attributes[
|
|
11032
|
+
var key2, attr, attrName, quote, result = [];
|
|
11033
|
+
for (key2 in attributes) {
|
|
11034
|
+
if (attributes.hasOwnProperty(key2) && attributes[key2] !== null && attributes[key2] !== void 0) {
|
|
11035
|
+
quote = options.noQuotesForNativeAttributes && typeof attributes[key2] !== "string" ? "" : '"';
|
|
11036
|
+
attr = "" + attributes[key2];
|
|
11037
11037
|
attr = attr.replace(/"/g, """);
|
|
11038
|
-
attrName = "attributeNameFn" in options ? options.attributeNameFn(
|
|
11038
|
+
attrName = "attributeNameFn" in options ? options.attributeNameFn(key2, attr, currentElementName, currentElement) : key2;
|
|
11039
11039
|
result.push(options.spaces && options.indentAttributes ? writeIndentation(options, depth + 1, false) : " ");
|
|
11040
|
-
result.push(attrName + "=" + quote + ("attributeValueFn" in options ? options.attributeValueFn(attr,
|
|
11040
|
+
result.push(attrName + "=" + quote + ("attributeValueFn" in options ? options.attributeValueFn(attr, key2, currentElementName, currentElement) : attr) + quote);
|
|
11041
11041
|
}
|
|
11042
11042
|
}
|
|
11043
11043
|
if (attributes && Object.keys(attributes).length && options.spaces && options.indentAttributes) {
|
|
@@ -11054,20 +11054,20 @@ function requireJs2xml() {
|
|
|
11054
11054
|
if (options.ignoreInstruction) {
|
|
11055
11055
|
return "";
|
|
11056
11056
|
}
|
|
11057
|
-
var
|
|
11058
|
-
for (
|
|
11059
|
-
if (instruction.hasOwnProperty(
|
|
11057
|
+
var key2;
|
|
11058
|
+
for (key2 in instruction) {
|
|
11059
|
+
if (instruction.hasOwnProperty(key2)) {
|
|
11060
11060
|
break;
|
|
11061
11061
|
}
|
|
11062
11062
|
}
|
|
11063
|
-
var instructionName = "instructionNameFn" in options ? options.instructionNameFn(
|
|
11064
|
-
if (typeof instruction[
|
|
11063
|
+
var instructionName = "instructionNameFn" in options ? options.instructionNameFn(key2, instruction[key2], currentElementName, currentElement) : key2;
|
|
11064
|
+
if (typeof instruction[key2] === "object") {
|
|
11065
11065
|
currentElement = instruction;
|
|
11066
11066
|
currentElementName = instructionName;
|
|
11067
|
-
return "<?" + instructionName + writeAttributes(instruction[
|
|
11067
|
+
return "<?" + instructionName + writeAttributes(instruction[key2][options.attributesKey], options, depth) + "?>";
|
|
11068
11068
|
} else {
|
|
11069
|
-
var instructionValue = instruction[
|
|
11070
|
-
if ("instructionFn" in options) instructionValue = options.instructionFn(instructionValue,
|
|
11069
|
+
var instructionValue = instruction[key2] ? instruction[key2] : "";
|
|
11070
|
+
if ("instructionFn" in options) instructionValue = options.instructionFn(instructionValue, key2, currentElementName, currentElement);
|
|
11071
11071
|
return "<?" + instructionName + (instructionValue ? " " + instructionValue : "") + "?>";
|
|
11072
11072
|
}
|
|
11073
11073
|
}
|
|
@@ -11173,10 +11173,10 @@ function requireJs2xml() {
|
|
|
11173
11173
|
}, "");
|
|
11174
11174
|
}
|
|
11175
11175
|
function hasContentCompact(element, options, anyContent) {
|
|
11176
|
-
var
|
|
11177
|
-
for (
|
|
11178
|
-
if (element.hasOwnProperty(
|
|
11179
|
-
switch (
|
|
11176
|
+
var key2;
|
|
11177
|
+
for (key2 in element) {
|
|
11178
|
+
if (element.hasOwnProperty(key2)) {
|
|
11179
|
+
switch (key2) {
|
|
11180
11180
|
case options.parentKey:
|
|
11181
11181
|
case options.attributesKey:
|
|
11182
11182
|
break;
|
|
@@ -11250,12 +11250,12 @@ function requireJs2xml() {
|
|
|
11250
11250
|
return xml.join("");
|
|
11251
11251
|
}
|
|
11252
11252
|
function writeElementsCompact(element, options, depth, firstLine) {
|
|
11253
|
-
var i,
|
|
11254
|
-
for (
|
|
11255
|
-
if (element.hasOwnProperty(
|
|
11256
|
-
nodes = isArray2(element[
|
|
11253
|
+
var i, key2, nodes, xml = [];
|
|
11254
|
+
for (key2 in element) {
|
|
11255
|
+
if (element.hasOwnProperty(key2)) {
|
|
11256
|
+
nodes = isArray2(element[key2]) ? element[key2] : [element[key2]];
|
|
11257
11257
|
for (i = 0; i < nodes.length; ++i) {
|
|
11258
|
-
switch (
|
|
11258
|
+
switch (key2) {
|
|
11259
11259
|
case options.declarationKey:
|
|
11260
11260
|
xml.push(writeDeclaration(nodes[i], options, depth));
|
|
11261
11261
|
break;
|
|
@@ -11279,7 +11279,7 @@ function requireJs2xml() {
|
|
|
11279
11279
|
xml.push(writeIndentation(options, depth, firstLine) + writeComment(nodes[i], options));
|
|
11280
11280
|
break;
|
|
11281
11281
|
default:
|
|
11282
|
-
xml.push(writeIndentation(options, depth, firstLine) + writeElementCompact(nodes[i],
|
|
11282
|
+
xml.push(writeIndentation(options, depth, firstLine) + writeElementCompact(nodes[i], key2, options, depth, hasContentCompact(nodes[i], options)));
|
|
11283
11283
|
}
|
|
11284
11284
|
firstLine = firstLine && !xml.length;
|
|
11285
11285
|
}
|
|
@@ -11407,10 +11407,10 @@ const isRegExp = (value) => {
|
|
|
11407
11407
|
function objectIncludes(obj1, obj2, options = { strict: true }) {
|
|
11408
11408
|
const keys2 = Object.keys(obj2);
|
|
11409
11409
|
if (!keys2.length) return true;
|
|
11410
|
-
return keys2.every((
|
|
11411
|
-
if (options.strict) return obj2[
|
|
11412
|
-
if (isRegExp(obj2[
|
|
11413
|
-
return obj2[
|
|
11410
|
+
return keys2.every((key2) => {
|
|
11411
|
+
if (options.strict) return obj2[key2] === obj1[key2];
|
|
11412
|
+
if (isRegExp(obj2[key2])) return obj2[key2].test(obj1[key2]);
|
|
11413
|
+
return obj2[key2] === obj1[key2];
|
|
11414
11414
|
});
|
|
11415
11415
|
}
|
|
11416
11416
|
function deleteProps(obj, propOrProps) {
|
|
@@ -11439,27 +11439,27 @@ function OrderedMap(content) {
|
|
|
11439
11439
|
}
|
|
11440
11440
|
OrderedMap.prototype = {
|
|
11441
11441
|
constructor: OrderedMap,
|
|
11442
|
-
find: function(
|
|
11442
|
+
find: function(key2) {
|
|
11443
11443
|
for (var i = 0; i < this.content.length; i += 2)
|
|
11444
|
-
if (this.content[i] ===
|
|
11444
|
+
if (this.content[i] === key2) return i;
|
|
11445
11445
|
return -1;
|
|
11446
11446
|
},
|
|
11447
11447
|
// :: (string) → ?any
|
|
11448
11448
|
// Retrieve the value stored under `key`, or return undefined when
|
|
11449
11449
|
// no such key exists.
|
|
11450
|
-
get: function(
|
|
11451
|
-
var found2 = this.find(
|
|
11450
|
+
get: function(key2) {
|
|
11451
|
+
var found2 = this.find(key2);
|
|
11452
11452
|
return found2 == -1 ? void 0 : this.content[found2 + 1];
|
|
11453
11453
|
},
|
|
11454
11454
|
// :: (string, any, ?string) → OrderedMap
|
|
11455
11455
|
// Create a new map by replacing the value of `key` with a new
|
|
11456
11456
|
// value, or adding a binding to the end of the map. If `newKey` is
|
|
11457
11457
|
// given, the key of the binding will be replaced with that key.
|
|
11458
|
-
update: function(
|
|
11459
|
-
var self2 = newKey && newKey !=
|
|
11460
|
-
var found2 = self2.find(
|
|
11458
|
+
update: function(key2, value, newKey) {
|
|
11459
|
+
var self2 = newKey && newKey != key2 ? this.remove(newKey) : this;
|
|
11460
|
+
var found2 = self2.find(key2), content = self2.content.slice();
|
|
11461
11461
|
if (found2 == -1) {
|
|
11462
|
-
content.push(newKey ||
|
|
11462
|
+
content.push(newKey || key2, value);
|
|
11463
11463
|
} else {
|
|
11464
11464
|
content[found2 + 1] = value;
|
|
11465
11465
|
if (newKey) content[found2] = newKey;
|
|
@@ -11468,8 +11468,8 @@ OrderedMap.prototype = {
|
|
|
11468
11468
|
},
|
|
11469
11469
|
// :: (string) → OrderedMap
|
|
11470
11470
|
// Return a map with the given key removed, if it existed.
|
|
11471
|
-
remove: function(
|
|
11472
|
-
var found2 = this.find(
|
|
11471
|
+
remove: function(key2) {
|
|
11472
|
+
var found2 = this.find(key2);
|
|
11473
11473
|
if (found2 == -1) return this;
|
|
11474
11474
|
var content = this.content.slice();
|
|
11475
11475
|
content.splice(found2, 2);
|
|
@@ -11477,23 +11477,23 @@ OrderedMap.prototype = {
|
|
|
11477
11477
|
},
|
|
11478
11478
|
// :: (string, any) → OrderedMap
|
|
11479
11479
|
// Add a new key to the start of the map.
|
|
11480
|
-
addToStart: function(
|
|
11481
|
-
return new OrderedMap([
|
|
11480
|
+
addToStart: function(key2, value) {
|
|
11481
|
+
return new OrderedMap([key2, value].concat(this.remove(key2).content));
|
|
11482
11482
|
},
|
|
11483
11483
|
// :: (string, any) → OrderedMap
|
|
11484
11484
|
// Add a new key to the end of the map.
|
|
11485
|
-
addToEnd: function(
|
|
11486
|
-
var content = this.remove(
|
|
11487
|
-
content.push(
|
|
11485
|
+
addToEnd: function(key2, value) {
|
|
11486
|
+
var content = this.remove(key2).content.slice();
|
|
11487
|
+
content.push(key2, value);
|
|
11488
11488
|
return new OrderedMap(content);
|
|
11489
11489
|
},
|
|
11490
11490
|
// :: (string, string, any) → OrderedMap
|
|
11491
11491
|
// Add a key after the given key. If `place` is not found, the new
|
|
11492
11492
|
// key is added to the end.
|
|
11493
|
-
addBefore: function(place,
|
|
11494
|
-
var without = this.remove(
|
|
11493
|
+
addBefore: function(place, key2, value) {
|
|
11494
|
+
var without = this.remove(key2), content = without.content.slice();
|
|
11495
11495
|
var found2 = without.find(place);
|
|
11496
|
-
content.splice(found2 == -1 ? content.length : found2, 0,
|
|
11496
|
+
content.splice(found2 == -1 ? content.length : found2, 0, key2, value);
|
|
11497
11497
|
return new OrderedMap(content);
|
|
11498
11498
|
},
|
|
11499
11499
|
// :: ((key: string, value: any))
|
|
@@ -11533,8 +11533,8 @@ OrderedMap.prototype = {
|
|
|
11533
11533
|
// Turn ordered map into a plain object.
|
|
11534
11534
|
toObject: function() {
|
|
11535
11535
|
var result = {};
|
|
11536
|
-
this.forEach(function(
|
|
11537
|
-
result[
|
|
11536
|
+
this.forEach(function(key2, value) {
|
|
11537
|
+
result[key2] = value;
|
|
11538
11538
|
});
|
|
11539
11539
|
return result;
|
|
11540
11540
|
},
|
|
@@ -18849,15 +18849,15 @@ class Transaction extends Transform {
|
|
|
18849
18849
|
Store a metadata property in this transaction, keyed either by
|
|
18850
18850
|
name or by plugin.
|
|
18851
18851
|
*/
|
|
18852
|
-
setMeta(
|
|
18853
|
-
this.meta[typeof
|
|
18852
|
+
setMeta(key2, value) {
|
|
18853
|
+
this.meta[typeof key2 == "string" ? key2 : key2.key] = value;
|
|
18854
18854
|
return this;
|
|
18855
18855
|
}
|
|
18856
18856
|
/**
|
|
18857
18857
|
Retrieve a metadata property for a given name or plugin.
|
|
18858
18858
|
*/
|
|
18859
|
-
getMeta(
|
|
18860
|
-
return this.meta[typeof
|
|
18859
|
+
getMeta(key2) {
|
|
18860
|
+
return this.meta[typeof key2 == "string" ? key2 : key2.key];
|
|
18861
18861
|
}
|
|
18862
18862
|
/**
|
|
18863
18863
|
Returns true if this transaction doesn't contain any metadata,
|
|
@@ -19239,8 +19239,8 @@ function handleListNodes(params2, node) {
|
|
|
19239
19239
|
const currentListByNumId = lists[currentListNumId];
|
|
19240
19240
|
if (!currentListByNumId.levels[iLvl]) currentListByNumId.levels[iLvl] = Number(start2) || 1;
|
|
19241
19241
|
else currentListByNumId.levels[iLvl]++;
|
|
19242
|
-
Object.keys(currentListByNumId.levels).forEach((
|
|
19243
|
-
const level = Number(
|
|
19242
|
+
Object.keys(currentListByNumId.levels).forEach((key2) => {
|
|
19243
|
+
const level = Number(key2);
|
|
19244
19244
|
if (level > iLvl) {
|
|
19245
19245
|
delete currentListByNumId.levels[level];
|
|
19246
19246
|
}
|
|
@@ -19753,8 +19753,8 @@ function _processListRunProperties(data) {
|
|
|
19753
19753
|
elements.forEach((item) => {
|
|
19754
19754
|
if (!expectedTypes.includes(item.name)) ;
|
|
19755
19755
|
const { attributes = {} } = item;
|
|
19756
|
-
Object.keys(attributes).forEach((
|
|
19757
|
-
runProperties[
|
|
19756
|
+
Object.keys(attributes).forEach((key2) => {
|
|
19757
|
+
runProperties[key2] = attributes[key2];
|
|
19758
19758
|
});
|
|
19759
19759
|
});
|
|
19760
19760
|
return runProperties;
|
|
@@ -20933,8 +20933,8 @@ function getSchemaTypeByName(name, schema) {
|
|
|
20933
20933
|
return schema.nodes[name] || schema.marks[name] || null;
|
|
20934
20934
|
}
|
|
20935
20935
|
function cleanSchemaItem(schemaItem) {
|
|
20936
|
-
const entries = Object.entries(schemaItem).filter(([
|
|
20937
|
-
if (
|
|
20936
|
+
const entries = Object.entries(schemaItem).filter(([key2, value]) => {
|
|
20937
|
+
if (key2 === "attrs" && isEmptyObject(value)) {
|
|
20938
20938
|
return false;
|
|
20939
20939
|
}
|
|
20940
20940
|
return value !== null && value !== void 0;
|
|
@@ -21283,11 +21283,11 @@ function getActiveFormatting(editor) {
|
|
|
21283
21283
|
}
|
|
21284
21284
|
const ignoreKeys = ["paragraphSpacing"];
|
|
21285
21285
|
const attributes = getActiveAttributes(state2);
|
|
21286
|
-
Object.keys(attributes).forEach((
|
|
21287
|
-
if (ignoreKeys.includes(
|
|
21286
|
+
Object.keys(attributes).forEach((key2) => {
|
|
21287
|
+
if (ignoreKeys.includes(key2)) return;
|
|
21288
21288
|
const attrs = {};
|
|
21289
|
-
attrs[
|
|
21290
|
-
marksToProcess.push({ name:
|
|
21289
|
+
attrs[key2] = attributes[key2];
|
|
21290
|
+
marksToProcess.push({ name: key2, attrs });
|
|
21291
21291
|
});
|
|
21292
21292
|
const textColor = marksToProcess.find((i) => i.name === "textColor");
|
|
21293
21293
|
const textHightlight = marksToProcess.find((i) => i.name === "textHighlight");
|
|
@@ -21310,9 +21310,9 @@ function getActiveFormatting(editor) {
|
|
|
21310
21310
|
function unwrapTextMarks(textStyleMark) {
|
|
21311
21311
|
const processedMarks = [];
|
|
21312
21312
|
const { attrs } = textStyleMark;
|
|
21313
|
-
Object.keys(attrs).forEach((
|
|
21314
|
-
if (!attrs[
|
|
21315
|
-
processedMarks.push({ name:
|
|
21313
|
+
Object.keys(attrs).forEach((key2) => {
|
|
21314
|
+
if (!attrs[key2]) return;
|
|
21315
|
+
processedMarks.push({ name: key2, attrs: { [key2]: attrs[key2] } });
|
|
21316
21316
|
});
|
|
21317
21317
|
return processedMarks;
|
|
21318
21318
|
}
|
|
@@ -21321,10 +21321,10 @@ function getActiveAttributes(state2) {
|
|
|
21321
21321
|
const { from: from2, to, empty: empty2 } = state2.selection;
|
|
21322
21322
|
const attributes = {};
|
|
21323
21323
|
const getAttrs = (node) => {
|
|
21324
|
-
Object.keys(node.attrs).forEach((
|
|
21325
|
-
const value = node.attrs[
|
|
21324
|
+
Object.keys(node.attrs).forEach((key2) => {
|
|
21325
|
+
const value = node.attrs[key2];
|
|
21326
21326
|
if (value) {
|
|
21327
|
-
attributes[
|
|
21327
|
+
attributes[key2] = value;
|
|
21328
21328
|
}
|
|
21329
21329
|
});
|
|
21330
21330
|
};
|
|
@@ -22556,16 +22556,16 @@ const defaultBooleans = ["required", "readonly", "disabled", "checked", "multipl
|
|
|
22556
22556
|
function updateDOMAttributes(dom, attrs = {}, options = {}) {
|
|
22557
22557
|
const customBooleans = options.customBooleans || [];
|
|
22558
22558
|
const booleans = [...defaultBooleans, ...customBooleans];
|
|
22559
|
-
Object.entries(attrs).forEach(([
|
|
22560
|
-
if (booleans.includes(
|
|
22561
|
-
if (!value) dom.removeAttribute(
|
|
22562
|
-
else dom.setAttribute(
|
|
22559
|
+
Object.entries(attrs).forEach(([key2, value]) => {
|
|
22560
|
+
if (booleans.includes(key2)) {
|
|
22561
|
+
if (!value) dom.removeAttribute(key2);
|
|
22562
|
+
else dom.setAttribute(key2, "");
|
|
22563
22563
|
return;
|
|
22564
22564
|
}
|
|
22565
22565
|
if (value != null) {
|
|
22566
|
-
dom.setAttribute(
|
|
22566
|
+
dom.setAttribute(key2, value);
|
|
22567
22567
|
} else {
|
|
22568
|
-
dom.removeAttribute(
|
|
22568
|
+
dom.removeAttribute(key2);
|
|
22569
22569
|
}
|
|
22570
22570
|
});
|
|
22571
22571
|
}
|
|
@@ -25287,10 +25287,10 @@ function decodeProperties(translatorsBySdName, properties) {
|
|
|
25287
25287
|
return [];
|
|
25288
25288
|
}
|
|
25289
25289
|
const elements = [];
|
|
25290
|
-
Object.keys(properties).forEach((
|
|
25291
|
-
const translator2 = translatorsBySdName[
|
|
25290
|
+
Object.keys(properties).forEach((key2) => {
|
|
25291
|
+
const translator2 = translatorsBySdName[key2];
|
|
25292
25292
|
if (translator2) {
|
|
25293
|
-
const attributes = translator2.decode({ node: { attrs: { [
|
|
25293
|
+
const attributes = translator2.decode({ node: { attrs: { [key2]: properties[key2] } } });
|
|
25294
25294
|
if (attributes != null) {
|
|
25295
25295
|
elements.push({ name: translator2.xmlName, attributes });
|
|
25296
25296
|
}
|
|
@@ -25333,16 +25333,16 @@ const translator$i = NodeTranslator.from({
|
|
|
25333
25333
|
"w:val"
|
|
25334
25334
|
].map((attr) => createAttributeHandler(attr)),
|
|
25335
25335
|
encode: (_2, encodedAttrs) => {
|
|
25336
|
-
Object.keys(encodedAttrs).forEach((
|
|
25337
|
-
encodedAttrs[
|
|
25336
|
+
Object.keys(encodedAttrs).forEach((key2) => {
|
|
25337
|
+
encodedAttrs[key2] = ["1", "true"].includes(encodedAttrs[key2]);
|
|
25338
25338
|
});
|
|
25339
25339
|
return Object.keys(encodedAttrs).length > 0 ? encodedAttrs : void 0;
|
|
25340
25340
|
},
|
|
25341
25341
|
decode: ({ node }) => {
|
|
25342
25342
|
if (!node.attrs?.cnfStyle) return;
|
|
25343
25343
|
const cnfStyleAttrs = {};
|
|
25344
|
-
Object.entries(node.attrs.cnfStyle).forEach(([
|
|
25345
|
-
cnfStyleAttrs[`w:${
|
|
25344
|
+
Object.entries(node.attrs.cnfStyle).forEach(([key2, value]) => {
|
|
25345
|
+
cnfStyleAttrs[`w:${key2}`] = value ? "1" : "0";
|
|
25346
25346
|
});
|
|
25347
25347
|
return Object.keys(cnfStyleAttrs).length > 0 ? cnfStyleAttrs : void 0;
|
|
25348
25348
|
}
|
|
@@ -25966,17 +25966,17 @@ function generateTableCellProperties(node) {
|
|
|
25966
25966
|
if (!!borders && Object.keys(borders).length) {
|
|
25967
25967
|
const cellBordersElement = {
|
|
25968
25968
|
name: "w:tcBorders",
|
|
25969
|
-
elements: Object.entries(borders).map(([
|
|
25969
|
+
elements: Object.entries(borders).map(([key2, value]) => {
|
|
25970
25970
|
if (!value.size || value.val === "none") {
|
|
25971
25971
|
return {
|
|
25972
|
-
name: `w:${
|
|
25972
|
+
name: `w:${key2}`,
|
|
25973
25973
|
attributes: {
|
|
25974
25974
|
"w:val": "nil"
|
|
25975
25975
|
}
|
|
25976
25976
|
};
|
|
25977
25977
|
}
|
|
25978
25978
|
return {
|
|
25979
|
-
name: `w:${
|
|
25979
|
+
name: `w:${key2}`,
|
|
25980
25980
|
attributes: {
|
|
25981
25981
|
"w:val": "single",
|
|
25982
25982
|
"w:color": value.color ? value.color.substring(1) : "auto",
|
|
@@ -26223,8 +26223,8 @@ const parseAnnotationMarks = (content = {}) => {
|
|
|
26223
26223
|
const { type: type2 } = mark;
|
|
26224
26224
|
if (type2 === "textStyle") {
|
|
26225
26225
|
const { attrs: attrs2 } = mark;
|
|
26226
|
-
Object.keys(attrs2).forEach((
|
|
26227
|
-
marksWithFlatFontStyles.push({ type:
|
|
26226
|
+
Object.keys(attrs2).forEach((key2) => {
|
|
26227
|
+
marksWithFlatFontStyles.push({ type: key2, attrs: attrs2[key2] });
|
|
26228
26228
|
});
|
|
26229
26229
|
} else {
|
|
26230
26230
|
marksWithFlatFontStyles.push(mark);
|
|
@@ -27177,8 +27177,8 @@ const extractListLevelStyles = (cssText, listId, level, numId) => {
|
|
|
27177
27177
|
const rawStyles = match[1].split(";").map((line) => line.trim()).filter(Boolean);
|
|
27178
27178
|
const styleMap = {};
|
|
27179
27179
|
for (const style2 of rawStyles) {
|
|
27180
|
-
const [
|
|
27181
|
-
styleMap[
|
|
27180
|
+
const [key2, value] = style2.split(":").map((s) => s.trim());
|
|
27181
|
+
styleMap[key2] = value;
|
|
27182
27182
|
}
|
|
27183
27183
|
return styleMap;
|
|
27184
27184
|
};
|
|
@@ -27345,8 +27345,8 @@ const transformWordLists = (container, editor) => {
|
|
|
27345
27345
|
const currentListByNumId = lists[id];
|
|
27346
27346
|
if (!currentListByNumId.levels[level]) currentListByNumId.levels[level] = Number(start2) || 1;
|
|
27347
27347
|
else currentListByNumId.levels[level]++;
|
|
27348
|
-
Object.keys(currentListByNumId.levels).forEach((
|
|
27349
|
-
const level1 = Number(
|
|
27348
|
+
Object.keys(currentListByNumId.levels).forEach((key2) => {
|
|
27349
|
+
const level1 = Number(key2);
|
|
27350
27350
|
if (level1 > level) {
|
|
27351
27351
|
delete currentListByNumId.levels[level1];
|
|
27352
27352
|
}
|
|
@@ -28063,9 +28063,9 @@ function requireHe() {
|
|
|
28063
28063
|
return defaults;
|
|
28064
28064
|
}
|
|
28065
28065
|
var result = {};
|
|
28066
|
-
var
|
|
28067
|
-
for (
|
|
28068
|
-
result[
|
|
28066
|
+
var key22;
|
|
28067
|
+
for (key22 in defaults) {
|
|
28068
|
+
result[key22] = has(options, key22) ? options[key22] : defaults[key22];
|
|
28069
28069
|
}
|
|
28070
28070
|
return result;
|
|
28071
28071
|
};
|
|
@@ -28238,8 +28238,8 @@ function requireHe() {
|
|
|
28238
28238
|
if (freeModule2) {
|
|
28239
28239
|
freeModule2.exports = he2;
|
|
28240
28240
|
} else {
|
|
28241
|
-
for (var
|
|
28242
|
-
has(he2,
|
|
28241
|
+
for (var key2 in he2) {
|
|
28242
|
+
has(he2, key2) && (freeExports2[key2] = he2[key2]);
|
|
28243
28243
|
}
|
|
28244
28244
|
}
|
|
28245
28245
|
} else {
|
|
@@ -28672,9 +28672,9 @@ function translateBodyNode(params2) {
|
|
|
28672
28672
|
const newMargins = params2.converter.pageStyles.pageMargins;
|
|
28673
28673
|
const sectPrMargins = sectPr.elements.find((n) => n.name === "w:pgMar");
|
|
28674
28674
|
const { attributes } = sectPrMargins;
|
|
28675
|
-
Object.entries(newMargins).forEach(([
|
|
28675
|
+
Object.entries(newMargins).forEach(([key2, value]) => {
|
|
28676
28676
|
const convertedValue = inchesToTwips(value);
|
|
28677
|
-
attributes[`w:${
|
|
28677
|
+
attributes[`w:${key2}`] = convertedValue;
|
|
28678
28678
|
});
|
|
28679
28679
|
sectPrMargins.attributes = attributes;
|
|
28680
28680
|
}
|
|
@@ -28931,9 +28931,9 @@ function getTextNodeForExport(text, marks, params2) {
|
|
|
28931
28931
|
});
|
|
28932
28932
|
if (!isCustomMark) return;
|
|
28933
28933
|
let attrsString = "";
|
|
28934
|
-
Object.entries(mark.attrs).forEach(([
|
|
28934
|
+
Object.entries(mark.attrs).forEach(([key2, value]) => {
|
|
28935
28935
|
if (value) {
|
|
28936
|
-
attrsString += `${
|
|
28936
|
+
attrsString += `${key2}=${value};`;
|
|
28937
28937
|
}
|
|
28938
28938
|
});
|
|
28939
28939
|
if (isCustomMark) {
|
|
@@ -29033,8 +29033,8 @@ function generateRunProps(marks = []) {
|
|
|
29033
29033
|
function processOutputMarks(marks = []) {
|
|
29034
29034
|
return marks.flatMap((mark) => {
|
|
29035
29035
|
if (mark.type === "textStyle") {
|
|
29036
|
-
return Object.entries(mark.attrs).filter(([, value]) => value).map(([
|
|
29037
|
-
const unwrappedMark = { type:
|
|
29036
|
+
return Object.entries(mark.attrs).filter(([, value]) => value).map(([key2]) => {
|
|
29037
|
+
const unwrappedMark = { type: key2, attrs: mark.attrs };
|
|
29038
29038
|
return translateMark(unwrappedMark);
|
|
29039
29039
|
});
|
|
29040
29040
|
} else {
|
|
@@ -29542,9 +29542,9 @@ function translateVRectContentBlock(params2) {
|
|
|
29542
29542
|
if (vmlAttributes.stroked) rectAttrs.stroked = vmlAttributes.stroked;
|
|
29543
29543
|
}
|
|
29544
29544
|
if (attributes) {
|
|
29545
|
-
Object.entries(attributes).forEach(([
|
|
29546
|
-
if (!rectAttrs[
|
|
29547
|
-
rectAttrs[
|
|
29545
|
+
Object.entries(attributes).forEach(([key2, value]) => {
|
|
29546
|
+
if (!rectAttrs[key2] && value !== void 0) {
|
|
29547
|
+
rectAttrs[key2] = value;
|
|
29548
29548
|
}
|
|
29549
29549
|
});
|
|
29550
29550
|
}
|
|
@@ -29575,7 +29575,7 @@ _DocxExporter_instances = /* @__PURE__ */ new WeakSet();
|
|
|
29575
29575
|
generate_xml_as_list_fn = function(data, debug = false) {
|
|
29576
29576
|
const json = JSON.parse(JSON.stringify(data));
|
|
29577
29577
|
const declaration = this.converter.declaration.attributes;
|
|
29578
|
-
const xmlTag = `<?xml${Object.entries(declaration).map(([
|
|
29578
|
+
const xmlTag = `<?xml${Object.entries(declaration).map(([key2, value]) => ` ${key2}="${value}"`).join("")}?>`;
|
|
29579
29579
|
const result = __privateMethod$2(this, _DocxExporter_instances, generateXml_fn).call(this, json, debug);
|
|
29580
29580
|
const final = [xmlTag, ...result];
|
|
29581
29581
|
return final;
|
|
@@ -30076,9 +30076,9 @@ const handleBookmarkNode = (params2) => {
|
|
|
30076
30076
|
const nodeListHandler2 = params2.nodeListHandler;
|
|
30077
30077
|
const attrs = {};
|
|
30078
30078
|
node.attributes["w:name"].split(";").forEach((name) => {
|
|
30079
|
-
const [
|
|
30080
|
-
if (
|
|
30081
|
-
attrs[
|
|
30079
|
+
const [key2, value] = name.split("=");
|
|
30080
|
+
if (key2 && value) {
|
|
30081
|
+
attrs[key2] = value;
|
|
30082
30082
|
}
|
|
30083
30083
|
});
|
|
30084
30084
|
const translatedText = nodeListHandler2.handler({
|
|
@@ -30718,8 +30718,8 @@ const getDefaultStyleDefinition = (defaultStyleId, docx) => {
|
|
|
30718
30718
|
parsedMarks.forEach((mark) => {
|
|
30719
30719
|
const { type: type2, attrs } = mark;
|
|
30720
30720
|
if (type2 === "textStyle") {
|
|
30721
|
-
Object.entries(attrs).forEach(([
|
|
30722
|
-
parsedStyles[kebabCase$1(
|
|
30721
|
+
Object.entries(attrs).forEach(([key2, value]) => {
|
|
30722
|
+
parsedStyles[kebabCase$1(key2)] = value;
|
|
30723
30723
|
});
|
|
30724
30724
|
return;
|
|
30725
30725
|
}
|
|
@@ -31102,11 +31102,11 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
|
|
|
31102
31102
|
});
|
|
31103
31103
|
};
|
|
31104
31104
|
const findSectPr = (obj, result = []) => {
|
|
31105
|
-
for (const
|
|
31106
|
-
if (obj[
|
|
31105
|
+
for (const key2 in obj) {
|
|
31106
|
+
if (obj[key2] === "w:sectPr") {
|
|
31107
31107
|
result.push(obj);
|
|
31108
|
-
} else if (typeof obj[
|
|
31109
|
-
findSectPr(obj[
|
|
31108
|
+
} else if (typeof obj[key2] === "object") {
|
|
31109
|
+
findSectPr(obj[key2], result);
|
|
31110
31110
|
}
|
|
31111
31111
|
}
|
|
31112
31112
|
return result;
|
|
@@ -34280,9 +34280,9 @@ class DocxZipper {
|
|
|
34280
34280
|
const content = file.content;
|
|
34281
34281
|
zip.file(file.name, content);
|
|
34282
34282
|
}
|
|
34283
|
-
Object.keys(updatedDocs).forEach((
|
|
34284
|
-
const content = updatedDocs[
|
|
34285
|
-
zip.file(
|
|
34283
|
+
Object.keys(updatedDocs).forEach((key2) => {
|
|
34284
|
+
const content = updatedDocs[key2];
|
|
34285
|
+
zip.file(key2, content);
|
|
34286
34286
|
});
|
|
34287
34287
|
Object.keys(media).forEach((path) => {
|
|
34288
34288
|
const binaryData = Buffer2.from(media[path], "base64");
|
|
@@ -34311,8 +34311,8 @@ class DocxZipper {
|
|
|
34311
34311
|
filePromises.push(promise);
|
|
34312
34312
|
});
|
|
34313
34313
|
await Promise.all(filePromises);
|
|
34314
|
-
Object.keys(updatedDocs).forEach((
|
|
34315
|
-
unzippedOriginalDocx.file(
|
|
34314
|
+
Object.keys(updatedDocs).forEach((key2) => {
|
|
34315
|
+
unzippedOriginalDocx.file(key2, updatedDocs[key2]);
|
|
34316
34316
|
});
|
|
34317
34317
|
Object.keys(media).forEach((path) => {
|
|
34318
34318
|
unzippedOriginalDocx.file(path, media[path]);
|
|
@@ -34325,8 +34325,8 @@ var __defProp$1 = Object.defineProperty;
|
|
|
34325
34325
|
var __typeError$1 = (msg2) => {
|
|
34326
34326
|
throw TypeError(msg2);
|
|
34327
34327
|
};
|
|
34328
|
-
var __defNormalProp$1 = (obj,
|
|
34329
|
-
var __publicField$1 = (obj,
|
|
34328
|
+
var __defNormalProp$1 = (obj, key2, value) => key2 in obj ? __defProp$1(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value;
|
|
34329
|
+
var __publicField$1 = (obj, key2, value) => __defNormalProp$1(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value);
|
|
34330
34330
|
var __accessCheck$1 = (obj, member, msg2) => member.has(obj) || __typeError$1("Cannot " + msg2);
|
|
34331
34331
|
var __privateGet$1 = (obj, member, getter) => (__accessCheck$1(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
34332
34332
|
var __privateAdd$1 = (obj, member, value) => member.has(obj) ? __typeError$1("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
@@ -34980,11 +34980,11 @@ function hasBlockDesc(dom) {
|
|
|
34980
34980
|
const selectionCollapsed = function(domSel) {
|
|
34981
34981
|
return domSel.focusNode && isEquivalentPosition(domSel.focusNode, domSel.focusOffset, domSel.anchorNode, domSel.anchorOffset);
|
|
34982
34982
|
};
|
|
34983
|
-
function keyEvent(keyCode,
|
|
34983
|
+
function keyEvent(keyCode, key2) {
|
|
34984
34984
|
let event = document.createEvent("Event");
|
|
34985
34985
|
event.initEvent("keydown", true, true);
|
|
34986
34986
|
event.keyCode = keyCode;
|
|
34987
|
-
event.key = event.code =
|
|
34987
|
+
event.key = event.code = key2;
|
|
34988
34988
|
return event;
|
|
34989
34989
|
}
|
|
34990
34990
|
function deepActiveElement(doc2) {
|
|
@@ -40232,9 +40232,9 @@ const writeAny = (encoder, data) => {
|
|
|
40232
40232
|
const keys2 = Object.keys(data);
|
|
40233
40233
|
writeVarUint(encoder, keys2.length);
|
|
40234
40234
|
for (let i = 0; i < keys2.length; i++) {
|
|
40235
|
-
const
|
|
40236
|
-
writeVarString(encoder,
|
|
40237
|
-
writeAny(encoder, data[
|
|
40235
|
+
const key2 = keys2[i];
|
|
40236
|
+
writeVarString(encoder, key2);
|
|
40237
|
+
writeAny(encoder, data[key2]);
|
|
40238
40238
|
}
|
|
40239
40239
|
}
|
|
40240
40240
|
break;
|
|
@@ -40253,17 +40253,17 @@ const unexpectedCase = () => {
|
|
|
40253
40253
|
throw create$1("Unexpected case");
|
|
40254
40254
|
};
|
|
40255
40255
|
const create = () => /* @__PURE__ */ new Map();
|
|
40256
|
-
const setIfUndefined = (map22,
|
|
40257
|
-
let set = map22.get(
|
|
40256
|
+
const setIfUndefined = (map22, key2, createT) => {
|
|
40257
|
+
let set = map22.get(key2);
|
|
40258
40258
|
if (set === void 0) {
|
|
40259
|
-
map22.set(
|
|
40259
|
+
map22.set(key2, set = createT());
|
|
40260
40260
|
}
|
|
40261
40261
|
return set;
|
|
40262
40262
|
};
|
|
40263
40263
|
const keys$1 = Object.keys;
|
|
40264
40264
|
const every = (obj, f) => {
|
|
40265
|
-
for (const
|
|
40266
|
-
if (!f(obj[
|
|
40265
|
+
for (const key2 in obj) {
|
|
40266
|
+
if (!f(obj[key2], key2)) {
|
|
40267
40267
|
return false;
|
|
40268
40268
|
}
|
|
40269
40269
|
}
|
|
@@ -40319,14 +40319,14 @@ class VarStoragePolyfill {
|
|
|
40319
40319
|
* @param {string} key
|
|
40320
40320
|
* @param {any} newValue
|
|
40321
40321
|
*/
|
|
40322
|
-
setItem(
|
|
40323
|
-
this.map.set(
|
|
40322
|
+
setItem(key2, newValue) {
|
|
40323
|
+
this.map.set(key2, newValue);
|
|
40324
40324
|
}
|
|
40325
40325
|
/**
|
|
40326
40326
|
* @param {string} key
|
|
40327
40327
|
*/
|
|
40328
|
-
getItem(
|
|
40329
|
-
return this.map.get(
|
|
40328
|
+
getItem(key2) {
|
|
40329
|
+
return this.map.get(key2);
|
|
40330
40330
|
}
|
|
40331
40331
|
}
|
|
40332
40332
|
let _localStorage = new VarStoragePolyfill();
|
|
@@ -40369,9 +40369,9 @@ const computeParams = () => {
|
|
|
40369
40369
|
params = create();
|
|
40370
40370
|
(location.search || "?").slice(1).split("&").forEach((kv) => {
|
|
40371
40371
|
if (kv.length !== 0) {
|
|
40372
|
-
const [
|
|
40373
|
-
params.set(`--${fromCamelCase(
|
|
40374
|
-
params.set(`-${fromCamelCase(
|
|
40372
|
+
const [key2, value] = kv.split("=");
|
|
40373
|
+
params.set(`--${fromCamelCase(key2, "-")}`, value);
|
|
40374
|
+
params.set(`-${fromCamelCase(key2, "-")}`, value);
|
|
40375
40375
|
}
|
|
40376
40376
|
});
|
|
40377
40377
|
} else {
|
|
@@ -40654,8 +40654,8 @@ const ySyncPlugin = (yXmlFragment, {
|
|
|
40654
40654
|
const change = tr.getMeta(ySyncPluginKey);
|
|
40655
40655
|
if (change !== void 0) {
|
|
40656
40656
|
pluginState = Object.assign({}, pluginState);
|
|
40657
|
-
for (const
|
|
40658
|
-
pluginState[
|
|
40657
|
+
for (const key2 in change) {
|
|
40658
|
+
pluginState[key2] = change[key2];
|
|
40659
40659
|
}
|
|
40660
40660
|
}
|
|
40661
40661
|
pluginState.addToHistory = tr.getMeta("addToHistory") !== false;
|
|
@@ -40927,7 +40927,7 @@ class ProsemirrorBinding {
|
|
|
40927
40927
|
snapshot = Y__namespace.snapshot(historyDoc);
|
|
40928
40928
|
if (historyType._item === null) {
|
|
40929
40929
|
const rootKey = Array.from(this.doc.share.keys()).find(
|
|
40930
|
-
(
|
|
40930
|
+
(key2) => this.doc.share.get(key2) === this.type
|
|
40931
40931
|
);
|
|
40932
40932
|
historyType = historyDoc.getXmlFragment(rootKey);
|
|
40933
40933
|
} else {
|
|
@@ -41216,10 +41216,10 @@ const createTypeFromTextNodes = (nodes, meta) => {
|
|
|
41216
41216
|
};
|
|
41217
41217
|
const createTypeFromElementNode = (node, meta) => {
|
|
41218
41218
|
const type2 = new Y__namespace.XmlElement(node.type.name);
|
|
41219
|
-
for (const
|
|
41220
|
-
const val = node.attrs[
|
|
41221
|
-
if (val !== null &&
|
|
41222
|
-
type2.setAttribute(
|
|
41219
|
+
for (const key2 in node.attrs) {
|
|
41220
|
+
const val = node.attrs[key2];
|
|
41221
|
+
if (val !== null && key2 !== "ychange") {
|
|
41222
|
+
type2.setAttribute(key2, val);
|
|
41223
41223
|
}
|
|
41224
41224
|
}
|
|
41225
41225
|
type2.insert(
|
|
@@ -41234,13 +41234,13 @@ const createTypeFromElementNode = (node, meta) => {
|
|
|
41234
41234
|
const createTypeFromTextOrElementNode = (node, meta) => node instanceof Array ? createTypeFromTextNodes(node, meta) : createTypeFromElementNode(node, meta);
|
|
41235
41235
|
const isObject$1 = (val) => typeof val === "object" && val !== null;
|
|
41236
41236
|
const equalAttrs = (pattrs, yattrs) => {
|
|
41237
|
-
const keys2 = Object.keys(pattrs).filter((
|
|
41238
|
-
let eq2 = keys2.length === (yattrs == null ? 0 : Object.keys(yattrs).filter((
|
|
41237
|
+
const keys2 = Object.keys(pattrs).filter((key2) => pattrs[key2] !== null);
|
|
41238
|
+
let eq2 = keys2.length === (yattrs == null ? 0 : Object.keys(yattrs).filter((key2) => yattrs[key2] !== null).length);
|
|
41239
41239
|
for (let i = 0; i < keys2.length && eq2; i++) {
|
|
41240
|
-
const
|
|
41241
|
-
const l3 = pattrs[
|
|
41242
|
-
const r2 = yattrs[
|
|
41243
|
-
eq2 =
|
|
41240
|
+
const key2 = keys2[i];
|
|
41241
|
+
const l3 = pattrs[key2];
|
|
41242
|
+
const r2 = yattrs[key2];
|
|
41243
|
+
eq2 = key2 === "ychange" || l3 === r2 || isObject$1(l3) && isObject$1(r2) && equalAttrs(l3, r2);
|
|
41244
41244
|
}
|
|
41245
41245
|
return eq2;
|
|
41246
41246
|
};
|
|
@@ -41387,18 +41387,18 @@ const updateYFragment = (y2, yDomFragment, pNode, meta) => {
|
|
|
41387
41387
|
if (yDomFragment instanceof Y__namespace.XmlElement) {
|
|
41388
41388
|
const yDomAttrs = yDomFragment.getAttributes();
|
|
41389
41389
|
const pAttrs = pNode.attrs;
|
|
41390
|
-
for (const
|
|
41391
|
-
if (pAttrs[
|
|
41392
|
-
if (yDomAttrs[
|
|
41393
|
-
yDomFragment.setAttribute(
|
|
41390
|
+
for (const key2 in pAttrs) {
|
|
41391
|
+
if (pAttrs[key2] !== null) {
|
|
41392
|
+
if (yDomAttrs[key2] !== pAttrs[key2] && key2 !== "ychange") {
|
|
41393
|
+
yDomFragment.setAttribute(key2, pAttrs[key2]);
|
|
41394
41394
|
}
|
|
41395
41395
|
} else {
|
|
41396
|
-
yDomFragment.removeAttribute(
|
|
41396
|
+
yDomFragment.removeAttribute(key2);
|
|
41397
41397
|
}
|
|
41398
41398
|
}
|
|
41399
|
-
for (const
|
|
41400
|
-
if (pAttrs[
|
|
41401
|
-
yDomFragment.removeAttribute(
|
|
41399
|
+
for (const key2 in yDomAttrs) {
|
|
41400
|
+
if (pAttrs[key2] === void 0) {
|
|
41401
|
+
yDomFragment.removeAttribute(key2);
|
|
41402
41402
|
}
|
|
41403
41403
|
}
|
|
41404
41404
|
}
|
|
@@ -41529,19 +41529,19 @@ const updateMetas = () => {
|
|
|
41529
41529
|
const tr = view.state.tr;
|
|
41530
41530
|
const syncState = ySyncPluginKey.getState(view.state);
|
|
41531
41531
|
if (syncState && syncState.binding && !syncState.binding.isDestroyed) {
|
|
41532
|
-
metas.forEach((val,
|
|
41533
|
-
tr.setMeta(
|
|
41532
|
+
metas.forEach((val, key2) => {
|
|
41533
|
+
tr.setMeta(key2, val);
|
|
41534
41534
|
});
|
|
41535
41535
|
view.dispatch(tr);
|
|
41536
41536
|
}
|
|
41537
41537
|
});
|
|
41538
41538
|
};
|
|
41539
|
-
const setMeta$1 = (view,
|
|
41539
|
+
const setMeta$1 = (view, key2, value) => {
|
|
41540
41540
|
if (!viewsToUpdate) {
|
|
41541
41541
|
viewsToUpdate = /* @__PURE__ */ new Map();
|
|
41542
41542
|
timeout(0, updateMetas);
|
|
41543
41543
|
}
|
|
41544
|
-
setIfUndefined(viewsToUpdate, view, create).set(
|
|
41544
|
+
setIfUndefined(viewsToUpdate, view, create).set(key2, value);
|
|
41545
41545
|
};
|
|
41546
41546
|
const absolutePositionToRelativePosition = (pos, type2, mapping) => {
|
|
41547
41547
|
if (pos === 0) {
|
|
@@ -42233,21 +42233,21 @@ class Attribute2 {
|
|
|
42233
42233
|
let attrs = {};
|
|
42234
42234
|
for (const item of items) {
|
|
42235
42235
|
const mergedAttributes = { ...attrs };
|
|
42236
|
-
for (const [
|
|
42237
|
-
const exists2 = mergedAttributes[
|
|
42236
|
+
for (const [key2, value] of Object.entries(item)) {
|
|
42237
|
+
const exists2 = mergedAttributes[key2];
|
|
42238
42238
|
if (!exists2) {
|
|
42239
|
-
mergedAttributes[
|
|
42239
|
+
mergedAttributes[key2] = value;
|
|
42240
42240
|
continue;
|
|
42241
42241
|
}
|
|
42242
|
-
if (
|
|
42242
|
+
if (key2 === "class") {
|
|
42243
42243
|
const valueClasses = value ? value.split(" ") : [];
|
|
42244
|
-
const existingClasses = mergedAttributes[
|
|
42244
|
+
const existingClasses = mergedAttributes[key2] ? mergedAttributes[key2].split(" ") : [];
|
|
42245
42245
|
const insertClasses = valueClasses.filter((value2) => !existingClasses.includes(value2));
|
|
42246
|
-
mergedAttributes[
|
|
42247
|
-
} else if (
|
|
42248
|
-
mergedAttributes[
|
|
42246
|
+
mergedAttributes[key2] = [...existingClasses, ...insertClasses].join(" ");
|
|
42247
|
+
} else if (key2 === "style") {
|
|
42248
|
+
mergedAttributes[key2] = [mergedAttributes[key2], value].join("; ");
|
|
42249
42249
|
} else {
|
|
42250
|
-
mergedAttributes[
|
|
42250
|
+
mergedAttributes[key2] = value;
|
|
42251
42251
|
}
|
|
42252
42252
|
}
|
|
42253
42253
|
attrs = mergedAttributes;
|
|
@@ -42556,8 +42556,8 @@ const insertTabNode = () => ({ tr, state: state2, dispatch }) => {
|
|
|
42556
42556
|
if (dispatch) dispatch(tr);
|
|
42557
42557
|
return true;
|
|
42558
42558
|
};
|
|
42559
|
-
const setMeta = (
|
|
42560
|
-
tr.setMeta(
|
|
42559
|
+
const setMeta = (key2, value) => ({ tr }) => {
|
|
42560
|
+
tr.setMeta(key2, value);
|
|
42561
42561
|
return true;
|
|
42562
42562
|
};
|
|
42563
42563
|
const ensureMarks = (state2, splittableMarks) => {
|
|
@@ -45676,14 +45676,14 @@ const updateYdocDocxData = async (editor, ydoc) => {
|
|
|
45676
45676
|
const metaMap = ydoc.getMap("meta");
|
|
45677
45677
|
const docx = [...metaMap.get("docx")];
|
|
45678
45678
|
const newXml = await editor.exportDocx({ getUpdatedDocs: true });
|
|
45679
|
-
Object.keys(newXml).forEach((
|
|
45680
|
-
const fileIndex = docx.findIndex((item) => item.name ===
|
|
45679
|
+
Object.keys(newXml).forEach((key2) => {
|
|
45680
|
+
const fileIndex = docx.findIndex((item) => item.name === key2);
|
|
45681
45681
|
if (fileIndex > -1) {
|
|
45682
45682
|
docx.splice(fileIndex, 1);
|
|
45683
45683
|
}
|
|
45684
45684
|
docx.push({
|
|
45685
|
-
name:
|
|
45686
|
-
content: newXml[
|
|
45685
|
+
name: key2,
|
|
45686
|
+
content: newXml[key2]
|
|
45687
45687
|
});
|
|
45688
45688
|
});
|
|
45689
45689
|
ydoc.transact(
|
|
@@ -45699,8 +45699,8 @@ const initPaginationData = async (editor) => {
|
|
|
45699
45699
|
const sectionData = { headers: {}, footers: {} };
|
|
45700
45700
|
const headerIds = editor.converter.headerIds.ids;
|
|
45701
45701
|
const footerIds = editor.converter.footerIds.ids;
|
|
45702
|
-
for (let
|
|
45703
|
-
const sectionId = headerIds[
|
|
45702
|
+
for (let key2 in headerIds) {
|
|
45703
|
+
const sectionId = headerIds[key2];
|
|
45704
45704
|
if (!sectionId) continue;
|
|
45705
45705
|
const dataForThisSection = editor.converter.headers[sectionId];
|
|
45706
45706
|
if (!sectionData.headers[sectionId]) sectionData.headers[sectionId] = {};
|
|
@@ -45710,8 +45710,8 @@ const initPaginationData = async (editor) => {
|
|
|
45710
45710
|
sectionData.headers[sectionId].sectionEditor = sectionEditor;
|
|
45711
45711
|
sectionData.headers[sectionId].sectionContainer = sectionContainer;
|
|
45712
45712
|
}
|
|
45713
|
-
for (let
|
|
45714
|
-
const sectionId = footerIds[
|
|
45713
|
+
for (let key2 in footerIds) {
|
|
45714
|
+
const sectionId = footerIds[key2];
|
|
45715
45715
|
if (!sectionId) continue;
|
|
45716
45716
|
const dataForThisSection = editor.converter.footers[sectionId];
|
|
45717
45717
|
if (!sectionData.headers[sectionId]) sectionData.footers[sectionId] = {};
|
|
@@ -46780,16 +46780,16 @@ const generateTableIfNecessary = ({ tableNode, annotationValues, tr, state: stat
|
|
|
46780
46780
|
if (rowsToGenerate <= 1) return;
|
|
46781
46781
|
const validateAttributes = (attrs) => {
|
|
46782
46782
|
const cleaned = {};
|
|
46783
|
-
for (const [
|
|
46783
|
+
for (const [key2, value] of Object.entries(attrs)) {
|
|
46784
46784
|
if (value !== void 0 && value !== null) {
|
|
46785
|
-
if (
|
|
46786
|
-
cleaned[
|
|
46787
|
-
} else if (
|
|
46788
|
-
cleaned[
|
|
46785
|
+
if (key2 === "displayLabel") {
|
|
46786
|
+
cleaned[key2] = String(value);
|
|
46787
|
+
} else if (key2 === "rawHtml" || key2 === "linkUrl" || key2 === "imageSrc") {
|
|
46788
|
+
cleaned[key2] = String(value);
|
|
46789
46789
|
} else if (typeof value === "string" && value.length > 0) {
|
|
46790
|
-
cleaned[
|
|
46790
|
+
cleaned[key2] = value;
|
|
46791
46791
|
} else if (typeof value !== "string") {
|
|
46792
|
-
cleaned[
|
|
46792
|
+
cleaned[key2] = value;
|
|
46793
46793
|
}
|
|
46794
46794
|
}
|
|
46795
46795
|
}
|
|
@@ -47067,10 +47067,10 @@ const Collaboration = Extension.create({
|
|
|
47067
47067
|
this.options.fragment = fragment;
|
|
47068
47068
|
const metaMap = this.options.ydoc.getMap("media");
|
|
47069
47069
|
metaMap.observe((event) => {
|
|
47070
|
-
event.changes.keys.forEach((_2,
|
|
47071
|
-
if (!(
|
|
47072
|
-
const fileData = metaMap.get(
|
|
47073
|
-
this.editor.storage.image.media[
|
|
47070
|
+
event.changes.keys.forEach((_2, key2) => {
|
|
47071
|
+
if (!(key2 in this.editor.storage.image.media)) {
|
|
47072
|
+
const fileData = metaMap.get(key2);
|
|
47073
|
+
this.editor.storage.image.media[key2] = fileData;
|
|
47074
47074
|
}
|
|
47075
47075
|
});
|
|
47076
47076
|
});
|
|
@@ -47090,8 +47090,8 @@ const initializeMetaMap = (ydoc, editor) => {
|
|
|
47090
47090
|
metaMap.set("docx", editor.options.content);
|
|
47091
47091
|
metaMap.set("fonts", editor.options.fonts);
|
|
47092
47092
|
const mediaMap = ydoc.getMap("media");
|
|
47093
|
-
Object.entries(editor.options.mediaFiles).forEach(([
|
|
47094
|
-
mediaMap.set(
|
|
47093
|
+
Object.entries(editor.options.mediaFiles).forEach(([key2, value]) => {
|
|
47094
|
+
mediaMap.set(key2, value);
|
|
47095
47095
|
});
|
|
47096
47096
|
};
|
|
47097
47097
|
const checkDocxChanged = (transaction) => {
|
|
@@ -47853,8 +47853,8 @@ function processRelationships(root2, convertedXml, results) {
|
|
|
47853
47853
|
};
|
|
47854
47854
|
const seenIds = /* @__PURE__ */ new Set();
|
|
47855
47855
|
const filtered = [];
|
|
47856
|
-
function extractStringAttr(attrs,
|
|
47857
|
-
return typeof attrs[
|
|
47856
|
+
function extractStringAttr(attrs, key2) {
|
|
47857
|
+
return typeof attrs[key2] === "string" ? attrs[key2].trim() : "";
|
|
47858
47858
|
}
|
|
47859
47859
|
for (const rel of root2.elements) {
|
|
47860
47860
|
rel.attributes = rel.attributes || {};
|
|
@@ -48071,10 +48071,10 @@ class SuperValidator {
|
|
|
48071
48071
|
this.logger.debug("Document analysis:", documentAnalysis);
|
|
48072
48072
|
let hasModifiedDocument = false;
|
|
48073
48073
|
const validationResults = [];
|
|
48074
|
-
Object.entries(__privateGet$1(this, _stateValidators)).forEach(([
|
|
48075
|
-
this.logger.debug(`🕵 Validating with ${
|
|
48074
|
+
Object.entries(__privateGet$1(this, _stateValidators)).forEach(([key2, validator]) => {
|
|
48075
|
+
this.logger.debug(`🕵 Validating with ${key2}...`);
|
|
48076
48076
|
const { results, modified } = validator(tr, documentAnalysis);
|
|
48077
|
-
validationResults.push({ key, results });
|
|
48077
|
+
validationResults.push({ key: key2, results });
|
|
48078
48078
|
hasModifiedDocument = hasModifiedDocument || modified;
|
|
48079
48079
|
});
|
|
48080
48080
|
if (!this.dryRun) dispatch(tr);
|
|
@@ -48091,10 +48091,10 @@ class SuperValidator {
|
|
|
48091
48091
|
const { dispatch } = __privateGet$1(this, _editor).view;
|
|
48092
48092
|
let hasModifiedDocument = false;
|
|
48093
48093
|
const validationResults = [];
|
|
48094
|
-
Object.entries(__privateGet$1(this, _xmlValidators)).forEach(([
|
|
48095
|
-
this.logger.debug(`🕵 Validating export with ${
|
|
48094
|
+
Object.entries(__privateGet$1(this, _xmlValidators)).forEach(([key2, validator]) => {
|
|
48095
|
+
this.logger.debug(`🕵 Validating export with ${key2}...`);
|
|
48096
48096
|
const { results, modified } = validator();
|
|
48097
|
-
validationResults.push({ key, results });
|
|
48097
|
+
validationResults.push({ key: key2, results });
|
|
48098
48098
|
hasModifiedDocument = hasModifiedDocument || modified;
|
|
48099
48099
|
});
|
|
48100
48100
|
if (!this.dryRun && hasModifiedDocument) dispatch(tr);
|
|
@@ -48114,11 +48114,11 @@ initializeValidators_fn = function() {
|
|
|
48114
48114
|
const requiredMarks = /* @__PURE__ */ new Set();
|
|
48115
48115
|
const initializeValidatorSet = (validatorFactories) => {
|
|
48116
48116
|
return Object.fromEntries(
|
|
48117
|
-
Object.entries(validatorFactories).map(([
|
|
48118
|
-
const validatorLogger = this.logger.withPrefix(
|
|
48117
|
+
Object.entries(validatorFactories).map(([key2, factory]) => {
|
|
48118
|
+
const validatorLogger = this.logger.withPrefix(key2);
|
|
48119
48119
|
const validator = factory({ editor: __privateGet$1(this, _editor), logger: validatorLogger });
|
|
48120
48120
|
__privateMethod$1(this, _SuperValidator_instances, collectValidatorRequirements_fn).call(this, validator, requiredNodes, requiredMarks);
|
|
48121
|
-
return [
|
|
48121
|
+
return [key2, validator];
|
|
48122
48122
|
})
|
|
48123
48123
|
);
|
|
48124
48124
|
};
|
|
@@ -49348,8 +49348,8 @@ initMedia_fn = function() {
|
|
|
49348
49348
|
if (!this.options.ydoc) return this.storage.image.media = this.options.mediaFiles;
|
|
49349
49349
|
const mediaMap = this.options.ydoc.getMap("media");
|
|
49350
49350
|
if (this.options.isNewFile) {
|
|
49351
|
-
Object.entries(this.options.mediaFiles).forEach(([
|
|
49352
|
-
mediaMap.set(
|
|
49351
|
+
Object.entries(this.options.mediaFiles).forEach(([key2, value]) => {
|
|
49352
|
+
mediaMap.set(key2, value);
|
|
49353
49353
|
});
|
|
49354
49354
|
this.storage.image.media = this.options.mediaFiles;
|
|
49355
49355
|
} else {
|
|
@@ -50174,11 +50174,11 @@ const FormatCommands = Extension.create({
|
|
|
50174
50174
|
const { type: type2, attrs } = mark;
|
|
50175
50175
|
const { name } = type2;
|
|
50176
50176
|
if (name === "textStyle") {
|
|
50177
|
-
Object.keys(attrs).forEach((
|
|
50178
|
-
if (!attrs[
|
|
50177
|
+
Object.keys(attrs).forEach((key2) => {
|
|
50178
|
+
if (!attrs[key2]) return;
|
|
50179
50179
|
const attributes = {};
|
|
50180
|
-
attributes[
|
|
50181
|
-
processedMarks.push({ name:
|
|
50180
|
+
attributes[key2] = attrs[key2];
|
|
50181
|
+
processedMarks.push({ name: key2, attrs: attributes });
|
|
50182
50182
|
});
|
|
50183
50183
|
} else {
|
|
50184
50184
|
processedMarks.push({ name, attrs });
|
|
@@ -50193,13 +50193,13 @@ const FormatCommands = Extension.create({
|
|
|
50193
50193
|
fontFamily: ["setFontFamily", "unsetFontFamily"]
|
|
50194
50194
|
};
|
|
50195
50195
|
let result = chain();
|
|
50196
|
-
Object.keys(marksToCommands).forEach((
|
|
50197
|
-
const [setCommand, unsetCommand, defaultParam] = marksToCommands[
|
|
50198
|
-
const markToApply = processedMarks.find((mark) => mark.name ===
|
|
50199
|
-
const hasEmptyAttrs = markToApply?.attrs && markToApply?.attrs[
|
|
50196
|
+
Object.keys(marksToCommands).forEach((key2) => {
|
|
50197
|
+
const [setCommand, unsetCommand, defaultParam] = marksToCommands[key2];
|
|
50198
|
+
const markToApply = processedMarks.find((mark) => mark.name === key2);
|
|
50199
|
+
const hasEmptyAttrs = markToApply?.attrs && markToApply?.attrs[key2];
|
|
50200
50200
|
let cmd = {};
|
|
50201
50201
|
if (!markToApply && !hasEmptyAttrs) cmd = { command: unsetCommand, argument: defaultParam };
|
|
50202
|
-
else cmd = { command: setCommand, argument: markToApply.attrs[
|
|
50202
|
+
else cmd = { command: setCommand, argument: markToApply.attrs[key2] || defaultParam };
|
|
50203
50203
|
result = result[cmd.command](cmd.argument);
|
|
50204
50204
|
});
|
|
50205
50205
|
this.storage.storedStyle = null;
|
|
@@ -51703,7 +51703,7 @@ const generateLinkedStyleString = (linkedStyle, basedOnStyle, node, parent, incl
|
|
|
51703
51703
|
resultStyles["text-transform"] = basedOnDefinitionStyles["text-transform"];
|
|
51704
51704
|
}
|
|
51705
51705
|
Object.entries(resultStyles).forEach(([k, value]) => {
|
|
51706
|
-
const
|
|
51706
|
+
const key2 = kebabCase$1(k);
|
|
51707
51707
|
const flattenedMarks = [];
|
|
51708
51708
|
node?.marks?.forEach((n) => {
|
|
51709
51709
|
if (n.type.name === "textStyle") {
|
|
@@ -51714,46 +51714,46 @@ const generateLinkedStyleString = (linkedStyle, basedOnStyle, node, parent, incl
|
|
|
51714
51714
|
});
|
|
51715
51715
|
return;
|
|
51716
51716
|
}
|
|
51717
|
-
flattenedMarks.push({ key: n.type.name, value: n.attrs[
|
|
51717
|
+
flattenedMarks.push({ key: n.type.name, value: n.attrs[key2] });
|
|
51718
51718
|
});
|
|
51719
|
-
const mark = flattenedMarks.find((n) => n.key ===
|
|
51719
|
+
const mark = flattenedMarks.find((n) => n.key === key2);
|
|
51720
51720
|
const hasParentIndent = Object.keys(parent?.attrs?.indent || {});
|
|
51721
51721
|
const hasParentSpacing = Object.keys(parent?.attrs?.spacing || {});
|
|
51722
51722
|
const listTypes = ["orderedList", "listItem"];
|
|
51723
51723
|
if (!mark) {
|
|
51724
|
-
if (
|
|
51724
|
+
if (key2 === "spacing" && includeSpacing && !hasParentSpacing) {
|
|
51725
51725
|
const space = getSpacingStyle(value);
|
|
51726
51726
|
Object.entries(space).forEach(([k2, v2]) => {
|
|
51727
51727
|
markValue[k2] = v2;
|
|
51728
51728
|
});
|
|
51729
|
-
} else if (
|
|
51729
|
+
} else if (key2 === "indent" && includeSpacing && !hasParentIndent) {
|
|
51730
51730
|
const { leftIndent, rightIndent, firstLine } = value;
|
|
51731
51731
|
if (leftIndent) markValue["margin-left"] = leftIndent + "px";
|
|
51732
51732
|
if (rightIndent) markValue["margin-right"] = rightIndent + "px";
|
|
51733
51733
|
if (firstLine) markValue["text-indent"] = firstLine + "px";
|
|
51734
|
-
} else if (
|
|
51734
|
+
} else if (key2 === "bold" && node) {
|
|
51735
51735
|
const val = value?.value;
|
|
51736
51736
|
if (!listTypes.includes(node.type.name) && val !== "0") {
|
|
51737
51737
|
markValue["font-weight"] = "bold";
|
|
51738
51738
|
}
|
|
51739
|
-
} else if (
|
|
51739
|
+
} else if (key2 === "text-transform" && node) {
|
|
51740
51740
|
if (!listTypes.includes(node.type.name)) {
|
|
51741
|
-
markValue[
|
|
51741
|
+
markValue[key2] = value;
|
|
51742
51742
|
}
|
|
51743
|
-
} else if (
|
|
51743
|
+
} else if (key2 === "font-size" && node) {
|
|
51744
51744
|
if (!listTypes.includes(node.type.name)) {
|
|
51745
|
-
markValue[
|
|
51745
|
+
markValue[key2] = value;
|
|
51746
51746
|
}
|
|
51747
|
-
} else if (
|
|
51747
|
+
} else if (key2 === "color" && node) {
|
|
51748
51748
|
if (!listTypes.includes(node.type.name)) {
|
|
51749
|
-
markValue[
|
|
51749
|
+
markValue[key2] = value;
|
|
51750
51750
|
}
|
|
51751
51751
|
} else if (typeof value === "string") {
|
|
51752
|
-
markValue[
|
|
51752
|
+
markValue[key2] = value;
|
|
51753
51753
|
}
|
|
51754
51754
|
}
|
|
51755
51755
|
});
|
|
51756
|
-
const final = Object.entries(markValue).map(([
|
|
51756
|
+
const final = Object.entries(markValue).map(([key2, value]) => `${key2}: ${value}`).join(";");
|
|
51757
51757
|
return final;
|
|
51758
51758
|
};
|
|
51759
51759
|
const applyLinkedStyleToTransaction = (tr, editor, style2) => {
|
|
@@ -52448,7 +52448,7 @@ function orderedListSync(editor) {
|
|
|
52448
52448
|
listNumberingType,
|
|
52449
52449
|
customFormat
|
|
52450
52450
|
};
|
|
52451
|
-
const keysChanged = Object.keys(updatedAttrs).some((
|
|
52451
|
+
const keysChanged = Object.keys(updatedAttrs).some((key2) => node.attrs[key2] !== updatedAttrs[key2]);
|
|
52452
52452
|
if (keysChanged) {
|
|
52453
52453
|
tr.setNodeMarkup(pos, void 0, updatedAttrs);
|
|
52454
52454
|
}
|
|
@@ -53575,11 +53575,11 @@ function updateTable(editor, node, table) {
|
|
|
53575
53575
|
const allExtensionsAttrs = editor.extensionService.attributes;
|
|
53576
53576
|
const tableExtensionAttrs = allExtensionsAttrs.filter((e) => e.type === "table");
|
|
53577
53577
|
const htmlAttributes = Attribute2.getAttributesToRender(node, tableExtensionAttrs);
|
|
53578
|
-
Object.entries(htmlAttributes).forEach(([
|
|
53579
|
-
if (
|
|
53578
|
+
Object.entries(htmlAttributes).forEach(([key2, value]) => {
|
|
53579
|
+
if (key2 === "style") {
|
|
53580
53580
|
table.style.cssText = value;
|
|
53581
53581
|
} else {
|
|
53582
|
-
table.setAttribute(
|
|
53582
|
+
table.setAttribute(key2, value);
|
|
53583
53583
|
}
|
|
53584
53584
|
});
|
|
53585
53585
|
}
|
|
@@ -53651,22 +53651,22 @@ var readFromCache;
|
|
|
53651
53651
|
var addToCache;
|
|
53652
53652
|
if (typeof WeakMap != "undefined") {
|
|
53653
53653
|
let cache2 = /* @__PURE__ */ new WeakMap();
|
|
53654
|
-
readFromCache = (
|
|
53655
|
-
addToCache = (
|
|
53656
|
-
cache2.set(
|
|
53654
|
+
readFromCache = (key2) => cache2.get(key2);
|
|
53655
|
+
addToCache = (key2, value) => {
|
|
53656
|
+
cache2.set(key2, value);
|
|
53657
53657
|
return value;
|
|
53658
53658
|
};
|
|
53659
53659
|
} else {
|
|
53660
53660
|
const cache2 = [];
|
|
53661
53661
|
const cacheSize = 10;
|
|
53662
53662
|
let cachePos = 0;
|
|
53663
|
-
readFromCache = (
|
|
53663
|
+
readFromCache = (key2) => {
|
|
53664
53664
|
for (let i = 0; i < cache2.length; i += 2)
|
|
53665
|
-
if (cache2[i] ==
|
|
53665
|
+
if (cache2[i] == key2) return cache2[i + 1];
|
|
53666
53666
|
};
|
|
53667
|
-
addToCache = (
|
|
53667
|
+
addToCache = (key2, value) => {
|
|
53668
53668
|
if (cachePos == cacheSize) cachePos = 0;
|
|
53669
|
-
cache2[cachePos++] =
|
|
53669
|
+
cache2[cachePos++] = key2;
|
|
53670
53670
|
return cache2[cachePos++] = value;
|
|
53671
53671
|
};
|
|
53672
53672
|
}
|
|
@@ -55900,8 +55900,8 @@ const Table = Node$1.create({
|
|
|
55900
55900
|
default: {},
|
|
55901
55901
|
renderDOM({ borders }) {
|
|
55902
55902
|
if (!borders) return {};
|
|
55903
|
-
const style2 = Object.entries(borders).reduce((acc, [
|
|
55904
|
-
return `${acc}border-${
|
|
55903
|
+
const style2 = Object.entries(borders).reduce((acc, [key2, { size: size2, color }]) => {
|
|
55904
|
+
return `${acc}border-${key2}: ${Math.ceil(size2)}px solid ${color || "black"};`;
|
|
55905
55905
|
}, "");
|
|
55906
55906
|
return {
|
|
55907
55907
|
style: style2
|
|
@@ -57016,11 +57016,11 @@ createAnnotation_fn = function({ displayLabel } = {}) {
|
|
|
57016
57016
|
let mergedAttrs = Attribute2.mergeAttributes(this.htmlAttributes, {
|
|
57017
57017
|
style: omitHighlight ? "" : annotationStyle
|
|
57018
57018
|
});
|
|
57019
|
-
for (let [
|
|
57020
|
-
if (
|
|
57019
|
+
for (let [key2, value] of Object.entries(mergedAttrs)) {
|
|
57020
|
+
if (key2 === "style") {
|
|
57021
57021
|
annotation.style.cssText = value;
|
|
57022
57022
|
} else {
|
|
57023
|
-
annotation.setAttribute(
|
|
57023
|
+
annotation.setAttribute(key2, value);
|
|
57024
57024
|
}
|
|
57025
57025
|
}
|
|
57026
57026
|
return {
|
|
@@ -57194,13 +57194,13 @@ function hash$2(str) {
|
|
|
57194
57194
|
}
|
|
57195
57195
|
const colorToInt = (x) => parseInt(x.replace(/_/g, ""), 36);
|
|
57196
57196
|
const compressedColorMap = "1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((acc, next) => {
|
|
57197
|
-
const
|
|
57197
|
+
const key2 = colorToInt(next.substring(0, 3));
|
|
57198
57198
|
const hex2 = colorToInt(next.substring(3)).toString(16);
|
|
57199
57199
|
let prefix2 = "";
|
|
57200
57200
|
for (let i = 0; i < 6 - hex2.length; i++) {
|
|
57201
57201
|
prefix2 += "0";
|
|
57202
57202
|
}
|
|
57203
|
-
acc[
|
|
57203
|
+
acc[key2] = `${prefix2}${hex2}`;
|
|
57204
57204
|
return acc;
|
|
57205
57205
|
}, {});
|
|
57206
57206
|
function nameToHex(color) {
|
|
@@ -58316,41 +58316,480 @@ function getFormatAttrsFromMarks(marks) {
|
|
|
58316
58316
|
}
|
|
58317
58317
|
return formatAttrs;
|
|
58318
58318
|
}
|
|
58319
|
-
const
|
|
58320
|
-
|
|
58319
|
+
const simpleHash = (str) => {
|
|
58320
|
+
let hash2 = 0;
|
|
58321
|
+
for (let i = 0; i < str.length; i++) {
|
|
58322
|
+
const char = str.charCodeAt(i);
|
|
58323
|
+
hash2 = (hash2 << 5) - hash2 + char;
|
|
58324
|
+
hash2 = hash2 & hash2;
|
|
58325
|
+
}
|
|
58326
|
+
return Math.abs(hash2).toString();
|
|
58327
|
+
};
|
|
58328
|
+
const base64ToFile = (base64String) => {
|
|
58329
|
+
const arr = base64String.split(",");
|
|
58330
|
+
const mimeMatch = arr[0].match(/:(.*?);/);
|
|
58331
|
+
const mimeType = mimeMatch ? mimeMatch[1] : "";
|
|
58332
|
+
const data = arr[1];
|
|
58333
|
+
const binaryString = atob(data);
|
|
58334
|
+
const hash2 = simpleHash(binaryString);
|
|
58335
|
+
const extension = mimeType.split("/")[1] || "bin";
|
|
58336
|
+
const filename = `image-${hash2}.${extension}`;
|
|
58337
|
+
const bytes = new Uint8Array(binaryString.length);
|
|
58338
|
+
for (let i = 0; i < binaryString.length; i++) {
|
|
58339
|
+
bytes[i] = binaryString.charCodeAt(i);
|
|
58340
|
+
}
|
|
58341
|
+
const blob = new Blob([bytes], { type: mimeType });
|
|
58342
|
+
return new File([blob], filename, { type: mimeType });
|
|
58343
|
+
};
|
|
58344
|
+
const urlToFile = async (url, filename, mimeType) => {
|
|
58345
|
+
try {
|
|
58346
|
+
const response = await fetch(url, {
|
|
58347
|
+
mode: "cors",
|
|
58348
|
+
credentials: "omit",
|
|
58349
|
+
headers: {
|
|
58350
|
+
// Add common headers that might help with CORS
|
|
58351
|
+
Accept: "image/*,*/*;q=0.8"
|
|
58352
|
+
}
|
|
58353
|
+
});
|
|
58354
|
+
if (!response.ok) {
|
|
58355
|
+
console.warn(`Failed to fetch image from ${url}: ${response.status} ${response.statusText}`);
|
|
58356
|
+
return null;
|
|
58357
|
+
}
|
|
58358
|
+
const blob = await response.blob();
|
|
58359
|
+
const finalFilename = filename || extractFilenameFromUrl(url);
|
|
58360
|
+
const finalMimeType = mimeType || response.headers.get("content-type") || blob.type || "image/jpeg";
|
|
58361
|
+
return new File([blob], finalFilename, { type: finalMimeType });
|
|
58362
|
+
} catch (error) {
|
|
58363
|
+
if (isCorsError(error)) {
|
|
58364
|
+
console.warn(`CORS policy prevents accessing image from ${url}:`, error.message);
|
|
58365
|
+
return null;
|
|
58366
|
+
}
|
|
58367
|
+
console.error(`Error fetching image from ${url}:`, error);
|
|
58368
|
+
return null;
|
|
58369
|
+
}
|
|
58370
|
+
};
|
|
58371
|
+
const isCorsError = (error) => {
|
|
58372
|
+
const errorMessage = error.message.toLowerCase();
|
|
58373
|
+
const errorName = error.name.toLowerCase();
|
|
58374
|
+
return errorName.includes("cors") || errorMessage.includes("cors") || errorMessage.includes("cross-origin") || errorMessage.includes("access-control") || errorMessage.includes("network error") || // Often indicates CORS in browsers
|
|
58375
|
+
errorMessage.includes("failed to fetch");
|
|
58376
|
+
};
|
|
58377
|
+
const extractFilenameFromUrl = (url) => {
|
|
58378
|
+
try {
|
|
58379
|
+
const urlObj = new URL(url);
|
|
58380
|
+
const pathname = urlObj.pathname;
|
|
58381
|
+
const filename = pathname.split("/").pop();
|
|
58382
|
+
if (filename && !filename.includes(".")) {
|
|
58383
|
+
return `${filename}.jpg`;
|
|
58384
|
+
}
|
|
58385
|
+
return filename || "image.jpg";
|
|
58386
|
+
} catch {
|
|
58387
|
+
return "image.jpg";
|
|
58388
|
+
}
|
|
58389
|
+
};
|
|
58390
|
+
const validateUrlAccessibility = async (url) => {
|
|
58391
|
+
try {
|
|
58392
|
+
const response = await fetch(url, {
|
|
58393
|
+
method: "HEAD",
|
|
58394
|
+
mode: "cors",
|
|
58395
|
+
credentials: "omit"
|
|
58396
|
+
});
|
|
58397
|
+
return response.ok;
|
|
58398
|
+
} catch (_error) {
|
|
58399
|
+
return false;
|
|
58400
|
+
}
|
|
58401
|
+
};
|
|
58402
|
+
const handleImageUpload = (file) => {
|
|
58403
|
+
return new Promise((resolve, reject) => {
|
|
58404
|
+
let reader = new FileReader();
|
|
58405
|
+
reader.onload = (event) => {
|
|
58406
|
+
resolve(event.target.result);
|
|
58407
|
+
};
|
|
58408
|
+
reader.onerror = reject;
|
|
58409
|
+
setTimeout(() => reader.readAsDataURL(file), 250);
|
|
58410
|
+
});
|
|
58411
|
+
};
|
|
58412
|
+
const processUploadedImage = (fileData, getMaxContentSize) => {
|
|
58413
|
+
return new Promise((resolve, reject) => {
|
|
58414
|
+
const img = new window.Image();
|
|
58415
|
+
img.onload = () => {
|
|
58416
|
+
const canvas = document.createElement("canvas");
|
|
58417
|
+
const { width: logicalWidth, height: logicalHeight } = getAllowedImageDimensions(
|
|
58418
|
+
img.width,
|
|
58419
|
+
img.height,
|
|
58420
|
+
getMaxContentSize
|
|
58421
|
+
);
|
|
58422
|
+
canvas.width = img.width;
|
|
58423
|
+
canvas.height = img.height;
|
|
58424
|
+
const ctx2 = canvas.getContext("2d");
|
|
58425
|
+
if (ctx2) {
|
|
58426
|
+
ctx2.imageSmoothingEnabled = true;
|
|
58427
|
+
try {
|
|
58428
|
+
ctx2.imageSmoothingQuality = "high";
|
|
58429
|
+
} catch {
|
|
58430
|
+
}
|
|
58431
|
+
}
|
|
58432
|
+
ctx2.drawImage(img, 0, 0, img.width, img.height);
|
|
58433
|
+
const dpr = typeof window !== "undefined" && window.devicePixelRatio ? window.devicePixelRatio : 1;
|
|
58434
|
+
const targetPixelWidth = Math.round(logicalWidth * dpr);
|
|
58435
|
+
const targetPixelHeight = Math.round(logicalHeight * dpr);
|
|
58436
|
+
const finalTargetWidth = Math.min(targetPixelWidth, img.width);
|
|
58437
|
+
const finalTargetHeight = Math.min(targetPixelHeight, img.height);
|
|
58438
|
+
const resizeNeeded = finalTargetWidth !== img.width || finalTargetHeight !== img.height;
|
|
58439
|
+
if (resizeNeeded) {
|
|
58440
|
+
multiStepResize(canvas, finalTargetWidth, finalTargetHeight);
|
|
58441
|
+
}
|
|
58442
|
+
if (typeof fileData === "string") {
|
|
58443
|
+
const resizedBase64 = canvas.toDataURL();
|
|
58444
|
+
resolve(resizedBase64);
|
|
58445
|
+
} else {
|
|
58446
|
+
canvas.toBlob((blob) => {
|
|
58447
|
+
const updatedFile = new File([blob], fileData.name, {
|
|
58448
|
+
type: fileData.type,
|
|
58449
|
+
lastModified: Date.now()
|
|
58450
|
+
});
|
|
58451
|
+
resolve({ file: updatedFile, width: logicalWidth, height: logicalHeight });
|
|
58452
|
+
});
|
|
58453
|
+
}
|
|
58454
|
+
};
|
|
58455
|
+
img.onerror = (error) => reject(error);
|
|
58456
|
+
img.src = typeof fileData === "string" ? fileData : URL.createObjectURL(fileData);
|
|
58457
|
+
});
|
|
58458
|
+
};
|
|
58459
|
+
const getAllowedImageDimensions = (width, height, getMaxContentSize) => {
|
|
58460
|
+
const { width: maxWidth, height: maxHeight } = getMaxContentSize();
|
|
58461
|
+
if (!maxWidth || !maxHeight) return { width, height };
|
|
58462
|
+
let adjustedWidth = width;
|
|
58463
|
+
let adjustedHeight = height;
|
|
58464
|
+
const aspectRatio = width / height;
|
|
58465
|
+
if (height > maxHeight) {
|
|
58466
|
+
adjustedHeight = maxHeight;
|
|
58467
|
+
adjustedWidth = Math.round(maxHeight * aspectRatio);
|
|
58468
|
+
}
|
|
58469
|
+
if (adjustedWidth > maxWidth) {
|
|
58470
|
+
adjustedWidth = maxWidth;
|
|
58471
|
+
adjustedHeight = Math.round(maxWidth / aspectRatio);
|
|
58472
|
+
}
|
|
58473
|
+
return { width: adjustedWidth, height: adjustedHeight };
|
|
58474
|
+
};
|
|
58475
|
+
function resample_high_quality(canvas, width, height, resize_canvas) {
|
|
58476
|
+
var width_source = canvas.width;
|
|
58477
|
+
var height_source = canvas.height;
|
|
58478
|
+
width = Math.round(width);
|
|
58479
|
+
height = Math.round(height);
|
|
58480
|
+
var ratio_w = width_source / width;
|
|
58481
|
+
var ratio_h = height_source / height;
|
|
58482
|
+
var ratio_w_half = Math.ceil(ratio_w / 2);
|
|
58483
|
+
var ratio_h_half = Math.ceil(ratio_h / 2);
|
|
58484
|
+
var ctx2 = canvas.getContext("2d");
|
|
58485
|
+
var img = ctx2.getImageData(0, 0, width_source, height_source);
|
|
58486
|
+
var img2 = ctx2.createImageData(width, height);
|
|
58487
|
+
var data = img.data;
|
|
58488
|
+
var data2 = img2.data;
|
|
58489
|
+
for (var j2 = 0; j2 < height; j2++) {
|
|
58490
|
+
for (var i = 0; i < width; i++) {
|
|
58491
|
+
var x2 = (i + j2 * width) * 4;
|
|
58492
|
+
var weight = 0;
|
|
58493
|
+
var weights = 0;
|
|
58494
|
+
var weights_alpha = 0;
|
|
58495
|
+
var gx_r = 0;
|
|
58496
|
+
var gx_g = 0;
|
|
58497
|
+
var gx_b = 0;
|
|
58498
|
+
var gx_a = 0;
|
|
58499
|
+
var center_y = (j2 + 0.5) * ratio_h;
|
|
58500
|
+
var yy_start = Math.floor(j2 * ratio_h);
|
|
58501
|
+
var yy_stop = Math.ceil((j2 + 1) * ratio_h);
|
|
58502
|
+
for (var yy = yy_start; yy < yy_stop; yy++) {
|
|
58503
|
+
var dy = Math.abs(center_y - (yy + 0.5)) / ratio_h_half;
|
|
58504
|
+
var center_x = (i + 0.5) * ratio_w;
|
|
58505
|
+
var w0 = dy * dy;
|
|
58506
|
+
var xx_start = Math.floor(i * ratio_w);
|
|
58507
|
+
var xx_stop = Math.ceil((i + 1) * ratio_w);
|
|
58508
|
+
for (var xx = xx_start; xx < xx_stop; xx++) {
|
|
58509
|
+
var dx = Math.abs(center_x - (xx + 0.5)) / ratio_w_half;
|
|
58510
|
+
var w2 = Math.sqrt(w0 + dx * dx);
|
|
58511
|
+
if (w2 >= 1) {
|
|
58512
|
+
continue;
|
|
58513
|
+
}
|
|
58514
|
+
weight = 2 * w2 * w2 * w2 - 3 * w2 * w2 + 1;
|
|
58515
|
+
var pos_x = 4 * (xx + yy * width_source);
|
|
58516
|
+
gx_a += weight * data[pos_x + 3];
|
|
58517
|
+
weights_alpha += weight;
|
|
58518
|
+
if (data[pos_x + 3] < 255) weight = weight * data[pos_x + 3] / 250;
|
|
58519
|
+
gx_r += weight * data[pos_x];
|
|
58520
|
+
gx_g += weight * data[pos_x + 1];
|
|
58521
|
+
gx_b += weight * data[pos_x + 2];
|
|
58522
|
+
weights += weight;
|
|
58523
|
+
}
|
|
58524
|
+
}
|
|
58525
|
+
data2[x2] = gx_r / weights;
|
|
58526
|
+
data2[x2 + 1] = gx_g / weights;
|
|
58527
|
+
data2[x2 + 2] = gx_b / weights;
|
|
58528
|
+
data2[x2 + 3] = gx_a / weights_alpha;
|
|
58529
|
+
}
|
|
58530
|
+
}
|
|
58531
|
+
{
|
|
58532
|
+
canvas.width = width;
|
|
58533
|
+
canvas.height = height;
|
|
58534
|
+
}
|
|
58535
|
+
ctx2.putImageData(img2, 0, 0);
|
|
58536
|
+
}
|
|
58537
|
+
function multiStepResize(canvas, width, height) {
|
|
58538
|
+
let oc = document.createElement("canvas");
|
|
58539
|
+
let octx = oc.getContext("2d");
|
|
58540
|
+
let ctx2 = canvas.getContext("2d");
|
|
58541
|
+
let steps = Math.ceil(Math.log(canvas.width / width) / Math.log(2));
|
|
58542
|
+
steps = Math.max(steps, 1);
|
|
58543
|
+
let stepWidth = width * Math.pow(2, steps - 1);
|
|
58544
|
+
let stepHeight = height * Math.pow(2, steps - 1);
|
|
58545
|
+
let currentWidth = canvas.width;
|
|
58546
|
+
let currentHeight = canvas.height;
|
|
58547
|
+
oc.width = currentWidth;
|
|
58548
|
+
oc.height = currentHeight;
|
|
58549
|
+
octx.drawImage(canvas, 0, 0);
|
|
58550
|
+
while (steps > 0) {
|
|
58551
|
+
stepWidth = Math.max(stepWidth, width);
|
|
58552
|
+
stepHeight = Math.max(stepHeight, height);
|
|
58553
|
+
canvas.width = stepWidth;
|
|
58554
|
+
canvas.height = stepHeight;
|
|
58555
|
+
ctx2.drawImage(oc, 0, 0, currentWidth, currentHeight, 0, 0, stepWidth, stepHeight);
|
|
58556
|
+
currentWidth = stepWidth;
|
|
58557
|
+
currentHeight = stepHeight;
|
|
58558
|
+
oc.width = currentWidth;
|
|
58559
|
+
oc.height = currentHeight;
|
|
58560
|
+
octx.drawImage(canvas, 0, 0);
|
|
58561
|
+
stepWidth = Math.round(stepWidth / 2);
|
|
58562
|
+
stepHeight = Math.round(stepHeight / 2);
|
|
58563
|
+
steps--;
|
|
58564
|
+
}
|
|
58565
|
+
resample_high_quality(canvas, width, height);
|
|
58566
|
+
}
|
|
58567
|
+
const fileTooLarge = (file) => {
|
|
58568
|
+
let fileSizeMb = Number((file.size / (1024 * 1024)).toFixed(4));
|
|
58569
|
+
if (fileSizeMb > 5) {
|
|
58570
|
+
window.alert("Image size must be less than 5MB");
|
|
58571
|
+
return true;
|
|
58572
|
+
}
|
|
58573
|
+
return false;
|
|
58574
|
+
};
|
|
58575
|
+
const checkAndProcessImage = async ({ getMaxContentSize, file }) => {
|
|
58576
|
+
if (fileTooLarge(file)) {
|
|
58577
|
+
return { file: null, size: { width: 0, height: 0 } };
|
|
58578
|
+
}
|
|
58579
|
+
try {
|
|
58580
|
+
const processedImageResult = await processUploadedImage(file, getMaxContentSize);
|
|
58581
|
+
const process2 = processedImageResult;
|
|
58582
|
+
return { file: process2.file, size: { width: process2.width, height: process2.height } };
|
|
58583
|
+
} catch (err) {
|
|
58584
|
+
console.warn("Error processing image:", err);
|
|
58585
|
+
return { file: null, size: { width: 0, height: 0 } };
|
|
58586
|
+
}
|
|
58587
|
+
};
|
|
58588
|
+
function replaceSelectionWithImagePlaceholder({ editorOptions, view, id }) {
|
|
58589
|
+
let { tr } = view.state;
|
|
58590
|
+
let { selection } = tr;
|
|
58591
|
+
if (editorOptions.isHeaderOrFooter) {
|
|
58592
|
+
selection = editorOptions.lastSelection;
|
|
58593
|
+
}
|
|
58594
|
+
if (!selection.empty && !editorOptions.isHeaderOrFooter) {
|
|
58595
|
+
tr.deleteSelection();
|
|
58596
|
+
}
|
|
58597
|
+
tr = addImagePlaceholder(view.state, tr, id, selection.from);
|
|
58598
|
+
view.dispatch(tr);
|
|
58599
|
+
}
|
|
58600
|
+
async function uploadAndInsertImage({ editor, view, file, size: size2, id }) {
|
|
58601
|
+
const imageUploadHandler = typeof editor.options.handleImageUpload === "function" ? editor.options.handleImageUpload : handleImageUpload;
|
|
58602
|
+
try {
|
|
58603
|
+
let url = await imageUploadHandler(file);
|
|
58604
|
+
let fileName = file.name.replace(" ", "_");
|
|
58605
|
+
let placeholderPos = findPlaceholder(view.state, id);
|
|
58606
|
+
if (placeholderPos == null) {
|
|
58607
|
+
return;
|
|
58608
|
+
}
|
|
58609
|
+
let mediaPath = `word/media/${fileName}`;
|
|
58610
|
+
let rId = null;
|
|
58611
|
+
if (editor.options.mode === "docx") {
|
|
58612
|
+
const [, path] = mediaPath.split("word/");
|
|
58613
|
+
const id2 = addImageRelationship({ editor, path });
|
|
58614
|
+
if (id2) rId = id2;
|
|
58615
|
+
}
|
|
58616
|
+
let imageNode = view.state.schema.nodes.image.create({
|
|
58617
|
+
src: mediaPath,
|
|
58618
|
+
size: size2,
|
|
58619
|
+
id,
|
|
58620
|
+
rId
|
|
58621
|
+
});
|
|
58622
|
+
editor.storage.image.media = Object.assign(editor.storage.image.media, { [mediaPath]: url });
|
|
58623
|
+
if (editor.options.ydoc && typeof editor.commands.addImageToCollaboration === "function") {
|
|
58624
|
+
editor.commands.addImageToCollaboration({ mediaPath, fileData: url });
|
|
58625
|
+
}
|
|
58626
|
+
let tr = view.state.tr;
|
|
58627
|
+
tr.replaceWith(placeholderPos, placeholderPos, imageNode);
|
|
58628
|
+
tr = removeImagePlaceholder(view.state, tr, id);
|
|
58629
|
+
view.dispatch(tr);
|
|
58630
|
+
} catch {
|
|
58631
|
+
const tr = removeImagePlaceholder(view.state, view.state.tr, id);
|
|
58632
|
+
view.dispatch(tr);
|
|
58633
|
+
}
|
|
58634
|
+
}
|
|
58635
|
+
function addImageRelationship({ editor, path }) {
|
|
58636
|
+
const target = path;
|
|
58637
|
+
const type2 = "image";
|
|
58638
|
+
try {
|
|
58639
|
+
const id = insertNewRelationship(target, type2, editor);
|
|
58640
|
+
return id;
|
|
58641
|
+
} catch {
|
|
58642
|
+
return null;
|
|
58643
|
+
}
|
|
58644
|
+
}
|
|
58645
|
+
const key = new PluginKey("ImageRegistration");
|
|
58646
|
+
const ImageRegistrationPlugin = ({ editor }) => {
|
|
58647
|
+
const { view } = editor;
|
|
58321
58648
|
return new Plugin({
|
|
58322
|
-
key
|
|
58649
|
+
key,
|
|
58323
58650
|
state: {
|
|
58324
58651
|
init() {
|
|
58325
|
-
return DecorationSet.empty;
|
|
58652
|
+
return { set: DecorationSet.empty };
|
|
58326
58653
|
},
|
|
58327
|
-
apply(tr, set) {
|
|
58654
|
+
apply(tr, { set }) {
|
|
58655
|
+
const meta = tr.getMeta(key);
|
|
58656
|
+
if (meta) {
|
|
58657
|
+
set = meta.set;
|
|
58658
|
+
return { set };
|
|
58659
|
+
}
|
|
58328
58660
|
set = set.map(tr.mapping, tr.doc);
|
|
58329
|
-
|
|
58330
|
-
|
|
58331
|
-
|
|
58332
|
-
|
|
58333
|
-
|
|
58661
|
+
return { set };
|
|
58662
|
+
}
|
|
58663
|
+
},
|
|
58664
|
+
appendTransaction: (trs, _oldState, state2) => {
|
|
58665
|
+
let foundImages = [];
|
|
58666
|
+
trs.forEach((tr2) => {
|
|
58667
|
+
if (tr2.docChanged) {
|
|
58668
|
+
tr2.steps.forEach((step, index2) => {
|
|
58669
|
+
const stepMap = step.getMap();
|
|
58670
|
+
foundImages = foundImages.map(({ node, pos, id }) => {
|
|
58671
|
+
const mappedPos = stepMap.map(pos, -1);
|
|
58672
|
+
return { node, pos: mappedPos, id };
|
|
58673
|
+
});
|
|
58674
|
+
if (step instanceof ReplaceStep || step instanceof ReplaceAroundStep$1) {
|
|
58675
|
+
(tr2.docs[index2 + 1] || tr2.doc).nodesBetween(
|
|
58676
|
+
stepMap.map(step.from, -1),
|
|
58677
|
+
stepMap.map(step.to, 1),
|
|
58678
|
+
(node, pos) => {
|
|
58679
|
+
if (node.type.name === "image" && !node.attrs.src.startsWith("word/media")) {
|
|
58680
|
+
const id = {};
|
|
58681
|
+
foundImages.push({ node, pos, id });
|
|
58682
|
+
} else {
|
|
58683
|
+
return true;
|
|
58684
|
+
}
|
|
58685
|
+
}
|
|
58686
|
+
);
|
|
58687
|
+
}
|
|
58334
58688
|
});
|
|
58335
|
-
set = set.add(tr.doc, [deco]);
|
|
58336
|
-
} else if (action?.type === "remove") {
|
|
58337
|
-
set = set.remove(set.find(null, null, (spec) => spec.id == action.id));
|
|
58338
58689
|
}
|
|
58339
|
-
|
|
58690
|
+
});
|
|
58691
|
+
if (!foundImages || foundImages.length === 0) {
|
|
58692
|
+
return null;
|
|
58340
58693
|
}
|
|
58694
|
+
registerImages(foundImages, editor, view);
|
|
58695
|
+
const tr = state2.tr;
|
|
58696
|
+
let { set } = key.getState(state2);
|
|
58697
|
+
foundImages.slice().sort((a, b2) => a.pos - b2.pos).forEach(({ pos, id }) => {
|
|
58698
|
+
let deco = Decoration.widget(pos, () => document.createElement("placeholder"), {
|
|
58699
|
+
side: -1,
|
|
58700
|
+
id
|
|
58701
|
+
});
|
|
58702
|
+
set = set.add(tr.doc, [deco]);
|
|
58703
|
+
});
|
|
58704
|
+
foundImages.slice().sort((a, b2) => b2.pos - a.pos).forEach(({ node, pos }) => {
|
|
58705
|
+
tr.delete(pos, pos + node.nodeSize);
|
|
58706
|
+
});
|
|
58707
|
+
set = set.map(tr.mapping, tr.doc);
|
|
58708
|
+
tr.setMeta(key, { set });
|
|
58709
|
+
return tr;
|
|
58341
58710
|
},
|
|
58342
58711
|
props: {
|
|
58343
58712
|
decorations(state2) {
|
|
58344
|
-
|
|
58713
|
+
let { set } = key.getState(state2);
|
|
58714
|
+
return set;
|
|
58345
58715
|
}
|
|
58346
58716
|
}
|
|
58347
58717
|
});
|
|
58348
58718
|
};
|
|
58349
58719
|
const findPlaceholder = (state2, id) => {
|
|
58350
|
-
let
|
|
58351
|
-
let found2 =
|
|
58720
|
+
let { set } = key.getState(state2);
|
|
58721
|
+
let found2 = set?.find(null, null, (spec) => spec.id === id);
|
|
58352
58722
|
return found2?.length ? found2[0].from : null;
|
|
58353
58723
|
};
|
|
58724
|
+
const removeImagePlaceholder = (state2, tr, id) => {
|
|
58725
|
+
let { set } = key.getState(state2);
|
|
58726
|
+
set = set.map(tr.mapping, tr.doc);
|
|
58727
|
+
set = set.remove(set.find(null, null, (spec) => spec.id == id));
|
|
58728
|
+
return tr.setMeta(key, { set, type: "remove" });
|
|
58729
|
+
};
|
|
58730
|
+
const addImagePlaceholder = (state2, tr, id, pos) => {
|
|
58731
|
+
let { set } = key.getState(state2);
|
|
58732
|
+
set = set.map(tr.mapping, tr.doc);
|
|
58733
|
+
let deco = Decoration.widget(pos, () => document.createElement("placeholder"), {
|
|
58734
|
+
id
|
|
58735
|
+
});
|
|
58736
|
+
set = set.add(tr.doc, [deco]);
|
|
58737
|
+
return tr.setMeta(key, { set, type: "add" });
|
|
58738
|
+
};
|
|
58739
|
+
const getImageRegistrationMetaType = (tr) => {
|
|
58740
|
+
const meta = tr.getMeta(key);
|
|
58741
|
+
if (meta && meta.type) {
|
|
58742
|
+
return meta.type;
|
|
58743
|
+
}
|
|
58744
|
+
return null;
|
|
58745
|
+
};
|
|
58746
|
+
const registerImages = async (foundImages, editor, view) => {
|
|
58747
|
+
foundImages.forEach(async (image) => {
|
|
58748
|
+
const src = image.node.attrs.src;
|
|
58749
|
+
const id = image.id;
|
|
58750
|
+
let file = null;
|
|
58751
|
+
if (src.startsWith("http")) {
|
|
58752
|
+
const isAccessible = await validateUrlAccessibility(src);
|
|
58753
|
+
if (isAccessible) {
|
|
58754
|
+
file = await urlToFile(src);
|
|
58755
|
+
} else {
|
|
58756
|
+
console.warn(`Image URL ${src} is not accessible due to CORS or other restrictions. Using original URL.`);
|
|
58757
|
+
const tr = view.state.tr;
|
|
58758
|
+
removeImagePlaceholder(view.state, tr, id);
|
|
58759
|
+
view.dispatch(tr);
|
|
58760
|
+
return;
|
|
58761
|
+
}
|
|
58762
|
+
} else if (src.startsWith("data:")) {
|
|
58763
|
+
file = base64ToFile(src);
|
|
58764
|
+
} else {
|
|
58765
|
+
console.error(`Unsupported image source: ${src}`);
|
|
58766
|
+
}
|
|
58767
|
+
if (!file) {
|
|
58768
|
+
const tr = view.state.tr;
|
|
58769
|
+
removeImagePlaceholder(view.state, tr, id);
|
|
58770
|
+
view.dispatch(tr);
|
|
58771
|
+
return;
|
|
58772
|
+
}
|
|
58773
|
+
try {
|
|
58774
|
+
const process2 = await checkAndProcessImage({
|
|
58775
|
+
getMaxContentSize: () => editor.getMaxContentSize(),
|
|
58776
|
+
file
|
|
58777
|
+
});
|
|
58778
|
+
if (!process2.file) {
|
|
58779
|
+
const tr = view.state.tr;
|
|
58780
|
+
removeImagePlaceholder(view.state, tr, id);
|
|
58781
|
+
view.dispatch(tr);
|
|
58782
|
+
return;
|
|
58783
|
+
}
|
|
58784
|
+
await uploadAndInsertImage({ editor, view, file: process2.file, size: process2.size, id });
|
|
58785
|
+
} catch (error) {
|
|
58786
|
+
console.error(`Error processing image from ${src}:`, error);
|
|
58787
|
+
const tr = view.state.tr;
|
|
58788
|
+
removeImagePlaceholder(view.state, tr, id);
|
|
58789
|
+
view.dispatch(tr);
|
|
58790
|
+
}
|
|
58791
|
+
});
|
|
58792
|
+
};
|
|
58354
58793
|
const ImagePositionPluginKey = new PluginKey("ImagePosition");
|
|
58355
58794
|
const ImagePositionPlugin = ({ editor }) => {
|
|
58356
58795
|
const { view } = editor;
|
|
@@ -58683,7 +59122,7 @@ const Image = Node$1.create({
|
|
|
58683
59122
|
};
|
|
58684
59123
|
},
|
|
58685
59124
|
addPmPlugins() {
|
|
58686
|
-
return [
|
|
59125
|
+
return [ImageRegistrationPlugin({ editor: this.editor }), ImagePositionPlugin({ editor: this.editor })];
|
|
58687
59126
|
}
|
|
58688
59127
|
});
|
|
58689
59128
|
const ACCEPT_IMAGE_TYPES = [".jpg", ".jpeg", ".png", "image/jpeg", "image/png"];
|
|
@@ -58708,247 +59147,6 @@ const getFileOpener = () => {
|
|
|
58708
59147
|
};
|
|
58709
59148
|
return openFile;
|
|
58710
59149
|
};
|
|
58711
|
-
const handleImageUpload = (file) => {
|
|
58712
|
-
return new Promise((resolve, reject) => {
|
|
58713
|
-
let reader = new FileReader();
|
|
58714
|
-
reader.onload = (event) => {
|
|
58715
|
-
resolve(event.target.result);
|
|
58716
|
-
};
|
|
58717
|
-
reader.onerror = reject;
|
|
58718
|
-
setTimeout(() => reader.readAsDataURL(file), 250);
|
|
58719
|
-
});
|
|
58720
|
-
};
|
|
58721
|
-
const processUploadedImage = (fileData, editor) => {
|
|
58722
|
-
return new Promise((resolve, reject) => {
|
|
58723
|
-
const img = new window.Image();
|
|
58724
|
-
img.onload = () => {
|
|
58725
|
-
const canvas = document.createElement("canvas");
|
|
58726
|
-
const { width: logicalWidth, height: logicalHeight } = getAllowedImageDimensions(img.width, img.height, editor);
|
|
58727
|
-
canvas.width = img.width;
|
|
58728
|
-
canvas.height = img.height;
|
|
58729
|
-
const ctx2 = canvas.getContext("2d");
|
|
58730
|
-
if (ctx2) {
|
|
58731
|
-
ctx2.imageSmoothingEnabled = true;
|
|
58732
|
-
try {
|
|
58733
|
-
ctx2.imageSmoothingQuality = "high";
|
|
58734
|
-
} catch {
|
|
58735
|
-
}
|
|
58736
|
-
}
|
|
58737
|
-
ctx2.drawImage(img, 0, 0, img.width, img.height);
|
|
58738
|
-
const dpr = typeof window !== "undefined" && window.devicePixelRatio ? window.devicePixelRatio : 1;
|
|
58739
|
-
const targetPixelWidth = Math.round(logicalWidth * dpr);
|
|
58740
|
-
const targetPixelHeight = Math.round(logicalHeight * dpr);
|
|
58741
|
-
const finalTargetWidth = Math.min(targetPixelWidth, img.width);
|
|
58742
|
-
const finalTargetHeight = Math.min(targetPixelHeight, img.height);
|
|
58743
|
-
const resizeNeeded = finalTargetWidth !== img.width || finalTargetHeight !== img.height;
|
|
58744
|
-
if (resizeNeeded) {
|
|
58745
|
-
multiStepResize(canvas, finalTargetWidth, finalTargetHeight);
|
|
58746
|
-
}
|
|
58747
|
-
if (typeof fileData === "string") {
|
|
58748
|
-
const resizedBase64 = canvas.toDataURL();
|
|
58749
|
-
resolve(resizedBase64);
|
|
58750
|
-
} else {
|
|
58751
|
-
canvas.toBlob((blob) => {
|
|
58752
|
-
const updatedFile = new File([blob], fileData.name, {
|
|
58753
|
-
type: fileData.type,
|
|
58754
|
-
lastModified: Date.now()
|
|
58755
|
-
});
|
|
58756
|
-
resolve({ file: updatedFile, width: logicalWidth, height: logicalHeight });
|
|
58757
|
-
});
|
|
58758
|
-
}
|
|
58759
|
-
};
|
|
58760
|
-
img.onerror = (error) => reject(error);
|
|
58761
|
-
img.src = typeof fileData === "string" ? fileData : URL.createObjectURL(fileData);
|
|
58762
|
-
});
|
|
58763
|
-
};
|
|
58764
|
-
const getAllowedImageDimensions = (width, height, editor) => {
|
|
58765
|
-
const { width: maxWidth, height: maxHeight } = editor.getMaxContentSize();
|
|
58766
|
-
if (!maxWidth || !maxHeight) return { width, height };
|
|
58767
|
-
let adjustedWidth = width;
|
|
58768
|
-
let adjustedHeight = height;
|
|
58769
|
-
const aspectRatio = width / height;
|
|
58770
|
-
if (height > maxHeight) {
|
|
58771
|
-
adjustedHeight = maxHeight;
|
|
58772
|
-
adjustedWidth = Math.round(maxHeight * aspectRatio);
|
|
58773
|
-
}
|
|
58774
|
-
if (adjustedWidth > maxWidth) {
|
|
58775
|
-
adjustedWidth = maxWidth;
|
|
58776
|
-
adjustedHeight = Math.round(maxWidth / aspectRatio);
|
|
58777
|
-
}
|
|
58778
|
-
return { width: adjustedWidth, height: adjustedHeight };
|
|
58779
|
-
};
|
|
58780
|
-
function resample_high_quality(canvas, width, height, resize_canvas) {
|
|
58781
|
-
var width_source = canvas.width;
|
|
58782
|
-
var height_source = canvas.height;
|
|
58783
|
-
width = Math.round(width);
|
|
58784
|
-
height = Math.round(height);
|
|
58785
|
-
var ratio_w = width_source / width;
|
|
58786
|
-
var ratio_h = height_source / height;
|
|
58787
|
-
var ratio_w_half = Math.ceil(ratio_w / 2);
|
|
58788
|
-
var ratio_h_half = Math.ceil(ratio_h / 2);
|
|
58789
|
-
var ctx2 = canvas.getContext("2d");
|
|
58790
|
-
var img = ctx2.getImageData(0, 0, width_source, height_source);
|
|
58791
|
-
var img2 = ctx2.createImageData(width, height);
|
|
58792
|
-
var data = img.data;
|
|
58793
|
-
var data2 = img2.data;
|
|
58794
|
-
for (var j2 = 0; j2 < height; j2++) {
|
|
58795
|
-
for (var i = 0; i < width; i++) {
|
|
58796
|
-
var x2 = (i + j2 * width) * 4;
|
|
58797
|
-
var weight = 0;
|
|
58798
|
-
var weights = 0;
|
|
58799
|
-
var weights_alpha = 0;
|
|
58800
|
-
var gx_r = 0;
|
|
58801
|
-
var gx_g = 0;
|
|
58802
|
-
var gx_b = 0;
|
|
58803
|
-
var gx_a = 0;
|
|
58804
|
-
var center_y = (j2 + 0.5) * ratio_h;
|
|
58805
|
-
var yy_start = Math.floor(j2 * ratio_h);
|
|
58806
|
-
var yy_stop = Math.ceil((j2 + 1) * ratio_h);
|
|
58807
|
-
for (var yy = yy_start; yy < yy_stop; yy++) {
|
|
58808
|
-
var dy = Math.abs(center_y - (yy + 0.5)) / ratio_h_half;
|
|
58809
|
-
var center_x = (i + 0.5) * ratio_w;
|
|
58810
|
-
var w0 = dy * dy;
|
|
58811
|
-
var xx_start = Math.floor(i * ratio_w);
|
|
58812
|
-
var xx_stop = Math.ceil((i + 1) * ratio_w);
|
|
58813
|
-
for (var xx = xx_start; xx < xx_stop; xx++) {
|
|
58814
|
-
var dx = Math.abs(center_x - (xx + 0.5)) / ratio_w_half;
|
|
58815
|
-
var w2 = Math.sqrt(w0 + dx * dx);
|
|
58816
|
-
if (w2 >= 1) {
|
|
58817
|
-
continue;
|
|
58818
|
-
}
|
|
58819
|
-
weight = 2 * w2 * w2 * w2 - 3 * w2 * w2 + 1;
|
|
58820
|
-
var pos_x = 4 * (xx + yy * width_source);
|
|
58821
|
-
gx_a += weight * data[pos_x + 3];
|
|
58822
|
-
weights_alpha += weight;
|
|
58823
|
-
if (data[pos_x + 3] < 255) weight = weight * data[pos_x + 3] / 250;
|
|
58824
|
-
gx_r += weight * data[pos_x];
|
|
58825
|
-
gx_g += weight * data[pos_x + 1];
|
|
58826
|
-
gx_b += weight * data[pos_x + 2];
|
|
58827
|
-
weights += weight;
|
|
58828
|
-
}
|
|
58829
|
-
}
|
|
58830
|
-
data2[x2] = gx_r / weights;
|
|
58831
|
-
data2[x2 + 1] = gx_g / weights;
|
|
58832
|
-
data2[x2 + 2] = gx_b / weights;
|
|
58833
|
-
data2[x2 + 3] = gx_a / weights_alpha;
|
|
58834
|
-
}
|
|
58835
|
-
}
|
|
58836
|
-
{
|
|
58837
|
-
canvas.width = width;
|
|
58838
|
-
canvas.height = height;
|
|
58839
|
-
}
|
|
58840
|
-
ctx2.putImageData(img2, 0, 0);
|
|
58841
|
-
}
|
|
58842
|
-
function multiStepResize(canvas, targetWidth, targetHeight) {
|
|
58843
|
-
const originalWidth = canvas.width;
|
|
58844
|
-
const originalHeight = canvas.height;
|
|
58845
|
-
const scaleX = targetWidth / originalWidth;
|
|
58846
|
-
const scaleY = targetHeight / originalHeight;
|
|
58847
|
-
const scaleFactor = Math.min(scaleX, scaleY);
|
|
58848
|
-
if (scaleFactor < 0.5) {
|
|
58849
|
-
let currentWidth = originalWidth;
|
|
58850
|
-
let currentHeight = originalHeight;
|
|
58851
|
-
while (currentWidth > targetWidth * 2 || currentHeight > targetHeight * 2) {
|
|
58852
|
-
const nextWidth = Math.round(currentWidth / 2);
|
|
58853
|
-
const nextHeight = Math.round(currentHeight / 2);
|
|
58854
|
-
resample_high_quality(canvas, nextWidth, nextHeight);
|
|
58855
|
-
currentWidth = nextWidth;
|
|
58856
|
-
currentHeight = nextHeight;
|
|
58857
|
-
}
|
|
58858
|
-
if (currentWidth !== targetWidth || currentHeight !== targetHeight) {
|
|
58859
|
-
resample_high_quality(canvas, targetWidth, targetHeight);
|
|
58860
|
-
}
|
|
58861
|
-
} else {
|
|
58862
|
-
resample_high_quality(canvas, targetWidth, targetHeight);
|
|
58863
|
-
}
|
|
58864
|
-
}
|
|
58865
|
-
const startImageUpload = async ({ editor, view, file }) => {
|
|
58866
|
-
const imageUploadHandler = typeof editor.options.handleImageUpload === "function" ? editor.options.handleImageUpload : handleImageUpload;
|
|
58867
|
-
let fileSizeMb = Number((file.size / (1024 * 1024)).toFixed(4));
|
|
58868
|
-
if (fileSizeMb > 5) {
|
|
58869
|
-
window.alert("Image size must be less than 5MB");
|
|
58870
|
-
return;
|
|
58871
|
-
}
|
|
58872
|
-
let width;
|
|
58873
|
-
let height;
|
|
58874
|
-
try {
|
|
58875
|
-
const processedImageResult = await processUploadedImage(file, editor);
|
|
58876
|
-
width = processedImageResult.width;
|
|
58877
|
-
height = processedImageResult.height;
|
|
58878
|
-
file = processedImageResult.file;
|
|
58879
|
-
} catch (err) {
|
|
58880
|
-
console.warn("Error processing image:", err);
|
|
58881
|
-
editor.emit("exception", { error: err, editor });
|
|
58882
|
-
return;
|
|
58883
|
-
}
|
|
58884
|
-
await uploadImage({
|
|
58885
|
-
editor,
|
|
58886
|
-
view,
|
|
58887
|
-
file,
|
|
58888
|
-
size: { width, height },
|
|
58889
|
-
uploadHandler: imageUploadHandler
|
|
58890
|
-
});
|
|
58891
|
-
};
|
|
58892
|
-
async function uploadImage({ editor, view, file, size: size2, uploadHandler }) {
|
|
58893
|
-
let id = {};
|
|
58894
|
-
let { tr, schema } = view.state;
|
|
58895
|
-
let { selection } = tr;
|
|
58896
|
-
if (editor.options.isHeaderOrFooter) {
|
|
58897
|
-
selection = editor.options.lastSelection;
|
|
58898
|
-
}
|
|
58899
|
-
if (!selection.empty && !editor.options.isHeaderOrFooter) {
|
|
58900
|
-
tr.deleteSelection();
|
|
58901
|
-
}
|
|
58902
|
-
let imageMeta = {
|
|
58903
|
-
type: "add",
|
|
58904
|
-
pos: selection.from,
|
|
58905
|
-
id
|
|
58906
|
-
};
|
|
58907
|
-
tr.setMeta(ImagePlaceholderPluginKey, imageMeta);
|
|
58908
|
-
view.dispatch(tr);
|
|
58909
|
-
try {
|
|
58910
|
-
let url = await uploadHandler(file);
|
|
58911
|
-
let fileName = file.name.replace(" ", "_");
|
|
58912
|
-
let placeholderPos = findPlaceholder(view.state, id);
|
|
58913
|
-
if (placeholderPos == null) {
|
|
58914
|
-
return;
|
|
58915
|
-
}
|
|
58916
|
-
let removeMeta = { type: "remove", id };
|
|
58917
|
-
let mediaPath = `word/media/${fileName}`;
|
|
58918
|
-
let rId = null;
|
|
58919
|
-
if (editor.options.mode === "docx") {
|
|
58920
|
-
const [, path] = mediaPath.split("word/");
|
|
58921
|
-
const imageid = addImageRelationship({ editor, path });
|
|
58922
|
-
if (imageid) rId = imageid;
|
|
58923
|
-
}
|
|
58924
|
-
let imageNode = schema.nodes.image.create({
|
|
58925
|
-
src: mediaPath,
|
|
58926
|
-
size: size2,
|
|
58927
|
-
rId
|
|
58928
|
-
});
|
|
58929
|
-
editor.storage.image.media = Object.assign(editor.storage.image.media, { [mediaPath]: url });
|
|
58930
|
-
if (editor.options.ydoc) {
|
|
58931
|
-
editor.commands.addImageToCollaboration({ mediaPath, fileData: url });
|
|
58932
|
-
}
|
|
58933
|
-
view.dispatch(
|
|
58934
|
-
view.state.tr.replaceWith(placeholderPos, placeholderPos, imageNode).setMeta(ImagePlaceholderPluginKey, removeMeta)
|
|
58935
|
-
);
|
|
58936
|
-
} catch (error) {
|
|
58937
|
-
let removeMeta = { type: "remove", id };
|
|
58938
|
-
view.dispatch(tr.setMeta(ImagePlaceholderPluginKey, removeMeta));
|
|
58939
|
-
editor.emit("exception", { error, editor });
|
|
58940
|
-
}
|
|
58941
|
-
}
|
|
58942
|
-
function addImageRelationship({ editor, path }) {
|
|
58943
|
-
const target = path;
|
|
58944
|
-
const type2 = "image";
|
|
58945
|
-
try {
|
|
58946
|
-
const relationshipId = insertNewRelationship(target, type2, editor);
|
|
58947
|
-
return relationshipId;
|
|
58948
|
-
} catch {
|
|
58949
|
-
return null;
|
|
58950
|
-
}
|
|
58951
|
-
}
|
|
58952
59150
|
const BookmarkStart = Node$1.create({
|
|
58953
59151
|
name: "bookmarkStart",
|
|
58954
59152
|
group: "inline",
|
|
@@ -59263,8 +59461,8 @@ renderDom_fn = function(node, htmlAttributes) {
|
|
|
59263
59461
|
__privateMethod$1(this, _AutoPageNumberNodeView_instances, scheduleUpdateNodeStyle_fn).call(this, currentPos, marks);
|
|
59264
59462
|
Object.assign(nodeContent.style, styles);
|
|
59265
59463
|
nodeContent.appendChild(content);
|
|
59266
|
-
Object.entries(htmlAttributes).forEach(([
|
|
59267
|
-
if (value) nodeContent.setAttribute(
|
|
59464
|
+
Object.entries(htmlAttributes).forEach(([key2, value]) => {
|
|
59465
|
+
if (value) nodeContent.setAttribute(key2, value);
|
|
59268
59466
|
});
|
|
59269
59467
|
return nodeContent;
|
|
59270
59468
|
};
|
|
@@ -59330,8 +59528,8 @@ const processMarks = (marks) => {
|
|
|
59330
59528
|
break;
|
|
59331
59529
|
default:
|
|
59332
59530
|
if (attrs?.style) {
|
|
59333
|
-
Object.entries(attrs.style).forEach(([
|
|
59334
|
-
styles[
|
|
59531
|
+
Object.entries(attrs.style).forEach(([key2, value]) => {
|
|
59532
|
+
styles[key2] = value;
|
|
59335
59533
|
});
|
|
59336
59534
|
}
|
|
59337
59535
|
break;
|
|
@@ -61993,8 +62191,8 @@ function mergePaddingObject(paddingObject) {
|
|
|
61993
62191
|
return Object.assign({}, getFreshSideObject(), paddingObject);
|
|
61994
62192
|
}
|
|
61995
62193
|
function expandToHashMap(value, keys2) {
|
|
61996
|
-
return keys2.reduce(function(hashMap,
|
|
61997
|
-
hashMap[
|
|
62194
|
+
return keys2.reduce(function(hashMap, key2) {
|
|
62195
|
+
hashMap[key2] = value;
|
|
61998
62196
|
return hashMap;
|
|
61999
62197
|
}, {});
|
|
62000
62198
|
}
|
|
@@ -62450,10 +62648,10 @@ function detectOverflow$1(state2, options) {
|
|
|
62450
62648
|
var offsetData = state2.modifiersData.offset;
|
|
62451
62649
|
if (elementContext === popper && offsetData) {
|
|
62452
62650
|
var offset2 = offsetData[placement];
|
|
62453
|
-
Object.keys(overflowOffsets).forEach(function(
|
|
62454
|
-
var multiply = [right, bottom].indexOf(
|
|
62455
|
-
var axis = [top, bottom].indexOf(
|
|
62456
|
-
overflowOffsets[
|
|
62651
|
+
Object.keys(overflowOffsets).forEach(function(key2) {
|
|
62652
|
+
var multiply = [right, bottom].indexOf(key2) >= 0 ? 1 : -1;
|
|
62653
|
+
var axis = [top, bottom].indexOf(key2) >= 0 ? "y" : "x";
|
|
62654
|
+
overflowOffsets[key2] += offset2[axis] * multiply;
|
|
62457
62655
|
});
|
|
62458
62656
|
}
|
|
62459
62657
|
return overflowOffsets;
|
|
@@ -62900,8 +63098,8 @@ function mergeByName(modifiers2) {
|
|
|
62900
63098
|
}) : current;
|
|
62901
63099
|
return merged2;
|
|
62902
63100
|
}, {});
|
|
62903
|
-
return Object.keys(merged).map(function(
|
|
62904
|
-
return merged[
|
|
63101
|
+
return Object.keys(merged).map(function(key2) {
|
|
63102
|
+
return merged[key2];
|
|
62905
63103
|
});
|
|
62906
63104
|
}
|
|
62907
63105
|
var DEFAULT_OPTIONS = {
|
|
@@ -63058,8 +63256,8 @@ var TOUCH_OPTIONS = {
|
|
|
63058
63256
|
var TIPPY_DEFAULT_APPEND_TO = function TIPPY_DEFAULT_APPEND_TO2() {
|
|
63059
63257
|
return document.body;
|
|
63060
63258
|
};
|
|
63061
|
-
function hasOwnProperty$c(obj,
|
|
63062
|
-
return {}.hasOwnProperty.call(obj,
|
|
63259
|
+
function hasOwnProperty$c(obj, key2) {
|
|
63260
|
+
return {}.hasOwnProperty.call(obj, key2);
|
|
63063
63261
|
}
|
|
63064
63262
|
function getValueAtIndexOrReturn(value, index2, defaultValue) {
|
|
63065
63263
|
if (Array.isArray(value)) {
|
|
@@ -63089,8 +63287,8 @@ function debounce(fn2, ms) {
|
|
|
63089
63287
|
}
|
|
63090
63288
|
function removeProperties(obj, keys2) {
|
|
63091
63289
|
var clone = Object.assign({}, obj);
|
|
63092
|
-
keys2.forEach(function(
|
|
63093
|
-
delete clone[
|
|
63290
|
+
keys2.forEach(function(key2) {
|
|
63291
|
+
delete clone[key2];
|
|
63094
63292
|
});
|
|
63095
63293
|
return clone;
|
|
63096
63294
|
}
|
|
@@ -63117,9 +63315,9 @@ function arrayFrom(value) {
|
|
|
63117
63315
|
return [].slice.call(value);
|
|
63118
63316
|
}
|
|
63119
63317
|
function removeUndefinedProps(obj) {
|
|
63120
|
-
return Object.keys(obj).reduce(function(acc,
|
|
63121
|
-
if (obj[
|
|
63122
|
-
acc[
|
|
63318
|
+
return Object.keys(obj).reduce(function(acc, key2) {
|
|
63319
|
+
if (obj[key2] !== void 0) {
|
|
63320
|
+
acc[key2] = obj[key2];
|
|
63123
63321
|
}
|
|
63124
63322
|
return acc;
|
|
63125
63323
|
}, {});
|
|
@@ -63371,8 +63569,8 @@ var setDefaultProps = function setDefaultProps2(partialProps) {
|
|
|
63371
63569
|
validateProps(partialProps, []);
|
|
63372
63570
|
}
|
|
63373
63571
|
var keys2 = Object.keys(partialProps);
|
|
63374
|
-
keys2.forEach(function(
|
|
63375
|
-
defaultProps[
|
|
63572
|
+
keys2.forEach(function(key2) {
|
|
63573
|
+
defaultProps[key2] = partialProps[key2];
|
|
63376
63574
|
});
|
|
63377
63575
|
};
|
|
63378
63576
|
function getExtendedPassedProps(passedProps) {
|
|
@@ -63391,18 +63589,18 @@ function getDataAttributeProps(reference2, plugins) {
|
|
|
63391
63589
|
var propKeys = plugins ? Object.keys(getExtendedPassedProps(Object.assign({}, defaultProps, {
|
|
63392
63590
|
plugins
|
|
63393
63591
|
}))) : defaultKeys;
|
|
63394
|
-
var props = propKeys.reduce(function(acc,
|
|
63395
|
-
var valueAsString = (reference2.getAttribute("data-tippy-" +
|
|
63592
|
+
var props = propKeys.reduce(function(acc, key2) {
|
|
63593
|
+
var valueAsString = (reference2.getAttribute("data-tippy-" + key2) || "").trim();
|
|
63396
63594
|
if (!valueAsString) {
|
|
63397
63595
|
return acc;
|
|
63398
63596
|
}
|
|
63399
|
-
if (
|
|
63400
|
-
acc[
|
|
63597
|
+
if (key2 === "content") {
|
|
63598
|
+
acc[key2] = valueAsString;
|
|
63401
63599
|
} else {
|
|
63402
63600
|
try {
|
|
63403
|
-
acc[
|
|
63601
|
+
acc[key2] = JSON.parse(valueAsString);
|
|
63404
63602
|
} catch (e) {
|
|
63405
|
-
acc[
|
|
63603
|
+
acc[key2] = valueAsString;
|
|
63406
63604
|
}
|
|
63407
63605
|
}
|
|
63408
63606
|
return acc;
|
|
@@ -64326,8 +64524,8 @@ tippy.setDefaultProps({
|
|
|
64326
64524
|
});
|
|
64327
64525
|
const _export_sfc = (sfc, props) => {
|
|
64328
64526
|
const target = sfc.__vccOpts || sfc;
|
|
64329
|
-
for (const [
|
|
64330
|
-
target[
|
|
64527
|
+
for (const [key2, val] of props) {
|
|
64528
|
+
target[key2] = val;
|
|
64331
64529
|
}
|
|
64332
64530
|
return target;
|
|
64333
64531
|
};
|
|
@@ -65719,9 +65917,9 @@ const Pagination = Extension.create({
|
|
|
65719
65917
|
if (syncMeta && syncMeta.isChangeOrigin || listSyncMeta) {
|
|
65720
65918
|
return { ...oldState };
|
|
65721
65919
|
}
|
|
65722
|
-
const
|
|
65723
|
-
if (
|
|
65724
|
-
if (
|
|
65920
|
+
const imageRegistrationMetaType = getImageRegistrationMetaType(tr);
|
|
65921
|
+
if (imageRegistrationMetaType) {
|
|
65922
|
+
if (imageRegistrationMetaType === "remove") {
|
|
65725
65923
|
onImageLoad(editor);
|
|
65726
65924
|
}
|
|
65727
65925
|
return { ...oldState };
|
|
@@ -68553,8 +68751,8 @@ function ensureTrapHandlers(name, el, handler2) {
|
|
|
68553
68751
|
function trapOn(name, el, handler2, options) {
|
|
68554
68752
|
if (name === "mousemoveoutside" || name === "clickoutside") {
|
|
68555
68753
|
const trapHandlers = ensureTrapHandlers(name, el, handler2);
|
|
68556
|
-
Object.keys(trapHandlers).forEach((
|
|
68557
|
-
on(
|
|
68754
|
+
Object.keys(trapHandlers).forEach((key2) => {
|
|
68755
|
+
on(key2, document, trapHandlers[key2], options);
|
|
68558
68756
|
});
|
|
68559
68757
|
return true;
|
|
68560
68758
|
}
|
|
@@ -68563,8 +68761,8 @@ function trapOn(name, el, handler2, options) {
|
|
|
68563
68761
|
function trapOff(name, el, handler2, options) {
|
|
68564
68762
|
if (name === "mousemoveoutside" || name === "clickoutside") {
|
|
68565
68763
|
const trapHandlers = ensureTrapHandlers(name, el, handler2);
|
|
68566
|
-
Object.keys(trapHandlers).forEach((
|
|
68567
|
-
off(
|
|
68764
|
+
Object.keys(trapHandlers).forEach((key2) => {
|
|
68765
|
+
off(key2, document, trapHandlers[key2], options);
|
|
68568
68766
|
});
|
|
68569
68767
|
return true;
|
|
68570
68768
|
}
|
|
@@ -68902,9 +69100,9 @@ function isMounted() {
|
|
|
68902
69100
|
}
|
|
68903
69101
|
function useCompitable(reactive2, keys2) {
|
|
68904
69102
|
return vue.computed(() => {
|
|
68905
|
-
for (const
|
|
68906
|
-
if (reactive2[
|
|
68907
|
-
return reactive2[
|
|
69103
|
+
for (const key2 of keys2) {
|
|
69104
|
+
if (reactive2[key2] !== void 0)
|
|
69105
|
+
return reactive2[key2];
|
|
68908
69106
|
}
|
|
68909
69107
|
return reactive2[keys2[keys2.length - 1]];
|
|
68910
69108
|
});
|
|
@@ -68940,10 +69138,10 @@ function useKeyboard(options = {}, enabledRef) {
|
|
|
68940
69138
|
break;
|
|
68941
69139
|
}
|
|
68942
69140
|
if (keydown !== void 0) {
|
|
68943
|
-
Object.keys(keydown).forEach((
|
|
68944
|
-
if (
|
|
69141
|
+
Object.keys(keydown).forEach((key2) => {
|
|
69142
|
+
if (key2 !== e.key)
|
|
68945
69143
|
return;
|
|
68946
|
-
const handler2 = keydown[
|
|
69144
|
+
const handler2 = keydown[key2];
|
|
68947
69145
|
if (typeof handler2 === "function") {
|
|
68948
69146
|
handler2(e);
|
|
68949
69147
|
} else {
|
|
@@ -68974,10 +69172,10 @@ function useKeyboard(options = {}, enabledRef) {
|
|
|
68974
69172
|
break;
|
|
68975
69173
|
}
|
|
68976
69174
|
if (keyup !== void 0) {
|
|
68977
|
-
Object.keys(keyup).forEach((
|
|
68978
|
-
if (
|
|
69175
|
+
Object.keys(keyup).forEach((key2) => {
|
|
69176
|
+
if (key2 !== e.key)
|
|
68979
69177
|
return;
|
|
68980
|
-
const handler2 = keyup[
|
|
69178
|
+
const handler2 = keyup[key2];
|
|
68981
69179
|
if (typeof handler2 === "function") {
|
|
68982
69180
|
handler2(e);
|
|
68983
69181
|
} else {
|
|
@@ -69021,8 +69219,8 @@ function useKeyboard(options = {}, enabledRef) {
|
|
|
69021
69219
|
}
|
|
69022
69220
|
return vue.readonly(state2);
|
|
69023
69221
|
}
|
|
69024
|
-
function createInjectionKey(
|
|
69025
|
-
return
|
|
69222
|
+
function createInjectionKey(key2) {
|
|
69223
|
+
return key2;
|
|
69026
69224
|
}
|
|
69027
69225
|
const internalSelectionMenuBodyInjectionKey = createInjectionKey("n-internal-select-menu-body");
|
|
69028
69226
|
const drawerBodyInjectionKey = createInjectionKey("n-drawer-body");
|
|
@@ -71120,8 +71318,8 @@ function getFirstSlotVNode(slots, slotName = "default", props = void 0) {
|
|
|
71120
71318
|
}
|
|
71121
71319
|
function keep(object, keys2 = [], rest) {
|
|
71122
71320
|
const keepedObject = {};
|
|
71123
|
-
keys2.forEach((
|
|
71124
|
-
keepedObject[
|
|
71321
|
+
keys2.forEach((key2) => {
|
|
71322
|
+
keepedObject[key2] = object[key2];
|
|
71125
71323
|
});
|
|
71126
71324
|
return Object.assign(keepedObject, rest);
|
|
71127
71325
|
}
|
|
@@ -71216,8 +71414,8 @@ function useThemeClass(componentName, hashRef, cssVarsRef, props) {
|
|
|
71216
71414
|
renderCallback = () => {
|
|
71217
71415
|
const cssVars = cssVarsRef.value;
|
|
71218
71416
|
let style2 = "";
|
|
71219
|
-
for (const
|
|
71220
|
-
style2 += `${
|
|
71417
|
+
for (const key2 in cssVars) {
|
|
71418
|
+
style2 += `${key2}: ${cssVars[key2]};`;
|
|
71221
71419
|
}
|
|
71222
71420
|
c$1(`.${finalThemeHash}`, style2).mount({
|
|
71223
71421
|
id: finalThemeHash,
|
|
@@ -71357,11 +71555,11 @@ function baseIsNative(value) {
|
|
|
71357
71555
|
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
|
71358
71556
|
return pattern.test(toSource(value));
|
|
71359
71557
|
}
|
|
71360
|
-
function getValue(object,
|
|
71361
|
-
return object == null ? void 0 : object[
|
|
71558
|
+
function getValue(object, key2) {
|
|
71559
|
+
return object == null ? void 0 : object[key2];
|
|
71362
71560
|
}
|
|
71363
|
-
function getNative(object,
|
|
71364
|
-
var value = getValue(object,
|
|
71561
|
+
function getNative(object, key2) {
|
|
71562
|
+
var value = getValue(object, key2);
|
|
71365
71563
|
return baseIsNative(value) ? value : void 0;
|
|
71366
71564
|
}
|
|
71367
71565
|
var WeakMap$1 = getNative(root, "WeakMap");
|
|
@@ -71449,16 +71647,16 @@ function isIndex(value, length2) {
|
|
|
71449
71647
|
length2 = length2 == null ? MAX_SAFE_INTEGER$1 : length2;
|
|
71450
71648
|
return !!length2 && (type2 == "number" || type2 != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length2);
|
|
71451
71649
|
}
|
|
71452
|
-
function baseAssignValue(object,
|
|
71453
|
-
if (
|
|
71454
|
-
defineProperty(object,
|
|
71650
|
+
function baseAssignValue(object, key2, value) {
|
|
71651
|
+
if (key2 == "__proto__" && defineProperty) {
|
|
71652
|
+
defineProperty(object, key2, {
|
|
71455
71653
|
"configurable": true,
|
|
71456
71654
|
"enumerable": true,
|
|
71457
71655
|
"value": value,
|
|
71458
71656
|
"writable": true
|
|
71459
71657
|
});
|
|
71460
71658
|
} else {
|
|
71461
|
-
object[
|
|
71659
|
+
object[key2] = value;
|
|
71462
71660
|
}
|
|
71463
71661
|
}
|
|
71464
71662
|
function eq(value, other) {
|
|
@@ -71466,10 +71664,10 @@ function eq(value, other) {
|
|
|
71466
71664
|
}
|
|
71467
71665
|
var objectProto$b = Object.prototype;
|
|
71468
71666
|
var hasOwnProperty$9 = objectProto$b.hasOwnProperty;
|
|
71469
|
-
function assignValue(object,
|
|
71470
|
-
var objValue = object[
|
|
71471
|
-
if (!(hasOwnProperty$9.call(object,
|
|
71472
|
-
baseAssignValue(object,
|
|
71667
|
+
function assignValue(object, key2, value) {
|
|
71668
|
+
var objValue = object[key2];
|
|
71669
|
+
if (!(hasOwnProperty$9.call(object, key2) && eq(objValue, value)) || value === void 0 && !(key2 in object)) {
|
|
71670
|
+
baseAssignValue(object, key2, value);
|
|
71473
71671
|
}
|
|
71474
71672
|
}
|
|
71475
71673
|
function copyObject(source, props, object, customizer) {
|
|
@@ -71477,15 +71675,15 @@ function copyObject(source, props, object, customizer) {
|
|
|
71477
71675
|
object || (object = {});
|
|
71478
71676
|
var index2 = -1, length2 = props.length;
|
|
71479
71677
|
while (++index2 < length2) {
|
|
71480
|
-
var
|
|
71678
|
+
var key2 = props[index2];
|
|
71481
71679
|
var newValue = void 0;
|
|
71482
71680
|
if (newValue === void 0) {
|
|
71483
|
-
newValue = source[
|
|
71681
|
+
newValue = source[key2];
|
|
71484
71682
|
}
|
|
71485
71683
|
if (isNew) {
|
|
71486
|
-
baseAssignValue(object,
|
|
71684
|
+
baseAssignValue(object, key2, newValue);
|
|
71487
71685
|
} else {
|
|
71488
|
-
assignValue(object,
|
|
71686
|
+
assignValue(object, key2, newValue);
|
|
71489
71687
|
}
|
|
71490
71688
|
}
|
|
71491
71689
|
return object;
|
|
@@ -71611,13 +71809,13 @@ var objectProto$8 = Object.prototype;
|
|
|
71611
71809
|
var hasOwnProperty$7 = objectProto$8.hasOwnProperty;
|
|
71612
71810
|
function arrayLikeKeys(value, inherited) {
|
|
71613
71811
|
var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType2 = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType2, result = skipIndexes ? baseTimes(value.length, String) : [], length2 = result.length;
|
|
71614
|
-
for (var
|
|
71615
|
-
if ((inherited || hasOwnProperty$7.call(value,
|
|
71616
|
-
(
|
|
71617
|
-
isBuff && (
|
|
71618
|
-
isType2 && (
|
|
71619
|
-
isIndex(
|
|
71620
|
-
result.push(
|
|
71812
|
+
for (var key2 in value) {
|
|
71813
|
+
if ((inherited || hasOwnProperty$7.call(value, key2)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
71814
|
+
(key2 == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
71815
|
+
isBuff && (key2 == "offset" || key2 == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
71816
|
+
isType2 && (key2 == "buffer" || key2 == "byteLength" || key2 == "byteOffset") || // Skip index properties.
|
|
71817
|
+
isIndex(key2, length2)))) {
|
|
71818
|
+
result.push(key2);
|
|
71621
71819
|
}
|
|
71622
71820
|
}
|
|
71623
71821
|
return result;
|
|
@@ -71635,9 +71833,9 @@ function baseKeys(object) {
|
|
|
71635
71833
|
return nativeKeys(object);
|
|
71636
71834
|
}
|
|
71637
71835
|
var result = [];
|
|
71638
|
-
for (var
|
|
71639
|
-
if (hasOwnProperty$6.call(object,
|
|
71640
|
-
result.push(
|
|
71836
|
+
for (var key2 in Object(object)) {
|
|
71837
|
+
if (hasOwnProperty$6.call(object, key2) && key2 != "constructor") {
|
|
71838
|
+
result.push(key2);
|
|
71641
71839
|
}
|
|
71642
71840
|
}
|
|
71643
71841
|
return result;
|
|
@@ -71648,8 +71846,8 @@ function keys(object) {
|
|
|
71648
71846
|
function nativeKeysIn(object) {
|
|
71649
71847
|
var result = [];
|
|
71650
71848
|
if (object != null) {
|
|
71651
|
-
for (var
|
|
71652
|
-
result.push(
|
|
71849
|
+
for (var key2 in Object(object)) {
|
|
71850
|
+
result.push(key2);
|
|
71653
71851
|
}
|
|
71654
71852
|
}
|
|
71655
71853
|
return result;
|
|
@@ -71661,9 +71859,9 @@ function baseKeysIn(object) {
|
|
|
71661
71859
|
return nativeKeysIn(object);
|
|
71662
71860
|
}
|
|
71663
71861
|
var isProto = isPrototype(object), result = [];
|
|
71664
|
-
for (var
|
|
71665
|
-
if (!(
|
|
71666
|
-
result.push(
|
|
71862
|
+
for (var key2 in object) {
|
|
71863
|
+
if (!(key2 == "constructor" && (isProto || !hasOwnProperty$5.call(object, key2)))) {
|
|
71864
|
+
result.push(key2);
|
|
71667
71865
|
}
|
|
71668
71866
|
}
|
|
71669
71867
|
return result;
|
|
@@ -71687,33 +71885,33 @@ function hashClear() {
|
|
|
71687
71885
|
this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
|
71688
71886
|
this.size = 0;
|
|
71689
71887
|
}
|
|
71690
|
-
function hashDelete(
|
|
71691
|
-
var result = this.has(
|
|
71888
|
+
function hashDelete(key2) {
|
|
71889
|
+
var result = this.has(key2) && delete this.__data__[key2];
|
|
71692
71890
|
this.size -= result ? 1 : 0;
|
|
71693
71891
|
return result;
|
|
71694
71892
|
}
|
|
71695
71893
|
var HASH_UNDEFINED$2 = "__lodash_hash_undefined__";
|
|
71696
71894
|
var objectProto$5 = Object.prototype;
|
|
71697
71895
|
var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
|
|
71698
|
-
function hashGet(
|
|
71896
|
+
function hashGet(key2) {
|
|
71699
71897
|
var data = this.__data__;
|
|
71700
71898
|
if (nativeCreate) {
|
|
71701
|
-
var result = data[
|
|
71899
|
+
var result = data[key2];
|
|
71702
71900
|
return result === HASH_UNDEFINED$2 ? void 0 : result;
|
|
71703
71901
|
}
|
|
71704
|
-
return hasOwnProperty$4.call(data,
|
|
71902
|
+
return hasOwnProperty$4.call(data, key2) ? data[key2] : void 0;
|
|
71705
71903
|
}
|
|
71706
71904
|
var objectProto$4 = Object.prototype;
|
|
71707
71905
|
var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
|
|
71708
|
-
function hashHas(
|
|
71906
|
+
function hashHas(key2) {
|
|
71709
71907
|
var data = this.__data__;
|
|
71710
|
-
return nativeCreate ? data[
|
|
71908
|
+
return nativeCreate ? data[key2] !== void 0 : hasOwnProperty$3.call(data, key2);
|
|
71711
71909
|
}
|
|
71712
71910
|
var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
|
|
71713
|
-
function hashSet(
|
|
71911
|
+
function hashSet(key2, value) {
|
|
71714
71912
|
var data = this.__data__;
|
|
71715
|
-
this.size += this.has(
|
|
71716
|
-
data[
|
|
71913
|
+
this.size += this.has(key2) ? 0 : 1;
|
|
71914
|
+
data[key2] = nativeCreate && value === void 0 ? HASH_UNDEFINED$1 : value;
|
|
71717
71915
|
return this;
|
|
71718
71916
|
}
|
|
71719
71917
|
function Hash(entries) {
|
|
@@ -71733,10 +71931,10 @@ function listCacheClear() {
|
|
|
71733
71931
|
this.__data__ = [];
|
|
71734
71932
|
this.size = 0;
|
|
71735
71933
|
}
|
|
71736
|
-
function assocIndexOf(array,
|
|
71934
|
+
function assocIndexOf(array, key2) {
|
|
71737
71935
|
var length2 = array.length;
|
|
71738
71936
|
while (length2--) {
|
|
71739
|
-
if (eq(array[length2][0],
|
|
71937
|
+
if (eq(array[length2][0], key2)) {
|
|
71740
71938
|
return length2;
|
|
71741
71939
|
}
|
|
71742
71940
|
}
|
|
@@ -71744,8 +71942,8 @@ function assocIndexOf(array, key) {
|
|
|
71744
71942
|
}
|
|
71745
71943
|
var arrayProto = Array.prototype;
|
|
71746
71944
|
var splice = arrayProto.splice;
|
|
71747
|
-
function listCacheDelete(
|
|
71748
|
-
var data = this.__data__, index2 = assocIndexOf(data,
|
|
71945
|
+
function listCacheDelete(key2) {
|
|
71946
|
+
var data = this.__data__, index2 = assocIndexOf(data, key2);
|
|
71749
71947
|
if (index2 < 0) {
|
|
71750
71948
|
return false;
|
|
71751
71949
|
}
|
|
@@ -71758,18 +71956,18 @@ function listCacheDelete(key) {
|
|
|
71758
71956
|
--this.size;
|
|
71759
71957
|
return true;
|
|
71760
71958
|
}
|
|
71761
|
-
function listCacheGet(
|
|
71762
|
-
var data = this.__data__, index2 = assocIndexOf(data,
|
|
71959
|
+
function listCacheGet(key2) {
|
|
71960
|
+
var data = this.__data__, index2 = assocIndexOf(data, key2);
|
|
71763
71961
|
return index2 < 0 ? void 0 : data[index2][1];
|
|
71764
71962
|
}
|
|
71765
|
-
function listCacheHas(
|
|
71766
|
-
return assocIndexOf(this.__data__,
|
|
71963
|
+
function listCacheHas(key2) {
|
|
71964
|
+
return assocIndexOf(this.__data__, key2) > -1;
|
|
71767
71965
|
}
|
|
71768
|
-
function listCacheSet(
|
|
71769
|
-
var data = this.__data__, index2 = assocIndexOf(data,
|
|
71966
|
+
function listCacheSet(key2, value) {
|
|
71967
|
+
var data = this.__data__, index2 = assocIndexOf(data, key2);
|
|
71770
71968
|
if (index2 < 0) {
|
|
71771
71969
|
++this.size;
|
|
71772
|
-
data.push([
|
|
71970
|
+
data.push([key2, value]);
|
|
71773
71971
|
} else {
|
|
71774
71972
|
data[index2][1] = value;
|
|
71775
71973
|
}
|
|
@@ -71801,24 +71999,24 @@ function isKeyable(value) {
|
|
|
71801
71999
|
var type2 = typeof value;
|
|
71802
72000
|
return type2 == "string" || type2 == "number" || type2 == "symbol" || type2 == "boolean" ? value !== "__proto__" : value === null;
|
|
71803
72001
|
}
|
|
71804
|
-
function getMapData(map22,
|
|
72002
|
+
function getMapData(map22, key2) {
|
|
71805
72003
|
var data = map22.__data__;
|
|
71806
|
-
return isKeyable(
|
|
72004
|
+
return isKeyable(key2) ? data[typeof key2 == "string" ? "string" : "hash"] : data.map;
|
|
71807
72005
|
}
|
|
71808
|
-
function mapCacheDelete(
|
|
71809
|
-
var result = getMapData(this,
|
|
72006
|
+
function mapCacheDelete(key2) {
|
|
72007
|
+
var result = getMapData(this, key2)["delete"](key2);
|
|
71810
72008
|
this.size -= result ? 1 : 0;
|
|
71811
72009
|
return result;
|
|
71812
72010
|
}
|
|
71813
|
-
function mapCacheGet(
|
|
71814
|
-
return getMapData(this,
|
|
72011
|
+
function mapCacheGet(key2) {
|
|
72012
|
+
return getMapData(this, key2).get(key2);
|
|
71815
72013
|
}
|
|
71816
|
-
function mapCacheHas(
|
|
71817
|
-
return getMapData(this,
|
|
72014
|
+
function mapCacheHas(key2) {
|
|
72015
|
+
return getMapData(this, key2).has(key2);
|
|
71818
72016
|
}
|
|
71819
|
-
function mapCacheSet(
|
|
71820
|
-
var data = getMapData(this,
|
|
71821
|
-
data.set(
|
|
72017
|
+
function mapCacheSet(key2, value) {
|
|
72018
|
+
var data = getMapData(this, key2), size2 = data.size;
|
|
72019
|
+
data.set(key2, value);
|
|
71822
72020
|
this.size += data.size == size2 ? 0 : 1;
|
|
71823
72021
|
return this;
|
|
71824
72022
|
}
|
|
@@ -71841,12 +72039,12 @@ function memoize(func, resolver) {
|
|
|
71841
72039
|
throw new TypeError(FUNC_ERROR_TEXT);
|
|
71842
72040
|
}
|
|
71843
72041
|
var memoized = function() {
|
|
71844
|
-
var args = arguments,
|
|
71845
|
-
if (cache2.has(
|
|
71846
|
-
return cache2.get(
|
|
72042
|
+
var args = arguments, key2 = resolver ? resolver.apply(this, args) : args[0], cache2 = memoized.cache;
|
|
72043
|
+
if (cache2.has(key2)) {
|
|
72044
|
+
return cache2.get(key2);
|
|
71847
72045
|
}
|
|
71848
72046
|
var result = func.apply(this, args);
|
|
71849
|
-
memoized.cache = cache2.set(
|
|
72047
|
+
memoized.cache = cache2.set(key2, result) || cache2;
|
|
71850
72048
|
return result;
|
|
71851
72049
|
};
|
|
71852
72050
|
memoized.cache = new (memoize.Cache || MapCache)();
|
|
@@ -71855,11 +72053,11 @@ function memoize(func, resolver) {
|
|
|
71855
72053
|
memoize.Cache = MapCache;
|
|
71856
72054
|
var MAX_MEMOIZE_SIZE = 500;
|
|
71857
72055
|
function memoizeCapped(func) {
|
|
71858
|
-
var result = memoize(func, function(
|
|
72056
|
+
var result = memoize(func, function(key2) {
|
|
71859
72057
|
if (cache2.size === MAX_MEMOIZE_SIZE) {
|
|
71860
72058
|
cache2.clear();
|
|
71861
72059
|
}
|
|
71862
|
-
return
|
|
72060
|
+
return key2;
|
|
71863
72061
|
});
|
|
71864
72062
|
var cache2 = result.cache;
|
|
71865
72063
|
return result;
|
|
@@ -71932,30 +72130,30 @@ function stackClear() {
|
|
|
71932
72130
|
this.__data__ = new ListCache();
|
|
71933
72131
|
this.size = 0;
|
|
71934
72132
|
}
|
|
71935
|
-
function stackDelete(
|
|
71936
|
-
var data = this.__data__, result = data["delete"](
|
|
72133
|
+
function stackDelete(key2) {
|
|
72134
|
+
var data = this.__data__, result = data["delete"](key2);
|
|
71937
72135
|
this.size = data.size;
|
|
71938
72136
|
return result;
|
|
71939
72137
|
}
|
|
71940
|
-
function stackGet(
|
|
71941
|
-
return this.__data__.get(
|
|
72138
|
+
function stackGet(key2) {
|
|
72139
|
+
return this.__data__.get(key2);
|
|
71942
72140
|
}
|
|
71943
|
-
function stackHas(
|
|
71944
|
-
return this.__data__.has(
|
|
72141
|
+
function stackHas(key2) {
|
|
72142
|
+
return this.__data__.has(key2);
|
|
71945
72143
|
}
|
|
71946
72144
|
var LARGE_ARRAY_SIZE = 200;
|
|
71947
|
-
function stackSet(
|
|
72145
|
+
function stackSet(key2, value) {
|
|
71948
72146
|
var data = this.__data__;
|
|
71949
72147
|
if (data instanceof ListCache) {
|
|
71950
72148
|
var pairs = data.__data__;
|
|
71951
72149
|
if (!Map$1 || pairs.length < LARGE_ARRAY_SIZE - 1) {
|
|
71952
|
-
pairs.push([
|
|
72150
|
+
pairs.push([key2, value]);
|
|
71953
72151
|
this.size = ++data.size;
|
|
71954
72152
|
return this;
|
|
71955
72153
|
}
|
|
71956
72154
|
data = this.__data__ = new MapCache(pairs);
|
|
71957
72155
|
}
|
|
71958
|
-
data.set(
|
|
72156
|
+
data.set(key2, value);
|
|
71959
72157
|
this.size = data.size;
|
|
71960
72158
|
return this;
|
|
71961
72159
|
}
|
|
@@ -72076,8 +72274,8 @@ function arraySome(array, predicate) {
|
|
|
72076
72274
|
}
|
|
72077
72275
|
return false;
|
|
72078
72276
|
}
|
|
72079
|
-
function cacheHas(cache2,
|
|
72080
|
-
return cache2.has(
|
|
72277
|
+
function cacheHas(cache2, key2) {
|
|
72278
|
+
return cache2.has(key2);
|
|
72081
72279
|
}
|
|
72082
72280
|
var COMPARE_PARTIAL_FLAG$5 = 1, COMPARE_UNORDERED_FLAG$3 = 2;
|
|
72083
72281
|
function equalArrays(array, other, bitmask, customizer, equalFunc, stack2) {
|
|
@@ -72125,8 +72323,8 @@ function equalArrays(array, other, bitmask, customizer, equalFunc, stack2) {
|
|
|
72125
72323
|
}
|
|
72126
72324
|
function mapToArray(map22) {
|
|
72127
72325
|
var index2 = -1, result = Array(map22.size);
|
|
72128
|
-
map22.forEach(function(value,
|
|
72129
|
-
result[++index2] = [
|
|
72326
|
+
map22.forEach(function(value, key2) {
|
|
72327
|
+
result[++index2] = [key2, value];
|
|
72130
72328
|
});
|
|
72131
72329
|
return result;
|
|
72132
72330
|
}
|
|
@@ -72197,8 +72395,8 @@ function equalObjects(object, other, bitmask, customizer, equalFunc, stack2) {
|
|
|
72197
72395
|
}
|
|
72198
72396
|
var index2 = objLength;
|
|
72199
72397
|
while (index2--) {
|
|
72200
|
-
var
|
|
72201
|
-
if (!(isPartial ?
|
|
72398
|
+
var key2 = objProps[index2];
|
|
72399
|
+
if (!(isPartial ? key2 in other : hasOwnProperty$1.call(other, key2))) {
|
|
72202
72400
|
return false;
|
|
72203
72401
|
}
|
|
72204
72402
|
}
|
|
@@ -72212,16 +72410,16 @@ function equalObjects(object, other, bitmask, customizer, equalFunc, stack2) {
|
|
|
72212
72410
|
stack2.set(other, object);
|
|
72213
72411
|
var skipCtor = isPartial;
|
|
72214
72412
|
while (++index2 < objLength) {
|
|
72215
|
-
|
|
72216
|
-
var objValue = object[
|
|
72413
|
+
key2 = objProps[index2];
|
|
72414
|
+
var objValue = object[key2], othValue = other[key2];
|
|
72217
72415
|
if (customizer) {
|
|
72218
|
-
var compared = isPartial ? customizer(othValue, objValue,
|
|
72416
|
+
var compared = isPartial ? customizer(othValue, objValue, key2, other, object, stack2) : customizer(objValue, othValue, key2, object, other, stack2);
|
|
72219
72417
|
}
|
|
72220
72418
|
if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack2) : compared)) {
|
|
72221
72419
|
result = false;
|
|
72222
72420
|
break;
|
|
72223
72421
|
}
|
|
72224
|
-
skipCtor || (skipCtor =
|
|
72422
|
+
skipCtor || (skipCtor = key2 == "constructor");
|
|
72225
72423
|
}
|
|
72226
72424
|
if (result && !skipCtor) {
|
|
72227
72425
|
var objCtor = object.constructor, othCtor = other.constructor;
|
|
@@ -72291,9 +72489,9 @@ function baseIsMatch(object, source, matchData, customizer) {
|
|
|
72291
72489
|
}
|
|
72292
72490
|
while (++index2 < length2) {
|
|
72293
72491
|
data = matchData[index2];
|
|
72294
|
-
var
|
|
72492
|
+
var key2 = data[0], objValue = object[key2], srcValue = data[1];
|
|
72295
72493
|
if (data[2]) {
|
|
72296
|
-
if (objValue === void 0 && !(
|
|
72494
|
+
if (objValue === void 0 && !(key2 in object)) {
|
|
72297
72495
|
return false;
|
|
72298
72496
|
}
|
|
72299
72497
|
} else {
|
|
@@ -72312,17 +72510,17 @@ function isStrictComparable(value) {
|
|
|
72312
72510
|
function getMatchData(object) {
|
|
72313
72511
|
var result = keys(object), length2 = result.length;
|
|
72314
72512
|
while (length2--) {
|
|
72315
|
-
var
|
|
72316
|
-
result[length2] = [
|
|
72513
|
+
var key2 = result[length2], value = object[key2];
|
|
72514
|
+
result[length2] = [key2, value, isStrictComparable(value)];
|
|
72317
72515
|
}
|
|
72318
72516
|
return result;
|
|
72319
72517
|
}
|
|
72320
|
-
function matchesStrictComparable(
|
|
72518
|
+
function matchesStrictComparable(key2, srcValue) {
|
|
72321
72519
|
return function(object) {
|
|
72322
72520
|
if (object == null) {
|
|
72323
72521
|
return false;
|
|
72324
72522
|
}
|
|
72325
|
-
return object[
|
|
72523
|
+
return object[key2] === srcValue && (srcValue !== void 0 || key2 in Object(object));
|
|
72326
72524
|
};
|
|
72327
72525
|
}
|
|
72328
72526
|
function baseMatches(source) {
|
|
@@ -72334,24 +72532,24 @@ function baseMatches(source) {
|
|
|
72334
72532
|
return object === source || baseIsMatch(object, source, matchData);
|
|
72335
72533
|
};
|
|
72336
72534
|
}
|
|
72337
|
-
function baseHasIn(object,
|
|
72338
|
-
return object != null &&
|
|
72535
|
+
function baseHasIn(object, key2) {
|
|
72536
|
+
return object != null && key2 in Object(object);
|
|
72339
72537
|
}
|
|
72340
72538
|
function hasPath(object, path, hasFunc) {
|
|
72341
72539
|
path = castPath(path, object);
|
|
72342
72540
|
var index2 = -1, length2 = path.length, result = false;
|
|
72343
72541
|
while (++index2 < length2) {
|
|
72344
|
-
var
|
|
72345
|
-
if (!(result = object != null && hasFunc(object,
|
|
72542
|
+
var key2 = toKey(path[index2]);
|
|
72543
|
+
if (!(result = object != null && hasFunc(object, key2))) {
|
|
72346
72544
|
break;
|
|
72347
72545
|
}
|
|
72348
|
-
object = object[
|
|
72546
|
+
object = object[key2];
|
|
72349
72547
|
}
|
|
72350
72548
|
if (result || ++index2 != length2) {
|
|
72351
72549
|
return result;
|
|
72352
72550
|
}
|
|
72353
72551
|
length2 = object == null ? 0 : object.length;
|
|
72354
|
-
return !!length2 && isLength(length2) && isIndex(
|
|
72552
|
+
return !!length2 && isLength(length2) && isIndex(key2, length2) && (isArray(object) || isArguments(object));
|
|
72355
72553
|
}
|
|
72356
72554
|
function hasIn(object, path) {
|
|
72357
72555
|
return object != null && hasPath(object, path, baseHasIn);
|
|
@@ -72366,9 +72564,9 @@ function baseMatchesProperty(path, srcValue) {
|
|
|
72366
72564
|
return objValue === void 0 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
|
|
72367
72565
|
};
|
|
72368
72566
|
}
|
|
72369
|
-
function baseProperty(
|
|
72567
|
+
function baseProperty(key2) {
|
|
72370
72568
|
return function(object) {
|
|
72371
|
-
return object == null ? void 0 : object[
|
|
72569
|
+
return object == null ? void 0 : object[key2];
|
|
72372
72570
|
};
|
|
72373
72571
|
}
|
|
72374
72572
|
function basePropertyDeep(path) {
|
|
@@ -72395,8 +72593,8 @@ function createBaseFor(fromRight) {
|
|
|
72395
72593
|
return function(object, iteratee, keysFunc) {
|
|
72396
72594
|
var index2 = -1, iterable = Object(object), props = keysFunc(object), length2 = props.length;
|
|
72397
72595
|
while (length2--) {
|
|
72398
|
-
var
|
|
72399
|
-
if (iteratee(iterable[
|
|
72596
|
+
var key2 = props[++index2];
|
|
72597
|
+
if (iteratee(iterable[key2], key2, iterable) === false) {
|
|
72400
72598
|
break;
|
|
72401
72599
|
}
|
|
72402
72600
|
}
|
|
@@ -72425,33 +72623,33 @@ function createBaseEach(eachFunc, fromRight) {
|
|
|
72425
72623
|
};
|
|
72426
72624
|
}
|
|
72427
72625
|
var baseEach = createBaseEach(baseForOwn);
|
|
72428
|
-
function assignMergeValue(object,
|
|
72429
|
-
if (value !== void 0 && !eq(object[
|
|
72430
|
-
baseAssignValue(object,
|
|
72626
|
+
function assignMergeValue(object, key2, value) {
|
|
72627
|
+
if (value !== void 0 && !eq(object[key2], value) || value === void 0 && !(key2 in object)) {
|
|
72628
|
+
baseAssignValue(object, key2, value);
|
|
72431
72629
|
}
|
|
72432
72630
|
}
|
|
72433
72631
|
function isArrayLikeObject(value) {
|
|
72434
72632
|
return isObjectLike(value) && isArrayLike(value);
|
|
72435
72633
|
}
|
|
72436
|
-
function safeGet(object,
|
|
72437
|
-
if (
|
|
72634
|
+
function safeGet(object, key2) {
|
|
72635
|
+
if (key2 === "constructor" && typeof object[key2] === "function") {
|
|
72438
72636
|
return;
|
|
72439
72637
|
}
|
|
72440
|
-
if (
|
|
72638
|
+
if (key2 == "__proto__") {
|
|
72441
72639
|
return;
|
|
72442
72640
|
}
|
|
72443
|
-
return object[
|
|
72641
|
+
return object[key2];
|
|
72444
72642
|
}
|
|
72445
72643
|
function toPlainObject(value) {
|
|
72446
72644
|
return copyObject(value, keysIn(value));
|
|
72447
72645
|
}
|
|
72448
|
-
function baseMergeDeep(object, source,
|
|
72449
|
-
var objValue = safeGet(object,
|
|
72646
|
+
function baseMergeDeep(object, source, key2, srcIndex, mergeFunc, customizer, stack2) {
|
|
72647
|
+
var objValue = safeGet(object, key2), srcValue = safeGet(source, key2), stacked = stack2.get(srcValue);
|
|
72450
72648
|
if (stacked) {
|
|
72451
|
-
assignMergeValue(object,
|
|
72649
|
+
assignMergeValue(object, key2, stacked);
|
|
72452
72650
|
return;
|
|
72453
72651
|
}
|
|
72454
|
-
var newValue = customizer ? customizer(objValue, srcValue,
|
|
72652
|
+
var newValue = customizer ? customizer(objValue, srcValue, key2 + "", object, source, stack2) : void 0;
|
|
72455
72653
|
var isCommon = newValue === void 0;
|
|
72456
72654
|
if (isCommon) {
|
|
72457
72655
|
var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
|
|
@@ -72486,29 +72684,29 @@ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, sta
|
|
|
72486
72684
|
mergeFunc(newValue, srcValue, srcIndex, customizer, stack2);
|
|
72487
72685
|
stack2["delete"](srcValue);
|
|
72488
72686
|
}
|
|
72489
|
-
assignMergeValue(object,
|
|
72687
|
+
assignMergeValue(object, key2, newValue);
|
|
72490
72688
|
}
|
|
72491
72689
|
function baseMerge(object, source, srcIndex, customizer, stack2) {
|
|
72492
72690
|
if (object === source) {
|
|
72493
72691
|
return;
|
|
72494
72692
|
}
|
|
72495
|
-
baseFor(source, function(srcValue,
|
|
72693
|
+
baseFor(source, function(srcValue, key2) {
|
|
72496
72694
|
stack2 || (stack2 = new Stack());
|
|
72497
72695
|
if (isObject(srcValue)) {
|
|
72498
|
-
baseMergeDeep(object, source,
|
|
72696
|
+
baseMergeDeep(object, source, key2, srcIndex, baseMerge, customizer, stack2);
|
|
72499
72697
|
} else {
|
|
72500
|
-
var newValue = customizer ? customizer(safeGet(object,
|
|
72698
|
+
var newValue = customizer ? customizer(safeGet(object, key2), srcValue, key2 + "", object, source, stack2) : void 0;
|
|
72501
72699
|
if (newValue === void 0) {
|
|
72502
72700
|
newValue = srcValue;
|
|
72503
72701
|
}
|
|
72504
|
-
assignMergeValue(object,
|
|
72702
|
+
assignMergeValue(object, key2, newValue);
|
|
72505
72703
|
}
|
|
72506
72704
|
}, keysIn);
|
|
72507
72705
|
}
|
|
72508
72706
|
function baseMap(collection, iteratee) {
|
|
72509
72707
|
var index2 = -1, result = isArrayLike(collection) ? Array(collection.length) : [];
|
|
72510
|
-
baseEach(collection, function(value,
|
|
72511
|
-
result[++index2] = iteratee(value,
|
|
72708
|
+
baseEach(collection, function(value, key2, collection2) {
|
|
72709
|
+
result[++index2] = iteratee(value, key2, collection2);
|
|
72512
72710
|
});
|
|
72513
72711
|
return result;
|
|
72514
72712
|
}
|
|
@@ -73846,18 +74044,18 @@ function unwrapIndeterminateKeys(result) {
|
|
|
73846
74044
|
}
|
|
73847
74045
|
function merge(originalKeys, keysToAdd) {
|
|
73848
74046
|
const set = new Set(originalKeys);
|
|
73849
|
-
keysToAdd.forEach((
|
|
73850
|
-
if (!set.has(
|
|
73851
|
-
set.add(
|
|
74047
|
+
keysToAdd.forEach((key2) => {
|
|
74048
|
+
if (!set.has(key2)) {
|
|
74049
|
+
set.add(key2);
|
|
73852
74050
|
}
|
|
73853
74051
|
});
|
|
73854
74052
|
return Array.from(set);
|
|
73855
74053
|
}
|
|
73856
74054
|
function minus(originalKeys, keysToRemove) {
|
|
73857
74055
|
const set = new Set(originalKeys);
|
|
73858
|
-
keysToRemove.forEach((
|
|
73859
|
-
if (set.has(
|
|
73860
|
-
set.delete(
|
|
74056
|
+
keysToRemove.forEach((key2) => {
|
|
74057
|
+
if (set.has(key2)) {
|
|
74058
|
+
set.delete(key2);
|
|
73861
74059
|
}
|
|
73862
74060
|
});
|
|
73863
74061
|
return Array.from(set);
|
|
@@ -73899,12 +74097,12 @@ function getExtendedCheckedKeySetAfterUncheck(uncheckedKeys, currentCheckedKeys,
|
|
|
73899
74097
|
const extendedKeySetToUncheck = getExtendedCheckedKeySet(uncheckedKeys, treeMate, allowNotLoaded, true);
|
|
73900
74098
|
const ascendantKeySet = getAvailableAscendantNodeSet(uncheckedKeys, treeMate);
|
|
73901
74099
|
const keysToRemove = [];
|
|
73902
|
-
extendedCheckedKeySet.forEach((
|
|
73903
|
-
if (extendedKeySetToUncheck.has(
|
|
73904
|
-
keysToRemove.push(
|
|
74100
|
+
extendedCheckedKeySet.forEach((key2) => {
|
|
74101
|
+
if (extendedKeySetToUncheck.has(key2) || ascendantKeySet.has(key2)) {
|
|
74102
|
+
keysToRemove.push(key2);
|
|
73905
74103
|
}
|
|
73906
74104
|
});
|
|
73907
|
-
keysToRemove.forEach((
|
|
74105
|
+
keysToRemove.forEach((key2) => extendedCheckedKeySet.delete(key2));
|
|
73908
74106
|
return extendedCheckedKeySet;
|
|
73909
74107
|
}
|
|
73910
74108
|
function getCheckedKeys(options, treeMate) {
|
|
@@ -74013,11 +74211,11 @@ function getExtendedCheckedKeySet(checkedKeys, treeMate, allowNotLoaded, isUnche
|
|
|
74013
74211
|
if (treeNode.disabled) {
|
|
74014
74212
|
return TRAVERSE_COMMAND.STOP;
|
|
74015
74213
|
}
|
|
74016
|
-
const { key } = treeNode;
|
|
74017
|
-
if (visitedKeySet.has(
|
|
74214
|
+
const { key: key2 } = treeNode;
|
|
74215
|
+
if (visitedKeySet.has(key2))
|
|
74018
74216
|
return;
|
|
74019
|
-
visitedKeySet.add(
|
|
74020
|
-
extendedKeySet.add(
|
|
74217
|
+
visitedKeySet.add(key2);
|
|
74218
|
+
extendedKeySet.add(key2);
|
|
74021
74219
|
if (isExpilicitlyNotLoaded(treeNode.rawNode, getChildren2)) {
|
|
74022
74220
|
if (isUnchecking) {
|
|
74023
74221
|
return TRAVERSE_COMMAND.STOP;
|
|
@@ -74030,10 +74228,10 @@ function getExtendedCheckedKeySet(checkedKeys, treeMate, allowNotLoaded, isUnche
|
|
|
74030
74228
|
});
|
|
74031
74229
|
return extendedKeySet;
|
|
74032
74230
|
}
|
|
74033
|
-
function getPath(
|
|
74231
|
+
function getPath(key2, { includeGroup = false, includeSelf = true }, treeMate) {
|
|
74034
74232
|
var _a2;
|
|
74035
74233
|
const treeNodeMap = treeMate.treeNodeMap;
|
|
74036
|
-
let treeNode =
|
|
74234
|
+
let treeNode = key2 === null || key2 === void 0 ? null : (_a2 = treeNodeMap.get(key2)) !== null && _a2 !== void 0 ? _a2 : null;
|
|
74037
74235
|
const mergedPath = {
|
|
74038
74236
|
keyPath: [],
|
|
74039
74237
|
treeNodePath: [],
|
|
@@ -74279,44 +74477,44 @@ function createTreeMate(rawNodes, options = {}) {
|
|
|
74279
74477
|
}
|
|
74280
74478
|
}, moveMethods);
|
|
74281
74479
|
const treeNodes = createTreeNodes(rawNodes, treeNodeMap, levelTreeNodeMap, nodeProto, getChildren2);
|
|
74282
|
-
function getNode(
|
|
74283
|
-
if (
|
|
74480
|
+
function getNode(key2) {
|
|
74481
|
+
if (key2 === null || key2 === void 0)
|
|
74284
74482
|
return null;
|
|
74285
|
-
const tmNode = treeNodeMap.get(
|
|
74483
|
+
const tmNode = treeNodeMap.get(key2);
|
|
74286
74484
|
if (tmNode && !tmNode.isGroup && !tmNode.ignored) {
|
|
74287
74485
|
return tmNode;
|
|
74288
74486
|
}
|
|
74289
74487
|
return null;
|
|
74290
74488
|
}
|
|
74291
|
-
function _getNode(
|
|
74292
|
-
if (
|
|
74489
|
+
function _getNode(key2) {
|
|
74490
|
+
if (key2 === null || key2 === void 0)
|
|
74293
74491
|
return null;
|
|
74294
|
-
const tmNode = treeNodeMap.get(
|
|
74492
|
+
const tmNode = treeNodeMap.get(key2);
|
|
74295
74493
|
if (tmNode && !tmNode.ignored) {
|
|
74296
74494
|
return tmNode;
|
|
74297
74495
|
}
|
|
74298
74496
|
return null;
|
|
74299
74497
|
}
|
|
74300
|
-
function getPrev(
|
|
74301
|
-
const node = _getNode(
|
|
74498
|
+
function getPrev(key2, options2) {
|
|
74499
|
+
const node = _getNode(key2);
|
|
74302
74500
|
if (!node)
|
|
74303
74501
|
return null;
|
|
74304
74502
|
return node.getPrev(options2);
|
|
74305
74503
|
}
|
|
74306
|
-
function getNext(
|
|
74307
|
-
const node = _getNode(
|
|
74504
|
+
function getNext(key2, options2) {
|
|
74505
|
+
const node = _getNode(key2);
|
|
74308
74506
|
if (!node)
|
|
74309
74507
|
return null;
|
|
74310
74508
|
return node.getNext(options2);
|
|
74311
74509
|
}
|
|
74312
|
-
function getParent(
|
|
74313
|
-
const node = _getNode(
|
|
74510
|
+
function getParent(key2) {
|
|
74511
|
+
const node = _getNode(key2);
|
|
74314
74512
|
if (!node)
|
|
74315
74513
|
return null;
|
|
74316
74514
|
return node.getParent();
|
|
74317
74515
|
}
|
|
74318
|
-
function getChild2(
|
|
74319
|
-
const node = _getNode(
|
|
74516
|
+
function getChild2(key2) {
|
|
74517
|
+
const node = _getNode(key2);
|
|
74320
74518
|
if (!node)
|
|
74321
74519
|
return null;
|
|
74322
74520
|
return node.getChild();
|
|
@@ -74338,8 +74536,8 @@ function createTreeMate(rawNodes, options = {}) {
|
|
|
74338
74536
|
getFirstAvailableNode() {
|
|
74339
74537
|
return getFirstAvailableNode(treeNodes);
|
|
74340
74538
|
},
|
|
74341
|
-
getPath(
|
|
74342
|
-
return getPath(
|
|
74539
|
+
getPath(key2, options2 = {}) {
|
|
74540
|
+
return getPath(key2, options2, treemate);
|
|
74343
74541
|
},
|
|
74344
74542
|
getCheckedKeys(checkedKeys, options2 = {}) {
|
|
74345
74543
|
const { cascade = true, leafOnly = false, checkStrategy = "all", allowNotLoaded = false } = options2;
|
|
@@ -75867,7 +76065,7 @@ const NDropdownOption = vue.defineComponent({
|
|
|
75867
76065
|
const showSubmenuRef = vue.computed(() => {
|
|
75868
76066
|
if (!hasSubmenuRef.value) return false;
|
|
75869
76067
|
const {
|
|
75870
|
-
key,
|
|
76068
|
+
key: key2,
|
|
75871
76069
|
disabled
|
|
75872
76070
|
} = props.tmNode;
|
|
75873
76071
|
if (disabled) return false;
|
|
@@ -75883,11 +76081,11 @@ const NDropdownOption = vue.defineComponent({
|
|
|
75883
76081
|
const {
|
|
75884
76082
|
value: pendingKeyPath
|
|
75885
76083
|
} = pendingKeyPathRef;
|
|
75886
|
-
if (hoverKey !== null) return pendingKeyPath.includes(
|
|
76084
|
+
if (hoverKey !== null) return pendingKeyPath.includes(key2);
|
|
75887
76085
|
if (keyboardKey !== null) {
|
|
75888
|
-
return pendingKeyPath.includes(
|
|
76086
|
+
return pendingKeyPath.includes(key2) && pendingKeyPath[pendingKeyPath.length - 1] !== key2;
|
|
75889
76087
|
}
|
|
75890
|
-
if (lastToggledSubmenuKey !== null) return pendingKeyPath.includes(
|
|
76088
|
+
if (lastToggledSubmenuKey !== null) return pendingKeyPath.includes(key2);
|
|
75891
76089
|
return false;
|
|
75892
76090
|
});
|
|
75893
76091
|
const shouldDelayRef = vue.computed(() => {
|
|
@@ -75973,18 +76171,18 @@ const NDropdownOption = vue.defineComponent({
|
|
|
75973
76171
|
value: pendingKeyPath
|
|
75974
76172
|
} = pendingKeyPathRef;
|
|
75975
76173
|
const {
|
|
75976
|
-
key
|
|
76174
|
+
key: key2
|
|
75977
76175
|
} = props.tmNode;
|
|
75978
|
-
return pendingKeyPath.includes(
|
|
76176
|
+
return pendingKeyPath.includes(key2);
|
|
75979
76177
|
}),
|
|
75980
76178
|
childActive: useMemo(() => {
|
|
75981
76179
|
const {
|
|
75982
76180
|
value: activeKeyPath
|
|
75983
76181
|
} = activeKeyPathRef;
|
|
75984
76182
|
const {
|
|
75985
|
-
key
|
|
76183
|
+
key: key2
|
|
75986
76184
|
} = props.tmNode;
|
|
75987
|
-
const index2 = activeKeyPath.findIndex((k) =>
|
|
76185
|
+
const index2 = activeKeyPath.findIndex((k) => key2 === k);
|
|
75988
76186
|
if (index2 === -1) return false;
|
|
75989
76187
|
return index2 < activeKeyPath.length - 1;
|
|
75990
76188
|
}),
|
|
@@ -75993,9 +76191,9 @@ const NDropdownOption = vue.defineComponent({
|
|
|
75993
76191
|
value: activeKeyPath
|
|
75994
76192
|
} = activeKeyPathRef;
|
|
75995
76193
|
const {
|
|
75996
|
-
key
|
|
76194
|
+
key: key2
|
|
75997
76195
|
} = props.tmNode;
|
|
75998
|
-
const index2 = activeKeyPath.findIndex((k) =>
|
|
76196
|
+
const index2 = activeKeyPath.findIndex((k) => key2 === k);
|
|
75999
76197
|
if (index2 === -1) return false;
|
|
76000
76198
|
return index2 === activeKeyPath.length - 1;
|
|
76001
76199
|
}),
|
|
@@ -76542,11 +76740,11 @@ const NDropdown = vue.defineComponent({
|
|
|
76542
76740
|
clearPendingState();
|
|
76543
76741
|
}
|
|
76544
76742
|
});
|
|
76545
|
-
function doSelect(
|
|
76743
|
+
function doSelect(key2, node) {
|
|
76546
76744
|
const {
|
|
76547
76745
|
onSelect
|
|
76548
76746
|
} = props;
|
|
76549
|
-
if (onSelect) call(onSelect,
|
|
76747
|
+
if (onSelect) call(onSelect, key2, node);
|
|
76550
76748
|
}
|
|
76551
76749
|
function doUpdateShow(value) {
|
|
76552
76750
|
const {
|
|
@@ -77118,7 +77316,7 @@ const _sfc_main$1$1 = {
|
|
|
77118
77316
|
size: "medium",
|
|
77119
77317
|
placement: "bottom-start",
|
|
77120
77318
|
class: vue.normalizeClass(["toolbar-button toolbar-dropdown sd-editor-toolbar-dropdown", { "high-contrast": vue.unref(isHighContrastMode2) }]),
|
|
77121
|
-
onSelect: (
|
|
77319
|
+
onSelect: (key2, option) => handleSelect(item, option),
|
|
77122
77320
|
onClickoutside: handleClickOutside2,
|
|
77123
77321
|
style: vue.normalizeStyle(item.dropdownStyles.value),
|
|
77124
77322
|
"menu-props": () => ({
|
|
@@ -77794,8 +77992,8 @@ var __defProp = Object.defineProperty;
|
|
|
77794
77992
|
var __typeError = (msg2) => {
|
|
77795
77993
|
throw TypeError(msg2);
|
|
77796
77994
|
};
|
|
77797
|
-
var __defNormalProp = (obj,
|
|
77798
|
-
var __publicField = (obj,
|
|
77995
|
+
var __defNormalProp = (obj, key2, value) => key2 in obj ? __defProp(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value;
|
|
77996
|
+
var __publicField = (obj, key2, value) => __defNormalProp(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value);
|
|
77799
77997
|
var __accessCheck = (obj, member, msg2) => member.has(obj) || __typeError("Cannot " + msg2);
|
|
77800
77998
|
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
77801
77999
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
@@ -77852,8 +78050,8 @@ function requireEventemitter3() {
|
|
|
77852
78050
|
var evt = prefix2 ? prefix2 + event : event, handlers2 = this._events[evt];
|
|
77853
78051
|
if (!handlers2) return [];
|
|
77854
78052
|
if (handlers2.fn) return [handlers2.fn];
|
|
77855
|
-
for (var
|
|
77856
|
-
ee[
|
|
78053
|
+
for (var i2 = 0, l22 = handlers2.length, ee = new Array(l22); i2 < l22; i2++) {
|
|
78054
|
+
ee[i2] = handlers2[i2].fn;
|
|
77857
78055
|
}
|
|
77858
78056
|
return ee;
|
|
77859
78057
|
};
|
|
@@ -77866,7 +78064,7 @@ function requireEventemitter3() {
|
|
|
77866
78064
|
EventEmitter22.prototype.emit = function emit(event, a1, a22, a3, a4, a52) {
|
|
77867
78065
|
var evt = prefix2 ? prefix2 + event : event;
|
|
77868
78066
|
if (!this._events[evt]) return false;
|
|
77869
|
-
var listeners = this._events[evt], len = arguments.length, args,
|
|
78067
|
+
var listeners = this._events[evt], len = arguments.length, args, i2;
|
|
77870
78068
|
if (listeners.fn) {
|
|
77871
78069
|
if (listeners.once) this.removeListener(event, listeners.fn, void 0, true);
|
|
77872
78070
|
switch (len) {
|
|
@@ -77883,32 +78081,32 @@ function requireEventemitter3() {
|
|
|
77883
78081
|
case 6:
|
|
77884
78082
|
return listeners.fn.call(listeners.context, a1, a22, a3, a4, a52), true;
|
|
77885
78083
|
}
|
|
77886
|
-
for (
|
|
77887
|
-
args[
|
|
78084
|
+
for (i2 = 1, args = new Array(len - 1); i2 < len; i2++) {
|
|
78085
|
+
args[i2 - 1] = arguments[i2];
|
|
77888
78086
|
}
|
|
77889
78087
|
listeners.fn.apply(listeners.context, args);
|
|
77890
78088
|
} else {
|
|
77891
78089
|
var length2 = listeners.length, j2;
|
|
77892
|
-
for (
|
|
77893
|
-
if (listeners[
|
|
78090
|
+
for (i2 = 0; i2 < length2; i2++) {
|
|
78091
|
+
if (listeners[i2].once) this.removeListener(event, listeners[i2].fn, void 0, true);
|
|
77894
78092
|
switch (len) {
|
|
77895
78093
|
case 1:
|
|
77896
|
-
listeners[
|
|
78094
|
+
listeners[i2].fn.call(listeners[i2].context);
|
|
77897
78095
|
break;
|
|
77898
78096
|
case 2:
|
|
77899
|
-
listeners[
|
|
78097
|
+
listeners[i2].fn.call(listeners[i2].context, a1);
|
|
77900
78098
|
break;
|
|
77901
78099
|
case 3:
|
|
77902
|
-
listeners[
|
|
78100
|
+
listeners[i2].fn.call(listeners[i2].context, a1, a22);
|
|
77903
78101
|
break;
|
|
77904
78102
|
case 4:
|
|
77905
|
-
listeners[
|
|
78103
|
+
listeners[i2].fn.call(listeners[i2].context, a1, a22, a3);
|
|
77906
78104
|
break;
|
|
77907
78105
|
default:
|
|
77908
78106
|
if (!args) for (j2 = 1, args = new Array(len - 1); j2 < len; j2++) {
|
|
77909
78107
|
args[j2 - 1] = arguments[j2];
|
|
77910
78108
|
}
|
|
77911
|
-
listeners[
|
|
78109
|
+
listeners[i2].fn.apply(listeners[i2].context, args);
|
|
77912
78110
|
}
|
|
77913
78111
|
}
|
|
77914
78112
|
}
|
|
@@ -77933,9 +78131,9 @@ function requireEventemitter3() {
|
|
|
77933
78131
|
clearEvent(this, evt);
|
|
77934
78132
|
}
|
|
77935
78133
|
} else {
|
|
77936
|
-
for (var
|
|
77937
|
-
if (listeners[
|
|
77938
|
-
events2.push(listeners[
|
|
78134
|
+
for (var i2 = 0, events2 = [], length2 = listeners.length; i2 < length2; i2++) {
|
|
78135
|
+
if (listeners[i2].fn !== fn2 || once && !listeners[i2].once || context && listeners[i2].context !== context) {
|
|
78136
|
+
events2.push(listeners[i2]);
|
|
77939
78137
|
}
|
|
77940
78138
|
}
|
|
77941
78139
|
if (events2.length) this._events[evt] = events2.length === 1 ? events2[0] : events2;
|
|
@@ -78038,9 +78236,9 @@ const useToolbarItem = (options) => {
|
|
|
78038
78236
|
const onDeactivate = options.onDeactivate || (() => null);
|
|
78039
78237
|
const unref2 = () => {
|
|
78040
78238
|
const flattened = {};
|
|
78041
|
-
Object.keys(refs).forEach((
|
|
78042
|
-
if (refs[
|
|
78043
|
-
flattened[
|
|
78239
|
+
Object.keys(refs).forEach((key2) => {
|
|
78240
|
+
if (refs[key2].value !== void 0) {
|
|
78241
|
+
flattened[key2] = refs[key2].value;
|
|
78044
78242
|
}
|
|
78045
78243
|
});
|
|
78046
78244
|
return flattened;
|
|
@@ -78928,8 +79126,8 @@ const _sfc_main$7 = {
|
|
|
78928
79126
|
const selectGridItems = (allItems, cols, rows) => {
|
|
78929
79127
|
selectedCols.value = cols;
|
|
78930
79128
|
selectedRows.value = rows;
|
|
78931
|
-
for (let
|
|
78932
|
-
let item = allItems[
|
|
79129
|
+
for (let i2 = 0; i2 < allItems.length; i2++) {
|
|
79130
|
+
let item = allItems[i2];
|
|
78933
79131
|
let itemsCols = parseInt(item.dataset.cols, 10);
|
|
78934
79132
|
let itemsRows = parseInt(item.dataset.rows, 10);
|
|
78935
79133
|
if (itemsCols <= cols && itemsRows <= rows) {
|
|
@@ -79006,20 +79204,20 @@ const _sfc_main$7 = {
|
|
|
79006
79204
|
onMouseover: onTableGridMouseOver,
|
|
79007
79205
|
"data-grid": "true"
|
|
79008
79206
|
}, [
|
|
79009
|
-
(vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(5, (
|
|
79010
|
-
return vue.openBlock(), vue.createElementBlock(vue.Fragment, { key:
|
|
79011
|
-
(vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(5, (
|
|
79207
|
+
(vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(5, (i2) => {
|
|
79208
|
+
return vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: i2 }, [
|
|
79209
|
+
(vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(5, (n2) => {
|
|
79012
79210
|
return vue.createBaseVNode("div", {
|
|
79013
79211
|
class: "toolbar-table-grid__item",
|
|
79014
|
-
key: `${
|
|
79015
|
-
"data-cols":
|
|
79016
|
-
"data-rows":
|
|
79212
|
+
key: `${i2}_${n2}`,
|
|
79213
|
+
"data-cols": n2,
|
|
79214
|
+
"data-rows": i2,
|
|
79017
79215
|
"data-item": "true",
|
|
79018
79216
|
ref_for: true,
|
|
79019
79217
|
ref_key: "tableGridItems",
|
|
79020
79218
|
ref: tableGridItems,
|
|
79021
|
-
onKeydown: vue.withModifiers((event) => handleKeyDown2(event,
|
|
79022
|
-
onClick: vue.withModifiers(($event) => handleClick2({ cols:
|
|
79219
|
+
onKeydown: vue.withModifiers((event) => handleKeyDown2(event, n2, i2), ["prevent"]),
|
|
79220
|
+
onClick: vue.withModifiers(($event) => handleClick2({ cols: n2, rows: i2 }), ["stop", "prevent"])
|
|
79023
79221
|
}, null, 40, _hoisted_1$6);
|
|
79024
79222
|
}), 64))
|
|
79025
79223
|
], 64);
|
|
@@ -79240,7 +79438,7 @@ const makeDefaultItems = ({
|
|
|
79240
79438
|
onActivate: ({ fontFamily: fontFamily2 }) => {
|
|
79241
79439
|
if (!fontFamily2) return;
|
|
79242
79440
|
fontButton.label.value = fontFamily2;
|
|
79243
|
-
const foundFont = fontOptions.find((
|
|
79441
|
+
const foundFont = fontOptions.find((i2) => i2.label === fontFamily2);
|
|
79244
79442
|
if (foundFont) {
|
|
79245
79443
|
fontButton.selectedValue.value = foundFont.key;
|
|
79246
79444
|
} else {
|
|
@@ -79326,8 +79524,8 @@ const makeDefaultItems = ({
|
|
|
79326
79524
|
if (sanitizedValue < 8) sanitizedValue = 8;
|
|
79327
79525
|
if (sanitizedValue > 96) sanitizedValue = 96;
|
|
79328
79526
|
let sanitizedValueStr = String(sanitizedValue);
|
|
79329
|
-
const foundSize = fontSizeOptions.find((
|
|
79330
|
-
return
|
|
79527
|
+
const foundSize = fontSizeOptions.find((i2) => {
|
|
79528
|
+
return i2.label === sanitizedValueStr || i2.key === sanitizedValueStr;
|
|
79331
79529
|
});
|
|
79332
79530
|
if (foundSize) {
|
|
79333
79531
|
fontSize2.selectedValue.value = foundSize.key;
|
|
@@ -80417,10 +80615,25 @@ class SuperToolbar extends EventEmitter2 {
|
|
|
80417
80615
|
if (!result?.file) {
|
|
80418
80616
|
return;
|
|
80419
80617
|
}
|
|
80420
|
-
|
|
80618
|
+
const { size: size2, file } = await checkAndProcessImage({
|
|
80619
|
+
file: result.file,
|
|
80620
|
+
getMaxContentSize: () => this.activeEditor.getMaxContentSize()
|
|
80621
|
+
});
|
|
80622
|
+
if (!file) {
|
|
80623
|
+
return;
|
|
80624
|
+
}
|
|
80625
|
+
const id = {};
|
|
80626
|
+
replaceSelectionWithImagePlaceholder({
|
|
80627
|
+
view: this.activeEditor.view,
|
|
80628
|
+
editorOptions: this.activeEditor.options,
|
|
80629
|
+
id
|
|
80630
|
+
});
|
|
80631
|
+
await uploadAndInsertImage({
|
|
80421
80632
|
editor: this.activeEditor,
|
|
80422
80633
|
view: this.activeEditor.view,
|
|
80423
|
-
file
|
|
80634
|
+
file,
|
|
80635
|
+
size: size2,
|
|
80636
|
+
id
|
|
80424
80637
|
});
|
|
80425
80638
|
},
|
|
80426
80639
|
/**
|
|
@@ -81702,11 +81915,11 @@ const _sfc_main$3 = {
|
|
|
81702
81915
|
pageMargins.value = docMargins;
|
|
81703
81916
|
rightHandle.x = docSize.width * 96 - docMargins.right * 96;
|
|
81704
81917
|
leftHandle.x = docMargins.left * 96;
|
|
81705
|
-
for (let
|
|
81918
|
+
for (let i2 = 0; i2 < docSize.width; i2++) {
|
|
81706
81919
|
const marginNum = 0.0625 * 96 - 0.5;
|
|
81707
81920
|
const margin = `${marginNum}px`;
|
|
81708
|
-
const diff = docSize.width -
|
|
81709
|
-
rulerItems.push(...generateSection(1, "main", "20%", margin,
|
|
81921
|
+
const diff = docSize.width - i2;
|
|
81922
|
+
rulerItems.push(...generateSection(1, "main", "20%", margin, i2));
|
|
81710
81923
|
rulerItems.push(...generateSection(3, "eighth", "10%", margin));
|
|
81711
81924
|
rulerItems.push(...generateSection(1, "half", "40%", margin));
|
|
81712
81925
|
if (diff <= 0.5) break;
|
|
@@ -81715,7 +81928,7 @@ const _sfc_main$3 = {
|
|
|
81715
81928
|
return rulerItems;
|
|
81716
81929
|
};
|
|
81717
81930
|
const generateSection = (qty, size2, height, margin, index2) => {
|
|
81718
|
-
return Array.from({ length: qty }, (_2,
|
|
81931
|
+
return Array.from({ length: qty }, (_2, i2) => {
|
|
81719
81932
|
const item = {
|
|
81720
81933
|
className: `${size2}-unit ruler-section`,
|
|
81721
81934
|
height,
|