@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/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-
|
|
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
|
|
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,
|
|
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-
|
|
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-
|
|
1683
|
+
void import("./renderPopup-MES7IINW.mjs").then(({ renderPopup }) => {
|
|
1680
1684
|
renderPopup(
|
|
1681
1685
|
container,
|
|
1682
1686
|
surveyId,
|