@shiva004/surveys 0.3.0 → 0.4.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 CHANGED
@@ -17,16 +17,25 @@ export default function Page() {
17
17
  }
18
18
  ```
19
19
 
20
- ### User Journey docs page (new in 0.3.0)
20
+ ### Walkthrough tour + analytics (new in 0.4.0)
21
+
22
+ Replaces `UserJourneyDocs`. A React port of the Sonnaga walkthrough: spotlight tour, passive tracking (time, scroll depth, clicks, navigation, heatmap) and an optional event endpoint.
21
23
 
22
24
  ```tsx
23
- import { UserJourneyDocs } from '@shiva004/surveys';
25
+ import { JourneyProvider, useJourney, WalkthroughDemo } from '@shiva004/surveys';
24
26
  import '@shiva004/surveys/style.css';
25
27
 
26
- <UserJourneyDocs githubUrl="https://github.com/your-org/your-repo" defaultTheme="dark" />
28
+ // Full sample site with tour and Insights panel
29
+ <WalkthroughDemo />
30
+
31
+ // Or wrap your own app
32
+ <JourneyProvider config={{ endpoint: '/api/journey/events', welcome: { title: 'Welcome', body: 'Quick tour?' } }}>
33
+ <App />
34
+ </JourneyProvider>
35
+ // inside: const { start, setTheme, toggleHeat } = useJourney();
27
36
  ```
28
37
 
29
- Self-contained (no Bootstrap needed): sidebar, "On this page" list with scroll-spy and a light/dark toggle. Props: `defaultTheme`, `githubUrl`, `className`.
38
+ Steps come from `config.steps`, else `data-sj-*` attributes, else the page's header, nav, sections and footer. `useJourneyStats()` returns live metrics. Needs `react` and `react-dom` 18+.
30
39
 
31
40
  Requires React 18 or newer. Also exported: `SurveyJourneyApp` (both modules with tabs), the NPS helpers, the journey analytics functions and all types.
32
41
 
package/dist/index.d.ts CHANGED
@@ -2,8 +2,7 @@ import './styles.css';
2
2
  export { App as SurveyJourneyApp } from './App';
3
3
  export { SurveyApp } from './survey/SurveyApp';
4
4
  export { JourneyApp } from './journey/JourneyApp';
5
- export { UserJourneyDocs } from './docs/UserJourneyDocs';
6
- export type { UserJourneyDocsProps } from './docs/UserJourneyDocs';
5
+ export * from './walkthrough';
7
6
  export { npsOf, npsCategory, npsScores } from './survey/nps';
8
7
  export type { NpsCategory } from './survey/nps';
9
8
  export { simulate, navigationStats, pathStats, flowStats, stageReach } from './journey/analytics';