@automattic/charts 1.10.0 → 1.10.2
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/CHANGELOG.md +21 -0
- package/dist/index.cjs +5917 -5783
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +44 -3
- package/dist/index.d.cts +66 -13
- package/dist/index.d.ts +67 -14
- package/dist/index.js +1159 -1015
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/src/charts/heatmap-chart/heatmap-chart.module.scss +27 -4
- package/src/charts/heatmap-chart/heatmap-chart.tsx +115 -49
- package/src/charts/heatmap-chart/private/build-calendar-data.ts +39 -4
- package/src/charts/heatmap-chart/private/heatmap-context.ts +10 -0
- package/src/charts/heatmap-chart/private/heatmap-legend.tsx +3 -2
- package/src/charts/heatmap-chart/private/index.ts +2 -0
- package/src/charts/heatmap-chart/private/use-heatmap-colors.ts +6 -2
- package/src/charts/heatmap-chart/test/build-calendar-data.test.ts +57 -1
- package/src/charts/heatmap-chart/test/heatmap-chart.test.tsx +91 -3
- package/src/charts/heatmap-chart/test/use-heatmap-colors.test.ts +4 -0
- package/src/charts/heatmap-chart/types.ts +28 -0
- package/src/charts/leaderboard-chart/leaderboard-chart.module.scss +12 -0
- package/src/charts/leaderboard-chart/leaderboard-chart.tsx +65 -37
- package/src/charts/leaderboard-chart/test/leaderboard-chart.test.tsx +46 -6
- package/src/charts/pie-semi-circle-chart/test/pie-semi-circle-chart.test.tsx +0 -6
- package/src/charts/private/with-responsive/test/with-responsive.test.tsx +229 -18
- package/src/charts/private/with-responsive/with-responsive.module.scss +20 -1
- package/src/charts/private/with-responsive/with-responsive.tsx +114 -65
- package/src/hooks/test/use-chart-margin.test.tsx +8 -5
- package/src/hooks/use-chart-margin.tsx +11 -1
- package/src/providers/chart-context/global-charts-provider.tsx +7 -0
- package/src/providers/chart-context/test/chart-context.test.tsx +40 -0
- package/src/providers/chart-context/types.ts +3 -0
- package/src/types.ts +9 -6
- package/src/utils/color-utils.ts +28 -0
- package/src/utils/test/color-utils.test.ts +29 -0
package/dist/index.js
CHANGED
|
@@ -10,21 +10,21 @@ import { addDays, differenceInCalendarWeeks, differenceInHours, differenceInYear
|
|
|
10
10
|
import { Text, getStringWidth } from "@visx/text";
|
|
11
11
|
import deepmerge from "deepmerge";
|
|
12
12
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useTooltip, useTooltipInPortal } from "@visx/tooltip";
|
|
13
14
|
import { createScale, getTicks, scaleBand, scaleOrdinal, scaleTime } from "@visx/scale";
|
|
14
15
|
import { Group } from "@visx/group";
|
|
15
16
|
import { LegendItem, LegendLabel, LegendOrdinal, LegendShape } from "@visx/legend";
|
|
17
|
+
import { __assign } from "tslib";
|
|
18
|
+
import { Icon, chevronRight } from "@wordpress/icons";
|
|
16
19
|
import { LinearGradient } from "@visx/gradient";
|
|
17
20
|
import { curveCatmullRom, curveLinear, curveMonotoneX } from "@visx/curve";
|
|
18
21
|
import { useParentSize } from "@visx/responsive";
|
|
19
22
|
import { Annotation, CircleSubject, Connector, HtmlLabel, Label, LineSubject } from "@visx/annotation";
|
|
20
23
|
import { PatternCircles, PatternHexagons, PatternLines, PatternWaves } from "@visx/pattern";
|
|
21
|
-
import { useTooltip, useTooltipInPortal } from "@visx/tooltip";
|
|
22
24
|
import { Chart } from "react-google-charts";
|
|
23
25
|
import DOMPurify from "dompurify";
|
|
24
|
-
import
|
|
25
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
26
|
+
import "@babel/runtime/helpers/esm/extends";
|
|
26
27
|
import "@babel/runtime/helpers/extends";
|
|
27
|
-
import { Icon, chevronRight } from "@wordpress/icons";
|
|
28
28
|
import { Pie } from "@visx/shape";
|
|
29
29
|
//#region \0rolldown/runtime.js
|
|
30
30
|
var __create = Object.create;
|
|
@@ -445,6 +445,22 @@ const lightenHexColor = (hex, blend) => {
|
|
|
445
445
|
return `#${newR.toString(16).padStart(2, "0")}${newG.toString(16).padStart(2, "0")}${newB.toString(16).padStart(2, "0")}`;
|
|
446
446
|
};
|
|
447
447
|
/**
|
|
448
|
+
* Blend one hex color toward another, per-channel in sRGB.
|
|
449
|
+
*
|
|
450
|
+
* @param fromHex - Starting hex color, returned when blend is 0
|
|
451
|
+
* @param toHex - Target hex color, returned when blend is 1
|
|
452
|
+
* @param blend - Amount toward toHex, clamped to [0, 1]
|
|
453
|
+
* @return Blended hex color string
|
|
454
|
+
* @throws {Error} if either hex string is malformed
|
|
455
|
+
*/
|
|
456
|
+
const mixHexColors = (fromHex, toHex, blend) => {
|
|
457
|
+
validateHexColor(fromHex);
|
|
458
|
+
validateHexColor(toHex);
|
|
459
|
+
const amount = Math.min(1, Math.max(0, blend));
|
|
460
|
+
const channel = (start, end) => Math.round(start + (end - start) * amount).toString(16).padStart(2, "0");
|
|
461
|
+
return `#${channel(parseInt(fromHex.slice(1, 3), 16), parseInt(toHex.slice(1, 3), 16))}${channel(parseInt(fromHex.slice(3, 5), 16), parseInt(toHex.slice(3, 5), 16))}${channel(parseInt(fromHex.slice(5, 7), 16), parseInt(toHex.slice(5, 7), 16))}`;
|
|
462
|
+
};
|
|
463
|
+
/**
|
|
448
464
|
* WCAG relative luminance of a hex color (0 = black, 1 = white).
|
|
449
465
|
*
|
|
450
466
|
* @param hex - Hex color string (e.g., '#98C8DF')
|
|
@@ -879,6 +895,7 @@ const GlobalChartsProvider = ({ children, theme }) => {
|
|
|
879
895
|
}
|
|
880
896
|
return getChartColor(index, colorCache);
|
|
881
897
|
}, [colorCache, groupToColorMap]);
|
|
898
|
+
const resolveThemeColor = useCallback((value) => value ? normalizeColorToHex(value, wrapperRef.current, resolveCssVariable) : "", []);
|
|
882
899
|
const getElementStyles = useCallback(({ data, index, overrideColor, legendShape }) => {
|
|
883
900
|
const isSeriesData = data && typeof data === "object" && "data" in data && "options" in data;
|
|
884
901
|
const isPointPercentageData = data && typeof data === "object" && "value" in data && typeof data.value === "number" && !("data" in data);
|
|
@@ -921,6 +938,7 @@ const GlobalChartsProvider = ({ children, theme }) => {
|
|
|
921
938
|
getChartData,
|
|
922
939
|
theme: providerTheme,
|
|
923
940
|
getElementStyles,
|
|
941
|
+
resolveThemeColor,
|
|
924
942
|
toggleSeriesVisibility,
|
|
925
943
|
isSeriesVisible,
|
|
926
944
|
getHiddenSeries,
|
|
@@ -932,6 +950,7 @@ const GlobalChartsProvider = ({ children, theme }) => {
|
|
|
932
950
|
getChartData,
|
|
933
951
|
providerTheme,
|
|
934
952
|
getElementStyles,
|
|
953
|
+
resolveThemeColor,
|
|
935
954
|
toggleSeriesVisibility,
|
|
936
955
|
isSeriesVisible,
|
|
937
956
|
getHiddenSeries,
|
|
@@ -1140,7 +1159,9 @@ const useChartMargin = (height, options, data, theme, horizontal = false) => {
|
|
|
1140
1159
|
};
|
|
1141
1160
|
const yAxisOrientation = options.axis?.y?.orientation;
|
|
1142
1161
|
const yAxisStyles = yAxisOrientation === "right" ? theme.axisStyles.y.right : theme.axisStyles.y.left;
|
|
1143
|
-
const
|
|
1162
|
+
const yTickWidth = getLongestTickWidth(yTicks, options.axis?.y?.tickFormat, yAxisStyles.axisLabel);
|
|
1163
|
+
const yTickLabelFontSize = resolveFontSize(yAxisStyles?.tickLabel?.fontSize) || DEFAULT_FONT_SIZE;
|
|
1164
|
+
const yMarginValue = (yTickWidth ?? DEFAULT_Y_TICK_WIDTH) + (yAxisStyles?.tickLength ?? 0) + Math.ceil(yTickLabelFontSize * .25);
|
|
1144
1165
|
if (yAxisOrientation === "right") defaultMargin.right = yMarginValue;
|
|
1145
1166
|
else defaultMargin.left = yMarginValue;
|
|
1146
1167
|
const xOrientation = options.axis?.x?.orientation === "top" ? "top" : "bottom";
|
|
@@ -1227,7 +1248,8 @@ function useTextTruncation(enabled = true) {
|
|
|
1227
1248
|
}
|
|
1228
1249
|
if (node && enabled) {
|
|
1229
1250
|
const checkTruncation = () => {
|
|
1230
|
-
|
|
1251
|
+
const truncated = node.scrollWidth > node.clientWidth;
|
|
1252
|
+
setIsTruncated(truncated);
|
|
1231
1253
|
};
|
|
1232
1254
|
checkTruncation();
|
|
1233
1255
|
const resizeObserver = new ResizeObserver(checkTruncation);
|
|
@@ -1428,168 +1450,102 @@ const useGlobalChartsTheme = () => {
|
|
|
1428
1450
|
return useContext(GlobalChartsContext)?.theme ?? defaultTheme;
|
|
1429
1451
|
};
|
|
1430
1452
|
//#endregion
|
|
1431
|
-
//#region ../../../node_modules/.pnpm
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1453
|
+
//#region ../../../node_modules/.pnpm/is-plain-object@5.0.0/node_modules/is-plain-object/dist/is-plain-object.mjs
|
|
1454
|
+
/*!
|
|
1455
|
+
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
1456
|
+
*
|
|
1457
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
1458
|
+
* Released under the MIT License.
|
|
1459
|
+
*/
|
|
1460
|
+
function isObject(o) {
|
|
1461
|
+
return Object.prototype.toString.call(o) === "[object Object]";
|
|
1462
|
+
}
|
|
1463
|
+
function isPlainObject(o) {
|
|
1464
|
+
var ctor, prot;
|
|
1465
|
+
if (isObject(o) === false) return false;
|
|
1466
|
+
ctor = o.constructor;
|
|
1467
|
+
if (ctor === void 0) return true;
|
|
1468
|
+
prot = ctor.prototype;
|
|
1469
|
+
if (isObject(prot) === false) return false;
|
|
1470
|
+
if (prot.hasOwnProperty("isPrototypeOf") === false) return false;
|
|
1471
|
+
return true;
|
|
1439
1472
|
}
|
|
1440
1473
|
//#endregion
|
|
1441
|
-
//#region ../../../node_modules/.pnpm
|
|
1442
|
-
const EMPTY_PROPS = {};
|
|
1474
|
+
//#region ../../../node_modules/.pnpm/lower-case@2.0.2/node_modules/lower-case/dist.es2015/index.js
|
|
1443
1475
|
/**
|
|
1444
|
-
*
|
|
1445
|
-
* the conflicting ones from others. This doesn't apply to event handlers, `className` and `style` props.
|
|
1446
|
-
*
|
|
1447
|
-
* Event handlers are merged and called in right-to-left order (rightmost handler executes first, leftmost last).
|
|
1448
|
-
* For React synthetic events, the rightmost handler can prevent prior (left-positioned) handlers from executing
|
|
1449
|
-
* by calling `event.preventBaseUIHandler()`. For non-synthetic events (custom events with primitive/object values),
|
|
1450
|
-
* all handlers always execute without prevention capability.
|
|
1451
|
-
*
|
|
1452
|
-
* The `className` prop is merged by concatenating classes in right-to-left order (rightmost class appears first in the string).
|
|
1453
|
-
* The `style` prop is merged with rightmost styles overwriting the prior ones.
|
|
1454
|
-
*
|
|
1455
|
-
* Props can either be provided as objects or as functions that take the previous props as an argument.
|
|
1456
|
-
* The function will receive the merged props up to that point (going from left to right):
|
|
1457
|
-
* so in the case of `(obj1, obj2, fn, obj3)`, `fn` will receive the merged props of `obj1` and `obj2`.
|
|
1458
|
-
* The function is responsible for chaining event handlers if needed (that is, we don't run the merge logic).
|
|
1459
|
-
*
|
|
1460
|
-
* Event handlers returned by the functions are not automatically prevented when `preventBaseUIHandler` is called.
|
|
1461
|
-
* They must check `event.baseUIHandlerPrevented` themselves and bail out if it's true.
|
|
1462
|
-
*
|
|
1463
|
-
* @important **`ref` is not merged.**
|
|
1464
|
-
* @param a Props object to merge.
|
|
1465
|
-
* @param b Props object to merge. The function will overwrite conflicting props from `a`.
|
|
1466
|
-
* @param c Props object to merge. The function will overwrite conflicting props from previous parameters.
|
|
1467
|
-
* @param d Props object to merge. The function will overwrite conflicting props from previous parameters.
|
|
1468
|
-
* @param e Props object to merge. The function will overwrite conflicting props from previous parameters.
|
|
1469
|
-
* @returns The merged props.
|
|
1470
|
-
* @public
|
|
1476
|
+
* Lower case as a function.
|
|
1471
1477
|
*/
|
|
1472
|
-
function
|
|
1473
|
-
|
|
1474
|
-
let merged = createInitialMergedProps(a);
|
|
1475
|
-
if (b) merged = mergeInto(merged, b);
|
|
1476
|
-
if (c) merged = mergeInto(merged, c);
|
|
1477
|
-
if (d) merged = mergeInto(merged, d);
|
|
1478
|
-
if (e) merged = mergeInto(merged, e);
|
|
1479
|
-
return merged;
|
|
1478
|
+
function lowerCase(str) {
|
|
1479
|
+
return str.toLowerCase();
|
|
1480
1480
|
}
|
|
1481
|
+
//#endregion
|
|
1482
|
+
//#region ../../../node_modules/.pnpm/no-case@3.0.4/node_modules/no-case/dist.es2015/index.js
|
|
1483
|
+
var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
|
|
1484
|
+
var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
|
|
1481
1485
|
/**
|
|
1482
|
-
*
|
|
1483
|
-
* This function accepts an array of props instead of individual arguments.
|
|
1484
|
-
*
|
|
1485
|
-
* This has slightly lower performance than {@link mergeProps} due to accepting an array
|
|
1486
|
-
* instead of a fixed number of arguments. Prefer {@link mergeProps} when merging 5 or
|
|
1487
|
-
* fewer prop sets for better performance.
|
|
1488
|
-
*
|
|
1489
|
-
* @param props Array of props to merge.
|
|
1490
|
-
* @returns The merged props.
|
|
1491
|
-
* @see mergeProps
|
|
1492
|
-
* @public
|
|
1486
|
+
* Normalize the string into something other libraries can manipulate easier.
|
|
1493
1487
|
*/
|
|
1494
|
-
function
|
|
1495
|
-
if (
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
return copyInitialProps(inputProps);
|
|
1504
|
-
}
|
|
1505
|
-
function mergeInto(merged, inputProps) {
|
|
1506
|
-
if (isPropsGetter(inputProps)) return resolvePropsGetter(inputProps, merged);
|
|
1507
|
-
return mutablyMergeInto(merged, inputProps);
|
|
1508
|
-
}
|
|
1509
|
-
function copyInitialProps(inputProps) {
|
|
1510
|
-
const copiedProps = { ...inputProps };
|
|
1511
|
-
for (const propName in copiedProps) {
|
|
1512
|
-
const propValue = copiedProps[propName];
|
|
1513
|
-
if (isEventHandler(propName, propValue)) copiedProps[propName] = wrapEventHandler(propValue);
|
|
1514
|
-
}
|
|
1515
|
-
return copiedProps;
|
|
1488
|
+
function noCase(input, options) {
|
|
1489
|
+
if (options === void 0) options = {};
|
|
1490
|
+
var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d;
|
|
1491
|
+
var result = replace$1(replace$1(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
|
|
1492
|
+
var start = 0;
|
|
1493
|
+
var end = result.length;
|
|
1494
|
+
while (result.charAt(start) === "\0") start++;
|
|
1495
|
+
while (result.charAt(end - 1) === "\0") end--;
|
|
1496
|
+
return result.slice(start, end).split("\0").map(transform).join(delimiter);
|
|
1516
1497
|
}
|
|
1517
1498
|
/**
|
|
1518
|
-
*
|
|
1499
|
+
* Replace `re` in the input string with the replacement value.
|
|
1519
1500
|
*/
|
|
1520
|
-
function
|
|
1521
|
-
if (
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
case "style":
|
|
1526
|
-
mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue);
|
|
1527
|
-
break;
|
|
1528
|
-
case "className":
|
|
1529
|
-
mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue);
|
|
1530
|
-
break;
|
|
1531
|
-
default: if (isEventHandler(propName, externalPropValue)) mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue);
|
|
1532
|
-
else mergedProps[propName] = externalPropValue;
|
|
1533
|
-
}
|
|
1534
|
-
}
|
|
1535
|
-
return mergedProps;
|
|
1501
|
+
function replace$1(input, re, value) {
|
|
1502
|
+
if (re instanceof RegExp) return input.replace(re, value);
|
|
1503
|
+
return re.reduce(function(input, re) {
|
|
1504
|
+
return input.replace(re, value);
|
|
1505
|
+
}, input);
|
|
1536
1506
|
}
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
return
|
|
1507
|
+
//#endregion
|
|
1508
|
+
//#region ../../../node_modules/.pnpm/dot-case@3.0.4/node_modules/dot-case/dist.es2015/index.js
|
|
1509
|
+
function dotCase(input, options) {
|
|
1510
|
+
if (options === void 0) options = {};
|
|
1511
|
+
return noCase(input, __assign({ delimiter: "." }, options));
|
|
1542
1512
|
}
|
|
1543
|
-
|
|
1544
|
-
|
|
1513
|
+
//#endregion
|
|
1514
|
+
//#region ../../../node_modules/.pnpm/param-case@3.0.4/node_modules/param-case/dist.es2015/index.js
|
|
1515
|
+
function paramCase(input, options) {
|
|
1516
|
+
if (options === void 0) options = {};
|
|
1517
|
+
return dotCase(input, __assign({ delimiter: "-" }, options));
|
|
1545
1518
|
}
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1519
|
+
//#endregion
|
|
1520
|
+
//#region ../../../node_modules/.pnpm/@base-ui+utils@0.3.1_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/useRefWithInit.mjs
|
|
1521
|
+
const UNINITIALIZED = {};
|
|
1522
|
+
/**
|
|
1523
|
+
* A React.useRef() that is initialized with a function. Note that it accepts an optional
|
|
1524
|
+
* initialization argument, so the initialization function doesn't need to be an inline closure.
|
|
1525
|
+
*
|
|
1526
|
+
* @usage
|
|
1527
|
+
* const ref = useRefWithInit(sortColumns, columns)
|
|
1528
|
+
*/
|
|
1529
|
+
function useRefWithInit(init, initArg) {
|
|
1530
|
+
const ref = React.useRef(UNINITIALIZED);
|
|
1531
|
+
if (ref.current === UNINITIALIZED) ref.current = init(initArg);
|
|
1532
|
+
return ref;
|
|
1549
1533
|
}
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
return result;
|
|
1534
|
+
//#endregion
|
|
1535
|
+
//#region ../../../node_modules/.pnpm/@base-ui+utils@0.3.1_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/warn.mjs
|
|
1536
|
+
let set;
|
|
1537
|
+
if (process.env.NODE_ENV !== "production") set = /* @__PURE__ */ new Set();
|
|
1538
|
+
function warn(...messages) {
|
|
1539
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1540
|
+
const messageKey = messages.join(" ");
|
|
1541
|
+
if (!set.has(messageKey)) {
|
|
1542
|
+
set.add(messageKey);
|
|
1543
|
+
console.warn(`Base UI: ${messageKey}`);
|
|
1561
1544
|
}
|
|
1562
|
-
const result = theirHandler(...args);
|
|
1563
|
-
ourHandler?.(...args);
|
|
1564
|
-
return result;
|
|
1565
|
-
};
|
|
1566
|
-
}
|
|
1567
|
-
function wrapEventHandler(handler) {
|
|
1568
|
-
if (!handler) return handler;
|
|
1569
|
-
return (...args) => {
|
|
1570
|
-
const event = args[0];
|
|
1571
|
-
if (isSyntheticEvent(event)) makeEventPreventable(event);
|
|
1572
|
-
return handler(...args);
|
|
1573
|
-
};
|
|
1574
|
-
}
|
|
1575
|
-
function makeEventPreventable(event) {
|
|
1576
|
-
event.preventBaseUIHandler = () => {
|
|
1577
|
-
event.baseUIHandlerPrevented = true;
|
|
1578
|
-
};
|
|
1579
|
-
return event;
|
|
1580
|
-
}
|
|
1581
|
-
function mergeClassNames(ourClassName, theirClassName) {
|
|
1582
|
-
if (theirClassName) {
|
|
1583
|
-
if (ourClassName) return theirClassName + " " + ourClassName;
|
|
1584
|
-
return theirClassName;
|
|
1585
1545
|
}
|
|
1586
|
-
return ourClassName;
|
|
1587
|
-
}
|
|
1588
|
-
function isSyntheticEvent(event) {
|
|
1589
|
-
return event != null && typeof event === "object" && "nativeEvent" in event;
|
|
1590
1546
|
}
|
|
1591
1547
|
//#endregion
|
|
1592
|
-
//#region ../../../node_modules/.pnpm/@base-ui+utils@0.
|
|
1548
|
+
//#region ../../../node_modules/.pnpm/@base-ui+utils@0.3.1_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/formatErrorMessage.mjs
|
|
1593
1549
|
/**
|
|
1594
1550
|
* Creates a formatErrorMessage function with a custom URL and prefix.
|
|
1595
1551
|
* @param baseUrl - The base URL for the error page (e.g., 'https://base-ui.com/production-error')
|
|
@@ -1615,22 +1571,7 @@ function createFormatErrorMessage(baseUrl, prefix) {
|
|
|
1615
1571
|
*/
|
|
1616
1572
|
const formatErrorMessage = createFormatErrorMessage("https://base-ui.com/production-error", "Base UI");
|
|
1617
1573
|
//#endregion
|
|
1618
|
-
//#region ../../../node_modules/.pnpm/@base-ui+utils@0.
|
|
1619
|
-
const UNINITIALIZED = {};
|
|
1620
|
-
/**
|
|
1621
|
-
* A React.useRef() that is initialized with a function. Note that it accepts an optional
|
|
1622
|
-
* initialization argument, so the initialization function doesn't need to be an inline closure.
|
|
1623
|
-
*
|
|
1624
|
-
* @usage
|
|
1625
|
-
* const ref = useRefWithInit(sortColumns, columns)
|
|
1626
|
-
*/
|
|
1627
|
-
function useRefWithInit(init, initArg) {
|
|
1628
|
-
const ref = React.useRef(UNINITIALIZED);
|
|
1629
|
-
if (ref.current === UNINITIALIZED) ref.current = init(initArg);
|
|
1630
|
-
return ref;
|
|
1631
|
-
}
|
|
1632
|
-
//#endregion
|
|
1633
|
-
//#region ../../../node_modules/.pnpm/@base-ui+utils@0.2.9_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/useMergedRefs.js
|
|
1574
|
+
//#region ../../../node_modules/.pnpm/@base-ui+utils@0.3.1_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/useMergedRefs.mjs
|
|
1634
1575
|
/**
|
|
1635
1576
|
* Merges refs into a single memoized callback ref or `null`.
|
|
1636
1577
|
* This makes sure multiple refs are updated together and have the same value.
|
|
@@ -1721,13 +1662,13 @@ function update(forkRef, refs) {
|
|
|
1721
1662
|
};
|
|
1722
1663
|
}
|
|
1723
1664
|
//#endregion
|
|
1724
|
-
//#region ../../../node_modules/.pnpm/@base-ui+utils@0.
|
|
1665
|
+
//#region ../../../node_modules/.pnpm/@base-ui+utils@0.3.1_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/reactVersion.mjs
|
|
1725
1666
|
const majorVersion = parseInt(React.version, 10);
|
|
1726
1667
|
function isReactVersionAtLeast(reactVersionToCheck) {
|
|
1727
1668
|
return majorVersion >= reactVersionToCheck;
|
|
1728
1669
|
}
|
|
1729
1670
|
//#endregion
|
|
1730
|
-
//#region ../../../node_modules/.pnpm/@base-ui+utils@0.
|
|
1671
|
+
//#region ../../../node_modules/.pnpm/@base-ui+utils@0.3.1_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/getReactElementRef.mjs
|
|
1731
1672
|
/**
|
|
1732
1673
|
* Extracts the `ref` from a React element, handling different React versions.
|
|
1733
1674
|
*/
|
|
@@ -1738,24 +1679,21 @@ function getReactElementRef(element) {
|
|
|
1738
1679
|
return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null;
|
|
1739
1680
|
}
|
|
1740
1681
|
//#endregion
|
|
1741
|
-
//#region ../../../node_modules/.pnpm/@base-ui+utils@0.
|
|
1742
|
-
|
|
1743
|
-
if (
|
|
1744
|
-
|
|
1745
|
-
if (
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
//#region ../../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@18.3.28_date-fns@4.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/internals/getStateAttributesProps.js
|
|
1757
|
-
function getStateAttributesProps(state, customMapping) {
|
|
1758
|
-
const props = {};
|
|
1682
|
+
//#region ../../../node_modules/.pnpm/@base-ui+utils@0.3.1_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/mergeObjects.mjs
|
|
1683
|
+
function mergeObjects(a, b) {
|
|
1684
|
+
if (a && !b) return a;
|
|
1685
|
+
if (!a && b) return b;
|
|
1686
|
+
if (a || b) return {
|
|
1687
|
+
...a,
|
|
1688
|
+
...b
|
|
1689
|
+
};
|
|
1690
|
+
}
|
|
1691
|
+
Object.freeze([]);
|
|
1692
|
+
const EMPTY_OBJECT = Object.freeze({});
|
|
1693
|
+
//#endregion
|
|
1694
|
+
//#region ../../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@18.3.28_date-fns@4.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/internals/getStateAttributesProps.mjs
|
|
1695
|
+
function getStateAttributesProps(state, customMapping) {
|
|
1696
|
+
const props = {};
|
|
1759
1697
|
for (const key in state) {
|
|
1760
1698
|
const value = state[key];
|
|
1761
1699
|
if (customMapping?.hasOwnProperty(key)) {
|
|
@@ -1769,7 +1707,7 @@ function getStateAttributesProps(state, customMapping) {
|
|
|
1769
1707
|
return props;
|
|
1770
1708
|
}
|
|
1771
1709
|
//#endregion
|
|
1772
|
-
//#region ../../../node_modules/.pnpm/@base-ui+react@1.
|
|
1710
|
+
//#region ../../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@18.3.28_date-fns@4.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/utils/resolveClassName.mjs
|
|
1773
1711
|
/**
|
|
1774
1712
|
* If the provided className is a string, it will be returned as is.
|
|
1775
1713
|
* Otherwise, the function will call the className function with the state as the first argument.
|
|
@@ -1781,7 +1719,7 @@ function resolveClassName(className, state) {
|
|
|
1781
1719
|
return typeof className === "function" ? className(state) : className;
|
|
1782
1720
|
}
|
|
1783
1721
|
//#endregion
|
|
1784
|
-
//#region ../../../node_modules/.pnpm/@base-ui+react@1.
|
|
1722
|
+
//#region ../../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@18.3.28_date-fns@4.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/utils/resolveStyle.mjs
|
|
1785
1723
|
/**
|
|
1786
1724
|
* If the provided style is an object, it will be returned as is.
|
|
1787
1725
|
* Otherwise, the function will call the style function with the state as the first argument.
|
|
@@ -1793,7 +1731,158 @@ function resolveStyle(style, state) {
|
|
|
1793
1731
|
return typeof style === "function" ? style(state) : style;
|
|
1794
1732
|
}
|
|
1795
1733
|
//#endregion
|
|
1796
|
-
//#region ../../../node_modules/.pnpm/@base-ui+react@1.
|
|
1734
|
+
//#region ../../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@18.3.28_date-fns@4.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/merge-props/mergeProps.mjs
|
|
1735
|
+
const EMPTY_PROPS = {};
|
|
1736
|
+
/**
|
|
1737
|
+
* Merges multiple sets of React props. It follows the Object.assign pattern where the rightmost object's fields overwrite
|
|
1738
|
+
* the conflicting ones from others. This doesn't apply to event handlers, `className` and `style` props.
|
|
1739
|
+
*
|
|
1740
|
+
* Event handlers are merged and called in right-to-left order (rightmost handler executes first, leftmost last).
|
|
1741
|
+
* For React synthetic events, the rightmost handler can prevent prior (left-positioned) handlers from executing
|
|
1742
|
+
* by calling `event.preventBaseUIHandler()`. For non-synthetic events (custom events with primitive/object values),
|
|
1743
|
+
* all handlers always execute without prevention capability.
|
|
1744
|
+
*
|
|
1745
|
+
* The `className` prop is merged by concatenating classes in right-to-left order (rightmost class appears first in the string).
|
|
1746
|
+
* The `style` prop is merged with rightmost styles overwriting the prior ones.
|
|
1747
|
+
*
|
|
1748
|
+
* Props can either be provided as objects or as functions that take the previous props as an argument.
|
|
1749
|
+
* The function will receive the merged props up to that point (going from left to right):
|
|
1750
|
+
* so in the case of `(obj1, obj2, fn, obj3)`, `fn` will receive the merged props of `obj1` and `obj2`.
|
|
1751
|
+
* The function is responsible for chaining event handlers if needed (that is, we don't run the merge logic).
|
|
1752
|
+
*
|
|
1753
|
+
* Event handlers returned by the functions are not automatically prevented when `preventBaseUIHandler` is called.
|
|
1754
|
+
* They must check `event.baseUIHandlerPrevented` themselves and bail out if it's true.
|
|
1755
|
+
*
|
|
1756
|
+
* @important **`ref` is not merged.**
|
|
1757
|
+
* @param a Props object to merge.
|
|
1758
|
+
* @param b Props object to merge. The function will overwrite conflicting props from `a`.
|
|
1759
|
+
* @param c Props object to merge. The function will overwrite conflicting props from previous parameters.
|
|
1760
|
+
* @param d Props object to merge. The function will overwrite conflicting props from previous parameters.
|
|
1761
|
+
* @param e Props object to merge. The function will overwrite conflicting props from previous parameters.
|
|
1762
|
+
* @returns The merged props.
|
|
1763
|
+
* @public
|
|
1764
|
+
*/
|
|
1765
|
+
function mergeProps(a, b, c, d, e) {
|
|
1766
|
+
if (!c && !d && !e && !a) return createInitialMergedProps(b);
|
|
1767
|
+
let merged = createInitialMergedProps(a);
|
|
1768
|
+
if (b) merged = mergeInto(merged, b);
|
|
1769
|
+
if (c) merged = mergeInto(merged, c);
|
|
1770
|
+
if (d) merged = mergeInto(merged, d);
|
|
1771
|
+
if (e) merged = mergeInto(merged, e);
|
|
1772
|
+
return merged;
|
|
1773
|
+
}
|
|
1774
|
+
/**
|
|
1775
|
+
* Merges an arbitrary number of React props using the same logic as {@link mergeProps}.
|
|
1776
|
+
* This function accepts an array of props instead of individual arguments.
|
|
1777
|
+
*
|
|
1778
|
+
* This has slightly lower performance than {@link mergeProps} due to accepting an array
|
|
1779
|
+
* instead of a fixed number of arguments. Prefer {@link mergeProps} when merging 5 or
|
|
1780
|
+
* fewer prop sets for better performance.
|
|
1781
|
+
*
|
|
1782
|
+
* @param props Array of props to merge.
|
|
1783
|
+
* @returns The merged props.
|
|
1784
|
+
* @see mergeProps
|
|
1785
|
+
* @public
|
|
1786
|
+
*/
|
|
1787
|
+
function mergePropsN(props) {
|
|
1788
|
+
if (props.length === 0) return EMPTY_PROPS;
|
|
1789
|
+
if (props.length === 1) return createInitialMergedProps(props[0]);
|
|
1790
|
+
let merged = createInitialMergedProps(props[0]);
|
|
1791
|
+
for (let i = 1; i < props.length; i += 1) merged = mergeInto(merged, props[i]);
|
|
1792
|
+
return merged;
|
|
1793
|
+
}
|
|
1794
|
+
function createInitialMergedProps(inputProps) {
|
|
1795
|
+
if (isPropsGetter(inputProps)) return { ...resolvePropsGetter(inputProps, EMPTY_PROPS) };
|
|
1796
|
+
return copyInitialProps(inputProps);
|
|
1797
|
+
}
|
|
1798
|
+
function mergeInto(merged, inputProps) {
|
|
1799
|
+
if (isPropsGetter(inputProps)) return resolvePropsGetter(inputProps, merged);
|
|
1800
|
+
return mutablyMergeInto(merged, inputProps);
|
|
1801
|
+
}
|
|
1802
|
+
function copyInitialProps(inputProps) {
|
|
1803
|
+
const copiedProps = { ...inputProps };
|
|
1804
|
+
for (const propName in copiedProps) {
|
|
1805
|
+
const propValue = copiedProps[propName];
|
|
1806
|
+
if (isEventHandler(propName, propValue)) copiedProps[propName] = wrapEventHandler(propValue);
|
|
1807
|
+
}
|
|
1808
|
+
return copiedProps;
|
|
1809
|
+
}
|
|
1810
|
+
/**
|
|
1811
|
+
* Merges two sets of props. In case of conflicts, the external props take precedence.
|
|
1812
|
+
*/
|
|
1813
|
+
function mutablyMergeInto(mergedProps, externalProps) {
|
|
1814
|
+
if (!externalProps) return mergedProps;
|
|
1815
|
+
for (const propName in externalProps) {
|
|
1816
|
+
const externalPropValue = externalProps[propName];
|
|
1817
|
+
switch (propName) {
|
|
1818
|
+
case "style":
|
|
1819
|
+
mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue);
|
|
1820
|
+
break;
|
|
1821
|
+
case "className":
|
|
1822
|
+
mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue);
|
|
1823
|
+
break;
|
|
1824
|
+
default: if (isEventHandler(propName, externalPropValue)) mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue);
|
|
1825
|
+
else mergedProps[propName] = externalPropValue;
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1828
|
+
return mergedProps;
|
|
1829
|
+
}
|
|
1830
|
+
function isEventHandler(key, value) {
|
|
1831
|
+
const code0 = key.charCodeAt(0);
|
|
1832
|
+
const code1 = key.charCodeAt(1);
|
|
1833
|
+
const code2 = key.charCodeAt(2);
|
|
1834
|
+
return code0 === 111 && code1 === 110 && code2 >= 65 && code2 <= 90 && (typeof value === "function" || typeof value === "undefined");
|
|
1835
|
+
}
|
|
1836
|
+
function isPropsGetter(inputProps) {
|
|
1837
|
+
return typeof inputProps === "function";
|
|
1838
|
+
}
|
|
1839
|
+
function resolvePropsGetter(inputProps, previousProps) {
|
|
1840
|
+
if (isPropsGetter(inputProps)) return inputProps(previousProps);
|
|
1841
|
+
return inputProps ?? EMPTY_PROPS;
|
|
1842
|
+
}
|
|
1843
|
+
function mergeEventHandlers(ourHandler, theirHandler) {
|
|
1844
|
+
if (!theirHandler) return ourHandler;
|
|
1845
|
+
if (!ourHandler) return wrapEventHandler(theirHandler);
|
|
1846
|
+
return (...args) => {
|
|
1847
|
+
const event = args[0];
|
|
1848
|
+
if (isSyntheticEvent(event)) {
|
|
1849
|
+
const baseUIEvent = event;
|
|
1850
|
+
makeEventPreventable(baseUIEvent);
|
|
1851
|
+
const result = theirHandler(...args);
|
|
1852
|
+
if (!baseUIEvent.baseUIHandlerPrevented) ourHandler?.(...args);
|
|
1853
|
+
return result;
|
|
1854
|
+
}
|
|
1855
|
+
const result = theirHandler(...args);
|
|
1856
|
+
ourHandler?.(...args);
|
|
1857
|
+
return result;
|
|
1858
|
+
};
|
|
1859
|
+
}
|
|
1860
|
+
function wrapEventHandler(handler) {
|
|
1861
|
+
if (!handler) return handler;
|
|
1862
|
+
return (...args) => {
|
|
1863
|
+
const event = args[0];
|
|
1864
|
+
if (isSyntheticEvent(event)) makeEventPreventable(event);
|
|
1865
|
+
return handler(...args);
|
|
1866
|
+
};
|
|
1867
|
+
}
|
|
1868
|
+
function makeEventPreventable(event) {
|
|
1869
|
+
event.preventBaseUIHandler = () => {
|
|
1870
|
+
event.baseUIHandlerPrevented = true;
|
|
1871
|
+
};
|
|
1872
|
+
return event;
|
|
1873
|
+
}
|
|
1874
|
+
function mergeClassNames(ourClassName, theirClassName) {
|
|
1875
|
+
if (theirClassName) {
|
|
1876
|
+
if (ourClassName) return theirClassName + " " + ourClassName;
|
|
1877
|
+
return theirClassName;
|
|
1878
|
+
}
|
|
1879
|
+
return ourClassName;
|
|
1880
|
+
}
|
|
1881
|
+
function isSyntheticEvent(event) {
|
|
1882
|
+
return event != null && typeof event === "object" && "nativeEvent" in event;
|
|
1883
|
+
}
|
|
1884
|
+
//#endregion
|
|
1885
|
+
//#region ../../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@18.3.28_date-fns@4.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/internals/useRenderElement.mjs
|
|
1797
1886
|
/**
|
|
1798
1887
|
* Renders a Base UI element.
|
|
1799
1888
|
*
|
|
@@ -1882,7 +1971,7 @@ function renderTag(Tag, props) {
|
|
|
1882
1971
|
return /*#__PURE__*/ React.createElement(Tag, props);
|
|
1883
1972
|
}
|
|
1884
1973
|
//#endregion
|
|
1885
|
-
//#region ../../../node_modules/.pnpm/@base-ui+react@1.
|
|
1974
|
+
//#region ../../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@18.3.28_date-fns@4.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/use-render/useRender.mjs
|
|
1886
1975
|
/**
|
|
1887
1976
|
* Renders a Base UI element.
|
|
1888
1977
|
*
|
|
@@ -1892,7 +1981,7 @@ function useRender(params) {
|
|
|
1892
1981
|
return useRenderElement(params.defaultTagName ?? "div", params, params);
|
|
1893
1982
|
}
|
|
1894
1983
|
//#endregion
|
|
1895
|
-
//#region ../../../node_modules/.pnpm/@wordpress+ui@0.17.0_@types+react@18.3.28_date-fns@4.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/ui/build-module/
|
|
1984
|
+
//#region ../../../node_modules/.pnpm/@wordpress+ui@0.17.0_@types+react@18.3.28_date-fns@4.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/ui/build-module/text/text.mjs
|
|
1896
1985
|
var STYLE_HASH_ATTRIBUTE$1 = "data-wp-hash";
|
|
1897
1986
|
function getRuntime$1() {
|
|
1898
1987
|
const globalScope = globalThis;
|
|
@@ -1948,35 +2037,39 @@ function registerStyle$1(hash, css) {
|
|
|
1948
2037
|
runtime.styles.set(hash, css);
|
|
1949
2038
|
for (const targetDocument of runtime.documents.keys()) injectStyle$1(targetDocument, hash, css);
|
|
1950
2039
|
}
|
|
1951
|
-
if (typeof process === "undefined" || process.env.NODE_ENV !== "test") registerStyle$1("
|
|
1952
|
-
var style_default$1 = {
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
"
|
|
1960
|
-
"
|
|
2040
|
+
if (typeof process === "undefined" || process.env.NODE_ENV !== "test") registerStyle$1("0c5702ddca", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._83ed8a8da5dd50ea__text{margin:0}._14437cfb77831647__heading-2xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-p-line-height:var(--wpds-typography-line-height-2xl,40px);font-size:var(--wpds-typography-font-size-2xl,32px);line-height:var(--wpds-typography-line-height-2xl,40px)}._14437cfb77831647__heading-2xl,._3c78b7fa9b4072dd__heading-xl{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,\"Segoe UI\",\"Roboto\",\"Oxygen-Sans\",\"Ubuntu\",\"Cantarell\",\"Helvetica Neue\",sans-serif);font-weight:var(--wpds-typography-font-weight-medium,499)}._3c78b7fa9b4072dd__heading-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-md,24px)}.aa58f227716bcde2__heading-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-lg,15px)}.aa58f227716bcde2__heading-lg,.fc4da56d8dfe52c4__heading-md{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,\"Segoe UI\",\"Roboto\",\"Oxygen-Sans\",\"Ubuntu\",\"Cantarell\",\"Helvetica Neue\",sans-serif);font-weight:var(--wpds-typography-font-weight-medium,499);line-height:var(--wpds-typography-line-height-sm,20px)}.fc4da56d8dfe52c4__heading-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px)}.a9b78c7c82e8dff7__heading-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,\"Segoe UI\",\"Roboto\",\"Oxygen-Sans\",\"Ubuntu\",\"Cantarell\",\"Helvetica Neue\",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-medium,499);line-height:var(--wpds-typography-line-height-xs,16px);text-transform:uppercase}._305ff559e52180d5__body-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,400);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-xl,32px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-xl,32px)}._305ff559e52180d5__body-xl,.ca1aa3fc2029e958__body-lg{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,\"Segoe UI\",\"Roboto\",\"Oxygen-Sans\",\"Ubuntu\",\"Cantarell\",\"Helvetica Neue\",sans-serif);font-weight:var(--wpds-typography-font-weight-regular,400)}.ca1aa3fc2029e958__body-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,400);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-lg,15px);line-height:var(--wpds-typography-line-height-md,24px)}._131101940be12424__body-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,400);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-sm,20px)}._0e8d87a42c1f75fa__body-sm,._131101940be12424__body-md{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,\"Segoe UI\",\"Roboto\",\"Oxygen-Sans\",\"Ubuntu\",\"Cantarell\",\"Helvetica Neue\",sans-serif);font-weight:var(--wpds-typography-font-weight-regular,400)}._0e8d87a42c1f75fa__body-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,400);--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}");
|
|
2041
|
+
var style_default$1 = {
|
|
2042
|
+
"text": "_83ed8a8da5dd50ea__text",
|
|
2043
|
+
"heading-2xl": "_14437cfb77831647__heading-2xl",
|
|
2044
|
+
"heading-xl": "_3c78b7fa9b4072dd__heading-xl",
|
|
2045
|
+
"heading-lg": "aa58f227716bcde2__heading-lg",
|
|
2046
|
+
"heading-md": "fc4da56d8dfe52c4__heading-md",
|
|
2047
|
+
"heading-sm": "a9b78c7c82e8dff7__heading-sm",
|
|
2048
|
+
"body-xl": "_305ff559e52180d5__body-xl",
|
|
2049
|
+
"body-lg": "ca1aa3fc2029e958__body-lg",
|
|
2050
|
+
"body-md": "_131101940be12424__body-md",
|
|
2051
|
+
"body-sm": "_0e8d87a42c1f75fa__body-sm"
|
|
1961
2052
|
};
|
|
1962
|
-
|
|
2053
|
+
if (typeof process === "undefined" || process.env.NODE_ENV !== "test") registerStyle$1("d390e935a7", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-medium,499));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}");
|
|
2054
|
+
var global_css_defense_default = {
|
|
2055
|
+
"button": "_6defc79820e382c6__button",
|
|
2056
|
+
"input": "d2cff2e5dea83bd1__input",
|
|
2057
|
+
"textarea": "_547d86373d02e108__textarea",
|
|
2058
|
+
"div": "_8c15fd0ed9f28ba4__div",
|
|
2059
|
+
"p": "_43cec3e1eec1066d__p",
|
|
2060
|
+
"heading": "e97669c6d9a38497__heading",
|
|
2061
|
+
"a": "_2c0831b0499dbd6e__a"
|
|
2062
|
+
};
|
|
2063
|
+
var Text$1 = forwardRef$1(function Text2({ variant = "body-md", render, className, ...props }, ref) {
|
|
1963
2064
|
return useRender({
|
|
1964
2065
|
render,
|
|
2066
|
+
defaultTagName: "span",
|
|
1965
2067
|
ref,
|
|
1966
|
-
props: mergeProps(props, {
|
|
1967
|
-
style: {
|
|
1968
|
-
gap: gap && gapTokens[gap],
|
|
1969
|
-
alignItems: align,
|
|
1970
|
-
justifyContent: justify,
|
|
1971
|
-
flexDirection: direction,
|
|
1972
|
-
flexWrap: wrap
|
|
1973
|
-
},
|
|
1974
|
-
className: style_default$1.stack
|
|
1975
|
-
})
|
|
2068
|
+
props: mergeProps(props, { className: clsx(style_default$1.text, global_css_defense_default.heading, global_css_defense_default.p, style_default$1[variant], className) })
|
|
1976
2069
|
});
|
|
1977
2070
|
});
|
|
1978
2071
|
//#endregion
|
|
1979
|
-
//#region ../../../node_modules/.pnpm/@wordpress+ui@0.17.0_@types+react@18.3.28_date-fns@4.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/ui/build-module/
|
|
2072
|
+
//#region ../../../node_modules/.pnpm/@wordpress+ui@0.17.0_@types+react@18.3.28_date-fns@4.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/ui/build-module/stack/stack.mjs
|
|
1980
2073
|
var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
|
|
1981
2074
|
function getRuntime() {
|
|
1982
2075
|
const globalScope = globalThis;
|
|
@@ -2032,35 +2125,31 @@ function registerStyle(hash, css) {
|
|
|
2032
2125
|
runtime.styles.set(hash, css);
|
|
2033
2126
|
for (const targetDocument of runtime.documents.keys()) injectStyle(targetDocument, hash, css);
|
|
2034
2127
|
}
|
|
2035
|
-
if (typeof process === "undefined" || process.env.NODE_ENV !== "test") registerStyle("
|
|
2036
|
-
var style_default = {
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
"
|
|
2044
|
-
"
|
|
2045
|
-
"body-md": "_131101940be12424__body-md",
|
|
2046
|
-
"body-sm": "_0e8d87a42c1f75fa__body-sm"
|
|
2047
|
-
};
|
|
2048
|
-
if (typeof process === "undefined" || process.env.NODE_ENV !== "test") registerStyle("d390e935a7", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-medium,499));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}");
|
|
2049
|
-
var global_css_defense_default = {
|
|
2050
|
-
"button": "_6defc79820e382c6__button",
|
|
2051
|
-
"input": "d2cff2e5dea83bd1__input",
|
|
2052
|
-
"textarea": "_547d86373d02e108__textarea",
|
|
2053
|
-
"div": "_8c15fd0ed9f28ba4__div",
|
|
2054
|
-
"p": "_43cec3e1eec1066d__p",
|
|
2055
|
-
"heading": "e97669c6d9a38497__heading",
|
|
2056
|
-
"a": "_2c0831b0499dbd6e__a"
|
|
2128
|
+
if (typeof process === "undefined" || process.env.NODE_ENV !== "test") registerStyle("32aba35fe1", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._19ce0419607e1896__stack{display:flex}}}");
|
|
2129
|
+
var style_default = { "stack": "_19ce0419607e1896__stack" };
|
|
2130
|
+
var gapTokens = {
|
|
2131
|
+
xs: "var(--wpds-dimension-gap-xs, 4px)",
|
|
2132
|
+
sm: "var(--wpds-dimension-gap-sm, 8px)",
|
|
2133
|
+
md: "var(--wpds-dimension-gap-md, 12px)",
|
|
2134
|
+
lg: "var(--wpds-dimension-gap-lg, 16px)",
|
|
2135
|
+
xl: "var(--wpds-dimension-gap-xl, 24px)",
|
|
2136
|
+
"2xl": "var(--wpds-dimension-gap-2xl, 32px)",
|
|
2137
|
+
"3xl": "var(--wpds-dimension-gap-3xl, 40px)"
|
|
2057
2138
|
};
|
|
2058
|
-
var
|
|
2139
|
+
var Stack = forwardRef$1(function Stack2({ direction, gap, align, justify, wrap, render, ...props }, ref) {
|
|
2059
2140
|
return useRender({
|
|
2060
2141
|
render,
|
|
2061
|
-
defaultTagName: "span",
|
|
2062
2142
|
ref,
|
|
2063
|
-
props: mergeProps(props, {
|
|
2143
|
+
props: mergeProps(props, {
|
|
2144
|
+
style: {
|
|
2145
|
+
gap: gap && gapTokens[gap],
|
|
2146
|
+
alignItems: align,
|
|
2147
|
+
justifyContent: justify,
|
|
2148
|
+
flexDirection: direction,
|
|
2149
|
+
flexWrap: wrap
|
|
2150
|
+
},
|
|
2151
|
+
className: style_default.stack
|
|
2152
|
+
})
|
|
2064
2153
|
});
|
|
2065
2154
|
});
|
|
2066
2155
|
//#endregion
|
|
@@ -2818,27 +2907,14 @@ const guessOptimalNumTicks = (data, chartWidth, tickFormatter) => {
|
|
|
2818
2907
|
};
|
|
2819
2908
|
//#endregion
|
|
2820
2909
|
//#region src/charts/private/with-responsive/with-responsive.module.scss
|
|
2821
|
-
var with_responsive_module_default = {
|
|
2910
|
+
var with_responsive_module_default = {
|
|
2911
|
+
"container": "a8ccharts-sP1gHa-container",
|
|
2912
|
+
"content": "a8ccharts-sP1gHa-content",
|
|
2913
|
+
"isContained": "a8ccharts-sP1gHa-isContained"
|
|
2914
|
+
};
|
|
2822
2915
|
//#endregion
|
|
2823
2916
|
//#region src/charts/private/with-responsive/with-responsive.tsx
|
|
2824
|
-
const
|
|
2825
|
-
const { parentRef, width: parentWidth, height: parentHeight } = useParentSize({
|
|
2826
|
-
debounceTime: resizeDebounceTime,
|
|
2827
|
-
enableDebounceLeadingCall: true
|
|
2828
|
-
});
|
|
2829
|
-
const containerWidth = parentWidth > 0 ? Math.min(parentWidth, maxWidth) : 0;
|
|
2830
|
-
return {
|
|
2831
|
-
parentRef,
|
|
2832
|
-
width: containerWidth,
|
|
2833
|
-
height: aspectRatio !== void 0 ? containerWidth * aspectRatio : parentHeight,
|
|
2834
|
-
/**
|
|
2835
|
-
* Whether an aspectRatio was provided. Used to determine container
|
|
2836
|
-
* height styling: 'auto' when true (height derived from width),
|
|
2837
|
-
* '100%' when false (fill parent container).
|
|
2838
|
-
*/
|
|
2839
|
-
hasAspectRatio: aspectRatio !== void 0
|
|
2840
|
-
};
|
|
2841
|
-
};
|
|
2917
|
+
const useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
|
2842
2918
|
/**
|
|
2843
2919
|
* A higher-order component that provides responsive dimensions
|
|
2844
2920
|
* to the wrapped chart component using useParentSize from `@visx/responsive`.
|
|
@@ -2848,32 +2924,67 @@ const useResponsiveDimensions = ({ resizeDebounceTime = 300, maxWidth = 1200, as
|
|
|
2848
2924
|
*/
|
|
2849
2925
|
function withResponsive(WrappedComponent) {
|
|
2850
2926
|
return function ResponsiveChart({ resizeDebounceTime = 300, maxWidth = 1200, aspectRatio, size, width, height, ...chartProps }) {
|
|
2851
|
-
const { parentRef, width:
|
|
2852
|
-
resizeDebounceTime,
|
|
2853
|
-
|
|
2854
|
-
aspectRatio
|
|
2927
|
+
const { parentRef, width: parentWidth, height: parentHeight } = useParentSize({
|
|
2928
|
+
debounceTime: resizeDebounceTime,
|
|
2929
|
+
enableDebounceLeadingCall: true
|
|
2855
2930
|
});
|
|
2856
|
-
const
|
|
2857
|
-
const
|
|
2858
|
-
const
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
}
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2931
|
+
const hasAspectRatio = aspectRatio !== void 0 && aspectRatio > 0;
|
|
2932
|
+
const wrapperRef = useRef(null);
|
|
2933
|
+
const setWrapperRef = useCallback((node) => {
|
|
2934
|
+
wrapperRef.current = node;
|
|
2935
|
+
if (typeof parentRef === "function") parentRef(node);
|
|
2936
|
+
else if (parentRef) parentRef.current = node;
|
|
2937
|
+
}, [parentRef]);
|
|
2938
|
+
const [containedHeight, setContainedHeight] = useState(null);
|
|
2939
|
+
const availableWidth = parentWidth > 0 ? Math.min(parentWidth, width === void 0 ? maxWidth : Infinity) : width ?? 0;
|
|
2940
|
+
let boxWidth = availableWidth;
|
|
2941
|
+
let boxHeight;
|
|
2942
|
+
if (hasAspectRatio) {
|
|
2943
|
+
const derivedHeight = availableWidth * aspectRatio;
|
|
2944
|
+
if (containedHeight !== null && derivedHeight > containedHeight) {
|
|
2945
|
+
boxHeight = containedHeight;
|
|
2946
|
+
boxWidth = boxHeight / aspectRatio;
|
|
2947
|
+
} else boxHeight = derivedHeight;
|
|
2948
|
+
} else boxHeight = parentHeight > 0 ? parentHeight : height ?? 0;
|
|
2949
|
+
useIsomorphicLayoutEffect(() => {
|
|
2950
|
+
if (!hasAspectRatio) {
|
|
2951
|
+
if (containedHeight !== null) setContainedHeight(null);
|
|
2952
|
+
return;
|
|
2953
|
+
}
|
|
2954
|
+
const available = wrapperRef.current?.clientHeight ?? 0;
|
|
2955
|
+
const derivedHeight = availableWidth * aspectRatio;
|
|
2956
|
+
if (containedHeight === null) {
|
|
2957
|
+
if (available > 0 && derivedHeight > available + 1) setContainedHeight(available);
|
|
2958
|
+
} else if (available >= derivedHeight - 1) setContainedHeight(null);
|
|
2959
|
+
else if (Math.abs(available - containedHeight) > 1) setContainedHeight(available);
|
|
2960
|
+
}, [
|
|
2961
|
+
hasAspectRatio,
|
|
2962
|
+
availableWidth,
|
|
2963
|
+
aspectRatio,
|
|
2964
|
+
containedHeight,
|
|
2965
|
+
parentHeight
|
|
2966
|
+
]);
|
|
2967
|
+
const wrappedComponent = /* @__PURE__ */ jsx(WrappedComponent, {
|
|
2968
|
+
width: boxWidth,
|
|
2969
|
+
height: boxHeight,
|
|
2970
|
+
size,
|
|
2971
|
+
...chartProps
|
|
2972
|
+
});
|
|
2973
|
+
return /* @__PURE__ */ jsx("div", {
|
|
2974
|
+
ref: setWrapperRef,
|
|
2975
|
+
className: clsx(with_responsive_module_default.container, hasAspectRatio && with_responsive_module_default.isContained),
|
|
2976
|
+
style: {
|
|
2977
|
+
...width !== void 0 ? { width } : null,
|
|
2978
|
+
...height !== void 0 ? { height } : null
|
|
2979
|
+
},
|
|
2980
|
+
children: hasAspectRatio ? /* @__PURE__ */ jsx("div", {
|
|
2981
|
+
className: with_responsive_module_default.content,
|
|
2982
|
+
style: {
|
|
2983
|
+
width: boxWidth,
|
|
2984
|
+
height: boxHeight
|
|
2985
|
+
},
|
|
2986
|
+
children: wrappedComponent
|
|
2987
|
+
}) : wrappedComponent
|
|
2877
2988
|
});
|
|
2878
2989
|
};
|
|
2879
2990
|
}
|
|
@@ -3081,6 +3192,86 @@ var line_chart_module_default = {
|
|
|
3081
3192
|
"line-chart--animated": "a8ccharts-inuQka-line-chart--animated",
|
|
3082
3193
|
"rise": "a8ccharts-inuQka-rise"
|
|
3083
3194
|
};
|
|
3195
|
+
const CloseIcon = () => /* @__PURE__ */ jsx("svg", {
|
|
3196
|
+
width: "16",
|
|
3197
|
+
height: "16",
|
|
3198
|
+
viewBox: "0 0 24 24",
|
|
3199
|
+
fill: "none",
|
|
3200
|
+
stroke: "currentColor",
|
|
3201
|
+
strokeWidth: "2",
|
|
3202
|
+
strokeLinecap: "round",
|
|
3203
|
+
strokeLinejoin: "round",
|
|
3204
|
+
"aria-hidden": "true",
|
|
3205
|
+
focusable: "false",
|
|
3206
|
+
children: /* @__PURE__ */ jsx("path", { d: "M6 6l12 12M18 6L6 18" })
|
|
3207
|
+
});
|
|
3208
|
+
const LineChartAnnotationLabelWithPopover = ({ title, subtitle, renderLabel, renderLabelPopover }) => {
|
|
3209
|
+
const popoverId = useId();
|
|
3210
|
+
const buttonRef = useRef(null);
|
|
3211
|
+
const popoverRef = useRef(null);
|
|
3212
|
+
const [isPositioned, setIsPositioned] = useState(false);
|
|
3213
|
+
const isBrowserSafari = isSafari();
|
|
3214
|
+
useEffect(() => {
|
|
3215
|
+
const button = buttonRef.current;
|
|
3216
|
+
const popover = popoverRef.current;
|
|
3217
|
+
if (!button || !popover) return;
|
|
3218
|
+
const positionPopover = () => {
|
|
3219
|
+
if (!isBrowserSafari) {
|
|
3220
|
+
const buttonRect = button.getBoundingClientRect();
|
|
3221
|
+
popover.style.left = `${buttonRect.right}px`;
|
|
3222
|
+
popover.style.top = `${buttonRect.top}px`;
|
|
3223
|
+
}
|
|
3224
|
+
setIsPositioned(true);
|
|
3225
|
+
};
|
|
3226
|
+
popover.addEventListener("toggle", (e) => {
|
|
3227
|
+
if (e.newState === "open") positionPopover();
|
|
3228
|
+
});
|
|
3229
|
+
try {
|
|
3230
|
+
if (popover.matches(":popover-open")) positionPopover();
|
|
3231
|
+
} catch {}
|
|
3232
|
+
}, [isBrowserSafari]);
|
|
3233
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
3234
|
+
className: line_chart_module_default["line-chart__annotation-label"],
|
|
3235
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
3236
|
+
ref: buttonRef,
|
|
3237
|
+
popovertarget: popoverId,
|
|
3238
|
+
className: line_chart_module_default["line-chart__annotation-label-trigger-button"],
|
|
3239
|
+
style: {
|
|
3240
|
+
width: `44px`,
|
|
3241
|
+
height: `44px`,
|
|
3242
|
+
transform: `translate(${44 / 2}px, 0)`
|
|
3243
|
+
},
|
|
3244
|
+
"aria-label": title || __("View details", "jetpack-charts"),
|
|
3245
|
+
children: renderLabel({
|
|
3246
|
+
title,
|
|
3247
|
+
subtitle
|
|
3248
|
+
})
|
|
3249
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
3250
|
+
ref: popoverRef,
|
|
3251
|
+
id: popoverId,
|
|
3252
|
+
popover: "auto",
|
|
3253
|
+
className: clsx(line_chart_module_default["line-chart__annotation-label-popover"], isPositioned && line_chart_module_default["line-chart__annotation-label-popover--visible"], isBrowserSafari && line_chart_module_default["line-chart__annotation-label-popover--safari"]),
|
|
3254
|
+
children: /* @__PURE__ */ jsxs(Stack, {
|
|
3255
|
+
direction: "row",
|
|
3256
|
+
align: "flex-start",
|
|
3257
|
+
justify: "space-between",
|
|
3258
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
3259
|
+
className: line_chart_module_default["line-chart__annotation-label-popover-content"],
|
|
3260
|
+
children: renderLabelPopover({
|
|
3261
|
+
title,
|
|
3262
|
+
subtitle
|
|
3263
|
+
})
|
|
3264
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
3265
|
+
popovertarget: popoverId,
|
|
3266
|
+
popovertargetaction: "hide",
|
|
3267
|
+
className: line_chart_module_default["line-chart__annotation-label-popover-close-button"],
|
|
3268
|
+
"aria-label": __("Close", "jetpack-charts"),
|
|
3269
|
+
children: /* @__PURE__ */ jsx(CloseIcon, {})
|
|
3270
|
+
})]
|
|
3271
|
+
})
|
|
3272
|
+
})]
|
|
3273
|
+
});
|
|
3274
|
+
};
|
|
3084
3275
|
//#endregion
|
|
3085
3276
|
//#region src/charts/line-chart/private/line-chart-annotations-overlay.tsx
|
|
3086
3277
|
const LineChartAnnotationsOverlay = ({ children }) => {
|
|
@@ -3165,86 +3356,6 @@ const LineChartAnnotationsOverlay = ({ children }) => {
|
|
|
3165
3356
|
})
|
|
3166
3357
|
});
|
|
3167
3358
|
};
|
|
3168
|
-
const CloseIcon = () => /* @__PURE__ */ jsx("svg", {
|
|
3169
|
-
width: "16",
|
|
3170
|
-
height: "16",
|
|
3171
|
-
viewBox: "0 0 24 24",
|
|
3172
|
-
fill: "none",
|
|
3173
|
-
stroke: "currentColor",
|
|
3174
|
-
strokeWidth: "2",
|
|
3175
|
-
strokeLinecap: "round",
|
|
3176
|
-
strokeLinejoin: "round",
|
|
3177
|
-
"aria-hidden": "true",
|
|
3178
|
-
focusable: "false",
|
|
3179
|
-
children: /* @__PURE__ */ jsx("path", { d: "M6 6l12 12M18 6L6 18" })
|
|
3180
|
-
});
|
|
3181
|
-
const LineChartAnnotationLabelWithPopover = ({ title, subtitle, renderLabel, renderLabelPopover }) => {
|
|
3182
|
-
const popoverId = useId();
|
|
3183
|
-
const buttonRef = useRef(null);
|
|
3184
|
-
const popoverRef = useRef(null);
|
|
3185
|
-
const [isPositioned, setIsPositioned] = useState(false);
|
|
3186
|
-
const isBrowserSafari = isSafari();
|
|
3187
|
-
useEffect(() => {
|
|
3188
|
-
const button = buttonRef.current;
|
|
3189
|
-
const popover = popoverRef.current;
|
|
3190
|
-
if (!button || !popover) return;
|
|
3191
|
-
const positionPopover = () => {
|
|
3192
|
-
if (!isBrowserSafari) {
|
|
3193
|
-
const buttonRect = button.getBoundingClientRect();
|
|
3194
|
-
popover.style.left = `${buttonRect.right}px`;
|
|
3195
|
-
popover.style.top = `${buttonRect.top}px`;
|
|
3196
|
-
}
|
|
3197
|
-
setIsPositioned(true);
|
|
3198
|
-
};
|
|
3199
|
-
popover.addEventListener("toggle", (e) => {
|
|
3200
|
-
if (e.newState === "open") positionPopover();
|
|
3201
|
-
});
|
|
3202
|
-
try {
|
|
3203
|
-
if (popover.matches(":popover-open")) positionPopover();
|
|
3204
|
-
} catch {}
|
|
3205
|
-
}, [isBrowserSafari]);
|
|
3206
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
3207
|
-
className: line_chart_module_default["line-chart__annotation-label"],
|
|
3208
|
-
children: [/* @__PURE__ */ jsx("button", {
|
|
3209
|
-
ref: buttonRef,
|
|
3210
|
-
popovertarget: popoverId,
|
|
3211
|
-
className: line_chart_module_default["line-chart__annotation-label-trigger-button"],
|
|
3212
|
-
style: {
|
|
3213
|
-
width: `44px`,
|
|
3214
|
-
height: `44px`,
|
|
3215
|
-
transform: `translate(${44 / 2}px, 0)`
|
|
3216
|
-
},
|
|
3217
|
-
"aria-label": title || __("View details", "jetpack-charts"),
|
|
3218
|
-
children: renderLabel({
|
|
3219
|
-
title,
|
|
3220
|
-
subtitle
|
|
3221
|
-
})
|
|
3222
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
3223
|
-
ref: popoverRef,
|
|
3224
|
-
id: popoverId,
|
|
3225
|
-
popover: "auto",
|
|
3226
|
-
className: clsx(line_chart_module_default["line-chart__annotation-label-popover"], isPositioned && line_chart_module_default["line-chart__annotation-label-popover--visible"], isBrowserSafari && line_chart_module_default["line-chart__annotation-label-popover--safari"]),
|
|
3227
|
-
children: /* @__PURE__ */ jsxs(Stack, {
|
|
3228
|
-
direction: "row",
|
|
3229
|
-
align: "flex-start",
|
|
3230
|
-
justify: "space-between",
|
|
3231
|
-
children: [/* @__PURE__ */ jsx("div", {
|
|
3232
|
-
className: line_chart_module_default["line-chart__annotation-label-popover-content"],
|
|
3233
|
-
children: renderLabelPopover({
|
|
3234
|
-
title,
|
|
3235
|
-
subtitle
|
|
3236
|
-
})
|
|
3237
|
-
}), /* @__PURE__ */ jsx("button", {
|
|
3238
|
-
popovertarget: popoverId,
|
|
3239
|
-
popovertargetaction: "hide",
|
|
3240
|
-
className: line_chart_module_default["line-chart__annotation-label-popover-close-button"],
|
|
3241
|
-
"aria-label": __("Close", "jetpack-charts"),
|
|
3242
|
-
children: /* @__PURE__ */ jsx(CloseIcon, {})
|
|
3243
|
-
})]
|
|
3244
|
-
})
|
|
3245
|
-
})]
|
|
3246
|
-
});
|
|
3247
|
-
};
|
|
3248
3359
|
//#endregion
|
|
3249
3360
|
//#region src/charts/line-chart/private/line-chart-annotation.tsx
|
|
3250
3361
|
const ANNOTATION_MAX_WIDTH = 125;
|
|
@@ -3309,7 +3420,10 @@ const LineChartAnnotation = ({ datum, title, subtitle, subjectType = "circle", s
|
|
|
3309
3420
|
const styles = deepmerge(providerTheme.annotationStyles ?? {}, datumStyles ?? {});
|
|
3310
3421
|
const resolveColor = (value) => value ? resolveCssVariable(value) ?? value : value;
|
|
3311
3422
|
useEffect(() => {
|
|
3312
|
-
if (labelRef.current?.getBBox)
|
|
3423
|
+
if (labelRef.current?.getBBox) {
|
|
3424
|
+
const bbox = labelRef.current.getBBox();
|
|
3425
|
+
setHeight(bbox.height);
|
|
3426
|
+
}
|
|
3313
3427
|
}, []);
|
|
3314
3428
|
const positionData = useMemo(() => {
|
|
3315
3429
|
if (!datum || !datum.date || datum.value == null || !xScale || !yScale) return null;
|
|
@@ -4950,8 +5064,9 @@ const BarChartInternal = ({ data, chartId: providedChartId, width, height, class
|
|
|
4950
5064
|
if (dataPointIndex >= maxDataPoints || seriesIndex >= primaryCount) return "";
|
|
4951
5065
|
const seriesData = primaryEntries[seriesIndex]?.series;
|
|
4952
5066
|
if (!seriesData || dataPointIndex >= seriesData.data.length) return "";
|
|
5067
|
+
const actualBarIndex = seriesIndex * maxDataPoints + dataPointIndex;
|
|
4953
5068
|
return `
|
|
4954
|
-
.bar-chart[data-chart-id="bar-chart-${chartId}"] .visx-bar-group .visx-bar:nth-child(${
|
|
5069
|
+
.bar-chart[data-chart-id="bar-chart-${chartId}"] .visx-bar-group .visx-bar:nth-child(${actualBarIndex + 1}) {
|
|
4955
5070
|
stroke: #005fcc;
|
|
4956
5071
|
stroke-width: 2px;
|
|
4957
5072
|
}
|
|
@@ -5171,16 +5286,18 @@ const AxisRenderer = ({ ticks, tickLabelProps, yOffset, labelPosition, valuePosi
|
|
|
5171
5286
|
const getDefaultYOffset = (data, yScaleConfig, height, isMultiSeries) => {
|
|
5172
5287
|
if (!isMultiSeries) return 0;
|
|
5173
5288
|
const dataKeys = data.map(({ label }) => label);
|
|
5174
|
-
|
|
5289
|
+
const yScale = createScale({
|
|
5290
|
+
type: "band",
|
|
5291
|
+
range: [0, height],
|
|
5175
5292
|
domain: dataKeys,
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
}))],
|
|
5293
|
+
...yScaleConfig
|
|
5294
|
+
});
|
|
5295
|
+
const groupScale = scaleBand({
|
|
5296
|
+
domain: dataKeys,
|
|
5297
|
+
range: [0, getScaleBandwidth(yScale)],
|
|
5182
5298
|
padding: yScaleConfig.paddingInner
|
|
5183
|
-
})
|
|
5299
|
+
});
|
|
5300
|
+
return -(getScaleBandwidth(groupScale) + 6);
|
|
5184
5301
|
};
|
|
5185
5302
|
const BarListChartInternal = ({ data, width, height, options = {}, margin = {
|
|
5186
5303
|
left: 0,
|
|
@@ -5859,6 +5976,7 @@ var heatmap_chart_module_default = {
|
|
|
5859
5976
|
"heatmap-chart": "a8ccharts-O3YMOW-heatmap-chart",
|
|
5860
5977
|
"heatmap-chart__cell": "a8ccharts-O3YMOW-heatmap-chart__cell",
|
|
5861
5978
|
"heatmap-chart__cell--filled": "a8ccharts-O3YMOW-heatmap-chart__cell--filled",
|
|
5979
|
+
"heatmap-chart__cell--hidden": "a8ccharts-O3YMOW-heatmap-chart__cell--hidden",
|
|
5862
5980
|
"heatmap-chart__cell--selected": "a8ccharts-O3YMOW-heatmap-chart__cell--selected",
|
|
5863
5981
|
"heatmap-chart__cell--strong": "a8ccharts-O3YMOW-heatmap-chart__cell--strong",
|
|
5864
5982
|
"heatmap-chart__cell-value": "a8ccharts-O3YMOW-heatmap-chart__cell-value",
|
|
@@ -5866,9 +5984,11 @@ var heatmap_chart_module_default = {
|
|
|
5866
5984
|
"heatmap-chart__empty": "a8ccharts-O3YMOW-heatmap-chart__empty",
|
|
5867
5985
|
"heatmap-chart__grid": "a8ccharts-O3YMOW-heatmap-chart__grid",
|
|
5868
5986
|
"heatmap-chart__grid--compact": "a8ccharts-O3YMOW-heatmap-chart__grid--compact",
|
|
5987
|
+
"heatmap-chart__grid--height-capped": "a8ccharts-O3YMOW-heatmap-chart__grid--height-capped",
|
|
5869
5988
|
"heatmap-chart__legend-swatch": "a8ccharts-O3YMOW-heatmap-chart__legend-swatch",
|
|
5870
5989
|
"heatmap-chart__row": "a8ccharts-O3YMOW-heatmap-chart__row",
|
|
5871
|
-
"heatmap-chart__row-label": "a8ccharts-O3YMOW-heatmap-chart__row-label"
|
|
5990
|
+
"heatmap-chart__row-label": "a8ccharts-O3YMOW-heatmap-chart__row-label",
|
|
5991
|
+
"heatmap-chart--height-capped": "a8ccharts-O3YMOW-heatmap-chart--height-capped"
|
|
5872
5992
|
};
|
|
5873
5993
|
//#endregion
|
|
5874
5994
|
//#region src/charts/heatmap-chart/private/use-heatmap-colors.ts
|
|
@@ -5890,14 +6010,18 @@ const getValueExtent = (data) => {
|
|
|
5890
6010
|
return [min, max];
|
|
5891
6011
|
};
|
|
5892
6012
|
/**
|
|
5893
|
-
* Normalize a value to 0–1 within the extent. A flat extent (min === max)
|
|
6013
|
+
* Normalize a value to 0–1 within the extent. A flat extent (min === max)
|
|
6014
|
+
* maps to 1 — every cell is equally the "highest" — except an all-zero
|
|
6015
|
+
* extent, which maps to 0 so a no-activity grid renders at the scale's
|
|
6016
|
+
* bottom instead of full intensity.
|
|
6017
|
+
*
|
|
5894
6018
|
* @param value - The value to normalize
|
|
5895
6019
|
* @param extent - Tuple of [min, max] values for the normalization range
|
|
5896
6020
|
* @return Normalized value between 0 and 1
|
|
5897
6021
|
*/
|
|
5898
6022
|
const getNormalizedValue = (value, extent) => {
|
|
5899
6023
|
const [min, max] = extent;
|
|
5900
|
-
if (min === max) return 1;
|
|
6024
|
+
if (min === max) return max === 0 ? 0 : 1;
|
|
5901
6025
|
return Math.min(1, Math.max(0, (value - min) / (max - min)));
|
|
5902
6026
|
};
|
|
5903
6027
|
//#endregion
|
|
@@ -5918,6 +6042,7 @@ const toDate = (point) => {
|
|
|
5918
6042
|
};
|
|
5919
6043
|
const buildCalendarHeatmapData = (series, options = {}) => {
|
|
5920
6044
|
const weekStartsOn = options.weekStartsOn ?? 1;
|
|
6045
|
+
const hideOutOfRangeDays = options.hideOutOfRangeDays ?? true;
|
|
5921
6046
|
const entries = series.map((point) => ({
|
|
5922
6047
|
date: toDate(point),
|
|
5923
6048
|
value: point.value
|
|
@@ -5936,22 +6061,31 @@ const buildCalendarHeatmapData = (series, options = {}) => {
|
|
|
5936
6061
|
}
|
|
5937
6062
|
const gridStart = startOfWeek(minDate, { weekStartsOn });
|
|
5938
6063
|
const weekCount = differenceInCalendarWeeks(maxDate, gridStart, { weekStartsOn }) + 1;
|
|
6064
|
+
const minDayKey = format(minDate, "yyyy-MM-dd");
|
|
6065
|
+
const maxDayKey = format(maxDate, "yyyy-MM-dd");
|
|
5939
6066
|
const rowLabels = Array.from({ length: 7 }, (_, row) => LABELLED_ROWS.includes(row) ? format(addDays(gridStart, row), "EEE") : "");
|
|
6067
|
+
const MIN_FIRST_MONTH_WEEKS = 2;
|
|
6068
|
+
const firstMonth = gridStart.getMonth();
|
|
6069
|
+
let firstMonthWeeks = 0;
|
|
6070
|
+
while (firstMonthWeeks < weekCount && addDays(gridStart, firstMonthWeeks * 7).getMonth() === firstMonth) firstMonthWeeks++;
|
|
6071
|
+
const showFirstMonthLabel = !(firstMonthWeeks < weekCount) || firstMonthWeeks >= MIN_FIRST_MONTH_WEEKS;
|
|
5940
6072
|
const data = [];
|
|
5941
6073
|
let previousMonth = -1;
|
|
5942
6074
|
for (let week = 0; week < weekCount; week++) {
|
|
5943
6075
|
const columnStart = addDays(gridStart, week * 7);
|
|
5944
6076
|
const month = columnStart.getMonth();
|
|
5945
|
-
const label = month !== previousMonth ? format(columnStart, "MMM") : "";
|
|
6077
|
+
const label = month !== previousMonth && (week !== 0 || showFirstMonthLabel) ? format(columnStart, "MMM") : "";
|
|
5946
6078
|
previousMonth = month;
|
|
5947
6079
|
const cells = [];
|
|
5948
6080
|
for (let row = 0; row < 7; row++) {
|
|
5949
6081
|
const day = addDays(gridStart, week * 7 + row);
|
|
5950
6082
|
const key = format(day, "yyyy-MM-dd");
|
|
5951
|
-
|
|
6083
|
+
const cell = {
|
|
5952
6084
|
label: format(day, "EEE, MMM d, yyyy"),
|
|
5953
6085
|
value: valueByDay.has(key) ? valueByDay.get(key) : null
|
|
5954
|
-
}
|
|
6086
|
+
};
|
|
6087
|
+
if (hideOutOfRangeDays && (key < minDayKey || key > maxDayKey)) cell.hidden = true;
|
|
6088
|
+
cells.push(cell);
|
|
5955
6089
|
}
|
|
5956
6090
|
data.push({
|
|
5957
6091
|
label,
|
|
@@ -5964,10 +6098,14 @@ const buildCalendarHeatmapData = (series, options = {}) => {
|
|
|
5964
6098
|
};
|
|
5965
6099
|
};
|
|
5966
6100
|
//#endregion
|
|
6101
|
+
//#region src/charts/heatmap-chart/private/heatmap-context.ts
|
|
6102
|
+
/** Shared by the chart and legend without importing back from `heatmap-chart.tsx`. */
|
|
6103
|
+
const HeatmapContext = createContext(null);
|
|
6104
|
+
//#endregion
|
|
5967
6105
|
//#region src/charts/heatmap-chart/private/heatmap-legend.tsx
|
|
5968
6106
|
const HeatmapLegend = ({ steps = 5, lessLabel, moreLabel }) => {
|
|
5969
6107
|
const context = useContext(HeatmapContext);
|
|
5970
|
-
const { legend } = useGlobalChartsTheme();
|
|
6108
|
+
const { legend, backgroundColor } = useGlobalChartsTheme();
|
|
5971
6109
|
if (!context) return null;
|
|
5972
6110
|
const { primaryColorHex } = context;
|
|
5973
6111
|
const labelStyle = legend.labelStyles;
|
|
@@ -5991,6 +6129,7 @@ const HeatmapLegend = ({ steps = 5, lessLabel, moreLabel }) => {
|
|
|
5991
6129
|
className: heatmap_chart_module_default["heatmap-chart__legend-swatch"],
|
|
5992
6130
|
style: {
|
|
5993
6131
|
"--heatmap-primary": primaryColorHex,
|
|
6132
|
+
"--heatmap-bg": backgroundColor,
|
|
5994
6133
|
"--intensity": intensity
|
|
5995
6134
|
}
|
|
5996
6135
|
}, index);
|
|
@@ -6006,11 +6145,10 @@ const HeatmapLegend = ({ steps = 5, lessLabel, moreLabel }) => {
|
|
|
6006
6145
|
};
|
|
6007
6146
|
//#endregion
|
|
6008
6147
|
//#region src/charts/heatmap-chart/heatmap-chart.tsx
|
|
6009
|
-
const HeatmapContext = createContext(null);
|
|
6010
6148
|
const CELL_MIX_FLOOR = .15;
|
|
6011
|
-
const HeatmapChartInternal = ({ data, chartId: providedChartId, width = 0, height = 0, className, compact = false, showValues, rowLabels = [], primaryColor, gap = "md", withTooltips = false, renderTooltip, children }) => {
|
|
6149
|
+
const HeatmapChartInternal = ({ data, chartId: providedChartId, width = 0, height = 0, className, compact = false, showValues, maxCellWidth, maxCellHeight, minCellWidth, minCellHeight, rowLabels = [], primaryColor, gap = "md", withTooltips = false, renderTooltip, children }) => {
|
|
6012
6150
|
const chartId = useChartId(providedChartId);
|
|
6013
|
-
const { getElementStyles, theme } = useGlobalChartsContext();
|
|
6151
|
+
const { getElementStyles, resolveThemeColor, theme } = useGlobalChartsContext();
|
|
6014
6152
|
const { heatmapChart: heatmapChartSettings } = theme;
|
|
6015
6153
|
const { nonLegendChildren } = useChartChildren(children, "HeatmapChart");
|
|
6016
6154
|
const [selectedIndex, setSelectedIndex] = useState();
|
|
@@ -6025,8 +6163,9 @@ const HeatmapChartInternal = ({ data, chartId: providedChartId, width = 0, heigh
|
|
|
6025
6163
|
index: 0,
|
|
6026
6164
|
overrideColor: primaryColor || heatmapChartSettings.primaryColor
|
|
6027
6165
|
});
|
|
6166
|
+
const chartBackgroundHex = resolveThemeColor(theme.backgroundColor);
|
|
6028
6167
|
const primaryHex = normalizeColorToHex(primaryColorHex);
|
|
6029
|
-
const cellHasLightText = (intensity) => isValidHexColor(primaryHex) && prefersLightText(
|
|
6168
|
+
const cellHasLightText = (intensity) => isValidHexColor(primaryHex) && isValidHexColor(chartBackgroundHex) && prefersLightText(mixHexColors(primaryHex, chartBackgroundHex, 1 - (CELL_MIX_FLOOR + (1 - CELL_MIX_FLOOR) * intensity)));
|
|
6030
6169
|
const extent = useMemo(() => getValueExtent(data), [data]);
|
|
6031
6170
|
const heatmapContext = useMemo(() => ({
|
|
6032
6171
|
extent,
|
|
@@ -6051,6 +6190,7 @@ const HeatmapChartInternal = ({ data, chartId: providedChartId, width = 0, heigh
|
|
|
6051
6190
|
setSelectedIndex(void 0);
|
|
6052
6191
|
hideTooltip();
|
|
6053
6192
|
}, [hideTooltip]);
|
|
6193
|
+
const isCellHidden = useCallback((col, row) => data[col]?.data[row]?.hidden === true, [data]);
|
|
6054
6194
|
const onChartKeyDown = useCallback((event) => {
|
|
6055
6195
|
if (![
|
|
6056
6196
|
"ArrowLeft",
|
|
@@ -6067,21 +6207,32 @@ const HeatmapChartInternal = ({ data, chartId: providedChartId, width = 0, heigh
|
|
|
6067
6207
|
}
|
|
6068
6208
|
event.preventDefault();
|
|
6069
6209
|
if (selectedIndex === void 0) {
|
|
6070
|
-
|
|
6210
|
+
for (let index = 0; index < columns * rows; index++) if (!isCellHidden(Math.floor(index / rows), index % rows)) {
|
|
6211
|
+
setSelectedIndex(index);
|
|
6212
|
+
return;
|
|
6213
|
+
}
|
|
6071
6214
|
return;
|
|
6072
6215
|
}
|
|
6216
|
+
let stepCol = 0;
|
|
6217
|
+
let stepRow = 0;
|
|
6218
|
+
if (event.key === "ArrowRight") stepCol = 1;
|
|
6219
|
+
else if (event.key === "ArrowLeft") stepCol = -1;
|
|
6220
|
+
else if (event.key === "ArrowDown") stepRow = 1;
|
|
6221
|
+
else if (event.key === "ArrowUp") stepRow = -1;
|
|
6073
6222
|
let col = Math.floor(selectedIndex / rows);
|
|
6074
6223
|
let row = selectedIndex % rows;
|
|
6075
|
-
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6224
|
+
do {
|
|
6225
|
+
col += stepCol;
|
|
6226
|
+
row += stepRow;
|
|
6227
|
+
} while (col >= 0 && col < columns && row >= 0 && row < rows && isCellHidden(col, row));
|
|
6228
|
+
if (col < 0 || col >= columns || row < 0 || row >= rows) return;
|
|
6079
6229
|
setSelectedIndex(col * rows + row);
|
|
6080
6230
|
}, [
|
|
6081
6231
|
rows,
|
|
6082
6232
|
columns,
|
|
6083
6233
|
selectedIndex,
|
|
6084
|
-
hideTooltip
|
|
6234
|
+
hideTooltip,
|
|
6235
|
+
isCellHidden
|
|
6085
6236
|
]);
|
|
6086
6237
|
const handleCellMouseMove = useCallback((event) => {
|
|
6087
6238
|
if (!withTooltips) return;
|
|
@@ -6137,17 +6288,20 @@ const HeatmapChartInternal = ({ data, chartId: providedChartId, width = 0, heigh
|
|
|
6137
6288
|
children: __("No data available", "jetpack-charts")
|
|
6138
6289
|
})
|
|
6139
6290
|
});
|
|
6140
|
-
const
|
|
6291
|
+
const columnTrack = compact ? "var(--heatmap-cell-size)" : `minmax(${minCellWidth ?? 0}px, ${maxCellWidth ? `${maxCellWidth}px` : "1fr"})`;
|
|
6292
|
+
const rowTrack = compact ? "var(--heatmap-cell-size)" : `minmax(${minCellHeight ?? 0}px, ${maxCellHeight ? `${maxCellHeight}px` : "1fr"})`;
|
|
6141
6293
|
const gridStyle = {
|
|
6142
6294
|
"--heatmap-primary": primaryColorHex,
|
|
6143
|
-
|
|
6144
|
-
|
|
6295
|
+
"--heatmap-bg": theme.backgroundColor,
|
|
6296
|
+
gridTemplateColumns: `auto repeat(${columns}, ${columnTrack})`,
|
|
6297
|
+
gridTemplateRows: `auto repeat(${rows}, ${rowTrack})`
|
|
6145
6298
|
};
|
|
6146
6299
|
if (compact) {
|
|
6147
6300
|
gridStyle["--heatmap-cell-gap"] = `${compactCellGap}px`;
|
|
6148
6301
|
gridStyle["--heatmap-cell-size"] = `${compactCellSize}px`;
|
|
6149
6302
|
}
|
|
6150
6303
|
const activeDescendant = selectedIndex !== void 0 ? `${chartId}-cell-${Math.floor(selectedIndex / rows)}-${selectedIndex % rows}` : void 0;
|
|
6304
|
+
const heightCapped = !compact && Boolean(maxCellHeight);
|
|
6151
6305
|
return /* @__PURE__ */ jsx(HeatmapContext.Provider, {
|
|
6152
6306
|
value: heatmapContext,
|
|
6153
6307
|
children: /* @__PURE__ */ jsx(SingleChartContext.Provider, {
|
|
@@ -6157,7 +6311,7 @@ const HeatmapChartInternal = ({ data, chartId: providedChartId, width = 0, heigh
|
|
|
6157
6311
|
legendChildren: [],
|
|
6158
6312
|
trailingContent: nonLegendChildren,
|
|
6159
6313
|
gap,
|
|
6160
|
-
className: clsx("heatmap-chart", heatmap_chart_module_default["heatmap-chart"], className),
|
|
6314
|
+
className: clsx("heatmap-chart", heatmap_chart_module_default["heatmap-chart"], className, { [heatmap_chart_module_default["heatmap-chart--height-capped"]]: heightCapped }),
|
|
6161
6315
|
style: {
|
|
6162
6316
|
width: width || void 0,
|
|
6163
6317
|
height: height || void 0
|
|
@@ -6173,57 +6327,65 @@ const HeatmapChartInternal = ({ data, chartId: providedChartId, width = 0, heigh
|
|
|
6173
6327
|
tabIndex: 0,
|
|
6174
6328
|
onBlur: onChartBlur,
|
|
6175
6329
|
onKeyDown: onChartKeyDown,
|
|
6176
|
-
className: clsx(heatmap_chart_module_default["heatmap-chart__grid"], {
|
|
6330
|
+
className: clsx(heatmap_chart_module_default["heatmap-chart__grid"], {
|
|
6331
|
+
[heatmap_chart_module_default["heatmap-chart__grid--compact"]]: compact,
|
|
6332
|
+
[heatmap_chart_module_default["heatmap-chart__grid--height-capped"]]: heightCapped
|
|
6333
|
+
}),
|
|
6177
6334
|
style: gridStyle,
|
|
6178
|
-
children: [
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
|
|
6335
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
6336
|
+
role: "row",
|
|
6337
|
+
"aria-hidden": "true",
|
|
6338
|
+
className: heatmap_chart_module_default["heatmap-chart__row"],
|
|
6339
|
+
children: [/* @__PURE__ */ jsx("span", {}), data.map((column, columnIndex) => /* @__PURE__ */ jsx("span", {
|
|
6182
6340
|
className: heatmap_chart_module_default["heatmap-chart__col-label"],
|
|
6183
6341
|
children: column.label
|
|
6184
|
-
}, `col-${columnIndex}`))
|
|
6185
|
-
|
|
6186
|
-
|
|
6187
|
-
|
|
6188
|
-
|
|
6189
|
-
|
|
6190
|
-
|
|
6191
|
-
|
|
6342
|
+
}, `col-${columnIndex}`))]
|
|
6343
|
+
}), Array.from({ length: rows }).map((_row, rowIndex) => {
|
|
6344
|
+
const labelVisible = !compact || rowIndex % 2 === 0;
|
|
6345
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
6346
|
+
role: "row",
|
|
6347
|
+
"aria-rowindex": rowIndex + 1,
|
|
6348
|
+
className: heatmap_chart_module_default["heatmap-chart__row"],
|
|
6349
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
6350
|
+
"aria-hidden": "true",
|
|
6351
|
+
className: heatmap_chart_module_default["heatmap-chart__row-label"],
|
|
6352
|
+
children: labelVisible ? rowLabels[rowIndex] ?? "" : ""
|
|
6353
|
+
}), data.map((column, columnIndex) => {
|
|
6354
|
+
const cell = column.data[rowIndex];
|
|
6355
|
+
if (cell?.hidden) return /* @__PURE__ */ jsx("div", {
|
|
6192
6356
|
"aria-hidden": "true",
|
|
6193
|
-
className: heatmap_chart_module_default["heatmap-
|
|
6194
|
-
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
|
|
6204
|
-
|
|
6205
|
-
|
|
6206
|
-
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
-
|
|
6224
|
-
|
|
6225
|
-
})
|
|
6226
|
-
]
|
|
6357
|
+
className: clsx(heatmap_chart_module_default["heatmap-chart__cell"], heatmap_chart_module_default["heatmap-chart__cell--hidden"])
|
|
6358
|
+
}, `cell-${columnIndex}-${rowIndex}`);
|
|
6359
|
+
const value = cell?.value ?? null;
|
|
6360
|
+
const present = isPresent(value);
|
|
6361
|
+
const normalized = present ? getNormalizedValue(value, extent) : 0;
|
|
6362
|
+
const flatIndex = columnIndex * rows + rowIndex;
|
|
6363
|
+
const info = buildTooltipData(columnIndex, rowIndex);
|
|
6364
|
+
const accessibleLabel = `${info.cellLabel || `${info.columnLabel ?? ""} ${info.rowLabel ?? ""}`.trim()}: ${info.value === null ? __("No data", "jetpack-charts") : formatNumber(info.value)}`;
|
|
6365
|
+
return /* @__PURE__ */ jsx("div", {
|
|
6366
|
+
id: `${chartId}-cell-${columnIndex}-${rowIndex}`,
|
|
6367
|
+
role: "gridcell",
|
|
6368
|
+
tabIndex: -1,
|
|
6369
|
+
"aria-colindex": columnIndex + 1,
|
|
6370
|
+
"aria-label": accessibleLabel,
|
|
6371
|
+
"data-column": columnIndex,
|
|
6372
|
+
"data-row": rowIndex,
|
|
6373
|
+
className: clsx(heatmap_chart_module_default["heatmap-chart__cell"], {
|
|
6374
|
+
[heatmap_chart_module_default["heatmap-chart__cell--filled"]]: present,
|
|
6375
|
+
[heatmap_chart_module_default["heatmap-chart__cell--strong"]]: present && cellHasLightText(normalized),
|
|
6376
|
+
[heatmap_chart_module_default["heatmap-chart__cell--selected"]]: selectedIndex === flatIndex
|
|
6377
|
+
}),
|
|
6378
|
+
style: present ? { "--intensity": normalized } : void 0,
|
|
6379
|
+
onMouseMove: handleCellMouseMove,
|
|
6380
|
+
onMouseLeave: handleCellMouseLeave,
|
|
6381
|
+
children: drawValues && present && /* @__PURE__ */ jsx("span", {
|
|
6382
|
+
className: heatmap_chart_module_default["heatmap-chart__cell-value"],
|
|
6383
|
+
children: formatNumberCompact(value)
|
|
6384
|
+
})
|
|
6385
|
+
}, `cell-${columnIndex}-${rowIndex}`);
|
|
6386
|
+
})]
|
|
6387
|
+
}, `row-${rowIndex}`);
|
|
6388
|
+
})]
|
|
6227
6389
|
}), withTooltips && tooltipOpen && tooltipData && /* @__PURE__ */ jsx(TooltipInPortal, {
|
|
6228
6390
|
top: tooltipTop,
|
|
6229
6391
|
left: tooltipLeft,
|
|
@@ -6251,318 +6413,32 @@ const HeatmapChartResponsiveInner = (props) => /* @__PURE__ */ jsx(HeatmapChartW
|
|
|
6251
6413
|
HeatmapChartResponsiveInner.displayName = "HeatmapChart";
|
|
6252
6414
|
const HeatmapChartResponsive = attachSubComponents(withResponsive(HeatmapChartResponsiveInner), { Legend: HeatmapLegend });
|
|
6253
6415
|
//#endregion
|
|
6254
|
-
//#region ../../../node_modules/.pnpm/@wordpress+
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
|
|
6259
|
-
|
|
6260
|
-
}
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
console.warn(message);
|
|
6265
|
-
try {
|
|
6266
|
-
throw Error(message);
|
|
6267
|
-
} catch {}
|
|
6268
|
-
logged.add(message);
|
|
6416
|
+
//#region ../../../node_modules/.pnpm/@wordpress+components@37.0.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/utils/hooks/use-update-effect.mjs
|
|
6417
|
+
function useUpdateEffect(effect, deps) {
|
|
6418
|
+
const mountedRef = useRef$1(false);
|
|
6419
|
+
useEffect$1(() => {
|
|
6420
|
+
if (mountedRef.current) return effect();
|
|
6421
|
+
mountedRef.current = true;
|
|
6422
|
+
}, deps);
|
|
6423
|
+
useEffect$1(() => () => {
|
|
6424
|
+
mountedRef.current = false;
|
|
6425
|
+
}, []);
|
|
6269
6426
|
}
|
|
6427
|
+
var use_update_effect_default = useUpdateEffect;
|
|
6270
6428
|
//#endregion
|
|
6271
|
-
//#region ../../../node_modules/.pnpm/@
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
//#region ../../../node_modules/.pnpm/lower-case@2.0.2/node_modules/lower-case/dist.es2015/index.js
|
|
6277
|
-
/**
|
|
6278
|
-
* Lower case as a function.
|
|
6279
|
-
*/
|
|
6280
|
-
function lowerCase(str) {
|
|
6281
|
-
return str.toLowerCase();
|
|
6429
|
+
//#region ../../../node_modules/.pnpm/@emotion+sheet@1.4.0/node_modules/@emotion/sheet/dist/emotion-sheet.esm.js
|
|
6430
|
+
function sheetForTag(tag) {
|
|
6431
|
+
if (tag.sheet) return tag.sheet;
|
|
6432
|
+
/* istanbul ignore next */
|
|
6433
|
+
for (var i = 0; i < document.styleSheets.length; i++) if (document.styleSheets[i].ownerNode === tag) return document.styleSheets[i];
|
|
6282
6434
|
}
|
|
6283
|
-
|
|
6284
|
-
|
|
6285
|
-
|
|
6286
|
-
|
|
6287
|
-
|
|
6288
|
-
|
|
6289
|
-
|
|
6290
|
-
function noCase(input, options) {
|
|
6291
|
-
if (options === void 0) options = {};
|
|
6292
|
-
var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d;
|
|
6293
|
-
var result = replace$1(replace$1(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
|
|
6294
|
-
var start = 0;
|
|
6295
|
-
var end = result.length;
|
|
6296
|
-
while (result.charAt(start) === "\0") start++;
|
|
6297
|
-
while (result.charAt(end - 1) === "\0") end--;
|
|
6298
|
-
return result.slice(start, end).split("\0").map(transform).join(delimiter);
|
|
6299
|
-
}
|
|
6300
|
-
/**
|
|
6301
|
-
* Replace `re` in the input string with the replacement value.
|
|
6302
|
-
*/
|
|
6303
|
-
function replace$1(input, re, value) {
|
|
6304
|
-
if (re instanceof RegExp) return input.replace(re, value);
|
|
6305
|
-
return re.reduce(function(input, re) {
|
|
6306
|
-
return input.replace(re, value);
|
|
6307
|
-
}, input);
|
|
6308
|
-
}
|
|
6309
|
-
//#endregion
|
|
6310
|
-
//#region ../../../node_modules/.pnpm/dot-case@3.0.4/node_modules/dot-case/dist.es2015/index.js
|
|
6311
|
-
function dotCase(input, options) {
|
|
6312
|
-
if (options === void 0) options = {};
|
|
6313
|
-
return noCase(input, __assign({ delimiter: "." }, options));
|
|
6314
|
-
}
|
|
6315
|
-
//#endregion
|
|
6316
|
-
//#region ../../../node_modules/.pnpm/param-case@3.0.4/node_modules/param-case/dist.es2015/index.js
|
|
6317
|
-
function paramCase(input, options) {
|
|
6318
|
-
if (options === void 0) options = {};
|
|
6319
|
-
return dotCase(input, __assign({ delimiter: "-" }, options));
|
|
6320
|
-
}
|
|
6321
|
-
//#endregion
|
|
6322
|
-
//#region ../../../node_modules/.pnpm/memize@2.1.1/node_modules/memize/dist/index.js
|
|
6323
|
-
/**
|
|
6324
|
-
* Memize options object.
|
|
6325
|
-
*
|
|
6326
|
-
* @typedef MemizeOptions
|
|
6327
|
-
*
|
|
6328
|
-
* @property {number} [maxSize] Maximum size of the cache.
|
|
6329
|
-
*/
|
|
6330
|
-
/**
|
|
6331
|
-
* Internal cache entry.
|
|
6332
|
-
*
|
|
6333
|
-
* @typedef MemizeCacheNode
|
|
6334
|
-
*
|
|
6335
|
-
* @property {?MemizeCacheNode|undefined} [prev] Previous node.
|
|
6336
|
-
* @property {?MemizeCacheNode|undefined} [next] Next node.
|
|
6337
|
-
* @property {Array<*>} args Function arguments for cache
|
|
6338
|
-
* entry.
|
|
6339
|
-
* @property {*} val Function result.
|
|
6340
|
-
*/
|
|
6341
|
-
/**
|
|
6342
|
-
* Properties of the enhanced function for controlling cache.
|
|
6343
|
-
*
|
|
6344
|
-
* @typedef MemizeMemoizedFunction
|
|
6345
|
-
*
|
|
6346
|
-
* @property {()=>void} clear Clear the cache.
|
|
6347
|
-
*/
|
|
6348
|
-
/**
|
|
6349
|
-
* Accepts a function to be memoized, and returns a new memoized function, with
|
|
6350
|
-
* optional options.
|
|
6351
|
-
*
|
|
6352
|
-
* @template {(...args: any[]) => any} F
|
|
6353
|
-
*
|
|
6354
|
-
* @param {F} fn Function to memoize.
|
|
6355
|
-
* @param {MemizeOptions} [options] Options object.
|
|
6356
|
-
*
|
|
6357
|
-
* @return {((...args: Parameters<F>) => ReturnType<F>) & MemizeMemoizedFunction} Memoized function.
|
|
6358
|
-
*/
|
|
6359
|
-
function memize(fn, options) {
|
|
6360
|
-
var size = 0;
|
|
6361
|
-
/** @type {?MemizeCacheNode|undefined} */
|
|
6362
|
-
var head;
|
|
6363
|
-
/** @type {?MemizeCacheNode|undefined} */
|
|
6364
|
-
var tail;
|
|
6365
|
-
options = options || {};
|
|
6366
|
-
function memoized() {
|
|
6367
|
-
var node = head, len = arguments.length, args, i;
|
|
6368
|
-
searchCache: while (node) {
|
|
6369
|
-
if (node.args.length !== arguments.length) {
|
|
6370
|
-
node = node.next;
|
|
6371
|
-
continue;
|
|
6372
|
-
}
|
|
6373
|
-
for (i = 0; i < len; i++) if (node.args[i] !== arguments[i]) {
|
|
6374
|
-
node = node.next;
|
|
6375
|
-
continue searchCache;
|
|
6376
|
-
}
|
|
6377
|
-
if (node !== head) {
|
|
6378
|
-
if (node === tail) tail = node.prev;
|
|
6379
|
-
/** @type {MemizeCacheNode} */ node.prev.next = node.next;
|
|
6380
|
-
if (node.next) node.next.prev = node.prev;
|
|
6381
|
-
node.next = head;
|
|
6382
|
-
node.prev = null;
|
|
6383
|
-
/** @type {MemizeCacheNode} */ head.prev = node;
|
|
6384
|
-
head = node;
|
|
6385
|
-
}
|
|
6386
|
-
return node.val;
|
|
6387
|
-
}
|
|
6388
|
-
args = new Array(len);
|
|
6389
|
-
for (i = 0; i < len; i++) args[i] = arguments[i];
|
|
6390
|
-
node = {
|
|
6391
|
-
args,
|
|
6392
|
-
val: fn.apply(null, args)
|
|
6393
|
-
};
|
|
6394
|
-
if (head) {
|
|
6395
|
-
head.prev = node;
|
|
6396
|
-
node.next = head;
|
|
6397
|
-
} else tail = node;
|
|
6398
|
-
if (size === options.maxSize) {
|
|
6399
|
-
tail = tail.prev;
|
|
6400
|
-
/** @type {MemizeCacheNode} */ tail.next = null;
|
|
6401
|
-
} else size++;
|
|
6402
|
-
head = node;
|
|
6403
|
-
return node.val;
|
|
6404
|
-
}
|
|
6405
|
-
memoized.clear = function() {
|
|
6406
|
-
head = null;
|
|
6407
|
-
tail = null;
|
|
6408
|
-
size = 0;
|
|
6409
|
-
};
|
|
6410
|
-
return memoized;
|
|
6411
|
-
}
|
|
6412
|
-
//#endregion
|
|
6413
|
-
//#region ../../../node_modules/.pnpm/@wordpress+components@36.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/context/get-styled-class-name-from-key.mjs
|
|
6414
|
-
function getStyledClassName(namespace) {
|
|
6415
|
-
return `components-${paramCase(namespace)}`;
|
|
6416
|
-
}
|
|
6417
|
-
var getStyledClassNameFromKey = memize(getStyledClassName);
|
|
6418
|
-
//#endregion
|
|
6419
|
-
//#region ../../../node_modules/.pnpm/@wordpress+components@36.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/context/context-connect.mjs
|
|
6420
|
-
function contextConnect(Component, namespace) {
|
|
6421
|
-
return _contextConnect(Component, namespace, { forwardsRef: true });
|
|
6422
|
-
}
|
|
6423
|
-
function _contextConnect(Component, namespace, options) {
|
|
6424
|
-
const WrappedComponent = options?.forwardsRef ? forwardRef$1(Component) : Component;
|
|
6425
|
-
if (typeof namespace === "undefined") globalThis.SCRIPT_DEBUG === true && warning("contextConnect: Please provide a namespace");
|
|
6426
|
-
let mergedNamespace = WrappedComponent["__contextSystemKey__"] || [namespace];
|
|
6427
|
-
if (Array.isArray(namespace)) mergedNamespace = [...mergedNamespace, ...namespace];
|
|
6428
|
-
if (typeof namespace === "string") mergedNamespace = [...mergedNamespace, namespace];
|
|
6429
|
-
return Object.assign(WrappedComponent, {
|
|
6430
|
-
[CONNECT_STATIC_NAMESPACE]: [...new Set(mergedNamespace)],
|
|
6431
|
-
displayName: namespace,
|
|
6432
|
-
selector: `.${getStyledClassNameFromKey(namespace)}`
|
|
6433
|
-
});
|
|
6434
|
-
}
|
|
6435
|
-
//#endregion
|
|
6436
|
-
//#region ../../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/es6/index.js
|
|
6437
|
-
var require_es6 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
6438
|
-
module.exports = function equal(a, b) {
|
|
6439
|
-
if (a === b) return true;
|
|
6440
|
-
if (a && b && typeof a == "object" && typeof b == "object") {
|
|
6441
|
-
if (a.constructor !== b.constructor) return false;
|
|
6442
|
-
var length, i, keys;
|
|
6443
|
-
if (Array.isArray(a)) {
|
|
6444
|
-
length = a.length;
|
|
6445
|
-
if (length != b.length) return false;
|
|
6446
|
-
for (i = length; i-- !== 0;) if (!equal(a[i], b[i])) return false;
|
|
6447
|
-
return true;
|
|
6448
|
-
}
|
|
6449
|
-
if (a instanceof Map && b instanceof Map) {
|
|
6450
|
-
if (a.size !== b.size) return false;
|
|
6451
|
-
for (i of a.entries()) if (!b.has(i[0])) return false;
|
|
6452
|
-
for (i of a.entries()) if (!equal(i[1], b.get(i[0]))) return false;
|
|
6453
|
-
return true;
|
|
6454
|
-
}
|
|
6455
|
-
if (a instanceof Set && b instanceof Set) {
|
|
6456
|
-
if (a.size !== b.size) return false;
|
|
6457
|
-
for (i of a.entries()) if (!b.has(i[0])) return false;
|
|
6458
|
-
return true;
|
|
6459
|
-
}
|
|
6460
|
-
if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
|
|
6461
|
-
length = a.length;
|
|
6462
|
-
if (length != b.length) return false;
|
|
6463
|
-
for (i = length; i-- !== 0;) if (a[i] !== b[i]) return false;
|
|
6464
|
-
return true;
|
|
6465
|
-
}
|
|
6466
|
-
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
|
|
6467
|
-
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
|
|
6468
|
-
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
|
|
6469
|
-
keys = Object.keys(a);
|
|
6470
|
-
length = keys.length;
|
|
6471
|
-
if (length !== Object.keys(b).length) return false;
|
|
6472
|
-
for (i = length; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
|
|
6473
|
-
for (i = length; i-- !== 0;) {
|
|
6474
|
-
var key = keys[i];
|
|
6475
|
-
if (!equal(a[key], b[key])) return false;
|
|
6476
|
-
}
|
|
6477
|
-
return true;
|
|
6478
|
-
}
|
|
6479
|
-
return a !== a && b !== b;
|
|
6480
|
-
};
|
|
6481
|
-
}));
|
|
6482
|
-
//#endregion
|
|
6483
|
-
//#region ../../../node_modules/.pnpm/is-plain-object@5.0.0/node_modules/is-plain-object/dist/is-plain-object.mjs
|
|
6484
|
-
/*!
|
|
6485
|
-
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
6486
|
-
*
|
|
6487
|
-
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
6488
|
-
* Released under the MIT License.
|
|
6489
|
-
*/
|
|
6490
|
-
function isObject(o) {
|
|
6491
|
-
return Object.prototype.toString.call(o) === "[object Object]";
|
|
6492
|
-
}
|
|
6493
|
-
function isPlainObject(o) {
|
|
6494
|
-
var ctor, prot;
|
|
6495
|
-
if (isObject(o) === false) return false;
|
|
6496
|
-
ctor = o.constructor;
|
|
6497
|
-
if (ctor === void 0) return true;
|
|
6498
|
-
prot = ctor.prototype;
|
|
6499
|
-
if (isObject(prot) === false) return false;
|
|
6500
|
-
if (prot.hasOwnProperty("isPrototypeOf") === false) return false;
|
|
6501
|
-
return true;
|
|
6502
|
-
}
|
|
6503
|
-
//#endregion
|
|
6504
|
-
//#region ../../../node_modules/.pnpm/@wordpress+components@36.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/utils/hooks/use-update-effect.mjs
|
|
6505
|
-
function useUpdateEffect(effect, deps) {
|
|
6506
|
-
const mountedRef = useRef$1(false);
|
|
6507
|
-
useEffect$1(() => {
|
|
6508
|
-
if (mountedRef.current) return effect();
|
|
6509
|
-
mountedRef.current = true;
|
|
6510
|
-
}, deps);
|
|
6511
|
-
useEffect$1(() => () => {
|
|
6512
|
-
mountedRef.current = false;
|
|
6513
|
-
}, []);
|
|
6514
|
-
}
|
|
6515
|
-
var use_update_effect_default = useUpdateEffect;
|
|
6516
|
-
//#endregion
|
|
6517
|
-
//#region ../../../node_modules/.pnpm/@wordpress+components@36.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/context/context-system-provider.mjs
|
|
6518
|
-
var import_es6 = /* @__PURE__ */ __toESM(require_es6(), 1);
|
|
6519
|
-
var ComponentsContext = createContext$1(
|
|
6520
|
-
/** @type {Record<string, any>} */
|
|
6521
|
-
{}
|
|
6522
|
-
);
|
|
6523
|
-
ComponentsContext.displayName = "ComponentsContext";
|
|
6524
|
-
var useComponentsContext = () => useContext$1(ComponentsContext);
|
|
6525
|
-
function useContextSystemBridge({ value }) {
|
|
6526
|
-
const parentContext = useComponentsContext();
|
|
6527
|
-
const valueRef = useRef$1(value);
|
|
6528
|
-
use_update_effect_default(() => {
|
|
6529
|
-
if ((0, import_es6.default)(valueRef.current, value) && valueRef.current !== value) globalThis.SCRIPT_DEBUG === true && warning(`Please memoize your context: ${JSON.stringify(value)}`);
|
|
6530
|
-
}, [value]);
|
|
6531
|
-
return useMemo$1(() => {
|
|
6532
|
-
return deepmerge(parentContext ?? {}, value ?? {}, { isMergeableObject: isPlainObject });
|
|
6533
|
-
}, [parentContext, value]);
|
|
6534
|
-
}
|
|
6535
|
-
var BaseContextSystemProvider = ({ children, value }) => {
|
|
6536
|
-
const contextValue = useContextSystemBridge({ value });
|
|
6537
|
-
return /* @__PURE__ */ jsx(ComponentsContext.Provider, {
|
|
6538
|
-
value: contextValue,
|
|
6539
|
-
children
|
|
6540
|
-
});
|
|
6541
|
-
};
|
|
6542
|
-
memo(BaseContextSystemProvider);
|
|
6543
|
-
//#endregion
|
|
6544
|
-
//#region ../../../node_modules/.pnpm/@wordpress+components@36.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/context/utils.mjs
|
|
6545
|
-
function getNamespace(componentName) {
|
|
6546
|
-
return { [COMPONENT_NAMESPACE]: componentName };
|
|
6547
|
-
}
|
|
6548
|
-
function getConnectedNamespace() {
|
|
6549
|
-
return { [CONNECTED_NAMESPACE]: true };
|
|
6550
|
-
}
|
|
6551
|
-
//#endregion
|
|
6552
|
-
//#region ../../../node_modules/.pnpm/@emotion+sheet@1.4.0/node_modules/@emotion/sheet/dist/emotion-sheet.esm.js
|
|
6553
|
-
var isDevelopment$3 = false;
|
|
6554
|
-
function sheetForTag(tag) {
|
|
6555
|
-
if (tag.sheet) return tag.sheet;
|
|
6556
|
-
/* istanbul ignore next */
|
|
6557
|
-
for (var i = 0; i < document.styleSheets.length; i++) if (document.styleSheets[i].ownerNode === tag) return document.styleSheets[i];
|
|
6558
|
-
}
|
|
6559
|
-
function createStyleElement(options) {
|
|
6560
|
-
var tag = document.createElement("style");
|
|
6561
|
-
tag.setAttribute("data-emotion", options.key);
|
|
6562
|
-
if (options.nonce !== void 0) tag.setAttribute("nonce", options.nonce);
|
|
6563
|
-
tag.appendChild(document.createTextNode(""));
|
|
6564
|
-
tag.setAttribute("data-s", "");
|
|
6565
|
-
return tag;
|
|
6435
|
+
function createStyleElement(options) {
|
|
6436
|
+
var tag = document.createElement("style");
|
|
6437
|
+
tag.setAttribute("data-emotion", options.key);
|
|
6438
|
+
if (options.nonce !== void 0) tag.setAttribute("nonce", options.nonce);
|
|
6439
|
+
tag.appendChild(document.createTextNode(""));
|
|
6440
|
+
tag.setAttribute("data-s", "");
|
|
6441
|
+
return tag;
|
|
6566
6442
|
}
|
|
6567
6443
|
var StyleSheet = /*#__PURE__*/ function() {
|
|
6568
6444
|
function StyleSheet(options) {
|
|
@@ -6576,7 +6452,7 @@ var StyleSheet = /*#__PURE__*/ function() {
|
|
|
6576
6452
|
_this.container.insertBefore(tag, before);
|
|
6577
6453
|
_this.tags.push(tag);
|
|
6578
6454
|
};
|
|
6579
|
-
this.isSpeedy = options.speedy === void 0 ?
|
|
6455
|
+
this.isSpeedy = options.speedy === void 0 ? true : options.speedy;
|
|
6580
6456
|
this.tags = [];
|
|
6581
6457
|
this.ctr = 0;
|
|
6582
6458
|
this.nonce = options.nonce;
|
|
@@ -7372,7 +7248,25 @@ var createCache = function createCache(options) {
|
|
|
7372
7248
|
* LICENSE file in the root directory of this source tree.
|
|
7373
7249
|
*/
|
|
7374
7250
|
var require_react_is_production_min = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
7375
|
-
var b = "function" === typeof Symbol && Symbol.for
|
|
7251
|
+
var b = "function" === typeof Symbol && Symbol.for;
|
|
7252
|
+
var c = b ? Symbol.for("react.element") : 60103;
|
|
7253
|
+
var d = b ? Symbol.for("react.portal") : 60106;
|
|
7254
|
+
var e = b ? Symbol.for("react.fragment") : 60107;
|
|
7255
|
+
var f = b ? Symbol.for("react.strict_mode") : 60108;
|
|
7256
|
+
var g = b ? Symbol.for("react.profiler") : 60114;
|
|
7257
|
+
var h = b ? Symbol.for("react.provider") : 60109;
|
|
7258
|
+
var k = b ? Symbol.for("react.context") : 60110;
|
|
7259
|
+
var l = b ? Symbol.for("react.async_mode") : 60111;
|
|
7260
|
+
var m = b ? Symbol.for("react.concurrent_mode") : 60111;
|
|
7261
|
+
var n = b ? Symbol.for("react.forward_ref") : 60112;
|
|
7262
|
+
var p = b ? Symbol.for("react.suspense") : 60113;
|
|
7263
|
+
var q = b ? Symbol.for("react.suspense_list") : 60120;
|
|
7264
|
+
var r = b ? Symbol.for("react.memo") : 60115;
|
|
7265
|
+
var t = b ? Symbol.for("react.lazy") : 60116;
|
|
7266
|
+
var v = b ? Symbol.for("react.block") : 60121;
|
|
7267
|
+
var w = b ? Symbol.for("react.fundamental") : 60117;
|
|
7268
|
+
var x = b ? Symbol.for("react.responder") : 60118;
|
|
7269
|
+
var y = b ? Symbol.for("react.scope") : 60119;
|
|
7376
7270
|
function z(a) {
|
|
7377
7271
|
if ("object" === typeof a && null !== a) {
|
|
7378
7272
|
var u = a.$$typeof;
|
|
@@ -7695,7 +7589,6 @@ var require_hoist_non_react_statics_cjs = /* @__PURE__ */ __commonJSMin(((export
|
|
|
7695
7589
|
}));
|
|
7696
7590
|
//#endregion
|
|
7697
7591
|
//#region ../../../node_modules/.pnpm/@emotion+utils@1.4.2/node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js
|
|
7698
|
-
var isBrowser = true;
|
|
7699
7592
|
function getRegisteredStyles$1(registered, registeredStyles, classNames) {
|
|
7700
7593
|
var rawClassName = "";
|
|
7701
7594
|
classNames.split(" ").forEach(function(className) {
|
|
@@ -7706,7 +7599,7 @@ function getRegisteredStyles$1(registered, registeredStyles, classNames) {
|
|
|
7706
7599
|
}
|
|
7707
7600
|
var registerStyles = function registerStyles(cache, serialized, isStringTag) {
|
|
7708
7601
|
var className = cache.key + "-" + serialized.name;
|
|
7709
|
-
if ((isStringTag === false ||
|
|
7602
|
+
if ((isStringTag === false || false) && cache.registered[className] === void 0) cache.registered[className] = serialized.styles;
|
|
7710
7603
|
};
|
|
7711
7604
|
var insertStyles = function insertStyles(cache, serialized, isStringTag) {
|
|
7712
7605
|
registerStyles(cache, serialized, isStringTag);
|
|
@@ -7794,7 +7687,7 @@ var unitlessKeys = {
|
|
|
7794
7687
|
};
|
|
7795
7688
|
//#endregion
|
|
7796
7689
|
//#region ../../../node_modules/.pnpm/@emotion+serialize@1.3.3/node_modules/@emotion/serialize/dist/emotion-serialize.esm.js
|
|
7797
|
-
var isDevelopment$
|
|
7690
|
+
var isDevelopment$1 = false;
|
|
7798
7691
|
var hyphenateRegex = /[A-Z]|^ms/g;
|
|
7799
7692
|
var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
|
|
7800
7693
|
var isCustomProperty = function isCustomProperty(property) {
|
|
@@ -7876,7 +7769,7 @@ function createStringFromObject(mergedProps, registered, obj) {
|
|
|
7876
7769
|
if (registered != null && registered[asString] !== void 0) string += key + "{" + registered[asString] + "}";
|
|
7877
7770
|
else if (isProcessableValue(asString)) string += processStyleName(key) + ":" + processStyleValue(key, asString) + ";";
|
|
7878
7771
|
} else {
|
|
7879
|
-
if (key === "NO_COMPONENT_SELECTOR" && isDevelopment$
|
|
7772
|
+
if (key === "NO_COMPONENT_SELECTOR" && isDevelopment$1) throw new Error(noComponentSelectorMessage);
|
|
7880
7773
|
if (Array.isArray(value) && typeof value[0] === "string" && (registered == null || registered[value[0]] === void 0)) {
|
|
7881
7774
|
for (var _i = 0; _i < value.length; _i++) if (isProcessableValue(value[_i])) string += processStyleName(key) + ":" + processStyleValue(key, value[_i]) + ";";
|
|
7882
7775
|
} else {
|
|
@@ -7946,7 +7839,7 @@ var createEmotionProps = function createEmotionProps(type, props) {
|
|
|
7946
7839
|
newProps[typePropName] = type;
|
|
7947
7840
|
return newProps;
|
|
7948
7841
|
};
|
|
7949
|
-
var Insertion
|
|
7842
|
+
var Insertion = function Insertion(_ref) {
|
|
7950
7843
|
var cache = _ref.cache, serialized = _ref.serialized, isStringTag = _ref.isStringTag;
|
|
7951
7844
|
registerStyles(cache, serialized, isStringTag);
|
|
7952
7845
|
useInsertionEffectAlwaysWithSyncFallback(function() {
|
|
@@ -7968,7 +7861,7 @@ var Emotion$1 = /* @__PURE__ */ withEmotionCache(function(props, cache, ref) {
|
|
|
7968
7861
|
for (var _key2 in props) if (hasOwn.call(props, _key2) && _key2 !== "css" && _key2 !== typePropName && true) newProps[_key2] = props[_key2];
|
|
7969
7862
|
newProps.className = className;
|
|
7970
7863
|
if (ref) newProps.ref = ref;
|
|
7971
|
-
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(Insertion
|
|
7864
|
+
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(Insertion, {
|
|
7972
7865
|
cache,
|
|
7973
7866
|
serialized,
|
|
7974
7867
|
isStringTag: typeof WrappedComponent === "string"
|
|
@@ -8078,11 +7971,12 @@ var classnames = function classnames(args) {
|
|
|
8078
7971
|
}
|
|
8079
7972
|
}
|
|
8080
7973
|
return cls;
|
|
8081
|
-
}
|
|
8082
|
-
_createEmotion.flush;
|
|
8083
|
-
_createEmotion.hydrate;
|
|
7974
|
+
};
|
|
8084
7975
|
//#endregion
|
|
8085
7976
|
//#region ../../../node_modules/.pnpm/@emotion+css@11.13.5/node_modules/@emotion/css/dist/emotion-css.esm.js
|
|
7977
|
+
var _createEmotion = createEmotion({ key: "css" });
|
|
7978
|
+
_createEmotion.flush;
|
|
7979
|
+
_createEmotion.hydrate;
|
|
8086
7980
|
var cx = _createEmotion.cx;
|
|
8087
7981
|
_createEmotion.merge;
|
|
8088
7982
|
_createEmotion.getRegisteredStyles;
|
|
@@ -8092,7 +7986,7 @@ _createEmotion.css;
|
|
|
8092
7986
|
_createEmotion.sheet;
|
|
8093
7987
|
_createEmotion.cache;
|
|
8094
7988
|
//#endregion
|
|
8095
|
-
//#region ../../../node_modules/.pnpm/@wordpress+components@
|
|
7989
|
+
//#region ../../../node_modules/.pnpm/@wordpress+components@37.0.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/utils/hooks/use-cx.mjs
|
|
8096
7990
|
var isSerializedStyles = (o) => typeof o !== "undefined" && o !== null && ["name", "styles"].every((p) => typeof o[p] !== "undefined");
|
|
8097
7991
|
var useCx = () => {
|
|
8098
7992
|
const cache = __unsafe_useEmotionCache();
|
|
@@ -8108,226 +8002,98 @@ var useCx = () => {
|
|
|
8108
8002
|
}, [cache]);
|
|
8109
8003
|
};
|
|
8110
8004
|
//#endregion
|
|
8111
|
-
//#region ../../../node_modules/.pnpm
|
|
8112
|
-
|
|
8113
|
-
|
|
8114
|
-
|
|
8115
|
-
|
|
8116
|
-
|
|
8117
|
-
|
|
8118
|
-
|
|
8119
|
-
|
|
8120
|
-
|
|
8121
|
-
|
|
8122
|
-
|
|
8123
|
-
|
|
8124
|
-
|
|
8125
|
-
|
|
8126
|
-
|
|
8127
|
-
|
|
8128
|
-
|
|
8129
|
-
|
|
8130
|
-
|
|
8131
|
-
|
|
8132
|
-
|
|
8133
|
-
|
|
8134
|
-
|
|
8135
|
-
}
|
|
8136
|
-
|
|
8137
|
-
|
|
8138
|
-
|
|
8139
|
-
|
|
8140
|
-
|
|
8141
|
-
|
|
8142
|
-
|
|
8143
|
-
|
|
8144
|
-
|
|
8145
|
-
|
|
8146
|
-
|
|
8147
|
-
|
|
8148
|
-
|
|
8149
|
-
|
|
8150
|
-
|
|
8151
|
-
|
|
8152
|
-
|
|
8153
|
-
|
|
8154
|
-
|
|
8155
|
-
|
|
8156
|
-
|
|
8157
|
-
|
|
8158
|
-
|
|
8159
|
-
|
|
8160
|
-
|
|
8161
|
-
return insertStyles(cache, serialized, isStringTag);
|
|
8162
|
-
});
|
|
8163
|
-
return null;
|
|
8164
|
-
};
|
|
8165
|
-
//#endregion
|
|
8166
|
-
//#region ../../../node_modules/.pnpm/@wordpress+components@36.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/view/component.mjs
|
|
8167
|
-
var PolymorphicDiv = /* @__PURE__ */ function createStyled(tag, options) {
|
|
8168
|
-
var isReal = tag.__emotion_real === tag;
|
|
8169
|
-
var baseTag = isReal && tag.__emotion_base || tag;
|
|
8170
|
-
var identifierName;
|
|
8171
|
-
var targetClassName;
|
|
8172
|
-
if (options !== void 0) {
|
|
8173
|
-
identifierName = options.label;
|
|
8174
|
-
targetClassName = options.target;
|
|
8175
|
-
}
|
|
8176
|
-
var shouldForwardProp = composeShouldForwardProps(tag, options, isReal);
|
|
8177
|
-
var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag);
|
|
8178
|
-
var shouldUseAs = !defaultShouldForwardProp("as");
|
|
8179
|
-
return function() {
|
|
8180
|
-
var args = arguments;
|
|
8181
|
-
var styles = isReal && tag.__emotion_styles !== void 0 ? tag.__emotion_styles.slice(0) : [];
|
|
8182
|
-
if (identifierName !== void 0) styles.push("label:" + identifierName + ";");
|
|
8183
|
-
if (args[0] == null || args[0].raw === void 0) styles.push.apply(styles, args);
|
|
8184
|
-
else {
|
|
8185
|
-
var templateStringsArr = args[0];
|
|
8186
|
-
styles.push(templateStringsArr[0]);
|
|
8187
|
-
var len = args.length;
|
|
8188
|
-
var i = 1;
|
|
8189
|
-
for (; i < len; i++) styles.push(args[i], templateStringsArr[i]);
|
|
8190
|
-
}
|
|
8191
|
-
var Styled = withEmotionCache(function(props, cache, ref) {
|
|
8192
|
-
var FinalTag = shouldUseAs && props.as || baseTag;
|
|
8193
|
-
var className = "";
|
|
8194
|
-
var classInterpolations = [];
|
|
8195
|
-
var mergedProps = props;
|
|
8196
|
-
if (props.theme == null) {
|
|
8197
|
-
mergedProps = {};
|
|
8198
|
-
for (var key in props) mergedProps[key] = props[key];
|
|
8199
|
-
mergedProps.theme = React.useContext(ThemeContext);
|
|
8005
|
+
//#region ../../../node_modules/.pnpm/memize@2.1.1/node_modules/memize/dist/index.js
|
|
8006
|
+
/**
|
|
8007
|
+
* Memize options object.
|
|
8008
|
+
*
|
|
8009
|
+
* @typedef MemizeOptions
|
|
8010
|
+
*
|
|
8011
|
+
* @property {number} [maxSize] Maximum size of the cache.
|
|
8012
|
+
*/
|
|
8013
|
+
/**
|
|
8014
|
+
* Internal cache entry.
|
|
8015
|
+
*
|
|
8016
|
+
* @typedef MemizeCacheNode
|
|
8017
|
+
*
|
|
8018
|
+
* @property {?MemizeCacheNode|undefined} [prev] Previous node.
|
|
8019
|
+
* @property {?MemizeCacheNode|undefined} [next] Next node.
|
|
8020
|
+
* @property {Array<*>} args Function arguments for cache
|
|
8021
|
+
* entry.
|
|
8022
|
+
* @property {*} val Function result.
|
|
8023
|
+
*/
|
|
8024
|
+
/**
|
|
8025
|
+
* Properties of the enhanced function for controlling cache.
|
|
8026
|
+
*
|
|
8027
|
+
* @typedef MemizeMemoizedFunction
|
|
8028
|
+
*
|
|
8029
|
+
* @property {()=>void} clear Clear the cache.
|
|
8030
|
+
*/
|
|
8031
|
+
/**
|
|
8032
|
+
* Accepts a function to be memoized, and returns a new memoized function, with
|
|
8033
|
+
* optional options.
|
|
8034
|
+
*
|
|
8035
|
+
* @template {(...args: any[]) => any} F
|
|
8036
|
+
*
|
|
8037
|
+
* @param {F} fn Function to memoize.
|
|
8038
|
+
* @param {MemizeOptions} [options] Options object.
|
|
8039
|
+
*
|
|
8040
|
+
* @return {((...args: Parameters<F>) => ReturnType<F>) & MemizeMemoizedFunction} Memoized function.
|
|
8041
|
+
*/
|
|
8042
|
+
function memize(fn, options) {
|
|
8043
|
+
var size = 0;
|
|
8044
|
+
/** @type {?MemizeCacheNode|undefined} */
|
|
8045
|
+
var head;
|
|
8046
|
+
/** @type {?MemizeCacheNode|undefined} */
|
|
8047
|
+
var tail;
|
|
8048
|
+
options = options || {};
|
|
8049
|
+
function memoized() {
|
|
8050
|
+
var node = head, len = arguments.length, args, i;
|
|
8051
|
+
searchCache: while (node) {
|
|
8052
|
+
if (node.args.length !== arguments.length) {
|
|
8053
|
+
node = node.next;
|
|
8054
|
+
continue;
|
|
8200
8055
|
}
|
|
8201
|
-
|
|
8202
|
-
|
|
8203
|
-
|
|
8204
|
-
className += cache.key + "-" + serialized.name;
|
|
8205
|
-
if (targetClassName !== void 0) className += " " + targetClassName;
|
|
8206
|
-
var finalShouldForwardProp = shouldUseAs && shouldForwardProp === void 0 ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;
|
|
8207
|
-
var newProps = {};
|
|
8208
|
-
for (var _key in props) {
|
|
8209
|
-
if (shouldUseAs && _key === "as") continue;
|
|
8210
|
-
if (finalShouldForwardProp(_key)) newProps[_key] = props[_key];
|
|
8056
|
+
for (i = 0; i < len; i++) if (node.args[i] !== arguments[i]) {
|
|
8057
|
+
node = node.next;
|
|
8058
|
+
continue searchCache;
|
|
8211
8059
|
}
|
|
8212
|
-
|
|
8213
|
-
|
|
8214
|
-
|
|
8215
|
-
|
|
8216
|
-
|
|
8217
|
-
|
|
8218
|
-
|
|
8219
|
-
|
|
8220
|
-
|
|
8221
|
-
|
|
8222
|
-
|
|
8223
|
-
|
|
8224
|
-
|
|
8225
|
-
|
|
8226
|
-
|
|
8227
|
-
|
|
8228
|
-
return "." + targetClassName;
|
|
8229
|
-
} });
|
|
8230
|
-
Styled.withComponent = function(nextTag, nextOptions) {
|
|
8231
|
-
return createStyled(nextTag, _extends({}, options, nextOptions, { shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true) })).apply(void 0, styles);
|
|
8060
|
+
if (node !== head) {
|
|
8061
|
+
if (node === tail) tail = node.prev;
|
|
8062
|
+
/** @type {MemizeCacheNode} */ node.prev.next = node.next;
|
|
8063
|
+
if (node.next) node.next.prev = node.prev;
|
|
8064
|
+
node.next = head;
|
|
8065
|
+
node.prev = null;
|
|
8066
|
+
/** @type {MemizeCacheNode} */ head.prev = node;
|
|
8067
|
+
head = node;
|
|
8068
|
+
}
|
|
8069
|
+
return node.val;
|
|
8070
|
+
}
|
|
8071
|
+
args = new Array(len);
|
|
8072
|
+
for (i = 0; i < len; i++) args[i] = arguments[i];
|
|
8073
|
+
node = {
|
|
8074
|
+
args,
|
|
8075
|
+
val: fn.apply(null, args)
|
|
8232
8076
|
};
|
|
8233
|
-
|
|
8234
|
-
|
|
8235
|
-
|
|
8236
|
-
|
|
8237
|
-
|
|
8238
|
-
|
|
8239
|
-
|
|
8240
|
-
|
|
8241
|
-
|
|
8242
|
-
|
|
8243
|
-
...restProps
|
|
8244
|
-
});
|
|
8245
|
-
}
|
|
8246
|
-
var component_default$1 = Object.assign(forwardRef$1(UnforwardedView), { selector: ".components-view" });
|
|
8247
|
-
//#endregion
|
|
8248
|
-
//#region ../../../node_modules/.pnpm/@wordpress+components@36.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/grid/utils.mjs
|
|
8249
|
-
var ALIGNMENTS = {
|
|
8250
|
-
bottom: {
|
|
8251
|
-
alignItems: "flex-end",
|
|
8252
|
-
justifyContent: "center"
|
|
8253
|
-
},
|
|
8254
|
-
bottomLeft: {
|
|
8255
|
-
alignItems: "flex-start",
|
|
8256
|
-
justifyContent: "flex-end"
|
|
8257
|
-
},
|
|
8258
|
-
bottomRight: {
|
|
8259
|
-
alignItems: "flex-end",
|
|
8260
|
-
justifyContent: "flex-end"
|
|
8261
|
-
},
|
|
8262
|
-
center: {
|
|
8263
|
-
alignItems: "center",
|
|
8264
|
-
justifyContent: "center"
|
|
8265
|
-
},
|
|
8266
|
-
spaced: {
|
|
8267
|
-
alignItems: "center",
|
|
8268
|
-
justifyContent: "space-between"
|
|
8269
|
-
},
|
|
8270
|
-
left: {
|
|
8271
|
-
alignItems: "center",
|
|
8272
|
-
justifyContent: "flex-start"
|
|
8273
|
-
},
|
|
8274
|
-
right: {
|
|
8275
|
-
alignItems: "center",
|
|
8276
|
-
justifyContent: "flex-end"
|
|
8277
|
-
},
|
|
8278
|
-
stretch: { alignItems: "stretch" },
|
|
8279
|
-
top: {
|
|
8280
|
-
alignItems: "flex-start",
|
|
8281
|
-
justifyContent: "center"
|
|
8282
|
-
},
|
|
8283
|
-
topLeft: {
|
|
8284
|
-
alignItems: "flex-start",
|
|
8285
|
-
justifyContent: "flex-start"
|
|
8286
|
-
},
|
|
8287
|
-
topRight: {
|
|
8288
|
-
alignItems: "flex-start",
|
|
8289
|
-
justifyContent: "flex-end"
|
|
8077
|
+
if (head) {
|
|
8078
|
+
head.prev = node;
|
|
8079
|
+
node.next = head;
|
|
8080
|
+
} else tail = node;
|
|
8081
|
+
if (size === options.maxSize) {
|
|
8082
|
+
tail = tail.prev;
|
|
8083
|
+
/** @type {MemizeCacheNode} */ tail.next = null;
|
|
8084
|
+
} else size++;
|
|
8085
|
+
head = node;
|
|
8086
|
+
return node.val;
|
|
8290
8087
|
}
|
|
8291
|
-
|
|
8292
|
-
|
|
8293
|
-
|
|
8294
|
-
|
|
8295
|
-
|
|
8296
|
-
|
|
8297
|
-
var breakpoints = [
|
|
8298
|
-
"40em",
|
|
8299
|
-
"52em",
|
|
8300
|
-
"64em"
|
|
8301
|
-
];
|
|
8302
|
-
var useBreakpointIndex = (options = {}) => {
|
|
8303
|
-
const { defaultIndex = 0 } = options;
|
|
8304
|
-
if (typeof defaultIndex !== "number") throw new TypeError(`Default breakpoint index should be a number. Got: ${defaultIndex}, ${typeof defaultIndex}`);
|
|
8305
|
-
else if (defaultIndex < 0 || defaultIndex > breakpoints.length - 1) throw new RangeError(`Default breakpoint index out of range. Theme has ${breakpoints.length} breakpoints, got index ${defaultIndex}`);
|
|
8306
|
-
const [value, setValue] = useState$1(defaultIndex);
|
|
8307
|
-
useEffect$1(() => {
|
|
8308
|
-
const getIndex = () => breakpoints.filter((bp) => {
|
|
8309
|
-
return typeof window !== "undefined" ? window.matchMedia(`screen and (min-width: ${bp})`).matches : false;
|
|
8310
|
-
}).length;
|
|
8311
|
-
const onResize = () => {
|
|
8312
|
-
const newValue = getIndex();
|
|
8313
|
-
if (value !== newValue) setValue(newValue);
|
|
8314
|
-
};
|
|
8315
|
-
onResize();
|
|
8316
|
-
if (typeof window !== "undefined") window.addEventListener("resize", onResize);
|
|
8317
|
-
return () => {
|
|
8318
|
-
if (typeof window !== "undefined") window.removeEventListener("resize", onResize);
|
|
8319
|
-
};
|
|
8320
|
-
}, [value]);
|
|
8321
|
-
return value;
|
|
8322
|
-
};
|
|
8323
|
-
function useResponsiveValue(values, options = {}) {
|
|
8324
|
-
const index = useBreakpointIndex(options);
|
|
8325
|
-
if (!Array.isArray(values) && typeof values !== "function") return values;
|
|
8326
|
-
const array = values || [];
|
|
8327
|
-
return array[index >= array.length ? array.length - 1 : index];
|
|
8088
|
+
memoized.clear = function() {
|
|
8089
|
+
head = null;
|
|
8090
|
+
tail = null;
|
|
8091
|
+
size = 0;
|
|
8092
|
+
};
|
|
8093
|
+
return memoized;
|
|
8328
8094
|
}
|
|
8329
8095
|
//#endregion
|
|
8330
|
-
//#region ../../../node_modules/.pnpm/@wordpress+components@
|
|
8096
|
+
//#region ../../../node_modules/.pnpm/@wordpress+components@37.0.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/utils/colors-values.mjs
|
|
8331
8097
|
var white = "#fff";
|
|
8332
8098
|
var GRAY = {
|
|
8333
8099
|
900: "#1e1e1e",
|
|
@@ -8406,7 +8172,7 @@ var COLORS = Object.freeze({
|
|
|
8406
8172
|
ui: UI
|
|
8407
8173
|
});
|
|
8408
8174
|
//#endregion
|
|
8409
|
-
//#region ../../../node_modules/.pnpm/@wordpress+components@
|
|
8175
|
+
//#region ../../../node_modules/.pnpm/@wordpress+components@37.0.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/utils/config-values.mjs
|
|
8410
8176
|
var CONTROL_HEIGHT = "36px";
|
|
8411
8177
|
var CONTROL_PROPS = {
|
|
8412
8178
|
controlPaddingX: 12,
|
|
@@ -8448,20 +8214,13 @@ var config_values_default = Object.assign({}, CONTROL_PROPS, {
|
|
|
8448
8214
|
fontSizeXSmall: "calc(0.75 * 13px)",
|
|
8449
8215
|
fontLineHeightBase: "1.4",
|
|
8450
8216
|
fontWeight: "normal",
|
|
8451
|
-
|
|
8452
|
-
fontWeightHeading: "600",
|
|
8217
|
+
fontWeightEmphasis: "600",
|
|
8453
8218
|
gridBase: "4px",
|
|
8454
8219
|
elevationXSmall: `0 1px 1px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02), 0 3px 3px rgba(0, 0, 0, 0.02), 0 4px 4px rgba(0, 0, 0, 0.01)`,
|
|
8455
8220
|
elevationSmall: `0 1px 2px rgba(0, 0, 0, 0.05), 0 2px 3px rgba(0, 0, 0, 0.04), 0 6px 6px rgba(0, 0, 0, 0.03), 0 8px 8px rgba(0, 0, 0, 0.02)`,
|
|
8456
8221
|
elevationMedium: `0 2px 3px rgba(0, 0, 0, 0.05), 0 4px 5px rgba(0, 0, 0, 0.04), 0 12px 12px rgba(0, 0, 0, 0.03), 0 16px 16px rgba(0, 0, 0, 0.02)`,
|
|
8457
8222
|
elevationLarge: `0 5px 15px rgba(0, 0, 0, 0.08), 0 15px 27px rgba(0, 0, 0, 0.07), 0 30px 36px rgba(0, 0, 0, 0.04), 0 50px 43px rgba(0, 0, 0, 0.02)`,
|
|
8458
|
-
surfaceBackgroundColor: COLORS.white,
|
|
8459
|
-
surfaceBackgroundSubtleColor: "#F3F3F3",
|
|
8460
|
-
surfaceBackgroundTintColor: "#F5F5F5",
|
|
8461
8223
|
surfaceBorderColor: "rgba(0, 0, 0, 0.1)",
|
|
8462
|
-
surfaceBorderBoldColor: "rgba(0, 0, 0, 0.15)",
|
|
8463
|
-
surfaceBorderSubtleColor: "rgba(0, 0, 0, 0.05)",
|
|
8464
|
-
surfaceBackgroundTertiaryColor: COLORS.white,
|
|
8465
8224
|
surfaceColor: COLORS.white,
|
|
8466
8225
|
transitionDuration: "200ms",
|
|
8467
8226
|
transitionDurationFast: "160ms",
|
|
@@ -8471,7 +8230,365 @@ var config_values_default = Object.assign({}, CONTROL_PROPS, {
|
|
|
8471
8230
|
transitionTimingFunctionControl: "cubic-bezier(0.12, 0.8, 0.32, 1)"
|
|
8472
8231
|
});
|
|
8473
8232
|
//#endregion
|
|
8474
|
-
//#region ../../../node_modules/.pnpm
|
|
8233
|
+
//#region ../../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/es6/index.js
|
|
8234
|
+
var require_es6 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
8235
|
+
module.exports = function equal(a, b) {
|
|
8236
|
+
if (a === b) return true;
|
|
8237
|
+
if (a && b && typeof a == "object" && typeof b == "object") {
|
|
8238
|
+
if (a.constructor !== b.constructor) return false;
|
|
8239
|
+
var length, i, keys;
|
|
8240
|
+
if (Array.isArray(a)) {
|
|
8241
|
+
length = a.length;
|
|
8242
|
+
if (length != b.length) return false;
|
|
8243
|
+
for (i = length; i-- !== 0;) if (!equal(a[i], b[i])) return false;
|
|
8244
|
+
return true;
|
|
8245
|
+
}
|
|
8246
|
+
if (a instanceof Map && b instanceof Map) {
|
|
8247
|
+
if (a.size !== b.size) return false;
|
|
8248
|
+
for (i of a.entries()) if (!b.has(i[0])) return false;
|
|
8249
|
+
for (i of a.entries()) if (!equal(i[1], b.get(i[0]))) return false;
|
|
8250
|
+
return true;
|
|
8251
|
+
}
|
|
8252
|
+
if (a instanceof Set && b instanceof Set) {
|
|
8253
|
+
if (a.size !== b.size) return false;
|
|
8254
|
+
for (i of a.entries()) if (!b.has(i[0])) return false;
|
|
8255
|
+
return true;
|
|
8256
|
+
}
|
|
8257
|
+
if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
|
|
8258
|
+
length = a.length;
|
|
8259
|
+
if (length != b.length) return false;
|
|
8260
|
+
for (i = length; i-- !== 0;) if (a[i] !== b[i]) return false;
|
|
8261
|
+
return true;
|
|
8262
|
+
}
|
|
8263
|
+
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
|
|
8264
|
+
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
|
|
8265
|
+
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
|
|
8266
|
+
keys = Object.keys(a);
|
|
8267
|
+
length = keys.length;
|
|
8268
|
+
if (length !== Object.keys(b).length) return false;
|
|
8269
|
+
for (i = length; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
|
|
8270
|
+
for (i = length; i-- !== 0;) {
|
|
8271
|
+
var key = keys[i];
|
|
8272
|
+
if (!equal(a[key], b[key])) return false;
|
|
8273
|
+
}
|
|
8274
|
+
return true;
|
|
8275
|
+
}
|
|
8276
|
+
return a !== a && b !== b;
|
|
8277
|
+
};
|
|
8278
|
+
}));
|
|
8279
|
+
//#endregion
|
|
8280
|
+
//#region ../../../node_modules/.pnpm/@wordpress+warning@3.51.0/node_modules/@wordpress/warning/build-module/utils.mjs
|
|
8281
|
+
var logged = /* @__PURE__ */ new Set();
|
|
8282
|
+
//#endregion
|
|
8283
|
+
//#region ../../../node_modules/.pnpm/@wordpress+warning@3.51.0/node_modules/@wordpress/warning/build-module/index.mjs
|
|
8284
|
+
function isDev() {
|
|
8285
|
+
return globalThis.SCRIPT_DEBUG === true;
|
|
8286
|
+
}
|
|
8287
|
+
function warning(message) {
|
|
8288
|
+
if (!isDev()) return;
|
|
8289
|
+
if (logged.has(message)) return;
|
|
8290
|
+
console.warn(message);
|
|
8291
|
+
try {
|
|
8292
|
+
throw Error(message);
|
|
8293
|
+
} catch {}
|
|
8294
|
+
logged.add(message);
|
|
8295
|
+
}
|
|
8296
|
+
//#endregion
|
|
8297
|
+
//#region ../../../node_modules/.pnpm/@wordpress+components@37.0.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/context/context-system-provider.mjs
|
|
8298
|
+
var import_es6 = /* @__PURE__ */ __toESM(require_es6(), 1);
|
|
8299
|
+
var ComponentsContext = createContext$1(
|
|
8300
|
+
/** @type {Record<string, any>} */
|
|
8301
|
+
{}
|
|
8302
|
+
);
|
|
8303
|
+
ComponentsContext.displayName = "ComponentsContext";
|
|
8304
|
+
var useComponentsContext = () => useContext$1(ComponentsContext);
|
|
8305
|
+
function useContextSystemBridge({ value }) {
|
|
8306
|
+
const parentContext = useComponentsContext();
|
|
8307
|
+
const valueRef = useRef$1(value);
|
|
8308
|
+
use_update_effect_default(() => {
|
|
8309
|
+
if ((0, import_es6.default)(valueRef.current, value) && valueRef.current !== value) globalThis.SCRIPT_DEBUG === true && warning(`Please memoize your context: ${JSON.stringify(value)}`);
|
|
8310
|
+
}, [value]);
|
|
8311
|
+
return useMemo$1(() => {
|
|
8312
|
+
return deepmerge(parentContext ?? {}, value ?? {}, { isMergeableObject: isPlainObject });
|
|
8313
|
+
}, [parentContext, value]);
|
|
8314
|
+
}
|
|
8315
|
+
var BaseContextSystemProvider = ({ children, value }) => {
|
|
8316
|
+
const contextValue = useContextSystemBridge({ value });
|
|
8317
|
+
return /* @__PURE__ */ jsx(ComponentsContext.Provider, {
|
|
8318
|
+
value: contextValue,
|
|
8319
|
+
children
|
|
8320
|
+
});
|
|
8321
|
+
};
|
|
8322
|
+
memo(BaseContextSystemProvider);
|
|
8323
|
+
//#endregion
|
|
8324
|
+
//#region ../../../node_modules/.pnpm/@wordpress+components@37.0.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/context/constants.mjs
|
|
8325
|
+
var COMPONENT_NAMESPACE = "data-wp-component";
|
|
8326
|
+
var CONNECTED_NAMESPACE = "data-wp-c16t";
|
|
8327
|
+
var CONNECT_STATIC_NAMESPACE = "__contextSystemKey__";
|
|
8328
|
+
//#endregion
|
|
8329
|
+
//#region ../../../node_modules/.pnpm/@wordpress+components@37.0.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/context/get-styled-class-name-from-key.mjs
|
|
8330
|
+
function getStyledClassName(namespace) {
|
|
8331
|
+
return `components-${paramCase(namespace)}`;
|
|
8332
|
+
}
|
|
8333
|
+
var getStyledClassNameFromKey = memize(getStyledClassName);
|
|
8334
|
+
//#endregion
|
|
8335
|
+
//#region ../../../node_modules/.pnpm/@wordpress+components@37.0.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/context/context-connect.mjs
|
|
8336
|
+
function contextConnect(Component, namespace) {
|
|
8337
|
+
return _contextConnect(Component, namespace, { forwardsRef: true });
|
|
8338
|
+
}
|
|
8339
|
+
function _contextConnect(Component, namespace, options) {
|
|
8340
|
+
const WrappedComponent = options?.forwardsRef ? forwardRef$1(Component) : Component;
|
|
8341
|
+
if (typeof namespace === "undefined") globalThis.SCRIPT_DEBUG === true && warning("contextConnect: Please provide a namespace");
|
|
8342
|
+
let mergedNamespace = WrappedComponent["__contextSystemKey__"] || [namespace];
|
|
8343
|
+
if (Array.isArray(namespace)) mergedNamespace = [...mergedNamespace, ...namespace];
|
|
8344
|
+
if (typeof namespace === "string") mergedNamespace = [...mergedNamespace, namespace];
|
|
8345
|
+
return Object.assign(WrappedComponent, {
|
|
8346
|
+
[CONNECT_STATIC_NAMESPACE]: [...new Set(mergedNamespace)],
|
|
8347
|
+
displayName: namespace,
|
|
8348
|
+
selector: `.${getStyledClassNameFromKey(namespace)}`
|
|
8349
|
+
});
|
|
8350
|
+
}
|
|
8351
|
+
//#endregion
|
|
8352
|
+
//#region ../../../node_modules/.pnpm/@wordpress+components@37.0.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/context/utils.mjs
|
|
8353
|
+
function getNamespace(componentName) {
|
|
8354
|
+
return { [COMPONENT_NAMESPACE]: componentName };
|
|
8355
|
+
}
|
|
8356
|
+
function getConnectedNamespace() {
|
|
8357
|
+
return { [CONNECTED_NAMESPACE]: true };
|
|
8358
|
+
}
|
|
8359
|
+
//#endregion
|
|
8360
|
+
//#region ../../../node_modules/.pnpm/@wordpress+components@37.0.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/context/use-context-system.mjs
|
|
8361
|
+
function useContextSystem(props, namespace) {
|
|
8362
|
+
const contextSystemProps = useComponentsContext();
|
|
8363
|
+
if (typeof namespace === "undefined") globalThis.SCRIPT_DEBUG === true && warning("useContextSystem: Please provide a namespace");
|
|
8364
|
+
const contextProps = contextSystemProps?.[namespace] || {};
|
|
8365
|
+
const finalComponentProps = {
|
|
8366
|
+
...getConnectedNamespace(),
|
|
8367
|
+
...getNamespace(namespace)
|
|
8368
|
+
};
|
|
8369
|
+
const { _overrides: overrideProps, ...otherContextProps } = contextProps;
|
|
8370
|
+
const initialMergedProps = Object.entries(otherContextProps).length ? Object.assign({}, otherContextProps, props) : props;
|
|
8371
|
+
const classes = useCx()(getStyledClassNameFromKey(namespace), props.className);
|
|
8372
|
+
const rendered = typeof initialMergedProps.renderChildren === "function" ? initialMergedProps.renderChildren(initialMergedProps) : initialMergedProps.children;
|
|
8373
|
+
for (const key in initialMergedProps) finalComponentProps[key] = initialMergedProps[key];
|
|
8374
|
+
for (const key in overrideProps) finalComponentProps[key] = overrideProps[key];
|
|
8375
|
+
if (rendered !== void 0) finalComponentProps.children = rendered;
|
|
8376
|
+
finalComponentProps.className = classes;
|
|
8377
|
+
return finalComponentProps;
|
|
8378
|
+
}
|
|
8379
|
+
//#endregion
|
|
8380
|
+
//#region ../../../node_modules/.pnpm/@wordpress+components@37.0.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/visually-hidden/styles.mjs
|
|
8381
|
+
var visuallyHidden = {
|
|
8382
|
+
border: 0,
|
|
8383
|
+
clip: "rect(1px, 1px, 1px, 1px)",
|
|
8384
|
+
WebkitClipPath: "inset( 50% )",
|
|
8385
|
+
clipPath: "inset( 50% )",
|
|
8386
|
+
height: "1px",
|
|
8387
|
+
margin: "-1px",
|
|
8388
|
+
overflow: "hidden",
|
|
8389
|
+
padding: 0,
|
|
8390
|
+
position: "absolute",
|
|
8391
|
+
width: "1px",
|
|
8392
|
+
wordWrap: "normal",
|
|
8393
|
+
wordBreak: "normal"
|
|
8394
|
+
};
|
|
8395
|
+
//#endregion
|
|
8396
|
+
//#region ../../../node_modules/.pnpm/@wordpress+components@37.0.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/utils/polymorphic-element.mjs
|
|
8397
|
+
var customAttributeRegExp = /^(data|aria|x)-/i;
|
|
8398
|
+
var eventHandlerRegExp = /^on[A-Z]/;
|
|
8399
|
+
var svgElementNames = new Set(`animate animateMotion animateTransform circle clipPath defs desc ellipse
|
|
8400
|
+
feBlend feColorMatrix feComponentTransfer feComposite feConvolveMatrix
|
|
8401
|
+
feDiffuseLighting feDisplacementMap feDistantLight feDropShadow feFlood
|
|
8402
|
+
feFuncA feFuncB feFuncG feFuncR feGaussianBlur feImage feMerge feMergeNode
|
|
8403
|
+
feMorphology feOffset fePointLight feSpecularLighting feSpotLight feTile
|
|
8404
|
+
feTurbulence filter foreignObject g image line linearGradient marker mask
|
|
8405
|
+
metadata mpath path pattern polygon polyline radialGradient rect set stop svg
|
|
8406
|
+
switch symbol text textPath tspan use view`.split(/\s+/));
|
|
8407
|
+
var baseElementProps = new Set(`children dangerouslySetInnerHTML key autoFocus defaultValue defaultChecked
|
|
8408
|
+
innerHTML suppressContentEditableWarning suppressHydrationWarning valueLink
|
|
8409
|
+
abbr accept acceptCharset accessKey action allow allowUserMedia
|
|
8410
|
+
allowPaymentRequest allowFullScreen allowTransparency alt async autoComplete
|
|
8411
|
+
autoPlay capture cellPadding cellSpacing challenge charSet checked cite classID
|
|
8412
|
+
className cols colSpan content contentEditable contextMenu controls controlsList
|
|
8413
|
+
coords crossOrigin data dateTime decoding default defer dir disabled
|
|
8414
|
+
disablePictureInPicture disableRemotePlayback download draggable encType
|
|
8415
|
+
enterKeyHint fetchpriority fetchPriority form formAction formEncType formMethod
|
|
8416
|
+
formNoValidate formTarget frameBorder headers height hidden high href hrefLang
|
|
8417
|
+
htmlFor httpEquiv id inputMode integrity is keyParams keyType kind label lang
|
|
8418
|
+
list loading loop low marginHeight marginWidth max maxLength media mediaGroup
|
|
8419
|
+
method min minLength multiple muted name nonce noValidate open optimum pattern
|
|
8420
|
+
placeholder playsInline popover popoverTarget popoverTargetAction poster
|
|
8421
|
+
preload profile radioGroup readOnly referrerPolicy rel required reversed role
|
|
8422
|
+
rows rowSpan sandbox scope scoped scrolling seamless selected shape size sizes
|
|
8423
|
+
slot span spellCheck src srcDoc srcLang srcSet start step style summary
|
|
8424
|
+
tabIndex target title translate type useMap value width wmode wrap about
|
|
8425
|
+
datatype inlist prefix property resource typeof vocab autoCapitalize
|
|
8426
|
+
autoCorrect autoSave color incremental fallback inert itemProp itemScope
|
|
8427
|
+
itemType itemID itemRef on option results security unselectable`.split(/\s+/));
|
|
8428
|
+
var svgElementProps = new Set(`accentHeight accumulate additive alignmentBaseline allowReorder alphabetic
|
|
8429
|
+
amplitude arabicForm ascent attributeName attributeType autoReverse azimuth
|
|
8430
|
+
baseFrequency baselineShift baseProfile bbox begin bias by calcMode capHeight
|
|
8431
|
+
clip clipPathUnits clipPath clipRule colorInterpolation
|
|
8432
|
+
colorInterpolationFilters colorProfile colorRendering contentScriptType
|
|
8433
|
+
contentStyleType cursor cx cy d decelerate descent diffuseConstant direction
|
|
8434
|
+
display divisor dominantBaseline dur dx dy edgeMode elevation enableBackground
|
|
8435
|
+
end exponent externalResourcesRequired fill fillOpacity fillRule filter
|
|
8436
|
+
filterRes filterUnits floodColor floodOpacity focusable fontFamily fontSize
|
|
8437
|
+
fontSizeAdjust fontStretch fontStyle fontVariant fontWeight format from fr fx
|
|
8438
|
+
fy g1 g2 glyphName glyphOrientationHorizontal glyphOrientationVertical
|
|
8439
|
+
glyphRef gradientTransform gradientUnits hanging horizAdvX horizOriginX
|
|
8440
|
+
ideographic imageRendering in in2 intercept k k1 k2 k3 k4 kernelMatrix
|
|
8441
|
+
kernelUnitLength kerning keyPoints keySplines keyTimes lengthAdjust
|
|
8442
|
+
letterSpacing lightingColor limitingConeAngle local markerEnd markerMid
|
|
8443
|
+
markerStart markerHeight markerUnits markerWidth mask maskContentUnits
|
|
8444
|
+
maskUnits mathematical mode numOctaves offset opacity operator order orient
|
|
8445
|
+
orientation origin overflow overlinePosition overlineThickness panose1
|
|
8446
|
+
paintOrder pathLength patternContentUnits patternTransform patternUnits
|
|
8447
|
+
pointerEvents points pointsAtX pointsAtY pointsAtZ preserveAlpha
|
|
8448
|
+
preserveAspectRatio primitiveUnits r radius refX refY renderingIntent
|
|
8449
|
+
repeatCount repeatDur requiredExtensions requiredFeatures restart result rotate
|
|
8450
|
+
rx ry scale seed shapeRendering slope spacing specularConstant
|
|
8451
|
+
specularExponent speed spreadMethod startOffset stdDeviation stemh stemv
|
|
8452
|
+
stitchTiles stopColor stopOpacity strikethroughPosition strikethroughThickness
|
|
8453
|
+
string stroke strokeDasharray strokeDashoffset strokeLinecap strokeLinejoin
|
|
8454
|
+
strokeMiterlimit strokeOpacity strokeWidth surfaceScale systemLanguage
|
|
8455
|
+
tableValues targetX targetY textAnchor textDecoration textRendering textLength
|
|
8456
|
+
to transform u1 u2 underlinePosition underlineThickness unicode unicodeBidi
|
|
8457
|
+
unicodeRange unitsPerEm vAlphabetic vHanging vIdeographic vMathematical values
|
|
8458
|
+
vectorEffect version vertAdvY vertOriginX vertOriginY viewBox viewTarget
|
|
8459
|
+
visibility widths wordSpacing writingMode x xHeight x1 x2 xChannelSelector
|
|
8460
|
+
xlinkActuate xlinkArcrole xlinkHref xlinkRole xlinkShow xlinkTitle xlinkType
|
|
8461
|
+
xmlBase xmlns xmlnsXlink xmlLang xmlSpace y y1 y2 yChannelSelector z
|
|
8462
|
+
zoomAndPan`.split(/\s+/));
|
|
8463
|
+
var compatElementProps = /* @__PURE__ */ new Set([
|
|
8464
|
+
"autofocus",
|
|
8465
|
+
"class",
|
|
8466
|
+
"for"
|
|
8467
|
+
]);
|
|
8468
|
+
function isValidIntrinsicElementProp(prop, element) {
|
|
8469
|
+
if (customAttributeRegExp.test(prop) || eventHandlerRegExp.test(prop)) return true;
|
|
8470
|
+
if (baseElementProps.has(prop) || compatElementProps.has(prop)) return true;
|
|
8471
|
+
return svgElementNames.has(element) && svgElementProps.has(prop);
|
|
8472
|
+
}
|
|
8473
|
+
function filterIntrinsicElementProps(props, element) {
|
|
8474
|
+
return Object.fromEntries(Object.entries(props).filter(([prop]) => isValidIntrinsicElementProp(prop, element)));
|
|
8475
|
+
}
|
|
8476
|
+
function UnforwardedPolymorphicElement({ as, ...props }, ref) {
|
|
8477
|
+
const Element = as || "div";
|
|
8478
|
+
return /* @__PURE__ */ jsx(Element, {
|
|
8479
|
+
ref,
|
|
8480
|
+
...typeof Element === "string" ? filterIntrinsicElementProps(props, Element) : props
|
|
8481
|
+
});
|
|
8482
|
+
}
|
|
8483
|
+
var PolymorphicElement = forwardRef$1(UnforwardedPolymorphicElement);
|
|
8484
|
+
//#endregion
|
|
8485
|
+
//#region ../../../node_modules/.pnpm/@wordpress+components@37.0.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/view/component.mjs
|
|
8486
|
+
function UnforwardedView({ css, ...restProps }, ref) {
|
|
8487
|
+
return /* @__PURE__ */ jsx(PolymorphicElement, {
|
|
8488
|
+
ref,
|
|
8489
|
+
...restProps
|
|
8490
|
+
});
|
|
8491
|
+
}
|
|
8492
|
+
var component_default$2 = Object.assign(forwardRef$1(UnforwardedView), { selector: ".components-view" });
|
|
8493
|
+
//#endregion
|
|
8494
|
+
//#region ../../../node_modules/.pnpm/@wordpress+components@37.0.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/visually-hidden/component.mjs
|
|
8495
|
+
function UnconnectedVisuallyHidden(props, forwardedRef) {
|
|
8496
|
+
const { style: styleProp, ...contextProps } = useContextSystem(props, "VisuallyHidden");
|
|
8497
|
+
return /* @__PURE__ */ jsx(component_default$2, {
|
|
8498
|
+
ref: forwardedRef,
|
|
8499
|
+
...contextProps,
|
|
8500
|
+
"data-visually-hidden": "",
|
|
8501
|
+
style: {
|
|
8502
|
+
...visuallyHidden,
|
|
8503
|
+
...styleProp || {}
|
|
8504
|
+
}
|
|
8505
|
+
});
|
|
8506
|
+
}
|
|
8507
|
+
var component_default$1 = contextConnect(UnconnectedVisuallyHidden, "VisuallyHidden");
|
|
8508
|
+
//#endregion
|
|
8509
|
+
//#region ../../../node_modules/.pnpm/@wordpress+components@37.0.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/utils/use-responsive-value.mjs
|
|
8510
|
+
var breakpoints = [
|
|
8511
|
+
"40em",
|
|
8512
|
+
"52em",
|
|
8513
|
+
"64em"
|
|
8514
|
+
];
|
|
8515
|
+
var useBreakpointIndex = (options = {}) => {
|
|
8516
|
+
const { defaultIndex = 0 } = options;
|
|
8517
|
+
if (typeof defaultIndex !== "number") throw new TypeError(`Default breakpoint index should be a number. Got: ${defaultIndex}, ${typeof defaultIndex}`);
|
|
8518
|
+
else if (defaultIndex < 0 || defaultIndex > breakpoints.length - 1) throw new RangeError(`Default breakpoint index out of range. Theme has ${breakpoints.length} breakpoints, got index ${defaultIndex}`);
|
|
8519
|
+
const [value, setValue] = useState$1(defaultIndex);
|
|
8520
|
+
useEffect$1(() => {
|
|
8521
|
+
const getIndex = () => breakpoints.filter((bp) => {
|
|
8522
|
+
return typeof window !== "undefined" ? window.matchMedia(`screen and (min-width: ${bp})`).matches : false;
|
|
8523
|
+
}).length;
|
|
8524
|
+
const onResize = () => {
|
|
8525
|
+
const newValue = getIndex();
|
|
8526
|
+
if (value !== newValue) setValue(newValue);
|
|
8527
|
+
};
|
|
8528
|
+
onResize();
|
|
8529
|
+
if (typeof window !== "undefined") window.addEventListener("resize", onResize);
|
|
8530
|
+
return () => {
|
|
8531
|
+
if (typeof window !== "undefined") window.removeEventListener("resize", onResize);
|
|
8532
|
+
};
|
|
8533
|
+
}, [value]);
|
|
8534
|
+
return value;
|
|
8535
|
+
};
|
|
8536
|
+
function useResponsiveValue(values, options = {}) {
|
|
8537
|
+
const index = useBreakpointIndex(options);
|
|
8538
|
+
if (!Array.isArray(values) && typeof values !== "function") return values;
|
|
8539
|
+
const array = values || [];
|
|
8540
|
+
return array[index >= array.length ? array.length - 1 : index];
|
|
8541
|
+
}
|
|
8542
|
+
//#endregion
|
|
8543
|
+
//#region ../../../node_modules/.pnpm/@wordpress+components@37.0.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/grid/utils.mjs
|
|
8544
|
+
var ALIGNMENTS = {
|
|
8545
|
+
bottom: {
|
|
8546
|
+
alignItems: "flex-end",
|
|
8547
|
+
justifyContent: "center"
|
|
8548
|
+
},
|
|
8549
|
+
bottomLeft: {
|
|
8550
|
+
alignItems: "flex-start",
|
|
8551
|
+
justifyContent: "flex-end"
|
|
8552
|
+
},
|
|
8553
|
+
bottomRight: {
|
|
8554
|
+
alignItems: "flex-end",
|
|
8555
|
+
justifyContent: "flex-end"
|
|
8556
|
+
},
|
|
8557
|
+
center: {
|
|
8558
|
+
alignItems: "center",
|
|
8559
|
+
justifyContent: "center"
|
|
8560
|
+
},
|
|
8561
|
+
spaced: {
|
|
8562
|
+
alignItems: "center",
|
|
8563
|
+
justifyContent: "space-between"
|
|
8564
|
+
},
|
|
8565
|
+
left: {
|
|
8566
|
+
alignItems: "center",
|
|
8567
|
+
justifyContent: "flex-start"
|
|
8568
|
+
},
|
|
8569
|
+
right: {
|
|
8570
|
+
alignItems: "center",
|
|
8571
|
+
justifyContent: "flex-end"
|
|
8572
|
+
},
|
|
8573
|
+
stretch: { alignItems: "stretch" },
|
|
8574
|
+
top: {
|
|
8575
|
+
alignItems: "flex-start",
|
|
8576
|
+
justifyContent: "center"
|
|
8577
|
+
},
|
|
8578
|
+
topLeft: {
|
|
8579
|
+
alignItems: "flex-start",
|
|
8580
|
+
justifyContent: "flex-start"
|
|
8581
|
+
},
|
|
8582
|
+
topRight: {
|
|
8583
|
+
alignItems: "flex-start",
|
|
8584
|
+
justifyContent: "flex-end"
|
|
8585
|
+
}
|
|
8586
|
+
};
|
|
8587
|
+
function getAlignmentProps(alignment) {
|
|
8588
|
+
return alignment ? ALIGNMENTS[alignment] : {};
|
|
8589
|
+
}
|
|
8590
|
+
//#endregion
|
|
8591
|
+
//#region ../../../node_modules/.pnpm/@wordpress+components@37.0.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/grid/hook.mjs
|
|
8475
8592
|
function useGrid(props) {
|
|
8476
8593
|
const { align, alignment, className, columnGap, columns = 2, gap = 3, isInline = false, justify, rowGap, rows, templateColumns, templateRows, ...otherProps } = useContextSystem(props, "Grid");
|
|
8477
8594
|
const column = useResponsiveValue(Array.isArray(columns) ? columns : [columns]);
|
|
@@ -8481,7 +8598,7 @@ function useGrid(props) {
|
|
|
8481
8598
|
const cx = useCx();
|
|
8482
8599
|
const classes = useMemo$1(() => {
|
|
8483
8600
|
const alignmentProps = getAlignmentProps(alignment);
|
|
8484
|
-
|
|
8601
|
+
const gridClasses = /* @__PURE__ */ css$1({
|
|
8485
8602
|
alignItems: align,
|
|
8486
8603
|
display: isInline ? "inline-grid" : "grid",
|
|
8487
8604
|
gap: `calc( ${config_values_default.gridBase} * ${gap} )`,
|
|
@@ -8492,7 +8609,8 @@ function useGrid(props) {
|
|
|
8492
8609
|
justifyContent: justify,
|
|
8493
8610
|
verticalAlign: isInline ? "middle" : void 0,
|
|
8494
8611
|
...alignmentProps
|
|
8495
|
-
}, process.env.NODE_ENV === "production" ? "" : ";label:gridClasses;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImhvb2sudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBdURzQiIsImZpbGUiOiJob29rLnRzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBFeHRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuXG4vKipcbiAqIFdvcmRQcmVzcyBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHsgdXNlTWVtbyB9IGZyb20gJ0B3b3JkcHJlc3MvZWxlbWVudCc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB0eXBlIHsgV29yZFByZXNzQ29tcG9uZW50UHJvcHMgfSBmcm9tICcuLi9jb250ZXh0JztcbmltcG9ydCB7IHVzZUNvbnRleHRTeXN0ZW0gfSBmcm9tICcuLi9jb250ZXh0JztcbmltcG9ydCB7IGdldEFsaWdubWVudFByb3BzIH0gZnJvbSAnLi91dGlscyc7XG5pbXBvcnQgeyB1c2VSZXNwb25zaXZlVmFsdWUgfSBmcm9tICcuLi91dGlscy91c2UtcmVzcG9uc2l2ZS12YWx1ZSc7XG5pbXBvcnQgQ09ORklHIGZyb20gJy4uL3V0aWxzL2NvbmZpZy12YWx1ZXMnO1xuaW1wb3J0IHsgdXNlQ3ggfSBmcm9tICcuLi91dGlscy9ob29rcy91c2UtY3gnO1xuaW1wb3J0IHR5cGUgeyBHcmlkUHJvcHMgfSBmcm9tICcuL3R5cGVzJztcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gdXNlR3JpZChcblx0cHJvcHM6IFdvcmRQcmVzc0NvbXBvbmVudFByb3BzPCBHcmlkUHJvcHMsICdkaXYnID5cbikge1xuXHRjb25zdCB7XG5cdFx0YWxpZ24sXG5cdFx0YWxpZ25tZW50LFxuXHRcdGNsYXNzTmFtZSxcblx0XHRjb2x1bW5HYXAsXG5cdFx0Y29sdW1ucyA9IDIsXG5cdFx0Z2FwID0gMyxcblx0XHRpc0lubGluZSA9IGZhbHNlLFxuXHRcdGp1c3RpZnksXG5cdFx0cm93R2FwLFxuXHRcdHJvd3MsXG5cdFx0dGVtcGxhdGVDb2x1bW5zLFxuXHRcdHRlbXBsYXRlUm93cyxcblx0XHQuLi5vdGhlclByb3BzXG5cdH0gPSB1c2VDb250ZXh0U3lzdGVtKCBwcm9wcywgJ0dyaWQnICk7XG5cblx0Y29uc3QgY29sdW1uc0FzQXJyYXkgPSBBcnJheS5pc0FycmF5KCBjb2x1bW5zICkgPyBjb2x1bW5zIDogWyBjb2x1bW5zIF07XG5cdGNvbnN0IGNvbHVtbiA9IHVzZVJlc3BvbnNpdmVWYWx1ZSggY29sdW1uc0FzQXJyYXkgKTtcblx0Y29uc3Qgcm93c0FzQXJyYXkgPSBBcnJheS5pc0FycmF5KCByb3dzICkgPyByb3dzIDogWyByb3dzIF07XG5cdGNvbnN0IHJvdyA9IHVzZVJlc3BvbnNpdmVWYWx1ZSggcm93c0FzQXJyYXkgKTtcblxuXHRjb25zdCBncmlkVGVtcGxhdGVDb2x1bW5zID1cblx0XHR0ZW1wbGF0ZUNvbHVtbnMgfHwgKCAhISBjb2x1bW5zICYmIGByZXBlYXQoICR7IGNvbHVtbiB9LCAxZnIgKWAgKTtcblx0Y29uc3QgZ3JpZFRlbXBsYXRlUm93cyA9XG5cdFx0dGVtcGxhdGVSb3dzIHx8ICggISEgcm93cyAmJiBgcmVwZWF0KCAkeyByb3cgfSwgMWZyIClgICk7XG5cblx0Y29uc3QgY3ggPSB1c2VDeCgpO1xuXG5cdGNvbnN0IGNsYXNzZXMgPSB1c2VNZW1vKCAoKSA9PiB7XG5cdFx0Y29uc3QgYWxpZ25tZW50UHJvcHMgPSBnZXRBbGlnbm1lbnRQcm9wcyggYWxpZ25tZW50ICk7XG5cblx0XHRjb25zdCBncmlkQ2xhc3NlcyA9IGNzcygge1xuXHRcdFx0YWxpZ25JdGVtczogYWxpZ24sXG5cdFx0XHRkaXNwbGF5OiBpc0lubGluZSA/ICdpbmxpbmUtZ3JpZCcgOiAnZ3JpZCcsXG5cdFx0XHRnYXA6IGBjYWxjKCAkeyBDT05GSUcuZ3JpZEJhc2UgfSAqICR7IGdhcCB9IClgLFxuXHRcdFx0Z3JpZFRlbXBsYXRlQ29sdW1uczogZ3JpZFRlbXBsYXRlQ29sdW1ucyB8fCB1bmRlZmluZWQsXG5cdFx0XHRncmlkVGVtcGxhdGVSb3dzOiBncmlkVGVtcGxhdGVSb3dzIHx8IHVuZGVmaW5lZCxcblx0XHRcdGdyaWRSb3dHYXA6IHJvd0dhcCxcblx0XHRcdGdyaWRDb2x1bW5HYXA6IGNvbHVtbkdhcCxcblx0XHRcdGp1c3RpZnlDb250ZW50OiBqdXN0aWZ5LFxuXHRcdFx0dmVydGljYWxBbGlnbjogaXNJbmxpbmUgPyAnbWlkZGxlJyA6IHVuZGVmaW5lZCxcblx0XHRcdC4uLmFsaWdubWVudFByb3BzLFxuXHRcdH0gKTtcblxuXHRcdHJldHVybiBjeCggZ3JpZENsYXNzZXMsIGNsYXNzTmFtZSApO1xuXHR9LCBbXG5cdFx0YWxpZ24sXG5cdFx0YWxpZ25tZW50LFxuXHRcdGNsYXNzTmFtZSxcblx0XHRjb2x1bW5HYXAsXG5cdFx0Y3gsXG5cdFx0Z2FwLFxuXHRcdGdyaWRUZW1wbGF0ZUNvbHVtbnMsXG5cdFx0Z3JpZFRlbXBsYXRlUm93cyxcblx0XHRpc0lubGluZSxcblx0XHRqdXN0aWZ5LFxuXHRcdHJvd0dhcCxcblx0XSApO1xuXG5cdHJldHVybiB7IC4uLm90aGVyUHJvcHMsIGNsYXNzTmFtZTogY2xhc3NlcyB9O1xufVxuIl19 */")
|
|
8612
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:gridClasses;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImhvb2sudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBdURzQiIsImZpbGUiOiJob29rLnRzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBFeHRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuXG4vKipcbiAqIFdvcmRQcmVzcyBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHsgdXNlTWVtbyB9IGZyb20gJ0B3b3JkcHJlc3MvZWxlbWVudCc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB0eXBlIHsgV29yZFByZXNzQ29tcG9uZW50UHJvcHMgfSBmcm9tICcuLi9jb250ZXh0JztcbmltcG9ydCB7IHVzZUNvbnRleHRTeXN0ZW0gfSBmcm9tICcuLi9jb250ZXh0JztcbmltcG9ydCB7IGdldEFsaWdubWVudFByb3BzIH0gZnJvbSAnLi91dGlscyc7XG5pbXBvcnQgeyB1c2VSZXNwb25zaXZlVmFsdWUgfSBmcm9tICcuLi91dGlscy91c2UtcmVzcG9uc2l2ZS12YWx1ZSc7XG5pbXBvcnQgQ09ORklHIGZyb20gJy4uL3V0aWxzL2NvbmZpZy12YWx1ZXMnO1xuaW1wb3J0IHsgdXNlQ3ggfSBmcm9tICcuLi91dGlscy9ob29rcy91c2UtY3gnO1xuaW1wb3J0IHR5cGUgeyBHcmlkUHJvcHMgfSBmcm9tICcuL3R5cGVzJztcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gdXNlR3JpZChcblx0cHJvcHM6IFdvcmRQcmVzc0NvbXBvbmVudFByb3BzPCBHcmlkUHJvcHMsICdkaXYnID5cbikge1xuXHRjb25zdCB7XG5cdFx0YWxpZ24sXG5cdFx0YWxpZ25tZW50LFxuXHRcdGNsYXNzTmFtZSxcblx0XHRjb2x1bW5HYXAsXG5cdFx0Y29sdW1ucyA9IDIsXG5cdFx0Z2FwID0gMyxcblx0XHRpc0lubGluZSA9IGZhbHNlLFxuXHRcdGp1c3RpZnksXG5cdFx0cm93R2FwLFxuXHRcdHJvd3MsXG5cdFx0dGVtcGxhdGVDb2x1bW5zLFxuXHRcdHRlbXBsYXRlUm93cyxcblx0XHQuLi5vdGhlclByb3BzXG5cdH0gPSB1c2VDb250ZXh0U3lzdGVtKCBwcm9wcywgJ0dyaWQnICk7XG5cblx0Y29uc3QgY29sdW1uc0FzQXJyYXkgPSBBcnJheS5pc0FycmF5KCBjb2x1bW5zICkgPyBjb2x1bW5zIDogWyBjb2x1bW5zIF07XG5cdGNvbnN0IGNvbHVtbiA9IHVzZVJlc3BvbnNpdmVWYWx1ZSggY29sdW1uc0FzQXJyYXkgKTtcblx0Y29uc3Qgcm93c0FzQXJyYXkgPSBBcnJheS5pc0FycmF5KCByb3dzICkgPyByb3dzIDogWyByb3dzIF07XG5cdGNvbnN0IHJvdyA9IHVzZVJlc3BvbnNpdmVWYWx1ZSggcm93c0FzQXJyYXkgKTtcblxuXHRjb25zdCBncmlkVGVtcGxhdGVDb2x1bW5zID1cblx0XHR0ZW1wbGF0ZUNvbHVtbnMgfHwgKCAhISBjb2x1bW5zICYmIGByZXBlYXQoICR7IGNvbHVtbiB9LCAxZnIgKWAgKTtcblx0Y29uc3QgZ3JpZFRlbXBsYXRlUm93cyA9XG5cdFx0dGVtcGxhdGVSb3dzIHx8ICggISEgcm93cyAmJiBgcmVwZWF0KCAkeyByb3cgfSwgMWZyIClgICk7XG5cblx0Y29uc3QgY3ggPSB1c2VDeCgpO1xuXG5cdGNvbnN0IGNsYXNzZXMgPSB1c2VNZW1vKCAoKSA9PiB7XG5cdFx0Y29uc3QgYWxpZ25tZW50UHJvcHMgPSBnZXRBbGlnbm1lbnRQcm9wcyggYWxpZ25tZW50ICk7XG5cblx0XHRjb25zdCBncmlkQ2xhc3NlcyA9IGNzcygge1xuXHRcdFx0YWxpZ25JdGVtczogYWxpZ24sXG5cdFx0XHRkaXNwbGF5OiBpc0lubGluZSA/ICdpbmxpbmUtZ3JpZCcgOiAnZ3JpZCcsXG5cdFx0XHRnYXA6IGBjYWxjKCAkeyBDT05GSUcuZ3JpZEJhc2UgfSAqICR7IGdhcCB9IClgLFxuXHRcdFx0Z3JpZFRlbXBsYXRlQ29sdW1uczogZ3JpZFRlbXBsYXRlQ29sdW1ucyB8fCB1bmRlZmluZWQsXG5cdFx0XHRncmlkVGVtcGxhdGVSb3dzOiBncmlkVGVtcGxhdGVSb3dzIHx8IHVuZGVmaW5lZCxcblx0XHRcdGdyaWRSb3dHYXA6IHJvd0dhcCxcblx0XHRcdGdyaWRDb2x1bW5HYXA6IGNvbHVtbkdhcCxcblx0XHRcdGp1c3RpZnlDb250ZW50OiBqdXN0aWZ5LFxuXHRcdFx0dmVydGljYWxBbGlnbjogaXNJbmxpbmUgPyAnbWlkZGxlJyA6IHVuZGVmaW5lZCxcblx0XHRcdC4uLmFsaWdubWVudFByb3BzLFxuXHRcdH0gKTtcblxuXHRcdHJldHVybiBjeCggZ3JpZENsYXNzZXMsIGNsYXNzTmFtZSApO1xuXHR9LCBbXG5cdFx0YWxpZ24sXG5cdFx0YWxpZ25tZW50LFxuXHRcdGNsYXNzTmFtZSxcblx0XHRjb2x1bW5HYXAsXG5cdFx0Y3gsXG5cdFx0Z2FwLFxuXHRcdGdyaWRUZW1wbGF0ZUNvbHVtbnMsXG5cdFx0Z3JpZFRlbXBsYXRlUm93cyxcblx0XHRpc0lubGluZSxcblx0XHRqdXN0aWZ5LFxuXHRcdHJvd0dhcCxcblx0XSApO1xuXG5cdHJldHVybiB7IC4uLm90aGVyUHJvcHMsIGNsYXNzTmFtZTogY2xhc3NlcyB9O1xufVxuIl19 */");
|
|
8613
|
+
return cx(gridClasses, className);
|
|
8496
8614
|
}, [
|
|
8497
8615
|
align,
|
|
8498
8616
|
alignment,
|
|
@@ -8512,9 +8630,9 @@ function useGrid(props) {
|
|
|
8512
8630
|
};
|
|
8513
8631
|
}
|
|
8514
8632
|
//#endregion
|
|
8515
|
-
//#region ../../../node_modules/.pnpm/@wordpress+components@
|
|
8633
|
+
//#region ../../../node_modules/.pnpm/@wordpress+components@37.0.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/grid/component.mjs
|
|
8516
8634
|
function UnconnectedGrid(props, forwardedRef) {
|
|
8517
|
-
return /* @__PURE__ */ jsx(component_default$
|
|
8635
|
+
return /* @__PURE__ */ jsx(component_default$2, {
|
|
8518
8636
|
...useGrid(props),
|
|
8519
8637
|
ref: forwardedRef
|
|
8520
8638
|
});
|
|
@@ -8578,6 +8696,8 @@ var leaderboard_chart_module_default = {
|
|
|
8578
8696
|
"bar--animated": "a8ccharts-GovfoW-bar--animated",
|
|
8579
8697
|
"barWithLabelContainer": "a8ccharts-GovfoW-barWithLabelContainer",
|
|
8580
8698
|
"chevron": "a8ccharts-GovfoW-chevron",
|
|
8699
|
+
"deltaPlaceholder": "a8ccharts-GovfoW-deltaPlaceholder",
|
|
8700
|
+
"deltaValue": "a8ccharts-GovfoW-deltaValue",
|
|
8581
8701
|
"emptyState": "a8ccharts-GovfoW-emptyState",
|
|
8582
8702
|
"interactiveRow": "a8ccharts-GovfoW-interactiveRow",
|
|
8583
8703
|
"is-overlay": "a8ccharts-GovfoW-is-overlay",
|
|
@@ -8628,30 +8748,34 @@ const defaultDeltaFormatter = (value) => {
|
|
|
8628
8748
|
* @return A CSS width value.
|
|
8629
8749
|
*/
|
|
8630
8750
|
const getBarWidth = (share) => `calc(${share}% - var(--a8c--charts--leaderboard--bar--hover-inset, 0px) * ${share} / 100)`;
|
|
8751
|
+
const hasComparisonValue = (entry) => entry.previousValue != null && entry.previousShare != null && entry.delta != null;
|
|
8631
8752
|
const BarLabel = ({ label }) => /* @__PURE__ */ jsx(Fragment$1, { children: typeof label === "string" ? /* @__PURE__ */ jsx(Text$1, {
|
|
8632
8753
|
className: leaderboard_chart_module_default.label,
|
|
8633
8754
|
children: label
|
|
8634
8755
|
}) : label });
|
|
8635
|
-
const BarWithLabel = ({ entry, withComparison, withOverlayLabel, primaryColor, secondaryColor, animation, isPrimaryVisible = true, isComparisonVisible = true }) =>
|
|
8636
|
-
|
|
8637
|
-
|
|
8638
|
-
|
|
8639
|
-
|
|
8640
|
-
|
|
8641
|
-
|
|
8642
|
-
|
|
8643
|
-
|
|
8644
|
-
|
|
8645
|
-
|
|
8646
|
-
|
|
8647
|
-
|
|
8648
|
-
|
|
8649
|
-
|
|
8650
|
-
|
|
8651
|
-
|
|
8652
|
-
|
|
8653
|
-
|
|
8654
|
-
})
|
|
8756
|
+
const BarWithLabel = ({ entry, withComparison, withOverlayLabel, primaryColor, secondaryColor, animation, isPrimaryVisible = true, isComparisonVisible = true }) => {
|
|
8757
|
+
const showComparisonBar = withComparison && !withOverlayLabel && isComparisonVisible;
|
|
8758
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
8759
|
+
className: clsx(leaderboard_chart_module_default.barWithLabelContainer, { [leaderboard_chart_module_default["is-overlay"]]: withOverlayLabel }),
|
|
8760
|
+
children: [
|
|
8761
|
+
/* @__PURE__ */ jsx(BarLabel, { label: entry.label }),
|
|
8762
|
+
isPrimaryVisible && /* @__PURE__ */ jsx("div", {
|
|
8763
|
+
className: clsx(leaderboard_chart_module_default.bar, { [leaderboard_chart_module_default["bar--animated"]]: animation }),
|
|
8764
|
+
style: {
|
|
8765
|
+
width: getBarWidth(entry.currentShare),
|
|
8766
|
+
backgroundColor: primaryColor
|
|
8767
|
+
}
|
|
8768
|
+
}),
|
|
8769
|
+
showComparisonBar && hasComparisonValue(entry) && /* @__PURE__ */ jsx("div", {
|
|
8770
|
+
className: clsx(leaderboard_chart_module_default.bar, { [leaderboard_chart_module_default["bar--animated"]]: animation }),
|
|
8771
|
+
style: {
|
|
8772
|
+
width: getBarWidth(entry.previousShare),
|
|
8773
|
+
backgroundColor: secondaryColor
|
|
8774
|
+
}
|
|
8775
|
+
})
|
|
8776
|
+
]
|
|
8777
|
+
});
|
|
8778
|
+
};
|
|
8655
8779
|
/**
|
|
8656
8780
|
* LeaderboardChart component displays a ranked list of data with progress bars
|
|
8657
8781
|
* and optional comparison values.
|
|
@@ -8809,7 +8933,12 @@ const LeaderboardChartInternal = ({ data, chartId: providedChartId, width: propW
|
|
|
8809
8933
|
rowGap,
|
|
8810
8934
|
columnGap,
|
|
8811
8935
|
children: data.map((entry) => {
|
|
8812
|
-
const
|
|
8936
|
+
const showComparisonColumn = withComparison && isComparisonVisible;
|
|
8937
|
+
const hasDeltaValue = hasComparisonValue(entry);
|
|
8938
|
+
const showComparisonValue = showComparisonColumn && hasDeltaValue;
|
|
8939
|
+
const showComparisonPlaceholder = showComparisonColumn && !hasDeltaValue;
|
|
8940
|
+
const colorIndex = showComparisonValue ? Math.sign(entry.delta) + 1 : 1;
|
|
8941
|
+
const deltaColor = deltaColors[colorIndex];
|
|
8813
8942
|
const rowCells = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Stack, {
|
|
8814
8943
|
direction: "column",
|
|
8815
8944
|
gap: labelSpacing,
|
|
@@ -8827,10 +8956,25 @@ const LeaderboardChartInternal = ({ data, chartId: providedChartId, width: propW
|
|
|
8827
8956
|
direction: "row",
|
|
8828
8957
|
gap: "xs",
|
|
8829
8958
|
className: clsx(leaderboard_chart_module_default.valueContainer, { [leaderboard_chart_module_default.overlayLabel]: withOverlayLabel }),
|
|
8830
|
-
children: [
|
|
8831
|
-
|
|
8832
|
-
|
|
8833
|
-
|
|
8959
|
+
children: [
|
|
8960
|
+
isPrimaryVisible && /* @__PURE__ */ jsx(Text$1, { children: valueFormatter(entry.currentValue) }),
|
|
8961
|
+
showComparisonValue && /* @__PURE__ */ jsx(Text$1, {
|
|
8962
|
+
className: leaderboard_chart_module_default.deltaValue,
|
|
8963
|
+
style: { color: deltaColor },
|
|
8964
|
+
children: deltaFormatter(entry.delta)
|
|
8965
|
+
}),
|
|
8966
|
+
showComparisonPlaceholder && /* @__PURE__ */ jsxs(Text$1, {
|
|
8967
|
+
className: clsx(leaderboard_chart_module_default.deltaValue, leaderboard_chart_module_default.deltaPlaceholder),
|
|
8968
|
+
style: { color: deltaColor },
|
|
8969
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
8970
|
+
"aria-hidden": "true",
|
|
8971
|
+
children: "-"
|
|
8972
|
+
}), /* @__PURE__ */ jsx(component_default$1, {
|
|
8973
|
+
as: "span",
|
|
8974
|
+
children: __("No comparison data", "jetpack-charts")
|
|
8975
|
+
})]
|
|
8976
|
+
})
|
|
8977
|
+
]
|
|
8834
8978
|
})] });
|
|
8835
8979
|
if (entry.onClick) return /* @__PURE__ */ jsxs("button", {
|
|
8836
8980
|
type: "button",
|
|
@@ -9639,6 +9783,6 @@ function TrendIndicator({ direction, value, className, style, showIcon = true })
|
|
|
9639
9783
|
});
|
|
9640
9784
|
}
|
|
9641
9785
|
//#endregion
|
|
9642
|
-
export { AccessibleTooltip, AreaChartResponsive as AreaChart, AreaChart as AreaChartUnresponsive, BarChartResponsive as BarChart, BarChart as BarChartUnresponsive, BarListChartResponsive as BarListChart, BarListChart as BarListChartUnresponsive, BaseTooltip, ConversionFunnelChartWithProvider as ConversionFunnelChart, GeoChartResponsive as GeoChart, GeoChartWithProvider as GeoChartUnresponsive, GlobalChartsContext, GlobalChartsProvider, GlobalChartsProvider as ThemeProvider, HeatmapChartResponsive as HeatmapChart, HeatmapChart as HeatmapChartUnresponsive, LeaderboardChartResponsive as LeaderboardChart, LeaderboardChart as LeaderboardChartUnresponsive, Legend, LineChartResponsive as LineChart, LineChart as LineChartUnresponsive, PieChartResponsive as PieChart, PieChart as PieChartUnresponsive, PieSemiCircleChartResponsive as PieSemiCircleChart, PieSemiCircleChart as PieSemiCircleChartUnresponsive, Sparkline, SparklineUnresponsive, TrendIndicator, buildCalendarHeatmapData, defaultTheme, formatMetricValue, formatPercentage, getColorDistance, hexToRgba, isValidHexColor, lightenHexColor, mergeThemes, normalizeColorToHex, parseAsLocalDate, parseHslString, parseRgbString, prefersLightText, relativeLuminance, useChartLegendItems, useGlobalChartsContext, useGlobalChartsTheme, useLeaderboardLegendItems, validateHexColor };
|
|
9786
|
+
export { AccessibleTooltip, AreaChartResponsive as AreaChart, AreaChart as AreaChartUnresponsive, BarChartResponsive as BarChart, BarChart as BarChartUnresponsive, BarListChartResponsive as BarListChart, BarListChart as BarListChartUnresponsive, BaseTooltip, ConversionFunnelChartWithProvider as ConversionFunnelChart, GeoChartResponsive as GeoChart, GeoChartWithProvider as GeoChartUnresponsive, GlobalChartsContext, GlobalChartsProvider, GlobalChartsProvider as ThemeProvider, HeatmapChartResponsive as HeatmapChart, HeatmapChart as HeatmapChartUnresponsive, LeaderboardChartResponsive as LeaderboardChart, LeaderboardChart as LeaderboardChartUnresponsive, Legend, LineChartResponsive as LineChart, LineChart as LineChartUnresponsive, PieChartResponsive as PieChart, PieChart as PieChartUnresponsive, PieSemiCircleChartResponsive as PieSemiCircleChart, PieSemiCircleChart as PieSemiCircleChartUnresponsive, Sparkline, SparklineUnresponsive, TrendIndicator, buildCalendarHeatmapData, defaultTheme, formatMetricValue, formatPercentage, getColorDistance, hexToRgba, isValidHexColor, lightenHexColor, mergeThemes, mixHexColors, normalizeColorToHex, parseAsLocalDate, parseHslString, parseRgbString, prefersLightText, relativeLuminance, useChartLegendItems, useGlobalChartsContext, useGlobalChartsTheme, useLeaderboardLegendItems, validateHexColor };
|
|
9643
9787
|
|
|
9644
9788
|
//# sourceMappingURL=index.js.map
|