@useinsider/guido 3.19.0-beta.c8d2be8 → 3.19.0-beta.d04f200
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/@types/config/schemas.js +104 -91
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +79 -74
- package/dist/components/organisms/base/AuthErrorModal.vue.js +18 -0
- package/dist/components/organisms/base/AuthErrorModal.vue2.js +42 -0
- package/dist/components/organisms/header/EditorActions.vue.js +4 -4
- package/dist/components/organisms/header/EditorActions.vue2.js +23 -25
- package/dist/components/wrappers/WpModal.vue.js +1 -1
- package/dist/components/wrappers/WpModal.vue2.js +4 -3
- package/dist/composables/useActionsApi.js +52 -47
- package/dist/composables/useAuthError.js +52 -0
- package/dist/composables/useCodeEditorApi.js +23 -9
- package/dist/composables/useHttp.js +48 -49
- package/dist/composables/useLegacyStrategyConversion.js +23 -19
- package/dist/composables/useStripo.js +24 -20
- package/dist/composables/useToaster.js +17 -15
- package/dist/composables/useTranslations.js +3 -2
- package/dist/composables/useVersionHistoryApi.js +33 -24
- package/dist/composables/validators/useLiquidValidator.js +15 -15
- package/dist/config/migrator/index.js +14 -13
- package/dist/config/migrator/recommendationPartnerMigrator.js +50 -0
- package/dist/enums/extensions/recommendationBlock.js +30 -29
- package/dist/extensions/Blocks/Recommendation/block.js +15 -14
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +45 -38
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +72 -49
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +30 -29
- package/dist/extensions/Blocks/Recommendation/utils/partnerScope.js +25 -0
- package/dist/guido.css +1 -1
- package/dist/src/@types/config/schemas.d.ts +16 -0
- package/dist/src/components/organisms/base/AuthErrorModal.vue.d.ts +2 -0
- package/dist/src/components/wrappers/WpModal.vue.d.ts +5 -1
- package/dist/src/composables/useAuthError.d.ts +12 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useHttp.d.ts +2 -0
- package/dist/src/config/migrator/index.d.ts +2 -1
- package/dist/src/config/migrator/recommendationPartnerMigrator.d.ts +19 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/partnerScope.d.ts +33 -0
- package/dist/src/stores/config.d.ts +20 -0
- package/dist/src/utils/stripoEditorApi.d.ts +4 -0
- package/dist/static/styles/components/recommendation-strategy.css.js +9 -0
- package/dist/stores/unsubscribe.js +3 -3
- package/dist/utils/stripoEditorApi.js +11 -0
- package/package.json +2 -1
|
@@ -1,33 +1,35 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var i = (
|
|
4
|
-
import { useLegacyStrategyConversion as
|
|
5
|
-
import { ACADEMY_LINKS as
|
|
6
|
-
import { useOnboardingStore as
|
|
7
|
-
import { CommonControl as
|
|
8
|
-
import { RRS_CONFIG_VERSION as
|
|
9
|
-
import { RecommendationConfigService as
|
|
10
|
-
import { useRecommendationExtensionStore as
|
|
11
|
-
const
|
|
12
|
-
class
|
|
1
|
+
var w = Object.defineProperty;
|
|
2
|
+
var N = (l, o, t) => o in l ? w(l, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[o] = t;
|
|
3
|
+
var i = (l, o, t) => N(l, typeof o != "symbol" ? o + "" : o, t);
|
|
4
|
+
import { useLegacyStrategyConversion as L } from "../../../../../composables/useLegacyStrategyConversion.js";
|
|
5
|
+
import { ACADEMY_LINKS as $ } from "../../../../../enums/academy.js";
|
|
6
|
+
import { useOnboardingStore as A } from "../../../../../stores/onboarding.js";
|
|
7
|
+
import { CommonControl as R } from "../../../common-control.js";
|
|
8
|
+
import { RRS_CONFIG_VERSION as E } from "../../constants/defaultConfig.js";
|
|
9
|
+
import { RecommendationConfigService as C } from "../../services/configService.js";
|
|
10
|
+
import { useRecommendationExtensionStore as O } from "../../store/recommendation.js";
|
|
11
|
+
const I = "recommendation-strategy-control";
|
|
12
|
+
class P extends R {
|
|
13
13
|
constructor() {
|
|
14
14
|
super(...arguments);
|
|
15
|
-
i(this, "store",
|
|
16
|
-
i(this, "onboardingStore",
|
|
17
|
-
i(this, "legacyConversion",
|
|
15
|
+
i(this, "store", O());
|
|
16
|
+
i(this, "onboardingStore", A());
|
|
17
|
+
i(this, "legacyConversion", L());
|
|
18
18
|
i(this, "storeUnsubscription", () => {
|
|
19
19
|
});
|
|
20
20
|
i(this, "listeners", []);
|
|
21
21
|
i(this, "lastPaintedState", null);
|
|
22
22
|
}
|
|
23
23
|
getId() {
|
|
24
|
-
return
|
|
24
|
+
return I;
|
|
25
25
|
}
|
|
26
26
|
getTemplate() {
|
|
27
27
|
const t = this.api.translate(
|
|
28
28
|
"You can assign a recommendation strategy by selecting an existing one or creating a new one to show specific content."
|
|
29
|
-
), e = this.api.translate("For more information, you can"),
|
|
29
|
+
), e = this.api.translate("For more information, you can"), a = this.api.translate("visit Academy"), r = this.api.translate("Legacy Strategy"), s = this.api.translate(
|
|
30
30
|
"Note that this is an older version of the Recommendation Strategy. We recommend you update it to the new Recommendation Strategy for an improved experience."
|
|
31
|
+
), g = this.api.translate(
|
|
32
|
+
"The recommendation strategy used in the recommendation block is no longer available. You can assign a different strategy to it."
|
|
31
33
|
);
|
|
32
34
|
return `
|
|
33
35
|
<div class="strategy-control-container">
|
|
@@ -52,9 +54,9 @@ class M extends A {
|
|
|
52
54
|
${t}
|
|
53
55
|
${e}
|
|
54
56
|
<a
|
|
55
|
-
href="${
|
|
57
|
+
href="${$.EMAIL_RECOMMENDATION_BLOCK}"
|
|
56
58
|
target="_blank"
|
|
57
|
-
rel="noopener noreferrer">${
|
|
59
|
+
rel="noopener noreferrer">${a}</a>.
|
|
58
60
|
</p>
|
|
59
61
|
</div>
|
|
60
62
|
<div data-strategy-empty-state style="display: none;">
|
|
@@ -71,16 +73,37 @@ class M extends A {
|
|
|
71
73
|
id: "guido__btn-create-strategy",
|
|
72
74
|
className: "strategy-control-cta primary"
|
|
73
75
|
})
|
|
76
|
+
], "strategy-control-cta-row")}
|
|
77
|
+
</div>
|
|
78
|
+
<div data-strategy-unavailable-state style="display: none;">
|
|
79
|
+
<div class="strategy-control-notice-row">
|
|
80
|
+
<div class="strategy-control-notice strategy-control-notice--error" role="alert">
|
|
81
|
+
<p class="strategy-control-notice-text">${g}</p>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
${this._GuTwoColumns([
|
|
85
|
+
this._GuButton({
|
|
86
|
+
name: "assignUnavailableStrategy",
|
|
87
|
+
label: this.api.translate("Assign Strategy"),
|
|
88
|
+
id: "guido__btn-assign-unavailable-strategy",
|
|
89
|
+
className: "strategy-control-cta on"
|
|
90
|
+
}),
|
|
91
|
+
this._GuButton({
|
|
92
|
+
name: "createUnavailableStrategy",
|
|
93
|
+
label: this.api.translate("Create New Strategy"),
|
|
94
|
+
id: "guido__btn-create-unavailable-strategy",
|
|
95
|
+
className: "strategy-control-cta primary"
|
|
96
|
+
})
|
|
74
97
|
], "strategy-control-cta-row")}
|
|
75
98
|
</div>
|
|
76
99
|
<div data-strategy-legacy-state style="display: none;">
|
|
77
100
|
<div class="strategy-control-notice-row">
|
|
78
101
|
<div class="strategy-control-notice">
|
|
79
|
-
<p class="strategy-control-notice-text">${
|
|
102
|
+
<p class="strategy-control-notice-text">${s}</p>
|
|
80
103
|
</div>
|
|
81
104
|
</div>
|
|
82
105
|
<div class="strategy-control-name-band">
|
|
83
|
-
<span class="strategy-control-name">${
|
|
106
|
+
<span class="strategy-control-name">${r}</span>
|
|
84
107
|
${this._strategyAction({
|
|
85
108
|
id: "guido__btn-update-legacy-strategy",
|
|
86
109
|
label: this.api.translate("Update"),
|
|
@@ -123,12 +146,12 @@ class M extends A {
|
|
|
123
146
|
</div>
|
|
124
147
|
`;
|
|
125
148
|
}
|
|
126
|
-
_strategyAction({ id: t, label: e, modifier:
|
|
149
|
+
_strategyAction({ id: t, label: e, modifier: a }) {
|
|
127
150
|
return `
|
|
128
151
|
<button
|
|
129
152
|
id="${t}"
|
|
130
153
|
type="button"
|
|
131
|
-
class="strategy-control-action strategy-control-action--${
|
|
154
|
+
class="strategy-control-action strategy-control-action--${a}">
|
|
132
155
|
<span>${e}</span>
|
|
133
156
|
</button>
|
|
134
157
|
`;
|
|
@@ -136,8 +159,8 @@ class M extends A {
|
|
|
136
159
|
onRender() {
|
|
137
160
|
this._teardown(), this.store.strategyPanelOpen = !0, this._setupButtonListeners(), this._renderState(), this.storeUnsubscription = this.store.$subscribe(() => {
|
|
138
161
|
this._renderState();
|
|
139
|
-
}), this.store.recommendationConfigs.strategyId && !this.store.
|
|
140
|
-
});
|
|
162
|
+
}), this.store.recommendationConfigs.strategyId && !this.store.strategiesLoading && (this.store.invalidateStrategies(), this.store.fetchStrategies().catch(() => {
|
|
163
|
+
}));
|
|
141
164
|
}
|
|
142
165
|
/**
|
|
143
166
|
* Whether the document itself says this block has no strategy.
|
|
@@ -147,10 +170,10 @@ class M extends A {
|
|
|
147
170
|
* strategyId) for an assigned block.
|
|
148
171
|
*/
|
|
149
172
|
_isNodeUnassigned() {
|
|
150
|
-
if (!
|
|
173
|
+
if (!C.hasConfig(this.currentNode))
|
|
151
174
|
return !1;
|
|
152
|
-
const t =
|
|
153
|
-
return !t.strategyId && (t.configVersion ?? 0) >=
|
|
175
|
+
const t = C.getConfig(this.currentNode);
|
|
176
|
+
return !t.strategyId && (t.configVersion ?? 0) >= E;
|
|
154
177
|
}
|
|
155
178
|
onDestroy() {
|
|
156
179
|
this._teardown();
|
|
@@ -163,37 +186,37 @@ class M extends A {
|
|
|
163
186
|
const t = this.getContainer();
|
|
164
187
|
if (!t)
|
|
165
188
|
return;
|
|
166
|
-
const e = (
|
|
167
|
-
const
|
|
168
|
-
|
|
189
|
+
const e = (a, r) => {
|
|
190
|
+
const s = t.querySelector(a);
|
|
191
|
+
s && (s.addEventListener("click", r), this.listeners.push({ element: s, handler: r }));
|
|
169
192
|
};
|
|
170
|
-
e("#guido__btn-assign-strategy", () => this.store.openAssignStrategyDrawer()), e("#guido__btn-create-strategy", () => this.store.openStrategyCreation()), e("#guido__btn-change-strategy", () => this.store.openAssignStrategyDrawer()), e("#guido__btn-change-legacy-strategy", () => this.store.openAssignStrategyDrawer()), e("#guido__btn-remove-strategy", () => this.store.openRemoveStrategyModal()), e("#guido__btn-remove-legacy-strategy", () => this.store.openRemoveStrategyModal()), e("#guido__btn-update-legacy-strategy", () => {
|
|
193
|
+
e("#guido__btn-assign-strategy", () => this.store.openAssignStrategyDrawer()), e("#guido__btn-create-strategy", () => this.store.openStrategyCreation()), e("#guido__btn-assign-unavailable-strategy", () => this.store.openAssignStrategyDrawer()), e("#guido__btn-create-unavailable-strategy", () => this.store.openStrategyCreation()), e("#guido__btn-change-strategy", () => this.store.openAssignStrategyDrawer()), e("#guido__btn-change-legacy-strategy", () => this.store.openAssignStrategyDrawer()), e("#guido__btn-remove-strategy", () => this.store.openRemoveStrategyModal()), e("#guido__btn-remove-legacy-strategy", () => this.store.openRemoveStrategyModal()), e("#guido__btn-update-legacy-strategy", () => {
|
|
171
194
|
this.legacyConversion.convertLegacyStrategy();
|
|
172
195
|
});
|
|
173
196
|
}
|
|
174
197
|
_renderState() {
|
|
175
|
-
var
|
|
176
|
-
const { strategyId: t } = this.store.recommendationConfigs, e = t ? ((
|
|
177
|
-
if (
|
|
198
|
+
var f;
|
|
199
|
+
const { strategyId: t } = this.store.recommendationConfigs, e = t ? ((f = this.store.assignedStrategy) == null ? void 0 : f.name) ?? "" : "", a = !!t && !e && (this.store.strategiesLoading || !this.store.strategiesSettled), r = !!t && !e && !a && this.store.strategiesFetched, s = this.store.legacyConversionLoading, g = this.store.isLegacyStrategyBlock, p = [t, e, a, r, s, g].join("\0");
|
|
200
|
+
if (p === this.lastPaintedState)
|
|
178
201
|
return;
|
|
179
|
-
const
|
|
180
|
-
if (!
|
|
202
|
+
const n = this.getContainer();
|
|
203
|
+
if (!n)
|
|
181
204
|
return;
|
|
182
|
-
const
|
|
183
|
-
if (!
|
|
205
|
+
const y = n.querySelector("[data-strategy-empty-state]"), u = n.querySelector("[data-strategy-assigned-state]"), c = n.querySelector("[data-strategy-legacy-state]"), h = n.querySelector("[data-strategy-unavailable-state]"), v = n.querySelector("[data-strategy-loading-state]"), b = n.querySelector("[data-strategy-content]"), m = n.querySelector("[data-strategy-name]"), _ = n.querySelector("[data-strategy-name-skeleton]");
|
|
206
|
+
if (!y || !u || !c || !h)
|
|
184
207
|
return;
|
|
185
|
-
|
|
186
|
-
const
|
|
187
|
-
[
|
|
188
|
-
|
|
189
|
-
}),
|
|
190
|
-
|
|
191
|
-
}),
|
|
208
|
+
v && (v.style.display = "none"), b && (b.style.display = "");
|
|
209
|
+
const k = t ? r ? h : u : g ? c : y;
|
|
210
|
+
[y, u, c, h].forEach((d) => {
|
|
211
|
+
d.style.display = d === k ? "" : "none";
|
|
212
|
+
}), c.querySelectorAll("button").forEach((d) => {
|
|
213
|
+
d.disabled = s;
|
|
214
|
+
}), c.classList.toggle("is-converting", s), !t && this._isNodeUnassigned() && this.onboardingStore.startOnboarding("recommendationStrategyOnboarding");
|
|
192
215
|
const S = this.store.currentRecommendationId;
|
|
193
|
-
|
|
216
|
+
g && S !== null && this.store.blockStates[S] && this.onboardingStore.startOnboarding("recommendationLegacyStrategyOnboarding"), m && (m.style.display = a ? "none" : "", t && !a && (m.textContent = e || `#${t}`)), _ && (_.style.display = a ? "block" : "none"), this.lastPaintedState = p;
|
|
194
217
|
}
|
|
195
218
|
}
|
|
196
219
|
export {
|
|
197
|
-
|
|
198
|
-
|
|
220
|
+
I as STRATEGY_CONTROL_ID,
|
|
221
|
+
P as StrategyControl
|
|
199
222
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { useToaster as
|
|
1
|
+
import { useToaster as _ } from "../../../../composables/useToaster.js";
|
|
2
2
|
import { useTranslations as L } from "../../../../composables/useTranslations.js";
|
|
3
|
-
import { getRecommendationFeedSourceMaps as F, strategyEditPath as U,
|
|
4
|
-
import { ToasterTypeOptions as
|
|
5
|
-
import { useRecommendationApi as
|
|
6
|
-
import { useConfigStore as
|
|
7
|
-
import { defineStore as
|
|
3
|
+
import { getRecommendationFeedSourceMaps as F, strategyEditPath as U, strategyCreatePath as N, getOperatorOptions as M, PriceAttributes as E } from "../../../../enums/extensions/recommendationBlock.js";
|
|
4
|
+
import { ToasterTypeOptions as B } from "../../../../enums/toaster.js";
|
|
5
|
+
import { useRecommendationApi as z } from "../../../../services/recommendationApi.js";
|
|
6
|
+
import { useConfigStore as R } from "../../../../stores/config.js";
|
|
7
|
+
import { defineStore as A } from "pinia";
|
|
8
8
|
import "../constants/selectors.js";
|
|
9
|
-
import { DEFAULT_MOBILE_CARDS_IN_ROW as O, DEFAULT_CARDS_IN_ROW as
|
|
10
|
-
import { CURRENT_CONFIG_VERSION as C, DEFAULT_NODE_CONFIG as
|
|
9
|
+
import { DEFAULT_MOBILE_CARDS_IN_ROW as O, DEFAULT_CARDS_IN_ROW as x } from "../constants/layout.js";
|
|
10
|
+
import { CURRENT_CONFIG_VERSION as C, DEFAULT_NODE_CONFIG as T, EXCLUDED_ALGORITHM_IDS as V } from "../constants/defaultConfig.js";
|
|
11
11
|
import { getDefaultProducts as w } from "../templates/utils.js";
|
|
12
12
|
import { generateCompleteFilterQuery as P } from "../utils/filterUtil.js";
|
|
13
13
|
import { isLegacyStrategyConfig as j } from "../utils/legacyStrategyMigration.js";
|
|
@@ -15,13 +15,13 @@ import { getPartnerRecommendationParams as $ } from "../utils/partnerCustomizati
|
|
|
15
15
|
import { sanitizeProductIds as q } from "../utils/productIds.js";
|
|
16
16
|
import { isFilterValid as K } from "../validation/filterSchema.js";
|
|
17
17
|
import { getInvalidFields as H, isConfigValid as J } from "../validation/requiredFields.js";
|
|
18
|
-
const m =
|
|
19
|
-
let S = null, p = null, y = null, I = "",
|
|
18
|
+
const m = z();
|
|
19
|
+
let S = null, p = null, y = null, I = "", k = null, b = 0;
|
|
20
20
|
const g = /* @__PURE__ */ new Map();
|
|
21
21
|
let l = null;
|
|
22
|
-
function
|
|
22
|
+
function D() {
|
|
23
23
|
return {
|
|
24
|
-
cardsInRow:
|
|
24
|
+
cardsInRow: x,
|
|
25
25
|
currencySettings: {
|
|
26
26
|
name: "USD",
|
|
27
27
|
value: "USD",
|
|
@@ -45,7 +45,7 @@ function _() {
|
|
|
45
45
|
// that default is what reached buildCampaignUrl and baked a most-popular feed URL
|
|
46
46
|
// for a block the user never configured (SD-149916). Legacy blocks still get their real
|
|
47
47
|
// algorithm from the node-config sync or the save-time seed.
|
|
48
|
-
strategy:
|
|
48
|
+
strategy: R().isFeatureEnabled("reusableRecommendationStrategy") ? "" : "mostPopular",
|
|
49
49
|
strategyId: "",
|
|
50
50
|
nodeConfigVersion: C,
|
|
51
51
|
textTrimming: !0,
|
|
@@ -58,7 +58,7 @@ function _() {
|
|
|
58
58
|
}
|
|
59
59
|
function G() {
|
|
60
60
|
return {
|
|
61
|
-
recommendationConfigs:
|
|
61
|
+
recommendationConfigs: D(),
|
|
62
62
|
recommendationProducts: [],
|
|
63
63
|
filterStatus: !1,
|
|
64
64
|
filterSelectionDrawerStatus: !1,
|
|
@@ -87,7 +87,7 @@ const Q = () => ({
|
|
|
87
87
|
currentRecommendationId: null,
|
|
88
88
|
strategyPanelOpen: !1,
|
|
89
89
|
configVersion: 0
|
|
90
|
-
}), ft =
|
|
90
|
+
}), ft = A("guidoRecommendationExtension", {
|
|
91
91
|
state: () => Q(),
|
|
92
92
|
getters: {
|
|
93
93
|
// ====================================================================
|
|
@@ -98,7 +98,7 @@ const Q = () => ({
|
|
|
98
98
|
* This allows all existing code that reads `store.recommendationConfigs` to work unchanged.
|
|
99
99
|
*/
|
|
100
100
|
recommendationConfigs(t) {
|
|
101
|
-
return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].recommendationConfigs :
|
|
101
|
+
return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].recommendationConfigs : D();
|
|
102
102
|
},
|
|
103
103
|
/**
|
|
104
104
|
* Proxy getter: delegates to blockStates[currentRecommendationId].recommendationProducts
|
|
@@ -119,7 +119,7 @@ const Q = () => ({
|
|
|
119
119
|
return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].removeStrategyModalStatus : !1;
|
|
120
120
|
},
|
|
121
121
|
isLegacyStrategyBlock() {
|
|
122
|
-
return
|
|
122
|
+
return R().isFeatureEnabled("reusableRecommendationStrategy") && j(this.recommendationConfigs);
|
|
123
123
|
},
|
|
124
124
|
legacyConversionLoading(t) {
|
|
125
125
|
return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].legacyConversionLoading ?? !1 : !1;
|
|
@@ -181,7 +181,7 @@ const Q = () => ({
|
|
|
181
181
|
getFilterList() {
|
|
182
182
|
return Object.values(this.filterList).filter((t) => t.isFilterable !== 0 && t.isFilterable !== !1).map((t) => {
|
|
183
183
|
let e;
|
|
184
|
-
return t.type === "productAttribute" ? e = `product_attributes.${t.attributeName}` :
|
|
184
|
+
return t.type === "productAttribute" ? e = `product_attributes.${t.attributeName}` : E.includes(t.attributeName) ? e = `${t.attributeName}.${this.recommendationConfigs.currencySettings.value}` : e = t.attributeName, {
|
|
185
185
|
text: t.displayName,
|
|
186
186
|
value: e,
|
|
187
187
|
type: t.attributeType
|
|
@@ -234,7 +234,7 @@ const Q = () => ({
|
|
|
234
234
|
const r = this.blockStates[t];
|
|
235
235
|
if (r) {
|
|
236
236
|
const o = structuredClone(r);
|
|
237
|
-
o.recommendationConfigs.id = e, o.recommendationConfigs.strategyId &&
|
|
237
|
+
o.recommendationConfigs.id = e, o.recommendationConfigs.strategyId && R().isFeatureEnabled("reusableRecommendationStrategy") && (o.isInitialized = !1, o.syncedConfigFingerprint = null), this.blockStates = {
|
|
238
238
|
...this.blockStates,
|
|
239
239
|
[e]: o
|
|
240
240
|
};
|
|
@@ -314,7 +314,7 @@ const Q = () => ({
|
|
|
314
314
|
* Creates a filter with the first available attribute and operator pre-selected.
|
|
315
315
|
*/
|
|
316
316
|
createDefaultFilter(t, e) {
|
|
317
|
-
const [r] = this.getFilterList, [n] =
|
|
317
|
+
const [r] = this.getFilterList, [n] = M(r == null ? void 0 : r.type);
|
|
318
318
|
return {
|
|
319
319
|
type: "standardFilter",
|
|
320
320
|
attribute: (r == null ? void 0 : r.value) ?? "",
|
|
@@ -380,9 +380,9 @@ const Q = () => ({
|
|
|
380
380
|
this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId] || (this.blockStates[this.currentRecommendationId].removeStrategyModalStatus = !1);
|
|
381
381
|
},
|
|
382
382
|
async fetchStrategies() {
|
|
383
|
-
for (;
|
|
383
|
+
for (; k; )
|
|
384
384
|
try {
|
|
385
|
-
await
|
|
385
|
+
await k;
|
|
386
386
|
} catch {
|
|
387
387
|
}
|
|
388
388
|
if (this.strategiesFetched)
|
|
@@ -398,11 +398,11 @@ const Q = () => ({
|
|
|
398
398
|
this.strategiesLoading = !1, t === b && (this.strategiesSettled = !0);
|
|
399
399
|
}
|
|
400
400
|
})();
|
|
401
|
-
|
|
401
|
+
k = e;
|
|
402
402
|
try {
|
|
403
403
|
await e;
|
|
404
404
|
} finally {
|
|
405
|
-
|
|
405
|
+
k = null;
|
|
406
406
|
}
|
|
407
407
|
},
|
|
408
408
|
/**
|
|
@@ -434,8 +434,8 @@ const Q = () => ({
|
|
|
434
434
|
_armStrategyPageReturn(t) {
|
|
435
435
|
const e = window.open(t, "_blank");
|
|
436
436
|
if (!e)
|
|
437
|
-
return
|
|
438
|
-
type:
|
|
437
|
+
return _().showToaster({
|
|
438
|
+
type: B.Error,
|
|
439
439
|
message: L()("discovery-strategy.error-description")
|
|
440
440
|
}), !1;
|
|
441
441
|
e.opener = null, l == null || l();
|
|
@@ -471,7 +471,7 @@ const Q = () => ({
|
|
|
471
471
|
* new strategy is offered; the user picks it themselves.
|
|
472
472
|
*/
|
|
473
473
|
openStrategyCreation() {
|
|
474
|
-
return this._armStrategyPageReturn(
|
|
474
|
+
return this._armStrategyPageReturn(N());
|
|
475
475
|
},
|
|
476
476
|
/**
|
|
477
477
|
* Opens the strategy's edit page. Every return refreshes the list so the block reflects the
|
|
@@ -503,6 +503,7 @@ const Q = () => ({
|
|
|
503
503
|
this.blockStates[r].legacyConversionLoading = !0;
|
|
504
504
|
try {
|
|
505
505
|
const n = await m.migrateLegacyStrategy(t, e);
|
|
506
|
+
this.invalidateStrategies();
|
|
506
507
|
try {
|
|
507
508
|
await this.fetchStrategies();
|
|
508
509
|
} catch (o) {
|
|
@@ -532,7 +533,7 @@ const Q = () => ({
|
|
|
532
533
|
this.patchCurrentBlockConfig({
|
|
533
534
|
strategyId: "",
|
|
534
535
|
strategy: "",
|
|
535
|
-
size:
|
|
536
|
+
size: T.size,
|
|
536
537
|
nodeConfigVersion: C
|
|
537
538
|
});
|
|
538
539
|
},
|
|
@@ -685,7 +686,7 @@ const Q = () => ({
|
|
|
685
686
|
},
|
|
686
687
|
async _doFetchProducts() {
|
|
687
688
|
var h;
|
|
688
|
-
const t = this.currentRecommendationId, e = this.blockStates[t], { recommendationConfigs: r } = e, n =
|
|
689
|
+
const t = this.currentRecommendationId, e = this.blockStates[t], { recommendationConfigs: r } = e, n = R();
|
|
689
690
|
if (r.strategyId && n.isFeatureEnabled("reusableRecommendationStrategy")) {
|
|
690
691
|
await this._doFetchStrategyProducts(t);
|
|
691
692
|
return;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ATTR_CUSTOM_PREFIX as f } from "../constants/selectors.js";
|
|
2
|
+
function o(t) {
|
|
3
|
+
if (typeof t == "string")
|
|
4
|
+
return t.trim() !== "";
|
|
5
|
+
if (t && typeof t == "object" && "strategyId" in t) {
|
|
6
|
+
const { strategyId: r } = t;
|
|
7
|
+
return (typeof r == "string" || typeof r == "number") && String(r).trim() !== "";
|
|
8
|
+
}
|
|
9
|
+
return !1;
|
|
10
|
+
}
|
|
11
|
+
function u({ config: t, blockId: r, partnerName: e, campaignUrls: n, rrsEnabled: i }) {
|
|
12
|
+
return e ? t.partnerName ? t.partnerName !== e : !i || !t.strategyId || !n ? !1 : !o(n[String(r)]) : !1;
|
|
13
|
+
}
|
|
14
|
+
function a({ config: t, campaignUrls: r, rrsEnabled: e }) {
|
|
15
|
+
return !t.strategyId || e && !!r;
|
|
16
|
+
}
|
|
17
|
+
function g(t) {
|
|
18
|
+
return t.filter((r) => !r.startsWith(f));
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
a as canJudgeUnstampedBlock,
|
|
22
|
+
u as carriesForeignPartnerConfig,
|
|
23
|
+
o as isDefinedCampaignUrl,
|
|
24
|
+
g as withoutCustomAttributes
|
|
25
|
+
};
|
package/dist/guido.css
CHANGED
|
@@ -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-
|
|
1
|
+
@charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.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-c61cc8ea]{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-926b01f5]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-926b01f5]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-926b01f5]{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-19d8cb42] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[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-6ce48dfd]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-skeleton{width:100%!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .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}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}
|
|
@@ -278,6 +278,14 @@ export declare const TemplateSchema: v.ObjectSchema<{
|
|
|
278
278
|
* mount. Non-numbers still fail, like every other field in this schema.
|
|
279
279
|
*/
|
|
280
280
|
readonly trackIdCounter: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, number>]>, 0>;
|
|
281
|
+
/**
|
|
282
|
+
* The variation's saved `recommendationCampaignUrls`, keyed by block id. A block
|
|
283
|
+
* that still names a strategy but has no entry here had it dropped by a
|
|
284
|
+
* cross-account duplicate, so Guido resets it on load (SD-151945). Omit it and
|
|
285
|
+
* that check is off, and so is any non-object value such as `null`, because a reset
|
|
286
|
+
* cannot be undone. Hosts send `[]` for an empty map.
|
|
287
|
+
*/
|
|
288
|
+
readonly recommendationCampaignUrls: v.OptionalSchema<v.SchemaWithPipe<readonly [v.UnknownSchema, v.TransformAction<unknown, Record<string, unknown> | undefined>]>, undefined>;
|
|
281
289
|
/** Migration-only inputs (legacy block configs) */
|
|
282
290
|
readonly migration: v.OptionalSchema<v.ObjectSchema<{
|
|
283
291
|
/**
|
|
@@ -701,6 +709,14 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
701
709
|
* mount. Non-numbers still fail, like every other field in this schema.
|
|
702
710
|
*/
|
|
703
711
|
readonly trackIdCounter: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, number>]>, 0>;
|
|
712
|
+
/**
|
|
713
|
+
* The variation's saved `recommendationCampaignUrls`, keyed by block id. A block
|
|
714
|
+
* that still names a strategy but has no entry here had it dropped by a
|
|
715
|
+
* cross-account duplicate, so Guido resets it on load (SD-151945). Omit it and
|
|
716
|
+
* that check is off, and so is any non-object value such as `null`, because a reset
|
|
717
|
+
* cannot be undone. Hosts send `[]` for an empty map.
|
|
718
|
+
*/
|
|
719
|
+
readonly recommendationCampaignUrls: v.OptionalSchema<v.SchemaWithPipe<readonly [v.UnknownSchema, v.TransformAction<unknown, Record<string, unknown> | undefined>]>, undefined>;
|
|
704
720
|
/** Migration-only inputs (legacy block configs) */
|
|
705
721
|
readonly migration: v.OptionalSchema<v.ObjectSchema<{
|
|
706
722
|
/**
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
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<{}>>, {}>;
|
|
2
|
+
export default _default;
|
|
@@ -3,6 +3,7 @@ type __VLS_Props = {
|
|
|
3
3
|
id: string;
|
|
4
4
|
title: string;
|
|
5
5
|
description?: string;
|
|
6
|
+
state?: 'default' | 'primary' | 'warning' | 'danger';
|
|
6
7
|
size?: 'X-small' | 'small' | 'medium' | 'large';
|
|
7
8
|
footerButtonOptions?: FooterButtonGroup;
|
|
8
9
|
closeButtonStatus?: boolean;
|
|
@@ -15,6 +16,7 @@ type __VLS_Slots = {} & {
|
|
|
15
16
|
};
|
|
16
17
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
17
18
|
description: string;
|
|
19
|
+
state: string;
|
|
18
20
|
size: string;
|
|
19
21
|
footerButtonOptions: undefined;
|
|
20
22
|
closeButtonStatus: boolean;
|
|
@@ -26,6 +28,7 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
|
|
|
26
28
|
"secondary-action": () => void;
|
|
27
29
|
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
28
30
|
description: string;
|
|
31
|
+
state: string;
|
|
29
32
|
size: string;
|
|
30
33
|
footerButtonOptions: undefined;
|
|
31
34
|
closeButtonStatus: boolean;
|
|
@@ -34,9 +37,10 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
|
|
|
34
37
|
}>>>, {
|
|
35
38
|
size: "X-small" | "small" | "medium" | "large";
|
|
36
39
|
description: string;
|
|
37
|
-
|
|
40
|
+
state: "default" | "primary" | "warning" | "danger";
|
|
38
41
|
footerButtonOptions: FooterButtonGroup;
|
|
39
42
|
closeButtonStatus: boolean;
|
|
43
|
+
closeOnOutsideClick: boolean;
|
|
40
44
|
footerStatus: boolean;
|
|
41
45
|
}>;
|
|
42
46
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface AuthErrorState {
|
|
2
|
+
status: number;
|
|
3
|
+
data: Record<string, unknown> | null;
|
|
4
|
+
}
|
|
5
|
+
export declare const isPanelOrigin: (url: string) => boolean;
|
|
6
|
+
export declare const reportAuthError: (status: number, body: string, url: string) => void;
|
|
7
|
+
export declare const useAuthError: () => {
|
|
8
|
+
authError: import("vue").Ref<{
|
|
9
|
+
status: number;
|
|
10
|
+
data: Record<string, unknown> | null;
|
|
11
|
+
} | null>;
|
|
12
|
+
};
|
|
@@ -43,6 +43,7 @@ export declare const useConfig: () => {
|
|
|
43
43
|
selectedUnsubscribePages: number[];
|
|
44
44
|
forceRecreate: boolean;
|
|
45
45
|
trackIdCounter: number;
|
|
46
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
46
47
|
migration: {
|
|
47
48
|
recommendationConfigs: {
|
|
48
49
|
[x: string]: {
|
|
@@ -180,6 +181,7 @@ export declare const useConfig: () => {
|
|
|
180
181
|
selectedUnsubscribePages: number[];
|
|
181
182
|
forceRecreate: boolean;
|
|
182
183
|
trackIdCounter: number;
|
|
184
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
183
185
|
migration: {
|
|
184
186
|
recommendationConfigs: {
|
|
185
187
|
[x: string]: {
|
|
@@ -16,6 +16,7 @@ export interface HttpError {
|
|
|
16
16
|
status?: number;
|
|
17
17
|
statusText?: string;
|
|
18
18
|
response?: Response;
|
|
19
|
+
authReported?: boolean;
|
|
19
20
|
}
|
|
20
21
|
export declare const useHttp: (defaultOptions?: HttpOptions) => {
|
|
21
22
|
loading: import("vue").ComputedRef<boolean>;
|
|
@@ -65,6 +66,7 @@ export declare const useHttp: (defaultOptions?: HttpOptions) => {
|
|
|
65
66
|
json: () => Promise<any>;
|
|
66
67
|
text: () => Promise<string>;
|
|
67
68
|
} | undefined;
|
|
69
|
+
authReported?: boolean | undefined;
|
|
68
70
|
} | null>;
|
|
69
71
|
hasError: import("vue").ComputedRef<boolean>;
|
|
70
72
|
request: <T = unknown>(method: HttpMethod, url: string, data?: unknown, options?: HttpOptions) => Promise<HttpResponse<T>>;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { LegacyRecommendationConfig } from '@@/Types/config';
|
|
2
|
-
|
|
2
|
+
import { type PartnerScopeMigrationOptions } from './recommendationPartnerMigrator';
|
|
3
|
+
export declare const migrate: (html: string, recommendationConfigs?: Record<string, LegacyRecommendationConfig>, partnerScope?: PartnerScopeMigrationOptions) => Promise<string>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Empties recommendation blocks copied in from another account and stamps the
|
|
3
|
+
* current one, before the editor ever sees the template (SD-151945).
|
|
4
|
+
*
|
|
5
|
+
* Runs at load rather than on document change: the stamp makes it a one-time
|
|
6
|
+
* pass per template, the campaign-URL rule only ever applies to the loaded HTML,
|
|
7
|
+
* and Stripo takes the result as the original document, so nothing is dirtied.
|
|
8
|
+
*/
|
|
9
|
+
export interface PartnerScopeMigrationOptions {
|
|
10
|
+
partnerName: string;
|
|
11
|
+
/** `undefined` when the host does not pass the map — the unstamped check is then off. */
|
|
12
|
+
campaignUrls?: Record<string, unknown>;
|
|
13
|
+
rrsEnabled: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* @param html Template HTML, already normalized by `migrateRecommendation`.
|
|
17
|
+
* @returns Migrated HTML, or the original when no block needed a reset or a stamp.
|
|
18
|
+
*/
|
|
19
|
+
export declare function migrateRecommendationPartnerScope(html: string, { partnerName, campaignUrls, rrsEnabled }: PartnerScopeMigrationOptions): string;
|
|
@@ -8,8 +8,8 @@ export declare const URLS: {
|
|
|
8
8
|
NEWSLETTER_RECOMMENDATIONS_PATH: string;
|
|
9
9
|
MIGRATE_STRATEGIES_PATH: string;
|
|
10
10
|
TEMPLATE_MIGRATE_STRATEGIES_PATH: string;
|
|
11
|
-
RECOMMENDATION_STRATEGY_CREATE_PATH: string;
|
|
12
11
|
};
|
|
12
|
+
export declare const strategyCreatePath: () => string;
|
|
13
13
|
export declare const strategyEditPath: (strategyId: string | number) => string;
|
|
14
14
|
export declare const MIGRATION_PATHS: Record<RrsMigrationTarget['scope'], string>;
|
|
15
15
|
export declare const QUERY_PARAMS: {
|
|
@@ -83,6 +83,12 @@ export interface RecommendationNodeConfig {
|
|
|
83
83
|
*/
|
|
84
84
|
filters: Filter[];
|
|
85
85
|
strategyId: string;
|
|
86
|
+
/**
|
|
87
|
+
* Account (`config.partner.name`) that last wrote the strategy config. Strategy ids and
|
|
88
|
+
* attribute types are account-scoped, so a block opened under another account is reset.
|
|
89
|
+
* Absent on blocks saved before SD-151945.
|
|
90
|
+
*/
|
|
91
|
+
partnerName?: string;
|
|
86
92
|
/**
|
|
87
93
|
* Layout orientation
|
|
88
94
|
* - 'grid': Products in a grid, attributes aligned across products
|