@useinsider/guido 3.24.0-beta.82c2d5e → 3.24.0-beta.8779b29
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 +1 -9
- package/dist/@types/config/schemas.js +14 -14
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +88 -90
- package/dist/composables/useModuleRepair.js +23 -30
- package/dist/config/migrator/index.js +16 -16
- package/dist/config/migrator/itemsPriceFormatMigrator.js +20 -0
- package/dist/enums/academy.js +1 -2
- package/dist/extensions/Blocks/Items/block.js +115 -77
- package/dist/extensions/Blocks/Items/constants/currency.js +59 -14
- package/dist/extensions/Blocks/Items/controls/blockBackground/index.js +11 -0
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +34 -23
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +62 -51
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +18 -17
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +42 -31
- package/dist/extensions/Blocks/Items/controls/priceFormat.js +135 -0
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +141 -120
- package/dist/extensions/Blocks/Items/enums/controlEnums.js +2 -2
- package/dist/extensions/Blocks/Items/extension.js +15 -13
- package/dist/extensions/Blocks/Items/items.css.js +19 -0
- package/dist/extensions/Blocks/Items/settingsPanel.js +38 -25
- package/dist/extensions/Blocks/Items/template.js +250 -212
- package/dist/extensions/Blocks/Items/utils/priceFormatOps.js +185 -0
- package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +1 -0
- package/dist/extensions/Blocks/controlFactories.js +104 -104
- package/dist/guido.css +1 -1
- package/dist/package.json.js +2 -2
- package/dist/src/@types/config/schemas.d.ts +4 -4
- package/dist/src/composables/useConfig.d.ts +2 -2
- package/dist/src/composables/useModuleRepair.d.ts +11 -2
- package/dist/src/config/migrator/index.d.ts +4 -1
- package/dist/src/config/migrator/itemsPriceFormatMigrator.d.ts +1 -0
- package/dist/src/enums/academy.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/block.d.ts +6 -9
- package/dist/src/extensions/Blocks/Items/constants/currency.d.ts +32 -0
- package/dist/src/extensions/Blocks/Items/controls/blockBackground/index.d.ts +15 -0
- package/dist/src/extensions/Blocks/Items/controls/priceFormat.d.ts +24 -0
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +2 -0
- package/dist/src/extensions/Blocks/Items/template.d.ts +4 -1
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +3 -0
- package/dist/src/extensions/Blocks/Items/utils/priceFormatOps.d.ts +66 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/priceFormatter.d.ts +12 -0
- package/dist/src/extensions/Blocks/controlFactories.d.ts +1 -1
- package/dist/src/stores/config.d.ts +20 -20
- package/dist/src/stores/editor.d.ts +0 -27
- package/dist/src/utils/itemsCurrencyRepair.d.ts +5 -1
- package/dist/stores/editor.js +0 -1
- package/dist/utils/itemsCurrencyRepair.js +29 -24
- package/dist/utils/pairProductVariables.js +119 -99
- package/package.json +1 -1
- package/dist/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js +0 -17
- package/dist/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue2.js +0 -30
- package/dist/config/migrator/legacyUnsubscribeTextMigrator.js +0 -16
- package/dist/src/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.d.ts +0 -2
- package/dist/src/config/migrator/legacyUnsubscribeTextMigrator.d.ts +0 -1
- package/dist/src/utils/legacyUnsubscribeConversion.d.ts +0 -10
- package/dist/utils/legacyUnsubscribeConversion.js +0 -49
|
@@ -415,8 +415,8 @@ export declare const FeaturesSchema: v.ObjectSchema<{
|
|
|
415
415
|
/** Allow persisting a template that still has validation errors (drawer "Save and Continue" soft-save). Host sets false for transactional + unsubscribe. */
|
|
416
416
|
readonly allowSaveWithErrors: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
417
417
|
readonly reusableRecommendationStrategy: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
418
|
-
/**
|
|
419
|
-
readonly
|
|
418
|
+
/** Items block: Recommendation-style price formatting (root currency-* attrs, raw price tags). Released dark. */
|
|
419
|
+
readonly itemsPriceFormatting: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
420
420
|
}, undefined>;
|
|
421
421
|
/**
|
|
422
422
|
* Default block types available in Stripo
|
|
@@ -836,8 +836,8 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
836
836
|
/** Allow persisting a template that still has validation errors (drawer "Save and Continue" soft-save). Host sets false for transactional + unsubscribe. */
|
|
837
837
|
readonly allowSaveWithErrors: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
838
838
|
readonly reusableRecommendationStrategy: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
839
|
-
/**
|
|
840
|
-
readonly
|
|
839
|
+
/** Items block: Recommendation-style price formatting (root currency-* attrs, raw price tags). Released dark. */
|
|
840
|
+
readonly itemsPriceFormatting: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
841
841
|
}, undefined>, {}>;
|
|
842
842
|
/** Block configuration */
|
|
843
843
|
readonly blocks: v.OptionalSchema<v.ObjectSchema<{
|
|
@@ -105,7 +105,7 @@ export declare const useConfig: () => {
|
|
|
105
105
|
linkTrackingIds: boolean;
|
|
106
106
|
allowSaveWithErrors: boolean;
|
|
107
107
|
reusableRecommendationStrategy: boolean;
|
|
108
|
-
|
|
108
|
+
itemsPriceFormatting: boolean;
|
|
109
109
|
};
|
|
110
110
|
blocks: {
|
|
111
111
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -246,7 +246,7 @@ export declare const useConfig: () => {
|
|
|
246
246
|
linkTrackingIds: boolean;
|
|
247
247
|
allowSaveWithErrors: boolean;
|
|
248
248
|
reusableRecommendationStrategy: boolean;
|
|
249
|
-
|
|
249
|
+
itemsPriceFormatting: boolean;
|
|
250
250
|
} | null>;
|
|
251
251
|
blocks: import("vue").ComputedRef<{
|
|
252
252
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import type { ModuleAddData, ModuleModifier } from '@@/Types/stripo';
|
|
2
2
|
export declare const UNRESOLVED_DYNAMIC_CONTENT_ON_DROP_KEY = "dynamic-content.unresolved-attributes-on-drop";
|
|
3
3
|
/**
|
|
4
|
-
* Repairs
|
|
5
|
-
*
|
|
4
|
+
* Repairs saved modules as they are dropped or copied into the editor, in one pass
|
|
5
|
+
* over the module HTML. Two independent repairs run through a single write-back:
|
|
6
|
+
*
|
|
7
|
+
* - Dynamic content: saved modules serialize merge-tag chips by their display label
|
|
8
|
+
* (`{{ Phone Number }}`); this maps them back to their canonical token
|
|
9
|
+
* (`{{phone_number}}`) using the account's dynamic-content list.
|
|
10
|
+
* - Items currency: v2 Items blocks can carry price `data-curency` /
|
|
11
|
+
* `data-currency_symbol` attrs that drifted from their `esd-ext-config`; these are
|
|
12
|
+
* healed from config (the export contract reads those exact attrs).
|
|
13
|
+
*
|
|
14
|
+
* Wired into Stripo via the `onModuleAdd` init callback (see `useStripo`).
|
|
6
15
|
*/
|
|
7
16
|
export declare const useModuleRepair: () => {
|
|
8
17
|
handleModuleAdd: (data: ModuleAddData, modifier: ModuleModifier) => void;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import type { LegacyRecommendationConfig } from '@@/Types/config';
|
|
2
2
|
import { type PartnerScopeMigrationOptions } from './recommendationPartnerMigrator';
|
|
3
|
-
export
|
|
3
|
+
export interface MigrationFeatureFlags {
|
|
4
|
+
itemsPriceFormatting?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const migrate: (html: string, recommendationConfigs?: Record<string, LegacyRecommendationConfig>, partnerScope?: PartnerScopeMigrationOptions, features?: MigrationFeatureFlags) => Promise<string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function migrateItemsPriceFormat(html: string): string;
|
|
@@ -9,6 +9,5 @@ export declare const ACADEMY_LINKS: {
|
|
|
9
9
|
readonly GLOBAL_UNSUBSCRIBE: "https://academy.insiderone.com/docs/global-unsubscribe-preference-center";
|
|
10
10
|
readonly AMP_FOR_EMAILS: "https://academy.insiderone.com/docs/amp-for-emails";
|
|
11
11
|
readonly EMAIL_RECOMMENDATION_BLOCK: "https://academy.insiderone.com/docs/new-editor-email-recommendation-block";
|
|
12
|
-
readonly LEGACY_UNSUBSCRIBE_MODULE: "https://academy.insiderone.com/docs/new-editor-add-unsubscribe-pages-into-emails";
|
|
13
12
|
};
|
|
14
13
|
export type AcademyLinkKey = keyof typeof ACADEMY_LINKS;
|
|
@@ -71,15 +71,12 @@ export declare class ItemsBlock extends Block {
|
|
|
71
71
|
*/
|
|
72
72
|
private _resolveInstanceId;
|
|
73
73
|
/**
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
* Config is the source of truth — never derive from visible text.
|
|
77
|
-
*
|
|
78
|
-
* Authority split lives in `currencyAttrTargets` (SD-147588) — position only when a location
|
|
79
|
-
* is recorded, symbol only when customized — so this heal and the module-drop repair can't drift.
|
|
80
|
-
*
|
|
81
|
-
* Returns true only when an attr actually changed, so the caller can skip an empty apply that
|
|
82
|
-
* would otherwise re-trigger onDocumentChanged and loop.
|
|
74
|
+
* Single self-heal slot: the flag only decides whether a legacy root is converted; a root
|
|
75
|
+
* already in the new format is reconciled from config regardless. Returns whether anything was queued.
|
|
83
76
|
*/
|
|
84
77
|
private _reconcileCurrencyDomAttributes;
|
|
78
|
+
/** Legacy `<p>` contract via `currencyAttrTargets`: position when recorded, symbol only when custom. */
|
|
79
|
+
private _reconcileLegacyCurrencyAttributes;
|
|
80
|
+
private _priceParagraphs;
|
|
81
|
+
private _isPriceFormattingEnabled;
|
|
85
82
|
}
|
|
@@ -41,3 +41,35 @@ export declare function currencyAttrTargets(config: {
|
|
|
41
41
|
priceCurrencyLocation?: string;
|
|
42
42
|
priceCurrencySymbol?: string;
|
|
43
43
|
}): CurrencyAttrTargets;
|
|
44
|
+
export declare const ITEMS_PRICE_FORMAT_ATTR: {
|
|
45
|
+
readonly SYMBOL: "currency-symbol";
|
|
46
|
+
readonly ALIGNMENT: "currency-alignment";
|
|
47
|
+
readonly THOUSAND_SEPARATOR: "currency-thousand-separator";
|
|
48
|
+
readonly DECIMAL_SEPARATOR: "currency-decimal-separator";
|
|
49
|
+
readonly DECIMAL_COUNT: "currency-decimal-count";
|
|
50
|
+
readonly SINGLE_PRICE: "data-single_price";
|
|
51
|
+
};
|
|
52
|
+
/** Price `<p>` attrs of the legacy model; a new-format block carries none of them. */
|
|
53
|
+
export declare const LEGACY_PRICE_PARAGRAPH_ATTRS: readonly ["data-formated", "data-single_price", "data-curency", "data-currency_symbol"];
|
|
54
|
+
export declare const PRICE_FORMAT_CONFIG_KEYS: readonly ["priceThousandSeparator", "priceDecimalSeparator", "priceDecimalCount"];
|
|
55
|
+
export interface ItemsPriceFormat {
|
|
56
|
+
thousandSeparator: string;
|
|
57
|
+
decimalSeparator: string;
|
|
58
|
+
decimalCount: number;
|
|
59
|
+
}
|
|
60
|
+
/** en-US, the shape the legacy pre-formatted price tags produced. */
|
|
61
|
+
export declare const DEFAULT_ITEMS_PRICE_FORMAT: ItemsPriceFormat;
|
|
62
|
+
export interface PriceFormatConfigSlice {
|
|
63
|
+
priceThousandSeparator?: string;
|
|
64
|
+
priceDecimalSeparator?: string;
|
|
65
|
+
priceDecimalCount?: number;
|
|
66
|
+
}
|
|
67
|
+
export declare function normalizeDecimalCount(value: unknown): number;
|
|
68
|
+
/** Config → format, defaulting each missing key independently. */
|
|
69
|
+
export declare function priceFormatFromConfig(config: PriceFormatConfigSlice | null | undefined): ItemsPriceFormat;
|
|
70
|
+
export declare function isNewPriceFormatConfig(config: PriceFormatConfigSlice | null | undefined): boolean;
|
|
71
|
+
export interface AttributeReader {
|
|
72
|
+
getAttribute(name: string): string | null | undefined;
|
|
73
|
+
}
|
|
74
|
+
/** The export/control switch: a root carrying `currency-decimal-count` is in the new format. */
|
|
75
|
+
export declare function isNewPriceFormatRoot(root: AttributeReader | null | undefined): boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const ItemsBlockBackgroundControl: {
|
|
2
|
+
new (): {
|
|
3
|
+
getId(): string;
|
|
4
|
+
getLabels(): {
|
|
5
|
+
title: string;
|
|
6
|
+
};
|
|
7
|
+
getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
|
|
8
|
+
getAdditionalModifications(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
9
|
+
getParentControlId(): string;
|
|
10
|
+
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
11
|
+
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
12
|
+
isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
|
|
13
|
+
getElementLockCategory(): import("@stripoinc/ui-editor-extensions").ElementLockCategory | undefined;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ControlApi, ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
2
|
+
import { CommonControl } from '../../common-control';
|
|
3
|
+
import { ItemsBlockControlId } from '../enums/controlEnums';
|
|
4
|
+
import { type ItemsBlockConfig } from '../utils/nodeConfigUtils';
|
|
5
|
+
export declare const CONTROL_BLOCK_ID = ItemsBlockControlId.PRICE_FORMAT;
|
|
6
|
+
export declare function isNewPriceFormatBlock(currentNode: ImmutableHtmlNode | undefined): boolean;
|
|
7
|
+
/** One apply: the config patch, the root attrs the export reads, and both price texts re-rendered. */
|
|
8
|
+
export declare function applyPriceFormatChange(currentNode: ImmutableHtmlNode | undefined, api: ControlApi, patch: Partial<ItemsBlockConfig>, description: string): void;
|
|
9
|
+
export declare class ItemsBlockPriceFormatControl extends CommonControl {
|
|
10
|
+
private lastWritten;
|
|
11
|
+
getId(): string;
|
|
12
|
+
getTemplate(): string;
|
|
13
|
+
onRender(): void;
|
|
14
|
+
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
15
|
+
onDestroy(): void;
|
|
16
|
+
_onThousandSeparatorChange(value: string): void;
|
|
17
|
+
_onDecimalSeparatorChange(value: string): void;
|
|
18
|
+
_onDecimalCountChange(value: string): void;
|
|
19
|
+
private _currentFormat;
|
|
20
|
+
private _write;
|
|
21
|
+
private _setSelectItems;
|
|
22
|
+
private _formValues;
|
|
23
|
+
private _getSelectRow;
|
|
24
|
+
}
|
|
@@ -35,6 +35,7 @@ export declare class ItemsBlockControl extends CommonControl {
|
|
|
35
35
|
_reFillTemplate(itemsType?: ProductType): void;
|
|
36
36
|
_recalculateTrimming(): void;
|
|
37
37
|
private _getParagraphFromBlock;
|
|
38
|
+
private _replacePriceText;
|
|
38
39
|
private _escapeRegex;
|
|
39
40
|
private _removeCurrencySymbol;
|
|
40
41
|
private _replacePriceNumber;
|
|
@@ -46,6 +46,8 @@ export declare enum ItemsBlockControlId {
|
|
|
46
46
|
PRICE_CURRENCY_SYMBOL = "items-block-price-currency-symbol-control",
|
|
47
47
|
PRICE_CURRENCY_LOCATION = "items-block-price-currency-location-control",
|
|
48
48
|
PRICE_ORIENTATION = "items-block-price-orientation-control",
|
|
49
|
+
PRICE_FORMAT = "items-block-price-format-control",
|
|
50
|
+
BLOCK_BACKGROUND = "items-block-background-color-control",
|
|
49
51
|
NAME_ALIGN = "items-block-name-align-control",
|
|
50
52
|
NAME_COLOR = "items-block-name-color-control",
|
|
51
53
|
NAME_SIZE = "items-block-name-size-control",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ItemsPriceFormat } from './constants/currency';
|
|
1
2
|
import { type ItemsBlockConfig } from './utils/nodeConfigUtils';
|
|
2
3
|
declare const migrationTemplate = "ADD YOUR MIGRATION HERE";
|
|
3
4
|
type ProductType = 'CART_ITEMS' | 'BROWSED_ITEMS' | 'PURCHASED_ITEMS';
|
|
@@ -36,6 +37,8 @@ type TemplateParameters = {
|
|
|
36
37
|
quantityStyles?: string;
|
|
37
38
|
/** Price orientation within the card ('vertical' = stacked, 'horizontal' = side-by-side) */
|
|
38
39
|
priceOrientation?: PriceOrientationType;
|
|
40
|
+
/** New price model (itemsPriceFormatting): root attrs + raw dummy amounts; absent = legacy output. */
|
|
41
|
+
priceFormat?: ItemsPriceFormat;
|
|
39
42
|
};
|
|
40
43
|
/**
|
|
41
44
|
* Applies price orientation styles to the generated HTML template.
|
|
@@ -67,5 +70,5 @@ export declare const applyPriceOrientationStyles: (html: string, layoutOrientati
|
|
|
67
70
|
* @param params.formattedPrice - Whether to use formatted price display
|
|
68
71
|
* @returns HTML template string for the Items Block
|
|
69
72
|
*/
|
|
70
|
-
export declare function getDefaultTemplate({ orientation, itemsType, itemId, currencySymbol, currencyLocation, migrate, formattedPrice, configBlockAttributes, nodeConfig, nameStyles, buttonStyles, priceStyles, originalPriceStyles, quantityStyles, priceOrientation, }: TemplateParameters): string;
|
|
73
|
+
export declare function getDefaultTemplate({ orientation, itemsType, itemId, currencySymbol, currencyLocation, migrate, formattedPrice, configBlockAttributes, nodeConfig, nameStyles, buttonStyles, priceStyles, originalPriceStyles, quantityStyles, priceOrientation, priceFormat, }: TemplateParameters): string;
|
|
71
74
|
export default migrationTemplate;
|
|
@@ -18,6 +18,9 @@ export interface ItemsBlockConfig {
|
|
|
18
18
|
priceCurrencySymbol: string;
|
|
19
19
|
priceCurrencyLocation: string;
|
|
20
20
|
priceOrientation: 'vertical' | 'horizontal';
|
|
21
|
+
priceThousandSeparator?: string;
|
|
22
|
+
priceDecimalSeparator?: string;
|
|
23
|
+
priceDecimalCount?: number;
|
|
21
24
|
quantityControlEnabled: boolean;
|
|
22
25
|
buttonLink: string;
|
|
23
26
|
imageLink: string;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type ItemsPriceFormat } from '../constants/currency';
|
|
2
|
+
import { type ItemsBlockConfig } from './nodeConfigUtils';
|
|
3
|
+
export type PriceParagraphKind = 'price' | 'originalPrice';
|
|
4
|
+
export declare const PRICE_PARAGRAPH_SELECTOR = "p[product-attr=\"price\"], p[product-attr=\"originalPrice\"]";
|
|
5
|
+
type AttrMap = Record<string, string | null | undefined>;
|
|
6
|
+
export interface PriceParagraphSnapshot {
|
|
7
|
+
kind: PriceParagraphKind;
|
|
8
|
+
attrs: AttrMap;
|
|
9
|
+
text: string;
|
|
10
|
+
}
|
|
11
|
+
export interface PriceFormatSnapshot {
|
|
12
|
+
rootAttrs: AttrMap;
|
|
13
|
+
paragraphs: PriceParagraphSnapshot[];
|
|
14
|
+
config: Partial<ItemsBlockConfig> | null;
|
|
15
|
+
}
|
|
16
|
+
export interface PriceTexts {
|
|
17
|
+
price: string;
|
|
18
|
+
originalPrice: string;
|
|
19
|
+
}
|
|
20
|
+
export interface PriceFormatOps {
|
|
21
|
+
rootSet: Record<string, string>;
|
|
22
|
+
paragraphRemove: string[];
|
|
23
|
+
configPatch: Partial<ItemsBlockConfig> | null;
|
|
24
|
+
texts: PriceTexts | null;
|
|
25
|
+
changed: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface PlanPriceFormatOptions {
|
|
28
|
+
convertLegacy: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface FormatDummyPriceInput {
|
|
31
|
+
amount: string | number;
|
|
32
|
+
format: ItemsPriceFormat;
|
|
33
|
+
symbol: string | null | undefined;
|
|
34
|
+
alignment: string | null | undefined;
|
|
35
|
+
}
|
|
36
|
+
export declare function paragraphKindOf(productAttr: string | null | undefined): PriceParagraphKind | null;
|
|
37
|
+
export declare function resolvePriceDummyAmounts(config: Pick<Partial<ItemsBlockConfig>, 'type' | 'priceSinglePrice'> | null | undefined): PriceTexts;
|
|
38
|
+
export declare function formatItemsDummyPrice({ amount, format, symbol, alignment }: FormatDummyPriceInput): string;
|
|
39
|
+
export declare function priceTextsFromConfig(config: Partial<ItemsBlockConfig> | null | undefined): PriceTexts;
|
|
40
|
+
/** `text` is decoded DOM text, `html` the rendered markup text (entities allowed). */
|
|
41
|
+
export declare function samePriceText(text: string | null | undefined, html: string | null | undefined): boolean;
|
|
42
|
+
/** Swaps the whole price text inside the paragraph markup, keeping the style wrappers around it. */
|
|
43
|
+
export declare function replacePriceText(innerHtml: string, currentText: string, newText: string): string;
|
|
44
|
+
export declare function planPriceFormatOps(snapshot: PriceFormatSnapshot, options: {
|
|
45
|
+
convertLegacy: true;
|
|
46
|
+
}): PriceFormatOps & {
|
|
47
|
+
texts: PriceTexts;
|
|
48
|
+
};
|
|
49
|
+
export declare function planPriceFormatOps(snapshot: PriceFormatSnapshot, options: PlanPriceFormatOptions): PriceFormatOps;
|
|
50
|
+
export interface PriceParagraphSource {
|
|
51
|
+
kind: PriceParagraphKind;
|
|
52
|
+
attr(name: string): string | null | undefined;
|
|
53
|
+
text: string;
|
|
54
|
+
}
|
|
55
|
+
export interface PriceFormatSnapshotSource {
|
|
56
|
+
rootAttr(name: string): string | null | undefined;
|
|
57
|
+
paragraphs: PriceParagraphSource[];
|
|
58
|
+
config: Partial<ItemsBlockConfig> | null;
|
|
59
|
+
}
|
|
60
|
+
/** Shared snapshot builder so DOM (migrator, repair) and Stripo-node callers read the same attrs. */
|
|
61
|
+
export declare function buildPriceFormatSnapshot(source: PriceFormatSnapshotSource): PriceFormatSnapshot;
|
|
62
|
+
export declare function readPersistedConfigAttribute(root: Element): Partial<ItemsBlockConfig> | null;
|
|
63
|
+
export declare function snapshotPriceFormatFromElement(root: Element): PriceFormatSnapshot;
|
|
64
|
+
/** DOM applier for parsed HTML (migrator, module repair). Returns whether anything was written. */
|
|
65
|
+
export declare function applyPriceFormatOpsToElement(root: Element, ops: PriceFormatOps): boolean;
|
|
66
|
+
export {};
|
|
@@ -14,6 +14,18 @@ export interface FormatPriceOptions {
|
|
|
14
14
|
/** Currency configuration */
|
|
15
15
|
currency: CurrencyConfig;
|
|
16
16
|
}
|
|
17
|
+
export interface FormatNumberOptions {
|
|
18
|
+
thousandSeparator: string;
|
|
19
|
+
decimalSeparator: string;
|
|
20
|
+
decimalCount: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Formats a number with custom thousand and decimal separators
|
|
24
|
+
* @param value - The numeric value to format
|
|
25
|
+
* @param options - Formatting options
|
|
26
|
+
* @returns Formatted number string
|
|
27
|
+
*/
|
|
28
|
+
export declare function formatNumber(value: number, options: FormatNumberOptions): string;
|
|
17
29
|
/**
|
|
18
30
|
* Formats a numeric price according to currency settings
|
|
19
31
|
* @example
|
|
@@ -135,7 +135,7 @@ export declare function createTextBackgroundColorControl(controlId: string, targ
|
|
|
135
135
|
* next edit. We write inline `background-color` + `bgcolor` on the block `<td>` instead — surviving
|
|
136
136
|
* regeneration and reaching Outlook, matching the migrator's convention.
|
|
137
137
|
*/
|
|
138
|
-
export declare function createBlockBackgroundColorControl(controlId: string, blockRootSelector?: string): {
|
|
138
|
+
export declare function createBlockBackgroundColorControl(controlId: string, blockRootSelector?: string, title?: string): {
|
|
139
139
|
new (): {
|
|
140
140
|
getId(): string;
|
|
141
141
|
/** The parent control renders its own generic title; restore the block-level wording. */
|
|
@@ -110,7 +110,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
110
110
|
linkTrackingIds: boolean;
|
|
111
111
|
allowSaveWithErrors: boolean;
|
|
112
112
|
reusableRecommendationStrategy: boolean;
|
|
113
|
-
|
|
113
|
+
itemsPriceFormatting: boolean;
|
|
114
114
|
};
|
|
115
115
|
blocks: {
|
|
116
116
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -257,7 +257,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
257
257
|
linkTrackingIds: boolean;
|
|
258
258
|
allowSaveWithErrors: boolean;
|
|
259
259
|
reusableRecommendationStrategy: boolean;
|
|
260
|
-
|
|
260
|
+
itemsPriceFormatting: boolean;
|
|
261
261
|
};
|
|
262
262
|
blocks: {
|
|
263
263
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -404,7 +404,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
404
404
|
linkTrackingIds: boolean;
|
|
405
405
|
allowSaveWithErrors: boolean;
|
|
406
406
|
reusableRecommendationStrategy: boolean;
|
|
407
|
-
|
|
407
|
+
itemsPriceFormatting: boolean;
|
|
408
408
|
};
|
|
409
409
|
blocks: {
|
|
410
410
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -551,7 +551,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
551
551
|
linkTrackingIds: boolean;
|
|
552
552
|
allowSaveWithErrors: boolean;
|
|
553
553
|
reusableRecommendationStrategy: boolean;
|
|
554
|
-
|
|
554
|
+
itemsPriceFormatting: boolean;
|
|
555
555
|
};
|
|
556
556
|
blocks: {
|
|
557
557
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -698,7 +698,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
698
698
|
linkTrackingIds: boolean;
|
|
699
699
|
allowSaveWithErrors: boolean;
|
|
700
700
|
reusableRecommendationStrategy: boolean;
|
|
701
|
-
|
|
701
|
+
itemsPriceFormatting: boolean;
|
|
702
702
|
};
|
|
703
703
|
blocks: {
|
|
704
704
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -845,7 +845,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
845
845
|
linkTrackingIds: boolean;
|
|
846
846
|
allowSaveWithErrors: boolean;
|
|
847
847
|
reusableRecommendationStrategy: boolean;
|
|
848
|
-
|
|
848
|
+
itemsPriceFormatting: boolean;
|
|
849
849
|
};
|
|
850
850
|
blocks: {
|
|
851
851
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -992,7 +992,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
992
992
|
linkTrackingIds: boolean;
|
|
993
993
|
allowSaveWithErrors: boolean;
|
|
994
994
|
reusableRecommendationStrategy: boolean;
|
|
995
|
-
|
|
995
|
+
itemsPriceFormatting: boolean;
|
|
996
996
|
};
|
|
997
997
|
blocks: {
|
|
998
998
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1139,7 +1139,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1139
1139
|
linkTrackingIds: boolean;
|
|
1140
1140
|
allowSaveWithErrors: boolean;
|
|
1141
1141
|
reusableRecommendationStrategy: boolean;
|
|
1142
|
-
|
|
1142
|
+
itemsPriceFormatting: boolean;
|
|
1143
1143
|
};
|
|
1144
1144
|
blocks: {
|
|
1145
1145
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1286,7 +1286,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1286
1286
|
linkTrackingIds: boolean;
|
|
1287
1287
|
allowSaveWithErrors: boolean;
|
|
1288
1288
|
reusableRecommendationStrategy: boolean;
|
|
1289
|
-
|
|
1289
|
+
itemsPriceFormatting: boolean;
|
|
1290
1290
|
};
|
|
1291
1291
|
blocks: {
|
|
1292
1292
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1433,7 +1433,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1433
1433
|
linkTrackingIds: boolean;
|
|
1434
1434
|
allowSaveWithErrors: boolean;
|
|
1435
1435
|
reusableRecommendationStrategy: boolean;
|
|
1436
|
-
|
|
1436
|
+
itemsPriceFormatting: boolean;
|
|
1437
1437
|
};
|
|
1438
1438
|
blocks: {
|
|
1439
1439
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1580,7 +1580,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1580
1580
|
linkTrackingIds: boolean;
|
|
1581
1581
|
allowSaveWithErrors: boolean;
|
|
1582
1582
|
reusableRecommendationStrategy: boolean;
|
|
1583
|
-
|
|
1583
|
+
itemsPriceFormatting: boolean;
|
|
1584
1584
|
};
|
|
1585
1585
|
blocks: {
|
|
1586
1586
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1727,7 +1727,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1727
1727
|
linkTrackingIds: boolean;
|
|
1728
1728
|
allowSaveWithErrors: boolean;
|
|
1729
1729
|
reusableRecommendationStrategy: boolean;
|
|
1730
|
-
|
|
1730
|
+
itemsPriceFormatting: boolean;
|
|
1731
1731
|
};
|
|
1732
1732
|
blocks: {
|
|
1733
1733
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1874,7 +1874,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1874
1874
|
linkTrackingIds: boolean;
|
|
1875
1875
|
allowSaveWithErrors: boolean;
|
|
1876
1876
|
reusableRecommendationStrategy: boolean;
|
|
1877
|
-
|
|
1877
|
+
itemsPriceFormatting: boolean;
|
|
1878
1878
|
};
|
|
1879
1879
|
blocks: {
|
|
1880
1880
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -2021,7 +2021,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2021
2021
|
linkTrackingIds: boolean;
|
|
2022
2022
|
allowSaveWithErrors: boolean;
|
|
2023
2023
|
reusableRecommendationStrategy: boolean;
|
|
2024
|
-
|
|
2024
|
+
itemsPriceFormatting: boolean;
|
|
2025
2025
|
};
|
|
2026
2026
|
blocks: {
|
|
2027
2027
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -2168,7 +2168,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2168
2168
|
linkTrackingIds: boolean;
|
|
2169
2169
|
allowSaveWithErrors: boolean;
|
|
2170
2170
|
reusableRecommendationStrategy: boolean;
|
|
2171
|
-
|
|
2171
|
+
itemsPriceFormatting: boolean;
|
|
2172
2172
|
};
|
|
2173
2173
|
blocks: {
|
|
2174
2174
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -2315,7 +2315,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2315
2315
|
linkTrackingIds: boolean;
|
|
2316
2316
|
allowSaveWithErrors: boolean;
|
|
2317
2317
|
reusableRecommendationStrategy: boolean;
|
|
2318
|
-
|
|
2318
|
+
itemsPriceFormatting: boolean;
|
|
2319
2319
|
};
|
|
2320
2320
|
blocks: {
|
|
2321
2321
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -2462,7 +2462,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2462
2462
|
linkTrackingIds: boolean;
|
|
2463
2463
|
allowSaveWithErrors: boolean;
|
|
2464
2464
|
reusableRecommendationStrategy: boolean;
|
|
2465
|
-
|
|
2465
|
+
itemsPriceFormatting: boolean;
|
|
2466
2466
|
};
|
|
2467
2467
|
blocks: {
|
|
2468
2468
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -2621,7 +2621,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2621
2621
|
linkTrackingIds: boolean;
|
|
2622
2622
|
allowSaveWithErrors: boolean;
|
|
2623
2623
|
reusableRecommendationStrategy: boolean;
|
|
2624
|
-
|
|
2624
|
+
itemsPriceFormatting: boolean;
|
|
2625
2625
|
};
|
|
2626
2626
|
blocks: {
|
|
2627
2627
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -2768,7 +2768,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2768
2768
|
linkTrackingIds: boolean;
|
|
2769
2769
|
allowSaveWithErrors: boolean;
|
|
2770
2770
|
reusableRecommendationStrategy: boolean;
|
|
2771
|
-
|
|
2771
|
+
itemsPriceFormatting: boolean;
|
|
2772
2772
|
};
|
|
2773
2773
|
blocks: {
|
|
2774
2774
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -2917,7 +2917,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2917
2917
|
linkTrackingIds: boolean;
|
|
2918
2918
|
allowSaveWithErrors: boolean;
|
|
2919
2919
|
reusableRecommendationStrategy: boolean;
|
|
2920
|
-
|
|
2920
|
+
itemsPriceFormatting: boolean;
|
|
2921
2921
|
};
|
|
2922
2922
|
blocks: {
|
|
2923
2923
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|