@useinsider/guido 3.1.1 → 3.2.0-beta.080341b
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 +117 -0
- package/dist/@types/config/schemas.js +166 -96
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +92 -80
- package/dist/components/organisms/AutoSaveController.vue.js +17 -0
- package/dist/components/organisms/AutoSaveController.vue2.js +13 -0
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +7 -7
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +12 -20
- package/dist/components/organisms/header/AutoSaveToggle.vue.js +22 -0
- package/dist/components/organisms/header/AutoSaveToggle.vue2.js +19 -0
- package/dist/components/organisms/header/EditorActions.vue.js +2 -2
- package/dist/components/organisms/header/EditorActions.vue2.js +51 -36
- package/dist/components/organisms/header/RightSlot.vue.js +11 -11
- package/dist/components/organisms/header/RightSlot.vue2.js +17 -13
- package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +51 -31
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +1 -1
- package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +23 -22
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +1 -1
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +37 -39
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +3 -3
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +30 -41
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +15 -14
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +18 -17
- package/dist/composables/useActionsApi.js +4 -4
- package/dist/composables/useAutoSave.js +71 -0
- package/dist/composables/useFullStoryBridge.js +14 -0
- package/dist/composables/useHtmlCompiler.js +23 -21
- package/dist/composables/useHtmlValidator.js +40 -38
- package/dist/composables/usePreviewMode.js +20 -16
- package/dist/composables/useRecommendation.js +46 -26
- package/dist/composables/useRibbonOffset.js +21 -0
- package/dist/composables/useSave.js +26 -15
- package/dist/composables/useStripo.js +48 -45
- package/dist/composables/validators/useCouponBlockValidator.js +24 -0
- package/dist/composables/validators/useLiquidValidator.js +42 -0
- package/dist/config/compiler/liquidCompilerRules.js +15 -0
- package/dist/config/compiler/recommendationCompilerRules.js +162 -43
- package/dist/config/compiler/unsubscribeCompilerRules.js +48 -45
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +110 -71
- package/dist/config/i18n/en/tooltips.json.js +2 -1
- package/dist/config/migrator/checkboxMigrator.js +5 -3
- package/dist/config/migrator/index.js +9 -9
- package/dist/config/migrator/radioButtonMigrator.js +66 -44
- package/dist/config/migrator/recommendation/compositionMapper.js +98 -0
- package/dist/config/migrator/recommendation/extractors.js +27 -0
- package/dist/config/migrator/recommendation/htmlBuilder.js +496 -0
- package/dist/config/migrator/recommendation/parseLegacyConfig.js +33 -0
- package/dist/config/migrator/recommendation/settingsMapper.js +70 -0
- package/dist/config/migrator/recommendation/themeMapper.js +93 -0
- package/dist/config/migrator/recommendationMigrator.js +74 -290
- package/dist/enums/extensions/recommendationBlock.js +16 -12
- package/dist/enums/onboarding.js +7 -2
- package/dist/enums/recommendation.js +2 -2
- package/dist/enums/unsubscribe.js +34 -27
- package/dist/extensions/Blocks/CouponBlock/template.js +24 -13
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +38 -38
- package/dist/extensions/Blocks/Items/enums/productEnums.js +19 -7
- package/dist/extensions/Blocks/RadioButton/template.js +1 -1
- package/dist/extensions/Blocks/Recommendation/block.js +60 -50
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +5 -5
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +27 -11
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +185 -172
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +21 -18
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +99 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +27 -26
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +3 -1
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +211 -162
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +27 -57
- package/dist/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.js +14 -0
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +75 -73
- package/dist/extensions/Blocks/Recommendation/services/configService.js +76 -33
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +18 -17
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +123 -79
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +24 -13
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +30 -29
- package/dist/extensions/Blocks/Recommendation/templates/index.js +7 -7
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +27 -15
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +21 -21
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +57 -50
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +17 -14
- package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMap.js +21 -0
- package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +13 -22
- package/dist/extensions/Blocks/Recommendation/utils/tagName.js +6 -6
- package/dist/extensions/Blocks/Unsubscribe/block.js +11 -11
- package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +16 -17
- package/dist/extensions/DynamicContent/dynamic-content.js +17 -12
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +393 -264
- package/dist/node_modules/valibot/dist/index.js +450 -235
- package/dist/package.json.js +1 -1
- package/dist/services/recommendationApi.js +15 -15
- package/dist/services/stripoApi.js +9 -9
- package/dist/services/templateLibraryApi.js +49 -46
- package/dist/src/@types/config/defaults.d.ts +5 -1
- package/dist/src/@types/config/index.d.ts +3 -3
- package/dist/src/@types/config/schemas.d.ts +245 -0
- package/dist/src/@types/config/types.d.ts +11 -1
- package/dist/src/@types/generic.d.ts +0 -1
- package/dist/src/@types/save-as-template.d.ts +1 -0
- package/dist/src/components/Guido.vue.d.ts +1 -1
- package/dist/src/components/organisms/AutoSaveController.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/AutoSaveToggle.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -1
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -1
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useActionsApi.d.ts +1 -1
- package/dist/src/composables/useAutoSave.d.ts +3 -0
- package/dist/src/composables/useConfig.d.ts +70 -0
- package/dist/src/composables/useFullStoryBridge.d.ts +11 -0
- package/dist/src/composables/useRecommendation.d.ts +10 -1
- package/dist/src/composables/useRecommendation.test.d.ts +1 -0
- package/dist/src/composables/useRibbonOffset.d.ts +4 -0
- package/dist/src/composables/useSave.d.ts +1 -1
- package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
- package/dist/src/composables/validators/useLiquidValidator.d.ts +3 -0
- package/dist/src/config/compiler/liquidCompilerRules.d.ts +2 -0
- package/dist/src/config/compiler/utils/recommendationCompilerUtils.d.ts +1 -1
- package/dist/src/config/migrator/index.d.ts +2 -1
- package/dist/src/config/migrator/recommendation/compositionMapper.d.ts +2 -0
- package/dist/src/config/migrator/recommendation/compositionMapper.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/extractors.d.ts +7 -0
- package/dist/src/config/migrator/recommendation/extractors.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +11 -0
- package/dist/src/config/migrator/recommendation/parseLegacyConfig.d.ts +15 -0
- package/dist/src/config/migrator/recommendation/parseLegacyConfig.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/settingsMapper.d.ts +7 -0
- package/dist/src/config/migrator/recommendation/settingsMapper.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/themeMapper.d.ts +5 -0
- package/dist/src/config/migrator/recommendation/themeMapper.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/types.d.ts +205 -0
- package/dist/src/config/migrator/recommendationMigrator.d.ts +13 -1
- package/dist/src/config/migrator/recommendationMigrator.test.d.ts +1 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +3 -0
- package/dist/src/enums/onboarding.d.ts +6 -0
- package/dist/src/enums/unsubscribe.d.ts +5 -0
- package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +2 -0
- package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +3 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.d.ts +35 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.test.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/textTrim.d.ts +3 -20
- package/dist/src/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.d.ts +29 -0
- package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +21 -3
- package/dist/src/extensions/Blocks/Recommendation/services/configService.test.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +34 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -3
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +20 -3
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.d.ts +21 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.test.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +0 -3
- package/dist/src/library.d.ts +1 -1
- package/dist/src/services/templateLibraryApi.d.ts +1 -1
- package/dist/src/stores/autosave.d.ts +12 -0
- package/dist/src/stores/config.d.ts +630 -0
- package/dist/src/stores/editor.d.ts +23 -0
- package/dist/src/stores/onboarding.d.ts +4 -0
- package/dist/src/stores/preview.d.ts +3 -0
- package/dist/src/utils/genericUtil.d.ts +1 -1
- package/dist/src/utils/htmlCompiler.d.ts +2 -1
- package/dist/src/utils/htmlEscape.d.ts +5 -0
- package/dist/src/utils/htmlEscape.test.d.ts +1 -0
- package/dist/src/utils/timeUtil.d.ts +8 -0
- package/dist/static/styles/base.css.js +7 -2
- package/dist/static/styles/components/button.css.js +16 -9
- package/dist/static/styles/components/loader.css.js +4 -0
- package/dist/static/styles/components/narrow-panel.css.js +52 -0
- package/dist/stores/autosave.js +17 -0
- package/dist/stores/editor.js +3 -1
- package/dist/stores/onboarding.js +4 -0
- package/dist/stores/preview.js +4 -3
- package/dist/utils/genericUtil.js +42 -20
- package/dist/utils/htmlCompiler.js +48 -41
- package/dist/utils/htmlEscape.js +13 -0
- package/dist/utils/pairProductVariables.js +89 -88
- package/dist/utils/templatePreparation.js +75 -24
- package/dist/utils/timeUtil.js +19 -0
- package/dist/utils/tooltipUtils.js +4 -5
- package/package.json +8 -4
- package/dist/enums/displayConditions.js +0 -80
- package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +0 -251
- package/dist/src/enums/displayConditions.d.ts +0 -2
package/README.md
CHANGED
|
@@ -113,6 +113,12 @@ const config: GuidoConfigInput = {
|
|
|
113
113
|
preselectedDynamicContent?: DynamicContent[],
|
|
114
114
|
selectedUnsubscribePages?: number[],
|
|
115
115
|
forceRecreate?: boolean, // Default: false - Force recreate template in Stripo storage
|
|
116
|
+
migration?: {
|
|
117
|
+
// Legacy block configs keyed by block ID. Consumed once by the migrator
|
|
118
|
+
// when upgrading templates authored with v1 block formats. See the
|
|
119
|
+
// "Template Migration" section below.
|
|
120
|
+
recommendationConfigs?: Record<string, LegacyRecommendationConfig>,
|
|
121
|
+
},
|
|
116
122
|
},
|
|
117
123
|
|
|
118
124
|
// Optional: Editor settings
|
|
@@ -143,6 +149,8 @@ const config: GuidoConfigInput = {
|
|
|
143
149
|
displayConditions?: boolean, // Default: true
|
|
144
150
|
unsubscribe?: boolean, // Default: true
|
|
145
151
|
modulesDisabled?: boolean, // Default: false - Disable modules panel
|
|
152
|
+
liquidSyntax?: boolean, // Default: false - Enable Liquid template syntax
|
|
153
|
+
autosave?: boolean, // Default: false - Show the Auto Save toggle in the header. See wiki/AUTOSAVE.md.
|
|
146
154
|
},
|
|
147
155
|
|
|
148
156
|
// Optional: Callbacks
|
|
@@ -201,6 +209,7 @@ interface SavedTemplateDetails {
|
|
|
201
209
|
config: number[];
|
|
202
210
|
};
|
|
203
211
|
metadata: Metadata;
|
|
212
|
+
silent: boolean; // true when triggered by autosave, false when user clicked Save
|
|
204
213
|
}
|
|
205
214
|
|
|
206
215
|
interface Metadata {
|
|
@@ -326,6 +335,112 @@ const config: GuidoConfigInput = {
|
|
|
326
335
|
|
|
327
336
|
---
|
|
328
337
|
|
|
338
|
+
## Autosave
|
|
339
|
+
|
|
340
|
+
Guido ships an opt-in **autosave** that saves on a 3-minute interval and when the user leaves the tab. Enable it with the `features.autosave` feature flag — this **shows an "Auto Save" toggle in the editor header**; the end user switches autosave on per session.
|
|
341
|
+
|
|
342
|
+
```typescript
|
|
343
|
+
const config: GuidoConfigInput = {
|
|
344
|
+
identity: { templateId: 'tpl-123', userId: 'user-456' },
|
|
345
|
+
partner: { name: 'partner' },
|
|
346
|
+
features: {
|
|
347
|
+
autosave: true, // Default: false — shows the Auto Save toggle in the header
|
|
348
|
+
},
|
|
349
|
+
};
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
- Default is `false` — integrations see no change unless they opt in.
|
|
353
|
+
- Autosave reuses the same save pipeline as the Save button, so your existing `@save:complete` handler receives autosave output identically to a manual save. No new events or callbacks.
|
|
354
|
+
- Toggle state is **session-only** (Pinia) — resets to OFF on reload.
|
|
355
|
+
|
|
356
|
+
For a deep dive on triggers, guards, and limitations, see **[wiki/AUTOSAVE.md](wiki/AUTOSAVE.md)**.
|
|
357
|
+
|
|
358
|
+
---
|
|
359
|
+
|
|
360
|
+
## Template Migration
|
|
361
|
+
|
|
362
|
+
When a template was authored with **v1 block formats** (notably the legacy recommendation block), Guido needs additional context that cannot be recovered from the saved HTML alone — things like filter rules, recommendation strategies, currency settings, locale, and pinned product IDs.
|
|
363
|
+
|
|
364
|
+
Pass that context once via `template.migration` when loading the template. The migrator consumes it during initial render to upgrade legacy blocks to the current format. After migration, the field has no effect on editor behavior — you can keep passing it (it's idempotent on already-migrated templates) or omit it.
|
|
365
|
+
|
|
366
|
+
> **When to provide this:** Only when loading templates created before the v2 recommendation block was rolled out. New templates do not need it.
|
|
367
|
+
|
|
368
|
+
### `recommendationConfigs`
|
|
369
|
+
|
|
370
|
+
A dictionary keyed by the legacy block's element ID. Each entry preserves the v1 block's runtime config so the migrator can hydrate the upgraded block.
|
|
371
|
+
|
|
372
|
+
```typescript
|
|
373
|
+
const config: GuidoConfigInput = {
|
|
374
|
+
identity: { templateId: 'tpl-123', userId: 'user-456' },
|
|
375
|
+
partner: { name: 'acme' },
|
|
376
|
+
template: {
|
|
377
|
+
html: legacyHtml,
|
|
378
|
+
css: legacyCss,
|
|
379
|
+
migration: {
|
|
380
|
+
recommendationConfigs: {
|
|
381
|
+
// Key = legacy block element id (also present as `id` in the entry)
|
|
382
|
+
'recommendation-1700000000000': {
|
|
383
|
+
id: 1700000000000,
|
|
384
|
+
// Filter-driven block — productIds is empty, filters/strategy drive selection
|
|
385
|
+
productIds: [],
|
|
386
|
+
filters: [{ field: 'category', op: 'eq', value: 'shoes' }],
|
|
387
|
+
strategy: 'newArrivals',
|
|
388
|
+
shuffleProducts: false,
|
|
389
|
+
sendProductRequestFlag: true,
|
|
390
|
+
|
|
391
|
+
// Display & locale
|
|
392
|
+
currency: 'EUR',
|
|
393
|
+
currencySettings: { decimal: ',', thousand: '.', alignment: 'left' },
|
|
394
|
+
language: 'nl_NL',
|
|
395
|
+
decimalCount: 2,
|
|
396
|
+
|
|
397
|
+
// Layout
|
|
398
|
+
cardsInRow: 2,
|
|
399
|
+
orientation: 'vertical',
|
|
400
|
+
textTrimming: true,
|
|
401
|
+
unresponsive: false,
|
|
402
|
+
mobileLeftPadding: 0,
|
|
403
|
+
mobileRightPadding: 0,
|
|
404
|
+
|
|
405
|
+
// Snapshot of products as they were rendered in the legacy email
|
|
406
|
+
recommendedProducts: [/* ...legacy product objects... */],
|
|
407
|
+
},
|
|
408
|
+
},
|
|
409
|
+
},
|
|
410
|
+
},
|
|
411
|
+
};
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
All fields on a `LegacyRecommendationConfig` entry are optional — pass whatever your storage layer has for that block. Unknown keys are preserved and forwarded to the migrator unchanged, so partner-specific extensions continue to round-trip.
|
|
415
|
+
|
|
416
|
+
### Field reference
|
|
417
|
+
|
|
418
|
+
| Field | Type | Purpose |
|
|
419
|
+
|-------|------|---------|
|
|
420
|
+
| `id` | `number` | Block ID (matches the dictionary key and legacy HTML element id) |
|
|
421
|
+
| `productIds` | `unknown[]` | Pinned product IDs — empty when filter-driven |
|
|
422
|
+
| `filters` | `unknown[]` | Filter rules driving product selection |
|
|
423
|
+
| `strategy` | `string` | Recommendation strategy key (e.g. `'newArrivals'`) |
|
|
424
|
+
| `shuffleProducts` | `boolean` | Whether to randomize product order |
|
|
425
|
+
| `sendProductRequestFlag` | `boolean` | Whether the block requested live products at send time |
|
|
426
|
+
| `currency` | `string` | Currency code (e.g. `'EUR'`) |
|
|
427
|
+
| `currencySettings` | `unknown` | Separators, alignment, decimals |
|
|
428
|
+
| `language` | `string` | Locale (e.g. `'nl_NL'`) |
|
|
429
|
+
| `decimalCount` | `string \| number` | Decimal places for price display |
|
|
430
|
+
| `cardsInRow` | `number` | Product cards per row |
|
|
431
|
+
| `orientation` | `'vertical' \| 'horizontal'` | Layout orientation |
|
|
432
|
+
| `size` | `string \| number` | Size variant marker (legacy) |
|
|
433
|
+
| `verticalResponsiveness` | `boolean` | Vertical responsiveness flag (legacy `size=1` variants) |
|
|
434
|
+
| `blockType` | `string` | Block type marker used by some legacy variants |
|
|
435
|
+
| `textTrimming` | `boolean` | Whether long text is trimmed |
|
|
436
|
+
| `unresponsive` | `boolean` | Disable responsive scaling |
|
|
437
|
+
| `mobileLeftPadding` / `mobileRightPadding` | `number` | Mobile-only horizontal padding |
|
|
438
|
+
| `recommendedProducts` | `unknown[]` | Snapshot of products rendered by the legacy block |
|
|
439
|
+
|
|
440
|
+
> **Note on data shape:** The schema uses `looseObject` because v1 partner data shapes vary across deployments. Some entries carry `verticalResponsiveness`, others carry `blockType` / `orientation` / `size`. Pass whatever you have — the migrator will use what it recognizes and preserve the rest.
|
|
441
|
+
|
|
442
|
+
---
|
|
443
|
+
|
|
329
444
|
## HTML Compiler Rules
|
|
330
445
|
|
|
331
446
|
Add custom rules to transform HTML during export:
|
|
@@ -381,6 +496,8 @@ import type {
|
|
|
381
496
|
IdentityConfig,
|
|
382
497
|
PartnerConfig,
|
|
383
498
|
TemplateConfig,
|
|
499
|
+
TemplateMigrationConfig,
|
|
500
|
+
LegacyRecommendationConfig,
|
|
384
501
|
EditorConfig,
|
|
385
502
|
UIConfig,
|
|
386
503
|
FeaturesConfig,
|
|
@@ -1,53 +1,60 @@
|
|
|
1
|
-
import { ModuleFolderDefaults as
|
|
2
|
-
import { object as o, number as
|
|
3
|
-
const
|
|
1
|
+
import { ModuleFolderDefaults as S } from "../../enums/defaults.js";
|
|
2
|
+
import { object as o, number as n, optional as e, string as t, pipe as p, picklist as l, minLength as b, custom as h, boolean as a, array as c, record as k, looseObject as y, literal as i, variant as g, union as f, unknown as s } from "../../node_modules/valibot/dist/index.js";
|
|
3
|
+
const d = {
|
|
4
4
|
/** Promotional/marketing emails */
|
|
5
5
|
PROMOTIONAL: 1,
|
|
6
6
|
/** Transactional/system emails */
|
|
7
7
|
TRANSACTIONAL: 2
|
|
8
|
-
},
|
|
8
|
+
}, r = {
|
|
9
9
|
/** Standard email campaigns */
|
|
10
10
|
EMAIL: 60,
|
|
11
11
|
/** Architect journey builder */
|
|
12
12
|
ARCHITECT: 49,
|
|
13
13
|
/** Unsubscribe page builder */
|
|
14
14
|
UNSUBSCRIBE_PAGES: 97
|
|
15
|
-
},
|
|
15
|
+
}, R = o({
|
|
16
16
|
/** Unique identifier for the template being edited */
|
|
17
|
-
templateId:
|
|
17
|
+
templateId: p(
|
|
18
18
|
t(),
|
|
19
|
-
|
|
19
|
+
b(1, "templateId is required")
|
|
20
20
|
),
|
|
21
21
|
/** Unique identifier for the user editing the template */
|
|
22
|
-
userId:
|
|
22
|
+
userId: p(
|
|
23
23
|
t(),
|
|
24
|
-
|
|
24
|
+
b(1, "userId is required")
|
|
25
25
|
),
|
|
26
26
|
/** Optional variation ID for A/B testing */
|
|
27
27
|
variationId: e(t())
|
|
28
|
-
}),
|
|
28
|
+
}), C = o({
|
|
29
|
+
/** Fallback font name (e.g., "Georgia") */
|
|
30
|
+
name: t(),
|
|
31
|
+
/** Fallback font family (e.g., "serif" or "sans-serif") */
|
|
32
|
+
family: t()
|
|
33
|
+
}), T = o({
|
|
29
34
|
/** Partner/organization name (required) */
|
|
30
|
-
name:
|
|
35
|
+
name: p(
|
|
31
36
|
t(),
|
|
32
|
-
|
|
37
|
+
b(1, "partner.name is required")
|
|
33
38
|
),
|
|
34
39
|
/** Product type identifier */
|
|
35
40
|
productType: e(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
41
|
+
l([
|
|
42
|
+
r.EMAIL,
|
|
43
|
+
r.ARCHITECT,
|
|
44
|
+
r.UNSUBSCRIBE_PAGES
|
|
40
45
|
]),
|
|
41
|
-
|
|
46
|
+
r.EMAIL
|
|
42
47
|
),
|
|
43
48
|
/** Message type (promotional or transactional) */
|
|
44
49
|
messageType: e(
|
|
45
|
-
|
|
46
|
-
|
|
50
|
+
l([d.PROMOTIONAL, d.TRANSACTIONAL]),
|
|
51
|
+
d.PROMOTIONAL
|
|
47
52
|
),
|
|
48
53
|
/** Display name for the current user */
|
|
49
|
-
username: e(t(), "Guido User")
|
|
50
|
-
|
|
54
|
+
username: e(t(), "Guido User"),
|
|
55
|
+
/** Fallback font settings from partner settings — used to match backend size calculation */
|
|
56
|
+
fallbackFont: e(C)
|
|
57
|
+
}), A = o({
|
|
51
58
|
/** Display text for the dynamic content */
|
|
52
59
|
text: t(),
|
|
53
60
|
/** Template variable value (e.g., {{username}}) */
|
|
@@ -61,44 +68,100 @@ const m = {
|
|
|
61
68
|
value: t()
|
|
62
69
|
})
|
|
63
70
|
)
|
|
64
|
-
}),
|
|
71
|
+
}), I = y({
|
|
72
|
+
/** Block ID (matches the dictionary key and the legacy HTML element id) */
|
|
73
|
+
id: e(n()),
|
|
74
|
+
/** Decimal places for price display (legacy data may use string or number) */
|
|
75
|
+
decimalCount: e(f([t(), n()])),
|
|
76
|
+
/** Pinned product IDs (empty array when filter-driven) */
|
|
77
|
+
productIds: e(c(s())),
|
|
78
|
+
/** Whether the block requested live products at send time */
|
|
79
|
+
sendProductRequestFlag: e(a()),
|
|
80
|
+
/** Whether to randomize product order */
|
|
81
|
+
shuffleProducts: e(a()),
|
|
82
|
+
/** Filter rules driving product selection */
|
|
83
|
+
filters: e(c(s())),
|
|
84
|
+
/** Currency code (e.g. 'EUR') — sometimes absent in legacy data */
|
|
85
|
+
currency: e(t()),
|
|
86
|
+
/** Currency display settings (separators, alignment, decimals) */
|
|
87
|
+
currencySettings: e(s()),
|
|
88
|
+
/** Locale (e.g. 'nl_NL') */
|
|
89
|
+
language: e(t()),
|
|
90
|
+
/** Recommendation strategy key (e.g. 'newArrivals') */
|
|
91
|
+
strategy: e(t()),
|
|
92
|
+
/** Snapshot of products as rendered by the legacy block */
|
|
93
|
+
recommendedProducts: e(c(s())),
|
|
94
|
+
/** Number of product cards per row */
|
|
95
|
+
cardsInRow: e(n()),
|
|
96
|
+
/** Mobile-only padding (right) */
|
|
97
|
+
mobileRightPadding: e(n()),
|
|
98
|
+
/** Mobile-only padding (left) */
|
|
99
|
+
mobileLeftPadding: e(n()),
|
|
100
|
+
/** Disable responsive scaling */
|
|
101
|
+
unresponsive: e(a()),
|
|
102
|
+
/** Layout orientation ('vertical' | 'horizontal') */
|
|
103
|
+
orientation: e(t()),
|
|
104
|
+
/** Whether long text is trimmed */
|
|
105
|
+
textTrimming: e(a()),
|
|
106
|
+
/** Block type marker used by some legacy variants */
|
|
107
|
+
blockType: e(t()),
|
|
108
|
+
/** Size variant marker (legacy data may use string or number) */
|
|
109
|
+
size: e(f([t(), n()])),
|
|
110
|
+
/** Vertical responsiveness flag (legacy size=1 variants) */
|
|
111
|
+
verticalResponsiveness: e(a())
|
|
112
|
+
}), E = o({
|
|
113
|
+
/**
|
|
114
|
+
* Legacy recommendation block configs keyed by block ID.
|
|
115
|
+
* Pass this when loading a template authored with the v1
|
|
116
|
+
* recommendation block so the migrator can preserve filters,
|
|
117
|
+
* strategy, currency, locale, and layout data.
|
|
118
|
+
*/
|
|
119
|
+
recommendationConfigs: e(
|
|
120
|
+
k(t(), I),
|
|
121
|
+
{}
|
|
122
|
+
)
|
|
123
|
+
}), L = o({
|
|
65
124
|
/** Initial HTML content */
|
|
66
125
|
html: e(t(), ""),
|
|
67
126
|
/** Initial CSS content */
|
|
68
127
|
css: e(t(), ""),
|
|
69
128
|
/** Preselected dynamic content items */
|
|
70
129
|
preselectedDynamicContent: e(
|
|
71
|
-
c(
|
|
130
|
+
c(A),
|
|
72
131
|
[]
|
|
73
132
|
),
|
|
133
|
+
/** Valid custom field attribute names from the partner's categorized fields */
|
|
134
|
+
customFieldAttributes: e(c(t()), []),
|
|
74
135
|
/** Selected unsubscribe page IDs */
|
|
75
|
-
selectedUnsubscribePages: e(c(
|
|
136
|
+
selectedUnsubscribePages: e(c(n()), []),
|
|
76
137
|
/** Force recreate template in Stripo storage (use true when updating externally modified templates) */
|
|
77
|
-
forceRecreate: e(a(), !1)
|
|
78
|
-
|
|
138
|
+
forceRecreate: e(a(), !1),
|
|
139
|
+
/** Migration-only inputs (legacy block configs) */
|
|
140
|
+
migration: e(E, {})
|
|
141
|
+
}), O = o({
|
|
79
142
|
/** Sender display name */
|
|
80
143
|
senderName: e(t(), ""),
|
|
81
144
|
/** Email subject line */
|
|
82
145
|
subject: e(t(), "")
|
|
83
|
-
}),
|
|
146
|
+
}), v = o({
|
|
84
147
|
/** Locale for the editor UI */
|
|
85
148
|
locale: e(t(), "en"),
|
|
86
149
|
/** Path to translations object */
|
|
87
150
|
translationsPath: e(t(), "window.trans[Object.keys(window.trans)[0]]"),
|
|
88
151
|
/** Migration date for template compatibility */
|
|
89
|
-
migrationDate: e(
|
|
152
|
+
migrationDate: e(n(), 1759696858),
|
|
90
153
|
/** Email header settings */
|
|
91
|
-
emailHeader: e(
|
|
154
|
+
emailHeader: e(O, { senderName: "", subject: "" }),
|
|
92
155
|
/** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
|
|
93
|
-
savedModulesFolderName: e(t(),
|
|
156
|
+
savedModulesFolderName: e(t(), S.SAVED_MODULES),
|
|
94
157
|
/** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
|
|
95
|
-
defaultModulesFolderName: e(t(),
|
|
96
|
-
}),
|
|
158
|
+
defaultModulesFolderName: e(t(), S.DEFAULT_MODULES)
|
|
159
|
+
}), M = o({
|
|
97
160
|
/** Whether to show the header bar */
|
|
98
161
|
showHeader: e(a(), !0),
|
|
99
162
|
/** Custom label for back button (if shown) */
|
|
100
163
|
backButtonLabel: e(t())
|
|
101
|
-
}),
|
|
164
|
+
}), P = o({
|
|
102
165
|
/** Enable dynamic content insertion */
|
|
103
166
|
dynamicContent: e(a(), !0),
|
|
104
167
|
/** Enable save as template functionality */
|
|
@@ -112,8 +175,12 @@ const m = {
|
|
|
112
175
|
/** Enable unsubscribe block */
|
|
113
176
|
unsubscribe: e(a(), !0),
|
|
114
177
|
/** Disable modules panel in the editor */
|
|
115
|
-
modulesDisabled: e(a(), !1)
|
|
116
|
-
|
|
178
|
+
modulesDisabled: e(a(), !1),
|
|
179
|
+
/** Enable Liquid template syntax */
|
|
180
|
+
liquidSyntax: e(a(), !1),
|
|
181
|
+
/** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
|
|
182
|
+
autosave: e(a(), !1)
|
|
183
|
+
}), N = l([
|
|
117
184
|
"amp-accordion",
|
|
118
185
|
"amp-carousel",
|
|
119
186
|
"amp-form-controls",
|
|
@@ -127,7 +194,7 @@ const m = {
|
|
|
127
194
|
"text-block",
|
|
128
195
|
"timer-block",
|
|
129
196
|
"video-block"
|
|
130
|
-
]),
|
|
197
|
+
]), D = l([
|
|
131
198
|
"dynamic-content",
|
|
132
199
|
"checkbox-block",
|
|
133
200
|
"radio-button-block",
|
|
@@ -135,118 +202,121 @@ const m = {
|
|
|
135
202
|
"unsubscribe-block",
|
|
136
203
|
"coupon-block",
|
|
137
204
|
"items-block"
|
|
138
|
-
]),
|
|
205
|
+
]), x = o({
|
|
139
206
|
/** Default blocks to exclude from the editor */
|
|
140
207
|
excludeDefaults: e(
|
|
141
|
-
c(
|
|
208
|
+
c(N),
|
|
142
209
|
[]
|
|
143
210
|
),
|
|
144
211
|
/** Custom blocks to include in the editor */
|
|
145
212
|
includeCustoms: e(
|
|
146
|
-
c(
|
|
213
|
+
c(D),
|
|
147
214
|
[]
|
|
148
215
|
)
|
|
149
|
-
}),
|
|
216
|
+
}), m = o({
|
|
150
217
|
/** Unique identifier for the rule */
|
|
151
218
|
id: t(),
|
|
152
219
|
/** Human-readable description */
|
|
153
220
|
description: e(t()),
|
|
154
221
|
/** Priority for rule ordering (lower = earlier) */
|
|
155
|
-
priority:
|
|
156
|
-
}),
|
|
157
|
-
...
|
|
158
|
-
type:
|
|
222
|
+
priority: n()
|
|
223
|
+
}), F = o({
|
|
224
|
+
...m.entries,
|
|
225
|
+
type: i("replace"),
|
|
159
226
|
/** String to search for */
|
|
160
227
|
search: t(),
|
|
161
228
|
/** Replacement string */
|
|
162
229
|
replacement: t(),
|
|
163
230
|
/** Replace all occurrences (default: false) */
|
|
164
231
|
replaceAll: e(a())
|
|
165
|
-
}),
|
|
166
|
-
...
|
|
167
|
-
type:
|
|
232
|
+
}), U = o({
|
|
233
|
+
...m.entries,
|
|
234
|
+
type: i("regex"),
|
|
168
235
|
/** Regex pattern string */
|
|
169
236
|
pattern: t(),
|
|
170
237
|
/** Replacement string (supports $1, $2, etc.) */
|
|
171
238
|
replacement: t(),
|
|
172
239
|
/** Regex flags (e.g., 'gi') */
|
|
173
240
|
flags: e(t())
|
|
174
|
-
}),
|
|
175
|
-
...
|
|
176
|
-
type:
|
|
241
|
+
}), B = o({
|
|
242
|
+
...m.entries,
|
|
243
|
+
type: i("remove"),
|
|
177
244
|
/** Strings or patterns to remove */
|
|
178
245
|
targets: c(t())
|
|
179
|
-
}),
|
|
180
|
-
...
|
|
181
|
-
type:
|
|
246
|
+
}), w = o({
|
|
247
|
+
...m.entries,
|
|
248
|
+
type: i("custom"),
|
|
182
249
|
/** Custom processor function */
|
|
183
|
-
processor:
|
|
184
|
-
(
|
|
250
|
+
processor: h(
|
|
251
|
+
(u) => typeof u == "function",
|
|
185
252
|
"processor must be a function"
|
|
186
253
|
)
|
|
187
|
-
}),
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
]),
|
|
254
|
+
}), H = g("type", [
|
|
255
|
+
F,
|
|
256
|
+
U,
|
|
257
|
+
B,
|
|
258
|
+
w
|
|
259
|
+
]), j = o({
|
|
193
260
|
/** Custom compiler rules to apply */
|
|
194
|
-
customRules: e(c(
|
|
261
|
+
customRules: e(c(H), []),
|
|
195
262
|
/** Skip default compiler rules */
|
|
196
263
|
ignoreDefaultRules: e(a(), !1)
|
|
197
|
-
}),
|
|
264
|
+
}), q = o({
|
|
198
265
|
/**
|
|
199
266
|
* External validation handler called before save completes.
|
|
200
267
|
* Return false to cancel the save operation.
|
|
201
268
|
*/
|
|
202
269
|
externalValidation: e(
|
|
203
|
-
|
|
204
|
-
(
|
|
270
|
+
h(
|
|
271
|
+
(u) => typeof u == "function",
|
|
205
272
|
"externalValidation must be a function"
|
|
206
273
|
)
|
|
207
274
|
)
|
|
208
|
-
}),
|
|
275
|
+
}), V = o({
|
|
209
276
|
// Required sections
|
|
210
277
|
/** Identity configuration (required) */
|
|
211
|
-
identity:
|
|
278
|
+
identity: R,
|
|
212
279
|
/** Partner configuration (required) */
|
|
213
|
-
partner:
|
|
280
|
+
partner: T,
|
|
214
281
|
// Optional sections (with defaults)
|
|
215
282
|
/** Template content and presets */
|
|
216
|
-
template: e(
|
|
283
|
+
template: e(L, {}),
|
|
217
284
|
/** Editor settings */
|
|
218
|
-
editor: e(
|
|
285
|
+
editor: e(v, {}),
|
|
219
286
|
/** UI configuration */
|
|
220
|
-
ui: e(
|
|
287
|
+
ui: e(M, {}),
|
|
221
288
|
/** Feature toggles */
|
|
222
|
-
features: e(
|
|
289
|
+
features: e(P, {}),
|
|
223
290
|
/** Block configuration */
|
|
224
|
-
blocks: e(
|
|
291
|
+
blocks: e(x, {}),
|
|
225
292
|
/** Compiler configuration */
|
|
226
|
-
compiler: e(
|
|
293
|
+
compiler: e(j, {}),
|
|
227
294
|
/** Callbacks and event handlers */
|
|
228
|
-
callbacks: e(
|
|
295
|
+
callbacks: e(q, {})
|
|
229
296
|
});
|
|
230
297
|
export {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
298
|
+
x as BlocksSchema,
|
|
299
|
+
q as CallbacksSchema,
|
|
300
|
+
H as CompilerRuleSchema,
|
|
301
|
+
j as CompilerSchema,
|
|
302
|
+
D as CustomBlockTypeSchema,
|
|
303
|
+
w as CustomRuleSchema,
|
|
304
|
+
N as DefaultBlockTypeSchema,
|
|
305
|
+
A as DynamicContentSchema,
|
|
306
|
+
v as EditorSchema,
|
|
307
|
+
O as EmailHeaderSchema,
|
|
308
|
+
C as FallbackFontSchema,
|
|
309
|
+
P as FeaturesSchema,
|
|
310
|
+
V as GuidoConfigSchema,
|
|
311
|
+
R as IdentitySchema,
|
|
312
|
+
I as LegacyRecommendationConfigSchema,
|
|
313
|
+
d as MessageType,
|
|
314
|
+
T as PartnerSchema,
|
|
315
|
+
r as ProductType,
|
|
316
|
+
U as RegexRuleSchema,
|
|
317
|
+
B as RemoveRuleSchema,
|
|
318
|
+
F as ReplaceRuleSchema,
|
|
319
|
+
E as TemplateMigrationSchema,
|
|
320
|
+
L as TemplateSchema,
|
|
321
|
+
M as UISchema
|
|
252
322
|
};
|
|
@@ -3,7 +3,7 @@ import i from "./Guido.vue2.js";
|
|
|
3
3
|
import a from "../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var t = function() {
|
|
5
5
|
var o = this, r = o._self._c, e = o._self._setupProxy;
|
|
6
|
-
return r("div", { staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? o._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(
|
|
6
|
+
return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? o._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(p) {
|
|
7
7
|
return e.emit("onboarding:finished");
|
|
8
8
|
} } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
|
|
9
9
|
}, n = [], s = /* @__PURE__ */ a(
|
|
@@ -12,9 +12,9 @@ var t = function() {
|
|
|
12
12
|
n,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"1a4e7084"
|
|
16
16
|
);
|
|
17
|
-
const
|
|
17
|
+
const l = s.exports;
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
l as default
|
|
20
20
|
};
|