@useinsider/guido 1.0.3-beta.80f253d → 1.0.3-beta.81b84f8

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 (39) hide show
  1. package/README.md +1 -0
  2. package/dist/components/Guido.vue.js +1 -1
  3. package/dist/components/Guido.vue2.js +36 -33
  4. package/dist/components/organisms/header/RightSlot.vue.js +1 -1
  5. package/dist/components/organisms/header/RightSlot.vue2.js +23 -22
  6. package/dist/composables/useGuidoActions.js +19 -9
  7. package/dist/config/compiler/unsubscribeCompilerRules.js +33 -28
  8. package/dist/enums/environment.js +5 -0
  9. package/dist/enums/unsubscribe.js +27 -25
  10. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +1 -1
  11. package/dist/guido.css +1 -1
  12. package/dist/package.json.js +1 -1
  13. package/dist/src/components/Guido.vue.d.ts +1 -0
  14. package/dist/src/composables/useGuidoActions.d.ts +9 -0
  15. package/dist/src/enums/environment.d.ts +5 -0
  16. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -1
  17. package/dist/src/stores/config.d.ts +1 -1
  18. package/dist/src/stores/dynamic-content.d.ts +1 -1
  19. package/dist/src/stores/editor.d.ts +1 -1
  20. package/dist/src/stores/onboarding.d.ts +1 -1
  21. package/dist/src/stores/preview.d.ts +1 -1
  22. package/dist/src/stores/recommendation.d.ts +1 -1
  23. package/dist/src/stores/save-as-template.d.ts +1 -1
  24. package/dist/src/stores/toaster.d.ts +1 -1
  25. package/dist/src/stores/unsubscribe.d.ts +1 -1
  26. package/dist/src/stores/version-history.d.ts +1 -1
  27. package/dist/src/utils/environmentUtil.d.ts +8 -0
  28. package/dist/stores/config.js +5 -5
  29. package/dist/stores/dynamic-content.js +1 -1
  30. package/dist/stores/editor.js +1 -1
  31. package/dist/stores/onboarding.js +27 -27
  32. package/dist/stores/preview.js +1 -1
  33. package/dist/stores/recommendation.js +3 -3
  34. package/dist/stores/save-as-template.js +2 -2
  35. package/dist/stores/toaster.js +1 -1
  36. package/dist/stores/unsubscribe.js +1 -1
  37. package/dist/stores/version-history.js +4 -4
  38. package/dist/utils/environmentUtil.js +6 -0
  39. package/package.json +2 -2
