@useinsider/guido 3.17.0-beta.ec8eabb → 3.17.0-beta.edf4165
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 +1 -0
- package/dist/@types/config/schemas.js +7 -6
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +100 -97
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +21 -0
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +106 -0
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.js +19 -0
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +63 -0
- package/dist/components/organisms/header/EditorActions.vue.js +1 -1
- package/dist/components/organisms/header/EditorActions.vue2.js +36 -44
- package/dist/composables/useActionsApi.js +67 -82
- package/dist/composables/useAutoSave.js +26 -31
- package/dist/composables/useCustomInterfaceAppearance.js +52 -38
- package/dist/composables/useGuidoStateBridge.js +30 -31
- package/dist/composables/useRecommendation.js +41 -34
- package/dist/composables/useSave.js +36 -40
- package/dist/config/migrator/recommendation/settingsMapper.js +17 -17
- package/dist/config/migrator/recommendationMigrator.js +5 -4
- package/dist/enums/academy.js +2 -1
- package/dist/enums/date.js +5 -3
- package/dist/enums/extensions/recommendationBlock.js +3 -1
- package/dist/extensions/Blocks/Recommendation/block.js +26 -21
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +34 -34
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +96 -95
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +162 -166
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +124 -0
- package/dist/extensions/Blocks/Recommendation/services/configService.js +35 -35
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +165 -79
- package/dist/extensions/Blocks/common-control.js +22 -19
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +69 -30
- package/dist/src/@types/config/schemas.d.ts +2 -0
- package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +3 -0
- package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts +15 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useRecommendation.d.ts +1 -0
- package/dist/src/enums/academy.d.ts +1 -0
- package/dist/src/enums/date.d.ts +1 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +2 -6
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +10 -4
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +16 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +150 -10
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +1 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +4 -1
- package/dist/src/mock/api/recommendation-strategies.d.ts +2 -0
- package/dist/src/services/recommendationApi.d.ts +4 -1
- package/dist/src/stores/config.d.ts +18 -0
- package/dist/src/stores/save-as-template.d.ts +4 -3
- package/dist/src/utils/genericUtil.d.ts +5 -0
- package/dist/static/assets/icons/line-change.svg.js +5 -0
- package/dist/static/assets/icons/line-delete.svg.js +5 -0
- package/dist/static/assets/icons/line-plus.svg.js +5 -0
- package/dist/static/styles/components/recommendation-strategy.css.js +155 -0
- package/dist/utils/dateUtil.js +23 -10
- package/dist/utils/genericUtil.js +28 -27
- package/dist/utils/templatePreparation.js +35 -34
- package/package.json +2 -1
- package/dist/composables/useEditorLock.js +0 -18
- package/dist/src/composables/useEditorLock.d.ts +0 -11
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var c = Object.defineProperty;
|
|
2
|
-
var i = (
|
|
3
|
-
var
|
|
2
|
+
var i = (l, a, e) => a in l ? c(l, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[a] = e;
|
|
3
|
+
var T = (l, a, e) => i(l, typeof a != "symbol" ? a + "" : a, e);
|
|
4
4
|
import { Control as I, UIElementType as n, UEAttr as $ } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
|
-
class
|
|
5
|
+
class _ extends I {
|
|
6
6
|
constructor() {
|
|
7
7
|
super(...arguments);
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
T(this, "currentNode");
|
|
9
|
+
T(this, "lastBlockInstanceId", null);
|
|
10
10
|
}
|
|
11
11
|
getContainer() {
|
|
12
12
|
var e;
|
|
@@ -91,21 +91,21 @@ class d extends I {
|
|
|
91
91
|
* and combines it with the text in Stripo's alert-message layout.
|
|
92
92
|
*/
|
|
93
93
|
_setInfoMessageValue(e, t) {
|
|
94
|
-
const E = this.getContainer(), o = E.querySelector(`[data-icon-key="${e}"]`),
|
|
94
|
+
const E = this.getContainer(), o = E.querySelector(`[data-icon-key="${e}"]`), r = o == null ? void 0 : o.querySelector("ue-icon-component"), s = (r == null ? void 0 : r.outerHTML) ?? "";
|
|
95
95
|
this.api.setUIEAttribute(
|
|
96
96
|
e,
|
|
97
97
|
"value",
|
|
98
98
|
`
|
|
99
99
|
<div class="service-element alert-message-main" style="align-items: start;">
|
|
100
|
-
${
|
|
100
|
+
${s}
|
|
101
101
|
<div class="service-element alert-message-text">
|
|
102
102
|
${t}
|
|
103
103
|
</div>
|
|
104
104
|
</div>
|
|
105
105
|
`
|
|
106
106
|
);
|
|
107
|
-
const
|
|
108
|
-
|
|
107
|
+
const u = E.querySelector(`[data-info-message="${e}"]`);
|
|
108
|
+
u && (u.style.display = "");
|
|
109
109
|
}
|
|
110
110
|
_GuToggle(e) {
|
|
111
111
|
return `
|
|
@@ -126,15 +126,15 @@ class d extends I {
|
|
|
126
126
|
placeholder: t,
|
|
127
127
|
options: E,
|
|
128
128
|
className: o = "es-180w",
|
|
129
|
-
searchable:
|
|
129
|
+
searchable: r = !1
|
|
130
130
|
}) {
|
|
131
131
|
return `
|
|
132
132
|
<${n.SELECTPICKER}
|
|
133
133
|
class="${o}"
|
|
134
134
|
${$.SELECTPICKER.name}="${e}"
|
|
135
|
-
${
|
|
135
|
+
${r ? `${$.SELECTPICKER.searchable}="true"` : ""}
|
|
136
136
|
${$.SELECTPICKER.placeholder}="${t}">
|
|
137
|
-
${E.map((
|
|
137
|
+
${E.map((s) => this._GuSelectItem(s)).join("")}
|
|
138
138
|
</${n.SELECTPICKER}>
|
|
139
139
|
`;
|
|
140
140
|
}
|
|
@@ -176,12 +176,15 @@ class d extends I {
|
|
|
176
176
|
</${n.RADIO_BUTTONS}>
|
|
177
177
|
`;
|
|
178
178
|
}
|
|
179
|
-
_GuButton({ name: e, label: t, id: E = "" }) {
|
|
179
|
+
_GuButton({ name: e, label: t, id: E = "", className: o = "", icon: r = "", disabled: s = !1 }) {
|
|
180
180
|
return `
|
|
181
181
|
<${n.BUTTON}
|
|
182
182
|
${$.BUTTON.name}="${e}"
|
|
183
183
|
${E ? `id="${E}"` : ""}
|
|
184
|
-
${
|
|
184
|
+
${o ? `class="${o}"` : ""}
|
|
185
|
+
${r ? `${$.BUTTON.icon}="${r}"` : ""}
|
|
186
|
+
${s ? `${$.BUTTON.disabled}="true"` : ""}
|
|
187
|
+
${$.BUTTON.caption}="${t}">
|
|
185
188
|
</${n.BUTTON}>
|
|
186
189
|
`;
|
|
187
190
|
}
|
|
@@ -230,11 +233,11 @@ class d extends I {
|
|
|
230
233
|
*/
|
|
231
234
|
_GuOrderable(e, t) {
|
|
232
235
|
let E = "";
|
|
233
|
-
t.forEach((
|
|
234
|
-
const
|
|
236
|
+
t.forEach((r) => {
|
|
237
|
+
const s = $.ORDERABLE_ITEM && "name" in $.ORDERABLE_ITEM ? $.ORDERABLE_ITEM.name : "name";
|
|
235
238
|
E += `
|
|
236
|
-
<${n.ORDERABLE_ITEM} ${
|
|
237
|
-
${
|
|
239
|
+
<${n.ORDERABLE_ITEM} ${s}="${r.key}">
|
|
240
|
+
${r.content}
|
|
238
241
|
</${n.ORDERABLE_ITEM}>
|
|
239
242
|
`;
|
|
240
243
|
});
|
|
@@ -305,5 +308,5 @@ class d extends I {
|
|
|
305
308
|
}
|
|
306
309
|
}
|
|
307
310
|
export {
|
|
308
|
-
|
|
311
|
+
_ as CommonControl
|
|
309
312
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
@charset "UTF-8";.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-6e711fd7]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-e6f99d29]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-e6f99d29]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-e6f99d29]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-2580a7d9]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-2580a7d9] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}
|
|
@@ -1,52 +1,91 @@
|
|
|
1
|
-
import { useHttp as
|
|
2
|
-
import {
|
|
3
|
-
const R = (
|
|
4
|
-
(
|
|
5
|
-
attributeName:
|
|
6
|
-
attributeJs:
|
|
7
|
-
attributeType:
|
|
8
|
-
type:
|
|
9
|
-
displayName:
|
|
10
|
-
isFilterable:
|
|
11
|
-
},
|
|
1
|
+
import { useHttp as l } from "../composables/useHttp.js";
|
|
2
|
+
import { URLS as m, QUERY_PARAMS as u } from "../enums/extensions/recommendationBlock.js";
|
|
3
|
+
const y = "[sr_strategies.status][=][active]*[sr_strategies.suitable_channels][~][EMAIL]", R = (c) => c.reduce(
|
|
4
|
+
(s, r, i) => (s[i] = {
|
|
5
|
+
attributeName: r.attributeName,
|
|
6
|
+
attributeJs: r.attributeJs,
|
|
7
|
+
attributeType: r.attributeType,
|
|
8
|
+
type: r.type,
|
|
9
|
+
displayName: r.displayName,
|
|
10
|
+
isFilterable: r.isFilterable
|
|
11
|
+
}, s),
|
|
12
12
|
{}
|
|
13
|
-
),
|
|
14
|
-
const { get:
|
|
13
|
+
), _ = () => {
|
|
14
|
+
const { get: c, post: s } = l(), { get: r } = l({ headers: {} }), i = "6KcLM9TwheVB1mgK";
|
|
15
15
|
return {
|
|
16
16
|
fetchRecommendationCreateData: async () => {
|
|
17
17
|
try {
|
|
18
|
-
return (await
|
|
18
|
+
return (await c("/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 R(
|
|
25
|
+
const { data: e } = await c(
|
|
26
|
+
m.PRODUCT_ATTRIBUTES_PATH
|
|
27
|
+
), o = Array.isArray(e) ? e : (e == null ? void 0 : e.data) ?? [];
|
|
28
|
+
return R(o);
|
|
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, o) => {
|
|
34
|
+
var t;
|
|
35
35
|
try {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
console.debug("🏁 Recommendation API Query:",
|
|
40
|
-
const
|
|
41
|
-
`${
|
|
36
|
+
const n = new URLSearchParams(Object.entries(o));
|
|
37
|
+
n.set(u.CLIENT_ID, i);
|
|
38
|
+
const d = decodeURIComponent(n.toString());
|
|
39
|
+
console.debug("🏁 Recommendation API Query:", d);
|
|
40
|
+
const a = await r(
|
|
41
|
+
`${m.RECOMMENDATION_API_URL}/v2/${e}?${d}`
|
|
42
42
|
);
|
|
43
|
-
return ((
|
|
44
|
-
} catch (
|
|
45
|
-
throw console.error("fetchRecommendationProducts error:",
|
|
43
|
+
return ((t = a == null ? void 0 : a.data) == null ? void 0 : t.data) ?? [];
|
|
44
|
+
} catch (n) {
|
|
45
|
+
throw console.error("fetchRecommendationProducts error:", n), n;
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
fetchRecommendationProductsByUrl: async (e) => {
|
|
49
|
+
var o;
|
|
50
|
+
try {
|
|
51
|
+
const t = new RegExp(`[?&]${u.CLIENT_ID}=`).test(e), n = e.includes("?") ? "&" : "?", d = t ? e : `${e}${n}${u.CLIENT_ID}=${i}`, a = await r(
|
|
52
|
+
d
|
|
53
|
+
);
|
|
54
|
+
return ((o = a == null ? void 0 : a.data) == null ? void 0 : o.data) ?? [];
|
|
55
|
+
} catch (t) {
|
|
56
|
+
return console.error("fetchRecommendationProductsByUrl error:", t), [];
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
fetchRecommendationStrategies: async () => {
|
|
60
|
+
try {
|
|
61
|
+
const { data: e } = await c(
|
|
62
|
+
`${m.RECOMMENDATION_STRATEGIES_PATH}?filters=${encodeURIComponent(y)}`
|
|
63
|
+
);
|
|
64
|
+
return Array.isArray(e) ? e : (e == null ? void 0 : e.data) ?? [];
|
|
65
|
+
} catch (e) {
|
|
66
|
+
return console.error("fetchRecommendationStrategies error:", e), [];
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
generateStrategyEndpoint: async (e, o) => {
|
|
70
|
+
try {
|
|
71
|
+
const { data: t } = await s(
|
|
72
|
+
`${m.RECOMMENDATION_STRATEGIES_PATH}/endpoint-generate`,
|
|
73
|
+
{
|
|
74
|
+
campaignId: 0,
|
|
75
|
+
pageTypes: [],
|
|
76
|
+
isPreviewer: !1,
|
|
77
|
+
strategy: e,
|
|
78
|
+
userId: "",
|
|
79
|
+
currency: o
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
return !t || typeof t != "object" || !("full_path" in t || "data" in t) ? (console.error("generateStrategyEndpoint unexpected response shape:", t), null) : "full_path" in t ? t : t.data;
|
|
83
|
+
} catch (t) {
|
|
84
|
+
return console.error("generateStrategyEndpoint error:", t), null;
|
|
46
85
|
}
|
|
47
86
|
}
|
|
48
87
|
};
|
|
49
88
|
};
|
|
50
89
|
export {
|
|
51
|
-
|
|
90
|
+
_ as useRecommendationApi
|
|
52
91
|
};
|
|
@@ -395,6 +395,7 @@ 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
|
+
readonly reusableRecommendationStrategy: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
398
399
|
}, undefined>;
|
|
399
400
|
/**
|
|
400
401
|
* Default block types available in Stripo
|
|
@@ -794,6 +795,7 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
794
795
|
readonly allowlistEnabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
795
796
|
/** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
|
|
796
797
|
readonly linkTrackingIds: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
798
|
+
readonly reusableRecommendationStrategy: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
797
799
|
}, undefined>, {}>;
|
|
798
800
|
/** Block configuration */
|
|
799
801
|
readonly blocks: v.OptionalSchema<v.ObjectSchema<{
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import '@useinsider/design-system-organisms/style';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
3
|
+
export default _default;
|
package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { RrsStrategy } from '@@/Types/recommendation';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
strategy: RrsStrategy;
|
|
4
|
+
};
|
|
5
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
|
|
6
|
+
export default _default;
|
|
7
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
8
|
+
type __VLS_TypePropsToOption<T> = {
|
|
9
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
10
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
11
|
+
} : {
|
|
12
|
+
type: import('vue').PropType<T[K]>;
|
|
13
|
+
required: true;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -99,6 +99,7 @@ export declare const useConfig: () => {
|
|
|
99
99
|
autosave: boolean;
|
|
100
100
|
allowlistEnabled: boolean;
|
|
101
101
|
linkTrackingIds: boolean;
|
|
102
|
+
reusableRecommendationStrategy: boolean;
|
|
102
103
|
};
|
|
103
104
|
blocks: {
|
|
104
105
|
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")[];
|
|
@@ -233,6 +234,7 @@ export declare const useConfig: () => {
|
|
|
233
234
|
autosave: boolean;
|
|
234
235
|
allowlistEnabled: boolean;
|
|
235
236
|
linkTrackingIds: boolean;
|
|
237
|
+
reusableRecommendationStrategy: boolean;
|
|
236
238
|
} | null>;
|
|
237
239
|
blocks: import("vue").ComputedRef<{
|
|
238
240
|
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,6 +18,7 @@ export declare const useRecommendation: () => {
|
|
|
18
18
|
getRecommendationCampaignData: (id: string) => CampaignData;
|
|
19
19
|
buildCampaignUrl: (campaignId: string, overrides?: {
|
|
20
20
|
strategy: string;
|
|
21
|
+
strategyId: string;
|
|
21
22
|
language: string;
|
|
22
23
|
currencyCode: string;
|
|
23
24
|
size: string;
|
|
@@ -8,5 +8,6 @@ export declare const ACADEMY_LINKS: {
|
|
|
8
8
|
readonly EMAIL_EDITOR: "https://academy.insiderone.com/docs/email-drag-and-drop-editor";
|
|
9
9
|
readonly GLOBAL_UNSUBSCRIBE: "https://academy.insiderone.com/docs/global-unsubscribe-preference-center";
|
|
10
10
|
readonly AMP_FOR_EMAILS: "https://academy.insiderone.com/docs/amp-for-emails";
|
|
11
|
+
readonly EMAIL_RECOMMENDATION_BLOCK: "https://academy.insiderone.com/docs/new-editor-email-recommendation-block";
|
|
11
12
|
};
|
|
12
13
|
export type AcademyLinkKey = keyof typeof ACADEMY_LINKS;
|
package/dist/src/enums/date.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ 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
|
+
RECOMMENDATION_STRATEGIES_PANEL_PATH: string;
|
|
6
8
|
};
|
|
7
9
|
export declare const QUERY_PARAMS: {
|
|
8
10
|
CLIENT_ID: string;
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
* - Merging partial updates with existing config
|
|
9
9
|
*/
|
|
10
10
|
import type { RecommendationNodeConfig, CurrencyConfig, OmnibusTextConfig } from '../types/nodeConfig';
|
|
11
|
+
export declare const PRE_RRS_CONFIG_VERSION = 1;
|
|
12
|
+
export declare const CURRENT_CONFIG_VERSION = 2;
|
|
11
13
|
/**
|
|
12
14
|
* Default currency configuration
|
|
13
15
|
* Uses USD as the base currency with standard formatting
|
|
@@ -47,9 +49,3 @@ export declare const DEFAULT_NODE_CONFIG: RecommendationNodeConfig;
|
|
|
47
49
|
* View Together and Purchase Together algorithms are disabled because these require product id.
|
|
48
50
|
*/
|
|
49
51
|
export declare const EXCLUDED_ALGORITHM_IDS: number[];
|
|
50
|
-
/**
|
|
51
|
-
* Current configuration version
|
|
52
|
-
* Increment this when making breaking changes to the schema
|
|
53
|
-
* Used for migration detection
|
|
54
|
-
*/
|
|
55
|
-
export declare const CURRENT_CONFIG_VERSION = 1;
|
|
@@ -10,4 +10,4 @@ export { RecommendationBlockId } from './blockIds';
|
|
|
10
10
|
export { RecommendationControlId } from './controlIds';
|
|
11
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';
|
|
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
|
-
export { DEFAULT_NODE_CONFIG, DEFAULT_CURRENCY, DEFAULT_COMPOSITION, DEFAULT_VISIBILITY, CURRENT_CONFIG_VERSION, EXCLUDED_ALGORITHM_IDS, } from './defaultConfig';
|
|
13
|
+
export { DEFAULT_NODE_CONFIG, DEFAULT_CURRENCY, DEFAULT_COMPOSITION, DEFAULT_VISIBILITY, CURRENT_CONFIG_VERSION, PRE_RRS_CONFIG_VERSION, EXCLUDED_ALGORITHM_IDS, } from './defaultConfig';
|
|
@@ -9,8 +9,9 @@ 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';
|
|
12
13
|
export declare const CONTROL_BLOCK_ID = "ui-elements-recommendation-block";
|
|
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, };
|
|
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, StrategyControl, STRATEGY_CONTROL_ID, };
|
|
14
15
|
export * from './utils';
|
|
15
16
|
/**
|
|
16
17
|
* Main recommendation block control that composes all sub-controls
|
|
@@ -29,8 +30,12 @@ export declare class RecommendationBlockControl extends CommonControl {
|
|
|
29
30
|
private shuffleControl;
|
|
30
31
|
private pricePlacementControl;
|
|
31
32
|
private layoutOrientationControl;
|
|
33
|
+
private strategyControl;
|
|
34
|
+
private rrsEnabled;
|
|
32
35
|
getId(): string;
|
|
36
|
+
private get _subControls();
|
|
33
37
|
getTemplate(): string;
|
|
38
|
+
private _showControlsForBlock;
|
|
34
39
|
onRender(): Promise<void>;
|
|
35
40
|
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
36
41
|
onDestroy(): void;
|
|
@@ -42,7 +47,6 @@ export declare class RecommendationBlockControl extends CommonControl {
|
|
|
42
47
|
/**
|
|
43
48
|
* Syncs persisted node config into the Pinia store's block state.
|
|
44
49
|
*
|
|
45
|
-
* setCurrentBlock() creates a default entry (USD, en_US, mostPopular).
|
|
46
50
|
* For saved templates, the real config lives in the node (e.g., TRY, tr_TR).
|
|
47
51
|
* This method reads it and patches the store so fetchRecommendationProducts()
|
|
48
52
|
* uses the correct values.
|
|
@@ -107,8 +111,10 @@ export declare class RecommendationBlockControl extends CommonControl {
|
|
|
107
111
|
*/
|
|
108
112
|
private _listenStateUpdates;
|
|
109
113
|
/**
|
|
110
|
-
* Persists
|
|
111
|
-
*
|
|
114
|
+
* Persists filter + strategy state to the Stripo node config so it survives
|
|
115
|
+
* save/reload (strategyId must reach esd-ext-config before any save).
|
|
116
|
+
* `size` rides along: assigning a strategy writes it to the store only, and a
|
|
117
|
+
* stale node config would rebuild the block against the old slot count.
|
|
112
118
|
*/
|
|
113
119
|
private _persistFiltersToNodeConfig;
|
|
114
120
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CommonControl } from '../../../common-control';
|
|
2
|
+
export declare const STRATEGY_CONTROL_ID = "recommendation-strategy-control";
|
|
3
|
+
export declare class StrategyControl extends CommonControl {
|
|
4
|
+
private store;
|
|
5
|
+
private storeUnsubscription;
|
|
6
|
+
private listeners;
|
|
7
|
+
private lastPaintedState;
|
|
8
|
+
getId(): string;
|
|
9
|
+
getTemplate(): string;
|
|
10
|
+
private _strategyAction;
|
|
11
|
+
onRender(): void;
|
|
12
|
+
onDestroy(): void;
|
|
13
|
+
private _teardown;
|
|
14
|
+
private _setupButtonListeners;
|
|
15
|
+
private _renderState;
|
|
16
|
+
}
|