@useinsider/guido 3.23.0-beta.31d0f5f → 3.23.0-beta.9f6bfbf

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 (42) hide show
  1. package/README.md +1 -0
  2. package/dist/@types/config/schemas.js +17 -15
  3. package/dist/components/Guido.vue.js +1 -1
  4. package/dist/components/Guido.vue2.js +58 -56
  5. package/dist/composables/useModuleRepair.js +14 -12
  6. package/dist/config/migrator/index.js +16 -15
  7. package/dist/config/migrator/itemsPriceFormatMigrator.js +20 -0
  8. package/dist/extensions/Blocks/Items/block.js +115 -77
  9. package/dist/extensions/Blocks/Items/constants/currency.js +59 -14
  10. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +33 -22
  11. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +62 -51
  12. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +18 -17
  13. package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +42 -31
  14. package/dist/extensions/Blocks/Items/controls/priceFormat.js +145 -0
  15. package/dist/extensions/Blocks/Items/controls/settingsControl.js +141 -120
  16. package/dist/extensions/Blocks/Items/enums/controlEnums.js +1 -1
  17. package/dist/extensions/Blocks/Items/extension.js +9 -8
  18. package/dist/extensions/Blocks/Items/items.css.js +19 -0
  19. package/dist/extensions/Blocks/Items/settingsPanel.js +34 -25
  20. package/dist/extensions/Blocks/Items/template.js +250 -212
  21. package/dist/extensions/Blocks/Items/utils/priceFormatOps.js +185 -0
  22. package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +1 -0
  23. package/dist/guido.css +1 -1
  24. package/dist/package.json.js +1 -1
  25. package/dist/src/@types/config/schemas.d.ts +4 -0
  26. package/dist/src/composables/useConfig.d.ts +2 -0
  27. package/dist/src/config/migrator/index.d.ts +4 -1
  28. package/dist/src/config/migrator/itemsPriceFormatMigrator.d.ts +1 -0
  29. package/dist/src/extensions/Blocks/Items/block.d.ts +6 -9
  30. package/dist/src/extensions/Blocks/Items/constants/currency.d.ts +32 -0
  31. package/dist/src/extensions/Blocks/Items/controls/priceFormat.d.ts +23 -0
  32. package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +1 -0
  33. package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +1 -0
  34. package/dist/src/extensions/Blocks/Items/template.d.ts +4 -1
  35. package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +3 -0
  36. package/dist/src/extensions/Blocks/Items/utils/priceFormatOps.d.ts +61 -0
  37. package/dist/src/extensions/Blocks/Recommendation/utils/priceFormatter.d.ts +12 -0
  38. package/dist/src/stores/config.d.ts +20 -0
  39. package/dist/src/utils/itemsCurrencyRepair.d.ts +5 -1
  40. package/dist/utils/itemsCurrencyRepair.js +29 -24
  41. package/dist/utils/pairProductVariables.js +119 -99
  42. package/package.json +1 -1
package/README.md CHANGED
@@ -166,6 +166,7 @@ const config: GuidoConfigInput = {
166
166
  allowlistEnabled?: boolean, // Default: false - Pre-save domain-allowlist check (opt-in). Guido self-serves the block toaster (role lookup, deep-link, copy from window.trans).
167
167
  allowSaveWithErrors?: boolean, // Default: true - Allow the validation drawer's "Save and Continue" soft-save. Set false to hard-block invalid saves (transactional + unsubscribe pages).
168
168
  reusableRecommendationStrategy?: boolean, // Default: false - Assign an RRS strategy to recommendation blocks instead of per-block algorithm/filters/shuffle/product-count settings.
169
+ itemsPriceFormatting?: boolean, // Default: false - Items block price formatting: thousand/decimal separator + decimal count on the block root, raw price tags in the export (formatted at send time).
169
170
  },
170
171
 
171
172
  // Optional: Callbacks
