@userflow-tech/react-native 0.5.0 → 0.6.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.
Files changed (153) hide show
  1. package/README.md +24 -0
  2. package/docs/custom-fonts.md +36 -0
  3. package/docs/troubleshooting.md +7 -6
  4. package/lib/commonjs/anchors/fiber/FiberScanRootStore.js +8 -0
  5. package/lib/commonjs/anchors/fiber/FiberScanRootStore.js.map +1 -1
  6. package/lib/commonjs/anchors/fiber/detectAppFontFamily.js +341 -0
  7. package/lib/commonjs/anchors/fiber/detectAppFontFamily.js.map +1 -0
  8. package/lib/commonjs/anchors/fiber/visibleScreens.js +6 -0
  9. package/lib/commonjs/anchors/fiber/visibleScreens.js.map +1 -1
  10. package/lib/commonjs/content/BannerStepButton.js +2 -1
  11. package/lib/commonjs/content/BannerStepButton.js.map +1 -1
  12. package/lib/commonjs/content/RichContentRenderer.js +17 -11
  13. package/lib/commonjs/content/RichContentRenderer.js.map +1 -1
  14. package/lib/commonjs/content/StepButton.js +2 -1
  15. package/lib/commonjs/content/StepButton.js.map +1 -1
  16. package/lib/commonjs/content/resolveContentFontFamily.js +96 -0
  17. package/lib/commonjs/content/resolveContentFontFamily.js.map +1 -0
  18. package/lib/commonjs/index.js +2 -0
  19. package/lib/commonjs/index.js.map +1 -1
  20. package/lib/commonjs/runtime/BannerHost.js +3 -3
  21. package/lib/commonjs/runtime/BannerHost.js.map +1 -1
  22. package/lib/commonjs/runtime/pushBannerLayoutContext.js +11 -8
  23. package/lib/commonjs/runtime/pushBannerLayoutContext.js.map +1 -1
  24. package/lib/commonjs/surfaces/BannerSurface.js +2 -6
  25. package/lib/commonjs/surfaces/BannerSurface.js.map +1 -1
  26. package/lib/commonjs/surfaces/ProgressBar.js +2 -1
  27. package/lib/commonjs/surfaces/ProgressBar.js.map +1 -1
  28. package/lib/commonjs/surfaces/TooltipSurface.js +5 -0
  29. package/lib/commonjs/surfaces/TooltipSurface.js.map +1 -1
  30. package/lib/commonjs/surfaces/bannerWebView/BannerWebViewBar.js +6 -4
  31. package/lib/commonjs/surfaces/bannerWebView/BannerWebViewBar.js.map +1 -1
  32. package/lib/commonjs/surfaces/bannerWebView/bannerNeedsWebView.js +3 -33
  33. package/lib/commonjs/surfaces/bannerWebView/bannerNeedsWebView.js.map +1 -1
  34. package/lib/commonjs/surfaces/bannerWebView/bannerThemeStyles.js +2 -1
  35. package/lib/commonjs/surfaces/bannerWebView/bannerThemeStyles.js.map +1 -1
  36. package/lib/commonjs/surfaces/bannerWebView/bannerWebViewHeight.js +33 -0
  37. package/lib/commonjs/surfaces/bannerWebView/bannerWebViewHeight.js.map +1 -0
  38. package/lib/commonjs/surfaces/bannerWebView/buildCustomBannerHtml.js +45 -12
  39. package/lib/commonjs/surfaces/bannerWebView/buildCustomBannerHtml.js.map +1 -1
  40. package/lib/commonjs/version.js +1 -1
  41. package/lib/module/anchors/fiber/FiberScanRootStore.js +8 -0
  42. package/lib/module/anchors/fiber/FiberScanRootStore.js.map +1 -1
  43. package/lib/module/anchors/fiber/detectAppFontFamily.js +330 -0
  44. package/lib/module/anchors/fiber/detectAppFontFamily.js.map +1 -0
  45. package/lib/module/anchors/fiber/visibleScreens.js +5 -0
  46. package/lib/module/anchors/fiber/visibleScreens.js.map +1 -1
  47. package/lib/module/content/BannerStepButton.js +2 -1
  48. package/lib/module/content/BannerStepButton.js.map +1 -1
  49. package/lib/module/content/RichContentRenderer.js +17 -11
  50. package/lib/module/content/RichContentRenderer.js.map +1 -1
  51. package/lib/module/content/StepButton.js +2 -1
  52. package/lib/module/content/StepButton.js.map +1 -1
  53. package/lib/module/content/resolveContentFontFamily.js +89 -0
  54. package/lib/module/content/resolveContentFontFamily.js.map +1 -0
  55. package/lib/module/index.js +2 -0
  56. package/lib/module/index.js.map +1 -1
  57. package/lib/module/runtime/BannerHost.js +3 -3
  58. package/lib/module/runtime/BannerHost.js.map +1 -1
  59. package/lib/module/runtime/pushBannerLayoutContext.js +11 -8
  60. package/lib/module/runtime/pushBannerLayoutContext.js.map +1 -1
  61. package/lib/module/surfaces/BannerSurface.js +2 -6
  62. package/lib/module/surfaces/BannerSurface.js.map +1 -1
  63. package/lib/module/surfaces/ProgressBar.js +2 -1
  64. package/lib/module/surfaces/ProgressBar.js.map +1 -1
  65. package/lib/module/surfaces/TooltipSurface.js +5 -0
  66. package/lib/module/surfaces/TooltipSurface.js.map +1 -1
  67. package/lib/module/surfaces/bannerWebView/BannerWebViewBar.js +6 -4
  68. package/lib/module/surfaces/bannerWebView/BannerWebViewBar.js.map +1 -1
  69. package/lib/module/surfaces/bannerWebView/bannerNeedsWebView.js +3 -31
  70. package/lib/module/surfaces/bannerWebView/bannerNeedsWebView.js.map +1 -1
  71. package/lib/module/surfaces/bannerWebView/bannerThemeStyles.js +2 -1
  72. package/lib/module/surfaces/bannerWebView/bannerThemeStyles.js.map +1 -1
  73. package/lib/module/surfaces/bannerWebView/bannerWebViewHeight.js +29 -0
  74. package/lib/module/surfaces/bannerWebView/bannerWebViewHeight.js.map +1 -0
  75. package/lib/module/surfaces/bannerWebView/buildCustomBannerHtml.js +45 -12
  76. package/lib/module/surfaces/bannerWebView/buildCustomBannerHtml.js.map +1 -1
  77. package/lib/module/version.js +1 -1
  78. package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRootStore.d.ts +5 -0
  79. package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRootStore.d.ts.map +1 -1
  80. package/lib/typescript/commonjs/src/anchors/fiber/detectAppFontFamily.d.ts +30 -0
  81. package/lib/typescript/commonjs/src/anchors/fiber/detectAppFontFamily.d.ts.map +1 -0
  82. package/lib/typescript/commonjs/src/anchors/fiber/visibleScreens.d.ts +2 -0
  83. package/lib/typescript/commonjs/src/anchors/fiber/visibleScreens.d.ts.map +1 -1
  84. package/lib/typescript/commonjs/src/content/BannerStepButton.d.ts.map +1 -1
  85. package/lib/typescript/commonjs/src/content/RichContentRenderer.d.ts.map +1 -1
  86. package/lib/typescript/commonjs/src/content/StepButton.d.ts.map +1 -1
  87. package/lib/typescript/commonjs/src/content/resolveContentFontFamily.d.ts +35 -0
  88. package/lib/typescript/commonjs/src/content/resolveContentFontFamily.d.ts.map +1 -0
  89. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  90. package/lib/typescript/commonjs/src/runtime/pushBannerLayoutContext.d.ts +5 -0
  91. package/lib/typescript/commonjs/src/runtime/pushBannerLayoutContext.d.ts.map +1 -1
  92. package/lib/typescript/commonjs/src/surfaces/BannerSurface.d.ts +1 -4
  93. package/lib/typescript/commonjs/src/surfaces/BannerSurface.d.ts.map +1 -1
  94. package/lib/typescript/commonjs/src/surfaces/ProgressBar.d.ts.map +1 -1
  95. package/lib/typescript/commonjs/src/surfaces/TooltipSurface.d.ts.map +1 -1
  96. package/lib/typescript/commonjs/src/surfaces/bannerWebView/BannerWebViewBar.d.ts.map +1 -1
  97. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerNeedsWebView.d.ts +3 -12
  98. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerNeedsWebView.d.ts.map +1 -1
  99. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerThemeStyles.d.ts.map +1 -1
  100. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerWebViewHeight.d.ts +13 -0
  101. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerWebViewHeight.d.ts.map +1 -0
  102. package/lib/typescript/commonjs/src/surfaces/bannerWebView/buildCustomBannerHtml.d.ts.map +1 -1
  103. package/lib/typescript/commonjs/src/version.d.ts +1 -1
  104. package/lib/typescript/module/src/anchors/fiber/FiberScanRootStore.d.ts +5 -0
  105. package/lib/typescript/module/src/anchors/fiber/FiberScanRootStore.d.ts.map +1 -1
  106. package/lib/typescript/module/src/anchors/fiber/detectAppFontFamily.d.ts +30 -0
  107. package/lib/typescript/module/src/anchors/fiber/detectAppFontFamily.d.ts.map +1 -0
  108. package/lib/typescript/module/src/anchors/fiber/visibleScreens.d.ts +2 -0
  109. package/lib/typescript/module/src/anchors/fiber/visibleScreens.d.ts.map +1 -1
  110. package/lib/typescript/module/src/content/BannerStepButton.d.ts.map +1 -1
  111. package/lib/typescript/module/src/content/RichContentRenderer.d.ts.map +1 -1
  112. package/lib/typescript/module/src/content/StepButton.d.ts.map +1 -1
  113. package/lib/typescript/module/src/content/resolveContentFontFamily.d.ts +35 -0
  114. package/lib/typescript/module/src/content/resolveContentFontFamily.d.ts.map +1 -0
  115. package/lib/typescript/module/src/index.d.ts.map +1 -1
  116. package/lib/typescript/module/src/runtime/pushBannerLayoutContext.d.ts +5 -0
  117. package/lib/typescript/module/src/runtime/pushBannerLayoutContext.d.ts.map +1 -1
  118. package/lib/typescript/module/src/surfaces/BannerSurface.d.ts +1 -4
  119. package/lib/typescript/module/src/surfaces/BannerSurface.d.ts.map +1 -1
  120. package/lib/typescript/module/src/surfaces/ProgressBar.d.ts.map +1 -1
  121. package/lib/typescript/module/src/surfaces/TooltipSurface.d.ts.map +1 -1
  122. package/lib/typescript/module/src/surfaces/bannerWebView/BannerWebViewBar.d.ts.map +1 -1
  123. package/lib/typescript/module/src/surfaces/bannerWebView/bannerNeedsWebView.d.ts +3 -12
  124. package/lib/typescript/module/src/surfaces/bannerWebView/bannerNeedsWebView.d.ts.map +1 -1
  125. package/lib/typescript/module/src/surfaces/bannerWebView/bannerThemeStyles.d.ts.map +1 -1
  126. package/lib/typescript/module/src/surfaces/bannerWebView/bannerWebViewHeight.d.ts +13 -0
  127. package/lib/typescript/module/src/surfaces/bannerWebView/bannerWebViewHeight.d.ts.map +1 -0
  128. package/lib/typescript/module/src/surfaces/bannerWebView/buildCustomBannerHtml.d.ts.map +1 -1
  129. package/lib/typescript/module/src/version.d.ts +1 -1
  130. package/package.json +1 -1
  131. package/src/anchors/fiber/FiberScanRootStore.ts +8 -0
  132. package/src/anchors/fiber/detectAppFontFamily.ts +400 -0
  133. package/src/anchors/fiber/visibleScreens.ts +5 -0
  134. package/src/content/BannerStepButton.tsx +2 -1
  135. package/src/content/RichContentRenderer.tsx +15 -10
  136. package/src/content/StepButton.tsx +2 -1
  137. package/src/content/resolveContentFontFamily.ts +119 -0
  138. package/src/index.ts +2 -0
  139. package/src/runtime/BannerHost.tsx +3 -3
  140. package/src/runtime/pushBannerLayoutContext.tsx +14 -9
  141. package/src/surfaces/BannerSurface.tsx +2 -6
  142. package/src/surfaces/ProgressBar.tsx +2 -1
  143. package/src/surfaces/TooltipSurface.tsx +15 -2
  144. package/src/surfaces/bannerWebView/BannerWebViewBar.tsx +6 -4
  145. package/src/surfaces/bannerWebView/bannerNeedsWebView.ts +4 -36
  146. package/src/surfaces/bannerWebView/bannerThemeStyles.ts +2 -1
  147. package/src/surfaces/bannerWebView/bannerWebViewHeight.ts +32 -0
  148. package/src/surfaces/bannerWebView/buildCustomBannerHtml.ts +48 -12
  149. package/src/version.ts +1 -1
  150. package/vendor/core/package.json +1 -1
  151. package/vendor/protocol/dist/flows.d.ts +2 -0
  152. package/vendor/protocol/dist/flows.d.ts.map +1 -1
  153. package/vendor/protocol/package.json +1 -1
