@useinsider/guido 3.27.1 → 3.28.0

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.
Files changed (34) hide show
  1. package/README.md +10 -5
  2. package/dist/components/Guido.vue.js +7 -7
  3. package/dist/components/Guido.vue2.js +86 -83
  4. package/dist/components/organisms/dynamic-content/AmbiguousDynamicContentModal.vue.js +24 -0
  5. package/dist/components/organisms/dynamic-content/AmbiguousDynamicContentModal.vue2.js +59 -0
  6. package/dist/composables/useAmbiguousDynamicContent.js +72 -0
  7. package/dist/composables/useHtmlCompiler.js +21 -17
  8. package/dist/composables/useHtmlValidator.js +71 -71
  9. package/dist/composables/useModuleRepair.js +63 -32
  10. package/dist/composables/useSaveValidation.js +80 -80
  11. package/dist/composables/useStripo.js +44 -43
  12. package/dist/config/compiler/htmlCompilerRules.js +16 -6
  13. package/dist/config/compiler/pongoCompilerRules.js +13 -0
  14. package/dist/config/migrator/itemsBlockMigrator.js +220 -178
  15. package/dist/enums/dynamic-content.js +4 -0
  16. package/dist/enums/html-validator.js +8 -7
  17. package/dist/guido.css +1 -1
  18. package/dist/package.json.js +1 -1
  19. package/dist/src/@types/generic.d.ts +7 -0
  20. package/dist/src/components/organisms/dynamic-content/AmbiguousDynamicContentModal.vue.d.ts +2 -0
  21. package/dist/src/composables/useAmbiguousDynamicContent.d.ts +7 -0
  22. package/dist/src/composables/useModuleRepair.d.ts +6 -0
  23. package/dist/src/config/compiler/pongoCompilerRules.d.ts +2 -0
  24. package/dist/src/enums/dynamic-content.d.ts +3 -0
  25. package/dist/src/enums/html-validator.d.ts +1 -0
  26. package/dist/src/stores/module-dynamic-content.d.ts +30 -0
  27. package/dist/src/utils/dynamicContentConverter.d.ts +20 -18
  28. package/dist/src/utils/dynamicContentPendingMarker.d.ts +2 -0
  29. package/dist/src/utils/genericUtil.d.ts +4 -8
  30. package/dist/stores/module-dynamic-content.js +20 -0
  31. package/dist/utils/dynamicContentConverter.js +41 -27
  32. package/dist/utils/dynamicContentPendingMarker.js +6 -0
  33. package/dist/utils/genericUtil.js +39 -39
  34. package/package.json +1 -1
@@ -1,58 +1,58 @@
1
1
  import { getIgnoredRecommendationBlockIds as Y } from "../config/compiler/utils/recommendationIgnoreUtils.js";
2
- import { CanNotMakeAnyChangesForRunningKey as k, DISPLAY_CONDITIONS_REGEX as U, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as M } from "../enums/html-validator.js";
2
+ import { CanNotMakeAnyChangesForRunningKey as k, CONDITION_TAG_REGEX as U, DISPLAY_CONDITIONS_REGEX as M, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as x } from "../enums/html-validator.js";
3
3
  import { SaveValidationRule as o } from "../enums/save-validation.js";
4
4
  import { ToasterTypeOptions as r } from "../enums/toaster.js";
5
- import { BLOCK_ROOT_SELECTOR as x } from "../extensions/Blocks/Checkbox/constants/selectors.js";
5
+ import { BLOCK_ROOT_SELECTOR as G } from "../extensions/Blocks/Checkbox/constants/selectors.js";
6
6
  import { itemsBlockDynamicVariables as W } from "../extensions/Blocks/Items/enums/productEnums.js";
