@useinsider/guido 3.22.0 → 3.23.0-beta.1a04a96

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 (71) hide show
  1. package/README.md +35 -4
  2. package/dist/components/Guido.vue.js +1 -1
  3. package/dist/components/Guido.vue2.js +118 -108
  4. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +11 -11
  5. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +9 -9
  6. package/dist/composables/useEditorOpenMetrics.js +167 -0
  7. package/dist/composables/useStripo.js +93 -82
  8. package/dist/config/compiler/utils/recommendationCompilerUtils.js +22 -22
  9. package/dist/config/migrator/recommendation/compositionMapper.js +56 -49
  10. package/dist/config/migrator/recommendation/extractors.js +100 -40
  11. package/dist/config/migrator/recommendation/htmlBuilder.js +285 -207
  12. package/dist/config/migrator/recommendation/settingsMapper.js +37 -36
  13. package/dist/config/migrator/recommendation/themeMapper.js +53 -41
  14. package/dist/config/migrator/recommendationMigrator.js +68 -61
  15. package/dist/config/migrator/unsubscribeMigrator.js +60 -87
  16. package/dist/extensions/Blocks/Items/controls/button/link.js +14 -17
  17. package/dist/extensions/Blocks/Items/controls/cardComposition.js +14 -17
  18. package/dist/extensions/Blocks/Items/controls/image/link.js +14 -17
  19. package/dist/extensions/Blocks/Items/controls/name/trimming.js +9 -10
  20. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +24 -25
  21. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +12 -13
  22. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +29 -30
  23. package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +15 -16
  24. package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +25 -26
  25. package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +27 -28
  26. package/dist/extensions/Blocks/Items/controls/settingsControl.js +75 -80
  27. package/dist/extensions/Blocks/Recommendation/block.js +33 -24
  28. package/dist/extensions/Blocks/Recommendation/controls/cardBackground/index.js +3 -3
  29. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +27 -26
  30. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +13 -13
  31. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +165 -175
  32. package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +5 -5
  33. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.js +8 -8
  34. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.js +15 -15
  35. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.js +12 -12
  36. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.js +10 -10
  37. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +1 -1
  38. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +23 -22
  39. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +19 -18
  40. package/dist/extensions/Blocks/Recommendation/templates/utils.js +82 -91
  41. package/dist/extensions/Blocks/Recommendation/utils/inlinePriceOrder.js +12 -0
  42. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMap.js +3 -2
  43. package/dist/extensions/Blocks/common-control.js +62 -55
  44. package/dist/guido.css +1 -1
  45. package/dist/library.js +12 -10
  46. package/dist/package.json.js +6 -4
  47. package/dist/public/prefetchRuntime.js +4 -0
  48. package/dist/src/composables/useEditorOpenMetrics.d.ts +27 -0
  49. package/dist/src/composables/useStripo.d.ts +2 -1
  50. package/dist/src/config/migrator/recommendation/compositionMapper.d.ts +3 -1
  51. package/dist/src/config/migrator/recommendation/extractors.d.ts +35 -6
  52. package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +3 -1
  53. package/dist/src/config/migrator/recommendation/themeMapper.d.ts +3 -1
  54. package/dist/src/config/migrator/recommendation/types.d.ts +11 -1
  55. package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +0 -1
  56. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +1 -0
  57. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +5 -10
  58. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +1 -13
  59. package/dist/src/extensions/Blocks/Recommendation/utils/inlinePriceOrder.d.ts +9 -0
  60. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.d.ts +2 -19
  61. package/dist/src/extensions/Blocks/common-control.d.ts +2 -0
  62. package/dist/src/library.d.ts +1 -0
  63. package/dist/src/public/prefetchRuntime.d.ts +1 -0
  64. package/dist/src/stores/unsubscribe.d.ts +10 -0
  65. package/dist/src/utils/runtimePrefetch.d.ts +4 -0
  66. package/dist/src/utils/stripoRuntime.d.ts +3 -0
  67. package/dist/static/stripo-runtime-manifest.json.js +9 -0
  68. package/dist/stores/unsubscribe.js +33 -29
  69. package/dist/utils/runtimePrefetch.js +26 -0
  70. package/dist/utils/stripoRuntime.js +13 -0
  71. package/package.json +7 -2
@@ -2,23 +2,24 @@ var b = Object.defineProperty;
2
2
  var A = (m, c, e) => c in m ? b(m, c, { enumerable: !0, configurable: !0, writable: !0, value: e }) : m[c] = e;
