@useinsider/guido 3.17.0-beta.58179dc → 3.17.0-beta.668ca65

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 (80) hide show
  1. package/README.md +1 -0
  2. package/dist/@types/config/schemas.js +7 -6
  3. package/dist/components/Guido.vue.js +8 -8
  4. package/dist/components/Guido.vue2.js +77 -73
  5. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +21 -0
  6. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +105 -0
  7. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.js +19 -0
  8. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +62 -0
  9. package/dist/composables/useCustomInterfaceAppearance.js +52 -38
  10. package/dist/composables/useRecommendation.js +41 -34
  11. package/dist/config/migrator/index.js +8 -9
  12. package/dist/config/migrator/recommendation/compositionMapper.js +20 -20
  13. package/dist/config/migrator/recommendation/extractors.js +24 -29
  14. package/dist/config/migrator/recommendation/htmlBuilder.js +130 -116
  15. package/dist/config/migrator/recommendation/settingsMapper.js +17 -17
  16. package/dist/config/migrator/recommendationMigrator.js +14 -16
  17. package/dist/enums/academy.js +2 -1
  18. package/dist/enums/date.js +5 -3
  19. package/dist/enums/extensions/recommendationBlock.js +3 -1
  20. package/dist/extensions/Blocks/Recommendation/block.js +27 -51
  21. package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
  22. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  23. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +24 -25
  24. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +28 -34
  25. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +256 -323
  26. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +162 -167
  27. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +124 -0
  28. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +0 -1
  29. package/dist/extensions/Blocks/Recommendation/extension.js +29 -31
  30. package/dist/extensions/Blocks/Recommendation/services/configService.js +35 -35
  31. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +4 -23
  32. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +165 -79
  33. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +3 -3
  34. package/dist/extensions/Blocks/Recommendation/templates/utils.js +107 -85
  35. package/dist/extensions/Blocks/common-control.js +22 -19
  36. package/dist/guido.css +1 -1
  37. package/dist/services/recommendationApi.js +69 -30
  38. package/dist/src/@types/config/schemas.d.ts +2 -0
  39. package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +3 -0
  40. package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts +15 -0
  41. package/dist/src/composables/useConfig.d.ts +2 -0
  42. package/dist/src/composables/useRecommendation.d.ts +1 -0
  43. package/dist/src/config/migrator/recommendation/extractors.d.ts +0 -8
  44. package/dist/src/enums/academy.d.ts +1 -0
  45. package/dist/src/enums/date.d.ts +1 -0
  46. package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -0
  47. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -15
  48. package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +1 -2
  49. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +0 -7
  50. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +2 -7
  51. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +2 -2
  52. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +0 -10
  53. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +0 -10
  54. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +0 -1
  55. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +10 -4
  56. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +16 -0
  57. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +0 -1
  58. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +150 -10
  59. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +1 -0
  60. package/dist/src/extensions/Blocks/common-control.d.ts +4 -1
  61. package/dist/src/mock/api/recommendation-strategies.d.ts +2 -0
  62. package/dist/src/services/recommendationApi.d.ts +4 -1
  63. package/dist/src/stores/config.d.ts +18 -0
  64. package/dist/src/stores/save-as-template.d.ts +4 -3
  65. package/dist/static/assets/icons/line-change.svg.js +5 -0
  66. package/dist/static/assets/icons/line-delete.svg.js +5 -0
  67. package/dist/static/assets/icons/line-plus.svg.js +5 -0
  68. package/dist/static/styles/components/recommendation-strategy.css.js +155 -0
  69. package/dist/static/styles/customEditorStyle.css.js +1 -3
  70. package/dist/utils/dateUtil.js +23 -10
  71. package/dist/utils/templatePreparation.js +35 -34
  72. package/package.json +2 -1
  73. package/dist/config/migrator/recommendationTitleMigrator.js +0 -119
  74. package/dist/extensions/Blocks/Recommendation/controls/title/index.js +0 -44
  75. package/dist/extensions/Blocks/Recommendation/templates/titleRows.js +0 -33
  76. package/dist/extensions/Blocks/Recommendation/utils/legacyTitle.js +0 -20
  77. package/dist/src/config/migrator/recommendationTitleMigrator.d.ts +0 -5
  78. package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +0 -86
  79. package/dist/src/extensions/Blocks/Recommendation/templates/titleRows.d.ts +0 -13
  80. package/dist/src/extensions/Blocks/Recommendation/utils/legacyTitle.d.ts +0 -20
@@ -1,12 +1,4 @@
1
1
  export declare function extractTitleText(block: Element): string;
