@deck.gl/widgets 9.3.0-alpha.3 → 9.3.0-alpha.6
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/dist.dev.js +311 -242
- package/dist/index.cjs +23 -4
- package/dist/index.cjs.map +2 -2
- package/dist/lib/components/popover.d.ts.map +1 -1
- package/dist/lib/components/popover.js +6 -3
- package/dist/lib/components/popover.js.map +1 -1
- package/dist/stats-widget.d.ts +1 -0
- package/dist/stats-widget.d.ts.map +1 -1
- package/dist/stats-widget.js +17 -1
- package/dist/stats-widget.js.map +1 -1
- package/dist/stylesheet.css +8 -0
- package/dist.min.js +2 -2
- package/package.json +4 -4
- package/src/lib/components/popover.tsx +6 -5
- package/src/stats-widget.tsx +18 -0
- package/src/stylesheet.css +8 -0
package/dist/dist.dev.js
CHANGED
|
@@ -1870,19 +1870,21 @@ var __exports__ = (() => {
|
|
|
1870
1870
|
// src/info-widget.tsx
|
|
1871
1871
|
var import_core12 = __toESM(require_core(), 1);
|
|
1872
1872
|
|
|
1873
|
-
// ../../node_modules/@floating-ui/
|
|
1873
|
+
// ../../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
|
1874
1874
|
var min = Math.min;
|
|
1875
1875
|
var max = Math.max;
|
|
1876
|
+
var round = Math.round;
|
|
1877
|
+
var floor = Math.floor;
|
|
1878
|
+
var createCoords = (v3) => ({
|
|
1879
|
+
x: v3,
|
|
1880
|
+
y: v3
|
|
1881
|
+
});
|
|
1876
1882
|
var oppositeSideMap = {
|
|
1877
1883
|
left: "right",
|
|
1878
1884
|
right: "left",
|
|
1879
1885
|
bottom: "top",
|
|
1880
1886
|
top: "bottom"
|
|
1881
1887
|
};
|
|
1882
|
-
var oppositeAlignmentMap = {
|
|
1883
|
-
start: "end",
|
|
1884
|
-
end: "start"
|
|
1885
|
-
};
|
|
1886
1888
|
function clamp(start, value, end) {
|
|
1887
1889
|
return max(start, min(value, end));
|
|
1888
1890
|
}
|
|
@@ -1902,7 +1904,8 @@ var __exports__ = (() => {
|
|
|
1902
1904
|
return axis === "y" ? "height" : "width";
|
|
1903
1905
|
}
|
|
1904
1906
|
function getSideAxis(placement) {
|
|
1905
|
-
|
|
1907
|
+
const firstChar = placement[0];
|
|
1908
|
+
return firstChar === "t" || firstChar === "b" ? "y" : "x";
|
|
1906
1909
|
}
|
|
1907
1910
|
function getAlignmentAxis(placement) {
|
|
1908
1911
|
return getOppositeAxis(getSideAxis(placement));
|
|
@@ -1925,22 +1928,22 @@ var __exports__ = (() => {
|
|
|
1925
1928
|
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
1926
1929
|
}
|
|
1927
1930
|
function getOppositeAlignmentPlacement(placement) {
|
|
1928
|
-
return placement.replace(
|
|
1931
|
+
return placement.includes("start") ? placement.replace("start", "end") : placement.replace("end", "start");
|
|
1929
1932
|
}
|
|
1933
|
+
var lrPlacement = ["left", "right"];
|
|
1934
|
+
var rlPlacement = ["right", "left"];
|
|
1935
|
+
var tbPlacement = ["top", "bottom"];
|
|
1936
|
+
var btPlacement = ["bottom", "top"];
|
|
1930
1937
|
function getSideList(side, isStart, rtl) {
|
|
1931
|
-
const lr = ["left", "right"];
|
|
1932
|
-
const rl = ["right", "left"];
|
|
1933
|
-
const tb = ["top", "bottom"];
|
|
1934
|
-
const bt = ["bottom", "top"];
|
|
1935
1938
|
switch (side) {
|
|
1936
1939
|
case "top":
|
|
1937
1940
|
case "bottom":
|
|
1938
1941
|
if (rtl)
|
|
1939
|
-
return isStart ?
|
|
1940
|
-
return isStart ?
|
|
1942
|
+
return isStart ? rlPlacement : lrPlacement;
|
|
1943
|
+
return isStart ? lrPlacement : rlPlacement;
|
|
1941
1944
|
case "left":
|
|
1942
1945
|
case "right":
|
|
1943
|
-
return isStart ?
|
|
1946
|
+
return isStart ? tbPlacement : btPlacement;
|
|
1944
1947
|
default:
|
|
1945
1948
|
return [];
|
|
1946
1949
|
}
|
|
@@ -1957,7 +1960,8 @@ var __exports__ = (() => {
|
|
|
1957
1960
|
return list;
|
|
1958
1961
|
}
|
|
1959
1962
|
function getOppositePlacement(placement) {
|
|
1960
|
-
|
|
1963
|
+
const side = getSide(placement);
|
|
1964
|
+
return oppositeSideMap[side] + placement.slice(side.length);
|
|
1961
1965
|
}
|
|
1962
1966
|
function expandPaddingObject(padding) {
|
|
1963
1967
|
return {
|
|
@@ -2051,6 +2055,63 @@ var __exports__ = (() => {
|
|
|
2051
2055
|
}
|
|
2052
2056
|
return coords;
|
|
2053
2057
|
}
|
|
2058
|
+
async function detectOverflow(state, options) {
|
|
2059
|
+
var _await$platform$isEle;
|
|
2060
|
+
if (options === void 0) {
|
|
2061
|
+
options = {};
|
|
2062
|
+
}
|
|
2063
|
+
const {
|
|
2064
|
+
x: x2,
|
|
2065
|
+
y: y3,
|
|
2066
|
+
platform: platform2,
|
|
2067
|
+
rects,
|
|
2068
|
+
elements,
|
|
2069
|
+
strategy
|
|
2070
|
+
} = state;
|
|
2071
|
+
const {
|
|
2072
|
+
boundary = "clippingAncestors",
|
|
2073
|
+
rootBoundary = "viewport",
|
|
2074
|
+
elementContext = "floating",
|
|
2075
|
+
altBoundary = false,
|
|
2076
|
+
padding = 0
|
|
2077
|
+
} = evaluate(options, state);
|
|
2078
|
+
const paddingObject = getPaddingObject(padding);
|
|
2079
|
+
const altContext = elementContext === "floating" ? "reference" : "floating";
|
|
2080
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
2081
|
+
const clippingClientRect = rectToClientRect(await platform2.getClippingRect({
|
|
2082
|
+
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)),
|
|
2083
|
+
boundary,
|
|
2084
|
+
rootBoundary,
|
|
2085
|
+
strategy
|
|
2086
|
+
}));
|
|
2087
|
+
const rect = elementContext === "floating" ? {
|
|
2088
|
+
x: x2,
|
|
2089
|
+
y: y3,
|
|
2090
|
+
width: rects.floating.width,
|
|
2091
|
+
height: rects.floating.height
|
|
2092
|
+
} : rects.reference;
|
|
2093
|
+
const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating));
|
|
2094
|
+
const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
|
|
2095
|
+
x: 1,
|
|
2096
|
+
y: 1
|
|
2097
|
+
} : {
|
|
2098
|
+
x: 1,
|
|
2099
|
+
y: 1
|
|
2100
|
+
};
|
|
2101
|
+
const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
2102
|
+
elements,
|
|
2103
|
+
rect,
|
|
2104
|
+
offsetParent,
|
|
2105
|
+
strategy
|
|
2106
|
+
}) : rect);
|
|
2107
|
+
return {
|
|
2108
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
2109
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
2110
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
2111
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
2112
|
+
};
|
|
2113
|
+
}
|
|
2114
|
+
var MAX_RESET_COUNT = 50;
|
|
2054
2115
|
var computePosition = async (reference, floating, config) => {
|
|
2055
2116
|
const {
|
|
2056
2117
|
placement = "bottom",
|
|
@@ -2058,7 +2119,10 @@ var __exports__ = (() => {
|
|
|
2058
2119
|
middleware = [],
|
|
2059
2120
|
platform: platform2
|
|
2060
2121
|
} = config;
|
|
2061
|
-
const
|
|
2122
|
+
const platformWithDetectOverflow = platform2.detectOverflow ? platform2 : {
|
|
2123
|
+
...platform2,
|
|
2124
|
+
detectOverflow
|
|
2125
|
+
};
|
|
2062
2126
|
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating));
|
|
2063
2127
|
let rects = await platform2.getElementRects({
|
|
2064
2128
|
reference,
|
|
@@ -2070,13 +2134,17 @@ var __exports__ = (() => {
|
|
|
2070
2134
|
y: y3
|
|
2071
2135
|
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
2072
2136
|
let statefulPlacement = placement;
|
|
2073
|
-
let middlewareData = {};
|
|
2074
2137
|
let resetCount = 0;
|
|
2075
|
-
|
|
2138
|
+
const middlewareData = {};
|
|
2139
|
+
for (let i4 = 0; i4 < middleware.length; i4++) {
|
|
2140
|
+
const currentMiddleware = middleware[i4];
|
|
2141
|
+
if (!currentMiddleware) {
|
|
2142
|
+
continue;
|
|
2143
|
+
}
|
|
2076
2144
|
const {
|
|
2077
2145
|
name,
|
|
2078
2146
|
fn
|
|
2079
|
-
} =
|
|
2147
|
+
} = currentMiddleware;
|
|
2080
2148
|
const {
|
|
2081
2149
|
x: nextX,
|
|
2082
2150
|
y: nextY,
|
|
@@ -2090,7 +2158,7 @@ var __exports__ = (() => {
|
|
|
2090
2158
|
strategy,
|
|
2091
2159
|
middlewareData,
|
|
2092
2160
|
rects,
|
|
2093
|
-
platform:
|
|
2161
|
+
platform: platformWithDetectOverflow,
|
|
2094
2162
|
elements: {
|
|
2095
2163
|
reference,
|
|
2096
2164
|
floating
|
|
@@ -2098,14 +2166,11 @@ var __exports__ = (() => {
|
|
|
2098
2166
|
});
|
|
2099
2167
|
x2 = nextX != null ? nextX : x2;
|
|
2100
2168
|
y3 = nextY != null ? nextY : y3;
|
|
2101
|
-
middlewareData = {
|
|
2102
|
-
...middlewareData,
|
|
2103
|
-
|
|
2104
|
-
...middlewareData[name],
|
|
2105
|
-
...data
|
|
2106
|
-
}
|
|
2169
|
+
middlewareData[name] = {
|
|
2170
|
+
...middlewareData[name],
|
|
2171
|
+
...data
|
|
2107
2172
|
};
|
|
2108
|
-
if (reset && resetCount
|
|
2173
|
+
if (reset && resetCount < MAX_RESET_COUNT) {
|
|
2109
2174
|
resetCount++;
|
|
2110
2175
|
if (typeof reset === "object") {
|
|
2111
2176
|
if (reset.placement) {
|
|
@@ -2134,62 +2199,6 @@ var __exports__ = (() => {
|
|
|
2134
2199
|
middlewareData
|
|
2135
2200
|
};
|
|
2136
2201
|
};
|
|
2137
|
-
async function detectOverflow(state, options) {
|
|
2138
|
-
var _await$platform$isEle;
|
|
2139
|
-
if (options === void 0) {
|
|
2140
|
-
options = {};
|
|
2141
|
-
}
|
|
2142
|
-
const {
|
|
2143
|
-
x: x2,
|
|
2144
|
-
y: y3,
|
|
2145
|
-
platform: platform2,
|
|
2146
|
-
rects,
|
|
2147
|
-
elements,
|
|
2148
|
-
strategy
|
|
2149
|
-
} = state;
|
|
2150
|
-
const {
|
|
2151
|
-
boundary = "clippingAncestors",
|
|
2152
|
-
rootBoundary = "viewport",
|
|
2153
|
-
elementContext = "floating",
|
|
2154
|
-
altBoundary = false,
|
|
2155
|
-
padding = 0
|
|
2156
|
-
} = evaluate(options, state);
|
|
2157
|
-
const paddingObject = getPaddingObject(padding);
|
|
2158
|
-
const altContext = elementContext === "floating" ? "reference" : "floating";
|
|
2159
|
-
const element = elements[altBoundary ? altContext : elementContext];
|
|
2160
|
-
const clippingClientRect = rectToClientRect(await platform2.getClippingRect({
|
|
2161
|
-
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)),
|
|
2162
|
-
boundary,
|
|
2163
|
-
rootBoundary,
|
|
2164
|
-
strategy
|
|
2165
|
-
}));
|
|
2166
|
-
const rect = elementContext === "floating" ? {
|
|
2167
|
-
x: x2,
|
|
2168
|
-
y: y3,
|
|
2169
|
-
width: rects.floating.width,
|
|
2170
|
-
height: rects.floating.height
|
|
2171
|
-
} : rects.reference;
|
|
2172
|
-
const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating));
|
|
2173
|
-
const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
|
|
2174
|
-
x: 1,
|
|
2175
|
-
y: 1
|
|
2176
|
-
} : {
|
|
2177
|
-
x: 1,
|
|
2178
|
-
y: 1
|
|
2179
|
-
};
|
|
2180
|
-
const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
2181
|
-
elements,
|
|
2182
|
-
rect,
|
|
2183
|
-
offsetParent,
|
|
2184
|
-
strategy
|
|
2185
|
-
}) : rect);
|
|
2186
|
-
return {
|
|
2187
|
-
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
2188
|
-
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
2189
|
-
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
2190
|
-
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
2191
|
-
};
|
|
2192
|
-
}
|
|
2193
2202
|
var arrow = (options) => ({
|
|
2194
2203
|
name: "arrow",
|
|
2195
2204
|
options,
|
|
@@ -2234,11 +2243,11 @@ var __exports__ = (() => {
|
|
|
2234
2243
|
const minPadding = min(paddingObject[minProp], largestPossiblePadding);
|
|
2235
2244
|
const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
|
|
2236
2245
|
const min$1 = minPadding;
|
|
2237
|
-
const
|
|
2246
|
+
const max2 = clientSize - arrowDimensions[length] - maxPadding;
|
|
2238
2247
|
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
2239
|
-
const offset3 = clamp(min$1, center,
|
|
2248
|
+
const offset3 = clamp(min$1, center, max2);
|
|
2240
2249
|
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset3 && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
2241
|
-
const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center -
|
|
2250
|
+
const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max2 : 0;
|
|
2242
2251
|
return {
|
|
2243
2252
|
[axis]: coords[axis] + alignmentOffset,
|
|
2244
2253
|
data: {
|
|
@@ -2291,7 +2300,7 @@ var __exports__ = (() => {
|
|
|
2291
2300
|
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
2292
2301
|
}
|
|
2293
2302
|
const placements2 = [initialPlacement, ...fallbackPlacements];
|
|
2294
|
-
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
2303
|
+
const overflow = await platform2.detectOverflow(state, detectOverflowOptions);
|
|
2295
2304
|
const overflows = [];
|
|
2296
2305
|
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
2297
2306
|
if (checkMainAxis) {
|
|
@@ -2310,15 +2319,20 @@ var __exports__ = (() => {
|
|
|
2310
2319
|
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
2311
2320
|
const nextPlacement = placements2[nextIndex];
|
|
2312
2321
|
if (nextPlacement) {
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
+
const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false;
|
|
2323
|
+
if (!ignoreCrossAxisOverflow || // We leave the current main axis only if every placement on that axis
|
|
2324
|
+
// overflows the main axis.
|
|
2325
|
+
overflowsData.every((d3) => getSideAxis(d3.placement) === initialSideAxis ? d3.overflows[0] > 0 : true)) {
|
|
2326
|
+
return {
|
|
2327
|
+
data: {
|
|
2328
|
+
index: nextIndex,
|
|
2329
|
+
overflows: overflowsData
|
|
2330
|
+
},
|
|
2331
|
+
reset: {
|
|
2332
|
+
placement: nextPlacement
|
|
2333
|
+
}
|
|
2334
|
+
};
|
|
2335
|
+
}
|
|
2322
2336
|
}
|
|
2323
2337
|
let resetPlacement = (_overflowsData$filter = overflowsData.filter((d3) => d3.overflows[0] <= 0).sort((a3, b2) => a3.overflows[1] - b2.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
|
|
2324
2338
|
if (!resetPlacement) {
|
|
@@ -2356,6 +2370,7 @@ var __exports__ = (() => {
|
|
|
2356
2370
|
}
|
|
2357
2371
|
};
|
|
2358
2372
|
};
|
|
2373
|
+
var originSides = /* @__PURE__ */ new Set(["left", "top"]);
|
|
2359
2374
|
async function convertValueToCoords(state, options) {
|
|
2360
2375
|
const {
|
|
2361
2376
|
placement,
|
|
@@ -2366,7 +2381,7 @@ var __exports__ = (() => {
|
|
|
2366
2381
|
const side = getSide(placement);
|
|
2367
2382
|
const alignment = getAlignment(placement);
|
|
2368
2383
|
const isVertical = getSideAxis(placement) === "y";
|
|
2369
|
-
const mainAxisMulti =
|
|
2384
|
+
const mainAxisMulti = originSides.has(side) ? -1 : 1;
|
|
2370
2385
|
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
2371
2386
|
const rawValue = evaluate(options, state);
|
|
2372
2387
|
let {
|
|
@@ -2378,10 +2393,9 @@ var __exports__ = (() => {
|
|
|
2378
2393
|
crossAxis: 0,
|
|
2379
2394
|
alignmentAxis: null
|
|
2380
2395
|
} : {
|
|
2381
|
-
mainAxis: 0,
|
|
2382
|
-
crossAxis: 0,
|
|
2383
|
-
alignmentAxis:
|
|
2384
|
-
...rawValue
|
|
2396
|
+
mainAxis: rawValue.mainAxis || 0,
|
|
2397
|
+
crossAxis: rawValue.crossAxis || 0,
|
|
2398
|
+
alignmentAxis: rawValue.alignmentAxis
|
|
2385
2399
|
};
|
|
2386
2400
|
if (alignment && typeof alignmentAxis === "number") {
|
|
2387
2401
|
crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
|
|
@@ -2435,7 +2449,8 @@ var __exports__ = (() => {
|
|
|
2435
2449
|
const {
|
|
2436
2450
|
x: x2,
|
|
2437
2451
|
y: y3,
|
|
2438
|
-
placement
|
|
2452
|
+
placement,
|
|
2453
|
+
platform: platform2
|
|
2439
2454
|
} = state;
|
|
2440
2455
|
const {
|
|
2441
2456
|
mainAxis: checkMainAxis = true,
|
|
@@ -2458,7 +2473,7 @@ var __exports__ = (() => {
|
|
|
2458
2473
|
x: x2,
|
|
2459
2474
|
y: y3
|
|
2460
2475
|
};
|
|
2461
|
-
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
2476
|
+
const overflow = await platform2.detectOverflow(state, detectOverflowOptions);
|
|
2462
2477
|
const crossAxis = getSideAxis(getSide(placement));
|
|
2463
2478
|
const mainAxis = getOppositeAxis(crossAxis);
|
|
2464
2479
|
let mainAxisCoord = coords[mainAxis];
|
|
@@ -2466,16 +2481,16 @@ var __exports__ = (() => {
|
|
|
2466
2481
|
if (checkMainAxis) {
|
|
2467
2482
|
const minSide = mainAxis === "y" ? "top" : "left";
|
|
2468
2483
|
const maxSide = mainAxis === "y" ? "bottom" : "right";
|
|
2469
|
-
const
|
|
2470
|
-
const
|
|
2471
|
-
mainAxisCoord = clamp(
|
|
2484
|
+
const min2 = mainAxisCoord + overflow[minSide];
|
|
2485
|
+
const max2 = mainAxisCoord - overflow[maxSide];
|
|
2486
|
+
mainAxisCoord = clamp(min2, mainAxisCoord, max2);
|
|
2472
2487
|
}
|
|
2473
2488
|
if (checkCrossAxis) {
|
|
2474
2489
|
const minSide = crossAxis === "y" ? "top" : "left";
|
|
2475
2490
|
const maxSide = crossAxis === "y" ? "bottom" : "right";
|
|
2476
|
-
const
|
|
2477
|
-
const
|
|
2478
|
-
crossAxisCoord = clamp(
|
|
2491
|
+
const min2 = crossAxisCoord + overflow[minSide];
|
|
2492
|
+
const max2 = crossAxisCoord - overflow[maxSide];
|
|
2493
|
+
crossAxisCoord = clamp(min2, crossAxisCoord, max2);
|
|
2479
2494
|
}
|
|
2480
2495
|
const limitedCoords = limiter.fn({
|
|
2481
2496
|
...state,
|
|
@@ -2486,23 +2501,17 @@ var __exports__ = (() => {
|
|
|
2486
2501
|
...limitedCoords,
|
|
2487
2502
|
data: {
|
|
2488
2503
|
x: limitedCoords.x - x2,
|
|
2489
|
-
y: limitedCoords.y - y3
|
|
2504
|
+
y: limitedCoords.y - y3,
|
|
2505
|
+
enabled: {
|
|
2506
|
+
[mainAxis]: checkMainAxis,
|
|
2507
|
+
[crossAxis]: checkCrossAxis
|
|
2508
|
+
}
|
|
2490
2509
|
}
|
|
2491
2510
|
};
|
|
2492
2511
|
}
|
|
2493
2512
|
};
|
|
2494
2513
|
};
|
|
2495
2514
|
|
|
2496
|
-
// ../../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
|
2497
|
-
var min2 = Math.min;
|
|
2498
|
-
var max2 = Math.max;
|
|
2499
|
-
var round = Math.round;
|
|
2500
|
-
var floor = Math.floor;
|
|
2501
|
-
var createCoords = (v3) => ({
|
|
2502
|
-
x: v3,
|
|
2503
|
-
y: v3
|
|
2504
|
-
});
|
|
2505
|
-
|
|
2506
2515
|
// ../../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
|
|
2507
2516
|
function hasWindow() {
|
|
2508
2517
|
return typeof window !== "undefined";
|
|
@@ -2551,25 +2560,32 @@ var __exports__ = (() => {
|
|
|
2551
2560
|
overflowX,
|
|
2552
2561
|
overflowY,
|
|
2553
2562
|
display
|
|
2554
|
-
} =
|
|
2555
|
-
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) &&
|
|
2563
|
+
} = getComputedStyle2(element);
|
|
2564
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== "inline" && display !== "contents";
|
|
2556
2565
|
}
|
|
2557
2566
|
function isTableElement(element) {
|
|
2558
|
-
return
|
|
2567
|
+
return /^(table|td|th)$/.test(getNodeName(element));
|
|
2559
2568
|
}
|
|
2560
2569
|
function isTopLayer(element) {
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
return
|
|
2564
|
-
} catch (e3) {
|
|
2565
|
-
return false;
|
|
2570
|
+
try {
|
|
2571
|
+
if (element.matches(":popover-open")) {
|
|
2572
|
+
return true;
|
|
2566
2573
|
}
|
|
2567
|
-
})
|
|
2574
|
+
} catch (_e) {
|
|
2575
|
+
}
|
|
2576
|
+
try {
|
|
2577
|
+
return element.matches(":modal");
|
|
2578
|
+
} catch (_e) {
|
|
2579
|
+
return false;
|
|
2580
|
+
}
|
|
2568
2581
|
}
|
|
2582
|
+
var willChangeRe = /transform|translate|scale|rotate|perspective|filter/;
|
|
2583
|
+
var containRe = /paint|layout|strict|content/;
|
|
2584
|
+
var isNotNone = (value) => !!value && value !== "none";
|
|
2585
|
+
var isWebKitValue;
|
|
2569
2586
|
function isContainingBlock(elementOrCss) {
|
|
2570
|
-
const
|
|
2571
|
-
|
|
2572
|
-
return ["transform", "translate", "scale", "rotate", "perspective"].some((value) => css[value] ? css[value] !== "none" : false) || (css.containerType ? css.containerType !== "normal" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit && (css.filter ? css.filter !== "none" : false) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((value) => (css.willChange || "").includes(value)) || ["paint", "layout", "strict", "content"].some((value) => (css.contain || "").includes(value));
|
|
2587
|
+
const css = isElement(elementOrCss) ? getComputedStyle2(elementOrCss) : elementOrCss;
|
|
2588
|
+
return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || "") || containRe.test(css.contain || "");
|
|
2573
2589
|
}
|
|
2574
2590
|
function getContainingBlock(element) {
|
|
2575
2591
|
let currentNode = getParentNode(element);
|
|
@@ -2584,14 +2600,15 @@ var __exports__ = (() => {
|
|
|
2584
2600
|
return null;
|
|
2585
2601
|
}
|
|
2586
2602
|
function isWebKit() {
|
|
2587
|
-
if (
|
|
2588
|
-
|
|
2589
|
-
|
|
2603
|
+
if (isWebKitValue == null) {
|
|
2604
|
+
isWebKitValue = typeof CSS !== "undefined" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none");
|
|
2605
|
+
}
|
|
2606
|
+
return isWebKitValue;
|
|
2590
2607
|
}
|
|
2591
2608
|
function isLastTraversableNode(node) {
|
|
2592
|
-
return
|
|
2609
|
+
return /^(html|body|#document)$/.test(getNodeName(node));
|
|
2593
2610
|
}
|
|
2594
|
-
function
|
|
2611
|
+
function getComputedStyle2(element) {
|
|
2595
2612
|
return getWindow(element).getComputedStyle(element);
|
|
2596
2613
|
}
|
|
2597
2614
|
function getNodeScroll(element) {
|
|
@@ -2643,8 +2660,9 @@ var __exports__ = (() => {
|
|
|
2643
2660
|
if (isBody) {
|
|
2644
2661
|
const frameElement = getFrameElement(win);
|
|
2645
2662
|
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
|
|
2663
|
+
} else {
|
|
2664
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
2646
2665
|
}
|
|
2647
|
-
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
2648
2666
|
}
|
|
2649
2667
|
function getFrameElement(win) {
|
|
2650
2668
|
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
@@ -2652,7 +2670,7 @@ var __exports__ = (() => {
|
|
|
2652
2670
|
|
|
2653
2671
|
// ../../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
|
|
2654
2672
|
function getCssDimensions(element) {
|
|
2655
|
-
const css =
|
|
2673
|
+
const css = getComputedStyle2(element);
|
|
2656
2674
|
let width = parseFloat(css.width) || 0;
|
|
2657
2675
|
let height = parseFloat(css.height) || 0;
|
|
2658
2676
|
const hasOffset = isHTMLElement(element);
|
|
@@ -2748,7 +2766,7 @@ var __exports__ = (() => {
|
|
|
2748
2766
|
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
|
2749
2767
|
const iframeScale = getScale(currentIFrame);
|
|
2750
2768
|
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
2751
|
-
const css =
|
|
2769
|
+
const css = getComputedStyle2(currentIFrame);
|
|
2752
2770
|
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
2753
2771
|
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
2754
2772
|
x2 *= iframeScale.x;
|
|
@@ -2768,6 +2786,22 @@ var __exports__ = (() => {
|
|
|
2768
2786
|
y: y3
|
|
2769
2787
|
});
|
|
2770
2788
|
}
|
|
2789
|
+
function getWindowScrollBarX(element, rect) {
|
|
2790
|
+
const leftScroll = getNodeScroll(element).scrollLeft;
|
|
2791
|
+
if (!rect) {
|
|
2792
|
+
return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
|
|
2793
|
+
}
|
|
2794
|
+
return rect.left + leftScroll;
|
|
2795
|
+
}
|
|
2796
|
+
function getHTMLOffset(documentElement, scroll) {
|
|
2797
|
+
const htmlRect = documentElement.getBoundingClientRect();
|
|
2798
|
+
const x2 = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
|
|
2799
|
+
const y3 = htmlRect.top + scroll.scrollTop;
|
|
2800
|
+
return {
|
|
2801
|
+
x: x2,
|
|
2802
|
+
y: y3
|
|
2803
|
+
};
|
|
2804
|
+
}
|
|
2771
2805
|
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
2772
2806
|
let {
|
|
2773
2807
|
elements,
|
|
@@ -2792,40 +2826,34 @@ var __exports__ = (() => {
|
|
|
2792
2826
|
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
|
2793
2827
|
scroll = getNodeScroll(offsetParent);
|
|
2794
2828
|
}
|
|
2795
|
-
if (
|
|
2829
|
+
if (isOffsetParentAnElement) {
|
|
2796
2830
|
const offsetRect = getBoundingClientRect(offsetParent);
|
|
2797
2831
|
scale = getScale(offsetParent);
|
|
2798
2832
|
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
2799
2833
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
2800
2834
|
}
|
|
2801
2835
|
}
|
|
2836
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
2802
2837
|
return {
|
|
2803
2838
|
width: rect.width * scale.x,
|
|
2804
2839
|
height: rect.height * scale.y,
|
|
2805
|
-
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
|
|
2806
|
-
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
|
|
2840
|
+
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
|
|
2841
|
+
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
|
|
2807
2842
|
};
|
|
2808
2843
|
}
|
|
2809
2844
|
function getClientRects(element) {
|
|
2810
2845
|
return Array.from(element.getClientRects());
|
|
2811
2846
|
}
|
|
2812
|
-
function getWindowScrollBarX(element, rect) {
|
|
2813
|
-
const leftScroll = getNodeScroll(element).scrollLeft;
|
|
2814
|
-
if (!rect) {
|
|
2815
|
-
return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
|
|
2816
|
-
}
|
|
2817
|
-
return rect.left + leftScroll;
|
|
2818
|
-
}
|
|
2819
2847
|
function getDocumentRect(element) {
|
|
2820
2848
|
const html = getDocumentElement(element);
|
|
2821
2849
|
const scroll = getNodeScroll(element);
|
|
2822
2850
|
const body = element.ownerDocument.body;
|
|
2823
|
-
const width =
|
|
2824
|
-
const height =
|
|
2851
|
+
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
2852
|
+
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
2825
2853
|
let x2 = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
2826
2854
|
const y3 = -scroll.scrollTop;
|
|
2827
|
-
if (
|
|
2828
|
-
x2 +=
|
|
2855
|
+
if (getComputedStyle2(body).direction === "rtl") {
|
|
2856
|
+
x2 += max(html.clientWidth, body.clientWidth) - width;
|
|
2829
2857
|
}
|
|
2830
2858
|
return {
|
|
2831
2859
|
width,
|
|
@@ -2834,6 +2862,7 @@ var __exports__ = (() => {
|
|
|
2834
2862
|
y: y3
|
|
2835
2863
|
};
|
|
2836
2864
|
}
|
|
2865
|
+
var SCROLLBAR_MAX = 25;
|
|
2837
2866
|
function getViewportRect(element, strategy) {
|
|
2838
2867
|
const win = getWindow(element);
|
|
2839
2868
|
const html = getDocumentElement(element);
|
|
@@ -2851,6 +2880,19 @@ var __exports__ = (() => {
|
|
|
2851
2880
|
y3 = visualViewport.offsetTop;
|
|
2852
2881
|
}
|
|
2853
2882
|
}
|
|
2883
|
+
const windowScrollbarX = getWindowScrollBarX(html);
|
|
2884
|
+
if (windowScrollbarX <= 0) {
|
|
2885
|
+
const doc = html.ownerDocument;
|
|
2886
|
+
const body = doc.body;
|
|
2887
|
+
const bodyStyles = getComputedStyle(body);
|
|
2888
|
+
const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
|
|
2889
|
+
const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
|
|
2890
|
+
if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
|
|
2891
|
+
width -= clippingStableScrollbarWidth;
|
|
2892
|
+
}
|
|
2893
|
+
} else if (windowScrollbarX <= SCROLLBAR_MAX) {
|
|
2894
|
+
width += windowScrollbarX;
|
|
2895
|
+
}
|
|
2854
2896
|
return {
|
|
2855
2897
|
width,
|
|
2856
2898
|
height,
|
|
@@ -2885,9 +2927,10 @@ var __exports__ = (() => {
|
|
|
2885
2927
|
} else {
|
|
2886
2928
|
const visualOffsets = getVisualOffsets(element);
|
|
2887
2929
|
rect = {
|
|
2888
|
-
...clippingAncestor,
|
|
2889
2930
|
x: clippingAncestor.x - visualOffsets.x,
|
|
2890
|
-
y: clippingAncestor.y - visualOffsets.y
|
|
2931
|
+
y: clippingAncestor.y - visualOffsets.y,
|
|
2932
|
+
width: clippingAncestor.width,
|
|
2933
|
+
height: clippingAncestor.height
|
|
2891
2934
|
};
|
|
2892
2935
|
}
|
|
2893
2936
|
return rectToClientRect(rect);
|
|
@@ -2897,7 +2940,7 @@ var __exports__ = (() => {
|
|
|
2897
2940
|
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
|
2898
2941
|
return false;
|
|
2899
2942
|
}
|
|
2900
|
-
return
|
|
2943
|
+
return getComputedStyle2(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
|
|
2901
2944
|
}
|
|
2902
2945
|
function getClippingElementAncestors(element, cache) {
|
|
2903
2946
|
const cachedResult = cache.get(element);
|
|
@@ -2906,15 +2949,15 @@ var __exports__ = (() => {
|
|
|
2906
2949
|
}
|
|
2907
2950
|
let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
|
|
2908
2951
|
let currentContainingBlockComputedStyle = null;
|
|
2909
|
-
const elementIsFixed =
|
|
2952
|
+
const elementIsFixed = getComputedStyle2(element).position === "fixed";
|
|
2910
2953
|
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
2911
2954
|
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
2912
|
-
const computedStyle =
|
|
2955
|
+
const computedStyle = getComputedStyle2(currentNode);
|
|
2913
2956
|
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
2914
2957
|
if (!currentNodeIsContaining && computedStyle.position === "fixed") {
|
|
2915
2958
|
currentContainingBlockComputedStyle = null;
|
|
2916
2959
|
}
|
|
2917
|
-
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle &&
|
|
2960
|
+
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && (currentContainingBlockComputedStyle.position === "absolute" || currentContainingBlockComputedStyle.position === "fixed") || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
2918
2961
|
if (shouldDropCurrentNode) {
|
|
2919
2962
|
result = result.filter((ancestor) => ancestor !== currentNode);
|
|
2920
2963
|
} else {
|
|
@@ -2934,20 +2977,23 @@ var __exports__ = (() => {
|
|
|
2934
2977
|
} = _ref;
|
|
2935
2978
|
const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
2936
2979
|
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
2937
|
-
const
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2980
|
+
const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy);
|
|
2981
|
+
let top = firstRect.top;
|
|
2982
|
+
let right = firstRect.right;
|
|
2983
|
+
let bottom = firstRect.bottom;
|
|
2984
|
+
let left = firstRect.left;
|
|
2985
|
+
for (let i4 = 1; i4 < clippingAncestors.length; i4++) {
|
|
2986
|
+
const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i4], strategy);
|
|
2987
|
+
top = max(rect.top, top);
|
|
2988
|
+
right = min(rect.right, right);
|
|
2989
|
+
bottom = min(rect.bottom, bottom);
|
|
2990
|
+
left = max(rect.left, left);
|
|
2991
|
+
}
|
|
2946
2992
|
return {
|
|
2947
|
-
width:
|
|
2948
|
-
height:
|
|
2949
|
-
x:
|
|
2950
|
-
y:
|
|
2993
|
+
width: right - left,
|
|
2994
|
+
height: bottom - top,
|
|
2995
|
+
x: left,
|
|
2996
|
+
y: top
|
|
2951
2997
|
};
|
|
2952
2998
|
}
|
|
2953
2999
|
function getDimensions(element) {
|
|
@@ -2970,6 +3016,9 @@ var __exports__ = (() => {
|
|
|
2970
3016
|
scrollTop: 0
|
|
2971
3017
|
};
|
|
2972
3018
|
const offsets = createCoords(0);
|
|
3019
|
+
function setLeftRTLScrollbarOffset() {
|
|
3020
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
3021
|
+
}
|
|
2973
3022
|
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
2974
3023
|
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
|
2975
3024
|
scroll = getNodeScroll(offsetParent);
|
|
@@ -2979,19 +3028,15 @@ var __exports__ = (() => {
|
|
|
2979
3028
|
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
2980
3029
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
2981
3030
|
} else if (documentElement) {
|
|
2982
|
-
|
|
3031
|
+
setLeftRTLScrollbarOffset();
|
|
2983
3032
|
}
|
|
2984
3033
|
}
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
if (documentElement && !isOffsetParentAnElement && !isFixed) {
|
|
2988
|
-
const htmlRect = documentElement.getBoundingClientRect();
|
|
2989
|
-
htmlY = htmlRect.top + scroll.scrollTop;
|
|
2990
|
-
htmlX = htmlRect.left + scroll.scrollLeft - // RTL <body> scrollbar.
|
|
2991
|
-
getWindowScrollBarX(documentElement, htmlRect);
|
|
3034
|
+
if (isFixed && !isOffsetParentAnElement && documentElement) {
|
|
3035
|
+
setLeftRTLScrollbarOffset();
|
|
2992
3036
|
}
|
|
2993
|
-
const
|
|
2994
|
-
const
|
|
3037
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
3038
|
+
const x2 = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
|
|
3039
|
+
const y3 = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
|
|
2995
3040
|
return {
|
|
2996
3041
|
x: x2,
|
|
2997
3042
|
y: y3,
|
|
@@ -3000,10 +3045,10 @@ var __exports__ = (() => {
|
|
|
3000
3045
|
};
|
|
3001
3046
|
}
|
|
3002
3047
|
function isStaticPositioned(element) {
|
|
3003
|
-
return
|
|
3048
|
+
return getComputedStyle2(element).position === "static";
|
|
3004
3049
|
}
|
|
3005
3050
|
function getTrueOffsetParent(element, polyfill) {
|
|
3006
|
-
if (!isHTMLElement(element) ||
|
|
3051
|
+
if (!isHTMLElement(element) || getComputedStyle2(element).position === "fixed") {
|
|
3007
3052
|
return null;
|
|
3008
3053
|
}
|
|
3009
3054
|
if (polyfill) {
|
|
@@ -3054,7 +3099,7 @@ var __exports__ = (() => {
|
|
|
3054
3099
|
};
|
|
3055
3100
|
};
|
|
3056
3101
|
function isRTL(element) {
|
|
3057
|
-
return
|
|
3102
|
+
return getComputedStyle2(element).direction === "rtl";
|
|
3058
3103
|
}
|
|
3059
3104
|
var platform = {
|
|
3060
3105
|
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
@@ -3068,6 +3113,9 @@ var __exports__ = (() => {
|
|
|
3068
3113
|
isElement,
|
|
3069
3114
|
isRTL
|
|
3070
3115
|
};
|
|
3116
|
+
function rectsAreEqual(a3, b2) {
|
|
3117
|
+
return a3.x === b2.x && a3.y === b2.y && a3.width === b2.width && a3.height === b2.height;
|
|
3118
|
+
}
|
|
3071
3119
|
function observeMove(element, onMove) {
|
|
3072
3120
|
let io = null;
|
|
3073
3121
|
let timeoutId;
|
|
@@ -3086,12 +3134,13 @@ var __exports__ = (() => {
|
|
|
3086
3134
|
threshold = 1;
|
|
3087
3135
|
}
|
|
3088
3136
|
cleanup();
|
|
3137
|
+
const elementRectForRootMargin = element.getBoundingClientRect();
|
|
3089
3138
|
const {
|
|
3090
3139
|
left,
|
|
3091
3140
|
top,
|
|
3092
3141
|
width,
|
|
3093
3142
|
height
|
|
3094
|
-
} =
|
|
3143
|
+
} = elementRectForRootMargin;
|
|
3095
3144
|
if (!skip) {
|
|
3096
3145
|
onMove();
|
|
3097
3146
|
}
|
|
@@ -3105,7 +3154,7 @@ var __exports__ = (() => {
|
|
|
3105
3154
|
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
|
|
3106
3155
|
const options = {
|
|
3107
3156
|
rootMargin,
|
|
3108
|
-
threshold:
|
|
3157
|
+
threshold: max(0, min(1, threshold)) || 1
|
|
3109
3158
|
};
|
|
3110
3159
|
let isFirstUpdate = true;
|
|
3111
3160
|
function handleObserve(entries) {
|
|
@@ -3122,6 +3171,9 @@ var __exports__ = (() => {
|
|
|
3122
3171
|
refresh(false, ratio);
|
|
3123
3172
|
}
|
|
3124
3173
|
}
|
|
3174
|
+
if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
|
|
3175
|
+
refresh();
|
|
3176
|
+
}
|
|
3125
3177
|
isFirstUpdate = false;
|
|
3126
3178
|
}
|
|
3127
3179
|
try {
|
|
@@ -3130,7 +3182,7 @@ var __exports__ = (() => {
|
|
|
3130
3182
|
// Handle <iframe>s
|
|
3131
3183
|
root: root.ownerDocument
|
|
3132
3184
|
});
|
|
3133
|
-
} catch (
|
|
3185
|
+
} catch (_e) {
|
|
3134
3186
|
io = new IntersectionObserver(handleObserve, options);
|
|
3135
3187
|
}
|
|
3136
3188
|
io.observe(element);
|
|
@@ -3150,7 +3202,7 @@ var __exports__ = (() => {
|
|
|
3150
3202
|
animationFrame = false
|
|
3151
3203
|
} = options;
|
|
3152
3204
|
const referenceEl = unwrapElement(reference);
|
|
3153
|
-
const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : [];
|
|
3205
|
+
const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...floating ? getOverflowAncestors(floating) : []] : [];
|
|
3154
3206
|
ancestors.forEach((ancestor) => {
|
|
3155
3207
|
ancestorScroll && ancestor.addEventListener("scroll", update, {
|
|
3156
3208
|
passive: true
|
|
@@ -3163,7 +3215,7 @@ var __exports__ = (() => {
|
|
|
3163
3215
|
if (elementResize) {
|
|
3164
3216
|
resizeObserver = new ResizeObserver((_ref) => {
|
|
3165
3217
|
let [firstEntry] = _ref;
|
|
3166
|
-
if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
|
|
3218
|
+
if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) {
|
|
3167
3219
|
resizeObserver.unobserve(floating);
|
|
3168
3220
|
cancelAnimationFrame(reobserveFrame);
|
|
3169
3221
|
reobserveFrame = requestAnimationFrame(() => {
|
|
@@ -3176,7 +3228,9 @@ var __exports__ = (() => {
|
|
|
3176
3228
|
if (referenceEl && !animationFrame) {
|
|
3177
3229
|
resizeObserver.observe(referenceEl);
|
|
3178
3230
|
}
|
|
3179
|
-
|
|
3231
|
+
if (floating) {
|
|
3232
|
+
resizeObserver.observe(floating);
|
|
3233
|
+
}
|
|
3180
3234
|
}
|
|
3181
3235
|
let frameId;
|
|
3182
3236
|
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
|
|
@@ -3185,7 +3239,7 @@ var __exports__ = (() => {
|
|
|
3185
3239
|
}
|
|
3186
3240
|
function frameLoop() {
|
|
3187
3241
|
const nextRefRect = getBoundingClientRect(reference);
|
|
3188
|
-
if (prevRefRect && (
|
|
3242
|
+
if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
|
|
3189
3243
|
update();
|
|
3190
3244
|
}
|
|
3191
3245
|
prevRefRect = nextRefRect;
|
|
@@ -3272,14 +3326,13 @@ var __exports__ = (() => {
|
|
|
3272
3326
|
updaterRef.current?.();
|
|
3273
3327
|
}, [x2, y3, placement, arrowSize, pixelOffset]);
|
|
3274
3328
|
y2(() => {
|
|
3275
|
-
|
|
3276
|
-
|
|
3329
|
+
const anchor = anchorRef.current;
|
|
3330
|
+
const content = contentRef.current;
|
|
3331
|
+
if (!anchor || !content) {
|
|
3332
|
+
return void 0;
|
|
3277
3333
|
}
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
contentRef.current,
|
|
3281
|
-
() => updaterRef.current?.()
|
|
3282
|
-
);
|
|
3334
|
+
content.style.visibility = "visible";
|
|
3335
|
+
const cleanup = autoUpdate(anchor, content, () => updaterRef.current?.());
|
|
3283
3336
|
return () => {
|
|
3284
3337
|
cleanup();
|
|
3285
3338
|
};
|
|
@@ -3655,12 +3708,12 @@ var __exports__ = (() => {
|
|
|
3655
3708
|
|
|
3656
3709
|
// src/lib/components/range-input.tsx
|
|
3657
3710
|
var wheelListenerOptions = { passive: false };
|
|
3658
|
-
var clamp2 = (value,
|
|
3659
|
-
if (value <
|
|
3660
|
-
return
|
|
3711
|
+
var clamp2 = (value, min2, max2) => {
|
|
3712
|
+
if (value < min2) {
|
|
3713
|
+
return min2;
|
|
3661
3714
|
}
|
|
3662
|
-
if (value >
|
|
3663
|
-
return
|
|
3715
|
+
if (value > max2) {
|
|
3716
|
+
return max2;
|
|
3664
3717
|
}
|
|
3665
3718
|
return value;
|
|
3666
3719
|
};
|
|
@@ -3689,8 +3742,8 @@ var __exports__ = (() => {
|
|
|
3689
3742
|
function RangeInput(props) {
|
|
3690
3743
|
const {
|
|
3691
3744
|
className = "",
|
|
3692
|
-
min:
|
|
3693
|
-
max:
|
|
3745
|
+
min: min2,
|
|
3746
|
+
max: max2,
|
|
3694
3747
|
step,
|
|
3695
3748
|
value,
|
|
3696
3749
|
orientation,
|
|
@@ -3708,10 +3761,10 @@ var __exports__ = (() => {
|
|
|
3708
3761
|
const thumbRef = A2(null);
|
|
3709
3762
|
const dragStateRef = A2(null);
|
|
3710
3763
|
const [trackLength, setTrackLength] = h2(0);
|
|
3711
|
-
const range =
|
|
3764
|
+
const range = max2 - min2;
|
|
3712
3765
|
const rangeSize = Math.max(0, value[1] - value[0]);
|
|
3713
3766
|
const maxStart = Math.max(0, range - rangeSize);
|
|
3714
|
-
const clampedStart = clamp2(value[0],
|
|
3767
|
+
const clampedStart = clamp2(value[0], min2, min2 + maxStart);
|
|
3715
3768
|
const { thumbLength, thumbOffset } = T2(() => {
|
|
3716
3769
|
if (trackLength <= 0 || range <= 0) {
|
|
3717
3770
|
return { thumbLength: 0, thumbOffset: 0 };
|
|
@@ -3721,21 +3774,21 @@ var __exports__ = (() => {
|
|
|
3721
3774
|
}
|
|
3722
3775
|
const nextThumbLength = rangeSize / range;
|
|
3723
3776
|
const travel = Math.max(0, 1 - nextThumbLength);
|
|
3724
|
-
const ratio = maxStart <= 0 ? 0 : clamp2((clampedStart -
|
|
3777
|
+
const ratio = maxStart <= 0 ? 0 : clamp2((clampedStart - min2) / maxStart, 0, 1);
|
|
3725
3778
|
return {
|
|
3726
3779
|
thumbLength: Math.max(0, Math.min(nextThumbLength, 1)),
|
|
3727
3780
|
thumbOffset: travel * ratio
|
|
3728
3781
|
};
|
|
3729
|
-
}, [trackLength, range, rangeSize, maxStart, clampedStart,
|
|
3782
|
+
}, [trackLength, range, rangeSize, maxStart, clampedStart, min2]);
|
|
3730
3783
|
const emitRange = q2(
|
|
3731
3784
|
(nextStart) => {
|
|
3732
3785
|
if (!onChange) {
|
|
3733
3786
|
return;
|
|
3734
3787
|
}
|
|
3735
|
-
const clamped = clamp2(nextStart,
|
|
3788
|
+
const clamped = clamp2(nextStart, min2, min2 + maxStart);
|
|
3736
3789
|
onChange([clamped, clamped + rangeSize]);
|
|
3737
3790
|
},
|
|
3738
|
-
[onChange,
|
|
3791
|
+
[onChange, min2, maxStart, rangeSize]
|
|
3739
3792
|
);
|
|
3740
3793
|
const handleStepNegative = q2(
|
|
3741
3794
|
(event) => {
|
|
@@ -3771,9 +3824,9 @@ var __exports__ = (() => {
|
|
|
3771
3824
|
const span = Math.max(1, 1 - thumbLength) * trackLength;
|
|
3772
3825
|
const thumbCenter = thumbLength / 2 * trackLength;
|
|
3773
3826
|
const ratio = span <= 0 ? 0 : clamp2((coordinate - thumbCenter) / span, 0, 1);
|
|
3774
|
-
emitRange(
|
|
3827
|
+
emitRange(min2 + ratio * maxStart);
|
|
3775
3828
|
},
|
|
3776
|
-
[vertical, trackLength, thumbLength, emitRange,
|
|
3829
|
+
[vertical, trackLength, thumbLength, emitRange, min2, maxStart]
|
|
3777
3830
|
);
|
|
3778
3831
|
const handleThumbPointerDown = (event) => {
|
|
3779
3832
|
if (event.button !== 0) {
|
|
@@ -3787,8 +3840,8 @@ var __exports__ = (() => {
|
|
|
3787
3840
|
pointerId: event.pointerId,
|
|
3788
3841
|
startCoord: vertical ? event.clientY : event.clientX,
|
|
3789
3842
|
startRatio: thumbOffset,
|
|
3790
|
-
min:
|
|
3791
|
-
max:
|
|
3843
|
+
min: min2,
|
|
3844
|
+
max: max2,
|
|
3792
3845
|
maxStart
|
|
3793
3846
|
};
|
|
3794
3847
|
event.currentTarget.setPointerCapture(event.pointerId);
|
|
@@ -3845,18 +3898,18 @@ var __exports__ = (() => {
|
|
|
3845
3898
|
event.preventDefault();
|
|
3846
3899
|
break;
|
|
3847
3900
|
case "Home":
|
|
3848
|
-
emitRange(
|
|
3901
|
+
emitRange(min2);
|
|
3849
3902
|
event.preventDefault();
|
|
3850
3903
|
break;
|
|
3851
3904
|
case "End":
|
|
3852
|
-
emitRange(
|
|
3905
|
+
emitRange(min2 + maxStart);
|
|
3853
3906
|
event.preventDefault();
|
|
3854
3907
|
break;
|
|
3855
3908
|
default:
|
|
3856
3909
|
break;
|
|
3857
3910
|
}
|
|
3858
3911
|
},
|
|
3859
|
-
[vertical, emitRange, clampedStart, step, range, pageSize, rangeSize,
|
|
3912
|
+
[vertical, emitRange, clampedStart, step, range, pageSize, rangeSize, min2, maxStart]
|
|
3860
3913
|
);
|
|
3861
3914
|
const handleWheel = q2(
|
|
3862
3915
|
(event) => {
|
|
@@ -3921,8 +3974,8 @@ var __exports__ = (() => {
|
|
|
3921
3974
|
}
|
|
3922
3975
|
return decorations.map((decoration, index) => {
|
|
3923
3976
|
const [start, end] = decoration.position;
|
|
3924
|
-
const startRatio = (start -
|
|
3925
|
-
const endRatio = (end -
|
|
3977
|
+
const startRatio = (start - min2) / range;
|
|
3978
|
+
const endRatio = (end - min2) / range;
|
|
3926
3979
|
const offsetPct = Math.round(startRatio * 1e3) / 10;
|
|
3927
3980
|
const sizePct = Math.max(0, Math.round((endRatio - startRatio) * 1e3) / 10);
|
|
3928
3981
|
const style = vertical ? {
|
|
@@ -3938,15 +3991,15 @@ var __exports__ = (() => {
|
|
|
3938
3991
|
};
|
|
3939
3992
|
return /* @__PURE__ */ u2("div", { className: "deck-widget-range__decoration", style, children: decoration.element }, `decoration-${index}`);
|
|
3940
3993
|
});
|
|
3941
|
-
}, [decorations, range,
|
|
3994
|
+
}, [decorations, range, min2, vertical]);
|
|
3942
3995
|
return /* @__PURE__ */ u2(
|
|
3943
3996
|
"div",
|
|
3944
3997
|
{
|
|
3945
3998
|
ref: rootRef,
|
|
3946
3999
|
tabIndex: 0,
|
|
3947
4000
|
role: "scrollbar",
|
|
3948
|
-
"aria-valuemin":
|
|
3949
|
-
"aria-valuemax":
|
|
4001
|
+
"aria-valuemin": min2,
|
|
4002
|
+
"aria-valuemax": min2 + maxStart,
|
|
3950
4003
|
"aria-valuenow": clampedStart,
|
|
3951
4004
|
"aria-orientation": orientation,
|
|
3952
4005
|
className: `${className} deck-widget-range deck-widget-range--${orientation} ${maxStart === 0 ? "deck-widget-range--disabled" : ""}`,
|
|
@@ -3957,7 +4010,7 @@ var __exports__ = (() => {
|
|
|
3957
4010
|
type: "button",
|
|
3958
4011
|
className: "deck-widget-range__button deck-widget-range__button--start",
|
|
3959
4012
|
"aria-label": startButtonAriaLabel,
|
|
3960
|
-
disabled: clampedStart <=
|
|
4013
|
+
disabled: clampedStart <= min2,
|
|
3961
4014
|
onClick: handleStepNegative,
|
|
3962
4015
|
children: /* @__PURE__ */ u2("span", { className: "deck-widget-icon" })
|
|
3963
4016
|
}
|
|
@@ -3984,7 +4037,7 @@ var __exports__ = (() => {
|
|
|
3984
4037
|
type: "button",
|
|
3985
4038
|
className: "deck-widget-range__button deck-widget-range__button--end",
|
|
3986
4039
|
"aria-label": endButtonAriaLabel,
|
|
3987
|
-
disabled: clampedStart >=
|
|
4040
|
+
disabled: clampedStart >= min2 + maxStart,
|
|
3988
4041
|
onClick: handleStepPositive,
|
|
3989
4042
|
children: /* @__PURE__ */ u2("span", { className: "deck-widget-icon" })
|
|
3990
4043
|
}
|
|
@@ -3995,12 +4048,12 @@ var __exports__ = (() => {
|
|
|
3995
4048
|
}
|
|
3996
4049
|
|
|
3997
4050
|
// src/scrollbar-widget.tsx
|
|
3998
|
-
var clamp3 = (value,
|
|
3999
|
-
if (value <
|
|
4000
|
-
return
|
|
4051
|
+
var clamp3 = (value, min2, max2) => {
|
|
4052
|
+
if (value < min2) {
|
|
4053
|
+
return min2;
|
|
4001
4054
|
}
|
|
4002
|
-
if (value >
|
|
4003
|
-
return
|
|
4055
|
+
if (value > max2) {
|
|
4056
|
+
return max2;
|
|
4004
4057
|
}
|
|
4005
4058
|
return value;
|
|
4006
4059
|
};
|
|
@@ -4393,19 +4446,19 @@ var __exports__ = (() => {
|
|
|
4393
4446
|
};
|
|
4394
4447
|
this.tick = () => {
|
|
4395
4448
|
const {
|
|
4396
|
-
timeRange: [
|
|
4449
|
+
timeRange: [min2, max2],
|
|
4397
4450
|
step,
|
|
4398
4451
|
loop
|
|
4399
4452
|
} = this.props;
|
|
4400
4453
|
if (step > 0) {
|
|
4401
4454
|
let next = Math.round(this.currentTime / step) * step + step;
|
|
4402
|
-
if (next >
|
|
4403
|
-
if (this.currentTime <
|
|
4404
|
-
next =
|
|
4455
|
+
if (next > max2) {
|
|
4456
|
+
if (this.currentTime < max2) {
|
|
4457
|
+
next = max2;
|
|
4405
4458
|
} else if (loop) {
|
|
4406
|
-
next =
|
|
4459
|
+
next = min2;
|
|
4407
4460
|
} else {
|
|
4408
|
-
next =
|
|
4461
|
+
next = max2;
|
|
4409
4462
|
this.playing = false;
|
|
4410
4463
|
}
|
|
4411
4464
|
}
|
|
@@ -4481,11 +4534,11 @@ var __exports__ = (() => {
|
|
|
4481
4534
|
play() {
|
|
4482
4535
|
this.playing = true;
|
|
4483
4536
|
const {
|
|
4484
|
-
timeRange: [
|
|
4537
|
+
timeRange: [min2, max2]
|
|
4485
4538
|
} = this.props;
|
|
4486
|
-
if (this.currentTime >=
|
|
4487
|
-
this.currentTime =
|
|
4488
|
-
this.props.onTimeChange(
|
|
4539
|
+
if (this.currentTime >= max2) {
|
|
4540
|
+
this.currentTime = min2;
|
|
4541
|
+
this.props.onTimeChange(min2);
|
|
4489
4542
|
}
|
|
4490
4543
|
this.updateHTML();
|
|
4491
4544
|
this.tick();
|
|
@@ -4894,6 +4947,7 @@ var __exports__ = (() => {
|
|
|
4894
4947
|
}
|
|
4895
4948
|
const stats = this._getStats();
|
|
4896
4949
|
const title = this.props.title || ("id" in stats ? stats.id : null) || "Stats";
|
|
4950
|
+
const deviceLabel = this._getDeviceLabel();
|
|
4897
4951
|
const items = [];
|
|
4898
4952
|
if (stats) {
|
|
4899
4953
|
stats.forEach((stat) => {
|
|
@@ -4918,6 +4972,7 @@ var __exports__ = (() => {
|
|
|
4918
4972
|
onClick: this._toggleCollapsed,
|
|
4919
4973
|
children: [
|
|
4920
4974
|
/* @__PURE__ */ u2("b", { children: title }),
|
|
4975
|
+
deviceLabel && /* @__PURE__ */ u2("span", { className: "deck-widget-stats-device", children: deviceLabel }),
|
|
4921
4976
|
/* @__PURE__ */ u2("button", { className: "deck-widget-dropdown-button", children: /* @__PURE__ */ u2("span", { className: "deck-widget-dropdown-icon open" }) })
|
|
4922
4977
|
]
|
|
4923
4978
|
}
|
|
@@ -4952,6 +5007,20 @@ var __exports__ = (() => {
|
|
|
4952
5007
|
throw new Error(`Unknown stats type: ${this.props.type}`);
|
|
4953
5008
|
}
|
|
4954
5009
|
}
|
|
5010
|
+
_getDeviceLabel() {
|
|
5011
|
+
const deviceType = this.deck?.device?.type;
|
|
5012
|
+
if (!deviceType) {
|
|
5013
|
+
return null;
|
|
5014
|
+
}
|
|
5015
|
+
switch (deviceType) {
|
|
5016
|
+
case "webgpu":
|
|
5017
|
+
return "WebGPU";
|
|
5018
|
+
case "webgl":
|
|
5019
|
+
return "WebGL";
|
|
5020
|
+
default:
|
|
5021
|
+
return String(deviceType);
|
|
5022
|
+
}
|
|
5023
|
+
}
|
|
4955
5024
|
_getLines(stat) {
|
|
4956
5025
|
if ("count" in stat) {
|
|
4957
5026
|
const formatter = this._formatters[stat.name] || this._formatters[stat.type || ""] || DEFAULT_COUNT_FORMATTER;
|