virtual-site-tour 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/ART.md ADDED
@@ -0,0 +1,5 @@
1
+ # Artwork
2
+
3
+ Thumbtack, the avatar that ships with VirtualTour, is original to this project and has two visual variants: the push-pin default and the original round-top design. Each variant has its own `frames.mjs`, SVG sources, `sheet.png` and `pack.json` under `src/avatar/thumbtack/` and `src/avatar/thumbtack/round/`. `tools/build-thumbtack-pack.mjs` writes the frames and rasterizes each variant. The author is the VirtualTour contributors. No frame was traced from, measured against, or derived from another character, and no third-party character art, screenshot of such art, or animation data describing it is accepted into this repository.
4
+
5
+ Both Thumbtack variants are dedicated to the public domain under CC0 1.0; see `dist/thumbtack/LICENSE-ART.md` in the package (the repository keeps the source at `src/avatar/thumbtack/LICENSE-ART.md`, and the build copies it). The code in `tools/build-thumbtack-pack.mjs` stays under the project's MIT license.
package/CHANGELOG.md ADDED
@@ -0,0 +1,105 @@
1
+ # Changelog
2
+
3
+ ## 1.0.0 (2026-11-24)
4
+
5
+ ### Features
6
+
7
+ * absolute position strategy for transformed containers (WU-29) ([#32](https://github.com/quaz579/virtualtour/issues/32)) ([2549ea1](https://github.com/quaz579/virtualtour/commit/2549ea17c3856ed55bea13a98b1e3ca5890a5e66))
8
+ * accessibility audit for dialog mode (WU-36) ([#40](https://github.com/quaz579/virtualtour/issues/40)) ([f35b0d5](https://github.com/quaz579/virtualtour/commit/f35b0d591240d1922aaa1d4227f77b1d7ce9339f))
9
+ * accessible name, content rendering and sanitizer (WU-14) ([#20](https://github.com/quaz579/virtualtour/issues/20)) ([33dcc23](https://github.com/quaz579/virtualtour/commit/33dcc238692053d84fc90d7a27032b869fb4ac50))
10
+ * action steps in the public API (WU-27) ([#31](https://github.com/quaz579/virtualtour/issues/31)) ([c546d61](https://github.com/quaz579/virtualtour/commit/c546d611c4d327d7b1e1c66143aa5033a2c6d069))
11
+ * add GitHub Pages demo site ([#72](https://github.com/quaz579/virtualtour/issues/72)) ([41f8d83](https://github.com/quaz579/virtualtour/commit/41f8d83dfbb27a697516f0ef158d80de7ba6a8f2))
12
+ * add sprite player and shared frame scheduler (WU-24) ([#27](https://github.com/quaz579/virtualtour/issues/27)) ([c1b0b4b](https://github.com/quaz579/virtualtour/commit/c1b0b4b82543ebed8386e6131051c3ebf0c14fa4))
13
+ * avatar idle loop and reduced motion end to end (WU-41) ([#45](https://github.com/quaz579/virtualtour/issues/45)) ([9f9ae8a](https://github.com/quaz579/virtualtour/commit/9f9ae8a624eadd27e1fa2e1c7fb1c34a20983a67))
14
+ * avatar pack types, validation, normalization and preload (WU-07) ([#6](https://github.com/quaz579/virtualtour/issues/6)) ([21172dc](https://github.com/quaz579/virtualtour/commit/21172dc25013d34728386541246c08bcdd05bb87))
15
+ * clip the overlay cut-out by scroll containers (WU-15) ([#18](https://github.com/quaz579/virtualtour/issues/18)) ([79ef080](https://github.com/quaz579/virtualtour/commit/79ef080e3f56641689833ac45512f5e745197cde))
16
+ * config model, deep merge, ids, emitter, tour compiler (WU-06) ([#7](https://github.com/quaz579/virtualtour/issues/7)) ([a1c0f7f](https://github.com/quaz579/virtualtour/commit/a1c0f7f5df9f8611f5ab069884f1c14a8dadae2b))
17
+ * consolidated demo with scenario picker and gallery (WU-45) ([#50](https://github.com/quaz579/virtualtour/issues/50)) ([8c1bd31](https://github.com/quaz579/virtualtour/commit/8c1bd31241bd59c159c0f6ca02a39e6112674449))
18
+ * **core,motion:** steps-changed event, progressVars refresh, composable glide ([#60](https://github.com/quaz579/virtualtour/issues/60)) ([c78ef56](https://github.com/quaz579/virtualtour/commit/c78ef5685d54167a77c26e82908771ab87686d83))
19
+ * cross-axis offset, RTL mirroring, arrow off and minimum inset (WU-33) ([#36](https://github.com/quaz579/virtualtour/issues/36)) ([2bbad7c](https://github.com/quaz579/virtualtour/commit/2bbad7c471877b924106ca30de80fd7997910c51))
20
+ * custom footer buttons, configure(), progressInfo and first-button focus (WU-20) ([#25](https://github.com/quaz579/virtualtour/issues/25)) ([0482bba](https://github.com/quaz579/virtualtour/commit/0482bba512268b553026ca907d5a9325764fccd6))
21
+ * cut out extra allowed elements anywhere, deduped and scroll-clipped (WU-21) ([#24](https://github.com/quaz579/virtualtour/issues/24)) ([338463e](https://github.com/quaz579/virtualtour/commit/338463e4bdbc9e4988e517180a177d1d5211497a))
22
+ * eligibility loop with waitFor, whenMissing, prepare, revealWith and auto-advance ([#19](https://github.com/quaz579/virtualtour/issues/19)) ([94b18ce](https://github.com/quaz579/virtualtour/commit/94b18ce32eba8c78269387eb1fd366150fa78690))
23
+ * engine seams for the public API (WU-08) ([#9](https://github.com/quaz579/virtualtour/issues/9)) ([5b1eff2](https://github.com/quaz579/virtualtour/commit/5b1eff282007f8b5594200774a828fa902e5cb69))
24
+ * harden avatar loading and fallback paths (WU-43) ([#48](https://github.com/quaz579/virtualtour/issues/48)) ([361dbc2](https://github.com/quaz579/virtualtour/commit/361dbc2c87d04138b5f180440eebdc5e5d3574b4))
25
+ * honor prefers-reduced-motion in the engine (WU-19) ([#16](https://github.com/quaz579/virtualtour/issues/16)) ([af7a716](https://github.com/quaz579/virtualtour/commit/af7a71644f92238444def9da13357713f06bea6d))
26
+ * import driver.js and build it with Vite (WU-01) ([#1](https://github.com/quaz579/virtualtour/issues/1)) ([0173625](https://github.com/quaz579/virtualtour/commit/017362566951f33423cb533839876e7aa234ed23))
27
+ * JSON tours with parse, serialize and schema files (WU-38) ([#41](https://github.com/quaz579/virtualtour/issues/41)) ([68d7ada](https://github.com/quaz579/virtualtour/commit/68d7adaed47f7bdcc3551a9867c0ece076adfe5c))
28
+ * motion add-on with glide and progress variables (WU-37) ([#39](https://github.com/quaz579/virtualtour/issues/39)) ([1d73850](https://github.com/quaz579/virtualtour/commit/1d7385001ec6b9a0c74f8e30a6399b8147fd68c0))
29
+ * mountIn and dimMountIn containers (WU-18) ([#15](https://github.com/quaz579/virtualtour/issues/15)) ([0d3bef4](https://github.com/quaz579/virtualtour/commit/0d3bef483a12af1053753755d4a6926ed1267285))
30
+ * nested scroll following and optional scroll-parent lock (WU-16) ([#17](https://github.com/quaz579/virtualtour/issues/17)) ([b16e3f5](https://github.com/quaz579/virtualtour/commit/b16e3f509aaae368221a73c54153aa632aa60f26))
31
+ * pack loaders for v1, classic formats and Thumbtack (WU-42) ([#44](https://github.com/quaz579/virtualtour/issues/44)) ([3c47594](https://github.com/quaz579/virtualtour/commit/3c47594f3720d8f9e30f1cb016629b3fa41559c0))
32
+ * per-corner cut-out radius (WU-17) ([#14](https://github.com/quaz579/virtualtour/issues/14)) ([6b16afd](https://github.com/quaz579/virtualtour/commit/6b16afd851f130353583f3e31a99fad6b21f8dd7))
33
+ * placement auto, flip/shift switches, position boundary and fallback fixes (WU-28) ([#30](https://github.com/quaz579/virtualtour/issues/30)) ([2af576d](https://github.com/quaz579/virtualtour/commit/2af576dc6b2aef74528251a024f759e459935280))
34
+ * popover boundary, padding and side over for targets (WU-22) ([#26](https://github.com/quaz579/virtualtour/issues/26)) ([447e9c2](https://github.com/quaz579/virtualtour/commit/447e9c27ad94689f456acc69c7d462ed3c07c1b9))
35
+ * progress persistence with localStorage and memory stores (WU-25) ([#28](https://github.com/quaz579/virtualtour/issues/28)) ([05b58ba](https://github.com/quaz579/virtualtour/commit/05b58ba4cd337e72b0b0040d6e683a57be9dcd46))
36
+ * React provider and useTour hook (WU-31) ([#34](https://github.com/quaz579/virtualtour/issues/34)) ([c8b8314](https://github.com/quaz579/virtualtour/commit/c8b83141d2ae23a4e569e374bfac60b60bf6501f))
37
+ * redraw Thumbtack avatar as a classic push pin ([#70](https://github.com/quaz579/virtualtour/issues/70)) ([355268f](https://github.com/quaz579/virtualtour/commit/355268fe36388e2a0aa35fb7682348108f42a2fc))
38
+ * release readiness, API freeze, perf tripwire and upstream re-check (WU-46) ([#52](https://github.com/quaz579/virtualtour/issues/52)) ([c0426f0](https://github.com/quaz579/virtualtour/commit/c0426f0150f243a79f5d66ea15d430d2acd2ed43))
39
+ * reveal options and reduced-motion-safe scrolling (WU-23) ([#23](https://github.com/quaz579/virtualtour/issues/23)) ([7d5703b](https://github.com/quaz579/virtualtour/commit/7d5703b47fd9d281e4d5ce93c9f3c85ef27047c0))
40
+ * speaker layout in the engine with bubble-measured arrow (WU-35) ([#38](https://github.com/quaz579/virtualtour/issues/38)) ([791c30f](https://github.com/quaz579/virtualtour/commit/791c30f2d34de499a6a277736aedd3f982ff4d3e))
41
+ * speaker presenter and avatar stylesheet (WU-39) ([#42](https://github.com/quaz579/virtualtour/issues/42)) ([f67ddc1](https://github.com/quaz579/virtualtour/commit/f67ddc1ad0d114312724477bfb46203b2989bce1))
42
+ * spotlight state classes, extras dedupe and overlay e2e (WU-30) ([#33](https://github.com/quaz579/virtualtour/issues/33)) ([efaab1a](https://github.com/quaz579/virtualtour/commit/efaab1a0e82cd317b811f598626a85a24909e207))
43
+ * step.configure treats null as clear-to-default ([#62](https://github.com/quaz579/virtualtour/issues/62)) ([e7d9940](https://github.com/quaz579/virtualtour/commit/e7d9940e11c2fa82b8cfe876fa906ec9c8890783))
44
+ * test harnesses, demo fixture, build/SSR/fork-point gates, size report (WU-02) ([#2](https://github.com/quaz579/virtualtour/issues/2)) ([5b3cd7b](https://github.com/quaz579/virtualtour/commit/5b3cd7b19442f5a0b60ddeda7fd52aa5a0cae565))
45
+ * theme stylesheet, dark mode, class contract and missing-stylesheet warning (WU-34) ([#37](https://github.com/quaz579/virtualtour/issues/37)) ([d765c79](https://github.com/quaz579/virtualtour/commit/d765c790ec7e21e97b235ba1d652aab01a321ac2))
46
+ * Thumbtack character, pack build and CC0 art license (WU-09) ([#10](https://github.com/quaz579/virtualtour/issues/10)) ([49ae09e](https://github.com/quaz579/virtualtour/commit/49ae09efceb69c37d2dc8bb5e19dc55c14e6d3d2))
47
+ * tour lifecycle, event ordering, exit prompt and engine invariants (WU-12) ([#13](https://github.com/quaz579/virtualtour/issues/13)) ([30e6828](https://github.com/quaz579/virtualtour/commit/30e682830f2f82359e09f9d197ac70a3b4fc5e6f))
48
+ * tour model, registry and dialog presenter skeleton (WU-11) ([#12](https://github.com/quaz579/virtualtour/issues/12)) ([e1c7726](https://github.com/quaz579/virtualtour/commit/e1c772658e6a2d3bb347c04265e1b66e1b1ad686))
49
+ * upstream tracking tool, review log and first review (WU-26) ([#29](https://github.com/quaz579/virtualtour/issues/29)) ([c3e4508](https://github.com/quaz579/virtualtour/commit/c3e450805d8becce1661d47c9f71584752e6b5b7))
50
+ * Vue provider and useTour composable (WU-32) ([#35](https://github.com/quaz579/virtualtour/issues/35)) ([a8d7701](https://github.com/quaz579/virtualtour/commit/a8d77018fb902998042307e4d5c95cac7e354746))
51
+ * withAvatar and per-step animation selection (WU-40) ([#43](https://github.com/quaz579/virtualtour/issues/43)) ([b61f28f](https://github.com/quaz579/virtualtour/commit/b61f28f5e0e121dc782019ab0fcc7161b7f6659e))
52
+
53
+ ### Bug Fixes
54
+
55
+ * a dropped move target exits with reason api and never shows an earlier step ([#59](https://github.com/quaz579/virtualtour/issues/59)) ([4138b8e](https://github.com/quaz579/virtualtour/commit/4138b8ebdc9c82bebb881c19603f1523efec6371))
56
+ * a11y, theme and avatar follow-ups ([#54](https://github.com/quaz579/virtualtour/issues/54)) ([c85358f](https://github.com/quaz579/virtualtour/commit/c85358ff39d6561b404bf9192082ae8834d97f9b))
57
+ * **avatar:** idle edge cases and single last-idle memory ([#64](https://github.com/quaz579/virtualtour/issues/64)) ([7051f54](https://github.com/quaz579/virtualtour/commit/7051f54250fe01f4125647d41996f346f6bcfe8e))
58
+ * bound each progress save, keep late-load merge consistent, reject bad waitBudget ([#61](https://github.com/quaz579/virtualtour/issues/61)) ([a8d8ef4](https://github.com/quaz579/virtualtour/commit/a8d8ef4452270817650399af40107900d66fe83c))
59
+ * bound progress store load and warn on a stale resume step ([#57](https://github.com/quaz579/virtualtour/issues/57)) ([2b90f03](https://github.com/quaz579/virtualtour/commit/2b90f03ee7bc120530501363723a2ef4c303095f))
60
+ * **engine:** popover adopts the target's direction; verify physicalAlign in RTL ([#65](https://github.com/quaz579/virtualtour/issues/65)) ([a8f2bfd](https://github.com/quaz579/virtualtour/commit/a8f2bfde1dbcadbc6a005b4a8eabe90eed20f13d))
61
+ * harden navigator hooks, wait budget, auto-advance and centered steps (WU-13b) ([#21](https://github.com/quaz579/virtualtour/issues/21)) ([295ebe1](https://github.com/quaz579/virtualtour/commit/295ebe1af99d74ea5b8974f517c7581c9eb32558))
62
+ * **motion:** glide starts when the next popover renders, so it never shows at its final position first ([#63](https://github.com/quaz579/virtualtour/issues/63)) ([2cc9886](https://github.com/quaz579/virtualtour/commit/2cc988626c477543d28d031c8d5b7bd52baa8919))
63
+ * **react,vue:** currentStep changes only when a step is shown ([#67](https://github.com/quaz579/virtualtour/issues/67)) ([0a10468](https://github.com/quaz579/virtualtour/commit/0a10468faa5a220d97b5083f09823591d89f7908))
64
+ * **react,vue:** keep currentStep in sync when the step on screen is dropped ([#56](https://github.com/quaz579/virtualtour/issues/56)) ([5c96586](https://github.com/quaz579/virtualtour/commit/5c965863afcb37021c41223dad0fc8365102b4a4))
65
+ * reject colons in localStorage prefixes, survive throwing sanitize and counter hooks, add spotlit to names() ([#58](https://github.com/quaz579/virtualtour/issues/58)) ([1df60fc](https://github.com/quaz579/virtualtour/commit/1df60fc1b49b7e619e627ef59383962e926fe6de))
66
+ * rename npm packages to virtual-site-tour ([#75](https://github.com/quaz579/virtualtour/issues/75)) ([1d26e6b](https://github.com/quaz579/virtualtour/commit/1d26e6be2930ddf419e6e27afcab2dad5569d3c0))
67
+ * sanitize every popover HTML sink and keep user element bodies intact (WU-14b) ([#22](https://github.com/quaz579/virtualtour/issues/22)) ([5a9effd](https://github.com/quaz579/virtualtour/commit/5a9effd326fa0dcc46d80cbadec4d2b8120631c5))
68
+ * ship self-contained type declarations for every entry point ([#46](https://github.com/quaz579/virtualtour/issues/46)) ([a5931e2](https://github.com/quaz579/virtualtour/commit/a5931e2a31f6c891efe49ef56ba6b8d28da199fd))
69
+ * **vue:** currentStep is null when step-shown reports a dropped step ([#68](https://github.com/quaz579/virtualtour/issues/68)) ([ed6e8ab](https://github.com/quaz579/virtualtour/commit/ed6e8ab101467fca5ab8f0039bf7b183cdc9215d))
70
+
71
+ ### Performance Improvements
72
+
73
+ * minify whitespace in shipped bundles and refresh size targets ([#49](https://github.com/quaz579/virtualtour/issues/49)) ([967f5fa](https://github.com/quaz579/virtualtour/commit/967f5fa998edc03047dcedb8ee77add1184887fc))
74
+
75
+ ## 1.0.0 (2026-11-20)
76
+
77
+ First release. The tour engine is derived from driver.js 1.12.1 (tag `1.12.1`, commit `0163642dc532417ea401684bd26690e2f3283d63`, MIT). See `NOTICE.md` for the license and the files not carried over, and `UPSTREAM.md` in the repository for how later upstream changes are tracked.
78
+
79
+ ### Public API
80
+
81
+ - `createTour`, `Tour`, `TourStep`: declarative tours with typed events, navigation, eligibility (conditional steps, waits, skip, prepare, reveal, auto-advance), action steps, persistence and resume.
82
+ - `parseTourJson` and `serializeTour`, with `schemas/tour.v1.schema.json`.
83
+ - `virtualtour/avatar`: `withAvatar`, `SpeakerPresenter`, pack loaders and validation, Thumbtack (CC0). `virtualtour/motion`: `glide`, `progressVars`.
84
+ - Stylesheets: `base.css` (required), `theme.css` (optional, light and dark), `avatar.css`. See `STYLES.md` for every class and variable.
85
+ - `localStorageStore` throws for a prefix that contains `:`, because the key would be ambiguous.
86
+ - The exact exported surface is frozen in `API-FREEZE.md`.
87
+
88
+ ### Engine changes from driver.js, by fork task
89
+
90
+ - F-03: classes renamed from `driver-` to `vt-`, state exposed as data attributes, and a `namespace` option.
91
+ - F-04: the cut-out is clipped by the scroll containers that crop the target.
92
+ - F-05: extra cut-outs for allowed elements anywhere on the page, deduplicated.
93
+ - F-06: popover boundary, viewport padding, and `side: "over"` for targets.
94
+ - F-07: flip, alignment flip and shift switches, and `side: "auto"`.
95
+ - F-08: cross-axis offset, RTL mirroring, arrow off and minimum arrow inset. A popover whose direction differs from its target's takes the target's direction while the step has a real target (a `dir` it replaced is restored afterwards); for targetless steps `info.rtl` follows the page direction.
96
+ - F-09: the highlight follows nested scroll containers, with an optional scroll-parent lock.
97
+ - F-10: `absolute` position strategy for transformed containers.
98
+ - F-11: reveal options, native `scrollIntoView` options, and reduced-motion-safe scrolling.
99
+ - F-12: per-corner cut-out radius.
100
+ - F-13: `mountIn` and `dimMountIn` containers for the popover and overlay.
101
+ - F-14: `prefers-reduced-motion` honored in the engine.
102
+ - V-02, V-05, V-06 and A-04: engine seams for the public API, accessible names and sanitized content, action steps, and the speaker layout.
103
+ - Upstream cherry-picks: `onDestroyed` fires when a tour closes before its first step settles, very long waits no longer expire at once, Tab skips hidden or inert controls, and focus returns to the trigger only when the tour still holds it.
104
+ - Removed: hints and checklist.
105
+ - Refresh cost: fewer style reads per reposition, and the extra cut-out path is reused while the rectangles stay the same.
package/LICENSE ADDED
@@ -0,0 +1,24 @@
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.
23
+
24
+ The Thumbtack character artwork in `dist/thumbtack/` (source `src/avatar/thumbtack/` in the repository) is dedicated to the public domain under CC0 1.0; see `dist/thumbtack/LICENSE-ART.md` (source `src/avatar/thumbtack/LICENSE-ART.md` in the repository). Third-party character art: this project ships none. Loading third-party art through the avatar loader is the integrator's responsibility.
package/NOTICE.md ADDED
@@ -0,0 +1,50 @@
1
+ # Notice
2
+
3
+ VirtualTour's tour engine is a fork of driver.js.
4
+
5
+ | | |
6
+ |---|---|
7
+ | Upstream repository | https://github.com/nilbuild/driver.js |
8
+ | Fork point tag | `1.12.1` |
9
+ | Fork point commit | `0163642dc532417ea401684bd26690e2f3283d63` |
10
+ | Upstream release date | 2026-11-12 |
11
+ | License | MIT |
12
+
13
+ `packages/core/src/engine/` derives from `packages/driver/src/` at that commit.
14
+
15
+ ## Files not carried over
16
+
17
+ - `hints.ts` and `styles/hints.css`
18
+ - `checklist.ts` and `styles/checklist.css`
19
+ - The Astro apps (playground and docs site)
20
+ - The upstream build configuration (`tsdown`, `turbo`, `pnpm` workspace files)
21
+
22
+ Later upstream changes that are cherry-picked are recorded in `UPSTREAM.md`, each citing its upstream commit.
23
+
24
+ ## Original notice
25
+
26
+ The following notice is reproduced verbatim from upstream.
27
+
28
+ ```
29
+ The MIT License
30
+
31
+ Copyright (c) Kamran Ahmed
32
+
33
+ Permission is hereby granted, free of charge, to any person obtaining a copy
34
+ of this software and associated documentation files (the "Software"), to deal
35
+ in the Software without restriction, including without limitation the rights
36
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
37
+ copies of the Software, and to permit persons to whom the Software is
38
+ furnished to do so, subject to the following conditions:
39
+
40
+ The above copyright notice and this permission notice shall be included in
41
+ all copies or substantial portions of the Software.
42
+
43
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
44
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
45
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
46
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
47
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
48
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
49
+ THE SOFTWARE.
50
+ ```
package/README.md CHANGED
@@ -1,3 +1,18 @@
1
- # Temporary Holding Version
1
+ # virtual-site-tour
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Guided tours and onboarding for the web, derived from driver.js (MIT). Entry points: `virtual-site-tour`, `virtual-site-tour/avatar`, `virtual-site-tour/motion`; stylesheets `virtual-site-tour/base.css` (required), `theme.css` and `avatar.css`. The exported names are listed in `API-FREEZE.md`, the class and variable names in `STYLES.md`, and the release history in `CHANGELOG.md`.
4
+
5
+ ## Developing
6
+
7
+ Commands, run from the repository root:
8
+
9
+ - `npm ci`: install dependencies
10
+ - `npm run typecheck`: strict TypeScript check
11
+ - `npm run build`: build `packages/core/dist`
12
+
13
+ ## More commands
14
+
15
+ - `npm test` runs both Vitest projects (`unit-node`, `unit-dom`).
16
+ - `npm run e2e` runs Playwright on chromium, firefox, webkit, and edge when installed (skipped otherwise). Set `VT_E2E_PORT` (default `4173`) to run the demo server and tests on another port, so parallel runs do not collide: `VT_E2E_PORT=4211 npm run e2e`.
17
+ - `npm run size` builds and prints gzip sizes; `npm run size -- --write` refreshes `SIZE.md`.
18
+ - `UPDATE_FORK_POINT=1 npm test -- test/fork-point.node.test.ts` regenerates `test/fixtures/fork-point.sha256` after a deliberate engine change.
package/STYLES.md ADDED
@@ -0,0 +1,116 @@
1
+ # Styles
2
+
3
+ VirtualTour ships three stylesheets and one stable naming contract.
4
+
5
+ | File | Import | Purpose |
6
+ |---|---|---|
7
+ | `base.css` | `virtual-site-tour/base.css` | Required. The engine's functional rules plus a plain, usable popover. |
8
+ | `theme.css` | `virtual-site-tour/theme.css` | Optional. Variable-driven colors, dark mode, focus ring and entrance animation. Import it after `base.css`. |
9
+ | `avatar.css` | `virtual-site-tour/avatar.css` | Only with `SpeakerPresenter`. Lays out the speech bubble and avatar. Import it after `base.css` and `theme.css`. |
10
+
11
+ Without `theme.css` the popover stays a plain light box. In a development build, `start()` logs a warning once per tour when `base.css` is missing.
12
+
13
+ ## Theming
14
+
15
+ Set the variables on `:root` (or any ancestor of the popover) to restyle every popover. Your rules win over the theme's defaults, including in dark mode, because the theme selectors have zero specificity.
16
+
17
+ The theme sets the instruction and feedback variables in dark mode only; light mode uses the engine's built-in colors. The entrance animation replaces the engine fade on the popover, so `--vt-enter-duration` (not `--vt-animation-duration`) times it once `theme.css` is loaded.
18
+
19
+ Dark mode follows `prefers-color-scheme`. Set `data-vt-theme="dark"` or `data-vt-theme="light"` on `<html>` to force one scheme regardless of the visitor's setting.
20
+
21
+ | Variable | Default (light) | Used for |
22
+ |---|---|---|
23
+ | `--vt-accent` | `#2563eb` | Primary buttons, focus ring, progress bar |
24
+ | `--vt-bg` | `#ffffff` | Popover and button background, arrow |
25
+ | `--vt-fg` | `#1f2328` | Text |
26
+ | `--vt-muted` | `#59636e` | Progress text, close button, button borders, secondary buttons |
27
+ | `--vt-radius` | `8px` | Popover corners (buttons use half) |
28
+ | `--vt-space` | `16px` | Popover padding |
29
+ | `--vt-shadow` | two-layer shadow | Popover shadow |
30
+ | `--vt-font` | system UI stack | Popover font |
31
+ | `--vt-enter-duration` | `180ms` | Entrance animation |
32
+ | `--vt-progress-index` | `0` | Filled steps in the progress bar. Set it on the popover; nothing fills it yet |
33
+ | `--vt-progress-total` | `1` | Total steps in the progress bar. Set it on the popover; nothing fills it yet |
34
+
35
+ ## Engine variables (`base.css`)
36
+
37
+ | Variable | Used for |
38
+ |---|---|
39
+ | `--vt-base` | Marker the missing-stylesheet check reads. Do not override. |
40
+ | `--vt-popover-font-family` | Popover font in `base.css` |
41
+ | `--vt-animation-duration` | Overlay and popover fade |
42
+ | `--vt-allowed-z-index` | Stacking of extra elements |
43
+ | `--vt-nudge-duration`, `--vt-nudge-distance`, `--vt-nudge-color` | Nudge animation |
44
+ | `--vt-raised-highlight-width`, `--vt-raised-highlight-color`, `--vt-raised-highlight-offset`, `--vt-raised-highlight-background` | Outline on raised targets |
45
+ | `--vt-instruction-background`, `--vt-instruction-color`, `--vt-instruction-padding`, `--vt-instruction-radius`, `--vt-instruction-indicator-color`, `--vt-instruction-indicator-size`, `--vt-instruction-next-color`, `--vt-instruction-done-background`, `--vt-instruction-done-color` | Instruction strip on action steps |
46
+ | `--vt-feedback-color` | Feedback line |
47
+
48
+ ## Avatar variables (`avatar.css`)
49
+
50
+ | Variable | Default | Used for |
51
+ |---|---|---|
52
+ | `--vt-avatar-base` | `1` | Marker the missing-stylesheet check reads. Do not override. |
53
+ | `--vt-avatar-gap` | `8px` | Space between the bubble and the avatar. The presenter sets it from the pack's `bubble.gap` when the pack has one. |
54
+
55
+ The bubble reads `--vt-bg`, `--vt-space`, `--vt-radius` and `--vt-shadow` from the theme and falls back to the `base.css` look without it.
56
+
57
+ ## Attributes
58
+
59
+ | Attribute | Where | Meaning |
60
+ |---|---|---|
61
+ | `data-vt-active` | `<body>` | A tour is running |
62
+ | `data-vt-dim` | `<body>` | Overlay is on |
63
+ | `data-vt-fade` | `<body>` | Animated (fade and entrance) |
64
+ | `data-vt-lock-scroll` | `<body>`, target parent | Scrolling disabled |
65
+ | `data-vt-target` | target | The spotlit element |
66
+ | `data-vt-blocked` | target | Clicks blocked |
67
+ | `data-vt-raised` | target | Raised above the overlay |
68
+ | `data-vt-extra` | extra element | Allowed alongside the target |
69
+ | `data-vt-target-parent` | target's parent | Scroll lock root |
70
+ | `data-vt-overlay` | overlay SVG | The dimming overlay |
71
+ | `data-vt-layer` | `<dialog>` | The dialog layer |
72
+ | `data-vt-strategy` | popover | `absolute` when positioned inside a transformed container |
73
+ | `data-vt-dock` | speaker popover | `start` or `end`: the inline edge of the bubble the avatar sits on, or above (`start`) and below (`end`) it beside a left or right popover. Written by the presenter, which resolves `auto`. |
74
+ | `data-vt-side` | speaker popover | `top`, `bottom`, `left`, `right` or `over`: the side the popover ended on, `over` when no side fit and it was pinned to the viewport. Written by the presenter after every reposition, whatever the tour's namespace. |
75
+ | `data-vt-anim` | avatar | Name of the animation the sprite player is showing, the pack's `rest` animation when it stands still. Written by the player; style on it only to hide or restyle a pose. |
76
+
77
+ ## Classes
78
+
79
+ ### Popover
80
+
81
+ `vt-popover`, `vt-popover-side-*`, `vt-popover-align-*`, `vt-popover-rtl`, `vt-no-arrow`, `vt-popover-waiting`, `vt-waiting`, `vt-popover-nudge`, `vt-popover-has-instruction`, `vt-popover-instruction-done`, `vt-dialog`
82
+
83
+ ### Parts
84
+
85
+ | Part | Classes |
86
+ |---|---|
87
+ | Title, close, description | `vt-popover-title`, `vt-popover-close-btn`, `vt-popover-description` |
88
+ | Body (Element content) | `vt-body` |
89
+ | Footer | `vt-popover-footer`, `vt-popover-progress-text`, `vt-popover-navigation-btns`, `vt-popover-prev-btn`, `vt-popover-next-btn`, `vt-popover-footer-btn`, `vt-popover-done-btn`, `vt-popover-btn-disabled` |
90
+ | Custom buttons | `vt-footer`, `vt-button`, `vt-button--secondary` |
91
+ | Instruction and feedback | `vt-popover-instruction`, `vt-popover-instruction-text`, `vt-popover-instruction-indicator`, `vt-popover-feedback` |
92
+ | Arrow | `vt-popover-arrow`, `vt-popover-arrow-side-*`, `vt-popover-arrow-none` |
93
+ | Speaker | `vt-speaker`, `vt-speaker--no-avatar`, `vt-bubble`, `vt-bubble-tail`, `vt-avatar-slot`, `vt-avatar` |
94
+ | Dialog layer | `vt-layer` |
95
+ | Live region | `vt-live-region` |
96
+
97
+ ### Namespaced (prefix is the `namespace` option, default `vt`)
98
+
99
+ `<ns>-active`, `<ns>-fade`, `<ns>-simple`, `<ns>-no-scroll`, `<ns>-overlay`, `<ns>-overlay-animated`, `<ns>-target`, `<ns>-target-blocked`, `<ns>-target-raised`, `<ns>-extra`, `<ns>-target-parent`, `<ns>-spotlit`
100
+
101
+ The shipped stylesheets never use the namespaced classes, so two tours with different namespaces can be styled independently. Popover wrappers also carry `data-<ns>-step` (step index) and `data-<ns>-side`. The speaker presenter also writes the fixed `data-vt-side` that `avatar.css` reads, so avatar styling does not depend on the namespace.
102
+
103
+ ### Author-applied
104
+
105
+ Names you set yourself. The engine never emits them.
106
+
107
+ | Name | Where | Effect |
108
+ |---|---|---|
109
+ | `data-vt-theme` | `<html>` | `dark` or `light` forces a scheme |
110
+ | `data-vt-progress-bar` | popover | Shows the progress bar; `--vt-progress-index` and `--vt-progress-total` set its width |
111
+
112
+ ### Avatar mode
113
+
114
+ With `SpeakerPresenter` the popover wrapper carries `vt-speaker` and holds, in order, the arrow (`vt-popover-arrow vt-bubble-tail`), `vt-bubble` (title, description, body, instruction and footer) and `vt-avatar-slot`. The presenter moves one `vt-avatar` element (`aria-hidden`, never focusable) into the slot of each step. `vt-speaker--no-avatar` marks a step that sets `extensions.avatar.hidden`; its slot is hidden.
115
+
116
+ The tail is positioned against the bubble's edge, so the bubble sits flush on the edge that faces the target and the avatar hangs off the other side, however tall or wide it is.
@@ -0,0 +1,103 @@
1
+ .vt-popover.vt-speaker {
2
+ --vt-avatar-base: 1;
3
+ display: flex;
4
+ flex-direction: row;
5
+ align-items: flex-end;
6
+ gap: var(--vt-avatar-gap, 8px);
7
+ min-width: 0;
8
+ max-width: none;
9
+ padding: 0;
10
+ border-radius: 0;
11
+ background: transparent;
12
+ box-shadow: none;
13
+ }
14
+
15
+ .vt-speaker[data-vt-dock="start"] {
16
+ flex-direction: row-reverse;
17
+ }
18
+
19
+ .vt-speaker[data-vt-side="left"],
20
+ .vt-speaker[data-vt-side="right"] {
21
+ flex-direction: column;
22
+ }
23
+
24
+ .vt-speaker[data-vt-dock="start"][data-vt-side="left"],
25
+ .vt-speaker[data-vt-dock="start"][data-vt-side="right"] {
26
+ flex-direction: column-reverse;
27
+ }
28
+
29
+ .vt-speaker .vt-bubble {
30
+ position: relative;
31
+ box-sizing: border-box;
32
+ min-width: 250px;
33
+ max-width: 300px;
34
+ padding: var(--vt-space, 15px);
35
+ border-radius: var(--vt-radius, 5px);
36
+ background-color: var(--vt-bg, #fff);
37
+ box-shadow: var(--vt-shadow, 0 1px 10px #0006);
38
+ }
39
+
40
+ .vt-speaker[data-vt-side="bottom"] .vt-bubble {
41
+ align-self: flex-start;
42
+ }
43
+
44
+ .vt-speaker[data-vt-side="top"] .vt-bubble,
45
+ .vt-speaker[data-vt-side="over"] .vt-bubble {
46
+ align-self: flex-end;
47
+ }
48
+
49
+ .vt-speaker[data-vt-side="left"] .vt-bubble {
50
+ margin-left: auto;
51
+ }
52
+
53
+ .vt-speaker[data-vt-side="right"] .vt-bubble {
54
+ margin-right: auto;
55
+ }
56
+
57
+ .vt-speaker .vt-avatar-slot {
58
+ position: relative;
59
+ flex: none;
60
+ align-self: flex-end;
61
+ }
62
+
63
+ .vt-speaker .vt-avatar {
64
+ position: absolute;
65
+ top: 0;
66
+ left: 0;
67
+ }
68
+
69
+ .vt-popover.vt-speaker:focus-visible {
70
+ outline: none;
71
+ }
72
+
73
+ .vt-speaker:focus-visible .vt-bubble {
74
+ outline: 2px solid var(--vt-accent, #2d2d2d);
75
+ outline-offset: 2px;
76
+ }
77
+
78
+ .vt-popover.vt-speaker[data-vt-progress-bar]::after {
79
+ display: none;
80
+ }
81
+
82
+ .vt-speaker--no-avatar .vt-avatar-slot {
83
+ display: none;
84
+ }
85
+
86
+ @keyframes vt-avatar-enter {
87
+ from {
88
+ opacity: 0;
89
+ transform: scale(0.85);
90
+ }
91
+
92
+ to {
93
+ opacity: 1;
94
+ transform: scale(1);
95
+ }
96
+ }
97
+
98
+ @media (prefers-reduced-motion: no-preference) {
99
+ [data-vt-fade] .vt-speaker .vt-avatar-slot {
100
+ transform-origin: bottom center;
101
+ animation: vt-avatar-enter var(--vt-enter-duration, 180ms) ease-out;
102
+ }
103
+ }