package/README.md CHANGED
@@ -354,6 +354,30 @@ watches navigation state, so overlays that do not change the pathname are
354
354
  skipped too). Returning from background past the lifecycle grace window
355
355
  re-fires the current screen.
356
356
 
357
+ ### Current screen auto-start
358
+
359
+ A React Native flow can auto-start when the current screen matches or does not
360
+ match a pattern. The pattern is compared to the same `screenName` this section
361
+ already sends. Matching is case-sensitive. A screen that has not been reported,
362
+ or an empty name, never matches — including "does not match".
363
+
364
+ - Expo Router: match the pathname (`/settings`, `/projects/123`). Route groups
365
+ are omitted, so `app/(tabs)/settings.tsx` is `/settings` and a pattern of
366
+ `/(tabs)/settings` never matches. Dynamic segments are filled in; `*` crosses
367
+ them (`/projects/*` matches `/projects/123` and `/projects/123/edit`, and does
368
+ not match `/projects`). `:name` matches exactly one segment
369
+ (`/projects/:id/edit` matches `/projects/123/edit`, not `/projects/123`).
370
+ - React Navigation and `Userflow.updateScreen`: match the route name
371
+ (`BillingSettings`). `Settings*` matches `SettingsProfile`.
372
+ - An app reports one of those values, not both. Write the pattern for the value
373
+ your integration sends.
374
+ - Modal and sheet presentations are not reported, so a pattern cannot target
375
+ them.
376
+ - The condition is offered on flow auto-start only. Banners, step triggers,
377
+ button conditions, and "hide flow when" do not use it.
378
+ - Leaving the screen does not stop a flow that already started. A "once"
379
+ frequency does not start it again.
380
+
357
381
  ### Expo Router
