demoman 0.9.4 → 0.9.5
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/THIRD_PARTY_NOTICES +1 -1
- package/dist/cli.mjs +1458 -821
- package/dist/page/decode-probe-entry.js +7 -193
- package/dist/page/mux-entry.js +37 -1
- package/dist/page/render-entry.js +37 -119
- package/dist/recipe.md +4 -4
- package/dist/studio/assets/editor-CJ2FLYuv.js +4 -0
- package/dist/studio/assets/library-1V4zxHu1.js +1 -0
- package/dist/studio/assets/{settings-C8S32Yjl.js → settings-CUfsBYQW.js} +1 -1
- package/dist/studio/assets/{state-nRiGhQ0_.js → state-CAJCdg4W.js} +1 -1
- package/dist/studio/assets/toast-BE4O_wjA.js +72 -0
- package/dist/studio/assets/{view-BAVIEhJQ.js → view-B276ZLOH.js} +1 -1
- package/dist/studio/editor.html +4 -4
- package/dist/studio/library.html +3 -3
- package/dist/studio/settings.html +3 -3
- package/dist/studio/studio-build.json +3 -3
- package/package.json +1 -1
- package/dist/studio/assets/editor-PQAWxnr8.js +0 -4
- package/dist/studio/assets/library-DhAZ4-QM.js +0 -1
- package/dist/studio/assets/toast-D-n2UDmc.js +0 -72
|
@@ -22493,32 +22493,6 @@
|
|
|
22493
22493
|
}
|
|
22494
22494
|
return moves;
|
|
22495
22495
|
}
|
|
22496
|
-
function insideOnly(a, b, w, filmWidth, inset) {
|
|
22497
|
-
const k = b.width / filmWidth;
|
|
22498
|
-
const x0 = w.x * k + inset;
|
|
22499
|
-
const y0 = w.y * k + inset;
|
|
22500
|
-
const x1 = (w.x + w.width) * k - inset;
|
|
22501
|
-
const y1 = (w.y + w.height) * k - inset;
|
|
22502
|
-
const r = Math.max(0, w.radius * k - inset);
|
|
22503
|
-
const rgba = new Uint8ClampedArray(a.rgba);
|
|
22504
|
-
for (let y = 0; y < b.height; y++) {
|
|
22505
|
-
const cy = y + 0.5;
|
|
22506
|
-
if (cy < y0 || cy > y1)
|
|
22507
|
-
continue;
|
|
22508
|
-
for (let x = 0; x < b.width; x++) {
|
|
22509
|
-
const cx = x + 0.5;
|
|
22510
|
-
if (cx < x0 || cx > x1)
|
|
22511
|
-
continue;
|
|
22512
|
-
const dx = cx < x0 + r ? x0 + r - cx : cx > x1 - r ? cx - (x1 - r) : 0;
|
|
22513
|
-
const dy = cy < y0 + r ? y0 + r - cy : cy > y1 - r ? cy - (y1 - r) : 0;
|
|
22514
|
-
if (dx > 0 && dy > 0 && dx * dx + dy * dy > r * r)
|
|
22515
|
-
continue;
|
|
22516
|
-
const p = (y * b.width + x) * 4;
|
|
22517
|
-
rgba.set(b.rgba.subarray(p, p + 4), p);
|
|
22518
|
-
}
|
|
22519
|
-
}
|
|
22520
|
-
return { width: b.width, height: b.height, rgba };
|
|
22521
|
-
}
|
|
22522
22496
|
function changedShare(a, b, look) {
|
|
22523
22497
|
const moves = blockMoves(a, b, look.block);
|
|
22524
22498
|
let changed = 0;
|
|
@@ -22843,125 +22817,8 @@
|
|
|
22843
22817
|
ctx.drawImage(source, 0, 0, width, height);
|
|
22844
22818
|
return { width, height, rgba: ctx.getImageData(0, 0, width, height).data };
|
|
22845
22819
|
}
|
|
22846
|
-
async function
|
|
22847
|
-
|
|
22848
|
-
const res = await fetch(url);
|
|
22849
|
-
if (!res.ok)
|
|
22850
|
-
throw new Error(`${url} answered ${res.status}`);
|
|
22851
|
-
const decoder = new ImageDecoder({ data: await res.arrayBuffer(), type });
|
|
22852
|
-
try {
|
|
22853
|
-
await decoder.tracks.ready;
|
|
22854
|
-
const count = decoder.tracks.selectedTrack?.frameCount ?? 0;
|
|
22855
|
-
if (count === 0)
|
|
22856
|
-
throw new Error(`${url} has no frames`);
|
|
22857
|
-
const ends = [];
|
|
22858
|
-
let w = 0;
|
|
22859
|
-
let h = 0;
|
|
22860
|
-
let end = 0;
|
|
22861
|
-
for (let i = 0; i < count; i++) {
|
|
22862
|
-
const { image } = await decoder.decode({ frameIndex: i });
|
|
22863
|
-
w = image.displayWidth;
|
|
22864
|
-
h = image.displayHeight;
|
|
22865
|
-
end += (image.duration ?? 0) / 1e6;
|
|
22866
|
-
ends.push(end);
|
|
22867
|
-
image.close();
|
|
22868
|
-
}
|
|
22869
|
-
const frame2 = Math.min(...ends.map((e, i) => e - (ends[i - 1] ?? 0)).filter((d) => d > 0));
|
|
22870
|
-
const indexAt = (t) => {
|
|
22871
|
-
const i = ends.findIndex((e) => t < e);
|
|
22872
|
-
return i < 0 ? count - 1 : i;
|
|
22873
|
-
};
|
|
22874
|
-
const drawnAt = async (i) => {
|
|
22875
|
-
const { image } = await decoder.decode({ frameIndex: i });
|
|
22876
|
-
try {
|
|
22877
|
-
return drawnOf(image, w, h, width);
|
|
22878
|
-
} finally {
|
|
22879
|
-
image.close();
|
|
22880
|
-
}
|
|
22881
|
-
};
|
|
22882
|
-
return {
|
|
22883
|
-
width: w,
|
|
22884
|
-
height: h,
|
|
22885
|
-
length: end,
|
|
22886
|
-
frame: frame2,
|
|
22887
|
-
at: async (times) => {
|
|
22888
|
-
const out = [];
|
|
22889
|
-
for (const t of times)
|
|
22890
|
-
out.push(await drawnAt(indexAt(t)));
|
|
22891
|
-
return out;
|
|
22892
|
-
},
|
|
22893
|
-
close: () => decoder.close()
|
|
22894
|
-
};
|
|
22895
|
-
} catch (error) {
|
|
22896
|
-
decoder.close();
|
|
22897
|
-
throw error;
|
|
22898
|
-
}
|
|
22899
|
-
}
|
|
22900
|
-
const input = new Input({
|
|
22901
|
-
source: new UrlSource(url, { getRetryDelay: () => null }),
|
|
22902
|
-
formats: ALL_FORMATS
|
|
22903
|
-
});
|
|
22904
|
-
const track = await input.getPrimaryVideoTrack();
|
|
22905
|
-
if (track === null)
|
|
22906
|
-
throw new Error(`${url} has no video track`);
|
|
22907
|
-
if (!await track.canDecode()) {
|
|
22908
|
-
throw new Error(`${url}'s video track (${track.codec ?? "unknown codec"}) cannot be decoded in this browser`);
|
|
22909
|
-
}
|
|
22910
|
-
const length = await input.computeDuration();
|
|
22911
|
-
const rate = (await track.computePacketStats()).averagePacketRate;
|
|
22912
|
-
const frame = rate > 0 ? 1 / rate : 1 / 30;
|
|
22913
|
-
const at = async (times) => {
|
|
22914
|
-
const drawn = [];
|
|
22915
|
-
for await (const wrapped of new CanvasSink(track).canvasesAtTimestamps(times)) {
|
|
22916
|
-
const t = times[drawn.length];
|
|
22917
|
-
if (!wrapped)
|
|
22918
|
-
throw new Error(`no frame decoded at ${t.toFixed(3)}s`);
|
|
22919
|
-
const c = wrapped.canvas;
|
|
22920
|
-
drawn.push(drawnOf(c, c.width, c.height, width));
|
|
22921
|
-
}
|
|
22922
|
-
return drawn;
|
|
22923
|
-
};
|
|
22924
|
-
return {
|
|
22925
|
-
width: track.displayWidth,
|
|
22926
|
-
height: track.displayHeight,
|
|
22927
|
-
length,
|
|
22928
|
-
frame,
|
|
22929
|
-
at,
|
|
22930
|
-
close: () => input.dispose()
|
|
22931
|
-
};
|
|
22932
|
-
}
|
|
22933
|
-
async function screensDiff(urlA, urlB, type, msA, msB, windows, o) {
|
|
22934
|
-
try {
|
|
22935
|
-
const ra = await blamed("a", urlA, type, o.width);
|
|
22936
|
-
try {
|
|
22937
|
-
const rb = await blamed("b", urlB, type, o.width);
|
|
22938
|
-
try {
|
|
22939
|
-
return await diffOf(ra, rb, msA, msB, windows, o);
|
|
22940
|
-
} finally {
|
|
22941
|
-
rb.close();
|
|
22942
|
-
}
|
|
22943
|
-
} finally {
|
|
22944
|
-
ra.close();
|
|
22945
|
-
}
|
|
22946
|
-
} catch (error) {
|
|
22947
|
-
if (error instanceof Unreadable)
|
|
22948
|
-
return { unreadable: error.side, error: error.message };
|
|
22949
|
-
throw error;
|
|
22950
|
-
}
|
|
22951
|
-
}
|
|
22952
|
-
async function imagesDiff(urlsA, urlsB, sizeA, sizeB, windows, o) {
|
|
22953
|
-
const file = (size) => ({
|
|
22954
|
-
...size,
|
|
22955
|
-
length: 0,
|
|
22956
|
-
frame: 0
|
|
22957
|
-
});
|
|
22958
|
-
const answer = {
|
|
22959
|
-
a: file(sizeA),
|
|
22960
|
-
b: file(sizeB),
|
|
22961
|
-
changed: []
|
|
22962
|
-
};
|
|
22963
|
-
if (sizeA.width !== sizeB.width || sizeA.height !== sizeB.height)
|
|
22964
|
-
return answer;
|
|
22820
|
+
async function imagesDiff(urlsA, urlsB, looks) {
|
|
22821
|
+
const answer = { changed: [] };
|
|
22965
22822
|
const read = async (side, url) => {
|
|
22966
22823
|
try {
|
|
22967
22824
|
const res = await fetch(url);
|
|
@@ -22969,7 +22826,7 @@
|
|
|
22969
22826
|
throw new Error(`answered ${res.status}`);
|
|
22970
22827
|
const bitmap = await createImageBitmap(await res.blob());
|
|
22971
22828
|
try {
|
|
22972
|
-
return drawnOf(bitmap, bitmap.width, bitmap.height,
|
|
22829
|
+
return drawnOf(bitmap, bitmap.width, bitmap.height, bitmap.width);
|
|
22973
22830
|
} finally {
|
|
22974
22831
|
bitmap.close();
|
|
22975
22832
|
}
|
|
@@ -22980,10 +22837,10 @@
|
|
|
22980
22837
|
try {
|
|
22981
22838
|
for (const [i, urlA] of urlsA.entries()) {
|
|
22982
22839
|
const da = await read("a", urlA);
|
|
22983
|
-
const
|
|
22984
|
-
|
|
22985
|
-
|
|
22986
|
-
answer.changed.push(
|
|
22840
|
+
const db = await read("b", urlsB[i]);
|
|
22841
|
+
if (da.width !== db.width || da.height !== db.height)
|
|
22842
|
+
throw new Error(`${urlA} is ${da.width}x${da.height} and ${urlsB[i]} ${db.width}x${db.height}: images of two sizes are not compared`);
|
|
22843
|
+
answer.changed.push(looks.map((look) => changedShare(da, db, look)));
|
|
22987
22844
|
}
|
|
22988
22845
|
} catch (error) {
|
|
22989
22846
|
if (error instanceof Unreadable)
|
|
@@ -22999,48 +22856,6 @@
|
|
|
22999
22856
|
this.side = side;
|
|
23000
22857
|
}
|
|
23001
22858
|
};
|
|
23002
|
-
async function blamed(side, url, type, width) {
|
|
23003
|
-
const blame = (p) => p.catch((error) => {
|
|
23004
|
-
throw new Unreadable(side, error);
|
|
23005
|
-
});
|
|
23006
|
-
const r = await blame(pictureReader(url, type, width));
|
|
23007
|
-
return {
|
|
23008
|
-
...r,
|
|
23009
|
-
at: (times) => blame(r.at(times))
|
|
23010
|
-
};
|
|
23011
|
-
}
|
|
23012
|
-
async function diffOf(ra, rb, msA, msB, windows, o) {
|
|
23013
|
-
const file = (r) => ({
|
|
23014
|
-
width: r.width,
|
|
23015
|
-
height: r.height,
|
|
23016
|
-
length: r.length,
|
|
23017
|
-
frame: r.frame
|
|
23018
|
-
});
|
|
23019
|
-
const answer = {
|
|
23020
|
-
a: file(ra),
|
|
23021
|
-
b: file(rb),
|
|
23022
|
-
changed: []
|
|
23023
|
-
};
|
|
23024
|
-
if (ra.width !== rb.width || ra.height !== rb.height)
|
|
23025
|
-
return answer;
|
|
23026
|
-
const within = (r, ms) => ms / 1e3 < r.length;
|
|
23027
|
-
const keep = msA.map((a, i) => within(ra, a) && within(rb, msB[i]) ? i : -1);
|
|
23028
|
-
const ids = keep.filter((i) => i >= 0);
|
|
23029
|
-
const ga = await ra.at(ids.map((i) => msA[i] / 1e3));
|
|
23030
|
-
const gb = await rb.at(ids.map((i) => msB[i] / 1e3));
|
|
23031
|
-
for (const i of msA.keys()) {
|
|
23032
|
-
const k = ids.indexOf(i);
|
|
23033
|
-
if (k < 0) {
|
|
23034
|
-
answer.changed.push(null);
|
|
23035
|
-
continue;
|
|
23036
|
-
}
|
|
23037
|
-
const da = ga[k];
|
|
23038
|
-
const w = windows[i] ?? null;
|
|
23039
|
-
const db = w === null ? gb[k] : insideOnly(da, gb[k], w, rb.width, o.inset);
|
|
23040
|
-
answer.changed.push(o.looks.map((look) => changedShare(da, db, look)));
|
|
23041
|
-
}
|
|
23042
|
-
return answer;
|
|
23043
|
-
}
|
|
23044
22859
|
function meanAbsoluteDifference(a, b) {
|
|
23045
22860
|
let sum = 0;
|
|
23046
22861
|
for (let p = 0; p < a.length; p += 4) {
|
|
@@ -23049,7 +22864,6 @@
|
|
|
23049
22864
|
return sum / (a.length / 4 * 3);
|
|
23050
22865
|
}
|
|
23051
22866
|
var entry = {
|
|
23052
|
-
screensDiff,
|
|
23053
22867
|
imagesDiff,
|
|
23054
22868
|
decodeFrame,
|
|
23055
22869
|
readCrops,
|
package/dist/page/mux-entry.js
CHANGED
|
@@ -15416,6 +15416,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15416
15416
|
pressMs: external_exports.number().nonnegative(),
|
|
15417
15417
|
releaseMs: external_exports.number().nonnegative()
|
|
15418
15418
|
});
|
|
15419
|
+
var PageScreenSchema = external_exports.object({
|
|
15420
|
+
after: external_exports.number().int().min(0),
|
|
15421
|
+
sourceTimeMs: external_exports.number(),
|
|
15422
|
+
ref: external_exports.string(),
|
|
15423
|
+
width: external_exports.number().int().positive(),
|
|
15424
|
+
height: external_exports.number().int().positive(),
|
|
15425
|
+
heldAnimations: external_exports.number().int().min(0),
|
|
15426
|
+
waitedMs: external_exports.number().min(0),
|
|
15427
|
+
unsettled: external_exports.string().optional()
|
|
15428
|
+
}).refine((s) => s.ref !== "" || s.unsettled !== void 0, {
|
|
15429
|
+
message: 'a page screen with no bytes (ref "") must say why in `unsettled`',
|
|
15430
|
+
path: ["unsettled"]
|
|
15431
|
+
});
|
|
15419
15432
|
var ViewportTransformSchema = external_exports.object({
|
|
15420
15433
|
sourceTimeMs: external_exports.number().nonnegative(),
|
|
15421
15434
|
scale: external_exports.number().positive(),
|
|
@@ -15541,7 +15554,27 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15541
15554
|
// A native drag's picture could not be drawn in the page (the element
|
|
15542
15555
|
// the page named for it was gone, or copying it threw). The drag still
|
|
15543
15556
|
// ran; the film shows the card jump to its drop instead of travelling.
|
|
15544
|
-
"dragPictureMissing"
|
|
15557
|
+
"dragPictureMissing",
|
|
15558
|
+
// A step's page had not settled when the cap ran out (requests in
|
|
15559
|
+
// flight, an animation running, the DOM still changing) or showed a
|
|
15560
|
+
// caret it would not hide: the page's own doing. The video is
|
|
15561
|
+
// unaffected; refresh cannot compare that screen. The note names the
|
|
15562
|
+
// step and the conditions.
|
|
15563
|
+
"stepUnsettled",
|
|
15564
|
+
// As `stepUnsettled`, but at least one condition was this machine's:
|
|
15565
|
+
// the first paint never came, the settle probe or the page screen
|
|
15566
|
+
// failed, requests could not be watched. Recording again may change
|
|
15567
|
+
// it, so refresh does (DEM-55); the note names the step and the
|
|
15568
|
+
// conditions, the page's beside the machine's.
|
|
15569
|
+
"stepSettleFailed",
|
|
15570
|
+
// A step's settle left out a request open since more than a request cap
|
|
15571
|
+
// before the step began (a long poll): its own step waited for it. The
|
|
15572
|
+
// screen counts as settled; the note names the step and how many.
|
|
15573
|
+
"requestNotWaited",
|
|
15574
|
+
// A page screen's hold (caret hidden, endless animations held) could not
|
|
15575
|
+
// be undone after the capture: the video after that step may show no
|
|
15576
|
+
// caret and frozen spinners. About the video, so not forgiven.
|
|
15577
|
+
"pageHoldNotReleased"
|
|
15545
15578
|
]),
|
|
15546
15579
|
note: external_exports.string()
|
|
15547
15580
|
});
|
|
@@ -15603,6 +15636,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15603
15636
|
// 2026-10-11 carries none, and identity is what they were drawn as.
|
|
15604
15637
|
// See `ViewportTransformSchema`.
|
|
15605
15638
|
viewportTransforms: external_exports.array(ViewportTransformSchema).optional(),
|
|
15639
|
+
// Optional, and absent is none: a sampled replay, a capture, and every
|
|
15640
|
+
// bundle written before 2026-11-10 carry none.
|
|
15641
|
+
pageScreens: external_exports.array(PageScreenSchema).optional(),
|
|
15606
15642
|
markers: external_exports.array(MarkerSchema),
|
|
15607
15643
|
degradations: external_exports.array(DegradationSchema),
|
|
15608
15644
|
/**
|
|
@@ -15416,6 +15416,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15416
15416
|
pressMs: external_exports.number().nonnegative(),
|
|
15417
15417
|
releaseMs: external_exports.number().nonnegative()
|
|
15418
15418
|
});
|
|
15419
|
+
var PageScreenSchema = external_exports.object({
|
|
15420
|
+
after: external_exports.number().int().min(0),
|
|
15421
|
+
sourceTimeMs: external_exports.number(),
|
|
15422
|
+
ref: external_exports.string(),
|
|
15423
|
+
width: external_exports.number().int().positive(),
|
|
15424
|
+
height: external_exports.number().int().positive(),
|
|
15425
|
+
heldAnimations: external_exports.number().int().min(0),
|
|
15426
|
+
waitedMs: external_exports.number().min(0),
|
|
15427
|
+
unsettled: external_exports.string().optional()
|
|
15428
|
+
}).refine((s) => s.ref !== "" || s.unsettled !== void 0, {
|
|
15429
|
+
message: 'a page screen with no bytes (ref "") must say why in `unsettled`',
|
|
15430
|
+
path: ["unsettled"]
|
|
15431
|
+
});
|
|
15419
15432
|
var ViewportTransformSchema = external_exports.object({
|
|
15420
15433
|
sourceTimeMs: external_exports.number().nonnegative(),
|
|
15421
15434
|
scale: external_exports.number().positive(),
|
|
@@ -15541,7 +15554,27 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15541
15554
|
// A native drag's picture could not be drawn in the page (the element
|
|
15542
15555
|
// the page named for it was gone, or copying it threw). The drag still
|
|
15543
15556
|
// ran; the film shows the card jump to its drop instead of travelling.
|
|
15544
|
-
"dragPictureMissing"
|
|
15557
|
+
"dragPictureMissing",
|
|
15558
|
+
// A step's page had not settled when the cap ran out (requests in
|
|
15559
|
+
// flight, an animation running, the DOM still changing) or showed a
|
|
15560
|
+
// caret it would not hide: the page's own doing. The video is
|
|
15561
|
+
// unaffected; refresh cannot compare that screen. The note names the
|
|
15562
|
+
// step and the conditions.
|
|
15563
|
+
"stepUnsettled",
|
|
15564
|
+
// As `stepUnsettled`, but at least one condition was this machine's:
|
|
15565
|
+
// the first paint never came, the settle probe or the page screen
|
|
15566
|
+
// failed, requests could not be watched. Recording again may change
|
|
15567
|
+
// it, so refresh does (DEM-55); the note names the step and the
|
|
15568
|
+
// conditions, the page's beside the machine's.
|
|
15569
|
+
"stepSettleFailed",
|
|
15570
|
+
// A step's settle left out a request open since more than a request cap
|
|
15571
|
+
// before the step began (a long poll): its own step waited for it. The
|
|
15572
|
+
// screen counts as settled; the note names the step and how many.
|
|
15573
|
+
"requestNotWaited",
|
|
15574
|
+
// A page screen's hold (caret hidden, endless animations held) could not
|
|
15575
|
+
// be undone after the capture: the video after that step may show no
|
|
15576
|
+
// caret and frozen spinners. About the video, so not forgiven.
|
|
15577
|
+
"pageHoldNotReleased"
|
|
15545
15578
|
]),
|
|
15546
15579
|
note: external_exports.string()
|
|
15547
15580
|
});
|
|
@@ -15603,6 +15636,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15603
15636
|
// 2026-10-11 carries none, and identity is what they were drawn as.
|
|
15604
15637
|
// See `ViewportTransformSchema`.
|
|
15605
15638
|
viewportTransforms: external_exports.array(ViewportTransformSchema).optional(),
|
|
15639
|
+
// Optional, and absent is none: a sampled replay, a capture, and every
|
|
15640
|
+
// bundle written before 2026-11-10 carry none.
|
|
15641
|
+
pageScreens: external_exports.array(PageScreenSchema).optional(),
|
|
15606
15642
|
markers: external_exports.array(MarkerSchema),
|
|
15607
15643
|
degradations: external_exports.array(DegradationSchema),
|
|
15608
15644
|
/**
|
|
@@ -48150,55 +48186,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
48150
48186
|
})
|
|
48151
48187
|
};
|
|
48152
48188
|
}
|
|
48153
|
-
async function renderScreens(args) {
|
|
48154
|
-
const { plan, bundle, scene, target, ports } = args;
|
|
48155
|
-
const { logo = null, wallpaper = null } = args;
|
|
48156
|
-
const sink = ports.images;
|
|
48157
|
-
if (!sink)
|
|
48158
|
-
throw new Error("renderScreens needs an image sink");
|
|
48159
|
-
const { resolved, presentation, violations } = await composeLikeRender({
|
|
48160
|
-
plan,
|
|
48161
|
-
bundle,
|
|
48162
|
-
scene,
|
|
48163
|
-
target,
|
|
48164
|
-
ports,
|
|
48165
|
-
logo,
|
|
48166
|
-
wallpaper
|
|
48167
|
-
});
|
|
48168
|
-
const { startMs } = resolved.range;
|
|
48169
|
-
const screens = screensWithWindows(resolved, presentation, target, scene, bundle, startMs);
|
|
48170
|
-
const canvas = ports.surface.create(target.width, target.height);
|
|
48171
|
-
const ctx = canvas.getContext("2d");
|
|
48172
|
-
for (const [i, m] of screens.moments.entries()) {
|
|
48173
|
-
const outputTimeMs = startMs + m.ms;
|
|
48174
|
-
const image = await ports.frames.at(toSourceMs(resolved.timeline, outputTimeMs));
|
|
48175
|
-
await renderFrame({
|
|
48176
|
-
resolved,
|
|
48177
|
-
target,
|
|
48178
|
-
presentation,
|
|
48179
|
-
frames: {
|
|
48180
|
-
at: async () => image,
|
|
48181
|
-
describe: () => ports.frames.describe()
|
|
48182
|
-
},
|
|
48183
|
-
ctx,
|
|
48184
|
-
outputTimeMs
|
|
48185
|
-
});
|
|
48186
|
-
await sink.add(canvas, `screen-${i}.png`);
|
|
48187
|
-
}
|
|
48188
|
-
const files = await sink.finish();
|
|
48189
|
-
if (files.length !== screens.moments.length) {
|
|
48190
|
-
throw new Error(`${screens.moments.length} screens drawn but the image sink returned ${files.length} files`);
|
|
48191
|
-
}
|
|
48192
|
-
return {
|
|
48193
|
-
screens,
|
|
48194
|
-
images: screens.moments.map((m, i) => ({
|
|
48195
|
-
step: m.step,
|
|
48196
|
-
bytes: files[i].bytes
|
|
48197
|
-
})),
|
|
48198
|
-
detailViolations: violations,
|
|
48199
|
-
unavailableSpans: ports.frames.unavailable?.() ?? []
|
|
48200
|
-
};
|
|
48201
|
-
}
|
|
48202
48189
|
function stillSourceMs(bundle, marker) {
|
|
48203
48190
|
const keyframe = bundle.keyframes.find((k) => k.actionId === marker.actionId);
|
|
48204
48191
|
return keyframe ? keyframe.sourceTimeMs : marker.sourceTimeMs;
|
|
@@ -48585,25 +48572,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
48585
48572
|
return true;
|
|
48586
48573
|
});
|
|
48587
48574
|
}
|
|
48588
|
-
function screenImageName(step) {
|
|
48589
|
-
return step === null ? "final.png" : `step-${step}.png`;
|
|
48590
|
-
}
|
|
48591
|
-
async function scaledPng(bytes2, width) {
|
|
48592
|
-
const bitmap = await createImageBitmap(new Blob([bytes2]));
|
|
48593
|
-
try {
|
|
48594
|
-
const canvas = new OffscreenCanvas(width, Math.round(bitmap.height * width / bitmap.width));
|
|
48595
|
-
canvas.getContext("2d").drawImage(bitmap, 0, 0, canvas.width, canvas.height);
|
|
48596
|
-
const blob = await canvas.convertToBlob({ type: "image/png" });
|
|
48597
|
-
return new Uint8Array(await blob.arrayBuffer());
|
|
48598
|
-
} finally {
|
|
48599
|
-
bitmap.close();
|
|
48600
|
-
}
|
|
48601
|
-
}
|
|
48602
48575
|
async function renderOutput(input) {
|
|
48603
48576
|
const { fileType, target, scene, bundle, frames, onFrame } = input;
|
|
48604
|
-
if (input.screensOnly !== void 0 && fileType === "stills") {
|
|
48605
|
-
throw new Error("screensOnly applies to an mp4 or gif output, not stills");
|
|
48606
|
-
}
|
|
48607
48577
|
const logoAt = async (at2) => {
|
|
48608
48578
|
if (input.logo === null)
|
|
48609
48579
|
return { logo: null, logoWarning: null };
|
|
@@ -48767,57 +48737,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
48767
48737
|
}
|
|
48768
48738
|
};
|
|
48769
48739
|
}
|
|
48770
|
-
if (input.screensOnly !== void 0) {
|
|
48771
|
-
const { width } = input.screensOnly;
|
|
48772
|
-
const { logo, logoWarning: logoWarning2 } = await logoAt(target);
|
|
48773
|
-
const wallpaper = await wallpaperAt(target);
|
|
48774
|
-
let result2;
|
|
48775
|
-
try {
|
|
48776
|
-
result2 = await renderScreens({
|
|
48777
|
-
plan,
|
|
48778
|
-
bundle,
|
|
48779
|
-
scene,
|
|
48780
|
-
target,
|
|
48781
|
-
ports: { frames, surface, images: createPngSink() },
|
|
48782
|
-
logo,
|
|
48783
|
-
wallpaper: wallpaper.image
|
|
48784
|
-
});
|
|
48785
|
-
} finally {
|
|
48786
|
-
release(wallpaper.image, wallpaper.held ?? null);
|
|
48787
|
-
}
|
|
48788
|
-
const deepest = input.wallpaper?.ok !== true ? 1 : composeForTarget({
|
|
48789
|
-
plan,
|
|
48790
|
-
bundle,
|
|
48791
|
-
scene,
|
|
48792
|
-
target
|
|
48793
|
-
}).resolved.cameraKeys.reduce((m, k) => Math.max(m, k.scale), 1);
|
|
48794
|
-
const files = [];
|
|
48795
|
-
for (const image of result2.images) {
|
|
48796
|
-
files.push({
|
|
48797
|
-
name: screenImageName(image.step),
|
|
48798
|
-
bytes: await scaledPng(image.bytes, width)
|
|
48799
|
-
});
|
|
48800
|
-
}
|
|
48801
|
-
return {
|
|
48802
|
-
files,
|
|
48803
|
-
facts: {
|
|
48804
|
-
detailViolations: result2.detailViolations,
|
|
48805
|
-
unavailableSpans: [...result2.unavailableSpans, ...reclaimed],
|
|
48806
|
-
unplacedStills: [],
|
|
48807
|
-
loweredZooms: [],
|
|
48808
|
-
logoWarning: logoWarning2,
|
|
48809
|
-
wallpaperWarning: wallpaperWarning(target, deepest, wallpaper.failed),
|
|
48810
|
-
clampedRanges: [],
|
|
48811
|
-
// The target's own size: the screens' windows are measured in it.
|
|
48812
|
-
rendered: {
|
|
48813
|
-
width: target.width,
|
|
48814
|
-
height: target.height,
|
|
48815
|
-
fps: target.fps
|
|
48816
|
-
},
|
|
48817
|
-
screens: result2.screens
|
|
48818
|
-
}
|
|
48819
|
-
};
|
|
48820
|
-
}
|
|
48821
48740
|
const renderAt = async (at2, maxBytes, saysWidth = false, pass) => {
|
|
48822
48741
|
const { logo, logoWarning: logoWarning2 } = await logoAt(at2);
|
|
48823
48742
|
const wallpaper = await wallpaperAt(at2);
|
|
@@ -49213,7 +49132,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
49213
49132
|
},
|
|
49214
49133
|
...manifest.stills === void 0 ? {} : { stills: manifest.stills },
|
|
49215
49134
|
...manifest.outputTimesMs === void 0 ? {} : { outputTimesMs: manifest.outputTimesMs },
|
|
49216
|
-
...manifest.screensOnly === void 0 ? {} : { screensOnly: manifest.screensOnly },
|
|
49217
49135
|
onFrame: wholePercent((done, total, width, pass) => width === void 0 ? report?.(done, total) : pass === void 0 ? report?.(done, total, width) : report?.(done, total, width, pass))
|
|
49218
49136
|
// The decoded image is freed once every output is rendered: the GIF
|
|
49219
49137
|
// ladder and the MP4 cap re-render inside this call.
|
package/dist/recipe.md
CHANGED
|
@@ -277,10 +277,10 @@ A flow in the repo (.demoman/flows) is rewritten by each run: commit that file w
|
|
|
277
277
|
sign-in page. `notStored` with `what: "session"` means the saved
|
|
278
278
|
session could not be refreshed: name it to the user.
|
|
279
279
|
- `threw` - a fault in the run; report its `error`.
|
|
280
|
-
- Then read `frames.degradations` and `frames.storageRefused
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
280
|
+
- Then read `frames.degradations` and `frames.storageRefused`, about the
|
|
281
|
+
video (`surfaceMismatch`: wrong-size frames; `dragPictureMissing`: a
|
|
282
|
+
drag's item jumps) or refresh screens (`step*`, `requestNotWaited`), not
|
|
283
|
+
the script. `notDragged`: a drag did nothing; `verdict.diverged` lists
|
|
284
284
|
it. Name them to the user; spend no run. `clickUnconfirmed` is about a step: a click
|
|
285
285
|
could not be confirmed to have reached its target, and
|
|
286
286
|
`frames.unconfirmedClicks` names each such step and says why; check in
|