@t007/toast 0.0.29 → 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 CHANGED
@@ -426,7 +426,6 @@
426
426
  flex-grow: 1;
427
427
  height: fit-content;
428
428
  border-radius: calc(var(--t007-toast-unit) / 5);
429
- padding: calc(var(--t007-toast-unit) / 7.5);
430
429
  overflow: hidden;
431
430
  }
432
431
  .t007-toast-body-text {
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. */
@@ -40,7 +40,7 @@
40
40
  });
41
41
  }
42
42
 
43
- // ../../../sia-reactor/dist/chunk-EZ4VRGYI.js
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-Y5YJMRXD.js
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 isSameURL(src1, src2) {
109
- if (!isStr(src1) || !isStr(src2) || !src1 || !src2) return false;
108
+ function cleanURL(url) {
110
109
  try {
111
- const u1 = new URL(src1, window.location.href), u2 = new URL(src2, window.location.href);
112
- return decodeURIComponent(u1.origin + u1.pathname) === decodeURIComponent(u2.origin + u2.pathname);
110
+ const u = new URL(url, window.location.href);
111
+ return decodeURIComponent(u.origin + u.pathname);
113
112
  } catch {
114
- return src1.replace(/\\/g, "/").split("?")[0].trim() === src2.replace(/\\/g, "/").split("?")[0].trim();
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.29",
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.31"
57
+ "@t007/utils": "^0.0.32"
58
58
  },
59
59
  "devDependencies": {
60
60
  "esbuild-sass-plugin": "^3.7.0"