@useinsider/guido 3.18.1-beta.e39fb14 → 3.18.1-beta.e489d08

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 (67) hide show
  1. package/README.md +0 -1
  2. package/dist/@types/config/schemas.js +26 -28
  3. package/dist/components/Guido.vue.js +6 -6
  4. package/dist/components/Guido.vue2.js +70 -72
  5. package/dist/components/organisms/AutoSaveController.vue2.js +8 -9
  6. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +13 -11
  7. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +65 -53
  8. package/dist/components/organisms/header/EditorActions.vue.js +2 -2
  9. package/dist/components/organisms/header/EditorActions.vue2.js +56 -86
  10. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  11. package/dist/components/organisms/header/LeftSlot.vue2.js +12 -16
  12. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +20 -18
  13. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +21 -0
  14. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +47 -0
  15. package/dist/components/wrappers/WpDrawer.vue.js +7 -9
  16. package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
  17. package/dist/composables/useCustomInterfaceAppearance.js +46 -41
  18. package/dist/composables/useHtmlCompiler.js +26 -37
  19. package/dist/composables/useHtmlValidator.js +84 -81
  20. package/dist/composables/useRecommendation.js +21 -18
  21. package/dist/composables/useSave.js +45 -90
  22. package/dist/composables/useStripo.js +7 -7
  23. package/dist/composables/validators/useCouponBlockValidator.js +21 -24
  24. package/dist/composables/validators/useUnsubscribeBlockValidator.js +27 -34
  25. package/dist/enums/extensions/recommendationBlock.js +38 -31
  26. package/dist/extensions/Blocks/Recommendation/block.js +43 -39
  27. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +62 -57
  28. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +80 -52
  29. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +145 -75
  30. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +21 -12
  31. package/dist/guido.css +1 -1
  32. package/dist/src/@types/config/schemas.d.ts +0 -4
  33. package/dist/src/components/Guido.vue.d.ts +1 -17
  34. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -17
  35. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -17
  36. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -17
  37. package/dist/src/components/wrappers/WpDrawer.vue.d.ts +3 -4
  38. package/dist/src/composables/useConfig.d.ts +0 -2
  39. package/dist/src/composables/useHtmlValidator.d.ts +0 -21
  40. package/dist/src/composables/useSave.d.ts +1 -6
  41. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +0 -3
  42. package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +0 -10
  43. package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -0
  44. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +2 -0
  45. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +9 -0
  46. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +59 -3
  47. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +4 -0
  48. package/dist/src/stores/config.d.ts +0 -30
  49. package/dist/src/stores/onboarding.d.ts +377 -0
  50. package/dist/src/utils/templatePreparation.d.ts +0 -30
  51. package/dist/static/styles/components/recommendation-strategy.css.js +51 -4
  52. package/dist/stores/config.js +22 -39
  53. package/dist/stores/onboarding.js +41 -36
  54. package/dist/utils/templatePreparation.js +47 -50
  55. package/package.json +1 -1
  56. package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +0 -20
  57. package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +0 -48
  58. package/dist/composables/useSaveValidation.js +0 -279
  59. package/dist/composables/useSaveValidationRollout.js +0 -9
  60. package/dist/enums/save-validation.js +0 -4
  61. package/dist/src/@types/save-validation.d.ts +0 -19
  62. package/dist/src/composables/useSaveValidation.d.ts +0 -6
  63. package/dist/src/composables/useSaveValidationRollout.d.ts +0 -3
  64. package/dist/src/enums/save-validation.d.ts +0 -27
  65. package/dist/src/stores/save-validation.d.ts +0 -22
  66. package/dist/stores/save-validation.js +0 -30
  67. /package/dist/src/components/organisms/{validation/ValidationErrorDrawer.vue.d.ts → onboarding/RecommendationStrategyOnboarding.vue.d.ts} +0 -0