7
- import { BLOCK_ROOT_SELECTOR as G } from "../extensions/Blocks/RadioButton/constants/selectors.js";
8
- import { useRecommendationExtensionStore as P } from "../extensions/Blocks/Recommendation/store/recommendation.js";
9
- import { getInvalidFields as q, STRATEGY_FIELD_KEY as H, RecommendationAssignStrategyKey as V, RecommendationRequiredFieldsKey as X } from "../extensions/Blocks/Recommendation/validation/requiredFields.js";
10
- import { useConfigStore as j } from "../stores/config.js";
11
- import { useDynamicContentStore as z } from "../stores/dynamic-content.js";
12
- import { useRecommendationStore as $ } from "../stores/recommendation.js";
7
+ import { BLOCK_ROOT_SELECTOR as P } from "../extensions/Blocks/RadioButton/constants/selectors.js";
8
+ import { useRecommendationExtensionStore as q } from "../extensions/Blocks/Recommendation/store/recommendation.js";
9
+ import { getInvalidFields as H, STRATEGY_FIELD_KEY as V, RecommendationAssignStrategyKey as X, RecommendationRequiredFieldsKey as j } from "../extensions/Blocks/Recommendation/validation/requiredFields.js";
10
+ import { useConfigStore as z } from "../stores/config.js";
11
+ import { useDynamicContentStore as $ } from "../stores/dynamic-content.js";
12
+ import { useRecommendationStore as Q } from "../stores/recommendation.js";
13
13
  import { base64EncodeWithSpecialChars as T } from "../utils/base64.js";
