@harbour-enterprises/superdoc 0.12.36 → 0.12.37-next.1
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/{eventemitter3-Dq2TEegt.es.js → eventemitter3-BrspJk8q.es.js} +1 -1
- package/dist/chunks/{eventemitter3-DuScojUH.cjs → eventemitter3-DfVviFzP.cjs} +1 -1
- package/dist/chunks/{index-CMBtuT02.cjs → index-B4J7wgs6.cjs} +2 -2
- package/dist/chunks/{index-B1MhwjTC.cjs → index-Cdsq63Xq.cjs} +4 -4
- package/dist/chunks/{index-SKpROzLW.es.js → index-Diu6UKHt.es.js} +4 -4
- package/dist/chunks/{index-BrSjd1Id.es.js → index-Hr3Um-Bg.es.js} +2 -2
- package/dist/chunks/{jszip-Bwu_om3F.cjs → jszip-BTAcmbVg.cjs} +1 -1
- package/dist/chunks/{jszip-BmWWPxfF.es.js → jszip-DckFs3A7.es.js} +1 -1
- package/dist/chunks/{super-editor.es-BtKVLpiq.es.js → super-editor.es-DYzhjqc5.es.js} +1767 -278
- package/dist/chunks/{super-editor.es-akFFn4Ld.cjs → super-editor.es-DmBtUqwe.cjs} +1767 -278
- package/dist/chunks/{url-DuggQ5JR.cjs → url-BIzg4y2i.cjs} +2 -2
- package/dist/chunks/{url-CAZQTNP3.es.js → url-CHayXMZH.es.js} +2 -2
- package/dist/chunks/{vue-IIIZMHTg.es.js → vue-Bi1uWinj.es.js} +17 -11
- package/dist/chunks/{vue-DPZkajuO.cjs → vue-HIY1g7dm.cjs} +17 -11
- package/dist/chunks/{xml-js-B7Vccv2s.cjs → xml-js-BjqmFOSP.cjs} +2 -2
- package/dist/chunks/{xml-js-BV-kCPOA.es.js → xml-js-CfClL-1b.es.js} +2 -2
- package/dist/core/SuperDoc.d.ts +0 -6
- package/dist/core/SuperDoc.d.ts.map +1 -1
- package/dist/core/collaboration/collaboration.d.ts +0 -9
- package/dist/core/collaboration/collaboration.d.ts.map +1 -1
- package/dist/core/collaboration/helpers.d.ts.map +1 -1
- package/dist/style.css +36 -7
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-BSl_E2ED.js → converter-ffnCghzo.js} +109 -10
- package/dist/super-editor/chunks/{docx-zipper-USmuqzmo.js → docx-zipper-BvIz98Bh.js} +1 -1
- package/dist/super-editor/chunks/{editor-C0hNf44Q.js → editor-BCC23g3q.js} +1687 -297
- package/dist/super-editor/chunks/{toolbar-IN0IJC2L.js → toolbar-BZxPbO0T.js} +2 -2
- package/dist/super-editor/components/pagination-helpers.d.ts.map +1 -1
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/core/Attribute.d.ts +2 -2
- package/dist/super-editor/core/Editor.d.ts.map +1 -1
- package/dist/super-editor/core/InputRule.d.ts +7 -0
- package/dist/super-editor/core/InputRule.d.ts.map +1 -1
- package/dist/super-editor/core/Schema.d.ts +2 -2
- package/dist/super-editor/core/helpers/findWordBounds.d.ts +5 -0
- package/dist/super-editor/core/helpers/findWordBounds.d.ts.map +1 -0
- package/dist/super-editor/core/helpers/setWordSelection.d.ts +2 -0
- package/dist/super-editor/core/helpers/setWordSelection.d.ts.map +1 -0
- package/dist/super-editor/core/inputRules/docx-paste/docx-paste.d.ts.map +1 -1
- package/dist/super-editor/core/super-converter/exporter.d.ts.map +1 -1
- package/dist/super-editor/core/super-converter/v2/importer/autoPageNumberImporter.d.ts.map +1 -1
- package/dist/super-editor/core/super-converter/v2/importer/listImporter.d.ts.map +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/extensions/field-annotation/FieldAnnotationView.d.ts.map +1 -1
- package/dist/super-editor/extensions/field-annotation/field-annotation.d.ts.map +1 -1
- package/dist/super-editor/extensions/page-number/page-number.d.ts +10 -0
- package/dist/super-editor/extensions/page-number/page-number.d.ts.map +1 -1
- package/dist/super-editor/extensions/pagination/pagination-helpers.d.ts +2 -1
- package/dist/super-editor/extensions/pagination/pagination-helpers.d.ts.map +1 -1
- package/dist/super-editor/extensions/pagination/pagination.d.ts.map +1 -1
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/style.css +36 -7
- package/dist/super-editor/super-editor.es.js +7 -7
- 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 +1587 -366
- package/dist/superdoc.es.js +1572 -367
- package/dist/superdoc.umd.js +3325 -630
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +3 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const Y = require("yjs");
|
|
3
|
-
const vue = require("./vue-
|
|
3
|
+
const vue = require("./vue-HIY1g7dm.cjs");
|
|
4
4
|
function _interopNamespaceDefault(e) {
|
|
5
5
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
6
6
|
if (e) {
|
|
@@ -2573,29 +2573,29 @@ function requireAbs() {
|
|
|
2573
2573
|
abs$1 = Math.abs;
|
|
2574
2574
|
return abs$1;
|
|
2575
2575
|
}
|
|
2576
|
-
var floor$
|
|
2576
|
+
var floor$2;
|
|
2577
2577
|
var hasRequiredFloor;
|
|
2578
2578
|
function requireFloor() {
|
|
2579
|
-
if (hasRequiredFloor) return floor$
|
|
2579
|
+
if (hasRequiredFloor) return floor$2;
|
|
2580
2580
|
hasRequiredFloor = 1;
|
|
2581
|
-
floor$
|
|
2582
|
-
return floor$
|
|
2581
|
+
floor$2 = Math.floor;
|
|
2582
|
+
return floor$2;
|
|
2583
2583
|
}
|
|
2584
|
-
var max$
|
|
2584
|
+
var max$3;
|
|
2585
2585
|
var hasRequiredMax;
|
|
2586
2586
|
function requireMax() {
|
|
2587
|
-
if (hasRequiredMax) return max$
|
|
2587
|
+
if (hasRequiredMax) return max$3;
|
|
2588
2588
|
hasRequiredMax = 1;
|
|
2589
|
-
max$
|
|
2590
|
-
return max$
|
|
2589
|
+
max$3 = Math.max;
|
|
2590
|
+
return max$3;
|
|
2591
2591
|
}
|
|
2592
|
-
var min$
|
|
2592
|
+
var min$3;
|
|
2593
2593
|
var hasRequiredMin;
|
|
2594
2594
|
function requireMin() {
|
|
2595
|
-
if (hasRequiredMin) return min$
|
|
2595
|
+
if (hasRequiredMin) return min$3;
|
|
2596
2596
|
hasRequiredMin = 1;
|
|
2597
|
-
min$
|
|
2598
|
-
return min$
|
|
2597
|
+
min$3 = Math.min;
|
|
2598
|
+
return min$3;
|
|
2599
2599
|
}
|
|
2600
2600
|
var pow;
|
|
2601
2601
|
var hasRequiredPow;
|
|
@@ -2605,13 +2605,13 @@ function requirePow() {
|
|
|
2605
2605
|
pow = Math.pow;
|
|
2606
2606
|
return pow;
|
|
2607
2607
|
}
|
|
2608
|
-
var round$
|
|
2608
|
+
var round$2;
|
|
2609
2609
|
var hasRequiredRound;
|
|
2610
2610
|
function requireRound() {
|
|
2611
|
-
if (hasRequiredRound) return round$
|
|
2611
|
+
if (hasRequiredRound) return round$2;
|
|
2612
2612
|
hasRequiredRound = 1;
|
|
2613
|
-
round$
|
|
2614
|
-
return round$
|
|
2613
|
+
round$2 = Math.round;
|
|
2614
|
+
return round$2;
|
|
2615
2615
|
}
|
|
2616
2616
|
var _isNaN;
|
|
2617
2617
|
var hasRequired_isNaN;
|
|
@@ -12436,7 +12436,7 @@ const OPT_PRESERVE_WS = 1, OPT_PRESERVE_WS_FULL = 2, OPT_OPEN_LEFT = 4;
|
|
|
12436
12436
|
function wsOptionsFor(type2, preserveWhitespace, base2) {
|
|
12437
12437
|
if (preserveWhitespace != null)
|
|
12438
12438
|
return (preserveWhitespace ? OPT_PRESERVE_WS : 0) | (preserveWhitespace === "full" ? OPT_PRESERVE_WS_FULL : 0);
|
|
12439
|
-
return type2 && type2.whitespace == "pre" ? OPT_PRESERVE_WS | OPT_PRESERVE_WS_FULL : base2 &
|
|
12439
|
+
return type2 && type2.whitespace == "pre" ? OPT_PRESERVE_WS | OPT_PRESERVE_WS_FULL : base2 & ~OPT_OPEN_LEFT;
|
|
12440
12440
|
}
|
|
12441
12441
|
class NodeContext {
|
|
12442
12442
|
constructor(type2, attrs, marks, solid, match, options2) {
|
|
@@ -15407,7 +15407,7 @@ class Transaction extends Transform {
|
|
|
15407
15407
|
throw new RangeError("Selection passed to setSelection must point at the current document");
|
|
15408
15408
|
this.curSelection = selection;
|
|
15409
15409
|
this.curSelectionFor = this.steps.length;
|
|
15410
|
-
this.updated = (this.updated | UPDATED_SEL) &
|
|
15410
|
+
this.updated = (this.updated | UPDATED_SEL) & ~UPDATED_MARKS;
|
|
15411
15411
|
this.storedMarks = null;
|
|
15412
15412
|
return this;
|
|
15413
15413
|
}
|
|
@@ -15458,7 +15458,7 @@ class Transaction extends Transform {
|
|
|
15458
15458
|
*/
|
|
15459
15459
|
addStep(step, doc2) {
|
|
15460
15460
|
super.addStep(step, doc2);
|
|
15461
|
-
this.updated = this.updated &
|
|
15461
|
+
this.updated = this.updated & ~UPDATED_MARKS;
|
|
15462
15462
|
this.storedMarks = null;
|
|
15463
15463
|
}
|
|
15464
15464
|
/**
|
|
@@ -18862,7 +18862,9 @@ function exportSchemaToJson(params2) {
|
|
|
18862
18862
|
shapeContainer: translateShapeContainer,
|
|
18863
18863
|
shapeTextbox: translateShapeTextbox,
|
|
18864
18864
|
contentBlock: translateContentBlock,
|
|
18865
|
-
structuredContent: translateStructuredContent
|
|
18865
|
+
structuredContent: translateStructuredContent,
|
|
18866
|
+
"page-number": translatePageNumberNode,
|
|
18867
|
+
"total-page-number": translateTotalPageNumberNode
|
|
18866
18868
|
};
|
|
18867
18869
|
if (!router[type2]) {
|
|
18868
18870
|
console.error("No translation function found for node type:", type2);
|
|
@@ -20559,6 +20561,81 @@ function translateStructuredContent(params2) {
|
|
|
20559
20561
|
elements: nodeElements
|
|
20560
20562
|
};
|
|
20561
20563
|
}
|
|
20564
|
+
const translatePageNumberNode = (params2) => {
|
|
20565
|
+
const outputMarks = processOutputMarks(params2.node.attrs?.marksAsAttrs || []);
|
|
20566
|
+
return getAutoPageJson("PAGE", outputMarks);
|
|
20567
|
+
};
|
|
20568
|
+
const translateTotalPageNumberNode = (params2) => {
|
|
20569
|
+
const outputMarks = processOutputMarks(params2.node.attrs?.marksAsAttrs || []);
|
|
20570
|
+
return getAutoPageJson("NUMPAGES", outputMarks);
|
|
20571
|
+
};
|
|
20572
|
+
const getAutoPageJson = (type2, outputMarks = []) => {
|
|
20573
|
+
return [
|
|
20574
|
+
{
|
|
20575
|
+
"name": "w:r",
|
|
20576
|
+
"elements": [
|
|
20577
|
+
{
|
|
20578
|
+
"name": "w:rPr",
|
|
20579
|
+
"elements": outputMarks
|
|
20580
|
+
},
|
|
20581
|
+
{
|
|
20582
|
+
"name": "w:fldChar",
|
|
20583
|
+
"attributes": {
|
|
20584
|
+
"w:fldCharType": "begin"
|
|
20585
|
+
}
|
|
20586
|
+
}
|
|
20587
|
+
]
|
|
20588
|
+
},
|
|
20589
|
+
{
|
|
20590
|
+
"name": "w:r",
|
|
20591
|
+
"elements": [
|
|
20592
|
+
{
|
|
20593
|
+
"name": "w:rPr",
|
|
20594
|
+
"elements": outputMarks
|
|
20595
|
+
},
|
|
20596
|
+
{
|
|
20597
|
+
"name": "w:instrText",
|
|
20598
|
+
"elements": [
|
|
20599
|
+
{
|
|
20600
|
+
"type": "text",
|
|
20601
|
+
"text": ` ${type2}`
|
|
20602
|
+
}
|
|
20603
|
+
]
|
|
20604
|
+
}
|
|
20605
|
+
]
|
|
20606
|
+
},
|
|
20607
|
+
{
|
|
20608
|
+
"name": "w:r",
|
|
20609
|
+
"elements": [
|
|
20610
|
+
{
|
|
20611
|
+
"name": "w:rPr",
|
|
20612
|
+
"elements": outputMarks
|
|
20613
|
+
},
|
|
20614
|
+
{
|
|
20615
|
+
"name": "w:fldChar",
|
|
20616
|
+
"attributes": {
|
|
20617
|
+
"w:fldCharType": "separate"
|
|
20618
|
+
}
|
|
20619
|
+
}
|
|
20620
|
+
]
|
|
20621
|
+
},
|
|
20622
|
+
{
|
|
20623
|
+
"name": "w:r",
|
|
20624
|
+
"elements": [
|
|
20625
|
+
{
|
|
20626
|
+
"name": "w:rPr",
|
|
20627
|
+
"elements": outputMarks
|
|
20628
|
+
},
|
|
20629
|
+
{
|
|
20630
|
+
"name": "w:fldChar",
|
|
20631
|
+
"attributes": {
|
|
20632
|
+
"w:fldCharType": "end"
|
|
20633
|
+
}
|
|
20634
|
+
}
|
|
20635
|
+
]
|
|
20636
|
+
}
|
|
20637
|
+
];
|
|
20638
|
+
};
|
|
20562
20639
|
const defaultInitialXml = `<w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex" xmlns:cx1="http://schemas.microsoft.com/office/drawing/2015/9/8/chartex" xmlns:cx2="http://schemas.microsoft.com/office/drawing/2015/10/21/chartex" xmlns:cx3="http://schemas.microsoft.com/office/drawing/2016/5/9/chartex" xmlns:cx4="http://schemas.microsoft.com/office/drawing/2016/5/10/chartex" xmlns:cx5="http://schemas.microsoft.com/office/drawing/2016/5/11/chartex" xmlns:cx6="http://schemas.microsoft.com/office/drawing/2016/5/12/chartex" xmlns:cx7="http://schemas.microsoft.com/office/drawing/2016/5/13/chartex" xmlns:cx8="http://schemas.microsoft.com/office/drawing/2016/5/14/chartex" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:aink="http://schemas.microsoft.com/office/drawing/2016/ink" xmlns:am3d="http://schemas.microsoft.com/office/drawing/2017/model3d" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:oel="http://schemas.microsoft.com/office/2019/extlst" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:w16cex="http://schemas.microsoft.com/office/word/2018/wordml/cex" xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid" xmlns:w16="http://schemas.microsoft.com/office/word/2018/wordml" xmlns:w16sdtdh="http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash" xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" mc:Ignorable="w14 w15 w16se w16cid w16 w16cex w16sdtdh wp14"><w:body></w:body></w:document>`;
|
|
20563
20640
|
const parseXmlToJson = (xml) => {
|
|
20564
20641
|
return JSON.parse(xmljs.xml2json(xml, null, 2));
|
|
@@ -21457,6 +21534,8 @@ const handleListNode = (params2) => {
|
|
|
21457
21534
|
listItems.push(possibleList);
|
|
21458
21535
|
possibleList = siblings.shift();
|
|
21459
21536
|
if (possibleList?.elements && !hasTextNode(possibleList.elements)) {
|
|
21537
|
+
const { name } = possibleList;
|
|
21538
|
+
if (name === "w:tbl") continue;
|
|
21460
21539
|
listItems.push(possibleList);
|
|
21461
21540
|
possibleList = siblings.shift();
|
|
21462
21541
|
}
|
|
@@ -22267,15 +22346,25 @@ const processCombinedNodesForFldChar = (nodesToCombine = []) => {
|
|
|
22267
22346
|
if (!isNumPages) isNumPages = instrText?.trim().startsWith("NUMPAGES");
|
|
22268
22347
|
const urlMatch = instrText?.match(/HYPERLINK\s+"([^"]+)"/);
|
|
22269
22348
|
if (hasPageMarker) {
|
|
22270
|
-
|
|
22349
|
+
const pageNumNode = {
|
|
22271
22350
|
name: "sd:autoPageNumber",
|
|
22272
22351
|
type: "element"
|
|
22352
|
+
};
|
|
22353
|
+
nodesToCombine.forEach((n) => {
|
|
22354
|
+
const rPrNode = n.elements.find((el) => el.name === "w:rPr");
|
|
22355
|
+
if (rPrNode) pageNumNode.elements = [rPrNode];
|
|
22273
22356
|
});
|
|
22357
|
+
processedNodes.push(pageNumNode);
|
|
22274
22358
|
} else if (isNumPages) {
|
|
22275
|
-
|
|
22359
|
+
const totalPageNumNode = {
|
|
22276
22360
|
name: "sd:totalPageNumber",
|
|
22277
22361
|
type: "element"
|
|
22362
|
+
};
|
|
22363
|
+
nodesToCombine.forEach((n) => {
|
|
22364
|
+
const rPrNode = n.elements.find((el) => el.name === "w:rPr");
|
|
22365
|
+
if (rPrNode) totalPageNumNode.elements = [rPrNode];
|
|
22278
22366
|
});
|
|
22367
|
+
processedNodes.push(totalPageNumNode);
|
|
22279
22368
|
} else if (urlMatch && urlMatch?.length >= 2) {
|
|
22280
22369
|
const url = urlMatch[1];
|
|
22281
22370
|
const textMarks = [];
|
|
@@ -22611,8 +22700,13 @@ const handleAutoPageNumber = (params2) => {
|
|
|
22611
22700
|
if (nodes.length === 0 || nodes[0].name !== "sd:autoPageNumber") {
|
|
22612
22701
|
return { nodes: [], consumed: 0 };
|
|
22613
22702
|
}
|
|
22703
|
+
const rPr = nodes[0].elements?.find((el) => el.name === "w:rPr");
|
|
22704
|
+
const marks = parseMarks(rPr || { elements: [] });
|
|
22614
22705
|
const processedNode = {
|
|
22615
|
-
type: "page-number"
|
|
22706
|
+
type: "page-number",
|
|
22707
|
+
attrs: {
|
|
22708
|
+
marksAsAttrs: marks
|
|
22709
|
+
}
|
|
22616
22710
|
};
|
|
22617
22711
|
return { nodes: [processedNode], consumed: 1 };
|
|
22618
22712
|
};
|
|
@@ -22625,8 +22719,13 @@ const handleAutoTotalPageNumber = (params2) => {
|
|
|
22625
22719
|
if (nodes.length === 0 || nodes[0].name !== "sd:totalPageNumber") {
|
|
22626
22720
|
return { nodes: [], consumed: 0 };
|
|
22627
22721
|
}
|
|
22722
|
+
const rPr = nodes[0].elements?.find((el) => el.name === "w:rPr");
|
|
22723
|
+
const marks = parseMarks(rPr || { elements: [] });
|
|
22628
22724
|
const processedNode = {
|
|
22629
|
-
type: "total-page-number"
|
|
22725
|
+
type: "total-page-number",
|
|
22726
|
+
attrs: {
|
|
22727
|
+
marksAsAttrs: marks
|
|
22728
|
+
}
|
|
22630
22729
|
};
|
|
22631
22730
|
return { nodes: [processedNode], consumed: 1 };
|
|
22632
22731
|
};
|
|
@@ -23311,7 +23410,7 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
23311
23410
|
return;
|
|
23312
23411
|
}
|
|
23313
23412
|
}
|
|
23314
|
-
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.12.
|
|
23413
|
+
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.12.37-next.1") {
|
|
23315
23414
|
const customLocation = "docProps/custom.xml";
|
|
23316
23415
|
if (!docx[customLocation]) {
|
|
23317
23416
|
docx[customLocation] = generateCustomXml();
|
|
@@ -23778,7 +23877,7 @@ function storeSuperdocVersion(docx) {
|
|
|
23778
23877
|
function generateCustomXml() {
|
|
23779
23878
|
return DEFAULT_CUSTOM_XML;
|
|
23780
23879
|
}
|
|
23781
|
-
function generateSuperdocVersion(pid = 2, version2 = "0.12.
|
|
23880
|
+
function generateSuperdocVersion(pid = 2, version2 = "0.12.37-next.1") {
|
|
23782
23881
|
return {
|
|
23783
23882
|
type: "element",
|
|
23784
23883
|
name: "property",
|
|
@@ -26311,7 +26410,7 @@ var __privateGet$1 = (obj, member, getter) => (__accessCheck$1(obj, member, "rea
|
|
|
26311
26410
|
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);
|
|
26312
26411
|
var __privateSet = (obj, member, value, setter) => (__accessCheck$1(obj, member, "write to private field"), member.set(obj, value), value);
|
|
26313
26412
|
var __privateMethod$1 = (obj, member, method) => (__accessCheck$1(obj, member, "access private method"), method);
|
|
26314
|
-
var _Attribute_static, getGlobalAttributes_fn, getNodeAndMarksAttributes_fn, _Schema_static, createNodesSchema_fn, createMarksSchema_fn, _events, _ExtensionService_instances, setupExtensions_fn, attachEditorEvents_fn, _commandService, _css, _Editor_instances, initContainerElement_fn, init_fn, initRichText_fn, onFocus_fn, checkHeadless_fn, insertNewFileData_fn, registerPluginByNameIfNotExists_fn, createExtensionService_fn, createCommandService_fn, createConverter_fn, initMedia_fn, initFonts_fn, createSchema_fn, generatePmData_fn, createDocFromHTML_fn, createView_fn, onCollaborationReady_fn, initComments_fn, initPagination_fn, dispatchTransaction_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, _FieldAnnotationView_instances, createAnnotation_fn;
|
|
26413
|
+
var _Attribute_static, getGlobalAttributes_fn, getNodeAndMarksAttributes_fn, _Schema_static, createNodesSchema_fn, createMarksSchema_fn, _events, _ExtensionService_instances, setupExtensions_fn, attachEditorEvents_fn, _commandService, _css, _Editor_instances, initContainerElement_fn, init_fn, initRichText_fn, onFocus_fn, checkHeadless_fn, insertNewFileData_fn, registerPluginByNameIfNotExists_fn, createExtensionService_fn, createCommandService_fn, createConverter_fn, initMedia_fn, initFonts_fn, createSchema_fn, generatePmData_fn, createDocFromHTML_fn, createView_fn, onCollaborationReady_fn, initComments_fn, initPagination_fn, dispatchTransaction_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn;
|
|
26315
26414
|
function getMarksFromSelection(state2) {
|
|
26316
26415
|
const { from: from2, to, empty: empty2 } = state2.selection;
|
|
26317
26416
|
const marks = [];
|
|
@@ -30578,6 +30677,7 @@ const isEquivalentPosition = function(node2, off2, targetNode, targetOff) {
|
|
|
30578
30677
|
};
|
|
30579
30678
|
const atomElements = /^(img|br|input|textarea|hr)$/i;
|
|
30580
30679
|
function scanFor(node2, off2, targetNode, targetOff, dir) {
|
|
30680
|
+
var _a;
|
|
30581
30681
|
for (; ; ) {
|
|
30582
30682
|
if (node2 == targetNode && off2 == targetOff)
|
|
30583
30683
|
return true;
|
|
@@ -30588,10 +30688,16 @@ function scanFor(node2, off2, targetNode, targetOff, dir) {
|
|
|
30588
30688
|
off2 = domIndex(node2) + (dir < 0 ? 0 : 1);
|
|
30589
30689
|
node2 = parent;
|
|
30590
30690
|
} else if (node2.nodeType == 1) {
|
|
30591
|
-
|
|
30592
|
-
if (
|
|
30593
|
-
|
|
30594
|
-
|
|
30691
|
+
let child = node2.childNodes[off2 + (dir < 0 ? -1 : 0)];
|
|
30692
|
+
if (child.nodeType == 1 && child.contentEditable == "false") {
|
|
30693
|
+
if ((_a = child.pmViewDesc) === null || _a === void 0 ? void 0 : _a.ignoreForSelection)
|
|
30694
|
+
off2 += dir;
|
|
30695
|
+
else
|
|
30696
|
+
return false;
|
|
30697
|
+
} else {
|
|
30698
|
+
node2 = child;
|
|
30699
|
+
off2 = dir < 0 ? nodeSize(node2) : 0;
|
|
30700
|
+
}
|
|
30595
30701
|
} else {
|
|
30596
30702
|
return false;
|
|
30597
30703
|
}
|
|
@@ -30720,7 +30826,7 @@ function windowRect(doc2) {
|
|
|
30720
30826
|
bottom: doc2.documentElement.clientHeight
|
|
30721
30827
|
};
|
|
30722
30828
|
}
|
|
30723
|
-
function getSide(value, side) {
|
|
30829
|
+
function getSide$1(value, side) {
|
|
30724
30830
|
return typeof value == "number" ? value : value[side];
|
|
30725
30831
|
}
|
|
30726
30832
|
function clientRect(node2) {
|
|
@@ -30748,14 +30854,14 @@ function scrollRectIntoView(view, rect, startDOM) {
|
|
|
30748
30854
|
let atTop = elt == doc2.body;
|
|
30749
30855
|
let bounding = atTop ? windowRect(doc2) : clientRect(elt);
|
|
30750
30856
|
let moveX = 0, moveY = 0;
|
|
30751
|
-
if (rect.top < bounding.top + getSide(scrollThreshold, "top"))
|
|
30752
|
-
moveY = -(bounding.top - rect.top + getSide(scrollMargin, "top"));
|
|
30753
|
-
else if (rect.bottom > bounding.bottom - getSide(scrollThreshold, "bottom"))
|
|
30754
|
-
moveY = rect.bottom - rect.top > bounding.bottom - bounding.top ? rect.top + getSide(scrollMargin, "top") - bounding.top : rect.bottom - bounding.bottom + getSide(scrollMargin, "bottom");
|
|
30755
|
-
if (rect.left < bounding.left + getSide(scrollThreshold, "left"))
|
|
30756
|
-
moveX = -(bounding.left - rect.left + getSide(scrollMargin, "left"));
|
|
30757
|
-
else if (rect.right > bounding.right - getSide(scrollThreshold, "right"))
|
|
30758
|
-
moveX = rect.right - bounding.right + getSide(scrollMargin, "right");
|
|
30857
|
+
if (rect.top < bounding.top + getSide$1(scrollThreshold, "top"))
|
|
30858
|
+
moveY = -(bounding.top - rect.top + getSide$1(scrollMargin, "top"));
|
|
30859
|
+
else if (rect.bottom > bounding.bottom - getSide$1(scrollThreshold, "bottom"))
|
|
30860
|
+
moveY = rect.bottom - rect.top > bounding.bottom - bounding.top ? rect.top + getSide$1(scrollMargin, "top") - bounding.top : rect.bottom - bounding.bottom + getSide$1(scrollMargin, "bottom");
|
|
30861
|
+
if (rect.left < bounding.left + getSide$1(scrollThreshold, "left"))
|
|
30862
|
+
moveX = -(bounding.left - rect.left + getSide$1(scrollMargin, "left"));
|
|
30863
|
+
else if (rect.right > bounding.right - getSide$1(scrollThreshold, "right"))
|
|
30864
|
+
moveX = rect.right - bounding.right + getSide$1(scrollMargin, "right");
|
|
30759
30865
|
if (moveX || moveY) {
|
|
30760
30866
|
if (atTop) {
|
|
30761
30867
|
doc2.defaultView.scrollBy(moveX, moveY);
|
|
@@ -31550,6 +31656,9 @@ class ViewDesc {
|
|
|
31550
31656
|
get ignoreForCoords() {
|
|
31551
31657
|
return false;
|
|
31552
31658
|
}
|
|
31659
|
+
get ignoreForSelection() {
|
|
31660
|
+
return false;
|
|
31661
|
+
}
|
|
31553
31662
|
isText(text) {
|
|
31554
31663
|
return false;
|
|
31555
31664
|
}
|
|
@@ -31598,6 +31707,9 @@ class WidgetViewDesc extends ViewDesc {
|
|
|
31598
31707
|
get domAtom() {
|
|
31599
31708
|
return true;
|
|
31600
31709
|
}
|
|
31710
|
+
get ignoreForSelection() {
|
|
31711
|
+
return !!this.widget.type.spec.relaxedSide;
|
|
31712
|
+
}
|
|
31601
31713
|
get side() {
|
|
31602
31714
|
return this.widget.type.side;
|
|
31603
31715
|
}
|
|
@@ -33378,8 +33490,9 @@ editHandlers.keypress = (view, _event) => {
|
|
|
33378
33490
|
let sel = view.state.selection;
|
|
33379
33491
|
if (!(sel instanceof TextSelection) || !sel.$from.sameParent(sel.$to)) {
|
|
33380
33492
|
let text = String.fromCharCode(event.charCode);
|
|
33381
|
-
|
|
33382
|
-
|
|
33493
|
+
let deflt = () => view.state.tr.insertText(text).scrollIntoView();
|
|
33494
|
+
if (!/[\r\n]/.test(text) && !view.someProp("handleTextInput", (f) => f(view, sel.$from.pos, sel.$to.pos, text, deflt)))
|
|
33495
|
+
view.dispatch(deflt());
|
|
33383
33496
|
event.preventDefault();
|
|
33384
33497
|
}
|
|
33385
33498
|
};
|
|
@@ -34951,14 +35064,14 @@ function readDOMChange(view, from2, to, typeOver, addedNodes) {
|
|
|
34951
35064
|
if (newSel && !view.state.selection.eq(newSel)) {
|
|
34952
35065
|
if (chrome && android && view.input.lastKeyCode === 13 && Date.now() - 100 < view.input.lastKeyCodeTime && view.someProp("handleKeyDown", (f) => f(view, keyEvent(13, "Enter"))))
|
|
34953
35066
|
return;
|
|
34954
|
-
let
|
|
35067
|
+
let tr = view.state.tr.setSelection(newSel);
|
|
34955
35068
|
if (origin == "pointer")
|
|
34956
|
-
|
|
35069
|
+
tr.setMeta("pointer", true);
|
|
34957
35070
|
else if (origin == "key")
|
|
34958
|
-
|
|
35071
|
+
tr.scrollIntoView();
|
|
34959
35072
|
if (compositionID)
|
|
34960
|
-
|
|
34961
|
-
view.dispatch(
|
|
35073
|
+
tr.setMeta("composition", compositionID);
|
|
35074
|
+
view.dispatch(tr);
|
|
34962
35075
|
}
|
|
34963
35076
|
return;
|
|
34964
35077
|
}
|
|
@@ -34992,10 +35105,10 @@ function readDOMChange(view, from2, to, typeOver, addedNodes) {
|
|
|
34992
35105
|
if (parse.sel) {
|
|
34993
35106
|
let sel2 = resolveSelection(view, view.state.doc, parse.sel);
|
|
34994
35107
|
if (sel2 && !sel2.eq(view.state.selection)) {
|
|
34995
|
-
let
|
|
35108
|
+
let tr = view.state.tr.setSelection(sel2);
|
|
34996
35109
|
if (compositionID)
|
|
34997
|
-
|
|
34998
|
-
view.dispatch(
|
|
35110
|
+
tr.setMeta("composition", compositionID);
|
|
35111
|
+
view.dispatch(tr);
|
|
34999
35112
|
}
|
|
35000
35113
|
}
|
|
35001
35114
|
return;
|
|
@@ -35040,43 +35153,48 @@ function readDOMChange(view, from2, to, typeOver, addedNodes) {
|
|
|
35040
35153
|
}, 20);
|
|
35041
35154
|
}
|
|
35042
35155
|
let chFrom = change.start, chTo = change.endA;
|
|
35043
|
-
let
|
|
35156
|
+
let mkTr = (base2) => {
|
|
35157
|
+
let tr = base2 || view.state.tr.replace(chFrom, chTo, parse.doc.slice(change.start - parse.from, change.endB - parse.from));
|
|
35158
|
+
if (parse.sel) {
|
|
35159
|
+
let sel2 = resolveSelection(view, tr.doc, parse.sel);
|
|
35160
|
+
if (sel2 && !(chrome && view.composing && sel2.empty && (change.start != change.endB || view.input.lastChromeDelete < Date.now() - 100) && (sel2.head == chFrom || sel2.head == tr.mapping.map(chTo) - 1) || ie$1 && sel2.empty && sel2.head == chFrom))
|
|
35161
|
+
tr.setSelection(sel2);
|
|
35162
|
+
}
|
|
35163
|
+
if (compositionID)
|
|
35164
|
+
tr.setMeta("composition", compositionID);
|
|
35165
|
+
return tr.scrollIntoView();
|
|
35166
|
+
};
|
|
35167
|
+
let markChange;
|
|
35044
35168
|
if (inlineChange) {
|
|
35045
35169
|
if ($from.pos == $to.pos) {
|
|
35046
35170
|
if (ie$1 && ie_version <= 11 && $from.parentOffset == 0) {
|
|
35047
35171
|
view.domObserver.suppressSelectionUpdates();
|
|
35048
35172
|
setTimeout(() => selectionToDOM(view), 20);
|
|
35049
35173
|
}
|
|
35050
|
-
tr = view.state.tr.delete(chFrom, chTo);
|
|
35051
|
-
|
|
35174
|
+
let tr = mkTr(view.state.tr.delete(chFrom, chTo));
|
|
35175
|
+
let marks = doc2.resolve(change.start).marksAcross(doc2.resolve(change.endA));
|
|
35176
|
+
if (marks)
|
|
35177
|
+
tr.ensureMarks(marks);
|
|
35178
|
+
view.dispatch(tr);
|
|
35052
35179
|
} else if (
|
|
35053
35180
|
// Adding or removing a mark
|
|
35054
35181
|
change.endA == change.endB && (markChange = isMarkChange($from.parent.content.cut($from.parentOffset, $to.parentOffset), $fromA.parent.content.cut($fromA.parentOffset, change.endA - $fromA.start())))
|
|
35055
35182
|
) {
|
|
35056
|
-
tr = view.state.tr;
|
|
35183
|
+
let tr = mkTr(view.state.tr);
|
|
35057
35184
|
if (markChange.type == "add")
|
|
35058
35185
|
tr.addMark(chFrom, chTo, markChange.mark);
|
|
35059
35186
|
else
|
|
35060
35187
|
tr.removeMark(chFrom, chTo, markChange.mark);
|
|
35188
|
+
view.dispatch(tr);
|
|
35061
35189
|
} else if ($from.parent.child($from.index()).isText && $from.index() == $to.index() - ($to.textOffset ? 0 : 1)) {
|
|
35062
35190
|
let text = $from.parent.textBetween($from.parentOffset, $to.parentOffset);
|
|
35063
|
-
|
|
35064
|
-
|
|
35065
|
-
|
|
35191
|
+
let deflt = () => mkTr(view.state.tr.insertText(text, chFrom, chTo));
|
|
35192
|
+
if (!view.someProp("handleTextInput", (f) => f(view, chFrom, chTo, text, deflt)))
|
|
35193
|
+
view.dispatch(deflt());
|
|
35066
35194
|
}
|
|
35195
|
+
} else {
|
|
35196
|
+
view.dispatch(mkTr());
|
|
35067
35197
|
}
|
|
35068
|
-
if (!tr)
|
|
35069
|
-
tr = view.state.tr.replace(chFrom, chTo, parse.doc.slice(change.start - parse.from, change.endB - parse.from));
|
|
35070
|
-
if (parse.sel) {
|
|
35071
|
-
let sel2 = resolveSelection(view, tr.doc, parse.sel);
|
|
35072
|
-
if (sel2 && !(chrome && view.composing && sel2.empty && (change.start != change.endB || view.input.lastChromeDelete < Date.now() - 100) && (sel2.head == chFrom || sel2.head == tr.mapping.map(chTo) - 1) || ie$1 && sel2.empty && sel2.head == chFrom))
|
|
35073
|
-
tr.setSelection(sel2);
|
|
35074
|
-
}
|
|
35075
|
-
if (storedMarks)
|
|
35076
|
-
tr.ensureMarks(storedMarks);
|
|
35077
|
-
if (compositionID)
|
|
35078
|
-
tr.setMeta("composition", compositionID);
|
|
35079
|
-
view.dispatch(tr.scrollIntoView());
|
|
35080
35198
|
}
|
|
35081
35199
|
function resolveSelection(view, doc2, parsedSel) {
|
|
35082
35200
|
if (Math.max(parsedSel.anchor, parsedSel.head) > doc2.content.size)
|
|
@@ -35598,22 +35716,6 @@ class EditorView {
|
|
|
35598
35716
|
return dispatchEvent(this, event);
|
|
35599
35717
|
}
|
|
35600
35718
|
/**
|
|
35601
|
-
Dispatch a transaction. Will call
|
|
35602
|
-
[`dispatchTransaction`](https://prosemirror.net/docs/ref/#view.DirectEditorProps.dispatchTransaction)
|
|
35603
|
-
when given, and otherwise defaults to applying the transaction to
|
|
35604
|
-
the current state and calling
|
|
35605
|
-
[`updateState`](https://prosemirror.net/docs/ref/#view.EditorView.updateState) with the result.
|
|
35606
|
-
This method is bound to the view instance, so that it can be
|
|
35607
|
-
easily passed around.
|
|
35608
|
-
*/
|
|
35609
|
-
dispatch(tr) {
|
|
35610
|
-
let dispatchTransaction = this._props.dispatchTransaction;
|
|
35611
|
-
if (dispatchTransaction)
|
|
35612
|
-
dispatchTransaction.call(this, tr);
|
|
35613
|
-
else
|
|
35614
|
-
this.updateState(this.state.apply(tr));
|
|
35615
|
-
}
|
|
35616
|
-
/**
|
|
35617
35719
|
@internal
|
|
35618
35720
|
*/
|
|
35619
35721
|
domSelectionRange() {
|
|
@@ -35629,6 +35731,13 @@ class EditorView {
|
|
|
35629
35731
|
return this.root.getSelection();
|
|
35630
35732
|
}
|
|
35631
35733
|
}
|
|
35734
|
+
EditorView.prototype.dispatch = function(tr) {
|
|
35735
|
+
let dispatchTransaction = this._props.dispatchTransaction;
|
|
35736
|
+
if (dispatchTransaction)
|
|
35737
|
+
dispatchTransaction.call(this, tr);
|
|
35738
|
+
else
|
|
35739
|
+
this.updateState(this.state.apply(tr));
|
|
35740
|
+
};
|
|
35632
35741
|
function computeDocDeco(view) {
|
|
35633
35742
|
let attrs = /* @__PURE__ */ Object.create(null);
|
|
35634
35743
|
attrs.class = "ProseMirror";
|
|
@@ -35694,10 +35803,10 @@ function checkStateComponent(plugin2) {
|
|
|
35694
35803
|
if (plugin2.spec.state || plugin2.spec.filterTransaction || plugin2.spec.appendTransaction)
|
|
35695
35804
|
throw new RangeError("Plugins passed directly to the view must not have a state component");
|
|
35696
35805
|
}
|
|
35697
|
-
const floor = Math.floor;
|
|
35806
|
+
const floor$1 = Math.floor;
|
|
35698
35807
|
const abs = Math.abs;
|
|
35699
|
-
const min$
|
|
35700
|
-
const max$
|
|
35808
|
+
const min$2 = (a, b) => a < b ? a : b;
|
|
35809
|
+
const max$2 = (a, b) => a > b ? a : b;
|
|
35701
35810
|
const isNegativeZero = (n) => n !== 0 ? n < 0 : 1 / n < 0;
|
|
35702
35811
|
const BIT7 = 64;
|
|
35703
35812
|
const BIT8 = 128;
|
|
@@ -35705,7 +35814,7 @@ const BIT30 = 1 << 29;
|
|
|
35705
35814
|
const BITS6 = 63;
|
|
35706
35815
|
const BITS7 = 127;
|
|
35707
35816
|
const BITS31 = 2147483647;
|
|
35708
|
-
const isInteger = Number.isInteger || ((num) => typeof num === "number" && isFinite(num) && floor(num) === num);
|
|
35817
|
+
const isInteger = Number.isInteger || ((num) => typeof num === "number" && isFinite(num) && floor$1(num) === num);
|
|
35709
35818
|
const create$2 = () => /* @__PURE__ */ new Set();
|
|
35710
35819
|
const isArray$1 = Array.isArray;
|
|
35711
35820
|
const fromCharCode = String.fromCharCode;
|
|
@@ -35769,7 +35878,7 @@ const verifyLen = (encoder, len) => {
|
|
|
35769
35878
|
const bufferLen = encoder.cbuf.length;
|
|
35770
35879
|
if (bufferLen - encoder.cpos < len) {
|
|
35771
35880
|
encoder.bufs.push(new Uint8Array(encoder.cbuf.buffer, 0, encoder.cpos));
|
|
35772
|
-
encoder.cbuf = new Uint8Array(max$
|
|
35881
|
+
encoder.cbuf = new Uint8Array(max$2(bufferLen, len) * 2);
|
|
35773
35882
|
encoder.cpos = 0;
|
|
35774
35883
|
}
|
|
35775
35884
|
};
|
|
@@ -35785,7 +35894,7 @@ const write$1 = (encoder, num) => {
|
|
|
35785
35894
|
const writeVarUint = (encoder, num) => {
|
|
35786
35895
|
while (num > BITS7) {
|
|
35787
35896
|
write$1(encoder, BIT8 | BITS7 & num);
|
|
35788
|
-
num = floor(num / 128);
|
|
35897
|
+
num = floor$1(num / 128);
|
|
35789
35898
|
}
|
|
35790
35899
|
write$1(encoder, BITS7 & num);
|
|
35791
35900
|
};
|
|
@@ -35795,10 +35904,10 @@ const writeVarInt = (encoder, num) => {
|
|
|
35795
35904
|
num = -num;
|
|
35796
35905
|
}
|
|
35797
35906
|
write$1(encoder, (num > BITS6 ? BIT8 : 0) | (isNegative ? BIT7 : 0) | BITS6 & num);
|
|
35798
|
-
num = floor(num / 64);
|
|
35907
|
+
num = floor$1(num / 64);
|
|
35799
35908
|
while (num > 0) {
|
|
35800
35909
|
write$1(encoder, (num > BITS7 ? BIT8 : 0) | BITS7 & num);
|
|
35801
|
-
num = floor(num / 128);
|
|
35910
|
+
num = floor$1(num / 128);
|
|
35802
35911
|
}
|
|
35803
35912
|
};
|
|
35804
35913
|
const _strBuffer = new Uint8Array(3e4);
|
|
@@ -35831,13 +35940,13 @@ utf8TextEncoder.encodeInto ? _writeVarStringNative : _writeVarStringPolyfill;
|
|
|
35831
35940
|
const writeUint8Array = (encoder, uint8Array) => {
|
|
35832
35941
|
const bufferLen = encoder.cbuf.length;
|
|
35833
35942
|
const cpos = encoder.cpos;
|
|
35834
|
-
const leftCopyLen = min$
|
|
35943
|
+
const leftCopyLen = min$2(bufferLen - cpos, uint8Array.length);
|
|
35835
35944
|
const rightCopyLen = uint8Array.length - leftCopyLen;
|
|
35836
35945
|
encoder.cbuf.set(uint8Array.subarray(0, leftCopyLen), cpos);
|
|
35837
35946
|
encoder.cpos += leftCopyLen;
|
|
35838
35947
|
if (rightCopyLen > 0) {
|
|
35839
35948
|
encoder.bufs.push(encoder.cbuf);
|
|
35840
|
-
encoder.cbuf = new Uint8Array(max$
|
|
35949
|
+
encoder.cbuf = new Uint8Array(max$2(bufferLen * 2, rightCopyLen));
|
|
35841
35950
|
encoder.cbuf.set(uint8Array.subarray(leftCopyLen));
|
|
35842
35951
|
encoder.cpos = rightCopyLen;
|
|
35843
35952
|
}
|
|
@@ -35979,7 +36088,7 @@ const ySyncPluginKey = new PluginKey("y-sync");
|
|
|
35979
36088
|
const yUndoPluginKey = new PluginKey("y-undo");
|
|
35980
36089
|
const yCursorPluginKey = new PluginKey("yjs-cursor");
|
|
35981
36090
|
const rand = Math.random;
|
|
35982
|
-
const oneOf = (arr) => arr[floor(rand() * arr.length)];
|
|
36091
|
+
const oneOf = (arr) => arr[floor$1(rand() * arr.length)];
|
|
35983
36092
|
const undefinedToNull = (v) => v === void 0 ? null : v;
|
|
35984
36093
|
class VarStoragePolyfill {
|
|
35985
36094
|
constructor() {
|
|
@@ -36009,12 +36118,12 @@ try {
|
|
|
36009
36118
|
} catch (e) {
|
|
36010
36119
|
}
|
|
36011
36120
|
const varStorage = _localStorage;
|
|
36012
|
-
const isNode = typeof process$1$1 !== "undefined" && process$1$1.release && /node|io\.js/.test(process$1$1.release.name) && Object.prototype.toString.call(typeof process$1$1 !== "undefined" ? process$1$1 : 0) === "[object process]";
|
|
36013
|
-
const isBrowser$1$1 = typeof window !== "undefined" && typeof document !== "undefined" && !isNode;
|
|
36121
|
+
const isNode$1 = typeof process$1$1 !== "undefined" && process$1$1.release && /node|io\.js/.test(process$1$1.release.name) && Object.prototype.toString.call(typeof process$1$1 !== "undefined" ? process$1$1 : 0) === "[object process]";
|
|
36122
|
+
const isBrowser$1$1 = typeof window !== "undefined" && typeof document !== "undefined" && !isNode$1;
|
|
36014
36123
|
let params;
|
|
36015
36124
|
const computeParams = () => {
|
|
36016
36125
|
if (params === void 0) {
|
|
36017
|
-
if (isNode) {
|
|
36126
|
+
if (isNode$1) {
|
|
36018
36127
|
params = create();
|
|
36019
36128
|
const pargs = process$1$1.argv;
|
|
36020
36129
|
let currParamName = null;
|
|
@@ -36051,12 +36160,12 @@ const computeParams = () => {
|
|
|
36051
36160
|
return params;
|
|
36052
36161
|
};
|
|
36053
36162
|
const hasParam = (name) => computeParams().has(name);
|
|
36054
|
-
const getVariable = (name) => isNode ? undefinedToNull(process$1$1.env[name.toUpperCase().replaceAll("-", "_")]) : undefinedToNull(varStorage.getItem(name));
|
|
36163
|
+
const getVariable = (name) => isNode$1 ? undefinedToNull(process$1$1.env[name.toUpperCase().replaceAll("-", "_")]) : undefinedToNull(varStorage.getItem(name));
|
|
36055
36164
|
const hasConf = (name) => hasParam("--" + name) || getVariable(name) !== null;
|
|
36056
36165
|
hasConf("production");
|
|
36057
|
-
const forceColor = isNode && isOneOf(process$1$1.env.FORCE_COLOR, ["true", "1", "2"]);
|
|
36166
|
+
const forceColor = isNode$1 && isOneOf(process$1$1.env.FORCE_COLOR, ["true", "1", "2"]);
|
|
36058
36167
|
forceColor || !hasParam("--no-colors") && // @todo deprecate --no-colors
|
|
36059
|
-
!hasConf("no-color") && (!isNode || process$1$1.stdout.isTTY) && (!isNode || hasParam("--color") || getVariable("COLORTERM") !== null || (getVariable("TERM") || "").includes("color"));
|
|
36168
|
+
!hasConf("no-color") && (!isNode$1 || process$1$1.stdout.isTTY) && (!isNode$1 || hasParam("--color") || getVariable("COLORTERM") !== null || (getVariable("TERM") || "").includes("color"));
|
|
36060
36169
|
const doc = (
|
|
36061
36170
|
/** @type {Document} */
|
|
36062
36171
|
typeof document !== "undefined" ? document : {}
|
|
@@ -36565,8 +36674,8 @@ class ProsemirrorBinding {
|
|
|
36565
36674
|
new Slice(Fragment.from(fragmentContent), 0, 0)
|
|
36566
36675
|
);
|
|
36567
36676
|
if (sel) {
|
|
36568
|
-
const clampedAnchor = min$
|
|
36569
|
-
const clampedHead = min$
|
|
36677
|
+
const clampedAnchor = min$2(max$2(sel.anchor, 0), tr.doc.content.size);
|
|
36678
|
+
const clampedHead = min$2(max$2(sel.head, 0), tr.doc.content.size);
|
|
36570
36679
|
tr.setSelection(TextSelection.create(tr.doc, clampedAnchor, clampedHead));
|
|
36571
36680
|
}
|
|
36572
36681
|
this.prosemirrorView.dispatch(
|
|
@@ -36963,7 +37072,7 @@ const computeChildEqualityFactor = (ytype, pnode, meta) => {
|
|
|
36963
37072
|
const pChildren = normalizePNodeContent(pnode);
|
|
36964
37073
|
const pChildCnt = pChildren.length;
|
|
36965
37074
|
const yChildCnt = yChildren.length;
|
|
36966
|
-
const minCnt = min$
|
|
37075
|
+
const minCnt = min$2(yChildCnt, pChildCnt);
|
|
36967
37076
|
let left2 = 0;
|
|
36968
37077
|
let right2 = 0;
|
|
36969
37078
|
let foundMappedChild = false;
|
|
@@ -37075,7 +37184,7 @@ const updateYFragment = (y, yDomFragment, pNode, meta) => {
|
|
|
37075
37184
|
const pChildCnt = pChildren.length;
|
|
37076
37185
|
const yChildren = yDomFragment.toArray();
|
|
37077
37186
|
const yChildCnt = yChildren.length;
|
|
37078
|
-
const minCnt = min$
|
|
37187
|
+
const minCnt = min$2(pChildCnt, yChildCnt);
|
|
37079
37188
|
let left2 = 0;
|
|
37080
37189
|
let right2 = 0;
|
|
37081
37190
|
for (; left2 < minCnt; left2++) {
|
|
@@ -37448,17 +37557,17 @@ const createDecorations = (state2, awareness, awarenessFilter, createCursor, cre
|
|
|
37448
37557
|
ystate.binding.mapping
|
|
37449
37558
|
);
|
|
37450
37559
|
if (anchor !== null && head !== null) {
|
|
37451
|
-
const maxsize = max$
|
|
37452
|
-
anchor = min$
|
|
37453
|
-
head = min$
|
|
37560
|
+
const maxsize = max$2(state2.doc.content.size - 1, 0);
|
|
37561
|
+
anchor = min$2(anchor, maxsize);
|
|
37562
|
+
head = min$2(head, maxsize);
|
|
37454
37563
|
decorations.push(
|
|
37455
37564
|
Decoration.widget(head, () => createCursor(user, clientId), {
|
|
37456
37565
|
key: clientId + "",
|
|
37457
37566
|
side: 10
|
|
37458
37567
|
})
|
|
37459
37568
|
);
|
|
37460
|
-
const from2 = min$
|
|
37461
|
-
const to = max$
|
|
37569
|
+
const from2 = min$2(anchor, head);
|
|
37570
|
+
const to = max$2(anchor, head);
|
|
37462
37571
|
decorations.push(
|
|
37463
37572
|
Decoration.inline(from2, to, createSelection(user, clientId), {
|
|
37464
37573
|
inclusiveEnd: true,
|
|
@@ -37912,7 +38021,8 @@ const getTextContentFromNodes = ($from, maxMatch = 500) => {
|
|
|
37912
38021
|
const handleDocxPaste = (html, editor, view, plugin2) => {
|
|
37913
38022
|
const { converter } = editor;
|
|
37914
38023
|
if (!converter || !converter.convertedXml) return handleHtmlPaste(html, editor, view, plugin2);
|
|
37915
|
-
|
|
38024
|
+
let cleanedHtml = convertEmToPt(html);
|
|
38025
|
+
cleanedHtml = cleanHtmlUnnecessaryTags(cleanedHtml);
|
|
37916
38026
|
const tempDiv = document.createElement("div");
|
|
37917
38027
|
tempDiv.innerHTML = cleanedHtml;
|
|
37918
38028
|
const paragraphs = tempDiv.querySelectorAll("p");
|
|
@@ -38283,6 +38393,9 @@ const convertEmToPt = (html) => {
|
|
|
38283
38393
|
}
|
|
38284
38394
|
);
|
|
38285
38395
|
};
|
|
38396
|
+
function cleanHtmlUnnecessaryTags(html) {
|
|
38397
|
+
return html.replace(/<o:p>.*?<\/o:p>/gi, "").replace(/ /gi, " ").replace(/<span[^>]*>\s*<\/span>/gi, "").replace(/<p[^>]*>\s*<\/p>/gi, "").trim();
|
|
38398
|
+
}
|
|
38286
38399
|
const _ExtensionService = class _ExtensionService2 {
|
|
38287
38400
|
constructor(extensions, userExtensions, editor) {
|
|
38288
38401
|
__privateAdd$1(this, _ExtensionService_instances);
|
|
@@ -39080,7 +39193,8 @@ const createHeaderFooterEditor = ({
|
|
|
39080
39193
|
appendToBody = true,
|
|
39081
39194
|
sectionId,
|
|
39082
39195
|
type: type2,
|
|
39083
|
-
availableHeight
|
|
39196
|
+
availableHeight,
|
|
39197
|
+
currentPageNumber
|
|
39084
39198
|
}) => {
|
|
39085
39199
|
const parentStyles = editor.converter.getDocumentDefaultStyles();
|
|
39086
39200
|
const { fontSizePt, typeface } = parentStyles;
|
|
@@ -39121,6 +39235,8 @@ const createHeaderFooterEditor = ({
|
|
|
39121
39235
|
fonts: editor.options.fonts,
|
|
39122
39236
|
isHeaderOrFooter: true,
|
|
39123
39237
|
annotations: true,
|
|
39238
|
+
currentPageNumber,
|
|
39239
|
+
parentEditor: editor,
|
|
39124
39240
|
onCreate: (evt) => setEditorToolbar(evt, editor),
|
|
39125
39241
|
onBlur: (evt) => onHeaderFooterDataUpdate(evt, editor, sectionId, type2)
|
|
39126
39242
|
});
|
|
@@ -40264,9 +40380,9 @@ const cleanUpListsWithAnnotations = (fieldsToDelete = [], editor) => {
|
|
|
40264
40380
|
if (type2.name !== "paragraph" && type2.name !== "fieldAnnotation") return;
|
|
40265
40381
|
child.children.forEach((inline) => {
|
|
40266
40382
|
const isFieldToDelete = fieldsToDelete.includes(inline.attrs.fieldId);
|
|
40267
|
-
const
|
|
40268
|
-
const
|
|
40269
|
-
if (!
|
|
40383
|
+
const isFieldType = inline.type.name === "fieldAnnotation";
|
|
40384
|
+
const isMatchingField = isFieldType && isFieldToDelete;
|
|
40385
|
+
if (!isFieldType && !isMatchingField) hasOtherNodes = true;
|
|
40270
40386
|
if (isMatchingField) matchingNodesFound += 1;
|
|
40271
40387
|
});
|
|
40272
40388
|
});
|
|
@@ -40468,6 +40584,25 @@ function useHighContrastMode() {
|
|
|
40468
40584
|
setHighContrastMode
|
|
40469
40585
|
};
|
|
40470
40586
|
}
|
|
40587
|
+
const findWordBounds = (doc2, pos) => {
|
|
40588
|
+
const $pos = doc2.resolve(pos);
|
|
40589
|
+
const parent = $pos.parent;
|
|
40590
|
+
const offset2 = $pos.parentOffset;
|
|
40591
|
+
const text = parent.textContent;
|
|
40592
|
+
if (!text) return { from: pos, to: pos };
|
|
40593
|
+
let start2 = offset2, end2 = offset2;
|
|
40594
|
+
while (start2 > 0 && /\w/.test(text[start2 - 1])) start2--;
|
|
40595
|
+
while (end2 < text.length && /\w/.test(text[end2])) end2++;
|
|
40596
|
+
const from2 = $pos.start() + start2;
|
|
40597
|
+
const to = $pos.start() + end2;
|
|
40598
|
+
return { from: from2, to };
|
|
40599
|
+
};
|
|
40600
|
+
const setWordSelection = (view, pos) => {
|
|
40601
|
+
const { state: state2, dispatch } = view;
|
|
40602
|
+
const word = findWordBounds(state2.doc, pos);
|
|
40603
|
+
const tr = state2.tr.setSelection(TextSelection.create(state2.doc, word.from, word.to));
|
|
40604
|
+
dispatch(tr);
|
|
40605
|
+
};
|
|
40471
40606
|
const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
40472
40607
|
/**
|
|
40473
40608
|
* Create a new Editor instance
|
|
@@ -40711,6 +40846,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
40711
40846
|
__privateMethod$1(this, _Editor_instances, initMedia_fn).call(this);
|
|
40712
40847
|
const doc2 = __privateMethod$1(this, _Editor_instances, generatePmData_fn).call(this);
|
|
40713
40848
|
const tr = this.state.tr.replaceWith(0, this.state.doc.content.size, doc2);
|
|
40849
|
+
tr.setMeta("replaceContent", true);
|
|
40714
40850
|
this.view.dispatch(tr);
|
|
40715
40851
|
}
|
|
40716
40852
|
/**
|
|
@@ -41118,7 +41254,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41118
41254
|
* @returns {Object | void} Migration results
|
|
41119
41255
|
*/
|
|
41120
41256
|
processCollaborationMigrations() {
|
|
41121
|
-
console.debug("[checkVersionMigrations] Current editor version", "0.12.
|
|
41257
|
+
console.debug("[checkVersionMigrations] Current editor version", "0.12.37-next.1");
|
|
41122
41258
|
if (!this.options.ydoc) return;
|
|
41123
41259
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
41124
41260
|
let docVersion = metaMap.get("version");
|
|
@@ -41473,6 +41609,7 @@ createView_fn = function() {
|
|
|
41473
41609
|
if (isHeader || isFooter) {
|
|
41474
41610
|
const eventClone = new event.constructor(event.type);
|
|
41475
41611
|
event.target.dispatchEvent(eventClone);
|
|
41612
|
+
if (this.options.isHeaderOrFooter && this.options.editable) setWordSelection(view, pos);
|
|
41476
41613
|
return;
|
|
41477
41614
|
}
|
|
41478
41615
|
event.stopPropagation();
|
|
@@ -41483,6 +41620,7 @@ createView_fn = function() {
|
|
|
41483
41620
|
pm.classList.remove("header-footer-edit");
|
|
41484
41621
|
pm.setAttribute("aria-readonly", false);
|
|
41485
41622
|
}
|
|
41623
|
+
setWordSelection(view, pos);
|
|
41486
41624
|
}
|
|
41487
41625
|
});
|
|
41488
41626
|
const newState = this.state.reconfigure({
|
|
@@ -46654,7 +46792,7 @@ const Table = Node$1.create({
|
|
|
46654
46792
|
if (!borders) return {};
|
|
46655
46793
|
const style2 = Object.entries(borders).reduce(
|
|
46656
46794
|
(acc, [key, { size: size2, color }]) => {
|
|
46657
|
-
return `${acc}border-${key}: ${size2}px solid ${color || "black"};`;
|
|
46795
|
+
return `${acc}border-${key}: ${Math.ceil(size2)}px solid ${color || "black"};`;
|
|
46658
46796
|
},
|
|
46659
46797
|
""
|
|
46660
46798
|
);
|
|
@@ -46994,8 +47132,8 @@ const TableCell = Node$1.create({
|
|
|
46994
47132
|
cellMargins: {
|
|
46995
47133
|
renderDOM({ cellMargins }) {
|
|
46996
47134
|
if (!cellMargins) return {};
|
|
46997
|
-
const
|
|
46998
|
-
const style2 =
|
|
47135
|
+
const sides2 = ["top", "right", "bottom", "left"];
|
|
47136
|
+
const style2 = sides2.map((side) => {
|
|
46999
47137
|
const margin = cellMargins?.[side];
|
|
47000
47138
|
if (margin) return `padding-${side}: ${margin}px;`;
|
|
47001
47139
|
return "";
|
|
@@ -47007,11 +47145,11 @@ const TableCell = Node$1.create({
|
|
|
47007
47145
|
default: () => createCellBorders(),
|
|
47008
47146
|
renderDOM({ borders }) {
|
|
47009
47147
|
if (!borders) return {};
|
|
47010
|
-
const
|
|
47011
|
-
const style2 =
|
|
47148
|
+
const sides2 = ["top", "right", "bottom", "left"];
|
|
47149
|
+
const style2 = sides2.map((side) => {
|
|
47012
47150
|
const border = borders?.[side];
|
|
47013
47151
|
if (border && border.val === "none") return `border-${side}: ${border.val};`;
|
|
47014
|
-
if (border) return `border-${side}: ${border.size}px solid ${border.color || "black"};`;
|
|
47152
|
+
if (border) return `border-${side}: ${Math.ceil(border.size)}px solid ${border.color || "black"};`;
|
|
47015
47153
|
return "";
|
|
47016
47154
|
}).join(" ");
|
|
47017
47155
|
return { style: style2 };
|
|
@@ -47237,7 +47375,7 @@ class FieldAnnotationView {
|
|
|
47237
47375
|
}
|
|
47238
47376
|
_FieldAnnotationView_instances = /* @__PURE__ */ new WeakSet();
|
|
47239
47377
|
createAnnotation_fn = function({ displayLabel } = {}) {
|
|
47240
|
-
let { highlighted } = this.node.attrs;
|
|
47378
|
+
let { highlighted, rawHtml } = this.node.attrs;
|
|
47241
47379
|
let annotation = document.createElement("span");
|
|
47242
47380
|
annotation.classList.add(this.annotationClass);
|
|
47243
47381
|
let content = document.createElement("span");
|
|
@@ -47249,7 +47387,11 @@ createAnnotation_fn = function({ displayLabel } = {}) {
|
|
|
47249
47387
|
}
|
|
47250
47388
|
annotation.append(content);
|
|
47251
47389
|
let omitHighlight = highlighted === false;
|
|
47252
|
-
let
|
|
47390
|
+
let styles = [`border: 2px solid ${this.borderColor}`, `border-radius: 2px`, `padding: 1px 2px`, `box-sizing: border-box`];
|
|
47391
|
+
if (rawHtml) {
|
|
47392
|
+
styles.push("font-weight: normal");
|
|
47393
|
+
}
|
|
47394
|
+
let annotationStyle = styles.join(
|
|
47253
47395
|
"; "
|
|
47254
47396
|
);
|
|
47255
47397
|
let mergedAttrs = Attribute2.mergeAttributes(this.htmlAttributes, {
|
|
@@ -47804,6 +47946,12 @@ const FieldAnnotation = Node$1.create({
|
|
|
47804
47946
|
parseDOM: (elem) => elem.getAttribute("data-bold") === "true",
|
|
47805
47947
|
renderDOM: (attrs) => {
|
|
47806
47948
|
if (!attrs.bold) return {};
|
|
47949
|
+
if (attrs.rawHtml) {
|
|
47950
|
+
return {
|
|
47951
|
+
"data-bold": "false",
|
|
47952
|
+
style: "font-weight: normal"
|
|
47953
|
+
};
|
|
47954
|
+
}
|
|
47807
47955
|
return {
|
|
47808
47956
|
"data-bold": "true",
|
|
47809
47957
|
style: "font-weight: bold"
|
|
@@ -47814,7 +47962,7 @@ const FieldAnnotation = Node$1.create({
|
|
|
47814
47962
|
default: false,
|
|
47815
47963
|
parseDOM: (elem) => elem.getAttribute("data-italic") === "true",
|
|
47816
47964
|
renderDOM: (attrs) => {
|
|
47817
|
-
if (!attrs.italic) return {};
|
|
47965
|
+
if (!attrs.italic || attrs.rawHtml) return {};
|
|
47818
47966
|
return {
|
|
47819
47967
|
"data-italic": "true",
|
|
47820
47968
|
style: "font-style: italic"
|
|
@@ -47825,7 +47973,7 @@ const FieldAnnotation = Node$1.create({
|
|
|
47825
47973
|
default: false,
|
|
47826
47974
|
parseDOM: (elem) => elem.getAttribute("data-underline") === "true",
|
|
47827
47975
|
renderDOM: (attrs) => {
|
|
47828
|
-
if (!attrs.underline) return {};
|
|
47976
|
+
if (!attrs.underline || attrs.rawHtml) return {};
|
|
47829
47977
|
return {
|
|
47830
47978
|
"data-underline": "true",
|
|
47831
47979
|
style: "text-decoration: underline"
|
|
@@ -47847,7 +47995,7 @@ const FieldAnnotation = Node$1.create({
|
|
|
47847
47995
|
default: null,
|
|
47848
47996
|
parseDOM: (elem) => elem.getAttribute("data-font-size") || elem.style.fontSize || null,
|
|
47849
47997
|
renderDOM: (attrs) => {
|
|
47850
|
-
if (!attrs.fontSize) return {};
|
|
47998
|
+
if (!attrs.fontSize || attrs.rawHtml) return {};
|
|
47851
47999
|
let [value, unit] = parseSizeUnit(attrs.fontSize);
|
|
47852
48000
|
if (Number.isNaN(value)) return {};
|
|
47853
48001
|
unit = unit ? unit : "pt";
|
|
@@ -48766,32 +48914,89 @@ const PageNumber = Node$1.create({
|
|
|
48766
48914
|
name: "page-number",
|
|
48767
48915
|
group: "inline",
|
|
48768
48916
|
inline: true,
|
|
48769
|
-
|
|
48917
|
+
atom: true,
|
|
48918
|
+
selectable: false,
|
|
48919
|
+
draggable: false,
|
|
48920
|
+
selectable: false,
|
|
48921
|
+
defining: true,
|
|
48922
|
+
content: "",
|
|
48770
48923
|
addOptions() {
|
|
48771
48924
|
return {
|
|
48772
48925
|
htmlAttributes: {
|
|
48926
|
+
contenteditable: false,
|
|
48773
48927
|
"data-id": "auto-page-number",
|
|
48774
48928
|
"aria-label": "Page number node"
|
|
48775
48929
|
}
|
|
48776
48930
|
};
|
|
48777
48931
|
},
|
|
48932
|
+
addAttributes() {
|
|
48933
|
+
return {
|
|
48934
|
+
marksAsAttrs: {
|
|
48935
|
+
default: null,
|
|
48936
|
+
rendered: false
|
|
48937
|
+
}
|
|
48938
|
+
};
|
|
48939
|
+
},
|
|
48940
|
+
addNodeView() {
|
|
48941
|
+
return ({ node: node2, editor, getPos, decorations }) => {
|
|
48942
|
+
const htmlAttributes = this.options.htmlAttributes;
|
|
48943
|
+
return new AutoPageNumberNodeView(node2, getPos, decorations, editor, htmlAttributes);
|
|
48944
|
+
};
|
|
48945
|
+
},
|
|
48778
48946
|
parseDOM() {
|
|
48779
48947
|
return [{ tag: 'span[data-id="auto-page-number"' }];
|
|
48780
48948
|
},
|
|
48781
48949
|
renderDOM({ htmlAttributes }) {
|
|
48782
|
-
return ["span", Attribute2.mergeAttributes(this.options.htmlAttributes, htmlAttributes)
|
|
48950
|
+
return ["span", Attribute2.mergeAttributes(this.options.htmlAttributes, htmlAttributes)];
|
|
48951
|
+
},
|
|
48952
|
+
addCommands() {
|
|
48953
|
+
return {
|
|
48954
|
+
addAutoPageNumber: () => ({ tr, dispatch, state: state2, editor }) => {
|
|
48955
|
+
const { options: options2 } = editor;
|
|
48956
|
+
if (!options2.isHeaderOrFooter) return false;
|
|
48957
|
+
const { schema } = state2;
|
|
48958
|
+
const pageNumberType = schema?.nodes?.["page-number"];
|
|
48959
|
+
if (!pageNumberType) return false;
|
|
48960
|
+
const pageNumberNodeJSON = { type: "page-number" };
|
|
48961
|
+
const pageNumberNode = schema.nodeFromJSON(pageNumberNodeJSON);
|
|
48962
|
+
if (dispatch) {
|
|
48963
|
+
tr.replaceSelectionWith(pageNumberNode, false);
|
|
48964
|
+
tr.setMeta("forceUpdatePagination", true);
|
|
48965
|
+
}
|
|
48966
|
+
return true;
|
|
48967
|
+
}
|
|
48968
|
+
};
|
|
48969
|
+
},
|
|
48970
|
+
addShortcuts() {
|
|
48971
|
+
return {
|
|
48972
|
+
"Mod-Shift-alt-p": () => this.editor.commands.addAutoPageNumber()
|
|
48973
|
+
};
|
|
48783
48974
|
}
|
|
48784
48975
|
});
|
|
48785
48976
|
const TotalPageCount = Node$1.create({
|
|
48786
48977
|
name: "total-page-number",
|
|
48787
48978
|
group: "inline",
|
|
48788
48979
|
inline: true,
|
|
48980
|
+
atom: true,
|
|
48981
|
+
selectable: false,
|
|
48982
|
+
draggable: false,
|
|
48983
|
+
selectable: false,
|
|
48789
48984
|
content: "text*",
|
|
48790
48985
|
addOptions() {
|
|
48791
48986
|
return {
|
|
48792
48987
|
htmlAttributes: {
|
|
48988
|
+
contenteditable: false,
|
|
48793
48989
|
"data-id": "auto-total-pages",
|
|
48794
|
-
"aria-label": "Total page count node"
|
|
48990
|
+
"aria-label": "Total page count node",
|
|
48991
|
+
"class": "sd-editor-auto-total-pages"
|
|
48992
|
+
}
|
|
48993
|
+
};
|
|
48994
|
+
},
|
|
48995
|
+
addAttributes() {
|
|
48996
|
+
return {
|
|
48997
|
+
marksAsAttrs: {
|
|
48998
|
+
default: null,
|
|
48999
|
+
rendered: false
|
|
48795
49000
|
}
|
|
48796
49001
|
};
|
|
48797
49002
|
},
|
|
@@ -48800,8 +49005,139 @@ const TotalPageCount = Node$1.create({
|
|
|
48800
49005
|
},
|
|
48801
49006
|
renderDOM({ htmlAttributes }) {
|
|
48802
49007
|
return ["span", Attribute2.mergeAttributes(this.options.htmlAttributes, htmlAttributes), 0];
|
|
49008
|
+
},
|
|
49009
|
+
addCommands() {
|
|
49010
|
+
return {
|
|
49011
|
+
addTotalPageCount: () => ({ tr, dispatch, state: state2, editor }) => {
|
|
49012
|
+
const { options: options2 } = editor;
|
|
49013
|
+
if (!options2.isHeaderOrFooter) return false;
|
|
49014
|
+
const { schema } = state2;
|
|
49015
|
+
const pageNumberType = schema.nodes?.["total-page-number"];
|
|
49016
|
+
if (!pageNumberType) return false;
|
|
49017
|
+
const currentPages = editor?.options?.parentEditor?.currentTotalPages || 1;
|
|
49018
|
+
const pageNumberNode = {
|
|
49019
|
+
type: "total-page-number",
|
|
49020
|
+
content: [{ type: "text", text: String(currentPages) }]
|
|
49021
|
+
};
|
|
49022
|
+
const pageNode = schema.nodeFromJSON(pageNumberNode);
|
|
49023
|
+
if (dispatch) {
|
|
49024
|
+
tr.replaceSelectionWith(pageNode, false);
|
|
49025
|
+
}
|
|
49026
|
+
return true;
|
|
49027
|
+
}
|
|
49028
|
+
};
|
|
49029
|
+
},
|
|
49030
|
+
addShortcuts() {
|
|
49031
|
+
return {
|
|
49032
|
+
"Mod-Shift-alt-c": () => this.editor.commands.addTotalPageCount()
|
|
49033
|
+
};
|
|
48803
49034
|
}
|
|
48804
49035
|
});
|
|
49036
|
+
class AutoPageNumberNodeView {
|
|
49037
|
+
constructor(node2, getPos, decorations, editor, htmlAttributes = {}) {
|
|
49038
|
+
__privateAdd$1(this, _AutoPageNumberNodeView_instances);
|
|
49039
|
+
this.node = node2;
|
|
49040
|
+
this.editor = editor;
|
|
49041
|
+
this.view = editor.view;
|
|
49042
|
+
this.getPos = getPos;
|
|
49043
|
+
this.editor = editor;
|
|
49044
|
+
this.dom = __privateMethod$1(this, _AutoPageNumberNodeView_instances, renderDom_fn).call(this, node2, htmlAttributes);
|
|
49045
|
+
}
|
|
49046
|
+
update(node2) {
|
|
49047
|
+
if (node2.type !== this.node.type) return false;
|
|
49048
|
+
this.node = node2;
|
|
49049
|
+
return true;
|
|
49050
|
+
}
|
|
49051
|
+
}
|
|
49052
|
+
_AutoPageNumberNodeView_instances = /* @__PURE__ */ new WeakSet();
|
|
49053
|
+
renderDom_fn = function(node2, htmlAttributes) {
|
|
49054
|
+
const pageText = this.editor.options.currentPageNumber || "1";
|
|
49055
|
+
const content = document.createTextNode(String(pageText));
|
|
49056
|
+
const nodeContent = document.createElement("span");
|
|
49057
|
+
nodeContent.className = "sd-editor-auto-page-number";
|
|
49058
|
+
nodeContent.setAttribute("data-id", "auto-page-number");
|
|
49059
|
+
nodeContent.setAttribute("aria-label", "Page number node");
|
|
49060
|
+
const currentPos = this.getPos();
|
|
49061
|
+
const { styles, marks } = getMarksFromNeighbors(currentPos, this.view);
|
|
49062
|
+
__privateMethod$1(this, _AutoPageNumberNodeView_instances, scheduleUpdateNodeStyle_fn).call(this, currentPos, marks);
|
|
49063
|
+
Object.assign(nodeContent.style, styles);
|
|
49064
|
+
nodeContent.appendChild(content);
|
|
49065
|
+
Object.entries(htmlAttributes).forEach(([key, value]) => {
|
|
49066
|
+
if (value) nodeContent.setAttribute(key, value);
|
|
49067
|
+
});
|
|
49068
|
+
return nodeContent;
|
|
49069
|
+
};
|
|
49070
|
+
scheduleUpdateNodeStyle_fn = function(pos, marks) {
|
|
49071
|
+
setTimeout(() => {
|
|
49072
|
+
const { state: state2 } = this.editor;
|
|
49073
|
+
const { dispatch } = this.view;
|
|
49074
|
+
const node2 = state2.doc.nodeAt(pos);
|
|
49075
|
+
if (!node2) return;
|
|
49076
|
+
const currentMarks = node2.attrs.marksAsAttrs || [];
|
|
49077
|
+
const newMarks = marks.map((m) => ({ type: m.type.name, attrs: m.attrs }));
|
|
49078
|
+
const isEqual = JSON.stringify(currentMarks) === JSON.stringify(newMarks);
|
|
49079
|
+
if (isEqual) return;
|
|
49080
|
+
const newAttrs = {
|
|
49081
|
+
...node2.attrs,
|
|
49082
|
+
marksAsAttrs: newMarks
|
|
49083
|
+
};
|
|
49084
|
+
const tr = state2.tr.setNodeMarkup(pos, void 0, newAttrs);
|
|
49085
|
+
dispatch(tr);
|
|
49086
|
+
}, 0);
|
|
49087
|
+
};
|
|
49088
|
+
const getMarksFromNeighbors = (currentPos, view) => {
|
|
49089
|
+
const $pos = view.state.doc.resolve(currentPos);
|
|
49090
|
+
const styles = {};
|
|
49091
|
+
const marks = [];
|
|
49092
|
+
const before = $pos.nodeBefore;
|
|
49093
|
+
if (before) {
|
|
49094
|
+
Object.assign(styles, processMarks(before.marks));
|
|
49095
|
+
marks.push(...before.marks);
|
|
49096
|
+
}
|
|
49097
|
+
const after = $pos.nodeAfter;
|
|
49098
|
+
if (after) {
|
|
49099
|
+
Object.assign(styles, { ...styles, ...processMarks(after.marks) });
|
|
49100
|
+
marks.push(...after.marks);
|
|
49101
|
+
}
|
|
49102
|
+
return {
|
|
49103
|
+
styles,
|
|
49104
|
+
marks
|
|
49105
|
+
};
|
|
49106
|
+
};
|
|
49107
|
+
const processMarks = (marks) => {
|
|
49108
|
+
const styles = {};
|
|
49109
|
+
marks.forEach((mark) => {
|
|
49110
|
+
const { type: type2, attrs } = mark;
|
|
49111
|
+
switch (type2.name) {
|
|
49112
|
+
case "textStyle":
|
|
49113
|
+
if (attrs.fontFamily) styles["font-family"] = attrs.fontFamily;
|
|
49114
|
+
if (attrs.fontSize) styles["font-size"] = attrs.fontSize;
|
|
49115
|
+
if (attrs.color) styles["color"] = attrs.color;
|
|
49116
|
+
if (attrs.backgroundColor) styles["background-color"] = attrs.backgroundColor;
|
|
49117
|
+
break;
|
|
49118
|
+
case "bold":
|
|
49119
|
+
styles["font-weight"] = "bold";
|
|
49120
|
+
break;
|
|
49121
|
+
case "italic":
|
|
49122
|
+
styles["font-style"] = "italic";
|
|
49123
|
+
break;
|
|
49124
|
+
case "underline":
|
|
49125
|
+
styles["text-decoration"] = (styles["text-decoration"] || "") + " underline";
|
|
49126
|
+
break;
|
|
49127
|
+
case "strike":
|
|
49128
|
+
styles["text-decoration"] = (styles["text-decoration"] || "") + " line-through";
|
|
49129
|
+
break;
|
|
49130
|
+
default:
|
|
49131
|
+
if (attrs?.style) {
|
|
49132
|
+
Object.entries(attrs.style).forEach(([key, value]) => {
|
|
49133
|
+
styles[key] = value;
|
|
49134
|
+
});
|
|
49135
|
+
}
|
|
49136
|
+
break;
|
|
49137
|
+
}
|
|
49138
|
+
});
|
|
49139
|
+
return styles;
|
|
49140
|
+
};
|
|
48805
49141
|
const ShapeContainer = Node$1.create({
|
|
48806
49142
|
name: "shapeContainer",
|
|
48807
49143
|
group: "block",
|
|
@@ -49814,10 +50150,10 @@ var beforeWrite = "beforeWrite";
|
|
|
49814
50150
|
var write = "write";
|
|
49815
50151
|
var afterWrite = "afterWrite";
|
|
49816
50152
|
var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
|
|
49817
|
-
function getNodeName(element) {
|
|
50153
|
+
function getNodeName$1(element) {
|
|
49818
50154
|
return element ? (element.nodeName || "").toLowerCase() : null;
|
|
49819
50155
|
}
|
|
49820
|
-
function getWindow(node2) {
|
|
50156
|
+
function getWindow$1(node2) {
|
|
49821
50157
|
if (node2 == null) {
|
|
49822
50158
|
return window;
|
|
49823
50159
|
}
|
|
@@ -49827,19 +50163,19 @@ function getWindow(node2) {
|
|
|
49827
50163
|
}
|
|
49828
50164
|
return node2;
|
|
49829
50165
|
}
|
|
49830
|
-
function isElement$
|
|
49831
|
-
var OwnElement = getWindow(node2).Element;
|
|
50166
|
+
function isElement$2(node2) {
|
|
50167
|
+
var OwnElement = getWindow$1(node2).Element;
|
|
49832
50168
|
return node2 instanceof OwnElement || node2 instanceof Element;
|
|
49833
50169
|
}
|
|
49834
50170
|
function isHTMLElement$1(node2) {
|
|
49835
|
-
var OwnElement = getWindow(node2).HTMLElement;
|
|
50171
|
+
var OwnElement = getWindow$1(node2).HTMLElement;
|
|
49836
50172
|
return node2 instanceof OwnElement || node2 instanceof HTMLElement;
|
|
49837
50173
|
}
|
|
49838
|
-
function isShadowRoot(node2) {
|
|
50174
|
+
function isShadowRoot$1(node2) {
|
|
49839
50175
|
if (typeof ShadowRoot === "undefined") {
|
|
49840
50176
|
return false;
|
|
49841
50177
|
}
|
|
49842
|
-
var OwnElement = getWindow(node2).ShadowRoot;
|
|
50178
|
+
var OwnElement = getWindow$1(node2).ShadowRoot;
|
|
49843
50179
|
return node2 instanceof OwnElement || node2 instanceof ShadowRoot;
|
|
49844
50180
|
}
|
|
49845
50181
|
function applyStyles(_ref) {
|
|
@@ -49848,7 +50184,7 @@ function applyStyles(_ref) {
|
|
|
49848
50184
|
var style2 = state2.styles[name] || {};
|
|
49849
50185
|
var attributes = state2.attributes[name] || {};
|
|
49850
50186
|
var element = state2.elements[name];
|
|
49851
|
-
if (!isHTMLElement$1(element) || !getNodeName(element)) {
|
|
50187
|
+
if (!isHTMLElement$1(element) || !getNodeName$1(element)) {
|
|
49852
50188
|
return;
|
|
49853
50189
|
}
|
|
49854
50190
|
Object.assign(element.style, style2);
|
|
@@ -49890,7 +50226,7 @@ function effect$2(_ref2) {
|
|
|
49890
50226
|
style22[property2] = "";
|
|
49891
50227
|
return style22;
|
|
49892
50228
|
}, {});
|
|
49893
|
-
if (!isHTMLElement$1(element) || !getNodeName(element)) {
|
|
50229
|
+
if (!isHTMLElement$1(element) || !getNodeName$1(element)) {
|
|
49894
50230
|
return;
|
|
49895
50231
|
}
|
|
49896
50232
|
Object.assign(element.style, style2);
|
|
@@ -49911,9 +50247,9 @@ const applyStyles$1 = {
|
|
|
49911
50247
|
function getBasePlacement$1(placement) {
|
|
49912
50248
|
return placement.split("-")[0];
|
|
49913
50249
|
}
|
|
49914
|
-
var max = Math.max;
|
|
49915
|
-
var min = Math.min;
|
|
49916
|
-
var round = Math.round;
|
|
50250
|
+
var max$1 = Math.max;
|
|
50251
|
+
var min$1 = Math.min;
|
|
50252
|
+
var round$1 = Math.round;
|
|
49917
50253
|
function getUAString() {
|
|
49918
50254
|
var uaData = navigator.userAgentData;
|
|
49919
50255
|
if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {
|
|
@@ -49926,7 +50262,7 @@ function getUAString() {
|
|
|
49926
50262
|
function isLayoutViewport() {
|
|
49927
50263
|
return !/^((?!chrome|android).)*safari/i.test(getUAString());
|
|
49928
50264
|
}
|
|
49929
|
-
function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
|
50265
|
+
function getBoundingClientRect$1(element, includeScale, isFixedStrategy) {
|
|
49930
50266
|
if (includeScale === void 0) {
|
|
49931
50267
|
includeScale = false;
|
|
49932
50268
|
}
|
|
@@ -49937,10 +50273,10 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
|
|
49937
50273
|
var scaleX = 1;
|
|
49938
50274
|
var scaleY = 1;
|
|
49939
50275
|
if (includeScale && isHTMLElement$1(element)) {
|
|
49940
|
-
scaleX = element.offsetWidth > 0 ? round(clientRect2.width) / element.offsetWidth || 1 : 1;
|
|
49941
|
-
scaleY = element.offsetHeight > 0 ? round(clientRect2.height) / element.offsetHeight || 1 : 1;
|
|
50276
|
+
scaleX = element.offsetWidth > 0 ? round$1(clientRect2.width) / element.offsetWidth || 1 : 1;
|
|
50277
|
+
scaleY = element.offsetHeight > 0 ? round$1(clientRect2.height) / element.offsetHeight || 1 : 1;
|
|
49942
50278
|
}
|
|
49943
|
-
var _ref = isElement$
|
|
50279
|
+
var _ref = isElement$2(element) ? getWindow$1(element) : window, visualViewport = _ref.visualViewport;
|
|
49944
50280
|
var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
|
|
49945
50281
|
var x = (clientRect2.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
|
|
49946
50282
|
var y = (clientRect2.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
|
|
@@ -49958,7 +50294,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
|
|
49958
50294
|
};
|
|
49959
50295
|
}
|
|
49960
50296
|
function getLayoutRect(element) {
|
|
49961
|
-
var clientRect2 = getBoundingClientRect(element);
|
|
50297
|
+
var clientRect2 = getBoundingClientRect$1(element);
|
|
49962
50298
|
var width = element.offsetWidth;
|
|
49963
50299
|
var height = element.offsetHeight;
|
|
49964
50300
|
if (Math.abs(clientRect2.width - width) <= 1) {
|
|
@@ -49978,7 +50314,7 @@ function contains$1(parent, child) {
|
|
|
49978
50314
|
var rootNode = child.getRootNode && child.getRootNode();
|
|
49979
50315
|
if (parent.contains(child)) {
|
|
49980
50316
|
return true;
|
|
49981
|
-
} else if (rootNode && isShadowRoot(rootNode)) {
|
|
50317
|
+
} else if (rootNode && isShadowRoot$1(rootNode)) {
|
|
49982
50318
|
var next = child;
|
|
49983
50319
|
do {
|
|
49984
50320
|
if (next && parent.isSameNode(next)) {
|
|
@@ -49989,20 +50325,20 @@ function contains$1(parent, child) {
|
|
|
49989
50325
|
}
|
|
49990
50326
|
return false;
|
|
49991
50327
|
}
|
|
49992
|
-
function getComputedStyle$
|
|
49993
|
-
return getWindow(element).getComputedStyle(element);
|
|
50328
|
+
function getComputedStyle$2(element) {
|
|
50329
|
+
return getWindow$1(element).getComputedStyle(element);
|
|
49994
50330
|
}
|
|
49995
|
-
function isTableElement(element) {
|
|
49996
|
-
return ["table", "td", "th"].indexOf(getNodeName(element)) >= 0;
|
|
50331
|
+
function isTableElement$1(element) {
|
|
50332
|
+
return ["table", "td", "th"].indexOf(getNodeName$1(element)) >= 0;
|
|
49997
50333
|
}
|
|
49998
|
-
function getDocumentElement(element) {
|
|
49999
|
-
return ((isElement$
|
|
50334
|
+
function getDocumentElement$1(element) {
|
|
50335
|
+
return ((isElement$2(element) ? element.ownerDocument : (
|
|
50000
50336
|
// $FlowFixMe[prop-missing]
|
|
50001
50337
|
element.document
|
|
50002
50338
|
)) || window.document).documentElement;
|
|
50003
50339
|
}
|
|
50004
50340
|
function getParentNode$1(element) {
|
|
50005
|
-
if (getNodeName(element) === "html") {
|
|
50341
|
+
if (getNodeName$1(element) === "html") {
|
|
50006
50342
|
return element;
|
|
50007
50343
|
}
|
|
50008
50344
|
return (
|
|
@@ -50011,33 +50347,33 @@ function getParentNode$1(element) {
|
|
|
50011
50347
|
// $FlowFixMe[prop-missing]
|
|
50012
50348
|
element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
|
|
50013
50349
|
element.parentNode || // DOM Element detected
|
|
50014
|
-
(isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
|
|
50350
|
+
(isShadowRoot$1(element) ? element.host : null) || // ShadowRoot detected
|
|
50015
50351
|
// $FlowFixMe[incompatible-call]: HTMLElement is a Node
|
|
50016
|
-
getDocumentElement(element)
|
|
50352
|
+
getDocumentElement$1(element)
|
|
50017
50353
|
);
|
|
50018
50354
|
}
|
|
50019
|
-
function getTrueOffsetParent(element) {
|
|
50355
|
+
function getTrueOffsetParent$1(element) {
|
|
50020
50356
|
if (!isHTMLElement$1(element) || // https://github.com/popperjs/popper-core/issues/837
|
|
50021
|
-
getComputedStyle$
|
|
50357
|
+
getComputedStyle$2(element).position === "fixed") {
|
|
50022
50358
|
return null;
|
|
50023
50359
|
}
|
|
50024
50360
|
return element.offsetParent;
|
|
50025
50361
|
}
|
|
50026
|
-
function getContainingBlock(element) {
|
|
50362
|
+
function getContainingBlock$1(element) {
|
|
50027
50363
|
var isFirefox = /firefox/i.test(getUAString());
|
|
50028
50364
|
var isIE = /Trident/i.test(getUAString());
|
|
50029
50365
|
if (isIE && isHTMLElement$1(element)) {
|
|
50030
|
-
var elementCss = getComputedStyle$
|
|
50366
|
+
var elementCss = getComputedStyle$2(element);
|
|
50031
50367
|
if (elementCss.position === "fixed") {
|
|
50032
50368
|
return null;
|
|
50033
50369
|
}
|
|
50034
50370
|
}
|
|
50035
50371
|
var currentNode = getParentNode$1(element);
|
|
50036
|
-
if (isShadowRoot(currentNode)) {
|
|
50372
|
+
if (isShadowRoot$1(currentNode)) {
|
|
50037
50373
|
currentNode = currentNode.host;
|
|
50038
50374
|
}
|
|
50039
|
-
while (isHTMLElement$1(currentNode) && ["html", "body"].indexOf(getNodeName(currentNode)) < 0) {
|
|
50040
|
-
var css = getComputedStyle$
|
|
50375
|
+
while (isHTMLElement$1(currentNode) && ["html", "body"].indexOf(getNodeName$1(currentNode)) < 0) {
|
|
50376
|
+
var css = getComputedStyle$2(currentNode);
|
|
50041
50377
|
if (css.transform !== "none" || css.perspective !== "none" || css.contain === "paint" || ["transform", "perspective"].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === "filter" || isFirefox && css.filter && css.filter !== "none") {
|
|
50042
50378
|
return currentNode;
|
|
50043
50379
|
} else {
|
|
@@ -50046,22 +50382,22 @@ function getContainingBlock(element) {
|
|
|
50046
50382
|
}
|
|
50047
50383
|
return null;
|
|
50048
50384
|
}
|
|
50049
|
-
function getOffsetParent(element) {
|
|
50050
|
-
var window2 = getWindow(element);
|
|
50051
|
-
var offsetParent = getTrueOffsetParent(element);
|
|
50052
|
-
while (offsetParent && isTableElement(offsetParent) && getComputedStyle$
|
|
50053
|
-
offsetParent = getTrueOffsetParent(offsetParent);
|
|
50385
|
+
function getOffsetParent$1(element) {
|
|
50386
|
+
var window2 = getWindow$1(element);
|
|
50387
|
+
var offsetParent = getTrueOffsetParent$1(element);
|
|
50388
|
+
while (offsetParent && isTableElement$1(offsetParent) && getComputedStyle$2(offsetParent).position === "static") {
|
|
50389
|
+
offsetParent = getTrueOffsetParent$1(offsetParent);
|
|
50054
50390
|
}
|
|
50055
|
-
if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle$
|
|
50391
|
+
if (offsetParent && (getNodeName$1(offsetParent) === "html" || getNodeName$1(offsetParent) === "body" && getComputedStyle$2(offsetParent).position === "static")) {
|
|
50056
50392
|
return window2;
|
|
50057
50393
|
}
|
|
50058
|
-
return offsetParent || getContainingBlock(element) || window2;
|
|
50394
|
+
return offsetParent || getContainingBlock$1(element) || window2;
|
|
50059
50395
|
}
|
|
50060
50396
|
function getMainAxisFromPlacement(placement) {
|
|
50061
50397
|
return ["top", "bottom"].indexOf(placement) >= 0 ? "x" : "y";
|
|
50062
50398
|
}
|
|
50063
|
-
function within(
|
|
50064
|
-
return max(
|
|
50399
|
+
function within(min2, value, max2) {
|
|
50400
|
+
return max$1(min2, min$1(value, max2));
|
|
50065
50401
|
}
|
|
50066
50402
|
function withinMaxClamp(min2, value, max2) {
|
|
50067
50403
|
var v = within(min2, value, max2);
|
|
@@ -50108,7 +50444,7 @@ function arrow(_ref) {
|
|
|
50108
50444
|
var maxProp = axis === "y" ? bottom : right;
|
|
50109
50445
|
var endDiff = state2.rects.reference[len] + state2.rects.reference[axis] - popperOffsets2[axis] - state2.rects.popper[len];
|
|
50110
50446
|
var startDiff = popperOffsets2[axis] - state2.rects.reference[axis];
|
|
50111
|
-
var arrowOffsetParent = getOffsetParent(arrowElement);
|
|
50447
|
+
var arrowOffsetParent = getOffsetParent$1(arrowElement);
|
|
50112
50448
|
var clientSize = arrowOffsetParent ? axis === "y" ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
|
|
50113
50449
|
var centerToReference = endDiff / 2 - startDiff / 2;
|
|
50114
50450
|
var min2 = paddingObject[minProp];
|
|
@@ -50157,8 +50493,8 @@ function roundOffsetsByDPR(_ref, win) {
|
|
|
50157
50493
|
var x = _ref.x, y = _ref.y;
|
|
50158
50494
|
var dpr = win.devicePixelRatio || 1;
|
|
50159
50495
|
return {
|
|
50160
|
-
x: round(x * dpr) / dpr || 0,
|
|
50161
|
-
y: round(y * dpr) / dpr || 0
|
|
50496
|
+
x: round$1(x * dpr) / dpr || 0,
|
|
50497
|
+
y: round$1(y * dpr) / dpr || 0
|
|
50162
50498
|
};
|
|
50163
50499
|
}
|
|
50164
50500
|
function mapToStyles(_ref2) {
|
|
@@ -50180,12 +50516,12 @@ function mapToStyles(_ref2) {
|
|
|
50180
50516
|
var sideY = top;
|
|
50181
50517
|
var win = window;
|
|
50182
50518
|
if (adaptive) {
|
|
50183
|
-
var offsetParent = getOffsetParent(popper2);
|
|
50519
|
+
var offsetParent = getOffsetParent$1(popper2);
|
|
50184
50520
|
var heightProp = "clientHeight";
|
|
50185
50521
|
var widthProp = "clientWidth";
|
|
50186
|
-
if (offsetParent === getWindow(popper2)) {
|
|
50187
|
-
offsetParent = getDocumentElement(popper2);
|
|
50188
|
-
if (getComputedStyle$
|
|
50522
|
+
if (offsetParent === getWindow$1(popper2)) {
|
|
50523
|
+
offsetParent = getDocumentElement$1(popper2);
|
|
50524
|
+
if (getComputedStyle$2(offsetParent).position !== "static" && position === "absolute") {
|
|
50189
50525
|
heightProp = "scrollHeight";
|
|
50190
50526
|
widthProp = "scrollWidth";
|
|
50191
50527
|
}
|
|
@@ -50216,7 +50552,7 @@ function mapToStyles(_ref2) {
|
|
|
50216
50552
|
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
|
|
50217
50553
|
x,
|
|
50218
50554
|
y
|
|
50219
|
-
}, getWindow(popper2)) : {
|
|
50555
|
+
}, getWindow$1(popper2)) : {
|
|
50220
50556
|
x,
|
|
50221
50557
|
y
|
|
50222
50558
|
};
|
|
@@ -50272,7 +50608,7 @@ var passive = {
|
|
|
50272
50608
|
function effect(_ref) {
|
|
50273
50609
|
var state2 = _ref.state, instance = _ref.instance, options2 = _ref.options;
|
|
50274
50610
|
var _options$scroll = options2.scroll, scroll = _options$scroll === void 0 ? true : _options$scroll, _options$resize = options2.resize, resize = _options$resize === void 0 ? true : _options$resize;
|
|
50275
|
-
var window2 = getWindow(state2.elements.popper);
|
|
50611
|
+
var window2 = getWindow$1(state2.elements.popper);
|
|
50276
50612
|
var scrollParents = [].concat(state2.scrollParents.reference, state2.scrollParents.popper);
|
|
50277
50613
|
if (scroll) {
|
|
50278
50614
|
scrollParents.forEach(function(scrollParent) {
|
|
@@ -50323,7 +50659,7 @@ function getOppositeVariationPlacement(placement) {
|
|
|
50323
50659
|
});
|
|
50324
50660
|
}
|
|
50325
50661
|
function getWindowScroll(node2) {
|
|
50326
|
-
var win = getWindow(node2);
|
|
50662
|
+
var win = getWindow$1(node2);
|
|
50327
50663
|
var scrollLeft = win.pageXOffset;
|
|
50328
50664
|
var scrollTop = win.pageYOffset;
|
|
50329
50665
|
return {
|
|
@@ -50331,12 +50667,12 @@ function getWindowScroll(node2) {
|
|
|
50331
50667
|
scrollTop
|
|
50332
50668
|
};
|
|
50333
50669
|
}
|
|
50334
|
-
function getWindowScrollBarX(element) {
|
|
50335
|
-
return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
|
|
50670
|
+
function getWindowScrollBarX$1(element) {
|
|
50671
|
+
return getBoundingClientRect$1(getDocumentElement$1(element)).left + getWindowScroll(element).scrollLeft;
|
|
50336
50672
|
}
|
|
50337
|
-
function getViewportRect(element, strategy) {
|
|
50338
|
-
var win = getWindow(element);
|
|
50339
|
-
var html = getDocumentElement(element);
|
|
50673
|
+
function getViewportRect$1(element, strategy) {
|
|
50674
|
+
var win = getWindow$1(element);
|
|
50675
|
+
var html = getDocumentElement$1(element);
|
|
50340
50676
|
var visualViewport = win.visualViewport;
|
|
50341
50677
|
var width = html.clientWidth;
|
|
50342
50678
|
var height = html.clientHeight;
|
|
@@ -50354,21 +50690,21 @@ function getViewportRect(element, strategy) {
|
|
|
50354
50690
|
return {
|
|
50355
50691
|
width,
|
|
50356
50692
|
height,
|
|
50357
|
-
x: x + getWindowScrollBarX(element),
|
|
50693
|
+
x: x + getWindowScrollBarX$1(element),
|
|
50358
50694
|
y
|
|
50359
50695
|
};
|
|
50360
50696
|
}
|
|
50361
|
-
function getDocumentRect(element) {
|
|
50697
|
+
function getDocumentRect$1(element) {
|
|
50362
50698
|
var _element$ownerDocumen;
|
|
50363
|
-
var html = getDocumentElement(element);
|
|
50699
|
+
var html = getDocumentElement$1(element);
|
|
50364
50700
|
var winScroll = getWindowScroll(element);
|
|
50365
50701
|
var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
|
|
50366
|
-
var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
|
|
50367
|
-
var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
|
50368
|
-
var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
|
|
50702
|
+
var width = max$1(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
|
|
50703
|
+
var height = max$1(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
|
50704
|
+
var x = -winScroll.scrollLeft + getWindowScrollBarX$1(element);
|
|
50369
50705
|
var y = -winScroll.scrollTop;
|
|
50370
|
-
if (getComputedStyle$
|
|
50371
|
-
x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
|
|
50706
|
+
if (getComputedStyle$2(body || html).direction === "rtl") {
|
|
50707
|
+
x += max$1(html.clientWidth, body ? body.clientWidth : 0) - width;
|
|
50372
50708
|
}
|
|
50373
50709
|
return {
|
|
50374
50710
|
width,
|
|
@@ -50378,11 +50714,11 @@ function getDocumentRect(element) {
|
|
|
50378
50714
|
};
|
|
50379
50715
|
}
|
|
50380
50716
|
function isScrollParent(element) {
|
|
50381
|
-
var _getComputedStyle = getComputedStyle$
|
|
50717
|
+
var _getComputedStyle = getComputedStyle$2(element), overflow = _getComputedStyle.overflow, overflowX = _getComputedStyle.overflowX, overflowY = _getComputedStyle.overflowY;
|
|
50382
50718
|
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
|
|
50383
50719
|
}
|
|
50384
50720
|
function getScrollParent$1(node2) {
|
|
50385
|
-
if (["html", "body", "#document"].indexOf(getNodeName(node2)) >= 0) {
|
|
50721
|
+
if (["html", "body", "#document"].indexOf(getNodeName$1(node2)) >= 0) {
|
|
50386
50722
|
return node2.ownerDocument.body;
|
|
50387
50723
|
}
|
|
50388
50724
|
if (isHTMLElement$1(node2) && isScrollParent(node2)) {
|
|
@@ -50397,7 +50733,7 @@ function listScrollParents(element, list) {
|
|
|
50397
50733
|
}
|
|
50398
50734
|
var scrollParent = getScrollParent$1(element);
|
|
50399
50735
|
var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
|
|
50400
|
-
var win = getWindow(scrollParent);
|
|
50736
|
+
var win = getWindow$1(scrollParent);
|
|
50401
50737
|
var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
|
|
50402
50738
|
var updatedList = list.concat(target);
|
|
50403
50739
|
return isBody ? updatedList : (
|
|
@@ -50405,7 +50741,7 @@ function listScrollParents(element, list) {
|
|
|
50405
50741
|
updatedList.concat(listScrollParents(getParentNode$1(target)))
|
|
50406
50742
|
);
|
|
50407
50743
|
}
|
|
50408
|
-
function rectToClientRect(rect) {
|
|
50744
|
+
function rectToClientRect$1(rect) {
|
|
50409
50745
|
return Object.assign({}, rect, {
|
|
50410
50746
|
left: rect.x,
|
|
50411
50747
|
top: rect.y,
|
|
@@ -50413,8 +50749,8 @@ function rectToClientRect(rect) {
|
|
|
50413
50749
|
bottom: rect.y + rect.height
|
|
50414
50750
|
});
|
|
50415
50751
|
}
|
|
50416
|
-
function getInnerBoundingClientRect(element, strategy) {
|
|
50417
|
-
var rect = getBoundingClientRect(element, false, strategy === "fixed");
|
|
50752
|
+
function getInnerBoundingClientRect$1(element, strategy) {
|
|
50753
|
+
var rect = getBoundingClientRect$1(element, false, strategy === "fixed");
|
|
50418
50754
|
rect.top = rect.top + element.clientTop;
|
|
50419
50755
|
rect.left = rect.left + element.clientLeft;
|
|
50420
50756
|
rect.bottom = rect.top + element.clientHeight;
|
|
@@ -50426,29 +50762,29 @@ function getInnerBoundingClientRect(element, strategy) {
|
|
|
50426
50762
|
return rect;
|
|
50427
50763
|
}
|
|
50428
50764
|
function getClientRectFromMixedType(element, clippingParent, strategy) {
|
|
50429
|
-
return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement$
|
|
50765
|
+
return clippingParent === viewport ? rectToClientRect$1(getViewportRect$1(element, strategy)) : isElement$2(clippingParent) ? getInnerBoundingClientRect$1(clippingParent, strategy) : rectToClientRect$1(getDocumentRect$1(getDocumentElement$1(element)));
|
|
50430
50766
|
}
|
|
50431
50767
|
function getClippingParents(element) {
|
|
50432
50768
|
var clippingParents2 = listScrollParents(getParentNode$1(element));
|
|
50433
|
-
var canEscapeClipping = ["absolute", "fixed"].indexOf(getComputedStyle$
|
|
50434
|
-
var clipperElement = canEscapeClipping && isHTMLElement$1(element) ? getOffsetParent(element) : element;
|
|
50435
|
-
if (!isElement$
|
|
50769
|
+
var canEscapeClipping = ["absolute", "fixed"].indexOf(getComputedStyle$2(element).position) >= 0;
|
|
50770
|
+
var clipperElement = canEscapeClipping && isHTMLElement$1(element) ? getOffsetParent$1(element) : element;
|
|
50771
|
+
if (!isElement$2(clipperElement)) {
|
|
50436
50772
|
return [];
|
|
50437
50773
|
}
|
|
50438
50774
|
return clippingParents2.filter(function(clippingParent) {
|
|
50439
|
-
return isElement$
|
|
50775
|
+
return isElement$2(clippingParent) && contains$1(clippingParent, clipperElement) && getNodeName$1(clippingParent) !== "body";
|
|
50440
50776
|
});
|
|
50441
50777
|
}
|
|
50442
|
-
function getClippingRect(element, boundary, rootBoundary, strategy) {
|
|
50778
|
+
function getClippingRect$1(element, boundary, rootBoundary, strategy) {
|
|
50443
50779
|
var mainClippingParents = boundary === "clippingParents" ? getClippingParents(element) : [].concat(boundary);
|
|
50444
50780
|
var clippingParents2 = [].concat(mainClippingParents, [rootBoundary]);
|
|
50445
50781
|
var firstClippingParent = clippingParents2[0];
|
|
50446
50782
|
var clippingRect = clippingParents2.reduce(function(accRect, clippingParent) {
|
|
50447
50783
|
var rect = getClientRectFromMixedType(element, clippingParent, strategy);
|
|
50448
|
-
accRect.top = max(rect.top, accRect.top);
|
|
50449
|
-
accRect.right = min(rect.right, accRect.right);
|
|
50450
|
-
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
50451
|
-
accRect.left = max(rect.left, accRect.left);
|
|
50784
|
+
accRect.top = max$1(rect.top, accRect.top);
|
|
50785
|
+
accRect.right = min$1(rect.right, accRect.right);
|
|
50786
|
+
accRect.bottom = min$1(rect.bottom, accRect.bottom);
|
|
50787
|
+
accRect.left = max$1(rect.left, accRect.left);
|
|
50452
50788
|
return accRect;
|
|
50453
50789
|
}, getClientRectFromMixedType(element, firstClippingParent, strategy));
|
|
50454
50790
|
clippingRect.width = clippingRect.right - clippingRect.left;
|
|
@@ -50509,7 +50845,7 @@ function computeOffsets(_ref) {
|
|
|
50509
50845
|
}
|
|
50510
50846
|
return offsets;
|
|
50511
50847
|
}
|
|
50512
|
-
function detectOverflow(state2, options2) {
|
|
50848
|
+
function detectOverflow$1(state2, options2) {
|
|
50513
50849
|
if (options2 === void 0) {
|
|
50514
50850
|
options2 = {};
|
|
50515
50851
|
}
|
|
@@ -50518,14 +50854,14 @@ function detectOverflow(state2, options2) {
|
|
|
50518
50854
|
var altContext = elementContext === popper ? reference : popper;
|
|
50519
50855
|
var popperRect = state2.rects.popper;
|
|
50520
50856
|
var element = state2.elements[altBoundary ? altContext : elementContext];
|
|
50521
|
-
var clippingClientRect = getClippingRect(isElement$
|
|
50522
|
-
var referenceClientRect = getBoundingClientRect(state2.elements.reference);
|
|
50857
|
+
var clippingClientRect = getClippingRect$1(isElement$2(element) ? element : element.contextElement || getDocumentElement$1(state2.elements.popper), boundary, rootBoundary, strategy);
|
|
50858
|
+
var referenceClientRect = getBoundingClientRect$1(state2.elements.reference);
|
|
50523
50859
|
var popperOffsets2 = computeOffsets({
|
|
50524
50860
|
reference: referenceClientRect,
|
|
50525
50861
|
element: popperRect,
|
|
50526
50862
|
placement
|
|
50527
50863
|
});
|
|
50528
|
-
var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets2));
|
|
50864
|
+
var popperClientRect = rectToClientRect$1(Object.assign({}, popperRect, popperOffsets2));
|
|
50529
50865
|
var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect;
|
|
50530
50866
|
var overflowOffsets = {
|
|
50531
50867
|
top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
|
|
@@ -50560,7 +50896,7 @@ function computeAutoPlacement(state2, options2) {
|
|
|
50560
50896
|
allowedPlacements = placements$1;
|
|
50561
50897
|
}
|
|
50562
50898
|
var overflows = allowedPlacements.reduce(function(acc, placement2) {
|
|
50563
|
-
acc[placement2] = detectOverflow(state2, {
|
|
50899
|
+
acc[placement2] = detectOverflow$1(state2, {
|
|
50564
50900
|
placement: placement2,
|
|
50565
50901
|
boundary,
|
|
50566
50902
|
rootBoundary,
|
|
@@ -50610,7 +50946,7 @@ function flip(_ref) {
|
|
|
50610
50946
|
var isStartVariation = getVariation(placement) === start;
|
|
50611
50947
|
var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
|
|
50612
50948
|
var len = isVertical ? "width" : "height";
|
|
50613
|
-
var overflow = detectOverflow(state2, {
|
|
50949
|
+
var overflow = detectOverflow$1(state2, {
|
|
50614
50950
|
placement,
|
|
50615
50951
|
boundary,
|
|
50616
50952
|
rootBoundary,
|
|
@@ -50675,7 +51011,7 @@ const flip$1 = {
|
|
|
50675
51011
|
_skip: false
|
|
50676
51012
|
}
|
|
50677
51013
|
};
|
|
50678
|
-
function getSideOffsets(overflow, rect, preventedOffsets) {
|
|
51014
|
+
function getSideOffsets$1(overflow, rect, preventedOffsets) {
|
|
50679
51015
|
if (preventedOffsets === void 0) {
|
|
50680
51016
|
preventedOffsets = {
|
|
50681
51017
|
x: 0,
|
|
@@ -50689,26 +51025,26 @@ function getSideOffsets(overflow, rect, preventedOffsets) {
|
|
|
50689
51025
|
left: overflow.left - rect.width - preventedOffsets.x
|
|
50690
51026
|
};
|
|
50691
51027
|
}
|
|
50692
|
-
function isAnySideFullyClipped(overflow) {
|
|
51028
|
+
function isAnySideFullyClipped$1(overflow) {
|
|
50693
51029
|
return [top, right, bottom, left].some(function(side) {
|
|
50694
51030
|
return overflow[side] >= 0;
|
|
50695
51031
|
});
|
|
50696
51032
|
}
|
|
50697
|
-
function hide(_ref) {
|
|
51033
|
+
function hide$2(_ref) {
|
|
50698
51034
|
var state2 = _ref.state, name = _ref.name;
|
|
50699
51035
|
var referenceRect = state2.rects.reference;
|
|
50700
51036
|
var popperRect = state2.rects.popper;
|
|
50701
51037
|
var preventedOffsets = state2.modifiersData.preventOverflow;
|
|
50702
|
-
var referenceOverflow = detectOverflow(state2, {
|
|
51038
|
+
var referenceOverflow = detectOverflow$1(state2, {
|
|
50703
51039
|
elementContext: "reference"
|
|
50704
51040
|
});
|
|
50705
|
-
var popperAltOverflow = detectOverflow(state2, {
|
|
51041
|
+
var popperAltOverflow = detectOverflow$1(state2, {
|
|
50706
51042
|
altBoundary: true
|
|
50707
51043
|
});
|
|
50708
|
-
var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
|
|
50709
|
-
var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
|
|
50710
|
-
var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
|
|
50711
|
-
var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
|
|
51044
|
+
var referenceClippingOffsets = getSideOffsets$1(referenceOverflow, referenceRect);
|
|
51045
|
+
var popperEscapeOffsets = getSideOffsets$1(popperAltOverflow, popperRect, preventedOffsets);
|
|
51046
|
+
var isReferenceHidden = isAnySideFullyClipped$1(referenceClippingOffsets);
|
|
51047
|
+
var hasPopperEscaped = isAnySideFullyClipped$1(popperEscapeOffsets);
|
|
50712
51048
|
state2.modifiersData[name] = {
|
|
50713
51049
|
referenceClippingOffsets,
|
|
50714
51050
|
popperEscapeOffsets,
|
|
@@ -50720,12 +51056,12 @@ function hide(_ref) {
|
|
|
50720
51056
|
"data-popper-escaped": hasPopperEscaped
|
|
50721
51057
|
});
|
|
50722
51058
|
}
|
|
50723
|
-
const hide$
|
|
51059
|
+
const hide$3 = {
|
|
50724
51060
|
name: "hide",
|
|
50725
51061
|
enabled: true,
|
|
50726
51062
|
phase: "main",
|
|
50727
51063
|
requiresIfExists: ["preventOverflow"],
|
|
50728
|
-
fn: hide
|
|
51064
|
+
fn: hide$2
|
|
50729
51065
|
};
|
|
50730
51066
|
function distanceAndSkiddingToXY(placement, rects, offset2) {
|
|
50731
51067
|
var basePlacement = getBasePlacement$1(placement);
|
|
@@ -50785,7 +51121,7 @@ function getAltAxis(axis) {
|
|
|
50785
51121
|
function preventOverflow(_ref) {
|
|
50786
51122
|
var state2 = _ref.state, options2 = _ref.options, name = _ref.name;
|
|
50787
51123
|
var _options$mainAxis = options2.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options2.altAxis, checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, boundary = options2.boundary, rootBoundary = options2.rootBoundary, altBoundary = options2.altBoundary, padding = options2.padding, _options$tether = options2.tether, tether = _options$tether === void 0 ? true : _options$tether, _options$tetherOffset = options2.tetherOffset, tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
|
|
50788
|
-
var overflow = detectOverflow(state2, {
|
|
51124
|
+
var overflow = detectOverflow$1(state2, {
|
|
50789
51125
|
boundary,
|
|
50790
51126
|
rootBoundary,
|
|
50791
51127
|
padding,
|
|
@@ -50823,8 +51159,8 @@ function preventOverflow(_ref) {
|
|
|
50823
51159
|
var altSide = mainAxis === "y" ? bottom : right;
|
|
50824
51160
|
var len = mainAxis === "y" ? "height" : "width";
|
|
50825
51161
|
var offset2 = popperOffsets2[mainAxis];
|
|
50826
|
-
var
|
|
50827
|
-
var
|
|
51162
|
+
var min2 = offset2 + overflow[mainSide];
|
|
51163
|
+
var max2 = offset2 - overflow[altSide];
|
|
50828
51164
|
var additive = tether ? -popperRect[len] / 2 : 0;
|
|
50829
51165
|
var minLen = variation === start ? referenceRect[len] : popperRect[len];
|
|
50830
51166
|
var maxLen = variation === start ? -popperRect[len] : -referenceRect[len];
|
|
@@ -50839,12 +51175,12 @@ function preventOverflow(_ref) {
|
|
|
50839
51175
|
var arrowLen = within(0, referenceRect[len], arrowRect[len]);
|
|
50840
51176
|
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
|
|
50841
51177
|
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
|
|
50842
|
-
var arrowOffsetParent = state2.elements.arrow && getOffsetParent(state2.elements.arrow);
|
|
51178
|
+
var arrowOffsetParent = state2.elements.arrow && getOffsetParent$1(state2.elements.arrow);
|
|
50843
51179
|
var clientOffset = arrowOffsetParent ? mainAxis === "y" ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
|
|
50844
51180
|
var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
|
|
50845
51181
|
var tetherMin = offset2 + minOffset - offsetModifierValue - clientOffset;
|
|
50846
51182
|
var tetherMax = offset2 + maxOffset - offsetModifierValue;
|
|
50847
|
-
var preventedOffset = within(tether ? min(
|
|
51183
|
+
var preventedOffset = within(tether ? min$1(min2, tetherMin) : min2, offset2, tether ? max$1(max2, tetherMax) : max2);
|
|
50848
51184
|
popperOffsets2[mainAxis] = preventedOffset;
|
|
50849
51185
|
data[mainAxis] = preventedOffset - offset2;
|
|
50850
51186
|
}
|
|
@@ -50879,8 +51215,8 @@ function getHTMLElementScroll(element) {
|
|
|
50879
51215
|
scrollTop: element.scrollTop
|
|
50880
51216
|
};
|
|
50881
51217
|
}
|
|
50882
|
-
function getNodeScroll(node2) {
|
|
50883
|
-
if (node2 === getWindow(node2) || !isHTMLElement$1(node2)) {
|
|
51218
|
+
function getNodeScroll$1(node2) {
|
|
51219
|
+
if (node2 === getWindow$1(node2) || !isHTMLElement$1(node2)) {
|
|
50884
51220
|
return getWindowScroll(node2);
|
|
50885
51221
|
} else {
|
|
50886
51222
|
return getHTMLElementScroll(node2);
|
|
@@ -50888,8 +51224,8 @@ function getNodeScroll(node2) {
|
|
|
50888
51224
|
}
|
|
50889
51225
|
function isElementScaled(element) {
|
|
50890
51226
|
var rect = element.getBoundingClientRect();
|
|
50891
|
-
var scaleX = round(rect.width) / element.offsetWidth || 1;
|
|
50892
|
-
var scaleY = round(rect.height) / element.offsetHeight || 1;
|
|
51227
|
+
var scaleX = round$1(rect.width) / element.offsetWidth || 1;
|
|
51228
|
+
var scaleY = round$1(rect.height) / element.offsetHeight || 1;
|
|
50893
51229
|
return scaleX !== 1 || scaleY !== 1;
|
|
50894
51230
|
}
|
|
50895
51231
|
function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
@@ -50898,8 +51234,8 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
|
50898
51234
|
}
|
|
50899
51235
|
var isOffsetParentAnElement = isHTMLElement$1(offsetParent);
|
|
50900
51236
|
var offsetParentIsScaled = isHTMLElement$1(offsetParent) && isElementScaled(offsetParent);
|
|
50901
|
-
var documentElement = getDocumentElement(offsetParent);
|
|
50902
|
-
var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);
|
|
51237
|
+
var documentElement = getDocumentElement$1(offsetParent);
|
|
51238
|
+
var rect = getBoundingClientRect$1(elementOrVirtualElement, offsetParentIsScaled, isFixed);
|
|
50903
51239
|
var scroll = {
|
|
50904
51240
|
scrollLeft: 0,
|
|
50905
51241
|
scrollTop: 0
|
|
@@ -50909,16 +51245,16 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
|
50909
51245
|
y: 0
|
|
50910
51246
|
};
|
|
50911
51247
|
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
50912
|
-
if (getNodeName(offsetParent) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
|
|
51248
|
+
if (getNodeName$1(offsetParent) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
|
|
50913
51249
|
isScrollParent(documentElement)) {
|
|
50914
|
-
scroll = getNodeScroll(offsetParent);
|
|
51250
|
+
scroll = getNodeScroll$1(offsetParent);
|
|
50915
51251
|
}
|
|
50916
51252
|
if (isHTMLElement$1(offsetParent)) {
|
|
50917
|
-
offsets = getBoundingClientRect(offsetParent, true);
|
|
51253
|
+
offsets = getBoundingClientRect$1(offsetParent, true);
|
|
50918
51254
|
offsets.x += offsetParent.clientLeft;
|
|
50919
51255
|
offsets.y += offsetParent.clientTop;
|
|
50920
51256
|
} else if (documentElement) {
|
|
50921
|
-
offsets.x = getWindowScrollBarX(documentElement);
|
|
51257
|
+
offsets.x = getWindowScrollBarX$1(documentElement);
|
|
50922
51258
|
}
|
|
50923
51259
|
}
|
|
50924
51260
|
return {
|
|
@@ -51033,7 +51369,7 @@ function popperGenerator(generatorOptions) {
|
|
|
51033
51369
|
cleanupModifierEffects();
|
|
51034
51370
|
state2.options = Object.assign({}, defaultOptions, state2.options, options22);
|
|
51035
51371
|
state2.scrollParents = {
|
|
51036
|
-
reference: isElement$
|
|
51372
|
+
reference: isElement$2(reference2) ? listScrollParents(reference2) : reference2.contextElement ? listScrollParents(reference2.contextElement) : [],
|
|
51037
51373
|
popper: listScrollParents(popper2)
|
|
51038
51374
|
};
|
|
51039
51375
|
var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers2, state2.options.modifiers)));
|
|
@@ -51057,7 +51393,7 @@ function popperGenerator(generatorOptions) {
|
|
|
51057
51393
|
return;
|
|
51058
51394
|
}
|
|
51059
51395
|
state2.rects = {
|
|
51060
|
-
reference: getCompositeRect(reference3, getOffsetParent(popper3), state2.options.strategy === "fixed"),
|
|
51396
|
+
reference: getCompositeRect(reference3, getOffsetParent$1(popper3), state2.options.strategy === "fixed"),
|
|
51061
51397
|
popper: getLayoutRect(popper3)
|
|
51062
51398
|
};
|
|
51063
51399
|
state2.reset = false;
|
|
@@ -51128,7 +51464,7 @@ function popperGenerator(generatorOptions) {
|
|
|
51128
51464
|
return instance;
|
|
51129
51465
|
};
|
|
51130
51466
|
}
|
|
51131
|
-
var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$
|
|
51467
|
+
var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$3];
|
|
51132
51468
|
var createPopper = /* @__PURE__ */ popperGenerator({
|
|
51133
51469
|
defaultModifiers
|
|
51134
51470
|
});
|
|
@@ -51213,7 +51549,7 @@ function removeUndefinedProps(obj) {
|
|
|
51213
51549
|
function div() {
|
|
51214
51550
|
return document.createElement("div");
|
|
51215
51551
|
}
|
|
51216
|
-
function isElement$
|
|
51552
|
+
function isElement$1(value) {
|
|
51217
51553
|
return ["Element", "Fragment"].some(function(type2) {
|
|
51218
51554
|
return isType(value, type2);
|
|
51219
51555
|
});
|
|
@@ -51228,7 +51564,7 @@ function isReferenceElement(value) {
|
|
|
51228
51564
|
return !!(value && value._tippy && value._tippy.reference === value);
|
|
51229
51565
|
}
|
|
51230
51566
|
function getArrayOfElements(value) {
|
|
51231
|
-
if (isElement$
|
|
51567
|
+
if (isElement$1(value)) {
|
|
51232
51568
|
return [value];
|
|
51233
51569
|
}
|
|
51234
51570
|
if (isNodeList(value)) {
|
|
@@ -51537,7 +51873,7 @@ function createArrowElement(value) {
|
|
|
51537
51873
|
arrow2.className = ARROW_CLASS;
|
|
51538
51874
|
} else {
|
|
51539
51875
|
arrow2.className = SVG_ARROW_CLASS;
|
|
51540
|
-
if (isElement$
|
|
51876
|
+
if (isElement$1(value)) {
|
|
51541
51877
|
arrow2.appendChild(value);
|
|
51542
51878
|
} else {
|
|
51543
51879
|
dangerouslySetInnerHTML(arrow2, value);
|
|
@@ -51546,7 +51882,7 @@ function createArrowElement(value) {
|
|
|
51546
51882
|
return arrow2;
|
|
51547
51883
|
}
|
|
51548
51884
|
function setContent(content, props) {
|
|
51549
|
-
if (isElement$
|
|
51885
|
+
if (isElement$1(props.content)) {
|
|
51550
51886
|
dangerouslySetInnerHTML(content, "");
|
|
51551
51887
|
content.appendChild(props.content);
|
|
51552
51888
|
} else if (typeof props.content !== "function") {
|
|
@@ -52369,7 +52705,7 @@ function tippy(targets, optionalProps) {
|
|
|
52369
52705
|
});
|
|
52370
52706
|
var elements = getArrayOfElements(targets);
|
|
52371
52707
|
if (process$1$1.env.NODE_ENV !== "production") {
|
|
52372
|
-
var isSingleContentElement = isElement$
|
|
52708
|
+
var isSingleContentElement = isElement$1(passedProps.content);
|
|
52373
52709
|
var isMoreThanOneReferenceElement = elements.length > 1;
|
|
52374
52710
|
warnWhen(isSingleContentElement && isMoreThanOneReferenceElement, ["tippy() was passed an Element as the `content` prop, but more than", "one tippy instance was created by this invocation. This means the", "content element will only be appended to the last tippy instance.", "\n\n", "Instead, pass the .innerHTML of the element, or use a function that", "returns a cloned version of the element instead.", "\n\n", "1) content: element.innerHTML\n", "2) content: () => element.cloneNode(true)"].join(" "));
|
|
52375
52711
|
}
|
|
@@ -52380,7 +52716,7 @@ function tippy(targets, optionalProps) {
|
|
|
52380
52716
|
}
|
|
52381
52717
|
return acc;
|
|
52382
52718
|
}, []);
|
|
52383
|
-
return isElement$
|
|
52719
|
+
return isElement$1(targets) ? instances[0] : instances;
|
|
52384
52720
|
}
|
|
52385
52721
|
tippy.defaultProps = defaultProps;
|
|
52386
52722
|
tippy.setDefaultProps = setDefaultProps;
|
|
@@ -52649,7 +52985,1067 @@ class Popover {
|
|
|
52649
52985
|
this.popover.remove();
|
|
52650
52986
|
}
|
|
52651
52987
|
}
|
|
52988
|
+
const sides = ["top", "right", "bottom", "left"];
|
|
52989
|
+
const min = Math.min;
|
|
52990
|
+
const max = Math.max;
|
|
52991
|
+
const round = Math.round;
|
|
52992
|
+
const floor = Math.floor;
|
|
52993
|
+
const createCoords = (v) => ({
|
|
52994
|
+
x: v,
|
|
52995
|
+
y: v
|
|
52996
|
+
});
|
|
52997
|
+
function evaluate(value, param) {
|
|
52998
|
+
return typeof value === "function" ? value(param) : value;
|
|
52999
|
+
}
|
|
53000
|
+
function getSide(placement) {
|
|
53001
|
+
return placement.split("-")[0];
|
|
53002
|
+
}
|
|
53003
|
+
function getAlignment(placement) {
|
|
53004
|
+
return placement.split("-")[1];
|
|
53005
|
+
}
|
|
53006
|
+
function getOppositeAxis(axis) {
|
|
53007
|
+
return axis === "x" ? "y" : "x";
|
|
53008
|
+
}
|
|
53009
|
+
function getAxisLength(axis) {
|
|
53010
|
+
return axis === "y" ? "height" : "width";
|
|
53011
|
+
}
|
|
53012
|
+
function getSideAxis(placement) {
|
|
53013
|
+
return ["top", "bottom"].includes(getSide(placement)) ? "y" : "x";
|
|
53014
|
+
}
|
|
53015
|
+
function getAlignmentAxis(placement) {
|
|
53016
|
+
return getOppositeAxis(getSideAxis(placement));
|
|
53017
|
+
}
|
|
53018
|
+
function expandPaddingObject(padding) {
|
|
53019
|
+
return {
|
|
53020
|
+
top: 0,
|
|
53021
|
+
right: 0,
|
|
53022
|
+
bottom: 0,
|
|
53023
|
+
left: 0,
|
|
53024
|
+
...padding
|
|
53025
|
+
};
|
|
53026
|
+
}
|
|
53027
|
+
function getPaddingObject(padding) {
|
|
53028
|
+
return typeof padding !== "number" ? expandPaddingObject(padding) : {
|
|
53029
|
+
top: padding,
|
|
53030
|
+
right: padding,
|
|
53031
|
+
bottom: padding,
|
|
53032
|
+
left: padding
|
|
53033
|
+
};
|
|
53034
|
+
}
|
|
53035
|
+
function rectToClientRect(rect) {
|
|
53036
|
+
const {
|
|
53037
|
+
x,
|
|
53038
|
+
y,
|
|
53039
|
+
width,
|
|
53040
|
+
height
|
|
53041
|
+
} = rect;
|
|
53042
|
+
return {
|
|
53043
|
+
width,
|
|
53044
|
+
height,
|
|
53045
|
+
top: y,
|
|
53046
|
+
left: x,
|
|
53047
|
+
right: x + width,
|
|
53048
|
+
bottom: y + height,
|
|
53049
|
+
x,
|
|
53050
|
+
y
|
|
53051
|
+
};
|
|
53052
|
+
}
|
|
53053
|
+
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
53054
|
+
let {
|
|
53055
|
+
reference: reference2,
|
|
53056
|
+
floating
|
|
53057
|
+
} = _ref;
|
|
53058
|
+
const sideAxis = getSideAxis(placement);
|
|
53059
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
53060
|
+
const alignLength = getAxisLength(alignmentAxis);
|
|
53061
|
+
const side = getSide(placement);
|
|
53062
|
+
const isVertical = sideAxis === "y";
|
|
53063
|
+
const commonX = reference2.x + reference2.width / 2 - floating.width / 2;
|
|
53064
|
+
const commonY = reference2.y + reference2.height / 2 - floating.height / 2;
|
|
53065
|
+
const commonAlign = reference2[alignLength] / 2 - floating[alignLength] / 2;
|
|
53066
|
+
let coords;
|
|
53067
|
+
switch (side) {
|
|
53068
|
+
case "top":
|
|
53069
|
+
coords = {
|
|
53070
|
+
x: commonX,
|
|
53071
|
+
y: reference2.y - floating.height
|
|
53072
|
+
};
|
|
53073
|
+
break;
|
|
53074
|
+
case "bottom":
|
|
53075
|
+
coords = {
|
|
53076
|
+
x: commonX,
|
|
53077
|
+
y: reference2.y + reference2.height
|
|
53078
|
+
};
|
|
53079
|
+
break;
|
|
53080
|
+
case "right":
|
|
53081
|
+
coords = {
|
|
53082
|
+
x: reference2.x + reference2.width,
|
|
53083
|
+
y: commonY
|
|
53084
|
+
};
|
|
53085
|
+
break;
|
|
53086
|
+
case "left":
|
|
53087
|
+
coords = {
|
|
53088
|
+
x: reference2.x - floating.width,
|
|
53089
|
+
y: commonY
|
|
53090
|
+
};
|
|
53091
|
+
break;
|
|
53092
|
+
default:
|
|
53093
|
+
coords = {
|
|
53094
|
+
x: reference2.x,
|
|
53095
|
+
y: reference2.y
|
|
53096
|
+
};
|
|
53097
|
+
}
|
|
53098
|
+
switch (getAlignment(placement)) {
|
|
53099
|
+
case "start":
|
|
53100
|
+
coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
|
|
53101
|
+
break;
|
|
53102
|
+
case "end":
|
|
53103
|
+
coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
|
53104
|
+
break;
|
|
53105
|
+
}
|
|
53106
|
+
return coords;
|
|
53107
|
+
}
|
|
53108
|
+
const computePosition$1 = async (reference2, floating, config) => {
|
|
53109
|
+
const {
|
|
53110
|
+
placement = "bottom",
|
|
53111
|
+
strategy = "absolute",
|
|
53112
|
+
middleware = [],
|
|
53113
|
+
platform: platform2
|
|
53114
|
+
} = config;
|
|
53115
|
+
const validMiddleware = middleware.filter(Boolean);
|
|
53116
|
+
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating));
|
|
53117
|
+
let rects = await platform2.getElementRects({
|
|
53118
|
+
reference: reference2,
|
|
53119
|
+
floating,
|
|
53120
|
+
strategy
|
|
53121
|
+
});
|
|
53122
|
+
let {
|
|
53123
|
+
x,
|
|
53124
|
+
y
|
|
53125
|
+
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
53126
|
+
let statefulPlacement = placement;
|
|
53127
|
+
let middlewareData = {};
|
|
53128
|
+
let resetCount = 0;
|
|
53129
|
+
for (let i = 0; i < validMiddleware.length; i++) {
|
|
53130
|
+
const {
|
|
53131
|
+
name,
|
|
53132
|
+
fn: fn2
|
|
53133
|
+
} = validMiddleware[i];
|
|
53134
|
+
const {
|
|
53135
|
+
x: nextX,
|
|
53136
|
+
y: nextY,
|
|
53137
|
+
data,
|
|
53138
|
+
reset
|
|
53139
|
+
} = await fn2({
|
|
53140
|
+
x,
|
|
53141
|
+
y,
|
|
53142
|
+
initialPlacement: placement,
|
|
53143
|
+
placement: statefulPlacement,
|
|
53144
|
+
strategy,
|
|
53145
|
+
middlewareData,
|
|
53146
|
+
rects,
|
|
53147
|
+
platform: platform2,
|
|
53148
|
+
elements: {
|
|
53149
|
+
reference: reference2,
|
|
53150
|
+
floating
|
|
53151
|
+
}
|
|
53152
|
+
});
|
|
53153
|
+
x = nextX != null ? nextX : x;
|
|
53154
|
+
y = nextY != null ? nextY : y;
|
|
53155
|
+
middlewareData = {
|
|
53156
|
+
...middlewareData,
|
|
53157
|
+
[name]: {
|
|
53158
|
+
...middlewareData[name],
|
|
53159
|
+
...data
|
|
53160
|
+
}
|
|
53161
|
+
};
|
|
53162
|
+
if (reset && resetCount <= 50) {
|
|
53163
|
+
resetCount++;
|
|
53164
|
+
if (typeof reset === "object") {
|
|
53165
|
+
if (reset.placement) {
|
|
53166
|
+
statefulPlacement = reset.placement;
|
|
53167
|
+
}
|
|
53168
|
+
if (reset.rects) {
|
|
53169
|
+
rects = reset.rects === true ? await platform2.getElementRects({
|
|
53170
|
+
reference: reference2,
|
|
53171
|
+
floating,
|
|
53172
|
+
strategy
|
|
53173
|
+
}) : reset.rects;
|
|
53174
|
+
}
|
|
53175
|
+
({
|
|
53176
|
+
x,
|
|
53177
|
+
y
|
|
53178
|
+
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
53179
|
+
}
|
|
53180
|
+
i = -1;
|
|
53181
|
+
}
|
|
53182
|
+
}
|
|
53183
|
+
return {
|
|
53184
|
+
x,
|
|
53185
|
+
y,
|
|
53186
|
+
placement: statefulPlacement,
|
|
53187
|
+
strategy,
|
|
53188
|
+
middlewareData
|
|
53189
|
+
};
|
|
53190
|
+
};
|
|
53191
|
+
async function detectOverflow(state2, options2) {
|
|
53192
|
+
var _await$platform$isEle;
|
|
53193
|
+
if (options2 === void 0) {
|
|
53194
|
+
options2 = {};
|
|
53195
|
+
}
|
|
53196
|
+
const {
|
|
53197
|
+
x,
|
|
53198
|
+
y,
|
|
53199
|
+
platform: platform2,
|
|
53200
|
+
rects,
|
|
53201
|
+
elements,
|
|
53202
|
+
strategy
|
|
53203
|
+
} = state2;
|
|
53204
|
+
const {
|
|
53205
|
+
boundary = "clippingAncestors",
|
|
53206
|
+
rootBoundary = "viewport",
|
|
53207
|
+
elementContext = "floating",
|
|
53208
|
+
altBoundary = false,
|
|
53209
|
+
padding = 0
|
|
53210
|
+
} = evaluate(options2, state2);
|
|
53211
|
+
const paddingObject = getPaddingObject(padding);
|
|
53212
|
+
const altContext = elementContext === "floating" ? "reference" : "floating";
|
|
53213
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
53214
|
+
const clippingClientRect = rectToClientRect(await platform2.getClippingRect({
|
|
53215
|
+
element: ((_await$platform$isEle = await (platform2.isElement == null ? void 0 : platform2.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating)),
|
|
53216
|
+
boundary,
|
|
53217
|
+
rootBoundary,
|
|
53218
|
+
strategy
|
|
53219
|
+
}));
|
|
53220
|
+
const rect = elementContext === "floating" ? {
|
|
53221
|
+
x,
|
|
53222
|
+
y,
|
|
53223
|
+
width: rects.floating.width,
|
|
53224
|
+
height: rects.floating.height
|
|
53225
|
+
} : rects.reference;
|
|
53226
|
+
const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating));
|
|
53227
|
+
const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
|
|
53228
|
+
x: 1,
|
|
53229
|
+
y: 1
|
|
53230
|
+
} : {
|
|
53231
|
+
x: 1,
|
|
53232
|
+
y: 1
|
|
53233
|
+
};
|
|
53234
|
+
const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
53235
|
+
elements,
|
|
53236
|
+
rect,
|
|
53237
|
+
offsetParent,
|
|
53238
|
+
strategy
|
|
53239
|
+
}) : rect);
|
|
53240
|
+
return {
|
|
53241
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
53242
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
53243
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
53244
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
53245
|
+
};
|
|
53246
|
+
}
|
|
53247
|
+
function getSideOffsets(overflow, rect) {
|
|
53248
|
+
return {
|
|
53249
|
+
top: overflow.top - rect.height,
|
|
53250
|
+
right: overflow.right - rect.width,
|
|
53251
|
+
bottom: overflow.bottom - rect.height,
|
|
53252
|
+
left: overflow.left - rect.width
|
|
53253
|
+
};
|
|
53254
|
+
}
|
|
53255
|
+
function isAnySideFullyClipped(overflow) {
|
|
53256
|
+
return sides.some((side) => overflow[side] >= 0);
|
|
53257
|
+
}
|
|
53258
|
+
const hide$1 = function(options2) {
|
|
53259
|
+
if (options2 === void 0) {
|
|
53260
|
+
options2 = {};
|
|
53261
|
+
}
|
|
53262
|
+
return {
|
|
53263
|
+
name: "hide",
|
|
53264
|
+
options: options2,
|
|
53265
|
+
async fn(state2) {
|
|
53266
|
+
const {
|
|
53267
|
+
rects
|
|
53268
|
+
} = state2;
|
|
53269
|
+
const {
|
|
53270
|
+
strategy = "referenceHidden",
|
|
53271
|
+
...detectOverflowOptions
|
|
53272
|
+
} = evaluate(options2, state2);
|
|
53273
|
+
switch (strategy) {
|
|
53274
|
+
case "referenceHidden": {
|
|
53275
|
+
const overflow = await detectOverflow(state2, {
|
|
53276
|
+
...detectOverflowOptions,
|
|
53277
|
+
elementContext: "reference"
|
|
53278
|
+
});
|
|
53279
|
+
const offsets = getSideOffsets(overflow, rects.reference);
|
|
53280
|
+
return {
|
|
53281
|
+
data: {
|
|
53282
|
+
referenceHiddenOffsets: offsets,
|
|
53283
|
+
referenceHidden: isAnySideFullyClipped(offsets)
|
|
53284
|
+
}
|
|
53285
|
+
};
|
|
53286
|
+
}
|
|
53287
|
+
case "escaped": {
|
|
53288
|
+
const overflow = await detectOverflow(state2, {
|
|
53289
|
+
...detectOverflowOptions,
|
|
53290
|
+
altBoundary: true
|
|
53291
|
+
});
|
|
53292
|
+
const offsets = getSideOffsets(overflow, rects.floating);
|
|
53293
|
+
return {
|
|
53294
|
+
data: {
|
|
53295
|
+
escapedOffsets: offsets,
|
|
53296
|
+
escaped: isAnySideFullyClipped(offsets)
|
|
53297
|
+
}
|
|
53298
|
+
};
|
|
53299
|
+
}
|
|
53300
|
+
default: {
|
|
53301
|
+
return {};
|
|
53302
|
+
}
|
|
53303
|
+
}
|
|
53304
|
+
}
|
|
53305
|
+
};
|
|
53306
|
+
};
|
|
53307
|
+
function hasWindow() {
|
|
53308
|
+
return typeof window !== "undefined";
|
|
53309
|
+
}
|
|
53310
|
+
function getNodeName(node2) {
|
|
53311
|
+
if (isNode(node2)) {
|
|
53312
|
+
return (node2.nodeName || "").toLowerCase();
|
|
53313
|
+
}
|
|
53314
|
+
return "#document";
|
|
53315
|
+
}
|
|
53316
|
+
function getWindow(node2) {
|
|
53317
|
+
var _node$ownerDocument;
|
|
53318
|
+
return (node2 == null || (_node$ownerDocument = node2.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
53319
|
+
}
|
|
53320
|
+
function getDocumentElement(node2) {
|
|
53321
|
+
var _ref;
|
|
53322
|
+
return (_ref = (isNode(node2) ? node2.ownerDocument : node2.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
53323
|
+
}
|
|
53324
|
+
function isNode(value) {
|
|
53325
|
+
if (!hasWindow()) {
|
|
53326
|
+
return false;
|
|
53327
|
+
}
|
|
53328
|
+
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
53329
|
+
}
|
|
53330
|
+
function isElement$3(value) {
|
|
53331
|
+
if (!hasWindow()) {
|
|
53332
|
+
return false;
|
|
53333
|
+
}
|
|
53334
|
+
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
53335
|
+
}
|
|
53336
|
+
function isHTMLElement$2(value) {
|
|
53337
|
+
if (!hasWindow()) {
|
|
53338
|
+
return false;
|
|
53339
|
+
}
|
|
53340
|
+
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
53341
|
+
}
|
|
53342
|
+
function isShadowRoot(value) {
|
|
53343
|
+
if (!hasWindow() || typeof ShadowRoot === "undefined") {
|
|
53344
|
+
return false;
|
|
53345
|
+
}
|
|
53346
|
+
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
53347
|
+
}
|
|
53348
|
+
function isOverflowElement(element) {
|
|
53349
|
+
const {
|
|
53350
|
+
overflow,
|
|
53351
|
+
overflowX,
|
|
53352
|
+
overflowY,
|
|
53353
|
+
display
|
|
53354
|
+
} = getComputedStyle$1(element);
|
|
53355
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !["inline", "contents"].includes(display);
|
|
53356
|
+
}
|
|
53357
|
+
function isTableElement(element) {
|
|
53358
|
+
return ["table", "td", "th"].includes(getNodeName(element));
|
|
53359
|
+
}
|
|
53360
|
+
function isTopLayer(element) {
|
|
53361
|
+
return [":popover-open", ":modal"].some((selector) => {
|
|
53362
|
+
try {
|
|
53363
|
+
return element.matches(selector);
|
|
53364
|
+
} catch (e) {
|
|
53365
|
+
return false;
|
|
53366
|
+
}
|
|
53367
|
+
});
|
|
53368
|
+
}
|
|
53369
|
+
function isContainingBlock(elementOrCss) {
|
|
53370
|
+
const webkit2 = isWebKit();
|
|
53371
|
+
const css = isElement$3(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
|
|
53372
|
+
return ["transform", "translate", "scale", "rotate", "perspective"].some((value) => css[value] ? css[value] !== "none" : false) || (css.containerType ? css.containerType !== "normal" : false) || !webkit2 && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit2 && (css.filter ? css.filter !== "none" : false) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((value) => (css.willChange || "").includes(value)) || ["paint", "layout", "strict", "content"].some((value) => (css.contain || "").includes(value));
|
|
53373
|
+
}
|
|
53374
|
+
function getContainingBlock(element) {
|
|
53375
|
+
let currentNode = getParentNode$2(element);
|
|
53376
|
+
while (isHTMLElement$2(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
53377
|
+
if (isContainingBlock(currentNode)) {
|
|
53378
|
+
return currentNode;
|
|
53379
|
+
} else if (isTopLayer(currentNode)) {
|
|
53380
|
+
return null;
|
|
53381
|
+
}
|
|
53382
|
+
currentNode = getParentNode$2(currentNode);
|
|
53383
|
+
}
|
|
53384
|
+
return null;
|
|
53385
|
+
}
|
|
53386
|
+
function isWebKit() {
|
|
53387
|
+
if (typeof CSS === "undefined" || !CSS.supports) return false;
|
|
53388
|
+
return CSS.supports("-webkit-backdrop-filter", "none");
|
|
53389
|
+
}
|
|
53390
|
+
function isLastTraversableNode(node2) {
|
|
53391
|
+
return ["html", "body", "#document"].includes(getNodeName(node2));
|
|
53392
|
+
}
|
|
53393
|
+
function getComputedStyle$1(element) {
|
|
53394
|
+
return getWindow(element).getComputedStyle(element);
|
|
53395
|
+
}
|
|
53396
|
+
function getNodeScroll(element) {
|
|
53397
|
+
if (isElement$3(element)) {
|
|
53398
|
+
return {
|
|
53399
|
+
scrollLeft: element.scrollLeft,
|
|
53400
|
+
scrollTop: element.scrollTop
|
|
53401
|
+
};
|
|
53402
|
+
}
|
|
53403
|
+
return {
|
|
53404
|
+
scrollLeft: element.scrollX,
|
|
53405
|
+
scrollTop: element.scrollY
|
|
53406
|
+
};
|
|
53407
|
+
}
|
|
53408
|
+
function getParentNode$2(node2) {
|
|
53409
|
+
if (getNodeName(node2) === "html") {
|
|
53410
|
+
return node2;
|
|
53411
|
+
}
|
|
53412
|
+
const result = (
|
|
53413
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
53414
|
+
node2.assignedSlot || // DOM Element detected.
|
|
53415
|
+
node2.parentNode || // ShadowRoot detected.
|
|
53416
|
+
isShadowRoot(node2) && node2.host || // Fallback.
|
|
53417
|
+
getDocumentElement(node2)
|
|
53418
|
+
);
|
|
53419
|
+
return isShadowRoot(result) ? result.host : result;
|
|
53420
|
+
}
|
|
53421
|
+
function getNearestOverflowAncestor(node2) {
|
|
53422
|
+
const parentNode2 = getParentNode$2(node2);
|
|
53423
|
+
if (isLastTraversableNode(parentNode2)) {
|
|
53424
|
+
return node2.ownerDocument ? node2.ownerDocument.body : node2.body;
|
|
53425
|
+
}
|
|
53426
|
+
if (isHTMLElement$2(parentNode2) && isOverflowElement(parentNode2)) {
|
|
53427
|
+
return parentNode2;
|
|
53428
|
+
}
|
|
53429
|
+
return getNearestOverflowAncestor(parentNode2);
|
|
53430
|
+
}
|
|
53431
|
+
function getOverflowAncestors(node2, list, traverseIframes) {
|
|
53432
|
+
var _node$ownerDocument2;
|
|
53433
|
+
if (list === void 0) {
|
|
53434
|
+
list = [];
|
|
53435
|
+
}
|
|
53436
|
+
if (traverseIframes === void 0) {
|
|
53437
|
+
traverseIframes = true;
|
|
53438
|
+
}
|
|
53439
|
+
const scrollableAncestor = getNearestOverflowAncestor(node2);
|
|
53440
|
+
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node2.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
53441
|
+
const win = getWindow(scrollableAncestor);
|
|
53442
|
+
if (isBody) {
|
|
53443
|
+
const frameElement = getFrameElement(win);
|
|
53444
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
|
|
53445
|
+
}
|
|
53446
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
53447
|
+
}
|
|
53448
|
+
function getFrameElement(win) {
|
|
53449
|
+
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
53450
|
+
}
|
|
53451
|
+
function getCssDimensions(element) {
|
|
53452
|
+
const css = getComputedStyle$1(element);
|
|
53453
|
+
let width = parseFloat(css.width) || 0;
|
|
53454
|
+
let height = parseFloat(css.height) || 0;
|
|
53455
|
+
const hasOffset = isHTMLElement$2(element);
|
|
53456
|
+
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
|
53457
|
+
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
|
53458
|
+
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
53459
|
+
if (shouldFallback) {
|
|
53460
|
+
width = offsetWidth;
|
|
53461
|
+
height = offsetHeight;
|
|
53462
|
+
}
|
|
53463
|
+
return {
|
|
53464
|
+
width,
|
|
53465
|
+
height,
|
|
53466
|
+
$: shouldFallback
|
|
53467
|
+
};
|
|
53468
|
+
}
|
|
53469
|
+
function unwrapElement(element) {
|
|
53470
|
+
return !isElement$3(element) ? element.contextElement : element;
|
|
53471
|
+
}
|
|
53472
|
+
function getScale(element) {
|
|
53473
|
+
const domElement = unwrapElement(element);
|
|
53474
|
+
if (!isHTMLElement$2(domElement)) {
|
|
53475
|
+
return createCoords(1);
|
|
53476
|
+
}
|
|
53477
|
+
const rect = domElement.getBoundingClientRect();
|
|
53478
|
+
const {
|
|
53479
|
+
width,
|
|
53480
|
+
height,
|
|
53481
|
+
$
|
|
53482
|
+
} = getCssDimensions(domElement);
|
|
53483
|
+
let x = ($ ? round(rect.width) : rect.width) / width;
|
|
53484
|
+
let y = ($ ? round(rect.height) : rect.height) / height;
|
|
53485
|
+
if (!x || !Number.isFinite(x)) {
|
|
53486
|
+
x = 1;
|
|
53487
|
+
}
|
|
53488
|
+
if (!y || !Number.isFinite(y)) {
|
|
53489
|
+
y = 1;
|
|
53490
|
+
}
|
|
53491
|
+
return {
|
|
53492
|
+
x,
|
|
53493
|
+
y
|
|
53494
|
+
};
|
|
53495
|
+
}
|
|
53496
|
+
const noOffsets = /* @__PURE__ */ createCoords(0);
|
|
53497
|
+
function getVisualOffsets(element) {
|
|
53498
|
+
const win = getWindow(element);
|
|
53499
|
+
if (!isWebKit() || !win.visualViewport) {
|
|
53500
|
+
return noOffsets;
|
|
53501
|
+
}
|
|
53502
|
+
return {
|
|
53503
|
+
x: win.visualViewport.offsetLeft,
|
|
53504
|
+
y: win.visualViewport.offsetTop
|
|
53505
|
+
};
|
|
53506
|
+
}
|
|
53507
|
+
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
53508
|
+
if (isFixed === void 0) {
|
|
53509
|
+
isFixed = false;
|
|
53510
|
+
}
|
|
53511
|
+
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
|
|
53512
|
+
return false;
|
|
53513
|
+
}
|
|
53514
|
+
return isFixed;
|
|
53515
|
+
}
|
|
53516
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
53517
|
+
if (includeScale === void 0) {
|
|
53518
|
+
includeScale = false;
|
|
53519
|
+
}
|
|
53520
|
+
if (isFixedStrategy === void 0) {
|
|
53521
|
+
isFixedStrategy = false;
|
|
53522
|
+
}
|
|
53523
|
+
const clientRect2 = element.getBoundingClientRect();
|
|
53524
|
+
const domElement = unwrapElement(element);
|
|
53525
|
+
let scale = createCoords(1);
|
|
53526
|
+
if (includeScale) {
|
|
53527
|
+
if (offsetParent) {
|
|
53528
|
+
if (isElement$3(offsetParent)) {
|
|
53529
|
+
scale = getScale(offsetParent);
|
|
53530
|
+
}
|
|
53531
|
+
} else {
|
|
53532
|
+
scale = getScale(element);
|
|
53533
|
+
}
|
|
53534
|
+
}
|
|
53535
|
+
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
|
53536
|
+
let x = (clientRect2.left + visualOffsets.x) / scale.x;
|
|
53537
|
+
let y = (clientRect2.top + visualOffsets.y) / scale.y;
|
|
53538
|
+
let width = clientRect2.width / scale.x;
|
|
53539
|
+
let height = clientRect2.height / scale.y;
|
|
53540
|
+
if (domElement) {
|
|
53541
|
+
const win = getWindow(domElement);
|
|
53542
|
+
const offsetWin = offsetParent && isElement$3(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
53543
|
+
let currentWin = win;
|
|
53544
|
+
let currentIFrame = getFrameElement(currentWin);
|
|
53545
|
+
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
|
53546
|
+
const iframeScale = getScale(currentIFrame);
|
|
53547
|
+
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
53548
|
+
const css = getComputedStyle$1(currentIFrame);
|
|
53549
|
+
const left2 = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
53550
|
+
const top2 = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
53551
|
+
x *= iframeScale.x;
|
|
53552
|
+
y *= iframeScale.y;
|
|
53553
|
+
width *= iframeScale.x;
|
|
53554
|
+
height *= iframeScale.y;
|
|
53555
|
+
x += left2;
|
|
53556
|
+
y += top2;
|
|
53557
|
+
currentWin = getWindow(currentIFrame);
|
|
53558
|
+
currentIFrame = getFrameElement(currentWin);
|
|
53559
|
+
}
|
|
53560
|
+
}
|
|
53561
|
+
return rectToClientRect({
|
|
53562
|
+
width,
|
|
53563
|
+
height,
|
|
53564
|
+
x,
|
|
53565
|
+
y
|
|
53566
|
+
});
|
|
53567
|
+
}
|
|
53568
|
+
function getWindowScrollBarX(element, rect) {
|
|
53569
|
+
const leftScroll = getNodeScroll(element).scrollLeft;
|
|
53570
|
+
if (!rect) {
|
|
53571
|
+
return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
|
|
53572
|
+
}
|
|
53573
|
+
return rect.left + leftScroll;
|
|
53574
|
+
}
|
|
53575
|
+
function getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {
|
|
53576
|
+
if (ignoreScrollbarX === void 0) {
|
|
53577
|
+
ignoreScrollbarX = false;
|
|
53578
|
+
}
|
|
53579
|
+
const htmlRect = documentElement.getBoundingClientRect();
|
|
53580
|
+
const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 : (
|
|
53581
|
+
// RTL <body> scrollbar.
|
|
53582
|
+
getWindowScrollBarX(documentElement, htmlRect)
|
|
53583
|
+
));
|
|
53584
|
+
const y = htmlRect.top + scroll.scrollTop;
|
|
53585
|
+
return {
|
|
53586
|
+
x,
|
|
53587
|
+
y
|
|
53588
|
+
};
|
|
53589
|
+
}
|
|
53590
|
+
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
53591
|
+
let {
|
|
53592
|
+
elements,
|
|
53593
|
+
rect,
|
|
53594
|
+
offsetParent,
|
|
53595
|
+
strategy
|
|
53596
|
+
} = _ref;
|
|
53597
|
+
const isFixed = strategy === "fixed";
|
|
53598
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
53599
|
+
const topLayer = elements ? isTopLayer(elements.floating) : false;
|
|
53600
|
+
if (offsetParent === documentElement || topLayer && isFixed) {
|
|
53601
|
+
return rect;
|
|
53602
|
+
}
|
|
53603
|
+
let scroll = {
|
|
53604
|
+
scrollLeft: 0,
|
|
53605
|
+
scrollTop: 0
|
|
53606
|
+
};
|
|
53607
|
+
let scale = createCoords(1);
|
|
53608
|
+
const offsets = createCoords(0);
|
|
53609
|
+
const isOffsetParentAnElement = isHTMLElement$2(offsetParent);
|
|
53610
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
53611
|
+
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
|
53612
|
+
scroll = getNodeScroll(offsetParent);
|
|
53613
|
+
}
|
|
53614
|
+
if (isHTMLElement$2(offsetParent)) {
|
|
53615
|
+
const offsetRect = getBoundingClientRect(offsetParent);
|
|
53616
|
+
scale = getScale(offsetParent);
|
|
53617
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
53618
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
53619
|
+
}
|
|
53620
|
+
}
|
|
53621
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);
|
|
53622
|
+
return {
|
|
53623
|
+
width: rect.width * scale.x,
|
|
53624
|
+
height: rect.height * scale.y,
|
|
53625
|
+
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
|
|
53626
|
+
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
|
|
53627
|
+
};
|
|
53628
|
+
}
|
|
53629
|
+
function getClientRects(element) {
|
|
53630
|
+
return Array.from(element.getClientRects());
|
|
53631
|
+
}
|
|
53632
|
+
function getDocumentRect(element) {
|
|
53633
|
+
const html = getDocumentElement(element);
|
|
53634
|
+
const scroll = getNodeScroll(element);
|
|
53635
|
+
const body = element.ownerDocument.body;
|
|
53636
|
+
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
53637
|
+
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
53638
|
+
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
53639
|
+
const y = -scroll.scrollTop;
|
|
53640
|
+
if (getComputedStyle$1(body).direction === "rtl") {
|
|
53641
|
+
x += max(html.clientWidth, body.clientWidth) - width;
|
|
53642
|
+
}
|
|
53643
|
+
return {
|
|
53644
|
+
width,
|
|
53645
|
+
height,
|
|
53646
|
+
x,
|
|
53647
|
+
y
|
|
53648
|
+
};
|
|
53649
|
+
}
|
|
53650
|
+
function getViewportRect(element, strategy) {
|
|
53651
|
+
const win = getWindow(element);
|
|
53652
|
+
const html = getDocumentElement(element);
|
|
53653
|
+
const visualViewport = win.visualViewport;
|
|
53654
|
+
let width = html.clientWidth;
|
|
53655
|
+
let height = html.clientHeight;
|
|
53656
|
+
let x = 0;
|
|
53657
|
+
let y = 0;
|
|
53658
|
+
if (visualViewport) {
|
|
53659
|
+
width = visualViewport.width;
|
|
53660
|
+
height = visualViewport.height;
|
|
53661
|
+
const visualViewportBased = isWebKit();
|
|
53662
|
+
if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
|
|
53663
|
+
x = visualViewport.offsetLeft;
|
|
53664
|
+
y = visualViewport.offsetTop;
|
|
53665
|
+
}
|
|
53666
|
+
}
|
|
53667
|
+
return {
|
|
53668
|
+
width,
|
|
53669
|
+
height,
|
|
53670
|
+
x,
|
|
53671
|
+
y
|
|
53672
|
+
};
|
|
53673
|
+
}
|
|
53674
|
+
function getInnerBoundingClientRect(element, strategy) {
|
|
53675
|
+
const clientRect2 = getBoundingClientRect(element, true, strategy === "fixed");
|
|
53676
|
+
const top2 = clientRect2.top + element.clientTop;
|
|
53677
|
+
const left2 = clientRect2.left + element.clientLeft;
|
|
53678
|
+
const scale = isHTMLElement$2(element) ? getScale(element) : createCoords(1);
|
|
53679
|
+
const width = element.clientWidth * scale.x;
|
|
53680
|
+
const height = element.clientHeight * scale.y;
|
|
53681
|
+
const x = left2 * scale.x;
|
|
53682
|
+
const y = top2 * scale.y;
|
|
53683
|
+
return {
|
|
53684
|
+
width,
|
|
53685
|
+
height,
|
|
53686
|
+
x,
|
|
53687
|
+
y
|
|
53688
|
+
};
|
|
53689
|
+
}
|
|
53690
|
+
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
53691
|
+
let rect;
|
|
53692
|
+
if (clippingAncestor === "viewport") {
|
|
53693
|
+
rect = getViewportRect(element, strategy);
|
|
53694
|
+
} else if (clippingAncestor === "document") {
|
|
53695
|
+
rect = getDocumentRect(getDocumentElement(element));
|
|
53696
|
+
} else if (isElement$3(clippingAncestor)) {
|
|
53697
|
+
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
53698
|
+
} else {
|
|
53699
|
+
const visualOffsets = getVisualOffsets(element);
|
|
53700
|
+
rect = {
|
|
53701
|
+
x: clippingAncestor.x - visualOffsets.x,
|
|
53702
|
+
y: clippingAncestor.y - visualOffsets.y,
|
|
53703
|
+
width: clippingAncestor.width,
|
|
53704
|
+
height: clippingAncestor.height
|
|
53705
|
+
};
|
|
53706
|
+
}
|
|
53707
|
+
return rectToClientRect(rect);
|
|
53708
|
+
}
|
|
53709
|
+
function hasFixedPositionAncestor(element, stopNode) {
|
|
53710
|
+
const parentNode2 = getParentNode$2(element);
|
|
53711
|
+
if (parentNode2 === stopNode || !isElement$3(parentNode2) || isLastTraversableNode(parentNode2)) {
|
|
53712
|
+
return false;
|
|
53713
|
+
}
|
|
53714
|
+
return getComputedStyle$1(parentNode2).position === "fixed" || hasFixedPositionAncestor(parentNode2, stopNode);
|
|
53715
|
+
}
|
|
53716
|
+
function getClippingElementAncestors(element, cache2) {
|
|
53717
|
+
const cachedResult2 = cache2.get(element);
|
|
53718
|
+
if (cachedResult2) {
|
|
53719
|
+
return cachedResult2;
|
|
53720
|
+
}
|
|
53721
|
+
let result = getOverflowAncestors(element, [], false).filter((el) => isElement$3(el) && getNodeName(el) !== "body");
|
|
53722
|
+
let currentContainingBlockComputedStyle = null;
|
|
53723
|
+
const elementIsFixed = getComputedStyle$1(element).position === "fixed";
|
|
53724
|
+
let currentNode = elementIsFixed ? getParentNode$2(element) : element;
|
|
53725
|
+
while (isElement$3(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
53726
|
+
const computedStyle = getComputedStyle$1(currentNode);
|
|
53727
|
+
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
53728
|
+
if (!currentNodeIsContaining && computedStyle.position === "fixed") {
|
|
53729
|
+
currentContainingBlockComputedStyle = null;
|
|
53730
|
+
}
|
|
53731
|
+
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && ["absolute", "fixed"].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
53732
|
+
if (shouldDropCurrentNode) {
|
|
53733
|
+
result = result.filter((ancestor) => ancestor !== currentNode);
|
|
53734
|
+
} else {
|
|
53735
|
+
currentContainingBlockComputedStyle = computedStyle;
|
|
53736
|
+
}
|
|
53737
|
+
currentNode = getParentNode$2(currentNode);
|
|
53738
|
+
}
|
|
53739
|
+
cache2.set(element, result);
|
|
53740
|
+
return result;
|
|
53741
|
+
}
|
|
53742
|
+
function getClippingRect(_ref) {
|
|
53743
|
+
let {
|
|
53744
|
+
element,
|
|
53745
|
+
boundary,
|
|
53746
|
+
rootBoundary,
|
|
53747
|
+
strategy
|
|
53748
|
+
} = _ref;
|
|
53749
|
+
const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
53750
|
+
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
53751
|
+
const firstClippingAncestor = clippingAncestors[0];
|
|
53752
|
+
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
53753
|
+
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
|
53754
|
+
accRect.top = max(rect.top, accRect.top);
|
|
53755
|
+
accRect.right = min(rect.right, accRect.right);
|
|
53756
|
+
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
53757
|
+
accRect.left = max(rect.left, accRect.left);
|
|
53758
|
+
return accRect;
|
|
53759
|
+
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
|
53760
|
+
return {
|
|
53761
|
+
width: clippingRect.right - clippingRect.left,
|
|
53762
|
+
height: clippingRect.bottom - clippingRect.top,
|
|
53763
|
+
x: clippingRect.left,
|
|
53764
|
+
y: clippingRect.top
|
|
53765
|
+
};
|
|
53766
|
+
}
|
|
53767
|
+
function getDimensions(element) {
|
|
53768
|
+
const {
|
|
53769
|
+
width,
|
|
53770
|
+
height
|
|
53771
|
+
} = getCssDimensions(element);
|
|
53772
|
+
return {
|
|
53773
|
+
width,
|
|
53774
|
+
height
|
|
53775
|
+
};
|
|
53776
|
+
}
|
|
53777
|
+
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
53778
|
+
const isOffsetParentAnElement = isHTMLElement$2(offsetParent);
|
|
53779
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
53780
|
+
const isFixed = strategy === "fixed";
|
|
53781
|
+
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
|
|
53782
|
+
let scroll = {
|
|
53783
|
+
scrollLeft: 0,
|
|
53784
|
+
scrollTop: 0
|
|
53785
|
+
};
|
|
53786
|
+
const offsets = createCoords(0);
|
|
53787
|
+
function setLeftRTLScrollbarOffset() {
|
|
53788
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
53789
|
+
}
|
|
53790
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
53791
|
+
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
|
53792
|
+
scroll = getNodeScroll(offsetParent);
|
|
53793
|
+
}
|
|
53794
|
+
if (isOffsetParentAnElement) {
|
|
53795
|
+
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
53796
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
53797
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
53798
|
+
} else if (documentElement) {
|
|
53799
|
+
setLeftRTLScrollbarOffset();
|
|
53800
|
+
}
|
|
53801
|
+
}
|
|
53802
|
+
if (isFixed && !isOffsetParentAnElement && documentElement) {
|
|
53803
|
+
setLeftRTLScrollbarOffset();
|
|
53804
|
+
}
|
|
53805
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
53806
|
+
const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
|
|
53807
|
+
const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
|
|
53808
|
+
return {
|
|
53809
|
+
x,
|
|
53810
|
+
y,
|
|
53811
|
+
width: rect.width,
|
|
53812
|
+
height: rect.height
|
|
53813
|
+
};
|
|
53814
|
+
}
|
|
53815
|
+
function isStaticPositioned(element) {
|
|
53816
|
+
return getComputedStyle$1(element).position === "static";
|
|
53817
|
+
}
|
|
53818
|
+
function getTrueOffsetParent(element, polyfill) {
|
|
53819
|
+
if (!isHTMLElement$2(element) || getComputedStyle$1(element).position === "fixed") {
|
|
53820
|
+
return null;
|
|
53821
|
+
}
|
|
53822
|
+
if (polyfill) {
|
|
53823
|
+
return polyfill(element);
|
|
53824
|
+
}
|
|
53825
|
+
let rawOffsetParent = element.offsetParent;
|
|
53826
|
+
if (getDocumentElement(element) === rawOffsetParent) {
|
|
53827
|
+
rawOffsetParent = rawOffsetParent.ownerDocument.body;
|
|
53828
|
+
}
|
|
53829
|
+
return rawOffsetParent;
|
|
53830
|
+
}
|
|
53831
|
+
function getOffsetParent(element, polyfill) {
|
|
53832
|
+
const win = getWindow(element);
|
|
53833
|
+
if (isTopLayer(element)) {
|
|
53834
|
+
return win;
|
|
53835
|
+
}
|
|
53836
|
+
if (!isHTMLElement$2(element)) {
|
|
53837
|
+
let svgOffsetParent = getParentNode$2(element);
|
|
53838
|
+
while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
|
|
53839
|
+
if (isElement$3(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
|
|
53840
|
+
return svgOffsetParent;
|
|
53841
|
+
}
|
|
53842
|
+
svgOffsetParent = getParentNode$2(svgOffsetParent);
|
|
53843
|
+
}
|
|
53844
|
+
return win;
|
|
53845
|
+
}
|
|
53846
|
+
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
53847
|
+
while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
|
|
53848
|
+
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
53849
|
+
}
|
|
53850
|
+
if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
|
|
53851
|
+
return win;
|
|
53852
|
+
}
|
|
53853
|
+
return offsetParent || getContainingBlock(element) || win;
|
|
53854
|
+
}
|
|
53855
|
+
const getElementRects = async function(data) {
|
|
53856
|
+
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
53857
|
+
const getDimensionsFn = this.getDimensions;
|
|
53858
|
+
const floatingDimensions = await getDimensionsFn(data.floating);
|
|
53859
|
+
return {
|
|
53860
|
+
reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
|
|
53861
|
+
floating: {
|
|
53862
|
+
x: 0,
|
|
53863
|
+
y: 0,
|
|
53864
|
+
width: floatingDimensions.width,
|
|
53865
|
+
height: floatingDimensions.height
|
|
53866
|
+
}
|
|
53867
|
+
};
|
|
53868
|
+
};
|
|
53869
|
+
function isRTL(element) {
|
|
53870
|
+
return getComputedStyle$1(element).direction === "rtl";
|
|
53871
|
+
}
|
|
53872
|
+
const platform = {
|
|
53873
|
+
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
53874
|
+
getDocumentElement,
|
|
53875
|
+
getClippingRect,
|
|
53876
|
+
getOffsetParent,
|
|
53877
|
+
getElementRects,
|
|
53878
|
+
getClientRects,
|
|
53879
|
+
getDimensions,
|
|
53880
|
+
getScale,
|
|
53881
|
+
isElement: isElement$3,
|
|
53882
|
+
isRTL
|
|
53883
|
+
};
|
|
53884
|
+
function rectsAreEqual(a, b) {
|
|
53885
|
+
return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
|
|
53886
|
+
}
|
|
53887
|
+
function observeMove(element, onMove) {
|
|
53888
|
+
let io = null;
|
|
53889
|
+
let timeoutId;
|
|
53890
|
+
const root2 = getDocumentElement(element);
|
|
53891
|
+
function cleanup() {
|
|
53892
|
+
var _io;
|
|
53893
|
+
clearTimeout(timeoutId);
|
|
53894
|
+
(_io = io) == null || _io.disconnect();
|
|
53895
|
+
io = null;
|
|
53896
|
+
}
|
|
53897
|
+
function refresh(skip, threshold) {
|
|
53898
|
+
if (skip === void 0) {
|
|
53899
|
+
skip = false;
|
|
53900
|
+
}
|
|
53901
|
+
if (threshold === void 0) {
|
|
53902
|
+
threshold = 1;
|
|
53903
|
+
}
|
|
53904
|
+
cleanup();
|
|
53905
|
+
const elementRectForRootMargin = element.getBoundingClientRect();
|
|
53906
|
+
const {
|
|
53907
|
+
left: left2,
|
|
53908
|
+
top: top2,
|
|
53909
|
+
width,
|
|
53910
|
+
height
|
|
53911
|
+
} = elementRectForRootMargin;
|
|
53912
|
+
if (!skip) {
|
|
53913
|
+
onMove();
|
|
53914
|
+
}
|
|
53915
|
+
if (!width || !height) {
|
|
53916
|
+
return;
|
|
53917
|
+
}
|
|
53918
|
+
const insetTop = floor(top2);
|
|
53919
|
+
const insetRight = floor(root2.clientWidth - (left2 + width));
|
|
53920
|
+
const insetBottom = floor(root2.clientHeight - (top2 + height));
|
|
53921
|
+
const insetLeft = floor(left2);
|
|
53922
|
+
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
|
|
53923
|
+
const options2 = {
|
|
53924
|
+
rootMargin,
|
|
53925
|
+
threshold: max(0, min(1, threshold)) || 1
|
|
53926
|
+
};
|
|
53927
|
+
let isFirstUpdate = true;
|
|
53928
|
+
function handleObserve(entries) {
|
|
53929
|
+
const ratio = entries[0].intersectionRatio;
|
|
53930
|
+
if (ratio !== threshold) {
|
|
53931
|
+
if (!isFirstUpdate) {
|
|
53932
|
+
return refresh();
|
|
53933
|
+
}
|
|
53934
|
+
if (!ratio) {
|
|
53935
|
+
timeoutId = setTimeout(() => {
|
|
53936
|
+
refresh(false, 1e-7);
|
|
53937
|
+
}, 1e3);
|
|
53938
|
+
} else {
|
|
53939
|
+
refresh(false, ratio);
|
|
53940
|
+
}
|
|
53941
|
+
}
|
|
53942
|
+
if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
|
|
53943
|
+
refresh();
|
|
53944
|
+
}
|
|
53945
|
+
isFirstUpdate = false;
|
|
53946
|
+
}
|
|
53947
|
+
try {
|
|
53948
|
+
io = new IntersectionObserver(handleObserve, {
|
|
53949
|
+
...options2,
|
|
53950
|
+
// Handle <iframe>s
|
|
53951
|
+
root: root2.ownerDocument
|
|
53952
|
+
});
|
|
53953
|
+
} catch (_e) {
|
|
53954
|
+
io = new IntersectionObserver(handleObserve, options2);
|
|
53955
|
+
}
|
|
53956
|
+
io.observe(element);
|
|
53957
|
+
}
|
|
53958
|
+
refresh(true);
|
|
53959
|
+
return cleanup;
|
|
53960
|
+
}
|
|
53961
|
+
function autoUpdate(reference2, floating, update, options2) {
|
|
53962
|
+
if (options2 === void 0) {
|
|
53963
|
+
options2 = {};
|
|
53964
|
+
}
|
|
53965
|
+
const {
|
|
53966
|
+
ancestorScroll = true,
|
|
53967
|
+
ancestorResize = true,
|
|
53968
|
+
elementResize = typeof ResizeObserver === "function",
|
|
53969
|
+
layoutShift = typeof IntersectionObserver === "function",
|
|
53970
|
+
animationFrame = false
|
|
53971
|
+
} = options2;
|
|
53972
|
+
const referenceEl = unwrapElement(reference2);
|
|
53973
|
+
const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : [];
|
|
53974
|
+
ancestors.forEach((ancestor) => {
|
|
53975
|
+
ancestorScroll && ancestor.addEventListener("scroll", update, {
|
|
53976
|
+
passive: true
|
|
53977
|
+
});
|
|
53978
|
+
ancestorResize && ancestor.addEventListener("resize", update);
|
|
53979
|
+
});
|
|
53980
|
+
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
|
|
53981
|
+
let reobserveFrame = -1;
|
|
53982
|
+
let resizeObserver = null;
|
|
53983
|
+
if (elementResize) {
|
|
53984
|
+
resizeObserver = new ResizeObserver((_ref) => {
|
|
53985
|
+
let [firstEntry] = _ref;
|
|
53986
|
+
if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
|
|
53987
|
+
resizeObserver.unobserve(floating);
|
|
53988
|
+
cancelAnimationFrame(reobserveFrame);
|
|
53989
|
+
reobserveFrame = requestAnimationFrame(() => {
|
|
53990
|
+
var _resizeObserver;
|
|
53991
|
+
(_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
|
|
53992
|
+
});
|
|
53993
|
+
}
|
|
53994
|
+
update();
|
|
53995
|
+
});
|
|
53996
|
+
if (referenceEl && !animationFrame) {
|
|
53997
|
+
resizeObserver.observe(referenceEl);
|
|
53998
|
+
}
|
|
53999
|
+
resizeObserver.observe(floating);
|
|
54000
|
+
}
|
|
54001
|
+
let frameId;
|
|
54002
|
+
let prevRefRect = animationFrame ? getBoundingClientRect(reference2) : null;
|
|
54003
|
+
if (animationFrame) {
|
|
54004
|
+
frameLoop();
|
|
54005
|
+
}
|
|
54006
|
+
function frameLoop() {
|
|
54007
|
+
const nextRefRect = getBoundingClientRect(reference2);
|
|
54008
|
+
if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
|
|
54009
|
+
update();
|
|
54010
|
+
}
|
|
54011
|
+
prevRefRect = nextRefRect;
|
|
54012
|
+
frameId = requestAnimationFrame(frameLoop);
|
|
54013
|
+
}
|
|
54014
|
+
update();
|
|
54015
|
+
return () => {
|
|
54016
|
+
var _resizeObserver2;
|
|
54017
|
+
ancestors.forEach((ancestor) => {
|
|
54018
|
+
ancestorScroll && ancestor.removeEventListener("scroll", update);
|
|
54019
|
+
ancestorResize && ancestor.removeEventListener("resize", update);
|
|
54020
|
+
});
|
|
54021
|
+
cleanupIo == null || cleanupIo();
|
|
54022
|
+
(_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
|
|
54023
|
+
resizeObserver = null;
|
|
54024
|
+
if (animationFrame) {
|
|
54025
|
+
cancelAnimationFrame(frameId);
|
|
54026
|
+
}
|
|
54027
|
+
};
|
|
54028
|
+
}
|
|
54029
|
+
const hide = hide$1;
|
|
54030
|
+
const computePosition = (reference2, floating, options2) => {
|
|
54031
|
+
const cache2 = /* @__PURE__ */ new Map();
|
|
54032
|
+
const mergedOptions = {
|
|
54033
|
+
platform,
|
|
54034
|
+
...options2
|
|
54035
|
+
};
|
|
54036
|
+
const platformWithCache = {
|
|
54037
|
+
...mergedOptions.platform,
|
|
54038
|
+
_c: cache2
|
|
54039
|
+
};
|
|
54040
|
+
return computePosition$1(reference2, floating, {
|
|
54041
|
+
...mergedOptions,
|
|
54042
|
+
platform: platformWithCache
|
|
54043
|
+
});
|
|
54044
|
+
};
|
|
54045
|
+
const SEPARATOR_CLASS = "pagination-separator";
|
|
54046
|
+
const SEPARATOR_FLOATING_CLASS = "pagination-separator-floating";
|
|
52652
54047
|
const isDebugging = false;
|
|
54048
|
+
const cleanupFunctions = /* @__PURE__ */ new Set();
|
|
52653
54049
|
const Pagination = Extension.create({
|
|
52654
54050
|
name: "pagination",
|
|
52655
54051
|
addStorage() {
|
|
@@ -52739,7 +54135,7 @@ const Pagination = Extension.create({
|
|
|
52739
54135
|
view: (view) => {
|
|
52740
54136
|
let previousDecorations = DecorationSet.empty;
|
|
52741
54137
|
return {
|
|
52742
|
-
update: (view2) => {
|
|
54138
|
+
update: (view2, prevState) => {
|
|
52743
54139
|
if (!shouldUpdate || isUpdating) return;
|
|
52744
54140
|
isUpdating = true;
|
|
52745
54141
|
hasInitialized = true;
|
|
@@ -52756,6 +54152,9 @@ const Pagination = Extension.create({
|
|
|
52756
54152
|
}
|
|
52757
54153
|
});
|
|
52758
54154
|
return [paginationPlugin];
|
|
54155
|
+
},
|
|
54156
|
+
onDestroy() {
|
|
54157
|
+
cleanupFloatingSeparators();
|
|
52759
54158
|
}
|
|
52760
54159
|
});
|
|
52761
54160
|
const getHeaderFooterId = (currentPageNumber, sectionType, editor, node2 = null) => {
|
|
@@ -52793,12 +54192,23 @@ const getHeaderFooterId = (currentPageNumber, sectionType, editor, node2 = null)
|
|
|
52793
54192
|
const performUpdate = (editor, view, previousDecorations) => {
|
|
52794
54193
|
const sectionData = editor.storage.pagination.sectionData;
|
|
52795
54194
|
const newDecorations = calculatePageBreaks(view, editor, sectionData);
|
|
54195
|
+
const editorElement = editor.options.element;
|
|
52796
54196
|
if (!previousDecorations.eq(newDecorations)) {
|
|
52797
54197
|
const updateTransaction = view.state.tr.setMeta(
|
|
52798
54198
|
PaginationPluginKey,
|
|
52799
54199
|
{ decorations: newDecorations }
|
|
52800
54200
|
);
|
|
52801
54201
|
view.dispatch(updateTransaction);
|
|
54202
|
+
requestAnimationFrame(() => {
|
|
54203
|
+
requestAnimationFrame(() => {
|
|
54204
|
+
cleanupFloatingSeparators();
|
|
54205
|
+
const separators = [...editorElement.querySelectorAll(`.${SEPARATOR_CLASS}--table`)];
|
|
54206
|
+
separators.forEach((separator) => {
|
|
54207
|
+
const { cleanup } = createFloatingSeparator(separator, editor);
|
|
54208
|
+
cleanupFunctions.add(cleanup);
|
|
54209
|
+
});
|
|
54210
|
+
});
|
|
54211
|
+
});
|
|
52802
54212
|
}
|
|
52803
54213
|
editor.emit("paginationUpdate");
|
|
52804
54214
|
};
|
|
@@ -52839,16 +54249,15 @@ function generateInternalPageBreaks(doc2, view, editor, sectionData) {
|
|
|
52839
54249
|
const decorations = [];
|
|
52840
54250
|
const { pageSize, pageMargins } = editor.converter.pageStyles;
|
|
52841
54251
|
const pageHeight = pageSize.height * 96;
|
|
52842
|
-
editor.options.scale;
|
|
52843
54252
|
let currentPageNumber = 1;
|
|
52844
54253
|
let pageHeightThreshold = pageHeight;
|
|
52845
54254
|
let footer = null, header = null;
|
|
52846
54255
|
const firstHeaderId = getHeaderFooterId(currentPageNumber, "headerIds", editor);
|
|
52847
|
-
const firstHeader = createHeader(pageMargins, pageSize, sectionData, firstHeaderId, editor);
|
|
54256
|
+
const firstHeader = createHeader(pageMargins, pageSize, sectionData, firstHeaderId, editor, currentPageNumber);
|
|
52848
54257
|
const pageBreak = createPageBreak({ editor, header: firstHeader, isFirstHeader: true });
|
|
52849
54258
|
decorations.push(Decoration.widget(0, pageBreak, { key: "stable-key" }));
|
|
52850
54259
|
const lastFooterId = getHeaderFooterId(currentPageNumber, "footerIds", editor);
|
|
52851
|
-
const lastFooter = createFooter(pageMargins, pageSize, sectionData, lastFooterId, editor);
|
|
54260
|
+
const lastFooter = createFooter(pageMargins, pageSize, sectionData, lastFooterId, editor, currentPageNumber);
|
|
52852
54261
|
pageHeightThreshold -= firstHeader.headerHeight + lastFooter.footerHeight;
|
|
52853
54262
|
let coords = view?.coordsAtPos(doc2.content.size);
|
|
52854
54263
|
if (!coords) return [];
|
|
@@ -52867,7 +54276,7 @@ function generateInternalPageBreaks(doc2, view, editor, sectionData) {
|
|
|
52867
54276
|
if (currentPageNumber === 1) {
|
|
52868
54277
|
const headerId2 = getHeaderFooterId(currentPageNumber, "headerIds", editor, currentNode);
|
|
52869
54278
|
decorations.pop();
|
|
52870
|
-
const newFirstHeader = createHeader(pageMargins, pageSize, sectionData, headerId2, editor);
|
|
54279
|
+
const newFirstHeader = createHeader(pageMargins, pageSize, sectionData, headerId2, editor, currentPageNumber - 1);
|
|
52871
54280
|
const pageBreak2 = createPageBreak({ editor, header: newFirstHeader, isFirstHeader: true });
|
|
52872
54281
|
decorations.push(Decoration.widget(0, pageBreak2, { key: "stable-key" }));
|
|
52873
54282
|
}
|
|
@@ -52883,7 +54292,9 @@ function generateInternalPageBreaks(doc2, view, editor, sectionData) {
|
|
|
52883
54292
|
}
|
|
52884
54293
|
if (isHardBreakNode || shouldAddPageBreak) {
|
|
52885
54294
|
const $currentPos = view.state.doc.resolve(currentPos);
|
|
54295
|
+
const table = findParentNodeClosestToPos($currentPos, (node22) => node22.type.name === "table");
|
|
52886
54296
|
const tableRow = findParentNodeClosestToPos($currentPos, (node22) => node22.type.name === "tableRow");
|
|
54297
|
+
let isInTable2 = table || tableRow ? true : false;
|
|
52887
54298
|
if (tableRow) {
|
|
52888
54299
|
currentNode = tableRow.node;
|
|
52889
54300
|
currentPos = tableRow.pos;
|
|
@@ -52896,13 +54307,13 @@ function generateInternalPageBreaks(doc2, view, editor, sectionData) {
|
|
|
52896
54307
|
const footerId2 = getHeaderFooterId(currentPageNumber, "footerIds", editor, currentNode);
|
|
52897
54308
|
currentPageNumber++;
|
|
52898
54309
|
const headerId2 = getHeaderFooterId(currentPageNumber, "headerIds", editor);
|
|
52899
|
-
header = createHeader(pageMargins, pageSize, sectionData, headerId2, editor);
|
|
54310
|
+
header = createHeader(pageMargins, pageSize, sectionData, headerId2, editor, currentPageNumber - 1);
|
|
52900
54311
|
footer = createFooter(pageMargins, pageSize, sectionData, footerId2, editor, currentPageNumber - 1);
|
|
52901
54312
|
const bufferHeight2 = pageHeightThreshold - actualBreakBottom;
|
|
52902
54313
|
const { node: spacingNode2 } = createFinalPagePadding(bufferHeight2);
|
|
52903
54314
|
const pageSpacer2 = Decoration.widget(breakPos, spacingNode2, { key: "stable-key" });
|
|
52904
54315
|
decorations.push(pageSpacer2);
|
|
52905
|
-
const pageBreak2 = createPageBreak({ editor, header, footer });
|
|
54316
|
+
const pageBreak2 = createPageBreak({ editor, header, footer, isInTable: isInTable2 });
|
|
52906
54317
|
decorations.push(Decoration.widget(breakPos, pageBreak2, { key: "stable-key" }));
|
|
52907
54318
|
pageHeightThreshold = actualBreakBottom + (pageHeight - header.headerHeight - footer.footerHeight);
|
|
52908
54319
|
}
|
|
@@ -52911,7 +54322,7 @@ function generateInternalPageBreaks(doc2, view, editor, sectionData) {
|
|
|
52911
54322
|
const lastNodeCoords = view.coordsAtPos(finalPos);
|
|
52912
54323
|
const headerId = getHeaderFooterId(currentPageNumber, "headerIds", editor);
|
|
52913
54324
|
const footerId = getHeaderFooterId(currentPageNumber, "footerIds", editor);
|
|
52914
|
-
header = createHeader(pageMargins, pageSize, sectionData, headerId, editor);
|
|
54325
|
+
header = createHeader(pageMargins, pageSize, sectionData, headerId, editor, currentPageNumber);
|
|
52915
54326
|
footer = createFooter(pageMargins, pageSize, sectionData, footerId, editor, currentPageNumber);
|
|
52916
54327
|
const bufferHeight = pageHeightThreshold - lastNodeCoords.bottom;
|
|
52917
54328
|
const { node: spacingNode } = createFinalPagePadding(bufferHeight);
|
|
@@ -52928,6 +54339,7 @@ function generateInternalPageBreaks(doc2, view, editor, sectionData) {
|
|
|
52928
54339
|
totalPageNumber.innerText = currentPageNumber;
|
|
52929
54340
|
}
|
|
52930
54341
|
});
|
|
54342
|
+
editor.currentTotalPages = currentPageNumber;
|
|
52931
54343
|
return decorations;
|
|
52932
54344
|
}
|
|
52933
54345
|
function createFinalPagePadding(bufferHeight) {
|
|
@@ -52938,7 +54350,7 @@ function createFinalPagePadding(bufferHeight) {
|
|
|
52938
54350
|
div2.style.height = bufferHeight + "px";
|
|
52939
54351
|
return { nodeHeight: bufferHeight, node: div2 };
|
|
52940
54352
|
}
|
|
52941
|
-
function createHeader(pageMargins, pageSize, sectionData, headerId, editor) {
|
|
54353
|
+
function createHeader(pageMargins, pageSize, sectionData, headerId, editor, currentPageNumber) {
|
|
52942
54354
|
const headerDef = sectionData.headers?.[headerId];
|
|
52943
54355
|
const minHeaderHeight = pageMargins.top * 96;
|
|
52944
54356
|
const headerMargin = pageMargins.header * 96;
|
|
@@ -52965,7 +54377,8 @@ function createHeader(pageMargins, pageSize, sectionData, headerId, editor) {
|
|
|
52965
54377
|
appendToBody: false,
|
|
52966
54378
|
sectionId: headerId,
|
|
52967
54379
|
type: "header",
|
|
52968
|
-
availableHeight
|
|
54380
|
+
availableHeight,
|
|
54381
|
+
currentPageNumber
|
|
52969
54382
|
});
|
|
52970
54383
|
editor.converter.headerEditors.push({
|
|
52971
54384
|
id: headerId,
|
|
@@ -52991,13 +54404,6 @@ function createFooter(pageMargins, pageSize, sectionData, footerId, editor, curr
|
|
|
52991
54404
|
const minFooterHeight = pageMargins.bottom * 96;
|
|
52992
54405
|
const footerPaddingFromEdge = pageMargins.footer * 96;
|
|
52993
54406
|
const footerHeight = Math.max(footerDef?.height || 0, minFooterHeight - footerPaddingFromEdge);
|
|
52994
|
-
const sectionContainer = footerDef?.sectionContainer?.cloneNode(true);
|
|
52995
|
-
const autoPageNumber = sectionContainer?.querySelector('span[data-id="auto-page-number"]');
|
|
52996
|
-
if (autoPageNumber) {
|
|
52997
|
-
const fontSize2 = autoPageNumber.previousElementSibling?.style?.fontSize || autoPageNumber.nextElementSibling?.style?.fontSize;
|
|
52998
|
-
if (fontSize2) autoPageNumber.style.fontSize = fontSize2;
|
|
52999
|
-
autoPageNumber.innerText = currentPageNumber;
|
|
53000
|
-
}
|
|
53001
54407
|
const editorContainer = document.createElement("div");
|
|
53002
54408
|
if (!footerId && !editor.converter.footerIds["default"]) {
|
|
53003
54409
|
footerId = "rId" + generateDocxRandomId();
|
|
@@ -53017,7 +54423,8 @@ function createFooter(pageMargins, pageSize, sectionData, footerId, editor, curr
|
|
|
53017
54423
|
appendToBody: false,
|
|
53018
54424
|
sectionId: footerId,
|
|
53019
54425
|
type: "footer",
|
|
53020
|
-
availableHeight: footerHeight
|
|
54426
|
+
availableHeight: footerHeight,
|
|
54427
|
+
currentPageNumber
|
|
53021
54428
|
});
|
|
53022
54429
|
editor.converter.footerEditors.push({
|
|
53023
54430
|
id: footerId,
|
|
@@ -53043,7 +54450,7 @@ const onHeaderFooterDblClick = (editor, currentFocusedSectionEditor) => {
|
|
|
53043
54450
|
editor.setEditable(false, false);
|
|
53044
54451
|
toggleHeaderFooterEditMode(editor, currentFocusedSectionEditor, true);
|
|
53045
54452
|
};
|
|
53046
|
-
function createPageBreak({ editor, header, footer, footerBottom = null, isFirstHeader, isLastFooter }) {
|
|
54453
|
+
function createPageBreak({ editor, header, footer, footerBottom = null, isFirstHeader, isLastFooter, isInTable: isInTable2 = false }) {
|
|
53047
54454
|
const { pageSize, pageMargins } = editor.converter.pageStyles;
|
|
53048
54455
|
let sectionHeight = 0;
|
|
53049
54456
|
const paginationDiv = document.createElement("div");
|
|
@@ -53062,7 +54469,10 @@ function createPageBreak({ editor, header, footer, footerBottom = null, isFirstH
|
|
|
53062
54469
|
const separatorHeight = 20;
|
|
53063
54470
|
sectionHeight += separatorHeight;
|
|
53064
54471
|
const separator = document.createElement("div");
|
|
53065
|
-
separator.
|
|
54472
|
+
separator.classList.add(SEPARATOR_CLASS);
|
|
54473
|
+
if (isInTable2) {
|
|
54474
|
+
separator.classList.add(`${SEPARATOR_CLASS}--table`);
|
|
54475
|
+
}
|
|
53066
54476
|
innerDiv.appendChild(separator);
|
|
53067
54477
|
}
|
|
53068
54478
|
if (header) {
|
|
@@ -53101,6 +54511,85 @@ const onImageLoad = (editor) => {
|
|
|
53101
54511
|
editor.view.dispatch(newTr);
|
|
53102
54512
|
});
|
|
53103
54513
|
};
|
|
54514
|
+
function createFloatingSeparator(separator, editor) {
|
|
54515
|
+
const floatingSeparator = document.createElement("div");
|
|
54516
|
+
floatingSeparator.classList.add(SEPARATOR_FLOATING_CLASS);
|
|
54517
|
+
floatingSeparator.dataset.floatingSeparator = "";
|
|
54518
|
+
const editorElement = editor.options.element;
|
|
54519
|
+
editorElement.append(floatingSeparator);
|
|
54520
|
+
const updatePosition2 = () => {
|
|
54521
|
+
computePosition(separator, floatingSeparator, {
|
|
54522
|
+
strategy: "absolute",
|
|
54523
|
+
placement: "top-start",
|
|
54524
|
+
middleware: [
|
|
54525
|
+
hide(),
|
|
54526
|
+
{
|
|
54527
|
+
name: "copy",
|
|
54528
|
+
fn: ({ elements }) => {
|
|
54529
|
+
const rect = elements.reference.getBoundingClientRect();
|
|
54530
|
+
const containerRect = editorElement.getBoundingClientRect();
|
|
54531
|
+
const scaleFactor = getScaleFactor(editorElement);
|
|
54532
|
+
const x = Math.round((rect.left - containerRect.left) / scaleFactor);
|
|
54533
|
+
const y = Math.round((rect.top - containerRect.top) / scaleFactor);
|
|
54534
|
+
const width = Math.round(rect.width / scaleFactor);
|
|
54535
|
+
const height = Math.round(rect.height / scaleFactor);
|
|
54536
|
+
return {
|
|
54537
|
+
x,
|
|
54538
|
+
y,
|
|
54539
|
+
data: { width, height }
|
|
54540
|
+
};
|
|
54541
|
+
}
|
|
54542
|
+
}
|
|
54543
|
+
]
|
|
54544
|
+
}).then(({ x, y, middlewareData }) => {
|
|
54545
|
+
Object.assign(floatingSeparator.style, {
|
|
54546
|
+
top: `${y}px`,
|
|
54547
|
+
left: `${x}px`,
|
|
54548
|
+
width: `${middlewareData.copy.width}px`,
|
|
54549
|
+
height: `${middlewareData.copy.height}px`,
|
|
54550
|
+
visibility: middlewareData.hide?.referenceHidden ? "hidden" : "visible"
|
|
54551
|
+
});
|
|
54552
|
+
});
|
|
54553
|
+
};
|
|
54554
|
+
const cleanup = autoUpdate(
|
|
54555
|
+
separator,
|
|
54556
|
+
floatingSeparator,
|
|
54557
|
+
updatePosition2
|
|
54558
|
+
);
|
|
54559
|
+
const extendedCleanup = () => {
|
|
54560
|
+
floatingSeparator?.remove();
|
|
54561
|
+
cleanup();
|
|
54562
|
+
};
|
|
54563
|
+
return {
|
|
54564
|
+
cleanup: extendedCleanup,
|
|
54565
|
+
updatePosition: updatePosition2
|
|
54566
|
+
};
|
|
54567
|
+
}
|
|
54568
|
+
function cleanupFloatingSeparators() {
|
|
54569
|
+
cleanupFunctions.forEach((cleanup) => cleanup());
|
|
54570
|
+
cleanupFunctions.clear();
|
|
54571
|
+
}
|
|
54572
|
+
function getScaleFactor(element) {
|
|
54573
|
+
let scale = 1;
|
|
54574
|
+
let currentElement2 = element;
|
|
54575
|
+
while (currentElement2 && currentElement2 !== document.documentElement) {
|
|
54576
|
+
let zoomStyle = currentElement2.style.zoom;
|
|
54577
|
+
if (zoomStyle) {
|
|
54578
|
+
let zoom = parseFloat(zoomStyle) || 1;
|
|
54579
|
+
scale *= zoom;
|
|
54580
|
+
}
|
|
54581
|
+
let transformStyle = currentElement2.style.transform;
|
|
54582
|
+
if (transformStyle) {
|
|
54583
|
+
let scaleMatch = transformStyle.match(/scale\(([^)]+)\)/);
|
|
54584
|
+
if (scaleMatch) {
|
|
54585
|
+
let scaleValue = parseFloat(scaleMatch[1]) || 1;
|
|
54586
|
+
scale *= scaleValue;
|
|
54587
|
+
}
|
|
54588
|
+
}
|
|
54589
|
+
currentElement2 = currentElement2.parentElement;
|
|
54590
|
+
}
|
|
54591
|
+
return scale;
|
|
54592
|
+
}
|
|
53104
54593
|
class SearchQuery {
|
|
53105
54594
|
/**
|
|
53106
54595
|
Create a query object.
|
|
@@ -57140,7 +58629,7 @@ var ResizeObserverController = function() {
|
|
|
57140
58629
|
};
|
|
57141
58630
|
return ResizeObserverController2;
|
|
57142
58631
|
}();
|
|
57143
|
-
var ResizeObserver = function() {
|
|
58632
|
+
var ResizeObserver$1 = function() {
|
|
57144
58633
|
function ResizeObserver2(callback) {
|
|
57145
58634
|
if (arguments.length === 0) {
|
|
57146
58635
|
throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");
|
|
@@ -57179,7 +58668,7 @@ var ResizeObserver = function() {
|
|
|
57179
58668
|
class ResizeObserverDelegate {
|
|
57180
58669
|
constructor() {
|
|
57181
58670
|
this.handleResize = this.handleResize.bind(this);
|
|
57182
|
-
this.observer = new (typeof window !== "undefined" && window.ResizeObserver || ResizeObserver)(this.handleResize);
|
|
58671
|
+
this.observer = new (typeof window !== "undefined" && window.ResizeObserver || ResizeObserver$1)(this.handleResize);
|
|
57183
58672
|
this.elHandlersMap = /* @__PURE__ */ new Map();
|
|
57184
58673
|
}
|
|
57185
58674
|
handleResize(entries) {
|
|
@@ -67585,7 +69074,7 @@ const _sfc_main$2 = {
|
|
|
67585
69074
|
};
|
|
67586
69075
|
}
|
|
67587
69076
|
};
|
|
67588
|
-
const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-
|
|
69077
|
+
const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-4b700df1"]]);
|
|
67589
69078
|
const _sfc_main$1 = {
|
|
67590
69079
|
__name: "BasicUpload",
|
|
67591
69080
|
emits: ["file-change"],
|