@useinsider/guido 3.2.0-beta.e01b42a → 3.2.0-beta.e0e56ef
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 -0
- package/dist/@types/config/schemas.js +164 -96
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +91 -80
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +7 -7
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +12 -20
- package/dist/components/organisms/header/EditorActions.vue.js +2 -2
- package/dist/components/organisms/header/EditorActions.vue2.js +51 -36
- package/dist/components/organisms/header/RightSlot.vue.js +10 -10
- package/dist/components/organisms/header/RightSlot.vue2.js +16 -13
- package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +51 -31
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +1 -1
- package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +23 -22
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +1 -1
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +37 -39
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +3 -3
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +30 -41
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +15 -14
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +18 -17
- package/dist/composables/useActionsApi.js +4 -4
- package/dist/composables/useFullStoryBridge.js +14 -0
- package/dist/composables/useHtmlCompiler.js +23 -21
- package/dist/composables/useHtmlValidator.js +40 -38
- package/dist/composables/usePreviewMode.js +20 -16
- package/dist/composables/useRibbonOffset.js +21 -0
- package/dist/composables/useSave.js +23 -15
- package/dist/composables/useStripo.js +52 -47
- package/dist/composables/validators/useLiquidValidator.js +42 -0
- package/dist/config/compiler/liquidCompilerRules.js +15 -0
- package/dist/config/compiler/recommendationCompilerRules.js +162 -43
- package/dist/config/compiler/unsubscribeCompilerRules.js +48 -45
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +52 -46
- package/dist/config/migrator/checkboxMigrator.js +5 -3
- package/dist/config/migrator/index.js +9 -9
- package/dist/config/migrator/radioButtonMigrator.js +14 -12
- package/dist/config/migrator/recommendation/compositionMapper.js +98 -0
- package/dist/config/migrator/recommendation/extractors.js +27 -0
- package/dist/config/migrator/recommendation/htmlBuilder.js +496 -0
- package/dist/config/migrator/recommendation/parseLegacyConfig.js +33 -0
- package/dist/config/migrator/recommendation/settingsMapper.js +78 -0
- package/dist/config/migrator/recommendation/themeMapper.js +93 -0
- package/dist/config/migrator/recommendationMigrator.js +74 -290
- package/dist/enums/extensions/recommendationBlock.js +16 -12
- package/dist/enums/onboarding.js +7 -2
- package/dist/enums/recommendation.js +2 -2
- package/dist/enums/unsubscribe.js +34 -27
- package/dist/extensions/Blocks/CouponBlock/template.js +24 -13
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +38 -38
- package/dist/extensions/Blocks/Items/enums/productEnums.js +19 -7
- package/dist/extensions/Blocks/Recommendation/block.js +35 -32
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +5 -5
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +27 -11
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +185 -172
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +21 -18
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +99 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +6 -6
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +3 -1
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +211 -162
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +27 -57
- package/dist/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.js +14 -0
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +31 -31
- package/dist/extensions/Blocks/Recommendation/services/configService.js +65 -29
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +18 -17
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +29 -25
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +7 -5
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +30 -29
- package/dist/extensions/Blocks/Recommendation/templates/index.js +7 -7
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +3 -1
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +21 -21
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +57 -50
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +17 -14
- package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +13 -22
- package/dist/extensions/Blocks/Unsubscribe/block.js +11 -11
- package/dist/extensions/DynamicContent/dynamic-content.js +17 -12
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +258 -235
- package/dist/node_modules/valibot/dist/index.js +450 -235
- package/dist/package.json.js +1 -1
- package/dist/services/recommendationApi.js +15 -15
- package/dist/services/stripoApi.js +9 -9
- package/dist/services/templateLibraryApi.js +48 -46
- package/dist/src/@types/config/defaults.d.ts +5 -1
- package/dist/src/@types/config/index.d.ts +3 -3
- package/dist/src/@types/config/schemas.d.ts +241 -0
- package/dist/src/@types/config/types.d.ts +11 -1
- package/dist/src/@types/generic.d.ts +0 -1
- package/dist/src/@types/save-as-template.d.ts +1 -0
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useActionsApi.d.ts +1 -1
- package/dist/src/composables/useConfig.d.ts +68 -0
- package/dist/src/composables/useFullStoryBridge.d.ts +11 -0
- package/dist/src/composables/useRibbonOffset.d.ts +4 -0
- package/dist/src/composables/validators/useLiquidValidator.d.ts +3 -0
- package/dist/src/config/compiler/liquidCompilerRules.d.ts +2 -0
- package/dist/src/config/compiler/utils/recommendationCompilerUtils.d.ts +1 -1
- package/dist/src/config/migrator/index.d.ts +2 -1
- package/dist/src/config/migrator/recommendation/compositionMapper.d.ts +2 -0
- package/dist/src/config/migrator/recommendation/compositionMapper.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/extractors.d.ts +7 -0
- package/dist/src/config/migrator/recommendation/extractors.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +11 -0
- package/dist/src/config/migrator/recommendation/parseLegacyConfig.d.ts +15 -0
- package/dist/src/config/migrator/recommendation/parseLegacyConfig.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/settingsMapper.d.ts +7 -0
- package/dist/src/config/migrator/recommendation/settingsMapper.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/themeMapper.d.ts +5 -0
- package/dist/src/config/migrator/recommendation/themeMapper.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/types.d.ts +205 -0
- package/dist/src/config/migrator/recommendationMigrator.d.ts +13 -1
- package/dist/src/config/migrator/recommendationMigrator.test.d.ts +1 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +3 -0
- package/dist/src/enums/onboarding.d.ts +6 -0
- package/dist/src/enums/unsubscribe.d.ts +5 -0
- package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +3 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.d.ts +35 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.test.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/textTrim.d.ts +3 -20
- package/dist/src/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.d.ts +29 -0
- package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +10 -0
- package/dist/src/extensions/Blocks/Recommendation/services/configService.test.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -3
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +20 -3
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +0 -3
- package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +3 -3
- package/dist/src/services/templateLibraryApi.d.ts +1 -1
- package/dist/src/stores/config.d.ts +612 -0
- package/dist/src/stores/onboarding.d.ts +4 -0
- package/dist/src/stores/preview.d.ts +3 -0
- package/dist/src/utils/genericUtil.d.ts +1 -1
- package/dist/src/utils/htmlCompiler.d.ts +2 -1
- package/dist/src/utils/htmlEscape.d.ts +5 -0
- package/dist/src/utils/htmlEscape.test.d.ts +1 -0
- package/dist/static/styles/base.css.js +7 -2
- package/dist/static/styles/components/button.css.js +3 -2
- package/dist/static/styles/components/loader.css.js +4 -0
- package/dist/stores/onboarding.js +4 -0
- package/dist/stores/preview.js +4 -3
- package/dist/utils/genericUtil.js +42 -20
- package/dist/utils/htmlCompiler.js +48 -41
- package/dist/utils/htmlEscape.js +13 -0
- package/dist/utils/templatePreparation.js +36 -25
- package/dist/utils/tooltipUtils.js +4 -5
- package/package.json +8 -4
- package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +0 -251
|
@@ -7,5 +7,5 @@ export declare const useActionsApi: () => {
|
|
|
7
7
|
getPreviewData: (options?: CompileEmailOptions) => Promise<CompiledEmailResult>;
|
|
8
8
|
updateTimerInClonedTemplate: () => Promise<string | null>;
|
|
9
9
|
updateHtmlAndCss: (html: string, css: string) => void;
|
|
10
|
-
editorSave: () => void
|
|
10
|
+
editorSave: () => Promise<void>;
|
|
11
11
|
};
|
|
@@ -17,6 +17,10 @@ export declare const useConfig: () => {
|
|
|
17
17
|
productType: 60 | 49 | 97;
|
|
18
18
|
messageType: 1 | 2;
|
|
19
19
|
username: string;
|
|
20
|
+
fallbackFont?: {
|
|
21
|
+
name: string;
|
|
22
|
+
family: string;
|
|
23
|
+
} | undefined;
|
|
20
24
|
};
|
|
21
25
|
template: {
|
|
22
26
|
html: string;
|
|
@@ -30,8 +34,37 @@ export declare const useConfig: () => {
|
|
|
30
34
|
value: string;
|
|
31
35
|
} | undefined;
|
|
32
36
|
}[];
|
|
37
|
+
customFieldAttributes: string[];
|
|
33
38
|
selectedUnsubscribePages: number[];
|
|
34
39
|
forceRecreate: boolean;
|
|
40
|
+
migration: {
|
|
41
|
+
recommendationConfigs: {
|
|
42
|
+
[x: string]: {
|
|
43
|
+
id?: number | undefined;
|
|
44
|
+
decimalCount?: string | number | undefined;
|
|
45
|
+
productIds?: unknown[] | undefined;
|
|
46
|
+
sendProductRequestFlag?: boolean | undefined;
|
|
47
|
+
shuffleProducts?: boolean | undefined;
|
|
48
|
+
filters?: unknown[] | undefined;
|
|
49
|
+
currency?: string | undefined;
|
|
50
|
+
currencySettings?: unknown;
|
|
51
|
+
language?: string | undefined;
|
|
52
|
+
strategy?: string | undefined;
|
|
53
|
+
recommendedProducts?: unknown[] | undefined;
|
|
54
|
+
cardsInRow?: number | undefined;
|
|
55
|
+
mobileRightPadding?: number | undefined;
|
|
56
|
+
mobileLeftPadding?: number | undefined;
|
|
57
|
+
unresponsive?: boolean | undefined;
|
|
58
|
+
orientation?: string | undefined;
|
|
59
|
+
textTrimming?: boolean | undefined;
|
|
60
|
+
blockType?: string | undefined;
|
|
61
|
+
size?: string | number | undefined;
|
|
62
|
+
verticalResponsiveness?: boolean | undefined;
|
|
63
|
+
} & {
|
|
64
|
+
[key: string]: unknown;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
};
|
|
35
68
|
};
|
|
36
69
|
editor: {
|
|
37
70
|
locale: string;
|
|
@@ -56,6 +89,7 @@ export declare const useConfig: () => {
|
|
|
56
89
|
displayConditions: boolean;
|
|
57
90
|
unsubscribe: boolean;
|
|
58
91
|
modulesDisabled: boolean;
|
|
92
|
+
liquidSyntax: boolean;
|
|
59
93
|
};
|
|
60
94
|
blocks: {
|
|
61
95
|
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")[];
|
|
@@ -108,6 +142,10 @@ export declare const useConfig: () => {
|
|
|
108
142
|
productType: 60 | 49 | 97;
|
|
109
143
|
messageType: 1 | 2;
|
|
110
144
|
username: string;
|
|
145
|
+
fallbackFont?: {
|
|
146
|
+
name: string;
|
|
147
|
+
family: string;
|
|
148
|
+
} | undefined;
|
|
111
149
|
} | null>;
|
|
112
150
|
template: import("vue").ComputedRef<{
|
|
113
151
|
html: string;
|
|
@@ -121,8 +159,37 @@ export declare const useConfig: () => {
|
|
|
121
159
|
value: string;
|
|
122
160
|
} | undefined;
|
|
123
161
|
}[];
|
|
162
|
+
customFieldAttributes: string[];
|
|
124
163
|
selectedUnsubscribePages: number[];
|
|
125
164
|
forceRecreate: boolean;
|
|
165
|
+
migration: {
|
|
166
|
+
recommendationConfigs: {
|
|
167
|
+
[x: string]: {
|
|
168
|
+
id?: number | undefined;
|
|
169
|
+
decimalCount?: string | number | undefined;
|
|
170
|
+
productIds?: unknown[] | undefined;
|
|
171
|
+
sendProductRequestFlag?: boolean | undefined;
|
|
172
|
+
shuffleProducts?: boolean | undefined;
|
|
173
|
+
filters?: unknown[] | undefined;
|
|
174
|
+
currency?: string | undefined;
|
|
175
|
+
currencySettings?: unknown;
|
|
176
|
+
language?: string | undefined;
|
|
177
|
+
strategy?: string | undefined;
|
|
178
|
+
recommendedProducts?: unknown[] | undefined;
|
|
179
|
+
cardsInRow?: number | undefined;
|
|
180
|
+
mobileRightPadding?: number | undefined;
|
|
181
|
+
mobileLeftPadding?: number | undefined;
|
|
182
|
+
unresponsive?: boolean | undefined;
|
|
183
|
+
orientation?: string | undefined;
|
|
184
|
+
textTrimming?: boolean | undefined;
|
|
185
|
+
blockType?: string | undefined;
|
|
186
|
+
size?: string | number | undefined;
|
|
187
|
+
verticalResponsiveness?: boolean | undefined;
|
|
188
|
+
} & {
|
|
189
|
+
[key: string]: unknown;
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
};
|
|
126
193
|
} | null>;
|
|
127
194
|
editor: import("vue").ComputedRef<{
|
|
128
195
|
locale: string;
|
|
@@ -147,6 +214,7 @@ export declare const useConfig: () => {
|
|
|
147
214
|
displayConditions: boolean;
|
|
148
215
|
unsubscribe: boolean;
|
|
149
216
|
modulesDisabled: boolean;
|
|
217
|
+
liquidSyntax: boolean;
|
|
150
218
|
} | null>;
|
|
151
219
|
blocks: import("vue").ComputedRef<{
|
|
152
220
|
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")[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Injects the hosted FullStory bridge script into the Stripo editor iframe.
|
|
3
|
+
*
|
|
4
|
+
* The bridge script's origin is allowlisted via Stripo's
|
|
5
|
+
* `allowedScriptSourceDomains` in useStripo, so the iframe's CSP permits
|
|
6
|
+
* the load. The bundled script itself handles reading FS config from the
|
|
7
|
+
* parent window and booting the FullStory queue stub inside the iframe.
|
|
8
|
+
*/
|
|
9
|
+
export declare const useFullStoryBridge: () => {
|
|
10
|
+
injectFullStory: () => void;
|
|
11
|
+
};
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @param alignment - Currency alignment from block config: 'before' or 'after'
|
|
7
7
|
* @returns Formatted price string with currency variable in correct position
|
|
8
8
|
*/
|
|
9
|
-
export declare function formatPriceVariable(campaignId: string, productIndex: number, attribute: string, alignment: string): string;
|
|
9
|
+
export declare function formatPriceVariable(campaignId: string, productIndex: number, attribute: string, alignment: string, prefix?: string): string;
|
|
10
10
|
/**
|
|
11
11
|
* Transforms recommendation block HTML by replacing product data with
|
|
12
12
|
* template variables.
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import type { LegacyRecommendationConfig } from '@@/Types/config';
|
|
2
|
+
export declare const migrate: (html: string, recommendationConfigs?: Record<string, LegacyRecommendationConfig>) => Promise<string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function extractTitleText(block: Element): string;
|
|
2
|
+
/**
|
|
3
|
+
* Card background lives on either the block (`bgcolor`/`style`) or per-card
|
|
4
|
+
* cells (`.product-card`). Returns empty string when no background is set —
|
|
5
|
+
* the caller treats that as "no segment background".
|
|
6
|
+
*/
|
|
7
|
+
export declare function extractCardBgColor(block: Element): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { MappedComposition } from './types';
|
|
2
|
+
import type { RecommendationNodeConfig } from '@@/Extensions/Blocks/Recommendation/types/nodeConfig';
|
|
3
|
+
export declare function buildBlockHtml(params: {
|
|
4
|
+
nodeConfig: RecommendationNodeConfig;
|
|
5
|
+
composition: MappedComposition;
|
|
6
|
+
cardBg: string;
|
|
7
|
+
titleText: string;
|
|
8
|
+
extraClasses?: string;
|
|
9
|
+
legacyId?: string;
|
|
10
|
+
legacyBgColor?: string;
|
|
11
|
+
}): string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { LegacyProductConfig } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* `esd-dev-product-config` is double-HTML-encoded JSON: serialization
|
|
4
|
+
* escapes once to embed inside the attribute, and Stripo's templating
|
|
5
|
+
* layer escapes a second time when round-tripping. Returns `null` when
|
|
6
|
+
* the attribute is missing or unable to be parsed — the caller treats
|
|
7
|
+
* either case as an abort.
|
|
8
|
+
*/
|
|
9
|
+
export declare function parseLegacyConfig(block: Element): LegacyProductConfig | null;
|
|
10
|
+
/**
|
|
11
|
+
* Older legacy templates omitted the canonical
|
|
12
|
+
* `ins-recommendation-v3-campaign-id` attribute but always included the
|
|
13
|
+
* `ins-recommendation-v3-block-<id>` class — fall back to scraping it.
|
|
14
|
+
*/
|
|
15
|
+
export declare function parseRecommendationId(block: Element): number | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LegacyProductConfig } from './types';
|
|
2
|
+
import type { CurrencyConfig, RecommendationNodeConfig } from '@@/Extensions/Blocks/Recommendation/types/nodeConfig';
|
|
3
|
+
import type { LegacyRecommendationConfig } from '@@/Types/config';
|
|
4
|
+
/** Defensive against missing/malformed legacy `currencySettings` — defaults are per-field, not whole-object. */
|
|
5
|
+
export declare function mapCurrency(legacy: unknown): CurrencyConfig;
|
|
6
|
+
export type SettingsPartial = Pick<RecommendationNodeConfig, 'recommendationId' | 'strategy' | 'productIds' | 'size' | 'shuffleProducts' | 'language' | 'currency' | 'filters' | 'layout' | 'cardsInRow' | 'mobileCardsInRow' | 'mobileLayoutEnabled' | 'previousMobileCardsInRow' | 'columnSpacing' | 'rowSpacing' | 'mobileColumnSpacing' | 'mobileRowSpacing' | 'omnibusPrice' | 'omnibusDiscount' | 'configVersion'>;
|
|
7
|
+
export declare function mapSettings(recCfg: LegacyRecommendationConfig, parsed: LegacyProductConfig, id: number): SettingsPartial;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { LegacyButtonTheme, LegacyImageTheme, LegacyTextTheme, MappedButtonStyle, MappedImageStyle, MappedTextStyle } from './types';
|
|
2
|
+
export declare function mapTextTheme(theme: LegacyTextTheme | undefined): MappedTextStyle;
|
|
3
|
+
export declare function mapButtonTheme(theme: LegacyButtonTheme | undefined): MappedButtonStyle;
|
|
4
|
+
export declare function mapImageTheme(theme: LegacyImageTheme | undefined): MappedImageStyle;
|
|
5
|
+
export declare function appendStyle(existing: string | undefined, addition: string | undefined): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal types for the legacy Recommendation block migrator.
|
|
3
|
+
*
|
|
4
|
+
* The legacy block stores its full state as a JSON blob inside the
|
|
5
|
+
* `esd-dev-product-config` HTML attribute. These interfaces describe
|
|
6
|
+
* the subset of that schema we depend on. All fields are optional —
|
|
7
|
+
* legacy data is heterogeneous and we use defensive optional chaining
|
|
8
|
+
* everywhere downstream.
|
|
9
|
+
*/
|
|
10
|
+
/** Per-side numeric values used by border / padding theme fields. */
|
|
11
|
+
export interface LegacySides<T = number> {
|
|
12
|
+
left?: T;
|
|
13
|
+
right?: T;
|
|
14
|
+
top?: T;
|
|
15
|
+
bottom?: T;
|
|
16
|
+
}
|
|
17
|
+
/** Padding shape used for both desktop and mobile in legacy theme. */
|
|
18
|
+
export interface LegacyPaddingViewport {
|
|
19
|
+
all?: number;
|
|
20
|
+
top?: number;
|
|
21
|
+
right?: number;
|
|
22
|
+
bottom?: number;
|
|
23
|
+
left?: number;
|
|
24
|
+
}
|
|
25
|
+
/** Padding object covering both desktop and mobile breakpoints. */
|
|
26
|
+
export interface LegacyPadding {
|
|
27
|
+
desktop?: LegacyPaddingViewport;
|
|
28
|
+
mobile?: LegacyPaddingViewport;
|
|
29
|
+
}
|
|
30
|
+
/** Border-radius shape — observed in two flavours: shorthand or per-corner. */
|
|
31
|
+
export interface LegacyBorderRadius {
|
|
32
|
+
/** Single shorthand value (e.g. `radius: 4`). */
|
|
33
|
+
radius?: number;
|
|
34
|
+
/** Per-corner: top-left / top-right / bottom-right / bottom-left (in px). */
|
|
35
|
+
lt?: number;
|
|
36
|
+
rt?: number;
|
|
37
|
+
rb?: number;
|
|
38
|
+
lb?: number;
|
|
39
|
+
}
|
|
40
|
+
/** Theme attached to text-like variables (name, prices, omnibus, custom-attr). */
|
|
41
|
+
export interface LegacyTextTheme {
|
|
42
|
+
textStyle?: {
|
|
43
|
+
'font-family'?: string;
|
|
44
|
+
'font-size'?: string;
|
|
45
|
+
'font-weight'?: string;
|
|
46
|
+
'font-style'?: string;
|
|
47
|
+
};
|
|
48
|
+
textColor?: {
|
|
49
|
+
color?: string;
|
|
50
|
+
};
|
|
51
|
+
textBackgroundColor?: {
|
|
52
|
+
color?: string;
|
|
53
|
+
};
|
|
54
|
+
textPadding?: LegacyPadding;
|
|
55
|
+
textLineSpacing?: {
|
|
56
|
+
lineSpacing?: string;
|
|
57
|
+
'font-lineSpacing'?: string;
|
|
58
|
+
};
|
|
59
|
+
textAlign?: {
|
|
60
|
+
align?: string;
|
|
61
|
+
};
|
|
62
|
+
textTrimming?: boolean;
|
|
63
|
+
}
|
|
64
|
+
/** Theme attached to image variables. */
|
|
65
|
+
export interface LegacyImageTheme {
|
|
66
|
+
imageSize?: {
|
|
67
|
+
width?: number;
|
|
68
|
+
height?: number;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/** Theme attached to the button variable. */
|
|
72
|
+
export interface LegacyButtonTheme {
|
|
73
|
+
buttonStyle?: {
|
|
74
|
+
'font-family'?: string;
|
|
75
|
+
'font-size'?: string;
|
|
76
|
+
'font-weight'?: string;
|
|
77
|
+
'font-style'?: string;
|
|
78
|
+
};
|
|
79
|
+
buttonStretch?: {
|
|
80
|
+
stretched?: boolean;
|
|
81
|
+
};
|
|
82
|
+
buttonInternalPadding?: LegacyPadding;
|
|
83
|
+
buttonExternalPadding?: LegacyPadding;
|
|
84
|
+
buttonText?: {
|
|
85
|
+
text?: string;
|
|
86
|
+
};
|
|
87
|
+
buttonColor?: {
|
|
88
|
+
color?: string;
|
|
89
|
+
};
|
|
90
|
+
textButtonColor?: {
|
|
91
|
+
color?: string;
|
|
92
|
+
};
|
|
93
|
+
buttonBorder?: {
|
|
94
|
+
width?: LegacySides<number>;
|
|
95
|
+
style?: LegacySides<string>;
|
|
96
|
+
color?: LegacySides<string>;
|
|
97
|
+
};
|
|
98
|
+
buttonBorderRadius?: LegacyBorderRadius;
|
|
99
|
+
buttonAlign?: {
|
|
100
|
+
align?: string;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
/** Block-level theme. */
|
|
104
|
+
export interface LegacyBlockTheme {
|
|
105
|
+
blockAdapt?: {
|
|
106
|
+
adapt?: boolean;
|
|
107
|
+
};
|
|
108
|
+
blockPadding?: LegacyPadding;
|
|
109
|
+
}
|
|
110
|
+
/** Single composition.variable entry from `esd-dev-product-config`. */
|
|
111
|
+
export interface LegacyVariable {
|
|
112
|
+
/** e.g. `p_name`, `p_button`, `p_attribute_<ts>`. */
|
|
113
|
+
variable?: string;
|
|
114
|
+
/** Marker that distinguishes custom product attributes (`'p_attribute'`). */
|
|
115
|
+
variableType?: string;
|
|
116
|
+
/** Selector legacy used to address this element in the HTML. */
|
|
117
|
+
visibilityAreaSelector?: string;
|
|
118
|
+
/** Custom-attribute value (e.g. `product_attribute.brand`). */
|
|
119
|
+
value?: string;
|
|
120
|
+
/** Whether the element is hidden in the legacy block. */
|
|
121
|
+
hidden?: boolean;
|
|
122
|
+
/** Sort order across composition entries (lower = earlier). */
|
|
123
|
+
positionIdx?: number;
|
|
124
|
+
/** Element-kind-specific theme bag. */
|
|
125
|
+
theme?: LegacyTextTheme & LegacyImageTheme & LegacyButtonTheme;
|
|
126
|
+
/** Custom attribute marker. */
|
|
127
|
+
custom?: boolean;
|
|
128
|
+
}
|
|
129
|
+
/** Full decoded `esd-dev-product-config` shape. */
|
|
130
|
+
export interface LegacyProductConfig {
|
|
131
|
+
rowCount?: number;
|
|
132
|
+
totalCount?: number;
|
|
133
|
+
orientation?: string;
|
|
134
|
+
composition?: {
|
|
135
|
+
variables?: LegacyVariable[];
|
|
136
|
+
};
|
|
137
|
+
theme?: LegacyBlockTheme;
|
|
138
|
+
}
|
|
139
|
+
/** Element kind dispatched from a legacy `variable` value. */
|
|
140
|
+
export type ElementKind = 'image' | 'text' | 'button' | 'custom' | 'title';
|
|
141
|
+
/** Mapping output from a single legacy variable. */
|
|
142
|
+
export interface MappedVariable {
|
|
143
|
+
/** Composition key (`productName`, `customAttr:brand`, …) or `__title__` for titles. */
|
|
144
|
+
key: string;
|
|
145
|
+
kind: ElementKind;
|
|
146
|
+
hidden: boolean;
|
|
147
|
+
positionIdx: number;
|
|
148
|
+
/** Original legacy variable (kept for downstream theme mapping). */
|
|
149
|
+
legacy: LegacyVariable;
|
|
150
|
+
/** For custom attrs: bare attribute name (e.g. `brand`). */
|
|
151
|
+
customAttrName?: string;
|
|
152
|
+
/** For custom attrs: full `product-attr` value (e.g. `product_attribute.brand`). */
|
|
153
|
+
customAttrValue?: string;
|
|
154
|
+
}
|
|
155
|
+
/** CSS style strings + attributes resolved from a single text-like theme. */
|
|
156
|
+
export interface MappedTextStyle {
|
|
157
|
+
/** Inline CSS for outer `<td>` (background, padding). */
|
|
158
|
+
tdStyle: string;
|
|
159
|
+
/** Inline CSS for inner `<p>` (typography, color, line-height, text-align). */
|
|
160
|
+
pStyle: string;
|
|
161
|
+
/** Value for `<td align>` attribute, if any. */
|
|
162
|
+
align?: string;
|
|
163
|
+
/** Whether to wrap content in `<strong>`. */
|
|
164
|
+
wrapBold: boolean;
|
|
165
|
+
/** Whether to wrap content in `<em>`. */
|
|
166
|
+
wrapItalic: boolean;
|
|
167
|
+
/** True if `textTrimming: true` in theme. */
|
|
168
|
+
textTrimming: boolean;
|
|
169
|
+
}
|
|
170
|
+
/** Resolved button styles. */
|
|
171
|
+
export interface MappedButtonStyle {
|
|
172
|
+
/** Inline CSS for outer `<td>` (external padding). */
|
|
173
|
+
tdStyle: string;
|
|
174
|
+
/** Value for `<td align>`, if any. */
|
|
175
|
+
align?: string;
|
|
176
|
+
/** Inline CSS for `<span class="es-button-border">`. */
|
|
177
|
+
spanStyle: string;
|
|
178
|
+
/** Inline CSS for `<a class="es-button">`. */
|
|
179
|
+
aStyle: string;
|
|
180
|
+
/** Button label text. */
|
|
181
|
+
text?: string;
|
|
182
|
+
}
|
|
183
|
+
/** Resolved image styles. */
|
|
184
|
+
export interface MappedImageStyle {
|
|
185
|
+
/** Width in pixels (number form) — applied as both `width=` attr and CSS. */
|
|
186
|
+
width?: number;
|
|
187
|
+
/** Height in pixels. */
|
|
188
|
+
height?: number;
|
|
189
|
+
}
|
|
190
|
+
/** Per-variable mapped style bag, keyed by composition key. */
|
|
191
|
+
export type PerElementStyles = Record<string, MappedTextStyle | MappedButtonStyle | MappedImageStyle | undefined>;
|
|
192
|
+
/** Composition mapper output. */
|
|
193
|
+
export interface MappedComposition {
|
|
194
|
+
composition: string[];
|
|
195
|
+
visibility: Record<string, boolean>;
|
|
196
|
+
customAttributes: string[];
|
|
197
|
+
/** Mapping of customAttr key → full `product-attr` value. */
|
|
198
|
+
customAttrValues: Record<string, string>;
|
|
199
|
+
/** Title variable, if present (for separate title rendering). */
|
|
200
|
+
titleVariable?: LegacyVariable;
|
|
201
|
+
/** Resolved styles per composition key. */
|
|
202
|
+
perElementStyles: PerElementStyles;
|
|
203
|
+
/** Whether *any* element had `textTrimming: true`. */
|
|
204
|
+
anyTextTrimming: boolean;
|
|
205
|
+
}
|
|
@@ -1 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Idempotent: the selector matches only blocks that have
|
|
3
|
+
* `esd-dev-product-config` AND lack `recommendation-block-v2`, so
|
|
4
|
+
* re-running on a migrated template is a no-op.
|
|
5
|
+
*/
|
|
6
|
+
import type { LegacyRecommendationConfig } from '@@/Types/config';
|
|
7
|
+
/**
|
|
8
|
+
* Migrate all legacy Recommendation Blocks in the given HTML string.
|
|
9
|
+
* @param html - Full template HTML.
|
|
10
|
+
* @param recommendationConfigs - Map of campaign-id → legacy config (`Record<string, LegacyRecommendationConfig>`).
|
|
11
|
+
* @returns Migrated HTML, or the original HTML if no legacy blocks exist.
|
|
12
|
+
*/
|
|
13
|
+
export declare function migrateRecommendation(html: string, recommendationConfigs?: Record<string, LegacyRecommendationConfig>): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,6 +3,9 @@ import type { RecommendationFeedItem } from '@@/Types/recommendation';
|
|
|
3
3
|
export declare const URLS: {
|
|
4
4
|
RECOMMENDATION_API_URL: string;
|
|
5
5
|
};
|
|
6
|
+
export declare const QUERY_PARAMS: {
|
|
7
|
+
CLIENT_ID: string;
|
|
8
|
+
};
|
|
6
9
|
export declare const RecommendationFeedSourceMaps: RecommendationFeedItem[];
|
|
7
10
|
export declare const PriceAttributes: string[];
|
|
8
11
|
export declare const currencyLocationMaps: TextValueObject[];
|
|
@@ -3,3 +3,9 @@ export declare const UI_EDITOR_SELECTOR = "ui-editor";
|
|
|
3
3
|
export declare const CARD_COMPOSITION_TAB_SELECTOR = "button[role=\"tab\"][aria-label=\"Card Composition\"]";
|
|
4
4
|
export declare const SETTINGS_TAB_SELECTOR = "button[role=\"tab\"][aria-label=\"Settings\"]";
|
|
5
5
|
export declare const RIBBON_SELECTOR = ".in-ribbons-wrapper";
|
|
6
|
+
export declare const DYNAMIC_CONTENT_BUTTON_SELECTOR = "#guido__btn-add-dynamic-content";
|
|
7
|
+
export declare const AMP_TOGGLE_BUTTON_SELECTOR = ".guido__amp-toggle-html";
|
|
8
|
+
export declare const AMP_TOGGLE_WRAPPER_SELECTOR = ".in-segments-wrapper";
|
|
9
|
+
export declare const HEADER_SELECTOR = "[data-testid=\"guido-header\"]";
|
|
10
|
+
export declare const POPOVER_LEFT_OFFSET = 158;
|
|
11
|
+
export declare const POPOVER_TOP_GAP = 10;
|
|
@@ -12,6 +12,11 @@ export declare const URLS: {
|
|
|
12
12
|
UNSUBSCRIBE_URL: string;
|
|
13
13
|
PREFERENCES_URL: string;
|
|
14
14
|
};
|
|
15
|
+
export declare const PRODUCT_TYPE_URL_SEGMENTS: {
|
|
16
|
+
readonly 60: "email";
|
|
17
|
+
readonly 49: "journey";
|
|
18
|
+
readonly 97: "email";
|
|
19
|
+
};
|
|
15
20
|
export declare const INSIDER_ID = "iid";
|
|
16
21
|
export declare const DEFAULT_UNSUBSCRIBE_GROUP: {
|
|
17
22
|
readonly name: "Global Unsubscribe";
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export declare const COUPON_PLACEHOLDER_DEFAULT = "{@COUPON_CODE}";
|
|
2
|
+
export declare const COUPON_PLACEHOLDER_LIQUID = "{{ins_coupon_code}}";
|
|
1
3
|
declare const migrationTemplate = "\n <td\n class=\"coupon-block coupon-block-v2 ins-coupon-code esd-block-text esd-extension-block\"\n esd-extension-block-id=\"coupon-block\"\n >\n <p class=\"ins-title\" contenteditable=\"false\">{@COUPON_CODE}</p>\n </td>\n";
|
|
2
4
|
export declare function getDefaultTemplate(): string;
|
|
3
5
|
export default migrationTemplate;
|
|
@@ -63,5 +63,6 @@ export declare enum RecommendationControlId {
|
|
|
63
63
|
CUSTOM_ATTR_PADDINGS = "recommendation-block-custom-attr-paddings-control",
|
|
64
64
|
CUSTOM_ATTR_SIZE = "recommendation-block-custom-attr-size-control",
|
|
65
65
|
CUSTOM_ATTR_STYLE = "recommendation-block-custom-attr-style-control",
|
|
66
|
+
CUSTOM_ATTR_TEXT_TRIM = "recommendation-block-custom-attr-text-trim-control",
|
|
66
67
|
SYNC_INFO_MESSAGE = "recommendation-block-sync-info-message"
|
|
67
68
|
}
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export { RecommendationBlockId } from './blockIds';
|
|
10
10
|
export { RecommendationControlId } from './controlIds';
|
|
11
|
-
export { BLOCK_ROOT_SELECTOR, CONTAINER_SELECTOR, DESKTOP_CONTAINER_SELECTOR, MOBILE_CONTAINER_SELECTOR, MOBILE_ROW_SELECTOR, CURRENCY_ATTR, ATTR_PRODUCT_IMAGE, ATTR_PRODUCT_NAME, ATTR_PRODUCT_PRICE, ATTR_PRODUCT_OLD_PRICE, ATTR_PRODUCT_OMNIBUS_PRICE, ATTR_PRODUCT_OMNIBUS_DISCOUNT, ATTR_PRODUCT_BUTTON, ATTR_CUSTOM_PREFIX, ATTR_DATA_CUSTOM_ATTRIBUTES, ATTR_PRODUCT_ATTR, } from './selectors';
|
|
11
|
+
export { BLOCK_ROOT_SELECTOR, CONTAINER_SELECTOR, DESKTOP_CONTAINER_SELECTOR, MOBILE_CONTAINER_SELECTOR, MOBILE_ROW_SELECTOR, CURRENCY_ATTR, ATTR_PRODUCT_IMAGE, ATTR_PRODUCT_NAME, ATTR_PRODUCT_PRICE, ATTR_PRODUCT_OLD_PRICE, ATTR_PRODUCT_OMNIBUS_PRICE, ATTR_PRODUCT_OMNIBUS_DISCOUNT, ATTR_PRODUCT_BUTTON, ATTR_CUSTOM_PREFIX, ATTR_DATA_CUSTOM_ATTRIBUTES, ATTR_PRODUCT_ATTR, BUILT_IN_DEFAULT_ATTRIBUTES, } from './selectors';
|
|
12
12
|
export { LAYOUT_VALUES, LAYOUT_OPTIONS, DEFAULT_PRODUCTS_PER_ROW, DEFAULT_CARDS_IN_ROW, DEFAULT_MOBILE_CARDS_IN_ROW, MAX_PRODUCT_COUNT, MIN_PRODUCT_COUNT, MAX_PRODUCTS_PER_ROW, MIN_PRODUCTS_PER_ROW, MAX_MOBILE_PRODUCTS_PER_ROW, MIN_MOBILE_PRODUCTS_PER_ROW, DEFAULT_COLUMN_SPACING, DEFAULT_ROW_SPACING, DEFAULT_MOBILE_COLUMN_SPACING, DEFAULT_MOBILE_ROW_SPACING, MIN_SPACING, MAX_SPACING, SPACING_STEP, } from './layout';
|
|
13
13
|
export { DEFAULT_NODE_CONFIG, DEFAULT_CURRENCY, DEFAULT_COMPOSITION, DEFAULT_VISIBILITY, CURRENT_CONFIG_VERSION, EXCLUDED_ALGORITHM_IDS, } from './defaultConfig';
|
|
@@ -50,3 +50,8 @@ export declare const ATTR_CUSTOM_PREFIX = "customAttr:";
|
|
|
50
50
|
export declare const ATTR_DATA_CUSTOM_ATTRIBUTES = "data-custom-attributes";
|
|
51
51
|
/** HTML attribute on <td> elements identifying the product attribute for compiler template variable generation */
|
|
52
52
|
export declare const ATTR_PRODUCT_ATTR = "product-attr";
|
|
53
|
+
/**
|
|
54
|
+
* Default attribute names that are already represented by built-in composition toggle items.
|
|
55
|
+
* Used to exclude these from the custom attribute dropdown to prevent duplication with toggles.
|
|
56
|
+
*/
|
|
57
|
+
export declare const BUILT_IN_DEFAULT_ATTRIBUTES: Set<string>;
|
|
@@ -170,6 +170,11 @@ export declare class RecommendationCardCompositionControl extends CommonControl
|
|
|
170
170
|
* When filterList changes (e.g. after async fetch), re-renders dropdowns with new options.
|
|
171
171
|
*/
|
|
172
172
|
private _subscribeToStoreChanges;
|
|
173
|
+
/**
|
|
174
|
+
* Returns filters eligible for the custom attribute dropdown,
|
|
175
|
+
* excluding default attributes already covered by built-in toggle items.
|
|
176
|
+
*/
|
|
177
|
+
private _getAddableFilters;
|
|
173
178
|
/**
|
|
174
179
|
* Looks up the display name for an attribute from the store's filterList.
|
|
175
180
|
* Falls back to Title Case conversion of the snake_case attribute name.
|
|
@@ -13,10 +13,12 @@
|
|
|
13
13
|
* product cards — changing "brand" color won't affect "rating_star" color.
|
|
14
14
|
*/
|
|
15
15
|
import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
16
|
+
import { CustomAttributeTextTrimControl } from './textTrim';
|
|
16
17
|
/**
|
|
17
18
|
* Grouped Custom Attribute Controls
|
|
18
19
|
* Use this object for cleaner imports in extension.ts
|
|
19
20
|
*/
|
|
21
|
+
export { CustomAttributeTextTrimControl } from './textTrim';
|
|
20
22
|
export declare const CustomAttributeControls: {
|
|
21
23
|
readonly align: {
|
|
22
24
|
new (): {
|
|
@@ -102,4 +104,5 @@ export declare const CustomAttributeControls: {
|
|
|
102
104
|
isVisible(_node: ImmutableHtmlNode): boolean;
|
|
103
105
|
};
|
|
104
106
|
};
|
|
107
|
+
readonly textTrim: typeof CustomAttributeTextTrimControl;
|
|
105
108
|
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom Attribute Text Trim Control
|
|
3
|
+
*
|
|
4
|
+
* Per-attribute text trimming for custom product attributes.
|
|
5
|
+
* Unlike NameTextTrimControl which applies to ALL product names globally,
|
|
6
|
+
* this control is scoped to a specific custom attribute type via the
|
|
7
|
+
* `product-attr` HTML attribute — changing text-trim on "brand" won't
|
|
8
|
+
* affect "rating_star".
|
|
9
|
+
*
|
|
10
|
+
* CSS rules are shared with NameTextTrimControl via shared/textTrimCssRules.ts.
|
|
11
|
+
*/
|
|
12
|
+
import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
13
|
+
import { CommonControl } from '../../../common-control';
|
|
14
|
+
/**
|
|
15
|
+
* Control for enabling/disabling text trimming on individual custom attributes.
|
|
16
|
+
* Scoped per attribute type using the `product-attr` HTML attribute.
|
|
17
|
+
*/
|
|
18
|
+
export declare class CustomAttributeTextTrimControl extends CommonControl {
|
|
19
|
+
getId(): string;
|
|
20
|
+
getTemplate(): string;
|
|
21
|
+
onRender(): void;
|
|
22
|
+
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
23
|
+
_setFormValues(): void;
|
|
24
|
+
_getCurrentTrimState(): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Finds all custom attribute elements of the same type as the current node.
|
|
27
|
+
*
|
|
28
|
+
* Similar to getCustomAttrTargetNodes in customAttribute/index.ts, but adapted
|
|
29
|
+
* for CommonControl lifecycle where currentNode is a class property (not a
|
|
30
|
+
* parameter from Stripo's getTargetNodes override).
|
|
31
|
+
*/
|
|
32
|
+
_getTargetElements(): ImmutableHtmlNode[];
|
|
33
|
+
_onTextTrimChange(enabled: boolean): void;
|
|
34
|
+
_listenToFormUpdates(): void;
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
2
2
|
import { CommonControl } from '../../../common-control';
|
|
3
3
|
/**
|
|
4
|
-
* Control for enabling/disabling text trimming on product names
|
|
4
|
+
* Control for enabling/disabling text trimming on product names.
|
|
5
5
|
* When enabled, adds a CSS class that applies text-overflow: ellipsis
|
|
6
|
-
* and injects the required CSS rules into the document stylesheet
|
|
6
|
+
* and injects the required CSS rules into the document stylesheet.
|
|
7
7
|
*/
|
|
8
8
|
export declare class NameTextTrimControl extends CommonControl {
|
|
9
9
|
getId(): string;
|
|
@@ -12,23 +12,6 @@ export declare class NameTextTrimControl extends CommonControl {
|
|
|
12
12
|
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
13
13
|
_setFormValues(): void;
|
|
14
14
|
_getCurrentTrimState(): boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Finds an existing CSS rule in the document stylesheet by exact query
|
|
17
|
-
* @param query - The CSS query to search for (uses Stripo's CSS query syntax)
|
|
18
|
-
* @returns The CSS rule node if found, undefined otherwise
|
|
19
|
-
*/
|
|
20
|
-
_findCssRule(query: string): ImmutableCssNode | undefined;
|
|
21
|
-
/**
|
|
22
|
-
* Finds the .text-trim-enabled p rule by searching all text-trim rules and comparing selectors
|
|
23
|
-
* This is needed because Stripo's CSS query syntax interprets spaces as path separators
|
|
24
|
-
* @returns true if the rule exists
|
|
25
|
-
*/
|
|
26
|
-
_hasParagraphRule(): boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Ensures the text-trim CSS rules exist in the document stylesheet
|
|
29
|
-
* Only adds rules if they don't already exist (prevents duplicates across multiple blocks)
|
|
30
|
-
*/
|
|
31
|
-
_ensureCssRulesExist(): void;
|
|
32
15
|
_onTextTrimChange(enabled: boolean): void;
|
|
33
16
|
_listenToFormUpdates(): void;
|
|
34
17
|
}
|