@magicfeedback/popup-sdk 1.8.0 → 1.8.1
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/{chunk-XHR3MHJO.mjs → chunk-AV2TTQXB.mjs} +20 -1
- package/dist/chunk-AV2TTQXB.mjs.map +1 -0
- package/dist/{chunk-322DDMX6.mjs → chunk-EBJZDVC6.mjs} +20 -1
- package/dist/chunk-EBJZDVC6.mjs.map +1 -0
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -4
- package/dist/index.mjs.map +1 -1
- package/dist/react-native.js +33 -0
- package/dist/react-native.js.map +1 -1
- package/dist/react-native.mjs +12 -4
- package/dist/react-native.mjs.map +1 -1
- package/dist/{renderPopup-HTNVACFV.mjs → renderPopup-3CZ6WTXF.mjs} +4 -2
- package/dist/renderPopup-3CZ6WTXF.mjs.map +1 -0
- package/dist/{renderPopup-SNDPX5RX.mjs → renderPopup-E2OLIXIQ.mjs} +4 -2
- package/dist/renderPopup-E2OLIXIQ.mjs.map +1 -0
- package/package.json +1 -1
- package/dist/chunk-322DDMX6.mjs.map +0 -1
- package/dist/chunk-XHR3MHJO.mjs.map +0 -1
- package/dist/renderPopup-HTNVACFV.mjs.map +0 -1
- package/dist/renderPopup-SNDPX5RX.mjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -542,6 +542,29 @@ function ddApplySurveyPrimaryColor(el, style){
|
|
|
542
542
|
}
|
|
543
543
|
});
|
|
544
544
|
|
|
545
|
+
// src/ui/busy.ts
|
|
546
|
+
function setSurveyBusy(el, busy) {
|
|
547
|
+
if (!el) return;
|
|
548
|
+
el.style.pointerEvents = busy ? "none" : "";
|
|
549
|
+
el.setAttribute("aria-busy", busy ? "true" : "false");
|
|
550
|
+
if ("inert" in el) {
|
|
551
|
+
el.inert = busy;
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
var BUSY_JS;
|
|
555
|
+
var init_busy = __esm({
|
|
556
|
+
"src/ui/busy.ts"() {
|
|
557
|
+
"use strict";
|
|
558
|
+
BUSY_JS = `
|
|
559
|
+
function ddSetSurveyBusy(el, busy){
|
|
560
|
+
if(!el){ return; }
|
|
561
|
+
el.style.pointerEvents = busy ? 'none' : '';
|
|
562
|
+
el.setAttribute('aria-busy', busy ? 'true' : 'false');
|
|
563
|
+
if('inert' in el){ el.inert = busy; }
|
|
564
|
+
}`;
|
|
565
|
+
}
|
|
566
|
+
});
|
|
567
|
+
|
|
545
568
|
// src/assets/style.css
|
|
546
569
|
var style_default;
|
|
547
570
|
var init_style = __esm({
|
|
@@ -5381,6 +5404,7 @@ async function renderPopup(container, surveyId, productId, actions, emit, onClos
|
|
|
5381
5404
|
revealTimer = setTimeout(reveal, REVEAL_TIMEOUT_MS);
|
|
5382
5405
|
function setLoading(isLoading) {
|
|
5383
5406
|
spinnerEl.style.display = isLoading ? "flex" : "none";
|
|
5407
|
+
setSurveyBusy(formWrapper, isLoading);
|
|
5384
5408
|
if (!isLoading) {
|
|
5385
5409
|
formHost.style.visibility = "visible";
|
|
5386
5410
|
revealWhenPainted2();
|
|
@@ -5536,6 +5560,7 @@ var init_renderPopup = __esm({
|
|
|
5536
5560
|
init_font();
|
|
5537
5561
|
init_logo();
|
|
5538
5562
|
init_surveyPalette();
|
|
5563
|
+
init_busy();
|
|
5539
5564
|
init_logger();
|
|
5540
5565
|
init_labels();
|
|
5541
5566
|
init_reveal();
|
|
@@ -5778,6 +5803,7 @@ init_font();
|
|
|
5778
5803
|
init_labels();
|
|
5779
5804
|
init_reveal();
|
|
5780
5805
|
init_surveyPalette();
|
|
5806
|
+
init_busy();
|
|
5781
5807
|
init_style();
|
|
5782
5808
|
var REVEAL_JS = `
|
|
5783
5809
|
function ddCreateReveal(popup, onReveal, timeoutMs){
|
|
@@ -5997,6 +6023,7 @@ ${customCss}
|
|
|
5997
6023
|
var footer=document.getElementById('dd-footer');
|
|
5998
6024
|
var spinner=document.getElementById('dd-spinner');
|
|
5999
6025
|
var formHost=document.getElementById('mf');
|
|
6026
|
+
var formWrapper=document.getElementById('dd-form-wrapper');
|
|
6000
6027
|
var errorHint=document.getElementById('dd-error');
|
|
6001
6028
|
var backBtn=document.getElementById('dd-back');
|
|
6002
6029
|
var startBtn=document.getElementById('dd-start');
|
|
@@ -6156,6 +6183,7 @@ ${customCss}
|
|
|
6156
6183
|
}
|
|
6157
6184
|
|
|
6158
6185
|
${PRIMARY_COLOR_JS}
|
|
6186
|
+
${BUSY_JS}
|
|
6159
6187
|
${REVEAL_JS}
|
|
6160
6188
|
// El popup se ense\xF1a cuando el survey est\xE1 pintado; \`ready\` deja al host abrir su propio
|
|
6161
6189
|
// Modal en ese momento en vez de montar un WebView en blanco.
|
|
@@ -6166,6 +6194,11 @@ ${REVEAL_JS}
|
|
|
6166
6194
|
|
|
6167
6195
|
function setLoading(isLoading){
|
|
6168
6196
|
spinner.style.display=isLoading?'flex':'none';
|
|
6197
|
+
// El spinner no tapa el survey (28px en posicion absoluta), asi que sin esto el usuario
|
|
6198
|
+
// puede seguir cambiando de opcion mientras se envia la pagina, y ese cambio ya no viaja
|
|
6199
|
+
// con ella. Se bloquea el wrapper, que es el elemento estable: el div de dentro lo
|
|
6200
|
+
// sustituye @magicfeedback/native por su propio contenedor al generar el survey.
|
|
6201
|
+
ddSetSurveyBusy(formWrapper, isLoading);
|
|
6169
6202
|
if(!isLoading){
|
|
6170
6203
|
formHost.style.visibility='visible';
|
|
6171
6204
|
// Fin de la carga, sea por survey cargado o por error. Entre p\xE1ginas es no-op: la
|