@magicfeedback/popup-sdk 1.1.4 → 1.1.5

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.
@@ -2,9 +2,11 @@ import {
2
2
  STORAGE_KEYS,
3
3
  TrackingManager,
4
4
  __require,
5
+ buildFontFaceCss,
6
+ buildFontFamilyValue,
5
7
  buildSurveyIdentity,
6
8
  createDefaultStorage
7
- } from "./chunk-IOAZQPZE.mjs";
9
+ } from "./chunk-LSTKGFU7.mjs";
8
10
 
9
11
  // src/react-native/index.tsx
10
12
  import { createContext, useContext, useEffect, useRef, useState } from "react";
@@ -204,10 +206,12 @@ function buildSurveyHtml(opts) {
204
206
  const pid = JSON.stringify(opts.productId);
205
207
  const profileJson = JSON.stringify(opts.profile ?? []);
206
208
  const metaJson = JSON.stringify(opts.metadata ?? []);
209
+ const fontFaceCss = opts.font ? buildFontFaceCss(opts.font.family, opts.font.url) : "";
210
+ const fontFamilyValue = opts.font ? buildFontFamilyValue(opts.font.family) : "-apple-system,system-ui,sans-serif";
207
211
  return `<!DOCTYPE html><html><head>
208
212
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
209
213
  <meta name="color-scheme" content="light"/>
210
- <style>html,body{margin:0;padding:0;background:transparent;font-family:-apple-system,system-ui,sans-serif}#mf{width:100%;box-sizing:border-box}#mf *{max-width:100%;box-sizing:border-box}</style>
214
+ <style>${fontFaceCss}html,body{margin:0;padding:0;background:transparent;font-family:${fontFamilyValue}}#mf{width:100%;box-sizing:border-box}#mf *{max-width:100%;box-sizing:border-box}</style>
211
215
  </head><body>
212
216
  <div id="mf"></div>
213
217
  <script>
@@ -258,13 +262,13 @@ var ReactNativePopupRenderer = class {
258
262
  }
259
263
  init() {
260
264
  }
261
- show(surveyId, productId, _actions, emit, onClose, env = "production", userId, _style, sessionId, miniService, analyticsFeedbackSessionId) {
265
+ show(surveyId, productId, _actions, emit, onClose, env = "production", userId, style, sessionId, miniService, analyticsFeedbackSessionId) {
262
266
  this.emitFn = emit;
263
267
  this.onCloseFn = onClose;
264
268
  this.currentSurveyId = surveyId;
265
269
  this.partialEmitted = false;
266
270
  const { profile, metadata } = buildSurveyIdentity(userId ?? null, sessionId ?? null, miniService ?? null, analyticsFeedbackSessionId ?? null);
267
- const html = buildSurveyHtml({ surveyId, productId, env, profile, metadata });
271
+ const html = buildSurveyHtml({ surveyId, productId, env, profile, metadata, font: style?.font });
268
272
  if (this.options.onShow) {
269
273
  this.options.onShow({ surveyId, productId, html });
270
274
  } else {
@@ -360,7 +364,7 @@ var BrowserPopupRenderer = class {
360
364
  if (!this.container) return;
361
365
  this.visible = true;
362
366
  const container = this.container;
363
- void import("./renderPopup-KBDWWSUU.mjs").then(({ renderPopup }) => {
367
+ void import("./renderPopup-YNH2TD3B.mjs").then(({ renderPopup }) => {
364
368
  renderPopup(container, surveyId, productId, actions, emit, onClose, env, userId, style, sessionId, miniService, analyticsFeedbackSessionId);
365
369
  });
366
370
  }
@@ -1681,7 +1685,7 @@ var DeepdotsPopups = class {
1681
1685
  }
1682
1686
  if (!this.popupContainer) return;
1683
1687
  const container = this.popupContainer;
1684
- void import("./renderPopup-KBDWWSUU.mjs").then(({ renderPopup }) => {
1688
+ void import("./renderPopup-YNH2TD3B.mjs").then(({ renderPopup }) => {
1685
1689
  renderPopup(
1686
1690
  container,
1687
1691
  surveyId,