@useinsider/guido 2.0.0-beta.6b24cb0 → 2.0.0-beta.6b85cb2

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 (125) hide show
  1. package/dist/@types/config/schemas.js +36 -50
  2. package/dist/components/organisms/header/RightSlot.vue2.js +10 -10
  3. package/dist/composables/useConfig.js +27 -29
  4. package/dist/composables/useSave.js +11 -13
  5. package/dist/extensions/Blocks/CouponBlock/constants.js +4 -0
  6. package/dist/extensions/Blocks/CouponBlock/controls/index.js +29 -0
  7. package/dist/extensions/Blocks/CouponBlock/extension.js +5 -4
  8. package/dist/extensions/Blocks/CouponBlock/settingsPanel.js +20 -14
  9. package/dist/extensions/Blocks/CouponBlock/template.js +22 -11
  10. package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +153 -69
  11. package/dist/extensions/Blocks/Recommendation/constants.js +9 -1
  12. package/dist/extensions/Blocks/Recommendation/control.js +74 -59
  13. package/dist/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.js +68 -0
  14. package/dist/extensions/Blocks/Recommendation/controls/index.js +245 -0
  15. package/dist/extensions/Blocks/Recommendation/controls/nameTextTrimControl.js +74 -0
  16. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscountTextAfterControl.js +71 -0
  17. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscountTextBeforeControl.js +71 -0
  18. package/dist/extensions/Blocks/Recommendation/controls/omnibusPriceTextAfterControl.js +71 -0
  19. package/dist/extensions/Blocks/Recommendation/controls/omnibusPriceTextBeforeControl.js +71 -0
  20. package/dist/extensions/Blocks/Recommendation/controls/spacingControl.js +188 -0
  21. package/dist/extensions/Blocks/Recommendation/extension.js +16 -42
  22. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +117 -72
  23. package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +85 -64
  24. package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +54 -17
  25. package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +74 -45
  26. package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +25 -0
  27. package/dist/extensions/Blocks/Unsubscribe/extension.js +9 -9
  28. package/dist/extensions/Blocks/controlFactories.js +122 -111
  29. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +14 -14
  30. package/dist/src/@types/config/index.d.ts +2 -2
  31. package/dist/src/@types/config/schemas.d.ts +0 -26
  32. package/dist/src/@types/config/types.d.ts +1 -7
  33. package/dist/src/composables/useConfig.d.ts +0 -6
  34. package/dist/src/extensions/Blocks/CouponBlock/constants.d.ts +14 -0
  35. package/dist/src/extensions/Blocks/CouponBlock/controls/index.d.ts +108 -0
  36. package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +1 -1
  37. package/dist/src/extensions/Blocks/Recommendation/cardCompositionControl.d.ts +50 -3
  38. package/dist/src/extensions/Blocks/Recommendation/constants.d.ts +32 -0
  39. package/dist/src/extensions/Blocks/Recommendation/control.d.ts +5 -2
  40. package/dist/src/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.d.ts +25 -0
  41. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +592 -0
  42. package/dist/src/extensions/Blocks/Recommendation/controls/nameTextTrimControl.d.ts +16 -0
  43. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscountTextAfterControl.d.ts +15 -0
  44. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscountTextBeforeControl.d.ts +15 -0
  45. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPriceTextAfterControl.d.ts +15 -0
  46. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPriceTextBeforeControl.d.ts +15 -0
  47. package/dist/src/extensions/Blocks/Recommendation/controls/spacingControl.d.ts +60 -0
  48. package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +3 -3
  49. package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +15 -7
  50. package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +19 -0
  51. package/dist/src/extensions/Blocks/controlFactories.d.ts +30 -7
  52. package/dist/src/stores/config.d.ts +1 -146
  53. package/dist/static/styles/components/button.css.js +1 -1
  54. package/dist/static/styles/components/wide-panel.css.js +0 -4
  55. package/dist/static/styles/customEditorStyle.css.js +13 -0
  56. package/dist/stores/config.js +0 -7
  57. package/package.json +1 -1
  58. package/dist/extensions/Blocks/Recommendation/controls/button/align.js +0 -13
  59. package/dist/extensions/Blocks/Recommendation/controls/button/border.js +0 -13
  60. package/dist/extensions/Blocks/Recommendation/controls/button/borderRadius.js +0 -13
  61. package/dist/extensions/Blocks/Recommendation/controls/button/color.js +0 -13
  62. package/dist/extensions/Blocks/Recommendation/controls/button/fitToContent.js +0 -13
  63. package/dist/extensions/Blocks/Recommendation/controls/button/fontFamily.js +0 -13
  64. package/dist/extensions/Blocks/Recommendation/controls/button/margins.js +0 -13
  65. package/dist/extensions/Blocks/Recommendation/controls/button/paddings.js +0 -13
  66. package/dist/extensions/Blocks/Recommendation/controls/button/text.js +0 -13
  67. package/dist/extensions/Blocks/Recommendation/controls/button/textSize.js +0 -13
  68. package/dist/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.js +0 -13
  69. package/dist/extensions/Blocks/Recommendation/controls/image/margins.js +0 -13
  70. package/dist/extensions/Blocks/Recommendation/controls/image/size.js +0 -13
  71. package/dist/extensions/Blocks/Recommendation/controls/name/align.js +0 -13
  72. package/dist/extensions/Blocks/Recommendation/controls/name/background.js +0 -13
  73. package/dist/extensions/Blocks/Recommendation/controls/name/color.js +0 -13
  74. package/dist/extensions/Blocks/Recommendation/controls/name/fontFamily.js +0 -13
  75. package/dist/extensions/Blocks/Recommendation/controls/name/paddings.js +0 -13
  76. package/dist/extensions/Blocks/Recommendation/controls/name/size.js +0 -13
  77. package/dist/extensions/Blocks/Recommendation/controls/name/style.js +0 -13
  78. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/align.js +0 -13
  79. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/background.js +0 -13
  80. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/color.js +0 -13
  81. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.js +0 -13
  82. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/paddings.js +0 -13
  83. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/size.js +0 -13
  84. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/style.js +0 -13
  85. package/dist/extensions/Blocks/Recommendation/controls/price/align.js +0 -13
  86. package/dist/extensions/Blocks/Recommendation/controls/price/background.js +0 -13
  87. package/dist/extensions/Blocks/Recommendation/controls/price/color.js +0 -13
  88. package/dist/extensions/Blocks/Recommendation/controls/price/fontFamily.js +0 -13
  89. package/dist/extensions/Blocks/Recommendation/controls/price/paddings.js +0 -13
  90. package/dist/extensions/Blocks/Recommendation/controls/price/size.js +0 -13
  91. package/dist/extensions/Blocks/Recommendation/controls/price/style.js +0 -13
  92. package/dist/src/extensions/Blocks/Recommendation/controls/button/align.d.ts +0 -5
  93. package/dist/src/extensions/Blocks/Recommendation/controls/button/border.d.ts +0 -5
  94. package/dist/src/extensions/Blocks/Recommendation/controls/button/borderRadius.d.ts +0 -5
  95. package/dist/src/extensions/Blocks/Recommendation/controls/button/color.d.ts +0 -5
  96. package/dist/src/extensions/Blocks/Recommendation/controls/button/fitToContent.d.ts +0 -5
  97. package/dist/src/extensions/Blocks/Recommendation/controls/button/fontFamily.d.ts +0 -5
  98. package/dist/src/extensions/Blocks/Recommendation/controls/button/margins.d.ts +0 -5
  99. package/dist/src/extensions/Blocks/Recommendation/controls/button/paddings.d.ts +0 -5
  100. package/dist/src/extensions/Blocks/Recommendation/controls/button/text.d.ts +0 -5
  101. package/dist/src/extensions/Blocks/Recommendation/controls/button/textSize.d.ts +0 -5
  102. package/dist/src/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.d.ts +0 -5
  103. package/dist/src/extensions/Blocks/Recommendation/controls/image/margins.d.ts +0 -5
  104. package/dist/src/extensions/Blocks/Recommendation/controls/image/size.d.ts +0 -5
  105. package/dist/src/extensions/Blocks/Recommendation/controls/name/align.d.ts +0 -5
  106. package/dist/src/extensions/Blocks/Recommendation/controls/name/background.d.ts +0 -5
  107. package/dist/src/extensions/Blocks/Recommendation/controls/name/color.d.ts +0 -5
  108. package/dist/src/extensions/Blocks/Recommendation/controls/name/fontFamily.d.ts +0 -5
  109. package/dist/src/extensions/Blocks/Recommendation/controls/name/paddings.d.ts +0 -5
  110. package/dist/src/extensions/Blocks/Recommendation/controls/name/size.d.ts +0 -5
  111. package/dist/src/extensions/Blocks/Recommendation/controls/name/style.d.ts +0 -5
  112. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/align.d.ts +0 -5
  113. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/background.d.ts +0 -5
  114. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/color.d.ts +0 -5
  115. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.d.ts +0 -5
  116. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/paddings.d.ts +0 -5
  117. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/size.d.ts +0 -5
  118. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/style.d.ts +0 -5
  119. package/dist/src/extensions/Blocks/Recommendation/controls/price/align.d.ts +0 -5
  120. package/dist/src/extensions/Blocks/Recommendation/controls/price/background.d.ts +0 -5
  121. package/dist/src/extensions/Blocks/Recommendation/controls/price/color.d.ts +0 -5
  122. package/dist/src/extensions/Blocks/Recommendation/controls/price/fontFamily.d.ts +0 -5
  123. package/dist/src/extensions/Blocks/Recommendation/controls/price/paddings.d.ts +0 -5
  124. package/dist/src/extensions/Blocks/Recommendation/controls/price/size.d.ts +0 -5
  125. package/dist/src/extensions/Blocks/Recommendation/controls/price/style.d.ts +0 -5
