@thednp/shorty 2.0.2 → 2.0.4
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/README.md +5 -5
- package/dist/shorty.cjs +1 -1
- package/dist/shorty.cjs.map +1 -1
- package/dist/shorty.d.ts +12 -11
- package/dist/shorty.js +1 -1
- package/dist/shorty.js.map +1 -1
- package/dist/shorty.mjs +14 -4
- package/dist/shorty.mjs.map +1 -1
- package/package.json +17 -15
- package/src/boolean/isApple.ts +1 -1
- package/src/boolean/isFirefox.ts +3 -1
- package/src/boolean/isMobile.ts +1 -1
- package/src/event/one.ts +1 -1
- package/src/get/getRectRelativeToOffsetParent.ts +1 -1
- package/src/index.ts +11 -0
- package/src/misc/createCustomEvent.ts +5 -5
- package/src/misc/createElementNS.ts +1 -1
- package/src/misc/emulateAnimationEnd.ts +3 -2
- package/src/misc/emulateTransitionEnd.ts +2 -2
- package/src/selectors/closest.ts +5 -2
- package/test/att.test.ts +43 -0
- package/test/boolean.test.ts +30 -0
- package/test/class.test.ts +26 -0
- package/test/event.test.ts +39 -0
- package/{cypress/test.html → test/fixtures/getExampleDom.ts} +17 -32
- package/test/fixtures/style.css +18 -0
- package/test/get.test.ts +150 -0
- package/{cypress/e2e/is.cy.ts → test/is.test.ts} +77 -74
- package/test/misc.test.ts +352 -0
- package/test/selectors.test.ts +90 -0
- package/tsconfig.json +6 -1
- package/vitest.config-ui.ts +21 -0
- package/vitest.config.ts +20 -0
- package/cypress/e2e/att.cy.ts +0 -46
- package/cypress/e2e/boolean.cy.ts +0 -44
- package/cypress/e2e/class.cy.ts +0 -28
- package/cypress/e2e/event.cy.ts +0 -51
- package/cypress/e2e/get.cy.ts +0 -168
- package/cypress/e2e/misc.cy.ts +0 -354
- package/cypress/e2e/selectors.cy.ts +0 -85
- package/cypress/plugins/esbuild-istanbul.ts +0 -50
- package/cypress/plugins/tsCompile.ts +0 -34
- package/cypress/support/commands.ts +0 -37
- package/cypress/support/e2e.ts +0 -21
- package/cypress/support/index.js +0 -22
- package/cypress.config.ts +0 -30
- /package/{cypress → test}/fixtures/custom-elem.js +0 -0
package/dist/shorty.mjs
CHANGED
|
@@ -129,12 +129,13 @@ const pe = "aria-checked", me = "aria-description", fe = "aria-describedby", ge
|
|
|
129
129
|
easingBackInOut: "cubic-bezier(0.68,-0.55,0.265,1.55)"
|
|
130
130
|
}, ln = "offsetHeight", dn = "offsetWidth", pn = "scrollHeight", mn = "scrollWidth", fn = "tabindex", jt = navigator.userAgentData, A = jt, { userAgent: qt } = navigator, S = qt, z = /iPhone|iPad|iPod|Android/i;
|
|
131
131
|
let O = !1;
|
|
132
|
+
/* istanbul ignore else @preserve */
|
|
132
133
|
A ? O = A.brands.some((t) => z.test(t.brand)) : O = z.test(S);
|
|
133
134
|
const gn = O, x = /(iPhone|iPod|iPad)/, vn = A ? A.brands.some((t) => x.test(t.brand)) : (
|
|
134
|
-
/* istanbul ignore next */
|
|
135
|
+
/* istanbul ignore next @preserve */
|
|
135
136
|
x.test(S)
|
|
136
137
|
), En = S ? S.includes("Firefox") : (
|
|
137
|
-
/* istanbul ignore next */
|
|
138
|
+
/* istanbul ignore next @preserve */
|
|
138
139
|
!1
|
|
139
140
|
), { head: N } = document, bn = ["webkitPerspective", "perspective"].some((t) => t in N.style), Gt = (t, e, n, o) => {
|
|
140
141
|
const s = o || !1;
|
|
@@ -144,6 +145,7 @@ const gn = O, x = /(iPhone|iPod|iPad)/, vn = A ? A.brands.some((t) => x.test(t.b
|
|
|
144
145
|
t.removeEventListener(e, n, s);
|
|
145
146
|
}, Kt = (t, e, n, o) => {
|
|
146
147
|
const s = (r) => {
|
|
148
|
+
/* istanbul ignore else @preserve */
|
|
147
149
|
(r.target === t || r.currentTarget === t) && (n.apply(t, [r]), Jt(t, e, s, o));
|
|
148
150
|
};
|
|
149
151
|
Gt(t, e, s, o);
|
|
@@ -247,13 +249,17 @@ const gn = O, x = /(iPhone|iPod|iPad)/, vn = A ? A.brands.some((t) => x.test(t.b
|
|
|
247
249
|
const o = new Event(D), s = te(t), r = _t(t);
|
|
248
250
|
if (s) {
|
|
249
251
|
const a = (l) => {
|
|
252
|
+
/* istanbul ignore else @preserve */
|
|
250
253
|
l.target === t && (e.apply(t, [l]), t.removeEventListener(D, a), n = 1);
|
|
251
254
|
};
|
|
252
255
|
t.addEventListener(D, a), setTimeout(() => {
|
|
256
|
+
/* istanbul ignore next @preserve */
|
|
253
257
|
n || Q(t, o);
|
|
254
258
|
}, s + r + 17);
|
|
255
|
-
} else
|
|
259
|
+
} else {
|
|
260
|
+
/* istanbul ignore next @preserve */
|
|
256
261
|
e.apply(t, [o]);
|
|
262
|
+
}
|
|
257
263
|
}, ee = (t) => {
|
|
258
264
|
const e = g(t, U), n = g(t, Qt), o = n.includes("ms") ? (
|
|
259
265
|
/* istanbul ignore next */
|
|
@@ -283,9 +289,11 @@ const gn = O, x = /(iPhone|iPod|iPad)/, vn = A ? A.brands.some((t) => x.test(t.b
|
|
|
283
289
|
const o = new Event(C), s = ne(t), r = ee(t);
|
|
284
290
|
if (s) {
|
|
285
291
|
const a = (l) => {
|
|
292
|
+
/* istanbul ignore else @preserve */
|
|
286
293
|
l.target === t && (e.apply(t, [l]), t.removeEventListener(C, a), n = 1);
|
|
287
294
|
};
|
|
288
295
|
t.addEventListener(C, a), setTimeout(() => {
|
|
296
|
+
/* istanbul ignore next @preserve */
|
|
289
297
|
n || Q(t, o);
|
|
290
298
|
}, s + r + 17);
|
|
291
299
|
} else
|
|
@@ -305,6 +313,7 @@ const gn = O, x = /(iPhone|iPod|iPad)/, vn = A ? A.brands.some((t) => x.test(t.b
|
|
|
305
313
|
cancelable: !0,
|
|
306
314
|
bubbles: !0
|
|
307
315
|
});
|
|
316
|
+
/* istanbul ignore else @preserve */
|
|
308
317
|
return v(e) && M(n, e), n;
|
|
309
318
|
}, Yn = { passive: !0 }, Zn = (t) => t.offsetHeight, $n = (t, e) => {
|
|
310
319
|
w(e).forEach(([n, o]) => {
|
|
@@ -386,6 +395,7 @@ T(t), re = (t) => {
|
|
|
386
395
|
return Math.round(e) !== o || Math.round(n) !== s;
|
|
387
396
|
}, co = (t, e, n) => {
|
|
388
397
|
const o = u(e), s = h(t, o && re(e)), r = { x: 0, y: 0 };
|
|
398
|
+
/* istanbul ignore else @preserve */
|
|
389
399
|
if (o) {
|
|
390
400
|
const a = h(e, !0);
|
|
391
401
|
r.x = a.x + e.clientLeft, r.y = a.y + e.clientTop;
|
|
@@ -430,7 +440,7 @@ const b = /* @__PURE__ */ new Map(), ae = (t, e) => {
|
|
|
430
440
|
}, Eo = (t) => v(t) && t.constructor.name === "WeakMap" || !1, bo = (t) => i(t) && ["SVG", "Image", "Video", "Canvas"].some((e) => t.constructor.name.includes(e)) || !1, ho = (t) => v(t) && t.constructor.name === "NodeList" || !1, yo = (t) => T(t).dir === "rtl", wo = (t) => i(t) && t.constructor.name.includes("SVG") || !1, Ao = (t) => i(t) && ["TABLE", "TD", "TH"].includes(t.nodeName) || !1, le = (t, e) => t ? t.closest(e) || // break out of `ShadowRoot`
|
|
431
441
|
le(t.getRootNode().host, e) : null, So = (t, e) => u(t) ? t : (i(e) ? e : d()).querySelector(t), de = (t, e) => (i(e) ? e : d()).getElementsByTagName(t), No = (t) => [...de("*", t)].filter(ue), ko = (t, e) => d(e).getElementById(t) || null, Mo = (t, e) => (i(e) ? e : d()).querySelectorAll(t), To = (t, e) => (e && i(e) ? e : d()).getElementsByClassName(
|
|
432
442
|
t
|
|
433
|
-
), Do = (t, e) => t.matches(e), Co = "2.0.
|
|
443
|
+
), Do = (t, e) => t.matches(e), Co = "2.0.4";
|
|
434
444
|
export {
|
|
435
445
|
Bn as ArrayFrom,
|
|
436
446
|
P as DOMContentLoadedEvent,
|