@useinsider/guido 1.4.4-beta.9adffb8 → 1.4.4-beta.a48da7f

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.
Files changed (94) hide show
  1. package/README.md +295 -664
  2. package/dist/@types/config/defaults.js +44 -0
  3. package/dist/@types/config/schemas.js +243 -0
  4. package/dist/@types/config/validator.js +56 -0
  5. package/dist/components/Guido.vue.js +1 -1
  6. package/dist/components/Guido.vue2.js +63 -89
  7. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +13 -13
  8. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +5 -5
  9. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +13 -13
  10. package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
  11. package/dist/components/organisms/header/LeftSlot.vue2.js +18 -15
  12. package/dist/components/organisms/header/RightSlot.vue.js +10 -10
  13. package/dist/components/organisms/header/RightSlot.vue2.js +10 -10
  14. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +22 -19
  15. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.js +4 -4
  16. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue2.js +8 -8
  17. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +3 -3
  18. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +17 -17
  19. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +10 -10
  20. package/dist/composables/useBlocksConfig.js +23 -20
  21. package/dist/composables/useConfig.js +53 -5
  22. package/dist/composables/useHtmlCompiler.js +20 -19
  23. package/dist/composables/useHtmlValidator.js +41 -41
  24. package/dist/composables/usePartner.js +19 -9
  25. package/dist/composables/useSave.js +13 -11
  26. package/dist/composables/useStripo.js +11 -11
  27. package/dist/composables/useTranslations.js +3 -2
  28. package/dist/config/compiler/unsubscribeCompilerRules.js +1 -1
  29. package/dist/enums/defaults.js +3 -67
  30. package/dist/enums/unsubscribe.js +23 -20
  31. package/dist/extensions/Blocks/CouponBlock/extension.js +4 -5
  32. package/dist/extensions/Blocks/CouponBlock/settingsPanel.js +14 -20
  33. package/dist/extensions/Blocks/CouponBlock/template.js +11 -22
  34. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +12 -11
  35. package/dist/extensions/Blocks/Unsubscribe/extension.js +9 -9
  36. package/dist/extensions/Blocks/controlFactories.js +111 -122
  37. package/dist/guido.css +1 -1
  38. package/dist/library.js +12 -2
  39. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +52 -57
  40. package/dist/node_modules/lodash-es/_arrayLikeKeys.js +10 -10
  41. package/dist/node_modules/valibot/dist/index.js +476 -103
  42. package/dist/services/templateLibraryApi.js +18 -18
  43. package/dist/src/@types/config/defaults.d.ts +68 -0
  44. package/dist/src/@types/config/index.d.ts +14 -0
  45. package/dist/src/@types/config/schemas.d.ts +531 -0
  46. package/dist/src/@types/config/types.d.ts +148 -0
  47. package/dist/src/@types/config/validator.d.ts +119 -0
  48. package/dist/src/@types/generic.d.ts +4 -45
  49. package/dist/src/components/Guido.vue.d.ts +13 -12
  50. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  51. package/dist/src/composables/useConfig.d.ts +190 -2
  52. package/dist/src/composables/usePartner.d.ts +8 -0
  53. package/dist/src/enums/defaults.d.ts +4 -6
  54. package/dist/src/enums/unsubscribe.d.ts +5 -1
  55. package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +1 -1
  56. package/dist/src/extensions/Blocks/controlFactories.d.ts +7 -30
  57. package/dist/src/library.d.ts +3 -1
  58. package/dist/src/stores/config.d.ts +1691 -102
  59. package/dist/stores/config.js +148 -9
  60. package/package.json +1 -1
  61. package/dist/extensions/Blocks/CouponBlock/constants.js +0 -4
  62. package/dist/extensions/Blocks/CouponBlock/controls/index.js +0 -29
  63. package/dist/node_modules/lodash-es/_apply.js +0 -16
  64. package/dist/node_modules/lodash-es/_assignMergeValue.js +0 -8
  65. package/dist/node_modules/lodash-es/_assignValue.js +0 -10
  66. package/dist/node_modules/lodash-es/_baseAssignValue.js +0 -12
  67. package/dist/node_modules/lodash-es/_baseCreate.js +0 -17
  68. package/dist/node_modules/lodash-es/_baseKeysIn.js +0 -15
  69. package/dist/node_modules/lodash-es/_baseMerge.js +0 -20
  70. package/dist/node_modules/lodash-es/_baseMergeDeep.js +0 -31
  71. package/dist/node_modules/lodash-es/_baseRest.js +0 -9
  72. package/dist/node_modules/lodash-es/_baseSetToString.js +0 -14
  73. package/dist/node_modules/lodash-es/_cloneArrayBuffer.js +0 -8
  74. package/dist/node_modules/lodash-es/_cloneBuffer.js +0 -9
  75. package/dist/node_modules/lodash-es/_cloneTypedArray.js +0 -8
  76. package/dist/node_modules/lodash-es/_copyArray.js +0 -9
  77. package/dist/node_modules/lodash-es/_copyObject.js +0 -14
  78. package/dist/node_modules/lodash-es/_createAssigner.js +0 -15
  79. package/dist/node_modules/lodash-es/_defineProperty.js +0 -11
  80. package/dist/node_modules/lodash-es/_getPrototype.js +0 -5
  81. package/dist/node_modules/lodash-es/_initCloneObject.js +0 -9
  82. package/dist/node_modules/lodash-es/_nativeKeysIn.js +0 -10
  83. package/dist/node_modules/lodash-es/_overRest.js +0 -15
  84. package/dist/node_modules/lodash-es/_safeGet.js +0 -7
  85. package/dist/node_modules/lodash-es/_setToString.js +0 -6
  86. package/dist/node_modules/lodash-es/_shortOut.js +0 -16
  87. package/dist/node_modules/lodash-es/constant.js +0 -8
  88. package/dist/node_modules/lodash-es/isArrayLikeObject.js +0 -8
  89. package/dist/node_modules/lodash-es/isPlainObject.js +0 -16
  90. package/dist/node_modules/lodash-es/keysIn.js +0 -9
  91. package/dist/node_modules/lodash-es/merge.js +0 -8
  92. package/dist/node_modules/lodash-es/toPlainObject.js +0 -8
  93. package/dist/src/extensions/Blocks/CouponBlock/constants.d.ts +0 -14
  94. package/dist/src/extensions/Blocks/CouponBlock/controls/index.d.ts +0 -108
