@magicfeedback/popup-sdk 1.22.1 → 1.23.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.
Files changed (44) hide show
  1. package/README.md +8 -2
  2. package/dist/2.2.47-BYEZ6PUX.mjs +2428 -0
  3. package/dist/2.2.47-BYEZ6PUX.mjs.map +1 -0
  4. package/dist/2.2.47-ZZQRJNYY.mjs +2428 -0
  5. package/dist/2.2.47-ZZQRJNYY.mjs.map +1 -0
  6. package/dist/assets/assets/style.css +8 -1
  7. package/dist/assets/assets/survey-css/2.2.47.css +2420 -0
  8. package/dist/{chunk-5UURWEOR.mjs → chunk-7PNQVCOR.mjs} +156 -5
  9. package/dist/chunk-7PNQVCOR.mjs.map +1 -0
  10. package/dist/{chunk-4TNJ2IBB.mjs → chunk-HDCZ2QGX.mjs} +156 -5
  11. package/dist/chunk-HDCZ2QGX.mjs.map +1 -0
  12. package/dist/{chunk-6HPKIMVM.mjs → chunk-OXAYYIUH.mjs} +156 -5
  13. package/dist/chunk-OXAYYIUH.mjs.map +1 -0
  14. package/dist/index.d.mts +36 -0
  15. package/dist/index.d.ts +36 -0
  16. package/dist/index.js +4022 -1311
  17. package/dist/index.js.map +1 -1
  18. package/dist/index.mjs +125 -60
  19. package/dist/index.mjs.map +1 -1
  20. package/dist/index.native.d.mts +36 -0
  21. package/dist/index.native.d.ts +36 -0
  22. package/dist/index.native.js +4022 -1311
  23. package/dist/index.native.js.map +1 -1
  24. package/dist/index.native.mjs +125 -60
  25. package/dist/index.native.mjs.map +1 -1
  26. package/dist/react-native.d.mts +25 -0
  27. package/dist/react-native.d.ts +25 -0
  28. package/dist/react-native.js +2820 -181
  29. package/dist/react-native.js.map +1 -1
  30. package/dist/react-native.mjs +125 -60
  31. package/dist/react-native.mjs.map +1 -1
  32. package/dist/{renderPopup-SFDIFFUT.mjs → renderPopup-I565DNZX.mjs} +18 -29
  33. package/dist/renderPopup-I565DNZX.mjs.map +1 -0
  34. package/dist/{renderPopup-L5TROMDQ.mjs → renderPopup-KWAMONIN.mjs} +1210 -1149
  35. package/dist/renderPopup-KWAMONIN.mjs.map +1 -0
  36. package/dist/{renderPopup-UXD7L3FX.mjs → renderPopup-USTJXQJ6.mjs} +1210 -1149
  37. package/dist/renderPopup-USTJXQJ6.mjs.map +1 -0
  38. package/package.json +2 -2
  39. package/dist/chunk-4TNJ2IBB.mjs.map +0 -1
  40. package/dist/chunk-5UURWEOR.mjs.map +0 -1
  41. package/dist/chunk-6HPKIMVM.mjs.map +0 -1
  42. package/dist/renderPopup-L5TROMDQ.mjs.map +0 -1
  43. package/dist/renderPopup-SFDIFFUT.mjs.map +0 -1
  44. package/dist/renderPopup-UXD7L3FX.mjs.map +0 -1
