@guardian/interactive-component-library 0.1.0-alpha.42 → 0.1.0-alpha.44
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.
|
@@ -12,7 +12,7 @@ const group = "_group_b5io0_5";
|
|
|
12
12
|
const rotated = "_rotated_b5io0_10";
|
|
13
13
|
const path$4 = "_path_b5io0_14";
|
|
14
14
|
const active = "_active_b5io0_18";
|
|
15
|
-
const defaultStyles$
|
|
15
|
+
const defaultStyles$x = {
|
|
16
16
|
svg: svg$9,
|
|
17
17
|
group,
|
|
18
18
|
rotated,
|
|
@@ -52,13 +52,13 @@ function Chevron({
|
|
|
52
52
|
styles: styles2
|
|
53
53
|
}) {
|
|
54
54
|
const defaultStylesCopy = {
|
|
55
|
-
...defaultStyles$
|
|
55
|
+
...defaultStyles$x
|
|
56
56
|
};
|
|
57
57
|
if (active2) {
|
|
58
|
-
defaultStylesCopy.path = mergeStyles(defaultStyles$
|
|
58
|
+
defaultStylesCopy.path = mergeStyles(defaultStyles$x.path, defaultStyles$x.active);
|
|
59
59
|
}
|
|
60
60
|
if (direction === DIRECTION.up) {
|
|
61
|
-
defaultStylesCopy.group = mergeStyles(defaultStyles$
|
|
61
|
+
defaultStylesCopy.group = mergeStyles(defaultStyles$x.group, defaultStyles$x.rotated);
|
|
62
62
|
}
|
|
63
63
|
styles2 = mergeStyles(defaultStylesCopy, styles2);
|
|
64
64
|
return size === SIZE.small ? jsx(SmallChevron, {
|
|
@@ -112,7 +112,7 @@ const container$7 = "_container_jzalm_1";
|
|
|
112
112
|
const dot = "_dot_jzalm_6";
|
|
113
113
|
const circle$2 = "_circle_jzalm_13";
|
|
114
114
|
const text$2 = "_text_jzalm_17";
|
|
115
|
-
const defaultStyles$
|
|
115
|
+
const defaultStyles$w = {
|
|
116
116
|
container: container$7,
|
|
117
117
|
dot,
|
|
118
118
|
circle: circle$2,
|
|
@@ -129,10 +129,10 @@ const LegendItem = ({
|
|
|
129
129
|
abbreviation
|
|
130
130
|
}) => {
|
|
131
131
|
const defaultStylesCopy = {
|
|
132
|
-
...defaultStyles$
|
|
132
|
+
...defaultStyles$w
|
|
133
133
|
};
|
|
134
134
|
if (dotType === DOT_TYPE.round) {
|
|
135
|
-
defaultStylesCopy.dot = mergeStyles(defaultStyles$
|
|
135
|
+
defaultStylesCopy.dot = mergeStyles(defaultStyles$w.dot, defaultStyles$w.circle);
|
|
136
136
|
}
|
|
137
137
|
styles2 = mergeStyles(defaultStylesCopy, styles2);
|
|
138
138
|
return jsxs("div", {
|
|
@@ -145,11 +145,11 @@ const LegendItem = ({
|
|
|
145
145
|
})]
|
|
146
146
|
});
|
|
147
147
|
};
|
|
148
|
-
const bar$2 = "
|
|
149
|
-
const label$1 = "
|
|
150
|
-
const labelStroke = "
|
|
151
|
-
const backgroundRect = "
|
|
152
|
-
const defaultStyles$
|
|
148
|
+
const bar$2 = "_bar_1b3uz_1";
|
|
149
|
+
const label$1 = "_label_1b3uz_5";
|
|
150
|
+
const labelStroke = "_labelStroke_1b3uz_12";
|
|
151
|
+
const backgroundRect = "_backgroundRect_1b3uz_18";
|
|
152
|
+
const defaultStyles$v = {
|
|
153
153
|
bar: bar$2,
|
|
154
154
|
label: label$1,
|
|
155
155
|
labelStroke,
|
|
@@ -218,7 +218,7 @@ function StackedBar({
|
|
|
218
218
|
const rectElements = useRef([]);
|
|
219
219
|
const textElements = useRef([]);
|
|
220
220
|
styles2 = mergeStyles({
|
|
221
|
-
...defaultStyles$
|
|
221
|
+
...defaultStyles$v
|
|
222
222
|
}, styles2);
|
|
223
223
|
const svgHeight = labelType === LabelType.hanging && !hideLabels ? height + 20 : height;
|
|
224
224
|
const cleanBorderAbbr = (abbrText) => abbrText.split("-")[0];
|
|
@@ -309,7 +309,7 @@ function StackedBar({
|
|
|
309
309
|
const svg$8 = "_svg_1cajk_6";
|
|
310
310
|
const previous = "_previous_1cajk_12";
|
|
311
311
|
const next = "_next_1cajk_16";
|
|
312
|
-
const defaultStyles$
|
|
312
|
+
const defaultStyles$u = {
|
|
313
313
|
svg: svg$8,
|
|
314
314
|
previous,
|
|
315
315
|
next
|
|
@@ -320,7 +320,7 @@ const GradientIcon = (props) => {
|
|
|
320
320
|
next: next2,
|
|
321
321
|
styles: styles2
|
|
322
322
|
} = props;
|
|
323
|
-
styles2 = mergeStyles(defaultStyles$
|
|
323
|
+
styles2 = mergeStyles(defaultStyles$u, styles2);
|
|
324
324
|
const gradientId = useId();
|
|
325
325
|
return jsxs("svg", {
|
|
326
326
|
class: styles2.svg,
|
|
@@ -351,7 +351,7 @@ const GradientIcon = (props) => {
|
|
|
351
351
|
};
|
|
352
352
|
const unit = "_unit_mo5d9_1";
|
|
353
353
|
const container$6 = "_container_mo5d9_6";
|
|
354
|
-
const defaultStyles$
|
|
354
|
+
const defaultStyles$t = {
|
|
355
355
|
unit,
|
|
356
356
|
container: container$6
|
|
357
357
|
};
|
|
@@ -408,7 +408,7 @@ const Waffle = ({
|
|
|
408
408
|
const unitWidth = width / columns;
|
|
409
409
|
const unitHeight = unitWidth;
|
|
410
410
|
const height = numberOfRows * unitHeight;
|
|
411
|
-
styles2 = mergeStyles(defaultStyles$
|
|
411
|
+
styles2 = mergeStyles(defaultStyles$t, styles2);
|
|
412
412
|
return jsx("div", {
|
|
413
413
|
ref: containerRef,
|
|
414
414
|
className: styles2.container,
|
|
@@ -451,7 +451,7 @@ const Waffle = ({
|
|
|
451
451
|
};
|
|
452
452
|
const button$7 = "_button_oqopj_1";
|
|
453
453
|
const svg$7 = "_svg_oqopj_15";
|
|
454
|
-
const defaultStyles$
|
|
454
|
+
const defaultStyles$s = {
|
|
455
455
|
button: button$7,
|
|
456
456
|
svg: svg$7
|
|
457
457
|
};
|
|
@@ -460,7 +460,7 @@ const InfoButton = forwardRef(({
|
|
|
460
460
|
styles: styles2
|
|
461
461
|
}, ref) => {
|
|
462
462
|
styles2 = mergeStyles({
|
|
463
|
-
...defaultStyles$
|
|
463
|
+
...defaultStyles$s
|
|
464
464
|
}, styles2);
|
|
465
465
|
return jsx("button", {
|
|
466
466
|
ref,
|
|
@@ -479,7 +479,7 @@ const InfoButton = forwardRef(({
|
|
|
479
479
|
const svg$6 = "_svg_1v49v_1";
|
|
480
480
|
const circle$1 = "_circle_1v49v_5";
|
|
481
481
|
const pulse = "_pulse_1v49v_9";
|
|
482
|
-
const defaultStyles$
|
|
482
|
+
const defaultStyles$r = {
|
|
483
483
|
svg: svg$6,
|
|
484
484
|
circle: circle$1,
|
|
485
485
|
pulse
|
|
@@ -489,7 +489,7 @@ const CircleIcon = ({
|
|
|
489
489
|
pulse: pulse2 = false,
|
|
490
490
|
styles: styles2
|
|
491
491
|
}) => {
|
|
492
|
-
styles2 = mergeStyles(defaultStyles$
|
|
492
|
+
styles2 = mergeStyles(defaultStyles$r, styles2);
|
|
493
493
|
return jsx("svg", {
|
|
494
494
|
style: styles2.svg,
|
|
495
495
|
fill: "none",
|
|
@@ -509,7 +509,7 @@ const CircleIcon = ({
|
|
|
509
509
|
});
|
|
510
510
|
};
|
|
511
511
|
const dateStampText = "_dateStampText_wczs5_1";
|
|
512
|
-
const defaultStyles$
|
|
512
|
+
const defaultStyles$q = {
|
|
513
513
|
dateStampText
|
|
514
514
|
};
|
|
515
515
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
@@ -885,7 +885,7 @@ const RelativeTimeSentence = ({
|
|
|
885
885
|
styles: styles2
|
|
886
886
|
}) => {
|
|
887
887
|
styles2 = mergeStyles({
|
|
888
|
-
...defaultStyles$
|
|
888
|
+
...defaultStyles$q
|
|
889
889
|
}, styles2);
|
|
890
890
|
let timeSince = dayjs(timeStamp).fromNow();
|
|
891
891
|
return jsx("span", {
|
|
@@ -895,7 +895,7 @@ const RelativeTimeSentence = ({
|
|
|
895
895
|
};
|
|
896
896
|
const pageContainer = "_pageContainer_1s0yq_9";
|
|
897
897
|
const sideBorders = "_sideBorders_1s0yq_42";
|
|
898
|
-
const defaultStyles$
|
|
898
|
+
const defaultStyles$p = {
|
|
899
899
|
pageContainer,
|
|
900
900
|
sideBorders
|
|
901
901
|
};
|
|
@@ -907,7 +907,7 @@ function Container({
|
|
|
907
907
|
const {
|
|
908
908
|
pageContainer: pageContainer2,
|
|
909
909
|
sideBorders: sideBordersStyle
|
|
910
|
-
} = mergeStyles(defaultStyles$
|
|
910
|
+
} = mergeStyles(defaultStyles$p, styles2);
|
|
911
911
|
return jsx("div", {
|
|
912
912
|
className: [pageContainer2, sideBorders2 && sideBordersStyle].join(" "),
|
|
913
913
|
children
|
|
@@ -916,7 +916,7 @@ function Container({
|
|
|
916
916
|
const wrapper$1 = "_wrapper_5oj1x_9";
|
|
917
917
|
const bar$1 = "_bar_5oj1x_14";
|
|
918
918
|
const zero$1 = "_zero_5oj1x_19";
|
|
919
|
-
const defaultStyles$
|
|
919
|
+
const defaultStyles$o = {
|
|
920
920
|
wrapper: wrapper$1,
|
|
921
921
|
bar: bar$1,
|
|
922
922
|
zero: zero$1
|
|
@@ -937,7 +937,7 @@ function ChangeBar({
|
|
|
937
937
|
let thisColor = ` bg-color--${party}`;
|
|
938
938
|
let zeroStyles = ` height: ${height};`;
|
|
939
939
|
styles2 = mergeStyles({
|
|
940
|
-
...defaultStyles$
|
|
940
|
+
...defaultStyles$o
|
|
941
941
|
}, styles2);
|
|
942
942
|
return jsxs("div", {
|
|
943
943
|
className: styles2.wrapper,
|
|
@@ -955,7 +955,7 @@ const svg$5 = "_svg_886i1_9";
|
|
|
955
955
|
const dividingLineColor = "_dividingLineColor_886i1_16";
|
|
956
956
|
const square = "_square_886i1_20";
|
|
957
957
|
const corner = "_corner_886i1_24";
|
|
958
|
-
const defaultStyles$
|
|
958
|
+
const defaultStyles$n = {
|
|
959
959
|
svg: svg$5,
|
|
960
960
|
dividingLineColor,
|
|
961
961
|
square,
|
|
@@ -968,7 +968,7 @@ const SquareCutCornerIcon = ({
|
|
|
968
968
|
styles: styles2
|
|
969
969
|
}) => {
|
|
970
970
|
styles2 = mergeStyles({
|
|
971
|
-
...defaultStyles$
|
|
971
|
+
...defaultStyles$n
|
|
972
972
|
}, styles2);
|
|
973
973
|
let cornerSize = squareSize * 0.625;
|
|
974
974
|
let cornerMargin = squareSize < 100 ? squareSize / 6 : 10;
|
|
@@ -1006,7 +1006,7 @@ const stackedGridRotateItems0 = "_stackedGridRotateItems0_6whof_11";
|
|
|
1006
1006
|
const stackedGridRotateItems90 = "_stackedGridRotateItems90_6whof_17";
|
|
1007
1007
|
const stackedGridRotateItems180 = "_stackedGridRotateItems180_6whof_23";
|
|
1008
1008
|
const stackedGridRotateItems270 = "_stackedGridRotateItems270_6whof_29";
|
|
1009
|
-
const defaultStyles$
|
|
1009
|
+
const defaultStyles$m = {
|
|
1010
1010
|
stackedGridContainer,
|
|
1011
1011
|
stackedGridRotateItems0,
|
|
1012
1012
|
stackedGridRotateItems90,
|
|
@@ -1037,7 +1037,7 @@ const StackedGrid = ({
|
|
|
1037
1037
|
}) => {
|
|
1038
1038
|
let containerFlip = getContainerFlip(fromBottom, fromLeft);
|
|
1039
1039
|
let itemRotateClass = getItemRotate(fromBottom, fromLeft);
|
|
1040
|
-
styles2 = mergeStyles(defaultStyles$
|
|
1040
|
+
styles2 = mergeStyles(defaultStyles$m, styles2);
|
|
1041
1041
|
return jsx("div", {
|
|
1042
1042
|
style: {
|
|
1043
1043
|
transform: containerFlip
|
|
@@ -1048,7 +1048,7 @@ const StackedGrid = ({
|
|
|
1048
1048
|
};
|
|
1049
1049
|
const svg$4 = "_svg_l2fsl_9";
|
|
1050
1050
|
const squareFill = "_squareFill_l2fsl_16";
|
|
1051
|
-
const defaultStyles$
|
|
1051
|
+
const defaultStyles$l = {
|
|
1052
1052
|
svg: svg$4,
|
|
1053
1053
|
squareFill
|
|
1054
1054
|
};
|
|
@@ -1058,7 +1058,7 @@ const SquareIcon = ({
|
|
|
1058
1058
|
styles: styles2
|
|
1059
1059
|
}) => {
|
|
1060
1060
|
styles2 = mergeStyles({
|
|
1061
|
-
...defaultStyles$
|
|
1061
|
+
...defaultStyles$l
|
|
1062
1062
|
}, styles2);
|
|
1063
1063
|
return jsx("svg", {
|
|
1064
1064
|
width: size,
|
|
@@ -1076,7 +1076,7 @@ const SquareIcon = ({
|
|
|
1076
1076
|
};
|
|
1077
1077
|
const button$6 = "_button_1kqfn_1";
|
|
1078
1078
|
const icon$2 = "_icon_1kqfn_6";
|
|
1079
|
-
const defaultStyles$
|
|
1079
|
+
const defaultStyles$k = {
|
|
1080
1080
|
button: button$6,
|
|
1081
1081
|
icon: icon$2
|
|
1082
1082
|
};
|
|
@@ -1086,7 +1086,7 @@ function ArrowButton({
|
|
|
1086
1086
|
styles: styles2,
|
|
1087
1087
|
onClick
|
|
1088
1088
|
}) {
|
|
1089
|
-
styles2 = mergeStyles(defaultStyles$
|
|
1089
|
+
styles2 = mergeStyles(defaultStyles$k, styles2);
|
|
1090
1090
|
return jsx("button", {
|
|
1091
1091
|
className: styles2.button,
|
|
1092
1092
|
disabled: disabled2,
|
|
@@ -1112,7 +1112,7 @@ function ArrowButton({
|
|
|
1112
1112
|
}
|
|
1113
1113
|
const button$5 = "_button_s6ell_1";
|
|
1114
1114
|
const buttonInner$1 = "_buttonInner_s6ell_6";
|
|
1115
|
-
const defaultStyles$
|
|
1115
|
+
const defaultStyles$j = {
|
|
1116
1116
|
button: button$5,
|
|
1117
1117
|
buttonInner: buttonInner$1
|
|
1118
1118
|
};
|
|
@@ -1122,7 +1122,7 @@ function Button({
|
|
|
1122
1122
|
styles: styles2,
|
|
1123
1123
|
children
|
|
1124
1124
|
}) {
|
|
1125
|
-
styles2 = mergeStyles(defaultStyles$
|
|
1125
|
+
styles2 = mergeStyles(defaultStyles$j, styles2);
|
|
1126
1126
|
return jsx("button", {
|
|
1127
1127
|
className: styles2.button,
|
|
1128
1128
|
"data-type": type,
|
|
@@ -1137,7 +1137,7 @@ const button$4 = "_button_1bibm_1";
|
|
|
1137
1137
|
const buttonBorder = "_buttonBorder_1bibm_14";
|
|
1138
1138
|
const svg$3 = "_svg_1bibm_22";
|
|
1139
1139
|
const path$3 = "_path_1bibm_29";
|
|
1140
|
-
const defaultStyles$
|
|
1140
|
+
const defaultStyles$i = {
|
|
1141
1141
|
button: button$4,
|
|
1142
1142
|
buttonBorder,
|
|
1143
1143
|
svg: svg$3,
|
|
@@ -1148,7 +1148,7 @@ function CloseButton({
|
|
|
1148
1148
|
onClick,
|
|
1149
1149
|
styles: styles2
|
|
1150
1150
|
}) {
|
|
1151
|
-
styles2 = mergeStyles(defaultStyles$
|
|
1151
|
+
styles2 = mergeStyles(defaultStyles$i, styles2);
|
|
1152
1152
|
return jsx("button", {
|
|
1153
1153
|
className: [styles2.button, border && styles2.buttonBorder].join(" "),
|
|
1154
1154
|
onClick,
|
|
@@ -1169,7 +1169,7 @@ function CloseButton({
|
|
|
1169
1169
|
}
|
|
1170
1170
|
const container$5 = "_container_tq3ke_1";
|
|
1171
1171
|
const slot = "_slot_tq3ke_5";
|
|
1172
|
-
const defaultStyles$
|
|
1172
|
+
const defaultStyles$h = {
|
|
1173
1173
|
container: container$5,
|
|
1174
1174
|
slot
|
|
1175
1175
|
};
|
|
@@ -1180,7 +1180,7 @@ function AdSlot({
|
|
|
1180
1180
|
}) {
|
|
1181
1181
|
var _a, _b, _c;
|
|
1182
1182
|
const slotId = `dfp-ad--${name2}`;
|
|
1183
|
-
styles2 = mergeStyles(defaultStyles$
|
|
1183
|
+
styles2 = mergeStyles(defaultStyles$h, styles2);
|
|
1184
1184
|
const mobileSizes = (_a = sizeMapping.mobile) == null ? void 0 : _a.map((size) => size.join(",")).join("|");
|
|
1185
1185
|
const tabletSizes = (_b = sizeMapping.tablet) == null ? void 0 : _b.map((size) => size.join(",")).join("|");
|
|
1186
1186
|
const desktopSizes = (_c = sizeMapping.desktop) == null ? void 0 : _c.map((size) => size.join(",")).join("|");
|
|
@@ -1338,7 +1338,7 @@ const stickyHeader = "_stickyHeader_fhbur_42";
|
|
|
1338
1338
|
const headerCellButton = "_headerCellButton_fhbur_49";
|
|
1339
1339
|
const bodyRow = "_bodyRow_fhbur_58";
|
|
1340
1340
|
const bodyCell = "_bodyCell_fhbur_62";
|
|
1341
|
-
const defaultStyles$
|
|
1341
|
+
const defaultStyles$g = {
|
|
1342
1342
|
table,
|
|
1343
1343
|
hideHeader,
|
|
1344
1344
|
hideHeaderNoBorder,
|
|
@@ -1381,7 +1381,7 @@ function Table({
|
|
|
1381
1381
|
};
|
|
1382
1382
|
});
|
|
1383
1383
|
};
|
|
1384
|
-
styles2 = mergeStyles(defaultStyles$
|
|
1384
|
+
styles2 = mergeStyles(defaultStyles$g, styles2);
|
|
1385
1385
|
return jsxs("table", {
|
|
1386
1386
|
className: styles2.table,
|
|
1387
1387
|
cellSpacing: 0,
|
|
@@ -1458,7 +1458,7 @@ const y1Label = "_y1Label_nmjjj_29";
|
|
|
1458
1458
|
const y2Label = "_y2Label_nmjjj_33";
|
|
1459
1459
|
const axis$1 = "_axis_nmjjj_37";
|
|
1460
1460
|
const axisLabel = "_axisLabel_nmjjj_42";
|
|
1461
|
-
const defaultStyles$
|
|
1461
|
+
const defaultStyles$f = {
|
|
1462
1462
|
slopeChartContainer,
|
|
1463
1463
|
svg: svg$2,
|
|
1464
1464
|
line: line$1,
|
|
@@ -1508,7 +1508,7 @@ const SlopeChart = ({
|
|
|
1508
1508
|
return positionLabels(labels);
|
|
1509
1509
|
}, [lines, y2Label2, yScale]);
|
|
1510
1510
|
styles2 = mergeStyles({
|
|
1511
|
-
...defaultStyles$
|
|
1511
|
+
...defaultStyles$f
|
|
1512
1512
|
}, styles2);
|
|
1513
1513
|
const chart = jsx("svg", {
|
|
1514
1514
|
class: styles2.svg,
|
|
@@ -1608,7 +1608,7 @@ function pointInsideRect(point, rect) {
|
|
|
1608
1608
|
return point.x >= rect.x && point.x <= rect.x + rect.width && point.y >= rect.y && point.y <= rect.y + rect.height;
|
|
1609
1609
|
}
|
|
1610
1610
|
const tooltip = "_tooltip_11t5d_1";
|
|
1611
|
-
const defaultStyles$
|
|
1611
|
+
const defaultStyles$e = {
|
|
1612
1612
|
tooltip
|
|
1613
1613
|
};
|
|
1614
1614
|
function Tooltip({
|
|
@@ -1627,7 +1627,7 @@ function Tooltip({
|
|
|
1627
1627
|
});
|
|
1628
1628
|
const [displayElement, setDisplayElement] = useState(null);
|
|
1629
1629
|
const tooltipRef = useRef();
|
|
1630
|
-
styles2 = mergeStyles(defaultStyles$
|
|
1630
|
+
styles2 = mergeStyles(defaultStyles$e, styles2);
|
|
1631
1631
|
useEffect(() => {
|
|
1632
1632
|
setDisplayElement(document.querySelector("body"));
|
|
1633
1633
|
return () => {
|
|
@@ -1737,7 +1737,7 @@ function tooltipPositionForRect({
|
|
|
1737
1737
|
}
|
|
1738
1738
|
const text$1 = "_text_1b8t2_1";
|
|
1739
1739
|
const container$4 = "_container_1b8t2_10";
|
|
1740
|
-
const defaultStyles$
|
|
1740
|
+
const defaultStyles$d = {
|
|
1741
1741
|
text: text$1,
|
|
1742
1742
|
container: container$4
|
|
1743
1743
|
};
|
|
@@ -1748,7 +1748,7 @@ const ControlChange = ({
|
|
|
1748
1748
|
styles: styles2
|
|
1749
1749
|
}) => {
|
|
1750
1750
|
styles2 = mergeStyles({
|
|
1751
|
-
...defaultStyles$
|
|
1751
|
+
...defaultStyles$d
|
|
1752
1752
|
}, styles2);
|
|
1753
1753
|
let hasChanged = next2 !== previous2;
|
|
1754
1754
|
return jsxs("div", {
|
|
@@ -1773,7 +1773,7 @@ const ControlChange = ({
|
|
|
1773
1773
|
const wrapper = "_wrapper_8vo05_1";
|
|
1774
1774
|
const line = "_line_8vo05_5";
|
|
1775
1775
|
const halfLineText = "_halfLineText_8vo05_15";
|
|
1776
|
-
const defaultStyles$
|
|
1776
|
+
const defaultStyles$c = {
|
|
1777
1777
|
wrapper,
|
|
1778
1778
|
line,
|
|
1779
1779
|
halfLineText
|
|
@@ -1783,7 +1783,7 @@ const FirstPastThePostWaffle = ({
|
|
|
1783
1783
|
children,
|
|
1784
1784
|
lineOverHang
|
|
1785
1785
|
}) => {
|
|
1786
|
-
styles2 = mergeStyles(defaultStyles$
|
|
1786
|
+
styles2 = mergeStyles(defaultStyles$c, styles2);
|
|
1787
1787
|
return jsxs("div", {
|
|
1788
1788
|
class: styles2.wrapper,
|
|
1789
1789
|
children: [jsx("p", {
|
|
@@ -1809,7 +1809,7 @@ const secondaryNumber = "_secondaryNumber_49z3u_69";
|
|
|
1809
1809
|
const displayRow = "_displayRow_49z3u_76";
|
|
1810
1810
|
const displayColumn = "_displayColumn_49z3u_82";
|
|
1811
1811
|
const topRow = "_topRow_49z3u_86";
|
|
1812
|
-
const defaultStyles$
|
|
1812
|
+
const defaultStyles$b = {
|
|
1813
1813
|
toplineResult,
|
|
1814
1814
|
primaryname,
|
|
1815
1815
|
secondaryname,
|
|
@@ -1837,7 +1837,7 @@ const ToplineResult = forwardRef(({
|
|
|
1837
1837
|
infoButtonRef
|
|
1838
1838
|
}, ref) => {
|
|
1839
1839
|
styles2 = mergeStyles({
|
|
1840
|
-
...defaultStyles$
|
|
1840
|
+
...defaultStyles$b
|
|
1841
1841
|
}, styles2);
|
|
1842
1842
|
const displayStyle = displayRow2 ? styles2.displayRow : styles2.displayColumn;
|
|
1843
1843
|
return jsxs("div", {
|
|
@@ -1882,7 +1882,7 @@ const section = "_section_1xpz0_39";
|
|
|
1882
1882
|
const fullWidth = "_fullWidth_1xpz0_39";
|
|
1883
1883
|
const header = "_header_1xpz0_150";
|
|
1884
1884
|
const content = "_content_1xpz0_187";
|
|
1885
|
-
const defaultStyles$
|
|
1885
|
+
const defaultStyles$a = {
|
|
1886
1886
|
borderTop,
|
|
1887
1887
|
section,
|
|
1888
1888
|
fullWidth,
|
|
@@ -1902,7 +1902,7 @@ const PageSection = forwardRef(({
|
|
|
1902
1902
|
backgroundColor = "transparent"
|
|
1903
1903
|
}, ref) => {
|
|
1904
1904
|
styles2 = mergeStyles({
|
|
1905
|
-
...defaultStyles$
|
|
1905
|
+
...defaultStyles$a
|
|
1906
1906
|
}, styles2);
|
|
1907
1907
|
const [minHeight, setMinHeight] = useState("auto");
|
|
1908
1908
|
const headerRef = useRef();
|
|
@@ -1933,7 +1933,7 @@ const PageSection = forwardRef(({
|
|
|
1933
1933
|
const text = "_text_lo5h3_1";
|
|
1934
1934
|
const axis = "_axis_lo5h3_6";
|
|
1935
1935
|
const bar = "_bar_lo5h3_10";
|
|
1936
|
-
const defaultStyles$
|
|
1936
|
+
const defaultStyles$9 = {
|
|
1937
1937
|
text,
|
|
1938
1938
|
axis,
|
|
1939
1939
|
bar
|
|
@@ -1948,7 +1948,7 @@ const ColumnChart = ({
|
|
|
1948
1948
|
columnPadding,
|
|
1949
1949
|
styles: styles2
|
|
1950
1950
|
}) => {
|
|
1951
|
-
styles2 = mergeStyles(defaultStyles$
|
|
1951
|
+
styles2 = mergeStyles(defaultStyles$9, styles2);
|
|
1952
1952
|
const yScale = scaleLinear$1([maxValue, minValue], [0, chartHeight]);
|
|
1953
1953
|
const totalColumnWidth = Number(columnWidth) + Number(columnPadding.left) + Number(columnPadding.right);
|
|
1954
1954
|
let marginBottom = minValue < 0 ? 0 : 40;
|
|
@@ -1991,7 +1991,7 @@ const subtitle = "_subtitle_hbk39_29";
|
|
|
1991
1991
|
const small = "_small_hbk39_39";
|
|
1992
1992
|
const blurb = "_blurb_hbk39_49";
|
|
1993
1993
|
const footnote = "_footnote_hbk39_57";
|
|
1994
|
-
const defaultStyles$
|
|
1994
|
+
const defaultStyles$8 = {
|
|
1995
1995
|
container: container$3,
|
|
1996
1996
|
img,
|
|
1997
1997
|
title: title$2,
|
|
@@ -2015,7 +2015,7 @@ const PartyProfile = ({
|
|
|
2015
2015
|
styles: styles2
|
|
2016
2016
|
}) => {
|
|
2017
2017
|
styles2 = mergeStyles({
|
|
2018
|
-
...defaultStyles$
|
|
2018
|
+
...defaultStyles$8
|
|
2019
2019
|
}, styles2);
|
|
2020
2020
|
return jsxs("div", {
|
|
2021
2021
|
class: styles2.container,
|
|
@@ -2040,7 +2040,7 @@ const PartyProfile = ({
|
|
|
2040
2040
|
};
|
|
2041
2041
|
const container$2 = "_container_azu4a_1";
|
|
2042
2042
|
const paragraph = "_paragraph_azu4a_12";
|
|
2043
|
-
const defaultStyles$
|
|
2043
|
+
const defaultStyles$7 = {
|
|
2044
2044
|
container: container$2,
|
|
2045
2045
|
paragraph
|
|
2046
2046
|
};
|
|
@@ -2053,7 +2053,7 @@ function ResultSummary({
|
|
|
2053
2053
|
styles: styles2
|
|
2054
2054
|
}) {
|
|
2055
2055
|
styles2 = mergeStyles({
|
|
2056
|
-
...defaultStyles$
|
|
2056
|
+
...defaultStyles$7
|
|
2057
2057
|
}, styles2);
|
|
2058
2058
|
return jsxs("div", {
|
|
2059
2059
|
class: styles2.container,
|
|
@@ -2071,7 +2071,7 @@ function ResultSummary({
|
|
|
2071
2071
|
}
|
|
2072
2072
|
const svg$1 = "_svg_1dms8_1";
|
|
2073
2073
|
const path$2 = "_path_1dms8_8";
|
|
2074
|
-
const styles$
|
|
2074
|
+
const styles$6 = {
|
|
2075
2075
|
svg: svg$1,
|
|
2076
2076
|
path: path$2
|
|
2077
2077
|
};
|
|
@@ -2079,9 +2079,9 @@ function SearchIcon() {
|
|
|
2079
2079
|
return jsx("svg", {
|
|
2080
2080
|
viewBox: "0 0 20 20",
|
|
2081
2081
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2082
|
-
className: styles$
|
|
2082
|
+
className: styles$6.svg,
|
|
2083
2083
|
children: jsx("path", {
|
|
2084
|
-
className: styles$
|
|
2084
|
+
className: styles$6.path,
|
|
2085
2085
|
"fill-rule": "evenodd",
|
|
2086
2086
|
"clip-rule": "evenodd",
|
|
2087
2087
|
d: "M7.273 0c4.022 0 7.25 3.295 7.25 7.273a7.226 7.226 0 01-7.25 7.25C3.25 14.523 0 11.295 0 7.273 0 3.295 3.25 0 7.273 0zm0 1.84A5.403 5.403 0 001.84 7.274c0 3 2.409 5.454 5.432 5.454 3 0 5.454-2.454 5.454-5.454 0-3.023-2.454-5.432-5.454-5.432zM20 18.16l-5.432-5.432h-.932l-.909.91v.931L18.16 20 20 18.159z"
|
|
@@ -2097,7 +2097,7 @@ const suggestion = "_suggestion_1kj0x_42";
|
|
|
2097
2097
|
const disabled = "_disabled_1kj0x_68";
|
|
2098
2098
|
const selected$1 = "_selected_1kj0x_73";
|
|
2099
2099
|
const highlighted = "_highlighted_1kj0x_77";
|
|
2100
|
-
const defaultStyles$
|
|
2100
|
+
const defaultStyles$6 = {
|
|
2101
2101
|
searchContainer,
|
|
2102
2102
|
input,
|
|
2103
2103
|
searchIcon,
|
|
@@ -2116,10 +2116,11 @@ function SearchInput({
|
|
|
2116
2116
|
onSubmit,
|
|
2117
2117
|
onSelect,
|
|
2118
2118
|
onClear,
|
|
2119
|
+
onFocus,
|
|
2119
2120
|
styles: styles2
|
|
2120
2121
|
}) {
|
|
2121
2122
|
var _a, _b, _c;
|
|
2122
|
-
styles2 = mergeStyles(defaultStyles$
|
|
2123
|
+
styles2 = mergeStyles(defaultStyles$6, styles2);
|
|
2123
2124
|
const inputRef = useRef(null);
|
|
2124
2125
|
const [selectedIndex, setSelectedIndex] = useState(-1);
|
|
2125
2126
|
const [suggestions2, setSuggestions] = useState();
|
|
@@ -2188,6 +2189,7 @@ function SearchInput({
|
|
|
2188
2189
|
onFocus: (e) => {
|
|
2189
2190
|
e.target.select();
|
|
2190
2191
|
setShowSuggestions(true);
|
|
2192
|
+
onFocus && onFocus(e);
|
|
2191
2193
|
},
|
|
2192
2194
|
className: styles2.input
|
|
2193
2195
|
}), jsx("div", {
|
|
@@ -2250,7 +2252,7 @@ const refreshIndicator = "_refreshIndicator_3z0ji_9";
|
|
|
2250
2252
|
const icon$1 = "_icon_3z0ji_17";
|
|
2251
2253
|
const liveText = "_liveText_3z0ji_26";
|
|
2252
2254
|
const refreshText = "_refreshText_3z0ji_27";
|
|
2253
|
-
const defaultStyles$
|
|
2255
|
+
const defaultStyles$5 = {
|
|
2254
2256
|
refreshIndicator,
|
|
2255
2257
|
icon: icon$1,
|
|
2256
2258
|
liveText,
|
|
@@ -2260,7 +2262,7 @@ function RefreshIndicator({
|
|
|
2260
2262
|
text: text2,
|
|
2261
2263
|
styles: styles2
|
|
2262
2264
|
}) {
|
|
2263
|
-
styles2 = mergeStyles(defaultStyles$
|
|
2265
|
+
styles2 = mergeStyles(defaultStyles$5, styles2);
|
|
2264
2266
|
return jsxs("div", {
|
|
2265
2267
|
className: styles2.refreshIndicator,
|
|
2266
2268
|
children: [jsx("span", {
|
|
@@ -2278,7 +2280,7 @@ function RefreshIndicator({
|
|
|
2278
2280
|
});
|
|
2279
2281
|
}
|
|
2280
2282
|
const grid = "_grid_xps7m_9";
|
|
2281
|
-
const defaultStyles$
|
|
2283
|
+
const defaultStyles$4 = {
|
|
2282
2284
|
grid
|
|
2283
2285
|
};
|
|
2284
2286
|
const GridType = {
|
|
@@ -2292,7 +2294,7 @@ function ResponsiveGrid({
|
|
|
2292
2294
|
styles: styles2
|
|
2293
2295
|
}) {
|
|
2294
2296
|
styles2 = mergeStyles({
|
|
2295
|
-
...defaultStyles$
|
|
2297
|
+
...defaultStyles$4
|
|
2296
2298
|
}, styles2);
|
|
2297
2299
|
return jsx("div", {
|
|
2298
2300
|
className: styles2.grid,
|
|
@@ -2378,7 +2380,7 @@ const enter = "_enter_48fp9_25";
|
|
|
2378
2380
|
const exitDone = "_exitDone_48fp9_26";
|
|
2379
2381
|
const enterActive = "_enterActive_48fp9_37";
|
|
2380
2382
|
const exitActive = "_exitActive_48fp9_48";
|
|
2381
|
-
const
|
|
2383
|
+
const defaultStyles$3 = {
|
|
2382
2384
|
transitionContainer,
|
|
2383
2385
|
blur,
|
|
2384
2386
|
modalBox,
|
|
@@ -2390,9 +2392,11 @@ const styles$6 = {
|
|
|
2390
2392
|
function Modal({
|
|
2391
2393
|
visible = false,
|
|
2392
2394
|
blurBackground = true,
|
|
2395
|
+
styles: styles2,
|
|
2393
2396
|
children,
|
|
2394
2397
|
onClickOutside
|
|
2395
2398
|
}) {
|
|
2399
|
+
styles2 = mergeStyles(defaultStyles$3, styles2);
|
|
2396
2400
|
const modalBoxRef = useRef();
|
|
2397
2401
|
const onClick = useCallback((event) => {
|
|
2398
2402
|
if (!modalBoxRef.current.contains(event.target)) {
|
|
@@ -2417,13 +2421,13 @@ function Modal({
|
|
|
2417
2421
|
return createPortal(jsx(d, {
|
|
2418
2422
|
in: visible,
|
|
2419
2423
|
duration: 300,
|
|
2420
|
-
classNames:
|
|
2424
|
+
classNames: styles2,
|
|
2421
2425
|
children: jsx("div", {
|
|
2422
|
-
className: [
|
|
2426
|
+
className: [styles2.transitionContainer, blurBackground && styles2.blur, visible && styles2.visible].join(" "),
|
|
2423
2427
|
onClick,
|
|
2424
2428
|
children: jsx("div", {
|
|
2425
2429
|
ref: modalBoxRef,
|
|
2426
|
-
class:
|
|
2430
|
+
class: styles2.modalBox,
|
|
2427
2431
|
children
|
|
2428
2432
|
})
|
|
2429
2433
|
})
|
|
@@ -5917,35 +5921,11 @@ let Map$2 = class Map2 {
|
|
|
5917
5921
|
this._renderer = new MapRenderer(this);
|
|
5918
5922
|
this._resizeObserver = new ResizeObserver(() => this._updateSize());
|
|
5919
5923
|
this._resizeObserver.observe(this.target);
|
|
5920
|
-
this.view.transform = zoomIdentity;
|
|
5921
|
-
this._zoomBypassKey = navigator.userAgent.indexOf("Mac") !== -1 ? "metaKey" : "ctrlKey";
|
|
5922
|
-
this._zoomBehaviour = zoom().scaleExtent(this.view.scaleExtent).filter((event) => {
|
|
5923
|
-
const filterEvent = (filter) => {
|
|
5924
|
-
this._filterEventCallback(filter);
|
|
5925
|
-
return !filter;
|
|
5926
|
-
};
|
|
5927
|
-
if (event.type === "wheel" && !event[this._zoomBypassKey]) {
|
|
5928
|
-
return filterEvent(true);
|
|
5929
|
-
}
|
|
5930
|
-
if ("targetTouches" in event) {
|
|
5931
|
-
if (event.targetTouches.length < 2) {
|
|
5932
|
-
return false;
|
|
5933
|
-
}
|
|
5934
|
-
event.preventDefault();
|
|
5935
|
-
return filterEvent(false);
|
|
5936
|
-
}
|
|
5937
|
-
return (!event.ctrlKey || event.type === "wheel") && !event.button;
|
|
5938
|
-
}).on("zoom", (event) => {
|
|
5939
|
-
this.view.transform = event.transform;
|
|
5940
|
-
this._requestRender();
|
|
5941
|
-
this.dispatcher.dispatch(MapEvent.ZOOM, {
|
|
5942
|
-
currentZoomLevel: event.transform.k
|
|
5943
|
-
});
|
|
5944
|
-
});
|
|
5945
|
-
select(this._viewport).call(this._zoomBehaviour);
|
|
5946
5924
|
this._viewport.addEventListener("touchmove", (event) => {
|
|
5947
5925
|
if (event.targetTouches.length < 2) {
|
|
5948
5926
|
this._filterEventCallback(true);
|
|
5927
|
+
} else {
|
|
5928
|
+
event.stopImmediatePropagation();
|
|
5949
5929
|
}
|
|
5950
5930
|
});
|
|
5951
5931
|
}
|
|
@@ -6025,7 +6005,7 @@ let Map$2 = class Map2 {
|
|
|
6025
6005
|
const paddedViewPortWidth = viewPortWidth - padding.left - padding.right;
|
|
6026
6006
|
const paddedViewPortHeight = viewPortHeight - padding.top - padding.bottom;
|
|
6027
6007
|
const featureScale = Math.min(paddedViewPortWidth / featureWidth, paddedViewPortHeight / featureHeight);
|
|
6028
|
-
const zoomScale = Math.min(this.view.
|
|
6008
|
+
const zoomScale = Math.min(this.view.scaleExtent[1], featureScale);
|
|
6029
6009
|
const scaledPadding = {
|
|
6030
6010
|
top: padding.top / zoomScale,
|
|
6031
6011
|
right: padding.right / zoomScale,
|
|
@@ -6104,11 +6084,40 @@ let Map$2 = class Map2 {
|
|
|
6104
6084
|
const view = this.view;
|
|
6105
6085
|
if (view) {
|
|
6106
6086
|
view.viewPortSize = size;
|
|
6087
|
+
this._createZoomBehaviour(size);
|
|
6107
6088
|
}
|
|
6108
|
-
this._zoomBehaviour.extent([[0, 0], size]);
|
|
6109
|
-
this._zoomBehaviour.translateExtent([[0, 0], size]);
|
|
6110
6089
|
this._requestRender();
|
|
6111
6090
|
}
|
|
6091
|
+
_createZoomBehaviour(viewPortSize) {
|
|
6092
|
+
if (this._zoomBehaviour) {
|
|
6093
|
+
this._zoomBehaviour.on("zoom", null);
|
|
6094
|
+
}
|
|
6095
|
+
this._zoomBypassKey = navigator.userAgent.indexOf("Mac") !== -1 ? "metaKey" : "ctrlKey";
|
|
6096
|
+
this._zoomBehaviour = zoom().extent([[0, 0], viewPortSize]).translateExtent([[0, 0], viewPortSize]).scaleExtent(this.view.scaleExtent).filter((event) => {
|
|
6097
|
+
const filterEvent = (filter) => {
|
|
6098
|
+
this._filterEventCallback(filter);
|
|
6099
|
+
return !filter;
|
|
6100
|
+
};
|
|
6101
|
+
if (event.type === "wheel" && !event[this._zoomBypassKey]) {
|
|
6102
|
+
return filterEvent(true);
|
|
6103
|
+
}
|
|
6104
|
+
if ("targetTouches" in event) {
|
|
6105
|
+
if (event.targetTouches.length < 2) {
|
|
6106
|
+
return false;
|
|
6107
|
+
}
|
|
6108
|
+
event.preventDefault();
|
|
6109
|
+
return filterEvent(false);
|
|
6110
|
+
}
|
|
6111
|
+
return (!event.ctrlKey || event.type === "wheel") && !event.button;
|
|
6112
|
+
}).on("zoom", (event) => {
|
|
6113
|
+
this.view.transform = event.transform;
|
|
6114
|
+
this._requestRender();
|
|
6115
|
+
this.dispatcher.dispatch(MapEvent.ZOOM, {
|
|
6116
|
+
zoomScale: event.transform.k
|
|
6117
|
+
});
|
|
6118
|
+
});
|
|
6119
|
+
select(this._viewport).call(this._zoomBehaviour);
|
|
6120
|
+
}
|
|
6112
6121
|
_requestRender() {
|
|
6113
6122
|
if (!this._renderer || !!this._animationFrameRequestID || this._isTransitioning)
|
|
6114
6123
|
return;
|
|
@@ -6138,6 +6147,32 @@ function bboxFeature(bounds) {
|
|
|
6138
6147
|
};
|
|
6139
6148
|
return feature;
|
|
6140
6149
|
}
|
|
6150
|
+
const BASE_RESOLUTION = 156543.03392;
|
|
6151
|
+
function zoomLevelToZoomScale(zoomLevel, initialResolution) {
|
|
6152
|
+
const resolution = BASE_RESOLUTION / Math.pow(2, zoomLevel);
|
|
6153
|
+
const zoomScale = initialResolution / resolution;
|
|
6154
|
+
return zoomScale;
|
|
6155
|
+
}
|
|
6156
|
+
function zoomLevelForResolution(currentResolution) {
|
|
6157
|
+
const zoomLevel = Math.log2(BASE_RESOLUTION / currentResolution);
|
|
6158
|
+
return zoomLevel;
|
|
6159
|
+
}
|
|
6160
|
+
function haversineDistance(lat1, lon1, lat2, lon2) {
|
|
6161
|
+
const R2 = 6371e3;
|
|
6162
|
+
const toRadians = (degrees2) => degrees2 * Math.PI / 180;
|
|
6163
|
+
const dLat = toRadians(lat2 - lat1);
|
|
6164
|
+
const dLon = toRadians(lon2 - lon1);
|
|
6165
|
+
const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(toRadians(lat1)) * Math.cos(toRadians(lat2)) * Math.sin(dLon / 2) * Math.sin(dLon / 2);
|
|
6166
|
+
const c2 = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
|
6167
|
+
return R2 * c2;
|
|
6168
|
+
}
|
|
6169
|
+
function resolutionForExtent(extent, viewportSize) {
|
|
6170
|
+
const [lonMin, latMin, lonMax, latMax] = extent;
|
|
6171
|
+
const latMid = (latMin + latMax) / 2;
|
|
6172
|
+
const distance = haversineDistance(latMid, lonMin, latMid, lonMax);
|
|
6173
|
+
const resolution = distance / viewportSize[0];
|
|
6174
|
+
return resolution;
|
|
6175
|
+
}
|
|
6141
6176
|
class View {
|
|
6142
6177
|
constructor({
|
|
6143
6178
|
projection,
|
|
@@ -6151,6 +6186,7 @@ class View {
|
|
|
6151
6186
|
this.extent = extent;
|
|
6152
6187
|
this.minZoom = minZoom;
|
|
6153
6188
|
this.maxZoom = maxZoom;
|
|
6189
|
+
this._transform = zoomIdentity;
|
|
6154
6190
|
this._padding = padding;
|
|
6155
6191
|
this._viewPortSize = [0, 0];
|
|
6156
6192
|
this.pixelRatio = window.devicePixelRatio;
|
|
@@ -6160,6 +6196,8 @@ class View {
|
|
|
6160
6196
|
this._viewPortSize = size;
|
|
6161
6197
|
if (previousSize !== size) {
|
|
6162
6198
|
this.fitObject(bboxFeature(this.extent));
|
|
6199
|
+
const initialExtent = this.getVisibleExtent(zoomIdentity, this.projection);
|
|
6200
|
+
this.initialResolution = resolutionForExtent(initialExtent, size);
|
|
6163
6201
|
}
|
|
6164
6202
|
}
|
|
6165
6203
|
get viewPortSize() {
|
|
@@ -6185,9 +6223,10 @@ class View {
|
|
|
6185
6223
|
};
|
|
6186
6224
|
return scalePadding(scaledPadding, this.pixelRatio);
|
|
6187
6225
|
}
|
|
6188
|
-
//
|
|
6226
|
+
// calculates the upper and lower zoom scales
|
|
6189
6227
|
get scaleExtent() {
|
|
6190
|
-
|
|
6228
|
+
const maxScale = zoomLevelToZoomScale(this.maxZoom, this.initialResolution);
|
|
6229
|
+
return [1, maxScale];
|
|
6191
6230
|
}
|
|
6192
6231
|
setProjection(projection) {
|
|
6193
6232
|
this.projection = projection;
|
|
@@ -6233,6 +6272,14 @@ class View {
|
|
|
6233
6272
|
const points = [topLeft, topRight, bottomRight, bottomLeft, topLeft];
|
|
6234
6273
|
return points.map((d2) => this.invert(d2));
|
|
6235
6274
|
}
|
|
6275
|
+
// map resolution (meters per pixel)
|
|
6276
|
+
getResolution() {
|
|
6277
|
+
return resolutionForExtent(this.getVisibleExtent(this.transform, this.projection), this.viewPortSize);
|
|
6278
|
+
}
|
|
6279
|
+
// map zoom level (0 = the entire world)
|
|
6280
|
+
getZoomLevel() {
|
|
6281
|
+
return zoomLevelForResolution(this.getResolution());
|
|
6282
|
+
}
|
|
6236
6283
|
// get extent for drawn map
|
|
6237
6284
|
getMapExtent() {
|
|
6238
6285
|
const mapSizeInPixels = this.mapSize;
|
|
@@ -6259,6 +6306,7 @@ class View {
|
|
|
6259
6306
|
zoomLevel: transform.k,
|
|
6260
6307
|
pixelRatio: this.pixelRatio,
|
|
6261
6308
|
padding: this.padding,
|
|
6309
|
+
viewPortSize: this.viewPortSize,
|
|
6262
6310
|
sizeInPixels: scaleSize(this.viewPortSize, this.pixelRatio),
|
|
6263
6311
|
visibleExtent: this.getVisibleExtent(transform, projection)
|
|
6264
6312
|
};
|
|
@@ -6279,6 +6327,7 @@ const styles$3 = {
|
|
|
6279
6327
|
const mobileHelpText = "Use two fingers to zoom";
|
|
6280
6328
|
const Map$1 = forwardRef(({
|
|
6281
6329
|
config,
|
|
6330
|
+
inModalState = false,
|
|
6282
6331
|
onLoad,
|
|
6283
6332
|
children
|
|
6284
6333
|
}, ref) => {
|
|
@@ -6294,6 +6343,7 @@ const Map$1 = forwardRef(({
|
|
|
6294
6343
|
view: new View(config.view),
|
|
6295
6344
|
target: targetRef.current
|
|
6296
6345
|
});
|
|
6346
|
+
map2.collaborativeGesturesEnabled = !inModalState;
|
|
6297
6347
|
map2.addLayers(layers);
|
|
6298
6348
|
setMap(map2);
|
|
6299
6349
|
if (ref)
|
|
@@ -6332,6 +6382,11 @@ const Map$1 = forwardRef(({
|
|
|
6332
6382
|
map.setLayers(layers);
|
|
6333
6383
|
}
|
|
6334
6384
|
}, [map, layers]);
|
|
6385
|
+
useEffect(() => {
|
|
6386
|
+
if (!map)
|
|
6387
|
+
return;
|
|
6388
|
+
map.collaborativeGesturesEnabled = !inModalState;
|
|
6389
|
+
}, [inModalState]);
|
|
6335
6390
|
return jsx("figure", {
|
|
6336
6391
|
ref: targetRef,
|
|
6337
6392
|
className: styles$3.mapContainer,
|
|
@@ -6472,11 +6527,11 @@ class FeatureRenderer {
|
|
|
6472
6527
|
} = this.style;
|
|
6473
6528
|
if (stroke) {
|
|
6474
6529
|
context.lineWidth = stroke.width * pixelRatio / transform.k;
|
|
6475
|
-
context.strokeStyle = stroke.
|
|
6530
|
+
context.strokeStyle = stroke.getRgba();
|
|
6476
6531
|
context.stroke();
|
|
6477
6532
|
}
|
|
6478
6533
|
if (fill) {
|
|
6479
|
-
context.fillStyle = fill.
|
|
6534
|
+
context.fillStyle = fill.getRgba();
|
|
6480
6535
|
context.fill();
|
|
6481
6536
|
}
|
|
6482
6537
|
}
|
|
@@ -6500,12 +6555,15 @@ class TextLayerRenderer {
|
|
|
6500
6555
|
style2.pointerEvents = "none";
|
|
6501
6556
|
style2.overflow = "hidden";
|
|
6502
6557
|
}
|
|
6503
|
-
renderFrame(frameState) {
|
|
6558
|
+
renderFrame(frameState, targetElement) {
|
|
6559
|
+
if (this.layer.opacity === 0)
|
|
6560
|
+
return targetElement;
|
|
6504
6561
|
const {
|
|
6505
6562
|
declutterTree
|
|
6506
6563
|
} = frameState;
|
|
6507
6564
|
const {
|
|
6508
6565
|
projection,
|
|
6566
|
+
viewPortSize,
|
|
6509
6567
|
sizeInPixels,
|
|
6510
6568
|
visibleExtent,
|
|
6511
6569
|
transform
|
|
@@ -6524,15 +6582,15 @@ class TextLayerRenderer {
|
|
|
6524
6582
|
const featureStyle = styleFunction2(feature);
|
|
6525
6583
|
const textElement = this.getTextElementWithID(feature.uid);
|
|
6526
6584
|
textElement.innerText = featureStyle.text.content;
|
|
6527
|
-
const [
|
|
6585
|
+
const [relativeX, relativeY] = transform.apply(point.coordinates).map((d2, i) => d2 / sizeInPixels[i]);
|
|
6528
6586
|
const position = {
|
|
6529
|
-
left: `${
|
|
6530
|
-
top: `${
|
|
6587
|
+
left: `${relativeX * 100}%`,
|
|
6588
|
+
top: `${relativeY * 100}%`
|
|
6531
6589
|
};
|
|
6532
6590
|
this.styleTextElement(textElement, featureStyle.text, position);
|
|
6533
6591
|
const bbox = this.getElementBBox(textElement, {
|
|
6534
|
-
x,
|
|
6535
|
-
y
|
|
6592
|
+
x: relativeX * viewPortSize[0],
|
|
6593
|
+
y: relativeY * viewPortSize[1]
|
|
6536
6594
|
});
|
|
6537
6595
|
if (declutterTree.collides(bbox)) {
|
|
6538
6596
|
continue;
|
|
@@ -6598,7 +6656,7 @@ class TextLayerRenderer {
|
|
|
6598
6656
|
style2.top = `${bbox.minY}px`;
|
|
6599
6657
|
style2.width = `${bbox.maxX - bbox.minX}px`;
|
|
6600
6658
|
style2.height = `${bbox.maxY - bbox.minY}px`;
|
|
6601
|
-
style2.border = "
|
|
6659
|
+
style2.border = "2px solid black";
|
|
6602
6660
|
return element;
|
|
6603
6661
|
}
|
|
6604
6662
|
}
|
|
@@ -6609,15 +6667,63 @@ class Style {
|
|
|
6609
6667
|
this.text = options == null ? void 0 : options.text;
|
|
6610
6668
|
}
|
|
6611
6669
|
}
|
|
6670
|
+
function memoise(fn) {
|
|
6671
|
+
let called = false;
|
|
6672
|
+
let lastResult;
|
|
6673
|
+
let lastArgs;
|
|
6674
|
+
let lastThis;
|
|
6675
|
+
return function() {
|
|
6676
|
+
const nextArgs = Array.prototype.slice.call(arguments);
|
|
6677
|
+
if (!called || this !== lastThis || !arrayEquals(nextArgs, lastArgs)) {
|
|
6678
|
+
called = true;
|
|
6679
|
+
lastThis = this;
|
|
6680
|
+
lastArgs = nextArgs;
|
|
6681
|
+
lastResult = fn.apply(this, arguments);
|
|
6682
|
+
}
|
|
6683
|
+
return lastResult;
|
|
6684
|
+
};
|
|
6685
|
+
}
|
|
6686
|
+
function toRgba(color2, opacity = 1) {
|
|
6687
|
+
color2 = color2.replace(/\s+/g, "").toLowerCase();
|
|
6688
|
+
if (color2.startsWith("#")) {
|
|
6689
|
+
color2 = color2.replace(/^#/, "");
|
|
6690
|
+
if (color2.length === 3) {
|
|
6691
|
+
color2 = color2.split("").map((char) => char + char).join("");
|
|
6692
|
+
}
|
|
6693
|
+
let r = parseInt(color2.substring(0, 2), 16);
|
|
6694
|
+
let g = parseInt(color2.substring(2, 4), 16);
|
|
6695
|
+
let b = parseInt(color2.substring(4, 6), 16);
|
|
6696
|
+
return `rgba(${r}, ${g}, ${b}, ${opacity})`;
|
|
6697
|
+
}
|
|
6698
|
+
let rgbaMatch = color2.match(/^rgba?\((\d+),(\d+),(\d+)(?:,(\d+(\.\d+)?))?\)$/);
|
|
6699
|
+
if (rgbaMatch) {
|
|
6700
|
+
let r = parseInt(rgbaMatch[1], 10);
|
|
6701
|
+
let g = parseInt(rgbaMatch[2], 10);
|
|
6702
|
+
let b = parseInt(rgbaMatch[3], 10);
|
|
6703
|
+
let a = rgbaMatch[4] !== void 0 ? parseFloat(rgbaMatch[4]) : opacity;
|
|
6704
|
+
return `rgba(${r}, ${g}, ${b}, ${a})`;
|
|
6705
|
+
}
|
|
6706
|
+
throw new Error("Unsupported color format");
|
|
6707
|
+
}
|
|
6612
6708
|
class Stroke {
|
|
6613
6709
|
constructor(options) {
|
|
6614
6710
|
this.color = (options == null ? void 0 : options.color) || "#121212";
|
|
6615
6711
|
this.width = (options == null ? void 0 : options.width) || 0.5;
|
|
6712
|
+
this.opacity = (options == null ? void 0 : options.opacity) || 1;
|
|
6713
|
+
this._getRgba = memoise(toRgba);
|
|
6714
|
+
}
|
|
6715
|
+
getRgba() {
|
|
6716
|
+
return this._getRgba(this.color, this.opacity);
|
|
6616
6717
|
}
|
|
6617
6718
|
}
|
|
6618
6719
|
class Fill {
|
|
6619
6720
|
constructor(options) {
|
|
6620
6721
|
this.color = (options == null ? void 0 : options.color) || "#CCC";
|
|
6722
|
+
this.opacity = (options == null ? void 0 : options.opacity) || 1;
|
|
6723
|
+
this._getRgba = memoise(toRgba);
|
|
6724
|
+
}
|
|
6725
|
+
getRgba() {
|
|
6726
|
+
return this._getRgba(this.color, this.opacity);
|
|
6621
6727
|
}
|
|
6622
6728
|
}
|
|
6623
6729
|
class Text {
|
|
@@ -7110,9 +7216,9 @@ function interpolateFeatures(currentFeatures, newFeatures, {
|
|
|
7110
7216
|
return features;
|
|
7111
7217
|
};
|
|
7112
7218
|
}
|
|
7113
|
-
function interpolateStyles(firstStyle, secondStyle, interpolateColors) {
|
|
7114
|
-
const fillInterpolator = interpolateFill(firstStyle.fill, secondStyle.fill, interpolateColors);
|
|
7115
|
-
const strokeInterpolator = interpolateStroke(firstStyle.stroke, secondStyle.stroke, interpolateColors);
|
|
7219
|
+
function interpolateStyles(firstStyle, secondStyle, interpolateColors, interpolateNumbers) {
|
|
7220
|
+
const fillInterpolator = interpolateFill(firstStyle.fill, secondStyle.fill, interpolateColors, interpolateNumbers);
|
|
7221
|
+
const strokeInterpolator = interpolateStroke(firstStyle.stroke, secondStyle.stroke, interpolateColors, interpolateNumbers);
|
|
7116
7222
|
return (t) => {
|
|
7117
7223
|
return new Style({
|
|
7118
7224
|
fill: fillInterpolator(t),
|
|
@@ -7120,25 +7226,24 @@ function interpolateStyles(firstStyle, secondStyle, interpolateColors) {
|
|
|
7120
7226
|
});
|
|
7121
7227
|
};
|
|
7122
7228
|
}
|
|
7123
|
-
function interpolateFill(fillA, fillB, interpolateColors) {
|
|
7124
|
-
const colorInterpolator = interpolateColors((fillA == null ? void 0 : fillA.color)
|
|
7229
|
+
function interpolateFill(fillA, fillB, interpolateColors, interpolateNumbers) {
|
|
7230
|
+
const colorInterpolator = interpolateColors((fillA == null ? void 0 : fillA.color) ?? "transparent", (fillB == null ? void 0 : fillB.color) ?? "transparent");
|
|
7231
|
+
const opacityInterpolator = interpolateNumbers((fillA == null ? void 0 : fillA.opacity) ?? 1, (fillB == null ? void 0 : fillB.opacity) ?? 1);
|
|
7125
7232
|
return (t) => {
|
|
7126
7233
|
return new Fill({
|
|
7127
|
-
color: colorInterpolator(t)
|
|
7234
|
+
color: colorInterpolator(t),
|
|
7235
|
+
opacity: opacityInterpolator(t)
|
|
7128
7236
|
});
|
|
7129
7237
|
};
|
|
7130
7238
|
}
|
|
7131
|
-
function interpolateStroke(strokeA, strokeB, interpolateColors) {
|
|
7132
|
-
const colorInterpolator = interpolateColors((strokeA == null ? void 0 : strokeA.color)
|
|
7133
|
-
const
|
|
7134
|
-
|
|
7135
|
-
const widthB = (strokeB == null ? void 0 : strokeB.width) || 0;
|
|
7136
|
-
const diff = widthB - widthA;
|
|
7137
|
-
return widthA + diff * t;
|
|
7138
|
-
};
|
|
7239
|
+
function interpolateStroke(strokeA, strokeB, interpolateColors, interpolateNumbers) {
|
|
7240
|
+
const colorInterpolator = interpolateColors((strokeA == null ? void 0 : strokeA.color) ?? "transparent", (strokeB == null ? void 0 : strokeB.color) ?? "transparent");
|
|
7241
|
+
const opacityInterpolator = interpolateNumbers((strokeA == null ? void 0 : strokeA.opacity) ?? 1, (strokeB == null ? void 0 : strokeB.opacity) ?? 1);
|
|
7242
|
+
const widthInterpolator = interpolateNumbers((strokeA == null ? void 0 : strokeA.width) ?? 1, (strokeB == null ? void 0 : strokeB.width) ?? 1);
|
|
7139
7243
|
return (t) => {
|
|
7140
7244
|
return new Stroke({
|
|
7141
7245
|
color: colorInterpolator(t),
|
|
7246
|
+
opacity: opacityInterpolator(t),
|
|
7142
7247
|
width: widthInterpolator(t)
|
|
7143
7248
|
});
|
|
7144
7249
|
};
|
|
@@ -7204,22 +7309,6 @@ class Feature {
|
|
|
7204
7309
|
});
|
|
7205
7310
|
}
|
|
7206
7311
|
}
|
|
7207
|
-
function memoise(fn) {
|
|
7208
|
-
let called = false;
|
|
7209
|
-
let lastResult;
|
|
7210
|
-
let lastArgs;
|
|
7211
|
-
let lastThis;
|
|
7212
|
-
return function() {
|
|
7213
|
-
const nextArgs = Array.prototype.slice.call(arguments);
|
|
7214
|
-
if (!called || this !== lastThis || !arrayEquals(nextArgs, lastArgs)) {
|
|
7215
|
-
called = true;
|
|
7216
|
-
lastThis = this;
|
|
7217
|
-
lastArgs = nextArgs;
|
|
7218
|
-
lastResult = fn.apply(this, arguments);
|
|
7219
|
-
}
|
|
7220
|
-
return lastResult;
|
|
7221
|
-
};
|
|
7222
|
-
}
|
|
7223
7312
|
class LineString {
|
|
7224
7313
|
constructor({
|
|
7225
7314
|
type = "LineString",
|