@useinsider/guido 3.17.0-beta.ea65303 → 3.17.0-beta.ec8eabb

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 (52) hide show
  1. package/README.md +0 -1
  2. package/dist/@types/config/schemas.js +27 -29
  3. package/dist/components/Guido.vue.js +8 -8
  4. package/dist/components/Guido.vue2.js +59 -60
  5. package/dist/components/organisms/AutoSaveController.vue2.js +8 -9
  6. package/dist/components/organisms/header/EditorActions.vue.js +2 -2
  7. package/dist/components/organisms/header/EditorActions.vue2.js +51 -74
  8. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  9. package/dist/components/organisms/header/LeftSlot.vue2.js +12 -16
  10. package/dist/components/wrappers/WpDrawer.vue.js +7 -9
  11. package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
  12. package/dist/composables/useActionsApi.js +82 -67
  13. package/dist/composables/useAutoSave.js +31 -26
  14. package/dist/composables/useEditorLock.js +18 -0
  15. package/dist/composables/useGuidoStateBridge.js +31 -30
  16. package/dist/composables/useHtmlCompiler.js +26 -37
  17. package/dist/composables/useHtmlValidator.js +0 -2
  18. package/dist/composables/useSave.js +47 -86
  19. package/dist/composables/validators/useCouponBlockValidator.js +21 -24
  20. package/dist/composables/validators/useUnsubscribeBlockValidator.js +27 -34
  21. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +26 -33
  22. package/dist/guido.css +1 -1
  23. package/dist/src/@types/config/schemas.d.ts +0 -4
  24. package/dist/src/components/Guido.vue.d.ts +1 -17
  25. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -17
  26. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -17
  27. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -17
  28. package/dist/src/components/wrappers/WpDrawer.vue.d.ts +3 -4
  29. package/dist/src/composables/useConfig.d.ts +0 -2
  30. package/dist/src/composables/useEditorLock.d.ts +11 -0
  31. package/dist/src/composables/useHtmlValidator.d.ts +0 -21
  32. package/dist/src/composables/useSave.d.ts +1 -6
  33. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +0 -3
  34. package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +0 -10
  35. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -5
  36. package/dist/src/stores/config.d.ts +0 -30
  37. package/dist/src/utils/templatePreparation.d.ts +0 -30
  38. package/dist/stores/config.js +22 -39
  39. package/dist/utils/templatePreparation.js +25 -28
  40. package/package.json +1 -1
  41. package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +0 -20
  42. package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +0 -48
  43. package/dist/composables/useSaveValidation.js +0 -279
  44. package/dist/composables/useSaveValidationRollout.js +0 -9
  45. package/dist/enums/save-validation.js +0 -4
  46. package/dist/src/@types/save-validation.d.ts +0 -19
  47. package/dist/src/components/organisms/validation/ValidationErrorDrawer.vue.d.ts +0 -2
  48. package/dist/src/composables/useSaveValidation.d.ts +0 -6
  49. package/dist/src/composables/useSaveValidationRollout.d.ts +0 -3
  50. package/dist/src/enums/save-validation.d.ts +0 -27
  51. package/dist/src/stores/save-validation.d.ts +0 -22
  52. package/dist/stores/save-validation.js +0 -30
@@ -1,12 +1,5 @@
1
1
  import type { DynamicContent } from '@@/Types/generic';
2
2
  import type { FiltersResponse } from '@@/Types/recommendation';
3
- /**
4
- * Extracts recommendation block IDs directly from the HTML by parsing
5
- * the recommendation-id attribute on block elements.
6
- * This avoids depending on store state which may not be populated
7
- * when the settings panel hasn't been opened yet (e.g., saved templates).
8
- */
9
- export declare function getRecommendationBlockIds(html: string): string[];
10
3
  /**
11
4
  * Parses a `{{recoId_index_attributeName}}` variable (already stripped of the
12
5
  * braces/whitespace) into its recommendation id and attribute name. Returns
@@ -34,20 +27,6 @@ export declare function buildPartnerAttributeNameSet(filterList: FiltersResponse
34
27
  * before, so flagging it would false-positive on merge tags like `{{user.name}}`.
35
28
  */
