@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.
package/dist/index.mjs CHANGED
@@ -2,9 +2,11 @@ import {
2
2
  InMemoryStorage,
3
3
  STORAGE_KEYS,
4
4
  TrackingManager,
5
+ buildFontFaceCss,
6
+ buildFontFamilyValue,
5
7
  buildSurveyIdentity,
6
8
  createDefaultStorage
7
- } from "./chunk-6WTOQGET.mjs";
9
+ } from "./chunk-7TOLYAFL.mjs";
8
10
 
9
11
  // src/types/index.ts
10
12
  var POPUP_TRIGGER_CONDITION_STATUSES = [
@@ -199,10 +201,12 @@ function buildSurveyHtml(opts) {
199
201
  const pid = JSON.stringify(opts.productId);
200
202
  const profileJson = JSON.stringify(opts.profile ?? []);
201
203
  const metaJson = JSON.stringify(opts.metadata ?? []);
204
+ const fontFaceCss = opts.font ? buildFontFaceCss(opts.font.family, opts.font.url) : "";
205
+ const fontFamilyValue = opts.font ? buildFontFamilyValue(opts.font.family) : "-apple-system,system-ui,sans-serif";
202
206
  return `<!DOCTYPE html><html><head>
203
207
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
204
208
  <meta name="color-scheme" content="light"/>
205
- <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>
209
+ <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>
206
210
  </head><body>
207
211
  <div id="mf"></div>
208
212
  <script>
@@ -253,13 +257,13 @@ var ReactNativePopupRenderer = class {
253
257
  }
254
258
  init() {
255
259
  }
256
- show(surveyId, productId, _actions, emit, onClose, env = "production", userId, _style, sessionId, miniService, analyticsFeedbackSessionId) {
260
+ show(surveyId, productId, _actions, emit, onClose, env = "production", userId, style, sessionId, miniService, analyticsFeedbackSessionId) {
257
261
  this.emitFn = emit;
258
262
  this.onCloseFn = onClose;
259
263
  this.currentSurveyId = surveyId;
260
264
  this.partialEmitted = false;
261
265
  const { profile, metadata } = buildSurveyIdentity(userId ?? null, sessionId ?? null, miniService ?? null, analyticsFeedbackSessionId ?? null);
262
- const html = buildSurveyHtml({ surveyId, productId, env, profile, metadata });
266
+ const html = buildSurveyHtml({ surveyId, productId, env, profile, metadata, font: style?.font });
263
267
  if (this.options.onShow) {
264
268
  this.options.onShow({ surveyId, productId, html });
265
269
  } else {
@@ -355,7 +359,7 @@ var BrowserPopupRenderer = class {
355
359
  if (!this.container) return;
356
360
  this.visible = true;
357
361
  const container = this.container;
358
- void import("./renderPopup-YLFRGPQN.mjs").then(({ renderPopup }) => {
362
+ void import("./renderPopup-MES7IINW.mjs").then(({ renderPopup }) => {
359
363
  renderPopup(container, surveyId, productId, actions, emit, onClose, env, userId, style, sessionId, miniService, analyticsFeedbackSessionId);
360
364
  });
361
365
  }
@@ -1676,7 +1680,7 @@ var DeepdotsPopups = class {
1676
1680
  }
1677
1681
  if (!this.popupContainer) return;
1678
1682
  const container = this.popupContainer;
1679
- void import("./renderPopup-YLFRGPQN.mjs").then(({ renderPopup }) => {
1683
+ void import("./renderPopup-MES7IINW.mjs").then(({ renderPopup }) => {
1680
1684
  renderPopup(
1681
1685
  container,
1682
1686
  surveyId,