@useinsider/guido 3.21.2-beta.b6f3ef8 → 3.21.2-beta.eea8885

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.
package/README.md CHANGED
@@ -582,9 +582,9 @@ import '@useinsider/guido/style';
582
582
 
583
583
  ### Subpath entries
584
584
 
585
- Three surfaces also ship as their own entry points. Importing one pulls in only its
586
- own dependencies, so a consumer that needs the store, the tracking-id helpers or the
587
- runtime prefetch never loads the editor:
585
+ Two surfaces also ship as their own entry points. Importing one pulls in only its
586
+ own dependencies, so a consumer that needs the store or the tracking-id helpers
587
+ never loads the editor:
588
588
 
589
589
  ```typescript
590
590
  // Live editor state, published by the editor into the host's shared Pinia instance.
@@ -595,41 +595,11 @@ import type { GuidoEmailEditorState } from '@useinsider/guido/editor-state';
595
595
  // Persistent link ids for the click heatmap.
596
596
  import { assignTrackingIds, TRACK_ID_ATTRIBUTE } from '@useinsider/guido/tracking-ids';
597
597
  import type { TrackingIdResult } from '@useinsider/guido/tracking-ids';
598
-
599
- // Start downloading the Stripo editor runtime before the editor opens.
600
- import { prefetchGuidoRuntime } from '@useinsider/guido/prefetch';
601
598
  ```
602
599
 
603
- All three are re-exported from the root barrel as well; the subpath is what keeps the
600
+ Both are re-exported from the root barrel as well; the subpath is what keeps the
604
601
  editor out of the consumer's module graph.
605
602
 
606
- ### Runtime prefetch
607
-
608
- ```typescript
609
- import { prefetchGuidoRuntime } from '@useinsider/guido/prefetch';
610
-
611
- prefetchGuidoRuntime(); // e.g. when the user lands on the page that opens the editor
612
- ```
613
-
614
- Call it as early as the host knows an editor is likely to open. It appends one
615
- `<link rel="prefetch" data-guido-prefetch>` per file of the pinned Stripo runtime
616
- (`src/static/stripo-runtime-manifest.json`) from
617
- `https://email-static.useinsider.com/guido/<stripo version>/`, so the files are in the
618
- HTTP cache when `<Guido>` mounts. It only downloads: no Stripo code runs and the
619
- editor's startup order does not change.
620
-
621
- - Returns `void` and never throws.
622
- - Idempotent: later calls add nothing.
623
- - Adds nothing when the runtime is already loading or loaded (`#UiEditorScript` exists
624
- or `window.UIEditor` is defined), when `navigator.connection.saveData` is on, or when
625
- `navigator.connection.effectiveType` is `slow-2g` or `2g`.
626
- - The `guido_editor_open` metric reports it as `runtime_prefetch`: `none` (not called
627
- before Guido's setup), `pending` (some files still downloading) or `done`.
628
-
629
- After bumping `guido.stripo.version`, regenerate the file list with
630
- `npm run stripo:manifest`; a unit test fails while the manifest's version differs from
631
- the pinned one.
632
-
633
603
  ---
634
604
 
635
605
  ## Constants
@@ -6,15 +6,15 @@ var t = function() {
6
6
  return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), 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(), r(e.SaveAsTemplateDrawer), e.isSaveValidationEnabled ? r(e.ValidationErrorDrawer) : a._e(), e.isTestPartner() ? a._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(_) {
7
7
  return e.emit("onboarding:finished");
8
8
  } } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
9
- }, s = [], d = /* @__PURE__ */ i(
9
+ }, s = [], n = /* @__PURE__ */ i(
10
10
  o,
11
11
  t,
12
12
  s,
13
13
  !1,
14
14
  null,
15
- "1a3ddd48"
15
+ "c5146fc5"
16
16
  );
17
- const v = d.exports;
17
+ const v = n.exports;
18
18
  export {
19
19
  v as default
20
20
  };
