@useinsider/guido 3.17.0-beta.e23d5cd → 3.17.0-beta.e324492

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 (50) hide show
  1. package/dist/components/Guido.vue.js +7 -7
  2. package/dist/components/Guido.vue2.js +59 -57
  3. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.js +17 -0
  4. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +57 -0
  5. package/dist/composables/useStripo.js +14 -14
  6. package/dist/config/i18n/en/labels.json.js +1 -1
  7. package/dist/config/migrator/index.js +9 -8
  8. package/dist/config/migrator/recommendation/compositionMapper.js +20 -20
  9. package/dist/config/migrator/recommendation/extractors.js +29 -24
  10. package/dist/config/migrator/recommendation/htmlBuilder.js +116 -130
  11. package/dist/config/migrator/recommendationMigrator.js +30 -25
  12. package/dist/config/migrator/recommendationTitleMigrator.js +119 -0
  13. package/dist/extensions/Blocks/Recommendation/block.js +12 -11
  14. package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
  15. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  16. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +24 -22
  17. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +35 -28
  18. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +329 -257
  19. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +127 -113
  20. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +1 -1
  21. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +1 -0
  22. package/dist/extensions/Blocks/Recommendation/controls/title/index.js +44 -0
  23. package/dist/extensions/Blocks/Recommendation/extension.js +31 -29
  24. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +23 -4
  25. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +37 -26
  26. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +3 -3
  27. package/dist/extensions/Blocks/Recommendation/templates/titleRows.js +33 -0
  28. package/dist/extensions/Blocks/Recommendation/templates/utils.js +85 -107
  29. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +22 -0
  30. package/dist/guido.css +1 -1
  31. package/dist/src/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.d.ts +2 -0
  32. package/dist/src/config/migrator/recommendation/extractors.d.ts +8 -0
  33. package/dist/src/config/migrator/recommendationTitleMigrator.d.ts +5 -0
  34. package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +2 -1
  35. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +7 -0
  36. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +1 -0
  37. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  38. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +12 -0
  39. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +11 -0
  40. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
  41. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +8 -4
  42. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +1 -0
  43. package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +86 -0
  44. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +38 -0
  45. package/dist/src/extensions/Blocks/Recommendation/templates/titleRows.d.ts +13 -0
  46. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
  47. package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +31 -0
  48. package/dist/static/styles/customEditorStyle.css.js +3 -1
  49. package/dist/utils/templatePreparation.js +37 -36
  50. package/package.json +1 -1
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Runs before the document reaches the editor, so a legacy title is already a
3
+ * composition item on the first render — no post-load adoption pass.
4
+ */
5
+ export declare function migrateRecommendationTitle(html: string): string;
@@ -10,5 +10,6 @@ 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"
13
+ CUSTOM_ATTRIBUTE = "recommendation-block-custom-attribute",
14
+ TITLE = "recommendation-block-title"
14
15
  }
@@ -65,5 +65,12 @@ 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",
68
75
  SYNC_INFO_MESSAGE = "recommendation-block-sync-info-message"
69
76
  }
@@ -34,6 +34,7 @@ export declare const DEFAULT_COMPOSITION: string[];
34
34
  /**
35
35
  * Default visibility settings for card elements
36
36
  * Omnibus elements are hidden by default (not all regions require them)
37
+ * The block-level title is visible on a fresh drop.
37
38
  */
38
39
  export declare const DEFAULT_VISIBILITY: Record<string, boolean>;
39
40
  /**
@@ -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_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';
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';
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
13
  export { DEFAULT_NODE_CONFIG, DEFAULT_CURRENCY, DEFAULT_COMPOSITION, DEFAULT_VISIBILITY, CURRENT_CONFIG_VERSION, PRE_RRS_CONFIG_VERSION, EXCLUDED_ALGORITHM_IDS, } from './defaultConfig';
@@ -58,6 +58,10 @@ 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";
61
65
  /**
62
66
  * Custom attribute constants
63
67
  * Used for dynamically added product attributes in Card Composition
@@ -68,12 +72,20 @@ export declare const ATTR_CUSTOM_PREFIX = "customAttr:";
68
72
  export declare const ATTR_DATA_CUSTOM_ATTRIBUTES = "data-custom-attributes";
69
73
  /** HTML data attribute on the block root holding the comma-joined composition order */
