virtual-site-tour-react 0.0.0-stage → 1.0.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/LICENSE +22 -0
- package/README.md +4 -2
- package/dist/index.d.ts +29 -0
- package/dist/index.js +116 -0
- package/dist/index.js.map +1 -0
- package/package.json +42 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
The MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Kamran Ahmed
|
|
4
|
+
Copyright (c) 2026 VirtualTour contributors
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in
|
|
14
|
+
all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
22
|
+
THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
#
|
|
1
|
+
# virtual-site-tour-react
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
React provider and hook for `virtual-site-tour`: `TourProvider` creates the tour once, and `useTour()` exposes `isRunning`, `currentStep` and the navigation calls.
|
|
4
|
+
|
|
5
|
+
Requires `react >= 18` and the `virtual-site-tour` package as peer dependencies. The tour is created in an effect, so server rendering outputs the children only.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { Tour, TourConfig, TourStep } from 'virtual-site-tour';
|
|
3
|
+
/** Props of {@link TourProvider}. */
|
|
4
|
+
export interface TourProviderProps {
|
|
5
|
+
/** Read once, when the provider mounts. Pass a new `key` to the provider to rebuild the tour from a new config. */
|
|
6
|
+
config: TourConfig;
|
|
7
|
+
/** Start the tour once, after the provider mounts. Ignored while a run is already active. */
|
|
8
|
+
autoStart?: boolean;
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
/** What {@link useTour} returns. `isRunning` and `currentStep` update on the tour events started, step-shown, finished, exited and deactivated, and when the step on screen is dropped. `currentStep` is the last step the tour reported with `step-shown` (use `tour.currentStep` for the live value during a move): it keeps the previous step while a move is under way and changes only when the new step is shown, or to `null` when the run ends or that step is dropped. `hideCurrent()` leaves it unchanged. The methods are stable across renders. */
|
|
12
|
+
export interface UseTourResult {
|
|
13
|
+
tour: Tour;
|
|
14
|
+
isRunning: boolean;
|
|
15
|
+
currentStep: TourStep | null;
|
|
16
|
+
start(): Promise<void>;
|
|
17
|
+
forward(): Promise<void>;
|
|
18
|
+
backward(): Promise<void>;
|
|
19
|
+
exit(): Promise<boolean>;
|
|
20
|
+
finish(): void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Creates one tour for its subtree and exposes it through {@link useTour}. The tour is created during the first
|
|
24
|
+
* render (safe on the server), starts only in an effect, and ends without an exit prompt when the provider unmounts.
|
|
25
|
+
* React strict mode's extra mount and unmount cycle neither starts a second run nor ends the first.
|
|
26
|
+
*/
|
|
27
|
+
export declare function TourProvider(props: TourProviderProps): ReactElement;
|
|
28
|
+
/** Reads the tour of the nearest {@link TourProvider}. Throws when called outside one. */
|
|
29
|
+
export declare function useTour(): UseTourResult;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { createContext as m, useState as S, useSyncExternalStore as P, useEffect as f, useMemo as g, createElement as v, useContext as x } from "react";
|
|
2
|
+
import { createTour as R } from "virtual-site-tour";
|
|
3
|
+
const b = { isRunning: !1, currentStep: null }, k = ["started", "step-shown", "finished", "exited", "deactivated"];
|
|
4
|
+
function T(r) {
|
|
5
|
+
const o = r.exitPrompt, a = o === void 0 || o === !1 ? r : {
|
|
6
|
+
...r,
|
|
7
|
+
exitPrompt: async () => e.disposed ? !0 : Promise.race([typeof o == "string" ? window.confirm(o) : o(), e.released])
|
|
8
|
+
}, n = R(a), e = {
|
|
9
|
+
tour: n,
|
|
10
|
+
released: Promise.resolve(!0),
|
|
11
|
+
releasePrompts: () => {
|
|
12
|
+
},
|
|
13
|
+
arm() {
|
|
14
|
+
e.released = new Promise((t) => {
|
|
15
|
+
e.releasePrompts = () => t(!0);
|
|
16
|
+
});
|
|
17
|
+
},
|
|
18
|
+
disposed: !1,
|
|
19
|
+
disposePending: !1,
|
|
20
|
+
shown: null,
|
|
21
|
+
releaseShown: () => {
|
|
22
|
+
},
|
|
23
|
+
snapshot: { isRunning: !1, currentStep: null },
|
|
24
|
+
getSnapshot() {
|
|
25
|
+
const t = n.isRunning(), u = e.shown;
|
|
26
|
+
return (e.snapshot.isRunning !== t || e.snapshot.currentStep !== u) && (e.snapshot = { isRunning: t, currentStep: u }), e.snapshot;
|
|
27
|
+
},
|
|
28
|
+
subscribe(t) {
|
|
29
|
+
let u = null, c = () => {
|
|
30
|
+
};
|
|
31
|
+
const d = () => {
|
|
32
|
+
l(), t();
|
|
33
|
+
}, l = () => {
|
|
34
|
+
const i = e.shown;
|
|
35
|
+
i !== u && (c(), u = i, c = i ? i.on("disposed", () => {
|
|
36
|
+
e.shown === i && (e.shown = null), d();
|
|
37
|
+
}) : () => {
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
l();
|
|
41
|
+
const w = k.map((i) => n.on(i, d));
|
|
42
|
+
return () => {
|
|
43
|
+
w.forEach((i) => i()), c();
|
|
44
|
+
};
|
|
45
|
+
},
|
|
46
|
+
dispose() {
|
|
47
|
+
e.disposed = !0, e.releaseShown(), p(e);
|
|
48
|
+
},
|
|
49
|
+
actions: {
|
|
50
|
+
start: () => n.start(),
|
|
51
|
+
forward: () => n.forward(),
|
|
52
|
+
backward: () => n.backward(),
|
|
53
|
+
exit: () => n.exit(),
|
|
54
|
+
finish: () => n.finish()
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
e.arm();
|
|
58
|
+
let s = () => {
|
|
59
|
+
};
|
|
60
|
+
e.releaseShown = () => {
|
|
61
|
+
s(), s = () => {
|
|
62
|
+
};
|
|
63
|
+
}, n.on("step-shown", ({ step: t }) => {
|
|
64
|
+
if (s(), s = () => {
|
|
65
|
+
}, !t.isShown()) {
|
|
66
|
+
e.shown = null;
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
e.shown = t, s = t.on("disposed", () => {
|
|
70
|
+
e.shown === t && (e.shown = null);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
for (const t of ["started", "finished", "exited", "deactivated"])
|
|
74
|
+
n.on(t, () => {
|
|
75
|
+
s(), s = () => {
|
|
76
|
+
}, e.shown = null;
|
|
77
|
+
});
|
|
78
|
+
return n.on("started", () => {
|
|
79
|
+
queueMicrotask(() => {
|
|
80
|
+
e.disposed && p(e);
|
|
81
|
+
});
|
|
82
|
+
}), e;
|
|
83
|
+
}
|
|
84
|
+
function p(r) {
|
|
85
|
+
r.releasePrompts(), r.tour.isRunning() && r.tour.exit().catch((o) => {
|
|
86
|
+
console.error("[virtualtour-react] exit on unmount failed:", o);
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
const h = m(null);
|
|
90
|
+
function C(r) {
|
|
91
|
+
const { config: o, autoStart: a = !1, children: n } = r, [e] = S(() => T(o)), s = P(e.subscribe, e.getSnapshot, () => b);
|
|
92
|
+
f(() => (e.disposePending = !1, e.disposed && (e.disposed = !1, e.arm()), () => {
|
|
93
|
+
e.disposePending = !0, queueMicrotask(() => {
|
|
94
|
+
e.disposePending && (e.disposePending = !1, e.dispose());
|
|
95
|
+
});
|
|
96
|
+
}), [e]), f(() => {
|
|
97
|
+
!a || e.tour.isRunning() || e.actions.start().catch((u) => {
|
|
98
|
+
console.error("[virtualtour-react] autoStart failed:", u);
|
|
99
|
+
});
|
|
100
|
+
}, [e, a]);
|
|
101
|
+
const t = g(
|
|
102
|
+
() => ({ tour: e.tour, isRunning: s.isRunning, currentStep: s.currentStep, ...e.actions }),
|
|
103
|
+
[e, s]
|
|
104
|
+
);
|
|
105
|
+
return v(h.Provider, { value: t }, n);
|
|
106
|
+
}
|
|
107
|
+
function M() {
|
|
108
|
+
const r = x(h);
|
|
109
|
+
if (r === null) throw new Error("[virtualtour-react] useTour() must be called inside a <TourProvider>.");
|
|
110
|
+
return r;
|
|
111
|
+
}
|
|
112
|
+
export {
|
|
113
|
+
C as TourProvider,
|
|
114
|
+
M as useTour
|
|
115
|
+
};
|
|
116
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.tsx"],"sourcesContent":["import { createContext, createElement, useContext, useEffect, useMemo, useState, useSyncExternalStore } from \"react\";\nimport type { ReactElement, ReactNode } from \"react\";\nimport { createTour } from \"virtual-site-tour\";\nimport type { Tour, TourConfig, TourStep } from \"virtual-site-tour\";\n\n/** Props of {@link TourProvider}. */\nexport interface TourProviderProps {\n /** Read once, when the provider mounts. Pass a new `key` to the provider to rebuild the tour from a new config. */\n config: TourConfig;\n /** Start the tour once, after the provider mounts. Ignored while a run is already active. */\n autoStart?: boolean;\n children?: ReactNode;\n}\n\n/** What {@link useTour} returns. `isRunning` and `currentStep` update on the tour events started, step-shown, finished, exited and deactivated, and when the step on screen is dropped. `currentStep` is the last step the tour reported with `step-shown` (use `tour.currentStep` for the live value during a move): it keeps the previous step while a move is under way and changes only when the new step is shown, or to `null` when the run ends or that step is dropped. `hideCurrent()` leaves it unchanged. The methods are stable across renders. */\nexport interface UseTourResult {\n tour: Tour;\n isRunning: boolean;\n currentStep: TourStep | null;\n start(): Promise<void>;\n forward(): Promise<void>;\n backward(): Promise<void>;\n exit(): Promise<boolean>;\n finish(): void;\n}\n\ninterface Snapshot {\n isRunning: boolean;\n currentStep: TourStep | null;\n}\n\ninterface TourStore {\n tour: Tour;\n disposed: boolean;\n disposePending: boolean;\n shown: TourStep | null;\n releaseShown(): void;\n released: Promise<boolean>;\n releasePrompts(): void;\n arm(): void;\n snapshot: Snapshot;\n getSnapshot(): Snapshot;\n subscribe(listener: () => void): () => void;\n dispose(): void;\n actions: Omit<UseTourResult, \"tour\" | \"isRunning\" | \"currentStep\">;\n}\n\nconst serverSnapshot: Snapshot = { isRunning: false, currentStep: null };\nconst watched = [\"started\", \"step-shown\", \"finished\", \"exited\", \"deactivated\"] as const;\n\nfunction createStore(config: TourConfig): TourStore {\n const prompt = config.exitPrompt;\n const wrapped: TourConfig =\n prompt === undefined || prompt === false\n ? config\n : {\n ...config,\n exitPrompt: async () => {\n if (store.disposed) return true;\n return Promise.race([typeof prompt === \"string\" ? window.confirm(prompt) : prompt(), store.released]);\n },\n };\n const tour = createTour(wrapped);\n const store: TourStore = {\n tour,\n released: Promise.resolve(true),\n releasePrompts: () => {},\n arm() {\n store.released = new Promise<boolean>((resolve) => {\n store.releasePrompts = () => resolve(true);\n });\n },\n disposed: false,\n disposePending: false,\n shown: null,\n releaseShown: () => {},\n snapshot: { isRunning: false, currentStep: null },\n getSnapshot() {\n const isRunning = tour.isRunning();\n const currentStep = store.shown;\n if (store.snapshot.isRunning !== isRunning || store.snapshot.currentStep !== currentStep) {\n store.snapshot = { isRunning, currentStep };\n }\n return store.snapshot;\n },\n subscribe(listener) {\n let tracked: TourStep | null = null;\n let offStep = (): void => {};\n const notify = (): void => {\n track();\n listener();\n };\n const track = (): void => {\n const current = store.shown;\n if (current === tracked) return;\n offStep();\n tracked = current;\n offStep = current\n ? current.on(\"disposed\", () => {\n if (store.shown === current) store.shown = null;\n notify();\n })\n : () => {};\n };\n track();\n const offs = watched.map((event) => tour.on(event, notify));\n return () => {\n offs.forEach((off) => off());\n offStep();\n };\n },\n dispose() {\n store.disposed = true;\n store.releaseShown();\n exitWithoutPrompt(store);\n },\n actions: {\n start: () => tour.start(),\n forward: () => tour.forward(),\n backward: () => tour.backward(),\n exit: () => tour.exit(),\n finish: () => tour.finish(),\n },\n };\n store.arm();\n let offShownDisposed = (): void => {};\n store.releaseShown = () => {\n offShownDisposed();\n offShownDisposed = () => {};\n };\n tour.on(\"step-shown\", ({ step }) => {\n offShownDisposed();\n offShownDisposed = () => {};\n if (!step.isShown()) {\n store.shown = null;\n return;\n }\n store.shown = step;\n offShownDisposed = step.on(\"disposed\", () => {\n if (store.shown === step) store.shown = null;\n });\n });\n for (const event of [\"started\", \"finished\", \"exited\", \"deactivated\"] as const) {\n tour.on(event, () => {\n offShownDisposed();\n offShownDisposed = () => {};\n store.shown = null;\n });\n }\n tour.on(\"started\", () => {\n queueMicrotask(() => {\n if (store.disposed) exitWithoutPrompt(store);\n });\n });\n return store;\n}\n\nfunction exitWithoutPrompt(store: TourStore): void {\n store.releasePrompts();\n if (!store.tour.isRunning()) return;\n store.tour.exit().catch((error: unknown) => {\n console.error(\"[virtualtour-react] exit on unmount failed:\", error);\n });\n}\n\nconst TourContext = createContext<UseTourResult | null>(null);\n\n/**\n * Creates one tour for its subtree and exposes it through {@link useTour}. The tour is created during the first\n * render (safe on the server), starts only in an effect, and ends without an exit prompt when the provider unmounts.\n * React strict mode's extra mount and unmount cycle neither starts a second run nor ends the first.\n */\nexport function TourProvider(props: TourProviderProps): ReactElement {\n const { config, autoStart = false, children } = props;\n const [store] = useState(() => createStore(config));\n const snapshot = useSyncExternalStore(store.subscribe, store.getSnapshot, () => serverSnapshot);\n\n useEffect(() => {\n store.disposePending = false;\n if (store.disposed) {\n store.disposed = false;\n store.arm();\n }\n return () => {\n store.disposePending = true;\n queueMicrotask(() => {\n if (!store.disposePending) return;\n store.disposePending = false;\n store.dispose();\n });\n };\n }, [store]);\n\n useEffect(() => {\n if (!autoStart || store.tour.isRunning()) return;\n store.actions.start().catch((error: unknown) => {\n console.error(\"[virtualtour-react] autoStart failed:\", error);\n });\n }, [store, autoStart]);\n\n const value = useMemo<UseTourResult>(\n () => ({ tour: store.tour, isRunning: snapshot.isRunning, currentStep: snapshot.currentStep, ...store.actions }),\n [store, snapshot],\n );\n return createElement(TourContext.Provider, { value }, children);\n}\n\n/** Reads the tour of the nearest {@link TourProvider}. Throws when called outside one. */\nexport function useTour(): UseTourResult {\n const value = useContext(TourContext);\n if (value === null) throw new Error(\"[virtualtour-react] useTour() must be called inside a <TourProvider>.\");\n return value;\n}\n"],"names":["serverSnapshot","watched","createStore","config","prompt","wrapped","store","tour","createTour","resolve","isRunning","currentStep","listener","tracked","offStep","notify","track","current","offs","event","off","exitWithoutPrompt","offShownDisposed","step","error","TourContext","createContext","TourProvider","props","autoStart","children","useState","snapshot","useSyncExternalStore","useEffect","value","useMemo","createElement","useTour","useContext"],"mappings":";;AA+CA,MAAMA,IAA2B,EAAE,WAAW,IAAO,aAAa,KAAA,GAC5DC,IAAU,CAAC,WAAW,cAAc,YAAY,UAAU,aAAa;AAE7E,SAASC,EAAYC,GAA+B;AAClD,QAAMC,IAASD,EAAO,YAChBE,IACJD,MAAW,UAAaA,MAAW,KAC/BD,IACA;AAAA,IACE,GAAGA;AAAA,IACH,YAAY,YACNG,EAAM,WAAiB,KACpB,QAAQ,KAAK,CAAC,OAAOF,KAAW,WAAW,OAAO,QAAQA,CAAM,IAAIA,EAAA,GA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HANGED
|
@@ -1,6 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "virtual-site-tour-react",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "React provider and hook for virtual-site-tour.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/quaz579/virtualtour.git",
|
|
9
|
+
"directory": "packages/react"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/index.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist",
|
|
21
|
+
"LICENSE",
|
|
22
|
+
"README.md"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "vite build",
|
|
26
|
+
"typecheck": "tsc --noEmit -p tsconfig.check.json",
|
|
27
|
+
"test": "vitest run"
|
|
28
|
+
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"react": ">=18",
|
|
31
|
+
"virtual-site-tour": "^1.0.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/react": "^19.0.0",
|
|
35
|
+
"@types/react-dom": "^19.0.0",
|
|
36
|
+
"jsdom": "^31.0.1",
|
|
37
|
+
"react": "^19.0.0",
|
|
38
|
+
"react-dom": "^19.0.0",
|
|
39
|
+
"typescript": "~5.9.3",
|
|
40
|
+
"vite": "^7.3.8",
|
|
41
|
+
"vite-plugin-dts": "^4.5.4",
|
|
42
|
+
"vitest": "^3.2.7"
|
|
43
|
+
}
|
|
44
|
+
}
|