@useinsider/guido 1.0.3-beta.413aef4 → 1.0.3-beta.45db97c
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/index.js +7 -6
- package/dist/config/migrator/radioButtonMigrator.js +5 -5
- package/dist/config/migrator/recommendationMigrator.js +293 -0
- 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/control.js +15 -14
- package/dist/extensions/Blocks/Checkbox/extension.js +2 -2
- package/dist/extensions/Blocks/CouponBlock/extension.js +2 -2
- package/dist/extensions/Blocks/RadioButton/control.js +18 -17
- package/dist/extensions/Blocks/RadioButton/template.js +4 -4
- package/dist/extensions/Blocks/Recommendation/block.js +6 -3
- package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +103 -0
- package/dist/extensions/Blocks/Recommendation/constants.js +5 -0
- package/dist/extensions/Blocks/Recommendation/control.js +69 -40
- package/dist/extensions/Blocks/Recommendation/controls/button/align.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/border.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/borderRadius.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/color.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/fitToContent.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/fontFamily.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/margins.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/paddings.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/text.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/textSize.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.js +13 -0
- 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 +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/background.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/color.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/fontFamily.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/paddings.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/size.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/style.js +13 -0
- 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 +42 -7
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +107 -22
- 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/Blocks/common-control.js +125 -43
- 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 +307 -100
- 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/config/migrator/recommendationMigrator.d.ts +1 -0
- package/dist/src/enums/date.d.ts +4 -0
- package/dist/src/enums/onboarding.d.ts +1 -0
- package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/cardCompositionControl.d.ts +28 -0
- package/dist/src/extensions/Blocks/Recommendation/constants.d.ts +51 -0
- package/dist/src/extensions/Blocks/Recommendation/control.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/align.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/border.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/borderRadius.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/color.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/fitToContent.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/fontFamily.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/margins.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/paddings.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/text.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/textSize.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.d.ts +5 -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/name/align.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/background.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/color.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/fontFamily.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/paddings.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/size.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/style.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/templates/migrationTemplate.d.ts +16 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +44 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +21 -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 +3 -3
- package/dist/extensions/Blocks/Recommendation/template.js +0 -200
- package/dist/src/extensions/Blocks/Recommendation/template.d.ts +0 -6
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { RecommendationProduct } from '@@/Types/recommendation';
|
|
2
|
+
import { DEFAULTS, getDefaultProducts } from './templateUtils';
|
|
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;
|
|
5
|
+
/**
|
|
6
|
+
* Generates a custom migration 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 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 };
|
|
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;
|
|
@@ -62,5 +62,26 @@ export declare abstract class CommonControl extends Control {
|
|
|
62
62
|
*/
|
|
63
63
|
_GuIconButton({ name, icon, className }: IconButtonProps): string;
|
|
64
64
|
_GuTwoColumns(children: string[]): string;
|
|
65
|
+
/**
|
|
66
|
+
* Creates an orderable (sortable) list control
|
|
67
|
+
* @param name - The control name for value binding
|
|
68
|
+
* @param items - Array of item keys/values
|
|
69
|
+
* @param itemLabels - Optional array of objects with key and label properties for display
|
|
70
|
+
* @returns HTML string for the orderable control
|
|
71
|
+
*/
|
|
72
|
+
_GuOrderable(name: string, items: {
|
|
73
|
+
key: string;
|
|
74
|
+
label: string;
|
|
75
|
+
content: string;
|
|
76
|
+
}[]): string;
|
|
77
|
+
_GuNestedControl(id: string, content: string): string;
|
|
78
|
+
_GuExpandable(label: string, content: string): string;
|
|
79
|
+
_GuColorPicker(name: string): string;
|
|
80
|
+
_GuFontFamily(name: string, placeholder?: string): string;
|
|
81
|
+
_GuRadioButtons(name: string, buttons: {
|
|
82
|
+
text: string;
|
|
83
|
+
value: string;
|
|
84
|
+
}[]): string;
|
|
85
|
+
_GuCheckbox(name: string, caption: string): string;
|
|
65
86
|
}
|
|
66
87
|
export {};
|
|
@@ -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
|
}
|
|
@@ -1,16 +1,66 @@
|
|
|
1
|
+
import type { MergeTag } from '@@/Types/generic';
|
|
1
2
|
import { UIElementType, UIElement, UIElementTagRegistry } from '@stripoinc/ui-editor-extensions';
|
|
2
3
|
export declare class DynamicContentTagRegistry extends UIElementTagRegistry {
|
|
3
4
|
registerUiElements(uiElementsTagsMap: Record<UIElementType, string>): void;
|
|
4
5
|
}
|
|
5
6
|
export declare class DynamicContentUiElementExtension extends UIElement {
|
|
6
7
|
private mergeTagsButton;
|
|
7
|
-
private listener;
|
|
8
8
|
private mergeTagsLibrary;
|
|
9
|
-
private
|
|
9
|
+
private clickListener;
|
|
10
|
+
private lastClickedElement;
|
|
11
|
+
private lastClickedFrame;
|
|
12
|
+
private mousedownListener;
|
|
10
13
|
getId(): string;
|
|
11
14
|
onRender(container: HTMLElement): void;
|
|
12
15
|
onDestroy(): void;
|
|
13
16
|
_onClick(): void;
|
|
17
|
+
/**
|
|
18
|
+
* Called when Stripo detects merge tag interactions
|
|
19
|
+
* This is the key method that receives notifications about merge tag clicks
|
|
20
|
+
* @param name - Attribute name (e.g., 'mergeTag')
|
|
21
|
+
* @param value - MergeTag object with label, value, selStart, selEnd, etc.
|
|
22
|
+
*/
|
|
23
|
+
onAttributeUpdated(name: string, value: MergeTag | null | undefined): void;
|
|
14
24
|
openMergeTagLibrary(): void;
|
|
25
|
+
/**
|
|
26
|
+
* Opens the dynamic content library for external apps
|
|
27
|
+
* Dispatches event with dynamic content data and position
|
|
28
|
+
*/
|
|
29
|
+
private _openDynamicContentLibrary;
|
|
30
|
+
/**
|
|
31
|
+
* Gets the button's position on the screen
|
|
32
|
+
* Used to position the modal or anything else near the button
|
|
33
|
+
*/
|
|
34
|
+
private _getButtonPosition;
|
|
35
|
+
/**
|
|
36
|
+
* Sets up coordinate tracking for merge tag clicks in the iframe
|
|
37
|
+
* Workaround from Stripo intercepting click events - tracks mousedown events instead
|
|
38
|
+
*/
|
|
39
|
+
private _setupCoordinateTracking;
|
|
40
|
+
/**
|
|
41
|
+
* Gets the editor iframe element
|
|
42
|
+
*/
|
|
43
|
+
private _getEditorFrame;
|
|
44
|
+
/**
|
|
45
|
+
* Finds merge tag element in the element tree
|
|
46
|
+
*/
|
|
47
|
+
private _findMergeTagElement;
|
|
48
|
+
/**
|
|
49
|
+
* Gets the position of the last clicked element, calculated on-demand
|
|
50
|
+
* This ensures we always use the correct element's position even with rapid clicks
|
|
51
|
+
*/
|
|
52
|
+
private _getLastClickedPosition;
|
|
53
|
+
/**
|
|
54
|
+
* Calculates absolute position of element relative to page
|
|
55
|
+
*/
|
|
56
|
+
private _calculateAbsolutePosition;
|
|
57
|
+
/**
|
|
58
|
+
* Cleans up the coordinate tracking event listener
|
|
59
|
+
*/
|
|
60
|
+
private _cleanupCoordinateTracking;
|
|
61
|
+
/**
|
|
62
|
+
* Returns the HTML template for the "Add Dynamic Content" button
|
|
63
|
+
* This button is placed in the merge tags selector UI
|
|
64
|
+
*/
|
|
15
65
|
getTemplate(): string;
|
|
16
66
|
}
|
|
@@ -3,7 +3,7 @@ interface StoreState {
|
|
|
3
3
|
guidoConfig: GuidoConfig;
|
|
4
4
|
templateConfig?: TemplateConfig;
|
|
5
5
|
}
|
|
6
|
-
export declare const useConfigStore: import("pinia").StoreDefinition<"
|
|
6
|
+
export declare const useConfigStore: import("pinia").StoreDefinition<"guidoConfig", StoreState, {
|
|
7
7
|
getVariationId: (state: {
|
|
8
8
|
guidoConfig: {
|
|
9
9
|
translationsPath: string;
|
|
@@ -64,6 +64,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"config", S
|
|
|
64
64
|
senderName: string;
|
|
65
65
|
subject: string;
|
|
66
66
|
};
|
|
67
|
+
migrationDate: number;
|
|
67
68
|
partner?: {
|
|
68
69
|
partnerName: string;
|
|
69
70
|
productType: number;
|
|
@@ -76,17 +77,24 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"config", S
|
|
|
76
77
|
dynamicContent?: boolean | undefined;
|
|
77
78
|
saveAsTemplate?: boolean | undefined;
|
|
78
79
|
versionHistory?: boolean | undefined;
|
|
80
|
+
testMessage?: boolean | undefined;
|
|
81
|
+
displayConditions?: boolean | undefined;
|
|
79
82
|
} | undefined;
|
|
83
|
+
blocks?: {
|
|
84
|
+
excludeDefaults?: import("@@/Types/generic").GuidoBlockType[] | undefined;
|
|
85
|
+
includeCustoms?: import("@@/Types/generic").GuidoCustomBlockType[] | undefined;
|
|
86
|
+
} | undefined;
|
|
87
|
+
backButtonLabel?: string | undefined;
|
|
80
88
|
};
|
|
81
89
|
templateConfig?: {
|
|
82
90
|
preselectedDynamicContentList?: {
|
|
83
91
|
value: string;
|
|
84
|
-
text: string;
|
|
85
92
|
fallback?: string | undefined;
|
|
86
93
|
format?: {
|
|
87
94
|
key: string;
|
|
88
95
|
value: string;
|
|
89
96
|
} | undefined;
|
|
97
|
+
text: string;
|
|
90
98
|
}[] | undefined;
|
|
91
99
|
selectedUnsubscribePages?: number[] | undefined;
|
|
92
100
|
variationId?: string | undefined;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import type { DynamicContent } from '@@/Types/generic';
|
|
2
|
-
export declare const useDynamicContentStore: import("pinia").StoreDefinition<"
|
|
2
|
+
export declare const useDynamicContentStore: import("pinia").StoreDefinition<"guidoDynamicContent", {
|
|
3
3
|
selectedDynamicContent: DynamicContent;
|
|
4
4
|
selectedDynamicContentList: DynamicContent[];
|
|
5
5
|
}, {
|
|
6
6
|
getSelectedDynamicContentList: (state: {
|
|
7
7
|
selectedDynamicContent: {
|
|
8
8
|
value: string;
|
|
9
|
-
text: string;
|
|
10
9
|
fallback?: string | undefined;
|
|
11
10
|
format?: {
|
|
12
11
|
key: string;
|
|
13
12
|
value: string;
|
|
14
13
|
} | undefined;
|
|
14
|
+
text: string;
|
|
15
15
|
};
|
|
16
16
|
selectedDynamicContentList: {
|
|
17
17
|
value: string;
|
|
18
|
-
text: string;
|
|
19
18
|
fallback?: string | undefined;
|
|
20
19
|
format?: {
|
|
21
20
|
key: string;
|
|
22
21
|
value: string;
|
|
23
22
|
} | undefined;
|
|
23
|
+
text: string;
|
|
24
24
|
}[];
|
|
25
25
|
} & import("pinia").PiniaCustomStateProperties<{
|
|
26
26
|
selectedDynamicContent: DynamicContent;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { OnboardingCardConfig, OnboardingType, OnboardingStoreState } from '@@/Types/onboarding';
|
|
2
|
-
export declare const useOnboardingStore: import("pinia").StoreDefinition<"
|
|
2
|
+
export declare const useOnboardingStore: import("pinia").StoreDefinition<"guidoOnboarding", OnboardingStoreState, {
|
|
3
3
|
getOnboarding: (state: {
|
|
4
4
|
onboardings: {
|
|
5
5
|
newVersionPopup: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PreviewState, EmailFormat } from '@@/Types/preview';
|
|
2
|
-
export declare const usePreviewStore: import("pinia").StoreDefinition<"
|
|
2
|
+
export declare const usePreviewStore: import("pinia").StoreDefinition<"guidoPreview", PreviewState, {
|
|
3
3
|
isAMPModeEnabled: (state: {
|
|
4
4
|
emailFormat: EmailFormat;
|
|
5
5
|
ampHtml: string;
|
|
@@ -6,5 +6,5 @@ type RecommendationConfig = {
|
|
|
6
6
|
interface StoreState {
|
|
7
7
|
recommendationConfigs: RecommendationConfig[];
|
|
8
8
|
}
|
|
9
|
-
export declare const useRecommendationStore: import("pinia").StoreDefinition<"
|
|
9
|
+
export declare const useRecommendationStore: import("pinia").StoreDefinition<"guidoRecommendation", StoreState, {}, {}>;
|
|
10
10
|
export {};
|
|
@@ -17,7 +17,7 @@ interface StoreState {
|
|
|
17
17
|
message: number;
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
export declare const useSaveAsTemplateStore: import("pinia").StoreDefinition<"
|
|
20
|
+
export declare const useSaveAsTemplateStore: import("pinia").StoreDefinition<"guidoSaveAsTemplate", StoreState, {
|
|
21
21
|
getTemplateName: (state: {
|
|
22
22
|
templateName: string;
|
|
23
23
|
categories: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ToasterState, ToasterOptions } from '@@/Types/toaster';
|
|
2
|
-
export declare const useToasterStore: import("pinia").StoreDefinition<"
|
|
2
|
+
export declare const useToasterStore: import("pinia").StoreDefinition<"guidoToaster", ToasterState, {
|
|
3
3
|
shouldAutoHide: (s: {
|
|
4
4
|
status: boolean;
|
|
5
5
|
type: import("@@/Types/toaster").ToasterType;
|
|
@@ -11,7 +11,7 @@ interface StoreState {
|
|
|
11
11
|
isGlobalUnsubscribeDisabled: boolean;
|
|
12
12
|
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
13
13
|
}
|
|
14
|
-
export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"
|
|
14
|
+
export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guidoUnsubscribe", StoreState, {
|
|
15
15
|
getSelectedCollection: (state: {
|
|
16
16
|
templates: {
|
|
17
17
|
id: number;
|
|
@@ -2,7 +2,7 @@ import type { VersionHistoryState } from '@@/Types/version-history-api';
|
|
|
2
2
|
export interface StoreState extends VersionHistoryState {
|
|
3
3
|
editorVisualMode: 'desktop' | 'mobile';
|
|
4
4
|
}
|
|
5
|
-
export declare const useVersionHistoryStore: import("pinia").StoreDefinition<"
|
|
5
|
+
export declare const useVersionHistoryStore: import("pinia").StoreDefinition<"guidoVersionHistory", StoreState, {
|
|
6
6
|
hasPreviousPatch: (state: {
|
|
7
7
|
editorVisualMode: "desktop" | "mobile";
|
|
8
8
|
previousPatch: {
|
|
@@ -1 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Locale List:
|
|
3
|
+
* en-US -> MM/DD/YYYY
|
|
4
|
+
* en-GB -> DD/MM/YYYY
|
|
5
|
+
* tr-TR -> DD.MM.YYYY
|
|
6
|
+
*/
|
|
7
|
+
export declare const convertToDateObject: (date: string | number | Date | null | undefined) => Date;
|
|
8
|
+
export declare const locale: () => string;
|
|
9
|
+
export declare const localTz: string;
|
|
10
|
+
export declare const timezone: () => string;
|
|
11
|
+
export declare const hour12: () => boolean;
|
|
12
|
+
export declare const dateFormat: () => string;
|
|
13
|
+
/**
|
|
14
|
+
* @example 04/22/2024
|
|
15
|
+
* @param date - The date or timestamp input
|
|
16
|
+
* @param specificLocale - Locale to use for formatting
|
|
17
|
+
* @param tz - Timezone [window.l10n.timezone]
|
|
18
|
+
* @returns Formatted date string
|
|
19
|
+
*/
|
|
20
|
+
export declare const formatShortDate: (date: string | number | Date, specificLocale?: string, tz?: string) => string;
|
|
1
21
|
export declare const formatPatchDate: (timestamp: number) => string;
|
|
22
|
+
export declare const isAfterDate: (timestamp: number) => boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { DynamicContent, MergeTag } from '@@/Types/generic';
|
|
2
|
+
export declare const mergeTagToDynamicContent: (mergeTag: MergeTag) => DynamicContent;
|
|
2
3
|
export declare const dynamicContentToMergeTags: (dynamicContentList: DynamicContent[]) => MergeTag[];
|
|
3
4
|
export declare const getCsrfToken: () => string;
|
|
4
5
|
/**
|
|
@@ -32,6 +32,16 @@ ue-stripe-thumb:hover:not(.disabled),
|
|
|
32
32
|
padding: 0 16px 16px;
|
|
33
33
|
grid-row-gap: 16px;
|
|
34
34
|
}
|
|
35
|
+
|
|
36
|
+
/* TODO: will be removed after we find another way to hide stripo custom modules */
|
|
37
|
+
#moduleTab_tab1,
|
|
38
|
+
button[aria-label="Default Modules"],
|
|
39
|
+
button[aria-controls="moduleTab_tab1_content"],
|
|
40
|
+
#moduleTab_tab2,
|
|
41
|
+
button[aria-label="Pre-Built AMP"],
|
|
42
|
+
button[aria-controls="moduleTab_tab2_content"] {
|
|
43
|
+
display: none !important;
|
|
44
|
+
}
|
|
35
45
|
`;
|
|
36
46
|
export {
|
|
37
47
|
o as default
|
|
@@ -18,6 +18,11 @@ const n = `.esd-x,
|
|
|
18
18
|
border-radius: 0;
|
|
19
19
|
box-shadow: none;
|
|
20
20
|
}
|
|
21
|
+
|
|
22
|
+
.ins-recommendation-v3-block-v2 .product-attribute-cell ue-node-actions,
|
|
23
|
+
.ins-recommendation-v3-block-v2 .product-attribute-cell ue-node-panel {
|
|
24
|
+
display: none !important;
|
|
25
|
+
}
|
|
21
26
|
`;
|
|
22
27
|
export {
|
|
23
28
|
n as default
|
package/dist/stores/config.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { DefaultGuidoConfig as
|
|
2
|
-
import { defineStore as
|
|
3
|
-
const
|
|
1
|
+
import { DefaultGuidoConfig as i } from "../enums/defaults.js";
|
|
2
|
+
import { defineStore as e } from "pinia";
|
|
3
|
+
const n = e("guidoConfig", {
|
|
4
4
|
state: () => ({
|
|
5
|
-
guidoConfig:
|
|
5
|
+
guidoConfig: i,
|
|
6
6
|
templateConfig: {}
|
|
7
7
|
}),
|
|
8
8
|
getters: {
|
|
@@ -13,5 +13,5 @@ const r = i("config", {
|
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
n as useConfigStore
|
|
17
17
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { removeDuplicatesFromArray as n } from "../utils/arrayUtil.js";
|
|
2
2
|
import { defineStore as a } from "pinia";
|
|
3
|
-
const s = a("
|
|
3
|
+
const s = a("guidoDynamicContent", {
|
|
4
4
|
state: () => ({
|
|
5
|
-
selectedDynamicContent: { text: "", value: ""
|
|
5
|
+
selectedDynamicContent: { text: "", value: "" },
|
|
6
6
|
selectedDynamicContentList: []
|
|
7
7
|
}),
|
|
8
8
|
actions: {
|
package/dist/stores/editor.js
CHANGED
|
@@ -14,41 +14,41 @@ const e = () => ({
|
|
|
14
14
|
},
|
|
15
15
|
userModalState: {},
|
|
16
16
|
isFetched: !1
|
|
17
|
-
}),
|
|
17
|
+
}), c = s("guidoOnboarding", {
|
|
18
18
|
state: () => a(),
|
|
19
19
|
getters: {
|
|
20
|
-
getOnboarding: (n) => (
|
|
21
|
-
isActive: (n) => (
|
|
22
|
-
getCurrentCard: (n) => (
|
|
23
|
-
const
|
|
24
|
-
return
|
|
20
|
+
getOnboarding: (n) => (i) => n.onboardings[i],
|
|
21
|
+
isActive: (n) => (i) => n.onboardings[i].isActive,
|
|
22
|
+
getCurrentCard: (n) => (i) => {
|
|
23
|
+
const o = n.onboardings[i];
|
|
24
|
+
return o.config[o.cardIndex];
|
|
25
25
|
},
|
|
26
26
|
getGenericCurrentCard: (n) => {
|
|
27
|
-
const { genericOnboarding:
|
|
28
|
-
return
|
|
27
|
+
const { genericOnboarding: i } = n.onboardings;
|
|
28
|
+
return i.config[i.cardIndex];
|
|
29
29
|
},
|
|
30
30
|
getTextBlockCurrentCard: (n) => {
|
|
31
|
-
const { textBlockOnboarding:
|
|
32
|
-
return
|
|
31
|
+
const { textBlockOnboarding: i } = n.onboardings;
|
|
32
|
+
return i.config[i.cardIndex];
|
|
33
33
|
},
|
|
34
34
|
getVersionHistoryCurrentCard: (n) => {
|
|
35
|
-
const { versionHistoryOnboarding:
|
|
36
|
-
return
|
|
35
|
+
const { versionHistoryOnboarding: i } = n.onboardings;
|
|
36
|
+
return i.config[i.cardIndex];
|
|
37
37
|
},
|
|
38
38
|
getAmpCurrentCard: (n) => {
|
|
39
|
-
const { ampOnboarding:
|
|
40
|
-
return
|
|
39
|
+
const { ampOnboarding: i } = n.onboardings;
|
|
40
|
+
return i.config[i.cardIndex];
|
|
41
41
|
},
|
|
42
|
-
shouldShowOnboarding: (n) => (
|
|
43
|
-
const
|
|
44
|
-
return
|
|
42
|
+
shouldShowOnboarding: (n) => (i) => {
|
|
43
|
+
const o = n.userModalState.Guido;
|
|
44
|
+
return i === "newVersionPopup" && (o != null && o.genericOnboarding) ? !1 : o ? !o[i] : !0;
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
actions: {
|
|
48
48
|
closeOtherOnboardings(n) {
|
|
49
|
-
Object.keys(this.onboardings).forEach((
|
|
50
|
-
const
|
|
51
|
-
|
|
49
|
+
Object.keys(this.onboardings).forEach((i) => {
|
|
50
|
+
const o = i;
|
|
51
|
+
o !== n && this.onboardings[o].isActive && (this.onboardings[o].isActive = !1, this.onboardings[o].cardIndex = 0, this.onboardings[o].config = []);
|
|
52
52
|
});
|
|
53
53
|
},
|
|
54
54
|
start(n) {
|
|
@@ -63,8 +63,8 @@ const e = () => ({
|
|
|
63
63
|
previous(n) {
|
|
64
64
|
this.onboardings[n].cardIndex > 0 && this.onboardings[n].cardIndex--;
|
|
65
65
|
},
|
|
66
|
-
setConfig(n,
|
|
67
|
-
this.onboardings[n].config =
|
|
66
|
+
setConfig(n, i) {
|
|
67
|
+
this.onboardings[n].config = i ?? [], this.onboardings[n].cardIndex >= this.onboardings[n].config.length && (this.onboardings[n].cardIndex = 0);
|
|
68
68
|
},
|
|
69
69
|
async onDiscoverNowClicked() {
|
|
70
70
|
await this.setUserModalState("newVersionPopup", "true", "Guido"), await this.setUserModalState("genericOnboarding", "true", "Guido"), this.start("genericOnboarding");
|
|
@@ -81,15 +81,15 @@ const e = () => ({
|
|
|
81
81
|
async fetchUserModalState() {
|
|
82
82
|
if (this.isFetched)
|
|
83
83
|
return;
|
|
84
|
-
const { fetchUserModalState: n } = t(),
|
|
85
|
-
this.userModalState =
|
|
84
|
+
const { fetchUserModalState: n } = t(), i = await n();
|
|
85
|
+
this.userModalState = i, this.isFetched = !0;
|
|
86
86
|
},
|
|
87
|
-
async setUserModalState(n,
|
|
87
|
+
async setUserModalState(n, i, o) {
|
|
88
88
|
const { setUserModalState: r } = t();
|
|
89
|
-
await r(n,
|
|
89
|
+
await r(n, i, o), this.isFetched = !1, await this.fetchUserModalState();
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
93
|
export {
|
|
94
|
-
|
|
94
|
+
c as useOnboardingStore
|
|
95
95
|
};
|
package/dist/stores/preview.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineStore as e } from "pinia";
|
|
2
|
-
const
|
|
2
|
+
const o = () => ({
|
|
3
3
|
recommendationConfigs: []
|
|
4
|
-
}), n = e("
|
|
5
|
-
state: () =>
|
|
4
|
+
}), n = e("guidoRecommendation", {
|
|
5
|
+
state: () => o()
|
|
6
6
|
});
|
|
7
7
|
export {
|
|
8
8
|
n as useRecommendationStore
|
|
@@ -17,7 +17,7 @@ const r = () => ({
|
|
|
17
17
|
editor: 2,
|
|
18
18
|
message: 1
|
|
19
19
|
}
|
|
20
|
-
}),
|
|
20
|
+
}), g = i("guidoSaveAsTemplate", {
|
|
21
21
|
state: () => r(),
|
|
22
22
|
getters: {
|
|
23
23
|
getTemplateName: (e) => e.templateName.trim(),
|
|
@@ -44,5 +44,5 @@ const r = () => ({
|
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
export {
|
|
47
|
-
|
|
47
|
+
g as useSaveAsTemplateStore
|
|
48
48
|
};
|
package/dist/stores/toaster.js
CHANGED
|
@@ -12,7 +12,7 @@ const p = () => ({
|
|
|
12
12
|
typeSelectionDrawerStatus: !1,
|
|
13
13
|
isGlobalUnsubscribeDisabled: !1,
|
|
14
14
|
isSubscriptionPreferencesCenterDisabled: !1
|
|
15
|
-
}), g = d("
|
|
15
|
+
}), g = d("guidoUnsubscribe", {
|
|
16
16
|
state: () => p(),
|
|
17
17
|
getters: {
|
|
18
18
|
getSelectedCollection: (e) => i[e.selectedCollectionType],
|
|
@@ -5,13 +5,13 @@ const e = () => ({
|
|
|
5
5
|
description: "",
|
|
6
6
|
authorId: "",
|
|
7
7
|
authorName: ""
|
|
8
|
-
}),
|
|
8
|
+
}), i = () => ({
|
|
9
9
|
previousPatch: e(),
|
|
10
10
|
currentPatch: e(),
|
|
11
11
|
nextPatch: e(),
|
|
12
12
|
editorVisualMode: "desktop"
|
|
13
|
-
}),
|
|
14
|
-
state: () =>
|
|
13
|
+
}), r = a("guidoVersionHistory", {
|
|
14
|
+
state: () => i(),
|
|
15
15
|
getters: {
|
|
16
16
|
hasPreviousPatch: (t) => !!t.previousPatch.id,
|
|
17
17
|
hasCurrentPatch: (t) => !!t.currentPatch.id,
|
|
@@ -24,5 +24,5 @@ const e = () => ({
|
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
export {
|
|
27
|
-
|
|
27
|
+
r as useVersionHistoryStore
|
|
28
28
|
};
|