@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/assets/assets/style.css +10 -1
- package/dist/{chunk-6WTOQGET.mjs → chunk-7TOLYAFL.mjs} +35 -2
- package/dist/chunk-7TOLYAFL.mjs.map +1 -0
- package/dist/{chunk-IOAZQPZE.mjs → chunk-LSTKGFU7.mjs} +35 -2
- package/dist/chunk-LSTKGFU7.mjs.map +1 -0
- package/dist/index.d.mts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +74 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -6
- package/dist/index.mjs.map +1 -1
- package/dist/react-native.d.mts +10 -1
- package/dist/react-native.d.ts +10 -1
- package/dist/react-native.js +74 -4
- package/dist/react-native.js.map +1 -1
- package/dist/react-native.mjs +10 -6
- package/dist/react-native.mjs.map +1 -1
- package/dist/{renderPopup-YLFRGPQN.mjs → renderPopup-MES7IINW.mjs} +34 -3
- package/dist/renderPopup-MES7IINW.mjs.map +1 -0
- package/dist/{renderPopup-KBDWWSUU.mjs → renderPopup-YNH2TD3B.mjs} +34 -3
- package/dist/renderPopup-YNH2TD3B.mjs.map +1 -0
- package/package.json +1 -1
- package/dist/chunk-6WTOQGET.mjs.map +0 -1
- package/dist/chunk-IOAZQPZE.mjs.map +0 -1
- package/dist/renderPopup-KBDWWSUU.mjs.map +0 -1
- package/dist/renderPopup-YLFRGPQN.mjs.map +0 -1
package/dist/react-native.mjs
CHANGED
|
@@ -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-
|
|
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
|
|
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,
|
|
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-
|
|
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-
|
|
1688
|
+
void import("./renderPopup-YNH2TD3B.mjs").then(({ renderPopup }) => {
|
|
1685
1689
|
renderPopup(
|
|
1686
1690
|
container,
|
|
1687
1691
|
surveyId,
|