react-covideo-embed 1.0.60 → 1.0.62

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.
Files changed (31) hide show
  1. package/.github/DEPLOYMENT_SETUP.md +161 -0
  2. package/.github/workflows/publish-and-deploy.yml +91 -0
  3. package/build/app/pages/recordv1/ChooseRecordingOptions.d.ts +1 -1
  4. package/build/index.js +19 -19
  5. package/build/lib/api/inventory/inventoryItemKeys.d.ts +4 -0
  6. package/build/lib/api/inventory/useGtmVinInventoryQuery.d.ts +3 -0
  7. package/build/lib/context/AuthorizationContext.d.ts +1 -0
  8. package/build/lib/hooks/GTM/actions/recording/addVideoAttribute.d.ts +1 -0
  9. package/build/lib/hooks/GTM/actions/recording/discardVideo.d.ts +1 -0
  10. package/build/lib/hooks/GTM/actions/recording/index.d.ts +6 -0
  11. package/build/lib/hooks/GTM/actions/recording/selectType.d.ts +4 -0
  12. package/build/lib/hooks/GTM/actions/recording/start.d.ts +1 -0
  13. package/build/lib/hooks/GTM/actions/recording/stop.d.ts +1 -0
  14. package/build/lib/hooks/GTM/actions/recording/toolInteraction.d.ts +4 -0
  15. package/build/lib/hooks/GTM/actions/recording/types.d.ts +11 -0
  16. package/build/lib/hooks/GTM/actions/video/attributesInteraction.d.ts +2 -0
  17. package/build/lib/hooks/GTM/actions/video/index.d.ts +5 -0
  18. package/build/lib/hooks/GTM/actions/video/interaction.d.ts +2 -0
  19. package/build/lib/hooks/GTM/actions/video/messageInteraction.d.ts +2 -0
  20. package/build/lib/hooks/GTM/actions/video/saveNewVideoInteraction.d.ts +2 -0
  21. package/build/lib/hooks/GTM/actions/video/types.d.ts +121 -0
  22. package/build/lib/hooks/GTM/actions/video/utils.d.ts +3 -0
  23. package/build/lib/hooks/GTM/pushToDataLayer.d.ts +6 -0
  24. package/build/lib/hooks/GTM/types.d.ts +260 -0
  25. package/build/lib/hooks/GTM/useGTMAnalytics.d.ts +28 -0
  26. package/build/lib/hooks/GTM/useGTMInject.d.ts +5 -0
  27. package/build/lib/hooks/GTM/useGTMTrackPageView.d.ts +15 -0
  28. package/build/lib/hooks/GTM/utils.d.ts +56 -0
  29. package/package.json +1 -1
  30. package/build/lib/hooks/useGoogleTagManager.d.ts +0 -3
  31. package/build/lib/utils/gtm.d.ts +0 -29
@@ -0,0 +1,4 @@
1
+ export declare const inventoryItemKeys: {
2
+ all: () => readonly ["INTVENTORY_ITEMS"];
3
+ details: (itemId: string) => readonly ["DETAILS", string];
4
+ };
@@ -0,0 +1,3 @@
1
+ export declare const useGtmVinInventoryQuery: ({ vin }: {
2
+ vin: string;
3
+ }) => import("react-query").UseQueryResult<import("../inventoryApi").IInventoryItemsResponse, unknown>;
@@ -83,6 +83,7 @@ export interface UserData {
83
83
  customerId: string;
84
84
  resellerReportingEnabled: number;
85
85
  };
86
+ eleadDMSEmployeeID: string | null;
86
87
  videoCount: number;
87
88
  totalLogins: number;
88
89
  droplrAccess: boolean;