@@ -1,189 +1,179 @@
1
- import { defineComponent as de, defineAsyncComponent as l, ref as W, computed as f, watch as G, onMounted as me, onUnmounted as le } from "vue";
2
- import { useCortexBlueprintBridge as ue } from "../composables/useCortexBlueprintBridge.js";
3
- import { useEditorLock as pe } from "../composables/useEditorLock.js";
4
- import { startEditorOpenMetrics as fe } from "../composables/useEditorOpenMetrics.js";
5
- import { provideGuidoActions as ye } from "../composables/useGuidoActions.js";
6
- import { useGuidoStateBridge as ge } from "../composables/useGuidoStateBridge.js";
7
- import { usePartner as ve } from "../composables/usePartner.js";
8
- import { useSaveValidationRollout as Se } from "../composables/useSaveValidationRollout.js";
9
- import { useStripo as be } from "../composables/useStripo.js";
10
- import { useTimerClone as he } from "../composables/useTimerClone.js";
11
- import { migrate as Ee } from "../config/migrator/index.js";
12
- import { ModuleFolderDefaults as H } from "../enums/defaults.js";
13
- import { RIBBON_SELECTOR as we } from "../enums/onboarding.js";
14
- import { useRecommendationExtensionStore as V, disposeStrategyPageReturnListeners as ke } from "../extensions/Blocks/Recommendation/store/recommendation.js";
15
- import { disposeUnsubscribeListeners as Ce } from "../extensions/Blocks/Unsubscribe/block.js";
16
- import De from "./organisms/AutoSaveController.vue.js";
17
- import Ie from "./organisms/base/AuthErrorModal.vue.js";
18
- import Fe from "./organisms/base/Toaster.vue.js";
19
- import Me from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
20
- import Re from "./organisms/header/HeaderWrapper.vue.js";
21
- import Te from "./organisms/LoadingWrapper.vue.js";
22
- import Le from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
23
- import Ue from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
24
- import Ne from "./organisms/validation/ValidationErrorDrawer.vue.js";
25
- import { useStripoApi as _e } from "../services/stripoApi.js";
26
- import { useConfigStore as Ae } from "../stores/config.js";
27
- import { useDynamicContentStore as Be } from "../stores/dynamic-content.js";
28
- import { useEditorStore as w } from "../stores/editor.js";
29
- import { usePreviewStore as Oe } from "../stores/preview.js";
30
- import { useSaveValidationStore as Pe } from "../stores/save-validation.js";
31
- import { useTemplateStore as xe } from "../stores/template.js";
32
- import { useUnsubscribeStore as We } from "../stores/unsubscribe.js";
33
- import { readTrackFloor as $ } from "../utils/linkTrackingIds.js";
34
- const ht = /* @__PURE__ */ de({
1
+ import { defineComponent as ie, defineAsyncComponent as m, ref as W, computed as p, watch as G, onMounted as ce, onUnmounted as de } from "vue";
2
+ import { useCortexBlueprintBridge as me } from "../composables/useCortexBlueprintBridge.js";
3
+ import { useEditorLock as le } from "../composables/useEditorLock.js";
4
+ import { provideGuidoActions as ue } from "../composables/useGuidoActions.js";
5
+ import { useGuidoStateBridge as pe } from "../composables/useGuidoStateBridge.js";
6
+ import { usePartner as fe } from "../composables/usePartner.js";
7
+ import { useSaveValidationRollout as ye } from "../composables/useSaveValidationRollout.js";
8
+ import { useStripo as ge } from "../composables/useStripo.js";
9
+ import { useTimerClone as Se } from "../composables/useTimerClone.js";
10
+ import { migrate as V } from "../config/migrator/index.js";
11
+ import { ModuleFolderDefaults as $ } from "../enums/defaults.js";
12
+ import { RIBBON_SELECTOR as ve } from "../enums/onboarding.js";
13
+ import { useRecommendationExtensionStore as z, disposeStrategyPageReturnListeners as be } from "../extensions/Blocks/Recommendation/store/recommendation.js";
14
+ import { disposeUnsubscribeListeners as he } from "../extensions/Blocks/Unsubscribe/block.js";
15
+ import Ee from "./organisms/AutoSaveController.vue.js";
16
+ import we from "./organisms/base/AuthErrorModal.vue.js";
17
+ import De from "./organisms/base/Toaster.vue.js";
18
+ import Ce from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
19
+ import ke from "./organisms/header/HeaderWrapper.vue.js";
20
+ import Re from "./organisms/LoadingWrapper.vue.js";
21
+ import Fe from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
22
+ import Le from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
23
+ import Me from "./organisms/validation/ValidationErrorDrawer.vue.js";
24
+ import { useStripoApi as Te } from "../services/stripoApi.js";
25
+ import { useConfigStore as Ie } from "../stores/config.js";
26
+ import { useDynamicContentStore as Ue } from "../stores/dynamic-content.js";
27
+ import { useEditorStore as E } from "../stores/editor.js";
28
+ import { usePreviewStore as Ae } from "../stores/preview.js";
29
+ import { useSaveValidationStore as Be } from "../stores/save-validation.js";
30
+ import { useTemplateStore as Ne } from "../stores/template.js";
31
+ import { useUnsubscribeStore as Pe } from "../stores/unsubscribe.js";
32
+ import { readTrackFloor as H } from "../utils/linkTrackingIds.js";
33
+ const yt = /* @__PURE__ */ ie({
35
34
  __name: "Guido",
36
35
  props: {
37
36
  config: null,
38
37
  ready: { type: Boolean, default: !0 }
39
38
  },
40
39
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
41
- setup(z, { expose: q, emit: n }) {
42
- const s = z, a = fe(), K = l(
40
+ setup(q, { expose: K, emit: r }) {
41
+ const s = q, j = m(
43
42
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
44
- ), j = l(
43
+ ), J = m(
45
44
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
46
- ), J = l(
45
+ ), Q = m(
47
46
  () => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
48
- ), Q = l(
47
+ ), X = m(
49
48
  () => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
50
- ), X = l(
49
+ ), Y = m(
51
50
  () => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
52
- ), k = W(), y = W(), g = Be(), C = We(), o = Ae();
51
+ ), w = W(), f = W(), y = Ue(), D = Pe(), o = Ie();
53
52
  s.ready && o.init(s.config);
54
- const d = w(), Y = Oe(), u = f(() => d.hasChanges), { isTestPartner: Z } = ve(), { isEnabled: ee, loadRollout: D } = Se(), I = () => {
53
+ const c = E(), Z = Ae(), l = p(() => c.hasChanges), { isTestPartner: ee } = fe(), { isEnabled: te, loadRollout: C } = ye(), k = () => {
55
54
  var t;
56
- return (t = k.value) == null ? void 0 : t.handleSave(!0);
57
- }, F = (t) => {
58
- d.loadingStatus = t;
55
+ return (t = w.value) == null ? void 0 : t.handleSave(!0);
56
+ }, R = (t) => {
57
+ c.loadingStatus = t;
59
58
  };
60
- ue(), ge();
61
- const v = () => {
59
+ me(), pe();
60
+ const g = () => {
62
61
  var t, e;
63
62
  return {
64
63
  emailId: o.templateId,
65
64
  userId: o.userId,
66
65
  username: o.username,
67
66
  partnerName: o.partnerName,
68
- savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || H.SAVED_MODULES,
69
- defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || H.DEFAULT_MODULES
67
+ savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || $.SAVED_MODULES,
68
+ defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || $.DEFAULT_MODULES
70
69
  };
71
- }, { initPlugin: M, preloadRuntime: R } = be(), { runExclusive: T, beginMount: L, isCurrentMount: S } = pe();
72
- let p = 0;
73
- const { getDefaultTemplate: U } = _e(), { cloneTimersOnSave: N, hasTimerBlocks: _ } = he(), te = f(() => {
70
+ }, { initPlugin: F, preloadRuntime: L } = ge(), { runExclusive: M, beginMount: T, isCurrentMount: S } = le();
71
+ let u = 0;
72
+ const { getDefaultTemplate: I } = Te(), { cloneTimersOnSave: U, hasTimerBlocks: A } = Se(), oe = p(() => {
74
73
  var t;
75
74
  return !((t = o.ui) != null && t.showHeader);
76
- }), oe = f(() => o.isFeatureEnabled("reusableRecommendationStrategy")), re = f(
77
- () => !!V().recommendationConfigs.strategyId
75
+ }), ne = p(() => o.isFeatureEnabled("reusableRecommendationStrategy")), re = p(
76
+ () => !!z().recommendationConfigs.strategyId
78
77
  );
79
- ye({
78
+ ue({
80
79
  onBack: () => {
81
- console.debug("guido:back"), n("back");
80
+ console.debug("guido:back"), r("back");
82
81
  },
83
82
  onSaveStart: () => {
84
- console.debug("guido:save:start"), n("save:start");
83
+ console.debug("guido:save:start"), r("save:start");
85
84
  },
86
85
  onSaveComplete: (t) => {
87
- const e = { ...t, metadata: v() };
88
- console.debug("guido:save:complete", e), n("save:complete", e);
86
+ const e = { ...t, metadata: g() };
87
+ console.debug("guido:save:complete", e), r("save:complete", e);
89
88
  },
90
89
  onTestEmailClick: () => {
91
- console.debug("guido:test-email:click"), n("test-email:click");
90
+ console.debug("guido:test-email:click"), r("test-email:click");
92
91
  }
93
92
  });
94
- const A = (t) => {
95
- console.debug("dynamic-content:close", t), g.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
96
- }, B = () => {
93
+ const B = (t) => {
94
+ console.debug("dynamic-content:close", t), y.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
95
+ }, N = () => {
97
96
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
98
97
  };
99
- G(() => u.value, () => {
100
- n("on-change", u.value);
98
+ G(() => l.value, () => {
99
+ r("on-change", l.value);
101
100
  });
102
- const b = (t) => {
103
- const e = t, { attribute: i, position: m } = e.detail;
104
- console.debug("dynamic-content:open", e.detail), n("dynamic-content:open", i, m);
101
+ const v = (t) => {
102
+ const e = t, { attribute: a, position: d } = e.detail;
103
+ console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", a, d);
105
104
  };
106
- let c = null;
107
- const h = () => {
105
+ let i = null;
106
+ const b = () => {
108
107
  var e;
109
- const t = document.querySelector(we);
110
- (e = y.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
111
- }, E = async () => {
108
+ const t = document.querySelector(ve);
109
+ (e = f.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
110
+ }, h = async () => {
112
111
  var t;
113
- a.mark("host_ready");
114
112
  try {
115
- o.initialized || o.init(s.config), d.templateId = o.templateId, a.setContext({
116
- partnerName: o.partnerName,
117
- productType: o.productType,
118
- templateId: o.templateId,
119
- variationId: o.variationId
120
- });
121
- const e = o.template, i = (e == null ? void 0 : e.html) || "", m = (e == null ? void 0 : e.css) || "", O = (e == null ? void 0 : e.preselectedDynamicContent) || [];
122
- C.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
123
- const ne = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, P = o.isFeatureEnabled("linkTrackingIds"), ae = {
113
+ o.initialized || o.init(s.config), c.templateId = o.templateId;
114
+ const e = o.template, a = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", P = (e == null ? void 0 : e.preselectedDynamicContent) || [];
115
+ D.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
116
+ const _ = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, O = o.isFeatureEnabled("linkTrackingIds"), x = {
124
117
  partnerName: o.partnerName,
125
118
  campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
126
119
  rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
127
- }, x = (ce) => a.timed(
128
- "migration",
129
- () => Ee(ce, ne, ae)
130
- );
131
- let r = {
132
- html: i && await x(i),
133
- css: m
134
120
  };
135
- r.html || (r = await a.timed("default_template", () => U()), r.html = await x(r.html));
136
- const ie = P ? $(r.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
137
- _(r.html) && (r.html = await a.timed("timer_clone", () => N(r.html))), P && (d.trackIdSessionFloor = Math.max(ie, $(r.html)));
121
+ let n = {
122
+ html: a && await V(a, _, x),
123
+ css: d
124
+ };
125
+ n.html || (n = await I(), n.html = await V(n.html, _, x));
126
+ const ae = O ? H(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
127
+ A(n.html) && (n.html = await U(n.html)), O && (c.trackIdSessionFloor = Math.max(ae, H(n.html)));
138
128
  const se = {
139
- preselectedDynamicContentList: O,
129
+ preselectedDynamicContentList: P,
140
130
  onReady: () => {
141
- console.debug("guido:ready"), n("ready");
131
+ console.debug("guido:ready"), r("ready");
142
132
  }
143
133
  };
144
- p = L(), await M(r, v(), se), g.selectedDynamicContentList = O;
134
+ u = T(), await F(n, g(), se), y.selectedDynamicContentList = P;
145
135
  } catch (e) {
146
- console.error("Failed to initialize Stripo editor:", e), a.markFailed();
136
+ console.error("Failed to initialize Stripo editor:", e);
147
137
  }
148
138
  };
149
- return me(async () => {
139
+ return ce(async () => {
150
140
  var e;
151
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), V().$reset(), w().$reset(), xe().$reset(), Pe().$reset(), D(), h();
152
- const t = (e = y.value) == null ? void 0 : e.parentElement;
153
- if (t && (c = new ResizeObserver(h), c.observe(t)), R(), s.ready)
154
- await E();
141
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(), E().$reset(), Ne().$reset(), Be().$reset(), C(), b();
142
+ const t = (e = f.value) == null ? void 0 : e.parentElement;
143
+ if (t && (i = new ResizeObserver(b), i.observe(t)), L(), s.ready)
144
+ await h();
155
145
  else {
156
- const i = G(() => s.ready, (m) => {
157
- m && (i(), E());
146
+ const a = G(() => s.ready, (d) => {
147
+ d && (a(), h());
158
148
  });
159
149
  }
160
- document.addEventListener("dynamic-content:open", b);
161
- }), le(() => {
162
- if (Ce(), ke(), a.dispose(), c == null || c.disconnect(), document.removeEventListener("dynamic-content:open", b), S(p))
150
+ document.addEventListener("dynamic-content:open", v);
151
+ }), de(() => {
152
+ if (he(), be(), i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", v), S(u))
163
153
  try {
164
- w().isStripoInitialized = !1;
154
+ E().isStripoInitialized = !1;
165
155
  } catch (t) {
166
156
  console.debug("Failed to close the editor readiness gate on unmount", t);
167
157
  }
168
- T(async () => {
169
- if (S(p))
158
+ M(async () => {
159
+ if (S(u))
170
160
  try {
171
161
  window.UIEditor.removeEditor();
172
162
  } catch {
173
163
  console.debug("Failed to remove Stripo editor: No editor found");
174
164
  }
175
165
  }), o.reset();
176
- }), q({
166
+ }), K({
177
167
  dynamicContent: {
178
- insert: A,
179
- close: B
168
+ insert: B,
169
+ close: N
180
170
  },
181
- hasChanges: u,
182
- saveSilent: I,
183
- setLoading: F
184
- }), { __sfc: !0, openMetrics: a, PreviewContainer: K, OnboardingWrapper: j, AssignStrategyDrawer: J, RemoveStrategyModal: Q, LegacyStrategyUpdatedModal: X, headerWrapperRef: k, wrapperRef: y, dynamicContentStore: g, unsubscribeStore: C, props: s, configStore: o, editorStore: d, previewStore: Y, hasChanges: u, isTestPartner: Z, isSaveValidationEnabled: ee, loadRollout: D, saveSilent: I, setLoading: F, emit: n, buildMetadata: v, initPlugin: M, preloadRuntime: R, runExclusive: T, beginMount: L, isCurrentMount: S, mountGeneration: p, getDefaultTemplate: U, cloneTimersOnSave: N, hasTimerBlocks: _, noHeader: te, isRrsEnabled: oe, hasAssignedStrategy: re, insertDynamicContent: A, closeDynamicContent: B, handleDynamicContentOpen: b, ribbonObserver: c, updateRibbonOffset: h, startEditor: E, AutoSaveController: De, AuthErrorModal: Ie, Toaster: Fe, FilterSelectionDrawer: Me, HeaderWrapper: Re, LoadingWrapper: Te, SaveAsTemplateDrawer: Le, UnsubscribeWrapper: Ue, ValidationErrorDrawer: Ne };
171
+ hasChanges: l,
172
+ saveSilent: k,
173
+ setLoading: R
174
+ }), { __sfc: !0, PreviewContainer: j, OnboardingWrapper: J, AssignStrategyDrawer: Q, RemoveStrategyModal: X, LegacyStrategyUpdatedModal: Y, headerWrapperRef: w, wrapperRef: f, dynamicContentStore: y, unsubscribeStore: D, props: s, configStore: o, editorStore: c, previewStore: Z, hasChanges: l, isTestPartner: ee, isSaveValidationEnabled: te, loadRollout: C, saveSilent: k, setLoading: R, emit: r, buildMetadata: g, initPlugin: F, preloadRuntime: L, runExclusive: M, beginMount: T, isCurrentMount: S, mountGeneration: u, getDefaultTemplate: I, cloneTimersOnSave: U, hasTimerBlocks: A, noHeader: oe, isRrsEnabled: ne, hasAssignedStrategy: re, insertDynamicContent: B, closeDynamicContent: N, handleDynamicContentOpen: v, ribbonObserver: i, updateRibbonOffset: b, startEditor: h, AutoSaveController: Ee, AuthErrorModal: we, Toaster: De, FilterSelectionDrawer: Ce, HeaderWrapper: ke, LoadingWrapper: Re, SaveAsTemplateDrawer: Fe, UnsubscribeWrapper: Le, ValidationErrorDrawer: Me };
185
175
  }
186
176
  });
187
177
  export {
188
- ht as default
178
+ yt as default
189
179
  };
@@ -1,55 +1,44 @@
1
- import { useActionsApi as H } from "./useActionsApi.js";
2
- import { useBlocksConfig as N } from "./useBlocksConfig.js";
3
- import { useConfig as j } from "./useConfig.js";
4
- import { useCustomInterfaceAppearance as _ } from "./useCustomInterfaceAppearance.js";
5
- import { useEditorOpenMetrics as z } from "./useEditorOpenMetrics.js";
6
- import { useFullStoryBridge as $ } from "./useFullStoryBridge.js";
7
- import { useModuleRepair as G } from "./useModuleRepair.js";
8
- import { useStripoEventHandler as X } from "./useStripoEventHandler.js";
9
- import { useStripoNotifications as J } from "./useStripoNotifications.js";
10
- import { useToaster as K } from "./useToaster.js";
11
- import { localePatch as Q } from "../config/i18n/index.js";
12
- import { en as B } from "../config/i18n/en/index.js";
13
- import { ToasterTypeOptions as W } from "../enums/toaster.js";
14
- import { useStripoApi as Y } from "../services/stripoApi.js";
15
- import Z from "../static/styles/customEditorStyle.css.js";
16
- import { useEditorStore as M } from "../stores/editor.js";
17
- import { buildMergeTagEntries as ee, flattenDynamicContentList as te } from "../utils/genericUtil.js";
18
- import { getStripoRuntimeBaseUrl as oe } from "../utils/stripoRuntime.js";
19
- let d = null, v = !1;
20
- const be = () => {
21
- const { features: u, template: m, isFeatureEnabled: p } = j(), { handleError: f, showToaster: T } = K(), { getToken: F, getCustomFonts: A, getSyncModulesStatus: P } = Y(), { handleEvent: R } = X(), { handleModuleAdd: U } = G(), { getStripoBlocksConfig: V } = N(), { getStripoNotifications: D } = J(), e = z(), g = () => d || (d = new Promise((s, a) => {
1
+ import { useActionsApi as L } from "./useActionsApi.js";
2
+ import { useBlocksConfig as O } from "./useBlocksConfig.js";
3
+ import { useConfig as H } from "./useConfig.js";
4
+ import { useCustomInterfaceAppearance as w } from "./useCustomInterfaceAppearance.js";
5
+ import { useFullStoryBridge as N } from "./useFullStoryBridge.js";
6
+ import { useModuleRepair as j } from "./useModuleRepair.js";
7
+ import { useStripoEventHandler as z } from "./useStripoEventHandler.js";
8
+ import { useStripoNotifications as $ } from "./useStripoNotifications.js";
9
+ import { useToaster as G } from "./useToaster.js";
10
+ import { localePatch as J } from "../config/i18n/index.js";
11
+ import { en as b } from "../config/i18n/en/index.js";
12
+ import { ToasterTypeOptions as X } from "../enums/toaster.js";
13
+ import { useStripoApi as K } from "../services/stripoApi.js";
14
+ import Q from "../static/styles/customEditorStyle.css.js";
15
+ import { useEditorStore as k } from "../stores/editor.js";
16
+ import { buildMergeTagEntries as W, flattenDynamicContentList as Y } from "../utils/genericUtil.js";
17
+ import Z from "../package.json.js";
18
+ let n = null;
19
+ const he = () => {
20
+ const { features: c, template: u, isFeatureEnabled: p } = H(), { handleError: m, showToaster: v } = G(), { getToken: B, getCustomFonts: M, getSyncModulesStatus: T } = K(), { handleEvent: F } = z(), { handleModuleAdd: A } = j(), { getStripoBlocksConfig: V } = O(), { getStripoNotifications: _ } = $(), f = () => n || (n = new Promise((r, s) => {
21
+ var d;
22
22
  if (document.getElementById("UiEditorScript")) {
23
- s();
23
+ r();
24
24
  return;
25
25
  }
26
- const i = oe();
27
- if (!i) {
28
- a(
29
- new Error("guido.stripo.version is not set in package.json. Please configure the Stripo version.")
30
- );
31
- return;
32
- }
33
- const n = `${i}UIEditor.js`, t = document.createElement("script");
34
- t.id = "UiEditorScript", t.type = "module", t.src = n, t.onload = () => {
35
- v = !0, s();
36
- }, t.onerror = () => {
37
- t.remove(), a(new Error(`Failed to load Stripo UIEditor script from S3: ${n}`));
38
- }, document.body.appendChild(t);
39
- }), d.catch(() => {
40
- d = null;
41
- }), d), I = async (s, a, i, n = [], t = !1) => {
42
- var C, w, k, b;
43
- const o = M(), { html: c, css: S } = s, { baseBlocks: y, extensions: L } = await V();
44
- e.mark("blocks_config_ready");
45
- const E = ((C = u.value) == null ? void 0 : C.displayConditions) ?? !0, O = ((w = u.value) == null ? void 0 : w.modulesDisabled) ?? !1, h = !!c || (((k = m.value) == null ? void 0 : k.forceRecreate) ?? !1), q = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
46
- e.setTemplate({ html: c, css: S, forceRecreate: h }), _().importCss(), e.mark("init_editor"), await window.UIEditor.initEditor(
26
+ const o = Z.guido, i = `https://email-static.useinsider.com/guido/${(d = o == null ? void 0 : o.stripo) == null ? void 0 : d.version}/UIEditor.js`, e = document.createElement("script");
27
+ e.id = "UiEditorScript", e.type = "module", e.src = i, e.onload = () => r(), e.onerror = () => {
28
+ e.remove(), s(new Error(`Failed to load Stripo UIEditor script from S3: ${i}`));
29
+ }, document.body.appendChild(e);
30
+ }), n.catch(() => {
31
+ n = null;
32
+ }), n), D = async (r, s, o, a = [], i = !1) => {
33
+ var y, E, h, C;
34
+ const e = k(), { html: d, css: P } = r, { baseBlocks: g, extensions: R } = await V(), S = ((y = c.value) == null ? void 0 : y.displayConditions) ?? !0, U = ((E = c.value) == null ? void 0 : E.modulesDisabled) ?? !1, I = !!d || (((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1), q = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
35
+ w().importCss(), await window.UIEditor.initEditor(
47
36
  document.querySelector("#guido-editor"),
48
37
  {
49
- metadata: a,
50
- html: c,
51
- css: S,
52
- forceRecreate: h,
38
+ metadata: s,
39
+ html: d,
40
+ css: P,
41
+ forceRecreate: I,
53
42
  locale: "en",
54
43
  undoButtonSelector: "#guido__undo-button",
55
44
  redoButtonSelector: "#guido__redo-button",
@@ -59,12 +48,12 @@ const be = () => {
59
48
  customAppearanceMergetags: !p("liquidSyntax"),
60
49
  customAppearanceMergetagsBorderColor: "#f1f3fe",
61
50
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
62
- customViewStyles: Z,
63
- conditionsEnabled: E,
64
- customConditionsEnabled: E,
51
+ customViewStyles: Q,
52
+ conditionsEnabled: S,
53
+ customConditionsEnabled: S,
65
54
  enableXSSSecurity: !0,
66
- modulesDisabled: O,
67
- syncModulesEnabled: t,
55
+ modulesDisabled: U,
56
+ syncModulesEnabled: i,
68
57
  messageSettingsEnabled: !0,
69
58
  displayGmailAnnotations: !0,
70
59
  displayHiddenPreheader: !1,
@@ -75,55 +64,54 @@ const be = () => {
75
64
  selectElementAfterDrop: !0,
76
65
  sameFontSizeForOutlook: !0,
77
66
  allowedScriptSourceDomains: q,
78
- ...y ? { baseBlocks: y } : {},
67
+ ...g ? { baseBlocks: g } : {},
79
68
  editorFonts: {
80
69
  showDefaultStandardFonts: !0,
81
70
  showDefaultNotStandardFonts: !0,
82
- customFonts: n
71
+ customFonts: a
83
72
  },
84
73
  mergeTags: [
85
74
  {
86
- entries: ee(
87
- i.preselectedDynamicContentList,
88
- te((b = m.value) == null ? void 0 : b.dynamicContentList),
75
+ entries: W(
76
+ o.preselectedDynamicContentList,
77
+ Y((C = u.value) == null ? void 0 : C.dynamicContentList),
89
78
  p("liquidSyntax")
90
79
  )
91
80
  }
92
81
  ],
93
- async onTokenRefreshRequest(r) {
82
+ async onTokenRefreshRequest(t) {
94
83
  try {
95
- e.mark("token_start");
96
- const l = await F();
97
- e.mark("token_end"), r(l);
84
+ const l = await B();
85
+ t(l);
98
86
  } catch (l) {
99
- f(l, "Failed to refresh token");
87
+ m(l, "Failed to refresh token");
100
88
  }
101
89
  },
102
90
  onTemplateLoaded() {
103
91
  try {
104
- const { activateCustomViewStyles: r, updateTimerInClonedTemplate: l } = H(), { injectFullStory: x } = $();
105
- _().importCss(), r(), x(), l(), i.onReady(), o.isStripoInitialized = !0, o.loadingStatus = !1, setTimeout(() => {
106
- o.hasChanges = !1;
107
- }, 1e3), e.markReady();
108
- } catch (r) {
109
- f(r, "Failed to load custom interface appearance");
92
+ const { activateCustomViewStyles: t, updateTimerInClonedTemplate: l } = L(), { injectFullStory: x } = N();
93
+ w().importCss(), t(), x(), l(), o.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
94
+ e.hasChanges = !1;
95
+ }, 1e3);
96
+ } catch (t) {
97
+ m(t, "Failed to load custom interface appearance");
110
98
  }
111
99
  },
112
- onCodeEditorVisibilityChanged(r) {
113
- o.isCodeEditorOpen = r;
100
+ onCodeEditorVisibilityChanged(t) {
101
+ e.isCodeEditorOpen = t;
114
102
  },
115
- onEditorVisualModeChanged(r) {
116
- o.editorVisualMode = r.toLowerCase();
103
+ onEditorVisualModeChanged(t) {
104
+ e.editorVisualMode = t.toLowerCase();
117
105
  },
118
- onVersionHistoryVisibilityChanged(r) {
119
- o.isVersionHistoryOpen = r;
106
+ onVersionHistoryVisibilityChanged(t) {
107
+ e.isVersionHistoryOpen = t;
120
108
  },
121
109
  onDataChanged() {
122
- o.hasChanges = !0, o.changeSeq += 1;
110
+ e.hasChanges = !0, e.changeSeq += 1;
123
111
  },
124
- onEvent: R,
125
- onModuleAdd: U,
126
- notifications: D(),
112
+ onEvent: F,
113
+ onModuleAdd: A,
114
+ notifications: _(),
127
115
  // Stripo deselects the block on any click outside the canvas, so every surface
128
116
  // that belongs to the block's own flow has to be listed here (SD-153273).
129
117
  ignoreClickOutsideSelectors: [
@@ -133,35 +121,35 @@ const be = () => {
133
121
  ".in-modal-v2-wrapper",
134
122
  ".in-toasts-wrapper"
135
123
  ],
136
- extensions: L,
137
- localePatch: Q
124
+ extensions: R,
125
+ localePatch: J
138
126
  }
139
127
  );
140
128
  };
141
- return { initPlugin: async (s, a, i) => {
142
- const n = M();
129
+ return { initPlugin: async (r, s, o) => {
130
+ const a = k();
143
131
  try {
144
- e.mark("plugin_start"), e.setScriptPreloaded(v), await g(), e.mark("script_ready");
145
- const [t, o] = await Promise.all([
146
- A(),
147
- P()
132
+ await f();
133
+ const [i, e] = await Promise.all([
134
+ M(),
135
+ T()
148
136
  ]);
149
- e.mark("fonts_sync_ready"), n.syncModulesEnabled = o, await I(s, a, i, t, o);
137
+ a.syncModulesEnabled = e, await D(r, s, o, i, e);
150
138
  } catch {
151
- n.loadingStatus = !1, T({
152
- type: W.Error,
153
- message: B["An error has occurred. Please report the error code to support."],
139
+ a.loadingStatus = !1, v({
140
+ type: X.Error,
141
+ message: b["An error has occurred. Please report the error code to support."],
154
142
  actionButton: {
155
- text: B["Reload page"],
143
+ text: b["Reload page"],
156
144
  onClick: () => window.location.reload()
157
145
  }
158
- }), e.markFailed();
146
+ });
159
147
  }
160
148
  }, preloadRuntime: () => {
161
- g().catch(() => {
149
+ f().catch(() => {
162
150
  });
163
151
  } };
164
152
  };
165
153
  export {
166
- be as useStripo
154
+ he as useStripo
167
155
  };