@hyperframes/studio 0.8.116 → 0.8.118

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.
Files changed (58) hide show
  1. package/dist/assets/{hyperframes-player-mGYvPVpw.js → hyperframes-player-CnpIuNRl.js} +1 -1
  2. package/dist/assets/{index-DYNaXPVf.js → index-B4SbAADe.js} +196 -194
  3. package/dist/assets/{index-Dr3hNpvS.js → index-BZ23-h1_.js} +1 -1
  4. package/dist/assets/{index-BWHt0-ir.js → index-FeRU6G3G.js} +1 -1
  5. package/dist/index.d.ts +29 -19
  6. package/dist/index.html +1 -1
  7. package/dist/index.js +2366 -2305
  8. package/dist/index.js.map +1 -1
  9. package/package.json +8 -8
  10. package/src/components/StudioRightPanels.tsx +3 -6
  11. package/src/components/TimelineToolbar.test.tsx +14 -0
  12. package/src/components/TimelineToolbar.tsx +4 -1
  13. package/src/components/editor/DomEditOverlay.tsx +1 -0
  14. package/src/components/editor/PropertyPanel.test.tsx +149 -25
  15. package/src/components/editor/PropertyPanel.tsx +1 -12
  16. package/src/components/editor/PropertyPanelEmptyState.test.tsx +2 -3
  17. package/src/components/editor/PropertyPanelEmptyState.tsx +3 -5
  18. package/src/components/editor/PropertyPanelFlat.tsx +9 -22
  19. package/src/components/editor/PropertyPanelFlatHeader.test.tsx +7 -4
  20. package/src/components/editor/PropertyPanelFlatHeader.tsx +5 -3
  21. package/src/components/editor/domEditOverlayGestures.ts +1 -0
  22. package/src/components/editor/domEditOverlayStartGesture.ts +2 -2
  23. package/src/components/editor/manualOffsetDrag.ts +3 -3
  24. package/src/components/editor/plainTranslate.ts +5 -3
  25. package/src/components/editor/propertyPanelHelpers.ts +2 -2
  26. package/src/components/editor/propertyPanelTransformCommit.ts +2 -2
  27. package/src/components/editor/rotationDraft.ts +2 -1
  28. package/src/components/editor/useDomEditOverlayGestures.ts +2 -2
  29. package/src/components/editor/usePanelHiddenToggle.ts +44 -0
  30. package/src/contexts/DomEditContext.tsx +3 -0
  31. package/src/hooks/gsapRuntimeKeyframes.ts +16 -3
  32. package/src/hooks/gsapScriptCommitTypes.ts +1 -1
  33. package/src/hooks/plainRotation.ts +5 -1
  34. package/src/hooks/timelineTrackVisibility.ts +7 -17
  35. package/src/hooks/useDomEditPersist.test.tsx +335 -0
  36. package/src/hooks/useDomGeometryCommit.test.tsx +5 -1
  37. package/src/hooks/useDomGeometryCommit.ts +6 -9
  38. package/src/hooks/useFreezeFrame.test.ts +39 -3
  39. package/src/hooks/useFreezeFrame.ts +4 -1
  40. package/src/hooks/useGsapAwareEditing.test.tsx +25 -0
  41. package/src/hooks/useGsapAwareEditing.ts +12 -8
  42. package/src/hooks/useGsapAwareGroupMove.ts +2 -2
  43. package/src/hooks/useGsapScriptCommits.test.tsx +69 -1
  44. package/src/hooks/useGsapScriptCommits.ts +9 -7
  45. package/src/hooks/usePersistentEditHistory.test.ts +25 -2
  46. package/src/hooks/usePersistentEditHistory.ts +3 -9
  47. package/src/player/components/Timeline.test.ts +48 -0
  48. package/src/player/components/TimelineTrackHeader.test.tsx +14 -22
  49. package/src/player/components/TimelineTrackHeader.tsx +4 -2
  50. package/src/player/components/TimelineTrackPlainHeader.test.tsx +17 -31
  51. package/src/player/components/TimelineTrackPlainHeader.tsx +9 -32
  52. package/src/player/components/hiddenToggle.tsx +20 -0
  53. package/src/utils/gsapSoftReload.test.ts +51 -2
  54. package/src/utils/gsapSoftReload.ts +11 -21
  55. package/src/utils/gsapUndoRestore.browser.test.ts +91 -44
  56. package/src/utils/softReloadTargets.ts +4 -3
  57. package/src/utils/studioFileHistory.ts +1 -0
  58. package/src/utils/timelineInspector.ts +10 -5