@@ -0,0 +1,15 @@
1
+ import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
2
+ import { CommonControl } from '../../common-control';
3
+ /**
4
+ * Control for setting text after Omnibus Discount value
5
+ */
6
+ export declare class OmnibusDiscountTextAfterControl extends CommonControl {
7
+ getId(): string;
8
+ getTemplate(): string;
9
+ onRender(): void;
10
+ onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
11
+ _setFormValues(): void;
12
+ _getCurrentText(): string;
13
+ _onTextChange(newText: string): void;
14
+ _listenToFormUpdates(): void;
15
+ }
@@ -0,0 +1,15 @@
1
+ import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
2
+ import { CommonControl } from '../../common-control';
3
+ /**
4
+ * Control for setting text before Omnibus Discount value
5
+ */
6
+ export declare class OmnibusDiscountTextBeforeControl extends CommonControl {
7
+ getId(): string;
8
+ getTemplate(): string;
9
+ onRender(): void;
10
+ onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
11
+ _setFormValues(): void;
12
+ _getCurrentText(): string;
13
+ _onTextChange(newText: string): void;
14
+ _listenToFormUpdates(): void;
15
+ }
@@ -0,0 +1,15 @@
1
+ import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
2
+ import { CommonControl } from '../../common-control';
3
+ /**
4
+ * Control for setting text after Omnibus Price value
5
+ */
6
+ export declare class OmnibusPriceTextAfterControl extends CommonControl {
7
+ getId(): string;
8
+ getTemplate(): string;
9
+ onRender(): void;
10
+ onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
11
+ _setFormValues(): void;
12
+ _getCurrentText(): string;
13
+ _onTextChange(newText: string): void;
14
+ _listenToFormUpdates(): void;
15
+ }
@@ -0,0 +1,15 @@
1
+ import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
2
+ import { CommonControl } from '../../common-control';
3
+ /**
4
+ * Control for setting text before Omnibus Price value
5
+ */
6
+ export declare class OmnibusPriceTextBeforeControl extends CommonControl {
7
+ getId(): string;
8
+ getTemplate(): string;
9
+ onRender(): void;
10
+ onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
11
+ _setFormValues(): void;
12
+ _getCurrentText(): string;
13
+ _onTextChange(newText: string): void;
14
+ _listenToFormUpdates(): void;
15
+ }
@@ -0,0 +1,60 @@
1
+ import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
2
+ import { CommonControl } from '../../common-control';
3
+ export declare const SPACING_CONTROL_ID = "recommendation-spacing-control";
4
+ /**
5
+ * Control for managing spacing between product cards
6
+ * - Column spacing: horizontal gap between cards in the same row
7
+ * - Row spacing: vertical gap between different rows
8
+ */
9
+ export declare class SpacingControl extends CommonControl {
10
+ getId(): string;
11
+ getTemplate(): string;
12
+ onRender(): void;
13
+ onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
14
+ /**
15
+ * Reads spacing values from data attributes or returns defaults
16
+ */
17
+ _setFormValues(): void;
18
+ /**
19
+ * Gets stored column spacing from the first product card wrapper's parent element's padding
20
+ * Reads the actual padding value instead of relying on data attributes
21
+ *
22
+ * The padding is applied as "0 {halfSpacing}px" on the parent TD element,
23
+ * so we need to extract the horizontal padding value and multiply by 2 to get total spacing.
24
+ */
25
+ _getStoredColumnSpacing(): number;
26
+ /**
27
+ * Gets stored row spacing from the first spacer element's height style
28
+ * Reads the actual height value instead of relying on data attributes
29
+ */
30
+ _getStoredRowSpacing(): number;
31
+ /**
32
+ * Handles column spacing changes
33
+ * Applies horizontal padding to all product card wrappers
34
+ */
35
+ _onColumnSpacingChange(spacing: number): void;
36
+ /**
37
+ * Handles row spacing changes
38
+ * Applies height to all spacer elements between product rows
39
+ */
40
+ _onRowSpacingChange(spacing: number): void;
41
+ /**
42
+ * Stores column spacing value in block data attribute
43
+ */
44
+ _storeColumnSpacing(spacing: number): void;
45
+ /**
46
+ * Stores row spacing value in block data attribute
47
+ */
48
+ _storeRowSpacing(spacing: number): void;
49
+ _listenToFormUpdates(): void;
50
+ /**
51
+ * Debounced version of _onColumnSpacingChange
52
+ * Prevents excessive DOM updates when user rapidly adjusts the counter
53
+ */
54
+ _debouncedOnColumnSpacingChange: import("@vueuse/shared").PromisifyFn<(spacing: number) => void>;
55
+ /**
56
+ * Debounced version of _onRowSpacingChange
57
+ * Prevents excessive DOM updates when user rapidly adjusts the counter
58
+ */
59
+ _debouncedOnRowSpacingChange: import("@vueuse/shared").PromisifyFn<(spacing: number) => void>;
60
+ }
@@ -1,6 +1,6 @@
1
1
  import type { RecommendationProduct } from '@@/Types/recommendation';
