@useinsider/guido 3.2.0-beta.caa22bf → 3.2.0-beta.ccaf9f5

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 (79) hide show
  1. package/README.md +0 -92
  2. package/dist/@types/config/schemas.js +94 -150
  3. package/dist/components/Guido.vue.js +1 -1
  4. package/dist/components/Guido.vue2.js +75 -75
  5. package/dist/composables/useCortexBlueprintBridge.js +38 -0
  6. package/dist/composables/useEmailTemplateApplier.js +41 -0
  7. package/dist/composables/useRecommendation.js +26 -46
  8. package/dist/composables/useSave.js +18 -21
  9. package/dist/composables/useStripo.js +16 -14
  10. package/dist/config/compiler/recommendationCompilerRules.js +27 -27
  11. package/dist/config/migrator/index.js +9 -9
  12. package/dist/config/migrator/radioButtonMigrator.js +44 -64
  13. package/dist/config/migrator/recommendationMigrator.js +290 -74
  14. package/dist/enums/displayConditions.js +80 -0
  15. package/dist/enums/extensions/recommendationBlock.js +1 -2
  16. package/dist/extensions/Blocks/RadioButton/template.js +1 -1
  17. package/dist/extensions/Blocks/Recommendation/block.js +32 -35
  18. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +5 -5
  19. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +24 -25
  20. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +181 -228
  21. package/dist/extensions/Blocks/Recommendation/services/configService.js +29 -65
  22. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +90 -130
  23. package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +251 -0
  24. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +8 -8
  25. package/dist/extensions/Blocks/Recommendation/templates/utils.js +1 -1
  26. package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +22 -13
  27. package/dist/guido.css +1 -1
  28. package/dist/node_modules/valibot/dist/index.js +235 -450
  29. package/dist/src/@types/config/defaults.d.ts +1 -5
  30. package/dist/src/@types/config/index.d.ts +3 -3
  31. package/dist/src/@types/config/schemas.d.ts +0 -213
  32. package/dist/src/@types/config/types.d.ts +1 -9
  33. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  34. package/dist/src/composables/useConfig.d.ts +0 -56
  35. package/dist/src/composables/useCortexBlueprintBridge.d.ts +17 -0
  36. package/dist/src/composables/useEmailTemplateApplier.d.ts +21 -0
  37. package/dist/src/composables/useRecommendation.d.ts +1 -10
  38. package/dist/src/config/migrator/index.d.ts +1 -2
  39. package/dist/src/config/migrator/recommendationMigrator.d.ts +1 -13
  40. package/dist/src/enums/displayConditions.d.ts +2 -0
  41. package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
  42. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +0 -10
  43. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -34
  44. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +1 -1
  45. package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +3 -0
  46. package/dist/src/library.d.ts +1 -1
  47. package/dist/src/stores/config.d.ts +0 -504
  48. package/dist/utils/templatePreparation.js +32 -72
  49. package/package.json +1 -5
  50. package/dist/composables/validators/useCouponBlockValidator.js +0 -24
  51. package/dist/config/migrator/recommendation/compositionMapper.js +0 -98
  52. package/dist/config/migrator/recommendation/extractors.js +0 -27
  53. package/dist/config/migrator/recommendation/htmlBuilder.js +0 -496
  54. package/dist/config/migrator/recommendation/parseLegacyConfig.js +0 -33
  55. package/dist/config/migrator/recommendation/settingsMapper.js +0 -70
  56. package/dist/config/migrator/recommendation/themeMapper.js +0 -93
  57. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMap.js +0 -21
  58. package/dist/src/composables/useRecommendation.test.d.ts +0 -1
  59. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +0 -3
  60. package/dist/src/config/migrator/recommendation/compositionMapper.d.ts +0 -2
  61. package/dist/src/config/migrator/recommendation/compositionMapper.test.d.ts +0 -1
  62. package/dist/src/config/migrator/recommendation/extractors.d.ts +0 -7
  63. package/dist/src/config/migrator/recommendation/extractors.test.d.ts +0 -1
  64. package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +0 -11
  65. package/dist/src/config/migrator/recommendation/parseLegacyConfig.d.ts +0 -15
  66. package/dist/src/config/migrator/recommendation/parseLegacyConfig.test.d.ts +0 -1
  67. package/dist/src/config/migrator/recommendation/settingsMapper.d.ts +0 -7
  68. package/dist/src/config/migrator/recommendation/settingsMapper.test.d.ts +0 -1
  69. package/dist/src/config/migrator/recommendation/themeMapper.d.ts +0 -5
  70. package/dist/src/config/migrator/recommendation/themeMapper.test.d.ts +0 -1
  71. package/dist/src/config/migrator/recommendation/types.d.ts +0 -205
  72. package/dist/src/config/migrator/recommendationMigrator.test.d.ts +0 -1
  73. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.test.d.ts +0 -1
  74. package/dist/src/extensions/Blocks/Recommendation/services/configService.test.d.ts +0 -1
  75. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.d.ts +0 -21
  76. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.test.d.ts +0 -1
  77. package/dist/src/utils/htmlEscape.d.ts +0 -5
  78. package/dist/src/utils/htmlEscape.test.d.ts +0 -1
  79. package/dist/utils/htmlEscape.js +0 -13