2
- /**
3
- * Fallback for legacy configs that carry no `p_recommendation_title` variable:
4
- * the rendered HTML decides. A missing or `display: none` title container means
5
- * the user never saw a title, so the migrated block keeps it toggled off.
6
- * @param block - The legacy recommendation block element
7
- * @returns True when the legacy block renders a visible title
8
- */
9
- export declare function hasVisibleTitle(block: Element): boolean;
10
2
  /**
11
3
  * Card background lives on either the block (`bgcolor`/`style`) or per-card
12
4
  * cells (`.product-card`). Returns empty string when no background is set —
@@ -8,5 +8,6 @@ export declare const ACADEMY_LINKS: {
8
8
  readonly EMAIL_EDITOR: "https://academy.insiderone.com/docs/email-drag-and-drop-editor";
9
9
  readonly GLOBAL_UNSUBSCRIBE: "https://academy.insiderone.com/docs/global-unsubscribe-preference-center";
10
10
  readonly AMP_FOR_EMAILS: "https://academy.insiderone.com/docs/amp-for-emails";
11
+ readonly EMAIL_RECOMMENDATION_BLOCK: "https://academy.insiderone.com/docs/new-editor-email-recommendation-block";
11
12
  };
12
13
  export type AcademyLinkKey = keyof typeof ACADEMY_LINKS;
@@ -1,4 +1,5 @@
1
1
  export declare const DEFAULT_LOCALE = "tr-TR";
2
+ export declare const DOTTED_DATE_LOCALE = "tr-TR";
2
3
  export declare const DEFAULT = "default";
3
4
  export declare const DEFAULT_TZ = "UTC";
4
5
  export declare const FORMAT_MAPPING: Record<string, string>;
@@ -3,6 +3,8 @@ import type { RecommendationFeedItem } from '@@/Types/recommendation';
3
3
  export declare const URLS: {
4
4
  RECOMMENDATION_API_URL: string;
5
5
  PRODUCT_ATTRIBUTES_PATH: string;
6
+ RECOMMENDATION_STRATEGIES_PATH: string;
7
+ RECOMMENDATION_STRATEGIES_PANEL_PATH: string;
6
8
  };
7
9
  export declare const QUERY_PARAMS: {
8
10
  CLIENT_ID: string;
@@ -48,21 +48,6 @@ export declare class RecommendationBlock extends Block {
48
48
  * @param node - The block node that may need migration
49
49
  */
50
50
  onDocumentChanged(node: ImmutableHtmlNode): void;
51
- /**
52
- * Adopts the plain text cell a pre-SD-147795 block used as its title.
53
- *
54
- * `recommendationTitleMigrator` tags that cell before the document is handed
55
- * to Stripo, but Stripo serves a template it already holds in its own storage
56
- * (`forceRecreate: false`) and drops the HTML we pass, so for an already-saved
57
- * campaign the tagging only ever lands here. Without it the title is an
58
- * ordinary text block: Card Composition reads the toggle as off while the
59
- * title is on screen, switching it on prepends a second title, and the cell
60
- * keeps the generic delete/duplicate node actions the CSS hides by class.
61
- *
62
- * Partner-managed blocks are left alone, the same exclusion the migrator makes.
63
- * @param node - The block node that may still carry an untagged title
64
- */
65
- private _healLegacyTitle;
66
51
  /**
67
52
  * Called when a block is deleted from the template
68
53
  *
@@ -10,6 +10,5 @@ export declare enum RecommendationBlockId {
10
10
  OMNIBUS_PRICE = "recommendation-block-omnibus-price",
11
11
  OMNIBUS_DISCOUNT = "recommendation-block-omnibus-discount",
12
12
  IMAGE = "recommendation-block-image",
13
- CUSTOM_ATTRIBUTE = "recommendation-block-custom-attribute",
14
- TITLE = "recommendation-block-title"
13
+ CUSTOM_ATTRIBUTE = "recommendation-block-custom-attribute"
15
14
  }
@@ -65,12 +65,5 @@ export declare enum RecommendationControlId {
65
65
  CUSTOM_ATTR_SIZE = "recommendation-block-custom-attr-size-control",
66
66
  CUSTOM_ATTR_STYLE = "recommendation-block-custom-attr-style-control",
67
67
  CUSTOM_ATTR_TEXT_TRIM = "recommendation-block-custom-attr-text-trim-control",
68
- TITLE_ALIGN = "recommendation-block-title-align-control",
69
- TITLE_BACKGROUND = "recommendation-block-title-background-control",
70
- TITLE_COLOR = "recommendation-block-title-color-control",
71
- TITLE_FONT_FAMILY = "recommendation-block-title-font-family-control",
72
- TITLE_PADDINGS = "recommendation-block-title-paddings-control",
73
- TITLE_SIZE = "recommendation-block-title-size-control",
74
- TITLE_STYLE = "recommendation-block-title-style-control",
75
68
  SYNC_INFO_MESSAGE = "recommendation-block-sync-info-message"
76
69
  }
@@ -8,6 +8,8 @@
8
8
  * - Merging partial updates with existing config
9
9
  */
10
10
  import type { RecommendationNodeConfig, CurrencyConfig, OmnibusTextConfig } from '../types/nodeConfig';
11
+ export declare const PRE_RRS_CONFIG_VERSION = 1;
12
+ export declare const CURRENT_CONFIG_VERSION = 2;
11
13
  /**
12
14
  * Default currency configuration
13
15
  * Uses USD as the base currency with standard formatting
@@ -32,7 +34,6 @@ export declare const DEFAULT_COMPOSITION: string[];
32
34
  /**
33
35
  * Default visibility settings for card elements
34
36
  * Omnibus elements are hidden by default (not all regions require them)
35
- * The block-level title is visible on a fresh drop.
36
37
  */
