@splendidlabz/utils 1.11.1 → 1.11.3
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/CHANGELOG.md +12 -0
- package/package.json +2 -2
- package/src/dom/actions/masonry.js +1 -0
- package/src/lib/objects/omit-empty.js +1 -1
- package/src/lib/strings/markdown.spec.js +73 -0
- package/src/node/context.js +0 -0
- package/src/node/file-cache.js +1 -1
- package/src/node/pkce.js +1 -1
- package/tsup.config.mjs +19 -1
- package/dist/cjs/dom/accessibility.cjs +0 -51
- package/dist/cjs/dom/actions/index.cjs +0 -25
- package/dist/cjs/dom/actions/masonry.cjs +0 -60
- package/dist/cjs/dom/actions/prefer-horizontal-scroll.cjs +0 -113
- package/dist/cjs/dom/actions/sticky.cjs +0 -93
- package/dist/cjs/dom/bounding-box.cjs +0 -68
- package/dist/cjs/dom/clipboard.cjs +0 -35
- package/dist/cjs/dom/cookie.cjs +0 -55
- package/dist/cjs/dom/css-vars.cjs +0 -47
- package/dist/cjs/dom/events.cjs +0 -57
- package/dist/cjs/dom/focusable.cjs +0 -141
- package/dist/cjs/dom/font-size.cjs +0 -68
- package/dist/cjs/dom/get-element.cjs +0 -96
- package/dist/cjs/dom/hash.cjs +0 -33
- package/dist/cjs/dom/index.cjs +0 -65
- package/dist/cjs/dom/keyboard.cjs +0 -49
- package/dist/cjs/dom/local-store.cjs +0 -77
- package/dist/cjs/dom/media.cjs +0 -57
- package/dist/cjs/dom/observers/index.cjs +0 -27
- package/dist/cjs/dom/observers/intersection-observer.cjs +0 -59
- package/dist/cjs/dom/observers/mutation-observer.cjs +0 -63
- package/dist/cjs/dom/observers/observer.cjs +0 -38
- package/dist/cjs/dom/observers/resize-observer.cjs +0 -52
- package/dist/cjs/dom/observers/scroll-observer.cjs +0 -118
- package/dist/cjs/dom/pkce.cjs +0 -43
- package/dist/cjs/dom/query-params.cjs +0 -36
- package/dist/cjs/dom/random-string.cjs +0 -36
- package/dist/cjs/dom/sanitize.cjs +0 -41
- package/dist/cjs/dom/session-store.cjs +0 -47
- package/dist/cjs/dom/spam-prevention.cjs +0 -48
- package/dist/cjs/dom/trap-focus.cjs +0 -75
- package/dist/cjs/dom/ui/aria-current.cjs +0 -41
- package/dist/cjs/dom/ui/inconsistent-button-fix.cjs +0 -33
- package/dist/cjs/dom/ui/index.cjs +0 -27
- package/dist/cjs/dom/ui/scroll-container.cjs +0 -45
- package/dist/cjs/dom/ui/traverse-and-scramble.cjs +0 -48
- package/dist/cjs/lib/arrays/index.cjs +0 -31
- package/dist/cjs/lib/arrays/item-position.cjs +0 -40
- package/dist/cjs/lib/arrays/join.cjs +0 -35
- package/dist/cjs/lib/arrays/shuffle.cjs +0 -40
- package/dist/cjs/lib/arrays/sort.cjs +0 -59
- package/dist/cjs/lib/arrays/split-array.cjs +0 -39
- package/dist/cjs/lib/arrays/unique.cjs +0 -29
- package/dist/cjs/lib/auth/index.cjs +0 -21
- package/dist/cjs/lib/auth/route-manager.cjs +0 -49
- package/dist/cjs/lib/checks.cjs +0 -61
- package/dist/cjs/lib/date/days.cjs +0 -35
- package/dist/cjs/lib/date/index.cjs +0 -25
- package/dist/cjs/lib/date/months.cjs +0 -100
- package/dist/cjs/lib/date/time.cjs +0 -105
- package/dist/cjs/lib/form/form-data.cjs +0 -81
- package/dist/cjs/lib/form/index.cjs +0 -23
- package/dist/cjs/lib/form/sanitize.cjs +0 -59
- package/dist/cjs/lib/functions/callback.cjs +0 -29
- package/dist/cjs/lib/functions/debounce.cjs +0 -41
- package/dist/cjs/lib/functions/env.cjs +0 -30
- package/dist/cjs/lib/functions/functional.cjs +0 -80
- package/dist/cjs/lib/functions/index.cjs +0 -29
- package/dist/cjs/lib/functions/throttle.cjs +0 -36
- package/dist/cjs/lib/functions/timeout.cjs +0 -39
- package/dist/cjs/lib/hash.cjs +0 -41
- package/dist/cjs/lib/index.cjs +0 -47
- package/dist/cjs/lib/numbers/index.cjs +0 -36
- package/dist/cjs/lib/numbers/math.cjs +0 -34
- package/dist/cjs/lib/objects/camelcase-keys.cjs +0 -39
- package/dist/cjs/lib/objects/empty.cjs +0 -37
- package/dist/cjs/lib/objects/equal.cjs +0 -45
- package/dist/cjs/lib/objects/extend.cjs +0 -36
- package/dist/cjs/lib/objects/flatten.cjs +0 -40
- package/dist/cjs/lib/objects/index.cjs +0 -45
- package/dist/cjs/lib/objects/json.cjs +0 -33
- package/dist/cjs/lib/objects/loop.cjs +0 -38
- package/dist/cjs/lib/objects/mix/mix.cjs +0 -113
- package/dist/cjs/lib/objects/nested-property.cjs +0 -43
- package/dist/cjs/lib/objects/normalize-object.cjs +0 -32
- package/dist/cjs/lib/objects/omit-empty.cjs +0 -38
- package/dist/cjs/lib/objects/size.cjs +0 -61
- package/dist/cjs/lib/objects/split.cjs +0 -37
- package/dist/cjs/lib/promises/index.cjs +0 -21
- package/dist/cjs/lib/promises/reject.cjs +0 -50
- package/dist/cjs/lib/sse.cjs +0 -74
- package/dist/cjs/lib/strings/convert-case/convert-case.cjs +0 -94
- package/dist/cjs/lib/strings/index.cjs +0 -29
- package/dist/cjs/lib/strings/markdown.cjs +0 -74
- package/dist/cjs/lib/strings/name.cjs +0 -44
- package/dist/cjs/lib/strings/pluralize.cjs +0 -38
- package/dist/cjs/lib/strings/query-string.cjs +0 -41
- package/dist/cjs/lib/style/index.cjs +0 -35
- package/dist/cjs/lib/symbols/index.cjs +0 -21
- package/dist/cjs/lib/symbols/symbols.cjs +0 -36
- package/dist/cjs/node/dirname.cjs +0 -47
- package/dist/cjs/node/file-cache.cjs +0 -158
- package/dist/cjs/node/file.cjs +0 -48
- package/dist/cjs/node/hash.cjs +0 -40
- package/dist/cjs/node/index.cjs +0 -33
- package/dist/cjs/node/pkce.cjs +0 -52
- package/dist/cjs/node/random-string.cjs +0 -41
- package/dist/cjs/node/sanitize.cjs +0 -41
- package/dist/cjs/node/uuid.cjs +0 -40
- package/dist/esm/dom/accessibility.js +0 -26
- package/dist/esm/dom/actions/index.js +0 -3
- package/dist/esm/dom/actions/masonry.js +0 -37
- package/dist/esm/dom/actions/prefer-horizontal-scroll.js +0 -90
- package/dist/esm/dom/actions/sticky.js +0 -70
- package/dist/esm/dom/bounding-box.js +0 -44
- package/dist/esm/dom/clipboard.js +0 -12
- package/dist/esm/dom/cookie.js +0 -31
- package/dist/esm/dom/css-vars.js +0 -21
- package/dist/esm/dom/events.js +0 -31
- package/dist/esm/dom/focusable.js +0 -117
- package/dist/esm/dom/font-size.js +0 -40
- package/dist/esm/dom/get-element.js +0 -66
- package/dist/esm/dom/hash.js +0 -10
- package/dist/esm/dom/index.js +0 -23
- package/dist/esm/dom/keyboard.js +0 -22
- package/dist/esm/dom/local-store.js +0 -54
- package/dist/esm/dom/media.js +0 -32
- package/dist/esm/dom/observers/index.js +0 -4
- package/dist/esm/dom/observers/intersection-observer.js +0 -36
- package/dist/esm/dom/observers/mutation-observer.js +0 -40
- package/dist/esm/dom/observers/observer.js +0 -15
- package/dist/esm/dom/observers/resize-observer.js +0 -29
- package/dist/esm/dom/observers/scroll-observer.js +0 -95
- package/dist/esm/dom/pkce.js +0 -20
- package/dist/esm/dom/query-params.js +0 -13
- package/dist/esm/dom/random-string.js +0 -12
- package/dist/esm/dom/sanitize.js +0 -8
- package/dist/esm/dom/session-store.js +0 -24
- package/dist/esm/dom/spam-prevention.js +0 -25
- package/dist/esm/dom/trap-focus.js +0 -51
- package/dist/esm/dom/ui/aria-current.js +0 -17
- package/dist/esm/dom/ui/inconsistent-button-fix.js +0 -10
- package/dist/esm/dom/ui/index.js +0 -4
- package/dist/esm/dom/ui/scroll-container.js +0 -22
- package/dist/esm/dom/ui/traverse-and-scramble.js +0 -25
- package/dist/esm/lib/arrays/index.js +0 -6
- package/dist/esm/lib/arrays/item-position.js +0 -15
- package/dist/esm/lib/arrays/join.js +0 -12
- package/dist/esm/lib/arrays/shuffle.js +0 -17
- package/dist/esm/lib/arrays/sort.js +0 -36
- package/dist/esm/lib/arrays/split-array.js +0 -16
- package/dist/esm/lib/arrays/unique.js +0 -6
- package/dist/esm/lib/auth/index.js +0 -1
- package/dist/esm/lib/auth/route-manager.js +0 -25
- package/dist/esm/lib/checks.js +0 -34
- package/dist/esm/lib/date/days.js +0 -12
- package/dist/esm/lib/date/index.js +0 -3
- package/dist/esm/lib/date/months.js +0 -77
- package/dist/esm/lib/date/time.js +0 -75
- package/dist/esm/lib/form/form-data.js +0 -57
- package/dist/esm/lib/form/index.js +0 -2
- package/dist/esm/lib/form/sanitize.js +0 -34
- package/dist/esm/lib/functions/callback.js +0 -6
- package/dist/esm/lib/functions/debounce.js +0 -18
- package/dist/esm/lib/functions/env.js +0 -7
- package/dist/esm/lib/functions/functional.js +0 -52
- package/dist/esm/lib/functions/index.js +0 -5
- package/dist/esm/lib/functions/throttle.js +0 -13
- package/dist/esm/lib/functions/timeout.js +0 -14
- package/dist/esm/lib/hash.js +0 -18
- package/dist/esm/lib/index.js +0 -14
- package/dist/esm/lib/numbers/index.js +0 -11
- package/dist/esm/lib/numbers/math.js +0 -10
- package/dist/esm/lib/objects/camelcase-keys.js +0 -16
- package/dist/esm/lib/objects/empty.js +0 -13
- package/dist/esm/lib/objects/equal.js +0 -11
- package/dist/esm/lib/objects/extend.js +0 -13
- package/dist/esm/lib/objects/flatten.js +0 -17
- package/dist/esm/lib/objects/index.js +0 -13
- package/dist/esm/lib/objects/json.js +0 -10
- package/dist/esm/lib/objects/loop.js +0 -14
- package/dist/esm/lib/objects/mix/mix.js +0 -88
- package/dist/esm/lib/objects/nested-property.js +0 -18
- package/dist/esm/lib/objects/normalize-object.js +0 -9
- package/dist/esm/lib/objects/omit-empty.js +0 -15
- package/dist/esm/lib/objects/size.js +0 -38
- package/dist/esm/lib/objects/split.js +0 -14
- package/dist/esm/lib/promises/index.js +0 -1
- package/dist/esm/lib/promises/reject.js +0 -17
- package/dist/esm/lib/sse.js +0 -50
- package/dist/esm/lib/strings/convert-case/convert-case.js +0 -64
- package/dist/esm/lib/strings/index.js +0 -5
- package/dist/esm/lib/strings/markdown.js +0 -40
- package/dist/esm/lib/strings/name.js +0 -21
- package/dist/esm/lib/strings/pluralize.js +0 -5
- package/dist/esm/lib/strings/query-string.js +0 -16
- package/dist/esm/lib/style/index.js +0 -12
- package/dist/esm/lib/symbols/index.js +0 -1
- package/dist/esm/lib/symbols/symbols.js +0 -12
- package/dist/esm/node/dirname.js +0 -13
- package/dist/esm/node/file-cache.js +0 -121
- package/dist/esm/node/file.js +0 -14
- package/dist/esm/node/hash.js +0 -7
- package/dist/esm/node/index.js +0 -7
- package/dist/esm/node/pkce.js +0 -19
- package/dist/esm/node/random-string.js +0 -8
- package/dist/esm/node/sanitize.js +0 -8
- package/dist/esm/node/uuid.js +0 -7
- package/dist/types/dom/accessibility.d.cts +0 -30
- package/dist/types/dom/actions/index.d.cts +0 -3
- package/dist/types/dom/actions/masonry.d.cts +0 -5
- package/dist/types/dom/actions/prefer-horizontal-scroll.d.cts +0 -5
- package/dist/types/dom/actions/sticky.d.cts +0 -5
- package/dist/types/dom/bounding-box.d.cts +0 -41
- package/dist/types/dom/clipboard.d.cts +0 -7
- package/dist/types/dom/cookie.d.cts +0 -7
- package/dist/types/dom/css-vars.d.cts +0 -6
- package/dist/types/dom/events.d.cts +0 -92
- package/dist/types/dom/focusable.d.cts +0 -78
- package/dist/types/dom/font-size.d.cts +0 -8
- package/dist/types/dom/get-element.d.cts +0 -102
- package/dist/types/dom/hash.d.cts +0 -3
- package/dist/types/dom/index.d.cts +0 -31
- package/dist/types/dom/keyboard.d.cts +0 -32
- package/dist/types/dom/local-store.d.cts +0 -31
- package/dist/types/dom/media.d.cts +0 -5
- package/dist/types/dom/observers/index.d.cts +0 -4
- package/dist/types/dom/observers/intersection-observer.d.cts +0 -10
- package/dist/types/dom/observers/mutation-observer.d.cts +0 -9
- package/dist/types/dom/observers/observer.d.cts +0 -3
- package/dist/types/dom/observers/resize-observer.d.cts +0 -40
- package/dist/types/dom/observers/scroll-observer.d.cts +0 -40
- package/dist/types/dom/pkce.d.cts +0 -8
- package/dist/types/dom/query-params.d.cts +0 -6
- package/dist/types/dom/random-string.d.cts +0 -9
- package/dist/types/dom/sanitize.d.cts +0 -10
- package/dist/types/dom/session-store.d.cts +0 -7
- package/dist/types/dom/spam-prevention.d.cts +0 -14
- package/dist/types/dom/trap-focus.d.cts +0 -32
- package/dist/types/dom/ui/aria-current.d.cts +0 -7
- package/dist/types/dom/ui/inconsistent-button-fix.d.cts +0 -14
- package/dist/types/dom/ui/index.d.cts +0 -4
- package/dist/types/dom/ui/scroll-container.d.cts +0 -3
- package/dist/types/dom/ui/traverse-and-scramble.d.cts +0 -21
- package/dist/types/lib/arrays/index.d.cts +0 -6
- package/dist/types/lib/arrays/item-position.d.cts +0 -16
- package/dist/types/lib/arrays/join.d.cts +0 -15
- package/dist/types/lib/arrays/shuffle.d.cts +0 -3
- package/dist/types/lib/arrays/sort.d.cts +0 -32
- package/dist/types/lib/arrays/split-array.d.cts +0 -6
- package/dist/types/lib/arrays/unique.d.cts +0 -3
- package/dist/types/lib/auth/index.d.cts +0 -1
- package/dist/types/lib/auth/route-manager.d.cts +0 -28
- package/dist/types/lib/checks.d.cts +0 -33
- package/dist/types/lib/date/days.d.cts +0 -7
- package/dist/types/lib/date/index.d.cts +0 -3
- package/dist/types/lib/date/months.d.cts +0 -11
- package/dist/types/lib/date/time.d.cts +0 -21
- package/dist/types/lib/form/form-data.d.cts +0 -9
- package/dist/types/lib/form/index.d.cts +0 -2
- package/dist/types/lib/form/sanitize.d.cts +0 -60
- package/dist/types/lib/functions/callback.d.cts +0 -8
- package/dist/types/lib/functions/debounce.d.cts +0 -3
- package/dist/types/lib/functions/env.d.cts +0 -3
- package/dist/types/lib/functions/functional.d.cts +0 -72
- package/dist/types/lib/functions/index.d.cts +0 -5
- package/dist/types/lib/functions/throttle.d.cts +0 -3
- package/dist/types/lib/functions/timeout.d.cts +0 -5
- package/dist/types/lib/hash.d.cts +0 -3
- package/dist/types/lib/index.d.cts +0 -43
- package/dist/types/lib/numbers/index.d.cts +0 -5
- package/dist/types/lib/numbers/math.d.cts +0 -4
- package/dist/types/lib/objects/camelcase-keys.d.cts +0 -3
- package/dist/types/lib/objects/empty.d.cts +0 -4
- package/dist/types/lib/objects/equal.d.cts +0 -4
- package/dist/types/lib/objects/extend.d.cts +0 -6
- package/dist/types/lib/objects/flatten.d.cts +0 -6
- package/dist/types/lib/objects/index.d.cts +0 -13
- package/dist/types/lib/objects/json.d.cts +0 -3
- package/dist/types/lib/objects/loop.d.cts +0 -4
- package/dist/types/lib/objects/mix/mix.d.cts +0 -44
- package/dist/types/lib/objects/nested-property.d.cts +0 -24
- package/dist/types/lib/objects/normalize-object.d.cts +0 -3
- package/dist/types/lib/objects/omit-empty.d.cts +0 -3
- package/dist/types/lib/objects/size.d.cts +0 -3
- package/dist/types/lib/objects/split.d.cts +0 -14
- package/dist/types/lib/promises/index.d.cts +0 -1
- package/dist/types/lib/promises/reject.d.cts +0 -5
- package/dist/types/lib/sse.d.cts +0 -18
- package/dist/types/lib/strings/convert-case/convert-case.d.cts +0 -10
- package/dist/types/lib/strings/index.d.cts +0 -5
- package/dist/types/lib/strings/markdown.d.cts +0 -25
- package/dist/types/lib/strings/name.d.cts +0 -7
- package/dist/types/lib/strings/pluralize.d.cts +0 -3
- package/dist/types/lib/strings/query-string.d.cts +0 -10
- package/dist/types/lib/style/index.d.cts +0 -3
- package/dist/types/lib/symbols/index.d.cts +0 -1
- package/dist/types/lib/symbols/symbols.d.cts +0 -4
- package/dist/types/node/dirname.d.cts +0 -9
- package/dist/types/node/file-cache.d.cts +0 -56
- package/dist/types/node/file.d.cts +0 -4
- package/dist/types/node/hash.d.cts +0 -3
- package/dist/types/node/index.d.cts +0 -7
- package/dist/types/node/pkce.d.cts +0 -8
- package/dist/types/node/random-string.d.cts +0 -3
- package/dist/types/node/sanitize.d.cts +0 -10
- package/dist/types/node/uuid.d.cts +0 -3
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var css_vars_exports = {};
|
|
19
|
-
__export(css_vars_exports, {
|
|
20
|
-
getCSSValue: () => getCSSValue,
|
|
21
|
-
getCSSVar: () => getCSSVar,
|
|
22
|
-
setCSSValue: () => setCSSValue,
|
|
23
|
-
setCSSVar: () => setCSSVar
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(css_vars_exports);
|
|
26
|
-
var import_get_element = require("./get-element.js");
|
|
27
|
-
function getCSSValue(element, prop) {
|
|
28
|
-
return getCSSVar(element, prop);
|
|
29
|
-
}
|
|
30
|
-
function setCSSValue(element, prop, value) {
|
|
31
|
-
setCSSVar(element, prop, value);
|
|
32
|
-
}
|
|
33
|
-
function getCSSVar(element, prop) {
|
|
34
|
-
element = (0, import_get_element.getElement)(element);
|
|
35
|
-
return getComputedStyle(element).getPropertyValue(prop);
|
|
36
|
-
}
|
|
37
|
-
function setCSSVar(element, prop, value) {
|
|
38
|
-
element = (0, import_get_element.getElement)(element);
|
|
39
|
-
element.style.setProperty(prop, value);
|
|
40
|
-
}
|
|
41
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
-
0 && (module.exports = {
|
|
43
|
-
getCSSValue,
|
|
44
|
-
getCSSVar,
|
|
45
|
-
setCSSValue,
|
|
46
|
-
setCSSVar
|
|
47
|
-
});
|
package/dist/cjs/dom/events.cjs
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var events_exports = {};
|
|
19
|
-
__export(events_exports, {
|
|
20
|
-
addListeners: () => addListeners,
|
|
21
|
-
dispatchEvent: () => dispatchEvent,
|
|
22
|
-
removeListeners: () => removeListeners,
|
|
23
|
-
updateEvent: () => updateEvent
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(events_exports);
|
|
26
|
-
function addListeners(listeners) {
|
|
27
|
-
listeners.forEach(({ node, event, handler }) => {
|
|
28
|
-
node.addEventListener(event, handler);
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
function removeListeners(listeners) {
|
|
32
|
-
listeners.forEach(({ node, event, handler }) => {
|
|
33
|
-
node.removeEventListener(event, handler);
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
function dispatchEvent(node, eventName, detail, options = {}) {
|
|
37
|
-
node.dispatchEvent(
|
|
38
|
-
new CustomEvent(eventName, {
|
|
39
|
-
...options,
|
|
40
|
-
detail
|
|
41
|
-
})
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
function updateEvent(event, updates) {
|
|
45
|
-
const { type, ...rest } = event;
|
|
46
|
-
return new CustomEvent(event.type, {
|
|
47
|
-
...rest,
|
|
48
|
-
...updates
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
52
|
-
0 && (module.exports = {
|
|
53
|
-
addListeners,
|
|
54
|
-
dispatchEvent,
|
|
55
|
-
removeListeners,
|
|
56
|
-
updateEvent
|
|
57
|
-
});
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var focusable_exports = {};
|
|
19
|
-
__export(focusable_exports, {
|
|
20
|
-
Focusable: () => Focusable,
|
|
21
|
-
getFocusableElements: () => getFocusableElements
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(focusable_exports);
|
|
24
|
-
function getFocusableElements(container = document.body) {
|
|
25
|
-
return {
|
|
26
|
-
/**
|
|
27
|
-
* Gets the number of keyboard focusable elements.
|
|
28
|
-
* This is useful for checking if there are any focusable elements
|
|
29
|
-
* before attempting to focus them.
|
|
30
|
-
*
|
|
31
|
-
* @returns {number} The number of keyboard focusable elements
|
|
32
|
-
*/
|
|
33
|
-
get length() {
|
|
34
|
-
return this.keyboard.length;
|
|
35
|
-
},
|
|
36
|
-
/**
|
|
37
|
-
* Gets all focusable elements within the container that are visible and enabled.
|
|
38
|
-
* This includes elements that can be focused via mouse or programmatically,
|
|
39
|
-
* but may not be keyboard focusable.
|
|
40
|
-
*
|
|
41
|
-
* Elements are considered focusable if they:
|
|
42
|
-
* - Are not disabled
|
|
43
|
-
* - Are not hidden
|
|
44
|
-
* - Are not display:none
|
|
45
|
-
*
|
|
46
|
-
* @returns {HTMLElement[]} Array of focusable elements that are visible and enabled
|
|
47
|
-
*/
|
|
48
|
-
get all() {
|
|
49
|
-
const elements = Array.from(
|
|
50
|
-
container.querySelectorAll(
|
|
51
|
-
`a,
|
|
52
|
-
button,
|
|
53
|
-
input,
|
|
54
|
-
textarea,
|
|
55
|
-
select,
|
|
56
|
-
details,
|
|
57
|
-
iframe,
|
|
58
|
-
embed,
|
|
59
|
-
object,
|
|
60
|
-
summary,
|
|
61
|
-
dialog,
|
|
62
|
-
audio[controls],
|
|
63
|
-
video[controls],
|
|
64
|
-
[contenteditable],
|
|
65
|
-
[tabindex]
|
|
66
|
-
`
|
|
67
|
-
)
|
|
68
|
-
);
|
|
69
|
-
return elements.filter((el) => {
|
|
70
|
-
if (el.hasAttribute("disabled")) return false;
|
|
71
|
-
if (el.hasAttribute("hidden")) return false;
|
|
72
|
-
if (window.getComputedStyle(el).display === "none") return false;
|
|
73
|
-
return true;
|
|
74
|
-
});
|
|
75
|
-
},
|
|
76
|
-
/**
|
|
77
|
-
* Gets elements that can be focused via keyboard (tabIndex > -1).
|
|
78
|
-
* These are the elements that will be focused when using the Tab key.
|
|
79
|
-
*
|
|
80
|
-
* @returns {HTMLElement[]} Array of keyboard focusable elements
|
|
81
|
-
*/
|
|
82
|
-
get keyboard() {
|
|
83
|
-
return this.all.filter((el) => el instanceof HTMLElement && el.tabIndex > -1);
|
|
84
|
-
},
|
|
85
|
-
/**
|
|
86
|
-
* Alias for keyboard focusable elements.
|
|
87
|
-
* This is provided for semantic clarity in certain contexts.
|
|
88
|
-
*
|
|
89
|
-
* @returns {HTMLElement[]} Array of keyboard focusable elements
|
|
90
|
-
*/
|
|
91
|
-
get keyboardOnly() {
|
|
92
|
-
return this.keyboard;
|
|
93
|
-
},
|
|
94
|
-
/**
|
|
95
|
-
* Gets the first keyboard focusable element.
|
|
96
|
-
* This is useful for setting initial focus when opening a modal or dialog.
|
|
97
|
-
*
|
|
98
|
-
* @returns {HTMLElement|null} The first focusable element or null if none exist
|
|
99
|
-
*/
|
|
100
|
-
get first() {
|
|
101
|
-
return this.keyboard[0] || null;
|
|
102
|
-
},
|
|
103
|
-
/**
|
|
104
|
-
* Gets the last keyboard focusable element.
|
|
105
|
-
* This is useful for focus trapping when using Shift+Tab.
|
|
106
|
-
*
|
|
107
|
-
* @returns {HTMLElement|null} The last focusable element or null if none exist
|
|
108
|
-
*/
|
|
109
|
-
get last() {
|
|
110
|
-
return this.keyboard[this.length - 1] || null;
|
|
111
|
-
},
|
|
112
|
-
/**
|
|
113
|
-
* Gets the next focusable element after the given index.
|
|
114
|
-
* This is useful for implementing custom tab order or focus management.
|
|
115
|
-
*
|
|
116
|
-
* @param {number} index - The current element's index in the keyboard focusable array
|
|
117
|
-
* @returns {HTMLElement|null} The next focusable element or null if none exists
|
|
118
|
-
*/
|
|
119
|
-
next(index) {
|
|
120
|
-
return this.keyboard[index + 1] || null;
|
|
121
|
-
},
|
|
122
|
-
/**
|
|
123
|
-
* Gets the previous focusable element before the given index.
|
|
124
|
-
* This is useful for implementing custom tab order or focus management.
|
|
125
|
-
*
|
|
126
|
-
* @param {number} index - The current element's index in the keyboard focusable array
|
|
127
|
-
* @returns {HTMLElement|null} The previous focusable element or null if none exists
|
|
128
|
-
*/
|
|
129
|
-
prev(index) {
|
|
130
|
-
return this.keyboard[index - 1] || null;
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
function Focusable(container = document.body) {
|
|
135
|
-
return getFocusableElements(container);
|
|
136
|
-
}
|
|
137
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
138
|
-
0 && (module.exports = {
|
|
139
|
-
Focusable,
|
|
140
|
-
getFocusableElements
|
|
141
|
-
});
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var font_size_exports = {};
|
|
19
|
-
__export(font_size_exports, {
|
|
20
|
-
em: () => em,
|
|
21
|
-
getUnit: () => getUnit,
|
|
22
|
-
lh: () => lh,
|
|
23
|
-
rem: () => rem,
|
|
24
|
-
rlh: () => rlh,
|
|
25
|
-
toPx: () => toPx
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(font_size_exports);
|
|
28
|
-
var import_numbers = require("../lib/numbers/index.js");
|
|
29
|
-
function getUnit(value) {
|
|
30
|
-
const [, unit] = (0, import_numbers.splitUnit)(value);
|
|
31
|
-
return unit;
|
|
32
|
-
}
|
|
33
|
-
function rem(multiple = 1) {
|
|
34
|
-
const value = parseFloat(getComputedStyle(document.body)["font-size"]);
|
|
35
|
-
return Math.round(value * multiple);
|
|
36
|
-
}
|
|
37
|
-
function em(element = document.body, multiple = 1) {
|
|
38
|
-
const value = parseFloat(getComputedStyle(element)["font-size"]);
|
|
39
|
-
return Math.round(value * multiple);
|
|
40
|
-
}
|
|
41
|
-
function rlh(multiple = 1) {
|
|
42
|
-
const lineHeight = parseFloat(getComputedStyle(document.body)["line-height"]);
|
|
43
|
-
return Math.round(lineHeight * multiple);
|
|
44
|
-
}
|
|
45
|
-
function lh(element = document.body, multiple = 1) {
|
|
46
|
-
const lineHeight = getComputedStyle(element)["line-height"];
|
|
47
|
-
const value = parseFloat(lineHeight);
|
|
48
|
-
return Math.round(value * multiple);
|
|
49
|
-
}
|
|
50
|
-
function toPx(value, element = null) {
|
|
51
|
-
const [numeric, unit] = (0, import_numbers.splitUnit)(value);
|
|
52
|
-
let finalValue = 0;
|
|
53
|
-
if (unit === "rem") finalValue = rem(numeric);
|
|
54
|
-
if (unit === "em") finalValue = em(element, numeric);
|
|
55
|
-
if (unit === "lh") finalValue = lh(element, numeric);
|
|
56
|
-
if (unit === "px") finalValue = numeric;
|
|
57
|
-
if (!unit) finalValue = numeric;
|
|
58
|
-
return finalValue;
|
|
59
|
-
}
|
|
60
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
61
|
-
0 && (module.exports = {
|
|
62
|
-
em,
|
|
63
|
-
getUnit,
|
|
64
|
-
lh,
|
|
65
|
-
rem,
|
|
66
|
-
rlh,
|
|
67
|
-
toPx
|
|
68
|
-
});
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var get_element_exports = {};
|
|
19
|
-
__export(get_element_exports, {
|
|
20
|
-
getAncestorWithSiblings: () => getAncestorWithSiblings,
|
|
21
|
-
getChildrenElements: () => getChildrenElements,
|
|
22
|
-
getElement: () => getElement,
|
|
23
|
-
getNodeType: () => getNodeType,
|
|
24
|
-
getParentElement: () => getParentElement,
|
|
25
|
-
getSelfIndex: () => getSelfIndex,
|
|
26
|
-
getSiblingElements: () => getSiblingElements,
|
|
27
|
-
isAncestor: () => isAncestor
|
|
28
|
-
});
|
|
29
|
-
module.exports = __toCommonJS(get_element_exports);
|
|
30
|
-
const astroNodes = ["ASTRO-SLOT", "ASTRO-ISLAND"];
|
|
31
|
-
function getNodeType(node) {
|
|
32
|
-
if (node instanceof Element) return "element";
|
|
33
|
-
if (node instanceof NodeList) return "nodelist";
|
|
34
|
-
if (Array.isArray(node)) return "array";
|
|
35
|
-
}
|
|
36
|
-
function getElement(selector) {
|
|
37
|
-
if (!selector) return;
|
|
38
|
-
if (selector instanceof Element) return selector;
|
|
39
|
-
return document.querySelector(selector);
|
|
40
|
-
}
|
|
41
|
-
function getChildrenElements(node) {
|
|
42
|
-
let children = node.children;
|
|
43
|
-
if (children[0]?.nodeName === "ASTRO-SLOT") children = children[0].children;
|
|
44
|
-
return Array.from(children);
|
|
45
|
-
}
|
|
46
|
-
function getParentElement(element) {
|
|
47
|
-
const parent = element.parentElement;
|
|
48
|
-
if (astroNodes.includes(parent.nodeName)) return getParentElement(parent);
|
|
49
|
-
return parent;
|
|
50
|
-
}
|
|
51
|
-
function getSiblingElements(element) {
|
|
52
|
-
return Array.from(element.parentElement.children).filter(
|
|
53
|
-
(child) => child !== element
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
function getSelfIndex(element) {
|
|
57
|
-
return Array.from(element.parentElement.children).indexOf(element);
|
|
58
|
-
}
|
|
59
|
-
function isAncestor(ancestor, element, { searchLevels = 0 } = {}) {
|
|
60
|
-
if (ancestor === element) return true;
|
|
61
|
-
let parent = element.parentElement;
|
|
62
|
-
if (searchLevels === 0) {
|
|
63
|
-
while (parent) {
|
|
64
|
-
if (ancestor === parent) return true;
|
|
65
|
-
parent = parent.parentElement;
|
|
66
|
-
}
|
|
67
|
-
} else {
|
|
68
|
-
for (let i = 0; i < searchLevels; i++) {
|
|
69
|
-
if (ancestor === parent) return true;
|
|
70
|
-
parent = parent.parentElement;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return false;
|
|
74
|
-
}
|
|
75
|
-
function getAncestorWithSiblings(element, { limit = false } = {}) {
|
|
76
|
-
const ancestor = element.parentElement;
|
|
77
|
-
const siblings = getSiblingElements(ancestor);
|
|
78
|
-
if (siblings.length) return siblings;
|
|
79
|
-
if (!ancestor) return null;
|
|
80
|
-
if (limit === false) return getAncestorWithSiblings(ancestor);
|
|
81
|
-
if (typeof limit === "number" && limit > 0) {
|
|
82
|
-
return getAncestorWithSiblings(ancestor, { limit: limit - 1 });
|
|
83
|
-
}
|
|
84
|
-
if (limit === 0) return null;
|
|
85
|
-
}
|
|
86
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
87
|
-
0 && (module.exports = {
|
|
88
|
-
getAncestorWithSiblings,
|
|
89
|
-
getChildrenElements,
|
|
90
|
-
getElement,
|
|
91
|
-
getNodeType,
|
|
92
|
-
getParentElement,
|
|
93
|
-
getSelfIndex,
|
|
94
|
-
getSiblingElements,
|
|
95
|
-
isAncestor
|
|
96
|
-
});
|
package/dist/cjs/dom/hash.cjs
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var hash_exports = {};
|
|
19
|
-
__export(hash_exports, {
|
|
20
|
-
sha256Hash: () => sha256Hash
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(hash_exports);
|
|
23
|
-
async function sha256Hash(string) {
|
|
24
|
-
const utf8 = new TextEncoder().encode(string);
|
|
25
|
-
const hashBuffer = await crypto.subtle.digest("SHA-256", utf8);
|
|
26
|
-
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
|
27
|
-
const hashHex = hashArray.map((bytes) => bytes.toString(16).padStart(2, "0")).join("");
|
|
28
|
-
return hashHex;
|
|
29
|
-
}
|
|
30
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
-
0 && (module.exports = {
|
|
32
|
-
sha256Hash
|
|
33
|
-
});
|
package/dist/cjs/dom/index.cjs
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
-
for (let key of __getOwnPropNames(from))
|
|
8
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
-
}
|
|
11
|
-
return to;
|
|
12
|
-
};
|
|
13
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
var dom_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(dom_exports);
|
|
17
|
-
__reExport(dom_exports, require("./accessibility.js"), module.exports);
|
|
18
|
-
__reExport(dom_exports, require("./actions/index.js"), module.exports);
|
|
19
|
-
__reExport(dom_exports, require("./bounding-box.js"), module.exports);
|
|
20
|
-
__reExport(dom_exports, require("./clipboard.js"), module.exports);
|
|
21
|
-
__reExport(dom_exports, require("./cookie.js"), module.exports);
|
|
22
|
-
__reExport(dom_exports, require("./css-vars.js"), module.exports);
|
|
23
|
-
__reExport(dom_exports, require("./events.js"), module.exports);
|
|
24
|
-
__reExport(dom_exports, require("./focusable.js"), module.exports);
|
|
25
|
-
__reExport(dom_exports, require("./font-size.js"), module.exports);
|
|
26
|
-
__reExport(dom_exports, require("./get-element.js"), module.exports);
|
|
27
|
-
__reExport(dom_exports, require("./hash.js"), module.exports);
|
|
28
|
-
__reExport(dom_exports, require("./keyboard.js"), module.exports);
|
|
29
|
-
__reExport(dom_exports, require("./local-store.js"), module.exports);
|
|
30
|
-
__reExport(dom_exports, require("./media.js"), module.exports);
|
|
31
|
-
__reExport(dom_exports, require("./observers/index.js"), module.exports);
|
|
32
|
-
__reExport(dom_exports, require("./pkce.js"), module.exports);
|
|
33
|
-
__reExport(dom_exports, require("./query-params.js"), module.exports);
|
|
34
|
-
__reExport(dom_exports, require("./random-string.js"), module.exports);
|
|
35
|
-
__reExport(dom_exports, require("./sanitize.js"), module.exports);
|
|
36
|
-
__reExport(dom_exports, require("./session-store.js"), module.exports);
|
|
37
|
-
__reExport(dom_exports, require("./spam-prevention.js"), module.exports);
|
|
38
|
-
__reExport(dom_exports, require("./trap-focus.js"), module.exports);
|
|
39
|
-
__reExport(dom_exports, require("./ui/index.js"), module.exports);
|
|
40
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
-
0 && (module.exports = {
|
|
42
|
-
...require("./accessibility.js"),
|
|
43
|
-
...require("./actions/index.js"),
|
|
44
|
-
...require("./bounding-box.js"),
|
|
45
|
-
...require("./clipboard.js"),
|
|
46
|
-
...require("./cookie.js"),
|
|
47
|
-
...require("./css-vars.js"),
|
|
48
|
-
...require("./events.js"),
|
|
49
|
-
...require("./focusable.js"),
|
|
50
|
-
...require("./font-size.js"),
|
|
51
|
-
...require("./get-element.js"),
|
|
52
|
-
...require("./hash.js"),
|
|
53
|
-
...require("./keyboard.js"),
|
|
54
|
-
...require("./local-store.js"),
|
|
55
|
-
...require("./media.js"),
|
|
56
|
-
...require("./observers/index.js"),
|
|
57
|
-
...require("./pkce.js"),
|
|
58
|
-
...require("./query-params.js"),
|
|
59
|
-
...require("./random-string.js"),
|
|
60
|
-
...require("./sanitize.js"),
|
|
61
|
-
...require("./session-store.js"),
|
|
62
|
-
...require("./spam-prevention.js"),
|
|
63
|
-
...require("./trap-focus.js"),
|
|
64
|
-
...require("./ui/index.js")
|
|
65
|
-
});
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var keyboard_exports = {};
|
|
19
|
-
__export(keyboard_exports, {
|
|
20
|
-
isArrowKey: () => isArrowKey,
|
|
21
|
-
isEscapeKey: () => isEscapeKey,
|
|
22
|
-
isShiftTab: () => isShiftTab,
|
|
23
|
-
isTab: () => isTab,
|
|
24
|
-
isTabKey: () => isTabKey
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(keyboard_exports);
|
|
27
|
-
function isTab(event) {
|
|
28
|
-
return !event.shiftKey && event.key === "Tab";
|
|
29
|
-
}
|
|
30
|
-
function isShiftTab(event) {
|
|
31
|
-
return event.shiftKey && event.key === "Tab";
|
|
32
|
-
}
|
|
33
|
-
function isTabKey(key) {
|
|
34
|
-
return key === "Tab";
|
|
35
|
-
}
|
|
36
|
-
function isArrowKey(key) {
|
|
37
|
-
return ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(key);
|
|
38
|
-
}
|
|
39
|
-
function isEscapeKey(key) {
|
|
40
|
-
return key === "Escape";
|
|
41
|
-
}
|
|
42
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
43
|
-
0 && (module.exports = {
|
|
44
|
-
isArrowKey,
|
|
45
|
-
isEscapeKey,
|
|
46
|
-
isShiftTab,
|
|
47
|
-
isTab,
|
|
48
|
-
isTabKey
|
|
49
|
-
});
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var local_store_exports = {};
|
|
19
|
-
__export(local_store_exports, {
|
|
20
|
-
localStore: () => localStore
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(local_store_exports);
|
|
23
|
-
const localStore = {
|
|
24
|
-
/**
|
|
25
|
-
* Retrieves a value from localStorage
|
|
26
|
-
* @param {string} key - The key to retrieve from localStorage
|
|
27
|
-
* @returns {any} The stored value. Returns parsed JSON if the value was stored as JSON. Returns the original string if not JSON, or undefined if key doesn't exist
|
|
28
|
-
*/
|
|
29
|
-
get(key) {
|
|
30
|
-
const value = localStorage.getItem(key);
|
|
31
|
-
if (!value) return;
|
|
32
|
-
try {
|
|
33
|
-
return JSON.parse(value);
|
|
34
|
-
} catch (error) {
|
|
35
|
-
return value;
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
/**
|
|
39
|
-
* Stores a value in localStorage
|
|
40
|
-
* @param {string} key - The key to store the value under
|
|
41
|
-
* @param {any} value - The value to store. Objects will be stringified to JSON
|
|
42
|
-
*/
|
|
43
|
-
set(key, value) {
|
|
44
|
-
if (typeof value === "string") {
|
|
45
|
-
localStorage.setItem(key, value);
|
|
46
|
-
} else {
|
|
47
|
-
localStorage.setItem(key, JSON.stringify(value));
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
/**
|
|
51
|
-
* Stores multiple key-value pairs in localStorage
|
|
52
|
-
* @param {Object|Map} data - An object or Map containing key-value pairs to store
|
|
53
|
-
*/
|
|
54
|
-
setMultiple(data) {
|
|
55
|
-
for (const [key, value] of Object.entries(data)) {
|
|
56
|
-
this.set(key, value);
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
/**
|
|
60
|
-
* Removes a value from localStorage
|
|
61
|
-
* @param {string} key - The key to remove from localStorage
|
|
62
|
-
*/
|
|
63
|
-
remove(key) {
|
|
64
|
-
localStorage.removeItem(key);
|
|
65
|
-
},
|
|
66
|
-
/**
|
|
67
|
-
* Removes multiple keys from localStorage
|
|
68
|
-
* @param {string[]} keys - Array of keys to remove from localStorage
|
|
69
|
-
*/
|
|
70
|
-
removeMultiple(keys) {
|
|
71
|
-
keys.forEach((key) => this.remove(key));
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
75
|
-
0 && (module.exports = {
|
|
76
|
-
localStore
|
|
77
|
-
});
|