package/README.md CHANGED
@@ -167,6 +167,7 @@ export default {
167
167
  | `on-change` | void | It Fires once for managing leave modal etc. |
168
168
  | `ready` | void | Fired when the editor is ready and template is loaded |
169
169
  | `onboarding-finished` | void | Fired when the onboarding popup is dismissed or completed, allowing parent applications to track onboarding state |
170
+ | `test-email:click` | - | Fired when user clicks the test email button in the header |
170
171
 
171
172
  ### Guido Exposed Methods
172
173
  ```typescript
@@ -12,7 +12,7 @@ var t = function() {
12
12
  n,
13
13
  !1,
14
14
  null,
15
- "3c910a93"
15
+ "e299731b"
16
16
  );
17
17
  const v = s.exports;
18
18
  export {
@@ -1,8 +1,8 @@
1
- import { defineComponent as R, defineAsyncComponent as I, ref as x, computed as U, watch as M, onMounted as z, onUnmounted as B } from "vue";
1
+ import { defineComponent as R, defineAsyncComponent as G, ref as x, computed as I, watch as M, onMounted as z, onUnmounted as B } from "vue";
2
2
  import { provideGuidoActions as K } from "../composables/useGuidoActions.js";
3
3
  import { usePartner as O } from "../composables/usePartner.js";
4
4
  import { useStripo as j } from "../composables/useStripo.js";
5
- import { migrate as W } from "../config/migrator/index.js";
5
+ import { migrate as U } from "../config/migrator/index.js";
6
6
  import { DefaultUsername as q, DefaultMessageType as J, DefaultGuidoConfig as Q } from "../enums/defaults.js";
7
7
  import V from "./organisms/base/Toaster.vue.js";
8
8
  import X from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
@@ -14,10 +14,10 @@ import { useStripoApi as oe } from "../services/stripoApi.js";
14
14
  import { useConfigStore as te } from "../stores/config.js";
15
15
  import { useDynamicContentStore as ne } from "../stores/dynamic-content.js";
16
16
  import { useEditorStore as re } from "../stores/editor.js";
17
- import { usePreviewStore as ae } from "../stores/preview.js";
18
- import { useUnsubscribeStore as ie } from "../stores/unsubscribe.js";
19
- import se from "../node_modules/lodash-es/merge.js";
20
- const Ge = /* @__PURE__ */ R({
17
+ import { usePreviewStore as ie } from "../stores/preview.js";
18
+ import { useUnsubscribeStore as se } from "../stores/unsubscribe.js";
19
+ import ae from "../node_modules/lodash-es/merge.js";
20
+ const ke = /* @__PURE__ */ R({
21
21
  __name: "Guido",
22
22
  props: {
23
23
  templateId: null,
@@ -31,81 +31,84 @@ const Ge = /* @__PURE__ */ R({
31
31
  guidoConfig: null,
32
32
  templateConfig: null
33
33
  },
34
- emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished"],
35
- setup(_, { expose: L, emit: t }) {
36
- const u = _, k = I(
34
+ emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
35
+ setup(W, { expose: _, emit: o }) {
36
+ const l = W, L = G(
37
37
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
38
- ), A = I(
38
+ ), A = G(
39
39
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
40
- ), l = x(), a = ne(), p = ie(), g = te(), i = re(), N = ae(), n = U(() => i.hasChanges), { getPartnerName: f, getProductType: y, isTestPartner: F } = O(), v = () => {
40
+ ), u = x(), i = ne(), p = se(), g = te(), s = re(), N = ie(), n = I(() => s.hasChanges), { getPartnerName: f, getProductType: y, isTestPartner: F } = O(), v = () => {
41
41
  var e;
42
- return (e = l.value) == null ? void 0 : e.handleSave(!0);
42
+ return (e = u.value) == null ? void 0 : e.handleSave(!0);
43
43
  }, {
44
- templateId: s,
44
+ templateId: a,
45
45
  userId: b,
46
46
  guidoConfig: C,
47
- templateConfig: o,
47
+ templateConfig: t,
48
48
  html: r = "",
49
49
  css: h = "",
50
50
  partnerName: c = f(),
51
51
  productType: d = y(),
52
52
  messageType: S = J,
53
53
  username: w = q
54
- } = u, m = (o == null ? void 0 : o.preselectedDynamicContentList) || [];
55
- i.templateId = s, window.GuidoConfig = se(Q, C), window.GuidoConfig.partner = {
54
+ } = l, m = (t == null ? void 0 : t.preselectedDynamicContentList) || [];
55
+ s.templateId = a, window.GuidoConfig = ae(Q, C), window.GuidoConfig.partner = {
56
56
  partnerName: c,
57
57
  productType: d,
58
58
  messageType: S
59
- }, g.templateConfig = o;
59
+ }, g.templateConfig = t;
60
60
  const { initPlugin: D } = j({
61
- emailId: s,
61
+ emailId: a,
62
62
  userId: b,
63
63
  username: w,
64
64
  partnerName: c,
65
65
  productType: d,
66
66
  preselectedDynamicContentList: m,
67
67
  onReady: () => {
68
- console.debug("guido:ready"), t("ready");
68
+ console.debug("guido:ready"), o("ready");
69
69
  }
70
- }), { getDefaultTemplate: T } = oe(), H = U(() => {
70
+ }), { getDefaultTemplate: T } = oe(), H = I(() => {
71
71
  var e;
72
72
  return !((e = window.GuidoConfig) != null && e.useHeader);
73
73
  });
74
74
  K({
75
75
  onBack: () => {
76
- console.debug("guido:back"), t("back");
76
+ console.debug("guido:back"), o("back");
77
77
  },
78
78
  onSaveStart: () => {
79
- console.debug("guido:save:start"), t("save:start");
79
+ console.debug("guido:save:start"), o("save:start");
80
80
  },
81
81
  onSaveComplete: (e) => {
82
- console.debug("guido:save:complete", e), t("save:complete", e);
82
+ console.debug("guido:save:complete", e), o("save:complete", e);
83
+ },
84
+ onTestEmailClick: () => {
85
+ console.debug("guido:test-email:click"), o("test-email:click");
83
86
  }
84
87
  });
85
88
  const E = (e) => {
86
- console.debug("dynamic-content:close", e), a.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
89
+ console.debug("dynamic-content:close", e), i.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
87
90
  }, P = () => {
88
91
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
89
92
  };
90
93
  return M(() => n.value, () => {
91
- t("on-change", n.value);
94
+ o("on-change", n.value);
92
95
  }), z(async () => {
93
96
  console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
94
97
  try {
95
- p.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
98
+ p.selectedUnsubscribePages = (t == null ? void 0 : t.selectedUnsubscribePages) || [];
96
99
  let e = {
97
- html: r && await W(r),
100
+ html: r && await U(r),
98
101
  css: h,
99
102
  forceRecreate: !0
100
103
  // TODO: It should be false for old templates. We will communicate with Stripo
101
104
  };
102
- e.html || (e = await T(), e.html = await W(e.html)), await D(e), a.selectedDynamicContentList = m;
105
+ e.html || (e = await T(), e.html = await U(e.html)), await D(e), i.selectedDynamicContentList = m;
103
106
  } catch (e) {
104
107
  console.error("Failed to initialize Stripo editor:", e);
105
108
  }
106
109
  document.addEventListener("dynamic-content:open", (e) => {
107
- const G = e;
108
- console.debug("dynamic-content:open", G.detail), t("dynamic-content:open", G.detail);
110
+ const k = e;
111
+ console.debug("dynamic-content:open", k.detail), o("dynamic-content:open", k.detail);
109
112
  });
110
113
  }), B(() => {
111
114
  try {
@@ -113,16 +116,16 @@ const Ge = /* @__PURE__ */ R({
113
116
  } catch {
114
117
  console.debug("Failed to remove Stripo editor: No editor found");
115
118
  }
116
- }), L({
119
+ }), _({
117
120
  dynamicContent: {
118
121
  insert: E,
119
122
  close: P
120
123
  },
121
124
  hasChanges: n,
122
125
  saveSilent: v
123
- }), { __sfc: !0, PreviewContainer: k, OnboardingWrapper: A, headerWrapperRef: l, dynamicContentStore: a, unsubscribeStore: p, props: u, configStore: g, editorStore: i, previewStore: N, hasChanges: n, getPartnerName: f, getProductType: y, isTestPartner: F, saveSilent: v, templateId: s, userId: b, guidoConfig: C, templateConfig: o, html: r, css: h, partnerName: c, productType: d, messageType: S, username: w, preselectedDynamicContentList: m, emit: t, initPlugin: D, getDefaultTemplate: T, noHeader: H, insertDynamicContent: E, closeDynamicContent: P, Toaster: V, FilterSelectionDrawer: X, HeaderWrapper: Y, LoadingWrapper: Z, SaveAsTemplateDrawer: $, UnsubscribeWrapper: ee };
126
+ }), { __sfc: !0, PreviewContainer: L, OnboardingWrapper: A, headerWrapperRef: u, dynamicContentStore: i, unsubscribeStore: p, props: l, configStore: g, editorStore: s, previewStore: N, hasChanges: n, getPartnerName: f, getProductType: y, isTestPartner: F, saveSilent: v, templateId: a, userId: b, guidoConfig: C, templateConfig: t, html: r, css: h, partnerName: c, productType: d, messageType: S, username: w, preselectedDynamicContentList: m, emit: o, initPlugin: D, getDefaultTemplate: T, noHeader: H, insertDynamicContent: E, closeDynamicContent: P, Toaster: V, FilterSelectionDrawer: X, HeaderWrapper: Y, LoadingWrapper: Z, SaveAsTemplateDrawer: $, UnsubscribeWrapper: ee };
124
127
  }
125
128
  });
126
129
  export {
127
- Ge as default
130
+ ke as default
128
131
  };
@@ -3,7 +3,7 @@ import l from "../../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var r = function() {
4
4
  var o, i, n;
5
5
  var s = this, e = s._self._c, t = s._self._setupProxy;
6
- return e("div", { staticClass: "d-f" }, [(o = t.config.features) != null && o.versionHistory ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : s._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (i = t.config.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : s._e(), (n = t.config.features) != null && n.testMessage ? e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button"), "tooltip-text": t.trans("newsletter.test-email") } }) : s._e(), e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "loading-status": t.isSaving }, on: { click: function(_) {
6
+ return e("div", { staticClass: "d-f" }, [(o = t.config.features) != null && o.versionHistory ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : s._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (i = t.config.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : s._e(), (n = t.config.features) != null && n.testMessage ? e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button"), "tooltip-text": t.trans("newsletter.test-email") }, on: { click: t.testEmailClick } }) : s._e(), e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "loading-status": t.isSaving }, on: { click: function(c) {
7
7
  return t.handleSave(!1);
8
8
  } } })], 1);
9
9
  }, u = [], d = /* @__PURE__ */ l(
@@ -1,35 +1,36 @@
1
- import { defineComponent as g, ref as l, computed as H } from "vue";
2
- import { useConfig as _ } from "../../../composables/useConfig.js";
3
- import { useExport as h } from "../../../composables/useExport.js";
4
- import { useSave as V } from "../../../composables/useSave.js";
5
- import { useTranslations as x } from "../../../composables/useTranslations.js";
1
+ import { defineComponent as H, ref as p, computed as _ } from "vue";
2
+ import { useConfig as h } from "../../../composables/useConfig.js";
3
+ import { useExport as V } from "../../../composables/useExport.js";
4
+ import { useTestEmailClick as x } from "../../../composables/useGuidoActions.js";
5
+ import { useSave as E } from "../../../composables/useSave.js";
6
+ import { useTranslations as T } from "../../../composables/useTranslations.js";
6
7
  import { useVersionHistoryApi as w } from "../../../composables/useVersionHistoryApi.js";
7
- import { useEditorStore as T } from "../../../stores/editor.js";
8
- import { getTooltipOptions as E } from "../../../utils/tooltipUtils.js";
9
- import { InButtonV2 as O } from "@useinsider/design-system-vue";
10
- const z = /* @__PURE__ */ g({
8
+ import { useEditorStore as C } from "../../../stores/editor.js";
9
+ import { getTooltipOptions as O } from "../../../utils/tooltipUtils.js";
10
+ import { InButtonV2 as A } from "@useinsider/design-system-vue";
11
+ const J = /* @__PURE__ */ H({
11
12
  __name: "RightSlot",
12
- setup(A, { expose: m }) {
13
- const { config: u } = _(), { exportHtml: r } = h(), { save: n } = V(), { openVersionHistory: i, closeVersionHistory: a } = w(), o = T(), t = x(), e = l(!1), s = l(!1), c = () => {
14
- if (o.isVersionHistoryOpen) {
13
+ setup(k, { expose: m }) {
14
+ const { config: c } = h(), { exportHtml: r } = V(), { save: n } = E(), { openVersionHistory: i, closeVersionHistory: a } = w(), t = C(), o = T(), e = p(!1), s = p(!1), u = x(), f = () => {
15
+ if (t.isVersionHistoryOpen) {
15
16
  a();
16
17
  return;
17
18
  }
18
19
  i();
19
- }, f = async () => {
20
+ }, v = async () => {
20
21
  e.value = !0, await r(), e.value = !1;
21
- }, v = () => {
22
- o.isSaveAsTemplateDrawerOpen = !0;
23
- }, d = H(() => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history")), p = async (y) => {
24
- s.value = !0, o.loadingStatus = !0;
25
- const S = await n(y);
26
- return s.value = !1, o.loadingStatus = !1, S;
22
+ }, d = () => {
23
+ t.isSaveAsTemplateDrawerOpen = !0;
24
+ }, y = _(() => t.isVersionHistoryOpen ? o("newsletter.close-version-history") : o("newsletter.version-history")), l = async (S) => {
25
+ s.value = !0, t.loadingStatus = !0;
26
+ const g = await n(S);
27
+ return s.value = !1, t.loadingStatus = !1, g;
27
28
  };
28
29
  return m({
29
- handleSave: p
30
- }), { __sfc: !0, config: u, exportHtml: r, save: n, openVersionHistory: i, closeVersionHistory: a, editorStore: o, trans: t, isExporting: e, isSaving: s, handleVersionHistory: c, handleExport: f, handleSaveAs: v, versionHistoryTooltipText: d, handleSave: p, getTooltipOptions: E, InButtonV2: O };
30
+ handleSave: l
31
+ }), { __sfc: !0, config: c, exportHtml: r, save: n, openVersionHistory: i, closeVersionHistory: a, editorStore: t, trans: o, isExporting: e, isSaving: s, testEmailClick: u, handleVersionHistory: f, handleExport: v, handleSaveAs: d, versionHistoryTooltipText: y, handleSave: l, getTooltipOptions: O, InButtonV2: A };
31
32
  }
32
33
  });
33
34
  export {
34
- z as default
35
+ J as default
35
36
  };
@@ -1,6 +1,6 @@
1
1
  import { provideValue as o, useInjectedValue as t } from "./useProvideInject.js";
2
- const r = Symbol.for("guido.back"), n = Symbol.for("guido.save.start"), a = Symbol.for("guido.save.complete"), s = (e) => {
3
- o(r, e.onBack), o(n, e.onSaveStart), o(a, e.onSaveComplete);
2
+ const r = Symbol.for("guido.back"), n = Symbol.for("guido.save.start"), c = Symbol.for("guido.save.complete"), a = Symbol.for("guido.test.email.click"), i = (e) => {
3
+ o(r, e.onBack), o(n, e.onSaveStart), o(c, e.onSaveComplete), o(a, e.onTestEmailClick);
4
4
  }, u = () => {
5
5
  try {
6
6
  return t(r);
@@ -9,7 +9,7 @@ const r = Symbol.for("guido.back"), n = Symbol.for("guido.save.start"), a = Symb
9
9
  "useBack: No back handler provided. Make sure Guido component is in the component tree."
10
10
  );
11
11
  }
12
- }, d = () => {
12
+ }, l = () => {
13
13
  try {
14
14
  return t(n);
15
15
  } catch {
@@ -17,21 +17,31 @@ const r = Symbol.for("guido.back"), n = Symbol.for("guido.save.start"), a = Symb
17
17
  "useSaveStart: No save start handler provided. Make sure Guido component is in the component tree."
18
18
  );
19
19
  }
20
- }, i = () => {
20
+ }, d = () => {
21
21
  try {
22
- return t(a);
22
+ return t(c);
23
23
  } catch {
24
24
  throw new Error(
25
25
  "useSaveComplete: No save complete handler provided. Make sure Guido component is in the component tree."
26
26
  );
27
27
  }
28
+ }, m = () => {
29
+ try {
30
+ return t(a);
31
+ } catch {
32
+ throw new Error(
33
+ "useTestEmailClick: No test email click handler provided. Make sure Guido component is in the component tree."
34
+ );
35
+ }
28
36
  };
29
37
  export {
30
38
  r as BACK_KEY,
31
- a as SAVE_COMPLETE_KEY,
39
+ c as SAVE_COMPLETE_KEY,
32
40
  n as SAVE_START_KEY,
33
- s as provideGuidoActions,
41
+ a as TEST_EMAIL_CLICK_KEY,
42
+ i as provideGuidoActions,
34
43
  u as useBack,
35
- i as useSaveComplete,
36
- d as useSaveStart
44
+ d as useSaveComplete,
45
+ l as useSaveStart,
46
+ m as useTestEmailClick
37
47
  };
@@ -1,36 +1,41 @@
1
- import { usePartner as U } from "../../composables/usePartner.js";
2
- import { LINK_REGEXES as l, LINK_TYPES as b, URLS as f } from "../../enums/unsubscribe.js";
3
- import { parsePageList as B } from "../../extensions/Blocks/Unsubscribe/utils/utils.js";
4
- import { useConfigStore as N } from "../../stores/config.js";
5
- import { useUnsubscribeStore as I } from "../../stores/unsubscribe.js";
6
- const T = [
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";
3
+ import { parsePageList as U } from "../../extensions/Blocks/Unsubscribe/utils/utils.js";
4
+ import { useConfigStore as B } from "../../stores/config.js";
5
+ import { useDynamicContentStore as y } from "../../stores/dynamic-content.js";
6
+ import { useUnsubscribeStore as L } from "../../stores/unsubscribe.js";
7
+ const D = [
7
8
  {
8
9
  id: "add-unsubscribe-link-values",
9
10
  description: "Adding unsubscribe link values",
10
11
  type: "custom",
11
12
  processor: (t) => {
12
- const { getPartnerName: i } = U(), a = N(), n = I(), u = a.getVariationId;
13
- if (!u)
13
+ const { getPartnerName: i } = N(), c = B(), n = y(), u = L(), a = c.getVariationId;
14
+ if (!a)
14
15
  return t;
15
- let o = t;
16
- const e = `/${i()}/email/${u}?user={{iid}}`;
17
- return new DOMParser().parseFromString(o, "text/html").querySelectorAll(".unsubscribe-block-v2[data-unsubscribe-page-list]").forEach((p) => {
18
- var g;
19
- const d = p.getAttribute("data-unsubscribe-page-list");
20
- if (!d)
16
+ let e = t;
17
+ const r = `/${i()}/email/${a}?user={{iid}}`;
18
+ return new DOMParser().parseFromString(e, "text/html").querySelectorAll(".unsubscribe-block-v2[data-unsubscribe-page-list]").forEach((p) => {
19
+ var b;
20
+ const m = p.getAttribute("data-unsubscribe-page-list");
21
+ if (!m)
21
22
  return;
22
- const S = B(d), m = ((g = n.templates) == null ? void 0 : g.filter(
23
- (c) => S.includes(c.id)
24
- )) ?? [], R = m.some((c) => c.type === b.UNSUBSCRIBE_LINK_TYPE), _ = m.some((c) => c.type === b.PREFERENCES_LINK_TYPE), E = p.outerHTML;
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;
25
26
  let s = E;
26
- R && (s = s.replace(
27
+ _ && (n.selectedDynamicContentList.push({
28
+ text: f,
29
+ value: f,
30
+ fallback: ""
31
+ }), s = s.replace(
27
32
  l.GLOBAL_UNSUBSCRIBE_LINK_REGEX,
28
- f.UNSUBSCRIBE_URL + e
29
- )), _ && (s = s.replace(
33
+ S.UNSUBSCRIBE_URL + r
34
+ )), I && (s = s.replace(
30
35
  l.PREFERENCES_UNSUBSCRIBE_LINK_REGEX,
31
- f.PREFERENCES_URL + e
32
- )), s = s.replace(l.UNSUBSCRIBE_LINK_REGEX, ""), o = o.replace(E, s);
33
- }), o;
36
+ S.PREFERENCES_URL + r
37
+ )), s = s.replace(l.UNSUBSCRIBE_LINK_REGEX, ""), e = e.replace(E, s);
38
+ }), e;
34
39
  },
35
40
  priority: 60
36
41
  },
@@ -56,16 +61,16 @@ const T = [
56
61
  type: "custom",
57
62
  processor: (t) => {
58
63
  let i = t;
59
- const a = i.match(/<a[^>]+>(.*?)<\/a>/gm);
60
- return a && a.forEach((n) => {
64
+ const c = i.match(/<a[^>]+>(.*?)<\/a>/gm);
65
+ return c && c.forEach((n) => {
61
66
  if (n.includes("insEmail=1"))
62
67
  return;
63
68
  if (n.match(/<a\s+(?:[^>]*?\s+)?href=(["'`”])(.*?)\1\s+(?:[^>]*?\s+)?universal=(["'`”])true\3/gm)) {
64
- const o = n.replace(/href=(["'`”])(.*?)\1/gm, (e) => {
69
+ const a = n.replace(/href=(["'`”])(.*?)\1/gm, (e) => {
65
70
  const r = e.slice(6, e.length - 1).trim();
66
71
  return e.includes("?") || e.includes("#") ? r.slice(-1) === "&" ? e.replace(r, `${r}insEmail=1`) : e.replace(r, `${r}&insEmail=1`) : e.replace(r, `${r}?insEmail=1`);
67
72
  });
68
- i = i.replace(n, o);
73
+ i = i.replace(n, a);
69
74
  }
70
75
  }), i;
71
76
  },
@@ -73,5 +78,5 @@ const T = [
73
78
  }
74
79
  ];
75
80
  export {
76
- T as unsubscribeCompilerRules
81
+ D as unsubscribeCompilerRules
77
82
  };
@@ -0,0 +1,5 @@
1
+ const e = "insidethekube", s = "useinsider";
2
+ export {
3
+ e as KUBE_ENV_PREFIX,
4
+ s as PROD_ENV_PREFIX
5
+ };
@@ -1,25 +1,26 @@
1
- import { useTranslations as e } from "../composables/useTranslations.js";
2
- const s = e(), R = {
1
+ import { useTranslations as n } from "../composables/useTranslations.js";
2
+ import { getEnvironmentPrefix as R } from "../utils/environmentUtil.js";
3
+ const e = n(), i = {
3
4
  UNSUBSCRIBE_LINK_TYPE: 1,
4
5
  PREFERENCES_LINK_TYPE: 3
5
- }, S = {
6
+ }, r = {
6
7
  UNSUBSCRIBE_LINK_REGEX: /{{ins-unsubscribe-link}}/g,
7
8
  DATA_OGSB_BUTTON_CSS_REGEX: "\\[data-ogsb\\]\\s*\\.es-button\\.es-button-[0-9]+\\s*\\{(?:[^\\}]*)\\}",
8
9
  GLOBAL_UNSUBSCRIBE_LINK_REGEX: /{{ins-global-unsubscribe-link}}/g,
9
10
  PREFERENCES_UNSUBSCRIBE_LINK_REGEX: /{{ins-preferences-unsubscribe-link}}/g
10
- }, N = {
11
- UNSUBSCRIBE_URL: "https://mail.useinsider.com/user/v1/unsub",
12
- PREFERENCES_URL: "https://mail.useinsider.com/user/v1/prefs"
13
- }, _ = {
11
+ }, s = R(), I = {
12
+ UNSUBSCRIBE_URL: `https://${s}.mail.useinsider.com/user/v1/unsub`,
13
+ PREFERENCES_URL: `https://${s}.mail.useinsider.com/user/v1/prefs`
14
+ }, _ = "iid", B = {
14
15
  name: "Global Unsubscribe",
15
16
  sendGridId: "G"
16
- }, I = "https://academy.useinsider.com/docs/global-unsubscribe-preference-center", r = "/email/unsubscribe-pages", E = {
17
+ }, C = "https://academy.useinsider.com/docs/global-unsubscribe-preference-center", c = "/email/unsubscribe-pages", E = {
17
18
  GLOBAL_UNSUBSCRIBE: 1,
18
19
  GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE: 2,
19
20
  SUBSCRIPTION_PREFERENCE_CENTER: 3,
20
21
  SUBSCRIPTION_PREFERENCE_CONFIRMATION: 4,
21
22
  RESUBSCRIBE: 5
22
- }, i = {
23
+ }, t = {
23
24
  [E.GLOBAL_UNSUBSCRIBE]: [
24
25
  E.GLOBAL_UNSUBSCRIBE,
25
26
  E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE,
@@ -29,26 +30,27 @@ const s = e(), R = {
29
30
  E.SUBSCRIPTION_PREFERENCE_CENTER,
30
31
  E.SUBSCRIPTION_PREFERENCE_CONFIRMATION
31
32
  ]
32
- }, B = {
33
- [E.GLOBAL_UNSUBSCRIBE]: s("unsubscription-preference.type-global-unsubscribe"),
34
- [E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]: s("unsubscription-preference.type-global-unsubscription-confirmation"),
35
- [E.RESUBSCRIBE]: s("unsubscription-preference.type-resubscribe"),
36
- [E.SUBSCRIPTION_PREFERENCE_CENTER]: s("unsubscription-preference.type-subscription-preferences-center"),
37
- [E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]: s("unsubscription-preference.type-subscription-preferences-confirmation")
38
- }, C = {
33
+ }, U = {
34
+ [E.GLOBAL_UNSUBSCRIBE]: e("unsubscription-preference.type-global-unsubscribe"),
35
+ [E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]: e("unsubscription-preference.type-global-unsubscription-confirmation"),
36
+ [E.RESUBSCRIBE]: e("unsubscription-preference.type-resubscribe"),
37
+ [E.SUBSCRIPTION_PREFERENCE_CENTER]: e("unsubscription-preference.type-subscription-preferences-center"),
38
+ [E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]: e("unsubscription-preference.type-subscription-preferences-confirmation")
39
+ }, o = {
39
40
  default: "{{ins-unsubscribe-link}}",
40
41
  [E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
41
42
  [E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
42
43
  };
43
44
  export {
44
- I as ACADEMY_LINK,
45
- _ as DEFAULT_UNSUBSCRIBE_GROUP,
46
- S as LINK_REGEXES,
47
- R as LINK_TYPES,
48
- C as MERGE_TAGS,
45
+ C as ACADEMY_LINK,
46
+ B as DEFAULT_UNSUBSCRIBE_GROUP,
47
+ _ as INSIDER_ID,
48
+ r as LINK_REGEXES,
49
+ i as LINK_TYPES,
50
+ o as MERGE_TAGS,
49
51
  E as PAGE_TYPES,
50
- i as TYPE_COLLECTIONS,
51
- B as TYPE_TRANSLATIONS,
52
- r as UNSUBSCRIBE_PAGES_LINK,
53
- N as URLS
52
+ t as TYPE_COLLECTIONS,
53
+ U as TYPE_TRANSLATIONS,
54
+ c as UNSUBSCRIBE_PAGES_LINK,
55
+ I as URLS
54
56
  };
@@ -133,7 +133,7 @@ const a = c(), d = () => ({
133
133
  filterSelectionDrawerStatus: !1,
134
134
  filterList: {},
135
135
  filterGroup: 1
136
- }), G = p("guidoRecommendationExtension", {
136
+ }), G = p("recommendationExtension", {
137
137
  state: () => d(),
138
138
  getters: {
139
139
  hasFilters: (e) => !!e.recommendationConfigs.filters.length,
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- .gap-16[data-v-6562e38c],.gap-16[data-v-1ccb6d4a]{gap:16px}[data-v-0502bceb] .in-button-v2__wrapper{line-height:0}[data-v-b5997368] .in-segments-wrapper .in-tooltip-wrapper__box{text-align:left}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.guido-loading__wrapper[data-v-dced5582]{height:100%;top:75px}.guido-editor__wrapper[data-v-3c910a93],.guido-editor__container[data-v-3c910a93]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-3c910a93]{height:calc(100vh - 75px)}[data-v-70835920] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-a86fc486]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-a86fc486]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-a86fc486]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-a86fc486]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-a86fc486]{object-fit:cover;transform:scale(1)}[data-v-dd57102d] .guido__verion-history-view-option-selection-desktop svg,[data-v-dd57102d] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-dd57102d] .in-segments-wrapper__button_selected,[data-v-dd57102d] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-7a09985c]{gap:16px}[data-v-c2adc57d] .in-progress-wrapper__progress p span:last-child{display:none!important}.desktop-preview-container[data-v-2dd60b0c],[data-v-2dd60b0c] .desktop-preview-container .in-container{min-height:720px!important;height:100%}.cropped-text[data-v-f20b3a9b]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[data-v-d3c52b44] .vueperslides__bullets,[data-v-a408dcea] .vueperslides__bullets{pointer-events:none!important}[data-v-a408dcea] .vueperslides__parallax-wrapper{height:110px!important}
1
+ .gap-16[data-v-6562e38c],.gap-16[data-v-1ccb6d4a]{gap:16px}[data-v-0502bceb] .in-button-v2__wrapper{line-height:0}[data-v-b5997368] .in-segments-wrapper .in-tooltip-wrapper__box{text-align:left}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.guido-loading__wrapper[data-v-dced5582]{height:100%;top:75px}.guido-editor__wrapper[data-v-e299731b],.guido-editor__container[data-v-e299731b]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-e299731b]{height:calc(100vh - 75px)}[data-v-70835920] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-a86fc486]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-a86fc486]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-a86fc486]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-a86fc486]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-a86fc486]{object-fit:cover;transform:scale(1)}[data-v-dd57102d] .guido__verion-history-view-option-selection-desktop svg,[data-v-dd57102d] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-dd57102d] .in-segments-wrapper__button_selected,[data-v-dd57102d] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-7a09985c]{gap:16px}[data-v-c2adc57d] .in-progress-wrapper__progress p span:last-child{display:none!important}.desktop-preview-container[data-v-2dd60b0c],[data-v-2dd60b0c] .desktop-preview-container .in-container{min-height:720px!important;height:100%}.cropped-text[data-v-f20b3a9b]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[data-v-d3c52b44] .vueperslides__bullets,[data-v-a408dcea] .vueperslides__bullets{pointer-events:none!important}[data-v-a408dcea] .vueperslides__parallax-wrapper{height:110px!important}
@@ -1,4 +1,4 @@
1
- const o = { stripo: { version: "2.42.0" } }, s = {
1
+ const o = { stripo: { version: "2.46.0" } }, s = {
2
2
  guido: o
3
3
  };
4
4
  export {
@@ -27,6 +27,7 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__
27
27
  "on-change": (hasChanges: boolean) => void;
28
28
  ready: () => void;
29
29
  "onboarding:finished": () => void;
30
+ "test-email:click": () => void;
30
31
  }, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
31
32
  export default _default;
32
33
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -3,9 +3,11 @@ import type { InjectionKey } from 'vue';
3
3
  export type BackHandler = () => void;
4
4
  export type SaveStartHandler = () => void;
5
5
  export type SaveCompleteHandler = (template: Omit<SavedTemplateDetails, 'forceRecreate'>) => void;
6
+ export type TestEmailClickHandler = () => void;
6
7
  export declare const BACK_KEY: InjectionKey<BackHandler>;
7
8
  export declare const SAVE_START_KEY: InjectionKey<SaveStartHandler>;
8
9
  export declare const SAVE_COMPLETE_KEY: InjectionKey<SaveCompleteHandler>;
10
+ export declare const TEST_EMAIL_CLICK_KEY: InjectionKey<TestEmailClickHandler>;
9
11
  /**
10
12
  * Provides Guido action handlers to child components
11
13
  */
@@ -13,6 +15,7 @@ export declare const provideGuidoActions: (actions: {
13
15
  onBack: BackHandler;
14
16
  onSaveStart: SaveStartHandler;
15
17
  onSaveComplete: SaveCompleteHandler;
18
+ onTestEmailClick: TestEmailClickHandler;
16
19
  }) => void;
17
20
  /**
18
21
  * Provides individual Guido action handlers
@@ -35,6 +38,11 @@ export declare const useSaveStart: () => SaveStartHandler;
35
38
  * @returns Save complete function
36
39
  */
37
40
  export declare const useSaveComplete: () => SaveCompleteHandler;
41
+ /**
42
+ * Hook to use the test email click handler
43
+ * @returns Test email click function
44
+ */
45
+ export declare const useTestEmailClick: () => TestEmailClickHandler;
38
46
  /**
39
47
  * Convenience hook to get all Guido actions
40
48
  * @returns Object containing all action handlers
@@ -43,4 +51,5 @@ export declare const useGuidoActions: () => {
43
51
  back: BackHandler;
44
52
  saveStart: SaveStartHandler;
45
53
  saveComplete: SaveCompleteHandler;
54
+ testEmailClick: TestEmailClickHandler;
46
55
  };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Environment constants
3
+ */
4
+ export declare const KUBE_ENV_PREFIX = "insidethekube";
5
+ export declare const PROD_ENV_PREFIX = "useinsider";
@@ -34,7 +34,7 @@ interface StoreState {
34
34
  filterList: FiltersResponse;
35
35
  filterGroup: number;
36
36
  }
37
- export declare const useRecommendationExtensionStore: import("pinia").StoreDefinition<"guidoRecommendationExtension", StoreState, {
37
+ export declare const useRecommendationExtensionStore: import("pinia").StoreDefinition<"recommendationExtension", StoreState, {
38
38
  hasFilters: (state: {
39
39
  recommendationCampaignUrls: Record<string, string>;
40
40
  recommendationConfigs: {
@@ -3,7 +3,7 @@ interface StoreState {
3
3
  guidoConfig: GuidoConfig;
4
4
  templateConfig?: TemplateConfig;
5
5
  }
6
- export declare const useConfigStore: import("pinia").StoreDefinition<"guidoConfig", StoreState, {
6
+ export declare const useConfigStore: import("pinia").StoreDefinition<"config", StoreState, {
7
7
  getVariationId: (state: {
8
8
  guidoConfig: {
9
9
  translationsPath: string;
@@ -1,5 +1,5 @@
1
1
  import type { DynamicContent } from '@@/Types/generic';
2
- export declare const useDynamicContentStore: import("pinia").StoreDefinition<"guidoDynamicContent", {
2
+ export declare const useDynamicContentStore: import("pinia").StoreDefinition<"dynamicContent", {
3
3
  selectedDynamicContent: DynamicContent;
4
4
  selectedDynamicContentList: DynamicContent[];
5
5
  }, {
@@ -1,4 +1,4 @@
1
- export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEditor", {
1
+ export declare const useEditorStore: import("pinia").StoreDefinition<"editor", {
2
2
  loadingStatus: boolean;
3
3
  isCodeEditorOpen: boolean;
4
4
  isSaveAsTemplateDrawerOpen: boolean;
@@ -1,5 +1,5 @@
1
1
  import type { OnboardingCardConfig, OnboardingType, OnboardingStoreState } from '@@/Types/onboarding';
2
- export declare const useOnboardingStore: import("pinia").StoreDefinition<"guidoOnboarding", OnboardingStoreState, {
2
+ export declare const useOnboardingStore: import("pinia").StoreDefinition<"onboarding", OnboardingStoreState, {
3
3
  getOnboarding: (state: {
4
4
  onboardings: {
5
5
  newVersionPopup: {
@@ -1,5 +1,5 @@
1
1
  import type { PreviewState, EmailFormat } from '@@/Types/preview';
2
- export declare const usePreviewStore: import("pinia").StoreDefinition<"guidoPreview", PreviewState, {
2
+ export declare const usePreviewStore: import("pinia").StoreDefinition<"preview", PreviewState, {
3
3
  isAMPModeEnabled: (state: {
4
4
  emailFormat: EmailFormat;
5
5
  ampHtml: string;
@@ -6,5 +6,5 @@ type RecommendationConfig = {
6
6
  interface StoreState {
7
7
  recommendationConfigs: RecommendationConfig[];
8
8
  }
9
- export declare const useRecommendationStore: import("pinia").StoreDefinition<"guidoRecommendation", StoreState, {}, {}>;
9
+ export declare const useRecommendationStore: import("pinia").StoreDefinition<"recommendation", StoreState, {}, {}>;
10
10
  export {};
@@ -17,7 +17,7 @@ interface StoreState {
17
17
  message: number;
18
18
  };
19
19
  }
20
- export declare const useSaveAsTemplateStore: import("pinia").StoreDefinition<"guidoSaveAsTemplate", StoreState, {
20
+ export declare const useSaveAsTemplateStore: import("pinia").StoreDefinition<"saveAsTemplate", StoreState, {
21
21
  getTemplateName: (state: {
22
22
  templateName: string;
23
23
  categories: {
@@ -1,5 +1,5 @@
1
1
  import type { ToasterState, ToasterOptions } from '@@/Types/toaster';
2
- export declare const useToasterStore: import("pinia").StoreDefinition<"guidoToaster", ToasterState, {
2
+ export declare const useToasterStore: import("pinia").StoreDefinition<"toaster", ToasterState, {
3
3
  shouldAutoHide: (s: {
4
4
  status: boolean;
5
5
  type: import("@@/Types/toaster").ToasterType;
@@ -11,7 +11,7 @@ interface StoreState {
11
11
  isGlobalUnsubscribeDisabled: boolean;
12
12
  isSubscriptionPreferencesCenterDisabled: boolean;
13
13
  }
14
- export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guidoUnsubscribe", StoreState, {
14
+ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"unsubscribe", StoreState, {
15
15
  getSelectedCollection: (state: {
16
16
  templates: {
17
17
  id: number;
@@ -2,7 +2,7 @@ import type { VersionHistoryState } from '@@/Types/version-history-api';
2
2
  export interface StoreState extends VersionHistoryState {
3
3
  editorVisualMode: 'desktop' | 'mobile';
4
4
  }
5
- export declare const useVersionHistoryStore: import("pinia").StoreDefinition<"guidoVersionHistory", StoreState, {
5
+ export declare const useVersionHistoryStore: import("pinia").StoreDefinition<"versionHistory", StoreState, {
6
6
  hasPreviousPatch: (state: {
7
7
  editorVisualMode: "desktop" | "mobile";
8
8
  previousPatch: {
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Checks if the current environment is Kube environment
3
+ */
4
+ export declare const isKubeEnvironment: () => boolean;
5
+ /**
6
+ * Gets the appropriate environment prefix for unsubscribe links
7
+ */
8
+ export declare const getEnvironmentPrefix: () => string;
@@ -1,8 +1,8 @@
1
- import { DefaultGuidoConfig as i } from "../enums/defaults.js";
2
- import { defineStore as e } from "pinia";
3
- const n = e("guidoConfig", {
1
+ import { DefaultGuidoConfig as e } from "../enums/defaults.js";
2
+ import { defineStore as i } from "pinia";
3
+ const r = i("config", {
4
4
  state: () => ({
5
- guidoConfig: i,
5
+ guidoConfig: e,
6
6
  templateConfig: {}
7
7
  }),
8
8
  getters: {
@@ -13,5 +13,5 @@ const n = e("guidoConfig", {
13
13
  }
14
14
  });
15
15
  export {
16
- n as useConfigStore
16
+ r as useConfigStore
17
17
  };
@@ -1,6 +1,6 @@
1
1
  import { removeDuplicatesFromArray as n } from "../utils/arrayUtil.js";
2
2
  import { defineStore as a } from "pinia";
3
- const s = a("guidoDynamicContent", {
3
+ const s = a("dynamicContent", {
4
4
  state: () => ({
5
5
  selectedDynamicContent: { text: "", value: "", fallback: "" },
6
6
  selectedDynamicContentList: []
@@ -1,5 +1,5 @@
1
1
  import { defineStore as e } from "pinia";
2
- const o = e("guidoEditor", {
2
+ const o = e("editor", {
3
3
  state: () => ({
4
4
  loadingStatus: !0,
5
5
  isCodeEditorOpen: !1,
@@ -14,41 +14,41 @@ const e = () => ({
14
14
  },
15
15
  userModalState: {},
16
16
  isFetched: !1
17
- }), c = s("guidoOnboarding", {
17
+ }), g = s("onboarding", {
18
18
  state: () => a(),
19
19
  getters: {
20
- getOnboarding: (n) => (i) => n.onboardings[i],
21
- isActive: (n) => (i) => n.onboardings[i].isActive,
22
- getCurrentCard: (n) => (i) => {
23
- const o = n.onboardings[i];
24
- return o.config[o.cardIndex];
20
+ getOnboarding: (n) => (o) => n.onboardings[o],
21
+ isActive: (n) => (o) => n.onboardings[o].isActive,
22
+ getCurrentCard: (n) => (o) => {
23
+ const i = n.onboardings[o];
24
+ return i.config[i.cardIndex];
25
25
  },
26
26
  getGenericCurrentCard: (n) => {
27
- const { genericOnboarding: i } = n.onboardings;
28
- return i.config[i.cardIndex];
27
+ const { genericOnboarding: o } = n.onboardings;
28
+ return o.config[o.cardIndex];
29
29
  },
30
30
  getTextBlockCurrentCard: (n) => {
31
- const { textBlockOnboarding: i } = n.onboardings;
32
- return i.config[i.cardIndex];
31
+ const { textBlockOnboarding: o } = n.onboardings;
32
+ return o.config[o.cardIndex];
33
33
  },
34
34
  getVersionHistoryCurrentCard: (n) => {
35
- const { versionHistoryOnboarding: i } = n.onboardings;
36
- return i.config[i.cardIndex];
35
+ const { versionHistoryOnboarding: o } = n.onboardings;
36
+ return o.config[o.cardIndex];
37
37
  },
38
38
  getAmpCurrentCard: (n) => {
39
- const { ampOnboarding: i } = n.onboardings;
40
- return i.config[i.cardIndex];
39
+ const { ampOnboarding: o } = n.onboardings;
40
+ return o.config[o.cardIndex];
41
41
  },
42
- shouldShowOnboarding: (n) => (i) => {
43
- const o = n.userModalState.Guido;
44
- return i === "newVersionPopup" && (o != null && o.genericOnboarding) ? !1 : o ? !o[i] : !0;
42
+ shouldShowOnboarding: (n) => (o) => {
43
+ const i = n.userModalState.Guido;
44
+ return o === "newVersionPopup" && (i != null && i.genericOnboarding) ? !1 : i ? !i[o] : !0;
45
45
  }
46
46
  },
47
47
  actions: {
48
48
  closeOtherOnboardings(n) {
49
- Object.keys(this.onboardings).forEach((i) => {
50
- const o = i;
51
- o !== n && this.onboardings[o].isActive && (this.onboardings[o].isActive = !1, this.onboardings[o].cardIndex = 0, this.onboardings[o].config = []);
49
+ Object.keys(this.onboardings).forEach((o) => {
50
+ const i = o;
51
+ i !== n && this.onboardings[i].isActive && (this.onboardings[i].isActive = !1, this.onboardings[i].cardIndex = 0, this.onboardings[i].config = []);
52
52
  });
53
53
  },
54
54
  start(n) {
@@ -63,8 +63,8 @@ const e = () => ({
63
63
  previous(n) {
64
64
  this.onboardings[n].cardIndex > 0 && this.onboardings[n].cardIndex--;
65
65
  },
66
- setConfig(n, i) {
67
- this.onboardings[n].config = i ?? [], this.onboardings[n].cardIndex >= this.onboardings[n].config.length && (this.onboardings[n].cardIndex = 0);
66
+ setConfig(n, o) {
67
+ this.onboardings[n].config = o ?? [], this.onboardings[n].cardIndex >= this.onboardings[n].config.length && (this.onboardings[n].cardIndex = 0);
68
68
  },
69
69
  async onDiscoverNowClicked() {
70
70
  await this.setUserModalState("newVersionPopup", "true", "Guido"), await this.setUserModalState("genericOnboarding", "true", "Guido"), this.start("genericOnboarding");
@@ -81,15 +81,15 @@ const e = () => ({
81
81
  async fetchUserModalState() {
82
82
  if (this.isFetched)
83
83
  return;
84
- const { fetchUserModalState: n } = t(), i = await n();
85
- this.userModalState = i, this.isFetched = !0;
84
+ const { fetchUserModalState: n } = t(), o = await n();
85
+ this.userModalState = o, this.isFetched = !0;
86
86
  },
87
- async setUserModalState(n, i, o) {
87
+ async setUserModalState(n, o, i) {
88
88
  const { setUserModalState: r } = t();
89
- await r(n, i, o), this.isFetched = !1, await this.fetchUserModalState();
89
+ await r(n, o, i), this.isFetched = !1, await this.fetchUserModalState();
90
90
  }
91
91
  }
92
92
  });
93
93
  export {
94
- c as useOnboardingStore
94
+ g as useOnboardingStore
95
95
  };
@@ -6,7 +6,7 @@ const s = () => ({
6
6
  templateHtml: "",
7
7
  isLoaded: !1,
8
8
  isAMPErrorModalVisible: !1
9
- }), a = e("guidoPreview", {
9
+ }), a = e("preview", {
10
10
  state: () => s(),
11
11
  getters: {
12
12
  isAMPModeEnabled: (t) => t.emailFormat === "AMP",
@@ -1,8 +1,8 @@
1
1
  import { defineStore as e } from "pinia";
2
- const o = () => ({
2
+ const t = () => ({
3
3
  recommendationConfigs: []
4
- }), n = e("guidoRecommendation", {
5
- state: () => o()
4
+ }), n = e("recommendation", {
5
+ state: () => t()
6
6
  });
7
7
  export {
8
8
  n as useRecommendationStore
@@ -17,7 +17,7 @@ const r = () => ({
17
17
  editor: 2,
18
18
  message: 1
19
19
  }
20
- }), g = i("guidoSaveAsTemplate", {
20
+ }), n = i("saveAsTemplate", {
21
21
  state: () => r(),
22
22
  getters: {
23
23
  getTemplateName: (e) => e.templateName.trim(),
@@ -44,5 +44,5 @@ const r = () => ({
44
44
  }
45
45
  });
46
46
  export {
47
- g as useSaveAsTemplateStore
47
+ n as useSaveAsTemplateStore
48
48
  };
@@ -8,7 +8,7 @@ const a = () => ({
8
8
  withIcon: !0,
9
9
  withoutLeftMargin: !1,
10
10
  actionButton: void 0
11
- }), u = i("guidoToaster", {
11
+ }), u = i("toaster", {
12
12
  state: () => a(),
13
13
  getters: {
14
14
  shouldAutoHide: (t) => t.status && !!t.text
@@ -12,7 +12,7 @@ const p = () => ({
12
12
  typeSelectionDrawerStatus: !1,
13
13
  isGlobalUnsubscribeDisabled: !1,
14
14
  isSubscriptionPreferencesCenterDisabled: !1
15
- }), g = d("guidoUnsubscribe", {
15
+ }), g = d("unsubscribe", {
16
16
  state: () => p(),
17
17
  getters: {
18
18
  getSelectedCollection: (e) => i[e.selectedCollectionType],
@@ -5,13 +5,13 @@ const e = () => ({
5
5
  description: "",
6
6
  authorId: "",
7
7
  authorName: ""
8
- }), i = () => ({
8
+ }), r = () => ({
9
9
  previousPatch: e(),
10
10
  currentPatch: e(),
11
11
  nextPatch: e(),
12
12
  editorVisualMode: "desktop"
13
- }), r = a("guidoVersionHistory", {
14
- state: () => i(),
13
+ }), o = a("versionHistory", {
14
+ state: () => r(),
15
15
  getters: {
16
16
  hasPreviousPatch: (t) => !!t.previousPatch.id,
17
17
  hasCurrentPatch: (t) => !!t.currentPatch.id,
@@ -24,5 +24,5 @@ const e = () => ({
24
24
  }
25
25
  });
26
26
  export {
27
- r as useVersionHistoryStore
27
+ o as useVersionHistoryStore
28
28
  };
@@ -0,0 +1,6 @@
1
+ import { KUBE_ENV_PREFIX as n, PROD_ENV_PREFIX as o } from "../enums/environment.js";
2
+ const t = () => window.location.hostname.includes(n), i = () => t() ? n : o;
3
+ export {
4
+ i as getEnvironmentPrefix,
5
+ t as isKubeEnvironment
6
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "1.0.3-beta.80f253d",
3
+ "version": "1.0.3-beta.81b84f8",
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",
@@ -83,7 +83,7 @@
83
83
  },
84
84
  "guido": {
85
85
  "stripo": {
86
- "version": "2.42.0"
86
+ "version": "2.46.0"
87
87
  }
88
88
  }
89
89
  }