@spiffcommerce/core 32.2.3 → 32.2.4-beta.2a1f0ff0-c7c4-56e0-afbf-fd744926c42c
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 +85 -83
- 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 || {}), U = /* @__PURE__ */ ((r) => (r.FileUpload = "FileUpload", r.Option = "Option", r.ColorOption = "ColorOption", r.Text = "Text", r))(U || {}), 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;
|
@@ -6539,7 +6539,7 @@ class L extends Error {
|
|
6539
6539
|
super("Element not found!"), Object.setPrototypeOf(this, L.prototype);
|
6540
6540
|
}
|
6541
6541
|
}
|
6542
|
-
const
|
6542
|
+
const $ = (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
6545
|
throw new L();
|
@@ -6628,7 +6628,7 @@ class ed extends N {
|
|
6628
6628
|
}
|
6629
6629
|
apply(t) {
|
6630
6630
|
this.oldState = t;
|
6631
|
-
const e =
|
6631
|
+
const e = $(this.id, Object.values(t.layouts));
|
6632
6632
|
if (!e.id)
|
6633
6633
|
throw new L();
|
6634
6634
|
const a = {
|
@@ -6651,7 +6651,7 @@ class ad extends N {
|
|
6651
6651
|
}
|
6652
6652
|
apply(t) {
|
6653
6653
|
this.oldState = t;
|
6654
|
-
const e =
|
6654
|
+
const e = $(this.id, Object.values(t.layouts));
|
6655
6655
|
if (!e.id)
|
6656
6656
|
throw new L();
|
6657
6657
|
const a = {
|
@@ -6673,7 +6673,7 @@ class nd extends N {
|
|
6673
6673
|
}
|
6674
6674
|
apply(t) {
|
6675
6675
|
this.oldState = t;
|
6676
|
-
const e =
|
6676
|
+
const e = $(this.id, Object.values(t.layouts));
|
6677
6677
|
if (!e.id)
|
6678
6678
|
throw new L();
|
6679
6679
|
let a = {
|
@@ -6811,7 +6811,7 @@ class hs extends N {
|
|
6811
6811
|
}
|
6812
6812
|
apply(t) {
|
6813
6813
|
this.oldState = t;
|
6814
|
-
const e =
|
6814
|
+
const e = $(this.id, Object.values(t.layouts));
|
6815
6815
|
if (!e.id)
|
6816
6816
|
throw new L();
|
6817
6817
|
const a = {
|
@@ -6835,7 +6835,7 @@ class je extends N {
|
|
6835
6835
|
}
|
6836
6836
|
apply(t) {
|
6837
6837
|
this.oldState = t;
|
6838
|
-
const e =
|
6838
|
+
const e = $(this.id, Object.values(t.layouts));
|
6839
6839
|
if (!e.id)
|
6840
6840
|
throw new L();
|
6841
6841
|
const a = {
|
@@ -6857,7 +6857,7 @@ class ms extends N {
|
|
6857
6857
|
}
|
6858
6858
|
apply(t) {
|
6859
6859
|
this.oldState = t;
|
6860
|
-
const e =
|
6860
|
+
const e = $(this.id, Object.values(t.layouts));
|
6861
6861
|
if (!e.id)
|
6862
6862
|
throw new L();
|
6863
6863
|
const a = {
|
@@ -6879,7 +6879,7 @@ class Wa extends N {
|
|
6879
6879
|
}
|
6880
6880
|
apply(t) {
|
6881
6881
|
this.oldState = t;
|
6882
|
-
const e =
|
6882
|
+
const e = $(this.id, Object.values(t.layouts));
|
6883
6883
|
if (!e.id)
|
6884
6884
|
throw new L();
|
6885
6885
|
const a = {
|
@@ -6901,7 +6901,7 @@ class gs extends N {
|
|
6901
6901
|
}
|
6902
6902
|
apply(t) {
|
6903
6903
|
this.oldState = t;
|
6904
|
-
const e =
|
6904
|
+
const e = $(this.id, Object.values(t.layouts));
|
6905
6905
|
if (!e.id)
|
6906
6906
|
throw new L();
|
6907
6907
|
const a = {
|
@@ -6959,7 +6959,7 @@ class fs extends N {
|
|
6959
6959
|
}
|
6960
6960
|
apply(t) {
|
6961
6961
|
this.oldState = t;
|
6962
|
-
const e =
|
6962
|
+
const e = $(this.id, Object.values(t.layouts));
|
6963
6963
|
if (!e.id)
|
6964
6964
|
throw new L();
|
6965
6965
|
const a = {
|
@@ -6984,7 +6984,7 @@ class rd extends N {
|
|
6984
6984
|
}
|
6985
6985
|
apply(t) {
|
6986
6986
|
this.oldState = t;
|
6987
|
-
const e =
|
6987
|
+
const e = $(this.id, Object.values(t.layouts));
|
6988
6988
|
if (!e.id)
|
6989
6989
|
throw new L();
|
6990
6990
|
const a = {
|
@@ -7006,7 +7006,7 @@ class Cs extends N {
|
|
7006
7006
|
}
|
7007
7007
|
apply(t) {
|
7008
7008
|
this.oldState = t;
|
7009
|
-
const e =
|
7009
|
+
const e = $(this.id, Object.values(t.layouts));
|
7010
7010
|
if (!e.id)
|
7011
7011
|
throw new L();
|
7012
7012
|
const a = _(e.id, Object.values(t.layouts)), n = X(ae(e, this.text, e), a);
|
@@ -7025,7 +7025,7 @@ class He extends N {
|
|
7025
7025
|
}
|
7026
7026
|
apply(t) {
|
7027
7027
|
this.oldState = t;
|
7028
|
-
const e =
|
7028
|
+
const e = $(this.id, Object.values(t.layouts));
|
7029
7029
|
if (!e.id)
|
7030
7030
|
throw new L();
|
7031
7031
|
const a = {
|
@@ -7048,7 +7048,7 @@ class ca extends N {
|
|
7048
7048
|
}
|
7049
7049
|
apply(t) {
|
7050
7050
|
this.oldState = t;
|
7051
|
-
const e =
|
7051
|
+
const e = $(this.id, Object.values(t.layouts));
|
7052
7052
|
if (!e.id)
|
7053
7053
|
throw new L();
|
7054
7054
|
const a = e.colors || {}, n = a[this.className];
|
@@ -7080,7 +7080,7 @@ class ws extends N {
|
|
7080
7080
|
}
|
7081
7081
|
apply(t) {
|
7082
7082
|
this.oldState = t;
|
7083
|
-
const e =
|
7083
|
+
const e = $(this.id, Object.values(t.layouts));
|
7084
7084
|
if (!e.id)
|
7085
7085
|
throw new L();
|
7086
7086
|
const a = {
|
@@ -7105,7 +7105,7 @@ class id extends N {
|
|
7105
7105
|
super(), this.id = t;
|
7106
7106
|
}
|
7107
7107
|
apply(t) {
|
7108
|
-
if (this.oldState = t,
|
7108
|
+
if (this.oldState = t, !$(this.id, Object.values(t.layouts)).id)
|
7109
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)
|
@@ -7135,7 +7135,7 @@ class sd extends N {
|
|
7135
7135
|
}
|
7136
7136
|
apply(t) {
|
7137
7137
|
this.oldState = t;
|
7138
|
-
const e =
|
7138
|
+
const e = $(this.id, Object.values(t.layouts));
|
7139
7139
|
if (!e.id)
|
7140
7140
|
throw new L();
|
7141
7141
|
const a = Object.values(t.layouts).find((o) => o.elements.find((l) => l.id === this.id));
|
@@ -7165,7 +7165,7 @@ class od extends N {
|
|
7165
7165
|
super(), this.id = t;
|
7166
7166
|
}
|
7167
7167
|
apply(t) {
|
7168
|
-
if (this.oldState = t,
|
7168
|
+
if (this.oldState = t, !$(this.id, Object.values(t.layouts)).id)
|
7169
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)
|
@@ -7192,7 +7192,7 @@ class ld extends N {
|
|
7192
7192
|
super(), this.id = t;
|
7193
7193
|
}
|
7194
7194
|
apply(t) {
|
7195
|
-
if (this.oldState = t,
|
7195
|
+
if (this.oldState = t, !$(this.id, Object.values(t.layouts)).id)
|
7196
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)
|
@@ -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 $(
|
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 = $(
|
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 === U.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) => $(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 === U.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 === U.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 = $(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 U.FileUpload:
|
13417
13417
|
return new dl(this.bundle, t).initialize();
|
13418
|
-
case
|
13418
|
+
case U.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 U.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 U.Text:
|
13429
13429
|
return new Al(this.bundle, t);
|
13430
13430
|
default:
|
13431
13431
|
throw new Error("Unhandled Global Property Aspect Type");
|
@@ -13830,7 +13830,7 @@ class Ka extends er {
|
|
13830
13830
|
*/
|
13831
13831
|
async selectVariant(t, e) {
|
13832
13832
|
await Promise.all([
|
13833
|
-
this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name, t.getId(),
|
13833
|
+
this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name, t.getId(), {}, e),
|
13834
13834
|
this.applyColorVariant(t, void 0, e)
|
13835
13835
|
]);
|
13836
13836
|
}
|
@@ -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 U.FileUpload: {
|
14025
14025
|
a.fileUpload = e.storage;
|
14026
14026
|
break;
|
14027
14027
|
}
|
14028
|
-
case
|
14028
|
+
case U.Option: {
|
14029
14029
|
a.option = e.storage;
|
14030
14030
|
break;
|
14031
14031
|
}
|
14032
|
-
case
|
14032
|
+
case U.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() === U.ColorOption || m.getType() === U.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,57 @@ 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 U.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 U.ColorOption: {
|
14864
|
+
const s = i, l = s.getAllVariants().find((c) => c.getId() === a.value);
|
14865
|
+
l && await s.selectVariant(l), a.storage && a.storage.customColor && s.setCustomColor(a.value);
|
14866
|
+
break;
|
14867
|
+
}
|
14868
|
+
case U.Option: {
|
14869
|
+
const s = i, l = s.getAllVariants().find((c) => c.getId() === a.value);
|
14865
14870
|
l && await s.selectVariant(l);
|
14866
|
-
|
14867
|
-
|
14868
|
-
|
14869
|
-
|
14870
|
-
|
14871
|
-
|
14872
|
-
l && await s.selectVariant(l);
|
14873
|
-
break;
|
14874
|
-
}
|
14875
|
-
case $.Text: {
|
14876
|
-
await i.setText(a.value);
|
14877
|
-
break;
|
14871
|
+
break;
|
14872
|
+
}
|
14873
|
+
case U.Text: {
|
14874
|
+
await i.setText(a.value);
|
14875
|
+
break;
|
14876
|
+
}
|
14878
14877
|
}
|
14879
|
-
|
14878
|
+
}
|
14879
|
+
} finally {
|
14880
|
+
this.updatesLocked = !1, this.onGlobalPropertiesChanged(void 0, this.globalPropertyStateManager.getGlobalPropertyState());
|
14880
14881
|
}
|
14881
|
-
this.checkMandatoryHandlesChanged(void 0, e);
|
14882
14882
|
}
|
14883
14883
|
getGlobalPropertyStateManager() {
|
14884
14884
|
return this.globalPropertyStateManager;
|
14885
14885
|
}
|
14886
14886
|
async getGlobalPropertyTotalSubunits() {
|
14887
|
-
return (await this.globalPropertyHandleService.getHandles()).filter((a) => a.getType() ===
|
14887
|
+
return (await this.globalPropertyHandleService.getHandles()).filter((a) => a.getType() === U.Option).map((a) => a.getCurrentVariant()?.getPrice() || 0).reduce((a, n) => a + n, 0);
|
14888
14888
|
}
|
14889
14889
|
getTotalSubunits() {
|
14890
14890
|
return this.workflowExperiences.map((t) => t.getTotalPriceSubunits()).reduce((t, e) => t + e, 0);
|
@@ -14899,7 +14899,7 @@ class _e {
|
|
14899
14899
|
const i = this.getGlobalPropertyConfiguration()?.aspects.find(
|
14900
14900
|
(s) => s.name === n
|
14901
14901
|
);
|
14902
|
-
if (i && i.type ===
|
14902
|
+
if (i && i.type === U.ColorOption) {
|
14903
14903
|
const s = e.getCurrentVariant()?.getAssetResource(), o = s?.assetConfiguration?.channelNumbers || [], l = s?.assetConfiguration?.defaultColorVariants || [], c = hl(
|
14904
14904
|
this.getWorkflowExperiences(),
|
14905
14905
|
this.globalConfigurationPropertyId || "",
|
@@ -15346,10 +15346,12 @@ class _e {
|
|
15346
15346
|
});
|
15347
15347
|
}
|
15348
15348
|
async onGlobalPropertiesChanged(t, e) {
|
15349
|
+
if (this.updatesLocked)
|
15350
|
+
return;
|
15349
15351
|
const a = await this.globalPropertyHandleService.getHandles(), n = this.globalPropertyHandleService.applyConditionsFromState(a, t), i = this.globalPropertyHandleService.applyConditionsFromState(a, e);
|
15350
15352
|
this.checkConditionalHandlesChanged(n, i), this.checkMandatoryHandlesChanged(t, i);
|
15351
15353
|
const s = a.map((o) => {
|
15352
|
-
if (o.getType() ===
|
15354
|
+
if (o.getType() === U.ColorOption || o.getType() === U.Option) {
|
15353
15355
|
const l = o;
|
15354
15356
|
if (!e.aspects.find((d) => d.name === l.getName()))
|
15355
15357
|
return l.initDefaultVariant();
|
@@ -15973,7 +15975,7 @@ class pd {
|
|
15973
15975
|
} catch (a) {
|
15974
15976
|
throw console.error(a), new ht("Critical - Unable to synchronize workflow state with server.");
|
15975
15977
|
}
|
15976
|
-
}, this.options = t, this.options.applicationKey && Vr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 32.2.
|
15978
|
+
}, this.options = t, this.options.applicationKey && Vr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 32.2.4"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
15977
15979
|
}
|
15978
15980
|
configure(t) {
|
15979
15981
|
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);
|
@@ -17663,7 +17665,7 @@ export {
|
|
17663
17665
|
cc as AddressValidationResultConfirmationLevel,
|
17664
17666
|
An as AddressValidationStatus,
|
17665
17667
|
md as ArrayInput,
|
17666
|
-
|
17668
|
+
U as AspectType,
|
17667
17669
|
bt as AssetNotFoundError,
|
17668
17670
|
ye as AssetType,
|
17669
17671
|
od as BringForwardCommand,
|
@@ -17763,7 +17765,7 @@ export {
|
|
17763
17765
|
Bd as duplicateTransaction,
|
17764
17766
|
nt as fetchAsString,
|
17765
17767
|
zc as findAngle,
|
17766
|
-
|
17768
|
+
$ as findElement,
|
17767
17769
|
Lc as findPmsColors,
|
17768
17770
|
Vt as frameDataCache,
|
17769
17771
|
St as frameStepService,
|