@useinsider/guido 3.17.0-beta.3e9d6e7 → 3.17.0-beta.3ff6ea0
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 -1
- package/dist/@types/config/schemas.js +6 -12
- package/dist/components/Guido.vue.js +6 -6
- package/dist/components/Guido.vue2.js +61 -63
- package/dist/composables/useCustomInterfaceAppearance.js +16 -19
- package/dist/composables/useRecommendation.js +34 -41
- package/dist/composables/useStripo.js +14 -14
- package/dist/config/migrator/index.js +9 -8
- package/dist/config/migrator/recommendation/compositionMapper.js +20 -20
- package/dist/config/migrator/recommendation/extractors.js +29 -24
- package/dist/config/migrator/recommendation/htmlBuilder.js +116 -130
- package/dist/config/migrator/recommendationMigrator.js +16 -15
- package/dist/config/migrator/recommendationTitleMigrator.js +119 -0
- package/dist/enums/date.js +3 -4
- package/dist/enums/extensions/recommendationBlock.js +23 -25
- package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +20 -21
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +34 -28
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +306 -238
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +95 -122
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +1 -0
- package/dist/extensions/Blocks/Recommendation/controls/title/index.js +44 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +31 -29
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +23 -4
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +53 -199
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +3 -3
- package/dist/extensions/Blocks/Recommendation/templates/titleRows.js +33 -0
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +85 -107
- package/dist/extensions/Blocks/common-control.js +19 -22
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +28 -77
- package/dist/src/@types/config/schemas.d.ts +0 -12
- package/dist/src/composables/useConfig.d.ts +0 -2
- package/dist/src/composables/useRecommendation.d.ts +0 -1
- package/dist/src/config/migrator/recommendation/extractors.d.ts +8 -0
- package/dist/src/config/migrator/recommendationTitleMigrator.d.ts +5 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -2
- package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +2 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +10 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +10 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +3 -12
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +86 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +10 -210
- package/dist/src/extensions/Blocks/Recommendation/templates/titleRows.d.ts +13 -0
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +0 -6
- package/dist/src/extensions/Blocks/common-control.d.ts +1 -4
- package/dist/src/services/recommendationApi.d.ts +1 -4
- package/dist/src/stores/config.d.ts +0 -18
- package/dist/static/styles/customEditorStyle.css.js +3 -1
- package/dist/utils/dateUtil.js +10 -23
- package/dist/utils/templatePreparation.js +34 -37
- package/package.json +1 -2
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +0 -18
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +0 -67
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBox.vue.js +0 -20
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBox.vue2.js +0 -55
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +0 -132
- package/dist/node_modules/@useinsider/design-system-organisms/dist/index-Dc9AygoZ.js +0 -526
- package/dist/node_modules/@useinsider/design-system-organisms/dist/index.js +0 -9345
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InAccordion.js +0 -174
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InBasicTextInput.js +0 -381
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InBox.js +0 -236
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InBulkActions.js +0 -70
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InButton.js +0 -350
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InButtonV2.js +0 -371
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InCheckBox.js +0 -152
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InChips.js +0 -141
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InCustomDropDown.js +0 -1047
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDataTableV2.js +0 -96050
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDatePicker.js +0 -2042
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDrawer.js +0 -166
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDropDown.js +0 -1098
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InIcons.js +0 -55
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InInfoBox.js +0 -265
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InLinks.js +0 -184
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InLoading.js +0 -50
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InModals.js +0 -453
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InNoData.js +0 -145
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InOnPageMessage.js +0 -176
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InProgress.js +0 -266
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InRadioButton.js +0 -114
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InSegments.js +0 -200
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InSelect.js +0 -451
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InSkeleton.js +0 -49
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InStatusText.js +0 -119
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTabs.js +0 -4309
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTagsText.js +0 -129
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTextInput.js +0 -503
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InToasts.js +0 -253
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InToggle.js +0 -107
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTooltip.js +0 -134
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTooltipV2.js +0 -464
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/_commonjsHelpers.BItOPCY9.js +0 -28
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/_plugin-vue2_normalizer.WQT2Fc8L.js +0 -23
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/clickOutside.qP9M0QCm.js +0 -29
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/helpers.CgHNyjAJ.js +0 -109
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/index.Bw_06igr.js +0 -2339
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/localLocalesMixin.DYMhydo2.js +0 -16
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/useLocalLocales.Ckuhy7d-.js +0 -17
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/vue-property-decorator.BtlM7Epa.js +0 -188
- package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +0 -3
- package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBox.vue.d.ts +0 -24
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -37
- package/dist/src/mock/api/recommendation-strategies.d.ts +0 -43
- package/dist/static/styles/components/recommendation-strategy.css.js +0 -171
|
@@ -1,101 +1,52 @@
|
|
|
1
|
-
import { useHttp as
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
(
|
|
5
|
-
attributeName:
|
|
6
|
-
attributeJs:
|
|
7
|
-
attributeType:
|
|
8
|
-
type:
|
|
9
|
-
displayName:
|
|
10
|
-
isFilterable:
|
|
11
|
-
},
|
|
1
|
+
import { useHttp as d } from "../composables/useHttp.js";
|
|
2
|
+
import { QUERY_PARAMS as l, URLS as u } from "../enums/extensions/recommendationBlock.js";
|
|
3
|
+
const R = (o) => o.reduce(
|
|
4
|
+
(a, t, s) => (a[s] = {
|
|
5
|
+
attributeName: t.attributeName,
|
|
6
|
+
attributeJs: t.attributeJs,
|
|
7
|
+
attributeType: t.attributeType,
|
|
8
|
+
type: t.type,
|
|
9
|
+
displayName: t.displayName,
|
|
10
|
+
isFilterable: t.isFilterable
|
|
11
|
+
}, a),
|
|
12
12
|
{}
|
|
13
|
-
),
|
|
14
|
-
const { get:
|
|
13
|
+
), f = () => {
|
|
14
|
+
const { get: o } = d(), { get: a } = d({ headers: {} }), t = "6KcLM9TwheVB1mgK";
|
|
15
15
|
return {
|
|
16
16
|
fetchRecommendationCreateData: async () => {
|
|
17
17
|
try {
|
|
18
|
-
return (await
|
|
18
|
+
return (await o("/newsletter/recommendations/create-data")).data;
|
|
19
19
|
} catch (e) {
|
|
20
20
|
throw console.error("fetchUserModalState error:", e), e;
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
fetchRecommendationFilters: async () => {
|
|
24
24
|
try {
|
|
25
|
-
const { data: e } = await
|
|
26
|
-
|
|
27
|
-
),
|
|
28
|
-
return
|
|
25
|
+
const { data: e } = await o(
|
|
26
|
+
u.PRODUCT_ATTRIBUTES_PATH
|
|
27
|
+
), n = Array.isArray(e) ? e : (e == null ? void 0 : e.data) ?? [];
|
|
28
|
+
return R(n);
|
|
29
29
|
} catch (e) {
|
|
30
30
|
throw console.error("fetchRecommendationFilters error:", e), e;
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
|
-
fetchRecommendationProducts: async (e,
|
|
34
|
-
var
|
|
33
|
+
fetchRecommendationProducts: async (e, n) => {
|
|
34
|
+
var i;
|
|
35
35
|
try {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
const m = decodeURIComponent(
|
|
36
|
+
const r = new URLSearchParams(Object.entries(n));
|
|
37
|
+
r.set(l.CLIENT_ID, t);
|
|
38
|
+
const m = decodeURIComponent(r.toString());
|
|
39
39
|
console.debug("🏁 Recommendation API Query:", m);
|
|
40
|
-
const
|
|
41
|
-
`${
|
|
40
|
+
const c = await a(
|
|
41
|
+
`${u.RECOMMENDATION_API_URL}/v2/${e}?${m}`
|
|
42
42
|
);
|
|
43
|
-
return ((
|
|
44
|
-
} catch (o) {
|
|
45
|
-
throw console.error("fetchRecommendationProducts error:", o), o;
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
fetchRecommendationProductsByUrl: async (e) => {
|
|
49
|
-
var r;
|
|
50
|
-
try {
|
|
51
|
-
const t = new URL(e);
|
|
52
|
-
t.searchParams.has(R.CLIENT_ID) || t.searchParams.set(R.CLIENT_ID, i);
|
|
53
|
-
const o = await a(
|
|
54
|
-
decodeURIComponent(t.toString())
|
|
55
|
-
);
|
|
56
|
-
return ((r = o == null ? void 0 : o.data) == null ? void 0 : r.data) ?? [];
|
|
57
|
-
} catch (t) {
|
|
58
|
-
throw console.error("fetchRecommendationProductsByUrl error:", t), t;
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
fetchRecommendationStrategies: async () => {
|
|
62
|
-
try {
|
|
63
|
-
const e = /* @__PURE__ */ new Map();
|
|
64
|
-
let r = 1;
|
|
65
|
-
for (; ; ) {
|
|
66
|
-
const { data: t } = await c(
|
|
67
|
-
`${d.RECOMMENDATION_STRATEGIES_PATH}?filters=${encodeURIComponent(l)}&per_page=${y}&page=${r}`
|
|
68
|
-
), o = Array.isArray(t) ? t : (t == null ? void 0 : t.data) ?? [], m = e.size;
|
|
69
|
-
if (o.forEach((n) => e.set(n.strategy_id, n)), o.length < y || e.size === m)
|
|
70
|
-
break;
|
|
71
|
-
r += 1;
|
|
72
|
-
}
|
|
73
|
-
return [...e.values()];
|
|
74
|
-
} catch (e) {
|
|
75
|
-
throw console.error("fetchRecommendationStrategies error:", e), e;
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
generateStrategyEndpoint: async (e) => {
|
|
79
|
-
try {
|
|
80
|
-
const { data: r } = await s(
|
|
81
|
-
`${d.RECOMMENDATION_STRATEGIES_PATH}/endpoint-generate`,
|
|
82
|
-
{
|
|
83
|
-
// Email designs have no campaign yet; backend only needs it
|
|
84
|
-
// for previewer flows.
|
|
85
|
-
campaignId: 0,
|
|
86
|
-
pageTypes: [],
|
|
87
|
-
isPreviewer: !1,
|
|
88
|
-
strategy: e,
|
|
89
|
-
userId: ""
|
|
90
|
-
}
|
|
91
|
-
);
|
|
92
|
-
return r.data;
|
|
43
|
+
return ((i = c == null ? void 0 : c.data) == null ? void 0 : i.data) ?? [];
|
|
93
44
|
} catch (r) {
|
|
94
|
-
throw console.error("
|
|
45
|
+
throw console.error("fetchRecommendationProducts error:", r), r;
|
|
95
46
|
}
|
|
96
47
|
}
|
|
97
48
|
};
|
|
98
49
|
};
|
|
99
50
|
export {
|
|
100
|
-
|
|
51
|
+
f as useRecommendationApi
|
|
101
52
|
};
|
|
@@ -395,12 +395,6 @@ export declare const FeaturesSchema: v.ObjectSchema<{
|
|
|
395
395
|
readonly allowlistEnabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
396
396
|
/** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
|
|
397
397
|
readonly linkTrackingIds: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
398
|
-
/**
|
|
399
|
-
* Assign a Reusable Recommendation Strategy (RRS) to recommendation blocks instead of
|
|
400
|
-
* per-block algorithm settings. Hides Algorithm, Filters, Shuffle and Number of Products
|
|
401
|
-
* (they live on the strategy) and adds the Assign Strategy flow.
|
|
402
|
-
*/
|
|
403
|
-
readonly reusableRecommendationStrategy: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
404
398
|
}, undefined>;
|
|
405
399
|
/**
|
|
406
400
|
* Default block types available in Stripo
|
|
@@ -800,12 +794,6 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
800
794
|
readonly allowlistEnabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
801
795
|
/** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
|
|
802
796
|
readonly linkTrackingIds: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
803
|
-
/**
|
|
804
|
-
* Assign a Reusable Recommendation Strategy (RRS) to recommendation blocks instead of
|
|
805
|
-
* per-block algorithm settings. Hides Algorithm, Filters, Shuffle and Number of Products
|
|
806
|
-
* (they live on the strategy) and adds the Assign Strategy flow.
|
|
807
|
-
*/
|
|
808
|
-
readonly reusableRecommendationStrategy: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
809
797
|
}, undefined>, {}>;
|
|
810
798
|
/** Block configuration */
|
|
811
799
|
readonly blocks: v.OptionalSchema<v.ObjectSchema<{
|
|
@@ -99,7 +99,6 @@ export declare const useConfig: () => {
|
|
|
99
99
|
autosave: boolean;
|
|
100
100
|
allowlistEnabled: boolean;
|
|
101
101
|
linkTrackingIds: boolean;
|
|
102
|
-
reusableRecommendationStrategy: boolean;
|
|
103
102
|
};
|
|
104
103
|
blocks: {
|
|
105
104
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -234,7 +233,6 @@ export declare const useConfig: () => {
|
|
|
234
233
|
autosave: boolean;
|
|
235
234
|
allowlistEnabled: boolean;
|
|
236
235
|
linkTrackingIds: boolean;
|
|
237
|
-
reusableRecommendationStrategy: boolean;
|
|
238
236
|
} | null>;
|
|
239
237
|
blocks: import("vue").ComputedRef<{
|
|
240
238
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -18,7 +18,6 @@ export declare const useRecommendation: () => {
|
|
|
18
18
|
getRecommendationCampaignData: (id: string) => CampaignData;
|
|
19
19
|
buildCampaignUrl: (campaignId: string, overrides?: {
|
|
20
20
|
strategy: string;
|
|
21
|
-
strategyId: string;
|
|
22
21
|
language: string;
|
|
23
22
|
currencyCode: string;
|
|
24
23
|
size: string;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
export declare function extractTitleText(block: Element): string;
|
|
2
|
+
/**
|
|
3
|
+
* Fallback for legacy configs that carry no `p_recommendation_title` variable:
|
|
4
|
+
* the rendered HTML decides. A missing or `display: none` title container means
|
|
5
|
+
* the user never saw a title, so the migrated block keeps it toggled off.
|
|
6
|
+
* @param block - The legacy recommendation block element
|
|
7
|
+
* @returns True when the legacy block renders a visible title
|
|
8
|
+
*/
|
|
9
|
+
export declare function hasVisibleTitle(block: Element): boolean;
|
|
2
10
|
/**
|
|
3
11
|
* Card background lives on either the block (`bgcolor`/`style`) or per-card
|
|
4
12
|
* cells (`.product-card`). Returns empty string when no background is set —
|
|
@@ -3,9 +3,7 @@ import type { RecommendationFeedItem } from '@@/Types/recommendation';
|
|
|
3
3
|
export declare const URLS: {
|
|
4
4
|
RECOMMENDATION_API_URL: string;
|
|
5
5
|
PRODUCT_ATTRIBUTES_PATH: string;
|
|
6
|
-
RECOMMENDATION_STRATEGIES_PATH: string;
|
|
7
6
|
};
|
|
8
|
-
export declare const RRS_ACTIVE_EMAIL_FILTER = "[sr_strategies.status][=][active]*[sr_strategies.suitable_channels][~][EMAIL]";
|
|
9
7
|
export declare const QUERY_PARAMS: {
|
|
10
8
|
CLIENT_ID: string;
|
|
11
9
|
};
|
|
@@ -10,5 +10,6 @@ export declare enum RecommendationBlockId {
|
|
|
10
10
|
OMNIBUS_PRICE = "recommendation-block-omnibus-price",
|
|
11
11
|
OMNIBUS_DISCOUNT = "recommendation-block-omnibus-discount",
|
|
12
12
|
IMAGE = "recommendation-block-image",
|
|
13
|
-
CUSTOM_ATTRIBUTE = "recommendation-block-custom-attribute"
|
|
13
|
+
CUSTOM_ATTRIBUTE = "recommendation-block-custom-attribute",
|
|
14
|
+
TITLE = "recommendation-block-title"
|
|
14
15
|
}
|
|
@@ -65,5 +65,12 @@ export declare enum RecommendationControlId {
|
|
|
65
65
|
CUSTOM_ATTR_SIZE = "recommendation-block-custom-attr-size-control",
|
|
66
66
|
CUSTOM_ATTR_STYLE = "recommendation-block-custom-attr-style-control",
|
|
67
67
|
CUSTOM_ATTR_TEXT_TRIM = "recommendation-block-custom-attr-text-trim-control",
|
|
68
|
+
TITLE_ALIGN = "recommendation-block-title-align-control",
|
|
69
|
+
TITLE_BACKGROUND = "recommendation-block-title-background-control",
|
|
70
|
+
TITLE_COLOR = "recommendation-block-title-color-control",
|
|
71
|
+
TITLE_FONT_FAMILY = "recommendation-block-title-font-family-control",
|
|
72
|
+
TITLE_PADDINGS = "recommendation-block-title-paddings-control",
|
|
73
|
+
TITLE_SIZE = "recommendation-block-title-size-control",
|
|
74
|
+
TITLE_STYLE = "recommendation-block-title-style-control",
|
|
68
75
|
SYNC_INFO_MESSAGE = "recommendation-block-sync-info-message"
|
|
69
76
|
}
|
|
@@ -32,6 +32,7 @@ export declare const DEFAULT_COMPOSITION: string[];
|
|
|
32
32
|
/**
|
|
33
33
|
* Default visibility settings for card elements
|
|
34
34
|
* Omnibus elements are hidden by default (not all regions require them)
|
|
35
|
+
* The block-level title is visible on a fresh drop.
|
|
35
36
|
*/
|
|
36
37
|
export declare const DEFAULT_VISIBILITY: Record<string, boolean>;
|
|
37
38
|
/**
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export { RecommendationBlockId } from './blockIds';
|
|
10
10
|
export { RecommendationControlId } from './controlIds';
|
|
11
|
-
export { BLOCK_ROOT_SELECTOR, CONTAINER_SELECTOR, DESKTOP_CONTAINER_SELECTOR, MOBILE_CONTAINER_SELECTOR, MOBILE_ROW_SELECTOR, CSS_CLASS_RECO_BUTTON, CSS_CLASS_SKIP_COMPILE, RECOMMENDATION_VARIABLE_BUILTIN_ATTRIBUTES, CURRENCY_ATTR, ATTR_PRODUCT_IMAGE, ATTR_PRODUCT_NAME, ATTR_PRODUCT_PRICE, ATTR_PRODUCT_OLD_PRICE, ATTR_PRODUCT_OMNIBUS_PRICE, ATTR_PRODUCT_OMNIBUS_DISCOUNT, ATTR_PRODUCT_BUTTON, ATTR_CUSTOM_PREFIX, ATTR_DATA_CARD_COMPOSITION, ATTR_DATA_CUSTOM_ATTRIBUTES, ATTR_PRODUCT_ATTR, SELECTOR_ATTRIBUTE_ROW, ATTR_DATA_ATTRIBUTE_TYPE, PRODUCT_ATTRIBUTE_PREFIX, BUILT_IN_DEFAULT_ATTRIBUTES, } from './selectors';
|
|
11
|
+
export { BLOCK_ROOT_SELECTOR, CONTAINER_SELECTOR, DESKTOP_CONTAINER_SELECTOR, MOBILE_CONTAINER_SELECTOR, MOBILE_ROW_SELECTOR, CSS_CLASS_RECO_BUTTON, CSS_CLASS_SKIP_COMPILE, RECOMMENDATION_VARIABLE_BUILTIN_ATTRIBUTES, CURRENCY_ATTR, ATTR_PRODUCT_IMAGE, ATTR_PRODUCT_NAME, ATTR_PRODUCT_PRICE, ATTR_PRODUCT_OLD_PRICE, ATTR_PRODUCT_OMNIBUS_PRICE, ATTR_PRODUCT_OMNIBUS_DISCOUNT, ATTR_PRODUCT_BUTTON, ATTR_RECOMMENDATION_TITLE, SELECTOR_TITLE_CELL, ATTR_CUSTOM_PREFIX, ATTR_DATA_CARD_COMPOSITION, ATTR_DATA_CUSTOM_ATTRIBUTES, ATTR_PRODUCT_ATTR, CSS_CLASS_ATTRIBUTE_ROW, CSS_CLASS_SPACER, SELECTOR_ATTRIBUTE_ROW, ATTR_DATA_ATTRIBUTE_TYPE, ATTR_DATA_VISIBILITY, PRODUCT_ATTRIBUTE_PREFIX, BUILT_IN_DEFAULT_ATTRIBUTES, } from './selectors';
|
|
12
12
|
export { LAYOUT_VALUES, LAYOUT_OPTIONS, DEFAULT_PRODUCTS_PER_ROW, DEFAULT_CARDS_IN_ROW, DEFAULT_MOBILE_CARDS_IN_ROW, MAX_PRODUCT_COUNT, MIN_PRODUCT_COUNT, MAX_PRODUCTS_PER_ROW, MIN_PRODUCTS_PER_ROW, MAX_MOBILE_PRODUCTS_PER_ROW, MIN_MOBILE_PRODUCTS_PER_ROW, DEFAULT_COLUMN_SPACING, DEFAULT_ROW_SPACING, DEFAULT_MOBILE_COLUMN_SPACING, DEFAULT_MOBILE_ROW_SPACING, MIN_SPACING, MAX_SPACING, SPACING_STEP, } from './layout';
|
|
13
13
|
export { DEFAULT_NODE_CONFIG, DEFAULT_CURRENCY, DEFAULT_COMPOSITION, DEFAULT_VISIBILITY, CURRENT_CONFIG_VERSION, EXCLUDED_ALGORITHM_IDS, } from './defaultConfig';
|
|
@@ -58,6 +58,10 @@ export declare const ATTR_PRODUCT_OLD_PRICE = "productOldPrice";
|
|
|
58
58
|
export declare const ATTR_PRODUCT_OMNIBUS_PRICE = "productOmnibusPrice";
|
|
59
59
|
export declare const ATTR_PRODUCT_OMNIBUS_DISCOUNT = "productOmnibusDiscount";
|
|
60
60
|
export declare const ATTR_PRODUCT_BUTTON = "productButton";
|
|
61
|
+
export declare const ATTR_RECOMMENDATION_TITLE = "recommendationTitle";
|
|
62
|
+
export declare const CSS_CLASS_TITLE_CELL = "ins-recommendation-title";
|
|
63
|
+
/** Title cell — the only `esd-block-text` living outside the product containers. */
|
|
64
|
+
export declare const SELECTOR_TITLE_CELL = ".ins-recommendation-title";
|
|
61
65
|
/**
|
|
62
66
|
* Custom attribute constants
|
|
63
67
|
* Used for dynamically added product attributes in Card Composition
|
|
@@ -70,10 +74,16 @@ export declare const ATTR_DATA_CUSTOM_ATTRIBUTES = "data-custom-attributes";
|
|
|
70
74
|
export declare const ATTR_DATA_CARD_COMPOSITION = "data-card-composition";
|
|
71
75
|
/** HTML attribute on <td> elements identifying the product attribute for compiler template variable generation */
|
|
72
76
|
export declare const ATTR_PRODUCT_ATTR = "product-attr";
|
|
77
|
+
/** Class every composition attribute row carries — the visibility toggle and the compiler both key on it */
|
|
78
|
+
export declare const CSS_CLASS_ATTRIBUTE_ROW = "recommendation-attribute-row";
|
|
73
79
|
/** Row wrapper of one composition entry inside a product card */
|
|
74
80
|
export declare const SELECTOR_ATTRIBUTE_ROW = ".recommendation-attribute-row";
|
|
75
81
|
/** HTML attribute on an attribute row holding its composition key */
|
|
76
82
|
export declare const ATTR_DATA_ATTRIBUTE_TYPE = "data-attribute-type";
|
|
83
|
+
/** HTML attribute on an attribute row holding its visibility (`1` / `0`) */
|
|
84
|
+
export declare const ATTR_DATA_VISIBILITY = "data-visibility";
|
|
85
|
+
/** Class on the spacer cell of the row that trails a title */
|
|
86
|
+
export declare const CSS_CLASS_SPACER = "spacer";
|
|
77
87
|
/** Prefix `resolveProductAttrValue` puts on custom (non-default) product attributes in `product-attr` values */
|
|
78
88
|
export declare const PRODUCT_ATTRIBUTE_PREFIX = "product_attribute.";
|
|
79
89
|
/**
|
|
@@ -33,6 +33,8 @@ export declare class RecommendationCardCompositionControl extends CommonControl
|
|
|
33
33
|
private _normalizeComposition;
|
|
34
34
|
private _readCustomAttributesFromNode;
|
|
35
35
|
private _readVisibilityFromRows;
|
|
36
|
+
private _withTitlePresence;
|
|
37
|
+
private _hasTitle;
|
|
36
38
|
private _getDefaultVisibilities;
|
|
37
39
|
private _extractVisibilityFromRows;
|
|
38
40
|
private _parseVisibilityValue;
|
|
@@ -187,6 +189,14 @@ export declare class RecommendationCardCompositionControl extends CommonControl
|
|
|
187
189
|
*/
|
|
188
190
|
private _buildCompositionHtml;
|
|
189
191
|
private _applyVisibilityToBlock;
|
|
192
|
+
private _applyTitleVisibilityToBlock;
|
|
193
|
+
private _resolveTitleInjection;
|
|
194
|
+
private _findTitleRows;
|
|
195
|
+
private _findTitleRowsByClass;
|
|
196
|
+
private _isSpacerRow;
|
|
197
|
+
private _findTitleContainerBody;
|
|
198
|
+
private _readInnerHtml;
|
|
199
|
+
private _defaultTitleParagraph;
|
|
190
200
|
/**
|
|
191
201
|
* Finds the composition array index for the Nth custom attribute (0-based).
|
|
192
202
|
* Scans left-to-right, counting only entries with the custom prefix.
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
export { RecommendationBlockControl, CONTROL_BLOCK_ID, AlgorithmControl, ALGORITHM_CONTROL_ID, LocaleControl, LOCALE_CONTROL_ID, CurrencyControl, CURRENCY_CONTROL_ID, ProductCountControl, PRODUCT_COUNT_CONTROL_ID, ProductLayoutControl, PRODUCT_LAYOUT_CONTROL_ID, FiltersControl, FILTERS_CONTROL_ID, ShuffleControl, SHUFFLE_CONTROL_ID, LayoutOrientationControl, LAYOUT_ORIENTATION_CONTROL_ID, PricePlacementControl, PRICE_PLACEMENT_CONTROL_ID, } from './main';
|
|
13
13
|
export * from './main/utils';
|
|
14
|
+
export { TitleControls } from './title';
|
|
14
15
|
export { NameControls } from './name';
|
|
15
16
|
export { PriceControls } from './price';
|
|
16
17
|
export { OldPriceControls } from './oldPrice';
|
|
@@ -9,9 +9,8 @@ import { PricePlacementControl, PRICE_PLACEMENT_CONTROL_ID } from './pricePlacem
|
|
|
9
9
|
import { ProductCountControl, PRODUCT_COUNT_CONTROL_ID } from './productCount';
|
|
10
10
|
import { ProductLayoutControl, PRODUCT_LAYOUT_CONTROL_ID } from './productLayout';
|
|
11
11
|
import { ShuffleControl, SHUFFLE_CONTROL_ID } from './shuffle';
|
|
12
|
-
import { StrategyControl, STRATEGY_CONTROL_ID } from './strategy';
|
|
13
12
|
export declare const CONTROL_BLOCK_ID = "ui-elements-recommendation-block";
|
|
14
|
-
export { AlgorithmControl, ALGORITHM_CONTROL_ID, LocaleControl, LOCALE_CONTROL_ID, CurrencyControl, CURRENCY_CONTROL_ID, ProductCountControl, PRODUCT_COUNT_CONTROL_ID, ProductLayoutControl, PRODUCT_LAYOUT_CONTROL_ID, FiltersControl, FILTERS_CONTROL_ID, ShuffleControl, SHUFFLE_CONTROL_ID, LayoutOrientationControl, LAYOUT_ORIENTATION_CONTROL_ID, PricePlacementControl, PRICE_PLACEMENT_CONTROL_ID,
|
|
13
|
+
export { AlgorithmControl, ALGORITHM_CONTROL_ID, LocaleControl, LOCALE_CONTROL_ID, CurrencyControl, CURRENCY_CONTROL_ID, ProductCountControl, PRODUCT_COUNT_CONTROL_ID, ProductLayoutControl, PRODUCT_LAYOUT_CONTROL_ID, FiltersControl, FILTERS_CONTROL_ID, ShuffleControl, SHUFFLE_CONTROL_ID, LayoutOrientationControl, LAYOUT_ORIENTATION_CONTROL_ID, PricePlacementControl, PRICE_PLACEMENT_CONTROL_ID, };
|
|
15
14
|
export * from './utils';
|
|
16
15
|
/**
|
|
17
16
|
* Main recommendation block control that composes all sub-controls
|
|
@@ -30,7 +29,6 @@ export declare class RecommendationBlockControl extends CommonControl {
|
|
|
30
29
|
private shuffleControl;
|
|
31
30
|
private pricePlacementControl;
|
|
32
31
|
private layoutOrientationControl;
|
|
33
|
-
private strategyControl;
|
|
34
32
|
getId(): string;
|
|
35
33
|
getTemplate(): string;
|
|
36
34
|
onRender(): Promise<void>;
|
|
@@ -109,15 +107,8 @@ export declare class RecommendationBlockControl extends CommonControl {
|
|
|
109
107
|
*/
|
|
110
108
|
private _listenStateUpdates;
|
|
111
109
|
/**
|
|
112
|
-
* Persists the current filter
|
|
113
|
-
*
|
|
114
|
-
* (strategyId must be in esd-ext-config before any save — SD-149105).
|
|
115
|
-
*
|
|
116
|
-
* `size` rides along because assigning a strategy overwrites it in the
|
|
117
|
-
* store only. Without this write, `_syncNodeConfigToStore` re-seeds the
|
|
118
|
-
* store from the stale node config on the next panel open, and a block
|
|
119
|
-
* whose saved HTML has the strategy's slot count gets rebuilt against the
|
|
120
|
-
* old one — resetting migrator-applied per-element styles.
|
|
110
|
+
* Persists the current filter state from Pinia store to the Stripo node config.
|
|
111
|
+
* This ensures filters survive template save/reload cycles.
|
|
121
112
|
*/
|
|
122
113
|
private _persistFiltersToNodeConfig;
|
|
123
114
|
}
|
|
@@ -70,6 +70,7 @@ export interface RegenerateProductRowsOptions {
|
|
|
70
70
|
/** Optional: pass composition directly to avoid stale DOM reads after setAttribute */
|
|
71
71
|
composition?: string[];
|
|
72
72
|
}
|
|
73
|
+
export declare function getMainContainerTbody(currentNode: ImmutableHtmlNode): ImmutableHtmlNode | null;
|
|
73
74
|
/**
|
|
74
75
|
* Regenerates only the mobile product container rows and commits in a single apply().
|
|
75
76
|
* Standalone entry point for callers that change mobile-only settings
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export declare const TitleControls: {
|
|
2
|
+
readonly align: {
|
|
3
|
+
new (): {
|
|
4
|
+
getId(): string;
|
|
5
|
+
getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
|
|
6
|
+
getParentControlId(): string;
|
|
7
|
+
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
8
|
+
getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
|
|
9
|
+
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
10
|
+
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;
|
|
11
|
+
isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
readonly color: {
|
|
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 size: {
|
|
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 style: {
|
|
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 fontFamily: {
|
|
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 background: {
|
|
63
|
+
new (): {
|
|
64
|
+
getId(): string;
|
|
65
|
+
getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
|
|
66
|
+
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;
|
|
67
|
+
getParentControlId(): string;
|
|
68
|
+
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
69
|
+
getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
|
|
70
|
+
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
71
|
+
isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
readonly paddings: {
|
|
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
|
+
};
|