@useinsider/guido 1.0.3-beta.dfb1fcf → 1.0.3-beta.e1adf59
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 +3 -144
- package/dist/components/Guido.vue.js +10 -12
- package/dist/components/Guido.vue2.js +101 -84
- package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
- package/dist/components/organisms/header/LeftSlot.vue2.js +15 -16
- package/dist/components/organisms/header/RightSlot.vue.js +11 -11
- package/dist/components/organisms/header/RightSlot.vue2.js +22 -23
- package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +9 -9
- package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +17 -30
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +10 -12
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +18 -19
- package/dist/composables/useApiErrorTracking.js +120 -0
- package/dist/composables/useErrorTracking.js +98 -0
- package/dist/composables/useGuidoActions.js +9 -19
- package/dist/composables/useHttp.js +89 -52
- package/dist/composables/useStripo.js +163 -66
- package/dist/composables/useStripoErrorCategory.js +86 -0
- package/dist/composables/useStripoSlackNotifier.js +47 -0
- package/dist/config/compiler/unsubscribeCompilerRules.js +28 -33
- package/dist/config/migrator/index.js +6 -7
- package/dist/enums/defaults.js +8 -16
- package/dist/enums/onboarding.js +1 -2
- package/dist/enums/unsubscribe.js +25 -27
- 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 +3 -6
- package/dist/extensions/Blocks/Recommendation/control.js +65 -109
- package/dist/extensions/Blocks/Recommendation/extension.js +7 -18
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +21 -159
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +1 -1
- package/dist/extensions/Blocks/Recommendation/template.js +200 -0
- package/dist/extensions/Blocks/common-control.js +43 -125
- package/dist/extensions/DynamicContent/dynamic-content-modal.js +19 -25
- package/dist/extensions/DynamicContent/dynamic-content.js +33 -128
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +100 -312
- package/dist/package.json.js +1 -1
- package/dist/services/slackNotificationService.js +167 -0
- package/dist/services/stripoApi.js +49 -19
- package/dist/services/stripoErrorDeduplicationService.js +91 -0
- package/dist/src/@types/generic.d.ts +6 -42
- package/dist/src/components/Guido.vue.d.ts +3 -4
- package/dist/src/components/organisms/onboarding/NewVersionPopup.vue.d.ts +1 -3
- package/dist/src/components/organisms/onboarding/OnboardingWrapper.vue.d.ts +1 -3
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useApiErrorTracking.d.ts +26 -0
- package/dist/src/composables/useErrorTracking.d.ts +30 -0
- package/dist/src/composables/useGuidoActions.d.ts +0 -9
- package/dist/src/composables/useStripoErrorCategory.d.ts +26 -0
- package/dist/src/composables/useStripoSlackNotifier.d.ts +8 -0
- package/dist/src/enums/onboarding.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/control.d.ts +2 -11
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/template.d.ts +6 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +0 -21
- package/dist/src/extensions/DynamicContent/dynamic-content-modal.d.ts +2 -9
- package/dist/src/extensions/DynamicContent/dynamic-content.d.ts +2 -52
- package/dist/src/services/slackNotificationService.d.ts +110 -0
- package/dist/src/services/stripoErrorDeduplicationService.d.ts +75 -0
- package/dist/src/stores/config.d.ts +2 -10
- 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 +0 -21
- package/dist/src/utils/genericUtil.d.ts +0 -1
- package/dist/static/styles/components/narrow-panel.css.js +0 -10
- package/dist/static/styles/components/wide-panel.css.js +4 -0
- package/dist/static/styles/customEditorStyle.css.js +0 -19
- 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 +3 -24
- package/dist/utils/genericUtil.js +9 -20
- package/package.json +3 -3
- package/dist/composables/useBlocksConfig.js +0 -49
- package/dist/config/migrator/recommendationMigrator.js +0 -293
- package/dist/enums/date.js +0 -6
- package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +0 -193
- package/dist/extensions/Blocks/Recommendation/constants.js +0 -14
- package/dist/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.js +0 -68
- package/dist/extensions/Blocks/Recommendation/controls/index.js +0 -272
- package/dist/extensions/Blocks/Recommendation/controls/nameTextTrimControl.js +0 -74
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscountTextAfterControl.js +0 -71
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscountTextBeforeControl.js +0 -71
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPriceTextAfterControl.js +0 -71
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPriceTextBeforeControl.js +0 -71
- package/dist/extensions/Blocks/Recommendation/controls/priceHideControl.js +0 -60
- package/dist/extensions/Blocks/Recommendation/controls/priceInlineLayoutControl.js +0 -160
- package/dist/extensions/Blocks/Recommendation/controls/spacingControl.js +0 -188
- package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +0 -184
- package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +0 -189
- package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +0 -209
- package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +0 -25
- package/dist/extensions/Blocks/controlFactories.js +0 -234
- package/dist/src/composables/useBlocksConfig.d.ts +0 -11
- package/dist/src/config/migrator/recommendationMigrator.d.ts +0 -1
- package/dist/src/enums/date.d.ts +0 -4
- package/dist/src/extensions/Blocks/Recommendation/cardCompositionControl.d.ts +0 -79
- package/dist/src/extensions/Blocks/Recommendation/constants.d.ts +0 -91
- package/dist/src/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.d.ts +0 -25
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +0 -71
- package/dist/src/extensions/Blocks/Recommendation/controls/nameTextTrimControl.d.ts +0 -16
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscountTextAfterControl.d.ts +0 -15
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscountTextBeforeControl.d.ts +0 -15
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPriceTextAfterControl.d.ts +0 -15
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPriceTextBeforeControl.d.ts +0 -15
- package/dist/src/extensions/Blocks/Recommendation/controls/priceHideControl.d.ts +0 -16
- package/dist/src/extensions/Blocks/Recommendation/controls/priceInlineLayoutControl.d.ts +0 -50
- package/dist/src/extensions/Blocks/Recommendation/controls/spacingControl.d.ts +0 -60
- package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +0 -16
- package/dist/src/extensions/Blocks/Recommendation/templates/migrationTemplate.d.ts +0 -16
- package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +0 -52
- package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +0 -19
- package/dist/src/extensions/Blocks/controlFactories.d.ts +0 -95
- package/dist/src/utils/environmentUtil.d.ts +0 -5
- package/dist/utils/environmentUtil.js +0 -4
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
2
|
-
import { CommonControl } from '../../common-control';
|
|
3
|
-
export declare const SPACING_CONTROL_ID = "recommendation-spacing-control";
|
|
4
|
-
/**
|
|
5
|
-
* Control for managing spacing between product cards
|
|
6
|
-
* - Column spacing: horizontal gap between cards in the same row
|
|
7
|
-
* - Row spacing: vertical gap between different rows
|
|
8
|
-
*/
|
|
9
|
-
export declare class SpacingControl extends CommonControl {
|
|
10
|
-
getId(): string;
|
|
11
|
-
getTemplate(): string;
|
|
12
|
-
onRender(): void;
|
|
13
|
-
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
14
|
-
/**
|
|
15
|
-
* Reads spacing values from data attributes or returns defaults
|
|
16
|
-
*/
|
|
17
|
-
_setFormValues(): void;
|
|
18
|
-
/**
|
|
19
|
-
* Gets stored column spacing from the first product card wrapper's parent element's padding
|
|
20
|
-
* Reads the actual padding value instead of relying on data attributes
|
|
21
|
-
*
|
|
22
|
-
* The padding is applied as "0 {halfSpacing}px" on the parent TD element,
|
|
23
|
-
* so we need to extract the horizontal padding value and multiply by 2 to get total spacing.
|
|
24
|
-
*/
|
|
25
|
-
_getStoredColumnSpacing(): number;
|
|
26
|
-
/**
|
|
27
|
-
* Gets stored row spacing from the first spacer element's height style
|
|
28
|
-
* Reads the actual height value instead of relying on data attributes
|
|
29
|
-
*/
|
|
30
|
-
_getStoredRowSpacing(): number;
|
|
31
|
-
/**
|
|
32
|
-
* Handles column spacing changes
|
|
33
|
-
* Applies horizontal padding to all product card wrappers
|
|
34
|
-
*/
|
|
35
|
-
_onColumnSpacingChange(spacing: number): void;
|
|
36
|
-
/**
|
|
37
|
-
* Handles row spacing changes
|
|
38
|
-
* Applies height to all spacer elements between product rows
|
|
39
|
-
*/
|
|
40
|
-
_onRowSpacingChange(spacing: number): void;
|
|
41
|
-
/**
|
|
42
|
-
* Stores column spacing value in block data attribute
|
|
43
|
-
*/
|
|
44
|
-
_storeColumnSpacing(spacing: number): void;
|
|
45
|
-
/**
|
|
46
|
-
* Stores row spacing value in block data attribute
|
|
47
|
-
*/
|
|
48
|
-
_storeRowSpacing(spacing: number): void;
|
|
49
|
-
_listenToFormUpdates(): void;
|
|
50
|
-
/**
|
|
51
|
-
* Debounced version of _onColumnSpacingChange
|
|
52
|
-
* Prevents excessive DOM updates when user rapidly adjusts the counter
|
|
53
|
-
*/
|
|
54
|
-
_debouncedOnColumnSpacingChange: import("@vueuse/shared").PromisifyFn<(spacing: number) => void>;
|
|
55
|
-
/**
|
|
56
|
-
* Debounced version of _onRowSpacingChange
|
|
57
|
-
* Prevents excessive DOM updates when user rapidly adjusts the counter
|
|
58
|
-
*/
|
|
59
|
-
_debouncedOnRowSpacingChange: import("@vueuse/shared").PromisifyFn<(spacing: number) => void>;
|
|
60
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { RecommendationProduct } from '@@/Types/recommendation';
|
|
2
|
-
import { DEFAULTS, getDefaultProducts, DEFAULT_CARD_COMPOSITION, DEFAULT_CARD_VISIBILITY } from './templateUtils';
|
|
3
|
-
declare const blockTemplate = "\n <td\n align=\"left\"\n class=\"ins-recommendation-v3-block-v2 es-p20\"\n data-price-inline=\"0\">\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: 10px;\"></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, DEFAULT_CARD_VISIBILITY, getDefaultProducts, };
|
|
16
|
-
export default blockTemplate;
|
|
@@ -1,16 +0,0 @@
|
|
|
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 es-p20 esd-recommendation-block esd-extension-block esd-container-frame\"\n data-price-inline=\"0\">\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;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { RecommendationProduct } from '@@/Types/recommendation';
|
|
2
|
-
import { ATTR_PRODUCT_IMAGE, ATTR_PRODUCT_NAME, ATTR_PRODUCT_PRICE, ATTR_PRODUCT_OLD_PRICE, ATTR_PRODUCT_OMNIBUS_PRICE, ATTR_PRODUCT_OMNIBUS_DISCOUNT, ATTR_PRODUCT_BUTTON } from '../constants';
|
|
3
|
-
export interface ElementRenderer {
|
|
4
|
-
[ATTR_PRODUCT_IMAGE]: (product: RecommendationProduct) => string;
|
|
5
|
-
[ATTR_PRODUCT_NAME]: (product: RecommendationProduct) => string;
|
|
6
|
-
[ATTR_PRODUCT_PRICE]: (product: RecommendationProduct) => string;
|
|
7
|
-
[ATTR_PRODUCT_OLD_PRICE]: (product: RecommendationProduct) => string;
|
|
8
|
-
[ATTR_PRODUCT_OMNIBUS_PRICE]: (product: RecommendationProduct) => string;
|
|
9
|
-
[ATTR_PRODUCT_OMNIBUS_DISCOUNT]: (product: RecommendationProduct) => string;
|
|
10
|
-
[ATTR_PRODUCT_BUTTON]: (product: RecommendationProduct) => string;
|
|
11
|
-
}
|
|
12
|
-
export interface TemplateConfig {
|
|
13
|
-
spacer: string;
|
|
14
|
-
blockTemplate: string;
|
|
15
|
-
productRow: string;
|
|
16
|
-
productCardWrapper: string;
|
|
17
|
-
elementRenderer: ElementRenderer;
|
|
18
|
-
}
|
|
19
|
-
export declare const DEFAULTS: {
|
|
20
|
-
TITLE: string;
|
|
21
|
-
DESCRIPTION: string;
|
|
22
|
-
};
|
|
23
|
-
export declare const spacer = "\n <tr>\n <td class=\"spacer\" style=\"height: 10px;\"></td>\n </tr>\n";
|
|
24
|
-
export declare const productRow = "\n <tr class=\"recommendation-product-row\">\n <td>\n <table width=\"100%\" height=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n {-{-PRODUCTS-}-}\n </table>\n </td>\n </tr>\n";
|
|
25
|
-
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";
|
|
26
|
-
export declare const DEFAULT_CARD_COMPOSITION: string[];
|
|
27
|
-
/**
|
|
28
|
-
* Default visibility settings for card composition elements
|
|
29
|
-
* Omnibus Price and Omnibus Discount are hidden by default
|
|
30
|
-
*/
|
|
31
|
-
export declare const DEFAULT_CARD_VISIBILITY: Record<string, boolean>;
|
|
32
|
-
export declare function getDefaultProducts(): RecommendationProduct[];
|
|
33
|
-
/**
|
|
34
|
-
* Core template generation logic that works with any element renderer
|
|
35
|
-
* @param products - Array of products to display
|
|
36
|
-
* @param productsPerRow - Number of products per row
|
|
37
|
-
* @param elementRenderer - Object with methods to render each product element
|
|
38
|
-
* @param composition - Optional array defining order of card elements
|
|
39
|
-
* @returns HTML string for product rows
|
|
40
|
-
*/
|
|
41
|
-
export declare function prepareProductRows(products: RecommendationProduct[], productsPerRow: number, elementRenderer: ElementRenderer, composition?: string[]): string;
|
|
42
|
-
/**
|
|
43
|
-
* Generates complete HTML template with dynamic products and layout
|
|
44
|
-
* @param blockTemplate - The base block template string
|
|
45
|
-
* @param products - Array of products to display
|
|
46
|
-
* @param productsPerRow - Number of products per row
|
|
47
|
-
* @param elementRenderer - Element renderer for generating product HTML
|
|
48
|
-
* @param title - Title for the block
|
|
49
|
-
* @param composition - Optional array defining order of card elements
|
|
50
|
-
* @returns Complete HTML template
|
|
51
|
-
*/
|
|
52
|
-
export declare function generateTemplate(blockTemplate: string, products: RecommendationProduct[], productsPerRow: number, elementRenderer: ElementRenderer, title?: string, composition?: string[]): string;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utility for preserving text styling when updating innerHTML
|
|
3
|
-
*/
|
|
4
|
-
import type { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
5
|
-
/**
|
|
6
|
-
* Preserves existing style tags when updating text content
|
|
7
|
-
*
|
|
8
|
-
* When users apply text styles (bold, italic, etc.) in Stripo, the editor wraps
|
|
9
|
-
* content in tags like <strong>, <em>, <u>, <s>. This function extracts those
|
|
10
|
-
* style tags from the original HTML and re-applies them to the new text content.
|
|
11
|
-
* @example
|
|
12
|
-
* // Original: <span class="omnibus-text-before"><strong>Lowest price: </strong></span>
|
|
13
|
-
* // After calling preserveTextStyles(element, 'Best price: ')
|
|
14
|
-
* // Result: <strong>Best price: </strong>
|
|
15
|
-
* @param element - The DOM element or ImmutableHtmlNode containing the styled text
|
|
16
|
-
* @param newText - The new text content to insert
|
|
17
|
-
* @returns The new text wrapped in the original style tags
|
|
18
|
-
*/
|
|
19
|
-
export declare function preserveTextStyles(element: ImmutableHtmlNode | Element, newText: string): string;
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Reusable Control Factory Functions
|
|
3
|
-
*
|
|
4
|
-
* These factory functions can be used by any extension block to generate
|
|
5
|
-
* controls dynamically, reducing code duplication across the codebase.
|
|
6
|
-
*
|
|
7
|
-
* Note: TypeScript's type inference has limitations with dynamically generated classes.
|
|
8
|
-
* The eslint-disable comment above suppresses warnings that would otherwise require
|
|
9
|
-
* extensive type assertions throughout the file. The generated controls are type-safe
|
|
10
|
-
* at runtime and follow the exact same patterns as manually-written control classes.
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* Factory function to create text align controls for different block elements
|
|
14
|
-
*/
|
|
15
|
-
export declare function createTextAlignControl(controlId: string, targetBlockId: string, containerSelector: string): any;
|
|
16
|
-
/**
|
|
17
|
-
* Factory function to create text color controls for different block elements
|
|
18
|
-
*/
|
|
19
|
-
export declare function createTextColorControl(controlId: string, targetBlockId: string, containerSelector?: string): any;
|
|
20
|
-
/**
|
|
21
|
-
* Factory function to create text size controls for different block elements
|
|
22
|
-
*/
|
|
23
|
-
export declare function createTextSizeControl(controlId: string, targetBlockId: string, containerSelector?: string): any;
|
|
24
|
-
/**
|
|
25
|
-
* Factory function to create text style controls for different block elements
|
|
26
|
-
*/
|
|
27
|
-
export declare function createTextStyleControl(controlId: string, targetBlockId: string, containerSelector?: string): any;
|
|
28
|
-
/**
|
|
29
|
-
* Factory function to create text font family controls for different block elements
|
|
30
|
-
*/
|
|
31
|
-
export declare function createTextFontFamilyControl(controlId: string, targetBlockId: string, containerSelector?: string): any;
|
|
32
|
-
/**
|
|
33
|
-
* Factory function to create text background color controls for different block elements
|
|
34
|
-
*/
|
|
35
|
-
export declare function createTextBackgroundColorControl(controlId: string, targetBlockId: string, containerSelector?: string): any;
|
|
36
|
-
/**
|
|
37
|
-
* Factory function to create paddings controls for different block elements
|
|
38
|
-
*/
|
|
39
|
-
export declare function createPaddingsControl(controlId: string, targetBlockId: string, containerSelector?: string): any;
|
|
40
|
-
/**
|
|
41
|
-
* Factory function to create text line spacing controls for different block elements
|
|
42
|
-
*/
|
|
43
|
-
export declare function createTextLineSpacingControl(controlId: string, targetBlockId: string, containerSelector?: string): any;
|
|
44
|
-
/**
|
|
45
|
-
* Factory function to create button align controls for different block elements
|
|
46
|
-
*/
|
|
47
|
-
export declare function createButtonAlignControl(controlId: string, targetBlockId: string, containerSelector?: string): any;
|
|
48
|
-
/**
|
|
49
|
-
* Factory function to create button color controls for different block elements
|
|
50
|
-
*/
|
|
51
|
-
export declare function createButtonColorControl(controlId: string, targetBlockId: string, containerSelector?: string): any;
|
|
52
|
-
/**
|
|
53
|
-
* Factory function to create button border controls for different block elements
|
|
54
|
-
*/
|
|
55
|
-
export declare function createButtonBorderControl(controlId: string, targetBlockId: string, containerSelector?: string): any;
|
|
56
|
-
/**
|
|
57
|
-
* Factory function to create button border radius controls for different block elements
|
|
58
|
-
*/
|
|
59
|
-
export declare function createButtonBorderRadiusControl(controlId: string, targetBlockId: string, containerSelector?: string): any;
|
|
60
|
-
/**
|
|
61
|
-
* Factory function to create button font family controls for different block elements
|
|
62
|
-
*/
|
|
63
|
-
export declare function createButtonFontFamilyControl(controlId: string, targetBlockId: string, containerSelector?: string): any;
|
|
64
|
-
/**
|
|
65
|
-
* Factory function to create button margins controls for different block elements
|
|
66
|
-
*/
|
|
67
|
-
export declare function createButtonMarginsControl(controlId: string, targetBlockId: string, containerSelector?: string): any;
|
|
68
|
-
/**
|
|
69
|
-
* Factory function to create button paddings controls for different block elements
|
|
70
|
-
*/
|
|
71
|
-
export declare function createButtonPaddingsControl(controlId: string, targetBlockId: string, containerSelector?: string): any;
|
|
72
|
-
/**
|
|
73
|
-
* Factory function to create button text controls for different block elements
|
|
74
|
-
*/
|
|
75
|
-
export declare function createButtonTextControl(controlId: string, targetBlockId: string, containerSelector?: string): any;
|
|
76
|
-
/**
|
|
77
|
-
* Factory function to create button text size controls for different block elements
|
|
78
|
-
*/
|
|
79
|
-
export declare function createButtonTextSizeControl(controlId: string, targetBlockId: string, containerSelector?: string): any;
|
|
80
|
-
/**
|
|
81
|
-
* Factory function to create button text style and font color controls for different block elements
|
|
82
|
-
*/
|
|
83
|
-
export declare function createButtonTextStyleAndFontColorControl(controlId: string, targetBlockId: string, containerSelector: string): any;
|
|
84
|
-
/**
|
|
85
|
-
* Factory function to create button fit to container controls for different block elements
|
|
86
|
-
*/
|
|
87
|
-
export declare function createButtonFitToContainerControl(controlId: string, targetBlockId: string, containerSelector: string): any;
|
|
88
|
-
/**
|
|
89
|
-
* Factory function to create image size controls for different block elements
|
|
90
|
-
*/
|
|
91
|
-
export declare function createImageSizeControl(controlId: string, targetBlockId: string, containerSelector: string): any;
|
|
92
|
-
/**
|
|
93
|
-
* Factory function to create image margins controls for different block elements
|
|
94
|
-
*/
|
|
95
|
-
export declare function createImageMarginsControl(controlId: string, targetBlockId: string, containerSelector: string): any;
|