@@ -5,15 +5,11 @@
5
5
  * These are applied during validation when values are not provided.
6
6
  * @module @types/config/defaults
7
7
  */
8
- import type { TemplateConfig, TemplateMigrationConfig, EditorConfig, UIConfig, FeaturesConfig, BlocksConfig, CompilerConfig, EmailHeader } from './types';
8
+ import type { TemplateConfig, EditorConfig, UIConfig, FeaturesConfig, BlocksConfig, CompilerConfig, EmailHeader } from './types';
9
9
  /**
10
10
  * Default email header values
11
11
  */
12
12
  export declare const DEFAULT_EMAIL_HEADER: EmailHeader;
13
- /**
14
- * Default template migration configuration
15
- */
16
- export declare const DEFAULT_TEMPLATE_MIGRATION: TemplateMigrationConfig;
17
13
  /**
18
14
  * Default template configuration
19
15
  */
@@ -7,8 +7,8 @@
7
7
  * - Default values for optional configuration
8
8
  * - Validation utilities
9
9
  */
10
- export { MessageType, ProductType, GuidoConfigSchema, IdentitySchema, PartnerSchema, TemplateSchema, TemplateMigrationSchema, LegacyRecommendationConfigSchema, 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, FallbackFont, TemplateConfig, TemplateConfigInput, TemplateMigrationConfig, TemplateMigrationConfigInput, LegacyRecommendationConfig, LegacyRecommendationConfigInput, 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
- export { DEFAULT_EMAIL_HEADER, DEFAULT_TEMPLATE, DEFAULT_TEMPLATE_MIGRATION, 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';
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, FallbackFont, 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
+ 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';
@@ -86,117 +86,6 @@ export declare const DynamicContentSchema: v.ObjectSchema<{
86
86
  readonly value: v.StringSchema<undefined>;
87
87
  }, undefined>, undefined>;
88
88
  }, undefined>;
89
- /**
90
- * Legacy recommendation block config (v1 format) keyed by block ID.
91
- *
92
- * Used by the recommendation migrator to enrich migrated blocks with
93
- * filter, strategy, currency, language, and layout data that cannot be
94
- * fully recovered from the legacy HTML alone.
95
- *
96
- * `looseObject` is used because legacy partner data shapes vary
97
- * (e.g. some entries carry `verticalResponsiveness`, others `blockType`,
98
- * `orientation`, `size`). Unknown keys are preserved and forwarded to
99
- * the migrator unchanged.
100
- */
101
- export declare const LegacyRecommendationConfigSchema: v.LooseObjectSchema<{
102
- /** Block ID (matches the dictionary key and the legacy HTML element id) */
103
- readonly id: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
104
- /** Decimal places for price display (legacy data may use string or number) */
105
- readonly decimalCount: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
106
- /** Pinned product IDs (empty array when filter-driven) */
107
- readonly productIds: v.OptionalSchema<v.ArraySchema<v.UnknownSchema, undefined>, undefined>;
108
- /** Whether the block requested live products at send time */
109
- readonly sendProductRequestFlag: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
110
- /** Whether to randomize product order */
111
- readonly shuffleProducts: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
112
- /** Filter rules driving product selection */
113
- readonly filters: v.OptionalSchema<v.ArraySchema<v.UnknownSchema, undefined>, undefined>;
114
- /** Currency code (e.g. 'EUR') — sometimes absent in legacy data */
115
- readonly currency: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
116
- /** Currency display settings (separators, alignment, decimals) */
117
- readonly currencySettings: v.OptionalSchema<v.UnknownSchema, undefined>;
118
- /** Locale (e.g. 'nl_NL') */
119
- readonly language: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
120
- /** Recommendation strategy key (e.g. 'newArrivals') */
121
- readonly strategy: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
122
- /** Snapshot of products as rendered by the legacy block */
123
- readonly recommendedProducts: v.OptionalSchema<v.ArraySchema<v.UnknownSchema, undefined>, undefined>;
124
- /** Number of product cards per row */
125
- readonly cardsInRow: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
126
- /** Mobile-only padding (right) */
127
- readonly mobileRightPadding: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
128
- /** Mobile-only padding (left) */
129
- readonly mobileLeftPadding: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
130
- /** Disable responsive scaling */
131
- readonly unresponsive: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
132
- /** Layout orientation ('vertical' | 'horizontal') */
133
- readonly orientation: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
134
- /** Whether long text is trimmed */
135
- readonly textTrimming: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
136
- /** Block type marker used by some legacy variants */
137
- readonly blockType: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
138
- /** Size variant marker (legacy data may use string or number) */
139
- readonly size: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
140
- /** Vertical responsiveness flag (legacy size=1 variants) */
141
- readonly verticalResponsiveness: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
142
- }, undefined>;
143
- /**
144
- * Migration-only inputs scoped to this template.
145
- *
146
- * These fields are consumed by template migrators when upgrading
147
- * legacy block formats to current versions. They have no effect on
148
- * editor behavior once the template is in the current format.
149
- */
150
- export declare const TemplateMigrationSchema: v.ObjectSchema<{
151
- /**
152
- * Legacy recommendation block configs keyed by block ID.
153
- * Pass this when loading a template authored with the v1
154
- * recommendation block so the migrator can preserve filters,
155
- * strategy, currency, locale, and layout data.
156
- */
157
- readonly recommendationConfigs: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.LooseObjectSchema<{
158
- /** Block ID (matches the dictionary key and the legacy HTML element id) */
159
- readonly id: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
160
- /** Decimal places for price display (legacy data may use string or number) */
161
- readonly decimalCount: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
162
- /** Pinned product IDs (empty array when filter-driven) */
163
- readonly productIds: v.OptionalSchema<v.ArraySchema<v.UnknownSchema, undefined>, undefined>;
164
- /** Whether the block requested live products at send time */
165
- readonly sendProductRequestFlag: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
166
- /** Whether to randomize product order */
167
- readonly shuffleProducts: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
168
- /** Filter rules driving product selection */
169
- readonly filters: v.OptionalSchema<v.ArraySchema<v.UnknownSchema, undefined>, undefined>;
170
- /** Currency code (e.g. 'EUR') — sometimes absent in legacy data */
171
- readonly currency: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
172
- /** Currency display settings (separators, alignment, decimals) */
173
- readonly currencySettings: v.OptionalSchema<v.UnknownSchema, undefined>;
174
- /** Locale (e.g. 'nl_NL') */
175
- readonly language: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
176
- /** Recommendation strategy key (e.g. 'newArrivals') */
177
- readonly strategy: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
178
- /** Snapshot of products as rendered by the legacy block */
179
- readonly recommendedProducts: v.OptionalSchema<v.ArraySchema<v.UnknownSchema, undefined>, undefined>;
180
- /** Number of product cards per row */
181
- readonly cardsInRow: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
182
- /** Mobile-only padding (right) */
183
- readonly mobileRightPadding: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
184
- /** Mobile-only padding (left) */
185
- readonly mobileLeftPadding: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
186
- /** Disable responsive scaling */
187
- readonly unresponsive: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
188
- /** Layout orientation ('vertical' | 'horizontal') */
189
- readonly orientation: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
190
- /** Whether long text is trimmed */
191
- readonly textTrimming: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
192
- /** Block type marker used by some legacy variants */
193
- readonly blockType: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
194
- /** Size variant marker (legacy data may use string or number) */
195
- readonly size: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
196
- /** Vertical responsiveness flag (legacy size=1 variants) */
197
- readonly verticalResponsiveness: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
198
- }, undefined>, undefined>, {}>;
199
- }, undefined>;
200
89
  /**
201
90
  * Template configuration - initial content and preselected values
202
91
  */
@@ -225,57 +114,6 @@ export declare const TemplateSchema: v.ObjectSchema<{
225
114
  readonly selectedUnsubscribePages: v.OptionalSchema<v.ArraySchema<v.NumberSchema<undefined>, undefined>, readonly []>;
226
115
  /** Force recreate template in Stripo storage (use true when updating externally modified templates) */
227
116
  readonly forceRecreate: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
228
- /** Migration-only inputs (legacy block configs) */
229
- readonly migration: v.OptionalSchema<v.ObjectSchema<{
230
- /**
231
- * Legacy recommendation block configs keyed by block ID.
232
- * Pass this when loading a template authored with the v1
233
- * recommendation block so the migrator can preserve filters,
234
- * strategy, currency, locale, and layout data.
235
- */
236
- readonly recommendationConfigs: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.LooseObjectSchema<{
237
- /** Block ID (matches the dictionary key and the legacy HTML element id) */
238
- readonly id: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
239
- /** Decimal places for price display (legacy data may use string or number) */
240
- readonly decimalCount: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
241
- /** Pinned product IDs (empty array when filter-driven) */
242
- readonly productIds: v.OptionalSchema<v.ArraySchema<v.UnknownSchema, undefined>, undefined>;
243
- /** Whether the block requested live products at send time */
244
- readonly sendProductRequestFlag: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
245
- /** Whether to randomize product order */
246
- readonly shuffleProducts: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
247
- /** Filter rules driving product selection */
248
- readonly filters: v.OptionalSchema<v.ArraySchema<v.UnknownSchema, undefined>, undefined>;
249
- /** Currency code (e.g. 'EUR') — sometimes absent in legacy data */
250
- readonly currency: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
251
- /** Currency display settings (separators, alignment, decimals) */
252
- readonly currencySettings: v.OptionalSchema<v.UnknownSchema, undefined>;
253
- /** Locale (e.g. 'nl_NL') */
254
- readonly language: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
255
- /** Recommendation strategy key (e.g. 'newArrivals') */
256
- readonly strategy: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
257
- /** Snapshot of products as rendered by the legacy block */
258
- readonly recommendedProducts: v.OptionalSchema<v.ArraySchema<v.UnknownSchema, undefined>, undefined>;
259
- /** Number of product cards per row */
260
- readonly cardsInRow: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
261
- /** Mobile-only padding (right) */
262
- readonly mobileRightPadding: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
263
- /** Mobile-only padding (left) */
264
- readonly mobileLeftPadding: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
265
- /** Disable responsive scaling */
266
- readonly unresponsive: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
267
- /** Layout orientation ('vertical' | 'horizontal') */
268
- readonly orientation: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
269
- /** Whether long text is trimmed */
270
- readonly textTrimming: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
271
- /** Block type marker used by some legacy variants */
272
- readonly blockType: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
273
- /** Size variant marker (legacy data may use string or number) */
274
- readonly size: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
275
- /** Vertical responsiveness flag (legacy size=1 variants) */
276
- readonly verticalResponsiveness: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
277
- }, undefined>, undefined>, {}>;
278
- }, undefined>, {}>;
279
117
  }, undefined>;
280
118
  /**
281
119
  * Email header configuration (sender name and subject)
@@ -614,57 +452,6 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
614
452
  readonly selectedUnsubscribePages: v.OptionalSchema<v.ArraySchema<v.NumberSchema<undefined>, undefined>, readonly []>;
615
453
  /** Force recreate template in Stripo storage (use true when updating externally modified templates) */
616
454
  readonly forceRecreate: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
617
- /** Migration-only inputs (legacy block configs) */
618
- readonly migration: v.OptionalSchema<v.ObjectSchema<{
619
- /**
620
- * Legacy recommendation block configs keyed by block ID.
621
- * Pass this when loading a template authored with the v1
622
- * recommendation block so the migrator can preserve filters,
623
- * strategy, currency, locale, and layout data.
624
- */
625
- readonly recommendationConfigs: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.LooseObjectSchema<{
626
- /** Block ID (matches the dictionary key and the legacy HTML element id) */
627
- readonly id: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
628
- /** Decimal places for price display (legacy data may use string or number) */
629
- readonly decimalCount: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
630
- /** Pinned product IDs (empty array when filter-driven) */
631
- readonly productIds: v.OptionalSchema<v.ArraySchema<v.UnknownSchema, undefined>, undefined>;
632
- /** Whether the block requested live products at send time */
633
- readonly sendProductRequestFlag: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
634
- /** Whether to randomize product order */
635
- readonly shuffleProducts: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
636
- /** Filter rules driving product selection */
637
- readonly filters: v.OptionalSchema<v.ArraySchema<v.UnknownSchema, undefined>, undefined>;
638
- /** Currency code (e.g. 'EUR') — sometimes absent in legacy data */
639
- readonly currency: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
640
- /** Currency display settings (separators, alignment, decimals) */
641
- readonly currencySettings: v.OptionalSchema<v.UnknownSchema, undefined>;
642
- /** Locale (e.g. 'nl_NL') */
643
- readonly language: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
644
- /** Recommendation strategy key (e.g. 'newArrivals') */
645
- readonly strategy: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
646
- /** Snapshot of products as rendered by the legacy block */
647
- readonly recommendedProducts: v.OptionalSchema<v.ArraySchema<v.UnknownSchema, undefined>, undefined>;
648
- /** Number of product cards per row */
649
- readonly cardsInRow: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
650
- /** Mobile-only padding (right) */
651
- readonly mobileRightPadding: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
652
- /** Mobile-only padding (left) */
653
- readonly mobileLeftPadding: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
654
- /** Disable responsive scaling */
655
- readonly unresponsive: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
656
- /** Layout orientation ('vertical' | 'horizontal') */
657
- readonly orientation: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
658
- /** Whether long text is trimmed */
659
- readonly textTrimming: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
660
- /** Block type marker used by some legacy variants */
661
- readonly blockType: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
662
- /** Size variant marker (legacy data may use string or number) */
663
- readonly size: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
664
- /** Vertical responsiveness flag (legacy size=1 variants) */
665
- readonly verticalResponsiveness: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
666
- }, undefined>, undefined>, {}>;
667
- }, undefined>, {}>;
668
455
  }, undefined>, {}>;
