@shiva004/surveys 0.1.8 → 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 +38 -1
- package/dist/App.d.ts +1 -1
- package/dist/index.d.ts +8 -3
- package/dist/index.js +918 -296
- package/dist/journey/JourneyApp.d.ts +1 -1
- package/dist/journey/analytics.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/survey/SurveyApp.d.ts +1 -1
- package/dist/survey/data.d.ts +1 -1
- package/dist/survey/nps.d.ts +1 -1
- package/dist/ui.d.ts +1 -1
- package/dist/walkthrough/JourneyProvider.d.ts +27 -0
- package/dist/walkthrough/TourOverlay.d.ts +23 -0
- package/dist/walkthrough/WalkthroughDemo.d.ts +11 -0
- package/dist/walkthrough/index.d.ts +7 -0
- package/dist/walkthrough/tour.d.ts +39 -0
- package/dist/walkthrough/tracker.d.ts +83 -0
- package/package.json +13 -14
- package/dist/index.cjs +0 -1
- package/dist/main.d.ts +0 -1
package/README.md
CHANGED
|
@@ -2,7 +2,44 @@
|
|
|
2
2
|
|
|
3
3
|
A standalone proof of concept for the Survey and User Journey modules. No backend, no auth: all data is mock and lives in memory, so a page reload resets it.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Use as a package
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @shiva004/surveys
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import { SurveyApp, JourneyApp, npsOf } from '@shiva004/surveys';
|
|
13
|
+
import '@shiva004/surveys/style.css';
|
|
14
|
+
|
|
15
|
+
export default function Page() {
|
|
16
|
+
return <SurveyApp />;
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
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.
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
import { JourneyProvider, useJourney, WalkthroughDemo } from '@shiva004/surveys';
|
|
26
|
+
import '@shiva004/surveys/style.css';
|
|
27
|
+
|
|
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();
|
|
36
|
+
```
|
|
37
|
+
|
|
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+.
|
|
39
|
+
|
|
40
|
+
Requires React 18 or newer. Also exported: `SurveyJourneyApp` (both modules with tabs), the NPS helpers, the journey analytics functions and all types.
|
|
41
|
+
|
|
42
|
+
## Run the demo
|
|
6
43
|
|
|
7
44
|
```bash
|
|
8
45
|
npm install
|
package/dist/App.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
export declare const App: React.FC;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import './styles.css';
|
|
2
|
+
export { App as SurveyJourneyApp } from './App';
|
|
2
3
|
export { SurveyApp } from './survey/SurveyApp';
|
|
3
|
-
export {
|
|
4
|
+
export { JourneyApp } from './journey/JourneyApp';
|
|
5
|
+
export * from './walkthrough';
|
|
6
|
+
export { npsOf, npsCategory, npsScores } from './survey/nps';
|
|
4
7
|
export type { NpsCategory } from './survey/nps';
|
|
5
|
-
export
|
|
8
|
+
export { simulate, navigationStats, pathStats, flowStats, stageReach } from './journey/analytics';
|
|
9
|
+
export type { NavRow, PathRow, FlowRow } from './journey/analytics';
|
|
10
|
+
export type { Survey, Question, QType, SurveyStatus, Answer, SurveyResponse, Stage, JourneyMap } from './types';
|