2
- import { DEFAULTS, getDefaultProducts, DEFAULT_CARD_COMPOSITION } from './templateUtils';
3
- declare const blockTemplate = "\n <td align=\"left\" class=\"ins-recommendation-v3-block-v2 esd-block-recommendation-v3-block es-p20\">\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr>\n <td align=\"center\">\n <table\n class=\"container\"\n width=\"100%\"\n cellpadding=\"0\"\n cellspacing=\"0\"\n border=\"0\">\n <tbody>\n <tr>\n <td>\n <table\n width=\"100%\"\n cellpadding=\"0\"\n cellspacing=\"0\"\n border=\"0\">\n <tbody>\n <BLOCK_TEXT\n class=\"es-p10t es-p10b es-p20l es-p20r\"\n align=\"center\">\n <p path=\"1\" style=\"font-size: 28px; color: #333333;\">\n <strong path=\"1,0\">{-{-TITLE-}-}</strong>\n </p>\n </BLOCK_TEXT>\n </tbody>\n </table>\n </td>\n </tr>\n \n <tr>\n <td class=\"spacer\" style=\"height: 20px;\"></td>\n </tr>\n\n <tr>\n <td>\n <table\n class=\"ins-recommendation-product-container\"\n width=\"100%\"\n cellpadding=\"0\"\n cellspacing=\"0\"\n border=\"0\"\n >\n {-{-PRODUCT_ROWS-}-}\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </table>\n </td>\n";
2
+ import { DEFAULTS, getDefaultProducts, DEFAULT_CARD_COMPOSITION, DEFAULT_CARD_VISIBILITY } from './templateUtils';
3
+ declare const blockTemplate = "\n <td align=\"left\" class=\"ins-recommendation-v3-block-v2 esd-block-recommendation-v3-block es-p20\">\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr>\n <td align=\"center\">\n <table\n class=\"container\"\n width=\"100%\"\n cellpadding=\"0\"\n cellspacing=\"0\"\n border=\"0\">\n <tbody>\n <tr>\n <td>\n <table\n width=\"100%\"\n cellpadding=\"0\"\n cellspacing=\"0\"\n border=\"0\">\n <tbody>\n <BLOCK_TEXT\n class=\"es-p10t es-p10b es-p20l es-p20r\"\n align=\"center\">\n <p path=\"1\" style=\"font-size: 28px; color: #333333;\">\n <strong path=\"1,0\">{-{-TITLE-}-}</strong>\n </p>\n </BLOCK_TEXT>\n </tbody>\n </table>\n </td>\n </tr>\n \n <tr>\n <td class=\"spacer\" style=\"height: 10px;\"></td>\n </tr>\n\n <tr>\n <td>\n <table\n class=\"ins-recommendation-product-container\"\n width=\"100%\"\n cellpadding=\"0\"\n cellspacing=\"0\"\n border=\"0\"\n >\n {-{-PRODUCT_ROWS-}-}\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </table>\n </td>\n";
4
4
  export declare function getDefaultTemplate(): string;