37
38
  export declare const DEFAULT_VISIBILITY: Record<string, boolean>;
38
39
  /**
@@ -48,9 +49,3 @@ export declare const DEFAULT_NODE_CONFIG: RecommendationNodeConfig;
48
49
  * View Together and Purchase Together algorithms are disabled because these require product id.
49
50
  */
50
51
  export declare const EXCLUDED_ALGORITHM_IDS: number[];
51
- /**
52
- * Current configuration version
53
- * Increment this when making breaking changes to the schema
54
- * Used for migration detection
55
- */
56
- export declare const CURRENT_CONFIG_VERSION = 1;
@@ -8,6 +8,6 @@
8
8
  */
9
9
  export { RecommendationBlockId } from './blockIds';
10
10
  export { RecommendationControlId } from './controlIds';
11
- export { BLOCK_ROOT_SELECTOR, CONTAINER_SELECTOR, DESKTOP_CONTAINER_SELECTOR, MOBILE_CONTAINER_SELECTOR, MOBILE_ROW_SELECTOR, CSS_CLASS_RECO_BUTTON, CSS_CLASS_SKIP_COMPILE, RECOMMENDATION_VARIABLE_BUILTIN_ATTRIBUTES, CURRENCY_ATTR, ATTR_PRODUCT_IMAGE, ATTR_PRODUCT_NAME, ATTR_PRODUCT_PRICE, ATTR_PRODUCT_OLD_PRICE, ATTR_PRODUCT_OMNIBUS_PRICE, ATTR_PRODUCT_OMNIBUS_DISCOUNT, ATTR_PRODUCT_BUTTON, ATTR_RECOMMENDATION_TITLE, SELECTOR_TITLE_CELL, ATTR_CUSTOM_PREFIX, ATTR_DATA_CARD_COMPOSITION, ATTR_DATA_CUSTOM_ATTRIBUTES, ATTR_PRODUCT_ATTR, CSS_CLASS_ATTRIBUTE_ROW, CSS_CLASS_SPACER, SELECTOR_ATTRIBUTE_ROW, ATTR_DATA_ATTRIBUTE_TYPE, ATTR_DATA_VISIBILITY, PRODUCT_ATTRIBUTE_PREFIX, BUILT_IN_DEFAULT_ATTRIBUTES, } from './selectors';
11
+ export { BLOCK_ROOT_SELECTOR, CONTAINER_SELECTOR, DESKTOP_CONTAINER_SELECTOR, MOBILE_CONTAINER_SELECTOR, MOBILE_ROW_SELECTOR, CSS_CLASS_RECO_BUTTON, CSS_CLASS_SKIP_COMPILE, RECOMMENDATION_VARIABLE_BUILTIN_ATTRIBUTES, CURRENCY_ATTR, ATTR_PRODUCT_IMAGE, ATTR_PRODUCT_NAME, ATTR_PRODUCT_PRICE, ATTR_PRODUCT_OLD_PRICE, ATTR_PRODUCT_OMNIBUS_PRICE, ATTR_PRODUCT_OMNIBUS_DISCOUNT, ATTR_PRODUCT_BUTTON, ATTR_CUSTOM_PREFIX, ATTR_DATA_CARD_COMPOSITION, ATTR_DATA_CUSTOM_ATTRIBUTES, ATTR_PRODUCT_ATTR, SELECTOR_ATTRIBUTE_ROW, ATTR_DATA_ATTRIBUTE_TYPE, PRODUCT_ATTRIBUTE_PREFIX, BUILT_IN_DEFAULT_ATTRIBUTES, } from './selectors';
12
12
  export { LAYOUT_VALUES, LAYOUT_OPTIONS, DEFAULT_PRODUCTS_PER_ROW, DEFAULT_CARDS_IN_ROW, DEFAULT_MOBILE_CARDS_IN_ROW, MAX_PRODUCT_COUNT, MIN_PRODUCT_COUNT, MAX_PRODUCTS_PER_ROW, MIN_PRODUCTS_PER_ROW, MAX_MOBILE_PRODUCTS_PER_ROW, MIN_MOBILE_PRODUCTS_PER_ROW, DEFAULT_COLUMN_SPACING, DEFAULT_ROW_SPACING, DEFAULT_MOBILE_COLUMN_SPACING, DEFAULT_MOBILE_ROW_SPACING, MIN_SPACING, MAX_SPACING, SPACING_STEP, } from './layout';
