@useinsider/guido 3.17.0-beta.ec8eabb → 3.17.0-beta.f7536b7

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.
@@ -12,7 +12,7 @@ var t = function() {
12
12
  n,
13
13
  !1,
14
14
  null,
15
- "915d61d5"
15
+ "1f2703e5"
16
16
  );
17
17
  const l = s.exports;
18
18
  export {
@@ -1,153 +1,156 @@
1
- import { defineComponent as J, defineAsyncComponent as B, ref as U, computed as _, watch as N, onMounted as Q, onUnmounted as X } from "vue";
2
- import { useCortexBlueprintBridge as Y } from "../composables/useCortexBlueprintBridge.js";
3
- import { useEditorLock as Z } from "../composables/useEditorLock.js";
4
- import { provideGuidoActions as ee } from "../composables/useGuidoActions.js";
5
- import { useGuidoStateBridge as oe } from "../composables/useGuidoStateBridge.js";
6
- import { usePartner as te } from "../composables/usePartner.js";
7
- import { useStripo as ne } from "../composables/useStripo.js";
8
- import { useTimerClone as re } from "../composables/useTimerClone.js";
9
- import { migrate as O } from "../config/migrator/index.js";
10
- import { ModuleFolderDefaults as P } from "../enums/defaults.js";
11
- import { RIBBON_SELECTOR as se } from "../enums/onboarding.js";
12
- import { useRecommendationExtensionStore as ie } from "../extensions/Blocks/Recommendation/store/recommendation.js";
13
- import ae from "./organisms/AutoSaveController.vue.js";
14
- import ce from "./organisms/base/Toaster.vue.js";
15
- import de from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
16
- import me from "./organisms/header/HeaderWrapper.vue.js";
17
- import le from "./organisms/LoadingWrapper.vue.js";
18
- import ue from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
19
- import pe from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
20
- import { useStripoApi as fe } from "../services/stripoApi.js";
21
- import { useConfigStore as ve } from "../stores/config.js";
22
- import { useDynamicContentStore as ye } from "../stores/dynamic-content.js";
23
- import { useEditorStore as x } from "../stores/editor.js";
24
- import { usePreviewStore as he } from "../stores/preview.js";
25
- import { useTemplateStore as Se } from "../stores/template.js";
26
- import { useUnsubscribeStore as ge } from "../stores/unsubscribe.js";
27
- import { readTrackFloor as A } from "../utils/linkTrackingIds.js";
28
- const Ve = /* @__PURE__ */ J({
1
+ import { defineComponent as Y, defineAsyncComponent as N, ref as O, computed as P, watch as x, onMounted as Z, onUnmounted as ee } from "vue";
2
+ import { useCortexBlueprintBridge as te } from "../composables/useCortexBlueprintBridge.js";
3
+ import { useEditorLock as oe } from "../composables/useEditorLock.js";
4
+ import { provideGuidoActions as ne } from "../composables/useGuidoActions.js";
5
+ import { useGuidoStateBridge as re } from "../composables/useGuidoStateBridge.js";
6
+ import { usePartner as se } from "../composables/usePartner.js";
7
+ import { useStripo as ie } from "../composables/useStripo.js";
8
+ import { useTimerClone as ae } from "../composables/useTimerClone.js";
9
+ import { migrate as A } from "../config/migrator/index.js";
10
+ import { ModuleFolderDefaults as W } from "../enums/defaults.js";
11
+ import { RIBBON_SELECTOR as ce } from "../enums/onboarding.js";
12
+ import { useRecommendationExtensionStore as de } from "../extensions/Blocks/Recommendation/store/recommendation.js";
13
+ import me from "./organisms/AutoSaveController.vue.js";
14
+ import le from "./organisms/base/Toaster.vue.js";
15
+ import ue from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
16
+ import pe from "./organisms/header/HeaderWrapper.vue.js";
17
+ import fe from "./organisms/LoadingWrapper.vue.js";
18
+ import ve from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
19
+ import ye from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
20
+ import { useStripoApi as ge } from "../services/stripoApi.js";
21
+ import { useConfigStore as he } from "../stores/config.js";
22
+ import { useDynamicContentStore as Se } from "../stores/dynamic-content.js";
23
+ import { useEditorStore as G } from "../stores/editor.js";
24
+ import { usePreviewStore as be } from "../stores/preview.js";
25
+ import { useTemplateStore as Ee } from "../stores/template.js";
26
+ import { useUnsubscribeStore as we } from "../stores/unsubscribe.js";
27
+ import { readTrackFloor as H } from "../utils/linkTrackingIds.js";
28
+ const Qe = /* @__PURE__ */ Y({
29
29
  __name: "Guido",
30
30
  props: {
31
31
  config: null,
32
32
  ready: { type: Boolean, default: !0 }
33
33
  },
34
34
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
35
- setup(W, { expose: G, emit: r }) {
36
- const i = W, H = B(
35
+ setup($, { expose: z, emit: r }) {
36
+ const i = $, q = N(
37
37
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
38
- ), $ = B(
38
+ ), K = N(
39
39
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
40
- ), h = U(), l = U(), u = ye(), S = ge(), t = ve();
41
- i.ready && t.init(i.config);
42
- const c = x(), z = he(), m = _(() => c.hasChanges), { isTestPartner: q } = te(), g = () => {
43
- var o;
44
- return (o = h.value) == null ? void 0 : o.handleSave(!0);
45
- }, b = (o) => {
46
- c.loadingStatus = o;
40
+ ), h = O(), l = O(), u = Se(), S = we(), o = he();
41
+ i.ready && o.init(i.config);
42
+ const c = G(), V = be(), m = P(() => c.hasChanges), { isTestPartner: j } = se(), b = () => {
43
+ var t;
44
+ return (t = h.value) == null ? void 0 : t.handleSave(!0);
45
+ }, E = (t) => {
46
+ c.loadingStatus = t;
47
47
  };
48
- Y(), oe();
48
+ te(), re();
49
49
  const p = () => {
50
- var o, e;
50
+ var t, e;
51
51
  return {
52
- emailId: t.templateId,
53
- userId: t.userId,
54
- username: t.username,
55
- partnerName: t.partnerName,
56
- savedModulesFolderName: ((o = t.editor) == null ? void 0 : o.savedModulesFolderName) || P.SAVED_MODULES,
57
- defaultModulesFolderName: ((e = t.editor) == null ? void 0 : e.defaultModulesFolderName) || P.DEFAULT_MODULES
52
+ emailId: o.templateId,
53
+ userId: o.userId,
54
+ username: o.username,
55
+ partnerName: o.partnerName,
56
+ savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || W.SAVED_MODULES,
57
+ defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || W.DEFAULT_MODULES
58
58
  };
59
- }, { initPlugin: E, preloadRuntime: w } = ne(), { runExclusive: k } = Z(), { getDefaultTemplate: C } = fe(), { cloneTimersOnSave: D, hasTimerBlocks: T } = re(), K = _(() => {
60
- var o;
61
- return !((o = t.ui) != null && o.showHeader);
59
+ }, { initPlugin: w, preloadRuntime: C } = ie(), { runExclusive: k, beginMount: D, isCurrentMount: T } = oe();
60
+ let f = 0;
61
+ const { getDefaultTemplate: F } = ge(), { cloneTimersOnSave: I, hasTimerBlocks: L } = ae(), J = P(() => {
62
+ var t;
63
+ return !((t = o.ui) != null && t.showHeader);
62
64
  });
63
- ee({
65
+ ne({
64
66
  onBack: () => {
65
67
  console.debug("guido:back"), r("back");
66
68
  },
67
69
  onSaveStart: () => {
68
70
  console.debug("guido:save:start"), r("save:start");
69
71
  },
70
- onSaveComplete: (o) => {
71
- const e = { ...o, metadata: p() };
72
+ onSaveComplete: (t) => {
73
+ const e = { ...t, metadata: p() };
72
74
  console.debug("guido:save:complete", e), r("save:complete", e);
73
75
  },
74
76
  onTestEmailClick: () => {
75
77
  console.debug("guido:test-email:click"), r("test-email:click");
76
78
  }
77
79
  });
78
- const F = (o) => {
79
- console.debug("dynamic-content:close", o), u.setSelectedDynamicContent(o), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: o }));
80
- }, I = () => {
80
+ const M = (t) => {
81
+ console.debug("dynamic-content:close", t), u.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
82
+ }, R = () => {
81
83
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
82
84
  };
83
- N(() => m.value, () => {
85
+ x(() => m.value, () => {
84
86
  r("on-change", m.value);
85
87
  });
86
- const f = (o) => {
87
- const e = o, { attribute: s, position: d } = e.detail;
88
+ const v = (t) => {
89
+ const e = t, { attribute: s, position: d } = e.detail;
88
90
  console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, d);
89
91
  };
90
92
  let a = null;
91
- const v = () => {
93
+ const y = () => {
92
94
  var e;
93
- const o = document.querySelector(se);
94
- (e = l.value) == null || e.style.setProperty("--ribbon-offset", `${(o == null ? void 0 : o.offsetHeight) ?? 0}px`);
95
- }, y = async () => {
96
- var o;
95
+ const t = document.querySelector(ce);
96
+ (e = l.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
97
+ }, g = async () => {
98
+ var t;
97
99
  try {
98
- t.initialized || t.init(i.config), c.templateId = t.templateId;
99
- const e = t.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", L = (e == null ? void 0 : e.preselectedDynamicContent) || [];
100
+ o.initialized || o.init(i.config), c.templateId = o.templateId;
101
+ const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", B = (e == null ? void 0 : e.preselectedDynamicContent) || [];
100
102
  S.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
101
- const M = ((o = e == null ? void 0 : e.migration) == null ? void 0 : o.recommendationConfigs) ?? {}, R = t.isFeatureEnabled("linkTrackingIds");
103
+ const U = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, _ = o.isFeatureEnabled("linkTrackingIds");
102
104
  let n = {
103
- html: s && await O(s, M),
105
+ html: s && await A(s, U),
104
106
  css: d
105
107
  };
106
- n.html || (n = await C(), n.html = await O(n.html, M));
107
- const V = R ? A(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
108
- T(n.html) && (n.html = await D(n.html)), R && (c.trackIdSessionFloor = Math.max(V, A(n.html)));
109
- const j = {
110
- preselectedDynamicContentList: L,
108
+ n.html || (n = await F(), n.html = await A(n.html, U));
109
+ const Q = _ ? H(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
110
+ L(n.html) && (n.html = await I(n.html)), _ && (c.trackIdSessionFloor = Math.max(Q, H(n.html)));
111
+ const X = {
112
+ preselectedDynamicContentList: B,
111
113
  onReady: () => {
112
114
  console.debug("guido:ready"), r("ready");
113
115
  }
114
116
  };
115
- await E(n, p(), j), u.selectedDynamicContentList = L;
117
+ f = D(), await w(n, p(), X), u.selectedDynamicContentList = B;
116
118
  } catch (e) {
117
119
  console.error("Failed to initialize Stripo editor:", e);
118
120
  }
119
121
  };
120
- return Q(async () => {
122
+ return Z(async () => {
121
123
  var e;
122
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), ie().$reset(), x().$reset(), Se().$reset(), v();
123
- const o = (e = l.value) == null ? void 0 : e.parentElement;
124
- if (o && (a = new ResizeObserver(v), a.observe(o)), w(), i.ready)
125
- await y();
124
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), de().$reset(), G().$reset(), Ee().$reset(), y();
125
+ const t = (e = l.value) == null ? void 0 : e.parentElement;
126
+ if (t && (a = new ResizeObserver(y), a.observe(t)), C(), i.ready)
127
+ await g();
126
128
  else {
127
- const s = N(() => i.ready, (d) => {
128
- d && (s(), y());
129
+ const s = x(() => i.ready, (d) => {
130
+ d && (s(), g());
129
131
  });
130
132
  }
131
- document.addEventListener("dynamic-content:open", f);
132
- }), X(() => {
133
- a == null || a.disconnect(), document.removeEventListener("dynamic-content:open", f), k(async () => {
134
- try {
135
- window.UIEditor.removeEditor();
136
- } catch {
137
- console.debug("Failed to remove Stripo editor: No editor found");
138
- }
139
- }), t.reset();
140
- }), G({
133
+ document.addEventListener("dynamic-content:open", v);
134
+ }), ee(() => {
135
+ a == null || a.disconnect(), document.removeEventListener("dynamic-content:open", v), k(async () => {
136
+ if (T(f))
137
+ try {
138
+ window.UIEditor.removeEditor();
139
+ } catch {
140
+ console.debug("Failed to remove Stripo editor: No editor found");
141
+ }
142
+ }), o.reset();
143
+ }), z({
141
144
  dynamicContent: {
142
- insert: F,
143
- close: I
145
+ insert: M,
146
+ close: R
144
147
  },
145
148
  hasChanges: m,
146
- saveSilent: g,
147
- setLoading: b
148
- }), { __sfc: !0, PreviewContainer: H, OnboardingWrapper: $, headerWrapperRef: h, wrapperRef: l, dynamicContentStore: u, unsubscribeStore: S, props: i, configStore: t, editorStore: c, previewStore: z, hasChanges: m, isTestPartner: q, saveSilent: g, setLoading: b, emit: r, buildMetadata: p, initPlugin: E, preloadRuntime: w, runExclusive: k, getDefaultTemplate: C, cloneTimersOnSave: D, hasTimerBlocks: T, noHeader: K, insertDynamicContent: F, closeDynamicContent: I, handleDynamicContentOpen: f, ribbonObserver: a, updateRibbonOffset: v, startEditor: y, AutoSaveController: ae, Toaster: ce, FilterSelectionDrawer: de, HeaderWrapper: me, LoadingWrapper: le, SaveAsTemplateDrawer: ue, UnsubscribeWrapper: pe };
149
+ saveSilent: b,
150
+ setLoading: E
151
+ }), { __sfc: !0, PreviewContainer: q, OnboardingWrapper: K, headerWrapperRef: h, wrapperRef: l, dynamicContentStore: u, unsubscribeStore: S, props: i, configStore: o, editorStore: c, previewStore: V, hasChanges: m, isTestPartner: j, saveSilent: b, setLoading: E, emit: r, buildMetadata: p, initPlugin: w, preloadRuntime: C, runExclusive: k, beginMount: D, isCurrentMount: T, mountGeneration: f, getDefaultTemplate: F, cloneTimersOnSave: I, hasTimerBlocks: L, noHeader: J, insertDynamicContent: M, closeDynamicContent: R, handleDynamicContentOpen: v, ribbonObserver: a, updateRibbonOffset: y, startEditor: g, AutoSaveController: me, Toaster: le, FilterSelectionDrawer: ue, HeaderWrapper: pe, LoadingWrapper: fe, SaveAsTemplateDrawer: ve, UnsubscribeWrapper: ye };
149
152
  }
150
153
  });
151
154
  export {
152
- Ve as default
155
+ Qe as default
153
156
  };
@@ -9,15 +9,15 @@ var u = function() {
9
9
  } } }), e(t.MigrationConfirmModal, { ref: "migrationModalRef", on: { confirm: function(r) {
10
10
  return t.executeSave(!1);
11
11
  } } })], 1);
12
- }, p = [], c = /* @__PURE__ */ d(
12
+ }, c = [], p = /* @__PURE__ */ d(
13
13
  l,
14
14
  u,
15
- p,
15
+ c,
16
16
  !1,
17
17
  null,
18
- "fa75f9c3"
18
+ "c61cc8ea"
19
19
  );
20
- const v = c.exports;
20
+ const v = p.exports;
21
21
  export {
22
22
  v as default
23
23
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as F, ref as a, computed as x } from "vue";
1
+ import { defineComponent as q, ref as n, computed as x } from "vue";
2
2
  import { useActionsApi as b } from "../../../composables/useActionsApi.js";
3
3
  import { useConfig as k } from "../../../composables/useConfig.js";
4
4
  import { useExport as B } from "../../../composables/useExport.js";
@@ -15,33 +15,33 @@ import { getTooltipOptions as K } from "../../../utils/tooltipUtils.js";
15
15
  import { InButtonV2 as N } from "@useinsider/design-system-vue";
16
16
  import { storeToRefs as Q } from "pinia";
17
17
  import U from "./MigrationConfirmModal.vue.js";
18
- const ft = /* @__PURE__ */ F({
18
+ const ft = /* @__PURE__ */ q({
19
19
  __name: "EditorActions",
20
20
  setup(W, { expose: w }) {
21
- const { config: n, isFeatureEnabled: l } = k(), { exportHtml: m } = B(), { save: u } = R(), { openVersionHistory: c, closeVersionHistory: p } = P(), { getCompiledEmail: f } = b(), { compileHtml: d } = L(), { validateLiquidSyntax: v } = j(), { handleError: y } = z(), e = G(), g = J(), { hasMigrations: S } = Q(g), r = I(), s = a(!1), i = a(!1), H = a(), V = D(), _ = () => {
21
+ const { config: l, isFeatureEnabled: m } = k(), { exportHtml: c } = B(), { save: p } = R(), { openVersionHistory: u, closeVersionHistory: f } = P(), { getCompiledEmail: d } = b(), { compileHtml: v } = L(), { validateLiquidSyntax: y } = j(), { handleError: r } = z(), e = G(), g = J(), { hasMigrations: S } = Q(g), s = I(), i = n(!1), a = n(!1), H = n(), h = D(), _ = () => {
22
22
  if (e.isVersionHistoryOpen) {
23
- p();
23
+ f();
24
24
  return;
25
25
  }
26
- c();
26
+ u();
27
27
  }, C = async () => {
28
- s.value = !0, await m(), s.value = !1;
28
+ i.value = !0, await c(), i.value = !1;
29
29
  }, A = () => {
30
30
  e.isSaveAsTemplateDrawerOpen = !0;
31
- }, M = x(() => e.isVersionHistoryOpen ? r("newsletter.close-version-history") : r("newsletter.version-history")), O = x(
31
+ }, M = x(() => e.isVersionHistoryOpen ? s("newsletter.close-version-history") : s("newsletter.version-history")), O = x(
32
32
  () => {
33
33
  var t, o;
34
- return ((o = (t = n.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
34
+ return ((o = (t = l.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
35
35
  }
36
- ), h = async (t) => {
37
- i.value = !0, t || (e.loadingStatus = !0);
36
+ ), V = async (t) => {
37
+ a.value = !0, t || (e.loadingStatus = !0);
38
38
  let o;
39
39
  try {
40
- o = await u(t);
40
+ o = await p(t);
41
41
  } catch (T) {
42
- y(T, "Failed to save template");
42
+ r(T, "Failed to save template");
43
43
  } finally {
44
- i.value = !1, !t && !o && (e.loadingStatus = !1);
44
+ a.value = !1, !t && !o && (e.loadingStatus = !1);
45
45
  }
46
46
  return o;
47
47
  }, E = (t) => {
@@ -50,23 +50,26 @@ const ft = /* @__PURE__ */ F({
50
50
  (o = H.value) == null || o.open();
51
51
  return;
52
52
  }
53
- return h(t);
54
- }, q = async () => {
55
- if (l("liquidSyntax")) {
53
+ return V(t);
54
+ }, F = async () => {
55
+ if (m("liquidSyntax")) {
56
56
  e.loadingStatus = !0;
57
57
  try {
58
- const { html: t } = await f({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = d(t);
59
- if (!await v(o))
58
+ const { html: t } = await d({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = v(t);
59
+ if (!await y(o))
60
60
  return;
61
+ } catch (t) {
62
+ r(t, "Failed to prepare test email");
63
+ return;
61
64
  } finally {
62
65
  e.loadingStatus = !1;
63
66
  }
64
67
  }
65
- V();
68
+ h();
66
69
  };
67
70
  return w({
68
71
  handleSave: E
69
- }), { __sfc: !0, config: n, isFeatureEnabled: l, exportHtml: m, save: u, openVersionHistory: c, closeVersionHistory: p, getCompiledEmail: f, compileHtml: d, validateLiquidSyntax: v, handleError: y, editorStore: e, templateStore: g, hasMigrations: S, trans: r, isExporting: s, isSaving: i, migrationModalRef: H, testEmailClick: V, handleVersionHistory: _, handleExport: C, handleSaveAs: A, versionHistoryTooltipText: M, isVersionHistoryButtonVisible: O, executeSave: h, handleSave: E, handleTestEmail: q, getTooltipOptions: K, InButtonV2: N, MigrationConfirmModal: U };
72
+ }), { __sfc: !0, config: l, isFeatureEnabled: m, exportHtml: c, save: p, openVersionHistory: u, closeVersionHistory: f, getCompiledEmail: d, compileHtml: v, validateLiquidSyntax: y, handleError: r, editorStore: e, templateStore: g, hasMigrations: S, trans: s, isExporting: i, isSaving: a, migrationModalRef: H, testEmailClick: h, handleVersionHistory: _, handleExport: C, handleSaveAs: A, versionHistoryTooltipText: M, isVersionHistoryButtonVisible: O, executeSave: V, handleSave: E, handleTestEmail: F, getTooltipOptions: K, InButtonV2: N, MigrationConfirmModal: U };
70
73
  }
71
74
  });
72
75
  export {
@@ -1,18 +1,20 @@
1
- let n = Promise.resolve(), t = 0;
2
- const c = () => t > 0, s = (r) => {
3
- const e = n.then(async () => {
4
- t += 1;
1
+ let o = Promise.resolve(), n = 0, e = 0;
2
+ const s = () => n > 0, c = () => (e += 1, e), u = (t) => t > 0 && t === e, i = (t) => {
3
+ const r = o.then(async () => {
4
+ n += 1;
5
5
  try {
6
- return await r();
6
+ return await t();
7
7
  } finally {
8
- t -= 1;
8
+ n -= 1;
9
9
  }
10
10
  });
11
- return n = e.catch(() => {
12
- }), e;
13
- }, o = () => ({ runExclusive: s, isEditorBusy: c });
11
+ return o = r.catch(() => {
12
+ }), r;
13
+ }, a = () => ({ runExclusive: i, isEditorBusy: s, beginMount: c, isCurrentMount: u });
14
14
  export {
15
- c as isEditorBusy,
16
- s as runExclusive,
17
- o as useEditorLock
15
+ c as beginMount,
16
+ u as isCurrentMount,
17
+ s as isEditorBusy,
18
+ i as runExclusive,
19
+ a as useEditorLock
18
20
  };
@@ -1,49 +1,54 @@
1
- import { useActionsApi as I } from "./useActionsApi.js";
2
- import { useEditorLock as b } from "./useEditorLock.js";
1
+ import { useActionsApi as b } from "./useActionsApi.js";
2
+ import { useEditorLock as v } from "./useEditorLock.js";
3
3
  import { useConfigStore as T } from "../stores/config.js";
4
- import { useEditorStore as v } from "../stores/editor.js";
5
- import { useGuidoEmailEditorStore as w } from "../stores/guido-email-editor.js";
6
- import { watch as c, onUnmounted as y } from "vue";
7
- const B = 500, G = () => {
8
- const i = v(), a = w(), u = T(), { getTemplateData: l } = I(), { runExclusive: m, isEditorBusy: d } = b();
9
- let o = null, r = !1;
10
- const s = () => {
4
+ import { useEditorStore as w } from "../stores/editor.js";
5
+ import { useGuidoEmailEditorStore as y } from "../stores/guido-email-editor.js";
6
+ import { watch as a, onUnmounted as B } from "vue";
7
+ const C = 500, L = () => {
8
+ const i = w(), u = y(), l = T(), { getTemplateData: d } = b(), { runExclusive: m, isEditorBusy: p } = v();
9
+ let o = null, s = !1;
10
+ const n = () => {
11
11
  o && (clearTimeout(o), o = null);
12
- }, n = async () => {
13
- var t, e;
14
- if (!(r || !i.isStripoInitialized || d()))
12
+ }, c = (t) => {
13
+ n(), o = setTimeout(() => {
14
+ o = null, t();
15
+ }, C);
16
+ }, e = async () => {
17
+ var t, r;
18
+ if (!(s || !i.isStripoInitialized)) {
19
+ if (p()) {
20
+ c(() => void e());
21
+ return;
22
+ }
15
23
  try {
16
- const { html: S, css: E } = await m(l), g = ((e = (t = u.config) == null ? void 0 : t.identity) == null ? void 0 : e.templateId) ?? "";
17
- if (r)
24
+ const { html: E, css: g } = await m(d), I = ((r = (t = l.config) == null ? void 0 : t.identity) == null ? void 0 : r.templateId) ?? "";
25
+ if (s)
18
26
  return;
19
- a.$patch({
20
- html: S ?? "",
21
- css: E ?? "",
22
- templateId: g,
27
+ u.$patch({
28
+ html: E ?? "",
29
+ css: g ?? "",
30
+ templateId: I,
23
31
  lastUpdatedAt: Date.now()
24
32
  });
25
33
  } catch {
26
34
  }
27
- }, p = () => {
28
- s(), o = setTimeout(() => {
29
- o = null, n();
30
- }, B);
31
- }, f = c(
35
+ }
36
+ }, f = () => c(() => void e()), h = a(
32
37
  () => i.isStripoInitialized,
33
38
  (t) => {
34
- t && n();
39
+ t && e();
35
40
  },
36
41
  { immediate: !0 }
37
- ), h = c(
42
+ ), S = a(
38
43
  () => i.hasChanges,
39
- (t, e) => {
40
- i.isStripoInitialized && (t ? p() : e && (s(), n()));
44
+ (t, r) => {
45
+ i.isStripoInitialized && (t ? f() : r && (n(), e()));
41
46
  }
42
47
  );
43
- y(() => {
44
- r = !0, s(), f(), h();
48
+ B(() => {
49
+ s = !0, n(), h(), S();
45
50
  });
46
51
  };
47
52
  export {
48
- G as useGuidoStateBridge
53
+ L as useGuidoStateBridge
49
54
  };
@@ -46,7 +46,6 @@ const et = () => {
46
46
  return await S(g), t.modules = k, a || c({ ...t, silent: e }), t;
47
47
  };
48
48
  return { save: (a = !1, e = !1) => y(
49
- // Serialized so no other editor read/export runs while Stripo is exporting for this save.
50
49
  () => E(a, e)
51
50
  ) };
52
51
  };
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-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}.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-fa75f9c3]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-915d61d5]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-915d61d5]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-915d61d5]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{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}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[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}
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-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}.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-c61cc8ea]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-1f2703e5]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-1f2703e5]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-1f2703e5]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{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}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[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}
@@ -1,11 +1,10 @@
1
1
  export declare const isEditorBusy: () => boolean;
2
- /**
3
- * Runs `task` once every previously queued task has settled — no two editor
4
- * read/export/save operations ever overlap. A rejected task propagates to its
5
- * caller but never wedges the queue.
6
- */
2
+ export declare const beginMount: () => number;
3
+ export declare const isCurrentMount: (generation: number) => boolean;
7
4
  export declare const runExclusive: <T>(task: () => Promise<T>) => Promise<T>;
8
5
  export declare const useEditorLock: () => {
9
6
  runExclusive: <T>(task: () => Promise<T>) => Promise<T>;
10
7
  isEditorBusy: () => boolean;
8
+ beginMount: () => number;
9
+ isCurrentMount: (generation: number) => boolean;
11
10
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.17.0-beta.ec8eabb",
3
+ "version": "3.17.0-beta.f7536b7",
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",