358
382
 
359
383
  Mount `UserflowExpoRouterScreenTracker` from the `@userflow-tech/react-native/expo-router`
@@ -0,0 +1,36 @@
1
+ # Custom fonts (investigation)
2
+
3
+ Part 1 makes SDK content use the font the host app is already drawing when the theme is still on Userflow's default stack. This note is how a later ticket could let a customer choose a font the app does not already use. No loader is implemented here.
4
+
5
+ ## Where it would be configured
6
+
7
+ The Builder theme, the same place web already configures fonts:
8
+
9
+ - **System font** — the default CSS stack. On React Native this is the Part 1 behavior: the detected app font, or the platform font when nothing is detected.
10
+ - **Google font** (`builtinFontFamily`) — the family web loads from `fonts.googleapis.com`.
11
+ - **Custom family** — a family name the customer installs with theme custom CSS (`@font-face`). `fontCssUrl` is the legacy locked field for that stylesheet.
12
+
13
+ SDK init is only an escape hatch for a face already linked in the app binary, for example `fontFamily` passed at `Userflow.init` when the file cannot be downloaded. It is not the customer-facing control. The dashboard does not run on device, so a builder-only name still has to be resolved by the SDK.
14
+
15
+ ## How the SDK would load a face the app does not have
16
+
17
+ React Native `fontFamily` is one family name, not a CSS stack, and it only resolves a face registered in the process.
18
+
19
+ - **Already registered in the app.** Pass the PostScript name (iOS) or the file name without extension (Android). Part 1 detects this from host `Text` and does not download anything.
20
+ - **Bundled in the SDK.** Not viable for arbitrary customer fonts. There is nothing to ship ahead of time except faces Userflow itself hosts.
21
+ - **Hosted `ttf` or `otf`.** Download the file and register it the way `expo-font` does: `CTFontManager` on iOS, `ReactFontManager` on Android. The registered name has to match the font's internal family name. Web Google CSS is `woff2` and cannot be assigned to RN `fontFamily`. A follow-up should host the `ttf`/`otf` files, not reuse the Google CSS URL. Standard faces in the builder list (Arial, Georgia, and the rest in `backend/lib/userflow/videos/font_family.ex`) exist as web fallbacks and generally do not exist on iOS or Android, so they are not a mobile default.
22
+ - **WebView banners.** Native registration is not enough on Android. The banner HTML needs its own `@font-face` (file URL or a data URI). iOS `WKWebView` often sees fonts registered with `CTFontManager`, but that should not be the only path.
23
+
24
+ ## Platform constraints
25
+
26
+ - iOS and Android both require the font file to be registered before `Text` can use the name. A missing name logs an unrecognized-font warning and falls back to the platform face.
27
+ - RN does not synthesize bold or italic for a custom face. A follow-up must register the weight files the theme actually uses (`fontWeightNormal`, `fontWeightBold`, and the button weights). Part 1 does not copy the app's weight or style; size, weight, and color stay on the theme.
28
+ - Family names differ by platform for the same file. The loader has to record the name each platform registered, not assume the Google family string matches both.
29
+
30
+ ## Recommended follow-up
31
+
32
+ Medium effort, and it is a backend-then-SDK change if the theme gains a font-file URL.
33
+
34
+ 1. Host `ttf`/`otf` for the builtin Google families (the name list already lives in `backend/lib/userflow/videos/font_family.ex`), including the weights the theme uses.
35
+ 2. When `builtinFontFamily` is set, the SDK downloads and registers those files, then sets `fontFamily` to the registered name. Until that load finishes, keep the Part 1 app font so text never renders with a missing face.
36
+ 3. Leave custom `@font-face` CSS web-only until the theme has a real file URL the SDK can download. Do not parse arbitrary customer CSS for font files.
@@ -120,12 +120,13 @@ Id matching: dashboard `#invite-teammates` ↔ `userflowId="invite-teammates"`,
120
120
 
121
121
  ### 3. Screen / provider
122
122
 
123
- | Symptom | Likely cause |
124
- | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
125
- | No overlay at all | Missing `UserflowProvider` above the tree |
126
- | Wrong screen / flow never qualifies | Screen not reported — Expo Router needs `UserflowExpoRouterScreenTracker` under the provider; React Navigation needs `WithUserflowReactNavigation`; or call `updateScreen` / `useUserflowScreen` |
127
- | Works only after identify | Expected for server-driven sessions; `updateScreen` before identify only buffers |
128
- | No `screen_viewed` events | Identify has not run, or an overlay (modal/sheet) is focused — overlays are not screen views |
123
+ | Symptom | Likely cause |
124
+ | ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
125
+ | No overlay at all | Missing `UserflowProvider` above the tree |
126
+ | Wrong screen / flow never qualifies | Screen not reported — Expo Router needs `UserflowExpoRouterScreenTracker` under the provider; React Navigation needs `WithUserflowReactNavigation`; or call `updateScreen` / `useUserflowScreen` |
127
+ | "Current screen" auto-start never matches | Pattern does not equal the reported value: route groups are dropped (`/(tabs)/settings` is `/settings`), Expo Router sends a path while React Navigation sends a route name, or the focused route is a modal/sheet (not reported). `*` or `:name` covers dynamic segments (`/projects/*`, `/projects/:id`). An unreported or empty screen never matches, including "does not match". Matching is case-sensitive |
128
+ | Works only after identify | Expected for server-driven sessions; `updateScreen` before identify only buffers |
129
+ | No `screen_viewed` events | Identify has not run, or an overlay (modal/sheet) is focused — overlays are not screen views |
129
130
 
