@useinsider/guido 2.1.0-beta.9ba2e9d → 2.1.0-beta.aa05b06
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 +36 -0
- package/dist/@types/config/schemas.js +70 -65
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +69 -58
- package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +14 -15
- package/dist/components/organisms/header/HeaderWrapper.vue.js +9 -9
- package/dist/composables/useBlocksConfig.js +29 -20
- package/dist/composables/useHtmlValidator.js +84 -106
- package/dist/composables/useRecommendation.js +21 -54
- package/dist/config/compiler/recommendationCompilerRules.js +39 -45
- package/dist/config/migrator/recommendationMigrator.js +2 -2
- package/dist/enums/defaults.js +8 -4
- package/dist/enums/recommendation.js +15 -16
- package/dist/extensions/Blocks/Recommendation/block.js +9 -130
- 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 +193 -230
- 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 +15 -26
- package/dist/extensions/Blocks/controlFactories.js +93 -125
- package/dist/extensions/ModulesTabIcons/extension.js +17 -0
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +238 -224
- package/dist/services/recommendationApi.js +9 -10
- package/dist/services/templateLibraryApi.js +13 -16
- package/dist/src/@types/config/schemas.d.ts +8 -0
- package/dist/src/components/wrappers/WpDrawer.vue.d.ts +1 -1
- package/dist/src/composables/useConfig.d.ts +4 -0
- package/dist/src/composables/useRecommendation.d.ts +0 -1
- package/dist/src/enums/defaults.d.ts +4 -0
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -67
- 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/controls/nameTextTrimControl.d.ts +16 -0
- package/dist/src/extensions/Blocks/Recommendation/extension.d.ts +0 -9
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +468 -131
- 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/ModulesTabIcons/extension.d.ts +2 -0
- package/dist/src/stores/config.d.ts +36 -0
- package/dist/static/styles/customEditorStyle.css.js +2 -25
- package/dist/utils/pairProductVariables.js +56 -57
- package/dist/utils/templatePreparation.js +14 -15
- package/package.json +1 -1
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +0 -147
- 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 -65
- 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 -92
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +0 -102
- package/dist/extensions/Blocks/Recommendation/controls/main/currency.js +0 -209
- package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +0 -52
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +0 -217
- package/dist/extensions/Blocks/Recommendation/controls/main/locale.js +0 -70
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +0 -110
- package/dist/extensions/Blocks/Recommendation/controls/main/shuffle.js +0 -67
- 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 -108
- 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 -240
- 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 -122
- 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/config/compiler/utils/recommendationCompilerUtils.d.ts +0 -17
- 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 -52
- 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 -68
- 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 -34
- 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 -57
- package/dist/src/extensions/Blocks/Recommendation/types/index.d.ts +0 -7
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +0 -160
- 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,100 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Omnibus Price Element Controls
|
|
3
|
-
*
|
|
4
|
-
* Controls for styling the omnibus price element in recommendation cards.
|
|
5
|
-
* Includes text before/after controls for compliance text.
|
|
6
|
-
*/
|
|
7
|
-
import { OmnibusPriceTextAfterControl } from './textAfter';
|
|
8
|
-
import { OmnibusPriceTextBeforeControl } from './textBefore';
|
|
9
|
-
/**
|
|
10
|
-
* Grouped Omnibus Price Controls
|
|
11
|
-
* Use this object for cleaner imports in extension.ts
|
|
12
|
-
*/
|
|
13
|
-
export declare const OmnibusPriceControls: {
|
|
14
|
-
readonly align: {
|
|
15
|
-
new (): {
|
|
16
|
-
getId(): string;
|
|
17
|
-
getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
|
|
18
|
-
getParentControlId(): string;
|
|
19
|
-
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
20
|
-
getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
|
|
21
|
-
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
22
|
-
getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
23
|
-
isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
readonly color: {
|
|
27
|
-
new (): {
|
|
28
|
-
getId(): string;
|
|
29
|
-
getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
|
|
30
|
-
getParentControlId(): string;
|
|
31
|
-
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
32
|
-
getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
|
|
33
|
-
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
34
|
-
getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
35
|
-
isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
readonly size: {
|
|
39
|
-
new (): {
|
|
40
|
-
getId(): string;
|
|
41
|
-
getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
|
|
42
|
-
getParentControlId(): string;
|
|
43
|
-
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
44
|
-
getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
|
|
45
|
-
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
46
|
-
getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
47
|
-
isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
readonly style: {
|
|
51
|
-
new (): {
|
|
52
|
-
getId(): string;
|
|
53
|
-
getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
|
|
54
|
-
getParentControlId(): string;
|
|
55
|
-
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
56
|
-
getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
|
|
57
|
-
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
58
|
-
getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
59
|
-
isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
readonly fontFamily: {
|
|
63
|
-
new (): {
|
|
64
|
-
getId(): string;
|
|
65
|
-
getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
|
|
66
|
-
getParentControlId(): string;
|
|
67
|
-
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
68
|
-
getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
|
|
69
|
-
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
70
|
-
getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
71
|
-
isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
readonly background: {
|
|
75
|
-
new (): {
|
|
76
|
-
getId(): string;
|
|
77
|
-
getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
|
|
78
|
-
getParentControlId(): string;
|
|
79
|
-
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
80
|
-
getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
|
|
81
|
-
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
82
|
-
getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
83
|
-
isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
readonly paddings: {
|
|
87
|
-
new (): {
|
|
88
|
-
getId(): string;
|
|
89
|
-
getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
|
|
90
|
-
getParentControlId(): string;
|
|
91
|
-
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
92
|
-
getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
|
|
93
|
-
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
94
|
-
getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
95
|
-
isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
|
|
96
|
-
};
|
|
97
|
-
};
|
|
98
|
-
readonly textBefore: typeof OmnibusPriceTextBeforeControl;
|
|
99
|
-
readonly textAfter: typeof OmnibusPriceTextAfterControl;
|
|
100
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Price Element Controls
|
|
3
|
-
*
|
|
4
|
-
* Controls for styling the product price element in recommendation cards.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Grouped Price Controls
|
|
8
|
-
* Use this object for cleaner imports in extension.ts
|
|
9
|
-
*/
|
|
10
|
-
export declare const PriceControls: {
|
|
11
|
-
readonly align: {
|
|
12
|
-
new (): {
|
|
13
|
-
getId(): string;
|
|
14
|
-
getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
|
|
15
|
-
getParentControlId(): string;
|
|
16
|
-
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
17
|
-
getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
|
|
18
|
-
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
19
|
-
getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
20
|
-
isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
readonly color: {
|
|
24
|
-
new (): {
|
|
25
|
-
getId(): string;
|
|
26
|
-
getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
|
|
27
|
-
getParentControlId(): string;
|
|
28
|
-
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
29
|
-
getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
|
|
30
|
-
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
31
|
-
getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
32
|
-
isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
readonly size: {
|
|
36
|
-
new (): {
|
|
37
|
-
getId(): string;
|
|
38
|
-
getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
|
|
39
|
-
getParentControlId(): string;
|
|
40
|
-
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
41
|
-
getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
|
|
42
|
-
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
43
|
-
getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
44
|
-
isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
readonly style: {
|
|
48
|
-
new (): {
|
|
49
|
-
getId(): string;
|
|
50
|
-
getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
|
|
51
|
-
getParentControlId(): string;
|
|
52
|
-
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
53
|
-
getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
|
|
54
|
-
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
55
|
-
getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
56
|
-
isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
readonly fontFamily: {
|
|
60
|
-
new (): {
|
|
61
|
-
getId(): string;
|
|
62
|
-
getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
|
|
63
|
-
getParentControlId(): string;
|
|
64
|
-
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
65
|
-
getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
|
|
66
|
-
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
67
|
-
getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
68
|
-
isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
readonly background: {
|
|
72
|
-
new (): {
|
|
73
|
-
getId(): string;
|
|
74
|
-
getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
|
|
75
|
-
getParentControlId(): string;
|
|
76
|
-
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
77
|
-
getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
|
|
78
|
-
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
79
|
-
getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
80
|
-
isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
readonly paddings: {
|
|
84
|
-
new (): {
|
|
85
|
-
getId(): string;
|
|
86
|
-
getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
|
|
87
|
-
getParentControlId(): string;
|
|
88
|
-
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
89
|
-
getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
|
|
90
|
-
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
91
|
-
getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
92
|
-
isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
};
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Spacing Control
|
|
3
|
-
*
|
|
4
|
-
* Manages spacing between product cards:
|
|
5
|
-
* - Column spacing: horizontal gap between cards in the same row
|
|
6
|
-
* - Row spacing: vertical gap between different rows
|
|
7
|
-
*
|
|
8
|
-
* Configuration is stored via node config (persists with template).
|
|
9
|
-
* Actual spacing is applied to DOM elements via inline styles.
|
|
10
|
-
*/
|
|
11
|
-
import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
12
|
-
import { CommonControl } from '../../../common-control';
|
|
13
|
-
export declare const SPACING_CONTROL_ID = "recommendation-spacing-control";
|
|
14
|
-
/**
|
|
15
|
-
* Control for managing spacing between product cards
|
|
16
|
-
* - Column spacing: horizontal gap between cards in the same row
|
|
17
|
-
* - Row spacing: vertical gap between different rows
|
|
18
|
-
*/
|
|
19
|
-
export declare class SpacingControl extends CommonControl {
|
|
20
|
-
private store;
|
|
21
|
-
private unsubscribeOrientation;
|
|
22
|
-
getId(): string;
|
|
23
|
-
getTemplate(): string;
|
|
24
|
-
onRender(): void;
|
|
25
|
-
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
26
|
-
onDestroy(): void;
|
|
27
|
-
/**
|
|
28
|
-
* Updates column spacing visibility based on layout orientation
|
|
29
|
-
* Column spacing is hidden for list layout (products are stacked vertically)
|
|
30
|
-
* Reads from node config first, falls back to store then DOM
|
|
31
|
-
*/
|
|
32
|
-
_updateColumnSpacingVisibility(): void;
|
|
33
|
-
/**
|
|
34
|
-
* Reads spacing values from node config first, falls back to DOM styles
|
|
35
|
-
*/
|
|
36
|
-
_setFormValues(): void;
|
|
37
|
-
/**
|
|
38
|
-
* Gets stored column spacing from the first attribute row cell's padding.
|
|
39
|
-
* For grid layout: cells inside .recommendation-attribute-row have padding applied.
|
|
40
|
-
* For list layout: the parent of .product-card-wrapper has the padding.
|
|
41
|
-
* The padding is applied as "0 {halfSpacing}px", so we extract and multiply by 2.
|
|
42
|
-
*/
|
|
43
|
-
_getStoredColumnSpacing(): number;
|
|
44
|
-
/**
|
|
45
|
-
* Gets stored row spacing from the first spacer element's height style
|
|
46
|
-
*/
|
|
47
|
-
_getStoredRowSpacing(): number;
|
|
48
|
-
/**
|
|
49
|
-
* Handles column spacing changes.
|
|
50
|
-
* For grid layout: applies horizontal padding to all cells inside attribute rows.
|
|
51
|
-
* For list layout: applies padding to parent of product card wrappers.
|
|
52
|
-
*/
|
|
53
|
-
_onColumnSpacingChange(spacing: number): void;
|
|
54
|
-
/**
|
|
55
|
-
* Handles row spacing changes
|
|
56
|
-
* Applies height to all spacer elements between product rows
|
|
57
|
-
*/
|
|
58
|
-
_onRowSpacingChange(spacing: number): void;
|
|
59
|
-
/**
|
|
60
|
-
* Stores column spacing value in block data attribute
|
|
61
|
-
*/
|
|
62
|
-
_storeColumnSpacing(spacing: number): void;
|
|
63
|
-
/**
|
|
64
|
-
* Stores row spacing value in block data attribute
|
|
65
|
-
*/
|
|
66
|
-
_storeRowSpacing(spacing: number): void;
|
|
67
|
-
_listenToFormUpdates(): void;
|
|
68
|
-
/**
|
|
69
|
-
* Debounced version of _onColumnSpacingChange
|
|
70
|
-
* Prevents excessive DOM updates when user rapidly adjusts the counter
|
|
71
|
-
*/
|
|
72
|
-
_debouncedOnColumnSpacingChange: import("@vueuse/shared").PromisifyFn<(spacing: number) => void>;
|
|
73
|
-
/**
|
|
74
|
-
* Debounced version of _onRowSpacingChange
|
|
75
|
-
* Prevents excessive DOM updates when user rapidly adjusts the counter
|
|
76
|
-
*/
|
|
77
|
-
_debouncedOnRowSpacingChange: import("@vueuse/shared").PromisifyFn<(spacing: number) => void>;
|
|
78
|
-
/**
|
|
79
|
-
* Subscribe to store orientation changes
|
|
80
|
-
* Updates column spacing visibility when layout changes via the layout control
|
|
81
|
-
*/
|
|
82
|
-
_subscribeToOrientationChanges(): void;
|
|
83
|
-
}
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Recommendation Config Service
|
|
3
|
-
*
|
|
4
|
-
* Service for managing Recommendation block configuration via Stripo's node config API.
|
|
5
|
-
* This replaces the Pinia store for persistent configuration data.
|
|
6
|
-
*
|
|
7
|
-
* Key features:
|
|
8
|
-
* - Reads/writes config to/from node using `getNodeConfig`/`setNodeConfig`
|
|
9
|
-
* - Configuration persists with the template HTML
|
|
10
|
-
* - Each block has independent configuration (no global state)
|
|
11
|
-
* - Integrates with Stripo's undo/redo via `ModificationDescription`
|
|
12
|
-
*
|
|
13
|
-
* Usage pattern similar to legacy `blockConfigurationService`:
|
|
14
|
-
* @example
|
|
15
|
-
* // Read config
|
|
16
|
-
* const config = RecommendationConfigService.getConfig(node);
|
|
17
|
-
* // Update config
|
|
18
|
-
* RecommendationConfigService.updateConfig(api, node, { strategy: 'mostPopular' }, 'Changed algorithm');
|
|
19
|
-
* @see https://plugin.stripo.email/extensions/reference/blocks/Block
|
|
20
|
-
*/
|
|
21
|
-
import type { RecommendationNodeConfig, PartialNodeConfig } from '../types/nodeConfig';
|
|
22
|
-
import type { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
23
|
-
import { ModificationDescription } from '@stripoinc/ui-editor-extensions';
|
|
24
|
-
/**
|
|
25
|
-
* Stripo Extension API interface for document modifications
|
|
26
|
-
* Extracted to allow type-safe usage without importing full Stripo types
|
|
27
|
-
*/
|
|
28
|
-
interface DocumentModifier {
|
|
29
|
-
modifyHtml: (node: ImmutableHtmlNode) => {
|
|
30
|
-
setNodeConfig: (config: Record<string, unknown>) => DocumentModifier;
|
|
31
|
-
setAttribute: (name: string, value: string) => DocumentModifier;
|
|
32
|
-
setStyle: (prop: string, value: string) => DocumentModifier;
|
|
33
|
-
setInnerHtml: (html: string) => DocumentModifier;
|
|
34
|
-
};
|
|
35
|
-
apply: (desc: ModificationDescription) => void;
|
|
36
|
-
}
|
|
37
|
-
interface DocumentModifierApi {
|
|
38
|
-
getDocumentModifier: () => DocumentModifier;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Service for managing Recommendation block configuration
|
|
42
|
-
*
|
|
43
|
-
* All methods are static for easy usage without instantiation.
|
|
44
|
-
* The service follows the same patterns as the legacy `blockConfigurationService`.
|
|
45
|
-
*/
|
|
46
|
-
export declare class RecommendationConfigService {
|
|
47
|
-
/**
|
|
48
|
-
* Get configuration from a node, with defaults for missing values
|
|
49
|
-
*
|
|
50
|
-
* This is the primary way to read configuration from a block.
|
|
51
|
-
* Always returns a complete config object with defaults merged in.
|
|
52
|
-
* @example
|
|
53
|
-
* const config = RecommendationConfigService.getConfig(this.currentNode);
|
|
54
|
-
* console.log(config.strategy); // 'mostPopular'
|
|
55
|
-
* @param node - The immutable HTML node to read config from
|
|
56
|
-
* @returns Complete configuration with defaults for missing values
|
|
57
|
-
*/
|
|
58
|
-
static getConfig(node: ImmutableHtmlNode | null | undefined): RecommendationNodeConfig;
|
|
59
|
-
/**
|
|
60
|
-
* Check if a node has valid configuration stored
|
|
61
|
-
*
|
|
62
|
-
* Used for migration detection - returns false for legacy templates
|
|
63
|
-
* that need their configuration migrated.
|
|
64
|
-
* @param node - The immutable HTML node to check
|
|
65
|
-
* @returns True if node has valid config with version number
|
|
66
|
-
*/
|
|
67
|
-
static hasConfig(node: ImmutableHtmlNode | null | undefined): boolean;
|
|
68
|
-
/**
|
|
69
|
-
* Get the configuration version from a node
|
|
70
|
-
* @param node - The immutable HTML node to check
|
|
71
|
-
* @returns Config version number, or 0 if no config exists
|
|
72
|
-
*/
|
|
73
|
-
static getConfigVersion(node: ImmutableHtmlNode | null | undefined): number;
|
|
74
|
-
/**
|
|
75
|
-
* Update specific configuration values
|
|
76
|
-
*
|
|
77
|
-
* Merges the updates with existing config and persists to node.
|
|
78
|
-
* This is the primary way to update configuration from controls.
|
|
79
|
-
* @example
|
|
80
|
-
* RecommendationConfigService.updateConfig(
|
|
81
|
-
* this.api,
|
|
82
|
-
* this.currentNode,
|
|
83
|
-
* { strategy: 'complementaryItems' },
|
|
84
|
-
* 'Changed recommendation algorithm'
|
|
85
|
-
* );
|
|
86
|
-
* @param api - Stripo extension API with document modifier
|
|
87
|
-
* @param node - The immutable HTML node to update
|
|
88
|
-
* @param updates - Partial config with values to update
|
|
89
|
-
* @param description - Human-readable description for undo/redo
|
|
90
|
-
* @returns The new complete configuration
|
|
91
|
-
*/
|
|
92
|
-
static updateConfig(api: DocumentModifierApi, node: ImmutableHtmlNode, updates: PartialNodeConfig, description: string): RecommendationNodeConfig;
|
|
93
|
-
/**
|
|
94
|
-
* Initialize configuration for a new block
|
|
95
|
-
*
|
|
96
|
-
* Called when a block is first created (dropped into template).
|
|
97
|
-
* Can optionally merge in partial config from migration.
|
|
98
|
-
* @example
|
|
99
|
-
* // In Block.onCreated lifecycle
|
|
100
|
-
* RecommendationConfigService.initializeConfig(this.api, node);
|
|
101
|
-
* @param api - Stripo extension API with document modifier
|
|
102
|
-
* @param node - The immutable HTML node to initialize
|
|
103
|
-
* @param partialConfig - Optional partial config to merge with defaults
|
|
104
|
-
* @returns The initialized configuration
|
|
105
|
-
*/
|
|
106
|
-
static initializeConfig(api: DocumentModifierApi, node: ImmutableHtmlNode, partialConfig?: PartialNodeConfig): RecommendationNodeConfig;
|
|
107
|
-
/**
|
|
108
|
-
* Save complete configuration to a node
|
|
109
|
-
*
|
|
110
|
-
* Low-level method - prefer `updateConfig` or `initializeConfig` in most cases.
|
|
111
|
-
* @param api - Stripo extension API with document modifier
|
|
112
|
-
* @param node - The immutable HTML node to save to
|
|
113
|
-
* @param config - Complete configuration to save
|
|
114
|
-
* @param description - Human-readable description for undo/redo
|
|
115
|
-
*/
|
|
116
|
-
static saveConfig(api: DocumentModifierApi, node: ImmutableHtmlNode, config: RecommendationNodeConfig, description: string): void;
|
|
117
|
-
/**
|
|
118
|
-
* Migrate configuration from legacy data-attributes
|
|
119
|
-
*
|
|
120
|
-
* Reads existing data-attributes and creates a proper node config.
|
|
121
|
-
* Used when loading templates created before node config was implemented.
|
|
122
|
-
* @param api - Stripo extension API with document modifier
|
|
123
|
-
* @param node - The block node to migrate
|
|
124
|
-
* @returns The migrated configuration
|
|
125
|
-
*/
|
|
126
|
-
static migrateFromDataAttributes(api: DocumentModifierApi, node: ImmutableHtmlNode): RecommendationNodeConfig;
|
|
127
|
-
/**
|
|
128
|
-
* Check if configuration needs migration
|
|
129
|
-
* @param node - The block node to check
|
|
130
|
-
* @returns True if migration is needed
|
|
131
|
-
*/
|
|
132
|
-
static needsMigration(node: ImmutableHtmlNode | null | undefined): boolean;
|
|
133
|
-
/**
|
|
134
|
-
* Clone default config to avoid mutations
|
|
135
|
-
*/
|
|
136
|
-
private static cloneDefaults;
|
|
137
|
-
/**
|
|
138
|
-
* Merge partial config with defaults
|
|
139
|
-
*
|
|
140
|
-
* Deep merges nested objects like currency, omnibus settings.
|
|
141
|
-
*/
|
|
142
|
-
private static mergeWithDefaults;
|
|
143
|
-
/**
|
|
144
|
-
* Deep merge for nested objects
|
|
145
|
-
*
|
|
146
|
-
* Recursively merges source into target, preserving existing values
|
|
147
|
-
* that aren't explicitly overwritten.
|
|
148
|
-
*/
|
|
149
|
-
private static deepMerge;
|
|
150
|
-
}
|
|
151
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { ElementRenderer } from '../utils';
|
|
2
|
-
/**
|
|
3
|
-
* Grid element renderer
|
|
4
|
-
* Each element returns a `<td>` containing a nested table structure:
|
|
5
|
-
* - Outer `<td>` has padding for column spacing
|
|
6
|
-
* - Inner `<table class="product-card-segment">` supports background color
|
|
7
|
-
* - Content is inside the inner table
|
|
8
|
-
*
|
|
9
|
-
* This structure allows:
|
|
10
|
-
* 1. Row-based alignment (all same attributes in one row)
|
|
11
|
-
* 2. Per-card background color via inner table
|
|
12
|
-
* 3. Column spacing via outer cell padding
|
|
13
|
-
*/
|
|
14
|
-
export declare const DEFAULT_CELL_PADDING = "0 5px";
|
|
15
|
-
/**
|
|
16
|
-
* Class name for outer cells in attribute rows
|
|
17
|
-
* Used by controls to reliably select direct children for spacing adjustments
|
|
18
|
-
*/
|
|
19
|
-
export declare const ATTRIBUTE_CELL_CLASS = "attribute-cell";
|
|
20
|
-
export declare const gridElementRenderer: ElementRenderer;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { RecommendationProduct } from '@@/Types/recommendation';
|
|
2
|
-
import { type ElementRenderer } from '../utils';
|
|
3
|
-
/**
|
|
4
|
-
* Generates attribute-aligned product rows for grid layout.
|
|
5
|
-
* Creates rows where each row contains one attribute type from all products.
|
|
6
|
-
* @param products - Array of products in this row group
|
|
7
|
-
* @param productsPerRow - Number of products per row (for column width calculation)
|
|
8
|
-
* @param elementRenderer - Object mapping attribute types to render functions
|
|
9
|
-
* @param composition - Array defining order of card elements
|
|
10
|
-
* @returns HTML string for attribute-aligned rows
|
|
11
|
-
*/
|
|
12
|
-
export declare function prepareGridAttributeRows(products: RecommendationProduct[], productsPerRow: number, elementRenderer: ElementRenderer, composition?: string[]): string;
|
|
13
|
-
/**
|
|
14
|
-
* Prepares grid product rows with attribute-aligned structure
|
|
15
|
-
* Groups products into rows, then generates attribute-aligned HTML for each group
|
|
16
|
-
* @param products - Array of products to display
|
|
17
|
-
* @param productsPerRow - Number of products per row
|
|
18
|
-
* @param elementRenderer - Object mapping attribute types to render functions
|
|
19
|
-
* @param composition - Array defining order of card elements
|
|
20
|
-
* @returns HTML string for all product rows
|
|
21
|
-
*/
|
|
22
|
-
export declare function prepareGridProductRows(products: RecommendationProduct[], productsPerRow: number, elementRenderer: ElementRenderer, composition?: string[]): string;
|
|
23
|
-
/**
|
|
24
|
-
* Prepares grid product rows with attribute-aligned structure.
|
|
25
|
-
* Uses row-based rendering where each attribute type forms a single row across all products.
|
|
26
|
-
* @param products - Array of products to display
|
|
27
|
-
* @param productsPerRow - Number of products per row
|
|
28
|
-
* @param composition - Array defining element order
|
|
29
|
-
* @returns HTML string for product rows
|
|
30
|
-
*/
|
|
31
|
-
export declare function prepareProductRows(products: RecommendationProduct[], productsPerRow: number, composition?: string[]): string;
|
|
32
|
-
export declare function getDefaultTemplate(recommendationId?: number): string;
|
|
33
|
-
export declare function generateBlockTemplate(products: RecommendationProduct[], productsPerRow: number, title?: string, composition?: string[]): string;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Unified Template API for Recommendation Block
|
|
3
|
-
*
|
|
4
|
-
* This module provides a single entry point for working with recommendation
|
|
5
|
-
* block templates, abstracting away the layout-specific implementations.
|
|
6
|
-
*/
|
|
7
|
-
import type { RecommendationProduct } from '@@/Types/recommendation';
|
|
8
|
-
import { type Orientation, type PrepareProductRowsOptions } from './utils';
|
|
9
|
-
export { DEFAULTS, DEFAULT_CARD_COMPOSITION, DEFAULT_CARD_VISIBILITY, getDefaultProducts, spacer, sanitizeImageUrl, createBlockTemplate, type Orientation, type PrepareProductRowsOptions, type ElementRenderer, type ProductCardGetter, } from './utils';
|
|
10
|
-
/**
|
|
11
|
-
* Unified function to prepare product rows for any layout.
|
|
12
|
-
* Delegates to the appropriate layout-specific implementation.
|
|
13
|
-
* @example
|
|
14
|
-
* // List layout (full-width rows)
|
|
15
|
-
* prepareProductRows(products, 'list');
|
|
16
|
-
* @example
|
|
17
|
-
* // Grid layout
|
|
18
|
-
* prepareProductRows(products, 'grid', { productsPerRow: 3 });
|
|
19
|
-
* @param products - Array of products to display
|
|
20
|
-
* @param layout - The layout orientation ('list' or 'grid')
|
|
21
|
-
* @param options - Layout-specific options
|
|
22
|
-
* @returns HTML string for product rows
|
|
23
|
-
*/
|
|
24
|
-
export declare function prepareProductRows(products: RecommendationProduct[], layout: Orientation, options?: PrepareProductRowsOptions): string;
|
|
25
|
-
/**
|
|
26
|
-
* Generates the default template for a given layout.
|
|
27
|
-
* @param layout - The layout orientation ('list' or 'grid')
|
|
28
|
-
* @returns Complete HTML template with default products
|
|
29
|
-
*/
|
|
30
|
-
export declare function getDefaultTemplate(layout?: Orientation): string;
|
|
31
|
-
/**
|
|
32
|
-
* Generates a complete block template with custom products.
|
|
33
|
-
* @param products - Array of products to display
|
|
34
|
-
* @param layout - The layout orientation ('list' or 'grid')
|
|
35
|
-
* @param title - Title for the block
|
|
36
|
-
* @param options - Layout-specific options
|
|
37
|
-
* @returns Complete HTML template
|
|
38
|
-
*/
|
|
39
|
-
export declare function generateBlockTemplate(products: RecommendationProduct[], layout: Orientation, title?: string, options?: PrepareProductRowsOptions): string;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ElementRenderer } from '../utils';
|
|
2
|
-
/**
|
|
3
|
-
* List element renderer
|
|
4
|
-
* - Image and Button return `<td>` cells for the 3-column layout
|
|
5
|
-
* - Name and Prices return `<tr><td>` rows for the info cell table
|
|
6
|
-
* All elements have esd-block-* classes for Stripo selection
|
|
7
|
-
*/
|
|
8
|
-
export declare const listElementRenderer: ElementRenderer;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { RecommendationProduct } from '@@/Types/recommendation';
|
|
2
|
-
import { DEFAULTS, getDefaultProducts } from '../utils';
|
|
3
|
-
/**
|
|
4
|
-
* Migration template for list layout
|
|
5
|
-
* Used when migrating old recommendation blocks to list format
|
|
6
|
-
*/
|
|
7
|
-
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 data-layout=\"list\"\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";
|
|
8
|
-
export declare function getMigrationTemplate(): string;
|
|
9
|
-
/**
|
|
10
|
-
* Generates a custom list migration template with specified products
|
|
11
|
-
* @param products - Array of products to display
|
|
12
|
-
* @param title - Optional title for the block
|
|
13
|
-
* @param composition - Optional array defining order of card elements
|
|
14
|
-
* @returns Complete HTML template
|
|
15
|
-
*/
|
|
16
|
-
export declare function generateMigrationTemplate(products: RecommendationProduct[], title?: string, composition?: string[]): string;
|
|
17
|
-
/**
|
|
18
|
-
* Prepares list product rows for migration
|
|
19
|
-
* @param products - Array of products to display
|
|
20
|
-
* @param composition - Optional array defining order of card elements
|
|
21
|
-
* @returns HTML string for product rows
|
|
22
|
-
*/
|
|
23
|
-
export declare function prepareProductRows(products: RecommendationProduct[], composition?: string[]): string;
|
|
24
|
-
export { DEFAULTS, getDefaultProducts };
|
|
25
|
-
export default migrationTemplate;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { RecommendationProduct } from '@@/Types/recommendation';
|
|
2
|
-
/**
|
|
3
|
-
* Generates a list product card with 3-column layout
|
|
4
|
-
* Uses listElementRenderer to render Image, Info content, and Button
|
|
5
|
-
* Layout: [Image (120px)] [Info table (flexible)] [Button (100px)]
|
|
6
|
-
* @param product - The product data
|
|
7
|
-
* @returns HTML string for a single product card row
|
|
8
|
-
*/
|
|
9
|
-
export declare function getListProductCard(product: RecommendationProduct): string;
|
|
10
|
-
/**
|
|
11
|
-
* Prepares list product rows
|
|
12
|
-
* Each product is a full-width row with 3-column layout
|
|
13
|
-
* @param products - Array of products to display
|
|
14
|
-
* @returns HTML string for product rows
|
|
15
|
-
*/
|
|
16
|
-
export declare function prepareProductRows(products: RecommendationProduct[]): string;
|
|
17
|
-
export declare function getDefaultTemplate(): string;
|
|
18
|
-
export declare function generateBlockTemplate(products: RecommendationProduct[], title?: string): string;
|