@useinsider/guido 3.30.0-beta.52efeeb → 3.30.0-beta.569ec62

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 (33) hide show
  1. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +11 -16
  2. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +11 -11
  3. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +51 -51
  4. package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +3 -3
  5. package/dist/composables/useExport.js +8 -7
  6. package/dist/composables/useHtmlValidator.js +102 -100
  7. package/dist/composables/useToaster.js +11 -10
  8. package/dist/composables/useVersionHistoryApi.js +22 -21
  9. package/dist/composables/validators/useLiquidValidator.js +26 -24
  10. package/dist/config/migrator/itemsBlockMigrator.js +164 -161
  11. package/dist/config/migrator/recommendation/extractors.js +72 -180
  12. package/dist/config/migrator/recommendation/themeMapper.js +21 -33
  13. package/dist/config/migrator/recommendationMigrator.js +48 -53
  14. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +148 -141
  15. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +53 -53
  16. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +40 -39
  17. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +27 -26
  18. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +33 -32
  19. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +23 -22
  20. package/dist/extensions/Blocks/Recommendation/templates/utils.js +79 -78
  21. package/dist/extensions/Blocks/Recommendation/utils/compositionKeys.js +50 -41
  22. package/dist/guido.css +1 -1
  23. package/dist/package.json.js +6 -6
  24. package/dist/src/config/migrator/recommendation/extractors.d.ts +1 -15
  25. package/dist/src/extensions/Blocks/Recommendation/utils/compositionKeys.d.ts +2 -0
  26. package/dist/src/stores/preview.d.ts +3 -0
  27. package/dist/src/utils/ampPreviewSanitizer.d.ts +5 -0
  28. package/dist/src/utils/htmlEscape.d.ts +5 -0
  29. package/dist/stores/preview.js +21 -15
  30. package/dist/utils/ampPreviewSanitizer.js +46 -0
  31. package/dist/utils/htmlEscape.js +5 -1
  32. package/dist/utils/pairProductVariables.js +98 -108
  33. package/package.json +1 -1
@@ -1,98 +1,107 @@
1
- import { ATTR_CUSTOM_PREFIX as o, ATTR_PRODUCT_PRICE as g, ATTR_PRODUCT_OLD_PRICE as d, PRODUCT_ATTRIBUTE_PREFIX as a, ATTR_DATA_ATTRIBUTE_TYPE as f, ATTR_PRODUCT_ATTR as c, SELECTOR_ATTRIBUTE_ROW as y } from "../constants/selectors.js";
1
+ import { ATTR_CUSTOM_PREFIX as o, ATTR_PRODUCT_PRICE as _, ATTR_PRODUCT_OLD_PRICE as C, PRODUCT_ATTRIBUTE_PREFIX as f, ATTR_DATA_ATTRIBUTE_TYPE as a, ATTR_PRODUCT_ATTR as c, SELECTOR_ATTRIBUTE_ROW as y } from "../constants/selectors.js";
2
2
  function q(t) {
3
- return !t.startsWith(a);
3
+ return !t.startsWith(f);
4
4
  }
5
5
  function $(t) {
6
- return t.startsWith(a) ? t.substring(a.length) : t;
6
+ return t.startsWith(f) ? t.substring(f.length) : t;
7
7
  }
