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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,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
  };
@@ -0,0 +1,22 @@
1
+ import { useToaster as i } from "../useToaster.js";
2
+ import { useTranslations as m } from "../useTranslations.js";
3
+ import { ToasterTypeOptions as c } from "../../enums/toaster.js";
4
+ const u = "newsletter.multiple-html-designs-detected", r = `(?:[^>"']|"[^"]*"|'[^']*')*`, a = "style|script|noscript|xmp|iframe|noembed|noframes|textarea|title", T = /<html(?=[\s>/])/gi, A = new RegExp(
5
+ `<!--[\\s\\S]*?-->|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>|<(${a})(?=[\\s/>])${r}>[\\s\\S]*?</\\1\\s*>|<([a-zA-Z][\\w:-]*)${r}>`,
6
+ "gi"
7
+ ), p = (e) => Array.from(e.matchAll(A)).filter(([, , t]) => (t == null ? void 0 : t.toLowerCase()) === "html").length, g = () => {
8
+ const { showToaster: e } = i(), t = m();
9
+ return { validateSingleHtmlDocument: (o, l = !1) => {
10
+ var n;
11
+ if ((((n = o.match(T)) == null ? void 0 : n.length) ?? 0) < 2)
12
+ return !0;
13
+ const s = p(o);
14
+ return s <= 1 ? !0 : (console.debug("guido:save:blocked", { reason: "multiple-html-documents", htmlRootCount: s }), l || e({
15
+ type: c.Warning,
16
+ message: t(u)
17
+ }), !1);
18
+ } };
19
+ };
20
+ export {
21
+ g as useHtmlDocumentCountValidator
22
+ };
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- @charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-b8f24f34] .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-baf7a5dd]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-1a3ddd48]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-1a3ddd48]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-1a3ddd48]{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-19d8cb42] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-skeleton{width:100%!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}
1
+ @charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-b8f24f34] .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-baf7a5dd]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-c5146fc5]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-c5146fc5]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-c5146fc5]{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-19d8cb42] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-skeleton{width:100%!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}
package/dist/library.js CHANGED
@@ -1,22 +1,20 @@
1
1
  import { default as a } from "./components/Guido.vue.js";
2
- import { MessageType as t, ProductType as f } from "./@types/config/schemas.js";
2
+ import { MessageType as t, ProductType as d } from "./@types/config/schemas.js";
3
3
  import "./@types/config/defaults.js";
4
- import { getValidationErrors as p, isValidConfig as s, parseConfig as m, parseConfigSafe as g, validateConfig as n } from "./@types/config/validator.js";
5
- import { assignTrackingIds as l, readTrackFloor as x, readTrackSeq as c } from "./utils/linkTrackingIds.js";
4
+ import { getValidationErrors as s, isValidConfig as p, parseConfig as g, parseConfigSafe as m, validateConfig as n } from "./@types/config/validator.js";
5
+ import { assignTrackingIds as u, readTrackFloor as x, readTrackSeq as T } from "./utils/linkTrackingIds.js";
6
6
  import { useGuidoEmailEditorStore as C } from "./stores/guido-email-editor.js";
7
- import { prefetchGuidoRuntime as E } from "./utils/runtimePrefetch.js";
8
7
  export {
9
8
  a as Guido,
10
9
  t as MessageType,
11
- f as ProductType,
12
- l as assignTrackingIds,
13
- p as getValidationErrors,
14
- s as isValidConfig,
15
- m as parseConfig,
16
- g as parseConfigSafe,
17
- E as prefetchGuidoRuntime,
10
+ d as ProductType,
11
+ u as assignTrackingIds,
12
+ s as getValidationErrors,
13
+ p as isValidConfig,
14
+ g as parseConfig,
15
+ m as parseConfigSafe,
18
16
  x as readTrackFloor,
19
- c as readTrackSeq,
17
+ T as readTrackSeq,
20
18
  C as useGuidoEmailEditorStore,
21
19
  n as validateConfig
22
20
  };
