@useinsider/guido 3.12.0-beta.cfe6433 → 3.12.0-beta.f5f025c

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
- "50dac6de"
15
+ "89cc9a70"
16
16
  );
17
17
  const l = s.exports;
18
18
  export {
@@ -1,140 +1,149 @@
1
- import { defineComponent as X, defineAsyncComponent as I, ref as W, computed as x, watch as Y, onMounted as Z, onUnmounted as ee } from "vue";
2
- import { useCortexBlueprintBridge as oe } from "../composables/useCortexBlueprintBridge.js";
3
- import { provideGuidoActions as te } from "../composables/useGuidoActions.js";
4
- import { useGuidoStateBridge as ne } from "../composables/useGuidoStateBridge.js";
5
- import { usePartner as re } from "../composables/usePartner.js";
6
- import { useStripo as se } from "../composables/useStripo.js";
7
- import { useTimerClone as ae } from "../composables/useTimerClone.js";
8
- import { migrate as G } from "../config/migrator/index.js";
9
- import { ModuleFolderDefaults as H } from "../enums/defaults.js";
10
- import { RIBBON_SELECTOR as ce } from "../enums/onboarding.js";
11
- import { useRecommendationExtensionStore as ie } from "../extensions/Blocks/Recommendation/store/recommendation.js";
12
- import me from "./organisms/AutoSaveController.vue.js";
13
- import de from "./organisms/base/Toaster.vue.js";
14
- import le from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
15
- import ue from "./organisms/header/HeaderWrapper.vue.js";
16
- import pe from "./organisms/LoadingWrapper.vue.js";
17
- import fe from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
18
- import ve from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
19
- import { useStripoApi as Se } from "../services/stripoApi.js";
20
- import { useConfigStore as ye } from "../stores/config.js";
21
- import { useDynamicContentStore as he } from "../stores/dynamic-content.js";
22
- import { useEditorStore as $ } from "../stores/editor.js";
23
- import { usePreviewStore as ge } from "../stores/preview.js";
24
- import { useTemplateStore as be } from "../stores/template.js";
25
- import { useUnsubscribeStore as Ee } from "../stores/unsubscribe.js";
26
- const Ve = /* @__PURE__ */ X({
1
+ import { defineComponent as q, defineAsyncComponent as M, ref as U, computed as _, watch as B, onMounted as K, onUnmounted as V } from "vue";
2
+ import { useCortexBlueprintBridge as j } from "../composables/useCortexBlueprintBridge.js";
3
+ import { provideGuidoActions as J } from "../composables/useGuidoActions.js";
4
+ import { useGuidoStateBridge as Q } from "../composables/useGuidoStateBridge.js";
5
+ import { usePartner as X } from "../composables/usePartner.js";
6
+ import { useStripo as Y } from "../composables/useStripo.js";
7
+ import { useTimerClone as Z } from "../composables/useTimerClone.js";
8
+ import { migrate as I } from "../config/migrator/index.js";
9
+ import { ModuleFolderDefaults as N } from "../enums/defaults.js";
10
+ import { RIBBON_SELECTOR as ee } from "../enums/onboarding.js";
11
+ import { useRecommendationExtensionStore as te } from "../extensions/Blocks/Recommendation/store/recommendation.js";
12
+ import oe from "./organisms/AutoSaveController.vue.js";
13
+ import ne from "./organisms/base/Toaster.vue.js";
14
+ import re from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
15
+ import se from "./organisms/header/HeaderWrapper.vue.js";
16
+ import ie from "./organisms/LoadingWrapper.vue.js";
17
+ import ae from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
18
+ import ce from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
19
+ import { useStripoApi as de } from "../services/stripoApi.js";
20
+ import { useConfigStore as me } from "../stores/config.js";
21
+ import { useDynamicContentStore as le } from "../stores/dynamic-content.js";
22
+ import { useEditorStore as O } from "../stores/editor.js";
23
+ import { usePreviewStore as ue } from "../stores/preview.js";
24
+ import { useTemplateStore as pe } from "../stores/template.js";
25
+ import { useUnsubscribeStore as fe } from "../stores/unsubscribe.js";
26
+ const xe = /* @__PURE__ */ q({
27
27
  __name: "Guido",
28
28
  props: {
29
- config: null
29
+ config: null,
30
+ ready: { type: Boolean, default: !0 }
30
31
  },
31
32
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
32
- setup(z, { expose: q, emit: n }) {
33
- const b = z, K = I(
33
+ setup(P, { expose: A, emit: n }) {
34
+ const i = P, W = M(
34
35
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
35
- ), V = I(
36
+ ), x = M(
36
37
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
37
- ), E = W(), p = W(), f = he(), w = Ee(), i = ye();
38
- i.init(b.config);
39
- const m = $(), j = ge(), d = x(() => m.hasChanges), { isTestPartner: J } = re(), D = () => {
40
- var e;
41
- return (e = E.value) == null ? void 0 : e.handleSave(!0);
42
- }, C = (e) => {
43
- m.loadingStatus = e;
44
- }, {
45
- templateId: v,
46
- userId: T,
47
- partnerName: L,
48
- username: k,
49
- template: o,
50
- editor: s
51
- } = i, l = (o == null ? void 0 : o.html) || "", F = (o == null ? void 0 : o.css) || "", S = (o == null ? void 0 : o.preselectedDynamicContent) || [], U = (s == null ? void 0 : s.savedModulesFolderName) || H.SAVED_MODULES, _ = (s == null ? void 0 : s.defaultModulesFolderName) || H.DEFAULT_MODULES;
52
- oe(), ne();
53
- const y = {
54
- emailId: v,
55
- userId: T,
56
- username: k,
57
- partnerName: L,
58
- savedModulesFolderName: U,
59
- defaultModulesFolderName: _
60
- }, M = {
61
- preselectedDynamicContentList: S,
62
- onReady: () => {
63
- console.debug("guido:ready"), n("ready");
64
- }
65
- }, { initPlugin: O } = se(y, M), { getDefaultTemplate: P } = Se(), { cloneTimersOnSave: R, hasTimerBlocks: A } = ae(), Q = x(() => {
66
- var e;
67
- return !((e = i.ui) != null && e.showHeader);
38
+ ), g = U(), l = U(), u = le(), S = fe(), o = me();
39
+ i.ready && o.init(i.config);
40
+ const d = O(), G = ue(), m = _(() => d.hasChanges), { isTestPartner: H } = X(), h = () => {
41
+ var t;
42
+ return (t = g.value) == null ? void 0 : t.handleSave(!0);
43
+ }, b = (t) => {
44
+ d.loadingStatus = t;
45
+ };
46
+ j(), Q();
47
+ const p = () => {
48
+ var t, e;
49
+ return {
50
+ emailId: o.templateId,
51
+ userId: o.userId,
52
+ username: o.username,
53
+ partnerName: o.partnerName,
54
+ savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || N.SAVED_MODULES,
55
+ defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || N.DEFAULT_MODULES
56
+ };
57
+ }, { initPlugin: E, preloadRuntime: w } = Y(), { getDefaultTemplate: C } = de(), { cloneTimersOnSave: D, hasTimerBlocks: T } = Z(), $ = _(() => {
58
+ var t;
59
+ return !((t = o.ui) != null && t.showHeader);
68
60
  });
69
- te({
61
+ J({
70
62
  onBack: () => {
71
63
  console.debug("guido:back"), n("back");
72
64
  },
73
65
  onSaveStart: () => {
74
66
  console.debug("guido:save:start"), n("save:start");
75
67
  },
76
- onSaveComplete: (e) => {
77
- const t = { ...e, metadata: y };
78
- console.debug("guido:save:complete", t), n("save:complete", t);
68
+ onSaveComplete: (t) => {
69
+ const e = { ...t, metadata: p() };
70
+ console.debug("guido:save:complete", e), n("save:complete", e);
79
71
  },
80
72
  onTestEmailClick: () => {
81
73
  console.debug("guido:test-email:click"), n("test-email:click");
82
74
  }
83
75
  });
84
- const B = (e) => {
85
- console.debug("dynamic-content:close", e), f.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
86
- }, N = () => {
76
+ const L = (t) => {
77
+ console.debug("dynamic-content:close", t), u.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
78
+ }, R = () => {
87
79
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
88
80
  };
89
- Y(() => d.value, () => {
90
- n("on-change", d.value);
81
+ B(() => m.value, () => {
82
+ n("on-change", m.value);
91
83
  });
92
- const h = (e) => {
93
- const t = e, { attribute: u, position: c } = t.detail;
94
- console.debug("dynamic-content:open", t.detail), n("dynamic-content:open", u, c);
84
+ const f = (t) => {
85
+ const e = t, { attribute: s, position: c } = e.detail;
86
+ console.debug("dynamic-content:open", e.detail), n("dynamic-content:open", s, c);
95
87
  };
96
88
  let a = null;
97
- const g = () => {
89
+ const y = () => {
90
+ var e;
91
+ const t = document.querySelector(ee);
92
+ (e = l.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
93
+ }, v = async () => {
98
94
  var t;
99
- const e = document.querySelector(ce);
100
- (t = p.value) == null || t.style.setProperty("--ribbon-offset", `${(e == null ? void 0 : e.offsetHeight) ?? 0}px`);
101
- };
102
- return Z(async () => {
103
- var t, u;
104
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), ie().$reset(), $().$reset(), m.templateId = v, be().$reset(), g();
105
- const e = (t = p.value) == null ? void 0 : t.parentElement;
106
- e && (a = new ResizeObserver(g), a.observe(e));
107
95
  try {
108
- w.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
109
- const c = ((u = o == null ? void 0 : o.migration) == null ? void 0 : u.recommendationConfigs) ?? {};
96
+ o.initialized || o.init(i.config), d.templateId = o.templateId;
97
+ const e = o.template, s = (e == null ? void 0 : e.html) || "", c = (e == null ? void 0 : e.css) || "", k = (e == null ? void 0 : e.preselectedDynamicContent) || [];
98
+ S.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
99
+ const F = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {};
110
100
  let r = {
111
- html: l && await G(l, c),
112
- css: F
101
+ html: s && await I(s, F),
102
+ css: c
103
+ };
104
+ r.html || (r = await C(), r.html = await I(r.html, F)), T(r.html) && (r.html = await D(r.html));
105
+ const z = {
106
+ preselectedDynamicContentList: k,
107
+ onReady: () => {
108
+ console.debug("guido:ready"), n("ready");
109
+ }
113
110
  };
114
- r.html || (r = await P(), r.html = await G(r.html, c)), A(r.html) && (r.html = await R(r.html)), await O(r), f.selectedDynamicContentList = S;
115
- } catch (c) {
116
- console.error("Failed to initialize Stripo editor:", c);
111
+ await E(r, p(), z), u.selectedDynamicContentList = k;
112
+ } catch (e) {
113
+ console.error("Failed to initialize Stripo editor:", e);
114
+ }
115
+ };
116
+ return K(async () => {
117
+ var e;
118
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), te().$reset(), O().$reset(), pe().$reset(), y();
119
+ const t = (e = l.value) == null ? void 0 : e.parentElement;
120
+ if (t && (a = new ResizeObserver(y), a.observe(t)), w(), i.ready)
121
+ await v();
122
+ else {
123
+ const s = B(() => i.ready, (c) => {
124
+ c && (s(), v());
125
+ });
117
126
  }
118
- document.addEventListener("dynamic-content:open", h);
119
- }), ee(() => {
120
- a == null || a.disconnect(), document.removeEventListener("dynamic-content:open", h);
127
+ document.addEventListener("dynamic-content:open", f);
128
+ }), V(() => {
129
+ a == null || a.disconnect(), document.removeEventListener("dynamic-content:open", f);
121
130
  try {
122
131
  window.UIEditor.removeEditor();
123
132
  } catch {
124
133
  console.debug("Failed to remove Stripo editor: No editor found");
125
134
  }
126
- i.reset();
127
- }), q({
135
+ o.reset();
136
+ }), A({
128
137
  dynamicContent: {
129
- insert: B,
130
- close: N
138
+ insert: L,
139
+ close: R
131
140
  },
132
- hasChanges: d,
133
- saveSilent: D,
134
- setLoading: C
135
- }), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: V, headerWrapperRef: E, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: w, props: b, configStore: i, editorStore: m, previewStore: j, hasChanges: d, isTestPartner: J, saveSilent: D, setLoading: C, templateId: v, userId: T, partnerName: L, username: k, templateConfig: o, editorConfig: s, html: l, css: F, preselectedDynamicContentList: S, savedModulesFolderName: U, defaultModulesFolderName: _, emit: n, metadata: y, options: M, initPlugin: O, getDefaultTemplate: P, cloneTimersOnSave: R, hasTimerBlocks: A, noHeader: Q, insertDynamicContent: B, closeDynamicContent: N, handleDynamicContentOpen: h, ribbonObserver: a, updateRibbonOffset: g, AutoSaveController: me, Toaster: de, FilterSelectionDrawer: le, HeaderWrapper: ue, LoadingWrapper: pe, SaveAsTemplateDrawer: fe, UnsubscribeWrapper: ve };
141
+ hasChanges: m,
142
+ saveSilent: h,
143
+ setLoading: b
144
+ }), { __sfc: !0, PreviewContainer: W, OnboardingWrapper: x, headerWrapperRef: g, wrapperRef: l, dynamicContentStore: u, unsubscribeStore: S, props: i, configStore: o, editorStore: d, previewStore: G, hasChanges: m, isTestPartner: H, saveSilent: h, setLoading: b, emit: n, buildMetadata: p, initPlugin: E, preloadRuntime: w, getDefaultTemplate: C, cloneTimersOnSave: D, hasTimerBlocks: T, noHeader: $, insertDynamicContent: L, closeDynamicContent: R, handleDynamicContentOpen: f, ribbonObserver: a, updateRibbonOffset: y, startEditor: v, AutoSaveController: oe, Toaster: ne, FilterSelectionDrawer: re, HeaderWrapper: se, LoadingWrapper: ie, SaveAsTemplateDrawer: ae, UnsubscribeWrapper: ce };
136
145
  }
137
146
  });
138
147
  export {
139
- Ve as default
148
+ xe as default
140
149
  };
@@ -1,31 +1,45 @@
1
- import { useActionsApi as x } from "./useActionsApi.js";
1
+ import { useActionsApi as L } from "./useActionsApi.js";
2
2
  import { useBlocksConfig as O } from "./useBlocksConfig.js";
3
3
  import { useConfig as q } from "./useConfig.js";
4
4
  import { useCustomInterfaceAppearance as H } from "./useCustomInterfaceAppearance.js";
5
- import { useFullStoryBridge as L } from "./useFullStoryBridge.js";
6
- import { useModuleDynamicContentRepair as N } from "./useModuleDynamicContentRepair.js";
5
+ import { useFullStoryBridge as N } from "./useFullStoryBridge.js";
6
+ import { useModuleDynamicContentRepair as j } from "./useModuleDynamicContentRepair.js";
7
7
  import { useStripoEventHandler as z } from "./useStripoEventHandler.js";
8
8
  import { useStripoNotifications as $ } from "./useStripoNotifications.js";
9
9
  import { useToaster as G } from "./useToaster.js";
10
10
  import { localePatch as J } from "../config/i18n/index.js";
11
- import { en as E } from "../config/i18n/en/index.js";
11
+ import { en as w } from "../config/i18n/en/index.js";
12
12
  import { ToasterTypeOptions as X } from "../enums/toaster.js";
13
- import { useStripoApi as j } from "../services/stripoApi.js";
14
- import K from "../static/styles/customEditorStyle.css.js";
15
- import { useEditorStore as w } from "../stores/editor.js";
16
- import { buildMergeTagEntries as Q, flattenDynamicContentList as W } from "../utils/genericUtil.js";
17
- import Y from "../package.json.js";
18
- const he = (b, l) => {
19
- const { features: c, template: u, isFeatureEnabled: m } = q(), { handleError: p, showToaster: k } = G(), { getToken: T, getCustomFonts: v, getSyncModulesStatus: B } = j(), { handleEvent: F } = z(), { handleModuleAdd: M } = N(), { getStripoBlocksConfig: A } = O(), { getStripoNotifications: V } = $(), _ = async (n, i = [], r = !1) => {
20
- var S, y, h, C;
21
- const e = w(), { html: f, css: a } = n, { baseBlocks: o, extensions: d } = await A(), g = ((S = c.value) == null ? void 0 : S.displayConditions) ?? !0, P = ((y = c.value) == null ? void 0 : y.modulesDisabled) ?? !1, I = ((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1;
13
+ import { useStripoApi as K } from "../services/stripoApi.js";
14
+ import Q from "../static/styles/customEditorStyle.css.js";
15
+ import { useEditorStore as b } from "../stores/editor.js";
16
+ import { buildMergeTagEntries as W, flattenDynamicContentList as Y } from "../utils/genericUtil.js";
17
+ import Z from "../package.json.js";
18
+ const Ct = () => {
19
+ const { features: c, template: u, isFeatureEnabled: m } = q(), { handleError: p, showToaster: k } = G(), { getToken: T, getCustomFonts: v, getSyncModulesStatus: B } = K(), { handleEvent: F } = z(), { handleModuleAdd: M } = j(), { getStripoBlocksConfig: A } = O(), { getStripoNotifications: V } = $();
20
+ let i = null;
21
+ const f = () => i || (i = new Promise((r, s) => {
22
+ var l;
23
+ if (document.getElementById("UiEditorScript")) {
24
+ r();
25
+ return;
26
+ }
27
+ const o = Z.guido, n = `https://email-static.useinsider.com/guido/${(l = o == null ? void 0 : o.stripo) == null ? void 0 : l.version}/UIEditor.js`, t = document.createElement("script");
28
+ t.id = "UiEditorScript", t.type = "module", t.src = n, t.onload = () => r(), t.onerror = () => {
29
+ t.remove(), s(new Error(`Failed to load Stripo UIEditor script from S3: ${n}`));
30
+ }, document.body.appendChild(t);
31
+ }), i.catch(() => {
32
+ i = null;
33
+ }), i), _ = async (r, s, o, a = [], n = !1) => {
34
+ var y, E, h, C;
35
+ const t = b(), { html: l, css: D } = r, { baseBlocks: g, extensions: R } = await A(), S = ((y = c.value) == null ? void 0 : y.displayConditions) ?? !0, P = ((E = c.value) == null ? void 0 : E.modulesDisabled) ?? !1, U = ((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1;
22
36
  await window.UIEditor.initEditor(
23
37
  document.querySelector("#guido-editor"),
24
38
  {
25
- metadata: b,
26
- html: f,
27
- css: a,
28
- forceRecreate: I,
39
+ metadata: s,
40
+ html: l,
41
+ css: D,
42
+ forceRecreate: U,
29
43
  locale: "en",
30
44
  undoButtonSelector: "#guido__undo-button",
31
45
  redoButtonSelector: "#guido__redo-button",
@@ -35,12 +49,12 @@ const he = (b, l) => {
35
49
  customAppearanceMergetags: !m("liquidSyntax"),
36
50
  customAppearanceMergetagsBorderColor: "#f1f3fe",
37
51
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
38
- customViewStyles: K,
39
- conditionsEnabled: g,
40
- customConditionsEnabled: g,
52
+ customViewStyles: Q,
53
+ conditionsEnabled: S,
54
+ customConditionsEnabled: S,
41
55
  enableXSSSecurity: !0,
42
56
  modulesDisabled: P,
43
- syncModulesEnabled: r,
57
+ syncModulesEnabled: n,
44
58
  messageSettingsEnabled: !0,
45
59
  displayGmailAnnotations: !0,
46
60
  displayHiddenPreheader: !1,
@@ -49,50 +63,50 @@ const he = (b, l) => {
49
63
  selectElementAfterDrop: !0,
50
64
  sameFontSizeForOutlook: !0,
51
65
  allowedScriptSourceDomains: "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com",
52
- ...o ? { baseBlocks: o } : {},
66
+ ...g ? { baseBlocks: g } : {},
53
67
  editorFonts: {
54
68
  showDefaultStandardFonts: !0,
55
69
  showDefaultNotStandardFonts: !0,
56
- customFonts: i
70
+ customFonts: a
57
71
  },
58
72
  mergeTags: [
59
73
  {
60
- entries: Q(
61
- l.preselectedDynamicContentList,
62
- W((C = u.value) == null ? void 0 : C.dynamicContentList),
74
+ entries: W(
75
+ o.preselectedDynamicContentList,
76
+ Y((C = u.value) == null ? void 0 : C.dynamicContentList),
63
77
  m("liquidSyntax")
64
78
  )
65
79
  }
66
80
  ],
67
- async onTokenRefreshRequest(t) {
81
+ async onTokenRefreshRequest(e) {
68
82
  try {
69
- const s = await T();
70
- t(s);
71
- } catch (s) {
72
- p(s, "Failed to refresh token");
83
+ const d = await T();
84
+ e(d);
85
+ } catch (d) {
86
+ p(d, "Failed to refresh token");
73
87
  }
74
88
  },
75
89
  onTemplateLoaded() {
76
90
  try {
77
- const { importCss: t } = H(), { activateCustomViewStyles: s, updateTimerInClonedTemplate: R } = x(), { injectFullStory: U } = L();
78
- t(), s(), U(), R(), l.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
79
- e.hasChanges = !1;
91
+ const { importCss: e } = H(), { activateCustomViewStyles: d, updateTimerInClonedTemplate: I } = L(), { injectFullStory: x } = N();
92
+ e(), d(), x(), I(), o.onReady(), t.isStripoInitialized = !0, t.loadingStatus = !1, setTimeout(() => {
93
+ t.hasChanges = !1;
80
94
  }, 1e3);
81
- } catch (t) {
82
- p(t, "Failed to load custom interface appearance");
95
+ } catch (e) {
96
+ p(e, "Failed to load custom interface appearance");
83
97
  }
84
98
  },
85
- onCodeEditorVisibilityChanged(t) {
86
- e.isCodeEditorOpen = t;
99
+ onCodeEditorVisibilityChanged(e) {
100
+ t.isCodeEditorOpen = e;
87
101
  },
88
- onEditorVisualModeChanged(t) {
89
- e.editorVisualMode = t.toLowerCase();
102
+ onEditorVisualModeChanged(e) {
103
+ t.editorVisualMode = e.toLowerCase();
90
104
  },
91
- onVersionHistoryVisibilityChanged(t) {
92
- e.isVersionHistoryOpen = t;
105
+ onVersionHistoryVisibilityChanged(e) {
106
+ t.isVersionHistoryOpen = e;
93
107
  },
94
108
  onDataChanged() {
95
- e.hasChanges = !0;
109
+ t.hasChanges = !0;
96
110
  },
97
111
  onEvent: F,
98
112
  onModuleAdd: M,
@@ -102,45 +116,35 @@ const he = (b, l) => {
102
116
  ".in-on-board-wrapper",
103
117
  ".in-drawer__container"
104
118
  ],
105
- extensions: d,
119
+ extensions: R,
106
120
  localePatch: J
107
121
  }
108
122
  );
109
- }, D = (n) => new Promise((i, r) => {
110
- var d;
111
- if (document.getElementById("UiEditorScript")) {
112
- Promise.resolve(n()).then(i, r);
113
- return;
114
- }
115
- const e = Y.guido, a = `https://email-static.useinsider.com/guido/${(d = e == null ? void 0 : e.stripo) == null ? void 0 : d.version}/UIEditor.js`, o = document.createElement("script");
116
- o.id = "UiEditorScript", o.type = "module", o.src = a, o.onload = () => {
117
- Promise.resolve(n()).then(i, r);
118
- }, o.onerror = () => {
119
- r(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
120
- }, document.body.appendChild(o);
121
- });
122
- return { initPlugin: async (n) => {
123
- const i = w();
123
+ };
124
+ return { initPlugin: async (r, s, o) => {
125
+ const a = b();
124
126
  try {
125
- await D(async () => {
126
- const [r, e] = await Promise.all([
127
- v(),
128
- B()
129
- ]);
130
- i.syncModulesEnabled = e, await _(n, r, e);
131
- });
127
+ await f();
128
+ const [n, t] = await Promise.all([
129
+ v(),
130
+ B()
131
+ ]);
132
+ a.syncModulesEnabled = t, await _(r, s, o, n, t);
132
133
  } catch {
133
- i.loadingStatus = !1, k({
134
+ a.loadingStatus = !1, k({
134
135
  type: X.Error,
135
- message: E["An error has occurred. Please report the error code to support."],
136
+ message: w["An error has occurred. Please report the error code to support."],
136
137
  actionButton: {
137
- text: E["Reload page"],
138
+ text: w["Reload page"],
138
139
  onClick: () => window.location.reload()
139
140
  }
140
141
  });
141
142
  }
143
+ }, preloadRuntime: () => {
144
+ f().catch(() => {
145
+ });
142
146
  } };
143
147
  };
144
148
  export {
145
- he as useStripo
149
+ Ct as useStripo
146
150
  };
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- .gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-6e711fd7]{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-50dac6de]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-50dac6de]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-50dac6de]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-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-06afaecb]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-06afaecb]{min-height:504px}.iframe-wrapper[data-v-cbafc185]{width:258px}.iframe-scaled[data-v-cbafc185]{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-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-6e711fd7]{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-89cc9a70]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-89cc9a70]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-89cc9a70]{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-06afaecb]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-06afaecb]{min-height:504px}.iframe-wrapper[data-v-cbafc185]{width:258px}.iframe-scaled[data-v-cbafc185]{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}
@@ -4,8 +4,12 @@ import type { SavedTemplateDetails } from '@@/Types/stripo';
4
4
  type __VLS_Props = {
5
5
  /** Guido configuration object */
6
6
  config: GuidoConfigInput;
7
+ /** Host data readiness. Runtime still preloads on mount; only config init waits. Defaults true for v-if-gated call sites. */
8
+ ready?: boolean;
7
9
  };
8
- declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {
10
+ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
11
+ ready: boolean;
12
+ }>, {
9
13
  dynamicContent: {
10
14
  insert: (data: DynamicContent) => void;
11
15
  close: () => void;
@@ -30,8 +34,17 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__
30
34
  ready: () => void;
31
35
  "onboarding:finished": () => void;
32
36
  "test-email:click": () => void;
33
- }, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
37
+ }, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
38
+ ready: boolean;
39
+ }>>>, {
40
+ ready: boolean;
41
+ }>;
34
42
  export default _default;
43
+ type __VLS_WithDefaults<P, D> = {
44
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
45
+ default: D[K];
46
+ }> : P[K];
47
+ };
35
48
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
36
49
  type __VLS_TypePropsToOption<T> = {
37
50
  [K in keyof T]-?: {} extends Pick<T, K> ? {
@@ -41,3 +54,6 @@ type __VLS_TypePropsToOption<T> = {
41
54
  required: true;
42
55
  };
43
56
  };
57
+ type __VLS_PrettifyLocal<T> = {
58
+ [K in keyof T]: T[K];
59
+ } & {};
@@ -1,4 +1,5 @@
1
1
  import type { Metadata, Options, Template } from '@@/Types/stripo';
2
- export declare const useStripo: (metadata: Metadata, options: Options) => {
3
- initPlugin: (template: Template) => Promise<void>;
2
+ export declare const useStripo: () => {
3
+ initPlugin: (template: Template, metadata: Metadata, options: Options) => Promise<void>;
4
+ preloadRuntime: () => void;
4
5
  };
@@ -3,12 +3,8 @@ const n = `.base-input {
3
3
  border-radius: 4px;
4
4
  background-color: var(--guido-color-gray-0);
5
5
  align-items: center;
6
- /* 40px is a floor, never a cap: \`.base-input\` is shared by every settings field,
7
- including Stripo's own auto-height inputs (e.g. the link field) that expand on
8
- focus. A fixed max-height clamped their inner box; keep 40px only as the floor. */
9
- min-height: 40px;
10
- height: auto;
11
- max-height: none;
6
+ height: 40px;
7
+ max-height: 40px;
12
8
  box-sizing: content-box;
13
9
  outline: none;
14
10
  resize: vertical;
@@ -40,6 +36,11 @@ ue-contenteditable .base-input {
40
36
  line-height: 24px;
41
37
  }
42
38
 
39
+ /* Image link input is auto-height; lift the fixed 40px cap so it can grow. */
40
+ ue-contenteditable.link-autoheight-contenteditable .base-input {
41
+ max-height: none;
42
+ }
43
+
43
44
  ue-icon-component.icon-button.icon-clear-input {
44
45
  right: 2px;
45
46
  top: 2px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.12.0-beta.cfe6433",
3
+ "version": "3.12.0-beta.f5f025c",
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",