@useinsider/guido 3.1.0 → 3.1.1

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,31 +1,33 @@
1
1
  import { ToasterTypeOptions as T } from "../enums/toaster.js";
2
- import { useToasterStore as u } from "../stores/toaster.js";
3
- import { watch as c } from "vue";
4
- const d = () => {
5
- const t = u();
2
+ import { useToasterStore as c } from "../stores/toaster.js";
3
+ import { watch as u, nextTick as l } from "vue";
4
+ const p = () => {
5
+ const t = c();
6
6
  let o = null;
7
7
  const s = () => {
8
8
  o && (clearTimeout(o), o = null);
9
9
  };
10
10
  function r(e = { message: "" }) {
11
- s(), t.hideToaster(), t.showToaster(e);
11
+ s(), t.hideToaster(), l(() => {
12
+ t.showToaster(e);
13
+ });
12
14
  }
13
15
  function i() {
14
16
  s(), t.hideToaster();
15
17
  }
16
- function a(e, n) {
18
+ function n(e, a) {
17
19
  const m = e instanceof Error ? e.message : String(e);
18
- r({ type: T.Alert, message: `${n}: ${m}` });
20
+ r({ type: T.Alert, message: `${a}: ${m}` });
19
21
  }
20
- return c(
22
+ return u(
21
23
  () => t.shouldAutoHide,
22
24
  (e) => {
23
25
  s(), e && (o = setTimeout(() => {
24
26
  t.hideToaster(), s();
25
27
  }, 6e3));
26
28
  }
27
- ), { showToaster: r, hideToaster: i, handleError: a };
29
+ ), { showToaster: r, hideToaster: i, handleError: n };
28
30
  };
29
31
  export {
30
- d as useToaster
32
+ p as useToaster
31
33
  };
@@ -1,27 +1,27 @@
1
- import { ToasterTypeOptions as s } from "../enums/toaster.js";
1
+ import { ToasterTypeOptions as e } from "../enums/toaster.js";
2
2
  import { defineStore as i } from "pinia";
3
3
  const a = () => ({
4
4
  status: !1,
5
- type: s.Success,
5
+ type: e.Success,
6
6
  text: "",
7
7
  icon: "",
8
8
  withIcon: !0,
9
9
  withoutLeftMargin: !1,
10
10
  actionButton: void 0
11
- }), u = i("guidoToaster", {
11
+ }), n = i("guidoToaster", {
12
12
  state: () => a(),
13
13
  getters: {
14
14
  shouldAutoHide: (t) => t.status && !!t.text
15
15
  },
16
16
  actions: {
17
- showToaster({ type: t = s.Success, message: e, actionButton: o }) {
18
- this.status = !0, this.text = e, this.type = t, this.actionButton = o;
17
+ showToaster({ type: t = e.Success, message: s, actionButton: o }) {
18
+ this.status = !0, this.text = s, this.type = t, this.actionButton = o;
19
19
  },
20
20
  hideToaster() {
21
- this.status = !1, this.text = "", this.actionButton = void 0;
21
+ this.status = !1;
22
22
  }
23
23
  }
24
24
  });
25
25
  export {
26
- u as useToasterStore
26
+ n as useToasterStore
27
27
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
5
5
  "main": "./dist/guido.umd.cjs",
6
6
  "module": "./dist/library.js",