669
456
  /** Editor settings */
670
457
  readonly editor: 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, TemplateMigrationSchema, LegacyRecommendationConfigSchema, EditorSchema, UISchema, FeaturesSchema, BlocksSchema, CompilerSchema, CallbacksSchema, DynamicContentSchema, EmailHeaderSchema, CompilerRuleSchema, ReplaceRuleSchema, RegexRuleSchema, RemoveRuleSchema, CustomRuleSchema, DefaultBlockTypeSchema, CustomBlockTypeSchema, FallbackFontSchema, ExternalValidationHandler } from './schemas';
8
+ import type { GuidoConfigSchema, IdentitySchema, PartnerSchema, TemplateSchema, EditorSchema, UISchema, FeaturesSchema, BlocksSchema, CompilerSchema, CallbacksSchema, DynamicContentSchema, EmailHeaderSchema, CompilerRuleSchema, ReplaceRuleSchema, RegexRuleSchema, RemoveRuleSchema, CustomRuleSchema, DefaultBlockTypeSchema, CustomBlockTypeSchema, FallbackFontSchema, ExternalValidationHandler } from './schemas';
9
9
  import type * as v from 'valibot';
10
10
  /**
11
11
  * Complete validated Guido configuration.
@@ -33,10 +33,6 @@ export type PartnerConfig = v.InferOutput<typeof PartnerSchema>;
33
33
  export type FallbackFont = v.InferOutput<typeof FallbackFontSchema>;
34
34
  /** Template configuration (html, css, dynamic content, unsubscribe pages) */
