@useinsider/guido 3.18.1-beta.e39fb14 → 3.18.1-beta.e489d08
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/dist/@types/config/schemas.js +26 -28
- package/dist/components/Guido.vue.js +6 -6
- package/dist/components/Guido.vue2.js +70 -72
- package/dist/components/organisms/AutoSaveController.vue2.js +8 -9
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +13 -11
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +65 -53
- package/dist/components/organisms/header/EditorActions.vue.js +2 -2
- package/dist/components/organisms/header/EditorActions.vue2.js +56 -86
- package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue2.js +12 -16
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +20 -18
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +21 -0
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +47 -0
- package/dist/components/wrappers/WpDrawer.vue.js +7 -9
- package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
- package/dist/composables/useCustomInterfaceAppearance.js +46 -41
- package/dist/composables/useHtmlCompiler.js +26 -37
- package/dist/composables/useHtmlValidator.js +84 -81
- package/dist/composables/useRecommendation.js +21 -18
- package/dist/composables/useSave.js +45 -90
- package/dist/composables/useStripo.js +7 -7
- package/dist/composables/validators/useCouponBlockValidator.js +21 -24
- package/dist/composables/validators/useUnsubscribeBlockValidator.js +27 -34
- package/dist/enums/extensions/recommendationBlock.js +38 -31
- package/dist/extensions/Blocks/Recommendation/block.js +43 -39
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +62 -57
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +80 -52
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +145 -75
- package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +21 -12
- package/dist/guido.css +1 -1
- package/dist/src/@types/config/schemas.d.ts +0 -4
- package/dist/src/components/Guido.vue.d.ts +1 -17
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -17
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -17
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -17
- package/dist/src/components/wrappers/WpDrawer.vue.d.ts +3 -4
- package/dist/src/composables/useConfig.d.ts +0 -2
- package/dist/src/composables/useHtmlValidator.d.ts +0 -21
- package/dist/src/composables/useSave.d.ts +1 -6
- package/dist/src/composables/validators/useCouponBlockValidator.d.ts +0 -3
- package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +0 -10
- package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +9 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +59 -3
- package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +4 -0
- package/dist/src/stores/config.d.ts +0 -30
- package/dist/src/stores/onboarding.d.ts +377 -0
- package/dist/src/utils/templatePreparation.d.ts +0 -30
- package/dist/static/styles/components/recommendation-strategy.css.js +51 -4
- package/dist/stores/config.js +22 -39
- package/dist/stores/onboarding.js +41 -36
- package/dist/utils/templatePreparation.js +47 -50
- package/package.json +1 -1
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +0 -20
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +0 -48
- package/dist/composables/useSaveValidation.js +0 -279
- package/dist/composables/useSaveValidationRollout.js +0 -9
- package/dist/enums/save-validation.js +0 -4
- package/dist/src/@types/save-validation.d.ts +0 -19
- package/dist/src/composables/useSaveValidation.d.ts +0 -6
- package/dist/src/composables/useSaveValidationRollout.d.ts +0 -3
- package/dist/src/enums/save-validation.d.ts +0 -27
- package/dist/src/stores/save-validation.d.ts +0 -22
- package/dist/stores/save-validation.js +0 -30
- /package/dist/src/components/organisms/{validation/ValidationErrorDrawer.vue.d.ts → onboarding/RecommendationStrategyOnboarding.vue.d.ts} +0 -0
|
@@ -99,7 +99,6 @@ export declare const useConfig: () => {
|
|
|
99
99
|
autosave: boolean;
|
|
100
100
|
allowlistEnabled: boolean;
|
|
101
101
|
linkTrackingIds: boolean;
|
|
102
|
-
allowSaveWithErrors: boolean;
|
|
103
102
|
reusableRecommendationStrategy: boolean;
|
|
104
103
|
};
|
|
105
104
|
blocks: {
|
|
@@ -235,7 +234,6 @@ export declare const useConfig: () => {
|
|
|
235
234
|
autosave: boolean;
|
|
236
235
|
allowlistEnabled: boolean;
|
|
237
236
|
linkTrackingIds: boolean;
|
|
238
|
-
allowSaveWithErrors: boolean;
|
|
239
237
|
reusableRecommendationStrategy: boolean;
|
|
240
238
|
} | null>;
|
|
241
239
|
blocks: import("vue").ComputedRef<{
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import type { DynamicContent } from '@@/Types/generic';
|
|
2
2
|
import type { FiltersResponse } from '@@/Types/recommendation';
|
|
3
|
-
/**
|
|
4
|
-
* Extracts recommendation block IDs directly from the HTML by parsing
|
|
5
|
-
* the recommendation-id attribute on block elements.
|
|
6
|
-
* This avoids depending on store state which may not be populated
|
|
7
|
-
* when the settings panel hasn't been opened yet (e.g., saved templates).
|
|
8
|
-
*/
|
|
9
|
-
export declare function getRecommendationBlockIds(html: string): string[];
|
|
10
3
|
/**
|
|
11
4
|
* Parses a `{{recoId_index_attributeName}}` variable (already stripped of the
|
|
12
5
|
* braces/whitespace) into its recommendation id and attribute name. Returns
|
|
@@ -34,20 +27,6 @@ export declare function buildPartnerAttributeNameSet(filterList: FiltersResponse
|
|
|
34
27
|
* before, so flagging it would false-positive on merge tags like `{{user.name}}`.
|
|
35
28
|
*/
|
|
36
29
|
export declare function findInvalidCustomFields(html: string, validCustomFields: string[], recommendationBlockIds: string[], ignoredIds: Set<string>, ignoredAttributeNames: Set<string> | null): string[];
|
|
37
|
-
/**
|
|
38
|
-
* Returns the invalid `{{ ... }}` dynamic-content tags found in the HTML.
|
|
39
|
-
*
|
|
40
|
-
* A tag's variable name is the part before the first `|` (everything after it is the fallback).
|
|
41
|
-
* Surrounding whitespace is always allowed (trimmed). A tag is valid only when the variable name
|
|
42
|
-
* is an allowed system token, or it is a clean identifier (`[A-Za-z0-9_.]`) and — when a `|` is
|
|
43
|
-
* present — the fallback after it is not empty. Otherwise the tag is invalid (e.g.
|
|
44
|
-
* `{{Api Response: OA1 Main Item Url}}` — spaces/`:` — or `{{bounce|}}` — empty fallback).
|
|
45
|
-
*
|
|
46
|
-
* `data-*` block-config attribute values are excluded from the scan: blocks such as Items/cart
|
|
47
|
-
* store product merge tags (`data-product_button_link="{{Abandoned Cart Item (1) Url}}"`) that the
|
|
48
|
-
* backend resolves through its own pipeline, so they must not be treated as user-authored tags.
|
|
49
|
-
*/
|
|
50
|
-
export declare function getInvalidDynamicContentTags(html: string): string[];
|
|
51
30
|
export declare const useHtmlValidator: () => {
|
|
52
31
|
validateHtml: (html: string, customFields: DynamicContent[], isOnSaveValidation?: boolean) => Promise<boolean>;
|
|
53
32
|
};
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import type { SavedTemplateDetails } from '@@/Types/stripo';
|
|
2
|
-
type SaveDetails = Omit<SavedTemplateDetails, 'metadata' | 'silent'>;
|
|
3
|
-
type SaveResult = SaveDetails | undefined;
|
|
4
2
|
export declare const useSave: () => {
|
|
5
|
-
save: (suppressEmit?: boolean, silent?: boolean) => Promise<
|
|
6
|
-
saveWithErrors: () => Promise<SaveResult>;
|
|
7
|
-
saveRawOnly: () => Promise<SaveResult>;
|
|
3
|
+
save: (suppressEmit?: boolean, silent?: boolean) => Promise<Omit<SavedTemplateDetails, "metadata" | "silent"> | undefined>;
|
|
8
4
|
};
|
|
9
|
-
export {};
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
export declare const COUPON_TAG_MODIFIED_KEY = "newsletter.coupon-tag-modified";
|
|
2
|
-
/** Pure core: the tag text of every coupon block whose code was modified. */
|
|
3
|
-
export declare function findInvalidCouponBlocks(html: string): string[];
|
|
4
1
|
export declare const useCouponBlockValidator: () => {
|
|
5
2
|
validateCouponBlockTags: (html: string) => boolean;
|
|
6
3
|
};
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
declare const SINGLETON_BLOCK_RULES: {
|
|
2
|
-
pageType: number;
|
|
3
|
-
messageKey: string;
|
|
4
|
-
}[];
|
|
5
|
-
export declare const EMPTY_BLOCK_KEY = "unsubscription-preference.select-page-to-continue";
|
|
6
|
-
/** Pure core: the singleton rules whose page type appears more than once. */
|
|
7
|
-
export declare function findDuplicateUnsubPageTypes(html: string): typeof SINGLETON_BLOCK_RULES;
|
|
8
|
-
/** Pure core: count of unsubscribe blocks with no page type or page list chosen. */
|
|
9
|
-
export declare function countUnsubBlocksWithoutPage(html: string): number;
|
|
10
1
|
export declare const useUnsubscribeBlockValidator: () => {
|
|
11
2
|
validateUnsubscribeBlockUniqueness: (html: string) => boolean;
|
|
12
3
|
validateUnsubscribeBlockHasTemplate: (html: string) => boolean;
|
|
13
4
|
};
|
|
14
|
-
export {};
|
|
@@ -5,7 +5,9 @@ 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;
|
|
8
9
|
};
|
|
10
|
+
export declare const strategyEditPath: (strategyId: string | number) => string;
|
|
9
11
|
export declare const QUERY_PARAMS: {
|
|
10
12
|
CLIENT_ID: string;
|
|
11
13
|
};
|
|
@@ -66,6 +66,8 @@ 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;
|
|
69
71
|
private _capturePendingNodeConfigWrite;
|
|
70
72
|
/**
|
|
71
73
|
* Accumulates the pending write into `documentModifier` without applying, so the
|
|
@@ -2,6 +2,7 @@ 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;
|
|
5
6
|
private storeUnsubscription;
|
|
6
7
|
private listeners;
|
|
7
8
|
private lastPaintedState;
|
|
@@ -9,6 +10,14 @@ export declare class StrategyControl extends CommonControl {
|
|
|
9
10
|
getTemplate(): string;
|
|
10
11
|
private _strategyAction;
|
|
11
12
|
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;
|
|
12
21
|
onDestroy(): void;
|
|
13
22
|
private _teardown;
|
|
14
23
|
private _setupButtonListeners;
|
|
@@ -71,8 +71,10 @@ interface StoreState {
|
|
|
71
71
|
strategies: RrsStrategy[];
|
|
72
72
|
strategiesLoading: boolean;
|
|
73
73
|
strategyUrlTemplates: Record<string, string>;
|
|
74
|
+
strategiesFetched: boolean;
|
|
74
75
|
blockStates: Record<number, PerBlockState>;
|
|
75
76
|
currentRecommendationId: number | null;
|
|
77
|
+
strategyPanelOpen: boolean;
|
|
76
78
|
configVersion: number;
|
|
77
79
|
}
|
|
78
80
|
export declare const useRecommendationExtensionStore: import("pinia").StoreDefinition<"guidoRecommendationExtension", StoreState, {
|
|
@@ -99,8 +101,10 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
99
101
|
}[];
|
|
100
102
|
strategiesLoading: boolean;
|
|
101
103
|
strategyUrlTemplates: Record<string, string>;
|
|
104
|
+
strategiesFetched: boolean;
|
|
102
105
|
blockStates: Record<number, PerBlockState>;
|
|
103
106
|
currentRecommendationId: number | null;
|
|
107
|
+
strategyPanelOpen: boolean;
|
|
104
108
|
configVersion: number;
|
|
105
109
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): PerBlockConfigs;
|
|
106
110
|
/**
|
|
@@ -125,8 +129,10 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
125
129
|
}[];
|
|
126
130
|
strategiesLoading: boolean;
|
|
127
131
|
strategyUrlTemplates: Record<string, string>;
|
|
132
|
+
strategiesFetched: boolean;
|
|
128
133
|
blockStates: Record<number, PerBlockState>;
|
|
129
134
|
currentRecommendationId: number | null;
|
|
135
|
+
strategyPanelOpen: boolean;
|
|
130
136
|
configVersion: number;
|
|
131
137
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): RecommendationProduct[];
|
|
132
138
|
/**
|
|
@@ -151,8 +157,10 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
151
157
|
}[];
|
|
152
158
|
strategiesLoading: boolean;
|
|
153
159
|
strategyUrlTemplates: Record<string, string>;
|
|
160
|
+
strategiesFetched: boolean;
|
|
154
161
|
blockStates: Record<number, PerBlockState>;
|
|
155
162
|
currentRecommendationId: number | null;
|
|
163
|
+
strategyPanelOpen: boolean;
|
|
156
164
|
configVersion: number;
|
|
157
165
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
158
166
|
assignStrategyDrawerStatus(state: {
|
|
@@ -174,8 +182,10 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
174
182
|
}[];
|
|
175
183
|
strategiesLoading: boolean;
|
|
176
184
|
strategyUrlTemplates: Record<string, string>;
|
|
185
|
+
strategiesFetched: boolean;
|
|
177
186
|
blockStates: Record<number, PerBlockState>;
|
|
178
187
|
currentRecommendationId: number | null;
|
|
188
|
+
strategyPanelOpen: boolean;
|
|
179
189
|
configVersion: number;
|
|
180
190
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
181
191
|
removeStrategyModalStatus(state: {
|
|
@@ -197,8 +207,10 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
197
207
|
}[];
|
|
198
208
|
strategiesLoading: boolean;
|
|
199
209
|
strategyUrlTemplates: Record<string, string>;
|
|
210
|
+
strategiesFetched: boolean;
|
|
200
211
|
blockStates: Record<number, PerBlockState>;
|
|
201
212
|
currentRecommendationId: number | null;
|
|
213
|
+
strategyPanelOpen: boolean;
|
|
202
214
|
configVersion: number;
|
|
203
215
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
204
216
|
assignedStrategy(state: {
|
|
@@ -220,8 +232,10 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
220
232
|
}[];
|
|
221
233
|
strategiesLoading: boolean;
|
|
222
234
|
strategyUrlTemplates: Record<string, string>;
|
|
235
|
+
strategiesFetched: boolean;
|
|
223
236
|
blockStates: Record<number, PerBlockState>;
|
|
224
237
|
currentRecommendationId: number | null;
|
|
238
|
+
strategyPanelOpen: boolean;
|
|
225
239
|
configVersion: number;
|
|
226
240
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): RrsStrategy | null;
|
|
227
241
|
/**
|
|
@@ -246,8 +260,10 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
246
260
|
}[];
|
|
247
261
|
strategiesLoading: boolean;
|
|
248
262
|
strategyUrlTemplates: Record<string, string>;
|
|
263
|
+
strategiesFetched: boolean;
|
|
249
264
|
blockStates: Record<number, PerBlockState>;
|
|
250
265
|
currentRecommendationId: number | null;
|
|
266
|
+
strategyPanelOpen: boolean;
|
|
251
267
|
configVersion: number;
|
|
252
268
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
253
269
|
/**
|
|
@@ -272,8 +288,10 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
272
288
|
}[];
|
|
273
289
|
strategiesLoading: boolean;
|
|
274
290
|
strategyUrlTemplates: Record<string, string>;
|
|
291
|
+
strategiesFetched: boolean;
|
|
275
292
|
blockStates: Record<number, PerBlockState>;
|
|
276
293
|
currentRecommendationId: number | null;
|
|
294
|
+
strategyPanelOpen: boolean;
|
|
277
295
|
configVersion: number;
|
|
278
296
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): number;
|
|
279
297
|
hasFilters(): boolean;
|
|
@@ -299,8 +317,10 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
299
317
|
}[];
|
|
300
318
|
strategiesLoading: boolean;
|
|
301
319
|
strategyUrlTemplates: Record<string, string>;
|
|
320
|
+
strategiesFetched: boolean;
|
|
302
321
|
blockStates: Record<number, PerBlockState>;
|
|
303
322
|
currentRecommendationId: number | null;
|
|
323
|
+
strategyPanelOpen: boolean;
|
|
304
324
|
configVersion: number;
|
|
305
325
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => {
|
|
306
326
|
text: string;
|
|
@@ -325,8 +345,10 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
325
345
|
}[];
|
|
326
346
|
strategiesLoading: boolean;
|
|
327
347
|
strategyUrlTemplates: Record<string, string>;
|
|
348
|
+
strategiesFetched: boolean;
|
|
328
349
|
blockStates: Record<number, PerBlockState>;
|
|
329
350
|
currentRecommendationId: number | null;
|
|
351
|
+
strategyPanelOpen: boolean;
|
|
330
352
|
configVersion: number;
|
|
331
353
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => {
|
|
332
354
|
text: string;
|
|
@@ -351,8 +373,10 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
351
373
|
}[];
|
|
352
374
|
strategiesLoading: boolean;
|
|
353
375
|
strategyUrlTemplates: Record<string, string>;
|
|
376
|
+
strategiesFetched: boolean;
|
|
354
377
|
blockStates: Record<number, PerBlockState>;
|
|
355
378
|
currentRecommendationId: number | null;
|
|
379
|
+
strategyPanelOpen: boolean;
|
|
356
380
|
configVersion: number;
|
|
357
381
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => {
|
|
358
382
|
text: string;
|
|
@@ -433,6 +457,38 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
433
457
|
openRemoveStrategyModal(): void;
|
|
434
458
|
closeRemoveStrategyModal(): void;
|
|
435
459
|
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;
|
|
436
492
|
resolveStrategyUrlTemplate(strategy: RrsStrategy, currency: string): Promise<string>;
|
|
437
493
|
assignStrategy(strategy: RrsStrategy): void;
|
|
438
494
|
removeStrategy(): void;
|
|
@@ -451,10 +507,10 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
451
507
|
*/
|
|
452
508
|
hasInvalidBlock(): boolean;
|
|
453
509
|
/**
|
|
454
|
-
*
|
|
455
|
-
*
|
|
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.
|
|
456
512
|
*/
|
|
457
|
-
|
|
513
|
+
invalidBlockFields(): string[];
|
|
458
514
|
fetchRecommendationProducts(): Promise<void>;
|
|
459
515
|
_doFetchProducts(): Promise<void>;
|
|
460
516
|
_doFetchStrategyProducts(blockId: number): Promise<void>;
|
|
@@ -15,7 +15,11 @@ 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";
|
|
18
20
|
export declare const REQUIRED_RECOMMENDATION_FIELDS: RequiredField[];
|
|
19
21
|
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";
|
|
20
24
|
export declare function getInvalidFields(config: PerBlockConfigs, store: ExtensionStoreSlice, fields?: RequiredField[]): string[];
|
|
21
25
|
export declare function isConfigValid(config: PerBlockConfigs, store: ExtensionStoreSlice): boolean;
|
|
@@ -104,7 +104,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
104
104
|
autosave: boolean;
|
|
105
105
|
allowlistEnabled: boolean;
|
|
106
106
|
linkTrackingIds: boolean;
|
|
107
|
-
allowSaveWithErrors: boolean;
|
|
108
107
|
reusableRecommendationStrategy: boolean;
|
|
109
108
|
};
|
|
110
109
|
blocks: {
|
|
@@ -246,7 +245,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
246
245
|
autosave: boolean;
|
|
247
246
|
allowlistEnabled: boolean;
|
|
248
247
|
linkTrackingIds: boolean;
|
|
249
|
-
allowSaveWithErrors: boolean;
|
|
250
248
|
reusableRecommendationStrategy: boolean;
|
|
251
249
|
};
|
|
252
250
|
blocks: {
|
|
@@ -388,7 +386,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
388
386
|
autosave: boolean;
|
|
389
387
|
allowlistEnabled: boolean;
|
|
390
388
|
linkTrackingIds: boolean;
|
|
391
|
-
allowSaveWithErrors: boolean;
|
|
392
389
|
reusableRecommendationStrategy: boolean;
|
|
393
390
|
};
|
|
394
391
|
blocks: {
|
|
@@ -530,7 +527,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
530
527
|
autosave: boolean;
|
|
531
528
|
allowlistEnabled: boolean;
|
|
532
529
|
linkTrackingIds: boolean;
|
|
533
|
-
allowSaveWithErrors: boolean;
|
|
534
530
|
reusableRecommendationStrategy: boolean;
|
|
535
531
|
};
|
|
536
532
|
blocks: {
|
|
@@ -672,7 +668,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
672
668
|
autosave: boolean;
|
|
673
669
|
allowlistEnabled: boolean;
|
|
674
670
|
linkTrackingIds: boolean;
|
|
675
|
-
allowSaveWithErrors: boolean;
|
|
676
671
|
reusableRecommendationStrategy: boolean;
|
|
677
672
|
};
|
|
678
673
|
blocks: {
|
|
@@ -814,7 +809,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
814
809
|
autosave: boolean;
|
|
815
810
|
allowlistEnabled: boolean;
|
|
816
811
|
linkTrackingIds: boolean;
|
|
817
|
-
allowSaveWithErrors: boolean;
|
|
818
812
|
reusableRecommendationStrategy: boolean;
|
|
819
813
|
};
|
|
820
814
|
blocks: {
|
|
@@ -956,7 +950,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
956
950
|
autosave: boolean;
|
|
957
951
|
allowlistEnabled: boolean;
|
|
958
952
|
linkTrackingIds: boolean;
|
|
959
|
-
allowSaveWithErrors: boolean;
|
|
960
953
|
reusableRecommendationStrategy: boolean;
|
|
961
954
|
};
|
|
962
955
|
blocks: {
|
|
@@ -1098,7 +1091,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1098
1091
|
autosave: boolean;
|
|
1099
1092
|
allowlistEnabled: boolean;
|
|
1100
1093
|
linkTrackingIds: boolean;
|
|
1101
|
-
allowSaveWithErrors: boolean;
|
|
1102
1094
|
reusableRecommendationStrategy: boolean;
|
|
1103
1095
|
};
|
|
1104
1096
|
blocks: {
|
|
@@ -1240,7 +1232,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1240
1232
|
autosave: boolean;
|
|
1241
1233
|
allowlistEnabled: boolean;
|
|
1242
1234
|
linkTrackingIds: boolean;
|
|
1243
|
-
allowSaveWithErrors: boolean;
|
|
1244
1235
|
reusableRecommendationStrategy: boolean;
|
|
1245
1236
|
};
|
|
1246
1237
|
blocks: {
|
|
@@ -1382,7 +1373,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1382
1373
|
autosave: boolean;
|
|
1383
1374
|
allowlistEnabled: boolean;
|
|
1384
1375
|
linkTrackingIds: boolean;
|
|
1385
|
-
allowSaveWithErrors: boolean;
|
|
1386
1376
|
reusableRecommendationStrategy: boolean;
|
|
1387
1377
|
};
|
|
1388
1378
|
blocks: {
|
|
@@ -1524,7 +1514,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1524
1514
|
autosave: boolean;
|
|
1525
1515
|
allowlistEnabled: boolean;
|
|
1526
1516
|
linkTrackingIds: boolean;
|
|
1527
|
-
allowSaveWithErrors: boolean;
|
|
1528
1517
|
reusableRecommendationStrategy: boolean;
|
|
1529
1518
|
};
|
|
1530
1519
|
blocks: {
|
|
@@ -1666,7 +1655,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1666
1655
|
autosave: boolean;
|
|
1667
1656
|
allowlistEnabled: boolean;
|
|
1668
1657
|
linkTrackingIds: boolean;
|
|
1669
|
-
allowSaveWithErrors: boolean;
|
|
1670
1658
|
reusableRecommendationStrategy: boolean;
|
|
1671
1659
|
};
|
|
1672
1660
|
blocks: {
|
|
@@ -1808,7 +1796,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1808
1796
|
autosave: boolean;
|
|
1809
1797
|
allowlistEnabled: boolean;
|
|
1810
1798
|
linkTrackingIds: boolean;
|
|
1811
|
-
allowSaveWithErrors: boolean;
|
|
1812
1799
|
reusableRecommendationStrategy: boolean;
|
|
1813
1800
|
};
|
|
1814
1801
|
blocks: {
|
|
@@ -1950,7 +1937,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1950
1937
|
autosave: boolean;
|
|
1951
1938
|
allowlistEnabled: boolean;
|
|
1952
1939
|
linkTrackingIds: boolean;
|
|
1953
|
-
allowSaveWithErrors: boolean;
|
|
1954
1940
|
reusableRecommendationStrategy: boolean;
|
|
1955
1941
|
};
|
|
1956
1942
|
blocks: {
|
|
@@ -2092,7 +2078,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2092
2078
|
autosave: boolean;
|
|
2093
2079
|
allowlistEnabled: boolean;
|
|
2094
2080
|
linkTrackingIds: boolean;
|
|
2095
|
-
allowSaveWithErrors: boolean;
|
|
2096
2081
|
reusableRecommendationStrategy: boolean;
|
|
2097
2082
|
};
|
|
2098
2083
|
blocks: {
|
|
@@ -2136,18 +2121,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2136
2121
|
};
|
|
2137
2122
|
} | null;
|
|
2138
2123
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => number;
|
|
2139
|
-
/**
|
|
2140
|
-
* Transactional campaigns keep the hard save block. Reactive getter, so
|
|
2141
|
-
* consumers stay safe in setup where a raw config read snapshots null (SD-147945).
|
|
2142
|
-
*/
|
|
2143
|
-
isTransactional(): boolean;
|
|
2144
|
-
/**
|
|
2145
|
-
* Soft-save policy: may the editor persist a template with validation errors?
|
|
2146
|
-
* Default true (host sets features.allowSaveWithErrors=false for transactional +
|
|
2147
|
-
* unsub). Reactive getter defaulting true — reading via isFeatureEnabled would
|
|
2148
|
-
* floor to false pre-init and momentarily hide the soft-save option (SD-147430).
|
|
2149
|
-
*/
|
|
2150
|
-
allowSaveWithErrors(): boolean;
|
|
2151
2124
|
/**
|
|
2152
2125
|
* Get the username
|
|
2153
2126
|
*/
|
|
@@ -2246,7 +2219,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2246
2219
|
autosave: boolean;
|
|
2247
2220
|
allowlistEnabled: boolean;
|
|
2248
2221
|
linkTrackingIds: boolean;
|
|
2249
|
-
allowSaveWithErrors: boolean;
|
|
2250
2222
|
reusableRecommendationStrategy: boolean;
|
|
2251
2223
|
};
|
|
2252
2224
|
blocks: {
|
|
@@ -2388,7 +2360,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2388
2360
|
autosave: boolean;
|
|
2389
2361
|
allowlistEnabled: boolean;
|
|
2390
2362
|
linkTrackingIds: boolean;
|
|
2391
|
-
allowSaveWithErrors: boolean;
|
|
2392
2363
|
reusableRecommendationStrategy: boolean;
|
|
2393
2364
|
};
|
|
2394
2365
|
blocks: {
|
|
@@ -2532,7 +2503,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2532
2503
|
autosave: boolean;
|
|
2533
2504
|
allowlistEnabled: boolean;
|
|
2534
2505
|
linkTrackingIds: boolean;
|
|
2535
|
-
allowSaveWithErrors: boolean;
|
|
2536
2506
|
reusableRecommendationStrategy: boolean;
|
|
2537
2507
|
};
|
|
2538
2508
|
blocks: {
|