@useinsider/guido 1.0.3-beta.3dd93d0 → 1.0.3-beta.3e280d4
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 -147
- package/dist/components/Guido.vue.js +9 -11
- package/dist/components/Guido.vue2.js +70 -76
- package/dist/components/organisms/LoadingWrapper.vue.js +1 -1
- 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 +20 -21
- 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 +20 -23
- package/dist/composables/useActionsApi.js +1 -1
- package/dist/composables/useGuidoActions.js +9 -19
- package/dist/composables/useHtmlCompiler.js +13 -15
- package/dist/composables/useHtmlValidator.js +35 -36
- package/dist/composables/useStripo.js +60 -55
- package/dist/config/compiler/unsubscribeCompilerRules.js +28 -33
- package/dist/config/migrator/recommendationMigrator.js +98 -188
- package/dist/enums/defaults.js +11 -20
- package/dist/enums/extensions/recommendationBlock.js +2 -2
- package/dist/enums/onboarding.js +2 -7
- package/dist/enums/unsubscribe.js +25 -27
- package/dist/extensions/Blocks/Checkbox/block.js +2 -5
- package/dist/extensions/Blocks/Checkbox/control.js +14 -15
- package/dist/extensions/Blocks/Checkbox/extension.js +2 -2
- package/dist/extensions/Blocks/Checkbox/template.js +9 -14
- package/dist/extensions/Blocks/CouponBlock/extension.js +2 -2
- package/dist/extensions/Blocks/RadioButton/block.js +2 -5
- package/dist/extensions/Blocks/RadioButton/control.js +17 -18
- package/dist/extensions/Blocks/RadioButton/template.js +9 -18
- package/dist/extensions/Blocks/Recommendation/block.js +1 -1
- package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +298 -66
- package/dist/extensions/Blocks/Recommendation/control.js +4 -5
- package/dist/extensions/Blocks/Recommendation/extension.js +4 -4
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +43 -43
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +1 -1
- package/dist/extensions/Blocks/Recommendation/template.js +365 -0
- package/dist/extensions/Blocks/Unsubscribe/block.js +41 -45
- package/dist/extensions/Blocks/common-control.js +110 -174
- 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 +168 -213
- package/dist/node_modules/lodash-es/_arrayLikeKeys.js +12 -13
- package/dist/node_modules/lodash-es/keysIn.js +3 -3
- package/dist/package.json.js +1 -1
- package/dist/services/recommendationApi.js +19 -13
- package/dist/services/stripoApi.js +26 -38
- package/dist/src/@types/generic.d.ts +6 -42
- package/dist/src/components/Guido.vue.d.ts +2 -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/useGuidoActions.d.ts +0 -9
- package/dist/src/enums/defaults.d.ts +0 -1
- package/dist/src/enums/onboarding.d.ts +0 -5
- package/dist/src/extensions/Blocks/Checkbox/block.d.ts +0 -1
- package/dist/src/extensions/Blocks/Checkbox/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/RadioButton/block.d.ts +0 -1
- package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/cardCompositionControl.d.ts +42 -5
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/{templates/migrationTemplate.d.ts → template.d.ts} +34 -7
- package/dist/src/extensions/Blocks/Unsubscribe/block.d.ts +4 -3
- package/dist/src/extensions/Blocks/common-control.d.ts +7 -44
- 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/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 -335
- 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/customEditorStyle.css.js +3 -3
- 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 +36 -44
- 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 +8 -18
- package/package.json +4 -6
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +0 -21
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +0 -99
- package/dist/composables/useBlocksConfig.js +0 -48
- package/dist/config/compiler/itemsCompilerRules.js +0 -14
- package/dist/enums/date.js +0 -6
- package/dist/extensions/Blocks/Items/block.js +0 -67
- package/dist/extensions/Blocks/Items/controls/button/link.js +0 -68
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +0 -193
- package/dist/extensions/Blocks/Items/controls/image/link.js +0 -68
- package/dist/extensions/Blocks/Items/controls/index.js +0 -217
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +0 -70
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +0 -107
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +0 -123
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +0 -76
- package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +0 -61
- package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +0 -92
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +0 -316
- package/dist/extensions/Blocks/Items/enums/controlEnums.js +0 -5
- package/dist/extensions/Blocks/Items/enums/productEnums.js +0 -274
- package/dist/extensions/Blocks/Items/enums/settingsEnums.js +0 -77
- package/dist/extensions/Blocks/Items/extension.js +0 -20
- package/dist/extensions/Blocks/Items/iconsRegistry.js +0 -32
- package/dist/extensions/Blocks/Items/items.css.js +0 -23
- package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +0 -62
- package/dist/extensions/Blocks/Items/layouts/vertical.html.js +0 -72
- package/dist/extensions/Blocks/Items/settingsPanel.js +0 -132
- package/dist/extensions/Blocks/Items/store/items-block.js +0 -75
- package/dist/extensions/Blocks/Items/template.js +0 -195
- package/dist/extensions/Blocks/Items/utils/configBlockUtils.js +0 -17
- package/dist/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.js +0 -28
- package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +0 -76
- package/dist/extensions/Blocks/Items/utils/updateAttributes.js +0 -46
- 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/extensions/Blocks/controlFactories.js +0 -223
- package/dist/node_modules/lodash-es/_DataView.js +0 -6
- package/dist/node_modules/lodash-es/_Promise.js +0 -6
- package/dist/node_modules/lodash-es/_Set.js +0 -6
- package/dist/node_modules/lodash-es/_SetCache.js +0 -13
- package/dist/node_modules/lodash-es/_WeakMap.js +0 -6
- package/dist/node_modules/lodash-es/_arrayFilter.js +0 -10
- package/dist/node_modules/lodash-es/_arrayMap.js +0 -8
- package/dist/node_modules/lodash-es/_arrayPush.js +0 -8
- package/dist/node_modules/lodash-es/_arraySome.js +0 -9
- package/dist/node_modules/lodash-es/_baseEach.js +0 -6
- package/dist/node_modules/lodash-es/_baseFlatten.js +0 -13
- package/dist/node_modules/lodash-es/_baseForOwn.js +0 -8
- package/dist/node_modules/lodash-es/_baseGet.js +0 -11
- package/dist/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
- package/dist/node_modules/lodash-es/_baseHasIn.js +0 -6
- package/dist/node_modules/lodash-es/_baseIsEqual.js +0 -8
- package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +0 -32
- package/dist/node_modules/lodash-es/_baseIsMatch.js +0 -29
- package/dist/node_modules/lodash-es/_baseIteratee.js +0 -11
- package/dist/node_modules/lodash-es/_baseKeys.js +0 -14
- package/dist/node_modules/lodash-es/_baseMap.js +0 -11
- package/dist/node_modules/lodash-es/_baseMatches.js +0 -12
- package/dist/node_modules/lodash-es/_baseMatchesProperty.js +0 -17
- package/dist/node_modules/lodash-es/_baseProperty.js +0 -8
- package/dist/node_modules/lodash-es/_basePropertyDeep.js +0 -9
- package/dist/node_modules/lodash-es/_baseRange.js +0 -9
- package/dist/node_modules/lodash-es/_baseToString.js +0 -18
- package/dist/node_modules/lodash-es/_baseTrim.js +0 -8
- package/dist/node_modules/lodash-es/_cacheHas.js +0 -6
- package/dist/node_modules/lodash-es/_castPath.js +0 -10
- package/dist/node_modules/lodash-es/_createBaseEach.js +0 -15
- package/dist/node_modules/lodash-es/_createRange.js +0 -11
- package/dist/node_modules/lodash-es/_equalArrays.js +0 -40
- package/dist/node_modules/lodash-es/_equalByTag.js +0 -45
- package/dist/node_modules/lodash-es/_equalObjects.js +0 -36
- package/dist/node_modules/lodash-es/_getAllKeys.js +0 -9
- package/dist/node_modules/lodash-es/_getMatchData.js +0 -12
- package/dist/node_modules/lodash-es/_getSymbols.js +0 -10
- package/dist/node_modules/lodash-es/_getTag.js +0 -28
- package/dist/node_modules/lodash-es/_hasPath.js +0 -19
- package/dist/node_modules/lodash-es/_isFlattenable.js +0 -10
- package/dist/node_modules/lodash-es/_isKey.js +0 -12
- package/dist/node_modules/lodash-es/_isStrictComparable.js +0 -7
- package/dist/node_modules/lodash-es/_mapToArray.js +0 -9
- package/dist/node_modules/lodash-es/_matchesStrictComparable.js +0 -8
- package/dist/node_modules/lodash-es/_memoizeCapped.js +0 -11
- package/dist/node_modules/lodash-es/_nativeKeys.js +0 -5
- package/dist/node_modules/lodash-es/_setCacheAdd.js +0 -7
- package/dist/node_modules/lodash-es/_setCacheHas.js +0 -6
- package/dist/node_modules/lodash-es/_setToArray.js +0 -9
- package/dist/node_modules/lodash-es/_stringToPath.js +0 -10
- package/dist/node_modules/lodash-es/_toKey.js +0 -10
- package/dist/node_modules/lodash-es/_trimmedEndIndex.js +0 -9
- package/dist/node_modules/lodash-es/flatMap.js +0 -8
- package/dist/node_modules/lodash-es/get.js +0 -8
- package/dist/node_modules/lodash-es/hasIn.js +0 -8
- package/dist/node_modules/lodash-es/isSymbol.js +0 -9
- package/dist/node_modules/lodash-es/keys.js +0 -9
- package/dist/node_modules/lodash-es/map.js +0 -11
- package/dist/node_modules/lodash-es/property.js +0 -10
- package/dist/node_modules/lodash-es/range.js +0 -5
- package/dist/node_modules/lodash-es/stubArray.js +0 -6
- package/dist/node_modules/lodash-es/toFinite.js +0 -14
- package/dist/node_modules/lodash-es/toNumber.js +0 -22
- package/dist/node_modules/lodash-es/toString.js +0 -7
- package/dist/src/components/organisms/onboarding/ItemsOnboarding.vue.d.ts +0 -2
- package/dist/src/composables/useBlocksConfig.d.ts +0 -11
- package/dist/src/config/compiler/itemsCompilerRules.d.ts +0 -2
- package/dist/src/enums/date.d.ts +0 -4
- package/dist/src/extensions/Blocks/Items/block.d.ts +0 -27
- package/dist/src/extensions/Blocks/Items/controls/button/link.d.ts +0 -14
- package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +0 -33
- package/dist/src/extensions/Blocks/Items/controls/image/link.d.ts +0 -14
- package/dist/src/extensions/Blocks/Items/controls/index.d.ts +0 -501
- package/dist/src/extensions/Blocks/Items/controls/name/trimming.d.ts +0 -14
- package/dist/src/extensions/Blocks/Items/controls/price/currencyLocation.d.ts +0 -19
- package/dist/src/extensions/Blocks/Items/controls/price/currencySymbol.d.ts +0 -21
- package/dist/src/extensions/Blocks/Items/controls/price/formattedPrice.d.ts +0 -14
- package/dist/src/extensions/Blocks/Items/controls/price/hideDiscount.d.ts +0 -13
- package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +0 -15
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +0 -48
- package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +0 -62
- package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +0 -163
- package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +0 -50
- package/dist/src/extensions/Blocks/Items/extension.d.ts +0 -2
- package/dist/src/extensions/Blocks/Items/iconsRegistry.d.ts +0 -4
- package/dist/src/extensions/Blocks/Items/settingsPanel.d.ts +0 -4
- package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +0 -43
- package/dist/src/extensions/Blocks/Items/template.d.ts +0 -24
- package/dist/src/extensions/Blocks/Items/utils/configBlockUtils.d.ts +0 -23
- package/dist/src/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.d.ts +0 -32
- package/dist/src/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.d.ts +0 -50
- package/dist/src/extensions/Blocks/Items/utils/updateAttributes.d.ts +0 -8
- package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +0 -16
- package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +0 -44
- package/dist/src/extensions/Blocks/controlFactories.d.ts +0 -312
- package/dist/src/utils/environmentUtil.d.ts +0 -5
- package/dist/src/utils/pairProductVariables.d.ts +0 -7
- package/dist/utils/environmentUtil.js +0 -4
- package/dist/utils/pairProductVariables.js +0 -136
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { ProductType } from '@@/Types/extensions/items';
|
|
2
|
-
import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
3
|
-
import { CommonControl } from '../../common-control';
|
|
4
|
-
export declare const CONTROL_BLOCK_ID = "ui-elements-items-block";
|
|
5
|
-
export declare class ItemsBlockControl extends CommonControl {
|
|
6
|
-
private store;
|
|
7
|
-
getId(): string;
|
|
8
|
-
getTemplate(): string;
|
|
9
|
-
onRender(): void;
|
|
10
|
-
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
11
|
-
onDestroy(): void;
|
|
12
|
-
_getItemsType(): string;
|
|
13
|
-
_getOrientation(): string;
|
|
14
|
-
_getItemInCart(): string;
|
|
15
|
-
_onOrientationChange(value: string): void;
|
|
16
|
-
_onItemsTypeChange(value: string): void;
|
|
17
|
-
_onItemIdsChange(value: string): void;
|
|
18
|
-
_initializeSelectItems(): void;
|
|
19
|
-
_listenToFormUpdates(): void;
|
|
20
|
-
_renderTemplate(): void;
|
|
21
|
-
_getTemplateData(): {
|
|
22
|
-
imageSrc: string;
|
|
23
|
-
name: string;
|
|
24
|
-
price: string;
|
|
25
|
-
originalPrice: string;
|
|
26
|
-
quantity: string;
|
|
27
|
-
button: string;
|
|
28
|
-
};
|
|
29
|
-
_updateImageSrc(imageSrc: string): void;
|
|
30
|
-
_updateName(name: string): void;
|
|
31
|
-
_updatePrice(price: string): void;
|
|
32
|
-
_updateOriginalPrice(originalPrice: string): void;
|
|
33
|
-
_updateQuantity(quantity: string): void;
|
|
34
|
-
/**
|
|
35
|
-
* @todo Optimize template reordering for performance.
|
|
36
|
-
* @description Reorders the template structure based on current orientation and visibility settings.
|
|
37
|
-
*/
|
|
38
|
-
_reOrderTemplate(): void;
|
|
39
|
-
_updateDataTypeAttributes(itemsType: ProductType): void;
|
|
40
|
-
_updateDataNumberAttributes(itemId: string): void;
|
|
41
|
-
_reFillTemplate(): void;
|
|
42
|
-
_recalculateTrimming(): void;
|
|
43
|
-
private _getParagraphFromBlock;
|
|
44
|
-
private _escapeRegex;
|
|
45
|
-
private _removeCurrencySymbol;
|
|
46
|
-
private _replacePriceNumber;
|
|
47
|
-
private _buildPriceContent;
|
|
48
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
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 ItemsBlockId {
|
|
6
|
-
BUTTON = "items-block-button",
|
|
7
|
-
IMAGE = "items-block-image",
|
|
8
|
-
ORIGINAL_PRICE = "items-block-original-price",
|
|
9
|
-
PRICE = "items-block-price",
|
|
10
|
-
QUANTITY = "items-block-quantity",
|
|
11
|
-
NAME = "items-block-name"
|
|
12
|
-
}
|
|
13
|
-
export declare enum ItemsBlockControlId {
|
|
14
|
-
BUTTON_ALIGN = "items-block-button-align-control",
|
|
15
|
-
BUTTON_BORDER = "items-block-button-border-control",
|
|
16
|
-
BUTTON_BORDER_RADIUS = "items-block-button-border-radius-control",
|
|
17
|
-
BUTTON_COLOR = "items-block-button-color-control",
|
|
18
|
-
BUTTON_FIT_TO_CONTENT = "items-block-button-fit-to-content-control",
|
|
19
|
-
BUTTON_FONT_FAMILY = "items-block-button-font-family-control",
|
|
20
|
-
BUTTON_MARGINS = "items-block-button-margins-control",
|
|
21
|
-
BUTTON_PADDINGS = "items-block-button-paddings-control",
|
|
22
|
-
BUTTON_TEXT = "items-block-button-text-control",
|
|
23
|
-
BUTTON_TEXT_SIZE = "items-block-button-text-size-control",
|
|
24
|
-
BUTTON_TEXT_STYLE_AND_FONT_COLOR = "items-block-button-text-style-and-font-color-control",
|
|
25
|
-
BUTTON_LINK = "items-block-button-link-control",
|
|
26
|
-
IMAGE_SIZE = "items-block-image-size-control",
|
|
27
|
-
IMAGE_MARGINS = "items-block-image-margins-control",
|
|
28
|
-
IMAGE_LINK = "items-block-image-link-control",
|
|
29
|
-
ORIGINAL_PRICE_ALIGN = "items-block-original-price-align-control",
|
|
30
|
-
ORIGINAL_PRICE_COLOR = "items-block-original-price-color-control",
|
|
31
|
-
ORIGINAL_PRICE_SIZE = "items-block-original-price-size-control",
|
|
32
|
-
ORIGINAL_PRICE_STYLE = "items-block-original-price-style-control",
|
|
33
|
-
ORIGINAL_PRICE_FONT_FAMILY = "items-block-original-price-font-family-control",
|
|
34
|
-
ORIGINAL_PRICE_BACKGROUND = "items-block-original-price-background-control",
|
|
35
|
-
ORIGINAL_PRICE_PADDINGS = "items-block-original-price-paddings-control",
|
|
36
|
-
PRICE_ALIGN = "items-block-price-align-control",
|
|
37
|
-
PRICE_COLOR = "items-block-price-color-control",
|
|
38
|
-
PRICE_SIZE = "items-block-price-size-control",
|
|
39
|
-
PRICE_STYLE = "items-block-price-style-control",
|
|
40
|
-
PRICE_FONT_FAMILY = "items-block-price-font-family-control",
|
|
41
|
-
PRICE_BACKGROUND = "items-block-price-background-control",
|
|
42
|
-
PRICE_PADDINGS = "items-block-price-paddings-control",
|
|
43
|
-
PRICE_HIDE_DISCOUNT = "items-block-price-hide-discount-control",
|
|
44
|
-
PRICE_FORMATTED_PRICE = "items-block-price-formatted-price-control",
|
|
45
|
-
PRICE_CURRENCY_SYMBOL = "items-block-price-currency-symbol-control",
|
|
46
|
-
PRICE_CURRENCY_LOCATION = "items-block-price-currency-location-control",
|
|
47
|
-
PRICE_ORIENTATION = "items-block-price-orientation-control",
|
|
48
|
-
NAME_ALIGN = "items-block-name-align-control",
|
|
49
|
-
NAME_COLOR = "items-block-name-color-control",
|
|
50
|
-
NAME_SIZE = "items-block-name-size-control",
|
|
51
|
-
NAME_STYLE = "items-block-name-style-control",
|
|
52
|
-
NAME_FONT_FAMILY = "items-block-name-font-family-control",
|
|
53
|
-
NAME_BACKGROUND = "items-block-name-background-control",
|
|
54
|
-
NAME_TRIMMING = "items-block-name-trimming-control",
|
|
55
|
-
NAME_PADDINGS = "items-block-name-paddings-control",
|
|
56
|
-
QUANTITY_ALIGN = "items-block-quantity-align-control",
|
|
57
|
-
QUANTITY_COLOR = "items-block-quantity-color-control",
|
|
58
|
-
QUANTITY_FONT_FAMILY = "items-block-quantity-font-family-control",
|
|
59
|
-
QUANTITY_PADDINGS = "items-block-quantity-paddings-control",
|
|
60
|
-
QUANTITY_SIZE = "items-block-quantity-size-control",
|
|
61
|
-
QUANTITY_STYLE = "items-block-quantity-style-control"
|
|
62
|
-
}
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
export declare const templateFirstLine = "<td align=\"center\" class=\"ins-product-td items-block items-block-v2\">";
|
|
2
|
-
export declare const configAttributes: {
|
|
3
|
-
TYPE: string;
|
|
4
|
-
ITEMS_INDEX_SELECT_CONTROL_VALUE: string;
|
|
5
|
-
ORIENTATION: string;
|
|
6
|
-
PRODUCT_NAME_TRIMMING: string;
|
|
7
|
-
PRODUCT_PRICE_HIDE_DISCOUNT: string;
|
|
8
|
-
PRODUCT_PRICE_FORMATTED: string;
|
|
9
|
-
PRODUCT_PRICE_CURRENCY_SYMBOL: string;
|
|
10
|
-
PRODUCT_PRICE_CURRENCY_LOCATION: string;
|
|
11
|
-
PRODUCT_ORIGINAL_PRICE_CONTROL_ORIENTATION: string;
|
|
12
|
-
PRODUCT_BUTTON_LINK: string;
|
|
13
|
-
PRODUCT_IMAGE_LINK: string;
|
|
14
|
-
PRODUCT_NAME_CONTROL_VALUE: string;
|
|
15
|
-
PRODUCT_QUANTITY_CONTROL_VALUE: string;
|
|
16
|
-
PRODUCT_PRICE_CONTROL_VALUE: string;
|
|
17
|
-
BLOCK_INSTANCE_ID: string;
|
|
18
|
-
NAME_CONTROL_ENABLED: string;
|
|
19
|
-
QUANTITY_CONTROL_ENABLED: string;
|
|
20
|
-
PRICE_CONTROL_OPENED: string;
|
|
21
|
-
PRODUCT_IMAGE_VISIBLE: string;
|
|
22
|
-
PRODUCT_NAME_VISIBLE: string;
|
|
23
|
-
PRODUCT_QUANTITY_VISIBLE: string;
|
|
24
|
-
PRODUCT_PRICE_VISIBLE: string;
|
|
25
|
-
PRODUCT_ORIGINAL_PRICE_VISIBLE: string;
|
|
26
|
-
PRODUCT_BUTTON_VISIBLE: string;
|
|
27
|
-
};
|
|
28
|
-
export declare const productPairs: {
|
|
29
|
-
PAIRS_FOR_EXTENSION: {
|
|
30
|
-
imageSrc: {
|
|
31
|
-
CART_ITEMS: {
|
|
32
|
-
ATTR: string;
|
|
33
|
-
DEFAULT: string[];
|
|
34
|
-
};
|
|
35
|
-
BROWSED_ITEMS: {
|
|
36
|
-
ATTR: string;
|
|
37
|
-
DEFAULT: string[];
|
|
38
|
-
};
|
|
39
|
-
PURCHASED_ITEMS: {
|
|
40
|
-
ATTR: string;
|
|
41
|
-
DEFAULT: string[];
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
name: {
|
|
45
|
-
CART_ITEMS: {
|
|
46
|
-
ATTR: string;
|
|
47
|
-
DEFAULT: string[];
|
|
48
|
-
HREF: string;
|
|
49
|
-
DEFAULT_HREF: string;
|
|
50
|
-
};
|
|
51
|
-
BROWSED_ITEMS: {
|
|
52
|
-
ATTR: string;
|
|
53
|
-
DEFAULT: string[];
|
|
54
|
-
HREF: string;
|
|
55
|
-
DEFAULT_HREF: string;
|
|
56
|
-
};
|
|
57
|
-
PURCHASED_ITEMS: {
|
|
58
|
-
ATTR: string;
|
|
59
|
-
DEFAULT: string[];
|
|
60
|
-
HREF: string;
|
|
61
|
-
DEFAULT_HREF: string;
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
quantity: {
|
|
65
|
-
CART_ITEMS: {
|
|
66
|
-
ATTR: string;
|
|
67
|
-
DEFAULT: string;
|
|
68
|
-
};
|
|
69
|
-
BROWSED_ITEMS: {
|
|
70
|
-
ATTR: string;
|
|
71
|
-
DEFAULT: string;
|
|
72
|
-
};
|
|
73
|
-
PURCHASED_ITEMS: {
|
|
74
|
-
ATTR: string;
|
|
75
|
-
DEFAULT: string;
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
price: {
|
|
79
|
-
CART_ITEMS: {
|
|
80
|
-
PRICE: string;
|
|
81
|
-
PRICE_FORMATTED: string;
|
|
82
|
-
CURRENCY: string;
|
|
83
|
-
DEFAULT_PRICE: string;
|
|
84
|
-
DEFAULT_PRICE_FORMATTED: string;
|
|
85
|
-
DEFAULT_CURRENCY: string;
|
|
86
|
-
};
|
|
87
|
-
BROWSED_ITEMS: {
|
|
88
|
-
PRICE: string;
|
|
89
|
-
PRICE_FORMATTED: string;
|
|
90
|
-
CURRENCY: string;
|
|
91
|
-
DEFAULT_PRICE: string;
|
|
92
|
-
DEFAULT_PRICE_FORMATTED: string;
|
|
93
|
-
DEFAULT_CURRENCY: string;
|
|
94
|
-
};
|
|
95
|
-
PURCHASED_ITEMS: {
|
|
96
|
-
PRICE: string;
|
|
97
|
-
PRICE_FORMATTED: string;
|
|
98
|
-
CURRENCY: string;
|
|
99
|
-
DEFAULT_PRICE: string;
|
|
100
|
-
DEFAULT_PRICE_FORMATTED: string;
|
|
101
|
-
DEFAULT_CURRENCY: string;
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
originalPrice: {
|
|
105
|
-
CART_ITEMS: {
|
|
106
|
-
PRICE: string;
|
|
107
|
-
PRICE_FORMATTED: string;
|
|
108
|
-
CURRENCY: string;
|
|
109
|
-
DEFAULT_PRICE: string;
|
|
110
|
-
DEFAULT_PRICE_FORMATTED: string;
|
|
111
|
-
DEFAULT_CURRENCY: string;
|
|
112
|
-
};
|
|
113
|
-
BROWSED_ITEMS: {
|
|
114
|
-
PRICE: string;
|
|
115
|
-
PRICE_FORMATTED: string;
|
|
116
|
-
CURRENCY: string;
|
|
117
|
-
DEFAULT_PRICE: string;
|
|
118
|
-
DEFAULT_PRICE_FORMATTED: string;
|
|
119
|
-
DEFAULT_CURRENCY: string;
|
|
120
|
-
};
|
|
121
|
-
PURCHASED_ITEMS: {
|
|
122
|
-
PRICE: string;
|
|
123
|
-
PRICE_FORMATTED: string;
|
|
124
|
-
CURRENCY: string;
|
|
125
|
-
DEFAULT_PRICE: string;
|
|
126
|
-
DEFAULT_PRICE_FORMATTED: string;
|
|
127
|
-
DEFAULT_CURRENCY: string;
|
|
128
|
-
};
|
|
129
|
-
};
|
|
130
|
-
button: {
|
|
131
|
-
CART_ITEMS: {
|
|
132
|
-
HREF: string;
|
|
133
|
-
DEFAULT_HREF: string;
|
|
134
|
-
DEFAULT_LABEL: string;
|
|
135
|
-
};
|
|
136
|
-
BROWSED_ITEMS: {
|
|
137
|
-
HREF: string;
|
|
138
|
-
DEFAULT_HREF: string;
|
|
139
|
-
DEFAULT_LABEL: string;
|
|
140
|
-
};
|
|
141
|
-
PURCHASED_ITEMS: {
|
|
142
|
-
HREF: string;
|
|
143
|
-
DEFAULT_HREF: string;
|
|
144
|
-
DEFAULT_LABEL: string;
|
|
145
|
-
};
|
|
146
|
-
};
|
|
147
|
-
itemLink: {
|
|
148
|
-
CART_ITEMS: {
|
|
149
|
-
HREF: string;
|
|
150
|
-
DEFAULT_HREF: string;
|
|
151
|
-
};
|
|
152
|
-
BROWSED_ITEMS: {
|
|
153
|
-
HREF: string;
|
|
154
|
-
DEFAULT_HREF: string;
|
|
155
|
-
};
|
|
156
|
-
PURCHASED_ITEMS: {
|
|
157
|
-
HREF: string;
|
|
158
|
-
DEFAULT_HREF: string;
|
|
159
|
-
};
|
|
160
|
-
};
|
|
161
|
-
};
|
|
162
|
-
};
|
|
163
|
-
export declare const itemsBlockDynamicVariables: string[];
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
export declare const SETTINGS_ENUMS: {
|
|
2
|
-
ITEMS_TYPE: {
|
|
3
|
-
CART_ITEMS: string;
|
|
4
|
-
BROWSED_ITEMS: string;
|
|
5
|
-
PURCHASED_ITEMS: string;
|
|
6
|
-
};
|
|
7
|
-
ORIENTATION: {
|
|
8
|
-
VERTICAL: string;
|
|
9
|
-
HORIZONTAL: string;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
export declare const ItemTypeOptions: {
|
|
13
|
-
text: string;
|
|
14
|
-
value: string;
|
|
15
|
-
}[];
|
|
16
|
-
export declare const OrientationOptions: {
|
|
17
|
-
icon: string;
|
|
18
|
-
value: string;
|
|
19
|
-
}[];
|
|
20
|
-
export declare const DefaultConfigValues: {
|
|
21
|
-
itemsType: string;
|
|
22
|
-
isDataInitialized: string;
|
|
23
|
-
cartItemsSelectControlValue: string;
|
|
24
|
-
cardOrientationControlValue: string;
|
|
25
|
-
productNameTrimmingControlValue: string;
|
|
26
|
-
productPriceHideDiscountControlValue: string;
|
|
27
|
-
productPriceFormattedControlValue: string;
|
|
28
|
-
productPriceCurrencySymbolControlValue: string;
|
|
29
|
-
productPriceCurrencyLocationControlValue: string;
|
|
30
|
-
productButtonLinkControlValue: string;
|
|
31
|
-
productImageLinkControlValue: string;
|
|
32
|
-
productNameControlEnabled: string;
|
|
33
|
-
productQuantityControlOpened: string;
|
|
34
|
-
productNameControlTrim: string;
|
|
35
|
-
productQuantityControlEnabled: string;
|
|
36
|
-
productPriceControlOpened: string;
|
|
37
|
-
productImageVisible: string;
|
|
38
|
-
productNameVisible: string;
|
|
39
|
-
productQuantityVisible: string;
|
|
40
|
-
productPriceVisible: string;
|
|
41
|
-
productOriginalPriceVisible: string;
|
|
42
|
-
productButtonVisible: string;
|
|
43
|
-
productImageWidth: string;
|
|
44
|
-
};
|
|
45
|
-
export declare const ItemInCartOptions: {
|
|
46
|
-
[x: string]: {
|
|
47
|
-
text: string;
|
|
48
|
-
value: string;
|
|
49
|
-
}[];
|
|
50
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { OrientationType, ProductType } from '@@/Types/extensions/items';
|
|
2
|
-
interface ItemsBlockState {
|
|
3
|
-
itemsType: ProductType;
|
|
4
|
-
itemIds: string;
|
|
5
|
-
imageLink: string;
|
|
6
|
-
buttonLink: string;
|
|
7
|
-
orientation: OrientationType;
|
|
8
|
-
nameTrimming: boolean;
|
|
9
|
-
hideDiscount: boolean;
|
|
10
|
-
currencySymbol: string;
|
|
11
|
-
currencyLocation: string;
|
|
12
|
-
formattedPrice: boolean;
|
|
13
|
-
priceOrientation: 'vertical' | 'horizontal';
|
|
14
|
-
templateData: {
|
|
15
|
-
imageSrc: string;
|
|
16
|
-
name: string;
|
|
17
|
-
price: string;
|
|
18
|
-
originalPrice: string;
|
|
19
|
-
quantity: string;
|
|
20
|
-
button: string;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
export declare const useItemsBlockStore: import("pinia").StoreDefinition<"guidoItemsBlock", ItemsBlockState, {}, {
|
|
24
|
-
setItemsType(itemsType: ProductType): void;
|
|
25
|
-
setItemIds(itemIds: string): void;
|
|
26
|
-
setImageLink(imageLink: string): void;
|
|
27
|
-
setButtonLink(buttonLink: string): void;
|
|
28
|
-
setOrientation(orientation: OrientationType): void;
|
|
29
|
-
setNameTrimming(nameTrimming: boolean): void;
|
|
30
|
-
setHideDiscount(hideDiscount: boolean): void;
|
|
31
|
-
setCurrencySymbol(currencySymbol: string): void;
|
|
32
|
-
setCurrencyLocation(currencyLocation: string): void;
|
|
33
|
-
setFormattedPrice(formattedPrice: boolean): void;
|
|
34
|
-
setPriceOrientation(priceOrientation: "vertical" | "horizontal"): void;
|
|
35
|
-
setTemplateData(templateData: ItemsBlockState["templateData"]): void;
|
|
36
|
-
updateFromAttributes(attributes: {
|
|
37
|
-
itemsType?: string;
|
|
38
|
-
itemIds?: string;
|
|
39
|
-
orientation?: string;
|
|
40
|
-
}): void;
|
|
41
|
-
reset(): void;
|
|
42
|
-
}>;
|
|
43
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
declare const migrationTemplate = "ADD YOUR MIGRATION HERE";
|
|
2
|
-
type ProductType = 'CART_ITEMS' | 'BROWSED_ITEMS' | 'PURCHASED_ITEMS';
|
|
3
|
-
type OrientationType = 'vertical' | 'horizontal';
|
|
4
|
-
type TemplateParameters = {
|
|
5
|
-
orientation: OrientationType;
|
|
6
|
-
itemsType: ProductType;
|
|
7
|
-
itemId: string;
|
|
8
|
-
currencySymbol?: string;
|
|
9
|
-
currencyLocation?: string;
|
|
10
|
-
formattedPrice?: boolean;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Generates the default template for the Items Block.
|
|
14
|
-
* @param params - Template parameters including orientation, items type, item ID, and formatting options
|
|
15
|
-
* @param params.orientation - Layout orientation ('vertical' or 'horizontal')
|
|
16
|
-
* @param params.itemsType - Product data source type ('CART_ITEMS', 'BROWSED_ITEMS', or 'PURCHASED_ITEMS')
|
|
17
|
-
* @param params.itemId - The merge tag for the item (e.g., '{{Abandoned Cart Item (1) Url}}')
|
|
18
|
-
* @param params.currencySymbol - Currency symbol to display (e.g., 'USD')
|
|
19
|
-
* @param params.currencyLocation - Currency position ('0' for before, '1' for after)
|
|
20
|
-
* @param params.formattedPrice - Whether to use formatted price display
|
|
21
|
-
* @returns HTML template string for the Items Block
|
|
22
|
-
*/
|
|
23
|
-
export declare function getDefaultTemplate({ orientation, itemsType, itemId, currencySymbol, currencyLocation, formattedPrice, }: TemplateParameters): string;
|
|
24
|
-
export default migrationTemplate;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ImmutableHtmlElementNode, ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
2
|
-
/**
|
|
3
|
-
* Gets the esd-config-block element from the current node.
|
|
4
|
-
* Searches within the closest .items-block-v2 container.
|
|
5
|
-
* @param currentNode - The current node from the control (usually this.currentNode)
|
|
6
|
-
* @returns The config block element or null if not found
|
|
7
|
-
*/
|
|
8
|
-
export declare function getConfigBlock(currentNode: ImmutableHtmlNode | undefined): ImmutableHtmlElementNode | null;
|
|
9
|
-
/**
|
|
10
|
-
* Converts an attribute value to a boolean.
|
|
11
|
-
* Handles string values '1', 'true', and null/undefined cases.
|
|
12
|
-
* @param value - The attribute value (string or null)
|
|
13
|
-
* @param defaultValue - Default value to return if value is null/undefined (default: false)
|
|
14
|
-
* @returns The boolean value
|
|
15
|
-
*/
|
|
16
|
-
export declare function attributeToBoolean(value: string | null, defaultValue?: boolean): boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Gets a string attribute value with a default fallback.
|
|
19
|
-
* @param value - The attribute value (string or null)
|
|
20
|
-
* @param defaultValue - Default value to return if value is null/undefined (default: '')
|
|
21
|
-
* @returns The string value or default
|
|
22
|
-
*/
|
|
23
|
-
export declare function attributeToString(value: string | null, defaultValue?: string): string;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
2
|
-
import { configAttributes } from '../enums/productEnums';
|
|
3
|
-
type StoreSetter<T> = (value: T) => void;
|
|
4
|
-
interface SyncConfig<T> {
|
|
5
|
-
attributeName: keyof typeof configAttributes;
|
|
6
|
-
storeSetter: StoreSetter<T>;
|
|
7
|
-
converter: (value: string | null) => T;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Generic utility to sync an attribute value from esd-config-block to the store.
|
|
11
|
-
* This makes attribute values mutable by syncing them from the DOM.
|
|
12
|
-
* @param currentNode - The current node from the control (usually this.currentNode)
|
|
13
|
-
* @param config - Configuration object with attribute name, store setter, and value converter
|
|
14
|
-
*/
|
|
15
|
-
export declare function syncAttributeFromConfigBlock<T>(currentNode: ImmutableHtmlNode | undefined, config: SyncConfig<T>): void;
|
|
16
|
-
/**
|
|
17
|
-
* Helper to create a sync config for boolean attributes.
|
|
18
|
-
* @param attributeName - The attribute name from configAttributes
|
|
19
|
-
* @param storeSetter - The store setter function
|
|
20
|
-
* @param defaultValue - Default value if attribute is not set (default: false)
|
|
21
|
-
* @returns Sync configuration object
|
|
22
|
-
*/
|
|
23
|
-
export declare function createBooleanSyncConfig(attributeName: keyof typeof configAttributes, storeSetter: StoreSetter<boolean>, defaultValue?: boolean): SyncConfig<boolean>;
|
|
24
|
-
/**
|
|
25
|
-
* Helper to create a sync config for string attributes.
|
|
26
|
-
* @param attributeName - The attribute name from configAttributes
|
|
27
|
-
* @param storeSetter - The store setter function
|
|
28
|
-
* @param defaultValue - Default value if attribute is not set (default: '')
|
|
29
|
-
* @returns Sync configuration object
|
|
30
|
-
*/
|
|
31
|
-
export declare function createStringSyncConfig(attributeName: keyof typeof configAttributes, storeSetter: StoreSetter<string>, defaultValue?: string): SyncConfig<string>;
|
|
32
|
-
export {};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
2
|
-
/**
|
|
3
|
-
* Reads name trimming value from esd-config-block attribute and updates the store.
|
|
4
|
-
* This makes the trimming value mutable by syncing it from the DOM.
|
|
5
|
-
* @param currentNode - The current node from the control (usually this.currentNode)
|
|
6
|
-
*/
|
|
7
|
-
export declare function syncNameTrimmingFromAttributes(currentNode: ImmutableHtmlNode | undefined): void;
|
|
8
|
-
/**
|
|
9
|
-
* Reads hide discount value from esd-config-block attribute and updates the store.
|
|
10
|
-
* This makes the hide discount value mutable by syncing it from the DOM.
|
|
11
|
-
* @param currentNode - The current node from the control (usually this.currentNode)
|
|
12
|
-
*/
|
|
13
|
-
export declare function syncHideDiscountFromAttributes(currentNode: ImmutableHtmlNode | undefined): void;
|
|
14
|
-
/**
|
|
15
|
-
* Reads formatted price value from esd-config-block attribute and updates the store.
|
|
16
|
-
* This makes the formatted price value mutable by syncing it from the DOM.
|
|
17
|
-
* Defaults to true if not set, since formatted is the default.
|
|
18
|
-
* @param currentNode - The current node from the control (usually this.currentNode)
|
|
19
|
-
*/
|
|
20
|
-
export declare function syncFormattedPriceFromAttributes(currentNode: ImmutableHtmlNode | undefined): void;
|
|
21
|
-
/**
|
|
22
|
-
* Reads currency symbol value from esd-config-block attribute and updates the store.
|
|
23
|
-
* This makes the currency symbol value mutable by syncing it from the DOM.
|
|
24
|
-
* @param currentNode - The current node from the control (usually this.currentNode)
|
|
25
|
-
*/
|
|
26
|
-
export declare function syncCurrencySymbolFromAttributes(currentNode: ImmutableHtmlNode | undefined): void;
|
|
27
|
-
/**
|
|
28
|
-
* Reads currency location value from esd-config-block attribute and updates the store.
|
|
29
|
-
* This makes the currency location value mutable by syncing it from the DOM.
|
|
30
|
-
* @param currentNode - The current node from the control (usually this.currentNode)
|
|
31
|
-
*/
|
|
32
|
-
export declare function syncCurrencyLocationFromAttributes(currentNode: ImmutableHtmlNode | undefined): void;
|
|
33
|
-
/**
|
|
34
|
-
* Reads button link value from esd-config-block attribute and updates the store.
|
|
35
|
-
* This makes the button link value mutable by syncing it from the DOM.
|
|
36
|
-
* @param currentNode - The current node from the control (usually this.currentNode)
|
|
37
|
-
*/
|
|
38
|
-
export declare function syncButtonLinkFromAttributes(currentNode: ImmutableHtmlNode | undefined): void;
|
|
39
|
-
/**
|
|
40
|
-
* Reads image link value from esd-config-block attribute and updates the store.
|
|
41
|
-
* This makes the image link value mutable by syncing it from the DOM.
|
|
42
|
-
* @param currentNode - The current node from the control (usually this.currentNode)
|
|
43
|
-
*/
|
|
44
|
-
export declare function syncImageLinkFromAttributes(currentNode: ImmutableHtmlNode | undefined): void;
|
|
45
|
-
/**
|
|
46
|
-
* Reads price orientation value from esd-config-block attribute and updates the store.
|
|
47
|
-
* This makes the price orientation value mutable by syncing it from the DOM.
|
|
48
|
-
* @param currentNode - The current node from the control (usually this.currentNode)
|
|
49
|
-
*/
|
|
50
|
-
export declare function syncPriceOrientationFromAttributes(currentNode: ImmutableHtmlNode | undefined): void;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ImmutableHtmlNode, ControlApi } from '@stripoinc/ui-editor-extensions';
|
|
2
|
-
/**
|
|
3
|
-
* Updates attributes on the esd-config-block element based on current store state.
|
|
4
|
-
* This utility can be called from controls whenever they change values that affect attributes.
|
|
5
|
-
* @param currentNode - The current node from the control (usually this.currentNode)
|
|
6
|
-
* @param api - The API object from the control (usually this.api)
|
|
7
|
-
*/
|
|
8
|
-
export declare function updateConfigBlockAttributes(currentNode: ImmutableHtmlNode | undefined, api: ControlApi): void;
|
|
@@ -1,16 +0,0 @@
|
|
|
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;
|
|
@@ -1,44 +0,0 @@
|
|
|
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;
|