14
- import { escapeHtml as Q } from "../utils/htmlEscape.js";
15
- import { useTemplatePreparation as Z } from "../utils/templatePreparation.js";
16
- import { useActionsApi as J } from "./useActionsApi.js";
17
- import { useConfig as ee } from "./useConfig.js";
18
- import { useHtmlCompiler as te } from "./useHtmlCompiler.js";
19
- import { buildPartnerAttributeNameSet as ne, getInvalidDynamicContentTags as ie, getRecommendationBlockIds as oe, findInvalidCustomFields as re } from "./useHtmlValidator.js";
20
- import { useHttp as se } from "./useHttp.js";
21
- import { useTranslations as ae } from "./useTranslations.js";
22
- import { findInvalidCouponBlocks as ce, COUPON_TAG_MODIFIED_KEY as le } from "./validators/useCouponBlockValidator.js";
23
- import { hasInsiderUnsubscribeCode as ue, EXTERNALLY_MANAGED_UNSUBSCRIBE_KEY as me, findDuplicateUnsubPageTypes as de, countUnsubBlocksWithoutPage as pe, EMPTY_BLOCK_KEY as ge } from "./validators/useUnsubscribeBlockValidator.js";
24
- const fe = "newsletter.html-content-is-empty", ye = "custom-fields.missing-closing-braces", Ee = "custom-fields.missing-opening-braces", S = "custom-fields.invalid-custom-fields", Ie = "newsletter.display-conditions-invalid-syntax", Se = "custom-conditions.wrong-equality-operators", _e = "custom-conditions.missing-if-endif-tag", Ce = "custom-conditions.no-space-after-braces", he = "custom-conditions.no-braces-inside-if-tag", ke = "newsletter.fill-all-necessary-fields", Te = "newsletter.invalid-image-type", Fe = "unsubscribe-templates.select-checkbox-groups", be = "unsubscribe-templates.select-radio-button-groups", F = "newsletter.invalid-url-link-for-toaster", b = "journey-builder.liquid-validation-failed", Re = "/newsletter/template-library/check-template-html-body", Le = /src="[^"]*\.(svg|pst)"/gm, L = /({%(.*?)%})/g, Ne = ["if", "endif", "else", "elif", "now"], Oe = (t) => !Ne.includes(t.toLowerCase()), Ae = (t) => ["if", "endif"].includes(t.toLowerCase());
25
- function De(t) {
26
- return ce(t).map((i) => ({
14
+ import { escapeHtml as Z } from "../utils/htmlEscape.js";
15
+ import { useTemplatePreparation as J } from "../utils/templatePreparation.js";
16
+ import { useActionsApi as ee } from "./useActionsApi.js";
17
+ import { useConfig as te } from "./useConfig.js";
18
+ import { useHtmlCompiler as ne } from "./useHtmlCompiler.js";
19
+ import { buildPartnerAttributeNameSet as ie, getInvalidDynamicContentTags as oe, getRecommendationBlockIds as re, findInvalidCustomFields as se } from "./useHtmlValidator.js";
20
+ import { useHttp as ae } from "./useHttp.js";
21
+ import { useTranslations as ce } from "./useTranslations.js";
22
+ import { findInvalidCouponBlocks as le, COUPON_TAG_MODIFIED_KEY as ue } from "./validators/useCouponBlockValidator.js";
23
+ import { hasInsiderUnsubscribeCode as me, EXTERNALLY_MANAGED_UNSUBSCRIBE_KEY as de, findDuplicateUnsubPageTypes as pe, countUnsubBlocksWithoutPage as ge, EMPTY_BLOCK_KEY as fe } from "./validators/useUnsubscribeBlockValidator.js";
24
+ const ye = "newsletter.html-content-is-empty", Ee = "custom-fields.missing-closing-braces", Ie = "custom-fields.missing-opening-braces", S = "custom-fields.invalid-custom-fields", Se = "newsletter.display-conditions-invalid-syntax", _e = "custom-conditions.wrong-equality-operators", Ce = "custom-conditions.missing-if-endif-tag", he = "custom-conditions.no-space-after-braces", ke = "custom-conditions.no-braces-inside-if-tag", Te = "newsletter.fill-all-necessary-fields", Fe = "newsletter.invalid-image-type", be = "unsubscribe-templates.select-checkbox-groups", Re = "unsubscribe-templates.select-radio-button-groups", F = "newsletter.invalid-url-link-for-toaster", b = "journey-builder.liquid-validation-failed", Ne = "/newsletter/template-library/check-template-html-body", Oe = /src="[^"]*\.(svg|pst)"/gm, N = /({%(.*?)%})/g, Le = ["if", "endif", "else", "elif", "now"], Ae = (t) => !Le.includes(t.toLowerCase()), De = (t) => ["if", "endif"].includes(t.toLowerCase());
25
+ function ve(t) {
26
+ return le(t).map((i) => ({
27
27
  rule: o.CouponTagModified,
28
28
  type: r.Warning,
29
- key: le,
29
+ key: ue,
30
30
  detail: i
31
31
  }));
32
32
  }
33
- function ve(t) {
34
- return de(t).map((i) => ({
33
+ function Ke(t) {
34
+ return pe(t).map((i) => ({
35
35
  rule: o.DuplicateUnsubBlock,
36
36
  type: r.Error,
37
37
  key: i.messageKey
38
38
  }));
39
39
  }
40
- function Ke(t) {
41
- return Array.from({ length: pe(t) }, () => ({
40
+ function Be(t) {
41
+ return Array.from({ length: ge(t) }, () => ({
42
42
  rule: o.UnsubBlockMissingTemplate,
43
43
  type: r.Warning,
44
- key: ge
44
+ key: fe
45
45
  }));
46
46
  }
47
- function Be(t) {
48
- return ue(t) ? [{
47
+ function we(t) {
48
+ return me(t) ? [{
49
49
  rule: o.ExternallyManagedUnsubscribe,
50
50
  type: r.Warning,
51
- key: me
51
+ key: de
52
52
  }] : [];
53
53
  }
54
- function we(t, i) {
55
- const n = t.match(L);
54
+ function Ye(t, i) {
55
+ const n = t.match(N);
56
56
  if (!n)
57
57
  return [];
58
58
  const u = [];
@@ -60,7 +60,7 @@ function we(t, i) {
60
60
  const c = m.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
61
61
  if (c && c.length > 0) {
62
62
  const [d] = c;
63
- Oe(d) && !i.includes(d) && u.push({
63
+ Ae(d) && !i.includes(d) && u.push({
64
64
  rule: o.CustomFieldScript,
65
65
  type: r.Warning,
66
66
  key: S,
@@ -69,32 +69,32 @@ function we(t, i) {
69
69
  }
70
70
  }), u;
71
71
  }
72
- function Ye(t) {
73
- return t.length > 0 ? [] : [{ rule: o.EmptyHtml, type: r.Warning, key: fe }];
74
- }
75
72
  function Ue(t) {
73
+ return t.length > 0 ? [] : [{ rule: o.EmptyHtml, type: r.Warning, key: ye }];
74
+ }
75
+ function Me(t) {
76
76
  const i = (t.match(/{/gm) || []).length, n = (t.match(/}/gm) || []).length;
77
77
  return i > n ? [{
78
78
  rule: o.MismatchedBraces,
79
79
  type: r.Warning,
80
- key: ye
80
+ key: Ee
81
81
  }] : i < n ? [{
82
82
  rule: o.MismatchedBraces,
83
83
  type: r.Warning,
84
- key: Ee
84
+ key: Ie
85
85
  }] : [];
86
86
  }
87
- function Me(t) {
88
- return ie(t).map((i) => ({
87
+ function xe(t) {
88
+ return oe(t).map((i) => ({
89
89
  rule: o.InvalidDynamicTag,
90
90
  type: r.Warning,
91
91
  key: S,
92
92
  detail: i
93
93
  }));
94
94
  }
95
- function xe(t, i, n, u) {
96
- const m = oe(t);
97
- return re(t, i, m, n, u).map((c) => ({
95
+ function Ge(t, i, n, u) {
96
+ const m = re(t);
97
+ return se(t, i, m, n, u).map((c) => ({
98
98
  rule: o.InvalidCustomField,
99
99
  type: r.Error,
100
100
  key: S,
@@ -102,21 +102,21 @@ function xe(t, i, n, u) {
102
102
  }));
103
103
  }
104
104
  function We(t) {
105
- const i = t.match(/{%(.*?)%}/g), n = [], u = [];
105
+ const i = t.match(U), n = [], u = [];
106
106
  if (i && i.forEach((m) => {
107
- const c = m.match(U), d = m.match(M), I = (c == null ? void 0 : c.join("")) || "";
107
+ const c = m.match(M), d = m.match(x), I = (c == null ? void 0 : c.join("")) || "";
108
108
  (!c || m !== I) && !d && u.push({
109
109
  rule: o.ConditionsSyntax,
110
110
  type: r.Error,
111
- key: Ie,
111
+ key: Se,
112
112
  detail: m
113
113
  }), c && c.forEach((g) => {
114
114
  g.trim() === "=" && u.push({
115
115
  rule: o.WrongEqualityOperator,
116
116
  type: r.Error,
117
- key: Se
117
+ key: _e
118
118
  }), (g.match(/^[a-zA-Z]*$/g) ?? []).forEach((f) => {
119
- Ae(f) && n.push(f);
119
+ De(f) && n.push(f);
120
120
  });
121
121
  });
122
122
  }), n.length) {
@@ -124,31 +124,31 @@ function We(t) {
124
124
  m !== c && u.push({
125
125
  rule: o.MissingIfEndif,
126
126
  type: r.Error,
127
- key: _e
127
+ key: Ce
128
128
  });
129
129
  }
130
130
  return u;
131
131
  }
132
- function Ge(t) {
132
+ function Pe(t) {
133
133
  const i = (t.match(/{% /gm) || []).length, n = (t.match(/ %}/gm) || []).length;
134
134
  return i === n ? [] : [{
135
135
  rule: o.ConditionTagSpacing,
136
136
  type: r.Warning,
137
- key: Ce
137
+ key: he
138
138
  }];
139
139
  }
140
- function Pe(t) {
141
- return (t.match(L) || []).filter((n) => n.includes("if")).map((n) => (n.match(/{{.*}}/gm) || []).length).reduce((n, u) => n + u, 0) === 0 ? [] : [{
140
+ function qe(t) {
141
+ return (t.match(N) || []).filter((n) => n.includes("if")).map((n) => (n.match(/{{.*}}/gm) || []).length).reduce((n, u) => n + u, 0) === 0 ? [] : [{
142
142
  rule: o.BracesInsideIfTag,
143
143
  type: r.Warning,
144
- key: he
144
+ key: ke
145
145
  }];
146
146
  }
147
- function qe(t) {
148
- return (t.match(Le) ?? []).map((i) => ({
147
+ function He(t) {
148
+ return (t.match(Oe) ?? []).map((i) => ({
149
149
  rule: o.InvalidImageType,
150
150
  type: r.Error,
151
- key: Te,
151
+ key: Fe,
152
152
  detail: i
153
153
  }));
154
154
  }
@@ -159,12 +159,12 @@ function R(t, i, n, u) {
159
159
  return !((d = c.id) != null && d.trim());
160
160
  }).map(() => ({ rule: n, type: r.Error, key: u }));
161
161
  }
162
- const ft = () => {
163
- const { config: t, isFeatureEnabled: i } = ee(), n = ae(), { post: u } = se(), { getCompiledEmail: m, getTemplateData: c } = J(), { compileHtml: d } = te(), { hydrateRecommendationStore: I } = Z(), g = z(), f = $(), y = P(), N = j(), O = (e) => ({
162
+ const yt = () => {
163
+ const { config: t, isFeatureEnabled: i } = te(), n = ce(), { post: u } = ae(), { getCompiledEmail: m, getTemplateData: c } = ee(), { compileHtml: d } = ne(), { hydrateRecommendationStore: I } = J(), g = $(), f = Q(), y = q(), O = z(), L = (e) => ({
164
164
  rule: e.rule,
165
165
  type: e.type,
166
166
  detail: e.detail,
167
- message: "key" in e ? n(e.key) : Q(e.message)
167
+ message: "key" in e ? n(e.key) : Z(e.message)
168
168
  }), A = async (e) => {
169
169
  if (e.size === 0)
170
170
  return /* @__PURE__ */ new Set();
@@ -173,10 +173,10 @@ const ft = () => {
173
173
  } catch {
174
174
  return null;
175
175
  }
176
- return ne(y.filterList);
176
+ return ie(y.filterList);
177
177
  }, D = async (e) => {
178
178
  try {
179
- const a = await u(Re, { html: T(e) }), { status: s, message: l } = a.data, p = [], E = s === void 0 && !!l && l !== n(F);
179
+ const a = await u(Ne, { html: T(e) }), { status: s, message: l } = a.data, p = [], E = s === void 0 && !!l && l !== n(F);
180
180
  return s || p.push({
181
181
  rule: o.InvalidLinks,
182
182
  type: r.Error,
@@ -225,17 +225,17 @@ const ft = () => {
225
225
  }];
226
226
  }
227
227
  }, K = () => {
228
- const e = Object.values(y.blockStates).map((s) => q(s.recommendationConfigs, y)).filter((s) => s.length > 0).map((s) => {
229
- const l = s.every((p) => p === H);
228
+ const e = Object.values(y.blockStates).map((s) => H(s.recommendationConfigs, y)).filter((s) => s.length > 0).map((s) => {
229
+ const l = s.every((p) => p === V);
230
230
  return {
231
231
  rule: o.RecommendationRequiredFields,
232
232
  type: l ? r.Warning : r.Error,
233
- key: l ? V : X
233
+ key: l ? X : j
234
234
  };
235
235
  }), a = (f.recommendationConfigs ?? []).filter((s) => s.filters.some((l) => l.value === "")).map(() => ({
236
236
  rule: o.RecommendationFilters,
237
237
  type: r.Error,
238
- key: ke
238
+ key: Te
239
239
  }));
240
240
  return [...e, ...a];
241
241
  }, B = async (e, a) => {
@@ -244,39 +244,39 @@ const ft = () => {
244
244
  ...a.map((w) => w.value),
245
245
  ...W,
246
246
  ...((h = (C = t.value) == null ? void 0 : C.template) == null ? void 0 : h.customFieldAttributes) ?? []
247
- ], l = Y(e), p = await A(l), { isTransactional: E } = N;
247
+ ], l = Y(e), p = await A(l), { isTransactional: E } = O;
248
248
  return [
249
249
  ...await D(e),
250
- ...E ? [] : we(e, s),
251
- ...Ye(e),
250
+ ...E ? [] : Ye(e, s),
252
251
  ...Ue(e),
253
252
  ...Me(e),
254
- ...E ? [] : xe(e, s, l, p),
253
+ ...xe(e),
254
+ ...E ? [] : Ge(e, s, l, p),
255
255
  ...We(e),
256
- ...Ge(e),
257
256
  ...Pe(e),
258
- ...K(),
259
257
  ...qe(e),
258
+ ...K(),
259
+ ...He(e),
260
260
  ...R(
261
261
  e,
262
- x,
262
+ G,
263
263
  o.CheckboxUnsubGroup,
264
- Fe
264
+ be
265
265
  ),
266
266
  ...R(
267
267
  e,
268
- G,
268
+ P,
269
269
  o.RadioButtonUnsubGroup,
270
- be
270
+ Re
271
271
  )
272
272
  ];
273
273
  }, _ = async (e, a, s) => [
274
- ...De(e),
275
- ...i("blockUnsubscribeLinks") ? Be(s) : [],
276
274
  ...ve(e),
275
+ ...i("blockUnsubscribeLinks") ? we(s) : [],
277
276
  ...Ke(e),
277
+ ...Be(e),
278
278
  ...i("liquidSyntax") ? await v(e) : await B(e, a)
279
- ].map(O);
279
+ ].map(L);
280
280
  return { collectSaveValidationErrors: _, validateCurrentTemplate: async () => {
281
281
  const { html: e } = await c();
282
282
  await I(e);
@@ -285,5 +285,5 @@ const ft = () => {
285
285
  } };
286
286
  };
287
287
  export {
288
- ft as useSaveValidation
288
+ yt as useSaveValidation
289
289
  };
@@ -1,51 +1,52 @@
1
- import { useActionsApi as N } from "./useActionsApi.js";
2
- import { useBlocksConfig as j } from "./useBlocksConfig.js";
3
- import { useConfig as z } from "./useConfig.js";
1
+ import { useActionsApi as j } from "./useActionsApi.js";
2
+ import { useAmbiguousDynamicContent as z } from "./useAmbiguousDynamicContent.js";
3
+ import { useBlocksConfig as $ } from "./useBlocksConfig.js";
4
+ import { useConfig as G } from "./useConfig.js";
4
5
  import { useCustomInterfaceAppearance as v } from "./useCustomInterfaceAppearance.js";
5
- import { useFullStoryBridge as $ } from "./useFullStoryBridge.js";
6
- import { useModuleRepair as G } from "./useModuleRepair.js";
7
- import { useStripoEventHandler as X } from "./useStripoEventHandler.js";
8
- import { useStripoNotifications as J } from "./useStripoNotifications.js";
9
- import { useToaster as K } from "./useToaster.js";
10
- import { localePatch as Q } from "../config/i18n/index.js";
6
+ import { useFullStoryBridge as X } from "./useFullStoryBridge.js";
7
+ import { useModuleRepair as J } from "./useModuleRepair.js";
8
+ import { useStripoEventHandler as K } from "./useStripoEventHandler.js";
9
+ import { useStripoNotifications as Q } from "./useStripoNotifications.js";
10
+ import { useToaster as W } from "./useToaster.js";
11
+ import { localePatch as Y } from "../config/i18n/index.js";
11
12
  import { en as B } from "../config/i18n/en/index.js";
12
- import { ToasterTypeOptions as W } from "../enums/toaster.js";
13
- import { useStripoApi as Y } from "../services/stripoApi.js";
14
- import Z from "../static/styles/customEditorStyle.css.js";
13
+ import { ToasterTypeOptions as Z } from "../enums/toaster.js";
14
+ import { useStripoApi as ee } from "../services/stripoApi.js";
15
+ import te from "../static/styles/customEditorStyle.css.js";
15
16
  import { useEditorStore as T } from "../stores/editor.js";
16
- import { buildMergeTagEntries as ee, flattenDynamicContentList as te } from "../utils/genericUtil.js";
17
- import { getStripoRuntimeBaseUrl as oe } from "../utils/stripoRuntime.js";
17
+ import { buildMergeTagEntries as oe, flattenDynamicContentList as re } from "../utils/genericUtil.js";
18
+ import { getStripoRuntimeBaseUrl as ie } from "../utils/stripoRuntime.js";
18
19
  let d = null, F = !1;
19
- const ke = (t) => {
20
- const { features: u, template: m, isFeatureEnabled: p } = z(), { handleError: f, showToaster: A } = K(), { getToken: P, getCustomFonts: R, getSyncModulesStatus: U } = Y(), { handleEvent: V } = X(), { handleModuleAdd: D } = G(), { getStripoBlocksConfig: I } = j(), { getStripoNotifications: L } = J(), g = () => d || (d = new Promise((n, a) => {
20
+ const ve = (t) => {
21
+ const { features: u, template: m, isFeatureEnabled: p } = G(), { handleError: f, showToaster: A } = W(), { getToken: P, getCustomFonts: R, getSyncModulesStatus: D } = ee(), { handleEvent: U } = K(), { handleModuleAdd: V } = J(), { restorePending: I } = z(), { getStripoBlocksConfig: L } = $(), { getStripoNotifications: q } = Q(), g = () => d || (d = new Promise((n, s) => {
21
22
  if (document.getElementById("UiEditorScript")) {
22
23
  n();
23
24
  return;
24
25
  }
25
- const i = oe();
26
+ const i = ie();
26
27
  if (!i) {
27
- a(
28
+ s(
28
29
  new Error("guido.stripo.version is not set in package.json. Please configure the Stripo version.")
29
30
  );
30
31
  return;
31
32
  }
32
- const s = `${i}UIEditor.js`, e = document.createElement("script");
33
- e.id = "UiEditorScript", e.type = "module", e.src = s, e.onload = () => {
33
+ const a = `${i}UIEditor.js`, e = document.createElement("script");
34
+ e.id = "UiEditorScript", e.type = "module", e.src = a, e.onload = () => {
34
35
  F = !0, n();
35
36
  }, e.onerror = () => {
36
- e.remove(), a(new Error(`Failed to load Stripo UIEditor script from S3: ${s}`));
37
+ e.remove(), s(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
37
38
  }, document.body.appendChild(e);
38
39
  }), d.catch(() => {
39
40
  d = null;
40
- }), d), q = async (n, a, i, s = [], e = !1, c = !1) => {
41
+ }), d), x = async (n, s, i, a = [], e = !1, c = !1) => {
41
42
  var w, k, b, _;
42
- const o = T(), { html: S, css: y } = n, { baseBlocks: E, extensions: x } = await I();
43
+ const o = T(), { html: S, css: y } = n, { baseBlocks: E, extensions: O } = await L();
43
44
  t.mark("blocks_config_ready");
44
- const h = ((w = u.value) == null ? void 0 : w.displayConditions) ?? !0, O = ((k = u.value) == null ? void 0 : k.modulesDisabled) ?? !1, C = c || (((b = m.value) == null ? void 0 : b.forceRecreate) ?? !1), H = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
45
+ const h = ((w = u.value) == null ? void 0 : w.displayConditions) ?? !0, H = ((k = u.value) == null ? void 0 : k.modulesDisabled) ?? !1, C = c || (((b = m.value) == null ? void 0 : b.forceRecreate) ?? !1), M = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
45
46
  t.setTemplate({ html: S, css: y, forceRecreate: C }), v().importCss(), t.mark("init_editor"), await window.UIEditor.initEditor(
46
47
  document.querySelector("#guido-editor"),
47
48
  {
48
- metadata: a,
49
+ metadata: s,
49
50
  html: S,
50
51
  css: y,
51
52
  forceRecreate: C,
@@ -58,11 +59,11 @@ const ke = (t) => {
58
59
  customAppearanceMergetags: !p("liquidSyntax"),
59
60
  customAppearanceMergetagsBorderColor: "#f1f3fe",
60
61
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
61
- customViewStyles: Z,
62
+ customViewStyles: te,
62
63
  conditionsEnabled: h,
63
64
  customConditionsEnabled: h,
64
65
  enableXSSSecurity: !0,
65
- modulesDisabled: O,
66
+ modulesDisabled: H,
66
67
  syncModulesEnabled: e,
67
68
  messageSettingsEnabled: !0,
68
69
  displayGmailAnnotations: !0,
@@ -73,18 +74,18 @@ const ke = (t) => {
73
74
  copyPasteEnabled: !1,
74
75
  selectElementAfterDrop: !0,
75
76
  sameFontSizeForOutlook: !0,
76
- allowedScriptSourceDomains: H,
77
+ allowedScriptSourceDomains: M,
77
78
  ...E ? { baseBlocks: E } : {},
78
79
  editorFonts: {
79
80
  showDefaultStandardFonts: !0,
80
81
  showDefaultNotStandardFonts: !0,
81
- customFonts: s
82
+ customFonts: a
82
83
  },
83
84
  mergeTags: [
84
85
  {
85
- entries: ee(
86
+ entries: oe(
86
87
  i.preselectedDynamicContentList,
87
- te((_ = m.value) == null ? void 0 : _.dynamicContentList),
88
+ re((_ = m.value) == null ? void 0 : _.dynamicContentList),
88
89
  p("liquidSyntax")
89
90
  )
90
91
  }
@@ -100,8 +101,8 @@ const ke = (t) => {
100
101
  },
101
102
  onTemplateLoaded() {
102
103
  try {
103
- const { activateCustomViewStyles: r, updateTimerInClonedTemplate: l } = N(), { injectFullStory: M } = $();
104
- v().importCss(), r(), M(), l(), i.onReady(), o.isStripoInitialized = !0, o.loadingStatus = !1, setTimeout(() => {
104
+ const { activateCustomViewStyles: r, updateTimerInClonedTemplate: l } = j(), { injectFullStory: N } = X();
105
+ v().importCss(), r(), N(), I(), l(), i.onReady(), o.isStripoInitialized = !0, o.loadingStatus = !1, setTimeout(() => {
105
106
  o.hasChanges = !1;
106
107
  }, 1e3), t.markReady();
107
108
  } catch (r) {
@@ -120,9 +121,9 @@ const ke = (t) => {
120
121
  onDataChanged() {
121
122
  o.hasChanges = !0, o.changeSeq += 1;
122
123
  },
123
- onEvent: V,
124
- onModuleAdd: D,
125
- notifications: L(),
124
+ onEvent: U,
125
+ onModuleAdd: V,
126
+ notifications: q(),
126
127
  // Stripo deselects the block on any click outside the canvas, so every surface
127
128
  // that belongs to the block's own flow has to be listed here (SD-153273).
128
129
  ignoreClickOutsideSelectors: [
@@ -132,23 +133,23 @@ const ke = (t) => {
132
133
  ".in-modal-v2-wrapper",
133
134
  ".in-toasts-wrapper"
134
135
  ],
135
- extensions: x,
136
- localePatch: Q
136
+ extensions: O,
137
+ localePatch: Y
137
138
  }
138
139
  );
139
140
  };
140
- return { initPlugin: async (n, a, i, s = !1) => {
141
+ return { initPlugin: async (n, s, i, a = !1) => {
141
142
  const e = T();
142
143
  try {
143
144
  t.mark("plugin_start"), t.setScriptPreloaded(F), await g(), t.mark("script_ready");
144
145
  const [c, o] = await Promise.all([
145
146
  R(),
146
- U()
147
+ D()
147
148
  ]);
148
- t.mark("fonts_sync_ready"), e.syncModulesEnabled = o, await q(n, a, i, c, o, s);
149
+ t.mark("fonts_sync_ready"), e.syncModulesEnabled = o, await x(n, s, i, c, o, a);
149
150
  } catch {
150
151
  e.loadingStatus = !1, A({
151
- type: W.Error,
152
+ type: Z.Error,
152
153
  message: B["An error has occurred. Please report the error code to support."],
153
154
  actionButton: {
154
155
  text: B["Reload page"],
@@ -162,5 +163,5 @@ const ke = (t) => {
162
163
  } };
163
164
  };
164
165
  export {
165
- ke as useStripo
166
+ ve as useStripo
166
167
  };
@@ -1,6 +1,7 @@
1
- import { stripFontTags as c } from "../../utils/stripFontTags.js";
2
- import { trimHrefWhitespace as l } from "../../utils/trimHrefWhitespace.js";
3
- const f = [
1
+ import { PENDING_MARKER_PATTERN as c } from "../../utils/dynamicContentPendingMarker.js";
2
+ import { stripFontTags as l } from "../../utils/stripFontTags.js";
3
+ import { trimHrefWhitespace as d } from "../../utils/trimHrefWhitespace.js";
4
+ const y = [
4
5
  {
5
6
  id: "fix-url-encoding-start",
6
7
  description: "Replace {%22 with %7B%22 to fix URL encoding",
@@ -59,14 +60,14 @@ const f = [
59
60
  id: "strip-font-tags",
60
61
  description: 'Unwrap browser-translate-injected <font dir="auto"> tags, keeping inner content; other <font> elements are left intact.',
61
62
  type: "custom",
62
- processor: (e) => c(e),
63
+ processor: (e) => l(e),
63
64
  priority: 15
64
65
  },
65
66
  {
66
67
  id: "trim-href-whitespace",
67
68
  description: "Trim leading/trailing whitespace and &nbsp; from every href value",
68
69
  type: "custom",
69
- processor: (e) => l(e),
70
+ processor: (e) => d(e),
70
71
  priority: 16
71
72
  },
72
73
  {
@@ -183,6 +184,15 @@ const f = [
183
184
  flags: "g",
184
185
  priority: 45
185
186
  },
187
+ {
188
+ id: "remove-dc-pending-marker",
189
+ description: "Strip the editor-only pending dynamic-content choice marker from compiled output",
190
+ type: "regex",
191
+ pattern: c,
192
+ replacement: "",
193
+ flags: "g",
194
+ priority: 46
195
+ },
186
196
  {
187
197
  id: "remove-script-tags",
188
198
  // SD-145051: parity with HB HtmlCleaner.removeUnsafeHtmlTags — strip <script> from
@@ -208,5 +218,5 @@ const f = [
208
218
  }
209
219
  ];
210
220
  export {
211
- f as defaultHtmlCompilerRules
221
+ y as defaultHtmlCompilerRules
212
222
  };
@@ -0,0 +1,13 @@
1
+ import { CONDITION_TAG_REGEX as s } from "../../enums/html-validator.js";
2
+ const r = /[^\S\r\n\u2028\u2029]*[\r\n\u2028\u2029]+\s*/g, i = [
3
+ {
4
+ id: "pongo-single-line-tags",
5
+ description: "Collapse line breaks inside {% %} tags to a space",
6
+ type: "custom",
7
+ processor: (e) => e.replace(s, (o) => o.replace(r, " ")),
8
+ priority: 50
9
+ }
10
+ ];
11
+ export {
12
+ i as pongoCompilerRules
13
+ };