superdoc 0.34.5 → 0.34.6-RC1
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-DRQmW5MW.cjs → PdfViewer-Cdq6hWaP.cjs} +2 -2
- package/dist/chunks/{PdfViewer-DTAOrhGM.es.js → PdfViewer-Yy390Dyv.es.js} +2 -2
- package/dist/chunks/{eventemitter3-hYlnBzSA.es.js → eventemitter3-BZXKb7j7.es.js} +1 -1
- package/dist/chunks/{eventemitter3-DmHNHvFX.cjs → eventemitter3-CFCpOk3d.cjs} +1 -1
- package/dist/chunks/{index-wvwkg6PD.es.js → index-M9d0bJ9k.es.js} +12 -7
- package/dist/chunks/{index-C_RM2IcG.cjs → index-QkGtTLUE.cjs} +12 -7
- package/dist/chunks/{index-BO0dc2dg-BiqxnA1k.cjs → index-_8cQcYzu-CB4RkW2W.cjs} +1 -1
- package/dist/chunks/{index-BO0dc2dg-DpvJHkle.es.js → index-_8cQcYzu-Dj8Emsl2.es.js} +1 -1
- package/dist/chunks/{jszip-BP2FTbpi.cjs → jszip-B99MTu59.cjs} +1 -1
- package/dist/chunks/{jszip-jKrsZoMS.es.js → jszip-Duxs2YMV.es.js} +1 -1
- package/dist/chunks/{super-editor.es-VtmcJzKs.cjs → super-editor.es-C-hpEM8j.cjs} +745 -623
- package/dist/chunks/{super-editor.es-CfMROBHl.es.js → super-editor.es-kNY6AOSu.es.js} +698 -576
- package/dist/chunks/{vue-Cwv-wUpm.cjs → vue-ARQSyfaw.cjs} +2401 -2360
- package/dist/chunks/{vue-CKmzTNVs.es.js → vue-B5QAf5pA.es.js} +2401 -2360
- package/dist/chunks/xml-js-CVyfrKaV.es.js +2 -0
- package/dist/chunks/xml-js-DQa4Ye5C.cjs +3 -0
- package/dist/packages/superdoc/src/components/CommentsLayer/use-comment.d.ts.map +1 -1
- package/dist/packages/superdoc/src/core/SuperDoc.d.ts.map +1 -1
- package/dist/packages/superdoc/src/core/types/index.d.ts.map +1 -1
- package/dist/packages/superdoc/src/stores/comments-store.d.ts.map +1 -1
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-PA_XpTWF.js → converter-Ddl2ZmKy.js} +397 -296
- package/dist/super-editor/chunks/{docx-zipper-gaQWcuwh.js → docx-zipper-D1BgiAWm.js} +1 -1
- package/dist/super-editor/chunks/{editor-CAqYW4R2.js → editor-B2T2u3JG.js} +35 -14
- package/dist/super-editor/chunks/{index-BO0dc2dg.js → index-_8cQcYzu.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-BgNvrbei.js → toolbar-hyRTdNjv.js} +2 -2
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/docx-zipper.es.js +2 -2
- package/dist/super-editor/editor.es.js +3 -3
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/super-editor/src/core/super-converter/helpers.d.ts.map +1 -1
- package/dist/super-editor/super-editor/src/core/super-converter/v2/exporter/commentsExporter.d.ts.map +1 -1
- package/dist/super-editor/super-editor/src/extensions/track-changes/permission-helpers.d.ts.map +1 -1
- package/dist/super-editor/super-editor.es.js +6 -6
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +2 -2
- package/dist/super-editor.es.js +2 -2
- package/dist/superdoc.cjs +2 -2
- package/dist/superdoc.es.js +2 -2
- package/dist/superdoc.umd.js +1092 -925
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/xml-js-BSDu25I7.cjs +0 -3
- package/dist/chunks/xml-js-CBrRls0f.es.js +0 -2
|
@@ -413,17 +413,17 @@ ieee754.write = function(buffer2, value, offset, isLE, mLen, nBytes) {
|
|
|
413
413
|
);
|
|
414
414
|
}
|
|
415
415
|
if (a === b2) return 0;
|
|
416
|
-
let
|
|
416
|
+
let x2 = a.length;
|
|
417
417
|
let y2 = b2.length;
|
|
418
|
-
for (let i = 0, len = Math.min(
|
|
418
|
+
for (let i = 0, len = Math.min(x2, y2); i < len; ++i) {
|
|
419
419
|
if (a[i] !== b2[i]) {
|
|
420
|
-
|
|
420
|
+
x2 = a[i];
|
|
421
421
|
y2 = b2[i];
|
|
422
422
|
break;
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
|
-
if (
|
|
426
|
-
if (y2 <
|
|
425
|
+
if (x2 < y2) return -1;
|
|
426
|
+
if (y2 < x2) return 1;
|
|
427
427
|
return 0;
|
|
428
428
|
};
|
|
429
429
|
Buffer3.isEncoding = function isEncoding(encoding) {
|
|
@@ -672,20 +672,20 @@ ieee754.write = function(buffer2, value, offset, isLE, mLen, nBytes) {
|
|
|
672
672
|
thisStart >>>= 0;
|
|
673
673
|
thisEnd >>>= 0;
|
|
674
674
|
if (this === target) return 0;
|
|
675
|
-
let
|
|
675
|
+
let x2 = thisEnd - thisStart;
|
|
676
676
|
let y2 = end - start;
|
|
677
|
-
const len = Math.min(
|
|
677
|
+
const len = Math.min(x2, y2);
|
|
678
678
|
const thisCopy = this.slice(thisStart, thisEnd);
|
|
679
679
|
const targetCopy = target.slice(start, end);
|
|
680
680
|
for (let i = 0; i < len; ++i) {
|
|
681
681
|
if (thisCopy[i] !== targetCopy[i]) {
|
|
682
|
-
|
|
682
|
+
x2 = thisCopy[i];
|
|
683
683
|
y2 = targetCopy[i];
|
|
684
684
|
break;
|
|
685
685
|
}
|
|
686
686
|
}
|
|
687
|
-
if (
|
|
688
|
-
if (y2 <
|
|
687
|
+
if (x2 < y2) return -1;
|
|
688
|
+
if (y2 < x2) return 1;
|
|
689
689
|
return 0;
|
|
690
690
|
};
|
|
691
691
|
function bidirectionalIndexOf(buffer2, val, byteOffset, encoding, dir) {
|
|
@@ -1775,8 +1775,8 @@ ieee754.write = function(buffer2, value, offset, isLE, mLen, nBytes) {
|
|
|
1775
1775
|
})(buffer);
|
|
1776
1776
|
const Buffer2 = buffer.Buffer;
|
|
1777
1777
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
1778
|
-
function getDefaultExportFromCjs$2(
|
|
1779
|
-
return
|
|
1778
|
+
function getDefaultExportFromCjs$2(x2) {
|
|
1779
|
+
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
|
|
1780
1780
|
}
|
|
1781
1781
|
var sax = {};
|
|
1782
1782
|
var events = { exports: {} };
|
|
@@ -1784,13 +1784,13 @@ var hasRequiredEvents;
|
|
|
1784
1784
|
function requireEvents() {
|
|
1785
1785
|
if (hasRequiredEvents) return events.exports;
|
|
1786
1786
|
hasRequiredEvents = 1;
|
|
1787
|
-
var
|
|
1788
|
-
var ReflectApply =
|
|
1787
|
+
var R = typeof Reflect === "object" ? Reflect : null;
|
|
1788
|
+
var ReflectApply = R && typeof R.apply === "function" ? R.apply : function ReflectApply2(target, receiver, args) {
|
|
1789
1789
|
return Function.prototype.apply.call(target, receiver, args);
|
|
1790
1790
|
};
|
|
1791
1791
|
var ReflectOwnKeys;
|
|
1792
|
-
if (
|
|
1793
|
-
ReflectOwnKeys =
|
|
1792
|
+
if (R && typeof R.ownKeys === "function") {
|
|
1793
|
+
ReflectOwnKeys = R.ownKeys;
|
|
1794
1794
|
} else if (Object.getOwnPropertySymbols) {
|
|
1795
1795
|
ReflectOwnKeys = function ReflectOwnKeys2(target) {
|
|
1796
1796
|
return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target));
|
|
@@ -2180,8 +2180,8 @@ function requireInherits_browser() {
|
|
|
2180
2180
|
}
|
|
2181
2181
|
return inherits_browser.exports;
|
|
2182
2182
|
}
|
|
2183
|
-
function getDefaultExportFromCjs$1(
|
|
2184
|
-
return
|
|
2183
|
+
function getDefaultExportFromCjs$1(x2) {
|
|
2184
|
+
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
|
|
2185
2185
|
}
|
|
2186
2186
|
var browser$1 = { exports: {} };
|
|
2187
2187
|
var process = browser$1.exports = {};
|
|
@@ -2762,17 +2762,17 @@ function requireDist() {
|
|
|
2762
2762
|
);
|
|
2763
2763
|
}
|
|
2764
2764
|
if (a === b2) return 0;
|
|
2765
|
-
let
|
|
2765
|
+
let x2 = a.length;
|
|
2766
2766
|
let y2 = b2.length;
|
|
2767
|
-
for (let i2 = 0, len2 = Math.min(
|
|
2767
|
+
for (let i2 = 0, len2 = Math.min(x2, y2); i2 < len2; ++i2) {
|
|
2768
2768
|
if (a[i2] !== b2[i2]) {
|
|
2769
|
-
|
|
2769
|
+
x2 = a[i2];
|
|
2770
2770
|
y2 = b2[i2];
|
|
2771
2771
|
break;
|
|
2772
2772
|
}
|
|
2773
2773
|
}
|
|
2774
|
-
if (
|
|
2775
|
-
if (y2 <
|
|
2774
|
+
if (x2 < y2) return -1;
|
|
2775
|
+
if (y2 < x2) return 1;
|
|
2776
2776
|
return 0;
|
|
2777
2777
|
};
|
|
2778
2778
|
Buffer4.isEncoding = function isEncoding(encoding) {
|
|
@@ -3021,20 +3021,20 @@ function requireDist() {
|
|
|
3021
3021
|
thisStart >>>= 0;
|
|
3022
3022
|
thisEnd >>>= 0;
|
|
3023
3023
|
if (this === target) return 0;
|
|
3024
|
-
let
|
|
3024
|
+
let x2 = thisEnd - thisStart;
|
|
3025
3025
|
let y2 = end - start;
|
|
3026
|
-
const len2 = Math.min(
|
|
3026
|
+
const len2 = Math.min(x2, y2);
|
|
3027
3027
|
const thisCopy = this.slice(thisStart, thisEnd);
|
|
3028
3028
|
const targetCopy = target.slice(start, end);
|
|
3029
3029
|
for (let i2 = 0; i2 < len2; ++i2) {
|
|
3030
3030
|
if (thisCopy[i2] !== targetCopy[i2]) {
|
|
3031
|
-
|
|
3031
|
+
x2 = thisCopy[i2];
|
|
3032
3032
|
y2 = targetCopy[i2];
|
|
3033
3033
|
break;
|
|
3034
3034
|
}
|
|
3035
3035
|
}
|
|
3036
|
-
if (
|
|
3037
|
-
if (y2 <
|
|
3036
|
+
if (x2 < y2) return -1;
|
|
3037
|
+
if (y2 < x2) return 1;
|
|
3038
3038
|
return 0;
|
|
3039
3039
|
};
|
|
3040
3040
|
function bidirectionalIndexOf(buffer3, val, byteOffset, encoding, dir) {
|
|
@@ -4606,15 +4606,15 @@ function requireGetProto() {
|
|
|
4606
4606
|
var reflectGetProto = requireReflect_getPrototypeOf();
|
|
4607
4607
|
var originalGetProto = requireObject_getPrototypeOf();
|
|
4608
4608
|
var getDunderProto = /* @__PURE__ */ requireGet();
|
|
4609
|
-
getProto = reflectGetProto ? function getProto2(
|
|
4610
|
-
return reflectGetProto(
|
|
4611
|
-
} : originalGetProto ? function getProto2(
|
|
4612
|
-
if (!
|
|
4609
|
+
getProto = reflectGetProto ? function getProto2(O) {
|
|
4610
|
+
return reflectGetProto(O);
|
|
4611
|
+
} : originalGetProto ? function getProto2(O) {
|
|
4612
|
+
if (!O || typeof O !== "object" && typeof O !== "function") {
|
|
4613
4613
|
throw new TypeError("getProto: not an object");
|
|
4614
4614
|
}
|
|
4615
|
-
return originalGetProto(
|
|
4616
|
-
} : getDunderProto ? function getProto2(
|
|
4617
|
-
return getDunderProto(
|
|
4615
|
+
return originalGetProto(O);
|
|
4616
|
+
} : getDunderProto ? function getProto2(O) {
|
|
4617
|
+
return getDunderProto(O);
|
|
4618
4618
|
} : null;
|
|
4619
4619
|
return getProto;
|
|
4620
4620
|
}
|
|
@@ -5282,18 +5282,18 @@ function requireForEach() {
|
|
|
5282
5282
|
}
|
|
5283
5283
|
};
|
|
5284
5284
|
var forEachObject = function forEachObject2(object, iterator, receiver) {
|
|
5285
|
-
for (var
|
|
5286
|
-
if (hasOwnProperty.call(object,
|
|
5285
|
+
for (var k2 in object) {
|
|
5286
|
+
if (hasOwnProperty.call(object, k2)) {
|
|
5287
5287
|
if (receiver == null) {
|
|
5288
|
-
iterator(object[
|
|
5288
|
+
iterator(object[k2], k2, object);
|
|
5289
5289
|
} else {
|
|
5290
|
-
iterator.call(receiver, object[
|
|
5290
|
+
iterator.call(receiver, object[k2], k2, object);
|
|
5291
5291
|
}
|
|
5292
5292
|
}
|
|
5293
5293
|
}
|
|
5294
5294
|
};
|
|
5295
|
-
function isArray(
|
|
5296
|
-
return toStr.call(
|
|
5295
|
+
function isArray(x2) {
|
|
5296
|
+
return toStr.call(x2) === "[object Array]";
|
|
5297
5297
|
}
|
|
5298
5298
|
forEach = function forEach2(list, iterator, thisArg) {
|
|
5299
5299
|
if (!isCallable2(iterator)) {
|
|
@@ -5902,10 +5902,10 @@ function requireUtil() {
|
|
|
5902
5902
|
var i = 1;
|
|
5903
5903
|
var args = arguments;
|
|
5904
5904
|
var len = args.length;
|
|
5905
|
-
var str = String(f).replace(formatRegExp, function(
|
|
5906
|
-
if (
|
|
5907
|
-
if (i >= len) return
|
|
5908
|
-
switch (
|
|
5905
|
+
var str = String(f).replace(formatRegExp, function(x3) {
|
|
5906
|
+
if (x3 === "%%") return "%";
|
|
5907
|
+
if (i >= len) return x3;
|
|
5908
|
+
switch (x3) {
|
|
5909
5909
|
case "%s":
|
|
5910
5910
|
return String(args[i++]);
|
|
5911
5911
|
case "%d":
|
|
@@ -5917,14 +5917,14 @@ function requireUtil() {
|
|
|
5917
5917
|
return "[Circular]";
|
|
5918
5918
|
}
|
|
5919
5919
|
default:
|
|
5920
|
-
return
|
|
5920
|
+
return x3;
|
|
5921
5921
|
}
|
|
5922
5922
|
});
|
|
5923
|
-
for (var
|
|
5924
|
-
if (isNull(
|
|
5925
|
-
str += " " +
|
|
5923
|
+
for (var x2 = args[i]; i < len; x2 = args[++i]) {
|
|
5924
|
+
if (isNull(x2) || !isObject(x2)) {
|
|
5925
|
+
str += " " + x2;
|
|
5926
5926
|
} else {
|
|
5927
|
-
str += " " + inspect(
|
|
5927
|
+
str += " " + inspect(x2);
|
|
5928
5928
|
}
|
|
5929
5929
|
}
|
|
5930
5930
|
return str;
|
|
@@ -7489,6 +7489,7 @@ function require_stream_duplex() {
|
|
|
7489
7489
|
}
|
|
7490
7490
|
var string_decoder = {};
|
|
7491
7491
|
var safeBuffer = { exports: {} };
|
|
7492
|
+
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
7492
7493
|
var hasRequiredSafeBuffer;
|
|
7493
7494
|
function requireSafeBuffer() {
|
|
7494
7495
|
if (hasRequiredSafeBuffer) return safeBuffer.exports;
|
|
@@ -7510,6 +7511,7 @@ function requireSafeBuffer() {
|
|
|
7510
7511
|
function SafeBuffer(arg, encodingOrOffset, length) {
|
|
7511
7512
|
return Buffer3(arg, encodingOrOffset, length);
|
|
7512
7513
|
}
|
|
7514
|
+
SafeBuffer.prototype = Object.create(Buffer3.prototype);
|
|
7513
7515
|
copyProps(Buffer3, SafeBuffer);
|
|
7514
7516
|
SafeBuffer.from = function(arg, encodingOrOffset, length) {
|
|
7515
7517
|
if (typeof arg === "number") {
|
|
@@ -8787,9 +8789,9 @@ function require_stream_readable() {
|
|
|
8787
8789
|
return from(Readable, iterable, opts);
|
|
8788
8790
|
};
|
|
8789
8791
|
}
|
|
8790
|
-
function indexOf(xs,
|
|
8792
|
+
function indexOf(xs, x2) {
|
|
8791
8793
|
for (var i = 0, l3 = xs.length; i < l3; i++) {
|
|
8792
|
-
if (xs[i] ===
|
|
8794
|
+
if (xs[i] === x2) return i;
|
|
8793
8795
|
}
|
|
8794
8796
|
return -1;
|
|
8795
8797
|
}
|
|
@@ -9247,27 +9249,27 @@ function requireSax() {
|
|
|
9247
9249
|
this._parser = new SAXParser(strict, opt);
|
|
9248
9250
|
this.writable = true;
|
|
9249
9251
|
this.readable = true;
|
|
9250
|
-
var
|
|
9252
|
+
var me2 = this;
|
|
9251
9253
|
this._parser.onend = function() {
|
|
9252
|
-
|
|
9254
|
+
me2.emit("end");
|
|
9253
9255
|
};
|
|
9254
9256
|
this._parser.onerror = function(er) {
|
|
9255
|
-
|
|
9256
|
-
|
|
9257
|
+
me2.emit("error", er);
|
|
9258
|
+
me2._parser.error = null;
|
|
9257
9259
|
};
|
|
9258
9260
|
this._decoder = null;
|
|
9259
9261
|
streamWraps.forEach(function(ev) {
|
|
9260
|
-
Object.defineProperty(
|
|
9262
|
+
Object.defineProperty(me2, "on" + ev, {
|
|
9261
9263
|
get: function() {
|
|
9262
|
-
return
|
|
9264
|
+
return me2._parser["on" + ev];
|
|
9263
9265
|
},
|
|
9264
|
-
set: function(
|
|
9265
|
-
if (!
|
|
9266
|
-
|
|
9267
|
-
|
|
9268
|
-
return
|
|
9266
|
+
set: function(h) {
|
|
9267
|
+
if (!h) {
|
|
9268
|
+
me2.removeAllListeners(ev);
|
|
9269
|
+
me2._parser["on" + ev] = h;
|
|
9270
|
+
return h;
|
|
9269
9271
|
}
|
|
9270
|
-
|
|
9272
|
+
me2.on(ev, h);
|
|
9271
9273
|
},
|
|
9272
9274
|
enumerable: true,
|
|
9273
9275
|
configurable: false
|
|
@@ -9299,15 +9301,15 @@ function requireSax() {
|
|
|
9299
9301
|
return true;
|
|
9300
9302
|
};
|
|
9301
9303
|
SAXStream.prototype.on = function(ev, handler2) {
|
|
9302
|
-
var
|
|
9303
|
-
if (!
|
|
9304
|
-
|
|
9304
|
+
var me2 = this;
|
|
9305
|
+
if (!me2._parser["on" + ev] && streamWraps.indexOf(ev) !== -1) {
|
|
9306
|
+
me2._parser["on" + ev] = function() {
|
|
9305
9307
|
var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments);
|
|
9306
9308
|
args.splice(0, 0, ev);
|
|
9307
|
-
|
|
9309
|
+
me2.emit.apply(me2, args);
|
|
9308
9310
|
};
|
|
9309
9311
|
}
|
|
9310
|
-
return Stream.prototype.on.call(
|
|
9312
|
+
return Stream.prototype.on.call(me2, ev, handler2);
|
|
9311
9313
|
};
|
|
9312
9314
|
var CDATA = "[CDATA[";
|
|
9313
9315
|
var DOCTYPE = "DOCTYPE";
|
|
@@ -9899,9 +9901,9 @@ function requireSax() {
|
|
|
9899
9901
|
var tag = parser.tag = parser.tags.pop();
|
|
9900
9902
|
parser.tagName = parser.tag.name;
|
|
9901
9903
|
emitNode(parser, "onclosetag", parser.tagName);
|
|
9902
|
-
var
|
|
9904
|
+
var x2 = {};
|
|
9903
9905
|
for (var i in tag.ns) {
|
|
9904
|
-
|
|
9906
|
+
x2[i] = tag.ns[i];
|
|
9905
9907
|
}
|
|
9906
9908
|
var parent = parser.tags[parser.tags.length - 1] || parser;
|
|
9907
9909
|
if (parser.opt.xmlns && tag.ns !== parent.ns) {
|
|
@@ -10958,8 +10960,8 @@ function requireXml2json() {
|
|
|
10958
10960
|
js = xml2js2(xml, options);
|
|
10959
10961
|
parentKey = "compact" in options && options.compact ? "_parent" : "parent";
|
|
10960
10962
|
if ("addParent" in options && options.addParent) {
|
|
10961
|
-
json = JSON.stringify(js, function(
|
|
10962
|
-
return
|
|
10963
|
+
json = JSON.stringify(js, function(k2, v2) {
|
|
10964
|
+
return k2 === parentKey ? "_" : v2;
|
|
10963
10965
|
}, options.spaces);
|
|
10964
10966
|
} else {
|
|
10965
10967
|
json = JSON.stringify(js, null, options.spaces);
|
|
@@ -11381,8 +11383,8 @@ function v4(options, buf, offset) {
|
|
|
11381
11383
|
rnds[8] = rnds[8] & 63 | 128;
|
|
11382
11384
|
return unsafeStringify(rnds);
|
|
11383
11385
|
}
|
|
11384
|
-
function getDefaultExportFromCjs(
|
|
11385
|
-
return
|
|
11386
|
+
function getDefaultExportFromCjs(x2) {
|
|
11387
|
+
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
|
|
11386
11388
|
}
|
|
11387
11389
|
const CRC_TABLE = new Int32Array([
|
|
11388
11390
|
0,
|
|
@@ -15198,8 +15200,8 @@ function polygonToObj(polygonNode) {
|
|
|
15198
15200
|
const points = [];
|
|
15199
15201
|
polygonNode.elements.forEach((element) => {
|
|
15200
15202
|
if (["wp:start", "wp:lineTo"].includes(element.name)) {
|
|
15201
|
-
const { x, y: y2 } = element.attributes;
|
|
15202
|
-
points.push([polygonUnitsToPixels(
|
|
15203
|
+
const { x: x2, y: y2 } = element.attributes;
|
|
15204
|
+
points.push([polygonUnitsToPixels(x2), polygonUnitsToPixels(y2)]);
|
|
15203
15205
|
}
|
|
15204
15206
|
});
|
|
15205
15207
|
if (points.length > 1) {
|
|
@@ -15222,13 +15224,13 @@ function objToPolygon(points) {
|
|
|
15222
15224
|
elements: []
|
|
15223
15225
|
};
|
|
15224
15226
|
points.forEach((point, index2) => {
|
|
15225
|
-
const [
|
|
15227
|
+
const [x2, y2] = point;
|
|
15226
15228
|
const tagName = index2 === 0 ? "wp:start" : "wp:lineTo";
|
|
15227
15229
|
const pointNode = {
|
|
15228
15230
|
name: tagName,
|
|
15229
15231
|
type: tagName,
|
|
15230
15232
|
attributes: {
|
|
15231
|
-
x: pixelsToPolygonUnits(
|
|
15233
|
+
x: pixelsToPolygonUnits(x2),
|
|
15232
15234
|
y: pixelsToPolygonUnits(y2)
|
|
15233
15235
|
}
|
|
15234
15236
|
};
|
|
@@ -15377,6 +15379,9 @@ const getLineHeightValueString = (lineHeight, defaultUnit, lineRule = "", isObje
|
|
|
15377
15379
|
let [value, unit] = parseSizeUnit(lineHeight);
|
|
15378
15380
|
if (Number.isNaN(value) || value === 0) return {};
|
|
15379
15381
|
if (lineRule === "atLeast" && value < 1) return {};
|
|
15382
|
+
if (!unit && value < 1) {
|
|
15383
|
+
value = 1;
|
|
15384
|
+
}
|
|
15380
15385
|
unit = unit ? unit : defaultUnit;
|
|
15381
15386
|
return isObject ? { ["line-height"]: `${value}${unit}` } : `line-height: ${value}${unit}`;
|
|
15382
15387
|
};
|
|
@@ -22890,7 +22895,7 @@ function posToDOMRect(view, from, to) {
|
|
|
22890
22895
|
const right = Math.max(start.right, end.right);
|
|
22891
22896
|
const width = right - left;
|
|
22892
22897
|
const height = bottom - top;
|
|
22893
|
-
const
|
|
22898
|
+
const x2 = left;
|
|
22894
22899
|
const y2 = top;
|
|
22895
22900
|
const data = {
|
|
22896
22901
|
top,
|
|
@@ -22899,7 +22904,7 @@ function posToDOMRect(view, from, to) {
|
|
|
22899
22904
|
right,
|
|
22900
22905
|
width,
|
|
22901
22906
|
height,
|
|
22902
|
-
x,
|
|
22907
|
+
x: x2,
|
|
22903
22908
|
y: y2
|
|
22904
22909
|
};
|
|
22905
22910
|
return {
|
|
@@ -22988,25 +22993,31 @@ function createDocFromHTML(content, schema, options = {}) {
|
|
|
22988
22993
|
function L() {
|
|
22989
22994
|
return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
|
|
22990
22995
|
}
|
|
22991
|
-
var
|
|
22996
|
+
var T = L();
|
|
22992
22997
|
function G(l3) {
|
|
22993
|
-
|
|
22998
|
+
T = l3;
|
|
22994
22999
|
}
|
|
22995
23000
|
var E = { exec: () => null };
|
|
22996
|
-
function
|
|
23001
|
+
function d(l3, e = "") {
|
|
22997
23002
|
let t = typeof l3 == "string" ? l3 : l3.source, n = { replace: (r, i) => {
|
|
22998
23003
|
let s = typeof i == "string" ? i : i.source;
|
|
22999
23004
|
return s = s.replace(m.caret, "$1"), t = t.replace(r, s), n;
|
|
23000
23005
|
}, getRegex: () => new RegExp(t, e) };
|
|
23001
23006
|
return n;
|
|
23002
23007
|
}
|
|
23003
|
-
var
|
|
23004
|
-
|
|
23005
|
-
|
|
23008
|
+
var be = (() => {
|
|
23009
|
+
try {
|
|
23010
|
+
return !!new RegExp("(?<=1)(?<!1)");
|
|
23011
|
+
} catch {
|
|
23012
|
+
return false;
|
|
23013
|
+
}
|
|
23014
|
+
})(), m = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceTabs: /^\t+/, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] /, listReplaceTask: /^\[[ xX]\] +/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (l3) => new RegExp(`^( {0,3}${l3})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (l3) => new RegExp(`^ {0,${Math.min(3, l3 - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (l3) => new RegExp(`^ {0,${Math.min(3, l3 - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (l3) => new RegExp(`^ {0,${Math.min(3, l3 - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (l3) => new RegExp(`^ {0,${Math.min(3, l3 - 1)}}#`), htmlBeginRegex: (l3) => new RegExp(`^ {0,${Math.min(3, l3 - 1)}}<(?:[a-z].*>|!--)`, "i") }, Re = /^(?:[ \t]*(?:\n|$))+/, Te = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Oe = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, I = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, we = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, F = /(?:[*+-]|\d{1,9}[.)])/, ie = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, oe = d(ie).replace(/bull/g, F).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), ye = d(ie).replace(/bull/g, F).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), j = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Pe = /^[^\n]+/, Q = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Se = d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Q).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), $e = d(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, F).getRegex(), v = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", U = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, _e = d("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", U).replace("tag", v).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ae = d(j).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex(), Le = d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ae).getRegex(), K = { blockquote: Le, code: Te, def: Se, fences: Oe, heading: we, hr: I, html: _e, lheading: oe, list: $e, newline: Re, paragraph: ae, table: E, text: Pe }, re = d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex(), Me = { ...K, lheading: ye, table: re, paragraph: d(j).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", re).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex() }, ze = { ...K, html: d(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", U).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: E, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: d(j).replace("hr", I).replace("heading", ` *#{1,6} *[^
|
|
23015
|
+
]`).replace("lheading", oe).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Ae = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Ee = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, le = /^( {2,}|\\)\n(?!\s*$)/, Ie = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, D = /[\p{P}\p{S}]/u, W = /[\s\p{P}\p{S}]/u, ue = /[^\s\p{P}\p{S}]/u, Ce = d(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, W).getRegex(), pe = /(?!~)[\p{P}\p{S}]/u, Be = /(?!~)[\s\p{P}\p{S}]/u, qe = /(?:[^\s\p{P}\p{S}]|~)/u, ve = d(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", be ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ce = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, De = d(ce, "u").replace(/punct/g, D).getRegex(), He = d(ce, "u").replace(/punct/g, pe).getRegex(), he$3 = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ze = d(he$3, "gu").replace(/notPunctSpace/g, ue).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex(), Ge = d(he$3, "gu").replace(/notPunctSpace/g, qe).replace(/punctSpace/g, Be).replace(/punct/g, pe).getRegex(), Ne = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ue).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex(), Fe = d(/\\(punct)/, "gu").replace(/punct/g, D).getRegex(), je = d(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Qe = d(U).replace("(?:-->|$)", "-->").getRegex(), Ue = d("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Qe).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), q = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, Ke = d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", q).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), de = d(/^!?\[(label)\]\[(ref)\]/).replace("label", q).replace("ref", Q).getRegex(), ke = d(/^!?\[(ref)\](?:\[\])?/).replace("ref", Q).getRegex(), We = d("reflink|nolink(?!\\()", "g").replace("reflink", de).replace("nolink", ke).getRegex(), se = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, X = { _backpedal: E, anyPunctuation: Fe, autolink: je, blockSkip: ve, br: le, code: Ee, del: E, emStrongLDelim: De, emStrongRDelimAst: Ze, emStrongRDelimUnd: Ne, escape: Ae, link: Ke, nolink: ke, punctuation: Ce, reflink: de, reflinkSearch: We, tag: Ue, text: Ie, url: E }, Xe = { ...X, link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", q).getRegex(), reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q).getRegex() }, N = { ...X, emStrongRDelimAst: Ge, emStrongLDelim: He, url: d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", se).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: d(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", se).getRegex() }, Je = { ...N, br: d(le).replace("{2,}", "*").getRegex(), text: d(N.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, C = { normal: K, gfm: Me, pedantic: ze }, M = { normal: X, gfm: N, breaks: Je, pedantic: Xe };
|
|
23016
|
+
var Ve = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, ge = (l3) => Ve[l3];
|
|
23006
23017
|
function w(l3, e) {
|
|
23007
23018
|
if (e) {
|
|
23008
|
-
if (m.escapeTest.test(l3)) return l3.replace(m.escapeReplace,
|
|
23009
|
-
} else if (m.escapeTestNoEncode.test(l3)) return l3.replace(m.escapeReplaceNoEncode,
|
|
23019
|
+
if (m.escapeTest.test(l3)) return l3.replace(m.escapeReplace, ge);
|
|
23020
|
+
} else if (m.escapeTestNoEncode.test(l3)) return l3.replace(m.escapeReplaceNoEncode, ge);
|
|
23010
23021
|
return l3;
|
|
23011
23022
|
}
|
|
23012
23023
|
function J(l3) {
|
|
@@ -23018,10 +23029,10 @@ function J(l3) {
|
|
|
23018
23029
|
return l3;
|
|
23019
23030
|
}
|
|
23020
23031
|
function V(l3, e) {
|
|
23021
|
-
let t = l3.replace(m.findPipe, (i, s,
|
|
23022
|
-
let
|
|
23023
|
-
for (; --
|
|
23024
|
-
return
|
|
23032
|
+
let t = l3.replace(m.findPipe, (i, s, a) => {
|
|
23033
|
+
let o = false, p = s;
|
|
23034
|
+
for (; --p >= 0 && a[p] === "\\"; ) o = !o;
|
|
23035
|
+
return o ? "|" : " |";
|
|
23025
23036
|
}), n = t.split(m.splitPipe), r = 0;
|
|
23026
23037
|
if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e) if (n.length > e) n.splice(e);
|
|
23027
23038
|
else for (; n.length < e; ) n.push("");
|
|
@@ -23039,7 +23050,7 @@ function z(l3, e, t) {
|
|
|
23039
23050
|
}
|
|
23040
23051
|
return l3.slice(0, n - r);
|
|
23041
23052
|
}
|
|
23042
|
-
function
|
|
23053
|
+
function fe(l3, e) {
|
|
23043
23054
|
if (l3.indexOf(e[1]) === -1) return -1;
|
|
23044
23055
|
let t = 0;
|
|
23045
23056
|
for (let n = 0; n < l3.length; n++) if (l3[n] === "\\") n++;
|
|
@@ -23047,13 +23058,13 @@ function ge(l3, e) {
|
|
|
23047
23058
|
else if (l3[n] === e[1] && (t--, t < 0)) return n;
|
|
23048
23059
|
return t > 0 ? -2 : -1;
|
|
23049
23060
|
}
|
|
23050
|
-
function
|
|
23051
|
-
let i = e.href, s = e.title || null,
|
|
23061
|
+
function me(l3, e, t, n, r) {
|
|
23062
|
+
let i = e.href, s = e.title || null, a = l3[1].replace(r.other.outputLinkReplace, "$1");
|
|
23052
23063
|
n.state.inLink = true;
|
|
23053
|
-
let
|
|
23054
|
-
return n.state.inLink = false,
|
|
23064
|
+
let o = { type: l3[0].charAt(0) === "!" ? "image" : "link", raw: t, href: i, title: s, text: a, tokens: n.inlineTokens(a) };
|
|
23065
|
+
return n.state.inLink = false, o;
|
|
23055
23066
|
}
|
|
23056
|
-
function
|
|
23067
|
+
function Ye(l3, e, t) {
|
|
23057
23068
|
let n = l3.match(t.other.indentCodeCompensation);
|
|
23058
23069
|
if (n === null) return e;
|
|
23059
23070
|
let r = n[1];
|
|
@@ -23061,8 +23072,8 @@ function Je(l3, e, t) {
|
|
|
23061
23072
|
`).map((i) => {
|
|
23062
23073
|
let s = i.match(t.other.beginningSpace);
|
|
23063
23074
|
if (s === null) return i;
|
|
23064
|
-
let [
|
|
23065
|
-
return
|
|
23075
|
+
let [a] = s;
|
|
23076
|
+
return a.length >= r.length ? i.slice(r.length) : i;
|
|
23066
23077
|
}).join(`
|
|
23067
23078
|
`);
|
|
23068
23079
|
}
|
|
@@ -23071,7 +23082,7 @@ var y = class {
|
|
|
23071
23082
|
__publicField(this, "options");
|
|
23072
23083
|
__publicField(this, "rules");
|
|
23073
23084
|
__publicField(this, "lexer");
|
|
23074
|
-
this.options = e ||
|
|
23085
|
+
this.options = e || T;
|
|
23075
23086
|
}
|
|
23076
23087
|
space(e) {
|
|
23077
23088
|
let t = this.rules.block.newline.exec(e);
|
|
@@ -23088,7 +23099,7 @@ var y = class {
|
|
|
23088
23099
|
fences(e) {
|
|
23089
23100
|
let t = this.rules.block.fences.exec(e);
|
|
23090
23101
|
if (t) {
|
|
23091
|
-
let n = t[0], r =
|
|
23102
|
+
let n = t[0], r = Ye(n, t[3] || "", this.rules);
|
|
23092
23103
|
return { type: "code", raw: n, lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2], text: r };
|
|
23093
23104
|
}
|
|
23094
23105
|
}
|
|
@@ -23115,32 +23126,32 @@ var y = class {
|
|
|
23115
23126
|
`).split(`
|
|
23116
23127
|
`), r = "", i = "", s = [];
|
|
23117
23128
|
for (; n.length > 0; ) {
|
|
23118
|
-
let
|
|
23119
|
-
for (
|
|
23120
|
-
else if (!
|
|
23129
|
+
let a = false, o = [], p;
|
|
23130
|
+
for (p = 0; p < n.length; p++) if (this.rules.other.blockquoteStart.test(n[p])) o.push(n[p]), a = true;
|
|
23131
|
+
else if (!a) o.push(n[p]);
|
|
23121
23132
|
else break;
|
|
23122
|
-
n = n.slice(
|
|
23123
|
-
let
|
|
23124
|
-
`), c =
|
|
23133
|
+
n = n.slice(p);
|
|
23134
|
+
let u = o.join(`
|
|
23135
|
+
`), c = u.replace(this.rules.other.blockquoteSetextReplace, `
|
|
23125
23136
|
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
23126
23137
|
r = r ? `${r}
|
|
23127
|
-
${
|
|
23138
|
+
${u}` : u, i = i ? `${i}
|
|
23128
23139
|
${c}` : c;
|
|
23129
|
-
let
|
|
23130
|
-
if (this.lexer.state.top = true, this.lexer.blockTokens(c, s, true), this.lexer.state.top =
|
|
23131
|
-
let
|
|
23132
|
-
if (
|
|
23133
|
-
if (
|
|
23134
|
-
let
|
|
23140
|
+
let g = this.lexer.state.top;
|
|
23141
|
+
if (this.lexer.state.top = true, this.lexer.blockTokens(c, s, true), this.lexer.state.top = g, n.length === 0) break;
|
|
23142
|
+
let h = s.at(-1);
|
|
23143
|
+
if (h?.type === "code") break;
|
|
23144
|
+
if (h?.type === "blockquote") {
|
|
23145
|
+
let R = h, f = R.raw + `
|
|
23135
23146
|
` + n.join(`
|
|
23136
|
-
`),
|
|
23137
|
-
s[s.length - 1] =
|
|
23147
|
+
`), O = this.blockquote(f);
|
|
23148
|
+
s[s.length - 1] = O, r = r.substring(0, r.length - R.raw.length) + O.raw, i = i.substring(0, i.length - R.text.length) + O.text;
|
|
23138
23149
|
break;
|
|
23139
|
-
} else if (
|
|
23140
|
-
let
|
|
23150
|
+
} else if (h?.type === "list") {
|
|
23151
|
+
let R = h, f = R.raw + `
|
|
23141
23152
|
` + n.join(`
|
|
23142
|
-
`),
|
|
23143
|
-
s[s.length - 1] =
|
|
23153
|
+
`), O = this.list(f);
|
|
23154
|
+
s[s.length - 1] = O, r = r.substring(0, r.length - h.raw.length) + O.raw, i = i.substring(0, i.length - R.raw.length) + O.raw, n = f.substring(s.at(-1).raw.length).split(`
|
|
23144
23155
|
`);
|
|
23145
23156
|
continue;
|
|
23146
23157
|
}
|
|
@@ -23153,45 +23164,45 @@ ${c}` : c;
|
|
|
23153
23164
|
if (t) {
|
|
23154
23165
|
let n = t[1].trim(), r = n.length > 1, i = { type: "list", raw: "", ordered: r, start: r ? +n.slice(0, -1) : "", loose: false, items: [] };
|
|
23155
23166
|
n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
|
|
23156
|
-
let s = this.rules.other.listItemRegex(n),
|
|
23167
|
+
let s = this.rules.other.listItemRegex(n), a = false;
|
|
23157
23168
|
for (; e; ) {
|
|
23158
|
-
let
|
|
23169
|
+
let p = false, u = "", c = "";
|
|
23159
23170
|
if (!(t = s.exec(e)) || this.rules.block.hr.test(e)) break;
|
|
23160
|
-
|
|
23161
|
-
let
|
|
23162
|
-
`, 1)[0].replace(this.rules.other.listReplaceTabs, (H) => " ".repeat(3 * H.length)),
|
|
23163
|
-
`, 1)[0],
|
|
23164
|
-
if (this.options.pedantic ? (
|
|
23165
|
-
`, e = e.substring(
|
|
23166
|
-
let H = this.rules.other.nextBulletRegex(
|
|
23171
|
+
u = t[0], e = e.substring(u.length);
|
|
23172
|
+
let g = t[2].split(`
|
|
23173
|
+
`, 1)[0].replace(this.rules.other.listReplaceTabs, (H) => " ".repeat(3 * H.length)), h = e.split(`
|
|
23174
|
+
`, 1)[0], R = !g.trim(), f = 0;
|
|
23175
|
+
if (this.options.pedantic ? (f = 2, c = g.trimStart()) : R ? f = t[1].length + 1 : (f = t[2].search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, c = g.slice(f), f += t[1].length), R && this.rules.other.blankLine.test(h) && (u += h + `
|
|
23176
|
+
`, e = e.substring(h.length + 1), p = true), !p) {
|
|
23177
|
+
let H = this.rules.other.nextBulletRegex(f), ee = this.rules.other.hrRegex(f), te = this.rules.other.fencesBeginRegex(f), ne = this.rules.other.headingBeginRegex(f), xe = this.rules.other.htmlBeginRegex(f);
|
|
23167
23178
|
for (; e; ) {
|
|
23168
23179
|
let Z = e.split(`
|
|
23169
23180
|
`, 1)[0], A;
|
|
23170
|
-
if (
|
|
23171
|
-
if (A.search(this.rules.other.nonSpaceChar) >=
|
|
23172
|
-
` + A.slice(
|
|
23181
|
+
if (h = Z, this.options.pedantic ? (h = h.replace(this.rules.other.listReplaceNesting, " "), A = h) : A = h.replace(this.rules.other.tabCharGlobal, " "), te.test(h) || ne.test(h) || xe.test(h) || H.test(h) || ee.test(h)) break;
|
|
23182
|
+
if (A.search(this.rules.other.nonSpaceChar) >= f || !h.trim()) c += `
|
|
23183
|
+
` + A.slice(f);
|
|
23173
23184
|
else {
|
|
23174
|
-
if (
|
|
23185
|
+
if (R || g.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || te.test(g) || ne.test(g) || ee.test(g)) break;
|
|
23175
23186
|
c += `
|
|
23176
|
-
` +
|
|
23187
|
+
` + h;
|
|
23177
23188
|
}
|
|
23178
|
-
!
|
|
23179
|
-
`, e = e.substring(Z.length + 1),
|
|
23189
|
+
!R && !h.trim() && (R = true), u += Z + `
|
|
23190
|
+
`, e = e.substring(Z.length + 1), g = A.slice(f);
|
|
23180
23191
|
}
|
|
23181
23192
|
}
|
|
23182
|
-
i.loose || (
|
|
23183
|
-
let
|
|
23184
|
-
this.options.gfm && (
|
|
23193
|
+
i.loose || (a ? i.loose = true : this.rules.other.doubleBlankLine.test(u) && (a = true));
|
|
23194
|
+
let O = null, Y;
|
|
23195
|
+
this.options.gfm && (O = this.rules.other.listIsTask.exec(c), O && (Y = O[0] !== "[ ] ", c = c.replace(this.rules.other.listReplaceTask, ""))), i.items.push({ type: "list_item", raw: u, task: !!O, checked: Y, loose: false, text: c, tokens: [] }), i.raw += u;
|
|
23185
23196
|
}
|
|
23186
|
-
let
|
|
23187
|
-
if (
|
|
23197
|
+
let o = i.items.at(-1);
|
|
23198
|
+
if (o) o.raw = o.raw.trimEnd(), o.text = o.text.trimEnd();
|
|
23188
23199
|
else return;
|
|
23189
23200
|
i.raw = i.raw.trimEnd();
|
|
23190
|
-
for (let
|
|
23191
|
-
let
|
|
23201
|
+
for (let p = 0; p < i.items.length; p++) if (this.lexer.state.top = false, i.items[p].tokens = this.lexer.blockTokens(i.items[p].text, []), !i.loose) {
|
|
23202
|
+
let u = i.items[p].tokens.filter((g) => g.type === "space"), c = u.length > 0 && u.some((g) => this.rules.other.anyLine.test(g.raw));
|
|
23192
23203
|
i.loose = c;
|
|
23193
23204
|
}
|
|
23194
|
-
if (i.loose) for (let
|
|
23205
|
+
if (i.loose) for (let p = 0; p < i.items.length; p++) i.items[p].loose = true;
|
|
23195
23206
|
return i;
|
|
23196
23207
|
}
|
|
23197
23208
|
}
|
|
@@ -23212,9 +23223,9 @@ ${c}` : c;
|
|
|
23212
23223
|
let n = V(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
|
|
23213
23224
|
`) : [], s = { type: "table", raw: t[0], header: [], align: [], rows: [] };
|
|
23214
23225
|
if (n.length === r.length) {
|
|
23215
|
-
for (let
|
|
23216
|
-
for (let
|
|
23217
|
-
for (let
|
|
23226
|
+
for (let a of r) this.rules.other.tableAlignRight.test(a) ? s.align.push("right") : this.rules.other.tableAlignCenter.test(a) ? s.align.push("center") : this.rules.other.tableAlignLeft.test(a) ? s.align.push("left") : s.align.push(null);
|
|
23227
|
+
for (let a = 0; a < n.length; a++) s.header.push({ text: n[a], tokens: this.lexer.inline(n[a]), header: true, align: s.align[a] });
|
|
23228
|
+
for (let a of i) s.rows.push(V(a, s.header.length).map((o, p) => ({ text: o, tokens: this.lexer.inline(o), header: false, align: s.align[p] })));
|
|
23218
23229
|
return s;
|
|
23219
23230
|
}
|
|
23220
23231
|
}
|
|
@@ -23251,11 +23262,11 @@ ${c}` : c;
|
|
|
23251
23262
|
let s = z(n.slice(0, -1), "\\");
|
|
23252
23263
|
if ((n.length - s.length) % 2 === 0) return;
|
|
23253
23264
|
} else {
|
|
23254
|
-
let s =
|
|
23265
|
+
let s = fe(t[2], "()");
|
|
23255
23266
|
if (s === -2) return;
|
|
23256
23267
|
if (s > -1) {
|
|
23257
|
-
let
|
|
23258
|
-
t[2] = t[2].substring(0, s), t[0] = t[0].substring(0,
|
|
23268
|
+
let o = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + s;
|
|
23269
|
+
t[2] = t[2].substring(0, s), t[0] = t[0].substring(0, o).trim(), t[3] = "";
|
|
23259
23270
|
}
|
|
23260
23271
|
}
|
|
23261
23272
|
let r = t[2], i = "";
|
|
@@ -23263,7 +23274,7 @@ ${c}` : c;
|
|
|
23263
23274
|
let s = this.rules.other.pedanticHrefTitle.exec(r);
|
|
23264
23275
|
s && (r = s[1], i = s[3]);
|
|
23265
23276
|
} else i = t[3] ? t[3].slice(1, -1) : "";
|
|
23266
|
-
return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)),
|
|
23277
|
+
return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), me(t, { href: r && r.replace(this.rules.inline.anyPunctuation, "$1"), title: i && i.replace(this.rules.inline.anyPunctuation, "$1") }, t[0], this.lexer, this.rules);
|
|
23267
23278
|
}
|
|
23268
23279
|
}
|
|
23269
23280
|
reflink(e, t) {
|
|
@@ -23274,32 +23285,32 @@ ${c}` : c;
|
|
|
23274
23285
|
let s = n[0].charAt(0);
|
|
23275
23286
|
return { type: "text", raw: s, text: s };
|
|
23276
23287
|
}
|
|
23277
|
-
return
|
|
23288
|
+
return me(n, i, n[0], this.lexer, this.rules);
|
|
23278
23289
|
}
|
|
23279
23290
|
}
|
|
23280
23291
|
emStrong(e, t, n = "") {
|
|
23281
23292
|
let r = this.rules.inline.emStrongLDelim.exec(e);
|
|
23282
23293
|
if (!r || r[3] && n.match(this.rules.other.unicodeAlphaNumeric)) return;
|
|
23283
23294
|
if (!(r[1] || r[2] || "") || !n || this.rules.inline.punctuation.exec(n)) {
|
|
23284
|
-
let s = [...r[0]].length - 1,
|
|
23295
|
+
let s = [...r[0]].length - 1, a, o, p = s, u = 0, c = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
|
|
23285
23296
|
for (c.lastIndex = 0, t = t.slice(-1 * e.length + s); (r = c.exec(t)) != null; ) {
|
|
23286
|
-
if (
|
|
23287
|
-
if (
|
|
23288
|
-
|
|
23297
|
+
if (a = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !a) continue;
|
|
23298
|
+
if (o = [...a].length, r[3] || r[4]) {
|
|
23299
|
+
p += o;
|
|
23289
23300
|
continue;
|
|
23290
|
-
} else if ((r[5] || r[6]) && s % 3 && !((s +
|
|
23291
|
-
|
|
23301
|
+
} else if ((r[5] || r[6]) && s % 3 && !((s + o) % 3)) {
|
|
23302
|
+
u += o;
|
|
23292
23303
|
continue;
|
|
23293
23304
|
}
|
|
23294
|
-
if (
|
|
23295
|
-
|
|
23296
|
-
let
|
|
23297
|
-
if (Math.min(s,
|
|
23298
|
-
let
|
|
23299
|
-
return { type: "em", raw:
|
|
23305
|
+
if (p -= o, p > 0) continue;
|
|
23306
|
+
o = Math.min(o, o + p + u);
|
|
23307
|
+
let g = [...r[0]][0].length, h = e.slice(0, s + r.index + g + o);
|
|
23308
|
+
if (Math.min(s, o) % 2) {
|
|
23309
|
+
let f = h.slice(1, -1);
|
|
23310
|
+
return { type: "em", raw: h, text: f, tokens: this.lexer.inlineTokens(f) };
|
|
23300
23311
|
}
|
|
23301
|
-
let
|
|
23302
|
-
return { type: "strong", raw:
|
|
23312
|
+
let R = h.slice(2, -2);
|
|
23313
|
+
return { type: "strong", raw: h, text: R, tokens: this.lexer.inlineTokens(R) };
|
|
23303
23314
|
}
|
|
23304
23315
|
}
|
|
23305
23316
|
}
|
|
@@ -23348,19 +23359,19 @@ ${c}` : c;
|
|
|
23348
23359
|
}
|
|
23349
23360
|
}
|
|
23350
23361
|
};
|
|
23351
|
-
var
|
|
23362
|
+
var x = class l {
|
|
23352
23363
|
constructor(e) {
|
|
23353
23364
|
__publicField(this, "tokens");
|
|
23354
23365
|
__publicField(this, "options");
|
|
23355
23366
|
__publicField(this, "state");
|
|
23356
23367
|
__publicField(this, "tokenizer");
|
|
23357
23368
|
__publicField(this, "inlineQueue");
|
|
23358
|
-
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e ||
|
|
23359
|
-
let t = { other: m, block:
|
|
23360
|
-
this.options.pedantic ? (t.block =
|
|
23369
|
+
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || T, this.options.tokenizer = this.options.tokenizer || new y(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: false, inRawBlock: false, top: true };
|
|
23370
|
+
let t = { other: m, block: C.normal, inline: M.normal };
|
|
23371
|
+
this.options.pedantic ? (t.block = C.pedantic, t.inline = M.pedantic) : this.options.gfm && (t.block = C.gfm, this.options.breaks ? t.inline = M.breaks : t.inline = M.gfm), this.tokenizer.rules = t;
|
|
23361
23372
|
}
|
|
23362
23373
|
static get rules() {
|
|
23363
|
-
return { block:
|
|
23374
|
+
return { block: C, inline: M };
|
|
23364
23375
|
}
|
|
23365
23376
|
static lex(e, t) {
|
|
23366
23377
|
return new l(t).lex(e);
|
|
@@ -23440,9 +23451,9 @@ var b = class l {
|
|
|
23440
23451
|
}
|
|
23441
23452
|
let i = e;
|
|
23442
23453
|
if (this.options.extensions?.startBlock) {
|
|
23443
|
-
let s = 1 / 0,
|
|
23444
|
-
this.options.extensions.startBlock.forEach((
|
|
23445
|
-
|
|
23454
|
+
let s = 1 / 0, a = e.slice(1), o;
|
|
23455
|
+
this.options.extensions.startBlock.forEach((p) => {
|
|
23456
|
+
o = p.call({ lexer: this }, a), typeof o == "number" && o >= 0 && (s = Math.min(s, o));
|
|
23446
23457
|
}), s < 1 / 0 && s >= 0 && (i = e.substring(0, s + 1));
|
|
23447
23458
|
}
|
|
23448
23459
|
if (this.state.top && (r = this.tokenizer.paragraph(i))) {
|
|
@@ -23482,11 +23493,12 @@ var b = class l {
|
|
|
23482
23493
|
if (o.length > 0) for (; (r = this.tokenizer.rules.inline.reflinkSearch.exec(n)) != null; ) o.includes(r[0].slice(r[0].lastIndexOf("[") + 1, -1)) && (n = n.slice(0, r.index) + "[" + "a".repeat(r[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
|
|
23483
23494
|
}
|
|
23484
23495
|
for (; (r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) != null; ) n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
|
|
23485
|
-
|
|
23496
|
+
let i;
|
|
23497
|
+
for (; (r = this.tokenizer.rules.inline.blockSkip.exec(n)) != null; ) i = r[2] ? r[2].length : 0, n = n.slice(0, r.index + i) + "[" + "a".repeat(r[0].length - i - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
|
|
23486
23498
|
n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
|
|
23487
|
-
let
|
|
23499
|
+
let s = false, a = "";
|
|
23488
23500
|
for (; e; ) {
|
|
23489
|
-
|
|
23501
|
+
s || (a = ""), s = false;
|
|
23490
23502
|
let o;
|
|
23491
23503
|
if (this.options.extensions?.inline?.some((u) => (o = u.call({ lexer: this }, e, t)) ? (e = e.substring(o.raw.length), t.push(o), true) : false)) continue;
|
|
23492
23504
|
if (o = this.tokenizer.escape(e)) {
|
|
@@ -23507,7 +23519,7 @@ var b = class l {
|
|
|
23507
23519
|
o.type === "text" && u?.type === "text" ? (u.raw += o.raw, u.text += o.text) : t.push(o);
|
|
23508
23520
|
continue;
|
|
23509
23521
|
}
|
|
23510
|
-
if (o = this.tokenizer.emStrong(e, n,
|
|
23522
|
+
if (o = this.tokenizer.emStrong(e, n, a)) {
|
|
23511
23523
|
e = e.substring(o.raw.length), t.push(o);
|
|
23512
23524
|
continue;
|
|
23513
23525
|
}
|
|
@@ -23531,15 +23543,15 @@ var b = class l {
|
|
|
23531
23543
|
e = e.substring(o.raw.length), t.push(o);
|
|
23532
23544
|
continue;
|
|
23533
23545
|
}
|
|
23534
|
-
let
|
|
23546
|
+
let p = e;
|
|
23535
23547
|
if (this.options.extensions?.startInline) {
|
|
23536
|
-
let u = 1 / 0,
|
|
23537
|
-
this.options.extensions.startInline.forEach((
|
|
23538
|
-
|
|
23539
|
-
}), u < 1 / 0 && u >= 0 && (
|
|
23548
|
+
let u = 1 / 0, c = e.slice(1), g;
|
|
23549
|
+
this.options.extensions.startInline.forEach((h) => {
|
|
23550
|
+
g = h.call({ lexer: this }, c), typeof g == "number" && g >= 0 && (u = Math.min(u, g));
|
|
23551
|
+
}), u < 1 / 0 && u >= 0 && (p = e.substring(0, u + 1));
|
|
23540
23552
|
}
|
|
23541
|
-
if (o = this.tokenizer.inlineText(
|
|
23542
|
-
e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (
|
|
23553
|
+
if (o = this.tokenizer.inlineText(p)) {
|
|
23554
|
+
e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (a = o.raw.slice(-1)), s = true;
|
|
23543
23555
|
let u = t.at(-1);
|
|
23544
23556
|
u?.type === "text" ? (u.raw += o.raw, u.text += o.text) : t.push(o);
|
|
23545
23557
|
continue;
|
|
@@ -23559,7 +23571,7 @@ var P = class {
|
|
|
23559
23571
|
constructor(e) {
|
|
23560
23572
|
__publicField(this, "options");
|
|
23561
23573
|
__publicField(this, "parser");
|
|
23562
|
-
this.options = e ||
|
|
23574
|
+
this.options = e || T;
|
|
23563
23575
|
}
|
|
23564
23576
|
space(e) {
|
|
23565
23577
|
return "";
|
|
@@ -23592,9 +23604,9 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
23592
23604
|
}
|
|
23593
23605
|
list(e) {
|
|
23594
23606
|
let t = e.ordered, n = e.start, r = "";
|
|
23595
|
-
for (let
|
|
23596
|
-
let
|
|
23597
|
-
r += this.listitem(
|
|
23607
|
+
for (let a = 0; a < e.items.length; a++) {
|
|
23608
|
+
let o = e.items[a];
|
|
23609
|
+
r += this.listitem(o);
|
|
23598
23610
|
}
|
|
23599
23611
|
let i = t ? "ol" : "ul", s = t && n !== 1 ? ' start="' + n + '"' : "";
|
|
23600
23612
|
return "<" + i + s + `>
|
|
@@ -23625,7 +23637,7 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
23625
23637
|
for (let i = 0; i < e.rows.length; i++) {
|
|
23626
23638
|
let s = e.rows[i];
|
|
23627
23639
|
n = "";
|
|
23628
|
-
for (let
|
|
23640
|
+
for (let a = 0; a < s.length; a++) n += this.tablecell(s[a]);
|
|
23629
23641
|
r += this.tablerow({ text: n });
|
|
23630
23642
|
}
|
|
23631
23643
|
return r && (r = `<tbody>${r}</tbody>`), `<table>
|
|
@@ -23707,12 +23719,12 @@ var $ = class {
|
|
|
23707
23719
|
return "";
|
|
23708
23720
|
}
|
|
23709
23721
|
};
|
|
23710
|
-
var
|
|
23722
|
+
var b = class l2 {
|
|
23711
23723
|
constructor(e) {
|
|
23712
23724
|
__publicField(this, "options");
|
|
23713
23725
|
__publicField(this, "renderer");
|
|
23714
23726
|
__publicField(this, "textRenderer");
|
|
23715
|
-
this.options = e ||
|
|
23727
|
+
this.options = e || T, this.options.renderer = this.options.renderer || new P(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new $();
|
|
23716
23728
|
}
|
|
23717
23729
|
static parse(e, t) {
|
|
23718
23730
|
return new l2(t).parse(e);
|
|
@@ -23725,9 +23737,9 @@ var R = class l2 {
|
|
|
23725
23737
|
for (let r = 0; r < e.length; r++) {
|
|
23726
23738
|
let i = e[r];
|
|
23727
23739
|
if (this.options.extensions?.renderers?.[i.type]) {
|
|
23728
|
-
let
|
|
23729
|
-
if (
|
|
23730
|
-
n +=
|
|
23740
|
+
let a = i, o = this.options.extensions.renderers[a.type].call({ parser: this }, a);
|
|
23741
|
+
if (o !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(a.type)) {
|
|
23742
|
+
n += o || "";
|
|
23731
23743
|
continue;
|
|
23732
23744
|
}
|
|
23733
23745
|
}
|
|
@@ -23774,16 +23786,16 @@ var R = class l2 {
|
|
|
23774
23786
|
continue;
|
|
23775
23787
|
}
|
|
23776
23788
|
case "text": {
|
|
23777
|
-
let
|
|
23778
|
-
for (; r + 1 < e.length && e[r + 1].type === "text"; )
|
|
23779
|
-
` + this.renderer.text(
|
|
23780
|
-
t ? n += this.renderer.paragraph({ type: "paragraph", raw:
|
|
23789
|
+
let a = s, o = this.renderer.text(a);
|
|
23790
|
+
for (; r + 1 < e.length && e[r + 1].type === "text"; ) a = e[++r], o += `
|
|
23791
|
+
` + this.renderer.text(a);
|
|
23792
|
+
t ? n += this.renderer.paragraph({ type: "paragraph", raw: o, text: o, tokens: [{ type: "text", raw: o, text: o, escaped: true }] }) : n += o;
|
|
23781
23793
|
continue;
|
|
23782
23794
|
}
|
|
23783
23795
|
default: {
|
|
23784
|
-
let
|
|
23785
|
-
if (this.options.silent) return console.error(
|
|
23786
|
-
throw new Error(
|
|
23796
|
+
let a = 'Token with "' + s.type + '" type was not found.';
|
|
23797
|
+
if (this.options.silent) return console.error(a), "";
|
|
23798
|
+
throw new Error(a);
|
|
23787
23799
|
}
|
|
23788
23800
|
}
|
|
23789
23801
|
}
|
|
@@ -23794,9 +23806,9 @@ var R = class l2 {
|
|
|
23794
23806
|
for (let r = 0; r < e.length; r++) {
|
|
23795
23807
|
let i = e[r];
|
|
23796
23808
|
if (this.options.extensions?.renderers?.[i.type]) {
|
|
23797
|
-
let
|
|
23798
|
-
if (
|
|
23799
|
-
n +=
|
|
23809
|
+
let a = this.options.extensions.renderers[i.type].call({ parser: this }, i);
|
|
23810
|
+
if (a !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(i.type)) {
|
|
23811
|
+
n += a || "";
|
|
23800
23812
|
continue;
|
|
23801
23813
|
}
|
|
23802
23814
|
}
|
|
@@ -23843,9 +23855,9 @@ var R = class l2 {
|
|
|
23843
23855
|
break;
|
|
23844
23856
|
}
|
|
23845
23857
|
default: {
|
|
23846
|
-
let
|
|
23847
|
-
if (this.options.silent) return console.error(
|
|
23848
|
-
throw new Error(
|
|
23858
|
+
let a = 'Token with "' + s.type + '" type was not found.';
|
|
23859
|
+
if (this.options.silent) return console.error(a), "";
|
|
23860
|
+
throw new Error(a);
|
|
23849
23861
|
}
|
|
23850
23862
|
}
|
|
23851
23863
|
}
|
|
@@ -23856,7 +23868,7 @@ var S = (_a = class {
|
|
|
23856
23868
|
constructor(e) {
|
|
23857
23869
|
__publicField(this, "options");
|
|
23858
23870
|
__publicField(this, "block");
|
|
23859
|
-
this.options = e ||
|
|
23871
|
+
this.options = e || T;
|
|
23860
23872
|
}
|
|
23861
23873
|
preprocess(e) {
|
|
23862
23874
|
return e;
|
|
@@ -23871,10 +23883,10 @@ var S = (_a = class {
|
|
|
23871
23883
|
return e;
|
|
23872
23884
|
}
|
|
23873
23885
|
provideLexer() {
|
|
23874
|
-
return this.block ?
|
|
23886
|
+
return this.block ? x.lex : x.lexInline;
|
|
23875
23887
|
}
|
|
23876
23888
|
provideParser() {
|
|
23877
|
-
return this.block ?
|
|
23889
|
+
return this.block ? b.parse : b.parseInline;
|
|
23878
23890
|
}
|
|
23879
23891
|
}, __publicField(_a, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), __publicField(_a, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), _a);
|
|
23880
23892
|
var B = class {
|
|
@@ -23883,10 +23895,10 @@ var B = class {
|
|
|
23883
23895
|
__publicField(this, "options", this.setOptions);
|
|
23884
23896
|
__publicField(this, "parse", this.parseMarkdown(true));
|
|
23885
23897
|
__publicField(this, "parseInline", this.parseMarkdown(false));
|
|
23886
|
-
__publicField(this, "Parser",
|
|
23898
|
+
__publicField(this, "Parser", b);
|
|
23887
23899
|
__publicField(this, "Renderer", P);
|
|
23888
23900
|
__publicField(this, "TextRenderer", $);
|
|
23889
|
-
__publicField(this, "Lexer",
|
|
23901
|
+
__publicField(this, "Lexer", x);
|
|
23890
23902
|
__publicField(this, "Tokenizer", y);
|
|
23891
23903
|
__publicField(this, "Hooks", S);
|
|
23892
23904
|
this.use(...e);
|
|
@@ -23897,7 +23909,7 @@ var B = class {
|
|
|
23897
23909
|
case "table": {
|
|
23898
23910
|
let i = r;
|
|
23899
23911
|
for (let s of i.header) n = n.concat(this.walkTokens(s.tokens, t));
|
|
23900
|
-
for (let s of i.rows) for (let
|
|
23912
|
+
for (let s of i.rows) for (let a of s) n = n.concat(this.walkTokens(a.tokens, t));
|
|
23901
23913
|
break;
|
|
23902
23914
|
}
|
|
23903
23915
|
case "list": {
|
|
@@ -23908,8 +23920,8 @@ var B = class {
|
|
|
23908
23920
|
default: {
|
|
23909
23921
|
let i = r;
|
|
23910
23922
|
this.defaults.extensions?.childTokens?.[i.type] ? this.defaults.extensions.childTokens[i.type].forEach((s) => {
|
|
23911
|
-
let
|
|
23912
|
-
n = n.concat(this.walkTokens(
|
|
23923
|
+
let a = i[s].flat(1 / 0);
|
|
23924
|
+
n = n.concat(this.walkTokens(a, t));
|
|
23913
23925
|
}) : i.tokens && (n = n.concat(this.walkTokens(i.tokens, t)));
|
|
23914
23926
|
}
|
|
23915
23927
|
}
|
|
@@ -23923,9 +23935,9 @@ var B = class {
|
|
|
23923
23935
|
if (!i.name) throw new Error("extension name required");
|
|
23924
23936
|
if ("renderer" in i) {
|
|
23925
23937
|
let s = t.renderers[i.name];
|
|
23926
|
-
s ? t.renderers[i.name] = function(...
|
|
23927
|
-
let
|
|
23928
|
-
return
|
|
23938
|
+
s ? t.renderers[i.name] = function(...a) {
|
|
23939
|
+
let o = i.renderer.apply(this, a);
|
|
23940
|
+
return o === false && (o = s.apply(this, a)), o;
|
|
23929
23941
|
} : t.renderers[i.name] = i.renderer;
|
|
23930
23942
|
}
|
|
23931
23943
|
if ("tokenizer" in i) {
|
|
@@ -23939,10 +23951,10 @@ var B = class {
|
|
|
23939
23951
|
for (let s in n.renderer) {
|
|
23940
23952
|
if (!(s in i)) throw new Error(`renderer '${s}' does not exist`);
|
|
23941
23953
|
if (["options", "parser"].includes(s)) continue;
|
|
23942
|
-
let
|
|
23943
|
-
i[
|
|
23944
|
-
let c =
|
|
23945
|
-
return c === false && (c =
|
|
23954
|
+
let a = s, o = n.renderer[a], p = i[a];
|
|
23955
|
+
i[a] = (...u) => {
|
|
23956
|
+
let c = o.apply(i, u);
|
|
23957
|
+
return c === false && (c = p.apply(i, u)), c || "";
|
|
23946
23958
|
};
|
|
23947
23959
|
}
|
|
23948
23960
|
r.renderer = i;
|
|
@@ -23952,10 +23964,10 @@ var B = class {
|
|
|
23952
23964
|
for (let s in n.tokenizer) {
|
|
23953
23965
|
if (!(s in i)) throw new Error(`tokenizer '${s}' does not exist`);
|
|
23954
23966
|
if (["options", "rules", "lexer"].includes(s)) continue;
|
|
23955
|
-
let
|
|
23956
|
-
i[
|
|
23957
|
-
let c =
|
|
23958
|
-
return c === false && (c =
|
|
23967
|
+
let a = s, o = n.tokenizer[a], p = i[a];
|
|
23968
|
+
i[a] = (...u) => {
|
|
23969
|
+
let c = o.apply(i, u);
|
|
23970
|
+
return c === false && (c = p.apply(i, u)), c;
|
|
23959
23971
|
};
|
|
23960
23972
|
}
|
|
23961
23973
|
r.tokenizer = i;
|
|
@@ -23965,23 +23977,30 @@ var B = class {
|
|
|
23965
23977
|
for (let s in n.hooks) {
|
|
23966
23978
|
if (!(s in i)) throw new Error(`hook '${s}' does not exist`);
|
|
23967
23979
|
if (["options", "block"].includes(s)) continue;
|
|
23968
|
-
let
|
|
23969
|
-
S.passThroughHooks.has(s) ? i[
|
|
23970
|
-
if (this.defaults.async && S.passThroughHooksRespectAsync.has(s)) return
|
|
23971
|
-
|
|
23972
|
-
|
|
23973
|
-
|
|
23974
|
-
let c =
|
|
23975
|
-
return
|
|
23980
|
+
let a = s, o = n.hooks[a], p = i[a];
|
|
23981
|
+
S.passThroughHooks.has(s) ? i[a] = (u) => {
|
|
23982
|
+
if (this.defaults.async && S.passThroughHooksRespectAsync.has(s)) return (async () => {
|
|
23983
|
+
let g = await o.call(i, u);
|
|
23984
|
+
return p.call(i, g);
|
|
23985
|
+
})();
|
|
23986
|
+
let c = o.call(i, u);
|
|
23987
|
+
return p.call(i, c);
|
|
23988
|
+
} : i[a] = (...u) => {
|
|
23989
|
+
if (this.defaults.async) return (async () => {
|
|
23990
|
+
let g = await o.apply(i, u);
|
|
23991
|
+
return g === false && (g = await p.apply(i, u)), g;
|
|
23992
|
+
})();
|
|
23993
|
+
let c = o.apply(i, u);
|
|
23994
|
+
return c === false && (c = p.apply(i, u)), c;
|
|
23976
23995
|
};
|
|
23977
23996
|
}
|
|
23978
23997
|
r.hooks = i;
|
|
23979
23998
|
}
|
|
23980
23999
|
if (n.walkTokens) {
|
|
23981
24000
|
let i = this.defaults.walkTokens, s = n.walkTokens;
|
|
23982
|
-
r.walkTokens = function(
|
|
23983
|
-
let
|
|
23984
|
-
return
|
|
24001
|
+
r.walkTokens = function(a) {
|
|
24002
|
+
let o = [];
|
|
24003
|
+
return o.push(s.call(this, a)), i && (o = o.concat(i.call(this, a))), o;
|
|
23985
24004
|
};
|
|
23986
24005
|
}
|
|
23987
24006
|
this.defaults = { ...this.defaults, ...r };
|
|
@@ -23991,28 +24010,31 @@ var B = class {
|
|
|
23991
24010
|
return this.defaults = { ...this.defaults, ...e }, this;
|
|
23992
24011
|
}
|
|
23993
24012
|
lexer(e, t) {
|
|
23994
|
-
return
|
|
24013
|
+
return x.lex(e, t ?? this.defaults);
|
|
23995
24014
|
}
|
|
23996
24015
|
parser(e, t) {
|
|
23997
|
-
return
|
|
24016
|
+
return b.parse(e, t ?? this.defaults);
|
|
23998
24017
|
}
|
|
23999
24018
|
parseMarkdown(e) {
|
|
24000
24019
|
return (n, r) => {
|
|
24001
|
-
let i = { ...r }, s = { ...this.defaults, ...i },
|
|
24002
|
-
if (this.defaults.async === true && i.async === false) return
|
|
24003
|
-
if (typeof n > "u" || n === null) return
|
|
24004
|
-
if (typeof n != "string") return
|
|
24005
|
-
s.hooks && (s.hooks.options = s, s.hooks.block = e)
|
|
24006
|
-
|
|
24007
|
-
|
|
24020
|
+
let i = { ...r }, s = { ...this.defaults, ...i }, a = this.onError(!!s.silent, !!s.async);
|
|
24021
|
+
if (this.defaults.async === true && i.async === false) return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
|
|
24022
|
+
if (typeof n > "u" || n === null) return a(new Error("marked(): input parameter is undefined or null"));
|
|
24023
|
+
if (typeof n != "string") return a(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
|
|
24024
|
+
if (s.hooks && (s.hooks.options = s, s.hooks.block = e), s.async) return (async () => {
|
|
24025
|
+
let o = s.hooks ? await s.hooks.preprocess(n) : n, u = await (s.hooks ? await s.hooks.provideLexer() : e ? x.lex : x.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(u) : u;
|
|
24026
|
+
s.walkTokens && await Promise.all(this.walkTokens(c, s.walkTokens));
|
|
24027
|
+
let h = await (s.hooks ? await s.hooks.provideParser() : e ? b.parse : b.parseInline)(c, s);
|
|
24028
|
+
return s.hooks ? await s.hooks.postprocess(h) : h;
|
|
24029
|
+
})().catch(a);
|
|
24008
24030
|
try {
|
|
24009
24031
|
s.hooks && (n = s.hooks.preprocess(n));
|
|
24010
|
-
let p =
|
|
24032
|
+
let p = (s.hooks ? s.hooks.provideLexer() : e ? x.lex : x.lexInline)(n, s);
|
|
24011
24033
|
s.hooks && (p = s.hooks.processAllTokens(p)), s.walkTokens && this.walkTokens(p, s.walkTokens);
|
|
24012
|
-
let c =
|
|
24034
|
+
let c = (s.hooks ? s.hooks.provideParser() : e ? b.parse : b.parseInline)(p, s);
|
|
24013
24035
|
return s.hooks && (c = s.hooks.postprocess(c)), c;
|
|
24014
|
-
} catch (
|
|
24015
|
-
return o
|
|
24036
|
+
} catch (o) {
|
|
24037
|
+
return a(o);
|
|
24016
24038
|
}
|
|
24017
24039
|
};
|
|
24018
24040
|
}
|
|
@@ -24029,38 +24051,38 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24029
24051
|
}
|
|
24030
24052
|
};
|
|
24031
24053
|
var _ = new B();
|
|
24032
|
-
function
|
|
24054
|
+
function k(l3, e) {
|
|
24033
24055
|
return _.parse(l3, e);
|
|
24034
24056
|
}
|
|
24035
|
-
|
|
24036
|
-
return _.setOptions(l3),
|
|
24057
|
+
k.options = k.setOptions = function(l3) {
|
|
24058
|
+
return _.setOptions(l3), k.defaults = _.defaults, G(k.defaults), k;
|
|
24037
24059
|
};
|
|
24038
|
-
|
|
24039
|
-
|
|
24040
|
-
|
|
24041
|
-
return _.use(...l3),
|
|
24060
|
+
k.getDefaults = L;
|
|
24061
|
+
k.defaults = T;
|
|
24062
|
+
k.use = function(...l3) {
|
|
24063
|
+
return _.use(...l3), k.defaults = _.defaults, G(k.defaults), k;
|
|
24042
24064
|
};
|
|
24043
|
-
|
|
24065
|
+
k.walkTokens = function(l3, e) {
|
|
24044
24066
|
return _.walkTokens(l3, e);
|
|
24045
24067
|
};
|
|
24046
|
-
|
|
24047
|
-
|
|
24048
|
-
|
|
24049
|
-
|
|
24050
|
-
|
|
24051
|
-
|
|
24052
|
-
|
|
24053
|
-
|
|
24054
|
-
|
|
24055
|
-
|
|
24056
|
-
|
|
24057
|
-
|
|
24058
|
-
|
|
24059
|
-
|
|
24060
|
-
|
|
24061
|
-
|
|
24062
|
-
|
|
24063
|
-
|
|
24068
|
+
k.parseInline = _.parseInline;
|
|
24069
|
+
k.Parser = b;
|
|
24070
|
+
k.parser = b.parse;
|
|
24071
|
+
k.Renderer = P;
|
|
24072
|
+
k.TextRenderer = $;
|
|
24073
|
+
k.Lexer = x;
|
|
24074
|
+
k.lexer = x.lex;
|
|
24075
|
+
k.Tokenizer = y;
|
|
24076
|
+
k.Hooks = S;
|
|
24077
|
+
k.parse = k;
|
|
24078
|
+
k.options;
|
|
24079
|
+
k.setOptions;
|
|
24080
|
+
k.use;
|
|
24081
|
+
k.walkTokens;
|
|
24082
|
+
k.parseInline;
|
|
24083
|
+
b.parse;
|
|
24084
|
+
x.lex;
|
|
24085
|
+
k.use({
|
|
24064
24086
|
breaks: false,
|
|
24065
24087
|
// Use proper paragraphs, not <br> tags
|
|
24066
24088
|
gfm: true
|
|
@@ -24071,7 +24093,7 @@ function createDocFromMarkdown(markdown, schema, options = {}) {
|
|
|
24071
24093
|
return createDocFromHTML(html, schema, options);
|
|
24072
24094
|
}
|
|
24073
24095
|
function convertMarkdownToHTML(markdown) {
|
|
24074
|
-
let html =
|
|
24096
|
+
let html = k.parse(markdown, { async: false });
|
|
24075
24097
|
return html.replace(/<\/p>\n<ul>/g, "</p>\n<p> </p>\n<ul>").replace(/<\/p>\n<ol>/g, "</p>\n<p> </p>\n<ol>").replace(/<\/ul>\n<h/g, "</ul>\n<p> </p>\n<h").replace(/<\/ol>\n<h/g, "</ol>\n<p> </p>\n<h");
|
|
24076
24098
|
}
|
|
24077
24099
|
function processContent({ content, type: type2, schema }) {
|
|
@@ -24250,7 +24272,7 @@ const getBasicNumIdTag = (numId, abstractId) => {
|
|
|
24250
24272
|
};
|
|
24251
24273
|
const getNewListId = (editor, grouping = "definitions") => {
|
|
24252
24274
|
const defs = editor.converter.numbering[grouping] || {};
|
|
24253
|
-
const intKeys = Object.keys(defs).map((
|
|
24275
|
+
const intKeys = Object.keys(defs).map((k2) => Number(k2)).filter((n) => Number.isInteger(n));
|
|
24254
24276
|
const max2 = intKeys.length ? Math.max(...intKeys) : 0;
|
|
24255
24277
|
return max2 + 1;
|
|
24256
24278
|
};
|
|
@@ -28704,18 +28726,18 @@ const handleShapeGroup = (params, node, graphicData, size, padding, marginOffset
|
|
|
28704
28726
|
const rawY = shapeOff?.attributes?.["y"] ? parseFloat(shapeOff.attributes["y"]) : 0;
|
|
28705
28727
|
const rawWidth = shapeExt?.attributes?.["cx"] ? parseFloat(shapeExt.attributes["cx"]) : 914400;
|
|
28706
28728
|
const rawHeight = shapeExt?.attributes?.["cy"] ? parseFloat(shapeExt.attributes["cy"]) : 914400;
|
|
28707
|
-
let
|
|
28729
|
+
let x2, y2, width, height;
|
|
28708
28730
|
if (groupTransform.childWidth && groupTransform.childHeight) {
|
|
28709
28731
|
const scaleX = groupTransform.width / groupTransform.childWidth;
|
|
28710
28732
|
const scaleY = groupTransform.height / groupTransform.childHeight;
|
|
28711
28733
|
const childOriginX = groupTransform.childOriginXEmu || 0;
|
|
28712
28734
|
const childOriginY = groupTransform.childOriginYEmu || 0;
|
|
28713
|
-
|
|
28735
|
+
x2 = groupTransform.x + emuToPixels((rawX - childOriginX) * scaleX);
|
|
28714
28736
|
y2 = groupTransform.y + emuToPixels((rawY - childOriginY) * scaleY);
|
|
28715
28737
|
width = emuToPixels(rawWidth * scaleX);
|
|
28716
28738
|
height = emuToPixels(rawHeight * scaleY);
|
|
28717
28739
|
} else {
|
|
28718
|
-
|
|
28740
|
+
x2 = emuToPixels(rawX);
|
|
28719
28741
|
y2 = emuToPixels(rawY);
|
|
28720
28742
|
width = emuToPixels(rawWidth);
|
|
28721
28743
|
height = emuToPixels(rawHeight);
|
|
@@ -28734,7 +28756,7 @@ const handleShapeGroup = (params, node, graphicData, size, padding, marginOffset
|
|
|
28734
28756
|
shapeType: "vectorShape",
|
|
28735
28757
|
attrs: {
|
|
28736
28758
|
kind: shapeKind,
|
|
28737
|
-
x,
|
|
28759
|
+
x: x2,
|
|
28738
28760
|
y: y2,
|
|
28739
28761
|
width,
|
|
28740
28762
|
height,
|
|
@@ -28943,8 +28965,8 @@ const translateImageNode = (params) => {
|
|
|
28943
28965
|
const leftMargin = tableCell.attrs.cellMargins?.left || 8;
|
|
28944
28966
|
const rightMargin = tableCell.attrs.cellMargins?.right || 8;
|
|
28945
28967
|
const maxWidthEmu = pixelsToEmu(colwidthSum - (leftMargin + rightMargin));
|
|
28946
|
-
const { width: w2, height:
|
|
28947
|
-
if (w2 &&
|
|
28968
|
+
const { width: w2, height: h } = resizeKeepAspectRatio(size.w, size.h, maxWidthEmu);
|
|
28969
|
+
if (w2 && h) size = { w: w2, h };
|
|
28948
28970
|
}
|
|
28949
28971
|
if (imageId) {
|
|
28950
28972
|
const docx = params.converter?.convertedXml || {};
|
|
@@ -33152,7 +33174,11 @@ function importCommentData({ docx, editor, converter }) {
|
|
|
33152
33174
|
const generateCommentsWithExtendedData = ({ docx, comments }) => {
|
|
33153
33175
|
if (!comments?.length) return [];
|
|
33154
33176
|
const commentsExtended = docx["word/commentsExtended.xml"];
|
|
33155
|
-
if (!commentsExtended)
|
|
33177
|
+
if (!commentsExtended) {
|
|
33178
|
+
const commentRanges = extractCommentRangesFromDocument(docx);
|
|
33179
|
+
const commentsWithThreading = detectThreadingFromRanges(comments, commentRanges);
|
|
33180
|
+
return commentsWithThreading.map((comment) => ({ ...comment, isDone: comment.isDone ?? false }));
|
|
33181
|
+
}
|
|
33156
33182
|
const { elements: initialElements = [] } = commentsExtended;
|
|
33157
33183
|
if (!initialElements?.length) return comments.map((comment) => ({ ...comment, isDone: comment.isDone ?? false }));
|
|
33158
33184
|
const { elements = [] } = initialElements[0] ?? {};
|
|
@@ -33178,6 +33204,79 @@ const getExtendedDetails = (commentEx) => {
|
|
|
33178
33204
|
const paraIdParent = attributes["w15:paraIdParent"];
|
|
33179
33205
|
return { paraId, isDone, paraIdParent };
|
|
33180
33206
|
};
|
|
33207
|
+
const extractCommentRangesFromDocument = (docx) => {
|
|
33208
|
+
const documentXml = docx["word/document.xml"];
|
|
33209
|
+
if (!documentXml) {
|
|
33210
|
+
return [];
|
|
33211
|
+
}
|
|
33212
|
+
const pendingComments = [];
|
|
33213
|
+
const walkElements = (elements) => {
|
|
33214
|
+
if (!elements || !Array.isArray(elements)) return;
|
|
33215
|
+
elements.forEach((element) => {
|
|
33216
|
+
if (element.name === "w:commentRangeStart") {
|
|
33217
|
+
const commentId = element.attributes?.["w:id"];
|
|
33218
|
+
if (commentId !== void 0) {
|
|
33219
|
+
pendingComments.push({
|
|
33220
|
+
type: "start",
|
|
33221
|
+
commentId: String(commentId)
|
|
33222
|
+
});
|
|
33223
|
+
}
|
|
33224
|
+
} else if (element.name === "w:commentRangeEnd") {
|
|
33225
|
+
const commentId = element.attributes?.["w:id"];
|
|
33226
|
+
if (commentId !== void 0) {
|
|
33227
|
+
pendingComments.push({
|
|
33228
|
+
type: "end",
|
|
33229
|
+
commentId: String(commentId)
|
|
33230
|
+
});
|
|
33231
|
+
}
|
|
33232
|
+
}
|
|
33233
|
+
if (element.elements && Array.isArray(element.elements)) {
|
|
33234
|
+
walkElements(element.elements);
|
|
33235
|
+
}
|
|
33236
|
+
});
|
|
33237
|
+
};
|
|
33238
|
+
if (documentXml.elements && documentXml.elements.length > 0) {
|
|
33239
|
+
const body = documentXml.elements[0];
|
|
33240
|
+
if (body.elements) {
|
|
33241
|
+
walkElements(body.elements);
|
|
33242
|
+
}
|
|
33243
|
+
}
|
|
33244
|
+
return pendingComments;
|
|
33245
|
+
};
|
|
33246
|
+
const detectThreadingFromRanges = (comments, rangeEvents) => {
|
|
33247
|
+
if (!rangeEvents || rangeEvents.length === 0) {
|
|
33248
|
+
return comments;
|
|
33249
|
+
}
|
|
33250
|
+
const openRanges = [];
|
|
33251
|
+
const parentMap = /* @__PURE__ */ new Map();
|
|
33252
|
+
rangeEvents.forEach((event) => {
|
|
33253
|
+
if (event.type === "start") {
|
|
33254
|
+
if (openRanges.length > 0) {
|
|
33255
|
+
const parentCommentId = openRanges[openRanges.length - 1];
|
|
33256
|
+
parentMap.set(event.commentId, parentCommentId);
|
|
33257
|
+
}
|
|
33258
|
+
openRanges.push(event.commentId);
|
|
33259
|
+
} else if (event.type === "end") {
|
|
33260
|
+
const index2 = openRanges.lastIndexOf(event.commentId);
|
|
33261
|
+
if (index2 !== -1) {
|
|
33262
|
+
openRanges.splice(index2, 1);
|
|
33263
|
+
}
|
|
33264
|
+
}
|
|
33265
|
+
});
|
|
33266
|
+
return comments.map((comment) => {
|
|
33267
|
+
const parentCommentId = parentMap.get(comment.importedId);
|
|
33268
|
+
if (parentCommentId) {
|
|
33269
|
+
const parentComment = comments.find((c) => c.importedId === parentCommentId);
|
|
33270
|
+
if (parentComment) {
|
|
33271
|
+
return {
|
|
33272
|
+
...comment,
|
|
33273
|
+
parentCommentId: parentComment.commentId
|
|
33274
|
+
};
|
|
33275
|
+
}
|
|
33276
|
+
}
|
|
33277
|
+
return comment;
|
|
33278
|
+
});
|
|
33279
|
+
};
|
|
33181
33280
|
const RELATIONSHIP_TYPES = (
|
|
33182
33281
|
/** @type {const} */
|
|
33183
33282
|
{
|
|
@@ -35638,7 +35737,7 @@ const prepareCommentParaIds = (comment) => {
|
|
|
35638
35737
|
return newComment;
|
|
35639
35738
|
};
|
|
35640
35739
|
const getCommentDefinition = (comment, commentId, allComments, editor) => {
|
|
35641
|
-
const translatedText =
|
|
35740
|
+
const translatedText = translator$1p.decode({ editor, node: comment.commentJSON });
|
|
35642
35741
|
const attributes = {
|
|
35643
35742
|
"w:id": String(commentId),
|
|
35644
35743
|
"w:author": comment.creatorName || comment.importedAuthor?.name,
|
|
@@ -35677,10 +35776,12 @@ const toIsoNoFractional = (unixMillis) => {
|
|
|
35677
35776
|
const updateCommentsXml = (commentDefs = [], commentsXml) => {
|
|
35678
35777
|
const newCommentsXml = carbonCopy(commentsXml);
|
|
35679
35778
|
commentDefs.forEach((commentDef) => {
|
|
35680
|
-
const
|
|
35779
|
+
const paraNode = commentDef.elements[0];
|
|
35780
|
+
if (!paraNode.attributes) paraNode.attributes = {};
|
|
35781
|
+
const elements = paraNode.elements;
|
|
35681
35782
|
elements.unshift(COMMENT_REF);
|
|
35682
35783
|
const paraId = commentDef.attributes["w15:paraId"];
|
|
35683
|
-
|
|
35784
|
+
paraNode.attributes["w14:paraId"] = paraId;
|
|
35684
35785
|
commentDef.attributes = {
|
|
35685
35786
|
"w:id": commentDef.attributes["w:id"],
|
|
35686
35787
|
"w:author": commentDef.attributes["w:author"],
|
|
@@ -36053,7 +36154,7 @@ const _SuperConverter = class _SuperConverter {
|
|
|
36053
36154
|
static getStoredSuperdocVersion(docx) {
|
|
36054
36155
|
return _SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
36055
36156
|
}
|
|
36056
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version = "0.34.
|
|
36157
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version = "0.34.6-RC1") {
|
|
36057
36158
|
return _SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
|
|
36058
36159
|
}
|
|
36059
36160
|
/**
|
|
@@ -36447,7 +36548,7 @@ prepareCommentsXmlFilesForExport_fn = function({ defs, exportType, commentsWithP
|
|
|
36447
36548
|
};
|
|
36448
36549
|
exportProcessHeadersFooters_fn = function({ isFinalDoc = false }) {
|
|
36449
36550
|
const relsData = this.convertedXml["word/_rels/document.xml.rels"];
|
|
36450
|
-
const relationships = relsData.elements.find((
|
|
36551
|
+
const relationships = relsData.elements.find((x2) => x2.name === "Relationships");
|
|
36451
36552
|
const newDocRels = [];
|
|
36452
36553
|
Object.entries(this.headers).forEach(([id, header], index2) => {
|
|
36453
36554
|
const fileName = relationships.elements.find((el) => el.attributes.Id === id)?.attributes.Target || `header${index2 + 1}.xml`;
|
|
@@ -36488,7 +36589,7 @@ exportProcessHeadersFooters_fn = function({ isFinalDoc = false }) {
|
|
|
36488
36589
|
}
|
|
36489
36590
|
this.convertedXml[`word/${fileName}`].elements[0].elements = bodyContent;
|
|
36490
36591
|
if (params.relationships.length) {
|
|
36491
|
-
const relationships2 = this.convertedXml[`word/_rels/${fileName}.rels`]?.elements?.find((
|
|
36592
|
+
const relationships2 = this.convertedXml[`word/_rels/${fileName}.rels`]?.elements?.find((x2) => x2.name === "Relationships")?.elements || [];
|
|
36492
36593
|
this.convertedXml[`word/_rels/${fileName}.rels`] = {
|
|
36493
36594
|
declaration: this.initialJSON?.declaration,
|
|
36494
36595
|
elements: [
|
|
@@ -36542,7 +36643,7 @@ exportProcessHeadersFooters_fn = function({ isFinalDoc = false }) {
|
|
|
36542
36643
|
}
|
|
36543
36644
|
this.convertedXml[`word/${fileName}`].elements[0].elements = bodyContent;
|
|
36544
36645
|
if (params.relationships.length) {
|
|
36545
|
-
const relationships2 = this.convertedXml[`word/_rels/${fileName}.rels`]?.elements?.find((
|
|
36646
|
+
const relationships2 = this.convertedXml[`word/_rels/${fileName}.rels`]?.elements?.find((x2) => x2.name === "Relationships")?.elements || [];
|
|
36546
36647
|
this.convertedXml[`word/_rels/${fileName}.rels`] = {
|
|
36547
36648
|
declaration: this.initialJSON?.declaration,
|
|
36548
36649
|
elements: [
|
|
@@ -36561,7 +36662,7 @@ exportProcessHeadersFooters_fn = function({ isFinalDoc = false }) {
|
|
|
36561
36662
|
};
|
|
36562
36663
|
exportProcessNewRelationships_fn = function(rels = []) {
|
|
36563
36664
|
const relsData = this.convertedXml["word/_rels/document.xml.rels"];
|
|
36564
|
-
const relationships = relsData.elements.find((
|
|
36665
|
+
const relationships = relsData.elements.find((x2) => x2.name === "Relationships");
|
|
36565
36666
|
relationships.elements = mergeRelationshipElements(relationships.elements, rels);
|
|
36566
36667
|
};
|
|
36567
36668
|
exportProcessMediaFiles_fn = async function(media = {}) {
|