@magicfeedback/popup-sdk 1.9.0 → 1.10.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.
@@ -18,7 +18,7 @@ import {
18
18
  sdkWarn,
19
19
  setLogger,
20
20
  style_default
21
- } from "./chunk-AKVMUQXO.mjs";
21
+ } from "./chunk-TSORXOQG.mjs";
22
22
 
23
23
  // src/react-native/index.tsx
24
24
  import { createContext, useContext, useEffect, useRef, useState } from "react";
@@ -256,7 +256,7 @@ function trimmedOrNull(value) {
256
256
  }
257
257
  function buildSurveyHtml(opts) {
258
258
  const env = opts.env === "development" ? "dev" : "prod";
259
- const version = opts.version ?? "2.2.22";
259
+ const version = opts.version ?? "2.2.31";
260
260
  const cdn = `https://cdn.jsdelivr.net/npm/@magicfeedback/native@${version}/dist/magicfeedback-sdk.browser.js`;
261
261
  const sid = jsonForScript(opts.surveyId);
262
262
  const pid = jsonForScript(opts.productId);
@@ -636,10 +636,15 @@ ${REVEAL_JS}
636
636
  // textContent, as\xED que el mensaje de la plataforma (HTML con imagen) no se ver\xEDa, y su
637
637
  // fallback es un literal gen\xE9rico que ignora style.successMessage.
638
638
  addSuccessScreen:false,
639
+ // Surveys multi-idioma: native pide a la API este idioma (el del init o el del
640
+ // dispositivo); si el survey no lo tiene, la API sirve el idioma por defecto.
641
+ lang:${initLangJson}||undefined,
639
642
  onLoadedEvent:function(args){
640
- // Idioma del survey: manda sobre el del init para que el chrome no se quede en
641
- // ingl\xE9s delante de un survey traducido.
642
- var langs=args && args.formData ? args.formData.lang : null;
643
+ // Idioma en el que native muestra el survey: manda sobre el del init para que el
644
+ // chrome no se quede en ingl\xE9s delante de un survey traducido. Native < 2.3 no lo
645
+ // env\xEDa: entonces el primero de formData.lang (el idioma por defecto).
646
+ var shown=args && typeof args.lang==='string' && args.lang.trim() ? args.lang : null;
647
+ var langs=shown ? [shown] : (args && args.formData ? args.formData.lang : null);
643
648
  if(langs && langs.length){
644
649
  for(var li=0;li<langs.length;li++){
645
650
  if(typeof langs[li]==='string' && langs[li].trim()){ ddApplyLabels(langs[li]); break; }
@@ -870,7 +875,7 @@ function createReactNativeRenderer() {
870
875
  }
871
876
 
872
877
  // src/ui/preload.ts
873
- var defaultLoader = () => import("./renderPopup-LEM2MLWT.mjs");
878
+ var defaultLoader = () => import("./renderPopup-WLOFOCDR.mjs");
874
879
  var pending = null;
875
880
  function preloadRenderPopup(loader = defaultLoader) {
876
881
  if (pending) return pending;
@@ -943,7 +948,7 @@ var BrowserPopupRenderer = class {
943
948
  if (!this.container) return;
944
949
  this.visible = true;
945
950
  const container = this.container;
946
- void import("./renderPopup-LEM2MLWT.mjs").then(({ renderPopup }) => {
951
+ void import("./renderPopup-WLOFOCDR.mjs").then(({ renderPopup }) => {
947
952
  renderPopup(container, surveyId, productId, actions, emit, onClose, env, userId, style, sessionId, miniService, analyticsFeedbackSessionId, options);
948
953
  });
949
954
  }
@@ -2973,7 +2978,7 @@ var DeepdotsPopups = class {
2973
2978
  }
2974
2979
  if (!this.popupContainer) return;
2975
2980
  const container = this.popupContainer;
2976
- void import("./renderPopup-LEM2MLWT.mjs").then(({ renderPopup }) => {
2981
+ void import("./renderPopup-WLOFOCDR.mjs").then(({ renderPopup }) => {
2977
2982
  renderPopup(
2978
2983
  container,
2979
2984
  surveyId,