70
74
  export declare const ATTR_DATA_CARD_COMPOSITION = "data-card-composition";
75
+ /** HTML attribute on the block root carrying its per-document unique id */
76
+ export declare const RECOMMENDATION_ID_ATTR = "recommendation-id";
71
77
  /** HTML attribute on <td> elements identifying the product attribute for compiler template variable generation */
72
78
  export declare const ATTR_PRODUCT_ATTR = "product-attr";
79
+ /** Class every composition attribute row carries — the visibility toggle and the compiler both key on it */
80
+ export declare const CSS_CLASS_ATTRIBUTE_ROW = "recommendation-attribute-row";
73
81
  /** Row wrapper of one composition entry inside a product card */
74
82
  export declare const SELECTOR_ATTRIBUTE_ROW = ".recommendation-attribute-row";
75
83
  /** HTML attribute on an attribute row holding its composition key */
76
84
  export declare const ATTR_DATA_ATTRIBUTE_TYPE = "data-attribute-type";
85
+ /** HTML attribute on an attribute row holding its visibility (`1` / `0`) */
86
+ export declare const ATTR_DATA_VISIBILITY = "data-visibility";
87
+ /** Class on the spacer cell of the row that trails a title */
88
+ export declare const CSS_CLASS_SPACER = "spacer";
77
89
  /** Prefix `resolveProductAttrValue` puts on custom (non-default) product attributes in `product-attr` values */
78
90
  export declare const PRODUCT_ATTRIBUTE_PREFIX = "product_attribute.";
79
91
  /**
@@ -33,6 +33,8 @@ export declare class RecommendationCardCompositionControl extends CommonControl
33
33
  private _normalizeComposition;
34
34
  private _readCustomAttributesFromNode;
35
35
  private _readVisibilityFromRows;
36
+ private _withTitlePresence;
37
+ private _hasTitle;
36
38
  private _getDefaultVisibilities;
37
39
  private _extractVisibilityFromRows;
38
40
  private _parseVisibilityValue;
@@ -187,6 +189,15 @@ export declare class RecommendationCardCompositionControl extends CommonControl
187
189
  */
188
190
  private _buildCompositionHtml;
189
191
  private _applyVisibilityToBlock;
192
+ private _applyTitleVisibilityToBlock;
193
+ private _resolveTitleInjection;
194
+ private _readTitleHtml;
195
+ private _findTitleRows;
196
+ private _findTitleRowsByClass;
197
+ private _isSpacerRow;
198
+ private _findTitleContainerBody;
199
+ private _readInnerHtml;
200
+ private _defaultTitleParagraph;
190
201
  /**
191
202
  * Finds the composition array index for the Nth custom attribute (0-based).
192
203
  * Scans left-to-right, counting only entries with the custom prefix.
@@ -11,6 +11,7 @@
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';
14
15
  export { NameControls } from './name';
15
16
  export { PriceControls } from './price';
16
17
  export { OldPriceControls } from './oldPrice';
@@ -20,7 +20,6 @@ export * from './utils';
20
20
  export declare class RecommendationBlockControl extends CommonControl {
21
21
  private store;
22
22
  private storeUnsubscription;
23
- private syncedConfigs;
24
23
  private pendingNodeConfigWrite;
25
24
  private pendingConfigFlushTimer;
26
25
  private algorithmControl;
@@ -64,6 +63,11 @@ export declare class RecommendationBlockControl extends CommonControl {
64
63
  * fingerprint diff on this hook is the only way to notice (SD-149105).
65
64
  * An unchanged fingerprint means the move came from us, so runtime store
66
65
  * edits are never clobbered (SD-141049).
66
+ *
67
+ * The fingerprint is kept on the block's own store state so deleting the
68
+ * block drops it with the state it describes. A control-owned memo outlived
69
+ * that state and made a re-dropped saved module keep the defaults its wiped
70
+ * state was rebuilt with (SD-150347).
67
71
  */