36
29
  export declare function findInvalidCustomFields(html: string, validCustomFields: string[], recommendationBlockIds: string[], ignoredIds: Set<string>, ignoredAttributeNames: Set<string> | null): string[];
37
- /**
38
- * Returns the invalid `{{ ... }}` dynamic-content tags found in the HTML.
39
- *
40
- * A tag's variable name is the part before the first `|` (everything after it is the fallback).
41
- * Surrounding whitespace is always allowed (trimmed). A tag is valid only when the variable name
42
- * is an allowed system token, or it is a clean identifier (`[A-Za-z0-9_.]`) and — when a `|` is
43
- * present — the fallback after it is not empty. Otherwise the tag is invalid (e.g.
44
- * `{{Api Response: OA1 Main Item Url}}` — spaces/`:` — or `{{bounce|}}` — empty fallback).
45
- *
46
- * `data-*` block-config attribute values are excluded from the scan: blocks such as Items/cart
47
- * store product merge tags (`data-product_button_link="{{Abandoned Cart Item (1) Url}}"`) that the
48
- * backend resolves through its own pipeline, so they must not be treated as user-authored tags.
49
- */
50
- export declare function getInvalidDynamicContentTags(html: string): string[];
51
30
  export declare const useHtmlValidator: () => {
52
31
  validateHtml: (html: string, customFields: DynamicContent[], isOnSaveValidation?: boolean) => Promise<boolean>;
53
32
  };
@@ -1,9 +1,4 @@
1
1
  import type { SavedTemplateDetails } from '@@/Types/stripo';
2
- type SaveDetails = Omit<SavedTemplateDetails, 'metadata' | 'silent'>;
3
- type SaveResult = SaveDetails | undefined;
4
2
  export declare const useSave: () => {
5
- save: (suppressEmit?: boolean, silent?: boolean) => Promise<SaveResult>;
6
- saveWithErrors: () => Promise<SaveResult>;
7
- saveRawOnly: () => Promise<SaveResult>;
3
+ save: (suppressEmit?: boolean, silent?: boolean) => Promise<Omit<SavedTemplateDetails, "metadata" | "silent"> | undefined>;
8
4
  };
9
- export {};
@@ -1,6 +1,3 @@
1
- export declare const COUPON_TAG_MODIFIED_KEY = "newsletter.coupon-tag-modified";
2
- /** Pure core: the tag text of every coupon block whose code was modified. */
3
- export declare function findInvalidCouponBlocks(html: string): string[];
4
1
  export declare const useCouponBlockValidator: () => {
5
2
  validateCouponBlockTags: (html: string) => boolean;
6
3
  };
@@ -1,14 +1,4 @@
1
- declare const SINGLETON_BLOCK_RULES: {
2
- pageType: number;
3
- messageKey: string;
4
- }[];
5
- export declare const EMPTY_BLOCK_KEY = "unsubscription-preference.select-page-to-continue";
6
- /** Pure core: the singleton rules whose page type appears more than once. */
7
- export declare function findDuplicateUnsubPageTypes(html: string): typeof SINGLETON_BLOCK_RULES;
8
- /** Pure core: count of unsubscribe blocks with no page type or page list chosen. */
9
- export declare function countUnsubBlocksWithoutPage(html: string): number;
10
1
  export declare const useUnsubscribeBlockValidator: () => {
11
2
  validateUnsubscribeBlockUniqueness: (html: string) => boolean;
12
3
  validateUnsubscribeBlockHasTemplate: (html: string) => boolean;
13
4
  };
14
- export {};
@@ -286,11 +286,6 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
286
286
  * every block's recommendationConfigs across user edits.
287
287
  */
288
288
  hasInvalidBlock(): boolean;
