@useinsider/guido 3.30.0-beta.69ba1a4 → 3.30.0-beta.6bec386

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,18 +1,18 @@
1
1
  import o from "./Guido.vue2.js";
2
2
  /* empty css */
3
3
  import i from "../_virtual/_plugin-vue2_normalizer.js";
4
- var t = function() {
4
+ var n = function() {
5
5
  var a = this, r = a._self._c, e = a._self._setupProxy;
6
- return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper), r(e.AutoSaveController, { ref: "autoSaveControllerRef" }), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : a._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.StripoNotificationModal), r(e.AuthErrorModal), r(e.FilterSelectionDrawer), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.AssignStrategyDrawer) : a._e(), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.RemoveStrategyModal) : a._e(), e.isRrsEnabled ? r(e.LegacyStrategyUpdatedModal) : a._e(), e.isLegacyUnsubscribeConversionEnabled ? r(e.LegacyUnsubscribeConvertedModal) : a._e(), e.moduleDynamicContentStore.queue.length > 0 ? r(e.AmbiguousDynamicContentModal) : a._e(), r(e.SaveAsTemplateDrawer), e.isSaveValidationEnabled ? r(e.ValidationErrorDrawer) : a._e(), e.isExternalDisplayConditionsEnabled ? r(e.DisplayConditionsHost) : a._e(), e.isTestPartner() ? a._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(l) {
6
+ return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper), r(e.AutoSaveController, { ref: "autoSaveControllerRef" }), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : a._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.AuthErrorModal), r(e.FilterSelectionDrawer), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.AssignStrategyDrawer) : a._e(), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.RemoveStrategyModal) : a._e(), e.isRrsEnabled ? r(e.LegacyStrategyUpdatedModal) : a._e(), e.isLegacyUnsubscribeConversionEnabled ? r(e.LegacyUnsubscribeConvertedModal) : a._e(), e.moduleDynamicContentStore.queue.length > 0 ? r(e.AmbiguousDynamicContentModal) : a._e(), r(e.SaveAsTemplateDrawer), e.isSaveValidationEnabled ? r(e.ValidationErrorDrawer) : a._e(), e.isExternalDisplayConditionsEnabled ? r(e.DisplayConditionsHost) : a._e(), e.isTestPartner() ? a._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(l) {
7
7
  return e.emit("onboarding:finished");
8
8
  } } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
9
- }, n = [], s = /* @__PURE__ */ i(
9
+ }, t = [], s = /* @__PURE__ */ i(
10
10
  o,
11
- t,
12
11
  n,
12
+ t,
13
13
  !1,
14
14
  null,
15
- "304e53dd"
15
+ "0c5f11a1"
16
16
  );
17
17
  const u = s.exports;