3
3
  var u = (m, c, e) => A(m, typeof c != "symbol" ? c + "" : c, e);
4
4
  import { useConfig as g } from "../../../composables/useConfig.js";
5
- import { BlockId as D } from "../../../enums/block.js";
6
- import { getMigrationBannerHtml as E } from "../../../utils/migrationBannerHtml.js";
5
+ import { BlockId as E } from "../../../enums/block.js";
6
+ import { getMigrationBannerHtml as D } from "../../../utils/migrationBannerHtml.js";
7
7
  import { Block as S, BlockCompositionType as v, ModificationDescription as _ } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
8
- import { CURRENT_CONFIG_VERSION as N, PRE_RRS_CONFIG_VERSION as M } from "./constants/defaultConfig.js";
8
+ import { CURRENT_CONFIG_VERSION as M, PRE_RRS_CONFIG_VERSION as N } from "./constants/defaultConfig.js";
9
9
  import { RECOMMENDATION_ID_ATTR as f } from "./constants/selectors.js";
10
- import { ensureMobileFitRule as w, syncHeightBound as O } from "./controls/image/index.js";
11
- import { regenerateMobileProductRows as H } from "./controls/main/utils.js";
12
- import { ensureMobileCssRulesExist as I, setMobileLayoutOptOut as R, hasMobileLayoutOptOut as T } from "./controls/mobileLayout/cssRules.js";
10
+ import { ensureMobileFitRule as T, syncHeightBound as w } from "./controls/image/index.js";
11
+ import { regenerateMobileProductRows as O } from "./controls/main/utils.js";
12
+ import { ensureMobileCssRulesExist as I, setMobileLayoutOptOut as R, hasMobileLayoutOptOut as x } from "./controls/mobileLayout/cssRules.js";
13
+ import { CSS_CLASS_TEXT_TRIM as H, ensureTextTrimCssRulesExist as $ } from "./controls/shared/textTrimCssRules.js";
13
14
  import { RecommendationConfigService as a } from "./services/configService.js";
14
15
  import { useRecommendationExtensionStore as p } from "./store/recommendation.js";
15
- import { getDefaultTemplate as x } from "./templates/grid/template.js";
16
+ import { getDefaultTemplate as q } from "./templates/grid/template.js";
16
17
  import { useRecommendationBlockWarning as F } from "./useRecommendationBlockWarning.js";
17
- import { registerNodeConfigWriter as y, readBlockNodeConfigs as $ } from "./utils/nodeConfigWriter.js";
18
- import { refreshArrivedStrategyBlocks as q, resolveSourceConfig as L, refreshDuplicatedStrategyBlocks as P } from "./utils/strategyCommit.js";
19
- const k = D.Recommendation, h = "recommendation-block-v2", C = "hide-price";
18
+ import { registerNodeConfigWriter as y, readBlockNodeConfigs as L } from "./utils/nodeConfigWriter.js";
19
+ import { refreshArrivedStrategyBlocks as P, resolveSourceConfig as V, refreshDuplicatedStrategyBlocks as W } from "./utils/strategyCommit.js";
20
+ const k = E.Recommendation, h = "recommendation-block-v2", C = "hide-price";
20
21
  let B = !1;