@@ -377,6 +377,13 @@ interface DeepdotsInitParams {
377
377
  * logged when `debug` is true.
378
378
  */
379
379
  analytics?: AnalyticsKeys;
380
+ /**
381
+ * Send analytics (events, crashes, page views) when the page runs on a local dev host
382
+ * (`localhost`, `*.localhost`, `127.x.x.x`, `0.0.0.0`, `::1`). Default `false`: there the
383
+ * analytics channel stays in dry-run, so local development does not land in your
384
+ * production project. Popups, surveys and answers work the same. Web only.
385
+ */
386
+ trackLocalhost?: boolean;
380
387
  /**
381
388
  * Called when the analytics channel opens or closes a session (needs `analytics`), with the
382
389
  * id the Deepdots API stores as `sdkSessionId` on the feedback the session becomes: send it
@@ -578,6 +585,16 @@ interface PopupFont {
578
585
  interface PopupStyle {
579
586
  theme: 'light' | 'dark';
580
587
  position: 'bottom' | 'bottom-right' | 'bottom-left' | 'top' | 'top-right' | 'top-left' | 'center';
588
+ /**
589
+ * Card size (DD-334). `regular` (default) is up to 600px wide; `small` up to 360px, for one
590
+ * short question that should not cover the page.
591
+ */
592
+ size?: 'small' | 'regular';
593
+ /**
594
+ * Cover the page with a backdrop and keep the clicks while the popup is open (DD-334).
595
+ * Default `false`. Ignored for `center`, which always blocks the page.
596
+ */
597
+ blockPage?: boolean;
581
598
  /** @deprecated Not used by the SDK; kept only for API compatibility */
582
599
  imageUrl?: string | null;
583
600
  /** Fuente personalizada. Si falta, se mantiene el comportamiento actual. */
@@ -962,6 +979,8 @@ declare class DeepdotsPopups {
962
979
  private engagement;
963
980
  /** Atributos internos del usuario identificado → POST /sdk/popups/contact. Null si no hay userId. */
964
981
  private contact;
982
+ /** DD-561: contact POST of `init()`, awaited (with a cap) by the popups GET. Null if none. */
983
+ private contactSync;
965
984
  /** Storage resuelto en init() (inyectado por el host o localStorage). Reusado al cambiar de usuario. */
966
985
  private storage;
967
986
  /** Marca si ya se inició la navegación manual (setScreen) — para RN sin History API. */
@@ -1332,6 +1351,12 @@ declare class DeepdotsPopups {
1332
1351
  private setDeferredExitQueue;
1333
1352
  /** Fetch al servidor para obtener popups. `null` si la carga falló (red, no-2xx, payload inválido). */
1334
1353
  private fetchPopupsFromServer;
1354
+ /**
1355
+ * DD-561: espera al POST de contact de `init()` antes del GET de popups, como mucho
1356
+ * `CONTACT_SYNC_TIMEOUT_MS`. Sin atributos nuevos la promesa ya está resuelta y no hay espera.
1357
+ * Nunca rechaza.
1358
+ */
1359
+ private waitForContactSync;
1335
1360
  /**
1336
1361
  * Envía los atributos de contact a la API (`POST /sdk/popups/contact`). Rechaza si no se
1337
1362
  * pudo enviar (sin red o respuesta no-2xx), para que `ContactManager` no guarde la caché
@@ -1506,6 +1531,10 @@ interface BuildSurveyHtmlOptions {
1506
1531
  */
1507
1532
  appearance?: Appearance;
1508
1533
  position?: 'bottom' | 'bottom-right' | 'bottom-left' | 'top' | 'top-right' | 'top-left' | 'center';
1534
+ /** Tamaño de la tarjeta (DD-334). Por defecto `regular`. */
1535
+ size?: 'small' | 'regular';
1536
+ /** Velo sobre la página con posiciones que no son `center` (DD-334). Por defecto `false`. */
1537
+ blockPage?: boolean;
1509
1538
  actions?: PopupActions;
1510
1539
  /**
1511
1540
  * Renderiza el "modal" del popup (tarjeta con fondo/sombra/bordes + overlay + posicionamiento).
@@ -1588,6 +1617,13 @@ interface PopupLabels {
1588
1617
  question: string;
1589
1618
  /** Separador del contador de progreso ("of" en `Question 2 of 5`). */
1590
1619
  of: string;
1620
+ /**
1621
+ * Contador en modo "Answered questions" (DD-210, `style.progressMode: "completed"`):
1622
+ * `{answered}` y `{total}` se sustituyen ("2 of 5 answered").
1623
+ */
1624
+ answeredOf: string;
1625
+ /** Igual, sin total (surveys dinámicos, cuyo total es solo un máximo): "2 answered". */
1626
+ answered: string;
1591
1627
  /** Distintivo de las preguntas de seguimiento dinámicas. */
1592
1628
  followUp: string;
1593
1629
  /** aria-label del botón de cerrar. */
@@ -377,6 +377,13 @@ interface DeepdotsInitParams {
377
377
  * logged when `debug` is true.
378
378
  */
379
379
  analytics?: AnalyticsKeys;
380
+ /**
381
+ * Send analytics (events, crashes, page views) when the page runs on a local dev host
382
+ * (`localhost`, `*.localhost`, `127.x.x.x`, `0.0.0.0`, `::1`). Default `false`: there the
383
+ * analytics channel stays in dry-run, so local development does not land in your
384
+ * production project. Popups, surveys and answers work the same. Web only.
385
+ */
386
+ trackLocalhost?: boolean;
380
387
  /**
381
388
  * Called when the analytics channel opens or closes a session (needs `analytics`), with the
382
389
  * id the Deepdots API stores as `sdkSessionId` on the feedback the session becomes: send it
@@ -578,6 +585,16 @@ interface PopupFont {
578
585
  interface PopupStyle {
579
586
  theme: 'light' | 'dark';
580
587
  position: 'bottom' | 'bottom-right' | 'bottom-left' | 'top' | 'top-right' | 'top-left' | 'center';
588
+ /**
589
+ * Card size (DD-334). `regular` (default) is up to 600px wide; `small` up to 360px, for one
590
+ * short question that should not cover the page.
591
+ */
592
+ size?: 'small' | 'regular';
593
+ /**
594
+ * Cover the page with a backdrop and keep the clicks while the popup is open (DD-334).
595
+ * Default `false`. Ignored for `center`, which always blocks the page.
596
+ */
597
+ blockPage?: boolean;
581
598
  /** @deprecated Not used by the SDK; kept only for API compatibility */
582
599
  imageUrl?: string | null;
583
600
  /** Fuente personalizada. Si falta, se mantiene el comportamiento actual. */
@@ -962,6 +979,8 @@ declare class DeepdotsPopups {
962
979
  private engagement;
963
980
  /** Atributos internos del usuario identificado → POST /sdk/popups/contact. Null si no hay userId. */
964
981
  private contact;
982
+ /** DD-561: contact POST of `init()`, awaited (with a cap) by the popups GET. Null if none. */
983
+ private contactSync;
965
984
  /** Storage resuelto en init() (inyectado por el host o localStorage). Reusado al cambiar de usuario. */
966
985
  private storage;
967
986
  /** Marca si ya se inició la navegación manual (setScreen) — para RN sin History API. */
@@ -1332,6 +1351,12 @@ declare class DeepdotsPopups {
1332
1351
  private setDeferredExitQueue;
1333
1352
  /** Fetch al servidor para obtener popups. `null` si la carga falló (red, no-2xx, payload inválido). */
1334
1353
  private fetchPopupsFromServer;
1354
+ /**
1355
+ * DD-561: espera al POST de contact de `init()` antes del GET de popups, como mucho
1356
+ * `CONTACT_SYNC_TIMEOUT_MS`. Sin atributos nuevos la promesa ya está resuelta y no hay espera.
1357
+ * Nunca rechaza.
1358
+ */
1359
+ private waitForContactSync;
1335
1360
  /**
1336
1361
  * Envía los atributos de contact a la API (`POST /sdk/popups/contact`). Rechaza si no se
1337
1362
  * pudo enviar (sin red o respuesta no-2xx), para que `ContactManager` no guarde la caché
@@ -1506,6 +1531,10 @@ interface BuildSurveyHtmlOptions {
1506
1531
  */
1507
1532
  appearance?: Appearance;
1508
1533
  position?: 'bottom' | 'bottom-right' | 'bottom-left' | 'top' | 'top-right' | 'top-left' | 'center';
1534
+ /** Tamaño de la tarjeta (DD-334). Por defecto `regular`. */
1535
+ size?: 'small' | 'regular';
1536
+ /** Velo sobre la página con posiciones que no son `center` (DD-334). Por defecto `false`. */
1537
+ blockPage?: boolean;
1509
1538
  actions?: PopupActions;
1510
1539
  /**
1511
1540
  * Renderiza el "modal" del popup (tarjeta con fondo/sombra/bordes + overlay + posicionamiento).
@@ -1588,6 +1617,13 @@ interface PopupLabels {
1588
1617
  question: string;
1589
1618
  /** Separador del contador de progreso ("of" en `Question 2 of 5`). */
1590
1619
  of: string;
1620
+ /**
1621
+ * Contador en modo "Answered questions" (DD-210, `style.progressMode: "completed"`):
1622
+ * `{answered}` y `{total}` se sustituyen ("2 of 5 answered").
1623
+ */
1624
+ answeredOf: string;
1625
+ /** Igual, sin total (surveys dinámicos, cuyo total es solo un máximo): "2 answered". */
1626
+ answered: string;
1591
1627
  /** Distintivo de las preguntas de seguimiento dinámicas. */
1592
1628
  followUp: string;
1593
1629
  /** aria-label del botón de cerrar. */