@useinsider/guido 3.22.0-beta.2551a6f → 3.22.0-beta.3f91a42

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 (44) 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/composables/useEditorOpenMetrics.js +167 -0
  5. package/dist/composables/useStripo.js +93 -82
  6. package/dist/extensions/Blocks/Items/controls/button/link.js +14 -17
  7. package/dist/extensions/Blocks/Items/controls/cardComposition.js +14 -17
  8. package/dist/extensions/Blocks/Items/controls/image/link.js +14 -17
  9. package/dist/extensions/Blocks/Items/controls/name/trimming.js +9 -10
  10. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +24 -25
  11. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +12 -13
  12. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +29 -30
  13. package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +15 -16
  14. package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +25 -26
  15. package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +27 -28
  16. package/dist/extensions/Blocks/Items/controls/settingsControl.js +75 -80
  17. package/dist/extensions/Blocks/Recommendation/controls/cardBackground/index.js +3 -3
  18. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +7 -7
  19. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +13 -13
  20. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +121 -116
  21. package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +5 -5
  22. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.js +8 -8
  23. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.js +15 -15
  24. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.js +12 -12
  25. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.js +10 -10
  26. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +1 -1
  27. package/dist/extensions/Blocks/common-control.js +62 -55
  28. package/dist/guido.css +1 -1
  29. package/dist/library.js +12 -10
  30. package/dist/package.json.js +6 -4
  31. package/dist/public/prefetchRuntime.js +4 -0
  32. package/dist/src/composables/useEditorOpenMetrics.d.ts +27 -0
  33. package/dist/src/composables/useStripo.d.ts +2 -1
  34. package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +0 -1
  35. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +3 -2
  36. package/dist/src/extensions/Blocks/common-control.d.ts +2 -0
  37. package/dist/src/library.d.ts +1 -0
  38. package/dist/src/public/prefetchRuntime.d.ts +1 -0
  39. package/dist/src/utils/runtimePrefetch.d.ts +4 -0
  40. package/dist/src/utils/stripoRuntime.d.ts +3 -0
  41. package/dist/static/stripo-runtime-manifest.json.js +9 -0
  42. package/dist/utils/runtimePrefetch.js +26 -0
  43. package/dist/utils/stripoRuntime.js +13 -0
  44. package/package.json +7 -2
