@useinsider/guido 3.7.0-beta.04f8814 → 3.7.0-beta.2037cb1

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 (30) hide show
  1. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +2 -2
  2. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +22 -24
  3. package/dist/composables/useStripo.js +44 -39
  4. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +9 -9
  5. package/dist/extensions/Blocks/Unsubscribe/control.js +26 -33
  6. package/dist/guido.css +1 -1
  7. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +2 -3
  8. package/dist/src/extensions/Blocks/Unsubscribe/control.d.ts +0 -1
  9. package/dist/stores/dynamic-content.js +1 -1
  10. package/package.json +1 -1
  11. package/dist/src/composables/useApiExample.d.ts +0 -63
  12. package/dist/src/composables/useRecommendation.test.d.ts +0 -1
  13. package/dist/src/config/migrator/recommendation/compositionMapper.test.d.ts +0 -1
  14. package/dist/src/config/migrator/recommendation/extractors.test.d.ts +0 -1
  15. package/dist/src/config/migrator/recommendation/parseLegacyConfig.test.d.ts +0 -1
  16. package/dist/src/config/migrator/recommendation/settingsMapper.test.d.ts +0 -1
  17. package/dist/src/config/migrator/recommendation/themeMapper.test.d.ts +0 -1
  18. package/dist/src/config/migrator/recommendationMigrator.test.d.ts +0 -1
  19. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.test.d.ts +0 -1
  20. package/dist/src/extensions/Blocks/Recommendation/services/configService.test.d.ts +0 -1
  21. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.test.d.ts +0 -1
  22. package/dist/src/extensions/Blocks/Recommendation/templates/utils.test.d.ts +0 -1
  23. package/dist/src/extensions/Blocks/Recommendation/utils/filterUtil.test.d.ts +0 -1
  24. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.test.d.ts +0 -1
  25. package/dist/src/extensions/Blocks/Recommendation/utils/priceFormatter.test.d.ts +0 -1
  26. package/dist/src/stores/config.test.d.ts +0 -1
  27. package/dist/src/utils/ampErrorFilter.test.d.ts +0 -1
  28. package/dist/src/utils/htmlEscape.test.d.ts +0 -1
  29. package/dist/src/utils/templatePreparation.test.d.ts +0 -1
  30. package/dist/src/vitest.setup.d.ts +0 -0
@@ -3,7 +3,7 @@ import a from "./UnsubscribePageSelection.vue2.js";
3
3
  import n from "../../../_virtual/_plugin-vue2_normalizer.js";