@@ -0,0 +1 @@
1
+ export declare function addVideoAttributeEvent(): void;
@@ -0,0 +1 @@
1
+ export declare function discardVideoEvent(): void;
@@ -0,0 +1,6 @@
1
+ export * from './selectType';
2
+ export * from './toolInteraction';
3
+ export * from './discardVideo';
4
+ export * from './start';
5
+ export * from './stop';
6
+ export * from './addVideoAttribute';
@@ -0,0 +1,4 @@
1
+ import { SelectRecordingType } from './types';
2
+ export declare function selectRecordingTypeEvent({ type, }: {
3
+ type: SelectRecordingType;
4
+ }): void;
@@ -0,0 +1 @@
1
+ export declare function startRecordingEvent(): void;
@@ -0,0 +1 @@
1
+ export declare function stopRecordingEvent(): void;
@@ -0,0 +1,4 @@
1
+ import { RecordingToolAction } from './types';
2
+ export declare function recordingToolIntearctionEvent({ action, }: {
3
+ action: RecordingToolAction;
4
+ }): void;
@@ -0,0 +1,11 @@
1
+ export declare enum SelectRecordingType {
2
+ SCREEN = "Screen",
3
+ CAM = "Camera",
4
+ SCREEN_AND_CAM = "Screen+Camera"
5
+ }
6
+ export declare enum RecordingToolAction {
7
+ OPENED = "Opened",
8
+ APPLIED = "Applied",
9
+ CLOSED = "Closed",
10
+ REMOVED = "Removed"
11
+ }
@@ -0,0 +1,2 @@
1
+ import { VideoAttributeInteractionInteractionEventArgs } from './types';
2
+ export declare function videoAttributeInteractionInteractionEvent({ videoAttributes, vehicleData, }: VideoAttributeInteractionInteractionEventArgs): void;
@@ -0,0 +1,5 @@
1
+ export * from './interaction';
2
+ export * from './messageInteraction';
3
+ export * from './attributesInteraction';
4
+ export * from './saveNewVideoInteraction';
5
+ export * from './types';
@@ -0,0 +1,2 @@
1
+ import { GTMVideoInteractonEventArguments } from './types';
2
+ export declare function videoInteractonEvent({ action, videoIds, videoAttributes, vehicleData, }: GTMVideoInteractonEventArguments): void;
@@ -0,0 +1,2 @@
1
+ import { GTMVideoMessageInteraction } from './types';
2
+ export declare function videoMessageInteractionEvent({ action, videoMessageProperties, video, vehicleData, }: GTMVideoMessageInteraction): void;
@@ -0,0 +1,2 @@
1
+ import { GTMSaveNewVideoInteractionEventArguments } from './types';
2
+ export declare function saveNewVideoInteractionEvent({ videoAttributes, type, vehicleData, mergedIds, }: GTMSaveNewVideoInteractionEventArguments): void;
@@ -0,0 +1,121 @@
1
+ import { CovideoGTMVideoAttributes, GTMVehicleAttributes } from '../../types';
2
+ export declare enum GTMVideoInteractionActions {
3
+ VIEW = "View",
4
+ SEND_AND_SHARE = "Send & Share (Insert)",
5
+ COPY_VIDEO_URL = "Copy Video URL",
6
+ MERGE = "Merge",
7
+ VOICE_OVER = "Voice Over"
8
+ }
9
+ export declare enum GTMSaveNewVideoInteractionTypes {
10
+ RECORD = "Record",
11
+ UPLOAD = "Upload",
12
+ MERGE = "Merge",
13
+ VOICE_RECORD = "Voice Record"
14
+ }
15
+ export declare enum GTMVideoMessageInteractionActions {
16
+ INSERT = "Insert",
17
+ COPY = "Copy"
18
+ }
19
+ type GTMVideoInteractionBase = {
20
+ action: GTMVideoInteractionActions;
21
+ };
22
+ type GTMVideoInteractionWithIds = GTMVideoInteractionBase & {
23
+ videoIds: number[];
24
+ videoAttributes?: never;
25
+ vehicleData?: never;
26
+ };
27
+ type GTMVideoInteractionWithDetails = GTMVideoInteractionBase & {
28
+ videoIds?: undefined;
29
+ videoAttributes?: CovideoGTMVideoAttributes;
30
+ vehicleData?: GTMVehicleAttributes;
31
+ };
32
+ export type GTMVideoInteractonEventArguments = GTMVideoInteractionWithIds | GTMVideoInteractionWithDetails;
33
+ export interface GTMSaveNewVideoInteractionEventArguments {
34
+ videoAttributes: CovideoGTMVideoAttributes;
35
+ type: GTMSaveNewVideoInteractionTypes;
36
+ vehicleData?: GTMVehicleAttributes;
37
+ mergedIds?: number[];
38
+ }
39
+ export type VideoAttributeInteractionInteractionEventArgs = {
40
+ videoAttributes: CovideoGTMVideoAttributes;
41
+ vehicleData?: GTMVehicleAttributes;
42
+ };
43
+ export type GTMVideoMessageInteraction = {
44
+ action: GTMVideoMessageInteractionActions;
45
+ videoMessageProperties: CovideoGTMVideoMessageProperties;
46
+ shareOption?: never;
47
+ video: CovideoGTMVideoAttributes;
48
+ vehicleData?: GTMVehicleAttributes;
49
+ };
50
+ /**
51
+ * Describes the normalized data sent to GTM for "Video Message Interaction"
52
+ * events that occur when a user shares or interacts with a video message.
53
+ * Each field corresponds to a user-selected option within the share flow.
54
+ */
55
+ export interface GTMVideoMessageProperties {
56
+ customer_id?: string;
57
+ sms?: boolean;
58
+ email?: boolean;
59
+ /**
60
+ * Indicates whether the user opted to notify the recipient after sharing
61
+ * the video message (e.g., "Notify viewer when video is viewed").
62
+ *
63
+ * @example true // user enabled notifications for video views
64
+ */
65
+ notification_viewed?: boolean;
66
+ /**
67
+ * The name or ID of the selected landing page template used for the
68
+ * shared video. Typically derived from `templateId` or the template label.
69
+ *
70
+ * @example "Automotive Default Template"
71
+ */
72
+ landing_page?: string;
73
+ /**
74
+ * The name or ID of the selected Call-to-Action (CTA) link set
75
+ * attached to the shared video. Usually maps to a `linksetId` or title.
76
+ *
77
+ * @example "Book a Test Drive"
78
+ */
79
+ call_to_action?: string;
80
+ /**
81
+ * The name or ID of the selected video thumbnail style or icon used
82
+ * in the share configuration. Usually maps to `iconId` or template title.
83
+ *
84
+ * @example "Dark Overlay Thumbnail"
85
+ */
86
+ thumbnails?: string;
87
+ }
88
+ export interface CovideoGTMVideoMessageProperties {
89
+ customerId?: string;
90
+ sms?: boolean;
91
+ email?: boolean;
92
+ /**
93
+ * Indicates whether the user opted to notify the recipient after sharing
94
+ * the video message (e.g., "Notify viewer when video is viewed").
95
+ *
96
+ * @example true // user enabled notifications for video views
97
+ */
98
+ notificationViewed?: boolean;
99
+ /**
100
+ * The name or ID of the selected landing page template used for the
101
+ * shared video. Typically derived from `templateId` or the template label.
102
+ *
103
+ * @example "Automotive Default Template"
104
+ */
105
+ landingPage?: string;
106
+ /**
107
+ * The name or ID of the selected Call-to-Action (CTA) link set
108
+ * attached to the shared video. Usually maps to a `linksetId` or title.
109
+ *
110
+ * @example "Book a Test Drive"
111
+ */
112
+ callToAction?: string;
113
+ /**
114
+ * The name or ID of the selected video thumbnail style or icon used
115
+ * in the share configuration. Usually maps to `iconId` or template title.
116
+ *
117
+ * @example "Dark Overlay Thumbnail"
118
+ */
119
+ thumbnails?: string;
120
+ }
121
+ export {};
@@ -0,0 +1,3 @@
1
+ import { CovideoGTMVideoMessageProperties, GTMVideoMessageProperties } from './types';
2
+ export declare function mapToGtmVideoMessageProperties(item?: CovideoGTMVideoMessageProperties): GTMVideoMessageProperties;
3
+ export declare function getVideoDurationMs(file: File, timeoutMs?: number): Promise<number>;
@@ -0,0 +1,6 @@
1
+ declare global {
2
+ interface Window {
3
+ dataLayer?: Array<Record<string, any>>;
4
+ }
5
+ }
6
+ export declare function pushToDataLayer(data: Record<string, any>): void;
@@ -0,0 +1,260 @@
1
+ export declare enum GTMEvent {
2
+ COVIDEO_EVENT = "covideo-event",
3
+ COVIDEO_PAGEVIEW = "covideo-pageview"
4
+ }
5
+ export declare enum GTMPageApplication {
6
+ CRM_VIDEO_EMBED = "CDK Video Whitelabel"
7
+ }
8
+ export declare enum GTMEventName {
9
+ VIDEO_INTERACTION = "Video Interaction",
10
+ INVENTORY_INTERACTION = "Inventory Interaction",
11
+ MEETING_INTERACTION = "Meeting Interaction",
12
+ SCHEDULE_MEETING = "Schedule Meeting",
13
+ SAVED_NEW_VIDEO = "Saved New Video",
14
+ VIDEO_ATTRIBUTE_INTERACTION = "Video Attribute Interaction",
15
+ VIDEO_MESSAGE_INTERACTION = "Video Message Interaction",
16
+ SELECT_RECORDING_TYPE = "Select Recording Type",
17
+ RECORDING_TOOL_INTERACTION = "Recording Tool Interaction",
18
+ START_RECORDING = "Start Recording",
19
+ STOP_RECORDING = "Stop Recording",
20
+ ADD_VIDEO_ATTRIBUTE = "Add Video Attribute",
21
+ DISCARD_VIDEO = "Discard Video",
22
+ RECENTLY_DELETED_INTERACTION = "Recently Deleted Interaction",
23
+ NEW_LEAD_ADDED = "New Lead Added",
24
+ CREATE_NEW_MEETING = "Create New Meeting"
25
+ }
26
+ export declare enum PageLocation {
27
+ SEND_SHARE = "Send & Share",
28
+ VIDEOS = "Videos",
29
+ RECORD = "Record",
30
+ MERGE = "Merge",
31
+ DETAILS = "Details"
32
+ }
33
+ export declare enum PageUrl {
34
+ SEND_SHARE = "https://video.connectcdk.com/embed/send",
35
+ HOME = "https://video.connectcdk.com/embed/home",
36
+ MERGE = "https://video.connectcdk.com/embed/merge",
37
+ RECORD = "https://video.connectcdk.com/embed/record",
38
+ VOICE_RECORDER = "https://video.connectcdk.com/embed/voice-recorder"
39
+ }
40
+ export declare enum PageSection {
41
+ SHARE = "Share",
42
+ OVERVIEW = "Overview",
43
+ RECORD = "Record",
44
+ RECORDER = "Recorder",
45
+ DETAILS = "Details",
46
+ VOICE_RECORDER = "Voice Recorder"
47
+ }
48
+ export interface GTMPageviewAttributes {
49
+ /**
50
+ * Event name for GTM or analytics tracking.
51
+ * Always set to `'covideo-pageview'`.
52
+ * @example "covideo-pageview"
53
+ */
54
+ event: GTMEvent.COVIDEO_PAGEVIEW;
55
+ /**
56
+ * Application or product identifier where the pageview originated.
57
+ * Typically fixed to `'CRM Video Embed'`.
58
+ * @example "'CRM Video Embed'"
59
+ */
60
+ application: GTMPageApplication.CRM_VIDEO_EMBED;
61
+ /**
62
+ * Full URL of the page viewed, including protocol, domain, and path.
63
+ * @example "https://video.connectcdk.com/reports/companies"
64
+ */
65
+ page_url: string;
66
+ /**
67
+ * Higher-level section or context of the page being viewed
68
+ * (e.g., "Reports", "Library", "Dashboard").
69
+ * @example "Reports"
70
+ */
71
+ page_location?: string;
72
+ /**
73
+ * **Lower-level location within the selected `page_section`.**
74
+ * Represents a specific page or sub-route under that section.
75
+ * @example "My Team"
76
+ */
77
+ page_section?: string;
78
+ }
79
+ export interface GTMEventAttributes {
80
+ /**
81
+ * Event name for GTM or analytics tracking.
82
+ * Always set to `'covideo-name'`.
83
+ * @example "covideo-name"
84
+ */
85
+ event: GTMEvent.COVIDEO_EVENT;
86
+ /**
87
+ * Specific name of the event being tracked.
88
+ * Examples include 'Video Interaction', 'Inventory Interaction', 'Meeting Interaction', 'Schedule Meeting', 'Save New Video', and 'Video Attribute Interaction'.
89
+ * @example "Video Interaction"
90
+ */
91
+ event_name: GTMEventName;
92
+ }
93
+ export interface GTMCDKUserAttributes {
94
+ /**
95
+ * Unique identifier of the user within our system.
96
+ * @example "2343564"
97
+ */
98
+ user_id?: string;
99
+ /**
100
+ * One or more roles assigned to the user.
101
+ * @example ["Sales Person", "F&I Manager"]
102
+ */
103
+ user_role?: string[];
104
+ /**
105
+ * Enterprise identifier (CDK enterprise code).
106
+ * @example "E000118"
107
+ */
108
+ enterprise_id?: string;
109
+ /**
110
+ * Enterprise (dealer group) display name.
111
+ * @example "Excellence Motors"
112
+ */
113
+ enterprise_name?: string;
114
+ /**
115
+ * Store identifier (CDK store code).
116
+ * @example "S13552"
117
+ */
118
+ store_id?: string;
119
+ /**
120
+ * Store display name.
121
+ * @example "Toyota Boston"
122
+ */
123
+ store_name?: string;
124
+ /**
125
+ * Customer identifier from the CRM (if present).
126
+ * @example "123454"
127
+ */
128
+ customer_id?: string;
129
+ /**
130
+ * Flag indicating whether the user is an internal user (CDK/Covideo staff).
131
+ * @example true
132
+ */
133
+ is_internal_user?: boolean;
134
+ }
135
+ export interface GTMVideoAttributes {
136
+ /**
137
+ * The ID of the video that is selected, created, or currently present on the page.
138
+ * @example 987654
139
+ */
140
+ video_id?: number;
141
+ /**
142
+ * The category/type associated with the video.
143
+ * Common examples: "Marketing", "Prospecting", "Respond to Inquiry", "Thanks for Your Business".
144
+ * @example "Marketing"
145
+ */
146
+ video_type?: string | undefined;
147
+ /**
148
+ * Whether the video has the customer's name filled in.
149
+ * NOTE: By cdk documentation this is a boolean check if that is correct.
150
+ * @example true
151
+ */
152
+ video_customer_name?: boolean;
153
+ /**
154
+ * Length of the video in **minutes** as a decimal value.
155
+ * For example, "00:02:45" (2 minutes 45 seconds) -> 2.75 minutes.
156
+ * @example 2.75
157
+ */
158
+ video_length?: number;
159
+ /**
160
+ * Title of the video.
161
+ * NOTE: By cdk documentation this is The inventory ID of the vehicle related to this video (as provided for tracking).
162
+ * @example 123456
163
+ */
164
+ video_title?: string;
165
+ }
166
+ export interface GTMVehicleAttributes {
167
+ /**
168
+ * Vehicle description.
169
+ * @example "2019 Ford Taurus"
170
+ */
171
+ vehicle?: string;
172
+ /**
173
+ * Vehicle price in numeric form (no currency symbol).
174
+ * @example 17499
175
+ */
176
+ price?: number;
177
+ /**
178
+ * Vehicle Identification Number (VIN).
179
+ * @example "1FAHP2E89KG117472"
180
+ */
181
+ vin?: string;
182
+ /**
183
+ * Dealer stock number.
184
+ * @example "AU117472"
185
+ */
186
+ stock_number?: string;
187
+ /**
188
+ * Vehicle condition (e.g., New, Used, CPO).
189
+ * @example "Used"
190
+ */
191
+ condition?: string;
192
+ /**
193
+ * Engine details or code.
194
+ * @example "3.5L Ti-VCT V6 (FFV)"
195
+ */
196
+ engine?: string;
197
+ /**
198
+ * Manufacturer / make.
199
+ * @example "Ford"
200
+ */
201
+ make?: string;
202
+ /**
203
+ * Vehicle model.
204
+ * @example "Taurus"
205
+ */
206
+ model?: string;
207
+ /**
208
+ * Trim and/or body style.
209
+ * @example "SEL 4dr Front-wheel Drive Sedan"
210
+ */
211
+ trim?: string;
212
+ /**
213
+ * Model year.
214
+ * @example 2019
215
+ */
216
+ year?: number;
217
+ /**
218
+ * Odometer reading in miles.
219
+ * @example 39231
220
+ */
221
+ mileage?: number;
222
+ /**
223
+ * Exterior color.
224
+ * @example "Red"
225
+ */
226
+ ext_color?: string;
227
+ /**
228
+ * Interior color.
229
+ * @example "Dune"
230
+ */
231
+ int_color?: string;
232
+ /**
233
+ * Transmission type.
234
+ * @example "Automatic"
235
+ */
236
+ transmission?: string;
237
+ }
238
+ export interface CovideoGTMVideoAttributes {
239
+ videoId?: number;
240
+ videoType?: string;
241
+ videoCustomerName?: boolean;
242
+ videoLength?: number;
243
+ videoTitle?: string;
244
+ }
245
+ export interface CovideoGTMVehicleItem {
246
+ title: string;
247
+ price: string | number;
248
+ year: string | number;
249
+ mileage: string | number;
250
+ vin: string;
251
+ stockNumber: string | number;
252
+ itemCondition: string;
253
+ engine: string;
254
+ make: string;
255
+ model: string;
256
+ trim: string;
257
+ exteriorColor: string;
258
+ interiorColor: string;
259
+ transmission: string;
260
+ }
@@ -0,0 +1,28 @@
1
+ import { GTMSaveNewVideoInteractionEventArguments, GTMVideoInteractonEventArguments, GTMVideoMessageInteraction, VideoAttributeInteractionInteractionEventArgs } from './actions/video/types';
2
+ import { selectRecordingTypeEvent, recordingToolIntearctionEvent, stopRecordingEvent, startRecordingEvent, addVideoAttributeEvent, discardVideoEvent } from './actions/recording';
3
+ type TrackVideoInteractionArgs = {
4
+ vin?: string;
5
+ } & Omit<GTMVideoInteractonEventArguments, 'vehicleData'>;
6
+ type TrackSaveNewVideoArgs = {
7
+ vin?: string;
8
+ } & Omit<GTMSaveNewVideoInteractionEventArguments, 'vehicleData'>;
9
+ type TrackVideoAttributeInteractionArgs = VideoAttributeInteractionInteractionEventArgs & {
10
+ vin?: string;
11
+ };
12
+ type TrackGTMVideoMessageInteractionEvent = GTMVideoMessageInteraction & {
13
+ vin?: string;
14
+ };
15
+ export declare function useGTMAnalytics(): {
16
+ trackGTMVideoInteractionEvent: (({ vin, ...rest }: TrackVideoInteractionArgs) => Promise<void>) | undefined;
17
+ trackGTMVideoMessageInteractionEvent: (({ vin, ...rest }: TrackGTMVideoMessageInteractionEvent) => Promise<void>) | undefined;
18
+ trackGTMSaveNewVideoInteractionEvent: (({ vin, ...rest }: TrackSaveNewVideoArgs) => Promise<void>) | undefined;
19
+ trackGTMVideoAttributeInteractionInteractionEvent: (({ vin, videoAttributes }: TrackVideoAttributeInteractionArgs) => Promise<void>) | undefined;
20
+ trackGTMRecordingToolIntearctionEvent: typeof recordingToolIntearctionEvent | undefined;
21
+ trackGTMSelectRecordingTypeEvent: typeof selectRecordingTypeEvent | undefined;
22
+ trackGTMStopRecordingEvent: typeof stopRecordingEvent | undefined;
23
+ trackGTMStartRecordingEvent: typeof startRecordingEvent | undefined;
24
+ trackGTMAddVideoAttributeEvent: typeof addVideoAttributeEvent | undefined;
25
+ trackGTMDiscardVideoEvent: typeof discardVideoEvent | undefined;
26
+ isFetchingVin: boolean;
27
+ };
28
+ export {};
@@ -0,0 +1,5 @@
1
+ export declare function useGTMInject({ gtmId }: {
2
+ gtmId?: string;
3
+ }): {
4
+ isLoadingScript: boolean;
5
+ };
@@ -0,0 +1,15 @@
1
+ import { CovideoGTMVideoAttributes, GTMVehicleAttributes } from './types';
2
+ export declare function useGTMTrackPageView({ vin }: {
3
+ vin: string;
4
+ }): {
5
+ trackVideoSpecificPagesManually: (({ pageLocation, pageSection, videoAttributes, excludeVehicleData, vehicle, mergeIds, pageUrl, }: {
6
+ pageLocation?: string;
7
+ pageSection?: string;
8
+ videoAttributes?: CovideoGTMVideoAttributes;
9
+ excludeVehicleData?: boolean;
10
+ vehicle?: GTMVehicleAttributes;
11
+ mergeIds?: number[];
12
+ pageUrl: string;
13
+ }) => void) | undefined;
14
+ vehiceReady: boolean;
15
+ };
@@ -0,0 +1,56 @@
1
+ import { CovideoGTMVehicleItem, CovideoGTMVideoAttributes, GTMVehicleAttributes, GTMVideoAttributes, PageLocation, PageSection, PageUrl } from './types';
2
+ /**
3
+ * Convert a duration to decimal minutes.
4
+ * Pass API value (ms or s) and get minutes rounded to 2 decimals.
5
+ *
6
+ * @example toDecimalMinutes(50600, 'ms') // 0.84 (≈ 50.6s)
7
+ * @example toDecimalMinutes(50, 's') // 0.83 (50s)
8
+ * @example toDecimalMinutes(165, 's') // 2.75 (2m45s)
9
+ */
10
+ export declare function toDecimalMinutes(value: number, unit?: 'ms' | 's', fractionDigits?: number): number;
11
+ export declare function mapToGTMVideoAttributes(src?: CovideoGTMVideoAttributes): GTMVideoAttributes;
12
+ /**
13
+ * Map app-level meeting attributes to GTM meeting attributes.
14
+ */
15
+ export declare function mapToGtmVehicleAttributes(item?: CovideoGTMVehicleItem): GTMVehicleAttributes;
16
+ export declare function mapDeliveryTimeToGtmMeeting(deliveryTime?: string): {
17
+ meetingDate: string | undefined;
18
+ meetingTime: string | undefined;
19
+ };
20
+ export declare const TRACKED_PAGES: {
21
+ readonly SEND_SHARE: {
22
+ readonly pageUrl: PageUrl.SEND_SHARE;
23
+ readonly pageLocation: PageLocation.SEND_SHARE;
24
+ readonly pageSection: PageSection.SHARE;
25
+ };
26
+ readonly VIDEOS_OVERVIEW: {
27
+ readonly pageUrl: PageUrl.HOME;
28
+ readonly pageLocation: PageLocation.VIDEOS;
29
+ readonly pageSection: PageSection.OVERVIEW;
30
+ };
31
+ readonly VIDEOS_MERGE: {
32
+ readonly pageUrl: PageUrl.MERGE;
33
+ readonly pageLocation: PageLocation.MERGE;
34
+ readonly pageSection: PageSection.DETAILS;
35
+ };
36
+ readonly VIDEOS_RECORD: {
37
+ readonly pageUrl: PageUrl.RECORD;
38
+ readonly pageLocation: PageLocation.RECORD;
39
+ readonly pageSection: PageSection.RECORDER;
40
+ };
41
+ readonly VIDEOS_RECORDER: {
42
+ readonly pageUrl: PageUrl.RECORD;
43
+ readonly pageLocation: PageLocation.RECORD;
44
+ readonly pageSection: PageSection.RECORDER;
45
+ };
46
+ readonly RECORD_VIDEOS_DETAILS: {
47
+ readonly pageUrl: PageUrl.RECORD;
48
+ readonly pageLocation: PageLocation.RECORD;
49
+ readonly pageSection: PageSection.DETAILS;
50
+ };
51
+ readonly VIDEOS_VOICE_RECORDER: {
52
+ readonly pageUrl: PageUrl.VOICE_RECORDER;
53
+ readonly pageSection: PageLocation.DETAILS;
54
+ readonly pageLocation: PageSection.VOICE_RECORDER;
55
+ };
56
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-covideo-embed",
3
- "version": "1.0.60",
3
+ "version": "1.0.62",
4
4
  "private": false,
5
5
  "description": "Covideo platform as an embeddable React component.",
6
6
  "main": "./build/index.js",
@@ -1,3 +0,0 @@
1
- export declare function useGoogleTagManager({ gtmId }: {
2
- gtmId?: string;
3
- }): void;
@@ -1,29 +0,0 @@
1
- import { VideoListItem } from 'lib/api';
2
- import { CreateVideoResponse } from 'lib/api/videos/useCreateVideoMutation';
3
- import { UserData } from 'lib/context';
4
- declare global {
5
- interface Window {
6
- dataLayer?: any[];
7
- }
8
- }
9
- export declare function pushToDataLayer(event: Record<string, any>, userData: UserData): void;
10
- export declare function trackInsertVideoMessage({ video, landingPage, callToActions, vin, userData, eventName, }: {
11
- video: VideoListItem;
12
- landingPage: string;
13
- callToActions: string;
14
- eventName: 'Insert Video Message' | 'Copy Video Message';
15
- vin: string;
16
- userData: UserData;
17
- }): Promise<void>;
18
- export declare function trackVideoInteraction(video: VideoListItem, videoAction: 'Insert' | 'Copy Video URL' | 'Voice Recorder', userData: UserData): Promise<void>;
19
- export declare function trackPageView({ pageUrl, userData, }: {
20
- pageUrl: string;
21
- userData: UserData;
22
- }): void;
23
- export declare function trackSaveVideo({ userData, creationType, video, mergeIds, payload, }: {
24
- userData: UserData;
25
- video?: VideoListItem | CreateVideoResponse;
26
- mergeIds?: number[];
27
- creationType: 'Merged' | 'Recorded' | 'Uploaded' | 'Voiceover';
28
- payload?: Record<string, any>;
29
- }): Promise<void>;