@guidelytech/react-native 0.10.0 → 0.12.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/README.md +71 -2
- package/dist/index.cjs +1222 -150
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +255 -32
- package/dist/index.d.ts +255 -32
- package/dist/index.js +1206 -138
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -85,12 +85,77 @@ tasks).
|
|
|
85
85
|
| `useChecklistProgress(key)`, `useGuideState(key)`, `useActiveGuide()` | Live state |
|
|
86
86
|
| `<GuidelyTarget id>`, `useGuidelyTarget(id)` | Guide targets |
|
|
87
87
|
| `<GuidelyScreenScope name>`, `guidelyScreenLayout` | Screen scoping for targets |
|
|
88
|
+
| `<GuidelyMask>` | Keeps its children's text out of tap analytics |
|
|
88
89
|
|
|
89
90
|
Provider props: `projectId`, `apiUrl`, `environment`, `storage`, `user`, `debug`, `analytics`,
|
|
90
91
|
`consent` (`granted` / `pending` / `denied`), `appVersion` (for *App version* rules), `theme`,
|
|
91
92
|
`configRefreshMs`, `onNavigate`, `onError`, `showChecklistLauncher` (default `true`),
|
|
92
93
|
`showResourceCenterLauncher` (default `false`), `showMessengerLauncher` (default `true`), `insets`,
|
|
93
|
-
`launcherOffset` (default 72)
|
|
94
|
+
`launcherOffset` (default 72), `autocapture`, `appBuild`.
|
|
95
|
+
|
|
96
|
+
## Product analytics (autocapture)
|
|
97
|
+
|
|
98
|
+
The SDK records the same product-analytics events as the web SDK, so taps, time on screen and
|
|
99
|
+
heatmaps show up in Pages, Heatmaps, Features, Funnels and Paths next to web clicks. Each capability
|
|
100
|
+
runs when the project turns it on (Settings → Product analytics) and analytics are allowed
|
|
101
|
+
(`analytics`, `consent`). The `autocapture` prop can only turn things off:
|
|
102
|
+
|
|
103
|
+
```tsx
|
|
104
|
+
<GuidelyProvider autocapture={{ clicks: false, heatmaps: false }} appVersion={version} appBuild={build} …>
|
|
105
|
+
// autocapture={false} turns everything off, including screen page views, and removes the wrapper view
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
| Event | When | Properties |
|
|
109
|
+
|---|---|---|
|
|
110
|
+
| `click` | A tap on an interactive element | `selector`, `tag`, `text?`, `x`, `y`, `platform` |
|
|
111
|
+
| `rage_click` | 3+ taps within 1 s and 30 pt | the `click` properties of the tapped (or hit) view + `count` |
|
|
112
|
+
| `heatmap` | Every 40 taps, on screen change and when the app goes to the background | `path?`, `viewportWidth`, `viewportHeight`, `pageHeight`, `platform`, `points` |
|
|
113
|
+
| `page_leave` | The screen changes or the app goes to the background | `path?`, `screen`, `durationMs`, `scrollDepth: 100`, `platform` |
|
|
114
|
+
| `page_view` | `screen()` with a new name; after returning to the foreground with `resumed: true` | `path`, `screen`, `platform` |
|
|
115
|
+
| `app_install` / `app_update` | First launch / a launch with a new `appVersion` or `appBuild` | `appVersion`, `build`, `previousVersion`, `previousBuild` |
|
|
116
|
+
| `app_open` / `app_background` | Cold start and return to the foreground / background | `coldStart` / `foregroundMs` |
|
|
117
|
+
|
|
118
|
+
**Taps.** The provider wraps your app in a full-size `View` (`flex: 1`) with capture-phase touch
|
|
119
|
+
handlers that only observe: they never claim the responder, stop propagation or delay anything. A
|
|
120
|
+
tap is a single-finger touch that moves ≤ 10 pt and lasts < 1 s. Guidely's own UI (guide cards,
|
|
121
|
+
launchers, messenger) is rendered outside the wrapper and never captured.
|
|
122
|
+
|
|
123
|
+
**Selectors**, first match wins:
|
|
124
|
+
|
|
125
|
+
1. A `<GuidelyTarget id>` / `useGuidelyTarget(id)` whose frame contains the tap (the smallest one) → `#<id>`.
|
|
126
|
+
The same id works in guides, Features and on the web (`data-guidely-id`), so this is the
|
|
127
|
+
recommended way to name what matters.
|
|
128
|
+
2. The `nativeID` → `[nativeID="…"]`, then `testID` → `[testID="…"]` of the tapped interactive element.
|
|
129
|
+
3. A short component path, innermost last: `Row:nth-of-type(3) > Pressable`.
|
|
130
|
+
|
|
131
|
+
The interactive element is the innermost component with `onPress` / `onLongPress` (`Pressable`,
|
|
132
|
+
`Touchable*`, `Button`, `Text onPress`, React Navigation buttons), else one with an interactive
|
|
133
|
+
`accessibilityRole` / `role` (`button`, `link`, `tab`, `switch`, …). `tag` is its component name and
|
|
134
|
+
`text` its visible text (else its accessibility label), whitespace collapsed, ≤ 100 characters.
|
|
135
|
+
Taps on anything else record no `click` (they still count for rage taps and heatmaps). Text is
|
|
136
|
+
never taken from a `TextInput`, and is left out inside `<GuidelyMask>` and when the project masks
|
|
137
|
+
all text in replays:
|
|
138
|
+
|
|
139
|
+
```tsx
|
|
140
|
+
import { GuidelyMask } from "@guidelytech/react-native";
|
|
141
|
+
<GuidelyMask><Pressable onPress={showCard}><Text>{cardNumber}</Text></Pressable></GuidelyMask>
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**App lifecycle.** `app_install` / `app_update` need the `appVersion` prop (e.g.
|
|
145
|
+
`Application.nativeApplicationVersion` from `expo-application`; `appBuild` from
|
|
146
|
+
`nativeBuildVersion`) and `storage`; the last version is stored per public key. An app that already
|
|
147
|
+
had Guidely installed stores its version silently on the first launch with this release.
|
|
148
|
+
|
|
149
|
+
**Limitations.** React Native has no public API for "which component is under this point", so
|
|
150
|
+
element resolution (steps 2 and 3, `tag`, `text`) reads React's internal component tree of the touch
|
|
151
|
+
event. It is best-effort and guarded: when it is unavailable the tap still counts (heatmaps, rage
|
|
152
|
+
taps, `#<id>` targets), and nothing ever throws into your app. Component names come from
|
|
153
|
+
`displayName` / function names; Metro keeps function names by default, but a custom minifier that
|
|
154
|
+
mangles them makes paths less readable — use `GuidelyTarget`, `nativeID` or `testID` for stable
|
|
155
|
+
names. Taps handled entirely by native gesture recognizers (`react-native-gesture-handler` buttons,
|
|
156
|
+
native-stack headers, some third-party native views) may not reach JavaScript touch handlers and are
|
|
157
|
+
then not captured. Coordinates are relative to the React Native root view (the window in a
|
|
158
|
+
full-screen app).
|
|
94
159
|
|
|
95
160
|
## Feature flags
|
|
96
161
|
|
|
@@ -139,7 +204,11 @@ guidely.closeMessenger();
|
|
|
139
204
|
useGuidelyEvent("conversation:message", ({ message }) => console.log(message.body));
|
|
140
205
|
```
|
|
141
206
|
|
|
142
|
-
|
|
207
|
+
Users can drag the bubble out of the way (e.g. off your map controls): it snaps to the nearer side
|
|
208
|
+
edge at the height they drop it, never lower than its default spot (so it stays clear of tab bars),
|
|
209
|
+
and the device remembers it across launches (only for the app session without `storage`). A tap
|
|
210
|
+
still opens the messenger. `showMessengerLauncher={false}` hides the bubble so you can open the
|
|
211
|
+
messenger from your own UI.
|
|
143
212
|
`openResourceCenter()` opens the Help tab while the messenger is on, and `reset()` forgets the
|
|
144
213
|
install's conversations.
|
|
145
214
|
|