@magicfeedback/popup-sdk 1.3.0 → 1.5.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.
@@ -162,6 +162,29 @@ interface DeepdotsInitParams {
162
162
  * `setContactAttributes` after init (sends only when values changed from the last sync).
163
163
  */
164
164
  contactAttributes?: Record<string, string | number | boolean>;
165
+ /**
166
+ * Whether the SDK renders the popup "modal" (card + backdrop + positioning) around the survey.
167
+ * Default `true`. Only affects React Native (the survey WebView HTML); the web DOM popup is
168
+ * unaffected. With `false` the survey is delivered transparent and edge-to-edge so the host
169
+ * mounts its own Modal/container and controls the styling — avoids the "double modal" when the
170
+ * host already wraps the WebView. The survey stays fully functional (bridge, form, nav buttons,
171
+ * close). Ver `ReactNativePopupRenderer`.
172
+ */
173
+ renderChrome?: boolean;
174
+ /**
175
+ * Barra de progreso ("Question X of Y" + barra) en la cabecera del popup. Si se omite,
176
+ * manda el `showProgressBar` que la plataforma configura en el estilo del survey; `true` o
177
+ * `false` lo fuerzan desde el host. Solo se pinta con más de una página, fuera de la
178
+ * pantalla de inicio y antes de completar, igual que en la web de surveys.
179
+ */
180
+ showProgressBar?: boolean;
181
+ /**
182
+ * CSS propio del host, inyectado como último bloque de estilos del popup: gana en cascada
183
+ * sobre el del SDK y sobre el de `@magicfeedback/native` sin tener que tocar ninguno. Es la
184
+ * vía para reestilar el área de preguntas (enunciados, opciones, escalas) por integración,
185
+ * en vez de cambiar los defaults que comparten todos los clientes.
186
+ */
187
+ surveyCss?: string;
165
188
  }
166
189
  /**
167
190
  * Options for configuring survey triggers
@@ -239,11 +262,26 @@ interface PopupStyle {
239
262
  font?: PopupFont;
240
263
  }
241
264
 
265
+ /**
266
+ * Ajustes de presentación que no vienen del estilo del popup. Van agrupados para no seguir
267
+ * alargando la lista posicional de `show`, que ya arrastra doce parámetros.
268
+ */
269
+ interface PopupRenderOptions {
270
+ /**
271
+ * Título de la cabecera: el `title` de la definición del popup, tal cual llega de la API.
272
+ * Varía por popup y vacío es un valor válido (la cabecera se queda solo con la X).
273
+ */
274
+ title?: string;
275
+ /** Barra de progreso: `undefined` deja decidir a la plataforma, `true`/`false` la fuerzan. */
276
+ showProgressBar?: boolean;
277
+ /** CSS del host, inyectado el último: gana sobre el del SDK y el de `@magicfeedback/native`. */
278
+ surveyCss?: string;
279
+ }
242
280
  interface PopupRenderer {
243
281
  /** Preparar recursos si aplica */
244
282
  init?(): void;
245
283
  /** Mostrar popup */
246
- show(surveyId: string, productId: string, actions: PopupActions | undefined, emit: (type: DeepdotsEventType, surveyId: string, data?: Record<string, unknown>) => void, onClose: () => void, env?: string, userId?: string, style?: PopupStyle, sessionId?: string, miniService?: string, analyticsFeedbackSessionId?: string): void;
284
+ show(surveyId: string, productId: string, actions: PopupActions | undefined, emit: (type: DeepdotsEventType, surveyId: string, data?: Record<string, unknown>) => void, onClose: () => void, env?: string, userId?: string, style?: PopupStyle, sessionId?: string, miniService?: string, analyticsFeedbackSessionId?: string, renderChrome?: boolean, options?: PopupRenderOptions): void;
247
285
  /** Ocultar popup */
248
286
  hide(): void;
249
287
  }
