@useinsider/guido 3.18.0-beta.3ffa144 → 3.18.0-beta.599df29

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.
@@ -1,30 +1,30 @@
1
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
- import { DEFAULT_CURRENCY as m, DEFAULT_NODE_CONFIG as a } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
5
- import { useRecommendationExtensionStore as T } from "../extensions/Blocks/Recommendation/store/recommendation.js";
4
+ import { DEFAULT_CURRENCY as d, DEFAULT_NODE_CONFIG as a } from "../extensions/Blocks/Recommendation/constants/defaultConfig.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
- import { DATA_ATTRIBUTES as C } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
7
+ import { DATA_ATTRIBUTES as A } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
8
8
  import { parsePageList as R } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
9
9
  import { useDynamicContentStore as N } from "../stores/dynamic-content.js";
10
10
  import { useEditorStore as z } from "../stores/editor.js";
11
11
  import { useUnsubscribeStore as _ } from "../stores/unsubscribe.js";
12
12
  import { assignTrackingIds as v } from "./linkTrackingIds.js";
13
- function O(l) {
14
- const c = new DOMParser().parseFromString(l, "text/html").querySelectorAll(`[${C.PAGE_LIST}]`), t = [];
15
- return c.forEach((i) => {
16
- const o = i.getAttribute(C.PAGE_LIST);
13
+ function O(m) {
14
+ const i = new DOMParser().parseFromString(m, "text/html").querySelectorAll(`[${A.PAGE_LIST}]`), t = [];
15
+ return i.forEach((s) => {
16
+ const o = s.getAttribute(A.PAGE_LIST);
17
17
  o && t.push(...R(o));
18
18
  }), [...new Set(t)];
19
19
  }
20
- async function M(l) {
21
- const n = new DOMParser().parseFromString(l, "text/html").querySelectorAll(".recommendation-block-v2");
20
+ async function M(m) {
21
+ const n = new DOMParser().parseFromString(m, "text/html").querySelectorAll(".recommendation-block-v2");
22
22
  if (n.length === 0)
23
23
  return;
24
- const c = T();
24
+ const i = C();
25
25
  n.forEach((t) => {
26
- var r, d, g, f, s, y;
27
- const i = t.getAttribute("recommendation-id"), o = i ? Number(i) : NaN;
26
+ var r, l, g, f, c;
27
+ const s = t.getAttribute("recommendation-id"), o = s ? Number(s) : NaN;
28
28
  if (!Number.isFinite(o))
29
29
  return;
30
30
  const p = t.getAttribute("esd-ext-config");
@@ -38,7 +38,7 @@ async function M(l) {
38
38
  }
39
39
  if (!e || typeof e != "object" || Array.isArray(e))
40
40
  return;
41
- const b = {
41
+ const h = {
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).
@@ -51,17 +51,16 @@ async function M(l) {
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) ?? m.code,
55
- currencySymbol: ((d = e.currency) == null ? void 0 : d.symbol) ?? m.symbol,
56
- currencyAlignment: ((g = e.currency) == null ? void 0 : g.alignment) ?? m.alignment,
57
- currencyDecimalCount: ((f = e.currency) == null ? void 0 : f.decimalCount) ?? m.decimalCount,
58
- currencyDecimalSeparator: ((s = e.currency) == null ? void 0 : s.decimalSeparator) ?? m.decimalSeparator,
59
- currencyThousandSeparator: ((y = e.currency) == null ? void 0 : y.thousandSeparator) ?? m.thousandSeparator
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
60
59
  };
61
- c.seedBlockUrlConfig(o, b);
60
+ i.seedBlockUrlConfig(o, h);
62
61
  });
63
62
  try {
64
- await c.fetchRecommendationCreateData();
63
+ await i.fetchRecommendationCreateData();
65
64
  } catch (t) {
66
65
  console.warn(
67
66
  "Recommendation reference data pre-load failed; validator will skip the availability check.",
@@ -70,44 +69,44 @@ async function M(l) {
70
69
  }
71
70
  }
72
71
  const Z = () => {
73
- const l = N(), u = z(), n = _(), { getCompiledEmail: c, getTemplateData: t, updateHtmlAndCss: i } = k(), { compileHtml: o, compileAmpHtml: p } = x(), { isFeatureEnabled: e } = U();
72
+ const m = N(), u = z(), n = _(), { getCompiledEmail: i, getTemplateData: t, updateHtmlAndCss: s } = k(), { compileHtml: o, compileAmpHtml: p } = x(), { isFeatureEnabled: e } = U();
74
73
  return {
75
74
  prepareTemplateDetails: async () => {
76
- let { html: r, css: d, syncModulesIds: g = [] } = await t();
75
+ let { html: r, css: l, syncModulesIds: g = [] } = await t();
77
76
  if (e("linkTrackingIds"))
78
77
  try {
79
- const { html: h, changed: F, nextSeq: H } = v(r, u.trackIdSessionFloor);
80
- u.trackIdSessionFloor = H, F && (r = h, await i(h, d));
81
- } catch (h) {
82
- console.error("Tracking-id step failed, saving anyway:", h);
78
+ const { html: S, changed: F, nextSeq: H } = v(r, u.trackIdSessionFloor);
79
+ u.trackIdSessionFloor = H, F && (r = S, await s(S, l));
80
+ } catch (S) {
81
+ console.error("Tracking-id step failed, saving anyway:", S);
83
82
  }
84
- const { html: f, ampHtml: s = "", ampErrors: y = [] } = await c({
83
+ const { html: f, ampHtml: c = "", ampErrors: T = [] } = await i({
85
84
  minimize: !0,
86
85
  resetDataSavedFlag: !1
87
86
  });
88
87
  n.selectedUnsubscribePages.length && await n.fetchTemplates(), await M(r);
89
- const { compiledHtml: I, stats: S, appliedRules: w } = o(f), D = s && p(s).compiledHtml, E = l.getSelectedDynamicContentList, P = T(), A = O(r);
88
+ const { compiledHtml: I, stats: y, appliedRules: w } = o(f), D = c && p(c).compiledHtml, E = m.getSelectedDynamicContentList, P = C(), b = O(r);
90
89
  return console.debug("HTML Compilation Stats:", {
91
- originalSize: S.originalSize,
92
- compiledSize: S.compiledSize,
93
- reduction: `${S.reductionPercentage.toFixed(2)}%`,
90
+ originalSize: y.originalSize,
91
+ compiledSize: y.compiledSize,
92
+ reduction: `${y.reductionPercentage.toFixed(2)}%`,
94
93
  appliedRules: w,
95
- executionTime: `${S.executionTime.toFixed(2)}ms`
94
+ executionTime: `${y.executionTime.toFixed(2)}ms`
96
95
  }), {
97
96
  dynamicContentList: E,
98
97
  compiledHtml: I,
99
98
  rawHtml: r,
100
- css: d,
99
+ css: l,
101
100
  ampHtml: D,
102
- ampErrors: y,
101
+ ampErrors: T,
103
102
  modules: g.map(Number),
104
103
  recommendation: {
105
104
  campaignUrls: P.recommendationCampaignUrls,
106
105
  configs: {}
107
106
  },
108
107
  unsubscribe: {
109
- status: A.length > 0,
110
- config: A
108
+ status: b.length > 0,
109
+ config: b
111
110
  }
112
111
  };
113
112
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.18.0-beta.3ffa144",
3
+ "version": "3.18.0-beta.599df29",
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",