@useinsider/guido 3.23.0-beta.9f6bfbf → 3.23.0-beta.c98fd85
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 +0 -1
- package/dist/@types/config/schemas.js +15 -17
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +56 -58
- package/dist/composables/useModuleRepair.js +12 -14
- package/dist/config/migrator/index.js +15 -16
- package/dist/config/migrator/unsubscribeMigrator.js +60 -87
- package/dist/extensions/Blocks/Items/block.js +77 -115
- package/dist/extensions/Blocks/Items/constants/currency.js +14 -59
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +22 -33
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +51 -62
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +17 -18
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +31 -42
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +120 -141
- package/dist/extensions/Blocks/Items/enums/controlEnums.js +1 -1
- package/dist/extensions/Blocks/Items/extension.js +8 -9
- package/dist/extensions/Blocks/Items/items.css.js +0 -19
- package/dist/extensions/Blocks/Items/settingsPanel.js +25 -34
- package/dist/extensions/Blocks/Items/template.js +212 -250
- package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +0 -1
- package/dist/guido.css +1 -1
- package/dist/package.json.js +1 -1
- package/dist/src/@types/config/schemas.d.ts +0 -4
- package/dist/src/composables/useConfig.d.ts +0 -2
- package/dist/src/config/migrator/index.d.ts +1 -4
- package/dist/src/extensions/Blocks/Items/block.d.ts +9 -6
- package/dist/src/extensions/Blocks/Items/constants/currency.d.ts +0 -32
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/template.d.ts +1 -4
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +0 -3
- package/dist/src/extensions/Blocks/Recommendation/utils/priceFormatter.d.ts +0 -12
- package/dist/src/stores/config.d.ts +0 -20
- package/dist/src/utils/itemsCurrencyRepair.d.ts +1 -5
- package/dist/utils/itemsCurrencyRepair.js +24 -29
- package/dist/utils/pairProductVariables.js +99 -119
- package/package.json +1 -1
- package/dist/config/migrator/itemsPriceFormatMigrator.js +0 -20
- package/dist/extensions/Blocks/Items/controls/priceFormat.js +0 -145
- package/dist/extensions/Blocks/Items/utils/priceFormatOps.js +0 -185
- package/dist/src/config/migrator/itemsPriceFormatMigrator.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/priceFormat.d.ts +0 -23
- package/dist/src/extensions/Blocks/Items/utils/priceFormatOps.d.ts +0 -61
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-b8f24f34] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-baf7a5dd]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-
|
|
1
|
+
@charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-b8f24f34] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-baf7a5dd]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-f2154cb6]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-f2154cb6]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-f2154cb6]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-eaf8e461]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-eaf8e461]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-eaf8e461]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-eaf8e461]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-eaf8e461]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-19d8cb42] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-skeleton{width:100%!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}
|
package/dist/package.json.js
CHANGED
|
@@ -414,8 +414,6 @@ export declare const FeaturesSchema: v.ObjectSchema<{
|
|
|
414
414
|
/** Allow persisting a template that still has validation errors (drawer "Save and Continue" soft-save). Host sets false for transactional + unsubscribe. */
|
|
415
415
|
readonly allowSaveWithErrors: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
416
416
|
readonly reusableRecommendationStrategy: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
417
|
-
/** Items block: Recommendation-style price formatting (root currency-* attrs, raw price tags). Released dark. */
|
|
418
|
-
readonly itemsPriceFormatting: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
419
417
|
}, undefined>;
|
|
420
418
|
/**
|
|
421
419
|
* Default block types available in Stripo
|
|
@@ -834,8 +832,6 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
834
832
|
/** Allow persisting a template that still has validation errors (drawer "Save and Continue" soft-save). Host sets false for transactional + unsubscribe. */
|
|
835
833
|
readonly allowSaveWithErrors: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
836
834
|
readonly reusableRecommendationStrategy: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
837
|
-
/** Items block: Recommendation-style price formatting (root currency-* attrs, raw price tags). Released dark. */
|
|
838
|
-
readonly itemsPriceFormatting: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
839
835
|
}, undefined>, {}>;
|
|
840
836
|
/** Block configuration */
|
|
841
837
|
readonly blocks: v.OptionalSchema<v.ObjectSchema<{
|
|
@@ -104,7 +104,6 @@ export declare const useConfig: () => {
|
|
|
104
104
|
linkTrackingIds: boolean;
|
|
105
105
|
allowSaveWithErrors: boolean;
|
|
106
106
|
reusableRecommendationStrategy: boolean;
|
|
107
|
-
itemsPriceFormatting: boolean;
|
|
108
107
|
};
|
|
109
108
|
blocks: {
|
|
110
109
|
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")[];
|
|
@@ -244,7 +243,6 @@ export declare const useConfig: () => {
|
|
|
244
243
|
linkTrackingIds: boolean;
|
|
245
244
|
allowSaveWithErrors: boolean;
|
|
246
245
|
reusableRecommendationStrategy: boolean;
|
|
247
|
-
itemsPriceFormatting: boolean;
|
|
248
246
|
} | null>;
|
|
249
247
|
blocks: import("vue").ComputedRef<{
|
|
250
248
|
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,6 +1,3 @@
|
|
|
1
1
|
import type { LegacyRecommendationConfig } from '@@/Types/config';
|
|
2
2
|
import { type PartnerScopeMigrationOptions } from './recommendationPartnerMigrator';
|
|
3
|
-
export
|
|
4
|
-
itemsPriceFormatting?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export declare const migrate: (html: string, recommendationConfigs?: Record<string, LegacyRecommendationConfig>, partnerScope?: PartnerScopeMigrationOptions, features?: MigrationFeatureFlags) => Promise<string>;
|
|
3
|
+
export declare const migrate: (html: string, recommendationConfigs?: Record<string, LegacyRecommendationConfig>, partnerScope?: PartnerScopeMigrationOptions) => Promise<string>;
|
|
@@ -71,12 +71,15 @@ export declare class ItemsBlock extends Block {
|
|
|
71
71
|
*/
|
|
72
72
|
private _resolveInstanceId;
|
|
73
73
|
/**
|
|
74
|
-
*
|
|
75
|
-
*
|
|
74
|
+
* Stamps the export-read currency attrs onto every price `<p>` from config, so a template whose
|
|
75
|
+
* attrs drifted (e.g. a location toggle before the sync fix) self-heals to match the editor.
|
|
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.
|
|
76
83
|
*/
|
|
77
84
|
private _reconcileCurrencyDomAttributes;
|
|
78
|
-
/** Legacy `<p>` contract via `currencyAttrTargets`: position when recorded, symbol only when custom. */
|
|
79
|
-
private _reconcileLegacyCurrencyAttributes;
|
|
80
|
-
private _priceParagraphs;
|
|
81
|
-
private _isPriceFormattingEnabled;
|
|
82
85
|
}
|
|
@@ -41,35 +41,3 @@ 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;
|
|
@@ -35,7 +35,6 @@ export declare class ItemsBlockControl extends CommonControl {
|
|
|
35
35
|
_reFillTemplate(itemsType?: ProductType): void;
|
|
36
36
|
_recalculateTrimming(): void;
|
|
37
37
|
private _getParagraphFromBlock;
|
|
38
|
-
private _replacePriceText;
|
|
39
38
|
private _escapeRegex;
|
|
40
39
|
private _removeCurrencySymbol;
|
|
41
40
|
private _replacePriceNumber;
|
|
@@ -46,7 +46,6 @@ 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
49
|
NAME_ALIGN = "items-block-name-align-control",
|
|
51
50
|
NAME_COLOR = "items-block-name-color-control",
|
|
52
51
|
NAME_SIZE = "items-block-name-size-control",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type ItemsPriceFormat } from './constants/currency';
|
|
2
1
|
import { type ItemsBlockConfig } from './utils/nodeConfigUtils';
|
|
3
2
|
declare const migrationTemplate = "ADD YOUR MIGRATION HERE";
|
|
4
3
|
type ProductType = 'CART_ITEMS' | 'BROWSED_ITEMS' | 'PURCHASED_ITEMS';
|
|
@@ -37,8 +36,6 @@ type TemplateParameters = {
|
|
|
37
36
|
quantityStyles?: string;
|
|
38
37
|
/** Price orientation within the card ('vertical' = stacked, 'horizontal' = side-by-side) */
|
|
39
38
|
priceOrientation?: PriceOrientationType;
|
|
40
|
-
/** New price model (itemsPriceFormatting): root attrs + raw dummy amounts; absent = legacy output. */
|
|
41
|
-
priceFormat?: ItemsPriceFormat;
|
|
42
39
|
};
|
|
43
40
|
/**
|
|
44
41
|
* Applies price orientation styles to the generated HTML template.
|
|
@@ -70,5 +67,5 @@ export declare const applyPriceOrientationStyles: (html: string, layoutOrientati
|
|
|
70
67
|
* @param params.formattedPrice - Whether to use formatted price display
|
|
71
68
|
* @returns HTML template string for the Items Block
|
|
72
69
|
*/
|
|
73
|
-
export declare function getDefaultTemplate({ orientation, itemsType, itemId, currencySymbol, currencyLocation, migrate, formattedPrice, configBlockAttributes, nodeConfig, nameStyles, buttonStyles, priceStyles, originalPriceStyles, quantityStyles, priceOrientation,
|
|
70
|
+
export declare function getDefaultTemplate({ orientation, itemsType, itemId, currencySymbol, currencyLocation, migrate, formattedPrice, configBlockAttributes, nodeConfig, nameStyles, buttonStyles, priceStyles, originalPriceStyles, quantityStyles, priceOrientation, }: TemplateParameters): string;
|
|
74
71
|
export default migrationTemplate;
|
|
@@ -18,9 +18,6 @@ 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;
|
|
24
21
|
quantityControlEnabled: boolean;
|
|
25
22
|
buttonLink: string;
|
|
26
23
|
imageLink: string;
|
|
@@ -14,18 +14,6 @@ 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;
|
|
29
17
|
/**
|
|
30
18
|
* Formats a numeric price according to currency settings
|
|
31
19
|
* @example
|
|
@@ -109,7 +109,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
109
109
|
linkTrackingIds: boolean;
|
|
110
110
|
allowSaveWithErrors: boolean;
|
|
111
111
|
reusableRecommendationStrategy: boolean;
|
|
112
|
-
itemsPriceFormatting: boolean;
|
|
113
112
|
};
|
|
114
113
|
blocks: {
|
|
115
114
|
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")[];
|
|
@@ -255,7 +254,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
255
254
|
linkTrackingIds: boolean;
|
|
256
255
|
allowSaveWithErrors: boolean;
|
|
257
256
|
reusableRecommendationStrategy: boolean;
|
|
258
|
-
itemsPriceFormatting: boolean;
|
|
259
257
|
};
|
|
260
258
|
blocks: {
|
|
261
259
|
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")[];
|
|
@@ -401,7 +399,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
401
399
|
linkTrackingIds: boolean;
|
|
402
400
|
allowSaveWithErrors: boolean;
|
|
403
401
|
reusableRecommendationStrategy: boolean;
|
|
404
|
-
itemsPriceFormatting: boolean;
|
|
405
402
|
};
|
|
406
403
|
blocks: {
|
|
407
404
|
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")[];
|
|
@@ -547,7 +544,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
547
544
|
linkTrackingIds: boolean;
|
|
548
545
|
allowSaveWithErrors: boolean;
|
|
549
546
|
reusableRecommendationStrategy: boolean;
|
|
550
|
-
itemsPriceFormatting: boolean;
|
|
551
547
|
};
|
|
552
548
|
blocks: {
|
|
553
549
|
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")[];
|
|
@@ -693,7 +689,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
693
689
|
linkTrackingIds: boolean;
|
|
694
690
|
allowSaveWithErrors: boolean;
|
|
695
691
|
reusableRecommendationStrategy: boolean;
|
|
696
|
-
itemsPriceFormatting: boolean;
|
|
697
692
|
};
|
|
698
693
|
blocks: {
|
|
699
694
|
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")[];
|
|
@@ -839,7 +834,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
839
834
|
linkTrackingIds: boolean;
|
|
840
835
|
allowSaveWithErrors: boolean;
|
|
841
836
|
reusableRecommendationStrategy: boolean;
|
|
842
|
-
itemsPriceFormatting: boolean;
|
|
843
837
|
};
|
|
844
838
|
blocks: {
|
|
845
839
|
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")[];
|
|
@@ -985,7 +979,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
985
979
|
linkTrackingIds: boolean;
|
|
986
980
|
allowSaveWithErrors: boolean;
|
|
987
981
|
reusableRecommendationStrategy: boolean;
|
|
988
|
-
itemsPriceFormatting: boolean;
|
|
989
982
|
};
|
|
990
983
|
blocks: {
|
|
991
984
|
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")[];
|
|
@@ -1131,7 +1124,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1131
1124
|
linkTrackingIds: boolean;
|
|
1132
1125
|
allowSaveWithErrors: boolean;
|
|
1133
1126
|
reusableRecommendationStrategy: boolean;
|
|
1134
|
-
itemsPriceFormatting: boolean;
|
|
1135
1127
|
};
|
|
1136
1128
|
blocks: {
|
|
1137
1129
|
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")[];
|
|
@@ -1277,7 +1269,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1277
1269
|
linkTrackingIds: boolean;
|
|
1278
1270
|
allowSaveWithErrors: boolean;
|
|
1279
1271
|
reusableRecommendationStrategy: boolean;
|
|
1280
|
-
itemsPriceFormatting: boolean;
|
|
1281
1272
|
};
|
|
1282
1273
|
blocks: {
|
|
1283
1274
|
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")[];
|
|
@@ -1423,7 +1414,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1423
1414
|
linkTrackingIds: boolean;
|
|
1424
1415
|
allowSaveWithErrors: boolean;
|
|
1425
1416
|
reusableRecommendationStrategy: boolean;
|
|
1426
|
-
itemsPriceFormatting: boolean;
|
|
1427
1417
|
};
|
|
1428
1418
|
blocks: {
|
|
1429
1419
|
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")[];
|
|
@@ -1569,7 +1559,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1569
1559
|
linkTrackingIds: boolean;
|
|
1570
1560
|
allowSaveWithErrors: boolean;
|
|
1571
1561
|
reusableRecommendationStrategy: boolean;
|
|
1572
|
-
itemsPriceFormatting: boolean;
|
|
1573
1562
|
};
|
|
1574
1563
|
blocks: {
|
|
1575
1564
|
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")[];
|
|
@@ -1715,7 +1704,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1715
1704
|
linkTrackingIds: boolean;
|
|
1716
1705
|
allowSaveWithErrors: boolean;
|
|
1717
1706
|
reusableRecommendationStrategy: boolean;
|
|
1718
|
-
itemsPriceFormatting: boolean;
|
|
1719
1707
|
};
|
|
1720
1708
|
blocks: {
|
|
1721
1709
|
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")[];
|
|
@@ -1861,7 +1849,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1861
1849
|
linkTrackingIds: boolean;
|
|
1862
1850
|
allowSaveWithErrors: boolean;
|
|
1863
1851
|
reusableRecommendationStrategy: boolean;
|
|
1864
|
-
itemsPriceFormatting: boolean;
|
|
1865
1852
|
};
|
|
1866
1853
|
blocks: {
|
|
1867
1854
|
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")[];
|
|
@@ -2007,7 +1994,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2007
1994
|
linkTrackingIds: boolean;
|
|
2008
1995
|
allowSaveWithErrors: boolean;
|
|
2009
1996
|
reusableRecommendationStrategy: boolean;
|
|
2010
|
-
itemsPriceFormatting: boolean;
|
|
2011
1997
|
};
|
|
2012
1998
|
blocks: {
|
|
2013
1999
|
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")[];
|
|
@@ -2153,7 +2139,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2153
2139
|
linkTrackingIds: boolean;
|
|
2154
2140
|
allowSaveWithErrors: boolean;
|
|
2155
2141
|
reusableRecommendationStrategy: boolean;
|
|
2156
|
-
itemsPriceFormatting: boolean;
|
|
2157
2142
|
};
|
|
2158
2143
|
blocks: {
|
|
2159
2144
|
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")[];
|
|
@@ -2299,7 +2284,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2299
2284
|
linkTrackingIds: boolean;
|
|
2300
2285
|
allowSaveWithErrors: boolean;
|
|
2301
2286
|
reusableRecommendationStrategy: boolean;
|
|
2302
|
-
itemsPriceFormatting: boolean;
|
|
2303
2287
|
};
|
|
2304
2288
|
blocks: {
|
|
2305
2289
|
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")[];
|
|
@@ -2445,7 +2429,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2445
2429
|
linkTrackingIds: boolean;
|
|
2446
2430
|
allowSaveWithErrors: boolean;
|
|
2447
2431
|
reusableRecommendationStrategy: boolean;
|
|
2448
|
-
itemsPriceFormatting: boolean;
|
|
2449
2432
|
};
|
|
2450
2433
|
blocks: {
|
|
2451
2434
|
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")[];
|
|
@@ -2603,7 +2586,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2603
2586
|
linkTrackingIds: boolean;
|
|
2604
2587
|
allowSaveWithErrors: boolean;
|
|
2605
2588
|
reusableRecommendationStrategy: boolean;
|
|
2606
|
-
itemsPriceFormatting: boolean;
|
|
2607
2589
|
};
|
|
2608
2590
|
blocks: {
|
|
2609
2591
|
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")[];
|
|
@@ -2749,7 +2731,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2749
2731
|
linkTrackingIds: boolean;
|
|
2750
2732
|
allowSaveWithErrors: boolean;
|
|
2751
2733
|
reusableRecommendationStrategy: boolean;
|
|
2752
|
-
itemsPriceFormatting: boolean;
|
|
2753
2734
|
};
|
|
2754
2735
|
blocks: {
|
|
2755
2736
|
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")[];
|
|
@@ -2897,7 +2878,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2897
2878
|
linkTrackingIds: boolean;
|
|
2898
2879
|
allowSaveWithErrors: boolean;
|
|
2899
2880
|
reusableRecommendationStrategy: boolean;
|
|
2900
|
-
itemsPriceFormatting: boolean;
|
|
2901
2881
|
};
|
|
2902
2882
|
blocks: {
|
|
2903
2883
|
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,7 +1,3 @@
|
|
|
1
|
-
export interface ItemsCurrencyRepairOptions {
|
|
2
|
-
/** Convert legacy-model blocks to the root price-format contract (itemsPriceFormatting). */
|
|
3
|
-
convertToPriceFormat?: boolean;
|
|
4
|
-
}
|
|
5
1
|
/**
|
|
6
2
|
* Heals stale price currency attributes on every v2 Items block inside a dropped
|
|
7
3
|
* saved module, driving `data-curency` / `data-currency_symbol` from each block's
|
|
@@ -18,4 +14,4 @@ export interface ItemsCurrencyRepairOptions {
|
|
|
18
14
|
* recommendationMigrator wraps). If the wrap fails to capture the blocks (non-`<td>`
|
|
19
15
|
* root foster-parented out), it bails to the original string.
|
|
20
16
|
*/
|
|
21
|
-
export declare function repairItemsCurrencyAttributes(html: string
|
|
17
|
+
export declare function repairItemsCurrencyAttributes(html: string): string;
|
|
@@ -1,44 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ItemsBlockId as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
if (i
|
|
7
|
-
const t = m(e), l = y(t, { convertLegacy: i });
|
|
8
|
-
return d(e, l);
|
|
9
|
-
}
|
|
10
|
-
const n = e.getAttribute("esd-ext-config");
|
|
11
|
-
if (!n)
|
|
1
|
+
import { currencyAttrTargets as u, ITEMS_CURRENCY_ATTR as c } from "../extensions/Blocks/Items/constants/currency.js";
|
|
2
|
+
import { ItemsBlockId as l } from "../extensions/Blocks/Items/enums/controlEnums.js";
|
|
3
|
+
const s = "items-block-v2";
|
|
4
|
+
function f(e) {
|
|
5
|
+
const i = e.getAttribute("esd-ext-config");
|
|
6
|
+
if (!i)
|
|
12
7
|
return !1;
|
|
13
|
-
let
|
|
8
|
+
let t, r;
|
|
14
9
|
try {
|
|
15
|
-
({ position:
|
|
10
|
+
({ position: t, symbol: r } = u(JSON.parse(i)));
|
|
16
11
|
} catch {
|
|
17
12
|
return !1;
|
|
18
13
|
}
|
|
19
|
-
let
|
|
20
|
-
return e.querySelectorAll(`.${
|
|
21
|
-
|
|
22
|
-
}),
|
|
14
|
+
let o = !1;
|
|
15
|
+
return e.querySelectorAll(`.${l.PRICE} p`).forEach((n) => {
|
|
16
|
+
t !== void 0 && n.getAttribute(c.POSITION) !== t && (n.setAttribute(c.POSITION, t), o = !0), r !== void 0 && n.getAttribute(c.SYMBOL) !== r && (n.setAttribute(c.SYMBOL, r), o = !0);
|
|
17
|
+
}), o;
|
|
23
18
|
}
|
|
24
|
-
function
|
|
25
|
-
if (typeof e != "string" || !e.includes(
|
|
19
|
+
function S(e) {
|
|
20
|
+
if (typeof e != "string" || !e.includes(s))
|
|
26
21
|
return e;
|
|
27
22
|
try {
|
|
28
|
-
const
|
|
23
|
+
const t = new DOMParser().parseFromString(
|
|
29
24
|
`<table><tbody><tr>${e}</tr></tbody></table>`,
|
|
30
25
|
"text/html"
|
|
31
|
-
).querySelector("tr"),
|
|
32
|
-
if (
|
|
26
|
+
).querySelector("tr"), r = t.querySelectorAll(`.${s}`);
|
|
27
|
+
if (r.length === 0)
|
|
33
28
|
return e;
|
|
34
|
-
let
|
|
35
|
-
return
|
|
36
|
-
|
|
37
|
-
}),
|
|
38
|
-
} catch (
|
|
39
|
-
return console.error("Failed to repair items currency on module add:",
|
|
29
|
+
let o = !1;
|
|
30
|
+
return r.forEach((n) => {
|
|
31
|
+
f(n) && (o = !0);
|
|
32
|
+
}), o ? t.innerHTML : e;
|
|
33
|
+
} catch (i) {
|
|
34
|
+
return console.error("Failed to repair items currency on module add:", i), e;
|
|
40
35
|
}
|
|
41
36
|
}
|
|
42
37
|
export {
|
|
43
|
-
|
|
38
|
+
S as repairItemsCurrencyAttributes
|
|
44
39
|
};
|