130
131
  ### 4. Connection
131
132
 
@@ -28,6 +28,14 @@ class FiberScanRootStore {
28
28
  if (!fiber) return null;
29
29
  return (0, _fiberInternals.resolveCurrentFiber)(fiber);
30
30
  }
31
+
32
+ /**
33
+ * Mounted scan-root instance. Font detection caches against this identity
34
+ * so a remount scans again and an update of the same root does not.
35
+ */
36
+ getInstance() {
37
+ return this.instance;
38
+ }
31
39
  subscribe(listener) {
32
40
  this.listeners.add(listener);
33
41
  return () => {
@@ -1 +1 @@
1
- {"version":3,"names":["_fiberInternals","require","FiberScanRootStore","instance","listeners","Set","set","emit","clear","getFiber","fiber","fiberFromPublicInstance","resolveCurrentFiber","subscribe","listener","add","delete","resetForTests","fiberScanRoot","exports"],"sourceRoot":"../../../../src","sources":["anchors/fiber/FiberScanRootStore.ts"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AAIA;AACA;AACA;AACA;AACA,MAAMC,kBAAkB,CAAC;EACfC,QAAQ,GAAY,IAAI;EACfC,SAAS,GAAG,IAAIC,GAAG,CAAW,CAAC;EAEhDC,GAAGA,CAACH,QAAiB,EAAQ;IAC3B,IAAI,CAACA,QAAQ,GAAGA,QAAQ;IACxB,IAAI,CAACI,IAAI,CAAC,CAAC;EACb;EAEAC,KAAKA,CAAA,EAAS;IACZ,IAAI,CAACL,QAAQ,GAAG,IAAI;IACpB,IAAI,CAACI,IAAI,CAAC,CAAC;EACb;;EAEA;EACAE,QAAQA,CAAA,EAAoB;IAC1B,IAAI,CAAC,IAAI,CAACN,QAAQ,EAAE,OAAO,IAAI;IAC/B,MAAMO,KAAK,GAAG,IAAAC,uCAAuB,EAAC,IAAI,CAACR,QAAQ,CAAC;IACpD,IAAI,CAACO,KAAK,EAAE,OAAO,IAAI;IACvB,OAAO,IAAAE,mCAAmB,EAACF,KAAK,CAAC;EACnC;EAEAG,SAASA,CAACC,QAAkB,EAAc;IACxC,IAAI,CAACV,SAAS,CAACW,GAAG,CAACD,QAAQ,CAAC;IAC5B,OAAO,MAAM;MACX,IAAI,CAACV,SAAS,CAACY,MAAM,CAACF,QAAQ,CAAC;IACjC,CAAC;EACH;;EAEA;EACAG,aAAaA,CAAA,EAAS;IACpB,IAAI,CAACd,QAAQ,GAAG,IAAI;IACpB,IAAI,CAACC,SAAS,CAACI,KAAK,CAAC,CAAC;EACxB;EAEQD,IAAIA,CAAA,EAAS;IACnB,KAAK,MAAMO,QAAQ,IAAI,IAAI,CAACV,SAAS,EAAE;MACrCU,QAAQ,CAAC,CAAC;IACZ;EACF;AACF;AAEO,MAAMI,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,IAAIhB,kBAAkB,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_fiberInternals","require","FiberScanRootStore","instance","listeners","Set","set","emit","clear","getFiber","fiber","fiberFromPublicInstance","resolveCurrentFiber","getInstance","subscribe","listener","add","delete","resetForTests","fiberScanRoot","exports"],"sourceRoot":"../../../../src","sources":["anchors/fiber/FiberScanR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CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,341 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.concreteFontFamily = concreteFontFamily;
7
+ exports.detectAppFontFamily = detectAppFontFamily;
8
+ exports.isBareCssFamily = isBareCssFamily;
9
+ exports.isIconFontFamily = isIconFontFamily;
10
+ exports.resetDetectedAppFont = resetDetectedAppFont;
11
+ exports.splitCssFamilies = splitCssFamilies;
12
+ exports.themeConcreteFontFamily = themeConcreteFontFamily;
13
+ var _screenTracker = require("../../screenTracker.js");
14
+ var _FiberScanRootStore = require("./FiberScanRootStore.js");
15
+ var _fiberInternals = require("./fiberInternals.js");
16
+ var _visibleScreens = require("./visibleScreens.js");
17
+ var _walkVisibleFibers = require("./walkVisibleFibers.js");
18
+ /**
19
+ * Host-app font used when a theme is still on the default CSS stack.
20
+ *
21
+ * React Native does not inherit `fontFamily` from a parent view, so the family
22
+ * actually in use is the one set on `Text`. The primary font is whichever
23
+ * family appears on the most visible host text under the scan root (the SDK
24
+ * overlay is a sibling and is not walked). Embedded banners are inside that
25
+ * root; their hosts use a `userflow-` testID and are not votes, or the bar's
26
+ * own text would win. Text with no family counts as the platform font. Icon
27
+ * faces are not content. Nested text with no family does not vote: the
28
+ * ancestor text already does, and a child run must not add another vote for
29
+ * that family or for the platform font.
30
+ *
31
+ * A finished walk is cached until the visible screen changes, the reported
32
+ * screen changes, or `Userflow.reset()`. A walk that hits the node cap is not
33
+ * cached. Failures return null.
34
+ */
35
+
36
+ const TEXT_HOST_NAMES = new Set(['Text', 'RCTText', 'RCTVirtualText']);
37
+
38
+ /** SDK hosts inside the scan root (embedded banners). Not the app's font. */
39
+ const SDK_HOST_TEST_ID_PREFIX = 'userflow-';
40
+
41
+ /** Cycle guard for nested-text inheritance. Real trees are only a few levels deep. */
42
+ const MAX_FONT_ANCESTORS = 50;
43
+ const CSS_GENERIC_FAMILIES = new Set(['sans-serif', 'serif', 'monospace', 'system-ui', 'ui-sans-serif', 'ui-serif', 'ui-monospace', 'ui-rounded', 'cursive', 'fantasy', 'emoji', 'math', 'fangsong', 'inherit', 'initial', 'unset']);
44
+
45
+ /** Short vector-icon families. Matched after stripping spaces and punctuation. */
46
+ const ICON_FONT_EXACT = new Set(['feather', 'antdesign', 'entypo', 'fontisto', 'simplelineicons', 'octicons', 'zocial', 'foundation', 'evilicons']);
47
+ let cache = null;
48
+
49
+ /** Drop the cached app font. Called from `Userflow.reset()`. */
50
+ function resetDetectedAppFont() {
51
+ cache = null;
52
+ }
53
+
54
+ /**
55
+ * Family to apply, or null when the app font is the platform face or could
56
+ * not be read. Never throws.
57
+ */
58
+ function detectAppFontFamily() {
59
+ try {
60
+ const instance = _FiberScanRootStore.fiberScanRoot.getInstance();
61
+ if (!instance || typeof instance !== 'object') return null;
62
+ const root = _FiberScanRootStore.fiberScanRoot.getFiber();
63
+ if (!root) return null;
64
+ if (cache?.instance === instance && cacheStillCurrent(cache, root)) return cache.family;
65
+ const tally = tallyHostText(root);
66
+ if (tally.truncated) {
67
+ if (!tally.voted) return null;
68
+ return pickMajority(tally.counts);
69
+ }
70
+ const family = tally.voted ? pickMajority(tally.counts) : null;
71
+ cache = {
72
+ instance,
73
+ family,
74
+ screens: tally.screens,
75
+ screenKey: reportedScreenKey()
76
+ };
77
+ return family;
78
+ } catch {
79
+ return null;
80
+ }
81
+ }
82
+
83
+ /**
84
+ * Faces that appear in the builder's default system stack. A comma-separated
85
+ * list made only of these and generic keywords is that default, not a custom
86
+ * font. A single concrete name is still kept, including `Roboto`.
87
+ */
88
+ const DEFAULT_STACK_FACES = new Set(['blinkmacsystemfont', 'segoe ui', 'roboto', 'helvetica', 'arial', 'apple color emoji', 'segoe ui emoji', 'segoe ui symbol']);
89
+
90
+ /**
91
+ * A single React Native family name. CSS stacks and generic keywords are not
92
+ * usable as a host `fontFamily` — RN treats the whole string as one face.
93
+ * Theme stacks are parsed by {@link themeConcreteFontFamily}.
94
+ */
95
+ function concreteFontFamily(value) {
96
+ if (typeof value !== 'string') return undefined;
97
+ const name = unwrapFontName(value);
98
+ if (!name || name.includes(',') || name.startsWith('-')) return undefined;
99
+ if (CSS_GENERIC_FAMILIES.has(name.toLowerCase())) return undefined;
100
+ return name;
101
+ }
102
+
103
+ /**
104
+ * Family a theme author chose. A single concrete name is kept. A comma-separated
105
+ * list keeps the first family that is not a generic or a default-stack face,
106
+ * so `"Source Sans Pro", sans-serif` stays Source Sans Pro and the system
107
+ * stack still resolves to undefined.
108
+ */
109
+ function themeConcreteFontFamily(value) {
110
+ if (typeof value !== 'string') return undefined;
111
+ const parts = splitCssFamilies(value);
112
+ if (parts.length === 0) return undefined;
113
+ if (parts.length === 1) return concreteFontFamily(parts[0]);
114
+ for (const part of parts) {
115
+ const name = concreteFontFamily(part);
116
+ if (!name || DEFAULT_STACK_FACES.has(name.toLowerCase())) continue;
117
+ return name;
118
+ }
119
+ return undefined;
120
+ }
121
+
122
+ /**
123
+ * Split a CSS `font-family` list. A quote that opens a family is wrapping and
124
+ * is removed; a quote inside a name stays, so `Foo"Bar` is one family.
125
+ * Commas inside wrapping quotes are not separators.
126
+ */
127
+ function splitCssFamilies(value) {
128
+ const parts = [];
129
+ let current = '';
130
+ let quote = null;
131
+ for (const char of value) {
132
+ if (quote) {
133
+ if (char === quote) quote = null;else current += char;
134
+ continue;
135
+ }
136
+ if ((char === '"' || char === "'") && current.trim() === '') {
137
+ quote = char;
138
+ continue;
139
+ }
140
+ if (char === ',') {
141
+ const name = current.trim();
142
+ if (name) parts.push(name);
143
+ current = '';
144
+ continue;
145
+ }
146
+ current += char;
147
+ }
148
+ const name = current.trim();
149
+ if (name) parts.push(name);
150
+ return parts;
151
+ }
152
+
153
+ /** Generic keywords and vendor-prefixed faces stay unquoted in CSS. */
154
+ function isBareCssFamily(name) {
155
+ return name.startsWith('-') || CSS_GENERIC_FAMILIES.has(name.toLowerCase());
156
+ }
157
+ function isIconFontFamily(name) {
158
+ const key = name.toLowerCase().replace(/[^a-z0-9]/g, '');
159
+ if (ICON_FONT_EXACT.has(key)) return true;
160
+ return key.startsWith('fontawesome') || key.startsWith('ionicons') || key.startsWith('materialcommunityicons') || key.startsWith('materialicons') || key.startsWith('materialsymbols');
161
+ }
162
+ function tallyHostText(root) {
163
+ const counts = new Map();
164
+ const screens = [];
165
+ let voted = false;
166
+ const {
167
+ truncated
168
+ } = (0, _walkVisibleFibers.walkVisibleFibers)(root, fiber => {
169
+ try {
170
+ if ((0, _visibleScreens.isScreenHostFiber)(fiber)) screens.push(fiber);
171
+ if (!isTextHost(fiber)) return;
172
+ const vote = voteFor(fiber, root);
173
+ if (vote === 'skip') return;
174
+ voted = true;
175
+ counts.set(vote, (counts.get(vote) ?? 0) + 1);
176
+ } catch {
177
+ // One unreadable node is not a vote.
178
+ }
179
+ });
180
+ return {
181
+ voted,
182
+ truncated,
183
+ screens,
184
+ counts
185
+ };
186
+ }
187
+
188
+ /** Usable family, null for the platform font, or skip for an icon face. */
189
+ function voteFor(fiber, root) {
190
+ if (isUnderSdkHost(fiber, root)) return 'skip';
191
+ const own = classifyFamily(readFontFamily(fiber));
192
+ if (own.kind === 'icon') return 'skip';
193
+ if (own.kind === 'family') return own.name;
194
+ if (own.kind === 'unusable') return null;
195
+ // No family of its own. The ancestor text node casts the vote for this run.
196
+ if (hasAncestorText(fiber, root)) return 'skip';
197
+ return null;
198
+ }
199
+ function hasAncestorText(fiber, root) {
200
+ let parent = (0, _fiberInternals.getReturn)(fiber);
201
+ for (let depth = 0; parent && parent !== root && depth < MAX_FONT_ANCESTORS; depth += 1) {
202
+ if (isTextHost(parent)) return true;
203
+ parent = (0, _fiberInternals.getReturn)(parent);
204
+ }
205
+ return false;
206
+ }
207
+ function cacheStillCurrent(cached, root) {
208
+ if (cached.screenKey !== reportedScreenKey()) return false;
209
+ if (cached.screens.length === 0) return true;
210
+ return cached.screens.every(screen => screenStillCurrent(screen, root));
211
+ }
212
+ function screenStillCurrent(screen, root) {
213
+ if (!(0, _visibleScreens.isFiberOnVisibleScreen)(screen)) return false;
214
+ let current = screen;
215
+ for (let depth = 0; current && depth < _fiberInternals.MAX_ANCESTOR_WALK; depth += 1) {
216
+ if (current === root) return true;
217
+ current = (0, _fiberInternals.getReturn)(current);
218
+ }
219
+ return false;
220
+ }
221
+ function reportedScreenKey() {
222
+ const location = (0, _screenTracker.getCurrentScreenLocation)();
223
+ if (!location) return null;
224
+ const key = 'path' in location ? location.path : location.screen;
225
+ return key || null;
226
+ }
227
+ function classifyFamily(raw) {
228
+ if (!raw) return {
229
+ kind: 'absent'
230
+ };
231
+ if (isIconFontFamily(raw)) return {
232
+ kind: 'icon'
233
+ };
234
+ const concrete = concreteFontFamily(raw);
235
+ if (!concrete) return {
236
+ kind: 'unusable'
237
+ };
238
+ return {
239
+ kind: 'family',
240
+ name: concrete
241
+ };
242
+ }
243
+ function pickMajority(counts) {
244
+ const platform = counts.get(null) ?? 0;
245
+ let bestName = null;
246
+ let bestCount = 0;
247
+ for (const [name, count] of counts) {
248
+ if (name == null) continue;
249
+ if (bestName == null || count > bestCount || count === bestCount && name < bestName) {
250
+ bestName = name;
251
+ bestCount = count;
252
+ }
253
+ }
254
+ if (bestName == null || platform > bestCount) return null;
255
+ return bestName;
256
+ }
257
+ function isUnderSdkHost(fiber, root) {
258
+ let parent = (0, _fiberInternals.getReturn)(fiber);
259
+ for (let depth = 0; parent && parent !== root && depth < MAX_FONT_ANCESTORS; depth += 1) {
260
+ try {
261
+ const testID = (0, _fiberInternals.getLiveHostProps)(parent)?.testID;
262
+ if (typeof testID === 'string' && testID.startsWith(SDK_HOST_TEST_ID_PREFIX)) {
263
+ return true;
264
+ }
265
+ } catch {
266
+ // An unreadable ancestor is not an SDK host.
267
+ }
268
+ parent = (0, _fiberInternals.getReturn)(parent);
269
+ }
270
+ return false;
271
+ }
272
+ function isTextHost(fiber) {
273
+ const typeName = (0, _fiberInternals.getHostTypeName)(fiber);
274
+ if (typeName && TEXT_HOST_NAMES.has(typeName)) return true;
275
+ const elementType = fiber?.elementType;
276
+ if (typeof elementType === 'string' && TEXT_HOST_NAMES.has(elementType)) return true;
277
+ try {
278
+ const node = (0, _fiberInternals.getStateNode)(fiber);
279
+ const className = node?.viewConfig?.uiViewClassName ?? node?.__viewConfig?.uiViewClassName;
280
+ return typeof className === 'string' && TEXT_HOST_NAMES.has(className);
281
+ } catch {
282
+ return false;
283
+ }
284
+ }
285
+ function readFontFamily(fiber) {
286
+ try {
287
+ const flat = flattenFontStyle((0, _fiberInternals.getLiveHostProps)(fiber)?.style);
288
+ const family = flat?.fontFamily;
289
+ if (typeof family !== 'string') return undefined;
290
+ const trimmed = family.trim();
291
+ return trimmed.length > 0 ? trimmed : undefined;
292
+ } catch {
293
+ return undefined;
294
+ }
295
+ }
296
+ function flattenFontStyle(style) {
297
+ if (style == null || style === false) return null;
298
+ if (typeof style === 'number') return flattenRegisteredStyle(style);
299
+ if (Array.isArray(style)) {
300
+ let family;
301
+ for (const entry of style) {
302
+ const flat = flattenFontStyle(entry);
303
+ if (flat && flat.fontFamily != null) family = flat.fontFamily;
304
+ }
305
+ return {
306
+ fontFamily: family
307
+ };
308
+ }
309
+ if (typeof style === 'object') return style;
310
+ return null;
311
+ }
312
+
313
+ /**
314
+ * StyleSheet ids are numbers. Resolve them only when one shows up so tests
315
+ * that pass plain style objects do not load react-native.
316
+ */
317
+ function flattenRegisteredStyle(styleId) {
318
+ try {
319
+ // Lazy require so unit tests that pass plain style objects do not load RN.
320
+ // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
321
+ const {
322
+ StyleSheet
323
+ } = require('react-native');
324
+ const flat = StyleSheet?.flatten?.(styleId);
325
+ return flat ?? null;
326
+ } catch {
327
+ return null;
328
+ }
329
+ }
330
+ function unwrapFontName(value) {
331
+ const trimmed = value.trim();
332
+ if (trimmed.length >= 2) {
333
+ const first = trimmed[0];
334
+ const last = trimmed[trimmed.length - 1];
335
+ if (first === '"' && last === '"' || first === "'" && last === "'") {
336
+ return trimmed.slice(1, -1).trim();
337
+ }
338
+ }
339
+ return trimmed;
340
+ }
341
+ //# sourceMappingURL=detectAppFontFamily.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_screenTracker","require","_FiberScanRootStore","_fiberInternals","_visibleScreens","_walkVisibleFibers","TEXT_HOST_NAMES","Set","SDK_HOST_TEST_ID_PREFIX","MAX_FONT_ANCESTORS","CSS_GENERIC_FAMILIES","ICON_FONT_EXACT","cache","resetDetectedAppFont","detectAppFontFamily","instance","fiberScanRoot","getInstance","root","getFiber","cacheStillCurrent","family","tally","tallyHostText","truncated","voted","pickMajority","counts","screens","screenKey","reportedScreenKey","DEFAULT_STACK_FACES","concreteFontFamily","value","undefined","name","unwrapFontName","includes","startsWith","has","toLowerCase","themeConcreteFontFamily","parts","splitCssFamilies","length","part","current","quote","char","trim","push","isBareCssFamily","isIconFontFamily","key","replace","Map","walkVisibleFibers","fiber","isScreenHostFiber","isTextHost","vote","voteFor","set","get","isUnderSdkHost","own","classifyFamily","readFontFamily","kind","hasAncestorText","parent","getReturn","depth","cached","every","screen","screenStillCurrent","isFiberOnVisibleScreen","MAX_ANCESTOR_WALK","location","getCurrentScreenLocation","path","raw","concrete","platform","bestName","bestCount","count","testID","getLiveHostProps","typeName","getHostTypeName","elementType","node","getStateNode","className","viewConfig","uiViewClassName","__viewConfig","flat","flattenFontStyle","style","fontFamily","trimmed","flattenRegisteredStyle","Array","isArray","entry","styleId","StyleSheet","flatten","first","last","slice"],"sourceRoot":"../../../../src","sources":["anchors/fiber/detectAppFontFamily.ts"],"mappings":";;;;;;;;;;;;AAiBA,IAAAA,cAAA,GAAAC,OAAA;AAEA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AAQA,IAAAG,eAAA,GAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAJ,OAAA;AA7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,CAAC,CAAC;IACpC;EACF;EACA,OAAOsD,OAAO;AAChB","ignoreList":[]}
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.coveredScreenBranches = coveredScreenBranches;
7
7
  exports.isFiberOnVisibleScreen = isFiberOnVisibleScreen;
8
8
  exports.isScreenContainerFiber = isScreenContainerFiber;
9
+ exports.isScreenHostFiber = isScreenHostFiber;
9
10
  exports.screensCoveringFiber = screensCoveringFiber;
10
11
  var _fiberInternals = require("./fiberInternals.js");
11
12
  /**
@@ -56,6 +57,11 @@ function isScreenFiber(fiber) {
56
57
  const type = (0, _fiberInternals.getHostTypeName)(fiber);
57
58
  return type !== undefined && SCREEN_TYPES.has(type);
58
59
  }
60
+
61
+ /** Host screen the walk can key a cache on (`RNSScreen`, `RNSModalScreen`). */
62
+ function isScreenHostFiber(fiber) {
63
+ return isScreenFiber(fiber);
64
+ }
59
65
  function isStackContainer(fiber) {
60
66
  const type = (0, _fiberInternals.getHostTypeName)(fiber);
61
67
  return type !== undefined && STACK_CONTAINER_TYPES.has(type);
@@ -1 +1 @@
1
- {"version":3,"names":["_fiberInternals","require","SCREEN_TYPES","Set","SCREEN_CONTAINER_TYPES","STACK_CONTAINER_TYPES","ACTIVITY_STATE_ACTIVE","MAX_BRANCH_NODES","isScreenContainerFiber","fiber","type","getHostTypeName","undefined","has","isScreenFiber","isStackContainer","ownedScreen","branch","stack","visited","length","pop","sibling","getSibling","push","child","getChild","isActive","screen","getMemoizedProps","activityState","screenBranches","container","branches","guard","visible","active","filter","entry","coveredScreenBranches","covered","includes","add","alternate","coveringContainer","previous","current","depth","MAX_ANCESTOR_WALK","resolveCurrentFiber","previousAlternate","getAlternate","getReturn","isFiberOnVisibleScreen","screensCoveringFiber","map","reverse"],"sourceRoot":"../../../../src","sources":["anchors/fiber/visibleScreens.ts"],"mappings":";;;;;;;;;AAyBA,IAAAA,eAAA,GAAAC,OAAA;AAzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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C,CAAC;EACd,CAAC,CAAC,MAAM;IACN,OAAO,EAAE;EACX;AACF","ignoreList":[]}
1
+ {"version":3,"names":["_fiberInternals","require","SCREEN_TYPES","Set","SCREEN_CONTAINER_TYPES","STACK_CONTAINER_TYPES","ACTIVITY_STATE_ACTIVE","MAX_BRANCH_NODES","isScreenContainerFiber","fiber","type","getHostTypeName","undefined","has","isScreenFiber","isScreenHostFiber","isStackContainer","ownedScreen","branch","stack","visited","length","pop","sibling","getSibling","push","child","getChild","isActive","screen","getMemoizedProps","activityState","screenBranches","container","branches","guard","visible","active","filter","entry","coveredScreenBranches","covered","includes","add","alternate","coveringContainer","previous","current","depth","MAX_ANCESTOR_WALK","resolveCurrentFiber","previousAlternate","getAlternate","getReturn","isFiberOnVisibleScreen","screensCoveringFiber","map","reverse"],"sourceRoot":"../../../../src","sources":["anchors/fiber/visibleScreens.ts"],"mappings":";;;;;;;;;;AAyBA,IAAAA,eAAA,GAAAC,OAAA;AAzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaA;AACA,MAAMC,YAAY,GAAG,IAAIC,GAAG,CAAC,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC;;AAE7D;AACA,MAAMC,sBAAsB,GAAG,IAAID,GAAG,CAAC,CACrC,gBAAgB,EAChB,oBAAoB,EACpB,8BAA8B,CAC/B,CAAC;;AAEF;AACA,MAAME,qBAAqB,GAAG,IAAIF,GAAG,CAAC,CAAC,gBAAgB,CAAC,CAAC;;AAEzD;AACA,MAAMG,qBAAqB,GAAG,CAAC;;AAE/B;AACA,MAAMC,gBAAgB,GAAG,GAAG;AAErB,SAASC,sBAAsBA,CAACC,KAAe,EAAW;EAC/D,MAAMC,IAAI,GAAG,IAAAC,+BAAe,EAACF,KAAK,CAAC;EACnC,OAAOC,IAAI,KAAKE,SAAS,IAAIR,sBAAsB,CAACS,G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AAE,OAAOlB,SAAS;IAC3E;IACAa,QAAQ,GAAGC,OAAO;IAClBA,OAAO,GAAG,IAAAM,yBAAS,EAACN,OAAO,CAAC;EAC9B;EACA,OAAO,IAAI;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASO,sBAAsBA,CAAC7C,KAAe,EAAW;EAC/D,IAAI,CAACA,KAAK,EAAE,OAAO,KAAK;EACxB,IAAI;IACF,OAAOoC,iBAAiB,CAACpC,KAAK,CAAC,KAAK,IAAI;EAC1C,CAAC,CAAC,MAAM;IACN;IACA,OAAO,IAAI;EACb;AACF;;AAEA;AACA;AACA;AACA;AACO,SAAS8C,oBAAoBA,CAAC9C,KAAe,EAAc;EAChE,IAAI,CAACA,KAAK,EAAE,OAAO,EAAE;EACrB,IAAI;IACF,MAAMwB,SAAS,GAAGY,iBAAiB,CAACpC,KAAK,CAAC;IAC1C,IAAI,CAACwB,SAAS,EAAE,OAAO,EAAE;IACzB,OAAOD,cAAc,CAACC,SAAS,CAAC,CAC7BG,OAAO,CAACoB,GAAG,CAAEjB,KAAK,IAAKA,KAAK,CAACV,MAAM,CAAC,CACpC4B,OAAO,CAAC,CAAC;EACd,CAAC,CAAC,MAAM;IACN,OAAO,EAAE;EACX;AACF","ignoreList":[]}
@@ -9,6 +9,7 @@ var React = _interopRequireWildcard(require("react"));
9
9
  var _reactNative = require("react-native");
10
10
  var _resolveBannerTheme = require("../surfaces/resolveBannerTheme.js");
11
11
  var _resolveBannerButtonChrome = require("./resolveBannerButtonChrome.js");
12
+ var _resolveContentFontFamily = require("./resolveContentFontFamily.js");
12
13
  var _resolveStepButtonChrome = require("./resolveStepButtonChrome.js");
13
14
  var _jsxRuntime = require("react/jsx-runtime");
14
15
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
@@ -36,7 +37,7 @@ function BannerStepButton({
36
37
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
37
38
  style: [styles.label, {
38
39
  color: chrome.fontColor,
39
- fontFamily: theme.fontFamily || undefined,
40
+ fontFamily: (0, _resolveContentFontFamily.resolveContentFontFamily)(theme),
40
41
  fontSize: chrome.fontSize,
41
42
  fontWeight: chrome.fontWeight,
42
43
  ...labelMetrics(chrome.lineHeight)
@@ -1 +1 @@
1
- {"version":3,"names":["_core","require","React","_interopRequireWildcard","_reactNative","_resolveBannerTheme","_resolveBannerButtonChrome","_resolveStepButtonChrome","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","BannerStepButton","button","theme","sessionData","onActions","label","interpolateSessionData","text","bannerBackground","resolveBannerBackgroundColor","bannerForeground","resolveBannerForegroundColor","chrome","resolveBannerButtonChrome","appearance","jsx","Pressable","testID","cvid","accessibilityRole","accessibilityLabel","onPress","actions","style","pressed","styles","stepButtonContainerStyle","opacity","children","Text","color","fontColor","fontFamily","undefined","fontSize","fontWeight","labelMetrics","lineHeight","Platform","OS","includeFontPadding","textAlignVertical","StyleSheet","create","alignItems","justifyContent","textAlign"],"sourceRoot":"../../../src","sources":["content/BannerStepButton.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAMA,IAAAC,KAAA,GAAAC,uBAAA,CAAAF,OAAA;AAEA,IAAAG,YAAA,GAAAH,OAAA;AAEA,IAAAI,mBAAA,GAAAJ,OAAA;AAKA,IAAAK,0BAAA,GAAAL,OAAA;AACA,IAAAM,wBA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EACA,OAAO;IAAEJ;EAAW,CAAC;AACvB;AAEA,MAAMZ,MAAM,GAAGiB,uBAAU,CAACC,MAAM,CAAC;EAC/B1C,MAAM,EAAE;IACN2C,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDxC,KAAK,EAAE;IACLyC,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_core","require","React","_interopRequireWildcard","_reactNative","_resolveBannerTheme","_resolveBannerButtonChrome","_resolveContentFontFamily","_resolveStepButtonChrome","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","BannerStepButton","button","theme","sessionData","onActions","label","interpolateSessionData","text","bannerBackground","resolveBannerBackgroundColor","bannerForeground","resolveBannerForegroundColor","chrome","resolveBannerButtonChrome","appearance","jsx","Pressable","testID","cvid","accessibilityRole","accessibilityLabel","onPress","actions","style","pressed","styles","stepButtonContainerStyle","opacity","children","Text","color","fontColor","fontFamily","resolveContentFontFamily","fontSize","fontWeight","labelMetrics","lineHeight","Platform","OS","includeFontPadding","textAlignVertical","StyleSheet","create","alignItems","justifyContent","textAlign"],"sourceRoot":"../../../src","sources":["content/BannerStepButton.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAMA,IAAAC,KAAA,GAAAC,uBAAA,CAAAF,OAAA;AAEA,IAAAG,YAAA,GAAAH,OAAA;AAEA,IAAAI,mBAAA,GAAAJ,OAAA;AAKA,IAAAK,0BAAA,GAAAL,OAAA;AACA,IAAAM,yBAAA,GAAAN,OAAA;AACA,IAAAO,wBAAA,GAAAP,OAAA;AAAqE,IAAAQ,WAAA,GAAAR,OAAA;AAAA,SAAAE,wBAAAO,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAT,uBAAA,YAAAA,CAAA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,EAAE;IACLyC,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]}
@@ -12,6 +12,7 @@ var _StepButton = require("./StepButton.js");
12
12
  var _deserialize = require("./deserialize.js");
13
13
  var _imageLayout = require("./imageLayout.js");
14
14
  var _migrateFlowBlocks = require("./migrateFlowBlocks.js");
15
+ var _resolveContentFontFamily = require("./resolveContentFontFamily.js");
15
16
  var _themeColor = require("./themeColor.js");
16
17
  var _jsxRuntime = require("react/jsx-runtime");
17
18
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
@@ -489,22 +490,27 @@ function RenderedButton({
489
490
  });
490
491
  }
491
492
  function baseText(theme) {
493
+ const fontFamily = (0, _resolveContentFontFamily.resolveContentFontFamily)(theme);
492
494
  return {
493
495
  color: theme.fontColor,
494
- fontFamily: theme.fontFamily || undefined,
495
- fontSize: theme.fontSize
496
+ fontSize: theme.fontSize,
497
+ // Omit the key when unset. An explicit `undefined` is flattened to null,
498
+ // and RN treats that as "use the default face" rather than keeping a
499
+ // family set earlier on the same run.
500
+ ...(fontFamily != null ? {
501
+ fontFamily
502
+ } : {})
496
503
  };
497
504
  }
498
505
  function markStyle(node) {
499
- return {
500
- fontWeight: node.bold ? '700' : undefined,
501
- fontStyle: node.italic ? 'italic' : undefined,
502
- textDecorationLine: textDecoration(node),
503
- fontSize: node.small ? 12 : node.sup ? 10 : undefined,
504
- color: node.color || undefined,
505
- // Inline `code` uses View chrome via RenderedText / RenderedAttribute.
506
- fontFamily: node.code ? monoFontFamily() : undefined
507
- };
506
+ const style = {};
507
+ if (node.bold) style.fontWeight = '700';
508
+ if (node.italic) style.fontStyle = 'italic';
509
+ const decoration = textDecoration(node);
510
+ if (decoration) style.textDecorationLine = decoration;
511
+ if (node.small) style.fontSize = 12;else if (node.sup) style.fontSize = 10;
512
+ if (node.color) style.color = node.color;
513
+ return style;
508
514
  }
509
515
 
510
516
  /** View wrapper so inline code padding/radius work reliably on Android. */