35
35
  export type TemplateConfig = v.InferOutput<typeof TemplateSchema>;
36
- /** Migration-only inputs scoped to a template */
37
- export type TemplateMigrationConfig = v.InferOutput<typeof TemplateMigrationSchema>;
38
- /** Legacy v1 recommendation block config (keyed by block ID in `recommendationConfigs`) */
39
- export type LegacyRecommendationConfig = v.InferOutput<typeof LegacyRecommendationConfigSchema>;
40
36
  /** Editor configuration (locale, translations, migration date, email header) */
41
37
  export type EditorConfig = v.InferOutput<typeof EditorSchema>;
42
38
  /** UI configuration (showHeader, backButtonLabel) */
@@ -85,10 +81,6 @@ export type IdentityConfigInput = v.InferInput<typeof IdentitySchema>;
85
81
  export type PartnerConfigInput = v.InferInput<typeof PartnerSchema>;
86
82
  /** Input type for template configuration */
87
83
  export type TemplateConfigInput = v.InferInput<typeof TemplateSchema>;
88
- /** Input type for template migration configuration */
89
- export type TemplateMigrationConfigInput = v.InferInput<typeof TemplateMigrationSchema>;
90
- /** Input type for a single legacy recommendation block config */
91
- export type LegacyRecommendationConfigInput = v.InferInput<typeof LegacyRecommendationConfigSchema>;
92
84
  /** Input type for editor configuration */