68
72
  private _syncNodeConfigIfChanged;
69
73
  private _capturePendingNodeConfigWrite;
@@ -79,9 +83,9 @@ export declare class RecommendationBlockControl extends CommonControl {
79
83
  */
80
84
  private _stagePendingNodeConfig;
81
85
  /**
82
- * Arms the guaranteed fallback write. The delay has to outlast the product fetch
83
- * and the re-render debounce it triggers — firing earlier writes the config on
84
- * its own and the undo entry splits in two again.
86
+ * Arms the guaranteed fallback write, once the product fetch has settled. The
87
+ * delay only has to outlast the re-render debounce that fetch triggers — firing
88
+ * earlier writes the config on its own and the undo entry splits in two again.
85
89
  */
86
90
  private _scheduleConfigFlush;
87
91
  private _clearConfigFlush;
@@ -70,6 +70,7 @@ 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;
73
74
  /**
74
75
  * Regenerates only the mobile product container rows and commits in a single apply().
75
76
  * Standalone entry point for callers that change mobile-only settings
@@ -0,0 +1,86 @@
1
+ export declare const TitleControls: {
2
+ readonly align: {
3
+ new (): {
4
+ getId(): string;
5
+ getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
6
+ getParentControlId(): string;
7
+ api: import("@stripoinc/ui-editor-extensions").ControlApi;
8
+ getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
9
+ getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
10
+ getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
11
+ isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
12
+ };
13
+ };
14
+ readonly color: {
15
+ new (): {
16
+ getId(): string;
17
+ getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
18
+ getParentControlId(): string;
19
+ api: import("@stripoinc/ui-editor-extensions").ControlApi;
20
+ getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
21
+ getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
22
+ getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
23
+ isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
24
+ };
25
+ };
26
+ readonly size: {
27
+ new (): {
28
+ getId(): string;
29
+ getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
30
+ getParentControlId(): string;
31
+ api: import("@stripoinc/ui-editor-extensions").ControlApi;
32
+ getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
33
+ getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
34
+ getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
35
+ isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
36
+ };
37
+ };
38
+ readonly style: {
39
+ new (): {
40
+ getId(): string;
41
+ getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
42
+ getParentControlId(): string;
43
+ api: import("@stripoinc/ui-editor-extensions").ControlApi;
44
+ getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
45
+ getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
46
+ getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
47
+ isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
48
+ };
49
+ };
50
+ readonly fontFamily: {
51
+ new (): {
52
+ getId(): string;
53
+ getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
54
+ getParentControlId(): string;
55
+ api: import("@stripoinc/ui-editor-extensions").ControlApi;
56
+ getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
57
+ getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
58
+ getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
59
+ isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
60
+ };
61
+ };
62
+ readonly background: {
63
+ new (): {
64
+ getId(): string;
65
+ getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
66
+ getAdditionalModifications(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
67
+ getParentControlId(): string;
68
+ api: import("@stripoinc/ui-editor-extensions").ControlApi;
69
+ getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
70
+ getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
71
+ isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
72
+ };
73
+ };
74
+ readonly paddings: {
75
+ new (): {
76
+ getId(): string;
77
+ getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
78
+ getParentControlId(): string;
79
+ api: import("@stripoinc/ui-editor-extensions").ControlApi;
80
+ getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
81
+ getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
82
+ getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
83
+ isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
84
+ };
85
+ };
86
+ };
@@ -35,11 +35,22 @@ interface PerBlockState {
35
35
  filterStatus: boolean;
36
36
  filterSelectionDrawerStatus: boolean;
37
37
  assignStrategyDrawerStatus: boolean;
38
+ removeStrategyModalStatus: boolean;
38
39
  filterGroup: number;
39
40
  /** Whether initial API data (filters, algorithms, products) has been fetched for this block */
40
41
  isInitialized: boolean;
41
42
  /** Snapshot of filters taken when the drawer opens, used to revert on cancel */
42
43
  filterSnapshot: Filter[] | null;
44
+ /**
45
+ * Fingerprint of the node config as this block's state last adopted it.
46
+ *
47
+ * Lives here, not on the control, because it is a claim ABOUT this state —
48
+ * "the store already holds that node config". Held on the control it
49
+ * outlived the state it described: `removeBlockState` tore the state down
50
+ * while the fingerprint survived, so re-dropping a saved module under the
51
+ * same id skipped the re-sync and kept the defaults (SD-150347).
52
+ */
53
+ syncedConfigFingerprint: string | null;
43
54
  }
