@spiffcommerce/core 44.5.6-alpha.5 → 44.5.6-alpha.7

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 CHANGED
@@ -14,6 +14,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
14
14
  - `Fixed` for any bug fixes.
15
15
  - `Security` in case of vulnerabilities.
16
16
 
17
+ ## [44.6.0] - 27-08-2026
18
+
19
+ ### Added
20
+
21
+ - **Dynamic Workflow Configuration**: New `WorkflowExperience.updateWorkflowConfiguration()` method to dynamically update workflow structure at runtime
22
+ - Supports adding, removing, and changing panels, steps, and step groups
23
+ - Automatically preserves user state and canvas content where possible
24
+ - New `WorkflowExperienceEventType.WorkflowConfigurationChanged` event
25
+
17
26
  ## [44.5.4] - 17-08-2026
18
27
 
19
28
  ### Fixed
@@ -63712,7 +63712,7 @@ const cL = [
63712
63712
  }), i.push(new fi(T, S));
63713
63713
  }
63714
63714
  return console.log(`[handleTextStep] Done with ${i.length} command(s).`), i;
63715
- }, AL = async (r, e, t, n) => {
63715
+ }, AL = async (r, e, t, n, i) => {
63716
63716
  console.log("[generateCommands] Start.", {
63717
63717
  workflowId: e.id,
63718
63718
  designInputStepCount: r.length,
@@ -63722,52 +63722,53 @@ const cL = [
63722
63722
  layoutPanelIds: t.map((s) => s.panelId),
63723
63723
  productOverlayImageUrl: n
63724
63724
  });
63725
- const i = [], a = {};
63725
+ const a = [];
63726
+ i = i ?? {};
63726
63727
  for (const s of r) {
63727
63728
  const o = e.steps.find((u) => u.stepName === s.name);
63728
63729
  if (!o) {
63729
63730
  console.warn(`[generateCommands] No workflow step matching design input step "${s.name}"; skipping.`);
63730
63731
  continue;
63731
63732
  }
63732
- const l = i.length;
63733
+ const l = a.length;
63733
63734
  switch (console.log(`[generateCommands] Handling step "${s.name}" of type ${o.type}.`), o.type) {
63734
63735
  case Je.DigitalContent:
63735
- i.push(
63736
+ a.push(
63736
63737
  ...await dL(t, s, o)
63737
63738
  );
63738
63739
  break;
63739
63740
  case Je.Frame:
63740
63741
  case Je.Photo:
63741
- i.push(
63742
- ...await fL(t, a, s, o)
63742
+ a.push(
63743
+ ...await fL(t, i, s, o)
63743
63744
  );
63744
63745
  break;
63745
63746
  case Je.Illustration:
63746
- i.push(
63747
+ a.push(
63747
63748
  ...await hL(
63748
63749
  t,
63749
- a,
63750
+ i,
63750
63751
  s,
63751
63752
  o
63752
63753
  )
63753
63754
  );
63754
63755
  break;
63755
63756
  case Je.Module:
63756
- i.push(...await pL(t, s, o));
63757
+ a.push(...await pL(t, s, o));
63757
63758
  break;
63758
63759
  case Je.Picture:
63759
- i.push(
63760
- ...await gL(t, a, s, o)
63760
+ a.push(
63761
+ ...await gL(t, i, s, o)
63761
63762
  );
63762
63763
  break;
63763
63764
  case Je.Shape:
63764
- i.push(
63765
- ...await mL(t, a, s, o)
63765
+ a.push(
63766
+ ...await mL(t, i, s, o)
63766
63767
  );
63767
63768
  break;
63768
63769
  case Je.Text:
63769
- i.push(
63770
- ...await yL(t, a, s, o)
63770
+ a.push(
63771
+ ...await yL(t, i, s, o)
63771
63772
  );
63772
63773
  break;
63773
63774
  default:
@@ -63777,35 +63778,35 @@ const cL = [
63777
63778
  break;
63778
63779
  }
63779
63780
  console.log(
63780
- `[generateCommands] Step "${s.name}" produced ${i.length - l} command(s). Running total: ${i.length}.`
63781
+ `[generateCommands] Step "${s.name}" produced ${a.length - l} command(s). Running total: ${a.length}.`
63781
63782
  );
63782
63783
  }
63783
63784
  console.log("[generateCommands] Renderable steps done.", {
63784
- commandCount: i.length,
63785
+ commandCount: a.length,
63785
63786
  stepSelections: Object.fromEntries(
63786
- Object.entries(a).map(([s, o]) => [
63787
+ Object.entries(i).map(([s, o]) => [
63787
63788
  s,
63788
- o.selectedVariants?.map((l) => l.id)
63789
+ JSON.stringify(o)
63789
63790
  ])
63790
63791
  )
63791
63792
  });
63792
63793
  for (const s of e.steps) {
63793
63794
  if (s.type !== Je.SilentIllustration && s.type !== Je.ProductOverlay)
63794
63795
  continue;
63795
- if (!await lo(s, a)) {
63796
+ if (!await lo(s, i)) {
63796
63797
  console.log(
63797
63798
  `[generateCommands] Silent step "${s.stepName}" conditions not satisfied; skipping.`
63798
63799
  );
63799
63800
  continue;
63800
63801
  }
63801
- const o = i.length;
63802
- console.log(`[generateCommands] Handling silent step "${s.stepName}" of type ${s.type}.`), i.push(
63802
+ const o = a.length;
63803
+ console.log(`[generateCommands] Handling silent step "${s.stepName}" of type ${s.type}.`), a.push(
63803
63804
  ...await vL(t, s, n)
63804
63805
  ), console.log(
63805
- `[generateCommands] Silent step "${s.stepName}" produced ${i.length - o} command(s). Running total: ${i.length}.`
63806
+ `[generateCommands] Silent step "${s.stepName}" produced ${a.length - o} command(s). Running total: ${a.length}.`
63806
63807
  );
63807
63808
  }
63808
- return console.log(`[generateCommands] Done with ${i.length} command(s).`), i;
63809
+ return console.log(`[generateCommands] Done with ${a.length} command(s).`), a;
63809
63810
  };
63810
63811
  class bL {
63811
63812
  constructor(e) {
@@ -64868,12 +64869,7 @@ const cU = (r) => r.sort((e, t) => e.index - t.index).map((e) => ({
64868
64869
  f && this.setWorkflow(f);
64869
64870
  }
64870
64871
  async updateWorkflowConfiguration(e) {
64871
- e.panels && await this.updatePanels(e.panels), e.steps && await this.updateSteps(e.steps);
64872
- let t = this.getWorkflowExperience().getWorkflow().stepGroups || [];
64873
- e.stepGroups && (t = await this.updateScenes(e.stepGroups)), this.allScenes = h0({
64874
- ...this.getWorkflowExperience().getWorkflow(),
64875
- stepGroups: t
64876
- }), await this.ensureStepsAreLoaded(), this.renderLayouts(), await this.onSelectionChange();
64872
+ e.panels && await this.updatePanels(e.panels), e.steps && await this.updateSteps(e.steps), this.allScenes = h0(this.getWorkflowExperience().getWorkflow()), await this.ensureStepsAreLoaded(), this.renderLayouts(), await this.onSelectionChange();
64877
64873
  }
64878
64874
  async updatePanels(e) {
64879
64875
  const t = this.experience.getWorkflow();
@@ -64916,20 +64912,6 @@ const cU = (r) => r.sort((e, t) => e.index - t.index).map((e) => ({
64916
64912
  }
64917
64913
  delete this.stepSelections[e], delete this.stepMetadata[e], delete this.storage[e], delete this.stepElements[e], delete this.stepInitialised[e], delete this.stepSpecificServices[e], delete this.mandatorySteps[e], this.validationErrors.steps.delete(e);
64918
64914
  }
64919
- async updateScenes(e) {
64920
- const t = this.experience.getWorkflow();
64921
- if (!t) return [];
64922
- let n = [...t.stepGroups];
64923
- if (e.removed && (n = n.filter((i) => i.id && !e.removed.includes(i.id))), e.changed)
64924
- for (const i of e.changed) {
64925
- const a = i.id || i.name, s = n.findIndex((o) => o.id === a);
64926
- s >= 0 && (n[s] = i);
64927
- }
64928
- if (e.added)
64929
- for (const { item: i, index: a } of e.added)
64930
- n.splice(a, 0, i);
64931
- return n;
64932
- }
64933
64915
  getTemplatingContext() {
64934
64916
  const e = this.experience.getTransaction().recipient, t = { recipient: e };
64935
64917
  return this.recipientConversionConfiguration?.requestedDataItems?.forEach((n) => {
@@ -67539,7 +67521,7 @@ class QT {
67539
67521
  throw new Error("No workflow set");
67540
67522
  e.steps && this.cachedStepHandles.clear();
67541
67523
  const t = this.applyWorkflowChanges(this.workflow, e);
67542
- await this.workflowManager.updateWorkflowConfiguration(e), this.workflow = t, this.callEvent(
67524
+ this.workflow = t, await this.workflowManager.updateWorkflowConfiguration(e), this.callEvent(
67543
67525
  "WorkflowConfigurationChanged"
67544
67526
  /* WorkflowConfigurationChanged */
67545
67527
  );
@@ -72951,7 +72933,7 @@ class rz extends tz {
72951
72933
  });
72952
72934
  }
72953
72935
  async loadEventStreamCapability() {
72954
- const { EventStreamSerde: e, eventStreamSerdeProvider: t } = await import("./index.browser-oJDA3nBL.js"), n = this.resolveEventStreamMarshaller(t);
72936
+ const { EventStreamSerde: e, eventStreamSerdeProvider: t } = await import("./index.browser-DU0RyCIT.js"), n = this.resolveEventStreamMarshaller(t);
72955
72937
  return new e({
72956
72938
  marshaller: n,
72957
72939
  serializer: this.serializer,
@@ -80389,7 +80371,7 @@ class rY {
80389
80371
  } catch (n) {
80390
80372
  throw console.error(n), new so("Critical - Unable to synchronize workflow state with server.");
80391
80373
  }
80392
- }, this.options = e, this.options.applicationKey && X4(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 44.5.6-alpha.4"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
80374
+ }, this.options = e, this.options.applicationKey && X4(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 44.5.6-alpha.6"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
80393
80375
  }
80394
80376
  configure(e) {
80395
80377
  Ps.setHubUrl(e.hubUrl), Ps.setServerUrl(e.serverUrl), Ps.setServicesApiUrl(e.servicesApiUrl), this.marketplaceThemeInstallId = e.marketplaceThemeInstallId, this.marketplaceThemeInstallConfigurationId = e.marketplaceThemeInstallConfigurationId, this.userPoolClientId = e.userPoolClientId, this.userPoolRegion = e.userPoolRegion, this.spiffRegion = e.spiffRegion, e.bearerAuthenticationToken && K4(e.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Ed.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
@@ -80398,7 +80380,7 @@ class rY {
80398
80380
  * @returns The version of the @spiffcommerce/core package that this client is running.
80399
80381
  */
80400
80382
  getVersion() {
80401
- return "44.5.6-alpha.4";
80383
+ return "44.5.6-alpha.6";
80402
80384
  }
80403
80385
  /**
80404
80386
  * @returns The asset manager allows for common operations related to assets
@@ -82544,4 +82526,4 @@ export {
82544
82526
  d9 as y,
82545
82527
  c9 as z
82546
82528
  };
82547
- //# sourceMappingURL=index-BFeXhRxg.js.map
82529
+ //# sourceMappingURL=index-3zc8nilH.js.map