@useinsider/guido 1.0.3-beta.413aef4 → 1.0.3-beta.46b1cdf
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 +4 -0
- package/dist/components/Guido.vue.js +11 -9
- package/dist/components/Guido.vue2.js +14 -14
- 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/config/migrator/index.js +7 -6
- package/dist/config/migrator/recommendationMigrator.js +293 -0
- package/dist/enums/date.js +6 -0
- package/dist/enums/defaults.js +4 -3
- package/dist/enums/onboarding.js +2 -1
- 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/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/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/src/@types/generic.d.ts +6 -0
- package/dist/src/components/Guido.vue.d.ts +1 -0
- 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/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/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/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/stores/config.d.ts +1 -0
- package/dist/src/utils/dateUtil.d.ts +21 -0
- package/dist/static/styles/customEditorStyle.css.js +5 -0
- package/dist/utils/dateUtil.js +24 -3
- 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,28 @@
|
|
|
1
|
+
import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
2
|
+
import { CommonControl } from '../common-control';
|
|
3
|
+
export declare const COMPOSITION_CONTROL_BLOCK_ID = "ui-elements-recommendation-card-composition";
|
|
4
|
+
export interface CardCompositionItem {
|
|
5
|
+
key: string;
|
|
6
|
+
label: string;
|
|
7
|
+
visible: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare class RecommendationCardCompositionControl extends CommonControl {
|
|
10
|
+
private currentComposition;
|
|
11
|
+
private currentVisibility;
|
|
12
|
+
getId(): string;
|
|
13
|
+
getTemplate(): string;
|
|
14
|
+
onRender(): void;
|
|
15
|
+
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
16
|
+
/**
|
|
17
|
+
* Initialize the composition order and visibility from the block or use defaults
|
|
18
|
+
*/
|
|
19
|
+
private _initializeComposition;
|
|
20
|
+
/**
|
|
21
|
+
* Apply the reordered composition to the block's HTML structure
|
|
22
|
+
*/
|
|
23
|
+
private _applyCompositionToBlock;
|
|
24
|
+
/**
|
|
25
|
+
* Apply visibility changes to the block's HTML structure
|
|
26
|
+
*/
|
|
27
|
+
private _applyVisibilityToBlock;
|
|
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
|
+
}
|
|
@@ -21,6 +21,12 @@ export declare class RecommendationBlockControl extends CommonControl {
|
|
|
21
21
|
_onFilterChange(value: boolean): void;
|
|
22
22
|
_onFilterSelectClick(): void;
|
|
23
23
|
_onDataChange(item: string, value: string | number | string[]): void;
|
|
24
|
+
/**
|
|
25
|
+
* Get the current card composition from block data attribute or use default
|
|
26
|
+
*/
|
|
27
|
+
_getCardComposition(): string[];
|
|
28
|
+
_regenerateProductRows(): void;
|
|
29
|
+
_debouncedRegenerateProductRows: import("@vueuse/shared").PromisifyFn<() => void>;
|
|
24
30
|
_onCurrencyConfigChange(item: string, value: string | number): void;
|
|
25
31
|
_onCurrencyChange(value: string): void;
|
|
26
32
|
_setProductIdsVisibility(): void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ImmutableHtmlNode, ButtonBorderRadiusBuiltInControl } from '@stripoinc/ui-editor-extensions';
|
|
2
|
+
export declare class ButtonBorderRadiusControl extends ButtonBorderRadiusBuiltInControl {
|
|
3
|
+
getId(): string;
|
|
4
|
+
getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
|
|
5
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ImmutableHtmlNode, ButtonFitToContainerBuiltInControl } from '@stripoinc/ui-editor-extensions';
|
|
2
|
+
export declare class ButtonFitToContentControl extends ButtonFitToContainerBuiltInControl {
|
|
3
|
+
getId(): string;
|
|
4
|
+
getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
|
|
5
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ImmutableHtmlNode, ButtonFontFamilyBuiltInControl } from '@stripoinc/ui-editor-extensions';
|
|
2
|
+
export declare class ButtonFontFamilyControl extends ButtonFontFamilyBuiltInControl {
|
|
3
|
+
getId(): string;
|
|
4
|
+
getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
|
|
5
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ImmutableHtmlNode, ButtonTextStyleAndFontColorBuiltInControl } from '@stripoinc/ui-editor-extensions';
|
|
2
|
+
export declare class ButtonTextStyleAndFontColorControl extends ButtonTextStyleAndFontColorBuiltInControl {
|
|
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 NameBackgroundControl extends TextBlockBackgroundBuiltInControl {
|
|
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 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
|
+
}
|
|
@@ -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;
|
|
@@ -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 +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;
|
|
@@ -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/utils/dateUtil.js
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
import { DEFAULT_LOCALE as r, DEFAULT as a, DEFAULT_TZ as c } from "../enums/date.js";
|
|
2
|
+
const m = (t) => t ? t instanceof Date ? t : typeof t == "string" ? t.length === 10 ? new Date(Number(t) * 1e3) : new Date(t) : typeof t == "number" ? t.toString().length === 10 ? new Date(t * 1e3) : new Date(t) : /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(), s = () => {
|
|
3
|
+
const t = window.l10n;
|
|
4
|
+
return (t == null ? void 0 : t.locale) === a ? r : (t == null ? void 0 : t.locale) || r;
|
|
5
|
+
}, u = new Intl.DateTimeFormat().resolvedOptions().timeZone, f = () => {
|
|
6
|
+
const t = window.l10n;
|
|
7
|
+
return (t == null ? void 0 : t.timezone) || u || c;
|
|
8
|
+
}, D = (t, e = s(), n = f()) => {
|
|
9
|
+
const o = {
|
|
10
|
+
year: "numeric",
|
|
11
|
+
month: "2-digit",
|
|
12
|
+
day: "2-digit",
|
|
13
|
+
timeZone: n
|
|
14
|
+
}, i = m(t);
|
|
15
|
+
return new Intl.DateTimeFormat(e, o).format(i);
|
|
16
|
+
}, T = (t) => {
|
|
2
17
|
if (!t)
|
|
3
18
|
return "";
|
|
4
19
|
const e = new Date(t);
|
|
@@ -10,7 +25,13 @@ const o = (t) => {
|
|
|
10
25
|
second: "2-digit",
|
|
11
26
|
hour12: !1
|
|
12
27
|
}).format(e);
|
|
13
|
-
};
|
|
28
|
+
}, h = (t) => t ? Math.floor(Date.now() / 1e3) >= t : !1;
|
|
14
29
|
export {
|
|
15
|
-
|
|
30
|
+
m as convertToDateObject,
|
|
31
|
+
T as formatPatchDate,
|
|
32
|
+
D as formatShortDate,
|
|
33
|
+
h as isAfterDate,
|
|
34
|
+
u as localTz,
|
|
35
|
+
s as locale,
|
|
36
|
+
f as timezone
|
|
16
37
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "1.0.3-beta.
|
|
3
|
+
"version": "1.0.3-beta.46b1cdf",
|
|
4
4
|
"description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
|
|
5
5
|
"main": "./dist/guido.umd.cjs",
|
|
6
6
|
"module": "./dist/library.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"author": "",
|
|
32
32
|
"license": "ISC",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@stripoinc/ui-editor-extensions": "3.
|
|
34
|
+
"@stripoinc/ui-editor-extensions": "3.1.0",
|
|
35
35
|
"@useinsider/design-system-vue": "0.14.20",
|
|
36
36
|
"@vueuse/core": "11.3.0",
|
|
37
37
|
"lodash-es": "4.17.21",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
},
|
|
84
84
|
"guido": {
|
|
85
85
|
"stripo": {
|
|
86
|
-
"version": "2.
|
|
86
|
+
"version": "2.42.0"
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
}
|