@vosjs/studio-core 0.22.1 → 0.23.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 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,
@@ -1188,6 +1189,7 @@ var ZOOM_STYLES = {
1188
1189
  targetFill: 0.5,
1189
1190
  minLevel: 1.5,
1190
1191
  maxLevel: 2.2,
1192
+ dragLevel: 1.7,
1191
1193
  lead: 0.35,
1192
1194
  hold: 1,
1193
1195
  followByDefault: false,
@@ -1215,6 +1217,7 @@ var ZOOM_STYLES = {
1215
1217
  targetFill: 0.45,
1216
1218
  minLevel: 1.35,
1217
1219
  maxLevel: 2,
1220
+ dragLevel: 1.5,
1218
1221
  lead: 0.6,
1219
1222
  hold: 1.4,
1220
1223
  followByDefault: true,
@@ -1242,6 +1245,7 @@ var ZOOM_STYLES = {
1242
1245
  targetFill: 0.5,
1243
1246
  minLevel: 1.4,
1244
1247
  maxLevel: 2.5,
1248
+ dragLevel: 1.7,
1245
1249
  lead: 0.25,
1246
1250
  hold: 1,
1247
1251
  followByDefault: false,
@@ -1269,6 +1273,7 @@ var ZOOM_STYLES = {
1269
1273
  targetFill: 0.5,
1270
1274
  minLevel: 1.5,
1271
1275
  maxLevel: 2.2,
1276
+ dragLevel: 1.7,
1272
1277
  lead: 0.2,
1273
1278
  hold: 1,
1274
1279
  followByDefault: false,
@@ -1297,6 +1302,7 @@ var ZOOM_STYLES = {
1297
1302
  targetFill: 0.42,
1298
1303
  minLevel: 1.3,
1299
1304
  maxLevel: 1.8,
1305
+ dragLevel: 1.5,
1300
1306
  lead: 0.5,
1301
1307
  hold: 0.6,
1302
1308
  followByDefault: false,
@@ -1334,6 +1340,7 @@ var ZOOM_STYLES = {
1334
1340
  targetFill: 0.42,
1335
1341
  minLevel: 1.3,
1336
1342
  maxLevel: 1.8,
1343
+ dragLevel: 1.5,
1337
1344
  lead: 0.5,
1338
1345
  hold: 0.7,
1339
1346
  followByDefault: true,
@@ -1371,6 +1378,7 @@ var ZOOM_STYLES = {
1371
1378
  targetFill: 0.45,
1372
1379
  minLevel: 1.35,
1373
1380
  maxLevel: 2,
1381
+ dragLevel: 1.5,
1374
1382
  lead: 0.6,
1375
1383
  hold: 1.4,
1376
1384
  followByDefault: true,
@@ -1441,6 +1449,37 @@ var DWELL_SPACING = 1.8;
1441
1449
  var DRAG_FIT_LEVEL = 1.15;
1442
1450
  var PRESS_ECHO_MS = 4;
1443
1451
  var PRESS_ECHO_PX = 2;
1452
+ var DRAG_MIN_TRAVEL_FRAC = 0.015;
1453
+ var DRAG_MIN_S = 0.2;
1454
+ function dragsFromTrack(track, width, height) {
1455
+ if (!(width > 0) || !(height > 0)) return [];
1456
+ const downs = dedupePresses(track.filter((e) => e.type === "down"));
1457
+ const out = [];
1458
+ for (const d of downs) {
1459
+ const up = track.find((e) => e.type === "up" && e.t > d.t);
1460
+ if (!up) continue;
1461
+ const t0 = d.t / 1e3;
1462
+ const t1 = up.t / 1e3;
1463
+ if (t1 - t0 < DRAG_MIN_S) continue;
1464
+ let travel = 0;
1465
+ for (const e of track) {
1466
+ if (e.t < d.t) continue;
1467
+ if (e.t > up.t) break;
1468
+ if (e.type !== "move" && e.type !== "up") continue;
1469
+ const dist = Math.hypot(e.x - d.x, e.y - d.y) / width;
1470
+ if (dist > travel) travel = dist;
1471
+ }
1472
+ if (travel < DRAG_MIN_TRAVEL_FRAC) continue;
1473
+ out.push({
1474
+ t0,
1475
+ t1,
1476
+ nx: clamp012(d.x / width),
1477
+ ny: clamp012(d.y / height),
1478
+ travel
1479
+ });
1480
+ }
1481
+ return out;
1482
+ }
1444
1483
  var TYPING_MIN_PINGS = 2;
1445
1484
  var TYPING_MIN_DUR = 0.5;
1446
1485
  var TYPING_CLICK_ABSORB = 1.5;
@@ -1518,13 +1557,14 @@ function planAutoZoom(track, options) {
1518
1557
  lead = style.lead,
1519
1558
  hold = style.hold,
1520
1559
  minClusterClicks = style.minClusterClicks,
1560
+ dragLevel = style.dragLevel,
1521
1561
  followByDefault = style.followByDefault,
1522
1562
  typingZoom = style.typingZoom,
1523
1563
  typingGap = style.typingGap,
1524
1564
  typingHold = style.typingHold,
1525
1565
  typingMinLevel = style.typingMinLevel
1526
1566
  } = options;
1527
- const { sessions, clusters, surfaces } = groupTrack(track, {
1567
+ const grouped = groupTrack(track, {
1528
1568
  width,
1529
1569
  height,
1530
1570
  clusterGap,
@@ -1532,6 +1572,22 @@ function planAutoZoom(track, options) {
1532
1572
  typingZoom,
1533
1573
  targetFill
1534
1574
  });
1575
+ const { sessions } = grouped;
1576
+ const drags = dragsFromTrack(track, width, height);
1577
+ const dragPress = new Set(drags.map((d) => round(d.t0)));
1578
+ const withoutDrags = (list) => list.map((cl) => cl.filter((c) => !dragPress.has(round(c.t)))).filter((cl) => cl.length > 0);
1579
+ const clusters = withoutDrags(grouped.clusters);
1580
+ const surfaces = withoutDrags(grouped.surfaces);
1581
+ const dragSpans = drags.map((d, i) => ({
1582
+ id: `g${i}`,
1583
+ in: round(Math.max(0, d.t0 - lead)),
1584
+ out: round(d.t1 + hold),
1585
+ level: clampZoomLevel(Math.min(Math.max(dragLevel, 1.1), maxLevel)),
1586
+ cx: round(d.nx),
1587
+ cy: round(d.ny),
1588
+ focusMode: "auto",
1589
+ source: "auto"
1590
+ }));
1535
1591
  const eligible = clusters.filter((c) => c.length >= minClusterClicks);
1536
1592
  const clickSpans = [];
1537
1593
  const dragReserved = surfaces.map((cluster, i) => {
@@ -1620,7 +1676,7 @@ function planAutoZoom(track, options) {
1620
1676
  // the FIELD is the anchor, and a follow would be a no-op at best.
1621
1677
  source: "auto"
1622
1678
  }));
1623
- const spans = [...zSpans, ...kSpans].sort((a, b) => a.in - b.in);
1679
+ const spans = [...zSpans, ...kSpans, ...dragSpans].sort((a, b) => a.in - b.in);
1624
1680
  const dwells = dwellSpans(track, width, height, maxLevel, [
1625
1681
  ...spans,
1626
1682
  ...dragReserved
@@ -2899,6 +2955,8 @@ function envelopeValueAt(env, t) {
2899
2955
  // src/lower/cursorFollow.ts
2900
2956
  var FOLLOW_SAFE_RATIO = ZOOM_STYLES.glide.followSafeRatio;
2901
2957
  var FOLLOW_RECENTER = ZOOM_STYLES.glide.followRecenter;
2958
+ var FOLLOW_PATH_STEP = 0.1;
2959
+ var FOLLOW_PATH_SMOOTH = 0.08;
2902
2960
  function followFocusEvents(span, cursor, space, layout, options = {}) {
2903
2961
  const safeRatio = options.safeRatio ?? FOLLOW_SAFE_RATIO;
2904
2962
  const recenter = options.recenter ?? FOLLOW_RECENTER;
@@ -2921,9 +2979,48 @@ function followFocusEvents(span, cursor, space, layout, options = {}) {
2921
2979
  let cx = entry.cx;
2922
2980
  let cy = entry.cy;
2923
2981
  let nextAllowed = span.in + recenter;
2982
+ const drags = dragsFromTrack(cursor, space.w, space.h).filter(
2983
+ (d) => d.t1 > span.in && d.t0 < span.out
2984
+ );
2985
+ const pathEvents = [];
2986
+ for (const d of drags) {
2987
+ const from = Math.max(d.t0, span.in);
2988
+ const to = Math.min(d.t1, span.out);
2989
+ for (let t = from; ; t += FOLLOW_PATH_STEP) {
2990
+ const at = Math.min(t, to);
2991
+ const a = sampleAt2(pts, at - FOLLOW_PATH_SMOOTH);
2992
+ const b = sampleAt2(pts, at);
2993
+ const c = sampleAt2(pts, at + FOLLOW_PATH_SMOOTH);
2994
+ const f = clampFocus(
2995
+ (a.nx + b.nx + c.nx) / 3,
2996
+ (a.ny + b.ny + c.ny) / 3,
2997
+ level,
2998
+ layout,
2999
+ camera
3000
+ );
3001
+ pathEvents.push({
3002
+ t: round2(at),
3003
+ path: true,
3004
+ cx: round2(f.cx),
3005
+ cy: round2(f.cy)
3006
+ });
3007
+ if (at >= to) break;
3008
+ }
3009
+ }
3010
+ let dragIdx = 0;
2924
3011
  for (const p of pts) {
2925
3012
  if (p.t < span.in) continue;
2926
3013
  if (p.t > span.out) break;
3014
+ while (dragIdx < drags.length && p.t > drags[dragIdx].t1) {
3015
+ const last = pathEvents.filter((e) => e.t <= drags[dragIdx].t1).at(-1);
3016
+ if (last) {
3017
+ cx = last.cx;
3018
+ cy = last.cy;
3019
+ }
3020
+ nextAllowed = drags[dragIdx].t1 + recenter;
3021
+ dragIdx++;
3022
+ }
3023
+ if (dragIdx < drags.length && p.t >= drags[dragIdx].t0) continue;
2927
3024
  if (p.t < nextAllowed) continue;
2928
3025
  if (Math.abs(p.nx - cx) > thrX || Math.abs(p.ny - cy) > thrY) {
2929
3026
  const target = lookahead > 0 ? sampleAt2(pts, Math.min(p.t + lookahead, span.out)) : p;
@@ -2935,7 +3032,8 @@ function followFocusEvents(span, cursor, space, layout, options = {}) {
2935
3032
  nextAllowed = p.t + recenter;
2936
3033
  }
2937
3034
  }
2938
- return { entry, events };
3035
+ const merged = [...events, ...pathEvents].sort((a, b) => a.t - b.t);
3036
+ return { entry, events: merged };
2939
3037
  }
2940
3038
  function sampleAt2(pts, t) {
2941
3039
  if (t <= pts[0].t) return pts[0];
@@ -4671,12 +4769,24 @@ function zoomTrackFromDoc(zoom, segments, style = ZOOM_STYLES[DEFAULT_ZOOM_STYLE
4671
4769
  );
4672
4770
  push2(start + style.rampIn * m, entry, spanEase(z.ease, style.ease));
4673
4771
  }
4772
+ let inPath = false;
4674
4773
  for (const e of z.followEvents ?? []) {
4675
4774
  const eOut = sourceToTimeline(segments, e.t);
4676
4775
  if (eOut === null || eOut <= tIn || eOut >= tOut) continue;
4677
4776
  const next2 = [cur[0], e.cx, e.cy, 1];
4678
- push2(eOut, cur, "none");
4679
- push2(Math.min(eOut + style.followRecenter, tOut), next2, panEase);
4777
+ if (e.path) {
4778
+ if (!inPath) {
4779
+ push2(Math.max(tIn, eOut - style.followRecenter), cur, "none");
4780
+ push2(eOut, next2, panEase);
4781
+ inPath = true;
4782
+ } else {
4783
+ push2(eOut, next2, "linear");
4784
+ }
4785
+ } else {
4786
+ inPath = false;
4787
+ push2(eOut, cur, "none");
4788
+ push2(Math.min(eOut + style.followRecenter, tOut), next2, panEase);
4789
+ }
4680
4790
  cur = next2;
4681
4791
  }
4682
4792
  push2(tOut, cur, "none");
@@ -10007,6 +10117,8 @@ export {
10007
10117
  DIGEST_VERSION,
10008
10118
  DOC_SCHEMA_VERSION,
10009
10119
  DRAG_FIT_LEVEL,
10120
+ DRAG_MIN_S,
10121
+ DRAG_MIN_TRAVEL_FRAC,
10010
10122
  END_CARD_FROM,
10011
10123
  END_CARD_RECEDE,
10012
10124
  END_CARD_SECONDS,
@@ -10157,6 +10269,7 @@ export {
10157
10269
  docToCropSpace,
10158
10270
  docToFullSpace,
10159
10271
  docTransitions,
10272
+ dragsFromTrack,
10160
10273
  dropTemplate,
10161
10274
  duckCurve,
10162
10275
  effectiveSegments,