@useinsider/guido 2.0.0-beta.dd0d492 → 2.0.0-beta.faa7c5d
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 +2 -0
- package/dist/@types/config/schemas.js +55 -39
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +15 -17
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +2 -2
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue.js +12 -12
- package/dist/components/organisms/header/LeftSlot.vue2.js +6 -6
- package/dist/components/organisms/header/RightSlot.vue2.js +10 -10
- package/dist/composables/useConfig.js +29 -27
- package/dist/composables/useSave.js +13 -11
- package/dist/composables/useStripo.js +40 -40
- package/dist/config/migrator/index.js +9 -8
- package/dist/config/migrator/itemsBlockMigrator.js +342 -0
- package/dist/extensions/Blocks/CouponBlock/constants.js +4 -0
- package/dist/extensions/Blocks/CouponBlock/controls/index.js +29 -0
- package/dist/extensions/Blocks/CouponBlock/extension.js +5 -4
- package/dist/extensions/Blocks/CouponBlock/settingsPanel.js +20 -14
- package/dist/extensions/Blocks/CouponBlock/template.js +22 -11
- package/dist/extensions/Blocks/Items/block.js +39 -40
- package/dist/extensions/Blocks/Items/controls/button/link.js +22 -29
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +66 -46
- package/dist/extensions/Blocks/Items/controls/image/link.js +23 -30
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +25 -25
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +19 -17
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +31 -29
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +36 -36
- package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +21 -19
- package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +29 -27
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +93 -0
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +152 -143
- package/dist/extensions/Blocks/Items/enums/controlEnums.js +2 -2
- package/dist/extensions/Blocks/Items/enums/productEnums.js +43 -45
- package/dist/extensions/Blocks/Items/enums/settingsEnums.js +4 -3
- package/dist/extensions/Blocks/Items/extension.js +7 -6
- package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +58 -49
- package/dist/extensions/Blocks/Items/layouts/vertical.html.js +48 -59
- package/dist/extensions/Blocks/Items/settingsPanel.js +27 -26
- package/dist/extensions/Blocks/Items/store/items-block.js +11 -7
- package/dist/extensions/Blocks/Items/template.js +366 -129
- package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +184 -0
- package/dist/extensions/Blocks/Recommendation/control.js +1 -1
- package/dist/extensions/Blocks/Unsubscribe/extension.js +9 -9
- package/dist/extensions/Blocks/common-control.js +29 -30
- package/dist/extensions/Blocks/controlFactories.js +139 -118
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +370 -286
- package/dist/package.json.js +1 -1
- package/dist/services/stripoApi.js +6 -10
- package/dist/src/@types/config/index.d.ts +2 -2
- package/dist/src/@types/config/schemas.d.ts +30 -0
- package/dist/src/@types/config/types.d.ts +7 -1
- package/dist/src/composables/useConfig.d.ts +8 -0
- package/dist/src/config/migrator/itemsBlockMigrator.d.ts +6 -0
- package/dist/src/extensions/Blocks/CouponBlock/constants.d.ts +14 -0
- package/dist/src/extensions/Blocks/CouponBlock/controls/index.d.ts +108 -0
- package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Items/controls/button/link.d.ts +0 -2
- package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +9 -0
- package/dist/src/extensions/Blocks/Items/controls/image/link.d.ts +0 -2
- package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +1 -1
- package/dist/src/extensions/Blocks/Items/controls/price/singlePrice.d.ts +18 -0
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +0 -4
- package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +24 -26
- package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +2 -0
- package/dist/src/extensions/Blocks/Items/template.d.ts +22 -1
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +73 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +9 -10
- package/dist/src/extensions/Blocks/controlFactories.d.ts +30 -7
- package/dist/src/stores/config.d.ts +164 -1
- package/dist/static/styles/components/button.css.js +1 -1
- package/dist/stores/config.js +7 -0
- package/dist/utils/pairProductVariables.js +61 -58
- package/package.json +3 -3
- package/dist/extensions/Blocks/Items/utils/configBlockUtils.js +0 -17
- package/dist/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.js +0 -28
- package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +0 -76
- package/dist/extensions/Blocks/Items/utils/updateAttributes.js +0 -46
- package/dist/src/extensions/Blocks/Items/utils/configBlockUtils.d.ts +0 -23
- package/dist/src/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.d.ts +0 -32
- package/dist/src/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.d.ts +0 -50
- package/dist/src/extensions/Blocks/Items/utils/updateAttributes.d.ts +0 -8
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { OrientationType, ProductType } from '@@/Types/extensions/items';
|
|
2
|
+
import { ImmutableHtmlNode, ImmutableHtmlElementNode, ControlApi, BlockApi } from '@stripoinc/ui-editor-extensions';
|
|
3
|
+
/**
|
|
4
|
+
* Typed configuration object for Items Block.
|
|
5
|
+
* Configuration is stored directly on the block node using Stripo V2's getNodeConfig/setNodeConfig API.
|
|
6
|
+
*/
|
|
7
|
+
export interface ItemsBlockConfig {
|
|
8
|
+
initialized: boolean;
|
|
9
|
+
blockInstanceId: string;
|
|
10
|
+
source: ProductType;
|
|
11
|
+
type: ProductType;
|
|
12
|
+
itemsSelectValue: string;
|
|
13
|
+
orientation: OrientationType;
|
|
14
|
+
nameTrimming: boolean;
|
|
15
|
+
nameControlEnabled: boolean;
|
|
16
|
+
priceHideDiscount: boolean;
|
|
17
|
+
priceFormatted: boolean;
|
|
18
|
+
priceSinglePrice: boolean;
|
|
19
|
+
priceCurrencySymbol: string;
|
|
20
|
+
priceCurrencyLocation: string;
|
|
21
|
+
priceControlOpened: boolean;
|
|
22
|
+
priceOrientation: 'vertical' | 'horizontal';
|
|
23
|
+
quantityControlEnabled: boolean;
|
|
24
|
+
buttonLink: string;
|
|
25
|
+
imageLink: string;
|
|
26
|
+
buttonLabel: string;
|
|
27
|
+
/** Whether button should be full width (true = es-fw class) or inline (false = es-il class) */
|
|
28
|
+
buttonFullWidth: boolean;
|
|
29
|
+
imageVisible: boolean;
|
|
30
|
+
nameVisible: boolean;
|
|
31
|
+
quantityVisible: boolean;
|
|
32
|
+
priceVisible: boolean;
|
|
33
|
+
originalPriceVisible: boolean;
|
|
34
|
+
buttonVisible: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Generates a unique block instance ID.
|
|
38
|
+
*/
|
|
39
|
+
export declare function generateBlockInstanceId(): string;
|
|
40
|
+
/**
|
|
41
|
+
* Returns default ItemsBlockConfig values.
|
|
42
|
+
* These are used when initializing a new block or when migrating from legacy format.
|
|
43
|
+
*/
|
|
44
|
+
export declare function getDefaultItemsBlockConfig(): ItemsBlockConfig;
|
|
45
|
+
/**
|
|
46
|
+
* Gets the Items block container element from the current node.
|
|
47
|
+
* The container is identified by the `.items-block-v2` class (new) or `.esd-cart-items-block` (legacy).
|
|
48
|
+
* @param currentNode - The current node from the control (usually this.currentNode)
|
|
49
|
+
* @returns The container element or null if not found
|
|
50
|
+
*/
|
|
51
|
+
export declare function getItemsBlockContainer(currentNode: ImmutableHtmlNode | undefined): ImmutableHtmlElementNode | null;
|
|
52
|
+
/**
|
|
53
|
+
* Gets the node configuration from the Items block.
|
|
54
|
+
* Uses Stripo V2's getNodeConfig() API.
|
|
55
|
+
* Falls back to migrating from legacy config block if nodeConfig is empty.
|
|
56
|
+
* @param currentNode - The current node from the control
|
|
57
|
+
* @returns The ItemsBlockConfig object or null if not found
|
|
58
|
+
*/
|
|
59
|
+
export declare function getItemsBlockConfig(currentNode: ImmutableHtmlNode | undefined): ItemsBlockConfig | null;
|
|
60
|
+
/**
|
|
61
|
+
* Sets the node configuration on the Items block.
|
|
62
|
+
* Uses Stripo V2's setNodeConfig() API.
|
|
63
|
+
* @param currentNode - The current node from the control
|
|
64
|
+
* @param api - The API object (ControlApi or BlockApi)
|
|
65
|
+
* @param config - The configuration to set (partial update supported)
|
|
66
|
+
*/
|
|
67
|
+
export declare function setItemsBlockConfig(currentNode: ImmutableHtmlNode | undefined, api: ControlApi | BlockApi, config: Partial<ItemsBlockConfig>): void;
|
|
68
|
+
/**
|
|
69
|
+
* Gets the block instance ID from the node config.
|
|
70
|
+
* @param currentNode - The current node from the control
|
|
71
|
+
* @returns The block instance ID or null if not found
|
|
72
|
+
*/
|
|
73
|
+
export declare function getBlockInstanceIdFromConfig(currentNode: ImmutableHtmlNode | undefined): string | null;
|
|
@@ -56,25 +56,24 @@ export declare abstract class CommonControl extends Control {
|
|
|
56
56
|
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
57
57
|
onDestroy(): void;
|
|
58
58
|
/**
|
|
59
|
-
* Gets the
|
|
60
|
-
* @returns The
|
|
59
|
+
* Gets the Items block container element from the current node.
|
|
60
|
+
* @returns The container element or null if not found
|
|
61
61
|
*/
|
|
62
|
-
protected
|
|
62
|
+
protected getItemsBlockContainer(): ImmutableHtmlElementNode | null;
|
|
63
63
|
/**
|
|
64
|
-
* Gets the current block instance ID from the config
|
|
65
|
-
* @param blockInstanceIdAttribute - The attribute name for block instance ID (default: 'data-block-instance-id')
|
|
64
|
+
* Gets the current block instance ID from the node config (Stripo V2).
|
|
66
65
|
* @returns The block instance ID or null if not found
|
|
67
66
|
*/
|
|
68
|
-
protected getBlockInstanceId(
|
|
67
|
+
protected getBlockInstanceId(): string | null;
|
|
69
68
|
/**
|
|
70
69
|
* Handles block instance change detection and syncing.
|
|
71
|
-
* This is a helper method for controls that need to sync
|
|
72
|
-
*
|
|
70
|
+
* This is a helper method for controls that need to sync config when switching between block instances.
|
|
71
|
+
* Uses Stripo V2 nodeConfig API for block instance tracking.
|
|
72
|
+
* @param syncFunction - Function to call when block instance changes (to sync from node config)
|
|
73
73
|
* @param updateUI - Function to call to update the UI (called both on change and when same block)
|
|
74
|
-
* @param blockInstanceIdAttribute - The attribute name for block instance ID (default: 'data-block-instance-id')
|
|
75
74
|
* @returns true if block instance changed, false otherwise
|
|
76
75
|
*/
|
|
77
|
-
protected handleBlockInstanceChange(syncFunction: (node: ImmutableHtmlNode) => void, updateUI: () => void
|
|
76
|
+
protected handleBlockInstanceChange(syncFunction: (node: ImmutableHtmlNode) => void, updateUI: () => void): boolean;
|
|
78
77
|
_GuLabel({ text, name, position }: LabelProps): string;
|
|
79
78
|
_GuToggle(name: string): string;
|
|
80
79
|
_GuSelectItem({ text, value }: {
|
|
@@ -12,8 +12,9 @@
|
|
|
12
12
|
import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
13
13
|
/**
|
|
14
14
|
* Factory function to create text align controls for different block elements
|
|
15
|
+
* When targetBlockId and containerSelector are not provided, applies directly to root
|
|
15
16
|
*/
|
|
16
|
-
export declare function createTextAlignControl(controlId: string, targetBlockId
|
|
17
|
+
export declare function createTextAlignControl(controlId: string, targetBlockId?: string, containerSelector?: string): {
|
|
17
18
|
new (): {
|
|
18
19
|
getId(): string;
|
|
19
20
|
getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
|
|
@@ -27,8 +28,9 @@ export declare function createTextAlignControl(controlId: string, targetBlockId:
|
|
|
27
28
|
};
|
|
28
29
|
/**
|
|
29
30
|
* Factory function to create text color controls for different block elements
|
|
31
|
+
* When targetBlockId and containerSelector are not provided, applies directly to root
|
|
30
32
|
*/
|
|
31
|
-
export declare function createTextColorControl(controlId: string, targetBlockId
|
|
33
|
+
export declare function createTextColorControl(controlId: string, targetBlockId?: string, containerSelector?: string): {
|
|
32
34
|
new (): {
|
|
33
35
|
getId(): string;
|
|
34
36
|
getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
|
|
@@ -42,8 +44,9 @@ export declare function createTextColorControl(controlId: string, targetBlockId:
|
|
|
42
44
|
};
|
|
43
45
|
/**
|
|
44
46
|
* Factory function to create text size controls for different block elements
|
|
47
|
+
* When targetBlockId and containerSelector are not provided, applies directly to root
|
|
45
48
|
*/
|
|
46
|
-
export declare function createTextSizeControl(controlId: string, targetBlockId
|
|
49
|
+
export declare function createTextSizeControl(controlId: string, targetBlockId?: string, containerSelector?: string): {
|
|
47
50
|
new (): {
|
|
48
51
|
getId(): string;
|
|
49
52
|
getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
|
|
@@ -57,8 +60,9 @@ export declare function createTextSizeControl(controlId: string, targetBlockId:
|
|
|
57
60
|
};
|
|
58
61
|
/**
|
|
59
62
|
* Factory function to create text style controls for different block elements
|
|
63
|
+
* When targetBlockId and containerSelector are not provided, applies directly to root
|
|
60
64
|
*/
|
|
61
|
-
export declare function createTextStyleControl(controlId: string, targetBlockId
|
|
65
|
+
export declare function createTextStyleControl(controlId: string, targetBlockId?: string, containerSelector?: string): {
|
|
62
66
|
new (): {
|
|
63
67
|
getId(): string;
|
|
64
68
|
getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
|
|
@@ -72,8 +76,9 @@ export declare function createTextStyleControl(controlId: string, targetBlockId:
|
|
|
72
76
|
};
|
|
73
77
|
/**
|
|
74
78
|
* Factory function to create text font family controls for different block elements
|
|
79
|
+
* When targetBlockId and containerSelector are not provided, applies directly to root
|
|
75
80
|
*/
|
|
76
|
-
export declare function createTextFontFamilyControl(controlId: string, targetBlockId
|
|
81
|
+
export declare function createTextFontFamilyControl(controlId: string, targetBlockId?: string, containerSelector?: string): {
|
|
77
82
|
new (): {
|
|
78
83
|
getId(): string;
|
|
79
84
|
getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
|
|
@@ -87,8 +92,9 @@ export declare function createTextFontFamilyControl(controlId: string, targetBlo
|
|
|
87
92
|
};
|
|
88
93
|
/**
|
|
89
94
|
* Factory function to create text background color controls for different block elements
|
|
95
|
+
* When targetBlockId and containerSelector are not provided, applies directly to root
|
|
90
96
|
*/
|
|
91
|
-
export declare function createTextBackgroundColorControl(controlId: string, targetBlockId
|
|
97
|
+
export declare function createTextBackgroundColorControl(controlId: string, targetBlockId?: string, containerSelector?: string): {
|
|
92
98
|
new (): {
|
|
93
99
|
getId(): string;
|
|
94
100
|
getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
|
|
@@ -102,8 +108,25 @@ export declare function createTextBackgroundColorControl(controlId: string, targ
|
|
|
102
108
|
};
|
|
103
109
|
/**
|
|
104
110
|
* Factory function to create paddings controls for different block elements
|
|
111
|
+
* When targetBlockId and containerSelector are not provided, applies directly to root
|
|
105
112
|
*/
|
|
106
|
-
export declare function createPaddingsControl(controlId: string, targetBlockId
|
|
113
|
+
export declare function createPaddingsControl(controlId: string, targetBlockId?: string, containerSelector?: string): {
|
|
114
|
+
new (): {
|
|
115
|
+
getId(): string;
|
|
116
|
+
getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
|
|
117
|
+
getParentControlId(): string;
|
|
118
|
+
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
119
|
+
getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
|
|
120
|
+
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
121
|
+
getAdditionalModifications(_root: ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
122
|
+
isVisible(_node: ImmutableHtmlNode): boolean;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* Factory function to create text line spacing controls for different block elements
|
|
127
|
+
* When targetBlockId and containerSelector are not provided, applies directly to root
|
|
128
|
+
*/
|
|
129
|
+
export declare function createTextLineSpacingControl(controlId: string, targetBlockId?: string, containerSelector?: string): {
|
|
107
130
|
new (): {
|
|
108
131
|
getId(): string;
|
|
109
132
|
getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GuidoConfig, GuidoConfigInput, IdentityConfig, PartnerConfig, TemplateConfig, EditorConfig, UIConfig, FeaturesConfig, BlocksConfig, CompilerConfig } from '@@/Types/config';
|
|
1
|
+
import type { GuidoConfig, GuidoConfigInput, IdentityConfig, PartnerConfig, TemplateConfig, EditorConfig, UIConfig, FeaturesConfig, BlocksConfig, CompilerConfig, CallbacksConfig } from '@@/Types/config';
|
|
2
2
|
interface ConfigStoreState {
|
|
3
3
|
/** Whether the config has been initialized */
|
|
4
4
|
initialized: boolean;
|
|
@@ -36,6 +36,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
36
36
|
} | undefined;
|
|
37
37
|
}[];
|
|
38
38
|
selectedUnsubscribePages: number[];
|
|
39
|
+
forceRecreate: boolean;
|
|
39
40
|
};
|
|
40
41
|
editor: {
|
|
41
42
|
locale: string;
|
|
@@ -95,6 +96,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
95
96
|
})[];
|
|
96
97
|
ignoreDefaultRules: boolean;
|
|
97
98
|
};
|
|
99
|
+
callbacks: {
|
|
100
|
+
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
101
|
+
};
|
|
98
102
|
} | null;
|
|
99
103
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => IdentityConfig | null;
|
|
100
104
|
/**
|
|
@@ -127,6 +131,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
127
131
|
} | undefined;
|
|
128
132
|
}[];
|
|
129
133
|
selectedUnsubscribePages: number[];
|
|
134
|
+
forceRecreate: boolean;
|
|
130
135
|
};
|
|
131
136
|
editor: {
|
|
132
137
|
locale: string;
|
|
@@ -186,6 +191,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
186
191
|
})[];
|
|
187
192
|
ignoreDefaultRules: boolean;
|
|
188
193
|
};
|
|
194
|
+
callbacks: {
|
|
195
|
+
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
196
|
+
};
|
|
189
197
|
} | null;
|
|
190
198
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => PartnerConfig | null;
|
|
191
199
|
/**
|
|
@@ -218,6 +226,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
218
226
|
} | undefined;
|
|
219
227
|
}[];
|
|
220
228
|
selectedUnsubscribePages: number[];
|
|
229
|
+
forceRecreate: boolean;
|
|
221
230
|
};
|
|
222
231
|
editor: {
|
|
223
232
|
locale: string;
|
|
@@ -277,6 +286,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
277
286
|
})[];
|
|
278
287
|
ignoreDefaultRules: boolean;
|
|
279
288
|
};
|
|
289
|
+
callbacks: {
|
|
290
|
+
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
291
|
+
};
|
|
280
292
|
} | null;
|
|
281
293
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => TemplateConfig | null;
|
|
282
294
|
/**
|
|
@@ -309,6 +321,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
309
321
|
} | undefined;
|
|
310
322
|
}[];
|
|
311
323
|
selectedUnsubscribePages: number[];
|
|
324
|
+
forceRecreate: boolean;
|
|
312
325
|
};
|
|
313
326
|
editor: {
|
|
314
327
|
locale: string;
|
|
@@ -368,6 +381,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
368
381
|
})[];
|
|
369
382
|
ignoreDefaultRules: boolean;
|
|
370
383
|
};
|
|
384
|
+
callbacks: {
|
|
385
|
+
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
386
|
+
};
|
|
371
387
|
} | null;
|
|
372
388
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => EditorConfig | null;
|
|
373
389
|
/**
|
|
@@ -400,6 +416,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
400
416
|
} | undefined;
|
|
401
417
|
}[];
|
|
402
418
|
selectedUnsubscribePages: number[];
|
|
419
|
+
forceRecreate: boolean;
|
|
403
420
|
};
|
|
404
421
|
editor: {
|
|
405
422
|
locale: string;
|
|
@@ -459,6 +476,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
459
476
|
})[];
|
|
460
477
|
ignoreDefaultRules: boolean;
|
|
461
478
|
};
|
|
479
|
+
callbacks: {
|
|
480
|
+
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
481
|
+
};
|
|
462
482
|
} | null;
|
|
463
483
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => UIConfig | null;
|
|
464
484
|
/**
|
|
@@ -491,6 +511,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
491
511
|
} | undefined;
|
|
492
512
|
}[];
|
|
493
513
|
selectedUnsubscribePages: number[];
|
|
514
|
+
forceRecreate: boolean;
|
|
494
515
|
};
|
|
495
516
|
editor: {
|
|
496
517
|
locale: string;
|
|
@@ -550,6 +571,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
550
571
|
})[];
|
|
551
572
|
ignoreDefaultRules: boolean;
|
|
552
573
|
};
|
|
574
|
+
callbacks: {
|
|
575
|
+
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
576
|
+
};
|
|
553
577
|
} | null;
|
|
554
578
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => FeaturesConfig | null;
|
|
555
579
|
/**
|
|
@@ -582,6 +606,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
582
606
|
} | undefined;
|
|
583
607
|
}[];
|
|
584
608
|
selectedUnsubscribePages: number[];
|
|
609
|
+
forceRecreate: boolean;
|
|
585
610
|
};
|
|
586
611
|
editor: {
|
|
587
612
|
locale: string;
|
|
@@ -641,6 +666,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
641
666
|
})[];
|
|
642
667
|
ignoreDefaultRules: boolean;
|
|
643
668
|
};
|
|
669
|
+
callbacks: {
|
|
670
|
+
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
671
|
+
};
|
|
644
672
|
} | null;
|
|
645
673
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => BlocksConfig | null;
|
|
646
674
|
/**
|
|
@@ -673,6 +701,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
673
701
|
} | undefined;
|
|
674
702
|
}[];
|
|
675
703
|
selectedUnsubscribePages: number[];
|
|
704
|
+
forceRecreate: boolean;
|
|
676
705
|
};
|
|
677
706
|
editor: {
|
|
678
707
|
locale: string;
|
|
@@ -732,8 +761,106 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
732
761
|
})[];
|
|
733
762
|
ignoreDefaultRules: boolean;
|
|
734
763
|
};
|
|
764
|
+
callbacks: {
|
|
765
|
+
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
766
|
+
};
|
|
735
767
|
} | null;
|
|
736
768
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => CompilerConfig | null;
|
|
769
|
+
/**
|
|
770
|
+
* Get the callbacks configuration
|
|
771
|
+
*/
|
|
772
|
+
callbacks: (state: {
|
|
773
|
+
initialized: boolean;
|
|
774
|
+
config: {
|
|
775
|
+
identity: {
|
|
776
|
+
templateId: string;
|
|
777
|
+
userId: string;
|
|
778
|
+
variationId?: string | undefined;
|
|
779
|
+
};
|
|
780
|
+
partner: {
|
|
781
|
+
name: string;
|
|
782
|
+
productType: 60 | 49 | 97;
|
|
783
|
+
messageType: 1 | 2;
|
|
784
|
+
username: string;
|
|
785
|
+
};
|
|
786
|
+
template: {
|
|
787
|
+
html: string;
|
|
788
|
+
css: string;
|
|
789
|
+
preselectedDynamicContent: {
|
|
790
|
+
text: string;
|
|
791
|
+
value: string;
|
|
792
|
+
fallback?: string | undefined;
|
|
793
|
+
format?: {
|
|
794
|
+
key: string;
|
|
795
|
+
value: string;
|
|
796
|
+
} | undefined;
|
|
797
|
+
}[];
|
|
798
|
+
selectedUnsubscribePages: number[];
|
|
799
|
+
forceRecreate: boolean;
|
|
800
|
+
};
|
|
801
|
+
editor: {
|
|
802
|
+
locale: string;
|
|
803
|
+
translationsPath: string;
|
|
804
|
+
migrationDate: number;
|
|
805
|
+
emailHeader: {
|
|
806
|
+
senderName: string;
|
|
807
|
+
subject: string;
|
|
808
|
+
};
|
|
809
|
+
};
|
|
810
|
+
ui: {
|
|
811
|
+
showHeader: boolean;
|
|
812
|
+
backButtonLabel?: string | undefined;
|
|
813
|
+
};
|
|
814
|
+
features: {
|
|
815
|
+
dynamicContent: boolean;
|
|
816
|
+
saveAsTemplate: boolean;
|
|
817
|
+
versionHistory: boolean;
|
|
818
|
+
testMessage: boolean;
|
|
819
|
+
displayConditions: boolean;
|
|
820
|
+
unsubscribe: boolean;
|
|
821
|
+
modulesDisabled: boolean;
|
|
822
|
+
};
|
|
823
|
+
blocks: {
|
|
824
|
+
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")[];
|
|
825
|
+
includeCustoms: ("dynamic-content" | "checkbox-block" | "radio-button-block" | "recommendation-block" | "unsubscribe-block" | "coupon-block" | "items-block")[];
|
|
826
|
+
};
|
|
827
|
+
compiler: {
|
|
828
|
+
customRules: ({
|
|
829
|
+
type: "replace";
|
|
830
|
+
search: string;
|
|
831
|
+
replacement: string;
|
|
832
|
+
replaceAll?: boolean | undefined;
|
|
833
|
+
id: string;
|
|
834
|
+
description?: string | undefined;
|
|
835
|
+
priority: number;
|
|
836
|
+
} | {
|
|
837
|
+
type: "regex";
|
|
838
|
+
pattern: string;
|
|
839
|
+
replacement: string;
|
|
840
|
+
flags?: string | undefined;
|
|
841
|
+
id: string;
|
|
842
|
+
description?: string | undefined;
|
|
843
|
+
priority: number;
|
|
844
|
+
} | {
|
|
845
|
+
type: "remove";
|
|
846
|
+
targets: string[];
|
|
847
|
+
id: string;
|
|
848
|
+
description?: string | undefined;
|
|
849
|
+
priority: number;
|
|
850
|
+
} | {
|
|
851
|
+
type: "custom";
|
|
852
|
+
processor: (html: string) => string;
|
|
853
|
+
id: string;
|
|
854
|
+
description?: string | undefined;
|
|
855
|
+
priority: number;
|
|
856
|
+
})[];
|
|
857
|
+
ignoreDefaultRules: boolean;
|
|
858
|
+
};
|
|
859
|
+
callbacks: {
|
|
860
|
+
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
861
|
+
};
|
|
862
|
+
} | null;
|
|
863
|
+
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => CallbacksConfig | null;
|
|
737
864
|
/**
|
|
738
865
|
* Get the template ID
|
|
739
866
|
*/
|
|
@@ -764,6 +891,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
764
891
|
} | undefined;
|
|
765
892
|
}[];
|
|
766
893
|
selectedUnsubscribePages: number[];
|
|
894
|
+
forceRecreate: boolean;
|
|
767
895
|
};
|
|
768
896
|
editor: {
|
|
769
897
|
locale: string;
|
|
@@ -823,6 +951,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
823
951
|
})[];
|
|
824
952
|
ignoreDefaultRules: boolean;
|
|
825
953
|
};
|
|
954
|
+
callbacks: {
|
|
955
|
+
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
956
|
+
};
|
|
826
957
|
} | null;
|
|
827
958
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
|
|
828
959
|
/**
|
|
@@ -855,6 +986,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
855
986
|
} | undefined;
|
|
856
987
|
}[];
|
|
857
988
|
selectedUnsubscribePages: number[];
|
|
989
|
+
forceRecreate: boolean;
|
|
858
990
|
};
|
|
859
991
|
editor: {
|
|
860
992
|
locale: string;
|
|
@@ -914,6 +1046,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
914
1046
|
})[];
|
|
915
1047
|
ignoreDefaultRules: boolean;
|
|
916
1048
|
};
|
|
1049
|
+
callbacks: {
|
|
1050
|
+
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
1051
|
+
};
|
|
917
1052
|
} | null;
|
|
918
1053
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
|
|
919
1054
|
/**
|
|
@@ -946,6 +1081,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
946
1081
|
} | undefined;
|
|
947
1082
|
}[];
|
|
948
1083
|
selectedUnsubscribePages: number[];
|
|
1084
|
+
forceRecreate: boolean;
|
|
949
1085
|
};
|
|
950
1086
|
editor: {
|
|
951
1087
|
locale: string;
|
|
@@ -1005,6 +1141,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1005
1141
|
})[];
|
|
1006
1142
|
ignoreDefaultRules: boolean;
|
|
1007
1143
|
};
|
|
1144
|
+
callbacks: {
|
|
1145
|
+
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
1146
|
+
};
|
|
1008
1147
|
} | null;
|
|
1009
1148
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
|
|
1010
1149
|
/**
|
|
@@ -1037,6 +1176,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1037
1176
|
} | undefined;
|
|
1038
1177
|
}[];
|
|
1039
1178
|
selectedUnsubscribePages: number[];
|
|
1179
|
+
forceRecreate: boolean;
|
|
1040
1180
|
};
|
|
1041
1181
|
editor: {
|
|
1042
1182
|
locale: string;
|
|
@@ -1096,6 +1236,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1096
1236
|
})[];
|
|
1097
1237
|
ignoreDefaultRules: boolean;
|
|
1098
1238
|
};
|
|
1239
|
+
callbacks: {
|
|
1240
|
+
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
1241
|
+
};
|
|
1099
1242
|
} | null;
|
|
1100
1243
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
|
|
1101
1244
|
/**
|
|
@@ -1128,6 +1271,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1128
1271
|
} | undefined;
|
|
1129
1272
|
}[];
|
|
1130
1273
|
selectedUnsubscribePages: number[];
|
|
1274
|
+
forceRecreate: boolean;
|
|
1131
1275
|
};
|
|
1132
1276
|
editor: {
|
|
1133
1277
|
locale: string;
|
|
@@ -1187,6 +1331,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1187
1331
|
})[];
|
|
1188
1332
|
ignoreDefaultRules: boolean;
|
|
1189
1333
|
};
|
|
1334
|
+
callbacks: {
|
|
1335
|
+
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
1336
|
+
};
|
|
1190
1337
|
} | null;
|
|
1191
1338
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => number;
|
|
1192
1339
|
/**
|
|
@@ -1219,6 +1366,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1219
1366
|
} | undefined;
|
|
1220
1367
|
}[];
|
|
1221
1368
|
selectedUnsubscribePages: number[];
|
|
1369
|
+
forceRecreate: boolean;
|
|
1222
1370
|
};
|
|
1223
1371
|
editor: {
|
|
1224
1372
|
locale: string;
|
|
@@ -1278,6 +1426,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1278
1426
|
})[];
|
|
1279
1427
|
ignoreDefaultRules: boolean;
|
|
1280
1428
|
};
|
|
1429
|
+
callbacks: {
|
|
1430
|
+
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
1431
|
+
};
|
|
1281
1432
|
} | null;
|
|
1282
1433
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => number;
|
|
1283
1434
|
/**
|
|
@@ -1310,6 +1461,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1310
1461
|
} | undefined;
|
|
1311
1462
|
}[];
|
|
1312
1463
|
selectedUnsubscribePages: number[];
|
|
1464
|
+
forceRecreate: boolean;
|
|
1313
1465
|
};
|
|
1314
1466
|
editor: {
|
|
1315
1467
|
locale: string;
|
|
@@ -1369,6 +1521,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1369
1521
|
})[];
|
|
1370
1522
|
ignoreDefaultRules: boolean;
|
|
1371
1523
|
};
|
|
1524
|
+
callbacks: {
|
|
1525
|
+
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
1526
|
+
};
|
|
1372
1527
|
} | null;
|
|
1373
1528
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
|
|
1374
1529
|
/**
|
|
@@ -1401,6 +1556,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1401
1556
|
} | undefined;
|
|
1402
1557
|
}[];
|
|
1403
1558
|
selectedUnsubscribePages: number[];
|
|
1559
|
+
forceRecreate: boolean;
|
|
1404
1560
|
};
|
|
1405
1561
|
editor: {
|
|
1406
1562
|
locale: string;
|
|
@@ -1460,6 +1616,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1460
1616
|
})[];
|
|
1461
1617
|
ignoreDefaultRules: boolean;
|
|
1462
1618
|
};
|
|
1619
|
+
callbacks: {
|
|
1620
|
+
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
1621
|
+
};
|
|
1463
1622
|
} | null;
|
|
1464
1623
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => boolean;
|
|
1465
1624
|
/**
|
|
@@ -1492,6 +1651,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1492
1651
|
} | undefined;
|
|
1493
1652
|
}[];
|
|
1494
1653
|
selectedUnsubscribePages: number[];
|
|
1654
|
+
forceRecreate: boolean;
|
|
1495
1655
|
};
|
|
1496
1656
|
editor: {
|
|
1497
1657
|
locale: string;
|
|
@@ -1551,6 +1711,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1551
1711
|
})[];
|
|
1552
1712
|
ignoreDefaultRules: boolean;
|
|
1553
1713
|
};
|
|
1714
|
+
callbacks: {
|
|
1715
|
+
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
1716
|
+
};
|
|
1554
1717
|
} | null;
|
|
1555
1718
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => (feature: keyof FeaturesConfig) => boolean;
|
|
1556
1719
|
}, {
|
package/dist/stores/config.js
CHANGED
|
@@ -64,6 +64,13 @@ const s = o("guido-config", {
|
|
|
64
64
|
var e;
|
|
65
65
|
return ((e = i.config) == null ? void 0 : e.compiler) ?? null;
|
|
66
66
|
},
|
|
67
|
+
/**
|
|
68
|
+
* Get the callbacks configuration
|
|
69
|
+
*/
|
|
70
|
+
callbacks: (i) => {
|
|
71
|
+
var e;
|
|
72
|
+
return ((e = i.config) == null ? void 0 : e.callbacks) ?? null;
|
|
73
|
+
},
|
|
67
74
|
/**
|
|
68
75
|
* Get the template ID
|
|
69
76
|
*/
|