@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
|
@@ -5,8 +5,8 @@ var __defProp$2 = Object.defineProperty;
|
|
|
5
5
|
var __typeError$2 = (msg2) => {
|
|
6
6
|
throw TypeError(msg2);
|
|
7
7
|
};
|
|
8
|
-
var __defNormalProp$2 = (obj,
|
|
9
|
-
var __publicField$2 = (obj,
|
|
8
|
+
var __defNormalProp$2 = (obj, key2, value) => key2 in obj ? __defProp$2(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value;
|
|
9
|
+
var __publicField$2 = (obj, key2, value) => __defNormalProp$2(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value);
|
|
10
10
|
var __accessCheck$2 = (obj, member, msg2) => member.has(obj) || __typeError$2("Cannot " + msg2);
|
|
11
11
|
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);
|
|
12
12
|
var __privateMethod$2 = (obj, member, method) => (__accessCheck$2(obj, member, "access private method"), method);
|
|
@@ -2028,11 +2028,11 @@ function requireEvents() {
|
|
|
2028
2028
|
}
|
|
2029
2029
|
if (arguments.length === 0) {
|
|
2030
2030
|
var keys2 = Object.keys(events2);
|
|
2031
|
-
var
|
|
2031
|
+
var key2;
|
|
2032
2032
|
for (i = 0; i < keys2.length; ++i) {
|
|
2033
|
-
|
|
2034
|
-
if (
|
|
2035
|
-
this.removeAllListeners(
|
|
2033
|
+
key2 = keys2[i];
|
|
2034
|
+
if (key2 === "removeListener") continue;
|
|
2035
|
+
this.removeAllListeners(key2);
|
|
2036
2036
|
}
|
|
2037
2037
|
this.removeAllListeners("removeListener");
|
|
2038
2038
|
this._events = /* @__PURE__ */ Object.create(null);
|
|
@@ -6116,8 +6116,8 @@ function requireUtil() {
|
|
|
6116
6116
|
if (array) {
|
|
6117
6117
|
output = formatArray(ctx2, value, recurseTimes, visibleKeys, keys2);
|
|
6118
6118
|
} else {
|
|
6119
|
-
output = keys2.map(function(
|
|
6120
|
-
return formatProperty(ctx2, value, recurseTimes, visibleKeys,
|
|
6119
|
+
output = keys2.map(function(key2) {
|
|
6120
|
+
return formatProperty(ctx2, value, recurseTimes, visibleKeys, key2, array);
|
|
6121
6121
|
});
|
|
6122
6122
|
}
|
|
6123
6123
|
ctx2.seen.pop();
|
|
@@ -6156,23 +6156,23 @@ function requireUtil() {
|
|
|
6156
6156
|
output.push("");
|
|
6157
6157
|
}
|
|
6158
6158
|
}
|
|
6159
|
-
keys2.forEach(function(
|
|
6160
|
-
if (!
|
|
6159
|
+
keys2.forEach(function(key2) {
|
|
6160
|
+
if (!key2.match(/^\d+$/)) {
|
|
6161
6161
|
output.push(formatProperty(
|
|
6162
6162
|
ctx2,
|
|
6163
6163
|
value,
|
|
6164
6164
|
recurseTimes,
|
|
6165
6165
|
visibleKeys,
|
|
6166
|
-
|
|
6166
|
+
key2,
|
|
6167
6167
|
true
|
|
6168
6168
|
));
|
|
6169
6169
|
}
|
|
6170
6170
|
});
|
|
6171
6171
|
return output;
|
|
6172
6172
|
}
|
|
6173
|
-
function formatProperty(ctx2, value, recurseTimes, visibleKeys,
|
|
6173
|
+
function formatProperty(ctx2, value, recurseTimes, visibleKeys, key2, array) {
|
|
6174
6174
|
var name, str, desc;
|
|
6175
|
-
desc = Object.getOwnPropertyDescriptor(value,
|
|
6175
|
+
desc = Object.getOwnPropertyDescriptor(value, key2) || { value: value[key2] };
|
|
6176
6176
|
if (desc.get) {
|
|
6177
6177
|
if (desc.set) {
|
|
6178
6178
|
str = ctx2.stylize("[Getter/Setter]", "special");
|
|
@@ -6184,8 +6184,8 @@ function requireUtil() {
|
|
|
6184
6184
|
str = ctx2.stylize("[Setter]", "special");
|
|
6185
6185
|
}
|
|
6186
6186
|
}
|
|
6187
|
-
if (!hasOwnProperty2(visibleKeys,
|
|
6188
|
-
name = "[" +
|
|
6187
|
+
if (!hasOwnProperty2(visibleKeys, key2)) {
|
|
6188
|
+
name = "[" + key2 + "]";
|
|
6189
6189
|
}
|
|
6190
6190
|
if (!str) {
|
|
6191
6191
|
if (ctx2.seen.indexOf(desc.value) < 0) {
|
|
@@ -6210,10 +6210,10 @@ function requireUtil() {
|
|
|
6210
6210
|
}
|
|
6211
6211
|
}
|
|
6212
6212
|
if (isUndefined(name)) {
|
|
6213
|
-
if (array &&
|
|
6213
|
+
if (array && key2.match(/^\d+$/)) {
|
|
6214
6214
|
return str;
|
|
6215
6215
|
}
|
|
6216
|
-
name = JSON.stringify("" +
|
|
6216
|
+
name = JSON.stringify("" + key2);
|
|
6217
6217
|
if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
|
|
6218
6218
|
name = name.slice(1, -1);
|
|
6219
6219
|
name = ctx2.stylize(name, "name");
|
|
@@ -6458,20 +6458,20 @@ function requireBuffer_list() {
|
|
|
6458
6458
|
function _objectSpread(target) {
|
|
6459
6459
|
for (var i = 1; i < arguments.length; i++) {
|
|
6460
6460
|
var source = null != arguments[i] ? arguments[i] : {};
|
|
6461
|
-
i % 2 ? ownKeys(Object(source), true).forEach(function(
|
|
6462
|
-
_defineProperty(target,
|
|
6463
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(
|
|
6464
|
-
Object.defineProperty(target,
|
|
6461
|
+
i % 2 ? ownKeys(Object(source), true).forEach(function(key2) {
|
|
6462
|
+
_defineProperty(target, key2, source[key2]);
|
|
6463
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key2) {
|
|
6464
|
+
Object.defineProperty(target, key2, Object.getOwnPropertyDescriptor(source, key2));
|
|
6465
6465
|
});
|
|
6466
6466
|
}
|
|
6467
6467
|
return target;
|
|
6468
6468
|
}
|
|
6469
|
-
function _defineProperty(obj,
|
|
6470
|
-
|
|
6471
|
-
if (
|
|
6472
|
-
Object.defineProperty(obj,
|
|
6469
|
+
function _defineProperty(obj, key2, value) {
|
|
6470
|
+
key2 = _toPropertyKey(key2);
|
|
6471
|
+
if (key2 in obj) {
|
|
6472
|
+
Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true });
|
|
6473
6473
|
} else {
|
|
6474
|
-
obj[
|
|
6474
|
+
obj[key2] = value;
|
|
6475
6475
|
}
|
|
6476
6476
|
return obj;
|
|
6477
6477
|
}
|
|
@@ -6495,8 +6495,8 @@ function requireBuffer_list() {
|
|
|
6495
6495
|
return Constructor;
|
|
6496
6496
|
}
|
|
6497
6497
|
function _toPropertyKey(arg) {
|
|
6498
|
-
var
|
|
6499
|
-
return typeof
|
|
6498
|
+
var key2 = _toPrimitive(arg, "string");
|
|
6499
|
+
return typeof key2 === "symbol" ? key2 : String(key2);
|
|
6500
6500
|
}
|
|
6501
6501
|
function _toPrimitive(input, hint) {
|
|
6502
6502
|
if (typeof input !== "object" || input === null) return input;
|
|
@@ -7409,7 +7409,7 @@ function require_stream_duplex() {
|
|
|
7409
7409
|
hasRequired_stream_duplex = 1;
|
|
7410
7410
|
var objectKeys = Object.keys || function(obj) {
|
|
7411
7411
|
var keys3 = [];
|
|
7412
|
-
for (var
|
|
7412
|
+
for (var key2 in obj) keys3.push(key2);
|
|
7413
7413
|
return keys3;
|
|
7414
7414
|
};
|
|
7415
7415
|
_stream_duplex = Duplex;
|
|
@@ -7502,8 +7502,8 @@ function requireSafeBuffer() {
|
|
|
7502
7502
|
var buffer2 = requireDist();
|
|
7503
7503
|
var Buffer3 = buffer2.Buffer;
|
|
7504
7504
|
function copyProps(src, dst) {
|
|
7505
|
-
for (var
|
|
7506
|
-
dst[
|
|
7505
|
+
for (var key2 in src) {
|
|
7506
|
+
dst[key2] = src[key2];
|
|
7507
7507
|
}
|
|
7508
7508
|
}
|
|
7509
7509
|
if (Buffer3.from && Buffer3.alloc && Buffer3.allocUnsafe && Buffer3.allocUnsafeSlow) {
|
|
@@ -7885,18 +7885,18 @@ function requireAsync_iterator() {
|
|
|
7885
7885
|
if (hasRequiredAsync_iterator) return async_iterator;
|
|
7886
7886
|
hasRequiredAsync_iterator = 1;
|
|
7887
7887
|
var _Object$setPrototypeO;
|
|
7888
|
-
function _defineProperty(obj,
|
|
7889
|
-
|
|
7890
|
-
if (
|
|
7891
|
-
Object.defineProperty(obj,
|
|
7888
|
+
function _defineProperty(obj, key2, value) {
|
|
7889
|
+
key2 = _toPropertyKey(key2);
|
|
7890
|
+
if (key2 in obj) {
|
|
7891
|
+
Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true });
|
|
7892
7892
|
} else {
|
|
7893
|
-
obj[
|
|
7893
|
+
obj[key2] = value;
|
|
7894
7894
|
}
|
|
7895
7895
|
return obj;
|
|
7896
7896
|
}
|
|
7897
7897
|
function _toPropertyKey(arg) {
|
|
7898
|
-
var
|
|
7899
|
-
return typeof
|
|
7898
|
+
var key2 = _toPrimitive(arg, "string");
|
|
7899
|
+
return typeof key2 === "symbol" ? key2 : String(key2);
|
|
7900
7900
|
}
|
|
7901
7901
|
function _toPrimitive(input, hint) {
|
|
7902
7902
|
if (typeof input !== "object" || input === null) return input;
|
|
@@ -9675,10 +9675,10 @@ function requireSax() {
|
|
|
9675
9675
|
"hearts": 9829,
|
|
9676
9676
|
"diams": 9830
|
|
9677
9677
|
};
|
|
9678
|
-
Object.keys(sax2.ENTITIES).forEach(function(
|
|
9679
|
-
var e = sax2.ENTITIES[
|
|
9678
|
+
Object.keys(sax2.ENTITIES).forEach(function(key2) {
|
|
9679
|
+
var e = sax2.ENTITIES[key2];
|
|
9680
9680
|
var s2 = typeof e === "number" ? String.fromCharCode(e) : e;
|
|
9681
|
-
sax2.ENTITIES[
|
|
9681
|
+
sax2.ENTITIES[key2] = s2;
|
|
9682
9682
|
});
|
|
9683
9683
|
for (var s in sax2.STATE) {
|
|
9684
9684
|
sax2.STATE[sax2.STATE[s]] = s;
|
|
@@ -10562,10 +10562,10 @@ function requireOptionsHelper() {
|
|
|
10562
10562
|
var isArray2 = requireArrayHelper().isArray;
|
|
10563
10563
|
optionsHelper = {
|
|
10564
10564
|
copyOptions: function(options) {
|
|
10565
|
-
var
|
|
10566
|
-
for (
|
|
10567
|
-
if (options.hasOwnProperty(
|
|
10568
|
-
copy2[
|
|
10565
|
+
var key2, copy2 = {};
|
|
10566
|
+
for (key2 in options) {
|
|
10567
|
+
if (options.hasOwnProperty(key2)) {
|
|
10568
|
+
copy2[key2] = options[key2];
|
|
10569
10569
|
}
|
|
10570
10570
|
}
|
|
10571
10571
|
return copy2;
|
|
@@ -10585,13 +10585,13 @@ function requireOptionsHelper() {
|
|
|
10585
10585
|
options.alwaysArray = false;
|
|
10586
10586
|
}
|
|
10587
10587
|
},
|
|
10588
|
-
ensureKeyExists: function(
|
|
10589
|
-
if (!(
|
|
10590
|
-
options[
|
|
10588
|
+
ensureKeyExists: function(key2, options) {
|
|
10589
|
+
if (!(key2 + "Key" in options) || typeof options[key2 + "Key"] !== "string") {
|
|
10590
|
+
options[key2 + "Key"] = options.compact ? "_" + key2 : key2;
|
|
10591
10591
|
}
|
|
10592
10592
|
},
|
|
10593
|
-
checkFnExists: function(
|
|
10594
|
-
return
|
|
10593
|
+
checkFnExists: function(key2, options) {
|
|
10594
|
+
return key2 + "Fn" in options;
|
|
10595
10595
|
}
|
|
10596
10596
|
};
|
|
10597
10597
|
return optionsHelper;
|
|
@@ -10662,7 +10662,7 @@ function requireXml2js() {
|
|
|
10662
10662
|
return value;
|
|
10663
10663
|
}
|
|
10664
10664
|
function addField(type2, value) {
|
|
10665
|
-
var
|
|
10665
|
+
var key2;
|
|
10666
10666
|
if (options.compact) {
|
|
10667
10667
|
if (!currentElement[options[type2 + "Key"]] && (isArray2(options.alwaysArray) ? options.alwaysArray.indexOf(options[type2 + "Key"]) !== -1 : options.alwaysArray)) {
|
|
10668
10668
|
currentElement[options[type2 + "Key"]] = [];
|
|
@@ -10674,14 +10674,14 @@ function requireXml2js() {
|
|
|
10674
10674
|
value = options[type2 + "Fn"](value, currentElement);
|
|
10675
10675
|
}
|
|
10676
10676
|
if (type2 === "instruction" && ("instructionFn" in options || "instructionNameFn" in options)) {
|
|
10677
|
-
for (
|
|
10678
|
-
if (value.hasOwnProperty(
|
|
10677
|
+
for (key2 in value) {
|
|
10678
|
+
if (value.hasOwnProperty(key2)) {
|
|
10679
10679
|
if ("instructionFn" in options) {
|
|
10680
|
-
value[
|
|
10680
|
+
value[key2] = options.instructionFn(value[key2], key2, currentElement);
|
|
10681
10681
|
} else {
|
|
10682
|
-
var temp = value[
|
|
10683
|
-
delete value[
|
|
10684
|
-
value[options.instructionNameFn(
|
|
10682
|
+
var temp = value[key2];
|
|
10683
|
+
delete value[key2];
|
|
10684
|
+
value[options.instructionNameFn(key2, temp, currentElement)] = temp;
|
|
10685
10685
|
}
|
|
10686
10686
|
}
|
|
10687
10687
|
}
|
|
@@ -10698,22 +10698,22 @@ function requireXml2js() {
|
|
|
10698
10698
|
var element = {};
|
|
10699
10699
|
element[options.typeKey] = type2;
|
|
10700
10700
|
if (type2 === "instruction") {
|
|
10701
|
-
for (
|
|
10702
|
-
if (value.hasOwnProperty(
|
|
10701
|
+
for (key2 in value) {
|
|
10702
|
+
if (value.hasOwnProperty(key2)) {
|
|
10703
10703
|
break;
|
|
10704
10704
|
}
|
|
10705
10705
|
}
|
|
10706
|
-
element[options.nameKey] = "instructionNameFn" in options ? options.instructionNameFn(
|
|
10706
|
+
element[options.nameKey] = "instructionNameFn" in options ? options.instructionNameFn(key2, value, currentElement) : key2;
|
|
10707
10707
|
if (options.instructionHasAttributes) {
|
|
10708
|
-
element[options.attributesKey] = value[
|
|
10708
|
+
element[options.attributesKey] = value[key2][options.attributesKey];
|
|
10709
10709
|
if ("instructionFn" in options) {
|
|
10710
|
-
element[options.attributesKey] = options.instructionFn(element[options.attributesKey],
|
|
10710
|
+
element[options.attributesKey] = options.instructionFn(element[options.attributesKey], key2, currentElement);
|
|
10711
10711
|
}
|
|
10712
10712
|
} else {
|
|
10713
10713
|
if ("instructionFn" in options) {
|
|
10714
|
-
value[
|
|
10714
|
+
value[key2] = options.instructionFn(value[key2], key2, currentElement);
|
|
10715
10715
|
}
|
|
10716
|
-
element[options.instructionKey] = value[
|
|
10716
|
+
element[options.instructionKey] = value[key2];
|
|
10717
10717
|
}
|
|
10718
10718
|
} else {
|
|
10719
10719
|
if (type2 + "Fn" in options) {
|
|
@@ -10732,18 +10732,18 @@ function requireXml2js() {
|
|
|
10732
10732
|
attributes = options.attributesFn(attributes, currentElement);
|
|
10733
10733
|
}
|
|
10734
10734
|
if ((options.trim || "attributeValueFn" in options || "attributeNameFn" in options || options.nativeTypeAttributes) && attributes) {
|
|
10735
|
-
var
|
|
10736
|
-
for (
|
|
10737
|
-
if (attributes.hasOwnProperty(
|
|
10738
|
-
if (options.trim) attributes[
|
|
10735
|
+
var key2;
|
|
10736
|
+
for (key2 in attributes) {
|
|
10737
|
+
if (attributes.hasOwnProperty(key2)) {
|
|
10738
|
+
if (options.trim) attributes[key2] = attributes[key2].trim();
|
|
10739
10739
|
if (options.nativeTypeAttributes) {
|
|
10740
|
-
attributes[
|
|
10740
|
+
attributes[key2] = nativeType(attributes[key2]);
|
|
10741
10741
|
}
|
|
10742
|
-
if ("attributeValueFn" in options) attributes[
|
|
10742
|
+
if ("attributeValueFn" in options) attributes[key2] = options.attributeValueFn(attributes[key2], key2, currentElement);
|
|
10743
10743
|
if ("attributeNameFn" in options) {
|
|
10744
|
-
var temp = attributes[
|
|
10745
|
-
delete attributes[
|
|
10746
|
-
attributes[options.attributeNameFn(
|
|
10744
|
+
var temp = attributes[key2];
|
|
10745
|
+
delete attributes[key2];
|
|
10746
|
+
attributes[options.attributeNameFn(key2, attributes[key2], currentElement)] = temp;
|
|
10747
10747
|
}
|
|
10748
10748
|
}
|
|
10749
10749
|
}
|
|
@@ -10802,10 +10802,10 @@ function requireXml2js() {
|
|
|
10802
10802
|
element = {};
|
|
10803
10803
|
if (!options.ignoreAttributes && attributes && Object.keys(attributes).length) {
|
|
10804
10804
|
element[options.attributesKey] = {};
|
|
10805
|
-
var
|
|
10806
|
-
for (
|
|
10807
|
-
if (attributes.hasOwnProperty(
|
|
10808
|
-
element[options.attributesKey][
|
|
10805
|
+
var key2;
|
|
10806
|
+
for (key2 in attributes) {
|
|
10807
|
+
if (attributes.hasOwnProperty(key2)) {
|
|
10808
|
+
element[options.attributesKey][key2] = attributes[key2];
|
|
10809
10809
|
}
|
|
10810
10810
|
}
|
|
10811
10811
|
}
|
|
@@ -11012,15 +11012,15 @@ function requireJs2xml() {
|
|
|
11012
11012
|
if ("attributesFn" in options) {
|
|
11013
11013
|
attributes = options.attributesFn(attributes, currentElementName, currentElement);
|
|
11014
11014
|
}
|
|
11015
|
-
var
|
|
11016
|
-
for (
|
|
11017
|
-
if (attributes.hasOwnProperty(
|
|
11018
|
-
quote = options.noQuotesForNativeAttributes && typeof attributes[
|
|
11019
|
-
attr = "" + attributes[
|
|
11015
|
+
var key2, attr, attrName, quote, result = [];
|
|
11016
|
+
for (key2 in attributes) {
|
|
11017
|
+
if (attributes.hasOwnProperty(key2) && attributes[key2] !== null && attributes[key2] !== void 0) {
|
|
11018
|
+
quote = options.noQuotesForNativeAttributes && typeof attributes[key2] !== "string" ? "" : '"';
|
|
11019
|
+
attr = "" + attributes[key2];
|
|
11020
11020
|
attr = attr.replace(/"/g, """);
|
|
11021
|
-
attrName = "attributeNameFn" in options ? options.attributeNameFn(
|
|
11021
|
+
attrName = "attributeNameFn" in options ? options.attributeNameFn(key2, attr, currentElementName, currentElement) : key2;
|
|
11022
11022
|
result.push(options.spaces && options.indentAttributes ? writeIndentation(options, depth + 1, false) : " ");
|
|
11023
|
-
result.push(attrName + "=" + quote + ("attributeValueFn" in options ? options.attributeValueFn(attr,
|
|
11023
|
+
result.push(attrName + "=" + quote + ("attributeValueFn" in options ? options.attributeValueFn(attr, key2, currentElementName, currentElement) : attr) + quote);
|
|
11024
11024
|
}
|
|
11025
11025
|
}
|
|
11026
11026
|
if (attributes && Object.keys(attributes).length && options.spaces && options.indentAttributes) {
|
|
@@ -11037,20 +11037,20 @@ function requireJs2xml() {
|
|
|
11037
11037
|
if (options.ignoreInstruction) {
|
|
11038
11038
|
return "";
|
|
11039
11039
|
}
|
|
11040
|
-
var
|
|
11041
|
-
for (
|
|
11042
|
-
if (instruction.hasOwnProperty(
|
|
11040
|
+
var key2;
|
|
11041
|
+
for (key2 in instruction) {
|
|
11042
|
+
if (instruction.hasOwnProperty(key2)) {
|
|
11043
11043
|
break;
|
|
11044
11044
|
}
|
|
11045
11045
|
}
|
|
11046
|
-
var instructionName = "instructionNameFn" in options ? options.instructionNameFn(
|
|
11047
|
-
if (typeof instruction[
|
|
11046
|
+
var instructionName = "instructionNameFn" in options ? options.instructionNameFn(key2, instruction[key2], currentElementName, currentElement) : key2;
|
|
11047
|
+
if (typeof instruction[key2] === "object") {
|
|
11048
11048
|
currentElement = instruction;
|
|
11049
11049
|
currentElementName = instructionName;
|
|
11050
|
-
return "<?" + instructionName + writeAttributes(instruction[
|
|
11050
|
+
return "<?" + instructionName + writeAttributes(instruction[key2][options.attributesKey], options, depth) + "?>";
|
|
11051
11051
|
} else {
|
|
11052
|
-
var instructionValue = instruction[
|
|
11053
|
-
if ("instructionFn" in options) instructionValue = options.instructionFn(instructionValue,
|
|
11052
|
+
var instructionValue = instruction[key2] ? instruction[key2] : "";
|
|
11053
|
+
if ("instructionFn" in options) instructionValue = options.instructionFn(instructionValue, key2, currentElementName, currentElement);
|
|
11054
11054
|
return "<?" + instructionName + (instructionValue ? " " + instructionValue : "") + "?>";
|
|
11055
11055
|
}
|
|
11056
11056
|
}
|
|
@@ -11156,10 +11156,10 @@ function requireJs2xml() {
|
|
|
11156
11156
|
}, "");
|
|
11157
11157
|
}
|
|
11158
11158
|
function hasContentCompact(element, options, anyContent) {
|
|
11159
|
-
var
|
|
11160
|
-
for (
|
|
11161
|
-
if (element.hasOwnProperty(
|
|
11162
|
-
switch (
|
|
11159
|
+
var key2;
|
|
11160
|
+
for (key2 in element) {
|
|
11161
|
+
if (element.hasOwnProperty(key2)) {
|
|
11162
|
+
switch (key2) {
|
|
11163
11163
|
case options.parentKey:
|
|
11164
11164
|
case options.attributesKey:
|
|
11165
11165
|
break;
|
|
@@ -11233,12 +11233,12 @@ function requireJs2xml() {
|
|
|
11233
11233
|
return xml.join("");
|
|
11234
11234
|
}
|
|
11235
11235
|
function writeElementsCompact(element, options, depth, firstLine) {
|
|
11236
|
-
var i,
|
|
11237
|
-
for (
|
|
11238
|
-
if (element.hasOwnProperty(
|
|
11239
|
-
nodes = isArray2(element[
|
|
11236
|
+
var i, key2, nodes, xml = [];
|
|
11237
|
+
for (key2 in element) {
|
|
11238
|
+
if (element.hasOwnProperty(key2)) {
|
|
11239
|
+
nodes = isArray2(element[key2]) ? element[key2] : [element[key2]];
|
|
11240
11240
|
for (i = 0; i < nodes.length; ++i) {
|
|
11241
|
-
switch (
|
|
11241
|
+
switch (key2) {
|
|
11242
11242
|
case options.declarationKey:
|
|
11243
11243
|
xml.push(writeDeclaration(nodes[i], options, depth));
|
|
11244
11244
|
break;
|
|
@@ -11262,7 +11262,7 @@ function requireJs2xml() {
|
|
|
11262
11262
|
xml.push(writeIndentation(options, depth, firstLine) + writeComment(nodes[i], options));
|
|
11263
11263
|
break;
|
|
11264
11264
|
default:
|
|
11265
|
-
xml.push(writeIndentation(options, depth, firstLine) + writeElementCompact(nodes[i],
|
|
11265
|
+
xml.push(writeIndentation(options, depth, firstLine) + writeElementCompact(nodes[i], key2, options, depth, hasContentCompact(nodes[i], options)));
|
|
11266
11266
|
}
|
|
11267
11267
|
firstLine = firstLine && !xml.length;
|
|
11268
11268
|
}
|
|
@@ -11390,10 +11390,10 @@ const isRegExp = (value) => {
|
|
|
11390
11390
|
function objectIncludes(obj1, obj2, options = { strict: true }) {
|
|
11391
11391
|
const keys2 = Object.keys(obj2);
|
|
11392
11392
|
if (!keys2.length) return true;
|
|
11393
|
-
return keys2.every((
|
|
11394
|
-
if (options.strict) return obj2[
|
|
11395
|
-
if (isRegExp(obj2[
|
|
11396
|
-
return obj2[
|
|
11393
|
+
return keys2.every((key2) => {
|
|
11394
|
+
if (options.strict) return obj2[key2] === obj1[key2];
|
|
11395
|
+
if (isRegExp(obj2[key2])) return obj2[key2].test(obj1[key2]);
|
|
11396
|
+
return obj2[key2] === obj1[key2];
|
|
11397
11397
|
});
|
|
11398
11398
|
}
|
|
11399
11399
|
function deleteProps(obj, propOrProps) {
|
|
@@ -11422,27 +11422,27 @@ function OrderedMap(content) {
|
|
|
11422
11422
|
}
|
|
11423
11423
|
OrderedMap.prototype = {
|
|
11424
11424
|
constructor: OrderedMap,
|
|
11425
|
-
find: function(
|
|
11425
|
+
find: function(key2) {
|
|
11426
11426
|
for (var i = 0; i < this.content.length; i += 2)
|
|
11427
|
-
if (this.content[i] ===
|
|
11427
|
+
if (this.content[i] === key2) return i;
|
|
11428
11428
|
return -1;
|
|
11429
11429
|
},
|
|
11430
11430
|
// :: (string) → ?any
|
|
11431
11431
|
// Retrieve the value stored under `key`, or return undefined when
|
|
11432
11432
|
// no such key exists.
|
|
11433
|
-
get: function(
|
|
11434
|
-
var found2 = this.find(
|
|
11433
|
+
get: function(key2) {
|
|
11434
|
+
var found2 = this.find(key2);
|
|
11435
11435
|
return found2 == -1 ? void 0 : this.content[found2 + 1];
|
|
11436
11436
|
},
|
|
11437
11437
|
// :: (string, any, ?string) → OrderedMap
|
|
11438
11438
|
// Create a new map by replacing the value of `key` with a new
|
|
11439
11439
|
// value, or adding a binding to the end of the map. If `newKey` is
|
|
11440
11440
|
// given, the key of the binding will be replaced with that key.
|
|
11441
|
-
update: function(
|
|
11442
|
-
var self2 = newKey && newKey !=
|
|
11443
|
-
var found2 = self2.find(
|
|
11441
|
+
update: function(key2, value, newKey) {
|
|
11442
|
+
var self2 = newKey && newKey != key2 ? this.remove(newKey) : this;
|
|
11443
|
+
var found2 = self2.find(key2), content = self2.content.slice();
|
|
11444
11444
|
if (found2 == -1) {
|
|
11445
|
-
content.push(newKey ||
|
|
11445
|
+
content.push(newKey || key2, value);
|
|
11446
11446
|
} else {
|
|
11447
11447
|
content[found2 + 1] = value;
|
|
11448
11448
|
if (newKey) content[found2] = newKey;
|
|
@@ -11451,8 +11451,8 @@ OrderedMap.prototype = {
|
|
|
11451
11451
|
},
|
|
11452
11452
|
// :: (string) → OrderedMap
|
|
11453
11453
|
// Return a map with the given key removed, if it existed.
|
|
11454
|
-
remove: function(
|
|
11455
|
-
var found2 = this.find(
|
|
11454
|
+
remove: function(key2) {
|
|
11455
|
+
var found2 = this.find(key2);
|
|
11456
11456
|
if (found2 == -1) return this;
|
|
11457
11457
|
var content = this.content.slice();
|
|
11458
11458
|
content.splice(found2, 2);
|
|
@@ -11460,23 +11460,23 @@ OrderedMap.prototype = {
|
|
|
11460
11460
|
},
|
|
11461
11461
|
// :: (string, any) → OrderedMap
|
|
11462
11462
|
// Add a new key to the start of the map.
|
|
11463
|
-
addToStart: function(
|
|
11464
|
-
return new OrderedMap([
|
|
11463
|
+
addToStart: function(key2, value) {
|
|
11464
|
+
return new OrderedMap([key2, value].concat(this.remove(key2).content));
|
|
11465
11465
|
},
|
|
11466
11466
|
// :: (string, any) → OrderedMap
|
|
11467
11467
|
// Add a new key to the end of the map.
|
|
11468
|
-
addToEnd: function(
|
|
11469
|
-
var content = this.remove(
|
|
11470
|
-
content.push(
|
|
11468
|
+
addToEnd: function(key2, value) {
|
|
11469
|
+
var content = this.remove(key2).content.slice();
|
|
11470
|
+
content.push(key2, value);
|
|
11471
11471
|
return new OrderedMap(content);
|
|
11472
11472
|
},
|
|
11473
11473
|
// :: (string, string, any) → OrderedMap
|
|
11474
11474
|
// Add a key after the given key. If `place` is not found, the new
|
|
11475
11475
|
// key is added to the end.
|
|
11476
|
-
addBefore: function(place,
|
|
11477
|
-
var without = this.remove(
|
|
11476
|
+
addBefore: function(place, key2, value) {
|
|
11477
|
+
var without = this.remove(key2), content = without.content.slice();
|
|
11478
11478
|
var found2 = without.find(place);
|
|
11479
|
-
content.splice(found2 == -1 ? content.length : found2, 0,
|
|
11479
|
+
content.splice(found2 == -1 ? content.length : found2, 0, key2, value);
|
|
11480
11480
|
return new OrderedMap(content);
|
|
11481
11481
|
},
|
|
11482
11482
|
// :: ((key: string, value: any))
|
|
@@ -11516,8 +11516,8 @@ OrderedMap.prototype = {
|
|
|
11516
11516
|
// Turn ordered map into a plain object.
|
|
11517
11517
|
toObject: function() {
|
|
11518
11518
|
var result = {};
|
|
11519
|
-
this.forEach(function(
|
|
11520
|
-
result[
|
|
11519
|
+
this.forEach(function(key2, value) {
|
|
11520
|
+
result[key2] = value;
|
|
11521
11521
|
});
|
|
11522
11522
|
return result;
|
|
11523
11523
|
},
|
|
@@ -18832,15 +18832,15 @@ class Transaction extends Transform {
|
|
|
18832
18832
|
Store a metadata property in this transaction, keyed either by
|
|
18833
18833
|
name or by plugin.
|
|
18834
18834
|
*/
|
|
18835
|
-
setMeta(
|
|
18836
|
-
this.meta[typeof
|
|
18835
|
+
setMeta(key2, value) {
|
|
18836
|
+
this.meta[typeof key2 == "string" ? key2 : key2.key] = value;
|
|
18837
18837
|
return this;
|
|
18838
18838
|
}
|
|
18839
18839
|
/**
|
|
18840
18840
|
Retrieve a metadata property for a given name or plugin.
|
|
18841
18841
|
*/
|
|
18842
|
-
getMeta(
|
|
18843
|
-
return this.meta[typeof
|
|
18842
|
+
getMeta(key2) {
|
|
18843
|
+
return this.meta[typeof key2 == "string" ? key2 : key2.key];
|
|
18844
18844
|
}
|
|
18845
18845
|
/**
|
|
18846
18846
|
Returns true if this transaction doesn't contain any metadata,
|
|
@@ -19222,8 +19222,8 @@ function handleListNodes(params2, node) {
|
|
|
19222
19222
|
const currentListByNumId = lists[currentListNumId];
|
|
19223
19223
|
if (!currentListByNumId.levels[iLvl]) currentListByNumId.levels[iLvl] = Number(start2) || 1;
|
|
19224
19224
|
else currentListByNumId.levels[iLvl]++;
|
|
19225
|
-
Object.keys(currentListByNumId.levels).forEach((
|
|
19226
|
-
const level = Number(
|
|
19225
|
+
Object.keys(currentListByNumId.levels).forEach((key2) => {
|
|
19226
|
+
const level = Number(key2);
|
|
19227
19227
|
if (level > iLvl) {
|
|
19228
19228
|
delete currentListByNumId.levels[level];
|
|
19229
19229
|
}
|
|
@@ -19736,8 +19736,8 @@ function _processListRunProperties(data) {
|
|
|
19736
19736
|
elements.forEach((item) => {
|
|
19737
19737
|
if (!expectedTypes.includes(item.name)) ;
|
|
19738
19738
|
const { attributes = {} } = item;
|
|
19739
|
-
Object.keys(attributes).forEach((
|
|
19740
|
-
runProperties[
|
|
19739
|
+
Object.keys(attributes).forEach((key2) => {
|
|
19740
|
+
runProperties[key2] = attributes[key2];
|
|
19741
19741
|
});
|
|
19742
19742
|
});
|
|
19743
19743
|
return runProperties;
|
|
@@ -20916,8 +20916,8 @@ function getSchemaTypeByName(name, schema) {
|
|
|
20916
20916
|
return schema.nodes[name] || schema.marks[name] || null;
|
|
20917
20917
|
}
|
|
20918
20918
|
function cleanSchemaItem(schemaItem) {
|
|
20919
|
-
const entries = Object.entries(schemaItem).filter(([
|
|
20920
|
-
if (
|
|
20919
|
+
const entries = Object.entries(schemaItem).filter(([key2, value]) => {
|
|
20920
|
+
if (key2 === "attrs" && isEmptyObject(value)) {
|
|
20921
20921
|
return false;
|
|
20922
20922
|
}
|
|
20923
20923
|
return value !== null && value !== void 0;
|
|
@@ -21266,11 +21266,11 @@ function getActiveFormatting(editor) {
|
|
|
21266
21266
|
}
|
|
21267
21267
|
const ignoreKeys = ["paragraphSpacing"];
|
|
21268
21268
|
const attributes = getActiveAttributes(state2);
|
|
21269
|
-
Object.keys(attributes).forEach((
|
|
21270
|
-
if (ignoreKeys.includes(
|
|
21269
|
+
Object.keys(attributes).forEach((key2) => {
|
|
21270
|
+
if (ignoreKeys.includes(key2)) return;
|
|
21271
21271
|
const attrs = {};
|
|
21272
|
-
attrs[
|
|
21273
|
-
marksToProcess.push({ name:
|
|
21272
|
+
attrs[key2] = attributes[key2];
|
|
21273
|
+
marksToProcess.push({ name: key2, attrs });
|
|
21274
21274
|
});
|
|
21275
21275
|
const textColor = marksToProcess.find((i) => i.name === "textColor");
|
|
21276
21276
|
const textHightlight = marksToProcess.find((i) => i.name === "textHighlight");
|
|
@@ -21293,9 +21293,9 @@ function getActiveFormatting(editor) {
|
|
|
21293
21293
|
function unwrapTextMarks(textStyleMark) {
|
|
21294
21294
|
const processedMarks = [];
|
|
21295
21295
|
const { attrs } = textStyleMark;
|
|
21296
|
-
Object.keys(attrs).forEach((
|
|
21297
|
-
if (!attrs[
|
|
21298
|
-
processedMarks.push({ name:
|
|
21296
|
+
Object.keys(attrs).forEach((key2) => {
|
|
21297
|
+
if (!attrs[key2]) return;
|
|
21298
|
+
processedMarks.push({ name: key2, attrs: { [key2]: attrs[key2] } });
|
|
21299
21299
|
});
|
|
21300
21300
|
return processedMarks;
|
|
21301
21301
|
}
|
|
@@ -21304,10 +21304,10 @@ function getActiveAttributes(state2) {
|
|
|
21304
21304
|
const { from: from2, to, empty: empty2 } = state2.selection;
|
|
21305
21305
|
const attributes = {};
|
|
21306
21306
|
const getAttrs = (node) => {
|
|
21307
|
-
Object.keys(node.attrs).forEach((
|
|
21308
|
-
const value = node.attrs[
|
|
21307
|
+
Object.keys(node.attrs).forEach((key2) => {
|
|
21308
|
+
const value = node.attrs[key2];
|
|
21309
21309
|
if (value) {
|
|
21310
|
-
attributes[
|
|
21310
|
+
attributes[key2] = value;
|
|
21311
21311
|
}
|
|
21312
21312
|
});
|
|
21313
21313
|
};
|
|
@@ -22539,16 +22539,16 @@ const defaultBooleans = ["required", "readonly", "disabled", "checked", "multipl
|
|
|
22539
22539
|
function updateDOMAttributes(dom, attrs = {}, options = {}) {
|
|
22540
22540
|
const customBooleans = options.customBooleans || [];
|
|
22541
22541
|
const booleans = [...defaultBooleans, ...customBooleans];
|
|
22542
|
-
Object.entries(attrs).forEach(([
|
|
22543
|
-
if (booleans.includes(
|
|
22544
|
-
if (!value) dom.removeAttribute(
|
|
22545
|
-
else dom.setAttribute(
|
|
22542
|
+
Object.entries(attrs).forEach(([key2, value]) => {
|
|
22543
|
+
if (booleans.includes(key2)) {
|
|
22544
|
+
if (!value) dom.removeAttribute(key2);
|
|
22545
|
+
else dom.setAttribute(key2, "");
|
|
22546
22546
|
return;
|
|
22547
22547
|
}
|
|
22548
22548
|
if (value != null) {
|
|
22549
|
-
dom.setAttribute(
|
|
22549
|
+
dom.setAttribute(key2, value);
|
|
22550
22550
|
} else {
|
|
22551
|
-
dom.removeAttribute(
|
|
22551
|
+
dom.removeAttribute(key2);
|
|
22552
22552
|
}
|
|
22553
22553
|
});
|
|
22554
22554
|
}
|
|
@@ -25270,10 +25270,10 @@ function decodeProperties(translatorsBySdName, properties) {
|
|
|
25270
25270
|
return [];
|
|
25271
25271
|
}
|
|
25272
25272
|
const elements = [];
|
|
25273
|
-
Object.keys(properties).forEach((
|
|
25274
|
-
const translator2 = translatorsBySdName[
|
|
25273
|
+
Object.keys(properties).forEach((key2) => {
|
|
25274
|
+
const translator2 = translatorsBySdName[key2];
|
|
25275
25275
|
if (translator2) {
|
|
25276
|
-
const attributes = translator2.decode({ node: { attrs: { [
|
|
25276
|
+
const attributes = translator2.decode({ node: { attrs: { [key2]: properties[key2] } } });
|
|
25277
25277
|
if (attributes != null) {
|
|
25278
25278
|
elements.push({ name: translator2.xmlName, attributes });
|
|
25279
25279
|
}
|
|
@@ -25316,16 +25316,16 @@ const translator$i = NodeTranslator.from({
|
|
|
25316
25316
|
"w:val"
|
|
25317
25317
|
].map((attr) => createAttributeHandler(attr)),
|
|
25318
25318
|
encode: (_2, encodedAttrs) => {
|
|
25319
|
-
Object.keys(encodedAttrs).forEach((
|
|
25320
|
-
encodedAttrs[
|
|
25319
|
+
Object.keys(encodedAttrs).forEach((key2) => {
|
|
25320
|
+
encodedAttrs[key2] = ["1", "true"].includes(encodedAttrs[key2]);
|
|
25321
25321
|
});
|
|
25322
25322
|
return Object.keys(encodedAttrs).length > 0 ? encodedAttrs : void 0;
|
|
25323
25323
|
},
|
|
25324
25324
|
decode: ({ node }) => {
|
|
25325
25325
|
if (!node.attrs?.cnfStyle) return;
|
|
25326
25326
|
const cnfStyleAttrs = {};
|
|
25327
|
-
Object.entries(node.attrs.cnfStyle).forEach(([
|
|
25328
|
-
cnfStyleAttrs[`w:${
|
|
25327
|
+
Object.entries(node.attrs.cnfStyle).forEach(([key2, value]) => {
|
|
25328
|
+
cnfStyleAttrs[`w:${key2}`] = value ? "1" : "0";
|
|
25329
25329
|
});
|
|
25330
25330
|
return Object.keys(cnfStyleAttrs).length > 0 ? cnfStyleAttrs : void 0;
|
|
25331
25331
|
}
|
|
@@ -25949,17 +25949,17 @@ function generateTableCellProperties(node) {
|
|
|
25949
25949
|
if (!!borders && Object.keys(borders).length) {
|
|
25950
25950
|
const cellBordersElement = {
|
|
25951
25951
|
name: "w:tcBorders",
|
|
25952
|
-
elements: Object.entries(borders).map(([
|
|
25952
|
+
elements: Object.entries(borders).map(([key2, value]) => {
|
|
25953
25953
|
if (!value.size || value.val === "none") {
|
|
25954
25954
|
return {
|
|
25955
|
-
name: `w:${
|
|
25955
|
+
name: `w:${key2}`,
|
|
25956
25956
|
attributes: {
|
|
25957
25957
|
"w:val": "nil"
|
|
25958
25958
|
}
|
|
25959
25959
|
};
|
|
25960
25960
|
}
|
|
25961
25961
|
return {
|
|
25962
|
-
name: `w:${
|
|
25962
|
+
name: `w:${key2}`,
|
|
25963
25963
|
attributes: {
|
|
25964
25964
|
"w:val": "single",
|
|
25965
25965
|
"w:color": value.color ? value.color.substring(1) : "auto",
|
|
@@ -26206,8 +26206,8 @@ const parseAnnotationMarks = (content = {}) => {
|
|
|
26206
26206
|
const { type: type2 } = mark;
|
|
26207
26207
|
if (type2 === "textStyle") {
|
|
26208
26208
|
const { attrs: attrs2 } = mark;
|
|
26209
|
-
Object.keys(attrs2).forEach((
|
|
26210
|
-
marksWithFlatFontStyles.push({ type:
|
|
26209
|
+
Object.keys(attrs2).forEach((key2) => {
|
|
26210
|
+
marksWithFlatFontStyles.push({ type: key2, attrs: attrs2[key2] });
|
|
26211
26211
|
});
|
|
26212
26212
|
} else {
|
|
26213
26213
|
marksWithFlatFontStyles.push(mark);
|
|
@@ -27160,8 +27160,8 @@ const extractListLevelStyles = (cssText, listId, level, numId) => {
|
|
|
27160
27160
|
const rawStyles = match[1].split(";").map((line) => line.trim()).filter(Boolean);
|
|
27161
27161
|
const styleMap = {};
|
|
27162
27162
|
for (const style2 of rawStyles) {
|
|
27163
|
-
const [
|
|
27164
|
-
styleMap[
|
|
27163
|
+
const [key2, value] = style2.split(":").map((s) => s.trim());
|
|
27164
|
+
styleMap[key2] = value;
|
|
27165
27165
|
}
|
|
27166
27166
|
return styleMap;
|
|
27167
27167
|
};
|
|
@@ -27328,8 +27328,8 @@ const transformWordLists = (container, editor) => {
|
|
|
27328
27328
|
const currentListByNumId = lists[id];
|
|
27329
27329
|
if (!currentListByNumId.levels[level]) currentListByNumId.levels[level] = Number(start2) || 1;
|
|
27330
27330
|
else currentListByNumId.levels[level]++;
|
|
27331
|
-
Object.keys(currentListByNumId.levels).forEach((
|
|
27332
|
-
const level1 = Number(
|
|
27331
|
+
Object.keys(currentListByNumId.levels).forEach((key2) => {
|
|
27332
|
+
const level1 = Number(key2);
|
|
27333
27333
|
if (level1 > level) {
|
|
27334
27334
|
delete currentListByNumId.levels[level1];
|
|
27335
27335
|
}
|
|
@@ -28046,9 +28046,9 @@ function requireHe() {
|
|
|
28046
28046
|
return defaults;
|
|
28047
28047
|
}
|
|
28048
28048
|
var result = {};
|
|
28049
|
-
var
|
|
28050
|
-
for (
|
|
28051
|
-
result[
|
|
28049
|
+
var key22;
|
|
28050
|
+
for (key22 in defaults) {
|
|
28051
|
+
result[key22] = has(options, key22) ? options[key22] : defaults[key22];
|
|
28052
28052
|
}
|
|
28053
28053
|
return result;
|
|
28054
28054
|
};
|
|
@@ -28221,8 +28221,8 @@ function requireHe() {
|
|
|
28221
28221
|
if (freeModule2) {
|
|
28222
28222
|
freeModule2.exports = he2;
|
|
28223
28223
|
} else {
|
|
28224
|
-
for (var
|
|
28225
|
-
has(he2,
|
|
28224
|
+
for (var key2 in he2) {
|
|
28225
|
+
has(he2, key2) && (freeExports2[key2] = he2[key2]);
|
|
28226
28226
|
}
|
|
28227
28227
|
}
|
|
28228
28228
|
} else {
|
|
@@ -28655,9 +28655,9 @@ function translateBodyNode(params2) {
|
|
|
28655
28655
|
const newMargins = params2.converter.pageStyles.pageMargins;
|
|
28656
28656
|
const sectPrMargins = sectPr.elements.find((n) => n.name === "w:pgMar");
|
|
28657
28657
|
const { attributes } = sectPrMargins;
|
|
28658
|
-
Object.entries(newMargins).forEach(([
|
|
28658
|
+
Object.entries(newMargins).forEach(([key2, value]) => {
|
|
28659
28659
|
const convertedValue = inchesToTwips(value);
|
|
28660
|
-
attributes[`w:${
|
|
28660
|
+
attributes[`w:${key2}`] = convertedValue;
|
|
28661
28661
|
});
|
|
28662
28662
|
sectPrMargins.attributes = attributes;
|
|
28663
28663
|
}
|
|
@@ -28914,9 +28914,9 @@ function getTextNodeForExport(text, marks, params2) {
|
|
|
28914
28914
|
});
|
|
28915
28915
|
if (!isCustomMark) return;
|
|
28916
28916
|
let attrsString = "";
|
|
28917
|
-
Object.entries(mark.attrs).forEach(([
|
|
28917
|
+
Object.entries(mark.attrs).forEach(([key2, value]) => {
|
|
28918
28918
|
if (value) {
|
|
28919
|
-
attrsString += `${
|
|
28919
|
+
attrsString += `${key2}=${value};`;
|
|
28920
28920
|
}
|
|
28921
28921
|
});
|
|
28922
28922
|
if (isCustomMark) {
|
|
@@ -29016,8 +29016,8 @@ function generateRunProps(marks = []) {
|
|
|
29016
29016
|
function processOutputMarks(marks = []) {
|
|
29017
29017
|
return marks.flatMap((mark) => {
|
|
29018
29018
|
if (mark.type === "textStyle") {
|
|
29019
|
-
return Object.entries(mark.attrs).filter(([, value]) => value).map(([
|
|
29020
|
-
const unwrappedMark = { type:
|
|
29019
|
+
return Object.entries(mark.attrs).filter(([, value]) => value).map(([key2]) => {
|
|
29020
|
+
const unwrappedMark = { type: key2, attrs: mark.attrs };
|
|
29021
29021
|
return translateMark(unwrappedMark);
|
|
29022
29022
|
});
|
|
29023
29023
|
} else {
|
|
@@ -29525,9 +29525,9 @@ function translateVRectContentBlock(params2) {
|
|
|
29525
29525
|
if (vmlAttributes.stroked) rectAttrs.stroked = vmlAttributes.stroked;
|
|
29526
29526
|
}
|
|
29527
29527
|
if (attributes) {
|
|
29528
|
-
Object.entries(attributes).forEach(([
|
|
29529
|
-
if (!rectAttrs[
|
|
29530
|
-
rectAttrs[
|
|
29528
|
+
Object.entries(attributes).forEach(([key2, value]) => {
|
|
29529
|
+
if (!rectAttrs[key2] && value !== void 0) {
|
|
29530
|
+
rectAttrs[key2] = value;
|
|
29531
29531
|
}
|
|
29532
29532
|
});
|
|
29533
29533
|
}
|
|
@@ -29558,7 +29558,7 @@ _DocxExporter_instances = /* @__PURE__ */ new WeakSet();
|
|
|
29558
29558
|
generate_xml_as_list_fn = function(data, debug = false) {
|
|
29559
29559
|
const json = JSON.parse(JSON.stringify(data));
|
|
29560
29560
|
const declaration = this.converter.declaration.attributes;
|
|
29561
|
-
const xmlTag = `<?xml${Object.entries(declaration).map(([
|
|
29561
|
+
const xmlTag = `<?xml${Object.entries(declaration).map(([key2, value]) => ` ${key2}="${value}"`).join("")}?>`;
|
|
29562
29562
|
const result = __privateMethod$2(this, _DocxExporter_instances, generateXml_fn).call(this, json, debug);
|
|
29563
29563
|
const final = [xmlTag, ...result];
|
|
29564
29564
|
return final;
|
|
@@ -30059,9 +30059,9 @@ const handleBookmarkNode = (params2) => {
|
|
|
30059
30059
|
const nodeListHandler2 = params2.nodeListHandler;
|
|
30060
30060
|
const attrs = {};
|
|
30061
30061
|
node.attributes["w:name"].split(";").forEach((name) => {
|
|
30062
|
-
const [
|
|
30063
|
-
if (
|
|
30064
|
-
attrs[
|
|
30062
|
+
const [key2, value] = name.split("=");
|
|
30063
|
+
if (key2 && value) {
|
|
30064
|
+
attrs[key2] = value;
|
|
30065
30065
|
}
|
|
30066
30066
|
});
|
|
30067
30067
|
const translatedText = nodeListHandler2.handler({
|
|
@@ -30701,8 +30701,8 @@ const getDefaultStyleDefinition = (defaultStyleId, docx) => {
|
|
|
30701
30701
|
parsedMarks.forEach((mark) => {
|
|
30702
30702
|
const { type: type2, attrs } = mark;
|
|
30703
30703
|
if (type2 === "textStyle") {
|
|
30704
|
-
Object.entries(attrs).forEach(([
|
|
30705
|
-
parsedStyles[kebabCase$1(
|
|
30704
|
+
Object.entries(attrs).forEach(([key2, value]) => {
|
|
30705
|
+
parsedStyles[kebabCase$1(key2)] = value;
|
|
30706
30706
|
});
|
|
30707
30707
|
return;
|
|
30708
30708
|
}
|
|
@@ -31085,11 +31085,11 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
|
|
|
31085
31085
|
});
|
|
31086
31086
|
};
|
|
31087
31087
|
const findSectPr = (obj, result = []) => {
|
|
31088
|
-
for (const
|
|
31089
|
-
if (obj[
|
|
31088
|
+
for (const key2 in obj) {
|
|
31089
|
+
if (obj[key2] === "w:sectPr") {
|
|
31090
31090
|
result.push(obj);
|
|
31091
|
-
} else if (typeof obj[
|
|
31092
|
-
findSectPr(obj[
|
|
31091
|
+
} else if (typeof obj[key2] === "object") {
|
|
31092
|
+
findSectPr(obj[key2], result);
|
|
31093
31093
|
}
|
|
31094
31094
|
}
|
|
31095
31095
|
return result;
|
|
@@ -34263,9 +34263,9 @@ class DocxZipper {
|
|
|
34263
34263
|
const content = file.content;
|
|
34264
34264
|
zip.file(file.name, content);
|
|
34265
34265
|
}
|
|
34266
|
-
Object.keys(updatedDocs).forEach((
|
|
34267
|
-
const content = updatedDocs[
|
|
34268
|
-
zip.file(
|
|
34266
|
+
Object.keys(updatedDocs).forEach((key2) => {
|
|
34267
|
+
const content = updatedDocs[key2];
|
|
34268
|
+
zip.file(key2, content);
|
|
34269
34269
|
});
|
|
34270
34270
|
Object.keys(media).forEach((path) => {
|
|
34271
34271
|
const binaryData = Buffer2.from(media[path], "base64");
|
|
@@ -34294,8 +34294,8 @@ class DocxZipper {
|
|
|
34294
34294
|
filePromises.push(promise);
|
|
34295
34295
|
});
|
|
34296
34296
|
await Promise.all(filePromises);
|
|
34297
|
-
Object.keys(updatedDocs).forEach((
|
|
34298
|
-
unzippedOriginalDocx.file(
|
|
34297
|
+
Object.keys(updatedDocs).forEach((key2) => {
|
|
34298
|
+
unzippedOriginalDocx.file(key2, updatedDocs[key2]);
|
|
34299
34299
|
});
|
|
34300
34300
|
Object.keys(media).forEach((path) => {
|
|
34301
34301
|
unzippedOriginalDocx.file(path, media[path]);
|
|
@@ -34308,8 +34308,8 @@ var __defProp$1 = Object.defineProperty;
|
|
|
34308
34308
|
var __typeError$1 = (msg2) => {
|
|
34309
34309
|
throw TypeError(msg2);
|
|
34310
34310
|
};
|
|
34311
|
-
var __defNormalProp$1 = (obj,
|
|
34312
|
-
var __publicField$1 = (obj,
|
|
34311
|
+
var __defNormalProp$1 = (obj, key2, value) => key2 in obj ? __defProp$1(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value;
|
|
34312
|
+
var __publicField$1 = (obj, key2, value) => __defNormalProp$1(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value);
|
|
34313
34313
|
var __accessCheck$1 = (obj, member, msg2) => member.has(obj) || __typeError$1("Cannot " + msg2);
|
|
34314
34314
|
var __privateGet$1 = (obj, member, getter) => (__accessCheck$1(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
34315
34315
|
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);
|
|
@@ -34963,11 +34963,11 @@ function hasBlockDesc(dom) {
|
|
|
34963
34963
|
const selectionCollapsed = function(domSel) {
|
|
34964
34964
|
return domSel.focusNode && isEquivalentPosition(domSel.focusNode, domSel.focusOffset, domSel.anchorNode, domSel.anchorOffset);
|
|
34965
34965
|
};
|
|
34966
|
-
function keyEvent(keyCode,
|
|
34966
|
+
function keyEvent(keyCode, key2) {
|
|
34967
34967
|
let event = document.createEvent("Event");
|
|
34968
34968
|
event.initEvent("keydown", true, true);
|
|
34969
34969
|
event.keyCode = keyCode;
|
|
34970
|
-
event.key = event.code =
|
|
34970
|
+
event.key = event.code = key2;
|
|
34971
34971
|
return event;
|
|
34972
34972
|
}
|
|
34973
34973
|
function deepActiveElement(doc2) {
|
|
@@ -40215,9 +40215,9 @@ const writeAny = (encoder, data) => {
|
|
|
40215
40215
|
const keys2 = Object.keys(data);
|
|
40216
40216
|
writeVarUint(encoder, keys2.length);
|
|
40217
40217
|
for (let i = 0; i < keys2.length; i++) {
|
|
40218
|
-
const
|
|
40219
|
-
writeVarString(encoder,
|
|
40220
|
-
writeAny(encoder, data[
|
|
40218
|
+
const key2 = keys2[i];
|
|
40219
|
+
writeVarString(encoder, key2);
|
|
40220
|
+
writeAny(encoder, data[key2]);
|
|
40221
40221
|
}
|
|
40222
40222
|
}
|
|
40223
40223
|
break;
|
|
@@ -40236,17 +40236,17 @@ const unexpectedCase = () => {
|
|
|
40236
40236
|
throw create$1("Unexpected case");
|
|
40237
40237
|
};
|
|
40238
40238
|
const create = () => /* @__PURE__ */ new Map();
|
|
40239
|
-
const setIfUndefined = (map22,
|
|
40240
|
-
let set = map22.get(
|
|
40239
|
+
const setIfUndefined = (map22, key2, createT) => {
|
|
40240
|
+
let set = map22.get(key2);
|
|
40241
40241
|
if (set === void 0) {
|
|
40242
|
-
map22.set(
|
|
40242
|
+
map22.set(key2, set = createT());
|
|
40243
40243
|
}
|
|
40244
40244
|
return set;
|
|
40245
40245
|
};
|
|
40246
40246
|
const keys$1 = Object.keys;
|
|
40247
40247
|
const every = (obj, f) => {
|
|
40248
|
-
for (const
|
|
40249
|
-
if (!f(obj[
|
|
40248
|
+
for (const key2 in obj) {
|
|
40249
|
+
if (!f(obj[key2], key2)) {
|
|
40250
40250
|
return false;
|
|
40251
40251
|
}
|
|
40252
40252
|
}
|
|
@@ -40302,14 +40302,14 @@ class VarStoragePolyfill {
|
|
|
40302
40302
|
* @param {string} key
|
|
40303
40303
|
* @param {any} newValue
|
|
40304
40304
|
*/
|
|
40305
|
-
setItem(
|
|
40306
|
-
this.map.set(
|
|
40305
|
+
setItem(key2, newValue) {
|
|
40306
|
+
this.map.set(key2, newValue);
|
|
40307
40307
|
}
|
|
40308
40308
|
/**
|
|
40309
40309
|
* @param {string} key
|
|
40310
40310
|
*/
|
|
40311
|
-
getItem(
|
|
40312
|
-
return this.map.get(
|
|
40311
|
+
getItem(key2) {
|
|
40312
|
+
return this.map.get(key2);
|
|
40313
40313
|
}
|
|
40314
40314
|
}
|
|
40315
40315
|
let _localStorage = new VarStoragePolyfill();
|
|
@@ -40352,9 +40352,9 @@ const computeParams = () => {
|
|
|
40352
40352
|
params = create();
|
|
40353
40353
|
(location.search || "?").slice(1).split("&").forEach((kv) => {
|
|
40354
40354
|
if (kv.length !== 0) {
|
|
40355
|
-
const [
|
|
40356
|
-
params.set(`--${fromCamelCase(
|
|
40357
|
-
params.set(`-${fromCamelCase(
|
|
40355
|
+
const [key2, value] = kv.split("=");
|
|
40356
|
+
params.set(`--${fromCamelCase(key2, "-")}`, value);
|
|
40357
|
+
params.set(`-${fromCamelCase(key2, "-")}`, value);
|
|
40358
40358
|
}
|
|
40359
40359
|
});
|
|
40360
40360
|
} else {
|
|
@@ -40637,8 +40637,8 @@ const ySyncPlugin = (yXmlFragment, {
|
|
|
40637
40637
|
const change = tr.getMeta(ySyncPluginKey);
|
|
40638
40638
|
if (change !== void 0) {
|
|
40639
40639
|
pluginState = Object.assign({}, pluginState);
|
|
40640
|
-
for (const
|
|
40641
|
-
pluginState[
|
|
40640
|
+
for (const key2 in change) {
|
|
40641
|
+
pluginState[key2] = change[key2];
|
|
40642
40642
|
}
|
|
40643
40643
|
}
|
|
40644
40644
|
pluginState.addToHistory = tr.getMeta("addToHistory") !== false;
|
|
@@ -40910,7 +40910,7 @@ class ProsemirrorBinding {
|
|
|
40910
40910
|
snapshot = Y.snapshot(historyDoc);
|
|
40911
40911
|
if (historyType._item === null) {
|
|
40912
40912
|
const rootKey = Array.from(this.doc.share.keys()).find(
|
|
40913
|
-
(
|
|
40913
|
+
(key2) => this.doc.share.get(key2) === this.type
|
|
40914
40914
|
);
|
|
40915
40915
|
historyType = historyDoc.getXmlFragment(rootKey);
|
|
40916
40916
|
} else {
|
|
@@ -41199,10 +41199,10 @@ const createTypeFromTextNodes = (nodes, meta) => {
|
|
|
41199
41199
|
};
|
|
41200
41200
|
const createTypeFromElementNode = (node, meta) => {
|
|
41201
41201
|
const type2 = new Y.XmlElement(node.type.name);
|
|
41202
|
-
for (const
|
|
41203
|
-
const val = node.attrs[
|
|
41204
|
-
if (val !== null &&
|
|
41205
|
-
type2.setAttribute(
|
|
41202
|
+
for (const key2 in node.attrs) {
|
|
41203
|
+
const val = node.attrs[key2];
|
|
41204
|
+
if (val !== null && key2 !== "ychange") {
|
|
41205
|
+
type2.setAttribute(key2, val);
|
|
41206
41206
|
}
|
|
41207
41207
|
}
|
|
41208
41208
|
type2.insert(
|
|
@@ -41217,13 +41217,13 @@ const createTypeFromElementNode = (node, meta) => {
|
|
|
41217
41217
|
const createTypeFromTextOrElementNode = (node, meta) => node instanceof Array ? createTypeFromTextNodes(node, meta) : createTypeFromElementNode(node, meta);
|
|
41218
41218
|
const isObject$1 = (val) => typeof val === "object" && val !== null;
|
|
41219
41219
|
const equalAttrs = (pattrs, yattrs) => {
|
|
41220
|
-
const keys2 = Object.keys(pattrs).filter((
|
|
41221
|
-
let eq2 = keys2.length === (yattrs == null ? 0 : Object.keys(yattrs).filter((
|
|
41220
|
+
const keys2 = Object.keys(pattrs).filter((key2) => pattrs[key2] !== null);
|
|
41221
|
+
let eq2 = keys2.length === (yattrs == null ? 0 : Object.keys(yattrs).filter((key2) => yattrs[key2] !== null).length);
|
|
41222
41222
|
for (let i = 0; i < keys2.length && eq2; i++) {
|
|
41223
|
-
const
|
|
41224
|
-
const l3 = pattrs[
|
|
41225
|
-
const r2 = yattrs[
|
|
41226
|
-
eq2 =
|
|
41223
|
+
const key2 = keys2[i];
|
|
41224
|
+
const l3 = pattrs[key2];
|
|
41225
|
+
const r2 = yattrs[key2];
|
|
41226
|
+
eq2 = key2 === "ychange" || l3 === r2 || isObject$1(l3) && isObject$1(r2) && equalAttrs(l3, r2);
|
|
41227
41227
|
}
|
|
41228
41228
|
return eq2;
|
|
41229
41229
|
};
|
|
@@ -41370,18 +41370,18 @@ const updateYFragment = (y2, yDomFragment, pNode, meta) => {
|
|
|
41370
41370
|
if (yDomFragment instanceof Y.XmlElement) {
|
|
41371
41371
|
const yDomAttrs = yDomFragment.getAttributes();
|
|
41372
41372
|
const pAttrs = pNode.attrs;
|
|
41373
|
-
for (const
|
|
41374
|
-
if (pAttrs[
|
|
41375
|
-
if (yDomAttrs[
|
|
41376
|
-
yDomFragment.setAttribute(
|
|
41373
|
+
for (const key2 in pAttrs) {
|
|
41374
|
+
if (pAttrs[key2] !== null) {
|
|
41375
|
+
if (yDomAttrs[key2] !== pAttrs[key2] && key2 !== "ychange") {
|
|
41376
|
+
yDomFragment.setAttribute(key2, pAttrs[key2]);
|
|
41377
41377
|
}
|
|
41378
41378
|
} else {
|
|
41379
|
-
yDomFragment.removeAttribute(
|
|
41379
|
+
yDomFragment.removeAttribute(key2);
|
|
41380
41380
|
}
|
|
41381
41381
|
}
|
|
41382
|
-
for (const
|
|
41383
|
-
if (pAttrs[
|
|
41384
|
-
yDomFragment.removeAttribute(
|
|
41382
|
+
for (const key2 in yDomAttrs) {
|
|
41383
|
+
if (pAttrs[key2] === void 0) {
|
|
41384
|
+
yDomFragment.removeAttribute(key2);
|
|
41385
41385
|
}
|
|
41386
41386
|
}
|
|
41387
41387
|
}
|
|
@@ -41512,19 +41512,19 @@ const updateMetas = () => {
|
|
|
41512
41512
|
const tr = view.state.tr;
|
|
41513
41513
|
const syncState = ySyncPluginKey.getState(view.state);
|
|
41514
41514
|
if (syncState && syncState.binding && !syncState.binding.isDestroyed) {
|
|
41515
|
-
metas.forEach((val,
|
|
41516
|
-
tr.setMeta(
|
|
41515
|
+
metas.forEach((val, key2) => {
|
|
41516
|
+
tr.setMeta(key2, val);
|
|
41517
41517
|
});
|
|
41518
41518
|
view.dispatch(tr);
|
|
41519
41519
|
}
|
|
41520
41520
|
});
|
|
41521
41521
|
};
|
|
41522
|
-
const setMeta$1 = (view,
|
|
41522
|
+
const setMeta$1 = (view, key2, value) => {
|
|
41523
41523
|
if (!viewsToUpdate) {
|
|
41524
41524
|
viewsToUpdate = /* @__PURE__ */ new Map();
|
|
41525
41525
|
timeout(0, updateMetas);
|
|
41526
41526
|
}
|
|
41527
|
-
setIfUndefined(viewsToUpdate, view, create).set(
|
|
41527
|
+
setIfUndefined(viewsToUpdate, view, create).set(key2, value);
|
|
41528
41528
|
};
|
|
41529
41529
|
const absolutePositionToRelativePosition = (pos, type2, mapping) => {
|
|
41530
41530
|
if (pos === 0) {
|
|
@@ -42216,21 +42216,21 @@ class Attribute2 {
|
|
|
42216
42216
|
let attrs = {};
|
|
42217
42217
|
for (const item of items) {
|
|
42218
42218
|
const mergedAttributes = { ...attrs };
|
|
42219
|
-
for (const [
|
|
42220
|
-
const exists2 = mergedAttributes[
|
|
42219
|
+
for (const [key2, value] of Object.entries(item)) {
|
|
42220
|
+
const exists2 = mergedAttributes[key2];
|
|
42221
42221
|
if (!exists2) {
|
|
42222
|
-
mergedAttributes[
|
|
42222
|
+
mergedAttributes[key2] = value;
|
|
42223
42223
|
continue;
|
|
42224
42224
|
}
|
|
42225
|
-
if (
|
|
42225
|
+
if (key2 === "class") {
|
|
42226
42226
|
const valueClasses = value ? value.split(" ") : [];
|
|
42227
|
-
const existingClasses = mergedAttributes[
|
|
42227
|
+
const existingClasses = mergedAttributes[key2] ? mergedAttributes[key2].split(" ") : [];
|
|
42228
42228
|
const insertClasses = valueClasses.filter((value2) => !existingClasses.includes(value2));
|
|
42229
|
-
mergedAttributes[
|
|
42230
|
-
} else if (
|
|
42231
|
-
mergedAttributes[
|
|
42229
|
+
mergedAttributes[key2] = [...existingClasses, ...insertClasses].join(" ");
|
|
42230
|
+
} else if (key2 === "style") {
|
|
42231
|
+
mergedAttributes[key2] = [mergedAttributes[key2], value].join("; ");
|
|
42232
42232
|
} else {
|
|
42233
|
-
mergedAttributes[
|
|
42233
|
+
mergedAttributes[key2] = value;
|
|
42234
42234
|
}
|
|
42235
42235
|
}
|
|
42236
42236
|
attrs = mergedAttributes;
|
|
@@ -42539,8 +42539,8 @@ const insertTabNode = () => ({ tr, state: state2, dispatch }) => {
|
|
|
42539
42539
|
if (dispatch) dispatch(tr);
|
|
42540
42540
|
return true;
|
|
42541
42541
|
};
|
|
42542
|
-
const setMeta = (
|
|
42543
|
-
tr.setMeta(
|
|
42542
|
+
const setMeta = (key2, value) => ({ tr }) => {
|
|
42543
|
+
tr.setMeta(key2, value);
|
|
42544
42544
|
return true;
|
|
42545
42545
|
};
|
|
42546
42546
|
const ensureMarks = (state2, splittableMarks) => {
|
|
@@ -45659,14 +45659,14 @@ const updateYdocDocxData = async (editor, ydoc) => {
|
|
|
45659
45659
|
const metaMap = ydoc.getMap("meta");
|
|
45660
45660
|
const docx = [...metaMap.get("docx")];
|
|
45661
45661
|
const newXml = await editor.exportDocx({ getUpdatedDocs: true });
|
|
45662
|
-
Object.keys(newXml).forEach((
|
|
45663
|
-
const fileIndex = docx.findIndex((item) => item.name ===
|
|
45662
|
+
Object.keys(newXml).forEach((key2) => {
|
|
45663
|
+
const fileIndex = docx.findIndex((item) => item.name === key2);
|
|
45664
45664
|
if (fileIndex > -1) {
|
|
45665
45665
|
docx.splice(fileIndex, 1);
|
|
45666
45666
|
}
|
|
45667
45667
|
docx.push({
|
|
45668
|
-
name:
|
|
45669
|
-
content: newXml[
|
|
45668
|
+
name: key2,
|
|
45669
|
+
content: newXml[key2]
|
|
45670
45670
|
});
|
|
45671
45671
|
});
|
|
45672
45672
|
ydoc.transact(
|
|
@@ -45682,8 +45682,8 @@ const initPaginationData = async (editor) => {
|
|
|
45682
45682
|
const sectionData = { headers: {}, footers: {} };
|
|
45683
45683
|
const headerIds = editor.converter.headerIds.ids;
|
|
45684
45684
|
const footerIds = editor.converter.footerIds.ids;
|
|
45685
|
-
for (let
|
|
45686
|
-
const sectionId = headerIds[
|
|
45685
|
+
for (let key2 in headerIds) {
|
|
45686
|
+
const sectionId = headerIds[key2];
|
|
45687
45687
|
if (!sectionId) continue;
|
|
45688
45688
|
const dataForThisSection = editor.converter.headers[sectionId];
|
|
45689
45689
|
if (!sectionData.headers[sectionId]) sectionData.headers[sectionId] = {};
|
|
@@ -45693,8 +45693,8 @@ const initPaginationData = async (editor) => {
|
|
|
45693
45693
|
sectionData.headers[sectionId].sectionEditor = sectionEditor;
|
|
45694
45694
|
sectionData.headers[sectionId].sectionContainer = sectionContainer;
|
|
45695
45695
|
}
|
|
45696
|
-
for (let
|
|
45697
|
-
const sectionId = footerIds[
|
|
45696
|
+
for (let key2 in footerIds) {
|
|
45697
|
+
const sectionId = footerIds[key2];
|
|
45698
45698
|
if (!sectionId) continue;
|
|
45699
45699
|
const dataForThisSection = editor.converter.footers[sectionId];
|
|
45700
45700
|
if (!sectionData.headers[sectionId]) sectionData.footers[sectionId] = {};
|
|
@@ -46763,16 +46763,16 @@ const generateTableIfNecessary = ({ tableNode, annotationValues, tr, state: stat
|
|
|
46763
46763
|
if (rowsToGenerate <= 1) return;
|
|
46764
46764
|
const validateAttributes = (attrs) => {
|
|
46765
46765
|
const cleaned = {};
|
|
46766
|
-
for (const [
|
|
46766
|
+
for (const [key2, value] of Object.entries(attrs)) {
|
|
46767
46767
|
if (value !== void 0 && value !== null) {
|
|
46768
|
-
if (
|
|
46769
|
-
cleaned[
|
|
46770
|
-
} else if (
|
|
46771
|
-
cleaned[
|
|
46768
|
+
if (key2 === "displayLabel") {
|
|
46769
|
+
cleaned[key2] = String(value);
|
|
46770
|
+
} else if (key2 === "rawHtml" || key2 === "linkUrl" || key2 === "imageSrc") {
|
|
46771
|
+
cleaned[key2] = String(value);
|
|
46772
46772
|
} else if (typeof value === "string" && value.length > 0) {
|
|
46773
|
-
cleaned[
|
|
46773
|
+
cleaned[key2] = value;
|
|
46774
46774
|
} else if (typeof value !== "string") {
|
|
46775
|
-
cleaned[
|
|
46775
|
+
cleaned[key2] = value;
|
|
46776
46776
|
}
|
|
46777
46777
|
}
|
|
46778
46778
|
}
|
|
@@ -47050,10 +47050,10 @@ const Collaboration = Extension.create({
|
|
|
47050
47050
|
this.options.fragment = fragment;
|
|
47051
47051
|
const metaMap = this.options.ydoc.getMap("media");
|
|
47052
47052
|
metaMap.observe((event) => {
|
|
47053
|
-
event.changes.keys.forEach((_2,
|
|
47054
|
-
if (!(
|
|
47055
|
-
const fileData = metaMap.get(
|
|
47056
|
-
this.editor.storage.image.media[
|
|
47053
|
+
event.changes.keys.forEach((_2, key2) => {
|
|
47054
|
+
if (!(key2 in this.editor.storage.image.media)) {
|
|
47055
|
+
const fileData = metaMap.get(key2);
|
|
47056
|
+
this.editor.storage.image.media[key2] = fileData;
|
|
47057
47057
|
}
|
|
47058
47058
|
});
|
|
47059
47059
|
});
|
|
@@ -47073,8 +47073,8 @@ const initializeMetaMap = (ydoc, editor) => {
|
|
|
47073
47073
|
metaMap.set("docx", editor.options.content);
|
|
47074
47074
|
metaMap.set("fonts", editor.options.fonts);
|
|
47075
47075
|
const mediaMap = ydoc.getMap("media");
|
|
47076
|
-
Object.entries(editor.options.mediaFiles).forEach(([
|
|
47077
|
-
mediaMap.set(
|
|
47076
|
+
Object.entries(editor.options.mediaFiles).forEach(([key2, value]) => {
|
|
47077
|
+
mediaMap.set(key2, value);
|
|
47078
47078
|
});
|
|
47079
47079
|
};
|
|
47080
47080
|
const checkDocxChanged = (transaction) => {
|
|
@@ -47836,8 +47836,8 @@ function processRelationships(root2, convertedXml, results) {
|
|
|
47836
47836
|
};
|
|
47837
47837
|
const seenIds = /* @__PURE__ */ new Set();
|
|
47838
47838
|
const filtered = [];
|
|
47839
|
-
function extractStringAttr(attrs,
|
|
47840
|
-
return typeof attrs[
|
|
47839
|
+
function extractStringAttr(attrs, key2) {
|
|
47840
|
+
return typeof attrs[key2] === "string" ? attrs[key2].trim() : "";
|
|
47841
47841
|
}
|
|
47842
47842
|
for (const rel of root2.elements) {
|
|
47843
47843
|
rel.attributes = rel.attributes || {};
|
|
@@ -48054,10 +48054,10 @@ class SuperValidator {
|
|
|
48054
48054
|
this.logger.debug("Document analysis:", documentAnalysis);
|
|
48055
48055
|
let hasModifiedDocument = false;
|
|
48056
48056
|
const validationResults = [];
|
|
48057
|
-
Object.entries(__privateGet$1(this, _stateValidators)).forEach(([
|
|
48058
|
-
this.logger.debug(`🕵 Validating with ${
|
|
48057
|
+
Object.entries(__privateGet$1(this, _stateValidators)).forEach(([key2, validator]) => {
|
|
48058
|
+
this.logger.debug(`🕵 Validating with ${key2}...`);
|
|
48059
48059
|
const { results, modified } = validator(tr, documentAnalysis);
|
|
48060
|
-
validationResults.push({ key, results });
|
|
48060
|
+
validationResults.push({ key: key2, results });
|
|
48061
48061
|
hasModifiedDocument = hasModifiedDocument || modified;
|
|
48062
48062
|
});
|
|
48063
48063
|
if (!this.dryRun) dispatch(tr);
|
|
@@ -48074,10 +48074,10 @@ class SuperValidator {
|
|
|
48074
48074
|
const { dispatch } = __privateGet$1(this, _editor).view;
|
|
48075
48075
|
let hasModifiedDocument = false;
|
|
48076
48076
|
const validationResults = [];
|
|
48077
|
-
Object.entries(__privateGet$1(this, _xmlValidators)).forEach(([
|
|
48078
|
-
this.logger.debug(`🕵 Validating export with ${
|
|
48077
|
+
Object.entries(__privateGet$1(this, _xmlValidators)).forEach(([key2, validator]) => {
|
|
48078
|
+
this.logger.debug(`🕵 Validating export with ${key2}...`);
|
|
48079
48079
|
const { results, modified } = validator();
|
|
48080
|
-
validationResults.push({ key, results });
|
|
48080
|
+
validationResults.push({ key: key2, results });
|
|
48081
48081
|
hasModifiedDocument = hasModifiedDocument || modified;
|
|
48082
48082
|
});
|
|
48083
48083
|
if (!this.dryRun && hasModifiedDocument) dispatch(tr);
|
|
@@ -48097,11 +48097,11 @@ initializeValidators_fn = function() {
|
|
|
48097
48097
|
const requiredMarks = /* @__PURE__ */ new Set();
|
|
48098
48098
|
const initializeValidatorSet = (validatorFactories) => {
|
|
48099
48099
|
return Object.fromEntries(
|
|
48100
|
-
Object.entries(validatorFactories).map(([
|
|
48101
|
-
const validatorLogger = this.logger.withPrefix(
|
|
48100
|
+
Object.entries(validatorFactories).map(([key2, factory]) => {
|
|
48101
|
+
const validatorLogger = this.logger.withPrefix(key2);
|
|
48102
48102
|
const validator = factory({ editor: __privateGet$1(this, _editor), logger: validatorLogger });
|
|
48103
48103
|
__privateMethod$1(this, _SuperValidator_instances, collectValidatorRequirements_fn).call(this, validator, requiredNodes, requiredMarks);
|
|
48104
|
-
return [
|
|
48104
|
+
return [key2, validator];
|
|
48105
48105
|
})
|
|
48106
48106
|
);
|
|
48107
48107
|
};
|
|
@@ -49331,8 +49331,8 @@ initMedia_fn = function() {
|
|
|
49331
49331
|
if (!this.options.ydoc) return this.storage.image.media = this.options.mediaFiles;
|
|
49332
49332
|
const mediaMap = this.options.ydoc.getMap("media");
|
|
49333
49333
|
if (this.options.isNewFile) {
|
|
49334
|
-
Object.entries(this.options.mediaFiles).forEach(([
|
|
49335
|
-
mediaMap.set(
|
|
49334
|
+
Object.entries(this.options.mediaFiles).forEach(([key2, value]) => {
|
|
49335
|
+
mediaMap.set(key2, value);
|
|
49336
49336
|
});
|
|
49337
49337
|
this.storage.image.media = this.options.mediaFiles;
|
|
49338
49338
|
} else {
|
|
@@ -50157,11 +50157,11 @@ const FormatCommands = Extension.create({
|
|
|
50157
50157
|
const { type: type2, attrs } = mark;
|
|
50158
50158
|
const { name } = type2;
|
|
50159
50159
|
if (name === "textStyle") {
|
|
50160
|
-
Object.keys(attrs).forEach((
|
|
50161
|
-
if (!attrs[
|
|
50160
|
+
Object.keys(attrs).forEach((key2) => {
|
|
50161
|
+
if (!attrs[key2]) return;
|
|
50162
50162
|
const attributes = {};
|
|
50163
|
-
attributes[
|
|
50164
|
-
processedMarks.push({ name:
|
|
50163
|
+
attributes[key2] = attrs[key2];
|
|
50164
|
+
processedMarks.push({ name: key2, attrs: attributes });
|
|
50165
50165
|
});
|
|
50166
50166
|
} else {
|
|
50167
50167
|
processedMarks.push({ name, attrs });
|
|
@@ -50176,13 +50176,13 @@ const FormatCommands = Extension.create({
|
|
|
50176
50176
|
fontFamily: ["setFontFamily", "unsetFontFamily"]
|
|
50177
50177
|
};
|
|
50178
50178
|
let result = chain();
|
|
50179
|
-
Object.keys(marksToCommands).forEach((
|
|
50180
|
-
const [setCommand, unsetCommand, defaultParam] = marksToCommands[
|
|
50181
|
-
const markToApply = processedMarks.find((mark) => mark.name ===
|
|
50182
|
-
const hasEmptyAttrs = markToApply?.attrs && markToApply?.attrs[
|
|
50179
|
+
Object.keys(marksToCommands).forEach((key2) => {
|
|
50180
|
+
const [setCommand, unsetCommand, defaultParam] = marksToCommands[key2];
|
|
50181
|
+
const markToApply = processedMarks.find((mark) => mark.name === key2);
|
|
50182
|
+
const hasEmptyAttrs = markToApply?.attrs && markToApply?.attrs[key2];
|
|
50183
50183
|
let cmd = {};
|
|
50184
50184
|
if (!markToApply && !hasEmptyAttrs) cmd = { command: unsetCommand, argument: defaultParam };
|
|
50185
|
-
else cmd = { command: setCommand, argument: markToApply.attrs[
|
|
50185
|
+
else cmd = { command: setCommand, argument: markToApply.attrs[key2] || defaultParam };
|
|
50186
50186
|
result = result[cmd.command](cmd.argument);
|
|
50187
50187
|
});
|
|
50188
50188
|
this.storage.storedStyle = null;
|
|
@@ -51686,7 +51686,7 @@ const generateLinkedStyleString = (linkedStyle, basedOnStyle, node, parent, incl
|
|
|
51686
51686
|
resultStyles["text-transform"] = basedOnDefinitionStyles["text-transform"];
|
|
51687
51687
|
}
|
|
51688
51688
|
Object.entries(resultStyles).forEach(([k, value]) => {
|
|
51689
|
-
const
|
|
51689
|
+
const key2 = kebabCase$1(k);
|
|
51690
51690
|
const flattenedMarks = [];
|
|
51691
51691
|
node?.marks?.forEach((n) => {
|
|
51692
51692
|
if (n.type.name === "textStyle") {
|
|
@@ -51697,46 +51697,46 @@ const generateLinkedStyleString = (linkedStyle, basedOnStyle, node, parent, incl
|
|
|
51697
51697
|
});
|
|
51698
51698
|
return;
|
|
51699
51699
|
}
|
|
51700
|
-
flattenedMarks.push({ key: n.type.name, value: n.attrs[
|
|
51700
|
+
flattenedMarks.push({ key: n.type.name, value: n.attrs[key2] });
|
|
51701
51701
|
});
|
|
51702
|
-
const mark = flattenedMarks.find((n) => n.key ===
|
|
51702
|
+
const mark = flattenedMarks.find((n) => n.key === key2);
|
|
51703
51703
|
const hasParentIndent = Object.keys(parent?.attrs?.indent || {});
|
|
51704
51704
|
const hasParentSpacing = Object.keys(parent?.attrs?.spacing || {});
|
|
51705
51705
|
const listTypes = ["orderedList", "listItem"];
|
|
51706
51706
|
if (!mark) {
|
|
51707
|
-
if (
|
|
51707
|
+
if (key2 === "spacing" && includeSpacing && !hasParentSpacing) {
|
|
51708
51708
|
const space = getSpacingStyle(value);
|
|
51709
51709
|
Object.entries(space).forEach(([k2, v2]) => {
|
|
51710
51710
|
markValue[k2] = v2;
|
|
51711
51711
|
});
|
|
51712
|
-
} else if (
|
|
51712
|
+
} else if (key2 === "indent" && includeSpacing && !hasParentIndent) {
|
|
51713
51713
|
const { leftIndent, rightIndent, firstLine } = value;
|
|
51714
51714
|
if (leftIndent) markValue["margin-left"] = leftIndent + "px";
|
|
51715
51715
|
if (rightIndent) markValue["margin-right"] = rightIndent + "px";
|
|
51716
51716
|
if (firstLine) markValue["text-indent"] = firstLine + "px";
|
|
51717
|
-
} else if (
|
|
51717
|
+
} else if (key2 === "bold" && node) {
|
|
51718
51718
|
const val = value?.value;
|
|
51719
51719
|
if (!listTypes.includes(node.type.name) && val !== "0") {
|
|
51720
51720
|
markValue["font-weight"] = "bold";
|
|
51721
51721
|
}
|
|
51722
|
-
} else if (
|
|
51722
|
+
} else if (key2 === "text-transform" && node) {
|
|
51723
51723
|
if (!listTypes.includes(node.type.name)) {
|
|
51724
|
-
markValue[
|
|
51724
|
+
markValue[key2] = value;
|
|
51725
51725
|
}
|
|
51726
|
-
} else if (
|
|
51726
|
+
} else if (key2 === "font-size" && node) {
|
|
51727
51727
|
if (!listTypes.includes(node.type.name)) {
|
|
51728
|
-
markValue[
|
|
51728
|
+
markValue[key2] = value;
|
|
51729
51729
|
}
|
|
51730
|
-
} else if (
|
|
51730
|
+
} else if (key2 === "color" && node) {
|
|
51731
51731
|
if (!listTypes.includes(node.type.name)) {
|
|
51732
|
-
markValue[
|
|
51732
|
+
markValue[key2] = value;
|
|
51733
51733
|
}
|
|
51734
51734
|
} else if (typeof value === "string") {
|
|
51735
|
-
markValue[
|
|
51735
|
+
markValue[key2] = value;
|
|
51736
51736
|
}
|
|
51737
51737
|
}
|
|
51738
51738
|
});
|
|
51739
|
-
const final = Object.entries(markValue).map(([
|
|
51739
|
+
const final = Object.entries(markValue).map(([key2, value]) => `${key2}: ${value}`).join(";");
|
|
51740
51740
|
return final;
|
|
51741
51741
|
};
|
|
51742
51742
|
const applyLinkedStyleToTransaction = (tr, editor, style2) => {
|
|
@@ -52431,7 +52431,7 @@ function orderedListSync(editor) {
|
|
|
52431
52431
|
listNumberingType,
|
|
52432
52432
|
customFormat
|
|
52433
52433
|
};
|
|
52434
|
-
const keysChanged = Object.keys(updatedAttrs).some((
|
|
52434
|
+
const keysChanged = Object.keys(updatedAttrs).some((key2) => node.attrs[key2] !== updatedAttrs[key2]);
|
|
52435
52435
|
if (keysChanged) {
|
|
52436
52436
|
tr.setNodeMarkup(pos, void 0, updatedAttrs);
|
|
52437
52437
|
}
|
|
@@ -53558,11 +53558,11 @@ function updateTable(editor, node, table) {
|
|
|
53558
53558
|
const allExtensionsAttrs = editor.extensionService.attributes;
|
|
53559
53559
|
const tableExtensionAttrs = allExtensionsAttrs.filter((e) => e.type === "table");
|
|
53560
53560
|
const htmlAttributes = Attribute2.getAttributesToRender(node, tableExtensionAttrs);
|
|
53561
|
-
Object.entries(htmlAttributes).forEach(([
|
|
53562
|
-
if (
|
|
53561
|
+
Object.entries(htmlAttributes).forEach(([key2, value]) => {
|
|
53562
|
+
if (key2 === "style") {
|
|
53563
53563
|
table.style.cssText = value;
|
|
53564
53564
|
} else {
|
|
53565
|
-
table.setAttribute(
|
|
53565
|
+
table.setAttribute(key2, value);
|
|
53566
53566
|
}
|
|
53567
53567
|
});
|
|
53568
53568
|
}
|
|
@@ -53634,22 +53634,22 @@ var readFromCache;
|
|
|
53634
53634
|
var addToCache;
|
|
53635
53635
|
if (typeof WeakMap != "undefined") {
|
|
53636
53636
|
let cache2 = /* @__PURE__ */ new WeakMap();
|
|
53637
|
-
readFromCache = (
|
|
53638
|
-
addToCache = (
|
|
53639
|
-
cache2.set(
|
|
53637
|
+
readFromCache = (key2) => cache2.get(key2);
|
|
53638
|
+
addToCache = (key2, value) => {
|
|
53639
|
+
cache2.set(key2, value);
|
|
53640
53640
|
return value;
|
|
53641
53641
|
};
|
|
53642
53642
|
} else {
|
|
53643
53643
|
const cache2 = [];
|
|
53644
53644
|
const cacheSize = 10;
|
|
53645
53645
|
let cachePos = 0;
|
|
53646
|
-
readFromCache = (
|
|
53646
|
+
readFromCache = (key2) => {
|
|
53647
53647
|
for (let i = 0; i < cache2.length; i += 2)
|
|
53648
|
-
if (cache2[i] ==
|
|
53648
|
+
if (cache2[i] == key2) return cache2[i + 1];
|
|
53649
53649
|
};
|
|
53650
|
-
addToCache = (
|
|
53650
|
+
addToCache = (key2, value) => {
|
|
53651
53651
|
if (cachePos == cacheSize) cachePos = 0;
|
|
53652
|
-
cache2[cachePos++] =
|
|
53652
|
+
cache2[cachePos++] = key2;
|
|
53653
53653
|
return cache2[cachePos++] = value;
|
|
53654
53654
|
};
|
|
53655
53655
|
}
|
|
@@ -55883,8 +55883,8 @@ const Table = Node$1.create({
|
|
|
55883
55883
|
default: {},
|
|
55884
55884
|
renderDOM({ borders }) {
|
|
55885
55885
|
if (!borders) return {};
|
|
55886
|
-
const style2 = Object.entries(borders).reduce((acc, [
|
|
55887
|
-
return `${acc}border-${
|
|
55886
|
+
const style2 = Object.entries(borders).reduce((acc, [key2, { size: size2, color }]) => {
|
|
55887
|
+
return `${acc}border-${key2}: ${Math.ceil(size2)}px solid ${color || "black"};`;
|
|
55888
55888
|
}, "");
|
|
55889
55889
|
return {
|
|
55890
55890
|
style: style2
|
|
@@ -56999,11 +56999,11 @@ createAnnotation_fn = function({ displayLabel } = {}) {
|
|
|
56999
56999
|
let mergedAttrs = Attribute2.mergeAttributes(this.htmlAttributes, {
|
|
57000
57000
|
style: omitHighlight ? "" : annotationStyle
|
|
57001
57001
|
});
|
|
57002
|
-
for (let [
|
|
57003
|
-
if (
|
|
57002
|
+
for (let [key2, value] of Object.entries(mergedAttrs)) {
|
|
57003
|
+
if (key2 === "style") {
|
|
57004
57004
|
annotation.style.cssText = value;
|
|
57005
57005
|
} else {
|
|
57006
|
-
annotation.setAttribute(
|
|
57006
|
+
annotation.setAttribute(key2, value);
|
|
57007
57007
|
}
|
|
57008
57008
|
}
|
|
57009
57009
|
return {
|
|
@@ -57177,13 +57177,13 @@ function hash$2(str) {
|
|
|
57177
57177
|
}
|
|
57178
57178
|
const colorToInt = (x) => parseInt(x.replace(/_/g, ""), 36);
|
|
57179
57179
|
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) => {
|
|
57180
|
-
const
|
|
57180
|
+
const key2 = colorToInt(next.substring(0, 3));
|
|
57181
57181
|
const hex2 = colorToInt(next.substring(3)).toString(16);
|
|
57182
57182
|
let prefix2 = "";
|
|
57183
57183
|
for (let i = 0; i < 6 - hex2.length; i++) {
|
|
57184
57184
|
prefix2 += "0";
|
|
57185
57185
|
}
|
|
57186
|
-
acc[
|
|
57186
|
+
acc[key2] = `${prefix2}${hex2}`;
|
|
57187
57187
|
return acc;
|
|
57188
57188
|
}, {});
|
|
57189
57189
|
function nameToHex(color) {
|
|
@@ -58299,41 +58299,480 @@ function getFormatAttrsFromMarks(marks) {
|
|
|
58299
58299
|
}
|
|
58300
58300
|
return formatAttrs;
|
|
58301
58301
|
}
|
|
58302
|
-
const
|
|
58303
|
-
|
|
58302
|
+
const simpleHash = (str) => {
|
|
58303
|
+
let hash2 = 0;
|
|
58304
|
+
for (let i = 0; i < str.length; i++) {
|
|
58305
|
+
const char = str.charCodeAt(i);
|
|
58306
|
+
hash2 = (hash2 << 5) - hash2 + char;
|
|
58307
|
+
hash2 = hash2 & hash2;
|
|
58308
|
+
}
|
|
58309
|
+
return Math.abs(hash2).toString();
|
|
58310
|
+
};
|
|
58311
|
+
const base64ToFile = (base64String) => {
|
|
58312
|
+
const arr = base64String.split(",");
|
|
58313
|
+
const mimeMatch = arr[0].match(/:(.*?);/);
|
|
58314
|
+
const mimeType = mimeMatch ? mimeMatch[1] : "";
|
|
58315
|
+
const data = arr[1];
|
|
58316
|
+
const binaryString = atob(data);
|
|
58317
|
+
const hash2 = simpleHash(binaryString);
|
|
58318
|
+
const extension = mimeType.split("/")[1] || "bin";
|
|
58319
|
+
const filename = `image-${hash2}.${extension}`;
|
|
58320
|
+
const bytes = new Uint8Array(binaryString.length);
|
|
58321
|
+
for (let i = 0; i < binaryString.length; i++) {
|
|
58322
|
+
bytes[i] = binaryString.charCodeAt(i);
|
|
58323
|
+
}
|
|
58324
|
+
const blob = new Blob([bytes], { type: mimeType });
|
|
58325
|
+
return new File([blob], filename, { type: mimeType });
|
|
58326
|
+
};
|
|
58327
|
+
const urlToFile = async (url, filename, mimeType) => {
|
|
58328
|
+
try {
|
|
58329
|
+
const response = await fetch(url, {
|
|
58330
|
+
mode: "cors",
|
|
58331
|
+
credentials: "omit",
|
|
58332
|
+
headers: {
|
|
58333
|
+
// Add common headers that might help with CORS
|
|
58334
|
+
Accept: "image/*,*/*;q=0.8"
|
|
58335
|
+
}
|
|
58336
|
+
});
|
|
58337
|
+
if (!response.ok) {
|
|
58338
|
+
console.warn(`Failed to fetch image from ${url}: ${response.status} ${response.statusText}`);
|
|
58339
|
+
return null;
|
|
58340
|
+
}
|
|
58341
|
+
const blob = await response.blob();
|
|
58342
|
+
const finalFilename = filename || extractFilenameFromUrl(url);
|
|
58343
|
+
const finalMimeType = mimeType || response.headers.get("content-type") || blob.type || "image/jpeg";
|
|
58344
|
+
return new File([blob], finalFilename, { type: finalMimeType });
|
|
58345
|
+
} catch (error) {
|
|
58346
|
+
if (isCorsError(error)) {
|
|
58347
|
+
console.warn(`CORS policy prevents accessing image from ${url}:`, error.message);
|
|
58348
|
+
return null;
|
|
58349
|
+
}
|
|
58350
|
+
console.error(`Error fetching image from ${url}:`, error);
|
|
58351
|
+
return null;
|
|
58352
|
+
}
|
|
58353
|
+
};
|
|
58354
|
+
const isCorsError = (error) => {
|
|
58355
|
+
const errorMessage = error.message.toLowerCase();
|
|
58356
|
+
const errorName = error.name.toLowerCase();
|
|
58357
|
+
return errorName.includes("cors") || errorMessage.includes("cors") || errorMessage.includes("cross-origin") || errorMessage.includes("access-control") || errorMessage.includes("network error") || // Often indicates CORS in browsers
|
|
58358
|
+
errorMessage.includes("failed to fetch");
|
|
58359
|
+
};
|
|
58360
|
+
const extractFilenameFromUrl = (url) => {
|
|
58361
|
+
try {
|
|
58362
|
+
const urlObj = new URL(url);
|
|
58363
|
+
const pathname = urlObj.pathname;
|
|
58364
|
+
const filename = pathname.split("/").pop();
|
|
58365
|
+
if (filename && !filename.includes(".")) {
|
|
58366
|
+
return `${filename}.jpg`;
|
|
58367
|
+
}
|
|
58368
|
+
return filename || "image.jpg";
|
|
58369
|
+
} catch {
|
|
58370
|
+
return "image.jpg";
|
|
58371
|
+
}
|
|
58372
|
+
};
|
|
58373
|
+
const validateUrlAccessibility = async (url) => {
|
|
58374
|
+
try {
|
|
58375
|
+
const response = await fetch(url, {
|
|
58376
|
+
method: "HEAD",
|
|
58377
|
+
mode: "cors",
|
|
58378
|
+
credentials: "omit"
|
|
58379
|
+
});
|
|
58380
|
+
return response.ok;
|
|
58381
|
+
} catch (_error) {
|
|
58382
|
+
return false;
|
|
58383
|
+
}
|
|
58384
|
+
};
|
|
58385
|
+
const handleImageUpload = (file) => {
|
|
58386
|
+
return new Promise((resolve, reject) => {
|
|
58387
|
+
let reader = new FileReader();
|
|
58388
|
+
reader.onload = (event) => {
|
|
58389
|
+
resolve(event.target.result);
|
|
58390
|
+
};
|
|
58391
|
+
reader.onerror = reject;
|
|
58392
|
+
setTimeout(() => reader.readAsDataURL(file), 250);
|
|
58393
|
+
});
|
|
58394
|
+
};
|
|
58395
|
+
const processUploadedImage = (fileData, getMaxContentSize) => {
|
|
58396
|
+
return new Promise((resolve, reject) => {
|
|
58397
|
+
const img = new window.Image();
|
|
58398
|
+
img.onload = () => {
|
|
58399
|
+
const canvas = document.createElement("canvas");
|
|
58400
|
+
const { width: logicalWidth, height: logicalHeight } = getAllowedImageDimensions(
|
|
58401
|
+
img.width,
|
|
58402
|
+
img.height,
|
|
58403
|
+
getMaxContentSize
|
|
58404
|
+
);
|
|
58405
|
+
canvas.width = img.width;
|
|
58406
|
+
canvas.height = img.height;
|
|
58407
|
+
const ctx2 = canvas.getContext("2d");
|
|
58408
|
+
if (ctx2) {
|
|
58409
|
+
ctx2.imageSmoothingEnabled = true;
|
|
58410
|
+
try {
|
|
58411
|
+
ctx2.imageSmoothingQuality = "high";
|
|
58412
|
+
} catch {
|
|
58413
|
+
}
|
|
58414
|
+
}
|
|
58415
|
+
ctx2.drawImage(img, 0, 0, img.width, img.height);
|
|
58416
|
+
const dpr = typeof window !== "undefined" && window.devicePixelRatio ? window.devicePixelRatio : 1;
|
|
58417
|
+
const targetPixelWidth = Math.round(logicalWidth * dpr);
|
|
58418
|
+
const targetPixelHeight = Math.round(logicalHeight * dpr);
|
|
58419
|
+
const finalTargetWidth = Math.min(targetPixelWidth, img.width);
|
|
58420
|
+
const finalTargetHeight = Math.min(targetPixelHeight, img.height);
|
|
58421
|
+
const resizeNeeded = finalTargetWidth !== img.width || finalTargetHeight !== img.height;
|
|
58422
|
+
if (resizeNeeded) {
|
|
58423
|
+
multiStepResize(canvas, finalTargetWidth, finalTargetHeight);
|
|
58424
|
+
}
|
|
58425
|
+
if (typeof fileData === "string") {
|
|
58426
|
+
const resizedBase64 = canvas.toDataURL();
|
|
58427
|
+
resolve(resizedBase64);
|
|
58428
|
+
} else {
|
|
58429
|
+
canvas.toBlob((blob) => {
|
|
58430
|
+
const updatedFile = new File([blob], fileData.name, {
|
|
58431
|
+
type: fileData.type,
|
|
58432
|
+
lastModified: Date.now()
|
|
58433
|
+
});
|
|
58434
|
+
resolve({ file: updatedFile, width: logicalWidth, height: logicalHeight });
|
|
58435
|
+
});
|
|
58436
|
+
}
|
|
58437
|
+
};
|
|
58438
|
+
img.onerror = (error) => reject(error);
|
|
58439
|
+
img.src = typeof fileData === "string" ? fileData : URL.createObjectURL(fileData);
|
|
58440
|
+
});
|
|
58441
|
+
};
|
|
58442
|
+
const getAllowedImageDimensions = (width, height, getMaxContentSize) => {
|
|
58443
|
+
const { width: maxWidth, height: maxHeight } = getMaxContentSize();
|
|
58444
|
+
if (!maxWidth || !maxHeight) return { width, height };
|
|
58445
|
+
let adjustedWidth = width;
|
|
58446
|
+
let adjustedHeight = height;
|
|
58447
|
+
const aspectRatio = width / height;
|
|
58448
|
+
if (height > maxHeight) {
|
|
58449
|
+
adjustedHeight = maxHeight;
|
|
58450
|
+
adjustedWidth = Math.round(maxHeight * aspectRatio);
|
|
58451
|
+
}
|
|
58452
|
+
if (adjustedWidth > maxWidth) {
|
|
58453
|
+
adjustedWidth = maxWidth;
|
|
58454
|
+
adjustedHeight = Math.round(maxWidth / aspectRatio);
|
|
58455
|
+
}
|
|
58456
|
+
return { width: adjustedWidth, height: adjustedHeight };
|
|
58457
|
+
};
|
|
58458
|
+
function resample_high_quality(canvas, width, height, resize_canvas) {
|
|
58459
|
+
var width_source = canvas.width;
|
|
58460
|
+
var height_source = canvas.height;
|
|
58461
|
+
width = Math.round(width);
|
|
58462
|
+
height = Math.round(height);
|
|
58463
|
+
var ratio_w = width_source / width;
|
|
58464
|
+
var ratio_h = height_source / height;
|
|
58465
|
+
var ratio_w_half = Math.ceil(ratio_w / 2);
|
|
58466
|
+
var ratio_h_half = Math.ceil(ratio_h / 2);
|
|
58467
|
+
var ctx2 = canvas.getContext("2d");
|
|
58468
|
+
var img = ctx2.getImageData(0, 0, width_source, height_source);
|
|
58469
|
+
var img2 = ctx2.createImageData(width, height);
|
|
58470
|
+
var data = img.data;
|
|
58471
|
+
var data2 = img2.data;
|
|
58472
|
+
for (var j2 = 0; j2 < height; j2++) {
|
|
58473
|
+
for (var i = 0; i < width; i++) {
|
|
58474
|
+
var x2 = (i + j2 * width) * 4;
|
|
58475
|
+
var weight = 0;
|
|
58476
|
+
var weights = 0;
|
|
58477
|
+
var weights_alpha = 0;
|
|
58478
|
+
var gx_r = 0;
|
|
58479
|
+
var gx_g = 0;
|
|
58480
|
+
var gx_b = 0;
|
|
58481
|
+
var gx_a = 0;
|
|
58482
|
+
var center_y = (j2 + 0.5) * ratio_h;
|
|
58483
|
+
var yy_start = Math.floor(j2 * ratio_h);
|
|
58484
|
+
var yy_stop = Math.ceil((j2 + 1) * ratio_h);
|
|
58485
|
+
for (var yy = yy_start; yy < yy_stop; yy++) {
|
|
58486
|
+
var dy = Math.abs(center_y - (yy + 0.5)) / ratio_h_half;
|
|
58487
|
+
var center_x = (i + 0.5) * ratio_w;
|
|
58488
|
+
var w0 = dy * dy;
|
|
58489
|
+
var xx_start = Math.floor(i * ratio_w);
|
|
58490
|
+
var xx_stop = Math.ceil((i + 1) * ratio_w);
|
|
58491
|
+
for (var xx = xx_start; xx < xx_stop; xx++) {
|
|
58492
|
+
var dx = Math.abs(center_x - (xx + 0.5)) / ratio_w_half;
|
|
58493
|
+
var w2 = Math.sqrt(w0 + dx * dx);
|
|
58494
|
+
if (w2 >= 1) {
|
|
58495
|
+
continue;
|
|
58496
|
+
}
|
|
58497
|
+
weight = 2 * w2 * w2 * w2 - 3 * w2 * w2 + 1;
|
|
58498
|
+
var pos_x = 4 * (xx + yy * width_source);
|
|
58499
|
+
gx_a += weight * data[pos_x + 3];
|
|
58500
|
+
weights_alpha += weight;
|
|
58501
|
+
if (data[pos_x + 3] < 255) weight = weight * data[pos_x + 3] / 250;
|
|
58502
|
+
gx_r += weight * data[pos_x];
|
|
58503
|
+
gx_g += weight * data[pos_x + 1];
|
|
58504
|
+
gx_b += weight * data[pos_x + 2];
|
|
58505
|
+
weights += weight;
|
|
58506
|
+
}
|
|
58507
|
+
}
|
|
58508
|
+
data2[x2] = gx_r / weights;
|
|
58509
|
+
data2[x2 + 1] = gx_g / weights;
|
|
58510
|
+
data2[x2 + 2] = gx_b / weights;
|
|
58511
|
+
data2[x2 + 3] = gx_a / weights_alpha;
|
|
58512
|
+
}
|
|
58513
|
+
}
|
|
58514
|
+
{
|
|
58515
|
+
canvas.width = width;
|
|
58516
|
+
canvas.height = height;
|
|
58517
|
+
}
|
|
58518
|
+
ctx2.putImageData(img2, 0, 0);
|
|
58519
|
+
}
|
|
58520
|
+
function multiStepResize(canvas, width, height) {
|
|
58521
|
+
let oc = document.createElement("canvas");
|
|
58522
|
+
let octx = oc.getContext("2d");
|
|
58523
|
+
let ctx2 = canvas.getContext("2d");
|
|
58524
|
+
let steps = Math.ceil(Math.log(canvas.width / width) / Math.log(2));
|
|
58525
|
+
steps = Math.max(steps, 1);
|
|
58526
|
+
let stepWidth = width * Math.pow(2, steps - 1);
|
|
58527
|
+
let stepHeight = height * Math.pow(2, steps - 1);
|
|
58528
|
+
let currentWidth = canvas.width;
|
|
58529
|
+
let currentHeight = canvas.height;
|
|
58530
|
+
oc.width = currentWidth;
|
|
58531
|
+
oc.height = currentHeight;
|
|
58532
|
+
octx.drawImage(canvas, 0, 0);
|
|
58533
|
+
while (steps > 0) {
|
|
58534
|
+
stepWidth = Math.max(stepWidth, width);
|
|
58535
|
+
stepHeight = Math.max(stepHeight, height);
|
|
58536
|
+
canvas.width = stepWidth;
|
|
58537
|
+
canvas.height = stepHeight;
|
|
58538
|
+
ctx2.drawImage(oc, 0, 0, currentWidth, currentHeight, 0, 0, stepWidth, stepHeight);
|
|
58539
|
+
currentWidth = stepWidth;
|
|
58540
|
+
currentHeight = stepHeight;
|
|
58541
|
+
oc.width = currentWidth;
|
|
58542
|
+
oc.height = currentHeight;
|
|
58543
|
+
octx.drawImage(canvas, 0, 0);
|
|
58544
|
+
stepWidth = Math.round(stepWidth / 2);
|
|
58545
|
+
stepHeight = Math.round(stepHeight / 2);
|
|
58546
|
+
steps--;
|
|
58547
|
+
}
|
|
58548
|
+
resample_high_quality(canvas, width, height);
|
|
58549
|
+
}
|
|
58550
|
+
const fileTooLarge = (file) => {
|
|
58551
|
+
let fileSizeMb = Number((file.size / (1024 * 1024)).toFixed(4));
|
|
58552
|
+
if (fileSizeMb > 5) {
|
|
58553
|
+
window.alert("Image size must be less than 5MB");
|
|
58554
|
+
return true;
|
|
58555
|
+
}
|
|
58556
|
+
return false;
|
|
58557
|
+
};
|
|
58558
|
+
const checkAndProcessImage = async ({ getMaxContentSize, file }) => {
|
|
58559
|
+
if (fileTooLarge(file)) {
|
|
58560
|
+
return { file: null, size: { width: 0, height: 0 } };
|
|
58561
|
+
}
|
|
58562
|
+
try {
|
|
58563
|
+
const processedImageResult = await processUploadedImage(file, getMaxContentSize);
|
|
58564
|
+
const process2 = processedImageResult;
|
|
58565
|
+
return { file: process2.file, size: { width: process2.width, height: process2.height } };
|
|
58566
|
+
} catch (err) {
|
|
58567
|
+
console.warn("Error processing image:", err);
|
|
58568
|
+
return { file: null, size: { width: 0, height: 0 } };
|
|
58569
|
+
}
|
|
58570
|
+
};
|
|
58571
|
+
function replaceSelectionWithImagePlaceholder({ editorOptions, view, id }) {
|
|
58572
|
+
let { tr } = view.state;
|
|
58573
|
+
let { selection } = tr;
|
|
58574
|
+
if (editorOptions.isHeaderOrFooter) {
|
|
58575
|
+
selection = editorOptions.lastSelection;
|
|
58576
|
+
}
|
|
58577
|
+
if (!selection.empty && !editorOptions.isHeaderOrFooter) {
|
|
58578
|
+
tr.deleteSelection();
|
|
58579
|
+
}
|
|
58580
|
+
tr = addImagePlaceholder(view.state, tr, id, selection.from);
|
|
58581
|
+
view.dispatch(tr);
|
|
58582
|
+
}
|
|
58583
|
+
async function uploadAndInsertImage({ editor, view, file, size: size2, id }) {
|
|
58584
|
+
const imageUploadHandler = typeof editor.options.handleImageUpload === "function" ? editor.options.handleImageUpload : handleImageUpload;
|
|
58585
|
+
try {
|
|
58586
|
+
let url = await imageUploadHandler(file);
|
|
58587
|
+
let fileName = file.name.replace(" ", "_");
|
|
58588
|
+
let placeholderPos = findPlaceholder(view.state, id);
|
|
58589
|
+
if (placeholderPos == null) {
|
|
58590
|
+
return;
|
|
58591
|
+
}
|
|
58592
|
+
let mediaPath = `word/media/${fileName}`;
|
|
58593
|
+
let rId = null;
|
|
58594
|
+
if (editor.options.mode === "docx") {
|
|
58595
|
+
const [, path] = mediaPath.split("word/");
|
|
58596
|
+
const id2 = addImageRelationship({ editor, path });
|
|
58597
|
+
if (id2) rId = id2;
|
|
58598
|
+
}
|
|
58599
|
+
let imageNode = view.state.schema.nodes.image.create({
|
|
58600
|
+
src: mediaPath,
|
|
58601
|
+
size: size2,
|
|
58602
|
+
id,
|
|
58603
|
+
rId
|
|
58604
|
+
});
|
|
58605
|
+
editor.storage.image.media = Object.assign(editor.storage.image.media, { [mediaPath]: url });
|
|
58606
|
+
if (editor.options.ydoc && typeof editor.commands.addImageToCollaboration === "function") {
|
|
58607
|
+
editor.commands.addImageToCollaboration({ mediaPath, fileData: url });
|
|
58608
|
+
}
|
|
58609
|
+
let tr = view.state.tr;
|
|
58610
|
+
tr.replaceWith(placeholderPos, placeholderPos, imageNode);
|
|
58611
|
+
tr = removeImagePlaceholder(view.state, tr, id);
|
|
58612
|
+
view.dispatch(tr);
|
|
58613
|
+
} catch {
|
|
58614
|
+
const tr = removeImagePlaceholder(view.state, view.state.tr, id);
|
|
58615
|
+
view.dispatch(tr);
|
|
58616
|
+
}
|
|
58617
|
+
}
|
|
58618
|
+
function addImageRelationship({ editor, path }) {
|
|
58619
|
+
const target = path;
|
|
58620
|
+
const type2 = "image";
|
|
58621
|
+
try {
|
|
58622
|
+
const id = insertNewRelationship(target, type2, editor);
|
|
58623
|
+
return id;
|
|
58624
|
+
} catch {
|
|
58625
|
+
return null;
|
|
58626
|
+
}
|
|
58627
|
+
}
|
|
58628
|
+
const key = new PluginKey("ImageRegistration");
|
|
58629
|
+
const ImageRegistrationPlugin = ({ editor }) => {
|
|
58630
|
+
const { view } = editor;
|
|
58304
58631
|
return new Plugin({
|
|
58305
|
-
key
|
|
58632
|
+
key,
|
|
58306
58633
|
state: {
|
|
58307
58634
|
init() {
|
|
58308
|
-
return DecorationSet.empty;
|
|
58635
|
+
return { set: DecorationSet.empty };
|
|
58309
58636
|
},
|
|
58310
|
-
apply(tr, set) {
|
|
58637
|
+
apply(tr, { set }) {
|
|
58638
|
+
const meta = tr.getMeta(key);
|
|
58639
|
+
if (meta) {
|
|
58640
|
+
set = meta.set;
|
|
58641
|
+
return { set };
|
|
58642
|
+
}
|
|
58311
58643
|
set = set.map(tr.mapping, tr.doc);
|
|
58312
|
-
|
|
58313
|
-
|
|
58314
|
-
|
|
58315
|
-
|
|
58316
|
-
|
|
58644
|
+
return { set };
|
|
58645
|
+
}
|
|
58646
|
+
},
|
|
58647
|
+
appendTransaction: (trs, _oldState, state2) => {
|
|
58648
|
+
let foundImages = [];
|
|
58649
|
+
trs.forEach((tr2) => {
|
|
58650
|
+
if (tr2.docChanged) {
|
|
58651
|
+
tr2.steps.forEach((step, index2) => {
|
|
58652
|
+
const stepMap = step.getMap();
|
|
58653
|
+
foundImages = foundImages.map(({ node, pos, id }) => {
|
|
58654
|
+
const mappedPos = stepMap.map(pos, -1);
|
|
58655
|
+
return { node, pos: mappedPos, id };
|
|
58656
|
+
});
|
|
58657
|
+
if (step instanceof ReplaceStep || step instanceof ReplaceAroundStep$1) {
|
|
58658
|
+
(tr2.docs[index2 + 1] || tr2.doc).nodesBetween(
|
|
58659
|
+
stepMap.map(step.from, -1),
|
|
58660
|
+
stepMap.map(step.to, 1),
|
|
58661
|
+
(node, pos) => {
|
|
58662
|
+
if (node.type.name === "image" && !node.attrs.src.startsWith("word/media")) {
|
|
58663
|
+
const id = {};
|
|
58664
|
+
foundImages.push({ node, pos, id });
|
|
58665
|
+
} else {
|
|
58666
|
+
return true;
|
|
58667
|
+
}
|
|
58668
|
+
}
|
|
58669
|
+
);
|
|
58670
|
+
}
|
|
58317
58671
|
});
|
|
58318
|
-
set = set.add(tr.doc, [deco]);
|
|
58319
|
-
} else if (action?.type === "remove") {
|
|
58320
|
-
set = set.remove(set.find(null, null, (spec) => spec.id == action.id));
|
|
58321
58672
|
}
|
|
58322
|
-
|
|
58673
|
+
});
|
|
58674
|
+
if (!foundImages || foundImages.length === 0) {
|
|
58675
|
+
return null;
|
|
58323
58676
|
}
|
|
58677
|
+
registerImages(foundImages, editor, view);
|
|
58678
|
+
const tr = state2.tr;
|
|
58679
|
+
let { set } = key.getState(state2);
|
|
58680
|
+
foundImages.slice().sort((a, b2) => a.pos - b2.pos).forEach(({ pos, id }) => {
|
|
58681
|
+
let deco = Decoration.widget(pos, () => document.createElement("placeholder"), {
|
|
58682
|
+
side: -1,
|
|
58683
|
+
id
|
|
58684
|
+
});
|
|
58685
|
+
set = set.add(tr.doc, [deco]);
|
|
58686
|
+
});
|
|
58687
|
+
foundImages.slice().sort((a, b2) => b2.pos - a.pos).forEach(({ node, pos }) => {
|
|
58688
|
+
tr.delete(pos, pos + node.nodeSize);
|
|
58689
|
+
});
|
|
58690
|
+
set = set.map(tr.mapping, tr.doc);
|
|
58691
|
+
tr.setMeta(key, { set });
|
|
58692
|
+
return tr;
|
|
58324
58693
|
},
|
|
58325
58694
|
props: {
|
|
58326
58695
|
decorations(state2) {
|
|
58327
|
-
|
|
58696
|
+
let { set } = key.getState(state2);
|
|
58697
|
+
return set;
|
|
58328
58698
|
}
|
|
58329
58699
|
}
|
|
58330
58700
|
});
|
|
58331
58701
|
};
|
|
58332
58702
|
const findPlaceholder = (state2, id) => {
|
|
58333
|
-
let
|
|
58334
|
-
let found2 =
|
|
58703
|
+
let { set } = key.getState(state2);
|
|
58704
|
+
let found2 = set?.find(null, null, (spec) => spec.id === id);
|
|
58335
58705
|
return found2?.length ? found2[0].from : null;
|
|
58336
58706
|
};
|
|
58707
|
+
const removeImagePlaceholder = (state2, tr, id) => {
|
|
58708
|
+
let { set } = key.getState(state2);
|
|
58709
|
+
set = set.map(tr.mapping, tr.doc);
|
|
58710
|
+
set = set.remove(set.find(null, null, (spec) => spec.id == id));
|
|
58711
|
+
return tr.setMeta(key, { set, type: "remove" });
|
|
58712
|
+
};
|
|
58713
|
+
const addImagePlaceholder = (state2, tr, id, pos) => {
|
|
58714
|
+
let { set } = key.getState(state2);
|
|
58715
|
+
set = set.map(tr.mapping, tr.doc);
|
|
58716
|
+
let deco = Decoration.widget(pos, () => document.createElement("placeholder"), {
|
|
58717
|
+
id
|
|
58718
|
+
});
|
|
58719
|
+
set = set.add(tr.doc, [deco]);
|
|
58720
|
+
return tr.setMeta(key, { set, type: "add" });
|
|
58721
|
+
};
|
|
58722
|
+
const getImageRegistrationMetaType = (tr) => {
|
|
58723
|
+
const meta = tr.getMeta(key);
|
|
58724
|
+
if (meta && meta.type) {
|
|
58725
|
+
return meta.type;
|
|
58726
|
+
}
|
|
58727
|
+
return null;
|
|
58728
|
+
};
|
|
58729
|
+
const registerImages = async (foundImages, editor, view) => {
|
|
58730
|
+
foundImages.forEach(async (image) => {
|
|
58731
|
+
const src = image.node.attrs.src;
|
|
58732
|
+
const id = image.id;
|
|
58733
|
+
let file = null;
|
|
58734
|
+
if (src.startsWith("http")) {
|
|
58735
|
+
const isAccessible = await validateUrlAccessibility(src);
|
|
58736
|
+
if (isAccessible) {
|
|
58737
|
+
file = await urlToFile(src);
|
|
58738
|
+
} else {
|
|
58739
|
+
console.warn(`Image URL ${src} is not accessible due to CORS or other restrictions. Using original URL.`);
|
|
58740
|
+
const tr = view.state.tr;
|
|
58741
|
+
removeImagePlaceholder(view.state, tr, id);
|
|
58742
|
+
view.dispatch(tr);
|
|
58743
|
+
return;
|
|
58744
|
+
}
|
|
58745
|
+
} else if (src.startsWith("data:")) {
|
|
58746
|
+
file = base64ToFile(src);
|
|
58747
|
+
} else {
|
|
58748
|
+
console.error(`Unsupported image source: ${src}`);
|
|
58749
|
+
}
|
|
58750
|
+
if (!file) {
|
|
58751
|
+
const tr = view.state.tr;
|
|
58752
|
+
removeImagePlaceholder(view.state, tr, id);
|
|
58753
|
+
view.dispatch(tr);
|
|
58754
|
+
return;
|
|
58755
|
+
}
|
|
58756
|
+
try {
|
|
58757
|
+
const process2 = await checkAndProcessImage({
|
|
58758
|
+
getMaxContentSize: () => editor.getMaxContentSize(),
|
|
58759
|
+
file
|
|
58760
|
+
});
|
|
58761
|
+
if (!process2.file) {
|
|
58762
|
+
const tr = view.state.tr;
|
|
58763
|
+
removeImagePlaceholder(view.state, tr, id);
|
|
58764
|
+
view.dispatch(tr);
|
|
58765
|
+
return;
|
|
58766
|
+
}
|
|
58767
|
+
await uploadAndInsertImage({ editor, view, file: process2.file, size: process2.size, id });
|
|
58768
|
+
} catch (error) {
|
|
58769
|
+
console.error(`Error processing image from ${src}:`, error);
|
|
58770
|
+
const tr = view.state.tr;
|
|
58771
|
+
removeImagePlaceholder(view.state, tr, id);
|
|
58772
|
+
view.dispatch(tr);
|
|
58773
|
+
}
|
|
58774
|
+
});
|
|
58775
|
+
};
|
|
58337
58776
|
const ImagePositionPluginKey = new PluginKey("ImagePosition");
|
|
58338
58777
|
const ImagePositionPlugin = ({ editor }) => {
|
|
58339
58778
|
const { view } = editor;
|
|
@@ -58666,7 +59105,7 @@ const Image = Node$1.create({
|
|
|
58666
59105
|
};
|
|
58667
59106
|
},
|
|
58668
59107
|
addPmPlugins() {
|
|
58669
|
-
return [
|
|
59108
|
+
return [ImageRegistrationPlugin({ editor: this.editor }), ImagePositionPlugin({ editor: this.editor })];
|
|
58670
59109
|
}
|
|
58671
59110
|
});
|
|
58672
59111
|
const ACCEPT_IMAGE_TYPES = [".jpg", ".jpeg", ".png", "image/jpeg", "image/png"];
|
|
@@ -58691,247 +59130,6 @@ const getFileOpener = () => {
|
|
|
58691
59130
|
};
|
|
58692
59131
|
return openFile;
|
|
58693
59132
|
};
|
|
58694
|
-
const handleImageUpload = (file) => {
|
|
58695
|
-
return new Promise((resolve, reject) => {
|
|
58696
|
-
let reader = new FileReader();
|
|
58697
|
-
reader.onload = (event) => {
|
|
58698
|
-
resolve(event.target.result);
|
|
58699
|
-
};
|
|
58700
|
-
reader.onerror = reject;
|
|
58701
|
-
setTimeout(() => reader.readAsDataURL(file), 250);
|
|
58702
|
-
});
|
|
58703
|
-
};
|
|
58704
|
-
const processUploadedImage = (fileData, editor) => {
|
|
58705
|
-
return new Promise((resolve, reject) => {
|
|
58706
|
-
const img = new window.Image();
|
|
58707
|
-
img.onload = () => {
|
|
58708
|
-
const canvas = document.createElement("canvas");
|
|
58709
|
-
const { width: logicalWidth, height: logicalHeight } = getAllowedImageDimensions(img.width, img.height, editor);
|
|
58710
|
-
canvas.width = img.width;
|
|
58711
|
-
canvas.height = img.height;
|
|
58712
|
-
const ctx2 = canvas.getContext("2d");
|
|
58713
|
-
if (ctx2) {
|
|
58714
|
-
ctx2.imageSmoothingEnabled = true;
|
|
58715
|
-
try {
|
|
58716
|
-
ctx2.imageSmoothingQuality = "high";
|
|
58717
|
-
} catch {
|
|
58718
|
-
}
|
|
58719
|
-
}
|
|
58720
|
-
ctx2.drawImage(img, 0, 0, img.width, img.height);
|
|
58721
|
-
const dpr = typeof window !== "undefined" && window.devicePixelRatio ? window.devicePixelRatio : 1;
|
|
58722
|
-
const targetPixelWidth = Math.round(logicalWidth * dpr);
|
|
58723
|
-
const targetPixelHeight = Math.round(logicalHeight * dpr);
|
|
58724
|
-
const finalTargetWidth = Math.min(targetPixelWidth, img.width);
|
|
58725
|
-
const finalTargetHeight = Math.min(targetPixelHeight, img.height);
|
|
58726
|
-
const resizeNeeded = finalTargetWidth !== img.width || finalTargetHeight !== img.height;
|
|
58727
|
-
if (resizeNeeded) {
|
|
58728
|
-
multiStepResize(canvas, finalTargetWidth, finalTargetHeight);
|
|
58729
|
-
}
|
|
58730
|
-
if (typeof fileData === "string") {
|
|
58731
|
-
const resizedBase64 = canvas.toDataURL();
|
|
58732
|
-
resolve(resizedBase64);
|
|
58733
|
-
} else {
|
|
58734
|
-
canvas.toBlob((blob) => {
|
|
58735
|
-
const updatedFile = new File([blob], fileData.name, {
|
|
58736
|
-
type: fileData.type,
|
|
58737
|
-
lastModified: Date.now()
|
|
58738
|
-
});
|
|
58739
|
-
resolve({ file: updatedFile, width: logicalWidth, height: logicalHeight });
|
|
58740
|
-
});
|
|
58741
|
-
}
|
|
58742
|
-
};
|
|
58743
|
-
img.onerror = (error) => reject(error);
|
|
58744
|
-
img.src = typeof fileData === "string" ? fileData : URL.createObjectURL(fileData);
|
|
58745
|
-
});
|
|
58746
|
-
};
|
|
58747
|
-
const getAllowedImageDimensions = (width, height, editor) => {
|
|
58748
|
-
const { width: maxWidth, height: maxHeight } = editor.getMaxContentSize();
|
|
58749
|
-
if (!maxWidth || !maxHeight) return { width, height };
|
|
58750
|
-
let adjustedWidth = width;
|
|
58751
|
-
let adjustedHeight = height;
|
|
58752
|
-
const aspectRatio = width / height;
|
|
58753
|
-
if (height > maxHeight) {
|
|
58754
|
-
adjustedHeight = maxHeight;
|
|
58755
|
-
adjustedWidth = Math.round(maxHeight * aspectRatio);
|
|
58756
|
-
}
|
|
58757
|
-
if (adjustedWidth > maxWidth) {
|
|
58758
|
-
adjustedWidth = maxWidth;
|
|
58759
|
-
adjustedHeight = Math.round(maxWidth / aspectRatio);
|
|
58760
|
-
}
|
|
58761
|
-
return { width: adjustedWidth, height: adjustedHeight };
|
|
58762
|
-
};
|
|
58763
|
-
function resample_high_quality(canvas, width, height, resize_canvas) {
|
|
58764
|
-
var width_source = canvas.width;
|
|
58765
|
-
var height_source = canvas.height;
|
|
58766
|
-
width = Math.round(width);
|
|
58767
|
-
height = Math.round(height);
|
|
58768
|
-
var ratio_w = width_source / width;
|
|
58769
|
-
var ratio_h = height_source / height;
|
|
58770
|
-
var ratio_w_half = Math.ceil(ratio_w / 2);
|
|
58771
|
-
var ratio_h_half = Math.ceil(ratio_h / 2);
|
|
58772
|
-
var ctx2 = canvas.getContext("2d");
|
|
58773
|
-
var img = ctx2.getImageData(0, 0, width_source, height_source);
|
|
58774
|
-
var img2 = ctx2.createImageData(width, height);
|
|
58775
|
-
var data = img.data;
|
|
58776
|
-
var data2 = img2.data;
|
|
58777
|
-
for (var j2 = 0; j2 < height; j2++) {
|
|
58778
|
-
for (var i = 0; i < width; i++) {
|
|
58779
|
-
var x2 = (i + j2 * width) * 4;
|
|
58780
|
-
var weight = 0;
|
|
58781
|
-
var weights = 0;
|
|
58782
|
-
var weights_alpha = 0;
|
|
58783
|
-
var gx_r = 0;
|
|
58784
|
-
var gx_g = 0;
|
|
58785
|
-
var gx_b = 0;
|
|
58786
|
-
var gx_a = 0;
|
|
58787
|
-
var center_y = (j2 + 0.5) * ratio_h;
|
|
58788
|
-
var yy_start = Math.floor(j2 * ratio_h);
|
|
58789
|
-
var yy_stop = Math.ceil((j2 + 1) * ratio_h);
|
|
58790
|
-
for (var yy = yy_start; yy < yy_stop; yy++) {
|
|
58791
|
-
var dy = Math.abs(center_y - (yy + 0.5)) / ratio_h_half;
|
|
58792
|
-
var center_x = (i + 0.5) * ratio_w;
|
|
58793
|
-
var w0 = dy * dy;
|
|
58794
|
-
var xx_start = Math.floor(i * ratio_w);
|
|
58795
|
-
var xx_stop = Math.ceil((i + 1) * ratio_w);
|
|
58796
|
-
for (var xx = xx_start; xx < xx_stop; xx++) {
|
|
58797
|
-
var dx = Math.abs(center_x - (xx + 0.5)) / ratio_w_half;
|
|
58798
|
-
var w2 = Math.sqrt(w0 + dx * dx);
|
|
58799
|
-
if (w2 >= 1) {
|
|
58800
|
-
continue;
|
|
58801
|
-
}
|
|
58802
|
-
weight = 2 * w2 * w2 * w2 - 3 * w2 * w2 + 1;
|
|
58803
|
-
var pos_x = 4 * (xx + yy * width_source);
|
|
58804
|
-
gx_a += weight * data[pos_x + 3];
|
|
58805
|
-
weights_alpha += weight;
|
|
58806
|
-
if (data[pos_x + 3] < 255) weight = weight * data[pos_x + 3] / 250;
|
|
58807
|
-
gx_r += weight * data[pos_x];
|
|
58808
|
-
gx_g += weight * data[pos_x + 1];
|
|
58809
|
-
gx_b += weight * data[pos_x + 2];
|
|
58810
|
-
weights += weight;
|
|
58811
|
-
}
|
|
58812
|
-
}
|
|
58813
|
-
data2[x2] = gx_r / weights;
|
|
58814
|
-
data2[x2 + 1] = gx_g / weights;
|
|
58815
|
-
data2[x2 + 2] = gx_b / weights;
|
|
58816
|
-
data2[x2 + 3] = gx_a / weights_alpha;
|
|
58817
|
-
}
|
|
58818
|
-
}
|
|
58819
|
-
{
|
|
58820
|
-
canvas.width = width;
|
|
58821
|
-
canvas.height = height;
|
|
58822
|
-
}
|
|
58823
|
-
ctx2.putImageData(img2, 0, 0);
|
|
58824
|
-
}
|
|
58825
|
-
function multiStepResize(canvas, targetWidth, targetHeight) {
|
|
58826
|
-
const originalWidth = canvas.width;
|
|
58827
|
-
const originalHeight = canvas.height;
|
|
58828
|
-
const scaleX = targetWidth / originalWidth;
|
|
58829
|
-
const scaleY = targetHeight / originalHeight;
|
|
58830
|
-
const scaleFactor = Math.min(scaleX, scaleY);
|
|
58831
|
-
if (scaleFactor < 0.5) {
|
|
58832
|
-
let currentWidth = originalWidth;
|
|
58833
|
-
let currentHeight = originalHeight;
|
|
58834
|
-
while (currentWidth > targetWidth * 2 || currentHeight > targetHeight * 2) {
|
|
58835
|
-
const nextWidth = Math.round(currentWidth / 2);
|
|
58836
|
-
const nextHeight = Math.round(currentHeight / 2);
|
|
58837
|
-
resample_high_quality(canvas, nextWidth, nextHeight);
|
|
58838
|
-
currentWidth = nextWidth;
|
|
58839
|
-
currentHeight = nextHeight;
|
|
58840
|
-
}
|
|
58841
|
-
if (currentWidth !== targetWidth || currentHeight !== targetHeight) {
|
|
58842
|
-
resample_high_quality(canvas, targetWidth, targetHeight);
|
|
58843
|
-
}
|
|
58844
|
-
} else {
|
|
58845
|
-
resample_high_quality(canvas, targetWidth, targetHeight);
|
|
58846
|
-
}
|
|
58847
|
-
}
|
|
58848
|
-
const startImageUpload = async ({ editor, view, file }) => {
|
|
58849
|
-
const imageUploadHandler = typeof editor.options.handleImageUpload === "function" ? editor.options.handleImageUpload : handleImageUpload;
|
|
58850
|
-
let fileSizeMb = Number((file.size / (1024 * 1024)).toFixed(4));
|
|
58851
|
-
if (fileSizeMb > 5) {
|
|
58852
|
-
window.alert("Image size must be less than 5MB");
|
|
58853
|
-
return;
|
|
58854
|
-
}
|
|
58855
|
-
let width;
|
|
58856
|
-
let height;
|
|
58857
|
-
try {
|
|
58858
|
-
const processedImageResult = await processUploadedImage(file, editor);
|
|
58859
|
-
width = processedImageResult.width;
|
|
58860
|
-
height = processedImageResult.height;
|
|
58861
|
-
file = processedImageResult.file;
|
|
58862
|
-
} catch (err) {
|
|
58863
|
-
console.warn("Error processing image:", err);
|
|
58864
|
-
editor.emit("exception", { error: err, editor });
|
|
58865
|
-
return;
|
|
58866
|
-
}
|
|
58867
|
-
await uploadImage({
|
|
58868
|
-
editor,
|
|
58869
|
-
view,
|
|
58870
|
-
file,
|
|
58871
|
-
size: { width, height },
|
|
58872
|
-
uploadHandler: imageUploadHandler
|
|
58873
|
-
});
|
|
58874
|
-
};
|
|
58875
|
-
async function uploadImage({ editor, view, file, size: size2, uploadHandler }) {
|
|
58876
|
-
let id = {};
|
|
58877
|
-
let { tr, schema } = view.state;
|
|
58878
|
-
let { selection } = tr;
|
|
58879
|
-
if (editor.options.isHeaderOrFooter) {
|
|
58880
|
-
selection = editor.options.lastSelection;
|
|
58881
|
-
}
|
|
58882
|
-
if (!selection.empty && !editor.options.isHeaderOrFooter) {
|
|
58883
|
-
tr.deleteSelection();
|
|
58884
|
-
}
|
|
58885
|
-
let imageMeta = {
|
|
58886
|
-
type: "add",
|
|
58887
|
-
pos: selection.from,
|
|
58888
|
-
id
|
|
58889
|
-
};
|
|
58890
|
-
tr.setMeta(ImagePlaceholderPluginKey, imageMeta);
|
|
58891
|
-
view.dispatch(tr);
|
|
58892
|
-
try {
|
|
58893
|
-
let url = await uploadHandler(file);
|
|
58894
|
-
let fileName = file.name.replace(" ", "_");
|
|
58895
|
-
let placeholderPos = findPlaceholder(view.state, id);
|
|
58896
|
-
if (placeholderPos == null) {
|
|
58897
|
-
return;
|
|
58898
|
-
}
|
|
58899
|
-
let removeMeta = { type: "remove", id };
|
|
58900
|
-
let mediaPath = `word/media/${fileName}`;
|
|
58901
|
-
let rId = null;
|
|
58902
|
-
if (editor.options.mode === "docx") {
|
|
58903
|
-
const [, path] = mediaPath.split("word/");
|
|
58904
|
-
const imageid = addImageRelationship({ editor, path });
|
|
58905
|
-
if (imageid) rId = imageid;
|
|
58906
|
-
}
|
|
58907
|
-
let imageNode = schema.nodes.image.create({
|
|
58908
|
-
src: mediaPath,
|
|
58909
|
-
size: size2,
|
|
58910
|
-
rId
|
|
58911
|
-
});
|
|
58912
|
-
editor.storage.image.media = Object.assign(editor.storage.image.media, { [mediaPath]: url });
|
|
58913
|
-
if (editor.options.ydoc) {
|
|
58914
|
-
editor.commands.addImageToCollaboration({ mediaPath, fileData: url });
|
|
58915
|
-
}
|
|
58916
|
-
view.dispatch(
|
|
58917
|
-
view.state.tr.replaceWith(placeholderPos, placeholderPos, imageNode).setMeta(ImagePlaceholderPluginKey, removeMeta)
|
|
58918
|
-
);
|
|
58919
|
-
} catch (error) {
|
|
58920
|
-
let removeMeta = { type: "remove", id };
|
|
58921
|
-
view.dispatch(tr.setMeta(ImagePlaceholderPluginKey, removeMeta));
|
|
58922
|
-
editor.emit("exception", { error, editor });
|
|
58923
|
-
}
|
|
58924
|
-
}
|
|
58925
|
-
function addImageRelationship({ editor, path }) {
|
|
58926
|
-
const target = path;
|
|
58927
|
-
const type2 = "image";
|
|
58928
|
-
try {
|
|
58929
|
-
const relationshipId = insertNewRelationship(target, type2, editor);
|
|
58930
|
-
return relationshipId;
|
|
58931
|
-
} catch {
|
|
58932
|
-
return null;
|
|
58933
|
-
}
|
|
58934
|
-
}
|
|
58935
59133
|
const BookmarkStart = Node$1.create({
|
|
58936
59134
|
name: "bookmarkStart",
|
|
58937
59135
|
group: "inline",
|
|
@@ -59246,8 +59444,8 @@ renderDom_fn = function(node, htmlAttributes) {
|
|
|
59246
59444
|
__privateMethod$1(this, _AutoPageNumberNodeView_instances, scheduleUpdateNodeStyle_fn).call(this, currentPos, marks);
|
|
59247
59445
|
Object.assign(nodeContent.style, styles);
|
|
59248
59446
|
nodeContent.appendChild(content);
|
|
59249
|
-
Object.entries(htmlAttributes).forEach(([
|
|
59250
|
-
if (value) nodeContent.setAttribute(
|
|
59447
|
+
Object.entries(htmlAttributes).forEach(([key2, value]) => {
|
|
59448
|
+
if (value) nodeContent.setAttribute(key2, value);
|
|
59251
59449
|
});
|
|
59252
59450
|
return nodeContent;
|
|
59253
59451
|
};
|
|
@@ -59313,8 +59511,8 @@ const processMarks = (marks) => {
|
|
|
59313
59511
|
break;
|
|
59314
59512
|
default:
|
|
59315
59513
|
if (attrs?.style) {
|
|
59316
|
-
Object.entries(attrs.style).forEach(([
|
|
59317
|
-
styles[
|
|
59514
|
+
Object.entries(attrs.style).forEach(([key2, value]) => {
|
|
59515
|
+
styles[key2] = value;
|
|
59318
59516
|
});
|
|
59319
59517
|
}
|
|
59320
59518
|
break;
|
|
@@ -61976,8 +62174,8 @@ function mergePaddingObject(paddingObject) {
|
|
|
61976
62174
|
return Object.assign({}, getFreshSideObject(), paddingObject);
|
|
61977
62175
|
}
|
|
61978
62176
|
function expandToHashMap(value, keys2) {
|
|
61979
|
-
return keys2.reduce(function(hashMap,
|
|
61980
|
-
hashMap[
|
|
62177
|
+
return keys2.reduce(function(hashMap, key2) {
|
|
62178
|
+
hashMap[key2] = value;
|
|
61981
62179
|
return hashMap;
|
|
61982
62180
|
}, {});
|
|
61983
62181
|
}
|
|
@@ -62433,10 +62631,10 @@ function detectOverflow$1(state2, options) {
|
|
|
62433
62631
|
var offsetData = state2.modifiersData.offset;
|
|
62434
62632
|
if (elementContext === popper && offsetData) {
|
|
62435
62633
|
var offset2 = offsetData[placement];
|
|
62436
|
-
Object.keys(overflowOffsets).forEach(function(
|
|
62437
|
-
var multiply = [right, bottom].indexOf(
|
|
62438
|
-
var axis = [top, bottom].indexOf(
|
|
62439
|
-
overflowOffsets[
|
|
62634
|
+
Object.keys(overflowOffsets).forEach(function(key2) {
|
|
62635
|
+
var multiply = [right, bottom].indexOf(key2) >= 0 ? 1 : -1;
|
|
62636
|
+
var axis = [top, bottom].indexOf(key2) >= 0 ? "y" : "x";
|
|
62637
|
+
overflowOffsets[key2] += offset2[axis] * multiply;
|
|
62440
62638
|
});
|
|
62441
62639
|
}
|
|
62442
62640
|
return overflowOffsets;
|
|
@@ -62883,8 +63081,8 @@ function mergeByName(modifiers2) {
|
|
|
62883
63081
|
}) : current;
|
|
62884
63082
|
return merged2;
|
|
62885
63083
|
}, {});
|
|
62886
|
-
return Object.keys(merged).map(function(
|
|
62887
|
-
return merged[
|
|
63084
|
+
return Object.keys(merged).map(function(key2) {
|
|
63085
|
+
return merged[key2];
|
|
62888
63086
|
});
|
|
62889
63087
|
}
|
|
62890
63088
|
var DEFAULT_OPTIONS = {
|
|
@@ -63041,8 +63239,8 @@ var TOUCH_OPTIONS = {
|
|
|
63041
63239
|
var TIPPY_DEFAULT_APPEND_TO = function TIPPY_DEFAULT_APPEND_TO2() {
|
|
63042
63240
|
return document.body;
|
|
63043
63241
|
};
|
|
63044
|
-
function hasOwnProperty$c(obj,
|
|
63045
|
-
return {}.hasOwnProperty.call(obj,
|
|
63242
|
+
function hasOwnProperty$c(obj, key2) {
|
|
63243
|
+
return {}.hasOwnProperty.call(obj, key2);
|
|
63046
63244
|
}
|
|
63047
63245
|
function getValueAtIndexOrReturn(value, index2, defaultValue) {
|
|
63048
63246
|
if (Array.isArray(value)) {
|
|
@@ -63072,8 +63270,8 @@ function debounce(fn2, ms) {
|
|
|
63072
63270
|
}
|
|
63073
63271
|
function removeProperties(obj, keys2) {
|
|
63074
63272
|
var clone = Object.assign({}, obj);
|
|
63075
|
-
keys2.forEach(function(
|
|
63076
|
-
delete clone[
|
|
63273
|
+
keys2.forEach(function(key2) {
|
|
63274
|
+
delete clone[key2];
|
|
63077
63275
|
});
|
|
63078
63276
|
return clone;
|
|
63079
63277
|
}
|
|
@@ -63100,9 +63298,9 @@ function arrayFrom(value) {
|
|
|
63100
63298
|
return [].slice.call(value);
|
|
63101
63299
|
}
|
|
63102
63300
|
function removeUndefinedProps(obj) {
|
|
63103
|
-
return Object.keys(obj).reduce(function(acc,
|
|
63104
|
-
if (obj[
|
|
63105
|
-
acc[
|
|
63301
|
+
return Object.keys(obj).reduce(function(acc, key2) {
|
|
63302
|
+
if (obj[key2] !== void 0) {
|
|
63303
|
+
acc[key2] = obj[key2];
|
|
63106
63304
|
}
|
|
63107
63305
|
return acc;
|
|
63108
63306
|
}, {});
|
|
@@ -63354,8 +63552,8 @@ var setDefaultProps = function setDefaultProps2(partialProps) {
|
|
|
63354
63552
|
validateProps(partialProps, []);
|
|
63355
63553
|
}
|
|
63356
63554
|
var keys2 = Object.keys(partialProps);
|
|
63357
|
-
keys2.forEach(function(
|
|
63358
|
-
defaultProps[
|
|
63555
|
+
keys2.forEach(function(key2) {
|
|
63556
|
+
defaultProps[key2] = partialProps[key2];
|
|
63359
63557
|
});
|
|
63360
63558
|
};
|
|
63361
63559
|
function getExtendedPassedProps(passedProps) {
|
|
@@ -63374,18 +63572,18 @@ function getDataAttributeProps(reference2, plugins) {
|
|
|
63374
63572
|
var propKeys = plugins ? Object.keys(getExtendedPassedProps(Object.assign({}, defaultProps, {
|
|
63375
63573
|
plugins
|
|
63376
63574
|
}))) : defaultKeys;
|
|
63377
|
-
var props = propKeys.reduce(function(acc,
|
|
63378
|
-
var valueAsString = (reference2.getAttribute("data-tippy-" +
|
|
63575
|
+
var props = propKeys.reduce(function(acc, key2) {
|
|
63576
|
+
var valueAsString = (reference2.getAttribute("data-tippy-" + key2) || "").trim();
|
|
63379
63577
|
if (!valueAsString) {
|
|
63380
63578
|
return acc;
|
|
63381
63579
|
}
|
|
63382
|
-
if (
|
|
63383
|
-
acc[
|
|
63580
|
+
if (key2 === "content") {
|
|
63581
|
+
acc[key2] = valueAsString;
|
|
63384
63582
|
} else {
|
|
63385
63583
|
try {
|
|
63386
|
-
acc[
|
|
63584
|
+
acc[key2] = JSON.parse(valueAsString);
|
|
63387
63585
|
} catch (e) {
|
|
63388
|
-
acc[
|
|
63586
|
+
acc[key2] = valueAsString;
|
|
63389
63587
|
}
|
|
63390
63588
|
}
|
|
63391
63589
|
return acc;
|
|
@@ -64309,8 +64507,8 @@ tippy.setDefaultProps({
|
|
|
64309
64507
|
});
|
|
64310
64508
|
const _export_sfc = (sfc, props) => {
|
|
64311
64509
|
const target = sfc.__vccOpts || sfc;
|
|
64312
|
-
for (const [
|
|
64313
|
-
target[
|
|
64510
|
+
for (const [key2, val] of props) {
|
|
64511
|
+
target[key2] = val;
|
|
64314
64512
|
}
|
|
64315
64513
|
return target;
|
|
64316
64514
|
};
|
|
@@ -65702,9 +65900,9 @@ const Pagination = Extension.create({
|
|
|
65702
65900
|
if (syncMeta && syncMeta.isChangeOrigin || listSyncMeta) {
|
|
65703
65901
|
return { ...oldState };
|
|
65704
65902
|
}
|
|
65705
|
-
const
|
|
65706
|
-
if (
|
|
65707
|
-
if (
|
|
65903
|
+
const imageRegistrationMetaType = getImageRegistrationMetaType(tr);
|
|
65904
|
+
if (imageRegistrationMetaType) {
|
|
65905
|
+
if (imageRegistrationMetaType === "remove") {
|
|
65708
65906
|
onImageLoad(editor);
|
|
65709
65907
|
}
|
|
65710
65908
|
return { ...oldState };
|
|
@@ -68536,8 +68734,8 @@ function ensureTrapHandlers(name, el, handler2) {
|
|
|
68536
68734
|
function trapOn(name, el, handler2, options) {
|
|
68537
68735
|
if (name === "mousemoveoutside" || name === "clickoutside") {
|
|
68538
68736
|
const trapHandlers = ensureTrapHandlers(name, el, handler2);
|
|
68539
|
-
Object.keys(trapHandlers).forEach((
|
|
68540
|
-
on(
|
|
68737
|
+
Object.keys(trapHandlers).forEach((key2) => {
|
|
68738
|
+
on(key2, document, trapHandlers[key2], options);
|
|
68541
68739
|
});
|
|
68542
68740
|
return true;
|
|
68543
68741
|
}
|
|
@@ -68546,8 +68744,8 @@ function trapOn(name, el, handler2, options) {
|
|
|
68546
68744
|
function trapOff(name, el, handler2, options) {
|
|
68547
68745
|
if (name === "mousemoveoutside" || name === "clickoutside") {
|
|
68548
68746
|
const trapHandlers = ensureTrapHandlers(name, el, handler2);
|
|
68549
|
-
Object.keys(trapHandlers).forEach((
|
|
68550
|
-
off(
|
|
68747
|
+
Object.keys(trapHandlers).forEach((key2) => {
|
|
68748
|
+
off(key2, document, trapHandlers[key2], options);
|
|
68551
68749
|
});
|
|
68552
68750
|
return true;
|
|
68553
68751
|
}
|
|
@@ -68885,9 +69083,9 @@ function isMounted() {
|
|
|
68885
69083
|
}
|
|
68886
69084
|
function useCompitable(reactive2, keys2) {
|
|
68887
69085
|
return computed(() => {
|
|
68888
|
-
for (const
|
|
68889
|
-
if (reactive2[
|
|
68890
|
-
return reactive2[
|
|
69086
|
+
for (const key2 of keys2) {
|
|
69087
|
+
if (reactive2[key2] !== void 0)
|
|
69088
|
+
return reactive2[key2];
|
|
68891
69089
|
}
|
|
68892
69090
|
return reactive2[keys2[keys2.length - 1]];
|
|
68893
69091
|
});
|
|
@@ -68923,10 +69121,10 @@ function useKeyboard(options = {}, enabledRef) {
|
|
|
68923
69121
|
break;
|
|
68924
69122
|
}
|
|
68925
69123
|
if (keydown !== void 0) {
|
|
68926
|
-
Object.keys(keydown).forEach((
|
|
68927
|
-
if (
|
|
69124
|
+
Object.keys(keydown).forEach((key2) => {
|
|
69125
|
+
if (key2 !== e.key)
|
|
68928
69126
|
return;
|
|
68929
|
-
const handler2 = keydown[
|
|
69127
|
+
const handler2 = keydown[key2];
|
|
68930
69128
|
if (typeof handler2 === "function") {
|
|
68931
69129
|
handler2(e);
|
|
68932
69130
|
} else {
|
|
@@ -68957,10 +69155,10 @@ function useKeyboard(options = {}, enabledRef) {
|
|
|
68957
69155
|
break;
|
|
68958
69156
|
}
|
|
68959
69157
|
if (keyup !== void 0) {
|
|
68960
|
-
Object.keys(keyup).forEach((
|
|
68961
|
-
if (
|
|
69158
|
+
Object.keys(keyup).forEach((key2) => {
|
|
69159
|
+
if (key2 !== e.key)
|
|
68962
69160
|
return;
|
|
68963
|
-
const handler2 = keyup[
|
|
69161
|
+
const handler2 = keyup[key2];
|
|
68964
69162
|
if (typeof handler2 === "function") {
|
|
68965
69163
|
handler2(e);
|
|
68966
69164
|
} else {
|
|
@@ -69004,8 +69202,8 @@ function useKeyboard(options = {}, enabledRef) {
|
|
|
69004
69202
|
}
|
|
69005
69203
|
return readonly(state2);
|
|
69006
69204
|
}
|
|
69007
|
-
function createInjectionKey(
|
|
69008
|
-
return
|
|
69205
|
+
function createInjectionKey(key2) {
|
|
69206
|
+
return key2;
|
|
69009
69207
|
}
|
|
69010
69208
|
const internalSelectionMenuBodyInjectionKey = createInjectionKey("n-internal-select-menu-body");
|
|
69011
69209
|
const drawerBodyInjectionKey = createInjectionKey("n-drawer-body");
|
|
@@ -71103,8 +71301,8 @@ function getFirstSlotVNode(slots, slotName = "default", props = void 0) {
|
|
|
71103
71301
|
}
|
|
71104
71302
|
function keep(object, keys2 = [], rest) {
|
|
71105
71303
|
const keepedObject = {};
|
|
71106
|
-
keys2.forEach((
|
|
71107
|
-
keepedObject[
|
|
71304
|
+
keys2.forEach((key2) => {
|
|
71305
|
+
keepedObject[key2] = object[key2];
|
|
71108
71306
|
});
|
|
71109
71307
|
return Object.assign(keepedObject, rest);
|
|
71110
71308
|
}
|
|
@@ -71199,8 +71397,8 @@ function useThemeClass(componentName, hashRef, cssVarsRef, props) {
|
|
|
71199
71397
|
renderCallback = () => {
|
|
71200
71398
|
const cssVars = cssVarsRef.value;
|
|
71201
71399
|
let style2 = "";
|
|
71202
|
-
for (const
|
|
71203
|
-
style2 += `${
|
|
71400
|
+
for (const key2 in cssVars) {
|
|
71401
|
+
style2 += `${key2}: ${cssVars[key2]};`;
|
|
71204
71402
|
}
|
|
71205
71403
|
c$1(`.${finalThemeHash}`, style2).mount({
|
|
71206
71404
|
id: finalThemeHash,
|
|
@@ -71340,11 +71538,11 @@ function baseIsNative(value) {
|
|
|
71340
71538
|
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
|
71341
71539
|
return pattern.test(toSource(value));
|
|
71342
71540
|
}
|
|
71343
|
-
function getValue(object,
|
|
71344
|
-
return object == null ? void 0 : object[
|
|
71541
|
+
function getValue(object, key2) {
|
|
71542
|
+
return object == null ? void 0 : object[key2];
|
|
71345
71543
|
}
|
|
71346
|
-
function getNative(object,
|
|
71347
|
-
var value = getValue(object,
|
|
71544
|
+
function getNative(object, key2) {
|
|
71545
|
+
var value = getValue(object, key2);
|
|
71348
71546
|
return baseIsNative(value) ? value : void 0;
|
|
71349
71547
|
}
|
|
71350
71548
|
var WeakMap$1 = getNative(root, "WeakMap");
|
|
@@ -71432,16 +71630,16 @@ function isIndex(value, length2) {
|
|
|
71432
71630
|
length2 = length2 == null ? MAX_SAFE_INTEGER$1 : length2;
|
|
71433
71631
|
return !!length2 && (type2 == "number" || type2 != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length2);
|
|
71434
71632
|
}
|
|
71435
|
-
function baseAssignValue(object,
|
|
71436
|
-
if (
|
|
71437
|
-
defineProperty(object,
|
|
71633
|
+
function baseAssignValue(object, key2, value) {
|
|
71634
|
+
if (key2 == "__proto__" && defineProperty) {
|
|
71635
|
+
defineProperty(object, key2, {
|
|
71438
71636
|
"configurable": true,
|
|
71439
71637
|
"enumerable": true,
|
|
71440
71638
|
"value": value,
|
|
71441
71639
|
"writable": true
|
|
71442
71640
|
});
|
|
71443
71641
|
} else {
|
|
71444
|
-
object[
|
|
71642
|
+
object[key2] = value;
|
|
71445
71643
|
}
|
|
71446
71644
|
}
|
|
71447
71645
|
function eq(value, other) {
|
|
@@ -71449,10 +71647,10 @@ function eq(value, other) {
|
|
|
71449
71647
|
}
|
|
71450
71648
|
var objectProto$b = Object.prototype;
|
|
71451
71649
|
var hasOwnProperty$9 = objectProto$b.hasOwnProperty;
|
|
71452
|
-
function assignValue(object,
|
|
71453
|
-
var objValue = object[
|
|
71454
|
-
if (!(hasOwnProperty$9.call(object,
|
|
71455
|
-
baseAssignValue(object,
|
|
71650
|
+
function assignValue(object, key2, value) {
|
|
71651
|
+
var objValue = object[key2];
|
|
71652
|
+
if (!(hasOwnProperty$9.call(object, key2) && eq(objValue, value)) || value === void 0 && !(key2 in object)) {
|
|
71653
|
+
baseAssignValue(object, key2, value);
|
|
71456
71654
|
}
|
|
71457
71655
|
}
|
|
71458
71656
|
function copyObject(source, props, object, customizer) {
|
|
@@ -71460,15 +71658,15 @@ function copyObject(source, props, object, customizer) {
|
|
|
71460
71658
|
object || (object = {});
|
|
71461
71659
|
var index2 = -1, length2 = props.length;
|
|
71462
71660
|
while (++index2 < length2) {
|
|
71463
|
-
var
|
|
71661
|
+
var key2 = props[index2];
|
|
71464
71662
|
var newValue = void 0;
|
|
71465
71663
|
if (newValue === void 0) {
|
|
71466
|
-
newValue = source[
|
|
71664
|
+
newValue = source[key2];
|
|
71467
71665
|
}
|
|
71468
71666
|
if (isNew) {
|
|
71469
|
-
baseAssignValue(object,
|
|
71667
|
+
baseAssignValue(object, key2, newValue);
|
|
71470
71668
|
} else {
|
|
71471
|
-
assignValue(object,
|
|
71669
|
+
assignValue(object, key2, newValue);
|
|
71472
71670
|
}
|
|
71473
71671
|
}
|
|
71474
71672
|
return object;
|
|
@@ -71594,13 +71792,13 @@ var objectProto$8 = Object.prototype;
|
|
|
71594
71792
|
var hasOwnProperty$7 = objectProto$8.hasOwnProperty;
|
|
71595
71793
|
function arrayLikeKeys(value, inherited) {
|
|
71596
71794
|
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;
|
|
71597
|
-
for (var
|
|
71598
|
-
if ((inherited || hasOwnProperty$7.call(value,
|
|
71599
|
-
(
|
|
71600
|
-
isBuff && (
|
|
71601
|
-
isType2 && (
|
|
71602
|
-
isIndex(
|
|
71603
|
-
result.push(
|
|
71795
|
+
for (var key2 in value) {
|
|
71796
|
+
if ((inherited || hasOwnProperty$7.call(value, key2)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
71797
|
+
(key2 == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
71798
|
+
isBuff && (key2 == "offset" || key2 == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
71799
|
+
isType2 && (key2 == "buffer" || key2 == "byteLength" || key2 == "byteOffset") || // Skip index properties.
|
|
71800
|
+
isIndex(key2, length2)))) {
|
|
71801
|
+
result.push(key2);
|
|
71604
71802
|
}
|
|
71605
71803
|
}
|
|
71606
71804
|
return result;
|
|
@@ -71618,9 +71816,9 @@ function baseKeys(object) {
|
|
|
71618
71816
|
return nativeKeys(object);
|
|
71619
71817
|
}
|
|
71620
71818
|
var result = [];
|
|
71621
|
-
for (var
|
|
71622
|
-
if (hasOwnProperty$6.call(object,
|
|
71623
|
-
result.push(
|
|
71819
|
+
for (var key2 in Object(object)) {
|
|
71820
|
+
if (hasOwnProperty$6.call(object, key2) && key2 != "constructor") {
|
|
71821
|
+
result.push(key2);
|
|
71624
71822
|
}
|
|
71625
71823
|
}
|
|
71626
71824
|
return result;
|
|
@@ -71631,8 +71829,8 @@ function keys(object) {
|
|
|
71631
71829
|
function nativeKeysIn(object) {
|
|
71632
71830
|
var result = [];
|
|
71633
71831
|
if (object != null) {
|
|
71634
|
-
for (var
|
|
71635
|
-
result.push(
|
|
71832
|
+
for (var key2 in Object(object)) {
|
|
71833
|
+
result.push(key2);
|
|
71636
71834
|
}
|
|
71637
71835
|
}
|
|
71638
71836
|
return result;
|
|
@@ -71644,9 +71842,9 @@ function baseKeysIn(object) {
|
|
|
71644
71842
|
return nativeKeysIn(object);
|
|
71645
71843
|
}
|
|
71646
71844
|
var isProto = isPrototype(object), result = [];
|
|
71647
|
-
for (var
|
|
71648
|
-
if (!(
|
|
71649
|
-
result.push(
|
|
71845
|
+
for (var key2 in object) {
|
|
71846
|
+
if (!(key2 == "constructor" && (isProto || !hasOwnProperty$5.call(object, key2)))) {
|
|
71847
|
+
result.push(key2);
|
|
71650
71848
|
}
|
|
71651
71849
|
}
|
|
71652
71850
|
return result;
|
|
@@ -71670,33 +71868,33 @@ function hashClear() {
|
|
|
71670
71868
|
this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
|
71671
71869
|
this.size = 0;
|
|
71672
71870
|
}
|
|
71673
|
-
function hashDelete(
|
|
71674
|
-
var result = this.has(
|
|
71871
|
+
function hashDelete(key2) {
|
|
71872
|
+
var result = this.has(key2) && delete this.__data__[key2];
|
|
71675
71873
|
this.size -= result ? 1 : 0;
|
|
71676
71874
|
return result;
|
|
71677
71875
|
}
|
|
71678
71876
|
var HASH_UNDEFINED$2 = "__lodash_hash_undefined__";
|
|
71679
71877
|
var objectProto$5 = Object.prototype;
|
|
71680
71878
|
var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
|
|
71681
|
-
function hashGet(
|
|
71879
|
+
function hashGet(key2) {
|
|
71682
71880
|
var data = this.__data__;
|
|
71683
71881
|
if (nativeCreate) {
|
|
71684
|
-
var result = data[
|
|
71882
|
+
var result = data[key2];
|
|
71685
71883
|
return result === HASH_UNDEFINED$2 ? void 0 : result;
|
|
71686
71884
|
}
|
|
71687
|
-
return hasOwnProperty$4.call(data,
|
|
71885
|
+
return hasOwnProperty$4.call(data, key2) ? data[key2] : void 0;
|
|
71688
71886
|
}
|
|
71689
71887
|
var objectProto$4 = Object.prototype;
|
|
71690
71888
|
var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
|
|
71691
|
-
function hashHas(
|
|
71889
|
+
function hashHas(key2) {
|
|
71692
71890
|
var data = this.__data__;
|
|
71693
|
-
return nativeCreate ? data[
|
|
71891
|
+
return nativeCreate ? data[key2] !== void 0 : hasOwnProperty$3.call(data, key2);
|
|
71694
71892
|
}
|
|
71695
71893
|
var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
|
|
71696
|
-
function hashSet(
|
|
71894
|
+
function hashSet(key2, value) {
|
|
71697
71895
|
var data = this.__data__;
|
|
71698
|
-
this.size += this.has(
|
|
71699
|
-
data[
|
|
71896
|
+
this.size += this.has(key2) ? 0 : 1;
|
|
71897
|
+
data[key2] = nativeCreate && value === void 0 ? HASH_UNDEFINED$1 : value;
|
|
71700
71898
|
return this;
|
|
71701
71899
|
}
|
|
71702
71900
|
function Hash(entries) {
|
|
@@ -71716,10 +71914,10 @@ function listCacheClear() {
|
|
|
71716
71914
|
this.__data__ = [];
|
|
71717
71915
|
this.size = 0;
|
|
71718
71916
|
}
|
|
71719
|
-
function assocIndexOf(array,
|
|
71917
|
+
function assocIndexOf(array, key2) {
|
|
71720
71918
|
var length2 = array.length;
|
|
71721
71919
|
while (length2--) {
|
|
71722
|
-
if (eq(array[length2][0],
|
|
71920
|
+
if (eq(array[length2][0], key2)) {
|
|
71723
71921
|
return length2;
|
|
71724
71922
|
}
|
|
71725
71923
|
}
|
|
@@ -71727,8 +71925,8 @@ function assocIndexOf(array, key) {
|
|
|
71727
71925
|
}
|
|
71728
71926
|
var arrayProto = Array.prototype;
|
|
71729
71927
|
var splice = arrayProto.splice;
|
|
71730
|
-
function listCacheDelete(
|
|
71731
|
-
var data = this.__data__, index2 = assocIndexOf(data,
|
|
71928
|
+
function listCacheDelete(key2) {
|
|
71929
|
+
var data = this.__data__, index2 = assocIndexOf(data, key2);
|
|
71732
71930
|
if (index2 < 0) {
|
|
71733
71931
|
return false;
|
|
71734
71932
|
}
|
|
@@ -71741,18 +71939,18 @@ function listCacheDelete(key) {
|
|
|
71741
71939
|
--this.size;
|
|
71742
71940
|
return true;
|
|
71743
71941
|
}
|
|
71744
|
-
function listCacheGet(
|
|
71745
|
-
var data = this.__data__, index2 = assocIndexOf(data,
|
|
71942
|
+
function listCacheGet(key2) {
|
|
71943
|
+
var data = this.__data__, index2 = assocIndexOf(data, key2);
|
|
71746
71944
|
return index2 < 0 ? void 0 : data[index2][1];
|
|
71747
71945
|
}
|
|
71748
|
-
function listCacheHas(
|
|
71749
|
-
return assocIndexOf(this.__data__,
|
|
71946
|
+
function listCacheHas(key2) {
|
|
71947
|
+
return assocIndexOf(this.__data__, key2) > -1;
|
|
71750
71948
|
}
|
|
71751
|
-
function listCacheSet(
|
|
71752
|
-
var data = this.__data__, index2 = assocIndexOf(data,
|
|
71949
|
+
function listCacheSet(key2, value) {
|
|
71950
|
+
var data = this.__data__, index2 = assocIndexOf(data, key2);
|
|
71753
71951
|
if (index2 < 0) {
|
|
71754
71952
|
++this.size;
|
|
71755
|
-
data.push([
|
|
71953
|
+
data.push([key2, value]);
|
|
71756
71954
|
} else {
|
|
71757
71955
|
data[index2][1] = value;
|
|
71758
71956
|
}
|
|
@@ -71784,24 +71982,24 @@ function isKeyable(value) {
|
|
|
71784
71982
|
var type2 = typeof value;
|
|
71785
71983
|
return type2 == "string" || type2 == "number" || type2 == "symbol" || type2 == "boolean" ? value !== "__proto__" : value === null;
|
|
71786
71984
|
}
|
|
71787
|
-
function getMapData(map22,
|
|
71985
|
+
function getMapData(map22, key2) {
|
|
71788
71986
|
var data = map22.__data__;
|
|
71789
|
-
return isKeyable(
|
|
71987
|
+
return isKeyable(key2) ? data[typeof key2 == "string" ? "string" : "hash"] : data.map;
|
|
71790
71988
|
}
|
|
71791
|
-
function mapCacheDelete(
|
|
71792
|
-
var result = getMapData(this,
|
|
71989
|
+
function mapCacheDelete(key2) {
|
|
71990
|
+
var result = getMapData(this, key2)["delete"](key2);
|
|
71793
71991
|
this.size -= result ? 1 : 0;
|
|
71794
71992
|
return result;
|
|
71795
71993
|
}
|
|
71796
|
-
function mapCacheGet(
|
|
71797
|
-
return getMapData(this,
|
|
71994
|
+
function mapCacheGet(key2) {
|
|
71995
|
+
return getMapData(this, key2).get(key2);
|
|
71798
71996
|
}
|
|
71799
|
-
function mapCacheHas(
|
|
71800
|
-
return getMapData(this,
|
|
71997
|
+
function mapCacheHas(key2) {
|
|
71998
|
+
return getMapData(this, key2).has(key2);
|
|
71801
71999
|
}
|
|
71802
|
-
function mapCacheSet(
|
|
71803
|
-
var data = getMapData(this,
|
|
71804
|
-
data.set(
|
|
72000
|
+
function mapCacheSet(key2, value) {
|
|
72001
|
+
var data = getMapData(this, key2), size2 = data.size;
|
|
72002
|
+
data.set(key2, value);
|
|
71805
72003
|
this.size += data.size == size2 ? 0 : 1;
|
|
71806
72004
|
return this;
|
|
71807
72005
|
}
|
|
@@ -71824,12 +72022,12 @@ function memoize(func, resolver) {
|
|
|
71824
72022
|
throw new TypeError(FUNC_ERROR_TEXT);
|
|
71825
72023
|
}
|
|
71826
72024
|
var memoized = function() {
|
|
71827
|
-
var args = arguments,
|
|
71828
|
-
if (cache2.has(
|
|
71829
|
-
return cache2.get(
|
|
72025
|
+
var args = arguments, key2 = resolver ? resolver.apply(this, args) : args[0], cache2 = memoized.cache;
|
|
72026
|
+
if (cache2.has(key2)) {
|
|
72027
|
+
return cache2.get(key2);
|
|
71830
72028
|
}
|
|
71831
72029
|
var result = func.apply(this, args);
|
|
71832
|
-
memoized.cache = cache2.set(
|
|
72030
|
+
memoized.cache = cache2.set(key2, result) || cache2;
|
|
71833
72031
|
return result;
|
|
71834
72032
|
};
|
|
71835
72033
|
memoized.cache = new (memoize.Cache || MapCache)();
|
|
@@ -71838,11 +72036,11 @@ function memoize(func, resolver) {
|
|
|
71838
72036
|
memoize.Cache = MapCache;
|
|
71839
72037
|
var MAX_MEMOIZE_SIZE = 500;
|
|
71840
72038
|
function memoizeCapped(func) {
|
|
71841
|
-
var result = memoize(func, function(
|
|
72039
|
+
var result = memoize(func, function(key2) {
|
|
71842
72040
|
if (cache2.size === MAX_MEMOIZE_SIZE) {
|
|
71843
72041
|
cache2.clear();
|
|
71844
72042
|
}
|
|
71845
|
-
return
|
|
72043
|
+
return key2;
|
|
71846
72044
|
});
|
|
71847
72045
|
var cache2 = result.cache;
|
|
71848
72046
|
return result;
|
|
@@ -71915,30 +72113,30 @@ function stackClear() {
|
|
|
71915
72113
|
this.__data__ = new ListCache();
|
|
71916
72114
|
this.size = 0;
|
|
71917
72115
|
}
|
|
71918
|
-
function stackDelete(
|
|
71919
|
-
var data = this.__data__, result = data["delete"](
|
|
72116
|
+
function stackDelete(key2) {
|
|
72117
|
+
var data = this.__data__, result = data["delete"](key2);
|
|
71920
72118
|
this.size = data.size;
|
|
71921
72119
|
return result;
|
|
71922
72120
|
}
|
|
71923
|
-
function stackGet(
|
|
71924
|
-
return this.__data__.get(
|
|
72121
|
+
function stackGet(key2) {
|
|
72122
|
+
return this.__data__.get(key2);
|
|
71925
72123
|
}
|
|
71926
|
-
function stackHas(
|
|
71927
|
-
return this.__data__.has(
|
|
72124
|
+
function stackHas(key2) {
|
|
72125
|
+
return this.__data__.has(key2);
|
|
71928
72126
|
}
|
|
71929
72127
|
var LARGE_ARRAY_SIZE = 200;
|
|
71930
|
-
function stackSet(
|
|
72128
|
+
function stackSet(key2, value) {
|
|
71931
72129
|
var data = this.__data__;
|
|
71932
72130
|
if (data instanceof ListCache) {
|
|
71933
72131
|
var pairs = data.__data__;
|
|
71934
72132
|
if (!Map$1 || pairs.length < LARGE_ARRAY_SIZE - 1) {
|
|
71935
|
-
pairs.push([
|
|
72133
|
+
pairs.push([key2, value]);
|
|
71936
72134
|
this.size = ++data.size;
|
|
71937
72135
|
return this;
|
|
71938
72136
|
}
|
|
71939
72137
|
data = this.__data__ = new MapCache(pairs);
|
|
71940
72138
|
}
|
|
71941
|
-
data.set(
|
|
72139
|
+
data.set(key2, value);
|
|
71942
72140
|
this.size = data.size;
|
|
71943
72141
|
return this;
|
|
71944
72142
|
}
|
|
@@ -72059,8 +72257,8 @@ function arraySome(array, predicate) {
|
|
|
72059
72257
|
}
|
|
72060
72258
|
return false;
|
|
72061
72259
|
}
|
|
72062
|
-
function cacheHas(cache2,
|
|
72063
|
-
return cache2.has(
|
|
72260
|
+
function cacheHas(cache2, key2) {
|
|
72261
|
+
return cache2.has(key2);
|
|
72064
72262
|
}
|
|
72065
72263
|
var COMPARE_PARTIAL_FLAG$5 = 1, COMPARE_UNORDERED_FLAG$3 = 2;
|
|
72066
72264
|
function equalArrays(array, other, bitmask, customizer, equalFunc, stack2) {
|
|
@@ -72108,8 +72306,8 @@ function equalArrays(array, other, bitmask, customizer, equalFunc, stack2) {
|
|
|
72108
72306
|
}
|
|
72109
72307
|
function mapToArray(map22) {
|
|
72110
72308
|
var index2 = -1, result = Array(map22.size);
|
|
72111
|
-
map22.forEach(function(value,
|
|
72112
|
-
result[++index2] = [
|
|
72309
|
+
map22.forEach(function(value, key2) {
|
|
72310
|
+
result[++index2] = [key2, value];
|
|
72113
72311
|
});
|
|
72114
72312
|
return result;
|
|
72115
72313
|
}
|
|
@@ -72180,8 +72378,8 @@ function equalObjects(object, other, bitmask, customizer, equalFunc, stack2) {
|
|
|
72180
72378
|
}
|
|
72181
72379
|
var index2 = objLength;
|
|
72182
72380
|
while (index2--) {
|
|
72183
|
-
var
|
|
72184
|
-
if (!(isPartial ?
|
|
72381
|
+
var key2 = objProps[index2];
|
|
72382
|
+
if (!(isPartial ? key2 in other : hasOwnProperty$1.call(other, key2))) {
|
|
72185
72383
|
return false;
|
|
72186
72384
|
}
|
|
72187
72385
|
}
|
|
@@ -72195,16 +72393,16 @@ function equalObjects(object, other, bitmask, customizer, equalFunc, stack2) {
|
|
|
72195
72393
|
stack2.set(other, object);
|
|
72196
72394
|
var skipCtor = isPartial;
|
|
72197
72395
|
while (++index2 < objLength) {
|
|
72198
|
-
|
|
72199
|
-
var objValue = object[
|
|
72396
|
+
key2 = objProps[index2];
|
|
72397
|
+
var objValue = object[key2], othValue = other[key2];
|
|
72200
72398
|
if (customizer) {
|
|
72201
|
-
var compared = isPartial ? customizer(othValue, objValue,
|
|
72399
|
+
var compared = isPartial ? customizer(othValue, objValue, key2, other, object, stack2) : customizer(objValue, othValue, key2, object, other, stack2);
|
|
72202
72400
|
}
|
|
72203
72401
|
if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack2) : compared)) {
|
|
72204
72402
|
result = false;
|
|
72205
72403
|
break;
|
|
72206
72404
|
}
|
|
72207
|
-
skipCtor || (skipCtor =
|
|
72405
|
+
skipCtor || (skipCtor = key2 == "constructor");
|
|
72208
72406
|
}
|
|
72209
72407
|
if (result && !skipCtor) {
|
|
72210
72408
|
var objCtor = object.constructor, othCtor = other.constructor;
|
|
@@ -72274,9 +72472,9 @@ function baseIsMatch(object, source, matchData, customizer) {
|
|
|
72274
72472
|
}
|
|
72275
72473
|
while (++index2 < length2) {
|
|
72276
72474
|
data = matchData[index2];
|
|
72277
|
-
var
|
|
72475
|
+
var key2 = data[0], objValue = object[key2], srcValue = data[1];
|
|
72278
72476
|
if (data[2]) {
|
|
72279
|
-
if (objValue === void 0 && !(
|
|
72477
|
+
if (objValue === void 0 && !(key2 in object)) {
|
|
72280
72478
|
return false;
|
|
72281
72479
|
}
|
|
72282
72480
|
} else {
|
|
@@ -72295,17 +72493,17 @@ function isStrictComparable(value) {
|
|
|
72295
72493
|
function getMatchData(object) {
|
|
72296
72494
|
var result = keys(object), length2 = result.length;
|
|
72297
72495
|
while (length2--) {
|
|
72298
|
-
var
|
|
72299
|
-
result[length2] = [
|
|
72496
|
+
var key2 = result[length2], value = object[key2];
|
|
72497
|
+
result[length2] = [key2, value, isStrictComparable(value)];
|
|
72300
72498
|
}
|
|
72301
72499
|
return result;
|
|
72302
72500
|
}
|
|
72303
|
-
function matchesStrictComparable(
|
|
72501
|
+
function matchesStrictComparable(key2, srcValue) {
|
|
72304
72502
|
return function(object) {
|
|
72305
72503
|
if (object == null) {
|
|
72306
72504
|
return false;
|
|
72307
72505
|
}
|
|
72308
|
-
return object[
|
|
72506
|
+
return object[key2] === srcValue && (srcValue !== void 0 || key2 in Object(object));
|
|
72309
72507
|
};
|
|
72310
72508
|
}
|
|
72311
72509
|
function baseMatches(source) {
|
|
@@ -72317,24 +72515,24 @@ function baseMatches(source) {
|
|
|
72317
72515
|
return object === source || baseIsMatch(object, source, matchData);
|
|
72318
72516
|
};
|
|
72319
72517
|
}
|
|
72320
|
-
function baseHasIn(object,
|
|
72321
|
-
return object != null &&
|
|
72518
|
+
function baseHasIn(object, key2) {
|
|
72519
|
+
return object != null && key2 in Object(object);
|
|
72322
72520
|
}
|
|
72323
72521
|
function hasPath(object, path, hasFunc) {
|
|
72324
72522
|
path = castPath(path, object);
|
|
72325
72523
|
var index2 = -1, length2 = path.length, result = false;
|
|
72326
72524
|
while (++index2 < length2) {
|
|
72327
|
-
var
|
|
72328
|
-
if (!(result = object != null && hasFunc(object,
|
|
72525
|
+
var key2 = toKey(path[index2]);
|
|
72526
|
+
if (!(result = object != null && hasFunc(object, key2))) {
|
|
72329
72527
|
break;
|
|
72330
72528
|
}
|
|
72331
|
-
object = object[
|
|
72529
|
+
object = object[key2];
|
|
72332
72530
|
}
|
|
72333
72531
|
if (result || ++index2 != length2) {
|
|
72334
72532
|
return result;
|
|
72335
72533
|
}
|
|
72336
72534
|
length2 = object == null ? 0 : object.length;
|
|
72337
|
-
return !!length2 && isLength(length2) && isIndex(
|
|
72535
|
+
return !!length2 && isLength(length2) && isIndex(key2, length2) && (isArray(object) || isArguments(object));
|
|
72338
72536
|
}
|
|
72339
72537
|
function hasIn(object, path) {
|
|
72340
72538
|
return object != null && hasPath(object, path, baseHasIn);
|
|
@@ -72349,9 +72547,9 @@ function baseMatchesProperty(path, srcValue) {
|
|
|
72349
72547
|
return objValue === void 0 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
|
|
72350
72548
|
};
|
|
72351
72549
|
}
|
|
72352
|
-
function baseProperty(
|
|
72550
|
+
function baseProperty(key2) {
|
|
72353
72551
|
return function(object) {
|
|
72354
|
-
return object == null ? void 0 : object[
|
|
72552
|
+
return object == null ? void 0 : object[key2];
|
|
72355
72553
|
};
|
|
72356
72554
|
}
|
|
72357
72555
|
function basePropertyDeep(path) {
|
|
@@ -72378,8 +72576,8 @@ function createBaseFor(fromRight) {
|
|
|
72378
72576
|
return function(object, iteratee, keysFunc) {
|
|
72379
72577
|
var index2 = -1, iterable = Object(object), props = keysFunc(object), length2 = props.length;
|
|
72380
72578
|
while (length2--) {
|
|
72381
|
-
var
|
|
72382
|
-
if (iteratee(iterable[
|
|
72579
|
+
var key2 = props[++index2];
|
|
72580
|
+
if (iteratee(iterable[key2], key2, iterable) === false) {
|
|
72383
72581
|
break;
|
|
72384
72582
|
}
|
|
72385
72583
|
}
|
|
@@ -72408,33 +72606,33 @@ function createBaseEach(eachFunc, fromRight) {
|
|
|
72408
72606
|
};
|
|
72409
72607
|
}
|
|
72410
72608
|
var baseEach = createBaseEach(baseForOwn);
|
|
72411
|
-
function assignMergeValue(object,
|
|
72412
|
-
if (value !== void 0 && !eq(object[
|
|
72413
|
-
baseAssignValue(object,
|
|
72609
|
+
function assignMergeValue(object, key2, value) {
|
|
72610
|
+
if (value !== void 0 && !eq(object[key2], value) || value === void 0 && !(key2 in object)) {
|
|
72611
|
+
baseAssignValue(object, key2, value);
|
|
72414
72612
|
}
|
|
72415
72613
|
}
|
|
72416
72614
|
function isArrayLikeObject(value) {
|
|
72417
72615
|
return isObjectLike(value) && isArrayLike(value);
|
|
72418
72616
|
}
|
|
72419
|
-
function safeGet(object,
|
|
72420
|
-
if (
|
|
72617
|
+
function safeGet(object, key2) {
|
|
72618
|
+
if (key2 === "constructor" && typeof object[key2] === "function") {
|
|
72421
72619
|
return;
|
|
72422
72620
|
}
|
|
72423
|
-
if (
|
|
72621
|
+
if (key2 == "__proto__") {
|
|
72424
72622
|
return;
|
|
72425
72623
|
}
|
|
72426
|
-
return object[
|
|
72624
|
+
return object[key2];
|
|
72427
72625
|
}
|
|
72428
72626
|
function toPlainObject(value) {
|
|
72429
72627
|
return copyObject(value, keysIn(value));
|
|
72430
72628
|
}
|
|
72431
|
-
function baseMergeDeep(object, source,
|
|
72432
|
-
var objValue = safeGet(object,
|
|
72629
|
+
function baseMergeDeep(object, source, key2, srcIndex, mergeFunc, customizer, stack2) {
|
|
72630
|
+
var objValue = safeGet(object, key2), srcValue = safeGet(source, key2), stacked = stack2.get(srcValue);
|
|
72433
72631
|
if (stacked) {
|
|
72434
|
-
assignMergeValue(object,
|
|
72632
|
+
assignMergeValue(object, key2, stacked);
|
|
72435
72633
|
return;
|
|
72436
72634
|
}
|
|
72437
|
-
var newValue = customizer ? customizer(objValue, srcValue,
|
|
72635
|
+
var newValue = customizer ? customizer(objValue, srcValue, key2 + "", object, source, stack2) : void 0;
|
|
72438
72636
|
var isCommon = newValue === void 0;
|
|
72439
72637
|
if (isCommon) {
|
|
72440
72638
|
var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
|
|
@@ -72469,29 +72667,29 @@ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, sta
|
|
|
72469
72667
|
mergeFunc(newValue, srcValue, srcIndex, customizer, stack2);
|
|
72470
72668
|
stack2["delete"](srcValue);
|
|
72471
72669
|
}
|
|
72472
|
-
assignMergeValue(object,
|
|
72670
|
+
assignMergeValue(object, key2, newValue);
|
|
72473
72671
|
}
|
|
72474
72672
|
function baseMerge(object, source, srcIndex, customizer, stack2) {
|
|
72475
72673
|
if (object === source) {
|
|
72476
72674
|
return;
|
|
72477
72675
|
}
|
|
72478
|
-
baseFor(source, function(srcValue,
|
|
72676
|
+
baseFor(source, function(srcValue, key2) {
|
|
72479
72677
|
stack2 || (stack2 = new Stack());
|
|
72480
72678
|
if (isObject(srcValue)) {
|
|
72481
|
-
baseMergeDeep(object, source,
|
|
72679
|
+
baseMergeDeep(object, source, key2, srcIndex, baseMerge, customizer, stack2);
|
|
72482
72680
|
} else {
|
|
72483
|
-
var newValue = customizer ? customizer(safeGet(object,
|
|
72681
|
+
var newValue = customizer ? customizer(safeGet(object, key2), srcValue, key2 + "", object, source, stack2) : void 0;
|
|
72484
72682
|
if (newValue === void 0) {
|
|
72485
72683
|
newValue = srcValue;
|
|
72486
72684
|
}
|
|
72487
|
-
assignMergeValue(object,
|
|
72685
|
+
assignMergeValue(object, key2, newValue);
|
|
72488
72686
|
}
|
|
72489
72687
|
}, keysIn);
|
|
72490
72688
|
}
|
|
72491
72689
|
function baseMap(collection, iteratee) {
|
|
72492
72690
|
var index2 = -1, result = isArrayLike(collection) ? Array(collection.length) : [];
|
|
72493
|
-
baseEach(collection, function(value,
|
|
72494
|
-
result[++index2] = iteratee(value,
|
|
72691
|
+
baseEach(collection, function(value, key2, collection2) {
|
|
72692
|
+
result[++index2] = iteratee(value, key2, collection2);
|
|
72495
72693
|
});
|
|
72496
72694
|
return result;
|
|
72497
72695
|
}
|
|
@@ -73829,18 +74027,18 @@ function unwrapIndeterminateKeys(result) {
|
|
|
73829
74027
|
}
|
|
73830
74028
|
function merge(originalKeys, keysToAdd) {
|
|
73831
74029
|
const set = new Set(originalKeys);
|
|
73832
|
-
keysToAdd.forEach((
|
|
73833
|
-
if (!set.has(
|
|
73834
|
-
set.add(
|
|
74030
|
+
keysToAdd.forEach((key2) => {
|
|
74031
|
+
if (!set.has(key2)) {
|
|
74032
|
+
set.add(key2);
|
|
73835
74033
|
}
|
|
73836
74034
|
});
|
|
73837
74035
|
return Array.from(set);
|
|
73838
74036
|
}
|
|
73839
74037
|
function minus(originalKeys, keysToRemove) {
|
|
73840
74038
|
const set = new Set(originalKeys);
|
|
73841
|
-
keysToRemove.forEach((
|
|
73842
|
-
if (set.has(
|
|
73843
|
-
set.delete(
|
|
74039
|
+
keysToRemove.forEach((key2) => {
|
|
74040
|
+
if (set.has(key2)) {
|
|
74041
|
+
set.delete(key2);
|
|
73844
74042
|
}
|
|
73845
74043
|
});
|
|
73846
74044
|
return Array.from(set);
|
|
@@ -73882,12 +74080,12 @@ function getExtendedCheckedKeySetAfterUncheck(uncheckedKeys, currentCheckedKeys,
|
|
|
73882
74080
|
const extendedKeySetToUncheck = getExtendedCheckedKeySet(uncheckedKeys, treeMate, allowNotLoaded, true);
|
|
73883
74081
|
const ascendantKeySet = getAvailableAscendantNodeSet(uncheckedKeys, treeMate);
|
|
73884
74082
|
const keysToRemove = [];
|
|
73885
|
-
extendedCheckedKeySet.forEach((
|
|
73886
|
-
if (extendedKeySetToUncheck.has(
|
|
73887
|
-
keysToRemove.push(
|
|
74083
|
+
extendedCheckedKeySet.forEach((key2) => {
|
|
74084
|
+
if (extendedKeySetToUncheck.has(key2) || ascendantKeySet.has(key2)) {
|
|
74085
|
+
keysToRemove.push(key2);
|
|
73888
74086
|
}
|
|
73889
74087
|
});
|
|
73890
|
-
keysToRemove.forEach((
|
|
74088
|
+
keysToRemove.forEach((key2) => extendedCheckedKeySet.delete(key2));
|
|
73891
74089
|
return extendedCheckedKeySet;
|
|
73892
74090
|
}
|
|
73893
74091
|
function getCheckedKeys(options, treeMate) {
|
|
@@ -73996,11 +74194,11 @@ function getExtendedCheckedKeySet(checkedKeys, treeMate, allowNotLoaded, isUnche
|
|
|
73996
74194
|
if (treeNode.disabled) {
|
|
73997
74195
|
return TRAVERSE_COMMAND.STOP;
|
|
73998
74196
|
}
|
|
73999
|
-
const { key } = treeNode;
|
|
74000
|
-
if (visitedKeySet.has(
|
|
74197
|
+
const { key: key2 } = treeNode;
|
|
74198
|
+
if (visitedKeySet.has(key2))
|
|
74001
74199
|
return;
|
|
74002
|
-
visitedKeySet.add(
|
|
74003
|
-
extendedKeySet.add(
|
|
74200
|
+
visitedKeySet.add(key2);
|
|
74201
|
+
extendedKeySet.add(key2);
|
|
74004
74202
|
if (isExpilicitlyNotLoaded(treeNode.rawNode, getChildren2)) {
|
|
74005
74203
|
if (isUnchecking) {
|
|
74006
74204
|
return TRAVERSE_COMMAND.STOP;
|
|
@@ -74013,10 +74211,10 @@ function getExtendedCheckedKeySet(checkedKeys, treeMate, allowNotLoaded, isUnche
|
|
|
74013
74211
|
});
|
|
74014
74212
|
return extendedKeySet;
|
|
74015
74213
|
}
|
|
74016
|
-
function getPath(
|
|
74214
|
+
function getPath(key2, { includeGroup = false, includeSelf = true }, treeMate) {
|
|
74017
74215
|
var _a2;
|
|
74018
74216
|
const treeNodeMap = treeMate.treeNodeMap;
|
|
74019
|
-
let treeNode =
|
|
74217
|
+
let treeNode = key2 === null || key2 === void 0 ? null : (_a2 = treeNodeMap.get(key2)) !== null && _a2 !== void 0 ? _a2 : null;
|
|
74020
74218
|
const mergedPath = {
|
|
74021
74219
|
keyPath: [],
|
|
74022
74220
|
treeNodePath: [],
|
|
@@ -74262,44 +74460,44 @@ function createTreeMate(rawNodes, options = {}) {
|
|
|
74262
74460
|
}
|
|
74263
74461
|
}, moveMethods);
|
|
74264
74462
|
const treeNodes = createTreeNodes(rawNodes, treeNodeMap, levelTreeNodeMap, nodeProto, getChildren2);
|
|
74265
|
-
function getNode(
|
|
74266
|
-
if (
|
|
74463
|
+
function getNode(key2) {
|
|
74464
|
+
if (key2 === null || key2 === void 0)
|
|
74267
74465
|
return null;
|
|
74268
|
-
const tmNode = treeNodeMap.get(
|
|
74466
|
+
const tmNode = treeNodeMap.get(key2);
|
|
74269
74467
|
if (tmNode && !tmNode.isGroup && !tmNode.ignored) {
|
|
74270
74468
|
return tmNode;
|
|
74271
74469
|
}
|
|
74272
74470
|
return null;
|
|
74273
74471
|
}
|
|
74274
|
-
function _getNode(
|
|
74275
|
-
if (
|
|
74472
|
+
function _getNode(key2) {
|
|
74473
|
+
if (key2 === null || key2 === void 0)
|
|
74276
74474
|
return null;
|
|
74277
|
-
const tmNode = treeNodeMap.get(
|
|
74475
|
+
const tmNode = treeNodeMap.get(key2);
|
|
74278
74476
|
if (tmNode && !tmNode.ignored) {
|
|
74279
74477
|
return tmNode;
|
|
74280
74478
|
}
|
|
74281
74479
|
return null;
|
|
74282
74480
|
}
|
|
74283
|
-
function getPrev(
|
|
74284
|
-
const node = _getNode(
|
|
74481
|
+
function getPrev(key2, options2) {
|
|
74482
|
+
const node = _getNode(key2);
|
|
74285
74483
|
if (!node)
|
|
74286
74484
|
return null;
|
|
74287
74485
|
return node.getPrev(options2);
|
|
74288
74486
|
}
|
|
74289
|
-
function getNext(
|
|
74290
|
-
const node = _getNode(
|
|
74487
|
+
function getNext(key2, options2) {
|
|
74488
|
+
const node = _getNode(key2);
|
|
74291
74489
|
if (!node)
|
|
74292
74490
|
return null;
|
|
74293
74491
|
return node.getNext(options2);
|
|
74294
74492
|
}
|
|
74295
|
-
function getParent(
|
|
74296
|
-
const node = _getNode(
|
|
74493
|
+
function getParent(key2) {
|
|
74494
|
+
const node = _getNode(key2);
|
|
74297
74495
|
if (!node)
|
|
74298
74496
|
return null;
|
|
74299
74497
|
return node.getParent();
|
|
74300
74498
|
}
|
|
74301
|
-
function getChild2(
|
|
74302
|
-
const node = _getNode(
|
|
74499
|
+
function getChild2(key2) {
|
|
74500
|
+
const node = _getNode(key2);
|
|
74303
74501
|
if (!node)
|
|
74304
74502
|
return null;
|
|
74305
74503
|
return node.getChild();
|
|
@@ -74321,8 +74519,8 @@ function createTreeMate(rawNodes, options = {}) {
|
|
|
74321
74519
|
getFirstAvailableNode() {
|
|
74322
74520
|
return getFirstAvailableNode(treeNodes);
|
|
74323
74521
|
},
|
|
74324
|
-
getPath(
|
|
74325
|
-
return getPath(
|
|
74522
|
+
getPath(key2, options2 = {}) {
|
|
74523
|
+
return getPath(key2, options2, treemate);
|
|
74326
74524
|
},
|
|
74327
74525
|
getCheckedKeys(checkedKeys, options2 = {}) {
|
|
74328
74526
|
const { cascade = true, leafOnly = false, checkStrategy = "all", allowNotLoaded = false } = options2;
|
|
@@ -75850,7 +76048,7 @@ const NDropdownOption = defineComponent({
|
|
|
75850
76048
|
const showSubmenuRef = computed(() => {
|
|
75851
76049
|
if (!hasSubmenuRef.value) return false;
|
|
75852
76050
|
const {
|
|
75853
|
-
key,
|
|
76051
|
+
key: key2,
|
|
75854
76052
|
disabled
|
|
75855
76053
|
} = props.tmNode;
|
|
75856
76054
|
if (disabled) return false;
|
|
@@ -75866,11 +76064,11 @@ const NDropdownOption = defineComponent({
|
|
|
75866
76064
|
const {
|
|
75867
76065
|
value: pendingKeyPath
|
|
75868
76066
|
} = pendingKeyPathRef;
|
|
75869
|
-
if (hoverKey !== null) return pendingKeyPath.includes(
|
|
76067
|
+
if (hoverKey !== null) return pendingKeyPath.includes(key2);
|
|
75870
76068
|
if (keyboardKey !== null) {
|
|
75871
|
-
return pendingKeyPath.includes(
|
|
76069
|
+
return pendingKeyPath.includes(key2) && pendingKeyPath[pendingKeyPath.length - 1] !== key2;
|
|
75872
76070
|
}
|
|
75873
|
-
if (lastToggledSubmenuKey !== null) return pendingKeyPath.includes(
|
|
76071
|
+
if (lastToggledSubmenuKey !== null) return pendingKeyPath.includes(key2);
|
|
75874
76072
|
return false;
|
|
75875
76073
|
});
|
|
75876
76074
|
const shouldDelayRef = computed(() => {
|
|
@@ -75956,18 +76154,18 @@ const NDropdownOption = defineComponent({
|
|
|
75956
76154
|
value: pendingKeyPath
|
|
75957
76155
|
} = pendingKeyPathRef;
|
|
75958
76156
|
const {
|
|
75959
|
-
key
|
|
76157
|
+
key: key2
|
|
75960
76158
|
} = props.tmNode;
|
|
75961
|
-
return pendingKeyPath.includes(
|
|
76159
|
+
return pendingKeyPath.includes(key2);
|
|
75962
76160
|
}),
|
|
75963
76161
|
childActive: useMemo(() => {
|
|
75964
76162
|
const {
|
|
75965
76163
|
value: activeKeyPath
|
|
75966
76164
|
} = activeKeyPathRef;
|
|
75967
76165
|
const {
|
|
75968
|
-
key
|
|
76166
|
+
key: key2
|
|
75969
76167
|
} = props.tmNode;
|
|
75970
|
-
const index2 = activeKeyPath.findIndex((k) =>
|
|
76168
|
+
const index2 = activeKeyPath.findIndex((k) => key2 === k);
|
|
75971
76169
|
if (index2 === -1) return false;
|
|
75972
76170
|
return index2 < activeKeyPath.length - 1;
|
|
75973
76171
|
}),
|
|
@@ -75976,9 +76174,9 @@ const NDropdownOption = defineComponent({
|
|
|
75976
76174
|
value: activeKeyPath
|
|
75977
76175
|
} = activeKeyPathRef;
|
|
75978
76176
|
const {
|
|
75979
|
-
key
|
|
76177
|
+
key: key2
|
|
75980
76178
|
} = props.tmNode;
|
|
75981
|
-
const index2 = activeKeyPath.findIndex((k) =>
|
|
76179
|
+
const index2 = activeKeyPath.findIndex((k) => key2 === k);
|
|
75982
76180
|
if (index2 === -1) return false;
|
|
75983
76181
|
return index2 === activeKeyPath.length - 1;
|
|
75984
76182
|
}),
|
|
@@ -76525,11 +76723,11 @@ const NDropdown = defineComponent({
|
|
|
76525
76723
|
clearPendingState();
|
|
76526
76724
|
}
|
|
76527
76725
|
});
|
|
76528
|
-
function doSelect(
|
|
76726
|
+
function doSelect(key2, node) {
|
|
76529
76727
|
const {
|
|
76530
76728
|
onSelect
|
|
76531
76729
|
} = props;
|
|
76532
|
-
if (onSelect) call(onSelect,
|
|
76730
|
+
if (onSelect) call(onSelect, key2, node);
|
|
76533
76731
|
}
|
|
76534
76732
|
function doUpdateShow(value) {
|
|
76535
76733
|
const {
|
|
@@ -77101,7 +77299,7 @@ const _sfc_main$1$1 = {
|
|
|
77101
77299
|
size: "medium",
|
|
77102
77300
|
placement: "bottom-start",
|
|
77103
77301
|
class: normalizeClass(["toolbar-button toolbar-dropdown sd-editor-toolbar-dropdown", { "high-contrast": unref(isHighContrastMode2) }]),
|
|
77104
|
-
onSelect: (
|
|
77302
|
+
onSelect: (key2, option) => handleSelect(item, option),
|
|
77105
77303
|
onClickoutside: handleClickOutside2,
|
|
77106
77304
|
style: normalizeStyle(item.dropdownStyles.value),
|
|
77107
77305
|
"menu-props": () => ({
|
|
@@ -77777,8 +77975,8 @@ var __defProp = Object.defineProperty;
|
|
|
77777
77975
|
var __typeError = (msg2) => {
|
|
77778
77976
|
throw TypeError(msg2);
|
|
77779
77977
|
};
|
|
77780
|
-
var __defNormalProp = (obj,
|
|
77781
|
-
var __publicField = (obj,
|
|
77978
|
+
var __defNormalProp = (obj, key2, value) => key2 in obj ? __defProp(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value;
|
|
77979
|
+
var __publicField = (obj, key2, value) => __defNormalProp(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value);
|
|
77782
77980
|
var __accessCheck = (obj, member, msg2) => member.has(obj) || __typeError("Cannot " + msg2);
|
|
77783
77981
|
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
77784
77982
|
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);
|
|
@@ -77835,8 +78033,8 @@ function requireEventemitter3() {
|
|
|
77835
78033
|
var evt = prefix2 ? prefix2 + event : event, handlers2 = this._events[evt];
|
|
77836
78034
|
if (!handlers2) return [];
|
|
77837
78035
|
if (handlers2.fn) return [handlers2.fn];
|
|
77838
|
-
for (var
|
|
77839
|
-
ee[
|
|
78036
|
+
for (var i2 = 0, l22 = handlers2.length, ee = new Array(l22); i2 < l22; i2++) {
|
|
78037
|
+
ee[i2] = handlers2[i2].fn;
|
|
77840
78038
|
}
|
|
77841
78039
|
return ee;
|
|
77842
78040
|
};
|
|
@@ -77849,7 +78047,7 @@ function requireEventemitter3() {
|
|
|
77849
78047
|
EventEmitter22.prototype.emit = function emit(event, a1, a22, a3, a4, a52) {
|
|
77850
78048
|
var evt = prefix2 ? prefix2 + event : event;
|
|
77851
78049
|
if (!this._events[evt]) return false;
|
|
77852
|
-
var listeners = this._events[evt], len = arguments.length, args,
|
|
78050
|
+
var listeners = this._events[evt], len = arguments.length, args, i2;
|
|
77853
78051
|
if (listeners.fn) {
|
|
77854
78052
|
if (listeners.once) this.removeListener(event, listeners.fn, void 0, true);
|
|
77855
78053
|
switch (len) {
|
|
@@ -77866,32 +78064,32 @@ function requireEventemitter3() {
|
|
|
77866
78064
|
case 6:
|
|
77867
78065
|
return listeners.fn.call(listeners.context, a1, a22, a3, a4, a52), true;
|
|
77868
78066
|
}
|
|
77869
|
-
for (
|
|
77870
|
-
args[
|
|
78067
|
+
for (i2 = 1, args = new Array(len - 1); i2 < len; i2++) {
|
|
78068
|
+
args[i2 - 1] = arguments[i2];
|
|
77871
78069
|
}
|
|
77872
78070
|
listeners.fn.apply(listeners.context, args);
|
|
77873
78071
|
} else {
|
|
77874
78072
|
var length2 = listeners.length, j2;
|
|
77875
|
-
for (
|
|
77876
|
-
if (listeners[
|
|
78073
|
+
for (i2 = 0; i2 < length2; i2++) {
|
|
78074
|
+
if (listeners[i2].once) this.removeListener(event, listeners[i2].fn, void 0, true);
|
|
77877
78075
|
switch (len) {
|
|
77878
78076
|
case 1:
|
|
77879
|
-
listeners[
|
|
78077
|
+
listeners[i2].fn.call(listeners[i2].context);
|
|
77880
78078
|
break;
|
|
77881
78079
|
case 2:
|
|
77882
|
-
listeners[
|
|
78080
|
+
listeners[i2].fn.call(listeners[i2].context, a1);
|
|
77883
78081
|
break;
|
|
77884
78082
|
case 3:
|
|
77885
|
-
listeners[
|
|
78083
|
+
listeners[i2].fn.call(listeners[i2].context, a1, a22);
|
|
77886
78084
|
break;
|
|
77887
78085
|
case 4:
|
|
77888
|
-
listeners[
|
|
78086
|
+
listeners[i2].fn.call(listeners[i2].context, a1, a22, a3);
|
|
77889
78087
|
break;
|
|
77890
78088
|
default:
|
|
77891
78089
|
if (!args) for (j2 = 1, args = new Array(len - 1); j2 < len; j2++) {
|
|
77892
78090
|
args[j2 - 1] = arguments[j2];
|
|
77893
78091
|
}
|
|
77894
|
-
listeners[
|
|
78092
|
+
listeners[i2].fn.apply(listeners[i2].context, args);
|
|
77895
78093
|
}
|
|
77896
78094
|
}
|
|
77897
78095
|
}
|
|
@@ -77916,9 +78114,9 @@ function requireEventemitter3() {
|
|
|
77916
78114
|
clearEvent(this, evt);
|
|
77917
78115
|
}
|
|
77918
78116
|
} else {
|
|
77919
|
-
for (var
|
|
77920
|
-
if (listeners[
|
|
77921
|
-
events2.push(listeners[
|
|
78117
|
+
for (var i2 = 0, events2 = [], length2 = listeners.length; i2 < length2; i2++) {
|
|
78118
|
+
if (listeners[i2].fn !== fn2 || once && !listeners[i2].once || context && listeners[i2].context !== context) {
|
|
78119
|
+
events2.push(listeners[i2]);
|
|
77922
78120
|
}
|
|
77923
78121
|
}
|
|
77924
78122
|
if (events2.length) this._events[evt] = events2.length === 1 ? events2[0] : events2;
|
|
@@ -78021,9 +78219,9 @@ const useToolbarItem = (options) => {
|
|
|
78021
78219
|
const onDeactivate = options.onDeactivate || (() => null);
|
|
78022
78220
|
const unref2 = () => {
|
|
78023
78221
|
const flattened = {};
|
|
78024
|
-
Object.keys(refs).forEach((
|
|
78025
|
-
if (refs[
|
|
78026
|
-
flattened[
|
|
78222
|
+
Object.keys(refs).forEach((key2) => {
|
|
78223
|
+
if (refs[key2].value !== void 0) {
|
|
78224
|
+
flattened[key2] = refs[key2].value;
|
|
78027
78225
|
}
|
|
78028
78226
|
});
|
|
78029
78227
|
return flattened;
|
|
@@ -78911,8 +79109,8 @@ const _sfc_main$7 = {
|
|
|
78911
79109
|
const selectGridItems = (allItems, cols, rows) => {
|
|
78912
79110
|
selectedCols.value = cols;
|
|
78913
79111
|
selectedRows.value = rows;
|
|
78914
|
-
for (let
|
|
78915
|
-
let item = allItems[
|
|
79112
|
+
for (let i2 = 0; i2 < allItems.length; i2++) {
|
|
79113
|
+
let item = allItems[i2];
|
|
78916
79114
|
let itemsCols = parseInt(item.dataset.cols, 10);
|
|
78917
79115
|
let itemsRows = parseInt(item.dataset.rows, 10);
|
|
78918
79116
|
if (itemsCols <= cols && itemsRows <= rows) {
|
|
@@ -78989,20 +79187,20 @@ const _sfc_main$7 = {
|
|
|
78989
79187
|
onMouseover: onTableGridMouseOver,
|
|
78990
79188
|
"data-grid": "true"
|
|
78991
79189
|
}, [
|
|
78992
|
-
(openBlock(), createElementBlock(Fragment$1, null, renderList(5, (
|
|
78993
|
-
return openBlock(), createElementBlock(Fragment$1, { key:
|
|
78994
|
-
(openBlock(), createElementBlock(Fragment$1, null, renderList(5, (
|
|
79190
|
+
(openBlock(), createElementBlock(Fragment$1, null, renderList(5, (i2) => {
|
|
79191
|
+
return openBlock(), createElementBlock(Fragment$1, { key: i2 }, [
|
|
79192
|
+
(openBlock(), createElementBlock(Fragment$1, null, renderList(5, (n2) => {
|
|
78995
79193
|
return createBaseVNode("div", {
|
|
78996
79194
|
class: "toolbar-table-grid__item",
|
|
78997
|
-
key: `${
|
|
78998
|
-
"data-cols":
|
|
78999
|
-
"data-rows":
|
|
79195
|
+
key: `${i2}_${n2}`,
|
|
79196
|
+
"data-cols": n2,
|
|
79197
|
+
"data-rows": i2,
|
|
79000
79198
|
"data-item": "true",
|
|
79001
79199
|
ref_for: true,
|
|
79002
79200
|
ref_key: "tableGridItems",
|
|
79003
79201
|
ref: tableGridItems,
|
|
79004
|
-
onKeydown: withModifiers((event) => handleKeyDown2(event,
|
|
79005
|
-
onClick: withModifiers(($event) => handleClick2({ cols:
|
|
79202
|
+
onKeydown: withModifiers((event) => handleKeyDown2(event, n2, i2), ["prevent"]),
|
|
79203
|
+
onClick: withModifiers(($event) => handleClick2({ cols: n2, rows: i2 }), ["stop", "prevent"])
|
|
79006
79204
|
}, null, 40, _hoisted_1$6);
|
|
79007
79205
|
}), 64))
|
|
79008
79206
|
], 64);
|
|
@@ -79223,7 +79421,7 @@ const makeDefaultItems = ({
|
|
|
79223
79421
|
onActivate: ({ fontFamily: fontFamily2 }) => {
|
|
79224
79422
|
if (!fontFamily2) return;
|
|
79225
79423
|
fontButton.label.value = fontFamily2;
|
|
79226
|
-
const foundFont = fontOptions.find((
|
|
79424
|
+
const foundFont = fontOptions.find((i2) => i2.label === fontFamily2);
|
|
79227
79425
|
if (foundFont) {
|
|
79228
79426
|
fontButton.selectedValue.value = foundFont.key;
|
|
79229
79427
|
} else {
|
|
@@ -79309,8 +79507,8 @@ const makeDefaultItems = ({
|
|
|
79309
79507
|
if (sanitizedValue < 8) sanitizedValue = 8;
|
|
79310
79508
|
if (sanitizedValue > 96) sanitizedValue = 96;
|
|
79311
79509
|
let sanitizedValueStr = String(sanitizedValue);
|
|
79312
|
-
const foundSize = fontSizeOptions.find((
|
|
79313
|
-
return
|
|
79510
|
+
const foundSize = fontSizeOptions.find((i2) => {
|
|
79511
|
+
return i2.label === sanitizedValueStr || i2.key === sanitizedValueStr;
|
|
79314
79512
|
});
|
|
79315
79513
|
if (foundSize) {
|
|
79316
79514
|
fontSize2.selectedValue.value = foundSize.key;
|
|
@@ -80400,10 +80598,25 @@ class SuperToolbar extends EventEmitter2 {
|
|
|
80400
80598
|
if (!result?.file) {
|
|
80401
80599
|
return;
|
|
80402
80600
|
}
|
|
80403
|
-
|
|
80601
|
+
const { size: size2, file } = await checkAndProcessImage({
|
|
80602
|
+
file: result.file,
|
|
80603
|
+
getMaxContentSize: () => this.activeEditor.getMaxContentSize()
|
|
80604
|
+
});
|
|
80605
|
+
if (!file) {
|
|
80606
|
+
return;
|
|
80607
|
+
}
|
|
80608
|
+
const id = {};
|
|
80609
|
+
replaceSelectionWithImagePlaceholder({
|
|
80610
|
+
view: this.activeEditor.view,
|
|
80611
|
+
editorOptions: this.activeEditor.options,
|
|
80612
|
+
id
|
|
80613
|
+
});
|
|
80614
|
+
await uploadAndInsertImage({
|
|
80404
80615
|
editor: this.activeEditor,
|
|
80405
80616
|
view: this.activeEditor.view,
|
|
80406
|
-
file
|
|
80617
|
+
file,
|
|
80618
|
+
size: size2,
|
|
80619
|
+
id
|
|
80407
80620
|
});
|
|
80408
80621
|
},
|
|
80409
80622
|
/**
|
|
@@ -81685,11 +81898,11 @@ const _sfc_main$3 = {
|
|
|
81685
81898
|
pageMargins.value = docMargins;
|
|
81686
81899
|
rightHandle.x = docSize.width * 96 - docMargins.right * 96;
|
|
81687
81900
|
leftHandle.x = docMargins.left * 96;
|
|
81688
|
-
for (let
|
|
81901
|
+
for (let i2 = 0; i2 < docSize.width; i2++) {
|
|
81689
81902
|
const marginNum = 0.0625 * 96 - 0.5;
|
|
81690
81903
|
const margin = `${marginNum}px`;
|
|
81691
|
-
const diff = docSize.width -
|
|
81692
|
-
rulerItems.push(...generateSection(1, "main", "20%", margin,
|
|
81904
|
+
const diff = docSize.width - i2;
|
|
81905
|
+
rulerItems.push(...generateSection(1, "main", "20%", margin, i2));
|
|
81693
81906
|
rulerItems.push(...generateSection(3, "eighth", "10%", margin));
|
|
81694
81907
|
rulerItems.push(...generateSection(1, "half", "40%", margin));
|
|
81695
81908
|
if (diff <= 0.5) break;
|
|
@@ -81698,7 +81911,7 @@ const _sfc_main$3 = {
|
|
|
81698
81911
|
return rulerItems;
|
|
81699
81912
|
};
|
|
81700
81913
|
const generateSection = (qty, size2, height, margin, index2) => {
|
|
81701
|
-
return Array.from({ length: qty }, (_2,
|
|
81914
|
+
return Array.from({ length: qty }, (_2, i2) => {
|
|
81702
81915
|
const item = {
|
|
81703
81916
|
className: `${size2}-unit ruler-section`,
|
|
81704
81917
|
height,
|