@useinsider/guido 3.23.0-beta.6555b16 → 3.23.0-beta.75de098

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.
@@ -10,32 +10,32 @@ import { RecommendationConfigService as c } from "../../services/configService.j
10
10
  import { useRecommendationExtensionStore as T } from "../../store/recommendation.js";
11
11
  import { refreshBlockOutsidePanel as O } from "../../utils/blockRefresh.js";
12
12
  import { mapLegacyStrategy as p } from "../../utils/legacyStrategyMap.js";
13
- import { registerNodeConfigWriter as b, writeBlockConfigOutsidePanel as C, hasEditedConfigChange as B, pickConfigDescription as F, isProductIdsChange as L, PRODUCT_IDS_DESCRIPTION as D } from "../../utils/nodeConfigWriter.js";
14
- import { AlgorithmControl as E } from "./algorithm.js";
15
- import { ALGORITHM_CONTROL_ID as Pe } from "./algorithm.js";
16
- import { CurrencyControl as U } from "./currency.js";
17
- import { CURRENCY_CONTROL_ID as Ie } from "./currency.js";
18
- import { FiltersControl as v } from "./filters.js";
19
- import { FILTERS_CONTROL_ID as ke } from "./filters.js";
13
+ import { registerNodeConfigWriter as b, writeBlockConfigOutsidePanel as C, hasEditedConfigChange as B, pickConfigDescription as F, isProductIdsChange as L, PRODUCT_IDS_DESCRIPTION as D, areProductsDrawn as E } from "../../utils/nodeConfigWriter.js";
14
+ import { AlgorithmControl as U } from "./algorithm.js";
15
+ import { ALGORITHM_CONTROL_ID as Re } from "./algorithm.js";
16
+ import { CurrencyControl as v } from "./currency.js";
17
+ import { CURRENCY_CONTROL_ID as Se } from "./currency.js";
18
+ import { FiltersControl as w } from "./filters.js";
19
+ import { FILTERS_CONTROL_ID as Te } from "./filters.js";
20
20
  import { LayoutOrientationControl as A } from "./layoutOrientation.js";
21
- import { LAYOUT_ORIENTATION_CONTROL_ID as Oe } from "./layoutOrientation.js";
22
- import { LocaleControl as w } from "./locale.js";
23
- import { LOCALE_CONTROL_ID as Be } from "./locale.js";
24
- import { PricePlacementControl as V } from "./pricePlacement.js";
25
- import { PRICE_PLACEMENT_CONTROL_ID as Le } from "./pricePlacement.js";
26
- import { ProductCountControl as W } from "./productCount.js";
27
- import { PRODUCT_COUNT_CONTROL_ID as Ee } from "./productCount.js";
28
- import { ProductLayoutControl as x } from "./productLayout.js";
29
- import { PRODUCT_LAYOUT_CONTROL_ID as ve } from "./productLayout.js";
30
- import { ShuffleControl as M } from "./shuffle.js";
31
- import { SHUFFLE_CONTROL_ID as we } from "./shuffle.js";
32
- import { StrategyControl as G } from "./strategy.js";
33
- import { STRATEGY_CONTROL_ID as We } from "./strategy.js";
34
- import { setCurrencyAttributes as $, getBlockElement as z, isPartnerManagedBlock as H, updateProductContentInPlace as Y, regenerateProductRowsWithStyles as j } from "./utils.js";
35
- import { adjustProductsToSize as Me, formatProductPrice as Ge, getCardComposition as $e, getCurrentLayout as ze, getMainContainerTbody as He, regenerateMobileProductRows as Ye, updatePricesInPlace as je, updateSingleProductContent as qe } from "./utils.js";
21
+ import { LAYOUT_ORIENTATION_CONTROL_ID as be } from "./layoutOrientation.js";
22
+ import { LocaleControl as V } from "./locale.js";
23
+ import { LOCALE_CONTROL_ID as Fe } from "./locale.js";
24
+ import { PricePlacementControl as W } from "./pricePlacement.js";
25
+ import { PRICE_PLACEMENT_CONTROL_ID as De } from "./pricePlacement.js";
26
+ import { ProductCountControl as x } from "./productCount.js";
27
+ import { PRODUCT_COUNT_CONTROL_ID as Ue } from "./productCount.js";
28
+ import { ProductLayoutControl as M } from "./productLayout.js";
29
+ import { PRODUCT_LAYOUT_CONTROL_ID as we } from "./productLayout.js";
30
+ import { ShuffleControl as G } from "./shuffle.js";
31
+ import { SHUFFLE_CONTROL_ID as Ve } from "./shuffle.js";
32
+ import { StrategyControl as $ } from "./strategy.js";
33
+ import { STRATEGY_CONTROL_ID as xe } from "./strategy.js";
34
+ import { setCurrencyAttributes as z, getBlockElement as H, isPartnerManagedBlock as Y, updateProductContentInPlace as j, regenerateProductRowsWithStyles as q } from "./utils.js";
35
+ import { adjustProductsToSize as Ge, formatProductPrice as $e, getCardComposition as ze, getCurrentLayout as He, getMainContainerTbody as Ye, regenerateMobileProductRows as je, updatePricesInPlace as qe, updateSingleProductContent as Je } from "./utils.js";
36
36
  import { useDebounceFn as _ } from "../../../../../node_modules/@vueuse/shared/index.js";
