@spiffcommerce/core 28.0.1-beta.29d7ea3f-e4d3-5c03-bd48-b02b5e782f5a → 28.0.1-beta.ac9a049c-ad73-555a-adbf-f7557a7cdbde
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.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +32 -34
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -6541,7 +6541,7 @@ const L = (r, t) => _(r, t).elements.find((n) => n.id === r), _ = (r, t) => {
|
|
|
6541
6541
|
if (!e)
|
|
6542
6542
|
throw new V();
|
|
6543
6543
|
return e;
|
|
6544
|
-
},
|
|
6544
|
+
}, Z = (r, t) => {
|
|
6545
6545
|
const e = [...t.elements.filter((n) => n.id !== r.id), r], a = va(e);
|
|
6546
6546
|
return {
|
|
6547
6547
|
layout: t.layout,
|
|
@@ -6634,7 +6634,7 @@ class Kc extends O {
|
|
|
6634
6634
|
...e,
|
|
6635
6635
|
x: this.x,
|
|
6636
6636
|
y: this.y
|
|
6637
|
-
}, n = _(e.id, Object.values(t.layouts)), i =
|
|
6637
|
+
}, n = _(e.id, Object.values(t.layouts)), i = Z(a, n);
|
|
6638
6638
|
return {
|
|
6639
6639
|
...t,
|
|
6640
6640
|
layouts: {
|
|
@@ -6656,7 +6656,7 @@ class _c extends O {
|
|
|
6656
6656
|
const a = {
|
|
6657
6657
|
...e,
|
|
6658
6658
|
rotation: this.angle
|
|
6659
|
-
}, n = _(e.id, Object.values(t.layouts)), i =
|
|
6659
|
+
}, n = _(e.id, Object.values(t.layouts)), i = Z(a, n);
|
|
6660
6660
|
return {
|
|
6661
6661
|
...t,
|
|
6662
6662
|
layouts: {
|
|
@@ -6687,7 +6687,7 @@ class Xc extends O {
|
|
|
6687
6687
|
const s = a, o = (!s.algorithm || s.algorithm === kt.Autosize ? s.text : s.input) ?? "";
|
|
6688
6688
|
a = ee(s, o, e);
|
|
6689
6689
|
}
|
|
6690
|
-
const n = _(e.id, Object.values(t.layouts)), i =
|
|
6690
|
+
const n = _(e.id, Object.values(t.layouts)), i = Z(a, n);
|
|
6691
6691
|
return {
|
|
6692
6692
|
...t,
|
|
6693
6693
|
layouts: {
|
|
@@ -6819,7 +6819,7 @@ class ds extends O {
|
|
|
6819
6819
|
fill: this.color,
|
|
6820
6820
|
fillSpotColorDefinition: this.textFillSpotColor,
|
|
6821
6821
|
textFillImage: void 0
|
|
6822
|
-
}, n = _(e.id, Object.values(t.layouts)), i =
|
|
6822
|
+
}, n = _(e.id, Object.values(t.layouts)), i = Z(a, n);
|
|
6823
6823
|
return {
|
|
6824
6824
|
...t,
|
|
6825
6825
|
layouts: {
|
|
@@ -6841,7 +6841,7 @@ class We extends O {
|
|
|
6841
6841
|
const a = {
|
|
6842
6842
|
...e,
|
|
6843
6843
|
textFillImage: this.imageFill
|
|
6844
|
-
}, n = _(e.id, Object.values(t.layouts)), i =
|
|
6844
|
+
}, n = _(e.id, Object.values(t.layouts)), i = Z(a, n);
|
|
6845
6845
|
return {
|
|
6846
6846
|
...t,
|
|
6847
6847
|
layouts: {
|
|
@@ -6863,7 +6863,7 @@ class As extends O {
|
|
|
6863
6863
|
const a = {
|
|
6864
6864
|
...e,
|
|
6865
6865
|
fontSize: this.size
|
|
6866
|
-
}, n = _(e.id, Object.values(t.layouts)), i = (!e.algorithm || e.algorithm === kt.Autosize ? e.text : e.input) ?? "", s =
|
|
6866
|
+
}, n = _(e.id, Object.values(t.layouts)), i = (!e.algorithm || e.algorithm === kt.Autosize ? e.text : e.input) ?? "", s = Z(ee(a, i), n);
|
|
6867
6867
|
return {
|
|
6868
6868
|
...t,
|
|
6869
6869
|
layouts: {
|
|
@@ -6885,7 +6885,7 @@ class Wa extends O {
|
|
|
6885
6885
|
const a = {
|
|
6886
6886
|
...e,
|
|
6887
6887
|
fontData: this.fontData
|
|
6888
|
-
}, n = _(e.id, Object.values(t.layouts)), i = (!e.algorithm || e.algorithm === kt.Autosize ? e.text : e.input) ?? "", s =
|
|
6888
|
+
}, n = _(e.id, Object.values(t.layouts)), i = (!e.algorithm || e.algorithm === kt.Autosize ? e.text : e.input) ?? "", s = Z(ee(a, i), n);
|
|
6889
6889
|
return {
|
|
6890
6890
|
...t,
|
|
6891
6891
|
layouts: {
|
|
@@ -6907,7 +6907,7 @@ class us extends O {
|
|
|
6907
6907
|
const a = {
|
|
6908
6908
|
...e,
|
|
6909
6909
|
align: this.align
|
|
6910
|
-
}, n = _(e.id, Object.values(t.layouts)), i =
|
|
6910
|
+
}, n = _(e.id, Object.values(t.layouts)), i = Z(a, n);
|
|
6911
6911
|
return {
|
|
6912
6912
|
...t,
|
|
6913
6913
|
layouts: {
|
|
@@ -6968,7 +6968,7 @@ class ms extends O {
|
|
|
6968
6968
|
invertThreshold: this.invertThreshold,
|
|
6969
6969
|
threshold: this.threshold,
|
|
6970
6970
|
thresholdSaturation: this.thresholdSaturation
|
|
6971
|
-
}, n = _(e.id, Object.values(t.layouts)), i =
|
|
6971
|
+
}, n = _(e.id, Object.values(t.layouts)), i = Z(a, n);
|
|
6972
6972
|
return {
|
|
6973
6973
|
...t,
|
|
6974
6974
|
layouts: {
|
|
@@ -6990,7 +6990,7 @@ class Zc extends O {
|
|
|
6990
6990
|
const a = {
|
|
6991
6991
|
...e,
|
|
6992
6992
|
src: this.src
|
|
6993
|
-
}, n = _(e.id, Object.values(t.layouts)), i =
|
|
6993
|
+
}, n = _(e.id, Object.values(t.layouts)), i = Z(a, n);
|
|
6994
6994
|
return {
|
|
6995
6995
|
...t,
|
|
6996
6996
|
layouts: {
|
|
@@ -7009,7 +7009,7 @@ class gs extends O {
|
|
|
7009
7009
|
const e = L(this.id, Object.values(t.layouts));
|
|
7010
7010
|
if (!e.id)
|
|
7011
7011
|
throw new V();
|
|
7012
|
-
const a = _(e.id, Object.values(t.layouts)), n =
|
|
7012
|
+
const a = _(e.id, Object.values(t.layouts)), n = Z(ee(e, this.text, e), a);
|
|
7013
7013
|
return {
|
|
7014
7014
|
...t,
|
|
7015
7015
|
layouts: {
|
|
@@ -7032,7 +7032,7 @@ class je extends O {
|
|
|
7032
7032
|
...e,
|
|
7033
7033
|
strokeColor: this.strokeColor,
|
|
7034
7034
|
strokeThickness: this.strokeThickness
|
|
7035
|
-
}, n = _(e.id, Object.values(t.layouts)), i =
|
|
7035
|
+
}, n = _(e.id, Object.values(t.layouts)), i = Z(a, n);
|
|
7036
7036
|
return {
|
|
7037
7037
|
...t,
|
|
7038
7038
|
layouts: {
|
|
@@ -7064,7 +7064,7 @@ class oa extends O {
|
|
|
7064
7064
|
const i = {
|
|
7065
7065
|
...e,
|
|
7066
7066
|
colors: a
|
|
7067
|
-
}, s = _(e.id, Object.values(t.layouts)), o =
|
|
7067
|
+
}, s = _(e.id, Object.values(t.layouts)), o = Z(i, s);
|
|
7068
7068
|
return {
|
|
7069
7069
|
...t,
|
|
7070
7070
|
layouts: {
|
|
@@ -7087,7 +7087,7 @@ class ps extends O {
|
|
|
7087
7087
|
...e,
|
|
7088
7088
|
svg: this.svgBody,
|
|
7089
7089
|
cachedObjectURL: this.objectURL
|
|
7090
|
-
}, n = _(e.id, Object.values(t.layouts)), i =
|
|
7090
|
+
}, n = _(e.id, Object.values(t.layouts)), i = Z(a, n);
|
|
7091
7091
|
return {
|
|
7092
7092
|
...t,
|
|
7093
7093
|
layouts: {
|
|
@@ -11516,7 +11516,6 @@ class Bo extends it {
|
|
|
11516
11516
|
*/
|
|
11517
11517
|
setText(t) {
|
|
11518
11518
|
var d;
|
|
11519
|
-
console.log("LOG: attempting to set text in handle"), console.trace();
|
|
11520
11519
|
const e = {
|
|
11521
11520
|
input: t,
|
|
11522
11521
|
helperData: {}
|
|
@@ -11991,22 +11990,22 @@ const ko = async (r, t) => {
|
|
|
11991
11990
|
for (const T of Object.keys(i)) {
|
|
11992
11991
|
const nt = i[T], R = t.steps.find((tt) => tt.stepName === T);
|
|
11993
11992
|
for (let tt = 0; tt < nt.selections.length; ++tt) {
|
|
11994
|
-
const
|
|
11993
|
+
const X = nt.selections[tt];
|
|
11995
11994
|
if (R && (!D || R.option && (R.option.variants || []).length > 1 && !R.data.hideSelectionInCart && !R.data.hideSelectionsInCart)) {
|
|
11996
11995
|
const Nt = R.stepTitle;
|
|
11997
11996
|
F[Nt] ? F[Nt].push({
|
|
11998
|
-
id:
|
|
11999
|
-
name:
|
|
12000
|
-
priceModifier:
|
|
11997
|
+
id: X.id || "",
|
|
11998
|
+
name: X.name,
|
|
11999
|
+
priceModifier: X.priceModifier
|
|
12001
12000
|
}) : F[Nt] = [
|
|
12002
12001
|
{
|
|
12003
|
-
id:
|
|
12004
|
-
name:
|
|
12005
|
-
priceModifier:
|
|
12002
|
+
id: X.id || "",
|
|
12003
|
+
name: X.name,
|
|
12004
|
+
priceModifier: X.priceModifier
|
|
12006
12005
|
}
|
|
12007
12006
|
];
|
|
12008
12007
|
}
|
|
12009
|
-
k +=
|
|
12008
|
+
k += X.priceModifier;
|
|
12010
12009
|
}
|
|
12011
12010
|
}
|
|
12012
12011
|
return [F, k];
|
|
@@ -13788,14 +13787,13 @@ class Zn extends Ia {
|
|
|
13788
13787
|
*/
|
|
13789
13788
|
async initDefaultVariant() {
|
|
13790
13789
|
var e, a;
|
|
13791
|
-
console.log(`LOG: attempting to init default variant for property ${this.property.name}`);
|
|
13792
13790
|
const t = (a = (e = this.optionResource) == null ? void 0 : e.variants) == null ? void 0 : a.find(
|
|
13793
13791
|
(n) => {
|
|
13794
13792
|
var i, s;
|
|
13795
13793
|
return n.id === ((s = (i = this.optionResource) == null ? void 0 : i.defaultVariant) == null ? void 0 : s.id);
|
|
13796
13794
|
}
|
|
13797
13795
|
);
|
|
13798
|
-
t &&
|
|
13796
|
+
t && await this.selectVariant(new st(t));
|
|
13799
13797
|
}
|
|
13800
13798
|
/**
|
|
13801
13799
|
* Gets the currently selected variant, or undefined if no variant is selected.
|
|
@@ -13837,7 +13835,7 @@ class Zn extends Ia {
|
|
|
13837
13835
|
* @param variant The variant to select.
|
|
13838
13836
|
*/
|
|
13839
13837
|
async selectVariant(t, e) {
|
|
13840
|
-
|
|
13838
|
+
await Promise.all([
|
|
13841
13839
|
this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name, t.getId(), void 0, e),
|
|
13842
13840
|
this.applyVariantSelection(t)
|
|
13843
13841
|
]);
|
|
@@ -13864,7 +13862,7 @@ class Ja extends Zn {
|
|
|
13864
13862
|
* @param variant The variant to select.
|
|
13865
13863
|
*/
|
|
13866
13864
|
async selectVariant(t, e) {
|
|
13867
|
-
|
|
13865
|
+
await Promise.all([
|
|
13868
13866
|
this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name, t.getId(), void 0, e),
|
|
13869
13867
|
this.applyColorVariant(t, void 0, e)
|
|
13870
13868
|
]);
|
|
@@ -15994,7 +15992,7 @@ class Ad {
|
|
|
15994
15992
|
} catch (a) {
|
|
15995
15993
|
throw console.error(a), new ut("Critical - Unable to synchronize workflow state with server.");
|
|
15996
15994
|
}
|
|
15997
|
-
}, this.options = t, this.options.applicationKey && $r(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 28.0.1-beta.
|
|
15995
|
+
}, this.options = t, this.options.applicationKey && $r(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 28.0.1-beta.29d7ea3f-e4d3-5c03-bd48-b02b5e782f5a"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
|
15998
15996
|
}
|
|
15999
15997
|
configure(t) {
|
|
16000
15998
|
mt.setHubUrl(t.hubUrl), mt.setServerUrl(t.serverUrl), mt.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 && Lr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Lt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
|
|
@@ -16556,18 +16554,18 @@ class Ad {
|
|
|
16556
16554
|
singleVariantsRenderable: (tt = k == null ? void 0 : k.workflowConfiguration) == null ? void 0 : tt.singleVariantsRenderable,
|
|
16557
16555
|
stateMutationFunc: I ? async () => {
|
|
16558
16556
|
throw new G("State mutation is forbidden in read only mode!");
|
|
16559
|
-
} : async (
|
|
16560
|
-
...
|
|
16557
|
+
} : async (X) => (console.log(`LOG: updating transaction with options ${JSON.stringify(X, null, 2)}`), console.trace(), this.updateTransactionState({
|
|
16558
|
+
...X,
|
|
16561
16559
|
context: { transactionOwnerId: T, bundleOwnerId: e == null ? void 0 : e.bundleOwnerId }
|
|
16562
|
-
}),
|
|
16560
|
+
})),
|
|
16563
16561
|
graphQlClient: () => nt,
|
|
16564
16562
|
readOnly: I,
|
|
16565
16563
|
workflow: F,
|
|
16566
16564
|
isReloadedTransaction: k.type === "transaction"
|
|
16567
16565
|
};
|
|
16568
16566
|
if (!I && k.workflowState) {
|
|
16569
|
-
const
|
|
16570
|
-
R.layouts = Object.values(
|
|
16567
|
+
const X = JSON.parse(k.workflowState);
|
|
16568
|
+
R.layouts = Object.values(X.layouts || {}).map((Nt) => Nt.layout), await cs(X), R.reloadedState = X;
|
|
16571
16569
|
} else
|
|
16572
16570
|
R.layouts = Rl(
|
|
16573
16571
|
R.transaction,
|