pixelkiln 0.96.0 → 0.96.1

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.cts CHANGED
@@ -23550,12 +23550,6 @@ declare function handEditBases(spec: ResolvedSpec, lock: Lock): Array<{
23550
23550
  declare function handEditBase(spec: ResolvedSpec, lock: Lock): string | null;
23551
23551
  /** The files a declared `source` stands for, in output order; the source itself for a single image. */
23552
23552
  declare function handEditMembers(loaded: LoadedManifest, spec: ResolvedSpec, lock: Lock, editPath: string): HandEditMember[];
23553
- /**
23554
- * Make (or reuse) the edit file for one asset in one style and declare it in
23555
- * the manifest. Idempotent: a second call finds the same file and changes
23556
- * nothing, so "open my edit again" and "start editing" are one action. A
23557
- * set gets one file per member; a member already there is kept.
23558
- */
23559
23553
  declare function startHandEdit(loaded: LoadedManifest, lock: Lock, spec: ResolvedSpec, opts?: {
23560
23554
  expectedSha256?: string;
23561
23555
  }): Promise<HandEditStart>;
package/dist/index.d.ts CHANGED
@@ -23550,12 +23550,6 @@ declare function handEditBases(spec: ResolvedSpec, lock: Lock): Array<{
23550
23550
  declare function handEditBase(spec: ResolvedSpec, lock: Lock): string | null;
23551
23551
  /** The files a declared `source` stands for, in output order; the source itself for a single image. */
23552
23552
  declare function handEditMembers(loaded: LoadedManifest, spec: ResolvedSpec, lock: Lock, editPath: string): HandEditMember[];
23553
- /**
23554
- * Make (or reuse) the edit file for one asset in one style and declare it in
23555
- * the manifest. Idempotent: a second call finds the same file and changes
23556
- * nothing, so "open my edit again" and "start editing" are one action. A
23557
- * set gets one file per member; a member already there is kept.
23558
- */
23559
23553
  declare function startHandEdit(loaded: LoadedManifest, lock: Lock, spec: ResolvedSpec, opts?: {
23560
23554
  expectedSha256?: string;
23561
23555
  }): Promise<HandEditStart>;
package/dist/index.js CHANGED
@@ -18855,7 +18855,27 @@ function handEditMembers(loaded, spec, lock, editPath) {
18855
18855
  }
18856
18856
  return [{ role: null, path: editPath, base: bases?.[0]?.path ?? null }];
18857
18857
  }
18858
+ function refuseUneditable(spec) {
18859
+ const key2 = `${spec.styleId}/${spec.assetId}`;
18860
+ if (spec.derive) {
18861
+ const from = spec.derive.source.kind === "asset" ? spec.derive.source.assetId : spec.derive.source.file;
18862
+ throw new ManifestEditError(
18863
+ `${key2} is derived from ${from} (${spec.derive.transform}), so it has no hand edit of its own; edit its source, or change the derive transform in the manifest`
18864
+ );
18865
+ }
18866
+ if (spec.external) {
18867
+ throw new ManifestEditError(
18868
+ `${key2} is built outside pixelkiln (${spec.external.builder}); change it there, then run pixelkiln adopt --local --force to record the new file`
18869
+ );
18870
+ }
18871
+ if (spec.mirror) {
18872
+ throw new ManifestEditError(
18873
+ `${key2} is a flip of ${spec.mirror.sourceAssetId}, so it has no hand edit of its own; edit ${spec.mirror.sourceAssetId} and flip it again`
18874
+ );
18875
+ }
18876
+ }
18858
18877
  async function startHandEdit(loaded, lock, spec, opts = {}) {
18878
+ refuseUneditable(spec);
18859
18879
  const entry = lock.entries[lockKey(spec.styleId, spec.assetId)];
18860
18880
  if (entry && entry.outputs.length > 1 && !isMemberSetEntry(entry)) {
18861
18881
  throw new ManifestEditError(
@@ -18969,6 +18989,7 @@ async function readHandEditCompanion(editPath) {
18969
18989
  }
18970
18990
  var MAX_HAND_EDIT_BYTES = 16 * 1024 * 1024;
18971
18991
  async function saveHandEdit(loaded, lock, spec, input) {
18992
+ refuseUneditable(spec);
18972
18993
  const entry = lock.entries[lockKey(spec.styleId, spec.assetId)];
18973
18994
  const memberSet = entry ? isMemberSetEntry(entry) : false;
18974
18995
  const incoming = input.frames ?? (input.png ? [{ role: null, png: input.png }] : []);