@ai-ecoverse/slicc-spectrum 1.20.0 → 1.22.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/{chunk-FVX3AKIL.js → chunk-7C2RFOQL.js} +2 -2
- package/dist/{chunk-HREBQ2GY.js → chunk-BALQPQXE.js} +22 -709
- package/dist/chunk-BALQPQXE.js.map +7 -0
- package/dist/chunk-LCUJINFQ.js +765 -0
- package/dist/chunk-LCUJINFQ.js.map +7 -0
- package/dist/{chunk-EBQYWRJ4.js → chunk-UGQPYZPJ.js} +3 -3
- package/dist/{chunk-3BBEUJX7.js → chunk-VGYK6PQ4.js} +3 -3
- package/dist/slicc-ui.js +53896 -51481
- package/dist/slicc-ui.js.map +4 -4
- package/dist/types/app/app.d.ts +9 -0
- package/dist/types/app/base.d.ts +3 -1
- package/dist/types/app/browser.d.ts +8 -5
- package/dist/types/app/panels.d.ts +7 -2
- package/dist/types/app/spectrum.d.ts +8 -0
- package/dist/types/app/terminals.d.ts +20 -9
- package/dist/types/app/tray.d.ts +1 -4
- package/package.json +2 -2
- package/dist/chunk-HREBQ2GY.js.map +0 -7
- package/dist/chunk-Y4Z7K443.js +0 -64
- package/dist/chunk-Y4Z7K443.js.map +0 -7
- /package/dist/{chunk-FVX3AKIL.js.map → chunk-7C2RFOQL.js.map} +0 -0
- /package/dist/{chunk-EBQYWRJ4.js.map → chunk-UGQPYZPJ.js.map} +0 -0
- /package/dist/{chunk-3BBEUJX7.js.map → chunk-VGYK6PQ4.js.map} +0 -0
|
@@ -7,13 +7,20 @@ import {
|
|
|
7
7
|
} from "./chunk-ZMBN6APP.js";
|
|
8
8
|
import {
|
|
9
9
|
SlottableRequestEvent,
|
|
10
|
+
arrow,
|
|
11
|
+
computePosition,
|
|
10
12
|
conditionAttributeWithId,
|
|
13
|
+
flip,
|
|
11
14
|
isAndroid,
|
|
12
15
|
isIOS,
|
|
13
16
|
isWebKit,
|
|
17
|
+
offset,
|
|
14
18
|
randomID,
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
rectToClientRect,
|
|
20
|
+
removeSlottableRequest,
|
|
21
|
+
shift,
|
|
22
|
+
size
|
|
23
|
+
} from "./chunk-LCUJINFQ.js";
|
|
17
24
|
import {
|
|
18
25
|
o
|
|
19
26
|
} from "./chunk-OS3ZND7O.js";
|
|
@@ -243,7 +250,7 @@ var AbstractOverlay = class _AbstractOverlay extends SpectrumElement {
|
|
|
243
250
|
document.dispatchEvent(e2);
|
|
244
251
|
}
|
|
245
252
|
static async open(e2, r3, n2, a) {
|
|
246
|
-
await import("./chunk-
|
|
253
|
+
await import("./chunk-UGQPYZPJ.js");
|
|
247
254
|
const m = arguments.length === 2, l2 = n2 || e2, t = new this();
|
|
248
255
|
let p = false;
|
|
249
256
|
t.dispose = () => {
|
|
@@ -590,703 +597,9 @@ var d = class {
|
|
|
590
597
|
};
|
|
591
598
|
var overlayStack = new d();
|
|
592
599
|
|
|
593
|
-
// node_modules/@floating-ui/
|
|
600
|
+
// node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
|
594
601
|
var min = Math.min;
|
|
595
602
|
var max = Math.max;
|
|
596
|
-
var oppositeSideMap = {
|
|
597
|
-
left: "right",
|
|
598
|
-
right: "left",
|
|
599
|
-
bottom: "top",
|
|
600
|
-
top: "bottom"
|
|
601
|
-
};
|
|
602
|
-
function clamp(start, value, end) {
|
|
603
|
-
return max(start, min(value, end));
|
|
604
|
-
}
|
|
605
|
-
function evaluate(value, param) {
|
|
606
|
-
return typeof value === "function" ? value(param) : value;
|
|
607
|
-
}
|
|
608
|
-
function getSide(placement) {
|
|
609
|
-
return placement.split("-")[0];
|
|
610
|
-
}
|
|
611
|
-
function getAlignment(placement) {
|
|
612
|
-
return placement.split("-")[1];
|
|
613
|
-
}
|
|
614
|
-
function getOppositeAxis(axis) {
|
|
615
|
-
return axis === "x" ? "y" : "x";
|
|
616
|
-
}
|
|
617
|
-
function getAxisLength(axis) {
|
|
618
|
-
return axis === "y" ? "height" : "width";
|
|
619
|
-
}
|
|
620
|
-
function getSideAxis(placement) {
|
|
621
|
-
const firstChar = placement[0];
|
|
622
|
-
return firstChar === "t" || firstChar === "b" ? "y" : "x";
|
|
623
|
-
}
|
|
624
|
-
function getAlignmentAxis(placement) {
|
|
625
|
-
return getOppositeAxis(getSideAxis(placement));
|
|
626
|
-
}
|
|
627
|
-
function getAlignmentSides(placement, rects, rtl) {
|
|
628
|
-
if (rtl === void 0) {
|
|
629
|
-
rtl = false;
|
|
630
|
-
}
|
|
631
|
-
const alignment = getAlignment(placement);
|
|
632
|
-
const alignmentAxis = getAlignmentAxis(placement);
|
|
633
|
-
const length = getAxisLength(alignmentAxis);
|
|
634
|
-
let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
|
|
635
|
-
if (rects.reference[length] > rects.floating[length]) {
|
|
636
|
-
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
637
|
-
}
|
|
638
|
-
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
|
|
639
|
-
}
|
|
640
|
-
function getExpandedPlacements(placement) {
|
|
641
|
-
const oppositePlacement = getOppositePlacement(placement);
|
|
642
|
-
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
643
|
-
}
|
|
644
|
-
function getOppositeAlignmentPlacement(placement) {
|
|
645
|
-
return placement.includes("start") ? placement.replace("start", "end") : placement.replace("end", "start");
|
|
646
|
-
}
|
|
647
|
-
var lrPlacement = ["left", "right"];
|
|
648
|
-
var rlPlacement = ["right", "left"];
|
|
649
|
-
var tbPlacement = ["top", "bottom"];
|
|
650
|
-
var btPlacement = ["bottom", "top"];
|
|
651
|
-
function getSideList(side, isStart, rtl) {
|
|
652
|
-
switch (side) {
|
|
653
|
-
case "top":
|
|
654
|
-
case "bottom":
|
|
655
|
-
if (rtl) return isStart ? rlPlacement : lrPlacement;
|
|
656
|
-
return isStart ? lrPlacement : rlPlacement;
|
|
657
|
-
case "left":
|
|
658
|
-
case "right":
|
|
659
|
-
return isStart ? tbPlacement : btPlacement;
|
|
660
|
-
default:
|
|
661
|
-
return [];
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
665
|
-
const alignment = getAlignment(placement);
|
|
666
|
-
let list = getSideList(getSide(placement), direction === "start", rtl);
|
|
667
|
-
if (alignment) {
|
|
668
|
-
list = list.map((side) => side + "-" + alignment);
|
|
669
|
-
if (flipAlignment) {
|
|
670
|
-
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
return list;
|
|
674
|
-
}
|
|
675
|
-
function getOppositePlacement(placement) {
|
|
676
|
-
const side = getSide(placement);
|
|
677
|
-
return oppositeSideMap[side] + placement.slice(side.length);
|
|
678
|
-
}
|
|
679
|
-
function expandPaddingObject(padding) {
|
|
680
|
-
var _padding$top, _padding$right, _padding$bottom, _padding$left;
|
|
681
|
-
return {
|
|
682
|
-
top: (_padding$top = padding.top) != null ? _padding$top : 0,
|
|
683
|
-
right: (_padding$right = padding.right) != null ? _padding$right : 0,
|
|
684
|
-
bottom: (_padding$bottom = padding.bottom) != null ? _padding$bottom : 0,
|
|
685
|
-
left: (_padding$left = padding.left) != null ? _padding$left : 0
|
|
686
|
-
};
|
|
687
|
-
}
|
|
688
|
-
function getPaddingObject(padding) {
|
|
689
|
-
return typeof padding !== "number" ? expandPaddingObject(padding) : {
|
|
690
|
-
top: padding,
|
|
691
|
-
right: padding,
|
|
692
|
-
bottom: padding,
|
|
693
|
-
left: padding
|
|
694
|
-
};
|
|
695
|
-
}
|
|
696
|
-
function rectToClientRect(rect) {
|
|
697
|
-
const {
|
|
698
|
-
x,
|
|
699
|
-
y: y2,
|
|
700
|
-
width,
|
|
701
|
-
height
|
|
702
|
-
} = rect;
|
|
703
|
-
return {
|
|
704
|
-
width,
|
|
705
|
-
height,
|
|
706
|
-
top: y2,
|
|
707
|
-
left: x,
|
|
708
|
-
right: x + width,
|
|
709
|
-
bottom: y2 + height,
|
|
710
|
-
x,
|
|
711
|
-
y: y2
|
|
712
|
-
};
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
// node_modules/@floating-ui/core/dist/floating-ui.core.mjs
|
|
716
|
-
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
717
|
-
let {
|
|
718
|
-
reference,
|
|
719
|
-
floating
|
|
720
|
-
} = _ref;
|
|
721
|
-
const sideAxis = getSideAxis(placement);
|
|
722
|
-
const alignmentAxis = getAlignmentAxis(placement);
|
|
723
|
-
const alignLength = getAxisLength(alignmentAxis);
|
|
724
|
-
const side = getSide(placement);
|
|
725
|
-
const isVertical = sideAxis === "y";
|
|
726
|
-
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
|
727
|
-
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
|
728
|
-
const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
|
|
729
|
-
let coords;
|
|
730
|
-
switch (side) {
|
|
731
|
-
case "top":
|
|
732
|
-
coords = {
|
|
733
|
-
x: commonX,
|
|
734
|
-
y: reference.y - floating.height
|
|
735
|
-
};
|
|
736
|
-
break;
|
|
737
|
-
case "bottom":
|
|
738
|
-
coords = {
|
|
739
|
-
x: commonX,
|
|
740
|
-
y: reference.y + reference.height
|
|
741
|
-
};
|
|
742
|
-
break;
|
|
743
|
-
case "right":
|
|
744
|
-
coords = {
|
|
745
|
-
x: reference.x + reference.width,
|
|
746
|
-
y: commonY
|
|
747
|
-
};
|
|
748
|
-
break;
|
|
749
|
-
case "left":
|
|
750
|
-
coords = {
|
|
751
|
-
x: reference.x - floating.width,
|
|
752
|
-
y: commonY
|
|
753
|
-
};
|
|
754
|
-
break;
|
|
755
|
-
default:
|
|
756
|
-
coords = {
|
|
757
|
-
x: reference.x,
|
|
758
|
-
y: reference.y
|
|
759
|
-
};
|
|
760
|
-
}
|
|
761
|
-
const alignment = getAlignment(placement);
|
|
762
|
-
if (alignment) {
|
|
763
|
-
coords[alignmentAxis] += commonAlign * (alignment === "end" ? 1 : -1) * (rtl && isVertical ? -1 : 1);
|
|
764
|
-
}
|
|
765
|
-
return coords;
|
|
766
|
-
}
|
|
767
|
-
async function detectOverflow(state, options) {
|
|
768
|
-
var _await$platform$isEle;
|
|
769
|
-
if (options === void 0) {
|
|
770
|
-
options = {};
|
|
771
|
-
}
|
|
772
|
-
const {
|
|
773
|
-
x,
|
|
774
|
-
y: y2,
|
|
775
|
-
platform: platform2,
|
|
776
|
-
rects,
|
|
777
|
-
elements,
|
|
778
|
-
strategy
|
|
779
|
-
} = state;
|
|
780
|
-
const {
|
|
781
|
-
boundary = "clippingAncestors",
|
|
782
|
-
rootBoundary = "viewport",
|
|
783
|
-
elementContext = "floating",
|
|
784
|
-
altBoundary = false,
|
|
785
|
-
padding = 0
|
|
786
|
-
} = evaluate(options, state);
|
|
787
|
-
const paddingObject = getPaddingObject(padding);
|
|
788
|
-
const altContext = elementContext === "floating" ? "reference" : "floating";
|
|
789
|
-
const element = elements[altBoundary ? altContext : elementContext];
|
|
790
|
-
const clippingClientRect = rectToClientRect(await platform2.getClippingRect({
|
|
791
|
-
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)),
|
|
792
|
-
boundary,
|
|
793
|
-
rootBoundary,
|
|
794
|
-
strategy
|
|
795
|
-
}));
|
|
796
|
-
const rect = elementContext === "floating" ? {
|
|
797
|
-
x,
|
|
798
|
-
y: y2,
|
|
799
|
-
width: rects.floating.width,
|
|
800
|
-
height: rects.floating.height
|
|
801
|
-
} : rects.reference;
|
|
802
|
-
const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating));
|
|
803
|
-
const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) && await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
|
|
804
|
-
x: 1,
|
|
805
|
-
y: 1
|
|
806
|
-
};
|
|
807
|
-
const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
808
|
-
elements,
|
|
809
|
-
rect,
|
|
810
|
-
offsetParent,
|
|
811
|
-
strategy
|
|
812
|
-
}) : rect);
|
|
813
|
-
return {
|
|
814
|
-
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
815
|
-
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
816
|
-
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
817
|
-
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
818
|
-
};
|
|
819
|
-
}
|
|
820
|
-
var MAX_RESET_COUNT = 50;
|
|
821
|
-
var computePosition = async (reference, floating, config) => {
|
|
822
|
-
const {
|
|
823
|
-
placement = "bottom",
|
|
824
|
-
strategy = "absolute",
|
|
825
|
-
middleware = [],
|
|
826
|
-
platform: platform2
|
|
827
|
-
} = config;
|
|
828
|
-
const platformWithDetectOverflow = platform2.detectOverflow ? platform2 : {
|
|
829
|
-
...platform2,
|
|
830
|
-
detectOverflow
|
|
831
|
-
};
|
|
832
|
-
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating));
|
|
833
|
-
let rects = await platform2.getElementRects({
|
|
834
|
-
reference,
|
|
835
|
-
floating,
|
|
836
|
-
strategy
|
|
837
|
-
});
|
|
838
|
-
let {
|
|
839
|
-
x,
|
|
840
|
-
y: y2
|
|
841
|
-
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
842
|
-
let statefulPlacement = placement;
|
|
843
|
-
let resetCount = 0;
|
|
844
|
-
const middlewareData = {};
|
|
845
|
-
for (let i2 = 0; i2 < middleware.length; i2++) {
|
|
846
|
-
const currentMiddleware = middleware[i2];
|
|
847
|
-
if (!currentMiddleware) {
|
|
848
|
-
continue;
|
|
849
|
-
}
|
|
850
|
-
const {
|
|
851
|
-
name,
|
|
852
|
-
fn
|
|
853
|
-
} = currentMiddleware;
|
|
854
|
-
const {
|
|
855
|
-
x: nextX,
|
|
856
|
-
y: nextY,
|
|
857
|
-
data,
|
|
858
|
-
reset
|
|
859
|
-
} = await fn({
|
|
860
|
-
x,
|
|
861
|
-
y: y2,
|
|
862
|
-
initialPlacement: placement,
|
|
863
|
-
placement: statefulPlacement,
|
|
864
|
-
strategy,
|
|
865
|
-
middlewareData,
|
|
866
|
-
rects,
|
|
867
|
-
platform: platformWithDetectOverflow,
|
|
868
|
-
elements: {
|
|
869
|
-
reference,
|
|
870
|
-
floating
|
|
871
|
-
}
|
|
872
|
-
});
|
|
873
|
-
x = nextX != null ? nextX : x;
|
|
874
|
-
y2 = nextY != null ? nextY : y2;
|
|
875
|
-
middlewareData[name] = {
|
|
876
|
-
...middlewareData[name],
|
|
877
|
-
...data
|
|
878
|
-
};
|
|
879
|
-
if (reset && resetCount < MAX_RESET_COUNT) {
|
|
880
|
-
resetCount++;
|
|
881
|
-
if (typeof reset === "object") {
|
|
882
|
-
if (reset.placement) {
|
|
883
|
-
statefulPlacement = reset.placement;
|
|
884
|
-
}
|
|
885
|
-
if (reset.rects) {
|
|
886
|
-
rects = reset.rects === true ? await platform2.getElementRects({
|
|
887
|
-
reference,
|
|
888
|
-
floating,
|
|
889
|
-
strategy
|
|
890
|
-
}) : reset.rects;
|
|
891
|
-
}
|
|
892
|
-
({
|
|
893
|
-
x,
|
|
894
|
-
y: y2
|
|
895
|
-
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
896
|
-
}
|
|
897
|
-
i2 = -1;
|
|
898
|
-
}
|
|
899
|
-
}
|
|
900
|
-
return {
|
|
901
|
-
x,
|
|
902
|
-
y: y2,
|
|
903
|
-
placement: statefulPlacement,
|
|
904
|
-
strategy,
|
|
905
|
-
middlewareData
|
|
906
|
-
};
|
|
907
|
-
};
|
|
908
|
-
var arrow = (options) => ({
|
|
909
|
-
name: "arrow",
|
|
910
|
-
options,
|
|
911
|
-
async fn(state) {
|
|
912
|
-
const {
|
|
913
|
-
x,
|
|
914
|
-
y: y2,
|
|
915
|
-
placement,
|
|
916
|
-
rects,
|
|
917
|
-
platform: platform2,
|
|
918
|
-
elements,
|
|
919
|
-
middlewareData
|
|
920
|
-
} = state;
|
|
921
|
-
const {
|
|
922
|
-
element,
|
|
923
|
-
padding = 0
|
|
924
|
-
} = evaluate(options, state) || {};
|
|
925
|
-
if (element == null) {
|
|
926
|
-
return {};
|
|
927
|
-
}
|
|
928
|
-
const paddingObject = getPaddingObject(padding);
|
|
929
|
-
const coords = {
|
|
930
|
-
x,
|
|
931
|
-
y: y2
|
|
932
|
-
};
|
|
933
|
-
const axis = getAlignmentAxis(placement);
|
|
934
|
-
const length = getAxisLength(axis);
|
|
935
|
-
const arrowDimensions = await platform2.getDimensions(element);
|
|
936
|
-
const isYAxis = axis === "y";
|
|
937
|
-
const minProp = isYAxis ? "top" : "left";
|
|
938
|
-
const maxProp = isYAxis ? "bottom" : "right";
|
|
939
|
-
const clientProp = isYAxis ? "clientHeight" : "clientWidth";
|
|
940
|
-
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
|
|
941
|
-
const startDiff = coords[axis] - rects.reference[axis];
|
|
942
|
-
const arrowOffsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(element));
|
|
943
|
-
let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
|
|
944
|
-
if (!clientSize || !await (platform2.isElement == null ? void 0 : platform2.isElement(arrowOffsetParent))) {
|
|
945
|
-
clientSize = elements.floating[clientProp] || rects.floating[length];
|
|
946
|
-
}
|
|
947
|
-
const centerToReference = endDiff / 2 - startDiff / 2;
|
|
948
|
-
const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
|
|
949
|
-
const minPadding = min(paddingObject[minProp], largestPossiblePadding);
|
|
950
|
-
const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
|
|
951
|
-
const max3 = clientSize - arrowDimensions[length] - maxPadding;
|
|
952
|
-
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
953
|
-
const offset3 = clamp(minPadding, center, max3);
|
|
954
|
-
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset3 && rects.reference[length] / 2 - (center < minPadding ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
955
|
-
const alignmentOffset = shouldAddOffset ? center < minPadding ? center - minPadding : center - max3 : 0;
|
|
956
|
-
return {
|
|
957
|
-
[axis]: coords[axis] + alignmentOffset,
|
|
958
|
-
data: {
|
|
959
|
-
[axis]: offset3,
|
|
960
|
-
centerOffset: center - offset3 - alignmentOffset,
|
|
961
|
-
...shouldAddOffset && {
|
|
962
|
-
alignmentOffset
|
|
963
|
-
}
|
|
964
|
-
},
|
|
965
|
-
reset: shouldAddOffset
|
|
966
|
-
};
|
|
967
|
-
}
|
|
968
|
-
});
|
|
969
|
-
var flip = function(options) {
|
|
970
|
-
if (options === void 0) {
|
|
971
|
-
options = {};
|
|
972
|
-
}
|
|
973
|
-
return {
|
|
974
|
-
name: "flip",
|
|
975
|
-
options,
|
|
976
|
-
async fn(state) {
|
|
977
|
-
var _middlewareData$arrow, _middlewareData$flip;
|
|
978
|
-
const {
|
|
979
|
-
placement,
|
|
980
|
-
middlewareData,
|
|
981
|
-
rects,
|
|
982
|
-
initialPlacement,
|
|
983
|
-
platform: platform2,
|
|
984
|
-
elements
|
|
985
|
-
} = state;
|
|
986
|
-
const {
|
|
987
|
-
mainAxis: checkMainAxis = true,
|
|
988
|
-
crossAxis: checkCrossAxis = true,
|
|
989
|
-
fallbackPlacements: specifiedFallbackPlacements,
|
|
990
|
-
fallbackStrategy = "bestFit",
|
|
991
|
-
fallbackAxisSideDirection = "none",
|
|
992
|
-
flipAlignment = true,
|
|
993
|
-
...detectOverflowOptions
|
|
994
|
-
} = evaluate(options, state);
|
|
995
|
-
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
996
|
-
return {};
|
|
997
|
-
}
|
|
998
|
-
const side = getSide(placement);
|
|
999
|
-
const initialSideAxis = getSideAxis(initialPlacement);
|
|
1000
|
-
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
1001
|
-
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
|
|
1002
|
-
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
1003
|
-
const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
|
|
1004
|
-
if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
|
|
1005
|
-
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
1006
|
-
}
|
|
1007
|
-
const placements2 = [initialPlacement, ...fallbackPlacements];
|
|
1008
|
-
const overflow = await platform2.detectOverflow(state, detectOverflowOptions);
|
|
1009
|
-
const overflows = [];
|
|
1010
|
-
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
1011
|
-
if (checkMainAxis) {
|
|
1012
|
-
overflows.push(overflow[side]);
|
|
1013
|
-
}
|
|
1014
|
-
if (checkCrossAxis) {
|
|
1015
|
-
const sides2 = getAlignmentSides(placement, rects, rtl);
|
|
1016
|
-
overflows.push(overflow[sides2[0]], overflow[sides2[1]]);
|
|
1017
|
-
}
|
|
1018
|
-
overflowsData = [...overflowsData, {
|
|
1019
|
-
placement,
|
|
1020
|
-
overflows
|
|
1021
|
-
}];
|
|
1022
|
-
if (!overflows.every((side2) => side2 <= 0)) {
|
|
1023
|
-
var _middlewareData$flip2, _overflowsData$filter;
|
|
1024
|
-
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
1025
|
-
const nextPlacement = placements2[nextIndex];
|
|
1026
|
-
if (nextPlacement) {
|
|
1027
|
-
const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false;
|
|
1028
|
-
if (!ignoreCrossAxisOverflow || // We leave the current main axis only if every placement on that axis
|
|
1029
|
-
// overflows the main axis.
|
|
1030
|
-
overflowsData.every((d2) => getSideAxis(d2.placement) === initialSideAxis ? d2.overflows[0] > 0 : true)) {
|
|
1031
|
-
return {
|
|
1032
|
-
data: {
|
|
1033
|
-
index: nextIndex,
|
|
1034
|
-
overflows: overflowsData
|
|
1035
|
-
},
|
|
1036
|
-
reset: {
|
|
1037
|
-
placement: nextPlacement
|
|
1038
|
-
}
|
|
1039
|
-
};
|
|
1040
|
-
}
|
|
1041
|
-
}
|
|
1042
|
-
let resetPlacement = (_overflowsData$filter = overflowsData.filter((d2) => d2.overflows[0] <= 0).sort((a, b3) => a.overflows[1] - b3.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
|
|
1043
|
-
if (!resetPlacement) {
|
|
1044
|
-
switch (fallbackStrategy) {
|
|
1045
|
-
case "bestFit": {
|
|
1046
|
-
var _overflowsData$filter2;
|
|
1047
|
-
const placement2 = (_overflowsData$filter2 = overflowsData.filter((d2) => {
|
|
1048
|
-
if (hasFallbackAxisSideDirection) {
|
|
1049
|
-
const currentSideAxis = getSideAxis(d2.placement);
|
|
1050
|
-
return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal
|
|
1051
|
-
// reading directions favoring greater width.
|
|
1052
|
-
currentSideAxis === "y";
|
|
1053
|
-
}
|
|
1054
|
-
return true;
|
|
1055
|
-
}).map((d2) => [d2.placement, d2.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a, b3) => a[1] - b3[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
|
|
1056
|
-
if (placement2) {
|
|
1057
|
-
resetPlacement = placement2;
|
|
1058
|
-
}
|
|
1059
|
-
break;
|
|
1060
|
-
}
|
|
1061
|
-
case "initialPlacement":
|
|
1062
|
-
resetPlacement = initialPlacement;
|
|
1063
|
-
break;
|
|
1064
|
-
}
|
|
1065
|
-
}
|
|
1066
|
-
if (placement !== resetPlacement) {
|
|
1067
|
-
return {
|
|
1068
|
-
reset: {
|
|
1069
|
-
placement: resetPlacement
|
|
1070
|
-
}
|
|
1071
|
-
};
|
|
1072
|
-
}
|
|
1073
|
-
}
|
|
1074
|
-
return {};
|
|
1075
|
-
}
|
|
1076
|
-
};
|
|
1077
|
-
};
|
|
1078
|
-
var originSides = /* @__PURE__ */ new Set(["left", "top"]);
|
|
1079
|
-
async function convertValueToCoords(state, options) {
|
|
1080
|
-
const {
|
|
1081
|
-
placement,
|
|
1082
|
-
platform: platform2,
|
|
1083
|
-
elements
|
|
1084
|
-
} = state;
|
|
1085
|
-
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
|
|
1086
|
-
const side = getSide(placement);
|
|
1087
|
-
const alignment = getAlignment(placement);
|
|
1088
|
-
const isVertical = getSideAxis(placement) === "y";
|
|
1089
|
-
const mainAxisMulti = originSides.has(side) ? -1 : 1;
|
|
1090
|
-
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
1091
|
-
const rawValue = evaluate(options, state);
|
|
1092
|
-
let {
|
|
1093
|
-
mainAxis,
|
|
1094
|
-
crossAxis,
|
|
1095
|
-
alignmentAxis
|
|
1096
|
-
} = typeof rawValue === "number" ? {
|
|
1097
|
-
mainAxis: rawValue,
|
|
1098
|
-
crossAxis: 0,
|
|
1099
|
-
alignmentAxis: null
|
|
1100
|
-
} : {
|
|
1101
|
-
mainAxis: rawValue.mainAxis || 0,
|
|
1102
|
-
crossAxis: rawValue.crossAxis || 0,
|
|
1103
|
-
alignmentAxis: rawValue.alignmentAxis
|
|
1104
|
-
};
|
|
1105
|
-
if (alignment && typeof alignmentAxis === "number") {
|
|
1106
|
-
crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
|
|
1107
|
-
}
|
|
1108
|
-
return isVertical ? {
|
|
1109
|
-
x: crossAxis * crossAxisMulti,
|
|
1110
|
-
y: mainAxis * mainAxisMulti
|
|
1111
|
-
} : {
|
|
1112
|
-
x: mainAxis * mainAxisMulti,
|
|
1113
|
-
y: crossAxis * crossAxisMulti
|
|
1114
|
-
};
|
|
1115
|
-
}
|
|
1116
|
-
var offset = function(options) {
|
|
1117
|
-
if (options === void 0) {
|
|
1118
|
-
options = 0;
|
|
1119
|
-
}
|
|
1120
|
-
return {
|
|
1121
|
-
name: "offset",
|
|
1122
|
-
options,
|
|
1123
|
-
async fn(state) {
|
|
1124
|
-
var _middlewareData$offse, _middlewareData$arrow;
|
|
1125
|
-
const {
|
|
1126
|
-
x,
|
|
1127
|
-
y: y2,
|
|
1128
|
-
placement,
|
|
1129
|
-
middlewareData
|
|
1130
|
-
} = state;
|
|
1131
|
-
const diffCoords = await convertValueToCoords(state, options);
|
|
1132
|
-
if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
1133
|
-
return {};
|
|
1134
|
-
}
|
|
1135
|
-
return {
|
|
1136
|
-
x: x + diffCoords.x,
|
|
1137
|
-
y: y2 + diffCoords.y,
|
|
1138
|
-
data: {
|
|
1139
|
-
...diffCoords,
|
|
1140
|
-
placement
|
|
1141
|
-
}
|
|
1142
|
-
};
|
|
1143
|
-
}
|
|
1144
|
-
};
|
|
1145
|
-
};
|
|
1146
|
-
var shift = function(options) {
|
|
1147
|
-
if (options === void 0) {
|
|
1148
|
-
options = {};
|
|
1149
|
-
}
|
|
1150
|
-
return {
|
|
1151
|
-
name: "shift",
|
|
1152
|
-
options,
|
|
1153
|
-
async fn(state) {
|
|
1154
|
-
const {
|
|
1155
|
-
x,
|
|
1156
|
-
y: y2,
|
|
1157
|
-
placement,
|
|
1158
|
-
platform: platform2
|
|
1159
|
-
} = state;
|
|
1160
|
-
const {
|
|
1161
|
-
mainAxis: checkMainAxis = true,
|
|
1162
|
-
crossAxis: checkCrossAxis = false,
|
|
1163
|
-
limiter = {
|
|
1164
|
-
fn: (_ref) => {
|
|
1165
|
-
let {
|
|
1166
|
-
x: x2,
|
|
1167
|
-
y: y3
|
|
1168
|
-
} = _ref;
|
|
1169
|
-
return {
|
|
1170
|
-
x: x2,
|
|
1171
|
-
y: y3
|
|
1172
|
-
};
|
|
1173
|
-
}
|
|
1174
|
-
},
|
|
1175
|
-
...detectOverflowOptions
|
|
1176
|
-
} = evaluate(options, state);
|
|
1177
|
-
const coords = {
|
|
1178
|
-
x,
|
|
1179
|
-
y: y2
|
|
1180
|
-
};
|
|
1181
|
-
const overflow = await platform2.detectOverflow(state, detectOverflowOptions);
|
|
1182
|
-
const crossAxis = getSideAxis(placement);
|
|
1183
|
-
const mainAxis = getOppositeAxis(crossAxis);
|
|
1184
|
-
let mainAxisCoord = coords[mainAxis];
|
|
1185
|
-
let crossAxisCoord = coords[crossAxis];
|
|
1186
|
-
const clampCoord = (axis, coord) => clamp(coord + overflow[axis === "y" ? "top" : "left"], coord, coord - overflow[axis === "y" ? "bottom" : "right"]);
|
|
1187
|
-
if (checkMainAxis) {
|
|
1188
|
-
mainAxisCoord = clampCoord(mainAxis, mainAxisCoord);
|
|
1189
|
-
}
|
|
1190
|
-
if (checkCrossAxis) {
|
|
1191
|
-
crossAxisCoord = clampCoord(crossAxis, crossAxisCoord);
|
|
1192
|
-
}
|
|
1193
|
-
const limitedCoords = limiter.fn({
|
|
1194
|
-
...state,
|
|
1195
|
-
[mainAxis]: mainAxisCoord,
|
|
1196
|
-
[crossAxis]: crossAxisCoord
|
|
1197
|
-
});
|
|
1198
|
-
return {
|
|
1199
|
-
...limitedCoords,
|
|
1200
|
-
data: {
|
|
1201
|
-
x: limitedCoords.x - x,
|
|
1202
|
-
y: limitedCoords.y - y2,
|
|
1203
|
-
enabled: {
|
|
1204
|
-
[mainAxis]: checkMainAxis,
|
|
1205
|
-
[crossAxis]: checkCrossAxis
|
|
1206
|
-
}
|
|
1207
|
-
}
|
|
1208
|
-
};
|
|
1209
|
-
}
|
|
1210
|
-
};
|
|
1211
|
-
};
|
|
1212
|
-
var size = function(options) {
|
|
1213
|
-
if (options === void 0) {
|
|
1214
|
-
options = {};
|
|
1215
|
-
}
|
|
1216
|
-
return {
|
|
1217
|
-
name: "size",
|
|
1218
|
-
options,
|
|
1219
|
-
async fn(state) {
|
|
1220
|
-
const {
|
|
1221
|
-
placement,
|
|
1222
|
-
rects,
|
|
1223
|
-
platform: platform2,
|
|
1224
|
-
elements
|
|
1225
|
-
} = state;
|
|
1226
|
-
const {
|
|
1227
|
-
apply = () => {
|
|
1228
|
-
},
|
|
1229
|
-
...detectOverflowOptions
|
|
1230
|
-
} = evaluate(options, state);
|
|
1231
|
-
const overflow = await platform2.detectOverflow(state, detectOverflowOptions);
|
|
1232
|
-
const side = getSide(placement);
|
|
1233
|
-
const alignment = getAlignment(placement);
|
|
1234
|
-
const isYAxis = getSideAxis(placement) === "y";
|
|
1235
|
-
const {
|
|
1236
|
-
width,
|
|
1237
|
-
height
|
|
1238
|
-
} = rects.floating;
|
|
1239
|
-
let heightSide;
|
|
1240
|
-
let widthSide;
|
|
1241
|
-
if (side === "top" || side === "bottom") {
|
|
1242
|
-
heightSide = side;
|
|
1243
|
-
widthSide = alignment === (await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right";
|
|
1244
|
-
} else {
|
|
1245
|
-
widthSide = side;
|
|
1246
|
-
heightSide = alignment === "end" ? "top" : "bottom";
|
|
1247
|
-
}
|
|
1248
|
-
const maximumClippingHeight = height - overflow.top - overflow.bottom;
|
|
1249
|
-
const maximumClippingWidth = width - overflow.left - overflow.right;
|
|
1250
|
-
const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
|
|
1251
|
-
const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
|
|
1252
|
-
const shiftData = state.middlewareData.shift;
|
|
1253
|
-
const noShift = !shiftData;
|
|
1254
|
-
let availableHeight = overflowAvailableHeight;
|
|
1255
|
-
let availableWidth = overflowAvailableWidth;
|
|
1256
|
-
if (shiftData != null && shiftData.enabled.x) {
|
|
1257
|
-
availableWidth = maximumClippingWidth;
|
|
1258
|
-
}
|
|
1259
|
-
if (shiftData != null && shiftData.enabled.y) {
|
|
1260
|
-
availableHeight = maximumClippingHeight;
|
|
1261
|
-
}
|
|
1262
|
-
if (noShift && !alignment) {
|
|
1263
|
-
if (isYAxis) {
|
|
1264
|
-
availableWidth = width - 2 * max(overflow.left, overflow.right);
|
|
1265
|
-
} else {
|
|
1266
|
-
availableHeight = height - 2 * max(overflow.top, overflow.bottom);
|
|
1267
|
-
}
|
|
1268
|
-
}
|
|
1269
|
-
await apply({
|
|
1270
|
-
...state,
|
|
1271
|
-
availableWidth,
|
|
1272
|
-
availableHeight
|
|
1273
|
-
});
|
|
1274
|
-
const nextDimensions = await platform2.getDimensions(elements.floating);
|
|
1275
|
-
if (width !== nextDimensions.width || height !== nextDimensions.height) {
|
|
1276
|
-
return {
|
|
1277
|
-
reset: {
|
|
1278
|
-
rects: true
|
|
1279
|
-
}
|
|
1280
|
-
};
|
|
1281
|
-
}
|
|
1282
|
-
return {};
|
|
1283
|
-
}
|
|
1284
|
-
};
|
|
1285
|
-
};
|
|
1286
|
-
|
|
1287
|
-
// node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
|
1288
|
-
var min2 = Math.min;
|
|
1289
|
-
var max2 = Math.max;
|
|
1290
603
|
var round = Math.round;
|
|
1291
604
|
var floor = Math.floor;
|
|
1292
605
|
var createCoords = (v) => ({
|
|
@@ -1627,12 +940,12 @@ function getDocumentRect(element) {
|
|
|
1627
940
|
const html = getDocumentElement(element);
|
|
1628
941
|
const scroll = getNodeScroll(element);
|
|
1629
942
|
const body = element.ownerDocument.body;
|
|
1630
|
-
const width =
|
|
1631
|
-
const height =
|
|
943
|
+
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
944
|
+
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
1632
945
|
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
1633
946
|
const y2 = -scroll.scrollTop;
|
|
1634
947
|
if (getComputedStyle2(body).direction === "rtl") {
|
|
1635
|
-
x +=
|
|
948
|
+
x += max(html.clientWidth, body.clientWidth) - width;
|
|
1636
949
|
}
|
|
1637
950
|
return {
|
|
1638
951
|
width,
|
|
@@ -1760,10 +1073,10 @@ function getClippingRect(_ref) {
|
|
|
1760
1073
|
const firstClippingAncestor = clippingAncestors[0];
|
|
1761
1074
|
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
1762
1075
|
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
|
1763
|
-
accRect.top =
|
|
1764
|
-
accRect.right =
|
|
1765
|
-
accRect.bottom =
|
|
1766
|
-
accRect.left =
|
|
1076
|
+
accRect.top = max(rect.top, accRect.top);
|
|
1077
|
+
accRect.right = min(rect.right, accRect.right);
|
|
1078
|
+
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
1079
|
+
accRect.left = max(rect.left, accRect.left);
|
|
1767
1080
|
return accRect;
|
|
1768
1081
|
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
|
1769
1082
|
return {
|
|
@@ -1931,7 +1244,7 @@ function observeMove(element, onMove) {
|
|
|
1931
1244
|
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
|
|
1932
1245
|
const options = {
|
|
1933
1246
|
rootMargin,
|
|
1934
|
-
threshold:
|
|
1247
|
+
threshold: max(0, min(1, threshold)) || 1
|
|
1935
1248
|
};
|
|
1936
1249
|
let isFirstUpdate = true;
|
|
1937
1250
|
function handleObserve(entries) {
|
|
@@ -2164,9 +1477,9 @@ var InteractionController = class {
|
|
|
2164
1477
|
return;
|
|
2165
1478
|
}
|
|
2166
1479
|
e2 && (customElements.whenDefined("sp-overlay").then(async () => {
|
|
2167
|
-
const { Overlay: t } = await import("./chunk-
|
|
1480
|
+
const { Overlay: t } = await import("./chunk-VGYK6PQ4.js");
|
|
2168
1481
|
this.overlay = new t(), this.overlay.open = true, this.target[lastInteractionType] = this.type;
|
|
2169
|
-
}), import("./chunk-
|
|
1482
|
+
}), import("./chunk-UGQPYZPJ.js"));
|
|
2170
1483
|
}
|
|
2171
1484
|
}
|
|
2172
1485
|
get overlay() {
|
|
@@ -2635,4 +1948,4 @@ export {
|
|
|
2635
1948
|
LONGPRESS_INSTRUCTIONS,
|
|
2636
1949
|
Overlay
|
|
2637
1950
|
};
|
|
2638
|
-
//# sourceMappingURL=chunk-
|
|
1951
|
+
//# sourceMappingURL=chunk-BALQPQXE.js.map
|