@t007/input 0.0.11 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.global.js +10 -12
- package/dist/standalone.js +10 -12
- package/package.json +2 -2
package/dist/index.global.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
(() => {
|
|
3
|
-
// ../utils/
|
|
3
|
+
// ../utils/dist/index.js
|
|
4
4
|
function isDef(val) {
|
|
5
5
|
return "undefined" !== typeof val;
|
|
6
6
|
}
|
|
7
|
-
|
|
8
|
-
// ../utils/dist/index.js
|
|
9
7
|
function isSym(val) {
|
|
10
8
|
return "symbol" === typeof val;
|
|
11
9
|
}
|
|
@@ -15,15 +13,6 @@
|
|
|
15
13
|
function isArr(obj) {
|
|
16
14
|
return Array.isArray(obj);
|
|
17
15
|
}
|
|
18
|
-
function isSameURL(src1, src2) {
|
|
19
|
-
if (!isStr(src1) || !isStr(src2) || !src1 || !src2) return false;
|
|
20
|
-
try {
|
|
21
|
-
const u1 = new URL(src1, window.location.href), u2 = new URL(src2, window.location.href);
|
|
22
|
-
return decodeURIComponent(u1.origin + u1.pathname) === decodeURIComponent(u2.origin + u2.pathname);
|
|
23
|
-
} catch {
|
|
24
|
-
return src1.replace(/\\/g, "/").split("?")[0].trim() === src2.replace(/\\/g, "/").split("?")[0].trim();
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
16
|
function createEl(tag, props, dataset, styles, el = tag ? document?.createElement(tag) : null) {
|
|
28
17
|
return assignEl(el, props, dataset, styles), el;
|
|
29
18
|
}
|
|
@@ -67,6 +56,15 @@
|
|
|
67
56
|
});
|
|
68
57
|
return w.t007._resourceCache[src];
|
|
69
58
|
}
|
|
59
|
+
function isSameURL(src1, src2) {
|
|
60
|
+
if (!isStr(src1) || !isStr(src2) || !src1 || !src2) return false;
|
|
61
|
+
try {
|
|
62
|
+
const u1 = new URL(src1, window.location.href), u2 = new URL(src2, window.location.href);
|
|
63
|
+
return decodeURIComponent(u1.origin + u1.pathname) === decodeURIComponent(u2.origin + u2.pathname);
|
|
64
|
+
} catch {
|
|
65
|
+
return src1.replace(/\\/g, "/").split("?")[0].trim() === src2.replace(/\\/g, "/").split("?")[0].trim();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
70
68
|
function initScrollAssist(el, { pxPerSecond = 80, assistClassName = "tmg-video-controls-scroll-assist", vertical = true, horizontal = true } = {}) {
|
|
71
69
|
t007._scrollers ??= /* @__PURE__ */ new WeakMap();
|
|
72
70
|
t007._scroller_r_observer ??= new ResizeObserver((entries) => entries.forEach(({ target }) => t007._scrollers.get(target)?.update()));
|
package/dist/standalone.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
// ../utils/
|
|
1
|
+
// ../utils/dist/index.js
|
|
2
2
|
function isDef(val) {
|
|
3
3
|
return "undefined" !== typeof val;
|
|
4
4
|
}
|
|
5
|
-
|
|
6
|
-
// ../utils/dist/index.js
|
|
7
5
|
function isSym(val) {
|
|
8
6
|
return "symbol" === typeof val;
|
|
9
7
|
}
|
|
@@ -13,15 +11,6 @@ function isStr(val) {
|
|
|
13
11
|
function isArr(obj) {
|
|
14
12
|
return Array.isArray(obj);
|
|
15
13
|
}
|
|
16
|
-
function isSameURL(src1, src2) {
|
|
17
|
-
if (!isStr(src1) || !isStr(src2) || !src1 || !src2) return false;
|
|
18
|
-
try {
|
|
19
|
-
const u1 = new URL(src1, window.location.href), u2 = new URL(src2, window.location.href);
|
|
20
|
-
return decodeURIComponent(u1.origin + u1.pathname) === decodeURIComponent(u2.origin + u2.pathname);
|
|
21
|
-
} catch {
|
|
22
|
-
return src1.replace(/\\/g, "/").split("?")[0].trim() === src2.replace(/\\/g, "/").split("?")[0].trim();
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
14
|
function createEl(tag, props, dataset, styles, el = tag ? document?.createElement(tag) : null) {
|
|
26
15
|
return assignEl(el, props, dataset, styles), el;
|
|
27
16
|
}
|
|
@@ -65,6 +54,15 @@ function loadResource(req, type = "style", { module, media, crossOrigin, integri
|
|
|
65
54
|
});
|
|
66
55
|
return w.t007._resourceCache[src];
|
|
67
56
|
}
|
|
57
|
+
function isSameURL(src1, src2) {
|
|
58
|
+
if (!isStr(src1) || !isStr(src2) || !src1 || !src2) return false;
|
|
59
|
+
try {
|
|
60
|
+
const u1 = new URL(src1, window.location.href), u2 = new URL(src2, window.location.href);
|
|
61
|
+
return decodeURIComponent(u1.origin + u1.pathname) === decodeURIComponent(u2.origin + u2.pathname);
|
|
62
|
+
} catch {
|
|
63
|
+
return src1.replace(/\\/g, "/").split("?")[0].trim() === src2.replace(/\\/g, "/").split("?")[0].trim();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
68
66
|
function initScrollAssist(el, { pxPerSecond = 80, assistClassName = "tmg-video-controls-scroll-assist", vertical = true, horizontal = true } = {}) {
|
|
69
67
|
t007._scrollers ??= /* @__PURE__ */ new WeakMap();
|
|
70
68
|
t007._scroller_r_observer ??= new ResizeObserver((entries) => entries.forEach(({ target }) => t007._scrollers.get(target)?.update()));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@t007/input",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"description": "A lightweight, pure JS input system.",
|
|
5
5
|
"author": "Oketade Oluwatobiloba <tobioketade007@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -57,6 +57,6 @@
|
|
|
57
57
|
"monkey-patch"
|
|
58
58
|
],
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@t007/utils": "^0.0.
|
|
60
|
+
"@t007/utils": "^0.0.15"
|
|
61
61
|
}
|
|
62
62
|
}
|