@magicfeedback/popup-sdk 1.21.0 → 1.22.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.
- package/README.md +1 -1
- package/dist/2.2.44-HO4Z2OYX.mjs +2421 -0
- package/dist/2.2.44-HO4Z2OYX.mjs.map +1 -0
- package/dist/2.2.44-NTG36TY5.mjs +2421 -0
- package/dist/2.2.44-NTG36TY5.mjs.map +1 -0
- package/dist/assets/assets/style.css +113 -36
- package/dist/assets/assets/survey-css/2.2.44.css +2413 -0
- package/dist/{chunk-BWYWXAIQ.mjs → chunk-36KEHE2P.mjs} +265 -40
- package/dist/chunk-36KEHE2P.mjs.map +1 -0
- package/dist/{chunk-H434NTBB.mjs → chunk-4MUHUL7W.mjs} +265 -40
- package/dist/chunk-4MUHUL7W.mjs.map +1 -0
- package/dist/{chunk-UBUY6G6Z.mjs → chunk-7PVEXIUG.mjs} +265 -40
- package/dist/chunk-7PVEXIUG.mjs.map +1 -0
- package/dist/index.d.mts +28 -1
- package/dist/index.d.ts +28 -1
- package/dist/index.js +4350 -1471
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +109 -32
- package/dist/index.mjs.map +1 -1
- package/dist/index.native.d.mts +28 -1
- package/dist/index.native.d.ts +28 -1
- package/dist/index.native.js +4367 -1481
- package/dist/index.native.js.map +1 -1
- package/dist/index.native.mjs +126 -42
- package/dist/index.native.mjs.map +1 -1
- package/dist/react-native.d.mts +22 -0
- package/dist/react-native.d.ts +22 -0
- package/dist/react-native.js +2999 -237
- package/dist/react-native.js.map +1 -1
- package/dist/react-native.mjs +126 -42
- package/dist/react-native.mjs.map +1 -1
- package/dist/renderPopup-5VVYPKXP.mjs +3998 -0
- package/dist/renderPopup-5VVYPKXP.mjs.map +1 -0
- package/dist/{renderPopup-VXKWSZ4E.mjs → renderPopup-I3LIC3W3.mjs} +67 -40
- package/dist/renderPopup-I3LIC3W3.mjs.map +1 -0
- package/dist/renderPopup-VS5XFGTI.mjs +3998 -0
- package/dist/renderPopup-VS5XFGTI.mjs.map +1 -0
- package/package.json +2 -2
- package/dist/chunk-BWYWXAIQ.mjs.map +0 -1
- package/dist/chunk-H434NTBB.mjs.map +0 -1
- package/dist/chunk-UBUY6G6Z.mjs.map +0 -1
- package/dist/renderPopup-HNSFPFVT.mjs +0 -3847
- package/dist/renderPopup-HNSFPFVT.mjs.map +0 -1
- package/dist/renderPopup-VXKWSZ4E.mjs.map +0 -1
- package/dist/renderPopup-WNF67H5T.mjs +0 -3847
- package/dist/renderPopup-WNF67H5T.mjs.map +0 -1
package/dist/react-native.mjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
+
APPEARANCE_JS,
|
|
2
3
|
BUNDLED_SURVEY_SDK_VERSION,
|
|
3
4
|
BUSY_JS,
|
|
5
|
+
CHROME_CONTRAST_JS,
|
|
4
6
|
LABELS,
|
|
5
7
|
PRIMARY_COLOR_JS,
|
|
6
8
|
RESOLVE_LOCALE_JS,
|
|
@@ -18,6 +20,7 @@ import {
|
|
|
18
20
|
describeSurveySdkChoice,
|
|
19
21
|
directionFor,
|
|
20
22
|
getLabels,
|
|
23
|
+
normalizeAppearance,
|
|
21
24
|
resolveActionLabels,
|
|
22
25
|
sdkLog,
|
|
23
26
|
sdkWarn,
|
|
@@ -25,7 +28,7 @@ import {
|
|
|
25
28
|
style_default,
|
|
26
29
|
surveySdkCssUrls,
|
|
27
30
|
surveySdkUrls
|
|
28
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-36KEHE2P.mjs";
|
|
29
32
|
import {
|
|
30
33
|
__require
|
|
31
34
|
} from "./chunk-BJTO5JO5.mjs";
|
|
@@ -276,7 +279,10 @@ function buildSurveyHtml(opts) {
|
|
|
276
279
|
const fontFaceCss = opts.font ? buildFontFaceCss(opts.font.family, opts.font.url) : "";
|
|
277
280
|
const fontFamilyValue = opts.font ? buildFontFamilyValue(opts.font.family) : "-apple-system,system-ui,sans-serif";
|
|
278
281
|
const popupClass = opts.font?.family ? "deepdots-popup deepdots-has-font" : "deepdots-popup";
|
|
279
|
-
const
|
|
282
|
+
const appearance = normalizeAppearance(opts.appearance);
|
|
283
|
+
const isDark = appearance === "dark" || appearance === "light" ? appearance === "dark" : opts.theme === "dark";
|
|
284
|
+
const appearanceJson = jsonForScript(appearance ?? null);
|
|
285
|
+
const themeJson = jsonForScript(opts.theme ?? null);
|
|
280
286
|
const popupBg = isDark ? "#1e1e1e" : "#fff";
|
|
281
287
|
const colorScheme = isDark ? "dark" : "light";
|
|
282
288
|
const textPrimary = isDark ? "#f0f0f0" : "#111";
|
|
@@ -333,22 +339,22 @@ body{display:${bodyDisplay};justify-content:${pos.justifyContent};align-items:${
|
|
|
333
339
|
body.dd-ready{background:${bodyBg}}
|
|
334
340
|
#dd-popup{visibility:hidden}
|
|
335
341
|
body.dd-ready #dd-popup{visibility:visible}
|
|
336
|
-
.deepdots-popup{position:relative;display:flex;flex-direction:column;justify-content:flex-start;background:${cardBg};color-scheme
|
|
342
|
+
.deepdots-popup{position:relative;display:flex;flex-direction:column;justify-content:flex-start;background:${cardBg};color-scheme:var(--dd-color-scheme,${colorScheme});border-radius:${cardRadius};padding:24px;box-shadow:${cardShadow};max-width:${cardMaxWidth};width:${cardWidth};min-height:${cardMinHeight};height:${cardHeight};max-height:${cardMaxHeight};box-sizing:border-box}
|
|
337
343
|
.deepdots-popup-header{display:flex;justify-content:space-between;align-items:center;gap:12px;width:100%;flex:0 0 auto}
|
|
338
344
|
/* Neutraliza la regla \`.deepdots-popup h2\` del CSS del survey (uppercase, centrado y
|
|
339
345
|
margin-bottom 40px), pensada para los enunciados y no para el t\xEDtulo de la cabecera. */
|
|
340
|
-
#dd-title{margin:0;font-family:var(--deepdots-font,'Montserrat',inherit);font-size:17px;font-weight:600;line-height:1.3;color
|
|
341
|
-
#dd-close{background:transparent;border:none;width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:8px;cursor:pointer;color
|
|
346
|
+
#dd-title{margin:0;font-family:var(--deepdots-font,'Montserrat',inherit);font-size:17px;font-weight:600;line-height:1.3;color:var(--dd-text-primary,${textPrimary});text-transform:none;text-align:start;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
347
|
+
#dd-close{background:transparent;border:none;width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:8px;cursor:pointer;color:var(--dd-text-primary,${textPrimary});padding:4px;flex:0 0 auto;margin-inline-start:auto}
|
|
342
348
|
/* Progreso alineado con la cabecera: sin padding horizontal propio, lo marca la tarjeta.
|
|
343
349
|
El vertical es el mismo arriba y abajo, y del mismo valor que el padding de la tarjeta. */
|
|
344
350
|
.deepdots-progress{display:none;flex-direction:column;gap:8px;width:100%;flex:0 0 auto;padding:16px 0;box-sizing:border-box}
|
|
345
351
|
.deepdots-progress-head{display:flex;flex-direction:row;justify-content:space-between;align-items:center;width:100%;gap:8px}
|
|
346
352
|
#dd-progress-label{font-size:13px;line-height:1.2}
|
|
347
353
|
/* "Question 1" en negrita y "of 3" en regular gris, como el mockup. */
|
|
348
|
-
#dd-progress-current{font-weight:700;color
|
|
349
|
-
#dd-progress-total{font-weight:400;color
|
|
354
|
+
#dd-progress-current{font-weight:700;color:var(--dd-text-primary,${textPrimary})}
|
|
355
|
+
#dd-progress-total{font-weight:400;color:var(--dd-text-muted,${textMuted})}
|
|
350
356
|
#dd-progress-followup{display:none;font-size:12px;font-weight:600;color:#fff;background:rgba(59,130,246,0.44);border-radius:999px;padding:2px 10px}
|
|
351
|
-
.deepdots-progress-track{width:100%;height:4px;border-radius:999px;background
|
|
357
|
+
.deepdots-progress-track{width:100%;height:4px;border-radius:999px;background:var(--dd-progress-track,${trackBg});overflow:hidden}
|
|
352
358
|
#dd-progress-bar{height:100%;width:0%;background:#22C55E;border-radius:999px;transition:width 450ms ease}
|
|
353
359
|
/* El popup es una columna: solo el bloque de preguntas hace scroll, para que el footer
|
|
354
360
|
con las acciones quede siempre visible en el borde inferior (antes viv\xEDa dentro del
|
|
@@ -376,14 +382,14 @@ body.dd-ready #dd-popup{visibility:visible}
|
|
|
376
382
|
#dd-logo{max-height:40px;max-width:100%;object-fit:contain;display:block;margin:12px 0 0 0}
|
|
377
383
|
.deepdots-error-hint{display:none;margin:12px 0 0 0;padding:10px 12px;border-radius:6px;background:#FEF3C7;color:#92400E;border:1px solid #FCD34D;font-size:13px}
|
|
378
384
|
/* Pantalla final: el HTML del editor de la plataforma (imagen + texto), centrado. */
|
|
379
|
-
.deepdots-load-error{display:none;width:100%;text-align:center;padding:24px 0;font-size:15px;color
|
|
380
|
-
.deepdots-success{display:none;width:100%;text-align:center;padding:24px 0;color
|
|
385
|
+
.deepdots-load-error{display:none;width:100%;text-align:center;padding:24px 0;font-size:15px;color:var(--dd-text-primary,${textPrimary})}
|
|
386
|
+
.deepdots-success{display:none;width:100%;text-align:center;padding:24px 0;color:var(--dd-text-primary,${textPrimary})}
|
|
381
387
|
.deepdots-success img{max-width:100%;height:auto;margin:0 auto 16px auto;display:block}
|
|
382
388
|
.deepdots-success p{margin:0;font-size:16px;font-weight:600;line-height:1.4}
|
|
383
389
|
.deepdots-popup-footer{display:flex;flex-direction:row-reverse;justify-content:space-between;align-items:center;gap:4px;margin-top:auto;width:100%;padding-top:12px}
|
|
384
390
|
.dd-nav-btn{display:none;border:none;min-height:44px;padding:12px 24px;border-radius:999px;cursor:pointer;font-size:15px;font-weight:600;align-items:center;justify-content:center;text-align:center}
|
|
385
391
|
/* Secundario como bot\xF3n de texto: sin borde ni fondo, para que el primario sea la \xFAnica CTA. */
|
|
386
|
-
#dd-back{background:transparent;color
|
|
392
|
+
#dd-back{background:transparent;color:var(--dd-text-muted,${textMuted});border:none}
|
|
387
393
|
#dd-start,#dd-complete,#dd-submit,#dd-cancel{background:#1E293B;color:#fff;border:none}
|
|
388
394
|
#dd-submit:disabled,#dd-start:disabled,#dd-back:disabled,#dd-complete:disabled{opacity:0.6;cursor:not-allowed}
|
|
389
395
|
.mf-spinner{display:none;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}
|
|
@@ -621,6 +627,40 @@ ${customCss}
|
|
|
621
627
|
}
|
|
622
628
|
|
|
623
629
|
${PRIMARY_COLOR_JS}
|
|
630
|
+
${CHROME_CONTRAST_JS}
|
|
631
|
+
${APPEARANCE_JS}
|
|
632
|
+
// Textos del chrome y color-scheme seg\xFAn el fondo final (Style), no el theme. Van como variables
|
|
633
|
+
// CSS para que el surveyCss del host, que va el \xFAltimo en la cascada, siga mandando.
|
|
634
|
+
function ddApplyChromeContrast(bg){
|
|
635
|
+
var dark=ddIsDarkBackground(bg);
|
|
636
|
+
if(dark===null){ return; }
|
|
637
|
+
var pal=ddChromePalette(dark);
|
|
638
|
+
var el=document.getElementById('dd-popup');
|
|
639
|
+
if(!el){ return; }
|
|
640
|
+
el.style.setProperty('--dd-color-scheme', pal.colorScheme);
|
|
641
|
+
el.style.setProperty('--dd-text-primary', pal.textPrimary);
|
|
642
|
+
el.style.setProperty('--dd-text-muted', pal.textMuted);
|
|
643
|
+
el.style.setProperty('--dd-progress-track', pal.progressTrack);
|
|
644
|
+
var meta=document.querySelector('meta[name="color-scheme"]');
|
|
645
|
+
if(meta){ meta.setAttribute('content', pal.colorScheme); }
|
|
646
|
+
}
|
|
647
|
+
// DD-241: modo de la app y colores del chrome (Style + theme + modo; bloque dark del Style).
|
|
648
|
+
var ddTheme=${themeJson};
|
|
649
|
+
var ddForcedMode=ddResolveForcedMode(${appearanceJson});
|
|
650
|
+
function ddApplyAppearanceColors(s){
|
|
651
|
+
var c=ddChromeColors(s, ddTheme, ddForcedMode);
|
|
652
|
+
if(chromeOn){ popup.style.background=c.background; ddApplyChromeContrast(c.background); }
|
|
653
|
+
if(c.loadingBar){ progressBar.style.background=c.loadingBar; progressFollowUp.style.background=c.loadingBar; }
|
|
654
|
+
if(c.primary){
|
|
655
|
+
var btns=[submitBtn,startBtn,completeBtn];
|
|
656
|
+
for(var bi=0;bi<btns.length;bi++){ btns[bi].style.background=c.primary; btns[bi].style.border='none'; btns[bi].style.color=c.onPrimary; }
|
|
657
|
+
}
|
|
658
|
+
if(c.secondary){
|
|
659
|
+
// Bot\xF3n de texto: solo ti\xF1e la etiqueta, sin recuperar fondo ni borde.
|
|
660
|
+
backBtn.style.background='transparent'; backBtn.style.color=c.secondary; backBtn.style.border='none';
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
if(ddForcedMode){ ddApplyAppearanceColors(null); }
|
|
624
664
|
${BUSY_JS}
|
|
625
665
|
${SUBMIT_ERROR_JS}
|
|
626
666
|
${REVEAL_JS}
|
|
@@ -706,6 +746,8 @@ ${REVEAL_JS}
|
|
|
706
746
|
// Foco en la primera pregunta de escribir tras Start, Siguiente o Atr\xE1s. Las versiones
|
|
707
747
|
// de native sin esta opci\xF3n la ignoran.
|
|
708
748
|
autofocus:'navigation',
|
|
749
|
+
// Paleta del survey (DD-238); las versiones sin la opci\xF3n la ignoran.
|
|
750
|
+
mode: ddForcedMode||undefined,
|
|
709
751
|
onLoadedEvent:function(args){
|
|
710
752
|
if(args && args.error){ ddShowLoadError('error:load', args.error); return; }
|
|
711
753
|
// Idioma en el que native muestra el survey: manda sobre el del init para que el
|
|
@@ -726,22 +768,13 @@ ${REVEAL_JS}
|
|
|
726
768
|
if(progressPref===null){ progressEnabled=s.showProgressBar===true; }
|
|
727
769
|
if(s.showProgressUnit!==undefined){ progressShowUnit=s.showProgressUnit!==false; }
|
|
728
770
|
if(s.progressUnit){ progressUnit=s.progressUnit; }
|
|
729
|
-
|
|
730
|
-
|
|
771
|
+
// Fondo, textos, botones y barra: Style + theme + modo de la app (DD-247, DD-241).
|
|
772
|
+
ddApplyAppearanceColors(s);
|
|
731
773
|
if(s.contentAlign){ main.style.justifyContent = s.contentAlign==='center' ? 'center' : 'flex-start'; }
|
|
732
774
|
// El survey pinta sus controles con --mf-primary, que sale de primaryColor; si la
|
|
733
775
|
// integraci\xF3n solo configura el del bot\xF3n, el popup mezclar\xEDa el color de la marca
|
|
734
776
|
// con el gris azulado por defecto del paquete.
|
|
735
777
|
ddApplySurveyPrimaryColor(popup, s);
|
|
736
|
-
if(s.buttonPrimaryColor){
|
|
737
|
-
submitBtn.style.background=s.buttonPrimaryColor; submitBtn.style.border='none'; submitBtn.style.color='#fff';
|
|
738
|
-
startBtn.style.background=s.buttonPrimaryColor; startBtn.style.border='none'; startBtn.style.color='#fff';
|
|
739
|
-
completeBtn.style.background=s.buttonPrimaryColor; completeBtn.style.border='none'; completeBtn.style.color='#fff';
|
|
740
|
-
}
|
|
741
|
-
if(s.buttonSecondaryColor){
|
|
742
|
-
// Bot\xF3n de texto: solo ti\xF1e la etiqueta, sin recuperar fondo ni borde.
|
|
743
|
-
backBtn.style.background='transparent'; backBtn.style.color=s.buttonSecondaryColor; backBtn.style.border='none';
|
|
744
|
-
}
|
|
745
778
|
if(s.logo && !document.getElementById('dd-logo')){
|
|
746
779
|
var logoImg=document.createElement('img');
|
|
747
780
|
logoImg.id='dd-logo'; logoImg.src=s.logo; logoImg.alt='Logo';
|
|
@@ -906,7 +939,8 @@ var ReactNativePopupRenderer = class {
|
|
|
906
939
|
title: options?.title,
|
|
907
940
|
showProgressBar: options?.showProgressBar,
|
|
908
941
|
surveyCss: options?.surveyCss,
|
|
909
|
-
language: options?.language
|
|
942
|
+
language: options?.language,
|
|
943
|
+
appearance: options?.appearance
|
|
910
944
|
});
|
|
911
945
|
if (this.options.onShow) {
|
|
912
946
|
this.options.onShow({ surveyId, productId, html });
|
|
@@ -1000,7 +1034,7 @@ function logRnSurveySdkChoice(choice, debug) {
|
|
|
1000
1034
|
}
|
|
1001
1035
|
|
|
1002
1036
|
// src/ui/preload.ts
|
|
1003
|
-
var defaultLoader = () => import("./renderPopup-
|
|
1037
|
+
var defaultLoader = () => import("./renderPopup-I3LIC3W3.mjs");
|
|
1004
1038
|
var pending = null;
|
|
1005
1039
|
function preloadRenderPopup(loader = defaultLoader) {
|
|
1006
1040
|
if (pending) return pending;
|
|
@@ -1073,7 +1107,7 @@ var BrowserPopupRenderer = class {
|
|
|
1073
1107
|
if (!this.container) return;
|
|
1074
1108
|
this.visible = true;
|
|
1075
1109
|
const container = this.container;
|
|
1076
|
-
void import("./renderPopup-
|
|
1110
|
+
void import("./renderPopup-I3LIC3W3.mjs").then(
|
|
1077
1111
|
({ renderPopup }) => {
|
|
1078
1112
|
renderPopup(container, surveyId, productId, actions, emit, onClose, env, userId, style, sessionId, miniService, analyticsFeedbackSessionId, options);
|
|
1079
1113
|
},
|
|
@@ -2191,13 +2225,26 @@ function resolveBackgroundTask(explicit, platform) {
|
|
|
2191
2225
|
}
|
|
2192
2226
|
var DEFAULT_REJECTION_WHITELIST = [ReferenceError, TypeError, RangeError];
|
|
2193
2227
|
function createHermesRejectionHub(hermes, options) {
|
|
2194
|
-
|
|
2195
|
-
|
|
2228
|
+
let original;
|
|
2229
|
+
try {
|
|
2230
|
+
if (!hermes || typeof hermes.enablePromiseRejectionTracker !== "function") return null;
|
|
2231
|
+
original = hermes.enablePromiseRejectionTracker.bind(hermes);
|
|
2232
|
+
} catch {
|
|
2233
|
+
return null;
|
|
2234
|
+
}
|
|
2196
2235
|
const listeners = /* @__PURE__ */ new Set();
|
|
2197
2236
|
let hostOptions = null;
|
|
2198
2237
|
let active = false;
|
|
2199
2238
|
const forwardsToHost = (error) => !!hostOptions?.onUnhandled && (hostOptions.allRejections === true || DEFAULT_REJECTION_WHITELIST.some((type) => error instanceof type));
|
|
2200
2239
|
const apply = () => {
|
|
2240
|
+
try {
|
|
2241
|
+
install();
|
|
2242
|
+
return true;
|
|
2243
|
+
} catch {
|
|
2244
|
+
return false;
|
|
2245
|
+
}
|
|
2246
|
+
};
|
|
2247
|
+
const install = () => {
|
|
2201
2248
|
original({
|
|
2202
2249
|
allRejections: true,
|
|
2203
2250
|
onUnhandled: (id, error) => {
|
|
@@ -2216,17 +2263,17 @@ function createHermesRejectionHub(hermes, options) {
|
|
|
2216
2263
|
onHandled: (id, error) => hostOptions?.onHandled?.(id, error)
|
|
2217
2264
|
});
|
|
2218
2265
|
};
|
|
2219
|
-
|
|
2266
|
+
const wrapper = (next) => {
|
|
2220
2267
|
hostOptions = next ?? null;
|
|
2221
|
-
if (active)
|
|
2268
|
+
if (active) install();
|
|
2222
2269
|
else original(next);
|
|
2223
2270
|
};
|
|
2271
|
+
if (!replaceTracker(hermes, wrapper)) return null;
|
|
2224
2272
|
return {
|
|
2225
2273
|
addUnhandledListener(listener) {
|
|
2226
2274
|
listeners.add(listener);
|
|
2227
2275
|
if (!active) {
|
|
2228
|
-
active =
|
|
2229
|
-
apply();
|
|
2276
|
+
active = apply();
|
|
2230
2277
|
}
|
|
2231
2278
|
return () => {
|
|
2232
2279
|
listeners.delete(listener);
|
|
@@ -2234,6 +2281,21 @@ function createHermesRejectionHub(hermes, options) {
|
|
|
2234
2281
|
}
|
|
2235
2282
|
};
|
|
2236
2283
|
}
|
|
2284
|
+
var TRACKER_KEY = "enablePromiseRejectionTracker";
|
|
2285
|
+
function replaceTracker(hermes, wrapper) {
|
|
2286
|
+
try {
|
|
2287
|
+
const own = Object.getOwnPropertyDescriptor(hermes, TRACKER_KEY);
|
|
2288
|
+
if (own && own.writable === false && !own.set) {
|
|
2289
|
+
if (!own.configurable) return false;
|
|
2290
|
+
Object.defineProperty(hermes, TRACKER_KEY, { ...own, value: wrapper });
|
|
2291
|
+
} else {
|
|
2292
|
+
hermes.enablePromiseRejectionTracker = wrapper;
|
|
2293
|
+
}
|
|
2294
|
+
return hermes.enablePromiseRejectionTracker === wrapper;
|
|
2295
|
+
} catch {
|
|
2296
|
+
return false;
|
|
2297
|
+
}
|
|
2298
|
+
}
|
|
2237
2299
|
|
|
2238
2300
|
// src/analytics/messaging.ts
|
|
2239
2301
|
var MESSAGE_CHANNELS = ["push", "in_app"];
|
|
@@ -2363,6 +2425,8 @@ var DeepdotsPopups = class {
|
|
|
2363
2425
|
/** CSS del host inyectado al final de los estilos del popup. */
|
|
2364
2426
|
this.surveyCss = void 0;
|
|
2365
2427
|
this.cspNonce = void 0;
|
|
2428
|
+
/** Claro/oscuro de la app (DD-241). undefined = mandan los colores del Style. */
|
|
2429
|
+
this.appearance = void 0;
|
|
2366
2430
|
/** Identidad + sesión (Fase 1 tracking). Null hasta init(). */
|
|
2367
2431
|
this.tracking = null;
|
|
2368
2432
|
/** Capa de analytics (canal separado del feedback). Null hasta init(). */
|
|
@@ -2446,6 +2510,7 @@ var DeepdotsPopups = class {
|
|
|
2446
2510
|
this.showProgressBar = config.showProgressBar;
|
|
2447
2511
|
this.surveyCss = config.surveyCss;
|
|
2448
2512
|
this.cspNonce = config.cspNonce;
|
|
2513
|
+
this.appearance = normalizeAppearance(config.appearance);
|
|
2449
2514
|
this.onFeedbackSession = config.onFeedbackSession;
|
|
2450
2515
|
this.autoTrackErrors = config.autoTrack?.errors !== false;
|
|
2451
2516
|
this.config = {
|
|
@@ -2815,6 +2880,18 @@ var DeepdotsPopups = class {
|
|
|
2815
2880
|
*
|
|
2816
2881
|
* Equivale a llamar a `init()` otra vez con otro `userId`.
|
|
2817
2882
|
*/
|
|
2883
|
+
/**
|
|
2884
|
+
* Claro u oscuro desde la app, en cualquier momento (apps con su propio interruptor de modo
|
|
2885
|
+
* oscuro). `'system'` sigue al sistema; `null`/`undefined` vuelve a los colores del Style.
|
|
2886
|
+
* Se aplica al siguiente popup que se abra. Paridad con nativo `setAppearance()` (DD-240).
|
|
2887
|
+
*/
|
|
2888
|
+
setAppearance(appearance) {
|
|
2889
|
+
this.appearance = normalizeAppearance(appearance);
|
|
2890
|
+
}
|
|
2891
|
+
/** El `appearance` actual de la app (`undefined` = mandan los colores del Style). */
|
|
2892
|
+
getAppearance() {
|
|
2893
|
+
return this.appearance;
|
|
2894
|
+
}
|
|
2818
2895
|
setUserId(userId) {
|
|
2819
2896
|
const next = userId || void 0;
|
|
2820
2897
|
if (!this.initialized || !this.config || next === this.config.userId) return;
|
|
@@ -3738,7 +3815,7 @@ var DeepdotsPopups = class {
|
|
|
3738
3815
|
miniService,
|
|
3739
3816
|
analyticsFeedbackSessionId,
|
|
3740
3817
|
this.renderChrome,
|
|
3741
|
-
{ title, showProgressBar: this.showProgressBar, surveyCss: this.surveyCss, language: this.language, cspNonce: this.cspNonce, surveySdkVersion, debug: this.config?.debug }
|
|
3818
|
+
{ title, showProgressBar: this.showProgressBar, surveyCss: this.surveyCss, language: this.language, cspNonce: this.cspNonce, surveySdkVersion, debug: this.config?.debug, appearance: this.appearance }
|
|
3742
3819
|
);
|
|
3743
3820
|
}
|
|
3744
3821
|
/** Hide the popup */
|
|
@@ -3987,17 +4064,24 @@ function setupReactNative(sdk2, config, deps = {}) {
|
|
|
3987
4064
|
var hub;
|
|
3988
4065
|
function registerReactNativeDefaults(rn) {
|
|
3989
4066
|
if (hub === void 0) {
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
4067
|
+
try {
|
|
4068
|
+
hub = getReactNativePlatform()?.promiseRejections ?? createHermesRejectionHub(
|
|
4069
|
+
globalThis.HermesInternal,
|
|
4070
|
+
{ dev: typeof __DEV__ !== "undefined" && !!__DEV__ }
|
|
4071
|
+
);
|
|
4072
|
+
} catch {
|
|
4073
|
+
hub = null;
|
|
4074
|
+
}
|
|
4075
|
+
}
|
|
4076
|
+
try {
|
|
4077
|
+
registerReactNativePlatform({
|
|
4078
|
+
os: rn.Platform.OS,
|
|
4079
|
+
appState: rn.AppState,
|
|
4080
|
+
backgroundTaskModule: rn.NativeModules?.DeepdotsBackgroundTask ?? null,
|
|
4081
|
+
promiseRejections: hub
|
|
4082
|
+
});
|
|
4083
|
+
} catch {
|
|
3994
4084
|
}
|
|
3995
|
-
registerReactNativePlatform({
|
|
3996
|
-
os: rn.Platform.OS,
|
|
3997
|
-
appState: rn.AppState,
|
|
3998
|
-
backgroundTaskModule: rn.NativeModules?.DeepdotsBackgroundTask ?? null,
|
|
3999
|
-
promiseRejections: hub
|
|
4000
|
-
});
|
|
4001
4085
|
}
|
|
4002
4086
|
|
|
4003
4087
|
// src/react-native/index.tsx
|