hyperframes 0.8.71 → 0.8.73
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/cli.js +456 -386
- package/dist/fontLocalizeCli.js +93 -59
- package/dist/hyperframe-runtime.js +45 -45
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +45 -45
- package/dist/hyperframes-player.global.js +3 -3
- package/dist/studio/assets/{hyperframes-player-DuN39PN6.js → hyperframes-player-BUauoSsb.js} +1 -1
- package/dist/studio/assets/{index-BoQsbDgf.js → index-CMFPPAGq.js} +1 -1
- package/dist/studio/assets/{index-BmCEvqsr.js → index-DKInxDDv.js} +1 -1
- package/dist/studio/assets/{index-CUcdruHw.js → index-DxIHGgGZ.js} +163 -163
- package/dist/studio/index.d.ts +16 -1
- package/dist/studio/index.html +1 -1
- package/dist/studio/index.js +129 -92
- package/dist/studio/index.js.map +1 -1
- package/package.json +1 -1
package/dist/studio/index.d.ts
CHANGED
|
@@ -326,12 +326,25 @@ interface PlayerProps {
|
|
|
326
326
|
*/
|
|
327
327
|
declare const Player: react.ForwardRefExoticComponent<PlayerProps & react.RefAttributes<HTMLIFrameElement>>;
|
|
328
328
|
|
|
329
|
+
interface ShortcutHint {
|
|
330
|
+
key: string;
|
|
331
|
+
label: string;
|
|
332
|
+
}
|
|
333
|
+
interface ShortcutSection {
|
|
334
|
+
title: string;
|
|
335
|
+
hints: readonly ShortcutHint[];
|
|
336
|
+
}
|
|
337
|
+
/** What PlayerControls' shortcuts panel lists unless an embedder passes its own sections. */
|
|
338
|
+
declare const DEFAULT_SHORTCUT_SECTIONS: readonly ShortcutSection[];
|
|
339
|
+
|
|
329
340
|
interface PlayerControlsProps {
|
|
330
341
|
onTogglePlay: () => void;
|
|
331
342
|
onSeek: (time: number) => void;
|
|
332
343
|
disabled?: boolean;
|
|
333
344
|
isFullscreen?: boolean;
|
|
334
345
|
onToggleFullscreen?: () => void;
|
|
346
|
+
/** Replaces the shortcuts panel's list, e.g. DEFAULT_SHORTCUT_SECTIONS with entries dropped or relabelled. */
|
|
347
|
+
shortcutSections?: readonly ShortcutSection[];
|
|
335
348
|
}
|
|
336
349
|
declare const PlayerControls: react.NamedExoticComponent<PlayerControlsProps>;
|
|
337
350
|
|
|
@@ -2124,6 +2137,8 @@ interface NLEPreviewProps {
|
|
|
2124
2137
|
onStageRef?: (ref: React.RefObject<HTMLDivElement | null>) => void;
|
|
2125
2138
|
/** Reports the authored composition size measured from the loaded preview. */
|
|
2126
2139
|
onCompositionSizeChange?: (size: PreviewCompositionSize | null) => void;
|
|
2140
|
+
/** Draws the picture edge to edge in this box, without Studio's inset band. */
|
|
2141
|
+
fillBox?: boolean;
|
|
2127
2142
|
}
|
|
2128
2143
|
declare const NLEPreview: react.NamedExoticComponent<NLEPreviewProps>;
|
|
2129
2144
|
|
|
@@ -2885,4 +2900,4 @@ declare function TimelineEditProvider({ value, children, }: {
|
|
|
2885
2900
|
children: ReactNode;
|
|
2886
2901
|
}): react_jsx_runtime.JSX.Element;
|
|
2887
2902
|
|
|
2888
|
-
export { type AgentModalAnchorPoint, type AgentPromptElementInfo, AskAgentModal, type AskAgentModalProps, AudioWaveform, type AudioWaveformProps, 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, ImageThumbnail, type ImageThumbnailProps, Input, type InputProps, Menu, MenuItem, type MenuItemTone, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuShortcut, NLEPreview, NumberField, type NumberFieldProps, type PatchOperation, type PersistedRenderSettings, type PickedElement, Player, PlayerControls, type PlayerHandle, type PlayerHandleElement, type PlayerHandleListener, type PlayerHandleTimeListener, 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, type ThumbnailPriority, Timeline, TimelineClipMenu, type TimelineClipRenderContext, type TimelineEditCallbacks, type TimelineEditPermission, TimelineEditPopover, TimelineEditProvider, type TimelineElement, TimelineEmptyStatePart, TimelineFrame, TimelineGapMenu, TimelineKeyframeMenu, TimelineLanes, TimelineOverlays, TimelinePane, type TimelinePaneProps, TimelinePlayhead, TimelineProvider, TimelineRazorGuide, TimelineRuler, TimelineShortcutHint, type TimelineTheme, type TimelineTimeRange$1 as TimelineTimeRange, Toggle, type ToggleProps, Tooltip, type UseEditHistoryActionsOptions, type UsePersistentEditHistoryOptions, type UseProjectFileWriterOptions, type UseRenderClipContentOptions, 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, usePlayerHandle, usePlayerStore, usePreviewCompositionRect, usePreviewGuidesStore, usePreviewOverlayContext, useProjectFileWriter, useRenderClipContent, useRenderQueue, useTimelineContext, useTimelineEditing, useTimelinePlayer };
|
|
2903
|
+
export { type AgentModalAnchorPoint, type AgentPromptElementInfo, AskAgentModal, type AskAgentModalProps, AudioWaveform, type AudioWaveformProps, type BlockedTimelineEditIntent, Button, type ButtonSize, type ButtonVariant, type CanEditTimelineElement, CompositionBreadcrumb, type CompositionDimensions, type CompositionLevel, CompositionThumbnail, ContextMenu, DEFAULT_SHORTCUT_SECTIONS, type EditHistoryHandle, EditorShell, type EditorShellProps, type ExternalFileChangeBlockedState, type ExternalFileChangeCoordinatorHandle, ExternalFileConflictBanner, type FfmpegStatus, FileTree, GridOverlay, HyperframesLoader, type HyperframesLoaderProps, HyperframesLogo, IconButton, ImageThumbnail, type ImageThumbnailProps, Input, type InputProps, Menu, MenuItem, type MenuItemTone, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuShortcut, NLEPreview, NumberField, type NumberFieldProps, type PatchOperation, type PersistedRenderSettings, type PickedElement, Player, PlayerControls, type PlayerHandle, type PlayerHandleElement, type PlayerHandleListener, type PlayerHandleTimeListener, 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, type ShortcutHint, type ShortcutSection, Slider, type SliderProps, SnapToolbar, SourceEditor, type StartRenderOptions, StudioApp, StudioFileConflictError, type StudioPendingEditsDrainResult, Tab, TabPanel, Tabs, TabsList, type ThumbnailPriority, Timeline, TimelineClipMenu, type TimelineClipRenderContext, type TimelineEditCallbacks, type TimelineEditPermission, TimelineEditPopover, TimelineEditProvider, type TimelineElement, TimelineEmptyStatePart, TimelineFrame, TimelineGapMenu, TimelineKeyframeMenu, TimelineLanes, TimelineOverlays, TimelinePane, type TimelinePaneProps, TimelinePlayhead, TimelineProvider, TimelineRazorGuide, TimelineRuler, TimelineShortcutHint, type TimelineTheme, type TimelineTimeRange$1 as TimelineTimeRange, Toggle, type ToggleProps, Tooltip, type UseEditHistoryActionsOptions, type UsePersistentEditHistoryOptions, type UseProjectFileWriterOptions, type UseRenderClipContentOptions, 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, usePlayerHandle, usePlayerStore, usePreviewCompositionRect, usePreviewGuidesStore, usePreviewOverlayContext, useProjectFileWriter, useRenderClipContent, useRenderQueue, useTimelineContext, useTimelineEditing, useTimelinePlayer };
|
package/dist/studio/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
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-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-DxIHGgGZ.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-0w6iIlwZ.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
package/dist/studio/index.js
CHANGED
|
@@ -3500,11 +3500,15 @@ function isHtmlElement2(el) {
|
|
|
3500
3500
|
const HtmlElementCtor = el.ownerDocument.defaultView?.HTMLElement ?? globalThis.HTMLElement;
|
|
3501
3501
|
return typeof HtmlElementCtor !== "undefined" && el instanceof HtmlElementCtor;
|
|
3502
3502
|
}
|
|
3503
|
+
function isCompositionHost(el) {
|
|
3504
|
+
return el.hasAttribute("data-composition-id") || el.hasAttribute("data-composition-src") || el.hasAttribute("data-composition-file");
|
|
3505
|
+
}
|
|
3503
3506
|
function resolveMediaElement(el) {
|
|
3504
3507
|
const win = el.ownerDocument.defaultView ?? window;
|
|
3505
3508
|
const MediaElementCtor = win.HTMLMediaElement ?? globalThis.HTMLMediaElement;
|
|
3506
3509
|
const ImageElementCtor = win.HTMLImageElement ?? globalThis.HTMLImageElement;
|
|
3507
3510
|
if (el instanceof MediaElementCtor || el instanceof ImageElementCtor) return el;
|
|
3511
|
+
if (isCompositionHost(el)) return null;
|
|
3508
3512
|
const candidate = el.querySelector("video, audio, img");
|
|
3509
3513
|
return candidate instanceof MediaElementCtor || candidate instanceof ImageElementCtor ? candidate : null;
|
|
3510
3514
|
}
|
|
@@ -4309,9 +4313,10 @@ function useContextMenuDismiss(onClose) {
|
|
|
4309
4313
|
return menuRef;
|
|
4310
4314
|
}
|
|
4311
4315
|
|
|
4312
|
-
// src/player/components/
|
|
4313
|
-
|
|
4314
|
-
var
|
|
4316
|
+
// src/player/components/studioShortcuts.ts
|
|
4317
|
+
var STUDIO_PLAIN_KEYS = { fullscreen: "f", split: "s", record: "r" };
|
|
4318
|
+
var hintKey = (key2) => key2.toUpperCase();
|
|
4319
|
+
var DEFAULT_SHORTCUT_SECTIONS = [
|
|
4315
4320
|
{
|
|
4316
4321
|
title: "Playback",
|
|
4317
4322
|
hints: [
|
|
@@ -4323,7 +4328,7 @@ var SHORTCUT_SECTIONS = [
|
|
|
4323
4328
|
{ key: "\u21E7L", label: "Toggle loop" },
|
|
4324
4329
|
{ key: "\u2190/\u2192", label: "Step 1 frame" },
|
|
4325
4330
|
{ key: "\u21E7\u2190/\u21E7\u2192", label: "Step 10 frames" },
|
|
4326
|
-
{ key:
|
|
4331
|
+
{ key: hintKey(STUDIO_PLAIN_KEYS.fullscreen), label: "Toggle fullscreen" }
|
|
4327
4332
|
]
|
|
4328
4333
|
},
|
|
4329
4334
|
{
|
|
@@ -4333,7 +4338,7 @@ var SHORTCUT_SECTIONS = [
|
|
|
4333
4338
|
{ key: "Del", label: "Delete selected keyframe" },
|
|
4334
4339
|
{ key: "H", label: "Toggle hold / bezier" },
|
|
4335
4340
|
{ key: "U", label: "Expand / collapse properties" },
|
|
4336
|
-
{ key:
|
|
4341
|
+
{ key: hintKey(STUDIO_PLAIN_KEYS.record), label: "Record gesture" }
|
|
4337
4342
|
]
|
|
4338
4343
|
},
|
|
4339
4344
|
{
|
|
@@ -4344,7 +4349,7 @@ var SHORTCUT_SECTIONS = [
|
|
|
4344
4349
|
{ key: "\u2318C", label: "Copy element" },
|
|
4345
4350
|
{ key: "\u2318V", label: "Paste element" },
|
|
4346
4351
|
{ key: "\u2318X", label: "Cut element" },
|
|
4347
|
-
{ key:
|
|
4352
|
+
{ key: hintKey(STUDIO_PLAIN_KEYS.split), label: "Split clip at playhead" },
|
|
4348
4353
|
{ key: "\u21E7Click", label: "Razor tool: split all tracks" },
|
|
4349
4354
|
{ key: "\u2318G", label: "Group elements" },
|
|
4350
4355
|
{ key: "\u2318\u21E7G", label: "Ungroup" },
|
|
@@ -4396,6 +4401,9 @@ var SHORTCUT_SECTIONS = [
|
|
|
4396
4401
|
]
|
|
4397
4402
|
}
|
|
4398
4403
|
];
|
|
4404
|
+
|
|
4405
|
+
// src/player/components/ShortcutsPanel.tsx
|
|
4406
|
+
import { Fragment, jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
4399
4407
|
var ShortcutsPanel = memo(function ShortcutsPanel2({
|
|
4400
4408
|
disabled,
|
|
4401
4409
|
duration,
|
|
@@ -4403,7 +4411,8 @@ var ShortcutsPanel = memo(function ShortcutsPanel2({
|
|
|
4403
4411
|
outPoint,
|
|
4404
4412
|
setInPoint,
|
|
4405
4413
|
setOutPoint,
|
|
4406
|
-
onSeek
|
|
4414
|
+
onSeek,
|
|
4415
|
+
sections = DEFAULT_SHORTCUT_SECTIONS
|
|
4407
4416
|
}) {
|
|
4408
4417
|
const [showShortcuts, setShowShortcuts] = useState7(false);
|
|
4409
4418
|
const [jumpFrame, setJumpFrame] = useState7("");
|
|
@@ -4597,9 +4606,9 @@ var ShortcutsPanel = memo(function ShortcutsPanel2({
|
|
|
4597
4606
|
] })
|
|
4598
4607
|
] }),
|
|
4599
4608
|
/* @__PURE__ */ jsx23("div", { style: { borderTop: "1px solid rgba(255,255,255,0.06)" } }),
|
|
4600
|
-
/* @__PURE__ */ jsx23("div", { className: "px-3 pt-2.5 pb-3 flex flex-col gap-3", children:
|
|
4609
|
+
/* @__PURE__ */ jsx23("div", { className: "px-3 pt-2.5 pb-3 flex flex-col gap-3", children: sections.map((section, sectionIndex) => /* @__PURE__ */ jsxs16("div", { children: [
|
|
4601
4610
|
/* @__PURE__ */ jsx23("p", { className: "text-[9px] font-medium text-neutral-500 uppercase tracking-wider mb-1.5", children: section.title }),
|
|
4602
|
-
/* @__PURE__ */ jsx23("div", { className: "flex flex-col gap-1", children: section.hints.map((hint) => /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-3", children: [
|
|
4611
|
+
/* @__PURE__ */ jsx23("div", { className: "flex flex-col gap-1", children: section.hints.map((hint, hintIndex) => /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-3", children: [
|
|
4603
4612
|
/* @__PURE__ */ jsx23(
|
|
4604
4613
|
"span",
|
|
4605
4614
|
{
|
|
@@ -4609,8 +4618,8 @@ var ShortcutsPanel = memo(function ShortcutsPanel2({
|
|
|
4609
4618
|
}
|
|
4610
4619
|
),
|
|
4611
4620
|
/* @__PURE__ */ jsx23("span", { className: "text-[10px] text-neutral-400", children: hint.label })
|
|
4612
|
-
] },
|
|
4613
|
-
] },
|
|
4621
|
+
] }, hintIndex)) })
|
|
4622
|
+
] }, sectionIndex)) })
|
|
4614
4623
|
]
|
|
4615
4624
|
}
|
|
4616
4625
|
)
|
|
@@ -4878,7 +4887,8 @@ var PlayerControls = memo4(function PlayerControls2({
|
|
|
4878
4887
|
onSeek,
|
|
4879
4888
|
disabled = false,
|
|
4880
4889
|
isFullscreen = false,
|
|
4881
|
-
onToggleFullscreen
|
|
4890
|
+
onToggleFullscreen,
|
|
4891
|
+
shortcutSections
|
|
4882
4892
|
}) {
|
|
4883
4893
|
const isPlaying = usePlayerStore((s) => s.isPlaying);
|
|
4884
4894
|
const duration = usePlayerStore((s) => s.duration);
|
|
@@ -5002,7 +5012,8 @@ var PlayerControls = memo4(function PlayerControls2({
|
|
|
5002
5012
|
outPoint,
|
|
5003
5013
|
setInPoint,
|
|
5004
5014
|
setOutPoint,
|
|
5005
|
-
onSeek
|
|
5015
|
+
onSeek,
|
|
5016
|
+
sections: shortcutSections
|
|
5006
5017
|
}
|
|
5007
5018
|
)
|
|
5008
5019
|
] })
|
|
@@ -6561,7 +6572,7 @@ function useTimelinePlayhead({
|
|
|
6561
6572
|
previousAnchorPpsRef.current = pps;
|
|
6562
6573
|
const skip = skipCenterAnchorRef.current;
|
|
6563
6574
|
skipCenterAnchorRef.current = false;
|
|
6564
|
-
if (!scroll || pps === prevPps || skip) return;
|
|
6575
|
+
if (!scroll || pps === prevPps || skip || scroll.scrollLeft < 1) return;
|
|
6565
6576
|
const nextScrollLeft = getTimelineScrollLeftForZoomAnchor({
|
|
6566
6577
|
pointerX: scroll.clientWidth / 2,
|
|
6567
6578
|
currentScrollLeft: scroll.scrollLeft,
|
|
@@ -27575,10 +27586,10 @@ function parseTimelineFromDOM(doc, rootDuration, timelines) {
|
|
|
27575
27586
|
if (compSrc) {
|
|
27576
27587
|
entry2.compositionSrc = compSrc;
|
|
27577
27588
|
} else if (compId && compId !== rootComp?.getAttribute("data-composition-id")) {
|
|
27578
|
-
const
|
|
27579
|
-
if (
|
|
27580
|
-
entry2.src =
|
|
27581
|
-
entry2.tag = "video";
|
|
27589
|
+
const innerMedia = el.querySelector("video[src], img[src]");
|
|
27590
|
+
if (innerMedia) {
|
|
27591
|
+
entry2.src = innerMedia.getAttribute("src") || void 0;
|
|
27592
|
+
entry2.tag = innerMedia.tagName === "IMG" ? "img" : "video";
|
|
27582
27593
|
}
|
|
27583
27594
|
}
|
|
27584
27595
|
if (entry2.kind === "composition") {
|
|
@@ -28068,6 +28079,7 @@ var logReload = makeStudioDebugLogger("reload");
|
|
|
28068
28079
|
|
|
28069
28080
|
// src/player/hooks/useShadowPreviewReload.ts
|
|
28070
28081
|
var SHADOW_READY_TIMEOUT_MS = 15e3;
|
|
28082
|
+
var SHADOW_READY_BUDGETS = 3;
|
|
28071
28083
|
function isDocumentHidden() {
|
|
28072
28084
|
return typeof document !== "undefined" && document.visibilityState === "hidden";
|
|
28073
28085
|
}
|
|
@@ -28096,6 +28108,7 @@ function useShadowPreviewReload({
|
|
|
28096
28108
|
const onReloadFailedRef = useRef51(onReloadFailed);
|
|
28097
28109
|
onReloadFailedRef.current = onReloadFailed;
|
|
28098
28110
|
const readyTimerRef = useRef51(void 0);
|
|
28111
|
+
const budgetsSpentRef = useRef51(0);
|
|
28099
28112
|
const budgetGenRef = useRef51(null);
|
|
28100
28113
|
const cancelPendingLoadRef = useRef51(() => {
|
|
28101
28114
|
});
|
|
@@ -28187,10 +28200,16 @@ function useShadowPreviewReload({
|
|
|
28187
28200
|
(gen) => {
|
|
28188
28201
|
clearTimeout(readyTimerRef.current);
|
|
28189
28202
|
if (isDocumentHidden()) return;
|
|
28190
|
-
readyTimerRef.current = setTimeout(
|
|
28191
|
-
|
|
28192
|
-
|
|
28193
|
-
|
|
28203
|
+
readyTimerRef.current = setTimeout(() => {
|
|
28204
|
+
if (gen !== shadowGenRef.current) return;
|
|
28205
|
+
budgetsSpentRef.current += 1;
|
|
28206
|
+
if (budgetsSpentRef.current < SHADOW_READY_BUDGETS) {
|
|
28207
|
+
logReload("shadow-slow", { budgetsSpent: budgetsSpentRef.current });
|
|
28208
|
+
armReadyTimerRef.current(gen);
|
|
28209
|
+
return;
|
|
28210
|
+
}
|
|
28211
|
+
failShadow(gen, "it took too long to load");
|
|
28212
|
+
}, SHADOW_READY_TIMEOUT_MS);
|
|
28194
28213
|
},
|
|
28195
28214
|
[failShadow]
|
|
28196
28215
|
);
|
|
@@ -28202,6 +28221,7 @@ function useShadowPreviewReload({
|
|
|
28202
28221
|
const gen = shadowGenRef.current;
|
|
28203
28222
|
stopPendingShadow();
|
|
28204
28223
|
budgetGenRef.current = gen;
|
|
28224
|
+
budgetsSpentRef.current = 0;
|
|
28205
28225
|
armReadyTimer(gen);
|
|
28206
28226
|
setPreviewSlots((prev) => planShadowReload(prev, gen, url));
|
|
28207
28227
|
thumbnailScheduler.setPreviewReloading(true);
|
|
@@ -29672,7 +29692,7 @@ function getPreviewPlayerKey({
|
|
|
29672
29692
|
}
|
|
29673
29693
|
var ZOOM_HUD_TIMEOUT_MS = 1200;
|
|
29674
29694
|
var ZOOM_SETTLE_MS = 200;
|
|
29675
|
-
var PREVIEW_STAGE_INSET_PX =
|
|
29695
|
+
var PREVIEW_STAGE_INSET_PX = 8;
|
|
29676
29696
|
var SHADOW_IFRAME_STYLE = {
|
|
29677
29697
|
position: "absolute",
|
|
29678
29698
|
inset: 0,
|
|
@@ -29691,9 +29711,9 @@ function loadInitialZoom() {
|
|
|
29691
29711
|
panY: stored.panY
|
|
29692
29712
|
} : DEFAULT_PREVIEW_ZOOM;
|
|
29693
29713
|
}
|
|
29694
|
-
function resolvePreviewStageSize(viewportWidth, viewportHeight, compositionSize, portrait, gutterPx = 0) {
|
|
29695
|
-
const availableWidth = Math.max(0, viewportWidth -
|
|
29696
|
-
const availableHeight = Math.max(0, viewportHeight -
|
|
29714
|
+
function resolvePreviewStageSize(viewportWidth, viewportHeight, compositionSize, portrait, gutterPx = 0, insetPx = PREVIEW_STAGE_INSET_PX) {
|
|
29715
|
+
const availableWidth = Math.max(0, viewportWidth - 2 * (insetPx + gutterPx));
|
|
29716
|
+
const availableHeight = Math.max(0, viewportHeight - 2 * (insetPx + gutterPx));
|
|
29697
29717
|
const aspectRatio = compositionSize && compositionSize.width > 0 && compositionSize.height > 0 ? compositionSize.width / compositionSize.height : portrait ? 9 / 16 : 16 / 9;
|
|
29698
29718
|
if (availableWidth === 0 || availableHeight === 0) {
|
|
29699
29719
|
return { width: 0, height: 0 };
|
|
@@ -29724,7 +29744,8 @@ var NLEPreview = memo19(function NLEPreview2({
|
|
|
29724
29744
|
directUrl,
|
|
29725
29745
|
suppressLoadingOverlay,
|
|
29726
29746
|
onStageRef,
|
|
29727
|
-
onCompositionSizeChange
|
|
29747
|
+
onCompositionSizeChange,
|
|
29748
|
+
fillBox
|
|
29728
29749
|
}) {
|
|
29729
29750
|
const activeKey = getPreviewPlayerKey({ projectId, directUrl });
|
|
29730
29751
|
const viewportRef = useRef56(null);
|
|
@@ -29743,6 +29764,7 @@ var NLEPreview = memo19(function NLEPreview2({
|
|
|
29743
29764
|
const reportPreviewFirstFrame = usePreviewFirstFrameTelemetry(previewSlots);
|
|
29744
29765
|
const [compositionSize, setCompositionSize] = useState37(null);
|
|
29745
29766
|
const gutterPx = usePreviewGuidesStore((s) => s.rulerVisible ? RULER_GUTTER_PX : 0);
|
|
29767
|
+
const insetPx = fillBox ? 0 : PREVIEW_STAGE_INSET_PX;
|
|
29746
29768
|
const [stageSize, setStageSize] = useState37(() => resolvePreviewStageSize(0, 0, null, portrait));
|
|
29747
29769
|
const zoomRef = useRef56(loadInitialZoom());
|
|
29748
29770
|
const [settledZoom, setSettledZoom] = useState37(() => zoomRef.current);
|
|
@@ -29763,14 +29785,21 @@ var NLEPreview = memo19(function NLEPreview2({
|
|
|
29763
29785
|
const updateStageSize = () => {
|
|
29764
29786
|
const rect = viewport.getBoundingClientRect();
|
|
29765
29787
|
setStageSize(
|
|
29766
|
-
resolvePreviewStageSize(
|
|
29788
|
+
resolvePreviewStageSize(
|
|
29789
|
+
rect.width,
|
|
29790
|
+
rect.height,
|
|
29791
|
+
compositionSize,
|
|
29792
|
+
portrait,
|
|
29793
|
+
gutterPx,
|
|
29794
|
+
insetPx
|
|
29795
|
+
)
|
|
29767
29796
|
);
|
|
29768
29797
|
};
|
|
29769
29798
|
updateStageSize();
|
|
29770
29799
|
const observer = new ResizeObserver(updateStageSize);
|
|
29771
29800
|
observer.observe(viewport);
|
|
29772
29801
|
return () => observer.disconnect();
|
|
29773
|
-
}, [compositionSize, portrait, gutterPx]);
|
|
29802
|
+
}, [compositionSize, portrait, gutterPx, insetPx]);
|
|
29774
29803
|
const onCompositionSizeChangeRef = useRef56(onCompositionSizeChange);
|
|
29775
29804
|
onCompositionSizeChangeRef.current = onCompositionSizeChange;
|
|
29776
29805
|
const updateCompositionSizeFromPreview = useCallback45(() => {
|
|
@@ -29996,77 +30025,84 @@ var NLEPreview = memo19(function NLEPreview2({
|
|
|
29996
30025
|
"div",
|
|
29997
30026
|
{
|
|
29998
30027
|
ref: viewportRef,
|
|
29999
|
-
className: "relative flex-1 flex items-center justify-center
|
|
30028
|
+
className: "relative flex-1 flex items-center justify-center overflow-hidden min-h-0 outline-hidden focus:ring-1 focus:ring-studio-accent/40 bg-[var(--studio-preview-bg,var(--color-neutral-950))]",
|
|
30000
30029
|
tabIndex: 0,
|
|
30001
30030
|
"aria-label": "Composition preview",
|
|
30002
30031
|
children: [
|
|
30003
|
-
/* @__PURE__ */ jsx86(
|
|
30032
|
+
/* @__PURE__ */ jsx86(
|
|
30004
30033
|
"div",
|
|
30005
30034
|
{
|
|
30006
|
-
|
|
30007
|
-
|
|
30008
|
-
|
|
30009
|
-
|
|
30010
|
-
|
|
30011
|
-
|
|
30012
|
-
|
|
30013
|
-
|
|
30014
|
-
|
|
30015
|
-
|
|
30016
|
-
|
|
30017
|
-
|
|
30018
|
-
|
|
30019
|
-
{
|
|
30020
|
-
projectId,
|
|
30021
|
-
onLoad: () => {
|
|
30022
|
-
},
|
|
30023
|
-
portrait,
|
|
30024
|
-
suppressLoadingOverlay: true,
|
|
30025
|
-
style: { position: "absolute", inset: 0, zIndex: 0 }
|
|
30035
|
+
className: "absolute flex items-center justify-center pointer-events-none",
|
|
30036
|
+
style: { inset: insetPx },
|
|
30037
|
+
children: /* @__PURE__ */ jsxs61(
|
|
30038
|
+
"div",
|
|
30039
|
+
{
|
|
30040
|
+
ref: stageRef,
|
|
30041
|
+
className: "relative shrink-0 pointer-events-auto",
|
|
30042
|
+
style: {
|
|
30043
|
+
width: `${stageSize.width}px`,
|
|
30044
|
+
height: `${stageSize.height}px`,
|
|
30045
|
+
transform: `translate3d(${toDomPrecision(initial.panX)}px, ${toDomPrecision(initial.panY)}px, 0) scale(${toDomPrecision(initial.zoomPercent / 100)})`,
|
|
30046
|
+
// resolvePreviewWheelZoom cursor math assumes center-center pivot
|
|
30047
|
+
transformOrigin: "center center"
|
|
30026
30048
|
},
|
|
30027
|
-
|
|
30028
|
-
|
|
30029
|
-
|
|
30030
|
-
(slot) => slot.role === "live" ? /* @__PURE__ */ jsx86(
|
|
30031
|
-
Player,
|
|
30032
|
-
{
|
|
30033
|
-
ref: setPreviewIframeRef,
|
|
30034
|
-
projectId: directUrl ? void 0 : projectId,
|
|
30035
|
-
directUrl,
|
|
30036
|
-
onLoad: () => {
|
|
30037
|
-
updateCompositionSizeFromPreview();
|
|
30038
|
-
onIframeLoad();
|
|
30039
|
-
applyInitialZoom();
|
|
30040
|
-
},
|
|
30041
|
-
onCompositionLoadingChange,
|
|
30042
|
-
onPainted: (details) => reportPreviewFirstFrame(slot, details),
|
|
30043
|
-
portrait,
|
|
30044
|
-
suppressLoadingOverlay,
|
|
30045
|
-
style: directUrl?.includes("/components/") ? { position: "absolute", inset: 0, zIndex: 1 } : void 0
|
|
30046
|
-
},
|
|
30047
|
-
`${activeKey}-${slot.gen}`
|
|
30048
|
-
) : (
|
|
30049
|
-
// Loads hidden behind the live slot until promoted.
|
|
30050
|
-
/* @__PURE__ */ jsx86(
|
|
30049
|
+
"data-testid": "preview-zoom-stage",
|
|
30050
|
+
children: [
|
|
30051
|
+
directUrl?.includes("/components/") && /* @__PURE__ */ jsx86(
|
|
30051
30052
|
Player,
|
|
30052
30053
|
{
|
|
30053
|
-
|
|
30054
|
-
|
|
30055
|
-
|
|
30056
|
-
onReadyToShowChange: (ready) => onShadowReadyChange(slot.gen, ready),
|
|
30057
|
-
onPainted: (details) => reportPreviewFirstFrame(slot, details),
|
|
30058
|
-
onPreviewError: (message) => onShadowError(slot.gen, message),
|
|
30054
|
+
projectId,
|
|
30055
|
+
onLoad: () => {
|
|
30056
|
+
},
|
|
30059
30057
|
portrait,
|
|
30060
30058
|
suppressLoadingOverlay: true,
|
|
30061
|
-
style:
|
|
30059
|
+
style: { position: "absolute", inset: 0, zIndex: 0 }
|
|
30062
30060
|
},
|
|
30063
|
-
|
|
30061
|
+
`backdrop-${projectId}`
|
|
30062
|
+
),
|
|
30063
|
+
previewSlots.map(
|
|
30064
|
+
(slot) => slot.role === "live" ? /* @__PURE__ */ jsx86(
|
|
30065
|
+
Player,
|
|
30066
|
+
{
|
|
30067
|
+
ref: setPreviewIframeRef,
|
|
30068
|
+
projectId: directUrl ? void 0 : projectId,
|
|
30069
|
+
directUrl,
|
|
30070
|
+
onLoad: () => {
|
|
30071
|
+
updateCompositionSizeFromPreview();
|
|
30072
|
+
onIframeLoad();
|
|
30073
|
+
applyInitialZoom();
|
|
30074
|
+
},
|
|
30075
|
+
onCompositionLoadingChange,
|
|
30076
|
+
onPainted: (details) => reportPreviewFirstFrame(slot, details),
|
|
30077
|
+
portrait,
|
|
30078
|
+
suppressLoadingOverlay,
|
|
30079
|
+
style: directUrl?.includes("/components/") ? { position: "absolute", inset: 0, zIndex: 1 } : void 0
|
|
30080
|
+
},
|
|
30081
|
+
`${activeKey}-${slot.gen}`
|
|
30082
|
+
) : (
|
|
30083
|
+
// Loads hidden behind the live slot until promoted.
|
|
30084
|
+
/* @__PURE__ */ jsx86(
|
|
30085
|
+
Player,
|
|
30086
|
+
{
|
|
30087
|
+
ref: setShadowIframeNode,
|
|
30088
|
+
directUrl: slot.url,
|
|
30089
|
+
onLoad: () => onShadowIframeLoad(slot.gen),
|
|
30090
|
+
onReadyToShowChange: (ready) => onShadowReadyChange(slot.gen, ready),
|
|
30091
|
+
onPainted: (details) => reportPreviewFirstFrame(slot, details),
|
|
30092
|
+
onPreviewError: (message) => onShadowError(slot.gen, message),
|
|
30093
|
+
portrait,
|
|
30094
|
+
suppressLoadingOverlay: true,
|
|
30095
|
+
style: SHADOW_IFRAME_STYLE
|
|
30096
|
+
},
|
|
30097
|
+
`${activeKey}-${slot.gen}`
|
|
30098
|
+
)
|
|
30099
|
+
)
|
|
30064
30100
|
)
|
|
30065
|
-
|
|
30066
|
-
|
|
30067
|
-
|
|
30101
|
+
]
|
|
30102
|
+
}
|
|
30103
|
+
)
|
|
30068
30104
|
}
|
|
30069
|
-
)
|
|
30105
|
+
),
|
|
30070
30106
|
/* @__PURE__ */ jsx86(
|
|
30071
30107
|
"div",
|
|
30072
30108
|
{
|
|
@@ -80995,14 +81031,14 @@ function dispatchModifierKey(event, key2, cb) {
|
|
|
80995
81031
|
return false;
|
|
80996
81032
|
}
|
|
80997
81033
|
function dispatchPlainKey(event, key2, cb) {
|
|
80998
|
-
if (key2 ===
|
|
81034
|
+
if (key2 === STUDIO_PLAIN_KEYS.fullscreen && !event.shiftKey && !event.altKey) {
|
|
80999
81035
|
event.preventDefault();
|
|
81000
81036
|
if (document.fullscreenElement) void document.exitFullscreen();
|
|
81001
81037
|
else
|
|
81002
81038
|
document.querySelector("[data-studio-fullscreen-target]")?.requestFullscreen();
|
|
81003
81039
|
return;
|
|
81004
81040
|
}
|
|
81005
|
-
if (event.key ===
|
|
81041
|
+
if (event.key === STUDIO_PLAIN_KEYS.split && !event.altKey) {
|
|
81006
81042
|
event.preventDefault();
|
|
81007
81043
|
if (cb.readOnlyPreview) return;
|
|
81008
81044
|
const { selectedElementId, elements, currentTime } = usePlayerStore.getState();
|
|
@@ -81079,7 +81115,7 @@ function dispatchPlainKey(event, key2, cb) {
|
|
|
81079
81115
|
}
|
|
81080
81116
|
return;
|
|
81081
81117
|
}
|
|
81082
|
-
if (event.key ===
|
|
81118
|
+
if (event.key === STUDIO_PLAIN_KEYS.record && !event.shiftKey && !event.altKey && cb.onToggleRecording) {
|
|
81083
81119
|
event.preventDefault();
|
|
81084
81120
|
cb.onToggleRecording();
|
|
81085
81121
|
}
|
|
@@ -86492,7 +86528,7 @@ var TAG_ICONS = {
|
|
|
86492
86528
|
function getTagBadge(tagName) {
|
|
86493
86529
|
return TAG_ICONS[tagName] ?? tagName.slice(0, 2).toUpperCase();
|
|
86494
86530
|
}
|
|
86495
|
-
function
|
|
86531
|
+
function isCompositionHost2(el) {
|
|
86496
86532
|
return el.hasAttribute("data-composition-src") || el.hasAttribute("data-composition-file");
|
|
86497
86533
|
}
|
|
86498
86534
|
function createRafThrottle(run, throttleMs = 100) {
|
|
@@ -86794,7 +86830,7 @@ var LayersPanel = memo44(function LayersPanel2() {
|
|
|
86794
86830
|
const draggable = isLayerDraggable(layer);
|
|
86795
86831
|
const isCollapsed = collapsed[layer.key] ?? false;
|
|
86796
86832
|
const hasChildren = layer.childCount > 0;
|
|
86797
|
-
const isCompHost =
|
|
86833
|
+
const isCompHost = isCompositionHost2(layer.element);
|
|
86798
86834
|
return /* @__PURE__ */ jsxs172(
|
|
86799
86835
|
"div",
|
|
86800
86836
|
{
|
|
@@ -93119,6 +93155,7 @@ export {
|
|
|
93119
93155
|
CompositionBreadcrumb,
|
|
93120
93156
|
CompositionThumbnail,
|
|
93121
93157
|
ContextMenu,
|
|
93158
|
+
DEFAULT_SHORTCUT_SECTIONS,
|
|
93122
93159
|
EditorShell,
|
|
93123
93160
|
ExternalFileConflictBanner,
|
|
93124
93161
|
FileTree,
|