rn-smart-tour 2.0.0-beta.1 → 2.0.0-rc.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 (100) hide show
  1. package/README.md +129 -9
  2. package/lib/commonjs/compat.js +1 -1
  3. package/lib/commonjs/compat.js.map +1 -1
  4. package/lib/commonjs/core/TourEngine.js +323 -46
  5. package/lib/commonjs/core/TourEngine.js.map +1 -1
  6. package/lib/commonjs/core/controller.js +8 -2
  7. package/lib/commonjs/core/controller.js.map +1 -1
  8. package/lib/commonjs/index.js +22 -0
  9. package/lib/commonjs/index.js.map +1 -1
  10. package/lib/commonjs/react/TourOverlay.js +328 -71
  11. package/lib/commonjs/react/TourOverlay.js.map +1 -1
  12. package/lib/commonjs/react/TourOverlayHost.js +46 -0
  13. package/lib/commonjs/react/TourOverlayHost.js.map +1 -0
  14. package/lib/commonjs/react/TourProvider.js +34 -9
  15. package/lib/commonjs/react/TourProvider.js.map +1 -1
  16. package/lib/commonjs/react/TourTarget.js +29 -2
  17. package/lib/commonjs/react/TourTarget.js.map +1 -1
  18. package/lib/commonjs/react/context.js +7 -1
  19. package/lib/commonjs/react/context.js.map +1 -1
  20. package/lib/commonjs/react/hooks.js +34 -0
  21. package/lib/commonjs/react/hooks.js.map +1 -1
  22. package/lib/commonjs/react/placement.js +9 -1
  23. package/lib/commonjs/react/placement.js.map +1 -1
  24. package/lib/module/compat.js +1 -1
  25. package/lib/module/compat.js.map +1 -1
  26. package/lib/module/core/TourEngine.js +322 -45
  27. package/lib/module/core/TourEngine.js.map +1 -1
  28. package/lib/module/core/controller.js +8 -2
  29. package/lib/module/core/controller.js.map +1 -1
  30. package/lib/module/index.js +3 -2
  31. package/lib/module/index.js.map +1 -1
  32. package/lib/module/react/TourOverlay.js +329 -73
  33. package/lib/module/react/TourOverlay.js.map +1 -1
  34. package/lib/module/react/TourOverlayHost.js +39 -0
  35. package/lib/module/react/TourOverlayHost.js.map +1 -0
  36. package/lib/module/react/TourProvider.js +36 -11
  37. package/lib/module/react/TourProvider.js.map +1 -1
  38. package/lib/module/react/TourTarget.js +30 -3
  39. package/lib/module/react/TourTarget.js.map +1 -1
  40. package/lib/module/react/context.js +6 -0
  41. package/lib/module/react/context.js.map +1 -1
  42. package/lib/module/react/hooks.js +33 -0
  43. package/lib/module/react/hooks.js.map +1 -1
  44. package/lib/module/react/placement.js +9 -1
  45. package/lib/module/react/placement.js.map +1 -1
  46. package/lib/typescript/commonjs/src/core/TourEngine.d.ts +62 -4
  47. package/lib/typescript/commonjs/src/core/TourEngine.d.ts.map +1 -1
  48. package/lib/typescript/commonjs/src/core/controller.d.ts +10 -2
  49. package/lib/typescript/commonjs/src/core/controller.d.ts.map +1 -1
  50. package/lib/typescript/commonjs/src/index.d.ts +5 -3
  51. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  52. package/lib/typescript/commonjs/src/react/TourOverlay.d.ts +39 -3
  53. package/lib/typescript/commonjs/src/react/TourOverlay.d.ts.map +1 -1
  54. package/lib/typescript/commonjs/src/react/TourOverlayHost.d.ts +23 -0
  55. package/lib/typescript/commonjs/src/react/TourOverlayHost.d.ts.map +1 -0
  56. package/lib/typescript/commonjs/src/react/TourProvider.d.ts +17 -1
  57. package/lib/typescript/commonjs/src/react/TourProvider.d.ts.map +1 -1
  58. package/lib/typescript/commonjs/src/react/TourTarget.d.ts.map +1 -1
  59. package/lib/typescript/commonjs/src/react/context.d.ts +6 -1
  60. package/lib/typescript/commonjs/src/react/context.d.ts.map +1 -1
  61. package/lib/typescript/commonjs/src/react/hooks.d.ts +10 -1
  62. package/lib/typescript/commonjs/src/react/hooks.d.ts.map +1 -1
  63. package/lib/typescript/commonjs/src/react/placement.d.ts +3 -2
  64. package/lib/typescript/commonjs/src/react/placement.d.ts.map +1 -1
  65. package/lib/typescript/commonjs/src/types.d.ts +144 -5
  66. package/lib/typescript/commonjs/src/types.d.ts.map +1 -1
  67. package/lib/typescript/module/src/core/TourEngine.d.ts +62 -4
  68. package/lib/typescript/module/src/core/TourEngine.d.ts.map +1 -1
  69. package/lib/typescript/module/src/core/controller.d.ts +10 -2
  70. package/lib/typescript/module/src/core/controller.d.ts.map +1 -1
  71. package/lib/typescript/module/src/index.d.ts +5 -3
  72. package/lib/typescript/module/src/index.d.ts.map +1 -1
  73. package/lib/typescript/module/src/react/TourOverlay.d.ts +39 -3
  74. package/lib/typescript/module/src/react/TourOverlay.d.ts.map +1 -1
  75. package/lib/typescript/module/src/react/TourOverlayHost.d.ts +23 -0
  76. package/lib/typescript/module/src/react/TourOverlayHost.d.ts.map +1 -0
  77. package/lib/typescript/module/src/react/TourProvider.d.ts +17 -1
  78. package/lib/typescript/module/src/react/TourProvider.d.ts.map +1 -1
  79. package/lib/typescript/module/src/react/TourTarget.d.ts.map +1 -1
  80. package/lib/typescript/module/src/react/context.d.ts +6 -1
  81. package/lib/typescript/module/src/react/context.d.ts.map +1 -1
  82. package/lib/typescript/module/src/react/hooks.d.ts +10 -1
  83. package/lib/typescript/module/src/react/hooks.d.ts.map +1 -1
  84. package/lib/typescript/module/src/react/placement.d.ts +3 -2
  85. package/lib/typescript/module/src/react/placement.d.ts.map +1 -1
  86. package/lib/typescript/module/src/types.d.ts +144 -5
  87. package/lib/typescript/module/src/types.d.ts.map +1 -1
  88. package/package.json +2 -2
  89. package/src/compat.ts +1 -1
  90. package/src/core/TourEngine.ts +309 -46
  91. package/src/core/controller.ts +20 -2
  92. package/src/index.ts +5 -3
  93. package/src/react/TourOverlay.tsx +325 -51
  94. package/src/react/TourOverlayHost.tsx +39 -0
  95. package/src/react/TourProvider.tsx +61 -7
  96. package/src/react/TourTarget.tsx +48 -6
  97. package/src/react/context.ts +8 -1
  98. package/src/react/hooks.ts +43 -1
  99. package/src/react/placement.ts +11 -2
  100. package/src/types.ts +158 -6
