@phillips/seldon 1.276.0 → 1.278.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/dist/_virtual/index10.cjs +1 -1
- package/dist/_virtual/index10.js +2 -2
- package/dist/_virtual/index9.cjs +1 -1
- package/dist/_virtual/index9.js +2 -2
- package/dist/components/SlideToActivate/SlideToActivate.cjs +1 -0
- package/dist/components/SlideToActivate/SlideToActivate.d.ts +14 -0
- package/dist/components/SlideToActivate/SlideToActivate.js +147 -0
- package/dist/components/SlideToActivate/SlideToActivate.stories.argTypes.d.ts +276 -0
- package/dist/components/SlideToActivate/SlideToActivate.stories.d.ts +499 -0
- package/dist/components/SlideToActivate/SlideToActivate.stories.demo.d.ts +8 -0
- package/dist/components/SlideToActivate/SlideToActivate.test.d.ts +1 -0
- package/dist/components/SlideToActivate/SlideToActivateThumb.cjs +1 -0
- package/dist/components/SlideToActivate/SlideToActivateThumb.d.ts +28 -0
- package/dist/components/SlideToActivate/SlideToActivateThumb.js +76 -0
- package/dist/components/SlideToActivate/hooks/useSlideDragHandlers.cjs +1 -0
- package/dist/components/SlideToActivate/hooks/useSlideDragHandlers.d.ts +20 -0
- package/dist/components/SlideToActivate/hooks/useSlideDragHandlers.js +90 -0
- package/dist/components/SlideToActivate/hooks/useSlideKeyboardActivate.cjs +1 -0
- package/dist/components/SlideToActivate/hooks/useSlideKeyboardActivate.d.ts +14 -0
- package/dist/components/SlideToActivate/hooks/useSlideKeyboardActivate.js +44 -0
- package/dist/components/SlideToActivate/hooks/useSlideToActivate.cjs +1 -0
- package/dist/components/SlideToActivate/hooks/useSlideToActivate.d.ts +33 -0
- package/dist/components/SlideToActivate/hooks/useSlideToActivate.js +122 -0
- package/dist/components/SlideToActivate/index.d.ts +4 -0
- package/dist/components/SlideToActivate/slideToActivateReducer.cjs +1 -0
- package/dist/components/SlideToActivate/slideToActivateReducer.d.ts +37 -0
- package/dist/components/SlideToActivate/slideToActivateReducer.js +38 -0
- package/dist/components/SlideToActivate/slideToActivateUtils.cjs +1 -0
- package/dist/components/SlideToActivate/slideToActivateUtils.d.ts +19 -0
- package/dist/components/SlideToActivate/slideToActivateUtils.js +23 -0
- package/dist/components/SlideToActivate/slideToActivateUtils.test.d.ts +1 -0
- package/dist/components/SlideToActivate/types.cjs +1 -0
- package/dist/components/SlideToActivate/types.d.ts +105 -0
- package/dist/components/SlideToActivate/types.js +9 -0
- package/dist/components/Toast/ToastContextProvider.cjs +1 -1
- package/dist/components/Toast/ToastContextProvider.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +104 -98
- package/dist/node_modules/ics/dist/index.cjs +1 -1
- package/dist/node_modules/ics/dist/index.js +1 -1
- package/dist/node_modules/prop-types/node_modules/react-is/index.cjs +1 -1
- package/dist/node_modules/prop-types/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/react-zoom-pan-pinch/dist/index.esm.cjs +3 -2
- package/dist/node_modules/react-zoom-pan-pinch/dist/index.esm.js +85 -78
- package/dist/node_modules/uuid/dist/rng.cjs +1 -0
- package/dist/node_modules/uuid/dist/rng.js +7 -0
- package/dist/node_modules/uuid/dist/v4.cjs +1 -0
- package/dist/node_modules/uuid/dist/v4.js +15 -0
- package/dist/scss/_vars.scss +6 -5
- package/dist/scss/_vars.scss.cjs +6 -5
- package/dist/scss/_vars.scss.js +6 -5
- package/dist/scss/componentStyles.scss +1 -0
- package/dist/scss/components/SlideToActivate/_slideToActivate.scss +284 -0
- package/dist/scss/components/SlideToActivate/_slideToActivate.stories.scss +166 -0
- package/dist/scss/components/Toast/_toast.scss +5 -6
- package/package.json +6 -7
- package/dist/node_modules/uuid/dist/esm-browser/native.cjs +0 -1
- package/dist/node_modules/uuid/dist/esm-browser/native.js +0 -4
- package/dist/node_modules/uuid/dist/esm-browser/rng.cjs +0 -1
- package/dist/node_modules/uuid/dist/esm-browser/rng.js +0 -13
- package/dist/node_modules/uuid/dist/esm-browser/v4.cjs +0 -1
- package/dist/node_modules/uuid/dist/esm-browser/v4.js +0 -15
- /package/dist/node_modules/uuid/dist/{esm-browser/stringify.cjs → stringify.cjs} +0 -0
- /package/dist/node_modules/uuid/dist/{esm-browser/stringify.js → stringify.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import B, { useRef as R, useImperativeHandle as qi, useEffect as ti, useContext as Yi } from "react";
|
|
2
2
|
var y = function(i, n) {
|
|
3
3
|
return Number(i.toFixed(n));
|
|
4
4
|
}, Ui = function(i, n) {
|
|
@@ -33,7 +33,7 @@ var y = function(i, n) {
|
|
|
33
33
|
return 1 + --i * i * i * i * i;
|
|
34
34
|
}, se = function(i) {
|
|
35
35
|
return i < 0.5 ? 16 * i * i * i * i * i : 1 + 16 * --i * i * i * i * i;
|
|
36
|
-
},
|
|
36
|
+
}, Ti = {
|
|
37
37
|
easeOut: Gi,
|
|
38
38
|
linear: Ji,
|
|
39
39
|
easeInQuad: $i,
|
|
@@ -48,18 +48,18 @@ var y = function(i, n) {
|
|
|
48
48
|
easeInQuint: te,
|
|
49
49
|
easeOutQuint: le,
|
|
50
50
|
easeInOutQuint: se
|
|
51
|
-
},
|
|
51
|
+
}, Xi = function(i) {
|
|
52
52
|
typeof i == "number" && cancelAnimationFrame(i);
|
|
53
53
|
}, Y = function(i) {
|
|
54
|
-
i.mounted && (
|
|
54
|
+
i.mounted && (Xi(i.animation), i.animate = !1, i.animation = null, i.velocity = null);
|
|
55
55
|
};
|
|
56
|
-
function
|
|
56
|
+
function Ai(i, n, e, r) {
|
|
57
57
|
if (i.mounted) {
|
|
58
58
|
var a = (/* @__PURE__ */ new Date()).getTime(), o = 1;
|
|
59
59
|
Y(i), i.animation = function() {
|
|
60
60
|
if (!i.mounted)
|
|
61
|
-
return
|
|
62
|
-
var t = (/* @__PURE__ */ new Date()).getTime() - a, l = t / e, s =
|
|
61
|
+
return Xi(i.animation);
|
|
62
|
+
var t = (/* @__PURE__ */ new Date()).getTime() - a, l = t / e, s = Ti[n], d = s(l);
|
|
63
63
|
t >= e ? (r(o), i.animation = null) : i.animation && (r(d), requestAnimationFrame(i.animation));
|
|
64
64
|
}, requestAnimationFrame(i.animation);
|
|
65
65
|
}
|
|
@@ -72,7 +72,7 @@ function D(i, n, e, r) {
|
|
|
72
72
|
var a = ue(n);
|
|
73
73
|
if (!(!i.mounted || !a)) {
|
|
74
74
|
var o = i.setTransformState, t = i.transformState, l = t.scale, s = t.positionX, d = t.positionY, u = n.scale - l, v = n.positionX - s, f = n.positionY - d;
|
|
75
|
-
e === 0 ? o(n.scale, n.positionX, n.positionY) :
|
|
75
|
+
e === 0 ? o(n.scale, n.positionX, n.positionY) : Ai(i, r, e, function(p) {
|
|
76
76
|
var m = l + u * p, h = s + v * p, c = d + f * p;
|
|
77
77
|
o(m, h, c);
|
|
78
78
|
});
|
|
@@ -100,7 +100,7 @@ var ve = function(i, n, e, r, a, o, t) {
|
|
|
100
100
|
return f;
|
|
101
101
|
}, ri = function(i, n, e, r) {
|
|
102
102
|
return r ? i < n ? y(n, 2) : i > e ? y(e, 2) : y(i, 2) : y(i, 2);
|
|
103
|
-
},
|
|
103
|
+
}, k = function(i, n) {
|
|
104
104
|
var e = li(i, n);
|
|
105
105
|
return i.bounds = e, e;
|
|
106
106
|
};
|
|
@@ -121,7 +121,7 @@ function H(i, n, e, r, a) {
|
|
|
121
121
|
var o = a ? r : 0, t = n - o;
|
|
122
122
|
return !Number.isNaN(e) && i >= e ? e : !Number.isNaN(n) && i <= t ? t : i;
|
|
123
123
|
}
|
|
124
|
-
var
|
|
124
|
+
var ci = function(i, n) {
|
|
125
125
|
var e = i.setup.panning.excluded, r = i.isInitialized, a = i.wrapperComponent, o = n.target, t = "shadowRoot" in o && "composedPath" in n, l = t ? n.composedPath().some(function(u) {
|
|
126
126
|
return u instanceof Element ? a?.contains(u) : !1;
|
|
127
127
|
}) : a?.contains(o), s = r && o && l;
|
|
@@ -129,7 +129,7 @@ var hi = function(i, n) {
|
|
|
129
129
|
return !1;
|
|
130
130
|
var d = q(o, e);
|
|
131
131
|
return !d;
|
|
132
|
-
},
|
|
132
|
+
}, gi = function(i) {
|
|
133
133
|
var n = i.isInitialized, e = i.isPanning, r = i.setup, a = r.panning.disabled, o = n && e && !a;
|
|
134
134
|
return !!o;
|
|
135
135
|
}, fe = function(i, n) {
|
|
@@ -157,7 +157,7 @@ function me(i) {
|
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
function
|
|
160
|
+
function zi(i, n, e, r, a) {
|
|
161
161
|
var o = i.setup.limitToBounds, t = i.wrapperComponent, l = i.bounds, s = i.transformState, d = s.scale, u = s.positionX, v = s.positionY;
|
|
162
162
|
if (!(t === null || l === null || n === u && e === v)) {
|
|
163
163
|
var f = L(n, e, l, o, r, a, t), p = f.x, m = f.y;
|
|
@@ -184,7 +184,7 @@ function Se(i, n) {
|
|
|
184
184
|
var e = i.setup.velocityAnimation, r = e.equalToMove, a = e.animationTime, o = e.sensitivity;
|
|
185
185
|
return r ? a * n * o : a;
|
|
186
186
|
}
|
|
187
|
-
function
|
|
187
|
+
function Si(i, n, e, r, a, o, t, l, s, d) {
|
|
188
188
|
if (a) {
|
|
189
189
|
if (n > t && e > t) {
|
|
190
190
|
var u = t + (i - t) * d;
|
|
@@ -215,29 +215,29 @@ function Pe(i, n) {
|
|
|
215
215
|
function be(i) {
|
|
216
216
|
var n = i.velocity, e = i.bounds, r = i.setup, a = i.wrapperComponent, o = ge(i);
|
|
217
217
|
if (!(!o || !n || !e || !a)) {
|
|
218
|
-
var t = n.velocityX, l = n.velocityY, s = n.total, d = e.maxPositionX, u = e.minPositionX, v = e.maxPositionY, f = e.minPositionY, p = r.limitToBounds, m = r.alignmentAnimation, h = r.zoomAnimation, c = r.panning, P = c.lockAxisY, b = c.lockAxisX, w = h.animationType, T = m.sizeX, C = m.sizeY, A = m.velocityAlignmentTime, X = A, O = Se(i, s), z = Math.max(O, X), E = W(i, T), N = W(i, C),
|
|
219
|
-
|
|
220
|
-
var $ = i.transformState, Vi = $.scale, x = $.positionX, I = $.positionY, Ki = (/* @__PURE__ */ new Date()).getTime() - Li, Qi = Ki / X, Fi =
|
|
221
|
-
(x !==
|
|
218
|
+
var t = n.velocityX, l = n.velocityY, s = n.total, d = e.maxPositionX, u = e.minPositionX, v = e.maxPositionY, f = e.minPositionY, p = r.limitToBounds, m = r.alignmentAnimation, h = r.zoomAnimation, c = r.panning, P = c.lockAxisY, b = c.lockAxisX, w = h.animationType, T = m.sizeX, C = m.sizeY, A = m.velocityAlignmentTime, X = A, O = Se(i, s), z = Math.max(O, X), E = W(i, T), N = W(i, C), Z = E * a.offsetWidth / 100, V = N * a.offsetHeight / 100, U = d + Z, K = u - Z, G = v + V, J = f - V, vi = i.transformState, Li = (/* @__PURE__ */ new Date()).getTime();
|
|
219
|
+
Ai(i, w, z, function(Hi) {
|
|
220
|
+
var $ = i.transformState, Vi = $.scale, x = $.positionX, I = $.positionY, Ki = (/* @__PURE__ */ new Date()).getTime() - Li, Qi = Ki / X, Fi = Ti[m.animationType], fi = 1 - Fi(Math.min(1, Qi)), pi = 1 - Hi, mi = x + t * pi, hi = I + l * pi, Ri = Si(mi, vi.positionX, x, b, p, u, d, K, U, fi), ji = Si(hi, vi.positionY, I, P, p, f, v, J, G, fi);
|
|
221
|
+
(x !== mi || I !== hi) && i.setTransformState(Vi, Ri, ji);
|
|
222
222
|
});
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function wi(i, n) {
|
|
226
226
|
var e = i.transformState.scale;
|
|
227
|
-
Y(i),
|
|
227
|
+
Y(i), k(i, e), window.TouchEvent !== void 0 && n instanceof TouchEvent ? pe(i, n) : fe(i, n);
|
|
228
228
|
}
|
|
229
|
-
function
|
|
230
|
-
var
|
|
231
|
-
if (!
|
|
232
|
-
var
|
|
233
|
-
|
|
229
|
+
function si(i, n) {
|
|
230
|
+
var e = i.transformState.scale, r = i.setup, a = r.minScale, o = r.alignmentAnimation, t = o.disabled, l = o.sizeX, s = o.sizeY, d = o.animationTime, u = o.animationType, v = t || e < a || !l && !s;
|
|
231
|
+
if (!v) {
|
|
232
|
+
var f = me(i);
|
|
233
|
+
f && D(i, f, n ?? d, u);
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
|
-
function
|
|
236
|
+
function Pi(i, n, e) {
|
|
237
237
|
var r = i.startCoords, a = i.setup, o = a.alignmentAnimation, t = o.sizeX, l = o.sizeY;
|
|
238
238
|
if (r) {
|
|
239
239
|
var s = he(i, n, e), d = s.x, u = s.y, v = W(i, t), f = W(i, l);
|
|
240
|
-
Pe(i, { x: d, y: u }),
|
|
240
|
+
Pe(i, { x: d, y: u }), zi(i, d, u, v, f);
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
function Ce(i) {
|
|
@@ -245,17 +245,17 @@ function Ce(i) {
|
|
|
245
245
|
var n = i.setup.panning.velocityDisabled, e = i.velocity, r = i.wrapperComponent, a = i.contentComponent;
|
|
246
246
|
i.isPanning = !1, i.animate = !1, i.animation = null;
|
|
247
247
|
var o = r?.getBoundingClientRect(), t = a?.getBoundingClientRect(), l = o?.width || 0, s = o?.height || 0, d = t?.width || 0, u = t?.height || 0, v = l < d || s < u, f = !n && e && e?.total > 0.1 && v;
|
|
248
|
-
f ? be(i) :
|
|
248
|
+
f ? be(i) : si(i);
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
|
-
function
|
|
252
|
-
var a = i.setup, o = a.minScale, t = a.maxScale, l = a.limitToBounds, s = H(y(n, 2), o, t, 0, !1), d =
|
|
251
|
+
function ui(i, n, e, r) {
|
|
252
|
+
var a = i.setup, o = a.minScale, t = a.maxScale, l = a.limitToBounds, s = H(y(n, 2), o, t, 0, !1), d = k(i, s), u = j(i, e, r, s, d, l), v = u.x, f = u.y;
|
|
253
253
|
return { scale: s, positionX: v, positionY: f };
|
|
254
254
|
}
|
|
255
255
|
function Ei(i, n, e) {
|
|
256
256
|
var r = i.transformState.scale, a = i.wrapperComponent, o = i.setup, t = o.minScale, l = o.limitToBounds, s = o.zoomAnimation, d = s.disabled, u = s.animationTime, v = s.animationType, f = d || r >= t;
|
|
257
|
-
if ((r >= 1 || l) &&
|
|
258
|
-
var p = n || a.offsetWidth / 2, m = e || a.offsetHeight / 2, h =
|
|
257
|
+
if ((r >= 1 || l) && si(i), !(f || !a || !i.mounted)) {
|
|
258
|
+
var p = n || a.offsetWidth / 2, m = e || a.offsetHeight / 2, h = ui(i, t, p, m);
|
|
259
259
|
h && D(i, h, u, v);
|
|
260
260
|
}
|
|
261
261
|
}
|
|
@@ -268,7 +268,7 @@ var _ = function() {
|
|
|
268
268
|
return n;
|
|
269
269
|
}, _.apply(this, arguments);
|
|
270
270
|
};
|
|
271
|
-
function
|
|
271
|
+
function bi(i, n, e) {
|
|
272
272
|
for (var r = 0, a = n.length, o; r < a; r++)
|
|
273
273
|
(o || !(r in n)) && (o || (o = Array.prototype.slice.call(n, 0, r)), o[r] = n[r]);
|
|
274
274
|
return i.concat(o || Array.prototype.slice.call(n));
|
|
@@ -356,13 +356,13 @@ var Q = {
|
|
|
356
356
|
positionX: (r = i.initialPositionX) !== null && r !== void 0 ? r : Q.positionX,
|
|
357
357
|
positionY: (a = i.initialPositionY) !== null && a !== void 0 ? a : Q.positionY
|
|
358
358
|
};
|
|
359
|
-
},
|
|
359
|
+
}, Ci = function(i) {
|
|
360
360
|
var n = _({}, M);
|
|
361
361
|
return Object.keys(i).forEach(function(e) {
|
|
362
362
|
var r = typeof i[e] < "u", a = typeof M[e] < "u";
|
|
363
363
|
if (a && r) {
|
|
364
364
|
var o = Object.prototype.toString.call(M[e]), t = o === "[object Object]", l = o === "[object Array]";
|
|
365
|
-
t ? n[e] = _(_({}, M[e]), i[e]) : l ? n[e] =
|
|
365
|
+
t ? n[e] = _(_({}, M[e]), i[e]) : l ? n[e] = bi(bi([], M[e], !0), i[e]) : n[e] = i[e];
|
|
366
366
|
}
|
|
367
367
|
}), n;
|
|
368
368
|
}, Wi = function(i, n, e) {
|
|
@@ -376,7 +376,7 @@ function Di(i, n, e, r, a) {
|
|
|
376
376
|
var o = i.wrapperComponent, t = i.transformState, l = t.scale, s = t.positionX, d = t.positionY;
|
|
377
377
|
if (!o)
|
|
378
378
|
return console.error("No WrapperComponent found");
|
|
379
|
-
var u = o.offsetWidth, v = o.offsetHeight, f = (u / 2 - s) / l, p = (v / 2 - d) / l, m = Wi(i, n, e), h =
|
|
379
|
+
var u = o.offsetWidth, v = o.offsetHeight, f = (u / 2 - s) / l, p = (v / 2 - d) / l, m = Wi(i, n, e), h = ui(i, m, f, p);
|
|
380
380
|
if (!h)
|
|
381
381
|
return console.error("Error during zoom event. New transformation state was not calculated.");
|
|
382
382
|
D(i, h, r, a);
|
|
@@ -573,8 +573,8 @@ var Ze = function(i, n, e, r, a) {
|
|
|
573
573
|
n.preventDefault(), n.stopPropagation();
|
|
574
574
|
var w = Be(n, null), T = m ? b * Math.abs(n.deltaY) : P, C = Ze(i, w, T, !n.ctrlKey);
|
|
575
575
|
if (s !== C) {
|
|
576
|
-
var A =
|
|
577
|
-
i.previousWheelEvent = n, i.setTransformState(C, N,
|
|
576
|
+
var A = k(i, C), X = ki(n, o, s), O = c || h === 0 || u || p, z = d && O, E = j(i, X.x, X.y, C, A, z), N = E.x, Z = E.y;
|
|
577
|
+
i.previousWheelEvent = n, i.setTransformState(C, N, Z), S(g(i), n, r), S(g(i), n, a);
|
|
578
578
|
}
|
|
579
579
|
}, qe = function(i, n) {
|
|
580
580
|
var e = i.props, r = e.onWheelStop, a = e.onZoomStop;
|
|
@@ -603,9 +603,9 @@ var Ze = function(i, n, e, r, a) {
|
|
|
603
603
|
var m = Bi(n), h = Ke(i, m), c = Zi(n), P = c.x - (i.pinchLastCenterX || 0), b = c.y - (i.pinchLastCenterY || 0);
|
|
604
604
|
if (!(h === o && P === 0 && b === 0)) {
|
|
605
605
|
i.pinchLastCenterX = c.x, i.pinchLastCenterY = c.y;
|
|
606
|
-
var w =
|
|
606
|
+
var w = k(i, h), T = v || f === 0 || s, C = l && T, A = j(i, p.x, p.y, h, w, C), X = A.x, O = A.y;
|
|
607
607
|
i.pinchMidpoint = p, i.lastDistance = m;
|
|
608
|
-
var z = u.sizeX, E = u.sizeY, N = W(i, z),
|
|
608
|
+
var z = u.sizeX, E = u.sizeY, N = W(i, z), Z = W(i, E), V = X + P, U = O + b, K = L(V, U, w, l, N, Z, a), G = K.x, J = K.y;
|
|
609
609
|
i.setTransformState(h, G, J);
|
|
610
610
|
}
|
|
611
611
|
}
|
|
@@ -637,7 +637,7 @@ function Ie(i, n) {
|
|
|
637
637
|
var c = xe(f, i.transformState.scale), P = Wi(i, c, p);
|
|
638
638
|
if (t !== P) {
|
|
639
639
|
S(g(i), n, s);
|
|
640
|
-
var b = ki(n, o, t), w =
|
|
640
|
+
var b = ki(n, o, t), w = ui(i, P, b.x, b.y);
|
|
641
641
|
if (!w)
|
|
642
642
|
return console.error("Error during zoom event. New transformation state was not calculated.");
|
|
643
643
|
S(g(i), n, d), D(i, w, m, h), Mi(i, n);
|
|
@@ -660,7 +660,7 @@ var ir = function(i, n) {
|
|
|
660
660
|
}, this.unmount = function() {
|
|
661
661
|
e.cleanupWindowEvents();
|
|
662
662
|
}, this.update = function(r) {
|
|
663
|
-
e.props = r,
|
|
663
|
+
e.props = r, k(e, e.transformState.scale), e.setup = Ci(r);
|
|
664
664
|
}, this.initializeWindowEvents = function() {
|
|
665
665
|
var r, a, o = ei(), t = (r = e.wrapperComponent) === null || r === void 0 ? void 0 : r.ownerDocument, l = t?.defaultView;
|
|
666
666
|
(a = e.wrapperComponent) === null || a === void 0 || a.addEventListener("wheel", e.onWheelPanning, o), l?.addEventListener("mousedown", e.onPanningStart, o), l?.addEventListener("mousemove", e.onPanning, o), l?.addEventListener("mouseup", e.onPanningStop, o), t?.addEventListener("mouseleave", e.clearPanning, o), l?.addEventListener("keyup", e.setKeyUnPressed, o), l?.addEventListener("keydown", e.setKeyPressed, o);
|
|
@@ -670,19 +670,25 @@ var ir = function(i, n) {
|
|
|
670
670
|
}, this.handleInitializeWrapperEvents = function(r) {
|
|
671
671
|
var a = ei();
|
|
672
672
|
r.addEventListener("wheel", e.onWheelZoom, a), r.addEventListener("dblclick", e.onDoubleClick, a), r.addEventListener("touchstart", e.onTouchPanningStart, a), r.addEventListener("touchmove", e.onTouchPanning, a), r.addEventListener("touchend", e.onTouchPanningStop, a);
|
|
673
|
-
}, this.handleInitialize = function(r) {
|
|
674
|
-
var
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
673
|
+
}, this.handleInitialize = function(r, a) {
|
|
674
|
+
var o = !1, t = e.setup.centerOnInit, l = function(s, d) {
|
|
675
|
+
for (var u = 0, v = s; u < v.length; u++) {
|
|
676
|
+
var f = v[u];
|
|
677
|
+
if (f.target === d)
|
|
678
|
+
return !0;
|
|
679
|
+
}
|
|
680
|
+
return !1;
|
|
681
|
+
};
|
|
682
|
+
e.applyTransformation(), e.onInitCallbacks.forEach(function(s) {
|
|
683
|
+
s(g(e));
|
|
684
|
+
}), e.observer = new ResizeObserver(function(s) {
|
|
685
|
+
if (l(s, r) || l(s, a))
|
|
686
|
+
if (t && !o) {
|
|
687
|
+
var d = a.offsetWidth, u = a.offsetHeight;
|
|
688
|
+
(d > 0 || u > 0) && (o = !0, e.setCenter());
|
|
689
|
+
} else
|
|
690
|
+
Y(e), k(e, e.transformState.scale), si(e, 0);
|
|
691
|
+
}), e.observer.observe(r), e.observer.observe(a);
|
|
686
692
|
}, this.onWheelZoom = function(r) {
|
|
687
693
|
var a = e.setup.disabled;
|
|
688
694
|
if (!a) {
|
|
@@ -697,24 +703,24 @@ var ir = function(i, n) {
|
|
|
697
703
|
if (!(!e.wrapperComponent || !e.contentComponent || o || !t.wheelDisabled || l.disabled || !l.wheelPanning || r.ctrlKey)) {
|
|
698
704
|
r.preventDefault(), r.stopPropagation();
|
|
699
705
|
var s = e.transformState, d = s.positionX, u = s.positionY, v = d - r.deltaX, f = u - r.deltaY, p = l.lockAxisX ? d : v, m = l.lockAxisY ? u : f, h = e.setup.alignmentAnimation, c = h.sizeX, P = h.sizeY, b = W(e, c), w = W(e, P);
|
|
700
|
-
p === d && m === u ||
|
|
706
|
+
p === d && m === u || zi(e, p, m, b, w);
|
|
701
707
|
}
|
|
702
708
|
}, this.onPanningStart = function(r) {
|
|
703
709
|
var a = e.setup.disabled, o = e.props.onPanningStart;
|
|
704
710
|
if (!a) {
|
|
705
|
-
var t =
|
|
711
|
+
var t = ci(e, r);
|
|
706
712
|
if (t) {
|
|
707
713
|
var l = e.isPressingKeys(e.setup.panning.activationKeys);
|
|
708
|
-
l && (r.button === 0 && !e.setup.panning.allowLeftClickPan || r.button === 1 && !e.setup.panning.allowMiddleClickPan || r.button === 2 && !e.setup.panning.allowRightClickPan || (r.preventDefault(), r.stopPropagation(), Y(e),
|
|
714
|
+
l && (r.button === 0 && !e.setup.panning.allowLeftClickPan || r.button === 1 && !e.setup.panning.allowMiddleClickPan || r.button === 2 && !e.setup.panning.allowRightClickPan || (r.preventDefault(), r.stopPropagation(), Y(e), wi(e, r), S(g(e), r, o)));
|
|
709
715
|
}
|
|
710
716
|
}
|
|
711
717
|
}, this.onPanning = function(r) {
|
|
712
718
|
var a = e.setup.disabled, o = e.props.onPanning;
|
|
713
719
|
if (!a) {
|
|
714
|
-
var t =
|
|
720
|
+
var t = gi(e);
|
|
715
721
|
if (t) {
|
|
716
722
|
var l = e.isPressingKeys(e.setup.panning.activationKeys);
|
|
717
|
-
l && (r.preventDefault(), r.stopPropagation(),
|
|
723
|
+
l && (r.preventDefault(), r.stopPropagation(), Pi(e, r.clientX, r.clientY), S(g(e), r, o));
|
|
718
724
|
}
|
|
719
725
|
}
|
|
720
726
|
}, this.onPanningStop = function(r) {
|
|
@@ -738,13 +744,13 @@ var ir = function(i, n) {
|
|
|
738
744
|
}, this.onTouchPanningStart = function(r) {
|
|
739
745
|
var a = e.setup.disabled, o = e.props.onPanningStart;
|
|
740
746
|
if (!a) {
|
|
741
|
-
var t =
|
|
747
|
+
var t = ci(e, r);
|
|
742
748
|
if (t) {
|
|
743
|
-
var l = e.lastTouch && +/* @__PURE__ */ new Date() - e.lastTouch < 200;
|
|
749
|
+
var l = e.lastTouch && +/* @__PURE__ */ new Date() - e.lastTouch < 200 && r.touches.length === 1;
|
|
744
750
|
if (!l) {
|
|
745
751
|
e.lastTouch = +/* @__PURE__ */ new Date(), Y(e);
|
|
746
752
|
var s = r.touches, d = s.length === 1, u = s.length === 2;
|
|
747
|
-
d && (Y(e),
|
|
753
|
+
d && (Y(e), wi(e, r), S(g(e), r, o)), u && e.onPinchStart(r);
|
|
748
754
|
}
|
|
749
755
|
}
|
|
750
756
|
}
|
|
@@ -753,12 +759,12 @@ var ir = function(i, n) {
|
|
|
753
759
|
if (e.isPanning && r.touches.length === 1) {
|
|
754
760
|
if (a)
|
|
755
761
|
return;
|
|
756
|
-
var t =
|
|
762
|
+
var t = gi(e);
|
|
757
763
|
if (!t)
|
|
758
764
|
return;
|
|
759
765
|
r.preventDefault(), r.stopPropagation();
|
|
760
766
|
var l = r.touches[0];
|
|
761
|
-
|
|
767
|
+
Pi(e, l.clientX, l.clientY), S(g(e), r, o);
|
|
762
768
|
} else r.touches.length > 1 && e.onPinch(r);
|
|
763
769
|
}, this.onTouchPanningStop = function(r) {
|
|
764
770
|
e.onPanningStop(r), e.onPinchStop(r);
|
|
@@ -811,25 +817,25 @@ var ir = function(i, n) {
|
|
|
811
817
|
e.onInitCallbacks.delete(r);
|
|
812
818
|
};
|
|
813
819
|
}, this.init = function(r, a) {
|
|
814
|
-
e.cleanupWindowEvents(), e.wrapperComponent = r, e.contentComponent = a,
|
|
820
|
+
e.cleanupWindowEvents(), e.wrapperComponent = r, e.contentComponent = a, k(e, e.transformState.scale), e.handleInitializeWrapperEvents(r), e.handleInitialize(r, a), e.initializeWindowEvents(), e.isInitialized = !0;
|
|
815
821
|
var o = g(e);
|
|
816
822
|
S(o, void 0, e.props.onInit);
|
|
817
|
-
}, this.props = n, this.setup =
|
|
823
|
+
}, this.props = n, this.setup = Ci(this.props), this.transformState = _i(this.props);
|
|
818
824
|
}
|
|
819
825
|
return i;
|
|
820
826
|
})()
|
|
821
|
-
),
|
|
827
|
+
), di = B.createContext(null), rr = function(i, n) {
|
|
822
828
|
return typeof i == "function" ? i(n) : i;
|
|
823
|
-
}, tr =
|
|
829
|
+
}, tr = B.forwardRef(function(i, n) {
|
|
824
830
|
var e = R(new er(i)).current, r = rr(i.children, ai(e));
|
|
825
831
|
return qi(n, function() {
|
|
826
832
|
return ai(e);
|
|
827
833
|
}, [e]), ti(function() {
|
|
828
834
|
e.update(i);
|
|
829
|
-
}, [e, i]),
|
|
835
|
+
}, [e, i]), B.createElement(di.Provider, { value: e }, r);
|
|
830
836
|
});
|
|
831
|
-
|
|
832
|
-
var e = R(null), r =
|
|
837
|
+
B.forwardRef(function(i, n) {
|
|
838
|
+
var e = R(null), r = Yi(di);
|
|
833
839
|
return ti(function() {
|
|
834
840
|
return r.onChange(function(a) {
|
|
835
841
|
if (e.current) {
|
|
@@ -837,7 +843,7 @@ k.forwardRef(function(i, n) {
|
|
|
837
843
|
e.current.style.transform = r.handleTransformStyles(o, t, 1 / a.instance.transformState.scale);
|
|
838
844
|
}
|
|
839
845
|
});
|
|
840
|
-
}, [r]),
|
|
846
|
+
}, [r]), B.createElement("div", _({}, i, { ref: Oe([e, n]) }));
|
|
841
847
|
});
|
|
842
848
|
function nr(i, n) {
|
|
843
849
|
n === void 0 && (n = {});
|
|
@@ -862,6 +868,7 @@ var ar = `.transform-component-module_wrapper__SPB86 {
|
|
|
862
868
|
user-select: none;
|
|
863
869
|
margin: 0;
|
|
864
870
|
padding: 0;
|
|
871
|
+
transform: translate3d(0, 0, 0);
|
|
865
872
|
}
|
|
866
873
|
.transform-component-module_content__FBWxo {
|
|
867
874
|
display: flex;
|
|
@@ -877,23 +884,23 @@ var ar = `.transform-component-module_wrapper__SPB86 {
|
|
|
877
884
|
.transform-component-module_content__FBWxo img {
|
|
878
885
|
pointer-events: none;
|
|
879
886
|
}
|
|
880
|
-
`,
|
|
887
|
+
`, yi = { wrapper: "transform-component-module_wrapper__SPB86", content: "transform-component-module_content__FBWxo" };
|
|
881
888
|
nr(ar);
|
|
882
889
|
var lr = function(i) {
|
|
883
|
-
var n = i.children, e = i.wrapperClass, r = e === void 0 ? "" : e, a = i.contentClass, o = a === void 0 ? "" : a, t = i.wrapperStyle, l = i.contentStyle, s = i.wrapperProps, d = s === void 0 ? {} : s, u = i.contentProps, v = u === void 0 ? {} : u, f =
|
|
890
|
+
var n = i.children, e = i.wrapperClass, r = e === void 0 ? "" : e, a = i.contentClass, o = a === void 0 ? "" : a, t = i.wrapperStyle, l = i.contentStyle, s = i.wrapperProps, d = s === void 0 ? {} : s, u = i.contentProps, v = u === void 0 ? {} : u, f = Yi(di), p = f.init, m = f.cleanupWindowEvents, h = R(null), c = R(null);
|
|
884
891
|
return ti(function() {
|
|
885
892
|
var P = h.current, b = c.current;
|
|
886
893
|
return P !== null && b !== null && p && p?.(P, b), function() {
|
|
887
894
|
m?.();
|
|
888
895
|
};
|
|
889
|
-
}, []),
|
|
896
|
+
}, []), B.createElement(
|
|
890
897
|
"div",
|
|
891
|
-
_({}, d, { ref: h, className: "".concat(ni.wrapperClass, " ").concat(
|
|
892
|
-
|
|
898
|
+
_({}, d, { ref: h, className: "".concat(ni.wrapperClass, " ").concat(yi.wrapper, " ").concat(r), style: t }),
|
|
899
|
+
B.createElement("div", _({}, v, { ref: c, className: "".concat(ni.contentClass, " ").concat(yi.content, " ").concat(o), style: l }), n)
|
|
893
900
|
);
|
|
894
901
|
};
|
|
895
902
|
export {
|
|
896
|
-
|
|
903
|
+
di as Context,
|
|
897
904
|
lr as TransformComponent,
|
|
898
905
|
tr as TransformWrapper,
|
|
899
906
|
Ni as getCenterPosition,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=new Uint8Array(16);function t(){return crypto.getRandomValues(e)}exports.default=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("./rng.cjs"),f=require("./stringify.cjs");function o(e,t,n){return crypto.randomUUID?crypto.randomUUID():i(e)}function i(e,t,n){e=e||{};const r=e.random??e.rng?.()??u.default();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,f.unsafeStringify(r)}exports.default=o;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import e from "./rng.js";
|
|
2
|
+
import { unsafeStringify as o } from "./stringify.js";
|
|
3
|
+
function d(r, n, t) {
|
|
4
|
+
return crypto.randomUUID ? crypto.randomUUID() : u(r);
|
|
5
|
+
}
|
|
6
|
+
function u(r, n, t) {
|
|
7
|
+
r = r || {};
|
|
8
|
+
const f = r.random ?? r.rng?.() ?? e();
|
|
9
|
+
if (f.length < 16)
|
|
10
|
+
throw new Error("Random bytes length must be >= 16");
|
|
11
|
+
return f[6] = f[6] & 15 | 64, f[8] = f[8] & 63 | 128, o(f);
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
d as default
|
|
15
|
+
};
|
package/dist/scss/_vars.scss
CHANGED
|
@@ -245,11 +245,12 @@ $linkSmall: 'linkSmall';
|
|
|
245
245
|
$badgeSmall: 'badgeSmall';
|
|
246
246
|
$badgeMedium: 'badgeMedium';
|
|
247
247
|
$stringSmall: 'stringSmall';
|
|
248
|
-
$text-tokens:
|
|
249
|
-
$
|
|
250
|
-
$
|
|
251
|
-
$
|
|
252
|
-
$
|
|
248
|
+
$text-tokens:
|
|
249
|
+
$button, $link, $email, $label, $badge, $blockquote, $heading1, $heading2, $heading3, $heading4, $heading5, $title1,
|
|
250
|
+
$title2, $title3, $title4, $body1, $body2, $body3, $string1, $string2, $string3, $snwFlyoutLink, $snwHeaderLink,
|
|
251
|
+
$snwHeadingHero1, $snwHeadingHero2, $displayMedium, $displaySmall, $headingLarge, $headingMedium, $headingSmall,
|
|
252
|
+
$headingExtraSmall, $bodyLarge, $bodyMedium, $bodySmall, $labelLarge, $labelMedium, $labelSmall, $linkStylised,
|
|
253
|
+
$linkLarge, $linkMedium, $linkSmall, $badgeSmall, $badgeMedium, $stringSmall;
|
|
253
254
|
|
|
254
255
|
////////////////////////
|
|
255
256
|
/// Breakpoint TOKENS to be used for min-width comparisons, make sure they match BREAKPOINTS in constants.ts
|
package/dist/scss/_vars.scss.cjs
CHANGED
|
@@ -245,11 +245,12 @@ $linkSmall: 'linkSmall';
|
|
|
245
245
|
$badgeSmall: 'badgeSmall';
|
|
246
246
|
$badgeMedium: 'badgeMedium';
|
|
247
247
|
$stringSmall: 'stringSmall';
|
|
248
|
-
$text-tokens:
|
|
249
|
-
$
|
|
250
|
-
$
|
|
251
|
-
$
|
|
252
|
-
$
|
|
248
|
+
$text-tokens:
|
|
249
|
+
$button, $link, $email, $label, $badge, $blockquote, $heading1, $heading2, $heading3, $heading4, $heading5, $title1,
|
|
250
|
+
$title2, $title3, $title4, $body1, $body2, $body3, $string1, $string2, $string3, $snwFlyoutLink, $snwHeaderLink,
|
|
251
|
+
$snwHeadingHero1, $snwHeadingHero2, $displayMedium, $displaySmall, $headingLarge, $headingMedium, $headingSmall,
|
|
252
|
+
$headingExtraSmall, $bodyLarge, $bodyMedium, $bodySmall, $labelLarge, $labelMedium, $labelSmall, $linkStylised,
|
|
253
|
+
$linkLarge, $linkMedium, $linkSmall, $badgeSmall, $badgeMedium, $stringSmall;
|
|
253
254
|
|
|
254
255
|
////////////////////////
|
|
255
256
|
/// Breakpoint TOKENS to be used for min-width comparisons, make sure they match BREAKPOINTS in constants.ts
|
package/dist/scss/_vars.scss.js
CHANGED
|
@@ -245,11 +245,12 @@ $linkSmall: 'linkSmall';
|
|
|
245
245
|
$badgeSmall: 'badgeSmall';
|
|
246
246
|
$badgeMedium: 'badgeMedium';
|
|
247
247
|
$stringSmall: 'stringSmall';
|
|
248
|
-
$text-tokens:
|
|
249
|
-
$
|
|
250
|
-
$
|
|
251
|
-
$
|
|
252
|
-
$
|
|
248
|
+
$text-tokens:
|
|
249
|
+
$button, $link, $email, $label, $badge, $blockquote, $heading1, $heading2, $heading3, $heading4, $heading5, $title1,
|
|
250
|
+
$title2, $title3, $title4, $body1, $body2, $body3, $string1, $string2, $string3, $snwFlyoutLink, $snwHeaderLink,
|
|
251
|
+
$snwHeadingHero1, $snwHeadingHero2, $displayMedium, $displaySmall, $headingLarge, $headingMedium, $headingSmall,
|
|
252
|
+
$headingExtraSmall, $bodyLarge, $bodyMedium, $bodySmall, $labelLarge, $labelMedium, $labelSmall, $linkStylised,
|
|
253
|
+
$linkLarge, $linkMedium, $linkSmall, $badgeSmall, $badgeMedium, $stringSmall;
|
|
253
254
|
|
|
254
255
|
////////////////////////
|
|
255
256
|
/// Breakpoint TOKENS to be used for min-width comparisons, make sure they match BREAKPOINTS in constants.ts
|
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
@use 'components/DescriptiveRadioButton/descriptiveRadioButton';
|
|
66
66
|
@use 'components/DescriptiveRadioButtonGroup/descriptiveRadioButtonGroup';
|
|
67
67
|
@use 'components/ProgressBar/progressBar';
|
|
68
|
+
@use 'components/SlideToActivate/slideToActivate';
|
|
68
69
|
|
|
69
70
|
// Patterns
|
|
70
71
|
@use 'patterns/HeroBanner/heroBanner';
|