@spiffcommerce/core 31.2.2 → 31.2.3-beta.85869a99-dc4e-57d8-937e-352cd65b71a3
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/CHANGELOG.md +6 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -5760,6 +5760,7 @@ 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), La = (r, t, e, a, n, i) => {
|
5763
|
+
console.log("LOG: getLines");
|
5763
5764
|
const s = (i || ya) * n.getApproximateHeight(), o = t.split(`
|
5764
5765
|
`);
|
5765
5766
|
try {
|
@@ -5780,6 +5781,7 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
|
|
5780
5781
|
};
|
5781
5782
|
}
|
5782
5783
|
}, ge = (r, t, e, a) => {
|
5784
|
+
console.log("LOG: splitLineUntilFit");
|
5783
5785
|
const n = mt(r, e, a);
|
5784
5786
|
if (n <= t)
|
5785
5787
|
return { lines: [r], width: n };
|
@@ -5811,9 +5813,11 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
|
|
5811
5813
|
throw new Error(`No max width calculated for text: ${o}.`);
|
5812
5814
|
return { lines: o, width: l };
|
5813
5815
|
}, ts = (r, t, e, a, n, i) => {
|
5816
|
+
console.log("LOG: calcFontSize");
|
5814
5817
|
const s = (i ?? ya) * t.getApproximateHeight(), o = 1 / e.unitsPerEm, l = Qn(r, o, t), c = r.length * s * o, d = a / l, A = n / c;
|
5815
5818
|
return Math.min(A, d);
|
5816
5819
|
}, es = (r, t, e, a) => {
|
5820
|
+
console.log("LOG: refit");
|
5817
5821
|
const n = Et(t.fontData.assetUrl), i = n.getFont(), s = t.fontSize / i.unitsPerEm;
|
5818
5822
|
if (!e)
|
5819
5823
|
return La(t, r, t.fontSize, s, n, a);
|
@@ -5835,6 +5839,7 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
|
|
5835
5839
|
fontSize: ts(o, n, i, t.width, t.height, a)
|
5836
5840
|
} : La(t, r, t.fontSize, s, n, a);
|
5837
5841
|
}, as = (r, t, e, a, n) => {
|
5842
|
+
console.log("LOG: recalc");
|
5838
5843
|
const s = Et(t.assetUrl).getFont();
|
5839
5844
|
let o = { ...r };
|
5840
5845
|
const l = { ...r }, c = Qn(a, e / s.unitsPerEm, Et(t.assetUrl));
|
@@ -8633,14 +8638,15 @@ class Ds {
|
|
8633
8638
|
}
|
8634
8639
|
}
|
8635
8640
|
const Fs = new Ds(), Ye = (r, t, e, a, n) => {
|
8636
|
-
if (t.some((d) => d == null))
|
8641
|
+
if (console.log("LOG: lines that fit"), t.some((d) => d == null))
|
8637
8642
|
throw new Error(`Failed to autosize lines: ${t.join(", ")}`);
|
8638
8643
|
let i = t.map((d) => d.split(`
|
8639
8644
|
`)).flat(), s = i.length, o = i.map((d) => mt(d, a, n));
|
8640
8645
|
const l = n.getApproximateHeight() * a;
|
8641
8646
|
let c = !0;
|
8642
8647
|
for (; c; ) {
|
8643
|
-
|
8648
|
+
const d = l + (s - 1) * e;
|
8649
|
+
if (console.log(`LOG: textbox height for size ${e}: ${d}`), d > r.height)
|
8644
8650
|
return [null, null];
|
8645
8651
|
const A = Math.max(...o);
|
8646
8652
|
if (A <= r.width)
|
@@ -8660,22 +8666,23 @@ const Fs = new Ds(), Ye = (r, t, e, a, n) => {
|
|
8660
8666
|
}
|
8661
8667
|
return [null, null];
|
8662
8668
|
}, fe = (r, t, e, a, n) => {
|
8669
|
+
console.log(`LOG: determineCorrectFontSize, region height ${e.height}`);
|
8663
8670
|
let i, s;
|
8664
8671
|
const o = Et(t.assetUrl), l = o.getFont();
|
8665
8672
|
if (n.size) {
|
8666
8673
|
const u = r / l.unitsPerEm;
|
8667
|
-
return [i, s] = Ye(e, a, r, u, o), [n.size, i, s];
|
8674
|
+
return [i, s] = Ye(e, a, r, u, o), console.log(`LOG: fixed mode returning ${n.size, s}`), [n.size, i, s];
|
8668
8675
|
}
|
8669
8676
|
const c = 6;
|
8670
8677
|
let d = c - Ge;
|
8671
8678
|
if (a.length > 0) {
|
8672
8679
|
let u = a, h = 0;
|
8673
8680
|
for (; (!n.maxSize || d <= n.maxSize) && u; )
|
8674
|
-
d += Ge, h = d / l.unitsPerEm, [u, s] = Ye(e, a, d, h, o);
|
8681
|
+
d += Ge, h = d / l.unitsPerEm, [u, s] = Ye(e, a, d, h, o), console.log(`LOG: intermediate result ${[u, s]}`);
|
8675
8682
|
}
|
8676
8683
|
d > c && (d -= Ge), n.minSize && d < n.minSize && (d = n.minSize);
|
8677
8684
|
const A = d / l.unitsPerEm;
|
8678
|
-
return [i, s] = Ye(e, a, d, A, o), [d, i, s];
|
8685
|
+
return [i, s] = Ye(e, a, d, A, o), console.log(`LOG: var mode returning ${[d, i, s]}`), [d, i, s];
|
8679
8686
|
}, Je = 30;
|
8680
8687
|
class De extends Error {
|
8681
8688
|
constructor(t) {
|
@@ -15170,6 +15177,7 @@ class _e {
|
|
15170
15177
|
name: this.getName(),
|
15171
15178
|
dispatchDate: this.getDispatchDate() || "",
|
15172
15179
|
purchaseOrder: this.getPurchaseOrder() || "",
|
15180
|
+
collectionId: this.getProductCollection()?.getId() || "",
|
15173
15181
|
collectionName: this.getProductCollection()?.getName() || "",
|
15174
15182
|
items: [],
|
15175
15183
|
bundleOwnerId: this.ownerId
|
@@ -15202,6 +15210,7 @@ class _e {
|
|
15202
15210
|
name: this.getName(),
|
15203
15211
|
dispatchDate: this.getDispatchDate() || "",
|
15204
15212
|
purchaseOrder: this.getPurchaseOrder() || "",
|
15213
|
+
collectionId: this.getProductCollection()?.getId() || "",
|
15205
15214
|
collectionName: this.getProductCollection()?.getName() || "",
|
15206
15215
|
items: a,
|
15207
15216
|
bundleOwnerId: this.ownerId
|
@@ -15947,7 +15956,7 @@ class md {
|
|
15947
15956
|
} catch (a) {
|
15948
15957
|
throw console.error(a), new ht("Critical - Unable to synchronize workflow state with server.");
|
15949
15958
|
}
|
15950
|
-
}, this.options = t, this.options.applicationKey && Lr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 31.2.
|
15959
|
+
}, 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.5249dfb4-40fc-508c-8b98-cb6aa1aafe90"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
15951
15960
|
}
|
15952
15961
|
configure(t) {
|
15953
15962
|
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);
|