@vosjs/studio-core 0.14.0 → 0.15.0
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/index.d.ts +27 -2
- package/dist/index.js +73 -20
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1629,8 +1629,22 @@ declare function exportSizeFor(ratio: number, resolution: ExportResolution): {
|
|
|
1629
1629
|
* plus the facts only a capture has) with the `id` a segment or a span
|
|
1630
1630
|
* names. The primary media has no id; it is `doc.source`.
|
|
1631
1631
|
*/
|
|
1632
|
+
/**
|
|
1633
|
+
* The CARD-owned frame fields, what a media may carry of its own: its
|
|
1634
|
+
* placement and size (`inset`, per-side fractions of the frame), the bar,
|
|
1635
|
+
* the corner, the shadow, the border, the cover fit and its focus. The
|
|
1636
|
+
* frame-wide fields (the aspect, the padding, the ground, the backdrop, the
|
|
1637
|
+
* card's animation) stay the take's: one frame, many cards.
|
|
1638
|
+
*/
|
|
1639
|
+
declare const MEDIA_FRAME_KEYS: readonly ["browserBar", "radius", "shadow", "shadowContact", "shadowColor", "inset", "border", "borderWidth", "borderColor", "fit", "focus", "focusFollow"];
|
|
1640
|
+
type MediaFrameKey = (typeof MEDIA_FRAME_KEYS)[number];
|
|
1641
|
+
/** What a media says about its own card; absent fields fall to the take's frame. */
|
|
1642
|
+
type MediaFrame = Partial<Omit<Pick<FrameStyle, MediaFrameKey>, 'browserBar'>> & {
|
|
1643
|
+
browserBar?: Partial<BrowserBarStyle>;
|
|
1644
|
+
};
|
|
1632
1645
|
type Media = ProjectDoc['source'] & {
|
|
1633
1646
|
id: string;
|
|
1647
|
+
frame?: MediaFrame;
|
|
1634
1648
|
};
|
|
1635
1649
|
|
|
1636
1650
|
/**
|
|
@@ -2052,7 +2066,9 @@ zoomFocus?: {
|
|
|
2052
2066
|
* ON_FRAME uses as source dims when `d.crop` is set (crp.w/crp.h) — the
|
|
2053
2067
|
* golden contract holds through the crop.
|
|
2054
2068
|
*/
|
|
2055
|
-
declare function docCardLayout(doc: Pick<ProjectDoc, 'frame' | 'source'
|
|
2069
|
+
declare function docCardLayout(doc: Pick<ProjectDoc, 'frame' | 'source' | 'media'>,
|
|
2070
|
+
/** The media whose card to lay out; absent or `''` = the primary. */
|
|
2071
|
+
media?: string | null): CardLayout;
|
|
2056
2072
|
/**
|
|
2057
2073
|
* Largest export preset whose footage card still gets ≥1 captured px per output
|
|
2058
2074
|
* px. The composited chrome (background, bar, cursor, effects) is vector-drawn
|
|
@@ -3224,6 +3240,15 @@ declare function mediaDuration(source: Pick<ProjectDoc['source'], 'meta'>): numb
|
|
|
3224
3240
|
* for an empty list.
|
|
3225
3241
|
*/
|
|
3226
3242
|
declare function mediaAtOutput(rated: readonly MediaSegment[], t: number): string;
|
|
3243
|
+
/**
|
|
3244
|
+
* The card a media wears: the take's frame with the media's own card
|
|
3245
|
+
* fields over it. Facts first: a media with a recorded page names it in
|
|
3246
|
+
* the bar, and one with no page (an upload) wears no bar, unless its own
|
|
3247
|
+
* `frame.browserBar` says otherwise. The primary wears the take's frame.
|
|
3248
|
+
*/
|
|
3249
|
+
declare function mediaFrame(doc: Pick<ProjectDoc, 'source' | 'media' | 'frame'>, id: string | undefined | null): FrameStyle;
|
|
3250
|
+
/** The card-owned fields of a frame, alone (what a media's card is made of). */
|
|
3251
|
+
declare function cardFields(frame: FrameStyle): Pick<FrameStyle, MediaFrameKey>;
|
|
3227
3252
|
/** The next free media id (`m1`, `m2`, …). */
|
|
3228
3253
|
declare function nextMediaId(doc: Pick<ProjectDoc, 'media'>): string;
|
|
3229
3254
|
|
|
@@ -3807,4 +3832,4 @@ declare function rejectSpan(rejected: RejectedSpan[] | undefined, lane: Rejected
|
|
|
3807
3832
|
anchor?: StepAnchor;
|
|
3808
3833
|
}, note?: string): RejectedSpan;
|
|
3809
3834
|
|
|
3810
|
-
export { ASPECT_RATIOS, AUDIO_PLAN_STEP, type AnchorKind, type Anim, type AnimKind, type AnimStep, type AppliedTemplate, type ApplyTemplateOptions, type AspectRatioOption, type AudioClip, type AudioPlanPoint, type AudioPlanTrack, BACKGROUND_Z, BASE_FRAME_STYLE, type Backdrop, type BackgroundMedia, type BakedText3dAsset, type BakedText3dMaterial, type BrowserBarStyle, type BuildDigestInput, CAMERA_FAR, CAMERA_NEAR, CAM_CHAIN_GAP, CAM_EASE, CAM_PAN, CAM_PAN_EASE, CAM_RAMP_IN, CAM_RAMP_OUT, CAM_SIZE_MAX, CAM_SIZE_MIN, CAM_SPAN_MIN, CAPTURE_COVERAGE_MIN, CARD_EDGE_OVERDRAW, CARD_ENTER_KINDS, CARD_EXIT_KINDS, CARD_FADE_SECONDS, CARD_FOV, CARD_Z, CHANNEL_SPECS_HASH, CHANNEL_SPECS_VERIFIED, CLICK_FX_INTENSITY, CLICK_FX_PRE, CLICK_HIGHLIGHT_FADE, CLICK_PAIR_MAX, CLICK_PULSE_DUR, CLICK_RECT_MAX_FRAC, CLICK_RIPPLE_DUR, CLICK_SYNTH_RELEASE, CROP_MAX_PX, CROP_MIN_FRAC, CROP_MIN_PX, CROP_PAD, CURSOR_IDLE_EPS_FRAC, CURSOR_IDLE_FADE_IN, CURSOR_IDLE_FADE_OUT, CURSOR_IDLE_HOLD, type CamBubbleRect, type CamPoseSpan, type CamStyle, type CaptureNormalization, type CardLayout, type ClickFxStyle, type CopiedLayout, type CopyLayoutOptions, type CopyStyleOptions, type CursorEvent, type CursorFadeKey, type CursorIdleOptions, type CursorStyle, type CursorTrack, DARK_GROUND, DEFAULT_BROWSER_BAR, DEFAULT_CAM_POSE, DEFAULT_CAM_STYLE, DEFAULT_CLICK_FX, DEFAULT_CURSOR_STYLE, DEFAULT_DUCK, DEFAULT_FRAME_STYLE, DEFAULT_SPEED_PARAMS, DEFAULT_TILT_POSE, DEFAULT_ZOOM_LEVEL, DEFAULT_ZOOM_STYLE, DESTINATIONS, DIGEST_CROP_MAX, DIGEST_FULL_MAX, DIGEST_VERSION, DOC_SCHEMA_VERSION, DRAG_FIT_LEVEL, type Destination, type Digest, type DigestImageRef, type DigestPlan, type DigestTakeFacts, type DocSegment, type DuckOptions, END_CARD_FROM, END_CARD_RECEDE, END_CARD_SECONDS, ENTRANCE_SECONDS, EXPORT_RESOLUTION_OPTIONS, EXPORT_SHORT_EDGE, type EndCard, type EnvelopePoint, type ExportResolution, type ExtractClickOptions, FOLLOW_RECENTER, FOLLOW_SAFE_RATIO, FRAME_BORDER_COLOR_DEFAULT, FRAME_BORDER_DEFAULT, FRAME_BORDER_WIDTH_DEFAULT, FREEZE_DEFAULT_SECONDS, FREEZE_SECONDS_MAX, FREEZE_SECONDS_MIN, type FocusBounds, type FollowEvent, type FollowOptions, type FrameEntrance, type FrameGeometry, type FrameStyle, type FreezeExtent, type FreezeSpan, HOUSE_GRADIENT, IDLE_KINDS, type IdleKind, type IngestOptions, LAYOUT_FRAME_FIELDS, LOOK_KINDS, type LayoutParts, type Look, type LookBrand, type LookKind, type LookPlacement, type LowerProgramOptions, type LoweredAudioClip, type LoweredClick, type LoweredComposition, type LoweredZoomSpan, MEDIA_ENTER_KINDS, MEDIA_EXIT_KINDS, MINIMAL_BAR_THEMES, MOTION_DELTA, MOTION_EASE, type Media, type MediaOverlayClip, type MediaSegment, type MicRms, type MinimalBarTheme, type Moment, type MomentKind, type MomentsOptions, type MotionKey, type MotionPose, type MotionPose3D, type MusicBedInput, type NormRect, OBJECT_DEFAULT_SCALE, OVERLAY_FONT_FACES, OVERLAY_LINE_HEIGHT, OVERLAY_MEDIA_DEFAULT_RADIUS, OVERLAY_MEDIA_DEFAULT_WIDTH, OVERLAY_MIN_DURATION, OVERLAY_SCALE_MAX, OVERLAY_SIZE_MAX, OVERLAY_SIZE_MIN, OVERLAY_TRANSITION_DUR, OVERLAY_Z, type ObjectAnimation, type ObjectAsset, type ObjectClip, type ObjectPrimitiveShape, type OverlayClip, type OverlayFontFace, type OverlayKind, type OverlayPresetStyle, type OverlayRect, type OverlayTransform, type OverlayTransition, PLATE_GROUND, PLAYBACK_ACTIVITY, PRIMARY_MEDIA, PROGRAM_RETIME, type PlanOptions, type PlanTiltOptions, type PlaneSize, type ProgramAnchorDoc, type ProgramTweenEdit, type ProjectDoc, type PxRect, REJECT_OVERLAP, REST_TILT_ID, type RecordingArtifact, type RecordingMeta, type Rect, type RejectedLane, type RejectedSpan, type ResolvedOverlayBox, type ResolvedOverlayStyle, SCENE_MOTION, SCENE_QUIET, SPEED_RATE_MAX, SPEED_RATE_MIN, SPEED_SPAN_MIN, STAGE_CLIP_PREFIX, STUDIO_ENTRY_ID, STYLE_FIELDS, type SmoothOptions, type SmoothPoint, type SpeedParams, type SpeedSpan, type StepAnchor, type StepSpan, type StudioAudioPlan, type StudioDoc, type StudioEntry, type StyleField, TEXT3D_DEPTH_DEFAULT, TEXT3D_DEPTH_MAX, TEXT3D_DEPTH_MIN, TEXT_ENTER_KINDS, TEXT_EXIT_KINDS, TEXT_PRESETS, TILT_AUTO_DEAD_ZONE, TILT_AUTO_MIN, TILT_CHAIN_GAP, TILT_DEG_MAX, TILT_EASE, TILT_INTENSITY_MAX, TILT_PAN, TILT_PAN_EASE, TILT_RAMP_IN, TILT_RAMP_OUT, TILT_SPAN_MIN, TILT_UI_DEG_MAX, TRANSITION_SPEED_MULT, type TemplateAnchor, type Text3dMaterial, type TextFxDirection, type TextFxKind, type TextFxSpec, type TextFxUnit, type TextOverlayBox, type TextOverlayClip, type TextOverlayPreset, type TextOverlayStroke, type TiltPersonality, type TiltSpan, type TiltStyleName, type TranscriptSegment, type TransitionSpeed, WINDOW_FOCUS_MIN, ZOOM_CHAIN_GAP, ZOOM_EASE, ZOOM_LEVELS, ZOOM_LEVEL_MAX, ZOOM_LEVEL_MIN, ZOOM_PAN, ZOOM_PAN_EASE, ZOOM_RAMP_IN, ZOOM_RAMP_IN_OVERLAP, ZOOM_RAMP_OUT, ZOOM_SPAN_MIN, ZOOM_STYLES, ZOOM_STYLE_OPTIONS, type ZoomSpan, type ZoomStyleName, type ZoomStyleParams, type ZoomWindow, anchorKindOf, anchorSourceDuration, animStep, applyLook, applyTemplate, aspectRatioValue, audioLane, backdropMedia, buildDigest, camBubbleRect, camBubbleRectAt, camLane, camMoveLane, camRectFromPose, camRestPose, camTrackFromDoc, cardEnter, cardExit, cardInset, cardPointToScreen, cardPoseTrack, clampCamFrac, clampCamSize, clampFocus, clampFreezeSeconds, clampSpeedRate, clampTiltDeg, clampZoomLevel, clipEnvelope, clipLength, clipsFrom, computeCardLayout, computeMicRms, computePeaks, copyLayout, copyStyle, cropBox, cursorIdleFade, deriveViewportCrop, destinationById, destinationsForChannel, docCardLayout, docFreezes, docMediaList, docOutputDuration, docRestTime, docToCropSpace, docToFullSpace, dropTemplate, duckCurve, effectiveSegments, endCardClips, enterKey, enterOf, entranceSeconds, envelopeAt, envelopeValueAt, exitKey, exitOf, exitSeconds, expandEndCard, expectedFrameSize, exportSizeFor, extractClicks, focusBounds, followFocusEvents, frameGeometry, freezeLane, freezeOutputExtents, hexToRgbTriplet, houseLook, idleGaps, idleKey, isLookKind, isMusicBed, isPlayback, isProgramDoc, isRecordingDoc, isRejected, isStageClip, isUnitStep, lastLayerEnd, layoutOf, levelForFocusFraction, lookFromBrand, lookKindForGround, lowerProgramDoc, lowerStudioDoc, lowerToComposition, mediaAtOutput, mediaDuration, mediaKey, mediaSource, micLane, migrateHostedDoc, migrateMotion, momentsFromDoc, motionTrack, musicBedClip, nextMediaId, normalizeCaptureSpace, objectMotionBase, objectMotionPoseAt, objectsLane, outputDurationOf, outputEnd, outputRangeToSource, overlapFraction, overlayFaceFor, overlayFontFaces, overlayFontString, overlayFxSpec, overlayHit, overlayLines, overlayMotionBase, overlayMotionPoseAt, overlayRect, overlaysLane, pageDisplayUrl, parsePoseId, pickStyle, placeFreezes, planAutoSpeed, planAutoTilt, planAutoZoom, planForDigest, planeSizeAtDepth, platformBarKind, programDuration, projectFromArtifact, ratedSegments, recommendedExportResolution, refillAudioBeds, rejectSpan, removeSourceRange, removeSpeedInRange, resolveExportSize, resolveOverlayBox, resolveOverlayStyle, resolveText3dAsset, resolveZoomStyle, restLeanOf, sameMedia, sceneChanges, scrollRuns, setSpeedInRange, smoothCursor, spanOutputExtent, speedLane, studioAudioPlan, studioEntry, studioLayerData, tiltLane, tiltTrackFromDoc, transitionMult, videoLane, voiceKey, withBackdrop, withFreezes, withHolds, withoutRejected, wrapProgramLength, zoomCoversRect, zoomLane, zoomSpanForRange, zoomTrackFromDoc, zoomWindow };
|
|
3835
|
+
export { ASPECT_RATIOS, AUDIO_PLAN_STEP, type AnchorKind, type Anim, type AnimKind, type AnimStep, type AppliedTemplate, type ApplyTemplateOptions, type AspectRatioOption, type AudioClip, type AudioPlanPoint, type AudioPlanTrack, BACKGROUND_Z, BASE_FRAME_STYLE, type Backdrop, type BackgroundMedia, type BakedText3dAsset, type BakedText3dMaterial, type BrowserBarStyle, type BuildDigestInput, CAMERA_FAR, CAMERA_NEAR, CAM_CHAIN_GAP, CAM_EASE, CAM_PAN, CAM_PAN_EASE, CAM_RAMP_IN, CAM_RAMP_OUT, CAM_SIZE_MAX, CAM_SIZE_MIN, CAM_SPAN_MIN, CAPTURE_COVERAGE_MIN, CARD_EDGE_OVERDRAW, CARD_ENTER_KINDS, CARD_EXIT_KINDS, CARD_FADE_SECONDS, CARD_FOV, CARD_Z, CHANNEL_SPECS_HASH, CHANNEL_SPECS_VERIFIED, CLICK_FX_INTENSITY, CLICK_FX_PRE, CLICK_HIGHLIGHT_FADE, CLICK_PAIR_MAX, CLICK_PULSE_DUR, CLICK_RECT_MAX_FRAC, CLICK_RIPPLE_DUR, CLICK_SYNTH_RELEASE, CROP_MAX_PX, CROP_MIN_FRAC, CROP_MIN_PX, CROP_PAD, CURSOR_IDLE_EPS_FRAC, CURSOR_IDLE_FADE_IN, CURSOR_IDLE_FADE_OUT, CURSOR_IDLE_HOLD, type CamBubbleRect, type CamPoseSpan, type CamStyle, type CaptureNormalization, type CardLayout, type ClickFxStyle, type CopiedLayout, type CopyLayoutOptions, type CopyStyleOptions, type CursorEvent, type CursorFadeKey, type CursorIdleOptions, type CursorStyle, type CursorTrack, DARK_GROUND, DEFAULT_BROWSER_BAR, DEFAULT_CAM_POSE, DEFAULT_CAM_STYLE, DEFAULT_CLICK_FX, DEFAULT_CURSOR_STYLE, DEFAULT_DUCK, DEFAULT_FRAME_STYLE, DEFAULT_SPEED_PARAMS, DEFAULT_TILT_POSE, DEFAULT_ZOOM_LEVEL, DEFAULT_ZOOM_STYLE, DESTINATIONS, DIGEST_CROP_MAX, DIGEST_FULL_MAX, DIGEST_VERSION, DOC_SCHEMA_VERSION, DRAG_FIT_LEVEL, type Destination, type Digest, type DigestImageRef, type DigestPlan, type DigestTakeFacts, type DocSegment, type DuckOptions, END_CARD_FROM, END_CARD_RECEDE, END_CARD_SECONDS, ENTRANCE_SECONDS, EXPORT_RESOLUTION_OPTIONS, EXPORT_SHORT_EDGE, type EndCard, type EnvelopePoint, type ExportResolution, type ExtractClickOptions, FOLLOW_RECENTER, FOLLOW_SAFE_RATIO, FRAME_BORDER_COLOR_DEFAULT, FRAME_BORDER_DEFAULT, FRAME_BORDER_WIDTH_DEFAULT, FREEZE_DEFAULT_SECONDS, FREEZE_SECONDS_MAX, FREEZE_SECONDS_MIN, type FocusBounds, type FollowEvent, type FollowOptions, type FrameEntrance, type FrameGeometry, type FrameStyle, type FreezeExtent, type FreezeSpan, HOUSE_GRADIENT, IDLE_KINDS, type IdleKind, type IngestOptions, LAYOUT_FRAME_FIELDS, LOOK_KINDS, type LayoutParts, type Look, type LookBrand, type LookKind, type LookPlacement, type LowerProgramOptions, type LoweredAudioClip, type LoweredClick, type LoweredComposition, type LoweredZoomSpan, MEDIA_ENTER_KINDS, MEDIA_EXIT_KINDS, MEDIA_FRAME_KEYS, MINIMAL_BAR_THEMES, MOTION_DELTA, MOTION_EASE, type Media, type MediaFrame, type MediaFrameKey, type MediaOverlayClip, type MediaSegment, type MicRms, type MinimalBarTheme, type Moment, type MomentKind, type MomentsOptions, type MotionKey, type MotionPose, type MotionPose3D, type MusicBedInput, type NormRect, OBJECT_DEFAULT_SCALE, OVERLAY_FONT_FACES, OVERLAY_LINE_HEIGHT, OVERLAY_MEDIA_DEFAULT_RADIUS, OVERLAY_MEDIA_DEFAULT_WIDTH, OVERLAY_MIN_DURATION, OVERLAY_SCALE_MAX, OVERLAY_SIZE_MAX, OVERLAY_SIZE_MIN, OVERLAY_TRANSITION_DUR, OVERLAY_Z, type ObjectAnimation, type ObjectAsset, type ObjectClip, type ObjectPrimitiveShape, type OverlayClip, type OverlayFontFace, type OverlayKind, type OverlayPresetStyle, type OverlayRect, type OverlayTransform, type OverlayTransition, PLATE_GROUND, PLAYBACK_ACTIVITY, PRIMARY_MEDIA, PROGRAM_RETIME, type PlanOptions, type PlanTiltOptions, type PlaneSize, type ProgramAnchorDoc, type ProgramTweenEdit, type ProjectDoc, type PxRect, REJECT_OVERLAP, REST_TILT_ID, type RecordingArtifact, type RecordingMeta, type Rect, type RejectedLane, type RejectedSpan, type ResolvedOverlayBox, type ResolvedOverlayStyle, SCENE_MOTION, SCENE_QUIET, SPEED_RATE_MAX, SPEED_RATE_MIN, SPEED_SPAN_MIN, STAGE_CLIP_PREFIX, STUDIO_ENTRY_ID, STYLE_FIELDS, type SmoothOptions, type SmoothPoint, type SpeedParams, type SpeedSpan, type StepAnchor, type StepSpan, type StudioAudioPlan, type StudioDoc, type StudioEntry, type StyleField, TEXT3D_DEPTH_DEFAULT, TEXT3D_DEPTH_MAX, TEXT3D_DEPTH_MIN, TEXT_ENTER_KINDS, TEXT_EXIT_KINDS, TEXT_PRESETS, TILT_AUTO_DEAD_ZONE, TILT_AUTO_MIN, TILT_CHAIN_GAP, TILT_DEG_MAX, TILT_EASE, TILT_INTENSITY_MAX, TILT_PAN, TILT_PAN_EASE, TILT_RAMP_IN, TILT_RAMP_OUT, TILT_SPAN_MIN, TILT_UI_DEG_MAX, TRANSITION_SPEED_MULT, type TemplateAnchor, type Text3dMaterial, type TextFxDirection, type TextFxKind, type TextFxSpec, type TextFxUnit, type TextOverlayBox, type TextOverlayClip, type TextOverlayPreset, type TextOverlayStroke, type TiltPersonality, type TiltSpan, type TiltStyleName, type TranscriptSegment, type TransitionSpeed, WINDOW_FOCUS_MIN, ZOOM_CHAIN_GAP, ZOOM_EASE, ZOOM_LEVELS, ZOOM_LEVEL_MAX, ZOOM_LEVEL_MIN, ZOOM_PAN, ZOOM_PAN_EASE, ZOOM_RAMP_IN, ZOOM_RAMP_IN_OVERLAP, ZOOM_RAMP_OUT, ZOOM_SPAN_MIN, ZOOM_STYLES, ZOOM_STYLE_OPTIONS, type ZoomSpan, type ZoomStyleName, type ZoomStyleParams, type ZoomWindow, anchorKindOf, anchorSourceDuration, animStep, applyLook, applyTemplate, aspectRatioValue, audioLane, backdropMedia, buildDigest, camBubbleRect, camBubbleRectAt, camLane, camMoveLane, camRectFromPose, camRestPose, camTrackFromDoc, cardEnter, cardExit, cardFields, cardInset, cardPointToScreen, cardPoseTrack, clampCamFrac, clampCamSize, clampFocus, clampFreezeSeconds, clampSpeedRate, clampTiltDeg, clampZoomLevel, clipEnvelope, clipLength, clipsFrom, computeCardLayout, computeMicRms, computePeaks, copyLayout, copyStyle, cropBox, cursorIdleFade, deriveViewportCrop, destinationById, destinationsForChannel, docCardLayout, docFreezes, docMediaList, docOutputDuration, docRestTime, docToCropSpace, docToFullSpace, dropTemplate, duckCurve, effectiveSegments, endCardClips, enterKey, enterOf, entranceSeconds, envelopeAt, envelopeValueAt, exitKey, exitOf, exitSeconds, expandEndCard, expectedFrameSize, exportSizeFor, extractClicks, focusBounds, followFocusEvents, frameGeometry, freezeLane, freezeOutputExtents, hexToRgbTriplet, houseLook, idleGaps, idleKey, isLookKind, isMusicBed, isPlayback, isProgramDoc, isRecordingDoc, isRejected, isStageClip, isUnitStep, lastLayerEnd, layoutOf, levelForFocusFraction, lookFromBrand, lookKindForGround, lowerProgramDoc, lowerStudioDoc, lowerToComposition, mediaAtOutput, mediaDuration, mediaFrame, mediaKey, mediaSource, micLane, migrateHostedDoc, migrateMotion, momentsFromDoc, motionTrack, musicBedClip, nextMediaId, normalizeCaptureSpace, objectMotionBase, objectMotionPoseAt, objectsLane, outputDurationOf, outputEnd, outputRangeToSource, overlapFraction, overlayFaceFor, overlayFontFaces, overlayFontString, overlayFxSpec, overlayHit, overlayLines, overlayMotionBase, overlayMotionPoseAt, overlayRect, overlaysLane, pageDisplayUrl, parsePoseId, pickStyle, placeFreezes, planAutoSpeed, planAutoTilt, planAutoZoom, planForDigest, planeSizeAtDepth, platformBarKind, programDuration, projectFromArtifact, ratedSegments, recommendedExportResolution, refillAudioBeds, rejectSpan, removeSourceRange, removeSpeedInRange, resolveExportSize, resolveOverlayBox, resolveOverlayStyle, resolveText3dAsset, resolveZoomStyle, restLeanOf, sameMedia, sceneChanges, scrollRuns, setSpeedInRange, smoothCursor, spanOutputExtent, speedLane, studioAudioPlan, studioEntry, studioLayerData, tiltLane, tiltTrackFromDoc, transitionMult, videoLane, voiceKey, withBackdrop, withFreezes, withHolds, withoutRejected, wrapProgramLength, zoomCoversRect, zoomLane, zoomSpanForRange, zoomTrackFromDoc, zoomWindow };
|
package/dist/index.js
CHANGED
|
@@ -209,6 +209,20 @@ function exportSizeFor(ratio, resolution) {
|
|
|
209
209
|
const safe = ratio > 0 && Number.isFinite(ratio) ? ratio : 16 / 9;
|
|
210
210
|
return safe >= 1 ? { width: even(short * safe), height: even(short) } : { width: even(short), height: even(short / safe) };
|
|
211
211
|
}
|
|
212
|
+
var MEDIA_FRAME_KEYS = [
|
|
213
|
+
"browserBar",
|
|
214
|
+
"radius",
|
|
215
|
+
"shadow",
|
|
216
|
+
"shadowContact",
|
|
217
|
+
"shadowColor",
|
|
218
|
+
"inset",
|
|
219
|
+
"border",
|
|
220
|
+
"borderWidth",
|
|
221
|
+
"borderColor",
|
|
222
|
+
"fit",
|
|
223
|
+
"focus",
|
|
224
|
+
"focusFollow"
|
|
225
|
+
];
|
|
212
226
|
|
|
213
227
|
// src/capture.ts
|
|
214
228
|
var CHROME_TOP_MIN = 20;
|
|
@@ -541,6 +555,33 @@ function mediaAtOutput(rated, t) {
|
|
|
541
555
|
}
|
|
542
556
|
return last ? mediaKey(last.media) : PRIMARY_MEDIA;
|
|
543
557
|
}
|
|
558
|
+
function mediaFrame(doc, id) {
|
|
559
|
+
const key = mediaKey(id);
|
|
560
|
+
if (key === PRIMARY_MEDIA) return doc.frame;
|
|
561
|
+
const m = (doc.media ?? []).find((x) => x.id === key);
|
|
562
|
+
if (!m) return doc.frame;
|
|
563
|
+
const over = m.frame ?? {};
|
|
564
|
+
const out = { ...doc.frame };
|
|
565
|
+
for (const k of MEDIA_FRAME_KEYS) {
|
|
566
|
+
if (k === "browserBar") continue;
|
|
567
|
+
const v = over[k];
|
|
568
|
+
if (v !== void 0) out[k] = v;
|
|
569
|
+
}
|
|
570
|
+
const bar = { ...doc.frame.browserBar };
|
|
571
|
+
const page = pageDisplayUrl(m.meta.pageUrl);
|
|
572
|
+
if (page) bar.url = page;
|
|
573
|
+
if (!m.meta.pageUrl) bar.kind = "none";
|
|
574
|
+
out.browserBar = { ...bar, ...over.browserBar ?? {} };
|
|
575
|
+
return out;
|
|
576
|
+
}
|
|
577
|
+
function cardFields(frame) {
|
|
578
|
+
const out = {};
|
|
579
|
+
for (const k of MEDIA_FRAME_KEYS) {
|
|
580
|
+
const v = frame[k];
|
|
581
|
+
if (v !== void 0) out[k] = v;
|
|
582
|
+
}
|
|
583
|
+
return out;
|
|
584
|
+
}
|
|
544
585
|
function nextMediaId(doc) {
|
|
545
586
|
const taken = new Set((doc.media ?? []).map((m) => m.id));
|
|
546
587
|
let n = 1;
|
|
@@ -1671,18 +1712,20 @@ function computeCardLayout(frame, video, W, H, zoomFocus) {
|
|
|
1671
1712
|
cardH: dh + barH
|
|
1672
1713
|
};
|
|
1673
1714
|
}
|
|
1674
|
-
function docCardLayout(doc) {
|
|
1715
|
+
function docCardLayout(doc, media) {
|
|
1675
1716
|
const meta = doc.source.meta;
|
|
1676
1717
|
const H = 1080;
|
|
1677
1718
|
const W = Math.max(
|
|
1678
1719
|
2,
|
|
1679
1720
|
Math.round(H * aspectRatioValue(doc.frame.aspectRatio, meta))
|
|
1680
1721
|
);
|
|
1722
|
+
const src = mediaSource(doc, media) ?? doc.source;
|
|
1723
|
+
const sm = src.meta;
|
|
1681
1724
|
return computeCardLayout(
|
|
1682
|
-
doc
|
|
1725
|
+
mediaFrame(doc, media),
|
|
1683
1726
|
{
|
|
1684
|
-
width:
|
|
1685
|
-
height:
|
|
1727
|
+
width: sm.captureWidth ?? sm.width,
|
|
1728
|
+
height: sm.captureHeight ?? sm.height
|
|
1686
1729
|
},
|
|
1687
1730
|
W,
|
|
1688
1731
|
H
|
|
@@ -4181,6 +4224,9 @@ var ON_FRAME = `(ctx, content, dt) => {
|
|
|
4181
4224
|
if (amId && d.media) for (var amJ = 0; amJ < d.media.length; amJ++) if (d.media[amJ].id === amId) actM = d.media[amJ]
|
|
4182
4225
|
if (actM && r.media && r.media[amId]) video = r.media[amId]
|
|
4183
4226
|
else amId = ''
|
|
4227
|
+
// The card under the playhead: another media's own card fields over the
|
|
4228
|
+
// take's frame (resolved at lowering), the take's frame for the primary.
|
|
4229
|
+
var cfr = amId && actM && actM.frame ? actM.frame : frame
|
|
4184
4230
|
if (r.media) for (var amK in r.media) { var amE = r.media[amK]; if (amK !== amId && amE && amE.pause && amE.paused === false) amE.pause() }
|
|
4185
4231
|
if (amId) {
|
|
4186
4232
|
if (r.video && r.video.pause && r.video.paused === false) r.video.pause()
|
|
@@ -4483,15 +4529,15 @@ var ON_FRAME = `(ctx, content, dt) => {
|
|
|
4483
4529
|
// strip is part of the card: it takes barH from the available height and the video
|
|
4484
4530
|
// sits below it \u2014 bar + video share the rounded clip and zoom together.
|
|
4485
4531
|
var pad = (frame.padding || 0) * s
|
|
4486
|
-
// Per-side placement (
|
|
4532
|
+
// Per-side placement (cfr.inset: fractions of the frame, a negative side
|
|
4487
4533
|
// bleeds the card past the edge) overrides the symmetric padding on the
|
|
4488
4534
|
// sides it names; absent sides keep pad, so the old math falls out.
|
|
4489
|
-
var ipIns =
|
|
4535
|
+
var ipIns = cfr.inset || {}
|
|
4490
4536
|
var ipL = ipIns.left == null ? pad : ipIns.left * W
|
|
4491
4537
|
var ipR = ipIns.right == null ? pad : ipIns.right * W
|
|
4492
4538
|
var ipT = ipIns.top == null ? pad : ipIns.top * H
|
|
4493
4539
|
var ipB = ipIns.bottom == null ? pad : ipIns.bottom * H
|
|
4494
|
-
var bar =
|
|
4540
|
+
var bar = cfr.browserBar || {}
|
|
4495
4541
|
// Window takes carry a viewport crop (drawImage source rect, capture px) that
|
|
4496
4542
|
// removes the real browser chrome \u2014 the card's source dims are then the CROP
|
|
4497
4543
|
// dims (meta/cursor were rewritten into crop space at doc build).
|
|
@@ -4509,11 +4555,11 @@ var ON_FRAME = `(ctx, content, dt) => {
|
|
|
4509
4555
|
// Cover fit: the CARD rect and the VIDEO rect separate. Under
|
|
4510
4556
|
// contain (default, byte-identical for every existing doc) the card IS the
|
|
4511
4557
|
// fitted video; under cover the card is the padded area itself and the
|
|
4512
|
-
// footage cover-fills it, cropped around
|
|
4558
|
+
// footage cover-fills it, cropped around cfr.focus (normalized video
|
|
4513
4559
|
// fractions, the zoom cx/cy convention; clamped so no gap ever shows).
|
|
4514
4560
|
// Chrome under cover scales by s alone (cf = 1): the card is as wide as
|
|
4515
4561
|
// the frame allows, which is the case cf existed to protect against.
|
|
4516
|
-
var fitCover =
|
|
4562
|
+
var fitCover = cfr.fit === 'cover'
|
|
4517
4563
|
var cf = fitCover ? 1 : Math.min(1, (W / H) / (vw / vh))
|
|
4518
4564
|
var s2 = s * cf
|
|
4519
4565
|
// current zoom \u2014 a standard keyframe track in OUTPUT time (hold + arrival pairs
|
|
@@ -4532,11 +4578,11 @@ var ON_FRAME = `(ctx, content, dt) => {
|
|
|
4532
4578
|
sc = Math.max(availW / vw, availH / vh)
|
|
4533
4579
|
dw = vw * sc; dh = vh * sc
|
|
4534
4580
|
cardX = ipL; cardY = ipT; cardW = availW; cardH = availH + barH
|
|
4535
|
-
var fcv =
|
|
4581
|
+
var fcv = cfr.focus || {}
|
|
4536
4582
|
var fcx = fcv.cx == null ? 0.5 : Math.max(0, Math.min(1, fcv.cx))
|
|
4537
4583
|
var fcy = fcv.cy == null ? 0.5 : Math.max(0, Math.min(1, fcv.cy))
|
|
4538
4584
|
// focusFollow: the crop keeps the camera's focus in frame (a 9:16 cut).
|
|
4539
|
-
if (
|
|
4585
|
+
if (cfr.focusFollow === 'camera' && zt && zt.keyframes && zt.keyframes.length) { fcx = zx; fcy = zy }
|
|
4540
4586
|
var vTop = ipT + barH
|
|
4541
4587
|
dx = Math.min(cardX, Math.max(cardX + availW - dw, cardX + availW / 2 - fcx * dw))
|
|
4542
4588
|
dy = Math.min(vTop, Math.max(vTop + availH - dh, vTop + availH / 2 - fcy * dh))
|
|
@@ -4548,14 +4594,14 @@ var ON_FRAME = `(ctx, content, dt) => {
|
|
|
4548
4594
|
dx = ipL + (availW - dw) / 2; dy = ipT + barH + (availH - dh) / 2
|
|
4549
4595
|
cardX = dx; cardY = dy - barH; cardW = dw; cardH = dh + barH
|
|
4550
4596
|
}
|
|
4551
|
-
var radius = (
|
|
4552
|
-
var shadow =
|
|
4597
|
+
var radius = (cfr.radius || 0) * s2
|
|
4598
|
+
var shadow = cfr.shadow || 0
|
|
4553
4599
|
// The shadow's colour (a #rrggbb; the strengths are its alpha) and the
|
|
4554
4600
|
// optional tight CONTACT layer that makes a light card sit on a light
|
|
4555
4601
|
// ground.
|
|
4556
|
-
var shC =
|
|
4602
|
+
var shC = cfr.shadowContact || 0
|
|
4557
4603
|
var shRgb = '0,0,0'
|
|
4558
|
-
var shHex =
|
|
4604
|
+
var shHex = cfr.shadowColor
|
|
4559
4605
|
if (typeof shHex === 'string' && /^#[0-9a-fA-F]{6}$/.test(shHex)) {
|
|
4560
4606
|
shRgb = parseInt(shHex.slice(1, 3), 16) + ',' + parseInt(shHex.slice(3, 5), 16) + ',' + parseInt(shHex.slice(5, 7), 16)
|
|
4561
4607
|
}
|
|
@@ -4695,15 +4741,15 @@ var ON_FRAME = `(ctx, content, dt) => {
|
|
|
4695
4741
|
// expanded by half the width so the stroke's inner edge lands on the card's
|
|
4696
4742
|
// own edge and never covers footage (inset, a 24px width ate 24px of the
|
|
4697
4743
|
// recording). Outer corner radius grows with the width, the CSS-border rule;
|
|
4698
|
-
// a square card stays square.
|
|
4744
|
+
// a square card stays square. cfr.border is the ALPHA (0 = off) and rides
|
|
4699
4745
|
// globalAlpha, so borderColor takes any CSS colour notation without this
|
|
4700
4746
|
// having to parse one. Card chrome, so it scales by s2.
|
|
4701
|
-
if (
|
|
4702
|
-
var bdW = (
|
|
4747
|
+
if (cfr.border) {
|
|
4748
|
+
var bdW = (cfr.borderWidth > 0 ? cfr.borderWidth : ${FRAME_BORDER_WIDTH_DEFAULT}) * s2
|
|
4703
4749
|
var bdH = bdW / 2
|
|
4704
4750
|
c.save()
|
|
4705
|
-
c.globalAlpha = Math.min(1,
|
|
4706
|
-
c.strokeStyle =
|
|
4751
|
+
c.globalAlpha = Math.min(1, cfr.border)
|
|
4752
|
+
c.strokeStyle = cfr.borderColor || '${FRAME_BORDER_COLOR_DEFAULT}'
|
|
4707
4753
|
c.lineWidth = bdW
|
|
4708
4754
|
rr(cardX - bdH, cardY - bdH, cardW + bdW, cardH + bdW, radius > 0 ? radius + bdH : 0)
|
|
4709
4755
|
c.stroke()
|
|
@@ -5281,6 +5327,10 @@ function lowerToComposition(input) {
|
|
|
5281
5327
|
y: round6(p.y)
|
|
5282
5328
|
})),
|
|
5283
5329
|
cursorSpace: { w: m.meta.width, h: m.meta.height },
|
|
5330
|
+
// The card this media wears (its own placement, bar, corner,
|
|
5331
|
+
// shadow, border, fit and focus over the take's), resolved
|
|
5332
|
+
// here so ON_FRAME swaps one object and reads no document.
|
|
5333
|
+
frame: cardFields(mediaFrame(doc, m.id)),
|
|
5284
5334
|
...fade.length ? { cursorFade: fade } : {}
|
|
5285
5335
|
};
|
|
5286
5336
|
})
|
|
@@ -8421,6 +8471,7 @@ export {
|
|
|
8421
8471
|
LOOK_KINDS,
|
|
8422
8472
|
MEDIA_ENTER_KINDS,
|
|
8423
8473
|
MEDIA_EXIT_KINDS,
|
|
8474
|
+
MEDIA_FRAME_KEYS,
|
|
8424
8475
|
MINIMAL_BAR_THEMES,
|
|
8425
8476
|
MOTION_DELTA,
|
|
8426
8477
|
MOTION_EASE,
|
|
@@ -8500,6 +8551,7 @@ export {
|
|
|
8500
8551
|
camTrackFromDoc,
|
|
8501
8552
|
cardEnter,
|
|
8502
8553
|
cardExit,
|
|
8554
|
+
cardFields,
|
|
8503
8555
|
cardInset,
|
|
8504
8556
|
cardPointToScreen,
|
|
8505
8557
|
cardPoseTrack,
|
|
@@ -8573,6 +8625,7 @@ export {
|
|
|
8573
8625
|
lowerToComposition,
|
|
8574
8626
|
mediaAtOutput,
|
|
8575
8627
|
mediaDuration,
|
|
8628
|
+
mediaFrame,
|
|
8576
8629
|
mediaKey,
|
|
8577
8630
|
mediaSource,
|
|
8578
8631
|
micLane,
|