@guardian/interactive-component-library 0.8.6 → 0.8.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/molecules/canvas-map/lib/View.d.ts +4 -34
- package/dist/components/molecules/canvas-map/lib/View.js +1 -1
- package/dist/components/molecules/control-change/index.js +11 -9
- package/dist/components/molecules/control-change/style.module.css.js +2 -2
- package/dist/components/molecules/result-summary/index.js +18 -14
- package/dist/style.css +7 -4
- package/package.json +1 -1
|
@@ -48,22 +48,7 @@ export class View {
|
|
|
48
48
|
};
|
|
49
49
|
}, debug?: boolean);
|
|
50
50
|
debug: boolean;
|
|
51
|
-
projection:
|
|
52
|
-
(p: any): number[];
|
|
53
|
-
invert(p: any): number[];
|
|
54
|
-
stream(stream: any): any;
|
|
55
|
-
postclip(_: any, ...args: any[]): any;
|
|
56
|
-
clipExtent(_: any, ...args: any[]): any[][] | any;
|
|
57
|
-
scale(_: any, ...args: any[]): number | any;
|
|
58
|
-
translate(_: any, ...args: any[]): number[] | any;
|
|
59
|
-
angle(_: any, ...args: any[]): number | any;
|
|
60
|
-
reflectX(_: any, ...args: any[]): boolean | any;
|
|
61
|
-
reflectY(_: any, ...args: any[]): boolean | any;
|
|
62
|
-
fitExtent(extent: any, object: any): any;
|
|
63
|
-
fitSize(size: any, object: any): any;
|
|
64
|
-
fitWidth(width: any, object: any): any;
|
|
65
|
-
fitHeight(height: any, object: any): any;
|
|
66
|
-
};
|
|
51
|
+
projection: any;
|
|
67
52
|
bounds: GeoBounds;
|
|
68
53
|
extent: Extent;
|
|
69
54
|
minZoom: number;
|
|
@@ -123,8 +108,8 @@ export class View {
|
|
|
123
108
|
* @returns {Extent} - The extent relative to the current viewport
|
|
124
109
|
*/
|
|
125
110
|
projectExtent(extent: Extent): Extent;
|
|
126
|
-
invert(point: any):
|
|
127
|
-
invertBounds(bounds: any):
|
|
111
|
+
invert(point: any): any;
|
|
112
|
+
invertBounds(bounds: any): any[];
|
|
128
113
|
getResolution(): number;
|
|
129
114
|
getZoomLevel(): number;
|
|
130
115
|
/**
|
|
@@ -145,22 +130,7 @@ export class View {
|
|
|
145
130
|
getVisibleBounds(transform: ZoomTransform, projection: any): import('./util').GeoBounds;
|
|
146
131
|
getState(): {
|
|
147
132
|
transform: ZoomTransform;
|
|
148
|
-
projection:
|
|
149
|
-
(p: any): number[];
|
|
150
|
-
invert(p: any): number[];
|
|
151
|
-
stream(stream: any): any;
|
|
152
|
-
postclip(_: any, ...args: any[]): any;
|
|
153
|
-
clipExtent(_: any, ...args: any[]): any[][] | any;
|
|
154
|
-
scale(_: any, ...args: any[]): number | any;
|
|
155
|
-
translate(_: any, ...args: any[]): number[] | any;
|
|
156
|
-
angle(_: any, ...args: any[]): number | any;
|
|
157
|
-
reflectX(_: any, ...args: any[]): boolean | any;
|
|
158
|
-
reflectY(_: any, ...args: any[]): boolean | any;
|
|
159
|
-
fitExtent(extent: any, object: any): any;
|
|
160
|
-
fitSize(size: any, object: any): any;
|
|
161
|
-
fitWidth(width: any, object: any): any;
|
|
162
|
-
fitHeight(height: any, object: any): any;
|
|
163
|
-
};
|
|
133
|
+
projection: any;
|
|
164
134
|
zoomLevel: any;
|
|
165
135
|
pixelRatio: number;
|
|
166
136
|
padding: {
|
|
@@ -22,7 +22,7 @@ class View {
|
|
|
22
22
|
}, debug = false) {
|
|
23
23
|
this.debug = debug;
|
|
24
24
|
projection.revision = 0;
|
|
25
|
-
this.projection = projection;
|
|
25
|
+
this.projection = projection.copy ? projection.copy() : { ...projection };
|
|
26
26
|
this.bounds = bounds && GeoBounds.convert(bounds);
|
|
27
27
|
this.extent = Extent.convert(extent) || GeoBounds.convert(bounds).toExtent();
|
|
28
28
|
this.minZoom = minZoom;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs,
|
|
1
|
+
import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
|
|
2
2
|
import { mergeStyles } from "../../../styles/helpers/mergeStyles.js";
|
|
3
3
|
import "preact/hooks";
|
|
4
4
|
import { GradientIcon } from "../../particles/gradient-icon/index.js";
|
|
@@ -8,19 +8,21 @@ import "../../particles/relative-time-sentence/index.js";
|
|
|
8
8
|
import defaultStyles from "./style.module.css.js";
|
|
9
9
|
const ControlChange = ({ previous, next, text, styles }) => {
|
|
10
10
|
styles = mergeStyles({ ...defaultStyles }, styles);
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
let changeIcon;
|
|
12
|
+
if (previous && next && next !== previous) {
|
|
13
|
+
changeIcon = /* @__PURE__ */ jsx(
|
|
14
14
|
GradientIcon,
|
|
15
15
|
{
|
|
16
16
|
previous,
|
|
17
17
|
next,
|
|
18
|
-
styles: {
|
|
19
|
-
previous: styles.previous,
|
|
20
|
-
next: styles.next
|
|
21
|
-
}
|
|
18
|
+
styles: { previous: styles.previous, next: styles.next }
|
|
22
19
|
}
|
|
23
|
-
)
|
|
20
|
+
);
|
|
21
|
+
} else if (next) {
|
|
22
|
+
changeIcon = /* @__PURE__ */ jsx(CircleIcon, { styles: { circle: `fill-color--${next}` } });
|
|
23
|
+
}
|
|
24
|
+
return /* @__PURE__ */ jsxs("div", { className: styles.container, children: [
|
|
25
|
+
changeIcon && /* @__PURE__ */ jsx(Fragment, { children: changeIcon }),
|
|
24
26
|
/* @__PURE__ */ jsx("strong", { className: styles.text, children: text })
|
|
25
27
|
] });
|
|
26
28
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx, jsxs } from "preact/jsx-runtime";
|
|
1
|
+
import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
|
|
2
2
|
import "preact/hooks";
|
|
3
3
|
import { mergeStyles } from "../../../styles/helpers/mergeStyles.js";
|
|
4
4
|
import "preact/compat";
|
|
@@ -35,25 +35,29 @@ function ResultSummary({
|
|
|
35
35
|
}) {
|
|
36
36
|
styles = mergeStyles({ ...defaultStyles }, styles);
|
|
37
37
|
if (isSlim) {
|
|
38
|
-
let
|
|
38
|
+
let changeIcon;
|
|
39
|
+
if (previous && next && next !== previous) {
|
|
40
|
+
changeIcon = /* @__PURE__ */ jsx(
|
|
41
|
+
GradientIcon,
|
|
42
|
+
{
|
|
43
|
+
previous,
|
|
44
|
+
next,
|
|
45
|
+
styles: { previous: styles.previous, next: styles.next }
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
} else if (next && !previous) {
|
|
49
|
+
changeIcon = /* @__PURE__ */ jsx(CircleIcon, { styles: { circle: `fill-color--${next}` } });
|
|
50
|
+
}
|
|
39
51
|
return /* @__PURE__ */ jsx(
|
|
40
52
|
"div",
|
|
41
53
|
{
|
|
42
54
|
className: `${styles.container} ${styles.containerSlim}`,
|
|
43
55
|
onClick,
|
|
44
56
|
children: /* @__PURE__ */ jsxs("p", { className: `${styles.titleSlim} ${lineClamp && styles.lineClamp}`, children: [
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
next,
|
|
50
|
-
styles: {
|
|
51
|
-
previous: styles.previous,
|
|
52
|
-
next: styles.next
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
) : /* @__PURE__ */ jsx(CircleIcon, { styles: { circle: `fill-color--${next}` } }),
|
|
56
|
-
" ",
|
|
57
|
+
changeIcon && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
58
|
+
changeIcon,
|
|
59
|
+
" "
|
|
60
|
+
] }),
|
|
57
61
|
title,
|
|
58
62
|
" ",
|
|
59
63
|
/* @__PURE__ */ jsx(RelativeTimeSentence, { timeStamp: timestamp })
|
package/dist/style.css
CHANGED
|
@@ -1294,7 +1294,7 @@ body {
|
|
|
1294
1294
|
--news-grey-06: #f3f3f3;
|
|
1295
1295
|
--con: #0077b6;
|
|
1296
1296
|
--lab: #c70000;
|
|
1297
|
-
--libdem: #
|
|
1297
|
+
--libdem: #ff7f0f;
|
|
1298
1298
|
--green: #39a566;
|
|
1299
1299
|
--ukip: #bb3b80;
|
|
1300
1300
|
--snp: #f5dc00;
|
|
@@ -1314,7 +1314,7 @@ body {
|
|
|
1314
1314
|
--undeclared: #e7e7e7;
|
|
1315
1315
|
--con-2: #d4edff;
|
|
1316
1316
|
--lab-2: #ffdbd4;
|
|
1317
|
-
--libdem-2: #
|
|
1317
|
+
--libdem-2: #ffe2cd;
|
|
1318
1318
|
--green-2: #d3f2de;
|
|
1319
1319
|
--ukip-2: #ffe6f4;
|
|
1320
1320
|
--snp-2: #fff7c7;
|
|
@@ -2030,16 +2030,19 @@ body.android {
|
|
|
2030
2030
|
._tooltip_11t5d_1 {
|
|
2031
2031
|
pointer-events: none;
|
|
2032
2032
|
}
|
|
2033
|
-
.
|
|
2033
|
+
._text_lsh6d_1 {
|
|
2034
2034
|
color: var(--primary-text-color);
|
|
2035
2035
|
font-family: var(--text-sans);
|
|
2036
2036
|
font-size: var(--sans-small);
|
|
2037
2037
|
line-height: var(--sans-line-height);
|
|
2038
2038
|
font-weight: 700;
|
|
2039
|
+
}
|
|
2040
|
+
|
|
2041
|
+
svg + ._text_lsh6d_1 {
|
|
2039
2042
|
margin-left: var(--space-1);
|
|
2040
2043
|
}
|
|
2041
2044
|
|
|
2042
|
-
.
|
|
2045
|
+
._container_lsh6d_13 {
|
|
2043
2046
|
font-weight: 700;
|
|
2044
2047
|
}
|
|
2045
2048
|
._wrapper_kh25l_1 {
|