@useinsider/guido 3.18.2-beta.eedafd2 → 3.18.2-beta.f42547e
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 +70 -51
- package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +23 -37
- 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 +56 -46
- package/dist/composables/useHtmlCompiler.js +26 -37
- package/dist/composables/useHtmlValidator.js +84 -81
- package/dist/composables/useRecommendation.js +40 -35
- package/dist/composables/useSave.js +45 -90
- package/dist/composables/useStripo.js +30 -30
- 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/constants/defaultConfig.js +21 -20
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +40 -35
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +84 -52
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +74 -74
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +181 -89
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +26 -16
- package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +24 -0
- 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/constants/defaultConfig.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- 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/controls/main/utils.d.ts +7 -2
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +73 -3
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyCommit.d.ts +14 -0
- 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 +34 -4
- package/dist/static/styles/components/skeleton.css.js +23 -0
- package/dist/stores/config.js +22 -39
- package/dist/stores/onboarding.js +41 -36
- package/dist/utils/genericUtil.js +61 -64
- package/dist/utils/templatePreparation.js +49 -52
- 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/src/utils/liquidDynamicContent.d.ts +0 -20
- package/dist/stores/save-validation.js +0 -30
- package/dist/utils/liquidDynamicContent.js +0 -15
- /package/dist/src/components/organisms/{validation/ValidationErrorDrawer.vue.d.ts → onboarding/RecommendationStrategyOnboarding.vue.d.ts} +0 -0
|
@@ -15,23 +15,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
15
15
|
close: () => void;
|
|
16
16
|
};
|
|
17
17
|
hasChanges: import("vue").ComputedRef<boolean>;
|
|
18
|
-
saveSilent: () => Promise<
|
|
19
|
-
dynamicContentList: import("@@/Types/generic").DynamicContent[];
|
|
20
|
-
compiledHtml: string;
|
|
21
|
-
rawHtml: string;
|
|
22
|
-
css: string;
|
|
23
|
-
ampHtml: string;
|
|
24
|
-
ampErrors: string[];
|
|
25
|
-
modules: number[];
|
|
26
|
-
recommendation: {
|
|
27
|
-
campaignUrls: Record<string, import("../@types/recommendation").RecommendationCampaignUrlValue>;
|
|
28
|
-
configs: Record<string, string>;
|
|
29
|
-
};
|
|
30
|
-
unsubscribe: {
|
|
31
|
-
status: boolean;
|
|
32
|
-
config: number[];
|
|
33
|
-
};
|
|
34
|
-
} | undefined> | undefined;
|
|
18
|
+
saveSilent: () => Promise<Omit<SavedTemplateDetails, "metadata" | "silent"> | undefined> | undefined;
|
|
35
19
|
setLoading: (value: boolean) => void;
|
|
36
20
|
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
|
|
37
21
|
"dynamic-content:open": (detail: {
|
|
@@ -1,20 +1,4 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
-
handleSave: (isSilent: boolean) => Promise<
|
|
3
|
-
dynamicContentList: import("../../../@types/generic.js").DynamicContent[];
|
|
4
|
-
compiledHtml: string;
|
|
5
|
-
rawHtml: string;
|
|
6
|
-
css: string;
|
|
7
|
-
ampHtml: string;
|
|
8
|
-
ampErrors: string[];
|
|
9
|
-
modules: number[];
|
|
10
|
-
recommendation: {
|
|
11
|
-
campaignUrls: Record<string, import("../../../@types/recommendation.js").RecommendationCampaignUrlValue>;
|
|
12
|
-
configs: Record<string, string>;
|
|
13
|
-
};
|
|
14
|
-
unsubscribe: {
|
|
15
|
-
status: boolean;
|
|
16
|
-
config: number[];
|
|
17
|
-
};
|
|
18
|
-
} | undefined> | undefined;
|
|
2
|
+
handleSave: (isSilent: boolean) => Promise<Omit<import("../../../@types/stripo.js").SavedTemplateDetails, "metadata" | "silent"> | undefined> | undefined;
|
|
19
3
|
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
20
4
|
export default _default;
|
|
@@ -1,20 +1,4 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
-
handleSave: (isSilent: boolean) => Promise<
|
|
3
|
-
dynamicContentList: import("../../../@types/generic.js").DynamicContent[];
|
|
4
|
-
compiledHtml: string;
|
|
5
|
-
rawHtml: string;
|
|
6
|
-
css: string;
|
|
7
|
-
ampHtml: string;
|
|
8
|
-
ampErrors: string[];
|
|
9
|
-
modules: number[];
|
|
10
|
-
recommendation: {
|
|
11
|
-
campaignUrls: Record<string, import("../../../@types/recommendation.js").RecommendationCampaignUrlValue>;
|
|
12
|
-
configs: Record<string, string>;
|
|
13
|
-
};
|
|
14
|
-
unsubscribe: {
|
|
15
|
-
status: boolean;
|
|
16
|
-
config: number[];
|
|
17
|
-
};
|
|
18
|
-
} | undefined> | undefined;
|
|
2
|
+
handleSave: (isSilent: boolean) => Promise<Omit<import("../../../@types/stripo.js").SavedTemplateDetails, "metadata" | "silent"> | undefined> | undefined;
|
|
19
3
|
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
20
4
|
export default _default;
|
|
@@ -1,20 +1,4 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
-
handleSave: (isSilent: boolean) => Promise<
|
|
3
|
-
dynamicContentList: import("../../../@types/generic.js").DynamicContent[];
|
|
4
|
-
compiledHtml: string;
|
|
5
|
-
rawHtml: string;
|
|
6
|
-
css: string;
|
|
7
|
-
ampHtml: string;
|
|
8
|
-
ampErrors: string[];
|
|
9
|
-
modules: number[];
|
|
10
|
-
recommendation: {
|
|
11
|
-
campaignUrls: Record<string, import("../../../@types/recommendation.js").RecommendationCampaignUrlValue>;
|
|
12
|
-
configs: Record<string, string>;
|
|
13
|
-
};
|
|
14
|
-
unsubscribe: {
|
|
15
|
-
status: boolean;
|
|
16
|
-
config: number[];
|
|
17
|
-
};
|
|
18
|
-
} | undefined> | undefined;
|
|
2
|
+
handleSave: (isSilent: boolean) => Promise<Omit<import("../../../@types/stripo.js").SavedTemplateDetails, "metadata" | "silent"> | undefined> | undefined;
|
|
19
3
|
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
20
4
|
export default _default;
|
|
@@ -10,11 +10,11 @@ interface Props {
|
|
|
10
10
|
status: boolean;
|
|
11
11
|
titleText: string;
|
|
12
12
|
}
|
|
13
|
-
declare var
|
|
13
|
+
declare var __VLS_12: {}, __VLS_14: {};
|
|
14
14
|
type __VLS_Slots = {} & {
|
|
15
|
-
headerBottomSlot?: (props: typeof
|
|
15
|
+
headerBottomSlot?: (props: typeof __VLS_12) => any;
|
|
16
16
|
} & {
|
|
17
|
-
default?: (props: typeof
|
|
17
|
+
default?: (props: typeof __VLS_14) => any;
|
|
18
18
|
};
|
|
19
19
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
20
20
|
className: string;
|
|
@@ -26,7 +26,6 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
|
|
|
26
26
|
cancelOrBackButtonEvent: () => void;
|
|
27
27
|
onCloseEvent: () => void;
|
|
28
28
|
primaryButtonEvent: () => void;
|
|
29
|
-
secondaryButtonEvent: () => void;
|
|
30
29
|
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
31
30
|
className: string;
|
|
32
31
|
size: string;
|
|
@@ -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
|
};
|
|
@@ -10,6 +10,7 @@
|
|
|
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;
|
|
13
14
|
/**
|
|
14
15
|
* Default currency configuration
|
|
15
16
|
* 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, EXCLUDED_ALGORITHM_IDS, } from './defaultConfig';
|
|
13
|
+
export { DEFAULT_NODE_CONFIG, DEFAULT_CURRENCY, DEFAULT_COMPOSITION, DEFAULT_VISIBILITY, CURRENT_CONFIG_VERSION, PRE_RRS_CONFIG_VERSION, RRS_CONFIG_VERSION, EXCLUDED_ALGORITHM_IDS, } from './defaultConfig';
|
|
@@ -70,6 +70,8 @@ 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;
|
|
73
75
|
private _capturePendingNodeConfigWrite;
|
|
74
76
|
/**
|
|
75
77
|
* 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;
|
|
@@ -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): boolean;
|
|
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,6 +151,11 @@ 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;
|
|
154
159
|
}
|
|
155
160
|
/**
|
|
156
161
|
* Updates product content in-place without regenerating HTML structure.
|
|
@@ -161,7 +166,7 @@ export interface UpdateProductContentInPlaceOptions {
|
|
|
161
166
|
* After updating desktop, also updates mobile container to keep them in sync.
|
|
162
167
|
*
|
|
163
168
|
* Falls back to false when product count changed (need to add/remove elements).
|
|
164
|
-
* @param options - Configuration options
|
|
169
|
+
* @param options - Configuration options; `onApplied` fires only when a batch was committed
|
|
165
170
|
* @returns true if in-place update was successful, false to fall back to full regeneration
|
|
166
171
|
*/
|
|
167
172
|
export declare function updateProductContentInPlace(options: UpdateProductContentInPlaceOptions): boolean;
|
|
@@ -83,8 +83,11 @@ interface StoreState {
|
|
|
83
83
|
strategies: RrsStrategy[];
|
|
84
84
|
strategiesLoading: boolean;
|
|
85
85
|
strategyUrlTemplates: Record<string, string>;
|
|
86
|
+
strategiesFetched: boolean;
|
|
87
|
+
strategiesSettled: boolean;
|
|
86
88
|
blockStates: Record<number, PerBlockState>;
|
|
87
89
|
currentRecommendationId: number | null;
|
|
90
|
+
strategyPanelOpen: boolean;
|
|
88
91
|
configVersion: number;
|
|
89
92
|
}
|
|
90
93
|
export declare const useRecommendationExtensionStore: import("pinia").StoreDefinition<"guidoRecommendationExtension", StoreState, {
|
|
@@ -111,8 +114,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
111
114
|
}[];
|
|
112
115
|
strategiesLoading: boolean;
|
|
113
116
|
strategyUrlTemplates: Record<string, string>;
|
|
117
|
+
strategiesFetched: boolean;
|
|
118
|
+
strategiesSettled: boolean;
|
|
114
119
|
blockStates: Record<number, PerBlockState>;
|
|
115
120
|
currentRecommendationId: number | null;
|
|
121
|
+
strategyPanelOpen: boolean;
|
|
116
122
|
configVersion: number;
|
|
117
123
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): PerBlockConfigs;
|
|
118
124
|
/**
|
|
@@ -137,8 +143,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
137
143
|
}[];
|
|
138
144
|
strategiesLoading: boolean;
|
|
139
145
|
strategyUrlTemplates: Record<string, string>;
|
|
146
|
+
strategiesFetched: boolean;
|
|
147
|
+
strategiesSettled: boolean;
|
|
140
148
|
blockStates: Record<number, PerBlockState>;
|
|
141
149
|
currentRecommendationId: number | null;
|
|
150
|
+
strategyPanelOpen: boolean;
|
|
142
151
|
configVersion: number;
|
|
143
152
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): RecommendationProduct[];
|
|
144
153
|
/**
|
|
@@ -163,8 +172,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
163
172
|
}[];
|
|
164
173
|
strategiesLoading: boolean;
|
|
165
174
|
strategyUrlTemplates: Record<string, string>;
|
|
175
|
+
strategiesFetched: boolean;
|
|
176
|
+
strategiesSettled: boolean;
|
|
166
177
|
blockStates: Record<number, PerBlockState>;
|
|
167
178
|
currentRecommendationId: number | null;
|
|
179
|
+
strategyPanelOpen: boolean;
|
|
168
180
|
configVersion: number;
|
|
169
181
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
170
182
|
assignStrategyDrawerStatus(state: {
|
|
@@ -186,8 +198,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
186
198
|
}[];
|
|
187
199
|
strategiesLoading: boolean;
|
|
188
200
|
strategyUrlTemplates: Record<string, string>;
|
|
201
|
+
strategiesFetched: boolean;
|
|
202
|
+
strategiesSettled: boolean;
|
|
189
203
|
blockStates: Record<number, PerBlockState>;
|
|
190
204
|
currentRecommendationId: number | null;
|
|
205
|
+
strategyPanelOpen: boolean;
|
|
191
206
|
configVersion: number;
|
|
192
207
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
193
208
|
removeStrategyModalStatus(state: {
|
|
@@ -209,8 +224,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
209
224
|
}[];
|
|
210
225
|
strategiesLoading: boolean;
|
|
211
226
|
strategyUrlTemplates: Record<string, string>;
|
|
227
|
+
strategiesFetched: boolean;
|
|
228
|
+
strategiesSettled: boolean;
|
|
212
229
|
blockStates: Record<number, PerBlockState>;
|
|
213
230
|
currentRecommendationId: number | null;
|
|
231
|
+
strategyPanelOpen: boolean;
|
|
214
232
|
configVersion: number;
|
|
215
233
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
216
234
|
assignedStrategy(state: {
|
|
@@ -232,8 +250,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
232
250
|
}[];
|
|
233
251
|
strategiesLoading: boolean;
|
|
234
252
|
strategyUrlTemplates: Record<string, string>;
|
|
253
|
+
strategiesFetched: boolean;
|
|
254
|
+
strategiesSettled: boolean;
|
|
235
255
|
blockStates: Record<number, PerBlockState>;
|
|
236
256
|
currentRecommendationId: number | null;
|
|
257
|
+
strategyPanelOpen: boolean;
|
|
237
258
|
configVersion: number;
|
|
238
259
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): RrsStrategy | null;
|
|
239
260
|
/**
|
|
@@ -258,8 +279,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
258
279
|
}[];
|
|
259
280
|
strategiesLoading: boolean;
|
|
260
281
|
strategyUrlTemplates: Record<string, string>;
|
|
282
|
+
strategiesFetched: boolean;
|
|
283
|
+
strategiesSettled: boolean;
|
|
261
284
|
blockStates: Record<number, PerBlockState>;
|
|
262
285
|
currentRecommendationId: number | null;
|
|
286
|
+
strategyPanelOpen: boolean;
|
|
263
287
|
configVersion: number;
|
|
264
288
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
265
289
|
/**
|
|
@@ -284,8 +308,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
284
308
|
}[];
|
|
285
309
|
strategiesLoading: boolean;
|
|
286
310
|
strategyUrlTemplates: Record<string, string>;
|
|
311
|
+
strategiesFetched: boolean;
|
|
312
|
+
strategiesSettled: boolean;
|
|
287
313
|
blockStates: Record<number, PerBlockState>;
|
|
288
314
|
currentRecommendationId: number | null;
|
|
315
|
+
strategyPanelOpen: boolean;
|
|
289
316
|
configVersion: number;
|
|
290
317
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): number;
|
|
291
318
|
hasFilters(): boolean;
|
|
@@ -311,8 +338,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
311
338
|
}[];
|
|
312
339
|
strategiesLoading: boolean;
|
|
313
340
|
strategyUrlTemplates: Record<string, string>;
|
|
341
|
+
strategiesFetched: boolean;
|
|
342
|
+
strategiesSettled: boolean;
|
|
314
343
|
blockStates: Record<number, PerBlockState>;
|
|
315
344
|
currentRecommendationId: number | null;
|
|
345
|
+
strategyPanelOpen: boolean;
|
|
316
346
|
configVersion: number;
|
|
317
347
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => {
|
|
318
348
|
text: string;
|
|
@@ -337,8 +367,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
337
367
|
}[];
|
|
338
368
|
strategiesLoading: boolean;
|
|
339
369
|
strategyUrlTemplates: Record<string, string>;
|
|
370
|
+
strategiesFetched: boolean;
|
|
371
|
+
strategiesSettled: boolean;
|
|
340
372
|
blockStates: Record<number, PerBlockState>;
|
|
341
373
|
currentRecommendationId: number | null;
|
|
374
|
+
strategyPanelOpen: boolean;
|
|
342
375
|
configVersion: number;
|
|
343
376
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => {
|
|
344
377
|
text: string;
|
|
@@ -363,8 +396,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
363
396
|
}[];
|
|
364
397
|
strategiesLoading: boolean;
|
|
365
398
|
strategyUrlTemplates: Record<string, string>;
|
|
399
|
+
strategiesFetched: boolean;
|
|
400
|
+
strategiesSettled: boolean;
|
|
366
401
|
blockStates: Record<number, PerBlockState>;
|
|
367
402
|
currentRecommendationId: number | null;
|
|
403
|
+
strategyPanelOpen: boolean;
|
|
368
404
|
configVersion: number;
|
|
369
405
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => {
|
|
370
406
|
text: string;
|
|
@@ -445,6 +481,40 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
445
481
|
openRemoveStrategyModal(): void;
|
|
446
482
|
closeRemoveStrategyModal(): void;
|
|
447
483
|
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;
|
|
448
518
|
resolveStrategyUrlTemplate(strategy: RrsStrategy, currency: string): Promise<string>;
|
|
449
519
|
assignStrategy(strategy: RrsStrategy): void;
|
|
450
520
|
removeStrategy(): void;
|
|
@@ -463,10 +533,10 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
463
533
|
*/
|
|
464
534
|
hasInvalidBlock(): boolean;
|
|
465
535
|
/**
|
|
466
|
-
*
|
|
467
|
-
*
|
|
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.
|
|
468
538
|
*/
|
|
469
|
-
|
|
539
|
+
invalidBlockFields(): string[];
|
|
470
540
|
fetchRecommendationProducts(): Promise<void>;
|
|
471
541
|
_doFetchProducts(): Promise<void>;
|
|
472
542
|
_doFetchStrategyProducts(blockId: number): Promise<void>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Writes a strategy change and its products straight to the document, without the settings panel.
|
|
3
|
+
*
|
|
4
|
+
* Every entry point is host-rendered UI outside `ui-editor`, and none of them can rely on the
|
|
5
|
+
* panel control: opening the strategy page deselects the block, so by the time the user comes back
|
|
6
|
+
* and presses Assign the control — and with it the subscription that does the node write, the
|
|
7
|
+
* product fetch and the repaint — is gone. The assignment then reaches Pinia and nothing else
|
|
8
|
+
* (SD-149916).
|
|
9
|
+
*
|
|
10
|
+
* Call AFTER the store change (`assignStrategy` / `removeStrategy`).
|
|
11
|
+
* @param description - labels the undo entry
|
|
12
|
+
* @returns whether the write reached a node
|
|
13
|
+
*/
|
|
14
|
+
export declare function commitStrategyChange(blockId: number, description: string): Promise<boolean>;
|
|
@@ -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;
|