@spiffcommerce/core 28.0.1-beta.29d7ea3f-e4d3-5c03-bd48-b02b5e782f5a → 28.0.1-beta.cf9847f6-7f99-59a1-a7ce-5381b1ac1990
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 +38 -36
- 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,13 +13835,14 @@ 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
|
]);
|
|
13844
13842
|
}
|
|
13845
13843
|
async applyGlobalState(t) {
|
|
13846
13844
|
var n, i;
|
|
13845
|
+
console.log(`LOG: applying global state for option ${this.property.name}`);
|
|
13847
13846
|
const e = this.getStateValue();
|
|
13848
13847
|
if (!e)
|
|
13849
13848
|
return Promise.resolve();
|
|
@@ -13864,13 +13863,14 @@ class Ja extends Zn {
|
|
|
13864
13863
|
* @param variant The variant to select.
|
|
13865
13864
|
*/
|
|
13866
13865
|
async selectVariant(t, e) {
|
|
13867
|
-
|
|
13866
|
+
await Promise.all([
|
|
13868
13867
|
this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name, t.getId(), void 0, e),
|
|
13869
13868
|
this.applyColorVariant(t, void 0, e)
|
|
13870
13869
|
]);
|
|
13871
13870
|
}
|
|
13872
13871
|
async applyGlobalState(t) {
|
|
13873
13872
|
var i, s, o;
|
|
13873
|
+
console.log(`LOG: applying global state for color ${this.property.name}`);
|
|
13874
13874
|
const e = this.getStateValue();
|
|
13875
13875
|
if (!e)
|
|
13876
13876
|
return Promise.resolve();
|
|
@@ -13879,10 +13879,12 @@ class Ja extends Zn {
|
|
|
13879
13879
|
return Promise.resolve();
|
|
13880
13880
|
await this.applyColorVariant(new st(a), t);
|
|
13881
13881
|
const n = (o = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name)) == null ? void 0 : o.customColor;
|
|
13882
|
-
n && this.setCustomColor(n);
|
|
13882
|
+
console.log(`LOG: custom color ${n}`), n && this.setCustomColor(n);
|
|
13883
13883
|
}
|
|
13884
13884
|
async applyColorVariant(t, e, a) {
|
|
13885
|
-
const
|
|
13885
|
+
const n = this.getSharedSteps(e);
|
|
13886
|
+
console.log(`LOG: applying color variant for ${n.length} shared steps`);
|
|
13887
|
+
const i = n.map((s) => {
|
|
13886
13888
|
switch (s.getType()) {
|
|
13887
13889
|
case P.Shape:
|
|
13888
13890
|
return s.selectVariant(t);
|
|
@@ -15994,7 +15996,7 @@ class Ad {
|
|
|
15994
15996
|
} catch (a) {
|
|
15995
15997
|
throw console.error(a), new ut("Critical - Unable to synchronize workflow state with server.");
|
|
15996
15998
|
}
|
|
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.
|
|
15999
|
+
}, 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.ac9a049c-ad73-555a-adbf-f7557a7cdbde"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
|
15998
16000
|
}
|
|
15999
16001
|
configure(t) {
|
|
16000
16002
|
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 +16558,18 @@ class Ad {
|
|
|
16556
16558
|
singleVariantsRenderable: (tt = k == null ? void 0 : k.workflowConfiguration) == null ? void 0 : tt.singleVariantsRenderable,
|
|
16557
16559
|
stateMutationFunc: I ? async () => {
|
|
16558
16560
|
throw new G("State mutation is forbidden in read only mode!");
|
|
16559
|
-
} : async (
|
|
16560
|
-
...
|
|
16561
|
+
} : async (X) => (console.log(`LOG: updating transaction with options ${JSON.stringify(X, null, 2)}`), console.trace(), this.updateTransactionState({
|
|
16562
|
+
...X,
|
|
16561
16563
|
context: { transactionOwnerId: T, bundleOwnerId: e == null ? void 0 : e.bundleOwnerId }
|
|
16562
|
-
}),
|
|
16564
|
+
})),
|
|
16563
16565
|
graphQlClient: () => nt,
|
|
16564
16566
|
readOnly: I,
|
|
16565
16567
|
workflow: F,
|
|
16566
16568
|
isReloadedTransaction: k.type === "transaction"
|
|
16567
16569
|
};
|
|
16568
16570
|
if (!I && k.workflowState) {
|
|
16569
|
-
const
|
|
16570
|
-
R.layouts = Object.values(
|
|
16571
|
+
const X = JSON.parse(k.workflowState);
|
|
16572
|
+
R.layouts = Object.values(X.layouts || {}).map((Nt) => Nt.layout), await cs(X), R.reloadedState = X;
|
|
16571
16573
|
} else
|
|
16572
16574
|
R.layouts = Rl(
|
|
16573
16575
|
R.transaction,
|