@useinsider/guido 1.0.3-beta.d1ff593 → 1.0.3-beta.d574817
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 +144 -3
- package/dist/components/Guido.vue.js +11 -9
- package/dist/components/Guido.vue2.js +76 -70
- package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
- package/dist/components/organisms/header/LeftSlot.vue2.js +16 -15
- package/dist/components/organisms/header/RightSlot.vue.js +11 -11
- package/dist/components/organisms/header/RightSlot.vue2.js +23 -22
- package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +9 -9
- package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +30 -17
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +12 -10
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +19 -18
- package/dist/composables/useBlocksConfig.js +49 -0
- package/dist/composables/useGuidoActions.js +19 -9
- package/dist/composables/useStripo.js +49 -58
- package/dist/config/compiler/unsubscribeCompilerRules.js +33 -28
- package/dist/config/migrator/recommendationMigrator.js +188 -98
- package/dist/enums/date.js +6 -0
- package/dist/enums/defaults.js +16 -8
- package/dist/enums/onboarding.js +2 -1
- package/dist/enums/unsubscribe.js +27 -25
- package/dist/extensions/Blocks/Checkbox/extension.js +2 -2
- package/dist/extensions/Blocks/CouponBlock/extension.js +2 -2
- package/dist/extensions/Blocks/Recommendation/block.js +1 -1
- package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +66 -298
- package/dist/extensions/Blocks/Recommendation/constants.js +5 -0
- package/dist/extensions/Blocks/Recommendation/control.js +5 -4
- package/dist/extensions/Blocks/Recommendation/controls/button/align.js +7 -6
- package/dist/extensions/Blocks/Recommendation/controls/button/border.js +7 -6
- package/dist/extensions/Blocks/Recommendation/controls/button/borderRadius.js +7 -6
- package/dist/extensions/Blocks/Recommendation/controls/button/color.js +5 -4
- package/dist/extensions/Blocks/Recommendation/controls/button/fitToContent.js +5 -4
- package/dist/extensions/Blocks/Recommendation/controls/button/fontFamily.js +5 -4
- package/dist/extensions/Blocks/Recommendation/controls/button/margins.js +5 -4
- package/dist/extensions/Blocks/Recommendation/controls/button/paddings.js +5 -4
- package/dist/extensions/Blocks/Recommendation/controls/button/text.js +5 -4
- package/dist/extensions/Blocks/Recommendation/controls/button/textSize.js +5 -4
- package/dist/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.js +5 -4
- package/dist/extensions/Blocks/Recommendation/controls/image/margins.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/image/size.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/align.js +5 -4
- package/dist/extensions/Blocks/Recommendation/controls/name/background.js +7 -6
- package/dist/extensions/Blocks/Recommendation/controls/name/color.js +5 -4
- package/dist/extensions/Blocks/Recommendation/controls/name/fontFamily.js +5 -4
- package/dist/extensions/Blocks/Recommendation/controls/name/paddings.js +5 -4
- package/dist/extensions/Blocks/Recommendation/controls/name/size.js +7 -6
- package/dist/extensions/Blocks/Recommendation/controls/name/style.js +7 -6
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/align.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/background.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/color.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/paddings.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/size.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/style.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/align.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/background.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/color.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/fontFamily.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/paddings.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/size.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/style.js +13 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +37 -21
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +90 -45
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +1 -1
- package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +160 -0
- package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +152 -0
- package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +180 -0
- package/dist/extensions/DynamicContent/dynamic-content-modal.js +25 -19
- package/dist/extensions/DynamicContent/dynamic-content.js +128 -33
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +198 -176
- package/dist/package.json.js +1 -1
- package/dist/services/stripoApi.js +1 -1
- package/dist/src/@types/generic.d.ts +42 -6
- package/dist/src/components/Guido.vue.d.ts +4 -2
- package/dist/src/components/organisms/onboarding/NewVersionPopup.vue.d.ts +3 -1
- package/dist/src/components/organisms/onboarding/OnboardingWrapper.vue.d.ts +3 -1
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useBlocksConfig.d.ts +11 -0
- package/dist/src/composables/useGuidoActions.d.ts +9 -0
- package/dist/src/enums/date.d.ts +4 -0
- package/dist/src/enums/onboarding.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/cardCompositionControl.d.ts +5 -42
- package/dist/src/extensions/Blocks/Recommendation/constants.d.ts +51 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/image/margins.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/image/size.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/align.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/background.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/color.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/paddings.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/size.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/style.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/align.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/background.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/color.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/fontFamily.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/paddings.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/size.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/style.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +16 -0
- package/dist/src/extensions/Blocks/Recommendation/{template.d.ts → templates/migrationTemplate.d.ts} +7 -34
- package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +44 -0
- package/dist/src/extensions/DynamicContent/dynamic-content-modal.d.ts +9 -2
- package/dist/src/extensions/DynamicContent/dynamic-content.d.ts +52 -2
- package/dist/src/stores/config.d.ts +10 -2
- package/dist/src/stores/dynamic-content.d.ts +3 -3
- package/dist/src/stores/editor.d.ts +1 -1
- package/dist/src/stores/onboarding.d.ts +1 -1
- package/dist/src/stores/preview.d.ts +1 -1
- package/dist/src/stores/recommendation.d.ts +1 -1
- package/dist/src/stores/save-as-template.d.ts +1 -1
- package/dist/src/stores/toaster.d.ts +1 -1
- package/dist/src/stores/unsubscribe.d.ts +1 -1
- package/dist/src/stores/version-history.d.ts +1 -1
- package/dist/src/utils/dateUtil.d.ts +21 -0
- package/dist/src/utils/environmentUtil.d.ts +5 -0
- package/dist/src/utils/genericUtil.d.ts +1 -0
- package/dist/static/styles/components/narrow-panel.css.js +10 -0
- package/dist/static/styles/customEditorStyle.css.js +5 -0
- package/dist/stores/config.js +5 -5
- package/dist/stores/dynamic-content.js +2 -2
- package/dist/stores/editor.js +1 -1
- package/dist/stores/onboarding.js +27 -27
- package/dist/stores/preview.js +1 -1
- package/dist/stores/recommendation.js +3 -3
- package/dist/stores/save-as-template.js +2 -2
- package/dist/stores/toaster.js +1 -1
- package/dist/stores/unsubscribe.js +1 -1
- package/dist/stores/version-history.js +4 -4
- package/dist/utils/dateUtil.js +24 -3
- package/dist/utils/environmentUtil.js +4 -0
- package/dist/utils/genericUtil.js +20 -9
- package/package.json +2 -2
- package/dist/extensions/Blocks/Recommendation/template.js +0 -314
|
@@ -6,36 +6,71 @@ type Features = {
|
|
|
6
6
|
dynamicContent?: boolean;
|
|
7
7
|
saveAsTemplate?: boolean;
|
|
8
8
|
versionHistory?: boolean;
|
|
9
|
+
testMessage?: boolean;
|
|
10
|
+
displayConditions?: boolean;
|
|
9
11
|
};
|
|
10
12
|
type Partner = {
|
|
11
13
|
partnerName: string;
|
|
12
14
|
productType: number;
|
|
13
15
|
messageType: number;
|
|
14
16
|
};
|
|
17
|
+
export type GuidoBlockType = 'amp-accordion' | 'amp-carousel' | 'amp-form-controls' | 'banner-block' | 'button-block' | 'html-block' | 'image-block' | 'menu-block' | 'social-block' | 'spacer-block' | 'text-block' | 'timer-block' | 'video-block';
|
|
18
|
+
export type GuidoCustomBlockType = 'dynamic-content' | 'checkbox-block' | 'radio-button-block' | 'recommendation-block' | 'unsubscribe-block' | 'coupon-block' | 'items-block';
|
|
19
|
+
type BlocksConfig = {
|
|
20
|
+
excludeDefaults?: GuidoBlockType[];
|
|
21
|
+
includeCustoms?: GuidoCustomBlockType[];
|
|
22
|
+
};
|
|
15
23
|
export type GuidoConfig = {
|
|
16
24
|
translationsPath: string;
|
|
17
25
|
htmlCompilerRules?: CompilerRule[];
|
|
18
26
|
ignoreDefaultHtmlCompilerRules?: boolean;
|
|
19
27
|
useHeader?: boolean;
|
|
20
28
|
emailHeader: EmailHeader;
|
|
29
|
+
migrationDate: number;
|
|
21
30
|
partner?: Partner;
|
|
22
31
|
extensions?: Extensions;
|
|
23
32
|
features?: Features;
|
|
33
|
+
blocks?: BlocksConfig;
|
|
34
|
+
backButtonLabel?: string;
|
|
24
35
|
};
|
|
25
36
|
export type TemplateConfig = {
|
|
26
37
|
preselectedDynamicContentList?: DynamicContent[];
|
|
27
38
|
selectedUnsubscribePages?: number[];
|
|
28
39
|
variationId?: string;
|
|
29
40
|
};
|
|
30
|
-
export type
|
|
41
|
+
export type BaseDynamicContent = {
|
|
31
42
|
value: string;
|
|
32
|
-
text: string;
|
|
33
43
|
fallback?: string;
|
|
34
44
|
format?: {
|
|
35
45
|
key: string;
|
|
36
46
|
value: string;
|
|
37
47
|
};
|
|
38
48
|
};
|
|
49
|
+
export type DynamicContent = BaseDynamicContent & {
|
|
50
|
+
text: string;
|
|
51
|
+
};
|
|
52
|
+
export type MergeTag = BaseDynamicContent & {
|
|
53
|
+
label: string;
|
|
54
|
+
selStart?: number;
|
|
55
|
+
selEnd?: number;
|
|
56
|
+
hidden?: boolean;
|
|
57
|
+
};
|
|
58
|
+
export type PositionData = {
|
|
59
|
+
x: number;
|
|
60
|
+
y: number;
|
|
61
|
+
width?: number;
|
|
62
|
+
height?: number;
|
|
63
|
+
};
|
|
64
|
+
export type DynamicContentEvent = {
|
|
65
|
+
attribute: DynamicContent;
|
|
66
|
+
position?: PositionData;
|
|
67
|
+
};
|
|
68
|
+
export type MergeTagClickEvent = {
|
|
69
|
+
position: PositionData;
|
|
70
|
+
element: HTMLElement;
|
|
71
|
+
tagValue: string | null;
|
|
72
|
+
tagLabel: string | null;
|
|
73
|
+
};
|
|
39
74
|
export interface EmailHeader {
|
|
40
75
|
senderName: string;
|
|
41
76
|
subject: string;
|
|
@@ -51,12 +86,13 @@ export interface TooltipOptions {
|
|
|
51
86
|
};
|
|
52
87
|
preventXss?: boolean;
|
|
53
88
|
}
|
|
54
|
-
export type MergeTag = {
|
|
55
|
-
label: string;
|
|
56
|
-
value: string;
|
|
57
|
-
};
|
|
58
89
|
export type TextValueObject = {
|
|
59
90
|
text: string;
|
|
60
91
|
value: string;
|
|
61
92
|
};
|
|
93
|
+
export interface L10n {
|
|
94
|
+
locale?: string;
|
|
95
|
+
timezone?: string;
|
|
96
|
+
time?: number;
|
|
97
|
+
}
|
|
62
98
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DynamicContent, GuidoConfig, TemplateConfig } from '@@/Types/generic';
|
|
1
|
+
import type { DynamicContent, GuidoConfig, PositionData, TemplateConfig } from '@@/Types/generic';
|
|
2
2
|
import type { SavedTemplateDetails } from '@@/Types/stripo';
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
templateId: string;
|
|
@@ -20,12 +20,14 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__
|
|
|
20
20
|
hasChanges: import("vue").ComputedRef<boolean>;
|
|
21
21
|
saveSilent: () => Promise<SavedTemplateDetails | undefined> | undefined;
|
|
22
22
|
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
|
|
23
|
-
"dynamic-content:open": (detail: DynamicContent | null) => void;
|
|
23
|
+
"dynamic-content:open": (detail: DynamicContent | null, position?: PositionData | undefined) => void;
|
|
24
24
|
back: () => void;
|
|
25
25
|
"save:start": () => void;
|
|
26
26
|
"save:complete": (data: Omit<SavedTemplateDetails, "forceRecreate">) => void;
|
|
27
27
|
"on-change": (hasChanges: boolean) => void;
|
|
28
28
|
ready: () => void;
|
|
29
|
+
"onboarding:finished": () => void;
|
|
30
|
+
"test-email:click": () => void;
|
|
29
31
|
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
|
|
30
32
|
export default _default;
|
|
31
33
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
|
|
2
|
+
"onboarding-finished": () => void;
|
|
3
|
+
}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
4
|
export default _default;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
|
|
2
|
+
"onboarding-finished": () => void;
|
|
3
|
+
}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
4
|
export default _default;
|
|
@@ -32,8 +32,8 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
|
|
|
32
32
|
closeOnOutsideClick: boolean;
|
|
33
33
|
footerStatus: boolean;
|
|
34
34
|
}>>>, {
|
|
35
|
-
description: string;
|
|
36
35
|
size: "small" | "medium" | "large";
|
|
36
|
+
description: string;
|
|
37
37
|
closeOnOutsideClick: boolean;
|
|
38
38
|
footerButtonOptions: FooterButtonGroup;
|
|
39
39
|
closeButtonStatus: boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Extension } from '@stripoinc/ui-editor-extensions';
|
|
2
|
+
/**
|
|
3
|
+
* Composable for managing Guido blocks configuration
|
|
4
|
+
* Converts GuidoConfig blocks settings to Stripo-compatible format
|
|
5
|
+
*/
|
|
6
|
+
export declare const useBlocksConfig: () => {
|
|
7
|
+
getStripoBlocksConfig: () => Promise<{
|
|
8
|
+
baseBlocks: Record<string, boolean>;
|
|
9
|
+
extensions: Extension[];
|
|
10
|
+
}>;
|
|
11
|
+
};
|
|
@@ -3,9 +3,11 @@ import type { InjectionKey } from 'vue';
|
|
|
3
3
|
export type BackHandler = () => void;
|
|
4
4
|
export type SaveStartHandler = () => void;
|
|
5
5
|
export type SaveCompleteHandler = (template: Omit<SavedTemplateDetails, 'forceRecreate'>) => void;
|
|
6
|
+
export type TestEmailClickHandler = () => void;
|
|
6
7
|
export declare const BACK_KEY: InjectionKey<BackHandler>;
|
|
7
8
|
export declare const SAVE_START_KEY: InjectionKey<SaveStartHandler>;
|
|
8
9
|
export declare const SAVE_COMPLETE_KEY: InjectionKey<SaveCompleteHandler>;
|
|
10
|
+
export declare const TEST_EMAIL_CLICK_KEY: InjectionKey<TestEmailClickHandler>;
|
|
9
11
|
/**
|
|
10
12
|
* Provides Guido action handlers to child components
|
|
11
13
|
*/
|
|
@@ -13,6 +15,7 @@ export declare const provideGuidoActions: (actions: {
|
|
|
13
15
|
onBack: BackHandler;
|
|
14
16
|
onSaveStart: SaveStartHandler;
|
|
15
17
|
onSaveComplete: SaveCompleteHandler;
|
|
18
|
+
onTestEmailClick: TestEmailClickHandler;
|
|
16
19
|
}) => void;
|
|
17
20
|
/**
|
|
18
21
|
* Provides individual Guido action handlers
|
|
@@ -35,6 +38,11 @@ export declare const useSaveStart: () => SaveStartHandler;
|
|
|
35
38
|
* @returns Save complete function
|
|
36
39
|
*/
|
|
37
40
|
export declare const useSaveComplete: () => SaveCompleteHandler;
|
|
41
|
+
/**
|
|
42
|
+
* Hook to use the test email click handler
|
|
43
|
+
* @returns Test email click function
|
|
44
|
+
*/
|
|
45
|
+
export declare const useTestEmailClick: () => TestEmailClickHandler;
|
|
38
46
|
/**
|
|
39
47
|
* Convenience hook to get all Guido actions
|
|
40
48
|
* @returns Object containing all action handlers
|
|
@@ -43,4 +51,5 @@ export declare const useGuidoActions: () => {
|
|
|
43
51
|
back: BackHandler;
|
|
44
52
|
saveStart: SaveStartHandler;
|
|
45
53
|
saveComplete: SaveCompleteHandler;
|
|
54
|
+
testEmailClick: TestEmailClickHandler;
|
|
46
55
|
};
|
|
@@ -4,34 +4,17 @@ export declare const COMPOSITION_CONTROL_BLOCK_ID = "ui-elements-recommendation-
|
|
|
4
4
|
export interface CardCompositionItem {
|
|
5
5
|
key: string;
|
|
6
6
|
label: string;
|
|
7
|
+
visible: boolean;
|
|
7
8
|
}
|
|
8
9
|
export declare class RecommendationCardCompositionControl extends CommonControl {
|
|
9
10
|
private currentComposition;
|
|
10
|
-
private
|
|
11
|
+
private currentVisibility;
|
|
11
12
|
getId(): string;
|
|
12
13
|
getTemplate(): string;
|
|
13
|
-
_getTextColor(label: string, name: string): string;
|
|
14
|
-
_getFontFamily(label: string, name: string): string;
|
|
15
|
-
/**
|
|
16
|
-
* Generate styling controls for Product Name element
|
|
17
|
-
*/
|
|
18
|
-
private _getProductNameStylingControls;
|
|
19
|
-
/**
|
|
20
|
-
* Generate styling controls for Product Price element
|
|
21
|
-
*/
|
|
22
|
-
private _getProductPriceStylingControls;
|
|
23
|
-
/**
|
|
24
|
-
* Generate styling controls for Product Original Price element
|
|
25
|
-
*/
|
|
26
|
-
private _getProductOriginalPriceStylingControls;
|
|
27
|
-
/**
|
|
28
|
-
* Generate styling controls for Product Button element
|
|
29
|
-
*/
|
|
30
|
-
private _getProductButtonStylingControls;
|
|
31
14
|
onRender(): void;
|
|
32
15
|
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
33
16
|
/**
|
|
34
|
-
* Initialize the composition order from the block or use defaults
|
|
17
|
+
* Initialize the composition order and visibility from the block or use defaults
|
|
35
18
|
*/
|
|
36
19
|
private _initializeComposition;
|
|
37
20
|
/**
|
|
@@ -39,27 +22,7 @@ export declare class RecommendationCardCompositionControl extends CommonControl
|
|
|
39
22
|
*/
|
|
40
23
|
private _applyCompositionToBlock;
|
|
41
24
|
/**
|
|
42
|
-
*
|
|
43
|
-
*/
|
|
44
|
-
private _initializeStyling;
|
|
45
|
-
/**
|
|
46
|
-
* Load default styling values and populate controls
|
|
47
|
-
*/
|
|
48
|
-
private _loadDefaultStyling;
|
|
49
|
-
/**
|
|
50
|
-
* Populate control values with current styling
|
|
51
|
-
*/
|
|
52
|
-
private _populateControlsWithStyling;
|
|
53
|
-
/**
|
|
54
|
-
* Update styling object for a specific element and property
|
|
55
|
-
*/
|
|
56
|
-
private _updateElementStyling;
|
|
57
|
-
/**
|
|
58
|
-
* Persist current styling to block attributes
|
|
59
|
-
*/
|
|
60
|
-
private _persistStyling;
|
|
61
|
-
/**
|
|
62
|
-
* Apply styling to a specific element in the DOM
|
|
25
|
+
* Apply visibility changes to the block's HTML structure
|
|
63
26
|
*/
|
|
64
|
-
private
|
|
27
|
+
private _applyVisibilityToBlock;
|
|
65
28
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Block IDs used in the Recommendation Extension
|
|
3
|
+
* These IDs are used in the esd-extension-block-id attribute to identify specific blocks
|
|
4
|
+
*/
|
|
5
|
+
export declare enum RecommendationBlockId {
|
|
6
|
+
BUTTON = "recommendation-block-button",
|
|
7
|
+
NAME = "recommendation-block-name",
|
|
8
|
+
PRICE = "recommendation-block-price",
|
|
9
|
+
OLD_PRICE = "recommendation-block-old-price",
|
|
10
|
+
IMAGE = "recommendation-block-image"
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Control IDs used in the Recommendation Extension
|
|
14
|
+
* These IDs are returned by the getId() method of each control
|
|
15
|
+
*/
|
|
16
|
+
export declare enum RecommendationControlId {
|
|
17
|
+
BUTTON_ALIGN = "recommendation-block-button-align-control",
|
|
18
|
+
BUTTON_BORDER = "recommendation-block-button-border-control",
|
|
19
|
+
BUTTON_BORDER_RADIUS = "recommendation-block-button-border-radius-control",
|
|
20
|
+
BUTTON_COLOR = "recommendation-block-button-color-control",
|
|
21
|
+
BUTTON_FIT_TO_CONTENT = "recommendation-block-button-fit-to-content-control",
|
|
22
|
+
BUTTON_FONT_FAMILY = "recommendation-block-button-font-family-control",
|
|
23
|
+
BUTTON_MARGINS = "recommendation-block-button-margins-control",
|
|
24
|
+
BUTTON_PADDINGS = "recommendation-block-button-paddings-control",
|
|
25
|
+
BUTTON_TEXT = "recommendation-block-button-text-control",
|
|
26
|
+
BUTTON_TEXT_SIZE = "recommendation-block-button-text-size-control",
|
|
27
|
+
BUTTON_TEXT_STYLE_AND_FONT_COLOR = "recommendation-block-button-text-style-and-font-color-control",
|
|
28
|
+
NAME_ALIGN = "recommendation-block-name-align-control",
|
|
29
|
+
NAME_BACKGROUND = "recommendation-block-name-background-control",
|
|
30
|
+
NAME_COLOR = "recommendation-block-name-color-control",
|
|
31
|
+
NAME_FONT_FAMILY = "recommendation-block-name-font-family-control",
|
|
32
|
+
NAME_PADDINGS = "recommendation-block-name-paddings-control",
|
|
33
|
+
NAME_SIZE = "recommendation-block-name-size-control",
|
|
34
|
+
NAME_STYLE = "recommendation-block-name-style-control",
|
|
35
|
+
PRICE_ALIGN = "recommendation-block-price-align-control",
|
|
36
|
+
PRICE_BACKGROUND = "recommendation-block-price-background-control",
|
|
37
|
+
PRICE_COLOR = "recommendation-block-price-color-control",
|
|
38
|
+
PRICE_FONT_FAMILY = "recommendation-block-price-font-family-control",
|
|
39
|
+
PRICE_PADDINGS = "recommendation-block-price-paddings-control",
|
|
40
|
+
PRICE_SIZE = "recommendation-block-price-size-control",
|
|
41
|
+
PRICE_STYLE = "recommendation-block-price-style-control",
|
|
42
|
+
OLD_PRICE_ALIGN = "recommendation-block-old-price-align-control",
|
|
43
|
+
OLD_PRICE_BACKGROUND = "recommendation-block-old-price-background-control",
|
|
44
|
+
OLD_PRICE_COLOR = "recommendation-block-old-price-color-control",
|
|
45
|
+
OLD_PRICE_FONT_FAMILY = "recommendation-block-old-price-font-family-control",
|
|
46
|
+
OLD_PRICE_PADDINGS = "recommendation-block-old-price-paddings-control",
|
|
47
|
+
OLD_PRICE_SIZE = "recommendation-block-old-price-size-control",
|
|
48
|
+
OLD_PRICE_STYLE = "recommendation-block-old-price-style-control",
|
|
49
|
+
IMAGE_SIZE = "recommendation-block-image-size-control",
|
|
50
|
+
IMAGE_MARGINS = "recommendation-block-image-margins-control"
|
|
51
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ImmutableHtmlNode, TextBlockBackgroundBuiltInControl } from '@stripoinc/ui-editor-extensions';
|
|
2
|
+
export declare class OldPriceBackgroundControl extends TextBlockBackgroundBuiltInControl {
|
|
3
|
+
getId(): string;
|
|
4
|
+
getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
|
|
5
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ImmutableHtmlNode, TextFontFamilyBuiltInControl } from '@stripoinc/ui-editor-extensions';
|
|
2
|
+
export declare class OldPriceFontFamilyControl extends TextFontFamilyBuiltInControl {
|
|
3
|
+
getId(): string;
|
|
4
|
+
getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
|
|
5
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ImmutableHtmlNode, TextBlockBackgroundBuiltInControl } from '@stripoinc/ui-editor-extensions';
|
|
2
|
+
export declare class PriceBackgroundControl extends TextBlockBackgroundBuiltInControl {
|
|
3
|
+
getId(): string;
|
|
4
|
+
getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
|
|
5
|
+
}
|
|
@@ -34,7 +34,7 @@ interface StoreState {
|
|
|
34
34
|
filterList: FiltersResponse;
|
|
35
35
|
filterGroup: number;
|
|
36
36
|
}
|
|
37
|
-
export declare const useRecommendationExtensionStore: import("pinia").StoreDefinition<"
|
|
37
|
+
export declare const useRecommendationExtensionStore: import("pinia").StoreDefinition<"guidoRecommendationExtension", StoreState, {
|
|
38
38
|
hasFilters: (state: {
|
|
39
39
|
recommendationCampaignUrls: Record<string, string>;
|
|
40
40
|
recommendationConfigs: {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { RecommendationProduct } from '@@/Types/recommendation';
|
|
2
|
+
import { DEFAULTS, getDefaultProducts, DEFAULT_CARD_COMPOSITION } from './templateUtils';
|
|
3
|
+
declare const blockTemplate = "\n <td align=\"left\" class=\"ins-recommendation-v3-block-v2 esd-block-recommendation-v3-block es-p20\">\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr>\n <td align=\"center\">\n <table\n class=\"container\"\n width=\"100%\"\n cellpadding=\"0\"\n cellspacing=\"0\"\n border=\"0\">\n <tbody>\n <tr>\n <td>\n <table\n width=\"100%\"\n cellpadding=\"0\"\n cellspacing=\"0\"\n border=\"0\">\n <tbody>\n <BLOCK_TEXT\n class=\"es-p10t es-p10b es-p20l es-p20r\"\n align=\"center\">\n <p path=\"1\" style=\"font-size: 28px; color: #333333;\">\n <strong path=\"1,0\">{-{-TITLE-}-}</strong>\n </p>\n </BLOCK_TEXT>\n </tbody>\n </table>\n </td>\n </tr>\n \n <tr>\n <td class=\"spacer\" style=\"height: 20px;\"></td>\n </tr>\n\n <tr>\n <td>\n <table\n class=\"ins-recommendation-product-container\"\n width=\"100%\"\n cellpadding=\"0\"\n cellspacing=\"0\"\n border=\"0\"\n >\n {-{-PRODUCT_ROWS-}-}\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </table>\n </td>\n";
|
|
4
|
+
export declare function getDefaultTemplate(): string;
|
|
5
|
+
/**
|
|
6
|
+
* Generates a custom template with specified products and layout
|
|
7
|
+
* @param products - Array of products to display
|
|
8
|
+
* @param productsPerRow - Number of products per row
|
|
9
|
+
* @param title - Optional title for the block
|
|
10
|
+
* @param composition - Optional array defining order of card elements
|
|
11
|
+
* @returns Complete HTML template
|
|
12
|
+
*/
|
|
13
|
+
export declare function generateBlockTemplate(products: RecommendationProduct[], productsPerRow: number, title?: string, composition?: string[]): string;
|
|
14
|
+
export declare function prepareProductRows(products: RecommendationProduct[], productsPerRow: number, composition?: string[]): string;
|
|
15
|
+
export { DEFAULTS, DEFAULT_CARD_COMPOSITION, getDefaultProducts, };
|
|
16
|
+
export default blockTemplate;
|
package/dist/src/extensions/Blocks/Recommendation/{template.d.ts → templates/migrationTemplate.d.ts}
RENAMED
|
@@ -1,43 +1,16 @@
|
|
|
1
1
|
import type { RecommendationProduct } from '@@/Types/recommendation';
|
|
2
|
-
|
|
3
|
-
* Migration template for converting old recommendation blocks (v1) to new format (v2)
|
|
4
|
-
*
|
|
5
|
-
* This template is used by Stripo to migrate existing emails with old recommendation blocks
|
|
6
|
-
* to the new block structure. It preserves user content while updating the HTML structure.
|
|
7
|
-
*
|
|
8
|
-
* Pattern:
|
|
9
|
-
* - Detects old blocks with class "ins-recommendation-v3-block-1"
|
|
10
|
-
* - Extracts title from ".ext-recommendation-title"
|
|
11
|
-
* - Extracts product cards and reconstructs them in new format
|
|
12
|
-
* - Preserves all product data variables ({{1_0_name}}, {{1_0_price}}, etc.)
|
|
13
|
-
*/
|
|
2
|
+
import { DEFAULTS, getDefaultProducts } from './templateUtils';
|
|
14
3
|
declare const migrationTemplate = "\n <td\n align=\"left\"\n esd-extension-block-id=\"recommendation-block\"\n esd-handler-name=\"esd-extension-RecommendationBlock\"\n class=\"ins-recommendation-v3-block-v2 esd-block-recommendation-v3-block esd-extension-block es-p20\"\n >\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr>\n <td align=\"center\">\n <table\n class=\"container\"\n width=\"100%\"\n cellpadding=\"0\"\n cellspacing=\"0\"\n border=\"0\">\n <tbody>\n <tr>\n <td>\n <table\n width=\"100%\"\n cellpadding=\"0\"\n cellspacing=\"0\"\n border=\"0\">\n <tbody>\n <tr>\n {-{-TITLE-}-}\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n <tr>\n <td class=\"spacer\" style=\"height: 20px;\"></td>\n </tr>\n <tr>\n <td>\n <table\n class=\"ins-recommendation-product-container\"\n width=\"100%\"\n cellpadding=\"0\"\n cellspacing=\"0\"\n border=\"0\"\n >\n {-{-PRODUCT_ROWS-}-}\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </table>\n </td>\n";
|
|
4
|
+
export declare function getMigrationTemplate(): string;
|
|
15
5
|
/**
|
|
16
|
-
*
|
|
17
|
-
*/
|
|
18
|
-
export declare const DEFAULT_CARD_COMPOSITION: string[];
|
|
19
|
-
/**
|
|
20
|
-
* Prepares product rows HTML with customizable composition order
|
|
21
|
-
* @param products - Array of products to display
|
|
22
|
-
* @param productsPerRow - Number of products per row
|
|
23
|
-
* @param composition - Optional array defining order of card elements
|
|
24
|
-
* @returns HTML string for product rows
|
|
25
|
-
*/
|
|
26
|
-
export declare function prepareProductRows(products: RecommendationProduct[], productsPerRow: number, composition?: string[]): string;
|
|
27
|
-
/**
|
|
28
|
-
* @returns The default mock products for initial template
|
|
29
|
-
*/
|
|
30
|
-
export declare function getDefaultProducts(): RecommendationProduct[];
|
|
31
|
-
/**
|
|
32
|
-
* @returns The template for the default checkbox block
|
|
33
|
-
*/
|
|
34
|
-
export declare function getDefaultTemplate(): string;
|
|
35
|
-
/**
|
|
36
|
-
* Generates the complete HTML template with dynamic products and layout
|
|
6
|
+
* Generates a custom migration template with specified products and layout
|
|
37
7
|
* @param products - Array of products to display
|
|
38
8
|
* @param productsPerRow - Number of products per row
|
|
39
9
|
* @param title - Optional title for the block
|
|
10
|
+
* @param composition - Optional array defining order of card elements
|
|
40
11
|
* @returns Complete HTML template
|
|
41
12
|
*/
|
|
42
|
-
export declare function
|
|
13
|
+
export declare function generateMigrationTemplate(products: RecommendationProduct[], productsPerRow: number, title?: string, composition?: string[]): string;
|
|
14
|
+
export declare function prepareProductRows(products: RecommendationProduct[], productsPerRow: number, composition?: string[]): string;
|
|
15
|
+
export { DEFAULTS, getDefaultProducts };
|
|
43
16
|
export default migrationTemplate;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { RecommendationProduct } from '@@/Types/recommendation';
|
|
2
|
+
export interface ElementRenderer {
|
|
3
|
+
productImage: (product: RecommendationProduct) => string;
|
|
4
|
+
productName: (product: RecommendationProduct) => string;
|
|
5
|
+
productPrice: (product: RecommendationProduct) => string;
|
|
6
|
+
productOldPrice: (product: RecommendationProduct) => string;
|
|
7
|
+
productButton: (product: RecommendationProduct) => string;
|
|
8
|
+
}
|
|
9
|
+
export interface TemplateConfig {
|
|
10
|
+
spacer: string;
|
|
11
|
+
blockTemplate: string;
|
|
12
|
+
productRow: string;
|
|
13
|
+
productCardWrapper: string;
|
|
14
|
+
elementRenderer: ElementRenderer;
|
|
15
|
+
}
|
|
16
|
+
export declare const DEFAULTS: {
|
|
17
|
+
TITLE: string;
|
|
18
|
+
DESCRIPTION: string;
|
|
19
|
+
};
|
|
20
|
+
export declare const spacer = "\n <tr>\n <td class=\"spacer\" style=\"height: 20px;\"></td>\n </tr>\n";
|
|
21
|
+
export declare const productRow = "\n <tr>\n <td>\n <table width=\"100%\" height=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n {-{-PRODUCTS-}-}\n </table>\n </td>\n </tr>\n";
|
|
22
|
+
export declare const productCardWrapper = "\n <td width=\"{-{-COLUMN_WIDTH-}-}\" style=\"padding: 0 5px;\" valign=\"top\" height=\"100%\">\n <table\n width=\"100%\"\n height=\"100%\"\n cellpadding=\"0\"\n cellspacing=\"0\"\n border=\"0\"\n class=\"product-card-wrapper\">\n <tr>\n <td\n class=\"product-attribute-cell\"\n valign=\"top\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n {-{-PRODUCT_CONTENT-}-}\n </tbody>\n </table>\n </td>\n </tr>\n </table>\n </td>\n";
|
|
23
|
+
export declare const DEFAULT_CARD_COMPOSITION: string[];
|
|
24
|
+
export declare function getDefaultProducts(): RecommendationProduct[];
|
|
25
|
+
/**
|
|
26
|
+
* Core template generation logic that works with any element renderer
|
|
27
|
+
* @param products - Array of products to display
|
|
28
|
+
* @param productsPerRow - Number of products per row
|
|
29
|
+
* @param elementRenderer - Object with methods to render each product element
|
|
30
|
+
* @param composition - Optional array defining order of card elements
|
|
31
|
+
* @returns HTML string for product rows
|
|
32
|
+
*/
|
|
33
|
+
export declare function prepareProductRows(products: RecommendationProduct[], productsPerRow: number, elementRenderer: ElementRenderer, composition?: string[]): string;
|
|
34
|
+
/**
|
|
35
|
+
* Generates complete HTML template with dynamic products and layout
|
|
36
|
+
* @param blockTemplate - The base block template string
|
|
37
|
+
* @param products - Array of products to display
|
|
38
|
+
* @param productsPerRow - Number of products per row
|
|
39
|
+
* @param elementRenderer - Element renderer for generating product HTML
|
|
40
|
+
* @param title - Title for the block
|
|
41
|
+
* @param composition - Optional array defining order of card elements
|
|
42
|
+
* @returns Complete HTML template
|
|
43
|
+
*/
|
|
44
|
+
export declare function generateTemplate(blockTemplate: string, products: RecommendationProduct[], productsPerRow: number, elementRenderer: ElementRenderer, title?: string, composition?: string[]): string;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import type { DynamicContent } from '@@/Types/generic';
|
|
1
|
+
import type { DynamicContent, PositionData } from '@@/Types/generic';
|
|
2
2
|
export declare class ExternalMergeTagsLibrary {
|
|
3
3
|
selectedDynamicContent: DynamicContent | null;
|
|
4
4
|
dataSelectCallback: (data: DynamicContent) => void;
|
|
5
|
-
|
|
5
|
+
private closeDynamicContentHandler;
|
|
6
|
+
/**
|
|
7
|
+
* Opens the merge tags library modal
|
|
8
|
+
* @param dynamicContent - Currently selected dynamic content (if any)
|
|
9
|
+
* @param onDataSelectCallback - Callback invoked when user selects a merge tag
|
|
10
|
+
* @param position - Optional position data to place the modal
|
|
11
|
+
*/
|
|
12
|
+
openMergeTagsLibrary(dynamicContent: DynamicContent, onDataSelectCallback: (data: DynamicContent) => void, position?: PositionData): void;
|
|
6
13
|
}
|