@useinsider/guido 3.24.0-beta.2a3ba08 → 3.24.0-beta.2ad6e30
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 +7 -2
- package/dist/@types/config/schemas.js +16 -16
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +77 -79
- package/dist/composables/useHtmlCompiler.js +2 -0
- package/dist/composables/useModuleRepair.js +12 -14
- package/dist/composables/useSave.js +57 -52
- package/dist/composables/useSaveValidation.js +118 -110
- package/dist/composables/useStripo.js +70 -70
- package/dist/composables/validators/useUnsubscribeBlockValidator.js +48 -33
- package/dist/config/compiler/htmlCompilerRules.js +14 -6
- package/dist/config/migrator/index.js +15 -16
- package/dist/enums/save-validation.js +1 -1
- 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 +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/useSaveValidation.d.ts +1 -1
- package/dist/src/composables/useStripo.d.ts +1 -1
- package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +4 -0
- package/dist/src/config/migrator/index.d.ts +1 -4
- package/dist/src/enums/save-validation.d.ts +2 -1
- 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 +20 -20
- package/dist/src/utils/itemsCurrencyRepair.d.ts +1 -5
- package/dist/src/utils/trimHrefWhitespace.d.ts +5 -0
- package/dist/utils/itemsCurrencyRepair.js +24 -29
- package/dist/utils/pairProductVariables.js +99 -119
- package/dist/utils/trimHrefWhitespace.js +10 -0
- 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-9d988e4b] .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}.color-vision-select__dropdown[data-v-64cb50da]{z-index:20;width:387px}.accessibility-toolbar[data-v-391019bc]{gap:16px}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button svg{margin-right:0}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button .clearfix:after{content:none}.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}.editor-actions-menu__dropdown[data-v-bdb3b37a]{z-index:20;width:222px}.editor-actions[data-v-9a028d08]{gap:16px}.editor-actions__divider[data-v-9a028d08]{width:1px;height:40px;background-color:#e1e1e1}.right-slot[data-v-77451c9a]{gap:16px}.header-wrapper[data-v-3c713746]{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-9d988e4b] .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}.color-vision-select__dropdown[data-v-64cb50da]{z-index:20;width:387px}.accessibility-toolbar[data-v-391019bc]{gap:16px}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button svg{margin-right:0}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button .clearfix:after{content:none}.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}.editor-actions-menu__dropdown[data-v-bdb3b37a]{z-index:20;width:222px}.editor-actions[data-v-9a028d08]{gap:16px}.editor-actions__divider[data-v-9a028d08]{width:1px;height:40px;background-color:#e1e1e1}.right-slot[data-v-77451c9a]{gap:16px}.header-wrapper[data-v-3c713746]{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-0191951d]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-0191951d]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-0191951d]{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}.guido-tab-bar-onboarding[data-v-219b4f7c]{z-index:21}[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
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const o = "3.24.0-beta.
|
|
1
|
+
const o = "3.24.0-beta.2ad6e30", s = { stripo: { version: "2.83.1" } }, e = {
|
|
2
2
|
version: o,
|
|
3
3
|
guido: s
|
|
4
4
|
};
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
e as default,
|
|
7
7
|
s as guido,
|
|
8
8
|
o as version
|
|
9
9
|
};
|
|
@@ -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
|
+
/** Warn on save when the design carries an Insider unsubscribe link or code (host sets true for SFMC accounts) */
|
|
419
|
+
readonly blockUnsubscribeLinks: 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
|
+
/** Warn on save when the design carries an Insider unsubscribe link or code (host sets true for SFMC accounts) */
|
|
840
|
+
readonly blockUnsubscribeLinks: 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
|
+
blockUnsubscribeLinks: 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
|
+
blockUnsubscribeLinks: 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,6 +1,6 @@
|
|
|
1
1
|
import type { DynamicContent } from '@@/Types/generic';
|
|
2
2
|
import type { SaveValidationError } from '@@/Types/save-validation';
|
|
3
3
|
export declare const useSaveValidation: () => {
|
|
4
|
-
collectSaveValidationErrors: (compiledHtml: string, dynamicContentList: DynamicContent[]) => Promise<SaveValidationError[]>;
|
|
4
|
+
collectSaveValidationErrors: (compiledHtml: string, dynamicContentList: DynamicContent[], rawHtml: string) => Promise<SaveValidationError[]>;
|
|
5
5
|
validateCurrentTemplate: () => Promise<SaveValidationError[]>;
|
|
6
6
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EditorOpenMetrics } from '@@/Composables/useEditorOpenMetrics';
|
|
2
2
|
import type { Metadata, Options, Template } from '@@/Types/stripo';
|
|
3
3
|
export declare const useStripo: (openMetrics: EditorOpenMetrics) => {
|
|
4
|
-
initPlugin: (template: Template, metadata: Metadata, options: Options) => Promise<void>;
|
|
4
|
+
initPlugin: (template: Template, metadata: Metadata, options: Options, htmlChanged?: boolean) => Promise<void>;
|
|
5
5
|
preloadRuntime: () => void;
|
|
6
6
|
};
|
|
@@ -3,6 +3,9 @@ declare const SINGLETON_BLOCK_RULES: {
|
|
|
3
3
|
messageKey: string;
|
|
4
4
|
}[];
|
|
5
5
|
export declare const EMPTY_BLOCK_KEY = "unsubscription-preference.select-page-to-continue";
|
|
6
|
+
export declare const EXTERNALLY_MANAGED_UNSUBSCRIBE_KEY = "newsletter.sfmc-remove-unsubscribe-link";
|
|
7
|
+
/** Pure core: whether the html carries an Insider unsubscribe merge tag or ASM unsubscribe code. */
|
|
8
|
+
export declare function hasInsiderUnsubscribeCode(html: string): boolean;
|
|
6
9
|
/** Pure core: the singleton rules whose page type appears more than once. */
|
|
7
10
|
export declare function findDuplicateUnsubPageTypes(html: string): typeof SINGLETON_BLOCK_RULES;
|
|
8
11
|
/** Pure core: count of unsubscribe blocks with no page type or page list chosen. */
|
|
@@ -10,5 +13,6 @@ export declare function countUnsubBlocksWithoutPage(html: string): number;
|
|
|
10
13
|
export declare const useUnsubscribeBlockValidator: () => {
|
|
11
14
|
validateUnsubscribeBlockUniqueness: (html: string) => boolean;
|
|
12
15
|
validateUnsubscribeBlockHasTemplate: (html: string) => boolean;
|
|
16
|
+
validateNoInsiderUnsubscribeCode: (html: string, silent?: boolean) => boolean;
|
|
13
17
|
};
|
|
14
18
|
export {};
|
|
@@ -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>;
|
|
@@ -23,5 +23,6 @@ export declare enum SaveValidationRule {
|
|
|
23
23
|
RecommendationFilters = "recommendation-filters",
|
|
24
24
|
InvalidImageType = "invalid-image-type",
|
|
25
25
|
CheckboxUnsubGroup = "checkbox-unsub-group",
|
|
26
|
-
RadioButtonUnsubGroup = "radio-button-unsub-group"
|
|
26
|
+
RadioButtonUnsubGroup = "radio-button-unsub-group",
|
|
27
|
+
ExternallyManagedUnsubscribe = "externally-managed-unsubscribe"
|
|
27
28
|
}
|
|
@@ -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
|
|
@@ -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
|
+
blockUnsubscribeLinks: 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
|
+
blockUnsubscribeLinks: 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
|
+
blockUnsubscribeLinks: 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
|
+
blockUnsubscribeLinks: 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
|
+
blockUnsubscribeLinks: 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
|
+
blockUnsubscribeLinks: 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
|
+
blockUnsubscribeLinks: 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
|
+
blockUnsubscribeLinks: 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
|
+
blockUnsubscribeLinks: 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
|
+
blockUnsubscribeLinks: 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
|
+
blockUnsubscribeLinks: 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
|
+
blockUnsubscribeLinks: 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
|
+
blockUnsubscribeLinks: 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
|
+
blockUnsubscribeLinks: 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
|
+
blockUnsubscribeLinks: 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
|
+
blockUnsubscribeLinks: 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
|
+
blockUnsubscribeLinks: 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
|
+
blockUnsubscribeLinks: 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
|
+
blockUnsubscribeLinks: 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
|
+
blockUnsubscribeLinks: 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")[];
|
|
@@ -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
|
};
|