@useinsider/guido 3.16.0-beta.cbe0707 → 3.16.0-beta.d7c8e2a

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 (45) hide show
  1. package/dist/components/Guido.vue.js +8 -8
  2. package/dist/components/Guido.vue2.js +76 -78
  3. package/dist/components/organisms/AutoSaveController.vue2.js +8 -9
  4. package/dist/components/organisms/header/EditorActions.vue.js +2 -2
  5. package/dist/components/organisms/header/EditorActions.vue2.js +43 -74
  6. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  7. package/dist/components/organisms/header/LeftSlot.vue2.js +23 -45
  8. package/dist/components/wrappers/WpDrawer.vue.js +7 -9
  9. package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
  10. package/dist/composables/useHtmlValidator.js +0 -1
  11. package/dist/composables/useSave.js +41 -84
  12. package/dist/composables/validators/useCouponBlockValidator.js +21 -24
  13. package/dist/composables/validators/useUnsubscribeBlockValidator.js +27 -34
  14. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +24 -31
  15. package/dist/guido.css +1 -1
  16. package/dist/src/components/Guido.vue.d.ts +1 -17
  17. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -17
  18. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -17
  19. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -17
  20. package/dist/src/components/wrappers/WpDrawer.vue.d.ts +3 -4
  21. package/dist/src/composables/useHtmlValidator.d.ts +0 -14
  22. package/dist/src/composables/useSave.d.ts +1 -6
  23. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +0 -3
  24. package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +0 -10
  25. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -5
  26. package/dist/src/stores/config.d.ts +0 -5
  27. package/dist/src/utils/dynamicContentFormat.d.ts +33 -0
  28. package/dist/src/utils/templatePreparation.d.ts +0 -30
  29. package/dist/stores/config.js +6 -13
  30. package/dist/utils/dynamicContentFormat.js +35 -0
  31. package/dist/utils/genericUtil.js +43 -49
  32. package/dist/utils/templatePreparation.js +25 -28
  33. package/package.json +1 -1
  34. package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +0 -20
  35. package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +0 -61
  36. package/dist/composables/useSaveValidation.js +0 -276
  37. package/dist/composables/useSaveValidationRollout.js +0 -9
  38. package/dist/enums/save-validation.js +0 -4
  39. package/dist/src/@types/save-validation.d.ts +0 -19
  40. package/dist/src/components/organisms/validation/ValidationErrorDrawer.vue.d.ts +0 -2
  41. package/dist/src/composables/useSaveValidation.d.ts +0 -6
  42. package/dist/src/composables/useSaveValidationRollout.d.ts +0 -3
  43. package/dist/src/enums/save-validation.d.ts +0 -27
  44. package/dist/src/stores/save-validation.d.ts +0 -22
  45. package/dist/stores/save-validation.js +0 -30