@@ -1,44 +1,54 @@
1
- import { useActionsApi as L } from "./useActionsApi.js";
2
- import { useBlocksConfig as O } from "./useBlocksConfig.js";
3
- import { useConfig as H } from "./useConfig.js";
4
- import { useCustomInterfaceAppearance as w } from "./useCustomInterfaceAppearance.js";
5
- import { useFullStoryBridge as N } from "./useFullStoryBridge.js";
6
- import { useModuleRepair as j } from "./useModuleRepair.js";
7
- import { useStripoEventHandler as z } from "./useStripoEventHandler.js";
8
- import { useStripoNotifications as $ } from "./useStripoNotifications.js";
9
- import { useToaster as G } from "./useToaster.js";
10
- import { localePatch as J } from "../config/i18n/index.js";
11
- import { en as b } from "../config/i18n/en/index.js";
12
- import { ToasterTypeOptions as X } from "../enums/toaster.js";
13
- import { useStripoApi as K } from "../services/stripoApi.js";
14
- import Q from "../static/styles/customEditorStyle.css.js";
15
- import { useEditorStore as k } from "../stores/editor.js";
16
- import { buildMergeTagEntries as W, flattenDynamicContentList as Y } from "../utils/genericUtil.js";
17
- import Z from "../package.json.js";
18
- let n = null;
19
- const he = () => {
20
- const { features: c, template: u, isFeatureEnabled: p } = H(), { handleError: m, showToaster: v } = G(), { getToken: B, getCustomFonts: M, getSyncModulesStatus: T } = K(), { handleEvent: F } = z(), { handleModuleAdd: A } = j(), { getStripoBlocksConfig: V } = O(), { getStripoNotifications: _ } = $(), f = () => n || (n = new Promise((r, s) => {
21
- var d;
1
+ import { useActionsApi as M } from "./useActionsApi.js";
2
+ import { useBlocksConfig as N } from "./useBlocksConfig.js";
3
+ import { useConfig as j } from "./useConfig.js";
4
+ import { useCustomInterfaceAppearance as _ } from "./useCustomInterfaceAppearance.js";
5
+ import { useFullStoryBridge as z } from "./useFullStoryBridge.js";
6
+ import { useModuleRepair as $ } from "./useModuleRepair.js";
7
+ import { useStripoEventHandler as G } from "./useStripoEventHandler.js";
8
+ import { useStripoNotifications as X } from "./useStripoNotifications.js";
9
+ import { useToaster as J } from "./useToaster.js";
10
+ import { localePatch as K } from "../config/i18n/index.js";
11
+ import { en as B } from "../config/i18n/en/index.js";
12
+ import { ToasterTypeOptions as Q } from "../enums/toaster.js";
13
+ import { useStripoApi as W } from "../services/stripoApi.js";
14
+ import Y from "../static/styles/customEditorStyle.css.js";
15
+ import { useEditorStore as v } from "../stores/editor.js";
16
+ import { buildMergeTagEntries as Z, flattenDynamicContentList as ee } from "../utils/genericUtil.js";
17
+ import { getStripoRuntimeBaseUrl as te } from "../utils/stripoRuntime.js";
18
+ let d = null, T = !1;
19
+ const we = (e) => {
20
+ const { features: u, template: m, isFeatureEnabled: p } = j(), { handleError: f, showToaster: F } = J(), { getToken: A, getCustomFonts: P, getSyncModulesStatus: R } = W(), { handleEvent: U } = G(), { handleModuleAdd: V } = $(), { getStripoBlocksConfig: D } = N(), { getStripoNotifications: I } = X(), g = () => d || (d = new Promise((a, s) => {
22
21
  if (document.getElementById("UiEditorScript")) {
23
- r();
22
+ a();
24
23
  return;
25
24
  }
26
- const o = Z.guido, i = `https://email-static.useinsider.com/guido/${(d = o == null ? void 0 : o.stripo) == null ? void 0 : d.version}/UIEditor.js`, e = document.createElement("script");
27
- e.id = "UiEditorScript", e.type = "module", e.src = i, e.onload = () => r(), e.onerror = () => {
28
- e.remove(), s(new Error(`Failed to load Stripo UIEditor script from S3: ${i}`));
29
- }, document.body.appendChild(e);
30
- }), n.catch(() => {
31
- n = null;
32
- }), n), D = async (r, s, o, a = [], i = !1) => {
33
- var y, E, h, C;
34
- const e = k(), { html: d, css: P } = r, { baseBlocks: g, extensions: R } = await V(), S = ((y = c.value) == null ? void 0 : y.displayConditions) ?? !0, U = ((E = c.value) == null ? void 0 : E.modulesDisabled) ?? !1, I = !!d || (((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1), q = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
35
- w().importCss(), await window.UIEditor.initEditor(
25
+ const i = te();
26
+ if (!i) {
27
+ s(
28
+ new Error("guido.stripo.version is not set in package.json. Please configure the Stripo version.")
29
+ );
30
+ return;
31
+ }
32
+ const n = `${i}UIEditor.js`, t = document.createElement("script");
33
+ t.id = "UiEditorScript", t.type = "module", t.src = n, t.onload = () => {
34
+ T = !0, a();
35
+ }, t.onerror = () => {
36
+ t.remove(), s(new Error(`Failed to load Stripo UIEditor script from S3: ${n}`));
37
+ }, document.body.appendChild(t);
38
+ }), d.catch(() => {
39
+ d = null;
40
+ }), d), L = async (a, s, i, n = [], t = !1) => {
41
+ var C, w, k, b;
42
+ const o = v(), { html: c, css: S } = a, { baseBlocks: y, extensions: q } = await D();
43
+ e.mark("blocks_config_ready");
44
+ const E = ((C = u.value) == null ? void 0 : C.displayConditions) ?? !0, x = ((w = u.value) == null ? void 0 : w.modulesDisabled) ?? !1, h = !!c || (((k = m.value) == null ? void 0 : k.forceRecreate) ?? !1), O = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
45
+ e.setTemplate({ html: c, css: S, forceRecreate: h }), _().importCss(), e.mark("init_editor"), await window.UIEditor.initEditor(
36
46
  document.querySelector("#guido-editor"),
37
47
  {
38
48
  metadata: s,
39
- html: d,
40
- css: P,
41
- forceRecreate: I,
49
+ html: c,
50
+ css: S,
51
+ forceRecreate: h,
42
52
  locale: "en",
43
53
  undoButtonSelector: "#guido__undo-button",
44
54
  redoButtonSelector: "#guido__redo-button",
@@ -48,12 +58,12 @@ const he = () => {
48
58
  customAppearanceMergetags: !p("liquidSyntax"),
49
59
  customAppearanceMergetagsBorderColor: "#f1f3fe",
50
60
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
51
- customViewStyles: Q,
52
- conditionsEnabled: S,
53
- customConditionsEnabled: S,
61
+ customViewStyles: Y,
62
+ conditionsEnabled: E,
63
+ customConditionsEnabled: E,
54
64
  enableXSSSecurity: !0,
55
- modulesDisabled: U,
56
- syncModulesEnabled: i,
65
+ modulesDisabled: x,
66
+ syncModulesEnabled: t,
57
67
  messageSettingsEnabled: !0,
58
68
  displayGmailAnnotations: !0,
59
69
  displayHiddenPreheader: !1,
@@ -63,55 +73,56 @@ const he = () => {
63
73
  copyPasteEnabled: !1,
64
74
  selectElementAfterDrop: !0,
65
75
  sameFontSizeForOutlook: !0,
66
- allowedScriptSourceDomains: q,
67
- ...g ? { baseBlocks: g } : {},
76
+ allowedScriptSourceDomains: O,
77
+ ...y ? { baseBlocks: y } : {},
68
78
  editorFonts: {
69
79
  showDefaultStandardFonts: !0,
70
80
  showDefaultNotStandardFonts: !0,
71
- customFonts: a
81
+ customFonts: n
72
82
  },
73
83
  mergeTags: [
74
84
  {
75
- entries: W(
76
- o.preselectedDynamicContentList,
77
- Y((C = u.value) == null ? void 0 : C.dynamicContentList),
85
+ entries: Z(
86
+ i.preselectedDynamicContentList,
87
+ ee((b = m.value) == null ? void 0 : b.dynamicContentList),
78
88
  p("liquidSyntax")
79
89
  )
80
90
  }
81
91
  ],
82
- async onTokenRefreshRequest(t) {
92
+ async onTokenRefreshRequest(r) {
83
93
  try {
84
- const l = await B();
85
- t(l);
94
+ e.mark("token_start");
95
+ const l = await A();
96
+ e.mark("token_end"), r(l);
86
97
  } catch (l) {
87
- m(l, "Failed to refresh token");
98
+ f(l, "Failed to refresh token");
88
99
  }
89
100
  },
90
101
  onTemplateLoaded() {
91
102
  try {
92
- const { activateCustomViewStyles: t, updateTimerInClonedTemplate: l } = L(), { injectFullStory: x } = N();
93
- w().importCss(), t(), x(), l(), o.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
94
- e.hasChanges = !1;
95
- }, 1e3);
96
- } catch (t) {
97
- m(t, "Failed to load custom interface appearance");
103
+ const { activateCustomViewStyles: r, updateTimerInClonedTemplate: l } = M(), { injectFullStory: H } = z();
104
+ _().importCss(), r(), H(), l(), i.onReady(), o.isStripoInitialized = !0, o.loadingStatus = !1, setTimeout(() => {
105
+ o.hasChanges = !1;
106
+ }, 1e3), e.markReady();
107
+ } catch (r) {
108
+ f(r, "Failed to load custom interface appearance");
98
109
  }
99
110
  },
100
- onCodeEditorVisibilityChanged(t) {
101
- e.isCodeEditorOpen = t;
111
+ onCodeEditorVisibilityChanged(r) {
112
+ o.isCodeEditorOpen = r;
102
113
  },
103
- onEditorVisualModeChanged(t) {
104
- e.editorVisualMode = t.toLowerCase();
114
+ onEditorVisualModeChanged(r) {
115
+ o.editorVisualMode = r.toLowerCase();
105
116
  },
106
- onVersionHistoryVisibilityChanged(t) {
107
- e.isVersionHistoryOpen = t;
117
+ onVersionHistoryVisibilityChanged(r) {
118
+ o.isVersionHistoryOpen = r;
108
119
  },
109
120
  onDataChanged() {
110
- e.hasChanges = !0, e.changeSeq += 1;
121
+ o.hasChanges = !0, o.changeSeq += 1;
111
122
  },
112
- onEvent: F,
113
- onModuleAdd: A,
114
- notifications: _(),
123
+ onEvent: U,
124
+ onModuleAdd: V,
125
+ notifications: I(),
115
126
  // Stripo deselects the block on any click outside the canvas, so every surface
116
127
  // that belongs to the block's own flow has to be listed here (SD-153273).
117
128
  ignoreClickOutsideSelectors: [
@@ -121,35 +132,35 @@ const he = () => {
121
132
  ".in-modal-v2-wrapper",
122
133
  ".in-toasts-wrapper"
123
134
  ],
124
- extensions: R,
125
- localePatch: J
135
+ extensions: q,
136
+ localePatch: K
126
137
  }
127
138
  );
128
139
  };
129
- return { initPlugin: async (r, s, o) => {
130
- const a = k();
140
+ return { initPlugin: async (a, s, i) => {
141
+ const n = v();
131
142
  try {
132
- await f();
133
- const [i, e] = await Promise.all([
134
- M(),
135
- T()
143
+ e.mark("plugin_start"), e.setScriptPreloaded(T), await g(), e.mark("script_ready");
144
+ const [t, o] = await Promise.all([
145
+ P(),
146
+ R()
136
147
  ]);
137
- a.syncModulesEnabled = e, await D(r, s, o, i, e);
148
+ e.mark("fonts_sync_ready"), n.syncModulesEnabled = o, await L(a, s, i, t, o);
138
149
  } catch {
139
- a.loadingStatus = !1, v({
140
- type: X.Error,
141
- message: b["An error has occurred. Please report the error code to support."],
150
+ n.loadingStatus = !1, F({
151
+ type: Q.Error,
152
+ message: B["An error has occurred. Please report the error code to support."],
142
153
  actionButton: {
143
- text: b["Reload page"],
154
+ text: B["Reload page"],
144
155
  onClick: () => window.location.reload()
145
156
  }
146
- });
157
+ }), e.markFailed();
147
158
  }
148
159
  }, preloadRuntime: () => {
149
- f().catch(() => {
160
+ g().catch(() => {
150
161
  });
151
162
  } };
152
163
  };
153
164
  export {
154
- he as useStripo
165
+ we as useStripo
155
166
  };
@@ -1,31 +1,28 @@
1
- import { CommonControl as r } from "../../../common-control.js";
2
- import { ItemsBlockControlId as i } from "../../enums/controlEnums.js";
3
- import { getItemsBlockConfig as o } from "../../utils/nodeConfigUtils.js";
4
- const s = i.BUTTON_LINK, n = {
1
+ import { CommonControl as s } from "../../../common-control.js";
2
+ import { ItemsBlockControlId as r } from "../../enums/controlEnums.js";
3
+ import { getItemsBlockConfig as a } from "../../utils/nodeConfigUtils.js";
4
+ const e = r.BUTTON_LINK, n = {
5
5
  LINK: "link"
6
6
  };
7
- class m extends r {
7
+ class L extends s {
8
8
  getId() {
9
- return s;
9
+ return e;
10
10
  }
11
11
  getTemplate() {
12
12
  return `
13
- <div class="container ${s}">
13
+ <div class="container ${e}">
14
14
  ${this._getLink()}
15
15
  </div>
16
16
  `;
17
17
  }
18
18
  onRender() {
19
- const t = o(this.currentNode);
20
- this.api.updateValues({
21
- [n.LINK]: (t == null ? void 0 : t.buttonLink) ?? ""
22
- });
19
+ this.forgetLastPanelNode();
23
20
  }
24
- onTemplateNodeUpdated(t) {
25
- super.onTemplateNodeUpdated(t), this.handleBlockInstanceChange(() => {
26
- const e = o(this.currentNode);
21
+ onTemplateNodeUpdated(o) {
22
+ super.onTemplateNodeUpdated(o), this.handleBlockInstanceChange(() => {
23
+ const t = a(this.currentNode);
27
24
  this.api.updateValues({
28
- [n.LINK]: (e == null ? void 0 : e.buttonLink) ?? ""
25
+ [n.LINK]: (t == null ? void 0 : t.buttonLink) ?? ""
29
26
  });
30
27
  });
31
28
  }
@@ -44,6 +41,6 @@ class m extends r {
44
41
  }
45
42
  }
46
43
  export {
47
- m as ButtonLinkControl,
48
- s as CONTROL_BLOCK_ID
44
+ L as ButtonLinkControl,
45
+ e as CONTROL_BLOCK_ID
49
46
  };
@@ -1,12 +1,12 @@
1
1
  var I = Object.defineProperty;
2
2
  var U = (d, a, t) => a in d ? I(d, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[a] = t;
3
- var p = (d, a, t) => U(d, typeof a != "symbol" ? a + "" : a, t);
3
+ var y = (d, a, t) => U(d, typeof a != "symbol" ? a + "" : a, t);
4
4
  import { ModificationDescription as c } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
5
  import { CommonControl as b } from "../../common-control.js";
6
6
  import { ItemsBlockId as r } from "../enums/controlEnums.js";
7
7
  import { SETTINGS_ENUMS as h } from "../enums/settingsEnums.js";
8
8
  import { getItemsBlockConfig as R, setItemsBlockConfig as m } from "../utils/nodeConfigUtils.js";
9
- const g = "ui-elements-items-card-composition-block", i = {
9
+ const N = "ui-elements-items-card-composition-block", i = {
10
10
  PRODUCT_IMAGE: "image",
11
11
  PRODUCT_NAME: "name",
12
12
  PRODUCT_QUANTITY: "quantity",
@@ -17,7 +17,7 @@ const g = "ui-elements-items-card-composition-block", i = {
17
17
  class M extends b {
18
18
  constructor() {
19
19
  super(...arguments);
20
- p(this, "visibilityState", {
20
+ y(this, "visibilityState", {
21
21
  [i.PRODUCT_IMAGE]: !0,
22
22
  [i.PRODUCT_NAME]: !0,
23
23
  [i.PRODUCT_QUANTITY]: !0,
@@ -27,7 +27,7 @@ class M extends b {
27
27
  });
28
28
  }
29
29
  getId() {
30
- return g;
30
+ return N;
31
31
  }
32
32
  getTemplate() {
33
33
  return `
@@ -44,7 +44,7 @@ class M extends b {
44
44
  `;
45
45
  }
46
46
  onRender() {
47
- this._syncVisibilityFromAttributes(), this._handleBrowsedItemsQuantity(), this._initializeToggles(), this._listenToFormUpdates();
47
+ this.forgetLastPanelNode(), this._listenToFormUpdates();
48
48
  }
49
49
  onTemplateNodeUpdated(t) {
50
50
  super.onTemplateNodeUpdated(t), this.handleBlockInstanceChange(() => {
@@ -61,9 +61,6 @@ class M extends b {
61
61
  </div>
62
62
  `;
63
63
  }
64
- _initializeToggles() {
65
- this._updateTogglesFromState();
66
- }
67
64
  _updateTogglesFromState() {
68
65
  this.api.updateValues({
69
66
  [i.PRODUCT_IMAGE]: this.visibilityState[i.PRODUCT_IMAGE],
@@ -224,21 +221,21 @@ class M extends b {
224
221
  * - When both are visible, they share 50% each
225
222
  */
226
223
  _updatePriceCellWidthsForVerticalLayout(t) {
227
- var O, y;
224
+ var O, p;
228
225
  const e = R(this.currentNode);
229
226
  if (!((e == null ? void 0 : e.orientation) === h.ORIENTATION.VERTICAL))
230
227
  return;
231
- const n = (O = this.currentNode) == null ? void 0 : O.querySelectorAll(".product-price-class"), s = (y = this.currentNode) == null ? void 0 : y.querySelectorAll(".product-original-price-class"), l = (e == null ? void 0 : e.priceOrientation) === "vertical", P = this.visibilityState[i.PRODUCT_PRICE], C = this.visibilityState[i.PRODUCT_ORIGINAL_PRICE], T = t ?? this.api.getDocumentModifier();
228
+ const n = (O = this.currentNode) == null ? void 0 : O.querySelectorAll(".product-price-class"), s = (p = this.currentNode) == null ? void 0 : p.querySelectorAll(".product-original-price-class"), l = (e == null ? void 0 : e.priceOrientation) === "vertical", P = this.visibilityState[i.PRODUCT_PRICE], C = this.visibilityState[i.PRODUCT_ORIGINAL_PRICE], T = t ?? this.api.getDocumentModifier();
232
229
  if (n && n.length > 0) {
233
- const _ = l || !C ? "100%" : "50%";
234
- n.forEach((u) => {
235
- T.modifyHtml(u).setStyle("width", _);
230
+ const u = l || !C ? "100%" : "50%";
231
+ n.forEach((_) => {
232
+ T.modifyHtml(_).setStyle("width", u);
236
233
  });
237
234
  }
238
235
  if (s && s.length > 0) {
239
- const _ = l || !P ? "100%" : "50%";
240
- s.forEach((u) => {
241
- T.modifyHtml(u).setStyle("width", _);
236
+ const u = l || !P ? "100%" : "50%";
237
+ s.forEach((_) => {
238
+ T.modifyHtml(_).setStyle("width", u);
242
239
  });
243
240
  }
244
241
  t || T.apply(new c("Updated price cell widths for vertical layout"));
@@ -256,6 +253,6 @@ class M extends b {
256
253
  }
257
254
  }
258
255
  export {
259
- g as COMPOSITION_CONTROL_BLOCK_ID,
256
+ N as COMPOSITION_CONTROL_BLOCK_ID,
260
257
  M as ItemsBlockCardCompositionControl
261
258
  };
@@ -1,31 +1,28 @@
1
- import { CommonControl as a } from "../../../common-control.js";
2
- import { ItemsBlockControlId as i } from "../../enums/controlEnums.js";
3
- import { getItemsBlockConfig as o } from "../../utils/nodeConfigUtils.js";
4
- const s = i.IMAGE_LINK, n = {
1
+ import { CommonControl as s } from "../../../common-control.js";
2
+ import { ItemsBlockControlId as r } from "../../enums/controlEnums.js";
3
+ import { getItemsBlockConfig as a } from "../../utils/nodeConfigUtils.js";
4
+ const t = r.IMAGE_LINK, n = {
5
5
  LINK: "link"
6
6
  };
7
- class p extends a {
7
+ class L extends s {
8
8
  getId() {
9
- return s;
9
+ return t;
10
10
  }
11
11
  getTemplate() {
12
12
  return `
13
- <div class="container ${s}">
13
+ <div class="container ${t}">
14
14
  ${this._getLink()}
15
15
  </div>
16
16
  `;
17
17
  }
18
18
  onRender() {
19
- const e = o(this.currentNode);
20
- this.api.updateValues({
21
- [n.LINK]: (e == null ? void 0 : e.imageLink) ?? ""
22
- });
19
+ this.forgetLastPanelNode();
23
20
  }
24
- onTemplateNodeUpdated(e) {
25
- super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(() => {
26
- const t = o(this.currentNode);
21
+ onTemplateNodeUpdated(o) {
22
+ super.onTemplateNodeUpdated(o), this.handleBlockInstanceChange(() => {
23
+ const e = a(this.currentNode);
27
24
  this.api.updateValues({
28
- [n.LINK]: (t == null ? void 0 : t.imageLink) ?? ""
25
+ [n.LINK]: (e == null ? void 0 : e.imageLink) ?? ""
29
26
  });
30
27
  });
31
28
  }
@@ -44,6 +41,6 @@ class p extends a {
44
41
  }
45
42
  }
46
43
  export {
47
- s as CONTROL_BLOCK_ID,
48
- p as ImageLinkControl
44
+ t as CONTROL_BLOCK_ID,
45
+ L as ImageLinkControl
49
46
  };
@@ -1,9 +1,9 @@
1
- import { ModificationDescription as d, UIElementType as s, UEAttr as p } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
1
+ import { ModificationDescription as d, UIElementType as m, UEAttr as p } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
2
  import { CommonControl as T } from "../../../common-control.js";
3
3
  import { nameMaxWidthFor as h } from "../../constants/cardLayout.js";
4
4
  import { ItemsBlockControlId as a } from "../../enums/controlEnums.js";
5
5
  import { findNameTextNode as c } from "../../utils/nameNode.js";
6
- import { getItemsBlockConfig as r, setItemsBlockConfig as g } from "../../utils/nodeConfigUtils.js";
6
+ import { getItemsBlockConfig as s, setItemsBlockConfig as g } from "../../utils/nodeConfigUtils.js";
7
7
  const I = a.NAME_TRIMMING, n = {
8
8
  TRIMMING: "trimming"
9
9
  };
@@ -19,14 +19,13 @@ class E extends T {
19
19
  `;
20
20
  }
21
21
  onRender() {
22
- const e = r(this.currentNode);
23
- this.api.updateValues({ [n.TRIMMING]: (e == null ? void 0 : e.nameTrimming) ?? !0 }), this.api.onValueChanged(n.TRIMMING, (t) => {
24
- this._onTrimmingChange(t);
22
+ this.forgetLastPanelNode(), this.api.onValueChanged(n.TRIMMING, (e) => {
23
+ this._onTrimmingChange(e);
25
24
  });
26
25
  }
27
26
  onTemplateNodeUpdated(e) {
28
27
  super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(() => {
29
- const t = r(this.currentNode);
28
+ const t = s(this.currentNode);
30
29
  this.api.updateValues({ [n.TRIMMING]: (t == null ? void 0 : t.nameTrimming) ?? !0 });
31
30
  });
32
31
  }
@@ -37,16 +36,16 @@ class E extends T {
37
36
  const t = c(this.currentNode);
38
37
  if (!t)
39
38
  return;
40
- const i = r(this.currentNode), m = e !== void 0 ? e : (i == null ? void 0 : i.nameTrimming) ?? !0, l = h(i == null ? void 0 : i.orientation), o = this.api.getDocumentModifier().modifyHtml(t);
41
- m ? o.setStyle("white-space", "nowrap").setStyle("overflow", "hidden").setStyle("text-overflow", "ellipsis") : o.removeStyle("white-space").removeStyle("overflow").removeStyle("text-overflow"), o.setStyle("max-width", l).apply(new d(`Text Trimming ${m ? "Enabled" : "Disabled"}`));
39
+ const i = s(this.currentNode), r = e !== void 0 ? e : (i == null ? void 0 : i.nameTrimming) ?? !0, l = h(i == null ? void 0 : i.orientation), o = this.api.getDocumentModifier().modifyHtml(t);
40
+ r ? o.setStyle("white-space", "nowrap").setStyle("overflow", "hidden").setStyle("text-overflow", "ellipsis") : o.removeStyle("white-space").removeStyle("overflow").removeStyle("text-overflow"), o.setStyle("max-width", l).apply(new d(`Text Trimming ${r ? "Enabled" : "Disabled"}`));
42
41
  }
43
42
  _getTextTrimming() {
44
43
  return `
45
44
  <div class="display-flex align-items-center justify-content-between">
46
- <${s.LABEL}
45
+ <${m.LABEL}
47
46
  ${p.LABEL.text}="${this.api.translate("Text Trimming")}"
48
47
  >
49
- </${s.LABEL}>
48
+ </${m.LABEL}>
50
49
  ${this._GuToggle(n.TRIMMING)}
51
50
  </div>
52
51
  `;
@@ -1,33 +1,32 @@
1
- import { currencyLocationMaps as p } from "../../../../../enums/extensions/recommendationBlock.js";
2
- import { UEAttr as N, ModificationDescription as I } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
3
- import { CommonControl as L } from "../../../common-control.js";
1
+ import { currencyLocationMaps as m } from "../../../../../enums/extensions/recommendationBlock.js";
2
+ import { UEAttr as I, ModificationDescription as L } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
3
+ import { CommonControl as N } from "../../../common-control.js";
4
4
  import { ITEMS_CURRENCY_ATTR as T, currencyPositionFromLocation as E } from "../../constants/currency.js";
5
- import { ItemsBlockControlId as m } from "../../enums/controlEnums.js";
6
- import { getItemsBlockConfig as l, setItemsBlockConfig as O, escapeReplacement as f } from "../../utils/nodeConfigUtils.js";
7
- const b = m.PRICE_CURRENCY_LOCATION, c = {
5
+ import { ItemsBlockControlId as p } from "../../enums/controlEnums.js";
6
+ import { getItemsBlockConfig as u, setItemsBlockConfig as O, escapeReplacement as f } from "../../utils/nodeConfigUtils.js";
7
+ const b = p.PRICE_CURRENCY_LOCATION, a = {
8
8
  CURRENCY_LOCATION: "currencyLocation"
9
9
  };
10
- class Y extends L {
10
+ class B extends N {
11
11
  getId() {
12
12
  return b;
13
13
  }
14
14
  getTemplate() {
15
15
  return `
16
- <div class="container ${m.PRICE_CURRENCY_LOCATION}">
16
+ <div class="container ${p.PRICE_CURRENCY_LOCATION}">
17
17
  ${this._getCurrencyLocation()}
18
18
  </div>
19
19
  `;
20
20
  }
21
21
  onRender() {
22
- const e = l(this.currentNode);
23
- this.api.setUIEAttribute(c.CURRENCY_LOCATION, N.SELECTPICKER.items, p), this.api.updateValues({ [c.CURRENCY_LOCATION]: (e == null ? void 0 : e.priceCurrencyLocation) ?? "0" }), this.api.onValueChanged(c.CURRENCY_LOCATION, (t) => {
24
- this._onCurrencyLocationChange(t);
22
+ this.forgetLastPanelNode(), this.api.setUIEAttribute(a.CURRENCY_LOCATION, I.SELECTPICKER.items, m), this.api.onValueChanged(a.CURRENCY_LOCATION, (e) => {
23
+ this._onCurrencyLocationChange(e);
25
24
  });
26
25
  }
27
26
  onTemplateNodeUpdated(e) {
28
27
  super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(() => {
29
- const t = l(this.currentNode);
30
- this.api.updateValues({ [c.CURRENCY_LOCATION]: (t == null ? void 0 : t.priceCurrencyLocation) ?? "0" });
28
+ const t = u(this.currentNode);
29
+ this.api.updateValues({ [a.CURRENCY_LOCATION]: (t == null ? void 0 : t.priceCurrencyLocation) ?? "0" });
31
30
  });
32
31
  }
33
32
  _onCurrencyLocationChange(e) {
@@ -36,15 +35,15 @@ class Y extends L {
36
35
  const t = this._getPriceBlocks();
37
36
  if (!t || t.length === 0)
38
37
  return;
39
- const r = l(this.currentNode), n = e || "0", o = (r == null ? void 0 : r.priceCurrencySymbol) ?? "", i = E(n), s = this.api.getDocumentModifier();
38
+ const r = u(this.currentNode), n = e || "0", o = (r == null ? void 0 : r.priceCurrencySymbol) ?? "", c = E(n), i = this.api.getDocumentModifier();
40
39
  t.forEach((h) => {
41
- const a = this._getParagraph(h);
42
- if (!a)
40
+ const s = this._getParagraph(h);
41
+ if (!s)
43
42
  return;
44
- const d = a.getInnerHTML().trim() || "", C = a.getInnerText().trim() || "", u = (o == null ? void 0 : o.trim()) || "", _ = this._removeCurrencySymbol(C, u), g = this._detectSymbolInText(C) || u, R = this._buildPriceContent(_, g, n), y = d.replace(C, f(R));
45
- s.modifyHtml(a).setInnerHtml(y).setAttribute(T.POSITION, i);
46
- }), s.apply(new I(
47
- `Updated currency location to ${i}`
43
+ const d = s.getInnerHTML().trim() || "", l = s.getInnerText().trim() || "", C = (o == null ? void 0 : o.trim()) || "", g = this._removeCurrencySymbol(l, C), _ = this._detectSymbolInText(l) || C, y = this._buildPriceContent(g, _, n), R = d.replace(l, f(y));
44
+ i.modifyHtml(s).setInnerHtml(R).setAttribute(T.POSITION, c);
45
+ }), i.apply(new L(
46
+ `Updated currency location to ${c}`
48
47
  ));
49
48
  }
50
49
  _getPriceBlocks() {
@@ -66,8 +65,8 @@ class Y extends L {
66
65
  } else {
67
66
  const o = r.match(/([^0-9.,\s]+)/);
68
67
  if (o && o[1]) {
69
- const i = o[1].trim(), s = new RegExp(`\\s*${this._escapeRegex(i)}\\s*`);
70
- n = r.replace(s, "").trim();
68
+ const c = o[1].trim(), i = new RegExp(`\\s*${this._escapeRegex(c)}\\s*`);
69
+ n = r.replace(i, "").trim();
71
70
  }
72
71
  }
73
72
  return n;
@@ -84,9 +83,9 @@ class Y extends L {
84
83
  ${this._GuTwoColumns([
85
84
  this._GuLabel({ text: "Currency Location" }),
86
85
  this._GuSelect({
87
- name: c.CURRENCY_LOCATION,
86
+ name: a.CURRENCY_LOCATION,
88
87
  placeholder: "",
89
- options: p
88
+ options: m
90
89
  })
91
90
  ])}
92
91
  `;
@@ -94,5 +93,5 @@ class Y extends L {
94
93
  }
95
94
  export {
96
95
  b as CONTROL_BLOCK_ID,
97
- Y as PriceCurrencyLocationControl
96
+ B as PriceCurrencyLocationControl
98
97
  };