5
5
  /**
6
6
  * Generates a custom template with specified products and layout
@@ -12,5 +12,5 @@ export declare function getDefaultTemplate(): string;
12
12
  */
13
13
  export declare function generateBlockTemplate(products: RecommendationProduct[], productsPerRow: number, title?: string, composition?: string[]): string;
14
14
  export declare function prepareProductRows(products: RecommendationProduct[], productsPerRow: number, composition?: string[]): string;
15
- export { DEFAULTS, DEFAULT_CARD_COMPOSITION, getDefaultProducts, };
15
+ export { DEFAULTS, DEFAULT_CARD_COMPOSITION, DEFAULT_CARD_VISIBILITY, getDefaultProducts, };
16
16
  export default blockTemplate;
@@ -1,10 +1,13 @@
1
1
  import type { RecommendationProduct } from '@@/Types/recommendation';
2
+ import { ATTR_PRODUCT_IMAGE, ATTR_PRODUCT_NAME, ATTR_PRODUCT_PRICE, ATTR_PRODUCT_OLD_PRICE, ATTR_PRODUCT_OMNIBUS_PRICE, ATTR_PRODUCT_OMNIBUS_DISCOUNT, ATTR_PRODUCT_BUTTON } from '../constants';
2
3
  export interface ElementRenderer {
3
- productImage: (product: RecommendationProduct) => string;
4
- productName: (product: RecommendationProduct) => string;
5
- productPrice: (product: RecommendationProduct) => string;
6
- productOldPrice: (product: RecommendationProduct) => string;
7
- productButton: (product: RecommendationProduct) => string;
4
+ [ATTR_PRODUCT_IMAGE]: (product: RecommendationProduct) => string;
5
+ [ATTR_PRODUCT_NAME]: (product: RecommendationProduct) => string;
6
+ [ATTR_PRODUCT_PRICE]: (product: RecommendationProduct) => string;
7
+ [ATTR_PRODUCT_OLD_PRICE]: (product: RecommendationProduct) => string;
8
+ [ATTR_PRODUCT_OMNIBUS_PRICE]: (product: RecommendationProduct) => string;
9
+ [ATTR_PRODUCT_OMNIBUS_DISCOUNT]: (product: RecommendationProduct) => string;
10
+ [ATTR_PRODUCT_BUTTON]: (product: RecommendationProduct) => string;
8
11
  }