@@ -323,6 +361,12 @@ declare class DeepdotsPopups {
323
361
  private deferredExitTimers;
324
362
  private baseUrl;
325
363
  private env;
364
+ /** Si el SDK pinta el "modal" del popup (RN). Default true; false = el host lo envuelve. */
365
+ private renderChrome;
366
+ /** Barra de progreso. undefined = la decide la plataforma (style.showProgressBar). */
367
+ private showProgressBar;
368
+ /** CSS del host inyectado al final de los estilos del popup. */
369
+ private surveyCss;
326
370
  /** Identidad + sesión (Fase 1 tracking). Null hasta init(). */
327
371
  private tracking;
328
372
  /** Capa de analytics (canal separado del feedback). Null hasta init(). */
@@ -394,6 +438,15 @@ declare class DeepdotsPopups {
394
438
  trackFindabilityFriction(frictionTopic: string, params?: Record<string, unknown>): void;
395
439
  /** Funnel: un paso del embudo, correlacionado por `taskId`. El backend reconstruye conversión/drop-off/tiempo. */
396
440
  trackFunnelStep(funnel: string, step: string, taskId: string, params?: Record<string, unknown>): void;
441
+ /**
442
+ * Product Effectiveness: una interacción significativa del usuario (`interaction_type` es la
443
+ * dimensión de agrupación, p. ej. `get_help`, `homepage`, `contact_support`).
444
+ *
445
+ * Existe como evento RESERVADO para que la convención no la invente cada host: un `track()`
446
+ * custom acaba como `deepdots_event_…` y no lo cuenta la analítica de effectiveness.
447
+ * Un `interactionType` vacío se descarta con warning (no aporta dato agrupable).
448
+ */
449
+ trackMeaningfulInteraction(interactionType: string, params?: Record<string, unknown>): void;
397
450
  /**
398
451
  * Messaging (#18–22): registra una etapa del funnel de una notificación (push/in-app).
399
452
  * No-op si tracking off. El evento se descarta (con warning) si el `channel` no es válido,
@@ -612,7 +665,7 @@ declare class ReactNativePopupRenderer implements PopupRenderer {
612
665
  private partialEmitted;
613
666
  constructor(options?: ReactNativeRendererOptions);
614
667
  init(): void;
615
- show(surveyId: string, productId: string, actions: PopupActions | undefined, emit: EmitFn, onClose: () => void, env?: string, userId?: string, style?: PopupStyle, sessionId?: string, miniService?: string, analyticsFeedbackSessionId?: string): void;
668
+ show(surveyId: string, productId: string, actions: PopupActions | undefined, emit: EmitFn, onClose: () => void, env?: string, userId?: string, style?: PopupStyle, sessionId?: string, miniService?: string, analyticsFeedbackSessionId?: string, renderChrome?: boolean, options?: PopupRenderOptions): void;
616
669
  hide(): void;
617
670
  /**
618
671
  * El host la conecta al `onMessage` del WebView. Traduce los mensajes del survey a
@@ -162,6 +162,29 @@ interface DeepdotsInitParams {
162
162
  * `setContactAttributes` after init (sends only when values changed from the last sync).
163
163
  */
164
164
  contactAttributes?: Record<string, string | number | boolean>;
165
+ /**
166
+ * Whether the SDK renders the popup "modal" (card + backdrop + positioning) around the survey.
167
+ * Default `true`. Only affects React Native (the survey WebView HTML); the web DOM popup is
168
+ * unaffected. With `false` the survey is delivered transparent and edge-to-edge so the host
169
+ * mounts its own Modal/container and controls the styling — avoids the "double modal" when the
170
+ * host already wraps the WebView. The survey stays fully functional (bridge, form, nav buttons,
171
+ * close). Ver `ReactNativePopupRenderer`.
172
+ */
173
+ renderChrome?: boolean;
174
+ /**
175
+ * Barra de progreso ("Question X of Y" + barra) en la cabecera del popup. Si se omite,
176
+ * manda el `showProgressBar` que la plataforma configura en el estilo del survey; `true` o
177
+ * `false` lo fuerzan desde el host. Solo se pinta con más de una página, fuera de la
178
+ * pantalla de inicio y antes de completar, igual que en la web de surveys.
179
+ */
180
+ showProgressBar?: boolean;
181
+ /**
182
+ * CSS propio del host, inyectado como último bloque de estilos del popup: gana en cascada
183
+ * sobre el del SDK y sobre el de `@magicfeedback/native` sin tener que tocar ninguno. Es la
184
+ * vía para reestilar el área de preguntas (enunciados, opciones, escalas) por integración,
185
+ * en vez de cambiar los defaults que comparten todos los clientes.
186
+ */
187
+ surveyCss?: string;
165
188
  }
166
189
  /**
167
190
  * Options for configuring survey triggers
@@ -239,11 +262,26 @@ interface PopupStyle {
239
262
  font?: PopupFont;
240
263
  }
241
264
 
265
+ /**
266
+ * Ajustes de presentación que no vienen del estilo del popup. Van agrupados para no seguir
267
+ * alargando la lista posicional de `show`, que ya arrastra doce parámetros.
268
+ */
269
+ interface PopupRenderOptions {
270
+ /**
271
+ * Título de la cabecera: el `title` de la definición del popup, tal cual llega de la API.
272
+ * Varía por popup y vacío es un valor válido (la cabecera se queda solo con la X).
273
+ */
274
+ title?: string;
275
+ /** Barra de progreso: `undefined` deja decidir a la plataforma, `true`/`false` la fuerzan. */
276
+ showProgressBar?: boolean;
277
+ /** CSS del host, inyectado el último: gana sobre el del SDK y el de `@magicfeedback/native`. */
278
+ surveyCss?: string;
279
+ }
242
280
  interface PopupRenderer {
243
281
  /** Preparar recursos si aplica */
244
282
  init?(): void;
245
283
  /** Mostrar popup */
246
- show(surveyId: string, productId: string, actions: PopupActions | undefined, emit: (type: DeepdotsEventType, surveyId: string, data?: Record<string, unknown>) => void, onClose: () => void, env?: string, userId?: string, style?: PopupStyle, sessionId?: string, miniService?: string, analyticsFeedbackSessionId?: string): void;
284
+ show(surveyId: string, productId: string, actions: PopupActions | undefined, emit: (type: DeepdotsEventType, surveyId: string, data?: Record<string, unknown>) => void, onClose: () => void, env?: string, userId?: string, style?: PopupStyle, sessionId?: string, miniService?: string, analyticsFeedbackSessionId?: string, renderChrome?: boolean, options?: PopupRenderOptions): void;
247
285
  /** Ocultar popup */
248
286
  hide(): void;
249
287
  }
@@ -323,6 +361,12 @@ declare class DeepdotsPopups {
323
361
  private deferredExitTimers;
324
362
  private baseUrl;
325
363
  private env;
364
+ /** Si el SDK pinta el "modal" del popup (RN). Default true; false = el host lo envuelve. */
365
+ private renderChrome;
366
+ /** Barra de progreso. undefined = la decide la plataforma (style.showProgressBar). */
367
+ private showProgressBar;
368
+ /** CSS del host inyectado al final de los estilos del popup. */
369
+ private surveyCss;
326
370
  /** Identidad + sesión (Fase 1 tracking). Null hasta init(). */
327
371
  private tracking;
328
372
  /** Capa de analytics (canal separado del feedback). Null hasta init(). */
@@ -394,6 +438,15 @@ declare class DeepdotsPopups {
394
438
  trackFindabilityFriction(frictionTopic: string, params?: Record<string, unknown>): void;
395
439
  /** Funnel: un paso del embudo, correlacionado por `taskId`. El backend reconstruye conversión/drop-off/tiempo. */
396
440
  trackFunnelStep(funnel: string, step: string, taskId: string, params?: Record<string, unknown>): void;
441
+ /**
442
+ * Product Effectiveness: una interacción significativa del usuario (`interaction_type` es la
443
+ * dimensión de agrupación, p. ej. `get_help`, `homepage`, `contact_support`).
444
+ *
445
+ * Existe como evento RESERVADO para que la convención no la invente cada host: un `track()`
446
+ * custom acaba como `deepdots_event_…` y no lo cuenta la analítica de effectiveness.
447
+ * Un `interactionType` vacío se descarta con warning (no aporta dato agrupable).
448
+ */
449
+ trackMeaningfulInteraction(interactionType: string, params?: Record<string, unknown>): void;
397
450
  /**
398
451
  * Messaging (#18–22): registra una etapa del funnel de una notificación (push/in-app).
399
452
  * No-op si tracking off. El evento se descarta (con warning) si el `channel` no es válido,
@@ -612,7 +665,7 @@ declare class ReactNativePopupRenderer implements PopupRenderer {
612
665
  private partialEmitted;
613
666
  constructor(options?: ReactNativeRendererOptions);
614
667
  init(): void;
615
- show(surveyId: string, productId: string, actions: PopupActions | undefined, emit: EmitFn, onClose: () => void, env?: string, userId?: string, style?: PopupStyle, sessionId?: string, miniService?: string, analyticsFeedbackSessionId?: string): void;
668
+ show(surveyId: string, productId: string, actions: PopupActions | undefined, emit: EmitFn, onClose: () => void, env?: string, userId?: string, style?: PopupStyle, sessionId?: string, miniService?: string, analyticsFeedbackSessionId?: string, renderChrome?: boolean, options?: PopupRenderOptions): void;
616
669
  hide(): void;
617
670
  /**
618
671
  * El host la conecta al `onMessage` del WebView. Traduce los mensajes del survey a