@useinsider/guido 3.2.0-beta.caa22bf → 3.2.0-beta.ccaf9f5

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 (79) hide show
  1. package/README.md +0 -92
  2. package/dist/@types/config/schemas.js +94 -150
  3. package/dist/components/Guido.vue.js +1 -1
  4. package/dist/components/Guido.vue2.js +75 -75
  5. package/dist/composables/useCortexBlueprintBridge.js +38 -0
  6. package/dist/composables/useEmailTemplateApplier.js +41 -0
  7. package/dist/composables/useRecommendation.js +26 -46
  8. package/dist/composables/useSave.js +18 -21
  9. package/dist/composables/useStripo.js +16 -14
  10. package/dist/config/compiler/recommendationCompilerRules.js +27 -27
  11. package/dist/config/migrator/index.js +9 -9
  12. package/dist/config/migrator/radioButtonMigrator.js +44 -64
  13. package/dist/config/migrator/recommendationMigrator.js +290 -74
  14. package/dist/enums/displayConditions.js +80 -0
  15. package/dist/enums/extensions/recommendationBlock.js +1 -2
  16. package/dist/extensions/Blocks/RadioButton/template.js +1 -1
  17. package/dist/extensions/Blocks/Recommendation/block.js +32 -35
  18. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +5 -5
  19. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +24 -25
  20. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +181 -228
  21. package/dist/extensions/Blocks/Recommendation/services/configService.js +29 -65
  22. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +90 -130
  23. package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +251 -0
  24. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +8 -8
  25. package/dist/extensions/Blocks/Recommendation/templates/utils.js +1 -1
  26. package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +22 -13
  27. package/dist/guido.css +1 -1
  28. package/dist/node_modules/valibot/dist/index.js +235 -450
  29. package/dist/src/@types/config/defaults.d.ts +1 -5
  30. package/dist/src/@types/config/index.d.ts +3 -3
  31. package/dist/src/@types/config/schemas.d.ts +0 -213
  32. package/dist/src/@types/config/types.d.ts +1 -9
  33. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  34. package/dist/src/composables/useConfig.d.ts +0 -56
  35. package/dist/src/composables/useCortexBlueprintBridge.d.ts +17 -0
  36. package/dist/src/composables/useEmailTemplateApplier.d.ts +21 -0
  37. package/dist/src/composables/useRecommendation.d.ts +1 -10
  38. package/dist/src/config/migrator/index.d.ts +1 -2
  39. package/dist/src/config/migrator/recommendationMigrator.d.ts +1 -13
  40. package/dist/src/enums/displayConditions.d.ts +2 -0
  41. package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
  42. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +0 -10
  43. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -34
  44. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +1 -1
  45. package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +3 -0
  46. package/dist/src/library.d.ts +1 -1
  47. package/dist/src/stores/config.d.ts +0 -504
  48. package/dist/utils/templatePreparation.js +32 -72
  49. package/package.json +1 -5
  50. package/dist/composables/validators/useCouponBlockValidator.js +0 -24
  51. package/dist/config/migrator/recommendation/compositionMapper.js +0 -98
  52. package/dist/config/migrator/recommendation/extractors.js +0 -27
  53. package/dist/config/migrator/recommendation/htmlBuilder.js +0 -496
  54. package/dist/config/migrator/recommendation/parseLegacyConfig.js +0 -33
  55. package/dist/config/migrator/recommendation/settingsMapper.js +0 -70
  56. package/dist/config/migrator/recommendation/themeMapper.js +0 -93
  57. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMap.js +0 -21
  58. package/dist/src/composables/useRecommendation.test.d.ts +0 -1
  59. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +0 -3
  60. package/dist/src/config/migrator/recommendation/compositionMapper.d.ts +0 -2
  61. package/dist/src/config/migrator/recommendation/compositionMapper.test.d.ts +0 -1
  62. package/dist/src/config/migrator/recommendation/extractors.d.ts +0 -7
  63. package/dist/src/config/migrator/recommendation/extractors.test.d.ts +0 -1
  64. package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +0 -11
  65. package/dist/src/config/migrator/recommendation/parseLegacyConfig.d.ts +0 -15
  66. package/dist/src/config/migrator/recommendation/parseLegacyConfig.test.d.ts +0 -1
  67. package/dist/src/config/migrator/recommendation/settingsMapper.d.ts +0 -7
  68. package/dist/src/config/migrator/recommendation/settingsMapper.test.d.ts +0 -1
  69. package/dist/src/config/migrator/recommendation/themeMapper.d.ts +0 -5
  70. package/dist/src/config/migrator/recommendation/themeMapper.test.d.ts +0 -1
  71. package/dist/src/config/migrator/recommendation/types.d.ts +0 -205
  72. package/dist/src/config/migrator/recommendationMigrator.test.d.ts +0 -1
  73. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.test.d.ts +0 -1
  74. package/dist/src/extensions/Blocks/Recommendation/services/configService.test.d.ts +0 -1
  75. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.d.ts +0 -21
  76. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.test.d.ts +0 -1
  77. package/dist/src/utils/htmlEscape.d.ts +0 -5
  78. package/dist/src/utils/htmlEscape.test.d.ts +0 -1
  79. package/dist/utils/htmlEscape.js +0 -13
