@useinsider/guido 3.7.0-beta.24bdfa3 → 3.7.0-beta.340a6d3

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 (40) hide show
  1. package/dist/@types/config/schemas.js +66 -70
  2. package/dist/composables/usePreviewMode.js +14 -15
  3. package/dist/config/compiler/utils/recommendationCompilerUtils.js +82 -90
  4. package/dist/config/migrator/recommendation/htmlBuilder.js +58 -59
  5. package/dist/config/migrator/recommendation/settingsMapper.js +33 -38
  6. package/dist/extensions/Blocks/Recommendation/block.js +43 -59
  7. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +32 -41
  8. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +313 -377
  9. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +72 -84
  10. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +66 -68
  11. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +7 -21
  12. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +4 -64
  13. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +5 -7
  14. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +72 -101
  15. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +30 -31
  16. package/dist/extensions/Blocks/Recommendation/templates/index.js +7 -9
  17. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +59 -74
  18. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +21 -21
  19. package/dist/extensions/Blocks/Recommendation/templates/utils.js +57 -88
  20. package/dist/src/@types/config/schemas.d.ts +0 -16
  21. package/dist/src/composables/useConfig.d.ts +0 -4
  22. package/dist/src/config/migrator/recommendation/settingsMapper.d.ts +1 -1
  23. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -10
  24. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +3 -29
  25. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -1
  26. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +1 -3
  27. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -2
  28. package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +0 -16
  29. package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
  30. package/dist/src/extensions/Blocks/Recommendation/templates/list/elementRenderer.d.ts +0 -13
  31. package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +2 -3
  32. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +1 -33
  33. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +0 -15
  34. package/dist/src/stores/config.d.ts +0 -36
  35. package/package.json +1 -1
  36. package/dist/composables/useRecommendationPreview.js +0 -100
  37. package/dist/extensions/Blocks/Recommendation/controls/main/pricePlacement.js +0 -133
  38. package/dist/src/composables/useRecommendationPreview.d.ts +0 -10
  39. package/dist/src/composables/useRecommendationPreview.test.d.ts +0 -1
  40. package/dist/src/extensions/Blocks/Recommendation/controls/main/pricePlacement.d.ts +0 -59
@@ -1,59 +0,0 @@
1
- /**
2
- * Price Placement Control
3
- *
4
- * Two block-level price settings ported from the legacy product block, shown
5
- * above the Currency control in the main Settings tab:
6
- *
7
- * - "Product Price Orientation" (`priceMovedToNextLine`): a vertical/horizontal
8
- * icon radio (mirrors the Items block control). `vertical` (default) keeps the
9
- * price and original price on separate stacked rows (current Guido look);
10
- * `horizontal` renders them inline on the same line and Card Composition
11
- * collapses them into a single "Product Prices" entry.
12
- * - "Hide if same as discounted" (`priceHideIfSameAsDiscounted`): a toggle.
13
- * When ON, email-service blanks the redundant original price at send time when
14
- * it equals the sale price (see the `hide-price` block attribute below).
15
- *
16
- * Orientation re-renders the rows (it changes the saved template layout).
17
- * Hide-if-same NEVER touches the template — it only persists config + stamps the
18
- * `hide-price` attribute; the visual hide is simulated in the preview and applied
19
- * for real server-side by email-service.
20
- */
21
- import type { RecommendationNodeConfig } from '../../types/nodeConfig';
22
- import type { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
23
- import { CommonControl } from '../../../common-control';
24
- export declare const PRICE_PLACEMENT_CONTROL_ID = "recommendation-price-placement-control";
25
- type Orientation = 'vertical' | 'horizontal';
26
- /**
27
- * Control for the block-level price orientation radio + hide-if-same toggle.
28
- */
29
- export declare class PricePlacementControl extends CommonControl {
30
- private store;
31
- getId(): string;
32
- getTemplate(): string;
33
- onRender(): void;
34
- onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
35
- _setFormValues(config: RecommendationNodeConfig): void;
36
- _initializeHideToggle(config: RecommendationNodeConfig): void;
37
- /**
38
- * Disables the orientation radio when a price element is hidden via Card
39
- * Composition — orientation is meaningless without both prices visible.
40
- * Visibility lives on the attribute rows' `data-visibility` (set by the Card
41
- * Composition control). Inline mode has no standalone original-price row, so
42
- * the merged "Product Prices" entry (the price row) governs.
43
- */
44
- _updateOrientationDisabled(): void;
45
- _onOrientationChange(orientation: Orientation): void;
46
- _onHideIfSameChange(value: boolean): void;
47
- /**
48
- * Mirrors the hide-if-same flag onto the durable `hide-price` block attribute
49
- * read by email-service at send time.
50
- */
51
- _stampHideIfSameAttr(value: boolean): void;
52
- /**
53
- * Rebuilds the product rows so the renderer re-reads the inline/stacked
54
- * layout flag from the store. Used by the orientation change only.
55
- */
56
- _regenerate(): void;
57
- _listenToFormUpdates(): void;
58
- }
59
- export {};