@revrag-ai/embed-react-native 1.0.16 → 1.0.17

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 (93) hide show
  1. package/README.md +6 -108
  2. package/dist/commonjs/api/api.js +6 -5
  3. package/dist/commonjs/api/api.js.map +1 -1
  4. package/dist/commonjs/components/Embed/EmbedButton.js +138 -345
  5. package/dist/commonjs/components/Embed/EmbedButton.js.map +1 -1
  6. package/dist/commonjs/components/Embed/EmbedVoice.js +16 -4
  7. package/dist/commonjs/components/Embed/EmbedVoice.js.map +1 -1
  8. package/dist/commonjs/context/EmbedProvider.js +638 -0
  9. package/dist/commonjs/context/EmbedProvider.js.map +1 -0
  10. package/dist/commonjs/events/embed.event.js +141 -54
  11. package/dist/commonjs/events/embed.event.js.map +1 -1
  12. package/dist/commonjs/hooks/EmbedButton.animations.js +181 -0
  13. package/dist/commonjs/hooks/EmbedButton.animations.js.map +1 -0
  14. package/dist/commonjs/hooks/EmbedButton.helpers.js +90 -0
  15. package/dist/commonjs/hooks/EmbedButton.helpers.js.map +1 -0
  16. package/dist/commonjs/hooks/EmbedButton.hooks.js +165 -0
  17. package/dist/commonjs/hooks/EmbedButton.hooks.js.map +1 -0
  18. package/dist/commonjs/hooks/initialize.js +65 -25
  19. package/dist/commonjs/hooks/initialize.js.map +1 -1
  20. package/dist/commonjs/hooks/voiceagent.js +1 -18
  21. package/dist/commonjs/hooks/voiceagent.js.map +1 -1
  22. package/dist/commonjs/index.js +16 -1
  23. package/dist/commonjs/index.js.map +1 -1
  24. package/dist/commonjs/index.types.js +1 -2
  25. package/dist/commonjs/index.types.js.map +1 -1
  26. package/dist/commonjs/utils/constant.js +88 -0
  27. package/dist/commonjs/utils/constant.js.map +1 -0
  28. package/dist/commonjs/utils/reanimated.helper.js +2 -3
  29. package/dist/commonjs/utils/reanimated.helper.js.map +1 -1
  30. package/dist/module/api/api.js +6 -6
  31. package/dist/module/api/api.js.map +1 -1
  32. package/dist/module/components/Embed/EmbedButton.js +140 -347
  33. package/dist/module/components/Embed/EmbedButton.js.map +1 -1
  34. package/dist/module/components/Embed/EmbedVoice.js +16 -4
  35. package/dist/module/components/Embed/EmbedVoice.js.map +1 -1
  36. package/dist/module/context/EmbedProvider.js +626 -0
  37. package/dist/module/context/EmbedProvider.js.map +1 -0
  38. package/dist/module/events/embed.event.js +143 -53
  39. package/dist/module/events/embed.event.js.map +1 -1
  40. package/dist/module/hooks/EmbedButton.animations.js +172 -0
  41. package/dist/module/hooks/EmbedButton.animations.js.map +1 -0
  42. package/dist/module/hooks/EmbedButton.helpers.js +80 -0
  43. package/dist/module/hooks/EmbedButton.helpers.js.map +1 -0
  44. package/dist/module/hooks/EmbedButton.hooks.js +160 -0
  45. package/dist/module/hooks/EmbedButton.hooks.js.map +1 -0
  46. package/dist/module/hooks/initialize.js +66 -26
  47. package/dist/module/hooks/initialize.js.map +1 -1
  48. package/dist/module/hooks/voiceagent.js +1 -17
  49. package/dist/module/hooks/voiceagent.js.map +1 -1
  50. package/dist/module/index.js +4 -2
  51. package/dist/module/index.js.map +1 -1
  52. package/dist/module/index.types.js +1 -2
  53. package/dist/module/index.types.js.map +1 -1
  54. package/dist/module/utils/constant.js +82 -0
  55. package/dist/module/utils/constant.js.map +1 -0
  56. package/dist/module/utils/reanimated.helper.js +2 -3
  57. package/dist/module/utils/reanimated.helper.js.map +1 -1
  58. package/dist/typescript/src/api/api.d.ts +4 -3
  59. package/dist/typescript/src/api/api.d.ts.map +1 -1
  60. package/dist/typescript/src/api/types/embed.api.types.d.ts +1 -1
  61. package/dist/typescript/src/api/types/embed.api.types.d.ts.map +1 -1
  62. package/dist/typescript/src/components/Embed/EmbedButton.d.ts +5 -25
  63. package/dist/typescript/src/components/Embed/EmbedButton.d.ts.map +1 -1
  64. package/dist/typescript/src/components/Embed/EmbedVoice.d.ts.map +1 -1
  65. package/dist/typescript/src/context/EmbedProvider.d.ts +306 -0
  66. package/dist/typescript/src/context/EmbedProvider.d.ts.map +1 -0
  67. package/dist/typescript/src/events/embed.event.d.ts +74 -10
  68. package/dist/typescript/src/events/embed.event.d.ts.map +1 -1
  69. package/dist/typescript/src/hooks/EmbedButton.animations.d.ts +38 -0
  70. package/dist/typescript/src/hooks/EmbedButton.animations.d.ts.map +1 -0
  71. package/dist/typescript/src/hooks/EmbedButton.helpers.d.ts +49 -0
  72. package/dist/typescript/src/hooks/EmbedButton.helpers.d.ts.map +1 -0
  73. package/dist/typescript/src/hooks/EmbedButton.hooks.d.ts +49 -0
  74. package/dist/typescript/src/hooks/EmbedButton.hooks.d.ts.map +1 -0
  75. package/dist/typescript/src/hooks/initialize.d.ts.map +1 -1
  76. package/dist/typescript/src/hooks/types/initialize.types.d.ts +1 -1
  77. package/dist/typescript/src/hooks/types/initialize.types.d.ts.map +1 -1
  78. package/dist/typescript/src/hooks/voiceagent.d.ts.map +1 -1
  79. package/dist/typescript/src/index.d.ts +10 -4
  80. package/dist/typescript/src/index.d.ts.map +1 -1
  81. package/dist/typescript/src/index.types.d.ts +2 -3
  82. package/dist/typescript/src/index.types.d.ts.map +1 -1
  83. package/dist/typescript/src/utils/constant.d.ts +45 -0
  84. package/dist/typescript/src/utils/constant.d.ts.map +1 -0
  85. package/dist/typescript/src/utils/reanimated.helper.d.ts.map +1 -1
  86. package/package.json +6 -3
  87. package/react-native.config.js +1 -0
  88. package/dist/commonjs/events/eventEmitter.js +0 -43
  89. package/dist/commonjs/events/eventEmitter.js.map +0 -1
  90. package/dist/module/events/eventEmitter.js +0 -39
  91. package/dist/module/events/eventEmitter.js.map +0 -1
  92. package/dist/typescript/src/events/eventEmitter.d.ts +0 -9
  93. package/dist/typescript/src/events/eventEmitter.d.ts.map +0 -1