@@ -1,93 +0,0 @@
1
- function r(n, t, o) {
2
- o != null && o !== "" && n.push(`${t}: ${o}`);
3
- }
4
- function $(n) {
5
- if (!n)
6
- return null;
7
- const t = n.top ?? n.all ?? 0, o = n.right ?? n.all ?? 0, i = n.bottom ?? n.all ?? 0, l = n.left ?? n.all ?? 0;
8
- return t === 0 && o === 0 && i === 0 && l === 0 ? null : `${t}px ${o}px ${i}px ${l}px`;
9
- }
10
- function j(n) {
11
- if (!n)
12
- return null;
13
- const { top: t, right: o, bottom: i, left: l } = n;
14
- return t === void 0 ? null : t === o && t === i && t === l ? t : null;
15
- }
16
- function S(n, t, o, i) {
17
- const l = j(o);
18
- if (l !== null) {
19
- r(n, `border-${t}`, i(l));
20
- return;
21
- }
22
- o && (r(n, `border-top-${t}`, o.top !== void 0 ? i(o.top) : null), r(n, `border-right-${t}`, o.right !== void 0 ? i(o.right) : null), r(n, `border-bottom-${t}`, o.bottom !== void 0 ? i(o.bottom) : null), r(n, `border-left-${t}`, o.left !== void 0 ? i(o.left) : null));
23
- }
24
- function C(n) {
25
- if (!n)
26
- return null;
27
- if (typeof n.radius == "number")
28
- return `${n.radius}px`;
29
- if (typeof n.lt == "number" || typeof n.rt == "number" || typeof n.rb == "number" || typeof n.lb == "number") {
30
- const t = n.lt ?? 0, o = n.rt ?? 0, i = n.rb ?? 0, l = n.lb ?? 0;
31
- return `${t}px ${o}px ${i}px ${l}px`;
32
- }
33
- return null;
34
- }
35
- function I(n) {
36
- var t, o;
37
- return ((t = n.textLineSpacing) == null ? void 0 : t.lineSpacing) ?? ((o = n.textLineSpacing) == null ? void 0 : o["font-lineSpacing"]);
38
- }
39
- function L(n) {
40
- var f, u, a, g, d, b, p, s;
41
- const t = [], o = [], i = (f = n == null ? void 0 : n.textAlign) == null ? void 0 : f.align, l = $((u = n == null ? void 0 : n.textPadding) == null ? void 0 : u.desktop), x = (a = n == null ? void 0 : n.textStyle) == null ? void 0 : a["font-weight"], c = (g = n == null ? void 0 : n.textStyle) == null ? void 0 : g["font-style"];
42
- return r(t, "background-color", (d = n == null ? void 0 : n.textBackgroundColor) == null ? void 0 : d.color), r(t, "padding", l), r(o, "font-family", (b = n == null ? void 0 : n.textStyle) == null ? void 0 : b["font-family"]), r(o, "font-size", (p = n == null ? void 0 : n.textStyle) == null ? void 0 : p["font-size"]), r(o, "font-weight", x), r(o, "font-style", c), r(o, "color", (s = n == null ? void 0 : n.textColor) == null ? void 0 : s.color), r(o, "line-height", I(n ?? {})), r(o, "text-align", i), {
43
- tdStyle: t.join("; "),
44
- pStyle: o.join("; "),
45
- align: i || void 0,
46
- wrapBold: x === "bold",
47
- wrapItalic: c === "italic",
48
- textTrimming: (n == null ? void 0 : n.textTrimming) === !0
49
- };
50
- }
51
- function N(n) {
52
- var u, a, g, d, b, p, s, k, w, P, B, z;
53
- const t = [], o = [], i = [];
54
- r(t, "padding", $((u = n == null ? void 0 : n.buttonExternalPadding) == null ? void 0 : u.desktop)), r(i, "padding", $((a = n == null ? void 0 : n.buttonInternalPadding) == null ? void 0 : a.desktop)), r(i, "font-family", (g = n == null ? void 0 : n.buttonStyle) == null ? void 0 : g["font-family"]), r(i, "font-size", (d = n == null ? void 0 : n.buttonStyle) == null ? void 0 : d["font-size"]), r(i, "font-weight", (b = n == null ? void 0 : n.buttonStyle) == null ? void 0 : b["font-weight"]), r(i, "font-style", (p = n == null ? void 0 : n.buttonStyle) == null ? void 0 : p["font-style"]);
55
- const l = (s = n == null ? void 0 : n.buttonColor) == null ? void 0 : s.color, x = (k = n == null ? void 0 : n.textButtonColor) == null ? void 0 : k.color;
56
- r(o, "background", l), r(i, "background", l), r(i, "color", x);
57
- const c = n == null ? void 0 : n.buttonBorder;
58
- S(o, "width", c == null ? void 0 : c.width, (y) => `${y}px`), S(o, "style", c == null ? void 0 : c.style, (y) => y), S(o, "color", c == null ? void 0 : c.color, (y) => y);
59
- const f = C(n == null ? void 0 : n.buttonBorderRadius);
60
- return f && (r(o, "border-radius", f), r(i, "border-radius", f)), ((w = n == null ? void 0 : n.buttonStretch) == null ? void 0 : w.stretched) === !1 ? (r(o, "display", "inline-block"), r(i, "display", "inline-block")) : ((P = n == null ? void 0 : n.buttonStretch) == null ? void 0 : P.stretched) === !0 && (r(o, "display", "block"), r(i, "display", "block")), {
61
- tdStyle: t.join("; "),
62
- align: ((B = n == null ? void 0 : n.buttonAlign) == null ? void 0 : B.align) || void 0,
63
- spanStyle: o.join("; "),
64
- aStyle: i.join("; "),
65
- text: (z = n == null ? void 0 : n.buttonText) == null ? void 0 : z.text
66
- };
67
- }
68
- function T(n) {
69
- if (typeof n == "number" && Number.isFinite(n) && n >= 0)
70
- return Math.trunc(n);
71
- if (typeof n == "string" && /^\d+$/.test(n.trim())) {
72
- const t = Number(n.trim());
73
- if (Number.isFinite(t) && t >= 0)
74
- return t;
75
- }
76
- }
77
- function A(n) {
78
- var t, o;
79
- return {
80
- width: T((t = n == null ? void 0 : n.imageSize) == null ? void 0 : t.width),
81
- height: T((o = n == null ? void 0 : n.imageSize) == null ? void 0 : o.height)
82
- };
83
- }
84
- function F(n, t) {
85
- const o = (n ?? "").trim().replace(/;$/, "").trim(), i = (t ?? "").trim().replace(/;$/, "").trim();
86
- return o ? i ? `${o}; ${i}` : o : i;
87
- }
88
- export {
89
- F as appendStyle,
90
- N as mapButtonTheme,
91
- A as mapImageTheme,
92
- L as mapTextTheme
93
- };
@@ -1,21 +0,0 @@
1
- function r(e) {
2
- if (!e)
3
- return e;
4
- switch (e) {
5
- case "viewedTogether":
6
- return "similarViewed";
7
- case "purchasedTogether":
8
- return "similarBought";
9
- case "trending":
10
- return "trendingProducts";
11
- case "mostValuable":
12
- return "mostValuableOfPartner";
13
- case "topSellers":
14
- return "mostPurchased";
15
- default:
16
- return e;
17
- }
18
- }
19
- export {
20
- r as mapLegacyStrategy
21
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,3 +0,0 @@
1
- export declare const useCouponBlockValidator: () => {
2
- validateCouponBlockTags: (html: string) => boolean;
3
- };
@@ -1,2 +0,0 @@
1
- import { type LegacyVariable, type MappedComposition } from './types';
2
- export declare function mapComposition(variables: LegacyVariable[] | undefined): MappedComposition;
@@ -1,7 +0,0 @@
1
- export declare function extractTitleText(block: Element): string;
2
- /**
3
- * Card background lives on either the block (`bgcolor`/`style`) or per-card
4
- * cells (`.product-card`). Returns empty string when no background is set —
5
- * the caller treats that as "no segment background".
6
- */
7
- export declare function extractCardBgColor(block: Element): string;
@@ -1,11 +0,0 @@
1
- import type { MappedComposition } from './types';
2
- import type { RecommendationNodeConfig } from '@@/Extensions/Blocks/Recommendation/types/nodeConfig';
3
- export declare function buildBlockHtml(params: {
4
- nodeConfig: RecommendationNodeConfig;
5
- composition: MappedComposition;
6
- cardBg: string;
7
- titleText: string;
8
- extraClasses?: string;
9
- legacyId?: string;
10
- legacyBgColor?: string;
11
- }): string;
@@ -1,15 +0,0 @@
1
- import type { LegacyProductConfig } from './types';
2
- /**
3
- * `esd-dev-product-config` is double-HTML-encoded JSON: serialization
4
- * escapes once to embed inside the attribute, and Stripo's templating
5
- * layer escapes a second time when round-tripping. Returns `null` when
6
- * the attribute is missing or unable to be parsed — the caller treats
7
- * either case as an abort.
8
- */
9
- export declare function parseLegacyConfig(block: Element): LegacyProductConfig | null;
10
- /**
11
- * Older legacy templates omitted the canonical
12
- * `ins-recommendation-v3-campaign-id` attribute but always included the
13
- * `ins-recommendation-v3-block-<id>` class — fall back to scraping it.
14
- */
15
- export declare function parseRecommendationId(block: Element): number | null;
@@ -1,7 +0,0 @@
1
- import type { LegacyProductConfig } from './types';
2
- import type { CurrencyConfig, RecommendationNodeConfig } from '@@/Extensions/Blocks/Recommendation/types/nodeConfig';
3
- import type { LegacyRecommendationConfig } from '@@/Types/config';
4
- /** Defensive against missing/malformed legacy `currencySettings` — defaults are per-field, not whole-object. */
5
- export declare function mapCurrency(legacy: unknown): CurrencyConfig;
6
- export type SettingsPartial = Pick<RecommendationNodeConfig, 'recommendationId' | 'strategy' | 'productIds' | 'size' | 'shuffleProducts' | 'language' | 'currency' | 'filters' | 'layout' | 'cardsInRow' | 'mobileCardsInRow' | 'mobileLayoutEnabled' | 'previousMobileCardsInRow' | 'columnSpacing' | 'rowSpacing' | 'mobileColumnSpacing' | 'mobileRowSpacing' | 'omnibusPrice' | 'omnibusDiscount' | 'configVersion'>;
7
- export declare function mapSettings(recCfg: LegacyRecommendationConfig, parsed: LegacyProductConfig, id: number): SettingsPartial;
@@ -1,5 +0,0 @@
1
- import type { LegacyButtonTheme, LegacyImageTheme, LegacyTextTheme, MappedButtonStyle, MappedImageStyle, MappedTextStyle } from './types';
2
- export declare function mapTextTheme(theme: LegacyTextTheme | undefined): MappedTextStyle;
3
- export declare function mapButtonTheme(theme: LegacyButtonTheme | undefined): MappedButtonStyle;
4
- export declare function mapImageTheme(theme: LegacyImageTheme | undefined): MappedImageStyle;
5
- export declare function appendStyle(existing: string | undefined, addition: string | undefined): string;
@@ -1,205 +0,0 @@
1
- /**
2
- * Internal types for the legacy Recommendation block migrator.
3
- *
4
- * The legacy block stores its full state as a JSON blob inside the
5
- * `esd-dev-product-config` HTML attribute. These interfaces describe
6
- * the subset of that schema we depend on. All fields are optional —
7
- * legacy data is heterogeneous and we use defensive optional chaining
8
- * everywhere downstream.
9
- */
10
- /** Per-side numeric values used by border / padding theme fields. */
11
- export interface LegacySides<T = number> {
12
- left?: T;
13
- right?: T;
14
- top?: T;
15
- bottom?: T;
16
- }
17
- /** Padding shape used for both desktop and mobile in legacy theme. */
18
- export interface LegacyPaddingViewport {
19
- all?: number;
20
- top?: number;
21
- right?: number;
22
- bottom?: number;
23
- left?: number;
24
- }
25
- /** Padding object covering both desktop and mobile breakpoints. */
26
- export interface LegacyPadding {
27
- desktop?: LegacyPaddingViewport;
28
- mobile?: LegacyPaddingViewport;
29
- }
30
- /** Border-radius shape — observed in two flavours: shorthand or per-corner. */
31
- export interface LegacyBorderRadius {
32
- /** Single shorthand value (e.g. `radius: 4`). */
33
- radius?: number;
34
- /** Per-corner: top-left / top-right / bottom-right / bottom-left (in px). */
35
- lt?: number;
36
- rt?: number;
37
- rb?: number;
38
- lb?: number;
39
- }
40
- /** Theme attached to text-like variables (name, prices, omnibus, custom-attr). */
41
- export interface LegacyTextTheme {
42
- textStyle?: {
43
- 'font-family'?: string;
44
- 'font-size'?: string;
45
- 'font-weight'?: string;
46
- 'font-style'?: string;
47
- };
48
- textColor?: {
49
- color?: string;
50
- };
51
- textBackgroundColor?: {
52
- color?: string;
53
- };
54
- textPadding?: LegacyPadding;
55
- textLineSpacing?: {
56
- lineSpacing?: string;
57
- 'font-lineSpacing'?: string;
58
- };
59
- textAlign?: {
60
- align?: string;
61
- };
62
- textTrimming?: boolean;
63
- }
64
- /** Theme attached to image variables. */
65
- export interface LegacyImageTheme {
66
- imageSize?: {
67
- width?: number;
68
- height?: number;
69
- };
70
- }
71
- /** Theme attached to the button variable. */
72
- export interface LegacyButtonTheme {
73
- buttonStyle?: {
74
- 'font-family'?: string;
75
- 'font-size'?: string;
76
- 'font-weight'?: string;
77
- 'font-style'?: string;
78
- };
79
- buttonStretch?: {
80
- stretched?: boolean;
81
- };
82
- buttonInternalPadding?: LegacyPadding;
83
- buttonExternalPadding?: LegacyPadding;
84
- buttonText?: {
85
- text?: string;
86
- };
87
- buttonColor?: {
88
- color?: string;
89
- };
90
- textButtonColor?: {
91
- color?: string;
92
- };
93
- buttonBorder?: {
94
- width?: LegacySides<number>;
95
- style?: LegacySides<string>;
96
- color?: LegacySides<string>;
97
- };
98
- buttonBorderRadius?: LegacyBorderRadius;
99
- buttonAlign?: {
100
- align?: string;
101
- };
102
- }
103
- /** Block-level theme. */
104
- export interface LegacyBlockTheme {
105
- blockAdapt?: {
106
- adapt?: boolean;
107
- };
108
- blockPadding?: LegacyPadding;
109
- }
110
- /** Single composition.variable entry from `esd-dev-product-config`. */
111
- export interface LegacyVariable {
112
- /** e.g. `p_name`, `p_button`, `p_attribute_<ts>`. */
113
- variable?: string;
114
- /** Marker that distinguishes custom product attributes (`'p_attribute'`). */
115
- variableType?: string;
116
- /** Selector legacy used to address this element in the HTML. */
117
- visibilityAreaSelector?: string;
118
- /** Custom-attribute value (e.g. `product_attribute.brand`). */
119
- value?: string;
120
- /** Whether the element is hidden in the legacy block. */
121
- hidden?: boolean;
122
- /** Sort order across composition entries (lower = earlier). */
123
- positionIdx?: number;
124
- /** Element-kind-specific theme bag. */
125
- theme?: LegacyTextTheme & LegacyImageTheme & LegacyButtonTheme;
126
- /** Custom attribute marker. */
127
- custom?: boolean;
128
- }
129
- /** Full decoded `esd-dev-product-config` shape. */
130
- export interface LegacyProductConfig {
131
- rowCount?: number;
132
- totalCount?: number;
133
- orientation?: string;
134
- composition?: {
135
- variables?: LegacyVariable[];
136
- };
137
- theme?: LegacyBlockTheme;
138
- }
139
- /** Element kind dispatched from a legacy `variable` value. */
140
- export type ElementKind = 'image' | 'text' | 'button' | 'custom' | 'title';
141
- /** Mapping output from a single legacy variable. */
142
- export interface MappedVariable {
143
- /** Composition key (`productName`, `customAttr:brand`, …) or `__title__` for titles. */
144
- key: string;
145
- kind: ElementKind;
146
- hidden: boolean;
147
- positionIdx: number;
148
- /** Original legacy variable (kept for downstream theme mapping). */
149
- legacy: LegacyVariable;
150
- /** For custom attrs: bare attribute name (e.g. `brand`). */
151
- customAttrName?: string;
152
- /** For custom attrs: full `product-attr` value (e.g. `product_attribute.brand`). */
153
- customAttrValue?: string;
154
- }
155
- /** CSS style strings + attributes resolved from a single text-like theme. */
156
- export interface MappedTextStyle {
157
- /** Inline CSS for outer `<td>` (background, padding). */
158
- tdStyle: string;
159
- /** Inline CSS for inner `<p>` (typography, color, line-height, text-align). */
160
- pStyle: string;
161
- /** Value for `<td align>` attribute, if any. */
162
- align?: string;
163
- /** Whether to wrap content in `<strong>`. */
164
- wrapBold: boolean;
165
- /** Whether to wrap content in `<em>`. */
166
- wrapItalic: boolean;
167
- /** True if `textTrimming: true` in theme. */
168
- textTrimming: boolean;
169
- }
170
- /** Resolved button styles. */
171
- export interface MappedButtonStyle {
172
- /** Inline CSS for outer `<td>` (external padding). */
173
- tdStyle: string;
174
- /** Value for `<td align>`, if any. */
175
- align?: string;
176
- /** Inline CSS for `<span class="es-button-border">`. */
177
- spanStyle: string;
178
- /** Inline CSS for `<a class="es-button">`. */
179
- aStyle: string;
180
- /** Button label text. */
181
- text?: string;
182
- }
183
- /** Resolved image styles. */
184
- export interface MappedImageStyle {
185
- /** Width in pixels (number form) — applied as both `width=` attr and CSS. */
186
- width?: number;
187
- /** Height in pixels. */
188
- height?: number;
189
- }
190
- /** Per-variable mapped style bag, keyed by composition key. */
191
- export type PerElementStyles = Record<string, MappedTextStyle | MappedButtonStyle | MappedImageStyle | undefined>;
192
- /** Composition mapper output. */
193
- export interface MappedComposition {
194
- composition: string[];
195
- visibility: Record<string, boolean>;
196
- customAttributes: string[];
197
- /** Mapping of customAttr key → full `product-attr` value. */
198
- customAttrValues: Record<string, string>;
199
- /** Title variable, if present (for separate title rendering). */
200
- titleVariable?: LegacyVariable;
201
- /** Resolved styles per composition key. */
202
- perElementStyles: PerElementStyles;
203
- /** Whether *any* element had `textTrimming: true`. */
204
- anyTextTrimming: boolean;
205
- }
@@ -1,21 +0,0 @@
1
- /**
2
- * Maps legacy algorithm strategy keys (used by templates authored against the
3
- * old recommendation system) to the new keys used by `RecommendationFeedSourceMaps`.
4
- *
5
- * Renames are matched by feed-source id:
6
- * - `viewedTogether` → `similarViewed` (id 11, path `viewed-together`)
7
- * - `purchasedTogether` → `similarBought` (id 12, path `purchased-together`)
8
- * - `trending` → `trendingProducts` (id 40, path `trending`)
9
- * - `mostValuable` → `mostValuableOfPartner` (id 46, path `most-valuable`)
10
- * - `topSellers` → `mostPurchased` (id 62, path `top-sellers`)
11
- *
12
- * Used at two boundaries:
13
- * 1. The migrator (`settingsMapper`), so freshly migrated node configs carry
14
- * the new key.
15
- * 2. The algorithm dropdown control, so already-saved blocks that still carry
16
- * a legacy key resolve to a matching dropdown option.
17
- *
18
- * Unknown values pass through untouched so a future-added algorithm doesn't
19
- * silently default.
20
- */
21
- export declare function mapLegacyStrategy(legacy: string | undefined): string | undefined;
@@ -1,5 +0,0 @@
1
- /**
2
- * Escape HTML special characters for safe inclusion in attribute values
3
- * or text content. Use for any string that may contain untrusted input.
4
- */
5
- export declare function escapeHtml(text: string): string;
@@ -1 +0,0 @@
1
- export {};
@@ -1,13 +0,0 @@
1
- const c = {
2
- "&": "&amp;",
3
- "<": "&lt;",
4
- ">": "&gt;",
5
- '"': "&quot;",
6
- "'": "&#x27;"
7
- };
8
- function n(t) {
9
- return t.replace(/[&<>"']/g, (e) => c[e]);
10
- }
11
- export {
12
- n as escapeHtml
13
- };