@useinsider/guido 3.16.0-beta.efbb91f → 3.16.0-beta.fe1df65

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 (81) hide show
  1. package/dist/components/Guido.vue.js +8 -8
  2. package/dist/components/Guido.vue2.js +76 -78
  3. package/dist/components/organisms/AutoSaveController.vue2.js +8 -9
  4. package/dist/components/organisms/header/EditorActions.vue.js +2 -2
  5. package/dist/components/organisms/header/EditorActions.vue2.js +43 -74
  6. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  7. package/dist/components/organisms/header/LeftSlot.vue2.js +23 -45
  8. package/dist/components/wrappers/WpDrawer.vue.js +7 -9
  9. package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
  10. package/dist/composables/useHtmlValidator.js +0 -1
  11. package/dist/composables/useRecommendation.js +20 -19
  12. package/dist/composables/useSave.js +41 -84
  13. package/dist/composables/validators/useCouponBlockValidator.js +21 -24
  14. package/dist/composables/validators/useUnsubscribeBlockValidator.js +27 -34
  15. package/dist/config/migrator/index.js +9 -8
  16. package/dist/config/migrator/itemsBlockMigrator.js +1 -1
  17. package/dist/config/migrator/recommendation/compositionMapper.js +20 -20
  18. package/dist/config/migrator/recommendation/extractors.js +29 -24
  19. package/dist/config/migrator/recommendation/htmlBuilder.js +116 -130
  20. package/dist/config/migrator/recommendationMigrator.js +18 -15
  21. package/dist/config/migrator/recommendationTitleMigrator.js +119 -0
  22. package/dist/enums/recommendation.js +17 -17
  23. package/dist/extensions/Blocks/Items/enums/productEnums.js +45 -45
  24. package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
  25. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  26. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +23 -22
  27. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +29 -26
  28. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +306 -238
  29. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +37 -26
  30. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +29 -28
  31. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +1 -0
  32. package/dist/extensions/Blocks/Recommendation/controls/title/index.js +44 -0
  33. package/dist/extensions/Blocks/Recommendation/extension.js +31 -29
  34. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +23 -4
  35. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +26 -32
  36. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +3 -3
  37. package/dist/extensions/Blocks/Recommendation/templates/titleRows.js +33 -0
  38. package/dist/extensions/Blocks/Recommendation/templates/utils.js +85 -107
  39. package/dist/extensions/Blocks/Recommendation/utils/productIds.js +6 -0
  40. package/dist/guido.css +1 -1
  41. package/dist/src/components/Guido.vue.d.ts +1 -17
  42. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -17
  43. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -17
  44. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -17
  45. package/dist/src/components/wrappers/WpDrawer.vue.d.ts +3 -4
  46. package/dist/src/composables/useHtmlValidator.d.ts +0 -14
  47. package/dist/src/composables/useSave.d.ts +1 -6
  48. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +0 -3
  49. package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +0 -10
  50. package/dist/src/config/migrator/recommendation/extractors.d.ts +8 -0
  51. package/dist/src/config/migrator/recommendationTitleMigrator.d.ts +1 -0
  52. package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +2 -1
  53. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +7 -0
  54. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +1 -0
  55. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  56. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +4 -0
  57. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +10 -0
  58. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
  59. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +1 -0
  60. package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +86 -0
  61. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -5
  62. package/dist/src/extensions/Blocks/Recommendation/templates/titleRows.d.ts +13 -0
  63. package/dist/src/extensions/Blocks/Recommendation/utils/productIds.d.ts +6 -0
  64. package/dist/src/stores/config.d.ts +0 -5
  65. package/dist/src/utils/templatePreparation.d.ts +0 -30
  66. package/dist/static/styles/customEditorStyle.css.js +3 -1
  67. package/dist/stores/config.js +6 -13
  68. package/dist/utils/templatePreparation.js +25 -28
  69. package/package.json +1 -1
  70. package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +0 -20
  71. package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +0 -61
  72. package/dist/composables/useSaveValidation.js +0 -276
  73. package/dist/composables/useSaveValidationRollout.js +0 -9
  74. package/dist/enums/save-validation.js +0 -4
  75. package/dist/src/@types/save-validation.d.ts +0 -19
  76. package/dist/src/components/organisms/validation/ValidationErrorDrawer.vue.d.ts +0 -2
  77. package/dist/src/composables/useSaveValidation.d.ts +0 -6
  78. package/dist/src/composables/useSaveValidationRollout.d.ts +0 -3
  79. package/dist/src/enums/save-validation.d.ts +0 -27
  80. package/dist/src/stores/save-validation.d.ts +0 -22
  81. package/dist/stores/save-validation.js +0 -30
