@splendidlabz/utils 1.10.1 → 1.10.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/dist/cjs/dom/accessibility.cjs +0 -2
- package/dist/cjs/dom/actions/index.cjs +7 -391
- package/dist/cjs/dom/actions/masonry.cjs +6 -97
- package/dist/cjs/dom/actions/prefer-horizontal-scroll.cjs +14 -58
- package/dist/cjs/dom/actions/sticky.cjs +6 -126
- package/dist/cjs/dom/bounding-box.cjs +0 -2
- package/dist/cjs/dom/clipboard.cjs +0 -2
- package/dist/cjs/dom/cookie.cjs +1 -3
- package/dist/cjs/dom/css-vars.cjs +3 -13
- package/dist/cjs/dom/events.cjs +0 -2
- package/dist/cjs/dom/focusable.cjs +0 -2
- package/dist/cjs/dom/font-size.cjs +3 -15
- package/dist/cjs/dom/get-element.cjs +1 -3
- package/dist/cjs/dom/hash.cjs +0 -2
- package/dist/cjs/dom/index.cjs +47 -1248
- package/dist/cjs/dom/keyboard.cjs +0 -2
- package/dist/cjs/dom/local-store.cjs +1 -3
- package/dist/cjs/dom/media.cjs +0 -2
- package/dist/cjs/dom/observers/index.cjs +9 -235
- package/dist/cjs/dom/observers/intersection-observer.cjs +6 -38
- package/dist/cjs/dom/observers/mutation-observer.cjs +6 -38
- package/dist/cjs/dom/observers/observer.cjs +2 -12
- package/dist/cjs/dom/observers/resize-observer.cjs +6 -38
- package/dist/cjs/dom/observers/scroll-observer.cjs +3 -62
- package/dist/cjs/dom/pkce.cjs +3 -13
- package/dist/cjs/dom/query-params.cjs +1 -3
- package/dist/cjs/dom/random-string.cjs +0 -2
- package/dist/cjs/dom/sanitize.cjs +3 -27
- package/dist/cjs/dom/session-store.cjs +1 -3
- package/dist/cjs/dom/spam-prevention.cjs +0 -2
- package/dist/cjs/dom/trap-focus.cjs +9 -131
- package/dist/cjs/dom/ui/aria-current.cjs +0 -2
- package/dist/cjs/dom/ui/inconsistent-button-fix.cjs +0 -2
- package/dist/cjs/dom/ui/index.cjs +9 -87
- package/dist/cjs/dom/ui/scroll-container.cjs +0 -2
- package/dist/cjs/dom/ui/traverse-and-scramble.cjs +0 -2
- package/dist/cjs/lib/arrays/index.cjs +13 -121
- package/dist/cjs/lib/arrays/item-position.cjs +0 -2
- package/dist/cjs/lib/arrays/join.cjs +2 -10
- package/dist/cjs/lib/arrays/shuffle.cjs +0 -2
- package/dist/cjs/lib/arrays/sort.cjs +3 -11
- package/dist/cjs/lib/arrays/split-array.cjs +0 -2
- package/dist/cjs/lib/arrays/unique.cjs +0 -2
- package/dist/cjs/lib/auth/index.cjs +3 -35
- package/dist/cjs/lib/auth/route-manager.cjs +0 -2
- package/dist/cjs/lib/checks.cjs +0 -2
- package/dist/cjs/lib/date/days.cjs +1 -3
- package/dist/cjs/lib/date/index.cjs +7 -190
- package/dist/cjs/lib/date/months.cjs +1 -3
- package/dist/cjs/lib/date/time.cjs +2 -14
- package/dist/cjs/lib/form/form-data.cjs +0 -2
- package/dist/cjs/lib/form/index.cjs +5 -104
- package/dist/cjs/lib/form/sanitize.cjs +0 -2
- package/dist/cjs/lib/functions/callback.cjs +0 -2
- package/dist/cjs/lib/functions/debounce.cjs +0 -2
- package/dist/cjs/lib/functions/env.cjs +0 -2
- package/dist/cjs/lib/functions/functional.cjs +0 -2
- package/dist/cjs/lib/functions/index.cjs +11 -124
- package/dist/cjs/lib/functions/throttle.cjs +0 -2
- package/dist/cjs/lib/functions/timeout.cjs +0 -2
- package/dist/cjs/lib/hash.cjs +0 -2
- package/dist/cjs/lib/index.cjs +29 -1155
- package/dist/cjs/lib/numbers/index.cjs +4 -17
- package/dist/cjs/lib/numbers/math.cjs +0 -2
- package/dist/cjs/lib/objects/camelcase-keys.cjs +4 -45
- package/dist/cjs/lib/objects/empty.cjs +0 -2
- package/dist/cjs/lib/objects/equal.cjs +0 -2
- package/dist/cjs/lib/objects/extend.cjs +6 -117
- package/dist/cjs/lib/objects/flatten.cjs +3 -11
- package/dist/cjs/lib/objects/index.cjs +27 -360
- package/dist/cjs/lib/objects/json.cjs +0 -2
- package/dist/cjs/lib/objects/loop.cjs +0 -2
- package/dist/cjs/lib/objects/mix/mix.cjs +3 -5
- package/dist/cjs/lib/objects/nested-property.cjs +0 -2
- package/dist/cjs/lib/objects/normalize-object.cjs +4 -78
- package/dist/cjs/lib/objects/omit-empty.cjs +0 -2
- package/dist/cjs/lib/objects/size.cjs +0 -2
- package/dist/cjs/lib/objects/split.cjs +0 -2
- package/dist/cjs/lib/promises/index.cjs +3 -51
- package/dist/cjs/lib/promises/reject.cjs +2 -19
- package/dist/cjs/lib/sse.cjs +4 -29
- package/dist/cjs/lib/strings/convert-case/convert-case.cjs +0 -2
- package/dist/cjs/lib/strings/index.cjs +11 -179
- package/dist/cjs/lib/strings/markdown.cjs +1 -3
- package/dist/cjs/lib/strings/name.cjs +0 -2
- package/dist/cjs/lib/strings/pluralize.cjs +1 -3
- package/dist/cjs/lib/strings/query-string.cjs +0 -2
- package/dist/cjs/lib/style/index.cjs +2 -31
- package/dist/cjs/lib/symbols/index.cjs +3 -22
- package/dist/cjs/lib/symbols/symbols.cjs +0 -2
- package/dist/cjs/node/common.cjs +0 -2
- package/dist/cjs/node/dirname.cjs +2 -4
- package/dist/cjs/node/file-cache.cjs +3 -45
- package/dist/cjs/node/file.cjs +2 -4
- package/dist/cjs/node/hash.cjs +1 -3
- package/dist/cjs/node/index.cjs +15 -272
- package/dist/cjs/node/pkce.cjs +5 -15
- package/dist/cjs/node/random-string.cjs +1 -3
- package/dist/cjs/node/sanitize.cjs +3 -27
- package/dist/esm/dom/accessibility.js +0 -1
- package/dist/esm/dom/actions/index.js +3 -381
- package/dist/esm/dom/actions/masonry.js +3 -91
- package/dist/esm/dom/actions/prefer-horizontal-scroll.js +4 -45
- package/dist/esm/dom/actions/sticky.js +3 -120
- package/dist/esm/dom/bounding-box.js +0 -1
- package/dist/esm/dom/clipboard.js +0 -1
- package/dist/esm/dom/cookie.js +1 -2
- package/dist/esm/dom/css-vars.js +1 -8
- package/dist/esm/dom/events.js +0 -1
- package/dist/esm/dom/focusable.js +0 -1
- package/dist/esm/dom/font-size.js +1 -10
- package/dist/esm/dom/get-element.js +1 -2
- package/dist/esm/dom/hash.js +0 -1
- package/dist/esm/dom/index.js +23 -1168
- package/dist/esm/dom/keyboard.js +0 -1
- package/dist/esm/dom/local-store.js +1 -2
- package/dist/esm/dom/media.js +0 -1
- package/dist/esm/dom/observers/index.js +4 -224
- package/dist/esm/dom/observers/intersection-observer.js +2 -31
- package/dist/esm/dom/observers/mutation-observer.js +3 -32
- package/dist/esm/dom/observers/observer.js +1 -8
- package/dist/esm/dom/observers/resize-observer.js +2 -31
- package/dist/esm/dom/observers/scroll-observer.js +2 -58
- package/dist/esm/dom/pkce.js +1 -8
- package/dist/esm/dom/query-params.js +1 -2
- package/dist/esm/dom/random-string.js +0 -1
- package/dist/esm/dom/sanitize.js +3 -26
- package/dist/esm/dom/session-store.js +1 -2
- package/dist/esm/dom/spam-prevention.js +0 -1
- package/dist/esm/dom/trap-focus.js +2 -121
- package/dist/esm/dom/ui/aria-current.js +0 -1
- package/dist/esm/dom/ui/inconsistent-button-fix.js +0 -1
- package/dist/esm/dom/ui/index.js +4 -75
- package/dist/esm/dom/ui/scroll-container.js +0 -1
- package/dist/esm/dom/ui/traverse-and-scramble.js +0 -1
- package/dist/esm/lib/arrays/index.js +6 -106
- package/dist/esm/lib/arrays/item-position.js +0 -1
- package/dist/esm/lib/arrays/join.js +1 -6
- package/dist/esm/lib/arrays/shuffle.js +0 -1
- package/dist/esm/lib/arrays/sort.js +1 -6
- package/dist/esm/lib/arrays/split-array.js +0 -1
- package/dist/esm/lib/arrays/unique.js +0 -1
- package/dist/esm/lib/auth/index.js +1 -26
- package/dist/esm/lib/auth/route-manager.js +0 -1
- package/dist/esm/lib/checks.js +0 -1
- package/dist/esm/lib/date/days.js +1 -2
- package/dist/esm/lib/date/index.js +3 -173
- package/dist/esm/lib/date/months.js +1 -2
- package/dist/esm/lib/date/time.js +1 -10
- package/dist/esm/lib/form/form-data.js +0 -1
- package/dist/esm/lib/form/index.js +2 -92
- package/dist/esm/lib/form/sanitize.js +0 -1
- package/dist/esm/lib/functions/callback.js +0 -1
- package/dist/esm/lib/functions/debounce.js +0 -1
- package/dist/esm/lib/functions/env.js +0 -1
- package/dist/esm/lib/functions/functional.js +0 -1
- package/dist/esm/lib/functions/index.js +5 -105
- package/dist/esm/lib/functions/throttle.js +0 -1
- package/dist/esm/lib/functions/timeout.js +0 -1
- package/dist/esm/lib/hash.js +0 -1
- package/dist/esm/lib/index.js +14 -1052
- package/dist/esm/lib/numbers/index.js +2 -12
- package/dist/esm/lib/numbers/math.js +0 -1
- package/dist/esm/lib/objects/camelcase-keys.js +2 -40
- package/dist/esm/lib/objects/empty.js +0 -1
- package/dist/esm/lib/objects/equal.js +0 -1
- package/dist/esm/lib/objects/extend.js +3 -111
- package/dist/esm/lib/objects/flatten.js +1 -6
- package/dist/esm/lib/objects/index.js +13 -323
- package/dist/esm/lib/objects/json.js +0 -1
- package/dist/esm/lib/objects/loop.js +0 -1
- package/dist/esm/lib/objects/mix/mix.js +3 -4
- package/dist/esm/lib/objects/nested-property.js +0 -1
- package/dist/esm/lib/objects/normalize-object.js +3 -74
- package/dist/esm/lib/objects/omit-empty.js +0 -1
- package/dist/esm/lib/objects/size.js +0 -1
- package/dist/esm/lib/objects/split.js +0 -1
- package/dist/esm/lib/promises/index.js +1 -33
- package/dist/esm/lib/promises/reject.js +1 -17
- package/dist/esm/lib/sse.js +2 -24
- package/dist/esm/lib/strings/convert-case/convert-case.js +0 -1
- package/dist/esm/lib/strings/index.js +5 -147
- package/dist/esm/lib/strings/markdown.js +1 -2
- package/dist/esm/lib/strings/name.js +0 -1
- package/dist/esm/lib/strings/pluralize.js +1 -2
- package/dist/esm/lib/strings/query-string.js +0 -1
- package/dist/esm/lib/style/index.js +1 -27
- package/dist/esm/lib/symbols/index.js +1 -13
- package/dist/esm/lib/symbols/symbols.js +0 -1
- package/dist/esm/node/common.js +0 -1
- package/dist/esm/node/dirname.js +2 -3
- package/dist/esm/node/file-cache.js +2 -43
- package/dist/esm/node/file.js +2 -3
- package/dist/esm/node/hash.js +1 -2
- package/dist/esm/node/index.js +7 -243
- package/dist/esm/node/pkce.js +3 -12
- package/dist/esm/node/random-string.js +1 -2
- package/dist/esm/node/sanitize.js +3 -26
- package/package.json +1 -1
- package/tsup.config.mjs +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -15,8 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
15
|
return to;
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// src/dom/accessibility.js
|
|
20
18
|
var accessibility_exports = {};
|
|
21
19
|
__export(accessibility_exports, {
|
|
22
20
|
checkForAccessibleName: () => checkForAccessibleName,
|
|
@@ -2,10 +2,6 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
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
5
|
var __copyProps = (to, from, except, desc) => {
|
|
10
6
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
7
|
for (let key of __getOwnPropNames(from))
|
|
@@ -14,396 +10,16 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
10
|
}
|
|
15
11
|
return to;
|
|
16
12
|
};
|
|
13
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
17
14
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// src/dom/actions/index.js
|
|
20
15
|
var actions_exports = {};
|
|
21
|
-
__export(actions_exports, {
|
|
22
|
-
masonry: () => masonry,
|
|
23
|
-
preferHorizontalScroll: () => preferHorizontalScroll,
|
|
24
|
-
sticky: () => sticky
|
|
25
|
-
});
|
|
26
16
|
module.exports = __toCommonJS(actions_exports);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (node instanceof Element) return "element";
|
|
31
|
-
if (node instanceof NodeList) return "nodelist";
|
|
32
|
-
if (Array.isArray(node)) return "array";
|
|
33
|
-
}
|
|
34
|
-
function getElement(selector) {
|
|
35
|
-
if (!selector) return;
|
|
36
|
-
if (selector instanceof Element) return selector;
|
|
37
|
-
return document.querySelector(selector);
|
|
38
|
-
}
|
|
39
|
-
function getChildrenElements(node) {
|
|
40
|
-
let children = node.children;
|
|
41
|
-
if (children[0]?.nodeName === "ASTRO-SLOT") children = children[0].children;
|
|
42
|
-
return Array.from(children);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// src/dom/media.js
|
|
46
|
-
async function imagesLoaded(node) {
|
|
47
|
-
const images = Array.from(node.querySelectorAll("img"));
|
|
48
|
-
const promises = images.map((img) => {
|
|
49
|
-
return new Promise((resolve, reject) => {
|
|
50
|
-
if (img.complete) return resolve();
|
|
51
|
-
img.onload = resolve;
|
|
52
|
-
img.onerror = (e) => {
|
|
53
|
-
reject("Image failed to load");
|
|
54
|
-
};
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
return Promise.all(promises);
|
|
58
|
-
}
|
|
59
|
-
async function videosLoaded(node) {
|
|
60
|
-
const videos = Array.from(node.querySelectorAll("video"));
|
|
61
|
-
const promises = videos.map((video) => {
|
|
62
|
-
return new Promise((resolve, reject) => {
|
|
63
|
-
if (video.readyState === 4) return resolve();
|
|
64
|
-
video.onloadedmetadata = resolve;
|
|
65
|
-
video.onerror = reject;
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
return Promise.all(promises);
|
|
69
|
-
}
|
|
70
|
-
async function mediaLoaded(node) {
|
|
71
|
-
return Promise.all([imagesLoaded(node), videosLoaded(node)]);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// src/dom/events.js
|
|
75
|
-
function addListeners(listeners) {
|
|
76
|
-
listeners.forEach(({ node, event, handler }) => {
|
|
77
|
-
node.addEventListener(event, handler);
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
function removeListeners(listeners) {
|
|
81
|
-
listeners.forEach(({ node, event, handler }) => {
|
|
82
|
-
node.removeEventListener(event, handler);
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
function dispatchEvent(node, eventName, detail, options = {}) {
|
|
86
|
-
node.dispatchEvent(
|
|
87
|
-
new CustomEvent(eventName, {
|
|
88
|
-
...options,
|
|
89
|
-
detail
|
|
90
|
-
})
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// src/dom/observers/observer.js
|
|
95
|
-
function useObserverMethodOnTarget(target, observer, method = "observe", options = void 0) {
|
|
96
|
-
const targetType = getNodeType(target);
|
|
97
|
-
if (targetType === "element") observer[method](target, options);
|
|
98
|
-
if (targetType === "nodelist") {
|
|
99
|
-
const elements = Array.from(target);
|
|
100
|
-
elements.forEach((element) => observer[method](element, options));
|
|
101
|
-
}
|
|
102
|
-
if (targetType === "array") {
|
|
103
|
-
target.forEach((element) => observer[method](element, options));
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// src/dom/observers/resize-observer.js
|
|
108
|
-
function resizeObserver(target, options) {
|
|
109
|
-
const { callback, ...opts } = options;
|
|
110
|
-
const observer = new ResizeObserver(observerFn);
|
|
111
|
-
if (target === window || target === document)
|
|
112
|
-
target = document.documentElement;
|
|
113
|
-
useObserverMethodOnTarget(target, observer, "observe", opts);
|
|
114
|
-
function observerFn(entries) {
|
|
115
|
-
for (const entry of entries) {
|
|
116
|
-
if (callback) callback({ entry, entries, observer });
|
|
117
|
-
else
|
|
118
|
-
dispatchEvent(entry.target, "resize-obs", { entry, entries, observer });
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
return {
|
|
122
|
-
observe(target2) {
|
|
123
|
-
useObserverMethodOnTarget(target2, observer, "observe", options);
|
|
124
|
-
},
|
|
125
|
-
unobserve(target2) {
|
|
126
|
-
useObserverMethodOnTarget(target2, observer, "unobserve");
|
|
127
|
-
},
|
|
128
|
-
disconnect: (_) => observer.disconnect(),
|
|
129
|
-
destroy: (_) => observer.disconnect()
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// src/dom/actions/masonry.js
|
|
134
|
-
async function masonry(node) {
|
|
135
|
-
if (nativeMasonrySupport(node)) return;
|
|
136
|
-
const colGap = parseFloat(getComputedStyle(node).columnGap);
|
|
137
|
-
const items = getChildrenElements(node);
|
|
138
|
-
node.style.setProperty("row-gap", "1px", "important");
|
|
139
|
-
node.style.gridAutoRows = "0px";
|
|
140
|
-
try {
|
|
141
|
-
await mediaLoaded(node);
|
|
142
|
-
} catch (e) {
|
|
143
|
-
}
|
|
144
|
-
layout({ colGap, items });
|
|
145
|
-
const obs = resizeObserver(node, {
|
|
146
|
-
async callback(opts) {
|
|
147
|
-
layout({ colGap, items });
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
async function layout({ colGap: colGap2, items: items2 }) {
|
|
151
|
-
items2.forEach((item) => {
|
|
152
|
-
const ib = item.getBoundingClientRect();
|
|
153
|
-
item.style.gridRowEnd = `span ${Math.round(ib.height + colGap2)}`;
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
return {
|
|
157
|
-
destroy() {
|
|
158
|
-
obs.disconnect();
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
function nativeMasonrySupport(node) {
|
|
163
|
-
return getComputedStyle(node).gridTemplateRows === "masonry";
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
// src/lib/objects/omit-empty.js
|
|
167
|
-
function omitEmpty(obj, shallow = false) {
|
|
168
|
-
if (typeof obj !== "object" || obj === null) return obj;
|
|
169
|
-
if (obj instanceof Date) return obj;
|
|
170
|
-
const result = Array.isArray(obj) ? [] : {};
|
|
171
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
172
|
-
if (value === null || value === void 0 || value === "" || typeof value === "object" && !(value instanceof Date) && Object.keys(value).length === 0) {
|
|
173
|
-
continue;
|
|
174
|
-
}
|
|
175
|
-
result[key] = shallow ? value : omitEmpty(value);
|
|
176
|
-
}
|
|
177
|
-
return result;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
// src/dom/css-vars.js
|
|
181
|
-
function getCSSVar(element, prop) {
|
|
182
|
-
element = getElement(element);
|
|
183
|
-
return getComputedStyle(element).getPropertyValue(prop);
|
|
184
|
-
}
|
|
185
|
-
function setCSSVar(element, prop, value) {
|
|
186
|
-
element = getElement(element);
|
|
187
|
-
element.style.setProperty(prop, value);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
// src/dom/actions/prefer-horizontal-scroll.js
|
|
191
|
-
var DEFAULT_OPTIONS = {
|
|
192
|
-
scrollSnapDelay: 1e3
|
|
193
|
-
};
|
|
194
|
-
function preferHorizontalScroll(node, props = {}) {
|
|
195
|
-
if (!node.classList.contains("scrollable-prefer-horizontal")) return;
|
|
196
|
-
const state = {
|
|
197
|
-
origSnapType: null,
|
|
198
|
-
currentSnapType: null,
|
|
199
|
-
snapTimeoutID: null
|
|
200
|
-
};
|
|
201
|
-
const options = {
|
|
202
|
-
...DEFAULT_OPTIONS,
|
|
203
|
-
...omitEmpty({
|
|
204
|
-
scrollSnapDelay: getCSSVar(node, "--scroll-snap-delay")
|
|
205
|
-
}),
|
|
206
|
-
...omitEmpty(props)
|
|
207
|
-
};
|
|
208
|
-
const listeners = [
|
|
209
|
-
{
|
|
210
|
-
event: "wheel",
|
|
211
|
-
node,
|
|
212
|
-
handler: handleWheel
|
|
213
|
-
},
|
|
214
|
-
{
|
|
215
|
-
event: "pointerenter",
|
|
216
|
-
node,
|
|
217
|
-
handler: handlePointerEnter
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
event: "pointerleave",
|
|
221
|
-
node,
|
|
222
|
-
handler: handlePointerLeave
|
|
223
|
-
}
|
|
224
|
-
];
|
|
225
|
-
addListeners(listeners);
|
|
226
|
-
function handleWheel(event) {
|
|
227
|
-
const direction = event.deltaY > 0 ? "down" : "up";
|
|
228
|
-
const updatedDelta = event.deltaY;
|
|
229
|
-
if (isTrackpad(event)) return false;
|
|
230
|
-
setCSSVar(node, "--snap-type", "none");
|
|
231
|
-
const scrolledAmount = node.scrollLeft;
|
|
232
|
-
const scrollWidth = node.scrollWidth;
|
|
233
|
-
const clientWidth = node.clientWidth;
|
|
234
|
-
const scrollableAmount = scrollWidth - clientWidth;
|
|
235
|
-
if (direction === "down" && scrolledAmount < scrollableAmount) {
|
|
236
|
-
node.scrollLeft += updatedDelta;
|
|
237
|
-
event.preventDefault();
|
|
238
|
-
}
|
|
239
|
-
if (direction === "up" && scrolledAmount > 0) {
|
|
240
|
-
node.scrollLeft += updatedDelta;
|
|
241
|
-
event.preventDefault();
|
|
242
|
-
}
|
|
243
|
-
const { snapTimeoutID } = state;
|
|
244
|
-
if (snapTimeoutID) clearTimeout(snapTimeoutID);
|
|
245
|
-
state.snapTimeoutID = setTimeout((_) => {
|
|
246
|
-
restoreHijackedState(node, state);
|
|
247
|
-
}, options.scrollSnapDelay);
|
|
248
|
-
}
|
|
249
|
-
function handlePointerEnter(event) {
|
|
250
|
-
state.origSnapType = getCSSVar(node, "--snap-type") || "proximity";
|
|
251
|
-
}
|
|
252
|
-
function handlePointerLeave(event) {
|
|
253
|
-
restoreHijackedState(node, state);
|
|
254
|
-
}
|
|
255
|
-
return {
|
|
256
|
-
destroy() {
|
|
257
|
-
removeListeners(listeners);
|
|
258
|
-
}
|
|
259
|
-
};
|
|
260
|
-
}
|
|
261
|
-
function restoreHijackedState(node, state) {
|
|
262
|
-
const scrollLeft = node.scrollLeft;
|
|
263
|
-
setCSSVar(node, "--snap-type", state.origSnapType);
|
|
264
|
-
const finalScrollLeft = node.scrollLeft;
|
|
265
|
-
setCSSVar(node, "--snap-type", "none");
|
|
266
|
-
node.scrollTo({ left: scrollLeft, behavior: "instant" });
|
|
267
|
-
node.scrollTo({ left: finalScrollLeft, behavior: "smooth" });
|
|
268
|
-
setTimeout((_) => {
|
|
269
|
-
setCSSVar(node, "--snap-type", state.origSnapType);
|
|
270
|
-
}, 250);
|
|
271
|
-
}
|
|
272
|
-
function isTrackpad(event) {
|
|
273
|
-
if (event.wheelDeltaY === event.deltaY * -3) return true;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
// src/dom/bounding-box.js
|
|
277
|
-
function boundingBox(element, { containsPadding = true } = {}) {
|
|
278
|
-
const box = element.getBoundingClientRect();
|
|
279
|
-
const ret = {};
|
|
280
|
-
for (const prop in box) ret[prop] = box[prop];
|
|
281
|
-
if (!containsPadding) {
|
|
282
|
-
const style = getComputedStyle(element);
|
|
283
|
-
const paddingTop = parseFloat(style.paddingTop);
|
|
284
|
-
const paddingRight = parseFloat(style.paddingRight);
|
|
285
|
-
const paddingBottom = parseFloat(style.paddingBottom);
|
|
286
|
-
const paddingLeft = parseFloat(style.paddingLeft);
|
|
287
|
-
ret.x = ret.x + paddingLeft;
|
|
288
|
-
ret.y = ret.y + paddingTop;
|
|
289
|
-
ret.width = ret.width - paddingLeft - paddingRight;
|
|
290
|
-
ret.height = ret.height - paddingTop - paddingBottom;
|
|
291
|
-
ret.top = ret.top + paddingTop;
|
|
292
|
-
ret.bottom = ret.bottom - paddingBottom;
|
|
293
|
-
ret.right = ret.right - paddingRight;
|
|
294
|
-
ret.left = ret.left + paddingLeft;
|
|
295
|
-
}
|
|
296
|
-
ret.xCenter = (ret.left + ret.right) / 2;
|
|
297
|
-
ret.yCenter = (ret.top + ret.bottom) / 2;
|
|
298
|
-
return ret;
|
|
299
|
-
}
|
|
300
|
-
function boundingBoxRelativeToAncestor({ element, ancestorElement }) {
|
|
301
|
-
ancestorElement = ancestorElement || element.parentElement;
|
|
302
|
-
const box = boundingBox(element);
|
|
303
|
-
const ancestorBox = boundingBox(ancestorElement, {
|
|
304
|
-
containsPadding: false
|
|
305
|
-
});
|
|
306
|
-
return {
|
|
307
|
-
top: box.top - ancestorBox.top,
|
|
308
|
-
right: box.right - ancestorBox.right,
|
|
309
|
-
bottom: box.bottom - ancestorBox.bottom,
|
|
310
|
-
left: box.left - ancestorBox.left,
|
|
311
|
-
width: box.width,
|
|
312
|
-
height: box.height,
|
|
313
|
-
xCenter: (box.left + box.right) / 2 - ancestorBox.left,
|
|
314
|
-
yCenter: (box.top + box.bottom) / 2 - ancestorBox.top
|
|
315
|
-
};
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
// src/dom/ui/scroll-container.js
|
|
319
|
-
function findScrollContainer(element, direction = "both") {
|
|
320
|
-
if (!element) return;
|
|
321
|
-
let parent = element.parentElement;
|
|
322
|
-
while (parent) {
|
|
323
|
-
const { overflow, overflowX, overflowY } = getComputedStyle(parent);
|
|
324
|
-
if (direction === "both") {
|
|
325
|
-
if (overflow.includes("auto") || overflow.includes("scroll"))
|
|
326
|
-
return parent;
|
|
327
|
-
}
|
|
328
|
-
if (direction === "horizontal") {
|
|
329
|
-
if (overflowX === "auto" || overflowX === "scroll") return parent;
|
|
330
|
-
}
|
|
331
|
-
if (direction === "vertical") {
|
|
332
|
-
if (overflowY === "auto" || overflowY === "scroll") return parent;
|
|
333
|
-
}
|
|
334
|
-
parent = parent.parentElement;
|
|
335
|
-
}
|
|
336
|
-
return document.documentElement;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
// src/dom/actions/sticky.js
|
|
340
|
-
function sticky(node, props = {}) {
|
|
341
|
-
const scrollContainer = findScrollContainer(node);
|
|
342
|
-
let stickyTBLR = getComputedTBLR(node);
|
|
343
|
-
const obs = resizeObserver(node, {
|
|
344
|
-
callback: ({ entry }) => {
|
|
345
|
-
stickyTBLR = getComputedTBLR(node);
|
|
346
|
-
isSticking();
|
|
347
|
-
scrollContainer === document.documentElement ? window.addEventListener("scroll", scrollEventListener) : scrollContainer.addEventListener("scroll", scrollEventListener);
|
|
348
|
-
}
|
|
349
|
-
});
|
|
350
|
-
function scrollEventListener(event) {
|
|
351
|
-
isSticking();
|
|
352
|
-
}
|
|
353
|
-
function isSticking() {
|
|
354
|
-
const { top, bottom, left, right } = stickyTBLR;
|
|
355
|
-
const relativeRect = boundingBoxRelativeToAncestor({
|
|
356
|
-
element: node,
|
|
357
|
-
ancestorElement: scrollContainer
|
|
358
|
-
});
|
|
359
|
-
if (!isNaN(top)) {
|
|
360
|
-
if (relativeRect.top - top <= 1) {
|
|
361
|
-
node.classList.add("sticking");
|
|
362
|
-
} else {
|
|
363
|
-
node.classList.remove("sticking");
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
if (!isNaN(bottom)) {
|
|
367
|
-
if (relativeRect.bottom + bottom >= -1) {
|
|
368
|
-
node.classList.add("sticking");
|
|
369
|
-
} else {
|
|
370
|
-
node.classList.remove("sticking");
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
if (!isNaN(left)) {
|
|
374
|
-
if (relativeRect.left - left <= 1) {
|
|
375
|
-
node.classList.add("sticking");
|
|
376
|
-
} else {
|
|
377
|
-
node.classList.remove("sticking");
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
if (!isNaN(right)) {
|
|
381
|
-
if (relativeRect.right + right >= -1) {
|
|
382
|
-
node.classList.add("sticking");
|
|
383
|
-
} else {
|
|
384
|
-
node.classList.remove("sticking");
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
return {
|
|
389
|
-
destroy() {
|
|
390
|
-
obs.disconnect();
|
|
391
|
-
scrollContainer.removeEventListener("scroll", scrollEventListener);
|
|
392
|
-
}
|
|
393
|
-
};
|
|
394
|
-
}
|
|
395
|
-
function getComputedTBLR(element) {
|
|
396
|
-
const style = getComputedStyle(element);
|
|
397
|
-
return {
|
|
398
|
-
top: parseFloat(style.top),
|
|
399
|
-
bottom: parseFloat(style.bottom),
|
|
400
|
-
left: parseFloat(style.left),
|
|
401
|
-
right: parseFloat(style.right)
|
|
402
|
-
};
|
|
403
|
-
}
|
|
17
|
+
__reExport(actions_exports, require("./masonry.js"), module.exports);
|
|
18
|
+
__reExport(actions_exports, require("./prefer-horizontal-scroll.js"), module.exports);
|
|
19
|
+
__reExport(actions_exports, require("./sticky.js"), module.exports);
|
|
404
20
|
// Annotate the CommonJS export names for ESM import in node:
|
|
405
21
|
0 && (module.exports = {
|
|
406
|
-
masonry,
|
|
407
|
-
|
|
408
|
-
sticky
|
|
22
|
+
...require("./masonry.js"),
|
|
23
|
+
...require("./prefer-horizontal-scroll.js"),
|
|
24
|
+
...require("./sticky.js")
|
|
409
25
|
});
|
|
@@ -15,117 +15,26 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
15
|
return to;
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// src/dom/actions/masonry.js
|
|
20
18
|
var masonry_exports = {};
|
|
21
19
|
__export(masonry_exports, {
|
|
22
20
|
masonry: () => masonry
|
|
23
21
|
});
|
|
24
22
|
module.exports = __toCommonJS(masonry_exports);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (node instanceof Element) return "element";
|
|
29
|
-
if (node instanceof NodeList) return "nodelist";
|
|
30
|
-
if (Array.isArray(node)) return "array";
|
|
31
|
-
}
|
|
32
|
-
function getChildrenElements(node) {
|
|
33
|
-
let children = node.children;
|
|
34
|
-
if (children[0]?.nodeName === "ASTRO-SLOT") children = children[0].children;
|
|
35
|
-
return Array.from(children);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// src/dom/media.js
|
|
39
|
-
async function imagesLoaded(node) {
|
|
40
|
-
const images = Array.from(node.querySelectorAll("img"));
|
|
41
|
-
const promises = images.map((img) => {
|
|
42
|
-
return new Promise((resolve, reject) => {
|
|
43
|
-
if (img.complete) return resolve();
|
|
44
|
-
img.onload = resolve;
|
|
45
|
-
img.onerror = (e) => {
|
|
46
|
-
reject("Image failed to load");
|
|
47
|
-
};
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
return Promise.all(promises);
|
|
51
|
-
}
|
|
52
|
-
async function videosLoaded(node) {
|
|
53
|
-
const videos = Array.from(node.querySelectorAll("video"));
|
|
54
|
-
const promises = videos.map((video) => {
|
|
55
|
-
return new Promise((resolve, reject) => {
|
|
56
|
-
if (video.readyState === 4) return resolve();
|
|
57
|
-
video.onloadedmetadata = resolve;
|
|
58
|
-
video.onerror = reject;
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
return Promise.all(promises);
|
|
62
|
-
}
|
|
63
|
-
async function mediaLoaded(node) {
|
|
64
|
-
return Promise.all([imagesLoaded(node), videosLoaded(node)]);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// src/dom/events.js
|
|
68
|
-
function dispatchEvent(node, eventName, detail, options = {}) {
|
|
69
|
-
node.dispatchEvent(
|
|
70
|
-
new CustomEvent(eventName, {
|
|
71
|
-
...options,
|
|
72
|
-
detail
|
|
73
|
-
})
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// src/dom/observers/observer.js
|
|
78
|
-
function useObserverMethodOnTarget(target, observer, method = "observe", options = void 0) {
|
|
79
|
-
const targetType = getNodeType(target);
|
|
80
|
-
if (targetType === "element") observer[method](target, options);
|
|
81
|
-
if (targetType === "nodelist") {
|
|
82
|
-
const elements = Array.from(target);
|
|
83
|
-
elements.forEach((element) => observer[method](element, options));
|
|
84
|
-
}
|
|
85
|
-
if (targetType === "array") {
|
|
86
|
-
target.forEach((element) => observer[method](element, options));
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// src/dom/observers/resize-observer.js
|
|
91
|
-
function resizeObserver(target, options) {
|
|
92
|
-
const { callback, ...opts } = options;
|
|
93
|
-
const observer = new ResizeObserver(observerFn);
|
|
94
|
-
if (target === window || target === document)
|
|
95
|
-
target = document.documentElement;
|
|
96
|
-
useObserverMethodOnTarget(target, observer, "observe", opts);
|
|
97
|
-
function observerFn(entries) {
|
|
98
|
-
for (const entry of entries) {
|
|
99
|
-
if (callback) callback({ entry, entries, observer });
|
|
100
|
-
else
|
|
101
|
-
dispatchEvent(entry.target, "resize-obs", { entry, entries, observer });
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
return {
|
|
105
|
-
observe(target2) {
|
|
106
|
-
useObserverMethodOnTarget(target2, observer, "observe", options);
|
|
107
|
-
},
|
|
108
|
-
unobserve(target2) {
|
|
109
|
-
useObserverMethodOnTarget(target2, observer, "unobserve");
|
|
110
|
-
},
|
|
111
|
-
disconnect: (_) => observer.disconnect(),
|
|
112
|
-
destroy: (_) => observer.disconnect()
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// src/dom/actions/masonry.js
|
|
23
|
+
var import_get_element = require("../get-element.js");
|
|
24
|
+
var import_media = require("../media.js");
|
|
25
|
+
var import_resize_observer = require("../observers/resize-observer.js");
|
|
117
26
|
async function masonry(node) {
|
|
118
27
|
if (nativeMasonrySupport(node)) return;
|
|
119
28
|
const colGap = parseFloat(getComputedStyle(node).columnGap);
|
|
120
|
-
const items = getChildrenElements(node);
|
|
29
|
+
const items = (0, import_get_element.getChildrenElements)(node);
|
|
121
30
|
node.style.setProperty("row-gap", "1px", "important");
|
|
122
31
|
node.style.gridAutoRows = "0px";
|
|
123
32
|
try {
|
|
124
|
-
await mediaLoaded(node);
|
|
33
|
+
await (0, import_media.mediaLoaded)(node);
|
|
125
34
|
} catch (e) {
|
|
126
35
|
}
|
|
127
36
|
layout({ colGap, items });
|
|
128
|
-
const obs = resizeObserver(node, {
|
|
37
|
+
const obs = (0, import_resize_observer.resizeObserver)(node, {
|
|
129
38
|
async callback(opts) {
|
|
130
39
|
layout({ colGap, items });
|
|
131
40
|
}
|
|
@@ -15,59 +15,15 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
15
|
return to;
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// src/dom/actions/prefer-horizontal-scroll.js
|
|
20
18
|
var prefer_horizontal_scroll_exports = {};
|
|
21
19
|
__export(prefer_horizontal_scroll_exports, {
|
|
22
20
|
preferHorizontalScroll: () => preferHorizontalScroll
|
|
23
21
|
});
|
|
24
22
|
module.exports = __toCommonJS(prefer_horizontal_scroll_exports);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if (obj instanceof Date) return obj;
|
|
30
|
-
const result = Array.isArray(obj) ? [] : {};
|
|
31
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
32
|
-
if (value === null || value === void 0 || value === "" || typeof value === "object" && !(value instanceof Date) && Object.keys(value).length === 0) {
|
|
33
|
-
continue;
|
|
34
|
-
}
|
|
35
|
-
result[key] = shallow ? value : omitEmpty(value);
|
|
36
|
-
}
|
|
37
|
-
return result;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// src/dom/get-element.js
|
|
41
|
-
function getElement(selector) {
|
|
42
|
-
if (!selector) return;
|
|
43
|
-
if (selector instanceof Element) return selector;
|
|
44
|
-
return document.querySelector(selector);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// src/dom/css-vars.js
|
|
48
|
-
function getCSSVar(element, prop) {
|
|
49
|
-
element = getElement(element);
|
|
50
|
-
return getComputedStyle(element).getPropertyValue(prop);
|
|
51
|
-
}
|
|
52
|
-
function setCSSVar(element, prop, value) {
|
|
53
|
-
element = getElement(element);
|
|
54
|
-
element.style.setProperty(prop, value);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// src/dom/events.js
|
|
58
|
-
function addListeners(listeners) {
|
|
59
|
-
listeners.forEach(({ node, event, handler }) => {
|
|
60
|
-
node.addEventListener(event, handler);
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
function removeListeners(listeners) {
|
|
64
|
-
listeners.forEach(({ node, event, handler }) => {
|
|
65
|
-
node.removeEventListener(event, handler);
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// src/dom/actions/prefer-horizontal-scroll.js
|
|
70
|
-
var DEFAULT_OPTIONS = {
|
|
23
|
+
var import_omit_empty = require("../../lib/objects/omit-empty.js");
|
|
24
|
+
var import_css_vars = require("../css-vars.js");
|
|
25
|
+
var import_events = require("../events.js");
|
|
26
|
+
const DEFAULT_OPTIONS = {
|
|
71
27
|
scrollSnapDelay: 1e3
|
|
72
28
|
};
|
|
73
29
|
function preferHorizontalScroll(node, props = {}) {
|
|
@@ -79,10 +35,10 @@ function preferHorizontalScroll(node, props = {}) {
|
|
|
79
35
|
};
|
|
80
36
|
const options = {
|
|
81
37
|
...DEFAULT_OPTIONS,
|
|
82
|
-
...omitEmpty({
|
|
83
|
-
scrollSnapDelay: getCSSVar(node, "--scroll-snap-delay")
|
|
38
|
+
...(0, import_omit_empty.omitEmpty)({
|
|
39
|
+
scrollSnapDelay: (0, import_css_vars.getCSSVar)(node, "--scroll-snap-delay")
|
|
84
40
|
}),
|
|
85
|
-
...omitEmpty(props)
|
|
41
|
+
...(0, import_omit_empty.omitEmpty)(props)
|
|
86
42
|
};
|
|
87
43
|
const listeners = [
|
|
88
44
|
{
|
|
@@ -101,12 +57,12 @@ function preferHorizontalScroll(node, props = {}) {
|
|
|
101
57
|
handler: handlePointerLeave
|
|
102
58
|
}
|
|
103
59
|
];
|
|
104
|
-
addListeners(listeners);
|
|
60
|
+
(0, import_events.addListeners)(listeners);
|
|
105
61
|
function handleWheel(event) {
|
|
106
62
|
const direction = event.deltaY > 0 ? "down" : "up";
|
|
107
63
|
const updatedDelta = event.deltaY;
|
|
108
64
|
if (isTrackpad(event)) return false;
|
|
109
|
-
setCSSVar(node, "--snap-type", "none");
|
|
65
|
+
(0, import_css_vars.setCSSVar)(node, "--snap-type", "none");
|
|
110
66
|
const scrolledAmount = node.scrollLeft;
|
|
111
67
|
const scrollWidth = node.scrollWidth;
|
|
112
68
|
const clientWidth = node.clientWidth;
|
|
@@ -126,26 +82,26 @@ function preferHorizontalScroll(node, props = {}) {
|
|
|
126
82
|
}, options.scrollSnapDelay);
|
|
127
83
|
}
|
|
128
84
|
function handlePointerEnter(event) {
|
|
129
|
-
state.origSnapType = getCSSVar(node, "--snap-type") || "proximity";
|
|
85
|
+
state.origSnapType = (0, import_css_vars.getCSSVar)(node, "--snap-type") || "proximity";
|
|
130
86
|
}
|
|
131
87
|
function handlePointerLeave(event) {
|
|
132
88
|
restoreHijackedState(node, state);
|
|
133
89
|
}
|
|
134
90
|
return {
|
|
135
91
|
destroy() {
|
|
136
|
-
removeListeners(listeners);
|
|
92
|
+
(0, import_events.removeListeners)(listeners);
|
|
137
93
|
}
|
|
138
94
|
};
|
|
139
95
|
}
|
|
140
96
|
function restoreHijackedState(node, state) {
|
|
141
97
|
const scrollLeft = node.scrollLeft;
|
|
142
|
-
setCSSVar(node, "--snap-type", state.origSnapType);
|
|
98
|
+
(0, import_css_vars.setCSSVar)(node, "--snap-type", state.origSnapType);
|
|
143
99
|
const finalScrollLeft = node.scrollLeft;
|
|
144
|
-
setCSSVar(node, "--snap-type", "none");
|
|
100
|
+
(0, import_css_vars.setCSSVar)(node, "--snap-type", "none");
|
|
145
101
|
node.scrollTo({ left: scrollLeft, behavior: "instant" });
|
|
146
102
|
node.scrollTo({ left: finalScrollLeft, behavior: "smooth" });
|
|
147
103
|
setTimeout((_) => {
|
|
148
|
-
setCSSVar(node, "--snap-type", state.origSnapType);
|
|
104
|
+
(0, import_css_vars.setCSSVar)(node, "--snap-type", state.origSnapType);
|
|
149
105
|
}, 250);
|
|
150
106
|
}
|
|
151
107
|
function isTrackpad(event) {
|