@magicfeedback/popup-sdk 1.18.0 → 1.19.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.
- package/MagicfeedbackPopupSdk.podspec +18 -0
- package/README.md +23 -0
- package/dist/2.2.38-CCK7SF4A.mjs +2343 -0
- package/dist/2.2.38-CCK7SF4A.mjs.map +1 -0
- package/dist/2.2.38-LGZRM7GX.mjs +2343 -0
- package/dist/2.2.38-LGZRM7GX.mjs.map +1 -0
- package/dist/2.2.39-BJJ3YRJ4.mjs +2344 -0
- package/dist/2.2.39-BJJ3YRJ4.mjs.map +1 -0
- package/dist/2.2.39-HPNDYUPP.mjs +2344 -0
- package/dist/2.2.39-HPNDYUPP.mjs.map +1 -0
- package/dist/assets/assets/style.css +107 -1
- package/dist/assets/assets/survey-css/2.2.38.css +2335 -0
- package/dist/assets/assets/survey-css/2.2.39.css +2336 -0
- package/dist/chunk-3QS3WKRC.mjs +31 -0
- package/dist/chunk-3QS3WKRC.mjs.map +1 -0
- package/dist/chunk-7ZQOAKXR.mjs +3335 -0
- package/dist/chunk-7ZQOAKXR.mjs.map +1 -0
- package/dist/chunk-BJTO5JO5.mjs +11 -0
- package/dist/chunk-BJTO5JO5.mjs.map +1 -0
- package/dist/{chunk-DNBFTJCA.mjs → chunk-EW2ARDEY.mjs} +496 -52
- package/dist/chunk-EW2ARDEY.mjs.map +1 -0
- package/dist/{chunk-7ZVOPIWE.mjs → chunk-XOEEBDBJ.mjs} +535 -11
- package/dist/chunk-XOEEBDBJ.mjs.map +1 -0
- package/dist/index.d.mts +152 -9
- package/dist/index.d.ts +152 -9
- package/dist/index.js +7139 -1511
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +294 -38
- package/dist/index.mjs.map +1 -1
- package/dist/index.native.d.mts +1616 -0
- package/dist/index.native.d.ts +1616 -0
- package/dist/index.native.js +15853 -0
- package/dist/index.native.js.map +1 -0
- package/dist/index.native.mjs +3914 -0
- package/dist/index.native.mjs.map +1 -0
- package/dist/react-native.d.mts +98 -7
- package/dist/react-native.d.ts +98 -7
- package/dist/react-native.js +5725 -157
- package/dist/react-native.js.map +1 -1
- package/dist/react-native.mjs +289 -40
- package/dist/react-native.mjs.map +1 -1
- package/dist/renderPopup-2Y4QMWR7.mjs +3847 -0
- package/dist/renderPopup-2Y4QMWR7.mjs.map +1 -0
- package/dist/renderPopup-YDJUON42.mjs +3847 -0
- package/dist/renderPopup-YDJUON42.mjs.map +1 -0
- package/dist/{renderPopup-B6VIV4VS.mjs → renderPopup-ZHTRMFO2.mjs} +133 -6
- package/dist/renderPopup-ZHTRMFO2.mjs.map +1 -0
- package/ios/DeepdotsBackgroundTask.m +71 -0
- package/package.json +14 -5
- package/react-native.config.js +9 -0
- package/dist/chunk-7ZVOPIWE.mjs.map +0 -1
- package/dist/chunk-DNBFTJCA.mjs.map +0 -1
- package/dist/renderPopup-B6VIV4VS.mjs.map +0 -1
- package/dist/renderPopup-BKZPAZZG.mjs +0 -3682
- package/dist/renderPopup-BKZPAZZG.mjs.map +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
+
|
|
5
|
+
# Módulo nativo mínimo del popup-sdk en React Native (iOS): background task para que el cierre
|
|
6
|
+
# de la sesión salga al pasar a background (DD-55). Lo enlaza el autolinking; en web no existe.
|
|
7
|
+
Pod::Spec.new do |s|
|
|
8
|
+
s.name = "MagicfeedbackPopupSdk"
|
|
9
|
+
s.version = package["version"]
|
|
10
|
+
s.summary = "Deepdots popup SDK: iOS background task for analytics requests (React Native)."
|
|
11
|
+
s.homepage = "https://github.com/MagicFeedback/deepdots-popup-sdk"
|
|
12
|
+
s.license = package["license"] || "UNLICENSED"
|
|
13
|
+
s.author = "Deepdots"
|
|
14
|
+
s.platforms = { :ios => "13.0" }
|
|
15
|
+
s.source = { :git => "https://github.com/MagicFeedback/deepdots-popup-sdk.git", :tag => "v#{s.version}" }
|
|
16
|
+
s.source_files = "ios/**/*.{h,m}"
|
|
17
|
+
s.dependency "React-Core"
|
|
18
|
+
end
|
package/README.md
CHANGED
|
@@ -137,6 +137,18 @@ Config fields:
|
|
|
137
137
|
defaults to `localStorage`)
|
|
138
138
|
- `platform?: 'web' | 'android' | 'ios'` — defaults to `'web'`
|
|
139
139
|
- `device?: DeviceInfo` — device context override, for hosts where the SDK cannot detect it
|
|
140
|
+
- `autoTrack?: { lifecycle?: boolean }` — what the SDK detects on its own; all on by default.
|
|
141
|
+
`lifecycle` (React Native): the SDK listens to `AppState` itself (`active` → session start,
|
|
142
|
+
`inactive` → send pending data with the current screen, `background` → session end). Calling
|
|
143
|
+
`onForeground` / `onInactive` / `onBackground` yourself as well is harmless: nothing is sent
|
|
144
|
+
twice.
|
|
145
|
+
- `backgroundTask?: (name) => () => void` — React Native on iOS, **usually not needed**: the
|
|
146
|
+
package ships a tiny native module (`ios/DeepdotsBackgroundTask.m`, linked by autolinking on
|
|
147
|
+
`pod install`) that asks iOS for background time while each analytics request is in flight,
|
|
148
|
+
so the request that closes the session finishes when the app goes to background instead of
|
|
149
|
+
when the user opens it again. Pass your own function only to replace it (for example
|
|
150
|
+
`backgroundTimerTask(BackgroundTimer)` with `react-native-background-timer`). Without either
|
|
151
|
+
(Expo Go, or an app not rebuilt yet), the closing batch is stored and sent on the next launch.
|
|
140
152
|
- `contactAttributes?: Record<string, string | number | boolean>`
|
|
141
153
|
- `renderChrome?: boolean` — React Native only. Defaults to `true`. When `false`, the survey
|
|
142
154
|
WebView HTML is delivered transparent and edge-to-edge, without the SDK's own card, backdrop,
|
|
@@ -220,6 +232,16 @@ const renderer = new ReactNativePopupRenderer({
|
|
|
220
232
|
`onReady` is optional: a host that opens its container on `onShow` still never shows the spinner,
|
|
221
233
|
because the HTML reveals itself; the container just appears a few hundred ms before the card.
|
|
222
234
|
|
|
235
|
+
### Survey version (latest or pinned in the Admin)
|
|
236
|
+
|
|
237
|
+
Each popup draws its survey with the survey version assigned to it in the Admin (*Survey frontend version*: latest or pinned), like the survey page does. The API sends it per popup as `surveyFrontend.sdkVersion`, the `@magicfeedback/native` version that survey release was built with.
|
|
238
|
+
|
|
239
|
+
- Supported versions: `SUPPORTED_SURVEY_SDK_VERSIONS` (now 2.2.38, 2.2.39), the ones whose survey CSS this SDK vendors (`src/assets/survey-css/<v>.css`, scoped to `.deepdots-popup` like `style.css`). JS and CSS follow the version together.
|
|
240
|
+
- DOM popup: the browser bundle of that exact version comes from jsDelivr (then unpkg); its CSS ships inside this SDK as a lazy chunk. React Native's WebView loads both from the CDN (the CSS from this package's `dist/assets/assets/survey-css`).
|
|
241
|
+
- Missing (older API, survey release without `sdkVersion`), unsupported, or failing to load (no network, a CSP without `cdn.jsdelivr.net`/`unpkg.com` in `script-src`): the bundled JS and CSS (`BUNDLED_SURVEY_SDK_VERSION`), as before. Never one version's JS with another's CSS.
|
|
242
|
+
- With `debug: true` the choice is logged (`[Deepdots] survey SDK 2.2.38 (assigned)`); an invalid version or a load failure is always logged as a warning (unsupported is debug-only: it is normal for older survey versions). The popup element carries it in `data-survey-sdk`.
|
|
243
|
+
- Adding a version: `node scripts/vendor-survey-css.mjs --src <readable magicfeedback-default.css> --version <v> --out src/assets/survey-css/<v>.css`, then add it to `SUPPORTED_SURVEY_SDK_VERSIONS` and `src/ui/surveyCss.ts` (a test checks the three match). The release gate then tests it: `apps/test-app/e2e/survey-sdk.spec.ts` opens a popup with each listed version (`?surveySdk=<v>`) and checks its JS, its CSS and that the survey draws and answers.
|
|
244
|
+
|
|
223
245
|
### Focus on text questions
|
|
224
246
|
|
|
225
247
|
When the first question of a page is a text field (text, long text, email or number), the cursor
|
|
@@ -309,6 +331,7 @@ session start/end and unhandled errors are automatic. The rest is instrumented b
|
|
|
309
331
|
| `setUserAttributes(map)` / `setMetric(key, value)` | Breakdown dimensions / measurable values |
|
|
310
332
|
| `setUserId(userId?)` | Login, logout or account switch |
|
|
311
333
|
| `endSession()` | Closes the session explicitly |
|
|
334
|
+
| `onForeground()` / `onInactive()` / `onBackground()` | React Native lifecycle. Not needed: the SDK listens to `AppState` itself (`autoTrack.lifecycle`). Calling them as well does not send anything twice |
|
|
312
335
|
| `setTrackingEnabled(enabled)` | Kill switch (consent) |
|
|
313
336
|
| `reportError(error, options?)` | A handled error |
|
|
314
337
|
| `previewAnalytics()` / `flushAnalytics()` | Inspect the pending payload / send it now |
|