@vosjs/studio-core 0.2.0 → 0.3.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
@@ -172,6 +172,14 @@ declare function idleGaps(track: readonly CursorEvent[], durationS: number, idle
172
172
  /** Mean activity over [a, b) source seconds exceeds PLAYBACK_ACTIVITY. */
173
173
  declare function isPlayback(activity: readonly number[] | null | undefined, a: number, b: number): boolean;
174
174
 
175
+ /**
176
+ * The studio — shared contracts.
177
+ *
178
+ * These are the seams between the capture extension, the editor, the planner,
179
+ * and the lowering. Branding lives at the app layer;
180
+ * these types are intentionally generic so the core stays extraction-ready.
181
+ */
182
+
175
183
  /** A single input event captured in the page, relative to the recording's t0. */
176
184
  interface CursorEvent {
177
185
  /** ms since t0 (recording start). */
@@ -1311,11 +1319,18 @@ declare const DEFAULT_CURSOR_STYLE: CursorStyle;
1311
1319
  declare const DEFAULT_CAM_STYLE: CamStyle;
1312
1320
  declare const DEFAULT_BROWSER_BAR: BrowserBarStyle;
1313
1321
  /**
1314
- * The frame a NEW take opens on. Once `BACKDROP_DEFAULT_ON`
1315
- * flips (backdrop.ts), the default is the house loop on its own ground;
1316
- * until then the brand gradient. Every ingest path spreads this, so the
1317
- * flip reaches the extension handoff, the in-page recorder, a dropped file
1318
- * and `vos record` at once; a doc that already carries a frame keeps it.
1322
+ * The frame with no backdrop: the card, its chrome and a flat ground. A
1323
+ * host that opens new takes on a backdrop builds its own opening frame
1324
+ * with `withBackdrop` (backdrop.ts) and hands it to `projectFromArtifact`,
1325
+ * so the pick never lives in the document model.
1326
+ */
1327
+ declare const BASE_FRAME_STYLE: FrameStyle;
1328
+ /**
1329
+ * The frame a NEW take opens on when the host names none: the bare frame.
1330
+ * Every ingest path spreads the frame it is handed (or this one), so a
1331
+ * host's pick reaches the extension handoff, the in-page recorder, a
1332
+ * dropped file and `vos record` through one argument; a doc that already
1333
+ * carries a frame keeps it.
1319
1334
  */
1320
1335
  declare const DEFAULT_FRAME_STYLE: FrameStyle;
1321
1336
  /** Border alpha applied when the Frame-border toggle turns on. */
@@ -1462,8 +1477,16 @@ declare function docToFullSpace(d: ProjectDoc): void;
1462
1477
  /** Remap a full-space doc back into crop space (hide the chrome again). */
1463
1478
  declare function docToCropSpace(d: ProjectDoc): void;
1464
1479
 
1480
+ interface IngestOptions {
1481
+ /**
1482
+ * The frame the take opens on: a host's house backdrop on the bare frame,
1483
+ * say (`withBackdrop`). Its browser bar is still derived from the footage
1484
+ * below. Absent, `DEFAULT_FRAME_STYLE`.
1485
+ */
1486
+ frame?: FrameStyle;
1487
+ }
1465
1488
  /** Build a ProjectDoc from a RecordingArtifact handed off by a recorder. */
1466
- declare function projectFromArtifact(artifact: RecordingArtifact, videoUrl: string): {
1489
+ declare function projectFromArtifact(artifact: RecordingArtifact, videoUrl: string, opts?: IngestOptions): {
1467
1490
  doc: ProjectDoc;
1468
1491
  videoUrl: string;
1469
1492
  };
@@ -2963,38 +2986,41 @@ declare function refillAudioBeds(doc: ProjectDoc, prevDuration: number, nextDura
2963
2986
  declare function voiceKey(doc: Pick<ProjectDoc, 'source'> | StudioDoc): string | null;
2964
2987
 
2965
2988
  /**
2966
- * The DEFAULT backdrop: the house loop every NEW take opens on
2967
- * once the flag below is on. A committed constant, not a live vos, the same
2968
- * way Home's door tiles are a deliberate asset push (decided 2026-08-17):
2969
- * changing it is a code change with a review, never something an autosave
2970
- * can re-skin.
2971
- *
2972
- * `ground` is the loop's average colour, written into `frame.background` so
2989
+ * A backdrop is the loop (or still) a frame opens on, together with its
2990
+ * GROUND: the loop's average colour, written into `frame.background` so
2973
2991
  * the frame before the first decoded frame, the reduced-motion still and
2974
- * the offline fail-open all land on the loop's own colour. The
2975
- * keys are the pre-registry bucket objects, which stay in the bucket
2976
- * forever; the registry's `backdrops/{slug}/…` keys replace them when the
2977
- * house loop is featured through the verb.
2992
+ * the offline fail-open all land on the loop's own colour instead of
2993
+ * whatever the frame carried before.
2978
2994
  *
2979
- * BACKDROP_DEFAULT_ON is the flip. It stays OFF until the set has a signed-off
2980
- * seed and the fleet measurement has run: a switch, not a surprise.
2981
- * Docs already carrying a frame are never touched either way.
2995
+ * WHICH backdrop a new take opens on is the host's decision, never this
2996
+ * package's: the studio hands its pick to `projectFromArtifact` as `frame`,
2997
+ * the CLI reads the set the platform publishes. The document model carries
2998
+ * the mechanism only, so the default here is a frame with no backdrop.
2999
+ * A doc that already carries a frame is never touched either way.
2982
3000
  */
2983
3001
 
2984
- declare const DEFAULT_BACKDROP: {
2985
- readonly slug: "soft-beams";
2986
- readonly title: "Soft Beams";
2987
- readonly key: "https://assets.vos.so/backgrounds/soft-beams-1080p.webm";
2988
- readonly key2k: "https://assets.vos.so/backgrounds/soft-beams-2k.webm";
2989
- readonly poster: "https://assets.vos.so/backgrounds/soft-beams-poster.jpg";
2990
- readonly duration: 10;
2991
- readonly ground: "#a7b2d1";
2992
- };
2993
- declare const BACKDROP_DEFAULT_ON: boolean;
2994
- /** The default backdrop as a doc's `frame.backgroundMedia`. */
2995
- declare function defaultBackdropMedia(): BackgroundMedia;
2996
- /** A frame style opening on the default backdrop (media + its ground). */
2997
- declare function withDefaultBackdrop(frame: FrameStyle): FrameStyle;
3002
+ interface Backdrop {
3003
+ /** The loop's URL, or a take-dir path (`/bg.webm`). */
3004
+ key: string;
3005
+ /** `video` unless said otherwise. */
3006
+ kind?: BackgroundMedia['kind'];
3007
+ /** The loop's period in seconds, a fact of the asset. Video only. */
3008
+ duration?: number;
3009
+ /** A still to show before the first decoded frame and under reduced motion. */
3010
+ poster?: string;
3011
+ /**
3012
+ * The loop's average colour. Written as `frame.background` when given; a
3013
+ * backdrop without one keeps the frame's own fill under it.
3014
+ */
3015
+ ground?: string;
3016
+ }
3017
+ /** A backdrop as a doc's `frame.backgroundMedia`. */
3018
+ declare function backdropMedia(backdrop: Backdrop): BackgroundMedia;
3019
+ /**
3020
+ * A frame opening on a backdrop: the media, and its ground when it has one,
3021
+ * in one write. Everything else on the frame is kept.
3022
+ */
3023
+ declare function withBackdrop(frame: FrameStyle, backdrop: Backdrop): FrameStyle;
2998
3024
 
2999
3025
  /**
3000
3026
  * Rejected proposals: the document's way to say "not this one".
@@ -3036,4 +3062,4 @@ declare function rejectSpan(rejected: RejectedSpan[] | undefined, lane: Rejected
3036
3062
  anchor?: StepAnchor;
3037
3063
  }, note?: string): RejectedSpan;
3038
3064
 
3039
- export { ASPECT_RATIOS, AUDIO_PLAN_STEP, type AnchorKind, type AspectRatioOption, type AudioClip, type AudioPlanPoint, type AudioPlanTrack, BACKDROP_DEFAULT_ON, BACKGROUND_Z, type BackgroundMedia, type BakedText3dAsset, type BakedText3dMaterial, type BrowserBarStyle, type BuildDigestInput, CAMERA_FAR, CAMERA_NEAR, CAM_CHAIN_GAP, CAM_EASE, CAM_PAN, CAM_PAN_EASE, CAM_RAMP_IN, CAM_RAMP_OUT, CAM_SIZE_MAX, CAM_SIZE_MIN, CAM_SPAN_MIN, CAPTURE_COVERAGE_MIN, CARD_FOV, CARD_Z, CHANNEL_SPECS_HASH, CHANNEL_SPECS_VERIFIED, CLICK_FX_INTENSITY, CLICK_FX_PRE, CLICK_HIGHLIGHT_FADE, CLICK_PAIR_MAX, CLICK_PULSE_DUR, CLICK_RECT_MAX_FRAC, CLICK_RIPPLE_DUR, CLICK_SYNTH_RELEASE, CROP_MAX_PX, CROP_MIN_FRAC, CROP_MIN_PX, CROP_PAD, CURSOR_IDLE_EPS_FRAC, CURSOR_IDLE_FADE_IN, CURSOR_IDLE_FADE_OUT, CURSOR_IDLE_HOLD, type CamBubbleRect, type CamPoseSpan, type CamStyle, type CaptureNormalization, type CardLayout, type ClickFxStyle, type CursorEvent, type CursorFadeKey, type CursorIdleOptions, type CursorStyle, type CursorTrack, DEFAULT_BACKDROP, DEFAULT_BROWSER_BAR, DEFAULT_CAM_POSE, DEFAULT_CAM_STYLE, DEFAULT_CLICK_FX, DEFAULT_CURSOR_STYLE, DEFAULT_DUCK, DEFAULT_FRAME_STYLE, DEFAULT_SPEED_PARAMS, DEFAULT_TILT_POSE, DEFAULT_ZOOM_LEVEL, DEFAULT_ZOOM_STYLE, DESTINATIONS, DIGEST_CROP_MAX, DIGEST_FULL_MAX, DIGEST_VERSION, DOC_SCHEMA_VERSION, DRAG_FIT_LEVEL, type Destination, type Digest, type DigestImageRef, type DigestPlan, type DigestTakeFacts, type DuckOptions, EXPORT_RESOLUTION_OPTIONS, EXPORT_SHORT_EDGE, type EnvelopePoint, type ExportResolution, type ExtractClickOptions, FOLLOW_RECENTER, FOLLOW_SAFE_RATIO, FRAME_BORDER_COLOR_DEFAULT, FRAME_BORDER_DEFAULT, FRAME_BORDER_WIDTH_DEFAULT, type FocusBounds, type FollowEvent, type FollowOptions, type FrameGeometry, type FrameStyle, type LowerProgramOptions, type LoweredAudioClip, type LoweredClick, type LoweredComposition, type LoweredZoomSpan, MINIMAL_BAR_THEMES, MOTION_DELTA, MOTION_EASE, type MediaOverlayClip, 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, PLAYBACK_ACTIVITY, PROGRAM_RETIME, type PlanOptions, type PlanTiltOptions, type PlaneSize, type ProgramAnchorDoc, type ProgramTweenEdit, type ProjectDoc, type PxRect, REJECT_OVERLAP, type RecordingArtifact, type RecordingMeta, type Rect, type RejectedLane, type RejectedSpan, type ResolvedOverlayBox, type ResolvedOverlayStyle, SCENE_MOTION, SCENE_QUIET, SPEED_RATE_MAX, SPEED_RATE_MIN, SPEED_SPAN_MIN, STUDIO_ENTRY_ID, STYLE_FIELDS, type SmoothOptions, type SmoothPoint, type SpeedParams, type SpeedSpan, type StepAnchor, type StepSpan, type StudioAudioPlan, type StudioDoc, type StudioEntry, type StyleField, TEXT3D_DEPTH_DEFAULT, TEXT3D_DEPTH_MAX, TEXT3D_DEPTH_MIN, TEXT_PRESETS, TILT_AUTO_DEAD_ZONE, TILT_AUTO_MIN, TILT_CHAIN_GAP, TILT_DEG_MAX, TILT_EASE, TILT_INTENSITY_MAX, TILT_PAN, TILT_PAN_EASE, TILT_RAMP_IN, TILT_RAMP_OUT, TILT_SPAN_MIN, TILT_UI_DEG_MAX, TRANSITION_SPEED_MULT, type Text3dMaterial, type TextFxDirection, type TextFxKind, type TextFxSpec, type TextFxUnit, type TextOverlayBox, type TextOverlayClip, type TextOverlayPreset, type TextOverlayStroke, type TiltPersonality, type TiltSpan, type TiltStyleName, type TranscriptSegment, type TransitionSpeed, WINDOW_FOCUS_MIN, ZOOM_CHAIN_GAP, ZOOM_EASE, ZOOM_LEVELS, ZOOM_LEVEL_MAX, ZOOM_LEVEL_MIN, ZOOM_PAN, ZOOM_PAN_EASE, ZOOM_RAMP_IN, ZOOM_RAMP_IN_OVERLAP, ZOOM_RAMP_OUT, ZOOM_SPAN_MIN, ZOOM_STYLES, ZOOM_STYLE_OPTIONS, type ZoomSpan, type ZoomStyleName, type ZoomStyleParams, type ZoomWindow, anchorKindOf, anchorSourceDuration, aspectRatioValue, audioLane, buildDigest, camBubbleRect, camBubbleRectAt, camLane, camMoveLane, camRectFromPose, camRestPose, camTrackFromDoc, cardPointToScreen, clampCamFrac, clampCamSize, clampFocus, clampSpeedRate, clampTiltDeg, clampZoomLevel, clipEnvelope, clipLength, computeCardLayout, computeMicRms, computePeaks, copyStyle, cropBox, cursorIdleFade, defaultBackdropMedia, deriveViewportCrop, destinationById, destinationsForChannel, docCardLayout, docOutputDuration, docToCropSpace, docToFullSpace, duckCurve, effectiveSegments, envelopeAt, envelopeValueAt, expectedFrameSize, exportSizeFor, extractClicks, focusBounds, followFocusEvents, frameGeometry, hexToRgbTriplet, idleGaps, isMusicBed, isPlayback, isProgramDoc, isRecordingDoc, isRejected, levelForFocusFraction, lowerProgramDoc, lowerStudioDoc, lowerToComposition, micLane, migrateHostedDoc, momentsFromDoc, motionTrack, musicBedClip, normalizeCaptureSpace, objectMotionBase, objectMotionPoseAt, objectsLane, outputDurationOf, outputRangeToSource, overlapFraction, overlayFaceFor, overlayFontFaces, overlayFontString, overlayHit, overlayLines, overlayMotionBase, overlayMotionPoseAt, overlayRect, overlaysLane, pageDisplayUrl, parsePoseId, pickStyle, planAutoSpeed, planAutoTilt, planAutoZoom, planForDigest, planeSizeAtDepth, platformBarKind, programDuration, projectFromArtifact, ratedSegments, recommendedExportResolution, refillAudioBeds, rejectSpan, removeSourceRange, removeSpeedInRange, resolveExportSize, resolveOverlayBox, resolveOverlayStyle, resolveText3dAsset, resolveZoomStyle, sceneChanges, scrollRuns, setSpeedInRange, smoothCursor, spanOutputExtent, speedLane, studioAudioPlan, studioEntry, studioLayerData, tiltLane, tiltTrackFromDoc, transitionMult, videoLane, voiceKey, withDefaultBackdrop, withoutRejected, wrapProgramLength, zoomCoversRect, zoomLane, zoomSpanForRange, zoomTrackFromDoc, zoomWindow };
3065
+ export { ASPECT_RATIOS, AUDIO_PLAN_STEP, type AnchorKind, type AspectRatioOption, type AudioClip, type AudioPlanPoint, type AudioPlanTrack, BACKGROUND_Z, BASE_FRAME_STYLE, type Backdrop, type BackgroundMedia, type BakedText3dAsset, type BakedText3dMaterial, type BrowserBarStyle, type BuildDigestInput, CAMERA_FAR, CAMERA_NEAR, CAM_CHAIN_GAP, CAM_EASE, CAM_PAN, CAM_PAN_EASE, CAM_RAMP_IN, CAM_RAMP_OUT, CAM_SIZE_MAX, CAM_SIZE_MIN, CAM_SPAN_MIN, CAPTURE_COVERAGE_MIN, CARD_FOV, CARD_Z, CHANNEL_SPECS_HASH, CHANNEL_SPECS_VERIFIED, CLICK_FX_INTENSITY, CLICK_FX_PRE, CLICK_HIGHLIGHT_FADE, CLICK_PAIR_MAX, CLICK_PULSE_DUR, CLICK_RECT_MAX_FRAC, CLICK_RIPPLE_DUR, CLICK_SYNTH_RELEASE, CROP_MAX_PX, CROP_MIN_FRAC, CROP_MIN_PX, CROP_PAD, CURSOR_IDLE_EPS_FRAC, CURSOR_IDLE_FADE_IN, CURSOR_IDLE_FADE_OUT, CURSOR_IDLE_HOLD, type CamBubbleRect, type CamPoseSpan, type CamStyle, type CaptureNormalization, type CardLayout, type ClickFxStyle, type CursorEvent, type CursorFadeKey, type CursorIdleOptions, type CursorStyle, type CursorTrack, DEFAULT_BROWSER_BAR, DEFAULT_CAM_POSE, DEFAULT_CAM_STYLE, DEFAULT_CLICK_FX, DEFAULT_CURSOR_STYLE, DEFAULT_DUCK, DEFAULT_FRAME_STYLE, DEFAULT_SPEED_PARAMS, DEFAULT_TILT_POSE, DEFAULT_ZOOM_LEVEL, DEFAULT_ZOOM_STYLE, DESTINATIONS, DIGEST_CROP_MAX, DIGEST_FULL_MAX, DIGEST_VERSION, DOC_SCHEMA_VERSION, DRAG_FIT_LEVEL, type Destination, type Digest, type DigestImageRef, type DigestPlan, type DigestTakeFacts, type DuckOptions, EXPORT_RESOLUTION_OPTIONS, EXPORT_SHORT_EDGE, type EnvelopePoint, type ExportResolution, type ExtractClickOptions, FOLLOW_RECENTER, FOLLOW_SAFE_RATIO, FRAME_BORDER_COLOR_DEFAULT, FRAME_BORDER_DEFAULT, FRAME_BORDER_WIDTH_DEFAULT, type FocusBounds, type FollowEvent, type FollowOptions, type FrameGeometry, type FrameStyle, type IngestOptions, type LowerProgramOptions, type LoweredAudioClip, type LoweredClick, type LoweredComposition, type LoweredZoomSpan, MINIMAL_BAR_THEMES, MOTION_DELTA, MOTION_EASE, type MediaOverlayClip, 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, PLAYBACK_ACTIVITY, PROGRAM_RETIME, type PlanOptions, type PlanTiltOptions, type PlaneSize, type ProgramAnchorDoc, type ProgramTweenEdit, type ProjectDoc, type PxRect, REJECT_OVERLAP, type RecordingArtifact, type RecordingMeta, type Rect, type RejectedLane, type RejectedSpan, type ResolvedOverlayBox, type ResolvedOverlayStyle, SCENE_MOTION, SCENE_QUIET, SPEED_RATE_MAX, SPEED_RATE_MIN, SPEED_SPAN_MIN, STUDIO_ENTRY_ID, STYLE_FIELDS, type SmoothOptions, type SmoothPoint, type SpeedParams, type SpeedSpan, type StepAnchor, type StepSpan, type StudioAudioPlan, type StudioDoc, type StudioEntry, type StyleField, TEXT3D_DEPTH_DEFAULT, TEXT3D_DEPTH_MAX, TEXT3D_DEPTH_MIN, TEXT_PRESETS, TILT_AUTO_DEAD_ZONE, TILT_AUTO_MIN, TILT_CHAIN_GAP, TILT_DEG_MAX, TILT_EASE, TILT_INTENSITY_MAX, TILT_PAN, TILT_PAN_EASE, TILT_RAMP_IN, TILT_RAMP_OUT, TILT_SPAN_MIN, TILT_UI_DEG_MAX, TRANSITION_SPEED_MULT, type Text3dMaterial, type TextFxDirection, type TextFxKind, type TextFxSpec, type TextFxUnit, type TextOverlayBox, type TextOverlayClip, type TextOverlayPreset, type TextOverlayStroke, type TiltPersonality, type TiltSpan, type TiltStyleName, type TranscriptSegment, type TransitionSpeed, WINDOW_FOCUS_MIN, ZOOM_CHAIN_GAP, ZOOM_EASE, ZOOM_LEVELS, ZOOM_LEVEL_MAX, ZOOM_LEVEL_MIN, ZOOM_PAN, ZOOM_PAN_EASE, ZOOM_RAMP_IN, ZOOM_RAMP_IN_OVERLAP, ZOOM_RAMP_OUT, ZOOM_SPAN_MIN, ZOOM_STYLES, ZOOM_STYLE_OPTIONS, type ZoomSpan, type ZoomStyleName, type ZoomStyleParams, type ZoomWindow, anchorKindOf, anchorSourceDuration, aspectRatioValue, audioLane, backdropMedia, buildDigest, camBubbleRect, camBubbleRectAt, camLane, camMoveLane, camRectFromPose, camRestPose, camTrackFromDoc, cardPointToScreen, clampCamFrac, clampCamSize, clampFocus, clampSpeedRate, clampTiltDeg, clampZoomLevel, clipEnvelope, clipLength, computeCardLayout, computeMicRms, computePeaks, copyStyle, cropBox, cursorIdleFade, deriveViewportCrop, destinationById, destinationsForChannel, docCardLayout, docOutputDuration, docToCropSpace, docToFullSpace, duckCurve, effectiveSegments, envelopeAt, envelopeValueAt, expectedFrameSize, exportSizeFor, extractClicks, focusBounds, followFocusEvents, frameGeometry, hexToRgbTriplet, idleGaps, isMusicBed, isPlayback, isProgramDoc, isRecordingDoc, isRejected, levelForFocusFraction, lowerProgramDoc, lowerStudioDoc, lowerToComposition, micLane, migrateHostedDoc, momentsFromDoc, motionTrack, musicBedClip, normalizeCaptureSpace, objectMotionBase, objectMotionPoseAt, objectsLane, outputDurationOf, outputRangeToSource, overlapFraction, overlayFaceFor, overlayFontFaces, overlayFontString, overlayHit, overlayLines, overlayMotionBase, overlayMotionPoseAt, overlayRect, overlaysLane, pageDisplayUrl, parsePoseId, pickStyle, planAutoSpeed, planAutoTilt, planAutoZoom, planForDigest, planeSizeAtDepth, platformBarKind, programDuration, projectFromArtifact, ratedSegments, recommendedExportResolution, refillAudioBeds, rejectSpan, removeSourceRange, removeSpeedInRange, resolveExportSize, resolveOverlayBox, resolveOverlayStyle, resolveText3dAsset, resolveZoomStyle, sceneChanges, scrollRuns, setSpeedInRange, smoothCursor, spanOutputExtent, speedLane, studioAudioPlan, studioEntry, studioLayerData, tiltLane, tiltTrackFromDoc, transitionMult, videoLane, voiceKey, withBackdrop, withoutRejected, wrapProgramLength, zoomCoversRect, zoomLane, zoomSpanForRange, zoomTrackFromDoc, zoomWindow };
package/dist/index.js CHANGED
@@ -1,31 +1,3 @@
1
- // src/backdrop.ts
2
- var DEFAULT_BACKDROP = {
3
- slug: "soft-beams",
4
- title: "Soft Beams",
5
- key: "https://assets.vos.so/backgrounds/soft-beams-1080p.webm",
6
- key2k: "https://assets.vos.so/backgrounds/soft-beams-2k.webm",
7
- poster: "https://assets.vos.so/backgrounds/soft-beams-poster.jpg",
8
- duration: 10,
9
- ground: "#a7b2d1"
10
- };
11
- var BACKDROP_DEFAULT_ON = false;
12
- function defaultBackdropMedia() {
13
- return {
14
- kind: "video",
15
- key: DEFAULT_BACKDROP.key,
16
- duration: DEFAULT_BACKDROP.duration,
17
- poster: DEFAULT_BACKDROP.poster,
18
- dim: 0
19
- };
20
- }
21
- function withDefaultBackdrop(frame) {
22
- return {
23
- ...frame,
24
- background: DEFAULT_BACKDROP.ground,
25
- backgroundMedia: defaultBackdropMedia()
26
- };
27
- }
28
-
29
1
  // src/types.ts
30
2
  var TRANSITION_SPEED_MULT = {
31
3
  instant: 0,
@@ -177,7 +149,7 @@ var BASE_FRAME_STYLE = {
177
149
  aspectRatio: "native",
178
150
  browserBar: DEFAULT_BROWSER_BAR
179
151
  };
180
- var DEFAULT_FRAME_STYLE = BACKDROP_DEFAULT_ON ? withDefaultBackdrop(BASE_FRAME_STYLE) : BASE_FRAME_STYLE;
152
+ var DEFAULT_FRAME_STYLE = BASE_FRAME_STYLE;
181
153
  var FRAME_BORDER_DEFAULT = 0.35;
182
154
  var FRAME_BORDER_WIDTH_DEFAULT = 1.5;
183
155
  var FRAME_BORDER_COLOR_DEFAULT = "#ffffff";
@@ -392,7 +364,8 @@ function median(values) {
392
364
  }
393
365
 
394
366
  // src/ingest.ts
395
- function projectFromArtifact(artifact, videoUrl) {
367
+ function projectFromArtifact(artifact, videoUrl, opts = {}) {
368
+ const baseFrame = opts.frame ?? DEFAULT_FRAME_STYLE;
396
369
  const surface = artifact.meta.captureSurface ?? "tab";
397
370
  const norm = normalizeCaptureSpace(artifact.cursor, artifact.meta);
398
371
  const { cursor, meta } = norm;
@@ -434,9 +407,9 @@ function projectFromArtifact(artifact, videoUrl) {
434
407
  cursor: { ...DEFAULT_CURSOR_STYLE },
435
408
  cam: { ...DEFAULT_CAM_STYLE },
436
409
  frame: {
437
- ...DEFAULT_FRAME_STYLE,
410
+ ...baseFrame,
438
411
  browserBar: {
439
- ...DEFAULT_FRAME_STYLE.browserBar,
412
+ ...baseFrame.browserBar,
440
413
  // Chrome-free footage (tab takes, cropped window takes) opens with the
441
414
  // OS-matched realistic frame — the Screen-Studio first render; Hidden is
442
415
  // one click away. Footage that still contains real chrome gets none.
@@ -6778,6 +6751,24 @@ function duckCurve(rms, segments, durationSec2, opts = DEFAULT_DUCK) {
6778
6751
  return points;
6779
6752
  }
6780
6753
 
6754
+ // src/backdrop.ts
6755
+ function backdropMedia(backdrop) {
6756
+ return {
6757
+ kind: backdrop.kind ?? "video",
6758
+ key: backdrop.key,
6759
+ ...backdrop.duration !== void 0 ? { duration: backdrop.duration } : {},
6760
+ ...backdrop.poster ? { poster: backdrop.poster } : {},
6761
+ dim: 0
6762
+ };
6763
+ }
6764
+ function withBackdrop(frame, backdrop) {
6765
+ return {
6766
+ ...frame,
6767
+ ...backdrop.ground ? { background: backdrop.ground } : {},
6768
+ backgroundMedia: backdropMedia(backdrop)
6769
+ };
6770
+ }
6771
+
6781
6772
  // src/rejected.ts
6782
6773
  var REJECT_OVERLAP = 0.5;
6783
6774
  function overlapFraction(a, b) {
@@ -6813,8 +6804,8 @@ function rejectSpan(rejected, lane, span, note) {
6813
6804
  export {
6814
6805
  ASPECT_RATIOS,
6815
6806
  AUDIO_PLAN_STEP,
6816
- BACKDROP_DEFAULT_ON,
6817
6807
  BACKGROUND_Z,
6808
+ BASE_FRAME_STYLE,
6818
6809
  CAMERA_FAR,
6819
6810
  CAMERA_NEAR,
6820
6811
  CAM_CHAIN_GAP,
@@ -6847,7 +6838,6 @@ export {
6847
6838
  CURSOR_IDLE_FADE_IN,
6848
6839
  CURSOR_IDLE_FADE_OUT,
6849
6840
  CURSOR_IDLE_HOLD,
6850
- DEFAULT_BACKDROP,
6851
6841
  DEFAULT_BROWSER_BAR,
6852
6842
  DEFAULT_CAM_POSE,
6853
6843
  DEFAULT_CAM_STYLE,
@@ -6931,6 +6921,7 @@ export {
6931
6921
  anchorSourceDuration,
6932
6922
  aspectRatioValue,
6933
6923
  audioLane,
6924
+ backdropMedia,
6934
6925
  buildDigest,
6935
6926
  camBubbleRect,
6936
6927
  camBubbleRectAt,
@@ -6954,7 +6945,6 @@ export {
6954
6945
  copyStyle,
6955
6946
  cropBox,
6956
6947
  cursorIdleFade,
6957
- defaultBackdropMedia,
6958
6948
  deriveViewportCrop,
6959
6949
  destinationById,
6960
6950
  destinationsForChannel,
@@ -7040,7 +7030,7 @@ export {
7040
7030
  transitionMult,
7041
7031
  videoLane,
7042
7032
  voiceKey,
7043
- withDefaultBackdrop,
7033
+ withBackdrop,
7044
7034
  withoutRejected,
7045
7035
  wrapProgramLength,
7046
7036
  zoomCoversRect,