@spiffcommerce/core 32.2.2 → 32.2.3-beta.b5a7d626-2f37-53ef-b01b-0ee2a6660230
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.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +117 -103
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -23,7 +23,7 @@ import { split as ea } from "unicode-default-word-boundary";
|
|
23
23
|
import dn from "lodash.debounce";
|
24
24
|
import "fs";
|
25
25
|
import "path";
|
26
|
-
var ye = /* @__PURE__ */ ((r) => (r.Data = "Data", r.Font = "Font", r.Frame = "Frame", r.Illustration = "Illustration", r.Image = "Image", r.Model = "Model", r.Material = "Material", r.Color = "Color", r.QuestionnaireCollateral = "QuestionnaireCollateral", r.RequestCollateral = "RequestCollateral", r.SignupCollateral = "SignupCollateral", r.Video = "Video", r.ColorProfile = "ColorProfile", r.Environment = "Environment", r))(ye || {}),
|
26
|
+
var ye = /* @__PURE__ */ ((r) => (r.Data = "Data", r.Font = "Font", r.Frame = "Frame", r.Illustration = "Illustration", r.Image = "Image", r.Model = "Model", r.Material = "Material", r.Color = "Color", r.QuestionnaireCollateral = "QuestionnaireCollateral", r.RequestCollateral = "RequestCollateral", r.SignupCollateral = "SignupCollateral", r.Video = "Video", r.ColorProfile = "ColorProfile", r.Environment = "Environment", r))(ye || {}), $ = /* @__PURE__ */ ((r) => (r.FileUpload = "FileUpload", r.Option = "Option", r.ColorOption = "ColorOption", r.Text = "Text", r))($ || {}), v = /* @__PURE__ */ ((r) => (r.Information = "Information", r.Bulk = "Bulk", r.DigitalContent = "DigitalContent", r.Finish = "Finish", r.Frame = "Frame", r.Illustration = "Illustration", r.Introduction = "Introduction", r.Material = "Material", r.Model = "Model", r.Module = "Module", r.Picture = "Picture", r.Photo = "Photo", r.ProductOverlay = "ProductOverlay", r.Question = "Question", r.Shape = "Shape", r.SilentIllustration = "SilentIllustration", r.Text = "Text", r))(v || {}), br = /* @__PURE__ */ ((r) => (r.Color = "Color", r.Colors = "Colors", r.Selection = "Selection", r.Selections = "Selections", r.Text = "Text", r.Upload = "Upload", r))(br || {}), Ht = /* @__PURE__ */ ((r) => (r.ThreeD = "ThreeD", r.FreeDesign = "FreeDesign", r.Print = "Print", r))(Ht || {}), x = /* @__PURE__ */ ((r) => (r.Frame = "frame", r.Group = "group", r.Image = "image", r.Pattern = "pattern", r.Illustration = "illustration", r.Textbox = "textbox", r))(x || {}), Br = /* @__PURE__ */ ((r) => (r.Default = "Default", r.FirstTransaction = "FirstTransaction", r.OneToOne = "OneToOne", r))(Br || {}), An = /* @__PURE__ */ ((r) => (r.Pending = "Pending", r.Failed = "Failed", r.Validated = "Validated", r.Overridden = "Overridden", r))(An || {}), Ir = /* @__PURE__ */ ((r) => (r.Hyperlink = "Hyperlink", r.Edit = "Edit", r.Approve = "Approve", r))(Ir || {}), Pr = /* @__PURE__ */ ((r) => (r.Hub = "Hub", r.Shopify = "Shopify", r))(Pr || {}), ua = /* @__PURE__ */ ((r) => (r.BackgroundRemover = "BackgroundRemover", r.ConversionAccelerator = "Conversion Accelerator", r.ProcessBuilder = "ProcessBuilder", r))(ua || {}), Dr = /* @__PURE__ */ ((r) => (r[r.Orbit = 0] = "Orbit", r[r.Pan = 1] = "Pan", r))(Dr || {}), Se = /* @__PURE__ */ ((r) => (r.Owner = "Owner", r.Approver = "Approver", r.Editor = "Editor", r.Viewer = "Viewer", r))(Se || {}), Mt = /* @__PURE__ */ ((r) => (r.Autosize = "Autosize", r.Traditional = "Traditional", r))(Mt || {}), j = /* @__PURE__ */ ((r) => (r[r.North = 0] = "North", r[r.Northeast = 1] = "Northeast", r[r.East = 2] = "East", r[r.Southeast = 3] = "Southeast", r[r.South = 4] = "South", r[r.Southwest = 5] = "Southwest", r[r.West = 6] = "West", r[r.Northwest = 7] = "Northwest", r))(j || {}), Fr = /* @__PURE__ */ ((r) => (r.Pixel = "px", r.Millimeter = "mm", r.Centimeter = "cm", r))(Fr || {});
|
27
27
|
class un extends Error {
|
28
28
|
constructor(t) {
|
29
29
|
super(t), this.name = this.constructor.name;
|
@@ -6534,15 +6534,15 @@ class td {
|
|
6534
6534
|
};
|
6535
6535
|
}
|
6536
6536
|
}
|
6537
|
-
class
|
6537
|
+
class L extends Error {
|
6538
6538
|
constructor() {
|
6539
|
-
super("Element not found!"), Object.setPrototypeOf(this,
|
6539
|
+
super("Element not found!"), Object.setPrototypeOf(this, L.prototype);
|
6540
6540
|
}
|
6541
6541
|
}
|
6542
|
-
const
|
6542
|
+
const U = (r, t) => _(r, t).elements.find((n) => n.id === r), _ = (r, t) => {
|
6543
6543
|
const e = Object.values(t).find((a) => a.elements.some((n) => n.id === r));
|
6544
6544
|
if (!e)
|
6545
|
-
throw new
|
6545
|
+
throw new L();
|
6546
6546
|
return e;
|
6547
6547
|
}, X = (r, t) => {
|
6548
6548
|
const e = [...t.elements.filter((n) => n.id !== r.id), r], a = Sa(e);
|
@@ -6628,9 +6628,9 @@ class ed extends N {
|
|
6628
6628
|
}
|
6629
6629
|
apply(t) {
|
6630
6630
|
this.oldState = t;
|
6631
|
-
const e =
|
6631
|
+
const e = U(this.id, Object.values(t.layouts));
|
6632
6632
|
if (!e.id)
|
6633
|
-
throw new
|
6633
|
+
throw new L();
|
6634
6634
|
const a = {
|
6635
6635
|
...e,
|
6636
6636
|
x: this.x,
|
@@ -6651,9 +6651,9 @@ class ad extends N {
|
|
6651
6651
|
}
|
6652
6652
|
apply(t) {
|
6653
6653
|
this.oldState = t;
|
6654
|
-
const e =
|
6654
|
+
const e = U(this.id, Object.values(t.layouts));
|
6655
6655
|
if (!e.id)
|
6656
|
-
throw new
|
6656
|
+
throw new L();
|
6657
6657
|
const a = {
|
6658
6658
|
...e,
|
6659
6659
|
rotation: this.angle
|
@@ -6673,9 +6673,9 @@ class nd extends N {
|
|
6673
6673
|
}
|
6674
6674
|
apply(t) {
|
6675
6675
|
this.oldState = t;
|
6676
|
-
const e =
|
6676
|
+
const e = U(this.id, Object.values(t.layouts));
|
6677
6677
|
if (!e.id)
|
6678
|
-
throw new
|
6678
|
+
throw new L();
|
6679
6679
|
let a = {
|
6680
6680
|
...e,
|
6681
6681
|
width: this.width,
|
@@ -6811,9 +6811,9 @@ class hs extends N {
|
|
6811
6811
|
}
|
6812
6812
|
apply(t) {
|
6813
6813
|
this.oldState = t;
|
6814
|
-
const e =
|
6814
|
+
const e = U(this.id, Object.values(t.layouts));
|
6815
6815
|
if (!e.id)
|
6816
|
-
throw new
|
6816
|
+
throw new L();
|
6817
6817
|
const a = {
|
6818
6818
|
...e,
|
6819
6819
|
fill: this.color,
|
@@ -6835,9 +6835,9 @@ class je extends N {
|
|
6835
6835
|
}
|
6836
6836
|
apply(t) {
|
6837
6837
|
this.oldState = t;
|
6838
|
-
const e =
|
6838
|
+
const e = U(this.id, Object.values(t.layouts));
|
6839
6839
|
if (!e.id)
|
6840
|
-
throw new
|
6840
|
+
throw new L();
|
6841
6841
|
const a = {
|
6842
6842
|
...e,
|
6843
6843
|
textFillImage: this.imageFill
|
@@ -6857,9 +6857,9 @@ class ms extends N {
|
|
6857
6857
|
}
|
6858
6858
|
apply(t) {
|
6859
6859
|
this.oldState = t;
|
6860
|
-
const e =
|
6860
|
+
const e = U(this.id, Object.values(t.layouts));
|
6861
6861
|
if (!e.id)
|
6862
|
-
throw new
|
6862
|
+
throw new L();
|
6863
6863
|
const a = {
|
6864
6864
|
...e,
|
6865
6865
|
fontSize: this.size
|
@@ -6879,9 +6879,9 @@ class Wa extends N {
|
|
6879
6879
|
}
|
6880
6880
|
apply(t) {
|
6881
6881
|
this.oldState = t;
|
6882
|
-
const e =
|
6882
|
+
const e = U(this.id, Object.values(t.layouts));
|
6883
6883
|
if (!e.id)
|
6884
|
-
throw new
|
6884
|
+
throw new L();
|
6885
6885
|
const a = {
|
6886
6886
|
...e,
|
6887
6887
|
fontData: this.fontData
|
@@ -6901,9 +6901,9 @@ class gs extends N {
|
|
6901
6901
|
}
|
6902
6902
|
apply(t) {
|
6903
6903
|
this.oldState = t;
|
6904
|
-
const e =
|
6904
|
+
const e = U(this.id, Object.values(t.layouts));
|
6905
6905
|
if (!e.id)
|
6906
|
-
throw new
|
6906
|
+
throw new L();
|
6907
6907
|
const a = {
|
6908
6908
|
...e,
|
6909
6909
|
align: this.align
|
@@ -6959,9 +6959,9 @@ class fs extends N {
|
|
6959
6959
|
}
|
6960
6960
|
apply(t) {
|
6961
6961
|
this.oldState = t;
|
6962
|
-
const e =
|
6962
|
+
const e = U(this.id, Object.values(t.layouts));
|
6963
6963
|
if (!e.id)
|
6964
|
-
throw new
|
6964
|
+
throw new L();
|
6965
6965
|
const a = {
|
6966
6966
|
...e,
|
6967
6967
|
useThreshold: this.useThreshold,
|
@@ -6984,9 +6984,9 @@ class rd extends N {
|
|
6984
6984
|
}
|
6985
6985
|
apply(t) {
|
6986
6986
|
this.oldState = t;
|
6987
|
-
const e =
|
6987
|
+
const e = U(this.id, Object.values(t.layouts));
|
6988
6988
|
if (!e.id)
|
6989
|
-
throw new
|
6989
|
+
throw new L();
|
6990
6990
|
const a = {
|
6991
6991
|
...e,
|
6992
6992
|
src: this.src
|
@@ -7006,9 +7006,9 @@ class Cs extends N {
|
|
7006
7006
|
}
|
7007
7007
|
apply(t) {
|
7008
7008
|
this.oldState = t;
|
7009
|
-
const e =
|
7009
|
+
const e = U(this.id, Object.values(t.layouts));
|
7010
7010
|
if (!e.id)
|
7011
|
-
throw new
|
7011
|
+
throw new L();
|
7012
7012
|
const a = _(e.id, Object.values(t.layouts)), n = X(ae(e, this.text, e), a);
|
7013
7013
|
return {
|
7014
7014
|
...t,
|
@@ -7025,9 +7025,9 @@ class He extends N {
|
|
7025
7025
|
}
|
7026
7026
|
apply(t) {
|
7027
7027
|
this.oldState = t;
|
7028
|
-
const e =
|
7028
|
+
const e = U(this.id, Object.values(t.layouts));
|
7029
7029
|
if (!e.id)
|
7030
|
-
throw new
|
7030
|
+
throw new L();
|
7031
7031
|
const a = {
|
7032
7032
|
...e,
|
7033
7033
|
strokeColor: this.strokeColor,
|
@@ -7048,9 +7048,9 @@ class ca extends N {
|
|
7048
7048
|
}
|
7049
7049
|
apply(t) {
|
7050
7050
|
this.oldState = t;
|
7051
|
-
const e =
|
7051
|
+
const e = U(this.id, Object.values(t.layouts));
|
7052
7052
|
if (!e.id)
|
7053
|
-
throw new
|
7053
|
+
throw new L();
|
7054
7054
|
const a = e.colors || {}, n = a[this.className];
|
7055
7055
|
typeof this.fill == "string" ? a[this.className] = {
|
7056
7056
|
browserValue: this.fill,
|
@@ -7080,9 +7080,9 @@ class ws extends N {
|
|
7080
7080
|
}
|
7081
7081
|
apply(t) {
|
7082
7082
|
this.oldState = t;
|
7083
|
-
const e =
|
7083
|
+
const e = U(this.id, Object.values(t.layouts));
|
7084
7084
|
if (!e.id)
|
7085
|
-
throw new
|
7085
|
+
throw new L();
|
7086
7086
|
const a = {
|
7087
7087
|
...e,
|
7088
7088
|
svg: this.svgBody,
|
@@ -7105,8 +7105,8 @@ class id extends N {
|
|
7105
7105
|
super(), this.id = t;
|
7106
7106
|
}
|
7107
7107
|
apply(t) {
|
7108
|
-
if (this.oldState = t,
|
7109
|
-
throw new
|
7108
|
+
if (this.oldState = t, !U(this.id, Object.values(t.layouts)).id)
|
7109
|
+
throw new L();
|
7110
7110
|
const a = Object.values(t.layouts).find((s) => s.elements.find((o) => o.id === this.id));
|
7111
7111
|
if (!a)
|
7112
7112
|
throw new Error("Layout missing from state!");
|
@@ -7135,9 +7135,9 @@ class sd extends N {
|
|
7135
7135
|
}
|
7136
7136
|
apply(t) {
|
7137
7137
|
this.oldState = t;
|
7138
|
-
const e =
|
7138
|
+
const e = U(this.id, Object.values(t.layouts));
|
7139
7139
|
if (!e.id)
|
7140
|
-
throw new
|
7140
|
+
throw new L();
|
7141
7141
|
const a = Object.values(t.layouts).find((o) => o.elements.find((l) => l.id === this.id));
|
7142
7142
|
if (!a)
|
7143
7143
|
throw new Error("Layout missing from state!");
|
@@ -7165,8 +7165,8 @@ class od extends N {
|
|
7165
7165
|
super(), this.id = t;
|
7166
7166
|
}
|
7167
7167
|
apply(t) {
|
7168
|
-
if (this.oldState = t,
|
7169
|
-
throw new
|
7168
|
+
if (this.oldState = t, !U(this.id, Object.values(t.layouts)).id)
|
7169
|
+
throw new L();
|
7170
7170
|
const a = Object.values(t.layouts).find((l) => l.elements.find((c) => c.id === this.id));
|
7171
7171
|
if (!a)
|
7172
7172
|
throw new Error("Layout missing from state!");
|
@@ -7192,8 +7192,8 @@ class ld extends N {
|
|
7192
7192
|
super(), this.id = t;
|
7193
7193
|
}
|
7194
7194
|
apply(t) {
|
7195
|
-
if (this.oldState = t,
|
7196
|
-
throw new
|
7195
|
+
if (this.oldState = t, !U(this.id, Object.values(t.layouts)).id)
|
7196
|
+
throw new L();
|
7197
7197
|
const a = Object.values(t.layouts).find((l) => l.elements.find((c) => c.id === this.id));
|
7198
7198
|
if (!a)
|
7199
7199
|
throw new Error("Layout missing from state!");
|
@@ -7838,7 +7838,7 @@ class vs {
|
|
7838
7838
|
const a = e.getRegionElements(t.stepName) || [];
|
7839
7839
|
if (a.length === 0) return [];
|
7840
7840
|
try {
|
7841
|
-
return
|
7841
|
+
return U(
|
7842
7842
|
a[0].id,
|
7843
7843
|
e.getAllLayoutData()
|
7844
7844
|
).colors;
|
@@ -7918,7 +7918,7 @@ class vs {
|
|
7918
7918
|
async changeColors(t, e, a, n, i) {
|
7919
7919
|
if (e.length === 0)
|
7920
7920
|
return;
|
7921
|
-
const s =
|
7921
|
+
const s = U(
|
7922
7922
|
e[0].id,
|
7923
7923
|
n().map((h) => h.layoutState)
|
7924
7924
|
), o = { ...s.colors }, l = {};
|
@@ -8749,7 +8749,7 @@ class Ms {
|
|
8749
8749
|
const u = e.getWorkflowExperience().getBundle();
|
8750
8750
|
if (u && t.globalPropertyAspectConfigurations) {
|
8751
8751
|
const g = u.getGlobalPropertyConfiguration()?.aspects?.find(
|
8752
|
-
(p) => p.type ===
|
8752
|
+
(p) => p.type === $.Text && t.globalPropertyAspectConfigurations?.map((f) => f.aspectName).includes(p.name)
|
8753
8753
|
);
|
8754
8754
|
if (g) {
|
8755
8755
|
const f = u.getGlobalPropertyStateManager().getAspect(g.name);
|
@@ -8787,7 +8787,7 @@ class Ms {
|
|
8787
8787
|
return null;
|
8788
8788
|
}
|
8789
8789
|
findLayoutElements(t, e) {
|
8790
|
-
return t.getRegionElements(e.stepName).map((i) =>
|
8790
|
+
return t.getRegionElements(e.stepName).map((i) => U(i.id, t.getAllLayoutData()));
|
8791
8791
|
}
|
8792
8792
|
/**
|
8793
8793
|
* Get the colors that can be used for a given text step.
|
@@ -8977,7 +8977,7 @@ class Ms {
|
|
8977
8977
|
const g = e.getWorkflowExperience().getBundle();
|
8978
8978
|
if (g && t.globalPropertyAspectConfigurations) {
|
8979
8979
|
const f = g.getGlobalPropertyConfiguration()?.aspects?.find(
|
8980
|
-
(S) => S.type ===
|
8980
|
+
(S) => S.type === $.Text && t.globalPropertyAspectConfigurations?.map((b) => b.aspectName).includes(S.name)
|
8981
8981
|
);
|
8982
8982
|
if (f) {
|
8983
8983
|
const b = g.getGlobalPropertyStateManager().getAspect(f.name);
|
@@ -9024,7 +9024,7 @@ class Ms {
|
|
9024
9024
|
const c = e.getWorkflowExperience().getBundle();
|
9025
9025
|
if (c && t.globalPropertyAspectConfigurations) {
|
9026
9026
|
const A = c.getGlobalPropertyConfiguration()?.aspects?.find(
|
9027
|
-
(u) => u.type ===
|
9027
|
+
(u) => u.type === $.Text && t.globalPropertyAspectConfigurations?.map((h) => h.aspectName).includes(u.name)
|
9028
9028
|
);
|
9029
9029
|
if (A) {
|
9030
9030
|
const h = c.getGlobalPropertyStateManager().getAspect(A.name);
|
@@ -11233,7 +11233,7 @@ class vo extends Z {
|
|
11233
11233
|
getColors() {
|
11234
11234
|
const t = this.manager.getRegionElements(this.step.stepName) || [];
|
11235
11235
|
if (t.length === 0) return;
|
11236
|
-
const a =
|
11236
|
+
const a = U(t[0].id, this.manager.getAllLayoutData()).colors, i = this.getCurrentVariant()?.getAssetResource()?.assetConfiguration, s = i?.defaultColorVariants || [];
|
11237
11237
|
if (s.length !== 0) {
|
11238
11238
|
const o = {};
|
11239
11239
|
return s.forEach((l) => {
|
@@ -13413,19 +13413,19 @@ class cl {
|
|
13413
13413
|
}
|
13414
13414
|
async createHandle(t) {
|
13415
13415
|
switch (t.type) {
|
13416
|
-
case
|
13416
|
+
case $.FileUpload:
|
13417
13417
|
return new dl(this.bundle, t).initialize();
|
13418
|
-
case
|
13418
|
+
case $.ColorOption:
|
13419
13419
|
return new Ka(
|
13420
13420
|
this.bundle,
|
13421
13421
|
t,
|
13422
13422
|
t.entityId ? await H.getOption(t.entityId) : void 0
|
13423
13423
|
);
|
13424
|
-
case
|
13424
|
+
case $.Option: {
|
13425
13425
|
const e = t.entityId ? await H.getOption(t.entityId) : void 0;
|
13426
13426
|
return e?.type === "Color" ? new Ka(this.bundle, t, e) : new er(this.bundle, t, e);
|
13427
13427
|
}
|
13428
|
-
case
|
13428
|
+
case $.Text:
|
13429
13429
|
return new Al(this.bundle, t);
|
13430
13430
|
default:
|
13431
13431
|
throw new Error("Unhandled Global Property Aspect Type");
|
@@ -14021,15 +14021,15 @@ class ml {
|
|
14021
14021
|
let a = e.type && e.storage ? {} : void 0;
|
14022
14022
|
if (a)
|
14023
14023
|
switch (e.type) {
|
14024
|
-
case
|
14024
|
+
case $.FileUpload: {
|
14025
14025
|
a.fileUpload = e.storage;
|
14026
14026
|
break;
|
14027
14027
|
}
|
14028
|
-
case
|
14028
|
+
case $.Option: {
|
14029
14029
|
a.option = e.storage;
|
14030
14030
|
break;
|
14031
14031
|
}
|
14032
|
-
case
|
14032
|
+
case $.ColorOption: {
|
14033
14033
|
a = e.storage;
|
14034
14034
|
break;
|
14035
14035
|
}
|
@@ -14690,7 +14690,7 @@ const bl = w`
|
|
14690
14690
|
`;
|
14691
14691
|
class _e {
|
14692
14692
|
constructor(t, e, a, n, i, s) {
|
14693
|
-
this.workflowExperiences = [], this.eventEmitter = new El(), this.client = t, this.id = e.id, this.name = e.name || "", this.dispatchDate = e.dispatchDate, this.template = e.template || !1, this.quoteId = e.quoteId, this.shareActions = e.bundleShareActions, this.workflowViewerLink = e.workflowViewerLink, this.workflowViewerAmendLink = e.workflowViewerAmendLink, this.ownerId = i, this.metadata = new Map(e.metadata?.map((c) => [c.key, c.value]) || []), this.completed = e.completed ?? !1, this.productCollection = e.productCollection, this.bundleStateManager = new gl(e.bundleStateData);
|
14693
|
+
this.workflowExperiences = [], this.eventEmitter = new El(), this.updatesLocked = !1, this.client = t, this.id = e.id, this.name = e.name || "", this.dispatchDate = e.dispatchDate, this.template = e.template || !1, this.quoteId = e.quoteId, this.shareActions = e.bundleShareActions, this.workflowViewerLink = e.workflowViewerLink, this.workflowViewerAmendLink = e.workflowViewerAmendLink, this.ownerId = i, this.metadata = new Map(e.metadata?.map((c) => [c.key, c.value]) || []), this.completed = e.completed ?? !1, this.productCollection = e.productCollection, this.bundleStateManager = new gl(e.bundleStateData);
|
14694
14694
|
const o = this.productCollection?.globalPropertyConfiguration;
|
14695
14695
|
this.globalConfigurationPropertyId = o?.id, this.globalPropertyStateManager = new ml(
|
14696
14696
|
this.id,
|
@@ -14708,7 +14708,7 @@ class _e {
|
|
14708
14708
|
const A = this.globalPropertyStateManager.getGlobalPropertyState();
|
14709
14709
|
A ? this.globalPropertyHandleService.getHandles().then((u) => {
|
14710
14710
|
const h = u.map((m) => {
|
14711
|
-
if (m.getType() ===
|
14711
|
+
if (m.getType() === $.ColorOption || m.getType() === $.Option) {
|
14712
14712
|
const g = m;
|
14713
14713
|
if (!A.aspects.find((f) => f.name === g.getName()))
|
14714
14714
|
return g.initDefaultVariant();
|
@@ -14834,57 +14834,61 @@ class _e {
|
|
14834
14834
|
);
|
14835
14835
|
}
|
14836
14836
|
async applyGlobalPropertyState(t) {
|
14837
|
+
this.updatesLocked = !0;
|
14837
14838
|
const e = await this.globalPropertyHandleService.getHandles();
|
14838
|
-
|
14839
|
-
const
|
14840
|
-
|
14841
|
-
|
14842
|
-
|
14843
|
-
const
|
14844
|
-
|
14845
|
-
|
14846
|
-
|
14847
|
-
|
14848
|
-
|
14849
|
-
|
14850
|
-
|
14851
|
-
|
14852
|
-
|
14853
|
-
d
|
14854
|
-
|
14855
|
-
|
14856
|
-
|
14857
|
-
|
14839
|
+
try {
|
14840
|
+
for (const a of t.aspects) {
|
14841
|
+
const n = a?.name;
|
14842
|
+
this.getGlobalPropertyStateManager().setAspect(n, a.value);
|
14843
|
+
}
|
14844
|
+
for (const a of t.aspects) {
|
14845
|
+
const n = a?.name, i = e.find((s) => s.getName() === n);
|
14846
|
+
if (i)
|
14847
|
+
switch (a.type) {
|
14848
|
+
case $.FileUpload: {
|
14849
|
+
const s = i, o = await be([a.value]);
|
14850
|
+
o.length > 0 && await s.selectImage(o[0]);
|
14851
|
+
const l = a.storage?.colors;
|
14852
|
+
if (l) {
|
14853
|
+
const c = Object.fromEntries(
|
14854
|
+
l.map((d) => [
|
14855
|
+
d.key,
|
14856
|
+
{ browserValue: d.browserValue, pmsValue: d.pmsValue }
|
14857
|
+
]) ?? []
|
14858
|
+
);
|
14859
|
+
await s.changeColors(c);
|
14860
|
+
}
|
14861
|
+
break;
|
14858
14862
|
}
|
14859
|
-
|
14860
|
-
|
14861
|
-
|
14862
|
-
|
14863
|
-
|
14864
|
-
|
14863
|
+
case $.ColorOption: {
|
14864
|
+
const s = i;
|
14865
|
+
if (a.type === $.ColorOption) {
|
14866
|
+
const l = s.getAllVariants().find((c) => c.getId() === a.value);
|
14867
|
+
l && await s.selectVariant(l);
|
14868
|
+
} else
|
14869
|
+
s.setCustomColor(a.value);
|
14870
|
+
break;
|
14871
|
+
}
|
14872
|
+
case $.Option: {
|
14873
|
+
const s = i, l = s.getAllVariants().find((c) => c.getId() === a.value);
|
14865
14874
|
l && await s.selectVariant(l);
|
14866
|
-
|
14867
|
-
|
14868
|
-
|
14869
|
-
|
14870
|
-
|
14871
|
-
|
14872
|
-
l && await s.selectVariant(l);
|
14873
|
-
break;
|
14874
|
-
}
|
14875
|
-
case L.Text: {
|
14876
|
-
await i.setText(a.value);
|
14877
|
-
break;
|
14875
|
+
break;
|
14876
|
+
}
|
14877
|
+
case $.Text: {
|
14878
|
+
await i.setText(a.value);
|
14879
|
+
break;
|
14880
|
+
}
|
14878
14881
|
}
|
14879
|
-
|
14882
|
+
}
|
14883
|
+
} finally {
|
14884
|
+
this.updatesLocked = !1, this.onGlobalPropertiesChanged(void 0, this.globalPropertyStateManager.getGlobalPropertyState());
|
14880
14885
|
}
|
14881
|
-
this.checkMandatoryHandlesChanged(void 0, e);
|
14882
14886
|
}
|
14883
14887
|
getGlobalPropertyStateManager() {
|
14884
14888
|
return this.globalPropertyStateManager;
|
14885
14889
|
}
|
14886
14890
|
async getGlobalPropertyTotalSubunits() {
|
14887
|
-
return (await this.globalPropertyHandleService.getHandles()).filter((a) => a.getType() ===
|
14891
|
+
return (await this.globalPropertyHandleService.getHandles()).filter((a) => a.getType() === $.Option).map((a) => a.getCurrentVariant()?.getPrice() || 0).reduce((a, n) => a + n, 0);
|
14888
14892
|
}
|
14889
14893
|
getTotalSubunits() {
|
14890
14894
|
return this.workflowExperiences.map((t) => t.getTotalPriceSubunits()).reduce((t, e) => t + e, 0);
|
@@ -14899,7 +14903,7 @@ class _e {
|
|
14899
14903
|
const i = this.getGlobalPropertyConfiguration()?.aspects.find(
|
14900
14904
|
(s) => s.name === n
|
14901
14905
|
);
|
14902
|
-
if (i && i.type ===
|
14906
|
+
if (i && i.type === $.ColorOption) {
|
14903
14907
|
const s = e.getCurrentVariant()?.getAssetResource(), o = s?.assetConfiguration?.channelNumbers || [], l = s?.assetConfiguration?.defaultColorVariants || [], c = hl(
|
14904
14908
|
this.getWorkflowExperiences(),
|
14905
14909
|
this.globalConfigurationPropertyId || "",
|
@@ -15346,8 +15350,18 @@ class _e {
|
|
15346
15350
|
});
|
15347
15351
|
}
|
15348
15352
|
async onGlobalPropertiesChanged(t, e) {
|
15353
|
+
if (this.updatesLocked)
|
15354
|
+
return;
|
15349
15355
|
const a = await this.globalPropertyHandleService.getHandles(), n = this.globalPropertyHandleService.applyConditionsFromState(a, t), i = this.globalPropertyHandleService.applyConditionsFromState(a, e);
|
15350
|
-
this.checkConditionalHandlesChanged(n, i), this.checkMandatoryHandlesChanged(t, i)
|
15356
|
+
this.checkConditionalHandlesChanged(n, i), this.checkMandatoryHandlesChanged(t, i);
|
15357
|
+
const s = a.map((o) => {
|
15358
|
+
if (o.getType() === $.ColorOption || o.getType() === $.Option) {
|
15359
|
+
const l = o;
|
15360
|
+
if (!e.aspects.find((d) => d.name === l.getName()))
|
15361
|
+
return l.initDefaultVariant();
|
15362
|
+
}
|
15363
|
+
});
|
15364
|
+
await Promise.all(s), await Promise.all(i.map((o) => o.applyGlobalState()));
|
15351
15365
|
}
|
15352
15366
|
checkConditionalHandlesChanged(t, e) {
|
15353
15367
|
(() => {
|
@@ -15965,7 +15979,7 @@ class pd {
|
|
15965
15979
|
} catch (a) {
|
15966
15980
|
throw console.error(a), new ht("Critical - Unable to synchronize workflow state with server.");
|
15967
15981
|
}
|
15968
|
-
}, this.options = t, this.options.applicationKey && Vr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 32.2.
|
15982
|
+
}, this.options = t, this.options.applicationKey && Vr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 32.2.3"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
15969
15983
|
}
|
15970
15984
|
configure(t) {
|
15971
15985
|
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 && Gr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Lt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
|
@@ -17655,7 +17669,7 @@ export {
|
|
17655
17669
|
cc as AddressValidationResultConfirmationLevel,
|
17656
17670
|
An as AddressValidationStatus,
|
17657
17671
|
md as ArrayInput,
|
17658
|
-
|
17672
|
+
$ as AspectType,
|
17659
17673
|
bt as AssetNotFoundError,
|
17660
17674
|
ye as AssetType,
|
17661
17675
|
od as BringForwardCommand,
|
@@ -17755,7 +17769,7 @@ export {
|
|
17755
17769
|
Bd as duplicateTransaction,
|
17756
17770
|
nt as fetchAsString,
|
17757
17771
|
zc as findAngle,
|
17758
|
-
|
17772
|
+
U as findElement,
|
17759
17773
|
Lc as findPmsColors,
|
17760
17774
|
Vt as frameDataCache,
|
17761
17775
|
St as frameStepService,
|