@@ -0,0 +1,531 @@
1
+ /**
2
+ * Guido Configuration Schemas
3
+ *
4
+ * Valibot schemas for validating and transforming Guido configuration.
5
+ * All types are inferred from these schemas to ensure single source of truth.
6
+ * @module @types/config/schemas
7
+ */
8
+ import type { SavedTemplateDetails } from '../stripo';
9
+ import * as v from 'valibot';
10
+ /**
11
+ * Handler function for external validation before save
12
+ * @param data - The template details to validate
13
+ * @returns Promise<boolean> - true if valid, false to cancel save
14
+ */
15
+ export type ExternalValidationHandler = (data: SavedTemplateDetails) => Promise<boolean>;
16
+ /**
17
+ * Message type constants for email templates
18
+ */
19
+ export declare const MessageType: {
20
+ /** Promotional/marketing emails */
21
+ readonly PROMOTIONAL: 1;
22
+ /** Transactional/system emails */
23
+ readonly TRANSACTIONAL: 2;
24
+ };
25
+ /**
26
+ * Product type constants for different Insider products
27
+ */
28
+ export declare const ProductType: {
29
+ /** Standard email campaigns */
30
+ readonly EMAIL: 60;
31
+ /** Architect journey builder */
32
+ readonly ARCHITECT: 49;
33
+ /** Unsubscribe page builder */
34
+ readonly UNSUBSCRIBE_PAGES: 97;
35
+ };
36
+ /**
37
+ * Identity configuration - identifies the template and user
38
+ */
39
+ export declare const IdentitySchema: v.ObjectSchema<{
40
+ /** Unique identifier for the template being edited */
41
+ readonly templateId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "templateId is required">]>;
42
+ /** Unique identifier for the user editing the template */
43
+ readonly userId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "userId is required">]>;
44
+ /** Optional variation ID for A/B testing */
45
+ readonly variationId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
46
+ }, undefined>;
47
+ /**
48
+ * Partner configuration - organization and product context
49
+ */
50
+ export declare const PartnerSchema: v.ObjectSchema<{
51
+ /** Partner/organization name (required) */
52
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "partner.name is required">]>;
53
+ /** Product type identifier */
54
+ readonly productType: v.OptionalSchema<v.PicklistSchema<[60, 49, 97], undefined>, 60>;
55
+ /** Message type (promotional or transactional) */
56
+ readonly messageType: v.OptionalSchema<v.PicklistSchema<[1, 2], undefined>, 1>;
57
+ /** Display name for the current user */
58
+ readonly username: v.OptionalSchema<v.StringSchema<undefined>, "Guido User">;
59
+ }, undefined>;
60
+ /**
61
+ * Dynamic content item schema
62
+ */
63
+ export declare const DynamicContentSchema: v.ObjectSchema<{
64
+ /** Display text for the dynamic content */
65
+ readonly text: v.StringSchema<undefined>;
66
+ /** Template variable value (e.g., {{username}}) */
67
+ readonly value: v.StringSchema<undefined>;
68
+ /** Fallback value if variable is empty */
69
+ readonly fallback: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
70
+ /** Optional formatting options */
71
+ readonly format: v.OptionalSchema<v.ObjectSchema<{
72
+ readonly key: v.StringSchema<undefined>;
73
+ readonly value: v.StringSchema<undefined>;
74
+ }, undefined>, undefined>;
75
+ }, undefined>;
76
+ /**
77
+ * Template configuration - initial content and preselected values
78
+ */
79
+ export declare const TemplateSchema: v.ObjectSchema<{
80
+ /** Initial HTML content */
81
+ readonly html: v.OptionalSchema<v.StringSchema<undefined>, "">;
82
+ /** Initial CSS content */
83
+ readonly css: v.OptionalSchema<v.StringSchema<undefined>, "">;
84
+ /** Preselected dynamic content items */
85
+ readonly preselectedDynamicContent: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
86
+ /** Display text for the dynamic content */
87
+ readonly text: v.StringSchema<undefined>;
88
+ /** Template variable value (e.g., {{username}}) */
89
+ readonly value: v.StringSchema<undefined>;
90
+ /** Fallback value if variable is empty */
91
+ readonly fallback: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
92
+ /** Optional formatting options */
93
+ readonly format: v.OptionalSchema<v.ObjectSchema<{
94
+ readonly key: v.StringSchema<undefined>;
95
+ readonly value: v.StringSchema<undefined>;
96
+ }, undefined>, undefined>;
97
+ }, undefined>, undefined>, readonly []>;
98
+ /** Selected unsubscribe page IDs */
99
+ readonly selectedUnsubscribePages: v.OptionalSchema<v.ArraySchema<v.NumberSchema<undefined>, undefined>, readonly []>;
100
+ }, undefined>;
101
+ /**
102
+ * Email header configuration (sender name and subject)
103
+ */
104
+ export declare const EmailHeaderSchema: v.ObjectSchema<{
105
+ /** Sender display name */
106
+ readonly senderName: v.OptionalSchema<v.StringSchema<undefined>, "">;
107
+ /** Email subject line */
108
+ readonly subject: v.OptionalSchema<v.StringSchema<undefined>, "">;
109
+ }, undefined>;
110
+ /**
111
+ * Editor configuration - core editor settings
112
+ */
113
+ export declare const EditorSchema: v.ObjectSchema<{
114
+ /** Locale for the editor UI */
115
+ readonly locale: v.OptionalSchema<v.StringSchema<undefined>, "en">;
116
+ /** Path to translations object */
117
+ readonly translationsPath: v.OptionalSchema<v.StringSchema<undefined>, "window.trans.en">;
118
+ /** Migration date for template compatibility */
119
+ readonly migrationDate: v.OptionalSchema<v.NumberSchema<undefined>, 1759696858>;
120
+ /** Email header settings */
121
+ readonly emailHeader: v.OptionalSchema<v.ObjectSchema<{
122
+ /** Sender display name */
123
+ readonly senderName: v.OptionalSchema<v.StringSchema<undefined>, "">;
124
+ /** Email subject line */
125
+ readonly subject: v.OptionalSchema<v.StringSchema<undefined>, "">;
126
+ }, undefined>, {
127
+ readonly senderName: "";
128
+ readonly subject: "";
129
+ }>;
130
+ }, undefined>;
131
+ /**
132
+ * UI configuration - visual elements and layout
133
+ */
134
+ export declare const UISchema: v.ObjectSchema<{
135
+ /** Whether to show the header bar */
136
+ readonly showHeader: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
137
+ /** Custom label for back button (if shown) */
138
+ readonly backButtonLabel: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
139
+ }, undefined>;
140
+ /**
141
+ * Features configuration - enable/disable editor features
142
+ */
143
+ export declare const FeaturesSchema: v.ObjectSchema<{
144
+ /** Enable dynamic content insertion */
145
+ readonly dynamicContent: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
146
+ /** Enable save as template functionality */
147
+ readonly saveAsTemplate: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
148
+ /** Enable version history */
149
+ readonly versionHistory: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
150
+ /** Enable test message sending */
151
+ readonly testMessage: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
152
+ /** Enable display conditions */
153
+ readonly displayConditions: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
154
+ /** Enable unsubscribe block */
155
+ readonly unsubscribe: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
156
+ }, undefined>;
157
+ /**
158
+ * Default block types available in Stripo
159
+ */
160
+ export declare const DefaultBlockTypeSchema: v.PicklistSchema<["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"], undefined>;
161
+ /**
162
+ * Custom block types added by Guido
163
+ */
164
+ export declare const CustomBlockTypeSchema: v.PicklistSchema<["dynamic-content", "checkbox-block", "radio-button-block", "recommendation-block", "unsubscribe-block", "coupon-block", "items-block"], undefined>;
165
+ /**
166
+ * Blocks configuration - include/exclude specific blocks
167
+ */
168
+ export declare const BlocksSchema: v.ObjectSchema<{
169
+ /** Default blocks to exclude from the editor */
170
+ readonly excludeDefaults: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["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"], undefined>, undefined>, readonly []>;
171
+ /** Custom blocks to include in the editor */
172
+ readonly includeCustoms: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["dynamic-content", "checkbox-block", "radio-button-block", "recommendation-block", "unsubscribe-block", "coupon-block", "items-block"], undefined>, undefined>, readonly []>;
173
+ }, undefined>;
174
+ /**
175
+ * Compiler rule types
176
+ */
177
+ export declare const CompilerRuleTypeSchema: v.PicklistSchema<["replace", "regex", "remove", "custom"], undefined>;
178
+ /**
179
+ * Replace rule - simple string replacement
180
+ */
181
+ export declare const ReplaceRuleSchema: v.ObjectSchema<{
182
+ readonly type: v.LiteralSchema<"replace", undefined>;
183
+ /** String to search for */
184
+ readonly search: v.StringSchema<undefined>;
185
+ /** Replacement string */
186
+ readonly replacement: v.StringSchema<undefined>;
187
+ /** Replace all occurrences (default: false) */
188
+ readonly replaceAll: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
189
+ /** Unique identifier for the rule */
190
+ readonly id: v.StringSchema<undefined>;
191
+ /** Human-readable description */
192
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
193
+ /** Priority for rule ordering (lower = earlier) */
194
+ readonly priority: v.NumberSchema<undefined>;
195
+ }, undefined>;
196
+ /**
197
+ * Regex rule - regular expression replacement
198
+ */
199
+ export declare const RegexRuleSchema: v.ObjectSchema<{
200
+ readonly type: v.LiteralSchema<"regex", undefined>;
201
+ /** Regex pattern string */
202
+ readonly pattern: v.StringSchema<undefined>;
203
+ /** Replacement string (supports $1, $2, etc.) */
204
+ readonly replacement: v.StringSchema<undefined>;
205
+ /** Regex flags (e.g., 'gi') */
206
+ readonly flags: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
207
+ /** Unique identifier for the rule */
208
+ readonly id: v.StringSchema<undefined>;
209
+ /** Human-readable description */
210
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
211
+ /** Priority for rule ordering (lower = earlier) */
212
+ readonly priority: v.NumberSchema<undefined>;
213
+ }, undefined>;
214
+ /**
215
+ * Remove rule - remove matching content
216
+ */
217
+ export declare const RemoveRuleSchema: v.ObjectSchema<{
218
+ readonly type: v.LiteralSchema<"remove", undefined>;
219
+ /** Strings or patterns to remove */
220
+ readonly targets: v.ArraySchema<v.StringSchema<undefined>, undefined>;
221
+ /** Unique identifier for the rule */
222
+ readonly id: v.StringSchema<undefined>;
223
+ /** Human-readable description */
224
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
225
+ /** Priority for rule ordering (lower = earlier) */
226
+ readonly priority: v.NumberSchema<undefined>;
227
+ }, undefined>;
228
+ /**
229
+ * Custom rule - custom processing function
230
+ * Note: Functions cannot be validated at runtime, this is for type safety
231
+ */
232
+ export declare const CustomRuleSchema: v.ObjectSchema<{
233
+ readonly type: v.LiteralSchema<"custom", undefined>;
234
+ /** Custom processor function */
235
+ readonly processor: v.CustomSchema<(html: string) => string, v.ErrorMessage<v.CustomIssue> | undefined>;
236
+ /** Unique identifier for the rule */
237
+ readonly id: v.StringSchema<undefined>;
238
+ /** Human-readable description */
239
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
240
+ /** Priority for rule ordering (lower = earlier) */
241
+ readonly priority: v.NumberSchema<undefined>;
242
+ }, undefined>;
243
+ /**
244
+ * Union of all compiler rule types
245
+ */
246
+ export declare const CompilerRuleSchema: v.VariantSchema<"type", [v.ObjectSchema<{
247
+ readonly type: v.LiteralSchema<"replace", undefined>;
248
+ /** String to search for */
249
+ readonly search: v.StringSchema<undefined>;
250
+ /** Replacement string */
251
+ readonly replacement: v.StringSchema<undefined>;
252
+ /** Replace all occurrences (default: false) */
253
+ readonly replaceAll: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
254
+ /** Unique identifier for the rule */
255
+ readonly id: v.StringSchema<undefined>;
256
+ /** Human-readable description */
257
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
258
+ /** Priority for rule ordering (lower = earlier) */
259
+ readonly priority: v.NumberSchema<undefined>;
260
+ }, undefined>, v.ObjectSchema<{
261
+ readonly type: v.LiteralSchema<"regex", undefined>;
262
+ /** Regex pattern string */
263
+ readonly pattern: v.StringSchema<undefined>;
264
+ /** Replacement string (supports $1, $2, etc.) */
265
+ readonly replacement: v.StringSchema<undefined>;
266
+ /** Regex flags (e.g., 'gi') */
267
+ readonly flags: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
268
+ /** Unique identifier for the rule */
269
+ readonly id: v.StringSchema<undefined>;
270
+ /** Human-readable description */
271
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
272
+ /** Priority for rule ordering (lower = earlier) */
273
+ readonly priority: v.NumberSchema<undefined>;
274
+ }, undefined>, v.ObjectSchema<{
275
+ readonly type: v.LiteralSchema<"remove", undefined>;
276
+ /** Strings or patterns to remove */
277
+ readonly targets: v.ArraySchema<v.StringSchema<undefined>, undefined>;
278
+ /** Unique identifier for the rule */
279
+ readonly id: v.StringSchema<undefined>;
280
+ /** Human-readable description */
281
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
282
+ /** Priority for rule ordering (lower = earlier) */
283
+ readonly priority: v.NumberSchema<undefined>;
284
+ }, undefined>, v.ObjectSchema<{
285
+ readonly type: v.LiteralSchema<"custom", undefined>;
286
+ /** Custom processor function */
287
+ readonly processor: v.CustomSchema<(html: string) => string, v.ErrorMessage<v.CustomIssue> | undefined>;
288
+ /** Unique identifier for the rule */
289
+ readonly id: v.StringSchema<undefined>;
290
+ /** Human-readable description */
291
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
292
+ /** Priority for rule ordering (lower = earlier) */
293
+ readonly priority: v.NumberSchema<undefined>;
294
+ }, undefined>], undefined>;
295
+ /**
296
+ * Compiler configuration - HTML compilation settings
297
+ */
298
+ export declare const CompilerSchema: v.ObjectSchema<{
299
+ /** Custom compiler rules to apply */
300
+ readonly customRules: v.OptionalSchema<v.ArraySchema<v.VariantSchema<"type", [v.ObjectSchema<{
301
+ readonly type: v.LiteralSchema<"replace", undefined>;
302
+ /** String to search for */
303
+ readonly search: v.StringSchema<undefined>;
304
+ /** Replacement string */
305
+ readonly replacement: v.StringSchema<undefined>;
306
+ /** Replace all occurrences (default: false) */
307
+ readonly replaceAll: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
308
+ /** Unique identifier for the rule */
309
+ readonly id: v.StringSchema<undefined>;
310
+ /** Human-readable description */
311
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
312
+ /** Priority for rule ordering (lower = earlier) */
313
+ readonly priority: v.NumberSchema<undefined>;
314
+ }, undefined>, v.ObjectSchema<{
315
+ readonly type: v.LiteralSchema<"regex", undefined>;
316
+ /** Regex pattern string */
317
+ readonly pattern: v.StringSchema<undefined>;
318
+ /** Replacement string (supports $1, $2, etc.) */
319
+ readonly replacement: v.StringSchema<undefined>;
320
+ /** Regex flags (e.g., 'gi') */
321
+ readonly flags: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
322
+ /** Unique identifier for the rule */
323
+ readonly id: v.StringSchema<undefined>;
324
+ /** Human-readable description */
325
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
326
+ /** Priority for rule ordering (lower = earlier) */
327
+ readonly priority: v.NumberSchema<undefined>;
328
+ }, undefined>, v.ObjectSchema<{
329
+ readonly type: v.LiteralSchema<"remove", undefined>;
330
+ /** Strings or patterns to remove */
331
+ readonly targets: v.ArraySchema<v.StringSchema<undefined>, undefined>;
332
+ /** Unique identifier for the rule */
333
+ readonly id: v.StringSchema<undefined>;
334
+ /** Human-readable description */
335
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
336
+ /** Priority for rule ordering (lower = earlier) */
337
+ readonly priority: v.NumberSchema<undefined>;
338
+ }, undefined>, v.ObjectSchema<{
339
+ readonly type: v.LiteralSchema<"custom", undefined>;
340
+ /** Custom processor function */
341
+ readonly processor: v.CustomSchema<(html: string) => string, v.ErrorMessage<v.CustomIssue> | undefined>;
342
+ /** Unique identifier for the rule */
343
+ readonly id: v.StringSchema<undefined>;
344
+ /** Human-readable description */
345
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
346
+ /** Priority for rule ordering (lower = earlier) */
347
+ readonly priority: v.NumberSchema<undefined>;
348
+ }, undefined>], undefined>, undefined>, readonly []>;
349
+ /** Skip default compiler rules */
350
+ readonly ignoreDefaultRules: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
351
+ }, undefined>;
352
+ /**
353
+ * Callbacks configuration - event handlers and hooks
354
+ */
355
+ export declare const CallbacksSchema: v.ObjectSchema<{
356
+ /**
357
+ * External validation handler called before save completes.
358
+ * Return false to cancel the save operation.
359
+ */
360
+ readonly externalValidation: v.OptionalSchema<v.CustomSchema<ExternalValidationHandler, v.ErrorMessage<v.CustomIssue> | undefined>, undefined>;
361
+ }, undefined>;
362
+ /**
363
+ * Complete Guido configuration schema
364
+ *
365
+ * Organized by domain:
366
+ * - identity: Who is editing what
367
+ * - partner: Organization context
368
+ * - template: Initial content
369
+ * - editor: Core editor settings
370
+ * - ui: Visual elements
371
+ * - features: Feature toggles
372
+ * - blocks: Block configuration
373
+ * - compiler: HTML compilation
374
+ * - callbacks: Event handlers and hooks
375
+ */
376
+ export declare const GuidoConfigSchema: v.ObjectSchema<{
377
+ /** Identity configuration (required) */
378
+ readonly identity: v.ObjectSchema<{
379
+ /** Unique identifier for the template being edited */
380
+ readonly templateId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "templateId is required">]>;
381
+ /** Unique identifier for the user editing the template */
382
+ readonly userId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "userId is required">]>;
383
+ /** Optional variation ID for A/B testing */
384
+ readonly variationId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
385
+ }, undefined>;
386
+ /** Partner configuration (required) */
387
+ readonly partner: v.ObjectSchema<{
388
+ /** Partner/organization name (required) */
389
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "partner.name is required">]>;
390
+ /** Product type identifier */
391
+ readonly productType: v.OptionalSchema<v.PicklistSchema<[60, 49, 97], undefined>, 60>;
392
+ /** Message type (promotional or transactional) */
393
+ readonly messageType: v.OptionalSchema<v.PicklistSchema<[1, 2], undefined>, 1>;
394
+ /** Display name for the current user */
395
+ readonly username: v.OptionalSchema<v.StringSchema<undefined>, "Guido User">;
396
+ }, undefined>;
397
+ /** Template content and presets */
398
+ readonly template: v.OptionalSchema<v.ObjectSchema<{
399
+ /** Initial HTML content */
400
+ readonly html: v.OptionalSchema<v.StringSchema<undefined>, "">;
401
+ /** Initial CSS content */
402
+ readonly css: v.OptionalSchema<v.StringSchema<undefined>, "">;
403
+ /** Preselected dynamic content items */
404
+ readonly preselectedDynamicContent: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
405
+ /** Display text for the dynamic content */
406
+ readonly text: v.StringSchema<undefined>;
407
+ /** Template variable value (e.g., {{username}}) */
408
+ readonly value: v.StringSchema<undefined>;
409
+ /** Fallback value if variable is empty */
410
+ readonly fallback: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
411
+ /** Optional formatting options */
412
+ readonly format: v.OptionalSchema<v.ObjectSchema<{
413
+ readonly key: v.StringSchema<undefined>;
414
+ readonly value: v.StringSchema<undefined>;
415
+ }, undefined>, undefined>;
416
+ }, undefined>, undefined>, readonly []>;
417
+ /** Selected unsubscribe page IDs */
418
+ readonly selectedUnsubscribePages: v.OptionalSchema<v.ArraySchema<v.NumberSchema<undefined>, undefined>, readonly []>;
419
+ }, undefined>, {}>;
420
+ /** Editor settings */
421
+ readonly editor: v.OptionalSchema<v.ObjectSchema<{
422
+ /** Locale for the editor UI */
423
+ readonly locale: v.OptionalSchema<v.StringSchema<undefined>, "en">;
424
+ /** Path to translations object */
425
+ readonly translationsPath: v.OptionalSchema<v.StringSchema<undefined>, "window.trans.en">;
426
+ /** Migration date for template compatibility */
427
+ readonly migrationDate: v.OptionalSchema<v.NumberSchema<undefined>, 1759696858>;
428
+ /** Email header settings */
429
+ readonly emailHeader: v.OptionalSchema<v.ObjectSchema<{
430
+ /** Sender display name */
431
+ readonly senderName: v.OptionalSchema<v.StringSchema<undefined>, "">;
432
+ /** Email subject line */
433
+ readonly subject: v.OptionalSchema<v.StringSchema<undefined>, "">;
434
+ }, undefined>, {
435
+ readonly senderName: "";
436
+ readonly subject: "";
437
+ }>;
438
+ }, undefined>, {}>;
439
+ /** UI configuration */
440
+ readonly ui: v.OptionalSchema<v.ObjectSchema<{
441
+ /** Whether to show the header bar */
442
+ readonly showHeader: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
443
+ /** Custom label for back button (if shown) */
444
+ readonly backButtonLabel: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
445
+ }, undefined>, {}>;
446
+ /** Feature toggles */
447
+ readonly features: v.OptionalSchema<v.ObjectSchema<{
448
+ /** Enable dynamic content insertion */
449
+ readonly dynamicContent: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
450
+ /** Enable save as template functionality */
451
+ readonly saveAsTemplate: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
452
+ /** Enable version history */
453
+ readonly versionHistory: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
454
+ /** Enable test message sending */
455
+ readonly testMessage: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
456
+ /** Enable display conditions */
457
+ readonly displayConditions: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
458
+ /** Enable unsubscribe block */
459
+ readonly unsubscribe: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
460
+ }, undefined>, {}>;
461
+ /** Block configuration */
462
+ readonly blocks: v.OptionalSchema<v.ObjectSchema<{
463
+ /** Default blocks to exclude from the editor */
464
+ readonly excludeDefaults: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["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"], undefined>, undefined>, readonly []>;
465
+ /** Custom blocks to include in the editor */
466
+ readonly includeCustoms: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["dynamic-content", "checkbox-block", "radio-button-block", "recommendation-block", "unsubscribe-block", "coupon-block", "items-block"], undefined>, undefined>, readonly []>;
467
+ }, undefined>, {}>;
468
+ /** Compiler configuration */
469
+ readonly compiler: v.OptionalSchema<v.ObjectSchema<{
470
+ /** Custom compiler rules to apply */
471
+ readonly customRules: v.OptionalSchema<v.ArraySchema<v.VariantSchema<"type", [v.ObjectSchema<{
472
+ readonly type: v.LiteralSchema<"replace", undefined>;
473
+ /** String to search for */
474
+ readonly search: v.StringSchema<undefined>;
475
+ /** Replacement string */
476
+ readonly replacement: v.StringSchema<undefined>;
477
+ /** Replace all occurrences (default: false) */
478
+ readonly replaceAll: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
479
+ /** Unique identifier for the rule */
480
+ readonly id: v.StringSchema<undefined>;
481
+ /** Human-readable description */
482
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
483
+ /** Priority for rule ordering (lower = earlier) */
484
+ readonly priority: v.NumberSchema<undefined>;
485
+ }, undefined>, v.ObjectSchema<{
486
+ readonly type: v.LiteralSchema<"regex", undefined>;
487
+ /** Regex pattern string */
488
+ readonly pattern: v.StringSchema<undefined>;
489
+ /** Replacement string (supports $1, $2, etc.) */
490
+ readonly replacement: v.StringSchema<undefined>;
491
+ /** Regex flags (e.g., 'gi') */
492
+ readonly flags: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
493
+ /** Unique identifier for the rule */
494
+ readonly id: v.StringSchema<undefined>;
495
+ /** Human-readable description */
496
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
497
+ /** Priority for rule ordering (lower = earlier) */
498
+ readonly priority: v.NumberSchema<undefined>;
499
+ }, undefined>, v.ObjectSchema<{
500
+ readonly type: v.LiteralSchema<"remove", undefined>;
501
+ /** Strings or patterns to remove */
502
+ readonly targets: v.ArraySchema<v.StringSchema<undefined>, undefined>;
503
+ /** Unique identifier for the rule */
504
+ readonly id: v.StringSchema<undefined>;
505
+ /** Human-readable description */
506
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
507
+ /** Priority for rule ordering (lower = earlier) */
508
+ readonly priority: v.NumberSchema<undefined>;
509
+ }, undefined>, v.ObjectSchema<{
510
+ readonly type: v.LiteralSchema<"custom", undefined>;
511
+ /** Custom processor function */
512
+ readonly processor: v.CustomSchema<(html: string) => string, v.ErrorMessage<v.CustomIssue> | undefined>;
513
+ /** Unique identifier for the rule */
514
+ readonly id: v.StringSchema<undefined>;
515
+ /** Human-readable description */
516
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
517
+ /** Priority for rule ordering (lower = earlier) */
518
+ readonly priority: v.NumberSchema<undefined>;
519
+ }, undefined>], undefined>, undefined>, readonly []>;
520
+ /** Skip default compiler rules */
521
+ readonly ignoreDefaultRules: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
522
+ }, undefined>, {}>;
523
+ /** Callbacks and event handlers */
524
+ readonly callbacks: v.OptionalSchema<v.ObjectSchema<{
525
+ /**
526
+ * External validation handler called before save completes.
527
+ * Return false to cancel the save operation.
528
+ */
529
+ readonly externalValidation: v.OptionalSchema<v.CustomSchema<ExternalValidationHandler, v.ErrorMessage<v.CustomIssue> | undefined>, undefined>;
530
+ }, undefined>, {}>;
531
+ }, undefined>;