@useinsider/guido 3.1.1-beta.f3b45b9 → 3.1.1-beta.f9482a3
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/dist/@types/config/schemas.js +61 -69
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +7 -7
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +20 -12
- package/dist/composables/useHtmlCompiler.js +20 -20
- package/dist/composables/usePreviewMode.js +16 -20
- package/dist/composables/useSave.js +13 -15
- package/dist/config/compiler/recommendationCompilerRules.js +152 -44
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +59 -58
- package/dist/config/migrator/checkboxMigrator.js +3 -5
- package/dist/config/migrator/radioButtonMigrator.js +12 -14
- package/dist/extensions/Blocks/Recommendation/block.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +11 -27
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +172 -185
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +93 -95
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +73 -75
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +5 -7
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +29 -30
- package/dist/extensions/Blocks/Recommendation/templates/index.js +7 -7
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +1 -3
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +20 -20
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +50 -57
- package/dist/extensions/Blocks/Recommendation/utils/tagName.js +6 -6
- package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +17 -16
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +218 -324
- package/dist/package.json.js +1 -1
- package/dist/src/@types/config/index.d.ts +1 -1
- package/dist/src/@types/config/schemas.d.ts +0 -20
- package/dist/src/@types/config/types.d.ts +1 -3
- package/dist/src/composables/useConfig.d.ts +0 -8
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +0 -5
- 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 +3 -20
- package/dist/src/stores/config.d.ts +0 -72
- package/dist/src/stores/preview.d.ts +0 -3
- package/dist/src/utils/htmlCompiler.d.ts +1 -2
- package/dist/stores/preview.js +3 -4
- package/dist/utils/htmlCompiler.js +41 -48
- package/dist/utils/templatePreparation.js +20 -20
- package/package.json +3 -3
package/dist/package.json.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* - Validation utilities
|
|
9
9
|
*/
|
|
10
10
|
export { MessageType, ProductType, GuidoConfigSchema, IdentitySchema, PartnerSchema, TemplateSchema, EditorSchema, UISchema, FeaturesSchema, BlocksSchema, CompilerSchema, CallbacksSchema, DynamicContentSchema, EmailHeaderSchema, DefaultBlockTypeSchema, CustomBlockTypeSchema, CompilerRuleSchema, CompilerRuleTypeSchema, ReplaceRuleSchema, RegexRuleSchema, RemoveRuleSchema, CustomRuleSchema, } from './schemas';
|
|
11
|
-
export type { GuidoConfig, GuidoConfigInput, IdentityConfig, IdentityConfigInput, PartnerConfig, PartnerConfigInput,
|
|
11
|
+
export type { GuidoConfig, GuidoConfigInput, IdentityConfig, IdentityConfigInput, PartnerConfig, PartnerConfigInput, TemplateConfig, TemplateConfigInput, EditorConfig, EditorConfigInput, UIConfig, UIConfigInput, FeaturesConfig, FeaturesConfigInput, BlocksConfig, BlocksConfigInput, CompilerConfig, CompilerConfigInput, CallbacksConfig, CallbacksConfigInput, ExternalValidationHandler, EmailHeader, DynamicContent, DefaultBlockType, CustomBlockType, BlockType, FeatureName, CompilerRule, ReplaceRule, RegexRule, RemoveRule, CustomRule, DeepPartial, ConfigOverrides, } from './types';
|
|
12
12
|
export { DEFAULT_EMAIL_HEADER, DEFAULT_TEMPLATE, DEFAULT_EDITOR, DEFAULT_UI, DEFAULT_FEATURES, DEFAULT_BLOCKS, DEFAULT_COMPILER, DEFAULT_PRODUCT_TYPE, DEFAULT_MESSAGE_TYPE, DEFAULT_USERNAME, EDITOR_TYPE, TEST_PARTNERS, isTestPartner, } from './defaults';
|
|
13
13
|
export { validateConfig, parseConfig, parseConfigSafe, getValidationErrors, isValidConfig, validateIdentity, validatePartner, } from './validator';
|
|
14
14
|
export type { ValidationResult, ValidationError, } from './validator';
|
|
@@ -47,12 +47,6 @@ export declare const IdentitySchema: v.ObjectSchema<{
|
|
|
47
47
|
/**
|
|
48
48
|
* Partner configuration - organization and product context
|
|
49
49
|
*/
|
|
50
|
-
export declare const FallbackFontSchema: v.ObjectSchema<{
|
|
51
|
-
/** Fallback font name (e.g., "Georgia") */
|
|
52
|
-
readonly name: v.StringSchema<undefined>;
|
|
53
|
-
/** Fallback font family (e.g., "serif" or "sans-serif") */
|
|
54
|
-
readonly family: v.StringSchema<undefined>;
|
|
55
|
-
}, undefined>;
|
|
56
50
|
export declare const PartnerSchema: v.ObjectSchema<{
|
|
57
51
|
/** Partner/organization name (required) */
|
|
58
52
|
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "partner.name is required">]>;
|
|
@@ -62,13 +56,6 @@ export declare const PartnerSchema: v.ObjectSchema<{
|
|
|
62
56
|
readonly messageType: v.OptionalSchema<v.PicklistSchema<[1, 2], undefined>, 1>;
|
|
63
57
|
/** Display name for the current user */
|
|
64
58
|
readonly username: v.OptionalSchema<v.StringSchema<undefined>, "Guido User">;
|
|
65
|
-
/** Fallback font settings from partner settings — used to match backend size calculation */
|
|
66
|
-
readonly fallbackFont: v.OptionalSchema<v.ObjectSchema<{
|
|
67
|
-
/** Fallback font name (e.g., "Georgia") */
|
|
68
|
-
readonly name: v.StringSchema<undefined>;
|
|
69
|
-
/** Fallback font family (e.g., "serif" or "sans-serif") */
|
|
70
|
-
readonly family: v.StringSchema<undefined>;
|
|
71
|
-
}, undefined>, undefined>;
|
|
72
59
|
}, undefined>;
|
|
73
60
|
/**
|
|
74
61
|
* Dynamic content item schema
|
|
@@ -416,13 +403,6 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
416
403
|
readonly messageType: v.OptionalSchema<v.PicklistSchema<[1, 2], undefined>, 1>;
|
|
417
404
|
/** Display name for the current user */
|
|
418
405
|
readonly username: v.OptionalSchema<v.StringSchema<undefined>, "Guido User">;
|
|
419
|
-
/** Fallback font settings from partner settings — used to match backend size calculation */
|
|
420
|
-
readonly fallbackFont: v.OptionalSchema<v.ObjectSchema<{
|
|
421
|
-
/** Fallback font name (e.g., "Georgia") */
|
|
422
|
-
readonly name: v.StringSchema<undefined>;
|
|
423
|
-
/** Fallback font family (e.g., "serif" or "sans-serif") */
|
|
424
|
-
readonly family: v.StringSchema<undefined>;
|
|
425
|
-
}, undefined>, undefined>;
|
|
426
406
|
}, undefined>;
|
|
427
407
|
/** Template content and presets */
|
|
428
408
|
readonly template: v.OptionalSchema<v.ObjectSchema<{
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* This ensures type definitions are always in sync with validation.
|
|
6
6
|
* @module @types/config/types
|
|
7
7
|
*/
|
|
8
|
-
import type { GuidoConfigSchema, IdentitySchema, PartnerSchema, TemplateSchema, EditorSchema, UISchema, FeaturesSchema, BlocksSchema, CompilerSchema, CallbacksSchema, DynamicContentSchema, EmailHeaderSchema, CompilerRuleSchema, ReplaceRuleSchema, RegexRuleSchema, RemoveRuleSchema, CustomRuleSchema, DefaultBlockTypeSchema, CustomBlockTypeSchema,
|
|
8
|
+
import type { GuidoConfigSchema, IdentitySchema, PartnerSchema, TemplateSchema, EditorSchema, UISchema, FeaturesSchema, BlocksSchema, CompilerSchema, CallbacksSchema, DynamicContentSchema, EmailHeaderSchema, CompilerRuleSchema, ReplaceRuleSchema, RegexRuleSchema, RemoveRuleSchema, CustomRuleSchema, DefaultBlockTypeSchema, CustomBlockTypeSchema, ExternalValidationHandler } from './schemas';
|
|
9
9
|
import type * as v from 'valibot';
|
|
10
10
|
/**
|
|
11
11
|
* Complete validated Guido configuration.
|
|
@@ -29,8 +29,6 @@ export type GuidoConfig = v.InferOutput<typeof GuidoConfigSchema>;
|
|
|
29
29
|
export type IdentityConfig = v.InferOutput<typeof IdentitySchema>;
|
|
30
30
|
/** Partner configuration (name, productType, messageType, username) */
|
|
31
31
|
export type PartnerConfig = v.InferOutput<typeof PartnerSchema>;
|
|
32
|
-
/** Fallback font settings for backend size calculation alignment */
|
|
33
|
-
export type FallbackFont = v.InferOutput<typeof FallbackFontSchema>;
|
|
34
32
|
/** Template configuration (html, css, dynamic content, unsubscribe pages) */
|
|
35
33
|
export type TemplateConfig = v.InferOutput<typeof TemplateSchema>;
|
|
36
34
|
/** Editor configuration (locale, translations, migration date, email header) */
|
|
@@ -17,10 +17,6 @@ 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;
|
|
24
20
|
};
|
|
25
21
|
template: {
|
|
26
22
|
html: string;
|
|
@@ -113,10 +109,6 @@ export declare const useConfig: () => {
|
|
|
113
109
|
productType: 60 | 49 | 97;
|
|
114
110
|
messageType: 1 | 2;
|
|
115
111
|
username: string;
|
|
116
|
-
fallbackFont?: {
|
|
117
|
-
name: string;
|
|
118
|
-
family: string;
|
|
119
|
-
} | undefined;
|
|
120
112
|
} | null>;
|
|
121
113
|
template: import("vue").ComputedRef<{
|
|
122
114
|
html: string;
|
|
@@ -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,
|
|
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';
|
|
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,8 +50,3 @@ 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,11 +170,6 @@ 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;
|
|
178
173
|
/**
|
|
179
174
|
* Looks up the display name for an attribute from the store's filterList.
|
|
180
175
|
* Falls back to Title Case conversion of the snake_case attribute name.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RecommendationProduct } from '@@/Types/recommendation';
|
|
2
2
|
import { type ElementRenderer } from '../utils';
|
|
3
3
|
/**
|
|
4
4
|
* Generates attribute-aligned product rows for grid layout.
|
|
@@ -9,7 +9,7 @@ import { type ElementRenderer } from '../utils';
|
|
|
9
9
|
* @param composition - Array defining order of card elements
|
|
10
10
|
* @returns HTML string for attribute-aligned rows
|
|
11
11
|
*/
|
|
12
|
-
export declare function prepareGridAttributeRows(products: RecommendationProduct[], productsPerRow: number, elementRenderer: ElementRenderer, composition?: string[]
|
|
12
|
+
export declare function prepareGridAttributeRows(products: RecommendationProduct[], productsPerRow: number, elementRenderer: ElementRenderer, composition?: string[]): string;
|
|
13
13
|
/**
|
|
14
14
|
* Prepares grid product rows with attribute-aligned structure
|
|
15
15
|
* Groups products into rows, then generates attribute-aligned HTML for each group
|
|
@@ -19,7 +19,7 @@ export declare function prepareGridAttributeRows(products: RecommendationProduct
|
|
|
19
19
|
* @param composition - Array defining order of card elements
|
|
20
20
|
* @returns HTML string for all product rows
|
|
21
21
|
*/
|
|
22
|
-
export declare function prepareGridProductRows(products: RecommendationProduct[], productsPerRow: number, elementRenderer: ElementRenderer, composition?: string[]
|
|
22
|
+
export declare function prepareGridProductRows(products: RecommendationProduct[], productsPerRow: number, elementRenderer: ElementRenderer, composition?: string[]): string;
|
|
23
23
|
/**
|
|
24
24
|
* Prepares grid product rows with attribute-aligned structure.
|
|
25
25
|
* Uses row-based rendering where each attribute type forms a single row across all products.
|
|
@@ -28,6 +28,6 @@ export declare function prepareGridProductRows(products: RecommendationProduct[]
|
|
|
28
28
|
* @param composition - Array defining element order
|
|
29
29
|
* @returns HTML string for product rows
|
|
30
30
|
*/
|
|
31
|
-
export declare function prepareProductRows(products: RecommendationProduct[], productsPerRow: number, composition?: string[]
|
|
31
|
+
export declare function prepareProductRows(products: RecommendationProduct[], productsPerRow: number, composition?: string[]): string;
|
|
32
32
|
export declare function getDefaultTemplate(recommendationId?: number): string;
|
|
33
33
|
export declare function generateBlockTemplate(products: RecommendationProduct[], productsPerRow: number, title?: string, composition?: string[], mobileProductsPerRow?: number): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RecommendationProduct } from '@@/Types/recommendation';
|
|
2
2
|
/**
|
|
3
3
|
* Generates a list product card with 3-column layout
|
|
4
4
|
* Uses buildElementRenderer to render Image, Info content, and Button
|
|
@@ -11,7 +11,7 @@ import type { FiltersResponse, RecommendationProduct } from '@@/Types/recommenda
|
|
|
11
11
|
* @param composition - Array defining order of card elements
|
|
12
12
|
* @returns HTML string for a single product card row
|
|
13
13
|
*/
|
|
14
|
-
export declare function getListProductCard(product: RecommendationProduct, composition?: string[]
|
|
14
|
+
export declare function getListProductCard(product: RecommendationProduct, composition?: string[]): string;
|
|
15
15
|
/**
|
|
16
16
|
* Prepares list product rows
|
|
17
17
|
* Each product is a full-width row with 3-column layout
|
|
@@ -19,6 +19,6 @@ export declare function getListProductCard(product: RecommendationProduct, compo
|
|
|
19
19
|
* @param composition - Array defining order of card elements
|
|
20
20
|
* @returns HTML string for product rows
|
|
21
21
|
*/
|
|
22
|
-
export declare function prepareProductRows(products: RecommendationProduct[], composition?: string[]
|
|
22
|
+
export declare function prepareProductRows(products: RecommendationProduct[], composition?: string[]): string;
|
|
23
23
|
export declare function getDefaultTemplate(): string;
|
|
24
24
|
export declare function generateBlockTemplate(products: RecommendationProduct[], title?: string, composition?: string[]): string;
|
|
@@ -1,29 +1,15 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RecommendationProduct } from '@@/Types/recommendation';
|
|
2
2
|
import { ATTR_PRODUCT_IMAGE, ATTR_PRODUCT_NAME, ATTR_PRODUCT_PRICE, ATTR_PRODUCT_OLD_PRICE, ATTR_PRODUCT_OMNIBUS_PRICE, ATTR_PRODUCT_OMNIBUS_DISCOUNT, ATTR_PRODUCT_BUTTON } from '../constants';
|
|
3
3
|
/**
|
|
4
4
|
* Converts a snake_case attribute name to Title Case display name.
|
|
5
5
|
* e.g., "rating_star" → "Rating Star"
|
|
6
6
|
*/
|
|
7
7
|
export declare function toDisplayName(attrName: string): string;
|
|
8
|
-
/**
|
|
9
|
-
* Checks whether an attribute is a default (top-level) product attribute
|
|
10
|
-
* vs a custom product attribute (nested under `product_attributes`).
|
|
11
|
-
* Returns false when filterList is empty or the attribute is not found.
|
|
12
|
-
*/
|
|
13
|
-
export declare function isDefaultAttribute(attrName: string, filterList: FiltersResponse): boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Resolves the `product-attr` HTML attribute value based on attribute type from the filter list.
|
|
16
|
-
* - Default attributes → attribute name directly (e.g., "brand") → compiles to `{{1_0_brand}}`
|
|
17
|
-
* - Product attributes → "product_attribute.<name>" (e.g., "product_attribute.rating_star")
|
|
18
|
-
*/
|
|
19
|
-
export declare function resolveProductAttrValue(attrName: string, filterList: FiltersResponse): string;
|
|
20
8
|
/**
|
|
21
9
|
* Callback that generates the cell HTML for a custom product attribute.
|
|
22
10
|
* Layout-specific: grid returns `<td>…`, list returns `<tr><td>…</td></tr>`.
|
|
23
|
-
* @param productAttrValue - The resolved `product-attr` value (e.g., "brand" or "product_attribute.rating_star")
|
|
24
|
-
* @param content - The display content for the cell
|
|
25
11
|
*/
|
|
26
|
-
export type CustomCellHtmlGetter = (
|
|
12
|
+
export type CustomCellHtmlGetter = (attrName: string, content: string) => string;
|
|
27
13
|
/**
|
|
28
14
|
* Symbol key for embedding custom attribute HTML in an ElementRenderer.
|
|
29
15
|
* Grid and list renderers store their custom-attribute cell template under this key
|
|
@@ -42,9 +28,8 @@ export declare const CUSTOM_CELL_HTML: unique symbol;
|
|
|
42
28
|
* alongside built-in ones, so template code can use a uniform lookup for all attributes.
|
|
43
29
|
* @param baseRenderer - The built-in element renderer (grid or list), must include a [CUSTOM_CELL_HTML] entry
|
|
44
30
|
* @param composition - Array of attribute keys including `customAttr:*` entries
|
|
45
|
-
* @param filterList - Filter list from the store, used to determine attribute type for correct product-attr resolution
|
|
46
31
|
*/
|
|
47
|
-
export declare function buildElementRenderer(baseRenderer: ElementRenderer, composition: string[]
|
|
32
|
+
export declare function buildElementRenderer(baseRenderer: ElementRenderer, composition: string[]): ElementRenderer;
|
|
48
33
|
export type Orientation = 'list' | 'grid';
|
|
49
34
|
/**
|
|
50
35
|
* Options for prepareProductRows unified function
|
|
@@ -56,8 +41,6 @@ export interface PrepareProductRowsOptions {
|
|
|
56
41
|
mobileProductsPerRow?: number;
|
|
57
42
|
/** Array defining order of card elements */
|
|
58
43
|
composition?: string[];
|
|
59
|
-
/** Filter list for attribute type resolution (default vs product attributes) */
|
|
60
|
-
filterList?: FiltersResponse;
|
|
61
44
|
}
|
|
62
45
|
/**
|
|
63
46
|
* Element renderer interface for product card elements.
|
|
@@ -22,10 +22,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
22
22
|
productType: 60 | 49 | 97;
|
|
23
23
|
messageType: 1 | 2;
|
|
24
24
|
username: string;
|
|
25
|
-
fallbackFont?: {
|
|
26
|
-
name: string;
|
|
27
|
-
family: string;
|
|
28
|
-
} | undefined;
|
|
29
25
|
};
|
|
30
26
|
template: {
|
|
31
27
|
html: string;
|
|
@@ -124,10 +120,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
124
120
|
productType: 60 | 49 | 97;
|
|
125
121
|
messageType: 1 | 2;
|
|
126
122
|
username: string;
|
|
127
|
-
fallbackFont?: {
|
|
128
|
-
name: string;
|
|
129
|
-
family: string;
|
|
130
|
-
} | undefined;
|
|
131
123
|
};
|
|
132
124
|
template: {
|
|
133
125
|
html: string;
|
|
@@ -226,10 +218,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
226
218
|
productType: 60 | 49 | 97;
|
|
227
219
|
messageType: 1 | 2;
|
|
228
220
|
username: string;
|
|
229
|
-
fallbackFont?: {
|
|
230
|
-
name: string;
|
|
231
|
-
family: string;
|
|
232
|
-
} | undefined;
|
|
233
221
|
};
|
|
234
222
|
template: {
|
|
235
223
|
html: string;
|
|
@@ -328,10 +316,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
328
316
|
productType: 60 | 49 | 97;
|
|
329
317
|
messageType: 1 | 2;
|
|
330
318
|
username: string;
|
|
331
|
-
fallbackFont?: {
|
|
332
|
-
name: string;
|
|
333
|
-
family: string;
|
|
334
|
-
} | undefined;
|
|
335
319
|
};
|
|
336
320
|
template: {
|
|
337
321
|
html: string;
|
|
@@ -430,10 +414,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
430
414
|
productType: 60 | 49 | 97;
|
|
431
415
|
messageType: 1 | 2;
|
|
432
416
|
username: string;
|
|
433
|
-
fallbackFont?: {
|
|
434
|
-
name: string;
|
|
435
|
-
family: string;
|
|
436
|
-
} | undefined;
|
|
437
417
|
};
|
|
438
418
|
template: {
|
|
439
419
|
html: string;
|
|
@@ -532,10 +512,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
532
512
|
productType: 60 | 49 | 97;
|
|
533
513
|
messageType: 1 | 2;
|
|
534
514
|
username: string;
|
|
535
|
-
fallbackFont?: {
|
|
536
|
-
name: string;
|
|
537
|
-
family: string;
|
|
538
|
-
} | undefined;
|
|
539
515
|
};
|
|
540
516
|
template: {
|
|
541
517
|
html: string;
|
|
@@ -634,10 +610,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
634
610
|
productType: 60 | 49 | 97;
|
|
635
611
|
messageType: 1 | 2;
|
|
636
612
|
username: string;
|
|
637
|
-
fallbackFont?: {
|
|
638
|
-
name: string;
|
|
639
|
-
family: string;
|
|
640
|
-
} | undefined;
|
|
641
613
|
};
|
|
642
614
|
template: {
|
|
643
615
|
html: string;
|
|
@@ -736,10 +708,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
736
708
|
productType: 60 | 49 | 97;
|
|
737
709
|
messageType: 1 | 2;
|
|
738
710
|
username: string;
|
|
739
|
-
fallbackFont?: {
|
|
740
|
-
name: string;
|
|
741
|
-
family: string;
|
|
742
|
-
} | undefined;
|
|
743
711
|
};
|
|
744
712
|
template: {
|
|
745
713
|
html: string;
|
|
@@ -838,10 +806,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
838
806
|
productType: 60 | 49 | 97;
|
|
839
807
|
messageType: 1 | 2;
|
|
840
808
|
username: string;
|
|
841
|
-
fallbackFont?: {
|
|
842
|
-
name: string;
|
|
843
|
-
family: string;
|
|
844
|
-
} | undefined;
|
|
845
809
|
};
|
|
846
810
|
template: {
|
|
847
811
|
html: string;
|
|
@@ -940,10 +904,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
940
904
|
productType: 60 | 49 | 97;
|
|
941
905
|
messageType: 1 | 2;
|
|
942
906
|
username: string;
|
|
943
|
-
fallbackFont?: {
|
|
944
|
-
name: string;
|
|
945
|
-
family: string;
|
|
946
|
-
} | undefined;
|
|
947
907
|
};
|
|
948
908
|
template: {
|
|
949
909
|
html: string;
|
|
@@ -1042,10 +1002,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1042
1002
|
productType: 60 | 49 | 97;
|
|
1043
1003
|
messageType: 1 | 2;
|
|
1044
1004
|
username: string;
|
|
1045
|
-
fallbackFont?: {
|
|
1046
|
-
name: string;
|
|
1047
|
-
family: string;
|
|
1048
|
-
} | undefined;
|
|
1049
1005
|
};
|
|
1050
1006
|
template: {
|
|
1051
1007
|
html: string;
|
|
@@ -1144,10 +1100,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1144
1100
|
productType: 60 | 49 | 97;
|
|
1145
1101
|
messageType: 1 | 2;
|
|
1146
1102
|
username: string;
|
|
1147
|
-
fallbackFont?: {
|
|
1148
|
-
name: string;
|
|
1149
|
-
family: string;
|
|
1150
|
-
} | undefined;
|
|
1151
1103
|
};
|
|
1152
1104
|
template: {
|
|
1153
1105
|
html: string;
|
|
@@ -1246,10 +1198,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1246
1198
|
productType: 60 | 49 | 97;
|
|
1247
1199
|
messageType: 1 | 2;
|
|
1248
1200
|
username: string;
|
|
1249
|
-
fallbackFont?: {
|
|
1250
|
-
name: string;
|
|
1251
|
-
family: string;
|
|
1252
|
-
} | undefined;
|
|
1253
1201
|
};
|
|
1254
1202
|
template: {
|
|
1255
1203
|
html: string;
|
|
@@ -1348,10 +1296,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1348
1296
|
productType: 60 | 49 | 97;
|
|
1349
1297
|
messageType: 1 | 2;
|
|
1350
1298
|
username: string;
|
|
1351
|
-
fallbackFont?: {
|
|
1352
|
-
name: string;
|
|
1353
|
-
family: string;
|
|
1354
|
-
} | undefined;
|
|
1355
1299
|
};
|
|
1356
1300
|
template: {
|
|
1357
1301
|
html: string;
|
|
@@ -1450,10 +1394,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1450
1394
|
productType: 60 | 49 | 97;
|
|
1451
1395
|
messageType: 1 | 2;
|
|
1452
1396
|
username: string;
|
|
1453
|
-
fallbackFont?: {
|
|
1454
|
-
name: string;
|
|
1455
|
-
family: string;
|
|
1456
|
-
} | undefined;
|
|
1457
1397
|
};
|
|
1458
1398
|
template: {
|
|
1459
1399
|
html: string;
|
|
@@ -1552,10 +1492,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1552
1492
|
productType: 60 | 49 | 97;
|
|
1553
1493
|
messageType: 1 | 2;
|
|
1554
1494
|
username: string;
|
|
1555
|
-
fallbackFont?: {
|
|
1556
|
-
name: string;
|
|
1557
|
-
family: string;
|
|
1558
|
-
} | undefined;
|
|
1559
1495
|
};
|
|
1560
1496
|
template: {
|
|
1561
1497
|
html: string;
|
|
@@ -1654,10 +1590,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1654
1590
|
productType: 60 | 49 | 97;
|
|
1655
1591
|
messageType: 1 | 2;
|
|
1656
1592
|
username: string;
|
|
1657
|
-
fallbackFont?: {
|
|
1658
|
-
name: string;
|
|
1659
|
-
family: string;
|
|
1660
|
-
} | undefined;
|
|
1661
1593
|
};
|
|
1662
1594
|
template: {
|
|
1663
1595
|
html: string;
|
|
@@ -1756,10 +1688,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1756
1688
|
productType: 60 | 49 | 97;
|
|
1757
1689
|
messageType: 1 | 2;
|
|
1758
1690
|
username: string;
|
|
1759
|
-
fallbackFont?: {
|
|
1760
|
-
name: string;
|
|
1761
|
-
family: string;
|
|
1762
|
-
} | undefined;
|
|
1763
1691
|
};
|
|
1764
1692
|
template: {
|
|
1765
1693
|
html: string;
|
|
@@ -7,7 +7,6 @@ export declare const usePreviewStore: import("pinia").StoreDefinition<"guidoPrev
|
|
|
7
7
|
templateHtml: string;
|
|
8
8
|
isLoaded: boolean;
|
|
9
9
|
isAMPErrorModalVisible: boolean;
|
|
10
|
-
emailSizeKB: number;
|
|
11
10
|
} & import("pinia").PiniaCustomStateProperties<PreviewState>) => boolean;
|
|
12
11
|
previewHtml(): string;
|
|
13
12
|
hasAMP: (state: {
|
|
@@ -17,7 +16,6 @@ export declare const usePreviewStore: import("pinia").StoreDefinition<"guidoPrev
|
|
|
17
16
|
templateHtml: string;
|
|
18
17
|
isLoaded: boolean;
|
|
19
18
|
isAMPErrorModalVisible: boolean;
|
|
20
|
-
emailSizeKB: number;
|
|
21
19
|
} & import("pinia").PiniaCustomStateProperties<PreviewState>) => boolean;
|
|
22
20
|
hasAMPErrors: (state: {
|
|
23
21
|
emailFormat: EmailFormat;
|
|
@@ -26,7 +24,6 @@ export declare const usePreviewStore: import("pinia").StoreDefinition<"guidoPrev
|
|
|
26
24
|
templateHtml: string;
|
|
27
25
|
isLoaded: boolean;
|
|
28
26
|
isAMPErrorModalVisible: boolean;
|
|
29
|
-
emailSizeKB: number;
|
|
30
27
|
} & import("pinia").PiniaCustomStateProperties<PreviewState>) => boolean;
|
|
31
28
|
showAMPErrorButton(): boolean;
|
|
32
29
|
isAMPResponsive(): boolean;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type { FallbackFont } from '@@/Types/config';
|
|
2
1
|
import type { CompilerRule, CompilationResult, HtmlCompiler } from '@@/Types/html-compiler';
|
|
3
2
|
export declare class HtmlCompilerEngine implements HtmlCompiler {
|
|
4
3
|
private rules;
|
|
5
4
|
constructor(rules?: CompilerRule[]);
|
|
6
|
-
compile(html: string, rules?: CompilerRule[]
|
|
5
|
+
compile(html: string, rules?: CompilerRule[]): CompilationResult;
|
|
7
6
|
private applyRule;
|
|
8
7
|
private applyReplaceRule;
|
|
9
8
|
private applyRegexRule;
|
package/dist/stores/preview.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { defineStore as e } from "pinia";
|
|
2
|
-
const
|
|
2
|
+
const s = () => ({
|
|
3
3
|
emailFormat: "html",
|
|
4
4
|
ampHtml: "",
|
|
5
5
|
ampErrors: [],
|
|
6
6
|
templateHtml: "",
|
|
7
7
|
isLoaded: !1,
|
|
8
|
-
isAMPErrorModalVisible: !1
|
|
9
|
-
emailSizeKB: 0
|
|
8
|
+
isAMPErrorModalVisible: !1
|
|
10
9
|
}), a = e("guidoPreview", {
|
|
11
|
-
state: () =>
|
|
10
|
+
state: () => s(),
|
|
12
11
|
getters: {
|
|
13
12
|
isAMPModeEnabled: (t) => t.emailFormat === "AMP",
|
|
14
13
|
previewHtml() {
|
|
@@ -1,77 +1,70 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { useToaster as
|
|
5
|
-
|
|
6
|
-
class T {
|
|
1
|
+
var y = Object.defineProperty;
|
|
2
|
+
var g = (p, e, r) => e in p ? y(p, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : p[e] = r;
|
|
3
|
+
var u = (p, e, r) => g(p, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { useToaster as m } from "../composables/useToaster.js";
|
|
5
|
+
class d {
|
|
7
6
|
constructor(e = []) {
|
|
8
|
-
|
|
7
|
+
u(this, "rules");
|
|
9
8
|
this.rules = e;
|
|
10
9
|
}
|
|
11
|
-
compile(e,
|
|
12
|
-
const
|
|
10
|
+
compile(e, r) {
|
|
11
|
+
const l = performance.now(), t = e, o = e.length;
|
|
13
12
|
let s = e;
|
|
14
|
-
const
|
|
15
|
-
(
|
|
16
|
-
const
|
|
17
|
-
s = this.applyRule(s,
|
|
13
|
+
const a = [];
|
|
14
|
+
(r || this.rules).sort((n, c) => n.priority - c.priority).forEach((n) => {
|
|
15
|
+
const c = s.length;
|
|
16
|
+
s = this.applyRule(s, n), s.length !== c && a.push(n.id);
|
|
18
17
|
});
|
|
19
|
-
const
|
|
20
|
-
let y = 0;
|
|
21
|
-
if (r && r.name && r.family) {
|
|
22
|
-
const p = (s.match(E) || []).length, a = `, ${r.name}, ${r.family}`;
|
|
23
|
-
y = p * new TextEncoder().encode(a).byteLength;
|
|
24
|
-
}
|
|
25
|
-
const g = Math.round((d + y) / 1024);
|
|
18
|
+
const i = s.length, R = o > 0 ? (o - i) / o * 100 : 0;
|
|
26
19
|
return {
|
|
27
|
-
originalHtml:
|
|
20
|
+
originalHtml: t,
|
|
28
21
|
compiledHtml: s,
|
|
29
|
-
appliedRules:
|
|
30
|
-
|
|
22
|
+
appliedRules: a,
|
|
23
|
+
// TODO: We can use stats for monitoring in the future
|
|
31
24
|
stats: {
|
|
32
|
-
originalSize:
|
|
33
|
-
compiledSize:
|
|
25
|
+
originalSize: o,
|
|
26
|
+
compiledSize: i,
|
|
34
27
|
reductionPercentage: R,
|
|
35
|
-
executionTime: performance.now() -
|
|
28
|
+
executionTime: performance.now() - l
|
|
36
29
|
}
|
|
37
30
|
};
|
|
38
31
|
}
|
|
39
|
-
applyRule(e,
|
|
32
|
+
applyRule(e, r) {
|
|
40
33
|
try {
|
|
41
|
-
switch (
|
|
34
|
+
switch (r.type) {
|
|
42
35
|
case "replace":
|
|
43
|
-
return this.applyReplaceRule(e,
|
|
36
|
+
return this.applyReplaceRule(e, r);
|
|
44
37
|
case "regex":
|
|
45
|
-
return this.applyRegexRule(e,
|
|
38
|
+
return this.applyRegexRule(e, r);
|
|
46
39
|
case "remove":
|
|
47
|
-
return this.applyRemoveRule(e,
|
|
40
|
+
return this.applyRemoveRule(e, r);
|
|
48
41
|
case "custom":
|
|
49
|
-
return this.applyCustomRule(e,
|
|
42
|
+
return this.applyCustomRule(e, r);
|
|
50
43
|
default:
|
|
51
44
|
return e;
|
|
52
45
|
}
|
|
53
|
-
} catch (
|
|
54
|
-
const { handleError:
|
|
55
|
-
return
|
|
46
|
+
} catch (l) {
|
|
47
|
+
const { handleError: t } = m();
|
|
48
|
+
return t(l, `Failed to apply rule ${r.id}:`), e;
|
|
56
49
|
}
|
|
57
50
|
}
|
|
58
|
-
applyReplaceRule(e,
|
|
59
|
-
const { search:
|
|
60
|
-
return
|
|
51
|
+
applyReplaceRule(e, r) {
|
|
52
|
+
const { search: l, replacement: t, replaceAll: o = !0 } = r;
|
|
53
|
+
return o ? e.replaceAll(l, t) : e.replace(l, t);
|
|
61
54
|
}
|
|
62
|
-
applyRegexRule(e,
|
|
63
|
-
const { pattern:
|
|
64
|
-
return e.replace(
|
|
55
|
+
applyRegexRule(e, r) {
|
|
56
|
+
const { pattern: l, replacement: t, flags: o = "g" } = r, s = new RegExp(l, o);
|
|
57
|
+
return e.replace(s, t);
|
|
65
58
|
}
|
|
66
|
-
applyRemoveRule(e,
|
|
67
|
-
return
|
|
59
|
+
applyRemoveRule(e, r) {
|
|
60
|
+
return r.targets.reduce((l, t) => t instanceof RegExp ? l.replace(t, "") : l.replaceAll(t, ""), e);
|
|
68
61
|
}
|
|
69
|
-
applyCustomRule(e,
|
|
70
|
-
return
|
|
62
|
+
applyCustomRule(e, r) {
|
|
63
|
+
return r.processor(e);
|
|
71
64
|
}
|
|
72
65
|
}
|
|
73
|
-
const
|
|
66
|
+
const A = (p = []) => new d(p);
|
|
74
67
|
export {
|
|
75
|
-
|
|
76
|
-
|
|
68
|
+
d as HtmlCompilerEngine,
|
|
69
|
+
A as createHtmlCompiler
|
|
77
70
|
};
|