21
- class se extends S {
22
+ class ae extends S {
22
23
  constructor() {
23
24
  super();
24
25
  /**
@@ -52,7 +53,7 @@ class se extends S {
52
53
  );
53
54
  }
54
55
  getSettingsPanelTitleHtml() {
55
- return E(
56
+ return D(
56
57
  k,
57
58
  this.api.translate("Recommendation Block"),
58
59
  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.")
@@ -76,7 +77,7 @@ class se extends S {
76
77
  */
77
78
  getTemplate() {
78
79
  const e = this._generateNextId();
79
- return this._pendingBlockId = e, x(e);
80
+ return this._pendingBlockId = e, q(e);
80
81
  }
81
82
  /**
82
83
  * Called when a new block is dropped into the template
@@ -110,7 +111,7 @@ class se extends S {
110
111
  e,
111
112
  {
112
113
  recommendationId: i,
113
- configVersion: r ? N : M,
114
+ configVersion: r ? M : N,
114
115
  ...s ? { partnerName: g().partnerName.value } : {},
115
116
  // An RRS block picks a strategy, not an algorithm, and its algorithm control is
116
117
  // hidden. Keeping the `mostPopular` default would bake a most-popular feed URL
@@ -121,7 +122,7 @@ class se extends S {
121
122
  if (l.setCurrentBlock(i), this._stampHidePrice(e, n.priceHideIfSameAsDiscounted), o) {
122
123
  I(this.api);
123
124
  const d = this._getBlockElement(e);
124
- d && (R(this.api, d, !0), H({
125
+ d && (R(this.api, d, !0), O({
125
126
  currentNode: e,
126
127
  documentModifier: this.api.getDocumentModifier()
127
128
  }));
@@ -155,13 +156,13 @@ class se extends S {
155
156
  "Assign recommendation ID to legacy block"
156
157
  );
157
158
  }
158
- this._healLingeringDuplicate(e), a.needsMigration(e) && this._migrateFromLegacy(e), this._healHidePriceAttr(e), this._ensureMobileFitRule(e), this._syncHeightBound(e);
159
+ this._healLingeringDuplicate(e), a.needsMigration(e) && this._migrateFromLegacy(e), this._healHidePriceAttr(e), this._ensureMobileFitRule(e), this._syncHeightBound(e), this._ensureTextTrimCss(e);
159
160
  try {
160
161
  B || (I(this.api), B = !0);
161
162
  const t = a.getConfig(e), i = this._getBlockElement(e);
162
163
  if (i) {
163
164
  const r = !t.mobileLayoutEnabled;
164
- T(i) !== r && R(this.api, i, r);
165
+ x(i) !== r && R(this.api, i, r);
165
166
  }
166
167
  } catch {
167
168
  }
@@ -179,7 +180,15 @@ class se extends S {
179
180
  }
180
181
  _ensureMobileFitRule(e) {
181
182
  try {
182
- w(this.api, e);
183
+ T(this.api, e);
184
+ } catch {
185
+ }
186
+ }
187
+ // A migrated block arrives with trimmed cells but without the stylesheet rules the toggle would have added.
188
+ _ensureTextTrimCss(e) {
189
+ var t;
190
+ try {
191
+ (t = this._getBlockElement(e)) != null && t.querySelector(`.${H}`) && $(this.api);
183
192
  } catch {
184
193
  }
185
194
  }
@@ -187,7 +196,7 @@ class se extends S {
187
196
  const t = this._getBlockElement(e);
188
197
  if (t)
189
198
  try {
190
- O(this.api, t);
199
+ w(this.api, t);
191
200
  } catch {
192
201
  }
193
202
  }
@@ -270,7 +279,7 @@ class se extends S {
270
279
  const d = { strategyId: l.strategyId };
271
280
  return t.add(n), this._refreshClaims.set(n, d), [{ id: n, config: l, claim: d }];
272
281
  });
273
- i.length && q(i.map(({ id: r, config: s }) => ({ id: r, config: s }))).catch((r) => console.error("[recommendation] refreshing an arrived strategy failed", r)).finally(() => i.forEach(({ id: r, claim: s }) => this._releaseRefreshClaim(r, s)));
282
+ i.length && P(i.map(({ id: r, config: s }) => ({ id: r, config: s }))).catch((r) => console.error("[recommendation] refreshing an arrived strategy failed", r)).finally(() => i.forEach(({ id: r, claim: s }) => this._releaseRefreshClaim(r, s)));
274
283
  }
275
284
  /**
276
285
  * A new document reports each block to onCreated and onDocumentInit, not always in one batch, so a
@@ -282,7 +291,7 @@ class se extends S {
282
291
  return !0;
283
292
  if (i.strategyId === t)
284
293
  return !1;
285
- const r = $(e);
294
+ const r = L(e);
286
295
  return r.length > 0 && r.every((s) => s.strategyId === t);
287
296
  }
288
297
  _releaseRefreshClaim(e, t) {
@@ -344,10 +353,10 @@ class se extends S {
344
353
  if (r.cloneBlockState(t, i), r.setCurrentBlock(i), g().isFeatureEnabled("reusableRecommendationStrategy")) {
345
354
  this._resetSourceIds.add(t), y(this.api);
346
355
  const s = a.getConfig(e), n = [
347
- { id: t, claim: { strategyId: L(t, s).strategyId } },
356
+ { id: t, claim: { strategyId: V(t, s).strategyId } },
348
357
  { id: i, claim: { strategyId: s.strategyId } }
349
358
  ].filter(({ id: o }) => !this._refreshClaims.has(o));
350
- n.forEach(({ id: o, claim: l }) => this._refreshClaims.set(o, l)), P(t, i, s).catch((o) => console.error("[recommendation] refreshing a duplicated strategy failed", o)).finally(() => n.forEach(({ id: o, claim: l }) => this._releaseRefreshClaim(o, l)));
359
+ n.forEach(({ id: o, claim: l }) => this._refreshClaims.set(o, l)), W(t, i, s).catch((o) => console.error("[recommendation] refreshing a duplicated strategy failed", o)).finally(() => n.forEach(({ id: o, claim: l }) => this._releaseRefreshClaim(o, l)));
351
360
  }
352
361
  this._warnIfMultipleBlocks();
353
362
  }
@@ -451,5 +460,5 @@ class se extends S {
451
460
  }
452
461
  export {
453
462
  k as BLOCK_ID,
454
- se as RecommendationBlock
463
+ ae as RecommendationBlock
455
464
  };
@@ -7,7 +7,7 @@ const u = "recommendation-card-background-color-control", e = {
7
7
  GRID: ".product-card-segment",
8
8
  LIST: ".product-card-wrapper"
9
9
  };
10
- class _ extends s {
10
+ class h extends s {
11
11
  getId() {
12
12
  return u;
13
13
  }
@@ -18,7 +18,7 @@ class _ extends s {
18
18
  ]);
19
19
  }
20
20
  onRender() {
21
- this._setFormValues(), this._listenToFormUpdates();
21
+ this.forgetLastPanelNode(), this._listenToFormUpdates();
22
22
  }
23
23
  onTemplateNodeUpdated(r) {
24
24
  super.onTemplateNodeUpdated(r), this._setFormValues();
@@ -72,5 +72,5 @@ class _ extends s {
72
72
  }
73
73
  export {
74
74
  u as CARD_BACKGROUND_COLOR_CONTROL_ID,
75
- _ as CardBackgroundColorControl
75
+ h as CardBackgroundColorControl
76
76
  };
@@ -4,17 +4,18 @@ var v = (_, g, t) => ct(_, typeof g != "symbol" ? g + "" : g, t);
4
4
  import { ACADEMY_LINKS as dt } from "../../../../../enums/academy.js";
5
5
  import { UIElementType as f, UEAttr as O, ModificationDescription as y } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
6
6
  import { CommonControl as ut } from "../../../common-control.js";
7
- import { ATTR_PRODUCT_IMAGE as q, ATTR_PRODUCT_NAME as mt, ATTR_PRODUCT_PRICE as p, ATTR_PRODUCT_OLD_PRICE as I, ATTR_PRODUCT_OMNIBUS_PRICE as ht, ATTR_PRODUCT_OMNIBUS_DISCOUNT as pt, ATTR_PRODUCT_BUTTON as F, ATTR_RECOMMENDATION_TITLE as $, ATTR_DATA_CARD_COMPOSITION as K, ATTR_DATA_CUSTOM_ATTRIBUTES as W, ATTR_CUSTOM_PREFIX as N, SELECTOR_ATTRIBUTE_ROW as E, SELECTOR_TITLE_CELL as z, ATTR_DATA_VISIBILITY as D, ATTR_DATA_ATTRIBUTE_TYPE as R, CSS_CLASS_ATTRIBUTE_ROW as G, CSS_CLASS_SPACER as _t, BUILT_IN_DEFAULT_ATTRIBUTES as gt } from "../../constants/selectors.js";
7
+ import { ATTR_PRODUCT_IMAGE as q, ATTR_PRODUCT_NAME as mt, ATTR_PRODUCT_PRICE as p, ATTR_PRODUCT_OLD_PRICE as I, ATTR_PRODUCT_OMNIBUS_PRICE as ht, ATTR_PRODUCT_OMNIBUS_DISCOUNT as pt, ATTR_PRODUCT_BUTTON as F, ATTR_RECOMMENDATION_TITLE as $, ATTR_DATA_CARD_COMPOSITION as K, ATTR_DATA_CUSTOM_ATTRIBUTES as W, ATTR_CUSTOM_PREFIX as N, SELECTOR_ATTRIBUTE_ROW as E, SELECTOR_TITLE_CELL as G, ATTR_DATA_VISIBILITY as D, ATTR_DATA_ATTRIBUTE_TYPE as R, CSS_CLASS_ATTRIBUTE_ROW as z, CSS_CLASS_SPACER as _t, BUILT_IN_DEFAULT_ATTRIBUTES as gt } from "../../constants/selectors.js";
8
8
  import { DEFAULT_COMPOSITION as Y, DEFAULT_VISIBILITY as X } from "../../constants/defaultConfig.js";
9
9
  import { RecommendationConfigService as T } from "../../services/configService.js";
10
10
  import { useRecommendationExtensionStore as ft } from "../../store/recommendation.js";
11
11
  import { ATTRIBUTE_CELL_CLASS as bt, gridElementRenderer as yt, DEFAULT_CELL_PADDING as Tt, buildFillerCell as Ct } from "../../templates/grid/elementRenderer.js";
12
12
  import { listElementRenderer as St } from "../../templates/list/elementRenderer.js";
13
13
  import { buildTitleRows as At, DEFAULT_TITLE_PARAGRAPH as It, DEFAULT_TITLE_TEXT as $t } from "../../templates/titleRows.js";
14
- import { resolveInlinePriceOrder as vt, toDisplayName as Nt, toDisplayableAttributeValue as Et, buildElementRenderer as J } from "../../templates/utils.js";
15
- import { normalizeCompositionKeys as Rt, normalizeCustomAttrValues as Lt, compositionKeyToProductAttr as k, resolveRowVisibilityKeys as Ot, filterToProductAttrValue as C, findAttributeRow as Dt, rewriteLegacyRowKeyHtml as Q, bareAttributeName as H, isDefaultProductAttr as Ht, productAttrToCompositionKey as M } from "../../utils/compositionKeys.js";
16
- import { getTableDisplayValue as Pt } from "../../utils/tagName.js";
17
- import { isPartnerManagedBlock as wt, regenerateProductRowsWithStyles as Bt, getMainContainerTbody as kt, getCurrentLayout as Mt } from "../main/utils.js";
14
+ import { toDisplayName as vt, toDisplayableAttributeValue as Nt, buildElementRenderer as J } from "../../templates/utils.js";
15
+ import { normalizeCompositionKeys as Et, normalizeCustomAttrValues as Rt, compositionKeyToProductAttr as k, resolveRowVisibilityKeys as Lt, filterToProductAttrValue as C, findAttributeRow as Ot, rewriteLegacyRowKeyHtml as Q, bareAttributeName as H, isDefaultProductAttr as Dt, productAttrToCompositionKey as M } from "../../utils/compositionKeys.js";
16
+ import { getTableDisplayValue as Ht } from "../../utils/tagName.js";
17
+ import { isPartnerManagedBlock as Pt, regenerateProductRowsWithStyles as wt, getMainContainerTbody as Bt, getCurrentLayout as kt } from "../main/utils.js";
18
+ import { resolveInlinePriceOrder as Mt } from "../../utils/inlinePriceOrder.js";
18
19
  const Ut = "ui-elements-recommendation-card-composition", U = ".product-card-wrapper > tbody", Z = ".product-info-cell > table > tbody", tt = {
19
20
  ADD_ATTRIBUTE: "addAttribute"
20
21
  }, b = 5, P = "reorderIcon_", qt = '<svg width="14" height="10" viewBox="0 0 14 10" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2.5" r="1.2"/><circle cx="7" cy="2.5" r="1.2"/><circle cx="12" cy="2.5" r="1.2"/><circle cx="2" cy="7.5" r="1.2"/><circle cx="7" cy="7.5" r="1.2"/><circle cx="12" cy="7.5" r="1.2"/></svg>', m = [
@@ -26,7 +27,7 @@ const Ut = "ui-elements-recommendation-card-composition", U = ".product-card-wra
26
27
  { key: pt, label: "Omnibus Discount" },
27
28
  { key: F, label: "Product Button" }
28
29
  ], L = { key: $, label: "Title" }, Ft = new Set(m.map((_) => _.key)), A = "customAttr_", w = "deleteAttr_";
29
- class se extends ut {
30
+ class oe extends ut {
30
31
  constructor() {
31
32
  super(...arguments);
32
33
  v(this, "store", ft());
@@ -142,7 +143,7 @@ class se extends ut {
142
143
  `;
143
144
  }
144
145
  onRender() {
145
- this._initializeComposition(), this._registerValueChangeListeners(), this._setupEventListeners(), this._updateOrderableState(), this._subscribeToStoreChanges(), this._syncDisabledState();
146
+ this.forgetLastPanelNode(), this._registerValueChangeListeners(), this._setupEventListeners(), this._updateOrderableState(), this._subscribeToStoreChanges();
146
147
  }
147
148
  /**
148
149
  * Card composition restructures the block (toggles/reorders/adds attribute
@@ -155,7 +156,7 @@ class se extends ut {
155
156
  const t = (r = this.getContainer()) == null ? void 0 : r.querySelector("[data-card-composition-control]");
156
157
  if (!t)
157
158
  return;
158
- const e = wt(this.currentNode);
159
+ const e = Pt(this.currentNode);
159
160
  t.style.pointerEvents = e ? "none" : "", t.style.opacity = e ? "0.5" : "";
160
161
  }
161
162
  onTemplateNodeUpdated(t) {
@@ -198,7 +199,7 @@ class se extends ut {
198
199
  }
199
200
  /** Upgrades legacy bare-name custom keys to the canonical form. (SD-147101) */
200
201
  _normalizeComposition(t) {
201
- return Rt(t, this.currentNode, this.store.filterList);
202
+ return Et(t, this.currentNode, this.store.filterList);
202
203
  }
203
204
  _readCustomAttributesFromNode() {
204
205
  if (!this.currentNode || !("getAttribute" in this.currentNode))
@@ -206,7 +207,7 @@ class se extends ut {
206
207
  const t = this.currentNode.getAttribute(W);
207
208
  if (t)
208
209
  try {
209
- return Lt(
210
+ return Rt(
210
211
  JSON.parse(t).map((e) => String(e)),
211
212
  this.currentNode,
212
213
  this.store.filterList
@@ -230,7 +231,7 @@ class se extends ut {
230
231
  }
231
232
  _hasTitle() {
232
233
  var t;
233
- return !!((t = this.currentNode) != null && t.querySelector(z));
234
+ return !!((t = this.currentNode) != null && t.querySelector(G));
234
235
  }
235
236
  _getDefaultVisibilities() {
236
237
  return { ...X };
@@ -241,7 +242,7 @@ class se extends ut {
241
242
  if (!("getAttribute" in r))
242
243
  return;
243
244
  const i = r.getAttribute(D);
244
- i !== null && Ot(r).forEach((s) => {
245
+ i !== null && Lt(r).forEach((s) => {
245
246
  e[s] = this._parseVisibilityValue(i);
246
247
  });
247
248
  }), e;
@@ -276,7 +277,7 @@ class se extends ut {
276
277
  if (!(i.dataset.inlinePrices !== String(s)) && this._tryReorderInPlace(i, t))
277
278
  return !1;
278
279
  i.dataset.inlinePrices = String(s);
279
- const n = new Set(e), l = vt(t);
280
+ const n = new Set(e), l = Mt(t);
280
281
  let a = 0, d = 0;
281
282
  const c = t.map((u) => {
282
283
  if (s && (u === p || u === I))
@@ -653,7 +654,7 @@ class se extends ut {
653
654
  try {
654
655
  this._updateBothAttributes(t, e);
655
656
  const r = this._isInlinePrices();
656
- this._getCurrentLayout() === "grid" && !r ? this._reorderProductAttributes(t) : this.currentNode && Bt({
657
+ this._getCurrentLayout() === "grid" && !r ? this._reorderProductAttributes(t) : this.currentNode && wt({
657
658
  currentNode: this.currentNode,
658
659
  documentModifier: this.api.getDocumentModifier()
659
660
  });
@@ -671,7 +672,7 @@ class se extends ut {
671
672
  * DOM converge on the next composition change without writing on open.
672
673
  */
673
674
  _getExistingRowHtml(t, e) {
674
- const r = Dt(t, e);
675
+ const r = Ot(t, e);
675
676
  if (r && "getOuterHTML" in r)
676
677
  return Q(r.getOuterHTML(), e);
677
678
  const i = t.querySelector(
@@ -712,7 +713,7 @@ class se extends ut {
712
713
  );
713
714
  }
714
715
  ).join(""), ot = Ct(x, l).repeat(S - B);
715
- return `<tr class="${G}" ${R}="${r}" ${D}="1">${st}${ot}</tr>`;
716
+ return `<tr class="${z}" ${R}="${r}" ${D}="1">${st}${ot}</tr>`;
716
717
  }
717
718
  return this._getExistingRowHtml(u, j);
718
719
  }).join("");
@@ -815,7 +816,7 @@ class se extends ut {
815
816
  return;
816
817
  const o = e ? "1" : "0", n = e ? this.api.translate("visible") : this.api.translate("hidden"), l = `${this.api.translate("Set visibility")}: ${t} → ${n}`, a = this.api.getDocumentModifier();
817
818
  s.forEach((c) => {
818
- const u = Pt(c), h = e ? u : "none";
819
+ const u = Ht(c), h = e ? u : "none";
819
820
  a.modifyHtml(c).setStyle("display", h).setAttribute(D, o);
820
821
  });
821
822
  const d = {
@@ -867,7 +868,7 @@ class se extends ut {
867
868
  return t.length > 0 ? t : this._findTitleRowsByClass();
868
869
  }
869
870
  _findTitleRowsByClass() {
870
- const t = this._findTitleContainerBody(), e = t && "children" in t ? t.children() : [], r = e.findIndex((s) => !!s.querySelector(z));
871
+ const t = this._findTitleContainerBody(), e = t && "children" in t ? t.children() : [], r = e.findIndex((s) => !!s.querySelector(G));
871
872
  if (r === -1)
872
873
  return [];
873
874
  const i = e[r + 1];
@@ -877,7 +878,7 @@ class se extends ut {
877
878
  return "children" in t && t.children().some((e) => "hasClass" in e && e.hasClass(_t));
878
879
  }
879
880
  _findTitleContainerBody() {
880
- return (this.currentNode ? kt(this.currentNode) : null) ?? void 0;
881
+ return (this.currentNode ? Bt(this.currentNode) : null) ?? void 0;
881
882
  }
882
883
  _readInnerHtml(t) {
883
884
  return "getInnerHTML" in t && typeof t.getInnerHTML == "function" ? t.getInnerHTML().trim() : null;
@@ -904,7 +905,7 @@ class se extends ut {
904
905
  return -1;
905
906
  }
906
907
  _getCurrentLayout() {
907
- return this.store.recommendationConfigs.orientation || Mt(this.currentNode);
908
+ return this.store.recommendationConfigs.orientation || kt(this.currentNode);
908
909
  }
909
910
  /**
910
911
  * Extracts background color properties from existing card elements.
@@ -974,7 +975,7 @@ class se extends ut {
974
975
  const r = this.store.recommendationConfigs.orientation;
975
976
  r !== t && (t = r, this._updateOrderableState());
976
977
  const i = Object.keys(this.store.filterList).sort().join(",");
977
- i !== e && (e = i, this._initializeComposition());
978
+ i !== e && (e = i, this.currentNode && this._initializeComposition());
978
979
  });
979
980
  }
980
981
  /**
@@ -1000,7 +1001,7 @@ class se extends ut {
1000
1001
  */
1001
1002
  _getDisplayNameForAttribute(t) {
1002
1003
  const e = Object.values(this.store.filterList).find((r) => C(r) === t);
1003
- return e ? e.displayName : Nt(H(t));
1004
+ return e ? e.displayName : vt(H(t));
1004
1005
  }
1005
1006
  /**
1006
1007
  * Resolves the display content for a custom attribute cell.
@@ -1008,8 +1009,8 @@ class se extends ut {
1008
1009
  */
1009
1010
  _resolveAttributeContent(t, e, r) {
1010
1011
  var l;
1011
- const s = this.store.recommendationProducts[r], o = H(t), n = Ht(t) ? s == null ? void 0 : s[o] : (l = s == null ? void 0 : s.product_attributes) == null ? void 0 : l[o];
1012
- return Et(n) ?? e;
1012
+ const s = this.store.recommendationProducts[r], o = H(t), n = Dt(t) ? s == null ? void 0 : s[o] : (l = s == null ? void 0 : s.product_attributes) == null ? void 0 : l[o];
1013
+ return Nt(n) ?? e;
1013
1014
  }
1014
1015
  _getGridCellHtml(t, e, r, i = "", s = "", o = "") {
1015
1016
  const n = M(t), l = H(t), a = J(yt, [n], this.store.filterList), d = {
@@ -1027,10 +1028,10 @@ class se extends ut {
1027
1028
  [i]: e,
1028
1029
  product_attributes: { [i]: e }
1029
1030
  }, l = s[r](o).replace(/<tr>/, "").replace(/<\/tr>/, "");
1030
- return `<tr class="${G}" ${R}="${r}" ${D}="1">${l}</tr>`;
1031
+ return `<tr class="${z}" ${R}="${r}" ${D}="1">${l}</tr>`;
1031
1032
  }
1032
1033
  }
1033
1034
  export {
1034
1035
  Ut as COMPOSITION_CONTROL_BLOCK_ID,
1035
- se as RecommendationCardCompositionControl
1036
+ oe as RecommendationCardCompositionControl
1036
1037
  };
@@ -1,15 +1,15 @@
1
1
  import { ModificationDescription as T } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { CommonControl as m } from "../../../common-control.js";
2
+ import { CommonControl as l } from "../../../common-control.js";
3
3
  import { RecommendationBlockId as n } from "../../constants/blockIds.js";
4
- import { RecommendationControlId as l } from "../../constants/controlIds.js";
4
+ import { RecommendationControlId as m } from "../../constants/controlIds.js";
5
5
  import { BLOCK_ROOT_SELECTOR as u, ATTR_PRODUCT_ATTR as a } from "../../constants/selectors.js";
6
- import { CSS_CLASS_TEXT_TRIM as o, ensureTextTrimCssRulesExist as c } from "../shared/textTrimCssRules.js";
6
+ import { CSS_CLASS_TEXT_TRIM as s, ensureTextTrimCssRulesExist as c } from "../shared/textTrimCssRules.js";
7
7
  const i = {
8
8
  TEXT_TRIM_ENABLED: "customAttrTextTrimEnabled"
9
9
  };
10
- class g extends m {
10
+ class C extends l {
11
11
  getId() {
12
- return l.CUSTOM_ATTR_TEXT_TRIM;
12
+ return m.CUSTOM_ATTR_TEXT_TRIM;
13
13
  }
14
14
  getTemplate() {
15
15
  return `
@@ -23,7 +23,7 @@ class g extends m {
23
23
  `;
24
24
  }
25
25
  onRender() {
26
- this._setFormValues(), this._listenToFormUpdates();
26
+ this.forgetLastPanelNode(), this._listenToFormUpdates();
27
27
  }
28
28
  onTemplateNodeUpdated(t) {
29
29
  super.onTemplateNodeUpdated(t), this._setFormValues();
@@ -39,10 +39,10 @@ class g extends m {
39
39
  _getCurrentTrimState() {
40
40
  if (!this.currentNode || !("hasClass" in this.currentNode))
41
41
  return !1;
42
- if (this.currentNode.hasClass(o))
42
+ if (this.currentNode.hasClass(s))
43
43
  return !0;
44
44
  const t = this._getTargetElements();
45
- return t.length > 0 && "hasClass" in t[0] ? t[0].hasClass(o) : !1;
45
+ return t.length > 0 && "hasClass" in t[0] ? t[0].hasClass(s) : !1;
46
46
  }
47
47
  // ========================================================================
48
48
  // Target Element Discovery (per-attribute scoping)
@@ -62,8 +62,8 @@ class g extends m {
62
62
  return [];
63
63
  const e = "asElement" in this.currentNode ? this.currentNode.asElement().getAttribute(a) : null;
64
64
  if (e) {
65
- const s = `[esd-extension-block-id="${n.CUSTOM_ATTRIBUTE}"][${a}="${e}"]`;
66
- return Array.from(t.querySelectorAll(s));
65
+ const o = `[esd-extension-block-id="${n.CUSTOM_ATTRIBUTE}"][${a}="${e}"]`;
66
+ return Array.from(t.querySelectorAll(o));
67
67
  }
68
68
  return Array.from(
69
69
  t.querySelectorAll(
@@ -80,8 +80,8 @@ class g extends m {
80
80
  return;
81
81
  t && c(this.api);
82
82
  const r = this.api.getDocumentModifier();
83
- e.forEach((s) => {
84
- t ? r.modifyHtml(s).setClass(o) : r.modifyHtml(s).removeClass(o);
83
+ e.forEach((o) => {
84
+ t ? r.modifyHtml(o).setClass(s) : r.modifyHtml(o).removeClass(s);
85
85
  }), r.apply(
86
86
  new T(
87
87
  t ? "Enable custom attribute text trimming" : "Disable custom attribute text trimming"
@@ -95,5 +95,5 @@ class g extends m {
95
95
  }
96
96
  }
97
97
  export {
98
- g as CustomAttributeTextTrimControl
98
+ C as CustomAttributeTextTrimControl
99
99
  };