@@ -58,6 +58,10 @@ export declare const ATTR_PRODUCT_OLD_PRICE = "productOldPrice";
58
58
  export declare const ATTR_PRODUCT_OMNIBUS_PRICE = "productOmnibusPrice";
59
59
  export declare const ATTR_PRODUCT_OMNIBUS_DISCOUNT = "productOmnibusDiscount";
60
60
  export declare const ATTR_PRODUCT_BUTTON = "productButton";
61
+ export declare const ATTR_RECOMMENDATION_TITLE = "recommendationTitle";
62
+ export declare const CSS_CLASS_TITLE_CELL = "ins-recommendation-title";
63
+ /** Title cell — the only `esd-block-text` living outside the product containers. */
64
+ export declare const SELECTOR_TITLE_CELL = ".ins-recommendation-title";
61
65
  /**
62
66
  * Custom attribute constants
63
67
  * Used for dynamically added product attributes in Card Composition
@@ -33,6 +33,8 @@ export declare class RecommendationCardCompositionControl extends CommonControl
33
33
  private _normalizeComposition;
34
34
  private _readCustomAttributesFromNode;
35
35
  private _readVisibilityFromRows;
36
+ private _withTitlePresence;
37
+ private _hasTitle;
36
38
  private _getDefaultVisibilities;
37
39
  private _extractVisibilityFromRows;
38
40
  private _parseVisibilityValue;
@@ -187,6 +189,14 @@ export declare class RecommendationCardCompositionControl extends CommonControl
187
189
  */
188
190
  private _buildCompositionHtml;
189
191
  private _applyVisibilityToBlock;
192
+ private _applyTitleVisibilityToBlock;
193
+ private _resolveTitleInjection;
194
+ private _findTitleRows;
195
+ private _findTitleRowsByClass;
196
+ private _isSpacerRow;
197
+ private _findTitleContainerBody;
198
+ private _readInnerHtml;
199
+ private _defaultTitleParagraph;
190
200
  /**
191
201
  * Finds the composition array index for the Nth custom attribute (0-based).
192
202
  * Scans left-to-right, counting only entries with the custom prefix.
@@ -11,6 +11,7 @@
11
11
  */
12
12
  export { RecommendationBlockControl, CONTROL_BLOCK_ID, AlgorithmControl, ALGORITHM_CONTROL_ID, LocaleControl, LOCALE_CONTROL_ID, CurrencyControl, CURRENCY_CONTROL_ID, ProductCountControl, PRODUCT_COUNT_CONTROL_ID, ProductLayoutControl, PRODUCT_LAYOUT_CONTROL_ID, FiltersControl, FILTERS_CONTROL_ID, ShuffleControl, SHUFFLE_CONTROL_ID, LayoutOrientationControl, LAYOUT_ORIENTATION_CONTROL_ID, PricePlacementControl, PRICE_PLACEMENT_CONTROL_ID, } from './main';
13
13
  export * from './main/utils';
14
+ export { TitleControls } from './title';
14
15
  export { NameControls } from './name';
15
16
  export { PriceControls } from './price';
16
17
  export { OldPriceControls } from './oldPrice';
@@ -70,6 +70,7 @@ export interface RegenerateProductRowsOptions {
70
70
  /** Optional: pass composition directly to avoid stale DOM reads after setAttribute */
71
71
  composition?: string[];
72
72
  }