@@ -1,9 +1,7 @@
1
- const o = "3.21.2-beta.b6f3ef8", s = { stripo: { version: "2.81.1" } }, e = {
2
- version: o,
3
- guido: s
1
+ const o = { stripo: { version: "2.81.1" } }, s = {
2
+ guido: o
4
3
  };
5
4
  export {
6
- e as default,
7
- s as guido,
8
- o as version
5
+ s as default,
6
+ o as guido
9
7
  };
@@ -1,24 +1,26 @@
1
- import { useConfig as w } from "../composables/useConfig.js";
2
- import { useHttp as b } from "../composables/useHttp.js";
3
- import { useToaster as C } from "../composables/useToaster.js";
4
- import { useTranslations as h } from "../composables/useTranslations.js";
5
- import { useLiquidValidator as S } from "../composables/validators/useLiquidValidator.js";
6
- import { EditorType as v } from "../enums/defaults.js";
7
- import { ToasterTypeOptions as x } from "../enums/toaster.js";
8
- import { useRecommendationExtensionStore as E } from "../extensions/Blocks/Recommendation/store/recommendation.js";
9
- import { useSaveAsTemplateStore as N } from "../stores/save-as-template.js";
1
+ import { useActionsApi as h } from "../composables/useActionsApi.js";
2
+ import { useConfig as S } from "../composables/useConfig.js";
3
+ import { useHttp as v } from "../composables/useHttp.js";
4
+ import { useToaster as x } from "../composables/useToaster.js";
5
+ import { useTranslations as A } from "../composables/useTranslations.js";
6
+ import { useHtmlDocumentCountValidator as E } from "../composables/validators/useHtmlDocumentCountValidator.js";
7
+ import { useLiquidValidator as N } from "../composables/validators/useLiquidValidator.js";
8
+ import { EditorType as H } from "../enums/defaults.js";
9
+ import { ToasterTypeOptions as P } from "../enums/toaster.js";
10
+ import { useRecommendationExtensionStore as D } from "../extensions/Blocks/Recommendation/store/recommendation.js";
11
+ import { useSaveAsTemplateStore as L } from "../stores/save-as-template.js";
10
12
  import { base64EncodeWithSpecialChars as r } from "../utils/base64.js";
11
- import { isPlainObject as P } from "../utils/genericUtil.js";
12
- import { useTemplatePreparation as A } from "../utils/templatePreparation.js";
13
- const B = () => {
14
- const { get: n, post: m } = b(), { handleError: o, showToaster: l } = C(), { config: c, isFeatureEnabled: p } = w(), { validateLiquidSyntax: f } = S(), u = h();
13
+ import { isPlainObject as q } from "../utils/genericUtil.js";
14
+ import { useTemplatePreparation as F } from "../utils/templatePreparation.js";
15
+ const Z = () => {
16
+ const { get: n, post: m } = v(), { handleError: s, showToaster: l } = x(), { config: c, isFeatureEnabled: p } = S(), { validateLiquidSyntax: T } = N(), { validateSingleHtmlDocument: w } = E(), { getTemplateData: b } = h(), u = A();
15
17
  return {
16
18
  getCategories: async () => {
17
19
  try {
18
20
  const { data: e = [] } = await n("/newsletter/template-library/get-template-categories");
19
21
  return e;
20
22
  } catch (e) {
21
- return o(e, "Failed to fetch template categories"), [];
23
+ return s(e, "Failed to fetch template categories"), [];
22
24
  }
23
25
  },
24
26
  checkTemplateNameAvailability: async (e) => {
@@ -35,27 +37,30 @@ const B = () => {
35
37
  );
36
38
  return t.toString();
37
39
  } catch (t) {
38
- return o(t, "Failed to create category"), "";
40
+ return s(t, "Failed to create category"), "";
39
41
  }
40
42
  },
41
43
  createTemplate: async () => {
42
44
  var e, t, d, y;
43
45
  try {
44
- const { prepareTemplateDetails: i } = A(), s = N(), a = await i();
45
- if (p("liquidSyntax") && !await f(a.compiledHtml))
46
+ const { prepareTemplateDetails: i } = F(), o = L(), g = await b();
47
+ if (!w(g.html))
46
48
  return !1;
47
- const T = {
48
- name: s.getTemplateName,
49
- categories: s.getSelectedCategoryIds,
49
+ const a = await i(g);
50
+ if (p("liquidSyntax") && !await T(a.compiledHtml))
51
+ return !1;
52
+ const C = {
53
+ name: o.getTemplateName,
54
+ categories: o.getSelectedCategoryIds,
50
55
  productId: ((t = (e = c.value) == null ? void 0 : e.partner) == null ? void 0 : t.productType) || 0,
51
- editorType: v,
56
+ editorType: H,
52
57
  messageType: ((y = (d = c.value) == null ? void 0 : d.partner) == null ? void 0 : y.messageType) || 0,
53
58
  content: r(a.compiledHtml),
54
59
  css: r(a.css),
55
60
  unsubscriptionPreferencePageStatus: !1,
56
61
  unsubscriptionPreferencePages: [],
57
62
  recommendationCampaignUrls: r(
58
- E().recommendationCampaignUrls
63
+ D().recommendationCampaignUrls
59
64
  ),
60
65
  recommendationConfigs: r({}),
61
66
  isGuido: !0,
@@ -67,31 +72,31 @@ const B = () => {
67
72
  css: a.css,
68
73
  dynamicContentList: a.dynamicContentList
69
74
  })
70
- }, { data: g } = await m(
75
+ }, { data: f } = await m(
71
76
  "/newsletter/template-library/create-template",
72
- T
77
+ C
73
78
  );
74
- if (!P(g))
79
+ if (!q(f))
75
80
  throw new Error("Unexpected create-template response");
76
- return g.type === "alert" ? (l({
81
+ return f.type === "alert" ? (l({
77
82
  message: u(
78
83
  "newsletter.template-library-save-alert",
79
- { templateName: s.getTemplateName }
84
+ { templateName: o.getTemplateName }
80
85
  ),
81
- type: x.Error
86
+ type: P.Error
82
87
  }), !1) : (l({
83
88
  message: u(
84
89
  "newsletter.template-library-save-success",
85
- { templateName: s.getTemplateName }
90
+ { templateName: o.getTemplateName }
86
91
  ),
87
92
  type: "success"
88
93
  }), !0);
89
94
  } catch (i) {
90
- return o(i, "Failed to create template"), !1;
95
+ return s(i, "Failed to create template"), !1;
91
96
  }
92
97
  }
93
98
  };
94
99
  };
95
100
  export {
96
- B as useTemplateLibraryApi
101
+ Z as useTemplateLibraryApi
97
102
  };
@@ -0,0 +1,3 @@
1
+ export declare const useHtmlDocumentCountValidator: () => {
2
+ validateSingleHtmlDocument: (rawHtml: string, silent?: boolean) => boolean;
3
+ };
@@ -4,6 +4,5 @@ export { validateConfig, parseConfig, parseConfigSafe, isValidConfig, getValidat
4
4
  export { assignTrackingIds, readTrackFloor, readTrackSeq } from './public/trackingIds';
5
5
  export { useGuidoEmailEditorStore } from './public/editorState';
6
6
  export type { GuidoEmailEditorState } from './public/editorState';
7
- export { prefetchGuidoRuntime } from './public/prefetchRuntime';
8
7
  export type { StripoEventType } from './@types/events';
9
8
  export type { PositionData, DynamicContentEvent, MergeTagClickEvent, MergeTag, BaseDynamicContent, DynamicContentNode, DynamicContentList, TooltipOptions, TextValueObject, L10n, } from './@types/generic';
@@ -1,3 +1,4 @@
1
+ import type { TemplateData } from '@@/Types/actions-api';
1
2
  import type { SavedTemplateDetails } from '@@/Types/stripo';
2
3
  /**
3
4
  * Collects every unsubscribe page id referenced by the unsubscribe blocks
@@ -44,7 +45,7 @@ export declare function getHtmlReferencedUnsubscribePages(html: string): number[
44
45
  */
45
46
  declare function hydrateRecommendationStoreFromRawHtml(rawHtml: string): Promise<void>;
46
47
  export declare const useTemplatePreparation: () => {
47
- prepareTemplateDetails: () => Promise<Omit<SavedTemplateDetails, "metadata">>;
48
+ prepareTemplateDetails: (prefetched?: TemplateData) => Promise<Omit<SavedTemplateDetails, "metadata">>;
48
49
  hydrateRecommendationStore: typeof hydrateRecommendationStoreFromRawHtml;
49
50
  };
50
51
  export {};