@t007/toast 0.0.28 → 0.0.30
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.css +0 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.global.js +10 -7
- package/package.json +2 -2
package/dist/index.css
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export type ToastType = "info" | "success" | "error" | "warning";
|
|
|
6
6
|
export type ToastPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right" | "center-left" | "center-center" | "center-right";
|
|
7
7
|
/** Motion preset used when a toast enters or leaves the screen. */
|
|
8
8
|
export type ToastAnimation = "fade" | "zoom" | "slide" | "slide-left" | "slide-right" | "slide-up" | "slide-down" | boolean;
|
|
9
|
-
/** Allowed drag directions for dismiss gestures. */
|
|
9
|
+
/** Allowed drag directions for dismiss gestures. `|` combines axes where it can be `a` or `b` and can change anytime while `||` does not change after a pick is determined. */
|
|
10
10
|
export type ToastDragDir = "x" | "y" | "xy" | "x|y" | "x||y" | "x+" | "x-" | "y+" | "y-" | "xy+" | "xy-" | "x|y+" | "x|y-" | "x||y+" | "x||y-";
|
|
11
11
|
|
|
12
12
|
/** Configuration object for creating and updating a toast. */
|
package/dist/index.global.js
CHANGED
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
// ../../../sia-reactor/dist/chunk-
|
|
43
|
+
// ../../../sia-reactor/dist/chunk-4PLMBUCP.js
|
|
44
44
|
var CTX = {
|
|
45
45
|
/** Flag indicating whether the application is running in development mode. */
|
|
46
46
|
isDevEnv: "undefined" !== typeof process ? process.env.NODE_ENV !== "production" : true,
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
return "object" === typeof obj && obj !== null && (arraycheck ? !Array.isArray(obj) : true);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
// ../utils/dist/chunk-
|
|
59
|
+
// ../utils/dist/chunk-4O76EZJ4.js
|
|
60
60
|
var INTERACTIVE_SELECTOR = ":is(button,[href],input:not([type='hidden']),select,textarea,details>summary,[contenteditable='true'],iframe,audio[controls],video[controls],[tabindex]):not([disabled],[tabindex='-1'],[data-focus-guard],[inert],[inert] *)";
|
|
61
61
|
var isInteractive = (target) => target instanceof HTMLElement && target.matches(INTERACTIVE_SELECTOR);
|
|
62
62
|
var VIRTUAL_RESOURCE = /* @__PURE__ */ Symbol.for("T007_VIRTUAL_RESOURCE");
|
|
@@ -105,15 +105,18 @@
|
|
|
105
105
|
function uid(prefix = "") {
|
|
106
106
|
return prefix + Date.now().toString(36) + "_" + performance.now().toString(36).replace(".", "") + "_" + Math.random().toString(36).slice(2);
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
if (!isStr(src1) || !isStr(src2) || !src1 || !src2) return false;
|
|
108
|
+
function cleanURL(url) {
|
|
110
109
|
try {
|
|
111
|
-
const
|
|
112
|
-
return decodeURIComponent(
|
|
110
|
+
const u = new URL(url, window.location.href);
|
|
111
|
+
return decodeURIComponent(u.origin + u.pathname);
|
|
113
112
|
} catch {
|
|
114
|
-
return
|
|
113
|
+
return url.replace(/\\/g, "/").split("?")[0].trim();
|
|
115
114
|
}
|
|
116
115
|
}
|
|
116
|
+
function isSameURL(url1, url2) {
|
|
117
|
+
if (!isStr(url1) || !isStr(url2) || !url1 || !url2) return false;
|
|
118
|
+
return cleanURL(url1) === cleanURL(url2);
|
|
119
|
+
}
|
|
117
120
|
if ("undefined" !== typeof window) {
|
|
118
121
|
(window.t007 ??= {}).VIRTUAL_RESOURCE = VIRTUAL_RESOURCE;
|
|
119
122
|
window.T007_TOAST_JS_SRC ??= `https://cdn.jsdelivr.net/npm/@t007/toast@latest`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@t007/toast",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.30",
|
|
4
4
|
"description": "A lightweight, pure JS toast system.",
|
|
5
5
|
"author": "Oketade Oluwatobiloba <tobioketade007@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"promise"
|
|
55
55
|
],
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@t007/utils": "^0.0.
|
|
57
|
+
"@t007/utils": "^0.0.32"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"esbuild-sass-plugin": "^3.7.0"
|