@vosjs/studio-core 0.22.1 → 0.23.1
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 +47 -1
- package/dist/index.js +128 -12
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -73,6 +73,14 @@ interface ZoomStyleParams {
|
|
|
73
73
|
targetFill: number;
|
|
74
74
|
minLevel: number;
|
|
75
75
|
maxLevel: number;
|
|
76
|
+
/**
|
|
77
|
+
* The level a DRAG is followed at (a press that travels before its
|
|
78
|
+
* release: a slider thumb, a scrubber, a thing moved across a canvas).
|
|
79
|
+
* The camera pans WITH the pointer for the whole press (a path follow,
|
|
80
|
+
* not a dead zone), so the level stays mild: the thumb and what it drives
|
|
81
|
+
* both stay in the window.
|
|
82
|
+
*/
|
|
83
|
+
dragLevel: number;
|
|
76
84
|
/** span lead-in before the first click / hold after the last (seconds). */
|
|
77
85
|
lead: number;
|
|
78
86
|
hold: number;
|
|
@@ -2065,6 +2073,35 @@ declare function smoothCursor(track: CursorTrack, options?: SmoothOptions): Smoo
|
|
|
2065
2073
|
* is set aside before clustering; the targets around it keep their zoom.
|
|
2066
2074
|
*/
|
|
2067
2075
|
declare const DRAG_FIT_LEVEL = 1.15;
|
|
2076
|
+
/**
|
|
2077
|
+
* A press that TRAVELS before its release is a drag (a slider thumb, a
|
|
2078
|
+
* scrubber, a thing moved across a canvas): the pointer's path is the
|
|
2079
|
+
* content, so the camera follows it for the whole press at the style's
|
|
2080
|
+
* dragLevel instead of framing the press as a click. Travel is the farthest
|
|
2081
|
+
* the pointer gets from the press point, as a fraction of the frame width;
|
|
2082
|
+
* a press held still (a long click) stays a click.
|
|
2083
|
+
*/
|
|
2084
|
+
declare const DRAG_MIN_TRAVEL_FRAC = 0.015;
|
|
2085
|
+
declare const DRAG_MIN_S = 0.2;
|
|
2086
|
+
/** A press that travelled before its release, in seconds and frame fractions. */
|
|
2087
|
+
interface Drag {
|
|
2088
|
+
/** the press and the release, seconds */
|
|
2089
|
+
t0: number;
|
|
2090
|
+
t1: number;
|
|
2091
|
+
/** the press point, normalized */
|
|
2092
|
+
nx: number;
|
|
2093
|
+
ny: number;
|
|
2094
|
+
/** the pointer's farthest excursion from the press point, frame widths */
|
|
2095
|
+
travel: number;
|
|
2096
|
+
}
|
|
2097
|
+
/**
|
|
2098
|
+
* The drags in a cursor track: each `down` paired with the next `up`, kept
|
|
2099
|
+
* when the pointer travelled ≥ DRAG_MIN_TRAVEL_FRAC between them over
|
|
2100
|
+
* ≥ DRAG_MIN_S. Shared by the planner (a drag plans a follow span, and its
|
|
2101
|
+
* press is not a click) and the lowering's cursor follow (a drag inside any
|
|
2102
|
+
* follow span is tracked as a path).
|
|
2103
|
+
*/
|
|
2104
|
+
declare function dragsFromTrack(track: CursorTrack, width: number, height: number): Drag[];
|
|
2068
2105
|
interface PlanOptions {
|
|
2069
2106
|
/** captured frame size (for normalizing rects → [0..1] focus points). */
|
|
2070
2107
|
width: number;
|
|
@@ -2088,6 +2125,8 @@ interface PlanOptions {
|
|
|
2088
2125
|
hold?: number;
|
|
2089
2126
|
/** minimum clicks for a cluster to earn a zoom (Cursorful's ≥2 rule). */
|
|
2090
2127
|
minClusterClicks?: number;
|
|
2128
|
+
/** the level a drag is followed at (see ZoomStyleParams.dragLevel). */
|
|
2129
|
+
dragLevel?: number;
|
|
2091
2130
|
/** emit spans with focusMode 'auto' (cursor-follow camera). */
|
|
2092
2131
|
followByDefault?: boolean;
|
|
2093
2132
|
/** typing sessions plan spans. */
|
|
@@ -2844,6 +2883,13 @@ interface FollowOptions {
|
|
|
2844
2883
|
interface FollowEvent {
|
|
2845
2884
|
/** SOURCE seconds — the moment the recenter starts. */
|
|
2846
2885
|
t: number;
|
|
2886
|
+
/**
|
|
2887
|
+
* A PATH sample: the camera is at this focus AT `t` (a linear segment
|
|
2888
|
+
* from the previous keyframe), not the start of a glide toward it. Baked
|
|
2889
|
+
* every FOLLOW_PATH_STEP through a drag, so the camera pans with the
|
|
2890
|
+
* pointer for the whole press.
|
|
2891
|
+
*/
|
|
2892
|
+
path?: true;
|
|
2847
2893
|
cx: number;
|
|
2848
2894
|
cy: number;
|
|
2849
2895
|
}
|
|
@@ -4460,4 +4506,4 @@ declare function rejectSpan(rejected: RejectedSpan[] | undefined, lane: Rejected
|
|
|
4460
4506
|
anchor?: StepAnchor;
|
|
4461
4507
|
}, note?: string): RejectedSpan;
|
|
4462
4508
|
|
|
4463
|
-
export { ASPECT_RATIOS, AUDIO_PLAN_STEP, type AnchorKind, type Anim, type AnimKind, type AnimSide, 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_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, 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 CameraModel, 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, DESIGN_FRAME_WIDTH, 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, 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, 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, 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, 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, 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 TranscriptSegment, type Transition, type TransitionKind, type TransitionMove, type TransitionOut, 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 ZoomView, type ZoomWindow, anchorKindOf, anchorSourceDuration, animStep, applyLook, applyTemplate, aspectRatioValue, audioLane, backdropMedia, buildDigest, camBubbleRect, camBubbleRectAt, camLane, camMoveLane, camRectFromPose, camRestPose, camTrackFromDoc, cameraCentring, cameraModel, cardEnter, cardExit, cardFields, cardInset, cardPointToScreen, cardPoseTrack, clampCamFrac, clampCamSize, clampFocus, clampFreezeSeconds, clampSpeedRate, clampTiltDeg, clampZoomLevel, clipEnvelope, clipLength, clipsFrom, computeCardLayout, computeMicRms, computePeaks, copyLayout, copyStyle, cropBox, cssFamilies, cssWeights, cursorIdleFade, deriveViewportCrop, destinationById, destinationsForChannel, docCardLayout, docFreezes, docMediaList, docOutputDuration, docRestTime, docStillTime, docToCropSpace, docToFullSpace, docTransitions, dropTemplate, duckCurve, effectiveSegments, endCardClips, enterKey, enterOf, entranceSeconds, envelopeAt, envelopeValueAt, exitKey, exitOf, exitSeconds, expandEndCard, expectedFrameSize, exportSizeFor, extractClicks, focusBounds, focusForViewportCentre, followFocusEvents, frameGeometry, freezeLane, freezeOutputExtents, hexToRgbTriplet, houseLook, htmlLayerBleed, htmlLayerBleedFor, htmlLayerFaces, htmlLayerKey, htmlLayerLabel, htmlLayerPayload, htmlLayerPictureBox, htmlLayerProblems, htmlLayerSvg, htmlLayerText, htmlLayerUnhostedFamilies, htmlLayerWidth, htmlStarterClip, idleGaps, idleKey, isKeyedOverlay, isLookKind, isMusicBed, isPlayback, isProgramDoc, isRecordingDoc, isRejected, isStageClip, isUnitStep, lastLayerEnd, layerMedia, layoutOf, levelForFocusFraction, lookFromBrand, lookKindForGround, lowerProgramDoc, lowerStudioDoc, lowerToComposition, mediaAtOutput, mediaDuration, mediaFrame, mediaKey, mediaRef, mediaRefId, 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, ownFreezes, pageDisplayUrl, parsePoseId, pickStyle, placeFreezes, planAutoSpeed, planAutoTilt, planAutoZoom, planForDigest, planeSizeAtDepth, platformBarKind, programDuration, projectFromArtifact, ratedSegments, recommendedExportResolution, refillAudioBeds, rejectSpan, removeSourceRange, removeSpeedInRange, resolveExportSize, resolveOverlayBox, resolveOverlayStyle, resolveText3dAsset, resolveZoomStyle, restLeanOf, restSpansThroughTransitions, sameMedia, sceneChanges, scrollRuns, segmentOutputExtents, outputLen as segmentOutputLen, segmentStarts, setSpeedInRange, slideSide, smoothCursor, spanOutputExtent, speedLane, studioAudioPlan, studioEntry, studioLayerData, tiltLane, tiltTrackFromDoc, transitionMult, transitionSeconds, videoLane, voiceKey, wellFormedXml, withBackdrop, withFreezes, withHolds, withoutRejected, wrapProgramLength, zoomCoversRect, zoomLane, zoomSpanForRange, zoomTrackFromDoc, zoomView, zoomViewport, zoomWindow };
|
|
4509
|
+
export { ASPECT_RATIOS, AUDIO_PLAN_STEP, type AnchorKind, type Anim, type AnimKind, type AnimSide, 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_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, 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 CameraModel, 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, DESIGN_FRAME_WIDTH, DESTINATIONS, DIGEST_CROP_MAX, DIGEST_FULL_MAX, DIGEST_VERSION, DOC_SCHEMA_VERSION, DRAG_FIT_LEVEL, DRAG_MIN_S, DRAG_MIN_TRAVEL_FRAC, type Destination, type Digest, type DigestImageRef, type DigestPlan, type DigestTakeFacts, type DocSegment, type Drag, 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, 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, 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, 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, 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, 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 TranscriptSegment, type Transition, type TransitionKind, type TransitionMove, type TransitionOut, 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 ZoomView, type ZoomWindow, anchorKindOf, anchorSourceDuration, animStep, applyLook, applyTemplate, aspectRatioValue, audioLane, backdropMedia, buildDigest, camBubbleRect, camBubbleRectAt, camLane, camMoveLane, camRectFromPose, camRestPose, camTrackFromDoc, cameraCentring, cameraModel, cardEnter, cardExit, cardFields, cardInset, cardPointToScreen, cardPoseTrack, clampCamFrac, clampCamSize, clampFocus, clampFreezeSeconds, clampSpeedRate, clampTiltDeg, clampZoomLevel, clipEnvelope, clipLength, clipsFrom, computeCardLayout, computeMicRms, computePeaks, copyLayout, copyStyle, cropBox, cssFamilies, cssWeights, cursorIdleFade, deriveViewportCrop, destinationById, destinationsForChannel, docCardLayout, docFreezes, docMediaList, docOutputDuration, docRestTime, docStillTime, docToCropSpace, docToFullSpace, docTransitions, dragsFromTrack, dropTemplate, duckCurve, effectiveSegments, endCardClips, enterKey, enterOf, entranceSeconds, envelopeAt, envelopeValueAt, exitKey, exitOf, exitSeconds, expandEndCard, expectedFrameSize, exportSizeFor, extractClicks, focusBounds, focusForViewportCentre, followFocusEvents, frameGeometry, freezeLane, freezeOutputExtents, hexToRgbTriplet, houseLook, htmlLayerBleed, htmlLayerBleedFor, htmlLayerFaces, htmlLayerKey, htmlLayerLabel, htmlLayerPayload, htmlLayerPictureBox, htmlLayerProblems, htmlLayerSvg, htmlLayerText, htmlLayerUnhostedFamilies, htmlLayerWidth, htmlStarterClip, idleGaps, idleKey, isKeyedOverlay, isLookKind, isMusicBed, isPlayback, isProgramDoc, isRecordingDoc, isRejected, isStageClip, isUnitStep, lastLayerEnd, layerMedia, layoutOf, levelForFocusFraction, lookFromBrand, lookKindForGround, lowerProgramDoc, lowerStudioDoc, lowerToComposition, mediaAtOutput, mediaDuration, mediaFrame, mediaKey, mediaRef, mediaRefId, 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, ownFreezes, pageDisplayUrl, parsePoseId, pickStyle, placeFreezes, planAutoSpeed, planAutoTilt, planAutoZoom, planForDigest, planeSizeAtDepth, platformBarKind, programDuration, projectFromArtifact, ratedSegments, recommendedExportResolution, refillAudioBeds, rejectSpan, removeSourceRange, removeSpeedInRange, resolveExportSize, resolveOverlayBox, resolveOverlayStyle, resolveText3dAsset, resolveZoomStyle, restLeanOf, restSpansThroughTransitions, sameMedia, sceneChanges, scrollRuns, segmentOutputExtents, outputLen as segmentOutputLen, segmentStarts, setSpeedInRange, slideSide, smoothCursor, spanOutputExtent, speedLane, studioAudioPlan, studioEntry, studioLayerData, tiltLane, tiltTrackFromDoc, transitionMult, transitionSeconds, videoLane, voiceKey, wellFormedXml, withBackdrop, withFreezes, withHolds, withoutRejected, wrapProgramLength, zoomCoversRect, zoomLane, zoomSpanForRange, zoomTrackFromDoc, zoomView, zoomViewport, zoomWindow };
|
package/dist/index.js
CHANGED
|
@@ -1156,6 +1156,7 @@ var ZOOM_STYLES = {
|
|
|
1156
1156
|
targetFill: 0.42,
|
|
1157
1157
|
minLevel: 1.3,
|
|
1158
1158
|
maxLevel: 1.8,
|
|
1159
|
+
dragLevel: 1.5,
|
|
1159
1160
|
lead: 0.35,
|
|
1160
1161
|
hold: 1.2,
|
|
1161
1162
|
followByDefault: true,
|
|
@@ -1163,18 +1164,21 @@ var ZOOM_STYLES = {
|
|
|
1163
1164
|
typingGap: 2.5,
|
|
1164
1165
|
typingHold: 1.1,
|
|
1165
1166
|
typingMinLevel: 1.4,
|
|
1166
|
-
rampIn: 0.
|
|
1167
|
+
rampIn: 0.6,
|
|
1167
1168
|
rampInOverlap: 0.2,
|
|
1168
1169
|
rampOut: 0.5,
|
|
1169
1170
|
chainGap: 3,
|
|
1170
1171
|
pan: 0.55,
|
|
1171
1172
|
// The reference's corner trace at 60 fps: a quarter of the move by a
|
|
1172
|
-
// fifth of the time, two thirds by half,
|
|
1173
|
-
//
|
|
1174
|
-
// (0.
|
|
1175
|
-
// and
|
|
1176
|
-
ease
|
|
1177
|
-
|
|
1173
|
+
// fifth of the time, two thirds by half, nine tenths by three
|
|
1174
|
+
// quarters, over ~0.6 s. Fitted against those three points,
|
|
1175
|
+
// (0.36, 0, 0.4, 1) is the closest cubic (15 / 64 / 93 %; half the
|
|
1176
|
+
// move at ~245 ms and 90 % at ~425 ms at 0.6 s): a gentle start and a
|
|
1177
|
+
// long settle. CSS ease (0.25, 0.1, 0.25, 1) reached the midpoint
|
|
1178
|
+
// 70 ms earlier and read a touch fast; (0.16, 1, 0.3, 1) put half the
|
|
1179
|
+
// move in the first sixty milliseconds and read as a twitch.
|
|
1180
|
+
ease: "css-bezier(0.36, 0, 0.4, 1)",
|
|
1181
|
+
panEase: "css-bezier(0.36, 0, 0.4, 1)",
|
|
1178
1182
|
followSafeRatio: 0.45,
|
|
1179
1183
|
followRecenter: 0.55,
|
|
1180
1184
|
followLookahead: 0.4,
|
|
@@ -1188,6 +1192,7 @@ var ZOOM_STYLES = {
|
|
|
1188
1192
|
targetFill: 0.5,
|
|
1189
1193
|
minLevel: 1.5,
|
|
1190
1194
|
maxLevel: 2.2,
|
|
1195
|
+
dragLevel: 1.7,
|
|
1191
1196
|
lead: 0.35,
|
|
1192
1197
|
hold: 1,
|
|
1193
1198
|
followByDefault: false,
|
|
@@ -1215,6 +1220,7 @@ var ZOOM_STYLES = {
|
|
|
1215
1220
|
targetFill: 0.45,
|
|
1216
1221
|
minLevel: 1.35,
|
|
1217
1222
|
maxLevel: 2,
|
|
1223
|
+
dragLevel: 1.5,
|
|
1218
1224
|
lead: 0.6,
|
|
1219
1225
|
hold: 1.4,
|
|
1220
1226
|
followByDefault: true,
|
|
@@ -1242,6 +1248,7 @@ var ZOOM_STYLES = {
|
|
|
1242
1248
|
targetFill: 0.5,
|
|
1243
1249
|
minLevel: 1.4,
|
|
1244
1250
|
maxLevel: 2.5,
|
|
1251
|
+
dragLevel: 1.7,
|
|
1245
1252
|
lead: 0.25,
|
|
1246
1253
|
hold: 1,
|
|
1247
1254
|
followByDefault: false,
|
|
@@ -1269,6 +1276,7 @@ var ZOOM_STYLES = {
|
|
|
1269
1276
|
targetFill: 0.5,
|
|
1270
1277
|
minLevel: 1.5,
|
|
1271
1278
|
maxLevel: 2.2,
|
|
1279
|
+
dragLevel: 1.7,
|
|
1272
1280
|
lead: 0.2,
|
|
1273
1281
|
hold: 1,
|
|
1274
1282
|
followByDefault: false,
|
|
@@ -1297,6 +1305,7 @@ var ZOOM_STYLES = {
|
|
|
1297
1305
|
targetFill: 0.42,
|
|
1298
1306
|
minLevel: 1.3,
|
|
1299
1307
|
maxLevel: 1.8,
|
|
1308
|
+
dragLevel: 1.5,
|
|
1300
1309
|
lead: 0.5,
|
|
1301
1310
|
hold: 0.6,
|
|
1302
1311
|
followByDefault: false,
|
|
@@ -1334,6 +1343,7 @@ var ZOOM_STYLES = {
|
|
|
1334
1343
|
targetFill: 0.42,
|
|
1335
1344
|
minLevel: 1.3,
|
|
1336
1345
|
maxLevel: 1.8,
|
|
1346
|
+
dragLevel: 1.5,
|
|
1337
1347
|
lead: 0.5,
|
|
1338
1348
|
hold: 0.7,
|
|
1339
1349
|
followByDefault: true,
|
|
@@ -1371,6 +1381,7 @@ var ZOOM_STYLES = {
|
|
|
1371
1381
|
targetFill: 0.45,
|
|
1372
1382
|
minLevel: 1.35,
|
|
1373
1383
|
maxLevel: 2,
|
|
1384
|
+
dragLevel: 1.5,
|
|
1374
1385
|
lead: 0.6,
|
|
1375
1386
|
hold: 1.4,
|
|
1376
1387
|
followByDefault: true,
|
|
@@ -1441,6 +1452,37 @@ var DWELL_SPACING = 1.8;
|
|
|
1441
1452
|
var DRAG_FIT_LEVEL = 1.15;
|
|
1442
1453
|
var PRESS_ECHO_MS = 4;
|
|
1443
1454
|
var PRESS_ECHO_PX = 2;
|
|
1455
|
+
var DRAG_MIN_TRAVEL_FRAC = 0.015;
|
|
1456
|
+
var DRAG_MIN_S = 0.2;
|
|
1457
|
+
function dragsFromTrack(track, width, height) {
|
|
1458
|
+
if (!(width > 0) || !(height > 0)) return [];
|
|
1459
|
+
const downs = dedupePresses(track.filter((e) => e.type === "down"));
|
|
1460
|
+
const out = [];
|
|
1461
|
+
for (const d of downs) {
|
|
1462
|
+
const up = track.find((e) => e.type === "up" && e.t > d.t);
|
|
1463
|
+
if (!up) continue;
|
|
1464
|
+
const t0 = d.t / 1e3;
|
|
1465
|
+
const t1 = up.t / 1e3;
|
|
1466
|
+
if (t1 - t0 < DRAG_MIN_S) continue;
|
|
1467
|
+
let travel = 0;
|
|
1468
|
+
for (const e of track) {
|
|
1469
|
+
if (e.t < d.t) continue;
|
|
1470
|
+
if (e.t > up.t) break;
|
|
1471
|
+
if (e.type !== "move" && e.type !== "up") continue;
|
|
1472
|
+
const dist = Math.hypot(e.x - d.x, e.y - d.y) / width;
|
|
1473
|
+
if (dist > travel) travel = dist;
|
|
1474
|
+
}
|
|
1475
|
+
if (travel < DRAG_MIN_TRAVEL_FRAC) continue;
|
|
1476
|
+
out.push({
|
|
1477
|
+
t0,
|
|
1478
|
+
t1,
|
|
1479
|
+
nx: clamp012(d.x / width),
|
|
1480
|
+
ny: clamp012(d.y / height),
|
|
1481
|
+
travel
|
|
1482
|
+
});
|
|
1483
|
+
}
|
|
1484
|
+
return out;
|
|
1485
|
+
}
|
|
1444
1486
|
var TYPING_MIN_PINGS = 2;
|
|
1445
1487
|
var TYPING_MIN_DUR = 0.5;
|
|
1446
1488
|
var TYPING_CLICK_ABSORB = 1.5;
|
|
@@ -1518,13 +1560,14 @@ function planAutoZoom(track, options) {
|
|
|
1518
1560
|
lead = style.lead,
|
|
1519
1561
|
hold = style.hold,
|
|
1520
1562
|
minClusterClicks = style.minClusterClicks,
|
|
1563
|
+
dragLevel = style.dragLevel,
|
|
1521
1564
|
followByDefault = style.followByDefault,
|
|
1522
1565
|
typingZoom = style.typingZoom,
|
|
1523
1566
|
typingGap = style.typingGap,
|
|
1524
1567
|
typingHold = style.typingHold,
|
|
1525
1568
|
typingMinLevel = style.typingMinLevel
|
|
1526
1569
|
} = options;
|
|
1527
|
-
const
|
|
1570
|
+
const grouped = groupTrack(track, {
|
|
1528
1571
|
width,
|
|
1529
1572
|
height,
|
|
1530
1573
|
clusterGap,
|
|
@@ -1532,6 +1575,22 @@ function planAutoZoom(track, options) {
|
|
|
1532
1575
|
typingZoom,
|
|
1533
1576
|
targetFill
|
|
1534
1577
|
});
|
|
1578
|
+
const { sessions } = grouped;
|
|
1579
|
+
const drags = dragsFromTrack(track, width, height);
|
|
1580
|
+
const dragPress = new Set(drags.map((d) => round(d.t0)));
|
|
1581
|
+
const withoutDrags = (list) => list.map((cl) => cl.filter((c) => !dragPress.has(round(c.t)))).filter((cl) => cl.length > 0);
|
|
1582
|
+
const clusters = withoutDrags(grouped.clusters);
|
|
1583
|
+
const surfaces = withoutDrags(grouped.surfaces);
|
|
1584
|
+
const dragSpans = drags.map((d, i) => ({
|
|
1585
|
+
id: `g${i}`,
|
|
1586
|
+
in: round(Math.max(0, d.t0 - lead)),
|
|
1587
|
+
out: round(d.t1 + hold),
|
|
1588
|
+
level: clampZoomLevel(Math.min(Math.max(dragLevel, 1.1), maxLevel)),
|
|
1589
|
+
cx: round(d.nx),
|
|
1590
|
+
cy: round(d.ny),
|
|
1591
|
+
focusMode: "auto",
|
|
1592
|
+
source: "auto"
|
|
1593
|
+
}));
|
|
1535
1594
|
const eligible = clusters.filter((c) => c.length >= minClusterClicks);
|
|
1536
1595
|
const clickSpans = [];
|
|
1537
1596
|
const dragReserved = surfaces.map((cluster, i) => {
|
|
@@ -1620,7 +1679,7 @@ function planAutoZoom(track, options) {
|
|
|
1620
1679
|
// the FIELD is the anchor, and a follow would be a no-op at best.
|
|
1621
1680
|
source: "auto"
|
|
1622
1681
|
}));
|
|
1623
|
-
const spans = [...zSpans, ...kSpans].sort((a, b) => a.in - b.in);
|
|
1682
|
+
const spans = [...zSpans, ...kSpans, ...dragSpans].sort((a, b) => a.in - b.in);
|
|
1624
1683
|
const dwells = dwellSpans(track, width, height, maxLevel, [
|
|
1625
1684
|
...spans,
|
|
1626
1685
|
...dragReserved
|
|
@@ -2899,6 +2958,8 @@ function envelopeValueAt(env, t) {
|
|
|
2899
2958
|
// src/lower/cursorFollow.ts
|
|
2900
2959
|
var FOLLOW_SAFE_RATIO = ZOOM_STYLES.glide.followSafeRatio;
|
|
2901
2960
|
var FOLLOW_RECENTER = ZOOM_STYLES.glide.followRecenter;
|
|
2961
|
+
var FOLLOW_PATH_STEP = 0.1;
|
|
2962
|
+
var FOLLOW_PATH_SMOOTH = 0.08;
|
|
2902
2963
|
function followFocusEvents(span, cursor, space, layout, options = {}) {
|
|
2903
2964
|
const safeRatio = options.safeRatio ?? FOLLOW_SAFE_RATIO;
|
|
2904
2965
|
const recenter = options.recenter ?? FOLLOW_RECENTER;
|
|
@@ -2921,9 +2982,48 @@ function followFocusEvents(span, cursor, space, layout, options = {}) {
|
|
|
2921
2982
|
let cx = entry.cx;
|
|
2922
2983
|
let cy = entry.cy;
|
|
2923
2984
|
let nextAllowed = span.in + recenter;
|
|
2985
|
+
const drags = dragsFromTrack(cursor, space.w, space.h).filter(
|
|
2986
|
+
(d) => d.t1 > span.in && d.t0 < span.out
|
|
2987
|
+
);
|
|
2988
|
+
const pathEvents = [];
|
|
2989
|
+
for (const d of drags) {
|
|
2990
|
+
const from = Math.max(d.t0, span.in);
|
|
2991
|
+
const to = Math.min(d.t1, span.out);
|
|
2992
|
+
for (let t = from; ; t += FOLLOW_PATH_STEP) {
|
|
2993
|
+
const at = Math.min(t, to);
|
|
2994
|
+
const a = sampleAt2(pts, at - FOLLOW_PATH_SMOOTH);
|
|
2995
|
+
const b = sampleAt2(pts, at);
|
|
2996
|
+
const c = sampleAt2(pts, at + FOLLOW_PATH_SMOOTH);
|
|
2997
|
+
const f = clampFocus(
|
|
2998
|
+
(a.nx + b.nx + c.nx) / 3,
|
|
2999
|
+
(a.ny + b.ny + c.ny) / 3,
|
|
3000
|
+
level,
|
|
3001
|
+
layout,
|
|
3002
|
+
camera
|
|
3003
|
+
);
|
|
3004
|
+
pathEvents.push({
|
|
3005
|
+
t: round2(at),
|
|
3006
|
+
path: true,
|
|
3007
|
+
cx: round2(f.cx),
|
|
3008
|
+
cy: round2(f.cy)
|
|
3009
|
+
});
|
|
3010
|
+
if (at >= to) break;
|
|
3011
|
+
}
|
|
3012
|
+
}
|
|
3013
|
+
let dragIdx = 0;
|
|
2924
3014
|
for (const p of pts) {
|
|
2925
3015
|
if (p.t < span.in) continue;
|
|
2926
3016
|
if (p.t > span.out) break;
|
|
3017
|
+
while (dragIdx < drags.length && p.t > drags[dragIdx].t1) {
|
|
3018
|
+
const last = pathEvents.filter((e) => e.t <= drags[dragIdx].t1).at(-1);
|
|
3019
|
+
if (last) {
|
|
3020
|
+
cx = last.cx;
|
|
3021
|
+
cy = last.cy;
|
|
3022
|
+
}
|
|
3023
|
+
nextAllowed = drags[dragIdx].t1 + recenter;
|
|
3024
|
+
dragIdx++;
|
|
3025
|
+
}
|
|
3026
|
+
if (dragIdx < drags.length && p.t >= drags[dragIdx].t0) continue;
|
|
2927
3027
|
if (p.t < nextAllowed) continue;
|
|
2928
3028
|
if (Math.abs(p.nx - cx) > thrX || Math.abs(p.ny - cy) > thrY) {
|
|
2929
3029
|
const target = lookahead > 0 ? sampleAt2(pts, Math.min(p.t + lookahead, span.out)) : p;
|
|
@@ -2935,7 +3035,8 @@ function followFocusEvents(span, cursor, space, layout, options = {}) {
|
|
|
2935
3035
|
nextAllowed = p.t + recenter;
|
|
2936
3036
|
}
|
|
2937
3037
|
}
|
|
2938
|
-
|
|
3038
|
+
const merged = [...events, ...pathEvents].sort((a, b) => a.t - b.t);
|
|
3039
|
+
return { entry, events: merged };
|
|
2939
3040
|
}
|
|
2940
3041
|
function sampleAt2(pts, t) {
|
|
2941
3042
|
if (t <= pts[0].t) return pts[0];
|
|
@@ -4671,12 +4772,24 @@ function zoomTrackFromDoc(zoom, segments, style = ZOOM_STYLES[DEFAULT_ZOOM_STYLE
|
|
|
4671
4772
|
);
|
|
4672
4773
|
push2(start + style.rampIn * m, entry, spanEase(z.ease, style.ease));
|
|
4673
4774
|
}
|
|
4775
|
+
let inPath = false;
|
|
4674
4776
|
for (const e of z.followEvents ?? []) {
|
|
4675
4777
|
const eOut = sourceToTimeline(segments, e.t);
|
|
4676
4778
|
if (eOut === null || eOut <= tIn || eOut >= tOut) continue;
|
|
4677
4779
|
const next2 = [cur[0], e.cx, e.cy, 1];
|
|
4678
|
-
|
|
4679
|
-
|
|
4780
|
+
if (e.path) {
|
|
4781
|
+
if (!inPath) {
|
|
4782
|
+
push2(Math.max(tIn, eOut - style.followRecenter), cur, "none");
|
|
4783
|
+
push2(eOut, next2, panEase);
|
|
4784
|
+
inPath = true;
|
|
4785
|
+
} else {
|
|
4786
|
+
push2(eOut, next2, "linear");
|
|
4787
|
+
}
|
|
4788
|
+
} else {
|
|
4789
|
+
inPath = false;
|
|
4790
|
+
push2(eOut, cur, "none");
|
|
4791
|
+
push2(Math.min(eOut + style.followRecenter, tOut), next2, panEase);
|
|
4792
|
+
}
|
|
4680
4793
|
cur = next2;
|
|
4681
4794
|
}
|
|
4682
4795
|
push2(tOut, cur, "none");
|
|
@@ -10007,6 +10120,8 @@ export {
|
|
|
10007
10120
|
DIGEST_VERSION,
|
|
10008
10121
|
DOC_SCHEMA_VERSION,
|
|
10009
10122
|
DRAG_FIT_LEVEL,
|
|
10123
|
+
DRAG_MIN_S,
|
|
10124
|
+
DRAG_MIN_TRAVEL_FRAC,
|
|
10010
10125
|
END_CARD_FROM,
|
|
10011
10126
|
END_CARD_RECEDE,
|
|
10012
10127
|
END_CARD_SECONDS,
|
|
@@ -10157,6 +10272,7 @@ export {
|
|
|
10157
10272
|
docToCropSpace,
|
|
10158
10273
|
docToFullSpace,
|
|
10159
10274
|
docTransitions,
|
|
10275
|
+
dragsFromTrack,
|
|
10160
10276
|
dropTemplate,
|
|
10161
10277
|
duckCurve,
|
|
10162
10278
|
effectiveSegments,
|