vue-toasts-lite 0.1.5 → 0.1.6

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.
Files changed (3) hide show
  1. package/README.md +0 -3
  2. package/dist/index.js +12 -12
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -7,9 +7,6 @@ A lightweight toast notifications library for Vue 3.
7
7
 
8
8
  📖 **[Check docs](https://scheron.github.io/vue-toasts-lite/)**
9
9
 
10
- > ⚠️ **Note**: This is primarily a personal utility library created for my own use. I don't discourage others from using it, but I should mention that I'm not currently using it in production myself. The main purpose of this library is to provide me with a simple and quick way to integrate toast notifications into my personal projects without the need to configure and set up larger, more complex libraries. If you find it useful, feel free to use it, but keep in mind that it's tailored to my personal needs and workflow.
11
-
12
-
13
10
  ## Features
14
11
 
15
12
  - 🚀 Lightweight and easy to use
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  var M = Object.defineProperty;
2
2
  var U = (r, t, e) => t in r ? M(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
3
  var m = (r, t, e) => U(r, typeof t != "symbol" ? t + "" : t, e);
4
- import { ref as p, defineComponent as D, watch as $, onMounted as L, onUnmounted as k, createElementBlock as y, openBlock as d, withModifiers as A, normalizeStyle as E, createCommentVNode as x, createElementVNode as h, normalizeClass as g, toDisplayString as B, computed as P, createBlock as C, Teleport as I, Fragment as b, renderList as w, unref as v, createVNode as N, TransitionGroup as R, withCtx as S } from "vue";
4
+ import { ref as p, defineComponent as D, watch as $, onMounted as L, onUnmounted as k, createElementBlock as y, openBlock as d, withModifiers as A, normalizeStyle as E, createCommentVNode as x, createElementVNode as h, normalizeClass as g, toDisplayString as B, computed as P, createBlock as C, Teleport as I, Fragment as w, renderList as b, unref as v, createVNode as N, TransitionGroup as R, withCtx as S } from "vue";
5
5
  class V extends Map {
6
6
  constructor() {
7
7
  super(...arguments);
@@ -33,7 +33,7 @@ const T = {
33
33
  duration: 3e3,
34
34
  position: "top-center"
35
35
  };
36
- class j {
36
+ class z {
37
37
  constructor() {
38
38
  m(this, "counter", 0);
39
39
  m(this, "toasts");
@@ -306,7 +306,7 @@ class j {
306
306
  let { id: e = this.ID(), ...o } = t;
307
307
  if (this.toasts.has(e)) {
308
308
  const n = this.toasts.get(e);
309
- return Object.assign(n, o), this.toasts.set(e, n), e;
309
+ return this.toasts.set(e, { ...n, ...o }), e;
310
310
  }
311
311
  return this.toasts.set(e, { ...this.mergeWithDefaultOptions(o), id: e }), e;
312
312
  }
@@ -319,8 +319,8 @@ class j {
319
319
  return e;
320
320
  }
321
321
  }
322
- const O = new j();
323
- function z() {
322
+ const O = new z();
323
+ function F() {
324
324
  const r = p(/* @__PURE__ */ new Map());
325
325
  function t(n, s, a) {
326
326
  r.value.has(n) || r.value.set(n, []);
@@ -341,10 +341,10 @@ function z() {
341
341
  resumeAll: o
342
342
  };
343
343
  }
344
- const F = {
344
+ const W = {
345
345
  key: 0,
346
346
  class: "toasts-lite__icon"
347
- }, W = { class: "toasts-lite__content" }, G = { class: "toasts-lite__content-message" }, H = /* @__PURE__ */ D({
347
+ }, j = { class: "toasts-lite__content" }, G = { class: "toasts-lite__content-message" }, H = /* @__PURE__ */ D({
348
348
  __name: "ToastsLiteItem",
349
349
  props: {
350
350
  id: {},
@@ -386,12 +386,12 @@ const F = {
386
386
  style: E(`--toast-duration: ${r.duration}s;`),
387
387
  onClick: A(c, ["prevent"])
388
388
  }, [
389
- ["success", "error", "loading", "warn", "info"].includes(r.type) ? (d(), y("div", F, [
389
+ ["success", "error", "loading", "warn", "info"].includes(r.type) ? (d(), y("div", W, [
390
390
  h("div", {
391
391
  class: g(`toasts-lite__${r.type}`)
392
392
  }, null, 2)
393
393
  ])) : x("", !0),
394
- h("div", W, [
394
+ h("div", j, [
395
395
  h("div", G, B(r.message), 1)
396
396
  ])
397
397
  ], 4));
@@ -404,7 +404,7 @@ const F = {
404
404
  itemClass: {}
405
405
  },
406
406
  setup(r) {
407
- const t = ["top-left", "top-center", "top-right", "middle-center", "bottom-left", "bottom-center", "bottom-right"], e = p([]), { setRef: o, pauseAll: n, resumeAll: s } = z();
407
+ const t = ["top-left", "top-center", "top-right", "middle-center", "bottom-left", "bottom-center", "bottom-right"], e = p([]), { setRef: o, pauseAll: n, resumeAll: s } = F();
408
408
  O.onToastsListChange((i) => {
409
409
  e.value = i;
410
410
  });
@@ -416,7 +416,7 @@ const F = {
416
416
  }), i;
417
417
  });
418
418
  return (i, c) => (d(), C(I, { to: "body" }, [
419
- (d(), y(b, null, w(t, (u) => h("div", {
419
+ (d(), y(w, null, b(t, (u) => h("div", {
420
420
  key: u,
421
421
  class: g(["toasts-lite__toast-container", [r.containerClass, `toasts-lite__${u}`]])
422
422
  }, [
@@ -430,7 +430,7 @@ const F = {
430
430
  appear: ""
431
431
  }, {
432
432
  default: S(() => [
433
- (d(!0), y(b, null, w(a.value.get(u) || [], (l, f) => (d(), C(H, {
433
+ (d(!0), y(w, null, b(a.value.get(u) || [], (l, f) => (d(), C(H, {
434
434
  id: l.id,
435
435
  ref_for: !0,
436
436
  ref: (_) => v(o)(u, f, _),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-toasts-lite",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "type": "module",
5
5
  "types": "./dist/index.d.ts",
6
6
  "author": "scheron",