44
55
  /**
45
56
  * Persisted-config subset used by `seedBlockUrlConfig` to reconstruct
@@ -56,6 +67,8 @@ export interface PerBlockUrlConfig {
56
67
  filters: Filter[];
57
68
  shuffleProducts: boolean;
58
69
  currencyCode: string;
70
+ /** The displayed symbol, which is not the code — a TRY block shows `₺`. */
71
+ currencySymbol: string;
59
72
  currencyAlignment: 'before' | 'after';
60
73
  currencyDecimalCount: number;
61
74
  currencyDecimalSeparator: string;
@@ -177,6 +190,29 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
177
190
  currentRecommendationId: number | null;
178
191
  configVersion: number;
179
192
  } & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
193
+ removeStrategyModalStatus(state: {
194
+ recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
195
+ activePredictiveAlgorithms: number[];
196
+ languages: Languages;
197
+ currencyList: {
198
+ text: string;
199
+ value: string;
200
+ }[];
201
+ filterList: FiltersResponse;
202
+ strategies: {
203
+ [x: string]: unknown;
204
+ strategy_id: number;
205
+ name: string;
206
+ status: string;
207
+ suitable_channels: string;
208
+ size?: (number | string) | undefined;
209
+ }[];
210
+ strategiesLoading: boolean;
211
+ strategyUrlTemplates: Record<string, string>;
212
+ blockStates: Record<number, PerBlockState>;
213
+ currentRecommendationId: number | null;
214
+ configVersion: number;
215
+ } & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
180
216
  assignedStrategy(state: {
181
217
  recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
182
218
  activePredictiveAlgorithms: number[];
@@ -406,6 +442,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
406
442
  cancelFilterDrawer(): void;
407
443
  openAssignStrategyDrawer(): void;
408
444
  closeAssignStrategyDrawer(): void;
445
+ openRemoveStrategyModal(): void;
446
+ closeRemoveStrategyModal(): void;
409
447
  fetchStrategies(): Promise<void>;
410
448
  resolveStrategyUrlTemplate(strategy: RrsStrategy, currency: string): Promise<string>;
411
449
  assignStrategy(strategy: RrsStrategy): void;
@@ -0,0 +1,13 @@
1
+ export declare const DEFAULT_TITLE_TEXT = "You May Also Like!";
2
+ export declare const DEFAULT_TITLE_PARAGRAPH: string;
3
+ /**
4
+ * Builds the two block-level title rows: the title itself and the spacer below it.
5
+ * Both carry the same `recommendation-attribute-row` tagging a card attribute row has,
6
+ * so the Card Composition toggle hides the pair together and the compiler's
7
+ * `[data-visibility="0"]` sweep drops both — no leading gap when the title is off.
8
+ * @param paragraphHtml - Full `<p>` markup rendered inside the title cell
9
+ * @param visible - Whether the title starts visible
10
+ * @param spacerHeightPx - Height of the spacer row below the title
11
+ * @returns HTML string with the title row followed by its spacer row
12
+ */
13
+ export declare function buildTitleRows(paragraphHtml?: string, visible?: boolean, spacerHeightPx?: number): string;
@@ -139,6 +139,12 @@ export interface RecommendationNodeConfig {
139
139
  * Keys are ATTR_PRODUCT_* constants
140
140
  */
141
141
  visibility: Record<string, boolean>;
142
+ /**
143
+ * Snapshot of the block title's row markup before it's removed.
144
+ * Restored verbatim when the title is re-enabled.
145
+ * @default ''
146
+ */
147
+ previousTitleHtml: string;
142
148
  /**
143
149
  * Omnibus price text configuration
144
150
  * For EU Omnibus Directive compliance
@@ -0,0 +1,31 @@
1
+ import type { DocumentModifier } from '../services/configService';
2
+ import type { PartialNodeConfig } from '../types/nodeConfig';
3
+ import type { RecommendationProduct } from '@@/Types/recommendation';
4
+ import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
5
+ interface ConfigWriterApi {
6
+ getDocumentModifier: () => DocumentModifier;
7
+ getDocumentRootHtmlNode: () => ImmutableHtmlNode;
8
+ }
9
+ /**
10
+ * Keeps a document handle alive for writes the settings panel can no longer make.
11
+ * Deliberately not cleared on deselect — that is the exact moment the handle is
12
+ * needed. It is replaced on the next render, and goes stale only if the editor
13
+ * itself is torn down.
14
+ */
15
+ export declare function registerNodeConfigWriter(api: ConfigWriterApi): void;
16
+ /**
17
+ * Commits a config change and its product re-render straight to the document,
18
+ * bypassing the settings panel.
19
+ *
20
+ * Host-rendered UI (the remove-strategy modal) lives outside `ui-editor`, and
21
+ * Stripo deselects the block on the first click that lands there — destroying the
22
+ * control that normally does both, before the store change even happens.
23
+ *
24
+ * Mirrors the control's regenerate routine so config and cards land in ONE undo
25
+ * entry, and so partner-managed blocks keep their hand-authored cells.
26
+ * @param description - labels the undo entry only when there are no cards to
27
+ * re-render; the product helpers label their own batch.
28
+ * @returns whether the write reached a node
29
+ */
30
+ export declare function commitBlockChangeOutsidePanel(blockId: number, updates: PartialNodeConfig, products: RecommendationProduct[], description: string): boolean;
31
+ export {};
@@ -43,7 +43,9 @@ const n = `.esd-x,
43
43
  .recommendation-block-v2 .product-omnibus-discount ue-node-actions,
44
44
  .recommendation-block-v2 .product-omnibus-discount ue-node-panel,
45
45
  .recommendation-block-v2 .product-button ue-node-actions,
46
- .recommendation-block-v2 .product-button ue-node-panel {
46
+ .recommendation-block-v2 .product-button ue-node-panel,
47
+ .recommendation-block-v2 .ins-recommendation-title ue-node-actions,
48
+ .recommendation-block-v2 .ins-recommendation-title ue-node-panel {
47
49
  display: none !important;
48
50
  }
49
51
 
@@ -1,30 +1,30 @@
1
1
  import { useActionsApi as k } from "../composables/useActionsApi.js";
2
2
  import { useConfig as U } from "../composables/useConfig.js";
3
3
  import { useHtmlCompiler as x } from "../composables/useHtmlCompiler.js";
4
- import { DEFAULT_CURRENCY as d, DEFAULT_NODE_CONFIG as a } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
5
- import { useRecommendationExtensionStore as C } from "../extensions/Blocks/Recommendation/store/recommendation.js";
4
+ import { DEFAULT_CURRENCY as m, DEFAULT_NODE_CONFIG as a } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
5
+ import { useRecommendationExtensionStore as T } from "../extensions/Blocks/Recommendation/store/recommendation.js";
6
6
  import { mapLegacyStrategy as L } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
7
- import { DATA_ATTRIBUTES as A } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
7
+ import { DATA_ATTRIBUTES as C } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
8
8
  import { parsePageList as R } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
9
9
  import { useDynamicContentStore as N } from "../stores/dynamic-content.js";
10
10
  import { useEditorStore as z } from "../stores/editor.js";
11
11
  import { useUnsubscribeStore as _ } from "../stores/unsubscribe.js";
12
12
  import { assignTrackingIds as v } from "./linkTrackingIds.js";
13
- function O(m) {
14
- const i = new DOMParser().parseFromString(m, "text/html").querySelectorAll(`[${A.PAGE_LIST}]`), t = [];
15
- return i.forEach((s) => {
16
- const o = s.getAttribute(A.PAGE_LIST);
13
+ function O(l) {
14
+ const c = new DOMParser().parseFromString(l, "text/html").querySelectorAll(`[${C.PAGE_LIST}]`), t = [];
15
+ return c.forEach((i) => {
16
+ const o = i.getAttribute(C.PAGE_LIST);
17
17
  o && t.push(...R(o));
18
18
  }), [...new Set(t)];
19
19
  }
20
- async function M(m) {
21
- const n = new DOMParser().parseFromString(m, "text/html").querySelectorAll(".recommendation-block-v2");
20
+ async function M(l) {
21
+ const n = new DOMParser().parseFromString(l, "text/html").querySelectorAll(".recommendation-block-v2");
22
22
  if (n.length === 0)
23
23
  return;
24
- const i = C();
24
+ const c = T();
25
25
  n.forEach((t) => {
26
- var r, l, g, f, c;
27
- const s = t.getAttribute("recommendation-id"), o = s ? Number(s) : NaN;
26
+ var r, d, g, f, s, y;
27
+ const i = t.getAttribute("recommendation-id"), o = i ? Number(i) : NaN;
28
28
  if (!Number.isFinite(o))
29
29
  return;
30
30
  const p = t.getAttribute("esd-ext-config");
@@ -38,7 +38,7 @@ async function M(m) {
38
38
  }
39
39
  if (!e || typeof e != "object" || Array.isArray(e))
40
40
  return;
41
- const h = {
41
+ const b = {
42
42
  // Normalize legacy strategy keys (e.g. `mostViewed` → `mostPopular`) so
43
43
  // already-saved blocks that never re-run the migrator don't emit a
44
44
  // strategy-less campaign URL. `||` also catches '' / undefined (SD-144882).
@@ -51,16 +51,17 @@ async function M(m) {
51
51
  productIds: e.productIds ?? [...a.productIds],
52
52
  filters: e.filters ?? [...a.filters],
53
53
  shuffleProducts: e.shuffleProducts ?? a.shuffleProducts,
54
- currencyCode: ((r = e.currency) == null ? void 0 : r.code) ?? d.code,
55
- currencyAlignment: ((l = e.currency) == null ? void 0 : l.alignment) ?? d.alignment,
56
- currencyDecimalCount: ((g = e.currency) == null ? void 0 : g.decimalCount) ?? d.decimalCount,
57
- currencyDecimalSeparator: ((f = e.currency) == null ? void 0 : f.decimalSeparator) ?? d.decimalSeparator,
58
- currencyThousandSeparator: ((c = e.currency) == null ? void 0 : c.thousandSeparator) ?? d.thousandSeparator
54
+ currencyCode: ((r = e.currency) == null ? void 0 : r.code) ?? m.code,
55
+ currencySymbol: ((d = e.currency) == null ? void 0 : d.symbol) ?? m.symbol,
56
+ currencyAlignment: ((g = e.currency) == null ? void 0 : g.alignment) ?? m.alignment,
57
+ currencyDecimalCount: ((f = e.currency) == null ? void 0 : f.decimalCount) ?? m.decimalCount,
58
+ currencyDecimalSeparator: ((s = e.currency) == null ? void 0 : s.decimalSeparator) ?? m.decimalSeparator,
59
+ currencyThousandSeparator: ((y = e.currency) == null ? void 0 : y.thousandSeparator) ?? m.thousandSeparator
59
60
  };
60
- i.seedBlockUrlConfig(o, h);
61
+ c.seedBlockUrlConfig(o, b);
61
62
  });
62
63
  try {
63
- await i.fetchRecommendationCreateData();
64
+ await c.fetchRecommendationCreateData();
64
65
  } catch (t) {
65
66
  console.warn(
66
67
  "Recommendation reference data pre-load failed; validator will skip the availability check.",
@@ -69,44 +70,44 @@ async function M(m) {
69
70
  }
70
71
  }
71
72
  const Z = () => {
72
- const m = N(), u = z(), n = _(), { getCompiledEmail: i, getTemplateData: t, updateHtmlAndCss: s } = k(), { compileHtml: o, compileAmpHtml: p } = x(), { isFeatureEnabled: e } = U();
73
+ const l = N(), u = z(), n = _(), { getCompiledEmail: c, getTemplateData: t, updateHtmlAndCss: i } = k(), { compileHtml: o, compileAmpHtml: p } = x(), { isFeatureEnabled: e } = U();
73
74
  return {
74
75
  prepareTemplateDetails: async () => {
75
- let { html: r, css: l, syncModulesIds: g = [] } = await t();
76
+ let { html: r, css: d, syncModulesIds: g = [] } = await t();
76
77
  if (e("linkTrackingIds"))
77
78
  try {
78
- const { html: S, changed: F, nextSeq: H } = v(r, u.trackIdSessionFloor);
79
- u.trackIdSessionFloor = H, F && (r = S, await s(S, l));
80
- } catch (S) {
81
- console.error("Tracking-id step failed, saving anyway:", S);
79
+ const { html: h, changed: F, nextSeq: H } = v(r, u.trackIdSessionFloor);
80
+ u.trackIdSessionFloor = H, F && (r = h, await i(h, d));
81
+ } catch (h) {
82
+ console.error("Tracking-id step failed, saving anyway:", h);
82
83
  }
83
- const { html: f, ampHtml: c = "", ampErrors: T = [] } = await i({
84
+ const { html: f, ampHtml: s = "", ampErrors: y = [] } = await c({
84
85
  minimize: !0,
85
86
  resetDataSavedFlag: !1
86
87
  });
87
88
  n.selectedUnsubscribePages.length && await n.fetchTemplates(), await M(r);
88
- const { compiledHtml: I, stats: y, appliedRules: w } = o(f), D = c && p(c).compiledHtml, E = m.getSelectedDynamicContentList, P = C(), b = O(r);
89
+ const { compiledHtml: I, stats: S, appliedRules: w } = o(f), D = s && p(s).compiledHtml, E = l.getSelectedDynamicContentList, P = T(), A = O(r);
89
90
  return console.debug("HTML Compilation Stats:", {
90
- originalSize: y.originalSize,
91
- compiledSize: y.compiledSize,
92
- reduction: `${y.reductionPercentage.toFixed(2)}%`,
91
+ originalSize: S.originalSize,
92
+ compiledSize: S.compiledSize,
93
+ reduction: `${S.reductionPercentage.toFixed(2)}%`,
93
94
  appliedRules: w,
94
- executionTime: `${y.executionTime.toFixed(2)}ms`
95
+ executionTime: `${S.executionTime.toFixed(2)}ms`
95
96
  }), {
96
97
  dynamicContentList: E,
97
98
  compiledHtml: I,
98
99
  rawHtml: r,
99
- css: l,
100
+ css: d,
100
101
  ampHtml: D,
101
- ampErrors: T,
102
+ ampErrors: y,
102
103
  modules: g.map(Number),
103
104
  recommendation: {
104
105
  campaignUrls: P.recommendationCampaignUrls,
105
106
  configs: {}
106
107
  },
107
108
  unsubscribe: {
108
- status: b.length > 0,
109
- config: b
109
+ status: A.length > 0,
110
+ config: A
110
111
  }
111
112
  };
112
113
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.17.0-beta.e23d5cd",
3
+ "version": "3.17.0-beta.e324492",
4
4
  "description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
5
5
  "main": "./dist/guido.umd.cjs",
6
6
  "module": "./dist/library.js",