@@ -1,4 +1,4 @@
1
- import { ModuleFolderDefaults as f } from "../../enums/defaults.js";
1
+ import { ModuleFolderDefaults as S } from "../../enums/defaults.js";
2
2
  import { object as a, number as s, optional as e, string as t, picklist as m, pipe as i, minLength as b, custom as k, boolean as o, array as c, transform as y, unknown as r, record as g, fallback as R, literal as u, looseObject as C, variant as I, union as h, lazy as T } from "../../node_modules/valibot/dist/index.js";
3
3
  const p = {
4
4
  /** Promotional/marketing emails */
@@ -76,18 +76,18 @@ const p = {
76
76
  value: t()
77
77
  })
78
78
  )
79
- }), S = T(() => C({
79
+ }), f = T(() => C({
80
80
  text: e(t()),
81
81
  // eslint-disable-next-line camelcase -- backend field name
82
82
  tag_text: e(t()),
83
83
  value: e(t()),
84
- children: e(c(S)),
84
+ children: e(c(f)),
85
85
  // eslint-disable-next-line camelcase -- backend field name
86
- select_items: e(c(S))
87
- })), N = g(
86
+ select_items: e(c(f))
87
+ })), P = g(
88
88
  t(),
89
- R(c(S), [])
90
- ), P = C({
89
+ R(c(f), [])
90
+ ), N = C({
91
91
  /** Block ID (matches the dictionary key and the legacy HTML element id) */
92
92
  id: e(s()),
93
93
  /** Decimal places for price display (legacy data may use string or number) */
@@ -140,7 +140,7 @@ const p = {
140
140
  * strategy, currency, locale, and layout data.
141
141
  */
142
142
  recommendationConfigs: e(
143
- g(t(), P),
143
+ g(t(), N),
144
144
  {}
145
145
  )
146
146
  }), x = a({
@@ -159,7 +159,7 @@ const p = {
159
159
  * (first) partner's leaf attributes into the label→token map that repairs
160
160
  * label-form placeholders (`{{ Phone Number }}`) in dropped saved modules.
161
161
  */
162
- dynamicContentList: e(N, {}),
162
+ dynamicContentList: e(P, {}),
163
163
  /** Valid custom field attribute names from the partner's categorized fields */
164
164
  customFieldAttributes: e(c(t()), []),
165
165
  /** Selected unsubscribe page IDs */
@@ -210,9 +210,9 @@ const p = {
210
210
  /** Email header settings */
211
211
  emailHeader: e(D, { senderName: "", subject: "" }),
212
212
  /** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
213
- savedModulesFolderName: e(t(), f.SAVED_MODULES),
213
+ savedModulesFolderName: e(t(), S.SAVED_MODULES),
214
214
  /** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
215
- defaultModulesFolderName: e(t(), f.DEFAULT_MODULES)
215
+ defaultModulesFolderName: e(t(), S.DEFAULT_MODULES)
216
216
  }), F = a({
217
217
  /** Whether to show the header bar */
218
218
  showHeader: e(o(), !0),
@@ -243,7 +243,9 @@ const p = {
243
243
  linkTrackingIds: e(o(), !1),
244
244
  /** Allow persisting a template that still has validation errors (drawer "Save and Continue" soft-save). Host sets false for transactional + unsubscribe. */
245
245
  allowSaveWithErrors: e(o(), !0),
246
- reusableRecommendationStrategy: e(o(), !1)
246
+ reusableRecommendationStrategy: e(o(), !1),
247
+ /** Items block: Recommendation-style price formatting (root currency-* attrs, raw price tags). Released dark. */
248
+ itemsPriceFormatting: e(o(), !1)
247
249
  }), w = m([
248
250
  "amp-accordion",
249
251
  "amp-carousel",
@@ -366,8 +368,8 @@ export {
366
368
  B as CustomBlockTypeSchema,
367
369
  G as CustomRuleSchema,
368
370
  w as DefaultBlockTypeSchema,
369
- N as DynamicContentListSchema,
370
- S as DynamicContentNodeSchema,
371
+ P as DynamicContentListSchema,
372
+ f as DynamicContentNodeSchema,
371
373
  M as DynamicContentSchema,
372
374
  O as EditorSchema,
373
375
  D as EmailHeaderSchema,
@@ -375,7 +377,7 @@ export {
375
377
  U as FeaturesSchema,
376
378
  K as GuidoConfigSchema,
377
379
  A as IdentitySchema,
378
- P as LegacyRecommendationConfigSchema,
380
+ N as LegacyRecommendationConfigSchema,
379
381
  p as MessageType,
380
382
  E as PartnerSchema,
381
383
  l as ProductType,
@@ -12,7 +12,7 @@ var t = function() {
12
12
  s,
13
13
  !1,
14
14
  null,
15
- "f2154cb6"
15
+ "49dc1b30"
16
16
  );
17
17
  const v = n.exports;
18
18
  export {
@@ -1,37 +1,37 @@
1
- import { defineComponent as de, defineAsyncComponent as l, ref as W, computed as f, watch as G, onMounted as me, onUnmounted as le } from "vue";
2
- import { useCortexBlueprintBridge as ue } from "../composables/useCortexBlueprintBridge.js";
3
- import { useEditorLock as pe } from "../composables/useEditorLock.js";
4
- import { startEditorOpenMetrics as fe } from "../composables/useEditorOpenMetrics.js";
1
+ import { defineComponent as me, defineAsyncComponent as l, ref as W, computed as f, watch as G, onMounted as le, onUnmounted as ue } from "vue";
2
+ import { useCortexBlueprintBridge as pe } from "../composables/useCortexBlueprintBridge.js";
3
+ import { useEditorLock as fe } from "../composables/useEditorLock.js";
4
+ import { startEditorOpenMetrics as ge } from "../composables/useEditorOpenMetrics.js";
5
5
  import { provideGuidoActions as ye } from "../composables/useGuidoActions.js";
6
- import { useGuidoStateBridge as ge } from "../composables/useGuidoStateBridge.js";
7
- import { usePartner as ve } from "../composables/usePartner.js";
8
- import { useSaveValidationRollout as Se } from "../composables/useSaveValidationRollout.js";
9
- import { useStripo as be } from "../composables/useStripo.js";
10
- import { useTimerClone as he } from "../composables/useTimerClone.js";
11
- import { migrate as Ee } from "../config/migrator/index.js";
6
+ import { useGuidoStateBridge as ve } from "../composables/useGuidoStateBridge.js";
7
+ import { usePartner as Se } from "../composables/usePartner.js";
8
+ import { useSaveValidationRollout as be } from "../composables/useSaveValidationRollout.js";
9
+ import { useStripo as he } from "../composables/useStripo.js";
10
+ import { useTimerClone as Ee } from "../composables/useTimerClone.js";
11
+ import { migrate as we } from "../config/migrator/index.js";
12
12
  import { ModuleFolderDefaults as H } from "../enums/defaults.js";
13
- import { RIBBON_SELECTOR as we } from "../enums/onboarding.js";
13
+ import { RIBBON_SELECTOR as Fe } from "../enums/onboarding.js";
14
14
  import { useRecommendationExtensionStore as V, disposeStrategyPageReturnListeners as ke } from "../extensions/Blocks/Recommendation/store/recommendation.js";
15
15
  import { disposeUnsubscribeListeners as Ce } from "../extensions/Blocks/Unsubscribe/block.js";
16
16
  import De from "./organisms/AutoSaveController.vue.js";
17
17
  import Ie from "./organisms/base/AuthErrorModal.vue.js";
18
- import Fe from "./organisms/base/Toaster.vue.js";
19
- import Me from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
20
- import Re from "./organisms/header/HeaderWrapper.vue.js";
21
- import Te from "./organisms/LoadingWrapper.vue.js";
22
- import Le from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
23
- import Ue from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
24
- import Ne from "./organisms/validation/ValidationErrorDrawer.vue.js";
25
- import { useStripoApi as _e } from "../services/stripoApi.js";
18
+ import Me from "./organisms/base/Toaster.vue.js";
19
+ import Re from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
20
+ import Te from "./organisms/header/HeaderWrapper.vue.js";
21
+ import Le from "./organisms/LoadingWrapper.vue.js";
22
+ import Ue from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
23
+ import Ne from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
24
+ import _e from "./organisms/validation/ValidationErrorDrawer.vue.js";
25
+ import { useStripoApi as Pe } from "../services/stripoApi.js";
26
26
  import { useConfigStore as Ae } from "../stores/config.js";
27
27
  import { useDynamicContentStore as Be } from "../stores/dynamic-content.js";
28
28
  import { useEditorStore as w } from "../stores/editor.js";
29
29
  import { usePreviewStore as Oe } from "../stores/preview.js";
30
- import { useSaveValidationStore as Pe } from "../stores/save-validation.js";
31
- import { useTemplateStore as xe } from "../stores/template.js";
32
- import { useUnsubscribeStore as We } from "../stores/unsubscribe.js";
30
+ import { useSaveValidationStore as xe } from "../stores/save-validation.js";
31
+ import { useTemplateStore as We } from "../stores/template.js";
32
+ import { useUnsubscribeStore as Ge } from "../stores/unsubscribe.js";
33
33
  import { readTrackFloor as $ } from "../utils/linkTrackingIds.js";
34
- const ht = /* @__PURE__ */ de({
34
+ const Et = /* @__PURE__ */ me({
35
35
  __name: "Guido",
36
36
  props: {
37
37
  config: null,
@@ -39,7 +39,7 @@ const ht = /* @__PURE__ */ de({
39
39
  },
40
40
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
41
41
  setup(z, { expose: q, emit: a }) {
42
- const s = z, n = fe(), K = l(
42
+ const s = z, n = ge(), K = l(
43
43
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
44
44
  ), j = l(
45
45
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
@@ -49,15 +49,15 @@ const ht = /* @__PURE__ */ de({
49
49
  () => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
50
50
  ), X = l(
51
51
  () => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
52
- ), k = W(), y = W(), g = Be(), C = We(), o = Ae();
52
+ ), F = W(), g = W(), y = Be(), k = Ge(), o = Ae();
53
53
  s.ready && o.init(s.config);
54
- const d = w(), Y = Oe(), u = f(() => d.hasChanges), { isTestPartner: Z } = ve(), { isEnabled: ee, loadRollout: D } = Se(), I = () => {
54
+ const d = w(), Y = Oe(), u = f(() => d.hasChanges), { isTestPartner: Z } = Se(), { isEnabled: ee, loadRollout: C } = be(), D = () => {
55
55
  var t;
56
- return (t = k.value) == null ? void 0 : t.handleSave(!0);
57
- }, F = (t) => {
56
+ return (t = F.value) == null ? void 0 : t.handleSave(!0);
57
+ }, I = (t) => {
58
58
  d.loadingStatus = t;
59
59
  };
60
- ue(), ge();
60
+ pe(), ve();
61
61
  const v = () => {
62
62
  var t, e;
63
63
  return {
@@ -68,9 +68,9 @@ const ht = /* @__PURE__ */ de({
68
68
  savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || H.SAVED_MODULES,
69
69
  defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || H.DEFAULT_MODULES
70
70
  };
71
- }, { initPlugin: M, preloadRuntime: R } = be(n), { runExclusive: T, beginMount: L, isCurrentMount: S } = pe();
71
+ }, { initPlugin: M, preloadRuntime: R } = he(n), { runExclusive: T, beginMount: L, isCurrentMount: S } = fe();
72
72
  let p = 0;
73
- const { getDefaultTemplate: U } = _e(), { cloneTimersOnSave: N, hasTimerBlocks: _ } = he(), te = f(() => {
73
+ const { getDefaultTemplate: U } = Pe(), { cloneTimersOnSave: N, hasTimerBlocks: _ } = Ee(), te = f(() => {
74
74
  var t;
75
75
  return !((t = o.ui) != null && t.showHeader);
76
76
  }), oe = f(() => o.isFeatureEnabled("reusableRecommendationStrategy")), re = f(
@@ -91,9 +91,9 @@ const ht = /* @__PURE__ */ de({
91
91
  console.debug("guido:test-email:click"), a("test-email:click");
92
92
  }
93
93
  });
94
- const A = (t) => {
95
- console.debug("dynamic-content:close", t), g.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
96
- }, B = () => {
94
+ const P = (t) => {
95
+ console.debug("dynamic-content:close", t), y.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
96
+ }, A = () => {
97
97
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
98
98
  };
99
99
  G(() => u.value, () => {
@@ -106,8 +106,8 @@ const ht = /* @__PURE__ */ de({
106
106
  let c = null;
107
107
  const h = () => {
108
108
  var e;
109
- const t = document.querySelector(we);
110
- (e = y.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
109
+ const t = document.querySelector(Fe);
110
+ (e = g.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
111
111
  }, E = async () => {
112
112
  var t;
113
113
  n.mark("host_ready");
@@ -118,38 +118,40 @@ const ht = /* @__PURE__ */ de({
118
118
  templateId: o.templateId,
119
119
  variationId: o.variationId
120
120
  });
121
- const e = o.template, i = (e == null ? void 0 : e.html) || "", m = (e == null ? void 0 : e.css) || "", O = (e == null ? void 0 : e.preselectedDynamicContent) || [];
122
- C.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
123
- const ne = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, P = o.isFeatureEnabled("linkTrackingIds"), ae = {
121
+ const e = o.template, i = (e == null ? void 0 : e.html) || "", m = (e == null ? void 0 : e.css) || "", B = (e == null ? void 0 : e.preselectedDynamicContent) || [];
122
+ k.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
123
+ const ne = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, O = o.isFeatureEnabled("linkTrackingIds"), ae = {
124
124
  partnerName: o.partnerName,
125
125
  campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
126
126
  rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
127
- }, x = (ce) => n.timed(
127
+ }, ie = {
128
+ itemsPriceFormatting: o.isFeatureEnabled("itemsPriceFormatting")
129
+ }, x = (de) => n.timed(
128
130
  "migration",
129
- () => Ee(ce, ne, ae)
131
+ () => we(de, ne, ae, ie)
130
132
  );
131
133
  let r = {
132
134
  html: i && await x(i),
133
135
  css: m
134
136
  };
135
137
  r.html || (r = await n.timed("default_template", () => U()), r.html = await x(r.html));
136
- const ie = P ? $(r.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
137
- _(r.html) && (r.html = await n.timed("timer_clone", () => N(r.html))), P && (d.trackIdSessionFloor = Math.max(ie, $(r.html)));
138
- const se = {
139
- preselectedDynamicContentList: O,
138
+ const se = O ? $(r.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
139
+ _(r.html) && (r.html = await n.timed("timer_clone", () => N(r.html))), O && (d.trackIdSessionFloor = Math.max(se, $(r.html)));
140
+ const ce = {
141
+ preselectedDynamicContentList: B,
140
142
  onReady: () => {
141
143
  console.debug("guido:ready"), a("ready");
142
144
  }
143
145
  };
144
- p = L(), await M(r, v(), se), g.selectedDynamicContentList = O;
146
+ p = L(), await M(r, v(), ce), y.selectedDynamicContentList = B;
145
147
  } catch (e) {
146
148
  console.error("Failed to initialize Stripo editor:", e), n.markFailed();
147
149
  }
148
150
  };
149
- return me(async () => {
151
+ return le(async () => {
150
152
  var e;
151
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), V().$reset(), w().$reset(), xe().$reset(), Pe().$reset(), D(), h();
152
- const t = (e = y.value) == null ? void 0 : e.parentElement;
153
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), V().$reset(), w().$reset(), We().$reset(), xe().$reset(), C(), h();
154
+ const t = (e = g.value) == null ? void 0 : e.parentElement;
153
155
  if (t && (c = new ResizeObserver(h), c.observe(t)), R(), s.ready)
154
156
  await E();
155
157
  else {
@@ -158,7 +160,7 @@ const ht = /* @__PURE__ */ de({
158
160
  });
159
161
  }
160
162
  document.addEventListener("dynamic-content:open", b);
161
- }), le(() => {
163
+ }), ue(() => {
162
164
  if (Ce(), ke(), n.dispose(), c == null || c.disconnect(), document.removeEventListener("dynamic-content:open", b), S(p))
163
165
  try {
164
166
  w().isStripoInitialized = !1;
@@ -175,15 +177,15 @@ const ht = /* @__PURE__ */ de({
175
177
  }), o.reset();
176
178
  }), q({
177
179
  dynamicContent: {
178
- insert: A,
179
- close: B
180
+ insert: P,
181
+ close: A
180
182
  },
181
183
  hasChanges: u,
182
- saveSilent: I,
183
- setLoading: F
184
- }), { __sfc: !0, openMetrics: n, PreviewContainer: K, OnboardingWrapper: j, AssignStrategyDrawer: J, RemoveStrategyModal: Q, LegacyStrategyUpdatedModal: X, headerWrapperRef: k, wrapperRef: y, dynamicContentStore: g, unsubscribeStore: C, props: s, configStore: o, editorStore: d, previewStore: Y, hasChanges: u, isTestPartner: Z, isSaveValidationEnabled: ee, loadRollout: D, saveSilent: I, setLoading: F, emit: a, buildMetadata: v, initPlugin: M, preloadRuntime: R, runExclusive: T, beginMount: L, isCurrentMount: S, mountGeneration: p, getDefaultTemplate: U, cloneTimersOnSave: N, hasTimerBlocks: _, noHeader: te, isRrsEnabled: oe, hasAssignedStrategy: re, insertDynamicContent: A, closeDynamicContent: B, handleDynamicContentOpen: b, ribbonObserver: c, updateRibbonOffset: h, startEditor: E, AutoSaveController: De, AuthErrorModal: Ie, Toaster: Fe, FilterSelectionDrawer: Me, HeaderWrapper: Re, LoadingWrapper: Te, SaveAsTemplateDrawer: Le, UnsubscribeWrapper: Ue, ValidationErrorDrawer: Ne };
184
+ saveSilent: D,
185
+ setLoading: I
186
+ }), { __sfc: !0, openMetrics: n, PreviewContainer: K, OnboardingWrapper: j, AssignStrategyDrawer: J, RemoveStrategyModal: Q, LegacyStrategyUpdatedModal: X, headerWrapperRef: F, wrapperRef: g, dynamicContentStore: y, unsubscribeStore: k, props: s, configStore: o, editorStore: d, previewStore: Y, hasChanges: u, isTestPartner: Z, isSaveValidationEnabled: ee, loadRollout: C, saveSilent: D, setLoading: I, emit: a, buildMetadata: v, initPlugin: M, preloadRuntime: R, runExclusive: T, beginMount: L, isCurrentMount: S, mountGeneration: p, getDefaultTemplate: U, cloneTimersOnSave: N, hasTimerBlocks: _, noHeader: te, isRrsEnabled: oe, hasAssignedStrategy: re, insertDynamicContent: P, closeDynamicContent: A, handleDynamicContentOpen: b, ribbonObserver: c, updateRibbonOffset: h, startEditor: E, AutoSaveController: De, AuthErrorModal: Ie, Toaster: Me, FilterSelectionDrawer: Re, HeaderWrapper: Te, LoadingWrapper: Le, SaveAsTemplateDrawer: Ue, UnsubscribeWrapper: Ne, ValidationErrorDrawer: _e };
185
187
  }
186
188
  });
187
189
  export {
188
- ht as default
190
+ Et as default
189
191
  };
@@ -1,24 +1,26 @@
1
- import { useConfig as C } from "./useConfig.js";
2
- import { useToaster as T } from "./useToaster.js";
3
- import { useTranslations as g } from "./useTranslations.js";
1
+ import { useConfig as T } from "./useConfig.js";
2
+ import { useToaster as g } from "./useToaster.js";
3
+ import { useTranslations as C } from "./useTranslations.js";
4
4
  import { ToasterTypeOptions as D } from "../enums/toaster.js";
5
5
  import { buildDynamicContentLookup as f, convertModuleDynamicContent as h } from "../utils/dynamicContentConverter.js";
6
6
  import { flattenDynamicContentList as O } from "../utils/genericUtil.js";
7
7
  import { repairItemsCurrencyAttributes as M } from "../utils/itemsCurrencyRepair.js";
8
- const N = "dynamic-content.unresolved-attributes-on-drop", R = () => {
9
- const { template: p, isFeatureEnabled: m } = C(), { showToaster: a } = T(), y = g();
8
+ const N = "dynamic-content.unresolved-attributes-on-drop", d = () => {
9
+ const { template: p, isFeatureEnabled: s } = T(), { showToaster: a } = g(), y = C();
10
10
  return { handleModuleAdd: (e, o) => {
11
- var s, l, u;
11
+ var c, l, i;
12
12
  try {
13
13
  if ((e == null ? void 0 : e.action) !== "ADD" && (e == null ? void 0 : e.action) !== "COPY")
14
14
  return;
15
- const t = (s = o == null ? void 0 : o.getTargetNode) == null ? void 0 : s.call(o), r = (l = t == null ? void 0 : t.getOuterHTML) == null ? void 0 : l.call(t);
15
+ const t = (c = o == null ? void 0 : o.getTargetNode) == null ? void 0 : c.call(o), r = (l = t == null ? void 0 : t.getOuterHTML) == null ? void 0 : l.call(t);
16
16
  if (!t || typeof r != "string")
17
17
  return;
18
- let n = M(r);
19
- const c = f(O((u = p.value) == null ? void 0 : u.dynamicContentList));
20
- let i = [];
21
- c.size > 0 && ({ html: n, unresolved: i } = h(n, c, m("liquidSyntax"))), n !== r && o.modifyHtml(t).replaceWith(n), i.length > 0 && a({
18
+ let n = M(r, {
19
+ convertToPriceFormat: s("itemsPriceFormatting")
20
+ });
21
+ const u = f(O((i = p.value) == null ? void 0 : i.dynamicContentList));
22
+ let m = [];
23
+ u.size > 0 && ({ html: n, unresolved: m } = h(n, u, s("liquidSyntax"))), n !== r && o.modifyHtml(t).replaceWith(n), m.length > 0 && a({
22
24
  type: D.Warning,
23
25
  message: y(N)
24
26
  });
@@ -29,5 +31,5 @@ const N = "dynamic-content.unresolved-attributes-on-drop", R = () => {
29
31
  };
30
32
  export {
31
33
  N as UNRESOLVED_DYNAMIC_CONTENT_ON_DROP_KEY,
32
- R as useModuleRepair
34
+ d as useModuleRepair
33
35
  };
@@ -1,18 +1,19 @@
1
- import { migrateCheckbox as i } from "./checkboxMigrator.js";
2
- import { migrateCouponBlock as e } from "./couponBlockMigrator.js";
3
- import { migrateFullStoryScripts as a } from "./fullStoryScriptMigrator.js";
4
- import { migrateItemsBlock as n } from "./itemsBlockMigrator.js";
5
- import { migrateProductNameLink as c } from "./productNameLinkMigrator.js";
6
- import { migrateRadioButton as g } from "./radioButtonMigrator.js";
7
- import { migrateRecommendation as p } from "./recommendationMigrator.js";
8
- import { migrateRecommendationPartnerScope as f } from "./recommendationPartnerMigrator.js";
9
- import { migrateRecommendationTitle as l } from "./recommendationTitleMigrator.js";
10
- import { migrateSocialIcons as s } from "./socialIconMigrator.js";
11
- import { migrateUnsubscribe as d } from "./unsubscribeMigrator.js";
12
- const h = async (o, t = {}, r) => {
13
- let m = o;
14
- return m = i(m), m = g(m), m = await d(m), m = e(m), m = p(m, t), r && (m = f(m, r)), m = l(m), m = n(m), m = c(m), m = s(m), m = a(m), m;
1
+ import { migrateCheckbox as e } from "./checkboxMigrator.js";
2
+ import { migrateCouponBlock as a } from "./couponBlockMigrator.js";
3
+ import { migrateFullStoryScripts as c } from "./fullStoryScriptMigrator.js";
4
+ import { migrateItemsBlock as g } from "./itemsBlockMigrator.js";
5
+ import { migrateItemsPriceFormat as n } from "./itemsPriceFormatMigrator.js";
6
+ import { migrateProductNameLink as p } from "./productNameLinkMigrator.js";
7
+ import { migrateRadioButton as f } from "./radioButtonMigrator.js";
8
+ import { migrateRecommendation as l } from "./recommendationMigrator.js";
9
+ import { migrateRecommendationPartnerScope as d } from "./recommendationPartnerMigrator.js";
10
+ import { migrateRecommendationTitle as s } from "./recommendationTitleMigrator.js";
11
+ import { migrateSocialIcons as k } from "./socialIconMigrator.js";
12
+ import { migrateUnsubscribe as P } from "./unsubscribeMigrator.js";
13
+ const H = async (t, i = {}, r, o) => {
14
+ let m = t;
15
+ return m = e(m), m = f(m), m = await P(m), m = a(m), m = l(m, i), r && (m = d(m, r)), m = s(m), m = g(m), o != null && o.itemsPriceFormatting && (m = n(m)), m = p(m), m = k(m), m = c(m), m;
15
16
  };
16
17
  export {
17
- h as migrate
18
+ H as migrate
18
19
  };
@@ -0,0 +1,20 @@
1
+ import { ITEMS_PRICE_FORMAT_ATTR as e } from "../../extensions/Blocks/Items/constants/currency.js";
2
+ import { applyPriceFormatOpsToElement as o, planPriceFormatOps as n, snapshotPriceFormatFromElement as c } from "../../extensions/Blocks/Items/utils/priceFormatOps.js";
3
+ import { protectLiquid as i, restoreLiquid as s } from "../../utils/liquidProtection.js";
4
+ const m = `td.ins-product-td.items-block-v2:not([${e.DECIMAL_COUNT}])`, a = (r) => o(
5
+ r,
6
+ n(c(r), { convertLegacy: !0 })
7
+ );
8
+ function T(r) {
9
+ if (typeof r != "string" || !r.includes("ins-product-td"))
10
+ return r;
11
+ try {
12
+ const t = new DOMParser().parseFromString(i(r), "text/html");
13
+ return Array.from(t.querySelectorAll(m)).map(a).includes(!0) ? s(t.documentElement.outerHTML) : r;
14
+ } catch (t) {
15
+ return console.error("ItemsPriceFormatMigrator failed:", t), r;
16
+ }
17
+ }
18
+ export {
19
+ T as migrateItemsPriceFormat
20
+ };