93
85
  export type EditorConfigInput = v.InferInput<typeof EditorSchema>;
94
86
  /** Input type for UI configuration */
@@ -32,8 +32,8 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
32
32
  closeOnOutsideClick: boolean;
33
33
  footerStatus: boolean;
34
34
  }>>>, {
35
- size: "X-small" | "small" | "medium" | "large";
36
35
  description: string;
36
+ size: "X-small" | "small" | "medium" | "large";
37
37
  closeOnOutsideClick: boolean;
38
38
  footerButtonOptions: FooterButtonGroup;
39
39
  closeButtonStatus: boolean;
@@ -37,34 +37,6 @@ export declare const useConfig: () => {
37
37
  customFieldAttributes: string[];
38
38
  selectedUnsubscribePages: number[];
39
39
  forceRecreate: boolean;
40
- migration: {
41
- recommendationConfigs: {
42
- [x: string]: {
43
- id?: number | undefined;
44
- decimalCount?: string | number | undefined;
45
- productIds?: unknown[] | undefined;
46
- sendProductRequestFlag?: boolean | undefined;
47
- shuffleProducts?: boolean | undefined;
48
- filters?: unknown[] | undefined;
49
- currency?: string | undefined;
50
- currencySettings?: unknown;
51
- language?: string | undefined;
52
- strategy?: string | undefined;
53
- recommendedProducts?: unknown[] | undefined;
54
- cardsInRow?: number | undefined;
55
- mobileRightPadding?: number | undefined;
56
- mobileLeftPadding?: number | undefined;
57
- unresponsive?: boolean | undefined;
58
- orientation?: string | undefined;
59
- textTrimming?: boolean | undefined;
60
- blockType?: string | undefined;
61
- size?: string | number | undefined;
62
- verticalResponsiveness?: boolean | undefined;
63
- } & {
64
- [key: string]: unknown;
65
- };
66
- };
67
- };
68
40
  };
69
41
  editor: {
70
42
  locale: string;
@@ -162,34 +134,6 @@ export declare const useConfig: () => {
162
134
  customFieldAttributes: string[];
163
135
  selectedUnsubscribePages: number[];
164
136
  forceRecreate: boolean;
165
- migration: {
166
- recommendationConfigs: {
167
- [x: string]: {
168
- id?: number | undefined;
169
- decimalCount?: string | number | undefined;
170
- productIds?: unknown[] | undefined;
171
- sendProductRequestFlag?: boolean | undefined;
172
- shuffleProducts?: boolean | undefined;
173
- filters?: unknown[] | undefined;
174
- currency?: string | undefined;
175
- currencySettings?: unknown;
176
- language?: string | undefined;
177
- strategy?: string | undefined;
178
- recommendedProducts?: unknown[] | undefined;
179
- cardsInRow?: number | undefined;
180
- mobileRightPadding?: number | undefined;
181
- mobileLeftPadding?: number | undefined;
182
- unresponsive?: boolean | undefined;
183
- orientation?: string | undefined;
184
- textTrimming?: boolean | undefined;
185
- blockType?: string | undefined;
186
- size?: string | number | undefined;
187
- verticalResponsiveness?: boolean | undefined;
188
- } & {
189
- [key: string]: unknown;
190
- };
191
- };
192
- };
193
137
  } | null>;
194
138
  editor: import("vue").ComputedRef<{
195
139
  locale: string;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Bridges cortex-fe's chat store to Guido's Stripo editor.
3
+ *
4
+ * cortex-fe is a Module Federation MFE that registers `defineStore('chat', …)`
5
+ * on the host's shared (singleton) Pinia. Guido — bundled inside MFE consumers
6
+ * that also share that pinia — reads the same store at runtime via
7
+ * `getActivePinia()._s.get('chat')`. No build-time dep on cortex-fe.
8
+ *
9
+ * On every `email_template` blueprint emitted by the agent stream:
10
+ * - first sighting of a blueprintId → applyTemplate immediately,
11
+ * - subsequent updates with new html → applyTemplateDebounced (250 ms trailing),
12
+ * - identical html is ignored so a streamed text chunk doesn't re-trigger Stripo.
13
+ *
14
+ * If cortex-fe isn't loaded (no `?cortex=true` in the URL), the chat store is
15
+ * undefined and the bridge is a no-op. That's the desired behavior.
16
+ */
17
+ export declare const useCortexBlueprintBridge: () => void;
@@ -0,0 +1,21 @@
1
+ type ApplyStatus = 'pending' | 'applying' | 'applied' | 'failed';
2
+ /**
3
+ * Applies email_template blueprints from the chat agent to the Stripo editor.
4
+ *
5
+ * - blueprint_create + manual Apply click: immediate.
6
+ * - blueprint_update: debounced 250 ms trailing so rapid mid-stream updates
7
+ * don't thrash updateHtmlAndCss.
8
+ */
9
+ export declare const useEmailTemplateApplier: () => {
10
+ applyStatus: import("vue").Ref<Record<string, ApplyStatus>>;
11
+ applyTemplate: (blueprintId: string, data: {
12
+ html?: string;
13
+ css?: string;
14
+ }) => void;
15
+ applyTemplateDebounced: (blueprintId: string, data: {
16
+ html?: string;
17
+ css?: string;
18
+ }) => void;
19
+ };
20
+ export declare const resetEmailTemplateApplier: () => void;
21
+ export {};
@@ -1,4 +1,3 @@
1
- import type { Filter } from '@@/Types/recommendation';
2
1
  type CardWidthParams = {
3
2
  mobileLeftPadding: number;
4
3
  mobileRightPadding: number;
@@ -16,14 +15,6 @@ interface CampaignData extends CardWidthParams {
16
15
  export declare const useRecommendation: () => {
17
16
  calculateCardWidth: ({ mobileLeftPadding, mobileRightPadding, cardsInRow, unresponsive, }: CardWidthParams) => number;
18
17
  getRecommendationCampaignData: (id: string) => CampaignData;
19
- buildCampaignUrl: (campaignId: string, overrides?: {
20
- strategy: string;
21
- language: string;
22
- currencyCode: string;
23
- size: string;
24
- productIds: string[];
25
- filters: Filter[];
26
- shuffleProducts: boolean;
27
- }) => string;
18
+ buildCampaignUrl: (campaignId: string) => string;
28
19
  };
29
20
  export {};
@@ -1,2 +1 @@
1
- import type { LegacyRecommendationConfig } from '@@/Types/config';
2
- export declare const migrate: (html: string, recommendationConfigs?: Record<string, LegacyRecommendationConfig>) => Promise<string>;
1
+ export declare const migrate: (html: string) => Promise<string>;
@@ -1,13 +1 @@
1
- /**
2
- * Idempotent: the selector matches only blocks that have
3
- * `esd-dev-product-config` AND lack `recommendation-block-v2`, so
4
- * re-running on a migrated template is a no-op.
5
- */
6
- import type { LegacyRecommendationConfig } from '@@/Types/config';
7
- /**
8
- * Migrate all legacy Recommendation Blocks in the given HTML string.
9
- * @param html - Full template HTML.
10
- * @param recommendationConfigs - Map of campaign-id → legacy config (`Record<string, LegacyRecommendationConfig>`).
11
- * @returns Migrated HTML, or the original HTML if no legacy blocks exist.
12
- */
13
- export declare function migrateRecommendation(html: string, recommendationConfigs?: Record<string, LegacyRecommendationConfig>): string;
1
+ export declare function migrateRecommendation(html: string): string;
@@ -0,0 +1,2 @@
1
+ import type { ConditionCategories } from '@@/Types/condition-categories';
2
+ export declare const displayConditions: ConditionCategories;
@@ -1,4 +1,4 @@
1
- declare const migrationTemplate = "\n <td\n align=\"left\"\n esd-extension-block-id=\"radio-button-block\"\n esd-handler-name=\"esd-extension-RadioButtonBlock\"\n class=\"\n radio-button\n radio-button-v2\n esd-block-ra\n esd-radio-button-block\n esd-extension-block\n es-p10t\n es-p10b\n es-p30r\n es-p30l\"\n >\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"left\" width=\"70%\" style=\"vertical-align: top;\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n {-{-TITLE-}-}\n </tr>\n <tr>\n {-{-DESCRIPTION-}-}\n </tr>\n </tbody>\n </table>\n </td>\n <td align=\"right\" width=\"30%\" style=\"vertical-align: middle;\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td width=\"50%\">\n <table width=\"100%\">\n <tr>\n <td width=\"24\">\n <input\n type=\"radio\"\n id=\"radioYes\"\n name=\"unsubscribe\"\n data-cke-editable=\"1\"\n style=\"margin: 0px; vertical-align: middle;\">\n </td>\n {-{-YES-}-}\n </tr>\n </table>\n </td>\n <td width=\"50%\">\n <table width=\"100%\">\n <tr>\n <td width=\"24\">\n <input\n type=\"radio\"\n id=\"radioNo\"\n name=\"unsubscribe\"\n data-cke-editable=\"1\"\n style=\"margin: 0px; vertical-align: middle;\">\n </td>\n {-{-NO-}-}\n </tr>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n";
1
+ declare const migrationTemplate = "\n <td\n align=\"left\"\n esd-extension-block-id=\"radio-button-block\"\n esd-handler-name=\"esd-extension-RadioButtonBlock\"\n class=\"\n radio-button\n radio-button-v2\n esd-block-ra\n esd-radio-button-block\n esd-extension-block\n es-p10t\n es-p10b\n es-p30r\n es-p30l\"\n >\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"left\" width=\"70%\" style=\"vertical-align: top;\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n {-{-TITLE-}-}\n </tr>\n <tr>\n {-{-DESCRIPTION-}-}\n </tr>\n </tbody>\n </table>\n </td>\n <td align=\"right\" width=\"30%\" style=\"vertical-align: middle;\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td width=\"50%\">\n <table width=\"100%\">\n <tr>\n <td width=\"24\">\n <input\n type=\"radio\"\n id=\"radioYes\"\n name=\"unsubscribe\"\n data-cke-editable=\"1\"\n style=\"margin: 0px; vertical-align: middle;>\n </td>\n {-{-YES-}-}\n </tr>\n </table>\n </td>\n <td width=\"50%\">\n <table width=\"100%\">\n <tr>\n <td width=\"24\">\n <input\n type=\"radio\"\n id=\"radioNo\"\n name=\"unsubscribe\"\n data-cke-editable=\"1\"\n style=\"margin: 0px; vertical-align: middle;\">\n </td>\n {-{-NO-}-}\n </tr>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n";
2
2
  /**
3
3
  * @returns The template for the default checkbox block
4
4
  */
@@ -119,16 +119,6 @@ export declare class RecommendationConfigService {
119
119
  *
120
120
  * Reads existing data-attributes and creates a proper node config.
121
121
  * Used when loading templates created before node config was implemented.
122
- *
123
- * Sources, in priority order (later overrides earlier):
124
- * 1. `esd-ext-config` JSON blob — emitted by the recommendation migrator and
125
- * by hand-authored new templates. Carries the full RecommendationNodeConfig
126
- * (strategy, language, currency, filters, productIds, etc.) which the
127
- * discrete data-* attrs below cannot capture.
128
- * 2. Discrete `data-*` attributes — runtime source of truth for
129
- * layout/composition/spacing; controls keep these in sync as the user
130
- * edits, so we let them override the JSON blob if they disagree.
131
- * 3. `currency-*` attributes — durable currency source on the block element.
132
122
  * @param api - Stripo extension API with document modifier
133
123
  * @param node - The block node to migrate
134
124
  * @returns The migrated configuration
@@ -36,25 +36,6 @@ interface PerBlockState {
36
36
  /** Snapshot of filters taken when the drawer opens, used to revert on cancel */
37
37
  filterSnapshot: Filter[] | null;
38
38
  }
39
- /**
40
- * Persisted-config subset used by `seedBlockUrlConfig` to reconstruct
41
- * `recommendationConfigs` from a node-config JSON blob without coupling the
42
- * caller to the full `RecommendationNodeConfig` shape. Separator strings are
43
- * narrowed at the seed boundary.
44
- */
45
- export interface PerBlockUrlConfig {
46
- strategy: string;
47
- language: string;
48
- size: string;
49
- productIds: string[];
50
- filters: Filter[];
51
- shuffleProducts: boolean;
52
- currencyCode: string;
53
- currencyAlignment: 'before' | 'after';
54
- currencyDecimalCount: number;
55
- currencyDecimalSeparator: string;
56
- currencyThousandSeparator: string;
57
- }
58
39
  interface StoreState {
59
40
  recommendationCampaignUrls: Record<string, string>;
60
41
  activePredictiveAlgorithms: number[];
@@ -221,21 +202,6 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
221
202
  * Automatically cleaned up when removeBlockState deletes the block entry.
222
203
  */
223
204
  markBlockInitialized(id: number): void;
224
- /**
225
- * Seeds the URL-relevant fields of a block from a persisted node config.
226
- *
227
- * Used at save-time to ensure the campaign URL is built from the
228
- * persisted truth (the `esd-ext-config` blob in the raw HTML) even when
229
- * the user never selected the block in this editor session — without
230
- * this seed, `_syncNodeConfigToStore` would never have run for that
231
- * block and the store would hold default values (USD/en_US/mostPopular)
232
- * instead of the real config.
233
- *
234
- * Creates the block entry if missing; otherwise patches only the URL-
235
- * relevant subset and leaves runtime fields (e.g., `recommendedProducts`,
236
- * `isInitialized`) alone.
237
- */
238
- seedBlockUrlConfig(id: number, config: PerBlockUrlConfig): void;
239
205
  /**
240
206
  * Patches the current block's recommendationConfigs.
241
207
  * Replaces `store.$patch({ recommendationConfigs: { ... } })` pattern.
@@ -24,7 +24,7 @@ export interface CurrencyConfig {
24
24
  /** Number of decimal places (-1 for no formatting) */
25
25
  decimalCount: number;
26
26
  /** Character used for decimal separation */
27
- decimalSeparator: '.' | ',' | ' ';
27
+ decimalSeparator: '.' | ',';
28
28
  /** Character used for thousands separation */
29
29
  thousandSeparator: '.' | ',' | ' ' | '';
30
30
  }
@@ -1,3 +1,6 @@
1
+ /**
2
+ * Utility for preserving text styling when updating innerHTML
3
+ */
1
4
  import type { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
2
5
  /**
3
6
  * Preserves existing style tags when updating text content
@@ -1,5 +1,5 @@
1
1
  export { default as Guido } from './components/Guido.vue';
2
- export type { GuidoConfig, GuidoConfigInput, IdentityConfig, PartnerConfig, TemplateConfig, TemplateMigrationConfig, LegacyRecommendationConfig, EditorConfig, UIConfig, FeaturesConfig, BlocksConfig, CompilerConfig, DynamicContent, EmailHeader, DefaultBlockType, CustomBlockType, ValidationResult, ValidationError, } from './@types/config';
2
+ export type { GuidoConfig, GuidoConfigInput, IdentityConfig, PartnerConfig, TemplateConfig, EditorConfig, UIConfig, FeaturesConfig, BlocksConfig, CompilerConfig, DynamicContent, EmailHeader, DefaultBlockType, CustomBlockType, ValidationResult, ValidationError, } from './@types/config';
3
3
  export { validateConfig, parseConfig, parseConfigSafe, isValidConfig, getValidationErrors, MessageType, ProductType, } from './@types/config';
4
4
  export type { StripoEventType } from './@types/events';
5
5
  export type { PositionData, DynamicContentEvent, MergeTagClickEvent, MergeTag, BaseDynamicContent, TooltipOptions, TextValueObject, L10n, } from './@types/generic';