@agrhub/engine-pixi 1.4.2 → 1.4.4

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.
@@ -68989,7 +68989,7 @@ const it = new tQ(), bo = (r, e) => {
68989
68989
  }
68990
68990
  let c = [];
68991
68991
  s((u) => {
68992
- c = l(u, a);
68992
+ if (c = l(u, a), c.length === 0) return u;
68993
68993
  const h = { ...u };
68994
68994
  if (bo(h, c), [
68995
68995
  "project.select",
@@ -69006,7 +69006,7 @@ const it = new tQ(), bo = (r, e) => {
69006
69006
  future: []
69007
69007
  // Clear redo stack on new command
69008
69008
  };
69009
- }), i(c), n(a), o().recalculateDuration();
69009
+ }), c.length !== 0 && (i(c), n(a), o().recalculateDuration());
69010
69010
  },
69011
69011
  batch: (a) => {
69012
69012
  let l = [];
@@ -69017,14 +69017,14 @@ const it = new tQ(), bo = (r, e) => {
69017
69017
  };
69018
69018
  s((u) => {
69019
69019
  const h = { ...u }, d = [];
69020
- a.forEach((p) => {
69020
+ if (a.forEach((p) => {
69021
69021
  const m = it.get(p.type);
69022
69022
  if (m) {
69023
69023
  const g = m(h, p);
69024
69024
  bo(h, g), l.push(...g), d.push(p);
69025
69025
  } else
69026
69026
  console.warn(`[Core.batch] No handler registered for command: ${p.type}`);
69027
- });
69027
+ }), l.length === 0) return u;
69028
69028
  const f = [
69029
69029
  ...u.history,
69030
69030
  {
@@ -69040,7 +69040,7 @@ const it = new tQ(), bo = (r, e) => {
69040
69040
  history: f,
69041
69041
  future: []
69042
69042
  };
69043
- }), i(l), n(c), o().recalculateDuration();
69043
+ }), l.length !== 0 && (i(l), n(c), o().recalculateDuration());
69044
69044
  },
69045
69045
  undo: () => {
69046
69046
  let a;
@@ -90494,7 +90494,7 @@ class Ore {
90494
90494
  const i = t.path.split("/").filter(Boolean);
90495
90495
  if (i[0] === "clips") {
90496
90496
  const n = i[1];
90497
- t.op === "add" && !i[2] ? await this.handleAddClip(t.value) : t.op === "remove" && !i[2] ? await this.handleRemoveClip(n) : t.op === "update" && await this.handleUpdateClip(n, i.slice(2), t.value);
90497
+ t.op === "add" && !i[2] ? await this.addClipSafely(t.value) : t.op === "remove" && !i[2] ? await this.handleRemoveClip(n) : t.op === "update" && await this.handleUpdateClip(n, i.slice(2), t.value);
90498
90498
  }
90499
90499
  if (i[0] === "tracks" && await this.studio.setTracks(this.core.store.getState().tracks), i[0] === "settings") {
90500
90500
  const n = this.core.store.getState().settings;
@@ -90511,6 +90511,17 @@ class Ore {
90511
90511
  const t = this.getTrackCaptionConfig(e.id);
90512
90512
  return t ? { captionConfig: t } : void 0;
90513
90513
  }
90514
+ /**
90515
+ * One clip that cannot load (unreachable or non-media src) must not abort the rest: the rebuild used to
90516
+ * stop at the first failing clip, leaving the canvas empty/black for every clip after it.
90517
+ */
90518
+ async addClipSafely(e) {
90519
+ try {
90520
+ await this.handleAddClip(e);
90521
+ } catch (t) {
90522
+ console.warn(`[StudioBridge] Skipped clip ${e?.id} (${e?.type}): could not load`, t);
90523
+ }
90524
+ }
90514
90525
  async handleAddClip(e) {
90515
90526
  if (e.type === "Transition")
90516
90527
  await this.studio.addTransition(
@@ -90571,7 +90582,7 @@ class Ore {
90571
90582
  const e = this.core.store.getState();
90572
90583
  this.studio.setSize(e.settings.width, e.settings.height);
90573
90584
  for (const t in e.clips)
90574
- await this.handleAddClip(e.clips[t]);
90585
+ await this.addClipSafely(e.clips[t]);
90575
90586
  this.studio.setTracks(e.tracks), this.syncSelectionToStudio(e.selectedIds), this.studio.updateFrame(e.currentTime);
90576
90587
  } finally {
90577
90588
  this.isSyncing = !1;
@@ -90620,7 +90631,12 @@ class Ore {
90620
90631
  "values"
90621
90632
  ].forEach((a) => {
90622
90633
  let l = t[a];
90623
- if (l === void 0 && (a === "locked" || a === "muted") && (l = !1), l === void 0) return;
90634
+ if (l === void 0 && (a === "locked" || a === "muted") && (l = !1), l === void 0 && (a === "chromaKey" || a === "colorAdjustment")) {
90635
+ const u = e[a];
90636
+ if (!u || u.enabled === !1) return;
90637
+ l = { ...u, enabled: !1 };
90638
+ }
90639
+ if (l === void 0) return;
90624
90640
  const c = e[a];
90625
90641
  c !== l && (typeof c == "number" && typeof l == "number" && Math.abs(c - l) < 0.01 || (a === "style" || a === "values" || a === "caption") && JSON.stringify(c) === JSON.stringify(l) || (Object.assign(e, { [a]: l }), i = !0));
90626
90642
  });