@cuekit-ai/react 1.3.2 → 1.3.4

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.mts CHANGED
@@ -254,21 +254,20 @@ declare const initWebRTCWithDeployedBackend: (apiKey: string, customConfig?: Par
254
254
  */
255
255
  declare const initWebRTC: (apiKey: string) => WebRTCServerConfig;
256
256
 
257
- type DOMNodeData = {
258
- hash: string;
259
- text: string;
260
- isClickable: boolean;
261
- componentType: string;
262
- children: DOMNodeData[];
263
- };
264
- type FullDOMStructure = {
265
- components: DOMNodeData[];
266
- };
257
+ interface InteractiveElementDto {
258
+ testID: string;
259
+ type: string;
260
+ textContent: string;
261
+ tags: string[];
262
+ }
263
+ interface DOMStructurePayload {
264
+ components: InteractiveElementDto[];
265
+ }
267
266
 
268
267
  /**
269
268
  * Capture the full DOM structure as a flat list of interactive elements
270
269
  */
271
- declare function captureFullDOMStructure(): FullDOMStructure;
270
+ declare function captureFullDOMStructure(): DOMStructurePayload;
272
271
  interface ElementAction {
273
272
  action_type: 'click' | 'navigate' | 'input' | 'focus' | 'toggle';
274
273
  target_element?: string;
@@ -276,6 +275,16 @@ interface ElementAction {
276
275
  instruction?: string;
277
276
  }
278
277
  declare function executeAction(action: ElementAction): boolean;
279
- declare function getFullDOMStructure(): FullDOMStructure;
278
+ declare function getFullDOMStructure(): DOMStructurePayload;
279
+
280
+ /**
281
+ * Generates a stable, unique 8-character ID for an interactive element.
282
+ *
283
+ * @param routePath The path of the current route (e.g., from useLocation().pathname).
284
+ * @param elementIdentifier A stable, developer-defined string that uniquely identifies
285
+ * the element within its dynamic context (e.g., `van-link-${van.id}`).
286
+ * @returns An 8-character hexadecimal string.
287
+ */
288
+ declare function generateDynamicId(routePath: string, elementIdentifier: string): string;
280
289
 
281
- export { BorderGlow, ChatPopup, type ChatPopupProps, CuekitProvider, type DOMNodeData, type ElementAction, type FullDOMStructure, InitCuekit, MicButton, type MicButtonProps, type MicState$1 as MicState, type NavigationCommand, type ServerConfig, type TokenRequest, type TokenResponse, VoiceIntensityVisualizer, type WebRTCServerConfig, captureFullDOMStructure, configureWebRTCServer, executeAction, getFullDOMStructure, getWebRTCServerConfig, initWebRTC, initWebRTCWithDeployedBackend, useCuekit, useQubeContext, useWebRTC };
290
+ export { BorderGlow, ChatPopup, type ChatPopupProps, CuekitProvider, type DOMStructurePayload, type ElementAction, InitCuekit, type InteractiveElementDto, MicButton, type MicButtonProps, type MicState$1 as MicState, type NavigationCommand, type ServerConfig, type TokenRequest, type TokenResponse, VoiceIntensityVisualizer, type WebRTCServerConfig, captureFullDOMStructure, configureWebRTCServer, executeAction, generateDynamicId, getFullDOMStructure, getWebRTCServerConfig, initWebRTC, initWebRTCWithDeployedBackend, useCuekit, useQubeContext, useWebRTC };
package/dist/index.d.ts CHANGED
@@ -254,21 +254,20 @@ declare const initWebRTCWithDeployedBackend: (apiKey: string, customConfig?: Par
254
254
  */
255
255
  declare const initWebRTC: (apiKey: string) => WebRTCServerConfig;
256
256
 
257
- type DOMNodeData = {
258
- hash: string;
259
- text: string;
260
- isClickable: boolean;
261
- componentType: string;
262
- children: DOMNodeData[];
263
- };
264
- type FullDOMStructure = {
265
- components: DOMNodeData[];
266
- };
257
+ interface InteractiveElementDto {
258
+ testID: string;
259
+ type: string;
260
+ textContent: string;
261
+ tags: string[];
262
+ }
263
+ interface DOMStructurePayload {
264
+ components: InteractiveElementDto[];
265
+ }
267
266
 
268
267
  /**
269
268
  * Capture the full DOM structure as a flat list of interactive elements
270
269
  */
271
- declare function captureFullDOMStructure(): FullDOMStructure;
270
+ declare function captureFullDOMStructure(): DOMStructurePayload;
272
271
  interface ElementAction {
273
272
  action_type: 'click' | 'navigate' | 'input' | 'focus' | 'toggle';
274
273
  target_element?: string;
@@ -276,6 +275,16 @@ interface ElementAction {
276
275
  instruction?: string;
277
276
  }
278
277
  declare function executeAction(action: ElementAction): boolean;
279
- declare function getFullDOMStructure(): FullDOMStructure;
278
+ declare function getFullDOMStructure(): DOMStructurePayload;
279
+
280
+ /**
281
+ * Generates a stable, unique 8-character ID for an interactive element.
282
+ *
283
+ * @param routePath The path of the current route (e.g., from useLocation().pathname).
284
+ * @param elementIdentifier A stable, developer-defined string that uniquely identifies
285
+ * the element within its dynamic context (e.g., `van-link-${van.id}`).
286
+ * @returns An 8-character hexadecimal string.
287
+ */
288
+ declare function generateDynamicId(routePath: string, elementIdentifier: string): string;
280
289
 
281
- export { BorderGlow, ChatPopup, type ChatPopupProps, CuekitProvider, type DOMNodeData, type ElementAction, type FullDOMStructure, InitCuekit, MicButton, type MicButtonProps, type MicState$1 as MicState, type NavigationCommand, type ServerConfig, type TokenRequest, type TokenResponse, VoiceIntensityVisualizer, type WebRTCServerConfig, captureFullDOMStructure, configureWebRTCServer, executeAction, getFullDOMStructure, getWebRTCServerConfig, initWebRTC, initWebRTCWithDeployedBackend, useCuekit, useQubeContext, useWebRTC };
290
+ export { BorderGlow, ChatPopup, type ChatPopupProps, CuekitProvider, type DOMStructurePayload, type ElementAction, InitCuekit, type InteractiveElementDto, MicButton, type MicButtonProps, type MicState$1 as MicState, type NavigationCommand, type ServerConfig, type TokenRequest, type TokenResponse, VoiceIntensityVisualizer, type WebRTCServerConfig, captureFullDOMStructure, configureWebRTCServer, executeAction, generateDynamicId, getFullDOMStructure, getWebRTCServerConfig, initWebRTC, initWebRTCWithDeployedBackend, useCuekit, useQubeContext, useWebRTC };