@useinsider/guido 2.1.0-beta.7d0f92a → 2.1.0-beta.860ef21
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/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +14 -15
- 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/extensions/recommendationBlock.js +1 -1
- 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/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +169 -223
- package/dist/services/recommendationApi.js +9 -10
- package/dist/services/templateLibraryApi.js +13 -16
- package/dist/src/components/wrappers/WpDrawer.vue.d.ts +1 -1
- package/dist/src/composables/useRecommendation.d.ts +0 -1
- 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/static/styles/components/notification.css.js +1 -0
- package/dist/static/styles/components/wide-panel.css.js +15 -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 +2 -2
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +0 -116
- 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,7 +1,7 @@
|
|
|
1
|
-
import { useHttp as
|
|
2
|
-
import { URLS as
|
|
3
|
-
const
|
|
4
|
-
const { get: o } =
|
|
1
|
+
import { useHttp as c } from "../composables/useHttp.js";
|
|
2
|
+
import { URLS as a } from "../enums/extensions/recommendationBlock.js";
|
|
3
|
+
const R = () => {
|
|
4
|
+
const { get: o } = c();
|
|
5
5
|
return {
|
|
6
6
|
fetchRecommendationCreateData: async () => {
|
|
7
7
|
try {
|
|
@@ -18,15 +18,14 @@ const u = () => {
|
|
|
18
18
|
throw console.error("fetchRecommendationFilters error:", e), e;
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
|
-
fetchRecommendationProducts: async (e,
|
|
22
|
-
var n;
|
|
21
|
+
fetchRecommendationProducts: async (e, n) => {
|
|
23
22
|
try {
|
|
24
|
-
const t = decodeURIComponent(new URLSearchParams(Object.entries(
|
|
23
|
+
const t = decodeURIComponent(new URLSearchParams(Object.entries(n)).toString());
|
|
25
24
|
console.debug("🏁 Recommendation API Query:", t);
|
|
26
25
|
const r = await o(
|
|
27
|
-
`${
|
|
26
|
+
`${a.RECOMMENDATION_API_URL}/v2/${e}?${t}`
|
|
28
27
|
);
|
|
29
|
-
return (
|
|
28
|
+
return (r == null ? void 0 : r.data) ?? [];
|
|
30
29
|
} catch (t) {
|
|
31
30
|
throw console.error("fetchRecommendationProducts error:", t), t;
|
|
32
31
|
}
|
|
@@ -34,5 +33,5 @@ const u = () => {
|
|
|
34
33
|
};
|
|
35
34
|
};
|
|
36
35
|
export {
|
|
37
|
-
|
|
36
|
+
R as useRecommendationApi
|
|
38
37
|
};
|
|
@@ -3,30 +3,29 @@ import { useHttp as f } from "../composables/useHttp.js";
|
|
|
3
3
|
import { useToaster as w } from "../composables/useToaster.js";
|
|
4
4
|
import { useTranslations as b } from "../composables/useTranslations.js";
|
|
5
5
|
import { EditorType as h } from "../enums/defaults.js";
|
|
6
|
-
import {
|
|
7
|
-
import { useSaveAsTemplateStore as v } from "../stores/save-as-template.js";
|
|
6
|
+
import { useSaveAsTemplateStore as C } from "../stores/save-as-template.js";
|
|
8
7
|
import { base64EncodeWithSpecialChars as a } from "../utils/base64.js";
|
|
9
|
-
import { useTemplatePreparation as
|
|
10
|
-
const
|
|
11
|
-
const { get:
|
|
8
|
+
import { useTemplatePreparation as v } from "../utils/templatePreparation.js";
|
|
9
|
+
const L = () => {
|
|
10
|
+
const { get: m, post: n } = f(), { handleError: o, showToaster: i } = w(), { config: l } = T(), p = b();
|
|
12
11
|
return {
|
|
13
12
|
getCategories: async () => {
|
|
14
13
|
try {
|
|
15
|
-
const { data: e = [] } = await
|
|
14
|
+
const { data: e = [] } = await m("/newsletter/template-library/get-template-categories");
|
|
16
15
|
return e;
|
|
17
16
|
} catch (e) {
|
|
18
17
|
return o(e, "Failed to fetch template categories"), [];
|
|
19
18
|
}
|
|
20
19
|
},
|
|
21
20
|
checkTemplateNameAvailability: async (e) => {
|
|
22
|
-
const { data: { status: t = !1 } } = await
|
|
21
|
+
const { data: { status: t = !1 } } = await m(
|
|
23
22
|
`/newsletter/template-library/template-name-exists?name=${e}`
|
|
24
23
|
);
|
|
25
24
|
return !t;
|
|
26
25
|
},
|
|
27
26
|
createCategory: async (e) => {
|
|
28
27
|
try {
|
|
29
|
-
const { data: { id: t } } = await
|
|
28
|
+
const { data: { id: t } } = await n(
|
|
30
29
|
"/newsletter/template-library/create-category",
|
|
31
30
|
{ name: e }
|
|
32
31
|
);
|
|
@@ -38,7 +37,7 @@ const R = () => {
|
|
|
38
37
|
createTemplate: async () => {
|
|
39
38
|
var e, t, g, y;
|
|
40
39
|
try {
|
|
41
|
-
const { prepareTemplateDetails:
|
|
40
|
+
const { prepareTemplateDetails: c } = v(), r = C(), s = await c(), u = {
|
|
42
41
|
name: r.getTemplateName,
|
|
43
42
|
categories: r.getSelectedCategoryIds,
|
|
44
43
|
productId: ((t = (e = l.value) == null ? void 0 : e.partner) == null ? void 0 : t.productType) || 0,
|
|
@@ -48,9 +47,7 @@ const R = () => {
|
|
|
48
47
|
css: a(s.css),
|
|
49
48
|
unsubscriptionPreferencePageStatus: !1,
|
|
50
49
|
unsubscriptionPreferencePages: [],
|
|
51
|
-
recommendationCampaignUrls: a(
|
|
52
|
-
C().recommendationCampaignUrls
|
|
53
|
-
),
|
|
50
|
+
recommendationCampaignUrls: a({}),
|
|
54
51
|
recommendationConfigs: a({}),
|
|
55
52
|
isGuido: !0,
|
|
56
53
|
stripoConfig: a({
|
|
@@ -58,7 +55,7 @@ const R = () => {
|
|
|
58
55
|
html: s.rawHtml,
|
|
59
56
|
css: s.css
|
|
60
57
|
})
|
|
61
|
-
}, { data: { type: d } } = await
|
|
58
|
+
}, { data: { type: d } } = await n(
|
|
62
59
|
"/newsletter/template-library/create-template",
|
|
63
60
|
u
|
|
64
61
|
);
|
|
@@ -79,12 +76,12 @@ const R = () => {
|
|
|
79
76
|
),
|
|
80
77
|
type: "success"
|
|
81
78
|
});
|
|
82
|
-
} catch (
|
|
83
|
-
o(
|
|
79
|
+
} catch (c) {
|
|
80
|
+
o(c, "Failed to create template");
|
|
84
81
|
}
|
|
85
82
|
}
|
|
86
83
|
};
|
|
87
84
|
};
|
|
88
85
|
export {
|
|
89
|
-
|
|
86
|
+
L as useTemplateLibraryApi
|
|
90
87
|
};
|
|
@@ -33,8 +33,8 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
|
|
|
33
33
|
descriptionStatus: boolean;
|
|
34
34
|
descriptionText: string;
|
|
35
35
|
}>>>, {
|
|
36
|
-
size: "small" | "medium" | "large";
|
|
37
36
|
className: string;
|
|
37
|
+
size: "small" | "medium" | "large";
|
|
38
38
|
closeOnOutsideClick: boolean;
|
|
39
39
|
descriptionStatus: boolean;
|
|
40
40
|
descriptionText: string;
|
|
@@ -15,6 +15,5 @@ interface CampaignData extends CardWidthParams {
|
|
|
15
15
|
export declare const useRecommendation: () => {
|
|
16
16
|
calculateCardWidth: ({ mobileLeftPadding, mobileRightPadding, cardsInRow, unresponsive, }: CardWidthParams) => number;
|
|
17
17
|
getRecommendationCampaignData: (id: string) => CampaignData;
|
|
18
|
-
buildCampaignUrl: (campaignId: string) => string;
|
|
19
18
|
};
|
|
20
19
|
export {};
|
|
@@ -1,78 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Recommendation Block
|
|
3
|
-
*
|
|
4
|
-
* Main block class for the Recommendation extension.
|
|
5
|
-
* Handles block lifecycle including configuration initialization and migration.
|
|
6
|
-
* Supports multiple block instances with unique recommendation-id attributes.
|
|
7
|
-
*/
|
|
8
|
-
import type { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
9
1
|
import { Block, BlockCompositionType } from '@stripoinc/ui-editor-extensions';
|
|
10
2
|
export declare const BLOCK_ID = "recommendation-block";
|
|
11
3
|
export declare class RecommendationBlock extends Block {
|
|
12
|
-
/**
|
|
13
|
-
* Stores the ID generated in getTemplate() so onCreated() can reuse it.
|
|
14
|
-
* This avoids generating a new (different) ID in onCreated().
|
|
15
|
-
*/
|
|
16
|
-
private _pendingBlockId;
|
|
17
4
|
constructor();
|
|
18
5
|
getId(): string;
|
|
19
6
|
getIcon(): string;
|
|
20
7
|
getBlockCompositionType(): BlockCompositionType;
|
|
21
8
|
getName(): string;
|
|
22
9
|
getDescription(): string;
|
|
23
|
-
/**
|
|
24
|
-
* Returns the template HTML for a new recommendation block.
|
|
25
|
-
* Generates a unique recommendation ID and embeds the instance class
|
|
26
|
-
* (ins-recommendation-v3-block-{id}) directly in the template HTML.
|
|
27
|
-
* This is necessary because Stripo's Angular rendering manages the class
|
|
28
|
-
* attribute and overwrites dynamically added classes via setAttribute.
|
|
29
|
-
*/
|
|
30
10
|
getTemplate(): string;
|
|
31
|
-
/**
|
|
32
|
-
* Called when a new block is dropped into the template
|
|
33
|
-
*
|
|
34
|
-
* Uses the ID from getTemplate() (which already embedded the instance class)
|
|
35
|
-
* and assigns the recommendation-id attribute + initializes configuration.
|
|
36
|
-
* @param node - The newly created block node
|
|
37
|
-
*/
|
|
38
|
-
onCreated(node: ImmutableHtmlNode): void;
|
|
39
|
-
/**
|
|
40
|
-
* Called when the document changes or template is loaded
|
|
41
|
-
*
|
|
42
|
-
* Handles migration from legacy templates that don't have node config
|
|
43
|
-
* and assigns recommendation-id to legacy blocks that lack one.
|
|
44
|
-
* @param node - The block node that may need migration
|
|
45
|
-
*/
|
|
46
|
-
onDocumentChanged(node: ImmutableHtmlNode): void;
|
|
47
|
-
/**
|
|
48
|
-
* Called when a block is deleted from the template
|
|
49
|
-
*
|
|
50
|
-
* Cleans up the per-block state from the Pinia store.
|
|
51
|
-
* @param node - The block node being deleted
|
|
52
|
-
*/
|
|
53
|
-
onDelete(node: ImmutableHtmlNode): void;
|
|
54
|
-
/**
|
|
55
|
-
* Generates the next unique recommendation ID by scanning all existing blocks
|
|
56
|
-
* in the document and finding the maximum existing ID + 1.
|
|
57
|
-
*/
|
|
58
|
-
private _generateNextId;
|
|
59
|
-
/**
|
|
60
|
-
* Assigns a recommendation-id attribute to the block element.
|
|
61
|
-
* The instance class (ins-recommendation-v3-block-{id}) is embedded in the template
|
|
62
|
-
* HTML by getTemplate(), since Stripo's Angular rendering overwrites dynamically
|
|
63
|
-
* added classes via setAttribute.
|
|
64
|
-
*/
|
|
65
|
-
private _assignRecommendationId;
|
|
66
|
-
/**
|
|
67
|
-
* Gets the recommendation-id from a block node
|
|
68
|
-
*/
|
|
69
|
-
private _getRecommendationId;
|
|
70
|
-
/**
|
|
71
|
-
* Gets the block element (the element with BLOCK_CLASS)
|
|
72
|
-
*/
|
|
73
|
-
private _getBlockElement;
|
|
74
|
-
/**
|
|
75
|
-
* Migrate configuration from legacy format
|
|
76
|
-
*/
|
|
77
|
-
private _migrateFromLegacy;
|
|
78
11
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
2
|
-
import { CommonControl } from '
|
|
2
|
+
import { CommonControl } from '../common-control';
|
|
3
3
|
export declare const COMPOSITION_CONTROL_BLOCK_ID = "ui-elements-recommendation-card-composition";
|
|
4
4
|
export interface CardCompositionItem {
|
|
5
5
|
key: string;
|
|
@@ -7,8 +7,6 @@ export interface CardCompositionItem {
|
|
|
7
7
|
visible: boolean;
|
|
8
8
|
}
|
|
9
9
|
export declare class RecommendationCardCompositionControl extends CommonControl {
|
|
10
|
-
private store;
|
|
11
|
-
private unsubscribeOrientation;
|
|
12
10
|
getId(): string;
|
|
13
11
|
getTemplate(): string;
|
|
14
12
|
onRender(): void;
|
|
@@ -59,12 +57,10 @@ export declare class RecommendationCardCompositionControl extends CommonControl
|
|
|
59
57
|
/**
|
|
60
58
|
* Apply the reordered composition to the block's HTML structure
|
|
61
59
|
* Updates the data-card-composition attribute and reorders product attributes
|
|
62
|
-
* Note: Reordering is only applied for grid layout
|
|
63
60
|
*/
|
|
64
61
|
private _applyCompositionToBlock;
|
|
65
62
|
/**
|
|
66
|
-
* Reorders attribute rows within each product
|
|
67
|
-
* Targets the tbody inside each product-attribute-cell to preserve card structure
|
|
63
|
+
* Reorders attribute rows within each product row based on composition order
|
|
68
64
|
*/
|
|
69
65
|
private _reorderProductAttributes;
|
|
70
66
|
/**
|
|
@@ -73,23 +69,7 @@ export declare class RecommendationCardCompositionControl extends CommonControl
|
|
|
73
69
|
private _buildCompositionHtml;
|
|
74
70
|
/**
|
|
75
71
|
* Apply visibility changes to the block's HTML structure
|
|
76
|
-
* Updates display style and data-visibility attribute for all matching
|
|
77
|
-
* - <tr> elements: use display: none / table-row
|
|
78
|
-
* - <td> elements: use display: none / table-cell
|
|
72
|
+
* Updates display style and data-visibility attribute for all matching rows
|
|
79
73
|
*/
|
|
80
74
|
private _applyVisibilityToBlock;
|
|
81
|
-
/**
|
|
82
|
-
* Gets the current layout orientation from store or DOM
|
|
83
|
-
*/
|
|
84
|
-
private _getCurrentLayout;
|
|
85
|
-
/**
|
|
86
|
-
* Updates orderable state based on layout orientation
|
|
87
|
-
* Adds/removes disabled class to hide drag icons for list layout
|
|
88
|
-
*/
|
|
89
|
-
private _updateOrderableState;
|
|
90
|
-
/**
|
|
91
|
-
* Subscribe to store orientation changes
|
|
92
|
-
* Updates orderable state when layout changes via the layout control
|
|
93
|
-
*/
|
|
94
|
-
private _subscribeToOrientationChanges;
|
|
95
75
|
}
|
package/dist/src/extensions/Blocks/Recommendation/{constants/controlIds.d.ts → constants.d.ts}
RENAMED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attribute type constants used in templates
|
|
3
|
+
* These are used as keys in ElementRenderer and composition arrays
|
|
4
|
+
*/
|
|
5
|
+
export declare const ATTR_PRODUCT_IMAGE = "productImage";
|
|
6
|
+
export declare const ATTR_PRODUCT_NAME = "productName";
|
|
7
|
+
export declare const ATTR_PRODUCT_PRICE = "productPrice";
|
|
8
|
+
export declare const ATTR_PRODUCT_OLD_PRICE = "productOldPrice";
|
|
9
|
+
export declare const ATTR_PRODUCT_OMNIBUS_PRICE = "productOmnibusPrice";
|
|
10
|
+
export declare const ATTR_PRODUCT_OMNIBUS_DISCOUNT = "productOmnibusDiscount";
|
|
11
|
+
export declare const ATTR_PRODUCT_BUTTON = "productButton";
|
|
12
|
+
/**
|
|
13
|
+
* Block IDs used in the Recommendation Extension
|
|
14
|
+
* These IDs are used in the esd-extension-block-id attribute to identify specific blocks
|
|
15
|
+
*/
|
|
16
|
+
export declare enum RecommendationBlockId {
|
|
17
|
+
BUTTON = "recommendation-block-button",
|
|
18
|
+
NAME = "recommendation-block-name",
|
|
19
|
+
PRICE = "recommendation-block-price",
|
|
20
|
+
OLD_PRICE = "recommendation-block-old-price",
|
|
21
|
+
OMNIBUS_PRICE = "recommendation-block-omnibus-price",
|
|
22
|
+
OMNIBUS_DISCOUNT = "recommendation-block-omnibus-discount",
|
|
23
|
+
IMAGE = "recommendation-block-image"
|
|
24
|
+
}
|
|
1
25
|
/**
|
|
2
26
|
* Control IDs used in the Recommendation Extension
|
|
3
27
|
* These IDs are returned by the getId() method of each control
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { CommonControl } from '../common-control';
|
|
2
|
+
export declare const CONTROL_BLOCK_ID = "ui-elements-recommendation-block";
|
|
3
|
+
export declare class RecommendationBlockControl extends CommonControl {
|
|
4
|
+
private store;
|
|
5
|
+
private storeUnsubscription;
|
|
6
|
+
private addFilterListener;
|
|
7
|
+
private addFilterButton;
|
|
8
|
+
getId(): string;
|
|
9
|
+
getTemplate(): string;
|
|
10
|
+
onRender(): Promise<void>;
|
|
11
|
+
onDestroy(): void;
|
|
12
|
+
_setFormValues(): void;
|
|
13
|
+
_initializeSelectItems(): void;
|
|
14
|
+
_getAlgorithms(): string;
|
|
15
|
+
_getLanguages(): string;
|
|
16
|
+
_getCurrency(): string;
|
|
17
|
+
_getProductLayout(): string;
|
|
18
|
+
_getFilterStatus(): string;
|
|
19
|
+
_getShuffleProducts(): string;
|
|
20
|
+
_onFilterSelectClick(): void;
|
|
21
|
+
_onDataChange(item: string, value: string | number | string[]): void;
|
|
22
|
+
/**
|
|
23
|
+
* Get the current card composition from block data attribute or use default
|
|
24
|
+
*/
|
|
25
|
+
_getCardComposition(): string[];
|
|
26
|
+
_regenerateProductRows(): void;
|
|
27
|
+
/**
|
|
28
|
+
* Reapply spacing values after product regeneration
|
|
29
|
+
* This ensures spacing persists when products are regenerated
|
|
30
|
+
*/
|
|
31
|
+
_reapplySpacing(): void;
|
|
32
|
+
_debouncedRegenerateProductRows: import("@vueuse/shared").PromisifyFn<() => void>;
|
|
33
|
+
_onCurrencyConfigChange(item: string, value: string | number): void;
|
|
34
|
+
_onCurrencyChange(value: string): void;
|
|
35
|
+
_setProductIdsVisibility(): void;
|
|
36
|
+
_listenToFormUpdates(): void;
|
|
37
|
+
_listenStateUpdates(): void;
|
|
38
|
+
}
|