@hyperframes/studio 0.8.140 → 0.8.141

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.
@@ -1 +1 @@
1
- import{g as P}from"./index-VAHDM_zL.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};
1
+ import{m as P}from"./index-C0thd4eM.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={},m;function k(){if(m)return v;m=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 h=e[o+x]-t,_=r.some(function(g){if(g.interval===h)return g.count+=1});_||r.push({interval:h,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,w;function q(){return w||(w=1,p=k().default),p}var b=q();const A=P(b),D=j({__proto__:null,default:A},[b]);export{D as i};
package/dist/index.html CHANGED
@@ -14,7 +14,7 @@
14
14
  document.documentElement.dataset.theme = "paper";
15
15
  }
16
16
  </script>
17
- <script type="module" crossorigin src="/assets/index-VAHDM_zL.js"></script>
17
+ <script type="module" crossorigin src="/assets/index-C0thd4eM.js"></script>
18
18
  <link rel="stylesheet" crossorigin href="/assets/index-CVd4O6eH.css">
19
19
  </head>
20
20
  <body>
package/dist/index.js CHANGED
@@ -29270,6 +29270,7 @@ import { createRuntimeStartTimeResolver } from "@hyperframes/core/runtime/start-
29270
29270
 
29271
29271
  // src/player/lib/runtimeProtocol.ts
29272
29272
  import {
29273
+ frameDisplayScale,
29273
29274
  inspectRuntimeProtocol,
29274
29275
  runtimeProtocolMetadata
29275
29276
  } from "@hyperframes/core/runtime/protocol";
@@ -29285,6 +29286,10 @@ function createRuntimeControlMessage(action, payload = {}, fps = 30) {
29285
29286
  function postRuntimeControlMessage(target, action, payload = {}, fps = 30) {
29286
29287
  target?.postMessage(createRuntimeControlMessage(action, payload, fps), "*");
29287
29288
  }
29289
+ function postFrameDisplayScale(iframe) {
29290
+ const scale = iframe && frameDisplayScale(iframe);
29291
+ if (scale) postRuntimeControlMessage(iframe.contentWindow, "set-display-scale", { scale });
29292
+ }
29288
29293
  function inspectStudioRuntimeMessage(value) {
29289
29294
  return inspectRuntimeProtocol(value, 30);
29290
29295
  }
@@ -33686,6 +33691,7 @@ var NLEPreview = memo23(function NLEPreview2({
33686
33691
  const hintHeight = compositionSizeHint?.height;
33687
33692
  const zoomRef = useRef54(DEFAULT_PREVIEW_ZOOM);
33688
33693
  const [settledZoom, setSettledZoom] = useState40(DEFAULT_PREVIEW_ZOOM);
33694
+ useEffect39(() => postFrameDisplayScale(previewIframeRef.current), [settledZoom]);
33689
33695
  const hudRef = useRef54(null);
33690
33696
  const hudTimerRef = useRef54(null);
33691
33697
  const settleTimerRef = useRef54(null);
@@ -93509,6 +93515,20 @@ function CompCard({
93509
93515
  useEffect144(() => {
93510
93516
  if (hovered) requestIframePlaybackSync(true);
93511
93517
  }, [hovered, requestIframePlaybackSync]);
93518
+ useEffect144(() => {
93519
+ if (livePreviewLoaded) postFrameDisplayScale(iframeRef.current);
93520
+ }, [livePreviewLoaded, previewScale]);
93521
+ useEffect144(() => {
93522
+ if (!hovered) return;
93523
+ const onRuntimeReady = (event) => {
93524
+ const frame3 = iframeRef.current;
93525
+ if (frame3 && event.source === frame3.contentWindow && event.data?.type === "ready") {
93526
+ postFrameDisplayScale(frame3);
93527
+ }
93528
+ };
93529
+ window.addEventListener("message", onRuntimeReady);
93530
+ return () => window.removeEventListener("message", onRuntimeReady);
93531
+ }, [hovered]);
93512
93532
  useEffect144(() => {
93513
93533
  return () => {
93514
93534
  if (hoverTimer.current) clearTimeout(hoverTimer.current);