package/README.md CHANGED
@@ -15,7 +15,11 @@
15
15
  - 📜 **Auto-Scroll**: Works with `ScrollView`, `FlatList` and `SectionList`; each target scrolls its own nearest list.
16
16
  - ⚡ **No Re-Render Cost**: Mounting and measuring targets re-renders nothing; components subscribe only to the tour state they use.
17
17
  - 💾 **Seen State Caching**: Persistent "only-once" logic with pluggable storage (AsyncStorage, MMKV, etc.).
18
- - 🛟 **Never Gets Stuck**: If a step's target isn't on screen in time, the tour ends (or skips the step) instead of leaving an invisible, active tour.
18
+ - 🛟 **Never Gets Stuck**: If a step's target isn't on screen in time, the tour ends, skips the step, or (walkthroughs) pauses with a Resume chip — never an invisible, active tour.
19
+ - 🙋 **"How do I…?" Walkthroughs**: Guide users through real tasks — they tap the real buttons and fill in the real form — with a searchable help list.
20
+ - 🪟 **Works With Your Popups**: The tour is drawn over the app, your modals open above it, and steps can point inside them.
21
+ - 🎨 **Your Design**: Render the card and resume chip with your own components and theme.
22
+ - 📊 **Analytics**: One callback reports starts, steps, completions, exits (and why) for funnels in your own backend.
19
23
  - 🔁 **Replay on Demand**: `startTour(id, { force: true })`, `resetTour(id)` and `resetAll()`, from components or from outside React.
