@zipify/wysiwyg 4.0.4 → 4.1.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +1 -1
- package/dist/wysiwyg.css +12 -12
- package/dist/wysiwyg.mjs +1300 -227
- package/example/tooltip/Tooltip.js +69 -92
- package/example/tooltip/modifiers/TooltipCloseOnScrollModifier.js +5 -2
- package/example/tooltip/tooltip.css +31 -8
- package/lib/Wysiwyg.vue +1 -3
- package/lib/components/base/composables/__tests__/useModalToggler.test.js +2 -0
- package/lib/components/base/composables/useModalToggler.js +24 -30
- package/lib/components/toolbar/Toolbar.vue +1 -1
- package/lib/components/toolbar/controls/__tests__/LineHeightControl.test.js +2 -0
- package/lib/composables/useToolbar.js +20 -24
- package/package.json +2 -1
package/dist/wysiwyg.mjs
CHANGED
|
@@ -1144,7 +1144,7 @@ class NodeRange {
|
|
|
1144
1144
|
}
|
|
1145
1145
|
}
|
|
1146
1146
|
const emptyAttrs = /* @__PURE__ */ Object.create(null);
|
|
1147
|
-
let Node$
|
|
1147
|
+
let Node$2 = class Node2 {
|
|
1148
1148
|
/**
|
|
1149
1149
|
@internal
|
|
1150
1150
|
*/
|
|
@@ -1267,14 +1267,14 @@ let Node$1 = class Node {
|
|
|
1267
1267
|
copy(content = null) {
|
|
1268
1268
|
if (content == this.content)
|
|
1269
1269
|
return this;
|
|
1270
|
-
return new
|
|
1270
|
+
return new Node2(this.type, this.attrs, content, this.marks);
|
|
1271
1271
|
}
|
|
1272
1272
|
/**
|
|
1273
1273
|
Create a copy of this node, with the given set of marks instead
|
|
1274
1274
|
of the node's own marks.
|
|
1275
1275
|
*/
|
|
1276
1276
|
mark(marks) {
|
|
1277
|
-
return marks == this.marks ? this : new
|
|
1277
|
+
return marks == this.marks ? this : new Node2(this.type, this.attrs, this.content, marks);
|
|
1278
1278
|
}
|
|
1279
1279
|
/**
|
|
1280
1280
|
Create a copy of this node with only the content between the
|
|
@@ -1532,8 +1532,8 @@ let Node$1 = class Node {
|
|
|
1532
1532
|
return schema.nodeType(json.type).create(json.attrs, content, marks);
|
|
1533
1533
|
}
|
|
1534
1534
|
};
|
|
1535
|
-
Node$
|
|
1536
|
-
class TextNode extends Node$
|
|
1535
|
+
Node$2.prototype.text = void 0;
|
|
1536
|
+
class TextNode extends Node$2 {
|
|
1537
1537
|
/**
|
|
1538
1538
|
@internal
|
|
1539
1539
|
*/
|
|
@@ -2103,7 +2103,7 @@ let NodeType$1 = class NodeType {
|
|
|
2103
2103
|
create(attrs = null, content, marks) {
|
|
2104
2104
|
if (this.isText)
|
|
2105
2105
|
throw new Error("NodeType.create can't construct text nodes");
|
|
2106
|
-
return new Node$
|
|
2106
|
+
return new Node$2(this, this.computeAttrs(attrs), Fragment.from(content), Mark$1.setFrom(marks));
|
|
2107
2107
|
}
|
|
2108
2108
|
/**
|
|
2109
2109
|
Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but check the given content
|
|
@@ -2113,7 +2113,7 @@ let NodeType$1 = class NodeType {
|
|
|
2113
2113
|
createChecked(attrs = null, content, marks) {
|
|
2114
2114
|
content = Fragment.from(content);
|
|
2115
2115
|
this.checkContent(content);
|
|
2116
|
-
return new Node$
|
|
2116
|
+
return new Node$2(this, this.computeAttrs(attrs), content, Mark$1.setFrom(marks));
|
|
2117
2117
|
}
|
|
2118
2118
|
/**
|
|
2119
2119
|
Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but see if it is
|
|
@@ -2136,7 +2136,7 @@ let NodeType$1 = class NodeType {
|
|
|
2136
2136
|
let after = matched && matched.fillBefore(Fragment.empty, true);
|
|
2137
2137
|
if (!after)
|
|
2138
2138
|
return null;
|
|
2139
|
-
return new Node$
|
|
2139
|
+
return new Node$2(this, attrs, content.append(after), Mark$1.setFrom(marks));
|
|
2140
2140
|
}
|
|
2141
2141
|
/**
|
|
2142
2142
|
Returns true if the given fragment is valid content for this node
|
|
@@ -2344,7 +2344,7 @@ class Schema {
|
|
|
2344
2344
|
bound.
|
|
2345
2345
|
*/
|
|
2346
2346
|
nodeFromJSON(json) {
|
|
2347
|
-
return Node$
|
|
2347
|
+
return Node$2.fromJSON(this, json);
|
|
2348
2348
|
}
|
|
2349
2349
|
/**
|
|
2350
2350
|
Deserialize a mark from its JSON representation. This method is
|
|
@@ -5758,7 +5758,7 @@ class EditorState {
|
|
|
5758
5758
|
let instance = new EditorState($config);
|
|
5759
5759
|
$config.fields.forEach((field) => {
|
|
5760
5760
|
if (field.name == "doc") {
|
|
5761
|
-
instance.doc = Node$
|
|
5761
|
+
instance.doc = Node$2.fromJSON(config.schema, json.doc);
|
|
5762
5762
|
} else if (field.name == "selection") {
|
|
5763
5763
|
instance.selection = Selection.fromJSON(instance.doc, json.selection);
|
|
5764
5764
|
} else if (field.name == "storedMarks") {
|
|
@@ -5943,7 +5943,7 @@ function windowRect(doc2) {
|
|
|
5943
5943
|
bottom: doc2.documentElement.clientHeight
|
|
5944
5944
|
};
|
|
5945
5945
|
}
|
|
5946
|
-
function getSide(value, side) {
|
|
5946
|
+
function getSide$1(value, side) {
|
|
5947
5947
|
return typeof value == "number" ? value : value[side];
|
|
5948
5948
|
}
|
|
5949
5949
|
function clientRect(node) {
|
|
@@ -5969,14 +5969,14 @@ function scrollRectIntoView(view, rect, startDOM) {
|
|
|
5969
5969
|
let atTop = elt == doc2.body;
|
|
5970
5970
|
let bounding = atTop ? windowRect(doc2) : clientRect(elt);
|
|
5971
5971
|
let moveX = 0, moveY = 0;
|
|
5972
|
-
if (rect.top < bounding.top + getSide(scrollThreshold, "top"))
|
|
5973
|
-
moveY = -(bounding.top - rect.top + getSide(scrollMargin, "top"));
|
|
5974
|
-
else if (rect.bottom > bounding.bottom - getSide(scrollThreshold, "bottom"))
|
|
5975
|
-
moveY = rect.bottom - bounding.bottom + getSide(scrollMargin, "bottom");
|
|
5976
|
-
if (rect.left < bounding.left + getSide(scrollThreshold, "left"))
|
|
5977
|
-
moveX = -(bounding.left - rect.left + getSide(scrollMargin, "left"));
|
|
5978
|
-
else if (rect.right > bounding.right - getSide(scrollThreshold, "right"))
|
|
5979
|
-
moveX = rect.right - bounding.right + getSide(scrollMargin, "right");
|
|
5972
|
+
if (rect.top < bounding.top + getSide$1(scrollThreshold, "top"))
|
|
5973
|
+
moveY = -(bounding.top - rect.top + getSide$1(scrollMargin, "top"));
|
|
5974
|
+
else if (rect.bottom > bounding.bottom - getSide$1(scrollThreshold, "bottom"))
|
|
5975
|
+
moveY = rect.bottom - bounding.bottom + getSide$1(scrollMargin, "bottom");
|
|
5976
|
+
if (rect.left < bounding.left + getSide$1(scrollThreshold, "left"))
|
|
5977
|
+
moveX = -(bounding.left - rect.left + getSide$1(scrollMargin, "left"));
|
|
5978
|
+
else if (rect.right > bounding.right - getSide$1(scrollThreshold, "right"))
|
|
5979
|
+
moveX = rect.right - bounding.right + getSide$1(scrollMargin, "right");
|
|
5980
5980
|
if (moveX || moveY) {
|
|
5981
5981
|
if (atTop) {
|
|
5982
5982
|
doc2.defaultView.scrollBy(moveX, moveY);
|
|
@@ -8899,16 +8899,16 @@ editHandlers.drop = (view, _event) => {
|
|
|
8899
8899
|
if (move)
|
|
8900
8900
|
tr2.deleteSelection();
|
|
8901
8901
|
let pos = tr2.mapping.map(insertPos);
|
|
8902
|
-
let
|
|
8902
|
+
let isNode2 = slice2.openStart == 0 && slice2.openEnd == 0 && slice2.content.childCount == 1;
|
|
8903
8903
|
let beforeInsert = tr2.doc;
|
|
8904
|
-
if (
|
|
8904
|
+
if (isNode2)
|
|
8905
8905
|
tr2.replaceRangeWith(pos, pos, slice2.content.firstChild);
|
|
8906
8906
|
else
|
|
8907
8907
|
tr2.replaceRange(pos, pos, slice2);
|
|
8908
8908
|
if (tr2.doc.eq(beforeInsert))
|
|
8909
8909
|
return;
|
|
8910
8910
|
let $pos = tr2.doc.resolve(pos);
|
|
8911
|
-
if (
|
|
8911
|
+
if (isNode2 && NodeSelection.isSelectable(slice2.content.firstChild) && $pos.nodeAfter && $pos.nodeAfter.sameMarkup(slice2.content.firstChild)) {
|
|
8912
8912
|
tr2.setSelection(new NodeSelection($pos));
|
|
8913
8913
|
} else {
|
|
8914
8914
|
let end2 = tr2.mapping.map(insertPos);
|
|
@@ -10625,7 +10625,7 @@ var base = {
|
|
|
10625
10625
|
221: "]",
|
|
10626
10626
|
222: "'"
|
|
10627
10627
|
};
|
|
10628
|
-
var shift = {
|
|
10628
|
+
var shift$1 = {
|
|
10629
10629
|
48: ")",
|
|
10630
10630
|
49: "!",
|
|
10631
10631
|
50: "@",
|
|
@@ -10661,14 +10661,14 @@ for (var i = 1; i <= 24; i++)
|
|
|
10661
10661
|
base[i + 111] = "F" + i;
|
|
10662
10662
|
for (var i = 65; i <= 90; i++) {
|
|
10663
10663
|
base[i] = String.fromCharCode(i + 32);
|
|
10664
|
-
shift[i] = String.fromCharCode(i);
|
|
10664
|
+
shift$1[i] = String.fromCharCode(i);
|
|
10665
10665
|
}
|
|
10666
10666
|
for (var code in base)
|
|
10667
|
-
if (!shift.hasOwnProperty(code))
|
|
10668
|
-
shift[code] = base[code];
|
|
10667
|
+
if (!shift$1.hasOwnProperty(code))
|
|
10668
|
+
shift$1[code] = base[code];
|
|
10669
10669
|
function keyName(event) {
|
|
10670
10670
|
var ignoreKey = brokenModifierNames && (event.ctrlKey || event.altKey || event.metaKey) || ie && event.shiftKey && event.key && event.key.length == 1 || event.key == "Unidentified";
|
|
10671
|
-
var name = !ignoreKey && event.key || (event.shiftKey ? shift : base)[event.keyCode] || event.key || "Unidentified";
|
|
10671
|
+
var name = !ignoreKey && event.key || (event.shiftKey ? shift$1 : base)[event.keyCode] || event.key || "Unidentified";
|
|
10672
10672
|
if (name == "Esc")
|
|
10673
10673
|
name = "Escape";
|
|
10674
10674
|
if (name == "Del")
|
|
@@ -14522,7 +14522,7 @@ class Mark2 {
|
|
|
14522
14522
|
return false;
|
|
14523
14523
|
}
|
|
14524
14524
|
}
|
|
14525
|
-
class
|
|
14525
|
+
let Node$1 = class Node3 {
|
|
14526
14526
|
constructor(config = {}) {
|
|
14527
14527
|
this.type = "node";
|
|
14528
14528
|
this.name = "node";
|
|
@@ -14552,7 +14552,7 @@ class Node2 {
|
|
|
14552
14552
|
})) || {};
|
|
14553
14553
|
}
|
|
14554
14554
|
static create(config = {}) {
|
|
14555
|
-
return new
|
|
14555
|
+
return new Node3(config);
|
|
14556
14556
|
}
|
|
14557
14557
|
configure(options = {}) {
|
|
14558
14558
|
const extension = this.extend();
|
|
@@ -14564,7 +14564,7 @@ class Node2 {
|
|
|
14564
14564
|
return extension;
|
|
14565
14565
|
}
|
|
14566
14566
|
extend(extendedConfig = {}) {
|
|
14567
|
-
const extension = new
|
|
14567
|
+
const extension = new Node3(extendedConfig);
|
|
14568
14568
|
extension.parent = this;
|
|
14569
14569
|
this.child = extension;
|
|
14570
14570
|
extension.name = extendedConfig.name ? extendedConfig.name : extension.parent.name;
|
|
@@ -14580,7 +14580,7 @@ class Node2 {
|
|
|
14580
14580
|
}));
|
|
14581
14581
|
return extension;
|
|
14582
14582
|
}
|
|
14583
|
-
}
|
|
14583
|
+
};
|
|
14584
14584
|
function markPasteRule(config) {
|
|
14585
14585
|
return new PasteRule({
|
|
14586
14586
|
find: config.find,
|
|
@@ -14645,10 +14645,10 @@ var beforeWrite = "beforeWrite";
|
|
|
14645
14645
|
var write = "write";
|
|
14646
14646
|
var afterWrite = "afterWrite";
|
|
14647
14647
|
var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
|
|
14648
|
-
function getNodeName(element) {
|
|
14648
|
+
function getNodeName$1(element) {
|
|
14649
14649
|
return element ? (element.nodeName || "").toLowerCase() : null;
|
|
14650
14650
|
}
|
|
14651
|
-
function getWindow(node) {
|
|
14651
|
+
function getWindow$1(node) {
|
|
14652
14652
|
if (node == null) {
|
|
14653
14653
|
return window;
|
|
14654
14654
|
}
|
|
@@ -14658,19 +14658,19 @@ function getWindow(node) {
|
|
|
14658
14658
|
}
|
|
14659
14659
|
return node;
|
|
14660
14660
|
}
|
|
14661
|
-
function isElement$
|
|
14662
|
-
var OwnElement = getWindow(node).Element;
|
|
14661
|
+
function isElement$2(node) {
|
|
14662
|
+
var OwnElement = getWindow$1(node).Element;
|
|
14663
14663
|
return node instanceof OwnElement || node instanceof Element;
|
|
14664
14664
|
}
|
|
14665
|
-
function isHTMLElement(node) {
|
|
14666
|
-
var OwnElement = getWindow(node).HTMLElement;
|
|
14665
|
+
function isHTMLElement$1(node) {
|
|
14666
|
+
var OwnElement = getWindow$1(node).HTMLElement;
|
|
14667
14667
|
return node instanceof OwnElement || node instanceof HTMLElement;
|
|
14668
14668
|
}
|
|
14669
|
-
function isShadowRoot(node) {
|
|
14669
|
+
function isShadowRoot$1(node) {
|
|
14670
14670
|
if (typeof ShadowRoot === "undefined") {
|
|
14671
14671
|
return false;
|
|
14672
14672
|
}
|
|
14673
|
-
var OwnElement = getWindow(node).ShadowRoot;
|
|
14673
|
+
var OwnElement = getWindow$1(node).ShadowRoot;
|
|
14674
14674
|
return node instanceof OwnElement || node instanceof ShadowRoot;
|
|
14675
14675
|
}
|
|
14676
14676
|
function applyStyles(_ref) {
|
|
@@ -14679,7 +14679,7 @@ function applyStyles(_ref) {
|
|
|
14679
14679
|
var style2 = state.styles[name] || {};
|
|
14680
14680
|
var attributes = state.attributes[name] || {};
|
|
14681
14681
|
var element = state.elements[name];
|
|
14682
|
-
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
14682
|
+
if (!isHTMLElement$1(element) || !getNodeName$1(element)) {
|
|
14683
14683
|
return;
|
|
14684
14684
|
}
|
|
14685
14685
|
Object.assign(element.style, style2);
|
|
@@ -14721,7 +14721,7 @@ function effect$2(_ref2) {
|
|
|
14721
14721
|
style3[property] = "";
|
|
14722
14722
|
return style3;
|
|
14723
14723
|
}, {});
|
|
14724
|
-
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
14724
|
+
if (!isHTMLElement$1(element) || !getNodeName$1(element)) {
|
|
14725
14725
|
return;
|
|
14726
14726
|
}
|
|
14727
14727
|
Object.assign(element.style, style2);
|
|
@@ -14742,9 +14742,9 @@ const applyStyles$1 = {
|
|
|
14742
14742
|
function getBasePlacement$1(placement) {
|
|
14743
14743
|
return placement.split("-")[0];
|
|
14744
14744
|
}
|
|
14745
|
-
var max = Math.max;
|
|
14746
|
-
var min = Math.min;
|
|
14747
|
-
var round = Math.round;
|
|
14745
|
+
var max$1 = Math.max;
|
|
14746
|
+
var min$1 = Math.min;
|
|
14747
|
+
var round$1 = Math.round;
|
|
14748
14748
|
function getUAString() {
|
|
14749
14749
|
var uaData = navigator.userAgentData;
|
|
14750
14750
|
if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {
|
|
@@ -14757,7 +14757,7 @@ function getUAString() {
|
|
|
14757
14757
|
function isLayoutViewport() {
|
|
14758
14758
|
return !/^((?!chrome|android).)*safari/i.test(getUAString());
|
|
14759
14759
|
}
|
|
14760
|
-
function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
|
14760
|
+
function getBoundingClientRect$1(element, includeScale, isFixedStrategy) {
|
|
14761
14761
|
if (includeScale === void 0) {
|
|
14762
14762
|
includeScale = false;
|
|
14763
14763
|
}
|
|
@@ -14767,11 +14767,11 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
|
|
14767
14767
|
var clientRect2 = element.getBoundingClientRect();
|
|
14768
14768
|
var scaleX = 1;
|
|
14769
14769
|
var scaleY = 1;
|
|
14770
|
-
if (includeScale && isHTMLElement(element)) {
|
|
14771
|
-
scaleX = element.offsetWidth > 0 ? round(clientRect2.width) / element.offsetWidth || 1 : 1;
|
|
14772
|
-
scaleY = element.offsetHeight > 0 ? round(clientRect2.height) / element.offsetHeight || 1 : 1;
|
|
14770
|
+
if (includeScale && isHTMLElement$1(element)) {
|
|
14771
|
+
scaleX = element.offsetWidth > 0 ? round$1(clientRect2.width) / element.offsetWidth || 1 : 1;
|
|
14772
|
+
scaleY = element.offsetHeight > 0 ? round$1(clientRect2.height) / element.offsetHeight || 1 : 1;
|
|
14773
14773
|
}
|
|
14774
|
-
var _ref = isElement$
|
|
14774
|
+
var _ref = isElement$2(element) ? getWindow$1(element) : window, visualViewport = _ref.visualViewport;
|
|
14775
14775
|
var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
|
|
14776
14776
|
var x = (clientRect2.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
|
|
14777
14777
|
var y = (clientRect2.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
|
|
@@ -14789,7 +14789,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
|
|
14789
14789
|
};
|
|
14790
14790
|
}
|
|
14791
14791
|
function getLayoutRect(element) {
|
|
14792
|
-
var clientRect2 = getBoundingClientRect(element);
|
|
14792
|
+
var clientRect2 = getBoundingClientRect$1(element);
|
|
14793
14793
|
var width = element.offsetWidth;
|
|
14794
14794
|
var height = element.offsetHeight;
|
|
14795
14795
|
if (Math.abs(clientRect2.width - width) <= 1) {
|
|
@@ -14809,7 +14809,7 @@ function contains(parent, child) {
|
|
|
14809
14809
|
var rootNode = child.getRootNode && child.getRootNode();
|
|
14810
14810
|
if (parent.contains(child)) {
|
|
14811
14811
|
return true;
|
|
14812
|
-
} else if (rootNode && isShadowRoot(rootNode)) {
|
|
14812
|
+
} else if (rootNode && isShadowRoot$1(rootNode)) {
|
|
14813
14813
|
var next = child;
|
|
14814
14814
|
do {
|
|
14815
14815
|
if (next && parent.isSameNode(next)) {
|
|
@@ -14820,20 +14820,20 @@ function contains(parent, child) {
|
|
|
14820
14820
|
}
|
|
14821
14821
|
return false;
|
|
14822
14822
|
}
|
|
14823
|
-
function getComputedStyle$
|
|
14824
|
-
return getWindow(element).getComputedStyle(element);
|
|
14823
|
+
function getComputedStyle$2(element) {
|
|
14824
|
+
return getWindow$1(element).getComputedStyle(element);
|
|
14825
14825
|
}
|
|
14826
|
-
function isTableElement(element) {
|
|
14827
|
-
return ["table", "td", "th"].indexOf(getNodeName(element)) >= 0;
|
|
14826
|
+
function isTableElement$1(element) {
|
|
14827
|
+
return ["table", "td", "th"].indexOf(getNodeName$1(element)) >= 0;
|
|
14828
14828
|
}
|
|
14829
|
-
function getDocumentElement(element) {
|
|
14830
|
-
return ((isElement$
|
|
14829
|
+
function getDocumentElement$1(element) {
|
|
14830
|
+
return ((isElement$2(element) ? element.ownerDocument : (
|
|
14831
14831
|
// $FlowFixMe[prop-missing]
|
|
14832
14832
|
element.document
|
|
14833
14833
|
)) || window.document).documentElement;
|
|
14834
14834
|
}
|
|
14835
|
-
function getParentNode(element) {
|
|
14836
|
-
if (getNodeName(element) === "html") {
|
|
14835
|
+
function getParentNode$1(element) {
|
|
14836
|
+
if (getNodeName$1(element) === "html") {
|
|
14837
14837
|
return element;
|
|
14838
14838
|
}
|
|
14839
14839
|
return (
|
|
@@ -14842,33 +14842,33 @@ function getParentNode(element) {
|
|
|
14842
14842
|
// $FlowFixMe[prop-missing]
|
|
14843
14843
|
element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
|
|
14844
14844
|
element.parentNode || // DOM Element detected
|
|
14845
|
-
(isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
|
|
14845
|
+
(isShadowRoot$1(element) ? element.host : null) || // ShadowRoot detected
|
|
14846
14846
|
// $FlowFixMe[incompatible-call]: HTMLElement is a Node
|
|
14847
|
-
getDocumentElement(element)
|
|
14847
|
+
getDocumentElement$1(element)
|
|
14848
14848
|
);
|
|
14849
14849
|
}
|
|
14850
|
-
function getTrueOffsetParent(element) {
|
|
14851
|
-
if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
|
|
14852
|
-
getComputedStyle$
|
|
14850
|
+
function getTrueOffsetParent$1(element) {
|
|
14851
|
+
if (!isHTMLElement$1(element) || // https://github.com/popperjs/popper-core/issues/837
|
|
14852
|
+
getComputedStyle$2(element).position === "fixed") {
|
|
14853
14853
|
return null;
|
|
14854
14854
|
}
|
|
14855
14855
|
return element.offsetParent;
|
|
14856
14856
|
}
|
|
14857
|
-
function getContainingBlock(element) {
|
|
14857
|
+
function getContainingBlock$1(element) {
|
|
14858
14858
|
var isFirefox = /firefox/i.test(getUAString());
|
|
14859
14859
|
var isIE = /Trident/i.test(getUAString());
|
|
14860
|
-
if (isIE && isHTMLElement(element)) {
|
|
14861
|
-
var elementCss = getComputedStyle$
|
|
14860
|
+
if (isIE && isHTMLElement$1(element)) {
|
|
14861
|
+
var elementCss = getComputedStyle$2(element);
|
|
14862
14862
|
if (elementCss.position === "fixed") {
|
|
14863
14863
|
return null;
|
|
14864
14864
|
}
|
|
14865
14865
|
}
|
|
14866
|
-
var currentNode = getParentNode(element);
|
|
14867
|
-
if (isShadowRoot(currentNode)) {
|
|
14866
|
+
var currentNode = getParentNode$1(element);
|
|
14867
|
+
if (isShadowRoot$1(currentNode)) {
|
|
14868
14868
|
currentNode = currentNode.host;
|
|
14869
14869
|
}
|
|
14870
|
-
while (isHTMLElement(currentNode) && ["html", "body"].indexOf(getNodeName(currentNode)) < 0) {
|
|
14871
|
-
var css = getComputedStyle$
|
|
14870
|
+
while (isHTMLElement$1(currentNode) && ["html", "body"].indexOf(getNodeName$1(currentNode)) < 0) {
|
|
14871
|
+
var css = getComputedStyle$2(currentNode);
|
|
14872
14872
|
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") {
|
|
14873
14873
|
return currentNode;
|
|
14874
14874
|
} else {
|
|
@@ -14877,22 +14877,22 @@ function getContainingBlock(element) {
|
|
|
14877
14877
|
}
|
|
14878
14878
|
return null;
|
|
14879
14879
|
}
|
|
14880
|
-
function getOffsetParent(element) {
|
|
14881
|
-
var window2 = getWindow(element);
|
|
14882
|
-
var offsetParent = getTrueOffsetParent(element);
|
|
14883
|
-
while (offsetParent && isTableElement(offsetParent) && getComputedStyle$
|
|
14884
|
-
offsetParent = getTrueOffsetParent(offsetParent);
|
|
14880
|
+
function getOffsetParent$1(element) {
|
|
14881
|
+
var window2 = getWindow$1(element);
|
|
14882
|
+
var offsetParent = getTrueOffsetParent$1(element);
|
|
14883
|
+
while (offsetParent && isTableElement$1(offsetParent) && getComputedStyle$2(offsetParent).position === "static") {
|
|
14884
|
+
offsetParent = getTrueOffsetParent$1(offsetParent);
|
|
14885
14885
|
}
|
|
14886
|
-
if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle$
|
|
14886
|
+
if (offsetParent && (getNodeName$1(offsetParent) === "html" || getNodeName$1(offsetParent) === "body" && getComputedStyle$2(offsetParent).position === "static")) {
|
|
14887
14887
|
return window2;
|
|
14888
14888
|
}
|
|
14889
|
-
return offsetParent || getContainingBlock(element) || window2;
|
|
14889
|
+
return offsetParent || getContainingBlock$1(element) || window2;
|
|
14890
14890
|
}
|
|
14891
14891
|
function getMainAxisFromPlacement(placement) {
|
|
14892
14892
|
return ["top", "bottom"].indexOf(placement) >= 0 ? "x" : "y";
|
|
14893
14893
|
}
|
|
14894
|
-
function within(
|
|
14895
|
-
return max
|
|
14894
|
+
function within(min2, value, max2) {
|
|
14895
|
+
return max$1(min2, min$1(value, max2));
|
|
14896
14896
|
}
|
|
14897
14897
|
function withinMaxClamp(min2, value, max2) {
|
|
14898
14898
|
var v = within(min2, value, max2);
|
|
@@ -14939,7 +14939,7 @@ function arrow(_ref) {
|
|
|
14939
14939
|
var maxProp = axis === "y" ? bottom : right;
|
|
14940
14940
|
var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets2[axis] - state.rects.popper[len];
|
|
14941
14941
|
var startDiff = popperOffsets2[axis] - state.rects.reference[axis];
|
|
14942
|
-
var arrowOffsetParent = getOffsetParent(arrowElement);
|
|
14942
|
+
var arrowOffsetParent = getOffsetParent$1(arrowElement);
|
|
14943
14943
|
var clientSize = arrowOffsetParent ? axis === "y" ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
|
|
14944
14944
|
var centerToReference = endDiff / 2 - startDiff / 2;
|
|
14945
14945
|
var min2 = paddingObject[minProp];
|
|
@@ -14962,7 +14962,7 @@ function effect$1(_ref2) {
|
|
|
14962
14962
|
}
|
|
14963
14963
|
}
|
|
14964
14964
|
if (process.env.NODE_ENV !== "production") {
|
|
14965
|
-
if (!isHTMLElement(arrowElement)) {
|
|
14965
|
+
if (!isHTMLElement$1(arrowElement)) {
|
|
14966
14966
|
console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).', "To use an SVG arrow, wrap it in an HTMLElement that will be used as", "the arrow."].join(" "));
|
|
14967
14967
|
}
|
|
14968
14968
|
}
|
|
@@ -14996,8 +14996,8 @@ function roundOffsetsByDPR(_ref, win) {
|
|
|
14996
14996
|
var x = _ref.x, y = _ref.y;
|
|
14997
14997
|
var dpr = win.devicePixelRatio || 1;
|
|
14998
14998
|
return {
|
|
14999
|
-
x: round(x * dpr) / dpr || 0,
|
|
15000
|
-
y: round(y * dpr) / dpr || 0
|
|
14999
|
+
x: round$1(x * dpr) / dpr || 0,
|
|
15000
|
+
y: round$1(y * dpr) / dpr || 0
|
|
15001
15001
|
};
|
|
15002
15002
|
}
|
|
15003
15003
|
function mapToStyles(_ref2) {
|
|
@@ -15019,12 +15019,12 @@ function mapToStyles(_ref2) {
|
|
|
15019
15019
|
var sideY = top;
|
|
15020
15020
|
var win = window;
|
|
15021
15021
|
if (adaptive) {
|
|
15022
|
-
var offsetParent = getOffsetParent(popper2);
|
|
15022
|
+
var offsetParent = getOffsetParent$1(popper2);
|
|
15023
15023
|
var heightProp = "clientHeight";
|
|
15024
15024
|
var widthProp = "clientWidth";
|
|
15025
|
-
if (offsetParent === getWindow(popper2)) {
|
|
15026
|
-
offsetParent = getDocumentElement(popper2);
|
|
15027
|
-
if (getComputedStyle$
|
|
15025
|
+
if (offsetParent === getWindow$1(popper2)) {
|
|
15026
|
+
offsetParent = getDocumentElement$1(popper2);
|
|
15027
|
+
if (getComputedStyle$2(offsetParent).position !== "static" && position === "absolute") {
|
|
15028
15028
|
heightProp = "scrollHeight";
|
|
15029
15029
|
widthProp = "scrollWidth";
|
|
15030
15030
|
}
|
|
@@ -15055,7 +15055,7 @@ function mapToStyles(_ref2) {
|
|
|
15055
15055
|
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
|
|
15056
15056
|
x,
|
|
15057
15057
|
y
|
|
15058
|
-
}, getWindow(popper2)) : {
|
|
15058
|
+
}, getWindow$1(popper2)) : {
|
|
15059
15059
|
x,
|
|
15060
15060
|
y
|
|
15061
15061
|
};
|
|
@@ -15071,7 +15071,7 @@ function computeStyles(_ref5) {
|
|
|
15071
15071
|
var state = _ref5.state, options = _ref5.options;
|
|
15072
15072
|
var _options$gpuAccelerat = options.gpuAcceleration, gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, _options$adaptive = options.adaptive, adaptive = _options$adaptive === void 0 ? true : _options$adaptive, _options$roundOffsets = options.roundOffsets, roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
|
|
15073
15073
|
if (process.env.NODE_ENV !== "production") {
|
|
15074
|
-
var transitionProperty = getComputedStyle$
|
|
15074
|
+
var transitionProperty = getComputedStyle$2(state.elements.popper).transitionProperty || "";
|
|
15075
15075
|
if (adaptive && ["transform", "top", "right", "bottom", "left"].some(function(property) {
|
|
15076
15076
|
return transitionProperty.indexOf(property) >= 0;
|
|
15077
15077
|
})) {
|
|
@@ -15119,7 +15119,7 @@ var passive = {
|
|
|
15119
15119
|
function effect(_ref) {
|
|
15120
15120
|
var state = _ref.state, instance = _ref.instance, options = _ref.options;
|
|
15121
15121
|
var _options$scroll = options.scroll, scroll = _options$scroll === void 0 ? true : _options$scroll, _options$resize = options.resize, resize = _options$resize === void 0 ? true : _options$resize;
|
|
15122
|
-
var window2 = getWindow(state.elements.popper);
|
|
15122
|
+
var window2 = getWindow$1(state.elements.popper);
|
|
15123
15123
|
var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
|
|
15124
15124
|
if (scroll) {
|
|
15125
15125
|
scrollParents.forEach(function(scrollParent) {
|
|
@@ -15170,7 +15170,7 @@ function getOppositeVariationPlacement(placement) {
|
|
|
15170
15170
|
});
|
|
15171
15171
|
}
|
|
15172
15172
|
function getWindowScroll(node) {
|
|
15173
|
-
var win = getWindow(node);
|
|
15173
|
+
var win = getWindow$1(node);
|
|
15174
15174
|
var scrollLeft = win.pageXOffset;
|
|
15175
15175
|
var scrollTop = win.pageYOffset;
|
|
15176
15176
|
return {
|
|
@@ -15178,12 +15178,12 @@ function getWindowScroll(node) {
|
|
|
15178
15178
|
scrollTop
|
|
15179
15179
|
};
|
|
15180
15180
|
}
|
|
15181
|
-
function getWindowScrollBarX(element) {
|
|
15182
|
-
return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
|
|
15181
|
+
function getWindowScrollBarX$1(element) {
|
|
15182
|
+
return getBoundingClientRect$1(getDocumentElement$1(element)).left + getWindowScroll(element).scrollLeft;
|
|
15183
15183
|
}
|
|
15184
|
-
function getViewportRect(element, strategy) {
|
|
15185
|
-
var win = getWindow(element);
|
|
15186
|
-
var html = getDocumentElement(element);
|
|
15184
|
+
function getViewportRect$1(element, strategy) {
|
|
15185
|
+
var win = getWindow$1(element);
|
|
15186
|
+
var html = getDocumentElement$1(element);
|
|
15187
15187
|
var visualViewport = win.visualViewport;
|
|
15188
15188
|
var width = html.clientWidth;
|
|
15189
15189
|
var height = html.clientHeight;
|
|
@@ -15201,21 +15201,21 @@ function getViewportRect(element, strategy) {
|
|
|
15201
15201
|
return {
|
|
15202
15202
|
width,
|
|
15203
15203
|
height,
|
|
15204
|
-
x: x + getWindowScrollBarX(element),
|
|
15204
|
+
x: x + getWindowScrollBarX$1(element),
|
|
15205
15205
|
y
|
|
15206
15206
|
};
|
|
15207
15207
|
}
|
|
15208
|
-
function getDocumentRect(element) {
|
|
15208
|
+
function getDocumentRect$1(element) {
|
|
15209
15209
|
var _element$ownerDocumen;
|
|
15210
|
-
var html = getDocumentElement(element);
|
|
15210
|
+
var html = getDocumentElement$1(element);
|
|
15211
15211
|
var winScroll = getWindowScroll(element);
|
|
15212
15212
|
var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
|
|
15213
|
-
var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
|
|
15214
|
-
var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
|
15215
|
-
var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
|
|
15213
|
+
var width = max$1(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
|
|
15214
|
+
var height = max$1(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
|
15215
|
+
var x = -winScroll.scrollLeft + getWindowScrollBarX$1(element);
|
|
15216
15216
|
var y = -winScroll.scrollTop;
|
|
15217
|
-
if (getComputedStyle$
|
|
15218
|
-
x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
|
|
15217
|
+
if (getComputedStyle$2(body || html).direction === "rtl") {
|
|
15218
|
+
x += max$1(html.clientWidth, body ? body.clientWidth : 0) - width;
|
|
15219
15219
|
}
|
|
15220
15220
|
return {
|
|
15221
15221
|
width,
|
|
@@ -15225,17 +15225,17 @@ function getDocumentRect(element) {
|
|
|
15225
15225
|
};
|
|
15226
15226
|
}
|
|
15227
15227
|
function isScrollParent(element) {
|
|
15228
|
-
var _getComputedStyle = getComputedStyle$
|
|
15228
|
+
var _getComputedStyle = getComputedStyle$2(element), overflow = _getComputedStyle.overflow, overflowX = _getComputedStyle.overflowX, overflowY = _getComputedStyle.overflowY;
|
|
15229
15229
|
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
|
|
15230
15230
|
}
|
|
15231
15231
|
function getScrollParent(node) {
|
|
15232
|
-
if (["html", "body", "#document"].indexOf(getNodeName(node)) >= 0) {
|
|
15232
|
+
if (["html", "body", "#document"].indexOf(getNodeName$1(node)) >= 0) {
|
|
15233
15233
|
return node.ownerDocument.body;
|
|
15234
15234
|
}
|
|
15235
|
-
if (isHTMLElement(node) && isScrollParent(node)) {
|
|
15235
|
+
if (isHTMLElement$1(node) && isScrollParent(node)) {
|
|
15236
15236
|
return node;
|
|
15237
15237
|
}
|
|
15238
|
-
return getScrollParent(getParentNode(node));
|
|
15238
|
+
return getScrollParent(getParentNode$1(node));
|
|
15239
15239
|
}
|
|
15240
15240
|
function listScrollParents(element, list) {
|
|
15241
15241
|
var _element$ownerDocumen;
|
|
@@ -15244,15 +15244,15 @@ function listScrollParents(element, list) {
|
|
|
15244
15244
|
}
|
|
15245
15245
|
var scrollParent = getScrollParent(element);
|
|
15246
15246
|
var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
|
|
15247
|
-
var win = getWindow(scrollParent);
|
|
15247
|
+
var win = getWindow$1(scrollParent);
|
|
15248
15248
|
var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
|
|
15249
15249
|
var updatedList = list.concat(target);
|
|
15250
15250
|
return isBody ? updatedList : (
|
|
15251
15251
|
// $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
|
|
15252
|
-
updatedList.concat(listScrollParents(getParentNode(target)))
|
|
15252
|
+
updatedList.concat(listScrollParents(getParentNode$1(target)))
|
|
15253
15253
|
);
|
|
15254
15254
|
}
|
|
15255
|
-
function rectToClientRect(rect) {
|
|
15255
|
+
function rectToClientRect$1(rect) {
|
|
15256
15256
|
return Object.assign({}, rect, {
|
|
15257
15257
|
left: rect.x,
|
|
15258
15258
|
top: rect.y,
|
|
@@ -15260,8 +15260,8 @@ function rectToClientRect(rect) {
|
|
|
15260
15260
|
bottom: rect.y + rect.height
|
|
15261
15261
|
});
|
|
15262
15262
|
}
|
|
15263
|
-
function getInnerBoundingClientRect(element, strategy) {
|
|
15264
|
-
var rect = getBoundingClientRect(element, false, strategy === "fixed");
|
|
15263
|
+
function getInnerBoundingClientRect$1(element, strategy) {
|
|
15264
|
+
var rect = getBoundingClientRect$1(element, false, strategy === "fixed");
|
|
15265
15265
|
rect.top = rect.top + element.clientTop;
|
|
15266
15266
|
rect.left = rect.left + element.clientLeft;
|
|
15267
15267
|
rect.bottom = rect.top + element.clientHeight;
|
|
@@ -15273,29 +15273,29 @@ function getInnerBoundingClientRect(element, strategy) {
|
|
|
15273
15273
|
return rect;
|
|
15274
15274
|
}
|
|
15275
15275
|
function getClientRectFromMixedType(element, clippingParent, strategy) {
|
|
15276
|
-
return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement$
|
|
15276
|
+
return clippingParent === viewport ? rectToClientRect$1(getViewportRect$1(element, strategy)) : isElement$2(clippingParent) ? getInnerBoundingClientRect$1(clippingParent, strategy) : rectToClientRect$1(getDocumentRect$1(getDocumentElement$1(element)));
|
|
15277
15277
|
}
|
|
15278
15278
|
function getClippingParents(element) {
|
|
15279
|
-
var clippingParents2 = listScrollParents(getParentNode(element));
|
|
15280
|
-
var canEscapeClipping = ["absolute", "fixed"].indexOf(getComputedStyle$
|
|
15281
|
-
var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
|
|
15282
|
-
if (!isElement$
|
|
15279
|
+
var clippingParents2 = listScrollParents(getParentNode$1(element));
|
|
15280
|
+
var canEscapeClipping = ["absolute", "fixed"].indexOf(getComputedStyle$2(element).position) >= 0;
|
|
15281
|
+
var clipperElement = canEscapeClipping && isHTMLElement$1(element) ? getOffsetParent$1(element) : element;
|
|
15282
|
+
if (!isElement$2(clipperElement)) {
|
|
15283
15283
|
return [];
|
|
15284
15284
|
}
|
|
15285
15285
|
return clippingParents2.filter(function(clippingParent) {
|
|
15286
|
-
return isElement$
|
|
15286
|
+
return isElement$2(clippingParent) && contains(clippingParent, clipperElement) && getNodeName$1(clippingParent) !== "body";
|
|
15287
15287
|
});
|
|
15288
15288
|
}
|
|
15289
|
-
function getClippingRect(element, boundary, rootBoundary, strategy) {
|
|
15289
|
+
function getClippingRect$1(element, boundary, rootBoundary, strategy) {
|
|
15290
15290
|
var mainClippingParents = boundary === "clippingParents" ? getClippingParents(element) : [].concat(boundary);
|
|
15291
15291
|
var clippingParents2 = [].concat(mainClippingParents, [rootBoundary]);
|
|
15292
15292
|
var firstClippingParent = clippingParents2[0];
|
|
15293
15293
|
var clippingRect = clippingParents2.reduce(function(accRect, clippingParent) {
|
|
15294
15294
|
var rect = getClientRectFromMixedType(element, clippingParent, strategy);
|
|
15295
|
-
accRect.top = max(rect.top, accRect.top);
|
|
15296
|
-
accRect.right = min(rect.right, accRect.right);
|
|
15297
|
-
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
15298
|
-
accRect.left = max(rect.left, accRect.left);
|
|
15295
|
+
accRect.top = max$1(rect.top, accRect.top);
|
|
15296
|
+
accRect.right = min$1(rect.right, accRect.right);
|
|
15297
|
+
accRect.bottom = min$1(rect.bottom, accRect.bottom);
|
|
15298
|
+
accRect.left = max$1(rect.left, accRect.left);
|
|
15299
15299
|
return accRect;
|
|
15300
15300
|
}, getClientRectFromMixedType(element, firstClippingParent, strategy));
|
|
15301
15301
|
clippingRect.width = clippingRect.right - clippingRect.left;
|
|
@@ -15356,7 +15356,7 @@ function computeOffsets(_ref) {
|
|
|
15356
15356
|
}
|
|
15357
15357
|
return offsets;
|
|
15358
15358
|
}
|
|
15359
|
-
function detectOverflow(state, options) {
|
|
15359
|
+
function detectOverflow$1(state, options) {
|
|
15360
15360
|
if (options === void 0) {
|
|
15361
15361
|
options = {};
|
|
15362
15362
|
}
|
|
@@ -15365,15 +15365,15 @@ function detectOverflow(state, options) {
|
|
|
15365
15365
|
var altContext = elementContext === popper ? reference : popper;
|
|
15366
15366
|
var popperRect = state.rects.popper;
|
|
15367
15367
|
var element = state.elements[altBoundary ? altContext : elementContext];
|
|
15368
|
-
var clippingClientRect = getClippingRect(isElement$
|
|
15369
|
-
var referenceClientRect = getBoundingClientRect(state.elements.reference);
|
|
15368
|
+
var clippingClientRect = getClippingRect$1(isElement$2(element) ? element : element.contextElement || getDocumentElement$1(state.elements.popper), boundary, rootBoundary, strategy);
|
|
15369
|
+
var referenceClientRect = getBoundingClientRect$1(state.elements.reference);
|
|
15370
15370
|
var popperOffsets2 = computeOffsets({
|
|
15371
15371
|
reference: referenceClientRect,
|
|
15372
15372
|
element: popperRect,
|
|
15373
15373
|
strategy: "absolute",
|
|
15374
15374
|
placement
|
|
15375
15375
|
});
|
|
15376
|
-
var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets2));
|
|
15376
|
+
var popperClientRect = rectToClientRect$1(Object.assign({}, popperRect, popperOffsets2));
|
|
15377
15377
|
var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect;
|
|
15378
15378
|
var overflowOffsets = {
|
|
15379
15379
|
top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
|
|
@@ -15411,7 +15411,7 @@ function computeAutoPlacement(state, options) {
|
|
|
15411
15411
|
}
|
|
15412
15412
|
}
|
|
15413
15413
|
var overflows = allowedPlacements.reduce(function(acc, placement2) {
|
|
15414
|
-
acc[placement2] = detectOverflow(state, {
|
|
15414
|
+
acc[placement2] = detectOverflow$1(state, {
|
|
15415
15415
|
placement: placement2,
|
|
15416
15416
|
boundary,
|
|
15417
15417
|
rootBoundary,
|
|
@@ -15461,7 +15461,7 @@ function flip(_ref) {
|
|
|
15461
15461
|
var isStartVariation = getVariation(placement) === start;
|
|
15462
15462
|
var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
|
|
15463
15463
|
var len = isVertical ? "width" : "height";
|
|
15464
|
-
var overflow = detectOverflow(state, {
|
|
15464
|
+
var overflow = detectOverflow$1(state, {
|
|
15465
15465
|
placement,
|
|
15466
15466
|
boundary,
|
|
15467
15467
|
rootBoundary,
|
|
@@ -15551,10 +15551,10 @@ function hide(_ref) {
|
|
|
15551
15551
|
var referenceRect = state.rects.reference;
|
|
15552
15552
|
var popperRect = state.rects.popper;
|
|
15553
15553
|
var preventedOffsets = state.modifiersData.preventOverflow;
|
|
15554
|
-
var referenceOverflow = detectOverflow(state, {
|
|
15554
|
+
var referenceOverflow = detectOverflow$1(state, {
|
|
15555
15555
|
elementContext: "reference"
|
|
15556
15556
|
});
|
|
15557
|
-
var popperAltOverflow = detectOverflow(state, {
|
|
15557
|
+
var popperAltOverflow = detectOverflow$1(state, {
|
|
15558
15558
|
altBoundary: true
|
|
15559
15559
|
});
|
|
15560
15560
|
var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
|
|
@@ -15595,7 +15595,7 @@ function distanceAndSkiddingToXY(placement, rects, offset2) {
|
|
|
15595
15595
|
y: distance
|
|
15596
15596
|
};
|
|
15597
15597
|
}
|
|
15598
|
-
function offset(_ref2) {
|
|
15598
|
+
function offset$1(_ref2) {
|
|
15599
15599
|
var state = _ref2.state, options = _ref2.options, name = _ref2.name;
|
|
15600
15600
|
var _options$offset = options.offset, offset2 = _options$offset === void 0 ? [0, 0] : _options$offset;
|
|
15601
15601
|
var data = placements.reduce(function(acc, placement) {
|
|
@@ -15609,12 +15609,12 @@ function offset(_ref2) {
|
|
|
15609
15609
|
}
|
|
15610
15610
|
state.modifiersData[name] = data;
|
|
15611
15611
|
}
|
|
15612
|
-
const offset$
|
|
15612
|
+
const offset$2 = {
|
|
15613
15613
|
name: "offset",
|
|
15614
15614
|
enabled: true,
|
|
15615
15615
|
phase: "main",
|
|
15616
15616
|
requires: ["popperOffsets"],
|
|
15617
|
-
fn: offset
|
|
15617
|
+
fn: offset$1
|
|
15618
15618
|
};
|
|
15619
15619
|
function popperOffsets(_ref) {
|
|
15620
15620
|
var state = _ref.state, name = _ref.name;
|
|
@@ -15638,7 +15638,7 @@ function getAltAxis(axis) {
|
|
|
15638
15638
|
function preventOverflow(_ref) {
|
|
15639
15639
|
var state = _ref.state, options = _ref.options, name = _ref.name;
|
|
15640
15640
|
var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, padding = options.padding, _options$tether = options.tether, tether = _options$tether === void 0 ? true : _options$tether, _options$tetherOffset = options.tetherOffset, tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
|
|
15641
|
-
var overflow = detectOverflow(state, {
|
|
15641
|
+
var overflow = detectOverflow$1(state, {
|
|
15642
15642
|
boundary,
|
|
15643
15643
|
rootBoundary,
|
|
15644
15644
|
padding,
|
|
@@ -15676,8 +15676,8 @@ function preventOverflow(_ref) {
|
|
|
15676
15676
|
var altSide = mainAxis === "y" ? bottom : right;
|
|
15677
15677
|
var len = mainAxis === "y" ? "height" : "width";
|
|
15678
15678
|
var offset2 = popperOffsets2[mainAxis];
|
|
15679
|
-
var
|
|
15680
|
-
var
|
|
15679
|
+
var min2 = offset2 + overflow[mainSide];
|
|
15680
|
+
var max2 = offset2 - overflow[altSide];
|
|
15681
15681
|
var additive = tether ? -popperRect[len] / 2 : 0;
|
|
15682
15682
|
var minLen = variation === start ? referenceRect[len] : popperRect[len];
|
|
15683
15683
|
var maxLen = variation === start ? -popperRect[len] : -referenceRect[len];
|
|
@@ -15692,12 +15692,12 @@ function preventOverflow(_ref) {
|
|
|
15692
15692
|
var arrowLen = within(0, referenceRect[len], arrowRect[len]);
|
|
15693
15693
|
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
|
|
15694
15694
|
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
|
|
15695
|
-
var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
|
|
15695
|
+
var arrowOffsetParent = state.elements.arrow && getOffsetParent$1(state.elements.arrow);
|
|
15696
15696
|
var clientOffset = arrowOffsetParent ? mainAxis === "y" ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
|
|
15697
15697
|
var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
|
|
15698
15698
|
var tetherMin = offset2 + minOffset - offsetModifierValue - clientOffset;
|
|
15699
15699
|
var tetherMax = offset2 + maxOffset - offsetModifierValue;
|
|
15700
|
-
var preventedOffset = within(tether ? min
|
|
15700
|
+
var preventedOffset = within(tether ? min$1(min2, tetherMin) : min2, offset2, tether ? max$1(max2, tetherMax) : max2);
|
|
15701
15701
|
popperOffsets2[mainAxis] = preventedOffset;
|
|
15702
15702
|
data[mainAxis] = preventedOffset - offset2;
|
|
15703
15703
|
}
|
|
@@ -15732,8 +15732,8 @@ function getHTMLElementScroll(element) {
|
|
|
15732
15732
|
scrollTop: element.scrollTop
|
|
15733
15733
|
};
|
|
15734
15734
|
}
|
|
15735
|
-
function getNodeScroll(node) {
|
|
15736
|
-
if (node === getWindow(node) || !isHTMLElement(node)) {
|
|
15735
|
+
function getNodeScroll$1(node) {
|
|
15736
|
+
if (node === getWindow$1(node) || !isHTMLElement$1(node)) {
|
|
15737
15737
|
return getWindowScroll(node);
|
|
15738
15738
|
} else {
|
|
15739
15739
|
return getHTMLElementScroll(node);
|
|
@@ -15741,18 +15741,18 @@ function getNodeScroll(node) {
|
|
|
15741
15741
|
}
|
|
15742
15742
|
function isElementScaled(element) {
|
|
15743
15743
|
var rect = element.getBoundingClientRect();
|
|
15744
|
-
var scaleX = round(rect.width) / element.offsetWidth || 1;
|
|
15745
|
-
var scaleY = round(rect.height) / element.offsetHeight || 1;
|
|
15744
|
+
var scaleX = round$1(rect.width) / element.offsetWidth || 1;
|
|
15745
|
+
var scaleY = round$1(rect.height) / element.offsetHeight || 1;
|
|
15746
15746
|
return scaleX !== 1 || scaleY !== 1;
|
|
15747
15747
|
}
|
|
15748
15748
|
function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
15749
15749
|
if (isFixed === void 0) {
|
|
15750
15750
|
isFixed = false;
|
|
15751
15751
|
}
|
|
15752
|
-
var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
15753
|
-
var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
|
15754
|
-
var documentElement = getDocumentElement(offsetParent);
|
|
15755
|
-
var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);
|
|
15752
|
+
var isOffsetParentAnElement = isHTMLElement$1(offsetParent);
|
|
15753
|
+
var offsetParentIsScaled = isHTMLElement$1(offsetParent) && isElementScaled(offsetParent);
|
|
15754
|
+
var documentElement = getDocumentElement$1(offsetParent);
|
|
15755
|
+
var rect = getBoundingClientRect$1(elementOrVirtualElement, offsetParentIsScaled, isFixed);
|
|
15756
15756
|
var scroll = {
|
|
15757
15757
|
scrollLeft: 0,
|
|
15758
15758
|
scrollTop: 0
|
|
@@ -15762,16 +15762,16 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
|
15762
15762
|
y: 0
|
|
15763
15763
|
};
|
|
15764
15764
|
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
15765
|
-
if (getNodeName(offsetParent) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
|
|
15765
|
+
if (getNodeName$1(offsetParent) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
|
|
15766
15766
|
isScrollParent(documentElement)) {
|
|
15767
|
-
scroll = getNodeScroll(offsetParent);
|
|
15767
|
+
scroll = getNodeScroll$1(offsetParent);
|
|
15768
15768
|
}
|
|
15769
|
-
if (isHTMLElement(offsetParent)) {
|
|
15770
|
-
offsets = getBoundingClientRect(offsetParent, true);
|
|
15769
|
+
if (isHTMLElement$1(offsetParent)) {
|
|
15770
|
+
offsets = getBoundingClientRect$1(offsetParent, true);
|
|
15771
15771
|
offsets.x += offsetParent.clientLeft;
|
|
15772
15772
|
offsets.y += offsetParent.clientTop;
|
|
15773
15773
|
} else if (documentElement) {
|
|
15774
|
-
offsets.x = getWindowScrollBarX(documentElement);
|
|
15774
|
+
offsets.x = getWindowScrollBarX$1(documentElement);
|
|
15775
15775
|
}
|
|
15776
15776
|
}
|
|
15777
15777
|
return {
|
|
@@ -15968,7 +15968,7 @@ function popperGenerator(generatorOptions) {
|
|
|
15968
15968
|
cleanupModifierEffects();
|
|
15969
15969
|
state.options = Object.assign({}, defaultOptions, state.options, options2);
|
|
15970
15970
|
state.scrollParents = {
|
|
15971
|
-
reference: isElement$
|
|
15971
|
+
reference: isElement$2(reference2) ? listScrollParents(reference2) : reference2.contextElement ? listScrollParents(reference2.contextElement) : [],
|
|
15972
15972
|
popper: listScrollParents(popper2)
|
|
15973
15973
|
};
|
|
15974
15974
|
var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers2, state.options.modifiers)));
|
|
@@ -15990,7 +15990,7 @@ function popperGenerator(generatorOptions) {
|
|
|
15990
15990
|
console.error(['Popper: "auto" placements require the "flip" modifier be', "present and enabled to work."].join(" "));
|
|
15991
15991
|
}
|
|
15992
15992
|
}
|
|
15993
|
-
var _getComputedStyle = getComputedStyle$
|
|
15993
|
+
var _getComputedStyle = getComputedStyle$2(popper2), marginTop = _getComputedStyle.marginTop, marginRight = _getComputedStyle.marginRight, marginBottom = _getComputedStyle.marginBottom, marginLeft = _getComputedStyle.marginLeft;
|
|
15994
15994
|
if ([marginTop, marginRight, marginBottom, marginLeft].some(function(margin) {
|
|
15995
15995
|
return parseFloat(margin);
|
|
15996
15996
|
})) {
|
|
@@ -16017,7 +16017,7 @@ function popperGenerator(generatorOptions) {
|
|
|
16017
16017
|
return;
|
|
16018
16018
|
}
|
|
16019
16019
|
state.rects = {
|
|
16020
|
-
reference: getCompositeRect(reference3, getOffsetParent(popper3), state.options.strategy === "fixed"),
|
|
16020
|
+
reference: getCompositeRect(reference3, getOffsetParent$1(popper3), state.options.strategy === "fixed"),
|
|
16021
16021
|
popper: getLayoutRect(popper3)
|
|
16022
16022
|
};
|
|
16023
16023
|
state.reset = false;
|
|
@@ -16099,7 +16099,7 @@ function popperGenerator(generatorOptions) {
|
|
|
16099
16099
|
return instance;
|
|
16100
16100
|
};
|
|
16101
16101
|
}
|
|
16102
|
-
var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$
|
|
16102
|
+
var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$2, flip$1, preventOverflow$1, arrow$1, hide$1];
|
|
16103
16103
|
var createPopper = /* @__PURE__ */ popperGenerator({
|
|
16104
16104
|
defaultModifiers
|
|
16105
16105
|
});
|
|
@@ -16184,7 +16184,7 @@ function removeUndefinedProps(obj) {
|
|
|
16184
16184
|
function div() {
|
|
16185
16185
|
return document.createElement("div");
|
|
16186
16186
|
}
|
|
16187
|
-
function isElement(value) {
|
|
16187
|
+
function isElement$1(value) {
|
|
16188
16188
|
return ["Element", "Fragment"].some(function(type) {
|
|
16189
16189
|
return isType(value, type);
|
|
16190
16190
|
});
|
|
@@ -16199,7 +16199,7 @@ function isReferenceElement(value) {
|
|
|
16199
16199
|
return !!(value && value._tippy && value._tippy.reference === value);
|
|
16200
16200
|
}
|
|
16201
16201
|
function getArrayOfElements(value) {
|
|
16202
|
-
if (isElement(value)) {
|
|
16202
|
+
if (isElement$1(value)) {
|
|
16203
16203
|
return [value];
|
|
16204
16204
|
}
|
|
16205
16205
|
if (isNodeList(value)) {
|
|
@@ -16508,7 +16508,7 @@ function createArrowElement(value) {
|
|
|
16508
16508
|
arrow2.className = ARROW_CLASS;
|
|
16509
16509
|
} else {
|
|
16510
16510
|
arrow2.className = SVG_ARROW_CLASS;
|
|
16511
|
-
if (isElement(value)) {
|
|
16511
|
+
if (isElement$1(value)) {
|
|
16512
16512
|
arrow2.appendChild(value);
|
|
16513
16513
|
} else {
|
|
16514
16514
|
dangerouslySetInnerHTML(arrow2, value);
|
|
@@ -16517,7 +16517,7 @@ function createArrowElement(value) {
|
|
|
16517
16517
|
return arrow2;
|
|
16518
16518
|
}
|
|
16519
16519
|
function setContent(content, props) {
|
|
16520
|
-
if (isElement(props.content)) {
|
|
16520
|
+
if (isElement$1(props.content)) {
|
|
16521
16521
|
dangerouslySetInnerHTML(content, "");
|
|
16522
16522
|
content.appendChild(props.content);
|
|
16523
16523
|
} else if (typeof props.content !== "function") {
|
|
@@ -17340,7 +17340,7 @@ function tippy(targets, optionalProps) {
|
|
|
17340
17340
|
});
|
|
17341
17341
|
var elements = getArrayOfElements(targets);
|
|
17342
17342
|
if (process.env.NODE_ENV !== "production") {
|
|
17343
|
-
var isSingleContentElement = isElement(passedProps.content);
|
|
17343
|
+
var isSingleContentElement = isElement$1(passedProps.content);
|
|
17344
17344
|
var isMoreThanOneReferenceElement = elements.length > 1;
|
|
17345
17345
|
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(" "));
|
|
17346
17346
|
}
|
|
@@ -17351,7 +17351,7 @@ function tippy(targets, optionalProps) {
|
|
|
17351
17351
|
}
|
|
17352
17352
|
return acc;
|
|
17353
17353
|
}, []);
|
|
17354
|
-
return isElement(targets) ? instances[0] : instances;
|
|
17354
|
+
return isElement$1(targets) ? instances[0] : instances;
|
|
17355
17355
|
}
|
|
17356
17356
|
tippy.defaultProps = defaultProps;
|
|
17357
17357
|
tippy.setDefaultProps = setDefaultProps;
|
|
@@ -18156,7 +18156,7 @@ class JsonSerializer {
|
|
|
18156
18156
|
return JSON.stringify(json);
|
|
18157
18157
|
}
|
|
18158
18158
|
}
|
|
18159
|
-
const Text$1 =
|
|
18159
|
+
const Text$1 = Node$1.create({
|
|
18160
18160
|
name: "text",
|
|
18161
18161
|
group: "inline"
|
|
18162
18162
|
});
|
|
@@ -21300,7 +21300,7 @@ const SelectionProcessor = Extension.create({
|
|
|
21300
21300
|
};
|
|
21301
21301
|
}
|
|
21302
21302
|
});
|
|
21303
|
-
const Document$1 =
|
|
21303
|
+
const Document$1 = Node$1.create({
|
|
21304
21304
|
name: "doc",
|
|
21305
21305
|
topNode: true,
|
|
21306
21306
|
content: "block+"
|
|
@@ -21315,7 +21315,7 @@ class SetDocAttr extends Step {
|
|
|
21315
21315
|
}
|
|
21316
21316
|
apply(doc2) {
|
|
21317
21317
|
this.prevValue = doc2.attrs.meta[this.key];
|
|
21318
|
-
const newDoc = Node$
|
|
21318
|
+
const newDoc = Node$2.fromJSON(this.schema, doc2.toJSON());
|
|
21319
21319
|
newDoc.attrs.meta[this.key] = this.value;
|
|
21320
21320
|
return StepResult.ok(newDoc);
|
|
21321
21321
|
}
|
|
@@ -21356,7 +21356,7 @@ const Document = Document$1.extend({
|
|
|
21356
21356
|
};
|
|
21357
21357
|
}
|
|
21358
21358
|
});
|
|
21359
|
-
const Paragraph$1 =
|
|
21359
|
+
const Paragraph$1 = Node$1.create({
|
|
21360
21360
|
name: "paragraph",
|
|
21361
21361
|
priority: 1e3,
|
|
21362
21362
|
addOptions() {
|
|
@@ -21393,7 +21393,7 @@ const Paragraph = Paragraph$1.extend({
|
|
|
21393
21393
|
HTMLAttributes: { class: "zw-style" }
|
|
21394
21394
|
})
|
|
21395
21395
|
});
|
|
21396
|
-
const Heading$1 =
|
|
21396
|
+
const Heading$1 = Node$1.create({
|
|
21397
21397
|
name: "heading",
|
|
21398
21398
|
addOptions() {
|
|
21399
21399
|
return {
|
|
@@ -22287,7 +22287,7 @@ const LineHeight = Extension.create({
|
|
|
22287
22287
|
};
|
|
22288
22288
|
}
|
|
22289
22289
|
});
|
|
22290
|
-
const ListItem$1 =
|
|
22290
|
+
const ListItem$1 = Node$1.create({
|
|
22291
22291
|
name: "listItem",
|
|
22292
22292
|
addOptions() {
|
|
22293
22293
|
return {
|
|
@@ -22350,7 +22350,7 @@ const ListItem = ListItem$1.extend({
|
|
|
22350
22350
|
}
|
|
22351
22351
|
})
|
|
22352
22352
|
});
|
|
22353
|
-
const List =
|
|
22353
|
+
const List = Node$1.create({
|
|
22354
22354
|
name: NodeTypes.LIST,
|
|
22355
22355
|
content: `${NodeTypes.LIST_ITEM}+`,
|
|
22356
22356
|
group: "block list",
|
|
@@ -25182,51 +25182,1133 @@ function useNumberValue({ valueRef, digits, min: min2, max: max2, onChange }) {
|
|
|
25182
25182
|
decrement
|
|
25183
25183
|
};
|
|
25184
25184
|
}
|
|
25185
|
+
const min = Math.min;
|
|
25186
|
+
const max = Math.max;
|
|
25187
|
+
const round = Math.round;
|
|
25188
|
+
const floor = Math.floor;
|
|
25189
|
+
const createCoords = (v) => ({
|
|
25190
|
+
x: v,
|
|
25191
|
+
y: v
|
|
25192
|
+
});
|
|
25193
|
+
function clamp(start2, value, end2) {
|
|
25194
|
+
return max(start2, min(value, end2));
|
|
25195
|
+
}
|
|
25196
|
+
function evaluate(value, param) {
|
|
25197
|
+
return typeof value === "function" ? value(param) : value;
|
|
25198
|
+
}
|
|
25199
|
+
function getSide(placement) {
|
|
25200
|
+
return placement.split("-")[0];
|
|
25201
|
+
}
|
|
25202
|
+
function getAlignment(placement) {
|
|
25203
|
+
return placement.split("-")[1];
|
|
25204
|
+
}
|
|
25205
|
+
function getOppositeAxis(axis) {
|
|
25206
|
+
return axis === "x" ? "y" : "x";
|
|
25207
|
+
}
|
|
25208
|
+
function getAxisLength(axis) {
|
|
25209
|
+
return axis === "y" ? "height" : "width";
|
|
25210
|
+
}
|
|
25211
|
+
function getSideAxis(placement) {
|
|
25212
|
+
return ["top", "bottom"].includes(getSide(placement)) ? "y" : "x";
|
|
25213
|
+
}
|
|
25214
|
+
function getAlignmentAxis(placement) {
|
|
25215
|
+
return getOppositeAxis(getSideAxis(placement));
|
|
25216
|
+
}
|
|
25217
|
+
function expandPaddingObject(padding) {
|
|
25218
|
+
return {
|
|
25219
|
+
top: 0,
|
|
25220
|
+
right: 0,
|
|
25221
|
+
bottom: 0,
|
|
25222
|
+
left: 0,
|
|
25223
|
+
...padding
|
|
25224
|
+
};
|
|
25225
|
+
}
|
|
25226
|
+
function getPaddingObject(padding) {
|
|
25227
|
+
return typeof padding !== "number" ? expandPaddingObject(padding) : {
|
|
25228
|
+
top: padding,
|
|
25229
|
+
right: padding,
|
|
25230
|
+
bottom: padding,
|
|
25231
|
+
left: padding
|
|
25232
|
+
};
|
|
25233
|
+
}
|
|
25234
|
+
function rectToClientRect(rect) {
|
|
25235
|
+
return {
|
|
25236
|
+
...rect,
|
|
25237
|
+
top: rect.y,
|
|
25238
|
+
left: rect.x,
|
|
25239
|
+
right: rect.x + rect.width,
|
|
25240
|
+
bottom: rect.y + rect.height
|
|
25241
|
+
};
|
|
25242
|
+
}
|
|
25243
|
+
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
25244
|
+
let {
|
|
25245
|
+
reference: reference2,
|
|
25246
|
+
floating
|
|
25247
|
+
} = _ref;
|
|
25248
|
+
const sideAxis = getSideAxis(placement);
|
|
25249
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
25250
|
+
const alignLength = getAxisLength(alignmentAxis);
|
|
25251
|
+
const side = getSide(placement);
|
|
25252
|
+
const isVertical = sideAxis === "y";
|
|
25253
|
+
const commonX = reference2.x + reference2.width / 2 - floating.width / 2;
|
|
25254
|
+
const commonY = reference2.y + reference2.height / 2 - floating.height / 2;
|
|
25255
|
+
const commonAlign = reference2[alignLength] / 2 - floating[alignLength] / 2;
|
|
25256
|
+
let coords;
|
|
25257
|
+
switch (side) {
|
|
25258
|
+
case "top":
|
|
25259
|
+
coords = {
|
|
25260
|
+
x: commonX,
|
|
25261
|
+
y: reference2.y - floating.height
|
|
25262
|
+
};
|
|
25263
|
+
break;
|
|
25264
|
+
case "bottom":
|
|
25265
|
+
coords = {
|
|
25266
|
+
x: commonX,
|
|
25267
|
+
y: reference2.y + reference2.height
|
|
25268
|
+
};
|
|
25269
|
+
break;
|
|
25270
|
+
case "right":
|
|
25271
|
+
coords = {
|
|
25272
|
+
x: reference2.x + reference2.width,
|
|
25273
|
+
y: commonY
|
|
25274
|
+
};
|
|
25275
|
+
break;
|
|
25276
|
+
case "left":
|
|
25277
|
+
coords = {
|
|
25278
|
+
x: reference2.x - floating.width,
|
|
25279
|
+
y: commonY
|
|
25280
|
+
};
|
|
25281
|
+
break;
|
|
25282
|
+
default:
|
|
25283
|
+
coords = {
|
|
25284
|
+
x: reference2.x,
|
|
25285
|
+
y: reference2.y
|
|
25286
|
+
};
|
|
25287
|
+
}
|
|
25288
|
+
switch (getAlignment(placement)) {
|
|
25289
|
+
case "start":
|
|
25290
|
+
coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
|
|
25291
|
+
break;
|
|
25292
|
+
case "end":
|
|
25293
|
+
coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
|
25294
|
+
break;
|
|
25295
|
+
}
|
|
25296
|
+
return coords;
|
|
25297
|
+
}
|
|
25298
|
+
const computePosition$1 = async (reference2, floating, config) => {
|
|
25299
|
+
const {
|
|
25300
|
+
placement = "bottom",
|
|
25301
|
+
strategy = "absolute",
|
|
25302
|
+
middleware = [],
|
|
25303
|
+
platform: platform2
|
|
25304
|
+
} = config;
|
|
25305
|
+
const validMiddleware = middleware.filter(Boolean);
|
|
25306
|
+
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating));
|
|
25307
|
+
let rects = await platform2.getElementRects({
|
|
25308
|
+
reference: reference2,
|
|
25309
|
+
floating,
|
|
25310
|
+
strategy
|
|
25311
|
+
});
|
|
25312
|
+
let {
|
|
25313
|
+
x,
|
|
25314
|
+
y
|
|
25315
|
+
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
25316
|
+
let statefulPlacement = placement;
|
|
25317
|
+
let middlewareData = {};
|
|
25318
|
+
let resetCount = 0;
|
|
25319
|
+
for (let i = 0; i < validMiddleware.length; i++) {
|
|
25320
|
+
const {
|
|
25321
|
+
name,
|
|
25322
|
+
fn: fn2
|
|
25323
|
+
} = validMiddleware[i];
|
|
25324
|
+
const {
|
|
25325
|
+
x: nextX,
|
|
25326
|
+
y: nextY,
|
|
25327
|
+
data,
|
|
25328
|
+
reset: reset2
|
|
25329
|
+
} = await fn2({
|
|
25330
|
+
x,
|
|
25331
|
+
y,
|
|
25332
|
+
initialPlacement: placement,
|
|
25333
|
+
placement: statefulPlacement,
|
|
25334
|
+
strategy,
|
|
25335
|
+
middlewareData,
|
|
25336
|
+
rects,
|
|
25337
|
+
platform: platform2,
|
|
25338
|
+
elements: {
|
|
25339
|
+
reference: reference2,
|
|
25340
|
+
floating
|
|
25341
|
+
}
|
|
25342
|
+
});
|
|
25343
|
+
x = nextX != null ? nextX : x;
|
|
25344
|
+
y = nextY != null ? nextY : y;
|
|
25345
|
+
middlewareData = {
|
|
25346
|
+
...middlewareData,
|
|
25347
|
+
[name]: {
|
|
25348
|
+
...middlewareData[name],
|
|
25349
|
+
...data
|
|
25350
|
+
}
|
|
25351
|
+
};
|
|
25352
|
+
if (reset2 && resetCount <= 50) {
|
|
25353
|
+
resetCount++;
|
|
25354
|
+
if (typeof reset2 === "object") {
|
|
25355
|
+
if (reset2.placement) {
|
|
25356
|
+
statefulPlacement = reset2.placement;
|
|
25357
|
+
}
|
|
25358
|
+
if (reset2.rects) {
|
|
25359
|
+
rects = reset2.rects === true ? await platform2.getElementRects({
|
|
25360
|
+
reference: reference2,
|
|
25361
|
+
floating,
|
|
25362
|
+
strategy
|
|
25363
|
+
}) : reset2.rects;
|
|
25364
|
+
}
|
|
25365
|
+
({
|
|
25366
|
+
x,
|
|
25367
|
+
y
|
|
25368
|
+
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
25369
|
+
}
|
|
25370
|
+
i = -1;
|
|
25371
|
+
continue;
|
|
25372
|
+
}
|
|
25373
|
+
}
|
|
25374
|
+
return {
|
|
25375
|
+
x,
|
|
25376
|
+
y,
|
|
25377
|
+
placement: statefulPlacement,
|
|
25378
|
+
strategy,
|
|
25379
|
+
middlewareData
|
|
25380
|
+
};
|
|
25381
|
+
};
|
|
25382
|
+
async function detectOverflow(state, options) {
|
|
25383
|
+
var _await$platform$isEle;
|
|
25384
|
+
if (options === void 0) {
|
|
25385
|
+
options = {};
|
|
25386
|
+
}
|
|
25387
|
+
const {
|
|
25388
|
+
x,
|
|
25389
|
+
y,
|
|
25390
|
+
platform: platform2,
|
|
25391
|
+
rects,
|
|
25392
|
+
elements,
|
|
25393
|
+
strategy
|
|
25394
|
+
} = state;
|
|
25395
|
+
const {
|
|
25396
|
+
boundary = "clippingAncestors",
|
|
25397
|
+
rootBoundary = "viewport",
|
|
25398
|
+
elementContext = "floating",
|
|
25399
|
+
altBoundary = false,
|
|
25400
|
+
padding = 0
|
|
25401
|
+
} = evaluate(options, state);
|
|
25402
|
+
const paddingObject = getPaddingObject(padding);
|
|
25403
|
+
const altContext = elementContext === "floating" ? "reference" : "floating";
|
|
25404
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
25405
|
+
const clippingClientRect = rectToClientRect(await platform2.getClippingRect({
|
|
25406
|
+
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)),
|
|
25407
|
+
boundary,
|
|
25408
|
+
rootBoundary,
|
|
25409
|
+
strategy
|
|
25410
|
+
}));
|
|
25411
|
+
const rect = elementContext === "floating" ? {
|
|
25412
|
+
...rects.floating,
|
|
25413
|
+
x,
|
|
25414
|
+
y
|
|
25415
|
+
} : rects.reference;
|
|
25416
|
+
const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating));
|
|
25417
|
+
const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
|
|
25418
|
+
x: 1,
|
|
25419
|
+
y: 1
|
|
25420
|
+
} : {
|
|
25421
|
+
x: 1,
|
|
25422
|
+
y: 1
|
|
25423
|
+
};
|
|
25424
|
+
const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
25425
|
+
rect,
|
|
25426
|
+
offsetParent,
|
|
25427
|
+
strategy
|
|
25428
|
+
}) : rect);
|
|
25429
|
+
return {
|
|
25430
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
25431
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
25432
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
25433
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
25434
|
+
};
|
|
25435
|
+
}
|
|
25436
|
+
async function convertValueToCoords(state, options) {
|
|
25437
|
+
const {
|
|
25438
|
+
placement,
|
|
25439
|
+
platform: platform2,
|
|
25440
|
+
elements
|
|
25441
|
+
} = state;
|
|
25442
|
+
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
|
|
25443
|
+
const side = getSide(placement);
|
|
25444
|
+
const alignment = getAlignment(placement);
|
|
25445
|
+
const isVertical = getSideAxis(placement) === "y";
|
|
25446
|
+
const mainAxisMulti = ["left", "top"].includes(side) ? -1 : 1;
|
|
25447
|
+
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
25448
|
+
const rawValue = evaluate(options, state);
|
|
25449
|
+
let {
|
|
25450
|
+
mainAxis,
|
|
25451
|
+
crossAxis,
|
|
25452
|
+
alignmentAxis
|
|
25453
|
+
} = typeof rawValue === "number" ? {
|
|
25454
|
+
mainAxis: rawValue,
|
|
25455
|
+
crossAxis: 0,
|
|
25456
|
+
alignmentAxis: null
|
|
25457
|
+
} : {
|
|
25458
|
+
mainAxis: 0,
|
|
25459
|
+
crossAxis: 0,
|
|
25460
|
+
alignmentAxis: null,
|
|
25461
|
+
...rawValue
|
|
25462
|
+
};
|
|
25463
|
+
if (alignment && typeof alignmentAxis === "number") {
|
|
25464
|
+
crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
|
|
25465
|
+
}
|
|
25466
|
+
return isVertical ? {
|
|
25467
|
+
x: crossAxis * crossAxisMulti,
|
|
25468
|
+
y: mainAxis * mainAxisMulti
|
|
25469
|
+
} : {
|
|
25470
|
+
x: mainAxis * mainAxisMulti,
|
|
25471
|
+
y: crossAxis * crossAxisMulti
|
|
25472
|
+
};
|
|
25473
|
+
}
|
|
25474
|
+
const offset = function(options) {
|
|
25475
|
+
if (options === void 0) {
|
|
25476
|
+
options = 0;
|
|
25477
|
+
}
|
|
25478
|
+
return {
|
|
25479
|
+
name: "offset",
|
|
25480
|
+
options,
|
|
25481
|
+
async fn(state) {
|
|
25482
|
+
const {
|
|
25483
|
+
x,
|
|
25484
|
+
y
|
|
25485
|
+
} = state;
|
|
25486
|
+
const diffCoords = await convertValueToCoords(state, options);
|
|
25487
|
+
return {
|
|
25488
|
+
x: x + diffCoords.x,
|
|
25489
|
+
y: y + diffCoords.y,
|
|
25490
|
+
data: diffCoords
|
|
25491
|
+
};
|
|
25492
|
+
}
|
|
25493
|
+
};
|
|
25494
|
+
};
|
|
25495
|
+
const shift = function(options) {
|
|
25496
|
+
if (options === void 0) {
|
|
25497
|
+
options = {};
|
|
25498
|
+
}
|
|
25499
|
+
return {
|
|
25500
|
+
name: "shift",
|
|
25501
|
+
options,
|
|
25502
|
+
async fn(state) {
|
|
25503
|
+
const {
|
|
25504
|
+
x,
|
|
25505
|
+
y,
|
|
25506
|
+
placement
|
|
25507
|
+
} = state;
|
|
25508
|
+
const {
|
|
25509
|
+
mainAxis: checkMainAxis = true,
|
|
25510
|
+
crossAxis: checkCrossAxis = false,
|
|
25511
|
+
limiter = {
|
|
25512
|
+
fn: (_ref) => {
|
|
25513
|
+
let {
|
|
25514
|
+
x: x2,
|
|
25515
|
+
y: y2
|
|
25516
|
+
} = _ref;
|
|
25517
|
+
return {
|
|
25518
|
+
x: x2,
|
|
25519
|
+
y: y2
|
|
25520
|
+
};
|
|
25521
|
+
}
|
|
25522
|
+
},
|
|
25523
|
+
...detectOverflowOptions
|
|
25524
|
+
} = evaluate(options, state);
|
|
25525
|
+
const coords = {
|
|
25526
|
+
x,
|
|
25527
|
+
y
|
|
25528
|
+
};
|
|
25529
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
25530
|
+
const crossAxis = getSideAxis(getSide(placement));
|
|
25531
|
+
const mainAxis = getOppositeAxis(crossAxis);
|
|
25532
|
+
let mainAxisCoord = coords[mainAxis];
|
|
25533
|
+
let crossAxisCoord = coords[crossAxis];
|
|
25534
|
+
if (checkMainAxis) {
|
|
25535
|
+
const minSide = mainAxis === "y" ? "top" : "left";
|
|
25536
|
+
const maxSide = mainAxis === "y" ? "bottom" : "right";
|
|
25537
|
+
const min2 = mainAxisCoord + overflow[minSide];
|
|
25538
|
+
const max2 = mainAxisCoord - overflow[maxSide];
|
|
25539
|
+
mainAxisCoord = clamp(min2, mainAxisCoord, max2);
|
|
25540
|
+
}
|
|
25541
|
+
if (checkCrossAxis) {
|
|
25542
|
+
const minSide = crossAxis === "y" ? "top" : "left";
|
|
25543
|
+
const maxSide = crossAxis === "y" ? "bottom" : "right";
|
|
25544
|
+
const min2 = crossAxisCoord + overflow[minSide];
|
|
25545
|
+
const max2 = crossAxisCoord - overflow[maxSide];
|
|
25546
|
+
crossAxisCoord = clamp(min2, crossAxisCoord, max2);
|
|
25547
|
+
}
|
|
25548
|
+
const limitedCoords = limiter.fn({
|
|
25549
|
+
...state,
|
|
25550
|
+
[mainAxis]: mainAxisCoord,
|
|
25551
|
+
[crossAxis]: crossAxisCoord
|
|
25552
|
+
});
|
|
25553
|
+
return {
|
|
25554
|
+
...limitedCoords,
|
|
25555
|
+
data: {
|
|
25556
|
+
x: limitedCoords.x - x,
|
|
25557
|
+
y: limitedCoords.y - y
|
|
25558
|
+
}
|
|
25559
|
+
};
|
|
25560
|
+
}
|
|
25561
|
+
};
|
|
25562
|
+
};
|
|
25563
|
+
const limitShift = function(options) {
|
|
25564
|
+
if (options === void 0) {
|
|
25565
|
+
options = {};
|
|
25566
|
+
}
|
|
25567
|
+
return {
|
|
25568
|
+
options,
|
|
25569
|
+
fn(state) {
|
|
25570
|
+
const {
|
|
25571
|
+
x,
|
|
25572
|
+
y,
|
|
25573
|
+
placement,
|
|
25574
|
+
rects,
|
|
25575
|
+
middlewareData
|
|
25576
|
+
} = state;
|
|
25577
|
+
const {
|
|
25578
|
+
offset: offset2 = 0,
|
|
25579
|
+
mainAxis: checkMainAxis = true,
|
|
25580
|
+
crossAxis: checkCrossAxis = true
|
|
25581
|
+
} = evaluate(options, state);
|
|
25582
|
+
const coords = {
|
|
25583
|
+
x,
|
|
25584
|
+
y
|
|
25585
|
+
};
|
|
25586
|
+
const crossAxis = getSideAxis(placement);
|
|
25587
|
+
const mainAxis = getOppositeAxis(crossAxis);
|
|
25588
|
+
let mainAxisCoord = coords[mainAxis];
|
|
25589
|
+
let crossAxisCoord = coords[crossAxis];
|
|
25590
|
+
const rawOffset = evaluate(offset2, state);
|
|
25591
|
+
const computedOffset = typeof rawOffset === "number" ? {
|
|
25592
|
+
mainAxis: rawOffset,
|
|
25593
|
+
crossAxis: 0
|
|
25594
|
+
} : {
|
|
25595
|
+
mainAxis: 0,
|
|
25596
|
+
crossAxis: 0,
|
|
25597
|
+
...rawOffset
|
|
25598
|
+
};
|
|
25599
|
+
if (checkMainAxis) {
|
|
25600
|
+
const len = mainAxis === "y" ? "height" : "width";
|
|
25601
|
+
const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
|
|
25602
|
+
const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
|
|
25603
|
+
if (mainAxisCoord < limitMin) {
|
|
25604
|
+
mainAxisCoord = limitMin;
|
|
25605
|
+
} else if (mainAxisCoord > limitMax) {
|
|
25606
|
+
mainAxisCoord = limitMax;
|
|
25607
|
+
}
|
|
25608
|
+
}
|
|
25609
|
+
if (checkCrossAxis) {
|
|
25610
|
+
var _middlewareData$offse, _middlewareData$offse2;
|
|
25611
|
+
const len = mainAxis === "y" ? "width" : "height";
|
|
25612
|
+
const isOriginSide = ["top", "left"].includes(getSide(placement));
|
|
25613
|
+
const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
|
|
25614
|
+
const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
|
|
25615
|
+
if (crossAxisCoord < limitMin) {
|
|
25616
|
+
crossAxisCoord = limitMin;
|
|
25617
|
+
} else if (crossAxisCoord > limitMax) {
|
|
25618
|
+
crossAxisCoord = limitMax;
|
|
25619
|
+
}
|
|
25620
|
+
}
|
|
25621
|
+
return {
|
|
25622
|
+
[mainAxis]: mainAxisCoord,
|
|
25623
|
+
[crossAxis]: crossAxisCoord
|
|
25624
|
+
};
|
|
25625
|
+
}
|
|
25626
|
+
};
|
|
25627
|
+
};
|
|
25628
|
+
function getNodeName(node) {
|
|
25629
|
+
if (isNode(node)) {
|
|
25630
|
+
return (node.nodeName || "").toLowerCase();
|
|
25631
|
+
}
|
|
25632
|
+
return "#document";
|
|
25633
|
+
}
|
|
25634
|
+
function getWindow(node) {
|
|
25635
|
+
var _node$ownerDocument;
|
|
25636
|
+
return (node == null ? void 0 : (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
25637
|
+
}
|
|
25638
|
+
function getDocumentElement(node) {
|
|
25639
|
+
var _ref;
|
|
25640
|
+
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
25641
|
+
}
|
|
25642
|
+
function isNode(value) {
|
|
25643
|
+
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
25644
|
+
}
|
|
25645
|
+
function isElement(value) {
|
|
25646
|
+
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
25647
|
+
}
|
|
25648
|
+
function isHTMLElement(value) {
|
|
25649
|
+
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
25650
|
+
}
|
|
25651
|
+
function isShadowRoot(value) {
|
|
25652
|
+
if (typeof ShadowRoot === "undefined") {
|
|
25653
|
+
return false;
|
|
25654
|
+
}
|
|
25655
|
+
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
25656
|
+
}
|
|
25657
|
+
function isOverflowElement(element) {
|
|
25658
|
+
const {
|
|
25659
|
+
overflow,
|
|
25660
|
+
overflowX,
|
|
25661
|
+
overflowY,
|
|
25662
|
+
display
|
|
25663
|
+
} = getComputedStyle$1(element);
|
|
25664
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !["inline", "contents"].includes(display);
|
|
25665
|
+
}
|
|
25666
|
+
function isTableElement(element) {
|
|
25667
|
+
return ["table", "td", "th"].includes(getNodeName(element));
|
|
25668
|
+
}
|
|
25669
|
+
function isContainingBlock(element) {
|
|
25670
|
+
const webkit2 = isWebKit();
|
|
25671
|
+
const css = getComputedStyle$1(element);
|
|
25672
|
+
return css.transform !== "none" || css.perspective !== "none" || (css.containerType ? css.containerType !== "normal" : false) || !webkit2 && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit2 && (css.filter ? css.filter !== "none" : false) || ["transform", "perspective", "filter"].some((value) => (css.willChange || "").includes(value)) || ["paint", "layout", "strict", "content"].some((value) => (css.contain || "").includes(value));
|
|
25673
|
+
}
|
|
25674
|
+
function getContainingBlock(element) {
|
|
25675
|
+
let currentNode = getParentNode(element);
|
|
25676
|
+
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
25677
|
+
if (isContainingBlock(currentNode)) {
|
|
25678
|
+
return currentNode;
|
|
25679
|
+
} else {
|
|
25680
|
+
currentNode = getParentNode(currentNode);
|
|
25681
|
+
}
|
|
25682
|
+
}
|
|
25683
|
+
return null;
|
|
25684
|
+
}
|
|
25685
|
+
function isWebKit() {
|
|
25686
|
+
if (typeof CSS === "undefined" || !CSS.supports)
|
|
25687
|
+
return false;
|
|
25688
|
+
return CSS.supports("-webkit-backdrop-filter", "none");
|
|
25689
|
+
}
|
|
25690
|
+
function isLastTraversableNode(node) {
|
|
25691
|
+
return ["html", "body", "#document"].includes(getNodeName(node));
|
|
25692
|
+
}
|
|
25693
|
+
function getComputedStyle$1(element) {
|
|
25694
|
+
return getWindow(element).getComputedStyle(element);
|
|
25695
|
+
}
|
|
25696
|
+
function getNodeScroll(element) {
|
|
25697
|
+
if (isElement(element)) {
|
|
25698
|
+
return {
|
|
25699
|
+
scrollLeft: element.scrollLeft,
|
|
25700
|
+
scrollTop: element.scrollTop
|
|
25701
|
+
};
|
|
25702
|
+
}
|
|
25703
|
+
return {
|
|
25704
|
+
scrollLeft: element.pageXOffset,
|
|
25705
|
+
scrollTop: element.pageYOffset
|
|
25706
|
+
};
|
|
25707
|
+
}
|
|
25708
|
+
function getParentNode(node) {
|
|
25709
|
+
if (getNodeName(node) === "html") {
|
|
25710
|
+
return node;
|
|
25711
|
+
}
|
|
25712
|
+
const result = (
|
|
25713
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
25714
|
+
node.assignedSlot || // DOM Element detected.
|
|
25715
|
+
node.parentNode || // ShadowRoot detected.
|
|
25716
|
+
isShadowRoot(node) && node.host || // Fallback.
|
|
25717
|
+
getDocumentElement(node)
|
|
25718
|
+
);
|
|
25719
|
+
return isShadowRoot(result) ? result.host : result;
|
|
25720
|
+
}
|
|
25721
|
+
function getNearestOverflowAncestor(node) {
|
|
25722
|
+
const parentNode2 = getParentNode(node);
|
|
25723
|
+
if (isLastTraversableNode(parentNode2)) {
|
|
25724
|
+
return node.ownerDocument ? node.ownerDocument.body : node.body;
|
|
25725
|
+
}
|
|
25726
|
+
if (isHTMLElement(parentNode2) && isOverflowElement(parentNode2)) {
|
|
25727
|
+
return parentNode2;
|
|
25728
|
+
}
|
|
25729
|
+
return getNearestOverflowAncestor(parentNode2);
|
|
25730
|
+
}
|
|
25731
|
+
function getOverflowAncestors(node, list, traverseIframes) {
|
|
25732
|
+
var _node$ownerDocument2;
|
|
25733
|
+
if (list === void 0) {
|
|
25734
|
+
list = [];
|
|
25735
|
+
}
|
|
25736
|
+
if (traverseIframes === void 0) {
|
|
25737
|
+
traverseIframes = true;
|
|
25738
|
+
}
|
|
25739
|
+
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
25740
|
+
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
25741
|
+
const win = getWindow(scrollableAncestor);
|
|
25742
|
+
if (isBody) {
|
|
25743
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
|
|
25744
|
+
}
|
|
25745
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
25746
|
+
}
|
|
25747
|
+
function getCssDimensions(element) {
|
|
25748
|
+
const css = getComputedStyle$1(element);
|
|
25749
|
+
let width = parseFloat(css.width) || 0;
|
|
25750
|
+
let height = parseFloat(css.height) || 0;
|
|
25751
|
+
const hasOffset = isHTMLElement(element);
|
|
25752
|
+
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
|
25753
|
+
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
|
25754
|
+
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
25755
|
+
if (shouldFallback) {
|
|
25756
|
+
width = offsetWidth;
|
|
25757
|
+
height = offsetHeight;
|
|
25758
|
+
}
|
|
25759
|
+
return {
|
|
25760
|
+
width,
|
|
25761
|
+
height,
|
|
25762
|
+
$: shouldFallback
|
|
25763
|
+
};
|
|
25764
|
+
}
|
|
25765
|
+
function unwrapElement(element) {
|
|
25766
|
+
return !isElement(element) ? element.contextElement : element;
|
|
25767
|
+
}
|
|
25768
|
+
function getScale(element) {
|
|
25769
|
+
const domElement = unwrapElement(element);
|
|
25770
|
+
if (!isHTMLElement(domElement)) {
|
|
25771
|
+
return createCoords(1);
|
|
25772
|
+
}
|
|
25773
|
+
const rect = domElement.getBoundingClientRect();
|
|
25774
|
+
const {
|
|
25775
|
+
width,
|
|
25776
|
+
height,
|
|
25777
|
+
$
|
|
25778
|
+
} = getCssDimensions(domElement);
|
|
25779
|
+
let x = ($ ? round(rect.width) : rect.width) / width;
|
|
25780
|
+
let y = ($ ? round(rect.height) : rect.height) / height;
|
|
25781
|
+
if (!x || !Number.isFinite(x)) {
|
|
25782
|
+
x = 1;
|
|
25783
|
+
}
|
|
25784
|
+
if (!y || !Number.isFinite(y)) {
|
|
25785
|
+
y = 1;
|
|
25786
|
+
}
|
|
25787
|
+
return {
|
|
25788
|
+
x,
|
|
25789
|
+
y
|
|
25790
|
+
};
|
|
25791
|
+
}
|
|
25792
|
+
const noOffsets = /* @__PURE__ */ createCoords(0);
|
|
25793
|
+
function getVisualOffsets(element) {
|
|
25794
|
+
const win = getWindow(element);
|
|
25795
|
+
if (!isWebKit() || !win.visualViewport) {
|
|
25796
|
+
return noOffsets;
|
|
25797
|
+
}
|
|
25798
|
+
return {
|
|
25799
|
+
x: win.visualViewport.offsetLeft,
|
|
25800
|
+
y: win.visualViewport.offsetTop
|
|
25801
|
+
};
|
|
25802
|
+
}
|
|
25803
|
+
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
25804
|
+
if (isFixed === void 0) {
|
|
25805
|
+
isFixed = false;
|
|
25806
|
+
}
|
|
25807
|
+
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
|
|
25808
|
+
return false;
|
|
25809
|
+
}
|
|
25810
|
+
return isFixed;
|
|
25811
|
+
}
|
|
25812
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
25813
|
+
if (includeScale === void 0) {
|
|
25814
|
+
includeScale = false;
|
|
25815
|
+
}
|
|
25816
|
+
if (isFixedStrategy === void 0) {
|
|
25817
|
+
isFixedStrategy = false;
|
|
25818
|
+
}
|
|
25819
|
+
const clientRect2 = element.getBoundingClientRect();
|
|
25820
|
+
const domElement = unwrapElement(element);
|
|
25821
|
+
let scale = createCoords(1);
|
|
25822
|
+
if (includeScale) {
|
|
25823
|
+
if (offsetParent) {
|
|
25824
|
+
if (isElement(offsetParent)) {
|
|
25825
|
+
scale = getScale(offsetParent);
|
|
25826
|
+
}
|
|
25827
|
+
} else {
|
|
25828
|
+
scale = getScale(element);
|
|
25829
|
+
}
|
|
25830
|
+
}
|
|
25831
|
+
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
|
25832
|
+
let x = (clientRect2.left + visualOffsets.x) / scale.x;
|
|
25833
|
+
let y = (clientRect2.top + visualOffsets.y) / scale.y;
|
|
25834
|
+
let width = clientRect2.width / scale.x;
|
|
25835
|
+
let height = clientRect2.height / scale.y;
|
|
25836
|
+
if (domElement) {
|
|
25837
|
+
const win = getWindow(domElement);
|
|
25838
|
+
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
25839
|
+
let currentIFrame = win.frameElement;
|
|
25840
|
+
while (currentIFrame && offsetParent && offsetWin !== win) {
|
|
25841
|
+
const iframeScale = getScale(currentIFrame);
|
|
25842
|
+
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
25843
|
+
const css = getComputedStyle$1(currentIFrame);
|
|
25844
|
+
const left2 = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
25845
|
+
const top2 = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
25846
|
+
x *= iframeScale.x;
|
|
25847
|
+
y *= iframeScale.y;
|
|
25848
|
+
width *= iframeScale.x;
|
|
25849
|
+
height *= iframeScale.y;
|
|
25850
|
+
x += left2;
|
|
25851
|
+
y += top2;
|
|
25852
|
+
currentIFrame = getWindow(currentIFrame).frameElement;
|
|
25853
|
+
}
|
|
25854
|
+
}
|
|
25855
|
+
return rectToClientRect({
|
|
25856
|
+
width,
|
|
25857
|
+
height,
|
|
25858
|
+
x,
|
|
25859
|
+
y
|
|
25860
|
+
});
|
|
25861
|
+
}
|
|
25862
|
+
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
25863
|
+
let {
|
|
25864
|
+
rect,
|
|
25865
|
+
offsetParent,
|
|
25866
|
+
strategy
|
|
25867
|
+
} = _ref;
|
|
25868
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
25869
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
25870
|
+
if (offsetParent === documentElement) {
|
|
25871
|
+
return rect;
|
|
25872
|
+
}
|
|
25873
|
+
let scroll = {
|
|
25874
|
+
scrollLeft: 0,
|
|
25875
|
+
scrollTop: 0
|
|
25876
|
+
};
|
|
25877
|
+
let scale = createCoords(1);
|
|
25878
|
+
const offsets = createCoords(0);
|
|
25879
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== "fixed") {
|
|
25880
|
+
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
|
25881
|
+
scroll = getNodeScroll(offsetParent);
|
|
25882
|
+
}
|
|
25883
|
+
if (isHTMLElement(offsetParent)) {
|
|
25884
|
+
const offsetRect = getBoundingClientRect(offsetParent);
|
|
25885
|
+
scale = getScale(offsetParent);
|
|
25886
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
25887
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
25888
|
+
}
|
|
25889
|
+
}
|
|
25890
|
+
return {
|
|
25891
|
+
width: rect.width * scale.x,
|
|
25892
|
+
height: rect.height * scale.y,
|
|
25893
|
+
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
|
|
25894
|
+
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
|
|
25895
|
+
};
|
|
25896
|
+
}
|
|
25897
|
+
function getClientRects(element) {
|
|
25898
|
+
return Array.from(element.getClientRects());
|
|
25899
|
+
}
|
|
25900
|
+
function getWindowScrollBarX(element) {
|
|
25901
|
+
return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
|
|
25902
|
+
}
|
|
25903
|
+
function getDocumentRect(element) {
|
|
25904
|
+
const html = getDocumentElement(element);
|
|
25905
|
+
const scroll = getNodeScroll(element);
|
|
25906
|
+
const body = element.ownerDocument.body;
|
|
25907
|
+
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
25908
|
+
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
25909
|
+
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
25910
|
+
const y = -scroll.scrollTop;
|
|
25911
|
+
if (getComputedStyle$1(body).direction === "rtl") {
|
|
25912
|
+
x += max(html.clientWidth, body.clientWidth) - width;
|
|
25913
|
+
}
|
|
25914
|
+
return {
|
|
25915
|
+
width,
|
|
25916
|
+
height,
|
|
25917
|
+
x,
|
|
25918
|
+
y
|
|
25919
|
+
};
|
|
25920
|
+
}
|
|
25921
|
+
function getViewportRect(element, strategy) {
|
|
25922
|
+
const win = getWindow(element);
|
|
25923
|
+
const html = getDocumentElement(element);
|
|
25924
|
+
const visualViewport = win.visualViewport;
|
|
25925
|
+
let width = html.clientWidth;
|
|
25926
|
+
let height = html.clientHeight;
|
|
25927
|
+
let x = 0;
|
|
25928
|
+
let y = 0;
|
|
25929
|
+
if (visualViewport) {
|
|
25930
|
+
width = visualViewport.width;
|
|
25931
|
+
height = visualViewport.height;
|
|
25932
|
+
const visualViewportBased = isWebKit();
|
|
25933
|
+
if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
|
|
25934
|
+
x = visualViewport.offsetLeft;
|
|
25935
|
+
y = visualViewport.offsetTop;
|
|
25936
|
+
}
|
|
25937
|
+
}
|
|
25938
|
+
return {
|
|
25939
|
+
width,
|
|
25940
|
+
height,
|
|
25941
|
+
x,
|
|
25942
|
+
y
|
|
25943
|
+
};
|
|
25944
|
+
}
|
|
25945
|
+
function getInnerBoundingClientRect(element, strategy) {
|
|
25946
|
+
const clientRect2 = getBoundingClientRect(element, true, strategy === "fixed");
|
|
25947
|
+
const top2 = clientRect2.top + element.clientTop;
|
|
25948
|
+
const left2 = clientRect2.left + element.clientLeft;
|
|
25949
|
+
const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
|
|
25950
|
+
const width = element.clientWidth * scale.x;
|
|
25951
|
+
const height = element.clientHeight * scale.y;
|
|
25952
|
+
const x = left2 * scale.x;
|
|
25953
|
+
const y = top2 * scale.y;
|
|
25954
|
+
return {
|
|
25955
|
+
width,
|
|
25956
|
+
height,
|
|
25957
|
+
x,
|
|
25958
|
+
y
|
|
25959
|
+
};
|
|
25960
|
+
}
|
|
25961
|
+
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
25962
|
+
let rect;
|
|
25963
|
+
if (clippingAncestor === "viewport") {
|
|
25964
|
+
rect = getViewportRect(element, strategy);
|
|
25965
|
+
} else if (clippingAncestor === "document") {
|
|
25966
|
+
rect = getDocumentRect(getDocumentElement(element));
|
|
25967
|
+
} else if (isElement(clippingAncestor)) {
|
|
25968
|
+
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
25969
|
+
} else {
|
|
25970
|
+
const visualOffsets = getVisualOffsets(element);
|
|
25971
|
+
rect = {
|
|
25972
|
+
...clippingAncestor,
|
|
25973
|
+
x: clippingAncestor.x - visualOffsets.x,
|
|
25974
|
+
y: clippingAncestor.y - visualOffsets.y
|
|
25975
|
+
};
|
|
25976
|
+
}
|
|
25977
|
+
return rectToClientRect(rect);
|
|
25978
|
+
}
|
|
25979
|
+
function hasFixedPositionAncestor(element, stopNode) {
|
|
25980
|
+
const parentNode2 = getParentNode(element);
|
|
25981
|
+
if (parentNode2 === stopNode || !isElement(parentNode2) || isLastTraversableNode(parentNode2)) {
|
|
25982
|
+
return false;
|
|
25983
|
+
}
|
|
25984
|
+
return getComputedStyle$1(parentNode2).position === "fixed" || hasFixedPositionAncestor(parentNode2, stopNode);
|
|
25985
|
+
}
|
|
25986
|
+
function getClippingElementAncestors(element, cache) {
|
|
25987
|
+
const cachedResult2 = cache.get(element);
|
|
25988
|
+
if (cachedResult2) {
|
|
25989
|
+
return cachedResult2;
|
|
25990
|
+
}
|
|
25991
|
+
let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
|
|
25992
|
+
let currentContainingBlockComputedStyle = null;
|
|
25993
|
+
const elementIsFixed = getComputedStyle$1(element).position === "fixed";
|
|
25994
|
+
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
25995
|
+
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
25996
|
+
const computedStyle = getComputedStyle$1(currentNode);
|
|
25997
|
+
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
25998
|
+
if (!currentNodeIsContaining && computedStyle.position === "fixed") {
|
|
25999
|
+
currentContainingBlockComputedStyle = null;
|
|
26000
|
+
}
|
|
26001
|
+
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && ["absolute", "fixed"].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
26002
|
+
if (shouldDropCurrentNode) {
|
|
26003
|
+
result = result.filter((ancestor) => ancestor !== currentNode);
|
|
26004
|
+
} else {
|
|
26005
|
+
currentContainingBlockComputedStyle = computedStyle;
|
|
26006
|
+
}
|
|
26007
|
+
currentNode = getParentNode(currentNode);
|
|
26008
|
+
}
|
|
26009
|
+
cache.set(element, result);
|
|
26010
|
+
return result;
|
|
26011
|
+
}
|
|
26012
|
+
function getClippingRect(_ref) {
|
|
26013
|
+
let {
|
|
26014
|
+
element,
|
|
26015
|
+
boundary,
|
|
26016
|
+
rootBoundary,
|
|
26017
|
+
strategy
|
|
26018
|
+
} = _ref;
|
|
26019
|
+
const elementClippingAncestors = boundary === "clippingAncestors" ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
26020
|
+
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
26021
|
+
const firstClippingAncestor = clippingAncestors[0];
|
|
26022
|
+
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
26023
|
+
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
|
26024
|
+
accRect.top = max(rect.top, accRect.top);
|
|
26025
|
+
accRect.right = min(rect.right, accRect.right);
|
|
26026
|
+
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
26027
|
+
accRect.left = max(rect.left, accRect.left);
|
|
26028
|
+
return accRect;
|
|
26029
|
+
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
|
26030
|
+
return {
|
|
26031
|
+
width: clippingRect.right - clippingRect.left,
|
|
26032
|
+
height: clippingRect.bottom - clippingRect.top,
|
|
26033
|
+
x: clippingRect.left,
|
|
26034
|
+
y: clippingRect.top
|
|
26035
|
+
};
|
|
26036
|
+
}
|
|
26037
|
+
function getDimensions(element) {
|
|
26038
|
+
return getCssDimensions(element);
|
|
26039
|
+
}
|
|
26040
|
+
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
26041
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
26042
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
26043
|
+
const isFixed = strategy === "fixed";
|
|
26044
|
+
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
|
|
26045
|
+
let scroll = {
|
|
26046
|
+
scrollLeft: 0,
|
|
26047
|
+
scrollTop: 0
|
|
26048
|
+
};
|
|
26049
|
+
const offsets = createCoords(0);
|
|
26050
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
26051
|
+
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
|
26052
|
+
scroll = getNodeScroll(offsetParent);
|
|
26053
|
+
}
|
|
26054
|
+
if (isOffsetParentAnElement) {
|
|
26055
|
+
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
26056
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
26057
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
26058
|
+
} else if (documentElement) {
|
|
26059
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
26060
|
+
}
|
|
26061
|
+
}
|
|
26062
|
+
return {
|
|
26063
|
+
x: rect.left + scroll.scrollLeft - offsets.x,
|
|
26064
|
+
y: rect.top + scroll.scrollTop - offsets.y,
|
|
26065
|
+
width: rect.width,
|
|
26066
|
+
height: rect.height
|
|
26067
|
+
};
|
|
26068
|
+
}
|
|
26069
|
+
function getTrueOffsetParent(element, polyfill) {
|
|
26070
|
+
if (!isHTMLElement(element) || getComputedStyle$1(element).position === "fixed") {
|
|
26071
|
+
return null;
|
|
26072
|
+
}
|
|
26073
|
+
if (polyfill) {
|
|
26074
|
+
return polyfill(element);
|
|
26075
|
+
}
|
|
26076
|
+
return element.offsetParent;
|
|
26077
|
+
}
|
|
26078
|
+
function getOffsetParent(element, polyfill) {
|
|
26079
|
+
const window2 = getWindow(element);
|
|
26080
|
+
if (!isHTMLElement(element)) {
|
|
26081
|
+
return window2;
|
|
26082
|
+
}
|
|
26083
|
+
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
26084
|
+
while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === "static") {
|
|
26085
|
+
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
26086
|
+
}
|
|
26087
|
+
if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle$1(offsetParent).position === "static" && !isContainingBlock(offsetParent))) {
|
|
26088
|
+
return window2;
|
|
26089
|
+
}
|
|
26090
|
+
return offsetParent || getContainingBlock(element) || window2;
|
|
26091
|
+
}
|
|
26092
|
+
const getElementRects = async function(_ref) {
|
|
26093
|
+
let {
|
|
26094
|
+
reference: reference2,
|
|
26095
|
+
floating,
|
|
26096
|
+
strategy
|
|
26097
|
+
} = _ref;
|
|
26098
|
+
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
26099
|
+
const getDimensionsFn = this.getDimensions;
|
|
26100
|
+
return {
|
|
26101
|
+
reference: getRectRelativeToOffsetParent(reference2, await getOffsetParentFn(floating), strategy),
|
|
26102
|
+
floating: {
|
|
26103
|
+
x: 0,
|
|
26104
|
+
y: 0,
|
|
26105
|
+
...await getDimensionsFn(floating)
|
|
26106
|
+
}
|
|
26107
|
+
};
|
|
26108
|
+
};
|
|
26109
|
+
function isRTL(element) {
|
|
26110
|
+
return getComputedStyle$1(element).direction === "rtl";
|
|
26111
|
+
}
|
|
26112
|
+
const platform = {
|
|
26113
|
+
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
26114
|
+
getDocumentElement,
|
|
26115
|
+
getClippingRect,
|
|
26116
|
+
getOffsetParent,
|
|
26117
|
+
getElementRects,
|
|
26118
|
+
getClientRects,
|
|
26119
|
+
getDimensions,
|
|
26120
|
+
getScale,
|
|
26121
|
+
isElement,
|
|
26122
|
+
isRTL
|
|
26123
|
+
};
|
|
26124
|
+
function observeMove(element, onMove) {
|
|
26125
|
+
let io = null;
|
|
26126
|
+
let timeoutId;
|
|
26127
|
+
const root2 = getDocumentElement(element);
|
|
26128
|
+
function cleanup() {
|
|
26129
|
+
clearTimeout(timeoutId);
|
|
26130
|
+
io && io.disconnect();
|
|
26131
|
+
io = null;
|
|
26132
|
+
}
|
|
26133
|
+
function refresh(skip, threshold) {
|
|
26134
|
+
if (skip === void 0) {
|
|
26135
|
+
skip = false;
|
|
26136
|
+
}
|
|
26137
|
+
if (threshold === void 0) {
|
|
26138
|
+
threshold = 1;
|
|
26139
|
+
}
|
|
26140
|
+
cleanup();
|
|
26141
|
+
const {
|
|
26142
|
+
left: left2,
|
|
26143
|
+
top: top2,
|
|
26144
|
+
width,
|
|
26145
|
+
height
|
|
26146
|
+
} = element.getBoundingClientRect();
|
|
26147
|
+
if (!skip) {
|
|
26148
|
+
onMove();
|
|
26149
|
+
}
|
|
26150
|
+
if (!width || !height) {
|
|
26151
|
+
return;
|
|
26152
|
+
}
|
|
26153
|
+
const insetTop = floor(top2);
|
|
26154
|
+
const insetRight = floor(root2.clientWidth - (left2 + width));
|
|
26155
|
+
const insetBottom = floor(root2.clientHeight - (top2 + height));
|
|
26156
|
+
const insetLeft = floor(left2);
|
|
26157
|
+
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
|
|
26158
|
+
const options = {
|
|
26159
|
+
rootMargin,
|
|
26160
|
+
threshold: max(0, min(1, threshold)) || 1
|
|
26161
|
+
};
|
|
26162
|
+
let isFirstUpdate = true;
|
|
26163
|
+
function handleObserve(entries) {
|
|
26164
|
+
const ratio = entries[0].intersectionRatio;
|
|
26165
|
+
if (ratio !== threshold) {
|
|
26166
|
+
if (!isFirstUpdate) {
|
|
26167
|
+
return refresh();
|
|
26168
|
+
}
|
|
26169
|
+
if (!ratio) {
|
|
26170
|
+
timeoutId = setTimeout(() => {
|
|
26171
|
+
refresh(false, 1e-7);
|
|
26172
|
+
}, 100);
|
|
26173
|
+
} else {
|
|
26174
|
+
refresh(false, ratio);
|
|
26175
|
+
}
|
|
26176
|
+
}
|
|
26177
|
+
isFirstUpdate = false;
|
|
26178
|
+
}
|
|
26179
|
+
try {
|
|
26180
|
+
io = new IntersectionObserver(handleObserve, {
|
|
26181
|
+
...options,
|
|
26182
|
+
// Handle <iframe>s
|
|
26183
|
+
root: root2.ownerDocument
|
|
26184
|
+
});
|
|
26185
|
+
} catch (e) {
|
|
26186
|
+
io = new IntersectionObserver(handleObserve, options);
|
|
26187
|
+
}
|
|
26188
|
+
io.observe(element);
|
|
26189
|
+
}
|
|
26190
|
+
refresh(true);
|
|
26191
|
+
return cleanup;
|
|
26192
|
+
}
|
|
26193
|
+
function autoUpdate(reference2, floating, update, options) {
|
|
26194
|
+
if (options === void 0) {
|
|
26195
|
+
options = {};
|
|
26196
|
+
}
|
|
26197
|
+
const {
|
|
26198
|
+
ancestorScroll = true,
|
|
26199
|
+
ancestorResize = true,
|
|
26200
|
+
elementResize = typeof ResizeObserver === "function",
|
|
26201
|
+
layoutShift = typeof IntersectionObserver === "function",
|
|
26202
|
+
animationFrame = false
|
|
26203
|
+
} = options;
|
|
26204
|
+
const referenceEl = unwrapElement(reference2);
|
|
26205
|
+
const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : [];
|
|
26206
|
+
ancestors.forEach((ancestor) => {
|
|
26207
|
+
ancestorScroll && ancestor.addEventListener("scroll", update, {
|
|
26208
|
+
passive: true
|
|
26209
|
+
});
|
|
26210
|
+
ancestorResize && ancestor.addEventListener("resize", update);
|
|
26211
|
+
});
|
|
26212
|
+
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
|
|
26213
|
+
let reobserveFrame = -1;
|
|
26214
|
+
let resizeObserver = null;
|
|
26215
|
+
if (elementResize) {
|
|
26216
|
+
resizeObserver = new ResizeObserver((_ref) => {
|
|
26217
|
+
let [firstEntry] = _ref;
|
|
26218
|
+
if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
|
|
26219
|
+
resizeObserver.unobserve(floating);
|
|
26220
|
+
cancelAnimationFrame(reobserveFrame);
|
|
26221
|
+
reobserveFrame = requestAnimationFrame(() => {
|
|
26222
|
+
resizeObserver && resizeObserver.observe(floating);
|
|
26223
|
+
});
|
|
26224
|
+
}
|
|
26225
|
+
update();
|
|
26226
|
+
});
|
|
26227
|
+
if (referenceEl && !animationFrame) {
|
|
26228
|
+
resizeObserver.observe(referenceEl);
|
|
26229
|
+
}
|
|
26230
|
+
resizeObserver.observe(floating);
|
|
26231
|
+
}
|
|
26232
|
+
let frameId;
|
|
26233
|
+
let prevRefRect = animationFrame ? getBoundingClientRect(reference2) : null;
|
|
26234
|
+
if (animationFrame) {
|
|
26235
|
+
frameLoop();
|
|
26236
|
+
}
|
|
26237
|
+
function frameLoop() {
|
|
26238
|
+
const nextRefRect = getBoundingClientRect(reference2);
|
|
26239
|
+
if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
|
|
26240
|
+
update();
|
|
26241
|
+
}
|
|
26242
|
+
prevRefRect = nextRefRect;
|
|
26243
|
+
frameId = requestAnimationFrame(frameLoop);
|
|
26244
|
+
}
|
|
26245
|
+
update();
|
|
26246
|
+
return () => {
|
|
26247
|
+
ancestors.forEach((ancestor) => {
|
|
26248
|
+
ancestorScroll && ancestor.removeEventListener("scroll", update);
|
|
26249
|
+
ancestorResize && ancestor.removeEventListener("resize", update);
|
|
26250
|
+
});
|
|
26251
|
+
cleanupIo && cleanupIo();
|
|
26252
|
+
resizeObserver && resizeObserver.disconnect();
|
|
26253
|
+
resizeObserver = null;
|
|
26254
|
+
if (animationFrame) {
|
|
26255
|
+
cancelAnimationFrame(frameId);
|
|
26256
|
+
}
|
|
26257
|
+
};
|
|
26258
|
+
}
|
|
26259
|
+
const computePosition = (reference2, floating, options) => {
|
|
26260
|
+
const cache = /* @__PURE__ */ new Map();
|
|
26261
|
+
const mergedOptions = {
|
|
26262
|
+
platform,
|
|
26263
|
+
...options
|
|
26264
|
+
};
|
|
26265
|
+
const platformWithCache = {
|
|
26266
|
+
...mergedOptions.platform,
|
|
26267
|
+
_c: cache
|
|
26268
|
+
};
|
|
26269
|
+
return computePosition$1(reference2, floating, {
|
|
26270
|
+
...mergedOptions,
|
|
26271
|
+
platform: platformWithCache
|
|
26272
|
+
});
|
|
26273
|
+
};
|
|
25185
26274
|
function useModalToggler({ onBeforeOpened, onClosed, wrapperRef, modalRef } = {}) {
|
|
25186
26275
|
const editor = inject(InjectionTokens$1.EDITOR);
|
|
25187
26276
|
const isOpened = ref(false);
|
|
25188
|
-
let
|
|
25189
|
-
function
|
|
26277
|
+
let floatingInstance;
|
|
26278
|
+
function initModal() {
|
|
25190
26279
|
const wrapperEl = useElementRef(wrapperRef);
|
|
25191
26280
|
const modalEl = useElementRef(modalRef);
|
|
25192
|
-
|
|
25193
|
-
|
|
25194
|
-
|
|
25195
|
-
|
|
25196
|
-
|
|
25197
|
-
|
|
25198
|
-
|
|
25199
|
-
|
|
25200
|
-
|
|
25201
|
-
|
|
25202
|
-
|
|
25203
|
-
|
|
25204
|
-
|
|
25205
|
-
|
|
25206
|
-
}
|
|
25207
|
-
},
|
|
25208
|
-
{
|
|
25209
|
-
name: "flip",
|
|
25210
|
-
enabled: false
|
|
25211
|
-
}
|
|
25212
|
-
]
|
|
26281
|
+
floatingInstance = autoUpdate(wrapperEl.value, modalEl.value, async () => {
|
|
26282
|
+
const positioning = await computePosition(wrapperEl.value, modalEl.value, {
|
|
26283
|
+
placement: "bottom",
|
|
26284
|
+
strategy: "fixed",
|
|
26285
|
+
middleware: [
|
|
26286
|
+
shift({ padding: 16, crossAxis: true, limiter: limitShift() }),
|
|
26287
|
+
offset({ mainAxis: 4 })
|
|
26288
|
+
]
|
|
26289
|
+
});
|
|
26290
|
+
const { x, y } = positioning;
|
|
26291
|
+
Object.assign(modalEl.value, {
|
|
26292
|
+
left: `${x}px`,
|
|
26293
|
+
top: `${y}px`
|
|
26294
|
+
});
|
|
25213
26295
|
});
|
|
25214
26296
|
}
|
|
25215
26297
|
async function open() {
|
|
26298
|
+
if (isOpened.value)
|
|
26299
|
+
return;
|
|
25216
26300
|
onBeforeOpened == null ? void 0 : onBeforeOpened();
|
|
25217
26301
|
editor.commands.storeSelection();
|
|
25218
26302
|
isOpened.value = true;
|
|
25219
26303
|
await nextTick();
|
|
25220
|
-
|
|
26304
|
+
initModal();
|
|
25221
26305
|
}
|
|
25222
26306
|
function close2() {
|
|
25223
26307
|
isOpened.value = false;
|
|
26308
|
+
floatingInstance == null ? void 0 : floatingInstance();
|
|
25224
26309
|
editor.commands.restoreSelection();
|
|
25225
26310
|
onClosed == null ? void 0 : onClosed();
|
|
25226
26311
|
}
|
|
25227
|
-
onUnmounted(() => {
|
|
25228
|
-
popper2 == null ? void 0 : popper2.destroy();
|
|
25229
|
-
});
|
|
25230
26312
|
const toggle = (toOpen) => toOpen ? open() : close2();
|
|
25231
26313
|
return { isOpened, open, close: close2, toggle };
|
|
25232
26314
|
}
|
|
@@ -27583,7 +28665,7 @@ const _sfc_main$2 = {
|
|
|
27583
28665
|
};
|
|
27584
28666
|
}
|
|
27585
28667
|
};
|
|
27586
|
-
const
|
|
28668
|
+
const Toolbar_vue_vue_type_style_index_0_scoped_d3e5d777_lang = "";
|
|
27587
28669
|
const _sfc_main$1 = {
|
|
27588
28670
|
__name: "Toolbar",
|
|
27589
28671
|
props: {
|
|
@@ -27608,7 +28690,7 @@ const _sfc_main$1 = {
|
|
|
27608
28690
|
setup(__props) {
|
|
27609
28691
|
const props = __props;
|
|
27610
28692
|
useCssVars((_ctx) => ({
|
|
27611
|
-
"
|
|
28693
|
+
"c6eda43c": __props.toolbar.offsets[1]
|
|
27612
28694
|
}));
|
|
27613
28695
|
const layoutComponent = computed(() => {
|
|
27614
28696
|
if (props.popupMode)
|
|
@@ -27642,7 +28724,7 @@ const _sfc_main$1 = {
|
|
|
27642
28724
|
};
|
|
27643
28725
|
}
|
|
27644
28726
|
};
|
|
27645
|
-
const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
28727
|
+
const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-d3e5d777"]]);
|
|
27646
28728
|
function useEditor({ content, onChange, extensions: extensions2, isReadonlyRef }) {
|
|
27647
28729
|
let editor;
|
|
27648
28730
|
const getContent = () => markWysiwygContent(editor.getJSON());
|
|
@@ -27665,33 +28747,26 @@ function useEditor({ content, onChange, extensions: extensions2, isReadonlyRef }
|
|
|
27665
28747
|
}
|
|
27666
28748
|
function useToolbar({ wrapperRef, offsets, isActiveRef, placementRef }) {
|
|
27667
28749
|
const wrapperEl = useElementRef(wrapperRef);
|
|
27668
|
-
let
|
|
28750
|
+
let floatingInstance;
|
|
27669
28751
|
function mount(element) {
|
|
27670
|
-
|
|
27671
|
-
|
|
27672
|
-
|
|
27673
|
-
|
|
27674
|
-
|
|
27675
|
-
|
|
27676
|
-
|
|
27677
|
-
|
|
27678
|
-
|
|
27679
|
-
|
|
27680
|
-
|
|
27681
|
-
|
|
27682
|
-
|
|
27683
|
-
|
|
27684
|
-
},
|
|
27685
|
-
{
|
|
27686
|
-
name: "flip",
|
|
27687
|
-
enabled: false
|
|
27688
|
-
}
|
|
27689
|
-
]
|
|
28752
|
+
floatingInstance = autoUpdate(wrapperEl.value, element, async () => {
|
|
28753
|
+
const positioning = await computePosition(wrapperEl.value, element, {
|
|
28754
|
+
placement: placementRef.value,
|
|
28755
|
+
strategy: "fixed",
|
|
28756
|
+
middleware: [
|
|
28757
|
+
shift({ padding: 16, crossAxis: true, limiter: limitShift() }),
|
|
28758
|
+
offset({ crossAxis: offsets[0], mainAxis: offsets[1] })
|
|
28759
|
+
]
|
|
28760
|
+
});
|
|
28761
|
+
const { x, y } = positioning;
|
|
28762
|
+
Object.assign(element.style, {
|
|
28763
|
+
left: `${x}px`,
|
|
28764
|
+
top: `${y}px`
|
|
28765
|
+
});
|
|
27690
28766
|
});
|
|
27691
28767
|
}
|
|
27692
|
-
|
|
28768
|
+
onUnmounted(() => floatingInstance == null ? void 0 : floatingInstance());
|
|
27693
28769
|
return {
|
|
27694
|
-
update,
|
|
27695
28770
|
mount,
|
|
27696
28771
|
isActiveRef,
|
|
27697
28772
|
offsets
|
|
@@ -27842,10 +28917,8 @@ const _sfc_main = {
|
|
|
27842
28917
|
isActiveRef: isToolbarActiveRef,
|
|
27843
28918
|
offsets: props.toolbarOffsets
|
|
27844
28919
|
});
|
|
27845
|
-
const updateToolbar = () => toolbar.update();
|
|
27846
28920
|
function onChange(content) {
|
|
27847
28921
|
emit("update:model-value", content);
|
|
27848
|
-
updateToolbar();
|
|
27849
28922
|
}
|
|
27850
28923
|
const pageBlocks = toRef(props, "pageBlocks");
|
|
27851
28924
|
const { editor, getContent } = useEditor({
|
|
@@ -27879,7 +28952,7 @@ const _sfc_main = {
|
|
|
27879
28952
|
provide(InjectionTokens$1.LOCAL_STORAGE, new Storage(localStorage));
|
|
27880
28953
|
provide(InjectionTokens$1.FAVORITE_COLORS, favoriteColors);
|
|
27881
28954
|
provide(InjectionTokens$1.PAGE_BLOCKS, pageBlocks);
|
|
27882
|
-
__expose({ getContentCustomization, getContent,
|
|
28955
|
+
__expose({ getContentCustomization, getContent, editor });
|
|
27883
28956
|
return (_ctx, _cache) => {
|
|
27884
28957
|
return openBlock(), createElementBlock("div", {
|
|
27885
28958
|
class: "zw-wysiwyg",
|