@hyperframes/studio 0.8.137 → 0.8.138

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-B3lJsA-e.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{g as P}from"./index-BdjA0CLD.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,4 +1,4 @@
1
- import{n as Qi}from"./index-B3lJsA-e.js";/*!
1
+ import{n as Qi}from"./index-BdjA0CLD.js";/*!
2
2
  * Copyright (c) 2026-present, Vanilagy and contributors
3
3
  *
4
4
  * This Source Code Form is subject to the terms of the Mozilla Public
package/dist/index.html CHANGED
@@ -14,8 +14,8 @@
14
14
  document.documentElement.dataset.theme = "paper";
15
15
  }
16
16
  </script>
17
- <script type="module" crossorigin src="/assets/index-B3lJsA-e.js"></script>
18
- <link rel="stylesheet" crossorigin href="/assets/index-CC_E-Cbl.css">
17
+ <script type="module" crossorigin src="/assets/index-BdjA0CLD.js"></script>
18
+ <link rel="stylesheet" crossorigin href="/assets/index-CVd4O6eH.css">
19
19
  </head>
20
20
  <body>
21
21
  <div data-hf-id="hf-aph5" id="root"></div>
package/dist/index.js CHANGED
@@ -88027,6 +88027,7 @@ function useCaptionDetection({
88027
88027
 
88028
88028
  // src/hooks/useConsoleErrorCapture.ts
88029
88029
  import { useCallback as useCallback157, useEffect as useEffect130, useRef as useRef160, useState as useState125 } from "react";
88030
+ import { STUDIO_PREVIEW_ERRORS } from "@hyperframes/core/studio-preview-mark";
88030
88031
  function useConsoleErrorCapture(previewIframe) {
88031
88032
  const [consoleErrors, setConsoleErrors] = useState125(null);
88032
88033
  const consoleErrorsRef = useRef160([]);
@@ -88035,6 +88036,7 @@ function useConsoleErrorCapture(previewIframe) {
88035
88036
  setConsoleErrors(null);
88036
88037
  }, []);
88037
88038
  useEffect130(() => {
88039
+ resetErrors();
88038
88040
  if (!previewIframe) return;
88039
88041
  let patchedWin = null;
88040
88042
  let origConsoleError = null;
@@ -88054,48 +88056,42 @@ function useConsoleErrorCapture(previewIframe) {
88054
88056
  };
88055
88057
  const attachErrorCapture = () => {
88056
88058
  detachErrorCapture();
88059
+ resetErrors();
88057
88060
  try {
88058
88061
  const win = previewIframe.contentWindow;
88059
88062
  if (!win) return;
88060
88063
  if (win.__hfErrorCapture) return;
88061
88064
  win.__hfErrorCapture = true;
88062
88065
  patchedWin = win;
88063
- origConsoleError = win.console.error.bind(win.console);
88064
- win.console.error = function(...args) {
88065
- origConsoleError(...args);
88066
- const text = args.map((a) => a instanceof Error ? a.message : String(a)).join(" ");
88067
- if (text.includes("favicon")) return;
88066
+ const record = (texts) => {
88067
+ if (texts.length === 0) return;
88068
88068
  consoleErrorsRef.current = [
88069
88069
  ...consoleErrorsRef.current,
88070
- { severity: "error", message: text }
88070
+ ...texts.map((message) => ({ severity: "error", message }))
88071
88071
  ];
88072
88072
  setConsoleErrors([...consoleErrorsRef.current]);
88073
88073
  };
88074
- errorHandler = (e) => {
88075
- const text = e.message || String(e);
88076
- consoleErrorsRef.current = [
88077
- ...consoleErrorsRef.current,
88078
- { severity: "error", message: text }
88079
- ];
88080
- setConsoleErrors([...consoleErrorsRef.current]);
88074
+ origConsoleError = win.console.error.bind(win.console);
88075
+ win.console.error = function(...args) {
88076
+ origConsoleError(...args);
88077
+ const text = args.map((a) => a instanceof Error ? a.message : String(a)).join(" ");
88078
+ if (!text.includes("favicon")) record([text]);
88081
88079
  };
88080
+ errorHandler = (e) => record([e.message || String(e)]);
88082
88081
  win.addEventListener("error", errorHandler);
88082
+ const raised = Reflect.get(win, STUDIO_PREVIEW_ERRORS);
88083
+ if (Array.isArray(raised)) record(raised.map(String));
88083
88084
  } catch {
88084
88085
  }
88085
88086
  };
88086
88087
  attachErrorCapture();
88087
- const handleLoad = () => {
88088
- consoleErrorsRef.current = [];
88089
- setConsoleErrors(null);
88090
- attachErrorCapture();
88091
- };
88092
- previewIframe.addEventListener("load", handleLoad);
88088
+ previewIframe.addEventListener("load", attachErrorCapture);
88093
88089
  return () => {
88094
- previewIframe.removeEventListener("load", handleLoad);
88090
+ previewIframe.removeEventListener("load", attachErrorCapture);
88095
88091
  detachErrorCapture();
88096
88092
  };
88097
- }, [previewIframe]);
88098
- return { consoleErrors, setConsoleErrors, resetErrors };
88093
+ }, [previewIframe, resetErrors]);
88094
+ return { consoleErrors, setConsoleErrors };
88099
88095
  }
88100
88096
 
88101
88097
  // src/hooks/useFrameCapture.ts
@@ -93402,7 +93398,7 @@ var LayersPanel = memo50(function LayersPanel2({ host }) {
93402
93398
  "div",
93403
93399
  {
93404
93400
  ref: scrollContainerRef,
93405
- className: "relative min-h-0 flex-1 overflow-y-auto py-1",
93401
+ className: "relative min-h-0 flex-1 select-none overflow-y-auto py-1",
93406
93402
  onPointerMove: handleContainerPointerMove,
93407
93403
  onPointerUp: handleContainerPointerUp,
93408
93404
  onPointerCancel: handleContainerPointerUp,
@@ -98941,11 +98937,7 @@ function StudioApp({ readOnlyPreview = false, readOnlyPreviewReason } = {}) {
98941
98937
  waitForPendingDomEditSaves: previewPersistence.waitForPendingDomEditSaves
98942
98938
  });
98943
98939
  const frameCapture = useStableHandlers(frameCaptureResult, projectId);
98944
- const {
98945
- consoleErrors,
98946
- setConsoleErrors,
98947
- resetErrors: resetConsoleErrors
98948
- } = useConsoleErrorCapture(previewIframe);
98940
+ const { consoleErrors, setConsoleErrors } = useConsoleErrorCapture(previewIframe);
98949
98941
  const fileDrop = useGlobalFileDrop(timelineEditing.handleTimelineFileDrop);
98950
98942
  const handleToggleRecordingRef = useRef187(() => {
98951
98943
  });
@@ -98970,10 +98962,9 @@ function StudioApp({ readOnlyPreview = false, readOnlyPreviewReason } = {}) {
98970
98962
  previewIframeRef.current = iframe;
98971
98963
  usePreviewIframeStore.getState().setIframe(iframe);
98972
98964
  appHotkeys.syncPreviewHotkeys(iframe);
98973
- resetConsoleErrors();
98974
98965
  refreshPreviewDocumentVersion();
98975
98966
  },
98976
- [appHotkeys, resetConsoleErrors, refreshPreviewDocumentVersion]
98967
+ [appHotkeys, refreshPreviewDocumentVersion]
98977
98968
  );
98978
98969
  const rightPanel = useRightPanelIntent();
98979
98970
  const { inspectorPanelActive, shouldShowMotionPath, shouldShowSelectedDomBounds } = useInspectorState(