@sps-woodland/product-bar 7.17.13 → 7.19.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/lib/{index.es.js → index.js} +217 -217
- package/lib/index.umd.cjs +159 -0
- package/lib/style.css +1 -1
- package/package.json +10 -10
- package/sps-woodland-product-bar-7.19.0.tgz +0 -0
- package/vite.config.js +13 -4
- package/lib/index.cjs.js +0 -159
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import ue, { useContext as de, useRef as I, useCallback as
|
|
1
|
+
import * as h from "react";
|
|
2
|
+
import ue, { useContext as de, useRef as I, useCallback as L, createContext as je, useEffect as fe, useState as Ye, useMemo as Xe } from "react";
|
|
3
3
|
import { Metadata as J, cl as Q, selectChildren as qe, PortalContext as Je, I18nContext as Qe, Icon as Ze } from "@sps-woodland/core";
|
|
4
4
|
import { code as X } from "@spscommerce/utils";
|
|
5
5
|
function et(e, t, r) {
|
|
@@ -10,7 +10,7 @@ function et(e, t, r) {
|
|
|
10
10
|
writable: !0
|
|
11
11
|
}) : e[t] = r, e;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function Pe(e, t) {
|
|
14
14
|
var r = Object.keys(e);
|
|
15
15
|
if (Object.getOwnPropertySymbols) {
|
|
16
16
|
var a = Object.getOwnPropertySymbols(e);
|
|
@@ -23,9 +23,9 @@ function he(e, t) {
|
|
|
23
23
|
function ye(e) {
|
|
24
24
|
for (var t = 1; t < arguments.length; t++) {
|
|
25
25
|
var r = arguments[t] != null ? arguments[t] : {};
|
|
26
|
-
t % 2 ?
|
|
26
|
+
t % 2 ? Pe(Object(r), !0).forEach(function(a) {
|
|
27
27
|
et(e, a, r[a]);
|
|
28
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) :
|
|
28
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Pe(Object(r)).forEach(function(a) {
|
|
29
29
|
Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(r, a));
|
|
30
30
|
});
|
|
31
31
|
}
|
|
@@ -38,7 +38,7 @@ var tt = (e, t, r) => {
|
|
|
38
38
|
return !1;
|
|
39
39
|
}
|
|
40
40
|
return !0;
|
|
41
|
-
},
|
|
41
|
+
}, Oe = (e) => (t) => {
|
|
42
42
|
var r = e.defaultClassName, a = ye(ye({}, e.defaultVariants), t);
|
|
43
43
|
for (var o in a) {
|
|
44
44
|
var u, c = (u = a[o]) !== null && u !== void 0 ? u : e.defaultVariants[o];
|
|
@@ -49,10 +49,10 @@ var tt = (e, t, r) => {
|
|
|
49
49
|
p && (r += " " + p);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
for (var [P
|
|
53
|
-
tt(
|
|
52
|
+
for (var [$, P] of e.compoundVariants)
|
|
53
|
+
tt($, a, e.defaultVariants) && (r += " " + P);
|
|
54
54
|
return r;
|
|
55
|
-
}, rt =
|
|
55
|
+
}, rt = Oe({ defaultClassName: "pkg_sps-woodland_product-bar__version_7_19_0__hash_1gzyg118", variantClassNames: { active: { true: "pkg_sps-woodland_product-bar__version_7_19_0__hash_1gzyg119", false: "pkg_sps-woodland_product-bar__version_7_19_0__hash_1gzyg11a" }, disabled: { true: "pkg_sps-woodland_product-bar__version_7_19_0__hash_1gzyg11b", false: "pkg_sps-woodland_product-bar__version_7_19_0__hash_1gzyg11c" } }, defaultVariants: { active: !1, disabled: !1 }, compoundVariants: [] }), nt = Oe({ defaultClassName: "pkg_sps-woodland_product-bar__version_7_19_0__hash_1gzyg111", variantClassNames: { fullWidth: { true: "pkg_sps-woodland_product-bar__version_7_19_0__hash_1gzyg112", false: "pkg_sps-woodland_product-bar__version_7_19_0__hash_1gzyg113" } }, defaultVariants: { fullWidth: !1 }, compoundVariants: [] }), at = "pkg_sps-woodland_product-bar__version_7_19_0__hash_1gzyg114", ot = "pkg_sps-woodland_product-bar__version_7_19_0__hash_1gzyg115", st = "pkg_sps-woodland_product-bar__version_7_19_0__hash_1gzyg116", it = "pkg_sps-woodland_product-bar__version_7_19_0__hash_1gzyg110", lt = "pkg_sps-woodland_product-bar__version_7_19_0__hash_1gzyg117", ct = "pkg_sps-woodland_product-bar__version_7_19_0__hash_1gzyg11e", ut = "pkg_sps-woodland_product-bar__version_7_19_0__hash_1gzyg11d";
|
|
56
56
|
function Ae(e) {
|
|
57
57
|
var t, r, a = "";
|
|
58
58
|
if (typeof e == "string" || typeof e == "number")
|
|
@@ -74,13 +74,13 @@ function dt() {
|
|
|
74
74
|
}
|
|
75
75
|
const pe = typeof document < "u" ? ue.useLayoutEffect : () => {
|
|
76
76
|
};
|
|
77
|
-
function
|
|
77
|
+
function O(e) {
|
|
78
78
|
const t = I(null);
|
|
79
79
|
return pe(() => {
|
|
80
80
|
t.current = e;
|
|
81
81
|
}, [
|
|
82
82
|
e
|
|
83
|
-
]),
|
|
83
|
+
]), L((...r) => {
|
|
84
84
|
const a = t.current;
|
|
85
85
|
return a(...r);
|
|
86
86
|
}, []);
|
|
@@ -101,10 +101,10 @@ function pt(...e) {
|
|
|
101
101
|
typeof r == "function" && r(...t);
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
|
-
const
|
|
104
|
+
const S = (e) => {
|
|
105
105
|
var t;
|
|
106
106
|
return (t = e == null ? void 0 : e.ownerDocument) !== null && t !== void 0 ? t : document;
|
|
107
|
-
}, oe = (e) => e && "window" in e && e.window === e ? e :
|
|
107
|
+
}, oe = (e) => e && "window" in e && e.window === e ? e : S(e).defaultView || window;
|
|
108
108
|
function D(...e) {
|
|
109
109
|
let t = {
|
|
110
110
|
...e[0]
|
|
@@ -132,25 +132,25 @@ const vt = /* @__PURE__ */ new Set([
|
|
|
132
132
|
"download",
|
|
133
133
|
"ping",
|
|
134
134
|
"referrerPolicy"
|
|
135
|
-
]),
|
|
136
|
-
function
|
|
135
|
+
]), ht = /^(data-.*)$/;
|
|
136
|
+
function mt(e, t = {}) {
|
|
137
137
|
let { labelable: r, isLink: a, propNames: o } = t, u = {};
|
|
138
138
|
for (const c in e)
|
|
139
|
-
Object.prototype.hasOwnProperty.call(e, c) && (vt.has(c) || r && bt.has(c) || a && gt.has(c) || (o == null ? void 0 : o.has(c)) ||
|
|
139
|
+
Object.prototype.hasOwnProperty.call(e, c) && (vt.has(c) || r && bt.has(c) || a && gt.has(c) || (o == null ? void 0 : o.has(c)) || ht.test(c)) && (u[c] = e[c]);
|
|
140
140
|
return u;
|
|
141
141
|
}
|
|
142
|
-
function
|
|
143
|
-
if (
|
|
142
|
+
function B(e) {
|
|
143
|
+
if ($t())
|
|
144
144
|
e.focus({
|
|
145
145
|
preventScroll: !0
|
|
146
146
|
});
|
|
147
147
|
else {
|
|
148
|
-
let t =
|
|
148
|
+
let t = Pt(e);
|
|
149
149
|
e.focus(), yt(t);
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
let W = null;
|
|
153
|
-
function
|
|
153
|
+
function $t() {
|
|
154
154
|
if (W == null) {
|
|
155
155
|
W = !1;
|
|
156
156
|
try {
|
|
@@ -165,7 +165,7 @@ function Pt() {
|
|
|
165
165
|
}
|
|
166
166
|
return W;
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function Pt(e) {
|
|
169
169
|
for (var t = e.parentNode, r = [], a = document.scrollingElement || document.documentElement; t instanceof HTMLElement && t !== a; )
|
|
170
170
|
(t.offsetHeight < t.scrollHeight || t.offsetWidth < t.scrollWidth) && r.push({
|
|
171
171
|
element: t,
|
|
@@ -202,34 +202,34 @@ function Ne() {
|
|
|
202
202
|
function De() {
|
|
203
203
|
return Tt() || Ne();
|
|
204
204
|
}
|
|
205
|
-
function
|
|
206
|
-
return Z(/AppleWebKit/i) && !
|
|
205
|
+
function _t() {
|
|
206
|
+
return Z(/AppleWebKit/i) && !Et();
|
|
207
207
|
}
|
|
208
|
-
function
|
|
208
|
+
function Et() {
|
|
209
209
|
return Z(/Chrome/i);
|
|
210
210
|
}
|
|
211
211
|
function Fe() {
|
|
212
212
|
return Z(/Android/i);
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function wt() {
|
|
215
215
|
return Z(/Firefox/i);
|
|
216
216
|
}
|
|
217
|
-
const
|
|
217
|
+
const St = /* @__PURE__ */ je({
|
|
218
218
|
isNative: !0,
|
|
219
|
-
open:
|
|
219
|
+
open: xt
|
|
220
220
|
});
|
|
221
221
|
function kt() {
|
|
222
|
-
return de(
|
|
222
|
+
return de(St);
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function Bt(e, t) {
|
|
225
225
|
let r = e.getAttribute("target");
|
|
226
226
|
return (!r || r === "_self") && e.origin === location.origin && !e.hasAttribute("download") && !t.metaKey && !t.ctrlKey && !t.altKey && !t.shiftKey;
|
|
227
227
|
}
|
|
228
228
|
function F(e, t, r = !0) {
|
|
229
229
|
var a, o;
|
|
230
230
|
let { metaKey: u, ctrlKey: c, altKey: d, shiftKey: p } = t;
|
|
231
|
-
|
|
232
|
-
let
|
|
231
|
+
wt() && ((o = window.event) === null || o === void 0 || (a = o.type) === null || a === void 0 ? void 0 : a.startsWith("key")) && e.target === "_blank" && (z() ? u = !0 : c = !0);
|
|
232
|
+
let $ = _t() && z() && !Ne() ? new KeyboardEvent("keydown", {
|
|
233
233
|
keyIdentifier: "Enter",
|
|
234
234
|
metaKey: u,
|
|
235
235
|
ctrlKey: c,
|
|
@@ -243,10 +243,10 @@ function F(e, t, r = !0) {
|
|
|
243
243
|
bubbles: !0,
|
|
244
244
|
cancelable: !0
|
|
245
245
|
});
|
|
246
|
-
F.isOpening = r,
|
|
246
|
+
F.isOpening = r, B(e), e.dispatchEvent($), F.isOpening = !1;
|
|
247
247
|
}
|
|
248
248
|
F.isOpening = !1;
|
|
249
|
-
function
|
|
249
|
+
function Lt(e, t) {
|
|
250
250
|
if (e instanceof HTMLAnchorElement)
|
|
251
251
|
t(e);
|
|
252
252
|
else if (e.hasAttribute("data-href")) {
|
|
@@ -254,11 +254,11 @@ function xt(e, t) {
|
|
|
254
254
|
r.href = e.getAttribute("data-href"), e.hasAttribute("data-target") && (r.target = e.getAttribute("data-target")), e.hasAttribute("data-rel") && (r.rel = e.getAttribute("data-rel")), e.hasAttribute("data-download") && (r.download = e.getAttribute("data-download")), e.hasAttribute("data-ping") && (r.ping = e.getAttribute("data-ping")), e.hasAttribute("data-referrer-policy") && (r.referrerPolicy = e.getAttribute("data-referrer-policy")), e.appendChild(r), t(r), e.removeChild(r);
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
|
-
function
|
|
258
|
-
|
|
257
|
+
function xt(e, t) {
|
|
258
|
+
Lt(e, (r) => F(r, t));
|
|
259
259
|
}
|
|
260
|
-
let A = /* @__PURE__ */ new Map(),
|
|
261
|
-
function
|
|
260
|
+
let A = /* @__PURE__ */ new Map(), se = /* @__PURE__ */ new Set();
|
|
261
|
+
function _e() {
|
|
262
262
|
if (typeof window > "u")
|
|
263
263
|
return;
|
|
264
264
|
let e = (r) => {
|
|
@@ -267,23 +267,23 @@ function Ee() {
|
|
|
267
267
|
}, t = (r) => {
|
|
268
268
|
let a = A.get(r.target);
|
|
269
269
|
if (!!a && (a.delete(r.propertyName), a.size === 0 && (r.target.removeEventListener("transitioncancel", t), A.delete(r.target)), A.size === 0)) {
|
|
270
|
-
for (let o of
|
|
270
|
+
for (let o of se)
|
|
271
271
|
o();
|
|
272
|
-
|
|
272
|
+
se.clear();
|
|
273
273
|
}
|
|
274
274
|
};
|
|
275
275
|
document.body.addEventListener("transitionrun", e), document.body.addEventListener("transitionend", t);
|
|
276
276
|
}
|
|
277
|
-
typeof document < "u" && (document.readyState !== "loading" ?
|
|
277
|
+
typeof document < "u" && (document.readyState !== "loading" ? _e() : document.addEventListener("DOMContentLoaded", _e));
|
|
278
278
|
function ze(e) {
|
|
279
279
|
requestAnimationFrame(() => {
|
|
280
|
-
A.size === 0 ? e() :
|
|
280
|
+
A.size === 0 ? e() : se.add(e);
|
|
281
281
|
});
|
|
282
282
|
}
|
|
283
|
-
function
|
|
284
|
-
let e = I(/* @__PURE__ */ new Map()), t =
|
|
285
|
-
let p = d != null && d.once ? (
|
|
286
|
-
e.current.delete(c), c(
|
|
283
|
+
function Ct() {
|
|
284
|
+
let e = I(/* @__PURE__ */ new Map()), t = L((o, u, c, d) => {
|
|
285
|
+
let p = d != null && d.once ? (...$) => {
|
|
286
|
+
e.current.delete(c), c(...$);
|
|
287
287
|
} : c;
|
|
288
288
|
e.current.set(c, {
|
|
289
289
|
type: u,
|
|
@@ -291,11 +291,11 @@ function Mt() {
|
|
|
291
291
|
fn: p,
|
|
292
292
|
options: d
|
|
293
293
|
}), o.addEventListener(u, c, d);
|
|
294
|
-
}, []), r =
|
|
294
|
+
}, []), r = L((o, u, c, d) => {
|
|
295
295
|
var p;
|
|
296
|
-
let
|
|
297
|
-
o.removeEventListener(u,
|
|
298
|
-
}, []), a =
|
|
296
|
+
let $ = ((p = e.current.get(c)) === null || p === void 0 ? void 0 : p.fn) || c;
|
|
297
|
+
o.removeEventListener(u, $, d), e.current.delete(c);
|
|
298
|
+
}, []), a = L(() => {
|
|
299
299
|
e.current.forEach((o, u) => {
|
|
300
300
|
r(o.eventTarget, o.type, u, o.options);
|
|
301
301
|
});
|
|
@@ -318,13 +318,13 @@ function Ie(e, t) {
|
|
|
318
318
|
};
|
|
319
319
|
});
|
|
320
320
|
}
|
|
321
|
-
function
|
|
321
|
+
function ie(e) {
|
|
322
322
|
return e.mozInputSource === 0 && e.isTrusted ? !0 : Fe() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function Mt(e) {
|
|
325
325
|
return !Fe() && e.width === 0 && e.height === 0 || e.width === 1 && e.height === 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "mouse";
|
|
326
326
|
}
|
|
327
|
-
function
|
|
327
|
+
function Kt(e, t) {
|
|
328
328
|
return t.get ? t.get.call(e) : t.value;
|
|
329
329
|
}
|
|
330
330
|
function Re(e, t, r) {
|
|
@@ -332,9 +332,9 @@ function Re(e, t, r) {
|
|
|
332
332
|
throw new TypeError("attempted to " + r + " private field on non-instance");
|
|
333
333
|
return t.get(e);
|
|
334
334
|
}
|
|
335
|
-
function
|
|
335
|
+
function Ot(e, t) {
|
|
336
336
|
var r = Re(e, t, "get");
|
|
337
|
-
return
|
|
337
|
+
return Kt(e, r);
|
|
338
338
|
}
|
|
339
339
|
function At(e, t) {
|
|
340
340
|
if (t.has(e))
|
|
@@ -352,15 +352,15 @@ function Dt(e, t, r) {
|
|
|
352
352
|
t.value = r;
|
|
353
353
|
}
|
|
354
354
|
}
|
|
355
|
-
function
|
|
355
|
+
function Ee(e, t, r) {
|
|
356
356
|
var a = Re(e, t, "set");
|
|
357
357
|
return Dt(e, a, r), r;
|
|
358
358
|
}
|
|
359
359
|
let N = "default", le = "", q = /* @__PURE__ */ new WeakMap();
|
|
360
|
-
function
|
|
360
|
+
function we(e) {
|
|
361
361
|
if (De()) {
|
|
362
362
|
if (N === "default") {
|
|
363
|
-
const t =
|
|
363
|
+
const t = S(e);
|
|
364
364
|
le = t.documentElement.style.webkitUserSelect, t.documentElement.style.webkitUserSelect = "none";
|
|
365
365
|
}
|
|
366
366
|
N = "disabled";
|
|
@@ -374,7 +374,7 @@ function V(e) {
|
|
|
374
374
|
N = "restoring", setTimeout(() => {
|
|
375
375
|
ze(() => {
|
|
376
376
|
if (N === "restoring") {
|
|
377
|
-
const t =
|
|
377
|
+
const t = S(e);
|
|
378
378
|
t.documentElement.style.webkitUserSelect === "none" && (t.documentElement.style.webkitUserSelect = le || ""), le = "", N = "default";
|
|
379
379
|
}
|
|
380
380
|
});
|
|
@@ -400,19 +400,19 @@ function Ft(e) {
|
|
|
400
400
|
var j = /* @__PURE__ */ new WeakMap();
|
|
401
401
|
class Y {
|
|
402
402
|
continuePropagation() {
|
|
403
|
-
|
|
403
|
+
Ee(this, j, !1);
|
|
404
404
|
}
|
|
405
405
|
get shouldStopPropagation() {
|
|
406
|
-
return
|
|
406
|
+
return Ot(this, j);
|
|
407
407
|
}
|
|
408
408
|
constructor(t, r, a) {
|
|
409
409
|
Nt(this, j, {
|
|
410
410
|
writable: !0,
|
|
411
411
|
value: void 0
|
|
412
|
-
}),
|
|
412
|
+
}), Ee(this, j, !0), this.type = t, this.pointerType = r, this.target = a.currentTarget, this.shiftKey = a.shiftKey, this.metaKey = a.metaKey, this.ctrlKey = a.ctrlKey, this.altKey = a.altKey;
|
|
413
413
|
}
|
|
414
414
|
}
|
|
415
|
-
const
|
|
415
|
+
const Se = Symbol("linkClicked");
|
|
416
416
|
function zt(e) {
|
|
417
417
|
let {
|
|
418
418
|
onPress: t,
|
|
@@ -423,11 +423,11 @@ function zt(e) {
|
|
|
423
423
|
isDisabled: c,
|
|
424
424
|
isPressed: d,
|
|
425
425
|
preventFocusOnPress: p,
|
|
426
|
-
shouldCancelOnPointerExit:
|
|
427
|
-
allowTextSelectionOnPress:
|
|
426
|
+
shouldCancelOnPointerExit: $,
|
|
427
|
+
allowTextSelectionOnPress: P,
|
|
428
428
|
ref: H,
|
|
429
429
|
...ee
|
|
430
|
-
} = Ft(e), [te, U] = Ye(!1),
|
|
430
|
+
} = Ft(e), [te, U] = Ye(!1), _ = I({
|
|
431
431
|
isPressed: !1,
|
|
432
432
|
ignoreEmulatedMouseEvents: !1,
|
|
433
433
|
ignoreClickAfterPress: !1,
|
|
@@ -437,8 +437,8 @@ function zt(e) {
|
|
|
437
437
|
target: null,
|
|
438
438
|
isOverTarget: !1,
|
|
439
439
|
pointerType: null
|
|
440
|
-
}), { addGlobalListener: b, removeAllGlobalListeners: T } =
|
|
441
|
-
let y =
|
|
440
|
+
}), { addGlobalListener: b, removeAllGlobalListeners: T } = Ct(), E = O((n, f) => {
|
|
441
|
+
let y = _.current;
|
|
442
442
|
if (c || y.didFirePressStart)
|
|
443
443
|
return !1;
|
|
444
444
|
let l = !0;
|
|
@@ -447,23 +447,23 @@ function zt(e) {
|
|
|
447
447
|
a(v), l = v.shouldStopPropagation;
|
|
448
448
|
}
|
|
449
449
|
return r && r(!0), y.isTriggeringEvent = !1, y.didFirePressStart = !0, U(!0), l;
|
|
450
|
-
}),
|
|
451
|
-
let l =
|
|
450
|
+
}), m = O((n, f, y = !0) => {
|
|
451
|
+
let l = _.current;
|
|
452
452
|
if (!l.didFirePressStart)
|
|
453
453
|
return !1;
|
|
454
454
|
l.ignoreClickAfterPress = !0, l.didFirePressStart = !1, l.isTriggeringEvent = !0;
|
|
455
455
|
let v = !0;
|
|
456
456
|
if (o) {
|
|
457
|
-
let
|
|
458
|
-
o(
|
|
457
|
+
let s = new Y("pressend", f, n);
|
|
458
|
+
o(s), v = s.shouldStopPropagation;
|
|
459
459
|
}
|
|
460
460
|
if (r && r(!1), U(!1), t && y && !c) {
|
|
461
|
-
let
|
|
462
|
-
t(
|
|
461
|
+
let s = new Y("press", f, n);
|
|
462
|
+
t(s), v && (v = s.shouldStopPropagation);
|
|
463
463
|
}
|
|
464
464
|
return l.isTriggeringEvent = !1, v;
|
|
465
|
-
}),
|
|
466
|
-
let y =
|
|
465
|
+
}), C = O((n, f) => {
|
|
466
|
+
let y = _.current;
|
|
467
467
|
if (c)
|
|
468
468
|
return !1;
|
|
469
469
|
if (u) {
|
|
@@ -472,32 +472,32 @@ function zt(e) {
|
|
|
472
472
|
return u(l), y.isTriggeringEvent = !1, l.shouldStopPropagation;
|
|
473
473
|
}
|
|
474
474
|
return !0;
|
|
475
|
-
}), k =
|
|
476
|
-
let f =
|
|
477
|
-
f.isPressed && f.target && (f.isOverTarget && f.pointerType != null &&
|
|
478
|
-
}), G =
|
|
479
|
-
|
|
475
|
+
}), k = O((n) => {
|
|
476
|
+
let f = _.current;
|
|
477
|
+
f.isPressed && f.target && (f.isOverTarget && f.pointerType != null && m(w(f.target, n), f.pointerType, !1), f.isPressed = !1, f.isOverTarget = !1, f.activePointerId = null, f.pointerType = null, T(), P || V(f.target));
|
|
478
|
+
}), G = O((n) => {
|
|
479
|
+
$ && k(n);
|
|
480
480
|
}), Ve = Xe(() => {
|
|
481
|
-
let n =
|
|
481
|
+
let n = _.current, f = {
|
|
482
482
|
onKeyDown(l) {
|
|
483
483
|
if (ne(l.nativeEvent, l.currentTarget) && l.currentTarget.contains(l.target)) {
|
|
484
484
|
var v;
|
|
485
|
-
|
|
486
|
-
let
|
|
487
|
-
!n.isPressed && !l.repeat && (n.target = l.currentTarget, n.isPressed = !0,
|
|
485
|
+
Be(l.target, l.key) && l.preventDefault();
|
|
486
|
+
let s = !0;
|
|
487
|
+
!n.isPressed && !l.repeat && (n.target = l.currentTarget, n.isPressed = !0, s = E(l, "keyboard"), b(S(l.currentTarget), "keyup", y, !1)), s && l.stopPropagation(), l.metaKey && z() && ((v = n.metaKeyEvents) === null || v === void 0 || v.set(l.key, l.nativeEvent));
|
|
488
488
|
} else
|
|
489
489
|
l.key === "Meta" && (n.metaKeyEvents = /* @__PURE__ */ new Map());
|
|
490
490
|
},
|
|
491
491
|
onKeyUp(l) {
|
|
492
|
-
ne(l.nativeEvent, l.currentTarget) && !l.repeat && l.currentTarget.contains(l.target) && n.target &&
|
|
492
|
+
ne(l.nativeEvent, l.currentTarget) && !l.repeat && l.currentTarget.contains(l.target) && n.target && C(w(n.target, l), "keyboard");
|
|
493
493
|
},
|
|
494
494
|
onClick(l) {
|
|
495
495
|
if (!(l && !l.currentTarget.contains(l.target)) && l && l.button === 0 && !n.isTriggeringEvent && !F.isOpening) {
|
|
496
496
|
let v = !0;
|
|
497
|
-
if (c && l.preventDefault(), !n.ignoreClickAfterPress && !n.ignoreEmulatedMouseEvents && !n.isPressed && (n.pointerType === "virtual" ||
|
|
498
|
-
!c && !p &&
|
|
499
|
-
let
|
|
500
|
-
v =
|
|
497
|
+
if (c && l.preventDefault(), !n.ignoreClickAfterPress && !n.ignoreEmulatedMouseEvents && !n.isPressed && (n.pointerType === "virtual" || ie(l.nativeEvent))) {
|
|
498
|
+
!c && !p && B(l.currentTarget);
|
|
499
|
+
let s = E(l, "virtual"), i = C(l, "virtual"), g = m(l, "virtual");
|
|
500
|
+
v = s && i && g;
|
|
501
501
|
}
|
|
502
502
|
n.ignoreEmulatedMouseEvents = !1, n.ignoreClickAfterPress = !1, v && l.stopPropagation();
|
|
503
503
|
}
|
|
@@ -505,105 +505,105 @@ function zt(e) {
|
|
|
505
505
|
}, y = (l) => {
|
|
506
506
|
var v;
|
|
507
507
|
if (n.isPressed && n.target && ne(l, n.target)) {
|
|
508
|
-
var i;
|
|
509
|
-
Le(l.target, l.key) && l.preventDefault();
|
|
510
|
-
let g = l.target, re = $(S(n.target, l), "keyboard", n.target.contains(g));
|
|
511
|
-
T(), re && l.stopPropagation(), l.key !== "Enter" && be(n.target) && n.target.contains(g) && !l[Be] && (l[Be] = !0, F(n.target, l, !1)), n.isPressed = !1, (i = n.metaKeyEvents) === null || i === void 0 || i.delete(l.key);
|
|
512
|
-
} else if (l.key === "Meta" && ((v = n.metaKeyEvents) === null || v === void 0 ? void 0 : v.size)) {
|
|
513
508
|
var s;
|
|
509
|
+
Be(l.target, l.key) && l.preventDefault();
|
|
510
|
+
let g = l.target, re = m(w(n.target, l), "keyboard", n.target.contains(g));
|
|
511
|
+
T(), re && l.stopPropagation(), l.key !== "Enter" && be(n.target) && n.target.contains(g) && !l[Se] && (l[Se] = !0, F(n.target, l, !1)), n.isPressed = !1, (s = n.metaKeyEvents) === null || s === void 0 || s.delete(l.key);
|
|
512
|
+
} else if (l.key === "Meta" && ((v = n.metaKeyEvents) === null || v === void 0 ? void 0 : v.size)) {
|
|
513
|
+
var i;
|
|
514
514
|
let g = n.metaKeyEvents;
|
|
515
515
|
n.metaKeyEvents = void 0;
|
|
516
516
|
for (let re of g.values())
|
|
517
|
-
(
|
|
517
|
+
(i = n.target) === null || i === void 0 || i.dispatchEvent(new KeyboardEvent("keyup", re));
|
|
518
518
|
}
|
|
519
519
|
};
|
|
520
520
|
if (typeof PointerEvent < "u") {
|
|
521
|
-
f.onPointerDown = (
|
|
522
|
-
if (
|
|
521
|
+
f.onPointerDown = (i) => {
|
|
522
|
+
if (i.button !== 0 || !i.currentTarget.contains(i.target))
|
|
523
523
|
return;
|
|
524
|
-
if (
|
|
524
|
+
if (Mt(i.nativeEvent)) {
|
|
525
525
|
n.pointerType = "virtual";
|
|
526
526
|
return;
|
|
527
527
|
}
|
|
528
|
-
ae(
|
|
528
|
+
ae(i.currentTarget) && i.preventDefault(), n.pointerType = i.pointerType;
|
|
529
529
|
let g = !0;
|
|
530
|
-
n.isPressed || (n.isPressed = !0, n.isOverTarget = !0, n.activePointerId =
|
|
531
|
-
}, f.onMouseDown = (
|
|
532
|
-
!
|
|
533
|
-
}, f.onPointerUp = (
|
|
534
|
-
!
|
|
530
|
+
n.isPressed || (n.isPressed = !0, n.isOverTarget = !0, n.activePointerId = i.pointerId, n.target = i.currentTarget, !c && !p && B(i.currentTarget), P || we(n.target), g = E(i, n.pointerType), b(S(i.currentTarget), "pointermove", l, !1), b(S(i.currentTarget), "pointerup", v, !1), b(S(i.currentTarget), "pointercancel", s, !1)), g && i.stopPropagation();
|
|
531
|
+
}, f.onMouseDown = (i) => {
|
|
532
|
+
!i.currentTarget.contains(i.target) || i.button === 0 && (ae(i.currentTarget) && i.preventDefault(), i.stopPropagation());
|
|
533
|
+
}, f.onPointerUp = (i) => {
|
|
534
|
+
!i.currentTarget.contains(i.target) || n.pointerType === "virtual" || i.button === 0 && M(i, i.currentTarget) && C(i, n.pointerType || i.pointerType);
|
|
535
535
|
};
|
|
536
|
-
let l = (
|
|
537
|
-
|
|
538
|
-
}, v = (
|
|
539
|
-
|
|
540
|
-
},
|
|
541
|
-
k(
|
|
536
|
+
let l = (i) => {
|
|
537
|
+
i.pointerId === n.activePointerId && (n.target && M(i, n.target) ? !n.isOverTarget && n.pointerType != null && (n.isOverTarget = !0, E(w(n.target, i), n.pointerType)) : n.target && n.isOverTarget && n.pointerType != null && (n.isOverTarget = !1, m(w(n.target, i), n.pointerType, !1), G(i)));
|
|
538
|
+
}, v = (i) => {
|
|
539
|
+
i.pointerId === n.activePointerId && n.isPressed && i.button === 0 && n.target && (M(i, n.target) && n.pointerType != null ? m(w(n.target, i), n.pointerType) : n.isOverTarget && n.pointerType != null && m(w(n.target, i), n.pointerType, !1), n.isPressed = !1, n.isOverTarget = !1, n.activePointerId = null, n.pointerType = null, T(), P || V(n.target));
|
|
540
|
+
}, s = (i) => {
|
|
541
|
+
k(i);
|
|
542
542
|
};
|
|
543
|
-
f.onDragStart = (
|
|
544
|
-
!
|
|
543
|
+
f.onDragStart = (i) => {
|
|
544
|
+
!i.currentTarget.contains(i.target) || k(i);
|
|
545
545
|
};
|
|
546
546
|
} else {
|
|
547
|
-
f.onMouseDown = (
|
|
548
|
-
if (
|
|
547
|
+
f.onMouseDown = (s) => {
|
|
548
|
+
if (s.button !== 0 || !s.currentTarget.contains(s.target))
|
|
549
549
|
return;
|
|
550
|
-
if (ae(
|
|
551
|
-
|
|
550
|
+
if (ae(s.currentTarget) && s.preventDefault(), n.ignoreEmulatedMouseEvents) {
|
|
551
|
+
s.stopPropagation();
|
|
552
552
|
return;
|
|
553
553
|
}
|
|
554
|
-
n.isPressed = !0, n.isOverTarget = !0, n.target =
|
|
555
|
-
}, f.onMouseEnter = (
|
|
556
|
-
if (!
|
|
554
|
+
n.isPressed = !0, n.isOverTarget = !0, n.target = s.currentTarget, n.pointerType = ie(s.nativeEvent) ? "virtual" : "mouse", !c && !p && B(s.currentTarget), E(s, n.pointerType) && s.stopPropagation(), b(S(s.currentTarget), "mouseup", l, !1);
|
|
555
|
+
}, f.onMouseEnter = (s) => {
|
|
556
|
+
if (!s.currentTarget.contains(s.target))
|
|
557
557
|
return;
|
|
558
|
-
let
|
|
559
|
-
n.isPressed && !n.ignoreEmulatedMouseEvents && n.pointerType != null && (n.isOverTarget = !0,
|
|
560
|
-
}, f.onMouseLeave = (
|
|
561
|
-
if (!
|
|
558
|
+
let i = !0;
|
|
559
|
+
n.isPressed && !n.ignoreEmulatedMouseEvents && n.pointerType != null && (n.isOverTarget = !0, i = E(s, n.pointerType)), i && s.stopPropagation();
|
|
560
|
+
}, f.onMouseLeave = (s) => {
|
|
561
|
+
if (!s.currentTarget.contains(s.target))
|
|
562
562
|
return;
|
|
563
|
-
let
|
|
564
|
-
n.isPressed && !n.ignoreEmulatedMouseEvents && n.pointerType != null && (n.isOverTarget = !1,
|
|
565
|
-
}, f.onMouseUp = (
|
|
566
|
-
!
|
|
563
|
+
let i = !0;
|
|
564
|
+
n.isPressed && !n.ignoreEmulatedMouseEvents && n.pointerType != null && (n.isOverTarget = !1, i = m(s, n.pointerType, !1), G(s)), i && s.stopPropagation();
|
|
565
|
+
}, f.onMouseUp = (s) => {
|
|
566
|
+
!s.currentTarget.contains(s.target) || !n.ignoreEmulatedMouseEvents && s.button === 0 && C(s, n.pointerType || "mouse");
|
|
567
567
|
};
|
|
568
|
-
let l = (
|
|
569
|
-
if (
|
|
568
|
+
let l = (s) => {
|
|
569
|
+
if (s.button === 0) {
|
|
570
570
|
if (n.isPressed = !1, T(), n.ignoreEmulatedMouseEvents) {
|
|
571
571
|
n.ignoreEmulatedMouseEvents = !1;
|
|
572
572
|
return;
|
|
573
573
|
}
|
|
574
|
-
n.target &&
|
|
574
|
+
n.target && M(s, n.target) && n.pointerType != null ? m(w(n.target, s), n.pointerType) : n.target && n.isOverTarget && n.pointerType != null && m(w(n.target, s), n.pointerType, !1), n.isOverTarget = !1;
|
|
575
575
|
}
|
|
576
576
|
};
|
|
577
|
-
f.onTouchStart = (
|
|
578
|
-
if (!
|
|
577
|
+
f.onTouchStart = (s) => {
|
|
578
|
+
if (!s.currentTarget.contains(s.target))
|
|
579
579
|
return;
|
|
580
|
-
let
|
|
581
|
-
if (!
|
|
580
|
+
let i = It(s.nativeEvent);
|
|
581
|
+
if (!i)
|
|
582
582
|
return;
|
|
583
|
-
n.activePointerId =
|
|
584
|
-
}, f.onTouchMove = (
|
|
585
|
-
if (!
|
|
583
|
+
n.activePointerId = i.identifier, n.ignoreEmulatedMouseEvents = !0, n.isOverTarget = !0, n.isPressed = !0, n.target = s.currentTarget, n.pointerType = "touch", !c && !p && B(s.currentTarget), P || we(n.target), E(s, n.pointerType) && s.stopPropagation(), b(oe(s.currentTarget), "scroll", v, !0);
|
|
584
|
+
}, f.onTouchMove = (s) => {
|
|
585
|
+
if (!s.currentTarget.contains(s.target))
|
|
586
586
|
return;
|
|
587
587
|
if (!n.isPressed) {
|
|
588
|
-
|
|
588
|
+
s.stopPropagation();
|
|
589
589
|
return;
|
|
590
590
|
}
|
|
591
|
-
let
|
|
592
|
-
|
|
593
|
-
}, f.onTouchEnd = (
|
|
594
|
-
if (!
|
|
591
|
+
let i = ke(s.nativeEvent, n.activePointerId), g = !0;
|
|
592
|
+
i && M(i, s.currentTarget) ? !n.isOverTarget && n.pointerType != null && (n.isOverTarget = !0, g = E(s, n.pointerType)) : n.isOverTarget && n.pointerType != null && (n.isOverTarget = !1, g = m(s, n.pointerType, !1), G(s)), g && s.stopPropagation();
|
|
593
|
+
}, f.onTouchEnd = (s) => {
|
|
594
|
+
if (!s.currentTarget.contains(s.target))
|
|
595
595
|
return;
|
|
596
596
|
if (!n.isPressed) {
|
|
597
|
-
|
|
597
|
+
s.stopPropagation();
|
|
598
598
|
return;
|
|
599
599
|
}
|
|
600
|
-
let
|
|
601
|
-
|
|
602
|
-
}, f.onTouchCancel = (
|
|
603
|
-
!
|
|
600
|
+
let i = ke(s.nativeEvent, n.activePointerId), g = !0;
|
|
601
|
+
i && M(i, s.currentTarget) && n.pointerType != null ? (C(s, n.pointerType), g = m(s, n.pointerType)) : n.isOverTarget && n.pointerType != null && (g = m(s, n.pointerType, !1)), g && s.stopPropagation(), n.isPressed = !1, n.activePointerId = null, n.isOverTarget = !1, n.ignoreEmulatedMouseEvents = !0, n.target && !P && V(n.target), T();
|
|
602
|
+
}, f.onTouchCancel = (s) => {
|
|
603
|
+
!s.currentTarget.contains(s.target) || (s.stopPropagation(), n.isPressed && k(s));
|
|
604
604
|
};
|
|
605
|
-
let v = (
|
|
606
|
-
n.isPressed &&
|
|
605
|
+
let v = (s) => {
|
|
606
|
+
n.isPressed && s.target.contains(n.target) && k({
|
|
607
607
|
currentTarget: n.target,
|
|
608
608
|
shiftKey: !1,
|
|
609
609
|
ctrlKey: !1,
|
|
@@ -611,8 +611,8 @@ function zt(e) {
|
|
|
611
611
|
altKey: !1
|
|
612
612
|
});
|
|
613
613
|
};
|
|
614
|
-
f.onDragStart = (
|
|
615
|
-
!
|
|
614
|
+
f.onDragStart = (s) => {
|
|
615
|
+
!s.currentTarget.contains(s.target) || k(s);
|
|
616
616
|
};
|
|
617
617
|
}
|
|
618
618
|
return f;
|
|
@@ -621,18 +621,18 @@ function zt(e) {
|
|
|
621
621
|
c,
|
|
622
622
|
p,
|
|
623
623
|
T,
|
|
624
|
-
|
|
624
|
+
P,
|
|
625
625
|
k,
|
|
626
626
|
G,
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
627
|
+
m,
|
|
628
|
+
E,
|
|
629
|
+
C
|
|
630
630
|
]);
|
|
631
631
|
return fe(() => () => {
|
|
632
632
|
var n;
|
|
633
|
-
|
|
633
|
+
P || V((n = _.current.target) !== null && n !== void 0 ? n : void 0);
|
|
634
634
|
}, [
|
|
635
|
-
|
|
635
|
+
P
|
|
636
636
|
]), {
|
|
637
637
|
isPressed: d || te,
|
|
638
638
|
pressProps: D(ee, Ve)
|
|
@@ -658,7 +658,7 @@ function ke(e, t) {
|
|
|
658
658
|
}
|
|
659
659
|
return null;
|
|
660
660
|
}
|
|
661
|
-
function
|
|
661
|
+
function w(e, t) {
|
|
662
662
|
return {
|
|
663
663
|
currentTarget: e,
|
|
664
664
|
shiftKey: t.shiftKey,
|
|
@@ -679,14 +679,14 @@ function Rt(e) {
|
|
|
679
679
|
function Ht(e, t) {
|
|
680
680
|
return !(e.left > t.right || t.left > e.right || e.top > t.bottom || t.top > e.bottom);
|
|
681
681
|
}
|
|
682
|
-
function
|
|
682
|
+
function M(e, t) {
|
|
683
683
|
let r = t.getBoundingClientRect(), a = Rt(e);
|
|
684
684
|
return Ht(r, a);
|
|
685
685
|
}
|
|
686
686
|
function ae(e) {
|
|
687
687
|
return !(e instanceof HTMLElement) || !e.hasAttribute("draggable");
|
|
688
688
|
}
|
|
689
|
-
function
|
|
689
|
+
function Be(e, t) {
|
|
690
690
|
return e instanceof HTMLInputElement ? !Ue(e, t) : e instanceof HTMLButtonElement ? e.type !== "submit" && e.type !== "reset" : !be(e);
|
|
691
691
|
}
|
|
692
692
|
const Ut = /* @__PURE__ */ new Set([
|
|
@@ -733,10 +733,10 @@ function Wt(e) {
|
|
|
733
733
|
a.observer && (a.observer.disconnect(), a.observer = null);
|
|
734
734
|
};
|
|
735
735
|
}, []);
|
|
736
|
-
let r =
|
|
736
|
+
let r = O((a) => {
|
|
737
737
|
e == null || e(a);
|
|
738
738
|
});
|
|
739
|
-
return
|
|
739
|
+
return L((a) => {
|
|
740
740
|
if (a.target instanceof HTMLButtonElement || a.target instanceof HTMLInputElement || a.target instanceof HTMLTextAreaElement || a.target instanceof HTMLSelectElement) {
|
|
741
741
|
t.current.isFocused = !0;
|
|
742
742
|
let o = a.target, u = (c) => {
|
|
@@ -769,13 +769,13 @@ function Wt(e) {
|
|
|
769
769
|
}
|
|
770
770
|
function Vt(e) {
|
|
771
771
|
let { isDisabled: t, onFocus: r, onBlur: a, onFocusChange: o } = e;
|
|
772
|
-
const u =
|
|
772
|
+
const u = L((p) => {
|
|
773
773
|
if (p.target === p.currentTarget)
|
|
774
774
|
return a && a(p), o && o(!1), !0;
|
|
775
775
|
}, [
|
|
776
776
|
a,
|
|
777
777
|
o
|
|
778
|
-
]), c = Wt(u), d =
|
|
778
|
+
]), c = Wt(u), d = L((p) => {
|
|
779
779
|
p.target === p.currentTarget && document.activeElement === p.target && (r && r(p), o && o(!0), c(p));
|
|
780
780
|
}, [
|
|
781
781
|
o,
|
|
@@ -789,7 +789,7 @@ function Vt(e) {
|
|
|
789
789
|
}
|
|
790
790
|
};
|
|
791
791
|
}
|
|
792
|
-
let R = null, jt = /* @__PURE__ */ new Set(),
|
|
792
|
+
let R = null, jt = /* @__PURE__ */ new Set(), Le = !1, x = !1, ce = !1;
|
|
793
793
|
function ge(e, t) {
|
|
794
794
|
for (let r of jt)
|
|
795
795
|
r(e, t);
|
|
@@ -797,34 +797,34 @@ function ge(e, t) {
|
|
|
797
797
|
function Yt(e) {
|
|
798
798
|
return !(e.metaKey || !z() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
|
|
799
799
|
}
|
|
800
|
-
function
|
|
801
|
-
|
|
800
|
+
function xe(e) {
|
|
801
|
+
x = !0, Yt(e) && (R = "keyboard", ge("keyboard", e));
|
|
802
802
|
}
|
|
803
|
-
function
|
|
804
|
-
R = "pointer", (e.type === "mousedown" || e.type === "pointerdown") && (
|
|
803
|
+
function K(e) {
|
|
804
|
+
R = "pointer", (e.type === "mousedown" || e.type === "pointerdown") && (x = !0, ge("pointer", e));
|
|
805
805
|
}
|
|
806
806
|
function Xt(e) {
|
|
807
|
-
|
|
807
|
+
ie(e) && (x = !0, R = "virtual");
|
|
808
808
|
}
|
|
809
809
|
function qt(e) {
|
|
810
|
-
e.target === window || e.target === document || (!
|
|
810
|
+
e.target === window || e.target === document || (!x && !ce && (R = "virtual", ge("virtual", e)), x = !1, ce = !1);
|
|
811
811
|
}
|
|
812
812
|
function Jt() {
|
|
813
|
-
|
|
813
|
+
x = !1, ce = !0;
|
|
814
814
|
}
|
|
815
|
-
function
|
|
816
|
-
if (typeof window > "u" ||
|
|
815
|
+
function Ce() {
|
|
816
|
+
if (typeof window > "u" || Le)
|
|
817
817
|
return;
|
|
818
818
|
let e = HTMLElement.prototype.focus;
|
|
819
819
|
HTMLElement.prototype.focus = function() {
|
|
820
|
-
|
|
821
|
-
}, document.addEventListener("keydown",
|
|
820
|
+
x = !0, e.apply(this, arguments);
|
|
821
|
+
}, document.addEventListener("keydown", xe, !0), document.addEventListener("keyup", xe, !0), document.addEventListener("click", Xt, !0), window.addEventListener("focus", qt, !0), window.addEventListener("blur", Jt, !1), typeof PointerEvent < "u" ? (document.addEventListener("pointerdown", K, !0), document.addEventListener("pointermove", K, !0), document.addEventListener("pointerup", K, !0)) : (document.addEventListener("mousedown", K, !0), document.addEventListener("mousemove", K, !0), document.addEventListener("mouseup", K, !0)), Le = !0;
|
|
822
822
|
}
|
|
823
|
-
typeof document < "u" && (document.readyState !== "loading" ?
|
|
823
|
+
typeof document < "u" && (document.readyState !== "loading" ? Ce() : document.addEventListener("DOMContentLoaded", Ce));
|
|
824
824
|
function Qt() {
|
|
825
825
|
return R;
|
|
826
826
|
}
|
|
827
|
-
function
|
|
827
|
+
function Me(e) {
|
|
828
828
|
if (!e)
|
|
829
829
|
return;
|
|
830
830
|
let t = !0;
|
|
@@ -850,25 +850,25 @@ function Ke(e) {
|
|
|
850
850
|
function Zt(e) {
|
|
851
851
|
return {
|
|
852
852
|
keyboardProps: e.isDisabled ? {} : {
|
|
853
|
-
onKeyDown:
|
|
854
|
-
onKeyUp:
|
|
853
|
+
onKeyDown: Me(e.onKeyDown),
|
|
854
|
+
onKeyUp: Me(e.onKeyUp)
|
|
855
855
|
}
|
|
856
856
|
};
|
|
857
857
|
}
|
|
858
858
|
function er(e) {
|
|
859
|
-
const t =
|
|
859
|
+
const t = S(e);
|
|
860
860
|
if (Qt() === "virtual") {
|
|
861
861
|
let r = t.activeElement;
|
|
862
862
|
ze(() => {
|
|
863
|
-
t.activeElement === r && e.isConnected &&
|
|
863
|
+
t.activeElement === r && e.isConnected && B(e);
|
|
864
864
|
});
|
|
865
865
|
} else
|
|
866
|
-
|
|
866
|
+
B(e);
|
|
867
867
|
}
|
|
868
868
|
function tr(e, t) {
|
|
869
869
|
return !e || !t ? !1 : t.some((r) => r.contains(e));
|
|
870
870
|
}
|
|
871
|
-
class
|
|
871
|
+
class he {
|
|
872
872
|
get size() {
|
|
873
873
|
return this.fastMap.size;
|
|
874
874
|
}
|
|
@@ -879,7 +879,7 @@ class me {
|
|
|
879
879
|
let o = this.fastMap.get(r != null ? r : null);
|
|
880
880
|
if (!o)
|
|
881
881
|
return;
|
|
882
|
-
let u = new
|
|
882
|
+
let u = new Ke({
|
|
883
883
|
scopeRef: t
|
|
884
884
|
});
|
|
885
885
|
o.addChild(u), u.parent = o, this.fastMap.set(t, u), a && (u.nodeToRestore = a);
|
|
@@ -906,19 +906,19 @@ class me {
|
|
|
906
906
|
}
|
|
907
907
|
clone() {
|
|
908
908
|
var t;
|
|
909
|
-
let r = new
|
|
909
|
+
let r = new he();
|
|
910
910
|
var a;
|
|
911
911
|
for (let o of this.traverse())
|
|
912
912
|
r.addTreeNode(o.scopeRef, (a = (t = o.parent) === null || t === void 0 ? void 0 : t.scopeRef) !== null && a !== void 0 ? a : null, o.nodeToRestore);
|
|
913
913
|
return r;
|
|
914
914
|
}
|
|
915
915
|
constructor() {
|
|
916
|
-
this.fastMap = /* @__PURE__ */ new Map(), this.root = new
|
|
916
|
+
this.fastMap = /* @__PURE__ */ new Map(), this.root = new Ke({
|
|
917
917
|
scopeRef: null
|
|
918
918
|
}), this.fastMap.set(null, this.root);
|
|
919
919
|
}
|
|
920
920
|
}
|
|
921
|
-
class
|
|
921
|
+
class Ke {
|
|
922
922
|
addChild(t) {
|
|
923
923
|
this.children.add(t), t.parent = this;
|
|
924
924
|
}
|
|
@@ -929,7 +929,7 @@ class Oe {
|
|
|
929
929
|
this.children = /* @__PURE__ */ new Set(), this.contain = !1, this.scopeRef = t.scopeRef;
|
|
930
930
|
}
|
|
931
931
|
}
|
|
932
|
-
new
|
|
932
|
+
new he();
|
|
933
933
|
let rr = /* @__PURE__ */ ue.createContext(null);
|
|
934
934
|
function nr(e) {
|
|
935
935
|
let t = de(rr) || {};
|
|
@@ -959,60 +959,60 @@ function or(e, t) {
|
|
|
959
959
|
onClick: c,
|
|
960
960
|
isDisabled: d,
|
|
961
961
|
...p
|
|
962
|
-
} = e,
|
|
963
|
-
r !== "a" && (
|
|
962
|
+
} = e, $ = {};
|
|
963
|
+
r !== "a" && ($ = {
|
|
964
964
|
role: "link",
|
|
965
965
|
tabIndex: d ? void 0 : 0
|
|
966
966
|
});
|
|
967
|
-
let { focusableProps:
|
|
967
|
+
let { focusableProps: P } = ar(e, t), { pressProps: H, isPressed: ee } = zt({
|
|
968
968
|
onPress: a,
|
|
969
969
|
onPressStart: o,
|
|
970
970
|
onPressEnd: u,
|
|
971
971
|
isDisabled: d,
|
|
972
972
|
ref: t
|
|
973
|
-
}), te =
|
|
973
|
+
}), te = mt(p, {
|
|
974
974
|
labelable: !0,
|
|
975
975
|
isLink: r === "a"
|
|
976
|
-
}), U = D(
|
|
976
|
+
}), U = D(P, H), _ = kt();
|
|
977
977
|
return {
|
|
978
978
|
isPressed: ee,
|
|
979
979
|
linkProps: D(te, {
|
|
980
980
|
...U,
|
|
981
|
-
|
|
981
|
+
...$,
|
|
982
982
|
"aria-disabled": d || void 0,
|
|
983
983
|
"aria-current": e["aria-current"],
|
|
984
984
|
onClick: (b) => {
|
|
985
985
|
var T;
|
|
986
|
-
(T = H.onClick) === null || T === void 0 || T.call(H, b), c && (c(b), console.warn("onClick is deprecated, please use onPress")), !
|
|
986
|
+
(T = H.onClick) === null || T === void 0 || T.call(H, b), c && (c(b), console.warn("onClick is deprecated, please use onPress")), !_.isNative && b.currentTarget instanceof HTMLAnchorElement && b.currentTarget.href && !b.isDefaultPrevented() && Bt(b.currentTarget, b) && (b.preventDefault(), _.open(b.currentTarget, b));
|
|
987
987
|
}
|
|
988
988
|
})
|
|
989
989
|
};
|
|
990
990
|
}
|
|
991
|
-
function
|
|
991
|
+
function me(e) {
|
|
992
992
|
var d;
|
|
993
|
-
const t =
|
|
993
|
+
const t = h.useRef(null), { linkProps: r } = or(e, t), { active: a, ...o } = e, u = {
|
|
994
994
|
...o,
|
|
995
995
|
...r,
|
|
996
996
|
ref: t,
|
|
997
997
|
className: Q(rt({ active: a, disabled: !1 }), e.className)
|
|
998
998
|
}, c = (d = e.as) != null ? d : e.href ? "a" : "span";
|
|
999
|
-
return /* @__PURE__ */
|
|
999
|
+
return /* @__PURE__ */ h.createElement(c, { ...u }, e.children);
|
|
1000
1000
|
}
|
|
1001
|
-
J.set(
|
|
1001
|
+
J.set(me, {
|
|
1002
1002
|
name: "Product Bar Tab",
|
|
1003
1003
|
props: {
|
|
1004
1004
|
active: { type: "boolean", required: !0 },
|
|
1005
1005
|
href: { type: "string" }
|
|
1006
1006
|
}
|
|
1007
1007
|
});
|
|
1008
|
-
function
|
|
1008
|
+
function $e({
|
|
1009
1009
|
children: e,
|
|
1010
1010
|
className: t,
|
|
1011
1011
|
name: r,
|
|
1012
1012
|
logoSrc: a,
|
|
1013
1013
|
...o
|
|
1014
1014
|
}) {
|
|
1015
|
-
return /* @__PURE__ */
|
|
1015
|
+
return /* @__PURE__ */ h.createElement(h.Fragment, null, /* @__PURE__ */ h.createElement("a", { className: Q(at, t), ...o }, a && /* @__PURE__ */ h.createElement(
|
|
1016
1016
|
"img",
|
|
1017
1017
|
{
|
|
1018
1018
|
className: ot,
|
|
@@ -1020,9 +1020,9 @@ function Pe({
|
|
|
1020
1020
|
"aria-hidden": "true",
|
|
1021
1021
|
alt: `${r} Logo`
|
|
1022
1022
|
}
|
|
1023
|
-
), r && /* @__PURE__ */
|
|
1023
|
+
), r && /* @__PURE__ */ h.createElement("span", { className: st }, r)), /* @__PURE__ */ h.createElement("span", { className: ut }));
|
|
1024
1024
|
}
|
|
1025
|
-
J.set(
|
|
1025
|
+
J.set($e, {
|
|
1026
1026
|
name: "Product Bar Name",
|
|
1027
1027
|
props: {
|
|
1028
1028
|
name: { type: "string" },
|
|
@@ -1035,11 +1035,11 @@ function Ge({
|
|
|
1035
1035
|
className: r,
|
|
1036
1036
|
...a
|
|
1037
1037
|
}) {
|
|
1038
|
-
const o =
|
|
1039
|
-
{ type:
|
|
1040
|
-
{ type:
|
|
1038
|
+
const o = h.useRef(null), [u, c, d] = qe(t, [
|
|
1039
|
+
{ type: $e },
|
|
1040
|
+
{ type: me }
|
|
1041
1041
|
]);
|
|
1042
|
-
return /* @__PURE__ */
|
|
1042
|
+
return /* @__PURE__ */ h.createElement("div", { className: Q(it, r), ...a, ref: o }, /* @__PURE__ */ h.createElement("nav", { className: nt({ fullWidth: e }) }, u, /* @__PURE__ */ h.createElement("div", { className: ct }, c), /* @__PURE__ */ h.createElement("div", { className: lt }, /* @__PURE__ */ h.createElement(Je.Provider, { value: { parentElementRef: o, fixed: !0 } }, d))));
|
|
1043
1043
|
}
|
|
1044
1044
|
J.set(Ge, {
|
|
1045
1045
|
name: "ProductBar",
|
|
@@ -1047,24 +1047,24 @@ J.set(Ge, {
|
|
|
1047
1047
|
fullWidth: { type: "boolean" }
|
|
1048
1048
|
}
|
|
1049
1049
|
});
|
|
1050
|
-
var
|
|
1050
|
+
var sr = "pkg_sps-woodland_product-bar__version_7_19_0__hash_r7f8id0", ir = "pkg_sps-woodland_product-bar__version_7_19_0__hash_r7f8id1";
|
|
1051
1051
|
function We({
|
|
1052
1052
|
channelId: e,
|
|
1053
1053
|
className: t,
|
|
1054
1054
|
...r
|
|
1055
1055
|
}) {
|
|
1056
|
-
const { t: a } =
|
|
1057
|
-
return /* @__PURE__ */
|
|
1056
|
+
const { t: a } = h.useContext(Qe);
|
|
1057
|
+
return /* @__PURE__ */ h.createElement(
|
|
1058
1058
|
"a",
|
|
1059
1059
|
{
|
|
1060
|
-
className: Q(
|
|
1060
|
+
className: Q(sr, t),
|
|
1061
1061
|
target: "_blank",
|
|
1062
1062
|
rel: "noreferrer",
|
|
1063
1063
|
href: `https://spscommerce.slack.com/archives/${e}`,
|
|
1064
1064
|
...r
|
|
1065
1065
|
},
|
|
1066
|
-
/* @__PURE__ */
|
|
1067
|
-
/* @__PURE__ */
|
|
1066
|
+
/* @__PURE__ */ h.createElement(Ze, { className: ir, icon: "conversation", "aria-hidden": "true" }),
|
|
1067
|
+
/* @__PURE__ */ h.createElement("span", null, a("design-system:slackLink.label"))
|
|
1068
1068
|
);
|
|
1069
1069
|
}
|
|
1070
1070
|
J.set(We, {
|
|
@@ -1074,7 +1074,7 @@ J.set(We, {
|
|
|
1074
1074
|
}
|
|
1075
1075
|
});
|
|
1076
1076
|
const lr = {
|
|
1077
|
-
components: [Ge,
|
|
1077
|
+
components: [Ge, $e, me],
|
|
1078
1078
|
examples: {
|
|
1079
1079
|
basic: {
|
|
1080
1080
|
label: "Basic",
|
|
@@ -1278,7 +1278,7 @@ const lr = {
|
|
|
1278
1278
|
export {
|
|
1279
1279
|
pr as MANIFEST,
|
|
1280
1280
|
Ge as ProductBar,
|
|
1281
|
-
|
|
1282
|
-
|
|
1281
|
+
$e as ProductBarName,
|
|
1282
|
+
me as ProductBarTab,
|
|
1283
1283
|
We as SlackLink
|
|
1284
1284
|
};
|