@aranova/tracking-react 1.18.0 → 1.19.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/{bookings-CCGpXhYE.d.ts → bookings-BDLyF70h.d.ts} +23 -1
- package/dist/{bookings-CVvpj_8K.d.mts → bookings-v3HA8gsC.d.mts} +23 -1
- package/dist/client.d.mts +121 -4
- package/dist/client.d.ts +121 -4
- package/dist/client.js +1680 -30
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +1682 -30
- package/dist/client.mjs.map +1 -1
- package/dist/index.d.mts +15 -39
- package/dist/index.d.ts +15 -39
- package/dist/index.js +174 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +172 -6
- package/dist/index.mjs.map +1 -1
- package/dist/{ingest-typed-CoCjTqJs.d.mts → ingest-typed-BEFQd3WM.d.mts} +200 -2
- package/dist/{ingest-typed-C3XAjHlH.d.ts → ingest-typed-DChvvgwd.d.ts} +200 -2
- package/dist/{sales-Dlc_umAV.d.ts → sales-Cu8M8I8k.d.ts} +1 -1
- package/dist/{sales-B1ONR-Yi.d.mts → sales-DriCnCbM.d.mts} +1 -1
- package/dist/sales.d.mts +2 -2
- package/dist/sales.d.ts +2 -2
- package/dist/sales.js +111 -5
- package/dist/sales.js.map +1 -1
- package/dist/sales.mjs +111 -5
- package/dist/sales.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -14,6 +14,22 @@ interface ConfigTriggerSpec {
|
|
|
14
14
|
threshold_seconds?: number;
|
|
15
15
|
page_threshold?: number;
|
|
16
16
|
page_name?: string;
|
|
17
|
+
metric?: "percent" | "seconds";
|
|
18
|
+
threshold?: number;
|
|
19
|
+
video_id?: string | null;
|
|
20
|
+
}
|
|
21
|
+
interface TrackedVideoSourcesConfig {
|
|
22
|
+
desktop: string;
|
|
23
|
+
mobile?: string | null;
|
|
24
|
+
}
|
|
25
|
+
interface TrackedVideoConfig {
|
|
26
|
+
key: string;
|
|
27
|
+
title: string;
|
|
28
|
+
host: string;
|
|
29
|
+
sources: TrackedVideoSourcesConfig;
|
|
30
|
+
poster_time?: number;
|
|
31
|
+
poster_time_s?: number;
|
|
32
|
+
duration_s?: number | null;
|
|
17
33
|
}
|
|
18
34
|
/** One unified conversion goal: a revenue `sale` or an on-page `event`. */
|
|
19
35
|
interface ConversionGoal {
|
|
@@ -47,6 +63,8 @@ interface ConversionConfig {
|
|
|
47
63
|
integrations?: ConversionIntegrations;
|
|
48
64
|
/** The lead-form contract (ADR-0024); null from an API that predates it. */
|
|
49
65
|
lead_forms?: LeadFormsConfig | null;
|
|
66
|
+
/** Cloudflare Stream tracked videos configured for this site (ADR-0042). */
|
|
67
|
+
videos?: Record<string, TrackedVideoConfig>;
|
|
50
68
|
}
|
|
51
69
|
interface LeadFormsConfig {
|
|
52
70
|
/** The registry version the object was published under. */
|
|
@@ -305,6 +323,10 @@ declare class TrackingConfigRuntime {
|
|
|
305
323
|
integrations(): ConversionIntegrations | null;
|
|
306
324
|
/** The lead-form contracts, from the cached object like `integrations()`. */
|
|
307
325
|
leadForms(): LeadFormsConfig | null;
|
|
326
|
+
/** Configured Cloudflare Stream tracked videos for this site. */
|
|
327
|
+
videos(): Record<string, TrackedVideoConfig>;
|
|
328
|
+
/** Look up one configured Cloudflare Stream tracked video by key. */
|
|
329
|
+
getVideo(key: string): TrackedVideoConfig | null;
|
|
308
330
|
private revalidateNow;
|
|
309
331
|
private expireAuthority;
|
|
310
332
|
private confirm;
|
|
@@ -795,4 +817,4 @@ interface SalesBookingsClient {
|
|
|
795
817
|
/** A fresh per-submit key. Keep it for retries of the same submit; mint a new one after. */
|
|
796
818
|
declare const newBookingAttemptKey: typeof uuidV4;
|
|
797
819
|
|
|
798
|
-
export {
|
|
820
|
+
export { resolveTrackingConfigUrl as $, type LeadFormDetailsResult as A, type BookableDay as B, type ConversionConfig as C, type LeadFormExtraField as D, type LeadFormFields as E, type FormSubmitField as F, type LeadFormKindDecl as G, type LeadFormRequirementDecl as H, type LeadFormSubmission as I, type LeadFormSubmitInput as J, type LeadFormSubmitOptions as K, type LeadFormAddress as L, type LeadFormSubmitter as M, type LeadFormTimeWindow as N, type LeadFormTracking as O, type LeadFormValue as P, type TrackedVideoSourcesConfig as Q, type TrackingConfigReference as R, type SalesBookingsClient as S, type TrackedVideoConfig as T, bookableSlots as U, buildBookingHandoffUrl as V, getBookingIntegration as W, getTrackingConfigRuntime as X, groupBookingOptions as Y, newBookingAttemptKey as Z, resolveConversionConfig as _, type BookingDetailsFailure as a, shopToday as a0, slotFields as a1, timeWindow as a2, createLeadFormSubmit as a3, TrackingConfigRuntime as a4, type BookingDetailsInput as b, type BookingDetailsOptions as c, type BookingDetailsOutcome as d, type BookingDetailsStatus as e, type BookingDropOff as f, type BookingFormSubmit as g, type BookingHandoffPrefill as h, type BookingInput as i, type BookingInputFor as j, type BookingIntegration as k, type BookingMode as l, type BookingOption as m, type BookingOptionGroup as n, type BookingOptionKey as o, type BookingOutcome as p, type BookingProvider as q, type BookingRules as r, type BookingServiceKey as s, type BookingSimulation as t, type BookingSubmitOptions as u, type BookingVehicle as v, type ConversionConfigStore as w, type LeadFormContracts as x, type LeadFormDetailsFields as y, type LeadFormDetailsInput as z };
|
|
@@ -14,6 +14,22 @@ interface ConfigTriggerSpec {
|
|
|
14
14
|
threshold_seconds?: number;
|
|
15
15
|
page_threshold?: number;
|
|
16
16
|
page_name?: string;
|
|
17
|
+
metric?: "percent" | "seconds";
|
|
18
|
+
threshold?: number;
|
|
19
|
+
video_id?: string | null;
|
|
20
|
+
}
|
|
21
|
+
interface TrackedVideoSourcesConfig {
|
|
22
|
+
desktop: string;
|
|
23
|
+
mobile?: string | null;
|
|
24
|
+
}
|
|
25
|
+
interface TrackedVideoConfig {
|
|
26
|
+
key: string;
|
|
27
|
+
title: string;
|
|
28
|
+
host: string;
|
|
29
|
+
sources: TrackedVideoSourcesConfig;
|
|
30
|
+
poster_time?: number;
|
|
31
|
+
poster_time_s?: number;
|
|
32
|
+
duration_s?: number | null;
|
|
17
33
|
}
|
|
18
34
|
/** One unified conversion goal: a revenue `sale` or an on-page `event`. */
|
|
19
35
|
interface ConversionGoal {
|
|
@@ -47,6 +63,8 @@ interface ConversionConfig {
|
|
|
47
63
|
integrations?: ConversionIntegrations;
|
|
48
64
|
/** The lead-form contract (ADR-0024); null from an API that predates it. */
|
|
49
65
|
lead_forms?: LeadFormsConfig | null;
|
|
66
|
+
/** Cloudflare Stream tracked videos configured for this site (ADR-0042). */
|
|
67
|
+
videos?: Record<string, TrackedVideoConfig>;
|
|
50
68
|
}
|
|
51
69
|
interface LeadFormsConfig {
|
|
52
70
|
/** The registry version the object was published under. */
|
|
@@ -305,6 +323,10 @@ declare class TrackingConfigRuntime {
|
|
|
305
323
|
integrations(): ConversionIntegrations | null;
|
|
306
324
|
/** The lead-form contracts, from the cached object like `integrations()`. */
|
|
307
325
|
leadForms(): LeadFormsConfig | null;
|
|
326
|
+
/** Configured Cloudflare Stream tracked videos for this site. */
|
|
327
|
+
videos(): Record<string, TrackedVideoConfig>;
|
|
328
|
+
/** Look up one configured Cloudflare Stream tracked video by key. */
|
|
329
|
+
getVideo(key: string): TrackedVideoConfig | null;
|
|
308
330
|
private revalidateNow;
|
|
309
331
|
private expireAuthority;
|
|
310
332
|
private confirm;
|
|
@@ -795,4 +817,4 @@ interface SalesBookingsClient {
|
|
|
795
817
|
/** A fresh per-submit key. Keep it for retries of the same submit; mint a new one after. */
|
|
796
818
|
declare const newBookingAttemptKey: typeof uuidV4;
|
|
797
819
|
|
|
798
|
-
export {
|
|
820
|
+
export { resolveTrackingConfigUrl as $, type LeadFormDetailsResult as A, type BookableDay as B, type ConversionConfig as C, type LeadFormExtraField as D, type LeadFormFields as E, type FormSubmitField as F, type LeadFormKindDecl as G, type LeadFormRequirementDecl as H, type LeadFormSubmission as I, type LeadFormSubmitInput as J, type LeadFormSubmitOptions as K, type LeadFormAddress as L, type LeadFormSubmitter as M, type LeadFormTimeWindow as N, type LeadFormTracking as O, type LeadFormValue as P, type TrackedVideoSourcesConfig as Q, type TrackingConfigReference as R, type SalesBookingsClient as S, type TrackedVideoConfig as T, bookableSlots as U, buildBookingHandoffUrl as V, getBookingIntegration as W, getTrackingConfigRuntime as X, groupBookingOptions as Y, newBookingAttemptKey as Z, resolveConversionConfig as _, type BookingDetailsFailure as a, shopToday as a0, slotFields as a1, timeWindow as a2, createLeadFormSubmit as a3, TrackingConfigRuntime as a4, type BookingDetailsInput as b, type BookingDetailsOptions as c, type BookingDetailsOutcome as d, type BookingDetailsStatus as e, type BookingDropOff as f, type BookingFormSubmit as g, type BookingHandoffPrefill as h, type BookingInput as i, type BookingInputFor as j, type BookingIntegration as k, type BookingMode as l, type BookingOption as m, type BookingOptionGroup as n, type BookingOptionKey as o, type BookingOutcome as p, type BookingProvider as q, type BookingRules as r, type BookingServiceKey as s, type BookingSimulation as t, type BookingSubmitOptions as u, type BookingVehicle as v, type ConversionConfigStore as w, type LeadFormContracts as x, type LeadFormDetailsFields as y, type LeadFormDetailsInput as z };
|
package/dist/client.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, CSSProperties, InputHTMLAttributes, ChangeEvent, FocusEvent, AnchorHTMLAttributes } from 'react';
|
|
3
3
|
import { G as GtagEnvironmentMap, M as MetaPixelEnvironmentMap, h as ConsentState, f as ConsentChoiceState, g as ConsentSource, T as TrackingParams, b as TrackingEnvironment, u as PhoneConfig, P as ParsedPhone, v as PhoneDisplayFormat } from './phone-utils-BlWj8oxq.mjs';
|
|
4
|
-
import {
|
|
5
|
-
export {
|
|
6
|
-
import {
|
|
4
|
+
import { R as TrackingConfigReference, C as ConversionConfig, h as BookingHandoffPrefill, i as BookingInput, p as BookingOutcome, b as BookingDetailsInput, d as BookingDetailsOutcome, k as BookingIntegration, B as BookableDay, x as LeadFormContracts, S as SalesBookingsClient, g as BookingFormSubmit, t as BookingSimulation, j as BookingInputFor, T as TrackedVideoConfig } from './bookings-v3HA8gsC.mjs';
|
|
5
|
+
export { a3 as createLeadFormSubmit } from './bookings-v3HA8gsC.mjs';
|
|
6
|
+
import { Q as TriggerRegistryConfig, V as TypedTrackingClient, $ as VideoVariant, a0 as VideoWatchRange, O as TrackingClient } from './ingest-typed-BEFQd3WM.mjs';
|
|
7
7
|
import { CountryCode } from 'libphonenumber-js';
|
|
8
8
|
import 'zod/mini';
|
|
9
9
|
import 'zod/v4/core';
|
|
@@ -439,4 +439,121 @@ declare function useBookingSubmit<C extends LeadFormContracts | undefined = unde
|
|
|
439
439
|
contracts?: C;
|
|
440
440
|
}): BookingSubmitState<C extends LeadFormContracts ? BookingInputFor<C> : BookingInput>;
|
|
441
441
|
|
|
442
|
-
|
|
442
|
+
/** A rendition height in pixels (e.g. 720, 1080), or "auto" for adaptive bitrate. */
|
|
443
|
+
type VideoQuality = number | "auto";
|
|
444
|
+
interface TrackedVideoEvent {
|
|
445
|
+
/** Logical video key, e.g. "qlt-case-study-v6". */
|
|
446
|
+
id: string;
|
|
447
|
+
/** Variant-qualified DOM id, e.g. "qlt-case-study-v6-16x9". */
|
|
448
|
+
videoId: string;
|
|
449
|
+
variant: VideoVariant;
|
|
450
|
+
currentTime: number;
|
|
451
|
+
duration: number;
|
|
452
|
+
watchedSeconds: number;
|
|
453
|
+
watchedPercent: number;
|
|
454
|
+
maxPercent: number;
|
|
455
|
+
ranges: VideoWatchRange[];
|
|
456
|
+
}
|
|
457
|
+
interface TrackedVideoCallbacks {
|
|
458
|
+
onPlay?: (e: TrackedVideoEvent) => void;
|
|
459
|
+
onPause?: (e: TrackedVideoEvent) => void;
|
|
460
|
+
/** A finished seek: where playback was and where it landed, in seconds. */
|
|
461
|
+
onSeek?: (e: TrackedVideoEvent & {
|
|
462
|
+
from: number;
|
|
463
|
+
to: number;
|
|
464
|
+
}) => void;
|
|
465
|
+
onTimeUpdate?: (e: TrackedVideoEvent) => void;
|
|
466
|
+
onEnded?: (e: TrackedVideoEvent) => void;
|
|
467
|
+
onWaiting?: (e: TrackedVideoEvent) => void;
|
|
468
|
+
/** Every quality change: a manual pick or an automatic ABR switch. */
|
|
469
|
+
onQualityChange?: (e: TrackedVideoEvent & {
|
|
470
|
+
from: VideoQuality;
|
|
471
|
+
to: VideoQuality;
|
|
472
|
+
source: "manual" | "auto";
|
|
473
|
+
}) => void;
|
|
474
|
+
onFullscreenChange?: (e: TrackedVideoEvent & {
|
|
475
|
+
fullscreen: boolean;
|
|
476
|
+
}) => void;
|
|
477
|
+
/** Fired once per checkpoint (default 25, 50, 75, 90, 100) as playback crosses it. */
|
|
478
|
+
onCheckpoint?: (e: TrackedVideoEvent & {
|
|
479
|
+
checkpoint: number;
|
|
480
|
+
}) => void;
|
|
481
|
+
}
|
|
482
|
+
interface TrackedVideoSources {
|
|
483
|
+
/** 16:9 Stream UID for desktop / landscape viewports. */
|
|
484
|
+
desktop: string;
|
|
485
|
+
/** Optional 9:16 Stream UID for mobile / portrait viewports. Falls back to `desktop` if omitted. */
|
|
486
|
+
mobile?: string | null;
|
|
487
|
+
}
|
|
488
|
+
interface TrackedVideoProps extends TrackedVideoCallbacks {
|
|
489
|
+
/** Logical video key (e.g. `"qlt-case-study-v6"`), resolved from R2 `trackingConfig` or `fallbackConfig`. */
|
|
490
|
+
id?: string;
|
|
491
|
+
/** Alias for `id` when referencing a key from `aranova-services.ts` (`videos`). */
|
|
492
|
+
video?: string;
|
|
493
|
+
/** Cloudflare Stream customer subdomain host (e.g. `"customer-xxxx.cloudflarestream.com"`). */
|
|
494
|
+
host?: string;
|
|
495
|
+
/** Stream UIDs for the desktop (16:9) and optional mobile (9:16) cuts. */
|
|
496
|
+
sources?: TrackedVideoSources;
|
|
497
|
+
/** Accessible title for the video player. */
|
|
498
|
+
title?: string;
|
|
499
|
+
/** Poster frame timestamp in seconds (Cloudflare Stream thumbnail parameter). Default: `4`. */
|
|
500
|
+
posterTime?: number;
|
|
501
|
+
/** Optional custom poster URL override. */
|
|
502
|
+
posterUrl?: string;
|
|
503
|
+
/** Optional custom renderer for the poster image (e.g. `next/image`). */
|
|
504
|
+
renderPoster?: (props: {
|
|
505
|
+
src: string;
|
|
506
|
+
variant: VideoVariant;
|
|
507
|
+
title: string;
|
|
508
|
+
width: number;
|
|
509
|
+
height: number;
|
|
510
|
+
}) => ReactNode;
|
|
511
|
+
/** Desktop theater state (controlled). */
|
|
512
|
+
theater?: boolean;
|
|
513
|
+
/** Initial desktop theater state when uncontrolled. */
|
|
514
|
+
defaultTheater?: boolean;
|
|
515
|
+
/** Callback when desktop theater expand/shrink is toggled or triggered on first play. */
|
|
516
|
+
onTheaterChange?: (next: boolean) => void;
|
|
517
|
+
/** Desktop expansion mode (`"theater"`, `"inline"`, or `"none"`). */
|
|
518
|
+
expandMode?: "theater" | "inline" | "none";
|
|
519
|
+
/** Whether clicking Play on desktop automatically expands into theater mode. Default: `true`. */
|
|
520
|
+
autoExpandOnPlay?: boolean;
|
|
521
|
+
/** Max width when expanded inline on desktop without an external `<TrackedVideoStage>`. Default: `1100`. */
|
|
522
|
+
expandedMaxWidth?: number | string;
|
|
523
|
+
/** Percentage checkpoints that trigger an immediate `video_progress` flush. Default: `[25, 50, 75, 90, 100]`. */
|
|
524
|
+
checkpoints?: readonly number[];
|
|
525
|
+
/** Optional R2 config reference override (defaults to the one passed to `createTracking`). */
|
|
526
|
+
trackingConfig?: TrackingConfigReference;
|
|
527
|
+
/** Optional baked video config fallback (e.g. `videos["qlt-case-study-v6"]` from `aranova-services.ts`). */
|
|
528
|
+
fallbackConfig?: TrackedVideoConfig | null;
|
|
529
|
+
/** Optional custom tracking client override (defaults to the active provider's client). */
|
|
530
|
+
client?: TrackingClient | null;
|
|
531
|
+
/** Optional custom loader for Media Chrome and HLS player libraries. */
|
|
532
|
+
loadPlayerLibs?: () => Promise<{
|
|
533
|
+
hls?: unknown;
|
|
534
|
+
} | void>;
|
|
535
|
+
className?: string;
|
|
536
|
+
style?: CSSProperties;
|
|
537
|
+
}
|
|
538
|
+
declare const DEFAULT_VIDEO_CHECKPOINTS: readonly number[];
|
|
539
|
+
declare const streamManifestUrl: (host: string, uid: string) => string;
|
|
540
|
+
declare const streamPosterUrl: (host: string, uid: string, time?: number) => string;
|
|
541
|
+
/** Look up a configured Cloudflare Stream tracked video by key from R2 runtime or `fallbackConfig`. */
|
|
542
|
+
declare function useTrackedVideoConfig(videoKey: string | undefined, trackingConfig?: TrackingConfigReference, fallbackConfig?: TrackedVideoConfig | null): TrackedVideoConfig | null;
|
|
543
|
+
/** Cloudflare Stream HLS player with watch-range telemetry, checkpoint flushing, and Theater mode. */
|
|
544
|
+
declare function TrackedVideo(props: TrackedVideoProps): ReactNode;
|
|
545
|
+
interface TrackedVideoStageProps {
|
|
546
|
+
/** Props forwarded to the `<TrackedVideo>` inside the stage. */
|
|
547
|
+
video: TrackedVideoProps;
|
|
548
|
+
/** Accompanying copy/content rendered beside the player at rest and below it in theater mode. */
|
|
549
|
+
children: ReactNode;
|
|
550
|
+
/** Maximum width of the expanded theater player on desktop. Default: `1100`. */
|
|
551
|
+
expandedMaxWidth?: number | string;
|
|
552
|
+
/** Maximum width of the accompanying copy when stacked below the theater player. Default: `760`. */
|
|
553
|
+
collapsedTextMaxWidth?: number | string;
|
|
554
|
+
className?: string;
|
|
555
|
+
}
|
|
556
|
+
/** Two-column desktop stage that FLIP-animates `<TrackedVideo>` into full-width theater layout. */
|
|
557
|
+
declare function TrackedVideoStage({ video, children, expandedMaxWidth, collapsedTextMaxWidth, className, }: TrackedVideoStageProps): ReactNode;
|
|
558
|
+
|
|
559
|
+
export { AdPlatformTracking, type AdPlatformTrackingProps, type BookedAttempt, BookingHandoffLink, type BookingHandoffLinkProps, type BookingHandoffOptions, type BookingSubmitState, type BookingSubmitStatus, ConsentBanner, type ConsentBannerProps, type CreateTrackingOptions, type CreateTrackingResult, DEFAULT_VIDEO_CHECKPOINTS, GoogleAdsTracking, type GoogleAdsTrackingProps, PhoneField, type PhoneFieldApi, type PhoneFieldProps, type PhoneInputProps, TrackedVideo, type TrackedVideoCallbacks, type TrackedVideoEvent, type TrackedVideoProps, type TrackedVideoSources, TrackedVideoStage, type TrackedVideoStageProps, type TrackingProviderProps, type UseConsentResult, type UseCookiePreferencesOptions, type UseCookiePreferencesResult, type UsePhoneFieldOptions, type VideoQuality, createTracking, streamManifestUrl, streamPosterUrl, useBookingHandoffUrl, useBookingIntegration, useBookingSlots, useBookingSubmit, useConsent, useConsentState, useCookiePreferences, useGclid, usePhoneConfig, usePhoneField, useTrackedVideoConfig, useTrackingParams };
|
package/dist/client.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, CSSProperties, InputHTMLAttributes, ChangeEvent, FocusEvent, AnchorHTMLAttributes } from 'react';
|
|
3
3
|
import { G as GtagEnvironmentMap, M as MetaPixelEnvironmentMap, h as ConsentState, f as ConsentChoiceState, g as ConsentSource, T as TrackingParams, b as TrackingEnvironment, u as PhoneConfig, P as ParsedPhone, v as PhoneDisplayFormat } from './phone-utils-BlWj8oxq.js';
|
|
4
|
-
import {
|
|
5
|
-
export {
|
|
6
|
-
import {
|
|
4
|
+
import { R as TrackingConfigReference, C as ConversionConfig, h as BookingHandoffPrefill, i as BookingInput, p as BookingOutcome, b as BookingDetailsInput, d as BookingDetailsOutcome, k as BookingIntegration, B as BookableDay, x as LeadFormContracts, S as SalesBookingsClient, g as BookingFormSubmit, t as BookingSimulation, j as BookingInputFor, T as TrackedVideoConfig } from './bookings-BDLyF70h.js';
|
|
5
|
+
export { a3 as createLeadFormSubmit } from './bookings-BDLyF70h.js';
|
|
6
|
+
import { Q as TriggerRegistryConfig, V as TypedTrackingClient, $ as VideoVariant, a0 as VideoWatchRange, O as TrackingClient } from './ingest-typed-DChvvgwd.js';
|
|
7
7
|
import { CountryCode } from 'libphonenumber-js';
|
|
8
8
|
import 'zod/mini';
|
|
9
9
|
import 'zod/v4/core';
|
|
@@ -439,4 +439,121 @@ declare function useBookingSubmit<C extends LeadFormContracts | undefined = unde
|
|
|
439
439
|
contracts?: C;
|
|
440
440
|
}): BookingSubmitState<C extends LeadFormContracts ? BookingInputFor<C> : BookingInput>;
|
|
441
441
|
|
|
442
|
-
|
|
442
|
+
/** A rendition height in pixels (e.g. 720, 1080), or "auto" for adaptive bitrate. */
|
|
443
|
+
type VideoQuality = number | "auto";
|
|
444
|
+
interface TrackedVideoEvent {
|
|
445
|
+
/** Logical video key, e.g. "qlt-case-study-v6". */
|
|
446
|
+
id: string;
|
|
447
|
+
/** Variant-qualified DOM id, e.g. "qlt-case-study-v6-16x9". */
|
|
448
|
+
videoId: string;
|
|
449
|
+
variant: VideoVariant;
|
|
450
|
+
currentTime: number;
|
|
451
|
+
duration: number;
|
|
452
|
+
watchedSeconds: number;
|
|
453
|
+
watchedPercent: number;
|
|
454
|
+
maxPercent: number;
|
|
455
|
+
ranges: VideoWatchRange[];
|
|
456
|
+
}
|
|
457
|
+
interface TrackedVideoCallbacks {
|
|
458
|
+
onPlay?: (e: TrackedVideoEvent) => void;
|
|
459
|
+
onPause?: (e: TrackedVideoEvent) => void;
|
|
460
|
+
/** A finished seek: where playback was and where it landed, in seconds. */
|
|
461
|
+
onSeek?: (e: TrackedVideoEvent & {
|
|
462
|
+
from: number;
|
|
463
|
+
to: number;
|
|
464
|
+
}) => void;
|
|
465
|
+
onTimeUpdate?: (e: TrackedVideoEvent) => void;
|
|
466
|
+
onEnded?: (e: TrackedVideoEvent) => void;
|
|
467
|
+
onWaiting?: (e: TrackedVideoEvent) => void;
|
|
468
|
+
/** Every quality change: a manual pick or an automatic ABR switch. */
|
|
469
|
+
onQualityChange?: (e: TrackedVideoEvent & {
|
|
470
|
+
from: VideoQuality;
|
|
471
|
+
to: VideoQuality;
|
|
472
|
+
source: "manual" | "auto";
|
|
473
|
+
}) => void;
|
|
474
|
+
onFullscreenChange?: (e: TrackedVideoEvent & {
|
|
475
|
+
fullscreen: boolean;
|
|
476
|
+
}) => void;
|
|
477
|
+
/** Fired once per checkpoint (default 25, 50, 75, 90, 100) as playback crosses it. */
|
|
478
|
+
onCheckpoint?: (e: TrackedVideoEvent & {
|
|
479
|
+
checkpoint: number;
|
|
480
|
+
}) => void;
|
|
481
|
+
}
|
|
482
|
+
interface TrackedVideoSources {
|
|
483
|
+
/** 16:9 Stream UID for desktop / landscape viewports. */
|
|
484
|
+
desktop: string;
|
|
485
|
+
/** Optional 9:16 Stream UID for mobile / portrait viewports. Falls back to `desktop` if omitted. */
|
|
486
|
+
mobile?: string | null;
|
|
487
|
+
}
|
|
488
|
+
interface TrackedVideoProps extends TrackedVideoCallbacks {
|
|
489
|
+
/** Logical video key (e.g. `"qlt-case-study-v6"`), resolved from R2 `trackingConfig` or `fallbackConfig`. */
|
|
490
|
+
id?: string;
|
|
491
|
+
/** Alias for `id` when referencing a key from `aranova-services.ts` (`videos`). */
|
|
492
|
+
video?: string;
|
|
493
|
+
/** Cloudflare Stream customer subdomain host (e.g. `"customer-xxxx.cloudflarestream.com"`). */
|
|
494
|
+
host?: string;
|
|
495
|
+
/** Stream UIDs for the desktop (16:9) and optional mobile (9:16) cuts. */
|
|
496
|
+
sources?: TrackedVideoSources;
|
|
497
|
+
/** Accessible title for the video player. */
|
|
498
|
+
title?: string;
|
|
499
|
+
/** Poster frame timestamp in seconds (Cloudflare Stream thumbnail parameter). Default: `4`. */
|
|
500
|
+
posterTime?: number;
|
|
501
|
+
/** Optional custom poster URL override. */
|
|
502
|
+
posterUrl?: string;
|
|
503
|
+
/** Optional custom renderer for the poster image (e.g. `next/image`). */
|
|
504
|
+
renderPoster?: (props: {
|
|
505
|
+
src: string;
|
|
506
|
+
variant: VideoVariant;
|
|
507
|
+
title: string;
|
|
508
|
+
width: number;
|
|
509
|
+
height: number;
|
|
510
|
+
}) => ReactNode;
|
|
511
|
+
/** Desktop theater state (controlled). */
|
|
512
|
+
theater?: boolean;
|
|
513
|
+
/** Initial desktop theater state when uncontrolled. */
|
|
514
|
+
defaultTheater?: boolean;
|
|
515
|
+
/** Callback when desktop theater expand/shrink is toggled or triggered on first play. */
|
|
516
|
+
onTheaterChange?: (next: boolean) => void;
|
|
517
|
+
/** Desktop expansion mode (`"theater"`, `"inline"`, or `"none"`). */
|
|
518
|
+
expandMode?: "theater" | "inline" | "none";
|
|
519
|
+
/** Whether clicking Play on desktop automatically expands into theater mode. Default: `true`. */
|
|
520
|
+
autoExpandOnPlay?: boolean;
|
|
521
|
+
/** Max width when expanded inline on desktop without an external `<TrackedVideoStage>`. Default: `1100`. */
|
|
522
|
+
expandedMaxWidth?: number | string;
|
|
523
|
+
/** Percentage checkpoints that trigger an immediate `video_progress` flush. Default: `[25, 50, 75, 90, 100]`. */
|
|
524
|
+
checkpoints?: readonly number[];
|
|
525
|
+
/** Optional R2 config reference override (defaults to the one passed to `createTracking`). */
|
|
526
|
+
trackingConfig?: TrackingConfigReference;
|
|
527
|
+
/** Optional baked video config fallback (e.g. `videos["qlt-case-study-v6"]` from `aranova-services.ts`). */
|
|
528
|
+
fallbackConfig?: TrackedVideoConfig | null;
|
|
529
|
+
/** Optional custom tracking client override (defaults to the active provider's client). */
|
|
530
|
+
client?: TrackingClient | null;
|
|
531
|
+
/** Optional custom loader for Media Chrome and HLS player libraries. */
|
|
532
|
+
loadPlayerLibs?: () => Promise<{
|
|
533
|
+
hls?: unknown;
|
|
534
|
+
} | void>;
|
|
535
|
+
className?: string;
|
|
536
|
+
style?: CSSProperties;
|
|
537
|
+
}
|
|
538
|
+
declare const DEFAULT_VIDEO_CHECKPOINTS: readonly number[];
|
|
539
|
+
declare const streamManifestUrl: (host: string, uid: string) => string;
|
|
540
|
+
declare const streamPosterUrl: (host: string, uid: string, time?: number) => string;
|
|
541
|
+
/** Look up a configured Cloudflare Stream tracked video by key from R2 runtime or `fallbackConfig`. */
|
|
542
|
+
declare function useTrackedVideoConfig(videoKey: string | undefined, trackingConfig?: TrackingConfigReference, fallbackConfig?: TrackedVideoConfig | null): TrackedVideoConfig | null;
|
|
543
|
+
/** Cloudflare Stream HLS player with watch-range telemetry, checkpoint flushing, and Theater mode. */
|
|
544
|
+
declare function TrackedVideo(props: TrackedVideoProps): ReactNode;
|
|
545
|
+
interface TrackedVideoStageProps {
|
|
546
|
+
/** Props forwarded to the `<TrackedVideo>` inside the stage. */
|
|
547
|
+
video: TrackedVideoProps;
|
|
548
|
+
/** Accompanying copy/content rendered beside the player at rest and below it in theater mode. */
|
|
549
|
+
children: ReactNode;
|
|
550
|
+
/** Maximum width of the expanded theater player on desktop. Default: `1100`. */
|
|
551
|
+
expandedMaxWidth?: number | string;
|
|
552
|
+
/** Maximum width of the accompanying copy when stacked below the theater player. Default: `760`. */
|
|
553
|
+
collapsedTextMaxWidth?: number | string;
|
|
554
|
+
className?: string;
|
|
555
|
+
}
|
|
556
|
+
/** Two-column desktop stage that FLIP-animates `<TrackedVideo>` into full-width theater layout. */
|
|
557
|
+
declare function TrackedVideoStage({ video, children, expandedMaxWidth, collapsedTextMaxWidth, className, }: TrackedVideoStageProps): ReactNode;
|
|
558
|
+
|
|
559
|
+
export { AdPlatformTracking, type AdPlatformTrackingProps, type BookedAttempt, BookingHandoffLink, type BookingHandoffLinkProps, type BookingHandoffOptions, type BookingSubmitState, type BookingSubmitStatus, ConsentBanner, type ConsentBannerProps, type CreateTrackingOptions, type CreateTrackingResult, DEFAULT_VIDEO_CHECKPOINTS, GoogleAdsTracking, type GoogleAdsTrackingProps, PhoneField, type PhoneFieldApi, type PhoneFieldProps, type PhoneInputProps, TrackedVideo, type TrackedVideoCallbacks, type TrackedVideoEvent, type TrackedVideoProps, type TrackedVideoSources, TrackedVideoStage, type TrackedVideoStageProps, type TrackingProviderProps, type UseConsentResult, type UseCookiePreferencesOptions, type UseCookiePreferencesResult, type UsePhoneFieldOptions, type VideoQuality, createTracking, streamManifestUrl, streamPosterUrl, useBookingHandoffUrl, useBookingIntegration, useBookingSlots, useBookingSubmit, useConsent, useConsentState, useCookiePreferences, useGclid, usePhoneConfig, usePhoneField, useTrackedVideoConfig, useTrackingParams };
|