73
+ export declare function getMainContainerTbody(currentNode: ImmutableHtmlNode): ImmutableHtmlNode | null;
73
74
  /**
74
75
  * Regenerates only the mobile product container rows and commits in a single apply().
75
76
  * Standalone entry point for callers that change mobile-only settings
@@ -0,0 +1,86 @@
1
+ export declare const TitleControls: {
2
+ readonly align: {
3
+ new (): {
4
+ getId(): string;
5
+ getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
6
+ getParentControlId(): string;
7
+ api: import("@stripoinc/ui-editor-extensions").ControlApi;
8
+ getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
9
+ getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
10
+ getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
11
+ isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
12
+ };
13
+ };
14
+ readonly color: {
15
+ new (): {
16
+ getId(): string;
17
+ getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
18
+ getParentControlId(): string;
19
+ api: import("@stripoinc/ui-editor-extensions").ControlApi;
20
+ getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
21
+ getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
22
+ getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
23
+ isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
24
+ };
25
+ };
26
+ readonly size: {
27
+ new (): {
28
+ getId(): string;
29
+ getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
30
+ getParentControlId(): string;
31
+ api: import("@stripoinc/ui-editor-extensions").ControlApi;
32
+ getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
33
+ getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
34
+ getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
35
+ isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
36
+ };
37
+ };
38
+ readonly style: {
39
+ new (): {
40
+ getId(): string;
41
+ getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
42
+ getParentControlId(): string;
43
+ api: import("@stripoinc/ui-editor-extensions").ControlApi;
44
+ getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
45
+ getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
46
+ getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
47
+ isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
48
+ };
49
+ };
50
+ readonly fontFamily: {
51
+ new (): {
52
+ getId(): string;
53
+ getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
54
+ getParentControlId(): string;
55
+ api: import("@stripoinc/ui-editor-extensions").ControlApi;
56
+ getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
57
+ getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
58
+ getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
59
+ isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
60
+ };
61
+ };
62
+ readonly background: {
63
+ new (): {
64
+ getId(): string;
65
+ getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
66
+ getAdditionalModifications(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
67
+ getParentControlId(): string;
68
+ api: import("@stripoinc/ui-editor-extensions").ControlApi;
69
+ getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
70
+ getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
71
+ isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
72
+ };
73
+ };
74
+ readonly paddings: {
75
+ new (): {
76
+ getId(): string;
77
+ getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
78
+ getParentControlId(): string;
79
+ api: import("@stripoinc/ui-editor-extensions").ControlApi;
80
+ getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
81
+ getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
82
+ getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
83
+ isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
84
+ };
85
+ };
86
+ };
@@ -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
  }>;
@@ -0,0 +1,13 @@
1
+ export declare const DEFAULT_TITLE_TEXT = "You May Also Like!";
2
+ export declare const DEFAULT_TITLE_PARAGRAPH: string;
3
+ /**
4
+ * Builds the two block-level title rows: the title itself and the spacer below it.
5
+ * Both carry the same `recommendation-attribute-row` tagging a card attribute row has,
6
+ * so the Card Composition toggle hides the pair together and the compiler's
7
+ * `[data-visibility="0"]` sweep drops both — no leading gap when the title is off.
8
+ * @param paragraphHtml - Full `<p>` markup rendered inside the title cell
9
+ * @param visible - Whether the title starts visible
10
+ * @param spacerHeightPx - Height of the spacer row below the title
11
+ * @returns HTML string with the title row followed by its spacer row
12
+ */
13
+ export declare function buildTitleRows(paragraphHtml?: string, visible?: boolean, spacerHeightPx?: number): string;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Builds the request/URL `productId` value from raw product ID segments.
3
+ * Trimming happens here — NOT on input change — so the user's in-progress
4
+ * text (trailing commas, spaces) is never rewritten under the caret (SD-147111).
5
+ */
6
+ export declare function sanitizeProductIds(ids: readonly (string | number | null | undefined)[]): string;
@@ -2106,11 +2106,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2106
2106
  };
2107
2107
  } | null;
2108
2108
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => number;
2109
- /**
2110
- * Transactional campaigns keep the hard save block. Reactive getter, so
2111
- * consumers stay safe in setup where a raw config read snapshots null (SD-147945).
2112
- */
2113
- isTransactional(): boolean;
2114
2109
  /**
2115
2110
  * Get the username
2116
2111
  */
