@magicfeedback/popup-sdk 1.7.1 → 1.8.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.
@@ -1,21 +1,24 @@
1
1
  import {
2
+ REVEAL_TIMEOUT_MS,
2
3
  __commonJS,
3
4
  __toESM,
5
+ applySurveyPrimaryColor,
4
6
  buildFontFaceCss,
5
7
  buildFontFamilyValue,
6
8
  buildSurveyIdentity,
7
9
  directionFor,
8
10
  getLabels,
9
11
  resolveActionLabels,
12
+ revealWhenPainted,
10
13
  sdkError,
11
14
  sdkLog,
12
15
  sdkWarn,
13
16
  style_default
14
- } from "./chunk-W6MPSWMS.mjs";
17
+ } from "./chunk-XHR3MHJO.mjs";
15
18
 
16
- // ../deepdots-popup-sdk/node_modules/@magicfeedback/native/dist/magicfeedback-sdk.browser.js
19
+ // node_modules/@magicfeedback/native/dist/magicfeedback-sdk.browser.js
17
20
  var require_magicfeedback_sdk_browser = __commonJS({
18
- "../deepdots-popup-sdk/node_modules/@magicfeedback/native/dist/magicfeedback-sdk.browser.js"(exports, module) {
21
+ "node_modules/@magicfeedback/native/dist/magicfeedback-sdk.browser.js"(exports, module) {
19
22
  "use strict";
20
23
  !(function(e, t) {
21
24
  "object" == typeof exports && "object" == typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? exports.magicfeedback = t() : e.magicfeedback = t();
@@ -2457,6 +2460,18 @@ function ensureMagicFeedbackStyles(_popup) {
2457
2460
  style.textContent = style_default;
2458
2461
  document.head.appendChild(style);
2459
2462
  }
2463
+ var SURVEY_ALIGNMENT_STYLE_ID = "deepdots-survey-alignment";
2464
+ function ensureSurveyAlignmentStyles() {
2465
+ if (document.getElementById(SURVEY_ALIGNMENT_STYLE_ID)) return;
2466
+ const style = document.createElement("style");
2467
+ style.id = SURVEY_ALIGNMENT_STYLE_ID;
2468
+ style.textContent = `
2469
+ .deepdots-popup .magicfeedback-container,
2470
+ .deepdots-popup .magicfeedback-form,
2471
+ .deepdots-popup .magicfeedback-div { padding-left: 0; padding-right: 0; }
2472
+ `;
2473
+ document.head.appendChild(style);
2474
+ }
2460
2475
  function ensureSpinnerStyles(_popup) {
2461
2476
  if (document.getElementById("deepdots-spinner-styles")) return;
2462
2477
  const style = document.createElement("style");
@@ -2709,6 +2724,7 @@ async function renderPopup(container, surveyId, productId, actions, emit, onClos
2709
2724
  progressFollowUp.style.display = p.followup ? "inline-block" : "none";
2710
2725
  }
2711
2726
  ensureMagicFeedbackStyles(popup);
2727
+ ensureSurveyAlignmentStyles();
2712
2728
  ensureSpinnerStyles(popup);
2713
2729
  ensureResponsiveStyles(popup);
2714
2730
  ensureCustomCss(options?.surveyCss);
@@ -2767,7 +2783,7 @@ async function renderPopup(container, surveyId, productId, actions, emit, onClos
2767
2783
  border: none;
2768
2784
  min-height: 44px;
2769
2785
  padding: 12px 24px;
2770
- border-radius: 6px;
2786
+ border-radius: 999px; /* p\xEDldora, como el Button de Material3 en KMP */
2771
2787
  cursor: pointer;
2772
2788
  font-size: 15px;
2773
2789
  font-weight: 600;
@@ -2797,7 +2813,7 @@ async function renderPopup(container, surveyId, productId, actions, emit, onClos
2797
2813
  border: none;
2798
2814
  min-height: 44px;
2799
2815
  padding: 12px 24px;
2800
- border-radius: 6px;
2816
+ border-radius: 999px; /* p\xEDldora, como el Button de Material3 en KMP */
2801
2817
  cursor: pointer;
2802
2818
  font-size: 15px;
2803
2819
  font-weight: 600;
@@ -2824,7 +2840,7 @@ async function renderPopup(container, surveyId, productId, actions, emit, onClos
2824
2840
  border: none;
2825
2841
  min-height: 44px;
2826
2842
  padding: 12px 24px;
2827
- border-radius: 6px;
2843
+ border-radius: 999px; /* p\xEDldora, como el Button de Material3 en KMP */
2828
2844
  cursor: pointer;
2829
2845
  font-size: 15px;
2830
2846
  font-weight: 600;
@@ -2855,7 +2871,7 @@ async function renderPopup(container, surveyId, productId, actions, emit, onClos
2855
2871
  border: none;
2856
2872
  min-height: 44px;
2857
2873
  padding: 12px 24px;
2858
- border-radius: 6px;
2874
+ border-radius: 999px; /* p\xEDldora, como el Button de Material3 en KMP */
2859
2875
  cursor: pointer;
2860
2876
  font-size: 15px;
2861
2877
  font-weight: 600;
@@ -2957,14 +2973,35 @@ async function renderPopup(container, surveyId, productId, actions, emit, onClos
2957
2973
  container.innerHTML = "";
2958
2974
  container.appendChild(popup);
2959
2975
  container.style.display = "flex";
2976
+ container.style.visibility = "hidden";
2977
+ container.style.pointerEvents = "none";
2960
2978
  container.style.justifyContent = pos.justifyContent;
2961
2979
  container.style.alignItems = pos.alignItems;
2962
2980
  container.style.background = pos.background;
2963
2981
  if (pos.padding) container.style.padding = pos.padding;
2982
+ let revealed = false;
2983
+ let revealTimer = null;
2984
+ function reveal() {
2985
+ if (revealed) return;
2986
+ revealed = true;
2987
+ if (revealTimer !== null) {
2988
+ clearTimeout(revealTimer);
2989
+ revealTimer = null;
2990
+ }
2991
+ if (!container.contains(popup)) return;
2992
+ container.style.visibility = "visible";
2993
+ container.style.pointerEvents = "";
2994
+ }
2995
+ function revealWhenPainted2() {
2996
+ if (revealed) return;
2997
+ revealWhenPainted(popup, reveal);
2998
+ }
2999
+ revealTimer = setTimeout(reveal, REVEAL_TIMEOUT_MS);
2964
3000
  function setLoading(isLoading) {
2965
3001
  spinnerEl.style.display = isLoading ? "flex" : "none";
2966
3002
  if (!isLoading) {
2967
3003
  formHost.style.visibility = "visible";
3004
+ revealWhenPainted2();
2968
3005
  }
2969
3006
  footer.style.display = isLoading ? "none" : "flex";
2970
3007
  backButton.disabled = isLoading;
@@ -3027,6 +3064,7 @@ async function renderPopup(container, surveyId, productId, actions, emit, onClos
3027
3064
  if (s.contentAlign) {
3028
3065
  main.style.justifyContent = s.contentAlign === "center" ? "center" : "flex-start";
3029
3066
  }
3067
+ applySurveyPrimaryColor(popup, s);
3030
3068
  if (s.buttonPrimaryColor) {
3031
3069
  submitButton.style.background = s.buttonPrimaryColor;
3032
3070
  submitButton.style.border = "none";
@@ -3109,6 +3147,8 @@ async function renderPopup(container, surveyId, productId, actions, emit, onClos
3109
3147
  }
3110
3148
  }
3111
3149
  export {
3150
+ REVEAL_TIMEOUT_MS,
3151
+ SURVEY_ALIGNMENT_STYLE_ID,
3112
3152
  renderPopup
3113
3153
  };
3114
- //# sourceMappingURL=renderPopup-HHQMAW3G.mjs.map
3154
+ //# sourceMappingURL=renderPopup-HTNVACFV.mjs.map