13
- export { DEFAULT_NODE_CONFIG, DEFAULT_CURRENCY, DEFAULT_COMPOSITION, DEFAULT_VISIBILITY, CURRENT_CONFIG_VERSION, EXCLUDED_ALGORITHM_IDS, } from './defaultConfig';
13
+ export { DEFAULT_NODE_CONFIG, DEFAULT_CURRENCY, DEFAULT_COMPOSITION, DEFAULT_VISIBILITY, CURRENT_CONFIG_VERSION, PRE_RRS_CONFIG_VERSION, EXCLUDED_ALGORITHM_IDS, } from './defaultConfig';
@@ -58,10 +58,6 @@ export declare const ATTR_PRODUCT_OLD_PRICE = "productOldPrice";
58
58
  export declare const ATTR_PRODUCT_OMNIBUS_PRICE = "productOmnibusPrice";
59
59
  export declare const ATTR_PRODUCT_OMNIBUS_DISCOUNT = "productOmnibusDiscount";
60
60
  export declare const ATTR_PRODUCT_BUTTON = "productButton";
61
- export declare const ATTR_RECOMMENDATION_TITLE = "recommendationTitle";
62
- export declare const CSS_CLASS_TITLE_CELL = "ins-recommendation-title";
63
- /** Title cell — the only `esd-block-text` living outside the product containers. */
64
- export declare const SELECTOR_TITLE_CELL = ".ins-recommendation-title";
65
61
  /**
66
62
  * Custom attribute constants
67
63
  * Used for dynamically added product attributes in Card Composition
@@ -74,16 +70,10 @@ export declare const ATTR_DATA_CUSTOM_ATTRIBUTES = "data-custom-attributes";
74
70
  export declare const ATTR_DATA_CARD_COMPOSITION = "data-card-composition";
75
71
  /** HTML attribute on <td> elements identifying the product attribute for compiler template variable generation */
76
72
  export declare const ATTR_PRODUCT_ATTR = "product-attr";
77
- /** Class every composition attribute row carries — the visibility toggle and the compiler both key on it */
78
- export declare const CSS_CLASS_ATTRIBUTE_ROW = "recommendation-attribute-row";
79
73
  /** Row wrapper of one composition entry inside a product card */
80
74
  export declare const SELECTOR_ATTRIBUTE_ROW = ".recommendation-attribute-row";
81
75
  /** HTML attribute on an attribute row holding its composition key */
82
76
  export declare const ATTR_DATA_ATTRIBUTE_TYPE = "data-attribute-type";
83
- /** HTML attribute on an attribute row holding its visibility (`1` / `0`) */
84
- export declare const ATTR_DATA_VISIBILITY = "data-visibility";
85
- /** Class on the spacer cell of the row that trails a title */
86
- export declare const CSS_CLASS_SPACER = "spacer";
87
77
  /** Prefix `resolveProductAttrValue` puts on custom (non-default) product attributes in `product-attr` values */
88
78
  export declare const PRODUCT_ATTRIBUTE_PREFIX = "product_attribute.";
89
79
  /**
@@ -33,8 +33,6 @@ export declare class RecommendationCardCompositionControl extends CommonControl
33
33
  private _normalizeComposition;
34
34
  private _readCustomAttributesFromNode;
35
35
  private _readVisibilityFromRows;
36
- private _withTitlePresence;
37
- private _hasTitle;
38
36
  private _getDefaultVisibilities;
39
37
  private _extractVisibilityFromRows;
40
38
  private _parseVisibilityValue;
@@ -189,14 +187,6 @@ export declare class RecommendationCardCompositionControl extends CommonControl
189
187
  */
190
188
  private _buildCompositionHtml;
191
189
  private _applyVisibilityToBlock;
192
- private _applyTitleVisibilityToBlock;
193
- private _resolveTitleInjection;
194
- private _findTitleRows;
195
- private _findTitleRowsByClass;
196
- private _isSpacerRow;
197
- private _findTitleContainerBody;
198
- private _readInnerHtml;
199
- private _defaultTitleParagraph;
200
190
  /**
201
191
  * Finds the composition array index for the Nth custom attribute (0-based).
202
192
  * Scans left-to-right, counting only entries with the custom prefix.
@@ -11,7 +11,6 @@
11
11
  */
12
12
  export { RecommendationBlockControl, CONTROL_BLOCK_ID, AlgorithmControl, ALGORITHM_CONTROL_ID, LocaleControl, LOCALE_CONTROL_ID, CurrencyControl, CURRENCY_CONTROL_ID, ProductCountControl, PRODUCT_COUNT_CONTROL_ID, ProductLayoutControl, PRODUCT_LAYOUT_CONTROL_ID, FiltersControl, FILTERS_CONTROL_ID, ShuffleControl, SHUFFLE_CONTROL_ID, LayoutOrientationControl, LAYOUT_ORIENTATION_CONTROL_ID, PricePlacementControl, PRICE_PLACEMENT_CONTROL_ID, } from './main';
13
13
  export * from './main/utils';
14
- export { TitleControls } from './title';
15
14
  export { NameControls } from './name';
16
15
  export { PriceControls } from './price';
17
16
  export { OldPriceControls } from './oldPrice';
@@ -9,8 +9,9 @@ import { PricePlacementControl, PRICE_PLACEMENT_CONTROL_ID } from './pricePlacem
9
9
  import { ProductCountControl, PRODUCT_COUNT_CONTROL_ID } from './productCount';
