hyperframes 0.7.65 → 0.7.67-alpha.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/cli.js +22 -12
- package/dist/hyperframes-player.global.js +1 -1
- package/dist/studio/assets/{hyperframes-player-D2zuA3cx.js → hyperframes-player-Dn2qHIaT.js} +1 -1
- package/dist/studio/assets/{index-hLCqiyjx.js → index-CI5umBCI.js} +1 -1
- package/dist/studio/assets/{index-BqX4YLnH.js → index-GOjhPhg7.js} +117 -117
- package/dist/studio/assets/{index-DwwsYjuk.js → index-KTfHoyE5.js} +1 -1
- package/dist/studio/index.html +1 -1
- package/dist/studio/index.js +2515 -2530
- package/dist/studio/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -50,7 +50,7 @@ var VERSION;
|
|
|
50
50
|
var init_version = __esm({
|
|
51
51
|
"src/version.ts"() {
|
|
52
52
|
"use strict";
|
|
53
|
-
VERSION = true ? "0.7.
|
|
53
|
+
VERSION = true ? "0.7.67-alpha.0" : "0.0.0-dev";
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
56
|
|
|
@@ -79834,6 +79834,13 @@ function expectedFramesForTask(task) {
|
|
|
79834
79834
|
function synthesizeSilentWorkerExitError(result, expectedFrames) {
|
|
79835
79835
|
return `worker ${result.workerId} exited without terminal error string (framesCaptured=${result.framesCaptured}, expected=${expectedFrames}, range=[${result.startFrame}, ${result.endFrame})). Field signal ts=1784042064 \u2014 this class of failure has been reported; consider re-run with --workers=1 to isolate.`;
|
|
79836
79836
|
}
|
|
79837
|
+
function flagSilentWorkerExits(results) {
|
|
79838
|
+
for (const r2 of results) {
|
|
79839
|
+
if (!r2.error && r2.framesCaptured < expectedFramesForTask(r2)) {
|
|
79840
|
+
r2.error = synthesizeSilentWorkerExitError(r2, expectedFramesForTask(r2));
|
|
79841
|
+
}
|
|
79842
|
+
}
|
|
79843
|
+
}
|
|
79837
79844
|
function formatWorkerFailure(result) {
|
|
79838
79845
|
const errorText = result.error && result.error.length > 0 ? result.error : synthesizeSilentWorkerExitError(result, expectedFramesForTask(result));
|
|
79839
79846
|
const base2 = `Worker ${result.workerId}: ${errorText}`;
|
|
@@ -80025,6 +80032,7 @@ async function executeWorkerTask(task, serverUrl, captureOptions, createBeforeCa
|
|
|
80025
80032
|
framesCaptured,
|
|
80026
80033
|
startFrame: task.startFrame,
|
|
80027
80034
|
endFrame: task.endFrame,
|
|
80035
|
+
frameStride: task.frameStride,
|
|
80028
80036
|
durationMs: Date.now() - startTime,
|
|
80029
80037
|
perf
|
|
80030
80038
|
};
|
|
@@ -80047,6 +80055,7 @@ async function executeWorkerTask(task, serverUrl, captureOptions, createBeforeCa
|
|
|
80047
80055
|
framesCaptured,
|
|
80048
80056
|
startFrame: task.startFrame,
|
|
80049
80057
|
endFrame: task.endFrame,
|
|
80058
|
+
frameStride: task.frameStride,
|
|
80050
80059
|
durationMs: Date.now() - startTime,
|
|
80051
80060
|
perf,
|
|
80052
80061
|
error: failure.message,
|
|
@@ -80113,11 +80122,7 @@ async function executeParallelCapture(serverUrl, workDir, tasks, captureOptions,
|
|
|
80113
80122
|
)
|
|
80114
80123
|
)
|
|
80115
80124
|
);
|
|
80116
|
-
|
|
80117
|
-
if (!r2.error && r2.framesCaptured < expectedFramesForTask(r2)) {
|
|
80118
|
-
r2.error = synthesizeSilentWorkerExitError(r2, expectedFramesForTask(r2));
|
|
80119
|
-
}
|
|
80120
|
-
}
|
|
80125
|
+
flagSilentWorkerExits(results);
|
|
80121
80126
|
const errors = results.filter((r2) => r2.failure || r2.error);
|
|
80122
80127
|
if (errors.length > 0) {
|
|
80123
80128
|
const errorMessages = errors.map(formatWorkerFailure).join("; ");
|
|
@@ -106582,6 +106587,9 @@ import {
|
|
|
106582
106587
|
writeFileSync as writeFileSync14
|
|
106583
106588
|
} from "fs";
|
|
106584
106589
|
import { basename as basename6, dirname as dirname16, isAbsolute as isAbsolute10, join as join34, relative as relative11, resolve as resolve26 } from "path";
|
|
106590
|
+
function resolveBrowserMediaEnd(start, end, duration) {
|
|
106591
|
+
return Number.isFinite(duration) && duration > 0 ? start + duration : end;
|
|
106592
|
+
}
|
|
106585
106593
|
function writeFileExclusiveSync(path2, data2) {
|
|
106586
106594
|
try {
|
|
106587
106595
|
writeFileSync14(path2, data2, { flag: "wx", mode: 384 });
|
|
@@ -114280,7 +114288,7 @@ async function runProbeStage(input2) {
|
|
|
114280
114288
|
const projectedEnd = projectBrowserEndToCompositionTimeline(
|
|
114281
114289
|
existing.start,
|
|
114282
114290
|
el.start,
|
|
114283
|
-
el.end
|
|
114291
|
+
resolveBrowserMediaEnd(el.start, el.end, el.duration)
|
|
114284
114292
|
);
|
|
114285
114293
|
if (projectedEnd > 0 && (existing.end <= 0 || Math.abs(existing.end - projectedEnd) > BROWSER_MEDIA_EPSILON)) {
|
|
114286
114294
|
existing.end = projectedEnd;
|
|
@@ -114300,7 +114308,7 @@ async function runProbeStage(input2) {
|
|
|
114300
114308
|
id: el.id,
|
|
114301
114309
|
src,
|
|
114302
114310
|
start: el.start,
|
|
114303
|
-
end: el.end,
|
|
114311
|
+
end: resolveBrowserMediaEnd(el.start, el.end, el.duration),
|
|
114304
114312
|
mediaStart: el.mediaStart,
|
|
114305
114313
|
loop: el.loop,
|
|
114306
114314
|
hasAudio: el.hasAudio && !el.muted
|
|
@@ -114317,7 +114325,7 @@ async function runProbeStage(input2) {
|
|
|
114317
114325
|
const projectedEnd = projectBrowserEndToCompositionTimeline(
|
|
114318
114326
|
existing.start,
|
|
114319
114327
|
el.start,
|
|
114320
|
-
el.end
|
|
114328
|
+
resolveBrowserMediaEnd(el.start, el.end, el.duration)
|
|
114321
114329
|
);
|
|
114322
114330
|
if (projectedEnd > 0 && (existing.end <= 0 || Math.abs(existing.end - projectedEnd) > BROWSER_MEDIA_EPSILON)) {
|
|
114323
114331
|
existing.end = projectedEnd;
|
|
@@ -114334,7 +114342,7 @@ async function runProbeStage(input2) {
|
|
|
114334
114342
|
id: el.id,
|
|
114335
114343
|
src,
|
|
114336
114344
|
start: el.start,
|
|
114337
|
-
end: el.end,
|
|
114345
|
+
end: resolveBrowserMediaEnd(el.start, el.end, el.duration),
|
|
114338
114346
|
mediaStart: el.mediaStart,
|
|
114339
114347
|
layer: 0,
|
|
114340
114348
|
volume: el.volume,
|
|
@@ -121445,7 +121453,8 @@ function buildSyntheticRenderJob(input2) {
|
|
|
121445
121453
|
logger: input2.logger ?? defaultLogger,
|
|
121446
121454
|
hdrMode: input2.hdrMode,
|
|
121447
121455
|
strictness: input2.strictness,
|
|
121448
|
-
producerConfig: input2.producerConfig
|
|
121456
|
+
producerConfig: input2.producerConfig,
|
|
121457
|
+
variables: input2.variables
|
|
121449
121458
|
};
|
|
121450
121459
|
return createRenderJob(renderConfig);
|
|
121451
121460
|
}
|
|
@@ -121701,7 +121710,8 @@ async function plan(projectDir, config, planDir) {
|
|
|
121701
121710
|
strictness: config.strictness,
|
|
121702
121711
|
entryFile: config.entryFile ?? "index.html",
|
|
121703
121712
|
logger: config.logger,
|
|
121704
|
-
producerConfig: cfg
|
|
121713
|
+
producerConfig: cfg,
|
|
121714
|
+
variables: config.variables
|
|
121705
121715
|
});
|
|
121706
121716
|
const entryFile = config.entryFile ?? "index.html";
|
|
121707
121717
|
const htmlPath = join63(projectDir, entryFile);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var HyperframesPlayer=(()=>{var J=Object.defineProperty;var Ge=Object.getOwnPropertyDescriptor;var qe=Object.getOwnPropertyNames;var Ye=Object.prototype.hasOwnProperty;var Xe=(i,e)=>{for(var t in e)J(i,t,{get:e[t],enumerable:!0})},Ze=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of qe(e))!Ye.call(i,n)&&n!==t&&J(i,n,{get:()=>e[n],enumerable:!(r=Ge(e,n))||r.enumerable});return i};var Qe=i=>Ze(J({},"__esModule",{value:!0}),i);var Lt={};Xe(Lt,{HyperframesPlayer:()=>Q,SPEED_PRESETS:()=>te,formatSpeed:()=>N,formatTime:()=>$});function ye(i){return i.hasRuntime||i.runtimeInjected?!1:!!(i.hasNestedCompositions||i.hasTimelines&&i.attempts>=5)}function I(i){return typeof i=="object"&&i!==null}function Ee(i){return I(i)&&typeof i.getDuration=="function"}function Se(i){return I(i)&&typeof i.duration=="function"&&typeof i.time=="function"&&typeof i.seek=="function"&&typeof i.play=="function"&&typeof i.pause=="function"}var Je="https://cdn.jsdelivr.net/npm/@hyperframes/core@0.7.
|
|
1
|
+
"use strict";var HyperframesPlayer=(()=>{var J=Object.defineProperty;var Ge=Object.getOwnPropertyDescriptor;var qe=Object.getOwnPropertyNames;var Ye=Object.prototype.hasOwnProperty;var Xe=(i,e)=>{for(var t in e)J(i,t,{get:e[t],enumerable:!0})},Ze=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of qe(e))!Ye.call(i,n)&&n!==t&&J(i,n,{get:()=>e[n],enumerable:!(r=Ge(e,n))||r.enumerable});return i};var Qe=i=>Ze(J({},"__esModule",{value:!0}),i);var Lt={};Xe(Lt,{HyperframesPlayer:()=>Q,SPEED_PRESETS:()=>te,formatSpeed:()=>N,formatTime:()=>$});function ye(i){return i.hasRuntime||i.runtimeInjected?!1:!!(i.hasNestedCompositions||i.hasTimelines&&i.attempts>=5)}function I(i){return typeof i=="object"&&i!==null}function Ee(i){return I(i)&&typeof i.getDuration=="function"}function Se(i){return I(i)&&typeof i.duration=="function"&&typeof i.time=="function"&&typeof i.seek=="function"&&typeof i.play=="function"&&typeof i.pause=="function"}var Je="https://cdn.jsdelivr.net/npm/@hyperframes/core@0.7.67-alpha.0/dist/hyperframe.runtime.iife.js";function D(i){if(i===null)return null;let e=Number.parseInt(i,10);return Number.isFinite(e)&&e>0?e:null}function Ke(i){let e=i?.querySelector("[data-composition-id][data-width][data-height]")??i?.querySelector("[data-width][data-height]");if(!e)return null;let t=D(e.getAttribute("data-width")),r=D(e.getAttribute("data-height"));return t!==null&&r!==null?{width:t,height:r}:null}var j=class{constructor(e,t){this._iframe=e;this._callbacks=t}_iframe;_callbacks;_interval=null;_runtimeInjected=!1;get runtimeInjected(){return this._runtimeInjected}start(){this.stop(),this._runtimeInjected=!1;let e=0;this._interval=setInterval(()=>{e++;try{let t=this._iframe.contentWindow;if(!t)return;let r=!!(t.__hf||t.__player),n=!!(t.__timelines&&Object.keys(t.__timelines).length>0),o=!!this._iframe.contentDocument?.querySelector("[data-composition-src]");if(ye({hasRuntime:r,hasTimelines:n,hasNestedCompositions:o,runtimeInjected:this._runtimeInjected,attempts:e})){this._injectRuntime();return}if(this._runtimeInjected&&!r)return;let s=this._resolvePlaybackDurationAdapter(t);if(s&&s.getDuration()>0){this.stop();let l=Ke(this._iframe.contentDocument);this._callbacks.onReady({duration:s.getDuration(),adapter:s,compositionSize:l});return}}catch{}e>=40&&(this.stop(),this._callbacks.onError("Composition timeline not found after 8s"))},200)}stop(){this._interval!==null&&(clearInterval(this._interval),this._interval=null)}resolveDirectTimelineAdapter(){try{let e=this._iframe.contentWindow;return e?this._resolveDirectTimelineAdapterFromWindow(e):null}catch{return null}}resolveDirectTimelineAdapterFromWindow(e){return this._resolveDirectTimelineAdapterFromWindow(e)}hasRuntimeBridge(e){return Reflect.get(e,"__hf")!==void 0||I(Reflect.get(e,"__player"))}_injectRuntime(){this._runtimeInjected=!0;try{let e=this._iframe.contentDocument;if(!e)return;let t=e.createElement("script");t.src=Je,(e.head||e.documentElement).appendChild(t),this._callbacks.onRuntimeInjected?.()}catch{}}_resolveDirectTimelineAdapterFromWindow(e){if(this.hasRuntimeBridge(e))return null;let t=Reflect.get(e,"__timelines");if(!I(t))return null;let r=Object.keys(t);if(r.length===0)return null;let n=this._iframe.contentDocument?.querySelector("[data-composition-id]")?.getAttribute("data-composition-id"),o=n&&n in t?n:r[r.length-1],s=t[o];return Se(s)?s:null}_resolvePlaybackDurationAdapter(e){let t=Reflect.get(e,"__player");if(Ee(t))return{kind:"runtime",getDuration:()=>t.getDuration()};let r=this._resolveDirectTimelineAdapterFromWindow(e);return r?{kind:"direct-timeline",timeline:r,getDuration:()=>r.duration()}:null}};var Te=`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
position: relative;
|
package/dist/studio/assets/{hyperframes-player-D2zuA3cx.js → hyperframes-player-Dn2qHIaT.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var ce=Object.defineProperty;var pe=(r,t,e)=>t in r?ce(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var c=(r,t,e)=>pe(r,typeof t!="symbol"?t+"":t,e);import{r as ne,i as me,a as fe}from"./index-
|
|
1
|
+
var ce=Object.defineProperty;var pe=(r,t,e)=>t in r?ce(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var c=(r,t,e)=>pe(r,typeof t!="symbol"?t+"":t,e);import{r as ne,i as me,a as fe}from"./index-GOjhPhg7.js";function _e(r){return r.hasRuntime||r.runtimeInjected?!1:!!(r.hasNestedCompositions||r.hasTimelines&&r.attempts>=5)}function F(r){return typeof r=="object"&&r!==null}function ge(r){return F(r)&&typeof r.getDuration=="function"}function ye(r){return F(r)&&typeof r.duration=="function"&&typeof r.time=="function"&&typeof r.seek=="function"&&typeof r.play=="function"&&typeof r.pause=="function"}function ve(r){if(!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/.test(r))throw new Error(`Invalid HyperFrames runtime version: ${r}`);return`https://cdn.jsdelivr.net/npm/@hyperframes/core@${r}/dist/hyperframe.runtime.iife.js`}const be=typeof __HYPERFRAMES_RUNTIME_CDN_URL__=="string"?__HYPERFRAMES_RUNTIME_CDN_URL__:ve("0.0.0-dev");function H(r){if(r===null)return null;const t=Number.parseInt(r,10);return Number.isFinite(t)&&t>0?t:null}function we(r){const t=(r==null?void 0:r.querySelector("[data-composition-id][data-width][data-height]"))??(r==null?void 0:r.querySelector("[data-width][data-height]"));if(!t)return null;const e=H(t.getAttribute("data-width")),i=H(t.getAttribute("data-height"));return e!==null&&i!==null?{width:e,height:i}:null}class Ae{constructor(t,e){c(this,"_interval",null);c(this,"_runtimeInjected",!1);this._iframe=t,this._callbacks=e}get runtimeInjected(){return this._runtimeInjected}start(){this.stop(),this._runtimeInjected=!1;let t=0;this._interval=setInterval(()=>{var e;t++;try{const i=this._iframe.contentWindow;if(!i)return;const s=!!(i.__hf||i.__player),o=!!(i.__timelines&&Object.keys(i.__timelines).length>0),d=!!((e=this._iframe.contentDocument)!=null&&e.querySelector("[data-composition-src]"));if(_e({hasRuntime:s,hasTimelines:o,hasNestedCompositions:d,runtimeInjected:this._runtimeInjected,attempts:t})){this._injectRuntime();return}if(this._runtimeInjected&&!s)return;const a=this._resolvePlaybackDurationAdapter(i);if(a&&a.getDuration()>0){this.stop();const h=we(this._iframe.contentDocument);this._callbacks.onReady({duration:a.getDuration(),adapter:a,compositionSize:h});return}}catch{}t>=40&&(this.stop(),this._callbacks.onError("Composition timeline not found after 8s"))},200)}stop(){this._interval!==null&&(clearInterval(this._interval),this._interval=null)}resolveDirectTimelineAdapter(){try{const t=this._iframe.contentWindow;return t?this._resolveDirectTimelineAdapterFromWindow(t):null}catch{return null}}resolveDirectTimelineAdapterFromWindow(t){return this._resolveDirectTimelineAdapterFromWindow(t)}hasRuntimeBridge(t){return Reflect.get(t,"__hf")!==void 0||F(Reflect.get(t,"__player"))}_injectRuntime(){var t,e;this._runtimeInjected=!0;try{const i=this._iframe.contentDocument;if(!i)return;const s=i.createElement("script");s.src=be,(i.head||i.documentElement).appendChild(s),(e=(t=this._callbacks).onRuntimeInjected)==null||e.call(t)}catch{}}_resolveDirectTimelineAdapterFromWindow(t){var a,h;if(this.hasRuntimeBridge(t))return null;const e=Reflect.get(t,"__timelines");if(!F(e))return null;const i=Object.keys(e);if(i.length===0)return null;const s=(h=(a=this._iframe.contentDocument)==null?void 0:a.querySelector("[data-composition-id]"))==null?void 0:h.getAttribute("data-composition-id"),o=s&&s in e?s:i[i.length-1],d=e[o];return ye(d)?d:null}_resolvePlaybackDurationAdapter(t){const e=Reflect.get(t,"__player");if(ge(e))return{kind:"runtime",getDuration:()=>e.getDuration()};const i=this._resolveDirectTimelineAdapterFromWindow(t);return i?{kind:"direct-timeline",timeline:i,getDuration:()=>i.duration()}:null}}const Ee=`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
position: relative;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as P}from"./index-
|
|
1
|
+
import{g as P}from"./index-GOjhPhg7.js";function j(c,d){for(var s=0;s<d.length;s++){const a=d[s];if(typeof a!="string"&&!Array.isArray(a)){for(const i in a)if(i!=="default"&&!(i in c)){const l=Object.getOwnPropertyDescriptor(a,i);l&&Object.defineProperty(c,i,l.get?l:{enumerable:!0,get:()=>a[i]})}}}return Object.freeze(Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}))}var v={},w;function k(){if(w)return v;w=1,Object.defineProperty(v,"__esModule",{value:!0}),v.default=d;var c=window.OfflineAudioContext||window.webkitOfflineAudioContext;function d(e){var r=a(e);return r.start(0),[i,y,O(e.sampleRate),s].reduce(function(t,o){return o(t)},r.buffer.getChannelData(0))}function s(e){return e.sort(function(r,t){return t.count-r.count}).splice(0,5)[0].tempo}function a(e){var r=e.length,t=e.numberOfChannels,o=e.sampleRate,n=new c(t,r,o),u=n.createBufferSource();u.buffer=e;var f=n.createBiquadFilter();return f.type="lowpass",u.connect(f),f.connect(n.destination),u}function i(e){for(var r=[],t=.9,o=.3,n=15;r.length<n&&t>=o;)r=l(e,t),t-=.05;if(r.length<n)throw new Error("Could not find enough samples for a reliable detection.");return r}function l(e,r){for(var t=[],o=0,n=e.length;o<n;o+=1)e[o]>r&&(t.push(o),o+=1e4);return t}function y(e){var r=[];return e.forEach(function(t,o){for(var n=function(x){var g=e[o+x]-t,_=r.some(function(h){if(h.interval===g)return h.count+=1});_||r.push({interval:g,count:1})},u=0;u<10;u+=1)n(u)}),r}function O(e){return function(r){var t=[];return r.forEach(function(o){if(o.interval!==0){for(var n=60/(o.interval/e);n<90;)n*=2;for(;n>180;)n/=2;n=Math.round(n);var u=t.some(function(f){if(f.tempo===n)return f.count+=o.count});u||t.push({tempo:n,count:o.count})}}),t}}return v}var p,b;function q(){return b||(b=1,p=k().default),p}var m=q();const A=P(m),D=j({__proto__:null,default:A},[m]);export{D as i};
|