18
18
  export {
@@ -1,4 +1,4 @@
1
- import { defineComponent as ve, defineAsyncComponent as a, ref as W, computed as l, watch as $, onMounted as he, onUnmounted as Ee } from "vue";
1
+ import { defineComponent as Se, defineAsyncComponent as a, ref as W, computed as l, watch as $, onMounted as he, onUnmounted as Ee } from "vue";
2
2
  import { useCortexBlueprintBridge as Ce } from "../composables/useCortexBlueprintBridge.js";
3
3
  import { useEditorLock as De } from "../composables/useEditorLock.js";
4
4
  import { startEditorOpenMetrics as we } from "../composables/useEditorOpenMetrics.js";
@@ -12,34 +12,32 @@ import { useToaster as Re } from "../composables/useToaster.js";
12
12
  import { useTranslations as Oe } from "../composables/useTranslations.js";
13
13
  import { migrate as Ue } from "../config/migrator/index.js";
14
14
  import { ModuleFolderDefaults as G } from "../enums/defaults.js";
15
- import { RIBBON_SELECTOR as Ne } from "../enums/onboarding.js";
16
- import { ToasterTypeOptions as Ae } from "../enums/toaster.js";
15
+ import { RIBBON_SELECTOR as Ae } from "../enums/onboarding.js";
16
+ import { ToasterTypeOptions as Ne } from "../enums/toaster.js";
17
17
  import { useRecommendationExtensionStore as z, disposeStrategyPageReturnListeners as _e } from "../extensions/Blocks/Recommendation/store/recommendation.js";
18
18
  import { disposeUnsubscribeListeners as Pe } from "../extensions/Blocks/Unsubscribe/block.js";
19
19
  import { disposeDisplayConditionRequest as xe } from "../extensions/DisplayConditions/bridge.js";
20
20
  import Be from "./organisms/AutoSaveController.vue.js";
21
21
  import He from "./organisms/base/AuthErrorModal.vue.js";
22
- import Ve from "./organisms/base/StripoNotificationModal.vue.js";
23
- import We from "./organisms/base/Toaster.vue.js";
24
- import $e from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
25
- import Ge from "./organisms/header/HeaderWrapper.vue.js";
26
- import ze from "./organisms/LoadingWrapper.vue.js";
27
- import qe from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
28
- import Ke from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
29
- import je from "./organisms/validation/ValidationErrorDrawer.vue.js";
30
- import { useStripoApi as Je } from "../services/stripoApi.js";
31
- import { useConfigStore as Qe } from "../stores/config.js";
32
- import { useDynamicContentStore as Xe } from "../stores/dynamic-content.js";
22
+ import Ve from "./organisms/base/Toaster.vue.js";
23
+ import We from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
24
+ import $e from "./organisms/header/HeaderWrapper.vue.js";
25
+ import Ge from "./organisms/LoadingWrapper.vue.js";
26
+ import ze from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
27
+ import qe from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
28
+ import Ke from "./organisms/validation/ValidationErrorDrawer.vue.js";
29
+ import { useStripoApi as je } from "../services/stripoApi.js";
30
+ import { useConfigStore as Je } from "../stores/config.js";
31
+ import { useDynamicContentStore as Qe } from "../stores/dynamic-content.js";
33
32
  import { useEditorStore as C } from "../stores/editor.js";
34
33
  import { useModuleDynamicContentStore as q } from "../stores/module-dynamic-content.js";
35
- import { useOnboardingStore as Ye } from "../stores/onboarding.js";
36
- import { usePreviewStore as Ze } from "../stores/preview.js";
37
- import { useSaveValidationStore as et } from "../stores/save-validation.js";
38
- import { useStripoNotificationModalStore as tt } from "../stores/stripo-notification-modal.js";
39
- import { useTemplateStore as ot } from "../stores/template.js";
40
- import { useUnsubscribeStore as nt } from "../stores/unsubscribe.js";
34
+ import { useOnboardingStore as Xe } from "../stores/onboarding.js";
35
+ import { usePreviewStore as Ye } from "../stores/preview.js";
36
+ import { useSaveValidationStore as Ze } from "../stores/save-validation.js";
37
+ import { useTemplateStore as et } from "../stores/template.js";
38
+ import { useUnsubscribeStore as tt } from "../stores/unsubscribe.js";
41
39
  import { readTrackFloor as K } from "../utils/linkTrackingIds.js";
42
- const zt = /* @__PURE__ */ ve({
40
+ const Vt = /* @__PURE__ */ Se({
43
41
  __name: "Guido",
44
42
  props: {
45
43
  config: null,
@@ -63,13 +61,13 @@ const zt = /* @__PURE__ */ ve({
63
61
  () => import("./organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js")
64
62
  ), ne = a(
65
63
  () => import("./organisms/dynamic-content/AmbiguousDynamicContentModal.vue.js")
66
- ), y = W(), g = Xe(), w = nt(), re = q(), o = Qe();
64
+ ), y = W(), g = Qe(), w = tt(), re = q(), o = Je();
67
65
  c.ready && o.init(c.config);
68
- const d = C(), ie = Ze(), p = l(() => d.hasChanges), { isTestPartner: se } = Fe(), { isEnabled: ae, loadRollout: T } = Me(), { showToaster: k } = Re(), F = Oe(), M = () => {
66
+ const d = C(), ie = Ye(), p = l(() => d.hasChanges), { isTestPartner: se } = Fe(), { isEnabled: ae, loadRollout: T } = Me(), { showToaster: k } = Re(), F = Oe(), M = () => {
69
67
  var t;
70
68
  if (d.isVersionHistoryOpen) {
71
69
  console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }), k({
72
- type: Ae.Warning,
70
+ type: Ne.Warning,
73
71
  message: F("email-editor.save-blocked-outside-editor")
74
72
  });
75
73
  return;
@@ -89,9 +87,9 @@ const zt = /* @__PURE__ */ ve({
89
87
  savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || G.SAVED_MODULES,
90
88
  defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || G.DEFAULT_MODULES
91
89
  };
92
- }, { initPlugin: L, preloadRuntime: R } = Ie(r), { runExclusive: O, beginMount: U, isCurrentMount: S } = De();
90
+ }, { initPlugin: L, preloadRuntime: R } = Ie(r), { runExclusive: O, beginMount: U, isCurrentMount: v } = De();
93
91
  let f = 0;
94
- const { getDefaultTemplate: N } = Je(), { cloneTimersOnSave: A, hasTimerBlocks: _ } = Le(), ce = l(() => {
92
+ const { getDefaultTemplate: A } = je(), { cloneTimersOnSave: N, hasTimerBlocks: _ } = Le(), ce = l(() => {
95
93
  var t;
96
94
  return !((t = o.ui) != null && t.showHeader);
97
95
  }), de = l(() => o.isFeatureEnabled("reusableRecommendationStrategy")), me = l(() => o.externalDisplayConditions), le = l(
@@ -122,14 +120,14 @@ const zt = /* @__PURE__ */ ve({
122
120
  $(() => p.value, () => {
123
121
  i("on-change", p.value);
124
122
  });
125
- const v = (t) => {
123
+ const S = (t) => {
126
124
  const e = t, { attribute: s, position: u } = e.detail;
127
125
  console.debug("dynamic-content:open", e.detail), i("dynamic-content:open", s, u);
128
126
  };
129
127
  let m = null;
130
128
  const h = () => {
131
129
  var e;
132
- const t = document.querySelector(Ne);
130
+ const t = document.querySelector(Ae);
133
131
  (e = y.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
134
132
  }, E = async () => {
135
133
  var t;
@@ -149,17 +147,17 @@ const zt = /* @__PURE__ */ ve({
149
147
  rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
150
148
  }, ye = {
151
149
  itemsPriceFormatting: o.isFeatureEnabled("itemsPriceFormatting")
152
- }, V = (Se) => r.timed(
150
+ }, V = (ve) => r.timed(
153
151
  "migration",
154
- () => Ue(Se, pe, fe, ye)
152
+ () => Ue(ve, pe, fe, ye)
155
153
  );
156
154
  let n = {
157
155
  html: s && await V(s),
158
156
  css: u
159
157
  };
160
- n.html || (n = await r.timed("default_template", () => N()), n.html = await V(n.html));
158
+ n.html || (n = await r.timed("default_template", () => A()), n.html = await V(n.html));
161
159
  const ge = H ? K(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
162
- _(n.html) && (n.html = await r.timed("timer_clone", () => A(n.html))), H && (d.trackIdSessionFloor = Math.max(ge, K(n.html)));
160
+ _(n.html) && (n.html = await r.timed("timer_clone", () => N(n.html))), H && (d.trackIdSessionFloor = Math.max(ge, K(n.html)));
163
161
  const be = {
164
162
  preselectedDynamicContentList: B,
165
163
  onReady: () => {
@@ -173,7 +171,7 @@ const zt = /* @__PURE__ */ ve({
173
171
  };
174
172
  return he(async () => {
175
173
  var e;
176
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(), C().$reset(), ot().$reset(), et().$reset(), q().$reset(), tt().$reset(), Ye().resetOnboarding("recommendationLegacyStrategyOnboarding"), T(), h();
174
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(), C().$reset(), et().$reset(), Ze().$reset(), q().$reset(), Xe().resetOnboarding("recommendationLegacyStrategyOnboarding"), T(), h();
177
175
  const t = (e = y.value) == null ? void 0 : e.parentElement;
178
176
  if (t && (m = new ResizeObserver(h), m.observe(t)), R(), c.ready)
179
177
  await E();
@@ -182,9 +180,9 @@ const zt = /* @__PURE__ */ ve({
182
180
  u && (s(), E());
183
181
  });
184
182
  }
185
- document.addEventListener("dynamic-content:open", v);
183
+ document.addEventListener("dynamic-content:open", S);
186
184
  }), Ee(() => {
187
- if (Pe(), _e(), r.dispose(), m == null || m.disconnect(), document.removeEventListener("dynamic-content:open", v), S(f)) {
185
+ if (Pe(), _e(), r.dispose(), m == null || m.disconnect(), document.removeEventListener("dynamic-content:open", S), v(f)) {
188
186
  xe();
189
187
  try {
190
188
  const t = C();
@@ -194,7 +192,7 @@ const zt = /* @__PURE__ */ ve({
194
192
  }
195
193
  }
196
194
  O(async () => {
197
- if (S(f))
195
+ if (v(f))
198
196
  try {
199
197
  window.UIEditor.removeEditor();
200
198
  } catch {
@@ -209,9 +207,9 @@ const zt = /* @__PURE__ */ ve({
209
207
  hasChanges: p,
210
208
  saveSilent: M,
211
209
  setLoading: I
212
- }), { __sfc: !0, openMetrics: r, PreviewContainer: Q, OnboardingWrapper: X, AssignStrategyDrawer: Y, RemoveStrategyModal: Z, DisplayConditionsHost: ee, autoSaveControllerRef: D, LegacyStrategyUpdatedModal: te, LegacyUnsubscribeConvertedModal: oe, AmbiguousDynamicContentModal: ne, wrapperRef: y, dynamicContentStore: g, unsubscribeStore: w, moduleDynamicContentStore: re, props: c, configStore: o, editorStore: d, previewStore: ie, hasChanges: p, isTestPartner: se, isSaveValidationEnabled: ae, loadRollout: T, showToaster: k, trans: F, saveSilent: M, setLoading: I, emit: i, buildMetadata: b, initPlugin: L, preloadRuntime: R, runExclusive: O, beginMount: U, isCurrentMount: S, mountGeneration: f, getDefaultTemplate: N, cloneTimersOnSave: A, hasTimerBlocks: _, noHeader: ce, isRrsEnabled: de, isExternalDisplayConditionsEnabled: me, isLegacyUnsubscribeConversionEnabled: le, hasAssignedStrategy: ue, insertDynamicContent: P, closeDynamicContent: x, handleDynamicContentOpen: v, ribbonObserver: m, updateRibbonOffset: h, startEditor: E, AutoSaveController: Be, AuthErrorModal: He, StripoNotificationModal: Ve, Toaster: We, FilterSelectionDrawer: $e, HeaderWrapper: Ge, LoadingWrapper: ze, SaveAsTemplateDrawer: qe, UnsubscribeWrapper: Ke, ValidationErrorDrawer: je };
210
+ }), { __sfc: !0, openMetrics: r, PreviewContainer: Q, OnboardingWrapper: X, AssignStrategyDrawer: Y, RemoveStrategyModal: Z, DisplayConditionsHost: ee, autoSaveControllerRef: D, LegacyStrategyUpdatedModal: te, LegacyUnsubscribeConvertedModal: oe, AmbiguousDynamicContentModal: ne, wrapperRef: y, dynamicContentStore: g, unsubscribeStore: w, moduleDynamicContentStore: re, props: c, configStore: o, editorStore: d, previewStore: ie, hasChanges: p, isTestPartner: se, isSaveValidationEnabled: ae, loadRollout: T, showToaster: k, trans: F, saveSilent: M, setLoading: I, emit: i, buildMetadata: b, initPlugin: L, preloadRuntime: R, runExclusive: O, beginMount: U, isCurrentMount: v, mountGeneration: f, getDefaultTemplate: A, cloneTimersOnSave: N, hasTimerBlocks: _, noHeader: ce, isRrsEnabled: de, isExternalDisplayConditionsEnabled: me, isLegacyUnsubscribeConversionEnabled: le, hasAssignedStrategy: ue, insertDynamicContent: P, closeDynamicContent: x, handleDynamicContentOpen: S, ribbonObserver: m, updateRibbonOffset: h, startEditor: E, AutoSaveController: Be, AuthErrorModal: He, Toaster: Ve, FilterSelectionDrawer: We, HeaderWrapper: $e, LoadingWrapper: Ge, SaveAsTemplateDrawer: ze, UnsubscribeWrapper: qe, ValidationErrorDrawer: Ke };
213
211
  }
214
212
  });
215
213
  export {
216
- zt as default
214
+ Vt as default
217
215
  };
@@ -1,18 +1,17 @@
1
- import s from "./Toaster.vue2.js";
2
- /* empty css */
3
- import n from "../../../_virtual/_plugin-vue2_normalizer.js";
1
+ import n from "./Toaster.vue2.js";
2
+ import s from "../../../_virtual/_plugin-vue2_normalizer.js";
4
3
  var r = function() {
5
4
  var o = this, e = o._self._c, t = o._self._setupProxy;
6
- return e(t.InToasts, { ref: "toastRef", attrs: { id: t.toastId, "action-buttons-config": t.actionButtonsConfig, status: t.store.status, text: t.store.text, timeout: 0, type: t.store.type }, on: { actionButtonClick0: t.handleActionClick } });
7
- }, a = [], i = /* @__PURE__ */ n(
8
- s,
5
+ return e(t.InToasts, { ref: "toastRef", attrs: { "action-buttons-config": t.actionButtonsConfig, status: t.store.status, text: t.store.text, type: t.store.type }, on: { actionButtonClick0: t.handleActionClick } });
6
+ }, a = [], _ = /* @__PURE__ */ s(
7
+ n,
9
8
  r,
10
9
  a,
11
10
  !1,
12
11
  null,
13
12
  null
14
13
  );
15
- const l = i.exports;
14
+ const l = _.exports;
16
15
  export {
17
16
  l as default
18
17
  };
@@ -1,19 +1,19 @@
1
- import { defineComponent as u, ref as m, computed as r, onBeforeUnmount as f } from "vue";
2
- import { useToaster as l } from "../../../composables/useToaster.js";
1
+ import { defineComponent as c, ref as i, computed as u, onBeforeUnmount as m } from "vue";
2
+ import { useToaster as f } from "../../../composables/useToaster.js";
3
3
  import { useToasterStore as p } from "../../../stores/toaster.js";
4
- import { InToasts as _ } from "@useinsider/design-system-vue";
5
- const b = /* @__PURE__ */ u({
4
+ import { InToasts as l } from "@useinsider/design-system-vue";
5
+ const x = /* @__PURE__ */ c({
6
6
  __name: "Toaster",
7
- setup(d) {
8
- const t = p(), { hideToaster: o } = l(), e = m(null), a = r(() => t.actionButton ? [{ text: t.actionButton.text }] : []), c = r(() => t.closeable ? "" : "guido-toast-non-closeable"), i = () => {
7
+ setup(_) {
8
+ const t = p(), { hideToaster: o } = f(), e = i(null), s = u(() => t.actionButton ? [{ text: t.actionButton.text }] : []), a = () => {
9
9
  t.actionButton && t.actionButton.onClick(), o();
10
10
  };
11
- return f(() => {
12
- var n, s;
13
- o(), t.$reset(), (s = (n = e.value) == null ? void 0 : n.$el) == null || s.remove();
14
- }), { __sfc: !0, store: t, hideToaster: o, toastRef: e, actionButtonsConfig: a, toastId: c, handleActionClick: i, InToasts: _ };
11
+ return m(() => {
12
+ var n, r;
13
+ o(), t.$reset(), (r = (n = e.value) == null ? void 0 : n.$el) == null || r.remove();
14
+ }), { __sfc: !0, store: t, hideToaster: o, toastRef: e, actionButtonsConfig: s, handleActionClick: a, InToasts: l };
15
15
  }
16
16
  });
17
17
  export {
18
- b as default
18
+ x as default
19
19
  };
@@ -2,17 +2,17 @@ import i from "./EditorActionsMenu.vue2.js";
2
2
  /* empty css */
3
3
  import s from "../../../_virtual/_plugin-vue2_normalizer.js";
4
4
  var n = function() {
5
- var e = this, o = e._self._c, t = e._self._setupProxy;
6
- return o("div", { staticClass: "editor-actions-menu p-r" }, [o(t.InButtonV2, { attrs: { id: "guido__kebab-button", "data-testid": "Editor Actions Menu", "left-icon": "line-more-vertical", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.loadingStatus, "label-text-status": !1, "selected-status": t.isPanelOpen, "tooltip-options": t.getTooltipOptions("guido__kebab-button"), "tooltip-text": t.trans("email-editor.more-actions") }, on: { click: function(d) {
5
+ var o = this, e = o._self._c, t = o._self._setupProxy;
6
+ return e("div", { staticClass: "editor-actions-menu p-r" }, [e(t.InButtonV2, { attrs: { id: "guido__kebab-button", "data-testid": "Editor Actions Menu", "left-icon": "line-more-vertical", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isEditorUnavailable, "label-text-status": !1, "selected-status": t.isPanelOpen, "tooltip-options": t.getTooltipOptions("guido__kebab-button"), "tooltip-text": t.trans("email-editor.more-actions") }, on: { click: function(c) {
7
7
  t.isOpen = !t.isOpen;
8
- } } }), o(t.InDropdownMenu, { staticClass: "editor-actions-menu__dropdown", attrs: { id: "guido__kebab-menu", "box-width": "basedOnLongestItem", "static-position": "bottom right", "dynamic-position": !1, "max-height": 400, options: t.options, "select-all-option-status": !1, status: t.isPanelOpen }, on: { clickOutside: t.close, optionClick: t.handleOptionClick } })], 1);
8
+ } } }), e(t.InDropdownMenu, { staticClass: "editor-actions-menu__dropdown", attrs: { id: "guido__kebab-menu", "box-width": "basedOnLongestItem", "static-position": "bottom right", "dynamic-position": !1, "max-height": 400, options: t.options, "select-all-option-status": !1, status: t.isPanelOpen }, on: { clickOutside: t.close, optionClick: t.handleOptionClick } })], 1);
9
9
  }, a = [], r = /* @__PURE__ */ s(
10
10
  i,
11
11
  n,
12
12
  a,
13
13
  !1,
14
14
  null,
15
- "bdb3b37a"
15
+ "0e63ebe1"
16
16
  );
17
17
  const _ = r.exports;
18
18
  export {
@@ -1,9 +1,9 @@
1
- import { defineComponent as D, ref as C, computed as i, watch as L } from "vue";
2
- import { useAccessibilityApi as R } from "../../../composables/useAccessibilityApi.js";
3
- import { useConfig as Y } from "../../../composables/useConfig.js";
4
- import { useExport as F } from "../../../composables/useExport.js";
5
- import { useTranslations as N } from "../../../composables/useTranslations.js";
6
- import { useVersionHistoryApi as U } from "../../../composables/useVersionHistoryApi.js";
1
+ import { defineComponent as D, ref as C, computed as s, watch as L } from "vue";
2
+ import { useAccessibilityApi as U } from "../../../composables/useAccessibilityApi.js";
3
+ import { useConfig as R } from "../../../composables/useConfig.js";
4
+ import { useExport as Y } from "../../../composables/useExport.js";
5
+ import { useTranslations as F } from "../../../composables/useTranslations.js";
6
+ import { useVersionHistoryApi as N } from "../../../composables/useVersionHistoryApi.js";
7
7
  import { useAutosaveStore as X } from "../../../stores/autosave.js";
8
8
  import { useEditorStore as j } from "../../../stores/editor.js";
9
9
  import { useOnboardingStore as q } from "../../../stores/onboarding.js";
@@ -12,22 +12,22 @@ import { InToggle as G, InDropdownMenu as J, InButtonV2 as K } from "@useinsider
12
12
  const ce = /* @__PURE__ */ D({
13
13
  __name: "EditorActionsMenu",
14
14
  setup(Q) {
15
- const c = "guido__kebab-autosave", u = "guido__kebab-version-history", p = "guido__kebab-accessibility", d = "guido__kebab-save-as", v = "guido__kebab-export", { config: m, isFeatureEnabled: b } = Y(), { exportHtml: y } = F(), { openVersionHistory: A, closeVersionHistory: S } = U(), { toggleAccessibilityTestingMode: _ } = R(), e = j(), a = X(), f = q(), o = N(), g = C(!1), M = i(() => g.value || f.isEditorActionsMenuPinned), r = C(!1), O = i(() => b("autosave")), x = i(
15
+ const c = "guido__kebab-autosave", u = "guido__kebab-version-history", p = "guido__kebab-accessibility", d = "guido__kebab-save-as", v = "guido__kebab-export", { config: b, isFeatureEnabled: m } = R(), { exportHtml: y } = Y(), { openVersionHistory: A, closeVersionHistory: _ } = N(), { toggleAccessibilityTestingMode: O } = U(), e = j(), a = X(), f = q(), o = F(), g = C(!1), M = s(() => g.value || f.isEditorActionsMenuPinned), r = C(!1), S = s(() => m("autosave")), E = s(
16
16
  () => {
17
- var t, s;
18
- return !!((s = (t = m.value) == null ? void 0 : t.features) != null && s.versionHistory) && !e.isPreviewModeOpen;
17
+ var t, i;
18
+ return !!((i = (t = b.value) == null ? void 0 : t.features) != null && i.versionHistory) && !e.isPreviewModeOpen;
19
19
  }
20
- ), h = i(
21
- () => b("accessibilityTesting") && !e.isPreviewModeOpen
22
- ), V = i(() => {
23
- var t, s;
24
- return !!((s = (t = m.value) == null ? void 0 : t.features) != null && s.saveAsTemplate);
25
- }), E = i(() => O.value ? [
20
+ ), x = s(
21
+ () => m("accessibilityTesting") && !e.isPreviewModeOpen
22
+ ), h = s(() => {
23
+ var t, i;
24
+ return !!((i = (t = b.value) == null ? void 0 : t.features) != null && i.saveAsTemplate);
25
+ }), V = s(() => S.value ? [
26
26
  { categoryText: o("email-editor.preferences") },
27
27
  {
28
28
  text: o("email-editor.auto-save"),
29
29
  value: c,
30
- disable: e.loadingStatus,
30
+ disable: e.isEditorUnavailable,
31
31
  rightSlotComponent: G,
32
32
  rightSlotProps: {
33
33
  // InDropdownMenu fills attrs.id with its own positional test id, and v-bind
@@ -35,25 +35,25 @@ const ce = /* @__PURE__ */ D({
35
35
  name: "guido-kebab-autosave-toggle",
36
36
  class: "p-e-n",
37
37
  checked: a.isOn,
38
- disable: e.loadingStatus
38
+ disable: e.isEditorUnavailable
39
39
  }
40
40
  },
41
41
  { divider: "solid" }
42
- ] : []), T = i(() => [
42
+ ] : []), T = s(() => [
43
43
  { categoryText: o("email-editor.actions") },
44
- ...x.value ? [{
44
+ ...E.value ? [{
45
45
  text: o("newsletter.version-history"),
46
46
  value: u,
47
47
  iconLeft: "line-architect-version-history",
48
48
  disable: e.isVersionHistoryButtonDisabled
49
49
  }] : [],
50
- ...h.value ? [{
50
+ ...x.value ? [{
51
51
  text: o("email-editor.accessibility-test"),
52
52
  value: p,
53
53
  iconLeft: "line-accessibility",
54
- disable: e.loadingStatus
54
+ disable: e.isEditorUnavailable
55
55
  }] : [],
56
- ...V.value ? [{
56
+ ...h.value ? [{
57
57
  text: o("newsletter.save-templates"),
58
58
  value: d,
59
59
  iconLeft: "line-newsletter-save-as-template",
@@ -65,7 +65,7 @@ const ce = /* @__PURE__ */ D({
65
65
  iconLeft: "line-export",
66
66
  disable: r.value || e.isExportButtonDisabled
67
67
  }
68
- ]), P = i(() => [...E.value, ...T.value]), n = () => {
68
+ ]), P = s(() => [...V.value, ...T.value]), n = () => {
69
69
  g.value = !1;
70
70
  };
71
71
  L(() => f.isEditorActionsMenuPinned, (t) => {
@@ -74,9 +74,9 @@ const ce = /* @__PURE__ */ D({
74
74
  const k = () => {
75
75
  a.isOn = !a.isOn;
76
76
  }, w = () => {
77
- e.isVersionHistoryOpen ? S() : A(), n();
77
+ e.isVersionHistoryOpen ? _() : A(), n();
78
78
  }, H = () => {
79
- _(), n();
79
+ O(), n();
80
80
  }, I = () => {
81
81
  e.isSaveAsTemplateDrawerOpen = !0, n();
82
82
  }, B = async () => {
@@ -88,9 +88,9 @@ const ce = /* @__PURE__ */ D({
88
88
  [d]: I,
89
89
  [v]: B
90
90
  };
91
- return { __sfc: !0, AUTOSAVE: c, VERSION_HISTORY: u, ACCESSIBILITY: p, SAVE_AS: d, EXPORT: v, config: m, isFeatureEnabled: b, exportHtml: y, openVersionHistory: A, closeVersionHistory: S, toggleAccessibilityTestingMode: _, editorStore: e, autosaveStore: a, onboardingStore: f, trans: o, isOpen: g, isPanelOpen: M, isExporting: r, isAutosaveVisible: O, isVersionHistoryVisible: x, isAccessibilityVisible: h, isSaveAsVisible: V, preferenceOptions: E, actionOptions: T, options: P, close: n, toggleAutosave: k, handleVersionHistory: w, handleAccessibility: H, handleSaveAs: I, handleExport: B, optionHandlers: l, handleOptionClick: ({ value: t }) => {
92
- var s;
93
- return (s = l[t]) == null ? void 0 : s.call(l);
91
+ return { __sfc: !0, AUTOSAVE: c, VERSION_HISTORY: u, ACCESSIBILITY: p, SAVE_AS: d, EXPORT: v, config: b, isFeatureEnabled: m, exportHtml: y, openVersionHistory: A, closeVersionHistory: _, toggleAccessibilityTestingMode: O, editorStore: e, autosaveStore: a, onboardingStore: f, trans: o, isOpen: g, isPanelOpen: M, isExporting: r, isAutosaveVisible: S, isVersionHistoryVisible: E, isAccessibilityVisible: x, isSaveAsVisible: h, preferenceOptions: V, actionOptions: T, options: P, close: n, toggleAutosave: k, handleVersionHistory: w, handleAccessibility: H, handleSaveAs: I, handleExport: B, optionHandlers: l, handleOptionClick: ({ value: t }) => {
92
+ var i;
93
+ return (i = l[t]) == null ? void 0 : i.call(l);
94
94
  }, getTooltipOptions: z, InButtonV2: K, InDropdownMenu: J };
95
95
  }
96
96
  });
@@ -3,9 +3,9 @@ import { useEditorLock as y } from "./useEditorLock.js";
3
3
  import { useAutosaveStore as I, AUTOSAVE_STATUS as a } from "../stores/autosave.js";
4
4
  import { useEditorStore as L } from "../stores/editor.js";
5
5
  import { computed as w, watch as V, onUnmounted as k } from "vue";
6
- const D = 18e4, b = 6e4, _ = (g, { clearsChanges: h = () => !0 } = {}) => {
6
+ const D = 18e4, b = 6e4, U = (g, { clearsChanges: h = () => !0 } = {}) => {
7
7
  const { isFeatureEnabled: m } = p(), s = L(), t = I(), { isEditorBusy: f } = y();
8
- let o = null, l = 0, u = -1;
8
+ let i = null, l = 0, u = -1;
9
9
  const d = w(
10
10
  () => m("autosave") && t.isOn
11
11
  ), A = () => s.hasChanges && s.isInSaveableState && s.changeSeq !== u, E = () => ({
@@ -30,43 +30,43 @@ const D = 18e4, b = 6e4, _ = (g, { clearsChanges: h = () => !0 } = {}) => {
30
30
  return;
31
31
  }
32
32
  e === "visibility" && (l = Date.now()), console.debug("guido:autosave:save-start", { trigger: e }), t.status = a.SAVING;
33
- const n = s.changeSeq;
33
+ const o = s.changeSeq;
34
34
  try {
35
35
  if (await g() === void 0) {
36
36
  console.debug("guido:autosave:blocked", { trigger: e, reason: "save-returned-undefined" }), t.status = a.ERROR;
37
37
  return;
38
38
  }
39
- u = n, h() && (s.hasChanges = !1), t.status = a.SAVED, t.lastSavedAt = /* @__PURE__ */ new Date(), console.debug("guido:autosave:save-complete", { trigger: e, at: t.lastSavedAt });
39
+ u = o, h() && s.changeSeq === o && (s.hasChanges = !1), t.status = a.SAVED, t.lastSavedAt = /* @__PURE__ */ new Date(), console.debug("guido:autosave:save-complete", { trigger: e, at: t.lastSavedAt });
40
40
  } catch (S) {
41
41
  console.debug("guido:autosave:error", { trigger: e, error: S }), t.status = a.ERROR;
42
42
  }
43
- }, i = () => {
43
+ }, n = () => {
44
44
  const { visibilityState: e } = document;
45
45
  if (console.debug("guido:autosave:visibility-change", {
46
46
  visibilityState: e,
47
47
  isActive: d.value
48
48
  }), e !== "hidden")
49
49
  return;
50
- const n = Date.now() - l;
51
- if (n < b) {
50
+ const o = Date.now() - l;
51
+ if (o < b) {
52
52
  console.debug("guido:autosave:visibility-debounced", {
53
- sinceLastMs: n,
53
+ sinceLastMs: o,
54
54
  debounceMs: b
55
55
  });
56
56
  return;
57
57
  }
58
58
  r("visibility");
59
59
  }, c = () => {
60
- o && (clearInterval(o), o = null);
60
+ i && (clearInterval(i), i = null);
61
61
  }, v = () => {
62
- document.removeEventListener("visibilitychange", i), window.removeEventListener("pagehide", i);
62
+ document.removeEventListener("visibilitychange", n), window.removeEventListener("pagehide", n);
63
63
  };
64
64
  V(
65
65
  d,
66
66
  (e) => {
67
- console.debug("guido:autosave:active-changed", { active: e }), e ? (c(), o = setInterval(() => {
67
+ console.debug("guido:autosave:active-changed", { active: e }), e ? (c(), i = setInterval(() => {
68
68
  console.debug("guido:autosave:interval-tick"), r("interval");
69
- }, D), document.addEventListener("visibilitychange", i), window.addEventListener("pagehide", i)) : (c(), v(), t.status = a.IDLE);
69
+ }, D), document.addEventListener("visibilitychange", n), window.addEventListener("pagehide", n)) : (c(), v(), t.status = a.IDLE);
70
70
  },
71
71
  { immediate: !0 }
72
72
  ), k(() => {
@@ -74,5 +74,5 @@ const D = 18e4, b = 6e4, _ = (g, { clearsChanges: h = () => !0 } = {}) => {
74
74
  });
75
75
  };
76
76
  export {
77
- _ as useAutoSave
77
+ U as useAutoSave
78
78
  };
@@ -1,5 +1,5 @@
1
- import { useActionsApi as j } from "./useActionsApi.js";
2
- import { useAmbiguousDynamicContent as z } from "./useAmbiguousDynamicContent.js";
1
+ import { useActionsApi as N } from "./useActionsApi.js";
2
+ import { useAmbiguousDynamicContent as j } from "./useAmbiguousDynamicContent.js";
3
3
  import { useBlocksConfig as $ } from "./useBlocksConfig.js";
4
4
  import { useConfig as G } from "./useConfig.js";
5
5
  import { useCustomInterfaceAppearance as v } from "./useCustomInterfaceAppearance.js";
@@ -13,40 +13,40 @@ import { en as B } from "../config/i18n/en/index.js";
13
13
  import { ToasterTypeOptions as Z } from "../enums/toaster.js";
14
14
  import { useStripoApi as ee } from "../services/stripoApi.js";
15
15
  import te from "../static/styles/customEditorStyle.css.js";
16
- import { useEditorStore as T } from "../stores/editor.js";
16
+ import { useEditorStore as F } from "../stores/editor.js";
17
17
  import { buildMergeTagEntries as oe, flattenDynamicContentList as re } from "../utils/genericUtil.js";
18
18
  import { getStripoRuntimeBaseUrl as ie } from "../utils/stripoRuntime.js";
19
- let d = null, F = !1;
19
+ let l = null, T = !1;
20
20
  const ve = (t) => {
21
- const { features: u, template: m, isFeatureEnabled: p } = G(), { handleError: f, showToaster: A } = W(), { getToken: P, getCustomFonts: R, getSyncModulesStatus: D } = ee(), { handleEvent: U } = K(), { handleModuleAdd: V } = J(), { restorePending: I } = z(), { getStripoBlocksConfig: L } = $(), { getStripoNotifications: q } = Q(), g = () => d || (d = new Promise((n, s) => {
21
+ const { features: u, template: m, isFeatureEnabled: p } = G(), { handleError: f, showToaster: A } = W(), { getToken: P, getCustomFonts: R, getSyncModulesStatus: D } = ee(), { handleEvent: U } = K(), { handleModuleAdd: V } = J(), { restorePending: I } = j(), { getStripoBlocksConfig: L } = $(), { getStripoNotifications: q } = Q(), g = () => l || (l = new Promise((n, a) => {
22
22
  if (document.getElementById("UiEditorScript")) {
23
23
  n();
24
24
  return;
25
25
  }
26
26
  const i = ie();
27
27
  if (!i) {
28
- s(
28
+ a(
29
29
  new Error("guido.stripo.version is not set in package.json. Please configure the Stripo version.")
30
30
  );
31
31
  return;
32
32
  }
33
- const a = `${i}UIEditor.js`, e = document.createElement("script");
34
- e.id = "UiEditorScript", e.type = "module", e.src = a, e.onload = () => {
35
- F = !0, n();
36
- }, e.onerror = () => {
37
- e.remove(), s(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
38
- }, document.body.appendChild(e);
39
- }), d.catch(() => {
40
- d = null;
41
- }), d), x = async (n, s, i, a = [], e = !1, c = !1) => {
42
- var w, k, b, _;
43
- const o = T(), { html: S, css: y } = n, { baseBlocks: E, extensions: O } = await L();
33
+ const s = `${i}UIEditor.js`, o = document.createElement("script");
34
+ o.id = "UiEditorScript", o.type = "module", o.src = s, o.onload = () => {
35
+ T = !0, n();
36
+ }, o.onerror = () => {
37
+ o.remove(), a(new Error(`Failed to load Stripo UIEditor script from S3: ${s}`));
38
+ }, document.body.appendChild(o);
39
+ }), l.catch(() => {
40
+ l = null;
41
+ }), l), x = async (n, a, i, s = [], o = !1, c = !1) => {
42
+ var k, w, b, _;
43
+ const e = F(), { html: S, css: y } = n, { baseBlocks: E, extensions: O } = await L();
44
44
  t.mark("blocks_config_ready");
45
- const h = ((w = u.value) == null ? void 0 : w.displayConditions) ?? !0, H = ((k = u.value) == null ? void 0 : k.modulesDisabled) ?? !1, C = c || (((b = m.value) == null ? void 0 : b.forceRecreate) ?? !1), M = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
45
+ const h = ((k = u.value) == null ? void 0 : k.displayConditions) ?? !0, H = ((w = u.value) == null ? void 0 : w.modulesDisabled) ?? !1, C = c || (((b = m.value) == null ? void 0 : b.forceRecreate) ?? !1), z = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
46
46
  t.setTemplate({ html: S, css: y, forceRecreate: C }), v().importCss(), t.mark("init_editor"), await window.UIEditor.initEditor(
47
47
  document.querySelector("#guido-editor"),
48
48
  {
49
- metadata: s,
49
+ metadata: a,
50
50
  html: S,
51
51
  css: y,
52
52
  forceRecreate: C,
@@ -64,7 +64,7 @@ const ve = (t) => {
64
64
  customConditionsEnabled: h,
65
65
  enableXSSSecurity: !0,
66
66
  modulesDisabled: H,
67
- syncModulesEnabled: e,
67
+ syncModulesEnabled: o,
68
68
  messageSettingsEnabled: !0,
69
69
  displayGmailAnnotations: !0,
70
70
  displayHiddenPreheader: !1,
@@ -74,12 +74,12 @@ const ve = (t) => {
74
74
  copyPasteEnabled: !1,
75
75
  selectElementAfterDrop: !0,
76
76
  sameFontSizeForOutlook: !0,
77
- allowedScriptSourceDomains: M,
77
+ allowedScriptSourceDomains: z,
78
78
  ...E ? { baseBlocks: E } : {},
79
79
  editorFonts: {
80
80
  showDefaultStandardFonts: !0,
81
81
  showDefaultNotStandardFonts: !0,
82
- customFonts: a
82
+ customFonts: s
83
83
  },
84
84
  mergeTags: [
85
85
  {
@@ -93,33 +93,37 @@ const ve = (t) => {
93
93
  async onTokenRefreshRequest(r) {
94
94
  try {
95
95
  t.mark("token_start");
96
- const l = await P();
97
- t.mark("token_end"), r(l);
98
- } catch (l) {
99
- f(l, "Failed to refresh token");
96
+ const d = await P();
97
+ if (t.mark("token_end"), !d) {
98
+ e.isStripoInitialized || (e.loadingStatus = !1, t.markFailed());
99
+ return;
100
+ }
101
+ r(d);
102
+ } catch (d) {
103
+ f(d, "Failed to refresh token");
100
104
  }
101
105
  },
102
106
  onTemplateLoaded() {
103
107
  try {
104
- const { activateCustomViewStyles: r, updateTimerInClonedTemplate: l } = j(), { injectFullStory: N } = X();
105
- v().importCss(), r(), N(), I(), l(), i.onReady(), o.isStripoInitialized = !0, o.loadingStatus = !1, setTimeout(() => {
106
- o.hasChanges = !1;
108
+ const { activateCustomViewStyles: r, updateTimerInClonedTemplate: d } = N(), { injectFullStory: M } = X();
109
+ v().importCss(), r(), M(), I(), d(), i.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
110
+ e.hasChanges = !1;
107
111
  }, 1e3), t.markReady();
108
112
  } catch (r) {
109
113
  f(r, "Failed to load custom interface appearance");
110
114
  }
111
115
  },
112
116
  onCodeEditorVisibilityChanged(r) {
113
- o.isCodeEditorOpen = r;
117
+ e.isCodeEditorOpen = r;
114
118
  },
115
119
  onEditorVisualModeChanged(r) {
116
- o.editorVisualMode = r.toLowerCase();
120
+ e.editorVisualMode = r.toLowerCase();
117
121
  },
118
122
  onVersionHistoryVisibilityChanged(r) {
119
- o.isVersionHistoryOpen = r;
123
+ e.isVersionHistoryOpen = r;
120
124
  },
121
125
  onDataChanged() {
122
- o.hasChanges = !0, o.changeSeq += 1;
126
+ e.hasChanges = !0, e.changeSeq += 1;
123
127
  },
124
128
  onEvent: U,
125
129
  onModuleAdd: V,
@@ -138,17 +142,17 @@ const ve = (t) => {
138
142
  }
139
143
  );
140
144
  };
141
- return { initPlugin: async (n, s, i, a = !1) => {
142
- const e = T();
145
+ return { initPlugin: async (n, a, i, s = !1) => {
146
+ const o = F();
143
147
  try {
144
- t.mark("plugin_start"), t.setScriptPreloaded(F), await g(), t.mark("script_ready");
145
- const [c, o] = await Promise.all([
148
+ t.mark("plugin_start"), t.setScriptPreloaded(T), await g(), t.mark("script_ready");
149
+ const [c, e] = await Promise.all([
146
150
  R(),
147
151
  D()
148
152
  ]);
149
- t.mark("fonts_sync_ready"), e.syncModulesEnabled = o, await x(n, s, i, c, o, a);
153
+ t.mark("fonts_sync_ready"), o.syncModulesEnabled = e, await x(n, a, i, c, e, s);
150
154
  } catch {
151
- e.loadingStatus = !1, A({
155
+ o.loadingStatus = !1, A({
152
156
  type: Z.Error,
153
157
  message: B["An error has occurred. Please report the error code to support."],
154
158
  actionButton: {
@@ -1,45 +1,26 @@
1
- import { useToaster as T } from "./useToaster.js";
2
- import { ToasterTypeOptions as i } from "../enums/toaster.js";
3
- import { useStripoNotificationModalStore as h } from "../stores/stripo-notification-modal.js";
4
- const g = {
5
- [i.Warning]: "warning",
6
- [i.Error]: "error"
7
- }, b = (u, c) => (c == null ? void 0 : c.closeable) !== !1 || c.autoClose !== !1 ? null : g[u] ?? null, A = () => {
8
- const { showToaster: u, hideToaster: c } = T(), r = h();
9
- let f = null;
10
- const l = (o, e, n, t, S = !0) => {
11
- const d = t != null && t.action ? { text: t.action.label, onClick: t.action.func } : void 0, s = b(o, t);
12
- if (s) {
13
- r.show({
14
- id: n,
15
- type: s,
16
- message: e,
17
- actionButton: d,
18
- closeOnAction: (t == null ? void 0 : t.closeOnAction) !== !1
19
- });
20
- return;
21
- }
22
- f = n, u({
23
- type: o,
24
- message: e,
25
- actionButton: d,
26
- autoHide: (t == null ? void 0 : t.autoClose) ?? S,
27
- closeable: (t == null ? void 0 : t.closeable) ?? !0
28
- });
1
+ import { useToaster as d } from "./useToaster.js";
2
+ import { ToasterTypeOptions as c } from "../enums/toaster.js";
3
+ const g = () => {
4
+ const { showToaster: s, hideToaster: u } = d();
5
+ let r = null;
6
+ const n = (o, t, i, e, f = !0) => {
7
+ r = i;
8
+ const l = e != null && e.action ? { text: e.action.label, onClick: e.action.func } : void 0;
9
+ s({ type: o, message: t, actionButton: l, autoHide: (e == null ? void 0 : e.autoClose) ?? f });
29
10
  };
30
11
  return { getStripoNotifications: () => ({
31
- info: (o, e, n) => l(i.Info, o, e, n),
32
- success: (o, e, n) => l(i.Success, o, e, n),
33
- warn: (o, e, n) => l(i.Warning, o, e, n),
34
- error: (o, e, n) => l(i.Error, o, e, n),
12
+ info: (o, t, i) => n(c.Info, o, t, i),
13
+ success: (o, t, i) => n(c.Success, o, t, i),
14
+ warn: (o, t, i) => n(c.Warning, o, t, i),
15
+ error: (o, t, i) => n(c.Error, o, t, i),
35
16
  // A loader marks an in-progress operation; Stripo dismisses it via hide(id)
36
17
  // when finished, so it must not auto-hide.
37
- loader: (o, e, n) => l(i.Info, o, e, n, !1),
18
+ loader: (o, t, i) => n(c.Info, o, t, i, !1),
38
19
  hide: (o) => {
39
- r.hide(o), f === o && (c(), f = null);
20
+ r === o && (u(), r = null);
40
21
  }
41
22
  }) };
42
23
  };
43
24
  export {
44
- A as useStripoNotifications
25
+ g as useStripoNotifications
45
26
  };
@@ -1,4 +1,4 @@
1
- const e = "Your version has been restored successfully.", o = "Restore Image", a = "Cancel", t = {
1
+ const e = "Your version has been restored successfully.", o = "Restore Image", t = "Cancel", a = {
2
2
  "Reload page": "Reload page",
3
3
  "The image has been deleted.": "The image has been deleted successfully.",
4
4
  "Aim for the drop zone!": "Drag and drop your image inside the upload area to continue.",
@@ -42,18 +42,16 @@ const e = "Your version has been restored successfully.", o = "Restore Image", a
42
42
  "Image recovery error": "The image couldn't be restored right now. You can wait for a while and try again.",
43
43
  "Image moved to trash": "The image has been deleted successfully.",
44
44
  Recover: o,
45
- Stop: a,
45
+ Stop: t,
46
46
  "Can`t delete the image": "The image couldn’t be deleted right now. You can wait for a while and try again.",
47
47
  "Can`t restore the image": "The image couldn’t be restored right now. You can wait for a while and try again.",
48
48
  "Image delete error": "The image couldn't be deleted right now. You can wait for a while and try again.",
49
49
  "The maximum number of users who can simultaneously work with the sheet has been exceeded. Maximum allowed number: {{max_users_per_model}}": "You can’t edit the design right now as the maximum number of users are currently editing it.",
50
- "The monthly limit of Timer basic block is reached. Please change the subscription pricing plan to activate new quotas": "You have reached your monthly limit of Timer Blocks. You can contact your Account Director for more information.",
51
- "Export unsaved changes": "Export Unsaved Changes",
52
- "Discard exported changes": "Discard Exported Changes"
50
+ "The monthly limit of Timer basic block is reached. Please change the subscription pricing plan to activate new quotas": "You have reached your monthly limit of Timer Blocks. You can contact your Account Director for more information."
53
51
  };
54
52
  export {
55
53
  o as Recover,
56
- a as Stop,
57
- t as default,
54
+ t as Stop,
55
+ a as default,
58
56
  e as history_revert_to_patch
59
57
  };
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- @charset "UTF-8";.auth-error-modal[data-v-b4d7ae51],.stripo-notification-modal[data-v-8e61bf92]{position:relative;z-index:145}#guido-toast-non-closeable .in-toasts-wrapper__close{display:none}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-9d988e4b] .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}.color-vision-select__dropdown[data-v-64cb50da]{z-index:20;width:387px}.accessibility-toolbar[data-v-391019bc]{gap:16px}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button svg{margin-right:0}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button .clearfix:after{content:none}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-actions-menu__dropdown[data-v-bdb3b37a]{z-index:20;width:222px}.editor-actions[data-v-9a028d08]{gap:16px}.editor-actions__divider[data-v-9a028d08]{width:1px;height:40px;background-color:#e1e1e1}.right-slot[data-v-77451c9a]{gap:16px}.header-wrapper[data-v-3c713746]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-304e53dd]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-304e53dd]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-304e53dd]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-eaf8e461]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-eaf8e461]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-eaf8e461]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-eaf8e461]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-eaf8e461]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .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-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{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-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.guido-tab-bar-onboarding[data-v-219b4f7c]{z-index:21}[data-v-fcba7e99] .vueperslides__bullets{pointer-events:none!important}[data-v-fcba7e99] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-1a34025a] .vueperslides__bullets{pointer-events:none!important}[data-v-1a34025a] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-8fc96a58] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.guido-display-condition-create__separator[data-v-929822bc]{height:1px;margin:0 0 24px;background-image:linear-gradient(to right,currentColor 1px,transparent 1px);background-size:5px 1px}.guido-display-condition-create__methods[data-v-929822bc]{gap:16px}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__footer{justify-content:flex-start}.guido-display-condition-select__delete-modal[data-v-0d740001]{position:relative;z-index:145}.guido-display-condition-select__delete-modal[data-v-0d740001] .in-modal-v2-wrapper__header-title{margin-bottom:0}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__content>div{display:flex;flex-direction:column;min-height:100%}.guido-display-condition-select__list[data-v-0d740001]{display:flex;flex-direction:column;gap:24px;margin:0;padding:0;list-style:none}.guido-display-condition-card__header[data-v-0d740001]{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px}.guido-display-condition-card__text[data-v-0d740001]{min-width:0}.guido-display-condition-card__name[data-v-0d740001],.guido-display-condition-card__description[data-v-0d740001]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.guido-display-condition-card__actions[data-v-0d740001]{display:flex;flex-shrink:0;align-items:center;gap:16px}.guido-display-condition-card__split[data-v-0d740001]{position:relative;display:flex;gap:1px}.guido-display-condition-card__menu[data-v-0d740001]{z-index:2;min-width:115px}.guido-display-condition-card__divider[data-v-0d740001]{width:1px;height:24px}.guido-display-condition-card__code[data-v-0d740001]{margin:1px 15px 15px;padding:8px;font-family:inherit;white-space:pre-wrap;word-break:break-word}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}.ambiguous-dynamic-content-modal__content[data-v-2643213c]{padding-bottom:150px}
1
+ @charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-9d988e4b] .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}.color-vision-select__dropdown[data-v-64cb50da]{z-index:20;width:387px}.accessibility-toolbar[data-v-391019bc]{gap:16px}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button svg{margin-right:0}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button .clearfix:after{content:none}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-actions-menu__dropdown[data-v-0e63ebe1]{z-index:20;width:222px}.editor-actions[data-v-9a028d08]{gap:16px}.editor-actions__divider[data-v-9a028d08]{width:1px;height:40px;background-color:#e1e1e1}.right-slot[data-v-77451c9a]{gap:16px}.header-wrapper[data-v-3c713746]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-0c5f11a1]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-0c5f11a1]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-0c5f11a1]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-eaf8e461]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-eaf8e461]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-eaf8e461]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-eaf8e461]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-eaf8e461]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .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-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{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-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.guido-tab-bar-onboarding[data-v-219b4f7c]{z-index:21}[data-v-fcba7e99] .vueperslides__bullets{pointer-events:none!important}[data-v-fcba7e99] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-1a34025a] .vueperslides__bullets{pointer-events:none!important}[data-v-1a34025a] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-8fc96a58] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.guido-display-condition-create__separator[data-v-929822bc]{height:1px;margin:0 0 24px;background-image:linear-gradient(to right,currentColor 1px,transparent 1px);background-size:5px 1px}.guido-display-condition-create__methods[data-v-929822bc]{gap:16px}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__footer{justify-content:flex-start}.guido-display-condition-select__delete-modal[data-v-0d740001]{position:relative;z-index:145}.guido-display-condition-select__delete-modal[data-v-0d740001] .in-modal-v2-wrapper__header-title{margin-bottom:0}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__content>div{display:flex;flex-direction:column;min-height:100%}.guido-display-condition-select__list[data-v-0d740001]{display:flex;flex-direction:column;gap:24px;margin:0;padding:0;list-style:none}.guido-display-condition-card__header[data-v-0d740001]{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px}.guido-display-condition-card__text[data-v-0d740001]{min-width:0}.guido-display-condition-card__name[data-v-0d740001],.guido-display-condition-card__description[data-v-0d740001]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.guido-display-condition-card__actions[data-v-0d740001]{display:flex;flex-shrink:0;align-items:center;gap:16px}.guido-display-condition-card__split[data-v-0d740001]{position:relative;display:flex;gap:1px}.guido-display-condition-card__menu[data-v-0d740001]{z-index:2;min-width:115px}.guido-display-condition-card__divider[data-v-0d740001]{width:1px;height:24px}.guido-display-condition-card__code[data-v-0d740001]{margin:1px 15px 15px;padding:8px;font-family:inherit;white-space:pre-wrap;word-break:break-word}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}.ambiguous-dynamic-content-modal__content[data-v-2643213c]{padding-bottom:150px}
@@ -1,9 +1,9 @@
1
- const o = "3.30.0-beta.69ba1a4", s = { stripo: { version: "2.87.0" } }, a = {
1
+ const o = "3.30.0-beta.6bec386", s = { stripo: { version: "2.87.0" } }, e = {
2
2
  version: o,
3
3
  guido: s
4
4
  };
5
5
  export {
6
- a as default,
6
+ e as default,
7
7
  s as guido,
8
8
  o as version
9
9
  };
@@ -2,19 +2,22 @@ import { useHttp as m } from "../composables/useHttp.js";
2
2
  import { useToaster as y } from "../composables/useToaster.js";
3
3
  import { MAX_DEFAULT_TEMPLATE_ID as f } from "../enums/defaults.js";
4
4
  import { useBlankTemplate as g } from "./blankTemplate.js";
5
- const l = () => ({
5
+ const p = () => ({
6
6
  id: 0,
7
7
  stripoId: 0,
8
8
  unsubscriptionPreferencePages: []
9
- }), D = () => {
10
- const { get: s, post: u } = m(), { handleError: r } = y(), { getBlankTemplate: n } = g();
9
+ }), E = () => {
10
+ const { get: s, post: i } = m(), { handleError: r } = y(), { getBlankTemplate: a } = g();
11
11
  return {
12
12
  getToken: async () => {
13
+ var t;
13
14
  try {
14
- const { data: t } = await s("/stripo/get-user-token");
15
- return t.body.token;
16
- } catch (t) {
17
- return r(t, "Failed to fetch token"), "";
15
+ const { data: e } = await s("/stripo/get-user-token"), n = (t = e == null ? void 0 : e.body) == null ? void 0 : t.token;
16
+ if (!n)
17
+ throw new Error("Response carries no token");
18
+ return n;
19
+ } catch (e) {
20
+ return r(e, "Failed to fetch token"), "";
18
21
  }
19
22
  },
20
23
  getCustomFonts: async () => {
@@ -30,13 +33,13 @@ const l = () => ({
30
33
  },
31
34
  getDefaultTemplate: async () => {
32
35
  try {
33
- const t = new URLSearchParams(window.location.search), e = t.get("default-template"), p = t.get("master"), o = e ? parseInt(e) : 0, i = o >= 1 && o <= f ? o : 0;
34
- if (!i && !p)
35
- return await n();
36
- const d = `/stripo/default-template/${i}`, { data: c } = await s(d), a = typeof c == "string" ? JSON.parse(c) : c;
37
- return !a || typeof a != "object" || !("html" in a) || !("css" in a) ? await n() : a;
36
+ const t = new URLSearchParams(window.location.search), e = t.get("default-template"), n = t.get("master"), c = e ? parseInt(e) : 0, l = c >= 1 && c <= f ? c : 0;
37
+ if (!l && !n)
38
+ return await a();
39
+ const d = `/stripo/default-template/${l}`, { data: u } = await s(d), o = typeof u == "string" ? JSON.parse(u) : u;
40
+ return !o || typeof o != "object" || !("html" in o) || !("css" in o) ? await a() : o;
38
41
  } catch (t) {
39
- return r(t, "Failed to fetch default template"), n();
42
+ return r(t, "Failed to fetch default template"), a();
40
43
  }
41
44
  },
42
45
  getSyncModulesStatus: async () => {
@@ -49,7 +52,7 @@ const l = () => ({
49
52
  },
50
53
  updateSyncModule: async (t) => {
51
54
  try {
52
- return await u(`/stripo/stripo-modules/${t.moduleId}/update`), !0;
55
+ return await i(`/stripo/stripo-modules/${t.moduleId}/update`), !0;
53
56
  } catch (e) {
54
57
  return r(e, "Failed to update sync module"), !1;
55
58
  }
@@ -57,16 +60,16 @@ const l = () => ({
57
60
  getSyncModule: async (t) => {
58
61
  try {
59
62
  const { data: e } = await s(`/stripo/stripo-modules/${t}/get`);
60
- return Array.isArray(e == null ? void 0 : e.unsubscriptionPreferencePages) ? e : l();
63
+ return Array.isArray(e == null ? void 0 : e.unsubscriptionPreferencePages) ? e : p();
61
64
  } catch (e) {
62
- return r(e, "Failed to get sync module"), l();
65
+ return r(e, "Failed to get sync module"), p();
63
66
  }
64
67
  },
65
68
  setSyncModuleUnsubscriptionPages: async (t) => {
66
69
  if (t.length === 0)
67
70
  return !0;
68
71
  try {
69
- return await u("/stripo/stripo-modules/set-unsubscription-preference-pages", t), !0;
72
+ return await i("/stripo/stripo-modules/set-unsubscription-preference-pages", t), !0;
70
73
  } catch (e) {
71
74
  return r(e, "Failed to set unsubscription preference pages"), !1;
72
75
  }
@@ -74,5 +77,5 @@ const l = () => ({
74
77
  };
75
78
  };
76
79
  export {
77
- D as useStripoApi
80
+ E as useStripoApi
78
81
  };
@@ -1,4 +1,8 @@
1
1
  import type { ColorVisionDeficiency } from '@@/Types/api/accessibility-api';
2
+ type EditorReadiness = {
3
+ loadingStatus: boolean;
4
+ isStripoInitialized: boolean;
5
+ };
2
6
  export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEditor", {
3
7
  loadingStatus: boolean;
4
8
  isCodeEditorOpen: boolean;
@@ -17,6 +21,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
17
21
  syncModulesEnabled: boolean;
18
22
  trackIdSessionFloor: number;
19
23
  }, {
24
+ isEditorUnavailable: (state: EditorReadiness) => boolean;
20
25
  isEditorToolbarVisible: (state: {
21
26
  loadingStatus: boolean;
22
27
  isCodeEditorOpen: boolean;
@@ -473,3 +478,4 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
473
478
  trackIdSessionFloor: number;
474
479
  }>) => boolean;
475
480
  }, {}>;
481
+ export {};
@@ -6,13 +6,12 @@ export declare const useToasterStore: import("pinia").StoreDefinition<"guidoToas
6
6
  text: string;
7
7
  withoutLeftMargin: boolean;
8
8
  autoHide: boolean;
9
- closeable: boolean;
10
9
  actionButton?: {
11
10
  text: string;
12
11
  onClick: () => void;
13
12
  } | undefined;
14
13
  } & import("pinia").PiniaCustomStateProperties<ToasterState>) => boolean;
15
14
  }, {
16
- showToaster(this: ToasterState, { type, message, actionButton, autoHide, closeable, }: ToasterOptions): void;
15
+ showToaster(this: ToasterState, { type, message, actionButton, autoHide }: ToasterOptions): void;
17
16
  hideToaster(this: ToasterState): void;
18
17
  }>;
@@ -1,5 +1,5 @@
1
- import { defineStore as e } from "pinia";
2
- const o = e("guidoEditor", {
1
+ import { defineStore as s } from "pinia";
2
+ const e = (i) => i.loadingStatus || !i.isStripoInitialized, n = s("guidoEditor", {
3
3
  state: () => ({
4
4
  loadingStatus: !0,
5
5
  isCodeEditorOpen: !1,
@@ -24,25 +24,26 @@ const o = e("guidoEditor", {
24
24
  trackIdSessionFloor: 0
25
25
  }),
26
26
  getters: {
27
+ isEditorUnavailable: e,
27
28
  // Middle Slot
28
29
  isEditorToolbarVisible: (i) => !i.isVersionHistoryOpen && !i.isPreviewModeOpen && !i.isAccessibilityTestingOpen,
29
- isUndoButtonDisabled: (i) => i.loadingStatus || i.isPreviewModeOpen,
30
- isRedoButtonDisabled: (i) => i.loadingStatus || i.isPreviewModeOpen,
31
- isCodeEditorButtonDisabled: (i) => i.loadingStatus || i.isPreviewModeOpen,
32
- isPreviewButtonDisabled: (i) => i.loadingStatus,
33
- isViewOptionsDisabled: (i) => i.loadingStatus || i.isPreviewModeOpen,
30
+ isUndoButtonDisabled: (i) => e(i) || i.isPreviewModeOpen,
31
+ isRedoButtonDisabled: (i) => e(i) || i.isPreviewModeOpen,
32
+ isCodeEditorButtonDisabled: (i) => e(i) || i.isPreviewModeOpen,
33
+ isPreviewButtonDisabled: (i) => e(i),
34
+ isViewOptionsDisabled: (i) => e(i) || i.isPreviewModeOpen,
34
35
  // Right Slot
35
36
  isNormalMode: (i) => !i.isVersionHistoryOpen && !i.isAccessibilityTestingOpen,
36
- isVersionHistoryButtonDisabled: (i) => i.loadingStatus || i.isPreviewModeOpen,
37
- isExportButtonDisabled: (i) => i.loadingStatus || i.isVersionHistoryOpen,
38
- isSaveAsButtonDisabled: (i) => i.loadingStatus || i.isVersionHistoryOpen,
39
- isTestButtonDisabled: (i) => i.loadingStatus || i.isVersionHistoryOpen,
40
- isSaveButtonDisabled: (i) => i.loadingStatus || i.isVersionHistoryOpen || i.isPreviewModeOpen || i.isAccessibilityTestingOpen,
37
+ isVersionHistoryButtonDisabled: (i) => e(i) || i.isPreviewModeOpen,
38
+ isExportButtonDisabled: (i) => e(i) || i.isVersionHistoryOpen,
39
+ isSaveAsButtonDisabled: (i) => e(i) || i.isVersionHistoryOpen,
40
+ isTestButtonDisabled: (i) => e(i) || i.isVersionHistoryOpen,
41
+ isSaveButtonDisabled: (i) => e(i) || i.isVersionHistoryOpen || i.isPreviewModeOpen || i.isAccessibilityTestingOpen,
41
42
  // Accessibility Test is absent on purpose: it only simulates, but its Apply / Auto-tune
42
43
  // edit the document, so pausing autosave there would lose those fixes.
43
- isInSaveableState: (i) => !i.loadingStatus && !i.isVersionHistoryOpen && !i.isPreviewModeOpen && !i.isCodeEditorOpen
44
+ isInSaveableState: (i) => !e(i) && !i.isVersionHistoryOpen && !i.isPreviewModeOpen && !i.isCodeEditorOpen
44
45
  }
45
46
  });
46
47
  export {
47
- o as useEditorStore
48
+ n as useEditorStore
48
49
  };
@@ -1,28 +1,21 @@
1
1
  import { ToasterTypeOptions as e } from "../enums/toaster.js";
2
- import { defineStore as u } from "pinia";
3
- const r = () => ({
2
+ import { defineStore as a } from "pinia";
3
+ const u = () => ({
4
4
  status: !1,
5
5
  type: e.Success,
6
6
  text: "",
7
7
  withoutLeftMargin: !1,
8
8
  autoHide: !0,
9
- closeable: !0,
10
9
  actionButton: void 0
11
- }), h = u("guidoToaster", {
12
- state: () => r(),
10
+ }), h = a("guidoToaster", {
11
+ state: () => u(),
13
12
  getters: {
14
13
  // A toast without auto-hide (e.g. Stripo `loader`) stays until hideToaster.
15
14
  shouldAutoHide: (t) => t.status && !!t.text && t.autoHide
16
15
  },
17
16
  actions: {
18
- showToaster({
19
- type: t = e.Success,
20
- message: s,
21
- actionButton: o,
22
- autoHide: a = !0,
23
- closeable: i = !0
24
- }) {
25
- this.status = !0, this.text = s, this.type = t, this.actionButton = o, this.autoHide = a, this.closeable = i;
17
+ showToaster({ type: t = e.Success, message: s, actionButton: o, autoHide: i = !0 }) {
18
+ this.status = !0, this.text = s, this.type = t, this.actionButton = o, this.autoHide = i;
26
19
  },
27
20
  hideToaster() {
28
21
  this.status = !1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.30.0-beta.69ba1a4",
3
+ "version": "3.30.0-beta.6bec386",
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,18 +0,0 @@
1
- import e from "./StripoNotificationModal.vue2.js";
2
- /* empty css */
3
- import s from "../../../_virtual/_plugin-vue2_normalizer.js";
4
- var n = function() {
5
- var o = this, r = o._self._c, t = o._self._setupProxy;
6
- return t.store.current ? r("div", { staticClass: "stripo-notification-modal" }, [r(t.WpModal, { attrs: { id: "guido__stripo-notification-modal", "close-button-status": !1, "close-on-outside-click": !1, "footer-button-options": t.footerButtonOptions, "footer-status": !!t.footerButtonOptions, state: t.isError ? "danger" : "warning", title: t.title }, on: { "primary-action": t.runAction } }, [r("p", [o._v(o._s(t.store.current.message))])])], 1) : o._e();
7
- }, i = [], a = /* @__PURE__ */ s(
8
- e,
9
- n,
10
- i,
11
- !1,
12
- null,
13
- "8e61bf92"
14
- );
15
- const p = a.exports;
16
- export {
17
- p as default
18
- };
@@ -1,30 +0,0 @@
1
- import { defineComponent as s, computed as n } from "vue";
2
- import u from "../../wrappers/WpModal.vue.js";
3
- import { useTranslations as l } from "../../../composables/useTranslations.js";
4
- import { useStripoNotificationModalStore as p } from "../../../stores/stripo-notification-modal.js";
5
- const S = /* @__PURE__ */ s({
6
- __name: "StripoNotificationModal",
7
- setup(m) {
8
- const r = l(), o = p(), i = n(() => {
9
- var t;
10
- return ((t = o.current) == null ? void 0 : t.type) === "error";
11
- }), e = n(() => i.value ? r("email-editor.notification-modal-error-title") : r("email-editor.notification-modal-warning-title")), c = n(() => {
12
- var t;
13
- return (t = o.current) != null && t.actionButton ? { primaryButton: { type: "primary", labelText: o.current.actionButton.text } } : void 0;
14
- });
15
- return { __sfc: !0, trans: r, store: o, isError: i, title: e, footerButtonOptions: c, runAction: () => {
16
- const t = o.current;
17
- if (t != null && t.actionButton) {
18
- try {
19
- t.actionButton.onClick();
20
- } catch (a) {
21
- console.error("Stripo notification action failed", a);
22
- }
23
- t.closeOnAction && o.hide(t.id);
24
- }
25
- }, WpModal: u };
26
- }
27
- });
28
- export {
29
- S as default
30
- };
@@ -1,2 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
- export default _default;
@@ -1,18 +0,0 @@
1
- import type { StripoNotifyId } from '@@/Types/stripo';
2
- import type { ActionButton } from '@@/Types/toaster';
3
- export type StripoNotificationModalType = 'warning' | 'error';
4
- export interface StripoNotificationModal {
5
- id: StripoNotifyId;
6
- type: StripoNotificationModalType;
7
- message: string;
8
- actionButton?: ActionButton;
9
- closeOnAction: boolean;
10
- }
11
- interface StripoNotificationModalState {
12
- current: StripoNotificationModal | null;
13
- }
14
- export declare const useStripoNotificationModalStore: import("pinia").StoreDefinition<"guidoStripoNotificationModal", StripoNotificationModalState, {}, {
15
- show(notification: StripoNotificationModal): void;
16
- hide(id: StripoNotifyId): void;
17
- }>;
18
- export {};
@@ -1,18 +0,0 @@
1
- import { defineStore as o } from "pinia";
2
- const e = o("guidoStripoNotificationModal", {
3
- state: () => ({
4
- current: null
5
- }),
6
- actions: {
7
- show(t) {
8
- this.current = t;
9
- },
10
- hide(t) {
11
- var i;
12
- ((i = this.current) == null ? void 0 : i.id) === t && (this.current = null);
13
- }
14
- }
15
- });
16
- export {
17
- e as useStripoNotificationModalStore
18
- };