10
10
  import { ProductLayoutControl, PRODUCT_LAYOUT_CONTROL_ID } from './productLayout';
11
11
  import { ShuffleControl, SHUFFLE_CONTROL_ID } from './shuffle';
12
+ import { StrategyControl, STRATEGY_CONTROL_ID } from './strategy';
12
13
  export declare const CONTROL_BLOCK_ID = "ui-elements-recommendation-block";
13
- export { AlgorithmControl, ALGORITHM_CONTROL_ID, LocaleControl, LOCALE_CONTROL_ID, CurrencyControl, CURRENCY_CONTROL_ID, ProductCountControl, PRODUCT_COUNT_CONTROL_ID, ProductLayoutControl, PRODUCT_LAYOUT_CONTROL_ID, FiltersControl, FILTERS_CONTROL_ID, ShuffleControl, SHUFFLE_CONTROL_ID, LayoutOrientationControl, LAYOUT_ORIENTATION_CONTROL_ID, PricePlacementControl, PRICE_PLACEMENT_CONTROL_ID, };
14
+ export { AlgorithmControl, ALGORITHM_CONTROL_ID, LocaleControl, LOCALE_CONTROL_ID, CurrencyControl, CURRENCY_CONTROL_ID, ProductCountControl, PRODUCT_COUNT_CONTROL_ID, ProductLayoutControl, PRODUCT_LAYOUT_CONTROL_ID, FiltersControl, FILTERS_CONTROL_ID, ShuffleControl, SHUFFLE_CONTROL_ID, LayoutOrientationControl, LAYOUT_ORIENTATION_CONTROL_ID, PricePlacementControl, PRICE_PLACEMENT_CONTROL_ID, StrategyControl, STRATEGY_CONTROL_ID, };
14
15
  export * from './utils';
15
16
  /**
16
17
  * Main recommendation block control that composes all sub-controls
@@ -29,8 +30,12 @@ export declare class RecommendationBlockControl extends CommonControl {
29
30
  private shuffleControl;
30
31
  private pricePlacementControl;
31
32
  private layoutOrientationControl;
33
+ private strategyControl;
34
+ private rrsEnabled;
32
35
  getId(): string;
36
+ private get _subControls();
33
37
  getTemplate(): string;
38
+ private _showControlsForBlock;
34
39
  onRender(): Promise<void>;
35
40
  onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
36
41
  onDestroy(): void;
@@ -42,7 +47,6 @@ export declare class RecommendationBlockControl extends CommonControl {
42
47
  /**
43
48
  * Syncs persisted node config into the Pinia store's block state.
44
49
  *
45
- * setCurrentBlock() creates a default entry (USD, en_US, mostPopular).
46
50
  * For saved templates, the real config lives in the node (e.g., TRY, tr_TR).
47
51
  * This method reads it and patches the store so fetchRecommendationProducts()
48
52
  * uses the correct values.
@@ -107,8 +111,10 @@ export declare class RecommendationBlockControl extends CommonControl {
107
111
  */
108
112
  private _listenStateUpdates;
109
113
  /**
110
- * Persists the current filter state from Pinia store to the Stripo node config.
111
- * This ensures filters survive template save/reload cycles.
114
+ * Persists filter + strategy state to the Stripo node config so it survives
115
+ * save/reload (strategyId must reach esd-ext-config before any save).
116
+ * `size` rides along: assigning a strategy writes it to the store only, and a
117
+ * stale node config would rebuild the block against the old slot count.
112
118
  */
113
119
  private _persistFiltersToNodeConfig;
114
120
  }
@@ -0,0 +1,16 @@
1
+ import { CommonControl } from '../../../common-control';
2
+ export declare const STRATEGY_CONTROL_ID = "recommendation-strategy-control";
3
+ export declare class StrategyControl extends CommonControl {
4
+ private store;
5
+ private storeUnsubscription;
6
+ private listeners;
7
+ private lastPaintedState;
8
+ getId(): string;
9
+ getTemplate(): string;
10
+ private _strategyAction;
11
+ onRender(): void;
12
+ onDestroy(): void;
13
+ private _teardown;
14
+ private _setupButtonListeners;
15
+ private _renderState;
16
+ }
@@ -70,7 +70,6 @@ export interface RegenerateProductRowsOptions {
70
70
  /** Optional: pass composition directly to avoid stale DOM reads after setAttribute */
71
71
  composition?: string[];
72
72
  }