@@ -1,4 +1,4 @@
1
- import{n as Qi}from"./index-DYNaXPVf.js";/*!
1
+ import{n as Qi}from"./index-B4SbAADe.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
@@ -1 +1 @@
1
- import{g as P}from"./index-DYNaXPVf.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-B4SbAADe.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};
package/dist/index.d.ts CHANGED
@@ -823,6 +823,17 @@ interface TimelineRangeSelection {
823
823
  anchorY: number;
824
824
  }
825
825
 
826
+ interface RecordEditInput$5 {
827
+ label: string;
828
+ coalesceKey?: string;
829
+ coalesceMs?: number;
830
+ files: Record<string, {
831
+ before: string;
832
+ after: string;
833
+ }>;
834
+ created?: string[];
835
+ }
836
+
826
837
  interface ImportedFontAsset {
827
838
  family: string;
828
839
  path: string;
@@ -856,7 +867,7 @@ type CommitDomAttributeBatch = (selection: DomEditSelection, operations: PatchOp
856
867
  prepareContent?: (html: string) => string;
857
868
  }) => Promise<boolean>;
858
869
 
859
- interface RecordEditInput$5 {
870
+ interface RecordEditInput$4 {
860
871
  label: string;
861
872
  coalesceKey?: string;
862
873
  files: Record<string, {
@@ -880,7 +891,7 @@ interface UseTimelineEditingOptions {
880
891
  showToast: (message: string, tone?: "error" | "info") => void;
881
892
  writeProjectFile: (path: string, content: string, expectedContent?: string) => Promise<void>;
882
893
  observeProjectFileVersion?: (path: string, version: string | null) => void;
883
- recordEdit: (input: RecordEditInput$5) => Promise<void>;
894
+ recordEdit: (input: RecordEditInput$4) => Promise<void>;
884
895
  reloadPreview: () => void;
885
896
  previewIframeRef: RefObject<HTMLIFrameElement | null>;
886
897
  pendingTimelineEditPathRef: MutableRefObject<Set<string>>;
@@ -968,7 +979,7 @@ interface CommitMutationOptions {
968
979
  * error handling — a failed write still throws.
969
980
  */
970
981
  deferPreviewSync?: boolean;
971
- /** Shares an in-place patch miss with the final render of one multi-write action. */
982
+ /** Carries a deferred write not yet on screen (no patch, or a missed one) to the final render. */
972
983
  previewFallbackLatch?: {
973
984
  pending: boolean;
974
985
  };
@@ -2767,15 +2778,6 @@ interface UndoRestoreFile {
2767
2778
  }
2768
2779
  type RestoreFiles = Record<string, UndoRestoreFile>;
2769
2780
 
2770
- interface RecordEditInput$4 {
2771
- label: string;
2772
- coalesceKey?: string;
2773
- coalesceMs?: number;
2774
- files: Record<string, {
2775
- before: string;
2776
- after: string;
2777
- }>;
2778
- }
2779
2781
  interface ApplyCallbacks {
2780
2782
  readFile: (path: string) => Promise<string>;
2781
2783
  serialize?: <T>(paths: readonly string[], task: () => Promise<T>) => Promise<T>;
@@ -2811,7 +2813,7 @@ declare function usePersistentEditHistory({ projectId }: UsePersistentEditHistor
2811
2813
  createdAt: number;
2812
2814
  }[];
2813
2815
  };
2814
- recordEdit: ({ label, coalesceKey, coalesceMs, files }: RecordEditInput$4) => Promise<void>;
2816
+ recordEdit: ({ label, coalesceKey, coalesceMs, files, created }: RecordEditInput$5) => Promise<void>;
2815
2817
  undo: (callbacks: ApplyCallbacks) => Promise<ApplyResult>;
2816
2818
  redo: (callbacks: ApplyCallbacks) => Promise<ApplyResult>;
