hyperframes 0.8.56 → 0.8.57

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.
@@ -304,7 +304,15 @@ interface PlayerProps {
304
304
  projectId?: string;
305
305
  directUrl?: string;
306
306
  onLoad: () => void;
307
+ /** Fires once the loaded document is painted and every loader (shader, assets) has cleared. */
308
+ onReadyToShowChange?: (ready: boolean) => void;
309
+ onPreviewError?: (message: string) => void;
307
310
  onCompositionLoadingChange?: (loading: boolean) => void;
311
+ onPainted?: (details: {
312
+ iframe: HTMLIFrameElement;
313
+ startedAt: number;
314
+ loadId: number;
315
+ }) => void;
308
316
  portrait?: boolean;
309
317
  style?: React.CSSProperties;
310
318
  suppressLoadingOverlay?: boolean;
@@ -1370,6 +1378,23 @@ interface CompositionThumbnailProps {
1370
1378
  /** Server-rendered composition poster, deduplicated and budgeted by project/session. */
1371
1379
  declare const CompositionThumbnail: react.NamedExoticComponent<CompositionThumbnailProps>;
1372
1380
 
1381
+ /**
1382
+ * React callbacks for synchronising the player store from iframe runtime data.
1383
+ *
1384
+ * Covers four related concerns:
1385
+ * - processTimelineMessage — turn a clip-manifest postMessage into TimelineElements
1386
+ * - enrichMissingCompositions — fill gaps the manifest misses (element-ref starts)
1387
+ * - initializeAdapter — called after iframe load: seek, set duration, read elements
1388
+ * - onIframeLoad — orchestrates initializeAdapter with a message-based fallback
1389
+ */
1390
+
1391
+ type PreviewIframeRole = "live" | "shadow";
1392
+ interface PreviewIframeSlot {
1393
+ gen: number;
1394
+ role: PreviewIframeRole;
1395
+ url?: string;
1396
+ }
1397
+
1373
1398
  /**
1374
1399
  * Runtime iframe integration utilities.
1375
1400
  *
@@ -1404,7 +1429,13 @@ declare const CompositionThumbnail: react.NamedExoticComponent<CompositionThumbn
1404
1429
  */
1405
1430
  declare function resolveIframe(el: Element | null): HTMLIFrameElement | null;
1406
1431
 
1407
- declare function useTimelinePlayer(): {
1432
+ interface UseTimelinePlayerOptions {
1433
+ /** Runs right after a reloaded preview becomes the live iframe. */
1434
+ onShadowPromoted?: () => void;
1435
+ /** A reload was abandoned (cause in the message); the previous preview is still showing. */
1436
+ onPreviewReloadFailed?: (message: string) => void;
1437
+ }
1438
+ declare function useTimelinePlayer({ onShadowPromoted, onPreviewReloadFailed, }?: UseTimelinePlayerOptions): {
1408
1439
  iframeRef: react.RefObject<HTMLIFrameElement | null>;
1409
1440
  play: () => void;
1410
1441
  pause: () => void;
@@ -1412,10 +1443,16 @@ declare function useTimelinePlayer(): {
1412
1443
  seek: (time: number, options?: {
1413
1444
  keepPlaying?: boolean;
1414
1445
  }) => boolean;
1415
- onIframeLoad: () => void;
1446
+ onIframeLoad: (context?: number) => void;
1416
1447
  refreshPlayer: () => void;
1417
1448
  saveSeekPosition: () => void;
1418
1449
  resetPlayer: () => void;
1450
+ previewSlots: PreviewIframeSlot[];
1451
+ onShadowIframeLoad: (context?: number) => void;
1452
+ onShadowReadyChange: (gen: number, ready: boolean) => void;
1453
+ onShadowError: (gen: number, cause: string) => void;
1454
+ setShadowIframeNode: (node: HTMLIFrameElement | null) => void;
1455
+ resetPreviewSlots: () => void;
1419
1456
  };
1420
1457
 
1421
1458
  declare function formatTime(time: number): string;
@@ -1496,10 +1533,21 @@ interface EditorShellProps extends TimelineEditCallbackDeps {
1496
1533
  }
1497
1534
  declare function EditorShell({ panels, timelineToolbar, renderClipContent, handleTimelineElementDelete, handleTimelineAssetDrop, handleTimelineBlockDrop, handleTimelineCompositionDrop, handlePreviewBlockDrop, handleTimelineFileDrop, handleTimelineElementMove, handleTimelineElementsMove, handleTimelineElementResize, handleTimelineGroupResize, handleToggleTrackHidden, setAudioGroupAttribute, handleGroupClips, setElementFxAttribute, handleBlockedTimelineEdit, handleTimelineElementSplit, handleRazorSplit, handleRazorSplitAll, onCopyClip, onPasteClip, onDuplicateClip, canPasteClip, setCompIdToSrc, setCompositionLoading, shouldShowMotionPath, shouldShowSelectedDomBounds, isGestureRecording, recordingState, onToggleRecording, blockPreview, gestureOverlay, readOnlyPreview, readOnlyPreviewReason, }: EditorShellProps): react_jsx_runtime.JSX.Element;
1498
1535
 
1536
+ interface PreviewCompositionSize {
1537
+ width: number;
1538
+ height: number;
1539
+ }
1540
+
1499
1541
  interface NLEPreviewProps {
1500
1542
  projectId: string;
1501
1543
  iframeRef: RefObject<HTMLIFrameElement | null>;
1502
1544
  onIframeLoad: () => void;
1545
+ previewSlots: PreviewIframeSlot[];
1546
+ onShadowIframeLoad: (gen: number) => void;
1547
+ onShadowReadyChange: (gen: number, ready: boolean) => void;
1548
+ onShadowError: (gen: number, message: string) => void;
1549
+ setShadowIframeNode: (node: HTMLIFrameElement | null) => void;
1550
+ resetPreviewSlots: () => void;
1503
1551
  onCompositionLoadingChange?: (loading: boolean) => void;
1504
1552
  portrait?: boolean;
1505
1553
  directUrl?: string;
@@ -1508,10 +1556,6 @@ interface NLEPreviewProps {
1508
1556
  /** Reports the authored composition size measured from the loaded preview. */
1509
1557
  onCompositionSizeChange?: (size: PreviewCompositionSize | null) => void;
1510
1558
  }
1511
- interface PreviewCompositionSize {
1512
- width: number;
1513
- height: number;
1514
- }
1515
1559
  declare const NLEPreview: react.NamedExoticComponent<NLEPreviewProps>;
1516
1560
 
1517
1561
  interface CompositionLevel {
@@ -1539,9 +1583,51 @@ interface DomEditCompositionRect {
1539
1583
 
1540
1584
  /**
1541
1585
  * Where the composition sits inside `overlayRef`, in overlay pixels, plus the scale from
1542
- * composition units to pixels. Follows the live preview iframe across reloads.
1586
+ * composition units to pixels.
1543
1587
  */
1544
- declare function usePreviewCompositionRect(overlayRef: RefObject<HTMLDivElement | null>): DomEditCompositionRect;
1588
+ declare function usePreviewCompositionRect(overlayRef: RefObject<HTMLDivElement | null>, iframe: HTMLIFrameElement | null): DomEditCompositionRect;
1589
+
1590
+ interface PreviewSnapPreferences {
1591
+ snapEnabled: boolean;
1592
+ gridVisible: boolean;
1593
+ gridSpacing: number;
1594
+ snapToGrid: boolean;
1595
+ }
1596
+ interface PreviewOverlayContextValue {
1597
+ state: {
1598
+ snapPrefs: PreviewSnapPreferences;
1599
+ rulerVisible: boolean;
1600
+ safeMarginsVisible: boolean;
1601
+ iframeRef: RefObject<HTMLIFrameElement | null>;
1602
+ compositionRect: DomEditCompositionRect;
1603
+ };
1604
+ actions: {
1605
+ setSnapPrefs: (patch: Partial<PreviewSnapPreferences>) => void;
1606
+ toggleRulers: () => void;
1607
+ toggleSafeMargins: () => void;
1608
+ };
1609
+ }
1610
+ interface PreviewOverlayProviderProps {
1611
+ iframe?: HTMLIFrameElement | null;
1612
+ children: ReactNode;
1613
+ }
1614
+ declare function PreviewOverlayProvider({ iframe, children }: PreviewOverlayProviderProps): react_jsx_runtime.JSX.Element;
1615
+ declare function usePreviewOverlayContext(): PreviewOverlayContextValue;
1616
+
1617
+ /** Ruler and safe-margin boxes drawn over the preview pane, never inside the composition. */
1618
+ declare const PreviewGuides: react.NamedExoticComponent<object>;
1619
+
1620
+ declare const GridOverlay: react.NamedExoticComponent<object>;
1621
+
1622
+ declare const SnapToolbar: react.NamedExoticComponent<object>;
1623
+
1624
+ type GuideKey = "rulerVisible" | "safeMarginsVisible";
1625
+ interface PreviewGuidesState {
1626
+ rulerVisible: boolean;
1627
+ safeMarginsVisible: boolean;
1628
+ toggle: (key: GuideKey) => void;
1629
+ }
1630
+ declare const usePreviewGuidesStore: zustand.UseBoundStore<zustand.StoreApi<PreviewGuidesState>>;
1545
1631
 
1546
1632
  interface SourceEditorProps {
1547
1633
  content: string;
@@ -2187,4 +2273,4 @@ declare function TimelineEditProvider({ value, children, }: {
2187
2273
  children: ReactNode;
2188
2274
  }): react_jsx_runtime.JSX.Element;
2189
2275
 
2190
- export { type AgentModalAnchorPoint, type AgentPromptElementInfo, AskAgentModal, type AskAgentModalProps, type BlockedTimelineEditIntent, Button, type ButtonSize, type ButtonVariant, type CanEditTimelineElement, CompositionBreadcrumb, type CompositionDimensions, type CompositionLevel, CompositionThumbnail, ContextMenu, type EditHistoryHandle, EditorShell, type EditorShellProps, type ExternalFileChangeBlockedState, type ExternalFileChangeCoordinatorHandle, ExternalFileConflictBanner, type FfmpegStatus, FileTree, HyperframesLoader, type HyperframesLoaderProps, HyperframesLogo, IconButton, Input, type InputProps, Menu, MenuItem, type MenuItemTone, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuShortcut, NLEPreview, NumberField, type NumberFieldProps, type PatchOperation, type PersistedRenderSettings, type PickedElement, Player, PlayerControls, Popover, type PopupPreviewState, type DomEditCompositionRect as PreviewCompositionRect, type PreviewState, PropertyPanel, type RenderJob, RenderQueue, type RenderQueueProps, type ResolutionPreset, Select, type SelectOption, type SelectProps, Slider, type SliderProps, SourceEditor, type StartRenderOptions, StudioApp, StudioFileConflictError, type StudioPendingEditsDrainResult, Tab, TabPanel, Tabs, TabsList, Timeline, type TimelineEditCallbacks, type TimelineEditPermission, TimelineEditProvider, type TimelineElement, TimelinePane, type TimelinePaneProps, type TimelineTimeRange, Toggle, type ToggleProps, Tooltip, type UseEditHistoryActionsOptions, type UsePersistentEditHistoryOptions, type UseProjectFileWriterOptions, type UseTimelineEditingOptions, VideoThumbnail, applyPatch, buildPickerAgentContextPreview, buildPickerAgentPrompt, buttonBase, buttonSizes, buttonVariants, cn, fieldBase, fieldText, findElementBlock, flushStudioPendingEdits, formatTime, getPersistedRenderSettings, liveTime, mergeStyleIntoTag, parseStyleString, persistRenderSettings, popupSurface, resolveIframe, resolveSourceFile, useEditHistoryActions, useElementPicker, usePersistentEditHistory, usePlayerStore, usePreviewCompositionRect, useProjectFileWriter, useRenderQueue, useTimelineEditing, useTimelinePlayer };
2276
+ export { type AgentModalAnchorPoint, type AgentPromptElementInfo, AskAgentModal, type AskAgentModalProps, type BlockedTimelineEditIntent, Button, type ButtonSize, type ButtonVariant, type CanEditTimelineElement, CompositionBreadcrumb, type CompositionDimensions, type CompositionLevel, CompositionThumbnail, ContextMenu, type EditHistoryHandle, EditorShell, type EditorShellProps, type ExternalFileChangeBlockedState, type ExternalFileChangeCoordinatorHandle, ExternalFileConflictBanner, type FfmpegStatus, FileTree, GridOverlay, HyperframesLoader, type HyperframesLoaderProps, HyperframesLogo, IconButton, Input, type InputProps, Menu, MenuItem, type MenuItemTone, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuShortcut, NLEPreview, NumberField, type NumberFieldProps, type PatchOperation, type PersistedRenderSettings, type PickedElement, Player, PlayerControls, Popover, type PopupPreviewState, type DomEditCompositionRect as PreviewCompositionRect, PreviewGuides, PreviewOverlayProvider, type PreviewOverlayProviderProps, type PreviewSnapPreferences, type PreviewState, PropertyPanel, type RenderJob, RenderQueue, type RenderQueueProps, type ResolutionPreset, Select, type SelectOption, type SelectProps, Slider, type SliderProps, SnapToolbar, SourceEditor, type StartRenderOptions, StudioApp, StudioFileConflictError, type StudioPendingEditsDrainResult, Tab, TabPanel, Tabs, TabsList, Timeline, type TimelineEditCallbacks, type TimelineEditPermission, TimelineEditProvider, type TimelineElement, TimelinePane, type TimelinePaneProps, type TimelineTimeRange, Toggle, type ToggleProps, Tooltip, type UseEditHistoryActionsOptions, type UsePersistentEditHistoryOptions, type UseProjectFileWriterOptions, type UseTimelineEditingOptions, VideoThumbnail, applyPatch, buildPickerAgentContextPreview, buildPickerAgentPrompt, buttonBase, buttonSizes, buttonVariants, cn, fieldBase, fieldText, findElementBlock, flushStudioPendingEdits, formatTime, getPersistedRenderSettings, liveTime, mergeStyleIntoTag, parseStyleString, persistRenderSettings, popupSurface, resolveIframe, resolveSourceFile, useEditHistoryActions, useElementPicker, usePersistentEditHistory, usePlayerStore, usePreviewCompositionRect, usePreviewGuidesStore, usePreviewOverlayContext, useProjectFileWriter, useRenderQueue, useTimelineEditing, useTimelinePlayer };
@@ -5,8 +5,8 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
6
6
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
7
7
  <title>HyperFrames Studio</title>
8
- <script type="module" crossorigin src="/assets/index-BlkJ_Axe.js"></script>
9
- <link rel="stylesheet" crossorigin href="/assets/index-ZmBtVrEm.css">
8
+ <script type="module" crossorigin src="/assets/index-gbOCDCuZ.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-DKJpHYYd.css">
10
10
  </head>
11
11
  <body>
12
12
  <div data-hf-id="hf-aph5" id="root"></div>