73
- export declare function getMainContainerTbody(currentNode: ImmutableHtmlNode): ImmutableHtmlNode | null;
74
73
  /**
75
74
  * Regenerates only the mobile product container rows and commits in a single apply().
76
75
  * Standalone entry point for callers that change mobile-only settings
@@ -1,4 +1,4 @@
1
- import type { Orientation, Languages, Currency, NumericSeparator, FiltersResponse, Filter, RecommendationProduct } from '@@/Types/recommendation';
1
+ import type { Orientation, Languages, Currency, NumericSeparator, FiltersResponse, Filter, RecommendationCampaignUrlValue, RecommendationProduct, RrsStrategy } from '@@/Types/recommendation';
2
2
  export interface PerBlockConfigs {
3
3
  cardsInRow: number;
4
4
  currencySettings: {
@@ -21,6 +21,7 @@ export interface PerBlockConfigs {
21
21
  sendProductRequestFlag: boolean;
22
22
  shuffleProducts: boolean;
23
23
  strategy: string;
24
+ strategyId: string;
24
25
  textTrimming: boolean;
25
26
  unresponsive: boolean;
26
27
  size: string;
@@ -33,6 +34,7 @@ interface PerBlockState {
33
34
  recommendationProducts: RecommendationProduct[];
34
35
  filterStatus: boolean;
35
36
  filterSelectionDrawerStatus: boolean;
37
+ assignStrategyDrawerStatus: boolean;
36
38
  filterGroup: number;
37
39
  /** Whether initial API data (filters, algorithms, products) has been fetched for this block */
38
40
  isInitialized: boolean;
