narrat 2.13.0-alpha.1 → 2.13.0

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/narrat.es.js CHANGED
@@ -38748,7 +38748,7 @@ const ev = "###_--_~=:;_JUMP", pw = "###_--_~=:;_RETURN", _te = "###_--_~=:;_OK"
38748
38748
  function xte(t) {
38749
38749
  return t === ev || t === pw || t === _te || t === tv;
38750
38750
  }
38751
- const jte = "2.13.0-alpha.1", Ste = new Date("2023-04-13T20:03:31.854Z"), Cte = 400, Ay = 20;
38751
+ const jte = "2.13.0", Ste = new Date("2023-04-13T20:55:02.163Z"), Cte = 400, Ay = 20;
38752
38752
  /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
38753
38753
  function PL(t) {
38754
38754
  return typeof t > "u" || t === null;
@@ -40982,21 +40982,26 @@ const as = oi("hud", {
40982
40982
  }
40983
40983
  }
40984
40984
  }), fo = oi("notifications", {
40985
- state: () => ({ notifications: {}, enabled: !0 }),
40985
+ state: () => ({ notifications: [], enabled: !0 }),
40986
40986
  actions: {
40987
40987
  async addNotification(t, e, n) {
40988
40988
  if (!this.enabled)
40989
40989
  return;
40990
40990
  t = Xs(t);
40991
40991
  const r = `${Date.now()}-${Math.random() * 1e4}`;
40992
- this.notifications[r] = {
40992
+ this.notifications.push({
40993
+ id: r,
40993
40994
  text: t,
40994
40995
  description: e,
40995
40996
  icon: n
40996
- }, gt().notifications.alsoPrintInDialogue && ML(`[NOTIFICATION] ${t}`), await ea(gt().notifications.timeOnScreen * 1e3);
40997
+ }), gt().notifications.alsoPrintInDialogue && ML(`[NOTIFICATION] ${t}`), await ea(gt().notifications.timeOnScreen * 1e3), this.deleteNotification(r);
40997
40998
  },
40998
40999
  deleteNotification(t) {
40999
- delete this.notifications[t];
41000
+ const e = this.findNotifications(t);
41001
+ e && this.notifications.splice(this.notifications.indexOf(e), 1);
41002
+ },
41003
+ findNotifications(t) {
41004
+ return this.notifications.find((e) => e.id === t);
41000
41005
  },
41001
41006
  disableNotifications() {
41002
41007
  this.enabled = !1;