@vived/sandbox 1.4.1 → 1.5.0

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
@@ -6004,7 +6004,7 @@ class $O extends Ah {
6004
6004
  return;
6005
6005
  }
6006
6006
  this.getAssetUC.getAsset(r).then((s) => {
6007
- i(s.fileURL ? s.fileURL : void 0);
6007
+ s.fileURL ? i(s.fileURL) : s.blobURL ? i(s.blobURL) : i(void 0);
6008
6008
  }).catch((s) => {
6009
6009
  this.error(s.message), i(void 0);
6010
6010
  });
@@ -6813,25 +6813,27 @@ class k7 extends Fo {
6813
6813
  return this.getCachedSingleton(St.type);
6814
6814
  }
6815
6815
  constructor(t) {
6816
- super(t, Fo.type), this.saveLocally = () => {
6816
+ super(t, Fo.type), this.copyToClipboard = () => {
6817
6817
  if (!this.stateMachine)
6818
6818
  return;
6819
6819
  const n = [];
6820
- this.stateMachine.states.forEach((a) => {
6821
- var c;
6822
- const o = (c = this.stateMachine) == null ? void 0 : c.getStateByID(a);
6823
- if (o) {
6824
- const u = {
6825
- assets: o.assets,
6826
- data: o.stateData,
6827
- id: o.id,
6828
- name: o.name
6820
+ this.stateMachine.states.forEach((i) => {
6821
+ var a;
6822
+ const s = (a = this.stateMachine) == null ? void 0 : a.getStateByID(i);
6823
+ if (s) {
6824
+ const o = {
6825
+ assets: s.assets,
6826
+ data: s.stateData,
6827
+ id: s.id,
6828
+ name: s.name
6829
6829
  };
6830
- n.push(u);
6830
+ n.push(o);
6831
6831
  }
6832
6832
  });
6833
- const r = JSON.stringify(n), i = document.createElement("a"), s = new Blob([r], { type: "text/plain" });
6834
- i.href = URL.createObjectURL(s), i.download = "persistentStates.json", i.click();
6833
+ const r = JSON.stringify(n);
6834
+ navigator.clipboard.writeText(r).catch((i) => {
6835
+ this.warn(`Unable to copy persistent states to the clipboard: ${i}`);
6836
+ });
6835
6837
  }, this.appObjects.registerSingleton(this);
6836
6838
  }
6837
6839
  }
@@ -7233,7 +7235,7 @@ function iw(e) {
7233
7235
  e.submitWarning("savePersistentStates", "Unable to find SavePersistentStatesUC");
7234
7236
  return;
7235
7237
  }
7236
- t.saveLocally();
7238
+ t.copyToClipboard();
7237
7239
  }
7238
7240
  class sw extends Fr {
7239
7241
  constructor(t) {
@@ -59714,10 +59716,10 @@ const qq = () => {
59714
59716
  variant: "contained",
59715
59717
  size: "small",
59716
59718
  onClick: () => iw(e),
59717
- children: "Save Persistent States"
59719
+ children: "Copy Persistent States"
59718
59720
  }
59719
59721
  ),
59720
- /* @__PURE__ */ O("label", { children: " Replace the file in src/Data with this file " })
59722
+ /* @__PURE__ */ O("label", { children: " Paste into the persistent states file in src/Data " })
59721
59723
  ] });
59722
59724
  }, kd = /* @__PURE__ */ F.createContext(void 0);
59723
59725
  process.env.NODE_ENV !== "production" && (kd.displayName = "FormControlContext");