@@ -0,0 +1,626 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * @file EmbedProvider.tsx
5
+ * @description Core provider component for the Embed React Native library.
6
+ *
7
+ * This provider:
8
+ * - Tracks navigation state and screen changes
9
+ * - Conditionally renders the EmbedButton based on current screen
10
+ * - Provides utilities for extracting navigation hierarchy information
11
+ * - Manages event tracking integration with the Embed system
12
+ *
13
+ * @module EmbedProvider
14
+ */
15
+
16
+ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
17
+ import { EmbedButton } from "../components/Embed/EmbedButton.js";
18
+ import Embed, { EventKeys } from "../events/embed.event.js";
19
+
20
+ /* ============================================================================
21
+ * TYPE DEFINITIONS
22
+ * ========================================================================== */
23
+
24
+ /**
25
+ * Props for the EmbedProvider component
26
+ * @interface EmbedProviderProps
27
+ */
28
+
29
+ /**
30
+ * Represents the complete hierarchical structure of the current navigation state
31
+ * @interface RouteHierarchy
32
+ */
33
+
34
+ /**
35
+ * Represents a node in the navigation tree structure
36
+ * @interface NavigationTreeNode
37
+ */
38
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
39
+ /* ============================================================================
40
+ * CONSTANTS
41
+ * ========================================================================== */
42
+
43
+ /**
44
+ * Default list of screens where the EmbedButton should be displayed
45
+ * Used when no custom includeScreens prop is provided
46
+ * @constant
47
+ */
48
+ const DEFAULT_INCLUDED_SCREENS = [];
49
+
50
+ /**
51
+ * Delay before setting up navigation listener (allows navigation to stabilize)
52
+ * @constant
53
+ */
54
+ const NAVIGATION_LISTENER_DELAY = 1000;
55
+
56
+ /* ============================================================================
57
+ * UTILITY FUNCTIONS - NAVIGATION HIERARCHY
58
+ * ========================================================================== */
59
+
60
+ /**
61
+ * Extracts complete route hierarchy information from navigation state
62
+ *
63
+ * This function traverses the navigation state tree recursively to build
64
+ * a comprehensive hierarchy object containing the current screen, full path,
65
+ * depth, and route information at each level.
66
+ *
67
+ * @param {any} state - Navigation state from navigationRef.current?.getRootState()
68
+ * @returns {RouteHierarchy | null} Complete route hierarchy or null if state is invalid
69
+ *
70
+ * @example
71
+ * ```typescript
72
+ * const routeInfo = getRouteHierarchy(navigationRef.current?.getRootState());
73
+ * console.log(routeInfo);
74
+ * // {
75
+ * // currentScreen: "Product",
76
+ * // fullPath: "MainApp > Home > Product",
77
+ * // allRoutes: ["MainApp", "Home", "Product"],
78
+ * // depth: 3,
79
+ * // routesByLevel: { 0: "MainApp", 1: "Home", 2: "Product" },
80
+ * // parentRoute: "Home",
81
+ * // routeParams: { id: "123" }
82
+ * // }
83
+ * ```
84
+ */
85
+ export const getRouteHierarchy = state => {
86
+ if (!state) return null;
87
+ try {
88
+ const allRoutes = [];
89
+ const routesByLevel = {};
90
+ let currentRouteParams;
91
+
92
+ /**
93
+ * Recursively traverse the navigation state tree
94
+ * @param {any} currentState - Current state node
95
+ * @param {number} level - Current depth level (0 = root)
96
+ */
97
+ const traverse = (currentState, level = 0) => {
98
+ if (!currentState || typeof currentState.index !== 'number') return;
99
+ const route = currentState.routes?.[currentState.index];
100
+ if (!route || !route.name) return;
101
+ const routeName = route.name;
102
+ allRoutes.push(routeName);
103
+ routesByLevel[level] = routeName;
104
+
105
+ // Capture parameters if this is the deepest (active) route
106
+ if (!route.state && route.params) {
107
+ currentRouteParams = route.params;
108
+ }
109
+
110
+ // Recursively traverse nested navigation states
111
+ if (route.state) {
112
+ traverse(route.state, level + 1);
113
+ }
114
+ };
115
+
116
+ // Start traversal from root
117
+ traverse(state);
118
+
119
+ // Return null if no routes were found
120
+ if (allRoutes.length === 0) return null;
121
+
122
+ // Build the hierarchy object
123
+ const currentScreen = allRoutes[allRoutes.length - 1] || 'Unknown';
124
+ const parentRoute = allRoutes.length > 1 ? allRoutes[allRoutes.length - 2] : undefined;
125
+ const depth = allRoutes.length;
126
+ const fullPath = allRoutes.join(' > ');
127
+ return {
128
+ currentScreen,
129
+ fullPath,
130
+ allRoutes,
131
+ depth,
132
+ routesByLevel,
133
+ parentRoute,
134
+ routeParams: currentRouteParams
135
+ };
136
+ } catch (error) {
137
+ // Return null if any error occurs during traversal
138
+ return null;
139
+ }
140
+ };
141
+
142
+ /**
143
+ * Extracts ALL available routes (both mounted and defined) from navigation state
144
+ *
145
+ * This function traverses the navigation state and returns a flat array of:
146
+ * 1. Currently MOUNTED routes (routes that are rendered in the navigation tree)
147
+ * 2. DEFINED routes (from routeNames - routes that exist but may not be rendered yet)
148
+ *
149
+ * This is particularly useful because nested navigators (like tab navigators)
150
+ * won't appear in the state until you navigate to them, but their route names
151
+ * are still defined in the navigator configuration.
152
+ *
153
+ * @param {any} state - Navigation state from navigationRef.current?.getRootState()
154
+ * @returns {string[]} Array of unique route names
155
+ *
156
+ * @example
157
+ * ```typescript
158
+ * const allRoutes = getAllRoutes(navigationRef.current?.getRootState());
159
+ * console.log(allRoutes);
160
+ * // ["Splash", "Welcome", "MainApp", "Home", "Transactions", "Profile"]
161
+ *
162
+ * // Check if a specific route is available
163
+ * const hasProfileScreen = allRoutes.includes("Profile");
164
+ * ```
165
+ */
166
+ export const getAllRoutes = state => {
167
+ if (!state) return [];
168
+
169
+ // Use Set for O(1) lookup instead of O(n) with array.includes
170
+ const allRouteNamesSet = new Set();
171
+
172
+ /**
173
+ * Recursively collect route names from navigation state
174
+ * @param {any} currentState - Current state node
175
+ */
176
+ const collectRoutes = currentState => {
177
+ if (!currentState) return;
178
+
179
+ // Collect defined route names (ALL routes configured in the navigator)
180
+ if (currentState?.routeNames && Array.isArray(currentState.routeNames)) {
181
+ currentState.routeNames.forEach(routeName => {
182
+ if (routeName && typeof routeName === 'string') {
183
+ allRouteNamesSet.add(routeName);
184
+ }
185
+ });
186
+ }
187
+
188
+ // Collect mounted routes (currently rendered routes)
189
+ if (!currentState?.routes || !Array.isArray(currentState.routes)) return;
190
+ currentState.routes.forEach(route => {
191
+ if (route?.name && typeof route.name === 'string') {
192
+ allRouteNamesSet.add(route.name);
193
+ }
194
+
195
+ // Recursively check nested states (for mounted nested navigators)
196
+ if (route?.state) {
197
+ collectRoutes(route.state);
198
+ }
199
+ });
200
+ };
201
+ try {
202
+ collectRoutes(state);
203
+ } catch (error) {
204
+ // Fail silently and return empty array if state traversal fails
205
+ return [];
206
+ }
207
+ return Array.from(allRouteNamesSet);
208
+ };
209
+
210
+ /**
211
+ * Builds a complete navigation tree structure showing all routes and their relationships
212
+ *
213
+ * This function creates a hierarchical tree structure representing the entire
214
+ * navigation state, including all routes at all levels (not just the active path).
215
+ * Useful for visualizing or debugging your navigation structure.
216
+ *
217
+ * @param {any} state - Navigation state from navigationRef.current?.getRootState()
218
+ * @returns {NavigationTreeNode[]} Array of NavigationTreeNode representing the complete tree
219
+ *
220
+ * @example
221
+ * ```typescript
222
+ * const tree = getNavigationTree(navigationRef.current?.getRootState());
223
+ * console.log(JSON.stringify(tree, null, 2));
224
+ *
225
+ * // Example output:
226
+ * // [
227
+ * // {
228
+ * // "name": "MainApp",
229
+ * // "level": 0,
230
+ * // "children": [
231
+ * // {
232
+ * // "name": "Home",
233
+ * // "level": 1,
234
+ * // "children": [
235
+ * // { "name": "HomeMain", "level": 2 },
236
+ * // { "name": "Product", "level": 2, "params": { "id": "123" } }
237
+ * // ]
238
+ * // },
239
+ * // { "name": "Profile", "level": 1 }
240
+ * // ]
241
+ * // }
242
+ * // ]
243
+ * ```
244
+ */
245
+ export const getNavigationTree = state => {
246
+ if (!state) return [];
247
+
248
+ /**
249
+ * Recursively build the navigation tree
250
+ * @param {any} currentState - Current state node
251
+ * @param {number} level - Current depth level (0 = root)
252
+ * @returns {NavigationTreeNode[]} Array of tree nodes
253
+ */
254
+ const buildTree = (currentState, level = 0) => {
255
+ if (!currentState?.routes || !Array.isArray(currentState.routes)) {
256
+ return [];
257
+ }
258
+ return currentState.routes.filter(route => route && route.name).map(route => {
259
+ const node = {
260
+ name: route.name,
261
+ level,
262
+ params: route.params
263
+ };
264
+
265
+ // Recursively build children if nested state exists
266
+ if (route.state) {
267
+ node.children = buildTree(route.state, level + 1);
268
+ }
269
+ return node;
270
+ });
271
+ };
272
+ try {
273
+ return buildTree(state);
274
+ } catch (error) {
275
+ // Return empty array if tree building fails
276
+ return [];
277
+ }
278
+ };
279
+
280
+ /**
281
+ * Legacy alias for getAllRoutes()
282
+ * @deprecated Use getAllRoutes() instead
283
+ *
284
+ * Note: React Navigation limitation - nested navigator routes (like tabs inside a stack)
285
+ * only appear in the state AFTER they're mounted/rendered.
286
+ *
287
+ * @param {any} state - Navigation state
288
+ * @returns {string[]} Array of route names
289
+ */
290
+ export const getAllDefinedRoutes = state => {
291
+ return getAllRoutes(state);
292
+ };
293
+
294
+ /* ============================================================================
295
+ * UTILITY FUNCTIONS - APP VERSION
296
+ * ========================================================================== */
297
+
298
+ /**
299
+ * Interface for app version information
300
+ * @interface AppVersionInfo
301
+ */
302
+
303
+ /* ============================================================================
304
+ * UTILITY FUNCTIONS - EVENT TRACKING
305
+ * ========================================================================== */
306
+
307
+ /**
308
+ * Track custom events with the Embed system
309
+ *
310
+ * This function provides a simple interface to send custom event data
311
+ * to the Embed analytics system. All errors are caught and handled silently
312
+ * to prevent analytics issues from affecting app functionality.
313
+ *
314
+ * @param {string} eventName - Name of the event to track
315
+ * @param {Record<string, any>} properties - Event properties/metadata (optional)
316
+ *
317
+ * @example
318
+ * ```typescript
319
+ * // Track a button click
320
+ * trackEmbedEvent('button_clicked', {
321
+ * buttonId: 'submit_form',
322
+ * screenName: 'Profile',
323
+ * });
324
+ *
325
+ * // Track a purchase
326
+ * trackEmbedEvent('purchase_completed', {
327
+ * amount: 99.99,
328
+ * currency: 'USD',
329
+ * items: ['item1', 'item2'],
330
+ * });
331
+ * ```
332
+ */
333
+ export const trackEmbedEvent = (eventName, properties = {}) => {
334
+ try {
335
+ Embed.Event(EventKeys.FORM_STATE, {
336
+ type: 'custom_event',
337
+ eventName,
338
+ properties,
339
+ timestamp: new Date().toISOString()
340
+ });
341
+ } catch (error) {
342
+ // Fail silently - analytics errors should not break the app
343
+ // You could log to a monitoring service here if needed
344
+ }
345
+ };
346
+
347
+ /**
348
+ * Track rage clicks (repeated rapid clicks indicating user frustration)
349
+ *
350
+ * Rage clicks are detected when a user clicks the same element multiple times
351
+ * in rapid succession, which can indicate frustration with unresponsive UI.
352
+ * This data helps identify problem areas in the user experience.
353
+ *
354
+ * @param {string} elementId - Unique identifier of the clicked element
355
+ * @param {string} elementType - Type of element (e.g., 'button', 'link', 'text')
356
+ * @param {{ x: number; y: number }} coordinates - Screen coordinates of the clicks
357
+ * @param {number} clickCount - Number of rapid clicks detected
358
+ *
359
+ * @example
360
+ * ```typescript
361
+ * trackRageClick('submit_button', 'button', { x: 100, y: 200 }, 5);
362
+ * ```
363
+ */
364
+ export const trackRageClick = (elementId, elementType, coordinates, clickCount) => {
365
+ try {
366
+ const eventData = {
367
+ type: 'rage_click',
368
+ elementId,
369
+ elementType,
370
+ coordinates,
371
+ clickCount,
372
+ timestamp: new Date().toISOString()
373
+ };
374
+ Embed.Event(EventKeys.FORM_STATE, eventData);
375
+ } catch (error) {
376
+ // Fail silently - analytics errors should not break the app
377
+ }
378
+ };
379
+
380
+ /**
381
+ * Track form-related events (changes, submissions, errors)
382
+ *
383
+ * This function tracks various form interactions to help understand
384
+ * user behavior and identify potential issues in form flows.
385
+ *
386
+ * @param {string} formId - Unique identifier of the form
387
+ * @param {'form_change' | 'form_submit' | 'form_error'} eventType - Type of form event
388
+ * @param {Record<string, any>} formData - Form data/metadata (optional)
389
+ *
390
+ * @example
391
+ * ```typescript
392
+ * // Track form field change
393
+ * trackFormEvent('signup_form', 'form_change', {
394
+ * field: 'email',
395
+ * value: 'user@example.com',
396
+ * });
397
+ *
398
+ * // Track form submission
399
+ * trackFormEvent('signup_form', 'form_submit', {
400
+ * success: true,
401
+ * userId: '12345',
402
+ * });
403
+ *
404
+ * // Track form error
405
+ * trackFormEvent('signup_form', 'form_error', {
406
+ * field: 'password',
407
+ * error: 'Password too short',
408
+ * });
409
+ * ```
410
+ */
411
+ export const trackFormEvent = (formId, eventType, formData = {}) => {
412
+ try {
413
+ const eventData = {
414
+ type: eventType,
415
+ formId,
416
+ formData,
417
+ timestamp: new Date().toISOString()
418
+ };
419
+ Embed.Event(EventKeys.FORM_STATE, eventData);
420
+ } catch (error) {
421
+ // Fail silently - analytics errors should not break the app
422
+ }
423
+ };
424
+
425
+ /* ============================================================================
426
+ * MAIN COMPONENT
427
+ * ========================================================================== */
428
+
429
+ /**
430
+ * EmbedProvider Component
431
+ *
432
+ * Core provider component that wraps your application to enable Embed functionality.
433
+ * This provider:
434
+ * - Monitors navigation state changes
435
+ * - Automatically shows/hides the EmbedButton based on current screen
436
+ * - Tracks screen views and navigation hierarchy
437
+ * - Integrates with the Embed analytics system
438
+ *
439
+ * @param {EmbedProviderProps} props - Component props
440
+ * @returns {JSX.Element} Provider component with children and conditional EmbedButton
441
+ *
442
+ * @example
443
+ * ```typescript
444
+ * import { NavigationContainer } from '@react-navigation/native';
445
+ * import { EmbedProvider } from '@revrag/embed-react-native';
446
+ * import { useRef } from 'react';
447
+ *
448
+ * function App() {
449
+ * const navigationRef = useRef<NavigationContainerRef<any>>(null);
450
+ *
451
+ * return (
452
+ * // IMPORTANT: EmbedProvider must WRAP NavigationContainer
453
+ * <EmbedProvider
454
+ * navigationRef={navigationRef}
455
+ * includeScreens={['Home', 'Profile', 'Dashboard']}
456
+ * >
457
+ * <NavigationContainer ref={navigationRef}>
458
+ * {/* Your navigation stack *\/}
459
+ * </NavigationContainer>
460
+ * </EmbedProvider>
461
+ * );
462
+ * }
463
+ * ```
464
+ */
465
+ export const EmbedProvider = ({
466
+ children,
467
+ navigationRef,
468
+ includeScreens = DEFAULT_INCLUDED_SCREENS,
469
+ appVersion: _appVersion
470
+ }) => {
471
+ // ========== Refs ==========
472
+
473
+ /**
474
+ * Navigation reference - use provided ref or create a default one
475
+ * This allows the provider to work both with and without an external navigation ref
476
+ * Note: Using useRef instead of createRef to maintain same ref across renders
477
+ */
478
+ const defaultNavRef = useRef(null);
479
+ const navRef = navigationRef || defaultNavRef;
480
+
481
+ /**
482
+ * Track if component is mounted to prevent state updates after unmount
483
+ */
484
+ const isMountedRef = useRef(true);
485
+
486
+ // ========== State ==========
487
+
488
+ /** Whether the EmbedButton should be visible on the current screen */
489
+ const [showEmbedButton, setShowEmbedButton] = useState(false);
490
+
491
+ // ========== Memoized Values ==========
492
+
493
+ /**
494
+ * Included screens (from prop)
495
+ * Memoized to prevent recalculation on every render and filter falsy values
496
+ */
497
+ const allIncludedScreens = useMemo(() => {
498
+ return Array.from(new Set(includeScreens.filter(Boolean)));
499
+ }, [includeScreens]);
500
+
501
+ // ========== Effects ==========
502
+
503
+ /**
504
+ * Memoized callback for tracking screen changes
505
+ * Uses useCallback to maintain stable reference and prevent unnecessary re-renders
506
+ */
507
+ const trackScreen = useCallback(async () => {
508
+ try {
509
+ // Safety check: Ensure navigation ref is available
510
+ if (!navRef.current) {
511
+ return;
512
+ }
513
+ const state = navRef.current.getRootState();
514
+ if (!state) {
515
+ return;
516
+ }
517
+ const routeInfo = getRouteHierarchy(state);
518
+ // Extract current screen name from navigation state
519
+ const screenName = routeInfo?.currentScreen || navRef.current.getCurrentRoute()?.name || '';
520
+
521
+ // Determine if EmbedButton should be visible
522
+ // Show button only on screens specified in includeScreens (prop + backend)
523
+ const hasIncludeFilter = allIncludedScreens.length > 0;
524
+ const isIncluded = allIncludedScreens.includes(screenName);
525
+ const shouldShowButton = screenName !== '' && (!hasIncludeFilter || isIncluded);
526
+ // Only update state if component is still mounted
527
+ if (isMountedRef.current) {
528
+ setShowEmbedButton(shouldShowButton);
529
+ }
530
+
531
+ // Track screen view event (if route info is available)
532
+ if (routeInfo) {
533
+ try {
534
+ // TODO: Uncomment when ready to enable screen view tracking
535
+ Embed.Event(EventKeys.FORM_STATE, {
536
+ type: 'screen_view',
537
+ ...routeInfo,
538
+ screen: routeInfo.currentScreen,
539
+ // allAvailableRoutes: allRoutes,
540
+ app_version: _appVersion,
541
+ timestamp: new Date().toISOString()
542
+ });
543
+ } catch (error) {
544
+ // Silently fail - analytics should not break the app
545
+ }
546
+ }
547
+ } catch (error) {
548
+ // Catch-all error handler to prevent any tracking errors from breaking the app
549
+ }
550
+ }, [navRef, allIncludedScreens, _appVersion]);
551
+
552
+ /**
553
+ * Effect: Navigation State Tracking
554
+ *
555
+ * Sets up listeners for navigation state changes and tracks:
556
+ * - Current screen name
557
+ * - Route hierarchy
558
+ * - Screen view events
559
+ * - EmbedButton visibility
560
+ */
561
+ useEffect(() => {
562
+ // Validate navigation ref
563
+ if (!navRef) {
564
+ return;
565
+ }
566
+ let unsubscribe;
567
+ let delayTimer;
568
+
569
+ /**
570
+ * Set up navigation state listener
571
+ */
572
+ const setupListener = () => {
573
+ // Only set up if navigation ref is ready
574
+ if (navRef.current) {
575
+ unsubscribe = navRef.current.addListener('state', trackScreen);
576
+ trackScreen(); // Track initial screen immediately
577
+ }
578
+ };
579
+
580
+ // Set up listener immediately for quick feedback
581
+ setupListener();
582
+
583
+ // Also set up after delay in case navigation wasn't ready
584
+ delayTimer = setTimeout(() => {
585
+ if (!unsubscribe && navRef.current) {
586
+ setupListener();
587
+ }
588
+ }, NAVIGATION_LISTENER_DELAY);
589
+
590
+ // Cleanup function
591
+ return () => {
592
+ if (delayTimer) {
593
+ clearTimeout(delayTimer);
594
+ }
595
+ if (unsubscribe) {
596
+ unsubscribe();
597
+ }
598
+ };
599
+ }, [navRef, trackScreen]);
600
+
601
+ /**
602
+ * Effect: Component Lifecycle Management
603
+ *
604
+ * Tracks component mount/unmount state to prevent state updates after unmount
605
+ */
606
+ useEffect(() => {
607
+ isMountedRef.current = true;
608
+ return () => {
609
+ isMountedRef.current = false;
610
+ };
611
+ }, []);
612
+
613
+ // ========== Render ==========
614
+
615
+ return /*#__PURE__*/_jsxs(_Fragment, {
616
+ children: [children, showEmbedButton && /*#__PURE__*/_jsx(EmbedButton, {})]
617
+ });
618
+ };
619
+
620
+ /* ============================================================================
621
+ * EXPORTS
622
+ * ========================================================================== */
623
+
624
+ // Default export
625
+ export default EmbedProvider;
626
+ //# sourceMappingURL=EmbedProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useCallback","useEffect","useMemo","useRef","useState","EmbedButton","Embed","EventKeys","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","DEFAULT_INCLUDED_SCREENS","NAVIGATION_LISTENER_DELAY","getRouteHierarchy","state","allRoutes","routesByLevel","currentRouteParams","traverse","currentState","level","index","route","routes","name","routeName","push","params","length","currentScreen","parentRoute","undefined","depth","fullPath","join","routeParams","error","getAllRoutes","allRouteNamesSet","Set","collectRoutes","routeNames","Array","isArray","forEach","add","from","getNavigationTree","buildTree","filter","map","node","children","getAllDefinedRoutes","trackEmbedEvent","eventName","properties","Event","FORM_STATE","type","timestamp","Date","toISOString","trackRageClick","elementId","elementType","coordinates","clickCount","eventData","trackFormEvent","formId","eventType","formData","EmbedProvider","navigationRef","includeScreens","appVersion","_appVersion","defaultNavRef","navRef","isMountedRef","showEmbedButton","setShowEmbedButton","allIncludedScreens","Boolean","trackScreen","current","getRootState","routeInfo","screenName","getCurrentRoute","hasIncludeFilter","isIncluded","includes","shouldShowButton","screen","app_version","unsubscribe","delayTimer","setupListener","addListener","setTimeout","clearTimeout"],"sourceRoot":"../../../src","sources":["context/EmbedProvider.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAOA,KAAK,IACVC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,OAAO;AACd,SAASC,WAAW,QAAQ,oCAAiC;AAC7D,OAAOC,KAAK,IAAIC,SAAS,QAAQ,0BAAuB;;AAExD;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAyBA;AACA;AACA;AACA;;AAkBA;AACA;AACA;AACA;AAHA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAeA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMC,wBAAkC,GAAG,EAAE;;AAE7C;AACA;AACA;AACA;AACA,MAAMC,yBAAyB,GAAG,IAAI;;AAEtC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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