@useinsider/guido 3.11.0-beta.e62ab49 → 3.11.0-beta.f2b79f2

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,5 +1,5 @@
1
1
  import { ModuleFolderDefaults as S } from "../../enums/defaults.js";
2
- import { object as a, number as s, optional as e, string as t, picklist as l, pipe as p, minLength as b, custom as h, boolean as o, array as c, record as k, literal as i, looseObject as y, variant as g, union as f, unknown as n } from "../../node_modules/valibot/dist/index.js";
2
+ import { object as a, number as n, optional as e, string as t, picklist as l, pipe as p, minLength as b, custom as h, boolean as o, array as c, record as k, literal as i, looseObject as g, variant as R, union as f, unknown as s } from "../../node_modules/valibot/dist/index.js";
3
3
  const d = {
4
4
  /** Promotional/marketing emails */
5
5
  PROMOTIONAL: 1,
@@ -12,7 +12,7 @@ const d = {
12
12
  ARCHITECT: 49,
13
13
  /** Unsubscribe page builder */
14
14
  UNSUBSCRIBE_PAGES: 97
15
- }, R = a({
15
+ }, C = a({
16
16
  /** Unique identifier for the template being edited */
17
17
  templateId: p(
18
18
  t(),
@@ -30,7 +30,7 @@ const d = {
30
30
  name: t(),
31
31
  /** Fallback font family (e.g., "serif" or "sans-serif") */
32
32
  family: t()
33
- }), C = a({
33
+ }), A = a({
34
34
  /** Partner/organization name (required) */
35
35
  name: p(
36
36
  t(),
@@ -54,7 +54,7 @@ const d = {
54
54
  username: e(t(), "Guido User"),
55
55
  /** Fallback font settings from partner settings — used to match backend size calculation */
56
56
  fallbackFont: e(T)
57
- }), A = a({
57
+ }), y = a({
58
58
  /** Display text for the dynamic content */
59
59
  text: t(),
60
60
  /** Template variable value (e.g., {{username}}) */
@@ -68,35 +68,35 @@ const d = {
68
68
  value: t()
69
69
  })
70
70
  )
71
- }), I = y({
71
+ }), I = g({
72
72
  /** Block ID (matches the dictionary key and the legacy HTML element id) */
73
- id: e(s()),
73
+ id: e(n()),
74
74
  /** Decimal places for price display (legacy data may use string or number) */
75
- decimalCount: e(f([t(), s()])),
75
+ decimalCount: e(f([t(), n()])),
76
76
  /** Pinned product IDs (empty array when filter-driven) */
77
- productIds: e(c(n())),
77
+ productIds: e(c(s())),
78
78
  /** Whether the block requested live products at send time */
79
79
  sendProductRequestFlag: e(o()),
80
80
  /** Whether to randomize product order */
81
81
  shuffleProducts: e(o()),
82
82
  /** Filter rules driving product selection */
83
- filters: e(c(n())),
83
+ filters: e(c(s())),
84
84
  /** Currency code (e.g. 'EUR') — sometimes absent in legacy data */
85
85
  currency: e(t()),
86
86
  /** Currency display settings (separators, alignment, decimals) */
87
- currencySettings: e(n()),
87
+ currencySettings: e(s()),
88
88
  /** Locale (e.g. 'nl_NL') */
89
89
  language: e(t()),
90
90
  /** Recommendation strategy key (e.g. 'newArrivals') */
91
91
  strategy: e(t()),
92
92
  /** Snapshot of products as rendered by the legacy block */
93
- recommendedProducts: e(c(n())),
93
+ recommendedProducts: e(c(s())),
94
94
  /** Number of product cards per row */
95
- cardsInRow: e(s()),
95
+ cardsInRow: e(n()),
96
96
  /** Mobile-only padding (right) */
97
- mobileRightPadding: e(s()),
97
+ mobileRightPadding: e(n()),
98
98
  /** Mobile-only padding (left) */
99
- mobileLeftPadding: e(s()),
99
+ mobileLeftPadding: e(n()),
100
100
  /** Disable responsive scaling */
101
101
  unresponsive: e(o()),
102
102
  /** Layout orientation ('vertical' | 'horizontal') */
@@ -106,14 +106,14 @@ const d = {
106
106
  /** Block type marker used by some legacy variants */
107
107
  blockType: e(t()),
108
108
  /** Size variant marker (legacy data may use string or number) */
109
- size: e(f([t(), s()])),
109
+ size: e(f([t(), n()])),
110
110
  /** Vertical responsiveness flag (legacy size=1 variants) */
111
111
  verticalResponsiveness: e(o()),
112
112
  /** Legacy "Move to next line" price placement toggle (cardPricePlacement.js) */
113
113
  isPriceMovedToNextLine: e(o()),
114
114
  /** Legacy "Hide if same as discounted" / delete-price-for-zero-sale toggle */
115
115
  isPriceDeletedForZeroSale: e(o())
116
- }), L = a({
116
+ }), v = a({
117
117
  /**
118
118
  * Legacy recommendation block configs keyed by block ID.
119
119
  * Pass this when loading a template authored with the v1
@@ -124,25 +124,34 @@ const d = {
124
124
  k(t(), I),
125
125
  {}
126
126
  )
127
- }), P = a({
127
+ }), L = a({
128
128
  /** Initial HTML content */
129
129
  html: e(t(), ""),
130
130
  /** Initial CSS content */
131
131
  css: e(t(), ""),
132
132
  /** Preselected dynamic content items */
133
133
  preselectedDynamicContent: e(
134
- c(A),
134
+ c(y),
135
+ []
136
+ ),
137
+ /**
138
+ * Full set of dynamic-content items the account offers (label + token).
139
+ * Used as the label→token map that repairs label-form placeholders
140
+ * (e.g. `{{ Phone Number }}`) in dropped saved modules.
141
+ */
142
+ availableDynamicContent: e(
143
+ c(y),
135
144
  []
136
145
  ),
137
146
  /** Valid custom field attribute names from the partner's categorized fields */
138
147
  customFieldAttributes: e(c(t()), []),
139
148
  /** Selected unsubscribe page IDs */
140
- selectedUnsubscribePages: e(c(s()), []),
149
+ selectedUnsubscribePages: e(c(n()), []),
141
150
  /** Force recreate template in Stripo storage (use true when updating externally modified templates) */
142
151
  forceRecreate: e(o(), !1),
143
152
  /** Migration-only inputs (legacy block configs) */
144
- migration: e(L, {})
145
- }), v = a({
153
+ migration: e(v, {})
154
+ }), P = a({
146
155
  /** Sender display name */
147
156
  senderName: e(t(), ""),
148
157
  /** Email subject line */
@@ -153,9 +162,9 @@ const d = {
153
162
  /** Path to translations object */
154
163
  translationsPath: e(t(), "window.trans[Object.keys(window.trans)[0]]"),
155
164
  /** Migration date for template compatibility */
156
- migrationDate: e(s(), 1759696858),
165
+ migrationDate: e(n(), 1759696858),
157
166
  /** Email header settings */
158
- emailHeader: e(v, { senderName: "", subject: "" }),
167
+ emailHeader: e(P, { senderName: "", subject: "" }),
159
168
  /** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
160
169
  savedModulesFolderName: e(t(), S.SAVED_MODULES),
161
170
  /** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
@@ -184,7 +193,7 @@ const d = {
184
193
  liquidSyntax: e(o(), !1),
185
194
  /** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
186
195
  autosave: e(o(), !1)
187
- }), N = l([
196
+ }), D = l([
188
197
  "amp-accordion",
189
198
  "amp-carousel",
190
199
  "amp-form-controls",
@@ -198,7 +207,7 @@ const d = {
198
207
  "text-block",
199
208
  "timer-block",
200
209
  "video-block"
201
- ]), D = l([
210
+ ]), N = l([
202
211
  "dynamic-content",
203
212
  "checkbox-block",
204
213
  "radio-button-block",
@@ -209,12 +218,12 @@ const d = {
209
218
  ]), x = a({
210
219
  /** Default blocks to exclude from the editor */
211
220
  excludeDefaults: e(
212
- c(N),
221
+ c(D),
213
222
  []
214
223
  ),
215
224
  /** Custom blocks to include in the editor */
216
225
  includeCustoms: e(
217
- c(D),
226
+ c(N),
218
227
  []
219
228
  )
220
229
  }), m = a({
@@ -223,7 +232,7 @@ const d = {
223
232
  /** Human-readable description */
224
233
  description: e(t()),
225
234
  /** Priority for rule ordering (lower = earlier) */
226
- priority: s()
235
+ priority: n()
227
236
  }), F = a({
228
237
  ...m.entries,
229
238
  type: i("replace"),
@@ -255,7 +264,7 @@ const d = {
255
264
  (u) => typeof u == "function",
256
265
  "processor must be a function"
257
266
  )
258
- }), H = g("type", [
267
+ }), H = R("type", [
259
268
  F,
260
269
  U,
261
270
  B,
@@ -279,12 +288,12 @@ const d = {
279
288
  }), V = a({
280
289
  // Required sections
281
290
  /** Identity configuration (required) */
282
- identity: R,
291
+ identity: C,
283
292
  /** Partner configuration (required) */
284
- partner: C,
293
+ partner: A,
285
294
  // Optional sections (with defaults)
286
295
  /** Template content and presets */
287
- template: e(P, {}),
296
+ template: e(L, {}),
288
297
  /** Editor settings */
289
298
  editor: e(E, {}),
290
299
  /** UI configuration */
@@ -303,24 +312,24 @@ export {
303
312
  q as CallbacksSchema,
304
313
  H as CompilerRuleSchema,
305
314
  j as CompilerSchema,
306
- D as CustomBlockTypeSchema,
315
+ N as CustomBlockTypeSchema,
307
316
  w as CustomRuleSchema,
308
- N as DefaultBlockTypeSchema,
309
- A as DynamicContentSchema,
317
+ D as DefaultBlockTypeSchema,
318
+ y as DynamicContentSchema,
310
319
  E as EditorSchema,
311
- v as EmailHeaderSchema,
320
+ P as EmailHeaderSchema,
312
321
  T as FallbackFontSchema,
313
322
  O as FeaturesSchema,
314
323
  V as GuidoConfigSchema,
315
- R as IdentitySchema,
324
+ C as IdentitySchema,
316
325
  I as LegacyRecommendationConfigSchema,
317
326
  d as MessageType,
318
- C as PartnerSchema,
327
+ A as PartnerSchema,
319
328
  r as ProductType,
320
329
  U as RegexRuleSchema,
321
330
  B as RemoveRuleSchema,
322
331
  F as ReplaceRuleSchema,
323
- L as TemplateMigrationSchema,
324
- P as TemplateSchema,
332
+ v as TemplateMigrationSchema,
333
+ L as TemplateSchema,
325
334
  M as UISchema
326
335
  };
@@ -15,7 +15,7 @@ var u = function() {
15
15
  p,
16
16
  !1,
17
17
  null,
18
- "82128f7d"
18
+ "6e711fd7"
19
19
  );
20
20
  const v = c.exports;
21
21
  export {
@@ -10,9 +10,9 @@ var s = function() {
10
10
  d,
11
11
  !1,
12
12
  null,
13
- "5c02dcc7"
13
+ "d11dd577"
14
14
  );
15
- const p = i.exports;
15
+ const c = i.exports;
16
16
  export {
17
- p as default
17
+ c as default
18
18
  };
@@ -8,6 +8,8 @@ const c = /* @__PURE__ */ n({
8
8
  setup(l, { expose: r }) {
9
9
  const e = m(null);
10
10
  return r({
11
+ // Stryker disable next-line OptionalChaining: RightSlot is always rendered (no
12
+ // v-if), so rightSlotRef.value is never null and `?.` cannot short-circuit.
11
13
  handleSave: (t) => {
12
14
  var o;
13
15
  return (o = e.value) == null ? void 0 : o.handleSave(t);
@@ -14,7 +14,7 @@ var n = function() {
14
14
  a,
15
15
  !1,
16
16
  null,
17
- "64c52560"
17
+ "fad98586"
18
18
  );
19
19
  const _ = c.exports;
20
20
  export {
@@ -1,6 +1,6 @@
1
- import n from "./UnsubscribePageSelection.vue2.js";
1
+ import a from "./UnsubscribePageSelection.vue2.js";
2
2
  /* empty css */
3
- import a from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ import n from "../../../_virtual/_plugin-vue2_normalizer.js";
4
4
  var o = function() {
5
5
  var r = this, e = r._self._c, t = r._self._setupProxy;
6
6
  return e(t.WpDrawer, { attrs: { id: "unsubscribe-modal", "description-status": "", size: "large", "footer-button-group-options": t.footerButtonGroupOptions, status: t.unsubscribeStore.pageSelectionDrawerStatus, "title-text": t.trans("newsletter.select-a-template") }, on: { cancelOrBackButtonEvent: t.handleBack, onCloseEvent: t.handleClose, primaryButtonEvent: t.handleSave }, scopedSlots: r._u([{ key: "headerBottomSlot", fn: function() {
@@ -10,13 +10,13 @@ var o = function() {
10
10
  return t.selectTemplate(s.id);
11
11
  } } }, [e(t.InContainer, { staticClass: "template-container o-h", class: { selected: t.unsubscribeStore.getSelectedTemplateByActiveType === s.id }, attrs: { border: t.getBorderClass(s.id) } }, [e("div", { staticClass: "w-1 h-1 d-f j-c-c a-i-c" }, [e("img", { staticClass: "w-1 h-1 thumbnail o-h", attrs: { alt: s.name, src: s.thumbnail } })])]), e("div", { staticClass: "mt-1 f-s-1" }, [r._v(" " + r._s(s.name) + " ")])], 1);
12
12
  }), 0)]);
13
- }, i = [], c = /* @__PURE__ */ a(
14
- n,
13
+ }, i = [], c = /* @__PURE__ */ n(
14
+ a,
15
15
  o,
16
16
  i,
17
17
  !1,
18
18
  null,
19
- "669fe7cf"
19
+ "91a26acd"
20
20
  );
21
21
  const _ = c.exports;
22
22
  export {
@@ -29,9 +29,9 @@ const N = /* @__PURE__ */ y({
29
29
  t();
30
30
  }, 500);
31
31
  }, m = () => {
32
- n(), e.pageSelectionUpdateStatus || document.dispatchEvent(new CustomEvent("unsubscribe:cancel", {
32
+ e.pageSelectionDrawerStatus && (n(), e.pageSelectionUpdateStatus || document.dispatchEvent(new CustomEvent("unsubscribe:cancel", {
33
33
  detail: { blockId: e.pendingBlockId }
34
- }));
34
+ })));
35
35
  }, b = () => {
36
36
  if (e.isActiveTypeFirstInCollection) {
37
37
  n(), e.pageSelectionUpdateStatus || (e.typeSelectionDrawerStatus = !0);
@@ -2,15 +2,15 @@ import n from "./UnsubscribeTypeSelection.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../../../_virtual/_plugin-vue2_normalizer.js";
4
4
  var i = function() {
5
- var e = this, s = e._self._c, t = e._self._setupProxy;
6
- return s(t.WpDrawer, { attrs: { id: "unsubscribe-modal", "description-status": "", "description-text": t.descriptionText, "footer-button-group-options": t.footerButtonGroupOptions, status: t.unsubscribeStore.typeSelectionDrawerStatus, "title-text": t.trans("unsubscription-preference.select-unsubscribe-page-title") }, on: { cancelOrBackButtonEvent: t.closeModal, onCloseEvent: t.closeModal, primaryButtonEvent: t.selectCollection } }, [s(t.InSegments, { staticClass: "w-1", attrs: { "with-icon": "", align: "vertical", disable: t.isSelecting, "segment-list": t.segmentList, selected: t.selectedCollection, "skeleton-sizing": { width: 495, height: 180 }, "skeleton-status": t.skeletonStatus }, on: { click: t.changeCollection } })], 1);
5
+ var t = this, s = t._self._c, e = t._self._setupProxy;
6
+ return s(e.WpDrawer, { attrs: { id: "unsubscribe-modal", "description-status": "", "description-text": e.descriptionText, "footer-button-group-options": e.footerButtonGroupOptions, status: e.unsubscribeStore.typeSelectionDrawerStatus, "title-text": e.trans("unsubscription-preference.select-unsubscribe-page-title") }, on: { cancelOrBackButtonEvent: e.closeModal, onCloseEvent: e.closeModal, primaryButtonEvent: e.selectCollection } }, [s(e.InSegments, { staticClass: "w-1", attrs: { "with-icon": "", align: "vertical", disable: e.isSelecting, "segment-list": e.segmentList, selected: e.selectedCollection, "skeleton-sizing": { width: 495, height: 180 }, "skeleton-status": e.skeletonStatus }, on: { click: e.changeCollection } })], 1);
7
7
  }, r = [], c = /* @__PURE__ */ o(
8
8
  n,
9
9
  i,
10
10
  r,
11
11
  !1,
12
12
  null,
13
- "7a305bb2"
13
+ "b9a93c6e"
14
14
  );
15
15
  const _ = c.exports;
16
16
  export {
@@ -10,10 +10,10 @@ import { InSegments as L } from "@useinsider/design-system-vue";
10
10
  const W = /* @__PURE__ */ _({
11
11
  __name: "UnsubscribeTypeSelection",
12
12
  setup(k) {
13
- const t = N(), { showToaster: d } = w(), e = G(), n = b(!1), o = b(!0), r = b(l.GLOBAL_UNSUBSCRIBE), T = t(
13
+ const t = N(), { showToaster: d } = w(), e = G(), n = b(!1), o = b(!0), r = b(l.GLOBAL_UNSUBSCRIBE), y = t(
14
14
  "unsubscription-preference.select-unsubscribe-page-description",
15
15
  { action: `<a href="${D.GLOBAL_UNSUBSCRIBE}" target="_blank">${t("ds-rules.visit-academy")}</a>` }
16
- ), y = f(() => [
16
+ ), T = f(() => [
17
17
  {
18
18
  description: t("unsubscription-preference.type-global-unsubscribe-description"),
19
19
  icon: "line-contact-global-unsub-page",
@@ -31,7 +31,7 @@ const W = /* @__PURE__ */ _({
31
31
  disable: e.isSubscriptionPreferencesCenterDisabled,
32
32
  tooltipText: e.isSubscriptionPreferencesCenterDisabled ? t("unsubscription-preference.pref-center-added") : ""
33
33
  }
34
- ]), g = f(
34
+ ]), S = f(
35
35
  () => e.isGlobalUnsubscribeDisabled && e.isSubscriptionPreferencesCenterDisabled
36
36
  ), C = f(() => ({
37
37
  primaryButton: {
@@ -41,7 +41,7 @@ const W = /* @__PURE__ */ _({
41
41
  n.value ? "unsubscription-preference.selecting-type" : "products.select-and-continue"
42
42
  ),
43
43
  loadingStatus: n.value,
44
- disabledStatus: g.value,
44
+ disabledStatus: S.value,
45
45
  skeletonStatus: o.value,
46
46
  skeletonSizing: { width: 168, height: 40 }
47
47
  },
@@ -53,12 +53,12 @@ const W = /* @__PURE__ */ _({
53
53
  skeletonStatus: o.value,
54
54
  skeletonSizing: { width: 78, height: 40 }
55
55
  }
56
- })), S = (s) => {
57
- e.typeSelectionDrawerStatus = !1, document.dispatchEvent(new CustomEvent("unsubscribe:cancel", {
56
+ })), g = (s) => {
57
+ e.typeSelectionDrawerStatus && (e.typeSelectionDrawerStatus = !1, document.dispatchEvent(new CustomEvent("unsubscribe:cancel", {
58
58
  detail: { blockId: e.pendingBlockId }
59
59
  })), s && setTimeout(() => {
60
60
  s();
61
- }, 500);
61
+ }, 500));
62
62
  }, E = (s) => {
63
63
  r.value = s;
64
64
  }, m = () => {
@@ -98,14 +98,14 @@ const W = /* @__PURE__ */ _({
98
98
  }), !1;
99
99
  }, B = async () => {
100
100
  if (n.value = !0, await e.fetchTemplates(!0), e.setCollection(r.value), !m()) {
101
- n.value = !1, S();
101
+ n.value = !1, g();
102
102
  return;
103
103
  }
104
104
  n.value = !1, e.typeSelectionDrawerStatus = !1, e.pageSelectionDrawerStatus = !0;
105
105
  };
106
106
  return v(() => e.typeSelectionDrawerStatus, (s) => {
107
107
  s && (o.value = !0, r.value = l.GLOBAL_UNSUBSCRIBE, e.isGlobalUnsubscribeDisabled && (r.value = e.isSubscriptionPreferencesCenterDisabled ? 0 : l.SUBSCRIPTION_PREFERENCE_CENTER), o.value = !1);
108
- }), { __sfc: !0, trans: t, showToaster: d, unsubscribeStore: e, isSelecting: n, skeletonStatus: o, selectedCollection: r, descriptionText: T, segmentList: y, hasNoSelectableType: g, footerButtonGroupOptions: C, closeModal: S, changeCollection: E, validateTemplates: m, selectCollection: B, WpDrawer: U, InSegments: L };
108
+ }), { __sfc: !0, trans: t, showToaster: d, unsubscribeStore: e, isSelecting: n, skeletonStatus: o, selectedCollection: r, descriptionText: y, segmentList: T, hasNoSelectableType: S, footerButtonGroupOptions: C, closeModal: g, changeCollection: E, validateTemplates: m, selectCollection: B, WpDrawer: U, InSegments: L };
109
109
  }
110
110
  });
111
111
  export {
@@ -0,0 +1,36 @@
1
+ import { useConfig as D } from "./useConfig.js";
2
+ import { useToaster as T } from "./useToaster.js";
3
+ import { useTranslations as g } from "./useTranslations.js";
4
+ import { ToasterTypeOptions as C } from "../enums/toaster.js";
5
+ import { buildDynamicContentLookup as h, convertModuleDynamicContent as O } from "../utils/dynamicContentConverter.js";
6
+ const M = "dynamic-content.unresolved-attributes-on-drop", A = () => {
7
+ const { template: i, isFeatureEnabled: p } = D(), { showToaster: a } = T(), m = g();
8
+ return { handleModuleAdd: (n, e) => {
9
+ var s, c, l;
10
+ try {
11
+ if ((n == null ? void 0 : n.action) !== "ADD" && (n == null ? void 0 : n.action) !== "COPY")
12
+ return;
13
+ const o = h(((s = i.value) == null ? void 0 : s.availableDynamicContent) ?? []);
14
+ if (o.size === 0)
15
+ return;
16
+ const t = (c = e == null ? void 0 : e.getTargetNode) == null ? void 0 : c.call(e), r = (l = t == null ? void 0 : t.getOuterHTML) == null ? void 0 : l.call(t);
17
+ if (!t || typeof r != "string")
18
+ return;
19
+ const { html: u, unresolved: y } = O(
20
+ r,
21
+ o,
22
+ p("liquidSyntax")
23
+ );
24
+ u !== r && e.modifyHtml(t).replaceWith(u), y.length > 0 && a({
25
+ type: C.Warning,
26
+ message: m(M)
27
+ });
28
+ } catch (o) {
29
+ console.error("Failed to repair dynamic content on module add:", o);
30
+ }
31
+ } };
32
+ };
33
+ export {
34
+ M as UNRESOLVED_DYNAMIC_CONTENT_ON_DROP_KEY,
35
+ A as useModuleDynamicContentRepair
36
+ };
@@ -1,44 +1,45 @@
1
- import { useActionsApi as U } from "./useActionsApi.js";
2
- import { useBlocksConfig as R } from "./useBlocksConfig.js";
3
- import { useConfig as x } from "./useConfig.js";
4
- import { useCustomInterfaceAppearance as O } from "./useCustomInterfaceAppearance.js";
5
- import { useFullStoryBridge as q } from "./useFullStoryBridge.js";
6
- import { useStripoEventHandler as H } from "./useStripoEventHandler.js";
7
- import { useStripoNotifications as N } from "./useStripoNotifications.js";
8
- import { useToaster as z } from "./useToaster.js";
9
- import { localePatch as L } from "../config/i18n/index.js";
10
- import { en as h } from "../config/i18n/en/index.js";
11
- import { ToasterTypeOptions as $ } from "../enums/toaster.js";
12
- import { useStripoApi as G } from "../services/stripoApi.js";
13
- import J from "../static/styles/customEditorStyle.css.js";
14
- import { useEditorStore as E } from "../stores/editor.js";
15
- import { dynamicContentToMergeTags as X } from "../utils/genericUtil.js";
16
- import j from "../package.json.js";
17
- const fo = (C, l) => {
18
- const { features: c, template: w, isFeatureEnabled: u } = x(), { handleError: m, showToaster: b } = z(), { getToken: T, getCustomFonts: k, getSyncModulesStatus: B } = G(), { handleEvent: F } = H(), { getStripoBlocksConfig: v } = R(), { getStripoNotifications: V } = N(), _ = async (s, i = [], r = !1) => {
19
- var g, S, y;
20
- const o = E(), { html: p, css: a } = s, { baseBlocks: t, extensions: d } = await v(), f = ((g = c.value) == null ? void 0 : g.displayConditions) ?? !0, M = ((S = c.value) == null ? void 0 : S.modulesDisabled) ?? !1, P = ((y = w.value) == null ? void 0 : y.forceRecreate) ?? !1;
1
+ import { useActionsApi as x } from "./useActionsApi.js";
2
+ import { useBlocksConfig as O } from "./useBlocksConfig.js";
3
+ import { useConfig as q } from "./useConfig.js";
4
+ import { useCustomInterfaceAppearance as H } from "./useCustomInterfaceAppearance.js";
5
+ import { useFullStoryBridge as N } from "./useFullStoryBridge.js";
6
+ import { useModuleDynamicContentRepair as z } from "./useModuleDynamicContentRepair.js";
7
+ import { useStripoEventHandler as L } 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 C } from "../config/i18n/en/index.js";
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 } from "../utils/genericUtil.js";
17
+ import W from "../package.json.js";
18
+ const ye = (b, l) => {
19
+ const { features: c, template: u, isFeatureEnabled: m } = q(), { handleError: p, showToaster: k } = G(), { getToken: v, getCustomFonts: T, getSyncModulesStatus: B } = j(), { handleEvent: F } = L(), { handleModuleAdd: M } = z(), { getStripoBlocksConfig: A } = O(), { getStripoNotifications: V } = $(), _ = async (s, i = [], r = !1) => {
20
+ var S, y, h, E;
21
+ const e = w(), { html: f, css: a } = s, { baseBlocks: t, 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;
21
22
  await window.UIEditor.initEditor(
22
23
  document.querySelector("#guido-editor"),
23
24
  {
24
- metadata: C,
25
- html: p,
25
+ metadata: b,
26
+ html: f,
26
27
  css: a,
27
- forceRecreate: P,
28
+ forceRecreate: I,
28
29
  locale: "en",
29
30
  undoButtonSelector: "#guido__undo-button",
30
31
  redoButtonSelector: "#guido__redo-button",
31
32
  mobileViewButtonSelector: ".guido__view-option-selection-mobile",
32
33
  desktopViewButtonSelector: ".guido__view-option-selection-desktop",
33
34
  codeEditorButtonSelector: "#guido__code-button",
34
- customAppearanceMergetags: !u("liquidSyntax"),
35
+ customAppearanceMergetags: !m("liquidSyntax"),
35
36
  customAppearanceMergetagsBorderColor: "#f1f3fe",
36
37
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
37
- customViewStyles: J,
38
- conditionsEnabled: f,
39
- customConditionsEnabled: f,
38
+ customViewStyles: K,
39
+ conditionsEnabled: g,
40
+ customConditionsEnabled: g,
40
41
  enableXSSSecurity: !0,
41
- modulesDisabled: M,
42
+ modulesDisabled: P,
42
43
  syncModulesEnabled: r,
43
44
  messageSettingsEnabled: !0,
44
45
  displayGmailAnnotations: !0,
@@ -56,43 +57,45 @@ const fo = (C, l) => {
56
57
  },
57
58
  mergeTags: [
58
59
  {
59
- entries: X(
60
+ entries: Q(
60
61
  l.preselectedDynamicContentList,
61
- u("liquidSyntax")
62
+ ((E = u.value) == null ? void 0 : E.availableDynamicContent) ?? [],
63
+ m("liquidSyntax")
62
64
  )
63
65
  }
64
66
  ],
65
- async onTokenRefreshRequest(e) {
67
+ async onTokenRefreshRequest(o) {
66
68
  try {
67
- const n = await T();
68
- e(n);
69
+ const n = await v();
70
+ o(n);
69
71
  } catch (n) {
70
- m(n, "Failed to refresh token");
72
+ p(n, "Failed to refresh token");
71
73
  }
72
74
  },
73
75
  onTemplateLoaded() {
74
76
  try {
75
- const { importCss: e } = O(), { activateCustomViewStyles: n, updateTimerInClonedTemplate: D } = U(), { injectFullStory: I } = q();
76
- e(), n(), I(), D(), l.onReady(), o.isStripoInitialized = !0, o.loadingStatus = !1, setTimeout(() => {
77
- o.hasChanges = !1;
77
+ const { importCss: o } = H(), { activateCustomViewStyles: n, updateTimerInClonedTemplate: R } = x(), { injectFullStory: U } = N();
78
+ o(), n(), U(), R(), l.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
79
+ e.hasChanges = !1;
78
80
  }, 1e3);
79
- } catch (e) {
80
- m(e, "Failed to load custom interface appearance");
81
+ } catch (o) {
82
+ p(o, "Failed to load custom interface appearance");
81
83
  }
82
84
  },
83
- onCodeEditorVisibilityChanged(e) {
84
- o.isCodeEditorOpen = e;
85
+ onCodeEditorVisibilityChanged(o) {
86
+ e.isCodeEditorOpen = o;
85
87
  },
86
- onEditorVisualModeChanged(e) {
87
- o.editorVisualMode = e.toLowerCase();
88
+ onEditorVisualModeChanged(o) {
89
+ e.editorVisualMode = o.toLowerCase();
88
90
  },
89
- onVersionHistoryVisibilityChanged(e) {
90
- o.isVersionHistoryOpen = e;
91
+ onVersionHistoryVisibilityChanged(o) {
92
+ e.isVersionHistoryOpen = o;
91
93
  },
92
94
  onDataChanged() {
93
- o.hasChanges = !0;
95
+ e.hasChanges = !0;
94
96
  },
95
97
  onEvent: F,
98
+ onModuleAdd: M,
96
99
  notifications: V(),
97
100
  ignoreClickOutsideSelectors: [
98
101
  "#guido-dynamic-content-modal",
@@ -100,16 +103,16 @@ const fo = (C, l) => {
100
103
  ".in-drawer__container"
101
104
  ],
102
105
  extensions: d,
103
- localePatch: L
106
+ localePatch: J
104
107
  }
105
108
  );
106
- }, A = (s) => new Promise((i, r) => {
109
+ }, D = (s) => new Promise((i, r) => {
107
110
  var d;
108
111
  if (document.getElementById("UiEditorScript")) {
109
112
  Promise.resolve(s()).then(i, r);
110
113
  return;
111
114
  }
112
- const o = j.guido, a = `https://email-static.useinsider.com/guido/${(d = o == null ? void 0 : o.stripo) == null ? void 0 : d.version}/UIEditor.js`, t = document.createElement("script");
115
+ const e = W.guido, a = `https://email-static.useinsider.com/guido/${(d = e == null ? void 0 : e.stripo) == null ? void 0 : d.version}/UIEditor.js`, t = document.createElement("script");
113
116
  t.id = "UiEditorScript", t.type = "module", t.src = a, t.onload = () => {
114
117
  Promise.resolve(s()).then(i, r);
115
118
  }, t.onerror = () => {
@@ -117,21 +120,21 @@ const fo = (C, l) => {
117
120
  }, document.body.appendChild(t);
118
121
  });
119
122
  return { initPlugin: async (s) => {
120
- const i = E();
123
+ const i = w();
121
124
  try {
122
- await A(async () => {
123
- const [r, o] = await Promise.all([
124
- k(),
125
+ await D(async () => {
126
+ const [r, e] = await Promise.all([
127
+ T(),
125
128
  B()
126
129
  ]);
127
- i.syncModulesEnabled = o, await _(s, r, o);
130
+ i.syncModulesEnabled = e, await _(s, r, e);
128
131
  });
129
132
  } catch {
130
- i.loadingStatus = !1, b({
131
- type: $.Error,
132
- message: h["An error has occurred. Please report the error code to support."],
133
+ i.loadingStatus = !1, k({
134
+ type: X.Error,
135
+ message: C["An error has occurred. Please report the error code to support."],
133
136
  actionButton: {
134
- text: h["Reload page"],
137
+ text: C["Reload page"],
135
138
  onClick: () => window.location.reload()
136
139
  }
137
140
  });
@@ -139,5 +142,5 @@ const fo = (C, l) => {
139
142
  } };
140
143
  };
141
144
  export {
142
- fo as useStripo
145
+ ye as useStripo
143
146
  };