@@ -47,6 +49,7 @@ interface PerBlockState {
47
49
  */
48
50
  export interface PerBlockUrlConfig {
49
51
  strategy: string;
52
+ strategyId: string;
50
53
  language: string;
51
54
  size: string;
52
55
  productIds: string[];
@@ -59,11 +62,14 @@ export interface PerBlockUrlConfig {
59
62
  currencyThousandSeparator: string;
60
63
  }
61
64
  interface StoreState {
62
- recommendationCampaignUrls: Record<string, string>;
65
+ recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
63
66
  activePredictiveAlgorithms: number[];
64
67
  languages: Languages;
65
68
  currencyList: Currency[];
66
69
  filterList: FiltersResponse;
70
+ strategies: RrsStrategy[];
71
+ strategiesLoading: boolean;
72
+ strategyUrlTemplates: Record<string, string>;
67
73
  blockStates: Record<number, PerBlockState>;
68
74
  currentRecommendationId: number | null;
69
75
  configVersion: number;
@@ -74,7 +80,7 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
74
80
  * This allows all existing code that reads `store.recommendationConfigs` to work unchanged.
75
81
  */
76
82
  recommendationConfigs(state: {
77
- recommendationCampaignUrls: Record<string, string>;
83
+ recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
78
84
  activePredictiveAlgorithms: number[];
79
85
  languages: Languages;
80
86
  currencyList: {
@@ -82,6 +88,16 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
82
88
  value: string;
83
89
  }[];
84
90
  filterList: FiltersResponse;
91
+ strategies: {
92
+ [x: string]: unknown;
93
+ strategy_id: number;
94
+ name: string;
95
+ status: string;
96
+ suitable_channels: string;
97
+ size?: (number | string) | undefined;
98
+ }[];
99
+ strategiesLoading: boolean;
100
+ strategyUrlTemplates: Record<string, string>;
85
101
  blockStates: Record<number, PerBlockState>;
86
102
  currentRecommendationId: number | null;
87
103
  configVersion: number;
@@ -90,7 +106,7 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
90
106
  * Proxy getter: delegates to blockStates[currentRecommendationId].recommendationProducts
91
107
  */
92
108
  recommendationProducts(state: {
93
- recommendationCampaignUrls: Record<string, string>;
109
+ recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
94
110
  activePredictiveAlgorithms: number[];
95
111
  languages: Languages;
96
112
  currencyList: {
@@ -98,6 +114,16 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
98
114
  value: string;
99
115
  }[];
100
116
  filterList: FiltersResponse;
117
+ strategies: {
118
+ [x: string]: unknown;
119
+ strategy_id: number;
120
+ name: string;
121
+ status: string;
122
+ suitable_channels: string;
123
+ size?: (number | string) | undefined;
124
+ }[];
125
+ strategiesLoading: boolean;
126
+ strategyUrlTemplates: Record<string, string>;
101
127
  blockStates: Record<number, PerBlockState>;
102
128
  currentRecommendationId: number | null;
103
129
  configVersion: number;
@@ -106,7 +132,30 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
106
132
  * Proxy getter: delegates to blockStates[currentRecommendationId].filterSelectionDrawerStatus
107
133
  */
108
134
  filterSelectionDrawerStatus(state: {
109
- recommendationCampaignUrls: Record<string, string>;
135
+ recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
136
+ activePredictiveAlgorithms: number[];
137
+ languages: Languages;
138
+ currencyList: {
139
+ text: string;
140
+ value: string;
141
+ }[];
142
+ filterList: FiltersResponse;
143
+ strategies: {
144
+ [x: string]: unknown;
145
+ strategy_id: number;
146
+ name: string;
147
+ status: string;
148
+ suitable_channels: string;
149
+ size?: (number | string) | undefined;
150
+ }[];
151
+ strategiesLoading: boolean;
152
+ strategyUrlTemplates: Record<string, string>;
153
+ blockStates: Record<number, PerBlockState>;
154
+ currentRecommendationId: number | null;
155
+ configVersion: number;
156
+ } & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
157
+ assignStrategyDrawerStatus(state: {
158
+ recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
110
159
  activePredictiveAlgorithms: number[];
111
160
  languages: Languages;
112
161
  currencyList: {
@@ -114,15 +163,48 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
114
163
  value: string;
115
164
  }[];
116
165
  filterList: FiltersResponse;
166
+ strategies: {
167
+ [x: string]: unknown;
168
+ strategy_id: number;
169
+ name: string;
170
+ status: string;
171
+ suitable_channels: string;
172
+ size?: (number | string) | undefined;
173
+ }[];
174
+ strategiesLoading: boolean;
175
+ strategyUrlTemplates: Record<string, string>;
117
176
  blockStates: Record<number, PerBlockState>;
118
177
  currentRecommendationId: number | null;
119
178
  configVersion: number;
120
179
  } & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
180
+ assignedStrategy(state: {
181
+ recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
182
+ activePredictiveAlgorithms: number[];
183
+ languages: Languages;
184
+ currencyList: {
185
+ text: string;
186
+ value: string;
187
+ }[];
188
+ filterList: FiltersResponse;
189
+ strategies: {
190
+ [x: string]: unknown;
191
+ strategy_id: number;
192
+ name: string;
193
+ status: string;
194
+ suitable_channels: string;
195
+ size?: (number | string) | undefined;
196
+ }[];
197
+ strategiesLoading: boolean;
198
+ strategyUrlTemplates: Record<string, string>;
199
+ blockStates: Record<number, PerBlockState>;
200
+ currentRecommendationId: number | null;
201
+ configVersion: number;
202
+ } & import("pinia").PiniaCustomStateProperties<StoreState>): RrsStrategy | null;
121
203
  /**
122
204
  * Proxy getter: delegates to blockStates[currentRecommendationId].filterStatus
123
205
  */
124
206
  filterStatus(state: {
125
- recommendationCampaignUrls: Record<string, string>;
207
+ recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
126
208
  activePredictiveAlgorithms: number[];
127
209
  languages: Languages;
128
210
  currencyList: {
@@ -130,6 +212,16 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
130
212
  value: string;
131
213
  }[];
132
214
  filterList: FiltersResponse;
215
+ strategies: {
216
+ [x: string]: unknown;
217
+ strategy_id: number;
218
+ name: string;
219
+ status: string;
220
+ suitable_channels: string;
221
+ size?: (number | string) | undefined;
222
+ }[];
223
+ strategiesLoading: boolean;
224
+ strategyUrlTemplates: Record<string, string>;
133
225
  blockStates: Record<number, PerBlockState>;
134
226
  currentRecommendationId: number | null;
135
227
  configVersion: number;
@@ -138,7 +230,7 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
138
230
  * Proxy getter: delegates to blockStates[currentRecommendationId].filterGroup
139
231
  */
140
232
  filterGroup(state: {
141
- recommendationCampaignUrls: Record<string, string>;
233
+ recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
142
234
  activePredictiveAlgorithms: number[];
143
235
  languages: Languages;
144
236
  currencyList: {
@@ -146,6 +238,16 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
146
238
  value: string;
147
239
  }[];
148
240
  filterList: FiltersResponse;
241
+ strategies: {
242
+ [x: string]: unknown;
243
+ strategy_id: number;
244
+ name: string;
245
+ status: string;
246
+ suitable_channels: string;
247
+ size?: (number | string) | undefined;
248
+ }[];
249
+ strategiesLoading: boolean;
250
+ strategyUrlTemplates: Record<string, string>;
149
251
  blockStates: Record<number, PerBlockState>;
150
252
  currentRecommendationId: number | null;
151
253
  configVersion: number;
@@ -155,7 +257,7 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
155
257
  getFilterGroupCount(): number;
156
258
  getUniqueFilterGroups(): number[];
157
259
  getActivePredictiveAlgorithms: (state: {
158
- recommendationCampaignUrls: Record<string, string>;
260
+ recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
159
261
  activePredictiveAlgorithms: number[];
160
262
  languages: Languages;
161
263
  currencyList: {
@@ -163,6 +265,16 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
163
265
  value: string;
164
266
  }[];
165
267
  filterList: FiltersResponse;
268
+ strategies: {
269
+ [x: string]: unknown;
270
+ strategy_id: number;
271
+ name: string;
272
+ status: string;
273
+ suitable_channels: string;
274
+ size?: (number | string) | undefined;
275
+ }[];
276
+ strategiesLoading: boolean;
277
+ strategyUrlTemplates: Record<string, string>;
166
278
  blockStates: Record<number, PerBlockState>;
167
279
  currentRecommendationId: number | null;
168
280
  configVersion: number;
@@ -171,7 +283,7 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
171
283
  value: string;
172
284
  }[];
173
285
  getLanguages: (state: {
174
- recommendationCampaignUrls: Record<string, string>;
286
+ recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
175
287
  activePredictiveAlgorithms: number[];
176
288
  languages: Languages;
177
289
  currencyList: {
@@ -179,6 +291,16 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
179
291
  value: string;
180
292
  }[];
181
293
  filterList: FiltersResponse;
294
+ strategies: {
295
+ [x: string]: unknown;
296
+ strategy_id: number;
297
+ name: string;
298
+ status: string;
299
+ suitable_channels: string;
300
+ size?: (number | string) | undefined;
301
+ }[];
302
+ strategiesLoading: boolean;
303
+ strategyUrlTemplates: Record<string, string>;
182
304
  blockStates: Record<number, PerBlockState>;
183
305
  currentRecommendationId: number | null;
184
306
  configVersion: number;
@@ -187,7 +309,7 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
187
309
  value: string;
188
310
  }[];
189
311
  getCurrencySymbolList: (state: {
190
- recommendationCampaignUrls: Record<string, string>;
312
+ recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
191
313
  activePredictiveAlgorithms: number[];
192
314
  languages: Languages;
193
315
  currencyList: {
@@ -195,6 +317,16 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
195
317
  value: string;
196
318
  }[];
197
319
  filterList: FiltersResponse;
320
+ strategies: {
321
+ [x: string]: unknown;
322
+ strategy_id: number;
323
+ name: string;
324
+ status: string;
325
+ suitable_channels: string;
326
+ size?: (number | string) | undefined;
327
+ }[];
328
+ strategiesLoading: boolean;
329
+ strategyUrlTemplates: Record<string, string>;
198
330
  blockStates: Record<number, PerBlockState>;
199
331
  currentRecommendationId: number | null;
200
332
  configVersion: number;
@@ -272,6 +404,12 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
272
404
  * to the snapshot taken when the drawer was opened.
273
405
  */
274
406
  cancelFilterDrawer(): void;
407
+ openAssignStrategyDrawer(): void;
408
+ closeAssignStrategyDrawer(): void;
409
+ fetchStrategies(): Promise<void>;
410
+ resolveStrategyUrlTemplate(strategy: RrsStrategy, currency: string): Promise<string>;
411
+ assignStrategy(strategy: RrsStrategy): void;
412
+ removeStrategy(): void;
275
413
  fetchRecommendationCreateData(): Promise<void>;
276
414
  fetchRecommendationFilters(): Promise<void>;
277
415
  addFilterGroup(filterGroup: number): void;
@@ -288,5 +426,7 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
288
426
  hasInvalidBlock(): boolean;
289
427
  fetchRecommendationProducts(): Promise<void>;
290
428
  _doFetchProducts(): Promise<void>;
429
+ _doFetchStrategyProducts(blockId: number): Promise<void>;
430
+ _setBlockProducts(blockId: number, products: RecommendationProduct[], size: number): void;
291
431
  }>;
292
432
  export {};
@@ -82,6 +82,7 @@ export interface RecommendationNodeConfig {
82
82
  * Uses existing Filter interface from recommendation types
83
83
  */
84
84
  filters: Filter[];
85
+ strategyId: string;
85
86
  /**
86
87
  * Layout orientation
87
88
  * - 'grid': Products in a grid, attributes aligned across products
@@ -56,6 +56,9 @@ interface ButtonProps {
56
56
  name: string;
57
57
  label: string;
58
58
  id?: string;
59
+ className?: string;
60
+ icon?: string;
61
+ disabled?: boolean;
59
62
  }
60
63
  /**
61
64
  * Common control for all blocks which includes common UI Elements.
@@ -116,7 +119,7 @@ export declare abstract class CommonControl extends Control {
116
119
  icon?: string;
117
120
  }): string;
118
121
  _GuRadioButton({ name, buttons, id }: RadioButtonProps): string;
119
- _GuButton({ name, label, id }: ButtonProps): string;
122
+ _GuButton({ name, label, id, className, icon, disabled }: ButtonProps): string;
120
123
  _GuIcon({ src, className }: IconProps): string;
121
124
  /**
122
125
  *
@@ -0,0 +1,2 @@
1
+ declare const _default: import("msw").HttpHandler[];
2
+ export default _default;
@@ -1,6 +1,9 @@
1
- import type { InitialResponse, FiltersResponse, RecommendationProduct, RecommendationProductsParams } from '@@/Types/recommendation';
1
+ import type { InitialResponse, FiltersResponse, RecommendationProduct, RecommendationProductsParams, RrsEndpointGenerateResponse, RrsStrategy } from '@@/Types/recommendation';
2
2
  export declare const useRecommendationApi: () => {
3
3
  fetchRecommendationCreateData: () => Promise<InitialResponse>;
4
4
  fetchRecommendationFilters: () => Promise<FiltersResponse>;
5
5
  fetchRecommendationProducts: (strategy: string, params: RecommendationProductsParams) => Promise<RecommendationProduct[]>;
6
+ fetchRecommendationProductsByUrl: (url: string) => Promise<RecommendationProduct[]>;
7
+ fetchRecommendationStrategies: () => Promise<RrsStrategy[]>;
8
+ generateStrategyEndpoint: (strategy: RrsStrategy, currency: string) => Promise<RrsEndpointGenerateResponse | null>;
6
9
  };