8
- function A(t) {
8
+ function T(t) {
9
9
  return t.startsWith(o) ? t.substring(o.length) : t;
10
10
  }
11
- function T(t) {
11
+ function A(t) {
12
12
  return `${o}${t}`;
13
13
  }
14
- function C(t) {
15
- return t.type === "defaultAttribute" ? t.attributeName : `${a}${t.attributeName}`;
14
+ const g = /[<>"`]/;
15
+ function m(t) {
16
+ return !g.test(t);
17
+ }
18
+ function O(t) {
19
+ return t.filter((r) => !r.startsWith(o) || m(T(r)));
16
20
  }
17
- function h(t, r) {
21
+ function h(t) {
22
+ return t.type === "defaultAttribute" ? t.attributeName : `${f}${t.attributeName}`;
23
+ }
24
+ function S(t, r) {
18
25
  const n = Object.values(r).filter((e) => e.attributeName === t);
19
26
  return n.find((e) => e.type === "defaultAttribute") ?? n[0];
20
27
  }
21
28
  function l(t, r) {
22
29
  return t && "getAttribute" in t ? t.getAttribute(r) : null;
23
30
  }
24
- function S(t, r, n = {}) {
31
+ function E(t, r, n = {}) {
25
32
  const e = `${o}${t}`, u = r == null ? void 0 : r.querySelector(
26
- `${y}[${f}="${e}"]`
33
+ `${y}[${a}="${e}"]`
27
34
  ), i = l(u, c) ?? l(u == null ? void 0 : u.querySelector(`[${c}]`), c);
28
35
  if (i)
29
36
  return i;
30
- const s = h(t, n);
31
- return s ? C(s) : t;
37
+ const s = S(t, n);
38
+ return s ? h(s) : t;
32
39
  }
33
40
  function P(t, r, n = {}) {
34
- return t.startsWith(a) ? t : S(t, r, n);
41
+ return t.startsWith(f) ? t : E(t, r, n);
35
42
  }
36
- function O(t, r, n = {}) {
43
+ function U(t, r, n = {}) {
37
44
  return t.map((e) => {
38
45
  if (!e.startsWith(o))
39
46
  return e;
40
- const u = A(e);
41
- return T(P(u, r, n));
47
+ const u = T(e);
48
+ return A(P(u, r, n));
42
49
  });
43
50
  }
44
- function p(t, r, n = {}) {
51
+ function D(t, r, n = {}) {
45
52
  return t.map((e) => P(e, r, n));
46
53
  }
47
54
  function b(t) {
48
- const r = l(t, f);
55
+ const r = l(t, a);
49
56
  if (!(r != null && r.startsWith(o)))
50
57
  return r;
51
58
  const n = "querySelector" in t ? t.querySelector(`[${c}]`) : void 0, e = l(n, c);
52
- return e ? T(e) : r;
59
+ return e ? A(e) : r;
53
60
  }
54
- function m(t) {
61
+ function p(t) {
55
62
  return !!(t && "querySelector" in t && t.querySelector(".product-price") && t.querySelector(".product-old-price"));
56
63
  }
57
- function D(t) {
64
+ function I(t) {
58
65
  const r = b(t);
59
- return r ? m(t) ? [g, d] : [r] : [];
66
+ return r ? p(t) ? [_, C] : [r] : [];
60
67
  }
61
68
  function R(t, r, n) {
62
69
  const e = l(t, c), u = l(t.querySelector(`[${c}]`), c), i = e ?? u;
63
70
  return i === null ? n : i === r;
64
71
  }
65
- function I(t, r) {
66
- const n = (_) => t.querySelector(
67
- `${y}[${f}="${_}"]`
72
+ function v(t, r) {
73
+ const n = (d) => t.querySelector(
74
+ `${y}[${a}="${d}"]`
68
75
  );
69
76
  if (!r.startsWith(o))
70
77
  return n(r) ?? null;
71
- const e = A(r), u = n(r);
78
+ const e = T(r), u = n(r);
72
79
  if (u && R(u, e, !0))
73
80
  return u;
74
- const i = T($(e)), s = i === r ? void 0 : n(i);
81
+ const i = A($(e)), s = i === r ? void 0 : n(i);
75
82
  return s && R(s, e, !1) ? s : null;
76
83
  }
77
- function U(t, r) {
78
- const n = A(r), e = T($(n));
84
+ function B(t, r) {
85
+ const n = T(r), e = A($(n));
79
86
  return e === r ? t : t.replace(
80
- `${f}="${e}"`,
81
- `${f}="${r}"`
87
+ `${a}="${e}"`,
88
+ `${a}="${r}"`
82
89
  );
83
90
  }
84
91
  export {
85
92
  $ as bareAttributeName,
86
- A as compositionKeyToProductAttr,
87
- C as filterToProductAttrValue,
88
- I as findAttributeRow,
89
- h as findFilterByBareName,
93
+ T as compositionKeyToProductAttr,
94
+ O as dropMalformedCompositionKeys,
95
+ h as filterToProductAttrValue,
96
+ v as findAttributeRow,
97
+ S as findFilterByBareName,
90
98
  q as isDefaultProductAttr,
91
- m as isMergedInlinePriceRow,
92
- O as normalizeCompositionKeys,
93
- p as normalizeCustomAttrValues,
94
- T as productAttrToCompositionKey,
99
+ p as isMergedInlinePriceRow,
100
+ m as isWellFormedProductAttr,
101
+ U as normalizeCompositionKeys,
102
+ D as normalizeCustomAttrValues,
103
+ A as productAttrToCompositionKey,
95
104
  b as resolveRowCompositionKey,
96
- D as resolveRowVisibilityKeys,
97
- U as rewriteLegacyRowKeyHtml
105
+ I as resolveRowVisibilityKeys,
106
+ B as rewriteLegacyRowKeyHtml
98
107
  };
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- @charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-9d988e4b] .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}.color-vision-select__dropdown[data-v-64cb50da]{z-index:20;width:387px}.accessibility-toolbar[data-v-391019bc]{gap:16px}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button svg{margin-right:0}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button .clearfix:after{content:none}.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}.editor-actions-menu__dropdown[data-v-bdb3b37a]{z-index:20;width:222px}.editor-actions[data-v-9a028d08]{gap:16px}.editor-actions__divider[data-v-9a028d08]{width:1px;height:40px;background-color:#e1e1e1}.right-slot[data-v-77451c9a]{gap:16px}.header-wrapper[data-v-3c713746]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-0c5f11a1]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-0c5f11a1]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-0c5f11a1]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-eaf8e461]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-eaf8e461]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-eaf8e461]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-eaf8e461]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-eaf8e461]{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}.guido-tab-bar-onboarding[data-v-219b4f7c]{z-index:21}[data-v-fcba7e99] .vueperslides__bullets{pointer-events:none!important}[data-v-fcba7e99] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-1a34025a] .vueperslides__bullets{pointer-events:none!important}[data-v-1a34025a] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-8fc96a58] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.guido-display-condition-create__separator[data-v-929822bc]{height:1px;margin:0 0 24px;background-image:linear-gradient(to right,currentColor 1px,transparent 1px);background-size:5px 1px}.guido-display-condition-create__methods[data-v-929822bc]{gap:16px}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__footer{justify-content:flex-start}.guido-display-condition-select__delete-modal[data-v-0d740001]{position:relative;z-index:145}.guido-display-condition-select__delete-modal[data-v-0d740001] .in-modal-v2-wrapper__header-title{margin-bottom:0}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__content>div{display:flex;flex-direction:column;min-height:100%}.guido-display-condition-select__list[data-v-0d740001]{display:flex;flex-direction:column;gap:24px;margin:0;padding:0;list-style:none}.guido-display-condition-card__header[data-v-0d740001]{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px}.guido-display-condition-card__text[data-v-0d740001]{min-width:0}.guido-display-condition-card__name[data-v-0d740001],.guido-display-condition-card__description[data-v-0d740001]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.guido-display-condition-card__actions[data-v-0d740001]{display:flex;flex-shrink:0;align-items:center;gap:16px}.guido-display-condition-card__split[data-v-0d740001]{position:relative;display:flex;gap:1px}.guido-display-condition-card__menu[data-v-0d740001]{z-index:2;min-width:115px}.guido-display-condition-card__divider[data-v-0d740001]{width:1px;height:24px}.guido-display-condition-card__code[data-v-0d740001]{margin:1px 15px 15px;padding:8px;font-family:inherit;white-space:pre-wrap;word-break:break-word}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}.ambiguous-dynamic-content-modal__content[data-v-2643213c]{padding-bottom:150px}
1
+ @charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-9d988e4b] .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}.color-vision-select__dropdown[data-v-64cb50da]{z-index:20;width:387px}.accessibility-toolbar[data-v-391019bc]{gap:16px}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button svg{margin-right:0}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button .clearfix:after{content:none}.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}.editor-actions-menu__dropdown[data-v-bdb3b37a]{z-index:20;width:222px}.editor-actions[data-v-9a028d08]{gap:16px}.editor-actions__divider[data-v-9a028d08]{width:1px;height:40px;background-color:#e1e1e1}.right-slot[data-v-77451c9a]{gap:16px}.header-wrapper[data-v-3c713746]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-c8351f74]{gap:16px}.validation-error-row[data-v-c8351f74]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-c8351f74]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-c8351f74]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-0c5f11a1]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-0c5f11a1]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-0c5f11a1]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-eaf8e461]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-eaf8e461]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-eaf8e461]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-eaf8e461]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-eaf8e461]{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-f5ff6219]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-f5ff6219]{min-height:504px}.iframe-wrapper[data-v-a7102458]{width:258px}.iframe-scaled[data-v-a7102458]{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}.guido-tab-bar-onboarding[data-v-219b4f7c]{z-index:21}[data-v-fcba7e99] .vueperslides__bullets{pointer-events:none!important}[data-v-fcba7e99] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-1a34025a] .vueperslides__bullets{pointer-events:none!important}[data-v-1a34025a] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-8fc96a58] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.guido-display-condition-create__separator[data-v-929822bc]{height:1px;margin:0 0 24px;background-image:linear-gradient(to right,currentColor 1px,transparent 1px);background-size:5px 1px}.guido-display-condition-create__methods[data-v-929822bc]{gap:16px}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__footer{justify-content:flex-start}.guido-display-condition-select__delete-modal[data-v-0d740001]{position:relative;z-index:145}.guido-display-condition-select__delete-modal[data-v-0d740001] .in-modal-v2-wrapper__header-title{margin-bottom:0}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__content>div{display:flex;flex-direction:column;min-height:100%}.guido-display-condition-select__list[data-v-0d740001]{display:flex;flex-direction:column;gap:24px;margin:0;padding:0;list-style:none}.guido-display-condition-card__header[data-v-0d740001]{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px}.guido-display-condition-card__text[data-v-0d740001]{min-width:0}.guido-display-condition-card__name[data-v-0d740001],.guido-display-condition-card__description[data-v-0d740001]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.guido-display-condition-card__actions[data-v-0d740001]{display:flex;flex-shrink:0;align-items:center;gap:16px}.guido-display-condition-card__split[data-v-0d740001]{position:relative;display:flex;gap:1px}.guido-display-condition-card__menu[data-v-0d740001]{z-index:2;min-width:115px}.guido-display-condition-card__divider[data-v-0d740001]{width:1px;height:24px}.guido-display-condition-card__code[data-v-0d740001]{margin:1px 15px 15px;padding:8px;font-family:inherit;white-space:pre-wrap;word-break:break-word}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}.ambiguous-dynamic-content-modal__content[data-v-2643213c]{padding-bottom:150px}
@@ -1,9 +1,9 @@
1
- const e = "3.30.0-beta.52efeeb", o = { stripo: { version: "2.87.0" } }, s = {
2
- version: e,
3
- guido: o
1
+ const o = "3.30.0-beta.569ec62", s = { stripo: { version: "2.87.0" } }, e = {
2
+ version: o,
3
+ guido: s
4
4
  };
5
5
  export {
6
- s as default,
7
- o as guido,
8
- e as version
6
+ e as default,
7
+ s as guido,
8
+ o as version
9
9
  };
@@ -1,4 +1,4 @@
1
- import type { LegacyButtonTheme, LegacyPaddingViewport, LegacyVariable } from './types';
1
+ import type { LegacyPaddingViewport, LegacyVariable } from './types';
2
2
  export declare function extractTitleText(block: Element): string;
3
3
  /**
4
4
  * Fallback for legacy configs that carry no `p_recommendation_title` variable:
@@ -33,20 +33,6 @@ export declare function isPriceOnNextLine(block: Element): boolean;
33
33
  * @returns The variables, with `textColor` / `textTrimming` filled from the rendered HTML where the theme lacks them
34
34
  */
35
35
  export declare function withRenderedTextTheme(variables: LegacyVariable[] | undefined, block: Element): LegacyVariable[] | undefined;
36
- /**
37
- * Reads the first legacy product button's inline colors, border and internal padding.
38
- * @param block - The legacy recommendation block element
39
- * @param theme - The legacy button theme; keys it already holds are not read
40
- * @returns Only the keys filled from the rendered button, or an empty object
41
- */
42
- export declare function extractRenderedButtonTheme(block: Element, theme?: LegacyButtonTheme): LegacyButtonTheme;
43
- /**
44
- * Legacy keeps the product button's colors, border and internal padding inline on the rendered button.
45
- * @param variables - The legacy composition variables
46
- * @param block - The legacy recommendation block element
47
- * @returns The variables, with the `p_button` theme filled from the rendered button where the theme lacks a value
48
- */
49
- export declare function withRenderedButtonTheme(variables: LegacyVariable[] | undefined, block: Element): LegacyVariable[] | undefined;
50
36
  /**
51
37
  * Card background lives on either the block (`bgcolor`/`style`) or per-card
52
38
  * cells (`.product-card`). Returns empty string when no background is set —
@@ -11,6 +11,8 @@ export declare function isDefaultProductAttr(productAttrValue: string): boolean;
11
11
  export declare function bareAttributeName(productAttrValue: string): string;
12
12
  export declare function compositionKeyToProductAttr(compositionKey: string): string;
13
13
  export declare function productAttrToCompositionKey(productAttrValue: string): string;
14
+ export declare function isWellFormedProductAttr(productAttrValue: string): boolean;
15
+ export declare function dropMalformedCompositionKeys(composition: string[]): string[];
14
16
  /**
15
17
  * Canonical identity of a filter entry. Reads the type off the entry itself, so
16
18
  * two same-named filters never collapse onto one value.
@@ -1,4 +1,6 @@
1
1
  import type { PreviewState, EmailFormat } from '@@/Types/preview';
2
+ export declare const HTML_PREVIEW_SANDBOX = "allow-same-origin allow-popups allow-popups-to-escape-sandbox";
3
+ export declare const AMP_PREVIEW_SANDBOX = "allow-same-origin allow-scripts allow-popups allow-popups-to-escape-sandbox";
2
4
  export declare const usePreviewStore: import("pinia").StoreDefinition<"guidoPreview", PreviewState, {
3
5
  isAMPModeEnabled: (state: {
4
6
  emailFormat: EmailFormat;
@@ -10,6 +12,7 @@ export declare const usePreviewStore: import("pinia").StoreDefinition<"guidoPrev
10
12
  emailSizeKB: number;
11
13
  } & import("pinia").PiniaCustomStateProperties<PreviewState>) => boolean;
12
14
  previewHtml(): string;
15
+ previewSandbox(): string;
13
16
  hasAMP: (state: {
14
17
  emailFormat: EmailFormat;
15
18
  ampHtml: string;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Strips script-running markup from AMP preview HTML, which needs `allow-scripts` for the AMP runtime.
3
+ * Preview only: the DOM round-trip re-encodes attribute text, so never feed the result back into saved HTML.
4
+ */
5
+ export declare const sanitizeAmpPreviewHtml: (html: string) => string;
@@ -3,3 +3,8 @@
3
3
  * or text content. Use for any string that may contain untrusted input.
4
4
  */
5
5
  export declare function escapeHtml(text: string): string;
6
+ /**
7
+ * Escape untrusted text but keep attribute-free line breaks and inline emphasis
8
+ * (`br`, `b`, `strong`, `i`, `em`, `u`) that translated copy carries.
9
+ */
10
+ export declare function escapeHtmlKeepFormatting(text: string): string;
@@ -1,5 +1,6 @@
1
- import { defineStore as e } from "pinia";
2
- const i = () => ({
1
+ import { sanitizeAmpPreviewHtml as s } from "../utils/ampPreviewSanitizer.js";
2
+ import { defineStore as r } from "pinia";
3
+ const o = "allow-same-origin allow-popups allow-popups-to-escape-sandbox", i = "allow-same-origin allow-scripts allow-popups allow-popups-to-escape-sandbox", a = () => ({
3
4
  emailFormat: "html",
4
5
  ampHtml: "",
5
6
  ampErrors: [],
@@ -7,18 +8,21 @@ const i = () => ({
7
8
  isLoaded: !1,
8
9
  isAMPErrorModalVisible: !1,
9
10
  emailSizeKB: 0
10
- }), a = e("guidoPreview", {
11
- state: () => i(),
11
+ }), p = r("guidoPreview", {
12
+ state: () => a(),
12
13
  getters: {
13
- isAMPModeEnabled: (t) => t.emailFormat === "AMP",
14
+ isAMPModeEnabled: (e) => e.emailFormat === "AMP",
14
15
  previewHtml() {
15
- return this.isAMPModeEnabled ? this.ampHtml : this.templateHtml;
16
+ return this.isAMPModeEnabled ? s(this.ampHtml) : this.templateHtml;
16
17
  },
17
- hasAMP: (t) => {
18
- var r;
19
- return !!((r = t.ampHtml) != null && r.trim());
18
+ previewSandbox() {
19
+ return this.isAMPModeEnabled ? i : o;
20
20
  },
21
- hasAMPErrors: (t) => t.ampErrors.length > 0,
21
+ hasAMP: (e) => {
22
+ var t;
23
+ return !!((t = e.ampHtml) != null && t.trim());
24
+ },
25
+ hasAMPErrors: (e) => e.ampErrors.length > 0,
22
26
  showAMPErrorButton() {
23
27
  return this.isAMPModeEnabled && this.hasAMPErrors;
24
28
  },
@@ -27,11 +31,11 @@ const i = () => ({
27
31
  }
28
32
  },
29
33
  actions: {
30
- updateAMPData(t) {
31
- this.ampHtml = t.ampHtml ?? "", this.ampErrors = t.ampErrors ?? [], this.emailFormat = t.ampHtml ? "AMP" : "html";
34
+ updateAMPData(e) {
35
+ this.ampHtml = e.ampHtml ?? "", this.ampErrors = e.ampErrors ?? [], this.emailFormat = e.ampHtml ? "AMP" : "html";
32
36
  },
33
- setEmailFormat(t) {
34
- this.emailFormat = t;
37
+ setEmailFormat(e) {
38
+ this.emailFormat = e;
35
39
  },
36
40
  closeErrorModal() {
37
41
  this.isAMPErrorModalVisible = !1;
@@ -42,5 +46,7 @@ const i = () => ({
42
46
  }
43
47
  });
44
48
  export {
45
- a as usePreviewStore
49
+ i as AMP_PREVIEW_SANDBOX,
50
+ o as HTML_PREVIEW_SANDBOX,
51
+ p as usePreviewStore
46
52
  };
@@ -0,0 +1,46 @@
1
+ import { BASE_SAFE_URL_SCHEMES as c } from "./urlSchemes.js";
2
+ const i = "https://cdn.ampproject.org/", a = "http://www.w3.org/1999/xhtml", l = ["application/json", "application/ld+json"], E = [...c, "tel:", "sms:"], u = ["href", "src", "action", "action-xhr", "formaction", "xlink:href", "poster", "background"], m = "iframe, frame, frameset, object, embed, base, noscript, amp-script, animate, set", p = /^on./i, f = "https://preview.invalid/", A = 4, S = (e) => {
3
+ const t = e.trim();
4
+ if (t === "")
5
+ return !0;
6
+ try {
7
+ const { protocol: r } = new URL(t, f);
8
+ return E.includes(r) || /^data:image\//i.test(t);
9
+ } catch {
10
+ return !1;
11
+ }
12
+ }, h = (e) => {
13
+ if (e.namespaceURI !== a)
14
+ return !1;
15
+ const t = e.getAttribute("src");
16
+ return t !== null ? t.trim().startsWith(i) : l.includes((e.getAttribute("type") ?? "").trim().toLowerCase());
17
+ }, _ = (e) => {
18
+ Array.from(e.attributes).forEach(({ name: t, value: r }) => {
19
+ const o = u.includes(t.toLowerCase()) && !S(r);
20
+ (p.test(t) || o) && e.removeAttribute(t);
21
+ });
22
+ }, s = (e) => {
23
+ e.querySelectorAll(m).forEach((t) => t.remove()), e.querySelectorAll("meta[http-equiv]").forEach((t) => {
24
+ var r;
25
+ ((r = t.getAttribute("http-equiv")) == null ? void 0 : r.trim().toLowerCase()) === "refresh" && t.remove();
26
+ }), e.querySelectorAll("script").forEach((t) => {
27
+ h(t) || t.remove();
28
+ }), e.querySelectorAll("*").forEach(_), e.querySelectorAll("template").forEach((t) => s(t.content));
29
+ }, n = (e) => {
30
+ const t = new DOMParser().parseFromString(e, "text/html");
31
+ return s(t), `${t.doctype ? `<!DOCTYPE ${t.doctype.name}>` : ""}${t.documentElement.outerHTML}`;
32
+ }, T = (e) => {
33
+ if (e.trim() === "")
34
+ return "";
35
+ let t = n(e);
36
+ for (let r = 1; r < A; r++) {
37
+ const o = n(t);
38
+ if (o === t)
39
+ return t;
40
+ t = o;
41
+ }
42
+ return "";
43
+ };
44
+ export {
45
+ T as sanitizeAmpPreviewHtml
46
+ };
@@ -8,6 +8,10 @@ const c = {
8
8
  function n(t) {
9
9
  return t.replace(/[&<>"']/g, (e) => c[e]);
10
10
  }
11
+ function o(t) {
12
+ return n(t).replace(/&lt;\/?br\s*\/?&gt;/gi, "<br>").replace(/&lt;(\/?)(b|strong|i|em|u)&gt;/gi, (e, r, a) => `<${r}${a.toLowerCase()}>`);
13
+ }
11
14
  export {
12
- n as escapeHtml
15
+ n as escapeHtml,
16
+ o as escapeHtmlKeepFormatting
13
17
  };