@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.
- package/dist/assets/{hyperframes-player-mGYvPVpw.js → hyperframes-player-CnpIuNRl.js} +1 -1
- package/dist/assets/{index-DYNaXPVf.js → index-B4SbAADe.js} +196 -194
- package/dist/assets/{index-Dr3hNpvS.js → index-BZ23-h1_.js} +1 -1
- package/dist/assets/{index-BWHt0-ir.js → index-FeRU6G3G.js} +1 -1
- package/dist/index.d.ts +29 -19
- package/dist/index.html +1 -1
- package/dist/index.js +2366 -2305
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
- package/src/components/StudioRightPanels.tsx +3 -6
- package/src/components/TimelineToolbar.test.tsx +14 -0
- package/src/components/TimelineToolbar.tsx +4 -1
- package/src/components/editor/DomEditOverlay.tsx +1 -0
- package/src/components/editor/PropertyPanel.test.tsx +149 -25
- package/src/components/editor/PropertyPanel.tsx +1 -12
- package/src/components/editor/PropertyPanelEmptyState.test.tsx +2 -3
- package/src/components/editor/PropertyPanelEmptyState.tsx +3 -5
- package/src/components/editor/PropertyPanelFlat.tsx +9 -22
- package/src/components/editor/PropertyPanelFlatHeader.test.tsx +7 -4
- package/src/components/editor/PropertyPanelFlatHeader.tsx +5 -3
- package/src/components/editor/domEditOverlayGestures.ts +1 -0
- package/src/components/editor/domEditOverlayStartGesture.ts +2 -2
- package/src/components/editor/manualOffsetDrag.ts +3 -3
- package/src/components/editor/plainTranslate.ts +5 -3
- package/src/components/editor/propertyPanelHelpers.ts +2 -2
- package/src/components/editor/propertyPanelTransformCommit.ts +2 -2
- package/src/components/editor/rotationDraft.ts +2 -1
- package/src/components/editor/useDomEditOverlayGestures.ts +2 -2
- package/src/components/editor/usePanelHiddenToggle.ts +44 -0
- package/src/contexts/DomEditContext.tsx +3 -0
- package/src/hooks/gsapRuntimeKeyframes.ts +16 -3
- package/src/hooks/gsapScriptCommitTypes.ts +1 -1
- package/src/hooks/plainRotation.ts +5 -1
- package/src/hooks/timelineTrackVisibility.ts +7 -17
- package/src/hooks/useDomEditPersist.test.tsx +335 -0
- package/src/hooks/useDomGeometryCommit.test.tsx +5 -1
- package/src/hooks/useDomGeometryCommit.ts +6 -9
- package/src/hooks/useFreezeFrame.test.ts +39 -3
- package/src/hooks/useFreezeFrame.ts +4 -1
- package/src/hooks/useGsapAwareEditing.test.tsx +25 -0
- package/src/hooks/useGsapAwareEditing.ts +12 -8
- package/src/hooks/useGsapAwareGroupMove.ts +2 -2
- package/src/hooks/useGsapScriptCommits.test.tsx +69 -1
- package/src/hooks/useGsapScriptCommits.ts +9 -7
- package/src/hooks/usePersistentEditHistory.test.ts +25 -2
- package/src/hooks/usePersistentEditHistory.ts +3 -9
- package/src/player/components/Timeline.test.ts +48 -0
- package/src/player/components/TimelineTrackHeader.test.tsx +14 -22
- package/src/player/components/TimelineTrackHeader.tsx +4 -2
- package/src/player/components/TimelineTrackPlainHeader.test.tsx +17 -31
- package/src/player/components/TimelineTrackPlainHeader.tsx +9 -32
- package/src/player/components/hiddenToggle.tsx +20 -0
- package/src/utils/gsapSoftReload.test.ts +51 -2
- package/src/utils/gsapSoftReload.ts +11 -21
- package/src/utils/gsapUndoRestore.browser.test.ts +91 -44
- package/src/utils/softReloadTargets.ts +4 -3
- package/src/utils/studioFileHistory.ts +1 -0
- package/src/utils/timelineInspector.ts +10 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as P}from"./index-
|
|
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$
|
|
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$
|
|
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
|
-
/**
|
|
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$
|
|
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
|
|
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
|
|
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
|
-
/**
|
|
3803
|
-
reloadPreview
|
|
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
|
|
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-
|
|
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>
|