289
- /**
290
- * Per-instance counterpart to `hasInvalidBlock`: the ids of every block
291
- * that fails required-field validation, one drawer row each (SD-147430).
292
- */
293
- invalidBlockIds(): string[];
294
289
  fetchRecommendationProducts(): Promise<void>;
295
290
  _doFetchProducts(): Promise<void>;
296
291
  }>;
@@ -104,7 +104,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
104
104
  autosave: boolean;
105
105
  allowlistEnabled: boolean;
106
106
  linkTrackingIds: boolean;
107
- allowSaveWithErrors: boolean;
108
107
  };
109
108
  blocks: {
110
109
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -245,7 +244,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
245
244
  autosave: boolean;
246
245
  allowlistEnabled: boolean;
247
246
  linkTrackingIds: boolean;
248
- allowSaveWithErrors: boolean;
249
247
  };
250
248
  blocks: {
251
249
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -386,7 +384,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
386
384
  autosave: boolean;
387
385
  allowlistEnabled: boolean;
388
386
  linkTrackingIds: boolean;
389
- allowSaveWithErrors: boolean;
390
387
  };
391
388
  blocks: {
392
389
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -527,7 +524,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
527
524
  autosave: boolean;
528
525
  allowlistEnabled: boolean;
529
526
  linkTrackingIds: boolean;
530
- allowSaveWithErrors: boolean;
531
527
  };
532
528
  blocks: {
533
529
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -668,7 +664,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
668
664
  autosave: boolean;
669
665
  allowlistEnabled: boolean;
670
666
  linkTrackingIds: boolean;
671
- allowSaveWithErrors: boolean;
672
667
  };
673
668
  blocks: {
674
669
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -809,7 +804,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
809
804
  autosave: boolean;
810
805
  allowlistEnabled: boolean;
811
806
  linkTrackingIds: boolean;
812
- allowSaveWithErrors: boolean;
813
807
  };
814
808
  blocks: {
815
809
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -950,7 +944,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
950
944
  autosave: boolean;
951
945
  allowlistEnabled: boolean;
952
946
  linkTrackingIds: boolean;
953
- allowSaveWithErrors: boolean;
954
947
  };
955
948
  blocks: {
956
949
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1091,7 +1084,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1091
1084
  autosave: boolean;
1092
1085
  allowlistEnabled: boolean;
1093
1086
  linkTrackingIds: boolean;
1094
- allowSaveWithErrors: boolean;
1095
1087
  };
1096
1088
  blocks: {
1097
1089
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1232,7 +1224,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1232
1224
  autosave: boolean;
1233
1225
  allowlistEnabled: boolean;
1234
1226
  linkTrackingIds: boolean;
1235
- allowSaveWithErrors: boolean;
1236
1227
  };
1237
1228
  blocks: {
1238
1229
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1373,7 +1364,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1373
1364
  autosave: boolean;
1374
1365
  allowlistEnabled: boolean;
1375
1366
  linkTrackingIds: boolean;
1376
- allowSaveWithErrors: boolean;
1377
1367
  };
1378
1368
  blocks: {
1379
1369
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1514,7 +1504,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1514
1504
  autosave: boolean;
1515
1505
  allowlistEnabled: boolean;
1516
1506
  linkTrackingIds: boolean;
1517
- allowSaveWithErrors: boolean;
1518
1507
  };
1519
1508
  blocks: {
1520
1509
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1655,7 +1644,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1655
1644
  autosave: boolean;
1656
1645
  allowlistEnabled: boolean;
1657
1646
  linkTrackingIds: boolean;
1658
- allowSaveWithErrors: boolean;
1659
1647
  };
1660
1648
  blocks: {
1661
1649
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1796,7 +1784,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1796
1784
  autosave: boolean;
1797
1785
  allowlistEnabled: boolean;
1798
1786
  linkTrackingIds: boolean;
1799
- allowSaveWithErrors: boolean;
1800
1787
  };
