@useinsider/guido 3.0.0-beta.9c9adc6 → 3.0.0-beta.9cfef1c

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,5 +1,5 @@
1
1
  import { usePartner as N } from "../../composables/usePartner.js";
2
- import { LINK_REGEXES as l, LINK_TYPES as g, INSIDER_ID as f, URLS as S } from "../../enums/unsubscribe.js";
2
+ import { LINK_REGEXES as l, LINK_TYPES as S, INSIDER_ID as R, URLS as _ } from "../../enums/unsubscribe.js";
3
3
  import { parsePageList as U } from "../../extensions/Blocks/Unsubscribe/utils/utils.js";
4
4
  import { useConfigStore as B } from "../../stores/config.js";
5
5
  import { useDynamicContentStore as y } from "../../stores/dynamic-content.js";
@@ -16,25 +16,25 @@ const D = [
16
16
  let e = t;
17
17
  const r = `/${i()}/email/${a}?user={{iid}}`;
18
18
  return new DOMParser().parseFromString(e, "text/html").querySelectorAll(".unsubscribe-block-v2[data-unsubscribe-page-list]").forEach((p) => {
19
- var b;
19
+ var g;
20
20
  const m = p.getAttribute("data-unsubscribe-page-list");
21
21
  if (!m)
22
22
  return;
23
- const R = U(m), d = ((b = u.templates) == null ? void 0 : b.filter(
24
- (o) => R.includes(o.id)
25
- )) ?? [], _ = d.some((o) => o.type === g.UNSUBSCRIBE_LINK_TYPE), I = d.some((o) => o.type === g.PREFERENCES_LINK_TYPE), E = p.outerHTML;
26
- let s = E;
27
- _ && (n.selectedDynamicContentList.push({
28
- text: f,
29
- value: f,
23
+ const I = U(m), d = ((g = u.templates) == null ? void 0 : g.filter(
24
+ (o) => I.includes(o.id)
25
+ )) ?? [], E = d.some((o) => o.type === S.UNSUBSCRIBE_LINK_TYPE), b = d.some((o) => o.type === S.PREFERENCES_LINK_TYPE), f = p.outerHTML;
26
+ let s = f;
27
+ (E || b) && n.selectedDynamicContentList.push({
28
+ text: R,
29
+ value: R,
30
30
  fallback: ""
31
- }), s = s.replace(
31
+ }), E && (s = s.replace(
32
32
  l.GLOBAL_UNSUBSCRIBE_LINK_REGEX,
33
- S.UNSUBSCRIBE_URL + r
34
- )), I && (s = s.replace(
33
+ _.UNSUBSCRIBE_URL + r
34
+ )), b && (s = s.replace(
35
35
  l.PREFERENCES_UNSUBSCRIBE_LINK_REGEX,
36
- S.PREFERENCES_URL + r
37
- )), s = s.replace(l.UNSUBSCRIBE_LINK_REGEX, ""), e = e.replace(E, s);
36
+ _.PREFERENCES_URL + r
37
+ )), s = s.replace(l.UNSUBSCRIBE_LINK_REGEX, ""), e = e.replace(f, s);
38
38
  }), e;
39
39
  },
40
40
  priority: 60
@@ -40,6 +40,9 @@ class T extends B {
40
40
  this.api.translate("This block is switched from the Old Version to the New Version. We recommend you check the Recommendation block and test your message to ensure it works properly.")
41
41
  );
42
42
  }
43
+ allowInnerBlocksDND() {
44
+ return !1;
45
+ }
43
46
  /**
44
47
  * Returns the template HTML for a new recommendation block.
45
48
  * Generates a unique recommendation ID and embeds the instance class
@@ -22,6 +22,7 @@ export declare class RecommendationBlock extends Block {
22
22
  getName(): string;
23
23
  getDescription(): string;
24
24
  getSettingsPanelTitleHtml(): string;
25
+ allowInnerBlocksDND(): boolean;
25
26
  /**
26
27
  * Returns the template HTML for a new recommendation block.
27
28
  * Generates a unique recommendation ID and embeds the instance class
@@ -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.0.0-beta.9c9adc6",
3
+ "version": "3.0.0-beta.9cfef1c",
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",