@spiffcommerce/core 21.13.0-alpha.7 → 21.13.0-alpha.9

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.d.ts CHANGED
@@ -2760,7 +2760,7 @@ declare class FrameStepService implements StepService<FrameStepData> {
2760
2760
  selectImage(stepData: Step<FrameStepData>, asset: Asset, workflowManager: WorkflowManager, recalculateOffsets?: boolean): Promise<void>;
2761
2761
  selectVariant(stepData: Step<FrameStepData>, variant: VariantResource | undefined, elements: RegionElement[], workflowManager: WorkflowManager, setFrameIsUpdating?: (status: boolean) => void): Promise<void>;
2762
2762
  getCreateElementCommand(id: string, region: Region, layout: ILayout, options: FrameCreateOpts): CreateElementCommand<FrameElement>;
2763
- loadPatternFromString(src: string, frameService: FrameService, recalculateOffsets: boolean): Promise<void>;
2763
+ loadPatternFromString(src: string, frameService: FrameService, recalculateOffsets?: boolean): Promise<void>;
2764
2764
  private selectVariantCommand;
2765
2765
  private frameSourceSvg;
2766
2766
  /**
package/dist/index.js CHANGED
@@ -2019,7 +2019,7 @@ class Ra {
2019
2019
  selectImage(e, t, A, a = !0) {
2020
2020
  var o;
2021
2021
  const n = this.patternSource(t), i = (o = A.getStepStorage(e.stepName)) == null ? void 0 : o.framePatternSrc;
2022
- return console.log("selectImage: ", { asset: t, assetSrc: n, existingSrc: i, equals: i === n }), i && i === n ? Promise.resolve() : (console.log("applying image"), A.setEditedStatus(e.stepName, !0), (t.fileLink || "").endsWith("pdf") ? new Promise((r) => {
2022
+ return i && i === n ? Promise.resolve() : (A.setEditedStatus(e.stepName, !0), (t.fileLink || "").endsWith("pdf") ? new Promise((r) => {
2023
2023
  A.addPoller(
2024
2024
  new aA(
2025
2025
  async () => {
@@ -2080,7 +2080,7 @@ class Ra {
2080
2080
  A
2081
2081
  );
2082
2082
  }
2083
- async loadPatternFromString(e, t, A) {
2083
+ async loadPatternFromString(e, t, A = !0) {
2084
2084
  if (e.endsWith("svg")) {
2085
2085
  const a = await SA(e), n = a.width, i = a.height, s = {
2086
2086
  src: e,
@@ -8265,7 +8265,7 @@ class ti extends wt {
8265
8265
  backgroundRemovedAssetKey: a.key,
8266
8266
  useOriginalAsset: !e
8267
8267
  }, o = [e ? A.setAspect(this.property.name, a.key, i) : A.setAspectStorage(this.property.name, i)];
8268
- return e && o.push(this.applyImageSelection(a, void 0, !1)), await Promise.all(o), this.updateSharedStepStorage(i), a;
8268
+ return e && o.push(this.applyImageSelection(a, void 0, !1, !1)), await Promise.all(o), this.updateSharedStepStorage(i), a;
8269
8269
  }
8270
8270
  /**
8271
8271
  * Returns `true` if the state has an image assigned, otherwise `false`.
@@ -8316,7 +8316,7 @@ class ti extends wt {
8316
8316
  useOriginalAsset: e
8317
8317
  }, i = e ? a == null ? void 0 : a.originalAssetKey : a == null ? void 0 : a.backgroundRemovedAssetKey, s = [A.setAspect(this.property.name, i || "", n)];
8318
8318
  if (e)
8319
- s.push(this.applyImageSelection(t, void 0, !1));
8319
+ s.push(this.applyImageSelection(t, void 0, !1, !1));
8320
8320
  else {
8321
8321
  const o = async () => {
8322
8322
  const r = await this.getBackgroundRemovedImage();
@@ -8324,7 +8324,7 @@ class ti extends wt {
8324
8324
  throw new Error(
8325
8325
  "You must call removeBackgroundFromImage before attempting to use that version of the image."
8326
8326
  );
8327
- this.applyImageSelection(r, void 0, !1);
8327
+ this.applyImageSelection(r, void 0, !1, !1);
8328
8328
  };
8329
8329
  s.push(o());
8330
8330
  }
@@ -8338,11 +8338,11 @@ class ti extends wt {
8338
8338
  if (!A)
8339
8339
  return;
8340
8340
  const a = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
8341
- await this.applyImageSelection(A, e, !1), a ? this.updateSharedStepStorage({ ...a }) : (this.updateSharedStepStorage({ originalAssetKey: t }), await this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name, { originalAssetKey: t }));
8341
+ await this.applyImageSelection(A, e, !1, !0), a ? this.updateSharedStepStorage({ ...a }) : (this.updateSharedStepStorage({ originalAssetKey: t }), await this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name, { originalAssetKey: t }));
8342
8342
  }
8343
- async applyImageSelection(e, t, A = !0) {
8344
- const n = this.getSharedSteps(t).map((i) => i.selectImage(e, A, !1));
8345
- await Promise.all(n);
8343
+ async applyImageSelection(e, t, A = !0, a = !0) {
8344
+ const i = this.getSharedSteps(t).map((s) => s.selectImage(e, A, a));
8345
+ await Promise.all(i);
8346
8346
  }
8347
8347
  updateSharedStepStorage(e) {
8348
8348
  this.bundle.getWorkflowExperiences().forEach(