1801
1788
  blocks: {
1802
1789
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1937,7 +1924,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1937
1924
  autosave: boolean;
1938
1925
  allowlistEnabled: boolean;
1939
1926
  linkTrackingIds: boolean;
1940
- allowSaveWithErrors: boolean;
1941
1927
  };
1942
1928
  blocks: {
1943
1929
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -2078,7 +2064,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2078
2064
  autosave: boolean;
2079
2065
  allowlistEnabled: boolean;
2080
2066
  linkTrackingIds: boolean;
2081
- allowSaveWithErrors: boolean;
2082
2067
  };
2083
2068
  blocks: {
2084
2069
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -2121,18 +2106,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2121
2106
  };
2122
2107
  } | null;
2123
2108
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => number;
2124
- /**
2125
- * Transactional campaigns keep the hard save block. Reactive getter, so
2126
- * consumers stay safe in setup where a raw config read snapshots null (SD-147945).
2127
- */
2128
- isTransactional(): boolean;
2129
- /**
2130
- * Soft-save policy: may the editor persist a template with validation errors?
2131
- * Default true (host sets features.allowSaveWithErrors=false for transactional +
2132
- * unsub). Reactive getter defaulting true — reading via isFeatureEnabled would
2133
- * floor to false pre-init and momentarily hide the soft-save option (SD-147430).
2134
- */
2135
- allowSaveWithErrors(): boolean;
2136
2109
  /**
2137
2110
  * Get the username
2138
2111
  */
@@ -2231,7 +2204,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2231
2204
  autosave: boolean;
2232
2205
  allowlistEnabled: boolean;
2233
2206
  linkTrackingIds: boolean;
2234
- allowSaveWithErrors: boolean;
2235
2207
  };
2236
2208
  blocks: {
2237
2209
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -2372,7 +2344,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2372
2344
  autosave: boolean;
2373
2345
  allowlistEnabled: boolean;
2374
2346
  linkTrackingIds: boolean;
2375
- allowSaveWithErrors: boolean;
2376
2347
  };
2377
2348
  blocks: {
2378
2349
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -2515,7 +2486,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2515
2486
  autosave: boolean;
2516
2487
  allowlistEnabled: boolean;
2517
2488
  linkTrackingIds: boolean;
2518
- allowSaveWithErrors: boolean;
2519
2489
  };
2520
2490
  blocks: {
2521
2491
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -15,36 +15,6 @@ import type { SavedTemplateDetails } from '@@/Types/stripo';
15
15
  * same source), so it is reliably present regardless of how the block was added.
16
16
  */
17
17
  export declare function getHtmlReferencedUnsubscribePages(html: string): number[];
18
- /**
19
- * Hydrates the recommendation extension store from the persisted `esd-ext-config`
20
- * JSON blob on each `.recommendation-block-v2` element in the raw editor HTML.
21
- *
22
- * Why this runs before `compileHtml`:
23
- * The HTML compiler's `prepareRecommendationBlocks` rule asks
24
- * `useRecommendation.buildCampaignUrl(id)` to assemble each block's API URL
25
- * from `blockStates[id].recommendationConfigs`. That Pinia entry is normally
26
- * populated by `RecommendationBlockControl._syncNodeConfigToStore`, which
27
- * only fires when the user *selects* the block. Saving without ever
28
- * selecting a migrated block would otherwise build the URL from empty/
29
- * default state and the campaign URL would not be saved.
30
- *
31
- * Why we read raw HTML, not compiled HTML:
32
- * Stripo's `compileEmail()` strips editor-only attributes (`esd-*`) from the
33
- * compiled output, so `esd-ext-config` is gone by the time the compiler
34
- * pipeline sees the HTML. The raw HTML from `getTemplateData()` preserves
35
- * the attribute as the migrator wrote it.
36
- *
37
- * Reference data pre-load:
38
- * When the template has recommendation blocks, this also pre-loads the
39
- * shared reference data (languages / currency list) so the save-time
40
- * required-fields validator can check each block's locale and currency
41
- * against the partner's real options. Best-effort — on a fetch failure the
42
- * validator degrades to its empty-list guard (`requiredFields.ts`) instead
43
- * of blocking the save or stranding the Save button.
44
- */
45
- declare function hydrateRecommendationStoreFromRawHtml(rawHtml: string): Promise<void>;
46
18
  export declare const useTemplatePreparation: () => {
47
19
  prepareTemplateDetails: () => Promise<Omit<SavedTemplateDetails, "metadata">>;
48
- hydrateRecommendationStore: typeof hydrateRecommendationStoreFromRawHtml;
49
20
  };
