@spiffcommerce/core 27.3.0-beta.39cbc175-4d16-5eeb-9cf8-4e8442e4f73d → 27.3.0-beta.525d3b80-811f-54ad-924f-79a50e9b6e91

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
@@ -9117,7 +9117,7 @@ class xs {
9117
9117
  return f.type === j.Text && ((C = t.globalPropertyAspectConfigurations) == null ? void 0 : C.map((w) => w.aspectName).includes(f.name));
9118
9118
  });
9119
9119
  if (p) {
9120
- console.log("LOG: text reload found aspect");
9120
+ console.log(`LOG: text reload found aspect ${p.name}`);
9121
9121
  const C = m.getGlobalPropertyStateManager().getAspect(p.name);
9122
9122
  if (C)
9123
9123
  if (console.log("LOG: text reload b found aspect text"), o.length === 0 && l) {
@@ -13776,7 +13776,10 @@ class sl extends Ia {
13776
13776
  * Set the text.
13777
13777
  */
13778
13778
  async setText(t) {
13779
- console.log(`LOG: global setting text ${t}`), await this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name, t), await this.applyTextSelection(t);
13779
+ await Promise.all([
13780
+ this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name, t),
13781
+ this.applyTextSelection(t)
13782
+ ]);
13780
13783
  }
13781
13784
  async applyGlobalState(t) {
13782
13785
  const e = this.getStateValue();
@@ -13982,7 +13985,7 @@ class cl {
13982
13985
  return (a = this.globalPropertyState.aspects.find((n) => n.name === t && n.channel === e)) == null ? void 0 : a.storage;
13983
13986
  }
13984
13987
  async setAspect(t, e, a, n) {
13985
- if (!this.globalPropertyState)
13988
+ if (console.log(`LOG: setting aspect ${t} to ${e}`), !this.globalPropertyState)
13986
13989
  throw new Error("Global property state not initialized");
13987
13990
  if (!this.configuration)
13988
13991
  throw new Error("Global property configuration not linked to the state manager.");
@@ -13991,7 +13994,7 @@ class cl {
13991
13994
  throw new Error(`Failed to find configuration aspect with name: ${t}`);
13992
13995
  const s = St(this.globalPropertyState), o = this.globalPropertyState.aspects.filter((l) => l.name === t);
13993
13996
  if (o.length > 0)
13994
- if (n) {
13997
+ if (console.log("LOG: setting aspect if case"), n) {
13995
13998
  const l = o.find((c) => c.channel === n);
13996
13999
  if (l)
13997
14000
  l.value = e, l.type = i.type, l.channel = n, a !== void 0 && (l.storage = a !== null ? a : void 0);
@@ -14009,18 +14012,19 @@ class cl {
14009
14012
  });
14010
14013
  }
14011
14014
  } else {
14015
+ console.log("LOG: setting aspect if case no channel");
14012
14016
  const l = o[0];
14013
- l.value = e, l.type = i.type, a !== void 0 && (l.storage = a !== null ? a : void 0);
14017
+ l.value = e, l.type = i.type, a !== void 0 && (console.log("LOG: setting aspect if case no channel storage"), l.storage = a !== null ? a : void 0);
14014
14018
  }
14015
14019
  else
14016
- this.globalPropertyState.aspects.push({
14020
+ console.log("LOG: setting aspect else case"), this.globalPropertyState.aspects.push({
14017
14021
  name: t,
14018
14022
  value: e,
14019
14023
  type: i.type,
14020
14024
  storage: a !== null ? a : void 0,
14021
14025
  channel: n
14022
14026
  });
14023
- await this.updateGlobalPropertyState(), await this.onGlobalPropertyStateChange(s, this.globalPropertyState);
14027
+ await this.updateGlobalPropertyState(), await this.onGlobalPropertyStateChange(s, this.globalPropertyState), console.log("LOG: setting aspect end");
14024
14028
  }
14025
14029
  async setAspectStorage(t, e, a) {
14026
14030
  if (!this.globalPropertyState)
@@ -14860,6 +14864,10 @@ class Je {
14860
14864
  async applyGlobalPropertyState(t) {
14861
14865
  var a;
14862
14866
  const e = await this.globalPropertyHandleService.getHandles();
14867
+ for (const n of t.aspects) {
14868
+ const i = n == null ? void 0 : n.name;
14869
+ this.getGlobalPropertyStateManager().setAspect(i, n.value), console.log(`LOG: setting aspect ${i} to ${n.value}`);
14870
+ }
14863
14871
  for (const n of t.aspects) {
14864
14872
  const i = n == null ? void 0 : n.name, s = e.find((o) => o.getName() === i);
14865
14873
  if (s)
@@ -15985,7 +15993,7 @@ class Ad {
15985
15993
  } catch (a) {
15986
15994
  throw console.error(a), new ut("Critical - Unable to synchronize workflow state with server.");
15987
15995
  }
15988
- }, this.options = t, this.options.applicationKey && Lr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 27.3.0-beta.496e85e9-64e7-50d6-b532-939e82cd6b86"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15996
+ }, this.options = t, this.options.applicationKey && Lr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 27.3.0-beta.77788c0a-992c-57e3-a34f-017b6df07c6c"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15989
15997
  }
15990
15998
  configure(t) {
15991
15999
  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 && Vr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Ut.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
@@ -16470,7 +16478,7 @@ class Ad {
16470
16478
  * @returns An array of workflow experiences configured as requested.
16471
16479
  */
16472
16480
  async getWorkflowExperiences(t, e) {
16473
- if (t.length === 0)
16481
+ if (console.log("LOG: start of getWorkflowExperiences"), t.length === 0)
16474
16482
  throw new ut("No options provided!");
16475
16483
  const a = B.getShadowGraphqlClient(), n = async (y) => {
16476
16484
  var D, x, k;
@@ -16560,6 +16568,7 @@ class Ad {
16560
16568
  const q = JSON.parse(E.workflowState);
16561
16569
  R.layouts = Object.values(q.layouts || {}).map((ft) => ft.layout), await za(q), R.reloadedState = q;
16562
16570
  } else if (!I && k.workflowState) {
16571
+ console.log(`LOG: reloading with state ${k.workflowState}`);
16563
16572
  const q = JSON.parse(k.workflowState);
16564
16573
  R.layouts = Object.values(q.layouts || {}).map((ft) => ft.layout), await za(q), R.reloadedState = q;
16565
16574
  } else