@useinsider/guido 3.18.1-beta.e489d08 → 3.18.1-beta.e609a33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Guido.vue.js +3 -3
- package/dist/components/Guido.vue2.js +30 -30
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +11 -13
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +53 -65
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +18 -20
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +34 -34
- package/dist/composables/useCustomInterfaceAppearance.js +41 -46
- package/dist/composables/useHtmlValidator.js +79 -84
- package/dist/composables/useHttp.js +24 -22
- package/dist/composables/useRecommendation.js +18 -21
- package/dist/composables/useStripo.js +7 -7
- package/dist/enums/extensions/recommendationBlock.js +31 -38
- package/dist/extensions/Blocks/Recommendation/block.js +39 -43
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +57 -62
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +52 -80
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +73 -150
- package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +12 -21
- package/dist/guido.css +1 -1
- package/dist/services/templateLibraryApi.js +39 -37
- package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -2
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +0 -2
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -9
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -61
- package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +0 -4
- package/dist/src/stores/onboarding.d.ts +0 -377
- package/dist/static/styles/components/recommendation-strategy.css.js +4 -51
- package/dist/stores/onboarding.js +36 -41
- package/dist/utils/templatePreparation.js +50 -50
- package/package.json +1 -1
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +0 -21
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +0 -47
- package/dist/src/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.d.ts +0 -2
|
@@ -1,43 +1,34 @@
|
|
|
1
|
-
const
|
|
1
|
+
const l = [
|
|
2
2
|
{
|
|
3
3
|
key: "locale",
|
|
4
4
|
getValue: (e) => e.language,
|
|
5
5
|
getAvailableOptions: (e) => Object.keys(e.languages)
|
|
6
6
|
},
|
|
7
|
-
{
|
|
8
|
-
// A block feeds from either an assigned strategy (RRS) or an algorithm (legacy).
|
|
9
|
-
// Only a fresh RRS block has neither, and its feed URL would otherwise be built
|
|
10
|
-
// from an empty algorithm path.
|
|
11
|
-
key: o,
|
|
12
|
-
getValue: (e) => e.strategyId || e.strategy
|
|
13
|
-
},
|
|
14
7
|
{
|
|
15
8
|
key: "currency",
|
|
16
9
|
getValue: (e) => e.currencySettings.value,
|
|
17
10
|
getAvailableOptions: (e) => e.currencyList.map((n) => n.text),
|
|
18
11
|
canBeEmpty: !0
|
|
19
12
|
}
|
|
20
|
-
],
|
|
21
|
-
function c(e, n, i =
|
|
13
|
+
], o = "newsletter.recommendation-fill-required-fields";
|
|
14
|
+
function c(e, n, i = l) {
|
|
22
15
|
return i.filter((t) => {
|
|
23
|
-
var
|
|
16
|
+
var u;
|
|
24
17
|
if (t.condition && !t.condition(e))
|
|
25
18
|
return !1;
|
|
26
|
-
const
|
|
27
|
-
if (t.canBeEmpty && (
|
|
19
|
+
const r = (u = t.getAvailableOptions) == null ? void 0 : u.call(t, n);
|
|
20
|
+
if (t.canBeEmpty && (r == null ? void 0 : r.length) === 0)
|
|
28
21
|
return !1;
|
|
29
|
-
const
|
|
30
|
-
return
|
|
22
|
+
const a = t.getValue(e);
|
|
23
|
+
return a ? r !== void 0 && !r.includes(a) : !0;
|
|
31
24
|
}).map((t) => t.key);
|
|
32
25
|
}
|
|
33
|
-
function
|
|
26
|
+
function s(e, n) {
|
|
34
27
|
return c(e, n).length === 0;
|
|
35
28
|
}
|
|
36
29
|
export {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
l as RecommendationRequiredFieldsKey,
|
|
40
|
-
o as STRATEGY_FIELD_KEY,
|
|
30
|
+
l as REQUIRED_RECOMMENDATION_FIELDS,
|
|
31
|
+
o as RecommendationRequiredFieldsKey,
|
|
41
32
|
c as getInvalidFields,
|
|
42
|
-
|
|
33
|
+
s as isConfigValid
|
|
43
34
|
};
|
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-1ca6baf0]{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-
|
|
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-1ca6baf0]{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-050dfa52]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-050dfa52]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-050dfa52]{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}
|
|
@@ -4,91 +4,93 @@ import { useToaster as C } from "../composables/useToaster.js";
|
|
|
4
4
|
import { useTranslations as h } from "../composables/useTranslations.js";
|
|
5
5
|
import { useLiquidValidator as S } from "../composables/validators/useLiquidValidator.js";
|
|
6
6
|
import { EditorType as v } from "../enums/defaults.js";
|
|
7
|
-
import { ToasterTypeOptions as
|
|
8
|
-
import { useRecommendationExtensionStore as
|
|
7
|
+
import { ToasterTypeOptions as x } from "../enums/toaster.js";
|
|
8
|
+
import { useRecommendationExtensionStore as A } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
9
9
|
import { useSaveAsTemplateStore as E } from "../stores/save-as-template.js";
|
|
10
|
-
import { base64EncodeWithSpecialChars as
|
|
11
|
-
import { useTemplatePreparation as
|
|
12
|
-
const
|
|
13
|
-
const { get:
|
|
10
|
+
import { base64EncodeWithSpecialChars as s } from "../utils/base64.js";
|
|
11
|
+
import { useTemplatePreparation as N } from "../utils/templatePreparation.js";
|
|
12
|
+
const _ = () => {
|
|
13
|
+
const { get: m, post: c } = b(), { handleError: i, showToaster: l } = C(), { config: p, isFeatureEnabled: u } = w(), { validateLiquidSyntax: f } = S(), y = h();
|
|
14
14
|
return {
|
|
15
15
|
getCategories: async () => {
|
|
16
16
|
try {
|
|
17
|
-
const { data: e = [] } = await
|
|
17
|
+
const { data: e = [] } = await m("/newsletter/template-library/get-template-categories");
|
|
18
18
|
return e;
|
|
19
19
|
} catch (e) {
|
|
20
|
-
return
|
|
20
|
+
return i(e, "Failed to fetch template categories"), [];
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
checkTemplateNameAvailability: async (e) => {
|
|
24
|
-
const { data: { status: t = !1 } } = await
|
|
24
|
+
const { data: { status: t = !1 } } = await m(
|
|
25
25
|
`/newsletter/template-library/template-name-exists?name=${e}`
|
|
26
26
|
);
|
|
27
27
|
return !t;
|
|
28
28
|
},
|
|
29
29
|
createCategory: async (e) => {
|
|
30
30
|
try {
|
|
31
|
-
const { data: { id: t } } = await
|
|
31
|
+
const { data: { id: t } } = await c(
|
|
32
32
|
"/newsletter/template-library/create-category",
|
|
33
33
|
{ name: e }
|
|
34
34
|
);
|
|
35
35
|
return t.toString();
|
|
36
36
|
} catch (t) {
|
|
37
|
-
return
|
|
37
|
+
return i(t, "Failed to create category"), "";
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
createTemplate: async () => {
|
|
41
|
-
var e, t, d,
|
|
41
|
+
var e, t, d, g;
|
|
42
42
|
try {
|
|
43
|
-
const { prepareTemplateDetails:
|
|
44
|
-
if (
|
|
43
|
+
const { prepareTemplateDetails: n } = N(), o = E(), a = await n();
|
|
44
|
+
if (u("liquidSyntax") && !await f(a.compiledHtml))
|
|
45
45
|
return !1;
|
|
46
|
-
const
|
|
47
|
-
name:
|
|
48
|
-
categories:
|
|
49
|
-
productId: ((t = (e =
|
|
46
|
+
const T = {
|
|
47
|
+
name: o.getTemplateName,
|
|
48
|
+
categories: o.getSelectedCategoryIds,
|
|
49
|
+
productId: ((t = (e = p.value) == null ? void 0 : e.partner) == null ? void 0 : t.productType) || 0,
|
|
50
50
|
editorType: v,
|
|
51
|
-
messageType: ((
|
|
52
|
-
content:
|
|
53
|
-
css:
|
|
51
|
+
messageType: ((g = (d = p.value) == null ? void 0 : d.partner) == null ? void 0 : g.messageType) || 0,
|
|
52
|
+
content: s(a.compiledHtml),
|
|
53
|
+
css: s(a.css),
|
|
54
54
|
unsubscriptionPreferencePageStatus: !1,
|
|
55
55
|
unsubscriptionPreferencePages: [],
|
|
56
|
-
recommendationCampaignUrls:
|
|
57
|
-
|
|
56
|
+
recommendationCampaignUrls: s(
|
|
57
|
+
A().recommendationCampaignUrls
|
|
58
58
|
),
|
|
59
|
-
recommendationConfigs:
|
|
59
|
+
recommendationConfigs: s({}),
|
|
60
60
|
isGuido: !0,
|
|
61
61
|
// eslint-disable-next-line camelcase
|
|
62
|
-
template_engine:
|
|
63
|
-
stripoConfig:
|
|
62
|
+
template_engine: u("liquidSyntax") ? 1 : 0,
|
|
63
|
+
stripoConfig: s({
|
|
64
64
|
editor: "stripo",
|
|
65
65
|
html: a.rawHtml,
|
|
66
66
|
css: a.css,
|
|
67
67
|
dynamicContentList: a.dynamicContentList
|
|
68
68
|
})
|
|
69
|
-
}, { data:
|
|
69
|
+
}, { data: r } = await c(
|
|
70
70
|
"/newsletter/template-library/create-template",
|
|
71
|
-
|
|
71
|
+
T
|
|
72
72
|
);
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
if (!r || typeof r != "object" || Array.isArray(r) || r instanceof Blob)
|
|
74
|
+
throw new Error("Unexpected create-template response");
|
|
75
|
+
return r.type === "alert" ? (l({
|
|
76
|
+
message: y(
|
|
75
77
|
"newsletter.template-library-save-alert",
|
|
76
|
-
{ templateName:
|
|
78
|
+
{ templateName: o.getTemplateName }
|
|
77
79
|
),
|
|
78
|
-
type:
|
|
80
|
+
type: x.Error
|
|
79
81
|
}), !1) : (l({
|
|
80
|
-
message:
|
|
82
|
+
message: y(
|
|
81
83
|
"newsletter.template-library-save-success",
|
|
82
|
-
{ templateName:
|
|
84
|
+
{ templateName: o.getTemplateName }
|
|
83
85
|
),
|
|
84
86
|
type: "success"
|
|
85
87
|
}), !0);
|
|
86
|
-
} catch (
|
|
87
|
-
return
|
|
88
|
+
} catch (n) {
|
|
89
|
+
return i(n, "Failed to create template"), !1;
|
|
88
90
|
}
|
|
89
91
|
}
|
|
90
92
|
};
|
|
91
93
|
};
|
|
92
94
|
export {
|
|
93
|
-
|
|
95
|
+
_ as useTemplateLibraryApi
|
|
94
96
|
};
|
|
@@ -5,9 +5,7 @@ export declare const URLS: {
|
|
|
5
5
|
PRODUCT_ATTRIBUTES_PATH: string;
|
|
6
6
|
RECOMMENDATION_STRATEGIES_PATH: string;
|
|
7
7
|
RECOMMENDATION_STRATEGIES_PANEL_PATH: string;
|
|
8
|
-
RECOMMENDATION_STRATEGY_CREATE_PATH: string;
|
|
9
8
|
};
|
|
10
|
-
export declare const strategyEditPath: (strategyId: string | number) => string;
|
|
11
9
|
export declare const QUERY_PARAMS: {
|
|
12
10
|
CLIENT_ID: string;
|
|
13
11
|
};
|
|
@@ -66,8 +66,6 @@ export declare class RecommendationBlockControl extends CommonControl {
|
|
|
66
66
|
* edits are never clobbered (SD-141049).
|
|
67
67
|
*/
|
|
68
68
|
private _syncNodeConfigIfChanged;
|
|
69
|
-
/** Whether the deferred write would move the node's strategyId — see the caller (SD-149916). */
|
|
70
|
-
private _isPendingStrategyIdChange;
|
|
71
69
|
private _capturePendingNodeConfigWrite;
|
|
72
70
|
/**
|
|
73
71
|
* Accumulates the pending write into `documentModifier` without applying, so the
|
|
@@ -2,7 +2,6 @@ import { CommonControl } from '../../../common-control';
|
|
|
2
2
|
export declare const STRATEGY_CONTROL_ID = "recommendation-strategy-control";
|
|
3
3
|
export declare class StrategyControl extends CommonControl {
|
|
4
4
|
private store;
|
|
5
|
-
private onboardingStore;
|
|
6
5
|
private storeUnsubscription;
|
|
7
6
|
private listeners;
|
|
8
7
|
private lastPaintedState;
|
|
@@ -10,14 +9,6 @@ export declare class StrategyControl extends CommonControl {
|
|
|
10
9
|
getTemplate(): string;
|
|
11
10
|
private _strategyAction;
|
|
12
11
|
onRender(): void;
|
|
13
|
-
/**
|
|
14
|
-
* Whether the document itself says this block has no strategy.
|
|
15
|
-
*
|
|
16
|
-
* Read the node, not the store: when the main control cannot resolve the block id off the
|
|
17
|
-
* node it never syncs the persisted config, so the store still holds defaults (empty
|
|
18
|
-
* strategyId) for an assigned block.
|
|
19
|
-
*/
|
|
20
|
-
private _isNodeUnassigned;
|
|
21
12
|
onDestroy(): void;
|
|
22
13
|
private _teardown;
|
|
23
14
|
private _setupButtonListeners;
|
|
@@ -71,10 +71,8 @@ interface StoreState {
|
|
|
71
71
|
strategies: RrsStrategy[];
|
|
72
72
|
strategiesLoading: boolean;
|
|
73
73
|
strategyUrlTemplates: Record<string, string>;
|
|
74
|
-
strategiesFetched: boolean;
|
|
75
74
|
blockStates: Record<number, PerBlockState>;
|
|
76
75
|
currentRecommendationId: number | null;
|
|
77
|
-
strategyPanelOpen: boolean;
|
|
78
76
|
configVersion: number;
|
|
79
77
|
}
|
|
80
78
|
export declare const useRecommendationExtensionStore: import("pinia").StoreDefinition<"guidoRecommendationExtension", StoreState, {
|
|
@@ -101,10 +99,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
101
99
|
}[];
|
|
102
100
|
strategiesLoading: boolean;
|
|
103
101
|
strategyUrlTemplates: Record<string, string>;
|
|
104
|
-
strategiesFetched: boolean;
|
|
105
102
|
blockStates: Record<number, PerBlockState>;
|
|
106
103
|
currentRecommendationId: number | null;
|
|
107
|
-
strategyPanelOpen: boolean;
|
|
108
104
|
configVersion: number;
|
|
109
105
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): PerBlockConfigs;
|
|
110
106
|
/**
|
|
@@ -129,10 +125,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
129
125
|
}[];
|
|
130
126
|
strategiesLoading: boolean;
|
|
131
127
|
strategyUrlTemplates: Record<string, string>;
|
|
132
|
-
strategiesFetched: boolean;
|
|
133
128
|
blockStates: Record<number, PerBlockState>;
|
|
134
129
|
currentRecommendationId: number | null;
|
|
135
|
-
strategyPanelOpen: boolean;
|
|
136
130
|
configVersion: number;
|
|
137
131
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): RecommendationProduct[];
|
|
138
132
|
/**
|
|
@@ -157,10 +151,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
157
151
|
}[];
|
|
158
152
|
strategiesLoading: boolean;
|
|
159
153
|
strategyUrlTemplates: Record<string, string>;
|
|
160
|
-
strategiesFetched: boolean;
|
|
161
154
|
blockStates: Record<number, PerBlockState>;
|
|
162
155
|
currentRecommendationId: number | null;
|
|
163
|
-
strategyPanelOpen: boolean;
|
|
164
156
|
configVersion: number;
|
|
165
157
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
166
158
|
assignStrategyDrawerStatus(state: {
|
|
@@ -182,10 +174,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
182
174
|
}[];
|
|
183
175
|
strategiesLoading: boolean;
|
|
184
176
|
strategyUrlTemplates: Record<string, string>;
|
|
185
|
-
strategiesFetched: boolean;
|
|
186
177
|
blockStates: Record<number, PerBlockState>;
|
|
187
178
|
currentRecommendationId: number | null;
|
|
188
|
-
strategyPanelOpen: boolean;
|
|
189
179
|
configVersion: number;
|
|
190
180
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
191
181
|
removeStrategyModalStatus(state: {
|
|
@@ -207,10 +197,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
207
197
|
}[];
|
|
208
198
|
strategiesLoading: boolean;
|
|
209
199
|
strategyUrlTemplates: Record<string, string>;
|
|
210
|
-
strategiesFetched: boolean;
|
|
211
200
|
blockStates: Record<number, PerBlockState>;
|
|
212
201
|
currentRecommendationId: number | null;
|
|
213
|
-
strategyPanelOpen: boolean;
|
|
214
202
|
configVersion: number;
|
|
215
203
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
216
204
|
assignedStrategy(state: {
|
|
@@ -232,10 +220,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
232
220
|
}[];
|
|
233
221
|
strategiesLoading: boolean;
|
|
234
222
|
strategyUrlTemplates: Record<string, string>;
|
|
235
|
-
strategiesFetched: boolean;
|
|
236
223
|
blockStates: Record<number, PerBlockState>;
|
|
237
224
|
currentRecommendationId: number | null;
|
|
238
|
-
strategyPanelOpen: boolean;
|
|
239
225
|
configVersion: number;
|
|
240
226
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): RrsStrategy | null;
|
|
241
227
|
/**
|
|
@@ -260,10 +246,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
260
246
|
}[];
|
|
261
247
|
strategiesLoading: boolean;
|
|
262
248
|
strategyUrlTemplates: Record<string, string>;
|
|
263
|
-
strategiesFetched: boolean;
|
|
264
249
|
blockStates: Record<number, PerBlockState>;
|
|
265
250
|
currentRecommendationId: number | null;
|
|
266
|
-
strategyPanelOpen: boolean;
|
|
267
251
|
configVersion: number;
|
|
268
252
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
269
253
|
/**
|
|
@@ -288,10 +272,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
288
272
|
}[];
|
|
289
273
|
strategiesLoading: boolean;
|
|
290
274
|
strategyUrlTemplates: Record<string, string>;
|
|
291
|
-
strategiesFetched: boolean;
|
|
292
275
|
blockStates: Record<number, PerBlockState>;
|
|
293
276
|
currentRecommendationId: number | null;
|
|
294
|
-
strategyPanelOpen: boolean;
|
|
295
277
|
configVersion: number;
|
|
296
278
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): number;
|
|
297
279
|
hasFilters(): boolean;
|
|
@@ -317,10 +299,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
317
299
|
}[];
|
|
318
300
|
strategiesLoading: boolean;
|
|
319
301
|
strategyUrlTemplates: Record<string, string>;
|
|
320
|
-
strategiesFetched: boolean;
|
|
321
302
|
blockStates: Record<number, PerBlockState>;
|
|
322
303
|
currentRecommendationId: number | null;
|
|
323
|
-
strategyPanelOpen: boolean;
|
|
324
304
|
configVersion: number;
|
|
325
305
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => {
|
|
326
306
|
text: string;
|
|
@@ -345,10 +325,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
345
325
|
}[];
|
|
346
326
|
strategiesLoading: boolean;
|
|
347
327
|
strategyUrlTemplates: Record<string, string>;
|
|
348
|
-
strategiesFetched: boolean;
|
|
349
328
|
blockStates: Record<number, PerBlockState>;
|
|
350
329
|
currentRecommendationId: number | null;
|
|
351
|
-
strategyPanelOpen: boolean;
|
|
352
330
|
configVersion: number;
|
|
353
331
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => {
|
|
354
332
|
text: string;
|
|
@@ -373,10 +351,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
373
351
|
}[];
|
|
374
352
|
strategiesLoading: boolean;
|
|
375
353
|
strategyUrlTemplates: Record<string, string>;
|
|
376
|
-
strategiesFetched: boolean;
|
|
377
354
|
blockStates: Record<number, PerBlockState>;
|
|
378
355
|
currentRecommendationId: number | null;
|
|
379
|
-
strategyPanelOpen: boolean;
|
|
380
356
|
configVersion: number;
|
|
381
357
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => {
|
|
382
358
|
text: string;
|
|
@@ -457,38 +433,6 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
457
433
|
openRemoveStrategyModal(): void;
|
|
458
434
|
closeRemoveStrategyModal(): void;
|
|
459
435
|
fetchStrategies(): Promise<void>;
|
|
460
|
-
invalidateStrategies(): void;
|
|
461
|
-
/**
|
|
462
|
-
* Opens a Smart Recommender strategy page in a new tab and refreshes the list every time
|
|
463
|
-
* the user comes back. `visibilitychange` covers the tab case; `focus` covers the page
|
|
464
|
-
* landing in a separate window, where this document never goes hidden.
|
|
465
|
-
*
|
|
466
|
-
* Deliberately NOT one-shot: the strategy tab stays open, so a user can create a second
|
|
467
|
-
* strategy in it and come back again — a listener that disarmed on the first return would
|
|
468
|
-
* leave that one missing from the list. Armed only once the user actually opens a strategy
|
|
469
|
-
* page, so anyone who never does pays nothing.
|
|
470
|
-
*/
|
|
471
|
-
_armStrategyPageReturn(url: string): void;
|
|
472
|
-
/**
|
|
473
|
-
* Reloads the products of the block the user is on, so an edit made in the strategy tab
|
|
474
|
-
* lands on the canvas instead of waiting for the assign drawer to be reopened.
|
|
475
|
-
*
|
|
476
|
-
* Only the selected block: the canvas regeneration is driven off the active block's
|
|
477
|
-
* product array, so refreshing an unselected block would fetch without redrawing it.
|
|
478
|
-
*/
|
|
479
|
-
_refreshAssignedStrategyProducts(): Promise<void>;
|
|
480
|
-
/** Lets the editor tear the return listeners down when it unmounts. */
|
|
481
|
-
disposeStrategyPageReturn(): void;
|
|
482
|
-
/**
|
|
483
|
-
* Opens Smart Recommender's strategy creation page. Every return refreshes the list so the
|
|
484
|
-
* new strategy is offered; the user picks it themselves.
|
|
485
|
-
*/
|
|
486
|
-
openStrategyCreation(): void;
|
|
487
|
-
/**
|
|
488
|
-
* Opens the strategy's edit page. Every return refreshes the list so the block reflects the
|
|
489
|
-
* edited configuration.
|
|
490
|
-
*/
|
|
491
|
-
openStrategyEdit(strategyId: string | number): void;
|
|
492
436
|
resolveStrategyUrlTemplate(strategy: RrsStrategy, currency: string): Promise<string>;
|
|
493
437
|
assignStrategy(strategy: RrsStrategy): void;
|
|
494
438
|
removeStrategy(): void;
|
|
@@ -506,11 +450,6 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
506
450
|
* every block's recommendationConfigs across user edits.
|
|
507
451
|
*/
|
|
508
452
|
hasInvalidBlock(): boolean;
|
|
509
|
-
/**
|
|
510
|
-
* Which required fields are missing across the design's blocks, so the save
|
|
511
|
-
* toaster can name the cause instead of always showing the generic message.
|
|
512
|
-
*/
|
|
513
|
-
invalidBlockFields(): string[];
|
|
514
453
|
fetchRecommendationProducts(): Promise<void>;
|
|
515
454
|
_doFetchProducts(): Promise<void>;
|
|
516
455
|
_doFetchStrategyProducts(blockId: number): Promise<void>;
|
|
@@ -15,11 +15,7 @@ export interface RequiredField {
|
|
|
15
15
|
getAvailableOptions?: (store: ExtensionStoreSlice) => string[];
|
|
16
16
|
condition?: (config: PerBlockConfigs) => boolean;
|
|
17
17
|
}
|
|
18
|
-
/** Field key of the strategy/algorithm descriptor, used to pick the toaster message. */
|
|
19
|
-
export declare const STRATEGY_FIELD_KEY = "strategy";
|
|
20
18
|
export declare const REQUIRED_RECOMMENDATION_FIELDS: RequiredField[];
|
|
21
19
|
export declare const RecommendationRequiredFieldsKey = "newsletter.recommendation-fill-required-fields";
|
|
22
|
-
/** Shown instead of the generic message when the only thing missing is the strategy. */
|
|
23
|
-
export declare const RecommendationAssignStrategyKey = "newsletter.recommendation-assign-strategy";
|
|
24
20
|
export declare function getInvalidFields(config: PerBlockConfigs, store: ExtensionStoreSlice, fields?: RequiredField[]): string[];
|
|
25
21
|
export declare function isConfigValid(config: PerBlockConfigs, store: ExtensionStoreSlice): boolean;
|