@useinsider/guido 3.4.1-beta.6ed05e2 → 3.4.1-beta.ece4e0c

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,24 +1,24 @@
1
1
  var k = Object.defineProperty;
2
- var B = (a, i, t) => i in a ? k(a, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[i] = t;
3
- var d = (a, i, t) => B(a, typeof i != "symbol" ? i + "" : i, t);
2
+ var B = (r, n, t) => n in r ? k(r, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[n] = t;
3
+ var g = (r, n, t) => B(r, typeof n != "symbol" ? n + "" : n, t);
4
4
  import { BlockId as _ } from "../../../enums/block.js";
5
- import { getMigrationBannerHtml as C } from "../../../utils/migrationBannerHtml.js";
6
- import { Block as b, BlockCompositionType as R, ModificationDescription as y } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
+ import { getMigrationBannerHtml as b } from "../../../utils/migrationBannerHtml.js";
6
+ import { Block as R, BlockCompositionType as y, ModificationDescription as C } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
7
7
  import { regenerateMobileProductRows as A } from "./controls/main/utils.js";
8
- import { ensureMobileCssRulesExist as p, setMobileLayoutOptOut as f, hasMobileLayoutOptOut as N } from "./controls/mobileLayout/cssRules.js";
9
- import { RecommendationConfigService as c } from "./services/configService.js";
10
- import { useRecommendationExtensionStore as m } from "./store/recommendation.js";
11
- import { getDefaultTemplate as D } from "./templates/grid/template.js";
12
- const h = _.Recommendation, u = "recommendation-block-v2", l = "recommendation-id";
8
+ import { ensureMobileCssRulesExist as d, setMobileLayoutOptOut as p, hasMobileLayoutOptOut as D } from "./controls/mobileLayout/cssRules.js";
9
+ import { RecommendationConfigService as s } from "./services/configService.js";
10
+ import { useRecommendationExtensionStore as f } from "./store/recommendation.js";
11
+ import { getDefaultTemplate as E } from "./templates/grid/template.js";
12
+ const h = _.Recommendation, l = "recommendation-block-v2", m = "recommendation-id";
13
13
  let I = !1;
14
- class q extends b {
14
+ class q extends R {
15
15
  constructor() {
16
16
  super();
17
17
  /**
18
18
  * Stores the ID generated in getTemplate() so onCreated() can reuse it.
19
19
  * This avoids generating a new (different) ID in onCreated().
20
20
  */
21
- d(this, "_pendingBlockId", null);
21
+ g(this, "_pendingBlockId", null);
22
22
  }
23
23
  getId() {
24
24
  return h;
@@ -27,7 +27,7 @@ class q extends b {
27
27
  return "recommendation-icon";
28
28
  }
29
29
  getBlockCompositionType() {
30
- return R.CONTAINER;
30
+ return y.CONTAINER;
31
31
  }
32
32
  getName() {
33
33
  return this.api.translate("Recommendation Block");
@@ -38,7 +38,7 @@ class q extends b {
38
38
  );
39
39
  }
40
40
  getSettingsPanelTitleHtml() {
41
- return C(
41
+ return b(
42
42
  h,
43
43
  this.api.translate("Recommendation Block"),
44
44
  this.api.translate("This block is switched from the Old Version to the New Version. We recommend you check the Recommendation block and test your message to ensure it works properly.")
@@ -59,7 +59,7 @@ class q extends b {
59
59
  */
60
60
  getTemplate() {
61
61
  const t = this._generateNextId();
62
- return this._pendingBlockId = t, D(t);
62
+ return this._pendingBlockId = t, E(t);
63
63
  }
64
64
  /**
65
65
  * Called when a new block is dropped into the template
@@ -72,22 +72,22 @@ class q extends b {
72
72
  const e = this._getRecommendationId(t);
73
73
  if (e !== null && e > 0)
74
74
  return;
75
- const o = this._pendingBlockId ?? this._generateNextId();
76
- this._pendingBlockId = null, this._assignRecommendationId(t, o);
77
- const { config: n, wasFreshDrop: s } = c.initializeConfig(
75
+ const i = this._pendingBlockId ?? this._generateNextId();
76
+ this._pendingBlockId = null, this._assignRecommendationId(t, i);
77
+ const { config: o, wasFreshDrop: c } = s.initializeConfig(
78
78
  this.api,
79
79
  t,
80
- { recommendationId: o }
81
- ), r = m();
82
- if (r.setCurrentBlock(o), s) {
83
- p(this.api);
84
- const g = this._getBlockElement(t);
85
- g && (f(this.api, g, !0), A({
80
+ { recommendationId: i }
81
+ ), a = f();
82
+ if (a.setCurrentBlock(i), c) {
83
+ d(this.api);
84
+ const u = this._getBlockElement(t);
85
+ u && (p(this.api, u, !0), A({
86
86
  currentNode: t,
87
87
  documentModifier: this.api.getDocumentModifier()
88
88
  }));
89
89
  }
90
- r.patchCurrentBlockConfig({ language: n.language }, { triggerRefetch: !1 });
90
+ a.patchCurrentBlockConfig({ language: o.language }, { triggerRefetch: !1 });
91
91
  }
92
92
  /**
93
93
  * Called when the document changes or template is loaded
@@ -100,20 +100,20 @@ class q extends b {
100
100
  if (!(!t || !("getNodeConfig" in t))) {
101
101
  if (!this._getRecommendationId(t)) {
102
102
  const e = this._generateNextId();
103
- this._assignRecommendationId(t, e), c.hasConfig(t) && c.updateConfig(
103
+ this._assignRecommendationId(t, e), s.hasConfig(t) && s.updateConfig(
104
104
  this.api,
105
105
  t,
106
106
  { recommendationId: e },
107
107
  "Assign recommendation ID to legacy block"
108
108
  );
109
109
  }
110
- c.needsMigration(t) && this._migrateFromLegacy(t);
110
+ s.needsMigration(t) && this._migrateFromLegacy(t);
111
111
  try {
112
- I || (p(this.api), I = !0);
113
- const e = c.getConfig(t), o = this._getBlockElement(t);
114
- if (o) {
115
- const n = !e.mobileLayoutEnabled;
116
- N(o) !== n && f(this.api, o, n);
112
+ I || (d(this.api), I = !0);
113
+ const e = s.getConfig(t), i = this._getBlockElement(t);
114
+ if (i) {
115
+ const o = !e.mobileLayoutEnabled;
116
+ D(i) !== o && p(this.api, i, o);
117
117
  }
118
118
  } catch {
119
119
  }
@@ -127,26 +127,7 @@ class q extends b {
127
127
  */
128
128
  onDelete(t) {
129
129
  const e = this._getRecommendationId(t);
130
- e && m().removeBlockState(e);
131
- }
132
- /**
133
- * Lifecycle hook fired when Stripo's UI Duplicate button copies a block.
134
- * Stripo passes an `HtmlNodeModifier` already targeting the cloned node;
135
- * its mutations are committed when this method returns. We stamp a fresh
136
- * `recommendation-id` on the clone and seed its blockStates entry from
137
- * the source so the duplicate enters the DOM as a fully independent block
138
- * — no shared id, no shared store, no API refetch flash.
139
- *
140
- * Stripo does NOT fire `onCreated` for blocks created via duplicate
141
- * (per Block.d.ts:54-69 — `onCreated` is drag-and-drop only), so this
142
- * hook is the sole production path for clone id assignment.
143
- */
144
- onCopy(t) {
145
- const e = t.getTargetNode(), o = this._getRecommendationId(e), n = this._generateNextId(), s = c.getConfig(e);
146
- if (t.setAttribute(l, n.toString()).setNodeConfig({ ...s, recommendationId: n }), o !== null && o > 0) {
147
- const r = m();
148
- r.cloneBlockState(o, n), r.setCurrentBlock(n);
149
- }
130
+ e && f().removeBlockState(e);
150
131
  }
151
132
  /**
152
133
  * Generates the next unique recommendation ID by scanning all existing blocks
@@ -156,10 +137,10 @@ class q extends b {
156
137
  let t = 0;
157
138
  try {
158
139
  const e = this.api.getDocumentRoot();
159
- e && "querySelectorAll" in e && e.querySelectorAll(`.${u}`).forEach((n) => {
160
- if ("getAttribute" in n) {
161
- const s = n.getAttribute(l), r = s ? parseInt(s) : 0;
162
- r > t && (t = r);
140
+ e && "querySelectorAll" in e && e.querySelectorAll(`.${l}`).forEach((o) => {
141
+ if ("getAttribute" in o) {
142
+ const c = o.getAttribute(m), a = c ? parseInt(c) : 0;
143
+ a > t && (t = a);
163
144
  }
164
145
  });
165
146
  } catch {
@@ -173,11 +154,11 @@ class q extends b {
173
154
  * added classes via setAttribute.
174
155
  */
175
156
  _assignRecommendationId(t, e) {
176
- const o = this._getBlockElement(t);
177
- if (!o)
157
+ const i = this._getBlockElement(t);
158
+ if (!i)
178
159
  return;
179
- const n = this.api.getDocumentModifier();
180
- n.modifyHtml(o).setAttribute(l, e.toString()), n.apply(new y(`Assign recommendation ID ${e}`));
160
+ const o = this.api.getDocumentModifier();
161
+ o.modifyHtml(i).setAttribute(m, e.toString()), o.apply(new C(`Assign recommendation ID ${e}`));
181
162
  }
182
163
  /**
183
164
  * Gets the recommendation-id from a block node
@@ -186,11 +167,11 @@ class q extends b {
186
167
  const e = this._getBlockElement(t);
187
168
  if (!e || !("getAttribute" in e))
188
169
  return null;
189
- const o = e.getAttribute(l);
190
- if (!o)
170
+ const i = e.getAttribute(m);
171
+ if (!i)
191
172
  return null;
192
- const n = parseInt(o);
193
- return Number.isNaN(n) ? null : n;
173
+ const o = parseInt(i);
174
+ return Number.isNaN(o) ? null : o;
194
175
  }
195
176
  /**
196
177
  * Gets the block element (the element with BLOCK_CLASS)
@@ -198,16 +179,16 @@ class q extends b {
198
179
  _getBlockElement(t) {
199
180
  if ("getAttribute" in t) {
200
181
  const e = t.getAttribute("class");
201
- if (e && e.includes(u))
182
+ if (e && e.includes(l))
202
183
  return t;
203
184
  }
204
- return "querySelector" in t ? t.querySelector(`.${u}`) ?? null : null;
185
+ return "querySelector" in t ? t.querySelector(`.${l}`) ?? null : null;
205
186
  }
206
187
  /**
207
188
  * Migrate configuration from legacy format
208
189
  */
209
190
  _migrateFromLegacy(t) {
210
- c.migrateFromDataAttributes(this.api, t);
191
+ s.migrateFromDataAttributes(this.api, t);
211
192
  }
212
193
  }
213
194
  export {
@@ -1,18 +1,18 @@
1
- import { getRecommendationFeedSourceMaps as S, getOperatorOptions as R, PriceAttributes as C } from "../../../../enums/extensions/recommendationBlock.js";
2
- import { useRecommendationApi as y } from "../../../../services/recommendationApi.js";
1
+ import { getRecommendationFeedSourceMaps as g, getOperatorOptions as R, PriceAttributes as y } from "../../../../enums/extensions/recommendationBlock.js";
2
+ import { useRecommendationApi as C } from "../../../../services/recommendationApi.js";
3
3
  import { useConfigStore as G } from "../../../../stores/config.js";
4
4
  import { defineStore as P } from "pinia";
5
- import { DEFAULT_CARDS_IN_ROW as D } from "../constants/layout.js";
6
- import { EXCLUDED_ALGORITHM_IDS as F } from "../constants/defaultConfig.js";
7
- import { getDefaultProducts as g } from "../templates/utils.js";
5
+ import { DEFAULT_CARDS_IN_ROW as F } from "../constants/layout.js";
6
+ import { EXCLUDED_ALGORITHM_IDS as D } from "../constants/defaultConfig.js";
7
+ import { getDefaultProducts as S } from "../templates/utils.js";
8
8
  import { generateCompleteFilterQuery as b } from "../utils/filterUtil.js";
9
9
  import { isFilterValid as w } from "../validation/filterSchema.js";
10
10
  import { isConfigValid as v } from "../validation/requiredFields.js";
11
- const h = y();
11
+ const h = C();
12
12
  let m = null, u = null, d = null;
13
13
  function k() {
14
14
  return {
15
- cardsInRow: D,
15
+ cardsInRow: F,
16
16
  currencySettings: {
17
17
  name: "USD",
18
18
  value: "USD",
@@ -114,8 +114,8 @@ const N = () => ({
114
114
  return [...new Set(t.map((e) => e.filterGroup))].sort((e, r) => e - r);
115
115
  },
116
116
  getActivePredictiveAlgorithms: (t) => {
117
- const e = S(), r = [];
118
- return t.activePredictiveAlgorithms.filter((n) => !F.includes(n)).forEach((n) => {
117
+ const e = g(), r = [];
118
+ return t.activePredictiveAlgorithms.filter((n) => !D.includes(n)).forEach((n) => {
119
119
  r.push(...e.filter((c) => c.id === n));
120
120
  }), r.map((n) => ({
121
121
  text: n.name,
@@ -133,7 +133,7 @@ const N = () => ({
133
133
  getFilterList() {
134
134
  return Object.values(this.filterList).map((t) => {
135
135
  let e;
136
- return t.type === "productAttribute" ? e = `product_attributes.${t.attributeName}` : C.includes(t.attributeName) ? e = `${t.attributeName}.${this.recommendationConfigs.currencySettings.value}` : e = t.attributeName, {
136
+ return t.type === "productAttribute" ? e = `product_attributes.${t.attributeName}` : y.includes(t.attributeName) ? e = `${t.attributeName}.${this.recommendationConfigs.currencySettings.value}` : e = t.attributeName, {
137
137
  text: t.displayName,
138
138
  value: e,
139
139
  type: t.attributeType
@@ -174,34 +174,6 @@ const N = () => ({
174
174
  this.currentRecommendationId = n.length > 0 ? n[0] : null;
175
175
  }
176
176
  },
177
- /**
178
- * Copies blockStates[fromId] into a new blockStates[toId] entry so a
179
- * duplicated block immediately renders the source's products/filters
180
- * without re-fetching from the API (SD-142352). No-op when the source
181
- * was never selected (no entry in blockStates) — the caller falls back
182
- * to setCurrentBlock's default initialization.
183
- */
184
- cloneBlockState(t, e) {
185
- const r = this.blockStates[t];
186
- !r || this.blockStates[e] || (this.blockStates = {
187
- ...this.blockStates,
188
- [e]: {
189
- ...r,
190
- recommendationProducts: [...r.recommendationProducts],
191
- recommendationConfigs: {
192
- ...r.recommendationConfigs,
193
- id: e,
194
- filters: r.recommendationConfigs.filters.map((n) => ({ ...n })),
195
- productIds: [...r.recommendationConfigs.productIds],
196
- customAttributes: [...r.recommendationConfigs.customAttributes],
197
- recommendedProducts: [...r.recommendationConfigs.recommendedProducts],
198
- currencySettings: { ...r.recommendationConfigs.currencySettings }
199
- },
200
- filterSnapshot: null,
201
- filterSelectionDrawerStatus: !1
202
- }
203
- });
204
- },
205
177
  /**
206
178
  * Marks a block as initialized (initial API data has been fetched).
207
179
  * Automatically cleaned up when removeBlockState deletes the block entry.
@@ -454,7 +426,7 @@ const N = () => ({
454
426
  },
455
427
  async _doFetchProducts() {
456
428
  var p;
457
- const t = this.currentRecommendationId, e = this.blockStates[t], { recommendationConfigs: r } = e, n = r.filters.filter((l) => l.isValid), c = b(n), i = ((p = S().find((l) => l.key === r.strategy)) == null ? void 0 : p.path) || "", o = G(), s = parseInt(r.size) || 6, a = {
429
+ const t = this.currentRecommendationId, e = this.blockStates[t], { recommendationConfigs: r } = e, n = r.filters.filter((l) => l.isValid), c = b(n), i = ((p = g().find((l) => l.key === r.strategy)) == null ? void 0 : p.path) || "", o = G(), s = parseInt(r.size) || 6, a = {
458
430
  locale: r.language,
459
431
  currency: r.currencySettings.value,
460
432
  partnerName: o.partnerName,
@@ -470,10 +442,10 @@ const N = () => ({
470
442
  f = [];
471
443
  }
472
444
  if (this.blockStates[t]) {
473
- const l = f.length > 0 ? f : g(s);
445
+ const l = f.length > 0 ? f : S(s);
474
446
  l.length < s ? this.blockStates[t].recommendationProducts = [
475
447
  ...l,
476
- ...g(s - l.length)
448
+ ...S(s - l.length)
477
449
  ] : l.length > s ? this.blockStates[t].recommendationProducts = l.slice(0, s) : this.blockStates[t].recommendationProducts = l;
478
450
  }
479
451
  }
@@ -6,7 +6,7 @@
6
6
  * Supports multiple block instances with unique recommendation-id attributes.
7
7
  */
8
8
  import type { BlockId } from '@@/Types/extensions/block';
9
- import type { HtmlNodeModifier, ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
9
+ import type { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
10
10
  import { Block, BlockCompositionType } from '@stripoinc/ui-editor-extensions';
11
11
  export declare const BLOCK_ID: BlockId;
12
12
  export declare class RecommendationBlock extends Block {
@@ -55,19 +55,6 @@ export declare class RecommendationBlock extends Block {
55
55
  * @param node - The block node being deleted
56
56
  */
57
57
  onDelete(node: ImmutableHtmlNode): void;
58
- /**
59
- * Lifecycle hook fired when Stripo's UI Duplicate button copies a block.
60
- * Stripo passes an `HtmlNodeModifier` already targeting the cloned node;
61
- * its mutations are committed when this method returns. We stamp a fresh
62
- * `recommendation-id` on the clone and seed its blockStates entry from
63
- * the source so the duplicate enters the DOM as a fully independent block
64
- * — no shared id, no shared store, no API refetch flash.
65
- *
66
- * Stripo does NOT fire `onCreated` for blocks created via duplicate
67
- * (per Block.d.ts:54-69 — `onCreated` is drag-and-drop only), so this
68
- * hook is the sole production path for clone id assignment.
69
- */
70
- onCopy(modifier: HtmlNodeModifier): void;
71
58
  /**
72
59
  * Generates the next unique recommendation ID by scanning all existing blocks
73
60
  * in the document and finding the maximum existing ID + 1.
@@ -216,14 +216,6 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
216
216
  * Resets currentRecommendationId if it was the deleted block.
217
217
  */
218
218
  removeBlockState(id: number): void;
219
- /**
220
- * Copies blockStates[fromId] into a new blockStates[toId] entry so a
221
- * duplicated block immediately renders the source's products/filters
222
- * without re-fetching from the API (SD-142352). No-op when the source
223
- * was never selected (no entry in blockStates) — the caller falls back
224
- * to setCurrentBlock's default initialization.
225
- */
226
- cloneBlockState(fromId: number, toId: number): void;
227
219
  /**
228
220
  * Marks a block as initialized (initial API data has been fetched).
229
221
  * Automatically cleaned up when removeBlockState deletes the block entry.
@@ -1,40 +1,29 @@
1
- import { useActionsApi as E } from "../composables/useActionsApi.js";
2
- import { useHtmlCompiler as P } from "../composables/useHtmlCompiler.js";
3
- import { DEFAULT_CURRENCY as p, DEFAULT_NODE_CONFIG as u } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
4
- import { BLOCK_ROOT_SELECTOR as R, CONTAINER_SELECTOR as N } from "../extensions/Blocks/Recommendation/constants/selectors.js";
1
+ import { useActionsApi as T } from "../composables/useActionsApi.js";
2
+ import { useHtmlCompiler as C } from "../composables/useHtmlCompiler.js";
3
+ import { DEFAULT_CURRENCY as l, DEFAULT_NODE_CONFIG as a } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
5
4
  import { useRecommendationExtensionStore as b } from "../extensions/Blocks/Recommendation/store/recommendation.js";
6
5
  import { DATA_ATTRIBUTES as y } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
7
- import { parsePageList as O } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
8
- import { useDynamicContentStore as L } from "../stores/dynamic-content.js";
9
- import { useUnsubscribeStore as F } from "../stores/unsubscribe.js";
10
- function I(s, t) {
11
- const n = new DOMParser().parseFromString(s, "text/html").querySelectorAll(`[${y.PAGE_LIST}]`), c = [];
12
- return n.forEach((r) => {
13
- const o = r.getAttribute(y.PAGE_LIST);
14
- o && c.push(...O(o));
15
- }), t.filter((r) => c.includes(r));
6
+ import { parsePageList as P } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
7
+ import { useDynamicContentStore as D } from "../stores/dynamic-content.js";
8
+ import { useUnsubscribeStore as E } from "../stores/unsubscribe.js";
9
+ function U(i, r) {
10
+ const s = new DOMParser().parseFromString(i, "text/html").querySelectorAll(`[${y.PAGE_LIST}]`), c = [];
11
+ return s.forEach((t) => {
12
+ const o = t.getAttribute(y.PAGE_LIST);
13
+ o && c.push(...P(o));
14
+ }), r.filter((t) => c.includes(t));
16
15
  }
17
- function w(s) {
18
- var c, r;
19
- const t = (r = (c = document.querySelector("ui-editor")) == null ? void 0 : c.shadowRoot) == null ? void 0 : r.querySelector("iframe"), m = (t == null ? void 0 : t.contentDocument) ?? new DOMParser().parseFromString(s, "text/html"), n = /* @__PURE__ */ new Set();
20
- return m.querySelectorAll(R).forEach((o) => {
21
- if (!o.querySelector(N))
22
- return;
23
- const e = Number(o.getAttribute("recommendation-id"));
24
- Number.isFinite(e) && e > 0 && n.add(e);
25
- }), n;
26
- }
27
- function x(s) {
28
- const a = new DOMParser().parseFromString(s, "text/html").querySelectorAll(".recommendation-block-v2");
29
- if (a.length === 0)
16
+ function F(i) {
17
+ const m = new DOMParser().parseFromString(i, "text/html").querySelectorAll(".recommendation-block-v2");
18
+ if (m.length === 0)
30
19
  return;
31
- const m = b();
32
- a.forEach((n) => {
33
- var f, g, d, i, S;
34
- const c = n.getAttribute("recommendation-id"), r = c ? Number(c) : NaN;
35
- if (!Number.isFinite(r))
20
+ const d = b();
21
+ m.forEach((s) => {
22
+ var g, f, u, n, S;
23
+ const c = s.getAttribute("recommendation-id"), t = c ? Number(c) : NaN;
24
+ if (!Number.isFinite(t))
36
25
  return;
37
- const o = n.getAttribute("esd-ext-config");
26
+ const o = s.getAttribute("esd-ext-config");
38
27
  if (!o)
39
28
  return;
40
29
  let e;
@@ -45,62 +34,60 @@ function x(s) {
45
34
  }
46
35
  if (!e || typeof e != "object" || Array.isArray(e))
47
36
  return;
48
- const l = {
49
- strategy: e.strategy ?? u.strategy,
50
- language: e.language ?? u.language,
51
- size: e.size ?? u.size,
37
+ const p = {
38
+ strategy: e.strategy ?? a.strategy,
39
+ language: e.language ?? a.language,
40
+ size: e.size ?? a.size,
52
41
  // Spread the default arrays so each block gets a fresh reference
53
42
  // instead of sharing the singleton in DEFAULT_NODE_CONFIG.
54
- productIds: e.productIds ?? [...u.productIds],
55
- filters: e.filters ?? [...u.filters],
56
- shuffleProducts: e.shuffleProducts ?? u.shuffleProducts,
57
- currencyCode: ((f = e.currency) == null ? void 0 : f.code) ?? p.code,
58
- currencyAlignment: ((g = e.currency) == null ? void 0 : g.alignment) ?? p.alignment,
59
- currencyDecimalCount: ((d = e.currency) == null ? void 0 : d.decimalCount) ?? p.decimalCount,
60
- currencyDecimalSeparator: ((i = e.currency) == null ? void 0 : i.decimalSeparator) ?? p.decimalSeparator,
61
- currencyThousandSeparator: ((S = e.currency) == null ? void 0 : S.thousandSeparator) ?? p.thousandSeparator
43
+ productIds: e.productIds ?? [...a.productIds],
44
+ filters: e.filters ?? [...a.filters],
45
+ shuffleProducts: e.shuffleProducts ?? a.shuffleProducts,
46
+ currencyCode: ((g = e.currency) == null ? void 0 : g.code) ?? l.code,
47
+ currencyAlignment: ((f = e.currency) == null ? void 0 : f.alignment) ?? l.alignment,
48
+ currencyDecimalCount: ((u = e.currency) == null ? void 0 : u.decimalCount) ?? l.decimalCount,
49
+ currencyDecimalSeparator: ((n = e.currency) == null ? void 0 : n.decimalSeparator) ?? l.decimalSeparator,
50
+ currencyThousandSeparator: ((S = e.currency) == null ? void 0 : S.thousandSeparator) ?? l.thousandSeparator
62
51
  };
63
- m.seedBlockUrlConfig(r, l);
52
+ d.seedBlockUrlConfig(t, p);
64
53
  });
65
54
  }
66
- const G = () => {
67
- const s = L(), t = F(), { getCompiledEmail: a, getTemplateData: m } = E(), { compileHtml: n } = P();
55
+ const _ = () => {
56
+ const i = D(), r = E(), { getCompiledEmail: m, getTemplateData: d } = T(), { compileHtml: s } = C();
68
57
  return {
69
58
  prepareTemplateDetails: async () => {
70
- const { html: r, ampHtml: o = "", ampErrors: e = [] } = await a({
59
+ const { html: t, ampHtml: o = "", ampErrors: e = [] } = await m({
71
60
  minimize: !0,
72
61
  resetDataSavedFlag: !1
73
- }), { html: l, css: f, syncModulesIds: g = [] } = await m();
74
- t.selectedUnsubscribePages.length && await t.fetchTemplates(), x(l);
75
- const { compiledHtml: d, stats: i, appliedRules: S } = n(r), h = s.getSelectedDynamicContentList, A = b(), T = w(l), C = Object.fromEntries(
76
- Object.entries(A.recommendationCampaignUrls).filter(([D]) => T.has(Number(D)))
77
- );
62
+ }), { html: p, css: g, syncModulesIds: f = [] } = await d();
63
+ r.selectedUnsubscribePages.length && await r.fetchTemplates(), F(p);
64
+ const { compiledHtml: u, stats: n, appliedRules: S } = s(t), h = i.getSelectedDynamicContentList, A = b();
78
65
  return console.debug("HTML Compilation Stats:", {
79
- originalSize: i.originalSize,
80
- compiledSize: i.compiledSize,
81
- reduction: `${i.reductionPercentage.toFixed(2)}%`,
66
+ originalSize: n.originalSize,
67
+ compiledSize: n.compiledSize,
68
+ reduction: `${n.reductionPercentage.toFixed(2)}%`,
82
69
  appliedRules: S,
83
- executionTime: `${i.executionTime.toFixed(2)}ms`
70
+ executionTime: `${n.executionTime.toFixed(2)}ms`
84
71
  }), {
85
72
  dynamicContentList: h,
86
- compiledHtml: d,
87
- rawHtml: l,
88
- css: f,
73
+ compiledHtml: u,
74
+ rawHtml: p,
75
+ css: g,
89
76
  ampHtml: o,
90
77
  ampErrors: e,
91
- modules: g.map(Number),
78
+ modules: f.map(Number),
92
79
  recommendation: {
93
- campaignUrls: C,
80
+ campaignUrls: A.recommendationCampaignUrls,
94
81
  configs: {}
95
82
  },
96
83
  unsubscribe: {
97
- status: t.unsubscribePagesStatus,
98
- config: I(d, t.selectedUnsubscribePages)
84
+ status: r.unsubscribePagesStatus,
85
+ config: U(u, r.selectedUnsubscribePages)
99
86
  }
100
87
  };
101
88
  }
102
89
  };
103
90
  };
104
91
  export {
105
- G as useTemplatePreparation
92
+ _ as useTemplatePreparation
106
93
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.4.1-beta.6ed05e2",
3
+ "version": "3.4.1-beta.ece4e0c",
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 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
File without changes