@spiffcommerce/core 32.2.3-beta.b5a7d626-2f37-53ef-b01b-0ee2a6660230 → 32.2.3

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.mjs CHANGED
@@ -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.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);
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);
14694
14694
  const o = this.productCollection?.globalPropertyConfiguration;
14695
14695
  this.globalConfigurationPropertyId = o?.id, this.globalPropertyStateManager = new ml(
14696
14696
  this.id,
@@ -14834,55 +14834,51 @@ class _e {
14834
14834
  );
14835
14835
  }
14836
14836
  async applyGlobalPropertyState(t) {
14837
- this.updatesLocked = !0;
14838
14837
  const e = await this.globalPropertyHandleService.getHandles();
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;
14862
- }
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;
14838
+ for (const a of t.aspects) {
14839
+ const n = a?.name;
14840
+ this.getGlobalPropertyStateManager().setAspect(n, a.value);
14841
+ }
14842
+ for (const a of t.aspects) {
14843
+ const n = a?.name, i = e.find((s) => s.getName() === n);
14844
+ if (i)
14845
+ switch (a.type) {
14846
+ case $.FileUpload: {
14847
+ const s = i, o = await be([a.value]);
14848
+ o.length > 0 && await s.selectImage(o[0]);
14849
+ const l = a.storage?.colors;
14850
+ if (l) {
14851
+ const c = Object.fromEntries(
14852
+ l.map((d) => [
14853
+ d.key,
14854
+ { browserValue: d.browserValue, pmsValue: d.pmsValue }
14855
+ ]) ?? []
14856
+ );
14857
+ await s.changeColors(c);
14871
14858
  }
14872
- case $.Option: {
14873
- const s = i, l = s.getAllVariants().find((c) => c.getId() === a.value);
14859
+ break;
14860
+ }
14861
+ case $.ColorOption: {
14862
+ const s = i;
14863
+ if (a.type === $.ColorOption) {
14864
+ const l = s.getAllVariants().find((c) => c.getId() === a.value);
14874
14865
  l && await s.selectVariant(l);
14875
- break;
14876
- }
14877
- case $.Text: {
14878
- await i.setText(a.value);
14879
- break;
14880
- }
14866
+ } else
14867
+ s.setCustomColor(a.value);
14868
+ break;
14881
14869
  }
14882
- }
14883
- } finally {
14884
- this.updatesLocked = !1, this.onGlobalPropertiesChanged(void 0, this.globalPropertyStateManager.getGlobalPropertyState());
14870
+ case $.Option: {
14871
+ const s = i, l = s.getAllVariants().find((c) => c.getId() === a.value);
14872
+ l && await s.selectVariant(l);
14873
+ break;
14874
+ }
14875
+ case $.Text: {
14876
+ await i.setText(a.value);
14877
+ break;
14878
+ }
14879
+ }
14885
14880
  }
14881
+ this.checkMandatoryHandlesChanged(void 0, e);
14886
14882
  }
14887
14883
  getGlobalPropertyStateManager() {
14888
14884
  return this.globalPropertyStateManager;
@@ -15350,8 +15346,6 @@ class _e {
15350
15346
  });
15351
15347
  }
15352
15348
  async onGlobalPropertiesChanged(t, e) {
15353
- if (this.updatesLocked)
15354
- return;
15355
15349
  const a = await this.globalPropertyHandleService.getHandles(), n = this.globalPropertyHandleService.applyConditionsFromState(a, t), i = this.globalPropertyHandleService.applyConditionsFromState(a, e);
15356
15350
  this.checkConditionalHandlesChanged(n, i), this.checkMandatoryHandlesChanged(t, i);
15357
15351
  const s = a.map((o) => {