4
4
  var o = function() {
5
5
  var r = this, e = r._self._c, t = r._self._setupProxy;
6
- return e(t.WpDrawer, { attrs: { id: "unsubscribe-modal", "description-status": "", size: "large", "footer-button-group-options": t.footerButtonGroupOptions, status: t.unsubscribeStore.pageSelectionDrawerStatus, "title-text": t.trans("newsletter.select-a-template") }, on: { cancelOrBackButtonEvent: t.handleBack, onCloseEvent: t.handleClose, primaryButtonEvent: t.handleSave }, scopedSlots: r._u([{ key: "headerBottomSlot", fn: function() {
6
+ return e(t.WpDrawer, { attrs: { id: "unsubscribe-modal", "description-status": "", size: "large", "footer-button-group-options": t.footerButtonGroupOptions, status: t.unsubscribeStore.pageSelectionDrawerStatus, "title-text": t.trans("newsletter.select-a-template") }, on: { cancelOrBackButtonEvent: t.handleBack, onCloseEvent: t.closeModal, primaryButtonEvent: t.handleSave }, scopedSlots: r._u([{ key: "headerBottomSlot", fn: function() {
7
7
  return [e(t.UnsubscribeBreadcrumb, { staticClass: "px-5 py-3" })];
8
8
  }, proxy: !0 }]) }, [e("div", { staticClass: "d-g templates-wrapper" }, r._l(t.unsubscribeStore.getTemplatesByActiveType, function(s) {
9
9
  return e("div", { key: s.id, staticClass: "template-wrapper", on: { click: function(u) {
@@ -16,7 +16,7 @@ var o = function() {
16
16
  i,
17
17
  !1,
18
18
  null,
19
- "f6a8cb4c"
19
+ "df672485"
20
20
  );
21
21
  const _ = c.exports;
22
22
  export {
@@ -1,15 +1,15 @@
1
- import { defineComponent as y, ref as S, computed as a, watch as T } from "vue";
2
- import v from "../../wrappers/WpDrawer.vue.js";
3
- import { useToaster as C } from "../../../composables/useToaster.js";
1
+ import { defineComponent as g, ref as y, computed as n, watch as S } from "vue";
2
+ import T from "../../wrappers/WpDrawer.vue.js";
3
+ import { useToaster as v } from "../../../composables/useToaster.js";
4
4
  import { useTranslations as B } from "../../../composables/useTranslations.js";
5
- import { ToasterTypeOptions as w } from "../../../enums/toaster.js";
6
- import { useUnsubscribeStore as h } from "../../../stores/unsubscribe.js";
7
- import { InContainer as U } from "@useinsider/design-system-vue";
8
- import P from "./UnsubscribeBreadcrumb.vue.js";
9
- const L = /* @__PURE__ */ y({
5
+ import { ToasterTypeOptions as C } from "../../../enums/toaster.js";
6
+ import { useUnsubscribeStore as w } from "../../../stores/unsubscribe.js";
7
+ import { InContainer as h } from "@useinsider/design-system-vue";
8
+ import U from "./UnsubscribeBreadcrumb.vue.js";
9
+ const F = /* @__PURE__ */ g({
10
10
  __name: "UnsubscribePageSelection",
11
- setup(_) {
12
- const s = B(), e = h(), { showToaster: r } = C(), o = S(!1), c = a(() => e.isActiveTypeLastInCollection ? o.value ? s("unsubscription-preference.applying-changes") : s("statistics.apply") : s("products.select-and-continue")), i = a(() => e.pageSelectionUpdateStatus && e.isActiveTypeFirstInCollection ? s("products.cancel") : s("newsletter.back")), u = a(() => ({
11
+ setup(P) {
12
+ const s = B(), e = w(), { showToaster: a } = v(), o = y(!1), c = n(() => e.isActiveTypeLastInCollection ? o.value ? s("unsubscription-preference.applying-changes") : s("statistics.apply") : s("products.select-and-continue")), i = n(() => e.pageSelectionUpdateStatus && e.isActiveTypeFirstInCollection ? s("products.cancel") : s("newsletter.back")), u = n(() => ({
13
13
  primaryButton: {
14
14
  styling: "solid",
15
15
  type: "primary",
@@ -23,44 +23,42 @@ const L = /* @__PURE__ */ y({
23
23
  labelText: i.value,
24
24
  disabledStatus: o.value
25
25
  }
26
- })), p = (t) => e.getSelectedTemplateByActiveType === t ? "bor-w-3 bor-s-s bor-c-7" : "bor-w-1 bor-s-s bor-c-6", n = (t) => {
26
+ })), p = (t) => e.getSelectedTemplateByActiveType === t ? "bor-w-3 bor-s-s bor-c-7" : "bor-w-1 bor-s-s bor-c-6", r = (t) => {
27
27
  e.pageSelectionDrawerStatus = !1, t && setTimeout(() => {
28
28
  t();
29
29
  }, 500);
30
30
  }, d = () => {
31
- n(), e.pageSelectionUpdateStatus || document.dispatchEvent(new CustomEvent("unsubscribe:cancel"));
32
- }, m = () => {
33
31
  if (e.isActiveTypeFirstInCollection) {
34
- n(), e.pageSelectionUpdateStatus || (e.typeSelectionDrawerStatus = !0);
32
+ r(), e.pageSelectionUpdateStatus || (e.typeSelectionDrawerStatus = !0);
35
33
  return;
36
34
  }
37
35
  e.setPreviousType();
38
- }, b = () => {
36
+ }, m = () => {
39
37
  if (e.isActiveTypeLastInCollection) {
40
38
  o.value = !0;
41
- const t = e.selectedCollectionType, l = e.getSelectedTemplatesByCollection(t), g = e.getSelectedUnsubscribePagesByCollection(t);
42
- e.removeUnsubscribePages(g), e.addUnsubscribePages(l), document.dispatchEvent(new CustomEvent("unsubscribe:select", {
39
+ const t = e.selectedCollectionType, l = e.getSelectedTemplatesByCollection(t), f = e.getSelectedUnsubscribePagesByCollection(t);
40
+ e.removeUnsubscribePages(f), e.addUnsubscribePages(l), document.dispatchEvent(new CustomEvent("unsubscribe:select", {
43
41
  detail: {
44
42
  collectionType: t,
45
43
  selectedPages: l
46
44
  }
47
- })), n(() => {
48
- o.value = !1, r({
49
- type: w.Success,
45
+ })), r(() => {
46
+ o.value = !1, a({
47
+ type: C.Success,
50
48
  message: s("global-unsubscribe.pages-were-attached")
51
49
  });
52
50
  });
53
51
  return;
54
52
  }
55
53
  e.setNextType();
56
- }, f = (t) => {
54
+ }, b = (t) => {
57
55
  e.setSelectedTemplate(t);
58
56
  };
59
- return T(() => e.pageSelectionDrawerStatus, (t) => {
57
+ return S(() => e.pageSelectionDrawerStatus, (t) => {
60
58
  t && e.pageSelectionUpdateStatus && e.fetchTemplates();
61
- }), { __sfc: !0, trans: s, unsubscribeStore: e, showToaster: r, isApplying: o, getPrimaryButtonText: c, getCancelOrBackButtonText: i, footerButtonGroupOptions: u, getBorderClass: p, closeModal: n, handleClose: d, handleBack: m, handleSave: b, selectTemplate: f, WpDrawer: v, InContainer: U, UnsubscribeBreadcrumb: P };
59
+ }), { __sfc: !0, trans: s, unsubscribeStore: e, showToaster: a, isApplying: o, getPrimaryButtonText: c, getCancelOrBackButtonText: i, footerButtonGroupOptions: u, getBorderClass: p, closeModal: r, handleBack: d, handleSave: m, selectTemplate: b, WpDrawer: T, InContainer: h, UnsubscribeBreadcrumb: U };
62
60
  }
63
61
  });
64
62
  export {
65
- L as default
63
+ F as default
66
64
  };
@@ -1,42 +1,42 @@
1
1
  import { useActionsApi as D } from "./useActionsApi.js";
2
- import { useBlocksConfig as I } from "./useBlocksConfig.js";
3
- import { useConfig as P } from "./useConfig.js";
2
+ import { useBlocksConfig as P } from "./useBlocksConfig.js";
3
+ import { useConfig as I } from "./useConfig.js";
4
4
  import { useCustomInterfaceAppearance as U } from "./useCustomInterfaceAppearance.js";
5
5
  import { useFullStoryBridge as R } from "./useFullStoryBridge.js";
6
6
  import { useStripoEventHandler as q } from "./useStripoEventHandler.js";
7
7
  import { useToaster as x } from "./useToaster.js";
8
8
  import { localePatch as H } from "../config/i18n/index.js";
9
9
  import { useStripoApi as O } from "../services/stripoApi.js";
10
- import j from "../static/styles/customEditorStyle.css.js";
11
- import { useEditorStore as E } from "../stores/editor.js";
12
- import { dynamicContentToMergeTags as z } from "../utils/genericUtil.js";
13
- import L from "../package.json.js";
14
- const se = (C, l) => {
15
- const { features: c, template: h, isFeatureEnabled: u } = P(), { handleError: m } = x(), { getToken: w, getCustomFonts: b, getSyncModulesStatus: k } = O(), { handleEvent: F } = q(), { getStripoBlocksConfig: B } = I(), T = async (i, r = [], s = !1) => {
10
+ import z from "../static/styles/customEditorStyle.css.js";
11
+ import { useEditorStore as h } from "../stores/editor.js";
12
+ import { dynamicContentToMergeTags as L } from "../utils/genericUtil.js";
13
+ import $ from "../package.json.js";
14
+ const se = (E, c) => {
15
+ const { features: u, template: C, isFeatureEnabled: m } = I(), { handleError: l } = x(), { getToken: w, getCustomFonts: b, getSyncModulesStatus: F } = O(), { handleEvent: k } = q(), { getStripoBlocksConfig: v } = P(), B = async (s, r = [], o = !1) => {
16
16
  var g, S, y;
17
- const e = E(), { html: p, css: a } = i, { baseBlocks: o, extensions: d } = await B(), f = ((g = c.value) == null ? void 0 : g.displayConditions) ?? !0, _ = ((S = c.value) == null ? void 0 : S.modulesDisabled) ?? !1, v = ((y = h.value) == null ? void 0 : y.forceRecreate) ?? !1;
17
+ const e = h(), { html: p, css: a } = s, { baseBlocks: i, extensions: d } = await v(), f = ((g = u.value) == null ? void 0 : g.displayConditions) ?? !0, V = ((S = u.value) == null ? void 0 : S.modulesDisabled) ?? !1, _ = ((y = C.value) == null ? void 0 : y.forceRecreate) ?? !1;
18
18
  window.UIEditor.initEditor(
19
19
  document.querySelector("#guido-editor"),
20
20
  {
21
- metadata: C,
21
+ metadata: E,
22
22
  html: p,
23
23
  css: a,
24
- forceRecreate: v,
24
+ forceRecreate: _,
25
25
  locale: "en",
26
26
  undoButtonSelector: "#guido__undo-button",
27
27
  redoButtonSelector: "#guido__redo-button",
28
28
  mobileViewButtonSelector: ".guido__view-option-selection-mobile",
29
29
  desktopViewButtonSelector: ".guido__view-option-selection-desktop",
30
30
  codeEditorButtonSelector: "#guido__code-button",
31
- customAppearanceMergetags: !u("liquidSyntax"),
31
+ customAppearanceMergetags: !m("liquidSyntax"),
32
32
  customAppearanceMergetagsBorderColor: "#f1f3fe",
33
33
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
34
- customViewStyles: j,
34
+ customViewStyles: z,
35
35
  conditionsEnabled: f,
36
36
  customConditionsEnabled: f,
37
37
  enableXSSSecurity: !0,
38
- modulesDisabled: _,
39
- syncModulesEnabled: s,
38
+ modulesDisabled: V,
39
+ syncModulesEnabled: o,
40
40
  messageSettingsEnabled: !0,
41
41
  displayGmailAnnotations: !0,
42
42
  displayHiddenPreheader: !1,
@@ -45,7 +45,7 @@ const se = (C, l) => {
45
45
  selectElementAfterDrop: !0,
46
46
  sameFontSizeForOutlook: !0,
47
47
  allowedScriptSourceDomains: "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com",
48
- ...o ? { baseBlocks: o } : {},
48
+ ...i ? { baseBlocks: i } : {},
49
49
  editorFonts: {
50
50
  showDefaultStandardFonts: !0,
51
51
  showDefaultNotStandardFonts: !0,
@@ -53,9 +53,9 @@ const se = (C, l) => {
53
53
  },
54
54
  mergeTags: [
55
55
  {
56
- entries: z(
57
- l.preselectedDynamicContentList,
58
- u("liquidSyntax")
56
+ entries: L(
57
+ c.preselectedDynamicContentList,
58
+ m("liquidSyntax")
59
59
  )
60
60
  }
61
61
  ],
@@ -64,17 +64,17 @@ const se = (C, l) => {
64
64
  const n = await w();
65
65
  t(n);
66
66
  } catch (n) {
67
- m(n, "Failed to refresh token");
67
+ l(n, "Failed to refresh token");
68
68
  }
69
69
  },
70
70
  onTemplateLoaded() {
71
71
  try {
72
72
  const { importCss: t } = U(), { activateCustomViewStyles: n, updateTimerInClonedTemplate: M } = D(), { injectFullStory: A } = R();
73
- t(), n(), A(), M(), l.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
73
+ t(), n(), A(), M(), c.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
74
74
  e.hasChanges = !1;
75
75
  }, 1e3);
76
76
  } catch (t) {
77
- m(t, "Failed to load custom interface appearance");
77
+ l(t, "Failed to load custom interface appearance");
78
78
  }
79
79
  },
80
80
  onCodeEditorVisibilityChanged(t) {
@@ -89,7 +89,7 @@ const se = (C, l) => {
89
89
  onDataChanged() {
90
90
  e.hasChanges = !0;
91
91
  },
92
- onEvent: F,
92
+ onEvent: k,
93
93
  ignoreClickOutsideSelectors: [
94
94
  "#guido-dynamic-content-modal",
95
95
  ".in-on-board-wrapper",
@@ -99,27 +99,32 @@ const se = (C, l) => {
99
99
  localePatch: H
100
100
  }
101
101
  );
102
- }, V = (i) => new Promise((r, s) => {
102
+ }, T = (s) => new Promise((r, o) => {
103
103
  var d;
104
104
  if (document.getElementById("UiEditorScript")) {
105
- i(), r();
105
+ Promise.resolve(s()).then(r, o);
106
106
  return;
107
107
  }
108
- const e = L.guido, a = `https://email-static.useinsider.com/guido/${(d = e == null ? void 0 : e.stripo) == null ? void 0 : d.version}/UIEditor.js`, o = document.createElement("script");
109
- o.id = "UiEditorScript", o.type = "module", o.src = a, o.onload = () => {
110
- i(), r();
111
- }, o.onerror = () => {
112
- s(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
113
- }, document.body.appendChild(o);
108
+ const e = $.guido, a = `https://email-static.useinsider.com/guido/${(d = e == null ? void 0 : e.stripo) == null ? void 0 : d.version}/UIEditor.js`, i = document.createElement("script");
109
+ i.id = "UiEditorScript", i.type = "module", i.src = a, i.onload = () => {
110
+ Promise.resolve(s()).then(r, o);
111
+ }, i.onerror = () => {
112
+ o(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
113
+ }, document.body.appendChild(i);
114
114
  });
115
- return { initPlugin: async (i) => {
116
- await V(async () => {
117
- const r = E(), [s, e] = await Promise.all([
118
- b(),
119
- k()
120
- ]);
121
- r.syncModulesEnabled = e, await T(i, s, e);
122
- });
115
+ return { initPlugin: async (s) => {
116
+ const r = h();
117
+ try {
118
+ await T(async () => {
119
+ const [o, e] = await Promise.all([
120
+ b(),
121
+ F()
122
+ ]);
123
+ r.syncModulesEnabled = e, await B(s, o, e);
124
+ });
125
+ } catch (o) {
126
+ r.loadingStatus = !1, l(o, "Failed to load the editor");
127
+ }
123
128
  } };
124
129
  };
125
130
  export {
@@ -1,4 +1,4 @@
1
- const o = [
1
+ const u = [
2
2
  {
3
3
  key: "locale",
4
4
  getValue: (e) => e.language,
@@ -9,8 +9,8 @@ const o = [
9
9
  getValue: (e) => e.currencySettings.value,
10
10
  getAvailableOptions: (e) => e.currencyList.map((n) => n.text)
11
11
  }
12
- ], l = "newsletter.recommendation-fill-required-fields";
13
- function u(e, n) {
12
+ ], s = "newsletter.recommendation-fill-required-fields";
13
+ function l(e, n, o = u) {
14
14
  return o.filter((t) => {
15
15
  var a;
16
16
  if (t.condition && !t.condition(e))
@@ -22,12 +22,12 @@ function u(e, n) {
22
22
  return r !== void 0 && !r.includes(i);
23
23
  }).map((t) => t.key);
24
24
  }
25
- function s(e, n) {
26
- return u(e, n).length === 0;
25
+ function c(e, n) {
26
+ return l(e, n).length === 0;
27
27
  }
28
28
  export {
29
- o as REQUIRED_RECOMMENDATION_FIELDS,
30
- l as RecommendationRequiredFieldsKey,
31
- u as getInvalidFields,
32
- s as isConfigValid
29
+ u as REQUIRED_RECOMMENDATION_FIELDS,
30
+ s as RecommendationRequiredFieldsKey,
31
+ l as getInvalidFields,
32
+ c as isConfigValid
33
33
  };
@@ -1,28 +1,28 @@
1
- var T = Object.defineProperty;
2
- var p = (o, s, e) => s in o ? T(o, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[s] = e;
3
- var c = (o, s, e) => p(o, typeof s != "symbol" ? s + "" : s, e);
1
+ var d = Object.defineProperty;
2
+ var h = (a, s, e) => s in a ? d(a, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[s] = e;
3
+ var u = (a, s, e) => h(a, typeof s != "symbol" ? s + "" : s, e);
4
4
  import { useUnsubscribeStore as l } from "../../../stores/unsubscribe.js";
5
- import { Control as _, UEAttr as i, UIElementType as n } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
6
- import { DATA_ATTRIBUTES as d } from "./utils/constants.js";
7
- import { parsePageList as h } from "./utils/utils.js";
8
- const g = "ui-elements-unsubscribe", r = {
5
+ import { Control as T, UEAttr as i, UIElementType as n } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
6
+ import { DATA_ATTRIBUTES as p } from "./utils/constants.js";
7
+ import { parsePageList as _ } from "./utils/utils.js";
8
+ const v = "ui-elements-unsubscribe", r = {
9
9
  SELECT_BUTTON: "selectTemplateButton",
10
10
  PREV_BUTTON: "prevButton",
11
11
  NEXT_BUTTON: "nextButton",
12
12
  COUNTER_TEXT: "counterText",
13
13
  PREVIEW_IMAGE: "previewImage"
14
14
  };
15
- class B extends _ {
15
+ class B extends T {
16
16
  constructor() {
17
17
  super(...arguments);
18
- c(this, "currentPreviewIndex", 0);
19
- c(this, "currentNode");
20
- c(this, "currentPages");
21
- c(this, "valueChangeHandlers", []);
22
- c(this, "lastParsedAttribute");
18
+ u(this, "currentPreviewIndex", 0);
19
+ u(this, "currentNode");
20
+ u(this, "currentPages");
21
+ u(this, "valueChangeHandlers", []);
22
+ u(this, "lastParsedAttribute");
23
23
  }
24
24
  getId() {
25
- return g;
25
+ return v;
26
26
  }
27
27
  getTemplate() {
28
28
  return `
@@ -34,8 +34,8 @@ class B extends _ {
34
34
  }
35
35
  onTemplateNodeUpdated(e) {
36
36
  if (this.currentNode = e, "getAttribute" in this.currentNode) {
37
- const t = this.currentNode.getAttribute(d.PAGE_LIST);
38
- t && (t !== this.lastParsedAttribute && (this.currentPages = h(t), this.lastParsedAttribute = t, this.currentPreviewIndex = 0), this._updateCounter(), this._loadAndUpdatePreview());
37
+ const t = this.currentNode.getAttribute(p.PAGE_LIST);
38
+ t && (t !== this.lastParsedAttribute && (this.currentPages = _(t), this.lastParsedAttribute = t, this.currentPreviewIndex = 0), this._updateCounter(), this._loadAndUpdatePreview());
39
39
  }
40
40
  }
41
41
  onRender() {
@@ -62,18 +62,11 @@ class B extends _ {
62
62
  _onButtonClick() {
63
63
  try {
64
64
  const e = l();
65
- this._reseedSelectionFromBlock(), e.activeType = e.getSelectedCollection[this.currentPreviewIndex], e.pageSelectionUpdateStatus = !0, e.pageSelectionDrawerStatus = !0;
65
+ e.activeType = e.getSelectedCollection[this.currentPreviewIndex], e.pageSelectionUpdateStatus = !0, e.pageSelectionDrawerStatus = !0;
66
66
  } catch (e) {
67
67
  console.error("[UnsubscribeControl] Failed to open drawer:", e);
68
68
  }
69
69
  }
70
- _reseedSelectionFromBlock() {
71
- const e = l();
72
- if (e.$reset(), !this.currentNode || !("getAttribute" in this.currentNode))
73
- return;
74
- const t = this.currentNode.getAttribute(d.PAGE_TYPE), a = this.currentNode.getAttribute(d.PAGE_LIST);
75
- !t || !a || (e.setCollectionWithoutAutoSelection(Number(t)), e.loadSelectedTemplates(h(a)));
76
- }
77
70
  _onPrevClick() {
78
71
  this.currentPreviewIndex > 0 && (this.currentPreviewIndex--, this._updatePreview(), this._updateCounter());
79
72
  }
@@ -87,21 +80,21 @@ class B extends _ {
87
80
  var e;
88
81
  if ((e = this.currentPages) != null && e.length)
89
82
  try {
90
- const t = this.currentPages[this.currentPreviewIndex], u = l().getThumbnailByTemplateId(t);
91
- if (!u) {
83
+ const t = this.currentPages[this.currentPreviewIndex], o = l().getThumbnailByTemplateId(t);
84
+ if (!o) {
92
85
  console.warn("[UnsubscribeControl] No thumbnail found for page:", t);
93
86
  return;
94
87
  }
95
88
  this.api.updateValues({
96
- [r.PREVIEW_IMAGE]: u
89
+ [r.PREVIEW_IMAGE]: o
97
90
  });
98
91
  } catch (t) {
99
92
  console.error("[UnsubscribeControl] Failed to update preview:", t);
100
93
  }
101
94
  }
102
95
  _updateCounter() {
103
- const e = this.currentPreviewIndex + 1, t = this.totalTemplates, a = this.currentPreviewIndex === 0, u = this.currentPreviewIndex >= t - 1;
104
- this.api.setUIEAttribute(r.PREV_BUTTON, i.BUTTON.disabled, a), this.api.setUIEAttribute(r.NEXT_BUTTON, i.BUTTON.disabled, u), this.api.setUIEAttribute(
96
+ const e = this.currentPreviewIndex + 1, t = this.totalTemplates, c = this.currentPreviewIndex === 0, o = this.currentPreviewIndex >= t - 1;
97
+ this.api.setUIEAttribute(r.PREV_BUTTON, i.BUTTON.disabled, c), this.api.setUIEAttribute(r.NEXT_BUTTON, i.BUTTON.disabled, o), this.api.setUIEAttribute(
105
98
  r.COUNTER_TEXT,
106
99
  i.LABEL.text,
107
100
  `${this.api.translate("Showing")} ${e} ${this.api.translate("of")} ${t}`
@@ -142,14 +135,14 @@ class B extends _ {
142
135
  </${n.LABEL}>
143
136
  `;
144
137
  }
145
- _getIconButton(e, t, a) {
146
- const u = a ? `${i.BUTTON.disabled}="true"` : "";
138
+ _getIconButton(e, t, c) {
139
+ const o = c ? `${i.BUTTON.disabled}="true"` : "";
147
140
  return `
148
141
  <${n.BUTTON}
149
142
  id="${e}"
150
143
  class="flat-inline flat-white"
151
144
  ${i.BUTTON.name}="${e}"
152
- ${u}
145
+ ${o}
153
146
  >
154
147
  <${n.ICON}
155
148
  src="${t}"
@@ -172,6 +165,6 @@ class B extends _ {
172
165
  }
173
166
  }
174
167
  export {
175
- g as UNSUBSCRIBE_CONTROL_ID,
168
+ v as UNSUBSCRIBE_CONTROL_ID,
176
169
  B as UnsubscribeControl
177
170
  };
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- .gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.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}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-64c52560]{gap:8px}.version-history__toolbar[data-v-64c52560]{gap:4px}.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}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-82128f7d]{gap:4px}.header-wrapper[data-v-5c02dcc7]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-50dac6de]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-50dac6de]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-50dac6de]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-f6a8cb4c]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-f6a8cb4c]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-f6a8cb4c]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-f6a8cb4c]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-f6a8cb4c]{object-fit:cover;transform:scale(1)}[data-v-43c617a7] .guido__verion-history-view-option-selection-desktop svg,[data-v-43c617a7] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-43c617a7] .in-segments-wrapper__button_selected,[data-v-43c617a7] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-988f8da6]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-988f8da6]{min-height:504px}.iframe-wrapper[data-v-e0424e99]{width:258px}.iframe-scaled[data-v-e0424e99]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-7419ae06] .vueperslides__bullets,[data-v-796d193b] .vueperslides__bullets{pointer-events:none!important}[data-v-796d193b] .vueperslides__parallax-wrapper{height:110px!important}[data-v-cadfc82d] .vueperslides__bullets{pointer-events:none!important}[data-v-cadfc82d] .vueperslides__parallax-wrapper{height:110px!important}
1
+ .gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.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}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-64c52560]{gap:8px}.version-history__toolbar[data-v-64c52560]{gap:4px}.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}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-82128f7d]{gap:4px}.header-wrapper[data-v-5c02dcc7]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-50dac6de]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-50dac6de]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-50dac6de]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-df672485]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-df672485]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-df672485]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-df672485]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-df672485]{object-fit:cover;transform:scale(1)}[data-v-43c617a7] .guido__verion-history-view-option-selection-desktop svg,[data-v-43c617a7] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-43c617a7] .in-segments-wrapper__button_selected,[data-v-43c617a7] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-988f8da6]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-988f8da6]{min-height:504px}.iframe-wrapper[data-v-e0424e99]{width:258px}.iframe-scaled[data-v-e0424e99]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-7419ae06] .vueperslides__bullets,[data-v-796d193b] .vueperslides__bullets{pointer-events:none!important}[data-v-796d193b] .vueperslides__parallax-wrapper{height:110px!important}[data-v-cadfc82d] .vueperslides__bullets{pointer-events:none!important}[data-v-cadfc82d] .vueperslides__parallax-wrapper{height:110px!important}
@@ -8,7 +8,7 @@ export interface ExtensionStoreSlice {
8
8
  languages: Languages;
9
9
  currencyList: Currency[];
10
10
  }
11
- interface RequiredField {
11
+ export interface RequiredField {
12
12
  key: string;
13
13
  getValue: (config: PerBlockConfigs) => string;
14
14
  getAvailableOptions?: (store: ExtensionStoreSlice) => string[];
@@ -16,6 +16,5 @@ interface RequiredField {
16
16
  }
17
17
  export declare const REQUIRED_RECOMMENDATION_FIELDS: RequiredField[];
18
18
  export declare const RecommendationRequiredFieldsKey = "newsletter.recommendation-fill-required-fields";
19
- export declare function getInvalidFields(config: PerBlockConfigs, store: ExtensionStoreSlice): string[];
19
+ export declare function getInvalidFields(config: PerBlockConfigs, store: ExtensionStoreSlice, fields?: RequiredField[]): string[];
20
20
  export declare function isConfigValid(config: PerBlockConfigs, store: ExtensionStoreSlice): boolean;
21
- export {};
@@ -15,7 +15,6 @@ export declare class UnsubscribeControl extends Control {
15
15
  private get totalTemplates();
16
16
  private _listenToFormUpdates;
17
17
  private _onButtonClick;
18
- private _reseedSelectionFromBlock;
19
18
  private _onPrevClick;
20
19
  private _onNextClick;
21
20
  private _loadAndUpdatePreview;
@@ -16,7 +16,7 @@ const s = a("guidoDynamicContent", {
16
16
  value: e.value,
17
17
  fallback: e.fallback,
18
18
  format: e.format
19
- })) || []
19
+ }))
20
20
  }
21
21
  });
22
22
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.7.0-beta.04f8814",
3
+ "version": "3.7.0-beta.2037cb1",
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",
@@ -1,63 +0,0 @@
1
- interface User {
2
- id: number;
3
- name: string;
4
- email: string;
5
- }
6
- export declare const useApiExample: () => {
7
- loading: import("vue").ComputedRef<boolean>;
8
- error: import("vue").ComputedRef<{
9
- message: string;
10
- status?: number | undefined;
11
- statusText?: string | undefined;
12
- response?: {
13
- readonly headers: {
14
- append: (name: string, value: string) => void;
15
- delete: (name: string) => void;
16
- get: (name: string) => string | null;
17
- getSetCookie: () => string[];
18
- has: (name: string) => boolean;
19
- set: (name: string, value: string) => void;
20
- forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
21
- entries: () => IterableIterator<[string, string]>;
22
- keys: () => IterableIterator<string>;
23
- values: () => IterableIterator<string>;
24
- [Symbol.iterator]: () => IterableIterator<[string, string]>;
25
- };
26
- readonly ok: boolean;
27
- readonly redirected: boolean;
28
- readonly status: number;
29
- readonly statusText: string;
30
- readonly type: ResponseType;
31
- readonly url: string;
32
- clone: () => Response;
33
- readonly body: {
34
- readonly locked: boolean;
35
- cancel: (reason?: any) => Promise<void>;
36
- getReader: {
37
- (options: {
38
- mode: "byob";
39
- }): ReadableStreamBYOBReader;
40
- (): ReadableStreamDefaultReader<Uint8Array>;
41
- (options?: ReadableStreamGetReaderOptions): ReadableStreamReader<Uint8Array>;
42
- };
43
- pipeThrough: <T>(transform: ReadableWritablePair<T, Uint8Array>, options?: StreamPipeOptions) => ReadableStream<T>;
44
- pipeTo: (destination: WritableStream<Uint8Array>, options?: StreamPipeOptions) => Promise<void>;
45
- tee: () => [ReadableStream<Uint8Array>, ReadableStream<Uint8Array>];
46
- } | null;
47
- readonly bodyUsed: boolean;
48
- arrayBuffer: () => Promise<ArrayBuffer>;
49
- blob: () => Promise<Blob>;
50
- formData: () => Promise<FormData>;
51
- json: () => Promise<any>;
52
- text: () => Promise<string>;
53
- } | undefined;
54
- } | null>;
55
- hasError: import("vue").ComputedRef<boolean>;
56
- fetchUsers: () => Promise<User[]>;
57
- createUser: (userData: Omit<User, "id">) => Promise<User>;
58
- updateUser: (id: number, userData: Partial<User>) => Promise<User>;
59
- deleteUser: (id: number) => Promise<void>;
60
- uploadFile: (file: File) => Promise<string>;
61
- clearError: () => void;
62
- };
63
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
File without changes