50
- export {};
@@ -1,8 +1,8 @@
1
- import { MessageType as r } from "../@types/config/schemas.js";
1
+ import "../@types/config/schemas.js";
2
2
  import "../@types/config/defaults.js";
3
3
  import { parseConfig as o } from "../@types/config/validator.js";
4
- import { defineStore as a } from "pinia";
5
- const u = a("guido-config", {
4
+ import { defineStore as r } from "pinia";
5
+ const f = r("guido-config", {
6
6
  state: () => ({
7
7
  initialized: !1,
8
8
  config: null
@@ -75,74 +75,57 @@ const u = a("guido-config", {
75
75
  * Get the template ID
76
76
  */
77
77
  templateId: (i) => {
78
- var e, t;
79
- return ((t = (e = i.config) == null ? void 0 : e.identity) == null ? void 0 : t.templateId) ?? "";
78
+ var e, n;
79
+ return ((n = (e = i.config) == null ? void 0 : e.identity) == null ? void 0 : n.templateId) ?? "";
80
80
  },
81
81
  /**
82
82
  * Get the user ID
83
83
  */
84
84
  userId: (i) => {
85
- var e, t;
86
- return ((t = (e = i.config) == null ? void 0 : e.identity) == null ? void 0 : t.userId) ?? "";
85
+ var e, n;
86
+ return ((n = (e = i.config) == null ? void 0 : e.identity) == null ? void 0 : n.userId) ?? "";
87
87
  },
88
88
  /**
89
89
  * Get the variation ID
90
90
  */
91
91
  variationId: (i) => {
92
- var e, t;
93
- return ((t = (e = i.config) == null ? void 0 : e.identity) == null ? void 0 : t.variationId) ?? "";
92
+ var e, n;
93
+ return ((n = (e = i.config) == null ? void 0 : e.identity) == null ? void 0 : n.variationId) ?? "";
94
94
  },
95
95
  /**
96
96
  * Get the partner name
97
97
  */
98
98
  partnerName: (i) => {
99
- var e, t;
100
- return ((t = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : t.name) ?? "";
99
+ var e, n;
100
+ return ((n = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : n.name) ?? "";
101
101
  },
102
102
  /**
103
103
  * Get the product type
104
104
  */
105
105
  productType: (i) => {
106
- var e, t;
107
- return ((t = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : t.productType) ?? 60;
106
+ var e, n;
107
+ return ((n = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : n.productType) ?? 60;
108
108
  },
109
109
  /**
110
110
  * Get the message type
111
111
  */
112
112
  messageType: (i) => {
113
- var e, t;
114
- return ((t = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : t.messageType) ?? 1;
115
- },
116
- /**
117
- * Transactional campaigns keep the hard save block. Reactive getter, so
118
- * consumers stay safe in setup where a raw config read snapshots null (SD-147945).
119
- */
120
- isTransactional() {
121
- return this.messageType === r.TRANSACTIONAL;
122
- },
123
- /**
124
- * Soft-save policy: may the editor persist a template with validation errors?
125
- * Default true (host sets features.allowSaveWithErrors=false for transactional +
126
- * unsub). Reactive getter defaulting true — reading via isFeatureEnabled would
127
- * floor to false pre-init and momentarily hide the soft-save option (SD-147430).
128
- */
129
- allowSaveWithErrors() {
130
- var i;
131
- return ((i = this.features) == null ? void 0 : i.allowSaveWithErrors) ?? !0;
113
+ var e, n;
114
+ return ((n = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : n.messageType) ?? 1;
132
115
  },
133
116
  /**
134
117
  * Get the username
135
118
  */
136
119
  username: (i) => {
137
- var e, t;
138
- return ((t = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : t.username) ?? "Guido User";
120
+ var e, n;
121
+ return ((n = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : n.username) ?? "Guido User";
139
122
  },
140
123
  /**
141
124
  * Check if header should be shown
142
125
  */
143
126
  showHeader: (i) => {
144
- var e, t;
145
- return ((t = (e = i.config) == null ? void 0 : e.ui) == null ? void 0 : t.showHeader) ?? !0;
127
+ var e, n;
128
+ return ((n = (e = i.config) == null ? void 0 : e.ui) == null ? void 0 : n.showHeader) ?? !0;
146
129
  },
147
130
  /**
148
131
  * Check if a specific feature is enabled.
@@ -151,8 +134,8 @@ const u = a("guido-config", {
151
134
  */
152
135
  // eslint-disable-next-line @stylistic/max-len
153
136
  isFeatureEnabled: (i) => (e) => {
154
- var t, n;
155
- return ((n = (t = i.config) == null ? void 0 : t.features) == null ? void 0 : n[e]) ?? !1;
137
+ var n, t;
138
+ return ((t = (n = i.config) == null ? void 0 : n.features) == null ? void 0 : t[e]) ?? !1;
156
139
  }
157
140
  },
158
141
  actions: {
@@ -172,5 +155,5 @@ const u = a("guido-config", {
172
155
  }
173
156
  });
174
157
  export {
175
- u as useConfigStore
158
+ f as useConfigStore
176
159
  };
@@ -1,27 +1,27 @@
1
- import { useActionsApi as R } from "../composables/useActionsApi.js";
1
+ import { useActionsApi as k } from "../composables/useActionsApi.js";
2
2
  import { useConfig as U } from "../composables/useConfig.js";
3
3
  import { useHtmlCompiler as x } from "../composables/useHtmlCompiler.js";
4
4
  import { DEFAULT_CURRENCY as d, DEFAULT_NODE_CONFIG as s } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
5
- import { useRecommendationExtensionStore as T } from "../extensions/Blocks/Recommendation/store/recommendation.js";
5
+ import { useRecommendationExtensionStore as C } from "../extensions/Blocks/Recommendation/store/recommendation.js";
6
6
  import { mapLegacyStrategy as L } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
7
7
  import { DATA_ATTRIBUTES as A } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
8
- import { parsePageList as N } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
9
- import { useDynamicContentStore as z } from "../stores/dynamic-content.js";
10
- import { useEditorStore as _ } from "../stores/editor.js";
11
- import { useUnsubscribeStore as v } from "../stores/unsubscribe.js";
12
- import { assignTrackingIds as O } from "./linkTrackingIds.js";
13
- function M(m) {
8
+ import { parsePageList as R } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
9
+ import { useDynamicContentStore as N } from "../stores/dynamic-content.js";
10
+ import { useEditorStore as z } from "../stores/editor.js";
11
+ import { useUnsubscribeStore as _ } from "../stores/unsubscribe.js";
12
+ import { assignTrackingIds as v } from "./linkTrackingIds.js";
13
+ function O(m) {
14
14
  const n = new DOMParser().parseFromString(m, "text/html").querySelectorAll(`[${A.PAGE_LIST}]`), t = [];
15
15
  return n.forEach((i) => {
16
16
  const o = i.getAttribute(A.PAGE_LIST);
17
- o && t.push(...N(o));
17
+ o && t.push(...R(o));
18
18
  }), [...new Set(t)];
19
19
  }
20
- async function C(m) {
20
+ async function M(m) {
21
21
  const a = new DOMParser().parseFromString(m, "text/html").querySelectorAll(".recommendation-block-v2");
22
22
  if (a.length === 0)
23
23
  return;
24
- const n = T();
24
+ const n = C();
25
25
  a.forEach((t) => {
26
26
  var r, l, g, f, c;
27
27
  const i = t.getAttribute("recommendation-id"), o = i ? Number(i) : NaN;
@@ -68,39 +68,39 @@ async function C(m) {
68
68
  }
69
69
  }
70
70
  const Z = () => {
71
- const m = z(), u = _(), a = v(), { getCompiledEmail: n, getTemplateData: t, updateHtmlAndCss: i } = R(), { compileHtml: o, compileAmpHtml: p } = x(), { isFeatureEnabled: e } = U();
71
+ const m = N(), u = z(), a = _(), { getCompiledEmail: n, getTemplateData: t, updateHtmlAndCss: i } = k(), { compileHtml: o, compileAmpHtml: p } = x(), { isFeatureEnabled: e } = U();
72
72
  return {
73
73
  prepareTemplateDetails: async () => {
74
74
  let { html: r, css: l, syncModulesIds: g = [] } = await t();
75
75
  if (e("linkTrackingIds"))
76
76
  try {
77
- const { html: y, changed: I, nextSeq: k } = O(r, u.trackIdSessionFloor);
78
- u.trackIdSessionFloor = k, I && (r = y, await i(y, l));
77
+ const { html: y, changed: H, nextSeq: I } = v(r, u.trackIdSessionFloor);
78
+ u.trackIdSessionFloor = I, H && (r = y, await i(y, l));
79
79
  } catch (y) {
80
80
  console.error("Tracking-id step failed, saving anyway:", y);
81
81
  }
82
- const { html: f, ampHtml: c = "", ampErrors: w = [] } = await n({
82
+ const { html: f, ampHtml: c = "", ampErrors: T = [] } = await n({
83
83
  minimize: !0,
84
84
  resetDataSavedFlag: !1
85
85
  });
86
- a.selectedUnsubscribePages.length && await a.fetchTemplates(), await C(r);
87
- const { compiledHtml: D, stats: S, appliedRules: E } = o(f), P = c && p(c).compiledHtml, F = m.getSelectedDynamicContentList, H = T(), b = M(r);
86
+ a.selectedUnsubscribePages.length && await a.fetchTemplates(), await M(r);
87
+ const { compiledHtml: w, stats: S, appliedRules: D } = o(f), E = c && p(c).compiledHtml, P = m.getSelectedDynamicContentList, F = C(), b = O(r);
88
88
  return console.debug("HTML Compilation Stats:", {
89
89
  originalSize: S.originalSize,
90
90
  compiledSize: S.compiledSize,
91
91
  reduction: `${S.reductionPercentage.toFixed(2)}%`,
92
- appliedRules: E,
92
+ appliedRules: D,
93
93
  executionTime: `${S.executionTime.toFixed(2)}ms`
94
94
  }), {
95
- dynamicContentList: F,
96
- compiledHtml: D,
95
+ dynamicContentList: P,
96
+ compiledHtml: w,
97
97
  rawHtml: r,
98
98
  css: l,
99
- ampHtml: P,
100
- ampErrors: w,
99
+ ampHtml: E,
100
+ ampErrors: T,
101
101
  modules: g.map(Number),
102
102
  recommendation: {
103
- campaignUrls: H.recommendationCampaignUrls,
103
+ campaignUrls: F.recommendationCampaignUrls,
104
104
  configs: {}
105
105
  },
106
106
  unsubscribe: {
@@ -108,13 +108,10 @@ const Z = () => {
108
108
  config: b
109
109
  }
110
110
  };
111
- },
112
- // Exposed so the back/test validate-only path can seed the reco store the
113
- // same way a full save does (required-field findings depend on it).
114
- hydrateRecommendationStore: C
111
+ }
115
112
  };
116
113
  };
117
114
  export {
118
- M as getHtmlReferencedUnsubscribePages,
115
+ O as getHtmlReferencedUnsubscribePages,
119
116
  Z as useTemplatePreparation
120
117
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.17.0-beta.ea65303",
3
+ "version": "3.17.0-beta.ec8eabb",
4
4
  "description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
5
5
  "main": "./dist/guido.umd.cjs",
6
6
  "module": "./dist/library.js",
@@ -1,20 +0,0 @@
1
- import a from "./ValidationErrorDrawer.vue2.js";
2
- /* empty css */
3
- import s from "../../../_virtual/_plugin-vue2_normalizer.js";
4
- var i = function() {
5
- var r = this, o = r._self._c, t = r._self._setupProxy;
6
- return o(t.WpDrawer, { attrs: { id: "guido__validation-error-drawer", size: "small", "footer-button-group-options": t.footerButtonGroupOptions, status: t.store.isDrawerOpen, "title-text": t.titleText }, on: { onCloseEvent: t.handleClose, primaryButtonEvent: t.handleClose, secondaryButtonEvent: t.handleSaveAndContinue } }, [o("div", { staticClass: "d-f f-d-c validation-error-list" }, r._l(t.rows, function(e, n) {
7
- return o("div", { key: n, staticClass: "d-f a-i-c validation-error-row" }, [o(t.InIcons, { staticClass: "validation-error-row__icon i-c-12", attrs: { name: "filled-caution-triangle" } }), o("span", { staticClass: "validation-error-row__text" }, [r._v(r._s(e))])], 1);
8
- }), 0)]);
9
- }, l = [], _ = /* @__PURE__ */ s(
10
- a,
11
- i,
12
- l,
13
- !1,
14
- null,
15
- "30d2e1f9"
16
- );
17
- const p = _.exports;
18
- export {
19
- p as default
20
- };
@@ -1,48 +0,0 @@
1
- import { defineComponent as m, ref as p, computed as a } from "vue";
2
- import f from "../../wrappers/WpDrawer.vue.js";
3
- import { useSave as S } from "../../../composables/useSave.js";
4
- import { useTranslations as v } from "../../../composables/useTranslations.js";
5
- import { useConfigStore as g } from "../../../stores/config.js";
6
- import { useEditorStore as y } from "../../../stores/editor.js";
7
- import { useSaveValidationStore as h } from "../../../stores/save-validation.js";
8
- import { InIcons as w } from "@useinsider/design-system-vue";
9
- const I = /* @__PURE__ */ m({
10
- __name: "ValidationErrorDrawer",
11
- setup(_) {
12
- const r = v(), e = h(), n = y(), s = g(), { saveWithErrors: i } = S(), o = p(!1), l = a(() => `${r("email-editor.validation-errors")} (${e.errorCount})`), u = a(() => {
13
- const t = {
14
- primaryButton: {
15
- styling: "solid",
16
- type: "primary",
17
- labelText: r("email-editor.update-design")
18
- }
19
- };
20
- return s.allowSaveWithErrors && e.intent !== "test" && (t.secondaryButton = {
21
- styling: "solid",
22
- type: "subtle-primary",
23
- labelText: r("email-editor.save-and-continue"),
24
- loadingStatus: o.value
25
- }), t;
26
- }), d = a(() => e.errors.map((t) => {
27
- const c = t.detail ? ` (${t.detail})` : "";
28
- return `${t.message}${c}`;
29
- }));
30
- return { __sfc: !0, trans: r, store: e, editorStore: n, configStore: s, saveWithErrors: i, isSaving: o, titleText: l, footerButtonGroupOptions: u, rows: d, handleClose: () => {
31
- e.isDrawerOpen && e.close();
32
- }, handleSaveAndContinue: async () => {
33
- if (!o.value) {
34
- o.value = !0, n.loadingStatus = !0;
35
- try {
36
- await i() ? e.close() : n.loadingStatus = !1;
37
- } catch (t) {
38
- console.warn("Soft-save failed; keeping the drawer open.", t), n.loadingStatus = !1;
39
- } finally {
40
- o.value = !1;
41
- }
42
- }
43
- }, WpDrawer: f, InIcons: w };
44
- }
45
- });
46
- export {
47
- I as default
48
- };