Files
hyperframes/packages/studio/src/utils/timelineElementSplit.ts
T
Miguel Ángel ab08260201 refactor(studio): extract shared timeline components and deduplicate code (#1329)
Extract shared utilities to reduce duplication across timeline components:

- PlayheadIndicator: shared playhead rendering (was duplicated in
  TimelineCanvas and TimelineEditorNotice)
- useContextMenuDismiss: outside-click/Escape dismiss pattern (was
  duplicated in ClipContextMenu and KeyframeDiamondContextMenu)
- TimelineCallbacks: shared callback interfaces for drop and edit
  operations (was duplicated in NLELayout and Timeline props)
- useTimelineZoom: consolidated zoom store selectors
- timelineElementSplit: shared canSplitElement, buildPatchTarget, and
  readFileContent utilities
- gsapParser.test-helpers: shared test utilities for parser specs
2026-06-10 23:45:03 -04:00

14 lines
381 B
TypeScript

import type { TimelineElement } from "../player/store/playerStore";
export { buildPatchTarget, readFileContent } from "../hooks/timelineEditingHelpers";
export function canSplitElement(el: TimelineElement): boolean {
return (
!el.timelineLocked &&
el.timingSource !== "implicit" &&
!el.compositionSrc &&
!!el.duration &&
Number.isFinite(el.duration)
);
}