@useinsider/guido 2.0.0-beta.1ba7e26 → 2.0.0-beta.1f72712
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 +2 -0
- package/dist/@types/config/schemas.js +3 -1
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +15 -17
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +2 -2
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +5 -5
- package/dist/composables/useStripo.js +40 -40
- package/dist/config/migrator/index.js +8 -9
- package/dist/config/migrator/recommendationMigrator.js +2 -2
- package/dist/extensions/Blocks/CouponBlock/constants.js +4 -0
- package/dist/extensions/Blocks/CouponBlock/controls/index.js +29 -0
- package/dist/extensions/Blocks/CouponBlock/extension.js +5 -4
- package/dist/extensions/Blocks/CouponBlock/settingsPanel.js +20 -14
- package/dist/extensions/Blocks/CouponBlock/template.js +22 -11
- package/dist/extensions/Blocks/Items/block.js +40 -39
- package/dist/extensions/Blocks/Items/controls/button/link.js +11 -11
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +62 -50
- package/dist/extensions/Blocks/Items/controls/image/link.js +8 -8
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +15 -13
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +1 -1
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +1 -1
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +17 -15
- package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +15 -15
- package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +27 -29
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +127 -132
- package/dist/extensions/Blocks/Items/enums/settingsEnums.js +2 -2
- package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +48 -58
- package/dist/extensions/Blocks/Items/layouts/vertical.html.js +58 -48
- package/dist/extensions/Blocks/Items/store/items-block.js +2 -2
- package/dist/extensions/Blocks/Items/template.js +125 -312
- package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +20 -11
- package/dist/extensions/Blocks/Recommendation/block.js +40 -6
- package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +4 -0
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +4 -0
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +64 -0
- package/dist/extensions/Blocks/Recommendation/constants/layout.js +12 -0
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +19 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/index.js +64 -0
- package/dist/extensions/Blocks/Recommendation/controls/cardBackground/index.js +80 -0
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +232 -0
- package/dist/extensions/Blocks/Recommendation/controls/image/index.js +19 -0
- package/dist/extensions/Blocks/Recommendation/controls/layout/index.js +110 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +110 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/currency.js +207 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +54 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +148 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/locale.js +74 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +124 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/shuffle.js +71 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +124 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/index.js +46 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +76 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/index.js +44 -0
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.js +48 -0
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.js +73 -0
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.js +73 -0
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/index.js +48 -0
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.js +73 -0
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.js +73 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/index.js +44 -0
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +222 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +40 -43
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +13 -4
- package/dist/extensions/Blocks/Recommendation/services/configService.js +239 -0
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +128 -72
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +39 -34
- package/dist/extensions/Blocks/Recommendation/templates/horizontal/elementRenderer.js +181 -0
- package/dist/extensions/Blocks/Recommendation/templates/horizontal/template.js +71 -0
- package/dist/extensions/Blocks/Recommendation/templates/index.js +12 -0
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +116 -0
- package/dist/extensions/Blocks/Recommendation/templates/vertical/elementRenderer.js +211 -0
- package/dist/extensions/Blocks/Recommendation/templates/vertical/migration.js +251 -0
- package/dist/extensions/Blocks/Recommendation/templates/vertical/template.js +62 -0
- package/dist/extensions/Blocks/Recommendation/types/nodeConfig.js +6 -0
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +9 -9
- package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +36 -0
- package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +29 -0
- package/dist/extensions/Blocks/Recommendation/utils/tagName.js +46 -0
- package/dist/extensions/Blocks/common-control.js +53 -64
- package/dist/extensions/Blocks/controlFactories.js +162 -117
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +229 -176
- package/dist/services/stripoApi.js +6 -10
- package/dist/src/@types/config/schemas.d.ts +4 -0
- package/dist/src/components/wrappers/WpDrawer.vue.d.ts +1 -1
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/extensions/Blocks/CouponBlock/constants.d.ts +14 -0
- package/dist/src/extensions/Blocks/CouponBlock/controls/index.d.ts +108 -0
- package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +1 -1
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +4 -0
- package/dist/src/extensions/Blocks/Items/template.d.ts +1 -20
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +34 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +13 -0
- package/dist/src/extensions/Blocks/Recommendation/{constants.d.ts → constants/controlIds.d.ts} +19 -11
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +49 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +13 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/layout.d.ts +27 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +31 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +143 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardBackground/index.d.ts +31 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +95 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/image/index.d.ts +35 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +24 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/layout/index.d.ts +36 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/algorithm.d.ts +29 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/currency.d.ts +45 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/filters.d.ts +22 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +62 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/locale.d.ts +24 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +42 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/shuffle.d.ts +23 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +100 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/index.d.ts +97 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/textTrim.d.ts +16 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/index.d.ts +95 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.d.ts +100 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/index.d.ts +100 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/index.d.ts +95 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +83 -0
- package/dist/src/extensions/Blocks/Recommendation/extension.d.ts +9 -0
- package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +151 -0
- package/dist/src/extensions/Blocks/Recommendation/services/index.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +17 -16
- package/dist/src/extensions/Blocks/Recommendation/templates/horizontal/elementRenderer.d.ts +8 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/horizontal/migration.d.ts +25 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/horizontal/template.d.ts +18 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +39 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +45 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/vertical/elementRenderer.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/{migrationTemplate.d.ts → vertical/migration.d.ts} +11 -4
- package/dist/src/extensions/Blocks/Recommendation/templates/vertical/template.d.ts +33 -0
- package/dist/src/extensions/Blocks/Recommendation/types/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +154 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +19 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/priceFormatter.d.ts +33 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/stylePreserver.d.ts +113 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +77 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +8 -13
- package/dist/src/extensions/Blocks/controlFactories.d.ts +30 -7
- package/dist/src/stores/config.d.ts +17 -0
- package/dist/static/styles/components/wide-panel.css.js +0 -4
- package/dist/static/styles/customEditorStyle.css.js +38 -2
- package/package.json +1 -1
- package/dist/config/migrator/itemsBlockMigrator.js +0 -283
- package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +0 -172
- package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +0 -103
- package/dist/extensions/Blocks/Recommendation/constants.js +0 -5
- package/dist/extensions/Blocks/Recommendation/control.js +0 -306
- package/dist/extensions/Blocks/Recommendation/controls/button/align.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/border.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/borderRadius.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/color.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/fitToContent.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/fontFamily.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/margins.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/paddings.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/text.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/textSize.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/image/margins.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/image/size.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/name/align.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/name/background.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/name/color.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/name/fontFamily.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/name/paddings.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/name/size.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/name/style.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/align.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/background.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/color.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/paddings.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/size.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/style.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/price/align.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/price/background.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/price/color.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/price/fontFamily.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/price/paddings.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/price/size.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/price/style.js +0 -13
- package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +0 -160
- package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +0 -152
- package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +0 -180
- package/dist/src/config/migrator/itemsBlockMigrator.d.ts +0 -6
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +0 -71
- package/dist/src/extensions/Blocks/Recommendation/cardCompositionControl.d.ts +0 -28
- package/dist/src/extensions/Blocks/Recommendation/control.d.ts +0 -35
- package/dist/src/extensions/Blocks/Recommendation/controls/button/align.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/border.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/borderRadius.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/color.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/fitToContent.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/fontFamily.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/margins.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/paddings.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/text.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/textSize.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/image/margins.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/image/size.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/name/align.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/name/background.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/name/color.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/name/fontFamily.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/name/paddings.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/name/size.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/name/style.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/align.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/background.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/color.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/paddings.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/size.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/style.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/price/align.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/price/background.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/price/color.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/price/fontFamily.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/price/paddings.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/price/size.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/price/style.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +0 -16
- package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +0 -44
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { RecommendationProduct } from '@@/Types/recommendation';
|
|
2
|
+
import { type ElementRenderer } from '../utils';
|
|
3
|
+
/**
|
|
4
|
+
* Generates attribute-aligned product rows for vertical layout.
|
|
5
|
+
* Creates rows where each row contains one attribute type from all products.
|
|
6
|
+
* @param products - Array of products in this row group
|
|
7
|
+
* @param productsPerRow - Number of products per row (for column width calculation)
|
|
8
|
+
* @param elementRenderer - Object mapping attribute types to render functions
|
|
9
|
+
* @param composition - Array defining order of card elements
|
|
10
|
+
* @returns HTML string for attribute-aligned rows
|
|
11
|
+
*/
|
|
12
|
+
export declare function prepareVerticalAttributeRows(products: RecommendationProduct[], productsPerRow: number, elementRenderer: ElementRenderer, composition?: string[]): string;
|
|
13
|
+
/**
|
|
14
|
+
* Prepares vertical product rows with attribute-aligned structure
|
|
15
|
+
* Groups products into rows, then generates attribute-aligned HTML for each group
|
|
16
|
+
* @param products - Array of products to display
|
|
17
|
+
* @param productsPerRow - Number of products per row
|
|
18
|
+
* @param elementRenderer - Object mapping attribute types to render functions
|
|
19
|
+
* @param composition - Array defining order of card elements
|
|
20
|
+
* @returns HTML string for all product rows
|
|
21
|
+
*/
|
|
22
|
+
export declare function prepareVerticalProductRows(products: RecommendationProduct[], productsPerRow: number, elementRenderer: ElementRenderer, composition?: string[]): string;
|
|
23
|
+
/**
|
|
24
|
+
* Prepares vertical product rows with attribute-aligned structure.
|
|
25
|
+
* Uses row-based rendering where each attribute type forms a single row across all products.
|
|
26
|
+
* @param products - Array of products to display
|
|
27
|
+
* @param productsPerRow - Number of products per row
|
|
28
|
+
* @param composition - Array defining element order
|
|
29
|
+
* @returns HTML string for product rows
|
|
30
|
+
*/
|
|
31
|
+
export declare function prepareProductRows(products: RecommendationProduct[], productsPerRow: number, composition?: string[]): string;
|
|
32
|
+
export declare function getDefaultTemplate(): string;
|
|
33
|
+
export declare function generateBlockTemplate(products: RecommendationProduct[], productsPerRow: number, title?: string, composition?: string[]): string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recommendation Extension Types
|
|
3
|
+
*
|
|
4
|
+
* This module re-exports all type definitions for the Recommendation extension.
|
|
5
|
+
*/
|
|
6
|
+
export type { RecommendationNodeConfig, CurrencyConfig, OmnibusTextConfig, PartialNodeConfig, DeepPartialNodeConfig, } from './nodeConfig';
|
|
7
|
+
export { isValidNodeConfig, hasMinimalConfig, } from './nodeConfig';
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node Configuration Types for Recommendation Block
|
|
3
|
+
*
|
|
4
|
+
* This module defines the TypeScript interfaces for configuration data
|
|
5
|
+
* stored via Stripo's `setNodeConfig`/`getNodeConfig` APIs.
|
|
6
|
+
*
|
|
7
|
+
* The configuration persists with the template HTML, solving:
|
|
8
|
+
* - Configuration loss on save/reload
|
|
9
|
+
* - Multi-block independence
|
|
10
|
+
* - Undo/redo integration
|
|
11
|
+
* @see https://plugin.stripo.email/extensions/reference/blocks/Block
|
|
12
|
+
*/
|
|
13
|
+
import type { Filter } from '@@/Types/recommendation';
|
|
14
|
+
/**
|
|
15
|
+
* Currency display and formatting settings
|
|
16
|
+
*/
|
|
17
|
+
export interface CurrencyConfig {
|
|
18
|
+
/** Currency code (e.g., 'USD', 'EUR', 'TRY') */
|
|
19
|
+
code: string;
|
|
20
|
+
/** Currency symbol (e.g., '$', '€', '₺') */
|
|
21
|
+
symbol: string;
|
|
22
|
+
/** Symbol position relative to price */
|
|
23
|
+
alignment: 'before' | 'after';
|
|
24
|
+
/** Number of decimal places (-1 for no formatting) */
|
|
25
|
+
decimalCount: number;
|
|
26
|
+
/** Character used for decimal separation */
|
|
27
|
+
decimalSeparator: '.' | ',';
|
|
28
|
+
/** Character used for thousands separation */
|
|
29
|
+
thousandSeparator: '.' | ',' | ' ' | '';
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Configuration for omnibus price/discount text wrappers
|
|
33
|
+
* Used to display EU Omnibus Directive compliant pricing
|
|
34
|
+
*/
|
|
35
|
+
export interface OmnibusTextConfig {
|
|
36
|
+
/** Text to prepend (e.g., 'Lowest 30-day price: ') */
|
|
37
|
+
textBefore: string;
|
|
38
|
+
/** Text to append */
|
|
39
|
+
textAfter: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Complete configuration schema for Recommendation Block
|
|
43
|
+
*
|
|
44
|
+
* This interface combines:
|
|
45
|
+
* - Legacy `esd-dev-product-config` structure patterns
|
|
46
|
+
* - Current data-attribute based settings
|
|
47
|
+
* - Campaign data that was previously in Pinia store
|
|
48
|
+
*
|
|
49
|
+
* All properties are persisted with the template via `setNodeConfig`.
|
|
50
|
+
*/
|
|
51
|
+
export interface RecommendationNodeConfig {
|
|
52
|
+
/**
|
|
53
|
+
* Recommendation algorithm/strategy
|
|
54
|
+
* @example 'mostPopular', 'complementaryItems', 'manualMerchandising'
|
|
55
|
+
*/
|
|
56
|
+
strategy: string;
|
|
57
|
+
/**
|
|
58
|
+
* Product IDs for manual merchandising strategy
|
|
59
|
+
* Only used when strategy === 'manualMerchandising'
|
|
60
|
+
*/
|
|
61
|
+
productIds: string[];
|
|
62
|
+
/**
|
|
63
|
+
* Number of products to fetch from API
|
|
64
|
+
* Stored as string for consistency with API params
|
|
65
|
+
*/
|
|
66
|
+
size: string;
|
|
67
|
+
/**
|
|
68
|
+
* Whether to randomize product order on each load
|
|
69
|
+
*/
|
|
70
|
+
shuffleProducts: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Locale/language for product data
|
|
73
|
+
* @example 'en_US', 'tr_TR', 'de_DE'
|
|
74
|
+
*/
|
|
75
|
+
language: string;
|
|
76
|
+
/**
|
|
77
|
+
* Currency display and formatting configuration
|
|
78
|
+
*/
|
|
79
|
+
currency: CurrencyConfig;
|
|
80
|
+
/**
|
|
81
|
+
* Product filters for narrowing recommendations
|
|
82
|
+
* Uses existing Filter interface from recommendation types
|
|
83
|
+
*/
|
|
84
|
+
filters: Filter[];
|
|
85
|
+
/**
|
|
86
|
+
* Layout orientation
|
|
87
|
+
* - 'vertical': Products in a grid, attributes aligned across products
|
|
88
|
+
* - 'horizontal': Products in rows, each product is a full-width card
|
|
89
|
+
*/
|
|
90
|
+
layout: 'vertical' | 'horizontal';
|
|
91
|
+
/**
|
|
92
|
+
* Number of products per row (vertical layout only)
|
|
93
|
+
*/
|
|
94
|
+
cardsInRow: number;
|
|
95
|
+
/**
|
|
96
|
+
* Horizontal spacing between product cards in pixels (vertical layout only)
|
|
97
|
+
*/
|
|
98
|
+
columnSpacing: number;
|
|
99
|
+
/**
|
|
100
|
+
* Vertical spacing between product rows in pixels
|
|
101
|
+
*/
|
|
102
|
+
rowSpacing: number;
|
|
103
|
+
/**
|
|
104
|
+
* Order of card elements from top to bottom
|
|
105
|
+
* Array of ATTR_PRODUCT_* constants
|
|
106
|
+
* @example ['productImage', 'productName', 'productPrice', 'productButton']
|
|
107
|
+
*/
|
|
108
|
+
composition: string[];
|
|
109
|
+
/**
|
|
110
|
+
* Visibility flags for each card element
|
|
111
|
+
* Keys are ATTR_PRODUCT_* constants
|
|
112
|
+
*/
|
|
113
|
+
visibility: Record<string, boolean>;
|
|
114
|
+
/**
|
|
115
|
+
* Omnibus price text configuration
|
|
116
|
+
* For EU Omnibus Directive compliance
|
|
117
|
+
*/
|
|
118
|
+
omnibusPrice: OmnibusTextConfig;
|
|
119
|
+
/**
|
|
120
|
+
* Omnibus discount text configuration
|
|
121
|
+
* For EU Omnibus Directive compliance
|
|
122
|
+
*/
|
|
123
|
+
omnibusDiscount: OmnibusTextConfig;
|
|
124
|
+
/**
|
|
125
|
+
* Whether to trim long product names with ellipsis
|
|
126
|
+
*/
|
|
127
|
+
textTrimming: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Configuration version for future migrations
|
|
130
|
+
* Increment when making breaking changes to schema
|
|
131
|
+
*/
|
|
132
|
+
configVersion: number;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Partial configuration for updates
|
|
136
|
+
* All fields are optional to support partial updates via `updateConfig`
|
|
137
|
+
*/
|
|
138
|
+
export type PartialNodeConfig = Partial<RecommendationNodeConfig>;
|
|
139
|
+
/**
|
|
140
|
+
* Deep partial for nested objects
|
|
141
|
+
*/
|
|
142
|
+
export type DeepPartialNodeConfig = {
|
|
143
|
+
[K in keyof RecommendationNodeConfig]?: RecommendationNodeConfig[K] extends object ? Partial<RecommendationNodeConfig[K]> : RecommendationNodeConfig[K];
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* Check if an object is a valid RecommendationNodeConfig
|
|
147
|
+
* Used for migration detection and validation
|
|
148
|
+
*/
|
|
149
|
+
export declare function isValidNodeConfig(obj: unknown): obj is RecommendationNodeConfig;
|
|
150
|
+
/**
|
|
151
|
+
* Check if a node config has the minimum required fields
|
|
152
|
+
* Used to detect legacy templates that need migration
|
|
153
|
+
*/
|
|
154
|
+
export declare function hasMinimalConfig(obj: unknown): boolean;
|
|
@@ -0,0 +1,19 @@
|
|
|
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;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Price Formatting Utilities
|
|
3
|
+
*
|
|
4
|
+
* Provides functions for formatting prices according to currency settings.
|
|
5
|
+
* Used to format prices displayed in recommendation product cards.
|
|
6
|
+
*/
|
|
7
|
+
import type { CurrencyConfig } from '../types/nodeConfig';
|
|
8
|
+
/**
|
|
9
|
+
* Options for formatting a price
|
|
10
|
+
*/
|
|
11
|
+
export interface FormatPriceOptions {
|
|
12
|
+
/** The numeric price value */
|
|
13
|
+
price: number;
|
|
14
|
+
/** Currency configuration */
|
|
15
|
+
currency: CurrencyConfig;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Formats a numeric price according to currency settings
|
|
19
|
+
* @example
|
|
20
|
+
* // Returns: "$ 1,999.99"
|
|
21
|
+
* formatPrice({ price: 1999.99, currency: currencyConfig })
|
|
22
|
+
* @param options - Formatting options
|
|
23
|
+
* @returns Formatted price string
|
|
24
|
+
*/
|
|
25
|
+
export declare function formatPrice(options: FormatPriceOptions): string;
|
|
26
|
+
/**
|
|
27
|
+
* Parses a formatted price string back to a number
|
|
28
|
+
* Useful for extracting numeric values from formatted price displays
|
|
29
|
+
* @param formattedPrice - The formatted price string
|
|
30
|
+
* @param currency - Currency configuration for parsing
|
|
31
|
+
* @returns Parsed numeric value or NaN if parsing fails
|
|
32
|
+
*/
|
|
33
|
+
export declare function parseFormattedPrice(formattedPrice: string, currency: CurrencyConfig): number;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Style Preserver Utility
|
|
3
|
+
*
|
|
4
|
+
* Captures and restores element styles during block regeneration.
|
|
5
|
+
* This ensures user styling is preserved when:
|
|
6
|
+
* - Layout changes (vertical <-> horizontal)
|
|
7
|
+
* - Cards per row changes
|
|
8
|
+
* - Composition order changes
|
|
9
|
+
*
|
|
10
|
+
* Works with the node config system to provide complete style persistence.
|
|
11
|
+
*/
|
|
12
|
+
import type { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
13
|
+
import { ModificationDescription } from '@stripoinc/ui-editor-extensions';
|
|
14
|
+
/**
|
|
15
|
+
* Style properties that can be captured for text elements
|
|
16
|
+
*/
|
|
17
|
+
export interface TextElementStyles {
|
|
18
|
+
fontSize?: string;
|
|
19
|
+
fontFamily?: string;
|
|
20
|
+
fontWeight?: string;
|
|
21
|
+
fontStyle?: string;
|
|
22
|
+
color?: string;
|
|
23
|
+
textAlign?: string;
|
|
24
|
+
lineHeight?: string;
|
|
25
|
+
textDecoration?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Style properties for button elements
|
|
29
|
+
*/
|
|
30
|
+
export interface ButtonElementStyles extends TextElementStyles {
|
|
31
|
+
backgroundColor?: string;
|
|
32
|
+
borderRadius?: string;
|
|
33
|
+
border?: string;
|
|
34
|
+
padding?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Style properties for image elements
|
|
38
|
+
*/
|
|
39
|
+
export interface ImageElementStyles {
|
|
40
|
+
width?: string;
|
|
41
|
+
height?: string;
|
|
42
|
+
maxWidth?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Complete captured styles for a recommendation block
|
|
46
|
+
*/
|
|
47
|
+
export interface CapturedStyles {
|
|
48
|
+
/** Product name text styles */
|
|
49
|
+
name: TextElementStyles;
|
|
50
|
+
/** Current price text styles */
|
|
51
|
+
price: TextElementStyles;
|
|
52
|
+
/** Original/old price text styles */
|
|
53
|
+
oldPrice: TextElementStyles;
|
|
54
|
+
/** Omnibus price text styles */
|
|
55
|
+
omnibusPrice: TextElementStyles;
|
|
56
|
+
/** Omnibus discount text styles */
|
|
57
|
+
omnibusDiscount: TextElementStyles;
|
|
58
|
+
/** CTA button styles */
|
|
59
|
+
button: ButtonElementStyles;
|
|
60
|
+
/** Product image styles */
|
|
61
|
+
image: ImageElementStyles;
|
|
62
|
+
/** Card background color */
|
|
63
|
+
cardBackgroundColor: string | null;
|
|
64
|
+
/** Column spacing in pixels */
|
|
65
|
+
columnSpacing: number;
|
|
66
|
+
/** Row spacing in pixels */
|
|
67
|
+
rowSpacing: number;
|
|
68
|
+
/** Element composition order */
|
|
69
|
+
composition: string[];
|
|
70
|
+
/** Element visibility flags */
|
|
71
|
+
visibility: Record<string, boolean>;
|
|
72
|
+
}
|
|
73
|
+
type DocumentModifier = {
|
|
74
|
+
modifyHtml: (node: ImmutableHtmlNode) => {
|
|
75
|
+
setStyle: (prop: string, value: string) => DocumentModifier;
|
|
76
|
+
};
|
|
77
|
+
apply: (description: ModificationDescription) => void;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Capture all styles from a recommendation block
|
|
81
|
+
*
|
|
82
|
+
* Call this BEFORE any operation that regenerates the block HTML.
|
|
83
|
+
* The captured styles can then be restored after regeneration.
|
|
84
|
+
* @example
|
|
85
|
+
* // Before layout change
|
|
86
|
+
* const styles = captureStyles(this.currentNode);
|
|
87
|
+
*
|
|
88
|
+
* // ... regenerate block HTML ...
|
|
89
|
+
*
|
|
90
|
+
* // After regeneration
|
|
91
|
+
* restoreStyles(this.currentNode, this.api.getDocumentModifier(), styles);
|
|
92
|
+
* @param node - The block node to capture styles from
|
|
93
|
+
* @returns Complete captured styles object
|
|
94
|
+
*/
|
|
95
|
+
export declare function captureStyles(node: ImmutableHtmlNode | null | undefined): CapturedStyles;
|
|
96
|
+
/**
|
|
97
|
+
* Restore captured styles to a regenerated block
|
|
98
|
+
*
|
|
99
|
+
* Call this AFTER regenerating block HTML to reapply user styling.
|
|
100
|
+
* @example
|
|
101
|
+
* restoreStyles(this.currentNode, this.api.getDocumentModifier(), capturedStyles);
|
|
102
|
+
* @param node - The block node to restore styles to
|
|
103
|
+
* @param modifier - Document modifier for applying changes
|
|
104
|
+
* @param styles - Previously captured styles
|
|
105
|
+
*/
|
|
106
|
+
export declare function restoreStyles(node: ImmutableHtmlNode | null | undefined, modifier: DocumentModifier, styles: CapturedStyles): void;
|
|
107
|
+
/**
|
|
108
|
+
* Check if styles have meaningful content worth restoring
|
|
109
|
+
* @param styles - Captured styles to check
|
|
110
|
+
* @returns True if styles contain restorable content
|
|
111
|
+
*/
|
|
112
|
+
export declare function hasRestorableStyles(styles: CapturedStyles): boolean;
|
|
113
|
+
export {};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node Type Guards and Tag Name Utilities
|
|
3
|
+
*
|
|
4
|
+
* Provides type-safe utilities for working with ImmutableHtmlNode.
|
|
5
|
+
* Handles both standard DOM properties and Stripo's custom methods.
|
|
6
|
+
*/
|
|
7
|
+
import type { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
8
|
+
/** Interface for nodes with standard tagName property */
|
|
9
|
+
interface NodeWithTagName {
|
|
10
|
+
tagName: string;
|
|
11
|
+
}
|
|
12
|
+
/** Interface for nodes with getStyle method */
|
|
13
|
+
export interface NodeWithGetStyle {
|
|
14
|
+
getStyle: (property: string) => string | null | undefined;
|
|
15
|
+
}
|
|
16
|
+
/** Interface for nodes with parent method */
|
|
17
|
+
export interface NodeWithParent {
|
|
18
|
+
parent: () => ImmutableHtmlNode | null;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Type guard to check if a node has getStyle method
|
|
22
|
+
* @param node - The node to check
|
|
23
|
+
*/
|
|
24
|
+
export declare function hasGetStyle(node: unknown): node is NodeWithGetStyle;
|
|
25
|
+
/**
|
|
26
|
+
* Type guard to check if a node has parent method
|
|
27
|
+
* @param node - The node to check
|
|
28
|
+
*/
|
|
29
|
+
export declare function hasParent(node: unknown): node is NodeWithParent;
|
|
30
|
+
/**
|
|
31
|
+
* Type guard to check if a node is a TD element
|
|
32
|
+
* @param node - The node to check
|
|
33
|
+
*/
|
|
34
|
+
export declare function isTdNode(node: unknown): node is ImmutableHtmlNode & NodeWithTagName;
|
|
35
|
+
/**
|
|
36
|
+
* Safely retrieves a style value from a node
|
|
37
|
+
* @param node - The node to get the style from
|
|
38
|
+
* @param property - The CSS property name
|
|
39
|
+
* @returns The style value or null if not accessible
|
|
40
|
+
*/
|
|
41
|
+
export declare function safeGetStyle(node: ImmutableHtmlNode | null, property: string): string | null | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Safely retrieves the parent element of a node
|
|
44
|
+
* @param node - The node to get the parent from
|
|
45
|
+
* @returns The parent node or null if not accessible
|
|
46
|
+
*/
|
|
47
|
+
export declare function safeGetParent(node: ImmutableHtmlNode | null): ImmutableHtmlNode | null;
|
|
48
|
+
/**
|
|
49
|
+
* Safely retrieves the tag name from a node.
|
|
50
|
+
* Handles both standard DOM tagName property and Stripo's getTagName() method.
|
|
51
|
+
* @param node - The node to get the tag name from
|
|
52
|
+
* @param defaultValue - Default value if tag name cannot be determined (default: 'UNKNOWN')
|
|
53
|
+
* @returns The uppercase tag name
|
|
54
|
+
*/
|
|
55
|
+
export declare function getTagName(node: ImmutableHtmlNode | null | undefined, defaultValue?: string): string;
|
|
56
|
+
/**
|
|
57
|
+
* Checks if a tag name represents a table cell element.
|
|
58
|
+
* Includes standard TD and Stripo's custom block types (BLOCK_IMAGE, BLOCK_BUTTON).
|
|
59
|
+
* @param tagName - The tag name to check (case-insensitive)
|
|
60
|
+
* @returns True if the tag represents a table cell
|
|
61
|
+
*/
|
|
62
|
+
export declare function isTableCellTag(tagName: string): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Checks if a node is a table cell element.
|
|
65
|
+
* Combines getTagName and isTableCellTag for convenience.
|
|
66
|
+
* @param node - The node to check
|
|
67
|
+
* @returns True if the node is a table cell element
|
|
68
|
+
*/
|
|
69
|
+
export declare function isTableCellNode(node: ImmutableHtmlNode | null | undefined): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Gets the appropriate CSS display value for showing a table element.
|
|
72
|
+
* Table cells use 'table-cell', table rows use 'table-row'.
|
|
73
|
+
* @param node - The table element node
|
|
74
|
+
* @returns The CSS display value ('table-cell' or 'table-row')
|
|
75
|
+
*/
|
|
76
|
+
export declare function getTableDisplayValue(node: ImmutableHtmlNode | null | undefined): 'table-cell' | 'table-row';
|
|
77
|
+
export {};
|
|
@@ -56,30 +56,25 @@ export declare abstract class CommonControl extends Control {
|
|
|
56
56
|
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
57
57
|
onDestroy(): void;
|
|
58
58
|
/**
|
|
59
|
-
* Gets the
|
|
60
|
-
* @returns The container element or null if not found
|
|
61
|
-
*/
|
|
62
|
-
protected getItemsBlockContainer(): ImmutableHtmlElementNode | null;
|
|
63
|
-
/**
|
|
64
|
-
* Gets the config block element from the current node (legacy support).
|
|
65
|
-
* @deprecated Use getNodeConfig() from nodeConfigUtils instead for Stripo V2
|
|
59
|
+
* Gets the config block element from the current node.
|
|
66
60
|
* @returns The config block element or null if not found
|
|
67
61
|
*/
|
|
68
62
|
protected getConfigBlock(): ImmutableHtmlElementNode | null;
|
|
69
63
|
/**
|
|
70
|
-
* Gets the current block instance ID from the
|
|
64
|
+
* Gets the current block instance ID from the config block.
|
|
65
|
+
* @param blockInstanceIdAttribute - The attribute name for block instance ID (default: 'data-block-instance-id')
|
|
71
66
|
* @returns The block instance ID or null if not found
|
|
72
67
|
*/
|
|
73
|
-
protected getBlockInstanceId(): string | null;
|
|
68
|
+
protected getBlockInstanceId(blockInstanceIdAttribute?: string): string | null;
|
|
74
69
|
/**
|
|
75
70
|
* Handles block instance change detection and syncing.
|
|
76
|
-
* This is a helper method for controls that need to sync
|
|
77
|
-
*
|
|
78
|
-
* @param syncFunction - Function to call when block instance changes (to sync from node config)
|
|
71
|
+
* This is a helper method for controls that need to sync attributes when switching between block instances.
|
|
72
|
+
* @param syncFunction - Function to call when block instance changes (to sync from attributes)
|
|
79
73
|
* @param updateUI - Function to call to update the UI (called both on change and when same block)
|
|
74
|
+
* @param blockInstanceIdAttribute - The attribute name for block instance ID (default: 'data-block-instance-id')
|
|
80
75
|
* @returns true if block instance changed, false otherwise
|
|
81
76
|
*/
|
|
82
|
-
protected handleBlockInstanceChange(syncFunction: (node: ImmutableHtmlNode) => void, updateUI: () => void): boolean;
|
|
77
|
+
protected handleBlockInstanceChange(syncFunction: (node: ImmutableHtmlNode) => void, updateUI: () => void, blockInstanceIdAttribute?: string): boolean;
|
|
83
78
|
_GuLabel({ text, name, position }: LabelProps): string;
|
|
84
79
|
_GuToggle(name: string): string;
|
|
85
80
|
_GuSelectItem({ text, value }: {
|
|
@@ -12,8 +12,9 @@
|
|
|
12
12
|
import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
13
13
|
/**
|
|
14
14
|
* Factory function to create text align controls for different block elements
|
|
15
|
+
* When targetBlockId and containerSelector are not provided, applies directly to root
|
|
15
16
|
*/
|
|
16
|
-
export declare function createTextAlignControl(controlId: string, targetBlockId
|
|
17
|
+
export declare function createTextAlignControl(controlId: string, targetBlockId?: string, containerSelector?: string): {
|
|
17
18
|
new (): {
|
|
18
19
|
getId(): string;
|
|
19
20
|
getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
|
|
@@ -27,8 +28,9 @@ export declare function createTextAlignControl(controlId: string, targetBlockId:
|
|
|
27
28
|
};
|
|
28
29
|
/**
|
|
29
30
|
* Factory function to create text color controls for different block elements
|
|
31
|
+
* When targetBlockId and containerSelector are not provided, applies directly to root
|
|
30
32
|
*/
|
|
31
|
-
export declare function createTextColorControl(controlId: string, targetBlockId
|
|
33
|
+
export declare function createTextColorControl(controlId: string, targetBlockId?: string, containerSelector?: string): {
|
|
32
34
|
new (): {
|
|
33
35
|
getId(): string;
|
|
34
36
|
getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
|
|
@@ -42,8 +44,9 @@ export declare function createTextColorControl(controlId: string, targetBlockId:
|
|
|
42
44
|
};
|
|
43
45
|
/**
|
|
44
46
|
* Factory function to create text size controls for different block elements
|
|
47
|
+
* When targetBlockId and containerSelector are not provided, applies directly to root
|
|
45
48
|
*/
|
|
46
|
-
export declare function createTextSizeControl(controlId: string, targetBlockId
|
|
49
|
+
export declare function createTextSizeControl(controlId: string, targetBlockId?: string, containerSelector?: string): {
|
|
47
50
|
new (): {
|
|
48
51
|
getId(): string;
|
|
49
52
|
getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
|
|
@@ -57,8 +60,9 @@ export declare function createTextSizeControl(controlId: string, targetBlockId:
|
|
|
57
60
|
};
|
|
58
61
|
/**
|
|
59
62
|
* Factory function to create text style controls for different block elements
|
|
63
|
+
* When targetBlockId and containerSelector are not provided, applies directly to root
|
|
60
64
|
*/
|
|
61
|
-
export declare function createTextStyleControl(controlId: string, targetBlockId
|
|
65
|
+
export declare function createTextStyleControl(controlId: string, targetBlockId?: string, containerSelector?: string): {
|
|
62
66
|
new (): {
|
|
63
67
|
getId(): string;
|
|
64
68
|
getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
|
|
@@ -72,8 +76,9 @@ export declare function createTextStyleControl(controlId: string, targetBlockId:
|
|
|
72
76
|
};
|
|
73
77
|
/**
|
|
74
78
|
* Factory function to create text font family controls for different block elements
|
|
79
|
+
* When targetBlockId and containerSelector are not provided, applies directly to root
|
|
75
80
|
*/
|
|
76
|
-
export declare function createTextFontFamilyControl(controlId: string, targetBlockId
|
|
81
|
+
export declare function createTextFontFamilyControl(controlId: string, targetBlockId?: string, containerSelector?: string): {
|
|
77
82
|
new (): {
|
|
78
83
|
getId(): string;
|
|
79
84
|
getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
|
|
@@ -87,8 +92,9 @@ export declare function createTextFontFamilyControl(controlId: string, targetBlo
|
|
|
87
92
|
};
|
|
88
93
|
/**
|
|
89
94
|
* Factory function to create text background color controls for different block elements
|
|
95
|
+
* When targetBlockId and containerSelector are not provided, applies directly to root
|
|
90
96
|
*/
|
|
91
|
-
export declare function createTextBackgroundColorControl(controlId: string, targetBlockId
|
|
97
|
+
export declare function createTextBackgroundColorControl(controlId: string, targetBlockId?: string, containerSelector?: string): {
|
|
92
98
|
new (): {
|
|
93
99
|
getId(): string;
|
|
94
100
|
getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
|
|
@@ -102,8 +108,25 @@ export declare function createTextBackgroundColorControl(controlId: string, targ
|
|
|
102
108
|
};
|
|
103
109
|
/**
|
|
104
110
|
* Factory function to create paddings controls for different block elements
|
|
111
|
+
* When targetBlockId and containerSelector are not provided, applies directly to root
|
|
105
112
|
*/
|
|
106
|
-
export declare function createPaddingsControl(controlId: string, targetBlockId
|
|
113
|
+
export declare function createPaddingsControl(controlId: string, targetBlockId?: string, containerSelector?: string): {
|
|
114
|
+
new (): {
|
|
115
|
+
getId(): string;
|
|
116
|
+
getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
|
|
117
|
+
getParentControlId(): string;
|
|
118
|
+
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
119
|
+
getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
|
|
120
|
+
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
121
|
+
getAdditionalModifications(_root: ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
122
|
+
isVisible(_node: ImmutableHtmlNode): boolean;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* Factory function to create text line spacing controls for different block elements
|
|
127
|
+
* When targetBlockId and containerSelector are not provided, applies directly to root
|
|
128
|
+
*/
|
|
129
|
+
export declare function createTextLineSpacingControl(controlId: string, targetBlockId?: string, containerSelector?: string): {
|
|
107
130
|
new (): {
|
|
108
131
|
getId(): string;
|
|
109
132
|
getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
|