@@ -221,7 +221,6 @@ const De = () => {
221
221
  export {
222
222
  de as buildPartnerAttributeNameSet,
223
223
  fe as findInvalidCustomFields,
224
- pe as getInvalidDynamicContentTags,
225
224
  ue as parseRecommendationVariable,
226
225
  De as useHtmlValidator
227
226
  };
@@ -1,94 +1,51 @@
1
- import { useActionsApi as h } from "./useActionsApi.js";
2
- import { useConfig as L } from "./useConfig.js";
3
- import { useSaveStart as A, useSaveComplete as q } from "./useGuidoActions.js";
4
- import { useSaveValidation as M } from "./useSaveValidation.js";
5
- import { useSaveValidationRollout as R } from "./useSaveValidationRollout.js";
6
- import { useSyncModuleExtractor as O } from "./useSyncModuleExtractor.js";
7
- import { ToasterTypeOptions as W } from "../enums/toaster.js";
1
+ import { useActionsApi as T } from "./useActionsApi.js";
2
+ import { useConfig as k } from "./useConfig.js";
3
+ import { useSaveStart as B, useSaveComplete as E } from "./useGuidoActions.js";
4
+ import { useSyncModuleExtractor as q } from "./useSyncModuleExtractor.js";
5
+ import { ToasterTypeOptions as C } from "../enums/toaster.js";
8
6
  import { useStripoApi as D } from "../services/stripoApi.js";
9
- import { useConfigStore as F } from "../stores/config.js";
10
- import { useDynamicContentStore as j } from "../stores/dynamic-content.js";
11
- import { useSaveValidationStore as z } from "../stores/save-validation.js";
12
- import { useTemplatePreparation as G, getHtmlReferencedUnsubscribePages as I } from "../utils/templatePreparation.js";
13
- import { useAllowlist as J } from "./useAllowlist.js";
14
- import { useHtmlValidator as K } from "./useHtmlValidator.js";
15
- import { useToaster as N } from "./useToaster.js";
16
- import { useCouponBlockValidator as Q } from "./validators/useCouponBlockValidator.js";
17
- import { useLiquidValidator as X } from "./validators/useLiquidValidator.js";
18
- import { useUnsubscribeBlockValidator as Y } from "./validators/useUnsubscribeBlockValidator.js";
19
- const bt = () => {
20
- const n = A(), d = q(), { validateHtml: u } = K(), { validateLiquidSyntax: f } = X(), { validateCouponBlockTags: p } = Q(), { validateUnsubscribeBlockUniqueness: v, validateUnsubscribeBlockHasTemplate: y } = Y(), { callbacks: a, isFeatureEnabled: c } = L(), { extractSyncModuleData: S } = O(), { setSyncModuleUnsubscriptionPages: b } = D(), { editorSave: g, getTemplateData: w } = h(), { showToaster: H } = N(), { getBlockedDomains: V, resolveToast: C } = J(), { prepareTemplateDetails: m } = G(), { collectSaveValidationErrors: E } = M(), { isEnabled: x } = R(), k = z(), T = j(), B = F(), r = async (t, e, o) => {
21
- if (!c("allowlistEnabled"))
22
- return !1;
23
- const i = await V(t, e);
24
- if (!i.length)
25
- return !1;
26
- if (!o) {
27
- const s = await C(i);
28
- s != null && s.message && H({
29
- type: W.Warning,
30
- message: s.message,
31
- actionButton: s.actionButton
32
- });
33
- }
34
- return !0;
35
- }, P = async (t) => !p(t.compiledHtml) || !v(t.compiledHtml) || !y(t.compiledHtml) ? !1 : c("liquidSyntax") ? f(t.compiledHtml) : u(t.compiledHtml, t.dynamicContentList, !0), l = async (t, e) => {
36
- if (!await g())
37
- return;
38
- const { unsubscribePayload: i, stripoModules: s } = S(t.rawHtml);
39
- if (await b(i), t.modules = s, !e.suppress) {
40
- const U = e.blankCompiled ? { compiledHtml: "", ampHtml: "" } : {};
41
- d({ ...t, ...U, silent: e.silent });
42
- }
43
- return t;
44
- };
45
- return { save: async (t = !1, e = !1) => {
46
- var i;
7
+ import { useTemplatePreparation as L } from "../utils/templatePreparation.js";
8
+ import { useAllowlist as P } from "./useAllowlist.js";
9
+ import { useHtmlValidator as U } from "./useHtmlValidator.js";
10
+ import { useToaster as A } from "./useToaster.js";
11
+ import { useCouponBlockValidator as M } from "./validators/useCouponBlockValidator.js";
12
+ import { useLiquidValidator as h } from "./validators/useLiquidValidator.js";
13
+ import { useUnsubscribeBlockValidator as F } from "./validators/useUnsubscribeBlockValidator.js";
14
+ const $ = () => {
15
+ const n = B(), l = E(), { validateHtml: c } = U(), { validateLiquidSyntax: d } = h(), { validateCouponBlockTags: m } = M(), { validateUnsubscribeBlockUniqueness: u, validateUnsubscribeBlockHasTemplate: p } = F(), { callbacks: e, isFeatureEnabled: a } = k(), { extractSyncModuleData: f } = q(), { setSyncModuleUnsubscriptionPages: v } = D(), { editorSave: S } = T(), { showToaster: b } = A(), { getBlockedDomains: w, resolveToast: V } = P();
16
+ return { save: async (y = !1, s = !1) => {
17
+ var r;
47
18
  n();
48
- const o = await m();
49
- if (x.value && !t && !e) {
50
- const s = await E(
51
- o.compiledHtml,
52
- o.dynamicContentList
53
- );
54
- if (s.length) {
55
- k.open(s, "save");
19
+ const { prepareTemplateDetails: H } = L(), t = await H();
20
+ if (!m(t.compiledHtml) || !u(t.compiledHtml) || !p(t.compiledHtml))
21
+ return;
22
+ if (a("liquidSyntax")) {
23
+ if (!await d(t.compiledHtml))
56
24
  return;
57
- }
58
- } else if (!await P(o))
25
+ } else if (!await c(t.compiledHtml, t.dynamicContentList, !0))
59
26
  return;
60
- if (!((i = a.value) != null && i.externalValidation && !await a.value.externalValidation(o)) && !await r(o.compiledHtml, o.css, e))
61
- return l(o, { silent: e, suppress: t });
62
- }, saveWithErrors: async () => {
63
- var e;
64
- if (B.isTransactional)
27
+ if ((r = e.value) != null && r.externalValidation && !await e.value.externalValidation(t))
65
28
  return;
66
- n();
67
- const t = await m();
68
- if (!((e = a.value) != null && e.externalValidation && !await a.value.externalValidation(t)) && !await r(t.compiledHtml, t.css, !1))
69
- return l(t, { silent: !1, blankCompiled: !0 });
70
- }, saveRawOnly: async () => {
71
- n();
72
- const { html: t, css: e } = await w();
73
- if (await r(t, e, !0))
74
- return;
75
- const o = I(t), i = {
76
- dynamicContentList: T.getSelectedDynamicContentList,
77
- compiledHtml: "",
78
- rawHtml: t,
79
- css: e,
80
- ampHtml: "",
81
- ampErrors: [],
82
- modules: [],
83
- recommendation: { campaignUrls: {}, configs: {} },
84
- unsubscribe: {
85
- status: o.length > 0,
86
- config: o
29
+ if (a("allowlistEnabled")) {
30
+ const i = await w(t.compiledHtml, t.css);
31
+ if (i.length) {
32
+ if (!s) {
33
+ const o = await V(i);
34
+ o != null && o.message && b({
35
+ type: C.Warning,
36
+ message: o.message,
37
+ actionButton: o.actionButton
38
+ });
39
+ }
40
+ return;
87
41
  }
88
- };
89
- return l(i, { silent: !0 });
42
+ }
43
+ if (!await S())
44
+ return;
45
+ const { unsubscribePayload: g, stripoModules: x } = f(t.rawHtml);
46
+ return await v(g), t.modules = x, y || l({ ...t, silent: s }), t;
90
47
  } };
91
48
  };
92
49
  export {
93
- bt as useSave
50
+ $ as useSave
94
51
  };
@@ -1,27 +1,24 @@
1
- import { ToasterTypeOptions as n } from "../../enums/toaster.js";
2
- import { COUPON_PLACEHOLDER_DEFAULT as s, COUPON_PLACEHOLDER_LIQUID as a } from "../../extensions/Blocks/CouponBlock/template.js";
3
- import { useToaster as i } from "../useToaster.js";
4
- import { useTranslations as l } from "../useTranslations.js";
5
- const c = /* @__PURE__ */ new Set([
6
- s,
7
- a
8
- ]), p = "newsletter.coupon-tag-modified";
9
- function u(r) {
10
- const e = new DOMParser().parseFromString(r, "text/html");
11
- return Array.from(e.querySelectorAll(".coupon-block")).map((o) => {
12
- var t;
13
- return ((t = o.textContent) == null ? void 0 : t.trim()) ?? "";
14
- }).filter((o) => !c.has(o));
15
- }
16
- const T = () => {
17
- const { showToaster: r } = i(), e = l();
18
- return { validateCouponBlockTags: (t) => u(t).length > 0 ? (r({
19
- type: n.Warning,
20
- message: e(p)
21
- }), !1) : !0 };
1
+ import { ToasterTypeOptions as c } from "../../enums/toaster.js";
2
+ import { COUPON_PLACEHOLDER_DEFAULT as i, COUPON_PLACEHOLDER_LIQUID as l } from "../../extensions/Blocks/CouponBlock/template.js";
3
+ import { useToaster as m } from "../useToaster.js";
4
+ import { useTranslations as p } from "../useTranslations.js";
5
+ const u = /* @__PURE__ */ new Set([
6
+ i,
7
+ l
8
+ ]), A = () => {
9
+ const { showToaster: t } = m(), r = p();
10
+ return { validateCouponBlockTags: (e) => {
11
+ const n = new DOMParser().parseFromString(e, "text/html");
12
+ return Array.from(n.querySelectorAll(".coupon-block")).find((s) => {
13
+ var o;
14
+ const a = ((o = s.textContent) == null ? void 0 : o.trim()) ?? "";
15
+ return !u.has(a);
16
+ }) ? (t({
17
+ type: c.Warning,
18
+ message: r("newsletter.coupon-tag-modified")
19
+ }), !1) : !0;
20
+ } };
22
21
  };
23
22
  export {
24
- p as COUPON_TAG_MODIFIED_KEY,
25
- u as findInvalidCouponBlocks,
26
- T as useCouponBlockValidator
23
+ A as useCouponBlockValidator
27
24
  };
@@ -1,8 +1,8 @@
1
- import { ToasterTypeOptions as c } from "../../enums/toaster.js";
1
+ import { ToasterTypeOptions as i } from "../../enums/toaster.js";
2
2
  import { PAGE_TYPES as u } from "../../enums/unsubscribe.js";
3
- import { UNSUBSCRIBE_BLOCK_SELECTOR as i, DATA_ATTRIBUTES as a } from "../../extensions/Blocks/Unsubscribe/utils/constants.js";
4
- import { useToaster as p } from "../useToaster.js";
5
- import { useTranslations as l } from "../useTranslations.js";
3
+ import { UNSUBSCRIBE_BLOCK_SELECTOR as l, DATA_ATTRIBUTES as a } from "../../extensions/Blocks/Unsubscribe/utils/constants.js";
4
+ import { useToaster as E } from "../useToaster.js";
5
+ import { useTranslations as m } from "../useTranslations.js";
6
6
  const T = [
7
7
  {
8
8
  pageType: u.GLOBAL_UNSUBSCRIBE,
@@ -12,37 +12,30 @@ const T = [
12
12
  pageType: u.SUBSCRIPTION_PREFERENCE_CENTER,
13
13
  messageKey: "unsubscription-preference.duplicate-pref-center"
14
14
  }
15
- ], g = "unsubscription-preference.duplicate-both", E = "unsubscription-preference.select-page-to-continue";
16
- function m(r) {
17
- const s = new DOMParser().parseFromString(r, "text/html"), t = /* @__PURE__ */ new Map();
18
- return s.querySelectorAll(i).forEach((n) => {
19
- const e = Number(n.getAttribute(a.PAGE_TYPE));
20
- t.set(e, (t.get(e) ?? 0) + 1);
21
- }), T.filter((n) => (t.get(n.pageType) ?? 0) > 1);
22
- }
23
- function b(r) {
24
- const s = new DOMParser().parseFromString(r, "text/html");
25
- return Array.from(s.querySelectorAll(i)).filter((t) => {
26
- const n = t.getAttribute(a.PAGE_TYPE), e = t.getAttribute(a.PAGE_LIST);
27
- return !n || !e;
28
- }).length;
29
- }
30
- const y = () => {
31
- const { showToaster: r } = p(), s = l();
32
- return { validateUnsubscribeBlockUniqueness: (e) => {
33
- const o = m(e);
34
- return o.length ? (r({
35
- type: c.Error,
36
- message: s(o.length > 1 ? g : o[0].messageKey)
15
+ ], g = "unsubscription-preference.duplicate-both", b = "unsubscription-preference.select-page-to-continue", P = () => {
16
+ const { showToaster: c } = E(), p = m();
17
+ return { validateUnsubscribeBlockUniqueness: (n) => {
18
+ const o = new DOMParser().parseFromString(n, "text/html"), r = /* @__PURE__ */ new Map();
19
+ o.querySelectorAll(l).forEach((e) => {
20
+ const s = Number(e.getAttribute(a.PAGE_TYPE));
21
+ r.set(s, (r.get(s) ?? 0) + 1);
22
+ });
23
+ const t = T.filter((e) => (r.get(e.pageType) ?? 0) > 1).map((e) => e.messageKey);
24
+ return t.length ? (c({
25
+ type: i.Error,
26
+ message: p(t.length > 1 ? g : t[0])
37
27
  }), !1) : !0;
38
- }, validateUnsubscribeBlockHasTemplate: (e) => b(e) === 0 ? !0 : (r({
39
- type: c.Warning,
40
- message: s(E)
41
- }), !1) };
28
+ }, validateUnsubscribeBlockHasTemplate: (n) => {
29
+ const o = new DOMParser().parseFromString(n, "text/html");
30
+ return Array.from(o.querySelectorAll(l)).some((t) => {
31
+ const e = t.getAttribute(a.PAGE_TYPE), s = t.getAttribute(a.PAGE_LIST);
32
+ return !e || !s;
33
+ }) ? (c({
34
+ type: i.Warning,
35
+ message: p(b)
36
+ }), !1) : !0;
37
+ } };
42
38
  };
43
39
  export {
44
- E as EMPTY_BLOCK_KEY,
45
- b as countUnsubBlocksWithoutPage,
46
- m as findDuplicateUnsubPageTypes,
47
- y as useUnsubscribeBlockValidator
40
+ P as useUnsubscribeBlockValidator
48
41
  };
@@ -1,20 +1,20 @@
1
- import { getRecommendationFeedSourceMaps as g, getOperatorOptions as C, PriceAttributes as y } from "../../../../enums/extensions/recommendationBlock.js";
2
- import { useRecommendationApi as G } from "../../../../services/recommendationApi.js";
3
- import { useConfigStore as F } from "../../../../stores/config.js";
4
- import { defineStore as P } from "pinia";
1
+ import { getRecommendationFeedSourceMaps as g, getOperatorOptions as R, PriceAttributes as C } from "../../../../enums/extensions/recommendationBlock.js";
2
+ import { useRecommendationApi as y } from "../../../../services/recommendationApi.js";
3
+ import { useConfigStore as G } from "../../../../stores/config.js";
4
+ import { defineStore as F } from "pinia";
5
5
  import "../constants/selectors.js";
6
- import { DEFAULT_MOBILE_CARDS_IN_ROW as D, DEFAULT_CARDS_IN_ROW as v } from "../constants/layout.js";
6
+ import { DEFAULT_MOBILE_CARDS_IN_ROW as P, DEFAULT_CARDS_IN_ROW as D } from "../constants/layout.js";
7
7
  import { EXCLUDED_ALGORITHM_IDS as w } from "../constants/defaultConfig.js";
8
8
  import { getDefaultProducts as S } from "../templates/utils.js";
9
9
  import { generateCompleteFilterQuery as b } from "../utils/filterUtil.js";
10
- import { getPartnerRecommendationParams as N } from "../utils/partnerCustomizations.js";
11
- import { isFilterValid as x } from "../validation/filterSchema.js";
12
- import { isConfigValid as I } from "../validation/requiredFields.js";
13
- const h = G();
10
+ import { getPartnerRecommendationParams as v } from "../utils/partnerCustomizations.js";
11
+ import { isFilterValid as N } from "../validation/filterSchema.js";
12
+ import { isConfigValid as x } from "../validation/requiredFields.js";
13
+ const h = y();
14
14
  let m = null, u = null, d = null;
15
- function R() {
15
+ function k() {
16
16
  return {
17
- cardsInRow: v,
17
+ cardsInRow: D,
18
18
  currencySettings: {
19
19
  name: "USD",
20
20
  value: "USD",
@@ -28,7 +28,7 @@ function R() {
28
28
  productIds: [],
29
29
  id: 1,
30
30
  language: "en_US",
31
- mobileCardsInRow: D,
31
+ mobileCardsInRow: P,
32
32
  mobileLayoutEnabled: !1,
33
33
  orientation: "grid",
34
34
  recommendedProducts: [],
@@ -43,9 +43,9 @@ function R() {
43
43
  priceHideIfSameAsDiscounted: !1
44
44
  };
45
45
  }
46
- function k() {
46
+ function I() {
47
47
  return {
48
- recommendationConfigs: R(),
48
+ recommendationConfigs: k(),
49
49
  recommendationProducts: [],
50
50
  filterStatus: !1,
51
51
  filterSelectionDrawerStatus: !1,
@@ -63,7 +63,7 @@ const L = () => ({
63
63
  blockStates: {},
64
64
  currentRecommendationId: null,
65
65
  configVersion: 0
66
- }), $ = P("guidoRecommendationExtension", {
66
+ }), $ = F("guidoRecommendationExtension", {
67
67
  state: () => L(),
68
68
  getters: {
69
69
  // ====================================================================
@@ -74,7 +74,7 @@ const L = () => ({
74
74
  * This allows all existing code that reads `store.recommendationConfigs` to work unchanged.
75
75
  */
76
76
  recommendationConfigs(t) {
77
- return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].recommendationConfigs : R();
77
+ return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].recommendationConfigs : k();
78
78
  },
79
79
  /**
80
80
  * Proxy getter: delegates to blockStates[currentRecommendationId].recommendationProducts
@@ -138,7 +138,7 @@ const L = () => ({
138
138
  getFilterList() {
139
139
  return Object.values(this.filterList).filter((t) => t.isFilterable !== 0 && t.isFilterable !== !1).map((t) => {
140
140
  let e;
141
- return t.type === "productAttribute" ? e = `product_attributes.${t.attributeName}` : y.includes(t.attributeName) ? e = `${t.attributeName}.${this.recommendationConfigs.currencySettings.value}` : e = t.attributeName, {
141
+ return t.type === "productAttribute" ? e = `product_attributes.${t.attributeName}` : C.includes(t.attributeName) ? e = `${t.attributeName}.${this.recommendationConfigs.currencySettings.value}` : e = t.attributeName, {
142
142
  text: t.displayName,
143
143
  value: e,
144
144
  type: t.attributeType
@@ -160,7 +160,7 @@ const L = () => ({
160
160
  setCurrentBlock(t) {
161
161
  this.blockStates[t] || (this.blockStates = {
162
162
  ...this.blockStates,
163
- [t]: k()
163
+ [t]: I()
164
164
  }), this.currentRecommendationId = t;
165
165
  },
166
166
  /**
@@ -228,7 +228,7 @@ const L = () => ({
228
228
  decimalCount: String(e.currencyDecimalCount),
229
229
  decimalSeparator: r(e.currencyDecimalSeparator, ","),
230
230
  thousandSeparator: r(e.currencyThousandSeparator, ".")
231
- }, c = !this.blockStates[t], i = c ? k() : this.blockStates[t];
231
+ }, c = !this.blockStates[t], i = c ? I() : this.blockStates[t];
232
232
  i.recommendationConfigs = {
233
233
  ...i.recommendationConfigs,
234
234
  strategy: e.strategy,
@@ -266,7 +266,7 @@ const L = () => ({
266
266
  * Creates a filter with the first available attribute and operator pre-selected.
267
267
  */
268
268
  createDefaultFilter(t, e) {
269
- const [r] = this.getFilterList, [n] = C(r == null ? void 0 : r.type);
269
+ const [r] = this.getFilterList, [n] = R(r == null ? void 0 : r.type);
270
270
  return {
271
271
  type: "standardFilter",
272
272
  attribute: (r == null ? void 0 : r.value) ?? "",
@@ -383,7 +383,7 @@ const L = () => ({
383
383
  const n = [...e.recommendationConfigs.filters];
384
384
  n[r] = {
385
385
  ...t,
386
- isValid: x(t)
386
+ isValid: N(t)
387
387
  }, e.recommendationConfigs.filters = n;
388
388
  }
389
389
  },
@@ -429,14 +429,7 @@ const L = () => ({
429
429
  * every block's recommendationConfigs across user edits.
430
430
  */
431
431
  hasInvalidBlock() {
432
- return Object.values(this.blockStates).some((t) => !I(t.recommendationConfigs, this));
433
- },
434
- /**
435
- * Per-instance counterpart to `hasInvalidBlock`: the ids of every block
436
- * that fails required-field validation, one drawer row each (SD-147430).
437
- */
438
- invalidBlockIds() {
439
- return Object.entries(this.blockStates).filter(([, t]) => !I(t.recommendationConfigs, this)).map(([t]) => t);
432
+ return Object.values(this.blockStates).some((t) => !x(t.recommendationConfigs, this));
440
433
  },
441
434
  // ====================================================================
442
435
  // Per-Block Product Fetching
@@ -457,7 +450,7 @@ const L = () => ({
457
450
  },
458
451
  async _doFetchProducts() {
459
452
  var p;
460
- const t = this.currentRecommendationId, e = this.blockStates[t], { recommendationConfigs: r } = e, n = r.filters.filter((l) => l.isValid), c = b(n), i = ((p = g().find((l) => l.key === r.strategy)) == null ? void 0 : p.path) || "", o = F(), s = parseInt(r.size) || 6, a = {
453
+ const t = this.currentRecommendationId, e = this.blockStates[t], { recommendationConfigs: r } = e, n = r.filters.filter((l) => l.isValid), c = b(n), i = ((p = g().find((l) => l.key === r.strategy)) == null ? void 0 : p.path) || "", o = G(), s = parseInt(r.size) || 6, a = {
461
454
  locale: r.language,
462
455
  currency: r.currencySettings.value,
463
456
  partnerName: o.partnerName,
@@ -467,7 +460,7 @@ const L = () => ({
467
460
  };
468
461
  r.strategy === "manualMerchandising" ? a.productId = r.productIds.join(",") : r.strategy === "similarViewed" && (a.productId = "{itemId}"), r.strategy === "userBased" && (a.userId = "{user_id}"), c && (a.filter = c), r.shuffleProducts && (a.shuffle = !0), Object.assign(
469
462
  a,
470
- N(o.partnerName, r.strategy)
463
+ v(o.partnerName, r.strategy)
471
464
  );
472
465
  let f;
473
466
  try {
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- .gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-ee2d4f7d] .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-44d8e7c8]{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-31b677b4]{gap:16px}.validation-error-row[data-v-31b677b4]{gap:8px;padding:24px;border:1px solid var(--guido-color-gray-300);border-radius:8px}.validation-error-row__icon[data-v-31b677b4]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-31b677b4]{font-size:13px;line-height:16px;color:var(--guido-color-gray-800);word-break:break-word}.guido-editor__wrapper[data-v-f02fdde0]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-f02fdde0]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-f02fdde0]{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-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-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-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-b0d3b445]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-b0d3b445]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-b0d3b445]{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-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}
@@ -15,23 +15,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
15
15
  close: () => void;
16
16
  };
17
17
  hasChanges: import("vue").ComputedRef<boolean>;
18
- saveSilent: () => Promise<{
19
- dynamicContentList: import("@@/Types/generic").DynamicContent[];
20
- compiledHtml: string;
21
- rawHtml: string;
22
- css: string;
23
- ampHtml: string;
24
- ampErrors: string[];
25
- modules: number[];
26
- recommendation: {
27
- campaignUrls: Record<string, string>;
28
- configs: Record<string, string>;
29
- };
30
- unsubscribe: {
31
- status: boolean;
32
- config: number[];
33
- };
34
- } | undefined> | undefined;
18
+ saveSilent: () => Promise<Omit<SavedTemplateDetails, "metadata" | "silent"> | undefined> | undefined;
35
19
  setLoading: (value: boolean) => void;
36
20
  }, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
37
21
  "dynamic-content:open": (detail: {
@@ -1,20 +1,4 @@
1
1
  declare const _default: import("vue").DefineComponent<{}, {
2
- handleSave: (isSilent: boolean) => Promise<{
3
- dynamicContentList: import("../../../@types/generic.js").DynamicContent[];
4
- compiledHtml: string;
5
- rawHtml: string;
6
- css: string;
7
- ampHtml: string;
8
- ampErrors: string[];
9
- modules: number[];
10
- recommendation: {
11
- campaignUrls: Record<string, string>;
12
- configs: Record<string, string>;
13
- };
14
- unsubscribe: {
15
- status: boolean;
16
- config: number[];
17
- };
18
- } | undefined> | undefined;
2
+ handleSave: (isSilent: boolean) => Promise<Omit<import("../../../@types/stripo.js").SavedTemplateDetails, "metadata" | "silent"> | undefined> | undefined;
19
3
  }, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
20
4
  export default _default;
@@ -1,20 +1,4 @@
1
1
  declare const _default: import("vue").DefineComponent<{}, {
2
- handleSave: (isSilent: boolean) => Promise<{
3
- dynamicContentList: import("../../../@types/generic.js").DynamicContent[];
4
- compiledHtml: string;
5
- rawHtml: string;
6
- css: string;
7
- ampHtml: string;
8
- ampErrors: string[];
9
- modules: number[];
10
- recommendation: {
11
- campaignUrls: Record<string, string>;
12
- configs: Record<string, string>;
13
- };
14
- unsubscribe: {
15
- status: boolean;
16
- config: number[];
17
- };
18
- } | undefined> | undefined;
2
+ handleSave: (isSilent: boolean) => Promise<Omit<import("../../../@types/stripo.js").SavedTemplateDetails, "metadata" | "silent"> | undefined> | undefined;
19
3
  }, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
20
4
  export default _default;
@@ -1,20 +1,4 @@
1
1
  declare const _default: import("vue").DefineComponent<{}, {
2
- handleSave: (isSilent: boolean) => Promise<{
3
- dynamicContentList: import("../../../@types/generic.js").DynamicContent[];
4
- compiledHtml: string;
5
- rawHtml: string;
6
- css: string;
7
- ampHtml: string;
8
- ampErrors: string[];
9
- modules: number[];
10
- recommendation: {
11
- campaignUrls: Record<string, string>;
12
- configs: Record<string, string>;
13
- };
14
- unsubscribe: {
15
- status: boolean;
16
- config: number[];
17
- };
18
- } | undefined> | undefined;
2
+ handleSave: (isSilent: boolean) => Promise<Omit<import("../../../@types/stripo.js").SavedTemplateDetails, "metadata" | "silent"> | undefined> | undefined;
19
3
  }, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
20
4
  export default _default;
@@ -10,11 +10,11 @@ interface Props {
10
10
  status: boolean;
11
11
  titleText: string;
12
12
  }
13
- declare var __VLS_13: {}, __VLS_15: {};
13
+ declare var __VLS_12: {}, __VLS_14: {};
14
14
  type __VLS_Slots = {} & {
15
- headerBottomSlot?: (props: typeof __VLS_13) => any;
15
+ headerBottomSlot?: (props: typeof __VLS_12) => any;
16
16
  } & {
17
- default?: (props: typeof __VLS_15) => any;
17
+ default?: (props: typeof __VLS_14) => any;
18
18
  };
19
19
  declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
20
20
  className: string;
@@ -26,7 +26,6 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
26
26
  cancelOrBackButtonEvent: () => void;
27
27
  onCloseEvent: () => void;
28
28
  primaryButtonEvent: () => void;
29
- secondaryButtonEvent: () => void;
30
29
  }, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
31
30
  className: string;
32
31
  size: string;
@@ -27,20 +27,6 @@ export declare function buildPartnerAttributeNameSet(filterList: FiltersResponse
27
27
  * before, so flagging it would false-positive on merge tags like `{{user.name}}`.
28
28
  */
29
29
  export declare function findInvalidCustomFields(html: string, validCustomFields: string[], recommendationBlockIds: string[], ignoredIds: Set<string>, ignoredAttributeNames: Set<string> | null): string[];
30
- /**
31
- * Returns the invalid `{{ ... }}` dynamic-content tags found in the HTML.
32
- *
33
- * A tag's variable name is the part before the first `|` (everything after it is the fallback).
34
- * Surrounding whitespace is always allowed (trimmed). A tag is valid only when the variable name
35
- * is an allowed system token, or it is a clean identifier (`[A-Za-z0-9_.]`) and — when a `|` is
36
- * present — the fallback after it is not empty. Otherwise the tag is invalid (e.g.
37
- * `{{Api Response: OA1 Main Item Url}}` — spaces/`:` — or `{{bounce|}}` — empty fallback).
38
- *
39
- * `data-*` block-config attribute values are excluded from the scan: blocks such as Items/cart
40
- * store product merge tags (`data-product_button_link="{{Abandoned Cart Item (1) Url}}"`) that the
41
- * backend resolves through its own pipeline, so they must not be treated as user-authored tags.
42
- */
43
- export declare function getInvalidDynamicContentTags(html: string): string[];
44
30
  export declare const useHtmlValidator: () => {
45
31
  validateHtml: (html: string, customFields: DynamicContent[], isOnSaveValidation?: boolean) => Promise<boolean>;
46
32
  };
@@ -1,9 +1,4 @@
1
1
  import type { SavedTemplateDetails } from '@@/Types/stripo';
2
- type SaveDetails = Omit<SavedTemplateDetails, 'metadata' | 'silent'>;
3
- type SaveResult = SaveDetails | undefined;
4
2
  export declare const useSave: () => {
5
- save: (suppressEmit?: boolean, silent?: boolean) => Promise<SaveResult>;
6
- saveWithErrors: () => Promise<SaveResult>;
7
- saveRawOnly: () => Promise<SaveResult>;
3
+ save: (suppressEmit?: boolean, silent?: boolean) => Promise<Omit<SavedTemplateDetails, "metadata" | "silent"> | undefined>;
8
4
  };
9
- export {};
@@ -1,6 +1,3 @@
1
- export declare const COUPON_TAG_MODIFIED_KEY = "newsletter.coupon-tag-modified";
2
- /** Pure core: the tag text of every coupon block whose code was modified. */
3
- export declare function findInvalidCouponBlocks(html: string): string[];
4
1
  export declare const useCouponBlockValidator: () => {
5
2
  validateCouponBlockTags: (html: string) => boolean;
6
3
  };
@@ -1,14 +1,4 @@
1
- declare const SINGLETON_BLOCK_RULES: {
2
- pageType: number;
3
- messageKey: string;
4
- }[];
5
- export declare const EMPTY_BLOCK_KEY = "unsubscription-preference.select-page-to-continue";
6
- /** Pure core: the singleton rules whose page type appears more than once. */
7
- export declare function findDuplicateUnsubPageTypes(html: string): typeof SINGLETON_BLOCK_RULES;
8
- /** Pure core: count of unsubscribe blocks with no page type or page list chosen. */
9
- export declare function countUnsubBlocksWithoutPage(html: string): number;
10
1
  export declare const useUnsubscribeBlockValidator: () => {
11
2
  validateUnsubscribeBlockUniqueness: (html: string) => boolean;
12
3
  validateUnsubscribeBlockHasTemplate: (html: string) => boolean;
13
4
  };
14
- export {};
@@ -286,11 +286,6 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
286
286
  * every block's recommendationConfigs across user edits.
287
287
  */
288
288
  hasInvalidBlock(): boolean;
289
- /**
290
- * Per-instance counterpart to `hasInvalidBlock`: the ids of every block
291
- * that fails required-field validation, one drawer row each (SD-147430).
292
- */
293
- invalidBlockIds(): string[];
294
289
  fetchRecommendationProducts(): Promise<void>;
295
290
  _doFetchProducts(): Promise<void>;
296
291
  }>;