@automattic/charts 4.12.0 → 4.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -29
- package/TOKENS.md +3 -0
- package/dist/index.cjs +733 -2203
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +42 -13
- package/dist/index.d.cts +41 -125
- package/dist/index.d.ts +41 -125
- package/dist/index.js +756 -1881
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
- package/src/charts/area-chart/area-chart.tsx +16 -6
- package/src/charts/area-chart/test/area-chart.test.tsx +42 -9
- package/src/charts/bar-chart/bar-chart.tsx +17 -12
- package/src/charts/bar-chart/private/index.ts +1 -1
- package/src/charts/bar-chart/private/slot-tooltip-members.tsx +4 -5
- package/src/charts/bar-chart/private/use-bar-stops.ts +1 -3
- package/src/charts/bar-chart/private/use-overlap-slots.ts +35 -16
- package/src/charts/bar-chart/test/bar-chart.test.tsx +115 -0
- package/src/charts/conversion-funnel-chart/conversion-funnel-chart.module.scss +24 -11
- package/src/charts/conversion-funnel-chart/conversion-funnel-chart.tsx +235 -182
- package/src/charts/conversion-funnel-chart/index.ts +2 -0
- package/src/charts/conversion-funnel-chart/private/index.ts +1 -0
- package/src/charts/conversion-funnel-chart/private/use-funnel-selection.ts +9 -47
- package/src/charts/conversion-funnel-chart/private/use-roving-step-focus.ts +83 -0
- package/src/charts/conversion-funnel-chart/test/conversion-funnel-chart.test.tsx +312 -92
- package/src/charts/conversion-funnel-chart/test/use-funnel-selection.test.ts +23 -188
- package/src/charts/conversion-funnel-chart/types.ts +22 -0
- package/src/charts/leaderboard-chart/leaderboard-chart.module.scss +42 -2
- package/src/charts/leaderboard-chart/leaderboard-chart.tsx +124 -36
- package/src/charts/leaderboard-chart/private/resolve-leaderboard-entries.ts +53 -0
- package/src/charts/leaderboard-chart/test/leaderboard-chart.test.tsx +88 -0
- package/src/charts/leaderboard-chart/test/resolve-leaderboard-entries.test.ts +146 -0
- package/src/charts/leaderboard-chart/types.ts +6 -0
- package/src/charts/line-chart/line-chart.tsx +10 -8
- package/src/charts/line-chart/test/line-chart.test.tsx +75 -0
- package/src/components/legend/private/base-legend.tsx +13 -8
- package/src/components/legend/test/legend.test.tsx +125 -0
- package/src/components/legend/types.ts +9 -1
- package/src/components/tooltip/private/at-nearest-date.ts +49 -0
- package/src/components/tooltip/private/keyboard-stops.ts +67 -0
- package/src/components/tooltip/private/xy-chart-tooltip-overlay.tsx +10 -2
- package/src/components/tooltip/test/keyboard-stops.test.ts +36 -0
- package/src/components/tooltip/test/xy-chart-tooltip.test.tsx +135 -1
- package/src/components/tooltip/xy-chart-tooltip.tsx +8 -12
- package/src/index.ts +2 -0
- package/src/styles/chart-scope.scss +1 -0
- package/src/types.ts +5 -6
package/dist/index.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { getStringWidth as getStringWidth$1 } from "./visx/text/index.js";
|
|
2
2
|
import { formatNumber, formatNumberCompact } from "@automattic/number-formatters";
|
|
3
3
|
import { AnimatedAreaSeries, AnimatedAreaStack, AreaSeries, Axis, BarGroup, BarSeries, DataContext, GlyphSeries, Grid, TooltipContext, XYChart, buildChartTheme, useEventEmitter } from "@visx/xychart";
|
|
4
|
-
import { __, _x, sprintf } from "@wordpress/i18n";
|
|
4
|
+
import { __, _n, _x, sprintf } from "@wordpress/i18n";
|
|
5
5
|
import clsx from "clsx";
|
|
6
|
-
import
|
|
7
|
-
import { Children, Fragment, createContext, createContext as createContext$1, createElement, forwardRef, forwardRef as forwardRef$1, isValidElement, memo, useCallback, useCallback as useCallback$1, useContext, useContext as useContext$1, useEffect, useEffect as useEffect$1, useId, useImperativeHandle, useLayoutEffect, useMemo, useMemo as useMemo$1, useRef, useRef as useRef$1, useState, useState as useState$1, version } from "react";
|
|
6
|
+
import { Children, Fragment, createContext, createContext as createContext$1, createElement, forwardRef, forwardRef as forwardRef$1, isValidElement, memo, useCallback, useContext, useContext as useContext$1, useEffect, useEffect as useEffect$1, useId, useImperativeHandle, useLayoutEffect, useMemo, useMemo as useMemo$1, useRef, useRef as useRef$1, useState, useState as useState$1, version } from "react";
|
|
8
7
|
import { differenceInHours, differenceInYears, isValid, parse, parseISO } from "date-fns";
|
|
9
8
|
import { tzOffset } from "@date-fns/tz";
|
|
10
9
|
import { Text, getStringWidth } from "@visx/text";
|
|
@@ -26,11 +25,9 @@ import { bisector } from "@visx/vendor/d3-array";
|
|
|
26
25
|
import { PatternCircles, PatternHexagons, PatternLines, PatternWaves } from "@visx/pattern";
|
|
27
26
|
import { Chart } from "react-google-charts";
|
|
28
27
|
import DOMPurify from "dompurify";
|
|
29
|
-
import { __assign } from "tslib";
|
|
30
|
-
import "@babel/runtime/helpers/esm/extends";
|
|
31
28
|
import { Icon, chevronRight } from "@wordpress/icons";
|
|
32
29
|
import { arc, pie } from "@visx/shape";
|
|
33
|
-
|
|
30
|
+
// \0rolldown/runtime.js
|
|
34
31
|
var __create = Object.create;
|
|
35
32
|
var __defProp = Object.defineProperty;
|
|
36
33
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -52,26 +49,22 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
52
49
|
value: mod,
|
|
53
50
|
enumerable: true
|
|
54
51
|
}) : target, mod));
|
|
55
|
-
|
|
56
|
-
//#region src/charts/private/chart-instance-context/chart-instance-context.ts
|
|
52
|
+
// src/charts/private/chart-instance-context/chart-instance-context.ts
|
|
57
53
|
const ChartInstanceContext = createContext(null);
|
|
58
|
-
|
|
59
|
-
//#region src/charts/private/chart-instance-context/use-chart-instance-context.ts
|
|
54
|
+
// src/charts/private/chart-instance-context/use-chart-instance-context.ts
|
|
60
55
|
const useChartInstanceContext = () => {
|
|
61
56
|
const context = useContext(ChartInstanceContext);
|
|
62
57
|
if (!context) throw new Error("useChartInstanceContext must be used within a Chart component");
|
|
63
58
|
return context;
|
|
64
59
|
};
|
|
65
|
-
|
|
66
|
-
//#region src/styles/chart-scope-class.ts
|
|
60
|
+
// src/styles/chart-scope-class.ts
|
|
67
61
|
/**
|
|
68
62
|
* Stable class that carries the `--a8c-charts-*` catalog. Applied to the `GlobalChartsProvider` wrapper, to portal-rendered surfaces (which sit outside the provider tree), and to standalone components when no provider is above them.
|
|
69
63
|
*
|
|
70
64
|
* Deliberately unhashed: consumers are documented as being able to target it to override a token on the provider element.
|
|
71
65
|
*/
|
|
72
66
|
const CHART_SCOPE_CLASS = "a8c-charts-scope";
|
|
73
|
-
|
|
74
|
-
//#region src/utils/create-composition.ts
|
|
67
|
+
// src/utils/create-composition.ts
|
|
75
68
|
/**
|
|
76
69
|
* Utility function to create chart components with composition API.
|
|
77
70
|
*
|
|
@@ -85,8 +78,7 @@ const CHART_SCOPE_CLASS = "a8c-charts-scope";
|
|
|
85
78
|
function attachSubComponents(Chart, subComponents) {
|
|
86
79
|
return Object.assign(Chart, subComponents);
|
|
87
80
|
}
|
|
88
|
-
|
|
89
|
-
//#region src/utils/warn-once.ts
|
|
81
|
+
// src/utils/warn-once.ts
|
|
90
82
|
const warned = /* @__PURE__ */ new Set();
|
|
91
83
|
/**
|
|
92
84
|
* Warns about a host-supplied value once per process, and never in production.
|
|
@@ -99,8 +91,7 @@ const warnOnce = (key, message) => {
|
|
|
99
91
|
warned.add(key);
|
|
100
92
|
console.warn(`[Charts] ${message}`);
|
|
101
93
|
};
|
|
102
|
-
|
|
103
|
-
//#region src/utils/date-parsing.ts
|
|
94
|
+
// src/utils/date-parsing.ts
|
|
104
95
|
/**
|
|
105
96
|
* @file Date parsing: a naive string is dated in a supplied IANA zone, or the runtime's own
|
|
106
97
|
*
|
|
@@ -195,8 +186,7 @@ const parseAsLocalDate = (dateString, timeZone) => {
|
|
|
195
186
|
}
|
|
196
187
|
return /* @__PURE__ */ new Date(NaN);
|
|
197
188
|
};
|
|
198
|
-
|
|
199
|
-
//#region src/utils/bucket-info.ts
|
|
189
|
+
// src/utils/bucket-info.ts
|
|
200
190
|
const getInstant = (point) => {
|
|
201
191
|
if (!point) return;
|
|
202
192
|
if ("date" in point && point.date) return point.date.getTime();
|
|
@@ -228,8 +218,7 @@ const getBucketInfo = (data, tickResolution) => ({
|
|
|
228
218
|
bucket: tickResolution ?? getBucketResolution(data),
|
|
229
219
|
displayResolution: getBucketResolution(data, tickResolution)
|
|
230
220
|
});
|
|
231
|
-
|
|
232
|
-
//#region src/utils/format-metric-value.ts
|
|
221
|
+
// src/utils/format-metric-value.ts
|
|
233
222
|
/**
|
|
234
223
|
* Format a numeric metric value based on type, precision and scale.
|
|
235
224
|
* Supports currency, number and percentage, using `@automattic/number-formatters`.
|
|
@@ -278,8 +267,7 @@ const formatMetricValue = (value, type = "number", { decimals, useMultipliers =
|
|
|
278
267
|
});
|
|
279
268
|
}
|
|
280
269
|
};
|
|
281
|
-
|
|
282
|
-
//#region src/utils/format-percentage.ts
|
|
270
|
+
// src/utils/format-percentage.ts
|
|
283
271
|
/**
|
|
284
272
|
* Format a percentage value with smart decimal handling.
|
|
285
273
|
* Uses `@automattic/number-formatters` for consistent formatting.
|
|
@@ -295,8 +283,7 @@ const formatPercentage = (value) => {
|
|
|
295
283
|
maximumFractionDigits: 2
|
|
296
284
|
} });
|
|
297
285
|
};
|
|
298
|
-
|
|
299
|
-
//#region src/utils/get-edge-tick-widths.ts
|
|
286
|
+
// src/utils/get-edge-tick-widths.ts
|
|
300
287
|
/**
|
|
301
288
|
* Rendered widths of the first and last tick labels on an axis.
|
|
302
289
|
*
|
|
@@ -320,8 +307,7 @@ const getEdgeTickWidths = (ticks, formatTick, labelStyle) => {
|
|
|
320
307
|
last: getStringWidth(label(ticks[lastIndex], lastIndex), labelStyle) ?? 0
|
|
321
308
|
};
|
|
322
309
|
};
|
|
323
|
-
|
|
324
|
-
//#region src/utils/get-longest-tick-width.ts
|
|
310
|
+
// src/utils/get-longest-tick-width.ts
|
|
325
311
|
/**
|
|
326
312
|
* Returns the width of the longest tick.
|
|
327
313
|
*
|
|
@@ -335,8 +321,7 @@ const getLongestTickWidth = (ticks, formatTick, labelStyle) => {
|
|
|
335
321
|
const longestTick = formattedTicks.reduce((longest, current) => longest.length >= current.length ? longest : current, formattedTicks[0]);
|
|
336
322
|
return getStringWidth(longestTick, labelStyle);
|
|
337
323
|
};
|
|
338
|
-
|
|
339
|
-
//#region src/utils/get-styles.ts
|
|
324
|
+
// src/utils/get-styles.ts
|
|
340
325
|
/**
|
|
341
326
|
* Utility function to get consolidated line styles for a series
|
|
342
327
|
* This consolidates the logic used by both LineChart and Legend components
|
|
@@ -389,19 +374,16 @@ function getItemShapeStyles(series, index, theme, legendShape) {
|
|
|
389
374
|
...barShapeStyles
|
|
390
375
|
};
|
|
391
376
|
}
|
|
392
|
-
|
|
393
|
-
//#region src/utils/is-safari.ts
|
|
377
|
+
// src/utils/is-safari.ts
|
|
394
378
|
const isSafari = () => {
|
|
395
379
|
if (typeof navigator !== "undefined" && navigator.userAgent) return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
396
380
|
return false;
|
|
397
381
|
};
|
|
398
|
-
|
|
399
|
-
//#region src/utils/merge-themes.ts
|
|
382
|
+
// src/utils/merge-themes.ts
|
|
400
383
|
function mergeThemes(baseTheme, overrideTheme) {
|
|
401
384
|
return deepmerge(baseTheme, overrideTheme, { arrayMerge: (_destinationArray, sourceArray) => sourceArray });
|
|
402
385
|
}
|
|
403
|
-
|
|
404
|
-
//#region src/utils/color-utils.ts
|
|
386
|
+
// src/utils/color-utils.ts
|
|
405
387
|
/**
|
|
406
388
|
* Check if a value is a valid 6-digit hex color
|
|
407
389
|
* @param hex - The value to check
|
|
@@ -568,8 +550,7 @@ const prefersLightText = (backgroundHex) => {
|
|
|
568
550
|
if (!isValidHexColor(backgroundHex)) return false;
|
|
569
551
|
return relativeLuminance(backgroundHex) <= .179;
|
|
570
552
|
};
|
|
571
|
-
|
|
572
|
-
//#region src/utils/resolve-css-var.ts
|
|
553
|
+
// src/utils/resolve-css-var.ts
|
|
573
554
|
/**
|
|
574
555
|
* Pattern for valid CSS custom property names (e.g., '--my-color', '--jp-gray-10')
|
|
575
556
|
*/
|
|
@@ -666,8 +647,7 @@ function readCustomProperty(varName, styles) {
|
|
|
666
647
|
return null;
|
|
667
648
|
}
|
|
668
649
|
}
|
|
669
|
-
|
|
670
|
-
//#region src/utils/resolve-font-size.ts
|
|
650
|
+
// src/utils/resolve-font-size.ts
|
|
671
651
|
const toFontSize = (size) => Number.isFinite(size) && size >= 0 ? size : void 0;
|
|
672
652
|
/**
|
|
673
653
|
* Resolve a theme `fontSize` value into a plain number suitable for
|
|
@@ -694,8 +674,7 @@ const resolveFontSize = (val) => {
|
|
|
694
674
|
return match ? toFontSize(parseFloat(match[1])) : void 0;
|
|
695
675
|
}
|
|
696
676
|
};
|
|
697
|
-
|
|
698
|
-
//#region src/utils/date-formatting.ts
|
|
677
|
+
// src/utils/date-formatting.ts
|
|
699
678
|
const formatters = /* @__PURE__ */ new Map();
|
|
700
679
|
const getFormatter$1 = (options, { locale, timeZone }) => {
|
|
701
680
|
const key = `${locale ?? ""}|${timeZone ?? ""}|${JSON.stringify(options)}`;
|
|
@@ -794,8 +773,7 @@ const createZonedClock = (timeZone) => {
|
|
|
794
773
|
};
|
|
795
774
|
};
|
|
796
775
|
};
|
|
797
|
-
|
|
798
|
-
//#region src/providers/chart-scope/chart-scope-context.ts
|
|
776
|
+
// src/providers/chart-scope/chart-scope-context.ts
|
|
799
777
|
/**
|
|
800
778
|
* The nearest chart element, published so JS token resolution reads the same CSS cascade that paints the chart's own colours.
|
|
801
779
|
*
|
|
@@ -812,8 +790,7 @@ const seriesRole = (slot) => `--a8c-charts-color-series-${slot}`;
|
|
|
812
790
|
const SERIES_SLOT_1_FALLBACK = "#3858e9";
|
|
813
791
|
/** The catalog pointer for every slot, in slot order. */
|
|
814
792
|
const SERIES_PALETTE_POINTERS = Array.from({ length: 5 }, (_, index) => index === 0 ? `var(${seriesRole(1)}, ${SERIES_SLOT_1_FALLBACK})` : `var(${seriesRole(index + 1)})`);
|
|
815
|
-
|
|
816
|
-
//#region src/providers/chart-context/private/catalog-pointers.ts
|
|
793
|
+
// src/providers/chart-context/private/catalog-pointers.ts
|
|
817
794
|
/** Terminal literals the provider also generates from before its first read, so SSR and the first client render agree. */
|
|
818
795
|
const BACKGROUND_FALLBACK = "#ffffff";
|
|
819
796
|
const LABEL_FALLBACK = "#1e1e1e";
|
|
@@ -853,8 +830,7 @@ const ANNOTATION_POINTERS = {
|
|
|
853
830
|
radius: 5
|
|
854
831
|
}
|
|
855
832
|
};
|
|
856
|
-
|
|
857
|
-
//#region src/providers/chart-context/private/perceptual-color.ts
|
|
833
|
+
// src/providers/chart-context/private/perceptual-color.ts
|
|
858
834
|
const DEUTERANOPIA = [
|
|
859
835
|
.367322,
|
|
860
836
|
.860646,
|
|
@@ -1260,16 +1236,14 @@ const buildPaletteGenerator = (normalizedSeeds, background, labelColors) => {
|
|
|
1260
1236
|
return palette[index].hex;
|
|
1261
1237
|
};
|
|
1262
1238
|
};
|
|
1263
|
-
|
|
1264
|
-
//#region src/providers/chart-context/private/resolve-opaque-hex.ts
|
|
1239
|
+
// src/providers/chart-context/private/resolve-opaque-hex.ts
|
|
1265
1240
|
const resolveOpaqueHex = (pointer, resolve) => {
|
|
1266
1241
|
const raw = resolve(pointer);
|
|
1267
1242
|
if (!raw || color(raw)?.opacity !== 1) return null;
|
|
1268
1243
|
const hex = normalizeColorToHex(raw);
|
|
1269
1244
|
return isValidHexColor(hex) ? hex : null;
|
|
1270
1245
|
};
|
|
1271
|
-
|
|
1272
|
-
//#region src/providers/chart-context/themes.ts
|
|
1246
|
+
// src/providers/chart-context/themes.ts
|
|
1273
1247
|
/**
|
|
1274
1248
|
* Default theme configuration: the shape and spacing a consumer can override.
|
|
1275
1249
|
*
|
|
@@ -1312,8 +1286,7 @@ const defaultTheme = {
|
|
|
1312
1286
|
groupGap: 24
|
|
1313
1287
|
}
|
|
1314
1288
|
};
|
|
1315
|
-
|
|
1316
|
-
//#region src/providers/chart-context/global-charts-provider.tsx
|
|
1289
|
+
// src/providers/chart-context/global-charts-provider.tsx
|
|
1317
1290
|
const PLACEHOLDER_LABEL_COLORS = [LABEL_FALLBACK, LABEL_INVERSE_FALLBACK];
|
|
1318
1291
|
const GlobalChartsContext = createContext(null);
|
|
1319
1292
|
const GlobalChartsProvider = ({ children, theme, locale, timeZone }) => {
|
|
@@ -1494,21 +1467,18 @@ const GlobalChartsProvider = ({ children, theme, locale, timeZone }) => {
|
|
|
1494
1467
|
})
|
|
1495
1468
|
});
|
|
1496
1469
|
};
|
|
1497
|
-
|
|
1498
|
-
//#region src/providers/chart-context/hooks/use-global-charts-context.ts
|
|
1470
|
+
// src/providers/chart-context/hooks/use-global-charts-context.ts
|
|
1499
1471
|
const useGlobalChartsContext = () => {
|
|
1500
1472
|
const context = useContext(GlobalChartsContext);
|
|
1501
1473
|
if (!context) throw new Error("useGlobalChartsContext must be used within a GlobalChartsProvider");
|
|
1502
1474
|
return context;
|
|
1503
1475
|
};
|
|
1504
|
-
|
|
1505
|
-
//#region src/providers/chart-context/hooks/use-chart-id.ts
|
|
1476
|
+
// src/providers/chart-context/hooks/use-chart-id.ts
|
|
1506
1477
|
const useChartId = (providedId) => {
|
|
1507
1478
|
const generatedId = useId();
|
|
1508
1479
|
return providedId || generatedId;
|
|
1509
1480
|
};
|
|
1510
|
-
|
|
1511
|
-
//#region src/hooks/use-deep-memo.ts
|
|
1481
|
+
// src/hooks/use-deep-memo.ts
|
|
1512
1482
|
var import_fast_deep_equal = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1513
1483
|
module.exports = function equal(a, b) {
|
|
1514
1484
|
if (a === b) return true;
|
|
@@ -1549,16 +1519,14 @@ const useDeepMemo = (value) => {
|
|
|
1549
1519
|
if (!(0, import_fast_deep_equal.default)(ref.current, value)) ref.current = value;
|
|
1550
1520
|
return ref.current;
|
|
1551
1521
|
};
|
|
1552
|
-
|
|
1553
|
-
//#region src/providers/chart-scope/use-chart-scope-element.ts
|
|
1522
|
+
// src/providers/chart-scope/use-chart-scope-element.ts
|
|
1554
1523
|
/**
|
|
1555
1524
|
* Returns the nearest chart scope element, or `null` when rendered outside any scope (and during SSR, before the ref is attached).
|
|
1556
1525
|
*
|
|
1557
1526
|
* @return {HTMLElement | null} The nearest chart scope element, or `null`.
|
|
1558
1527
|
*/
|
|
1559
1528
|
const useChartScopeElement = () => useContext(ChartScopeContext);
|
|
1560
|
-
|
|
1561
|
-
//#region src/providers/chart-scope/use-standalone-scope-class.ts
|
|
1529
|
+
// src/providers/chart-scope/use-standalone-scope-class.ts
|
|
1562
1530
|
/**
|
|
1563
1531
|
* Returns the catalog class when there is no `GlobalChartsProvider` above this component, and `undefined` when there is.
|
|
1564
1532
|
*
|
|
@@ -1567,8 +1535,7 @@ const useChartScopeElement = () => useContext(ChartScopeContext);
|
|
|
1567
1535
|
* @return The scope class name, or undefined when a provider is present.
|
|
1568
1536
|
*/
|
|
1569
1537
|
const useStandaloneScopeClass = () => useContext(GlobalChartsContext) ? void 0 : CHART_SCOPE_CLASS;
|
|
1570
|
-
|
|
1571
|
-
//#region src/hooks/use-xychart-theme.ts
|
|
1538
|
+
// src/hooks/use-xychart-theme.ts
|
|
1572
1539
|
const STARTS_LIKE_A_NUMBER = /^[+-]?[\d.]/;
|
|
1573
1540
|
const NON_NEGATIVE_CSS_NUMBER = /^\+?(?:\d*\.)?\d+(?:e[+-]?\d+)?(?:[a-z]+|%)?$/i;
|
|
1574
1541
|
const isRenderableFontSize = (fontSize) => {
|
|
@@ -1624,8 +1591,7 @@ const useXYChartTheme = (data) => {
|
|
|
1624
1591
|
scopeElement
|
|
1625
1592
|
]);
|
|
1626
1593
|
};
|
|
1627
|
-
|
|
1628
|
-
//#region src/providers/chart-context/hooks/use-chart-formatting.ts
|
|
1594
|
+
// src/providers/chart-context/hooks/use-chart-formatting.ts
|
|
1629
1595
|
const RUNTIME_FORMATTING = {};
|
|
1630
1596
|
/**
|
|
1631
1597
|
* The locale and time zone dates are rendered in, as set on `GlobalChartsProvider`.
|
|
@@ -1639,8 +1605,7 @@ const RUNTIME_FORMATTING = {};
|
|
|
1639
1605
|
const useChartFormatting = () => {
|
|
1640
1606
|
return useContext(GlobalChartsContext)?.formatting ?? RUNTIME_FORMATTING;
|
|
1641
1607
|
};
|
|
1642
|
-
|
|
1643
|
-
//#region src/hooks/use-chart-data-transform.ts
|
|
1608
|
+
// src/hooks/use-chart-data-transform.ts
|
|
1644
1609
|
/**
|
|
1645
1610
|
* Hook that transforms and sorts chart data, handling date parsing and sorting
|
|
1646
1611
|
*
|
|
@@ -1675,8 +1640,7 @@ const useChartDataTransform = (data) => {
|
|
|
1675
1640
|
}));
|
|
1676
1641
|
}, [data, timeZone]);
|
|
1677
1642
|
};
|
|
1678
|
-
|
|
1679
|
-
//#region src/hooks/use-chart-margin.tsx
|
|
1643
|
+
// src/hooks/use-chart-margin.tsx
|
|
1680
1644
|
/**
|
|
1681
1645
|
* Base top margin used when no dynamic adjustments are necessary.
|
|
1682
1646
|
*/
|
|
@@ -1798,8 +1762,7 @@ const useChartMargin = (height, options, data, theme, horizontal = false) => {
|
|
|
1798
1762
|
yTicks
|
|
1799
1763
|
]);
|
|
1800
1764
|
};
|
|
1801
|
-
|
|
1802
|
-
//#region src/hooks/use-element-size.ts
|
|
1765
|
+
// src/hooks/use-element-size.ts
|
|
1803
1766
|
/**
|
|
1804
1767
|
* Hook to measure the width and height of a DOM element.
|
|
1805
1768
|
* Returns a ref callback to attach to the element and the current dimensions in pixels.
|
|
@@ -1836,8 +1799,7 @@ function useElementSize({ initialWidth = 0, initialHeight = 0 } = {}) {
|
|
|
1836
1799
|
height
|
|
1837
1800
|
];
|
|
1838
1801
|
}
|
|
1839
|
-
|
|
1840
|
-
//#region src/hooks/use-text-truncation.ts
|
|
1802
|
+
// src/hooks/use-text-truncation.ts
|
|
1841
1803
|
/**
|
|
1842
1804
|
* Hook to detect if text content is truncated within its container.
|
|
1843
1805
|
* Uses ResizeObserver to dynamically track changes in element size.
|
|
@@ -1878,8 +1840,7 @@ function useTextTruncation(enabled = true) {
|
|
|
1878
1840
|
} else setIsTruncated(false);
|
|
1879
1841
|
}, [enabled]), isTruncated];
|
|
1880
1842
|
}
|
|
1881
|
-
|
|
1882
|
-
//#region src/hooks/use-zero-value-display.ts
|
|
1843
|
+
// src/hooks/use-zero-value-display.ts
|
|
1883
1844
|
/**
|
|
1884
1845
|
* Minimum pixel size for near-zero bars (non-zero values that would render too small).
|
|
1885
1846
|
* Using 3px to be visible but not misleading - larger values might look like actual data.
|
|
@@ -1919,8 +1880,7 @@ const useZeroValueDisplay = (data, options = { enabled: false }) => {
|
|
|
1919
1880
|
valueAxisLength
|
|
1920
1881
|
]);
|
|
1921
1882
|
};
|
|
1922
|
-
|
|
1923
|
-
//#region src/hooks/use-data-with-percentages.ts
|
|
1883
|
+
// src/hooks/use-data-with-percentages.ts
|
|
1924
1884
|
/**
|
|
1925
1885
|
* Hook to calculate percentages from values for chart data.
|
|
1926
1886
|
* Ensures percentages are always derived from values (single source of truth).
|
|
@@ -1937,8 +1897,7 @@ const useDataWithPercentages = (data) => {
|
|
|
1937
1897
|
}));
|
|
1938
1898
|
}, [data]);
|
|
1939
1899
|
};
|
|
1940
|
-
|
|
1941
|
-
//#region src/hooks/use-legend-visibility-data.ts
|
|
1900
|
+
// src/hooks/use-legend-visibility-data.ts
|
|
1942
1901
|
/**
|
|
1943
1902
|
* Custom hook to filter and recalculate chart data based on series visibility.
|
|
1944
1903
|
*
|
|
@@ -2010,8 +1969,7 @@ const useLegendVisibilityData = ({ data, chartId, isSeriesVisible }) => {
|
|
|
2010
1969
|
])
|
|
2011
1970
|
};
|
|
2012
1971
|
};
|
|
2013
|
-
|
|
2014
|
-
//#region src/hooks/use-prefers-reduced-motion.ts
|
|
1972
|
+
// src/hooks/use-prefers-reduced-motion.ts
|
|
2015
1973
|
const QUERY = "(prefers-reduced-motion: no-preference)";
|
|
2016
1974
|
const getInitialState = () => !window.matchMedia(QUERY).matches;
|
|
2017
1975
|
/**
|
|
@@ -2032,11 +1990,9 @@ function usePrefersReducedMotion() {
|
|
|
2032
1990
|
}, []);
|
|
2033
1991
|
return prefersReducedMotion;
|
|
2034
1992
|
}
|
|
2035
|
-
|
|
2036
|
-
//#region src/hooks/use-isomorphic-layout-effect.ts
|
|
1993
|
+
// src/hooks/use-isomorphic-layout-effect.ts
|
|
2037
1994
|
const useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
|
2038
|
-
|
|
2039
|
-
//#region src/providers/chart-context/hooks/use-chart-registration.ts
|
|
1995
|
+
// src/providers/chart-context/hooks/use-chart-registration.ts
|
|
2040
1996
|
const useChartRegistration = ({ chartId, legendItems, chartType, isDataValid, metadata }) => {
|
|
2041
1997
|
const { registerChart, unregisterChart } = useGlobalChartsContext();
|
|
2042
1998
|
const stableLegendItems = useDeepMemo(legendItems);
|
|
@@ -2058,8 +2014,7 @@ const useChartRegistration = ({ chartId, legendItems, chartType, isDataValid, me
|
|
|
2058
2014
|
isDataValid
|
|
2059
2015
|
]);
|
|
2060
2016
|
};
|
|
2061
|
-
|
|
2062
|
-
//#region src/providers/chart-context/hooks/use-global-charts-theme.ts
|
|
2017
|
+
// src/providers/chart-context/hooks/use-global-charts-theme.ts
|
|
2063
2018
|
/**
|
|
2064
2019
|
* Hook to get the global chart theme from GlobalChartsProvider
|
|
2065
2020
|
*
|
|
@@ -2068,8 +2023,7 @@ const useChartRegistration = ({ chartId, legendItems, chartType, isDataValid, me
|
|
|
2068
2023
|
const useGlobalChartsTheme = () => {
|
|
2069
2024
|
return useContext(GlobalChartsContext)?.theme ?? defaultTheme;
|
|
2070
2025
|
};
|
|
2071
|
-
|
|
2072
|
-
//#region src/components/legend/utils/value-or-identity.ts
|
|
2026
|
+
// src/components/legend/utils/value-or-identity.ts
|
|
2073
2027
|
/**
|
|
2074
2028
|
* Returns an object's value if defined, or the object.
|
|
2075
2029
|
* @param _ - The object to return the value of.
|
|
@@ -2087,8 +2041,7 @@ function valueOrIdentity(_) {
|
|
|
2087
2041
|
function valueOrIdentityString(_) {
|
|
2088
2042
|
return String(valueOrIdentity(_));
|
|
2089
2043
|
}
|
|
2090
|
-
|
|
2091
|
-
//#region src/components/legend/private/base-legend.module.scss
|
|
2044
|
+
// src/components/legend/private/base-legend.module.scss
|
|
2092
2045
|
var base_legend_module_default = {
|
|
2093
2046
|
"legend": "a8ccharts-04TogW-legend",
|
|
2094
2047
|
"legend--horizontal": "a8ccharts-04TogW-legend--horizontal",
|
|
@@ -2100,8 +2053,7 @@ var base_legend_module_default = {
|
|
|
2100
2053
|
"legend-item-text--wrap": "a8ccharts-04TogW-legend-item-text--wrap",
|
|
2101
2054
|
"legend-item-value": "a8ccharts-04TogW-legend-item-value"
|
|
2102
2055
|
};
|
|
2103
|
-
|
|
2104
|
-
//#region src/components/legend/private/base-legend.tsx
|
|
2056
|
+
// src/components/legend/private/base-legend.tsx
|
|
2105
2057
|
const ALIGNMENT_TO_FLEX = {
|
|
2106
2058
|
start: "flex-start",
|
|
2107
2059
|
center: "center",
|
|
@@ -2170,16 +2122,17 @@ const BaseLegend = forwardRef(({ items: allItems, className, orientation = "hori
|
|
|
2170
2122
|
chartId,
|
|
2171
2123
|
context
|
|
2172
2124
|
]);
|
|
2173
|
-
const createClickHandler = useCallback((seriesLabels, itemInteractive) => {
|
|
2125
|
+
const createClickHandler = useCallback((seriesLabels, itemInteractive, onToggle) => {
|
|
2174
2126
|
if (!itemInteractive) return;
|
|
2175
|
-
return () => handleLegendClick(seriesLabels);
|
|
2127
|
+
return onToggle ? () => onToggle() : () => handleLegendClick(seriesLabels);
|
|
2176
2128
|
}, [handleLegendClick]);
|
|
2177
|
-
const createKeyDownHandler = useCallback((seriesLabels, itemInteractive) => {
|
|
2129
|
+
const createKeyDownHandler = useCallback((seriesLabels, itemInteractive, onToggle) => {
|
|
2178
2130
|
if (!itemInteractive) return;
|
|
2131
|
+
const toggle = onToggle ?? (() => handleLegendClick(seriesLabels));
|
|
2179
2132
|
return (event) => {
|
|
2180
2133
|
if (event.key === "Enter" || event.key === " ") {
|
|
2181
2134
|
event.preventDefault();
|
|
2182
|
-
|
|
2135
|
+
if (!event.repeat) toggle();
|
|
2183
2136
|
}
|
|
2184
2137
|
};
|
|
2185
2138
|
}, [handleLegendClick]);
|
|
@@ -2203,10 +2156,11 @@ const BaseLegend = forwardRef(({ items: allItems, className, orientation = "hori
|
|
|
2203
2156
|
children: labels.map((label, i) => {
|
|
2204
2157
|
const matchedItem = items[i];
|
|
2205
2158
|
const seriesLabels = matchedItem?.seriesLabels?.length ? matchedItem.seriesLabels : [label.text];
|
|
2206
|
-
const visible = matchedItem?.interactive === false || isSeriesVisible(seriesLabels[0]);
|
|
2207
2159
|
const itemInteractive = interactive && matchedItem?.interactive !== false;
|
|
2208
|
-
const
|
|
2209
|
-
const
|
|
2160
|
+
const onToggle = itemInteractive ? matchedItem?.onToggle : void 0;
|
|
2161
|
+
const visible = matchedItem?.onToggle ? matchedItem.pressed : matchedItem?.interactive === false || isSeriesVisible(seriesLabels[0]);
|
|
2162
|
+
const handleClick = createClickHandler(seriesLabels, itemInteractive, onToggle);
|
|
2163
|
+
const handleKeyDown = createKeyDownHandler(seriesLabels, itemInteractive, onToggle);
|
|
2210
2164
|
return /* @__PURE__ */ jsxs(LegendItem, {
|
|
2211
2165
|
className: clsx("visx-legend-item", base_legend_module_default["legend-item"], itemInteractive && base_legend_module_default["legend-item--interactive"], !visible && base_legend_module_default["legend-item--inactive"], itemClassName),
|
|
2212
2166
|
margin: itemMargin,
|
|
@@ -2266,8 +2220,7 @@ const BaseLegend = forwardRef(({ items: allItems, className, orientation = "hori
|
|
|
2266
2220
|
})
|
|
2267
2221
|
});
|
|
2268
2222
|
});
|
|
2269
|
-
|
|
2270
|
-
//#region src/components/legend/legend.tsx
|
|
2223
|
+
// src/components/legend/legend.tsx
|
|
2271
2224
|
const defaultShapeByChartType = {
|
|
2272
2225
|
area: "rect",
|
|
2273
2226
|
line: "line",
|
|
@@ -2293,8 +2246,7 @@ const Legend = forwardRef(({ chartId, items, shape, ...props }, ref) => {
|
|
|
2293
2246
|
chartId: contextChartId
|
|
2294
2247
|
});
|
|
2295
2248
|
});
|
|
2296
|
-
|
|
2297
|
-
//#region src/components/legend/hooks/use-chart-legend-items.ts
|
|
2249
|
+
// src/components/legend/hooks/use-chart-legend-items.ts
|
|
2298
2250
|
/**
|
|
2299
2251
|
* Wraps `getElementStyles` so a swatch takes the color given for its series.
|
|
2300
2252
|
* @param getElementStyles - Function to get element styles
|
|
@@ -2550,15 +2502,13 @@ function useChartLegendItems(data, options = {}, legendShape) {
|
|
|
2550
2502
|
legendShape
|
|
2551
2503
|
]);
|
|
2552
2504
|
}
|
|
2553
|
-
|
|
2554
|
-
//#region src/components/tooltip/private/label-value-content.tsx
|
|
2505
|
+
// src/components/tooltip/private/label-value-content.tsx
|
|
2555
2506
|
const LabelValueContent = ({ data }) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
2556
2507
|
data.label,
|
|
2557
2508
|
": ",
|
|
2558
2509
|
data.valueDisplay || formatNumber(data.value)
|
|
2559
2510
|
] });
|
|
2560
|
-
|
|
2561
|
-
//#region src/components/tooltip/private/tooltip-theme.tsx
|
|
2511
|
+
// src/components/tooltip/private/tooltip-theme.tsx
|
|
2562
2512
|
const DEFAULT_SURFACE = "#1e1e1e";
|
|
2563
2513
|
const TOOLTIP_SURFACE = `var(--a8c-charts-color-tooltip-surface, ${DEFAULT_SURFACE})`;
|
|
2564
2514
|
const toSeed = (value) => {
|
|
@@ -2581,11 +2531,9 @@ const TooltipTheme = ({ children }) => {
|
|
|
2581
2531
|
children
|
|
2582
2532
|
});
|
|
2583
2533
|
};
|
|
2584
|
-
|
|
2585
|
-
//#region src/components/tooltip/tooltip-box.module.scss
|
|
2534
|
+
// src/components/tooltip/tooltip-box.module.scss
|
|
2586
2535
|
var tooltip_box_module_default = { "surface": "a8ccharts-ddpU1W-surface" };
|
|
2587
|
-
|
|
2588
|
-
//#region src/components/tooltip/tooltip-box.tsx
|
|
2536
|
+
// src/components/tooltip/tooltip-box.tsx
|
|
2589
2537
|
/**
|
|
2590
2538
|
* The chart tooltip box: the dark surface every chart tooltip draws. It does not position itself; place it with `style` or a wrapper.
|
|
2591
2539
|
*
|
|
@@ -2605,8 +2553,7 @@ const TooltipBox = forwardRef(({ unstyled = false, role = "tooltip", className,
|
|
|
2605
2553
|
return unstyled ? box : /* @__PURE__ */ jsx(TooltipTheme, { children: box });
|
|
2606
2554
|
});
|
|
2607
2555
|
TooltipBox.displayName = "TooltipBox";
|
|
2608
|
-
|
|
2609
|
-
//#region src/components/tooltip/base-tooltip.tsx
|
|
2556
|
+
// src/components/tooltip/base-tooltip.tsx
|
|
2610
2557
|
/**
|
|
2611
2558
|
* A tooltip box with children or `label: value` content. Prefer `TooltipBox`.
|
|
2612
2559
|
*
|
|
@@ -2640,6 +2587,80 @@ const BaseTooltip = ({ data, top, left, component: Component = LabelValueContent
|
|
|
2640
2587
|
children: content
|
|
2641
2588
|
});
|
|
2642
2589
|
};
|
|
2590
|
+
// src/components/tooltip/private/keyboard-stops.ts
|
|
2591
|
+
const timeOf$1 = (point) => point?.date?.getTime();
|
|
2592
|
+
const getXPositions = (series) => {
|
|
2593
|
+
const positions = /* @__PURE__ */ new Set();
|
|
2594
|
+
for (const { data } of series) for (const point of data) {
|
|
2595
|
+
const time = timeOf$1(point);
|
|
2596
|
+
if (time !== void 0) positions.add(time);
|
|
2597
|
+
}
|
|
2598
|
+
return [...positions].sort((a, b) => a - b);
|
|
2599
|
+
};
|
|
2600
|
+
/**
|
|
2601
|
+
* Keyboard stops over the series: the sorted union of their dates, or array indexes when no point has a date.
|
|
2602
|
+
*
|
|
2603
|
+
* Once any point has a date, a series of undated points has no stop.
|
|
2604
|
+
*
|
|
2605
|
+
* @param series - The series to step through.
|
|
2606
|
+
* @return The stop count, and each series' point at a stop.
|
|
2607
|
+
*/
|
|
2608
|
+
const getKeyboardStops = (series) => {
|
|
2609
|
+
const positions = getXPositions(series);
|
|
2610
|
+
if (positions.length === 0) return {
|
|
2611
|
+
count: Math.max(0, ...series.map(({ data }) => data.length)),
|
|
2612
|
+
membersAt: (stop) => series.flatMap((s) => stop < s.data.length ? [{
|
|
2613
|
+
series: s,
|
|
2614
|
+
datum: s.data[stop],
|
|
2615
|
+
index: stop
|
|
2616
|
+
}] : [])
|
|
2617
|
+
};
|
|
2618
|
+
return {
|
|
2619
|
+
count: positions.length,
|
|
2620
|
+
membersAt: (stop) => {
|
|
2621
|
+
const time = positions[stop];
|
|
2622
|
+
if (time === void 0) return [];
|
|
2623
|
+
return series.flatMap((s) => {
|
|
2624
|
+
const index = s.data.findIndex((point) => timeOf$1(point) === time);
|
|
2625
|
+
return index === -1 ? [] : [{
|
|
2626
|
+
series: s,
|
|
2627
|
+
datum: s.data[index],
|
|
2628
|
+
index
|
|
2629
|
+
}];
|
|
2630
|
+
});
|
|
2631
|
+
}
|
|
2632
|
+
};
|
|
2633
|
+
};
|
|
2634
|
+
// src/components/tooltip/private/at-nearest-date.ts
|
|
2635
|
+
const timeOf = (datum) => datum.date?.getTime();
|
|
2636
|
+
/**
|
|
2637
|
+
* Lists every registered series at the nearest datum's date, each with its own point there.
|
|
2638
|
+
*
|
|
2639
|
+
* The pointer hands each series its own nearest point, which for a series that skips that date, or that the pointer sits nearer another date of, is a neighbor's.
|
|
2640
|
+
*
|
|
2641
|
+
* @param tooltipData - The tooltip data visx collected.
|
|
2642
|
+
* @param registry - The chart's data registry.
|
|
2643
|
+
* @return The tooltip data, unchanged when the nearest datum has no date.
|
|
2644
|
+
*/
|
|
2645
|
+
const atNearestDate = (tooltipData, registry) => {
|
|
2646
|
+
const nearest = tooltipData?.nearestDatum?.datum;
|
|
2647
|
+
const time = nearest ? timeOf(nearest) : void 0;
|
|
2648
|
+
if (!tooltipData || time === void 0) return tooltipData;
|
|
2649
|
+
const datumByKey = {};
|
|
2650
|
+
for (const { key, data } of registry?.entries() ?? []) {
|
|
2651
|
+
const index = data.findIndex((datum) => timeOf(datum) === time);
|
|
2652
|
+
if (index !== -1) datumByKey[key] = {
|
|
2653
|
+
key,
|
|
2654
|
+
index,
|
|
2655
|
+
datum: data[index]
|
|
2656
|
+
};
|
|
2657
|
+
}
|
|
2658
|
+
for (const [key, entry] of Object.entries(tooltipData.datumByKey)) if (!datumByKey[key] && timeOf(entry.datum) === time) datumByKey[key] = entry;
|
|
2659
|
+
return {
|
|
2660
|
+
...tooltipData,
|
|
2661
|
+
datumByKey
|
|
2662
|
+
};
|
|
2663
|
+
};
|
|
2643
2664
|
const POINTER_HEIGHT = 6;
|
|
2644
2665
|
const clamp = (position, min, max, size) => Math.min(Math.max(position, min), Math.max(min, max - size));
|
|
2645
2666
|
const isClipping = (element) => {
|
|
@@ -2818,8 +2839,7 @@ const BoundedTooltip = ({ left = 0, top = 0, offsetLeft = 10, offsetTop = 10, st
|
|
|
2818
2839
|
}), children]
|
|
2819
2840
|
});
|
|
2820
2841
|
};
|
|
2821
|
-
|
|
2822
|
-
//#region src/components/tooltip/private/xy-chart-tooltip-overlay.tsx
|
|
2842
|
+
// src/components/tooltip/private/xy-chart-tooltip-overlay.tsx
|
|
2823
2843
|
const CROSSHAIR_STROKE_WIDTH = 1.5;
|
|
2824
2844
|
const CROSSHAIR_PAINT_PROPERTIES = /* @__PURE__ */ new Set([
|
|
2825
2845
|
"stroke",
|
|
@@ -3004,18 +3024,21 @@ const XyChartTooltipContent = ({ tooltipContext, container, renderTooltip, rende
|
|
|
3004
3024
|
*/
|
|
3005
3025
|
const XyChartTooltipOverlay = (props) => {
|
|
3006
3026
|
const tooltipContext = useContext(TooltipContext);
|
|
3027
|
+
const dataRegistry = useContext(DataContext)?.dataRegistry;
|
|
3007
3028
|
const [container, setContainer] = useState(null);
|
|
3008
3029
|
const anchorRef = useCallback((node) => {
|
|
3009
3030
|
setContainer(node?.ownerSVGElement?.parentElement ?? null);
|
|
3010
3031
|
}, []);
|
|
3011
3032
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("g", { ref: anchorRef }), tooltipContext?.tooltipOpen && /* @__PURE__ */ jsx(XyChartTooltipContent, {
|
|
3012
3033
|
...props,
|
|
3013
|
-
tooltipContext
|
|
3034
|
+
tooltipContext: {
|
|
3035
|
+
...tooltipContext,
|
|
3036
|
+
tooltipData: atNearestDate(tooltipContext.tooltipData, dataRegistry)
|
|
3037
|
+
},
|
|
3014
3038
|
container
|
|
3015
3039
|
})] });
|
|
3016
3040
|
};
|
|
3017
|
-
|
|
3018
|
-
//#region src/components/tooltip/xy-chart-tooltip.tsx
|
|
3041
|
+
// src/components/tooltip/xy-chart-tooltip.tsx
|
|
3019
3042
|
const XYChartTooltip = ({ renderTooltip, selectedIndex, tooltipRef, keyboardFocusedClassName, series = [], mode = "group", verticalCrosshairStyle, horizontalCrosshairStyle, ...props }) => {
|
|
3020
3043
|
const tooltipContext = useContext(TooltipContext);
|
|
3021
3044
|
const scopeElement = useChartScopeElement();
|
|
@@ -3040,6 +3063,7 @@ const XYChartTooltip = ({ renderTooltip, selectedIndex, tooltipRef, keyboardFocu
|
|
|
3040
3063
|
}
|
|
3041
3064
|
return flattened;
|
|
3042
3065
|
}, [series, mode]);
|
|
3066
|
+
const stops = useMemo(() => getKeyboardStops(series), [series]);
|
|
3043
3067
|
const hasKeyboardSelection = useRef(false);
|
|
3044
3068
|
const closeTooltipNow = useCallback(() => {
|
|
3045
3069
|
tooltipContext?.updateTooltip({
|
|
@@ -3073,19 +3097,20 @@ const XYChartTooltip = ({ renderTooltip, selectedIndex, tooltipRef, keyboardFocu
|
|
|
3073
3097
|
hasKeyboardSelection.current = true;
|
|
3074
3098
|
if (mode === "group") {
|
|
3075
3099
|
closeTooltipNow();
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
index
|
|
3083
|
-
});
|
|
3084
|
-
}
|
|
3100
|
+
stops.membersAt(selectedIndex).forEach(({ series: member, datum, index }) => {
|
|
3101
|
+
tooltipContext?.showTooltip({
|
|
3102
|
+
datum,
|
|
3103
|
+
key: member.label,
|
|
3104
|
+
index
|
|
3105
|
+
});
|
|
3085
3106
|
});
|
|
3086
3107
|
} else if (mode === "individual") {
|
|
3087
3108
|
if (selectedIndex < tooltipData.length) {
|
|
3088
3109
|
const tooltipItem = tooltipData[selectedIndex];
|
|
3110
|
+
tooltipContext?.updateTooltip((state) => ({
|
|
3111
|
+
...state,
|
|
3112
|
+
tooltipData: void 0
|
|
3113
|
+
}));
|
|
3089
3114
|
tooltipContext?.showTooltip({
|
|
3090
3115
|
datum: tooltipItem.datum,
|
|
3091
3116
|
key: tooltipItem.seriesLabel,
|
|
@@ -3096,7 +3121,7 @@ const XYChartTooltip = ({ renderTooltip, selectedIndex, tooltipRef, keyboardFocu
|
|
|
3096
3121
|
}, [
|
|
3097
3122
|
selectedIndex,
|
|
3098
3123
|
tooltipData,
|
|
3099
|
-
|
|
3124
|
+
stops
|
|
3100
3125
|
]);
|
|
3101
3126
|
const focusableRenderTooltip = useMemo(() => {
|
|
3102
3127
|
if (!renderTooltip) return void 0;
|
|
@@ -3246,8 +3271,7 @@ const useKeyboardNavigation = ({ selectedIndex, setSelectedIndex, isNavigating,
|
|
|
3246
3271
|
onChartPointerMove
|
|
3247
3272
|
};
|
|
3248
3273
|
};
|
|
3249
|
-
|
|
3250
|
-
//#region src/providers/chart-context/hooks/use-default-hidden-series.ts
|
|
3274
|
+
// src/providers/chart-context/hooks/use-default-hidden-series.ts
|
|
3251
3275
|
/**
|
|
3252
3276
|
* Seeds a chart's hidden series once per chart ID, the first time the provider
|
|
3253
3277
|
* sees that ID.
|
|
@@ -3282,8 +3306,7 @@ const useDefaultHiddenSeries = (chartId, seriesLabels) => {
|
|
|
3282
3306
|
chartId
|
|
3283
3307
|
]);
|
|
3284
3308
|
};
|
|
3285
|
-
|
|
3286
|
-
//#region src/charts/private/chart-composition/chart-svg.tsx
|
|
3309
|
+
// src/charts/private/chart-composition/chart-svg.tsx
|
|
3287
3310
|
/**
|
|
3288
3311
|
* Compound component for SVG children in charts.
|
|
3289
3312
|
* This component serves as a marker for SVG content that should be rendered
|
|
@@ -3297,8 +3320,7 @@ const ChartSVG = ({ children }) => {
|
|
|
3297
3320
|
return /* @__PURE__ */ jsx(Fragment$1, { children });
|
|
3298
3321
|
};
|
|
3299
3322
|
ChartSVG.displayName = "Chart.SVG";
|
|
3300
|
-
|
|
3301
|
-
//#region src/charts/private/chart-composition/chart-html.tsx
|
|
3323
|
+
// src/charts/private/chart-composition/chart-html.tsx
|
|
3302
3324
|
/**
|
|
3303
3325
|
* Compound component for HTML children in charts.
|
|
3304
3326
|
* This component serves as a marker for HTML content that should be rendered
|
|
@@ -3312,8 +3334,7 @@ const ChartHTML = ({ children }) => {
|
|
|
3312
3334
|
return /* @__PURE__ */ jsx(Fragment$1, { children });
|
|
3313
3335
|
};
|
|
3314
3336
|
ChartHTML.displayName = "Chart.HTML";
|
|
3315
|
-
|
|
3316
|
-
//#region src/charts/private/chart-composition/render-legend-slot.ts
|
|
3337
|
+
// src/charts/private/chart-composition/render-legend-slot.ts
|
|
3317
3338
|
/**
|
|
3318
3339
|
* Renders legend children filtered by position slot.
|
|
3319
3340
|
*
|
|
@@ -3324,8 +3345,7 @@ ChartHTML.displayName = "Chart.HTML";
|
|
|
3324
3345
|
function renderLegendSlot(legendChildren, position) {
|
|
3325
3346
|
return legendChildren.filter((l) => l.position === position).map((l, i) => createElement(Fragment, { key: `legend-${position}-${i}` }, l.element));
|
|
3326
3347
|
}
|
|
3327
|
-
|
|
3328
|
-
//#region src/charts/private/chart-composition/use-chart-children.ts
|
|
3348
|
+
// src/charts/private/chart-composition/use-chart-children.ts
|
|
3329
3349
|
/**
|
|
3330
3350
|
* Custom hook to process and categorize chart children for composition API.
|
|
3331
3351
|
* Extracts children from compound components (Chart.SVG, Chart.HTML) and
|
|
@@ -3378,11 +3398,9 @@ function useChartChildren(children, chartType) {
|
|
|
3378
3398
|
};
|
|
3379
3399
|
}, [children, chartType]);
|
|
3380
3400
|
}
|
|
3381
|
-
|
|
3382
|
-
//#region src/charts/private/chart-layout/chart-layout.module.scss
|
|
3401
|
+
// src/charts/private/chart-layout/chart-layout.module.scss
|
|
3383
3402
|
var chart_layout_module_default = { "chart-layout__content": "a8ccharts-fpNVAq-chart-layout__content" };
|
|
3384
|
-
|
|
3385
|
-
//#region src/charts/private/chart-layout/chart-layout.tsx
|
|
3403
|
+
// src/charts/private/chart-layout/chart-layout.tsx
|
|
3386
3404
|
const ChartLayout = ({ legendPosition, legendElement, legendChildren, children, trailingContent, onContentHeightChange, gap, className, rootRef, style, "data-testid": dataTestId, "data-chart-id": dataChartId }) => {
|
|
3387
3405
|
const [contentRef, contentWidth, contentHeight] = useElementSize();
|
|
3388
3406
|
const isRenderProp = typeof children === "function";
|
|
@@ -3425,8 +3443,7 @@ const ChartLayout = ({ legendPosition, legendElement, legendChildren, children,
|
|
|
3425
3443
|
]
|
|
3426
3444
|
});
|
|
3427
3445
|
};
|
|
3428
|
-
|
|
3429
|
-
//#region src/charts/private/default-glyph/default-glyph.tsx
|
|
3446
|
+
// src/charts/private/default-glyph/default-glyph.tsx
|
|
3430
3447
|
const DefaultGlyph = (props) => {
|
|
3431
3448
|
const { theme } = useContext(DataContext) || {};
|
|
3432
3449
|
props.position;
|
|
@@ -3441,8 +3458,7 @@ const DefaultGlyph = (props) => {
|
|
|
3441
3458
|
...props.glyphStyle
|
|
3442
3459
|
});
|
|
3443
3460
|
};
|
|
3444
|
-
|
|
3445
|
-
//#region src/charts/private/readings.ts
|
|
3461
|
+
// src/charts/private/readings.ts
|
|
3446
3462
|
/**
|
|
3447
3463
|
* Whether a value is a reading a scale can place.
|
|
3448
3464
|
*
|
|
@@ -3466,11 +3482,9 @@ const isInvalidReading = (value, { allowMissing }) => value === null ? !allowMis
|
|
|
3466
3482
|
* @return The formatted value.
|
|
3467
3483
|
*/
|
|
3468
3484
|
const formatReading = (value) => value == null ? __("No data", "jetpack-charts") : formatNumber(value);
|
|
3469
|
-
|
|
3470
|
-
//#region src/charts/private/center/center.module.scss
|
|
3485
|
+
// src/charts/private/center/center.module.scss
|
|
3471
3486
|
var center_module_default = { "center": "a8ccharts-w3qxlG-center" };
|
|
3472
|
-
|
|
3473
|
-
//#region src/charts/private/center/center.tsx
|
|
3487
|
+
// src/charts/private/center/center.tsx
|
|
3474
3488
|
/**
|
|
3475
3489
|
* Centers its children on both axes and fills its parent.
|
|
3476
3490
|
*
|
|
@@ -3492,11 +3506,9 @@ const Center = forwardRef(({ align = "center", justify = "center", className, ..
|
|
|
3492
3506
|
...props
|
|
3493
3507
|
}));
|
|
3494
3508
|
Center.displayName = "Center";
|
|
3495
|
-
|
|
3496
|
-
//#region src/charts/private/svg-empty-state/svg-empty-state.module.scss
|
|
3509
|
+
// src/charts/private/svg-empty-state/svg-empty-state.module.scss
|
|
3497
3510
|
var svg_empty_state_module_default = { "svg-empty-state": "a8ccharts-udGPVq-svg-empty-state" };
|
|
3498
|
-
|
|
3499
|
-
//#region src/charts/private/svg-empty-state/svg-empty-state.tsx
|
|
3511
|
+
// src/charts/private/svg-empty-state/svg-empty-state.tsx
|
|
3500
3512
|
/**
|
|
3501
3513
|
* Renders empty-state text inside an SVG using foreignObject so that the
|
|
3502
3514
|
* message wraps onto multiple lines instead of being clipped.
|
|
@@ -3523,8 +3535,7 @@ const SvgEmptyState = ({ x, y, width, height, children }) => {
|
|
|
3523
3535
|
})
|
|
3524
3536
|
});
|
|
3525
3537
|
};
|
|
3526
|
-
|
|
3527
|
-
//#region src/charts/private/svg-empty-state/get-all-hidden-message.ts
|
|
3538
|
+
// src/charts/private/svg-empty-state/get-all-hidden-message.ts
|
|
3528
3539
|
/**
|
|
3529
3540
|
* Return the empty-state message for a chart whose items are all hidden.
|
|
3530
3541
|
*
|
|
@@ -3544,8 +3555,7 @@ const getAllHiddenMessage = (interactive, itemType) => {
|
|
|
3544
3555
|
if (interactive) return _x("All series are hidden. Click legend items to show data.", "chart empty state: interactive series", "jetpack-charts");
|
|
3545
3556
|
return _x("All series are hidden.", "chart empty state: series", "jetpack-charts");
|
|
3546
3557
|
};
|
|
3547
|
-
|
|
3548
|
-
//#region src/charts/private/time-axis.ts
|
|
3558
|
+
// src/charts/private/time-axis.ts
|
|
3549
3559
|
const X_TICK_WIDTH = 60;
|
|
3550
3560
|
const getCurveType = (type, smoothing) => {
|
|
3551
3561
|
if (!type) return smoothing ? curveCatmullRom : curveLinear;
|
|
@@ -3802,8 +3812,7 @@ const guessOptimalNumTicks = (data, chartWidth, tickFormatter) => {
|
|
|
3802
3812
|
}
|
|
3803
3813
|
return Math.max(1, secondBestGuess);
|
|
3804
3814
|
};
|
|
3805
|
-
|
|
3806
|
-
//#region src/charts/private/time-axis-options.ts
|
|
3815
|
+
// src/charts/private/time-axis-options.ts
|
|
3807
3816
|
const toDateDomain = (domain) => domain ? [new Date(domain[0]), new Date(domain[1])] : void 0;
|
|
3808
3817
|
/**
|
|
3809
3818
|
* The x-axis options for a continuous time chart, shared by LineChart and AreaChart.
|
|
@@ -3838,8 +3847,7 @@ const buildTimeAxisOptions = ({ dataSorted, width, axisOptions, scaleDomain, zoo
|
|
|
3838
3847
|
...numTicks === void 0 ? {} : { numTicks }
|
|
3839
3848
|
};
|
|
3840
3849
|
};
|
|
3841
|
-
|
|
3842
|
-
//#region src/charts/private/whole-number-ticks.tsx
|
|
3850
|
+
// src/charts/private/whole-number-ticks.tsx
|
|
3843
3851
|
/**
|
|
3844
3852
|
* Whether every reading in the series is a whole number.
|
|
3845
3853
|
*
|
|
@@ -3886,15 +3894,13 @@ const WholeNumberTicks = ({ axis, numTicks, enabled, children }) => {
|
|
|
3886
3894
|
const tickValues = enabled ? getWholeNumberTickValues(axis === "x" ? xScale : yScale, numTicks) : void 0;
|
|
3887
3895
|
return /* @__PURE__ */ jsx(Fragment$1, { children: children(tickValues) });
|
|
3888
3896
|
};
|
|
3889
|
-
|
|
3890
|
-
//#region src/charts/private/with-responsive/with-responsive.module.scss
|
|
3897
|
+
// src/charts/private/with-responsive/with-responsive.module.scss
|
|
3891
3898
|
var with_responsive_module_default = {
|
|
3892
3899
|
"container": "a8ccharts-sP1gHa-container",
|
|
3893
3900
|
"content": "a8ccharts-sP1gHa-content",
|
|
3894
3901
|
"isContained": "a8ccharts-sP1gHa-isContained"
|
|
3895
3902
|
};
|
|
3896
|
-
|
|
3897
|
-
//#region src/charts/private/with-responsive/with-responsive.tsx
|
|
3903
|
+
// src/charts/private/with-responsive/with-responsive.tsx
|
|
3898
3904
|
/**
|
|
3899
3905
|
* A higher-order component that provides responsive dimensions
|
|
3900
3906
|
* to the wrapped chart component using useParentSize from `@visx/responsive`.
|
|
@@ -3973,14 +3979,12 @@ function withResponsive(WrappedComponent) {
|
|
|
3973
3979
|
});
|
|
3974
3980
|
};
|
|
3975
3981
|
}
|
|
3976
|
-
|
|
3977
|
-
//#region src/charts/private/x-zoom/x-zoom.module.scss
|
|
3982
|
+
// src/charts/private/x-zoom/x-zoom.module.scss
|
|
3978
3983
|
var x_zoom_module_default = {
|
|
3979
3984
|
"x-zoom__reset": "a8ccharts-ur9dWW-x-zoom__reset",
|
|
3980
3985
|
"x-zoom__selection": "a8ccharts-ur9dWW-x-zoom__selection"
|
|
3981
3986
|
};
|
|
3982
|
-
|
|
3983
|
-
//#region src/charts/private/x-zoom/x-zoom.tsx
|
|
3987
|
+
// src/charts/private/x-zoom/x-zoom.tsx
|
|
3984
3988
|
const MIN_DRAG_PIXELS = 6;
|
|
3985
3989
|
/**
|
|
3986
3990
|
* Drag-to-zoom state + pointer handlers for an XY chart. Designed to be
|
|
@@ -4163,11 +4167,9 @@ function ZoomResetButton({ onClick }) {
|
|
|
4163
4167
|
})
|
|
4164
4168
|
});
|
|
4165
4169
|
}
|
|
4166
|
-
|
|
4167
|
-
//#region src/charts/private/xy-plot/xy-plot.module.scss
|
|
4170
|
+
// src/charts/private/xy-plot/xy-plot.module.scss
|
|
4168
4171
|
var xy_plot_module_default = { "xy-plot": "a8ccharts-bIyhgG-xy-plot" };
|
|
4169
|
-
|
|
4170
|
-
//#region src/charts/line-chart/line-chart.module.scss
|
|
4172
|
+
// src/charts/line-chart/line-chart.module.scss
|
|
4171
4173
|
var line_chart_module_default = {
|
|
4172
4174
|
"line-chart": "a8ccharts-inuQka-line-chart",
|
|
4173
4175
|
"line-chart__annotation-label": "a8ccharts-inuQka-line-chart__annotation-label",
|
|
@@ -4269,8 +4271,7 @@ const LineChartAnnotationLabelWithPopover = ({ title, subtitle, renderLabel, ren
|
|
|
4269
4271
|
})]
|
|
4270
4272
|
});
|
|
4271
4273
|
};
|
|
4272
|
-
|
|
4273
|
-
//#region src/charts/line-chart/private/line-chart-annotations-overlay.tsx
|
|
4274
|
+
// src/charts/line-chart/private/line-chart-annotations-overlay.tsx
|
|
4274
4275
|
const LineChartAnnotationsOverlay = ({ children }) => {
|
|
4275
4276
|
const { chartRef, chartWidth, chartHeight } = useChartInstanceContext();
|
|
4276
4277
|
const [scales, setScales] = useState(null);
|
|
@@ -4353,8 +4354,7 @@ const LineChartAnnotationsOverlay = ({ children }) => {
|
|
|
4353
4354
|
})
|
|
4354
4355
|
});
|
|
4355
4356
|
};
|
|
4356
|
-
|
|
4357
|
-
//#region src/charts/line-chart/private/line-chart-annotation.tsx
|
|
4357
|
+
// src/charts/line-chart/private/line-chart-annotation.tsx
|
|
4358
4358
|
const ANNOTATION_MAX_WIDTH = 125;
|
|
4359
4359
|
const ANNOTATION_INIT_HEIGHT = 100;
|
|
4360
4360
|
const getLabelPosition = ({ subjectType, x, xMax, y, yMin, yMax, maxWidth, height }) => {
|
|
@@ -4547,8 +4547,7 @@ const LineChartAnnotation = ({ datum, title, subtitle, subjectType = "circle", s
|
|
|
4547
4547
|
]
|
|
4548
4548
|
}) });
|
|
4549
4549
|
};
|
|
4550
|
-
|
|
4551
|
-
//#region src/charts/line-chart/private/line-chart-glyph.tsx
|
|
4550
|
+
// src/charts/line-chart/private/line-chart-glyph.tsx
|
|
4552
4551
|
const toNumber$1 = (val) => {
|
|
4553
4552
|
const num = typeof val === "number" ? val : parseFloat(val);
|
|
4554
4553
|
return isNaN(num) ? void 0 : num;
|
|
@@ -4578,8 +4577,7 @@ const LineChartGlyph = ({ data, index, color, glyphStyle, renderGlyph, accessors
|
|
|
4578
4577
|
position
|
|
4579
4578
|
});
|
|
4580
4579
|
};
|
|
4581
|
-
|
|
4582
|
-
//#region src/charts/line-chart/private/nearest-pointer-events.tsx
|
|
4580
|
+
// src/charts/line-chart/private/nearest-pointer-events.tsx
|
|
4583
4581
|
/**
|
|
4584
4582
|
* Find the datum nearest a pointer along x, in one series sorted by x.
|
|
4585
4583
|
*
|
|
@@ -4678,8 +4676,7 @@ function NearestPointerEvents({ onPointerDown, onPointerMove, onPointerUp }) {
|
|
|
4678
4676
|
useEventEmitter("pointerup", handlers.pointerup);
|
|
4679
4677
|
return null;
|
|
4680
4678
|
}
|
|
4681
|
-
|
|
4682
|
-
//#region src/charts/line-chart/line-chart.tsx
|
|
4679
|
+
// src/charts/line-chart/line-chart.tsx
|
|
4683
4680
|
const defaultRenderGlyph = (props) => {
|
|
4684
4681
|
return /* @__PURE__ */ createElement(DefaultGlyph, {
|
|
4685
4682
|
...props,
|
|
@@ -4861,21 +4858,22 @@ const LineChartInternal = forwardRef(({ data, ariaLabel, chartId: providedChartI
|
|
|
4861
4858
|
isSeriesVisible,
|
|
4862
4859
|
options?.yScale
|
|
4863
4860
|
]);
|
|
4864
|
-
const
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4861
|
+
const stops = useMemo(() => getKeyboardStops(visibleSeries), [visibleSeries]);
|
|
4862
|
+
const activateSelectedPoint = useCallback((stop) => {
|
|
4863
|
+
const match = stops.membersAt(stop)[0];
|
|
4864
|
+
if (match) onDatumActivate?.({
|
|
4865
|
+
datum: match.datum,
|
|
4866
|
+
index: match.index,
|
|
4867
|
+
key: match.series.label
|
|
4870
4868
|
});
|
|
4871
|
-
}, [
|
|
4869
|
+
}, [stops, onDatumActivate]);
|
|
4872
4870
|
const { tooltipRef, onChartFocus, onChartBlur, onChartKeyDown } = useKeyboardNavigation({
|
|
4873
4871
|
selectedIndex,
|
|
4874
4872
|
setSelectedIndex,
|
|
4875
4873
|
isNavigating,
|
|
4876
4874
|
setIsNavigating,
|
|
4877
4875
|
chartRef,
|
|
4878
|
-
totalPoints:
|
|
4876
|
+
totalPoints: stops.count,
|
|
4879
4877
|
visibleSeriesKey,
|
|
4880
4878
|
onActivate: activateSelectedPoint,
|
|
4881
4879
|
preventTooltipScroll: tooltipPlacement === "below-axis"
|
|
@@ -5209,15 +5207,13 @@ const LineChartResponsive = attachSubComponents(withResponsive(LineChartWithProv
|
|
|
5209
5207
|
AnnotationsOverlay: LineChartAnnotationsOverlay,
|
|
5210
5208
|
Annotation: LineChartAnnotation
|
|
5211
5209
|
});
|
|
5212
|
-
|
|
5213
|
-
//#region src/charts/area-chart/area-chart.module.scss
|
|
5210
|
+
// src/charts/area-chart/area-chart.module.scss
|
|
5214
5211
|
var area_chart_module_default = {
|
|
5215
5212
|
"area-chart": "a8ccharts-jlynaq-area-chart",
|
|
5216
5213
|
"area-chart--animated": "a8ccharts-jlynaq-area-chart--animated",
|
|
5217
5214
|
"rise": "a8ccharts-jlynaq-rise"
|
|
5218
5215
|
};
|
|
5219
|
-
|
|
5220
|
-
//#region src/charts/area-chart/private/validate-data.ts
|
|
5216
|
+
// src/charts/area-chart/private/validate-data.ts
|
|
5221
5217
|
/**
|
|
5222
5218
|
* Up-front data validation. Returns a localised error message when the chart
|
|
5223
5219
|
* cannot safely render, otherwise `null`. Catches the cases that would
|
|
@@ -5233,8 +5229,7 @@ const validateData$3 = (data) => {
|
|
|
5233
5229
|
if (data.some((series) => series.data.some((point) => isInvalidReading(point.value, { allowMissing: false }) || "date" in point && point.date && isNaN(point.date.getTime())))) return __("Invalid data", "jetpack-charts");
|
|
5234
5230
|
return null;
|
|
5235
5231
|
};
|
|
5236
|
-
|
|
5237
|
-
//#region src/charts/area-chart/private/overlays.tsx
|
|
5232
|
+
// src/charts/area-chart/private/overlays.tsx
|
|
5238
5233
|
const AreaChartScalesRef = ({ chartRef, width, height, margin }) => {
|
|
5239
5234
|
const context = useContext(DataContext);
|
|
5240
5235
|
useImperativeHandle(chartRef, () => ({
|
|
@@ -5299,8 +5294,7 @@ const HoverGlyphs = ({ visibleSeries, stacked, stackOffset, getElementStyles, st
|
|
|
5299
5294
|
children: circles
|
|
5300
5295
|
});
|
|
5301
5296
|
};
|
|
5302
|
-
|
|
5303
|
-
//#region src/charts/area-chart/area-chart.tsx
|
|
5297
|
+
// src/charts/area-chart/area-chart.tsx
|
|
5304
5298
|
const AreaChartInternal = forwardRef(({ data, ariaLabel, chartId: providedChartId, width, height, className, margin, withTooltips = true, withTooltipCrosshairs, showLegend = false, legend = {}, stacked = true, stackOffset = "none", smoothing = true, curveType, fillOpacity, withStroke, renderTooltip = renderDefaultTooltip, animation, options = {}, onPointerDown, onPointerUp, onPointerMove, onPointerOut, zoomable = false, rescaleYOnVisibilityChange = true, defaultHiddenSeries, children, gridVisibility, gap = "md" }, ref) => {
|
|
5305
5299
|
const legendInteractive = legend.interactive ?? false;
|
|
5306
5300
|
const legendShape = legend.shape ?? "rect";
|
|
@@ -5346,19 +5340,22 @@ const AreaChartInternal = forwardRef(({ data, ariaLabel, chartId: providedChartI
|
|
|
5346
5340
|
}));
|
|
5347
5341
|
}, [dataSorted, hiddenSeries]);
|
|
5348
5342
|
const allSeriesHidden = useMemo(() => seriesWithVisibility.every(({ isVisible }) => !isVisible), [seriesWithVisibility]);
|
|
5349
|
-
const
|
|
5350
|
-
|
|
5351
|
-
|
|
5343
|
+
const visibleDataSeries = useMemo(() => dataSorted.filter((series) => isSeriesVisible(series.label)), [dataSorted, isSeriesVisible]);
|
|
5344
|
+
const hasWholeNumberValues = useMemo(() => (!stacked || stackOffset === "none") && hasOnlyWholeNumbers(visibleDataSeries), [
|
|
5345
|
+
visibleDataSeries,
|
|
5352
5346
|
stacked,
|
|
5353
5347
|
stackOffset
|
|
5354
5348
|
]);
|
|
5349
|
+
const visibleSeriesKey = useMemo(() => JSON.stringify(visibleDataSeries.map((series) => series.label)), [visibleDataSeries]);
|
|
5350
|
+
const stops = useMemo(() => getKeyboardStops(visibleDataSeries), [visibleDataSeries]);
|
|
5355
5351
|
const { tooltipRef, onChartFocus, onChartBlur, onChartKeyDown } = useKeyboardNavigation({
|
|
5356
5352
|
selectedIndex,
|
|
5357
5353
|
setSelectedIndex,
|
|
5358
5354
|
isNavigating,
|
|
5359
5355
|
setIsNavigating,
|
|
5360
5356
|
chartRef,
|
|
5361
|
-
totalPoints:
|
|
5357
|
+
totalPoints: stops.count,
|
|
5358
|
+
visibleSeriesKey
|
|
5362
5359
|
});
|
|
5363
5360
|
const fixedYDomain = useMemo(() => {
|
|
5364
5361
|
if (rescaleYOnVisibilityChange || !dataSorted.length || !dataSorted[0].data.length || stacked && stackOffset !== "none") return;
|
|
@@ -5646,7 +5643,7 @@ const AreaChartInternal = forwardRef(({ data, ariaLabel, chartId: providedChartI
|
|
|
5646
5643
|
selectedIndex,
|
|
5647
5644
|
tooltipRef,
|
|
5648
5645
|
keyboardFocusedClassName: area_chart_module_default["area-chart__tooltip--keyboard-focused"],
|
|
5649
|
-
series:
|
|
5646
|
+
series: visibleDataSeries
|
|
5650
5647
|
}), /* @__PURE__ */ jsx(HoverGlyphs, {
|
|
5651
5648
|
visibleSeries,
|
|
5652
5649
|
stacked,
|
|
@@ -5682,8 +5679,7 @@ const AreaChartWithProvider = forwardRef((props, ref) => {
|
|
|
5682
5679
|
AreaChartWithProvider.displayName = "AreaChart";
|
|
5683
5680
|
const AreaChart = attachSubComponents(AreaChartWithProvider, { Legend });
|
|
5684
5681
|
const AreaChartResponsive = attachSubComponents(withResponsive(AreaChartWithProvider), { Legend });
|
|
5685
|
-
|
|
5686
|
-
//#region src/charts/bar-chart/bar-chart.module.scss
|
|
5682
|
+
// src/charts/bar-chart/bar-chart.module.scss
|
|
5687
5683
|
var bar_chart_module_default = {
|
|
5688
5684
|
"bar-chart": "a8ccharts-97yN9W-bar-chart",
|
|
5689
5685
|
"bar-chart--animated": "a8ccharts-97yN9W-bar-chart--animated",
|
|
@@ -5691,8 +5687,7 @@ var bar_chart_module_default = {
|
|
|
5691
5687
|
"rise": "a8ccharts-97yN9W-rise",
|
|
5692
5688
|
"stretch": "a8ccharts-97yN9W-stretch"
|
|
5693
5689
|
};
|
|
5694
|
-
|
|
5695
|
-
//#region src/charts/bar-chart/private/truncated-tick-component.tsx
|
|
5690
|
+
// src/charts/bar-chart/private/truncated-tick-component.tsx
|
|
5696
5691
|
/**
|
|
5697
5692
|
* Get the bandwidth of a scale
|
|
5698
5693
|
*
|
|
@@ -5806,8 +5801,7 @@ const createTruncatedTickComponent = (axis) => (props) => {
|
|
|
5806
5801
|
*/
|
|
5807
5802
|
const TruncatedXTickComponent = createTruncatedTickComponent("x");
|
|
5808
5803
|
const TruncatedYTickComponent = createTruncatedTickComponent("y");
|
|
5809
|
-
|
|
5810
|
-
//#region src/charts/bar-chart/private/value-domain.ts
|
|
5804
|
+
// src/charts/bar-chart/private/value-domain.ts
|
|
5811
5805
|
/** Domain for a value axis that has nothing to scale, so its ticks still read 0 to 1. */
|
|
5812
5806
|
const EMPTY_DOMAIN = [0, 1];
|
|
5813
5807
|
/**
|
|
@@ -5858,8 +5852,7 @@ const getValueScaleDomain = (data, includeZero, isSeriesRendered) => {
|
|
|
5858
5852
|
if (includeZero) return [Math.min(0, min), Math.max(0, max)];
|
|
5859
5853
|
return null;
|
|
5860
5854
|
};
|
|
5861
|
-
|
|
5862
|
-
//#region src/charts/bar-chart/private/use-bar-chart-options.ts
|
|
5855
|
+
// src/charts/bar-chart/private/use-bar-chart-options.ts
|
|
5863
5856
|
/** Outer padding of the category band scale (space at the chart edges). */
|
|
5864
5857
|
const BASE_BAND_PADDING = .2;
|
|
5865
5858
|
/** Inner padding of the category band scale (the base gap between ticks). */
|
|
@@ -6075,8 +6068,7 @@ function useBarChartOptions(data, horizontal, options = {}, isSeriesRendered = A
|
|
|
6075
6068
|
isSeriesRendered
|
|
6076
6069
|
]);
|
|
6077
6070
|
}
|
|
6078
|
-
|
|
6079
|
-
//#region src/charts/bar-chart/private/band-scale.ts
|
|
6071
|
+
// src/charts/bar-chart/private/band-scale.ts
|
|
6080
6072
|
/**
|
|
6081
6073
|
* Match the inner slot scale used by visx BarGroup.
|
|
6082
6074
|
* @param keys - Visible primary series keys.
|
|
@@ -6089,8 +6081,7 @@ const createGroupScale = (keys, bandwidth, padding) => scaleBand({
|
|
|
6089
6081
|
range: [0, bandwidth],
|
|
6090
6082
|
padding
|
|
6091
6083
|
});
|
|
6092
|
-
|
|
6093
|
-
//#region src/charts/bar-chart/private/comparison-bars-geometry.ts
|
|
6084
|
+
// src/charts/bar-chart/private/comparison-bars-geometry.ts
|
|
6094
6085
|
/**
|
|
6095
6086
|
* Mirrors visx's getScaleBaseline so bars drawn outside visx share the baseline of its bars, including out-of-domain zero values.
|
|
6096
6087
|
*
|
|
@@ -6136,8 +6127,7 @@ function computeSlotRect(params) {
|
|
|
6136
6127
|
height: valueLength
|
|
6137
6128
|
};
|
|
6138
6129
|
}
|
|
6139
|
-
|
|
6140
|
-
//#region src/charts/bar-chart/private/classified-bar-series.tsx
|
|
6130
|
+
// src/charts/bar-chart/private/classified-bar-series.tsx
|
|
6141
6131
|
const ClassifiedBarSeries = ({ barClassName, primaryKeys, groupPadding, ...props }) => {
|
|
6142
6132
|
const { xScale, yScale, horizontal } = useContext(DataContext);
|
|
6143
6133
|
const bandScale = horizontal ? yScale : xScale;
|
|
@@ -6181,8 +6171,7 @@ const ClassifiedBarSeries = ({ barClassName, primaryKeys, groupPadding, ...props
|
|
|
6181
6171
|
renderGlyph
|
|
6182
6172
|
});
|
|
6183
6173
|
};
|
|
6184
|
-
|
|
6185
|
-
//#region src/charts/bar-chart/private/slotted-bar-series.tsx
|
|
6174
|
+
// src/charts/bar-chart/private/slotted-bar-series.tsx
|
|
6186
6175
|
const SlottedBarSeries = ({ barClassName, slotKeys, slotKey, thickness, groupPadding, ...props }) => {
|
|
6187
6176
|
const { xScale, yScale, horizontal } = useContext(DataContext);
|
|
6188
6177
|
const bandScale = horizontal ? yScale : xScale;
|
|
@@ -6225,16 +6214,14 @@ const SlottedBarSeries = ({ barClassName, slotKeys, slotKey, thickness, groupPad
|
|
|
6225
6214
|
renderGlyph
|
|
6226
6215
|
});
|
|
6227
6216
|
};
|
|
6228
|
-
|
|
6229
|
-
//#region src/charts/private/selected-ring/selected-ring.module.scss
|
|
6217
|
+
// src/charts/private/selected-ring/selected-ring.module.scss
|
|
6230
6218
|
var selected_ring_module_default = {
|
|
6231
6219
|
"selected-ring__contrast": "a8ccharts-gx1_AW-selected-ring__contrast",
|
|
6232
6220
|
"selected-ring__edge": "a8ccharts-gx1_AW-selected-ring__edge",
|
|
6233
6221
|
"selected-ring__far": "a8ccharts-gx1_AW-selected-ring__far",
|
|
6234
6222
|
"selected-ring__focus": "a8ccharts-gx1_AW-selected-ring__focus"
|
|
6235
6223
|
};
|
|
6236
|
-
|
|
6237
|
-
//#region src/charts/private/selected-ring/selected-ring.tsx
|
|
6224
|
+
// src/charts/private/selected-ring/selected-ring.tsx
|
|
6238
6225
|
const TONES = {
|
|
6239
6226
|
inside: ["contrast", "focus"],
|
|
6240
6227
|
outside: ["focus", "contrast"]
|
|
@@ -6281,8 +6268,7 @@ const SelectedRing = ({ chartId, d, side, testId }) => {
|
|
|
6281
6268
|
]
|
|
6282
6269
|
});
|
|
6283
6270
|
};
|
|
6284
|
-
|
|
6285
|
-
//#region src/charts/bar-chart/private/selected-bar-ring.tsx
|
|
6271
|
+
// src/charts/bar-chart/private/selected-bar-ring.tsx
|
|
6286
6272
|
/**
|
|
6287
6273
|
* Marks the keyboard-selected slot with a two-tone ring outside its edge, so the ring reads against any bar color.
|
|
6288
6274
|
*
|
|
@@ -6323,8 +6309,7 @@ const SelectedBarRing = ({ chartId, selected, slotKeys, groupPadding, horizontal
|
|
|
6323
6309
|
testId: "bar-chart-selected-ring"
|
|
6324
6310
|
});
|
|
6325
6311
|
};
|
|
6326
|
-
|
|
6327
|
-
//#region src/charts/bar-chart/private/bar-layer.tsx
|
|
6312
|
+
// src/charts/bar-chart/private/bar-layer.tsx
|
|
6328
6313
|
/**
|
|
6329
6314
|
* Draws the bars in front of any comparison shadows, slotted for an overlap layout and grouped by visx otherwise, then the selected bar's ring.
|
|
6330
6315
|
*
|
|
@@ -6392,8 +6377,7 @@ const BarLayer = ({ chartId, overlapSlots, selectedBar, primaryEntries, primaryK
|
|
|
6392
6377
|
yAccessor
|
|
6393
6378
|
})] });
|
|
6394
6379
|
};
|
|
6395
|
-
|
|
6396
|
-
//#region src/charts/bar-chart/private/slot-tooltip-members.tsx
|
|
6380
|
+
// src/charts/bar-chart/private/slot-tooltip-members.tsx
|
|
6397
6381
|
/**
|
|
6398
6382
|
* Fills the tooltip with every bar of the keyboard-selected category, and only those.
|
|
6399
6383
|
*
|
|
@@ -6401,26 +6385,20 @@ const BarLayer = ({ chartId, overlapSlots, selectedBar, primaryEntries, primaryK
|
|
|
6401
6385
|
*
|
|
6402
6386
|
* @param props - Component props.
|
|
6403
6387
|
* @param props.members - The category's bars, the keyboard stop last.
|
|
6404
|
-
* @param props.index - The selected data point.
|
|
6405
6388
|
* @return No visual content.
|
|
6406
6389
|
*/
|
|
6407
|
-
function SlotTooltipMembers({ members
|
|
6390
|
+
function SlotTooltipMembers({ members }) {
|
|
6408
6391
|
const { showTooltip, updateTooltip } = useContext(TooltipContext) ?? {};
|
|
6409
6392
|
useEffect(() => {
|
|
6410
6393
|
updateTooltip?.((state) => ({
|
|
6411
6394
|
...state,
|
|
6412
6395
|
tooltipData: void 0
|
|
6413
6396
|
}));
|
|
6414
|
-
members.forEach((
|
|
6415
|
-
|
|
6416
|
-
datum,
|
|
6417
|
-
index
|
|
6418
|
-
}));
|
|
6419
|
-
}, [members, index]);
|
|
6397
|
+
members.forEach((member) => showTooltip?.(member));
|
|
6398
|
+
}, [members]);
|
|
6420
6399
|
return null;
|
|
6421
6400
|
}
|
|
6422
|
-
|
|
6423
|
-
//#region src/charts/bar-chart/private/overlap-bars.ts
|
|
6401
|
+
// src/charts/bar-chart/private/overlap-bars.ts
|
|
6424
6402
|
const PRIMARY_SLOT = "primary";
|
|
6425
6403
|
const COMPARISON_SLOT = "comparison";
|
|
6426
6404
|
const OVERLAP_SLOTS = [PRIMARY_SLOT, COMPARISON_SLOT];
|
|
@@ -6528,8 +6506,7 @@ function getOverlapBarColors(series, colors, slotColors, background) {
|
|
|
6528
6506
|
});
|
|
6529
6507
|
return barColors;
|
|
6530
6508
|
}
|
|
6531
|
-
|
|
6532
|
-
//#region src/charts/bar-chart/private/use-overlap-slots.ts
|
|
6509
|
+
// src/charts/bar-chart/private/use-overlap-slots.ts
|
|
6533
6510
|
/**
|
|
6534
6511
|
* Whether two data points sit at the same category: the same label, or the same date.
|
|
6535
6512
|
*
|
|
@@ -6538,7 +6515,7 @@ function getOverlapBarColors(series, colors, slotColors, background) {
|
|
|
6538
6515
|
* @return Whether `point` is at `category`.
|
|
6539
6516
|
*/
|
|
6540
6517
|
function isSameCategory(point, category) {
|
|
6541
|
-
return category.label
|
|
6518
|
+
return category.label ? point.label === category.label : !!category.date && !!point.date && point.date.getTime() === category.date.getTime();
|
|
6542
6519
|
}
|
|
6543
6520
|
/**
|
|
6544
6521
|
* Lays out the visible series of an overlap layout in slots and layers.
|
|
@@ -6583,7 +6560,7 @@ function useOverlapSlots(enabled, seriesWithVisibility) {
|
|
|
6583
6560
|
* @return The category key.
|
|
6584
6561
|
*/
|
|
6585
6562
|
function categoryKey(point) {
|
|
6586
|
-
return point.label
|
|
6563
|
+
return point.label ? `label:${point.label}` : `date:${point.date?.getTime()}`;
|
|
6587
6564
|
}
|
|
6588
6565
|
/**
|
|
6589
6566
|
* Lists a stop for every slot at every category that slot draws a bar at, category by category.
|
|
@@ -6621,6 +6598,25 @@ function getStopPositions(entries, slotKeys, slotOf) {
|
|
|
6621
6598
|
}));
|
|
6622
6599
|
}
|
|
6623
6600
|
/**
|
|
6601
|
+
* Every bar at a category, each with its own data point index, the keyboard stop last.
|
|
6602
|
+
*
|
|
6603
|
+
* @param entries - The visible series.
|
|
6604
|
+
* @param category - The data point naming the category.
|
|
6605
|
+
* @param stopKey - The series the keyboard stop is on.
|
|
6606
|
+
* @return The category's bars; the last one shown becomes the tooltip's nearest datum.
|
|
6607
|
+
*/
|
|
6608
|
+
function membersAt(entries, category, stopKey) {
|
|
6609
|
+
const members = entries.flatMap(({ series }) => {
|
|
6610
|
+
const index = series.data.findIndex((point) => isSameCategory(point, category));
|
|
6611
|
+
return index === -1 ? [] : [{
|
|
6612
|
+
key: series.label,
|
|
6613
|
+
datum: series.data[index],
|
|
6614
|
+
index
|
|
6615
|
+
}];
|
|
6616
|
+
});
|
|
6617
|
+
return [...members.filter(({ key }) => key !== stopKey), ...members.filter(({ key }) => key === stopKey)];
|
|
6618
|
+
}
|
|
6619
|
+
/**
|
|
6624
6620
|
* The slot a keyboard index selects, and every bar at its category.
|
|
6625
6621
|
*
|
|
6626
6622
|
* @param slots - The overlap layout.
|
|
@@ -6630,25 +6626,17 @@ function getStopPositions(entries, slotKeys, slotOf) {
|
|
|
6630
6626
|
function getSelectedSlot(slots, selectedIndex) {
|
|
6631
6627
|
const position = selectedIndex === void 0 ? void 0 : slots?.positions[selectedIndex];
|
|
6632
6628
|
if (!slots || !position) return;
|
|
6633
|
-
const { slotKey, key: stopKey, datum: category
|
|
6634
|
-
const members = slots.entries
|
|
6635
|
-
const datum = series.data.find((point) => isSameCategory(point, category));
|
|
6636
|
-
return datum ? [{
|
|
6637
|
-
key: series.label,
|
|
6638
|
-
datum
|
|
6639
|
-
}] : [];
|
|
6640
|
-
});
|
|
6629
|
+
const { slotKey, key: stopKey, datum: category } = position;
|
|
6630
|
+
const members = membersAt(slots.entries, category, stopKey);
|
|
6641
6631
|
const slotBars = members.filter(({ key, datum }) => isBarRendered(datum) && slots.slotOf(key) === slotKey);
|
|
6642
6632
|
return {
|
|
6643
6633
|
data: slotBars.map(({ datum }) => datum),
|
|
6644
6634
|
slotKey,
|
|
6645
6635
|
thickness: Math.max(...slotBars.map(({ key }) => slots.thicknessOf(key))),
|
|
6646
|
-
|
|
6647
|
-
members: [...members.filter(({ key }) => key !== stopKey), ...members.filter(({ key }) => key === stopKey)]
|
|
6636
|
+
members
|
|
6648
6637
|
};
|
|
6649
6638
|
}
|
|
6650
|
-
|
|
6651
|
-
//#region src/charts/bar-chart/private/use-bar-stops.ts
|
|
6639
|
+
// src/charts/bar-chart/private/use-bar-stops.ts
|
|
6652
6640
|
/**
|
|
6653
6641
|
* Lays out the keyboard stops: one per slot and category in an overlap layout, else one per primary bar, series-major within each category.
|
|
6654
6642
|
*
|
|
@@ -6660,7 +6648,6 @@ function useBarStops(overlapSlots, primaryEntries) {
|
|
|
6660
6648
|
const series = useMemo(() => overlapSlots ? [] : primaryEntries.map((entry) => entry.series), [overlapSlots, primaryEntries]);
|
|
6661
6649
|
return {
|
|
6662
6650
|
count: overlapSlots?.positions.length ?? Math.max(0, ...series.map((item) => item.data.length)) * series.length,
|
|
6663
|
-
series,
|
|
6664
6651
|
key: useMemo(() => JSON.stringify(overlapSlots?.keys ?? series.map((item) => item.label)), [overlapSlots, series]),
|
|
6665
6652
|
barAt: useCallback((stop) => {
|
|
6666
6653
|
if (overlapSlots) {
|
|
@@ -6703,8 +6690,7 @@ const MAX_GROUP_PADDING = .9;
|
|
|
6703
6690
|
* gap between ticks. `0.75` = a 25% reduction of the tick-gap padding.
|
|
6704
6691
|
*/
|
|
6705
6692
|
const COMPARISON_TICK_GAP_FACTOR = .75;
|
|
6706
|
-
|
|
6707
|
-
//#region src/charts/bar-chart/private/comparison-bars.tsx
|
|
6693
|
+
// src/charts/bar-chart/private/comparison-bars.tsx
|
|
6708
6694
|
const ComparisonBars = ({ comparisonEntries, primaryKeys, groupPadding, horizontal, xAccessor, yAccessor, getElementStyles, resolveFill }) => {
|
|
6709
6695
|
const context = useContext(DataContext);
|
|
6710
6696
|
const xScale = context?.xScale;
|
|
@@ -6763,8 +6749,7 @@ const ComparisonBars = ({ comparisonEntries, primaryKeys, groupPadding, horizont
|
|
|
6763
6749
|
children: rects
|
|
6764
6750
|
});
|
|
6765
6751
|
};
|
|
6766
|
-
|
|
6767
|
-
//#region src/charts/bar-chart/private/band-highlight.tsx
|
|
6752
|
+
// src/charts/bar-chart/private/band-highlight.tsx
|
|
6768
6753
|
/**
|
|
6769
6754
|
* Render and report the active band using the chart’s registered scales.
|
|
6770
6755
|
* @param root0 - Highlight options.
|
|
@@ -6823,8 +6808,7 @@ function BandHighlight({ visible, horizontal, onChange }) {
|
|
|
6823
6808
|
fill: CATALOG_POINTERS.surfaceSecondary
|
|
6824
6809
|
});
|
|
6825
6810
|
}
|
|
6826
|
-
|
|
6827
|
-
//#region src/charts/bar-chart/private/band-tooltip.tsx
|
|
6811
|
+
// src/charts/bar-chart/private/band-tooltip.tsx
|
|
6828
6812
|
/**
|
|
6829
6813
|
* Find a category by its painted center, including outer padding and reversed ranges.
|
|
6830
6814
|
* @param data - Registered series points.
|
|
@@ -6943,8 +6927,7 @@ function BandTooltip({ keys, slots, groupPadding, withTooltips, onPointerDown, o
|
|
|
6943
6927
|
useEventEmitter("pointerup", onPointerUp ? handlePointer : void 0);
|
|
6944
6928
|
return null;
|
|
6945
6929
|
}
|
|
6946
|
-
|
|
6947
|
-
//#region src/charts/bar-chart/private/grouped-bars.ts
|
|
6930
|
+
// src/charts/bar-chart/private/grouped-bars.ts
|
|
6948
6931
|
/**
|
|
6949
6932
|
* Pairs each comparison series with the primary of its `group`, or with the only primary.
|
|
6950
6933
|
*
|
|
@@ -6984,8 +6967,7 @@ function getGroupedBarColors(series, colors, background) {
|
|
|
6984
6967
|
});
|
|
6985
6968
|
return barColors;
|
|
6986
6969
|
}
|
|
6987
|
-
|
|
6988
|
-
//#region src/charts/bar-chart/use-bar-colors.ts
|
|
6970
|
+
// src/charts/bar-chart/use-bar-colors.ts
|
|
6989
6971
|
/**
|
|
6990
6972
|
* Reads the colors `BarChart` fills series with, so a custom tooltip or legend can match the bars.
|
|
6991
6973
|
*
|
|
@@ -7007,8 +6989,7 @@ function useBarColors() {
|
|
|
7007
6989
|
comparisonOpacity
|
|
7008
6990
|
]);
|
|
7009
6991
|
}
|
|
7010
|
-
|
|
7011
|
-
//#region src/charts/bar-chart/use-bar-legend-items.ts
|
|
6992
|
+
// src/charts/bar-chart/use-bar-legend-items.ts
|
|
7012
6993
|
const isComparison = (data, label) => data.some((series) => series.label === label && series.options?.type === "comparison");
|
|
7013
6994
|
/**
|
|
7014
6995
|
* Applies what a bar layout changes about a legend: overlap lists every primary before every comparison, as it draws their slots, with every swatch opaque like its bar; a collapsed grouped item takes its comparison's tint, the wider bar that frames the group.
|
|
@@ -7072,8 +7053,7 @@ function useBarLegendItems(data, options = {}, legendShape) {
|
|
|
7072
7053
|
seriesColors
|
|
7073
7054
|
]);
|
|
7074
7055
|
}
|
|
7075
|
-
|
|
7076
|
-
//#region src/charts/bar-chart/bar-chart.tsx
|
|
7056
|
+
// src/charts/bar-chart/bar-chart.tsx
|
|
7077
7057
|
const validateData$2 = (data) => {
|
|
7078
7058
|
if (!data?.length) return __("No data available", "jetpack-charts");
|
|
7079
7059
|
if (data.some((series) => series.data.some((point) => isInvalidReading(point.value, { allowMissing: true }) || !point.label && (!("date" in point && point.date) || isNaN(point.date.getTime()))))) return __("Invalid data", "jetpack-charts");
|
|
@@ -7264,10 +7244,7 @@ const BarChartInternal = ({ data, ariaLabel, chartId: providedChartId, width, he
|
|
|
7264
7244
|
const primaryKey = tooltipData?.nearestDatum?.key;
|
|
7265
7245
|
const categoryLabel = chartOptions.tooltip.labelFormatter(nearestDatum.label || (nearestDatum.date ? nearestDatum.date.getTime() : 0), 0, []);
|
|
7266
7246
|
const comparisonEntry = comparisonEntries.find((entry) => entry.primaryKey === primaryKey);
|
|
7267
|
-
const comparisonDatum = comparisonEntry?.series.data.find((point) =>
|
|
7268
|
-
const p = point;
|
|
7269
|
-
return nearestDatum.label != null ? p.label === nearestDatum.label : !!nearestDatum.date && !!p.date && p.date.getTime() === nearestDatum.date.getTime();
|
|
7270
|
-
});
|
|
7247
|
+
const comparisonDatum = comparisonEntry?.series.data.find((point) => isSameCategory(point, nearestDatum));
|
|
7271
7248
|
if (comparisonEntry && comparisonDatum) return /* @__PURE__ */ jsxs("div", {
|
|
7272
7249
|
className: bar_chart_module_default["bar-chart__tooltip"],
|
|
7273
7250
|
children: [
|
|
@@ -7337,6 +7314,17 @@ const BarChartInternal = ({ data, ariaLabel, chartId: providedChartId, width, he
|
|
|
7337
7314
|
slotOf: overlapSlots.slotOf
|
|
7338
7315
|
}, [overlapSlots]);
|
|
7339
7316
|
const selectedSlot = useMemo(() => getSelectedSlot(overlapSlots, selectedIndex), [overlapSlots, selectedIndex]);
|
|
7317
|
+
const selectedGroup = useMemo(() => {
|
|
7318
|
+
const stop = overlapSlots || selectedIndex === void 0 ? void 0 : barAt(selectedIndex);
|
|
7319
|
+
if (!stop) return;
|
|
7320
|
+
return membersAt(primaryEntries, stop.datum, stop.key);
|
|
7321
|
+
}, [
|
|
7322
|
+
overlapSlots,
|
|
7323
|
+
selectedIndex,
|
|
7324
|
+
barAt,
|
|
7325
|
+
primaryEntries
|
|
7326
|
+
]);
|
|
7327
|
+
const selectedMembers = selectedSlot?.members ?? selectedGroup;
|
|
7340
7328
|
const selectedBar = useMemo(() => {
|
|
7341
7329
|
if (overlapSlots) return selectedSlot;
|
|
7342
7330
|
const bar = selectedIndex === void 0 ? void 0 : barAt(selectedIndex);
|
|
@@ -7499,10 +7487,7 @@ const BarChartInternal = ({ data, ariaLabel, chartId: providedChartId, width, he
|
|
|
7499
7487
|
...!horizontal && valueTicks ? { tickValues: valueTicks } : {}
|
|
7500
7488
|
})] })
|
|
7501
7489
|
}),
|
|
7502
|
-
withTooltips &&
|
|
7503
|
-
members: selectedSlot.members,
|
|
7504
|
-
index: selectedSlot.index
|
|
7505
|
-
}),
|
|
7490
|
+
withTooltips && selectedMembers && /* @__PURE__ */ jsx(SlotTooltipMembers, { members: selectedMembers }),
|
|
7506
7491
|
withTooltips && /* @__PURE__ */ jsx(XYChartTooltip, {
|
|
7507
7492
|
tooltipPlacement,
|
|
7508
7493
|
tooltipAnchorTop,
|
|
@@ -7514,7 +7499,6 @@ const BarChartInternal = ({ data, ariaLabel, chartId: providedChartId, width, he
|
|
|
7514
7499
|
selectedIndex,
|
|
7515
7500
|
tooltipRef,
|
|
7516
7501
|
keyboardFocusedClassName: bar_chart_module_default["bar-chart__tooltip--keyboard-focused"],
|
|
7517
|
-
series: stops.series,
|
|
7518
7502
|
mode: "individual"
|
|
7519
7503
|
})
|
|
7520
7504
|
]
|
|
@@ -7532,8 +7516,7 @@ const BarChartWithProvider = (props) => {
|
|
|
7532
7516
|
BarChartWithProvider.displayName = "BarChart";
|
|
7533
7517
|
const BarChart = attachSubComponents(BarChartWithProvider, { Legend });
|
|
7534
7518
|
const BarChartResponsive = attachSubComponents(withResponsive(BarChartWithProvider), { Legend });
|
|
7535
|
-
|
|
7536
|
-
//#region src/charts/bar-list-chart/bar-list-chart.tsx
|
|
7519
|
+
// src/charts/bar-list-chart/bar-list-chart.tsx
|
|
7537
7520
|
/**
|
|
7538
7521
|
* Get the bandwidth of a scale
|
|
7539
7522
|
* @param scale - The scale to get the bandwidth of
|
|
@@ -7702,8 +7685,7 @@ const BarListChart = (props) => {
|
|
|
7702
7685
|
};
|
|
7703
7686
|
BarListChart.displayName = "BarListChart";
|
|
7704
7687
|
const BarListChartResponsive = withResponsive(BarListChart);
|
|
7705
|
-
|
|
7706
|
-
//#region src/charts/conversion-funnel-chart/conversion-funnel-chart.module.scss
|
|
7688
|
+
// src/charts/conversion-funnel-chart/conversion-funnel-chart.module.scss
|
|
7707
7689
|
var conversion_funnel_chart_module_default = {
|
|
7708
7690
|
"bar-container": "a8ccharts-mGEVca-bar-container",
|
|
7709
7691
|
"change-indicator": "a8ccharts-mGEVca-change-indicator",
|
|
@@ -7722,83 +7704,131 @@ var conversion_funnel_chart_module_default = {
|
|
|
7722
7704
|
"main-rate": "a8ccharts-mGEVca-main-rate",
|
|
7723
7705
|
"step-label": "a8ccharts-mGEVca-step-label",
|
|
7724
7706
|
"step-rate": "a8ccharts-mGEVca-step-rate",
|
|
7707
|
+
"step-text": "a8ccharts-mGEVca-step-text",
|
|
7725
7708
|
"stretch": "a8ccharts-mGEVca-stretch",
|
|
7726
|
-
"tooltip-
|
|
7727
|
-
"tooltip-title": "a8ccharts-mGEVca-tooltip-title"
|
|
7709
|
+
"tooltip-label": "a8ccharts-mGEVca-tooltip-label",
|
|
7710
|
+
"tooltip-title": "a8ccharts-mGEVca-tooltip-title",
|
|
7711
|
+
"tooltip-value": "a8ccharts-mGEVca-tooltip-value"
|
|
7728
7712
|
};
|
|
7729
|
-
|
|
7730
|
-
//#region src/charts/conversion-funnel-chart/private/use-funnel-selection.ts
|
|
7713
|
+
// src/charts/conversion-funnel-chart/private/use-funnel-selection.ts
|
|
7731
7714
|
/**
|
|
7732
|
-
* Custom hook to manage funnel
|
|
7715
|
+
* Custom hook to manage funnel step selection state
|
|
7733
7716
|
* @param hideTooltip - Function to hide tooltip when selection is cleared
|
|
7734
|
-
* @return Object containing selection state and
|
|
7717
|
+
* @return Object containing selection state and its setters
|
|
7735
7718
|
*/
|
|
7736
7719
|
const useFunnelSelection = (hideTooltip) => {
|
|
7737
|
-
const [
|
|
7720
|
+
const [selectedStepId, setSelectedStepId] = useState(null);
|
|
7738
7721
|
return {
|
|
7739
|
-
|
|
7740
|
-
|
|
7741
|
-
if (clickedStep === stepId) {
|
|
7742
|
-
setClickedStep(null);
|
|
7743
|
-
hideTooltip?.();
|
|
7744
|
-
} else setClickedStep(stepId);
|
|
7745
|
-
}, [clickedStep, hideTooltip]),
|
|
7746
|
-
handleBarKeyDown: useCallback((stepId, event) => {
|
|
7747
|
-
if (event.key === "Enter" || event.key === " ") {
|
|
7748
|
-
event.preventDefault();
|
|
7749
|
-
if (clickedStep === stepId) {
|
|
7750
|
-
setClickedStep(null);
|
|
7751
|
-
hideTooltip?.();
|
|
7752
|
-
} else setClickedStep(stepId);
|
|
7753
|
-
} else if (event.key === "Escape") {
|
|
7754
|
-
event.preventDefault();
|
|
7755
|
-
setClickedStep(null);
|
|
7756
|
-
hideTooltip?.();
|
|
7757
|
-
}
|
|
7758
|
-
}, [clickedStep, hideTooltip]),
|
|
7722
|
+
selectedStepId,
|
|
7723
|
+
selectStep: setSelectedStepId,
|
|
7759
7724
|
clearSelection: useCallback(() => {
|
|
7760
|
-
|
|
7725
|
+
setSelectedStepId(null);
|
|
7761
7726
|
hideTooltip?.();
|
|
7762
7727
|
}, [hideTooltip]),
|
|
7763
7728
|
getStepState: useCallback((stepId) => ({
|
|
7764
|
-
|
|
7765
|
-
isBlurred:
|
|
7766
|
-
}), [
|
|
7729
|
+
isSelected: selectedStepId === stepId,
|
|
7730
|
+
isBlurred: selectedStepId !== null && selectedStepId !== stepId
|
|
7731
|
+
}), [selectedStepId])
|
|
7732
|
+
};
|
|
7733
|
+
};
|
|
7734
|
+
// src/charts/conversion-funnel-chart/private/use-roving-step-focus.ts
|
|
7735
|
+
const getTargetIndex = (key, index, count, isRtl) => {
|
|
7736
|
+
const nextKey = isRtl ? "ArrowLeft" : "ArrowRight";
|
|
7737
|
+
const previousKey = isRtl ? "ArrowRight" : "ArrowLeft";
|
|
7738
|
+
switch (key) {
|
|
7739
|
+
case nextKey: return Math.min(index + 1, count - 1);
|
|
7740
|
+
case previousKey: return Math.max(index - 1, 0);
|
|
7741
|
+
case "Home": return 0;
|
|
7742
|
+
case "End": return count - 1;
|
|
7743
|
+
default: return;
|
|
7744
|
+
}
|
|
7745
|
+
};
|
|
7746
|
+
/**
|
|
7747
|
+
* Roving tabindex for the funnel steps: one Tab stop, and arrow keys, Home and End move focus between steps.
|
|
7748
|
+
*
|
|
7749
|
+
* @param stepIds - Step ids in visual order.
|
|
7750
|
+
* @param selectedStepId - The selected step, which holds the Tab stop until any step has taken focus.
|
|
7751
|
+
* @return Tab index, element registration, focus and key handlers for each step.
|
|
7752
|
+
*/
|
|
7753
|
+
const useRovingStepFocus = (stepIds, selectedStepId) => {
|
|
7754
|
+
const [focusedStepId, setFocusedStepId] = useState(null);
|
|
7755
|
+
const stepElements = useRef(/* @__PURE__ */ new Map());
|
|
7756
|
+
const tabStopId = [focusedStepId, selectedStepId].find((id) => id !== null && stepIds.includes(id)) ?? stepIds[0];
|
|
7757
|
+
return {
|
|
7758
|
+
getTabIndex: useCallback((stepId) => stepId === tabStopId ? 0 : -1, [tabStopId]),
|
|
7759
|
+
setStepElement: useCallback((stepId, element) => {
|
|
7760
|
+
if (element) stepElements.current.set(stepId, element);
|
|
7761
|
+
else stepElements.current.delete(stepId);
|
|
7762
|
+
}, []),
|
|
7763
|
+
handleStepFocus: useCallback((stepId) => {
|
|
7764
|
+
setFocusedStepId(stepId);
|
|
7765
|
+
}, []),
|
|
7766
|
+
handleNavigationKey: useCallback((stepId, event) => {
|
|
7767
|
+
if (event.altKey || event.ctrlKey || event.metaKey) return false;
|
|
7768
|
+
const isRtl = getComputedStyle(event.currentTarget).direction === "rtl";
|
|
7769
|
+
const targetIndex = getTargetIndex(event.key, stepIds.indexOf(stepId), stepIds.length, isRtl);
|
|
7770
|
+
if (targetIndex === void 0) return false;
|
|
7771
|
+
event.preventDefault();
|
|
7772
|
+
stepElements.current.get(stepIds[targetIndex])?.focus();
|
|
7773
|
+
return true;
|
|
7774
|
+
}, [stepIds])
|
|
7767
7775
|
};
|
|
7768
7776
|
};
|
|
7769
|
-
|
|
7770
|
-
//#region src/charts/conversion-funnel-chart/conversion-funnel-chart.tsx
|
|
7777
|
+
// src/charts/conversion-funnel-chart/conversion-funnel-chart.tsx
|
|
7771
7778
|
/** Chart height (px) below which the funnel tightens its gaps so the bars keep their room. */
|
|
7772
7779
|
const SHORT_CHART_HEIGHT = 180;
|
|
7780
|
+
const formatStepCount = (count) => sprintf(_n("%s item", "%s items", count, "jetpack-charts"), formatMetricValue(count));
|
|
7781
|
+
const getDefaultTooltipContent = (step) => ({
|
|
7782
|
+
value: step.count === void 0 ? void 0 : formatStepCount(step.count),
|
|
7783
|
+
rows: [{
|
|
7784
|
+
label: __("Conversion rate", "jetpack-charts"),
|
|
7785
|
+
value: formatPercentage(step.rate)
|
|
7786
|
+
}]
|
|
7787
|
+
});
|
|
7788
|
+
const getDefaultTooltipIds = (tooltipId, { rows = [] }) => ({
|
|
7789
|
+
value: `${tooltipId}-value`,
|
|
7790
|
+
rows: rows.map((_, index) => ({
|
|
7791
|
+
label: `${tooltipId}-row-${index}-label`,
|
|
7792
|
+
value: `${tooltipId}-row-${index}-value`
|
|
7793
|
+
}))
|
|
7794
|
+
});
|
|
7795
|
+
const getDefaultTooltipDescriptionIds = (tooltipId, content) => {
|
|
7796
|
+
const ids = getDefaultTooltipIds(tooltipId, content);
|
|
7797
|
+
return [...content.value ? [ids.value] : [], ...ids.rows.flatMap((row) => [row.label, row.value])].join(" ");
|
|
7798
|
+
};
|
|
7773
7799
|
/**
|
|
7774
7800
|
* Internal ConversionFunnelChart component with chart registration
|
|
7775
7801
|
*
|
|
7776
|
-
* @param props
|
|
7777
|
-
* @param props.chartId
|
|
7778
|
-
* @param props.mainRate
|
|
7779
|
-
* @param props.changeIndicator
|
|
7780
|
-
* @param props.steps
|
|
7781
|
-
* @param props.loading
|
|
7782
|
-
* @param props.animation
|
|
7783
|
-
* @param props.className
|
|
7784
|
-
* @param props.ariaLabel
|
|
7785
|
-
* @param props.height
|
|
7786
|
-
* @param props.style
|
|
7787
|
-
* @param props.renderStepLabel
|
|
7788
|
-
* @param props.renderStepRate
|
|
7789
|
-
* @param props.renderMainMetric
|
|
7790
|
-
* @param props.renderTooltip
|
|
7791
|
-
* @param props.tooltipStyle
|
|
7802
|
+
* @param props - Component props
|
|
7803
|
+
* @param props.chartId - Optional unique identifier for the chart
|
|
7804
|
+
* @param props.mainRate - Main conversion rate to highlight
|
|
7805
|
+
* @param props.changeIndicator - Change indicator (e.g., +2%, -1.5%)
|
|
7806
|
+
* @param props.steps - Array of funnel steps
|
|
7807
|
+
* @param props.loading - Whether the chart is in loading state
|
|
7808
|
+
* @param props.animation - Whether to show chart animation on initial render or not
|
|
7809
|
+
* @param props.className - Additional CSS class name
|
|
7810
|
+
* @param props.ariaLabel - Accessible name for the chart group
|
|
7811
|
+
* @param props.height - Height of the chart container. Falls back to style.height if set, otherwise defaults to "100%".
|
|
7812
|
+
* @param props.style - Custom styling
|
|
7813
|
+
* @param props.renderStepLabel - Custom render function for step labels
|
|
7814
|
+
* @param props.renderStepRate - Custom render function for step rates
|
|
7815
|
+
* @param props.renderMainMetric - Custom render function for the entire main metric section
|
|
7816
|
+
* @param props.renderTooltip - Custom render function for tooltip content
|
|
7817
|
+
* @param props.tooltipStyle - Inline styles merged over the tooltip box defaults
|
|
7818
|
+
* @param props.getTooltipContent - What each step's tooltip shows, which screen readers also read
|
|
7792
7819
|
* @return JSX element representing the conversion funnel chart
|
|
7793
7820
|
*/
|
|
7794
|
-
const ConversionFunnelChartInternal = ({ mainRate, changeIndicator, steps, loading = false, animation, className, ariaLabel, chartId: providedChartId, height, style, renderStepLabel, renderStepRate, renderMainMetric, renderTooltip, tooltipStyle }) => {
|
|
7821
|
+
const ConversionFunnelChartInternal = ({ mainRate, changeIndicator, steps, loading = false, animation, className, ariaLabel, chartId: providedChartId, height, style, renderStepLabel, renderStepRate, renderMainMetric, renderTooltip, tooltipStyle, getTooltipContent = getDefaultTooltipContent }) => {
|
|
7795
7822
|
const chartId = useChartId(providedChartId);
|
|
7796
7823
|
const { getElementStyles, isColorPaletteResolved } = useGlobalChartsContext();
|
|
7797
7824
|
const chartRef = useRef(null);
|
|
7798
|
-
const
|
|
7825
|
+
const isPointerFocusRef = useRef(false);
|
|
7799
7826
|
const [scopeNode, setScopeNode] = useState(null);
|
|
7827
|
+
const tooltipId = useId();
|
|
7800
7828
|
const { tooltipData, tooltipLeft, tooltipTop, tooltipOpen, showTooltip, hideTooltip } = useTooltip();
|
|
7801
|
-
const {
|
|
7829
|
+
const { selectedStepId, selectStep, clearSelection, getStepState } = useFunnelSelection(hideTooltip);
|
|
7830
|
+
const stepIds = useMemo(() => steps?.map((step) => step.id) ?? [], [steps]);
|
|
7831
|
+
const { getTabIndex, setStepElement, handleStepFocus, handleNavigationKey } = useRovingStepFocus(stepIds, selectedStepId);
|
|
7802
7832
|
const standaloneScopeClass = useStandaloneScopeClass();
|
|
7803
7833
|
const [measureChartRef, , chartHeight] = useElementSize();
|
|
7804
7834
|
const gap = chartHeight > 0 && chartHeight < SHORT_CHART_HEIGHT ? "sm" : "xl";
|
|
@@ -7807,94 +7837,71 @@ const ConversionFunnelChartInternal = ({ mainRate, changeIndicator, steps, loadi
|
|
|
7807
7837
|
setScopeNode(node);
|
|
7808
7838
|
measureChartRef(node);
|
|
7809
7839
|
}, [measureChartRef]);
|
|
7810
|
-
const
|
|
7811
|
-
|
|
7812
|
-
|
|
7813
|
-
|
|
7814
|
-
}, [clearSelection, hideTooltip]);
|
|
7815
|
-
const showTooltipAt = useCallback((step, x, y) => {
|
|
7816
|
-
showTooltip({
|
|
7840
|
+
const selectStepAt = useCallback((step, x, y) => {
|
|
7841
|
+
selectStep(step.id);
|
|
7842
|
+
const bounds = chartRef.current?.getBoundingClientRect();
|
|
7843
|
+
if (bounds) showTooltip({
|
|
7817
7844
|
tooltipData: step,
|
|
7818
|
-
tooltipLeft: x,
|
|
7819
|
-
tooltipTop: y - 10
|
|
7845
|
+
tooltipLeft: x - bounds.left,
|
|
7846
|
+
tooltipTop: y - bounds.top - 10
|
|
7820
7847
|
});
|
|
7821
|
-
}, [showTooltip]);
|
|
7822
|
-
const
|
|
7823
|
-
const
|
|
7824
|
-
|
|
7825
|
-
|
|
7826
|
-
x: event.clientX - bounds.left,
|
|
7827
|
-
y: event.clientY - bounds.top
|
|
7828
|
-
};
|
|
7829
|
-
}, []);
|
|
7830
|
-
const getKeyboardTooltipCoords = useCallback((event) => {
|
|
7831
|
-
const bounds = chartRef.current?.getBoundingClientRect();
|
|
7832
|
-
if (!bounds) return null;
|
|
7833
|
-
const rect = event.currentTarget.getBoundingClientRect();
|
|
7834
|
-
return {
|
|
7835
|
-
x: rect.left + rect.width / 2 - bounds.left,
|
|
7836
|
-
y: rect.top - bounds.top
|
|
7837
|
-
};
|
|
7838
|
-
}, []);
|
|
7839
|
-
const handleStepInteraction = useCallback((step, event, interactionType) => {
|
|
7840
|
-
selectedBarRef.current = event.currentTarget;
|
|
7841
|
-
const { isClicked } = getStepState(step.id);
|
|
7842
|
-
if (isClicked) {
|
|
7843
|
-
if (interactionType === "click") handleBarClick(step.id);
|
|
7844
|
-
else handleBarKeyDown(step.id, event);
|
|
7845
|
-
return;
|
|
7846
|
-
}
|
|
7847
|
-
if (interactionType === "click") {
|
|
7848
|
-
handleBarClick(step.id);
|
|
7849
|
-
const coords = getMouseTooltipCoords(event);
|
|
7850
|
-
if (coords) showTooltipAt(step, coords.x, coords.y);
|
|
7851
|
-
} else {
|
|
7852
|
-
handleBarKeyDown(step.id, event);
|
|
7853
|
-
const coords = getKeyboardTooltipCoords(event);
|
|
7854
|
-
if (coords) showTooltipAt(step, coords.x, coords.y);
|
|
7855
|
-
}
|
|
7856
|
-
}, [
|
|
7857
|
-
getStepState,
|
|
7858
|
-
handleBarClick,
|
|
7859
|
-
handleBarKeyDown,
|
|
7860
|
-
showTooltipAt,
|
|
7861
|
-
getMouseTooltipCoords,
|
|
7862
|
-
getKeyboardTooltipCoords
|
|
7863
|
-
]);
|
|
7848
|
+
}, [selectStep, showTooltip]);
|
|
7849
|
+
const selectStepAtElement = useCallback((step, element) => {
|
|
7850
|
+
const rect = element.getBoundingClientRect();
|
|
7851
|
+
selectStepAt(step, rect.left + rect.width / 2, rect.top);
|
|
7852
|
+
}, [selectStepAt]);
|
|
7864
7853
|
const stepHandlers = useMemo(() => {
|
|
7865
7854
|
const handlers = /* @__PURE__ */ new Map();
|
|
7866
7855
|
steps.forEach((step) => {
|
|
7856
|
+
const onPointerDown = () => {
|
|
7857
|
+
isPointerFocusRef.current = true;
|
|
7858
|
+
};
|
|
7867
7859
|
const onClick = (event) => {
|
|
7868
|
-
|
|
7869
|
-
|
|
7860
|
+
isPointerFocusRef.current = false;
|
|
7861
|
+
selectStepAt(step, event.clientX, event.clientY);
|
|
7862
|
+
};
|
|
7863
|
+
const onFocus = (event) => {
|
|
7864
|
+
handleStepFocus(step.id);
|
|
7865
|
+
if (isPointerFocusRef.current) isPointerFocusRef.current = false;
|
|
7866
|
+
else if (step.id !== selectedStepId) selectStepAtElement(step, event.currentTarget);
|
|
7870
7867
|
};
|
|
7871
7868
|
const onKeyDown = (event) => {
|
|
7872
|
-
|
|
7873
|
-
|
|
7874
|
-
|
|
7875
|
-
|
|
7869
|
+
isPointerFocusRef.current = false;
|
|
7870
|
+
if (handleNavigationKey(step.id, event)) return;
|
|
7871
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
7872
|
+
event.preventDefault();
|
|
7873
|
+
selectStepAtElement(step, event.currentTarget);
|
|
7874
|
+
} else if (event.key === "Escape" && selectedStepId !== null) {
|
|
7875
|
+
event.preventDefault();
|
|
7876
|
+
clearSelection();
|
|
7876
7877
|
}
|
|
7877
7878
|
};
|
|
7879
|
+
const ref = (element) => setStepElement(step.id, element);
|
|
7878
7880
|
handlers.set(step.id, {
|
|
7881
|
+
onPointerDown,
|
|
7879
7882
|
onClick,
|
|
7880
|
-
onKeyDown
|
|
7883
|
+
onKeyDown,
|
|
7884
|
+
onFocus,
|
|
7885
|
+
ref
|
|
7881
7886
|
});
|
|
7882
7887
|
});
|
|
7883
7888
|
return handlers;
|
|
7884
7889
|
}, [
|
|
7885
7890
|
steps,
|
|
7886
|
-
|
|
7887
|
-
|
|
7891
|
+
selectedStepId,
|
|
7892
|
+
selectStepAt,
|
|
7893
|
+
selectStepAtElement,
|
|
7894
|
+
clearSelection,
|
|
7895
|
+
handleNavigationKey,
|
|
7896
|
+
handleStepFocus,
|
|
7897
|
+
setStepElement
|
|
7888
7898
|
]);
|
|
7889
|
-
|
|
7890
|
-
|
|
7891
|
-
|
|
7892
|
-
|
|
7893
|
-
|
|
7894
|
-
|
|
7895
|
-
document.removeEventListener("mousedown", handleDocumentClick);
|
|
7896
|
-
};
|
|
7897
|
-
}, [clearSelectionAndRef]);
|
|
7899
|
+
const handleStepsBlur = useCallback((event) => {
|
|
7900
|
+
if (!event.currentTarget.contains(event.relatedTarget) && document.hasFocus()) {
|
|
7901
|
+
isPointerFocusRef.current = false;
|
|
7902
|
+
clearSelection();
|
|
7903
|
+
}
|
|
7904
|
+
}, [clearSelection]);
|
|
7898
7905
|
const resolvedHeight = height ?? style?.height ?? "100%";
|
|
7899
7906
|
const { color: barColor } = getElementStyles ? getElementStyles({ index: 0 }) : { color: "#000000" };
|
|
7900
7907
|
const isPositiveChange = changeIndicator?.startsWith("+");
|
|
@@ -7906,18 +7913,41 @@ const ConversionFunnelChartInternal = ({ mainRate, changeIndicator, steps, loadi
|
|
|
7906
7913
|
className: clsx(conversion_funnel_chart_module_default["change-indicator"], conversion_funnel_chart_module_default[isPositiveChange ? "change-indicator--positive" : "change-indicator--negative"]),
|
|
7907
7914
|
children: changeIndicator
|
|
7908
7915
|
})] });
|
|
7909
|
-
const renderDefaultTooltip = (step) =>
|
|
7910
|
-
|
|
7911
|
-
|
|
7912
|
-
|
|
7913
|
-
|
|
7914
|
-
|
|
7915
|
-
|
|
7916
|
-
|
|
7917
|
-
|
|
7918
|
-
|
|
7919
|
-
|
|
7920
|
-
|
|
7916
|
+
const renderDefaultTooltip = (step, content) => {
|
|
7917
|
+
const ids = getDefaultTooltipIds(tooltipId, content);
|
|
7918
|
+
return /* @__PURE__ */ jsxs(Stack, {
|
|
7919
|
+
direction: "column",
|
|
7920
|
+
gap: "xs",
|
|
7921
|
+
children: [/* @__PURE__ */ jsxs(Stack, {
|
|
7922
|
+
direction: "row",
|
|
7923
|
+
justify: "space-between",
|
|
7924
|
+
align: "baseline",
|
|
7925
|
+
gap: "sm",
|
|
7926
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
7927
|
+
className: conversion_funnel_chart_module_default["tooltip-title"],
|
|
7928
|
+
children: step.label
|
|
7929
|
+
}), content.value && /* @__PURE__ */ jsx("span", {
|
|
7930
|
+
id: ids.value,
|
|
7931
|
+
className: conversion_funnel_chart_module_default["tooltip-value"],
|
|
7932
|
+
children: content.value
|
|
7933
|
+
})]
|
|
7934
|
+
}), content.rows?.map((row, index) => /* @__PURE__ */ jsxs(Stack, {
|
|
7935
|
+
direction: "row",
|
|
7936
|
+
justify: "space-between",
|
|
7937
|
+
align: "baseline",
|
|
7938
|
+
gap: "sm",
|
|
7939
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
7940
|
+
id: ids.rows[index].label,
|
|
7941
|
+
className: conversion_funnel_chart_module_default["tooltip-label"],
|
|
7942
|
+
children: row.label
|
|
7943
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
7944
|
+
id: ids.rows[index].value,
|
|
7945
|
+
className: conversion_funnel_chart_module_default["tooltip-value"],
|
|
7946
|
+
children: row.value
|
|
7947
|
+
})]
|
|
7948
|
+
}, row.label))]
|
|
7949
|
+
});
|
|
7950
|
+
};
|
|
7921
7951
|
const isDataValid = Boolean(steps && steps.length > 0);
|
|
7922
7952
|
const chartMetadata = useMemo(() => ({
|
|
7923
7953
|
mainRate,
|
|
@@ -7952,6 +7982,26 @@ const ConversionFunnelChartInternal = ({ mainRate, changeIndicator, steps, loadi
|
|
|
7952
7982
|
})
|
|
7953
7983
|
});
|
|
7954
7984
|
const maxRate = Math.max(...steps.map((step) => step.rate));
|
|
7985
|
+
const tooltipStep = tooltipOpen ? tooltipData : void 0;
|
|
7986
|
+
let tooltipContent = null;
|
|
7987
|
+
let tooltipDescriptionIds = "";
|
|
7988
|
+
if (tooltipStep) {
|
|
7989
|
+
const index = steps.findIndex((s) => s.id === tooltipStep.id);
|
|
7990
|
+
const content = getTooltipContent(tooltipStep, index);
|
|
7991
|
+
if (renderTooltip) {
|
|
7992
|
+
tooltipContent = renderTooltip({
|
|
7993
|
+
step: tooltipStep,
|
|
7994
|
+
index,
|
|
7995
|
+
content,
|
|
7996
|
+
top: tooltipTop,
|
|
7997
|
+
left: tooltipLeft
|
|
7998
|
+
});
|
|
7999
|
+
tooltipDescriptionIds = tooltipId;
|
|
8000
|
+
} else {
|
|
8001
|
+
tooltipContent = renderDefaultTooltip(tooltipStep, content);
|
|
8002
|
+
tooltipDescriptionIds = getDefaultTooltipDescriptionIds(tooltipId, content);
|
|
8003
|
+
}
|
|
8004
|
+
}
|
|
7955
8005
|
return /* @__PURE__ */ jsxs(Stack, {
|
|
7956
8006
|
direction: "column",
|
|
7957
8007
|
gap,
|
|
@@ -7980,10 +8030,16 @@ const ConversionFunnelChartInternal = ({ mainRate, changeIndicator, steps, loadi
|
|
|
7980
8030
|
direction: "row",
|
|
7981
8031
|
align: "flex-end",
|
|
7982
8032
|
gap: "lg",
|
|
8033
|
+
role: "listbox",
|
|
8034
|
+
"aria-label": __("Funnel steps", "jetpack-charts"),
|
|
8035
|
+
"aria-orientation": "horizontal",
|
|
8036
|
+
onBlur: handleStepsBlur,
|
|
7983
8037
|
className: conversion_funnel_chart_module_default["funnel-container"],
|
|
7984
8038
|
children: steps.map((step, index) => {
|
|
7985
8039
|
const barHeight = step.rate / maxRate * 100;
|
|
7986
|
-
const { isBlurred } = getStepState(step.id);
|
|
8040
|
+
const { isSelected, isBlurred } = getStepState(step.id);
|
|
8041
|
+
const handlers = stepHandlers.get(step.id);
|
|
8042
|
+
const isDescribedByTooltip = Boolean(tooltipContent && tooltipDescriptionIds) && tooltipStep?.id === step.id;
|
|
7987
8043
|
return /* @__PURE__ */ jsxs(Stack, {
|
|
7988
8044
|
direction: "column",
|
|
7989
8045
|
className: clsx(conversion_funnel_chart_module_default["funnel-step"], isColorPaletteResolved && conversion_funnel_chart_module_default["funnel-step--animated"], isBlurred && conversion_funnel_chart_module_default["funnel-step--blurred"]),
|
|
@@ -7991,6 +8047,8 @@ const ConversionFunnelChartInternal = ({ mainRate, changeIndicator, steps, loadi
|
|
|
7991
8047
|
children: [/* @__PURE__ */ jsxs(Stack, {
|
|
7992
8048
|
direction: "column",
|
|
7993
8049
|
gap: "xs",
|
|
8050
|
+
className: conversion_funnel_chart_module_default["step-text"],
|
|
8051
|
+
"aria-hidden": "true",
|
|
7994
8052
|
children: [renderStepLabel ? renderStepLabel({
|
|
7995
8053
|
step,
|
|
7996
8054
|
index,
|
|
@@ -8010,11 +8068,16 @@ const ConversionFunnelChartInternal = ({ mainRate, changeIndicator, steps, loadi
|
|
|
8010
8068
|
direction: "column",
|
|
8011
8069
|
justify: "flex-end",
|
|
8012
8070
|
className: conversion_funnel_chart_module_default["bar-container"],
|
|
8013
|
-
|
|
8014
|
-
|
|
8015
|
-
|
|
8016
|
-
|
|
8017
|
-
|
|
8071
|
+
ref: handlers?.ref,
|
|
8072
|
+
onPointerDown: handlers?.onPointerDown,
|
|
8073
|
+
onClick: handlers?.onClick,
|
|
8074
|
+
onKeyDown: handlers?.onKeyDown,
|
|
8075
|
+
onFocus: handlers?.onFocus,
|
|
8076
|
+
role: "option",
|
|
8077
|
+
tabIndex: getTabIndex(step.id),
|
|
8078
|
+
"aria-label": sprintf(__("%1$s, %2$s", "jetpack-charts"), step.label, formatPercentage(step.rate)),
|
|
8079
|
+
"aria-selected": isSelected,
|
|
8080
|
+
"aria-describedby": isDescribedByTooltip ? tooltipDescriptionIds : void 0,
|
|
8018
8081
|
children: /* @__PURE__ */ jsx("div", {
|
|
8019
8082
|
className: clsx(conversion_funnel_chart_module_default["funnel-bar"], { [conversion_funnel_chart_module_default["funnel-bar--animated"]]: animation && !loading && !prefersReducedMotion }),
|
|
8020
8083
|
style: {
|
|
@@ -8026,25 +8089,17 @@ const ConversionFunnelChartInternal = ({ mainRate, changeIndicator, steps, loadi
|
|
|
8026
8089
|
}, step.id);
|
|
8027
8090
|
})
|
|
8028
8091
|
})]
|
|
8029
|
-
}),
|
|
8030
|
-
|
|
8031
|
-
|
|
8032
|
-
|
|
8033
|
-
|
|
8034
|
-
|
|
8035
|
-
|
|
8036
|
-
|
|
8037
|
-
|
|
8038
|
-
|
|
8039
|
-
|
|
8040
|
-
className: standaloneScopeClass,
|
|
8041
|
-
style: tooltipStyle,
|
|
8042
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
8043
|
-
role: "tooltip",
|
|
8044
|
-
children: tooltipContent
|
|
8045
|
-
})
|
|
8046
|
-
});
|
|
8047
|
-
})()]
|
|
8092
|
+
}), tooltipContent && /* @__PURE__ */ jsx(BoundedTooltip, {
|
|
8093
|
+
top: tooltipTop,
|
|
8094
|
+
left: tooltipLeft,
|
|
8095
|
+
className: standaloneScopeClass,
|
|
8096
|
+
style: tooltipStyle,
|
|
8097
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
8098
|
+
id: tooltipId,
|
|
8099
|
+
"aria-hidden": "true",
|
|
8100
|
+
children: tooltipContent
|
|
8101
|
+
})
|
|
8102
|
+
})]
|
|
8048
8103
|
});
|
|
8049
8104
|
};
|
|
8050
8105
|
/**
|
|
@@ -8058,8 +8113,7 @@ const ConversionFunnelChartWithProvider = (props) => {
|
|
|
8058
8113
|
return /* @__PURE__ */ jsx(GlobalChartsProvider, { children: /* @__PURE__ */ jsx(ConversionFunnelChartInternal, { ...props }) });
|
|
8059
8114
|
};
|
|
8060
8115
|
ConversionFunnelChartWithProvider.displayName = "ConversionFunnelChart";
|
|
8061
|
-
|
|
8062
|
-
//#region src/utils/sanitize-html.ts
|
|
8116
|
+
// src/utils/sanitize-html.ts
|
|
8063
8117
|
/**
|
|
8064
8118
|
* External dependencies
|
|
8065
8119
|
*/
|
|
@@ -8107,11 +8161,9 @@ function sanitizeHtml(html) {
|
|
|
8107
8161
|
]
|
|
8108
8162
|
});
|
|
8109
8163
|
}
|
|
8110
|
-
|
|
8111
|
-
//#region src/charts/geo-chart/geo-chart.module.scss
|
|
8164
|
+
// src/charts/geo-chart/geo-chart.module.scss
|
|
8112
8165
|
var geo_chart_module_default = { "container": "a8ccharts-8hS2IW-container" };
|
|
8113
|
-
|
|
8114
|
-
//#region src/charts/geo-chart/private/use-tooltip-position.ts
|
|
8166
|
+
// src/charts/geo-chart/private/use-tooltip-position.ts
|
|
8115
8167
|
const TOOLTIP_CLASS = "google-visualization-tooltip";
|
|
8116
8168
|
const isTooltip = (node) => node instanceof HTMLElement && node.classList.contains(TOOLTIP_CLASS);
|
|
8117
8169
|
/**
|
|
@@ -8195,8 +8247,7 @@ function useTooltipPosition(containerRef) {
|
|
|
8195
8247
|
};
|
|
8196
8248
|
}, [containerRef]);
|
|
8197
8249
|
}
|
|
8198
|
-
|
|
8199
|
-
//#region src/charts/geo-chart/geo-chart.tsx
|
|
8250
|
+
// src/charts/geo-chart/geo-chart.tsx
|
|
8200
8251
|
/**
|
|
8201
8252
|
* External dependencies
|
|
8202
8253
|
*/
|
|
@@ -8416,8 +8467,7 @@ const GeoChartWithProvider = (props) => {
|
|
|
8416
8467
|
};
|
|
8417
8468
|
GeoChartWithProvider.displayName = "GeoChart";
|
|
8418
8469
|
const GeoChartResponsive = withResponsive(GeoChartWithProvider);
|
|
8419
|
-
|
|
8420
|
-
//#region src/types.ts
|
|
8470
|
+
// src/types.ts
|
|
8421
8471
|
let GoogleDataTableColumnRoleType = /* @__PURE__ */ function(GoogleDataTableColumnRoleType) {
|
|
8422
8472
|
GoogleDataTableColumnRoleType["annotation"] = "annotation";
|
|
8423
8473
|
GoogleDataTableColumnRoleType["annotationText"] = "annotationText";
|
|
@@ -8497,8 +8547,7 @@ const pickLabelTextColor = (fill, roles, defaultRole) => {
|
|
|
8497
8547
|
if (!isValidHexColor(fillHex)) return defaultRole;
|
|
8498
8548
|
return pickLabelTextColorForFill(hexToRgb(fillHex), roles, defaultRole);
|
|
8499
8549
|
};
|
|
8500
|
-
|
|
8501
|
-
//#region src/charts/heatmap-chart/heatmap-chart.module.scss
|
|
8550
|
+
// src/charts/heatmap-chart/heatmap-chart.module.scss
|
|
8502
8551
|
var heatmap_chart_module_default = {
|
|
8503
8552
|
"heatmap-chart": "a8ccharts-O3YMOW-heatmap-chart",
|
|
8504
8553
|
"heatmap-chart__cell": "a8ccharts-O3YMOW-heatmap-chart__cell",
|
|
@@ -8529,8 +8578,7 @@ var heatmap_chart_module_default = {
|
|
|
8529
8578
|
"heatmap-chart__row-label": "a8ccharts-O3YMOW-heatmap-chart__row-label",
|
|
8530
8579
|
"heatmap-chart--height-capped": "a8ccharts-O3YMOW-heatmap-chart--height-capped"
|
|
8531
8580
|
};
|
|
8532
|
-
|
|
8533
|
-
//#region src/charts/heatmap-chart/private/use-heatmap-colors.ts
|
|
8581
|
+
// src/charts/heatmap-chart/private/use-heatmap-colors.ts
|
|
8534
8582
|
const isPresent = (value) => value !== null && value !== void 0 && !isNaN(value);
|
|
8535
8583
|
/**
|
|
8536
8584
|
* Get the min and max values from heatmap data, ignoring null/NaN and the zeros
|
|
@@ -8609,12 +8657,10 @@ const getHeatmapScale = (primary, background, emptyCell) => {
|
|
|
8609
8657
|
high
|
|
8610
8658
|
};
|
|
8611
8659
|
};
|
|
8612
|
-
|
|
8613
|
-
//#region src/charts/heatmap-chart/private/heatmap-context.ts
|
|
8660
|
+
// src/charts/heatmap-chart/private/heatmap-context.ts
|
|
8614
8661
|
/** Shared by the chart and legend without importing back from `heatmap-chart.tsx`. */
|
|
8615
8662
|
const HeatmapContext = createContext(null);
|
|
8616
|
-
|
|
8617
|
-
//#region src/charts/heatmap-chart/private/heatmap-legend.tsx
|
|
8663
|
+
// src/charts/heatmap-chart/private/heatmap-legend.tsx
|
|
8618
8664
|
const HeatmapLegend = ({ steps = 5, variant = "swatches", lessLabel, moreLabel }) => {
|
|
8619
8665
|
const context = useContext(HeatmapContext);
|
|
8620
8666
|
const { legend } = useGlobalChartsTheme();
|
|
@@ -8658,8 +8704,7 @@ const HeatmapLegend = ({ steps = 5, variant = "swatches", lessLabel, moreLabel }
|
|
|
8658
8704
|
]
|
|
8659
8705
|
});
|
|
8660
8706
|
};
|
|
8661
|
-
|
|
8662
|
-
//#region src/charts/heatmap-chart/private/column-groups.ts
|
|
8707
|
+
// src/charts/heatmap-chart/private/column-groups.ts
|
|
8663
8708
|
const isSpan = (span) => Number.isInteger(span) && span > 0;
|
|
8664
8709
|
/**
|
|
8665
8710
|
* Validates column groups and lays them over the columns.
|
|
@@ -8765,8 +8810,7 @@ const wrapColumnGroups = (layout, bands) => {
|
|
|
8765
8810
|
slotSpans
|
|
8766
8811
|
};
|
|
8767
8812
|
};
|
|
8768
|
-
|
|
8769
|
-
//#region src/charts/heatmap-chart/private/fit-compact-cells.ts
|
|
8813
|
+
// src/charts/heatmap-chart/private/fit-compact-cells.ts
|
|
8770
8814
|
/**
|
|
8771
8815
|
* Largest whole-pixel square cell, and the band count giving it, for a compact grid in a box.
|
|
8772
8816
|
*
|
|
@@ -8804,8 +8848,7 @@ const fitCompactCells = (input) => {
|
|
|
8804
8848
|
cellSize: minCellSize
|
|
8805
8849
|
};
|
|
8806
8850
|
};
|
|
8807
|
-
|
|
8808
|
-
//#region src/charts/heatmap-chart/private/keyboard-navigation.ts
|
|
8851
|
+
// src/charts/heatmap-chart/private/keyboard-navigation.ts
|
|
8809
8852
|
const ARROW_KEYS = [
|
|
8810
8853
|
"ArrowLeft",
|
|
8811
8854
|
"ArrowRight",
|
|
@@ -8935,8 +8978,7 @@ const stepCalendarCell = (grid, blocks, from, key) => {
|
|
|
8935
8978
|
const before = page.slice(0, at === -1 ? page.length : at).reverse();
|
|
8936
8979
|
return firstSelectable(grid, after) ?? firstSelectable(grid, before);
|
|
8937
8980
|
};
|
|
8938
|
-
|
|
8939
|
-
//#region src/charts/heatmap-chart/heatmap-chart.tsx
|
|
8981
|
+
// src/charts/heatmap-chart/heatmap-chart.tsx
|
|
8940
8982
|
const CELL_VALUE_MODIFIER = {
|
|
8941
8983
|
label: void 0,
|
|
8942
8984
|
"label-inverse": heatmap_chart_module_default["heatmap-chart__cell-value--inverse"],
|
|
@@ -9391,8 +9433,7 @@ const HeatmapChartResponsiveInner = (props) => /* @__PURE__ */ jsx(HeatmapChartW
|
|
|
9391
9433
|
});
|
|
9392
9434
|
HeatmapChartResponsiveInner.displayName = "HeatmapChart";
|
|
9393
9435
|
const HeatmapChartResponsive = attachSubComponents(withResponsive(HeatmapChartResponsiveInner), { Legend: HeatmapLegend });
|
|
9394
|
-
|
|
9395
|
-
//#region src/charts/heatmap-chart/private/civil-day.ts
|
|
9436
|
+
// src/charts/heatmap-chart/private/civil-day.ts
|
|
9396
9437
|
const DAY_MS = 864e5;
|
|
9397
9438
|
const KEY_OPTIONS = {
|
|
9398
9439
|
calendar: "gregory",
|
|
@@ -9541,8 +9582,7 @@ const startOfCivilWeek = (date, weekStartsOn) => {
|
|
|
9541
9582
|
* @return Columns needed to cover the span, inclusive.
|
|
9542
9583
|
*/
|
|
9543
9584
|
const civilWeekSpan = (from, to, weekStartsOn) => Math.floor((startOfCivilWeek(to, weekStartsOn).getTime() - startOfCivilWeek(from, weekStartsOn).getTime()) / (7 * DAY_MS)) + 1;
|
|
9544
|
-
|
|
9545
|
-
//#region src/charts/heatmap-chart/build-calendar-data.ts
|
|
9585
|
+
// src/charts/heatmap-chart/build-calendar-data.ts
|
|
9546
9586
|
/** Rows that get a weekday label (Mon, Wed, Fri with a Monday week start). */
|
|
9547
9587
|
const LABELLED_ROWS = [
|
|
9548
9588
|
0,
|
|
@@ -9644,8 +9684,7 @@ const buildCalendarHeatmapData = (series, options = {}) => {
|
|
|
9644
9684
|
rowLabels
|
|
9645
9685
|
};
|
|
9646
9686
|
};
|
|
9647
|
-
|
|
9648
|
-
//#region src/charts/heatmap-chart/build-month-calendar-data.ts
|
|
9687
|
+
// src/charts/heatmap-chart/build-month-calendar-data.ts
|
|
9649
9688
|
/** Week rows per month, fixed so every month block is the same height. */
|
|
9650
9689
|
const MONTH_ROWS = 6;
|
|
9651
9690
|
const DAYS_PER_WEEK = 7;
|
|
@@ -9727,8 +9766,7 @@ const buildMonthCalendarHeatmapData = (valueByDay, range, options = {}) => {
|
|
|
9727
9766
|
columnGroups
|
|
9728
9767
|
};
|
|
9729
9768
|
};
|
|
9730
|
-
|
|
9731
|
-
//#region src/charts/heatmap-chart/use-calendar-heatmap-data.ts
|
|
9769
|
+
// src/charts/heatmap-chart/use-calendar-heatmap-data.ts
|
|
9732
9770
|
/**
|
|
9733
9771
|
* `buildCalendarHeatmapData` with the locale and zone taken from
|
|
9734
9772
|
* `GlobalChartsProvider` where the caller names neither.
|
|
@@ -9763,8 +9801,7 @@ const useCalendarHeatmapData = (series, options = {}) => {
|
|
|
9763
9801
|
gridEnd
|
|
9764
9802
|
]);
|
|
9765
9803
|
};
|
|
9766
|
-
|
|
9767
|
-
//#region src/charts/heatmap-chart/use-month-calendar-heatmap-data.ts
|
|
9804
|
+
// src/charts/heatmap-chart/use-month-calendar-heatmap-data.ts
|
|
9768
9805
|
/**
|
|
9769
9806
|
* `buildMonthCalendarHeatmapData` with the locale taken from `GlobalChartsProvider`
|
|
9770
9807
|
* where the caller names none.
|
|
@@ -9793,8 +9830,7 @@ const useMonthCalendarHeatmapData = (valueByDay, range, options = {}) => {
|
|
|
9793
9830
|
weekStartsOn
|
|
9794
9831
|
]);
|
|
9795
9832
|
};
|
|
9796
|
-
|
|
9797
|
-
//#region ../../../node_modules/.pnpm/is-plain-object@5.1.0/node_modules/is-plain-object/dist/is-plain-object.mjs
|
|
9833
|
+
// ../../../node_modules/.pnpm/is-plain-object@5.1.0/node_modules/is-plain-object/dist/is-plain-object.mjs
|
|
9798
9834
|
/*!
|
|
9799
9835
|
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
9800
9836
|
*
|
|
@@ -9814,57 +9850,9 @@ function isPlainObject(o) {
|
|
|
9814
9850
|
if (prot.hasOwnProperty("isPrototypeOf") === false) return false;
|
|
9815
9851
|
return true;
|
|
9816
9852
|
}
|
|
9817
|
-
|
|
9818
|
-
//#region ../../../node_modules/.pnpm/lower-case@2.0.2/node_modules/lower-case/dist.es2015/index.js
|
|
9819
|
-
/**
|
|
9820
|
-
* Lower case as a function.
|
|
9821
|
-
*/
|
|
9822
|
-
function lowerCase(str) {
|
|
9823
|
-
return str.toLowerCase();
|
|
9824
|
-
}
|
|
9825
|
-
//#endregion
|
|
9826
|
-
//#region ../../../node_modules/.pnpm/no-case@3.0.4/node_modules/no-case/dist.es2015/index.js
|
|
9827
|
-
var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
|
|
9828
|
-
var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
|
|
9829
|
-
/**
|
|
9830
|
-
* Normalize the string into something other libraries can manipulate easier.
|
|
9831
|
-
*/
|
|
9832
|
-
function noCase(input, options) {
|
|
9833
|
-
if (options === void 0) options = {};
|
|
9834
|
-
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;
|
|
9835
|
-
var result = replace$1(replace$1(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
|
|
9836
|
-
var start = 0;
|
|
9837
|
-
var end = result.length;
|
|
9838
|
-
while (result.charAt(start) === "\0") start++;
|
|
9839
|
-
while (result.charAt(end - 1) === "\0") end--;
|
|
9840
|
-
return result.slice(start, end).split("\0").map(transform).join(delimiter);
|
|
9841
|
-
}
|
|
9842
|
-
/**
|
|
9843
|
-
* Replace `re` in the input string with the replacement value.
|
|
9844
|
-
*/
|
|
9845
|
-
function replace$1(input, re, value) {
|
|
9846
|
-
if (re instanceof RegExp) return input.replace(re, value);
|
|
9847
|
-
return re.reduce(function(input, re) {
|
|
9848
|
-
return input.replace(re, value);
|
|
9849
|
-
}, input);
|
|
9850
|
-
}
|
|
9851
|
-
//#endregion
|
|
9852
|
-
//#region ../../../node_modules/.pnpm/dot-case@3.0.4/node_modules/dot-case/dist.es2015/index.js
|
|
9853
|
-
function dotCase(input, options) {
|
|
9854
|
-
if (options === void 0) options = {};
|
|
9855
|
-
return noCase(input, __assign({ delimiter: "." }, options));
|
|
9856
|
-
}
|
|
9857
|
-
//#endregion
|
|
9858
|
-
//#region ../../../node_modules/.pnpm/param-case@3.0.4/node_modules/param-case/dist.es2015/index.js
|
|
9859
|
-
function paramCase(input, options) {
|
|
9860
|
-
if (options === void 0) options = {};
|
|
9861
|
-
return dotCase(input, __assign({ delimiter: "-" }, options));
|
|
9862
|
-
}
|
|
9863
|
-
//#endregion
|
|
9864
|
-
//#region ../../../node_modules/.pnpm/@wordpress+warning@3.57.0/node_modules/@wordpress/warning/build-module/utils.mjs
|
|
9853
|
+
// ../../../node_modules/.pnpm/@wordpress+warning@4.0.0/node_modules/@wordpress/warning/build-module/utils.mjs
|
|
9865
9854
|
var logged = /* @__PURE__ */ new Set();
|
|
9866
|
-
|
|
9867
|
-
//#region ../../../node_modules/.pnpm/@wordpress+warning@3.57.0/node_modules/@wordpress/warning/build-module/index.mjs
|
|
9855
|
+
// ../../../node_modules/.pnpm/@wordpress+warning@4.0.0/node_modules/@wordpress/warning/build-module/index.mjs
|
|
9868
9856
|
function isDev() {
|
|
9869
9857
|
return globalThis.SCRIPT_DEBUG === true;
|
|
9870
9858
|
}
|
|
@@ -9877,8 +9865,53 @@ function warning(message) {
|
|
|
9877
9865
|
} catch {}
|
|
9878
9866
|
logged.add(message);
|
|
9879
9867
|
}
|
|
9880
|
-
|
|
9881
|
-
|
|
9868
|
+
// ../../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/es6/index.js
|
|
9869
|
+
var require_es6 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
9870
|
+
module.exports = function equal(a, b) {
|
|
9871
|
+
if (a === b) return true;
|
|
9872
|
+
if (a && b && typeof a == "object" && typeof b == "object") {
|
|
9873
|
+
if (a.constructor !== b.constructor) return false;
|
|
9874
|
+
var length, i, keys;
|
|
9875
|
+
if (Array.isArray(a)) {
|
|
9876
|
+
length = a.length;
|
|
9877
|
+
if (length != b.length) return false;
|
|
9878
|
+
for (i = length; i-- !== 0;) if (!equal(a[i], b[i])) return false;
|
|
9879
|
+
return true;
|
|
9880
|
+
}
|
|
9881
|
+
if (a instanceof Map && b instanceof Map) {
|
|
9882
|
+
if (a.size !== b.size) return false;
|
|
9883
|
+
for (i of a.entries()) if (!b.has(i[0])) return false;
|
|
9884
|
+
for (i of a.entries()) if (!equal(i[1], b.get(i[0]))) return false;
|
|
9885
|
+
return true;
|
|
9886
|
+
}
|
|
9887
|
+
if (a instanceof Set && b instanceof Set) {
|
|
9888
|
+
if (a.size !== b.size) return false;
|
|
9889
|
+
for (i of a.entries()) if (!b.has(i[0])) return false;
|
|
9890
|
+
return true;
|
|
9891
|
+
}
|
|
9892
|
+
if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
|
|
9893
|
+
length = a.length;
|
|
9894
|
+
if (length != b.length) return false;
|
|
9895
|
+
for (i = length; i-- !== 0;) if (a[i] !== b[i]) return false;
|
|
9896
|
+
return true;
|
|
9897
|
+
}
|
|
9898
|
+
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
|
|
9899
|
+
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
|
|
9900
|
+
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
|
|
9901
|
+
keys = Object.keys(a);
|
|
9902
|
+
length = keys.length;
|
|
9903
|
+
if (length !== Object.keys(b).length) return false;
|
|
9904
|
+
for (i = length; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
|
|
9905
|
+
for (i = length; i-- !== 0;) {
|
|
9906
|
+
var key = keys[i];
|
|
9907
|
+
if (!equal(a[key], b[key])) return false;
|
|
9908
|
+
}
|
|
9909
|
+
return true;
|
|
9910
|
+
}
|
|
9911
|
+
return a !== a && b !== b;
|
|
9912
|
+
};
|
|
9913
|
+
}));
|
|
9914
|
+
// ../../../node_modules/.pnpm/@wordpress+components@43.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_401cb4bad47bd1f7b56615ff574f0485/node_modules/@wordpress/components/build-module/utils/hooks/use-update-effect.mjs
|
|
9882
9915
|
function useUpdateEffect(effect, deps) {
|
|
9883
9916
|
const mountedRef = useRef$1(false);
|
|
9884
9917
|
useEffect$1(() => {
|
|
@@ -9890,1190 +9923,58 @@ function useUpdateEffect(effect, deps) {
|
|
|
9890
9923
|
}, []);
|
|
9891
9924
|
}
|
|
9892
9925
|
var use_update_effect_default = useUpdateEffect;
|
|
9893
|
-
|
|
9894
|
-
|
|
9895
|
-
|
|
9896
|
-
|
|
9897
|
-
|
|
9898
|
-
|
|
9899
|
-
|
|
9900
|
-
|
|
9901
|
-
|
|
9902
|
-
|
|
9903
|
-
|
|
9904
|
-
|
|
9905
|
-
|
|
9906
|
-
|
|
9907
|
-
}
|
|
9908
|
-
var StyleSheet = /*#__PURE__*/ function() {
|
|
9909
|
-
function StyleSheet(options) {
|
|
9910
|
-
var _this = this;
|
|
9911
|
-
this._insertTag = function(tag) {
|
|
9912
|
-
var before;
|
|
9913
|
-
if (_this.tags.length === 0) {
|
|
9914
|
-
if (_this.insertionPoint) before = _this.insertionPoint.nextSibling;
|
|
9915
|
-
else if (_this.prepend) before = _this.container.firstChild;
|
|
9916
|
-
else before = _this.before;
|
|
9917
|
-
} else before = _this.tags[_this.tags.length - 1].nextSibling;
|
|
9918
|
-
_this.container.insertBefore(tag, before);
|
|
9919
|
-
_this.tags.push(tag);
|
|
9920
|
-
};
|
|
9921
|
-
this.isSpeedy = options.speedy === void 0 ? true : options.speedy;
|
|
9922
|
-
this.tags = [];
|
|
9923
|
-
this.ctr = 0;
|
|
9924
|
-
this.nonce = options.nonce;
|
|
9925
|
-
this.key = options.key;
|
|
9926
|
-
this.container = options.container;
|
|
9927
|
-
this.prepend = options.prepend;
|
|
9928
|
-
this.insertionPoint = options.insertionPoint;
|
|
9929
|
-
this.before = null;
|
|
9930
|
-
}
|
|
9931
|
-
var _proto = StyleSheet.prototype;
|
|
9932
|
-
_proto.hydrate = function hydrate(nodes) {
|
|
9933
|
-
nodes.forEach(this._insertTag);
|
|
9934
|
-
};
|
|
9935
|
-
_proto.insert = function insert(rule) {
|
|
9936
|
-
if (this.ctr % (this.isSpeedy ? 65e3 : 1) === 0) this._insertTag(createStyleElement(this));
|
|
9937
|
-
var tag = this.tags[this.tags.length - 1];
|
|
9938
|
-
if (this.isSpeedy) {
|
|
9939
|
-
var sheet = sheetForTag(tag);
|
|
9940
|
-
try {
|
|
9941
|
-
sheet.insertRule(rule, sheet.cssRules.length);
|
|
9942
|
-
} catch (e) {}
|
|
9943
|
-
} else tag.appendChild(document.createTextNode(rule));
|
|
9944
|
-
this.ctr++;
|
|
9945
|
-
};
|
|
9946
|
-
_proto.flush = function flush() {
|
|
9947
|
-
this.tags.forEach(function(tag) {
|
|
9948
|
-
var _tag$parentNode;
|
|
9949
|
-
return (_tag$parentNode = tag.parentNode) == null ? void 0 : _tag$parentNode.removeChild(tag);
|
|
9950
|
-
});
|
|
9951
|
-
this.tags = [];
|
|
9952
|
-
this.ctr = 0;
|
|
9953
|
-
};
|
|
9954
|
-
return StyleSheet;
|
|
9955
|
-
}();
|
|
9956
|
-
//#endregion
|
|
9957
|
-
//#region ../../../node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Enum.js
|
|
9958
|
-
var MS = "-ms-";
|
|
9959
|
-
var MOZ = "-moz-";
|
|
9960
|
-
var WEBKIT = "-webkit-";
|
|
9961
|
-
var COMMENT = "comm";
|
|
9962
|
-
var RULESET = "rule";
|
|
9963
|
-
var DECLARATION = "decl";
|
|
9964
|
-
var IMPORT = "@import";
|
|
9965
|
-
var KEYFRAMES = "@keyframes";
|
|
9966
|
-
var LAYER = "@layer";
|
|
9967
|
-
//#endregion
|
|
9968
|
-
//#region ../../../node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Utility.js
|
|
9969
|
-
/**
|
|
9970
|
-
* @param {number}
|
|
9971
|
-
* @return {number}
|
|
9972
|
-
*/
|
|
9973
|
-
var abs = Math.abs;
|
|
9974
|
-
/**
|
|
9975
|
-
* @param {number}
|
|
9976
|
-
* @return {string}
|
|
9977
|
-
*/
|
|
9978
|
-
var from = String.fromCharCode;
|
|
9979
|
-
/**
|
|
9980
|
-
* @param {object}
|
|
9981
|
-
* @return {object}
|
|
9982
|
-
*/
|
|
9983
|
-
var assign = Object.assign;
|
|
9984
|
-
/**
|
|
9985
|
-
* @param {string} value
|
|
9986
|
-
* @param {number} length
|
|
9987
|
-
* @return {number}
|
|
9988
|
-
*/
|
|
9989
|
-
function hash(value, length) {
|
|
9990
|
-
return charat(value, 0) ^ 45 ? (((length << 2 ^ charat(value, 0)) << 2 ^ charat(value, 1)) << 2 ^ charat(value, 2)) << 2 ^ charat(value, 3) : 0;
|
|
9991
|
-
}
|
|
9992
|
-
/**
|
|
9993
|
-
* @param {string} value
|
|
9994
|
-
* @return {string}
|
|
9995
|
-
*/
|
|
9996
|
-
function trim(value) {
|
|
9997
|
-
return value.trim();
|
|
9998
|
-
}
|
|
9999
|
-
/**
|
|
10000
|
-
* @param {string} value
|
|
10001
|
-
* @param {RegExp} pattern
|
|
10002
|
-
* @return {string?}
|
|
10003
|
-
*/
|
|
10004
|
-
function match(value, pattern) {
|
|
10005
|
-
return (value = pattern.exec(value)) ? value[0] : value;
|
|
9926
|
+
// ../../../node_modules/.pnpm/@wordpress+components@43.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_401cb4bad47bd1f7b56615ff574f0485/node_modules/@wordpress/components/build-module/context/context-system-provider.mjs
|
|
9927
|
+
var import_es6 = /* @__PURE__ */ __toESM(require_es6(), 1);
|
|
9928
|
+
var ComponentsContext = createContext$1({});
|
|
9929
|
+
ComponentsContext.displayName = "ComponentsContext";
|
|
9930
|
+
var useComponentsContext = () => useContext$1(ComponentsContext);
|
|
9931
|
+
function useContextSystemBridge({ value }) {
|
|
9932
|
+
const parentContext = useComponentsContext();
|
|
9933
|
+
const valueRef = useRef$1(value);
|
|
9934
|
+
use_update_effect_default(() => {
|
|
9935
|
+
if ((0, import_es6.default)(valueRef.current, value) && valueRef.current !== value) warning(`Please memoize your context: ${JSON.stringify(value)}`);
|
|
9936
|
+
}, [value]);
|
|
9937
|
+
return useMemo$1(() => {
|
|
9938
|
+
return deepmerge(parentContext ?? {}, value ?? {}, { isMergeableObject: isPlainObject });
|
|
9939
|
+
}, [parentContext, value]);
|
|
10006
9940
|
}
|
|
9941
|
+
var BaseContextSystemProvider = ({ children, value }) => {
|
|
9942
|
+
const contextValue = useContextSystemBridge({ value });
|
|
9943
|
+
return /* @__PURE__ */ jsx(ComponentsContext.Provider, {
|
|
9944
|
+
value: contextValue,
|
|
9945
|
+
children
|
|
9946
|
+
});
|
|
9947
|
+
};
|
|
9948
|
+
memo(BaseContextSystemProvider);
|
|
9949
|
+
// ../../../node_modules/.pnpm/@wordpress+components@43.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_401cb4bad47bd1f7b56615ff574f0485/node_modules/@wordpress/components/build-module/context/constants.mjs
|
|
9950
|
+
var COMPONENT_NAMESPACE = "data-wp-component";
|
|
9951
|
+
var CONNECTED_NAMESPACE = "data-wp-c16t";
|
|
9952
|
+
var CONNECT_STATIC_NAMESPACE = "__contextSystemKey__";
|
|
9953
|
+
// ../../../node_modules/.pnpm/memize@2.1.1/node_modules/memize/dist/index.js
|
|
10007
9954
|
/**
|
|
10008
|
-
*
|
|
10009
|
-
*
|
|
10010
|
-
* @
|
|
10011
|
-
*
|
|
9955
|
+
* Memize options object.
|
|
9956
|
+
*
|
|
9957
|
+
* @typedef MemizeOptions
|
|
9958
|
+
*
|
|
9959
|
+
* @property {number} [maxSize] Maximum size of the cache.
|
|
10012
9960
|
*/
|
|
10013
|
-
function replace(value, pattern, replacement) {
|
|
10014
|
-
return value.replace(pattern, replacement);
|
|
10015
|
-
}
|
|
10016
9961
|
/**
|
|
10017
|
-
*
|
|
10018
|
-
*
|
|
10019
|
-
* @
|
|
9962
|
+
* Internal cache entry.
|
|
9963
|
+
*
|
|
9964
|
+
* @typedef MemizeCacheNode
|
|
9965
|
+
*
|
|
9966
|
+
* @property {?MemizeCacheNode|undefined} [prev] Previous node.
|
|
9967
|
+
* @property {?MemizeCacheNode|undefined} [next] Next node.
|
|
9968
|
+
* @property {Array<*>} args Function arguments for cache
|
|
9969
|
+
* entry.
|
|
9970
|
+
* @property {*} val Function result.
|
|
10020
9971
|
*/
|
|
10021
|
-
function indexof(value, search) {
|
|
10022
|
-
return value.indexOf(search);
|
|
10023
|
-
}
|
|
10024
9972
|
/**
|
|
10025
|
-
*
|
|
10026
|
-
*
|
|
10027
|
-
* @
|
|
10028
|
-
|
|
10029
|
-
|
|
10030
|
-
return value.charCodeAt(index) | 0;
|
|
10031
|
-
}
|
|
10032
|
-
/**
|
|
10033
|
-
* @param {string} value
|
|
10034
|
-
* @param {number} begin
|
|
10035
|
-
* @param {number} end
|
|
10036
|
-
* @return {string}
|
|
10037
|
-
*/
|
|
10038
|
-
function substr(value, begin, end) {
|
|
10039
|
-
return value.slice(begin, end);
|
|
10040
|
-
}
|
|
10041
|
-
/**
|
|
10042
|
-
* @param {string} value
|
|
10043
|
-
* @return {number}
|
|
10044
|
-
*/
|
|
10045
|
-
function strlen(value) {
|
|
10046
|
-
return value.length;
|
|
10047
|
-
}
|
|
10048
|
-
/**
|
|
10049
|
-
* @param {any[]} value
|
|
10050
|
-
* @return {number}
|
|
10051
|
-
*/
|
|
10052
|
-
function sizeof(value) {
|
|
10053
|
-
return value.length;
|
|
10054
|
-
}
|
|
10055
|
-
/**
|
|
10056
|
-
* @param {any} value
|
|
10057
|
-
* @param {any[]} array
|
|
10058
|
-
* @return {any}
|
|
10059
|
-
*/
|
|
10060
|
-
function append(value, array) {
|
|
10061
|
-
return array.push(value), value;
|
|
10062
|
-
}
|
|
10063
|
-
/**
|
|
10064
|
-
* @param {string[]} array
|
|
10065
|
-
* @param {function} callback
|
|
10066
|
-
* @return {string}
|
|
10067
|
-
*/
|
|
10068
|
-
function combine(array, callback) {
|
|
10069
|
-
return array.map(callback).join("");
|
|
10070
|
-
}
|
|
10071
|
-
//#endregion
|
|
10072
|
-
//#region ../../../node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Tokenizer.js
|
|
10073
|
-
var line = 1;
|
|
10074
|
-
var column = 1;
|
|
10075
|
-
var length = 0;
|
|
10076
|
-
var position = 0;
|
|
10077
|
-
var character = 0;
|
|
10078
|
-
var characters = "";
|
|
10079
|
-
/**
|
|
10080
|
-
* @param {string} value
|
|
10081
|
-
* @param {object | null} root
|
|
10082
|
-
* @param {object | null} parent
|
|
10083
|
-
* @param {string} type
|
|
10084
|
-
* @param {string[] | string} props
|
|
10085
|
-
* @param {object[] | string} children
|
|
10086
|
-
* @param {number} length
|
|
10087
|
-
*/
|
|
10088
|
-
function node(value, root, parent, type, props, children, length) {
|
|
10089
|
-
return {
|
|
10090
|
-
value,
|
|
10091
|
-
root,
|
|
10092
|
-
parent,
|
|
10093
|
-
type,
|
|
10094
|
-
props,
|
|
10095
|
-
children,
|
|
10096
|
-
line,
|
|
10097
|
-
column,
|
|
10098
|
-
length,
|
|
10099
|
-
return: ""
|
|
10100
|
-
};
|
|
10101
|
-
}
|
|
10102
|
-
/**
|
|
10103
|
-
* @param {object} root
|
|
10104
|
-
* @param {object} props
|
|
10105
|
-
* @return {object}
|
|
10106
|
-
*/
|
|
10107
|
-
function copy(root, props) {
|
|
10108
|
-
return assign(node("", null, null, "", null, null, 0), root, { length: -root.length }, props);
|
|
10109
|
-
}
|
|
10110
|
-
/**
|
|
10111
|
-
* @return {number}
|
|
10112
|
-
*/
|
|
10113
|
-
function char() {
|
|
10114
|
-
return character;
|
|
10115
|
-
}
|
|
10116
|
-
/**
|
|
10117
|
-
* @return {number}
|
|
10118
|
-
*/
|
|
10119
|
-
function prev() {
|
|
10120
|
-
character = position > 0 ? charat(characters, --position) : 0;
|
|
10121
|
-
if (column--, character === 10) column = 1, line--;
|
|
10122
|
-
return character;
|
|
10123
|
-
}
|
|
10124
|
-
/**
|
|
10125
|
-
* @return {number}
|
|
10126
|
-
*/
|
|
10127
|
-
function next() {
|
|
10128
|
-
character = position < length ? charat(characters, position++) : 0;
|
|
10129
|
-
if (column++, character === 10) column = 1, line++;
|
|
10130
|
-
return character;
|
|
10131
|
-
}
|
|
10132
|
-
/**
|
|
10133
|
-
* @return {number}
|
|
10134
|
-
*/
|
|
10135
|
-
function peek() {
|
|
10136
|
-
return charat(characters, position);
|
|
10137
|
-
}
|
|
10138
|
-
/**
|
|
10139
|
-
* @return {number}
|
|
10140
|
-
*/
|
|
10141
|
-
function caret() {
|
|
10142
|
-
return position;
|
|
10143
|
-
}
|
|
10144
|
-
/**
|
|
10145
|
-
* @param {number} begin
|
|
10146
|
-
* @param {number} end
|
|
10147
|
-
* @return {string}
|
|
10148
|
-
*/
|
|
10149
|
-
function slice(begin, end) {
|
|
10150
|
-
return substr(characters, begin, end);
|
|
10151
|
-
}
|
|
10152
|
-
/**
|
|
10153
|
-
* @param {number} type
|
|
10154
|
-
* @return {number}
|
|
10155
|
-
*/
|
|
10156
|
-
function token(type) {
|
|
10157
|
-
switch (type) {
|
|
10158
|
-
case 0:
|
|
10159
|
-
case 9:
|
|
10160
|
-
case 10:
|
|
10161
|
-
case 13:
|
|
10162
|
-
case 32: return 5;
|
|
10163
|
-
case 33:
|
|
10164
|
-
case 43:
|
|
10165
|
-
case 44:
|
|
10166
|
-
case 47:
|
|
10167
|
-
case 62:
|
|
10168
|
-
case 64:
|
|
10169
|
-
case 126:
|
|
10170
|
-
case 59:
|
|
10171
|
-
case 123:
|
|
10172
|
-
case 125: return 4;
|
|
10173
|
-
case 58: return 3;
|
|
10174
|
-
case 34:
|
|
10175
|
-
case 39:
|
|
10176
|
-
case 40:
|
|
10177
|
-
case 91: return 2;
|
|
10178
|
-
case 41:
|
|
10179
|
-
case 93: return 1;
|
|
10180
|
-
}
|
|
10181
|
-
return 0;
|
|
10182
|
-
}
|
|
10183
|
-
/**
|
|
10184
|
-
* @param {string} value
|
|
10185
|
-
* @return {any[]}
|
|
10186
|
-
*/
|
|
10187
|
-
function alloc(value) {
|
|
10188
|
-
return line = column = 1, length = strlen(characters = value), position = 0, [];
|
|
10189
|
-
}
|
|
10190
|
-
/**
|
|
10191
|
-
* @param {any} value
|
|
10192
|
-
* @return {any}
|
|
10193
|
-
*/
|
|
10194
|
-
function dealloc(value) {
|
|
10195
|
-
return characters = "", value;
|
|
10196
|
-
}
|
|
10197
|
-
/**
|
|
10198
|
-
* @param {number} type
|
|
10199
|
-
* @return {string}
|
|
10200
|
-
*/
|
|
10201
|
-
function delimit(type) {
|
|
10202
|
-
return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)));
|
|
10203
|
-
}
|
|
10204
|
-
/**
|
|
10205
|
-
* @param {number} type
|
|
10206
|
-
* @return {string}
|
|
10207
|
-
*/
|
|
10208
|
-
function whitespace(type) {
|
|
10209
|
-
while (character = peek()) if (character < 33) next();
|
|
10210
|
-
else break;
|
|
10211
|
-
return token(type) > 2 || token(character) > 3 ? "" : " ";
|
|
10212
|
-
}
|
|
10213
|
-
/**
|
|
10214
|
-
* @param {number} index
|
|
10215
|
-
* @param {number} count
|
|
10216
|
-
* @return {string}
|
|
10217
|
-
*/
|
|
10218
|
-
function escaping(index, count) {
|
|
10219
|
-
while (--count && next()) if (character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97) break;
|
|
10220
|
-
return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32));
|
|
10221
|
-
}
|
|
10222
|
-
/**
|
|
10223
|
-
* @param {number} type
|
|
10224
|
-
* @return {number}
|
|
10225
|
-
*/
|
|
10226
|
-
function delimiter(type) {
|
|
10227
|
-
while (next()) switch (character) {
|
|
10228
|
-
case type: return position;
|
|
10229
|
-
case 34:
|
|
10230
|
-
case 39:
|
|
10231
|
-
if (type !== 34 && type !== 39) delimiter(character);
|
|
10232
|
-
break;
|
|
10233
|
-
case 40:
|
|
10234
|
-
if (type === 41) delimiter(type);
|
|
10235
|
-
break;
|
|
10236
|
-
case 92: next();
|
|
10237
|
-
}
|
|
10238
|
-
return position;
|
|
10239
|
-
}
|
|
10240
|
-
/**
|
|
10241
|
-
* @param {number} type
|
|
10242
|
-
* @param {number} index
|
|
10243
|
-
* @return {number}
|
|
10244
|
-
*/
|
|
10245
|
-
function commenter(type, index) {
|
|
10246
|
-
while (next()) if (type + character === 57) break;
|
|
10247
|
-
else if (type + character === 84 && peek() === 47) break;
|
|
10248
|
-
return "/*" + slice(index, position - 1) + "*" + from(type === 47 ? type : next());
|
|
10249
|
-
}
|
|
10250
|
-
/**
|
|
10251
|
-
* @param {number} index
|
|
10252
|
-
* @return {string}
|
|
10253
|
-
*/
|
|
10254
|
-
function identifier(index) {
|
|
10255
|
-
while (!token(peek())) next();
|
|
10256
|
-
return slice(index, position);
|
|
10257
|
-
}
|
|
10258
|
-
//#endregion
|
|
10259
|
-
//#region ../../../node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Parser.js
|
|
10260
|
-
/**
|
|
10261
|
-
* @param {string} value
|
|
10262
|
-
* @return {object[]}
|
|
10263
|
-
*/
|
|
10264
|
-
function compile(value) {
|
|
10265
|
-
return dealloc(parse$1("", null, null, null, [""], value = alloc(value), 0, [0], value));
|
|
10266
|
-
}
|
|
10267
|
-
/**
|
|
10268
|
-
* @param {string} value
|
|
10269
|
-
* @param {object} root
|
|
10270
|
-
* @param {object?} parent
|
|
10271
|
-
* @param {string[]} rule
|
|
10272
|
-
* @param {string[]} rules
|
|
10273
|
-
* @param {string[]} rulesets
|
|
10274
|
-
* @param {number[]} pseudo
|
|
10275
|
-
* @param {number[]} points
|
|
10276
|
-
* @param {string[]} declarations
|
|
10277
|
-
* @return {object}
|
|
10278
|
-
*/
|
|
10279
|
-
function parse$1(value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {
|
|
10280
|
-
var index = 0;
|
|
10281
|
-
var offset = 0;
|
|
10282
|
-
var length = pseudo;
|
|
10283
|
-
var atrule = 0;
|
|
10284
|
-
var property = 0;
|
|
10285
|
-
var previous = 0;
|
|
10286
|
-
var variable = 1;
|
|
10287
|
-
var scanning = 1;
|
|
10288
|
-
var ampersand = 1;
|
|
10289
|
-
var character = 0;
|
|
10290
|
-
var type = "";
|
|
10291
|
-
var props = rules;
|
|
10292
|
-
var children = rulesets;
|
|
10293
|
-
var reference = rule;
|
|
10294
|
-
var characters = type;
|
|
10295
|
-
while (scanning) switch (previous = character, character = next()) {
|
|
10296
|
-
case 40: if (previous != 108 && charat(characters, length - 1) == 58) {
|
|
10297
|
-
if (indexof(characters += replace(delimit(character), "&", "&\f"), "&\f") != -1) ampersand = -1;
|
|
10298
|
-
break;
|
|
10299
|
-
}
|
|
10300
|
-
case 34:
|
|
10301
|
-
case 39:
|
|
10302
|
-
case 91:
|
|
10303
|
-
characters += delimit(character);
|
|
10304
|
-
break;
|
|
10305
|
-
case 9:
|
|
10306
|
-
case 10:
|
|
10307
|
-
case 13:
|
|
10308
|
-
case 32:
|
|
10309
|
-
characters += whitespace(previous);
|
|
10310
|
-
break;
|
|
10311
|
-
case 92:
|
|
10312
|
-
characters += escaping(caret() - 1, 7);
|
|
10313
|
-
continue;
|
|
10314
|
-
case 47:
|
|
10315
|
-
switch (peek()) {
|
|
10316
|
-
case 42:
|
|
10317
|
-
case 47:
|
|
10318
|
-
append(comment(commenter(next(), caret()), root, parent), declarations);
|
|
10319
|
-
break;
|
|
10320
|
-
default: characters += "/";
|
|
10321
|
-
}
|
|
10322
|
-
break;
|
|
10323
|
-
case 123 * variable: points[index++] = strlen(characters) * ampersand;
|
|
10324
|
-
case 125 * variable:
|
|
10325
|
-
case 59:
|
|
10326
|
-
case 0:
|
|
10327
|
-
switch (character) {
|
|
10328
|
-
case 0:
|
|
10329
|
-
case 125: scanning = 0;
|
|
10330
|
-
case 59 + offset:
|
|
10331
|
-
if (ampersand == -1) characters = replace(characters, /\f/g, "");
|
|
10332
|
-
if (property > 0 && strlen(characters) - length) append(property > 32 ? declaration(characters + ";", rule, parent, length - 1) : declaration(replace(characters, " ", "") + ";", rule, parent, length - 2), declarations);
|
|
10333
|
-
break;
|
|
10334
|
-
case 59: characters += ";";
|
|
10335
|
-
default:
|
|
10336
|
-
append(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets);
|
|
10337
|
-
if (character === 123) if (offset === 0) parse$1(characters, root, reference, reference, props, rulesets, length, points, children);
|
|
10338
|
-
else switch (atrule === 99 && charat(characters, 3) === 110 ? 100 : atrule) {
|
|
10339
|
-
case 100:
|
|
10340
|
-
case 108:
|
|
10341
|
-
case 109:
|
|
10342
|
-
case 115:
|
|
10343
|
-
parse$1(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children);
|
|
10344
|
-
break;
|
|
10345
|
-
default: parse$1(characters, reference, reference, reference, [""], children, 0, points, children);
|
|
10346
|
-
}
|
|
10347
|
-
}
|
|
10348
|
-
index = offset = property = 0, variable = ampersand = 1, type = characters = "", length = pseudo;
|
|
10349
|
-
break;
|
|
10350
|
-
case 58: length = 1 + strlen(characters), property = previous;
|
|
10351
|
-
default:
|
|
10352
|
-
if (variable < 1) {
|
|
10353
|
-
if (character == 123) --variable;
|
|
10354
|
-
else if (character == 125 && variable++ == 0 && prev() == 125) continue;
|
|
10355
|
-
}
|
|
10356
|
-
switch (characters += from(character), character * variable) {
|
|
10357
|
-
case 38:
|
|
10358
|
-
ampersand = offset > 0 ? 1 : (characters += "\f", -1);
|
|
10359
|
-
break;
|
|
10360
|
-
case 44:
|
|
10361
|
-
points[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1;
|
|
10362
|
-
break;
|
|
10363
|
-
case 64:
|
|
10364
|
-
if (peek() === 45) characters += delimit(next());
|
|
10365
|
-
atrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++;
|
|
10366
|
-
break;
|
|
10367
|
-
case 45: if (previous === 45 && strlen(characters) == 2) variable = 0;
|
|
10368
|
-
}
|
|
10369
|
-
}
|
|
10370
|
-
return rulesets;
|
|
10371
|
-
}
|
|
10372
|
-
/**
|
|
10373
|
-
* @param {string} value
|
|
10374
|
-
* @param {object} root
|
|
10375
|
-
* @param {object?} parent
|
|
10376
|
-
* @param {number} index
|
|
10377
|
-
* @param {number} offset
|
|
10378
|
-
* @param {string[]} rules
|
|
10379
|
-
* @param {number[]} points
|
|
10380
|
-
* @param {string} type
|
|
10381
|
-
* @param {string[]} props
|
|
10382
|
-
* @param {string[]} children
|
|
10383
|
-
* @param {number} length
|
|
10384
|
-
* @return {object}
|
|
10385
|
-
*/
|
|
10386
|
-
function ruleset(value, root, parent, index, offset, rules, points, type, props, children, length) {
|
|
10387
|
-
var post = offset - 1;
|
|
10388
|
-
var rule = offset === 0 ? rules : [""];
|
|
10389
|
-
var size = sizeof(rule);
|
|
10390
|
-
for (var i = 0, j = 0, k = 0; i < index; ++i) for (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x) if (z = trim(j > 0 ? rule[x] + " " + y : replace(y, /&\f/g, rule[x]))) props[k++] = z;
|
|
10391
|
-
return node(value, root, parent, offset === 0 ? RULESET : type, props, children, length);
|
|
10392
|
-
}
|
|
10393
|
-
/**
|
|
10394
|
-
* @param {number} value
|
|
10395
|
-
* @param {object} root
|
|
10396
|
-
* @param {object?} parent
|
|
10397
|
-
* @return {object}
|
|
10398
|
-
*/
|
|
10399
|
-
function comment(value, root, parent) {
|
|
10400
|
-
return node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0);
|
|
10401
|
-
}
|
|
10402
|
-
/**
|
|
10403
|
-
* @param {string} value
|
|
10404
|
-
* @param {object} root
|
|
10405
|
-
* @param {object?} parent
|
|
10406
|
-
* @param {number} length
|
|
10407
|
-
* @return {object}
|
|
10408
|
-
*/
|
|
10409
|
-
function declaration(value, root, parent, length) {
|
|
10410
|
-
return node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length);
|
|
10411
|
-
}
|
|
10412
|
-
//#endregion
|
|
10413
|
-
//#region ../../../node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Serializer.js
|
|
10414
|
-
/**
|
|
10415
|
-
* @param {object[]} children
|
|
10416
|
-
* @param {function} callback
|
|
10417
|
-
* @return {string}
|
|
10418
|
-
*/
|
|
10419
|
-
function serialize(children, callback) {
|
|
10420
|
-
var output = "";
|
|
10421
|
-
var length = sizeof(children);
|
|
10422
|
-
for (var i = 0; i < length; i++) output += callback(children[i], i, children, callback) || "";
|
|
10423
|
-
return output;
|
|
10424
|
-
}
|
|
10425
|
-
/**
|
|
10426
|
-
* @param {object} element
|
|
10427
|
-
* @param {number} index
|
|
10428
|
-
* @param {object[]} children
|
|
10429
|
-
* @param {function} callback
|
|
10430
|
-
* @return {string}
|
|
10431
|
-
*/
|
|
10432
|
-
function stringify(element, index, children, callback) {
|
|
10433
|
-
switch (element.type) {
|
|
10434
|
-
case LAYER: if (element.children.length) break;
|
|
10435
|
-
case IMPORT:
|
|
10436
|
-
case DECLARATION: return element.return = element.return || element.value;
|
|
10437
|
-
case COMMENT: return "";
|
|
10438
|
-
case KEYFRAMES: return element.return = element.value + "{" + serialize(element.children, callback) + "}";
|
|
10439
|
-
case RULESET: element.value = element.props.join(",");
|
|
10440
|
-
}
|
|
10441
|
-
return strlen(children = serialize(element.children, callback)) ? element.return = element.value + "{" + children + "}" : "";
|
|
10442
|
-
}
|
|
10443
|
-
//#endregion
|
|
10444
|
-
//#region ../../../node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Middleware.js
|
|
10445
|
-
/**
|
|
10446
|
-
* @param {function[]} collection
|
|
10447
|
-
* @return {function}
|
|
10448
|
-
*/
|
|
10449
|
-
function middleware(collection) {
|
|
10450
|
-
var length = sizeof(collection);
|
|
10451
|
-
return function(element, index, children, callback) {
|
|
10452
|
-
var output = "";
|
|
10453
|
-
for (var i = 0; i < length; i++) output += collection[i](element, index, children, callback) || "";
|
|
10454
|
-
return output;
|
|
10455
|
-
};
|
|
10456
|
-
}
|
|
10457
|
-
/**
|
|
10458
|
-
* @param {function} callback
|
|
10459
|
-
* @return {function}
|
|
10460
|
-
*/
|
|
10461
|
-
function rulesheet(callback) {
|
|
10462
|
-
return function(element) {
|
|
10463
|
-
if (!element.root) {
|
|
10464
|
-
if (element = element.return) callback(element);
|
|
10465
|
-
}
|
|
10466
|
-
};
|
|
10467
|
-
}
|
|
10468
|
-
//#endregion
|
|
10469
|
-
//#region ../../../node_modules/.pnpm/@emotion+memoize@0.9.0/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js
|
|
10470
|
-
function memoize(fn) {
|
|
10471
|
-
var cache = Object.create(null);
|
|
10472
|
-
return function(arg) {
|
|
10473
|
-
if (cache[arg] === void 0) cache[arg] = fn(arg);
|
|
10474
|
-
return cache[arg];
|
|
10475
|
-
};
|
|
10476
|
-
}
|
|
10477
|
-
//#endregion
|
|
10478
|
-
//#region ../../../node_modules/.pnpm/@emotion+cache@11.14.0/node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js
|
|
10479
|
-
var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
|
|
10480
|
-
var previous = 0;
|
|
10481
|
-
var character = 0;
|
|
10482
|
-
while (true) {
|
|
10483
|
-
previous = character;
|
|
10484
|
-
character = peek();
|
|
10485
|
-
if (previous === 38 && character === 12) points[index] = 1;
|
|
10486
|
-
if (token(character)) break;
|
|
10487
|
-
next();
|
|
10488
|
-
}
|
|
10489
|
-
return slice(begin, position);
|
|
10490
|
-
};
|
|
10491
|
-
var toRules = function toRules(parsed, points) {
|
|
10492
|
-
var index = -1;
|
|
10493
|
-
var character = 44;
|
|
10494
|
-
do
|
|
10495
|
-
switch (token(character)) {
|
|
10496
|
-
case 0:
|
|
10497
|
-
if (character === 38 && peek() === 12) points[index] = 1;
|
|
10498
|
-
parsed[index] += identifierWithPointTracking(position - 1, points, index);
|
|
10499
|
-
break;
|
|
10500
|
-
case 2:
|
|
10501
|
-
parsed[index] += delimit(character);
|
|
10502
|
-
break;
|
|
10503
|
-
case 4: if (character === 44) {
|
|
10504
|
-
parsed[++index] = peek() === 58 ? "&\f" : "";
|
|
10505
|
-
points[index] = parsed[index].length;
|
|
10506
|
-
break;
|
|
10507
|
-
}
|
|
10508
|
-
default: parsed[index] += from(character);
|
|
10509
|
-
}
|
|
10510
|
-
while (character = next());
|
|
10511
|
-
return parsed;
|
|
10512
|
-
};
|
|
10513
|
-
var getRules = function getRules(value, points) {
|
|
10514
|
-
return dealloc(toRules(alloc(value), points));
|
|
10515
|
-
};
|
|
10516
|
-
var fixedElements = /* #__PURE__ */ new WeakMap();
|
|
10517
|
-
var compat = function compat(element) {
|
|
10518
|
-
if (element.type !== "rule" || !element.parent || element.length < 1) return;
|
|
10519
|
-
var value = element.value;
|
|
10520
|
-
var parent = element.parent;
|
|
10521
|
-
var isImplicitRule = element.column === parent.column && element.line === parent.line;
|
|
10522
|
-
while (parent.type !== "rule") {
|
|
10523
|
-
parent = parent.parent;
|
|
10524
|
-
if (!parent) return;
|
|
10525
|
-
}
|
|
10526
|
-
if (element.props.length === 1 && value.charCodeAt(0) !== 58 && !fixedElements.get(parent)) return;
|
|
10527
|
-
if (isImplicitRule) return;
|
|
10528
|
-
fixedElements.set(element, true);
|
|
10529
|
-
var points = [];
|
|
10530
|
-
var rules = getRules(value, points);
|
|
10531
|
-
var parentRules = parent.props;
|
|
10532
|
-
for (var i = 0, k = 0; i < rules.length; i++) for (var j = 0; j < parentRules.length; j++, k++) element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
|
|
10533
|
-
};
|
|
10534
|
-
var removeLabel = function removeLabel(element) {
|
|
10535
|
-
if (element.type === "decl") {
|
|
10536
|
-
var value = element.value;
|
|
10537
|
-
if (value.charCodeAt(0) === 108 && value.charCodeAt(2) === 98) {
|
|
10538
|
-
element["return"] = "";
|
|
10539
|
-
element.value = "";
|
|
10540
|
-
}
|
|
10541
|
-
}
|
|
10542
|
-
};
|
|
10543
|
-
function prefix(value, length) {
|
|
10544
|
-
switch (hash(value, length)) {
|
|
10545
|
-
case 5103: return WEBKIT + "print-" + value + value;
|
|
10546
|
-
case 5737:
|
|
10547
|
-
case 4201:
|
|
10548
|
-
case 3177:
|
|
10549
|
-
case 3433:
|
|
10550
|
-
case 1641:
|
|
10551
|
-
case 4457:
|
|
10552
|
-
case 2921:
|
|
10553
|
-
case 5572:
|
|
10554
|
-
case 6356:
|
|
10555
|
-
case 5844:
|
|
10556
|
-
case 3191:
|
|
10557
|
-
case 6645:
|
|
10558
|
-
case 3005:
|
|
10559
|
-
case 6391:
|
|
10560
|
-
case 5879:
|
|
10561
|
-
case 5623:
|
|
10562
|
-
case 6135:
|
|
10563
|
-
case 4599:
|
|
10564
|
-
case 4855:
|
|
10565
|
-
case 4215:
|
|
10566
|
-
case 6389:
|
|
10567
|
-
case 5109:
|
|
10568
|
-
case 5365:
|
|
10569
|
-
case 5621:
|
|
10570
|
-
case 3829: return WEBKIT + value + value;
|
|
10571
|
-
case 5349:
|
|
10572
|
-
case 4246:
|
|
10573
|
-
case 4810:
|
|
10574
|
-
case 6968:
|
|
10575
|
-
case 2756: return WEBKIT + value + MOZ + value + MS + value + value;
|
|
10576
|
-
case 6828:
|
|
10577
|
-
case 4268: return WEBKIT + value + MS + value + value;
|
|
10578
|
-
case 6165: return WEBKIT + value + MS + "flex-" + value + value;
|
|
10579
|
-
case 5187: return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + "box-$1$2" + MS + "flex-$1$2") + value;
|
|
10580
|
-
case 5443: return WEBKIT + value + MS + "flex-item-" + replace(value, /flex-|-self/, "") + value;
|
|
10581
|
-
case 4675: return WEBKIT + value + MS + "flex-line-pack" + replace(value, /align-content|flex-|-self/, "") + value;
|
|
10582
|
-
case 5548: return WEBKIT + value + MS + replace(value, "shrink", "negative") + value;
|
|
10583
|
-
case 5292: return WEBKIT + value + MS + replace(value, "basis", "preferred-size") + value;
|
|
10584
|
-
case 6060: return WEBKIT + "box-" + replace(value, "-grow", "") + WEBKIT + value + MS + replace(value, "grow", "positive") + value;
|
|
10585
|
-
case 4554: return WEBKIT + replace(value, /([^-])(transform)/g, "$1" + WEBKIT + "$2") + value;
|
|
10586
|
-
case 6187: return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + "$1"), /(image-set)/, WEBKIT + "$1"), value, "") + value;
|
|
10587
|
-
case 5495:
|
|
10588
|
-
case 3959: return replace(value, /(image-set\([^]*)/, WEBKIT + "$1$`$1");
|
|
10589
|
-
case 4968: return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + "box-pack:$3" + MS + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + WEBKIT + value + value;
|
|
10590
|
-
case 4095:
|
|
10591
|
-
case 3583:
|
|
10592
|
-
case 4068:
|
|
10593
|
-
case 2532: return replace(value, /(.+)-inline(.+)/, WEBKIT + "$1$2") + value;
|
|
10594
|
-
case 8116:
|
|
10595
|
-
case 7059:
|
|
10596
|
-
case 5753:
|
|
10597
|
-
case 5535:
|
|
10598
|
-
case 5445:
|
|
10599
|
-
case 5701:
|
|
10600
|
-
case 4933:
|
|
10601
|
-
case 4677:
|
|
10602
|
-
case 5533:
|
|
10603
|
-
case 5789:
|
|
10604
|
-
case 5021:
|
|
10605
|
-
case 4765:
|
|
10606
|
-
if (strlen(value) - 1 - length > 6) switch (charat(value, length + 1)) {
|
|
10607
|
-
case 109: if (charat(value, length + 4) !== 45) break;
|
|
10608
|
-
case 102: return replace(value, /(.+:)(.+)-([^]+)/, "$1" + WEBKIT + "$2-$3$1" + MOZ + (charat(value, length + 3) == 108 ? "$3" : "$2-$3")) + value;
|
|
10609
|
-
case 115: return ~indexof(value, "stretch") ? prefix(replace(value, "stretch", "fill-available"), length) + value : value;
|
|
10610
|
-
}
|
|
10611
|
-
break;
|
|
10612
|
-
case 4949: if (charat(value, length + 1) !== 115) break;
|
|
10613
|
-
case 6444:
|
|
10614
|
-
switch (charat(value, strlen(value) - 3 - (~indexof(value, "!important") && 10))) {
|
|
10615
|
-
case 107: return replace(value, ":", ":" + WEBKIT) + value;
|
|
10616
|
-
case 101: return replace(value, /(.+:)([^;!]+)(;|!.+)?/, "$1" + WEBKIT + (charat(value, 14) === 45 ? "inline-" : "") + "box$3$1" + WEBKIT + "$2$3$1" + MS + "$2box$3") + value;
|
|
10617
|
-
}
|
|
10618
|
-
break;
|
|
10619
|
-
case 5936:
|
|
10620
|
-
switch (charat(value, length + 11)) {
|
|
10621
|
-
case 114: return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb") + value;
|
|
10622
|
-
case 108: return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb-rl") + value;
|
|
10623
|
-
case 45: return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "lr") + value;
|
|
10624
|
-
}
|
|
10625
|
-
return WEBKIT + value + MS + value + value;
|
|
10626
|
-
}
|
|
10627
|
-
return value;
|
|
10628
|
-
}
|
|
10629
|
-
var defaultStylisPlugins = [function prefixer(element, index, children, callback) {
|
|
10630
|
-
if (element.length > -1) {
|
|
10631
|
-
if (!element["return"]) switch (element.type) {
|
|
10632
|
-
case DECLARATION:
|
|
10633
|
-
element["return"] = prefix(element.value, element.length);
|
|
10634
|
-
break;
|
|
10635
|
-
case KEYFRAMES: return serialize([copy(element, { value: replace(element.value, "@", "@" + WEBKIT) })], callback);
|
|
10636
|
-
case RULESET: if (element.length) return combine(element.props, function(value) {
|
|
10637
|
-
switch (match(value, /(::plac\w+|:read-\w+)/)) {
|
|
10638
|
-
case ":read-only":
|
|
10639
|
-
case ":read-write": return serialize([copy(element, { props: [replace(value, /:(read-\w+)/, ":" + MOZ + "$1")] })], callback);
|
|
10640
|
-
case "::placeholder": return serialize([
|
|
10641
|
-
copy(element, { props: [replace(value, /:(plac\w+)/, ":" + WEBKIT + "input-$1")] }),
|
|
10642
|
-
copy(element, { props: [replace(value, /:(plac\w+)/, ":" + MOZ + "$1")] }),
|
|
10643
|
-
copy(element, { props: [replace(value, /:(plac\w+)/, MS + "input-$1")] })
|
|
10644
|
-
], callback);
|
|
10645
|
-
}
|
|
10646
|
-
return "";
|
|
10647
|
-
});
|
|
10648
|
-
}
|
|
10649
|
-
}
|
|
10650
|
-
}];
|
|
10651
|
-
var createCache = function createCache(options) {
|
|
10652
|
-
var key = options.key;
|
|
10653
|
-
if (key === "css") {
|
|
10654
|
-
var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])");
|
|
10655
|
-
Array.prototype.forEach.call(ssrStyles, function(node) {
|
|
10656
|
-
if (node.getAttribute("data-emotion").indexOf(" ") === -1) return;
|
|
10657
|
-
document.head.appendChild(node);
|
|
10658
|
-
node.setAttribute("data-s", "");
|
|
10659
|
-
});
|
|
10660
|
-
}
|
|
10661
|
-
var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
|
|
10662
|
-
var inserted = {};
|
|
10663
|
-
var container;
|
|
10664
|
-
var nodesToHydrate = [];
|
|
10665
|
-
container = options.container || document.head;
|
|
10666
|
-
Array.prototype.forEach.call(document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function(node) {
|
|
10667
|
-
var attrib = node.getAttribute("data-emotion").split(" ");
|
|
10668
|
-
for (var i = 1; i < attrib.length; i++) inserted[attrib[i]] = true;
|
|
10669
|
-
nodesToHydrate.push(node);
|
|
10670
|
-
});
|
|
10671
|
-
var _insert;
|
|
10672
|
-
var omnipresentPlugins = [compat, removeLabel];
|
|
10673
|
-
var currentSheet;
|
|
10674
|
-
var finalizingPlugins = [stringify, rulesheet(function(rule) {
|
|
10675
|
-
currentSheet.insert(rule);
|
|
10676
|
-
})];
|
|
10677
|
-
var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
|
|
10678
|
-
var stylis = function stylis(styles) {
|
|
10679
|
-
return serialize(compile(styles), serializer);
|
|
10680
|
-
};
|
|
10681
|
-
_insert = function insert(selector, serialized, sheet, shouldCache) {
|
|
10682
|
-
currentSheet = sheet;
|
|
10683
|
-
stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
|
|
10684
|
-
if (shouldCache) cache.inserted[serialized.name] = true;
|
|
10685
|
-
};
|
|
10686
|
-
var cache = {
|
|
10687
|
-
key,
|
|
10688
|
-
sheet: new StyleSheet({
|
|
10689
|
-
key,
|
|
10690
|
-
container,
|
|
10691
|
-
nonce: options.nonce,
|
|
10692
|
-
speedy: options.speedy,
|
|
10693
|
-
prepend: options.prepend,
|
|
10694
|
-
insertionPoint: options.insertionPoint
|
|
10695
|
-
}),
|
|
10696
|
-
nonce: options.nonce,
|
|
10697
|
-
inserted,
|
|
10698
|
-
registered: {},
|
|
10699
|
-
insert: _insert
|
|
10700
|
-
};
|
|
10701
|
-
cache.sheet.hydrate(nodesToHydrate);
|
|
10702
|
-
return cache;
|
|
10703
|
-
};
|
|
10704
|
-
//#endregion
|
|
10705
|
-
//#region ../../../node_modules/.pnpm/@emotion+utils@1.4.2/node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js
|
|
10706
|
-
function getRegisteredStyles$1(registered, registeredStyles, classNames) {
|
|
10707
|
-
var rawClassName = "";
|
|
10708
|
-
classNames.split(" ").forEach(function(className) {
|
|
10709
|
-
if (registered[className] !== void 0) registeredStyles.push(registered[className] + ";");
|
|
10710
|
-
else if (className) rawClassName += className + " ";
|
|
10711
|
-
});
|
|
10712
|
-
return rawClassName;
|
|
10713
|
-
}
|
|
10714
|
-
var registerStyles = function registerStyles(cache, serialized, isStringTag) {
|
|
10715
|
-
var className = cache.key + "-" + serialized.name;
|
|
10716
|
-
if ((isStringTag === false || false) && cache.registered[className] === void 0) cache.registered[className] = serialized.styles;
|
|
10717
|
-
};
|
|
10718
|
-
var insertStyles = function insertStyles(cache, serialized, isStringTag) {
|
|
10719
|
-
registerStyles(cache, serialized, isStringTag);
|
|
10720
|
-
var className = cache.key + "-" + serialized.name;
|
|
10721
|
-
if (cache.inserted[serialized.name] === void 0) {
|
|
10722
|
-
var current = serialized;
|
|
10723
|
-
do {
|
|
10724
|
-
cache.insert(serialized === current ? "." + className : "", current, cache.sheet, true);
|
|
10725
|
-
current = current.next;
|
|
10726
|
-
} while (current !== void 0);
|
|
10727
|
-
}
|
|
10728
|
-
};
|
|
10729
|
-
//#endregion
|
|
10730
|
-
//#region ../../../node_modules/.pnpm/@emotion+hash@0.9.2/node_modules/@emotion/hash/dist/emotion-hash.esm.js
|
|
10731
|
-
function murmur2(str) {
|
|
10732
|
-
var h = 0;
|
|
10733
|
-
var k, i = 0, len = str.length;
|
|
10734
|
-
for (; len >= 4; ++i, len -= 4) {
|
|
10735
|
-
k = str.charCodeAt(i) & 255 | (str.charCodeAt(++i) & 255) << 8 | (str.charCodeAt(++i) & 255) << 16 | (str.charCodeAt(++i) & 255) << 24;
|
|
10736
|
-
k = (k & 65535) * 1540483477 + ((k >>> 16) * 59797 << 16);
|
|
10737
|
-
k ^= k >>> 24;
|
|
10738
|
-
h = (k & 65535) * 1540483477 + ((k >>> 16) * 59797 << 16) ^ (h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
|
|
10739
|
-
}
|
|
10740
|
-
switch (len) {
|
|
10741
|
-
case 3: h ^= (str.charCodeAt(i + 2) & 255) << 16;
|
|
10742
|
-
case 2: h ^= (str.charCodeAt(i + 1) & 255) << 8;
|
|
10743
|
-
case 1:
|
|
10744
|
-
h ^= str.charCodeAt(i) & 255;
|
|
10745
|
-
h = (h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
|
|
10746
|
-
}
|
|
10747
|
-
h ^= h >>> 13;
|
|
10748
|
-
h = (h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
|
|
10749
|
-
return ((h ^ h >>> 15) >>> 0).toString(36);
|
|
10750
|
-
}
|
|
10751
|
-
//#endregion
|
|
10752
|
-
//#region ../../../node_modules/.pnpm/@emotion+unitless@0.10.0/node_modules/@emotion/unitless/dist/emotion-unitless.esm.js
|
|
10753
|
-
var unitlessKeys = {
|
|
10754
|
-
animationIterationCount: 1,
|
|
10755
|
-
aspectRatio: 1,
|
|
10756
|
-
borderImageOutset: 1,
|
|
10757
|
-
borderImageSlice: 1,
|
|
10758
|
-
borderImageWidth: 1,
|
|
10759
|
-
boxFlex: 1,
|
|
10760
|
-
boxFlexGroup: 1,
|
|
10761
|
-
boxOrdinalGroup: 1,
|
|
10762
|
-
columnCount: 1,
|
|
10763
|
-
columns: 1,
|
|
10764
|
-
flex: 1,
|
|
10765
|
-
flexGrow: 1,
|
|
10766
|
-
flexPositive: 1,
|
|
10767
|
-
flexShrink: 1,
|
|
10768
|
-
flexNegative: 1,
|
|
10769
|
-
flexOrder: 1,
|
|
10770
|
-
gridRow: 1,
|
|
10771
|
-
gridRowEnd: 1,
|
|
10772
|
-
gridRowSpan: 1,
|
|
10773
|
-
gridRowStart: 1,
|
|
10774
|
-
gridColumn: 1,
|
|
10775
|
-
gridColumnEnd: 1,
|
|
10776
|
-
gridColumnSpan: 1,
|
|
10777
|
-
gridColumnStart: 1,
|
|
10778
|
-
msGridRow: 1,
|
|
10779
|
-
msGridRowSpan: 1,
|
|
10780
|
-
msGridColumn: 1,
|
|
10781
|
-
msGridColumnSpan: 1,
|
|
10782
|
-
fontWeight: 1,
|
|
10783
|
-
lineHeight: 1,
|
|
10784
|
-
opacity: 1,
|
|
10785
|
-
order: 1,
|
|
10786
|
-
orphans: 1,
|
|
10787
|
-
scale: 1,
|
|
10788
|
-
tabSize: 1,
|
|
10789
|
-
widows: 1,
|
|
10790
|
-
zIndex: 1,
|
|
10791
|
-
zoom: 1,
|
|
10792
|
-
WebkitLineClamp: 1,
|
|
10793
|
-
fillOpacity: 1,
|
|
10794
|
-
floodOpacity: 1,
|
|
10795
|
-
stopOpacity: 1,
|
|
10796
|
-
strokeDasharray: 1,
|
|
10797
|
-
strokeDashoffset: 1,
|
|
10798
|
-
strokeMiterlimit: 1,
|
|
10799
|
-
strokeOpacity: 1,
|
|
10800
|
-
strokeWidth: 1
|
|
10801
|
-
};
|
|
10802
|
-
//#endregion
|
|
10803
|
-
//#region ../../../node_modules/.pnpm/@emotion+serialize@1.3.3/node_modules/@emotion/serialize/dist/emotion-serialize.esm.js
|
|
10804
|
-
var isDevelopment = false;
|
|
10805
|
-
var hyphenateRegex = /[A-Z]|^ms/g;
|
|
10806
|
-
var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
|
|
10807
|
-
var isCustomProperty = function isCustomProperty(property) {
|
|
10808
|
-
return property.charCodeAt(1) === 45;
|
|
10809
|
-
};
|
|
10810
|
-
var isProcessableValue = function isProcessableValue(value) {
|
|
10811
|
-
return value != null && typeof value !== "boolean";
|
|
10812
|
-
};
|
|
10813
|
-
var processStyleName = /* #__PURE__ */ memoize(function(styleName) {
|
|
10814
|
-
return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, "-$&").toLowerCase();
|
|
10815
|
-
});
|
|
10816
|
-
var processStyleValue = function processStyleValue(key, value) {
|
|
10817
|
-
switch (key) {
|
|
10818
|
-
case "animation":
|
|
10819
|
-
case "animationName": if (typeof value === "string") return value.replace(animationRegex, function(match, p1, p2) {
|
|
10820
|
-
cursor = {
|
|
10821
|
-
name: p1,
|
|
10822
|
-
styles: p2,
|
|
10823
|
-
next: cursor
|
|
10824
|
-
};
|
|
10825
|
-
return p1;
|
|
10826
|
-
});
|
|
10827
|
-
}
|
|
10828
|
-
if (unitlessKeys[key] !== 1 && !isCustomProperty(key) && typeof value === "number" && value !== 0) return value + "px";
|
|
10829
|
-
return value;
|
|
10830
|
-
};
|
|
10831
|
-
var noComponentSelectorMessage = "Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";
|
|
10832
|
-
function handleInterpolation(mergedProps, registered, interpolation) {
|
|
10833
|
-
if (interpolation == null) return "";
|
|
10834
|
-
var componentSelector = interpolation;
|
|
10835
|
-
if (componentSelector.__emotion_styles !== void 0) return componentSelector;
|
|
10836
|
-
switch (typeof interpolation) {
|
|
10837
|
-
case "boolean": return "";
|
|
10838
|
-
case "object":
|
|
10839
|
-
var keyframes = interpolation;
|
|
10840
|
-
if (keyframes.anim === 1) {
|
|
10841
|
-
cursor = {
|
|
10842
|
-
name: keyframes.name,
|
|
10843
|
-
styles: keyframes.styles,
|
|
10844
|
-
next: cursor
|
|
10845
|
-
};
|
|
10846
|
-
return keyframes.name;
|
|
10847
|
-
}
|
|
10848
|
-
var serializedStyles = interpolation;
|
|
10849
|
-
if (serializedStyles.styles !== void 0) {
|
|
10850
|
-
var next = serializedStyles.next;
|
|
10851
|
-
if (next !== void 0) while (next !== void 0) {
|
|
10852
|
-
cursor = {
|
|
10853
|
-
name: next.name,
|
|
10854
|
-
styles: next.styles,
|
|
10855
|
-
next: cursor
|
|
10856
|
-
};
|
|
10857
|
-
next = next.next;
|
|
10858
|
-
}
|
|
10859
|
-
return serializedStyles.styles + ";";
|
|
10860
|
-
}
|
|
10861
|
-
return createStringFromObject(mergedProps, registered, interpolation);
|
|
10862
|
-
case "function": if (mergedProps !== void 0) {
|
|
10863
|
-
var previousCursor = cursor;
|
|
10864
|
-
var result = interpolation(mergedProps);
|
|
10865
|
-
cursor = previousCursor;
|
|
10866
|
-
return handleInterpolation(mergedProps, registered, result);
|
|
10867
|
-
}
|
|
10868
|
-
}
|
|
10869
|
-
var asString = interpolation;
|
|
10870
|
-
if (registered == null) return asString;
|
|
10871
|
-
var cached = registered[asString];
|
|
10872
|
-
return cached !== void 0 ? cached : asString;
|
|
10873
|
-
}
|
|
10874
|
-
function createStringFromObject(mergedProps, registered, obj) {
|
|
10875
|
-
var string = "";
|
|
10876
|
-
if (Array.isArray(obj)) for (var i = 0; i < obj.length; i++) string += handleInterpolation(mergedProps, registered, obj[i]) + ";";
|
|
10877
|
-
else for (var key in obj) {
|
|
10878
|
-
var value = obj[key];
|
|
10879
|
-
if (typeof value !== "object") {
|
|
10880
|
-
var asString = value;
|
|
10881
|
-
if (registered != null && registered[asString] !== void 0) string += key + "{" + registered[asString] + "}";
|
|
10882
|
-
else if (isProcessableValue(asString)) string += processStyleName(key) + ":" + processStyleValue(key, asString) + ";";
|
|
10883
|
-
} else {
|
|
10884
|
-
if (key === "NO_COMPONENT_SELECTOR" && isDevelopment) throw new Error(noComponentSelectorMessage);
|
|
10885
|
-
if (Array.isArray(value) && typeof value[0] === "string" && (registered == null || registered[value[0]] === void 0)) {
|
|
10886
|
-
for (var _i = 0; _i < value.length; _i++) if (isProcessableValue(value[_i])) string += processStyleName(key) + ":" + processStyleValue(key, value[_i]) + ";";
|
|
10887
|
-
} else {
|
|
10888
|
-
var interpolated = handleInterpolation(mergedProps, registered, value);
|
|
10889
|
-
switch (key) {
|
|
10890
|
-
case "animation":
|
|
10891
|
-
case "animationName":
|
|
10892
|
-
string += processStyleName(key) + ":" + interpolated + ";";
|
|
10893
|
-
break;
|
|
10894
|
-
default: string += key + "{" + interpolated + "}";
|
|
10895
|
-
}
|
|
10896
|
-
}
|
|
10897
|
-
}
|
|
10898
|
-
}
|
|
10899
|
-
return string;
|
|
10900
|
-
}
|
|
10901
|
-
var labelPattern = /label:\s*([^\s;{]+)\s*(;|$)/g;
|
|
10902
|
-
var cursor;
|
|
10903
|
-
function serializeStyles(args, registered, mergedProps) {
|
|
10904
|
-
if (args.length === 1 && typeof args[0] === "object" && args[0] !== null && args[0].styles !== void 0) return args[0];
|
|
10905
|
-
var stringMode = true;
|
|
10906
|
-
var styles = "";
|
|
10907
|
-
cursor = void 0;
|
|
10908
|
-
var strings = args[0];
|
|
10909
|
-
if (strings == null || strings.raw === void 0) {
|
|
10910
|
-
stringMode = false;
|
|
10911
|
-
styles += handleInterpolation(mergedProps, registered, strings);
|
|
10912
|
-
} else styles += strings[0];
|
|
10913
|
-
for (var i = 1; i < args.length; i++) {
|
|
10914
|
-
styles += handleInterpolation(mergedProps, registered, args[i]);
|
|
10915
|
-
if (stringMode) styles += strings[i];
|
|
10916
|
-
}
|
|
10917
|
-
labelPattern.lastIndex = 0;
|
|
10918
|
-
var identifierName = "";
|
|
10919
|
-
var match;
|
|
10920
|
-
while ((match = labelPattern.exec(styles)) !== null) identifierName += "-" + match[1];
|
|
10921
|
-
return {
|
|
10922
|
-
name: murmur2(styles) + identifierName,
|
|
10923
|
-
styles,
|
|
10924
|
-
next: cursor
|
|
10925
|
-
};
|
|
10926
|
-
}
|
|
10927
|
-
React["useInsertionEffect"] && React["useInsertionEffect"] || React.useLayoutEffect;
|
|
10928
|
-
//#endregion
|
|
10929
|
-
//#region ../../../node_modules/.pnpm/@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.0/node_modules/@emotion/react/dist/emotion-element-f0de968e.browser.esm.js
|
|
10930
|
-
var EmotionCacheContext = /* #__PURE__ */ React.createContext(typeof HTMLElement !== "undefined" ? /* #__PURE__ */ createCache({ key: "css" }) : null);
|
|
10931
|
-
EmotionCacheContext.Provider;
|
|
10932
|
-
var __unsafe_useEmotionCache = function useEmotionCache() {
|
|
10933
|
-
return useContext(EmotionCacheContext);
|
|
10934
|
-
};
|
|
10935
|
-
({}).hasOwnProperty;
|
|
10936
|
-
//#endregion
|
|
10937
|
-
//#region ../../../node_modules/.pnpm/@emotion+css@11.13.5/node_modules/@emotion/css/create-instance/dist/emotion-css-create-instance.esm.js
|
|
10938
|
-
function insertWithoutScoping(cache, serialized) {
|
|
10939
|
-
if (cache.inserted[serialized.name] === void 0) return cache.insert("", serialized, cache.sheet, true);
|
|
10940
|
-
}
|
|
10941
|
-
function merge$1(registered, css, className) {
|
|
10942
|
-
var registeredStyles = [];
|
|
10943
|
-
var rawClassName = getRegisteredStyles$1(registered, registeredStyles, className);
|
|
10944
|
-
if (registeredStyles.length < 2) return className;
|
|
10945
|
-
return rawClassName + css(registeredStyles);
|
|
10946
|
-
}
|
|
10947
|
-
var createEmotion = function createEmotion(options) {
|
|
10948
|
-
var cache = createCache(options);
|
|
10949
|
-
cache.sheet.speedy = function(value) {
|
|
10950
|
-
this.isSpeedy = value;
|
|
10951
|
-
};
|
|
10952
|
-
cache.compat = true;
|
|
10953
|
-
var css = function css() {
|
|
10954
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
|
|
10955
|
-
var serialized = serializeStyles(args, cache.registered, void 0);
|
|
10956
|
-
insertStyles(cache, serialized, false);
|
|
10957
|
-
return cache.key + "-" + serialized.name;
|
|
10958
|
-
};
|
|
10959
|
-
return {
|
|
10960
|
-
css,
|
|
10961
|
-
cx: function cx() {
|
|
10962
|
-
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) args[_key4] = arguments[_key4];
|
|
10963
|
-
return merge$1(cache.registered, css, classnames(args));
|
|
10964
|
-
},
|
|
10965
|
-
injectGlobal: function injectGlobal() {
|
|
10966
|
-
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) args[_key3] = arguments[_key3];
|
|
10967
|
-
insertWithoutScoping(cache, serializeStyles(args, cache.registered));
|
|
10968
|
-
},
|
|
10969
|
-
keyframes: function keyframes() {
|
|
10970
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) args[_key2] = arguments[_key2];
|
|
10971
|
-
var serialized = serializeStyles(args, cache.registered);
|
|
10972
|
-
var animation = "animation-" + serialized.name;
|
|
10973
|
-
insertWithoutScoping(cache, {
|
|
10974
|
-
name: serialized.name,
|
|
10975
|
-
styles: "@keyframes " + animation + "{" + serialized.styles + "}"
|
|
10976
|
-
});
|
|
10977
|
-
return animation;
|
|
10978
|
-
},
|
|
10979
|
-
hydrate: function hydrate(ids) {
|
|
10980
|
-
ids.forEach(function(key) {
|
|
10981
|
-
cache.inserted[key] = true;
|
|
10982
|
-
});
|
|
10983
|
-
},
|
|
10984
|
-
flush: function flush() {
|
|
10985
|
-
cache.registered = {};
|
|
10986
|
-
cache.inserted = {};
|
|
10987
|
-
cache.sheet.flush();
|
|
10988
|
-
},
|
|
10989
|
-
sheet: cache.sheet,
|
|
10990
|
-
cache,
|
|
10991
|
-
getRegisteredStyles: getRegisteredStyles$1.bind(null, cache.registered),
|
|
10992
|
-
merge: merge$1.bind(null, cache.registered, css)
|
|
10993
|
-
};
|
|
10994
|
-
};
|
|
10995
|
-
var classnames = function classnames(args) {
|
|
10996
|
-
var cls = "";
|
|
10997
|
-
for (var i = 0; i < args.length; i++) {
|
|
10998
|
-
var arg = args[i];
|
|
10999
|
-
if (arg == null) continue;
|
|
11000
|
-
var toAdd = void 0;
|
|
11001
|
-
switch (typeof arg) {
|
|
11002
|
-
case "boolean": break;
|
|
11003
|
-
case "object":
|
|
11004
|
-
if (Array.isArray(arg)) toAdd = classnames(arg);
|
|
11005
|
-
else {
|
|
11006
|
-
toAdd = "";
|
|
11007
|
-
for (var k in arg) if (arg[k] && k) {
|
|
11008
|
-
toAdd && (toAdd += " ");
|
|
11009
|
-
toAdd += k;
|
|
11010
|
-
}
|
|
11011
|
-
}
|
|
11012
|
-
break;
|
|
11013
|
-
default: toAdd = arg;
|
|
11014
|
-
}
|
|
11015
|
-
if (toAdd) {
|
|
11016
|
-
cls && (cls += " ");
|
|
11017
|
-
cls += toAdd;
|
|
11018
|
-
}
|
|
11019
|
-
}
|
|
11020
|
-
return cls;
|
|
11021
|
-
};
|
|
11022
|
-
//#endregion
|
|
11023
|
-
//#region ../../../node_modules/.pnpm/@emotion+css@11.13.5/node_modules/@emotion/css/dist/emotion-css.esm.js
|
|
11024
|
-
var _createEmotion = createEmotion({ key: "css" });
|
|
11025
|
-
_createEmotion.flush;
|
|
11026
|
-
_createEmotion.hydrate;
|
|
11027
|
-
var cx = _createEmotion.cx;
|
|
11028
|
-
_createEmotion.merge;
|
|
11029
|
-
_createEmotion.getRegisteredStyles;
|
|
11030
|
-
_createEmotion.injectGlobal;
|
|
11031
|
-
_createEmotion.keyframes;
|
|
11032
|
-
_createEmotion.css;
|
|
11033
|
-
_createEmotion.sheet;
|
|
11034
|
-
_createEmotion.cache;
|
|
11035
|
-
//#endregion
|
|
11036
|
-
//#region ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_6d0393a58a031b78f608040e2ecbe6e0/node_modules/@wordpress/components/build-module/utils/hooks/use-cx.mjs
|
|
11037
|
-
var isSerializedStyles = (o) => typeof o !== "undefined" && o !== null && ["name", "styles"].every((p) => typeof o[p] !== "undefined");
|
|
11038
|
-
var useCx = () => {
|
|
11039
|
-
const cache = __unsafe_useEmotionCache();
|
|
11040
|
-
return useCallback$1((...classNames) => {
|
|
11041
|
-
if (cache === null) throw new Error("The `useCx` hook should be only used within a valid Emotion Cache Context");
|
|
11042
|
-
return cx(...classNames.map((arg) => {
|
|
11043
|
-
if (isSerializedStyles(arg)) {
|
|
11044
|
-
insertStyles(cache, arg, false);
|
|
11045
|
-
return `${cache.key}-${arg.name}`;
|
|
11046
|
-
}
|
|
11047
|
-
return arg;
|
|
11048
|
-
}));
|
|
11049
|
-
}, [cache]);
|
|
11050
|
-
};
|
|
11051
|
-
//#endregion
|
|
11052
|
-
//#region ../../../node_modules/.pnpm/memize@2.1.1/node_modules/memize/dist/index.js
|
|
11053
|
-
/**
|
|
11054
|
-
* Memize options object.
|
|
11055
|
-
*
|
|
11056
|
-
* @typedef MemizeOptions
|
|
11057
|
-
*
|
|
11058
|
-
* @property {number} [maxSize] Maximum size of the cache.
|
|
11059
|
-
*/
|
|
11060
|
-
/**
|
|
11061
|
-
* Internal cache entry.
|
|
11062
|
-
*
|
|
11063
|
-
* @typedef MemizeCacheNode
|
|
11064
|
-
*
|
|
11065
|
-
* @property {?MemizeCacheNode|undefined} [prev] Previous node.
|
|
11066
|
-
* @property {?MemizeCacheNode|undefined} [next] Next node.
|
|
11067
|
-
* @property {Array<*>} args Function arguments for cache
|
|
11068
|
-
* entry.
|
|
11069
|
-
* @property {*} val Function result.
|
|
11070
|
-
*/
|
|
11071
|
-
/**
|
|
11072
|
-
* Properties of the enhanced function for controlling cache.
|
|
11073
|
-
*
|
|
11074
|
-
* @typedef MemizeMemoizedFunction
|
|
11075
|
-
*
|
|
11076
|
-
* @property {()=>void} clear Clear the cache.
|
|
9973
|
+
* Properties of the enhanced function for controlling cache.
|
|
9974
|
+
*
|
|
9975
|
+
* @typedef MemizeMemoizedFunction
|
|
9976
|
+
*
|
|
9977
|
+
* @property {()=>void} clear Clear the cache.
|
|
11077
9978
|
*/
|
|
11078
9979
|
/**
|
|
11079
9980
|
* Accepts a function to be memoized, and returns a new memoized function, with
|
|
@@ -11139,93 +10040,18 @@ function memize(fn, options) {
|
|
|
11139
10040
|
};
|
|
11140
10041
|
return memoized;
|
|
11141
10042
|
}
|
|
11142
|
-
|
|
11143
|
-
//#region ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_6d0393a58a031b78f608040e2ecbe6e0/node_modules/@wordpress/components/build-module/context/context-system-provider.mjs
|
|
11144
|
-
var import_es6 = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
11145
|
-
module.exports = function equal(a, b) {
|
|
11146
|
-
if (a === b) return true;
|
|
11147
|
-
if (a && b && typeof a == "object" && typeof b == "object") {
|
|
11148
|
-
if (a.constructor !== b.constructor) return false;
|
|
11149
|
-
var length, i, keys;
|
|
11150
|
-
if (Array.isArray(a)) {
|
|
11151
|
-
length = a.length;
|
|
11152
|
-
if (length != b.length) return false;
|
|
11153
|
-
for (i = length; i-- !== 0;) if (!equal(a[i], b[i])) return false;
|
|
11154
|
-
return true;
|
|
11155
|
-
}
|
|
11156
|
-
if (a instanceof Map && b instanceof Map) {
|
|
11157
|
-
if (a.size !== b.size) return false;
|
|
11158
|
-
for (i of a.entries()) if (!b.has(i[0])) return false;
|
|
11159
|
-
for (i of a.entries()) if (!equal(i[1], b.get(i[0]))) return false;
|
|
11160
|
-
return true;
|
|
11161
|
-
}
|
|
11162
|
-
if (a instanceof Set && b instanceof Set) {
|
|
11163
|
-
if (a.size !== b.size) return false;
|
|
11164
|
-
for (i of a.entries()) if (!b.has(i[0])) return false;
|
|
11165
|
-
return true;
|
|
11166
|
-
}
|
|
11167
|
-
if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
|
|
11168
|
-
length = a.length;
|
|
11169
|
-
if (length != b.length) return false;
|
|
11170
|
-
for (i = length; i-- !== 0;) if (a[i] !== b[i]) return false;
|
|
11171
|
-
return true;
|
|
11172
|
-
}
|
|
11173
|
-
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
|
|
11174
|
-
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
|
|
11175
|
-
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
|
|
11176
|
-
keys = Object.keys(a);
|
|
11177
|
-
length = keys.length;
|
|
11178
|
-
if (length !== Object.keys(b).length) return false;
|
|
11179
|
-
for (i = length; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
|
|
11180
|
-
for (i = length; i-- !== 0;) {
|
|
11181
|
-
var key = keys[i];
|
|
11182
|
-
if (!equal(a[key], b[key])) return false;
|
|
11183
|
-
}
|
|
11184
|
-
return true;
|
|
11185
|
-
}
|
|
11186
|
-
return a !== a && b !== b;
|
|
11187
|
-
};
|
|
11188
|
-
})))(), 1);
|
|
11189
|
-
var ComponentsContext = createContext$1({});
|
|
11190
|
-
ComponentsContext.displayName = "ComponentsContext";
|
|
11191
|
-
var useComponentsContext = () => useContext$1(ComponentsContext);
|
|
11192
|
-
function useContextSystemBridge({ value }) {
|
|
11193
|
-
const parentContext = useComponentsContext();
|
|
11194
|
-
const valueRef = useRef$1(value);
|
|
11195
|
-
use_update_effect_default(() => {
|
|
11196
|
-
if ((0, import_es6.default)(valueRef.current, value) && valueRef.current !== value) globalThis.SCRIPT_DEBUG === true && warning(`Please memoize your context: ${JSON.stringify(value)}`);
|
|
11197
|
-
}, [value]);
|
|
11198
|
-
return useMemo$1(() => {
|
|
11199
|
-
return deepmerge(parentContext ?? {}, value ?? {}, { isMergeableObject: isPlainObject });
|
|
11200
|
-
}, [parentContext, value]);
|
|
11201
|
-
}
|
|
11202
|
-
var BaseContextSystemProvider = ({ children, value }) => {
|
|
11203
|
-
const contextValue = useContextSystemBridge({ value });
|
|
11204
|
-
return /* @__PURE__ */ jsx(ComponentsContext.Provider, {
|
|
11205
|
-
value: contextValue,
|
|
11206
|
-
children
|
|
11207
|
-
});
|
|
11208
|
-
};
|
|
11209
|
-
memo(BaseContextSystemProvider);
|
|
11210
|
-
//#endregion
|
|
11211
|
-
//#region ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_6d0393a58a031b78f608040e2ecbe6e0/node_modules/@wordpress/components/build-module/context/constants.mjs
|
|
11212
|
-
var COMPONENT_NAMESPACE = "data-wp-component";
|
|
11213
|
-
var CONNECTED_NAMESPACE = "data-wp-c16t";
|
|
11214
|
-
var CONNECT_STATIC_NAMESPACE = "__contextSystemKey__";
|
|
11215
|
-
//#endregion
|
|
11216
|
-
//#region ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_6d0393a58a031b78f608040e2ecbe6e0/node_modules/@wordpress/components/build-module/context/get-styled-class-name-from-key.mjs
|
|
10043
|
+
// ../../../node_modules/.pnpm/@wordpress+components@43.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_401cb4bad47bd1f7b56615ff574f0485/node_modules/@wordpress/components/build-module/context/get-styled-class-name-from-key.mjs
|
|
11217
10044
|
function getStyledClassName(namespace) {
|
|
11218
|
-
return `components-${
|
|
10045
|
+
return `components-${namespace.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([A-Z])([A-Z][a-z])/g, "$1-$2").replace(/[^A-Z0-9]+/gi, "-").replace(/^-|-$/g, "").toLowerCase()}`;
|
|
11219
10046
|
}
|
|
11220
10047
|
var getStyledClassNameFromKey = memize(getStyledClassName);
|
|
11221
|
-
|
|
11222
|
-
//#region ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_6d0393a58a031b78f608040e2ecbe6e0/node_modules/@wordpress/components/build-module/context/context-connect.mjs
|
|
10048
|
+
// ../../../node_modules/.pnpm/@wordpress+components@43.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_401cb4bad47bd1f7b56615ff574f0485/node_modules/@wordpress/components/build-module/context/context-connect.mjs
|
|
11223
10049
|
function contextConnect(Component, namespace) {
|
|
11224
10050
|
return _contextConnect(Component, namespace, { forwardsRef: true });
|
|
11225
10051
|
}
|
|
11226
10052
|
function _contextConnect(Component, namespace, options) {
|
|
11227
10053
|
const WrappedComponent = options?.forwardsRef ? forwardRef$1(Component) : Component;
|
|
11228
|
-
if (typeof namespace === "undefined")
|
|
10054
|
+
if (typeof namespace === "undefined") warning("contextConnect: Please provide a namespace");
|
|
11229
10055
|
let mergedNamespace = WrappedComponent["__contextSystemKey__"] || [namespace];
|
|
11230
10056
|
if (Array.isArray(namespace)) mergedNamespace = [...mergedNamespace, ...namespace];
|
|
11231
10057
|
if (typeof namespace === "string") mergedNamespace = [...mergedNamespace, namespace];
|
|
@@ -11235,19 +10061,17 @@ function _contextConnect(Component, namespace, options) {
|
|
|
11235
10061
|
selector: `.${getStyledClassNameFromKey(namespace)}`
|
|
11236
10062
|
});
|
|
11237
10063
|
}
|
|
11238
|
-
|
|
11239
|
-
//#region ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_6d0393a58a031b78f608040e2ecbe6e0/node_modules/@wordpress/components/build-module/context/utils.mjs
|
|
10064
|
+
// ../../../node_modules/.pnpm/@wordpress+components@43.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_401cb4bad47bd1f7b56615ff574f0485/node_modules/@wordpress/components/build-module/context/utils.mjs
|
|
11240
10065
|
function getNamespace(componentName) {
|
|
11241
10066
|
return { [COMPONENT_NAMESPACE]: componentName };
|
|
11242
10067
|
}
|
|
11243
10068
|
function getConnectedNamespace() {
|
|
11244
10069
|
return { [CONNECTED_NAMESPACE]: true };
|
|
11245
10070
|
}
|
|
11246
|
-
|
|
11247
|
-
//#region ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_6d0393a58a031b78f608040e2ecbe6e0/node_modules/@wordpress/components/build-module/context/use-context-system.mjs
|
|
10071
|
+
// ../../../node_modules/.pnpm/@wordpress+components@43.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_401cb4bad47bd1f7b56615ff574f0485/node_modules/@wordpress/components/build-module/context/use-context-system.mjs
|
|
11248
10072
|
function useContextSystem(props, namespace) {
|
|
11249
10073
|
const contextSystemProps = useComponentsContext();
|
|
11250
|
-
if (typeof namespace === "undefined")
|
|
10074
|
+
if (typeof namespace === "undefined") warning("useContextSystem: Please provide a namespace");
|
|
11251
10075
|
const contextProps = contextSystemProps?.[namespace] || {};
|
|
11252
10076
|
const finalComponentProps = {
|
|
11253
10077
|
...getConnectedNamespace(),
|
|
@@ -11257,7 +10081,7 @@ function useContextSystem(props, namespace) {
|
|
|
11257
10081
|
const overrideProps = _overrides;
|
|
11258
10082
|
const initialMergedProps = Object.entries(otherContextProps).length ? Object.assign({}, otherContextProps, props) : props;
|
|
11259
10083
|
const propsWithChildren = initialMergedProps;
|
|
11260
|
-
const classes =
|
|
10084
|
+
const classes = clsx(getStyledClassNameFromKey(namespace), props.className);
|
|
11261
10085
|
const rendered = typeof propsWithChildren.renderChildren === "function" ? propsWithChildren.renderChildren(initialMergedProps) : propsWithChildren.children;
|
|
11262
10086
|
for (const key in initialMergedProps) finalComponentProps[key] = initialMergedProps[key];
|
|
11263
10087
|
for (const key in overrideProps) finalComponentProps[key] = overrideProps[key];
|
|
@@ -11265,8 +10089,7 @@ function useContextSystem(props, namespace) {
|
|
|
11265
10089
|
finalComponentProps.className = classes;
|
|
11266
10090
|
return finalComponentProps;
|
|
11267
10091
|
}
|
|
11268
|
-
|
|
11269
|
-
//#region ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_6d0393a58a031b78f608040e2ecbe6e0/node_modules/@wordpress/components/build-module/visually-hidden/styles.mjs
|
|
10092
|
+
// ../../../node_modules/.pnpm/@wordpress+components@43.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_401cb4bad47bd1f7b56615ff574f0485/node_modules/@wordpress/components/build-module/visually-hidden/styles.mjs
|
|
11270
10093
|
var visuallyHidden = {
|
|
11271
10094
|
border: 0,
|
|
11272
10095
|
clip: "rect(1px, 1px, 1px, 1px)",
|
|
@@ -11281,8 +10104,7 @@ var visuallyHidden = {
|
|
|
11281
10104
|
wordWrap: "normal",
|
|
11282
10105
|
wordBreak: "normal"
|
|
11283
10106
|
};
|
|
11284
|
-
|
|
11285
|
-
//#region ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_6d0393a58a031b78f608040e2ecbe6e0/node_modules/@wordpress/components/build-module/utils/polymorphic-element.mjs
|
|
10107
|
+
// ../../../node_modules/.pnpm/@wordpress+components@43.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_401cb4bad47bd1f7b56615ff574f0485/node_modules/@wordpress/components/build-module/utils/polymorphic-element.mjs
|
|
11286
10108
|
var customAttributeRegExp = /^(data|aria|x)-/i;
|
|
11287
10109
|
var eventHandlerRegExp = /^on[A-Z]/;
|
|
11288
10110
|
var svgElementNames = new Set(`animate animateMotion animateTransform circle clipPath defs desc ellipse
|
|
@@ -11371,8 +10193,7 @@ function UnforwardedPolymorphicElement({ as, ...props }, ref) {
|
|
|
11371
10193
|
});
|
|
11372
10194
|
}
|
|
11373
10195
|
var PolymorphicElement = forwardRef$1(UnforwardedPolymorphicElement);
|
|
11374
|
-
|
|
11375
|
-
//#region ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_6d0393a58a031b78f608040e2ecbe6e0/node_modules/@wordpress/components/build-module/view/component.mjs
|
|
10196
|
+
// ../../../node_modules/.pnpm/@wordpress+components@43.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_401cb4bad47bd1f7b56615ff574f0485/node_modules/@wordpress/components/build-module/view/component.mjs
|
|
11376
10197
|
function UnforwardedView({ css, ...restProps }, ref) {
|
|
11377
10198
|
return /* @__PURE__ */ jsx(PolymorphicElement, {
|
|
11378
10199
|
ref,
|
|
@@ -11380,8 +10201,7 @@ function UnforwardedView({ css, ...restProps }, ref) {
|
|
|
11380
10201
|
});
|
|
11381
10202
|
}
|
|
11382
10203
|
var component_default$2 = Object.assign(forwardRef$1(UnforwardedView), { selector: ".components-view" });
|
|
11383
|
-
|
|
11384
|
-
//#region ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_6d0393a58a031b78f608040e2ecbe6e0/node_modules/@wordpress/components/build-module/visually-hidden/component.mjs
|
|
10204
|
+
// ../../../node_modules/.pnpm/@wordpress+components@43.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_401cb4bad47bd1f7b56615ff574f0485/node_modules/@wordpress/components/build-module/visually-hidden/component.mjs
|
|
11385
10205
|
function UnconnectedVisuallyHidden(props, forwardedRef) {
|
|
11386
10206
|
const { style: styleProp, ...contextProps } = useContextSystem(props, "VisuallyHidden");
|
|
11387
10207
|
return /* @__PURE__ */ jsx(component_default$2, {
|
|
@@ -11395,8 +10215,7 @@ function UnconnectedVisuallyHidden(props, forwardedRef) {
|
|
|
11395
10215
|
});
|
|
11396
10216
|
}
|
|
11397
10217
|
var component_default$1 = contextConnect(UnconnectedVisuallyHidden, "VisuallyHidden");
|
|
11398
|
-
|
|
11399
|
-
//#region ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_6d0393a58a031b78f608040e2ecbe6e0/node_modules/@wordpress/components/build-module/utils/use-responsive-value.mjs
|
|
10218
|
+
// ../../../node_modules/.pnpm/@wordpress+components@43.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_401cb4bad47bd1f7b56615ff574f0485/node_modules/@wordpress/components/build-module/utils/use-responsive-value.mjs
|
|
11400
10219
|
var breakpoints = [
|
|
11401
10220
|
"40em",
|
|
11402
10221
|
"52em",
|
|
@@ -11434,16 +10253,15 @@ function useResponsiveValue(values, options = {}) {
|
|
|
11434
10253
|
const array = values || [];
|
|
11435
10254
|
return array[index >= array.length ? array.length - 1 : index];
|
|
11436
10255
|
}
|
|
11437
|
-
|
|
11438
|
-
//#region ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_6d0393a58a031b78f608040e2ecbe6e0/node_modules/@wordpress/components/build-module/grid/utils.mjs
|
|
10256
|
+
// ../../../node_modules/.pnpm/@wordpress+components@43.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_401cb4bad47bd1f7b56615ff574f0485/node_modules/@wordpress/components/build-module/grid/utils.mjs
|
|
11439
10257
|
var ALIGNMENTS = {
|
|
11440
10258
|
bottom: {
|
|
11441
10259
|
alignItems: "flex-end",
|
|
11442
10260
|
justifyContent: "center"
|
|
11443
10261
|
},
|
|
11444
10262
|
bottomLeft: {
|
|
11445
|
-
alignItems: "flex-
|
|
11446
|
-
justifyContent: "flex-
|
|
10263
|
+
alignItems: "flex-end",
|
|
10264
|
+
justifyContent: "flex-start"
|
|
11447
10265
|
},
|
|
11448
10266
|
bottomRight: {
|
|
11449
10267
|
alignItems: "flex-end",
|
|
@@ -11482,8 +10300,7 @@ var ALIGNMENTS = {
|
|
|
11482
10300
|
function getAlignmentProps(alignment) {
|
|
11483
10301
|
return alignment ? ALIGNMENTS[alignment] ?? {} : {};
|
|
11484
10302
|
}
|
|
11485
|
-
|
|
11486
|
-
//#region ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_6d0393a58a031b78f608040e2ecbe6e0/node_modules/@wordpress/components/build-module/grid/hook.mjs
|
|
10303
|
+
// ../../../node_modules/.pnpm/@wordpress+components@43.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_401cb4bad47bd1f7b56615ff574f0485/node_modules/@wordpress/components/build-module/grid/hook.mjs
|
|
11487
10304
|
var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
|
|
11488
10305
|
function getRuntime() {
|
|
11489
10306
|
const globalScope = globalThis;
|
|
@@ -11627,8 +10444,7 @@ function useGrid(props) {
|
|
|
11627
10444
|
}
|
|
11628
10445
|
};
|
|
11629
10446
|
}
|
|
11630
|
-
|
|
11631
|
-
//#region ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_6d0393a58a031b78f608040e2ecbe6e0/node_modules/@wordpress/components/build-module/grid/component.mjs
|
|
10447
|
+
// ../../../node_modules/.pnpm/@wordpress+components@43.0.0_@date-fns+tz@1.5.0_@types+react-dom@19.3.0_@types+react@19_401cb4bad47bd1f7b56615ff574f0485/node_modules/@wordpress/components/build-module/grid/component.mjs
|
|
11632
10448
|
function UnconnectedGrid(props, forwardedRef) {
|
|
11633
10449
|
const gridProps = useGrid(props);
|
|
11634
10450
|
return /* @__PURE__ */ jsx(component_default$2, {
|
|
@@ -11637,8 +10453,7 @@ function UnconnectedGrid(props, forwardedRef) {
|
|
|
11637
10453
|
});
|
|
11638
10454
|
}
|
|
11639
10455
|
var component_default = contextConnect(UnconnectedGrid, "Grid");
|
|
11640
|
-
|
|
11641
|
-
//#region src/charts/leaderboard-chart/hooks/use-fitted-row-count.ts
|
|
10456
|
+
// src/charts/leaderboard-chart/hooks/use-fitted-row-count.ts
|
|
11642
10457
|
/**
|
|
11643
10458
|
* Fractional layout rounding can put a row's bottom a hair past the container's
|
|
11644
10459
|
* without any visible clipping. Allow that much slack before hiding a row.
|
|
@@ -11721,8 +10536,7 @@ function useFittedRowCount(enabled, rowCount, data) {
|
|
|
11721
10536
|
isMeasurable
|
|
11722
10537
|
};
|
|
11723
10538
|
}
|
|
11724
|
-
|
|
11725
|
-
//#region src/charts/leaderboard-chart/hooks/use-leaderboard-legend-items.ts
|
|
10539
|
+
// src/charts/leaderboard-chart/hooks/use-leaderboard-legend-items.ts
|
|
11726
10540
|
/**
|
|
11727
10541
|
* Hook to create legend items from leaderboard data
|
|
11728
10542
|
* @param root0 - Configuration object
|
|
@@ -11770,11 +10584,12 @@ function useLeaderboardLegendItems({ data, primaryColor, secondaryColor, withCom
|
|
|
11770
10584
|
withOverlayLabel
|
|
11771
10585
|
]);
|
|
11772
10586
|
}
|
|
11773
|
-
|
|
11774
|
-
//#region src/charts/leaderboard-chart/leaderboard-chart.module.scss
|
|
10587
|
+
// src/charts/leaderboard-chart/leaderboard-chart.module.scss
|
|
11775
10588
|
var leaderboard_chart_module_default = {
|
|
11776
10589
|
"bar": "a8ccharts-GovfoW-bar",
|
|
11777
10590
|
"bar--animated": "a8ccharts-GovfoW-bar--animated",
|
|
10591
|
+
"bar--negative": "a8ccharts-GovfoW-bar--negative",
|
|
10592
|
+
"barTrack": "a8ccharts-GovfoW-barTrack",
|
|
11778
10593
|
"barWithLabelContainer": "a8ccharts-GovfoW-barWithLabelContainer",
|
|
11779
10594
|
"chevron": "a8ccharts-GovfoW-chevron",
|
|
11780
10595
|
"deltaPlaceholder": "a8ccharts-GovfoW-deltaPlaceholder",
|
|
@@ -11801,8 +10616,42 @@ var leaderboard_chart_module_default = {
|
|
|
11801
10616
|
"stretch": "a8ccharts-GovfoW-stretch",
|
|
11802
10617
|
"valueContainer": "a8ccharts-GovfoW-valueContainer"
|
|
11803
10618
|
};
|
|
11804
|
-
|
|
11805
|
-
|
|
10619
|
+
// src/charts/leaderboard-chart/private/resolve-leaderboard-entries.ts
|
|
10620
|
+
const toShare = (value, max) => max === 0 ? 0 : value / max * 100;
|
|
10621
|
+
const toDelta = (currentValue, previousValue) => {
|
|
10622
|
+
if (previousValue == null) return;
|
|
10623
|
+
if (previousValue === 0) return currentValue === 0 ? 0 : void 0;
|
|
10624
|
+
return (currentValue - previousValue) / Math.abs(previousValue) * 100;
|
|
10625
|
+
};
|
|
10626
|
+
/**
|
|
10627
|
+
* Fills in the shares and delta an entry omits, derived from its values.
|
|
10628
|
+
*
|
|
10629
|
+
* @param data - Leaderboard entries; passed shares and delta win over derived ones.
|
|
10630
|
+
* @param options - Resolver options.
|
|
10631
|
+
* @param options.includePrevious - Whether previous values count toward the shared max.
|
|
10632
|
+
* @param options.clampNegative - Whether a negative share draws as an empty bar instead of below zero.
|
|
10633
|
+
* @return Entries with `currentShare` always set.
|
|
10634
|
+
*/
|
|
10635
|
+
function resolveLeaderboardEntries(data, { includePrevious, clampNegative = false }) {
|
|
10636
|
+
const magnitude = clampNegative ? (value) => Math.max(value, 0) : Math.abs;
|
|
10637
|
+
const clamp = (share) => clampNegative ? Math.max(share, 0) : share;
|
|
10638
|
+
const max = data.reduce((largest, { currentValue, previousValue }) => {
|
|
10639
|
+
const previous = includePrevious && previousValue != null ? magnitude(previousValue) : 0;
|
|
10640
|
+
return Math.max(largest, magnitude(currentValue), previous);
|
|
10641
|
+
}, 0);
|
|
10642
|
+
return data.map((entry) => {
|
|
10643
|
+
const passedOrDerivedPrevious = entry.previousShare ?? (entry.previousValue != null ? toShare(entry.previousValue, max) : void 0);
|
|
10644
|
+
const previousShare = passedOrDerivedPrevious !== void 0 ? clamp(passedOrDerivedPrevious) : void 0;
|
|
10645
|
+
const delta = entry.delta ?? toDelta(entry.currentValue, entry.previousValue);
|
|
10646
|
+
return {
|
|
10647
|
+
...entry,
|
|
10648
|
+
currentShare: clamp(entry.currentShare ?? toShare(entry.currentValue, max)),
|
|
10649
|
+
...previousShare !== void 0 && { previousShare },
|
|
10650
|
+
...delta !== void 0 && { delta }
|
|
10651
|
+
};
|
|
10652
|
+
});
|
|
10653
|
+
}
|
|
10654
|
+
// src/charts/leaderboard-chart/leaderboard-chart.tsx
|
|
11806
10655
|
const ROW_GAP = "var(--a8c-charts-dimension-leaderboard-row-gap, 12px)";
|
|
11807
10656
|
const COLUMN_GAP = "var(--a8c-charts-dimension-leaderboard-column-gap, 4px)";
|
|
11808
10657
|
/** Indexed by `Math.sign( delta ) + 1`, so [negative, neutral, positive]. */
|
|
@@ -11862,27 +10711,43 @@ const BarLabel = ({ label }) => /* @__PURE__ */ jsx(Fragment$1, { children: type
|
|
|
11862
10711
|
className: leaderboard_chart_module_default.label,
|
|
11863
10712
|
children: label
|
|
11864
10713
|
}) : label });
|
|
11865
|
-
const
|
|
10714
|
+
const Bar = ({ share, color, animation, divergingScale }) => {
|
|
10715
|
+
const isNegative = share < 0;
|
|
10716
|
+
const sideMax = divergingScale?.[isNegative ? "negative" : "positive"];
|
|
10717
|
+
const width = sideMax ? Math.abs(share) / sideMax * 100 : Math.abs(share);
|
|
10718
|
+
const bar = /* @__PURE__ */ jsx("div", {
|
|
10719
|
+
className: clsx(leaderboard_chart_module_default.bar, {
|
|
10720
|
+
[leaderboard_chart_module_default["bar--animated"]]: animation,
|
|
10721
|
+
[leaderboard_chart_module_default["bar--negative"]]: divergingScale && isNegative
|
|
10722
|
+
}),
|
|
10723
|
+
style: {
|
|
10724
|
+
width: getBarWidth(width),
|
|
10725
|
+
backgroundColor: color
|
|
10726
|
+
}
|
|
10727
|
+
});
|
|
10728
|
+
if (!divergingScale) return bar;
|
|
10729
|
+
return /* @__PURE__ */ jsx("div", {
|
|
10730
|
+
className: leaderboard_chart_module_default.barTrack,
|
|
10731
|
+
style: { gridTemplateColumns: `${divergingScale.negative}fr ${divergingScale.positive}fr` },
|
|
10732
|
+
children: bar
|
|
10733
|
+
});
|
|
10734
|
+
};
|
|
10735
|
+
const BarWithLabel = ({ entry, withComparison, withOverlayLabel, primaryColor, secondaryColor, animation, divergingScale, isPrimaryVisible = true, isComparisonVisible = true }) => {
|
|
11866
10736
|
const showComparisonBar = withComparison && !withOverlayLabel && isComparisonVisible;
|
|
10737
|
+
const bars = /* @__PURE__ */ jsxs(Fragment$1, { children: [isPrimaryVisible && /* @__PURE__ */ jsx(Bar, {
|
|
10738
|
+
share: entry.currentShare,
|
|
10739
|
+
color: primaryColor,
|
|
10740
|
+
animation,
|
|
10741
|
+
divergingScale
|
|
10742
|
+
}), showComparisonBar && hasPreviousValue(entry) && /* @__PURE__ */ jsx(Bar, {
|
|
10743
|
+
share: entry.previousShare,
|
|
10744
|
+
color: secondaryColor,
|
|
10745
|
+
animation,
|
|
10746
|
+
divergingScale
|
|
10747
|
+
})] });
|
|
11867
10748
|
return /* @__PURE__ */ jsxs("div", {
|
|
11868
10749
|
className: clsx(leaderboard_chart_module_default.barWithLabelContainer, { [leaderboard_chart_module_default["is-overlay"]]: withOverlayLabel }),
|
|
11869
|
-
children: [
|
|
11870
|
-
/* @__PURE__ */ jsx(BarLabel, { label: entry.label }),
|
|
11871
|
-
isPrimaryVisible && /* @__PURE__ */ jsx("div", {
|
|
11872
|
-
className: clsx(leaderboard_chart_module_default.bar, { [leaderboard_chart_module_default["bar--animated"]]: animation }),
|
|
11873
|
-
style: {
|
|
11874
|
-
width: getBarWidth(entry.currentShare),
|
|
11875
|
-
backgroundColor: primaryColor
|
|
11876
|
-
}
|
|
11877
|
-
}),
|
|
11878
|
-
showComparisonBar && hasPreviousValue(entry) && /* @__PURE__ */ jsx("div", {
|
|
11879
|
-
className: clsx(leaderboard_chart_module_default.bar, { [leaderboard_chart_module_default["bar--animated"]]: animation }),
|
|
11880
|
-
style: {
|
|
11881
|
-
width: getBarWidth(entry.previousShare),
|
|
11882
|
-
backgroundColor: secondaryColor
|
|
11883
|
-
}
|
|
11884
|
-
})
|
|
11885
|
-
]
|
|
10750
|
+
children: [/* @__PURE__ */ jsx(BarLabel, { label: entry.label }), bars]
|
|
11886
10751
|
});
|
|
11887
10752
|
};
|
|
11888
10753
|
/**
|
|
@@ -11896,6 +10761,7 @@ const BarWithLabel = ({ entry, withComparison, withOverlayLabel, primaryColor, s
|
|
|
11896
10761
|
* @param props.height - Optional height of the chart container in pixels
|
|
11897
10762
|
* @param props.withComparison - Whether to show comparison data
|
|
11898
10763
|
* @param props.withOverlayLabel - Whether to overlay the label on top of the bar
|
|
10764
|
+
* @param props.negativeBars - How a negative value draws: from a shared zero point, or as an empty bar
|
|
11899
10765
|
* @param props.primaryColor - Primary color for current period bars
|
|
11900
10766
|
* @param props.secondaryColor - Secondary color for comparison period bars
|
|
11901
10767
|
* @param props.valueFormatter - Custom formatter for values
|
|
@@ -11913,7 +10779,7 @@ const BarWithLabel = ({ entry, withComparison, withOverlayLabel, primaryColor, s
|
|
|
11913
10779
|
* @param props.ariaLabel - Accessible name for the list, defaulting to "Leaderboard chart"
|
|
11914
10780
|
* @return JSX element representing the leaderboard chart
|
|
11915
10781
|
*/
|
|
11916
|
-
const LeaderboardChartInternal = ({ data, chartId: providedChartId, width: propWidth, height: propHeight, withComparison = false, withOverlayLabel = false, primaryColor, secondaryColor, valueFormatter = defaultValueFormatter, deltaFormatter = defaultDeltaFormatter, animation, loading = false, fitRows = false, showLegend = false, legend = {}, legendLabels, gap = "md", ariaLabel, className, style, children }) => {
|
|
10782
|
+
const LeaderboardChartInternal = ({ data, chartId: providedChartId, width: propWidth, height: propHeight, withComparison = false, withOverlayLabel = false, negativeBars = "diverge", primaryColor, secondaryColor, valueFormatter = defaultValueFormatter, deltaFormatter = defaultDeltaFormatter, animation, loading = false, fitRows = false, showLegend = false, legend = {}, legendLabels, gap = "md", ariaLabel, className, style, children }) => {
|
|
11917
10783
|
const legendInteractive = legend.interactive ?? false;
|
|
11918
10784
|
const legendPosition = legend.position ?? "bottom";
|
|
11919
10785
|
const chartId = useChartId(providedChartId);
|
|
@@ -11967,6 +10833,30 @@ const LeaderboardChartInternal = ({ data, chartId: providedChartId, width: propW
|
|
|
11967
10833
|
withComparison,
|
|
11968
10834
|
withOverlayLabel
|
|
11969
10835
|
]);
|
|
10836
|
+
const withComparisonBars = withComparison && !withOverlayLabel;
|
|
10837
|
+
const resolvedData = useMemo(() => resolveLeaderboardEntries(data ?? [], {
|
|
10838
|
+
includePrevious: withComparisonBars,
|
|
10839
|
+
clampNegative: negativeBars === "clamp"
|
|
10840
|
+
}), [
|
|
10841
|
+
data,
|
|
10842
|
+
withComparisonBars,
|
|
10843
|
+
negativeBars
|
|
10844
|
+
]);
|
|
10845
|
+
const divergingScale = useMemo(() => {
|
|
10846
|
+
const scale = {
|
|
10847
|
+
negative: 0,
|
|
10848
|
+
positive: 0
|
|
10849
|
+
};
|
|
10850
|
+
for (const entry of resolvedData) {
|
|
10851
|
+
const shares = [entry.currentShare];
|
|
10852
|
+
if (withComparisonBars && hasPreviousValue(entry)) shares.push(entry.previousShare);
|
|
10853
|
+
for (const share of shares) {
|
|
10854
|
+
const side = share < 0 ? "negative" : "positive";
|
|
10855
|
+
scale[side] = Math.max(scale[side], Math.abs(share));
|
|
10856
|
+
}
|
|
10857
|
+
}
|
|
10858
|
+
return scale.negative > 0 ? scale : void 0;
|
|
10859
|
+
}, [resolvedData, withComparisonBars]);
|
|
11970
10860
|
const isDataValid = Boolean(data && data.length > 0);
|
|
11971
10861
|
const chartMetadata = useMemo(() => ({
|
|
11972
10862
|
withComparison,
|
|
@@ -11982,6 +10872,8 @@ const LeaderboardChartInternal = ({ data, chartId: providedChartId, width: propW
|
|
|
11982
10872
|
const prefersReducedMotion = usePrefersReducedMotion();
|
|
11983
10873
|
const { contentRef, fittedCount, isMeasurable } = useFittedRowCount(fitRows && !allSeriesHidden, data?.length ?? 0, data);
|
|
11984
10874
|
const shouldFitRows = fitRows && isMeasurable;
|
|
10875
|
+
const showComparisonColumn = withComparison && isComparisonVisible;
|
|
10876
|
+
const templateColumns = showComparisonColumn && isPrimaryVisible ? "minmax(0, 1fr) auto auto" : "minmax(0, 1fr) auto";
|
|
11985
10877
|
if (!data || data.length === 0) return /* @__PURE__ */ jsx(ChartInstanceContext.Provider, {
|
|
11986
10878
|
value: { chartId },
|
|
11987
10879
|
children: /* @__PURE__ */ jsx(ChartLayout, {
|
|
@@ -12046,13 +10938,12 @@ const LeaderboardChartInternal = ({ data, chartId: providedChartId, width: propW
|
|
|
12046
10938
|
}) : /* @__PURE__ */ jsx(component_default, {
|
|
12047
10939
|
role: "list",
|
|
12048
10940
|
"aria-label": ariaLabel ?? __("Leaderboard chart", "jetpack-charts"),
|
|
12049
|
-
templateColumns
|
|
10941
|
+
templateColumns,
|
|
12050
10942
|
rowGap: ROW_GAP,
|
|
12051
10943
|
columnGap: COLUMN_GAP,
|
|
12052
10944
|
"data-leaderboard-grid": true,
|
|
12053
|
-
children:
|
|
10945
|
+
children: resolvedData.map((entry, rowIndex) => {
|
|
12054
10946
|
const rowStyle = shouldFitRows && rowIndex >= fittedCount ? { visibility: "hidden" } : void 0;
|
|
12055
|
-
const showComparisonColumn = withComparison && isComparisonVisible;
|
|
12056
10947
|
const hasPreviousPeriodValue = hasPreviousValue(entry);
|
|
12057
10948
|
const hasDelta = hasDeltaValue(entry);
|
|
12058
10949
|
const showComparisonValue = showComparisonColumn && hasDelta;
|
|
@@ -12067,13 +10958,12 @@ const LeaderboardChartInternal = ({ data, chartId: providedChartId, width: propW
|
|
|
12067
10958
|
withOverlayLabel,
|
|
12068
10959
|
primaryColor: resolvedPrimaryColor,
|
|
12069
10960
|
secondaryColor: resolvedSecondaryColor,
|
|
10961
|
+
divergingScale,
|
|
12070
10962
|
isPrimaryVisible,
|
|
12071
10963
|
isComparisonVisible,
|
|
12072
10964
|
animation: animation && !loading && !prefersReducedMotion
|
|
12073
10965
|
})
|
|
12074
|
-
}), /* @__PURE__ */ jsxs(
|
|
12075
|
-
direction: "row",
|
|
12076
|
-
gap: "xs",
|
|
10966
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
12077
10967
|
className: clsx(leaderboard_chart_module_default.valueContainer, { [leaderboard_chart_module_default.overlayLabel]: withOverlayLabel }),
|
|
12078
10968
|
children: [
|
|
12079
10969
|
isPrimaryVisible && /* @__PURE__ */ jsx(Text$1, { children: valueFormatter(entry.currentValue) }),
|
|
@@ -12154,8 +11044,7 @@ const LeaderboardChartWithProvider = (props) => {
|
|
|
12154
11044
|
LeaderboardChartWithProvider.displayName = "LeaderboardChart";
|
|
12155
11045
|
const LeaderboardChart = attachSubComponents(LeaderboardChartWithProvider, { Legend });
|
|
12156
11046
|
const LeaderboardChartResponsive = attachSubComponents(withResponsive(LeaderboardChartWithProvider), { Legend });
|
|
12157
|
-
|
|
12158
|
-
//#region src/charts/private/pie-keyboard-navigation/order-arcs-for-navigation.ts
|
|
11047
|
+
// src/charts/private/pie-keyboard-navigation/order-arcs-for-navigation.ts
|
|
12159
11048
|
/**
|
|
12160
11049
|
* Orders arcs the way they appear: clockwise from 12 o'clock, which for a semi-circle is left to right.
|
|
12161
11050
|
*
|
|
@@ -12163,15 +11052,13 @@ const LeaderboardChartResponsive = attachSubComponents(withResponsive(Leaderboar
|
|
|
12163
11052
|
* @return A copy of `arcs` sorted by angular midpoint.
|
|
12164
11053
|
*/
|
|
12165
11054
|
const orderArcsForNavigation = (arcs) => [...arcs].sort((a, b) => a.startAngle + a.endAngle - (b.startAngle + b.endAngle));
|
|
12166
|
-
|
|
12167
|
-
//#region src/charts/private/pie-keyboard-navigation/pie-selection-announcement.tsx
|
|
11055
|
+
// src/charts/private/pie-keyboard-navigation/pie-selection-announcement.tsx
|
|
12168
11056
|
const PieSelectionAnnouncement = ({ data }) => /* @__PURE__ */ jsx(VisuallyHidden, {
|
|
12169
11057
|
role: "status",
|
|
12170
11058
|
"aria-atomic": "true",
|
|
12171
11059
|
children: data && /* @__PURE__ */ jsx(LabelValueContent, { data })
|
|
12172
11060
|
});
|
|
12173
|
-
|
|
12174
|
-
//#region src/charts/private/pie-keyboard-navigation/pie-tooltip.tsx
|
|
11061
|
+
// src/charts/private/pie-keyboard-navigation/pie-tooltip.tsx
|
|
12175
11062
|
const TOOLTIP_BOX_STYLE = { zIndex: 3 };
|
|
12176
11063
|
const PieTooltip = ({ top, left, selectedIndex, tooltipRef, children }) => {
|
|
12177
11064
|
const standaloneScopeClass = useStandaloneScopeClass();
|
|
@@ -12193,8 +11080,7 @@ const PieTooltip = ({ top, left, selectedIndex, tooltipRef, children }) => {
|
|
|
12193
11080
|
}, `chart-tooltip-${selectedIndex}`)
|
|
12194
11081
|
});
|
|
12195
11082
|
};
|
|
12196
|
-
|
|
12197
|
-
//#region src/charts/private/pie-keyboard-navigation/pie-selection-output.tsx
|
|
11083
|
+
// src/charts/private/pie-keyboard-navigation/pie-selection-output.tsx
|
|
12198
11084
|
/**
|
|
12199
11085
|
* Reports the selected segment: a focused tooltip for a keyboard selection, a pointer tooltip on hover, or a screen reader announcement without tooltips.
|
|
12200
11086
|
*
|
|
@@ -12234,8 +11120,7 @@ const PieSelectionOutput = ({ withTooltips, selectedIndex, selectedData, keyboar
|
|
|
12234
11120
|
})
|
|
12235
11121
|
] });
|
|
12236
11122
|
};
|
|
12237
|
-
|
|
12238
|
-
//#region src/charts/private/pie-keyboard-navigation/use-pie-keyboard-navigation.ts
|
|
11123
|
+
// src/charts/private/pie-keyboard-navigation/use-pie-keyboard-navigation.ts
|
|
12239
11124
|
const usePieKeyboardNavigation = ({ navigationArcs, withTooltips, tooltipOffsetX, tooltipOffsetY }) => {
|
|
12240
11125
|
const chartRef = useRef(null);
|
|
12241
11126
|
const svgRef = useRef(null);
|
|
@@ -12315,8 +11200,7 @@ const usePieKeyboardNavigation = ({ navigationArcs, withTooltips, tooltipOffsetX
|
|
|
12315
11200
|
}
|
|
12316
11201
|
};
|
|
12317
11202
|
};
|
|
12318
|
-
|
|
12319
|
-
//#region src/charts/private/radial-wipe-animation/radial-wipe-animation.tsx
|
|
11203
|
+
// src/charts/private/radial-wipe-animation/radial-wipe-animation.tsx
|
|
12320
11204
|
/**
|
|
12321
11205
|
* Renders a SVG mask that creates a radial wipe animation effect.
|
|
12322
11206
|
*
|
|
@@ -12353,8 +11237,7 @@ function RadialWipeAnimation({ id, radius, innerRadius = 0, durationMs = 1e3, wi
|
|
|
12353
11237
|
})
|
|
12354
11238
|
});
|
|
12355
11239
|
}
|
|
12356
|
-
|
|
12357
|
-
//#region src/charts/pie-chart/pie-chart.module.scss
|
|
11240
|
+
// src/charts/pie-chart/pie-chart.module.scss
|
|
12358
11241
|
var pie_chart_module_default = {
|
|
12359
11242
|
"pie-chart": "a8ccharts-gnszbG-pie-chart",
|
|
12360
11243
|
"pie-chart__label-plate": "a8ccharts-gnszbG-pie-chart__label-plate",
|
|
@@ -12365,8 +11248,7 @@ var pie_chart_module_default = {
|
|
|
12365
11248
|
"pie-chart__plot": "a8ccharts-gnszbG-pie-chart__plot",
|
|
12366
11249
|
"pie-chart--responsive": "a8ccharts-gnszbG-pie-chart--responsive"
|
|
12367
11250
|
};
|
|
12368
|
-
|
|
12369
|
-
//#region src/charts/pie-chart/pie-chart.tsx
|
|
11251
|
+
// src/charts/pie-chart/pie-chart.tsx
|
|
12370
11252
|
/**
|
|
12371
11253
|
* Default tooltip renderer for pie charts.
|
|
12372
11254
|
* Renders the default `label: value` tooltip content for the hovered segment.
|
|
@@ -12649,8 +11531,7 @@ const PieChartResponsive = attachSubComponents(withResponsive(PieChartWithProvid
|
|
|
12649
11531
|
SVG: ChartSVG,
|
|
12650
11532
|
HTML: ChartHTML
|
|
12651
11533
|
});
|
|
12652
|
-
|
|
12653
|
-
//#region src/charts/pie-semi-circle-chart/pie-semi-circle-chart.module.scss
|
|
11534
|
+
// src/charts/pie-semi-circle-chart/pie-semi-circle-chart.module.scss
|
|
12654
11535
|
var pie_semi_circle_chart_module_default = {
|
|
12655
11536
|
"label": "a8ccharts-YtTOxW-label",
|
|
12656
11537
|
"note": "a8ccharts-YtTOxW-note",
|
|
@@ -12658,8 +11539,7 @@ var pie_semi_circle_chart_module_default = {
|
|
|
12658
11539
|
"pie-semi-circle-chart__plot": "a8ccharts-YtTOxW-pie-semi-circle-chart__plot",
|
|
12659
11540
|
"pie-semi-circle-chart--responsive": "a8ccharts-YtTOxW-pie-semi-circle-chart--responsive"
|
|
12660
11541
|
};
|
|
12661
|
-
|
|
12662
|
-
//#region src/charts/pie-semi-circle-chart/pie-semi-circle-chart.tsx
|
|
11542
|
+
// src/charts/pie-semi-circle-chart/pie-semi-circle-chart.tsx
|
|
12663
11543
|
/**
|
|
12664
11544
|
* Default tooltip renderer for semi-circle pie charts.
|
|
12665
11545
|
* Renders the default `label: value` tooltip content for the hovered segment.
|
|
@@ -12902,14 +11782,12 @@ const PieSemiCircleChartResponsive = attachSubComponents(withResponsive(PieSemiC
|
|
|
12902
11782
|
SVG: ChartSVG,
|
|
12903
11783
|
HTML: ChartHTML
|
|
12904
11784
|
});
|
|
12905
|
-
|
|
12906
|
-
//#region src/charts/sparkline/sparkline.module.scss
|
|
11785
|
+
// src/charts/sparkline/sparkline.module.scss
|
|
12907
11786
|
var sparkline_module_default = {
|
|
12908
11787
|
"sparkline": "a8ccharts-GtgAVa-sparkline",
|
|
12909
11788
|
"sparkline--empty": "a8ccharts-GtgAVa-sparkline--empty"
|
|
12910
11789
|
};
|
|
12911
|
-
|
|
12912
|
-
//#region src/charts/sparkline/sparkline.tsx
|
|
11790
|
+
// src/charts/sparkline/sparkline.tsx
|
|
12913
11791
|
const DEFAULT_WIDTH = 100;
|
|
12914
11792
|
const DEFAULT_HEIGHT = 40;
|
|
12915
11793
|
/**
|
|
@@ -13051,8 +11929,7 @@ SparklineUnresponsive.displayName = "SparklineUnresponsive";
|
|
|
13051
11929
|
* Responsive Sparkline chart component
|
|
13052
11930
|
*/
|
|
13053
11931
|
const Sparkline = withResponsive(SparklineUnresponsive);
|
|
13054
|
-
|
|
13055
|
-
//#region src/components/trend-indicator/trend-indicator.module.scss
|
|
11932
|
+
// src/components/trend-indicator/trend-indicator.module.scss
|
|
13056
11933
|
var trend_indicator_module_default = {
|
|
13057
11934
|
"trend-indicator": "a8ccharts-zR7F7G-trend-indicator",
|
|
13058
11935
|
"trend-indicator__icon": "a8ccharts-zR7F7G-trend-indicator__icon",
|
|
@@ -13061,8 +11938,7 @@ var trend_indicator_module_default = {
|
|
|
13061
11938
|
"trend-indicator--neutral": "a8ccharts-zR7F7G-trend-indicator--neutral",
|
|
13062
11939
|
"trend-indicator--up": "a8ccharts-zR7F7G-trend-indicator--up"
|
|
13063
11940
|
};
|
|
13064
|
-
|
|
13065
|
-
//#region src/components/trend-indicator/trend-indicator.tsx
|
|
11941
|
+
// src/components/trend-indicator/trend-indicator.tsx
|
|
13066
11942
|
const DIRECTION_LABELS = {
|
|
13067
11943
|
up: "Increase",
|
|
13068
11944
|
down: "Decrease",
|
|
@@ -13105,7 +11981,6 @@ function TrendIndicator({ direction, value, className, style, showIcon = true })
|
|
|
13105
11981
|
})]
|
|
13106
11982
|
});
|
|
13107
11983
|
}
|
|
13108
|
-
//#endregion
|
|
13109
11984
|
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, GoogleDataTableColumnRoleType, 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, TooltipBox, TrendIndicator, XYChartTooltip, buildCalendarHeatmapData, buildMonthCalendarHeatmapData, defaultTheme, formatMetricValue, formatPercentage, getBucketInfo, getColorDistance, hexToRgba, isValidHexColor, lightenHexColor, mergeThemes, mixHexColors, normalizeColorToHex, parseAsLocalDate, parseHslString, prefersLightText, relativeLuminance, resolveCssVariable, useBarColors, useBarLegendItems, useCalendarHeatmapData, useChartFormatting, useChartLegendItems, useChartRegistration, useChartScopeElement, useGlobalChartsContext, useGlobalChartsTheme, useLeaderboardLegendItems, useMonthCalendarHeatmapData, validateHexColor };
|
|
13110
11985
|
|
|
13111
11986
|
//# sourceMappingURL=index.js.map
|