@useinsider/guido 2.1.0-beta.e13d291 → 2.1.0-beta.e2d48fe
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.
- package/dist/config/migrator/itemsBlockMigrator.js +140 -123
- package/dist/config/migrator/recommendationMigrator.js +2 -2
- package/dist/extensions/Blocks/Items/block.js +19 -28
- package/dist/extensions/Blocks/Items/controls/button/link.js +19 -31
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +124 -85
- package/dist/extensions/Blocks/Items/controls/image/link.js +19 -31
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +28 -40
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +34 -46
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +45 -50
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +40 -51
- package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +23 -35
- package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +45 -57
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +42 -62
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +189 -196
- package/dist/extensions/Blocks/Items/enums/settingsEnums.js +0 -2
- package/dist/extensions/Blocks/Items/extension.js +8 -9
- package/dist/extensions/Blocks/Items/template.js +181 -175
- package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +65 -65
- package/dist/extensions/Blocks/Recommendation/block.js +6 -40
- package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +187 -0
- package/dist/extensions/Blocks/Recommendation/constants.js +13 -0
- package/dist/extensions/Blocks/Recommendation/control.js +336 -0
- package/dist/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.js +68 -0
- package/dist/extensions/Blocks/Recommendation/controls/index.js +245 -0
- package/dist/extensions/Blocks/Recommendation/controls/nameTextTrimControl.js +74 -0
- package/dist/extensions/Blocks/Recommendation/controls/{omnibusDiscount/textAfter.js → omnibusDiscountTextAfterControl.js} +14 -16
- package/dist/extensions/Blocks/Recommendation/controls/{omnibusDiscount/textBefore.js → omnibusDiscountTextBeforeControl.js} +14 -16
- package/dist/extensions/Blocks/Recommendation/controls/{omnibusPrice/textAfter.js → omnibusPriceTextAfterControl.js} +14 -16
- package/dist/extensions/Blocks/Recommendation/controls/{omnibusPrice/textBefore.js → omnibusPriceTextBeforeControl.js} +12 -14
- package/dist/extensions/Blocks/Recommendation/controls/spacingControl.js +188 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +17 -40
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +3 -19
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +4 -13
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +10 -21
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +36 -41
- package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +181 -0
- package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +189 -0
- package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +209 -0
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +9 -9
- package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +16 -27
- package/dist/extensions/Blocks/common-control.js +91 -92
- package/dist/extensions/Blocks/controlFactories.js +93 -125
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +169 -223
- package/dist/package.json.js +1 -1
- package/dist/services/recommendationApi.js +9 -10
- package/dist/src/components/wrappers/WpDrawer.vue.d.ts +1 -1
- package/dist/src/extensions/Blocks/Items/block.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/button/link.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +5 -5
- package/dist/src/extensions/Blocks/Items/controls/image/link.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/name/trimming.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/price/currencyLocation.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/price/currencySymbol.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/price/formattedPrice.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/price/hideDiscount.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/price/singlePrice.d.ts +0 -5
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +10 -12
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +2 -1
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -34
- package/dist/src/extensions/Blocks/Recommendation/{controls/cardComposition/index.d.ts → cardCompositionControl.d.ts} +3 -23
- package/dist/src/extensions/Blocks/Recommendation/{constants/controlIds.d.ts → constants.d.ts} +24 -0
- package/dist/src/extensions/Blocks/Recommendation/control.d.ts +38 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +589 -21
- package/dist/src/extensions/Blocks/Recommendation/extension.d.ts +0 -9
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +16 -17
- package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +16 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/{grid/migration.d.ts → migrationTemplate.d.ts} +4 -11
- package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +52 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +4 -5
- package/dist/static/styles/customEditorStyle.css.js +2 -25
- package/package.json +2 -2
- package/dist/extensions/Blocks/Items/store/items-block.js +0 -79
- package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +0 -4
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +0 -4
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +0 -64
- package/dist/extensions/Blocks/Recommendation/constants/layout.js +0 -20
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +0 -19
- package/dist/extensions/Blocks/Recommendation/controls/button/index.js +0 -64
- package/dist/extensions/Blocks/Recommendation/controls/cardBackground/index.js +0 -80
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +0 -232
- package/dist/extensions/Blocks/Recommendation/controls/image/index.js +0 -19
- package/dist/extensions/Blocks/Recommendation/controls/layout/index.js +0 -96
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +0 -110
- package/dist/extensions/Blocks/Recommendation/controls/main/currency.js +0 -204
- package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +0 -54
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +0 -205
- package/dist/extensions/Blocks/Recommendation/controls/main/locale.js +0 -74
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +0 -118
- package/dist/extensions/Blocks/Recommendation/controls/main/shuffle.js +0 -71
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +0 -286
- package/dist/extensions/Blocks/Recommendation/controls/name/index.js +0 -46
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +0 -76
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/index.js +0 -44
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.js +0 -48
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/index.js +0 -48
- package/dist/extensions/Blocks/Recommendation/controls/price/index.js +0 -44
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +0 -222
- package/dist/extensions/Blocks/Recommendation/services/configService.js +0 -239
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +0 -233
- package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +0 -251
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +0 -69
- package/dist/extensions/Blocks/Recommendation/templates/index.js +0 -12
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +0 -174
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +0 -73
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +0 -121
- package/dist/extensions/Blocks/Recommendation/types/nodeConfig.js +0 -6
- package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +0 -29
- package/dist/extensions/Blocks/Recommendation/utils/tagName.js +0 -46
- package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +0 -45
- package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +0 -13
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +0 -49
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +0 -13
- package/dist/src/extensions/Blocks/Recommendation/constants/layout.d.ts +0 -35
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +0 -31
- package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +0 -143
- package/dist/src/extensions/Blocks/Recommendation/controls/cardBackground/index.d.ts +0 -31
- package/dist/src/extensions/Blocks/Recommendation/controls/image/index.d.ts +0 -35
- package/dist/src/extensions/Blocks/Recommendation/controls/layout/index.d.ts +0 -37
- package/dist/src/extensions/Blocks/Recommendation/controls/main/algorithm.d.ts +0 -29
- package/dist/src/extensions/Blocks/Recommendation/controls/main/currency.d.ts +0 -45
- package/dist/src/extensions/Blocks/Recommendation/controls/main/filters.d.ts +0 -22
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +0 -57
- package/dist/src/extensions/Blocks/Recommendation/controls/main/locale.d.ts +0 -24
- package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +0 -42
- package/dist/src/extensions/Blocks/Recommendation/controls/main/shuffle.d.ts +0 -23
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +0 -214
- package/dist/src/extensions/Blocks/Recommendation/controls/name/index.d.ts +0 -97
- package/dist/src/extensions/Blocks/Recommendation/controls/name/textTrim.d.ts +0 -16
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/index.d.ts +0 -95
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.d.ts +0 -100
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.d.ts +0 -15
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.d.ts +0 -15
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/index.d.ts +0 -100
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.d.ts +0 -15
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.d.ts +0 -15
- package/dist/src/extensions/Blocks/Recommendation/controls/price/index.d.ts +0 -95
- package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +0 -83
- package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +0 -151
- package/dist/src/extensions/Blocks/Recommendation/services/index.d.ts +0 -6
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +0 -20
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +0 -33
- package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +0 -39
- package/dist/src/extensions/Blocks/Recommendation/templates/list/elementRenderer.d.ts +0 -8
- package/dist/src/extensions/Blocks/Recommendation/templates/list/migration.d.ts +0 -25
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +0 -18
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +0 -54
- package/dist/src/extensions/Blocks/Recommendation/types/index.d.ts +0 -7
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +0 -154
- package/dist/src/extensions/Blocks/Recommendation/utils/priceFormatter.d.ts +0 -33
- package/dist/src/extensions/Blocks/Recommendation/utils/stylePreserver.d.ts +0 -113
- package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +0 -77
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Recommendation Block Extension
|
|
3
|
-
*
|
|
4
|
-
* This extension provides a product recommendation block for email templates.
|
|
5
|
-
* Controls are organized by element type in the ./controls directory.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Build and export the Recommendation extension
|
|
9
|
-
*/
|
|
10
1
|
declare const _default: import("@stripoinc/ui-editor-extensions").Extension;
|
|
11
2
|
export default _default;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Orientation, Languages, Currency, NumericSeparator, FiltersResponse, Filter, RecommendationProduct } from '@@/Types/recommendation';
|
|
2
2
|
interface StoreState {
|
|
3
|
-
/** Maps campaign URLs for recommendation blocks. Used by templateLibraryApi when saving templates. */
|
|
4
3
|
recommendationCampaignUrls: Record<string, string>;
|
|
5
4
|
recommendationConfigs: {
|
|
6
5
|
cardsInRow: number;
|
|
@@ -19,8 +18,8 @@ interface StoreState {
|
|
|
19
18
|
orientation: Orientation;
|
|
20
19
|
productIds: string[];
|
|
21
20
|
recommendedProducts: [];
|
|
22
|
-
sendProductRequestFlag:
|
|
23
|
-
shuffleProducts:
|
|
21
|
+
sendProductRequestFlag: false;
|
|
22
|
+
shuffleProducts: false;
|
|
24
23
|
strategy: string;
|
|
25
24
|
textTrimming: boolean;
|
|
26
25
|
unresponsive: boolean;
|
|
@@ -66,8 +65,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
66
65
|
orientation: Orientation;
|
|
67
66
|
productIds: string[];
|
|
68
67
|
recommendedProducts: [];
|
|
69
|
-
sendProductRequestFlag:
|
|
70
|
-
shuffleProducts:
|
|
68
|
+
sendProductRequestFlag: false;
|
|
69
|
+
shuffleProducts: false;
|
|
71
70
|
strategy: string;
|
|
72
71
|
textTrimming: boolean;
|
|
73
72
|
unresponsive: boolean;
|
|
@@ -135,8 +134,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
135
134
|
orientation: Orientation;
|
|
136
135
|
productIds: string[];
|
|
137
136
|
recommendedProducts: [];
|
|
138
|
-
sendProductRequestFlag:
|
|
139
|
-
shuffleProducts:
|
|
137
|
+
sendProductRequestFlag: false;
|
|
138
|
+
shuffleProducts: false;
|
|
140
139
|
strategy: string;
|
|
141
140
|
textTrimming: boolean;
|
|
142
141
|
unresponsive: boolean;
|
|
@@ -204,8 +203,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
204
203
|
orientation: Orientation;
|
|
205
204
|
productIds: string[];
|
|
206
205
|
recommendedProducts: [];
|
|
207
|
-
sendProductRequestFlag:
|
|
208
|
-
shuffleProducts:
|
|
206
|
+
sendProductRequestFlag: false;
|
|
207
|
+
shuffleProducts: false;
|
|
209
208
|
strategy: string;
|
|
210
209
|
textTrimming: boolean;
|
|
211
210
|
unresponsive: boolean;
|
|
@@ -276,8 +275,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
276
275
|
orientation: Orientation;
|
|
277
276
|
productIds: string[];
|
|
278
277
|
recommendedProducts: [];
|
|
279
|
-
sendProductRequestFlag:
|
|
280
|
-
shuffleProducts:
|
|
278
|
+
sendProductRequestFlag: false;
|
|
279
|
+
shuffleProducts: false;
|
|
281
280
|
strategy: string;
|
|
282
281
|
textTrimming: boolean;
|
|
283
282
|
unresponsive: boolean;
|
|
@@ -348,8 +347,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
348
347
|
orientation: Orientation;
|
|
349
348
|
productIds: string[];
|
|
350
349
|
recommendedProducts: [];
|
|
351
|
-
sendProductRequestFlag:
|
|
352
|
-
shuffleProducts:
|
|
350
|
+
sendProductRequestFlag: false;
|
|
351
|
+
shuffleProducts: false;
|
|
353
352
|
strategy: string;
|
|
354
353
|
textTrimming: boolean;
|
|
355
354
|
unresponsive: boolean;
|
|
@@ -420,8 +419,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
420
419
|
orientation: Orientation;
|
|
421
420
|
productIds: string[];
|
|
422
421
|
recommendedProducts: [];
|
|
423
|
-
sendProductRequestFlag:
|
|
424
|
-
shuffleProducts:
|
|
422
|
+
sendProductRequestFlag: false;
|
|
423
|
+
shuffleProducts: false;
|
|
425
424
|
strategy: string;
|
|
426
425
|
textTrimming: boolean;
|
|
427
426
|
unresponsive: boolean;
|
|
@@ -493,8 +492,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
493
492
|
orientation: Orientation;
|
|
494
493
|
productIds: string[];
|
|
495
494
|
recommendedProducts: [];
|
|
496
|
-
sendProductRequestFlag:
|
|
497
|
-
shuffleProducts:
|
|
495
|
+
sendProductRequestFlag: false;
|
|
496
|
+
shuffleProducts: false;
|
|
498
497
|
strategy: string;
|
|
499
498
|
textTrimming: boolean;
|
|
500
499
|
unresponsive: boolean;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { RecommendationProduct } from '@@/Types/recommendation';
|
|
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
|
+
export declare function getDefaultTemplate(): string;
|
|
5
|
+
/**
|
|
6
|
+
* Generates a custom template with specified products and layout
|
|
7
|
+
* @param products - Array of products to display
|
|
8
|
+
* @param productsPerRow - Number of products per row
|
|
9
|
+
* @param title - Optional title for the block
|
|
10
|
+
* @param composition - Optional array defining order of card elements
|
|
11
|
+
* @returns Complete HTML template
|
|
12
|
+
*/
|
|
13
|
+
export declare function generateBlockTemplate(products: RecommendationProduct[], productsPerRow: number, title?: string, composition?: string[]): string;
|
|
14
|
+
export declare function prepareProductRows(products: RecommendationProduct[], productsPerRow: number, composition?: string[]): string;
|
|
15
|
+
export { DEFAULTS, DEFAULT_CARD_COMPOSITION, DEFAULT_CARD_VISIBILITY, getDefaultProducts, };
|
|
16
|
+
export default blockTemplate;
|
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
import type { RecommendationProduct } from '@@/Types/recommendation';
|
|
2
|
-
import { DEFAULTS, getDefaultProducts
|
|
2
|
+
import { DEFAULTS, getDefaultProducts } from './templateUtils';
|
|
3
3
|
declare const migrationTemplate = "\n <td\n align=\"left\"\n esd-extension-block-id=\"recommendation-block\"\n esd-handler-name=\"esd-extension-RecommendationBlock\"\n class=\"ins-recommendation-v3-block-v2 esd-block-recommendation-v3-block esd-extension-block es-p20\"\n >\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 <tr>\n {-{-TITLE-}-}\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n <tr>\n <td class=\"spacer\" style=\"height: 20px;\"></td>\n </tr>\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
|
-
/**
|
|
5
|
-
* Prepares migration product rows with attribute-aligned structure.
|
|
6
|
-
* @param products - Array of products to display
|
|
7
|
-
* @param productsPerRow - Number of products per row
|
|
8
|
-
* @param composition - Array defining element order
|
|
9
|
-
* @returns HTML string for product rows
|
|
10
|
-
*/
|
|
11
|
-
export declare function prepareProductRows(products: RecommendationProduct[], productsPerRow: number, composition?: string[]): string;
|
|
12
4
|
export declare function getMigrationTemplate(): string;
|
|
13
5
|
/**
|
|
14
|
-
* Generates a custom migration template with specified products and layout
|
|
6
|
+
* Generates a custom migration template with specified products and layout
|
|
15
7
|
* @param products - Array of products to display
|
|
16
8
|
* @param productsPerRow - Number of products per row
|
|
17
9
|
* @param title - Optional title for the block
|
|
@@ -19,5 +11,6 @@ export declare function getMigrationTemplate(): string;
|
|
|
19
11
|
* @returns Complete HTML template
|
|
20
12
|
*/
|
|
21
13
|
export declare function generateMigrationTemplate(products: RecommendationProduct[], productsPerRow: number, title?: string, composition?: string[]): string;
|
|
22
|
-
export
|
|
14
|
+
export declare function prepareProductRows(products: RecommendationProduct[], productsPerRow: number, composition?: string[]): string;
|
|
15
|
+
export { DEFAULTS, getDefaultProducts };
|
|
23
16
|
export default migrationTemplate;
|
|
@@ -0,0 +1,52 @@
|
|
|
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';
|
|
3
|
+
export interface ElementRenderer {
|
|
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;
|
|
11
|
+
}
|
|
12
|
+
export interface TemplateConfig {
|
|
13
|
+
spacer: string;
|
|
14
|
+
blockTemplate: string;
|
|
15
|
+
productRow: string;
|
|
16
|
+
productCardWrapper: string;
|
|
17
|
+
elementRenderer: ElementRenderer;
|
|
18
|
+
}
|
|
19
|
+
export declare const DEFAULTS: {
|
|
20
|
+
TITLE: string;
|
|
21
|
+
DESCRIPTION: string;
|
|
22
|
+
};
|
|
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";
|
|
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";
|
|
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>;
|
|
32
|
+
export declare function getDefaultProducts(): RecommendationProduct[];
|
|
33
|
+
/**
|
|
34
|
+
* Core template generation logic that works with any element renderer
|
|
35
|
+
* @param products - Array of products to display
|
|
36
|
+
* @param productsPerRow - Number of products per row
|
|
37
|
+
* @param elementRenderer - Object with methods to render each product element
|
|
38
|
+
* @param composition - Optional array defining order of card elements
|
|
39
|
+
* @returns HTML string for product rows
|
|
40
|
+
*/
|
|
41
|
+
export declare function prepareProductRows(products: RecommendationProduct[], productsPerRow: number, elementRenderer: ElementRenderer, composition?: string[]): string;
|
|
42
|
+
/**
|
|
43
|
+
* Generates complete HTML template with dynamic products and layout
|
|
44
|
+
* @param blockTemplate - The base block template string
|
|
45
|
+
* @param products - Array of products to display
|
|
46
|
+
* @param productsPerRow - Number of products per row
|
|
47
|
+
* @param elementRenderer - Element renderer for generating product HTML
|
|
48
|
+
* @param title - Title for the block
|
|
49
|
+
* @param composition - Optional array defining order of card elements
|
|
50
|
+
* @returns Complete HTML template
|
|
51
|
+
*/
|
|
52
|
+
export declare function generateTemplate(blockTemplate: string, products: RecommendationProduct[], productsPerRow: number, elementRenderer: ElementRenderer, title?: string, composition?: string[]): string;
|
|
@@ -66,14 +66,13 @@ export declare abstract class CommonControl extends Control {
|
|
|
66
66
|
*/
|
|
67
67
|
protected getBlockInstanceId(): string | null;
|
|
68
68
|
/**
|
|
69
|
-
* Handles block instance change detection and
|
|
70
|
-
* This is a helper method for controls that need to
|
|
69
|
+
* Handles block instance change detection and UI updates.
|
|
70
|
+
* This is a helper method for controls that need to update UI when switching between block instances.
|
|
71
71
|
* Uses Stripo V2 nodeConfig API for block instance tracking.
|
|
72
|
-
* @param
|
|
73
|
-
* @param updateUI - Function to call to update the UI (called both on change and when same block)
|
|
72
|
+
* @param updateUI - Function to call to update the UI (called on every update)
|
|
74
73
|
* @returns true if block instance changed, false otherwise
|
|
75
74
|
*/
|
|
76
|
-
protected handleBlockInstanceChange(
|
|
75
|
+
protected handleBlockInstanceChange(updateUI: () => void): boolean;
|
|
77
76
|
_GuLabel({ text, name }: LabelProps): string;
|
|
78
77
|
_GuToggle(name: string): string;
|
|
79
78
|
_GuSelectItem({ text, value }: {
|
|
@@ -19,31 +19,8 @@ const n = `.esd-x,
|
|
|
19
19
|
box-shadow: none;
|
|
20
20
|
}
|
|
21
21
|
.ins-product-cart ue-node-actions,
|
|
22
|
-
|
|
23
|
-
.ins-recommendation-v3-block-v2 .product-
|
|
24
|
-
.ins-recommendation-v3-block-v2 .product-info-cell ue-node-panel,
|
|
25
|
-
.ins-recommendation-v3-block-v2 .product-image-cell ue-node-actions,
|
|
26
|
-
.ins-recommendation-v3-block-v2 .product-image-cell ue-node-panel,
|
|
27
|
-
.ins-recommendation-v3-block-v2 .button-cell ue-node-actions,
|
|
28
|
-
.ins-recommendation-v3-block-v2 .button-cell ue-node-panel,
|
|
29
|
-
/* Vertical layout - hide for product-card-segment inner cells */
|
|
30
|
-
.ins-recommendation-v3-block-v2 .product-card-segment ue-node-actions,
|
|
31
|
-
.ins-recommendation-v3-block-v2 .product-card-segment ue-node-panel,
|
|
32
|
-
/* Hide for specific product attribute cells in both layouts */
|
|
33
|
-
.ins-recommendation-v3-block-v2 .product-image ue-node-actions,
|
|
34
|
-
.ins-recommendation-v3-block-v2 .product-image ue-node-panel,
|
|
35
|
-
.ins-recommendation-v3-block-v2 .product-name ue-node-actions,
|
|
36
|
-
.ins-recommendation-v3-block-v2 .product-name ue-node-panel,
|
|
37
|
-
.ins-recommendation-v3-block-v2 .product-price ue-node-actions,
|
|
38
|
-
.ins-recommendation-v3-block-v2 .product-price ue-node-panel,
|
|
39
|
-
.ins-recommendation-v3-block-v2 .product-old-price ue-node-actions,
|
|
40
|
-
.ins-recommendation-v3-block-v2 .product-old-price ue-node-panel,
|
|
41
|
-
.ins-recommendation-v3-block-v2 .product-omnibus-price ue-node-actions,
|
|
42
|
-
.ins-recommendation-v3-block-v2 .product-omnibus-price ue-node-panel,
|
|
43
|
-
.ins-recommendation-v3-block-v2 .product-omnibus-discount ue-node-actions,
|
|
44
|
-
.ins-recommendation-v3-block-v2 .product-omnibus-discount ue-node-panel,
|
|
45
|
-
.ins-recommendation-v3-block-v2 .product-button ue-node-actions,
|
|
46
|
-
.ins-recommendation-v3-block-v2 .product-button ue-node-panel {
|
|
22
|
+
.ins-recommendation-v3-block-v2 .product-attribute-cell ue-node-actions,
|
|
23
|
+
.ins-recommendation-v3-block-v2 .product-attribute-cell ue-node-panel {
|
|
47
24
|
display: none !important;
|
|
48
25
|
}
|
|
49
26
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "2.1.0-beta.
|
|
3
|
+
"version": "2.1.0-beta.e2d48fe",
|
|
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",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
},
|
|
86
86
|
"guido": {
|
|
87
87
|
"stripo": {
|
|
88
|
-
"version": "2.
|
|
88
|
+
"version": "2.54.0"
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { defineStore as s } from "pinia";
|
|
2
|
-
import { DefaultConfigValues as e } from "../enums/settingsEnums.js";
|
|
3
|
-
const n = (t) => t.replace(/Url\}/, "Image}"), r = (t) => t.replace(/Image\}/, "Url}"), i = () => {
|
|
4
|
-
const t = e.cartItemsSelectControlValue;
|
|
5
|
-
return {
|
|
6
|
-
itemsType: e.itemsType,
|
|
7
|
-
itemIds: t,
|
|
8
|
-
imageLink: n(t),
|
|
9
|
-
buttonLink: r(t),
|
|
10
|
-
orientation: e.cardOrientationControlValue,
|
|
11
|
-
nameTrimming: !0,
|
|
12
|
-
hideDiscount: !0,
|
|
13
|
-
currencySymbol: "USD",
|
|
14
|
-
currencyLocation: "0",
|
|
15
|
-
formattedPrice: !0,
|
|
16
|
-
singlePrice: !1,
|
|
17
|
-
priceOrientation: "vertical",
|
|
18
|
-
templateData: {
|
|
19
|
-
imageSrc: "",
|
|
20
|
-
name: "",
|
|
21
|
-
price: "",
|
|
22
|
-
originalPrice: "",
|
|
23
|
-
quantity: "",
|
|
24
|
-
button: ""
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
}, m = s("guidoItemsBlock", {
|
|
28
|
-
state: () => i(),
|
|
29
|
-
actions: {
|
|
30
|
-
setItemsType(t) {
|
|
31
|
-
this.itemsType = t;
|
|
32
|
-
},
|
|
33
|
-
setItemIds(t) {
|
|
34
|
-
this.itemIds = t, this.imageLink = n(t), this.buttonLink = r(t);
|
|
35
|
-
},
|
|
36
|
-
setImageLink(t) {
|
|
37
|
-
this.imageLink = t;
|
|
38
|
-
},
|
|
39
|
-
setButtonLink(t) {
|
|
40
|
-
this.buttonLink = t;
|
|
41
|
-
},
|
|
42
|
-
setOrientation(t) {
|
|
43
|
-
this.orientation = t;
|
|
44
|
-
},
|
|
45
|
-
setNameTrimming(t) {
|
|
46
|
-
this.nameTrimming = t;
|
|
47
|
-
},
|
|
48
|
-
setHideDiscount(t) {
|
|
49
|
-
this.hideDiscount = t;
|
|
50
|
-
},
|
|
51
|
-
setCurrencySymbol(t) {
|
|
52
|
-
this.currencySymbol = t;
|
|
53
|
-
},
|
|
54
|
-
setCurrencyLocation(t) {
|
|
55
|
-
this.currencyLocation = t;
|
|
56
|
-
},
|
|
57
|
-
setFormattedPrice(t) {
|
|
58
|
-
this.formattedPrice = t;
|
|
59
|
-
},
|
|
60
|
-
setSinglePrice(t) {
|
|
61
|
-
this.singlePrice = t;
|
|
62
|
-
},
|
|
63
|
-
setPriceOrientation(t) {
|
|
64
|
-
this.priceOrientation = t;
|
|
65
|
-
},
|
|
66
|
-
setTemplateData(t) {
|
|
67
|
-
this.templateData = t;
|
|
68
|
-
},
|
|
69
|
-
updateFromAttributes(t) {
|
|
70
|
-
t.itemsType && (this.itemsType = t.itemsType), t.itemIds && this.setItemIds(t.itemIds), t.orientation && (this.orientation = t.orientation);
|
|
71
|
-
},
|
|
72
|
-
reset() {
|
|
73
|
-
Object.assign(this, i());
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
export {
|
|
78
|
-
m as useItemsBlockStore
|
|
79
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
var b = /* @__PURE__ */ ((r) => (r.BUTTON = "recommendation-block-button", r.NAME = "recommendation-block-name", r.PRICE = "recommendation-block-price", r.OLD_PRICE = "recommendation-block-old-price", r.OMNIBUS_PRICE = "recommendation-block-omnibus-price", r.OMNIBUS_DISCOUNT = "recommendation-block-omnibus-discount", r.IMAGE = "recommendation-block-image", r))(b || {});
|
|
2
|
-
export {
|
|
3
|
-
b as RecommendationBlockId
|
|
4
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
var o = /* @__PURE__ */ ((c) => (c.BUTTON_ALIGN = "recommendation-block-button-align-control", c.BUTTON_BORDER = "recommendation-block-button-border-control", c.BUTTON_BORDER_RADIUS = "recommendation-block-button-border-radius-control", c.BUTTON_COLOR = "recommendation-block-button-color-control", c.BUTTON_FIT_TO_CONTENT = "recommendation-block-button-fit-to-content-control", c.BUTTON_FONT_FAMILY = "recommendation-block-button-font-family-control", c.BUTTON_MARGINS = "recommendation-block-button-margins-control", c.BUTTON_PADDINGS = "recommendation-block-button-paddings-control", c.BUTTON_TEXT = "recommendation-block-button-text-control", c.BUTTON_TEXT_SIZE = "recommendation-block-button-text-size-control", c.BUTTON_TEXT_STYLE_AND_FONT_COLOR = "recommendation-block-button-text-style-and-font-color-control", c.NAME_ALIGN = "recommendation-block-name-align-control", c.NAME_BACKGROUND = "recommendation-block-name-background-control", c.NAME_COLOR = "recommendation-block-name-color-control", c.NAME_FONT_FAMILY = "recommendation-block-name-font-family-control", c.NAME_PADDINGS = "recommendation-block-name-paddings-control", c.NAME_SIZE = "recommendation-block-name-size-control", c.NAME_STYLE = "recommendation-block-name-style-control", c.NAME_TEXT_TRIM = "recommendation-block-name-text-trim-control", c.PRICE_ALIGN = "recommendation-block-price-align-control", c.PRICE_BACKGROUND = "recommendation-block-price-background-control", c.PRICE_COLOR = "recommendation-block-price-color-control", c.PRICE_FONT_FAMILY = "recommendation-block-price-font-family-control", c.PRICE_PADDINGS = "recommendation-block-price-paddings-control", c.PRICE_SIZE = "recommendation-block-price-size-control", c.PRICE_STYLE = "recommendation-block-price-style-control", c.OLD_PRICE_ALIGN = "recommendation-block-old-price-align-control", c.OLD_PRICE_BACKGROUND = "recommendation-block-old-price-background-control", c.OLD_PRICE_COLOR = "recommendation-block-old-price-color-control", c.OLD_PRICE_FONT_FAMILY = "recommendation-block-old-price-font-family-control", c.OLD_PRICE_PADDINGS = "recommendation-block-old-price-paddings-control", c.OLD_PRICE_SIZE = "recommendation-block-old-price-size-control", c.OLD_PRICE_STYLE = "recommendation-block-old-price-style-control", c.OMNIBUS_PRICE_ALIGN = "recommendation-block-omnibus-price-align-control", c.OMNIBUS_PRICE_BACKGROUND = "recommendation-block-omnibus-price-background-control", c.OMNIBUS_PRICE_COLOR = "recommendation-block-omnibus-price-color-control", c.OMNIBUS_PRICE_FONT_FAMILY = "recommendation-block-omnibus-price-font-family-control", c.OMNIBUS_PRICE_PADDINGS = "recommendation-block-omnibus-price-paddings-control", c.OMNIBUS_PRICE_SIZE = "recommendation-block-omnibus-price-size-control", c.OMNIBUS_PRICE_STYLE = "recommendation-block-omnibus-price-style-control", c.OMNIBUS_PRICE_TEXT_BEFORE = "recommendation-block-omnibus-price-text-before-control", c.OMNIBUS_PRICE_TEXT_AFTER = "recommendation-block-omnibus-price-text-after-control", c.OMNIBUS_DISCOUNT_ALIGN = "recommendation-block-omnibus-discount-align-control", c.OMNIBUS_DISCOUNT_BACKGROUND = "recommendation-block-omnibus-discount-background-control", c.OMNIBUS_DISCOUNT_COLOR = "recommendation-block-omnibus-discount-color-control", c.OMNIBUS_DISCOUNT_FONT_FAMILY = "recommendation-block-omnibus-discount-font-family-control", c.OMNIBUS_DISCOUNT_PADDINGS = "recommendation-block-omnibus-discount-paddings-control", c.OMNIBUS_DISCOUNT_SIZE = "recommendation-block-omnibus-discount-size-control", c.OMNIBUS_DISCOUNT_STYLE = "recommendation-block-omnibus-discount-style-control", c.OMNIBUS_DISCOUNT_TEXT_BEFORE = "recommendation-block-omnibus-discount-text-before-control", c.OMNIBUS_DISCOUNT_TEXT_AFTER = "recommendation-block-omnibus-discount-text-after-control", c.IMAGE_SIZE = "recommendation-block-image-size-control", c.IMAGE_MARGINS = "recommendation-block-image-margins-control", c))(o || {});
|
|
2
|
-
export {
|
|
3
|
-
o as RecommendationControlId
|
|
4
|
-
};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { DEFAULT_ROW_SPACING as s, DEFAULT_COLUMN_SPACING as R, DEFAULT_CARDS_IN_ROW as n } from "./layout.js";
|
|
2
|
-
import { ATTR_PRODUCT_IMAGE as t, ATTR_PRODUCT_NAME as T, ATTR_PRODUCT_OLD_PRICE as e, ATTR_PRODUCT_PRICE as o, ATTR_PRODUCT_OMNIBUS_PRICE as _, ATTR_PRODUCT_OMNIBUS_DISCOUNT as r, ATTR_PRODUCT_BUTTON as U } from "./selectors.js";
|
|
3
|
-
const I = {
|
|
4
|
-
code: "USD",
|
|
5
|
-
symbol: "USD",
|
|
6
|
-
alignment: "after",
|
|
7
|
-
decimalCount: 2,
|
|
8
|
-
decimalSeparator: ".",
|
|
9
|
-
thousandSeparator: ","
|
|
10
|
-
}, O = {
|
|
11
|
-
textBefore: "",
|
|
12
|
-
textAfter: ""
|
|
13
|
-
}, i = {
|
|
14
|
-
textBefore: "",
|
|
15
|
-
textAfter: ""
|
|
16
|
-
}, C = [
|
|
17
|
-
t,
|
|
18
|
-
T,
|
|
19
|
-
e,
|
|
20
|
-
o,
|
|
21
|
-
_,
|
|
22
|
-
r,
|
|
23
|
-
U
|
|
24
|
-
], D = {
|
|
25
|
-
[t]: !0,
|
|
26
|
-
[T]: !0,
|
|
27
|
-
[o]: !0,
|
|
28
|
-
[e]: !0,
|
|
29
|
-
[_]: !1,
|
|
30
|
-
[r]: !1,
|
|
31
|
-
[U]: !0
|
|
32
|
-
}, a = {
|
|
33
|
-
// Settings
|
|
34
|
-
strategy: "mostPopular",
|
|
35
|
-
productIds: [],
|
|
36
|
-
size: "6",
|
|
37
|
-
shuffleProducts: !1,
|
|
38
|
-
language: "en_US",
|
|
39
|
-
currency: I,
|
|
40
|
-
filters: [],
|
|
41
|
-
// Layout
|
|
42
|
-
layout: "grid",
|
|
43
|
-
cardsInRow: n,
|
|
44
|
-
columnSpacing: R,
|
|
45
|
-
rowSpacing: s,
|
|
46
|
-
// Composition
|
|
47
|
-
composition: C,
|
|
48
|
-
visibility: D,
|
|
49
|
-
// Element settings
|
|
50
|
-
omnibusPrice: O,
|
|
51
|
-
omnibusDiscount: i,
|
|
52
|
-
textTrimming: !1,
|
|
53
|
-
// Meta
|
|
54
|
-
configVersion: 1
|
|
55
|
-
}, E = 1;
|
|
56
|
-
export {
|
|
57
|
-
E as CURRENT_CONFIG_VERSION,
|
|
58
|
-
C as DEFAULT_COMPOSITION,
|
|
59
|
-
I as DEFAULT_CURRENCY,
|
|
60
|
-
a as DEFAULT_NODE_CONFIG,
|
|
61
|
-
i as DEFAULT_OMNIBUS_DISCOUNT,
|
|
62
|
-
O as DEFAULT_OMNIBUS_PRICE,
|
|
63
|
-
D as DEFAULT_VISIBILITY
|
|
64
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const _ = {
|
|
2
|
-
GRID: "grid",
|
|
3
|
-
LIST: "list"
|
|
4
|
-
}, o = [
|
|
5
|
-
{ icon: "grid-orientation", value: _.GRID },
|
|
6
|
-
{ icon: "list-orientation", value: _.LIST }
|
|
7
|
-
], t = 3, n = 3, A = 9, T = 4, c = 10, s = 20, O = 0, S = 50, I = 5;
|
|
8
|
-
export {
|
|
9
|
-
n as DEFAULT_CARDS_IN_ROW,
|
|
10
|
-
c as DEFAULT_COLUMN_SPACING,
|
|
11
|
-
t as DEFAULT_PRODUCTS_PER_ROW,
|
|
12
|
-
s as DEFAULT_ROW_SPACING,
|
|
13
|
-
o as LAYOUT_OPTIONS,
|
|
14
|
-
_ as LAYOUT_VALUES,
|
|
15
|
-
T as MAX_PRODUCTS_PER_ROW,
|
|
16
|
-
A as MAX_PRODUCT_COUNT,
|
|
17
|
-
S as MAX_SPACING,
|
|
18
|
-
O as MIN_SPACING,
|
|
19
|
-
I as SPACING_STEP
|
|
20
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
const c = ".ins-recommendation-product-container", T = {
|
|
2
|
-
CURRENCY: "currency",
|
|
3
|
-
SYMBOL: "currency-symbol",
|
|
4
|
-
ALIGNMENT: "currency-alignment",
|
|
5
|
-
THOUSAND_SEPARATOR: "currency-thousand-separator",
|
|
6
|
-
DECIMAL_SEPARATOR: "currency-decimal-separator",
|
|
7
|
-
DECIMAL_COUNT: "currency-decimal-count"
|
|
8
|
-
}, r = "productImage", n = "productName", o = "productPrice", t = "productOldPrice", R = "productOmnibusPrice", O = "productOmnibusDiscount", _ = "productButton";
|
|
9
|
-
export {
|
|
10
|
-
_ as ATTR_PRODUCT_BUTTON,
|
|
11
|
-
r as ATTR_PRODUCT_IMAGE,
|
|
12
|
-
n as ATTR_PRODUCT_NAME,
|
|
13
|
-
t as ATTR_PRODUCT_OLD_PRICE,
|
|
14
|
-
O as ATTR_PRODUCT_OMNIBUS_DISCOUNT,
|
|
15
|
-
R as ATTR_PRODUCT_OMNIBUS_PRICE,
|
|
16
|
-
o as ATTR_PRODUCT_PRICE,
|
|
17
|
-
c as CONTAINER_SELECTOR,
|
|
18
|
-
T as CURRENCY_ATTR
|
|
19
|
-
};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { createButtonFitToContainerControl as T, createButtonTextStyleAndFontColorControl as r, createButtonTextSizeControl as e, createButtonTextControl as B, createButtonPaddingsControl as l, createButtonMarginsControl as C, createButtonFontFamilyControl as O, createButtonColorControl as N, createButtonBorderRadiusControl as i, createButtonBorderControl as a, createButtonAlignControl as c } from "../../../controlFactories.js";
|
|
2
|
-
import { RecommendationBlockId as o } from "../../constants/blockIds.js";
|
|
3
|
-
import { RecommendationControlId as t } from "../../constants/controlIds.js";
|
|
4
|
-
import { CONTAINER_SELECTOR as n } from "../../constants/selectors.js";
|
|
5
|
-
const U = c(
|
|
6
|
-
t.BUTTON_ALIGN,
|
|
7
|
-
o.BUTTON,
|
|
8
|
-
n
|
|
9
|
-
), d = a(
|
|
10
|
-
t.BUTTON_BORDER,
|
|
11
|
-
o.BUTTON,
|
|
12
|
-
n
|
|
13
|
-
), s = i(
|
|
14
|
-
t.BUTTON_BORDER_RADIUS,
|
|
15
|
-
o.BUTTON,
|
|
16
|
-
n
|
|
17
|
-
), _ = N(
|
|
18
|
-
t.BUTTON_COLOR,
|
|
19
|
-
o.BUTTON,
|
|
20
|
-
n
|
|
21
|
-
), m = O(
|
|
22
|
-
t.BUTTON_FONT_FAMILY,
|
|
23
|
-
o.BUTTON,
|
|
24
|
-
n
|
|
25
|
-
), u = C(
|
|
26
|
-
t.BUTTON_MARGINS,
|
|
27
|
-
o.BUTTON,
|
|
28
|
-
n
|
|
29
|
-
), R = l(
|
|
30
|
-
t.BUTTON_PADDINGS,
|
|
31
|
-
o.BUTTON,
|
|
32
|
-
n
|
|
33
|
-
), F = B(
|
|
34
|
-
t.BUTTON_TEXT,
|
|
35
|
-
o.BUTTON,
|
|
36
|
-
n
|
|
37
|
-
), A = e(
|
|
38
|
-
t.BUTTON_TEXT_SIZE,
|
|
39
|
-
o.BUTTON,
|
|
40
|
-
n
|
|
41
|
-
), S = r(
|
|
42
|
-
t.BUTTON_TEXT_STYLE_AND_FONT_COLOR,
|
|
43
|
-
o.BUTTON,
|
|
44
|
-
n
|
|
45
|
-
), E = T(
|
|
46
|
-
t.BUTTON_FIT_TO_CONTENT,
|
|
47
|
-
o.BUTTON,
|
|
48
|
-
n
|
|
49
|
-
), p = {
|
|
50
|
-
align: U,
|
|
51
|
-
border: d,
|
|
52
|
-
borderRadius: s,
|
|
53
|
-
color: _,
|
|
54
|
-
fontFamily: m,
|
|
55
|
-
margins: u,
|
|
56
|
-
paddings: R,
|
|
57
|
-
text: F,
|
|
58
|
-
textSize: A,
|
|
59
|
-
textStyleAndFontColor: S,
|
|
60
|
-
fitToContent: E
|
|
61
|
-
};
|
|
62
|
-
export {
|
|
63
|
-
p as ButtonControls
|
|
64
|
-
};
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { ModificationDescription as d } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
-
import { CommonControl as s } from "../../../common-control.js";
|
|
3
|
-
import { getCurrentLayout as l } from "../main/utils.js";
|
|
4
|
-
const u = "recommendation-card-background-color-control", e = {
|
|
5
|
-
CARD_BACKGROUND_COLOR: "cardBackgroundColor"
|
|
6
|
-
}, a = {
|
|
7
|
-
GRID: ".product-card-segment",
|
|
8
|
-
LIST: ".product-card-wrapper"
|
|
9
|
-
};
|
|
10
|
-
class _ extends s {
|
|
11
|
-
getId() {
|
|
12
|
-
return u;
|
|
13
|
-
}
|
|
14
|
-
getTemplate() {
|
|
15
|
-
return `
|
|
16
|
-
<div class="card-bg-control-container">
|
|
17
|
-
${this._GuTwoColumns([
|
|
18
|
-
this._GuLabel({ text: "Card Background Color" }),
|
|
19
|
-
this._GuColorPicker(e.CARD_BACKGROUND_COLOR)
|
|
20
|
-
])}
|
|
21
|
-
</div>
|
|
22
|
-
`;
|
|
23
|
-
}
|
|
24
|
-
onRender() {
|
|
25
|
-
this._setFormValues(), this._listenToFormUpdates();
|
|
26
|
-
}
|
|
27
|
-
onTemplateNodeUpdated(r) {
|
|
28
|
-
super.onTemplateNodeUpdated(r), this._setFormValues();
|
|
29
|
-
}
|
|
30
|
-
_setFormValues() {
|
|
31
|
-
const r = this._getCurrentCardBackgroundColor();
|
|
32
|
-
this.api.updateValues({
|
|
33
|
-
[e.CARD_BACKGROUND_COLOR]: r
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Gets the appropriate selector based on layout
|
|
38
|
-
* Grid: .product-card-segment (inner table per product cell)
|
|
39
|
-
* List: .product-card-wrapper (table per product row)
|
|
40
|
-
*/
|
|
41
|
-
_getCardSelector() {
|
|
42
|
-
return l(this.currentNode) === "grid" ? a.GRID : a.LIST;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Reads the current background color from the first product card element
|
|
46
|
-
* @returns The background color value or 'transparent' if not found
|
|
47
|
-
*/
|
|
48
|
-
_getCurrentCardBackgroundColor() {
|
|
49
|
-
if (!this.currentNode || !("querySelectorAll" in this.currentNode))
|
|
50
|
-
return "transparent";
|
|
51
|
-
const r = this._getCardSelector(), t = this.currentNode.querySelector(r);
|
|
52
|
-
return !t || !("getStyle" in t) ? "transparent" : t.getStyle("background-color") || "transparent";
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Handles card background color changes
|
|
56
|
-
* Applies the color to all product card elements based on layout
|
|
57
|
-
*/
|
|
58
|
-
_onCardBackgroundColorChange(r) {
|
|
59
|
-
if (!this.currentNode || !("querySelectorAll" in this.currentNode))
|
|
60
|
-
return;
|
|
61
|
-
const t = this._getCardSelector(), o = Array.from(
|
|
62
|
-
this.currentNode.querySelectorAll(t)
|
|
63
|
-
);
|
|
64
|
-
if (o.length === 0)
|
|
65
|
-
return;
|
|
66
|
-
const n = this.api.getDocumentModifier();
|
|
67
|
-
o.forEach((c) => {
|
|
68
|
-
n.modifyHtml(c).setStyle("background-color", r);
|
|
69
|
-
}), n.apply(new d("Update card background color"));
|
|
70
|
-
}
|
|
71
|
-
_listenToFormUpdates() {
|
|
72
|
-
this.api.onValueChanged(e.CARD_BACKGROUND_COLOR, (r) => {
|
|
73
|
-
this._onCardBackgroundColorChange(r);
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
export {
|
|
78
|
-
u as CARD_BACKGROUND_COLOR_CONTROL_ID,
|
|
79
|
-
_ as CardBackgroundColorControl
|
|
80
|
-
};
|