2817
2819
  predict: (direction: "undo" | "redo") => {
@@ -3064,6 +3066,7 @@ interface TimelineToolbarProps {
3064
3066
  showAddBeat?: boolean;
3065
3067
  /** Hides Add keyframe and auto-record, and turns off auto-record and the K shortcut with them. */
3066
3068
  showKeyframes?: boolean;
3069
+ rightActions?: ReactNode;
3067
3070
  }
3068
3071
  declare const TimelineToolbar: react.NamedExoticComponent<TimelineToolbarProps>;
3069
3072
 
@@ -3132,9 +3135,10 @@ interface CssRotationTarget {
3132
3135
  /** An inline box does not transform, so the turn makes it inline-block. */
3133
3136
  inline: boolean;
3134
3137
  }
3138
+ type PressChoseGsap = null;
3135
3139
  type RotationCommit = {
3136
3140
  angle: number;
3137
- plain?: CssRotationTarget;
3141
+ plain?: CssRotationTarget | PressChoseGsap;
3138
3142
  };
3139
3143
 
3140
3144
  declare const SNAP_THRESHOLD_PX = 6;
@@ -3446,7 +3450,9 @@ declare function useDomEditSession({ projectId, activeCompPath, compIdToSrc, cap
3446
3450
  }, offset?: {
3447
3451
  x: number;
3448
3452
  y: number;
3449
- }, restore?: () => void) => Promise<GeometryCommitResult>;
3453
+ }, restore?: () => void, route?: {
3454
+ plainTranslate: boolean;
3455
+ }) => Promise<GeometryCommitResult>;
3450
3456
  handleDomRotationCommit: (selection: DomEditSelection, next: RotationCommit) => Promise<GeometryCommitResult | undefined>;
3451
3457
  handleDomManualEditsReset: (selection: DomEditSelection) => Promise<DomEditPersistOutcome | undefined>;
3452
3458
  handleDomTextCommit: (value: string, fieldKey?: string) => Promise<DomEditCommitOutcome>;
@@ -3703,7 +3709,9 @@ interface DomEditOverlayProps {
3703
3709
  }, offset?: {
3704
3710
  x: number;
3705
3711
  y: number;
3706
- }, restore?: () => void) => Promise<unknown> | void;
3712
+ }, restore?: () => void, route?: {
3713
+ plainTranslate: boolean;
3714
+ }) => Promise<unknown> | void;
3707
3715
  onRotationCommit: (selection: DomEditSelection, next: RotationCommit) => Promise<unknown> | void;
3708
3716
  onStyleCommit?: (property: string, value: string) => Promise<unknown> | void;
3709
3717
  recordingState?: GestureRecordingState;
@@ -3799,8 +3807,8 @@ declare function GradientField({ value, fallbackColor, disabled, onCommit, }: {
3799
3807
  * mounts; drain `waitForPendingSaves` before switching projects.
3800
3808
  */
3801
3809
  interface UseDomGeometryCommitOptions extends UseDomStyleCommitOptions {
3802
- /** Called when a save cannot patch the preview in place; defaults to reloading the iframe. */
3803
- reloadPreview?: () => void;
3810
+ /** Reloads the host's preview when a save cannot patch it in place. */
3811
+ reloadPreview: () => void;
3804
3812
  }
3805
3813
  interface DomGeometryCommits {
3806
3814
  commitPathOffset: (selection: DomEditSelection, next: {
@@ -3814,7 +3822,9 @@ interface DomGeometryCommits {
3814
3822
  }, offset?: {
3815
3823
  x: number;
3816
3824
  y: number;
3817
- }, restore?: () => void) => Promise<DomEditCommitOutcome>;
3825
+ }, restore?: () => void, route?: {
3826
+ plainTranslate: boolean;
3827
+ }) => Promise<DomEditCommitOutcome>;
3818
3828
  commitRotation: (selection: DomEditSelection, next: RotationCommit) => Promise<DomEditCommitOutcome>;
3819
3829
  waitForPendingSaves: () => Promise<void>;
3820
3830
  }
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-DYNaXPVf.js"></script>
17
+ <script type="module" crossorigin src="/assets/index-B4SbAADe.js"></script>
18
18
  <link rel="stylesheet" crossorigin href="/assets/index-t1LH6H5H.css">
19
19
  </head>
20
20
  <body>