@@ -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,5 +1,5 @@
1
- import { useOnboardingApi as s } from "../services/onboardingApi.js";
2
- import { defineStore as e } from "pinia";
1
+ import { useOnboardingApi as e } from "../services/onboardingApi.js";
2
+ import { defineStore as s } from "pinia";
3
3
  const t = () => ({
4
4
  cardIndex: 0,
5
5
  isActive: !1,
@@ -11,49 +11,54 @@ const t = () => ({
11
11
  textBlockOnboarding: t(),
12
12
  versionHistoryOnboarding: t(),
13
13
  ampOnboarding: t(),
14
- itemsOnboarding: t()
14
+ itemsOnboarding: t(),
15
+ recommendationStrategyOnboarding: t()
15
16
  },
16
17
  userModalState: {},
17
18
  isFetched: !1
18
- }), c = e("guidoOnboarding", {
19
+ }), c = s("guidoOnboarding", {
19
20
  state: () => a(),
20
21
  getters: {
21
- getOnboarding: (n) => (i) => n.onboardings[i],
22
- isActive: (n) => (i) => n.onboardings[i].isActive,
23
- getCurrentCard: (n) => (i) => {
24
- const o = n.onboardings[i];
25
- return o.config[o.cardIndex];
22
+ getOnboarding: (n) => (o) => n.onboardings[o],
23
+ isActive: (n) => (o) => n.onboardings[o].isActive,
24
+ getCurrentCard: (n) => (o) => {
25
+ const i = n.onboardings[o];
26
+ return i.config[i.cardIndex];
26
27
  },
27
28
  getGenericCurrentCard: (n) => {
28
- const { genericOnboarding: i } = n.onboardings;
29
- return i.config[i.cardIndex];
29
+ const { genericOnboarding: o } = n.onboardings;
30
+ return o.config[o.cardIndex];
30
31
  },
31
32
  getTextBlockCurrentCard: (n) => {
32
- const { textBlockOnboarding: i } = n.onboardings;
33
- return i.config[i.cardIndex];
33
+ const { textBlockOnboarding: o } = n.onboardings;
34
+ return o.config[o.cardIndex];
34
35
  },
35
36
  getVersionHistoryCurrentCard: (n) => {
36
- const { versionHistoryOnboarding: i } = n.onboardings;
37
- return i.config[i.cardIndex];
37
+ const { versionHistoryOnboarding: o } = n.onboardings;
38
+ return o.config[o.cardIndex];
38
39
  },
39
40
  getAmpCurrentCard: (n) => {
40
- const { ampOnboarding: i } = n.onboardings;
41
- return i.config[i.cardIndex];
41
+ const { ampOnboarding: o } = n.onboardings;
42
+ return o.config[o.cardIndex];
42
43
  },
43
44
  getItemsCurrentCard: (n) => {
44
- const { itemsOnboarding: i } = n.onboardings;
45
- return i.config[i.cardIndex];
45
+ const { itemsOnboarding: o } = n.onboardings;
46
+ return o.config[o.cardIndex];
47
+ },
48
+ getRecommendationStrategyCurrentCard: (n) => {
49
+ const { recommendationStrategyOnboarding: o } = n.onboardings;
50
+ return o.config[o.cardIndex];
46
51
  },
47
- shouldShowOnboarding: (n) => (i) => {
48
- const o = n.userModalState.Guido;
49
- return i === "newVersionPopup" && (o != null && o.genericOnboarding) ? !1 : o ? !o[i] : !0;
52
+ shouldShowOnboarding: (n) => (o) => {
53
+ const i = n.userModalState.Guido;
54
+ return o === "newVersionPopup" && (i != null && i.genericOnboarding) ? !1 : i ? !i[o] : !0;
50
55
  }
51
56
  },
52
57
  actions: {
53
58
  closeOtherOnboardings(n) {
54
- Object.keys(this.onboardings).forEach((i) => {
55
- const o = i;
56
- o !== n && this.onboardings[o].isActive && (this.onboardings[o].isActive = !1, this.onboardings[o].cardIndex = 0, this.onboardings[o].config = []);
59
+ Object.keys(this.onboardings).forEach((o) => {
60
+ const i = o;
61
+ i !== n && this.onboardings[i].isActive && (this.onboardings[i].isActive = !1, this.onboardings[i].cardIndex = 0, this.onboardings[i].config = []);
57
62
  });
58
63
  },
59
64
  start(n) {
@@ -71,12 +76,12 @@ const t = () => ({
71
76
  previous(n) {
72
77
  this.onboardings[n].cardIndex > 0 && this.onboardings[n].cardIndex--;
73
78
  },
74
- updateCardPosition(n, i, o) {
75
- const r = this.onboardings[n].config[i];
76
- r && (r.top = o.top, r.position = o.position);
79
+ updateCardPosition(n, o, i) {
80
+ const r = this.onboardings[n].config[o];
81
+ r && (r.top = i.top, r.position = i.position);
77
82
  },
78
- setConfig(n, i) {
79
- this.onboardings[n].config = i ?? [], this.onboardings[n].cardIndex >= this.onboardings[n].config.length && (this.onboardings[n].cardIndex = 0);
83
+ setConfig(n, o) {
84
+ this.onboardings[n].config = o ?? [], this.onboardings[n].cardIndex >= this.onboardings[n].config.length && (this.onboardings[n].cardIndex = 0);
80
85
  },
81
86
  async onDiscoverNowClicked() {
82
87
  await this.setUserModalState("newVersionPopup", "true", "Guido"), await this.setUserModalState("genericOnboarding", "true", "Guido"), this.start("genericOnboarding");
@@ -93,16 +98,16 @@ const t = () => ({
93
98
  async fetchUserModalState() {
94
99
  if (this.isFetched)
95
100
  return;
96
- const { fetchUserModalState: n } = s();
101
+ const { fetchUserModalState: n } = e();
97
102
  try {
98
- const i = await n();
99
- this.userModalState = i, this.isFetched = !0;
103
+ const o = await n();
104
+ this.userModalState = o, this.isFetched = !0;
100
105
  } catch {
101
106
  }
102
107
  },
103
- async setUserModalState(n, i, o) {
104
- const { setUserModalState: r } = s();
105
- await r(n, i, o), this.isFetched = !1, await this.fetchUserModalState();
108
+ async setUserModalState(n, o, i) {
109
+ const { setUserModalState: r } = e();
110
+ await r(n, o, i), this.isFetched = !1, await this.fetchUserModalState();
106
111
  }
107
112
  }
108
113
  });
@@ -1,31 +1,31 @@
1
1
  import { useActionsApi as R } from "../composables/useActionsApi.js";
2
- import { useConfig as U } from "../composables/useConfig.js";
3
- import { useHtmlCompiler as x } from "../composables/useHtmlCompiler.js";
4
- import { DEFAULT_CURRENCY as d, DEFAULT_NODE_CONFIG as a } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
2
+ import { useConfig as k } from "../composables/useConfig.js";
3
+ import { useHtmlCompiler as N } from "../composables/useHtmlCompiler.js";
4
+ import { CURRENT_CONFIG_VERSION as U, DEFAULT_CURRENCY as d, DEFAULT_NODE_CONFIG as a } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
5
5
  import { useRecommendationExtensionStore as T } from "../extensions/Blocks/Recommendation/store/recommendation.js";
6
- import { mapLegacyStrategy as L } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
6
+ import { mapLegacyStrategy as x } 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";
8
+ import { parsePageList as L } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
9
9
  import { useDynamicContentStore as z } from "../stores/dynamic-content.js";
10
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) {
11
+ import { useUnsubscribeStore as O } from "../stores/unsubscribe.js";
12
+ import { assignTrackingIds as v } from "./linkTrackingIds.js";
13
+ function B(m) {
14
14
  const i = new DOMParser().parseFromString(m, "text/html").querySelectorAll(`[${A.PAGE_LIST}]`), t = [];
15
15
  return i.forEach((s) => {
16
- const o = s.getAttribute(A.PAGE_LIST);
17
- o && t.push(...N(o));
16
+ const r = s.getAttribute(A.PAGE_LIST);
17
+ r && t.push(...L(r));
18
18
  }), [...new Set(t)];
19
19
  }
20
- async function C(m) {
20
+ async function G(m) {
21
21
  const n = new DOMParser().parseFromString(m, "text/html").querySelectorAll(".recommendation-block-v2");
22
22
  if (n.length === 0)
23
23
  return;
24
24
  const i = T();
25
25
  n.forEach((t) => {
26
- var r, l, g, f, c;
27
- const s = t.getAttribute("recommendation-id"), o = s ? Number(s) : NaN;
28
- if (!Number.isFinite(o))
26
+ var l, g, f, c, y;
27
+ const s = t.getAttribute("recommendation-id"), r = s ? Number(s) : NaN;
28
+ if (!Number.isFinite(r))
29
29
  return;
30
30
  const p = t.getAttribute("esd-ext-config");
31
31
  if (!p)
@@ -38,11 +38,11 @@ async function C(m) {
38
38
  }
39
39
  if (!e || typeof e != "object" || Array.isArray(e))
40
40
  return;
41
- const h = {
41
+ const b = !!e.strategyId || (e.configVersion ?? 0) >= U, o = {
42
42
  // Normalize legacy strategy keys (e.g. `mostViewed` → `mostPopular`) so
43
43
  // already-saved blocks that never re-run the migrator don't emit a
44
44
  // strategy-less campaign URL. `||` also catches '' / undefined (SD-144882).
45
- strategy: L(e.strategy) || a.strategy,
45
+ strategy: x(e.strategy) || (b ? "" : a.strategy),
46
46
  strategyId: e.strategyId ?? a.strategyId,
47
47
  language: e.language ?? a.language,
48
48
  size: e.size ?? a.size,
@@ -51,13 +51,13 @@ async function C(m) {
51
51
  productIds: e.productIds ?? [...a.productIds],
52
52
  filters: e.filters ?? [...a.filters],
53
53
  shuffleProducts: e.shuffleProducts ?? a.shuffleProducts,
54
- currencyCode: ((r = e.currency) == null ? void 0 : r.code) ?? d.code,
55
- currencyAlignment: ((l = e.currency) == null ? void 0 : l.alignment) ?? d.alignment,
56
- currencyDecimalCount: ((g = e.currency) == null ? void 0 : g.decimalCount) ?? d.decimalCount,
57
- currencyDecimalSeparator: ((f = e.currency) == null ? void 0 : f.decimalSeparator) ?? d.decimalSeparator,
58
- currencyThousandSeparator: ((c = e.currency) == null ? void 0 : c.thousandSeparator) ?? d.thousandSeparator
54
+ currencyCode: ((l = e.currency) == null ? void 0 : l.code) ?? d.code,
55
+ currencyAlignment: ((g = e.currency) == null ? void 0 : g.alignment) ?? d.alignment,
56
+ currencyDecimalCount: ((f = e.currency) == null ? void 0 : f.decimalCount) ?? d.decimalCount,
57
+ currencyDecimalSeparator: ((c = e.currency) == null ? void 0 : c.decimalSeparator) ?? d.decimalSeparator,
58
+ currencyThousandSeparator: ((y = e.currency) == null ? void 0 : y.thousandSeparator) ?? d.thousandSeparator
59
59
  };
60
- i.seedBlockUrlConfig(o, h);
60
+ i.seedBlockUrlConfig(r, o);
61
61
  });
62
62
  try {
63
63
  await i.fetchRecommendationCreateData();
@@ -68,54 +68,51 @@ async function C(m) {
68
68
  );
69
69
  }
70
70
  }
71
- const Z = () => {
72
- const m = z(), u = _(), n = v(), { getCompiledEmail: i, getTemplateData: t, updateHtmlAndCss: s } = R(), { compileHtml: o, compileAmpHtml: p } = x(), { isFeatureEnabled: e } = U();
71
+ const ee = () => {
72
+ const m = z(), u = _(), n = O(), { getCompiledEmail: i, getTemplateData: t, updateHtmlAndCss: s } = R(), { compileHtml: r, compileAmpHtml: p } = N(), { isFeatureEnabled: e } = k();
73
73
  return {
74
74
  prepareTemplateDetails: async () => {
75
- let { html: r, css: l, syncModulesIds: g = [] } = await t();
75
+ let { html: o, css: l, syncModulesIds: g = [] } = await t();
76
76
  if (e("linkTrackingIds"))
77
77
  try {
78
- const { html: S, changed: H, nextSeq: k } = O(r, u.trackIdSessionFloor);
79
- u.trackIdSessionFloor = k, H && (r = S, await s(S, l));
80
- } catch (S) {
81
- console.error("Tracking-id step failed, saving anyway:", S);
78
+ const { html: h, changed: P, nextSeq: H } = v(o, u.trackIdSessionFloor);
79
+ u.trackIdSessionFloor = H, P && (o = h, await s(h, l));
80
+ } catch (h) {
81
+ console.error("Tracking-id step failed, saving anyway:", h);
82
82
  }
83
- const { html: f, ampHtml: c = "", ampErrors: I = [] } = await i({
83
+ const { html: f, ampHtml: c = "", ampErrors: y = [] } = await i({
84
84
  minimize: !0,
85
85
  resetDataSavedFlag: !1
86
86
  });
87
- n.selectedUnsubscribePages.length && await n.fetchTemplates(), await C(r);
88
- const { compiledHtml: w, stats: y, appliedRules: D } = o(f), E = c && p(c).compiledHtml, P = m.getSelectedDynamicContentList, F = T(), b = M(r);
87
+ n.selectedUnsubscribePages.length && await n.fetchTemplates(), await G(o);
88
+ const { compiledHtml: I, stats: S, appliedRules: E } = r(f), w = c && p(c).compiledHtml, D = m.getSelectedDynamicContentList, F = T(), C = B(o);
89
89
  return console.debug("HTML Compilation Stats:", {
90
- originalSize: y.originalSize,
91
- compiledSize: y.compiledSize,
92
- reduction: `${y.reductionPercentage.toFixed(2)}%`,
93
- appliedRules: D,
94
- executionTime: `${y.executionTime.toFixed(2)}ms`
90
+ originalSize: S.originalSize,
91
+ compiledSize: S.compiledSize,
92
+ reduction: `${S.reductionPercentage.toFixed(2)}%`,
93
+ appliedRules: E,
94
+ executionTime: `${S.executionTime.toFixed(2)}ms`
95
95
  }), {
96
- dynamicContentList: P,
97
- compiledHtml: w,
98
- rawHtml: r,
96
+ dynamicContentList: D,
97
+ compiledHtml: I,
98
+ rawHtml: o,
99
99
  css: l,
100
- ampHtml: E,
101
- ampErrors: I,
100
+ ampHtml: w,
101
+ ampErrors: y,
102
102
  modules: g.map(Number),
103
103
  recommendation: {
104
104
  campaignUrls: F.recommendationCampaignUrls,
105
105
  configs: {}
106
106
  },
107
107
  unsubscribe: {
108
- status: b.length > 0,
109
- config: b
108
+ status: C.length > 0,
109
+ config: C
110
110
  }
111
111
  };
112
- },
113
- // Exposed so the back/test validate-only path can seed the reco store the
114
- // same way a full save does (required-field findings depend on it).
115
- hydrateRecommendationStore: C
112
+ }
116
113
  };
117
114
  };
118
115
  export {
119
- M as getHtmlReferencedUnsubscribePages,
120
- Z as useTemplatePreparation
116
+ B as getHtmlReferencedUnsubscribePages,
117
+ ee as useTemplatePreparation
121
118
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.18.1-beta.e39fb14",
3
+ "version": "3.18.1-beta.e489d08",
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
- };