@useinsider/guido 3.18.2-beta.f42547e → 3.18.2-beta.fc246a7
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 +51 -70
- package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +37 -23
- 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 +46 -56
- package/dist/composables/useHtmlValidator.js +79 -84
- package/dist/composables/useHttp.js +22 -24
- package/dist/composables/useRecommendation.js +35 -40
- package/dist/composables/useStripo.js +30 -30
- package/dist/config/migrator/itemsBlockMigrator.js +257 -167
- package/dist/enums/extensions/recommendationBlock.js +31 -38
- package/dist/extensions/Blocks/Items/constants/cardLayout.js +20 -0
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +18 -17
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +114 -105
- package/dist/extensions/Blocks/Items/enums/productEnums.js +14 -9
- package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +11 -9
- package/dist/extensions/Blocks/Items/template.js +219 -204
- package/dist/extensions/Blocks/Recommendation/block.js +39 -43
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +20 -21
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +35 -40
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +52 -84
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +74 -74
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +90 -189
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +16 -26
- package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +12 -21
- package/dist/guido.css +1 -1
- package/dist/services/templateLibraryApi.js +14 -17
- package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -2
- package/dist/src/extensions/Blocks/Items/constants/cardLayout.d.ts +44 -0
- package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +3 -0
- package/dist/src/extensions/Blocks/Items/template.d.ts +19 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- 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/controls/main/utils.d.ts +2 -7
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -75
- package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +0 -4
- package/dist/src/stores/onboarding.d.ts +0 -377
- package/dist/src/utils/genericUtil.d.ts +0 -6
- package/dist/static/styles/components/recommendation-strategy.css.js +4 -34
- package/dist/stores/onboarding.js +36 -41
- package/dist/utils/genericUtil.js +39 -45
- package/dist/utils/pairProductVariables.js +71 -71
- package/dist/utils/templatePreparation.js +60 -61
- 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/extensions/Blocks/Recommendation/utils/strategyCommit.js +0 -24
- package/dist/src/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.d.ts +0 -2
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyCommit.d.ts +0 -14
- package/dist/static/styles/components/skeleton.css.js +0 -23
|
@@ -4,14 +4,13 @@ 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
|
|
9
|
-
import { useSaveAsTemplateStore as
|
|
7
|
+
import { ToasterTypeOptions as N } from "../enums/toaster.js";
|
|
8
|
+
import { useRecommendationExtensionStore as x } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
9
|
+
import { useSaveAsTemplateStore as E } from "../stores/save-as-template.js";
|
|
10
10
|
import { base64EncodeWithSpecialChars as r } from "../utils/base64.js";
|
|
11
|
-
import { isPlainObject as P } from "../utils/genericUtil.js";
|
|
12
11
|
import { useTemplatePreparation as A } from "../utils/templatePreparation.js";
|
|
13
|
-
const
|
|
14
|
-
const { get: n, post: m } = b(), { handleError: o, showToaster: l } = C(), { config: c, isFeatureEnabled: p } = w(), { validateLiquidSyntax:
|
|
12
|
+
const j = () => {
|
|
13
|
+
const { get: n, post: m } = b(), { handleError: o, showToaster: l } = C(), { config: c, isFeatureEnabled: p } = w(), { validateLiquidSyntax: g } = S(), u = h();
|
|
15
14
|
return {
|
|
16
15
|
getCategories: async () => {
|
|
17
16
|
try {
|
|
@@ -41,10 +40,10 @@ const B = () => {
|
|
|
41
40
|
createTemplate: async () => {
|
|
42
41
|
var e, t, d, y;
|
|
43
42
|
try {
|
|
44
|
-
const { prepareTemplateDetails: i } = A(), s =
|
|
45
|
-
if (p("liquidSyntax") && !await
|
|
43
|
+
const { prepareTemplateDetails: i } = A(), s = E(), a = await i();
|
|
44
|
+
if (p("liquidSyntax") && !await g(a.compiledHtml))
|
|
46
45
|
return !1;
|
|
47
|
-
const
|
|
46
|
+
const f = {
|
|
48
47
|
name: s.getTemplateName,
|
|
49
48
|
categories: s.getSelectedCategoryIds,
|
|
50
49
|
productId: ((t = (e = c.value) == null ? void 0 : e.partner) == null ? void 0 : t.productType) || 0,
|
|
@@ -55,7 +54,7 @@ const B = () => {
|
|
|
55
54
|
unsubscriptionPreferencePageStatus: !1,
|
|
56
55
|
unsubscriptionPreferencePages: [],
|
|
57
56
|
recommendationCampaignUrls: r(
|
|
58
|
-
|
|
57
|
+
x().recommendationCampaignUrls
|
|
59
58
|
),
|
|
60
59
|
recommendationConfigs: r({}),
|
|
61
60
|
isGuido: !0,
|
|
@@ -67,18 +66,16 @@ const B = () => {
|
|
|
67
66
|
css: a.css,
|
|
68
67
|
dynamicContentList: a.dynamicContentList
|
|
69
68
|
})
|
|
70
|
-
}, { data:
|
|
69
|
+
}, { data: { type: T } } = await m(
|
|
71
70
|
"/newsletter/template-library/create-template",
|
|
72
|
-
|
|
71
|
+
f
|
|
73
72
|
);
|
|
74
|
-
|
|
75
|
-
throw new Error("Unexpected create-template response");
|
|
76
|
-
return g.type === "alert" ? (l({
|
|
73
|
+
return T === "alert" ? (l({
|
|
77
74
|
message: u(
|
|
78
75
|
"newsletter.template-library-save-alert",
|
|
79
76
|
{ templateName: s.getTemplateName }
|
|
80
77
|
),
|
|
81
|
-
type:
|
|
78
|
+
type: N.Error
|
|
82
79
|
}), !1) : (l({
|
|
83
80
|
message: u(
|
|
84
81
|
"newsletter.template-library-save-success",
|
|
@@ -93,5 +90,5 @@ const B = () => {
|
|
|
93
90
|
};
|
|
94
91
|
};
|
|
95
92
|
export {
|
|
96
|
-
|
|
93
|
+
j as useTemplateLibraryApi
|
|
97
94
|
};
|
|
@@ -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
|
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single owner for the Items card orientation-dependent layout contract (SD-149368).
|
|
3
|
+
*
|
|
4
|
+
* Two things depend on a card's orientation and are written across several layers:
|
|
5
|
+
*
|
|
6
|
+
* 1. Name column width — a horizontal card lays the name in a narrow side-by-side
|
|
7
|
+
* column, so it is capped; a vertical card gives it a full-width row.
|
|
8
|
+
* 2. Block-cell padding — the collapsible price / original-price block-cell carries its
|
|
9
|
+
* own inter-cell spacing (horizontal cards pad left/right, vertical cards pad
|
|
10
|
+
* top/bottom) so a hidden element removes its own spacing instead of leaving a gap.
|
|
11
|
+
*
|
|
12
|
+
* Every layer that writes these — template render, layouts/horizontal.html,
|
|
13
|
+
* NameTrimmingControl (trimming toggle) and settingsControl (orientation change) — MUST
|
|
14
|
+
* derive them here, or a migrated / re-toggled card silently drifts out of sync with
|
|
15
|
+
* freshly generated markup (convention B1: cross-layer literals live in one module).
|
|
16
|
+
*/
|
|
17
|
+
export declare const NAME_HORIZONTAL_MAX_WIDTH = "130px";
|
|
18
|
+
export declare const NAME_VERTICAL_MAX_WIDTH = "100%";
|
|
19
|
+
/** Name max-width for a card orientation. Non-horizontal (incl. undefined) → full width. */
|
|
20
|
+
export declare const nameMaxWidthFor: (orientation?: string) => string;
|
|
21
|
+
/** Orientation-dependent inter-cell padding classes for a collapsible block-cell. */
|
|
22
|
+
export declare const BLOCK_CELL_PADDING: {
|
|
23
|
+
readonly VERTICAL: "es-p5b es-p5t";
|
|
24
|
+
readonly HORIZONTAL: "es-p5l es-p5r";
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Attribute the block-cell carries to mark its LAYOUT-owned padding orientation ('v'|'h').
|
|
28
|
+
* The orientation toggle keys off this marker so it only ever rewrites the padding the
|
|
29
|
+
* layout itself baked — a user's own es-p* padding classes are never matched or clobbered
|
|
30
|
+
* (SD-149368 F1), and a cell without the marker is left untouched rather than mis-swapped.
|
|
31
|
+
*/
|
|
32
|
+
export declare const BLOCK_CELL_PAD_ATTR = "data-items-cell-pad";
|
|
33
|
+
/** Marker attribute (`data-items-cell-pad="v|h"`) for a block-cell in the given orientation. */
|
|
34
|
+
export declare const blockCellPadMarker: (isVertical: boolean) => string;
|
|
35
|
+
/** Padding classes (leading space included) for a block-cell in the given orientation. */
|
|
36
|
+
export declare const blockCellPaddingFor: (isVertical: boolean) => string;
|
|
37
|
+
/**
|
|
38
|
+
* Rewrites a block-cell's LAYOUT-owned padding classes to the target orientation, keyed off
|
|
39
|
+
* the BLOCK_CELL_PAD_ATTR marker. The orientation-change rebuild re-injects existing cells
|
|
40
|
+
* via getOuterHTML(), which still carry the previous orientation's padding — swap only the
|
|
41
|
+
* layout pair (and flip the marker) so price/original-price cells stay padded after a toggle
|
|
42
|
+
* (SD-149368 F3), while a user's own padding and any unmarked cell are left alone (F1).
|
|
43
|
+
*/
|
|
44
|
+
export declare const reorientBlockCellPadding: (html: string, toVertical: boolean) => string;
|
|
@@ -39,14 +39,17 @@ export declare const productPairs: {
|
|
|
39
39
|
CART_ITEMS: {
|
|
40
40
|
ATTR: string;
|
|
41
41
|
DEFAULT: string;
|
|
42
|
+
LEGACY_DEFAULTS: readonly string[];
|
|
42
43
|
};
|
|
43
44
|
BROWSED_ITEMS: {
|
|
44
45
|
ATTR: string;
|
|
45
46
|
DEFAULT: string;
|
|
47
|
+
LEGACY_DEFAULTS: readonly string[];
|
|
46
48
|
};
|
|
47
49
|
PURCHASED_ITEMS: {
|
|
48
50
|
ATTR: string;
|
|
49
51
|
DEFAULT: string;
|
|
52
|
+
LEGACY_DEFAULTS: readonly string[];
|
|
50
53
|
};
|
|
51
54
|
};
|
|
52
55
|
price: {
|
|
@@ -37,6 +37,25 @@ type TemplateParameters = {
|
|
|
37
37
|
/** Price orientation within the card ('vertical' = stacked, 'horizontal' = side-by-side) */
|
|
38
38
|
priceOrientation?: PriceOrientationType;
|
|
39
39
|
};
|
|
40
|
+
/**
|
|
41
|
+
* Applies price orientation styles to the generated HTML template.
|
|
42
|
+
*
|
|
43
|
+
* For Vertical Layout:
|
|
44
|
+
* - vertical price orientation: both cells 100% (stacked)
|
|
45
|
+
* - horizontal price orientation with both visible: both cells 50% (side-by-side)
|
|
46
|
+
* - horizontal price orientation with one hidden: visible cell 100%
|
|
47
|
+
*
|
|
48
|
+
* For Horizontal Layout:
|
|
49
|
+
* - horizontal price orientation: .horizontal-price visible, .vertical-price hidden
|
|
50
|
+
* - vertical price orientation: .horizontal-price hidden, .vertical-price visible
|
|
51
|
+
* @param html - The HTML template string with placeholders replaced
|
|
52
|
+
* @param layoutOrientation - The card layout orientation ('vertical' or 'horizontal')
|
|
53
|
+
* @param priceOrientation - The price orientation within the card ('vertical' or 'horizontal')
|
|
54
|
+
* @param isPriceVisible - Whether the price element is visible
|
|
55
|
+
* @param isOriginalPriceVisible - Whether the original price element is visible
|
|
56
|
+
* @returns HTML string with price orientation styles applied
|
|
57
|
+
*/
|
|
58
|
+
export declare const applyPriceOrientationStyles: (html: string, layoutOrientation: OrientationType, priceOrientation: PriceOrientationType, isPriceVisible?: boolean, isOriginalPriceVisible?: boolean) => string;
|
|
40
59
|
/**
|
|
41
60
|
* Generates the default template for the Items Block.
|
|
42
61
|
* @param params - Template parameters including orientation, items type, item ID, and formatting options
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
import type { RecommendationNodeConfig, CurrencyConfig, OmnibusTextConfig } from '../types/nodeConfig';
|
|
11
11
|
export declare const PRE_RRS_CONFIG_VERSION = 1;
|
|
12
12
|
export declare const CURRENT_CONFIG_VERSION = 2;
|
|
13
|
-
export declare const RRS_CONFIG_VERSION = 2;
|
|
14
13
|
/**
|
|
15
14
|
* Default currency configuration
|
|
16
15
|
* Uses USD as the base currency with standard formatting
|
|
@@ -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_RECOMMENDATION_TITLE, SELECTOR_TITLE_CELL, ATTR_CUSTOM_PREFIX, ATTR_DATA_CARD_COMPOSITION, ATTR_DATA_CUSTOM_ATTRIBUTES, ATTR_PRODUCT_ATTR, CSS_CLASS_ATTRIBUTE_ROW, CSS_CLASS_SPACER, SELECTOR_ATTRIBUTE_ROW, ATTR_DATA_ATTRIBUTE_TYPE, ATTR_DATA_VISIBILITY, PRODUCT_ATTRIBUTE_PREFIX, BUILT_IN_DEFAULT_ATTRIBUTES, } from './selectors';
|
|
12
12
|
export { LAYOUT_VALUES, LAYOUT_OPTIONS, DEFAULT_PRODUCTS_PER_ROW, DEFAULT_CARDS_IN_ROW, DEFAULT_MOBILE_CARDS_IN_ROW, MAX_PRODUCT_COUNT, MIN_PRODUCT_COUNT, MAX_PRODUCTS_PER_ROW, MIN_PRODUCTS_PER_ROW, MAX_MOBILE_PRODUCTS_PER_ROW, MIN_MOBILE_PRODUCTS_PER_ROW, DEFAULT_COLUMN_SPACING, DEFAULT_ROW_SPACING, DEFAULT_MOBILE_COLUMN_SPACING, DEFAULT_MOBILE_ROW_SPACING, MIN_SPACING, MAX_SPACING, SPACING_STEP, } from './layout';
|
|
13
|
-
export { DEFAULT_NODE_CONFIG, DEFAULT_CURRENCY, DEFAULT_COMPOSITION, DEFAULT_VISIBILITY, CURRENT_CONFIG_VERSION, PRE_RRS_CONFIG_VERSION,
|
|
13
|
+
export { DEFAULT_NODE_CONFIG, DEFAULT_CURRENCY, DEFAULT_COMPOSITION, DEFAULT_VISIBILITY, CURRENT_CONFIG_VERSION, PRE_RRS_CONFIG_VERSION, EXCLUDED_ALGORITHM_IDS, } from './defaultConfig';
|
|
@@ -70,8 +70,6 @@ export declare class RecommendationBlockControl extends CommonControl {
|
|
|
70
70
|
* state was rebuilt with (SD-150347).
|
|
71
71
|
*/
|
|
72
72
|
private _syncNodeConfigIfChanged;
|
|
73
|
-
/** Whether the deferred write would move the node's strategyId — see the caller (SD-149916). */
|
|
74
|
-
private _isPendingStrategyIdChange;
|
|
75
73
|
private _capturePendingNodeConfigWrite;
|
|
76
74
|
/**
|
|
77
75
|
* 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;
|
|
@@ -107,7 +107,7 @@ export interface RegenerateWithStylesOptions extends Omit<RegenerateProductRowsO
|
|
|
107
107
|
* HTML removes the need for any post-rebuild reapply pass.
|
|
108
108
|
* @param options - Configuration options for regeneration
|
|
109
109
|
*/
|
|
110
|
-
export declare function regenerateProductRowsWithStyles(options: RegenerateWithStylesOptions):
|
|
110
|
+
export declare function regenerateProductRowsWithStyles(options: RegenerateWithStylesOptions): void;
|
|
111
111
|
/**
|
|
112
112
|
* Adjusts a products array to a target size.
|
|
113
113
|
* Used by ProductLayoutControl to synchronously match products to the new size
|
|
@@ -151,11 +151,6 @@ export interface UpdateProductContentInPlaceOptions {
|
|
|
151
151
|
currentNode: ImmutableHtmlNode | null | undefined;
|
|
152
152
|
documentModifier: DocumentModifier;
|
|
153
153
|
products: RecommendationProduct[];
|
|
154
|
-
/**
|
|
155
|
-
* Called when the batch was actually committed. Identical products commit nothing, which
|
|
156
|
-
* leaves anything a caller staged into the same batch unwritten unless it applies itself.
|
|
157
|
-
*/
|
|
158
|
-
onApplied?: () => void;
|
|
159
154
|
}
|
|
160
155
|
/**
|
|
161
156
|
* Updates product content in-place without regenerating HTML structure.
|
|
@@ -166,7 +161,7 @@ export interface UpdateProductContentInPlaceOptions {
|
|
|
166
161
|
* After updating desktop, also updates mobile container to keep them in sync.
|
|
167
162
|
*
|
|
168
163
|
* Falls back to false when product count changed (need to add/remove elements).
|
|
169
|
-
* @param options - Configuration options
|
|
164
|
+
* @param options - Configuration options
|
|
170
165
|
* @returns true if in-place update was successful, false to fall back to full regeneration
|
|
171
166
|
*/
|
|
172
167
|
export declare function updateProductContentInPlace(options: UpdateProductContentInPlaceOptions): boolean;
|
|
@@ -83,11 +83,8 @@ interface StoreState {
|
|
|
83
83
|
strategies: RrsStrategy[];
|
|
84
84
|
strategiesLoading: boolean;
|
|
85
85
|
strategyUrlTemplates: Record<string, string>;
|
|
86
|
-
strategiesFetched: boolean;
|
|
87
|
-
strategiesSettled: boolean;
|
|
88
86
|
blockStates: Record<number, PerBlockState>;
|
|
89
87
|
currentRecommendationId: number | null;
|
|
90
|
-
strategyPanelOpen: boolean;
|
|
91
88
|
configVersion: number;
|
|
92
89
|
}
|
|
93
90
|
export declare const useRecommendationExtensionStore: import("pinia").StoreDefinition<"guidoRecommendationExtension", StoreState, {
|
|
@@ -114,11 +111,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
114
111
|
}[];
|
|
115
112
|
strategiesLoading: boolean;
|
|
116
113
|
strategyUrlTemplates: Record<string, string>;
|
|
117
|
-
strategiesFetched: boolean;
|
|
118
|
-
strategiesSettled: boolean;
|
|
119
114
|
blockStates: Record<number, PerBlockState>;
|
|
120
115
|
currentRecommendationId: number | null;
|
|
121
|
-
strategyPanelOpen: boolean;
|
|
122
116
|
configVersion: number;
|
|
123
117
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): PerBlockConfigs;
|
|
124
118
|
/**
|
|
@@ -143,11 +137,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
143
137
|
}[];
|
|
144
138
|
strategiesLoading: boolean;
|
|
145
139
|
strategyUrlTemplates: Record<string, string>;
|
|
146
|
-
strategiesFetched: boolean;
|
|
147
|
-
strategiesSettled: boolean;
|
|
148
140
|
blockStates: Record<number, PerBlockState>;
|
|
149
141
|
currentRecommendationId: number | null;
|
|
150
|
-
strategyPanelOpen: boolean;
|
|
151
142
|
configVersion: number;
|
|
152
143
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): RecommendationProduct[];
|
|
153
144
|
/**
|
|
@@ -172,11 +163,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
172
163
|
}[];
|
|
173
164
|
strategiesLoading: boolean;
|
|
174
165
|
strategyUrlTemplates: Record<string, string>;
|
|
175
|
-
strategiesFetched: boolean;
|
|
176
|
-
strategiesSettled: boolean;
|
|
177
166
|
blockStates: Record<number, PerBlockState>;
|
|
178
167
|
currentRecommendationId: number | null;
|
|
179
|
-
strategyPanelOpen: boolean;
|
|
180
168
|
configVersion: number;
|
|
181
169
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
182
170
|
assignStrategyDrawerStatus(state: {
|
|
@@ -198,11 +186,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
198
186
|
}[];
|
|
199
187
|
strategiesLoading: boolean;
|
|
200
188
|
strategyUrlTemplates: Record<string, string>;
|
|
201
|
-
strategiesFetched: boolean;
|
|
202
|
-
strategiesSettled: boolean;
|
|
203
189
|
blockStates: Record<number, PerBlockState>;
|
|
204
190
|
currentRecommendationId: number | null;
|
|
205
|
-
strategyPanelOpen: boolean;
|
|
206
191
|
configVersion: number;
|
|
207
192
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
208
193
|
removeStrategyModalStatus(state: {
|
|
@@ -224,11 +209,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
224
209
|
}[];
|
|
225
210
|
strategiesLoading: boolean;
|
|
226
211
|
strategyUrlTemplates: Record<string, string>;
|
|
227
|
-
strategiesFetched: boolean;
|
|
228
|
-
strategiesSettled: boolean;
|
|
229
212
|
blockStates: Record<number, PerBlockState>;
|
|
230
213
|
currentRecommendationId: number | null;
|
|
231
|
-
strategyPanelOpen: boolean;
|
|
232
214
|
configVersion: number;
|
|
233
215
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
234
216
|
assignedStrategy(state: {
|
|
@@ -250,11 +232,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
250
232
|
}[];
|
|
251
233
|
strategiesLoading: boolean;
|
|
252
234
|
strategyUrlTemplates: Record<string, string>;
|
|
253
|
-
strategiesFetched: boolean;
|
|
254
|
-
strategiesSettled: boolean;
|
|
255
235
|
blockStates: Record<number, PerBlockState>;
|
|
256
236
|
currentRecommendationId: number | null;
|
|
257
|
-
strategyPanelOpen: boolean;
|
|
258
237
|
configVersion: number;
|
|
259
238
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): RrsStrategy | null;
|
|
260
239
|
/**
|
|
@@ -279,11 +258,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
279
258
|
}[];
|
|
280
259
|
strategiesLoading: boolean;
|
|
281
260
|
strategyUrlTemplates: Record<string, string>;
|
|
282
|
-
strategiesFetched: boolean;
|
|
283
|
-
strategiesSettled: boolean;
|
|
284
261
|
blockStates: Record<number, PerBlockState>;
|
|
285
262
|
currentRecommendationId: number | null;
|
|
286
|
-
strategyPanelOpen: boolean;
|
|
287
263
|
configVersion: number;
|
|
288
264
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
289
265
|
/**
|
|
@@ -308,11 +284,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
308
284
|
}[];
|
|
309
285
|
strategiesLoading: boolean;
|
|
310
286
|
strategyUrlTemplates: Record<string, string>;
|
|
311
|
-
strategiesFetched: boolean;
|
|
312
|
-
strategiesSettled: boolean;
|
|
313
287
|
blockStates: Record<number, PerBlockState>;
|
|
314
288
|
currentRecommendationId: number | null;
|
|
315
|
-
strategyPanelOpen: boolean;
|
|
316
289
|
configVersion: number;
|
|
317
290
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): number;
|
|
318
291
|
hasFilters(): boolean;
|
|
@@ -338,11 +311,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
338
311
|
}[];
|
|
339
312
|
strategiesLoading: boolean;
|
|
340
313
|
strategyUrlTemplates: Record<string, string>;
|
|
341
|
-
strategiesFetched: boolean;
|
|
342
|
-
strategiesSettled: boolean;
|
|
343
314
|
blockStates: Record<number, PerBlockState>;
|
|
344
315
|
currentRecommendationId: number | null;
|
|
345
|
-
strategyPanelOpen: boolean;
|
|
346
316
|
configVersion: number;
|
|
347
317
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => {
|
|
348
318
|
text: string;
|
|
@@ -367,11 +337,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
367
337
|
}[];
|
|
368
338
|
strategiesLoading: boolean;
|
|
369
339
|
strategyUrlTemplates: Record<string, string>;
|
|
370
|
-
strategiesFetched: boolean;
|
|
371
|
-
strategiesSettled: boolean;
|
|
372
340
|
blockStates: Record<number, PerBlockState>;
|
|
373
341
|
currentRecommendationId: number | null;
|
|
374
|
-
strategyPanelOpen: boolean;
|
|
375
342
|
configVersion: number;
|
|
376
343
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => {
|
|
377
344
|
text: string;
|
|
@@ -396,11 +363,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
396
363
|
}[];
|
|
397
364
|
strategiesLoading: boolean;
|
|
398
365
|
strategyUrlTemplates: Record<string, string>;
|
|
399
|
-
strategiesFetched: boolean;
|
|
400
|
-
strategiesSettled: boolean;
|
|
401
366
|
blockStates: Record<number, PerBlockState>;
|
|
402
367
|
currentRecommendationId: number | null;
|
|
403
|
-
strategyPanelOpen: boolean;
|
|
404
368
|
configVersion: number;
|
|
405
369
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => {
|
|
406
370
|
text: string;
|
|
@@ -481,40 +445,6 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
481
445
|
openRemoveStrategyModal(): void;
|
|
482
446
|
closeRemoveStrategyModal(): void;
|
|
483
447
|
fetchStrategies(): Promise<void>;
|
|
484
|
-
invalidateStrategies(): void;
|
|
485
|
-
/**
|
|
486
|
-
* Opens a Smart Recommender strategy page in a new tab and refreshes the list every time
|
|
487
|
-
* the user comes back. `visibilitychange` only: a `focus` listener would also fire when
|
|
488
|
-
* focus merely returns from the Stripo canvas iframe to the panel, refetching and
|
|
489
|
-
* regenerating the canvas while the user never left the editor (SD-149916).
|
|
490
|
-
*
|
|
491
|
-
* Deliberately NOT one-shot: the strategy tab stays open, so a user can create a second
|
|
492
|
-
* strategy in it and come back again — a listener that disarmed on the first return would
|
|
493
|
-
* leave that one missing from the list. It disarms on the first return AFTER that tab is
|
|
494
|
-
* closed instead, so an ordinary alt-tab later in the session costs nothing. Armed only
|
|
495
|
-
* once the user actually opens a strategy page, so anyone who never does pays nothing.
|
|
496
|
-
*/
|
|
497
|
-
_armStrategyPageReturn(url: string): void;
|
|
498
|
-
/**
|
|
499
|
-
* Reloads the products of the block the user is on, so an edit made in the strategy tab
|
|
500
|
-
* lands on the canvas instead of waiting for the assign drawer to be reopened.
|
|
501
|
-
*
|
|
502
|
-
* Only the selected block: the canvas regeneration is driven off the active block's
|
|
503
|
-
* product array, so refreshing an unselected block would fetch without redrawing it.
|
|
504
|
-
*/
|
|
505
|
-
_refreshAssignedStrategyProducts(): Promise<void>;
|
|
506
|
-
/** Lets the editor tear the return listeners down when it unmounts. */
|
|
507
|
-
disposeStrategyPageReturn(): void;
|
|
508
|
-
/**
|
|
509
|
-
* Opens Smart Recommender's strategy creation page. Every return refreshes the list so the
|
|
510
|
-
* new strategy is offered; the user picks it themselves.
|
|
511
|
-
*/
|
|
512
|
-
openStrategyCreation(): void;
|
|
513
|
-
/**
|
|
514
|
-
* Opens the strategy's edit page. Every return refreshes the list so the block reflects the
|
|
515
|
-
* edited configuration.
|
|
516
|
-
*/
|
|
517
|
-
openStrategyEdit(strategyId: string | number): void;
|
|
518
448
|
resolveStrategyUrlTemplate(strategy: RrsStrategy, currency: string): Promise<string>;
|
|
519
449
|
assignStrategy(strategy: RrsStrategy): void;
|
|
520
450
|
removeStrategy(): void;
|
|
@@ -532,11 +462,6 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
532
462
|
* every block's recommendationConfigs across user edits.
|
|
533
463
|
*/
|
|
534
464
|
hasInvalidBlock(): boolean;
|
|
535
|
-
/**
|
|
536
|
-
* Which required fields are missing across the design's blocks, so the save
|
|
537
|
-
* toaster can name the cause instead of always showing the generic message.
|
|
538
|
-
*/
|
|
539
|
-
invalidBlockFields(): string[];
|
|
540
465
|
fetchRecommendationProducts(): Promise<void>;
|
|
541
466
|
_doFetchProducts(): Promise<void>;
|
|
542
467
|
_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;
|