@useinsider/guido 2.1.0-beta.fd71a10 → 2.1.0-beta.ff1bc98
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/README.md +0 -36
- package/dist/@types/config/schemas.js +65 -70
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +58 -69
- package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +15 -14
- package/dist/composables/useBlocksConfig.js +16 -26
- package/dist/composables/useHtmlValidator.js +114 -104
- package/dist/composables/useRecommendation.js +54 -21
- package/dist/config/compiler/recommendationCompilerRules.js +45 -39
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +116 -0
- package/dist/config/migrator/recommendationMigrator.js +2 -2
- package/dist/enums/defaults.js +4 -8
- package/dist/enums/extensions/recommendationBlock.js +1 -1
- package/dist/enums/recommendation.js +16 -15
- package/dist/extensions/Blocks/Recommendation/block.js +133 -9
- package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +4 -0
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +4 -0
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +66 -0
- package/dist/extensions/Blocks/Recommendation/constants/layout.js +22 -0
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +21 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/index.js +64 -0
- package/dist/extensions/Blocks/Recommendation/controls/cardBackground/index.js +80 -0
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +232 -0
- package/dist/extensions/Blocks/Recommendation/controls/image/index.js +19 -0
- package/dist/extensions/Blocks/Recommendation/controls/layout/index.js +92 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +102 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/currency.js +209 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +52 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +250 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/locale.js +70 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +160 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/shuffle.js +67 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +307 -0
- package/dist/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.js +21 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/index.js +46 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +108 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/index.js +44 -0
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.js +48 -0
- package/dist/extensions/Blocks/Recommendation/controls/{omnibusDiscountTextAfterControl.js → omnibusDiscount/textAfter.js} +16 -14
- package/dist/extensions/Blocks/Recommendation/controls/{omnibusDiscountTextBeforeControl.js → omnibusDiscount/textBefore.js} +16 -14
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/index.js +48 -0
- package/dist/extensions/Blocks/Recommendation/controls/{omnibusPriceTextAfterControl.js → omnibusPrice/textAfter.js} +16 -14
- package/dist/extensions/Blocks/Recommendation/controls/{omnibusPriceTextBeforeControl.js → omnibusPrice/textBefore.js} +14 -12
- package/dist/extensions/Blocks/Recommendation/controls/price/index.js +44 -0
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +222 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +40 -17
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +19 -3
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +13 -4
- package/dist/extensions/Blocks/Recommendation/services/configService.js +240 -0
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +21 -10
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +254 -207
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +233 -0
- package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +251 -0
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +66 -0
- package/dist/extensions/Blocks/Recommendation/templates/index.js +12 -0
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +174 -0
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +73 -0
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +134 -0
- package/dist/extensions/Blocks/Recommendation/types/nodeConfig.js +6 -0
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +9 -9
- package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +26 -15
- package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +29 -0
- package/dist/extensions/Blocks/Recommendation/utils/tagName.js +46 -0
- package/dist/extensions/Blocks/controlFactories.js +125 -93
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +225 -237
- package/dist/services/recommendationApi.js +11 -8
- package/dist/services/templateLibraryApi.js +16 -13
- package/dist/src/@types/config/schemas.d.ts +0 -8
- package/dist/src/components/wrappers/WpDrawer.vue.d.ts +1 -1
- package/dist/src/composables/useConfig.d.ts +0 -4
- package/dist/src/composables/useRecommendation.d.ts +1 -0
- package/dist/src/config/compiler/utils/recommendationCompilerUtils.d.ts +17 -0
- package/dist/src/enums/defaults.d.ts +0 -4
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +67 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +13 -0
- package/dist/src/extensions/Blocks/Recommendation/{constants.d.ts → constants/controlIds.d.ts} +0 -24
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +49 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +13 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/layout.d.ts +41 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +35 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +143 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardBackground/index.d.ts +31 -0
- package/dist/src/extensions/Blocks/Recommendation/{cardCompositionControl.d.ts → controls/cardComposition/index.d.ts} +23 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/image/index.d.ts +35 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +21 -589
- package/dist/src/extensions/Blocks/Recommendation/controls/layout/index.d.ts +37 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/algorithm.d.ts +29 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/currency.d.ts +52 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/filters.d.ts +22 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +79 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/locale.d.ts +24 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +60 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/shuffle.d.ts +23 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +221 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.d.ts +29 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/index.d.ts +97 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/textTrim.d.ts +34 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/index.d.ts +95 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.d.ts +100 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/index.d.ts +100 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/index.d.ts +95 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +83 -0
- package/dist/src/extensions/Blocks/Recommendation/extension.d.ts +9 -0
- package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +151 -0
- package/dist/src/extensions/Blocks/Recommendation/services/index.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +138 -468
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +20 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/{migrationTemplate.d.ts → grid/migration.d.ts} +11 -4
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +33 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +41 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/list/elementRenderer.d.ts +8 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/list/migration.d.ts +25 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +18 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +66 -0
- package/dist/src/extensions/Blocks/Recommendation/types/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +166 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/priceFormatter.d.ts +33 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/stylePreserver.d.ts +113 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +77 -0
- package/dist/src/stores/config.d.ts +0 -36
- package/dist/static/styles/customEditorStyle.css.js +35 -11
- package/dist/utils/pairProductVariables.js +57 -56
- package/dist/utils/templatePreparation.js +15 -14
- package/package.json +1 -1
- package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +0 -187
- package/dist/extensions/Blocks/Recommendation/constants.js +0 -13
- package/dist/extensions/Blocks/Recommendation/control.js +0 -336
- package/dist/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.js +0 -68
- package/dist/extensions/Blocks/Recommendation/controls/index.js +0 -245
- package/dist/extensions/Blocks/Recommendation/controls/nameTextTrimControl.js +0 -74
- package/dist/extensions/Blocks/Recommendation/controls/spacingControl.js +0 -188
- package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +0 -181
- package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +0 -189
- package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +0 -209
- package/dist/extensions/ModulesTabIcons/extension.js +0 -17
- package/dist/src/extensions/Blocks/Recommendation/control.d.ts +0 -38
- package/dist/src/extensions/Blocks/Recommendation/controls/nameTextTrimControl.d.ts +0 -16
- package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +0 -16
- package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +0 -52
- package/dist/src/extensions/ModulesTabIcons/extension.d.ts +0 -2
|
@@ -46,8 +46,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
46
46
|
senderName: string;
|
|
47
47
|
subject: string;
|
|
48
48
|
};
|
|
49
|
-
savedModulesFolderName: string;
|
|
50
|
-
defaultModulesFolderName: string;
|
|
51
49
|
};
|
|
52
50
|
ui: {
|
|
53
51
|
showHeader: boolean;
|
|
@@ -143,8 +141,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
143
141
|
senderName: string;
|
|
144
142
|
subject: string;
|
|
145
143
|
};
|
|
146
|
-
savedModulesFolderName: string;
|
|
147
|
-
defaultModulesFolderName: string;
|
|
148
144
|
};
|
|
149
145
|
ui: {
|
|
150
146
|
showHeader: boolean;
|
|
@@ -240,8 +236,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
240
236
|
senderName: string;
|
|
241
237
|
subject: string;
|
|
242
238
|
};
|
|
243
|
-
savedModulesFolderName: string;
|
|
244
|
-
defaultModulesFolderName: string;
|
|
245
239
|
};
|
|
246
240
|
ui: {
|
|
247
241
|
showHeader: boolean;
|
|
@@ -337,8 +331,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
337
331
|
senderName: string;
|
|
338
332
|
subject: string;
|
|
339
333
|
};
|
|
340
|
-
savedModulesFolderName: string;
|
|
341
|
-
defaultModulesFolderName: string;
|
|
342
334
|
};
|
|
343
335
|
ui: {
|
|
344
336
|
showHeader: boolean;
|
|
@@ -434,8 +426,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
434
426
|
senderName: string;
|
|
435
427
|
subject: string;
|
|
436
428
|
};
|
|
437
|
-
savedModulesFolderName: string;
|
|
438
|
-
defaultModulesFolderName: string;
|
|
439
429
|
};
|
|
440
430
|
ui: {
|
|
441
431
|
showHeader: boolean;
|
|
@@ -531,8 +521,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
531
521
|
senderName: string;
|
|
532
522
|
subject: string;
|
|
533
523
|
};
|
|
534
|
-
savedModulesFolderName: string;
|
|
535
|
-
defaultModulesFolderName: string;
|
|
536
524
|
};
|
|
537
525
|
ui: {
|
|
538
526
|
showHeader: boolean;
|
|
@@ -628,8 +616,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
628
616
|
senderName: string;
|
|
629
617
|
subject: string;
|
|
630
618
|
};
|
|
631
|
-
savedModulesFolderName: string;
|
|
632
|
-
defaultModulesFolderName: string;
|
|
633
619
|
};
|
|
634
620
|
ui: {
|
|
635
621
|
showHeader: boolean;
|
|
@@ -725,8 +711,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
725
711
|
senderName: string;
|
|
726
712
|
subject: string;
|
|
727
713
|
};
|
|
728
|
-
savedModulesFolderName: string;
|
|
729
|
-
defaultModulesFolderName: string;
|
|
730
714
|
};
|
|
731
715
|
ui: {
|
|
732
716
|
showHeader: boolean;
|
|
@@ -822,8 +806,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
822
806
|
senderName: string;
|
|
823
807
|
subject: string;
|
|
824
808
|
};
|
|
825
|
-
savedModulesFolderName: string;
|
|
826
|
-
defaultModulesFolderName: string;
|
|
827
809
|
};
|
|
828
810
|
ui: {
|
|
829
811
|
showHeader: boolean;
|
|
@@ -919,8 +901,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
919
901
|
senderName: string;
|
|
920
902
|
subject: string;
|
|
921
903
|
};
|
|
922
|
-
savedModulesFolderName: string;
|
|
923
|
-
defaultModulesFolderName: string;
|
|
924
904
|
};
|
|
925
905
|
ui: {
|
|
926
906
|
showHeader: boolean;
|
|
@@ -1016,8 +996,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1016
996
|
senderName: string;
|
|
1017
997
|
subject: string;
|
|
1018
998
|
};
|
|
1019
|
-
savedModulesFolderName: string;
|
|
1020
|
-
defaultModulesFolderName: string;
|
|
1021
999
|
};
|
|
1022
1000
|
ui: {
|
|
1023
1001
|
showHeader: boolean;
|
|
@@ -1113,8 +1091,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1113
1091
|
senderName: string;
|
|
1114
1092
|
subject: string;
|
|
1115
1093
|
};
|
|
1116
|
-
savedModulesFolderName: string;
|
|
1117
|
-
defaultModulesFolderName: string;
|
|
1118
1094
|
};
|
|
1119
1095
|
ui: {
|
|
1120
1096
|
showHeader: boolean;
|
|
@@ -1210,8 +1186,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1210
1186
|
senderName: string;
|
|
1211
1187
|
subject: string;
|
|
1212
1188
|
};
|
|
1213
|
-
savedModulesFolderName: string;
|
|
1214
|
-
defaultModulesFolderName: string;
|
|
1215
1189
|
};
|
|
1216
1190
|
ui: {
|
|
1217
1191
|
showHeader: boolean;
|
|
@@ -1307,8 +1281,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1307
1281
|
senderName: string;
|
|
1308
1282
|
subject: string;
|
|
1309
1283
|
};
|
|
1310
|
-
savedModulesFolderName: string;
|
|
1311
|
-
defaultModulesFolderName: string;
|
|
1312
1284
|
};
|
|
1313
1285
|
ui: {
|
|
1314
1286
|
showHeader: boolean;
|
|
@@ -1404,8 +1376,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1404
1376
|
senderName: string;
|
|
1405
1377
|
subject: string;
|
|
1406
1378
|
};
|
|
1407
|
-
savedModulesFolderName: string;
|
|
1408
|
-
defaultModulesFolderName: string;
|
|
1409
1379
|
};
|
|
1410
1380
|
ui: {
|
|
1411
1381
|
showHeader: boolean;
|
|
@@ -1501,8 +1471,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1501
1471
|
senderName: string;
|
|
1502
1472
|
subject: string;
|
|
1503
1473
|
};
|
|
1504
|
-
savedModulesFolderName: string;
|
|
1505
|
-
defaultModulesFolderName: string;
|
|
1506
1474
|
};
|
|
1507
1475
|
ui: {
|
|
1508
1476
|
showHeader: boolean;
|
|
@@ -1598,8 +1566,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1598
1566
|
senderName: string;
|
|
1599
1567
|
subject: string;
|
|
1600
1568
|
};
|
|
1601
|
-
savedModulesFolderName: string;
|
|
1602
|
-
defaultModulesFolderName: string;
|
|
1603
1569
|
};
|
|
1604
1570
|
ui: {
|
|
1605
1571
|
showHeader: boolean;
|
|
@@ -1695,8 +1661,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1695
1661
|
senderName: string;
|
|
1696
1662
|
subject: string;
|
|
1697
1663
|
};
|
|
1698
|
-
savedModulesFolderName: string;
|
|
1699
|
-
defaultModulesFolderName: string;
|
|
1700
1664
|
};
|
|
1701
1665
|
ui: {
|
|
1702
1666
|
showHeader: boolean;
|
|
@@ -19,22 +19,46 @@ 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-
|
|
22
|
+
/* Horizontal layout - hide for info, image, and button cells */
|
|
23
|
+
.ins-recommendation-v3-block-v2 .product-info-cell ue-node-actions,
|
|
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 {
|
|
24
47
|
display: none !important;
|
|
25
48
|
}
|
|
26
49
|
|
|
27
|
-
/*
|
|
28
|
-
.
|
|
29
|
-
|
|
50
|
+
/* Mobile layout: hide mobile container by default in editor */
|
|
51
|
+
.ins-recommendation-mobile-container {
|
|
52
|
+
display: none;
|
|
30
53
|
}
|
|
31
54
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
55
|
+
/* Mobile layout: when Stripo mobile mode is active, swap containers */
|
|
56
|
+
.ue-mobile-mode .ins-recommendation-desktop-container {
|
|
57
|
+
display: none !important;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.ue-mobile-mode .ins-recommendation-mobile-container {
|
|
61
|
+
display: table !important;
|
|
38
62
|
}
|
|
39
63
|
`;
|
|
40
64
|
export {
|
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
import { productPairs as
|
|
2
|
-
function
|
|
3
|
-
const
|
|
4
|
-
Object.entries(
|
|
5
|
-
$.querySelectorAll(".ins-product-td").forEach((
|
|
6
|
-
const E =
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
const
|
|
1
|
+
import { productPairs as P } from "../extensions/Blocks/Items/enums/productEnums.js";
|
|
2
|
+
function L(F) {
|
|
3
|
+
const R = F.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), $ = new DOMParser().parseFromString(R, "text/html"), y = P.PAIRS_FOR_EXTENSION;
|
|
4
|
+
Object.entries(y).forEach(([n, l]) => {
|
|
5
|
+
$.querySelectorAll(".ins-product-td").forEach((c) => {
|
|
6
|
+
const E = c.getAttribute("data-number") || "1", T = c.getAttribute("data-type") || "CART_ITEMS";
|
|
7
|
+
c.querySelectorAll(`[product-attr="${n}"]`).forEach((e) => {
|
|
8
|
+
var H;
|
|
9
|
+
const b = e.getAttribute("data-type") || T, u = e.getAttribute("data-number") || E, p = l[b];
|
|
10
10
|
if (p)
|
|
11
11
|
switch (n) {
|
|
12
12
|
case "imageSrc": {
|
|
13
|
-
let t = null,
|
|
14
|
-
if (e.tagName === "IMG" ? (t = e,
|
|
13
|
+
let t = null, o = null;
|
|
14
|
+
if (e.tagName === "IMG" ? (t = e, o = t.closest("a")) : (t = e.querySelector("img"), o = e.querySelector("a") || e.closest("a")), !t)
|
|
15
15
|
break;
|
|
16
16
|
const i = p.DEFAULT, a = p.ATTR;
|
|
17
17
|
if (i && t.src) {
|
|
18
18
|
const r = t.src;
|
|
19
|
-
i.some((
|
|
20
|
-
const s =
|
|
21
|
-
return r.includes(
|
|
19
|
+
i.some((f) => {
|
|
20
|
+
const s = f.split("/").pop() || "", _ = r.split("/").pop() || "";
|
|
21
|
+
return r.includes(f) || r.includes(s) || _ === s;
|
|
22
22
|
}) && (t.src = `{{${a}_${u}}}`);
|
|
23
23
|
}
|
|
24
|
-
if (
|
|
25
|
-
const r = (
|
|
24
|
+
if (o) {
|
|
25
|
+
const r = (H = y.itemLink) == null ? void 0 : H[b];
|
|
26
26
|
if (r) {
|
|
27
|
-
const
|
|
28
|
-
(s === "#" || s === "" || s.endsWith("#!") || s.endsWith(
|
|
27
|
+
const d = r.HREF, f = r.DEFAULT_HREF || "#!", s = o.href;
|
|
28
|
+
(s === "#" || s === "" || s.endsWith("#!") || s.endsWith(f) || s === `${window.location.href}${f}` || !s || s === window.location.href) && (o.href = `{{${d}_${u}}}`);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
break;
|
|
32
32
|
}
|
|
33
33
|
case "name": {
|
|
34
|
-
const t = p,
|
|
35
|
-
e.textContent && (e.textContent = `{{${
|
|
34
|
+
const t = p, o = t.ATTR, i = t.DEFAULT_HREF || "#!", a = t.HREF;
|
|
35
|
+
e.textContent && (e.textContent = `{{${o}_${u}}}`);
|
|
36
36
|
const r = e.closest("a") || (e.tagName === "A" ? e : null);
|
|
37
37
|
if (r && a) {
|
|
38
|
-
const
|
|
39
|
-
(
|
|
38
|
+
const d = r.href, f = `${window.location.href}${i}`;
|
|
39
|
+
(d === f || d.endsWith(i)) && (r.href = `{{${a}_${u}}}`);
|
|
40
40
|
}
|
|
41
41
|
break;
|
|
42
42
|
}
|
|
43
43
|
case "price":
|
|
44
44
|
case "originalPrice": {
|
|
45
|
-
const t = p,
|
|
46
|
-
let
|
|
47
|
-
r ?
|
|
45
|
+
const t = p, o = e.getAttribute("data-formated"), i = e.getAttribute("data-single_price"), a = o === "true", r = i === "true", d = e.getAttribute("data-curency") || "before";
|
|
46
|
+
let f;
|
|
47
|
+
r ? f = a ? t.SINGLE_PRICE_FORMATTED : t.SINGLE_PRICE : f = a ? t.PRICE_FORMATTED : t.PRICE;
|
|
48
48
|
const s = t.CURRENCY;
|
|
49
|
-
let _ = `{{${
|
|
49
|
+
let _ = `{{${f}_${u}}}`;
|
|
50
50
|
if (s) {
|
|
51
|
-
const
|
|
52
|
-
_ =
|
|
51
|
+
const k = `{{${s}_${u}}}`;
|
|
52
|
+
_ = d === "after" ? `${_} ${k}` : `${k} ${_}`;
|
|
53
53
|
}
|
|
54
54
|
e.textContent = _;
|
|
55
55
|
break;
|
|
56
56
|
}
|
|
57
57
|
case "quantity": {
|
|
58
|
-
const t = p,
|
|
59
|
-
e.textContent && e.textContent.trim() === i && (e.textContent = `{{${
|
|
58
|
+
const t = p, o = t.ATTR, i = t.DEFAULT;
|
|
59
|
+
e.textContent && e.textContent.trim() === i && (e.textContent = `{{${o}_${u}}}`);
|
|
60
60
|
break;
|
|
61
61
|
}
|
|
62
62
|
case "button": {
|
|
63
|
-
const t = p,
|
|
63
|
+
const t = p, o = t.HREF, i = t.DEFAULT_HREF || "#!", a = e.tagName === "A" ? e : e.querySelector("a");
|
|
64
64
|
if (a) {
|
|
65
|
-
const r = a.href || "",
|
|
66
|
-
(r === "" || r === "#" || r ===
|
|
65
|
+
const r = a.href || "", d = `${window.location.href}${i}`;
|
|
66
|
+
(r === "" || r === "#" || r === d || r.endsWith(i) || r.endsWith("#!") || r === window.location.href) && (a.href = `{{${o}_${u}}}`);
|
|
67
67
|
}
|
|
68
68
|
break;
|
|
69
69
|
}
|
|
70
70
|
case "itemLink": {
|
|
71
|
-
const t = p,
|
|
71
|
+
const t = p, o = t.HREF, i = t.DEFAULT_HREF || "#!", a = e;
|
|
72
72
|
if (a.href) {
|
|
73
|
-
const r = a.href,
|
|
74
|
-
(r ===
|
|
73
|
+
const r = a.href, d = `${window.location.href}${i}`;
|
|
74
|
+
(r === d || r.endsWith(i)) && (a.href = `{{${o}_${u}}}`);
|
|
75
75
|
}
|
|
76
76
|
break;
|
|
77
77
|
}
|
|
@@ -86,44 +86,45 @@ function P(k) {
|
|
|
86
86
|
});
|
|
87
87
|
});
|
|
88
88
|
});
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
const S = R.match(/<!DOCTYPE[^>]*>/i), I = S ? `${S[0]}
|
|
90
|
+
` : "", w = $.querySelectorAll(".ins-product-td"), m = [];
|
|
91
|
+
w.forEach((n) => {
|
|
92
|
+
const l = n.getAttribute("data-type") || "CART_ITEMS", A = n.getAttribute("data-number") || "1", c = n.getAttribute("data-nodup"), E = n.outerHTML;
|
|
93
|
+
m.push({
|
|
93
94
|
element: n,
|
|
94
95
|
outerHtml: E,
|
|
95
96
|
type: l,
|
|
96
97
|
number: A,
|
|
97
|
-
nodup:
|
|
98
|
+
nodup: c || void 0
|
|
98
99
|
});
|
|
99
100
|
});
|
|
100
|
-
let h = $.
|
|
101
|
-
|
|
102
|
-
let
|
|
101
|
+
let h = I + $.documentElement.outerHTML;
|
|
102
|
+
m.reverse().forEach(({ outerHtml: n, type: l, number: A }) => {
|
|
103
|
+
let c = "";
|
|
103
104
|
switch (l) {
|
|
104
105
|
case "CART_ITEMS":
|
|
105
|
-
|
|
106
|
+
c = "ins_apr_total_product_kind";
|
|
106
107
|
break;
|
|
107
108
|
case "BROWSED_ITEMS":
|
|
108
|
-
|
|
109
|
+
c = "browsed_item_total_product_kind";
|
|
109
110
|
break;
|
|
110
111
|
case "PURCHASED_ITEMS":
|
|
111
|
-
|
|
112
|
+
c = "purchased_item_total_product_kind";
|
|
112
113
|
break;
|
|
113
114
|
}
|
|
114
|
-
if (
|
|
115
|
-
const
|
|
116
|
-
h = h.replace(n,
|
|
115
|
+
if (c) {
|
|
116
|
+
const T = parseInt(A) - 1, b = `${`{% if ${c} > ${T} %}`}${n}{% endif %}`;
|
|
117
|
+
h = h.replace(n, b);
|
|
117
118
|
}
|
|
118
119
|
});
|
|
119
|
-
const
|
|
120
|
-
return
|
|
120
|
+
const M = $.querySelectorAll('[product-attr="originalPrice"][data-type="CART_ITEMS"]'), g = [];
|
|
121
|
+
return M.forEach((n) => {
|
|
121
122
|
const l = n.getAttribute("data-number"), A = n.getAttribute("data-type");
|
|
122
123
|
if (!l || A !== "CART_ITEMS")
|
|
123
124
|
return;
|
|
124
|
-
const
|
|
125
|
-
if (
|
|
126
|
-
const E =
|
|
125
|
+
const c = n.closest(".product-original-price-class");
|
|
126
|
+
if (c) {
|
|
127
|
+
const E = c.outerHTML;
|
|
127
128
|
g.some((C) => C.tdOuterHtml === E) || g.push({ tdOuterHtml: E, number: l });
|
|
128
129
|
}
|
|
129
130
|
}), g.reverse().forEach(({ tdOuterHtml: n, number: l }) => {
|
|
@@ -135,5 +136,5 @@ function P(k) {
|
|
|
135
136
|
}), h.replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}");
|
|
136
137
|
}
|
|
137
138
|
export {
|
|
138
|
-
|
|
139
|
+
L as pairProductVariables
|
|
139
140
|
};
|
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useHtmlCompiler as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { useActionsApi as f } from "../composables/useActionsApi.js";
|
|
2
|
+
import { useHtmlCompiler as C } from "../composables/useHtmlCompiler.js";
|
|
3
|
+
import { useRecommendationExtensionStore as T } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
4
|
+
import { useDynamicContentStore as x } from "../stores/dynamic-content.js";
|
|
5
|
+
import { useUnsubscribeStore as y } from "../stores/unsubscribe.js";
|
|
6
|
+
const E = () => {
|
|
7
|
+
const o = x(), t = y(), { getCompiledEmail: i, getTemplateData: n, editorSave: s } = f(), { compileHtml: m } = C();
|
|
7
8
|
return {
|
|
8
9
|
prepareTemplateDetails: async () => {
|
|
9
|
-
const { html:
|
|
10
|
+
const { html: a, ampHtml: r = "", ampErrors: c = [] } = await i({
|
|
10
11
|
minimize: !0,
|
|
11
12
|
resetDataSavedFlag: !1
|
|
12
|
-
}), { html: l, css: p, syncModulesIds: u = [] } = await
|
|
13
|
-
return
|
|
13
|
+
}), { html: l, css: p, syncModulesIds: u = [] } = await n(), { compiledHtml: d, stats: e, appliedRules: S } = m(a), g = o.getSelectedDynamicContentList, b = T();
|
|
14
|
+
return s(), console.debug("HTML Compilation Stats:", {
|
|
14
15
|
originalSize: e.originalSize,
|
|
15
16
|
compiledSize: e.compiledSize,
|
|
16
17
|
reduction: `${e.reductionPercentage.toFixed(2)}%`,
|
|
17
|
-
appliedRules:
|
|
18
|
+
appliedRules: S,
|
|
18
19
|
executionTime: `${e.executionTime.toFixed(2)}ms`
|
|
19
20
|
}), {
|
|
20
|
-
dynamicContentList:
|
|
21
|
+
dynamicContentList: g,
|
|
21
22
|
compiledHtml: d,
|
|
22
23
|
rawHtml: l,
|
|
23
24
|
css: p,
|
|
24
|
-
ampHtml:
|
|
25
|
+
ampHtml: r,
|
|
25
26
|
ampErrors: c,
|
|
26
27
|
modules: u,
|
|
27
28
|
recommendation: {
|
|
28
|
-
campaignUrls:
|
|
29
|
+
campaignUrls: b.recommendationCampaignUrls,
|
|
29
30
|
configs: {}
|
|
30
31
|
},
|
|
31
32
|
unsubscribe: {
|
|
@@ -37,5 +38,5 @@ const P = () => {
|
|
|
37
38
|
};
|
|
38
39
|
};
|
|
39
40
|
export {
|
|
40
|
-
|
|
41
|
+
E as useTemplatePreparation
|
|
41
42
|
};
|
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.ff1bc98",
|
|
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,187 +0,0 @@
|
|
|
1
|
-
import { ModificationDescription as n } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
-
import { CommonControl as _ } from "../common-control.js";
|
|
3
|
-
import { ATTR_PRODUCT_IMAGE as m, ATTR_PRODUCT_NAME as y, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_OLD_PRICE as h, ATTR_PRODUCT_OMNIBUS_PRICE as C, ATTR_PRODUCT_OMNIBUS_DISCOUNT as f, ATTR_PRODUCT_BUTTON as g } from "./constants.js";
|
|
4
|
-
const R = "ui-elements-recommendation-card-composition", l = ".recommendation-attribute-row", A = "tr.recommendation-product-row", c = "data-card-composition", a = "data-attribute-type", d = "data-visibility", s = [
|
|
5
|
-
{ key: m, label: "Product Image", visible: !0 },
|
|
6
|
-
{ key: y, label: "Product Name", visible: !0 },
|
|
7
|
-
{ key: T, label: "Product Price", visible: !0 },
|
|
8
|
-
{ key: h, label: "Product Original Price", visible: !0 },
|
|
9
|
-
{ key: C, label: "Omnibus Price", visible: !1 },
|
|
10
|
-
{ key: f, label: "Omnibus Discount", visible: !1 },
|
|
11
|
-
{ key: g, label: "Product Button", visible: !0 }
|
|
12
|
-
];
|
|
13
|
-
class N extends _ {
|
|
14
|
-
getId() {
|
|
15
|
-
return R;
|
|
16
|
-
}
|
|
17
|
-
getTemplate() {
|
|
18
|
-
const t = s.map((i) => ({
|
|
19
|
-
key: i.key,
|
|
20
|
-
label: i.label,
|
|
21
|
-
content: this._createItemContent(i.label, i.key)
|
|
22
|
-
}));
|
|
23
|
-
return `
|
|
24
|
-
<div class="container">
|
|
25
|
-
${this._GuLabel({ text: "Card Element Order & Visibility" })}
|
|
26
|
-
${this._GuOrderable("cardComposition", t)}
|
|
27
|
-
</div>
|
|
28
|
-
`;
|
|
29
|
-
}
|
|
30
|
-
onRender() {
|
|
31
|
-
this._initializeComposition(), this._registerValueChangeListeners();
|
|
32
|
-
}
|
|
33
|
-
onTemplateNodeUpdated(t) {
|
|
34
|
-
super.onTemplateNodeUpdated(t), this._initializeComposition();
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Creates the HTML content for an orderable item with label and toggle
|
|
38
|
-
*/
|
|
39
|
-
_createItemContent(t, i) {
|
|
40
|
-
return `
|
|
41
|
-
<div style="display: flex; align-items: center; justify-content: space-between;
|
|
42
|
-
padding: 8px; gap: 8px;">
|
|
43
|
-
<span style="flex: 1;">${t}</span>
|
|
44
|
-
${this._GuToggle(`visibility_${i}`)}
|
|
45
|
-
</div>
|
|
46
|
-
`;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Registers event listeners for composition and visibility changes
|
|
50
|
-
*/
|
|
51
|
-
_registerValueChangeListeners() {
|
|
52
|
-
this.api.onValueChanged("cardComposition", (t) => {
|
|
53
|
-
this._applyCompositionToBlock(t);
|
|
54
|
-
}), s.forEach((t) => {
|
|
55
|
-
this.api.onValueChanged(`visibility_${t.key}`, (i) => {
|
|
56
|
-
this._applyVisibilityToBlock(t.key, i);
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Initializes composition order and visibility state from the current node
|
|
62
|
-
*/
|
|
63
|
-
_initializeComposition() {
|
|
64
|
-
const t = this._readCompositionFromNode(), i = this._readVisibilityFromRows(), e = {
|
|
65
|
-
cardComposition: t,
|
|
66
|
-
...this._buildVisibilityValues(i)
|
|
67
|
-
};
|
|
68
|
-
this.api.updateValues(e);
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Reads composition order from node's data-card-composition attribute
|
|
72
|
-
* Falls back to default order if attribute is not present
|
|
73
|
-
*/
|
|
74
|
-
_readCompositionFromNode() {
|
|
75
|
-
if (!this.currentNode || !("getAttribute" in this.currentNode))
|
|
76
|
-
return s.map((i) => i.key);
|
|
77
|
-
const t = this.currentNode.getAttribute(c);
|
|
78
|
-
return t ? t.split(",").filter(Boolean) : s.map((i) => i.key);
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Builds visibility values object from the visibility map
|
|
82
|
-
*/
|
|
83
|
-
_buildVisibilityValues(t) {
|
|
84
|
-
return s.reduce((i, e) => (i[`visibility_${e.key}`] = t[e.key] ?? !0, i), {});
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Read visibility state from individual row elements' data-visibility attributes
|
|
88
|
-
* This ensures toggles reflect the actual DOM state
|
|
89
|
-
*/
|
|
90
|
-
_readVisibilityFromRows() {
|
|
91
|
-
if (!this.currentNode)
|
|
92
|
-
return this._getDefaultVisibilities();
|
|
93
|
-
const t = Array.from(this.currentNode.querySelectorAll(l));
|
|
94
|
-
console.debug("_readVisibilityFromRows - found attribute rows:", t.length);
|
|
95
|
-
const i = this._extractVisibilityFromRows(t);
|
|
96
|
-
return this._mergeWithDefaults(i);
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Returns default visibility values for all items
|
|
100
|
-
*/
|
|
101
|
-
_getDefaultVisibilities() {
|
|
102
|
-
return s.reduce((t, i) => (t[i.key] = i.visible, t), {});
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Extracts visibility values from DOM nodes
|
|
106
|
-
*/
|
|
107
|
-
_extractVisibilityFromRows(t) {
|
|
108
|
-
const i = {};
|
|
109
|
-
return t.forEach((e) => {
|
|
110
|
-
if (!("getAttribute" in e))
|
|
111
|
-
return;
|
|
112
|
-
const o = e.getAttribute(a), r = e.getAttribute(d);
|
|
113
|
-
o && r !== null && (i[o] = this._parseVisibilityValue(r), console.debug(
|
|
114
|
-
`_readVisibilityFromRows - ${o}: ${i[o]} (raw: ${r})`
|
|
115
|
-
));
|
|
116
|
-
}), i;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Parses visibility value from string to boolean
|
|
120
|
-
* Accepts "1", "true" as true, everything else as false
|
|
121
|
-
*/
|
|
122
|
-
_parseVisibilityValue(t) {
|
|
123
|
-
return t === "1" || t === "true";
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Merges extracted visibilities with default values for missing keys
|
|
127
|
-
*/
|
|
128
|
-
_mergeWithDefaults(t) {
|
|
129
|
-
return s.forEach((i) => {
|
|
130
|
-
i.key in t || (t[i.key] = i.visible, console.debug(`_readVisibilityFromRows - ${i.key}: using default ${i.visible}`));
|
|
131
|
-
}), t;
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Apply the reordered composition to the block's HTML structure
|
|
135
|
-
* Updates the data-card-composition attribute and reorders product attributes
|
|
136
|
-
*/
|
|
137
|
-
_applyCompositionToBlock(t) {
|
|
138
|
-
if (console.debug("_applyCompositionToBlock - composition:", t), !this.currentNode) {
|
|
139
|
-
console.debug("_applyCompositionToBlock - no current node");
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute(c, t.join(",")).apply(new n("Update card composition")), this._reorderProductAttributes(t);
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Reorders attribute rows within each product row based on composition order
|
|
146
|
-
*/
|
|
147
|
-
_reorderProductAttributes(t) {
|
|
148
|
-
if (!this.currentNode)
|
|
149
|
-
return;
|
|
150
|
-
const i = this.currentNode.querySelectorAll(A);
|
|
151
|
-
if (!(i != null && i.length))
|
|
152
|
-
return;
|
|
153
|
-
const e = this.api.getDocumentModifier();
|
|
154
|
-
i.forEach((o) => {
|
|
155
|
-
const r = this._buildCompositionHtml(o, t);
|
|
156
|
-
e.modifyHtml(o).setInnerHtml(r);
|
|
157
|
-
}), e.apply(new n("Reorder product attributes"));
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* Builds HTML string with attributes ordered according to composition
|
|
161
|
-
*/
|
|
162
|
-
_buildCompositionHtml(t, i) {
|
|
163
|
-
return i.reduce((e, o) => {
|
|
164
|
-
const r = t.querySelector(`${l}[${a}="${o}"]`);
|
|
165
|
-
return r && "getOuterHTML" in r ? e + r.getOuterHTML() : e;
|
|
166
|
-
}, "");
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Apply visibility changes to the block's HTML structure
|
|
170
|
-
* Updates display style and data-visibility attribute for all matching rows
|
|
171
|
-
*/
|
|
172
|
-
_applyVisibilityToBlock(t, i) {
|
|
173
|
-
if (console.debug("_applyVisibilityToBlock", t, i), !this.currentNode)
|
|
174
|
-
return;
|
|
175
|
-
const e = this.currentNode.querySelectorAll(`${l}[${a}="${t}"]`);
|
|
176
|
-
if (!(e != null && e.length))
|
|
177
|
-
return;
|
|
178
|
-
const o = i ? "table-row" : "none", r = i ? "1" : "0", p = `Set ${t} visibility to ${i ? "visible" : "hidden"}`, u = this.api.getDocumentModifier();
|
|
179
|
-
e.forEach((b) => {
|
|
180
|
-
u.modifyHtml(b).setStyle("display", o).setAttribute(d, r);
|
|
181
|
-
}), u.apply(new n(p));
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
export {
|
|
185
|
-
R as COMPOSITION_CONTROL_BLOCK_ID,
|
|
186
|
-
N as RecommendationCardCompositionControl
|
|
187
|
-
};
|