@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.
@@ -522,6 +522,29 @@ function ddApplySurveyPrimaryColor(el, style){
522
522
  }
523
523
  });
524
524
 
525
+ // src/ui/busy.ts
526
+ function setSurveyBusy(el, busy) {
527
+ if (!el) return;
528
+ el.style.pointerEvents = busy ? "none" : "";
529
+ el.setAttribute("aria-busy", busy ? "true" : "false");
530
+ if ("inert" in el) {
531
+ el.inert = busy;
532
+ }
533
+ }
534
+ var BUSY_JS;
535
+ var init_busy = __esm({
536
+ "src/ui/busy.ts"() {
537
+ "use strict";
538
+ BUSY_JS = `
539
+ function ddSetSurveyBusy(el, busy){
540
+ if(!el){ return; }
541
+ el.style.pointerEvents = busy ? 'none' : '';
542
+ el.setAttribute('aria-busy', busy ? 'true' : 'false');
543
+ if('inert' in el){ el.inert = busy; }
544
+ }`;
545
+ }
546
+ });
547
+
525
548
  // src/assets/style.css
526
549
  var style_default;
527
550
  var init_style = __esm({
@@ -2964,6 +2987,7 @@ async function renderPopup(container, surveyId, productId, actions, emit, onClos
2964
2987
  revealTimer = setTimeout(reveal, REVEAL_TIMEOUT_MS);
2965
2988
  function setLoading(isLoading) {
2966
2989
  spinnerEl.style.display = isLoading ? "flex" : "none";
2990
+ setSurveyBusy(formWrapper, isLoading);
2967
2991
  if (!isLoading) {
2968
2992
  formHost.style.visibility = "visible";
2969
2993
  revealWhenPainted2();
@@ -3119,6 +3143,7 @@ var init_renderPopup = __esm({
3119
3143
  init_font();
3120
3144
  init_logo();
3121
3145
  init_surveyPalette();
3146
+ init_busy();
3122
3147
  init_logger();
3123
3148
  init_labels();
3124
3149
  init_reveal();
@@ -3338,6 +3363,7 @@ init_font();
3338
3363
  init_labels();
3339
3364
  init_reveal();
3340
3365
  init_surveyPalette();
3366
+ init_busy();
3341
3367
  init_style();
3342
3368
  var REVEAL_JS = `
3343
3369
  function ddCreateReveal(popup, onReveal, timeoutMs){
@@ -3557,6 +3583,7 @@ ${customCss}
3557
3583
  var footer=document.getElementById('dd-footer');
3558
3584
  var spinner=document.getElementById('dd-spinner');
3559
3585
  var formHost=document.getElementById('mf');
3586
+ var formWrapper=document.getElementById('dd-form-wrapper');
3560
3587
  var errorHint=document.getElementById('dd-error');
3561
3588
  var backBtn=document.getElementById('dd-back');
3562
3589
  var startBtn=document.getElementById('dd-start');
@@ -3716,6 +3743,7 @@ ${customCss}
3716
3743
  }
3717
3744
 
3718
3745
  ${PRIMARY_COLOR_JS}
3746
+ ${BUSY_JS}
3719
3747
  ${REVEAL_JS}
3720
3748
  // El popup se ense\xF1a cuando el survey est\xE1 pintado; \`ready\` deja al host abrir su propio
3721
3749
  // Modal en ese momento en vez de montar un WebView en blanco.
@@ -3726,6 +3754,11 @@ ${REVEAL_JS}
3726
3754
 
3727
3755
  function setLoading(isLoading){
3728
3756
  spinner.style.display=isLoading?'flex':'none';
3757
+ // El spinner no tapa el survey (28px en posicion absoluta), asi que sin esto el usuario
3758
+ // puede seguir cambiando de opcion mientras se envia la pagina, y ese cambio ya no viaja
3759
+ // con ella. Se bloquea el wrapper, que es el elemento estable: el div de dentro lo
3760
+ // sustituye @magicfeedback/native por su propio contenedor al generar el survey.
3761
+ ddSetSurveyBusy(formWrapper, isLoading);
3729
3762
  if(!isLoading){
3730
3763
  formHost.style.visibility='visible';
3731
3764
  // Fin de la carga, sea por survey cargado o por error. Entre p\xE1ginas es no-op: la