9
12
  export interface TemplateConfig {
10
13
  spacer: string;
@@ -17,10 +20,15 @@ export declare const DEFAULTS: {
17
20
  TITLE: string;
18
21
  DESCRIPTION: string;
19
22
  };
20
- export declare const spacer = "\n <tr>\n <td class=\"spacer\" style=\"height: 20px;\"></td>\n </tr>\n";
21
- export declare const productRow = "\n <tr>\n <td>\n <table width=\"100%\" height=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n {-{-PRODUCTS-}-}\n </table>\n </td>\n </tr>\n";
23
+ export declare const spacer = "\n <tr>\n <td class=\"spacer\" style=\"height: 10px;\"></td>\n </tr>\n";
24
+ export declare const productRow = "\n <tr class=\"recommendation-product-row\">\n <td>\n <table width=\"100%\" height=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n {-{-PRODUCTS-}-}\n </table>\n </td>\n </tr>\n";
22
25
  export declare const productCardWrapper = "\n <td width=\"{-{-COLUMN_WIDTH-}-}\" style=\"padding: 0 5px;\" valign=\"top\" height=\"100%\">\n <table\n width=\"100%\"\n height=\"100%\"\n cellpadding=\"0\"\n cellspacing=\"0\"\n border=\"0\"\n class=\"product-card-wrapper\">\n <tr>\n <td\n class=\"product-attribute-cell\"\n valign=\"top\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n {-{-PRODUCT_CONTENT-}-}\n </tbody>\n </table>\n </td>\n </tr>\n </table>\n </td>\n";
23
26
  export declare const DEFAULT_CARD_COMPOSITION: string[];
27
+ /**
28
+ * Default visibility settings for card composition elements
29
+ * Omnibus Price and Omnibus Discount are hidden by default
30
+ */
31
+ export declare const DEFAULT_CARD_VISIBILITY: Record<string, boolean>;
24
32
  export declare function getDefaultProducts(): RecommendationProduct[];
25
33
  /**
26
34
  * Core template generation logic that works with any element renderer
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Utility for preserving text styling when updating innerHTML
3
+ */
4
+ import type { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
5
+ /**
6
+ * Preserves existing style tags when updating text content
7
+ *
8
+ * When users apply text styles (bold, italic, etc.) in Stripo, the editor wraps
9
+ * content in tags like <strong>, <em>, <u>, <s>. This function extracts those
10
+ * style tags from the original HTML and re-applies them to the new text content.
11
+ * @example
12
+ * // Original: <span class="omnibus-text-before"><strong>Lowest price: </strong></span>
13
+ * // After calling preserveTextStyles(element, 'Best price: ')
14
+ * // Result: <strong>Best price: </strong>
15
+ * @param element - The DOM element or ImmutableHtmlNode containing the styled text
16
+ * @param newText - The new text content to insert
17
+ * @returns The new text wrapped in the original style tags
18
+ */
19
+ export declare function preserveTextStyles(element: ImmutableHtmlNode | Element, newText: string): string;
@@ -12,8 +12,9 @@
12
12
  import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
13
13
  /**
14
14
  * Factory function to create text align controls for different block elements
15
+ * When targetBlockId and containerSelector are not provided, applies directly to root
15
16
  */
16
- export declare function createTextAlignControl(controlId: string, targetBlockId: string, containerSelector: string): {
17
+ export declare function createTextAlignControl(controlId: string, targetBlockId?: string, containerSelector?: string): {
17
18
  new (): {
18
19
  getId(): string;
19
20
  getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
@@ -27,8 +28,9 @@ export declare function createTextAlignControl(controlId: string, targetBlockId:
27
28
  };
28
29
  /**
29
30
  * Factory function to create text color controls for different block elements
31
+ * When targetBlockId and containerSelector are not provided, applies directly to root
30
32
  */
31
- export declare function createTextColorControl(controlId: string, targetBlockId: string, containerSelector?: string): {
33
+ export declare function createTextColorControl(controlId: string, targetBlockId?: string, containerSelector?: string): {
32
34
  new (): {
33
35
  getId(): string;
34
36
  getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
@@ -42,8 +44,9 @@ export declare function createTextColorControl(controlId: string, targetBlockId:
42
44
  };
43
45
  /**
44
46
  * Factory function to create text size controls for different block elements
47
+ * When targetBlockId and containerSelector are not provided, applies directly to root
45
48
  */
46
- export declare function createTextSizeControl(controlId: string, targetBlockId: string, containerSelector?: string): {
49
+ export declare function createTextSizeControl(controlId: string, targetBlockId?: string, containerSelector?: string): {
47
50
  new (): {
48
51
  getId(): string;
49
52
  getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
@@ -57,8 +60,9 @@ export declare function createTextSizeControl(controlId: string, targetBlockId:
57
60
  };
58
61
  /**
59
62
  * Factory function to create text style controls for different block elements
63
+ * When targetBlockId and containerSelector are not provided, applies directly to root
60
64
  */
61
- export declare function createTextStyleControl(controlId: string, targetBlockId: string, containerSelector?: string): {
65
+ export declare function createTextStyleControl(controlId: string, targetBlockId?: string, containerSelector?: string): {
62
66
  new (): {
63
67
  getId(): string;
64
68
  getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
@@ -72,8 +76,9 @@ export declare function createTextStyleControl(controlId: string, targetBlockId:
72
76
  };
73
77
  /**
74
78
  * Factory function to create text font family controls for different block elements
79
+ * When targetBlockId and containerSelector are not provided, applies directly to root
75
80
  */
76
- export declare function createTextFontFamilyControl(controlId: string, targetBlockId: string, containerSelector?: string): {
81
+ export declare function createTextFontFamilyControl(controlId: string, targetBlockId?: string, containerSelector?: string): {
77
82
  new (): {
78
83
  getId(): string;
79
84
  getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
@@ -87,8 +92,9 @@ export declare function createTextFontFamilyControl(controlId: string, targetBlo
87
92
  };
88
93
  /**
89
94
  * Factory function to create text background color controls for different block elements
95
+ * When targetBlockId and containerSelector are not provided, applies directly to root
90
96
  */
91
- export declare function createTextBackgroundColorControl(controlId: string, targetBlockId: string, containerSelector?: string): {
97
+ export declare function createTextBackgroundColorControl(controlId: string, targetBlockId?: string, containerSelector?: string): {
92
98
  new (): {
93
99
  getId(): string;
94
100
  getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
@@ -102,8 +108,25 @@ export declare function createTextBackgroundColorControl(controlId: string, targ
102
108
  };
103
109
  /**
104
110
  * Factory function to create paddings controls for different block elements
111
+ * When targetBlockId and containerSelector are not provided, applies directly to root
105
112
  */
106
- export declare function createPaddingsControl(controlId: string, targetBlockId: string, containerSelector?: string): {
113
+ export declare function createPaddingsControl(controlId: string, targetBlockId?: string, containerSelector?: string): {
114
+ new (): {
115
+ getId(): string;
116
+ getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
117
+ getParentControlId(): string;
118
+ api: import("@stripoinc/ui-editor-extensions").ControlApi;
119
+ getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
120
+ getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
121
+ getAdditionalModifications(_root: ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
122
+ isVisible(_node: ImmutableHtmlNode): boolean;
123
+ };
124
+ };
125
+ /**
126
+ * Factory function to create text line spacing controls for different block elements
127
+ * When targetBlockId and containerSelector are not provided, applies directly to root
128
+ */
129
+ export declare function createTextLineSpacingControl(controlId: string, targetBlockId?: string, containerSelector?: string): {
107
130
  new (): {
108
131
  getId(): string;
109
132
  getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
@@ -1,4 +1,4 @@
1
- import type { GuidoConfig, GuidoConfigInput, IdentityConfig, PartnerConfig, TemplateConfig, EditorConfig, UIConfig, FeaturesConfig, BlocksConfig, CompilerConfig, CallbacksConfig } from '@@/Types/config';
1
+ import type { GuidoConfig, GuidoConfigInput, IdentityConfig, PartnerConfig, TemplateConfig, EditorConfig, UIConfig, FeaturesConfig, BlocksConfig, CompilerConfig } from '@@/Types/config';
2
2
  interface ConfigStoreState {
3
3
  /** Whether the config has been initialized */
4
4
  initialized: boolean;
@@ -95,9 +95,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
95
95
  })[];
96
96
  ignoreDefaultRules: boolean;
97
97
  };
98
- callbacks: {
99
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
100
- };
101
98
  } | null;
102
99
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => IdentityConfig | null;
103
100
  /**
@@ -189,9 +186,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
189
186
  })[];
190
187
  ignoreDefaultRules: boolean;
191
188
  };
192
- callbacks: {
193
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
194
- };
195
189
  } | null;
196
190
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => PartnerConfig | null;
197
191
  /**
@@ -283,9 +277,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
283
277
  })[];
284
278
  ignoreDefaultRules: boolean;
285
279
  };
286
- callbacks: {
287
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
288
- };
289
280
  } | null;
290
281
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => TemplateConfig | null;
291
282
  /**
@@ -377,9 +368,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
377
368
  })[];
378
369
  ignoreDefaultRules: boolean;
379
370
  };
380
- callbacks: {
381
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
382
- };
383
371
  } | null;
384
372
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => EditorConfig | null;
385
373
  /**
@@ -471,9 +459,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
471
459
  })[];
472
460
  ignoreDefaultRules: boolean;
473
461
  };
474
- callbacks: {
475
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
476
- };
477
462
  } | null;
478
463
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => UIConfig | null;
479
464
  /**
@@ -565,9 +550,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
565
550
  })[];
566
551
  ignoreDefaultRules: boolean;
567
552
  };
568
- callbacks: {
569
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
570
- };
571
553
  } | null;
572
554
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => FeaturesConfig | null;
573
555
  /**
@@ -659,9 +641,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
659
641
  })[];
660
642
  ignoreDefaultRules: boolean;
661
643
  };
662
- callbacks: {
663
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
664
- };
665
644
  } | null;
666
645
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => BlocksConfig | null;
667
646
  /**
@@ -753,105 +732,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
753
732
  })[];
754
733
  ignoreDefaultRules: boolean;
755
734
  };
756
- callbacks: {
757
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
758
- };
759
735
  } | null;
760
736
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => CompilerConfig | null;
761
- /**
762
- * Get the callbacks configuration
763
- */
764
- callbacks: (state: {
765
- initialized: boolean;
766
- config: {
767
- identity: {
768
- templateId: string;
769
- userId: string;
770
- variationId?: string | undefined;
771
- };
772
- partner: {
773
- name: string;
774
- productType: 60 | 49 | 97;
775
- messageType: 1 | 2;
776
- username: string;
777
- };
778
- template: {
779
- html: string;
780
- css: string;
781
- preselectedDynamicContent: {
782
- text: string;
783
- value: string;
784
- fallback?: string | undefined;
785
- format?: {
786
- key: string;
787
- value: string;
788
- } | undefined;
789
- }[];
790
- selectedUnsubscribePages: number[];
791
- };
792
- editor: {
793
- locale: string;
794
- translationsPath: string;
795
- migrationDate: number;
796
- emailHeader: {
797
- senderName: string;
798
- subject: string;
799
- };
800
- };
801
- ui: {
802
- showHeader: boolean;
803
- backButtonLabel?: string | undefined;
804
- };
805
- features: {
806
- dynamicContent: boolean;
807
- saveAsTemplate: boolean;
808
- versionHistory: boolean;
809
- testMessage: boolean;
810
- displayConditions: boolean;
811
- unsubscribe: boolean;
812
- modulesDisabled: boolean;
813
- };
814
- blocks: {
815
- excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
816
- includeCustoms: ("dynamic-content" | "checkbox-block" | "radio-button-block" | "recommendation-block" | "unsubscribe-block" | "coupon-block" | "items-block")[];
817
- };
818
- compiler: {
819
- customRules: ({
820
- type: "replace";
821
- search: string;
822
- replacement: string;
823
- replaceAll?: boolean | undefined;
824
- id: string;
825
- description?: string | undefined;
826
- priority: number;
827
- } | {
828
- type: "regex";
829
- pattern: string;
830
- replacement: string;
831
- flags?: string | undefined;
832
- id: string;
833
- description?: string | undefined;
834
- priority: number;
835
- } | {
836
- type: "remove";
837
- targets: string[];
838
- id: string;
839
- description?: string | undefined;
840
- priority: number;
841
- } | {
842
- type: "custom";
843
- processor: (html: string) => string;
844
- id: string;
845
- description?: string | undefined;
846
- priority: number;
847
- })[];
848
- ignoreDefaultRules: boolean;
849
- };
850
- callbacks: {
851
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
852
- };
853
- } | null;
854
- } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => CallbacksConfig | null;
855
737
  /**
856
738
  * Get the template ID
857
739
  */
@@ -941,9 +823,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
941
823
  })[];
942
824
  ignoreDefaultRules: boolean;
943
825
  };
944
- callbacks: {
945
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
946
- };
947
826
  } | null;
948
827
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
949
828
  /**
@@ -1035,9 +914,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1035
914
  })[];
1036
915
  ignoreDefaultRules: boolean;
1037
916
  };
1038
- callbacks: {
1039
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1040
- };
1041
917
  } | null;
1042
918
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
1043
919
  /**
@@ -1129,9 +1005,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1129
1005
  })[];
1130
1006
  ignoreDefaultRules: boolean;
1131
1007
  };
1132
- callbacks: {
1133
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1134
- };
1135
1008
  } | null;
1136
1009
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
1137
1010
  /**
@@ -1223,9 +1096,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1223
1096
  })[];
1224
1097
  ignoreDefaultRules: boolean;
1225
1098
  };
1226
- callbacks: {
1227
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1228
- };
1229
1099
  } | null;
1230
1100
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
1231
1101
  /**
@@ -1317,9 +1187,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1317
1187
  })[];
1318
1188
  ignoreDefaultRules: boolean;
1319
1189
  };
1320
- callbacks: {
1321
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1322
- };
1323
1190
  } | null;
1324
1191
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => number;
1325
1192
  /**
@@ -1411,9 +1278,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1411
1278
  })[];
1412
1279
  ignoreDefaultRules: boolean;
1413
1280
  };
1414
- callbacks: {
1415
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1416
- };
1417
1281
  } | null;
1418
1282
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => number;
1419
1283
  /**
@@ -1505,9 +1369,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1505
1369
  })[];
1506
1370
  ignoreDefaultRules: boolean;
1507
1371
  };
1508
- callbacks: {
1509
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1510
- };
1511
1372
  } | null;
1512
1373
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
1513
1374
  /**
@@ -1599,9 +1460,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1599
1460
  })[];
1600
1461
  ignoreDefaultRules: boolean;
1601
1462
  };
1602
- callbacks: {
1603
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1604
- };
1605
1463
  } | null;
1606
1464
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => boolean;
1607
1465
  /**
@@ -1693,9 +1551,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1693
1551
  })[];
1694
1552
  ignoreDefaultRules: boolean;
1695
1553
  };
1696
- callbacks: {
1697
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1698
- };
1699
1554
  } | null;
1700
1555
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => (feature: keyof FeaturesConfig) => boolean;
1701
1556
  }, {
@@ -48,7 +48,7 @@ const o = `.control-shadow-wrapper:has(.button) {
48
48
  }
49
49
 
50
50
  .e2e-text-insert-controls .control-shadow-wrapper:not(:last-of-type) {
51
- margin-right: 6px;
51
+ margin-right: 16px;
52
52
  }
53
53
 
54
54
  .flat-white > .button {
@@ -6,10 +6,6 @@ ue-main-editor-container[panel-position=SETTINGS_BLOCKS] ue-wide-panel {
6
6
  right: calc(100% - calc(var(--ue-spacing-step, 5px) * 3) - 425px);
7
7
  }
8
8
 
9
- ue-main-tabs-panel-component .fixed-panel-header {
10
- display: none;
11
- }
12
-
13
9
  /* Remove with this writing task DT-28355 */
14
10
  ue-description a {
15
11
  display: none;
@@ -23,6 +23,19 @@ const n = `.esd-x,
23
23
  .ins-recommendation-v3-block-v2 .product-attribute-cell ue-node-panel {
24
24
  display: none !important;
25
25
  }
26
+
27
+ /* Apply to the table cell (td) with text-trim-enabled class */
28
+ .text-trim-enabled {
29
+ max-width: 0 !important;
30
+ }
31
+
32
+ .text-trim-enabled p {
33
+ overflow: hidden !important;
34
+ text-overflow: ellipsis !important;
35
+ white-space: nowrap !important;
36
+ margin: 0 !important;
37
+ display: block !important;
38
+ }
26
39
  `;
27
40
  export {
28
41
  n as default
@@ -64,13 +64,6 @@ const s = o("guido-config", {
64
64
  var e;
65
65
  return ((e = i.config) == null ? void 0 : e.compiler) ?? null;
66
66
  },
67
- /**
68
- * Get the callbacks configuration
69
- */
70
- callbacks: (i) => {
71
- var e;
72
- return ((e = i.config) == null ? void 0 : e.callbacks) ?? null;
73
- },
74
67
  /**
75
68
  * Get the template ID
76
69
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "2.0.0-beta.6b24cb0",
3
+ "version": "2.0.0-beta.6b85cb2",
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",
@@ -1,13 +0,0 @@
1
- import { ButtonAlignBuiltInControl as t } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { RecommendationControlId as e, RecommendationBlockId as n } from "../../constants.js";
3
- class c extends t {
4
- getId() {
5
- return e.BUTTON_ALIGN;
6
- }
7
- getTargetNodes(o) {
8
- return o.closest(".ins-recommendation-product-container").querySelectorAll(`[esd-extension-block-id="${n.BUTTON}"]`);
9
- }
10
- }
11
- export {
12
- c as ButtonAlignControl
13
- };