@spiffcommerce/core 21.9.0-alpha.7 → 21.9.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
@@ -3199,6 +3199,7 @@ declare class FrameStepHandle extends StepHandle<FrameStepData> {
3199
3199
  hasOverlayImageUrl(): any;
3200
3200
  getOriginalImageSelection(): Promise<Asset | undefined>;
3201
3201
  getBackgroundRemovedImageSelection(): Promise<Asset | undefined>;
3202
+ hasBackgroundRemovedImageSelection(): boolean;
3202
3203
  getUseOriginalImageSelection(): boolean;
3203
3204
  setUseOriginalImageSelection(value: boolean): Promise<void>;
3204
3205
  }
package/dist/index.js CHANGED
@@ -5341,7 +5341,8 @@ class $a {
5341
5341
  const e = this.getCommandContext().getState();
5342
5342
  if (!e)
5343
5343
  throw new b("Attempted to serialize state before it was initialized.");
5344
- return { transaction: JSON.stringify(this.dehydrateState(le(e.transaction))) };
5344
+ const t = this.dehydrateState(le(e.transaction));
5345
+ return console.log(t), { transaction: JSON.stringify(t) };
5345
5346
  }
5346
5347
  dehydrateState(e) {
5347
5348
  for (const t of Object.values(e.layouts).map((A) => A.elements).flat())
@@ -8209,6 +8210,8 @@ class Xn extends gt {
8209
8210
  if (!A)
8210
8211
  return Promise.resolve();
8211
8212
  await this.applyImageSelection(A, e);
8213
+ const a = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
8214
+ a && this.updateSharedStepStorage(a);
8212
8215
  }
8213
8216
  async applyImageSelection(e, t, A = !0) {
8214
8217
  const n = this.getSharedSteps(t).map((i) => i.selectImage(e, A));
@@ -11198,6 +11201,10 @@ class Si extends W {
11198
11201
  if (e)
11199
11202
  return v.getLocalOrFromServer(e);
11200
11203
  }
11204
+ hasBackgroundRemovedImageSelection() {
11205
+ var e, t;
11206
+ return !!((t = (e = this.manager.getStepStorage(this.step.stepName)) == null ? void 0 : e.framePatternData) != null && t.backgroundRemovedAssetKey);
11207
+ }
11201
11208
  getUseOriginalImageSelection() {
11202
11209
  var e, t;
11203
11210
  return ((t = (e = this.manager.getStepStorage(this.step.stepName)) == null ? void 0 : e.framePatternData) == null ? void 0 : t.useOriginalAsset) ?? !1;
@@ -11211,14 +11218,14 @@ class Si extends W {
11211
11218
  if (!A)
11212
11219
  throw new Error("You must provide an image selection before calling setUseOriginalImageSelection");
11213
11220
  if (e)
11214
- this.selectImage(A, !1);
11221
+ await this.selectImage(A, !1);
11215
11222
  else {
11216
11223
  const n = await this.getBackgroundRemovedImageSelection();
11217
11224
  if (!n)
11218
11225
  throw new Error(
11219
11226
  "You must call removeBackgroundFromImageSelection before attempting to apply the image."
11220
11227
  );
11221
- this.selectImage(n, !1);
11228
+ await this.selectImage(n, !1);
11222
11229
  }
11223
11230
  this.manager.updateStorage(this.step.stepName, {
11224
11231
  framePatternData: { ...t, useOriginalAsset: e }