@vosjs/studio-core 0.46.0 → 0.47.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 +40 -1
- package/dist/index.js +113 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ import { Segment, KeyframeTrack } from '@vosjs/timeline';
|
|
|
4
4
|
export { Segment } from '@vosjs/timeline';
|
|
5
5
|
import { TimelineEdit } from '@vosjs/shared/timelineEdits';
|
|
6
6
|
import { LaneAdapter } from '@vosjs/editor';
|
|
7
|
+
import { FilmSummary } from '@vosjs/shared/music';
|
|
8
|
+
export { FilmSummary } from '@vosjs/shared/music';
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
11
|
* Zoom/pan camera styles — named strategy
|
|
@@ -6021,4 +6023,41 @@ declare function rejectSpan(rejected: RejectedSpan[] | undefined, lane: Rejected
|
|
|
6021
6023
|
anchor?: StepAnchor;
|
|
6022
6024
|
}, note?: string): RejectedSpan;
|
|
6023
6025
|
|
|
6024
|
-
export { ASPECT_RATIOS, AUDIO_PLAN_STEP, type AnchorKind, type AnchorMiss, type AnchorResolution, type Anim, type AnimKind, type AnimSide, type AnimStep, type AppliedTemplate, type ApplyTemplateOptions, type AspectRatioOption, type AudioClip, type AudioLoudness, type AudioPlanPoint, type AudioPlanTrack, BACKGROUND_Z, BASE_FRAME_STYLE, type Backdrop, type BackgroundMedia, type BakeResult, type BakedText3dAsset, type BakedText3dMaterial, type BrowserBarStyle, type BuildDigestInput, CALLOUT_DEFAULT_BODY_PX, CALLOUT_SHAPES, CALLOUT_TYPE_RATIO, CAMERA_CENTRE_RAMP, CAMERA_COVER_MIN, 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, CHANGE_FLOOR, CHANGE_GRID, CHANGE_LEAD, CHANGE_OFFSETS, CHANNEL_SPECS_HASH, CHANNEL_SPECS_VERIFIED, CLICK_FX_INTENSITY, CLICK_FX_PRE, CLICK_HIGHLIGHT_FADE, CLICK_HOLD_MS, CLICK_PAIR_MAX, CLICK_PULSE_DUR, CLICK_RECT_MAX_FRAC, CLICK_RIPPLE_DUR, CLICK_SYNTH_RELEASE, CLUSTER_FILL, 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, CURSOR_OFF_FADE, type CalloutBox, type CalloutClipOptions, type CalloutLook, type CalloutRegister, type CalloutShape, type CalloutWords, type CamBubbleRect, type CamPoseSpan, type CamStyle, type CameraModel, type CaptureNormalization, type CardLayout, type ChangeSample, type ChangeWitness, type ChangedRegion, type ClickFxStyle, type ClipGain, type ClipGainBasis, type CopiedLayout, type CopyLayoutOptions, type CopyStyleOptions, type CursorEvent, type CursorFadeKey, type CursorIdleOptions, type CursorOff, 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, DESIGN_FRAME_WIDTH, DESTINATIONS, DIGEST_CROP_MAX, DIGEST_FULL_MAX, DIGEST_VERSION, DOC_FEATURES, DOC_SCHEMA_VERSION, DRAG_FIT_LEVEL, DRAG_MIN_S, DRAG_MIN_TRAVEL_FRAC, type Destination, type Digest, type DigestImageRef, type DigestPlan, type DigestTakeFacts, type DocFeature, type DocSegment, type Drag, type DuckOptions, ELAPSED_PLACEHOLDER, 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, FOOTAGE_FRAME_STYLE, 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, HOLD_DRIFT_MAX, HOUSE_GRADIENT, HOUSE_REGISTER, HTML_LAYER_FOREIGN_FIELDS, HTML_LAYER_MAX_BYTES, HTML_LAYER_SVG_CODE, HTML_LAYER_WARN_BYTES, HTML_STARTERS, type HtmlLayerFace, type HtmlLayerInlineFace, type HtmlLayerPayload, type HtmlLayerProblem, type HtmlLayerProblemCode, type HtmlLayerSource, type HtmlOverlayClip, type HtmlOverlayFont, type HtmlStarter, IDLE_KINDS, type IdleKind, type IngestOptions, LAYER_CARD_SHADOW, LAYOUT_FRAME_FIELDS, LOOK_KINDS, type LayerCard, type LayoutParts, type Look, type LookBrand, type LookKind, type LookPlacement, type LowerProgramOptions, type LoweredAudioClip, type LoweredClick, type LoweredComposition, type LoweredZoomSpan, type LumaGrid, MEDIA_ENTER_KINDS, MEDIA_EXIT_KINDS, MEDIA_FRAME_KEYS, MEDIA_KEY_PREFIX, 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, NORMALIZE_MAX_LIFT_DB, NORMALIZE_MAX_LUFS, NORMALIZE_MIN_LUFS, NORMALIZE_PEAK_CEILING_DB, 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 OutputExtent, type OverlayAnchor, type OverlayClip, type OverlayFontFace, type OverlayKind, type OverlayPin, type OverlayPresetStyle, type OverlayRect, type OverlayTransform, type OverlayTransition, PIN_GAP, PIN_MARGIN, PLATE_GROUND, PLAYBACK_ACTIVITY, PRIMARY_MEDIA, PROGRAM_RETIME, PUMP_REST, type PeerStepSpan, type PeerTrack, type PinCandidate, type PinCarry, type PinMark, type PinPlacement, type PinPlacementInput, type PinReferent, type PinSide, type PinSideResolved, type PlanOptions, type PlanTiltOptions, type PlaneSize, type ProgramAnchorDoc, type ProgramTweenEdit, type ProjectDoc, type PxRect, REJECT_OVERLAP, REPLAY_EPS, REST_TILT_ID, RETIRED_ZOOM_STYLES, type RecordingArtifact, type RecordingMeta, type RecordingNotice, type RecordingOutput, type RecordingPageMedia, type RecordingSkip, type Rect, type RejectedLane, type RejectedSpan, type ReplayedSpan, type ResolvedOverlayBox, type ResolvedOverlayStyle, type Rgb, SCENE_MOTION, SCENE_QUIET, SEGMENT_ENTER_KINDS, SEGMENT_EXIT_KINDS, SPEED_RATE_MAX, SPEED_RATE_MIN, SPEED_SPAN_MIN, STAGE_CLIP_PREFIX, STILL_DEFAULT, STUDIO_ENTRY_ID, STYLE_FIELDS, type SegmentExtent, type SmoothOptions, type SmoothPoint, type SpeedParams, type SpeedSpan, type StepAnchor, type StepSpan, type StudioAudioPlan, type StudioDoc, type StudioEntry, type StyleField, type StyledText, 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_SECONDS, TRANSITION_SECONDS_MAX, TRANSITION_SECONDS_MIN, 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 TraceFileKind, type TraceOptions, type TraceResult, type TranscriptSegment, type Transition, type TransitionKind, type TransitionMove, type TransitionOut, type TransitionSpeed, type UsedFeature, 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 ZipEntry, type ZoomScreen, type ZoomSpan, type ZoomStyleName, type ZoomStyleParams, type ZoomView, type ZoomWindow, ambientDrift, anchorKindOf, anchorSourceDuration, anchoredClip, animStep, applyLook, applyTemplate, aspectRatioValue, audioLane, backdropMedia, bakeDocFeatures, boldWeightFor, buildDigest, calloutBox, calloutClip, calloutGroundOf, calloutLook, calloutSource, camBubbleRect, camBubbleRectAt, camLane, camMoveLane, camRectFromPose, camRestPose, camTrackFromDoc, cameraCentring, cameraModel, cameraRestWindows, cameraRests, cameraSpanExtents, cardEnter, cardExit, cardFields, cardInset, cardPointToScreen, cardPoseTrack, changedRegion, clampCamFrac, clampCamSize, clampFocus, clampFreezeSeconds, clampSpeedRate, clampTiltDeg, clampZoomLevel, clipEnvelope, clipGain, clipLength, clipsFrom, compareVersions, computeCardLayout, computeMicRms, computePeaks, copyLayout, copyStyle, cropBox, cssFamilies, cssWeights, cursorFromCsv, cursorFromPlaywrightTrace, cursorFromRecords, cursorFromTrace, cursorIdleFade, cursorOffAlpha, deltaE, deriveViewportCrop, destinationById, destinationsForChannel, docCardLayout, docFeatures, docFreezes, docMediaList, docOutputDuration, docRestTime, docStillTime, docToCropSpace, docToFullSpace, docTransitions, docZoomTrack, dragsFromTrack, dropTemplate, duckCurve, effectiveSegments, elapsedFor, endCardClips, enterKey, enterOf, entranceAt, entranceEnd, entranceSeconds, envelopeAt, envelopeValueAt, exitKey, exitOf, exitSeconds, expandEndCard, expectedFrameSize, exportSizeFor, extractClicks, featuresNewerThan, findStep, focusBounds, focusForViewportCentre, followFocusEvents, formatElapsed, frameGeometry, freezeLane, freezeOutputExtents, hasElapsed, hasReplay, hexToRgb, hexToRgbTriplet, houseLook, htmlLayerBleed, htmlLayerBleedFor, htmlLayerFaces, htmlLayerKey, htmlLayerLabel, htmlLayerPayload, htmlLayerPictureBox, htmlLayerProblems, htmlLayerSvg, htmlLayerText, htmlLayerUnhostedFamilies, htmlLayerWidth, htmlStarterClip, idleGaps, idleKey, isKeyedOverlay, isLookKind, isLoweredRecording, isMusicBed, isPlayback, isProgramDoc, isRecordingDoc, isRejected, isStageClip, isUnitStep, lastLayerEnd, layerMedia, layerStart, layoutOf, levelForFocusFraction, liveZoomStyleName, longestOutputExtent, lookFromBrand, lookKindForGround, loudnessMatches, lowerProgramDoc, lowerStudioDoc, lowerToComposition, marksEmphasis, mediaAtOutput, mediaDuration, mediaFrame, mediaKey, mediaRef, mediaRefId, mediaSource, micLane, migrateHostedDoc, migrateMotion, migrateText, migrateTextClip, migrateZoomStyle, momentOutputs, momentsFromDoc, motionTrack, musicBedClip, nextMediaId, normalizeCaptureSpace, objectMotionBase, objectMotionPoseAt, objectsLane, outputDurationOf, outputEnd, outputRangeToSource, overlapFraction, overlayFaceFor, overlayFontFaces, overlayFontString, overlayFxSpec, overlayHit, overlayLines, overlayMotionBase, overlayMotionPoseAt, overlayPinPoseAt, overlayPlainText, overlayRect, overlaysLane, ownFreezes, pageDisplayUrl, parseCssColour, parsePoseId, pickChange, pickStyle, pinBox, pinCandidates, pinPlacement, pinRectOnScreen, pinReferent, pinReferentAt, placeFreezes, planAutoSpeed, planAutoTilt, planAutoZoom, planForDigest, planeSizeAtDepth, platformBarKind, playwrightTraceEntry, programDuration, programStillTime, projectFromArtifact, pumpFreeChainGap, ratedSegments, recommendedExportResolution, refillAudioBeds, rejectSpan, relativeLuminance, removeSourceRange, removeSpeedInRange, replayFlags, replayedSeconds, resolveAnchor, resolveExportSize, resolveOverlayAnchors, resolveOverlayBox, resolveOverlayStyle, resolvePins, resolveText3dAsset, resolveZoomStyle, restLeanOf, restSpansThroughTransitions, rgbToHex, sameMedia, sceneChanges, scrollRuns, segmentOutputExtents, outputLen as segmentOutputLen, segmentStarts, setSpeedInRange, slideSide, smoothCursor, snapRunWeight, sourceMomentToOutput, spanOutputExtent, spanOutputExtents, speedLane, stepElapsedMs, stepMomentToOutput, studioAudioPlan, studioEntry, studioLayerData, styledTextOf, textRunsOf, tiltLane, tiltTrackFromDoc, traceKindOf, transitionMult, transitionSeconds, unionFitLevel, unionRect, videoLane, voiceKey, wellFormedXml, withBackdrop, withFreezes, withHolds, withoutRejected, wrapProgramLength, zipEntries, zipEntryBytes, zoomCoversRect, zoomLane, zoomSpanForRange, zoomTrackFromDoc, zoomView, zoomViewport, zoomWindow };
|
|
6026
|
+
/**
|
|
6027
|
+
* A film as the music ranking reads it: its output length, the
|
|
6028
|
+
* instants a beat should land on, the moment the music should open up,
|
|
6029
|
+
* whether a voice plays. Built from the document here, where the document
|
|
6030
|
+
* is known, and handed to `@vosjs/shared/music`'s `rankBeds`, which never
|
|
6031
|
+
* reads one; the CLI's `vos music pick` and the studio's Sound panel read
|
|
6032
|
+
* the same summary, so one rule says what a cut is.
|
|
6033
|
+
*
|
|
6034
|
+
* A recording's cuts are its layers' starts (a caption landed on a step,
|
|
6035
|
+
* a callout), its segment boundaries (a join, a page change, a freeze) and
|
|
6036
|
+
* the page changes the recorder marked; its payoff is the last step the
|
|
6037
|
+
* script marks `"zoom": true`, else the last cut. A program's cuts are its
|
|
6038
|
+
* scene labels (`tl.addLabel`), its payoff the last scene. Pure.
|
|
6039
|
+
*/
|
|
6040
|
+
|
|
6041
|
+
interface FilmSummaryOptions {
|
|
6042
|
+
/** Stable identity: the vos id, else the take directory's name. */
|
|
6043
|
+
seed: string;
|
|
6044
|
+
/** The payoff, output seconds, when the person said it (`--at`). */
|
|
6045
|
+
payoff?: number;
|
|
6046
|
+
/** Override what the document says about a voice. */
|
|
6047
|
+
voice?: boolean;
|
|
6048
|
+
mood?: string;
|
|
6049
|
+
words?: string;
|
|
6050
|
+
like?: string[];
|
|
6051
|
+
fadeIn?: boolean;
|
|
6052
|
+
}
|
|
6053
|
+
/** The scene labels a program declares, output seconds, in order. */
|
|
6054
|
+
declare function programSceneTimes(config: Record<string, unknown>): number[];
|
|
6055
|
+
/**
|
|
6056
|
+
* The film summary of a document. `seed` is the caller's (a vos id when
|
|
6057
|
+
* the take is on vos.so, else its directory's name).
|
|
6058
|
+
*/
|
|
6059
|
+
declare function filmSummaryOf(doc: StudioDoc, opts: FilmSummaryOptions): FilmSummary;
|
|
6060
|
+
/** The library slugs a document's audio clips play, for a project's `like`. */
|
|
6061
|
+
declare function musicSlugsOfDoc(doc: Pick<StudioDoc, 'audio'>): string[];
|
|
6062
|
+
|
|
6063
|
+
export { ASPECT_RATIOS, AUDIO_PLAN_STEP, type AnchorKind, type AnchorMiss, type AnchorResolution, type Anim, type AnimKind, type AnimSide, type AnimStep, type AppliedTemplate, type ApplyTemplateOptions, type AspectRatioOption, type AudioClip, type AudioLoudness, type AudioPlanPoint, type AudioPlanTrack, BACKGROUND_Z, BASE_FRAME_STYLE, type Backdrop, type BackgroundMedia, type BakeResult, type BakedText3dAsset, type BakedText3dMaterial, type BrowserBarStyle, type BuildDigestInput, CALLOUT_DEFAULT_BODY_PX, CALLOUT_SHAPES, CALLOUT_TYPE_RATIO, CAMERA_CENTRE_RAMP, CAMERA_COVER_MIN, 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, CHANGE_FLOOR, CHANGE_GRID, CHANGE_LEAD, CHANGE_OFFSETS, CHANNEL_SPECS_HASH, CHANNEL_SPECS_VERIFIED, CLICK_FX_INTENSITY, CLICK_FX_PRE, CLICK_HIGHLIGHT_FADE, CLICK_HOLD_MS, CLICK_PAIR_MAX, CLICK_PULSE_DUR, CLICK_RECT_MAX_FRAC, CLICK_RIPPLE_DUR, CLICK_SYNTH_RELEASE, CLUSTER_FILL, 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, CURSOR_OFF_FADE, type CalloutBox, type CalloutClipOptions, type CalloutLook, type CalloutRegister, type CalloutShape, type CalloutWords, type CamBubbleRect, type CamPoseSpan, type CamStyle, type CameraModel, type CaptureNormalization, type CardLayout, type ChangeSample, type ChangeWitness, type ChangedRegion, type ClickFxStyle, type ClipGain, type ClipGainBasis, type CopiedLayout, type CopyLayoutOptions, type CopyStyleOptions, type CursorEvent, type CursorFadeKey, type CursorIdleOptions, type CursorOff, 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, DESIGN_FRAME_WIDTH, DESTINATIONS, DIGEST_CROP_MAX, DIGEST_FULL_MAX, DIGEST_VERSION, DOC_FEATURES, DOC_SCHEMA_VERSION, DRAG_FIT_LEVEL, DRAG_MIN_S, DRAG_MIN_TRAVEL_FRAC, type Destination, type Digest, type DigestImageRef, type DigestPlan, type DigestTakeFacts, type DocFeature, type DocSegment, type Drag, type DuckOptions, ELAPSED_PLACEHOLDER, 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, FOOTAGE_FRAME_STYLE, FRAME_BORDER_COLOR_DEFAULT, FRAME_BORDER_DEFAULT, FRAME_BORDER_WIDTH_DEFAULT, FREEZE_DEFAULT_SECONDS, FREEZE_SECONDS_MAX, FREEZE_SECONDS_MIN, type FilmSummaryOptions, type FocusBounds, type FollowEvent, type FollowOptions, type FrameEntrance, type FrameGeometry, type FrameStyle, type FreezeExtent, type FreezeSpan, HOLD_DRIFT_MAX, HOUSE_GRADIENT, HOUSE_REGISTER, HTML_LAYER_FOREIGN_FIELDS, HTML_LAYER_MAX_BYTES, HTML_LAYER_SVG_CODE, HTML_LAYER_WARN_BYTES, HTML_STARTERS, type HtmlLayerFace, type HtmlLayerInlineFace, type HtmlLayerPayload, type HtmlLayerProblem, type HtmlLayerProblemCode, type HtmlLayerSource, type HtmlOverlayClip, type HtmlOverlayFont, type HtmlStarter, IDLE_KINDS, type IdleKind, type IngestOptions, LAYER_CARD_SHADOW, LAYOUT_FRAME_FIELDS, LOOK_KINDS, type LayerCard, type LayoutParts, type Look, type LookBrand, type LookKind, type LookPlacement, type LowerProgramOptions, type LoweredAudioClip, type LoweredClick, type LoweredComposition, type LoweredZoomSpan, type LumaGrid, MEDIA_ENTER_KINDS, MEDIA_EXIT_KINDS, MEDIA_FRAME_KEYS, MEDIA_KEY_PREFIX, 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, NORMALIZE_MAX_LIFT_DB, NORMALIZE_MAX_LUFS, NORMALIZE_MIN_LUFS, NORMALIZE_PEAK_CEILING_DB, 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 OutputExtent, type OverlayAnchor, type OverlayClip, type OverlayFontFace, type OverlayKind, type OverlayPin, type OverlayPresetStyle, type OverlayRect, type OverlayTransform, type OverlayTransition, PIN_GAP, PIN_MARGIN, PLATE_GROUND, PLAYBACK_ACTIVITY, PRIMARY_MEDIA, PROGRAM_RETIME, PUMP_REST, type PeerStepSpan, type PeerTrack, type PinCandidate, type PinCarry, type PinMark, type PinPlacement, type PinPlacementInput, type PinReferent, type PinSide, type PinSideResolved, type PlanOptions, type PlanTiltOptions, type PlaneSize, type ProgramAnchorDoc, type ProgramTweenEdit, type ProjectDoc, type PxRect, REJECT_OVERLAP, REPLAY_EPS, REST_TILT_ID, RETIRED_ZOOM_STYLES, type RecordingArtifact, type RecordingMeta, type RecordingNotice, type RecordingOutput, type RecordingPageMedia, type RecordingSkip, type Rect, type RejectedLane, type RejectedSpan, type ReplayedSpan, type ResolvedOverlayBox, type ResolvedOverlayStyle, type Rgb, SCENE_MOTION, SCENE_QUIET, SEGMENT_ENTER_KINDS, SEGMENT_EXIT_KINDS, SPEED_RATE_MAX, SPEED_RATE_MIN, SPEED_SPAN_MIN, STAGE_CLIP_PREFIX, STILL_DEFAULT, STUDIO_ENTRY_ID, STYLE_FIELDS, type SegmentExtent, type SmoothOptions, type SmoothPoint, type SpeedParams, type SpeedSpan, type StepAnchor, type StepSpan, type StudioAudioPlan, type StudioDoc, type StudioEntry, type StyleField, type StyledText, 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_SECONDS, TRANSITION_SECONDS_MAX, TRANSITION_SECONDS_MIN, 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 TraceFileKind, type TraceOptions, type TraceResult, type TranscriptSegment, type Transition, type TransitionKind, type TransitionMove, type TransitionOut, type TransitionSpeed, type UsedFeature, 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 ZipEntry, type ZoomScreen, type ZoomSpan, type ZoomStyleName, type ZoomStyleParams, type ZoomView, type ZoomWindow, ambientDrift, anchorKindOf, anchorSourceDuration, anchoredClip, animStep, applyLook, applyTemplate, aspectRatioValue, audioLane, backdropMedia, bakeDocFeatures, boldWeightFor, buildDigest, calloutBox, calloutClip, calloutGroundOf, calloutLook, calloutSource, camBubbleRect, camBubbleRectAt, camLane, camMoveLane, camRectFromPose, camRestPose, camTrackFromDoc, cameraCentring, cameraModel, cameraRestWindows, cameraRests, cameraSpanExtents, cardEnter, cardExit, cardFields, cardInset, cardPointToScreen, cardPoseTrack, changedRegion, clampCamFrac, clampCamSize, clampFocus, clampFreezeSeconds, clampSpeedRate, clampTiltDeg, clampZoomLevel, clipEnvelope, clipGain, clipLength, clipsFrom, compareVersions, computeCardLayout, computeMicRms, computePeaks, copyLayout, copyStyle, cropBox, cssFamilies, cssWeights, cursorFromCsv, cursorFromPlaywrightTrace, cursorFromRecords, cursorFromTrace, cursorIdleFade, cursorOffAlpha, deltaE, deriveViewportCrop, destinationById, destinationsForChannel, docCardLayout, docFeatures, docFreezes, docMediaList, docOutputDuration, docRestTime, docStillTime, docToCropSpace, docToFullSpace, docTransitions, docZoomTrack, dragsFromTrack, dropTemplate, duckCurve, effectiveSegments, elapsedFor, endCardClips, enterKey, enterOf, entranceAt, entranceEnd, entranceSeconds, envelopeAt, envelopeValueAt, exitKey, exitOf, exitSeconds, expandEndCard, expectedFrameSize, exportSizeFor, extractClicks, featuresNewerThan, filmSummaryOf, findStep, focusBounds, focusForViewportCentre, followFocusEvents, formatElapsed, frameGeometry, freezeLane, freezeOutputExtents, hasElapsed, hasReplay, hexToRgb, hexToRgbTriplet, houseLook, htmlLayerBleed, htmlLayerBleedFor, htmlLayerFaces, htmlLayerKey, htmlLayerLabel, htmlLayerPayload, htmlLayerPictureBox, htmlLayerProblems, htmlLayerSvg, htmlLayerText, htmlLayerUnhostedFamilies, htmlLayerWidth, htmlStarterClip, idleGaps, idleKey, isKeyedOverlay, isLookKind, isLoweredRecording, isMusicBed, isPlayback, isProgramDoc, isRecordingDoc, isRejected, isStageClip, isUnitStep, lastLayerEnd, layerMedia, layerStart, layoutOf, levelForFocusFraction, liveZoomStyleName, longestOutputExtent, lookFromBrand, lookKindForGround, loudnessMatches, lowerProgramDoc, lowerStudioDoc, lowerToComposition, marksEmphasis, mediaAtOutput, mediaDuration, mediaFrame, mediaKey, mediaRef, mediaRefId, mediaSource, micLane, migrateHostedDoc, migrateMotion, migrateText, migrateTextClip, migrateZoomStyle, momentOutputs, momentsFromDoc, motionTrack, musicBedClip, musicSlugsOfDoc, nextMediaId, normalizeCaptureSpace, objectMotionBase, objectMotionPoseAt, objectsLane, outputDurationOf, outputEnd, outputRangeToSource, overlapFraction, overlayFaceFor, overlayFontFaces, overlayFontString, overlayFxSpec, overlayHit, overlayLines, overlayMotionBase, overlayMotionPoseAt, overlayPinPoseAt, overlayPlainText, overlayRect, overlaysLane, ownFreezes, pageDisplayUrl, parseCssColour, parsePoseId, pickChange, pickStyle, pinBox, pinCandidates, pinPlacement, pinRectOnScreen, pinReferent, pinReferentAt, placeFreezes, planAutoSpeed, planAutoTilt, planAutoZoom, planForDigest, planeSizeAtDepth, platformBarKind, playwrightTraceEntry, programDuration, programSceneTimes, programStillTime, projectFromArtifact, pumpFreeChainGap, ratedSegments, recommendedExportResolution, refillAudioBeds, rejectSpan, relativeLuminance, removeSourceRange, removeSpeedInRange, replayFlags, replayedSeconds, resolveAnchor, resolveExportSize, resolveOverlayAnchors, resolveOverlayBox, resolveOverlayStyle, resolvePins, resolveText3dAsset, resolveZoomStyle, restLeanOf, restSpansThroughTransitions, rgbToHex, sameMedia, sceneChanges, scrollRuns, segmentOutputExtents, outputLen as segmentOutputLen, segmentStarts, setSpeedInRange, slideSide, smoothCursor, snapRunWeight, sourceMomentToOutput, spanOutputExtent, spanOutputExtents, speedLane, stepElapsedMs, stepMomentToOutput, studioAudioPlan, studioEntry, studioLayerData, styledTextOf, textRunsOf, tiltLane, tiltTrackFromDoc, traceKindOf, transitionMult, transitionSeconds, unionFitLevel, unionRect, videoLane, voiceKey, wellFormedXml, withBackdrop, withFreezes, withHolds, withoutRejected, wrapProgramLength, zipEntries, zipEntryBytes, zoomCoversRect, zoomLane, zoomSpanForRange, zoomTrackFromDoc, zoomView, zoomViewport, zoomWindow };
|
package/dist/index.js
CHANGED
|
@@ -12815,6 +12815,116 @@ function rejectSpan(rejected, lane, span, note) {
|
|
|
12815
12815
|
if (note) entry.note = note;
|
|
12816
12816
|
return entry;
|
|
12817
12817
|
}
|
|
12818
|
+
|
|
12819
|
+
// src/filmSummary.ts
|
|
12820
|
+
var CUT_MERGE = 0.25;
|
|
12821
|
+
var r32 = (v) => Math.round(v * 1e3) / 1e3;
|
|
12822
|
+
var isMusicOrEffect = (key) => /\/music\/[^/?#]+\.mp3(?:[?#]|$)/.test(key) || /\/audio-sfx\//.test(key);
|
|
12823
|
+
function programSceneTimes(config) {
|
|
12824
|
+
const code = JSON.stringify(config);
|
|
12825
|
+
const times = /* @__PURE__ */ new Set();
|
|
12826
|
+
for (const m of code.matchAll(
|
|
12827
|
+
/addLabel\(\s*(?:\\"|['`])[^'`"\\]*(?:\\"|['`])\s*,\s*([\d.]+)/g
|
|
12828
|
+
)) {
|
|
12829
|
+
const t = Number(m[1]);
|
|
12830
|
+
if (Number.isFinite(t) && t > 0) times.add(r32(t));
|
|
12831
|
+
}
|
|
12832
|
+
return [...times].sort((a, b) => a - b);
|
|
12833
|
+
}
|
|
12834
|
+
function markedSteps(source) {
|
|
12835
|
+
const steps = source.script?.steps;
|
|
12836
|
+
if (!Array.isArray(steps)) return [];
|
|
12837
|
+
const out = [];
|
|
12838
|
+
steps.forEach((s, i) => {
|
|
12839
|
+
if (!s || typeof s !== "object") return;
|
|
12840
|
+
const step = s;
|
|
12841
|
+
if (step.zoom === true) out.push(typeof step.id === "string" ? step.id : i);
|
|
12842
|
+
});
|
|
12843
|
+
return out;
|
|
12844
|
+
}
|
|
12845
|
+
function tidy(cuts, duration) {
|
|
12846
|
+
const sorted = cuts.filter((t) => Number.isFinite(t) && t > CUT_MERGE && t < duration - 0.05).map(r32).sort((a, b) => a - b);
|
|
12847
|
+
const out = [];
|
|
12848
|
+
for (const t of sorted) {
|
|
12849
|
+
if (!out.length || t - out[out.length - 1] > CUT_MERGE) out.push(t);
|
|
12850
|
+
}
|
|
12851
|
+
return out;
|
|
12852
|
+
}
|
|
12853
|
+
function filmSummaryOf(doc, opts) {
|
|
12854
|
+
const duration = r32(docOutputDuration(doc));
|
|
12855
|
+
const cuts = [];
|
|
12856
|
+
let payoff = opts.payoff;
|
|
12857
|
+
let voice = opts.voice ?? false;
|
|
12858
|
+
if (isRecordingDoc(doc)) {
|
|
12859
|
+
const rated = ratedSegments(doc);
|
|
12860
|
+
let t = 0;
|
|
12861
|
+
for (const s of rated) {
|
|
12862
|
+
const rate = s.rate && s.rate > 0 ? s.rate : 1;
|
|
12863
|
+
t += (s.out - s.in) / rate;
|
|
12864
|
+
cuts.push(t);
|
|
12865
|
+
}
|
|
12866
|
+
for (const clip of doc.overlays ?? []) {
|
|
12867
|
+
const start = layerStart(clip, doc, rated);
|
|
12868
|
+
if (start !== null) cuts.push(start);
|
|
12869
|
+
}
|
|
12870
|
+
let lastMarked = null;
|
|
12871
|
+
for (const { id, source } of docMediaList(doc)) {
|
|
12872
|
+
for (const step of source.meta.steps ?? []) {
|
|
12873
|
+
if (step.navigated && typeof step.tEnd === "number") {
|
|
12874
|
+
const out = sourceMomentToOutput(rated, step.tEnd, id || void 0);
|
|
12875
|
+
if (out !== null) cuts.push(out);
|
|
12876
|
+
}
|
|
12877
|
+
}
|
|
12878
|
+
for (const step of markedSteps(source)) {
|
|
12879
|
+
const r = resolveAnchor(
|
|
12880
|
+
doc,
|
|
12881
|
+
{ step, ...id ? { media: id } : {} },
|
|
12882
|
+
rated
|
|
12883
|
+
);
|
|
12884
|
+
if (r.start !== null) {
|
|
12885
|
+
cuts.push(r.start);
|
|
12886
|
+
if (lastMarked === null || r.start > lastMarked) lastMarked = r.start;
|
|
12887
|
+
}
|
|
12888
|
+
}
|
|
12889
|
+
}
|
|
12890
|
+
if (payoff === void 0 && lastMarked !== null) payoff = lastMarked;
|
|
12891
|
+
if (opts.voice === void 0) {
|
|
12892
|
+
voice = voiceKey(doc) !== null || (doc.audio ?? []).some((a) => !isMusicOrEffect(a.key));
|
|
12893
|
+
}
|
|
12894
|
+
} else {
|
|
12895
|
+
const scenes = programSceneTimes(doc.program.config);
|
|
12896
|
+
cuts.push(...scenes);
|
|
12897
|
+
if (payoff === void 0 && scenes.length)
|
|
12898
|
+
payoff = scenes[scenes.length - 1];
|
|
12899
|
+
if (opts.voice === void 0) {
|
|
12900
|
+
voice = (doc.audio ?? []).some((a) => !isMusicOrEffect(a.key));
|
|
12901
|
+
}
|
|
12902
|
+
}
|
|
12903
|
+
const tidied = tidy(cuts, duration);
|
|
12904
|
+
if (payoff === void 0 && tidied.length) payoff = tidied[tidied.length - 1];
|
|
12905
|
+
if (payoff !== void 0 && !(payoff > 0 && payoff < duration)) {
|
|
12906
|
+
payoff = void 0;
|
|
12907
|
+
}
|
|
12908
|
+
return {
|
|
12909
|
+
duration,
|
|
12910
|
+
...payoff !== void 0 ? { payoff: r32(payoff) } : {},
|
|
12911
|
+
cuts: tidied,
|
|
12912
|
+
voice,
|
|
12913
|
+
...opts.mood ? { mood: opts.mood } : {},
|
|
12914
|
+
...opts.words ? { words: opts.words } : {},
|
|
12915
|
+
seed: opts.seed,
|
|
12916
|
+
...opts.like?.length ? { like: opts.like } : {},
|
|
12917
|
+
...opts.fadeIn ? { fadeIn: true } : {}
|
|
12918
|
+
};
|
|
12919
|
+
}
|
|
12920
|
+
function musicSlugsOfDoc(doc) {
|
|
12921
|
+
const out = /* @__PURE__ */ new Set();
|
|
12922
|
+
for (const a of doc.audio ?? []) {
|
|
12923
|
+
const m = /\/music\/([a-z0-9][a-z0-9-]*)\.mp3(?:[?#]|$)/.exec(a.key);
|
|
12924
|
+
if (m) out.add(m[1]);
|
|
12925
|
+
}
|
|
12926
|
+
return [...out].sort();
|
|
12927
|
+
}
|
|
12818
12928
|
export {
|
|
12819
12929
|
ASPECT_RATIOS,
|
|
12820
12930
|
AUDIO_PLAN_STEP,
|
|
@@ -13109,6 +13219,7 @@ export {
|
|
|
13109
13219
|
exportSizeFor,
|
|
13110
13220
|
extractClicks,
|
|
13111
13221
|
featuresNewerThan,
|
|
13222
|
+
filmSummaryOf,
|
|
13112
13223
|
findStep,
|
|
13113
13224
|
focusBounds,
|
|
13114
13225
|
focusForViewportCentre,
|
|
@@ -13181,6 +13292,7 @@ export {
|
|
|
13181
13292
|
momentsFromDoc,
|
|
13182
13293
|
motionTrack,
|
|
13183
13294
|
musicBedClip,
|
|
13295
|
+
musicSlugsOfDoc,
|
|
13184
13296
|
nextMediaId,
|
|
13185
13297
|
normalizeCaptureSpace,
|
|
13186
13298
|
normalizeRuns,
|
|
@@ -13226,6 +13338,7 @@ export {
|
|
|
13226
13338
|
platformBarKind,
|
|
13227
13339
|
playwrightTraceEntry,
|
|
13228
13340
|
programDuration,
|
|
13341
|
+
programSceneTimes,
|
|
13229
13342
|
programStillTime,
|
|
13230
13343
|
projectFromArtifact,
|
|
13231
13344
|
pumpFreeChainGap,
|