@zipify/wysiwyg 3.0.0 → 3.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 +11 -11
- package/dist/wysiwyg.mjs +1370 -1935
- package/example/tooltip/Tooltip.js +69 -94
- package/example/tooltip/tooltip.css +31 -8
- package/lib/Wysiwyg.vue +0 -3
- package/lib/components/base/composables/__tests__/useModalToggler.test.js +2 -0
- package/lib/components/base/composables/useModalToggler.js +21 -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 +19 -24
- package/package.json +7 -3
package/dist/wysiwyg.mjs
CHANGED
|
@@ -27,7 +27,7 @@ var __privateMethod = (obj, member, method) => {
|
|
|
27
27
|
return method;
|
|
28
28
|
};
|
|
29
29
|
var _buildDecorations, buildDecorations_fn, _domParser, _parser, _NodeFilter, NodeFilter_get, _Node, Node_get, _removeComments, removeComments_fn, _normalizeRootTags, normalizeRootTags_fn, _createNodeIterator, createNodeIterator_fn, _iterateNodes, iterateNodes_fn, _runIterator, runIterator_fn, _removeEmptyNodes, removeEmptyNodes_fn, _normalizeListItems, normalizeListItems_fn, _isBlockNode, isBlockNode_fn, _isRootNode, isRootNode_fn, _assignElementProperties, assignElementProperties_fn, _removeStyleProperties, removeStyleProperties_fn, _normalizeBreakLines, normalizeBreakLines_fn, _normalizeBlockTextDecoration, normalizeBlockTextDecoration_fn, _moveTextDecorationToChildren, moveTextDecorationToChildren_fn, _parseTextDecoration, parseTextDecoration_fn, _normalizeBlockBackgroundColor, normalizeBlockBackgroundColor_fn, _moveBackgroundColorToChildren, moveBackgroundColorToChildren_fn, _wrapTextNode, wrapTextNode_fn, _iterateNodes2, iterateNodes_fn2, _iterateChildNodes, iterateChildNodes_fn, _bubbleMarks, bubbleMarks_fn, _canBubbleMark, canBubbleMark_fn, _includesMark, includesMark_fn, _includesMarkType, includesMarkType_fn, _removeMark, removeMark_fn, _addMark, addMark_fn, _findMarkIndexByType, findMarkIndexByType_fn, _buildHtml, buildHtml_fn, _buildJson, buildJson_fn, _schema, _domParser2, _nodeDomParser, _textBlock, textBlock_fn, _normalizeTextBlockArgs, normalizeTextBlockArgs_fn, _contentSerializer, _getWeights, getWeights_fn;
|
|
30
|
-
import { computed, unref, toRef, reactive, watch, ref, inject,
|
|
30
|
+
import { computed, unref, toRef, reactive, watch, ref, inject, nextTick, onUnmounted, provide, onMounted } from "vue";
|
|
31
31
|
import { ColorModel, ZipifyColorPicker } from "@zipify/colorpicker";
|
|
32
32
|
function OrderedMap(content) {
|
|
33
33
|
this.content = content;
|
|
@@ -178,12 +178,12 @@ class Fragment {
|
|
|
178
178
|
}
|
|
179
179
|
nodesBetween(from2, to, f, nodeStart = 0, parent) {
|
|
180
180
|
for (let i = 0, pos = 0; pos < to; i++) {
|
|
181
|
-
let child = this.content[i],
|
|
182
|
-
if (
|
|
183
|
-
let
|
|
184
|
-
child.nodesBetween(Math.max(0, from2 -
|
|
181
|
+
let child = this.content[i], end = pos + child.nodeSize;
|
|
182
|
+
if (end > from2 && f(child, nodeStart + pos, parent || null, i) !== false && child.content.size) {
|
|
183
|
+
let start = pos + 1;
|
|
184
|
+
child.nodesBetween(Math.max(0, from2 - start), Math.min(child.content.size, to - start), f, nodeStart + start);
|
|
185
185
|
}
|
|
186
|
-
pos =
|
|
186
|
+
pos = end;
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
descendants(f) {
|
|
@@ -229,9 +229,9 @@ class Fragment {
|
|
|
229
229
|
let result = [], size2 = 0;
|
|
230
230
|
if (to > from2)
|
|
231
231
|
for (let i = 0, pos = 0; pos < to; i++) {
|
|
232
|
-
let child = this.content[i],
|
|
233
|
-
if (
|
|
234
|
-
if (pos < from2 ||
|
|
232
|
+
let child = this.content[i], end = pos + child.nodeSize;
|
|
233
|
+
if (end > from2) {
|
|
234
|
+
if (pos < from2 || end > to) {
|
|
235
235
|
if (child.isText)
|
|
236
236
|
child = child.cut(Math.max(0, from2 - pos), Math.min(child.text.length, to - pos));
|
|
237
237
|
else
|
|
@@ -240,7 +240,7 @@ class Fragment {
|
|
|
240
240
|
result.push(child);
|
|
241
241
|
size2 += child.nodeSize;
|
|
242
242
|
}
|
|
243
|
-
pos =
|
|
243
|
+
pos = end;
|
|
244
244
|
}
|
|
245
245
|
return new Fragment(result, size2);
|
|
246
246
|
}
|
|
@@ -313,13 +313,13 @@ class Fragment {
|
|
|
313
313
|
if (pos > this.size || pos < 0)
|
|
314
314
|
throw new RangeError(`Position ${pos} outside of fragment (${this})`);
|
|
315
315
|
for (let i = 0, curPos = 0; ; i++) {
|
|
316
|
-
let cur = this.child(i),
|
|
317
|
-
if (
|
|
318
|
-
if (
|
|
319
|
-
return retIndex(i + 1,
|
|
316
|
+
let cur = this.child(i), end = curPos + cur.nodeSize;
|
|
317
|
+
if (end >= pos) {
|
|
318
|
+
if (end == pos || round2 > 0)
|
|
319
|
+
return retIndex(i + 1, end);
|
|
320
320
|
return retIndex(i, curPos);
|
|
321
321
|
}
|
|
322
|
-
curPos =
|
|
322
|
+
curPos = end;
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
toString() {
|
|
@@ -575,13 +575,13 @@ function replaceOuter($from, $to, slice2, depth) {
|
|
|
575
575
|
let parent = $from.parent, content = parent.content;
|
|
576
576
|
return close(parent, content.cut(0, $from.parentOffset).append(slice2.content).append(content.cut($to.parentOffset)));
|
|
577
577
|
} else {
|
|
578
|
-
let { start
|
|
579
|
-
return close(node, replaceThreeWay($from,
|
|
578
|
+
let { start, end } = prepareSliceForReplace(slice2, $from);
|
|
579
|
+
return close(node, replaceThreeWay($from, start, end, $to, depth));
|
|
580
580
|
}
|
|
581
581
|
}
|
|
582
|
-
function checkJoin(
|
|
583
|
-
if (!sub.type.compatibleContent(
|
|
584
|
-
throw new ReplaceError("Cannot join " + sub.type.name + " onto " +
|
|
582
|
+
function checkJoin(main, sub) {
|
|
583
|
+
if (!sub.type.compatibleContent(main.type))
|
|
584
|
+
throw new ReplaceError("Cannot join " + sub.type.name + " onto " + main.type.name);
|
|
585
585
|
}
|
|
586
586
|
function joinable$1($before, $after, depth) {
|
|
587
587
|
let node = $before.node(depth);
|
|
@@ -735,13 +735,13 @@ class ResolvedPos {
|
|
|
735
735
|
return Mark$1.none;
|
|
736
736
|
if (this.textOffset)
|
|
737
737
|
return parent.child(index).marks;
|
|
738
|
-
let
|
|
739
|
-
if (!
|
|
740
|
-
let tmp =
|
|
741
|
-
|
|
738
|
+
let main = parent.maybeChild(index - 1), other = parent.maybeChild(index);
|
|
739
|
+
if (!main) {
|
|
740
|
+
let tmp = main;
|
|
741
|
+
main = other;
|
|
742
742
|
other = tmp;
|
|
743
743
|
}
|
|
744
|
-
let marks =
|
|
744
|
+
let marks = main.marks;
|
|
745
745
|
for (var i = 0; i < marks.length; i++)
|
|
746
746
|
if (marks[i].type.spec.inclusive === false && (!other || !marks[i].isInSet(other.marks)))
|
|
747
747
|
marks = marks[i--].removeFromSet(marks);
|
|
@@ -790,18 +790,18 @@ class ResolvedPos {
|
|
|
790
790
|
if (!(pos >= 0 && pos <= doc2.content.size))
|
|
791
791
|
throw new RangeError("Position " + pos + " out of range");
|
|
792
792
|
let path = [];
|
|
793
|
-
let
|
|
793
|
+
let start = 0, parentOffset = pos;
|
|
794
794
|
for (let node = doc2; ; ) {
|
|
795
795
|
let { index, offset: offset2 } = node.content.findIndex(parentOffset);
|
|
796
796
|
let rem = parentOffset - offset2;
|
|
797
|
-
path.push(node, index,
|
|
797
|
+
path.push(node, index, start + offset2);
|
|
798
798
|
if (!rem)
|
|
799
799
|
break;
|
|
800
800
|
node = node.child(index);
|
|
801
801
|
if (node.isText)
|
|
802
802
|
break;
|
|
803
803
|
parentOffset = rem - 1;
|
|
804
|
-
|
|
804
|
+
start += offset2 + 1;
|
|
805
805
|
}
|
|
806
806
|
return new ResolvedPos(pos, path, parentOffset);
|
|
807
807
|
}
|
|
@@ -907,8 +907,8 @@ class Node$1 {
|
|
|
907
907
|
return Slice.empty;
|
|
908
908
|
let $from = this.resolve(from2), $to = this.resolve(to);
|
|
909
909
|
let depth = includeParents ? 0 : $from.sharedDepth(to);
|
|
910
|
-
let
|
|
911
|
-
let content = node.content.cut($from.pos -
|
|
910
|
+
let start = $from.start(depth), node = $from.node(depth);
|
|
911
|
+
let content = node.content.cut($from.pos - start, $to.pos - start);
|
|
912
912
|
return new Slice(content, $from.depth - depth, $to.depth - depth);
|
|
913
913
|
}
|
|
914
914
|
replace(from2, to, slice2) {
|
|
@@ -989,12 +989,12 @@ class Node$1 {
|
|
|
989
989
|
throw new Error("Called contentMatchAt on a node with invalid content");
|
|
990
990
|
return match2;
|
|
991
991
|
}
|
|
992
|
-
canReplace(from2, to, replacement2 = Fragment.empty,
|
|
993
|
-
let one = this.contentMatchAt(from2).matchFragment(replacement2,
|
|
992
|
+
canReplace(from2, to, replacement2 = Fragment.empty, start = 0, end = replacement2.childCount) {
|
|
993
|
+
let one = this.contentMatchAt(from2).matchFragment(replacement2, start, end);
|
|
994
994
|
let two = one && one.matchFragment(this.content, to);
|
|
995
995
|
if (!two || !two.validEnd)
|
|
996
996
|
return false;
|
|
997
|
-
for (let i =
|
|
997
|
+
for (let i = start; i < end; i++)
|
|
998
998
|
if (!this.type.allowsMarks(replacement2.child(i).marks))
|
|
999
999
|
return false;
|
|
1000
1000
|
return true;
|
|
@@ -1002,9 +1002,9 @@ class Node$1 {
|
|
|
1002
1002
|
canReplaceWith(from2, to, type, marks) {
|
|
1003
1003
|
if (marks && !this.type.allowsMarks(marks))
|
|
1004
1004
|
return false;
|
|
1005
|
-
let
|
|
1006
|
-
let
|
|
1007
|
-
return
|
|
1005
|
+
let start = this.contentMatchAt(from2).matchType(type);
|
|
1006
|
+
let end = start && start.matchFragment(this.content, to);
|
|
1007
|
+
return end ? end.validEnd : false;
|
|
1008
1008
|
}
|
|
1009
1009
|
canAppend(other) {
|
|
1010
1010
|
if (other.content.size)
|
|
@@ -1124,9 +1124,9 @@ class ContentMatch {
|
|
|
1124
1124
|
return this.next[i].next;
|
|
1125
1125
|
return null;
|
|
1126
1126
|
}
|
|
1127
|
-
matchFragment(frag,
|
|
1127
|
+
matchFragment(frag, start = 0, end = frag.childCount) {
|
|
1128
1128
|
let cur = this;
|
|
1129
|
-
for (let i =
|
|
1129
|
+
for (let i = start; cur && i < end; i++)
|
|
1130
1130
|
cur = cur.matchType(frag.child(i).type);
|
|
1131
1131
|
return cur;
|
|
1132
1132
|
}
|
|
@@ -1884,9 +1884,9 @@ class NodeContext {
|
|
|
1884
1884
|
if (fill) {
|
|
1885
1885
|
this.match = this.type.contentMatch.matchFragment(fill);
|
|
1886
1886
|
} else {
|
|
1887
|
-
let
|
|
1888
|
-
if (wrap2 =
|
|
1889
|
-
this.match =
|
|
1887
|
+
let start = this.type.contentMatch, wrap2;
|
|
1888
|
+
if (wrap2 = start.findWrapping(node.type)) {
|
|
1889
|
+
this.match = start;
|
|
1890
1890
|
return wrap2;
|
|
1891
1891
|
} else {
|
|
1892
1892
|
return null;
|
|
@@ -1959,29 +1959,29 @@ class ParseContext {
|
|
|
1959
1959
|
this.addTextNode(dom);
|
|
1960
1960
|
} else if (dom.nodeType == 1) {
|
|
1961
1961
|
let style2 = dom.getAttribute("style");
|
|
1962
|
-
let marks = style2 ? this.readStyles(parseStyles(style2)) : null,
|
|
1962
|
+
let marks = style2 ? this.readStyles(parseStyles(style2)) : null, top = this.top;
|
|
1963
1963
|
if (marks != null)
|
|
1964
1964
|
for (let i = 0; i < marks.length; i++)
|
|
1965
1965
|
this.addPendingMark(marks[i]);
|
|
1966
1966
|
this.addElement(dom);
|
|
1967
1967
|
if (marks != null)
|
|
1968
1968
|
for (let i = 0; i < marks.length; i++)
|
|
1969
|
-
this.removePendingMark(marks[i],
|
|
1969
|
+
this.removePendingMark(marks[i], top);
|
|
1970
1970
|
}
|
|
1971
1971
|
}
|
|
1972
1972
|
addTextNode(dom) {
|
|
1973
1973
|
let value = dom.nodeValue;
|
|
1974
|
-
let
|
|
1975
|
-
if (
|
|
1976
|
-
if (!(
|
|
1974
|
+
let top = this.top;
|
|
1975
|
+
if (top.options & OPT_PRESERVE_WS_FULL || top.inlineContext(dom) || /[^ \t\r\n\u000c]/.test(value)) {
|
|
1976
|
+
if (!(top.options & OPT_PRESERVE_WS)) {
|
|
1977
1977
|
value = value.replace(/[ \t\r\n\u000c]+/g, " ");
|
|
1978
1978
|
if (/^[ \t\r\n\u000c]/.test(value) && this.open == this.nodes.length - 1) {
|
|
1979
|
-
let nodeBefore =
|
|
1979
|
+
let nodeBefore = top.content[top.content.length - 1];
|
|
1980
1980
|
let domNodeBefore = dom.previousSibling;
|
|
1981
1981
|
if (!nodeBefore || domNodeBefore && domNodeBefore.nodeName == "BR" || nodeBefore.isText && /[ \t\r\n\u000c]$/.test(nodeBefore.text))
|
|
1982
1982
|
value = value.slice(1);
|
|
1983
1983
|
}
|
|
1984
|
-
} else if (!(
|
|
1984
|
+
} else if (!(top.options & OPT_PRESERVE_WS_FULL)) {
|
|
1985
1985
|
value = value.replace(/\r?\n|\r/g, " ");
|
|
1986
1986
|
} else {
|
|
1987
1987
|
value = value.replace(/\r\n?/g, "\n");
|
|
@@ -2006,10 +2006,10 @@ class ParseContext {
|
|
|
2006
2006
|
this.open = Math.max(0, this.open - 1);
|
|
2007
2007
|
else if (rule && rule.skip.nodeType)
|
|
2008
2008
|
dom = rule.skip;
|
|
2009
|
-
let sync,
|
|
2009
|
+
let sync, top = this.top, oldNeedsBlock = this.needsBlock;
|
|
2010
2010
|
if (blockTags.hasOwnProperty(name)) {
|
|
2011
2011
|
sync = true;
|
|
2012
|
-
if (!
|
|
2012
|
+
if (!top.type)
|
|
2013
2013
|
this.needsBlock = true;
|
|
2014
2014
|
} else if (!dom.firstChild) {
|
|
2015
2015
|
this.leafFallback(dom);
|
|
@@ -2017,7 +2017,7 @@ class ParseContext {
|
|
|
2017
2017
|
}
|
|
2018
2018
|
this.addAll(dom);
|
|
2019
2019
|
if (sync)
|
|
2020
|
-
this.sync(
|
|
2020
|
+
this.sync(top);
|
|
2021
2021
|
this.needsBlock = oldNeedsBlock;
|
|
2022
2022
|
} else {
|
|
2023
2023
|
this.addElementByRule(dom, rule, rule.consuming === false ? ruleID : void 0);
|
|
@@ -2090,7 +2090,7 @@ class ParseContext {
|
|
|
2090
2090
|
}
|
|
2091
2091
|
addAll(parent, startIndex2, endIndex2) {
|
|
2092
2092
|
let index = startIndex2 || 0;
|
|
2093
|
-
for (let dom = startIndex2 ? parent.childNodes[startIndex2] : parent.firstChild,
|
|
2093
|
+
for (let dom = startIndex2 ? parent.childNodes[startIndex2] : parent.firstChild, end = endIndex2 == null ? null : parent.childNodes[endIndex2]; dom != end; dom = dom.nextSibling, ++index) {
|
|
2094
2094
|
this.findAtPoint(parent, index);
|
|
2095
2095
|
this.addDOM(dom);
|
|
2096
2096
|
}
|
|
@@ -2125,15 +2125,15 @@ class ParseContext {
|
|
|
2125
2125
|
}
|
|
2126
2126
|
if (this.findPlace(node)) {
|
|
2127
2127
|
this.closeExtra();
|
|
2128
|
-
let
|
|
2129
|
-
|
|
2130
|
-
if (
|
|
2131
|
-
|
|
2132
|
-
let marks =
|
|
2128
|
+
let top = this.top;
|
|
2129
|
+
top.applyPending(node.type);
|
|
2130
|
+
if (top.match)
|
|
2131
|
+
top.match = top.match.matchType(node.type);
|
|
2132
|
+
let marks = top.activeMarks;
|
|
2133
2133
|
for (let i = 0; i < node.marks.length; i++)
|
|
2134
|
-
if (!
|
|
2134
|
+
if (!top.type || top.type.allowsMarkType(node.marks[i].type))
|
|
2135
2135
|
marks = node.marks[i].addToSet(marks);
|
|
2136
|
-
|
|
2136
|
+
top.content.push(node.mark(marks));
|
|
2137
2137
|
return true;
|
|
2138
2138
|
}
|
|
2139
2139
|
return false;
|
|
@@ -2146,13 +2146,13 @@ class ParseContext {
|
|
|
2146
2146
|
}
|
|
2147
2147
|
enterInner(type, attrs = null, solid = false, preserveWS) {
|
|
2148
2148
|
this.closeExtra();
|
|
2149
|
-
let
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
let options = wsOptionsFor(type, preserveWS,
|
|
2153
|
-
if (
|
|
2149
|
+
let top = this.top;
|
|
2150
|
+
top.applyPending(type);
|
|
2151
|
+
top.match = top.match && top.match.matchType(type);
|
|
2152
|
+
let options = wsOptionsFor(type, preserveWS, top.options);
|
|
2153
|
+
if (top.options & OPT_OPEN_LEFT && top.content.length == 0)
|
|
2154
2154
|
options |= OPT_OPEN_LEFT;
|
|
2155
|
-
this.nodes.push(new NodeContext(type, attrs,
|
|
2155
|
+
this.nodes.push(new NodeContext(type, attrs, top.activeMarks, top.pendingMarks, solid, null, options));
|
|
2156
2156
|
this.open++;
|
|
2157
2157
|
}
|
|
2158
2158
|
closeExtra(openEnd = false) {
|
|
@@ -2346,7 +2346,7 @@ class DOMSerializer {
|
|
|
2346
2346
|
serializeFragment(fragment, options = {}, target) {
|
|
2347
2347
|
if (!target)
|
|
2348
2348
|
target = doc$1(options).createDocumentFragment();
|
|
2349
|
-
let
|
|
2349
|
+
let top = target, active = [];
|
|
2350
2350
|
fragment.forEach((node) => {
|
|
2351
2351
|
if (active.length || node.marks.length) {
|
|
2352
2352
|
let keep = 0, rendered = 0;
|
|
@@ -2362,18 +2362,18 @@ class DOMSerializer {
|
|
|
2362
2362
|
rendered++;
|
|
2363
2363
|
}
|
|
2364
2364
|
while (keep < active.length)
|
|
2365
|
-
|
|
2365
|
+
top = active.pop()[1];
|
|
2366
2366
|
while (rendered < node.marks.length) {
|
|
2367
2367
|
let add = node.marks[rendered++];
|
|
2368
2368
|
let markDOM = this.serializeMark(add, node.isInline, options);
|
|
2369
2369
|
if (markDOM) {
|
|
2370
|
-
active.push([add,
|
|
2371
|
-
|
|
2372
|
-
|
|
2370
|
+
active.push([add, top]);
|
|
2371
|
+
top.appendChild(markDOM.dom);
|
|
2372
|
+
top = markDOM.contentDOM || markDOM.dom;
|
|
2373
2373
|
}
|
|
2374
2374
|
}
|
|
2375
2375
|
}
|
|
2376
|
-
|
|
2376
|
+
top.appendChild(this.serializeNodeInner(node, options));
|
|
2377
2377
|
});
|
|
2378
2378
|
return target;
|
|
2379
2379
|
}
|
|
@@ -2415,9 +2415,9 @@ class DOMSerializer {
|
|
|
2415
2415
|
}
|
|
2416
2416
|
let contentDOM;
|
|
2417
2417
|
let dom = xmlNS ? doc2.createElementNS(xmlNS, tagName) : doc2.createElement(tagName);
|
|
2418
|
-
let attrs = structure[1],
|
|
2418
|
+
let attrs = structure[1], start = 1;
|
|
2419
2419
|
if (attrs && typeof attrs == "object" && attrs.nodeType == null && !Array.isArray(attrs)) {
|
|
2420
|
-
|
|
2420
|
+
start = 2;
|
|
2421
2421
|
for (let name in attrs)
|
|
2422
2422
|
if (attrs[name] != null) {
|
|
2423
2423
|
let space2 = name.indexOf(" ");
|
|
@@ -2427,10 +2427,10 @@ class DOMSerializer {
|
|
|
2427
2427
|
dom.setAttribute(name, attrs[name]);
|
|
2428
2428
|
}
|
|
2429
2429
|
}
|
|
2430
|
-
for (let i =
|
|
2430
|
+
for (let i = start; i < structure.length; i++) {
|
|
2431
2431
|
let child = structure[i];
|
|
2432
2432
|
if (child === 0) {
|
|
2433
|
-
if (i < structure.length - 1 || i >
|
|
2433
|
+
if (i < structure.length - 1 || i > start)
|
|
2434
2434
|
throw new RangeError("Content hole must be the only child of its parent node");
|
|
2435
2435
|
return { dom, contentDOM: dom };
|
|
2436
2436
|
} else {
|
|
@@ -2524,18 +2524,18 @@ class StepMap {
|
|
|
2524
2524
|
_map(pos, assoc, simple) {
|
|
2525
2525
|
let diff = 0, oldIndex = this.inverted ? 2 : 1, newIndex = this.inverted ? 1 : 2;
|
|
2526
2526
|
for (let i = 0; i < this.ranges.length; i += 3) {
|
|
2527
|
-
let
|
|
2528
|
-
if (
|
|
2527
|
+
let start = this.ranges[i] - (this.inverted ? diff : 0);
|
|
2528
|
+
if (start > pos)
|
|
2529
2529
|
break;
|
|
2530
|
-
let oldSize = this.ranges[i + oldIndex], newSize = this.ranges[i + newIndex],
|
|
2531
|
-
if (pos <=
|
|
2532
|
-
let side = !oldSize ? assoc : pos ==
|
|
2533
|
-
let result =
|
|
2530
|
+
let oldSize = this.ranges[i + oldIndex], newSize = this.ranges[i + newIndex], end = start + oldSize;
|
|
2531
|
+
if (pos <= end) {
|
|
2532
|
+
let side = !oldSize ? assoc : pos == start ? -1 : pos == end ? 1 : assoc;
|
|
2533
|
+
let result = start + diff + (side < 0 ? 0 : newSize);
|
|
2534
2534
|
if (simple)
|
|
2535
2535
|
return result;
|
|
2536
|
-
let recover = pos == (assoc < 0 ?
|
|
2537
|
-
let del = pos ==
|
|
2538
|
-
if (assoc < 0 ? pos !=
|
|
2536
|
+
let recover = pos == (assoc < 0 ? start : end) ? null : makeRecover(i / 3, pos - start);
|
|
2537
|
+
let del = pos == start ? DEL_AFTER : pos == end ? DEL_BEFORE : DEL_ACROSS;
|
|
2538
|
+
if (assoc < 0 ? pos != start : pos != end)
|
|
2539
2539
|
del |= DEL_SIDE;
|
|
2540
2540
|
return new MapResult(result, del, recover);
|
|
2541
2541
|
}
|
|
@@ -2547,11 +2547,11 @@ class StepMap {
|
|
|
2547
2547
|
let diff = 0, index = recoverIndex(recover);
|
|
2548
2548
|
let oldIndex = this.inverted ? 2 : 1, newIndex = this.inverted ? 1 : 2;
|
|
2549
2549
|
for (let i = 0; i < this.ranges.length; i += 3) {
|
|
2550
|
-
let
|
|
2551
|
-
if (
|
|
2550
|
+
let start = this.ranges[i] - (this.inverted ? diff : 0);
|
|
2551
|
+
if (start > pos)
|
|
2552
2552
|
break;
|
|
2553
|
-
let oldSize = this.ranges[i + oldIndex],
|
|
2554
|
-
if (pos <=
|
|
2553
|
+
let oldSize = this.ranges[i + oldIndex], end = start + oldSize;
|
|
2554
|
+
if (pos <= end && i == index * 3)
|
|
2555
2555
|
return true;
|
|
2556
2556
|
diff += this.ranges[i + newIndex] - oldSize;
|
|
2557
2557
|
}
|
|
@@ -2560,7 +2560,7 @@ class StepMap {
|
|
|
2560
2560
|
forEach(f) {
|
|
2561
2561
|
let oldIndex = this.inverted ? 2 : 1, newIndex = this.inverted ? 1 : 2;
|
|
2562
2562
|
for (let i = 0, diff = 0; i < this.ranges.length; i += 3) {
|
|
2563
|
-
let
|
|
2563
|
+
let start = this.ranges[i], oldStart = start - (this.inverted ? diff : 0), newStart = start + (this.inverted ? 0 : diff);
|
|
2564
2564
|
let oldSize = this.ranges[i + oldIndex], newSize = this.ranges[i + newIndex];
|
|
2565
2565
|
f(oldStart, oldStart + oldSize, newStart, newStart + newSize);
|
|
2566
2566
|
diff += newSize - oldSize;
|
|
@@ -2941,20 +2941,20 @@ function addMark(tr, from2, to, mark) {
|
|
|
2941
2941
|
return;
|
|
2942
2942
|
let marks = node.marks;
|
|
2943
2943
|
if (!mark.isInSet(marks) && parent.type.allowsMarkType(mark.type)) {
|
|
2944
|
-
let
|
|
2944
|
+
let start = Math.max(pos, from2), end = Math.min(pos + node.nodeSize, to);
|
|
2945
2945
|
let newSet = mark.addToSet(marks);
|
|
2946
2946
|
for (let i = 0; i < marks.length; i++) {
|
|
2947
2947
|
if (!marks[i].isInSet(newSet)) {
|
|
2948
|
-
if (removing && removing.to ==
|
|
2949
|
-
removing.to =
|
|
2948
|
+
if (removing && removing.to == start && removing.mark.eq(marks[i]))
|
|
2949
|
+
removing.to = end;
|
|
2950
2950
|
else
|
|
2951
|
-
removed.push(removing = new RemoveMarkStep(
|
|
2951
|
+
removed.push(removing = new RemoveMarkStep(start, end, marks[i]));
|
|
2952
2952
|
}
|
|
2953
2953
|
}
|
|
2954
|
-
if (adding && adding.to ==
|
|
2955
|
-
adding.to =
|
|
2954
|
+
if (adding && adding.to == start)
|
|
2955
|
+
adding.to = end;
|
|
2956
2956
|
else
|
|
2957
|
-
added.push(adding = new AddMarkStep(
|
|
2957
|
+
added.push(adding = new AddMarkStep(start, end, mark));
|
|
2958
2958
|
}
|
|
2959
2959
|
});
|
|
2960
2960
|
removed.forEach((s) => tr.step(s));
|
|
@@ -2980,7 +2980,7 @@ function removeMark(tr, from2, to, mark) {
|
|
|
2980
2980
|
toRemove = node.marks;
|
|
2981
2981
|
}
|
|
2982
2982
|
if (toRemove && toRemove.length) {
|
|
2983
|
-
let
|
|
2983
|
+
let end = Math.min(pos + node.nodeSize, to);
|
|
2984
2984
|
for (let i = 0; i < toRemove.length; i++) {
|
|
2985
2985
|
let style2 = toRemove[i], found2;
|
|
2986
2986
|
for (let j = 0; j < matched.length; j++) {
|
|
@@ -2989,10 +2989,10 @@ function removeMark(tr, from2, to, mark) {
|
|
|
2989
2989
|
found2 = m;
|
|
2990
2990
|
}
|
|
2991
2991
|
if (found2) {
|
|
2992
|
-
found2.to =
|
|
2992
|
+
found2.to = end;
|
|
2993
2993
|
found2.step = step;
|
|
2994
2994
|
} else {
|
|
2995
|
-
matched.push({ style: style2, from: Math.max(pos, from2), to:
|
|
2995
|
+
matched.push({ style: style2, from: Math.max(pos, from2), to: end, step });
|
|
2996
2996
|
}
|
|
2997
2997
|
}
|
|
2998
2998
|
}
|
|
@@ -3003,17 +3003,17 @@ function clearIncompatible(tr, pos, parentType, match2 = parentType.contentMatch
|
|
|
3003
3003
|
let node = tr.doc.nodeAt(pos);
|
|
3004
3004
|
let delSteps = [], cur = pos + 1;
|
|
3005
3005
|
for (let i = 0; i < node.childCount; i++) {
|
|
3006
|
-
let child = node.child(i),
|
|
3006
|
+
let child = node.child(i), end = cur + child.nodeSize;
|
|
3007
3007
|
let allowed = match2.matchType(child.type);
|
|
3008
3008
|
if (!allowed) {
|
|
3009
|
-
delSteps.push(new ReplaceStep(cur,
|
|
3009
|
+
delSteps.push(new ReplaceStep(cur, end, Slice.empty));
|
|
3010
3010
|
} else {
|
|
3011
3011
|
match2 = allowed;
|
|
3012
3012
|
for (let j = 0; j < child.marks.length; j++)
|
|
3013
3013
|
if (!parentType.allowsMarkType(child.marks[j].type))
|
|
3014
|
-
tr.step(new RemoveMarkStep(cur,
|
|
3014
|
+
tr.step(new RemoveMarkStep(cur, end, child.marks[j]));
|
|
3015
3015
|
}
|
|
3016
|
-
cur =
|
|
3016
|
+
cur = end;
|
|
3017
3017
|
}
|
|
3018
3018
|
if (!match2.validEnd) {
|
|
3019
3019
|
let fill = match2.fillBefore(Fragment.empty, true);
|
|
@@ -3022,8 +3022,8 @@ function clearIncompatible(tr, pos, parentType, match2 = parentType.contentMatch
|
|
|
3022
3022
|
for (let i = delSteps.length - 1; i >= 0; i--)
|
|
3023
3023
|
tr.step(delSteps[i]);
|
|
3024
3024
|
}
|
|
3025
|
-
function canCut(node,
|
|
3026
|
-
return (
|
|
3025
|
+
function canCut(node, start, end) {
|
|
3026
|
+
return (start == 0 || node.canReplace(start, node.childCount)) && (end == node.childCount || node.canReplace(0, end));
|
|
3027
3027
|
}
|
|
3028
3028
|
function liftTarget(range) {
|
|
3029
3029
|
let parent = range.parent;
|
|
@@ -3041,7 +3041,7 @@ function liftTarget(range) {
|
|
|
3041
3041
|
function lift$2(tr, range, target) {
|
|
3042
3042
|
let { $from, $to, depth } = range;
|
|
3043
3043
|
let gapStart = $from.before(depth + 1), gapEnd = $to.after(depth + 1);
|
|
3044
|
-
let
|
|
3044
|
+
let start = gapStart, end = gapEnd;
|
|
3045
3045
|
let before = Fragment.empty, openStart = 0;
|
|
3046
3046
|
for (let d = depth, splitting = false; d > target; d--)
|
|
3047
3047
|
if (splitting || $from.index(d) > 0) {
|
|
@@ -3049,7 +3049,7 @@ function lift$2(tr, range, target) {
|
|
|
3049
3049
|
before = Fragment.from($from.node(d).copy(before));
|
|
3050
3050
|
openStart++;
|
|
3051
3051
|
} else {
|
|
3052
|
-
|
|
3052
|
+
start--;
|
|
3053
3053
|
}
|
|
3054
3054
|
let after = Fragment.empty, openEnd = 0;
|
|
3055
3055
|
for (let d = depth, splitting = false; d > target; d--)
|
|
@@ -3058,9 +3058,9 @@ function lift$2(tr, range, target) {
|
|
|
3058
3058
|
after = Fragment.from($to.node(d).copy(after));
|
|
3059
3059
|
openEnd++;
|
|
3060
3060
|
} else {
|
|
3061
|
-
|
|
3061
|
+
end++;
|
|
3062
3062
|
}
|
|
3063
|
-
tr.step(new ReplaceAroundStep(
|
|
3063
|
+
tr.step(new ReplaceAroundStep(start, end, gapStart, gapEnd, new Slice(before.append(after), openStart, openEnd), before.size - openStart, true));
|
|
3064
3064
|
}
|
|
3065
3065
|
function findWrapping(range, nodeType, attrs = null, innerRange = range) {
|
|
3066
3066
|
let around = findWrappingOutside(range, nodeType);
|
|
@@ -3104,8 +3104,8 @@ function wrap(tr, range, wrappers) {
|
|
|
3104
3104
|
}
|
|
3105
3105
|
content = Fragment.from(wrappers[i].type.create(wrappers[i].attrs, content));
|
|
3106
3106
|
}
|
|
3107
|
-
let
|
|
3108
|
-
tr.step(new ReplaceAroundStep(
|
|
3107
|
+
let start = range.start, end = range.end;
|
|
3108
|
+
tr.step(new ReplaceAroundStep(start, end, start, end, new Slice(content, 0, 0), wrappers.length, true));
|
|
3109
3109
|
}
|
|
3110
3110
|
function setBlockType$1(tr, from2, to, type, attrs) {
|
|
3111
3111
|
if (!type.isTextblock)
|
|
@@ -3364,8 +3364,8 @@ class Fitter {
|
|
|
3364
3364
|
mustMoveInline() {
|
|
3365
3365
|
if (!this.$to.parent.isTextblock)
|
|
3366
3366
|
return -1;
|
|
3367
|
-
let
|
|
3368
|
-
if (!
|
|
3367
|
+
let top = this.frontier[this.depth], level;
|
|
3368
|
+
if (!top.type.isTextblock || !contentAfterFits(this.$to, this.$to.depth, top.type, top.match, false) || this.$to.depth == this.depth && (level = this.findCloseLevel(this.$to)) && level.depth == this.depth)
|
|
3369
3369
|
return -1;
|
|
3370
3370
|
let { depth } = this.$to, after = this.$to.after(depth);
|
|
3371
3371
|
while (depth > 1 && after == this.$to.end(--depth))
|
|
@@ -3405,8 +3405,8 @@ class Fitter {
|
|
|
3405
3405
|
return $to;
|
|
3406
3406
|
}
|
|
3407
3407
|
openFrontierNode(type, attrs = null, content) {
|
|
3408
|
-
let
|
|
3409
|
-
|
|
3408
|
+
let top = this.frontier[this.depth];
|
|
3409
|
+
top.match = top.match.matchType(type);
|
|
3410
3410
|
this.placed = addToFragment(this.placed, this.depth, Fragment.from(type.create(attrs, content)));
|
|
3411
3411
|
this.frontier.push({ type, match: type.contentMatch });
|
|
3412
3412
|
}
|
|
@@ -3452,8 +3452,8 @@ function contentAfterFits($to, depth, type, match2, open) {
|
|
|
3452
3452
|
let fit = match2.fillBefore(node.content, true, index);
|
|
3453
3453
|
return fit && !invalidMarks(type, node.content, index) ? fit : null;
|
|
3454
3454
|
}
|
|
3455
|
-
function invalidMarks(type, fragment,
|
|
3456
|
-
for (let i =
|
|
3455
|
+
function invalidMarks(type, fragment, start) {
|
|
3456
|
+
for (let i = start; i < fragment.childCount; i++)
|
|
3457
3457
|
if (!type.allowsMarks(fragment.child(i).marks))
|
|
3458
3458
|
return true;
|
|
3459
3459
|
return false;
|
|
@@ -3532,8 +3532,8 @@ function closeFragment(fragment, depth, oldOpen, newOpen, parent) {
|
|
|
3532
3532
|
}
|
|
3533
3533
|
if (depth > newOpen) {
|
|
3534
3534
|
let match2 = parent.contentMatchAt(0);
|
|
3535
|
-
let
|
|
3536
|
-
fragment =
|
|
3535
|
+
let start = match2.fillBefore(fragment).append(fragment);
|
|
3536
|
+
fragment = start.append(match2.matchFragment(start).fillBefore(Fragment.empty, true));
|
|
3537
3537
|
}
|
|
3538
3538
|
return fragment;
|
|
3539
3539
|
}
|
|
@@ -3564,10 +3564,10 @@ function deleteRange$1(tr, from2, to) {
|
|
|
3564
3564
|
function coveredDepths($from, $to) {
|
|
3565
3565
|
let result = [], minDepth = Math.min($from.depth, $to.depth);
|
|
3566
3566
|
for (let d = minDepth; d >= 0; d--) {
|
|
3567
|
-
let
|
|
3568
|
-
if (
|
|
3567
|
+
let start = $from.start(d);
|
|
3568
|
+
if (start < $from.pos - ($from.depth - d) || $to.end(d) > $to.pos + ($to.depth - d) || $from.node(d).type.spec.isolating || $to.node(d).type.spec.isolating)
|
|
3569
3569
|
break;
|
|
3570
|
-
if (
|
|
3570
|
+
if (start == $to.start(d) || d == $from.depth && d == $to.depth && $from.parent.inlineContent && $to.parent.inlineContent && d && $to.start(d - 1) == start - 1)
|
|
3571
3571
|
result.push(d);
|
|
3572
3572
|
}
|
|
3573
3573
|
return result;
|
|
@@ -3987,12 +3987,12 @@ function selectionToInsertionEnd$1(tr, startLen, bias) {
|
|
|
3987
3987
|
let step = tr.steps[last];
|
|
3988
3988
|
if (!(step instanceof ReplaceStep || step instanceof ReplaceAroundStep))
|
|
3989
3989
|
return;
|
|
3990
|
-
let map2 = tr.mapping.maps[last],
|
|
3990
|
+
let map2 = tr.mapping.maps[last], end;
|
|
3991
3991
|
map2.forEach((_from, _to, _newFrom, newTo) => {
|
|
3992
|
-
if (
|
|
3993
|
-
|
|
3992
|
+
if (end == null)
|
|
3993
|
+
end = newTo;
|
|
3994
3994
|
});
|
|
3995
|
-
tr.setSelection(Selection.near(tr.doc.resolve(
|
|
3995
|
+
tr.setSelection(Selection.near(tr.doc.resolve(end), bias));
|
|
3996
3996
|
}
|
|
3997
3997
|
const UPDATED_SEL = 1, UPDATED_MARKS = 2, UPDATED_SCROLL = 4;
|
|
3998
3998
|
class Transaction extends Transform {
|
|
@@ -4441,7 +4441,7 @@ function windowRect(doc2) {
|
|
|
4441
4441
|
bottom: doc2.documentElement.clientHeight
|
|
4442
4442
|
};
|
|
4443
4443
|
}
|
|
4444
|
-
function getSide(value, side) {
|
|
4444
|
+
function getSide$1(value, side) {
|
|
4445
4445
|
return typeof value == "number" ? value : value[side];
|
|
4446
4446
|
}
|
|
4447
4447
|
function clientRect(node) {
|
|
@@ -4467,14 +4467,14 @@ function scrollRectIntoView(view, rect, startDOM) {
|
|
|
4467
4467
|
let atTop = elt == doc2.body;
|
|
4468
4468
|
let bounding = atTop ? windowRect(doc2) : clientRect(elt);
|
|
4469
4469
|
let moveX = 0, moveY = 0;
|
|
4470
|
-
if (rect.top < bounding.top + getSide(scrollThreshold, "top"))
|
|
4471
|
-
moveY = -(bounding.top - rect.top + getSide(scrollMargin, "top"));
|
|
4472
|
-
else if (rect.bottom > bounding.bottom - getSide(scrollThreshold, "bottom"))
|
|
4473
|
-
moveY = rect.bottom - bounding.bottom + getSide(scrollMargin, "bottom");
|
|
4474
|
-
if (rect.left < bounding.left + getSide(scrollThreshold, "left"))
|
|
4475
|
-
moveX = -(bounding.left - rect.left + getSide(scrollMargin, "left"));
|
|
4476
|
-
else if (rect.right > bounding.right - getSide(scrollThreshold, "right"))
|
|
4477
|
-
moveX = rect.right - bounding.right + getSide(scrollMargin, "right");
|
|
4470
|
+
if (rect.top < bounding.top + getSide$1(scrollThreshold, "top"))
|
|
4471
|
+
moveY = -(bounding.top - rect.top + getSide$1(scrollMargin, "top"));
|
|
4472
|
+
else if (rect.bottom > bounding.bottom - getSide$1(scrollThreshold, "bottom"))
|
|
4473
|
+
moveY = rect.bottom - bounding.bottom + getSide$1(scrollMargin, "bottom");
|
|
4474
|
+
if (rect.left < bounding.left + getSide$1(scrollThreshold, "left"))
|
|
4475
|
+
moveX = -(bounding.left - rect.left + getSide$1(scrollMargin, "left"));
|
|
4476
|
+
else if (rect.right > bounding.right - getSide$1(scrollThreshold, "right"))
|
|
4477
|
+
moveX = rect.right - bounding.right + getSide$1(scrollMargin, "right");
|
|
4478
4478
|
if (moveX || moveY) {
|
|
4479
4479
|
if (atTop) {
|
|
4480
4480
|
doc2.defaultView.scrollBy(moveX, moveY);
|
|
@@ -4523,11 +4523,11 @@ function resetScrollPos({ refDOM, refTop, stack }) {
|
|
|
4523
4523
|
}
|
|
4524
4524
|
function restoreScrollStack(stack, dTop) {
|
|
4525
4525
|
for (let i = 0; i < stack.length; i++) {
|
|
4526
|
-
let { dom, top
|
|
4527
|
-
if (dom.scrollTop !=
|
|
4528
|
-
dom.scrollTop =
|
|
4529
|
-
if (dom.scrollLeft !=
|
|
4530
|
-
dom.scrollLeft =
|
|
4526
|
+
let { dom, top, left } = stack[i];
|
|
4527
|
+
if (dom.scrollTop != top + dTop)
|
|
4528
|
+
dom.scrollTop = top + dTop;
|
|
4529
|
+
if (dom.scrollLeft != left)
|
|
4530
|
+
dom.scrollLeft = left;
|
|
4531
4531
|
}
|
|
4532
4532
|
}
|
|
4533
4533
|
let preventScrollSupported = null;
|
|
@@ -4773,16 +4773,16 @@ function coordsAtPos(view, pos, side) {
|
|
|
4773
4773
|
}
|
|
4774
4774
|
return flattenV(singleRect(node.nodeType == 3 ? textRange(node) : node, -side), side >= 0);
|
|
4775
4775
|
}
|
|
4776
|
-
function flattenV(rect,
|
|
4776
|
+
function flattenV(rect, left) {
|
|
4777
4777
|
if (rect.width == 0)
|
|
4778
4778
|
return rect;
|
|
4779
|
-
let x =
|
|
4779
|
+
let x = left ? rect.left : rect.right;
|
|
4780
4780
|
return { top: rect.top, bottom: rect.bottom, left: x, right: x };
|
|
4781
4781
|
}
|
|
4782
|
-
function flattenH(rect,
|
|
4782
|
+
function flattenH(rect, top) {
|
|
4783
4783
|
if (rect.height == 0)
|
|
4784
4784
|
return rect;
|
|
4785
|
-
let y =
|
|
4785
|
+
let y = top ? rect.top : rect.bottom;
|
|
4786
4786
|
return { top: y, bottom: y, left: rect.left, right: rect.right };
|
|
4787
4787
|
}
|
|
4788
4788
|
function withFlushedState(view, state, f) {
|
|
@@ -5011,15 +5011,15 @@ class ViewDesc {
|
|
|
5011
5011
|
}
|
|
5012
5012
|
descAt(pos) {
|
|
5013
5013
|
for (let i = 0, offset2 = 0; i < this.children.length; i++) {
|
|
5014
|
-
let child = this.children[i],
|
|
5015
|
-
if (offset2 == pos &&
|
|
5014
|
+
let child = this.children[i], end = offset2 + child.size;
|
|
5015
|
+
if (offset2 == pos && end != offset2) {
|
|
5016
5016
|
while (!child.border && child.children.length)
|
|
5017
5017
|
child = child.children[0];
|
|
5018
5018
|
return child;
|
|
5019
5019
|
}
|
|
5020
|
-
if (pos <
|
|
5020
|
+
if (pos < end)
|
|
5021
5021
|
return child.descAt(pos - offset2 - child.border);
|
|
5022
|
-
offset2 =
|
|
5022
|
+
offset2 = end;
|
|
5023
5023
|
}
|
|
5024
5024
|
}
|
|
5025
5025
|
domFromPos(pos, side) {
|
|
@@ -5027,12 +5027,12 @@ class ViewDesc {
|
|
|
5027
5027
|
return { node: this.dom, offset: 0 };
|
|
5028
5028
|
let i = 0, offset2 = 0;
|
|
5029
5029
|
for (let curPos = 0; i < this.children.length; i++) {
|
|
5030
|
-
let child = this.children[i],
|
|
5031
|
-
if (
|
|
5030
|
+
let child = this.children[i], end = curPos + child.size;
|
|
5031
|
+
if (end > pos || child instanceof TrailingHackViewDesc) {
|
|
5032
5032
|
offset2 = pos - curPos;
|
|
5033
5033
|
break;
|
|
5034
5034
|
}
|
|
5035
|
-
curPos =
|
|
5035
|
+
curPos = end;
|
|
5036
5036
|
}
|
|
5037
5037
|
if (offset2)
|
|
5038
5038
|
return this.children[i].domFromPos(offset2 - this.children[i].border, side);
|
|
@@ -5065,10 +5065,10 @@ class ViewDesc {
|
|
|
5065
5065
|
return { node: this.contentDOM, from: from2, to, fromOffset: 0, toOffset: this.contentDOM.childNodes.length };
|
|
5066
5066
|
let fromOffset = -1, toOffset = -1;
|
|
5067
5067
|
for (let offset2 = base2, i = 0; ; i++) {
|
|
5068
|
-
let child = this.children[i],
|
|
5069
|
-
if (fromOffset == -1 && from2 <=
|
|
5068
|
+
let child = this.children[i], end = offset2 + child.size;
|
|
5069
|
+
if (fromOffset == -1 && from2 <= end) {
|
|
5070
5070
|
let childBase = offset2 + child.border;
|
|
5071
|
-
if (from2 >= childBase && to <=
|
|
5071
|
+
if (from2 >= childBase && to <= end - child.border && child.node && child.contentDOM && this.contentDOM.contains(child.contentDOM))
|
|
5072
5072
|
return child.parseRange(from2, to, childBase);
|
|
5073
5073
|
from2 = offset2;
|
|
5074
5074
|
for (let j = i; j > 0; j--) {
|
|
@@ -5082,8 +5082,8 @@ class ViewDesc {
|
|
|
5082
5082
|
if (fromOffset == -1)
|
|
5083
5083
|
fromOffset = 0;
|
|
5084
5084
|
}
|
|
5085
|
-
if (fromOffset > -1 && (
|
|
5086
|
-
to =
|
|
5085
|
+
if (fromOffset > -1 && (end > to || i == this.children.length - 1)) {
|
|
5086
|
+
to = end;
|
|
5087
5087
|
for (let j = i + 1; j < this.children.length; j++) {
|
|
5088
5088
|
let next2 = this.children[j];
|
|
5089
5089
|
if (next2.size && next2.dom.parentNode == this.contentDOM && !next2.emptyChildAt(-1)) {
|
|
@@ -5096,7 +5096,7 @@ class ViewDesc {
|
|
|
5096
5096
|
toOffset = this.contentDOM.childNodes.length;
|
|
5097
5097
|
break;
|
|
5098
5098
|
}
|
|
5099
|
-
offset2 =
|
|
5099
|
+
offset2 = end;
|
|
5100
5100
|
}
|
|
5101
5101
|
return { node: this.contentDOM, from: from2, to, fromOffset, toOffset };
|
|
5102
5102
|
}
|
|
@@ -5115,10 +5115,10 @@ class ViewDesc {
|
|
|
5115
5115
|
setSelection(anchor, head, root2, force = false) {
|
|
5116
5116
|
let from2 = Math.min(anchor, head), to = Math.max(anchor, head);
|
|
5117
5117
|
for (let i = 0, offset2 = 0; i < this.children.length; i++) {
|
|
5118
|
-
let child = this.children[i],
|
|
5119
|
-
if (from2 > offset2 && to <
|
|
5118
|
+
let child = this.children[i], end = offset2 + child.size;
|
|
5119
|
+
if (from2 > offset2 && to < end)
|
|
5120
5120
|
return child.setSelection(anchor - offset2 - child.border, head - offset2 - child.border, root2, force);
|
|
5121
|
-
offset2 =
|
|
5121
|
+
offset2 = end;
|
|
5122
5122
|
}
|
|
5123
5123
|
let anchorDOM = this.domFromPos(anchor, anchor ? -1 : 1);
|
|
5124
5124
|
let headDOM = head == anchor ? anchorDOM : this.domFromPos(head, head ? -1 : 1);
|
|
@@ -5185,11 +5185,11 @@ class ViewDesc {
|
|
|
5185
5185
|
}
|
|
5186
5186
|
markDirty(from2, to) {
|
|
5187
5187
|
for (let offset2 = 0, i = 0; i < this.children.length; i++) {
|
|
5188
|
-
let child = this.children[i],
|
|
5189
|
-
if (offset2 ==
|
|
5190
|
-
let startInside = offset2 + child.border, endInside =
|
|
5188
|
+
let child = this.children[i], end = offset2 + child.size;
|
|
5189
|
+
if (offset2 == end ? from2 <= end && to >= offset2 : from2 < end && to > offset2) {
|
|
5190
|
+
let startInside = offset2 + child.border, endInside = end - child.border;
|
|
5191
5191
|
if (from2 >= startInside && to <= endInside) {
|
|
5192
|
-
this.dirty = from2 == offset2 || to ==
|
|
5192
|
+
this.dirty = from2 == offset2 || to == end ? CONTENT_DIRTY : CHILD_DIRTY;
|
|
5193
5193
|
if (from2 == startInside && to == endInside && (child.contentLost || child.dom.parentNode != this.contentDOM))
|
|
5194
5194
|
child.dirty = NODE_DIRTY;
|
|
5195
5195
|
else
|
|
@@ -5199,7 +5199,7 @@ class ViewDesc {
|
|
|
5199
5199
|
child.dirty = child.dom == child.contentDOM && child.dom.parentNode == this.contentDOM && !child.children.length ? CONTENT_DIRTY : NODE_DIRTY;
|
|
5200
5200
|
}
|
|
5201
5201
|
}
|
|
5202
|
-
offset2 =
|
|
5202
|
+
offset2 = end;
|
|
5203
5203
|
}
|
|
5204
5204
|
this.dirty = CONTENT_DIRTY;
|
|
5205
5205
|
}
|
|
@@ -5667,25 +5667,25 @@ const noDeco = [new OuterDecoLevel()];
|
|
|
5667
5667
|
function computeOuterDeco(outerDeco, node, needsWrap) {
|
|
5668
5668
|
if (outerDeco.length == 0)
|
|
5669
5669
|
return noDeco;
|
|
5670
|
-
let
|
|
5670
|
+
let top = needsWrap ? noDeco[0] : new OuterDecoLevel(), result = [top];
|
|
5671
5671
|
for (let i = 0; i < outerDeco.length; i++) {
|
|
5672
5672
|
let attrs = outerDeco[i].type.attrs;
|
|
5673
5673
|
if (!attrs)
|
|
5674
5674
|
continue;
|
|
5675
5675
|
if (attrs.nodeName)
|
|
5676
|
-
result.push(
|
|
5676
|
+
result.push(top = new OuterDecoLevel(attrs.nodeName));
|
|
5677
5677
|
for (let name in attrs) {
|
|
5678
5678
|
let val = attrs[name];
|
|
5679
5679
|
if (val == null)
|
|
5680
5680
|
continue;
|
|
5681
5681
|
if (needsWrap && result.length == 1)
|
|
5682
|
-
result.push(
|
|
5682
|
+
result.push(top = new OuterDecoLevel(node.isInline ? "span" : "div"));
|
|
5683
5683
|
if (name == "class")
|
|
5684
|
-
|
|
5684
|
+
top.class = (top.class ? top.class + " " : "") + val;
|
|
5685
5685
|
else if (name == "style")
|
|
5686
|
-
|
|
5686
|
+
top.style = (top.style ? top.style + ";" : "") + val;
|
|
5687
5687
|
else if (name != "nodeName")
|
|
5688
|
-
|
|
5688
|
+
top[name] = val;
|
|
5689
5689
|
}
|
|
5690
5690
|
}
|
|
5691
5691
|
return result;
|
|
@@ -5758,20 +5758,20 @@ function rm(dom) {
|
|
|
5758
5758
|
return next2;
|
|
5759
5759
|
}
|
|
5760
5760
|
class ViewTreeUpdater {
|
|
5761
|
-
constructor(
|
|
5761
|
+
constructor(top, lock) {
|
|
5762
5762
|
this.lock = lock;
|
|
5763
5763
|
this.index = 0;
|
|
5764
5764
|
this.stack = [];
|
|
5765
5765
|
this.changed = false;
|
|
5766
|
-
this.top =
|
|
5767
|
-
this.preMatch = preMatch(
|
|
5766
|
+
this.top = top;
|
|
5767
|
+
this.preMatch = preMatch(top.node.content, top);
|
|
5768
5768
|
}
|
|
5769
|
-
destroyBetween(
|
|
5770
|
-
if (
|
|
5769
|
+
destroyBetween(start, end) {
|
|
5770
|
+
if (start == end)
|
|
5771
5771
|
return;
|
|
5772
|
-
for (let i =
|
|
5772
|
+
for (let i = start; i < end; i++)
|
|
5773
5773
|
this.top.children[i].destroy();
|
|
5774
|
-
this.top.children.splice(
|
|
5774
|
+
this.top.children.splice(start, end - start);
|
|
5775
5775
|
this.changed = true;
|
|
5776
5776
|
}
|
|
5777
5777
|
destroyRest() {
|
|
@@ -6005,24 +6005,24 @@ function iterDeco(parent, deco, onWidget, onNode) {
|
|
|
6005
6005
|
active.splice(i--, 1);
|
|
6006
6006
|
while (decoIndex < locals.length && locals[decoIndex].from <= offset2 && locals[decoIndex].to > offset2)
|
|
6007
6007
|
active.push(locals[decoIndex++]);
|
|
6008
|
-
let
|
|
6008
|
+
let end = offset2 + child.nodeSize;
|
|
6009
6009
|
if (child.isText) {
|
|
6010
|
-
let cutAt =
|
|
6010
|
+
let cutAt = end;
|
|
6011
6011
|
if (decoIndex < locals.length && locals[decoIndex].from < cutAt)
|
|
6012
6012
|
cutAt = locals[decoIndex].from;
|
|
6013
6013
|
for (let i = 0; i < active.length; i++)
|
|
6014
6014
|
if (active[i].to < cutAt)
|
|
6015
6015
|
cutAt = active[i].to;
|
|
6016
|
-
if (cutAt <
|
|
6016
|
+
if (cutAt < end) {
|
|
6017
6017
|
restNode = child.cut(cutAt - offset2);
|
|
6018
6018
|
child = child.cut(0, cutAt - offset2);
|
|
6019
|
-
|
|
6019
|
+
end = cutAt;
|
|
6020
6020
|
index = -1;
|
|
6021
6021
|
}
|
|
6022
6022
|
}
|
|
6023
6023
|
let outerDeco = child.isInline && !child.isLeaf ? active.filter((d) => !d.inline) : active.slice();
|
|
6024
6024
|
onNode(child, outerDeco, deco.forChild(offset2, child), index);
|
|
6025
|
-
offset2 =
|
|
6025
|
+
offset2 = end;
|
|
6026
6026
|
}
|
|
6027
6027
|
}
|
|
6028
6028
|
function iosHacks(dom) {
|
|
@@ -6077,18 +6077,18 @@ function findTextInFragment(frag, text2, from2, to) {
|
|
|
6077
6077
|
function replaceNodes(nodes, from2, to, view, replacement2) {
|
|
6078
6078
|
let result = [];
|
|
6079
6079
|
for (let i = 0, off = 0; i < nodes.length; i++) {
|
|
6080
|
-
let child = nodes[i],
|
|
6081
|
-
if (
|
|
6080
|
+
let child = nodes[i], start = off, end = off += child.size;
|
|
6081
|
+
if (start >= to || end <= from2) {
|
|
6082
6082
|
result.push(child);
|
|
6083
6083
|
} else {
|
|
6084
|
-
if (
|
|
6085
|
-
result.push(child.slice(0, from2 -
|
|
6084
|
+
if (start < from2)
|
|
6085
|
+
result.push(child.slice(0, from2 - start, view));
|
|
6086
6086
|
if (replacement2) {
|
|
6087
6087
|
result.push(replacement2);
|
|
6088
6088
|
replacement2 = void 0;
|
|
6089
6089
|
}
|
|
6090
|
-
if (
|
|
6091
|
-
result.push(child.slice(to -
|
|
6090
|
+
if (end > to)
|
|
6091
|
+
result.push(child.slice(to - start, child.size, view));
|
|
6092
6092
|
}
|
|
6093
6093
|
}
|
|
6094
6094
|
return result;
|
|
@@ -7308,21 +7308,21 @@ editHandlers.drop = (view, _event) => {
|
|
|
7308
7308
|
if (move)
|
|
7309
7309
|
tr.deleteSelection();
|
|
7310
7310
|
let pos = tr.mapping.map(insertPos);
|
|
7311
|
-
let
|
|
7311
|
+
let isNode2 = slice2.openStart == 0 && slice2.openEnd == 0 && slice2.content.childCount == 1;
|
|
7312
7312
|
let beforeInsert = tr.doc;
|
|
7313
|
-
if (
|
|
7313
|
+
if (isNode2)
|
|
7314
7314
|
tr.replaceRangeWith(pos, pos, slice2.content.firstChild);
|
|
7315
7315
|
else
|
|
7316
7316
|
tr.replaceRange(pos, pos, slice2);
|
|
7317
7317
|
if (tr.doc.eq(beforeInsert))
|
|
7318
7318
|
return;
|
|
7319
7319
|
let $pos = tr.doc.resolve(pos);
|
|
7320
|
-
if (
|
|
7320
|
+
if (isNode2 && NodeSelection.isSelectable(slice2.content.firstChild) && $pos.nodeAfter && $pos.nodeAfter.sameMarkup(slice2.content.firstChild)) {
|
|
7321
7321
|
tr.setSelection(new NodeSelection($pos));
|
|
7322
7322
|
} else {
|
|
7323
|
-
let
|
|
7324
|
-
tr.mapping.maps[tr.mapping.maps.length - 1].forEach((_from, _to, _newFrom, newTo) =>
|
|
7325
|
-
tr.setSelection(selectionBetween(view, $pos, tr.doc.resolve(
|
|
7323
|
+
let end = tr.mapping.map(insertPos);
|
|
7324
|
+
tr.mapping.maps[tr.mapping.maps.length - 1].forEach((_from, _to, _newFrom, newTo) => end = newTo);
|
|
7325
|
+
tr.setSelection(selectionBetween(view, $pos, tr.doc.resolve(end)));
|
|
7326
7326
|
}
|
|
7327
7327
|
view.focus();
|
|
7328
7328
|
view.dispatch(tr.setMeta("uiEvent", "drop"));
|
|
@@ -7488,21 +7488,21 @@ class DecorationSet {
|
|
|
7488
7488
|
static create(doc2, decorations) {
|
|
7489
7489
|
return decorations.length ? buildTree(decorations, doc2, 0, noSpec) : empty$1;
|
|
7490
7490
|
}
|
|
7491
|
-
find(
|
|
7491
|
+
find(start, end, predicate) {
|
|
7492
7492
|
let result = [];
|
|
7493
|
-
this.findInner(
|
|
7493
|
+
this.findInner(start == null ? 0 : start, end == null ? 1e9 : end, result, 0, predicate);
|
|
7494
7494
|
return result;
|
|
7495
7495
|
}
|
|
7496
|
-
findInner(
|
|
7496
|
+
findInner(start, end, result, offset2, predicate) {
|
|
7497
7497
|
for (let i = 0; i < this.local.length; i++) {
|
|
7498
7498
|
let span = this.local[i];
|
|
7499
|
-
if (span.from <=
|
|
7499
|
+
if (span.from <= end && span.to >= start && (!predicate || predicate(span.spec)))
|
|
7500
7500
|
result.push(span.copy(span.from + offset2, span.to + offset2));
|
|
7501
7501
|
}
|
|
7502
7502
|
for (let i = 0; i < this.children.length; i += 3) {
|
|
7503
|
-
if (this.children[i] <
|
|
7503
|
+
if (this.children[i] < end && this.children[i + 1] > start) {
|
|
7504
7504
|
let childOff = this.children[i] + 1;
|
|
7505
|
-
this.children[i + 2].findInner(
|
|
7505
|
+
this.children[i + 2].findInner(start - childOff, end - childOff, result, offset2 + childOff, predicate);
|
|
7506
7506
|
}
|
|
7507
7507
|
}
|
|
7508
7508
|
}
|
|
@@ -7610,11 +7610,11 @@ class DecorationSet {
|
|
|
7610
7610
|
child = this.children[i + 2];
|
|
7611
7611
|
break;
|
|
7612
7612
|
}
|
|
7613
|
-
let
|
|
7613
|
+
let start = offset2 + 1, end = start + node.content.size;
|
|
7614
7614
|
for (let i = 0; i < this.local.length; i++) {
|
|
7615
7615
|
let dec = this.local[i];
|
|
7616
|
-
if (dec.from <
|
|
7617
|
-
let from2 = Math.max(
|
|
7616
|
+
if (dec.from < end && dec.to > start && dec.type instanceof InlineType) {
|
|
7617
|
+
let from2 = Math.max(start, dec.from) - start, to = Math.min(end, dec.to) - start;
|
|
7618
7618
|
if (from2 < to)
|
|
7619
7619
|
(local || (local = [])).push(dec.copy(from2, to));
|
|
7620
7620
|
}
|
|
@@ -7722,12 +7722,12 @@ function mapChildren(oldChildren, newLocal, mapping, node, offset2, oldOffset, o
|
|
|
7722
7722
|
let children = oldChildren.slice();
|
|
7723
7723
|
let shift2 = (oldStart, oldEnd, newStart, newEnd) => {
|
|
7724
7724
|
for (let i = 0; i < children.length; i += 3) {
|
|
7725
|
-
let
|
|
7726
|
-
if (
|
|
7725
|
+
let end = children[i + 1], dSize;
|
|
7726
|
+
if (end < 0 || oldStart > end + oldOffset)
|
|
7727
7727
|
continue;
|
|
7728
|
-
let
|
|
7729
|
-
if (oldEnd >=
|
|
7730
|
-
children[i + 1] = oldStart <=
|
|
7728
|
+
let start = children[i] + oldOffset;
|
|
7729
|
+
if (oldEnd >= start) {
|
|
7730
|
+
children[i + 1] = oldStart <= start ? -2 : -1;
|
|
7731
7731
|
} else if (newStart >= offset2 && (dSize = newEnd - newStart - (oldEnd - oldStart))) {
|
|
7732
7732
|
children[i] += dSize;
|
|
7733
7733
|
children[i + 1] += dSize;
|
|
@@ -7814,9 +7814,9 @@ function mapAndGatherRemainingDecorations(children, oldChildren, decorations, ma
|
|
|
7814
7814
|
function takeSpansForNode(spans, node, offset2) {
|
|
7815
7815
|
if (node.isLeaf)
|
|
7816
7816
|
return null;
|
|
7817
|
-
let
|
|
7817
|
+
let end = offset2 + node.nodeSize, found2 = null;
|
|
7818
7818
|
for (let i = 0, span; i < spans.length; i++) {
|
|
7819
|
-
if ((span = spans[i]) && span.from > offset2 && span.to <
|
|
7819
|
+
if ((span = spans[i]) && span.from > offset2 && span.to < end) {
|
|
7820
7820
|
(found2 || (found2 = [])).push(span);
|
|
7821
7821
|
spans[i] = null;
|
|
7822
7822
|
}
|
|
@@ -8331,54 +8331,54 @@ function isMarkChange(cur, prev) {
|
|
|
8331
8331
|
if (Fragment.from(updated).eq(cur))
|
|
8332
8332
|
return { mark, type };
|
|
8333
8333
|
}
|
|
8334
|
-
function looksLikeJoin(old,
|
|
8335
|
-
if (!$newStart.parent.isTextblock ||
|
|
8334
|
+
function looksLikeJoin(old, start, end, $newStart, $newEnd) {
|
|
8335
|
+
if (!$newStart.parent.isTextblock || end - start <= $newEnd.pos - $newStart.pos || skipClosingAndOpening($newStart, true, false) < $newEnd.pos)
|
|
8336
8336
|
return false;
|
|
8337
|
-
let $start = old.resolve(
|
|
8337
|
+
let $start = old.resolve(start);
|
|
8338
8338
|
if ($start.parentOffset < $start.parent.content.size || !$start.parent.isTextblock)
|
|
8339
8339
|
return false;
|
|
8340
8340
|
let $next = old.resolve(skipClosingAndOpening($start, true, true));
|
|
8341
|
-
if (!$next.parent.isTextblock || $next.pos >
|
|
8341
|
+
if (!$next.parent.isTextblock || $next.pos > end || skipClosingAndOpening($next, true, false) < end)
|
|
8342
8342
|
return false;
|
|
8343
8343
|
return $newStart.parent.content.cut($newStart.parentOffset).eq($next.parent.content);
|
|
8344
8344
|
}
|
|
8345
8345
|
function skipClosingAndOpening($pos, fromEnd, mayOpen) {
|
|
8346
|
-
let depth = $pos.depth,
|
|
8346
|
+
let depth = $pos.depth, end = fromEnd ? $pos.end() : $pos.pos;
|
|
8347
8347
|
while (depth > 0 && (fromEnd || $pos.indexAfter(depth) == $pos.node(depth).childCount)) {
|
|
8348
8348
|
depth--;
|
|
8349
|
-
|
|
8349
|
+
end++;
|
|
8350
8350
|
fromEnd = false;
|
|
8351
8351
|
}
|
|
8352
8352
|
if (mayOpen) {
|
|
8353
8353
|
let next2 = $pos.node(depth).maybeChild($pos.indexAfter(depth));
|
|
8354
8354
|
while (next2 && !next2.isLeaf) {
|
|
8355
8355
|
next2 = next2.firstChild;
|
|
8356
|
-
|
|
8356
|
+
end++;
|
|
8357
8357
|
}
|
|
8358
8358
|
}
|
|
8359
|
-
return
|
|
8359
|
+
return end;
|
|
8360
8360
|
}
|
|
8361
8361
|
function findDiff(a, b, pos, preferredPos, preferredSide) {
|
|
8362
|
-
let
|
|
8363
|
-
if (
|
|
8362
|
+
let start = a.findDiffStart(b, pos);
|
|
8363
|
+
if (start == null)
|
|
8364
8364
|
return null;
|
|
8365
8365
|
let { a: endA, b: endB } = a.findDiffEnd(b, pos + a.size, pos + b.size);
|
|
8366
8366
|
if (preferredSide == "end") {
|
|
8367
|
-
let adjust = Math.max(0,
|
|
8368
|
-
preferredPos -= endA + adjust -
|
|
8369
|
-
}
|
|
8370
|
-
if (endA <
|
|
8371
|
-
let move = preferredPos <=
|
|
8372
|
-
|
|
8373
|
-
endB =
|
|
8374
|
-
endA =
|
|
8375
|
-
} else if (endB <
|
|
8376
|
-
let move = preferredPos <=
|
|
8377
|
-
|
|
8378
|
-
endA =
|
|
8379
|
-
endB =
|
|
8380
|
-
}
|
|
8381
|
-
return { start
|
|
8367
|
+
let adjust = Math.max(0, start - Math.min(endA, endB));
|
|
8368
|
+
preferredPos -= endA + adjust - start;
|
|
8369
|
+
}
|
|
8370
|
+
if (endA < start && a.size < b.size) {
|
|
8371
|
+
let move = preferredPos <= start && preferredPos >= endA ? start - preferredPos : 0;
|
|
8372
|
+
start -= move;
|
|
8373
|
+
endB = start + (endB - endA);
|
|
8374
|
+
endA = start;
|
|
8375
|
+
} else if (endB < start) {
|
|
8376
|
+
let move = preferredPos <= start && preferredPos >= endB ? start - preferredPos : 0;
|
|
8377
|
+
start -= move;
|
|
8378
|
+
endA = start + (endA - endB);
|
|
8379
|
+
endB = start;
|
|
8380
|
+
}
|
|
8381
|
+
return { start, endA, endB };
|
|
8382
8382
|
}
|
|
8383
8383
|
class EditorView {
|
|
8384
8384
|
constructor(place, props) {
|
|
@@ -8752,7 +8752,7 @@ var base = {
|
|
|
8752
8752
|
222: "'",
|
|
8753
8753
|
229: "q"
|
|
8754
8754
|
};
|
|
8755
|
-
var shift = {
|
|
8755
|
+
var shift$1 = {
|
|
8756
8756
|
48: ")",
|
|
8757
8757
|
49: "!",
|
|
8758
8758
|
50: "@",
|
|
@@ -8791,14 +8791,14 @@ for (var i = 1; i <= 24; i++)
|
|
|
8791
8791
|
base[i + 111] = "F" + i;
|
|
8792
8792
|
for (var i = 65; i <= 90; i++) {
|
|
8793
8793
|
base[i] = String.fromCharCode(i + 32);
|
|
8794
|
-
shift[i] = String.fromCharCode(i);
|
|
8794
|
+
shift$1[i] = String.fromCharCode(i);
|
|
8795
8795
|
}
|
|
8796
8796
|
for (var code in base)
|
|
8797
|
-
if (!shift.hasOwnProperty(code))
|
|
8798
|
-
shift[code] = base[code];
|
|
8797
|
+
if (!shift$1.hasOwnProperty(code))
|
|
8798
|
+
shift$1[code] = base[code];
|
|
8799
8799
|
function keyName(event) {
|
|
8800
8800
|
var ignoreKey = brokenModifierNames && (event.ctrlKey || event.altKey || event.metaKey) || (safari || ie) && event.shiftKey && event.key && event.key.length == 1;
|
|
8801
|
-
var name = !ignoreKey && event.key || (event.shiftKey ? shift : base)[event.keyCode] || event.key || "Unidentified";
|
|
8801
|
+
var name = !ignoreKey && event.key || (event.shiftKey ? shift$1 : base)[event.keyCode] || event.key || "Unidentified";
|
|
8802
8802
|
if (name == "Esc")
|
|
8803
8803
|
name = "Escape";
|
|
8804
8804
|
if (name == "Del")
|
|
@@ -9124,12 +9124,12 @@ function deleteBarrier(state, $cut, dispatch) {
|
|
|
9124
9124
|
let canDelAfter = $cut.parent.canReplace($cut.index(), $cut.index() + 1);
|
|
9125
9125
|
if (canDelAfter && (conn = (match2 = before.contentMatchAt(before.childCount)).findWrapping(after.type)) && match2.matchType(conn[0] || after.type).validEnd) {
|
|
9126
9126
|
if (dispatch) {
|
|
9127
|
-
let
|
|
9127
|
+
let end = $cut.pos + after.nodeSize, wrap2 = Fragment.empty;
|
|
9128
9128
|
for (let i = conn.length - 1; i >= 0; i--)
|
|
9129
9129
|
wrap2 = Fragment.from(conn[i].create(null, wrap2));
|
|
9130
9130
|
wrap2 = Fragment.from(before.copy(wrap2));
|
|
9131
|
-
let tr = state.tr.step(new ReplaceAroundStep($cut.pos - 1,
|
|
9132
|
-
let joinAt =
|
|
9131
|
+
let tr = state.tr.step(new ReplaceAroundStep($cut.pos - 1, end, $cut.pos, end, new Slice(wrap2, 1, 0), conn.length, true));
|
|
9132
|
+
let joinAt = end + 2 * conn.length;
|
|
9133
9133
|
if (canJoin(tr.doc, joinAt))
|
|
9134
9134
|
tr.join(joinAt);
|
|
9135
9135
|
dispatch(tr.scrollIntoView());
|
|
@@ -9156,10 +9156,10 @@ function deleteBarrier(state, $cut, dispatch) {
|
|
|
9156
9156
|
afterDepth++;
|
|
9157
9157
|
if (at.canReplace(at.childCount, at.childCount, afterText.content)) {
|
|
9158
9158
|
if (dispatch) {
|
|
9159
|
-
let
|
|
9159
|
+
let end = Fragment.empty;
|
|
9160
9160
|
for (let i = wrap2.length - 1; i >= 0; i--)
|
|
9161
|
-
|
|
9162
|
-
let tr = state.tr.step(new ReplaceAroundStep($cut.pos - wrap2.length, $cut.pos + after.nodeSize, $cut.pos + afterDepth, $cut.pos + after.nodeSize - afterDepth, new Slice(
|
|
9161
|
+
end = Fragment.from(wrap2[i].copy(end));
|
|
9162
|
+
let tr = state.tr.step(new ReplaceAroundStep($cut.pos - wrap2.length, $cut.pos + after.nodeSize, $cut.pos + afterDepth, $cut.pos + after.nodeSize - afterDepth, new Slice(end, wrap2.length, 0), 0, true));
|
|
9163
9163
|
dispatch(tr.scrollIntoView());
|
|
9164
9164
|
}
|
|
9165
9165
|
return true;
|
|
@@ -9278,9 +9278,9 @@ function liftListItem$1(itemType) {
|
|
|
9278
9278
|
};
|
|
9279
9279
|
}
|
|
9280
9280
|
function liftToOuterList(state, dispatch, itemType, range) {
|
|
9281
|
-
let tr = state.tr,
|
|
9282
|
-
if (
|
|
9283
|
-
tr.step(new ReplaceAroundStep(
|
|
9281
|
+
let tr = state.tr, end = range.end, endOfList = range.$to.end(range.depth);
|
|
9282
|
+
if (end < endOfList) {
|
|
9283
|
+
tr.step(new ReplaceAroundStep(end - 1, endOfList, end, endOfList, new Slice(Fragment.from(itemType.create(null, range.parent.copy())), 1, 0), 1, true));
|
|
9284
9284
|
range = new NodeRange(tr.doc.resolve(range.$from.pos), tr.doc.resolve(endOfList), range.depth);
|
|
9285
9285
|
}
|
|
9286
9286
|
dispatch(tr.lift(range, liftTarget(range)).scrollIntoView());
|
|
@@ -9299,8 +9299,8 @@ function liftOutOfList(state, dispatch, range) {
|
|
|
9299
9299
|
let parent = $start.node(-1), indexBefore = $start.index(-1);
|
|
9300
9300
|
if (!parent.canReplace(indexBefore + (atStart ? 0 : 1), indexBefore + 1, item.content.append(atEnd ? Fragment.empty : Fragment.from(list))))
|
|
9301
9301
|
return false;
|
|
9302
|
-
let
|
|
9303
|
-
tr.step(new ReplaceAroundStep(
|
|
9302
|
+
let start = $start.pos, end = start + item.nodeSize;
|
|
9303
|
+
tr.step(new ReplaceAroundStep(start - (atStart ? 1 : 0), end + (atEnd ? 1 : 0), start + 1, end - 1, new Slice((atStart ? Fragment.empty : Fragment.from(list.copy(Fragment.empty))).append(atEnd ? Fragment.empty : Fragment.from(list.copy(Fragment.empty))), atStart ? 0 : 1, atEnd ? 0 : 1), atStart ? 0 : 1));
|
|
9304
9304
|
dispatch(tr.scrollIntoView());
|
|
9305
9305
|
return true;
|
|
9306
9306
|
}
|
|
@@ -9460,11 +9460,11 @@ class EventEmitter {
|
|
|
9460
9460
|
constructor() {
|
|
9461
9461
|
this.callbacks = {};
|
|
9462
9462
|
}
|
|
9463
|
-
on(event,
|
|
9463
|
+
on(event, fn) {
|
|
9464
9464
|
if (!this.callbacks[event]) {
|
|
9465
9465
|
this.callbacks[event] = [];
|
|
9466
9466
|
}
|
|
9467
|
-
this.callbacks[event].push(
|
|
9467
|
+
this.callbacks[event].push(fn);
|
|
9468
9468
|
return this;
|
|
9469
9469
|
}
|
|
9470
9470
|
emit(event, ...args) {
|
|
@@ -9474,11 +9474,11 @@ class EventEmitter {
|
|
|
9474
9474
|
}
|
|
9475
9475
|
return this;
|
|
9476
9476
|
}
|
|
9477
|
-
off(event,
|
|
9477
|
+
off(event, fn) {
|
|
9478
9478
|
const callbacks2 = this.callbacks[event];
|
|
9479
9479
|
if (callbacks2) {
|
|
9480
|
-
if (
|
|
9481
|
-
this.callbacks[event] = callbacks2.filter((callback) => callback !==
|
|
9480
|
+
if (fn) {
|
|
9481
|
+
this.callbacks[event] = callbacks2.filter((callback) => callback !== fn);
|
|
9482
9482
|
} else {
|
|
9483
9483
|
delete this.callbacks[event];
|
|
9484
9484
|
}
|
|
@@ -10006,11 +10006,11 @@ function run$2(config) {
|
|
|
10006
10006
|
if (match2.index === void 0) {
|
|
10007
10007
|
return;
|
|
10008
10008
|
}
|
|
10009
|
-
const
|
|
10010
|
-
const
|
|
10009
|
+
const start = resolvedFrom + match2.index + 1;
|
|
10010
|
+
const end = start + match2[0].length;
|
|
10011
10011
|
const range = {
|
|
10012
|
-
from: state.tr.mapping.map(
|
|
10013
|
-
to: state.tr.mapping.map(
|
|
10012
|
+
from: state.tr.mapping.map(start),
|
|
10013
|
+
to: state.tr.mapping.map(end)
|
|
10014
10014
|
};
|
|
10015
10015
|
const handler = rule.handler({
|
|
10016
10016
|
state,
|
|
@@ -10486,8 +10486,8 @@ const clearNodes = () => ({ state, tr, dispatch }) => {
|
|
|
10486
10486
|
});
|
|
10487
10487
|
return true;
|
|
10488
10488
|
};
|
|
10489
|
-
const command = (
|
|
10490
|
-
return
|
|
10489
|
+
const command = (fn) => (props) => {
|
|
10490
|
+
return fn(props);
|
|
10491
10491
|
};
|
|
10492
10492
|
const createParagraphNear = () => ({ state, dispatch }) => {
|
|
10493
10493
|
return createParagraphNear$1(state, dispatch);
|
|
@@ -10551,22 +10551,22 @@ function getMarkRange($pos, type, attributes = {}) {
|
|
|
10551
10551
|
if (!$pos || !type) {
|
|
10552
10552
|
return;
|
|
10553
10553
|
}
|
|
10554
|
-
let
|
|
10555
|
-
if ($pos.parentOffset ===
|
|
10556
|
-
|
|
10554
|
+
let start = $pos.parent.childAfter($pos.parentOffset);
|
|
10555
|
+
if ($pos.parentOffset === start.offset && start.offset !== 0) {
|
|
10556
|
+
start = $pos.parent.childBefore($pos.parentOffset);
|
|
10557
10557
|
}
|
|
10558
|
-
if (!
|
|
10558
|
+
if (!start.node) {
|
|
10559
10559
|
return;
|
|
10560
10560
|
}
|
|
10561
|
-
const mark = findMarkInSet([...
|
|
10561
|
+
const mark = findMarkInSet([...start.node.marks], type, attributes);
|
|
10562
10562
|
if (!mark) {
|
|
10563
10563
|
return;
|
|
10564
10564
|
}
|
|
10565
|
-
let startIndex2 =
|
|
10566
|
-
let startPos = $pos.start() +
|
|
10565
|
+
let startIndex2 = start.index;
|
|
10566
|
+
let startPos = $pos.start() + start.offset;
|
|
10567
10567
|
let endIndex2 = startIndex2 + 1;
|
|
10568
|
-
let endPos = startPos +
|
|
10569
|
-
findMarkInSet([...
|
|
10568
|
+
let endPos = startPos + start.node.nodeSize;
|
|
10569
|
+
findMarkInSet([...start.node.marks], type, attributes);
|
|
10570
10570
|
while (startIndex2 > 0 && mark.isInSet($pos.parent.child(startIndex2 - 1).marks)) {
|
|
10571
10571
|
startIndex2 -= 1;
|
|
10572
10572
|
startPos -= $pos.parent.child(startIndex2).nodeSize;
|
|
@@ -10684,8 +10684,8 @@ const focus = (position = null, options = {}) => ({ editor, view, tr, dispatch }
|
|
|
10684
10684
|
}
|
|
10685
10685
|
return true;
|
|
10686
10686
|
};
|
|
10687
|
-
const forEach$1 = (items,
|
|
10688
|
-
return items.every((item, index) =>
|
|
10687
|
+
const forEach$1 = (items, fn) => (props) => {
|
|
10688
|
+
return items.every((item, index) => fn(item, { ...props, index }));
|
|
10689
10689
|
};
|
|
10690
10690
|
const insertContent = (value, options) => ({ tr, commands: commands2 }) => {
|
|
10691
10691
|
return commands2.insertContentAt({ from: tr.selection.from, to: tr.selection.to }, value, options);
|
|
@@ -10727,13 +10727,13 @@ function selectionToInsertionEnd(tr, startLen, bias) {
|
|
|
10727
10727
|
return;
|
|
10728
10728
|
}
|
|
10729
10729
|
const map2 = tr.mapping.maps[last];
|
|
10730
|
-
let
|
|
10730
|
+
let end = 0;
|
|
10731
10731
|
map2.forEach((_from, _to, _newFrom, newTo) => {
|
|
10732
|
-
if (
|
|
10733
|
-
|
|
10732
|
+
if (end === 0) {
|
|
10733
|
+
end = newTo;
|
|
10734
10734
|
}
|
|
10735
10735
|
});
|
|
10736
|
-
tr.setSelection(Selection.near(tr.doc.resolve(
|
|
10736
|
+
tr.setSelection(Selection.near(tr.doc.resolve(end), bias));
|
|
10737
10737
|
}
|
|
10738
10738
|
const isFragment = (nodeOrFragment) => {
|
|
10739
10739
|
return nodeOrFragment.toString().startsWith("<");
|
|
@@ -11204,10 +11204,10 @@ const splitListItem = (typeOrName) => ({ tr, state, dispatch, editor }) => {
|
|
|
11204
11204
|
const newNextTypeAttributes2 = getSplittedAttributes(extensionAttributes, $from.node().type.name, $from.node().attrs);
|
|
11205
11205
|
const nextType2 = ((_a = type.contentMatch.defaultType) === null || _a === void 0 ? void 0 : _a.createAndFill(newNextTypeAttributes2)) || void 0;
|
|
11206
11206
|
wrap2 = wrap2.append(Fragment.from(type.createAndFill(null, nextType2) || void 0));
|
|
11207
|
-
const
|
|
11208
|
-
tr.replace(
|
|
11207
|
+
const start = $from.before($from.depth - (depthBefore - 1));
|
|
11208
|
+
tr.replace(start, $from.after(-depthAfter), new Slice(wrap2, 4 - depthBefore, 0));
|
|
11209
11209
|
let sel = -1;
|
|
11210
|
-
tr.doc.nodesBetween(
|
|
11210
|
+
tr.doc.nodesBetween(start, tr.doc.content.size, (n, pos) => {
|
|
11211
11211
|
if (sel > -1) {
|
|
11212
11212
|
return false;
|
|
11213
11213
|
}
|
|
@@ -12028,9 +12028,9 @@ class Editor$1 extends EventEmitter {
|
|
|
12028
12028
|
nodeViews: this.extensionManager.nodeViews
|
|
12029
12029
|
});
|
|
12030
12030
|
}
|
|
12031
|
-
captureTransaction(
|
|
12031
|
+
captureTransaction(fn) {
|
|
12032
12032
|
this.isCapturingTransaction = true;
|
|
12033
|
-
|
|
12033
|
+
fn();
|
|
12034
12034
|
this.isCapturingTransaction = false;
|
|
12035
12035
|
const tr = this.capturedTransaction;
|
|
12036
12036
|
this.capturedTransaction = null;
|
|
@@ -12436,1463 +12436,6 @@ function markPasteRule(config) {
|
|
|
12436
12436
|
}
|
|
12437
12437
|
});
|
|
12438
12438
|
}
|
|
12439
|
-
var top = "top";
|
|
12440
|
-
var bottom = "bottom";
|
|
12441
|
-
var right = "right";
|
|
12442
|
-
var left = "left";
|
|
12443
|
-
var auto = "auto";
|
|
12444
|
-
var basePlacements = [top, bottom, right, left];
|
|
12445
|
-
var start = "start";
|
|
12446
|
-
var end = "end";
|
|
12447
|
-
var clippingParents = "clippingParents";
|
|
12448
|
-
var viewport = "viewport";
|
|
12449
|
-
var popper = "popper";
|
|
12450
|
-
var reference = "reference";
|
|
12451
|
-
var variationPlacements = /* @__PURE__ */ basePlacements.reduce(function(acc, placement) {
|
|
12452
|
-
return acc.concat([placement + "-" + start, placement + "-" + end]);
|
|
12453
|
-
}, []);
|
|
12454
|
-
var placements = /* @__PURE__ */ [].concat(basePlacements, [auto]).reduce(function(acc, placement) {
|
|
12455
|
-
return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
|
|
12456
|
-
}, []);
|
|
12457
|
-
var beforeRead = "beforeRead";
|
|
12458
|
-
var read = "read";
|
|
12459
|
-
var afterRead = "afterRead";
|
|
12460
|
-
var beforeMain = "beforeMain";
|
|
12461
|
-
var main = "main";
|
|
12462
|
-
var afterMain = "afterMain";
|
|
12463
|
-
var beforeWrite = "beforeWrite";
|
|
12464
|
-
var write = "write";
|
|
12465
|
-
var afterWrite = "afterWrite";
|
|
12466
|
-
var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
|
|
12467
|
-
function getNodeName(element) {
|
|
12468
|
-
return element ? (element.nodeName || "").toLowerCase() : null;
|
|
12469
|
-
}
|
|
12470
|
-
function getWindow(node) {
|
|
12471
|
-
if (node == null) {
|
|
12472
|
-
return window;
|
|
12473
|
-
}
|
|
12474
|
-
if (node.toString() !== "[object Window]") {
|
|
12475
|
-
var ownerDocument = node.ownerDocument;
|
|
12476
|
-
return ownerDocument ? ownerDocument.defaultView || window : window;
|
|
12477
|
-
}
|
|
12478
|
-
return node;
|
|
12479
|
-
}
|
|
12480
|
-
function isElement$1(node) {
|
|
12481
|
-
var OwnElement = getWindow(node).Element;
|
|
12482
|
-
return node instanceof OwnElement || node instanceof Element;
|
|
12483
|
-
}
|
|
12484
|
-
function isHTMLElement(node) {
|
|
12485
|
-
var OwnElement = getWindow(node).HTMLElement;
|
|
12486
|
-
return node instanceof OwnElement || node instanceof HTMLElement;
|
|
12487
|
-
}
|
|
12488
|
-
function isShadowRoot(node) {
|
|
12489
|
-
if (typeof ShadowRoot === "undefined") {
|
|
12490
|
-
return false;
|
|
12491
|
-
}
|
|
12492
|
-
var OwnElement = getWindow(node).ShadowRoot;
|
|
12493
|
-
return node instanceof OwnElement || node instanceof ShadowRoot;
|
|
12494
|
-
}
|
|
12495
|
-
function applyStyles(_ref) {
|
|
12496
|
-
var state = _ref.state;
|
|
12497
|
-
Object.keys(state.elements).forEach(function(name) {
|
|
12498
|
-
var style2 = state.styles[name] || {};
|
|
12499
|
-
var attributes = state.attributes[name] || {};
|
|
12500
|
-
var element = state.elements[name];
|
|
12501
|
-
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
12502
|
-
return;
|
|
12503
|
-
}
|
|
12504
|
-
Object.assign(element.style, style2);
|
|
12505
|
-
Object.keys(attributes).forEach(function(name2) {
|
|
12506
|
-
var value = attributes[name2];
|
|
12507
|
-
if (value === false) {
|
|
12508
|
-
element.removeAttribute(name2);
|
|
12509
|
-
} else {
|
|
12510
|
-
element.setAttribute(name2, value === true ? "" : value);
|
|
12511
|
-
}
|
|
12512
|
-
});
|
|
12513
|
-
});
|
|
12514
|
-
}
|
|
12515
|
-
function effect$2(_ref2) {
|
|
12516
|
-
var state = _ref2.state;
|
|
12517
|
-
var initialStyles = {
|
|
12518
|
-
popper: {
|
|
12519
|
-
position: state.options.strategy,
|
|
12520
|
-
left: "0",
|
|
12521
|
-
top: "0",
|
|
12522
|
-
margin: "0"
|
|
12523
|
-
},
|
|
12524
|
-
arrow: {
|
|
12525
|
-
position: "absolute"
|
|
12526
|
-
},
|
|
12527
|
-
reference: {}
|
|
12528
|
-
};
|
|
12529
|
-
Object.assign(state.elements.popper.style, initialStyles.popper);
|
|
12530
|
-
state.styles = initialStyles;
|
|
12531
|
-
if (state.elements.arrow) {
|
|
12532
|
-
Object.assign(state.elements.arrow.style, initialStyles.arrow);
|
|
12533
|
-
}
|
|
12534
|
-
return function() {
|
|
12535
|
-
Object.keys(state.elements).forEach(function(name) {
|
|
12536
|
-
var element = state.elements[name];
|
|
12537
|
-
var attributes = state.attributes[name] || {};
|
|
12538
|
-
var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]);
|
|
12539
|
-
var style2 = styleProperties.reduce(function(style3, property) {
|
|
12540
|
-
style3[property] = "";
|
|
12541
|
-
return style3;
|
|
12542
|
-
}, {});
|
|
12543
|
-
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
12544
|
-
return;
|
|
12545
|
-
}
|
|
12546
|
-
Object.assign(element.style, style2);
|
|
12547
|
-
Object.keys(attributes).forEach(function(attribute) {
|
|
12548
|
-
element.removeAttribute(attribute);
|
|
12549
|
-
});
|
|
12550
|
-
});
|
|
12551
|
-
};
|
|
12552
|
-
}
|
|
12553
|
-
const applyStyles$1 = {
|
|
12554
|
-
name: "applyStyles",
|
|
12555
|
-
enabled: true,
|
|
12556
|
-
phase: "write",
|
|
12557
|
-
fn: applyStyles,
|
|
12558
|
-
effect: effect$2,
|
|
12559
|
-
requires: ["computeStyles"]
|
|
12560
|
-
};
|
|
12561
|
-
function getBasePlacement(placement) {
|
|
12562
|
-
return placement.split("-")[0];
|
|
12563
|
-
}
|
|
12564
|
-
var max$3 = Math.max;
|
|
12565
|
-
var min$3 = Math.min;
|
|
12566
|
-
var round = Math.round;
|
|
12567
|
-
function getUAString() {
|
|
12568
|
-
var uaData = navigator.userAgentData;
|
|
12569
|
-
if (uaData != null && uaData.brands) {
|
|
12570
|
-
return uaData.brands.map(function(item) {
|
|
12571
|
-
return item.brand + "/" + item.version;
|
|
12572
|
-
}).join(" ");
|
|
12573
|
-
}
|
|
12574
|
-
return navigator.userAgent;
|
|
12575
|
-
}
|
|
12576
|
-
function isLayoutViewport() {
|
|
12577
|
-
return !/^((?!chrome|android).)*safari/i.test(getUAString());
|
|
12578
|
-
}
|
|
12579
|
-
function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
|
12580
|
-
if (includeScale === void 0) {
|
|
12581
|
-
includeScale = false;
|
|
12582
|
-
}
|
|
12583
|
-
if (isFixedStrategy === void 0) {
|
|
12584
|
-
isFixedStrategy = false;
|
|
12585
|
-
}
|
|
12586
|
-
var clientRect2 = element.getBoundingClientRect();
|
|
12587
|
-
var scaleX = 1;
|
|
12588
|
-
var scaleY = 1;
|
|
12589
|
-
if (includeScale && isHTMLElement(element)) {
|
|
12590
|
-
scaleX = element.offsetWidth > 0 ? round(clientRect2.width) / element.offsetWidth || 1 : 1;
|
|
12591
|
-
scaleY = element.offsetHeight > 0 ? round(clientRect2.height) / element.offsetHeight || 1 : 1;
|
|
12592
|
-
}
|
|
12593
|
-
var _ref = isElement$1(element) ? getWindow(element) : window, visualViewport = _ref.visualViewport;
|
|
12594
|
-
var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
|
|
12595
|
-
var x = (clientRect2.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
|
|
12596
|
-
var y = (clientRect2.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
|
|
12597
|
-
var width = clientRect2.width / scaleX;
|
|
12598
|
-
var height = clientRect2.height / scaleY;
|
|
12599
|
-
return {
|
|
12600
|
-
width,
|
|
12601
|
-
height,
|
|
12602
|
-
top: y,
|
|
12603
|
-
right: x + width,
|
|
12604
|
-
bottom: y + height,
|
|
12605
|
-
left: x,
|
|
12606
|
-
x,
|
|
12607
|
-
y
|
|
12608
|
-
};
|
|
12609
|
-
}
|
|
12610
|
-
function getLayoutRect(element) {
|
|
12611
|
-
var clientRect2 = getBoundingClientRect(element);
|
|
12612
|
-
var width = element.offsetWidth;
|
|
12613
|
-
var height = element.offsetHeight;
|
|
12614
|
-
if (Math.abs(clientRect2.width - width) <= 1) {
|
|
12615
|
-
width = clientRect2.width;
|
|
12616
|
-
}
|
|
12617
|
-
if (Math.abs(clientRect2.height - height) <= 1) {
|
|
12618
|
-
height = clientRect2.height;
|
|
12619
|
-
}
|
|
12620
|
-
return {
|
|
12621
|
-
x: element.offsetLeft,
|
|
12622
|
-
y: element.offsetTop,
|
|
12623
|
-
width,
|
|
12624
|
-
height
|
|
12625
|
-
};
|
|
12626
|
-
}
|
|
12627
|
-
function contains(parent, child) {
|
|
12628
|
-
var rootNode = child.getRootNode && child.getRootNode();
|
|
12629
|
-
if (parent.contains(child)) {
|
|
12630
|
-
return true;
|
|
12631
|
-
} else if (rootNode && isShadowRoot(rootNode)) {
|
|
12632
|
-
var next2 = child;
|
|
12633
|
-
do {
|
|
12634
|
-
if (next2 && parent.isSameNode(next2)) {
|
|
12635
|
-
return true;
|
|
12636
|
-
}
|
|
12637
|
-
next2 = next2.parentNode || next2.host;
|
|
12638
|
-
} while (next2);
|
|
12639
|
-
}
|
|
12640
|
-
return false;
|
|
12641
|
-
}
|
|
12642
|
-
function getComputedStyle$1(element) {
|
|
12643
|
-
return getWindow(element).getComputedStyle(element);
|
|
12644
|
-
}
|
|
12645
|
-
function isTableElement(element) {
|
|
12646
|
-
return ["table", "td", "th"].indexOf(getNodeName(element)) >= 0;
|
|
12647
|
-
}
|
|
12648
|
-
function getDocumentElement(element) {
|
|
12649
|
-
return ((isElement$1(element) ? element.ownerDocument : element.document) || window.document).documentElement;
|
|
12650
|
-
}
|
|
12651
|
-
function getParentNode(element) {
|
|
12652
|
-
if (getNodeName(element) === "html") {
|
|
12653
|
-
return element;
|
|
12654
|
-
}
|
|
12655
|
-
return element.assignedSlot || element.parentNode || (isShadowRoot(element) ? element.host : null) || getDocumentElement(element);
|
|
12656
|
-
}
|
|
12657
|
-
function getTrueOffsetParent(element) {
|
|
12658
|
-
if (!isHTMLElement(element) || getComputedStyle$1(element).position === "fixed") {
|
|
12659
|
-
return null;
|
|
12660
|
-
}
|
|
12661
|
-
return element.offsetParent;
|
|
12662
|
-
}
|
|
12663
|
-
function getContainingBlock(element) {
|
|
12664
|
-
var isFirefox = /firefox/i.test(getUAString());
|
|
12665
|
-
var isIE = /Trident/i.test(getUAString());
|
|
12666
|
-
if (isIE && isHTMLElement(element)) {
|
|
12667
|
-
var elementCss = getComputedStyle$1(element);
|
|
12668
|
-
if (elementCss.position === "fixed") {
|
|
12669
|
-
return null;
|
|
12670
|
-
}
|
|
12671
|
-
}
|
|
12672
|
-
var currentNode = getParentNode(element);
|
|
12673
|
-
if (isShadowRoot(currentNode)) {
|
|
12674
|
-
currentNode = currentNode.host;
|
|
12675
|
-
}
|
|
12676
|
-
while (isHTMLElement(currentNode) && ["html", "body"].indexOf(getNodeName(currentNode)) < 0) {
|
|
12677
|
-
var css = getComputedStyle$1(currentNode);
|
|
12678
|
-
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") {
|
|
12679
|
-
return currentNode;
|
|
12680
|
-
} else {
|
|
12681
|
-
currentNode = currentNode.parentNode;
|
|
12682
|
-
}
|
|
12683
|
-
}
|
|
12684
|
-
return null;
|
|
12685
|
-
}
|
|
12686
|
-
function getOffsetParent(element) {
|
|
12687
|
-
var window2 = getWindow(element);
|
|
12688
|
-
var offsetParent = getTrueOffsetParent(element);
|
|
12689
|
-
while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === "static") {
|
|
12690
|
-
offsetParent = getTrueOffsetParent(offsetParent);
|
|
12691
|
-
}
|
|
12692
|
-
if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle$1(offsetParent).position === "static")) {
|
|
12693
|
-
return window2;
|
|
12694
|
-
}
|
|
12695
|
-
return offsetParent || getContainingBlock(element) || window2;
|
|
12696
|
-
}
|
|
12697
|
-
function getMainAxisFromPlacement(placement) {
|
|
12698
|
-
return ["top", "bottom"].indexOf(placement) >= 0 ? "x" : "y";
|
|
12699
|
-
}
|
|
12700
|
-
function within(min2, value, max2) {
|
|
12701
|
-
return max$3(min2, min$3(value, max2));
|
|
12702
|
-
}
|
|
12703
|
-
function withinMaxClamp(min2, value, max2) {
|
|
12704
|
-
var v = within(min2, value, max2);
|
|
12705
|
-
return v > max2 ? max2 : v;
|
|
12706
|
-
}
|
|
12707
|
-
function getFreshSideObject() {
|
|
12708
|
-
return {
|
|
12709
|
-
top: 0,
|
|
12710
|
-
right: 0,
|
|
12711
|
-
bottom: 0,
|
|
12712
|
-
left: 0
|
|
12713
|
-
};
|
|
12714
|
-
}
|
|
12715
|
-
function mergePaddingObject(paddingObject) {
|
|
12716
|
-
return Object.assign({}, getFreshSideObject(), paddingObject);
|
|
12717
|
-
}
|
|
12718
|
-
function expandToHashMap(value, keys3) {
|
|
12719
|
-
return keys3.reduce(function(hashMap, key) {
|
|
12720
|
-
hashMap[key] = value;
|
|
12721
|
-
return hashMap;
|
|
12722
|
-
}, {});
|
|
12723
|
-
}
|
|
12724
|
-
var toPaddingObject = function toPaddingObject2(padding, state) {
|
|
12725
|
-
padding = typeof padding === "function" ? padding(Object.assign({}, state.rects, {
|
|
12726
|
-
placement: state.placement
|
|
12727
|
-
})) : padding;
|
|
12728
|
-
return mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements));
|
|
12729
|
-
};
|
|
12730
|
-
function arrow(_ref) {
|
|
12731
|
-
var _state$modifiersData$;
|
|
12732
|
-
var state = _ref.state, name = _ref.name, options = _ref.options;
|
|
12733
|
-
var arrowElement = state.elements.arrow;
|
|
12734
|
-
var popperOffsets2 = state.modifiersData.popperOffsets;
|
|
12735
|
-
var basePlacement = getBasePlacement(state.placement);
|
|
12736
|
-
var axis = getMainAxisFromPlacement(basePlacement);
|
|
12737
|
-
var isVertical = [left, right].indexOf(basePlacement) >= 0;
|
|
12738
|
-
var len = isVertical ? "height" : "width";
|
|
12739
|
-
if (!arrowElement || !popperOffsets2) {
|
|
12740
|
-
return;
|
|
12741
|
-
}
|
|
12742
|
-
var paddingObject = toPaddingObject(options.padding, state);
|
|
12743
|
-
var arrowRect = getLayoutRect(arrowElement);
|
|
12744
|
-
var minProp = axis === "y" ? top : left;
|
|
12745
|
-
var maxProp = axis === "y" ? bottom : right;
|
|
12746
|
-
var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets2[axis] - state.rects.popper[len];
|
|
12747
|
-
var startDiff = popperOffsets2[axis] - state.rects.reference[axis];
|
|
12748
|
-
var arrowOffsetParent = getOffsetParent(arrowElement);
|
|
12749
|
-
var clientSize = arrowOffsetParent ? axis === "y" ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
|
|
12750
|
-
var centerToReference = endDiff / 2 - startDiff / 2;
|
|
12751
|
-
var min2 = paddingObject[minProp];
|
|
12752
|
-
var max2 = clientSize - arrowRect[len] - paddingObject[maxProp];
|
|
12753
|
-
var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
|
|
12754
|
-
var offset2 = within(min2, center, max2);
|
|
12755
|
-
var axisProp = axis;
|
|
12756
|
-
state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset2, _state$modifiersData$.centerOffset = offset2 - center, _state$modifiersData$);
|
|
12757
|
-
}
|
|
12758
|
-
function effect$1(_ref2) {
|
|
12759
|
-
var state = _ref2.state, options = _ref2.options;
|
|
12760
|
-
var _options$element = options.element, arrowElement = _options$element === void 0 ? "[data-popper-arrow]" : _options$element;
|
|
12761
|
-
if (arrowElement == null) {
|
|
12762
|
-
return;
|
|
12763
|
-
}
|
|
12764
|
-
if (typeof arrowElement === "string") {
|
|
12765
|
-
arrowElement = state.elements.popper.querySelector(arrowElement);
|
|
12766
|
-
if (!arrowElement) {
|
|
12767
|
-
return;
|
|
12768
|
-
}
|
|
12769
|
-
}
|
|
12770
|
-
if (process.env.NODE_ENV !== "production") {
|
|
12771
|
-
if (!isHTMLElement(arrowElement)) {
|
|
12772
|
-
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(" "));
|
|
12773
|
-
}
|
|
12774
|
-
}
|
|
12775
|
-
if (!contains(state.elements.popper, arrowElement)) {
|
|
12776
|
-
if (process.env.NODE_ENV !== "production") {
|
|
12777
|
-
console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper', "element."].join(" "));
|
|
12778
|
-
}
|
|
12779
|
-
return;
|
|
12780
|
-
}
|
|
12781
|
-
state.elements.arrow = arrowElement;
|
|
12782
|
-
}
|
|
12783
|
-
const arrow$1 = {
|
|
12784
|
-
name: "arrow",
|
|
12785
|
-
enabled: true,
|
|
12786
|
-
phase: "main",
|
|
12787
|
-
fn: arrow,
|
|
12788
|
-
effect: effect$1,
|
|
12789
|
-
requires: ["popperOffsets"],
|
|
12790
|
-
requiresIfExists: ["preventOverflow"]
|
|
12791
|
-
};
|
|
12792
|
-
function getVariation(placement) {
|
|
12793
|
-
return placement.split("-")[1];
|
|
12794
|
-
}
|
|
12795
|
-
var unsetSides = {
|
|
12796
|
-
top: "auto",
|
|
12797
|
-
right: "auto",
|
|
12798
|
-
bottom: "auto",
|
|
12799
|
-
left: "auto"
|
|
12800
|
-
};
|
|
12801
|
-
function roundOffsetsByDPR(_ref) {
|
|
12802
|
-
var x = _ref.x, y = _ref.y;
|
|
12803
|
-
var win = window;
|
|
12804
|
-
var dpr = win.devicePixelRatio || 1;
|
|
12805
|
-
return {
|
|
12806
|
-
x: round(x * dpr) / dpr || 0,
|
|
12807
|
-
y: round(y * dpr) / dpr || 0
|
|
12808
|
-
};
|
|
12809
|
-
}
|
|
12810
|
-
function mapToStyles(_ref2) {
|
|
12811
|
-
var _Object$assign2;
|
|
12812
|
-
var popper2 = _ref2.popper, popperRect = _ref2.popperRect, placement = _ref2.placement, variation = _ref2.variation, offsets = _ref2.offsets, position = _ref2.position, gpuAcceleration = _ref2.gpuAcceleration, adaptive = _ref2.adaptive, roundOffsets = _ref2.roundOffsets, isFixed = _ref2.isFixed;
|
|
12813
|
-
var _offsets$x = offsets.x, x = _offsets$x === void 0 ? 0 : _offsets$x, _offsets$y = offsets.y, y = _offsets$y === void 0 ? 0 : _offsets$y;
|
|
12814
|
-
var _ref3 = typeof roundOffsets === "function" ? roundOffsets({
|
|
12815
|
-
x,
|
|
12816
|
-
y
|
|
12817
|
-
}) : {
|
|
12818
|
-
x,
|
|
12819
|
-
y
|
|
12820
|
-
};
|
|
12821
|
-
x = _ref3.x;
|
|
12822
|
-
y = _ref3.y;
|
|
12823
|
-
var hasX = offsets.hasOwnProperty("x");
|
|
12824
|
-
var hasY = offsets.hasOwnProperty("y");
|
|
12825
|
-
var sideX = left;
|
|
12826
|
-
var sideY = top;
|
|
12827
|
-
var win = window;
|
|
12828
|
-
if (adaptive) {
|
|
12829
|
-
var offsetParent = getOffsetParent(popper2);
|
|
12830
|
-
var heightProp = "clientHeight";
|
|
12831
|
-
var widthProp = "clientWidth";
|
|
12832
|
-
if (offsetParent === getWindow(popper2)) {
|
|
12833
|
-
offsetParent = getDocumentElement(popper2);
|
|
12834
|
-
if (getComputedStyle$1(offsetParent).position !== "static" && position === "absolute") {
|
|
12835
|
-
heightProp = "scrollHeight";
|
|
12836
|
-
widthProp = "scrollWidth";
|
|
12837
|
-
}
|
|
12838
|
-
}
|
|
12839
|
-
offsetParent = offsetParent;
|
|
12840
|
-
if (placement === top || (placement === left || placement === right) && variation === end) {
|
|
12841
|
-
sideY = bottom;
|
|
12842
|
-
var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : offsetParent[heightProp];
|
|
12843
|
-
y -= offsetY - popperRect.height;
|
|
12844
|
-
y *= gpuAcceleration ? 1 : -1;
|
|
12845
|
-
}
|
|
12846
|
-
if (placement === left || (placement === top || placement === bottom) && variation === end) {
|
|
12847
|
-
sideX = right;
|
|
12848
|
-
var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : offsetParent[widthProp];
|
|
12849
|
-
x -= offsetX - popperRect.width;
|
|
12850
|
-
x *= gpuAcceleration ? 1 : -1;
|
|
12851
|
-
}
|
|
12852
|
-
}
|
|
12853
|
-
var commonStyles = Object.assign({
|
|
12854
|
-
position
|
|
12855
|
-
}, adaptive && unsetSides);
|
|
12856
|
-
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
|
|
12857
|
-
x,
|
|
12858
|
-
y
|
|
12859
|
-
}) : {
|
|
12860
|
-
x,
|
|
12861
|
-
y
|
|
12862
|
-
};
|
|
12863
|
-
x = _ref4.x;
|
|
12864
|
-
y = _ref4.y;
|
|
12865
|
-
if (gpuAcceleration) {
|
|
12866
|
-
var _Object$assign;
|
|
12867
|
-
return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? "0" : "", _Object$assign[sideX] = hasX ? "0" : "", _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
|
|
12868
|
-
}
|
|
12869
|
-
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : "", _Object$assign2[sideX] = hasX ? x + "px" : "", _Object$assign2.transform = "", _Object$assign2));
|
|
12870
|
-
}
|
|
12871
|
-
function computeStyles(_ref5) {
|
|
12872
|
-
var state = _ref5.state, options = _ref5.options;
|
|
12873
|
-
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;
|
|
12874
|
-
if (process.env.NODE_ENV !== "production") {
|
|
12875
|
-
var transitionProperty = getComputedStyle$1(state.elements.popper).transitionProperty || "";
|
|
12876
|
-
if (adaptive && ["transform", "top", "right", "bottom", "left"].some(function(property) {
|
|
12877
|
-
return transitionProperty.indexOf(property) >= 0;
|
|
12878
|
-
})) {
|
|
12879
|
-
console.warn(["Popper: Detected CSS transitions on at least one of the following", 'CSS properties: "transform", "top", "right", "bottom", "left".', "\n\n", 'Disable the "computeStyles" modifier\'s `adaptive` option to allow', "for smooth transitions, or remove these properties from the CSS", "transition declaration on the popper element if only transitioning", "opacity or background-color for example.", "\n\n", "We recommend using the popper element as a wrapper around an inner", "element that can have any CSS property transitioned for animations."].join(" "));
|
|
12880
|
-
}
|
|
12881
|
-
}
|
|
12882
|
-
var commonStyles = {
|
|
12883
|
-
placement: getBasePlacement(state.placement),
|
|
12884
|
-
variation: getVariation(state.placement),
|
|
12885
|
-
popper: state.elements.popper,
|
|
12886
|
-
popperRect: state.rects.popper,
|
|
12887
|
-
gpuAcceleration,
|
|
12888
|
-
isFixed: state.options.strategy === "fixed"
|
|
12889
|
-
};
|
|
12890
|
-
if (state.modifiersData.popperOffsets != null) {
|
|
12891
|
-
state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
|
|
12892
|
-
offsets: state.modifiersData.popperOffsets,
|
|
12893
|
-
position: state.options.strategy,
|
|
12894
|
-
adaptive,
|
|
12895
|
-
roundOffsets
|
|
12896
|
-
})));
|
|
12897
|
-
}
|
|
12898
|
-
if (state.modifiersData.arrow != null) {
|
|
12899
|
-
state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
|
|
12900
|
-
offsets: state.modifiersData.arrow,
|
|
12901
|
-
position: "absolute",
|
|
12902
|
-
adaptive: false,
|
|
12903
|
-
roundOffsets
|
|
12904
|
-
})));
|
|
12905
|
-
}
|
|
12906
|
-
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
|
12907
|
-
"data-popper-placement": state.placement
|
|
12908
|
-
});
|
|
12909
|
-
}
|
|
12910
|
-
const computeStyles$1 = {
|
|
12911
|
-
name: "computeStyles",
|
|
12912
|
-
enabled: true,
|
|
12913
|
-
phase: "beforeWrite",
|
|
12914
|
-
fn: computeStyles,
|
|
12915
|
-
data: {}
|
|
12916
|
-
};
|
|
12917
|
-
var passive = {
|
|
12918
|
-
passive: true
|
|
12919
|
-
};
|
|
12920
|
-
function effect(_ref) {
|
|
12921
|
-
var state = _ref.state, instance = _ref.instance, options = _ref.options;
|
|
12922
|
-
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;
|
|
12923
|
-
var window2 = getWindow(state.elements.popper);
|
|
12924
|
-
var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
|
|
12925
|
-
if (scroll) {
|
|
12926
|
-
scrollParents.forEach(function(scrollParent) {
|
|
12927
|
-
scrollParent.addEventListener("scroll", instance.update, passive);
|
|
12928
|
-
});
|
|
12929
|
-
}
|
|
12930
|
-
if (resize) {
|
|
12931
|
-
window2.addEventListener("resize", instance.update, passive);
|
|
12932
|
-
}
|
|
12933
|
-
return function() {
|
|
12934
|
-
if (scroll) {
|
|
12935
|
-
scrollParents.forEach(function(scrollParent) {
|
|
12936
|
-
scrollParent.removeEventListener("scroll", instance.update, passive);
|
|
12937
|
-
});
|
|
12938
|
-
}
|
|
12939
|
-
if (resize) {
|
|
12940
|
-
window2.removeEventListener("resize", instance.update, passive);
|
|
12941
|
-
}
|
|
12942
|
-
};
|
|
12943
|
-
}
|
|
12944
|
-
const eventListeners = {
|
|
12945
|
-
name: "eventListeners",
|
|
12946
|
-
enabled: true,
|
|
12947
|
-
phase: "write",
|
|
12948
|
-
fn: function fn() {
|
|
12949
|
-
},
|
|
12950
|
-
effect,
|
|
12951
|
-
data: {}
|
|
12952
|
-
};
|
|
12953
|
-
var hash$1 = {
|
|
12954
|
-
left: "right",
|
|
12955
|
-
right: "left",
|
|
12956
|
-
bottom: "top",
|
|
12957
|
-
top: "bottom"
|
|
12958
|
-
};
|
|
12959
|
-
function getOppositePlacement(placement) {
|
|
12960
|
-
return placement.replace(/left|right|bottom|top/g, function(matched) {
|
|
12961
|
-
return hash$1[matched];
|
|
12962
|
-
});
|
|
12963
|
-
}
|
|
12964
|
-
var hash = {
|
|
12965
|
-
start: "end",
|
|
12966
|
-
end: "start"
|
|
12967
|
-
};
|
|
12968
|
-
function getOppositeVariationPlacement(placement) {
|
|
12969
|
-
return placement.replace(/start|end/g, function(matched) {
|
|
12970
|
-
return hash[matched];
|
|
12971
|
-
});
|
|
12972
|
-
}
|
|
12973
|
-
function getWindowScroll(node) {
|
|
12974
|
-
var win = getWindow(node);
|
|
12975
|
-
var scrollLeft = win.pageXOffset;
|
|
12976
|
-
var scrollTop = win.pageYOffset;
|
|
12977
|
-
return {
|
|
12978
|
-
scrollLeft,
|
|
12979
|
-
scrollTop
|
|
12980
|
-
};
|
|
12981
|
-
}
|
|
12982
|
-
function getWindowScrollBarX(element) {
|
|
12983
|
-
return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
|
|
12984
|
-
}
|
|
12985
|
-
function getViewportRect(element, strategy) {
|
|
12986
|
-
var win = getWindow(element);
|
|
12987
|
-
var html2 = getDocumentElement(element);
|
|
12988
|
-
var visualViewport = win.visualViewport;
|
|
12989
|
-
var width = html2.clientWidth;
|
|
12990
|
-
var height = html2.clientHeight;
|
|
12991
|
-
var x = 0;
|
|
12992
|
-
var y = 0;
|
|
12993
|
-
if (visualViewport) {
|
|
12994
|
-
width = visualViewport.width;
|
|
12995
|
-
height = visualViewport.height;
|
|
12996
|
-
var layoutViewport = isLayoutViewport();
|
|
12997
|
-
if (layoutViewport || !layoutViewport && strategy === "fixed") {
|
|
12998
|
-
x = visualViewport.offsetLeft;
|
|
12999
|
-
y = visualViewport.offsetTop;
|
|
13000
|
-
}
|
|
13001
|
-
}
|
|
13002
|
-
return {
|
|
13003
|
-
width,
|
|
13004
|
-
height,
|
|
13005
|
-
x: x + getWindowScrollBarX(element),
|
|
13006
|
-
y
|
|
13007
|
-
};
|
|
13008
|
-
}
|
|
13009
|
-
function getDocumentRect(element) {
|
|
13010
|
-
var _element$ownerDocumen;
|
|
13011
|
-
var html2 = getDocumentElement(element);
|
|
13012
|
-
var winScroll = getWindowScroll(element);
|
|
13013
|
-
var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
|
|
13014
|
-
var width = max$3(html2.scrollWidth, html2.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
|
|
13015
|
-
var height = max$3(html2.scrollHeight, html2.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
|
13016
|
-
var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
|
|
13017
|
-
var y = -winScroll.scrollTop;
|
|
13018
|
-
if (getComputedStyle$1(body || html2).direction === "rtl") {
|
|
13019
|
-
x += max$3(html2.clientWidth, body ? body.clientWidth : 0) - width;
|
|
13020
|
-
}
|
|
13021
|
-
return {
|
|
13022
|
-
width,
|
|
13023
|
-
height,
|
|
13024
|
-
x,
|
|
13025
|
-
y
|
|
13026
|
-
};
|
|
13027
|
-
}
|
|
13028
|
-
function isScrollParent(element) {
|
|
13029
|
-
var _getComputedStyle = getComputedStyle$1(element), overflow = _getComputedStyle.overflow, overflowX = _getComputedStyle.overflowX, overflowY = _getComputedStyle.overflowY;
|
|
13030
|
-
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
|
|
13031
|
-
}
|
|
13032
|
-
function getScrollParent(node) {
|
|
13033
|
-
if (["html", "body", "#document"].indexOf(getNodeName(node)) >= 0) {
|
|
13034
|
-
return node.ownerDocument.body;
|
|
13035
|
-
}
|
|
13036
|
-
if (isHTMLElement(node) && isScrollParent(node)) {
|
|
13037
|
-
return node;
|
|
13038
|
-
}
|
|
13039
|
-
return getScrollParent(getParentNode(node));
|
|
13040
|
-
}
|
|
13041
|
-
function listScrollParents(element, list) {
|
|
13042
|
-
var _element$ownerDocumen;
|
|
13043
|
-
if (list === void 0) {
|
|
13044
|
-
list = [];
|
|
13045
|
-
}
|
|
13046
|
-
var scrollParent = getScrollParent(element);
|
|
13047
|
-
var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
|
|
13048
|
-
var win = getWindow(scrollParent);
|
|
13049
|
-
var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
|
|
13050
|
-
var updatedList = list.concat(target);
|
|
13051
|
-
return isBody ? updatedList : updatedList.concat(listScrollParents(getParentNode(target)));
|
|
13052
|
-
}
|
|
13053
|
-
function rectToClientRect(rect) {
|
|
13054
|
-
return Object.assign({}, rect, {
|
|
13055
|
-
left: rect.x,
|
|
13056
|
-
top: rect.y,
|
|
13057
|
-
right: rect.x + rect.width,
|
|
13058
|
-
bottom: rect.y + rect.height
|
|
13059
|
-
});
|
|
13060
|
-
}
|
|
13061
|
-
function getInnerBoundingClientRect(element, strategy) {
|
|
13062
|
-
var rect = getBoundingClientRect(element, false, strategy === "fixed");
|
|
13063
|
-
rect.top = rect.top + element.clientTop;
|
|
13064
|
-
rect.left = rect.left + element.clientLeft;
|
|
13065
|
-
rect.bottom = rect.top + element.clientHeight;
|
|
13066
|
-
rect.right = rect.left + element.clientWidth;
|
|
13067
|
-
rect.width = element.clientWidth;
|
|
13068
|
-
rect.height = element.clientHeight;
|
|
13069
|
-
rect.x = rect.left;
|
|
13070
|
-
rect.y = rect.top;
|
|
13071
|
-
return rect;
|
|
13072
|
-
}
|
|
13073
|
-
function getClientRectFromMixedType(element, clippingParent, strategy) {
|
|
13074
|
-
return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement$1(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
|
13075
|
-
}
|
|
13076
|
-
function getClippingParents(element) {
|
|
13077
|
-
var clippingParents2 = listScrollParents(getParentNode(element));
|
|
13078
|
-
var canEscapeClipping = ["absolute", "fixed"].indexOf(getComputedStyle$1(element).position) >= 0;
|
|
13079
|
-
var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
|
|
13080
|
-
if (!isElement$1(clipperElement)) {
|
|
13081
|
-
return [];
|
|
13082
|
-
}
|
|
13083
|
-
return clippingParents2.filter(function(clippingParent) {
|
|
13084
|
-
return isElement$1(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== "body";
|
|
13085
|
-
});
|
|
13086
|
-
}
|
|
13087
|
-
function getClippingRect(element, boundary, rootBoundary, strategy) {
|
|
13088
|
-
var mainClippingParents = boundary === "clippingParents" ? getClippingParents(element) : [].concat(boundary);
|
|
13089
|
-
var clippingParents2 = [].concat(mainClippingParents, [rootBoundary]);
|
|
13090
|
-
var firstClippingParent = clippingParents2[0];
|
|
13091
|
-
var clippingRect = clippingParents2.reduce(function(accRect, clippingParent) {
|
|
13092
|
-
var rect = getClientRectFromMixedType(element, clippingParent, strategy);
|
|
13093
|
-
accRect.top = max$3(rect.top, accRect.top);
|
|
13094
|
-
accRect.right = min$3(rect.right, accRect.right);
|
|
13095
|
-
accRect.bottom = min$3(rect.bottom, accRect.bottom);
|
|
13096
|
-
accRect.left = max$3(rect.left, accRect.left);
|
|
13097
|
-
return accRect;
|
|
13098
|
-
}, getClientRectFromMixedType(element, firstClippingParent, strategy));
|
|
13099
|
-
clippingRect.width = clippingRect.right - clippingRect.left;
|
|
13100
|
-
clippingRect.height = clippingRect.bottom - clippingRect.top;
|
|
13101
|
-
clippingRect.x = clippingRect.left;
|
|
13102
|
-
clippingRect.y = clippingRect.top;
|
|
13103
|
-
return clippingRect;
|
|
13104
|
-
}
|
|
13105
|
-
function computeOffsets(_ref) {
|
|
13106
|
-
var reference2 = _ref.reference, element = _ref.element, placement = _ref.placement;
|
|
13107
|
-
var basePlacement = placement ? getBasePlacement(placement) : null;
|
|
13108
|
-
var variation = placement ? getVariation(placement) : null;
|
|
13109
|
-
var commonX = reference2.x + reference2.width / 2 - element.width / 2;
|
|
13110
|
-
var commonY = reference2.y + reference2.height / 2 - element.height / 2;
|
|
13111
|
-
var offsets;
|
|
13112
|
-
switch (basePlacement) {
|
|
13113
|
-
case top:
|
|
13114
|
-
offsets = {
|
|
13115
|
-
x: commonX,
|
|
13116
|
-
y: reference2.y - element.height
|
|
13117
|
-
};
|
|
13118
|
-
break;
|
|
13119
|
-
case bottom:
|
|
13120
|
-
offsets = {
|
|
13121
|
-
x: commonX,
|
|
13122
|
-
y: reference2.y + reference2.height
|
|
13123
|
-
};
|
|
13124
|
-
break;
|
|
13125
|
-
case right:
|
|
13126
|
-
offsets = {
|
|
13127
|
-
x: reference2.x + reference2.width,
|
|
13128
|
-
y: commonY
|
|
13129
|
-
};
|
|
13130
|
-
break;
|
|
13131
|
-
case left:
|
|
13132
|
-
offsets = {
|
|
13133
|
-
x: reference2.x - element.width,
|
|
13134
|
-
y: commonY
|
|
13135
|
-
};
|
|
13136
|
-
break;
|
|
13137
|
-
default:
|
|
13138
|
-
offsets = {
|
|
13139
|
-
x: reference2.x,
|
|
13140
|
-
y: reference2.y
|
|
13141
|
-
};
|
|
13142
|
-
}
|
|
13143
|
-
var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
|
|
13144
|
-
if (mainAxis != null) {
|
|
13145
|
-
var len = mainAxis === "y" ? "height" : "width";
|
|
13146
|
-
switch (variation) {
|
|
13147
|
-
case start:
|
|
13148
|
-
offsets[mainAxis] = offsets[mainAxis] - (reference2[len] / 2 - element[len] / 2);
|
|
13149
|
-
break;
|
|
13150
|
-
case end:
|
|
13151
|
-
offsets[mainAxis] = offsets[mainAxis] + (reference2[len] / 2 - element[len] / 2);
|
|
13152
|
-
break;
|
|
13153
|
-
}
|
|
13154
|
-
}
|
|
13155
|
-
return offsets;
|
|
13156
|
-
}
|
|
13157
|
-
function detectOverflow(state, options) {
|
|
13158
|
-
if (options === void 0) {
|
|
13159
|
-
options = {};
|
|
13160
|
-
}
|
|
13161
|
-
var _options = options, _options$placement = _options.placement, placement = _options$placement === void 0 ? state.placement : _options$placement, _options$strategy = _options.strategy, strategy = _options$strategy === void 0 ? state.strategy : _options$strategy, _options$boundary = _options.boundary, boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, _options$rootBoundary = _options.rootBoundary, rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, _options$elementConte = _options.elementContext, elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, _options$altBoundary = _options.altBoundary, altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, _options$padding = _options.padding, padding = _options$padding === void 0 ? 0 : _options$padding;
|
|
13162
|
-
var paddingObject = mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements));
|
|
13163
|
-
var altContext = elementContext === popper ? reference : popper;
|
|
13164
|
-
var popperRect = state.rects.popper;
|
|
13165
|
-
var element = state.elements[altBoundary ? altContext : elementContext];
|
|
13166
|
-
var clippingClientRect = getClippingRect(isElement$1(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);
|
|
13167
|
-
var referenceClientRect = getBoundingClientRect(state.elements.reference);
|
|
13168
|
-
var popperOffsets2 = computeOffsets({
|
|
13169
|
-
reference: referenceClientRect,
|
|
13170
|
-
element: popperRect,
|
|
13171
|
-
strategy: "absolute",
|
|
13172
|
-
placement
|
|
13173
|
-
});
|
|
13174
|
-
var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets2));
|
|
13175
|
-
var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect;
|
|
13176
|
-
var overflowOffsets = {
|
|
13177
|
-
top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
|
|
13178
|
-
bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
|
|
13179
|
-
left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
|
|
13180
|
-
right: elementClientRect.right - clippingClientRect.right + paddingObject.right
|
|
13181
|
-
};
|
|
13182
|
-
var offsetData = state.modifiersData.offset;
|
|
13183
|
-
if (elementContext === popper && offsetData) {
|
|
13184
|
-
var offset2 = offsetData[placement];
|
|
13185
|
-
Object.keys(overflowOffsets).forEach(function(key) {
|
|
13186
|
-
var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
|
|
13187
|
-
var axis = [top, bottom].indexOf(key) >= 0 ? "y" : "x";
|
|
13188
|
-
overflowOffsets[key] += offset2[axis] * multiply;
|
|
13189
|
-
});
|
|
13190
|
-
}
|
|
13191
|
-
return overflowOffsets;
|
|
13192
|
-
}
|
|
13193
|
-
function computeAutoPlacement(state, options) {
|
|
13194
|
-
if (options === void 0) {
|
|
13195
|
-
options = {};
|
|
13196
|
-
}
|
|
13197
|
-
var _options = options, placement = _options.placement, boundary = _options.boundary, rootBoundary = _options.rootBoundary, padding = _options.padding, flipVariations = _options.flipVariations, _options$allowedAutoP = _options.allowedAutoPlacements, allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
|
|
13198
|
-
var variation = getVariation(placement);
|
|
13199
|
-
var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function(placement2) {
|
|
13200
|
-
return getVariation(placement2) === variation;
|
|
13201
|
-
}) : basePlacements;
|
|
13202
|
-
var allowedPlacements = placements$1.filter(function(placement2) {
|
|
13203
|
-
return allowedAutoPlacements.indexOf(placement2) >= 0;
|
|
13204
|
-
});
|
|
13205
|
-
if (allowedPlacements.length === 0) {
|
|
13206
|
-
allowedPlacements = placements$1;
|
|
13207
|
-
if (process.env.NODE_ENV !== "production") {
|
|
13208
|
-
console.error(["Popper: The `allowedAutoPlacements` option did not allow any", "placements. Ensure the `placement` option matches the variation", "of the allowed placements.", 'For example, "auto" cannot be used to allow "bottom-start".', 'Use "auto-start" instead.'].join(" "));
|
|
13209
|
-
}
|
|
13210
|
-
}
|
|
13211
|
-
var overflows = allowedPlacements.reduce(function(acc, placement2) {
|
|
13212
|
-
acc[placement2] = detectOverflow(state, {
|
|
13213
|
-
placement: placement2,
|
|
13214
|
-
boundary,
|
|
13215
|
-
rootBoundary,
|
|
13216
|
-
padding
|
|
13217
|
-
})[getBasePlacement(placement2)];
|
|
13218
|
-
return acc;
|
|
13219
|
-
}, {});
|
|
13220
|
-
return Object.keys(overflows).sort(function(a, b) {
|
|
13221
|
-
return overflows[a] - overflows[b];
|
|
13222
|
-
});
|
|
13223
|
-
}
|
|
13224
|
-
function getExpandedFallbackPlacements(placement) {
|
|
13225
|
-
if (getBasePlacement(placement) === auto) {
|
|
13226
|
-
return [];
|
|
13227
|
-
}
|
|
13228
|
-
var oppositePlacement = getOppositePlacement(placement);
|
|
13229
|
-
return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
|
|
13230
|
-
}
|
|
13231
|
-
function flip(_ref) {
|
|
13232
|
-
var state = _ref.state, options = _ref.options, name = _ref.name;
|
|
13233
|
-
if (state.modifiersData[name]._skip) {
|
|
13234
|
-
return;
|
|
13235
|
-
}
|
|
13236
|
-
var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, specifiedFallbackPlacements = options.fallbackPlacements, padding = options.padding, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, _options$flipVariatio = options.flipVariations, flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, allowedAutoPlacements = options.allowedAutoPlacements;
|
|
13237
|
-
var preferredPlacement = state.options.placement;
|
|
13238
|
-
var basePlacement = getBasePlacement(preferredPlacement);
|
|
13239
|
-
var isBasePlacement = basePlacement === preferredPlacement;
|
|
13240
|
-
var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
|
|
13241
|
-
var placements2 = [preferredPlacement].concat(fallbackPlacements).reduce(function(acc, placement2) {
|
|
13242
|
-
return acc.concat(getBasePlacement(placement2) === auto ? computeAutoPlacement(state, {
|
|
13243
|
-
placement: placement2,
|
|
13244
|
-
boundary,
|
|
13245
|
-
rootBoundary,
|
|
13246
|
-
padding,
|
|
13247
|
-
flipVariations,
|
|
13248
|
-
allowedAutoPlacements
|
|
13249
|
-
}) : placement2);
|
|
13250
|
-
}, []);
|
|
13251
|
-
var referenceRect = state.rects.reference;
|
|
13252
|
-
var popperRect = state.rects.popper;
|
|
13253
|
-
var checksMap = /* @__PURE__ */ new Map();
|
|
13254
|
-
var makeFallbackChecks = true;
|
|
13255
|
-
var firstFittingPlacement = placements2[0];
|
|
13256
|
-
for (var i = 0; i < placements2.length; i++) {
|
|
13257
|
-
var placement = placements2[i];
|
|
13258
|
-
var _basePlacement = getBasePlacement(placement);
|
|
13259
|
-
var isStartVariation = getVariation(placement) === start;
|
|
13260
|
-
var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
|
|
13261
|
-
var len = isVertical ? "width" : "height";
|
|
13262
|
-
var overflow = detectOverflow(state, {
|
|
13263
|
-
placement,
|
|
13264
|
-
boundary,
|
|
13265
|
-
rootBoundary,
|
|
13266
|
-
altBoundary,
|
|
13267
|
-
padding
|
|
13268
|
-
});
|
|
13269
|
-
var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
|
|
13270
|
-
if (referenceRect[len] > popperRect[len]) {
|
|
13271
|
-
mainVariationSide = getOppositePlacement(mainVariationSide);
|
|
13272
|
-
}
|
|
13273
|
-
var altVariationSide = getOppositePlacement(mainVariationSide);
|
|
13274
|
-
var checks = [];
|
|
13275
|
-
if (checkMainAxis) {
|
|
13276
|
-
checks.push(overflow[_basePlacement] <= 0);
|
|
13277
|
-
}
|
|
13278
|
-
if (checkAltAxis) {
|
|
13279
|
-
checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
|
|
13280
|
-
}
|
|
13281
|
-
if (checks.every(function(check3) {
|
|
13282
|
-
return check3;
|
|
13283
|
-
})) {
|
|
13284
|
-
firstFittingPlacement = placement;
|
|
13285
|
-
makeFallbackChecks = false;
|
|
13286
|
-
break;
|
|
13287
|
-
}
|
|
13288
|
-
checksMap.set(placement, checks);
|
|
13289
|
-
}
|
|
13290
|
-
if (makeFallbackChecks) {
|
|
13291
|
-
var numberOfChecks = flipVariations ? 3 : 1;
|
|
13292
|
-
var _loop = function _loop2(_i2) {
|
|
13293
|
-
var fittingPlacement = placements2.find(function(placement2) {
|
|
13294
|
-
var checks2 = checksMap.get(placement2);
|
|
13295
|
-
if (checks2) {
|
|
13296
|
-
return checks2.slice(0, _i2).every(function(check3) {
|
|
13297
|
-
return check3;
|
|
13298
|
-
});
|
|
13299
|
-
}
|
|
13300
|
-
});
|
|
13301
|
-
if (fittingPlacement) {
|
|
13302
|
-
firstFittingPlacement = fittingPlacement;
|
|
13303
|
-
return "break";
|
|
13304
|
-
}
|
|
13305
|
-
};
|
|
13306
|
-
for (var _i = numberOfChecks; _i > 0; _i--) {
|
|
13307
|
-
var _ret = _loop(_i);
|
|
13308
|
-
if (_ret === "break")
|
|
13309
|
-
break;
|
|
13310
|
-
}
|
|
13311
|
-
}
|
|
13312
|
-
if (state.placement !== firstFittingPlacement) {
|
|
13313
|
-
state.modifiersData[name]._skip = true;
|
|
13314
|
-
state.placement = firstFittingPlacement;
|
|
13315
|
-
state.reset = true;
|
|
13316
|
-
}
|
|
13317
|
-
}
|
|
13318
|
-
const flip$1 = {
|
|
13319
|
-
name: "flip",
|
|
13320
|
-
enabled: true,
|
|
13321
|
-
phase: "main",
|
|
13322
|
-
fn: flip,
|
|
13323
|
-
requiresIfExists: ["offset"],
|
|
13324
|
-
data: {
|
|
13325
|
-
_skip: false
|
|
13326
|
-
}
|
|
13327
|
-
};
|
|
13328
|
-
function getSideOffsets(overflow, rect, preventedOffsets) {
|
|
13329
|
-
if (preventedOffsets === void 0) {
|
|
13330
|
-
preventedOffsets = {
|
|
13331
|
-
x: 0,
|
|
13332
|
-
y: 0
|
|
13333
|
-
};
|
|
13334
|
-
}
|
|
13335
|
-
return {
|
|
13336
|
-
top: overflow.top - rect.height - preventedOffsets.y,
|
|
13337
|
-
right: overflow.right - rect.width + preventedOffsets.x,
|
|
13338
|
-
bottom: overflow.bottom - rect.height + preventedOffsets.y,
|
|
13339
|
-
left: overflow.left - rect.width - preventedOffsets.x
|
|
13340
|
-
};
|
|
13341
|
-
}
|
|
13342
|
-
function isAnySideFullyClipped(overflow) {
|
|
13343
|
-
return [top, right, bottom, left].some(function(side) {
|
|
13344
|
-
return overflow[side] >= 0;
|
|
13345
|
-
});
|
|
13346
|
-
}
|
|
13347
|
-
function hide(_ref) {
|
|
13348
|
-
var state = _ref.state, name = _ref.name;
|
|
13349
|
-
var referenceRect = state.rects.reference;
|
|
13350
|
-
var popperRect = state.rects.popper;
|
|
13351
|
-
var preventedOffsets = state.modifiersData.preventOverflow;
|
|
13352
|
-
var referenceOverflow = detectOverflow(state, {
|
|
13353
|
-
elementContext: "reference"
|
|
13354
|
-
});
|
|
13355
|
-
var popperAltOverflow = detectOverflow(state, {
|
|
13356
|
-
altBoundary: true
|
|
13357
|
-
});
|
|
13358
|
-
var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
|
|
13359
|
-
var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
|
|
13360
|
-
var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
|
|
13361
|
-
var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
|
|
13362
|
-
state.modifiersData[name] = {
|
|
13363
|
-
referenceClippingOffsets,
|
|
13364
|
-
popperEscapeOffsets,
|
|
13365
|
-
isReferenceHidden,
|
|
13366
|
-
hasPopperEscaped
|
|
13367
|
-
};
|
|
13368
|
-
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
|
13369
|
-
"data-popper-reference-hidden": isReferenceHidden,
|
|
13370
|
-
"data-popper-escaped": hasPopperEscaped
|
|
13371
|
-
});
|
|
13372
|
-
}
|
|
13373
|
-
const hide$1 = {
|
|
13374
|
-
name: "hide",
|
|
13375
|
-
enabled: true,
|
|
13376
|
-
phase: "main",
|
|
13377
|
-
requiresIfExists: ["preventOverflow"],
|
|
13378
|
-
fn: hide
|
|
13379
|
-
};
|
|
13380
|
-
function distanceAndSkiddingToXY(placement, rects, offset2) {
|
|
13381
|
-
var basePlacement = getBasePlacement(placement);
|
|
13382
|
-
var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
|
|
13383
|
-
var _ref = typeof offset2 === "function" ? offset2(Object.assign({}, rects, {
|
|
13384
|
-
placement
|
|
13385
|
-
})) : offset2, skidding = _ref[0], distance = _ref[1];
|
|
13386
|
-
skidding = skidding || 0;
|
|
13387
|
-
distance = (distance || 0) * invertDistance;
|
|
13388
|
-
return [left, right].indexOf(basePlacement) >= 0 ? {
|
|
13389
|
-
x: distance,
|
|
13390
|
-
y: skidding
|
|
13391
|
-
} : {
|
|
13392
|
-
x: skidding,
|
|
13393
|
-
y: distance
|
|
13394
|
-
};
|
|
13395
|
-
}
|
|
13396
|
-
function offset(_ref2) {
|
|
13397
|
-
var state = _ref2.state, options = _ref2.options, name = _ref2.name;
|
|
13398
|
-
var _options$offset = options.offset, offset2 = _options$offset === void 0 ? [0, 0] : _options$offset;
|
|
13399
|
-
var data2 = placements.reduce(function(acc, placement) {
|
|
13400
|
-
acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset2);
|
|
13401
|
-
return acc;
|
|
13402
|
-
}, {});
|
|
13403
|
-
var _data$state$placement = data2[state.placement], x = _data$state$placement.x, y = _data$state$placement.y;
|
|
13404
|
-
if (state.modifiersData.popperOffsets != null) {
|
|
13405
|
-
state.modifiersData.popperOffsets.x += x;
|
|
13406
|
-
state.modifiersData.popperOffsets.y += y;
|
|
13407
|
-
}
|
|
13408
|
-
state.modifiersData[name] = data2;
|
|
13409
|
-
}
|
|
13410
|
-
const offset$1 = {
|
|
13411
|
-
name: "offset",
|
|
13412
|
-
enabled: true,
|
|
13413
|
-
phase: "main",
|
|
13414
|
-
requires: ["popperOffsets"],
|
|
13415
|
-
fn: offset
|
|
13416
|
-
};
|
|
13417
|
-
function popperOffsets(_ref) {
|
|
13418
|
-
var state = _ref.state, name = _ref.name;
|
|
13419
|
-
state.modifiersData[name] = computeOffsets({
|
|
13420
|
-
reference: state.rects.reference,
|
|
13421
|
-
element: state.rects.popper,
|
|
13422
|
-
strategy: "absolute",
|
|
13423
|
-
placement: state.placement
|
|
13424
|
-
});
|
|
13425
|
-
}
|
|
13426
|
-
const popperOffsets$1 = {
|
|
13427
|
-
name: "popperOffsets",
|
|
13428
|
-
enabled: true,
|
|
13429
|
-
phase: "read",
|
|
13430
|
-
fn: popperOffsets,
|
|
13431
|
-
data: {}
|
|
13432
|
-
};
|
|
13433
|
-
function getAltAxis(axis) {
|
|
13434
|
-
return axis === "x" ? "y" : "x";
|
|
13435
|
-
}
|
|
13436
|
-
function preventOverflow(_ref) {
|
|
13437
|
-
var state = _ref.state, options = _ref.options, name = _ref.name;
|
|
13438
|
-
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;
|
|
13439
|
-
var overflow = detectOverflow(state, {
|
|
13440
|
-
boundary,
|
|
13441
|
-
rootBoundary,
|
|
13442
|
-
padding,
|
|
13443
|
-
altBoundary
|
|
13444
|
-
});
|
|
13445
|
-
var basePlacement = getBasePlacement(state.placement);
|
|
13446
|
-
var variation = getVariation(state.placement);
|
|
13447
|
-
var isBasePlacement = !variation;
|
|
13448
|
-
var mainAxis = getMainAxisFromPlacement(basePlacement);
|
|
13449
|
-
var altAxis = getAltAxis(mainAxis);
|
|
13450
|
-
var popperOffsets2 = state.modifiersData.popperOffsets;
|
|
13451
|
-
var referenceRect = state.rects.reference;
|
|
13452
|
-
var popperRect = state.rects.popper;
|
|
13453
|
-
var tetherOffsetValue = typeof tetherOffset === "function" ? tetherOffset(Object.assign({}, state.rects, {
|
|
13454
|
-
placement: state.placement
|
|
13455
|
-
})) : tetherOffset;
|
|
13456
|
-
var normalizedTetherOffsetValue = typeof tetherOffsetValue === "number" ? {
|
|
13457
|
-
mainAxis: tetherOffsetValue,
|
|
13458
|
-
altAxis: tetherOffsetValue
|
|
13459
|
-
} : Object.assign({
|
|
13460
|
-
mainAxis: 0,
|
|
13461
|
-
altAxis: 0
|
|
13462
|
-
}, tetherOffsetValue);
|
|
13463
|
-
var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
|
|
13464
|
-
var data2 = {
|
|
13465
|
-
x: 0,
|
|
13466
|
-
y: 0
|
|
13467
|
-
};
|
|
13468
|
-
if (!popperOffsets2) {
|
|
13469
|
-
return;
|
|
13470
|
-
}
|
|
13471
|
-
if (checkMainAxis) {
|
|
13472
|
-
var _offsetModifierState$;
|
|
13473
|
-
var mainSide = mainAxis === "y" ? top : left;
|
|
13474
|
-
var altSide = mainAxis === "y" ? bottom : right;
|
|
13475
|
-
var len = mainAxis === "y" ? "height" : "width";
|
|
13476
|
-
var offset2 = popperOffsets2[mainAxis];
|
|
13477
|
-
var min2 = offset2 + overflow[mainSide];
|
|
13478
|
-
var max2 = offset2 - overflow[altSide];
|
|
13479
|
-
var additive = tether ? -popperRect[len] / 2 : 0;
|
|
13480
|
-
var minLen = variation === start ? referenceRect[len] : popperRect[len];
|
|
13481
|
-
var maxLen = variation === start ? -popperRect[len] : -referenceRect[len];
|
|
13482
|
-
var arrowElement = state.elements.arrow;
|
|
13483
|
-
var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
|
|
13484
|
-
width: 0,
|
|
13485
|
-
height: 0
|
|
13486
|
-
};
|
|
13487
|
-
var arrowPaddingObject = state.modifiersData["arrow#persistent"] ? state.modifiersData["arrow#persistent"].padding : getFreshSideObject();
|
|
13488
|
-
var arrowPaddingMin = arrowPaddingObject[mainSide];
|
|
13489
|
-
var arrowPaddingMax = arrowPaddingObject[altSide];
|
|
13490
|
-
var arrowLen = within(0, referenceRect[len], arrowRect[len]);
|
|
13491
|
-
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
|
|
13492
|
-
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
|
|
13493
|
-
var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
|
|
13494
|
-
var clientOffset = arrowOffsetParent ? mainAxis === "y" ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
|
|
13495
|
-
var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
|
|
13496
|
-
var tetherMin = offset2 + minOffset - offsetModifierValue - clientOffset;
|
|
13497
|
-
var tetherMax = offset2 + maxOffset - offsetModifierValue;
|
|
13498
|
-
var preventedOffset = within(tether ? min$3(min2, tetherMin) : min2, offset2, tether ? max$3(max2, tetherMax) : max2);
|
|
13499
|
-
popperOffsets2[mainAxis] = preventedOffset;
|
|
13500
|
-
data2[mainAxis] = preventedOffset - offset2;
|
|
13501
|
-
}
|
|
13502
|
-
if (checkAltAxis) {
|
|
13503
|
-
var _offsetModifierState$2;
|
|
13504
|
-
var _mainSide = mainAxis === "x" ? top : left;
|
|
13505
|
-
var _altSide = mainAxis === "x" ? bottom : right;
|
|
13506
|
-
var _offset = popperOffsets2[altAxis];
|
|
13507
|
-
var _len = altAxis === "y" ? "height" : "width";
|
|
13508
|
-
var _min = _offset + overflow[_mainSide];
|
|
13509
|
-
var _max = _offset - overflow[_altSide];
|
|
13510
|
-
var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
|
|
13511
|
-
var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
|
|
13512
|
-
var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
|
|
13513
|
-
var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
|
|
13514
|
-
var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
|
|
13515
|
-
popperOffsets2[altAxis] = _preventedOffset;
|
|
13516
|
-
data2[altAxis] = _preventedOffset - _offset;
|
|
13517
|
-
}
|
|
13518
|
-
state.modifiersData[name] = data2;
|
|
13519
|
-
}
|
|
13520
|
-
const preventOverflow$1 = {
|
|
13521
|
-
name: "preventOverflow",
|
|
13522
|
-
enabled: true,
|
|
13523
|
-
phase: "main",
|
|
13524
|
-
fn: preventOverflow,
|
|
13525
|
-
requiresIfExists: ["offset"]
|
|
13526
|
-
};
|
|
13527
|
-
function getHTMLElementScroll(element) {
|
|
13528
|
-
return {
|
|
13529
|
-
scrollLeft: element.scrollLeft,
|
|
13530
|
-
scrollTop: element.scrollTop
|
|
13531
|
-
};
|
|
13532
|
-
}
|
|
13533
|
-
function getNodeScroll(node) {
|
|
13534
|
-
if (node === getWindow(node) || !isHTMLElement(node)) {
|
|
13535
|
-
return getWindowScroll(node);
|
|
13536
|
-
} else {
|
|
13537
|
-
return getHTMLElementScroll(node);
|
|
13538
|
-
}
|
|
13539
|
-
}
|
|
13540
|
-
function isElementScaled(element) {
|
|
13541
|
-
var rect = element.getBoundingClientRect();
|
|
13542
|
-
var scaleX = round(rect.width) / element.offsetWidth || 1;
|
|
13543
|
-
var scaleY = round(rect.height) / element.offsetHeight || 1;
|
|
13544
|
-
return scaleX !== 1 || scaleY !== 1;
|
|
13545
|
-
}
|
|
13546
|
-
function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
13547
|
-
if (isFixed === void 0) {
|
|
13548
|
-
isFixed = false;
|
|
13549
|
-
}
|
|
13550
|
-
var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
13551
|
-
var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
|
13552
|
-
var documentElement = getDocumentElement(offsetParent);
|
|
13553
|
-
var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);
|
|
13554
|
-
var scroll = {
|
|
13555
|
-
scrollLeft: 0,
|
|
13556
|
-
scrollTop: 0
|
|
13557
|
-
};
|
|
13558
|
-
var offsets = {
|
|
13559
|
-
x: 0,
|
|
13560
|
-
y: 0
|
|
13561
|
-
};
|
|
13562
|
-
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
13563
|
-
if (getNodeName(offsetParent) !== "body" || isScrollParent(documentElement)) {
|
|
13564
|
-
scroll = getNodeScroll(offsetParent);
|
|
13565
|
-
}
|
|
13566
|
-
if (isHTMLElement(offsetParent)) {
|
|
13567
|
-
offsets = getBoundingClientRect(offsetParent, true);
|
|
13568
|
-
offsets.x += offsetParent.clientLeft;
|
|
13569
|
-
offsets.y += offsetParent.clientTop;
|
|
13570
|
-
} else if (documentElement) {
|
|
13571
|
-
offsets.x = getWindowScrollBarX(documentElement);
|
|
13572
|
-
}
|
|
13573
|
-
}
|
|
13574
|
-
return {
|
|
13575
|
-
x: rect.left + scroll.scrollLeft - offsets.x,
|
|
13576
|
-
y: rect.top + scroll.scrollTop - offsets.y,
|
|
13577
|
-
width: rect.width,
|
|
13578
|
-
height: rect.height
|
|
13579
|
-
};
|
|
13580
|
-
}
|
|
13581
|
-
function order(modifiers2) {
|
|
13582
|
-
var map2 = /* @__PURE__ */ new Map();
|
|
13583
|
-
var visited = /* @__PURE__ */ new Set();
|
|
13584
|
-
var result = [];
|
|
13585
|
-
modifiers2.forEach(function(modifier) {
|
|
13586
|
-
map2.set(modifier.name, modifier);
|
|
13587
|
-
});
|
|
13588
|
-
function sort(modifier) {
|
|
13589
|
-
visited.add(modifier.name);
|
|
13590
|
-
var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
|
|
13591
|
-
requires.forEach(function(dep) {
|
|
13592
|
-
if (!visited.has(dep)) {
|
|
13593
|
-
var depModifier = map2.get(dep);
|
|
13594
|
-
if (depModifier) {
|
|
13595
|
-
sort(depModifier);
|
|
13596
|
-
}
|
|
13597
|
-
}
|
|
13598
|
-
});
|
|
13599
|
-
result.push(modifier);
|
|
13600
|
-
}
|
|
13601
|
-
modifiers2.forEach(function(modifier) {
|
|
13602
|
-
if (!visited.has(modifier.name)) {
|
|
13603
|
-
sort(modifier);
|
|
13604
|
-
}
|
|
13605
|
-
});
|
|
13606
|
-
return result;
|
|
13607
|
-
}
|
|
13608
|
-
function orderModifiers(modifiers2) {
|
|
13609
|
-
var orderedModifiers = order(modifiers2);
|
|
13610
|
-
return modifierPhases.reduce(function(acc, phase) {
|
|
13611
|
-
return acc.concat(orderedModifiers.filter(function(modifier) {
|
|
13612
|
-
return modifier.phase === phase;
|
|
13613
|
-
}));
|
|
13614
|
-
}, []);
|
|
13615
|
-
}
|
|
13616
|
-
function debounce$2(fn2) {
|
|
13617
|
-
var pending;
|
|
13618
|
-
return function() {
|
|
13619
|
-
if (!pending) {
|
|
13620
|
-
pending = new Promise(function(resolve2) {
|
|
13621
|
-
Promise.resolve().then(function() {
|
|
13622
|
-
pending = void 0;
|
|
13623
|
-
resolve2(fn2());
|
|
13624
|
-
});
|
|
13625
|
-
});
|
|
13626
|
-
}
|
|
13627
|
-
return pending;
|
|
13628
|
-
};
|
|
13629
|
-
}
|
|
13630
|
-
function format(str) {
|
|
13631
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
13632
|
-
args[_key - 1] = arguments[_key];
|
|
13633
|
-
}
|
|
13634
|
-
return [].concat(args).reduce(function(p, c) {
|
|
13635
|
-
return p.replace(/%s/, c);
|
|
13636
|
-
}, str);
|
|
13637
|
-
}
|
|
13638
|
-
var INVALID_MODIFIER_ERROR = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s';
|
|
13639
|
-
var MISSING_DEPENDENCY_ERROR = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available';
|
|
13640
|
-
var VALID_PROPERTIES = ["name", "enabled", "phase", "fn", "effect", "requires", "options"];
|
|
13641
|
-
function validateModifiers(modifiers2) {
|
|
13642
|
-
modifiers2.forEach(function(modifier) {
|
|
13643
|
-
[].concat(Object.keys(modifier), VALID_PROPERTIES).filter(function(value, index, self2) {
|
|
13644
|
-
return self2.indexOf(value) === index;
|
|
13645
|
-
}).forEach(function(key) {
|
|
13646
|
-
switch (key) {
|
|
13647
|
-
case "name":
|
|
13648
|
-
if (typeof modifier.name !== "string") {
|
|
13649
|
-
console.error(format(INVALID_MODIFIER_ERROR, String(modifier.name), '"name"', '"string"', '"' + String(modifier.name) + '"'));
|
|
13650
|
-
}
|
|
13651
|
-
break;
|
|
13652
|
-
case "enabled":
|
|
13653
|
-
if (typeof modifier.enabled !== "boolean") {
|
|
13654
|
-
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', '"' + String(modifier.enabled) + '"'));
|
|
13655
|
-
}
|
|
13656
|
-
break;
|
|
13657
|
-
case "phase":
|
|
13658
|
-
if (modifierPhases.indexOf(modifier.phase) < 0) {
|
|
13659
|
-
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases.join(", "), '"' + String(modifier.phase) + '"'));
|
|
13660
|
-
}
|
|
13661
|
-
break;
|
|
13662
|
-
case "fn":
|
|
13663
|
-
if (typeof modifier.fn !== "function") {
|
|
13664
|
-
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"fn"', '"function"', '"' + String(modifier.fn) + '"'));
|
|
13665
|
-
}
|
|
13666
|
-
break;
|
|
13667
|
-
case "effect":
|
|
13668
|
-
if (modifier.effect != null && typeof modifier.effect !== "function") {
|
|
13669
|
-
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', '"' + String(modifier.fn) + '"'));
|
|
13670
|
-
}
|
|
13671
|
-
break;
|
|
13672
|
-
case "requires":
|
|
13673
|
-
if (modifier.requires != null && !Array.isArray(modifier.requires)) {
|
|
13674
|
-
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', '"' + String(modifier.requires) + '"'));
|
|
13675
|
-
}
|
|
13676
|
-
break;
|
|
13677
|
-
case "requiresIfExists":
|
|
13678
|
-
if (!Array.isArray(modifier.requiresIfExists)) {
|
|
13679
|
-
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requiresIfExists"', '"array"', '"' + String(modifier.requiresIfExists) + '"'));
|
|
13680
|
-
}
|
|
13681
|
-
break;
|
|
13682
|
-
case "options":
|
|
13683
|
-
case "data":
|
|
13684
|
-
break;
|
|
13685
|
-
default:
|
|
13686
|
-
console.error('PopperJS: an invalid property has been provided to the "' + modifier.name + '" modifier, valid properties are ' + VALID_PROPERTIES.map(function(s) {
|
|
13687
|
-
return '"' + s + '"';
|
|
13688
|
-
}).join(", ") + '; but "' + key + '" was provided.');
|
|
13689
|
-
}
|
|
13690
|
-
modifier.requires && modifier.requires.forEach(function(requirement) {
|
|
13691
|
-
if (modifiers2.find(function(mod) {
|
|
13692
|
-
return mod.name === requirement;
|
|
13693
|
-
}) == null) {
|
|
13694
|
-
console.error(format(MISSING_DEPENDENCY_ERROR, String(modifier.name), requirement, requirement));
|
|
13695
|
-
}
|
|
13696
|
-
});
|
|
13697
|
-
});
|
|
13698
|
-
});
|
|
13699
|
-
}
|
|
13700
|
-
function uniqueBy(arr, fn2) {
|
|
13701
|
-
var identifiers = /* @__PURE__ */ new Set();
|
|
13702
|
-
return arr.filter(function(item) {
|
|
13703
|
-
var identifier = fn2(item);
|
|
13704
|
-
if (!identifiers.has(identifier)) {
|
|
13705
|
-
identifiers.add(identifier);
|
|
13706
|
-
return true;
|
|
13707
|
-
}
|
|
13708
|
-
});
|
|
13709
|
-
}
|
|
13710
|
-
function mergeByName(modifiers2) {
|
|
13711
|
-
var merged = modifiers2.reduce(function(merged2, current) {
|
|
13712
|
-
var existing = merged2[current.name];
|
|
13713
|
-
merged2[current.name] = existing ? Object.assign({}, existing, current, {
|
|
13714
|
-
options: Object.assign({}, existing.options, current.options),
|
|
13715
|
-
data: Object.assign({}, existing.data, current.data)
|
|
13716
|
-
}) : current;
|
|
13717
|
-
return merged2;
|
|
13718
|
-
}, {});
|
|
13719
|
-
return Object.keys(merged).map(function(key) {
|
|
13720
|
-
return merged[key];
|
|
13721
|
-
});
|
|
13722
|
-
}
|
|
13723
|
-
var INVALID_ELEMENT_ERROR = "Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.";
|
|
13724
|
-
var INFINITE_LOOP_ERROR = "Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.";
|
|
13725
|
-
var DEFAULT_OPTIONS = {
|
|
13726
|
-
placement: "bottom",
|
|
13727
|
-
modifiers: [],
|
|
13728
|
-
strategy: "absolute"
|
|
13729
|
-
};
|
|
13730
|
-
function areValidElements() {
|
|
13731
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
13732
|
-
args[_key] = arguments[_key];
|
|
13733
|
-
}
|
|
13734
|
-
return !args.some(function(element) {
|
|
13735
|
-
return !(element && typeof element.getBoundingClientRect === "function");
|
|
13736
|
-
});
|
|
13737
|
-
}
|
|
13738
|
-
function popperGenerator(generatorOptions) {
|
|
13739
|
-
if (generatorOptions === void 0) {
|
|
13740
|
-
generatorOptions = {};
|
|
13741
|
-
}
|
|
13742
|
-
var _generatorOptions = generatorOptions, _generatorOptions$def = _generatorOptions.defaultModifiers, defaultModifiers2 = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, _generatorOptions$def2 = _generatorOptions.defaultOptions, defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
|
|
13743
|
-
return function createPopper2(reference2, popper2, options) {
|
|
13744
|
-
if (options === void 0) {
|
|
13745
|
-
options = defaultOptions;
|
|
13746
|
-
}
|
|
13747
|
-
var state = {
|
|
13748
|
-
placement: "bottom",
|
|
13749
|
-
orderedModifiers: [],
|
|
13750
|
-
options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
|
|
13751
|
-
modifiersData: {},
|
|
13752
|
-
elements: {
|
|
13753
|
-
reference: reference2,
|
|
13754
|
-
popper: popper2
|
|
13755
|
-
},
|
|
13756
|
-
attributes: {},
|
|
13757
|
-
styles: {}
|
|
13758
|
-
};
|
|
13759
|
-
var effectCleanupFns = [];
|
|
13760
|
-
var isDestroyed = false;
|
|
13761
|
-
var instance = {
|
|
13762
|
-
state,
|
|
13763
|
-
setOptions: function setOptions(setOptionsAction) {
|
|
13764
|
-
var options2 = typeof setOptionsAction === "function" ? setOptionsAction(state.options) : setOptionsAction;
|
|
13765
|
-
cleanupModifierEffects();
|
|
13766
|
-
state.options = Object.assign({}, defaultOptions, state.options, options2);
|
|
13767
|
-
state.scrollParents = {
|
|
13768
|
-
reference: isElement$1(reference2) ? listScrollParents(reference2) : reference2.contextElement ? listScrollParents(reference2.contextElement) : [],
|
|
13769
|
-
popper: listScrollParents(popper2)
|
|
13770
|
-
};
|
|
13771
|
-
var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers2, state.options.modifiers)));
|
|
13772
|
-
state.orderedModifiers = orderedModifiers.filter(function(m) {
|
|
13773
|
-
return m.enabled;
|
|
13774
|
-
});
|
|
13775
|
-
if (process.env.NODE_ENV !== "production") {
|
|
13776
|
-
var modifiers2 = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function(_ref) {
|
|
13777
|
-
var name = _ref.name;
|
|
13778
|
-
return name;
|
|
13779
|
-
});
|
|
13780
|
-
validateModifiers(modifiers2);
|
|
13781
|
-
if (getBasePlacement(state.options.placement) === auto) {
|
|
13782
|
-
var flipModifier = state.orderedModifiers.find(function(_ref2) {
|
|
13783
|
-
var name = _ref2.name;
|
|
13784
|
-
return name === "flip";
|
|
13785
|
-
});
|
|
13786
|
-
if (!flipModifier) {
|
|
13787
|
-
console.error(['Popper: "auto" placements require the "flip" modifier be', "present and enabled to work."].join(" "));
|
|
13788
|
-
}
|
|
13789
|
-
}
|
|
13790
|
-
var _getComputedStyle = getComputedStyle$1(popper2), marginTop = _getComputedStyle.marginTop, marginRight = _getComputedStyle.marginRight, marginBottom = _getComputedStyle.marginBottom, marginLeft = _getComputedStyle.marginLeft;
|
|
13791
|
-
if ([marginTop, marginRight, marginBottom, marginLeft].some(function(margin) {
|
|
13792
|
-
return parseFloat(margin);
|
|
13793
|
-
})) {
|
|
13794
|
-
console.warn(['Popper: CSS "margin" styles cannot be used to apply padding', "between the popper and its reference element or boundary.", "To replicate margin, use the `offset` modifier, as well as", "the `padding` option in the `preventOverflow` and `flip`", "modifiers."].join(" "));
|
|
13795
|
-
}
|
|
13796
|
-
}
|
|
13797
|
-
runModifierEffects();
|
|
13798
|
-
return instance.update();
|
|
13799
|
-
},
|
|
13800
|
-
forceUpdate: function forceUpdate() {
|
|
13801
|
-
if (isDestroyed) {
|
|
13802
|
-
return;
|
|
13803
|
-
}
|
|
13804
|
-
var _state$elements = state.elements, reference3 = _state$elements.reference, popper3 = _state$elements.popper;
|
|
13805
|
-
if (!areValidElements(reference3, popper3)) {
|
|
13806
|
-
if (process.env.NODE_ENV !== "production") {
|
|
13807
|
-
console.error(INVALID_ELEMENT_ERROR);
|
|
13808
|
-
}
|
|
13809
|
-
return;
|
|
13810
|
-
}
|
|
13811
|
-
state.rects = {
|
|
13812
|
-
reference: getCompositeRect(reference3, getOffsetParent(popper3), state.options.strategy === "fixed"),
|
|
13813
|
-
popper: getLayoutRect(popper3)
|
|
13814
|
-
};
|
|
13815
|
-
state.reset = false;
|
|
13816
|
-
state.placement = state.options.placement;
|
|
13817
|
-
state.orderedModifiers.forEach(function(modifier) {
|
|
13818
|
-
return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
|
|
13819
|
-
});
|
|
13820
|
-
var __debug_loops__ = 0;
|
|
13821
|
-
for (var index = 0; index < state.orderedModifiers.length; index++) {
|
|
13822
|
-
if (process.env.NODE_ENV !== "production") {
|
|
13823
|
-
__debug_loops__ += 1;
|
|
13824
|
-
if (__debug_loops__ > 100) {
|
|
13825
|
-
console.error(INFINITE_LOOP_ERROR);
|
|
13826
|
-
break;
|
|
13827
|
-
}
|
|
13828
|
-
}
|
|
13829
|
-
if (state.reset === true) {
|
|
13830
|
-
state.reset = false;
|
|
13831
|
-
index = -1;
|
|
13832
|
-
continue;
|
|
13833
|
-
}
|
|
13834
|
-
var _state$orderedModifie = state.orderedModifiers[index], fn2 = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name = _state$orderedModifie.name;
|
|
13835
|
-
if (typeof fn2 === "function") {
|
|
13836
|
-
state = fn2({
|
|
13837
|
-
state,
|
|
13838
|
-
options: _options,
|
|
13839
|
-
name,
|
|
13840
|
-
instance
|
|
13841
|
-
}) || state;
|
|
13842
|
-
}
|
|
13843
|
-
}
|
|
13844
|
-
},
|
|
13845
|
-
update: debounce$2(function() {
|
|
13846
|
-
return new Promise(function(resolve2) {
|
|
13847
|
-
instance.forceUpdate();
|
|
13848
|
-
resolve2(state);
|
|
13849
|
-
});
|
|
13850
|
-
}),
|
|
13851
|
-
destroy: function destroy() {
|
|
13852
|
-
cleanupModifierEffects();
|
|
13853
|
-
isDestroyed = true;
|
|
13854
|
-
}
|
|
13855
|
-
};
|
|
13856
|
-
if (!areValidElements(reference2, popper2)) {
|
|
13857
|
-
if (process.env.NODE_ENV !== "production") {
|
|
13858
|
-
console.error(INVALID_ELEMENT_ERROR);
|
|
13859
|
-
}
|
|
13860
|
-
return instance;
|
|
13861
|
-
}
|
|
13862
|
-
instance.setOptions(options).then(function(state2) {
|
|
13863
|
-
if (!isDestroyed && options.onFirstUpdate) {
|
|
13864
|
-
options.onFirstUpdate(state2);
|
|
13865
|
-
}
|
|
13866
|
-
});
|
|
13867
|
-
function runModifierEffects() {
|
|
13868
|
-
state.orderedModifiers.forEach(function(_ref3) {
|
|
13869
|
-
var name = _ref3.name, _ref3$options = _ref3.options, options2 = _ref3$options === void 0 ? {} : _ref3$options, effect2 = _ref3.effect;
|
|
13870
|
-
if (typeof effect2 === "function") {
|
|
13871
|
-
var cleanupFn = effect2({
|
|
13872
|
-
state,
|
|
13873
|
-
name,
|
|
13874
|
-
instance,
|
|
13875
|
-
options: options2
|
|
13876
|
-
});
|
|
13877
|
-
var noopFn = function noopFn2() {
|
|
13878
|
-
};
|
|
13879
|
-
effectCleanupFns.push(cleanupFn || noopFn);
|
|
13880
|
-
}
|
|
13881
|
-
});
|
|
13882
|
-
}
|
|
13883
|
-
function cleanupModifierEffects() {
|
|
13884
|
-
effectCleanupFns.forEach(function(fn2) {
|
|
13885
|
-
return fn2();
|
|
13886
|
-
});
|
|
13887
|
-
effectCleanupFns = [];
|
|
13888
|
-
}
|
|
13889
|
-
return instance;
|
|
13890
|
-
};
|
|
13891
|
-
}
|
|
13892
|
-
var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1];
|
|
13893
|
-
var createPopper = /* @__PURE__ */ popperGenerator({
|
|
13894
|
-
defaultModifiers
|
|
13895
|
-
});
|
|
13896
12439
|
class Editor extends Editor$1 {
|
|
13897
12440
|
constructor() {
|
|
13898
12441
|
super(...arguments);
|
|
@@ -14805,16 +13348,16 @@ var Leaf = /* @__PURE__ */ function(RopeSequence3) {
|
|
|
14805
13348
|
Leaf2.prototype.getInner = function getInner(i) {
|
|
14806
13349
|
return this.values[i];
|
|
14807
13350
|
};
|
|
14808
|
-
Leaf2.prototype.forEachInner = function forEachInner(f, from2, to,
|
|
13351
|
+
Leaf2.prototype.forEachInner = function forEachInner(f, from2, to, start) {
|
|
14809
13352
|
for (var i = from2; i < to; i++) {
|
|
14810
|
-
if (f(this.values[i],
|
|
13353
|
+
if (f(this.values[i], start + i) === false) {
|
|
14811
13354
|
return false;
|
|
14812
13355
|
}
|
|
14813
13356
|
}
|
|
14814
13357
|
};
|
|
14815
|
-
Leaf2.prototype.forEachInvertedInner = function forEachInvertedInner(f, from2, to,
|
|
13358
|
+
Leaf2.prototype.forEachInvertedInner = function forEachInvertedInner(f, from2, to, start) {
|
|
14816
13359
|
for (var i = from2 - 1; i >= to; i--) {
|
|
14817
|
-
if (f(this.values[i],
|
|
13360
|
+
if (f(this.values[i], start + i) === false) {
|
|
14818
13361
|
return false;
|
|
14819
13362
|
}
|
|
14820
13363
|
}
|
|
@@ -14840,12 +13383,12 @@ var Leaf = /* @__PURE__ */ function(RopeSequence3) {
|
|
|
14840
13383
|
}(RopeSequence);
|
|
14841
13384
|
RopeSequence.empty = new Leaf([]);
|
|
14842
13385
|
var Append = /* @__PURE__ */ function(RopeSequence3) {
|
|
14843
|
-
function Append2(
|
|
13386
|
+
function Append2(left, right) {
|
|
14844
13387
|
RopeSequence3.call(this);
|
|
14845
|
-
this.left =
|
|
14846
|
-
this.right =
|
|
14847
|
-
this.length =
|
|
14848
|
-
this.depth = Math.max(
|
|
13388
|
+
this.left = left;
|
|
13389
|
+
this.right = right;
|
|
13390
|
+
this.length = left.length + right.length;
|
|
13391
|
+
this.depth = Math.max(left.depth, right.depth) + 1;
|
|
14849
13392
|
}
|
|
14850
13393
|
if (RopeSequence3)
|
|
14851
13394
|
Append2.__proto__ = RopeSequence3;
|
|
@@ -14857,21 +13400,21 @@ var Append = /* @__PURE__ */ function(RopeSequence3) {
|
|
|
14857
13400
|
Append2.prototype.getInner = function getInner(i) {
|
|
14858
13401
|
return i < this.left.length ? this.left.get(i) : this.right.get(i - this.left.length);
|
|
14859
13402
|
};
|
|
14860
|
-
Append2.prototype.forEachInner = function forEachInner(f, from2, to,
|
|
13403
|
+
Append2.prototype.forEachInner = function forEachInner(f, from2, to, start) {
|
|
14861
13404
|
var leftLen = this.left.length;
|
|
14862
|
-
if (from2 < leftLen && this.left.forEachInner(f, from2, Math.min(to, leftLen),
|
|
13405
|
+
if (from2 < leftLen && this.left.forEachInner(f, from2, Math.min(to, leftLen), start) === false) {
|
|
14863
13406
|
return false;
|
|
14864
13407
|
}
|
|
14865
|
-
if (to > leftLen && this.right.forEachInner(f, Math.max(from2 - leftLen, 0), Math.min(this.length, to) - leftLen,
|
|
13408
|
+
if (to > leftLen && this.right.forEachInner(f, Math.max(from2 - leftLen, 0), Math.min(this.length, to) - leftLen, start + leftLen) === false) {
|
|
14866
13409
|
return false;
|
|
14867
13410
|
}
|
|
14868
13411
|
};
|
|
14869
|
-
Append2.prototype.forEachInvertedInner = function forEachInvertedInner(f, from2, to,
|
|
13412
|
+
Append2.prototype.forEachInvertedInner = function forEachInvertedInner(f, from2, to, start) {
|
|
14870
13413
|
var leftLen = this.left.length;
|
|
14871
|
-
if (from2 > leftLen && this.right.forEachInvertedInner(f, from2 - leftLen, Math.max(to, leftLen) - leftLen,
|
|
13414
|
+
if (from2 > leftLen && this.right.forEachInvertedInner(f, from2 - leftLen, Math.max(to, leftLen) - leftLen, start + leftLen) === false) {
|
|
14872
13415
|
return false;
|
|
14873
13416
|
}
|
|
14874
|
-
if (to < leftLen && this.left.forEachInvertedInner(f, Math.min(from2, leftLen), to,
|
|
13417
|
+
if (to < leftLen && this.left.forEachInvertedInner(f, Math.min(from2, leftLen), to, start) === false) {
|
|
14875
13418
|
return false;
|
|
14876
13419
|
}
|
|
14877
13420
|
};
|
|
@@ -14918,17 +13461,17 @@ class Branch {
|
|
|
14918
13461
|
popEvent(state, preserveItems) {
|
|
14919
13462
|
if (this.eventCount == 0)
|
|
14920
13463
|
return null;
|
|
14921
|
-
let
|
|
14922
|
-
for (; ;
|
|
14923
|
-
let next2 = this.items.get(
|
|
13464
|
+
let end = this.items.length;
|
|
13465
|
+
for (; ; end--) {
|
|
13466
|
+
let next2 = this.items.get(end - 1);
|
|
14924
13467
|
if (next2.selection) {
|
|
14925
|
-
--
|
|
13468
|
+
--end;
|
|
14926
13469
|
break;
|
|
14927
13470
|
}
|
|
14928
13471
|
}
|
|
14929
13472
|
let remap, mapFrom;
|
|
14930
13473
|
if (preserveItems) {
|
|
14931
|
-
remap = this.remapping(
|
|
13474
|
+
remap = this.remapping(end, this.items.length);
|
|
14932
13475
|
mapFrom = remap.maps.length;
|
|
14933
13476
|
}
|
|
14934
13477
|
let transform = state.tr;
|
|
@@ -14937,7 +13480,7 @@ class Branch {
|
|
|
14937
13480
|
this.items.forEach((item, i) => {
|
|
14938
13481
|
if (!item.step) {
|
|
14939
13482
|
if (!remap) {
|
|
14940
|
-
remap = this.remapping(
|
|
13483
|
+
remap = this.remapping(end, i + 1);
|
|
14941
13484
|
mapFrom = remap.maps.length;
|
|
14942
13485
|
}
|
|
14943
13486
|
mapFrom--;
|
|
@@ -14959,7 +13502,7 @@ class Branch {
|
|
|
14959
13502
|
}
|
|
14960
13503
|
if (item.selection) {
|
|
14961
13504
|
selection = remap ? item.selection.map(remap.slice(mapFrom)) : item.selection;
|
|
14962
|
-
remaining = new Branch(this.items.slice(0,
|
|
13505
|
+
remaining = new Branch(this.items.slice(0, end).append(addBefore.reverse().concat(addAfter)), this.eventCount - 1);
|
|
14963
13506
|
return false;
|
|
14964
13507
|
}
|
|
14965
13508
|
}, this.items.length, 0);
|
|
@@ -15009,14 +13552,14 @@ class Branch {
|
|
|
15009
13552
|
rebased(rebasedTransform, rebasedCount) {
|
|
15010
13553
|
if (!this.eventCount)
|
|
15011
13554
|
return this;
|
|
15012
|
-
let rebasedItems = [],
|
|
13555
|
+
let rebasedItems = [], start = Math.max(0, this.items.length - rebasedCount);
|
|
15013
13556
|
let mapping = rebasedTransform.mapping;
|
|
15014
13557
|
let newUntil = rebasedTransform.steps.length;
|
|
15015
13558
|
let eventCount = this.eventCount;
|
|
15016
13559
|
this.items.forEach((item) => {
|
|
15017
13560
|
if (item.selection)
|
|
15018
13561
|
eventCount--;
|
|
15019
|
-
},
|
|
13562
|
+
}, start);
|
|
15020
13563
|
let iRebased = rebasedCount;
|
|
15021
13564
|
this.items.forEach((item) => {
|
|
15022
13565
|
let pos = mapping.getMirror(--iRebased);
|
|
@@ -15033,11 +13576,11 @@ class Branch {
|
|
|
15033
13576
|
} else {
|
|
15034
13577
|
rebasedItems.push(new Item(map2));
|
|
15035
13578
|
}
|
|
15036
|
-
},
|
|
13579
|
+
}, start);
|
|
15037
13580
|
let newMaps = [];
|
|
15038
13581
|
for (let i = rebasedCount; i < newUntil; i++)
|
|
15039
13582
|
newMaps.push(new Item(mapping.maps[i]));
|
|
15040
|
-
let items = this.items.slice(0,
|
|
13583
|
+
let items = this.items.slice(0, start).append(newMaps).append(rebasedItems);
|
|
15041
13584
|
let branch = new Branch(items, eventCount);
|
|
15042
13585
|
if (branch.emptyItemCount() > max_empty_items)
|
|
15043
13586
|
branch = branch.compress(this.items.length - rebasedItems.length);
|
|
@@ -15146,9 +13689,9 @@ function isAdjacentTo(transform, prevRanges) {
|
|
|
15146
13689
|
if (!transform.docChanged)
|
|
15147
13690
|
return true;
|
|
15148
13691
|
let adjacent = false;
|
|
15149
|
-
transform.mapping.maps[0].forEach((
|
|
13692
|
+
transform.mapping.maps[0].forEach((start, end) => {
|
|
15150
13693
|
for (let i = 0; i < prevRanges.length; i += 2)
|
|
15151
|
-
if (
|
|
13694
|
+
if (start <= prevRanges[i + 1] && end >= prevRanges[i])
|
|
15152
13695
|
adjacent = true;
|
|
15153
13696
|
});
|
|
15154
13697
|
return adjacent;
|
|
@@ -16823,7 +15366,7 @@ function init$2() {
|
|
|
16823
15366
|
S_START.jd = makeAcceptingState(SYM);
|
|
16824
15367
|
return S_START;
|
|
16825
15368
|
}
|
|
16826
|
-
function run$1(
|
|
15369
|
+
function run$1(start, str) {
|
|
16827
15370
|
var iterable = stringToArray(str.replace(/[A-Z]/g, function(c) {
|
|
16828
15371
|
return c.toLowerCase();
|
|
16829
15372
|
}));
|
|
@@ -16832,7 +15375,7 @@ function run$1(start2, str) {
|
|
|
16832
15375
|
var cursor = 0;
|
|
16833
15376
|
var charCursor = 0;
|
|
16834
15377
|
while (charCursor < charCount) {
|
|
16835
|
-
var state =
|
|
15378
|
+
var state = start;
|
|
16836
15379
|
var nextState = null;
|
|
16837
15380
|
var tokenLength = 0;
|
|
16838
15381
|
var latestAccepting = null;
|
|
@@ -17209,13 +15752,13 @@ function init$1() {
|
|
|
17209
15752
|
makeT(S_LOCALPART_AT, LOCALHOST, S_EMAIL);
|
|
17210
15753
|
return S_START;
|
|
17211
15754
|
}
|
|
17212
|
-
function run(
|
|
15755
|
+
function run(start, input, tokens) {
|
|
17213
15756
|
var len = tokens.length;
|
|
17214
15757
|
var cursor = 0;
|
|
17215
15758
|
var multis = [];
|
|
17216
15759
|
var textTokens = [];
|
|
17217
15760
|
while (cursor < len) {
|
|
17218
|
-
var state =
|
|
15761
|
+
var state = start;
|
|
17219
15762
|
var secondState = null;
|
|
17220
15763
|
var nextState = null;
|
|
17221
15764
|
var multiLength = 0;
|
|
@@ -19743,11 +18286,11 @@ var FunctionPrototype$3 = Function.prototype;
|
|
|
19743
18286
|
var bind$3 = FunctionPrototype$3.bind;
|
|
19744
18287
|
var call$e = FunctionPrototype$3.call;
|
|
19745
18288
|
var uncurryThis$q = NATIVE_BIND$3 && bind$3.bind(call$e, call$e);
|
|
19746
|
-
var functionUncurryThis = NATIVE_BIND$3 ? function(
|
|
19747
|
-
return
|
|
19748
|
-
} : function(
|
|
19749
|
-
return
|
|
19750
|
-
return call$e.apply(
|
|
18289
|
+
var functionUncurryThis = NATIVE_BIND$3 ? function(fn) {
|
|
18290
|
+
return fn && uncurryThis$q(fn);
|
|
18291
|
+
} : function(fn) {
|
|
18292
|
+
return fn && function() {
|
|
18293
|
+
return call$e.apply(fn, arguments);
|
|
19751
18294
|
};
|
|
19752
18295
|
};
|
|
19753
18296
|
var $TypeError$b = TypeError;
|
|
@@ -19932,12 +18475,12 @@ var isCallable$f = isCallable$k;
|
|
|
19932
18475
|
var isObject$c = isObject$f;
|
|
19933
18476
|
var $TypeError$8 = TypeError;
|
|
19934
18477
|
var ordinaryToPrimitive$1 = function(input, pref) {
|
|
19935
|
-
var
|
|
19936
|
-
if (pref === "string" && isCallable$f(
|
|
18478
|
+
var fn, val;
|
|
18479
|
+
if (pref === "string" && isCallable$f(fn = input.toString) && !isObject$c(val = call$c(fn, input)))
|
|
19937
18480
|
return val;
|
|
19938
|
-
if (isCallable$f(
|
|
18481
|
+
if (isCallable$f(fn = input.valueOf) && !isObject$c(val = call$c(fn, input)))
|
|
19939
18482
|
return val;
|
|
19940
|
-
if (pref !== "string" && isCallable$f(
|
|
18483
|
+
if (pref !== "string" && isCallable$f(fn = input.toString) && !isObject$c(val = call$c(fn, input)))
|
|
19941
18484
|
return val;
|
|
19942
18485
|
throw $TypeError$8("Can't convert object to primitive value");
|
|
19943
18486
|
};
|
|
@@ -20296,10 +18839,10 @@ var uncurryThis$j = functionUncurryThis;
|
|
|
20296
18839
|
var aCallable$2 = aCallable$4;
|
|
20297
18840
|
var NATIVE_BIND$1 = functionBindNative;
|
|
20298
18841
|
var bind$2 = uncurryThis$j(uncurryThis$j.bind);
|
|
20299
|
-
var functionBindContext = function(
|
|
20300
|
-
aCallable$2(
|
|
20301
|
-
return that === void 0 ?
|
|
20302
|
-
return
|
|
18842
|
+
var functionBindContext = function(fn, that) {
|
|
18843
|
+
aCallable$2(fn);
|
|
18844
|
+
return that === void 0 ? fn : NATIVE_BIND$1 ? bind$2(fn, that) : function() {
|
|
18845
|
+
return fn.apply(that, arguments);
|
|
20303
18846
|
};
|
|
20304
18847
|
};
|
|
20305
18848
|
var uncurryThis$i = functionUncurryThis;
|
|
@@ -20324,9 +18867,9 @@ var toIntegerOrInfinity$4 = function(argument) {
|
|
|
20324
18867
|
return number !== number || number === 0 ? 0 : trunc2(number);
|
|
20325
18868
|
};
|
|
20326
18869
|
var toIntegerOrInfinity$3 = toIntegerOrInfinity$4;
|
|
20327
|
-
var min$
|
|
18870
|
+
var min$4 = Math.min;
|
|
20328
18871
|
var toLength$3 = function(argument) {
|
|
20329
|
-
return argument > 0 ? min$
|
|
18872
|
+
return argument > 0 ? min$4(toIntegerOrInfinity$3(argument), 9007199254740991) : 0;
|
|
20330
18873
|
};
|
|
20331
18874
|
var toLength$2 = toLength$3;
|
|
20332
18875
|
var lengthOfArrayLike$5 = function(obj) {
|
|
@@ -20541,11 +19084,11 @@ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$4 ? $getOwnPropertyDescriptor : f
|
|
|
20541
19084
|
};
|
|
20542
19085
|
var objectGetOwnPropertyNames = {};
|
|
20543
19086
|
var toIntegerOrInfinity$2 = toIntegerOrInfinity$4;
|
|
20544
|
-
var max$
|
|
20545
|
-
var min$
|
|
19087
|
+
var max$4 = Math.max;
|
|
19088
|
+
var min$3 = Math.min;
|
|
20546
19089
|
var toAbsoluteIndex$2 = function(index, length) {
|
|
20547
19090
|
var integer = toIntegerOrInfinity$2(index);
|
|
20548
|
-
return integer < 0 ? max$
|
|
19091
|
+
return integer < 0 ? max$4(integer + length, 0) : min$3(integer, length);
|
|
20549
19092
|
};
|
|
20550
19093
|
var toIndexedObject$4 = toIndexedObject$6;
|
|
20551
19094
|
var toAbsoluteIndex$1 = toAbsoluteIndex$2;
|
|
@@ -21249,12 +19792,12 @@ var toAbsoluteIndex = toAbsoluteIndex$2;
|
|
|
21249
19792
|
var lengthOfArrayLike$2 = lengthOfArrayLike$5;
|
|
21250
19793
|
var createProperty = createProperty$1;
|
|
21251
19794
|
var $Array = Array;
|
|
21252
|
-
var max$
|
|
21253
|
-
var arraySliceSimple = function(O,
|
|
19795
|
+
var max$3 = Math.max;
|
|
19796
|
+
var arraySliceSimple = function(O, start, end) {
|
|
21254
19797
|
var length = lengthOfArrayLike$2(O);
|
|
21255
|
-
var k = toAbsoluteIndex(
|
|
21256
|
-
var fin = toAbsoluteIndex(
|
|
21257
|
-
var result = $Array(max$
|
|
19798
|
+
var k = toAbsoluteIndex(start, length);
|
|
19799
|
+
var fin = toAbsoluteIndex(end === void 0 ? length : end, length);
|
|
19800
|
+
var result = $Array(max$3(fin - k, 0));
|
|
21258
19801
|
for (var n = 0; k < fin; k++, n++)
|
|
21259
19802
|
createProperty(result, n, O[k]);
|
|
21260
19803
|
result.length = n;
|
|
@@ -21454,7 +19997,7 @@ var iterate$2 = function(iterable, unboundFunction, options) {
|
|
|
21454
19997
|
var AS_ENTRIES = !!(options && options.AS_ENTRIES);
|
|
21455
19998
|
var IS_ITERATOR = !!(options && options.IS_ITERATOR);
|
|
21456
19999
|
var INTERRUPTED = !!(options && options.INTERRUPTED);
|
|
21457
|
-
var
|
|
20000
|
+
var fn = bind(unboundFunction, that);
|
|
21458
20001
|
var iterator, iterFn, index, length, result, next2, step;
|
|
21459
20002
|
var stop = function(condition) {
|
|
21460
20003
|
if (iterator)
|
|
@@ -21464,9 +20007,9 @@ var iterate$2 = function(iterable, unboundFunction, options) {
|
|
|
21464
20007
|
var callFn = function(value) {
|
|
21465
20008
|
if (AS_ENTRIES) {
|
|
21466
20009
|
anObject$5(value);
|
|
21467
|
-
return INTERRUPTED ?
|
|
20010
|
+
return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
|
|
21468
20011
|
}
|
|
21469
|
-
return INTERRUPTED ?
|
|
20012
|
+
return INTERRUPTED ? fn(value, stop) : fn(value);
|
|
21470
20013
|
};
|
|
21471
20014
|
if (IS_ITERATOR) {
|
|
21472
20015
|
iterator = iterable;
|
|
@@ -22407,8 +20950,8 @@ var DOMRectReadOnly = function() {
|
|
|
22407
20950
|
return freeze(this);
|
|
22408
20951
|
}
|
|
22409
20952
|
DOMRectReadOnly2.prototype.toJSON = function() {
|
|
22410
|
-
var _a = this, x = _a.x, y = _a.y,
|
|
22411
|
-
return { x, y, top
|
|
20953
|
+
var _a = this, x = _a.x, y = _a.y, top = _a.top, right = _a.right, bottom = _a.bottom, left = _a.left, width = _a.width, height = _a.height;
|
|
20954
|
+
return { x, y, top, right, bottom, left, width, height };
|
|
22412
20955
|
};
|
|
22413
20956
|
DOMRectReadOnly2.fromRect = function(rectangle) {
|
|
22414
20957
|
return new DOMRectReadOnly2(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
|
|
@@ -22426,7 +20969,7 @@ var isHidden = function(target) {
|
|
|
22426
20969
|
var _b = target, offsetWidth = _b.offsetWidth, offsetHeight = _b.offsetHeight;
|
|
22427
20970
|
return !(offsetWidth || offsetHeight || target.getClientRects().length);
|
|
22428
20971
|
};
|
|
22429
|
-
var isElement = function(obj) {
|
|
20972
|
+
var isElement$1 = function(obj) {
|
|
22430
20973
|
var _a, _b;
|
|
22431
20974
|
if (obj instanceof Element) {
|
|
22432
20975
|
return true;
|
|
@@ -22826,7 +21369,7 @@ var ResizeObserverController = function() {
|
|
|
22826
21369
|
};
|
|
22827
21370
|
return ResizeObserverController2;
|
|
22828
21371
|
}();
|
|
22829
|
-
var ResizeObserver = function() {
|
|
21372
|
+
var ResizeObserver$1 = function() {
|
|
22830
21373
|
function ResizeObserver2(callback) {
|
|
22831
21374
|
if (arguments.length === 0) {
|
|
22832
21375
|
throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");
|
|
@@ -22840,7 +21383,7 @@ var ResizeObserver = function() {
|
|
|
22840
21383
|
if (arguments.length === 0) {
|
|
22841
21384
|
throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");
|
|
22842
21385
|
}
|
|
22843
|
-
if (!isElement(target)) {
|
|
21386
|
+
if (!isElement$1(target)) {
|
|
22844
21387
|
throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");
|
|
22845
21388
|
}
|
|
22846
21389
|
ResizeObserverController.observe(this, target, options);
|
|
@@ -22849,7 +21392,7 @@ var ResizeObserver = function() {
|
|
|
22849
21392
|
if (arguments.length === 0) {
|
|
22850
21393
|
throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");
|
|
22851
21394
|
}
|
|
22852
|
-
if (!isElement(target)) {
|
|
21395
|
+
if (!isElement$1(target)) {
|
|
22853
21396
|
throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");
|
|
22854
21397
|
}
|
|
22855
21398
|
ResizeObserverController.unobserve(this, target);
|
|
@@ -23280,8 +21823,8 @@ var getSubstitution = getSubstitution$1;
|
|
|
23280
21823
|
var regExpExec = regexpExecAbstract;
|
|
23281
21824
|
var wellKnownSymbol = wellKnownSymbol$f;
|
|
23282
21825
|
var REPLACE = wellKnownSymbol("replace");
|
|
23283
|
-
var max = Math.max;
|
|
23284
|
-
var min = Math.min;
|
|
21826
|
+
var max$2 = Math.max;
|
|
21827
|
+
var min$2 = Math.min;
|
|
23285
21828
|
var concat = uncurryThis([].concat);
|
|
23286
21829
|
var push = uncurryThis([].push);
|
|
23287
21830
|
var stringIndexOf = uncurryThis("".indexOf);
|
|
@@ -23348,7 +21891,7 @@ fixRegExpWellKnownSymbolLogic("replace", function(_, nativeReplace2, maybeCallNa
|
|
|
23348
21891
|
for (var i = 0; i < results.length; i++) {
|
|
23349
21892
|
result = results[i];
|
|
23350
21893
|
var matched = toString4(result[0]);
|
|
23351
|
-
var position = max(min(toIntegerOrInfinity(result.index), S.length), 0);
|
|
21894
|
+
var position = max$2(min$2(toIntegerOrInfinity(result.index), S.length), 0);
|
|
23352
21895
|
var captures = [];
|
|
23353
21896
|
for (var j = 1; j < result.length; j++)
|
|
23354
21897
|
push(captures, maybeToString(result[j]));
|
|
@@ -23751,7 +22294,7 @@ var SimpleBar = /* @__PURE__ */ function() {
|
|
|
23751
22294
|
this.contentWrapperEl.addEventListener("scroll", this.onScroll);
|
|
23752
22295
|
elWindow.addEventListener("resize", this.onWindowResize);
|
|
23753
22296
|
var resizeObserverStarted = false;
|
|
23754
|
-
var resizeObserver = elWindow.ResizeObserver || ResizeObserver;
|
|
22297
|
+
var resizeObserver = elWindow.ResizeObserver || ResizeObserver$1;
|
|
23755
22298
|
this.resizeObserver = new resizeObserver(function() {
|
|
23756
22299
|
if (!resizeObserverStarted)
|
|
23757
22300
|
return;
|
|
@@ -24102,110 +22645,1014 @@ SimpleBar.handleMutations = function(mutations) {
|
|
|
24102
22645
|
});
|
|
24103
22646
|
}
|
|
24104
22647
|
}
|
|
24105
|
-
});
|
|
24106
|
-
});
|
|
22648
|
+
});
|
|
22649
|
+
});
|
|
22650
|
+
};
|
|
22651
|
+
SimpleBar.getOptions = getOptions;
|
|
22652
|
+
if (canUseDom) {
|
|
22653
|
+
SimpleBar.initHtmlApi();
|
|
22654
|
+
}
|
|
22655
|
+
function useValidator({ validations }) {
|
|
22656
|
+
const error = ref(null);
|
|
22657
|
+
function validate() {
|
|
22658
|
+
for (const validate2 of validations) {
|
|
22659
|
+
const validationError = validate2();
|
|
22660
|
+
if (validationError) {
|
|
22661
|
+
return error.value = validationError;
|
|
22662
|
+
}
|
|
22663
|
+
error.value = null;
|
|
22664
|
+
}
|
|
22665
|
+
}
|
|
22666
|
+
function reset() {
|
|
22667
|
+
error.value = null;
|
|
22668
|
+
}
|
|
22669
|
+
return { error, validate, reset };
|
|
22670
|
+
}
|
|
22671
|
+
const noFormatter = (value) => value;
|
|
22672
|
+
function useTempValue({ valueRef, format = noFormatter }) {
|
|
22673
|
+
const tempValue = ref(format(valueRef.value));
|
|
22674
|
+
watch(valueRef, () => tempValue.value = format(valueRef.value));
|
|
22675
|
+
return tempValue;
|
|
22676
|
+
}
|
|
22677
|
+
function useElementRef(ref2) {
|
|
22678
|
+
return computed(() => {
|
|
22679
|
+
var _a;
|
|
22680
|
+
return ((_a = ref2.value) == null ? void 0 : _a.$el) || ref2.value;
|
|
22681
|
+
});
|
|
22682
|
+
}
|
|
22683
|
+
function useNumberValue({ valueRef, digits, min: min2, max: max2, onChange }) {
|
|
22684
|
+
function format(number) {
|
|
22685
|
+
return Number(parseFloat(number).toFixed(digits));
|
|
22686
|
+
}
|
|
22687
|
+
const temp = useTempValue({ valueRef, format });
|
|
22688
|
+
function validateNumber(number) {
|
|
22689
|
+
if (min2 !== null && number < min2)
|
|
22690
|
+
return min2;
|
|
22691
|
+
if (max2 !== null && number > max2)
|
|
22692
|
+
return max2;
|
|
22693
|
+
return number;
|
|
22694
|
+
}
|
|
22695
|
+
function change(value) {
|
|
22696
|
+
temp.value = value;
|
|
22697
|
+
if (temp.value === "") {
|
|
22698
|
+
temp.value = min2 != null ? min2 : 1;
|
|
22699
|
+
}
|
|
22700
|
+
const numericValue = Number.parseFloat(temp.value);
|
|
22701
|
+
const validatedNumber = validateNumber(numericValue);
|
|
22702
|
+
temp.value = format(validatedNumber);
|
|
22703
|
+
onChange(temp.value);
|
|
22704
|
+
}
|
|
22705
|
+
function increment(step) {
|
|
22706
|
+
const newValue = temp.value + Number(step);
|
|
22707
|
+
const validatedNumber = validateNumber(newValue);
|
|
22708
|
+
temp.value = format(validatedNumber);
|
|
22709
|
+
onChange(temp.value);
|
|
22710
|
+
}
|
|
22711
|
+
function decrement(step) {
|
|
22712
|
+
const newValue = temp.value - Number(step);
|
|
22713
|
+
const validatedNumber = validateNumber(newValue);
|
|
22714
|
+
temp.value = format(validatedNumber);
|
|
22715
|
+
onChange(temp.value);
|
|
22716
|
+
}
|
|
22717
|
+
return {
|
|
22718
|
+
temp,
|
|
22719
|
+
change,
|
|
22720
|
+
increment,
|
|
22721
|
+
decrement
|
|
22722
|
+
};
|
|
22723
|
+
}
|
|
22724
|
+
function getSide(placement) {
|
|
22725
|
+
return placement.split("-")[0];
|
|
22726
|
+
}
|
|
22727
|
+
function getAlignment(placement) {
|
|
22728
|
+
return placement.split("-")[1];
|
|
22729
|
+
}
|
|
22730
|
+
function getMainAxisFromPlacement(placement) {
|
|
22731
|
+
return ["top", "bottom"].includes(getSide(placement)) ? "x" : "y";
|
|
22732
|
+
}
|
|
22733
|
+
function getLengthFromAxis(axis) {
|
|
22734
|
+
return axis === "y" ? "height" : "width";
|
|
22735
|
+
}
|
|
22736
|
+
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
22737
|
+
let {
|
|
22738
|
+
reference,
|
|
22739
|
+
floating
|
|
22740
|
+
} = _ref;
|
|
22741
|
+
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
|
22742
|
+
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
|
22743
|
+
const mainAxis = getMainAxisFromPlacement(placement);
|
|
22744
|
+
const length = getLengthFromAxis(mainAxis);
|
|
22745
|
+
const commonAlign = reference[length] / 2 - floating[length] / 2;
|
|
22746
|
+
const side = getSide(placement);
|
|
22747
|
+
const isVertical = mainAxis === "x";
|
|
22748
|
+
let coords;
|
|
22749
|
+
switch (side) {
|
|
22750
|
+
case "top":
|
|
22751
|
+
coords = {
|
|
22752
|
+
x: commonX,
|
|
22753
|
+
y: reference.y - floating.height
|
|
22754
|
+
};
|
|
22755
|
+
break;
|
|
22756
|
+
case "bottom":
|
|
22757
|
+
coords = {
|
|
22758
|
+
x: commonX,
|
|
22759
|
+
y: reference.y + reference.height
|
|
22760
|
+
};
|
|
22761
|
+
break;
|
|
22762
|
+
case "right":
|
|
22763
|
+
coords = {
|
|
22764
|
+
x: reference.x + reference.width,
|
|
22765
|
+
y: commonY
|
|
22766
|
+
};
|
|
22767
|
+
break;
|
|
22768
|
+
case "left":
|
|
22769
|
+
coords = {
|
|
22770
|
+
x: reference.x - floating.width,
|
|
22771
|
+
y: commonY
|
|
22772
|
+
};
|
|
22773
|
+
break;
|
|
22774
|
+
default:
|
|
22775
|
+
coords = {
|
|
22776
|
+
x: reference.x,
|
|
22777
|
+
y: reference.y
|
|
22778
|
+
};
|
|
22779
|
+
}
|
|
22780
|
+
switch (getAlignment(placement)) {
|
|
22781
|
+
case "start":
|
|
22782
|
+
coords[mainAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
|
|
22783
|
+
break;
|
|
22784
|
+
case "end":
|
|
22785
|
+
coords[mainAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
|
22786
|
+
break;
|
|
22787
|
+
}
|
|
22788
|
+
return coords;
|
|
22789
|
+
}
|
|
22790
|
+
const computePosition$1 = async (reference, floating, config) => {
|
|
22791
|
+
const {
|
|
22792
|
+
placement = "bottom",
|
|
22793
|
+
strategy = "absolute",
|
|
22794
|
+
middleware = [],
|
|
22795
|
+
platform: platform2
|
|
22796
|
+
} = config;
|
|
22797
|
+
const validMiddleware = middleware.filter(Boolean);
|
|
22798
|
+
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating));
|
|
22799
|
+
if (process.env.NODE_ENV !== "production") {
|
|
22800
|
+
if (platform2 == null) {
|
|
22801
|
+
console.error(["Floating UI: `platform` property was not passed to config. If you", "want to use Floating UI on the web, install @floating-ui/dom", "instead of the /core package. Otherwise, you can create your own", "`platform`: https://floating-ui.com/docs/platform"].join(" "));
|
|
22802
|
+
}
|
|
22803
|
+
if (validMiddleware.filter((_ref) => {
|
|
22804
|
+
let {
|
|
22805
|
+
name
|
|
22806
|
+
} = _ref;
|
|
22807
|
+
return name === "autoPlacement" || name === "flip";
|
|
22808
|
+
}).length > 1) {
|
|
22809
|
+
throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware", "detected. This will lead to an infinite loop. Ensure only one of", "either has been passed to the `middleware` array."].join(" "));
|
|
22810
|
+
}
|
|
22811
|
+
if (!reference || !floating) {
|
|
22812
|
+
console.error(["Floating UI: The reference and/or floating element was not defined", "when `computePosition()` was called. Ensure that both elements have", "been created and can be measured."].join(" "));
|
|
22813
|
+
}
|
|
22814
|
+
}
|
|
22815
|
+
let rects = await platform2.getElementRects({
|
|
22816
|
+
reference,
|
|
22817
|
+
floating,
|
|
22818
|
+
strategy
|
|
22819
|
+
});
|
|
22820
|
+
let {
|
|
22821
|
+
x,
|
|
22822
|
+
y
|
|
22823
|
+
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
22824
|
+
let statefulPlacement = placement;
|
|
22825
|
+
let middlewareData = {};
|
|
22826
|
+
let resetCount = 0;
|
|
22827
|
+
for (let i = 0; i < validMiddleware.length; i++) {
|
|
22828
|
+
const {
|
|
22829
|
+
name,
|
|
22830
|
+
fn
|
|
22831
|
+
} = validMiddleware[i];
|
|
22832
|
+
const {
|
|
22833
|
+
x: nextX,
|
|
22834
|
+
y: nextY,
|
|
22835
|
+
data: data2,
|
|
22836
|
+
reset
|
|
22837
|
+
} = await fn({
|
|
22838
|
+
x,
|
|
22839
|
+
y,
|
|
22840
|
+
initialPlacement: placement,
|
|
22841
|
+
placement: statefulPlacement,
|
|
22842
|
+
strategy,
|
|
22843
|
+
middlewareData,
|
|
22844
|
+
rects,
|
|
22845
|
+
platform: platform2,
|
|
22846
|
+
elements: {
|
|
22847
|
+
reference,
|
|
22848
|
+
floating
|
|
22849
|
+
}
|
|
22850
|
+
});
|
|
22851
|
+
x = nextX != null ? nextX : x;
|
|
22852
|
+
y = nextY != null ? nextY : y;
|
|
22853
|
+
middlewareData = {
|
|
22854
|
+
...middlewareData,
|
|
22855
|
+
[name]: {
|
|
22856
|
+
...middlewareData[name],
|
|
22857
|
+
...data2
|
|
22858
|
+
}
|
|
22859
|
+
};
|
|
22860
|
+
if (process.env.NODE_ENV !== "production") {
|
|
22861
|
+
if (resetCount > 50) {
|
|
22862
|
+
console.warn(["Floating UI: The middleware lifecycle appears to be running in an", "infinite loop. This is usually caused by a `reset` continually", "being returned without a break condition."].join(" "));
|
|
22863
|
+
}
|
|
22864
|
+
}
|
|
22865
|
+
if (reset && resetCount <= 50) {
|
|
22866
|
+
resetCount++;
|
|
22867
|
+
if (typeof reset === "object") {
|
|
22868
|
+
if (reset.placement) {
|
|
22869
|
+
statefulPlacement = reset.placement;
|
|
22870
|
+
}
|
|
22871
|
+
if (reset.rects) {
|
|
22872
|
+
rects = reset.rects === true ? await platform2.getElementRects({
|
|
22873
|
+
reference,
|
|
22874
|
+
floating,
|
|
22875
|
+
strategy
|
|
22876
|
+
}) : reset.rects;
|
|
22877
|
+
}
|
|
22878
|
+
({
|
|
22879
|
+
x,
|
|
22880
|
+
y
|
|
22881
|
+
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
22882
|
+
}
|
|
22883
|
+
i = -1;
|
|
22884
|
+
continue;
|
|
22885
|
+
}
|
|
22886
|
+
}
|
|
22887
|
+
return {
|
|
22888
|
+
x,
|
|
22889
|
+
y,
|
|
22890
|
+
placement: statefulPlacement,
|
|
22891
|
+
strategy,
|
|
22892
|
+
middlewareData
|
|
22893
|
+
};
|
|
22894
|
+
};
|
|
22895
|
+
function expandPaddingObject(padding) {
|
|
22896
|
+
return {
|
|
22897
|
+
top: 0,
|
|
22898
|
+
right: 0,
|
|
22899
|
+
bottom: 0,
|
|
22900
|
+
left: 0,
|
|
22901
|
+
...padding
|
|
22902
|
+
};
|
|
22903
|
+
}
|
|
22904
|
+
function getSideObjectFromPadding(padding) {
|
|
22905
|
+
return typeof padding !== "number" ? expandPaddingObject(padding) : {
|
|
22906
|
+
top: padding,
|
|
22907
|
+
right: padding,
|
|
22908
|
+
bottom: padding,
|
|
22909
|
+
left: padding
|
|
22910
|
+
};
|
|
22911
|
+
}
|
|
22912
|
+
function rectToClientRect(rect) {
|
|
22913
|
+
return {
|
|
22914
|
+
...rect,
|
|
22915
|
+
top: rect.y,
|
|
22916
|
+
left: rect.x,
|
|
22917
|
+
right: rect.x + rect.width,
|
|
22918
|
+
bottom: rect.y + rect.height
|
|
22919
|
+
};
|
|
22920
|
+
}
|
|
22921
|
+
async function detectOverflow(middlewareArguments, options) {
|
|
22922
|
+
var _await$platform$isEle;
|
|
22923
|
+
if (options === void 0) {
|
|
22924
|
+
options = {};
|
|
22925
|
+
}
|
|
22926
|
+
const {
|
|
22927
|
+
x,
|
|
22928
|
+
y,
|
|
22929
|
+
platform: platform2,
|
|
22930
|
+
rects,
|
|
22931
|
+
elements,
|
|
22932
|
+
strategy
|
|
22933
|
+
} = middlewareArguments;
|
|
22934
|
+
const {
|
|
22935
|
+
boundary = "clippingAncestors",
|
|
22936
|
+
rootBoundary = "viewport",
|
|
22937
|
+
elementContext = "floating",
|
|
22938
|
+
altBoundary = false,
|
|
22939
|
+
padding = 0
|
|
22940
|
+
} = options;
|
|
22941
|
+
const paddingObject = getSideObjectFromPadding(padding);
|
|
22942
|
+
const altContext = elementContext === "floating" ? "reference" : "floating";
|
|
22943
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
22944
|
+
const clippingClientRect = rectToClientRect(await platform2.getClippingRect({
|
|
22945
|
+
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)),
|
|
22946
|
+
boundary,
|
|
22947
|
+
rootBoundary,
|
|
22948
|
+
strategy
|
|
22949
|
+
}));
|
|
22950
|
+
const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
22951
|
+
rect: elementContext === "floating" ? {
|
|
22952
|
+
...rects.floating,
|
|
22953
|
+
x,
|
|
22954
|
+
y
|
|
22955
|
+
} : rects.reference,
|
|
22956
|
+
offsetParent: await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating)),
|
|
22957
|
+
strategy
|
|
22958
|
+
}) : rects[elementContext]);
|
|
22959
|
+
return {
|
|
22960
|
+
top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
|
|
22961
|
+
bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
|
|
22962
|
+
left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
|
|
22963
|
+
right: elementClientRect.right - clippingClientRect.right + paddingObject.right
|
|
22964
|
+
};
|
|
22965
|
+
}
|
|
22966
|
+
const min$1 = Math.min;
|
|
22967
|
+
const max$1 = Math.max;
|
|
22968
|
+
function within(min$1$1, value, max$1$1) {
|
|
22969
|
+
return max$1(min$1$1, min$1(value, max$1$1));
|
|
22970
|
+
}
|
|
22971
|
+
async function convertValueToCoords(middlewareArguments, value) {
|
|
22972
|
+
const {
|
|
22973
|
+
placement,
|
|
22974
|
+
platform: platform2,
|
|
22975
|
+
elements
|
|
22976
|
+
} = middlewareArguments;
|
|
22977
|
+
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
|
|
22978
|
+
const side = getSide(placement);
|
|
22979
|
+
const alignment = getAlignment(placement);
|
|
22980
|
+
const isVertical = getMainAxisFromPlacement(placement) === "x";
|
|
22981
|
+
const mainAxisMulti = ["left", "top"].includes(side) ? -1 : 1;
|
|
22982
|
+
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
22983
|
+
const rawValue = typeof value === "function" ? value(middlewareArguments) : value;
|
|
22984
|
+
let {
|
|
22985
|
+
mainAxis,
|
|
22986
|
+
crossAxis,
|
|
22987
|
+
alignmentAxis
|
|
22988
|
+
} = typeof rawValue === "number" ? {
|
|
22989
|
+
mainAxis: rawValue,
|
|
22990
|
+
crossAxis: 0,
|
|
22991
|
+
alignmentAxis: null
|
|
22992
|
+
} : {
|
|
22993
|
+
mainAxis: 0,
|
|
22994
|
+
crossAxis: 0,
|
|
22995
|
+
alignmentAxis: null,
|
|
22996
|
+
...rawValue
|
|
22997
|
+
};
|
|
22998
|
+
if (alignment && typeof alignmentAxis === "number") {
|
|
22999
|
+
crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
|
|
23000
|
+
}
|
|
23001
|
+
return isVertical ? {
|
|
23002
|
+
x: crossAxis * crossAxisMulti,
|
|
23003
|
+
y: mainAxis * mainAxisMulti
|
|
23004
|
+
} : {
|
|
23005
|
+
x: mainAxis * mainAxisMulti,
|
|
23006
|
+
y: crossAxis * crossAxisMulti
|
|
23007
|
+
};
|
|
23008
|
+
}
|
|
23009
|
+
const offset = function(value) {
|
|
23010
|
+
if (value === void 0) {
|
|
23011
|
+
value = 0;
|
|
23012
|
+
}
|
|
23013
|
+
return {
|
|
23014
|
+
name: "offset",
|
|
23015
|
+
options: value,
|
|
23016
|
+
async fn(middlewareArguments) {
|
|
23017
|
+
const {
|
|
23018
|
+
x,
|
|
23019
|
+
y
|
|
23020
|
+
} = middlewareArguments;
|
|
23021
|
+
const diffCoords = await convertValueToCoords(middlewareArguments, value);
|
|
23022
|
+
return {
|
|
23023
|
+
x: x + diffCoords.x,
|
|
23024
|
+
y: y + diffCoords.y,
|
|
23025
|
+
data: diffCoords
|
|
23026
|
+
};
|
|
23027
|
+
}
|
|
23028
|
+
};
|
|
23029
|
+
};
|
|
23030
|
+
function getCrossAxis(axis) {
|
|
23031
|
+
return axis === "x" ? "y" : "x";
|
|
23032
|
+
}
|
|
23033
|
+
const shift = function(options) {
|
|
23034
|
+
if (options === void 0) {
|
|
23035
|
+
options = {};
|
|
23036
|
+
}
|
|
23037
|
+
return {
|
|
23038
|
+
name: "shift",
|
|
23039
|
+
options,
|
|
23040
|
+
async fn(middlewareArguments) {
|
|
23041
|
+
const {
|
|
23042
|
+
x,
|
|
23043
|
+
y,
|
|
23044
|
+
placement
|
|
23045
|
+
} = middlewareArguments;
|
|
23046
|
+
const {
|
|
23047
|
+
mainAxis: checkMainAxis = true,
|
|
23048
|
+
crossAxis: checkCrossAxis = false,
|
|
23049
|
+
limiter = {
|
|
23050
|
+
fn: (_ref) => {
|
|
23051
|
+
let {
|
|
23052
|
+
x: x2,
|
|
23053
|
+
y: y2
|
|
23054
|
+
} = _ref;
|
|
23055
|
+
return {
|
|
23056
|
+
x: x2,
|
|
23057
|
+
y: y2
|
|
23058
|
+
};
|
|
23059
|
+
}
|
|
23060
|
+
},
|
|
23061
|
+
...detectOverflowOptions
|
|
23062
|
+
} = options;
|
|
23063
|
+
const coords = {
|
|
23064
|
+
x,
|
|
23065
|
+
y
|
|
23066
|
+
};
|
|
23067
|
+
const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
|
|
23068
|
+
const mainAxis = getMainAxisFromPlacement(getSide(placement));
|
|
23069
|
+
const crossAxis = getCrossAxis(mainAxis);
|
|
23070
|
+
let mainAxisCoord = coords[mainAxis];
|
|
23071
|
+
let crossAxisCoord = coords[crossAxis];
|
|
23072
|
+
if (checkMainAxis) {
|
|
23073
|
+
const minSide = mainAxis === "y" ? "top" : "left";
|
|
23074
|
+
const maxSide = mainAxis === "y" ? "bottom" : "right";
|
|
23075
|
+
const min2 = mainAxisCoord + overflow[minSide];
|
|
23076
|
+
const max2 = mainAxisCoord - overflow[maxSide];
|
|
23077
|
+
mainAxisCoord = within(min2, mainAxisCoord, max2);
|
|
23078
|
+
}
|
|
23079
|
+
if (checkCrossAxis) {
|
|
23080
|
+
const minSide = crossAxis === "y" ? "top" : "left";
|
|
23081
|
+
const maxSide = crossAxis === "y" ? "bottom" : "right";
|
|
23082
|
+
const min2 = crossAxisCoord + overflow[minSide];
|
|
23083
|
+
const max2 = crossAxisCoord - overflow[maxSide];
|
|
23084
|
+
crossAxisCoord = within(min2, crossAxisCoord, max2);
|
|
23085
|
+
}
|
|
23086
|
+
const limitedCoords = limiter.fn({
|
|
23087
|
+
...middlewareArguments,
|
|
23088
|
+
[mainAxis]: mainAxisCoord,
|
|
23089
|
+
[crossAxis]: crossAxisCoord
|
|
23090
|
+
});
|
|
23091
|
+
return {
|
|
23092
|
+
...limitedCoords,
|
|
23093
|
+
data: {
|
|
23094
|
+
x: limitedCoords.x - x,
|
|
23095
|
+
y: limitedCoords.y - y
|
|
23096
|
+
}
|
|
23097
|
+
};
|
|
23098
|
+
}
|
|
23099
|
+
};
|
|
23100
|
+
};
|
|
23101
|
+
const limitShift = function(options) {
|
|
23102
|
+
if (options === void 0) {
|
|
23103
|
+
options = {};
|
|
23104
|
+
}
|
|
23105
|
+
return {
|
|
23106
|
+
options,
|
|
23107
|
+
fn(middlewareArguments) {
|
|
23108
|
+
const {
|
|
23109
|
+
x,
|
|
23110
|
+
y,
|
|
23111
|
+
placement,
|
|
23112
|
+
rects,
|
|
23113
|
+
middlewareData
|
|
23114
|
+
} = middlewareArguments;
|
|
23115
|
+
const {
|
|
23116
|
+
offset: offset2 = 0,
|
|
23117
|
+
mainAxis: checkMainAxis = true,
|
|
23118
|
+
crossAxis: checkCrossAxis = true
|
|
23119
|
+
} = options;
|
|
23120
|
+
const coords = {
|
|
23121
|
+
x,
|
|
23122
|
+
y
|
|
23123
|
+
};
|
|
23124
|
+
const mainAxis = getMainAxisFromPlacement(placement);
|
|
23125
|
+
const crossAxis = getCrossAxis(mainAxis);
|
|
23126
|
+
let mainAxisCoord = coords[mainAxis];
|
|
23127
|
+
let crossAxisCoord = coords[crossAxis];
|
|
23128
|
+
const rawOffset = typeof offset2 === "function" ? offset2(middlewareArguments) : offset2;
|
|
23129
|
+
const computedOffset = typeof rawOffset === "number" ? {
|
|
23130
|
+
mainAxis: rawOffset,
|
|
23131
|
+
crossAxis: 0
|
|
23132
|
+
} : {
|
|
23133
|
+
mainAxis: 0,
|
|
23134
|
+
crossAxis: 0,
|
|
23135
|
+
...rawOffset
|
|
23136
|
+
};
|
|
23137
|
+
if (checkMainAxis) {
|
|
23138
|
+
const len = mainAxis === "y" ? "height" : "width";
|
|
23139
|
+
const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
|
|
23140
|
+
const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
|
|
23141
|
+
if (mainAxisCoord < limitMin) {
|
|
23142
|
+
mainAxisCoord = limitMin;
|
|
23143
|
+
} else if (mainAxisCoord > limitMax) {
|
|
23144
|
+
mainAxisCoord = limitMax;
|
|
23145
|
+
}
|
|
23146
|
+
}
|
|
23147
|
+
if (checkCrossAxis) {
|
|
23148
|
+
var _middlewareData$offse, _middlewareData$offse2, _middlewareData$offse3, _middlewareData$offse4;
|
|
23149
|
+
const len = mainAxis === "y" ? "width" : "height";
|
|
23150
|
+
const isOriginSide = ["top", "left"].includes(getSide(placement));
|
|
23151
|
+
const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? (_middlewareData$offse = (_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) != null ? _middlewareData$offse : 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
|
|
23152
|
+
const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : (_middlewareData$offse3 = (_middlewareData$offse4 = middlewareData.offset) == null ? void 0 : _middlewareData$offse4[crossAxis]) != null ? _middlewareData$offse3 : 0) - (isOriginSide ? computedOffset.crossAxis : 0);
|
|
23153
|
+
if (crossAxisCoord < limitMin) {
|
|
23154
|
+
crossAxisCoord = limitMin;
|
|
23155
|
+
} else if (crossAxisCoord > limitMax) {
|
|
23156
|
+
crossAxisCoord = limitMax;
|
|
23157
|
+
}
|
|
23158
|
+
}
|
|
23159
|
+
return {
|
|
23160
|
+
[mainAxis]: mainAxisCoord,
|
|
23161
|
+
[crossAxis]: crossAxisCoord
|
|
23162
|
+
};
|
|
23163
|
+
}
|
|
23164
|
+
};
|
|
24107
23165
|
};
|
|
24108
|
-
|
|
24109
|
-
|
|
24110
|
-
SimpleBar.initHtmlApi();
|
|
23166
|
+
function isWindow(value) {
|
|
23167
|
+
return value && value.document && value.location && value.alert && value.setInterval;
|
|
24111
23168
|
}
|
|
24112
|
-
function
|
|
24113
|
-
|
|
24114
|
-
|
|
24115
|
-
|
|
24116
|
-
|
|
24117
|
-
|
|
24118
|
-
|
|
24119
|
-
|
|
24120
|
-
|
|
23169
|
+
function getWindow(node) {
|
|
23170
|
+
if (node == null) {
|
|
23171
|
+
return window;
|
|
23172
|
+
}
|
|
23173
|
+
if (!isWindow(node)) {
|
|
23174
|
+
const ownerDocument = node.ownerDocument;
|
|
23175
|
+
return ownerDocument ? ownerDocument.defaultView || window : window;
|
|
23176
|
+
}
|
|
23177
|
+
return node;
|
|
23178
|
+
}
|
|
23179
|
+
function getComputedStyle$1(element) {
|
|
23180
|
+
return getWindow(element).getComputedStyle(element);
|
|
23181
|
+
}
|
|
23182
|
+
function getNodeName(node) {
|
|
23183
|
+
return isWindow(node) ? "" : node ? (node.nodeName || "").toLowerCase() : "";
|
|
23184
|
+
}
|
|
23185
|
+
function getUAString() {
|
|
23186
|
+
const uaData = navigator.userAgentData;
|
|
23187
|
+
if (uaData && Array.isArray(uaData.brands)) {
|
|
23188
|
+
return uaData.brands.map((item) => item.brand + "/" + item.version).join(" ");
|
|
23189
|
+
}
|
|
23190
|
+
return navigator.userAgent;
|
|
23191
|
+
}
|
|
23192
|
+
function isHTMLElement(value) {
|
|
23193
|
+
return value instanceof getWindow(value).HTMLElement;
|
|
23194
|
+
}
|
|
23195
|
+
function isElement(value) {
|
|
23196
|
+
return value instanceof getWindow(value).Element;
|
|
23197
|
+
}
|
|
23198
|
+
function isNode(value) {
|
|
23199
|
+
return value instanceof getWindow(value).Node;
|
|
23200
|
+
}
|
|
23201
|
+
function isShadowRoot(node) {
|
|
23202
|
+
if (typeof ShadowRoot === "undefined") {
|
|
23203
|
+
return false;
|
|
23204
|
+
}
|
|
23205
|
+
const OwnElement = getWindow(node).ShadowRoot;
|
|
23206
|
+
return node instanceof OwnElement || node instanceof ShadowRoot;
|
|
23207
|
+
}
|
|
23208
|
+
function isOverflowElement(element) {
|
|
23209
|
+
const {
|
|
23210
|
+
overflow,
|
|
23211
|
+
overflowX,
|
|
23212
|
+
overflowY,
|
|
23213
|
+
display
|
|
23214
|
+
} = getComputedStyle$1(element);
|
|
23215
|
+
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX) && !["inline", "contents"].includes(display);
|
|
23216
|
+
}
|
|
23217
|
+
function isTableElement(element) {
|
|
23218
|
+
return ["table", "td", "th"].includes(getNodeName(element));
|
|
23219
|
+
}
|
|
23220
|
+
function isContainingBlock(element) {
|
|
23221
|
+
const isFirefox = /firefox/i.test(getUAString());
|
|
23222
|
+
const css = getComputedStyle$1(element);
|
|
23223
|
+
const backdropFilter = css.backdropFilter || css.WebkitBackdropFilter;
|
|
23224
|
+
return css.transform !== "none" || css.perspective !== "none" || (backdropFilter ? backdropFilter !== "none" : false) || isFirefox && css.willChange === "filter" || isFirefox && (css.filter ? css.filter !== "none" : false) || ["transform", "perspective"].some((value) => css.willChange.includes(value)) || ["paint", "layout", "strict", "content"].some(
|
|
23225
|
+
(value) => {
|
|
23226
|
+
const contain = css.contain;
|
|
23227
|
+
return contain != null ? contain.includes(value) : false;
|
|
24121
23228
|
}
|
|
23229
|
+
);
|
|
23230
|
+
}
|
|
23231
|
+
function isLayoutViewport() {
|
|
23232
|
+
return !/^((?!chrome|android).)*safari/i.test(getUAString());
|
|
23233
|
+
}
|
|
23234
|
+
function isLastTraversableNode(node) {
|
|
23235
|
+
return ["html", "body", "#document"].includes(getNodeName(node));
|
|
23236
|
+
}
|
|
23237
|
+
const min = Math.min;
|
|
23238
|
+
const max = Math.max;
|
|
23239
|
+
const round = Math.round;
|
|
23240
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
|
23241
|
+
var _win$visualViewport$o, _win$visualViewport, _win$visualViewport$o2, _win$visualViewport2;
|
|
23242
|
+
if (includeScale === void 0) {
|
|
23243
|
+
includeScale = false;
|
|
24122
23244
|
}
|
|
24123
|
-
|
|
24124
|
-
|
|
23245
|
+
if (isFixedStrategy === void 0) {
|
|
23246
|
+
isFixedStrategy = false;
|
|
24125
23247
|
}
|
|
24126
|
-
|
|
23248
|
+
const clientRect2 = element.getBoundingClientRect();
|
|
23249
|
+
let scaleX = 1;
|
|
23250
|
+
let scaleY = 1;
|
|
23251
|
+
if (includeScale && isHTMLElement(element)) {
|
|
23252
|
+
scaleX = element.offsetWidth > 0 ? round(clientRect2.width) / element.offsetWidth || 1 : 1;
|
|
23253
|
+
scaleY = element.offsetHeight > 0 ? round(clientRect2.height) / element.offsetHeight || 1 : 1;
|
|
23254
|
+
}
|
|
23255
|
+
const win = isElement(element) ? getWindow(element) : window;
|
|
23256
|
+
const addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
|
|
23257
|
+
const x = (clientRect2.left + (addVisualOffsets ? (_win$visualViewport$o = (_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) != null ? _win$visualViewport$o : 0 : 0)) / scaleX;
|
|
23258
|
+
const y = (clientRect2.top + (addVisualOffsets ? (_win$visualViewport$o2 = (_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) != null ? _win$visualViewport$o2 : 0 : 0)) / scaleY;
|
|
23259
|
+
const width = clientRect2.width / scaleX;
|
|
23260
|
+
const height = clientRect2.height / scaleY;
|
|
23261
|
+
return {
|
|
23262
|
+
width,
|
|
23263
|
+
height,
|
|
23264
|
+
top: y,
|
|
23265
|
+
right: x + width,
|
|
23266
|
+
bottom: y + height,
|
|
23267
|
+
left: x,
|
|
23268
|
+
x,
|
|
23269
|
+
y
|
|
23270
|
+
};
|
|
24127
23271
|
}
|
|
24128
|
-
|
|
24129
|
-
|
|
24130
|
-
const tempValue = ref(format2(valueRef.value));
|
|
24131
|
-
watch(valueRef, () => tempValue.value = format2(valueRef.value));
|
|
24132
|
-
return tempValue;
|
|
23272
|
+
function getDocumentElement(node) {
|
|
23273
|
+
return ((isNode(node) ? node.ownerDocument : node.document) || window.document).documentElement;
|
|
24133
23274
|
}
|
|
24134
|
-
function
|
|
24135
|
-
|
|
24136
|
-
|
|
24137
|
-
|
|
24138
|
-
|
|
23275
|
+
function getNodeScroll(element) {
|
|
23276
|
+
if (isElement(element)) {
|
|
23277
|
+
return {
|
|
23278
|
+
scrollLeft: element.scrollLeft,
|
|
23279
|
+
scrollTop: element.scrollTop
|
|
23280
|
+
};
|
|
23281
|
+
}
|
|
23282
|
+
return {
|
|
23283
|
+
scrollLeft: element.pageXOffset,
|
|
23284
|
+
scrollTop: element.pageYOffset
|
|
23285
|
+
};
|
|
24139
23286
|
}
|
|
24140
|
-
function
|
|
24141
|
-
|
|
24142
|
-
|
|
23287
|
+
function getWindowScrollBarX(element) {
|
|
23288
|
+
return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
|
|
23289
|
+
}
|
|
23290
|
+
function isScaled(element) {
|
|
23291
|
+
const rect = getBoundingClientRect(element);
|
|
23292
|
+
return round(rect.width) !== element.offsetWidth || round(rect.height) !== element.offsetHeight;
|
|
23293
|
+
}
|
|
23294
|
+
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
23295
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
23296
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
23297
|
+
const rect = getBoundingClientRect(
|
|
23298
|
+
element,
|
|
23299
|
+
isOffsetParentAnElement && isScaled(offsetParent),
|
|
23300
|
+
strategy === "fixed"
|
|
23301
|
+
);
|
|
23302
|
+
let scroll = {
|
|
23303
|
+
scrollLeft: 0,
|
|
23304
|
+
scrollTop: 0
|
|
23305
|
+
};
|
|
23306
|
+
const offsets = {
|
|
23307
|
+
x: 0,
|
|
23308
|
+
y: 0
|
|
23309
|
+
};
|
|
23310
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== "fixed") {
|
|
23311
|
+
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
|
23312
|
+
scroll = getNodeScroll(offsetParent);
|
|
23313
|
+
}
|
|
23314
|
+
if (isHTMLElement(offsetParent)) {
|
|
23315
|
+
const offsetRect = getBoundingClientRect(offsetParent, true);
|
|
23316
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
23317
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
23318
|
+
} else if (documentElement) {
|
|
23319
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
23320
|
+
}
|
|
24143
23321
|
}
|
|
24144
|
-
|
|
24145
|
-
|
|
24146
|
-
|
|
24147
|
-
|
|
24148
|
-
|
|
24149
|
-
|
|
24150
|
-
|
|
23322
|
+
return {
|
|
23323
|
+
x: rect.left + scroll.scrollLeft - offsets.x,
|
|
23324
|
+
y: rect.top + scroll.scrollTop - offsets.y,
|
|
23325
|
+
width: rect.width,
|
|
23326
|
+
height: rect.height
|
|
23327
|
+
};
|
|
23328
|
+
}
|
|
23329
|
+
function getParentNode(node) {
|
|
23330
|
+
if (getNodeName(node) === "html") {
|
|
23331
|
+
return node;
|
|
24151
23332
|
}
|
|
24152
|
-
|
|
24153
|
-
|
|
24154
|
-
|
|
24155
|
-
|
|
23333
|
+
const result = node.assignedSlot || node.parentNode || (isShadowRoot(node) ? node.host : null) || getDocumentElement(node);
|
|
23334
|
+
return isShadowRoot(result) ? result.host : result;
|
|
23335
|
+
}
|
|
23336
|
+
function getTrueOffsetParent(element) {
|
|
23337
|
+
if (!isHTMLElement(element) || getComputedStyle$1(element).position === "fixed") {
|
|
23338
|
+
return null;
|
|
23339
|
+
}
|
|
23340
|
+
return element.offsetParent;
|
|
23341
|
+
}
|
|
23342
|
+
function getContainingBlock(element) {
|
|
23343
|
+
let currentNode = getParentNode(element);
|
|
23344
|
+
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
23345
|
+
if (isContainingBlock(currentNode)) {
|
|
23346
|
+
return currentNode;
|
|
23347
|
+
} else {
|
|
23348
|
+
currentNode = getParentNode(currentNode);
|
|
24156
23349
|
}
|
|
24157
|
-
const numericValue = Number.parseFloat(temp.value);
|
|
24158
|
-
const validatedNumber = validateNumber(numericValue);
|
|
24159
|
-
temp.value = format2(validatedNumber);
|
|
24160
|
-
onChange(temp.value);
|
|
24161
23350
|
}
|
|
24162
|
-
|
|
24163
|
-
|
|
24164
|
-
|
|
24165
|
-
|
|
24166
|
-
|
|
23351
|
+
return null;
|
|
23352
|
+
}
|
|
23353
|
+
function getOffsetParent(element) {
|
|
23354
|
+
const window2 = getWindow(element);
|
|
23355
|
+
let offsetParent = getTrueOffsetParent(element);
|
|
23356
|
+
while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === "static") {
|
|
23357
|
+
offsetParent = getTrueOffsetParent(offsetParent);
|
|
24167
23358
|
}
|
|
24168
|
-
|
|
24169
|
-
|
|
24170
|
-
|
|
24171
|
-
|
|
24172
|
-
|
|
23359
|
+
if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle$1(offsetParent).position === "static" && !isContainingBlock(offsetParent))) {
|
|
23360
|
+
return window2;
|
|
23361
|
+
}
|
|
23362
|
+
return offsetParent || getContainingBlock(element) || window2;
|
|
23363
|
+
}
|
|
23364
|
+
function getDimensions(element) {
|
|
23365
|
+
if (isHTMLElement(element)) {
|
|
23366
|
+
return {
|
|
23367
|
+
width: element.offsetWidth,
|
|
23368
|
+
height: element.offsetHeight
|
|
23369
|
+
};
|
|
24173
23370
|
}
|
|
23371
|
+
const rect = getBoundingClientRect(element);
|
|
24174
23372
|
return {
|
|
24175
|
-
|
|
24176
|
-
|
|
24177
|
-
|
|
24178
|
-
|
|
23373
|
+
width: rect.width,
|
|
23374
|
+
height: rect.height
|
|
23375
|
+
};
|
|
23376
|
+
}
|
|
23377
|
+
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
23378
|
+
let {
|
|
23379
|
+
rect,
|
|
23380
|
+
offsetParent,
|
|
23381
|
+
strategy
|
|
23382
|
+
} = _ref;
|
|
23383
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
23384
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
23385
|
+
if (offsetParent === documentElement) {
|
|
23386
|
+
return rect;
|
|
23387
|
+
}
|
|
23388
|
+
let scroll = {
|
|
23389
|
+
scrollLeft: 0,
|
|
23390
|
+
scrollTop: 0
|
|
23391
|
+
};
|
|
23392
|
+
const offsets = {
|
|
23393
|
+
x: 0,
|
|
23394
|
+
y: 0
|
|
23395
|
+
};
|
|
23396
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== "fixed") {
|
|
23397
|
+
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
|
23398
|
+
scroll = getNodeScroll(offsetParent);
|
|
23399
|
+
}
|
|
23400
|
+
if (isHTMLElement(offsetParent)) {
|
|
23401
|
+
const offsetRect = getBoundingClientRect(offsetParent, true);
|
|
23402
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
23403
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
23404
|
+
}
|
|
23405
|
+
}
|
|
23406
|
+
return {
|
|
23407
|
+
...rect,
|
|
23408
|
+
x: rect.x - scroll.scrollLeft + offsets.x,
|
|
23409
|
+
y: rect.y - scroll.scrollTop + offsets.y
|
|
23410
|
+
};
|
|
23411
|
+
}
|
|
23412
|
+
function getViewportRect(element, strategy) {
|
|
23413
|
+
const win = getWindow(element);
|
|
23414
|
+
const html2 = getDocumentElement(element);
|
|
23415
|
+
const visualViewport = win.visualViewport;
|
|
23416
|
+
let width = html2.clientWidth;
|
|
23417
|
+
let height = html2.clientHeight;
|
|
23418
|
+
let x = 0;
|
|
23419
|
+
let y = 0;
|
|
23420
|
+
if (visualViewport) {
|
|
23421
|
+
width = visualViewport.width;
|
|
23422
|
+
height = visualViewport.height;
|
|
23423
|
+
const layoutViewport = isLayoutViewport();
|
|
23424
|
+
if (layoutViewport || !layoutViewport && strategy === "fixed") {
|
|
23425
|
+
x = visualViewport.offsetLeft;
|
|
23426
|
+
y = visualViewport.offsetTop;
|
|
23427
|
+
}
|
|
23428
|
+
}
|
|
23429
|
+
return {
|
|
23430
|
+
width,
|
|
23431
|
+
height,
|
|
23432
|
+
x,
|
|
23433
|
+
y
|
|
24179
23434
|
};
|
|
24180
23435
|
}
|
|
23436
|
+
function getDocumentRect(element) {
|
|
23437
|
+
var _element$ownerDocumen;
|
|
23438
|
+
const html2 = getDocumentElement(element);
|
|
23439
|
+
const scroll = getNodeScroll(element);
|
|
23440
|
+
const body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
|
|
23441
|
+
const width = max(html2.scrollWidth, html2.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
|
|
23442
|
+
const height = max(html2.scrollHeight, html2.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
|
23443
|
+
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
23444
|
+
const y = -scroll.scrollTop;
|
|
23445
|
+
if (getComputedStyle$1(body || html2).direction === "rtl") {
|
|
23446
|
+
x += max(html2.clientWidth, body ? body.clientWidth : 0) - width;
|
|
23447
|
+
}
|
|
23448
|
+
return {
|
|
23449
|
+
width,
|
|
23450
|
+
height,
|
|
23451
|
+
x,
|
|
23452
|
+
y
|
|
23453
|
+
};
|
|
23454
|
+
}
|
|
23455
|
+
function getNearestOverflowAncestor(node) {
|
|
23456
|
+
const parentNode2 = getParentNode(node);
|
|
23457
|
+
if (isLastTraversableNode(parentNode2)) {
|
|
23458
|
+
return node.ownerDocument.body;
|
|
23459
|
+
}
|
|
23460
|
+
if (isHTMLElement(parentNode2) && isOverflowElement(parentNode2)) {
|
|
23461
|
+
return parentNode2;
|
|
23462
|
+
}
|
|
23463
|
+
return getNearestOverflowAncestor(parentNode2);
|
|
23464
|
+
}
|
|
23465
|
+
function getOverflowAncestors(node, list) {
|
|
23466
|
+
var _node$ownerDocument;
|
|
23467
|
+
if (list === void 0) {
|
|
23468
|
+
list = [];
|
|
23469
|
+
}
|
|
23470
|
+
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
23471
|
+
const isBody = scrollableAncestor === ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.body);
|
|
23472
|
+
const win = getWindow(scrollableAncestor);
|
|
23473
|
+
const target = isBody ? [win].concat(win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []) : scrollableAncestor;
|
|
23474
|
+
const updatedList = list.concat(target);
|
|
23475
|
+
return isBody ? updatedList : updatedList.concat(getOverflowAncestors(target));
|
|
23476
|
+
}
|
|
23477
|
+
function getInnerBoundingClientRect(element, strategy) {
|
|
23478
|
+
const clientRect2 = getBoundingClientRect(element, false, strategy === "fixed");
|
|
23479
|
+
const top = clientRect2.top + element.clientTop;
|
|
23480
|
+
const left = clientRect2.left + element.clientLeft;
|
|
23481
|
+
return {
|
|
23482
|
+
top,
|
|
23483
|
+
left,
|
|
23484
|
+
x: left,
|
|
23485
|
+
y: top,
|
|
23486
|
+
right: left + element.clientWidth,
|
|
23487
|
+
bottom: top + element.clientHeight,
|
|
23488
|
+
width: element.clientWidth,
|
|
23489
|
+
height: element.clientHeight
|
|
23490
|
+
};
|
|
23491
|
+
}
|
|
23492
|
+
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
23493
|
+
if (clippingAncestor === "viewport") {
|
|
23494
|
+
return rectToClientRect(getViewportRect(element, strategy));
|
|
23495
|
+
}
|
|
23496
|
+
if (isElement(clippingAncestor)) {
|
|
23497
|
+
return getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
23498
|
+
}
|
|
23499
|
+
return rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
|
23500
|
+
}
|
|
23501
|
+
function getClippingElementAncestors(element) {
|
|
23502
|
+
let result = getOverflowAncestors(element).filter((el) => isElement(el) && getNodeName(el) !== "body");
|
|
23503
|
+
let currentContainingBlockComputedStyle = null;
|
|
23504
|
+
const elementIsFixed = getComputedStyle$1(element).position === "fixed";
|
|
23505
|
+
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
23506
|
+
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
23507
|
+
const computedStyle = getComputedStyle$1(currentNode);
|
|
23508
|
+
const containingBlock = isContainingBlock(currentNode);
|
|
23509
|
+
const shouldDropCurrentNode = elementIsFixed ? !containingBlock && !currentContainingBlockComputedStyle : !containingBlock && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && ["absolute", "fixed"].includes(currentContainingBlockComputedStyle.position);
|
|
23510
|
+
if (shouldDropCurrentNode) {
|
|
23511
|
+
result = result.filter((ancestor) => ancestor !== currentNode);
|
|
23512
|
+
} else {
|
|
23513
|
+
currentContainingBlockComputedStyle = computedStyle;
|
|
23514
|
+
}
|
|
23515
|
+
currentNode = getParentNode(currentNode);
|
|
23516
|
+
}
|
|
23517
|
+
return result;
|
|
23518
|
+
}
|
|
23519
|
+
function getClippingRect(_ref) {
|
|
23520
|
+
let {
|
|
23521
|
+
element,
|
|
23522
|
+
boundary,
|
|
23523
|
+
rootBoundary,
|
|
23524
|
+
strategy
|
|
23525
|
+
} = _ref;
|
|
23526
|
+
const elementClippingAncestors = boundary === "clippingAncestors" ? getClippingElementAncestors(element) : [].concat(boundary);
|
|
23527
|
+
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
23528
|
+
const firstClippingAncestor = clippingAncestors[0];
|
|
23529
|
+
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
23530
|
+
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
|
23531
|
+
accRect.top = max(rect.top, accRect.top);
|
|
23532
|
+
accRect.right = min(rect.right, accRect.right);
|
|
23533
|
+
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
23534
|
+
accRect.left = max(rect.left, accRect.left);
|
|
23535
|
+
return accRect;
|
|
23536
|
+
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
|
23537
|
+
return {
|
|
23538
|
+
width: clippingRect.right - clippingRect.left,
|
|
23539
|
+
height: clippingRect.bottom - clippingRect.top,
|
|
23540
|
+
x: clippingRect.left,
|
|
23541
|
+
y: clippingRect.top
|
|
23542
|
+
};
|
|
23543
|
+
}
|
|
23544
|
+
const platform = {
|
|
23545
|
+
getClippingRect,
|
|
23546
|
+
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
23547
|
+
isElement,
|
|
23548
|
+
getDimensions,
|
|
23549
|
+
getOffsetParent,
|
|
23550
|
+
getDocumentElement,
|
|
23551
|
+
async getElementRects(_ref) {
|
|
23552
|
+
let {
|
|
23553
|
+
reference,
|
|
23554
|
+
floating,
|
|
23555
|
+
strategy
|
|
23556
|
+
} = _ref;
|
|
23557
|
+
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
23558
|
+
const getDimensionsFn = this.getDimensions;
|
|
23559
|
+
return {
|
|
23560
|
+
reference: getRectRelativeToOffsetParent(reference, await getOffsetParentFn(floating), strategy),
|
|
23561
|
+
floating: {
|
|
23562
|
+
x: 0,
|
|
23563
|
+
y: 0,
|
|
23564
|
+
...await getDimensionsFn(floating)
|
|
23565
|
+
}
|
|
23566
|
+
};
|
|
23567
|
+
},
|
|
23568
|
+
getClientRects: (element) => Array.from(element.getClientRects()),
|
|
23569
|
+
isRTL: (element) => getComputedStyle$1(element).direction === "rtl"
|
|
23570
|
+
};
|
|
23571
|
+
function autoUpdate(reference, floating, update, options) {
|
|
23572
|
+
if (options === void 0) {
|
|
23573
|
+
options = {};
|
|
23574
|
+
}
|
|
23575
|
+
const {
|
|
23576
|
+
ancestorScroll: _ancestorScroll = true,
|
|
23577
|
+
ancestorResize = true,
|
|
23578
|
+
elementResize = true,
|
|
23579
|
+
animationFrame = false
|
|
23580
|
+
} = options;
|
|
23581
|
+
const ancestorScroll = _ancestorScroll && !animationFrame;
|
|
23582
|
+
const ancestors = ancestorScroll || ancestorResize ? [...isElement(reference) ? getOverflowAncestors(reference) : reference.contextElement ? getOverflowAncestors(reference.contextElement) : [], ...getOverflowAncestors(floating)] : [];
|
|
23583
|
+
ancestors.forEach((ancestor) => {
|
|
23584
|
+
ancestorScroll && ancestor.addEventListener("scroll", update, {
|
|
23585
|
+
passive: true
|
|
23586
|
+
});
|
|
23587
|
+
ancestorResize && ancestor.addEventListener("resize", update);
|
|
23588
|
+
});
|
|
23589
|
+
let observer = null;
|
|
23590
|
+
if (elementResize) {
|
|
23591
|
+
let initialUpdate = true;
|
|
23592
|
+
observer = new ResizeObserver(() => {
|
|
23593
|
+
if (!initialUpdate) {
|
|
23594
|
+
update();
|
|
23595
|
+
}
|
|
23596
|
+
initialUpdate = false;
|
|
23597
|
+
});
|
|
23598
|
+
isElement(reference) && !animationFrame && observer.observe(reference);
|
|
23599
|
+
if (!isElement(reference) && reference.contextElement && !animationFrame) {
|
|
23600
|
+
observer.observe(reference.contextElement);
|
|
23601
|
+
}
|
|
23602
|
+
observer.observe(floating);
|
|
23603
|
+
}
|
|
23604
|
+
let frameId;
|
|
23605
|
+
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
|
|
23606
|
+
if (animationFrame) {
|
|
23607
|
+
frameLoop();
|
|
23608
|
+
}
|
|
23609
|
+
function frameLoop() {
|
|
23610
|
+
const nextRefRect = getBoundingClientRect(reference);
|
|
23611
|
+
if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
|
|
23612
|
+
update();
|
|
23613
|
+
}
|
|
23614
|
+
prevRefRect = nextRefRect;
|
|
23615
|
+
frameId = requestAnimationFrame(frameLoop);
|
|
23616
|
+
}
|
|
23617
|
+
update();
|
|
23618
|
+
return () => {
|
|
23619
|
+
var _observer;
|
|
23620
|
+
ancestors.forEach((ancestor) => {
|
|
23621
|
+
ancestorScroll && ancestor.removeEventListener("scroll", update);
|
|
23622
|
+
ancestorResize && ancestor.removeEventListener("resize", update);
|
|
23623
|
+
});
|
|
23624
|
+
(_observer = observer) == null ? void 0 : _observer.disconnect();
|
|
23625
|
+
observer = null;
|
|
23626
|
+
if (animationFrame) {
|
|
23627
|
+
cancelAnimationFrame(frameId);
|
|
23628
|
+
}
|
|
23629
|
+
};
|
|
23630
|
+
}
|
|
23631
|
+
const computePosition = (reference, floating, options) => computePosition$1(reference, floating, {
|
|
23632
|
+
platform,
|
|
23633
|
+
...options
|
|
23634
|
+
});
|
|
24181
23635
|
function useModalToggler({ onBeforeOpened, onClosed, wrapperRef, modalRef } = {}) {
|
|
24182
23636
|
const editor = inject(InjectionTokens$1.EDITOR);
|
|
24183
23637
|
const isOpened = ref(false);
|
|
24184
|
-
let
|
|
24185
|
-
function
|
|
23638
|
+
let floatingInstance;
|
|
23639
|
+
function initModal() {
|
|
24186
23640
|
const wrapperEl = useElementRef(wrapperRef);
|
|
24187
23641
|
const modalEl = useElementRef(modalRef);
|
|
24188
|
-
|
|
24189
|
-
|
|
24190
|
-
|
|
24191
|
-
|
|
24192
|
-
|
|
24193
|
-
|
|
24194
|
-
|
|
24195
|
-
|
|
24196
|
-
|
|
24197
|
-
|
|
24198
|
-
|
|
24199
|
-
|
|
24200
|
-
|
|
24201
|
-
|
|
24202
|
-
}
|
|
24203
|
-
},
|
|
24204
|
-
{
|
|
24205
|
-
name: "flip",
|
|
24206
|
-
enabled: false
|
|
24207
|
-
}
|
|
24208
|
-
]
|
|
23642
|
+
floatingInstance = autoUpdate(wrapperEl.value, modalEl.value, async () => {
|
|
23643
|
+
const positioning = await computePosition(wrapperEl.value, modalEl.value, {
|
|
23644
|
+
placement: "bottom",
|
|
23645
|
+
strategy: "fixed",
|
|
23646
|
+
middleware: [
|
|
23647
|
+
shift({ padding: 16, crossAxis: true, limiter: limitShift() }),
|
|
23648
|
+
offset({ mainAxis: 4 })
|
|
23649
|
+
]
|
|
23650
|
+
});
|
|
23651
|
+
const { x, y } = positioning;
|
|
23652
|
+
Object.assign(modalEl.value, {
|
|
23653
|
+
left: `${x}px`,
|
|
23654
|
+
top: `${y}px`
|
|
23655
|
+
});
|
|
24209
23656
|
});
|
|
24210
23657
|
}
|
|
24211
23658
|
async function open() {
|
|
@@ -24213,16 +23660,14 @@ function useModalToggler({ onBeforeOpened, onClosed, wrapperRef, modalRef } = {}
|
|
|
24213
23660
|
editor.commands.storeSelection();
|
|
24214
23661
|
isOpened.value = true;
|
|
24215
23662
|
await nextTick();
|
|
24216
|
-
|
|
23663
|
+
initModal();
|
|
24217
23664
|
}
|
|
24218
23665
|
function close2() {
|
|
24219
23666
|
isOpened.value = false;
|
|
23667
|
+
floatingInstance == null ? void 0 : floatingInstance();
|
|
24220
23668
|
editor.commands.restoreSelection();
|
|
24221
23669
|
onClosed == null ? void 0 : onClosed();
|
|
24222
23670
|
}
|
|
24223
|
-
onUnmounted(() => {
|
|
24224
|
-
popper2 == null ? void 0 : popper2.destroy();
|
|
24225
|
-
});
|
|
24226
23671
|
const toggle = (toOpen) => toOpen ? open() : close2();
|
|
24227
23672
|
return { isOpened, open, close: close2, toggle };
|
|
24228
23673
|
}
|
|
@@ -25207,7 +24652,7 @@ var render$r = function __render__18() {
|
|
|
25207
24652
|
},
|
|
25208
24653
|
scopedSlots: _vm._u([{
|
|
25209
24654
|
key: "option",
|
|
25210
|
-
fn: function
|
|
24655
|
+
fn: function fn(attrs) {
|
|
25211
24656
|
return [_vm._t("option", null, null, attrs)];
|
|
25212
24657
|
}
|
|
25213
24658
|
}], null, true)
|
|
@@ -25276,7 +24721,7 @@ var render$q = function __render__19() {
|
|
|
25276
24721
|
},
|
|
25277
24722
|
scopedSlots: _vm._u([{
|
|
25278
24723
|
key: "default",
|
|
25279
|
-
fn: function
|
|
24724
|
+
fn: function fn(attrs) {
|
|
25280
24725
|
return [_vm._t("activator", null, null, attrs)];
|
|
25281
24726
|
}
|
|
25282
24727
|
}], null, true)
|
|
@@ -25293,7 +24738,7 @@ var render$q = function __render__19() {
|
|
|
25293
24738
|
},
|
|
25294
24739
|
scopedSlots: _vm._u([{
|
|
25295
24740
|
key: "option",
|
|
25296
|
-
fn: function
|
|
24741
|
+
fn: function fn(attrs) {
|
|
25297
24742
|
return [_vm._t("option", null, null, attrs)];
|
|
25298
24743
|
}
|
|
25299
24744
|
}], null, true)
|
|
@@ -25465,7 +24910,7 @@ var render$p = function __render__20() {
|
|
|
25465
24910
|
},
|
|
25466
24911
|
scopedSlots: _vm._u([{
|
|
25467
24912
|
key: "activator",
|
|
25468
|
-
fn: function
|
|
24913
|
+
fn: function fn() {
|
|
25469
24914
|
return [_vm._t("activator", null, {
|
|
25470
24915
|
"isOpened": _vm.api.isOpened,
|
|
25471
24916
|
"open": _vm.api.open,
|
|
@@ -25686,7 +25131,7 @@ var render$n = function __render__22() {
|
|
|
25686
25131
|
},
|
|
25687
25132
|
scopedSlots: _vm._u([{
|
|
25688
25133
|
key: "option",
|
|
25689
|
-
fn: function
|
|
25134
|
+
fn: function fn(_ref) {
|
|
25690
25135
|
var option = _ref.option;
|
|
25691
25136
|
return [_c("DropdownOption", {
|
|
25692
25137
|
directives: [{
|
|
@@ -25918,7 +25363,7 @@ var render$k = function __render__25() {
|
|
|
25918
25363
|
},
|
|
25919
25364
|
scopedSlots: _vm._u([{
|
|
25920
25365
|
key: "activator",
|
|
25921
|
-
fn: function
|
|
25366
|
+
fn: function fn(_ref) {
|
|
25922
25367
|
var toggle = _ref.toggle, isOpened = _ref.isOpened;
|
|
25923
25368
|
return [_c("Button", {
|
|
25924
25369
|
directives: [{
|
|
@@ -25999,7 +25444,7 @@ var render$j = function __render__26() {
|
|
|
25999
25444
|
},
|
|
26000
25445
|
scopedSlots: _vm._u([{
|
|
26001
25446
|
key: "activator",
|
|
26002
|
-
fn: function
|
|
25447
|
+
fn: function fn(_ref) {
|
|
26003
25448
|
var toggle = _ref.toggle, isOpened = _ref.isOpened;
|
|
26004
25449
|
return [_c("Button", {
|
|
26005
25450
|
directives: [{
|
|
@@ -26353,7 +25798,7 @@ var render$e = function __render__31() {
|
|
|
26353
25798
|
},
|
|
26354
25799
|
scopedSlots: _vm._u([{
|
|
26355
25800
|
key: "activator",
|
|
26356
|
-
fn: function
|
|
25801
|
+
fn: function fn(_ref) {
|
|
26357
25802
|
var open = _ref.open, isOpened = _ref.isOpened;
|
|
26358
25803
|
return [_c("Button", {
|
|
26359
25804
|
directives: [{
|
|
@@ -26436,7 +25881,7 @@ var render$d = function __render__32() {
|
|
|
26436
25881
|
},
|
|
26437
25882
|
scopedSlots: _vm._u([{
|
|
26438
25883
|
key: "option",
|
|
26439
|
-
fn: function
|
|
25884
|
+
fn: function fn(_ref) {
|
|
26440
25885
|
var isActive2 = _ref.isActive, option = _ref.option, activate = _ref.activate;
|
|
26441
25886
|
return [_c("Button", {
|
|
26442
25887
|
directives: [{
|
|
@@ -26684,7 +26129,7 @@ var render$b = function __render__34() {
|
|
|
26684
26129
|
},
|
|
26685
26130
|
scopedSlots: _vm._u([{
|
|
26686
26131
|
key: "activator",
|
|
26687
|
-
fn: function
|
|
26132
|
+
fn: function fn(_ref) {
|
|
26688
26133
|
var open = _ref.open, isOpened = _ref.isOpened;
|
|
26689
26134
|
return [_c("Button", {
|
|
26690
26135
|
directives: [{
|
|
@@ -26712,7 +26157,7 @@ var render$b = function __render__34() {
|
|
|
26712
26157
|
}
|
|
26713
26158
|
}, {
|
|
26714
26159
|
key: "option",
|
|
26715
|
-
fn: function
|
|
26160
|
+
fn: function fn(_ref2) {
|
|
26716
26161
|
var option = _ref2.option;
|
|
26717
26162
|
return [_c("DropdownOption", {
|
|
26718
26163
|
staticClass: "zw-list-control__option",
|
|
@@ -27001,7 +26446,7 @@ var render$8 = function __render__37() {
|
|
|
27001
26446
|
},
|
|
27002
26447
|
scopedSlots: _vm._u([{
|
|
27003
26448
|
key: "option",
|
|
27004
|
-
fn: function
|
|
26449
|
+
fn: function fn(_ref) {
|
|
27005
26450
|
var option = _ref.option;
|
|
27006
26451
|
return [_c("DropdownOption", {
|
|
27007
26452
|
staticClass: "zw-link-modal-dropdown__option",
|
|
@@ -27138,7 +26583,7 @@ var render$6 = function __render__39() {
|
|
|
27138
26583
|
},
|
|
27139
26584
|
scopedSlots: _vm._u([{
|
|
27140
26585
|
key: "option",
|
|
27141
|
-
fn: function
|
|
26586
|
+
fn: function fn(_ref) {
|
|
27142
26587
|
var option = _ref.option;
|
|
27143
26588
|
return [_c("DropdownOption", {
|
|
27144
26589
|
staticClass: "zw-link-modal-dropdown__option",
|
|
@@ -27751,7 +27196,7 @@ var __component__$1 = /* @__PURE__ */ normalizeComponent(
|
|
|
27751
27196
|
staticRenderFns$1,
|
|
27752
27197
|
false,
|
|
27753
27198
|
__vue2_injectStyles$1,
|
|
27754
|
-
"
|
|
27199
|
+
"def9f25e",
|
|
27755
27200
|
null,
|
|
27756
27201
|
null
|
|
27757
27202
|
);
|
|
@@ -27785,33 +27230,26 @@ function useEditor({ content, onChange, extensions: extensions2, isReadonlyRef }
|
|
|
27785
27230
|
}
|
|
27786
27231
|
function useToolbar({ wrapperRef, offsets, isActiveRef, placementRef }) {
|
|
27787
27232
|
const wrapperEl = useElementRef(wrapperRef);
|
|
27788
|
-
let
|
|
27233
|
+
let floatingInstance;
|
|
27789
27234
|
function mount(element) {
|
|
27790
|
-
|
|
27791
|
-
|
|
27792
|
-
|
|
27793
|
-
|
|
27794
|
-
|
|
27795
|
-
|
|
27796
|
-
|
|
27797
|
-
|
|
27798
|
-
|
|
27799
|
-
|
|
27800
|
-
|
|
27801
|
-
|
|
27802
|
-
|
|
27803
|
-
|
|
27804
|
-
},
|
|
27805
|
-
{
|
|
27806
|
-
name: "flip",
|
|
27807
|
-
enabled: false
|
|
27808
|
-
}
|
|
27809
|
-
]
|
|
27235
|
+
floatingInstance = autoUpdate(wrapperEl.value, element, async () => {
|
|
27236
|
+
const positioning = await computePosition(wrapperEl.value, element, {
|
|
27237
|
+
placement: placementRef.value,
|
|
27238
|
+
strategy: "fixed",
|
|
27239
|
+
middleware: [
|
|
27240
|
+
shift({ padding: 16, crossAxis: true, limiter: limitShift() }),
|
|
27241
|
+
offset({ crossAxis: offsets[0], mainAxis: offsets[1] })
|
|
27242
|
+
]
|
|
27243
|
+
});
|
|
27244
|
+
const { x, y } = positioning;
|
|
27245
|
+
Object.assign(element.style, {
|
|
27246
|
+
left: `${x}px`,
|
|
27247
|
+
top: `${y}px`
|
|
27248
|
+
});
|
|
27810
27249
|
});
|
|
27811
27250
|
}
|
|
27812
|
-
|
|
27251
|
+
onUnmounted(() => floatingInstance == null ? void 0 : floatingInstance());
|
|
27813
27252
|
return {
|
|
27814
|
-
update,
|
|
27815
27253
|
mount,
|
|
27816
27254
|
isActiveRef,
|
|
27817
27255
|
offsets
|
|
@@ -27874,7 +27312,7 @@ var render = function __render__45() {
|
|
|
27874
27312
|
})], 1);
|
|
27875
27313
|
};
|
|
27876
27314
|
var staticRenderFns = [];
|
|
27877
|
-
const
|
|
27315
|
+
const main_css_vue_type_style_index_0_from__2FUsers_2Fmaster_2FProjects_2FZipifyWysiwyg_2Flib_2FWysiwyg_vue_src_lang = "";
|
|
27878
27316
|
const MIN_FONT_SIZE = 5;
|
|
27879
27317
|
const MAX_FONT_SIZE = 112;
|
|
27880
27318
|
const __vue2_script = {
|
|
@@ -27983,10 +27421,8 @@ const __vue2_script = {
|
|
|
27983
27421
|
isActiveRef: isToolbarActiveRef,
|
|
27984
27422
|
offsets: props.toolbarOffsets
|
|
27985
27423
|
});
|
|
27986
|
-
const updateToolbar = () => toolbar.update();
|
|
27987
27424
|
function onChange(content) {
|
|
27988
27425
|
emit("input", content);
|
|
27989
|
-
updateToolbar();
|
|
27990
27426
|
}
|
|
27991
27427
|
const pageBlocks = toRef(props, "pageBlocks");
|
|
27992
27428
|
const { editor, getContent } = useEditor({
|
|
@@ -28025,7 +27461,6 @@ const __vue2_script = {
|
|
|
28025
27461
|
toolbarRef,
|
|
28026
27462
|
wysiwygRef,
|
|
28027
27463
|
toolbar,
|
|
28028
|
-
updateToolbar,
|
|
28029
27464
|
getContent,
|
|
28030
27465
|
getContentCustomization
|
|
28031
27466
|
};
|