ponzu 1.78.2 → 1.78.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.
package/dist/chromium.js
CHANGED
|
@@ -14038,6 +14038,8 @@ function motionRuntime() {
|
|
|
14038
14038
|
const root = document.querySelector("[data-artboard]");
|
|
14039
14039
|
const STATES = ["hover", "active", "focus-visible", "focus-within", "focus"];
|
|
14040
14040
|
const ANIMATION_BUDGET = 100;
|
|
14041
|
+
const VIDEO_STALL_MS = 1e4;
|
|
14042
|
+
const stalledVideos = new WeakSet;
|
|
14041
14043
|
let entries = [];
|
|
14042
14044
|
let trigger = "load";
|
|
14043
14045
|
let loadSettled = 0;
|
|
@@ -14254,21 +14256,50 @@ function motionRuntime() {
|
|
|
14254
14256
|
for (const s of svgs())
|
|
14255
14257
|
s.setCurrentTime((base + t) / 1000);
|
|
14256
14258
|
}
|
|
14257
|
-
|
|
14258
|
-
|
|
14259
|
-
await Promise.all(videos().map((v) => new Promise((resolve) => {
|
|
14259
|
+
function seekVideo(v, t) {
|
|
14260
|
+
return new Promise((resolve) => {
|
|
14260
14261
|
const dur = v.duration;
|
|
14261
14262
|
if (!Number.isFinite(dur) || dur <= 0)
|
|
14262
14263
|
return resolve();
|
|
14263
14264
|
const s = (base + t) / 1000;
|
|
14264
|
-
const target = v.loop ? s % dur : Math.min(s, dur);
|
|
14265
|
-
if (Math.abs(v.currentTime - target) < 0.001)
|
|
14265
|
+
const target = v.loop ? (s % dur + dur) % dur : Math.min(Math.max(s, 0), dur);
|
|
14266
|
+
if (Math.abs(v.currentTime - target) < 0.001 && v.readyState >= 2)
|
|
14267
|
+
return resolve();
|
|
14268
|
+
if (stalledVideos.has(v)) {
|
|
14269
|
+
v.currentTime = target;
|
|
14266
14270
|
return resolve();
|
|
14267
|
-
|
|
14268
|
-
|
|
14269
|
-
|
|
14271
|
+
}
|
|
14272
|
+
const from = v.currentTime;
|
|
14273
|
+
let seeked = false;
|
|
14274
|
+
let shown = typeof v.requestVideoFrameCallback !== "function";
|
|
14275
|
+
const done = () => {
|
|
14276
|
+
if (!seeked || !shown)
|
|
14277
|
+
return;
|
|
14278
|
+
clearTimeout(timer);
|
|
14279
|
+
resolve();
|
|
14280
|
+
};
|
|
14281
|
+
const timer = setTimeout(() => {
|
|
14282
|
+
stalledVideos.add(v);
|
|
14283
|
+
resolve();
|
|
14284
|
+
}, VIDEO_STALL_MS);
|
|
14285
|
+
const ours = (media) => media <= target + 0.001 && (seeked || target < from || media > from + 0.001);
|
|
14286
|
+
const drawn = (_now, frame) => {
|
|
14287
|
+
if (!ours(frame.mediaTime))
|
|
14288
|
+
return void v.requestVideoFrameCallback(drawn);
|
|
14289
|
+
shown = true;
|
|
14290
|
+
done();
|
|
14291
|
+
};
|
|
14292
|
+
v.requestVideoFrameCallback?.(drawn);
|
|
14293
|
+
v.addEventListener("seeked", () => {
|
|
14294
|
+
seeked = true;
|
|
14295
|
+
done();
|
|
14296
|
+
}, { once: true });
|
|
14270
14297
|
v.currentTime = target;
|
|
14271
|
-
})
|
|
14298
|
+
});
|
|
14299
|
+
}
|
|
14300
|
+
async function seek(t) {
|
|
14301
|
+
setTime(t);
|
|
14302
|
+
await Promise.all(videos().map((v) => seekVideo(v, t)));
|
|
14272
14303
|
await frame();
|
|
14273
14304
|
return round(now);
|
|
14274
14305
|
}
|
package/dist/index.js
CHANGED
|
@@ -42130,6 +42130,8 @@ function motionRuntime() {
|
|
|
42130
42130
|
const root = document.querySelector("[data-artboard]");
|
|
42131
42131
|
const STATES = ["hover", "active", "focus-visible", "focus-within", "focus"];
|
|
42132
42132
|
const ANIMATION_BUDGET = 100;
|
|
42133
|
+
const VIDEO_STALL_MS = 1e4;
|
|
42134
|
+
const stalledVideos = new WeakSet;
|
|
42133
42135
|
let entries = [];
|
|
42134
42136
|
let trigger = "load";
|
|
42135
42137
|
let loadSettled = 0;
|
|
@@ -42346,21 +42348,50 @@ function motionRuntime() {
|
|
|
42346
42348
|
for (const s of svgs())
|
|
42347
42349
|
s.setCurrentTime((base + t) / 1000);
|
|
42348
42350
|
}
|
|
42349
|
-
|
|
42350
|
-
|
|
42351
|
-
await Promise.all(videos().map((v) => new Promise((resolve) => {
|
|
42351
|
+
function seekVideo(v, t) {
|
|
42352
|
+
return new Promise((resolve) => {
|
|
42352
42353
|
const dur = v.duration;
|
|
42353
42354
|
if (!Number.isFinite(dur) || dur <= 0)
|
|
42354
42355
|
return resolve();
|
|
42355
42356
|
const s = (base + t) / 1000;
|
|
42356
|
-
const target = v.loop ? s % dur : Math.min(s, dur);
|
|
42357
|
-
if (Math.abs(v.currentTime - target) < 0.001)
|
|
42357
|
+
const target = v.loop ? (s % dur + dur) % dur : Math.min(Math.max(s, 0), dur);
|
|
42358
|
+
if (Math.abs(v.currentTime - target) < 0.001 && v.readyState >= 2)
|
|
42358
42359
|
return resolve();
|
|
42359
|
-
|
|
42360
|
-
|
|
42361
|
-
|
|
42360
|
+
if (stalledVideos.has(v)) {
|
|
42361
|
+
v.currentTime = target;
|
|
42362
|
+
return resolve();
|
|
42363
|
+
}
|
|
42364
|
+
const from = v.currentTime;
|
|
42365
|
+
let seeked = false;
|
|
42366
|
+
let shown = typeof v.requestVideoFrameCallback !== "function";
|
|
42367
|
+
const done = () => {
|
|
42368
|
+
if (!seeked || !shown)
|
|
42369
|
+
return;
|
|
42370
|
+
clearTimeout(timer);
|
|
42371
|
+
resolve();
|
|
42372
|
+
};
|
|
42373
|
+
const timer = setTimeout(() => {
|
|
42374
|
+
stalledVideos.add(v);
|
|
42375
|
+
resolve();
|
|
42376
|
+
}, VIDEO_STALL_MS);
|
|
42377
|
+
const ours = (media) => media <= target + 0.001 && (seeked || target < from || media > from + 0.001);
|
|
42378
|
+
const drawn = (_now, frame) => {
|
|
42379
|
+
if (!ours(frame.mediaTime))
|
|
42380
|
+
return void v.requestVideoFrameCallback(drawn);
|
|
42381
|
+
shown = true;
|
|
42382
|
+
done();
|
|
42383
|
+
};
|
|
42384
|
+
v.requestVideoFrameCallback?.(drawn);
|
|
42385
|
+
v.addEventListener("seeked", () => {
|
|
42386
|
+
seeked = true;
|
|
42387
|
+
done();
|
|
42388
|
+
}, { once: true });
|
|
42362
42389
|
v.currentTime = target;
|
|
42363
|
-
})
|
|
42390
|
+
});
|
|
42391
|
+
}
|
|
42392
|
+
async function seek(t) {
|
|
42393
|
+
setTime(t);
|
|
42394
|
+
await Promise.all(videos().map((v) => seekVideo(v, t)));
|
|
42364
42395
|
await frame();
|
|
42365
42396
|
return round(now);
|
|
42366
42397
|
}
|
|
@@ -44809,7 +44840,10 @@ class Design {
|
|
|
44809
44840
|
}
|
|
44810
44841
|
async close() {
|
|
44811
44842
|
this.stopWatching?.();
|
|
44812
|
-
|
|
44843
|
+
for (let saving;saving !== this.saving || this.saveTimer; ) {
|
|
44844
|
+
saving = this.saving;
|
|
44845
|
+
await this.flush();
|
|
44846
|
+
}
|
|
44813
44847
|
this.closed = true;
|
|
44814
44848
|
}
|
|
44815
44849
|
}
|
|
@@ -45180,6 +45214,7 @@ class LocalCatalog {
|
|
|
45180
45214
|
extra = new Set;
|
|
45181
45215
|
foundAt = new Map;
|
|
45182
45216
|
temp;
|
|
45217
|
+
saving = Promise.resolve();
|
|
45183
45218
|
constructor(opts = {}) {
|
|
45184
45219
|
this.opts = opts;
|
|
45185
45220
|
this.db = new CatalogDb(opts.dbFile);
|
|
@@ -45296,6 +45331,9 @@ class LocalCatalog {
|
|
|
45296
45331
|
await this.ready();
|
|
45297
45332
|
await this.discovering;
|
|
45298
45333
|
}
|
|
45334
|
+
async saved() {
|
|
45335
|
+
await this.saving;
|
|
45336
|
+
}
|
|
45299
45337
|
close() {
|
|
45300
45338
|
this.db.close();
|
|
45301
45339
|
}
|
|
@@ -45385,7 +45423,7 @@ class LocalCatalog {
|
|
|
45385
45423
|
return;
|
|
45386
45424
|
this.granted.add(guard);
|
|
45387
45425
|
this.db.grant(guard);
|
|
45388
|
-
this.saveState();
|
|
45426
|
+
this.saving = this.saving.then(() => this.saveState());
|
|
45389
45427
|
}
|
|
45390
45428
|
importState() {
|
|
45391
45429
|
const file = this.opts.stateFile;
|
|
@@ -49938,7 +49976,7 @@ function remoteUpdater(endpoint, token) {
|
|
|
49938
49976
|
// apps/cli/package.json
|
|
49939
49977
|
var package_default = {
|
|
49940
49978
|
name: "ponzu",
|
|
49941
|
-
version: "1.78.
|
|
49979
|
+
version: "1.78.4",
|
|
49942
49980
|
description: "The open source canvas your agent draws on in HTML and CSS.",
|
|
49943
49981
|
type: "module",
|
|
49944
49982
|
license: "MIT",
|