20
24
 
21
25
  ---
@@ -23,8 +27,8 @@
23
27
  ## 📦 Installation
24
28
 
25
29
  ```sh
26
- npm install rn-smart-tour@next # 2.0 beta (this README)
27
- npm install rn-smart-tour # 1.x (stable)
30
+ npm install rn-smart-tour@next # 2.0 release candidate (this README)
31
+ npm install rn-smart-tour # 1.x (stable, until 2.0.0)
28
32
  ```
29
33
 
30
34
  Requires React 18+ and React Native 0.73+. No native code, so no `pod install` or rebuild is needed. React Navigation (6+) is optional.
@@ -197,7 +201,71 @@ const TourCard = ({ step, stepIndex, stepCount, isFirstStep, isLastStep, next, p
197
201
  backdropColor="rgba(0, 0, 0, 0.6)">
198
202
  ```
199
203
 
200
- ### 9. Start Tours from Outside React (Optional)
204
+ For walkthroughs, the props also tell the card what kind of step it is: `isActionStep` (the user taps the element or the app emits an event — hide Next), `isInteractive` (the element is usable, then Next) and `isCentered` (no target). `tour.kind` tells a walkthrough ("Exit") from a tour ("Skip").
205
+
206
+ ### 9. "How do I…?" Walkthroughs (Optional)
207
+ A walkthrough guides the user through a task in the real app — they tap the real buttons and the walkthrough follows along. Start it from a help list instead of automatically.
208
+
209
+ ```tsx
210
+ const TOURS = {
211
+ applyLeave: {
212
+ id: 'applyLeave',
213
+ kind: 'walkthrough',
214
+ title: 'Apply for leave',
215
+ keywords: ['holiday', 'sick'],
216
+ canStart: ctx => (ctx.isOnline ? true : 'Connect to the internet to apply for leave'),
217
+ steps: [
218
+ { title: "Let's apply for leave", description: 'It takes about a minute.' }, // no targetId: centred card
219
+ { targetId: 'menu', title: 'Open the menu', description: '', advanceOn: 'press' },
220
+ { targetId: 'leave', title: 'Tap Leave Management', description: '', advanceOn: 'press' },
221
+ { targetId: 'apply', title: 'Tap Apply Leave', description: '', advanceOn: 'press' },
222
+ { targetId: 'leaveType', title: 'Pick the leave type', description: '', interactive: true }, // usable, then Next
223
+ { targetId: 'submit', title: 'Tap Submit Request', description: 'This sends a real request.', advanceOn: 'press' },
224
+ { title: 'All done!', description: 'Track it under My Leave requests.' },
225
+ ],
226
+ },
227
+ };
228
+
229
+ <TourProvider
230
+ tours={TOURS}
231
+ context={{ isOnline }} // what canStart / when check
232
+ onStartBlocked={(tour, reason) => Toast.show(reason)} // canStart said no
233
+ >
234
+ ```
235
+
236
+ - `advanceOn: 'press'` — the highlighted element stays tappable; the step moves on when the user taps it. The rest of the screen stays blocked.
237
+ - `advanceOn: { event: 'leaveTypeChosen' }` — moves on when the app calls `emit('leaveTypeChosen')` (from `useTour()` or a controller).
238
+ - `interactive: true` — for form fields: the highlighted element stays usable (type, pick a date, open a dropdown) and the step moves on with Next. Taps elsewhere stay blocked.
239
+ - `when: ctx => …` — shows a step only when it applies (e.g. managers only); step counts skip hidden steps.
240
+ - If the user leaves the path, a walkthrough **pauses** (instead of ending) and shows a "Resume" chip (`renderResumeChip` to draw your own). Resuming continues from the latest step whose element is on screen, so the user is guided back.
241
+
242
+ List walkthroughs for a help screen with `useTourCatalog`:
243
+
244
+ ```tsx
245
+ const tasks = useTourCatalog({ kind: 'walkthrough', query: searchText });
246
+ // [{ id: 'applyLeave', title: 'Apply for leave', kind: 'walkthrough' }, …]
247
+ const { startTour } = useTour();
248
+ <Button title={task.title} onPress={() => startTour(task.id, { force: true })} />
249
+ ```
250
+
251
+ ### 10. Steps Inside Popups (Optional)
252
+ The overlay is drawn over your app, so the app's own modals open *above* it. To point a step at something inside a modal, wrap the modal's content in `TourOverlayHost`; steps whose target is inside it are drawn inside the modal.
253
+
254
+ ```tsx
255
+ import { TourOverlayHost } from 'rn-smart-tour';
256
+
257
+ <Modal visible={visible} transparent>
258
+ <TourOverlayHost>
259
+ <TourTarget name="endDay">
260
+ <Button title="End Day" onPress={endDay} />
261
+ </TourTarget>
262
+ </TourOverlayHost>
263
+ </Modal>
264
+ ```
265
+
266
+ Put it in your app's shared modal component once and every popup can host steps. It uses the provider's card, colors and width. Outside a `TourProvider` it just renders its children.
267
+
268
+ ### 11. Start Tours from Outside React (Optional)
201
269
  For deep links or notification handlers, create a controller and pass it to the provider:
202
270
 
203
271
  ```tsx
@@ -211,6 +279,28 @@ export const tours = createTourController({ tours: TOURS, storageAdapter: mmkvAd
211
279
  tours.startTour('new-feature', { force: true });
212
280
  ```
213
281
 
282
+ ### 12. Analytics (Optional)
283
+ Pass `onEvent` to see how tours perform: how many users finish each walkthrough, and at which step the others leave. Forward the events to your own backend or analytics tool.
284
+
285
+ ```tsx
286
+ <TourProvider tours={TOURS} onEvent={event => analyticsQueue.push(event)}>
287
+ ```
288
+
289
+ Every event has `type`, `runId` (the same for every event of one run of a tour, start to end), `tourId`, `tourKind` and `timestamp`, plus:
290
+
291
+ | `type` | When | Extra fields |
292
+ |:---|:---|:---|
293
+ | `tour_started` | A tour starts | `trigger` (`'auto'` / `'manual'`), `stepCount` |
294
+ | `step_shown` | A step appears (once per step visit, not on re-measures) | `stepIndex`, `stepNumber`, `stepCount`, `targetId` |
295
+ | `tour_completed` | The last step is finished | `durationMs` |
296
+ | `tour_exited` | The tour ends early | `reason`, `stepIndex`, `durationMs` |
297
+ | `tour_blocked` | `canStart` refused a `startTour` | `reason` (the message) |
298
+ | `tour_paused` | A walkthrough is put on hold | `reason` (`'app'` / `'target_missing'`), `stepIndex` |
299
+ | `tour_resumed` | A paused tour continues | `stepIndex` |
300
+ | `target_missing` | A step's element wasn't found in time | `stepIndex`, `targetId`, `outcome` (`'skip'` / `'pause'` / `'end'`) |
301
+
302
+ `tour_exited` reasons: `'user'` (Skip / Exit, or ✕ on the resume chip), `'back_button'`, `'app'` (`stopTour`), `'target_missing'`, `'replaced'` (another tour started), `'removed'` (the tour was removed). An error thrown by `onEvent` is logged and never affects the tour.
303
+
214
304
  ---
215
305
 
216
306
  ## 🧠 Technical Architecture
@@ -242,7 +332,7 @@ A tour that is stopped (finished, skipped, or ended because a target was missing
242
332
  <summary><b>Tour Lifecycle Rules</b></summary>
243
333
 
244
334
  - **Skip**, **Finish** and the **Android back button** end the tour and mark it as seen.
245
- - If a step's target is not on screen within `missingTargetTimeoutMs` (default **3000ms**, or the step's `targetTimeoutMs`), the tour ends **without** being marked as seen, or moves to the next step with `onMissingTarget: 'skip'`. A warning is logged in development.
335
+ - If a step's target is not on screen within `missingTargetTimeoutMs` (default **3000ms**, or the step's `targetTimeoutMs`), the tour ends **without** being marked as seen, moves to the next step with `onMissingTarget: 'skip'`, or pauses with a Resume chip with `onMissingTarget: 'pause'` (the default for walkthroughs). A warning is logged in development.
246
336
  - If the target of the step being shown disappears (unmounts, or its screen loses focus), the step is hidden until it comes back, within the same timeout.
247
337
  - While moving to the next step, the current one stays on screen until the next target is measured, and extra taps on **Next** are ignored.
248
338
 
@@ -262,23 +352,36 @@ A tour that is stopped (finished, skipped, or ended because a target was missing
262
352
  | `renderTooltip` | `(props: TourTooltipProps) => ReactNode` | built-in card | Draws the tooltip card. Receives the step, its index and count, and `next` / `prev` / `skip`. |
263
353
  | `tooltipWidth` | `number` | `280` | Card width (capped to the screen). |
264
354
  | `backdropColor` | `string` | `'rgba(0, 0, 0, 0.6)'` | Color of the dimmed area around the target. |
355
+ | `presentation` | `'root' \| 'modal'` | `'root'` | `'root'` draws the overlay as a layer over the app; the app's own modals open above it. `'modal'` uses a React Native `Modal`. For steps inside the app's modals, prefer `TourOverlayHost`. |
356
+ | `supportedOrientations` | `ModalProps['supportedOrientations']` | all | With `presentation="modal"`: iOS orientations the overlay allows (still limited by Info.plist). |
357
+ | `context` | `Record<string, unknown>` | `{}` | App state that `canStart` and step `when` receive. |
358
+ | `onStartBlocked` | `(tour, reason) => void` | — | A tour's `canStart` refused a `startTour` call; show `reason` to the user. |
359
+ | `onEvent` | `(event: TourEvent) => void` | — | Analytics: every start, step shown, completion, exit (and why), block, pause, resume and missing target. See [Analytics](#12-analytics-optional). |
360
+ | `renderResumeChip` | `(props: ResumeChipProps) => ReactNode` | built-in chip | Draws the "Resume" chip shown while a tour is paused (`tour`, `resume`, `dismiss`). |
361
+ | `highlightColor` | `string` | `'#FFFFFF'` | Ring around an element the user should tap. |
265
362
 
266
363
  ### Tour Configuration
267
364
  | Property | Type | Description |
268
365
  |:---|:---|:---|
269
366
  | `id` | `string` | Unique identifier for caching. |
270
- | `autoStart` | `boolean` | Start the first time the first step's target appears. |
367
+ | `autoStart` | `boolean` | Start the first time the first step with a target appears. |
271
368
  | `steps` | `TourStep[]` | Sequence of highlight steps. |
369
+ | `kind` | `'tour' \| 'walkthrough'` | Walkthroughs pause on a missing target and say "Exit". Default `'tour'`. |
370
+ | `title` / `description` / `keywords` | `string` / `string` / `string[]` | Shown and searched by `useTourCatalog`. |
371
+ | `canStart` | `(context) => boolean \| string` | Return `true`, or a reason the tour can't start. |
272
372
 
273
373
  ### TourStep
274
374
  | Property | Type | Default | Description |
275
375
  |:---|:---|:---|:---|
276
- | `targetId` | `string` | — | Matches the `name` prop of a `<TourTarget>`. |
376
+ | `targetId` | `string` | — | Matches the `name` prop of a `<TourTarget>`. Leave out for a centred card. |
277
377
  | `title` | `string` | — | Tooltip header. |
278
378
  | `description` | `string` | — | Tooltip body. |
279
379
  | `position` | `string` | `'bottom'` | `top`, `bottom`, `left`, `right`. |
280
380
  | `beforeEnter` | `() => void \| Promise<void>` | — | Runs (and is awaited) before the step looks for its target. |
281
- | `onMissingTarget` | `'end' \| 'skip'` | `'end'` | What happens if the target isn't found in time. |
381
+ | `advanceOn` | `'next' \| 'press' \| { event }` | `'next'` | How the step moves on: Next button, a tap on the element, or an app event. |
382
+ | `interactive` | `boolean` | `false` | The highlighted element stays usable (form fields); the step still moves on with Next (or `advanceOn`). |
383
+ | `when` | `(context) => boolean` | — | Show the step only when this returns true. |
384
+ | `onMissingTarget` | `'end' \| 'skip' \| 'pause'` | `'end'` (`'pause'` for walkthroughs) | What happens if the target isn't found in time. |
282
385
  | `targetTimeoutMs` | `number` | provider's | Per-step override of `missingTargetTimeoutMs`. |
283
386
 
284
387
  ### TourTarget
@@ -288,6 +391,11 @@ A tour that is stopped (finished, skipped, or ended because a target was missing
288
391
  | `children` | `ReactNode` | The UI element to wrap and highlight. |
289
392
  | `...props` | `ViewProps` | All standard React Native `View` props are forwarded. |
290
393
 
394
+ ### TourOverlayHost
395
+ | Property | Type | Description |
396
+ |:---|:---|:---|
397
+ | `children` | `ReactNode` | A modal's content. Steps whose targets are inside are drawn here instead of over the app. |
398
+
291
399
  ### TourScope / NavigationTourScope
292
400
  | Component | Props | Description |
293
401
  |:---|:---|:---|
@@ -308,10 +416,12 @@ A tour that is stopped (finished, skipped, or ended because a target was missing
308
416
  | `nextStep()` / `prevStep()` | Manual step navigation. |
309
417
  | `resetTour(id)` | Mark a tour as unseen so it can show (and auto-start) again. |
310
418
  | `resetAll()` | Mark every tour as unseen. |
311
- | `status` | `'idle'`, `'waiting'` (looking for the step's target) or `'active'`. |
419
+ | `status` | `'idle'`, `'waiting'` (looking for the step's target), `'active'` or `'paused'`. |
312
420
  | `activeTour` | Current active tour object. |
313
421
  | `currentStepIndex` | Current step number (0-indexed). |
314
422
  | `seenTours` | `Record<string, boolean>` of tours already seen. |
423
+ | `emit(event)` | Report an app event, for steps with `advanceOn: { event }`. |
424
+ | `pauseTour()` / `resumeTour()` | Put the running tour on hold / continue it. |
315
425
 
316
426
  `useTourState(selector)` subscribes to any slice of the tour state and re-renders only when it changes.
317
427
 
@@ -326,6 +436,15 @@ Behaviour changes:
326
436
  - A step appears a few frames after it starts (once its target has stopped moving), not immediately.
327
437
  - `useDap().targets` only contains the measurement of the step being shown, and `requestScroll` does nothing; scrolling is automatic.
328
438
  - Wrap screens in `NavigationTourScope` (or `TourScope`) to stop targets on background screens from being used.
439
+ - `TourProvider` must wrap the whole app: the overlay is now drawn as a layer over its children instead of in a `Modal`, so the app's own modals open above it. To point a step inside one of your modals, wrap the modal's content in `TourOverlayHost`.
440
+
441
+ ---
442
+
443
+ ## ⚠️ Known Limitations
444
+
445
+ - **Nested lists**: only a target's nearest scroll container is scrolled. A target in a horizontal row inside a vertical list is brought into view sideways, but the outer list doesn't scroll to the row.
446
+ - **Sliding elements**: a target moved by a transform animation (a drawer or sheet sliding in) is measured once it holds still for 3 frames, or after 600 ms. Put such targets in a `TourScope` that becomes active once the animation has finished (e.g. a drawer's progress reaching 1).
447
+ - **Virtualized lists**: `FlatList` items that aren't rendered yet can't be highlighted.
329
448
 
330
449
  ---
331
450
 
@@ -337,6 +456,7 @@ Contributions are welcome! Please feel free to submit a Pull Request.
337
456
  npm install
338
457
  npm run typecheck && npm run lint && npm test # what CI runs
339
458
  npm run build # outputs lib/ (CommonJS, ES modules, types)
459
+ npm publish --tag next # prereleases (betas); `npm publish` for stable versions
340
460
  ```
341
461
 
342
462
  The `example/` app (React Native 0.88, React Navigation) loads the library straight from `src/`, so changes show up without a build:
@@ -75,7 +75,7 @@ function useDap() {
75
75
  return {
76
76
  ...api,
77
77
  ...getLegacyRegistry(engine),
78
- targets: presented && presentedStep ? {
78
+ targets: presented?.rect && presentedStep?.targetId ? {
79
79
  [presentedStep.targetId]: presented.rect
80
80
  } : {},
81
81
  requestScroll: noop,
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","_context","_hooks","_TourProvider","_TourScrollable","_TourTarget","DapProvider","exports","TourProvider","DapTarget","TourTarget","DapScrollView","TourScrollView","legacyRegistries","WeakMap","getLegacyRegistry","engine","registry","get","registrations","Map","unregisterTarget","id","delete","registerTarget","measurement","ref","measurable","measureInWindow","cb","x","y","width","height","set","current","scope","scrollable","noop","useDap","useContext","TourEngineContext","Error","api","useTour","presented","useTourState","state","useMemo","presentedStep","getTour","tourId","steps","stepIndex","targets","targetId","rect","requestScroll","_registerScrollRef","_unregisterScrollRef"],"sourceRoot":"../../src","sources":["compat.ts"],"mappings":";;;;;;;AAIA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AAEA,IAAAI,eAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAXA;AACA;AACA;AACA;;AAWA;AACO,MAAMM,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAGE,0BAAY;AACvC;;AAEA;AACO,MAAMC,SAAS,GAAAF,OAAA,CAAAE,SAAA,GAAGC,sBAAU;AACnC;AACO,MAAMC,aAAa,GAAAJ,OAAA,CAAAI,aAAA,GAAGC,8BAAc;AAO3C;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAG,IAAIC,OAAO,CAA6B,CAAC;AAElE,SAASC,iBAAiBA,CAACC,MAAkB,EAAkB;EAC7D,IAAIC,QAAQ,GAAGJ,gBAAgB,CAACK,GAAG,CAACF,MAAM,CAAC;EAC3C,IAAI,CAACC,QAAQ,EAAE;IACb,MAAME,aAAa,GAAG,IAAIC,GAAG,CAAqB,CAAC;IACnD,MAAMC,gBAAgB,GAAIC,EAAU,IAAK;MACvCH,aAAa,CAACD,GAAG,CAACI,EAAE,CAAC,GAAG,CAAC;MACzBH,aAAa,CAACI,MAAM,CAACD,EAAE,CAAC;IAC1B,CAAC;IACD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GAAG;MACN,GAAG5B,iBAAiB,CAACC,MAAM,CAAC;MAC5BsC,OAAO,EAAET,SAAS,IAAII,aAAa,GAAG;QAAE,CAACA,aAAa,CAACM,QAAQ,GAAGV,SAAS,CAACW;MAAK,CAAC,GAAG,CAAC,CAAC;MACvFC,aAAa,EAAEnB,IAAI;MACnBoB,kBAAkB,EAAEpB,IAAI;MACxBqB,oBAAoB,EAAErB;IACxB,CAAC;EACH,CAAC,EAAE,CAACtB,MAAM,EAAE2B,GAAG,EAAEE,SAAS,CAAC,CAAC;AAC9B","ignoreList":[]}
1
+ {"version":3,"names":["_react","require","_context","_hooks","_TourProvider","_TourScrollable","_TourTarget","DapProvider","exports","TourProvider","DapTarget","TourTarget","DapScrollView","TourScrollView","legacyRegistries","WeakMap","getLegacyRegistry","engine","registry","get","registrations","Map","unregisterTarget","id","delete","registerTarget","measurement","ref","measurable","measureInWindow","cb","x","y","width","height","set","current","scope","scrollable","noop","useDap","useContext","TourEngineContext","Error","api","useTour","presented","useTourState","state","useMemo","presentedStep","getTour","tourId","steps","stepIndex","targets","rect","targetId","requestScroll","_registerScrollRef","_unregisterScrollRef"],"sourceRoot":"../../src","sources":["compat.ts"],"mappings":";;;;;;;AAIA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AAEA,IAAAI,eAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAXA;AACA;AACA;AACA;;AAWA;AACO,MAAMM,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAGE,0BAAY;AACvC;;AAEA;AACO,MAAMC,SAAS,GAAAF,OAAA,CAAAE,SAAA,GAAGC,sBAAU;AACnC;AACO,MAAMC,aAAa,GAAAJ,OAAA,CAAAI,aAAA,GAAGC,8BAAc;AAO3C;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAG,IAAIC,OAAO,CA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