@spiffcommerce/core 31.2.3-beta.a0b3db5e-f507-543a-83fc-22e82e769276 → 31.2.4

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.
package/dist/index.mjs CHANGED
@@ -5760,7 +5760,6 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
5760
5760
  return e.querySelectorAll("text").forEach((d) => d.remove()), Bt().serializeToString(a);
5761
5761
  }, Be = (r, t, e, a) => Math.max(ns(r.join(`
5762
5762
  `), e, a), t), Ua = (r, t, e, a, n, i) => {
5763
- console.log("LOG: getLines");
5764
5763
  const s = (i || Rn) * n.getApproximateHeight(), o = t.split(`
5765
5764
  `);
5766
5765
  try {
@@ -5781,7 +5780,6 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
5781
5780
  };
5782
5781
  }
5783
5782
  }, ge = (r, t, e, a) => {
5784
- console.log("LOG: splitLineUntilFit");
5785
5783
  const n = mt(r, e, a);
5786
5784
  if (n <= t)
5787
5785
  return { lines: [r], width: n };
@@ -5813,11 +5811,9 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
5813
5811
  throw new Error(`No max width calculated for text: ${o}.`);
5814
5812
  return { lines: o, width: l };
5815
5813
  }, ts = (r, t, e, a, n, i) => {
5816
- console.log("LOG: calcFontSize");
5817
5814
  const s = (i ?? Rn) * t.getApproximateHeight(), o = 1 / e.unitsPerEm, l = Nn(r, o, t), c = r.length * s * o, d = a / l, A = n / c;
5818
5815
  return Math.min(A, d);
5819
5816
  }, es = (r, t, e, a) => {
5820
- console.log("LOG: refit");
5821
5817
  const n = Ct(t.fontData.assetUrl), i = n.getFont(), s = t.fontSize / i.unitsPerEm;
5822
5818
  if (!e)
5823
5819
  return Ua(t, r, t.fontSize, s, n, a);
@@ -5839,7 +5835,6 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
5839
5835
  fontSize: ts(o, n, i, t.width, t.height, a)
5840
5836
  } : Ua(t, r, t.fontSize, s, n, a);
5841
5837
  }, as = (r, t, e, a, n) => {
5842
- console.log("LOG: recalc");
5843
5838
  const s = Ct(t.assetUrl).getFont();
5844
5839
  let o = { ...r };
5845
5840
  const l = { ...r }, c = Nn(a, e / s.unitsPerEm, Ct(t.assetUrl));
@@ -5993,9 +5988,7 @@ const ss = (r) => {
5993
5988
  const n = Ct(r.fontData.assetUrl), i = n.getFont(), s = r.fontSize / i.unitsPerEm;
5994
5989
  return n.getApproximateHeight() * s;
5995
5990
  }, e = () => r.align === "left" ? -r.textboxWidth / 2 : r.align === "right" ? r.textboxWidth / 2 : 0, a = () => {
5996
- const n = t();
5997
- console.log(`LOG: text span. line height: ${n}`);
5998
- const i = r.textboxHeight / 2;
5991
+ const n = t(), i = r.textboxHeight / 2;
5999
5992
  if (r.verticalAlign === "top")
6000
5993
  return -i + r.fontSize * 3 / 4 + r.thisLineIdx * n;
6001
5994
  if (r.verticalAlign === "bottom") {
@@ -8651,11 +8644,9 @@ const Fs = new Ds(), Ye = (r, t, e, a, n) => {
8651
8644
  let i = t.map((d) => d.split(`
8652
8645
  `)).flat(), s = i.length, o = i.map((d) => mt(d, a, n));
8653
8646
  const l = n.getApproximateHeight() * a;
8654
- console.log(`LOG: lines that fit. calced line height: ${l}`);
8655
8647
  let c = !0;
8656
8648
  for (; c; ) {
8657
- const d = l + (s - 1) * e;
8658
- if (console.log(`LOG: textbox height for size ${e}: ${d}`), d > r.height)
8649
+ if (l + (s - 1) * e > r.height)
8659
8650
  return [null, null];
8660
8651
  const A = Math.max(...o);
8661
8652
  if (A <= r.width)
@@ -8675,23 +8666,22 @@ const Fs = new Ds(), Ye = (r, t, e, a, n) => {
8675
8666
  }
8676
8667
  return [null, null];
8677
8668
  }, fe = (r, t, e, a, n) => {
8678
- console.log(`LOG: determineCorrectFontSize, region height ${e.height}`);
8679
8669
  let i, s;
8680
8670
  const o = Ct(t.assetUrl), l = o.getFont();
8681
8671
  if (n.size) {
8682
8672
  const u = r / l.unitsPerEm;
8683
- return [i, s] = Ye(e, a, r, u, o), console.log(`LOG: fixed mode returning ${n.size, s}`), [n.size, i, s];
8673
+ return [i, s] = Ye(e, a, r, u, o), [n.size, i, s];
8684
8674
  }
8685
8675
  const c = 6;
8686
8676
  let d = c - Ge;
8687
8677
  if (a.length > 0) {
8688
8678
  let u = a, h = 0;
8689
8679
  for (; (!n.maxSize || d <= n.maxSize) && u; )
8690
- d += Ge, h = d / l.unitsPerEm, [u, s] = Ye(e, a, d, h, o), console.log(`LOG: intermediate result ${[u, s]}`);
8680
+ d += Ge, h = d / l.unitsPerEm, [u, s] = Ye(e, a, d, h, o);
8691
8681
  }
8692
8682
  d > c && (d -= Ge), n.minSize && d < n.minSize && (d = n.minSize);
8693
8683
  const A = d / l.unitsPerEm;
8694
- return [i, s] = Ye(e, a, d, A, o), console.log(`LOG: var mode returning ${[d, i, s]}`), [d, i, s];
8684
+ return [i, s] = Ye(e, a, d, A, o), [d, i, s];
8695
8685
  }, Je = 30;
8696
8686
  class De extends Error {
8697
8687
  constructor(t) {
@@ -15965,7 +15955,7 @@ class md {
15965
15955
  } catch (a) {
15966
15956
  throw console.error(a), new ht("Critical - Unable to synchronize workflow state with server.");
15967
15957
  }
15968
- }, this.options = t, this.options.applicationKey && Lr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 31.2.3-beta.026ad90d-92e9-500b-a212-bd6dfa71283c"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15958
+ }, this.options = t, this.options.applicationKey && Lr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 31.2.4"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15969
15959
  }
15970
15960
  configure(t) {
15971
15961
  gt.setHubUrl(t.hubUrl), gt.setServerUrl(t.serverUrl), gt.setServicesApiUrl(t.servicesApiUrl), this.marketplaceThemeInstallId = t.marketplaceThemeInstallId, this.marketplaceThemeInstallConfigurationId = t.marketplaceThemeInstallConfigurationId, this.userPoolClientId = t.userPoolClientId, this.userPoolRegion = t.userPoolRegion, this.spiffRegion = t.spiffRegion, t.bearerAuthenticationToken && zr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Lt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);