kitzo 2.3.44 → 2.3.45

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.
@@ -1,6 +1,6 @@
1
1
  import b from "../triggerToasts.js";
2
2
  let s = !1, e = null, c = null, m = 0, r = 0, a = !1, l = null;
3
- const L = 2, y = 90, S = 20, g = 100;
3
+ const L = 2, y = 65, S = 20, g = 100;
4
4
  function x(t) {
5
5
  const o = Math.sign(t) || 1, n = Math.abs(t), h = S * (1 - Math.exp(-n / g));
6
6
  return o * h;
@@ -1,8 +1,8 @@
1
- import { createToast as a, updateToast as s, genId as c } from "./createToast.js";
1
+ import { createToast as n, updateToast as s, genId as c } from "./createToast.js";
2
2
  import { notify as i } from "./listenars.js";
3
3
  const e = (r, t) => {
4
4
  r != null && i(
5
- a({
5
+ n({
6
6
  type: "default",
7
7
  action: "add",
8
8
  content: r,
@@ -11,11 +11,15 @@ const e = (r, t) => {
11
11
  );
12
12
  };
13
13
  e.dismiss = (r, t) => {
14
- i({ action: "dismiss", id: r, toasterId: `${t}` });
14
+ i({
15
+ action: "dismiss",
16
+ id: r,
17
+ toasterId: t
18
+ });
15
19
  };
16
20
  e.info = (r, t) => {
17
21
  r != null && i(
18
- a({
22
+ n({
19
23
  action: "add",
20
24
  type: "info",
21
25
  content: r,
@@ -25,7 +29,7 @@ e.info = (r, t) => {
25
29
  };
26
30
  e.success = (r, t) => {
27
31
  r != null && i(
28
- a({
32
+ n({
29
33
  action: "add",
30
34
  type: "success",
31
35
  content: r,
@@ -35,7 +39,7 @@ e.success = (r, t) => {
35
39
  };
36
40
  e.warning = (r, t) => {
37
41
  r != null && i(
38
- a({
42
+ n({
39
43
  action: "add",
40
44
  type: "warning",
41
45
  content: r,
@@ -45,7 +49,7 @@ e.warning = (r, t) => {
45
49
  };
46
50
  e.error = (r, t) => {
47
51
  r != null && i(
48
- a({
52
+ n({
49
53
  action: "add",
50
54
  type: "error",
51
55
  content: r,
@@ -55,7 +59,7 @@ e.error = (r, t) => {
55
59
  };
56
60
  e.loading = (r, t) => {
57
61
  r != null && i(
58
- a({
62
+ n({
59
63
  action: "add",
60
64
  type: "loading",
61
65
  content: r,
@@ -65,7 +69,7 @@ e.loading = (r, t) => {
65
69
  };
66
70
  e.custom = (r, t) => {
67
71
  r != null && i(
68
- a({
72
+ n({
69
73
  action: "add",
70
74
  type: "custom",
71
75
  content: r,
@@ -73,25 +77,25 @@ e.custom = (r, t) => {
73
77
  })
74
78
  );
75
79
  };
76
- e.update = (r, t, n) => {
77
- r != null && t != null && i(s({ id: `${r}`, content: t, options: n }));
80
+ e.update = (r, t, a) => {
81
+ r != null && t != null && i(s({ id: `${r}`, content: t, options: a }));
78
82
  };
79
- e.promise = (async (r, t, n) => {
83
+ e.promise = (async (r, t, a) => {
80
84
  const u = c();
81
85
  i(
82
- a({
86
+ n({
83
87
  action: "add",
84
88
  type: "loading",
85
89
  content: t.loading,
86
- options: { ...n, id: u, duration: 1 / 0, swipeToClose: !1 }
90
+ options: { ...a, id: u, duration: 1 / 0, swipeToClose: !1 }
87
91
  })
88
92
  );
89
93
  try {
90
94
  const o = await r, d = typeof t.success == "function" ? await t.success(o) : t.success;
91
- return e.update(u, d, { ...n, type: "success" }), o;
95
+ return e.update(u, d, { ...a, type: "success" }), o;
92
96
  } catch (o) {
93
97
  const d = typeof t.error == "function" ? await t.error(o) : t.error;
94
- throw e.update(u, d, { ...n, type: "error" }), o;
98
+ throw e.update(u, d, { ...a, type: "error" }), o;
95
99
  }
96
100
  });
97
101
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kitzo",
3
- "version": "2.3.44",
3
+ "version": "2.3.45",
4
4
  "description": "A lightweight React micro-utility.",
5
5
  "type": "module",
6
6
  "files": [