37
- const h = "Update recommendation filters", q = "ui-elements-recommendation-block";
38
- class _e extends I {
37
+ const h = "Update recommendation filters", J = "ui-elements-recommendation-block";
38
+ class Ne extends I {
39
39
  constructor() {
40
40
  super(...arguments);
41
41
  r(this, "store", T());
@@ -107,7 +107,7 @@ class _e extends I {
107
107
  }, 100));
108
108
  }
109
109
  getId() {
110
- return q;
110
+ return J;
111
111
  }
112
112
  get _subControls() {
113
113
  return [
@@ -128,7 +128,7 @@ class _e extends I {
128
128
  return this.rrsEnabled = f().isFeatureEnabled("reusableRecommendationStrategy"), this._subControls.forEach((t) => {
129
129
  var o;
130
130
  return (o = t == null ? void 0 : t.onDestroy) == null ? void 0 : o.call(t);
131
- }), this.algorithmControl = new E(), this.localeControl = new w(), this.currencyControl = new U(), this.productCountControl = new W(), this.productLayoutControl = new x(), this.filtersControl = new v(), this.shuffleControl = new M(), this.pricePlacementControl = new V(), this.layoutOrientationControl = new A(), this.strategyControl = this.rrsEnabled ? new G() : null, this._subControls.forEach((t) => {
131
+ }), this.algorithmControl = new U(), this.localeControl = new V(), this.currencyControl = new v(), this.productCountControl = new x(), this.productLayoutControl = new M(), this.filtersControl = new w(), this.shuffleControl = new G(), this.pricePlacementControl = new W(), this.layoutOrientationControl = new A(), this.strategyControl = this.rrsEnabled ? new $() : null, this._subControls.forEach((t) => {
132
132
  t && (t.api = this.api);
133
133
  }), `
134
134
  <div class="recommendation-controls-container">
@@ -404,7 +404,7 @@ class _e extends I {
404
404
  this.currentNode,
405
405
  t,
406
406
  "Applied smart defaults"
407
- ), o && t.currency && $({
407
+ ), o && t.currency && z({
408
408
  currentNode: this.currentNode,
409
409
  documentModifier: this.api.getDocumentModifier(),
410
410
  currency: t.currency
@@ -428,7 +428,7 @@ class _e extends I {
428
428
  * Reads the recommendation-id attribute from the block element within the node
429
429
  */
430
430
  _getRecommendationIdFromNode(e) {
431
- const t = z(e);
431
+ const t = H(e);
432
432
  if (!t || !("getAttribute" in t))
433
433
  return null;
434
434
  const o = t.getAttribute(k);
@@ -452,7 +452,9 @@ class _e extends I {
452
452
  e,
453
453
  this._getNodeConfigUpdates(n.recommendationConfigs),
454
454
  h
455
- ) && console.error("[recommendation] config write outside the panel did not reach a node", { blockId: e }), (i || o) && this._refreshOutsidePanel(e, i);
455
+ ) && console.error("[recommendation] config write outside the panel did not reach a node", { blockId: e });
456
+ const s = o && !E(e, n.recommendationProducts);
457
+ (i || s) && this._refreshOutsidePanel(e, i);
456
458
  } catch (n) {
457
459
  console.error("[recommendation] finishing the block outside the panel failed", n);
458
460
  }
@@ -488,19 +490,19 @@ class _e extends I {
488
490
  return;
489
491
  }
490
492
  const e = this.store.recommendationProducts, t = this.api.getDocumentModifier(), o = this._pendingDescription(), n = this._stagePendingNodeConfig(t);
491
- if (H(this.currentNode)) {
493
+ if (Y(this.currentNode)) {
492
494
  n && (t.apply(
493
495
  new R(o ?? "Update recommendation configuration")
494
496
  ), this._consumePendingNodeConfig());
495
497
  return;
496
498
  }
497
- Y({
499
+ j({
498
500
  currentNode: this.currentNode,
499
501
  documentModifier: t,
500
502
  products: e,
501
503
  description: o,
502
504
  onApplied: n ? () => this._consumePendingNodeConfig() : void 0
503
- }) || j({
505
+ }) || q({
504
506
  currentNode: this.currentNode,
505
507
  documentModifier: t,
506
508
  products: e,
@@ -543,39 +545,39 @@ class _e extends I {
543
545
  }
544
546
  }
545
547
  export {
546
- Pe as ALGORITHM_CONTROL_ID,
547
- E as AlgorithmControl,
548
- q as CONTROL_BLOCK_ID,
549
- Ie as CURRENCY_CONTROL_ID,
550
- U as CurrencyControl,
551
- ke as FILTERS_CONTROL_ID,
552
- v as FiltersControl,
553
- Oe as LAYOUT_ORIENTATION_CONTROL_ID,
554
- Be as LOCALE_CONTROL_ID,
548
+ Re as ALGORITHM_CONTROL_ID,
549
+ U as AlgorithmControl,
550
+ J as CONTROL_BLOCK_ID,
551
+ Se as CURRENCY_CONTROL_ID,
552
+ v as CurrencyControl,
553
+ Te as FILTERS_CONTROL_ID,
554
+ w as FiltersControl,
555
+ be as LAYOUT_ORIENTATION_CONTROL_ID,
556
+ Fe as LOCALE_CONTROL_ID,
555
557
  A as LayoutOrientationControl,
556
- w as LocaleControl,
557
- Le as PRICE_PLACEMENT_CONTROL_ID,
558
- Ee as PRODUCT_COUNT_CONTROL_ID,
559
- ve as PRODUCT_LAYOUT_CONTROL_ID,
560
- V as PricePlacementControl,
561
- W as ProductCountControl,
562
- x as ProductLayoutControl,
563
- _e as RecommendationBlockControl,
564
- we as SHUFFLE_CONTROL_ID,
565
- We as STRATEGY_CONTROL_ID,
566
- M as ShuffleControl,
567
- G as StrategyControl,
568
- Me as adjustProductsToSize,
569
- Ge as formatProductPrice,
570
- z as getBlockElement,
571
- $e as getCardComposition,
572
- ze as getCurrentLayout,
573
- He as getMainContainerTbody,
574
- H as isPartnerManagedBlock,
575
- Ye as regenerateMobileProductRows,
576
- j as regenerateProductRowsWithStyles,
577
- $ as setCurrencyAttributes,
578
- je as updatePricesInPlace,
579
- Y as updateProductContentInPlace,
580
- qe as updateSingleProductContent
558
+ V as LocaleControl,
559
+ De as PRICE_PLACEMENT_CONTROL_ID,
560
+ Ue as PRODUCT_COUNT_CONTROL_ID,
561
+ we as PRODUCT_LAYOUT_CONTROL_ID,
562
+ W as PricePlacementControl,
563
+ x as ProductCountControl,
564
+ M as ProductLayoutControl,
565
+ Ne as RecommendationBlockControl,
566
+ Ve as SHUFFLE_CONTROL_ID,
567
+ xe as STRATEGY_CONTROL_ID,
568
+ G as ShuffleControl,
569
+ $ as StrategyControl,
570
+ Ge as adjustProductsToSize,
571
+ $e as formatProductPrice,
572
+ H as getBlockElement,
573
+ ze as getCardComposition,
574
+ He as getCurrentLayout,
575
+ Ye as getMainContainerTbody,
576
+ Y as isPartnerManagedBlock,
577
+ je as regenerateMobileProductRows,
578
+ q as regenerateProductRowsWithStyles,
579
+ z as setCurrencyAttributes,
580
+ qe as updatePricesInPlace,
581
+ j as updateProductContentInPlace,
582
+ Je as updateSingleProductContent
581
583
  };
@@ -1,45 +1,52 @@
1
1
  import { ModificationDescription as a } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
2
  import { RECOMMENDATION_ID_ATTR as m } from "../constants/selectors.js";
3
- import { isPartnerManagedBlock as y, updateProductContentInPlace as I, regenerateProductRowsWithStyles as N } from "../controls/main/utils.js";
3
+ import { isPartnerManagedBlock as N, updateProductContentInPlace as I, regenerateProductRowsWithStyles as D } from "../controls/main/utils.js";
4
4
  import { RecommendationConfigService as c } from "../services/configService.js";
5
5
  import { useRecommendationExtensionStore as O } from "../store/recommendation.js";
6
6
  let r = null;
7
- function $(t) {
7
+ const C = /* @__PURE__ */ new Map();
8
+ function k(t) {
8
9
  r = t;
9
10
  }
10
- function C(t) {
11
+ function P(t, n) {
12
+ C.set(t, n);
13
+ }
14
+ function q(t, n) {
15
+ return C.get(t) === n;
16
+ }
17
+ function p(t) {
11
18
  const n = r == null ? void 0 : r.getDocumentRootHtmlNode();
12
19
  return !n || !("querySelector" in n) ? null : n.querySelector(`[${m}="${t}"]`) ?? null;
13
20
  }
14
- function D(t, n) {
21
+ function R(t, n) {
15
22
  const o = c.getConfig(t);
16
23
  return Object.keys(n).some((e) => JSON.stringify(o[e]) !== JSON.stringify(n[e]));
17
24
  }
18
- function R(t, n) {
25
+ function h(t, n) {
19
26
  const o = c.getConfig(t);
20
27
  return ["filters", "strategy", "strategyId", "size", "productIds"].some((e) => e in n && JSON.stringify(o[e]) !== JSON.stringify(n[e]));
21
28
  }
22
- const p = "Updated product IDs";
23
- function S(t, n) {
29
+ const S = "Updated product IDs";
30
+ function y(t, n) {
24
31
  if (!("productIds" in n))
25
32
  return !1;
26
33
  const o = c.getConfig(t);
27
34
  return JSON.stringify(o.productIds) !== JSON.stringify(n.productIds);
28
35
  }
29
- function h(t, n, o) {
30
- return S(t, n) ? p : o;
36
+ function w(t, n, o) {
37
+ return y(t, n) ? S : o;
31
38
  }
32
- function k(t, n, o) {
33
- const e = C(t);
39
+ function _(t, n, o) {
40
+ const e = p(t);
34
41
  if (!r || !e)
35
42
  return !1;
36
- if (R(e, n)) {
37
- const i = h(e, n, o);
43
+ if (h(e, n)) {
44
+ const i = w(e, n, o);
38
45
  c.updateConfig(r, e, n, i);
39
46
  }
40
47
  return !0;
41
48
  }
42
- function P(t, n) {
49
+ function B(t, n) {
43
50
  const o = O(), e = o.currentRecommendationId;
44
51
  if (e === t || !o.blockStates[t]) {
45
52
  n();
@@ -52,34 +59,37 @@ function P(t, n) {
52
59
  o.$patch({ currentRecommendationId: e });
53
60
  }
54
61
  }
55
- function q(t) {
62
+ function x(t) {
56
63
  const n = r == null ? void 0 : r.getDocumentRootHtmlNode();
57
64
  return !n || !("querySelectorAll" in n) ? [] : n.querySelectorAll(`[${m}="${t}"]`).map((o) => c.getConfig(o));
58
65
  }
59
- function w(t, n, o, e) {
60
- const i = C(t);
66
+ function A(t, n, o, e) {
67
+ const i = p(t);
61
68
  if (!r || !i)
62
69
  return !1;
63
- const f = r.getDocumentModifier(), d = D(i, n), g = S(i, n), s = g ? p : e, l = { currentNode: i, documentModifier: f, products: o, ...g ? { description: s } : {} };
64
- if (c.stageConfig(f, i, n), y(i))
70
+ P(t, o);
71
+ const f = r.getDocumentModifier(), d = R(i, n), g = y(i, n), s = g ? S : e, l = { currentNode: i, documentModifier: f, products: o, ...g ? { description: s } : {} };
72
+ if (c.stageConfig(f, i, n), N(i))
65
73
  return d && f.apply(new a(s)), !0;
66
74
  let u = !1;
67
- return P(t, () => {
75
+ return B(t, () => {
68
76
  I({
69
77
  ...l,
70
78
  onApplied: () => {
71
79
  u = !0;
72
80
  }
73
- }) || (u = N(l));
81
+ }) || (u = D(l));
74
82
  }), !u && d && f.apply(new a(s)), !0;
75
83
  }
76
84
  export {
77
- p as PRODUCT_IDS_DESCRIPTION,
78
- w as commitBlockChangeOutsidePanel,
79
- R as hasEditedConfigChange,
80
- S as isProductIdsChange,
81
- h as pickConfigDescription,
82
- q as readBlockNodeConfigs,
83
- $ as registerNodeConfigWriter,
84
- k as writeBlockConfigOutsidePanel
85
+ S as PRODUCT_IDS_DESCRIPTION,
86
+ q as areProductsDrawn,
87
+ A as commitBlockChangeOutsidePanel,
88
+ h as hasEditedConfigChange,
89
+ y as isProductIdsChange,
90
+ P as markProductsDrawn,
91
+ w as pickConfigDescription,
92
+ x as readBlockNodeConfigs,
93
+ k as registerNodeConfigWriter,
94
+ _ as writeBlockConfigOutsidePanel
85
95
  };
@@ -1,9 +1,9 @@
1
- const o = "3.23.0-beta.6555b16", s = { stripo: { version: "2.81.1" } }, t = {
1
+ const o = "3.23.0-beta.75de098", s = { stripo: { version: "2.83.1" } }, e = {
2
2
  version: o,
3
3
  guido: s
4
4
  };
5
5
  export {
6
- t as default,
6
+ e as default,
7
7
  s as guido,
8
8
  o as version
9
9
  };
@@ -1,70 +1,66 @@
1
- import { useActionsApi as v } from "../composables/useActionsApi.js";
2
- import { useConfig as A } from "../composables/useConfig.js";
3
- import { useHttp as E } from "../composables/useHttp.js";
1
+ import { useActionsApi as h } from "../composables/useActionsApi.js";
2
+ import { useConfig as S } from "../composables/useConfig.js";
3
+ import { useHttp as v } from "../composables/useHttp.js";
4
4
  import { useToaster as x } from "../composables/useToaster.js";
5
- import { useTranslations as N } from "../composables/useTranslations.js";
6
- import { useHtmlDocumentCountValidator as H } from "../composables/validators/useHtmlDocumentCountValidator.js";
7
- import { useLiquidValidator as P } from "../composables/validators/useLiquidValidator.js";
8
- import { EditorType as D } from "../enums/defaults.js";
9
- import { ToasterTypeOptions as T } from "../enums/toaster.js";
10
- import { useRecommendationExtensionStore as L } from "../extensions/Blocks/Recommendation/store/recommendation.js";
11
- import { useSaveAsTemplateStore as q } from "../stores/save-as-template.js";
5
+ import { useTranslations as A } from "../composables/useTranslations.js";
6
+ import { useHtmlDocumentCountValidator as E } from "../composables/validators/useHtmlDocumentCountValidator.js";
7
+ import { useLiquidValidator as N } from "../composables/validators/useLiquidValidator.js";
8
+ import { EditorType as H } from "../enums/defaults.js";
9
+ import { ToasterTypeOptions as P } from "../enums/toaster.js";
10
+ import { useRecommendationExtensionStore as D } from "../extensions/Blocks/Recommendation/store/recommendation.js";
11
+ import { useSaveAsTemplateStore as L } from "../stores/save-as-template.js";
12
12
  import { base64EncodeWithSpecialChars as r } from "../utils/base64.js";
13
- import { isPlainObject as w } from "../utils/genericUtil.js";
13
+ import { isPlainObject as q } from "../utils/genericUtil.js";
14
14
  import { useTemplatePreparation as F } from "../utils/templatePreparation.js";
15
15
  const Z = () => {
16
- const { get: m, post: l } = E(), { handleError: o, showToaster: i } = x(), { config: c, isFeatureEnabled: p } = A(), { validateLiquidSyntax: b } = P(), { validateSingleHtmlDocument: h } = H(), { getTemplateData: C } = v(), u = N();
16
+ const { get: n, post: m } = v(), { handleError: s, showToaster: l } = x(), { config: c, isFeatureEnabled: p } = S(), { validateLiquidSyntax: T } = N(), { validateSingleHtmlDocument: w } = E(), { getTemplateData: b } = h(), u = A();
17
17
  return {
18
18
  getCategories: async () => {
19
19
  try {
20
- const { data: e } = await m("/newsletter/template-library/get-template-categories");
21
- if (Array.isArray(e))
22
- return e;
23
- if (w(e) && e.type === "alert" && typeof e.message == "string")
24
- return i({ message: e.message, type: T.Error }), [];
25
- throw new Error("Unexpected get-template-categories response");
20
+ const { data: e = [] } = await n("/newsletter/template-library/get-template-categories");
21
+ return e;
26
22
  } catch (e) {
27
- return o(e, "Failed to fetch template categories"), [];
23
+ return s(e, "Failed to fetch template categories"), [];
28
24
  }
29
25
  },
30
26
  checkTemplateNameAvailability: async (e) => {
31
- const { data: { status: t = !1 } } = await m(
27
+ const { data: { status: t = !1 } } = await n(
32
28
  `/newsletter/template-library/template-name-exists?name=${e}`
33
29
  );
34
30
  return !t;
35
31
  },
36
32
  createCategory: async (e) => {
37
33
  try {
38
- const { data: { id: t } } = await l(
34
+ const { data: { id: t } } = await m(
39
35
  "/newsletter/template-library/create-category",
40
36
  { name: e }
41
37
  );
42
38
  return t.toString();
43
39
  } catch (t) {
44
- return o(t, "Failed to create category"), "";
40
+ return s(t, "Failed to create category"), "";
45
41
  }
46
42
  },
47
43
  createTemplate: async () => {
48
44
  var e, t, d, y;
49
45
  try {
50
- const { prepareTemplateDetails: n } = F(), s = q(), g = await C();
51
- if (!h(g.html))
46
+ const { prepareTemplateDetails: i } = F(), o = L(), g = await b();
47
+ if (!w(g.html))
52
48
  return !1;
53
- const a = await n(g);
54
- if (p("liquidSyntax") && !await b(a.compiledHtml))
49
+ const a = await i(g);
50
+ if (p("liquidSyntax") && !await T(a.compiledHtml))
55
51
  return !1;
56
- const S = {
57
- name: s.getTemplateName,
58
- categories: s.getSelectedCategoryIds,
52
+ const C = {
53
+ name: o.getTemplateName,
54
+ categories: o.getSelectedCategoryIds,
59
55
  productId: ((t = (e = c.value) == null ? void 0 : e.partner) == null ? void 0 : t.productType) || 0,
60
- editorType: D,
56
+ editorType: H,
61
57
  messageType: ((y = (d = c.value) == null ? void 0 : d.partner) == null ? void 0 : y.messageType) || 0,
62
58
  content: r(a.compiledHtml),
63
59
  css: r(a.css),
64
60
  unsubscriptionPreferencePageStatus: !1,
65
61
  unsubscriptionPreferencePages: [],
66
62
  recommendationCampaignUrls: r(
67
- L().recommendationCampaignUrls
63
+ D().recommendationCampaignUrls
68
64
  ),
69
65
  recommendationConfigs: r({}),
70
66
  isGuido: !0,
@@ -76,27 +72,27 @@ const Z = () => {
76
72
  css: a.css,
77
73
  dynamicContentList: a.dynamicContentList
78
74
  })
79
- }, { data: f } = await l(
75
+ }, { data: f } = await m(
80
76
  "/newsletter/template-library/create-template",
81
- S
77
+ C
82
78
  );
83
- if (!w(f))
79
+ if (!q(f))
84
80
  throw new Error("Unexpected create-template response");
85
- return f.type === "alert" ? (i({
81
+ return f.type === "alert" ? (l({
86
82
  message: u(
87
83
  "newsletter.template-library-save-alert",
88
- { templateName: s.getTemplateName }
84
+ { templateName: o.getTemplateName }
89
85
  ),
90
- type: T.Error
91
- }), !1) : (i({
86
+ type: P.Error
87
+ }), !1) : (l({
92
88
  message: u(
93
89
  "newsletter.template-library-save-success",
94
- { templateName: s.getTemplateName }
90
+ { templateName: o.getTemplateName }
95
91
  ),
96
92
  type: "success"
97
93
  }), !0);
98
- } catch (n) {
99
- return o(n, "Failed to create template"), !1;
94
+ } catch (i) {
95
+ return s(i, "Failed to create template"), !1;
100
96
  }
101
97
  }
102
98
  };
@@ -13,6 +13,9 @@ interface ConfigWriterApi {
13
13
  * itself is torn down.
14
14
  */
15
15
  export declare function registerNodeConfigWriter(api: ConfigWriterApi): void;
16
+ /** Records the product list last handed to a block's node; compared by identity, as every fetch swaps the array. */
17
+ export declare function markProductsDrawn(blockId: number, products: RecommendationProduct[]): void;
18
+ export declare function areProductsDrawn(blockId: number, products: RecommendationProduct[]): boolean;
16
19
  export declare function hasEditedConfigChange(node: ImmutableHtmlNode, updates: PartialNodeConfig): boolean;
17
20
  export declare const PRODUCT_IDS_DESCRIPTION = "Updated product IDs";
18
21
  /** A deferred Product Ids edit keeps its own undo label wherever the write finally lands. */
@@ -1,4 +1,4 @@
1
- const s = "2.81.1", n = ["UIEditor.js", "zone.js", "styles-BWH3PMR4.css", "polyfills-FF3RLU5F.js", "main-5LCHF56A.js", "chunk-2HYLRI4G.js", "chunk-4SN7BSQN.js", "chunk-5IY7ZG3R.js", "chunk-62K3AMOD.js", "chunk-GK543IRH.js", "chunk-L2EPGQ76.js", "chunk-LXS5IGCQ.js", "chunk-PNWIGF4L.js", "chunk-S2TYCIH3.js", "chunk-S5UZ4LUK.js", "chunk-V2AGQPVL.js", "chunk-XZ6MUAN5.js", "chunk-ZPL4VL4O.js", "assets/css/uiEditor.css", "assets/i18n/en.json", "assets/icons/ui-editor-icons.sprite.svg", "assets/icons/ui-editor-icons.map.json", "assets/imageeditor/scripts.min.js", "assets/imageeditor/assets/icons/merged.svg"], i = {
1
+ const s = "2.83.1", n = ["UIEditor.js", "zone.js", "styles-BWH3PMR4.css", "polyfills-FF3RLU5F.js", "main-OTN2PYRT.js", "chunk-62K3AMOD.js", "chunk-6RGJBGUG.js", "chunk-6W43DTQG.js", "chunk-EC4WGEOZ.js", "chunk-GLBBUJ54.js", "chunk-GPJLJCMF.js", "chunk-MDCDEJUH.js", "chunk-P7HQTFJV.js", "chunk-PA4WGBC4.js", "chunk-QMDAV6OU.js", "chunk-R2F3ADM2.js", "chunk-YSKQ2TWF.js", "chunk-ZU5ASRKR.js", "assets/css/uiEditor.css", "assets/i18n/en.json", "assets/icons/ui-editor-icons.sprite.svg", "assets/icons/ui-editor-icons.map.json", "assets/imageeditor/scripts.min.js", "assets/imageeditor/assets/icons/merged.svg"], i = {
2
2
  version: s,
3
3
  files: n
4
4
  };
@@ -1,6 +1,6 @@
1
1
  import { useTemplateLibraryApi as o } from "../services/templateLibraryApi.js";
2
- import { defineStore as r } from "pinia";
3
- const i = () => ({
2
+ import { defineStore as i } from "pinia";
3
+ const r = () => ({
4
4
  templateName: "",
5
5
  categories: [],
6
6
  selectedCategories: [],
@@ -17,8 +17,8 @@ const i = () => ({
17
17
  editor: 2,
18
18
  message: 1
19
19
  }
20
- }), g = r("guidoSaveAsTemplate", {
21
- state: () => i(),
20
+ }), g = i("guidoSaveAsTemplate", {
21
+ state: () => r(),
22
22
  getters: {
23
23
  getTemplateName: (e) => e.templateName.trim(),
24
24
  getSelectedCategoryIds: (e) => e.selectedCategories.map((a) => Number(a.value))
@@ -26,7 +26,7 @@ const i = () => ({
26
26
  actions: {
27
27
  async fetchCategories() {
28
28
  const { getCategories: e } = o(), a = await e();
29
- this.categories = (Array.isArray(a) ? a : []).map((t) => ({
29
+ this.categories = a.map((t) => ({
30
30
  value: t.id.toString(),
31
31
  text: t.name
32
32
  })).sort((t, s) => t.text.localeCompare(s.text));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.23.0-beta.6555b16",
3
+ "version": "3.23.0-beta.75de098",
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",
@@ -128,7 +128,7 @@
128
128
  },
129
129
  "guido": {
130
130
  "stripo": {
131
- "version": "2.81.1"
131
+ "version": "2.83.1"
132
132
  }
133
133
  }
134
134
  }