@@ -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 {};
@@ -43,7 +43,9 @@ const n = `.esd-x,
43
43
  .recommendation-block-v2 .product-omnibus-discount ue-node-actions,
44
44
  .recommendation-block-v2 .product-omnibus-discount ue-node-panel,
45
45
  .recommendation-block-v2 .product-button ue-node-actions,
46
- .recommendation-block-v2 .product-button ue-node-panel {
46
+ .recommendation-block-v2 .product-button ue-node-panel,
47
+ .recommendation-block-v2 .ins-recommendation-title ue-node-actions,
48
+ .recommendation-block-v2 .ins-recommendation-title ue-node-panel {
47
49
  display: none !important;
48
50
  }
49
51
 
@@ -1,8 +1,8 @@
1
- import { MessageType as o } from "../@types/config/schemas.js";
1
+ import "../@types/config/schemas.js";
2
2
  import "../@types/config/defaults.js";
3
- import { parseConfig as r } from "../@types/config/validator.js";
4
- import { defineStore as a } from "pinia";
5
- const g = a("guido-config", {
3
+ import { parseConfig as o } from "../@types/config/validator.js";
4
+ import { defineStore as r } from "pinia";
5
+ const f = r("guido-config", {
6
6
  state: () => ({
7
7
  initialized: !1,
8
8
  config: null
@@ -113,13 +113,6 @@ const g = a("guido-config", {
113
113
  var e, n;
114
114
  return ((n = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : n.messageType) ?? 1;
115
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 === o.TRANSACTIONAL;
122
- },
123
116
  /**
124
117
  * Get the username
125
118
  */
@@ -150,7 +143,7 @@ const g = a("guido-config", {
150
143
  * Initialize the config store with validated configuration
151
144
  */
152
145
  init(i) {
153
- const e = r(i);
146
+ const e = o(i);
154
147
  this.config = e, this.initialized = !0;
155
148
  },
156
149
  /**
@@ -162,5 +155,5 @@ const g = a("guido-config", {
162
155
  }
163
156
  });
164
157
  export {
165
- g as useConfigStore
158
+ f as useConfigStore
166
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.16.0-beta.efbb91f",
3
+ "version": "3.16.0-beta.fe1df65",
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 n 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.handleSecondary } }, [o("div", { staticClass: "d-f f-d-c validation-error-list" }, r._l(t.rows, function(e, a) {
7
- return o("div", { key: a, 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
- n,
11
- i,
12
- l,
13
- !1,
14
- null,
15
- "cbfabe9a"
16
- );
17
- const u = _.exports;
18
- export {
19
- u as default
20
- };
@@ -1,61 +0,0 @@
1
- import { defineComponent as S, ref as v, computed as a } from "vue";
2
- import g from "../../wrappers/WpDrawer.vue.js";
3
- import { useBack as h } from "../../../composables/useGuidoActions.js";
4
- import { useSave as _ } from "../../../composables/useSave.js";
5
- import { useTranslations as b } from "../../../composables/useTranslations.js";
6
- import { useConfigStore as w } from "../../../stores/config.js";
7
- import { useEditorStore as B } from "../../../stores/editor.js";
8
- import { useSaveValidationStore as T } from "../../../stores/save-validation.js";
9
- import { InIcons as x } from "@useinsider/design-system-vue";
10
- const L = /* @__PURE__ */ S({
11
- __name: "ValidationErrorDrawer",
12
- setup(C) {
13
- const o = b(), t = T(), n = B(), s = w(), { saveWithErrors: i } = _(), l = h(), r = v(!1), d = a(() => `${o("email-editor.validation-errors")} (${t.errorCount})`), m = a(() => {
14
- const e = {
15
- primaryButton: {
16
- styling: "solid",
17
- type: "primary",
18
- labelText: o("email-editor.update-design")
19
- }
20
- };
21
- return t.intent === "back" ? e.secondaryButton = {
22
- styling: "solid",
23
- type: "subtle-primary",
24
- labelText: o("email-editor.leave-without-saving")
25
- } : !s.isTransactional && t.intent !== "test" && (e.secondaryButton = {
26
- styling: "solid",
27
- type: "subtle-primary",
28
- labelText: o("email-editor.save-and-continue"),
29
- loadingStatus: r.value
30
- }), e;
31
- }), p = a(() => t.errors.map((e) => {
32
- const y = e.detail ? ` (${e.detail})` : "";
33
- return `${e.message}${y}`;
34
- })), f = () => {
35
- t.isDrawerOpen && t.close();
36
- }, c = async () => {
37
- if (!r.value) {
38
- r.value = !0, n.loadingStatus = !0;
39
- try {
40
- await i() ? t.close() : n.loadingStatus = !1;
41
- } catch {
42
- n.loadingStatus = !1;
43
- } finally {
44
- r.value = !1;
45
- }
46
- }
47
- }, u = () => {
48
- t.close(), l();
49
- };
50
- return { __sfc: !0, trans: o, store: t, editorStore: n, configStore: s, saveWithErrors: i, handleBack: l, isSaving: r, titleText: d, footerButtonGroupOptions: m, rows: p, handleClose: f, handleSaveAndContinue: c, handleDiscardAndLeave: u, handleSecondary: () => {
51
- if (t.intent === "back") {
52
- u();
53
- return;
54
- }
55
- c();
56
- }, WpDrawer: g, InIcons: x };
57
- }
58
- });
59
- export {
60
- L as default
61
- };