@cratis/showrunner.cue.react 0.0.0-stage → 2.10.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 (417) hide show
  1. package/.storybook/main.ts +11 -0
  2. package/.storybook/preview.tsx +21 -0
  3. package/Configuration/CueConfiguration.ts +27 -0
  4. package/Configuration/CueProvider.tsx +64 -0
  5. package/Configuration/CueStageBoundary.tsx +37 -0
  6. package/Configuration/index.ts +6 -0
  7. package/Icons.tsx +36 -0
  8. package/Labels/CueLabels.ts +39 -0
  9. package/Labels/defaultCueLabels.ts +23 -0
  10. package/Labels/index.ts +6 -0
  11. package/Labels/resolveLabels.ts +12 -0
  12. package/Markdown/CueMarkdown.tsx +31 -0
  13. package/Markdown/index.ts +5 -0
  14. package/Markdown/safeUrl.ts +29 -0
  15. package/README.md +54 -2
  16. package/Speech/CueSpeech.ts +27 -0
  17. package/Speech/CueSpeechConfiguration.ts +21 -0
  18. package/Speech/HttpSpeechOptions.ts +37 -0
  19. package/Speech/createHttpSpeech.ts +135 -0
  20. package/Speech/index.ts +7 -0
  21. package/Speech/silentSpeech.ts +15 -0
  22. package/Speech/speechClips.ts +66 -0
  23. package/TourAnchor.tsx +162 -0
  24. package/TourAnchorSpace.ts +15 -0
  25. package/TourCallout.ts +22 -0
  26. package/TourCalloutBubble.tsx +38 -0
  27. package/TourCamera.ts +17 -0
  28. package/TourChapter.ts +24 -0
  29. package/TourChapterList.tsx +65 -0
  30. package/TourGesture.ts +30 -0
  31. package/TourOverlayShell.tsx +102 -0
  32. package/TourPointer.tsx +83 -0
  33. package/TourSection.ts +24 -0
  34. package/TourSelfPacedPanel.tsx +26 -0
  35. package/TourStep.ts +40 -0
  36. package/TourSubtitles.tsx +22 -0
  37. package/TourTimelineBar.tsx +127 -0
  38. package/Tours/index.ts +5 -0
  39. package/Tours/useCueTours.ts +63 -0
  40. package/Tours/useTourNudge.ts +37 -0
  41. package/cursorSvg.ts +12 -0
  42. package/dist/cjs/Configuration/CueConfiguration.d.ts +11 -0
  43. package/dist/cjs/Configuration/CueConfiguration.d.ts.map +1 -0
  44. package/dist/cjs/Configuration/CueProvider.d.ts +19 -0
  45. package/dist/cjs/Configuration/CueProvider.d.ts.map +1 -0
  46. package/dist/cjs/Configuration/CueProvider.js +44 -0
  47. package/dist/cjs/Configuration/CueProvider.js.map +1 -0
  48. package/dist/cjs/Configuration/CueStageBoundary.d.ts +14 -0
  49. package/dist/cjs/Configuration/CueStageBoundary.d.ts.map +1 -0
  50. package/dist/cjs/Configuration/CueStageBoundary.js +45 -0
  51. package/dist/cjs/Configuration/CueStageBoundary.js.map +1 -0
  52. package/dist/cjs/Configuration/index.d.ts +4 -0
  53. package/dist/cjs/Configuration/index.d.ts.map +1 -0
  54. package/dist/cjs/Examples/AppShell.d.ts +5 -0
  55. package/dist/cjs/Examples/AppShell.d.ts.map +1 -0
  56. package/dist/cjs/Examples/LocalizedCue.d.ts +5 -0
  57. package/dist/cjs/Examples/LocalizedCue.d.ts.map +1 -0
  58. package/dist/cjs/Examples/OrderDeskTour.d.ts +2 -0
  59. package/dist/cjs/Examples/OrderDeskTour.d.ts.map +1 -0
  60. package/dist/cjs/Examples/OwnStageGuard.d.ts +5 -0
  61. package/dist/cjs/Examples/OwnStageGuard.d.ts.map +1 -0
  62. package/dist/cjs/Examples/OwnVoice.d.ts +3 -0
  63. package/dist/cjs/Examples/OwnVoice.d.ts.map +1 -0
  64. package/dist/cjs/Icons.d.ts +19 -0
  65. package/dist/cjs/Icons.d.ts.map +1 -0
  66. package/dist/cjs/Icons.js +33 -0
  67. package/dist/cjs/Icons.js.map +1 -0
  68. package/dist/cjs/Labels/CueLabels.d.ts +18 -0
  69. package/dist/cjs/Labels/CueLabels.d.ts.map +1 -0
  70. package/dist/cjs/Labels/defaultCueLabels.d.ts +3 -0
  71. package/dist/cjs/Labels/defaultCueLabels.d.ts.map +1 -0
  72. package/dist/cjs/Labels/defaultCueLabels.js +24 -0
  73. package/dist/cjs/Labels/defaultCueLabels.js.map +1 -0
  74. package/dist/cjs/Labels/index.d.ts +4 -0
  75. package/dist/cjs/Labels/index.d.ts.map +1 -0
  76. package/dist/cjs/Labels/resolveLabels.d.ts +3 -0
  77. package/dist/cjs/Labels/resolveLabels.d.ts.map +1 -0
  78. package/dist/cjs/Labels/resolveLabels.js +17 -0
  79. package/dist/cjs/Labels/resolveLabels.js.map +1 -0
  80. package/dist/cjs/Markdown/CueMarkdown.d.ts +6 -0
  81. package/dist/cjs/Markdown/CueMarkdown.d.ts.map +1 -0
  82. package/dist/cjs/Markdown/CueMarkdown.js +34 -0
  83. package/dist/cjs/Markdown/CueMarkdown.js.map +1 -0
  84. package/dist/cjs/Markdown/index.d.ts +3 -0
  85. package/dist/cjs/Markdown/index.d.ts.map +1 -0
  86. package/dist/cjs/Markdown/safeUrl.d.ts +2 -0
  87. package/dist/cjs/Markdown/safeUrl.d.ts.map +1 -0
  88. package/dist/cjs/Markdown/safeUrl.js +34 -0
  89. package/dist/cjs/Markdown/safeUrl.js.map +1 -0
  90. package/dist/cjs/Speech/CueSpeech.d.ts +10 -0
  91. package/dist/cjs/Speech/CueSpeech.d.ts.map +1 -0
  92. package/dist/cjs/Speech/CueSpeechConfiguration.d.ts +6 -0
  93. package/dist/cjs/Speech/CueSpeechConfiguration.d.ts.map +1 -0
  94. package/dist/cjs/Speech/HttpSpeechOptions.d.ts +10 -0
  95. package/dist/cjs/Speech/HttpSpeechOptions.d.ts.map +1 -0
  96. package/dist/cjs/Speech/createHttpSpeech.d.ts +4 -0
  97. package/dist/cjs/Speech/createHttpSpeech.d.ts.map +1 -0
  98. package/dist/cjs/Speech/createHttpSpeech.js +140 -0
  99. package/dist/cjs/Speech/createHttpSpeech.js.map +1 -0
  100. package/dist/cjs/Speech/index.d.ts +5 -0
  101. package/dist/cjs/Speech/index.d.ts.map +1 -0
  102. package/dist/cjs/Speech/silentSpeech.d.ts +3 -0
  103. package/dist/cjs/Speech/silentSpeech.d.ts.map +1 -0
  104. package/dist/cjs/Speech/silentSpeech.js +16 -0
  105. package/dist/cjs/Speech/silentSpeech.js.map +1 -0
  106. package/dist/cjs/Speech/speechClips.d.ts +7 -0
  107. package/dist/cjs/Speech/speechClips.d.ts.map +1 -0
  108. package/dist/cjs/Speech/speechClips.js +60 -0
  109. package/dist/cjs/Speech/speechClips.js.map +1 -0
  110. package/dist/cjs/TourAnchor.d.ts +14 -0
  111. package/dist/cjs/TourAnchor.d.ts.map +1 -0
  112. package/dist/cjs/TourAnchor.js +150 -0
  113. package/dist/cjs/TourAnchor.js.map +1 -0
  114. package/dist/cjs/TourAnchorSpace.d.ts +2 -0
  115. package/dist/cjs/TourAnchorSpace.d.ts.map +1 -0
  116. package/dist/cjs/TourCallout.d.ts +8 -0
  117. package/dist/cjs/TourCallout.d.ts.map +1 -0
  118. package/dist/cjs/TourCalloutBubble.d.ts +9 -0
  119. package/dist/cjs/TourCalloutBubble.d.ts.map +1 -0
  120. package/dist/cjs/TourCalloutBubble.js +27 -0
  121. package/dist/cjs/TourCalloutBubble.js.map +1 -0
  122. package/dist/cjs/TourCamera.d.ts +6 -0
  123. package/dist/cjs/TourCamera.d.ts.map +1 -0
  124. package/dist/cjs/TourChapter.d.ts +8 -0
  125. package/dist/cjs/TourChapter.d.ts.map +1 -0
  126. package/dist/cjs/TourChapterList.d.ts +10 -0
  127. package/dist/cjs/TourChapterList.d.ts.map +1 -0
  128. package/dist/cjs/TourChapterList.js +68 -0
  129. package/dist/cjs/TourChapterList.js.map +1 -0
  130. package/dist/cjs/TourChapterList.stories.d.ts +21 -0
  131. package/dist/cjs/TourChapterList.stories.d.ts.map +1 -0
  132. package/dist/cjs/TourGesture.d.ts +12 -0
  133. package/dist/cjs/TourGesture.d.ts.map +1 -0
  134. package/dist/cjs/TourOverlayShell.d.ts +13 -0
  135. package/dist/cjs/TourOverlayShell.d.ts.map +1 -0
  136. package/dist/cjs/TourOverlayShell.js +77 -0
  137. package/dist/cjs/TourOverlayShell.js.map +1 -0
  138. package/dist/cjs/TourPointer.d.ts +9 -0
  139. package/dist/cjs/TourPointer.d.ts.map +1 -0
  140. package/dist/cjs/TourPointer.js +74 -0
  141. package/dist/cjs/TourPointer.js.map +1 -0
  142. package/dist/cjs/TourSection.d.ts +8 -0
  143. package/dist/cjs/TourSection.d.ts.map +1 -0
  144. package/dist/cjs/TourSelfPacedPanel.d.ts +6 -0
  145. package/dist/cjs/TourSelfPacedPanel.d.ts.map +1 -0
  146. package/dist/cjs/TourSelfPacedPanel.js +27 -0
  147. package/dist/cjs/TourSelfPacedPanel.js.map +1 -0
  148. package/dist/cjs/TourSelfPacedPanel.stories.d.ts +21 -0
  149. package/dist/cjs/TourSelfPacedPanel.stories.d.ts.map +1 -0
  150. package/dist/cjs/TourStep.d.ts +12 -0
  151. package/dist/cjs/TourStep.d.ts.map +1 -0
  152. package/dist/cjs/TourSubtitles.d.ts +5 -0
  153. package/dist/cjs/TourSubtitles.d.ts.map +1 -0
  154. package/dist/cjs/TourSubtitles.js +24 -0
  155. package/dist/cjs/TourSubtitles.js.map +1 -0
  156. package/dist/cjs/TourTimelineBar.d.ts +10 -0
  157. package/dist/cjs/TourTimelineBar.d.ts.map +1 -0
  158. package/dist/cjs/TourTimelineBar.js +134 -0
  159. package/dist/cjs/TourTimelineBar.js.map +1 -0
  160. package/dist/cjs/TourTimelineBar.stories.d.ts +24 -0
  161. package/dist/cjs/TourTimelineBar.stories.d.ts.map +1 -0
  162. package/dist/cjs/Tours/index.d.ts +3 -0
  163. package/dist/cjs/Tours/index.d.ts.map +1 -0
  164. package/dist/cjs/Tours/useCueTours.d.ts +7 -0
  165. package/dist/cjs/Tours/useCueTours.d.ts.map +1 -0
  166. package/dist/cjs/Tours/useCueTours.js +46 -0
  167. package/dist/cjs/Tours/useCueTours.js.map +1 -0
  168. package/dist/cjs/Tours/useTourNudge.d.ts +6 -0
  169. package/dist/cjs/Tours/useTourNudge.d.ts.map +1 -0
  170. package/dist/cjs/Tours/useTourNudge.js +28 -0
  171. package/dist/cjs/Tours/useTourNudge.js.map +1 -0
  172. package/dist/cjs/cursorSvg.d.ts +2 -0
  173. package/dist/cjs/cursorSvg.d.ts.map +1 -0
  174. package/dist/cjs/cursorSvg.js +15 -0
  175. package/dist/cjs/cursorSvg.js.map +1 -0
  176. package/dist/cjs/index.d.ts +41 -0
  177. package/dist/cjs/index.d.ts.map +1 -0
  178. package/dist/cjs/index.js +72 -0
  179. package/dist/cjs/index.js.map +1 -0
  180. package/dist/cjs/package.json +3 -0
  181. package/dist/cjs/tourClock.d.ts +19 -0
  182. package/dist/cjs/tourClock.d.ts.map +1 -0
  183. package/dist/cjs/tourClock.js +107 -0
  184. package/dist/cjs/tourClock.js.map +1 -0
  185. package/dist/cjs/tourGeometry.d.ts +18 -0
  186. package/dist/cjs/tourGeometry.d.ts.map +1 -0
  187. package/dist/cjs/tourGeometry.js +86 -0
  188. package/dist/cjs/tourGeometry.js.map +1 -0
  189. package/dist/cjs/tourSelfPaced.d.ts +12 -0
  190. package/dist/cjs/tourSelfPaced.d.ts.map +1 -0
  191. package/dist/cjs/tourSelfPaced.js +69 -0
  192. package/dist/cjs/tourSelfPaced.js.map +1 -0
  193. package/dist/cjs/tourTimeline.d.ts +40 -0
  194. package/dist/cjs/tourTimeline.d.ts.map +1 -0
  195. package/dist/cjs/tourTimeline.js +168 -0
  196. package/dist/cjs/tourTimeline.js.map +1 -0
  197. package/dist/cjs/useTourPlayback.d.ts +25 -0
  198. package/dist/cjs/useTourPlayback.d.ts.map +1 -0
  199. package/dist/cjs/useTourPlayback.js +245 -0
  200. package/dist/cjs/useTourPlayback.js.map +1 -0
  201. package/dist/esm/Configuration/CueConfiguration.d.ts +11 -0
  202. package/dist/esm/Configuration/CueConfiguration.d.ts.map +1 -0
  203. package/dist/esm/Configuration/CueConfiguration.js +2 -0
  204. package/dist/esm/Configuration/CueConfiguration.js.map +1 -0
  205. package/dist/esm/Configuration/CueProvider.d.ts +19 -0
  206. package/dist/esm/Configuration/CueProvider.d.ts.map +1 -0
  207. package/dist/esm/Configuration/CueProvider.js +41 -0
  208. package/dist/esm/Configuration/CueProvider.js.map +1 -0
  209. package/dist/esm/Configuration/CueStageBoundary.d.ts +14 -0
  210. package/dist/esm/Configuration/CueStageBoundary.d.ts.map +1 -0
  211. package/dist/esm/Configuration/CueStageBoundary.js +43 -0
  212. package/dist/esm/Configuration/CueStageBoundary.js.map +1 -0
  213. package/dist/esm/Configuration/index.d.ts +4 -0
  214. package/dist/esm/Configuration/index.d.ts.map +1 -0
  215. package/dist/esm/Configuration/index.js +4 -0
  216. package/dist/esm/Configuration/index.js.map +1 -0
  217. package/dist/esm/Examples/AppShell.d.ts +5 -0
  218. package/dist/esm/Examples/AppShell.d.ts.map +1 -0
  219. package/dist/esm/Examples/AppShell.js +10 -0
  220. package/dist/esm/Examples/AppShell.js.map +1 -0
  221. package/dist/esm/Examples/LocalizedCue.d.ts +5 -0
  222. package/dist/esm/Examples/LocalizedCue.d.ts.map +1 -0
  223. package/dist/esm/Examples/LocalizedCue.js +11 -0
  224. package/dist/esm/Examples/LocalizedCue.js.map +1 -0
  225. package/dist/esm/Examples/OrderDeskTour.d.ts +2 -0
  226. package/dist/esm/Examples/OrderDeskTour.d.ts.map +1 -0
  227. package/dist/esm/Examples/OrderDeskTour.js +33 -0
  228. package/dist/esm/Examples/OrderDeskTour.js.map +1 -0
  229. package/dist/esm/Examples/OwnStageGuard.d.ts +5 -0
  230. package/dist/esm/Examples/OwnStageGuard.d.ts.map +1 -0
  231. package/dist/esm/Examples/OwnStageGuard.js +17 -0
  232. package/dist/esm/Examples/OwnStageGuard.js.map +1 -0
  233. package/dist/esm/Examples/OwnVoice.d.ts +3 -0
  234. package/dist/esm/Examples/OwnVoice.d.ts.map +1 -0
  235. package/dist/esm/Examples/OwnVoice.js +35 -0
  236. package/dist/esm/Examples/OwnVoice.js.map +1 -0
  237. package/dist/esm/Icons.d.ts +19 -0
  238. package/dist/esm/Icons.d.ts.map +1 -0
  239. package/dist/esm/Icons.js +31 -0
  240. package/dist/esm/Icons.js.map +1 -0
  241. package/dist/esm/Labels/CueLabels.d.ts +18 -0
  242. package/dist/esm/Labels/CueLabels.d.ts.map +1 -0
  243. package/dist/esm/Labels/CueLabels.js +2 -0
  244. package/dist/esm/Labels/CueLabels.js.map +1 -0
  245. package/dist/esm/Labels/defaultCueLabels.d.ts +3 -0
  246. package/dist/esm/Labels/defaultCueLabels.d.ts.map +1 -0
  247. package/dist/esm/Labels/defaultCueLabels.js +22 -0
  248. package/dist/esm/Labels/defaultCueLabels.js.map +1 -0
  249. package/dist/esm/Labels/index.d.ts +4 -0
  250. package/dist/esm/Labels/index.d.ts.map +1 -0
  251. package/dist/esm/Labels/index.js +4 -0
  252. package/dist/esm/Labels/index.js.map +1 -0
  253. package/dist/esm/Labels/resolveLabels.d.ts +3 -0
  254. package/dist/esm/Labels/resolveLabels.d.ts.map +1 -0
  255. package/dist/esm/Labels/resolveLabels.js +15 -0
  256. package/dist/esm/Labels/resolveLabels.js.map +1 -0
  257. package/dist/esm/Markdown/CueMarkdown.d.ts +6 -0
  258. package/dist/esm/Markdown/CueMarkdown.d.ts.map +1 -0
  259. package/dist/esm/Markdown/CueMarkdown.js +32 -0
  260. package/dist/esm/Markdown/CueMarkdown.js.map +1 -0
  261. package/dist/esm/Markdown/index.d.ts +3 -0
  262. package/dist/esm/Markdown/index.d.ts.map +1 -0
  263. package/dist/esm/Markdown/index.js +3 -0
  264. package/dist/esm/Markdown/index.js.map +1 -0
  265. package/dist/esm/Markdown/safeUrl.d.ts +2 -0
  266. package/dist/esm/Markdown/safeUrl.d.ts.map +1 -0
  267. package/dist/esm/Markdown/safeUrl.js +32 -0
  268. package/dist/esm/Markdown/safeUrl.js.map +1 -0
  269. package/dist/esm/Speech/CueSpeech.d.ts +10 -0
  270. package/dist/esm/Speech/CueSpeech.d.ts.map +1 -0
  271. package/dist/esm/Speech/CueSpeech.js +2 -0
  272. package/dist/esm/Speech/CueSpeech.js.map +1 -0
  273. package/dist/esm/Speech/CueSpeechConfiguration.d.ts +6 -0
  274. package/dist/esm/Speech/CueSpeechConfiguration.d.ts.map +1 -0
  275. package/dist/esm/Speech/CueSpeechConfiguration.js +2 -0
  276. package/dist/esm/Speech/CueSpeechConfiguration.js.map +1 -0
  277. package/dist/esm/Speech/HttpSpeechOptions.d.ts +10 -0
  278. package/dist/esm/Speech/HttpSpeechOptions.d.ts.map +1 -0
  279. package/dist/esm/Speech/HttpSpeechOptions.js +2 -0
  280. package/dist/esm/Speech/HttpSpeechOptions.js.map +1 -0
  281. package/dist/esm/Speech/createHttpSpeech.d.ts +4 -0
  282. package/dist/esm/Speech/createHttpSpeech.d.ts.map +1 -0
  283. package/dist/esm/Speech/createHttpSpeech.js +138 -0
  284. package/dist/esm/Speech/createHttpSpeech.js.map +1 -0
  285. package/dist/esm/Speech/index.d.ts +5 -0
  286. package/dist/esm/Speech/index.d.ts.map +1 -0
  287. package/dist/esm/Speech/index.js +5 -0
  288. package/dist/esm/Speech/index.js.map +1 -0
  289. package/dist/esm/Speech/silentSpeech.d.ts +3 -0
  290. package/dist/esm/Speech/silentSpeech.d.ts.map +1 -0
  291. package/dist/esm/Speech/silentSpeech.js +14 -0
  292. package/dist/esm/Speech/silentSpeech.js.map +1 -0
  293. package/dist/esm/Speech/speechClips.d.ts +7 -0
  294. package/dist/esm/Speech/speechClips.d.ts.map +1 -0
  295. package/dist/esm/Speech/speechClips.js +58 -0
  296. package/dist/esm/Speech/speechClips.js.map +1 -0
  297. package/dist/esm/TourAnchor.d.ts +14 -0
  298. package/dist/esm/TourAnchor.d.ts.map +1 -0
  299. package/dist/esm/TourAnchor.js +148 -0
  300. package/dist/esm/TourAnchor.js.map +1 -0
  301. package/dist/esm/TourAnchorSpace.d.ts +2 -0
  302. package/dist/esm/TourAnchorSpace.d.ts.map +1 -0
  303. package/dist/esm/TourAnchorSpace.js +2 -0
  304. package/dist/esm/TourAnchorSpace.js.map +1 -0
  305. package/dist/esm/TourCallout.d.ts +8 -0
  306. package/dist/esm/TourCallout.d.ts.map +1 -0
  307. package/dist/esm/TourCallout.js +2 -0
  308. package/dist/esm/TourCallout.js.map +1 -0
  309. package/dist/esm/TourCalloutBubble.d.ts +9 -0
  310. package/dist/esm/TourCalloutBubble.d.ts.map +1 -0
  311. package/dist/esm/TourCalloutBubble.js +25 -0
  312. package/dist/esm/TourCalloutBubble.js.map +1 -0
  313. package/dist/esm/TourCamera.d.ts +6 -0
  314. package/dist/esm/TourCamera.d.ts.map +1 -0
  315. package/dist/esm/TourCamera.js +2 -0
  316. package/dist/esm/TourCamera.js.map +1 -0
  317. package/dist/esm/TourChapter.d.ts +8 -0
  318. package/dist/esm/TourChapter.d.ts.map +1 -0
  319. package/dist/esm/TourChapter.js +2 -0
  320. package/dist/esm/TourChapter.js.map +1 -0
  321. package/dist/esm/TourChapterList.d.ts +10 -0
  322. package/dist/esm/TourChapterList.d.ts.map +1 -0
  323. package/dist/esm/TourChapterList.js +66 -0
  324. package/dist/esm/TourChapterList.js.map +1 -0
  325. package/dist/esm/TourChapterList.stories.d.ts +21 -0
  326. package/dist/esm/TourChapterList.stories.d.ts.map +1 -0
  327. package/dist/esm/TourChapterList.stories.js +53 -0
  328. package/dist/esm/TourChapterList.stories.js.map +1 -0
  329. package/dist/esm/TourGesture.d.ts +12 -0
  330. package/dist/esm/TourGesture.d.ts.map +1 -0
  331. package/dist/esm/TourGesture.js +2 -0
  332. package/dist/esm/TourGesture.js.map +1 -0
  333. package/dist/esm/TourOverlayShell.d.ts +13 -0
  334. package/dist/esm/TourOverlayShell.d.ts.map +1 -0
  335. package/dist/esm/TourOverlayShell.js +75 -0
  336. package/dist/esm/TourOverlayShell.js.map +1 -0
  337. package/dist/esm/TourPointer.d.ts +9 -0
  338. package/dist/esm/TourPointer.d.ts.map +1 -0
  339. package/dist/esm/TourPointer.js +72 -0
  340. package/dist/esm/TourPointer.js.map +1 -0
  341. package/dist/esm/TourSection.d.ts +8 -0
  342. package/dist/esm/TourSection.d.ts.map +1 -0
  343. package/dist/esm/TourSection.js +2 -0
  344. package/dist/esm/TourSection.js.map +1 -0
  345. package/dist/esm/TourSelfPacedPanel.d.ts +6 -0
  346. package/dist/esm/TourSelfPacedPanel.d.ts.map +1 -0
  347. package/dist/esm/TourSelfPacedPanel.js +25 -0
  348. package/dist/esm/TourSelfPacedPanel.js.map +1 -0
  349. package/dist/esm/TourSelfPacedPanel.stories.d.ts +21 -0
  350. package/dist/esm/TourSelfPacedPanel.stories.d.ts.map +1 -0
  351. package/dist/esm/TourSelfPacedPanel.stories.js +41 -0
  352. package/dist/esm/TourSelfPacedPanel.stories.js.map +1 -0
  353. package/dist/esm/TourStep.d.ts +12 -0
  354. package/dist/esm/TourStep.d.ts.map +1 -0
  355. package/dist/esm/TourStep.js +2 -0
  356. package/dist/esm/TourStep.js.map +1 -0
  357. package/dist/esm/TourSubtitles.d.ts +5 -0
  358. package/dist/esm/TourSubtitles.d.ts.map +1 -0
  359. package/dist/esm/TourSubtitles.js +22 -0
  360. package/dist/esm/TourSubtitles.js.map +1 -0
  361. package/dist/esm/TourTimelineBar.d.ts +10 -0
  362. package/dist/esm/TourTimelineBar.d.ts.map +1 -0
  363. package/dist/esm/TourTimelineBar.js +132 -0
  364. package/dist/esm/TourTimelineBar.js.map +1 -0
  365. package/dist/esm/TourTimelineBar.stories.d.ts +24 -0
  366. package/dist/esm/TourTimelineBar.stories.d.ts.map +1 -0
  367. package/dist/esm/TourTimelineBar.stories.js +62 -0
  368. package/dist/esm/TourTimelineBar.stories.js.map +1 -0
  369. package/dist/esm/Tours/index.d.ts +3 -0
  370. package/dist/esm/Tours/index.d.ts.map +1 -0
  371. package/dist/esm/Tours/index.js +3 -0
  372. package/dist/esm/Tours/index.js.map +1 -0
  373. package/dist/esm/Tours/useCueTours.d.ts +7 -0
  374. package/dist/esm/Tours/useCueTours.d.ts.map +1 -0
  375. package/dist/esm/Tours/useCueTours.js +44 -0
  376. package/dist/esm/Tours/useCueTours.js.map +1 -0
  377. package/dist/esm/Tours/useTourNudge.d.ts +6 -0
  378. package/dist/esm/Tours/useTourNudge.d.ts.map +1 -0
  379. package/dist/esm/Tours/useTourNudge.js +26 -0
  380. package/dist/esm/Tours/useTourNudge.js.map +1 -0
  381. package/dist/esm/cursorSvg.d.ts +2 -0
  382. package/dist/esm/cursorSvg.d.ts.map +1 -0
  383. package/dist/esm/cursorSvg.js +13 -0
  384. package/dist/esm/cursorSvg.js.map +1 -0
  385. package/dist/esm/index.d.ts +41 -0
  386. package/dist/esm/index.d.ts.map +1 -0
  387. package/dist/esm/index.js +24 -0
  388. package/dist/esm/index.js.map +1 -0
  389. package/dist/esm/package.json +3 -0
  390. package/dist/esm/tourClock.d.ts +19 -0
  391. package/dist/esm/tourClock.d.ts.map +1 -0
  392. package/dist/esm/tourClock.js +103 -0
  393. package/dist/esm/tourClock.js.map +1 -0
  394. package/dist/esm/tourGeometry.d.ts +18 -0
  395. package/dist/esm/tourGeometry.d.ts.map +1 -0
  396. package/dist/esm/tourGeometry.js +80 -0
  397. package/dist/esm/tourGeometry.js.map +1 -0
  398. package/dist/esm/tourSelfPaced.d.ts +12 -0
  399. package/dist/esm/tourSelfPaced.d.ts.map +1 -0
  400. package/dist/esm/tourSelfPaced.js +64 -0
  401. package/dist/esm/tourSelfPaced.js.map +1 -0
  402. package/dist/esm/tourTimeline.d.ts +40 -0
  403. package/dist/esm/tourTimeline.d.ts.map +1 -0
  404. package/dist/esm/tourTimeline.js +154 -0
  405. package/dist/esm/tourTimeline.js.map +1 -0
  406. package/dist/esm/useTourPlayback.d.ts +25 -0
  407. package/dist/esm/useTourPlayback.d.ts.map +1 -0
  408. package/dist/esm/useTourPlayback.js +243 -0
  409. package/dist/esm/useTourPlayback.js.map +1 -0
  410. package/index.ts +68 -0
  411. package/package.json +93 -4
  412. package/styles.css +485 -0
  413. package/tourClock.ts +125 -0
  414. package/tourGeometry.ts +95 -0
  415. package/tourSelfPaced.ts +93 -0
  416. package/tourTimeline.ts +237 -0
  417. package/useTourPlayback.ts +291 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TourCalloutBubble.js","sources":["../../TourCalloutBubble.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport React from 'react';\nimport type { BoardTransform } from './tourGeometry.js';\nimport type { TourCallout } from './TourCallout.js';\nimport { TourAnchor } from './TourAnchor.js';\n\nexport interface TourCalloutBubbleProps {\n /** The callout to show, or undefined when the step has nothing to point out. */\n callout: TourCallout | undefined;\n\n /** The board's live pan and zoom. */\n transformRef: React.RefObject<BoardTransform>;\n}\n\n/**\n * Names the thing the narration is talking about, pinned just above it on the board with its caret pointing\n * down at it. The script is responsible for anchoring callouts above their subjects — the bubble always\n * renders upward from its anchor.\n */\nexport const TourCalloutBubble = ({ callout, transformRef }: TourCalloutBubbleProps) => {\n if (!callout) return null;\n\n return (\n <TourAnchor\n // Keyed by its text so a new callout fades in as itself rather than the previous one's words\n // being swapped out underneath a bubble that never moved.\n key={callout.text}\n x={callout.x}\n y={callout.y}\n space={callout.space}\n transformRef={transformRef}\n className='cue-callout'>\n <div className='cue-callout__bubble'>{callout.text}</div>\n </TourAnchor>\n );\n};\n"],"names":["TourCalloutBubble","callout","transformRef","_jsx","TourAnchor","x","y","space","className","div","text"],"mappings":";;;;AAgBA;;;;UAKaA,iBAAAA,GAAoB,CAAC,EAAEC,OAAO,EAAEC,YAAY,EAA0B,GAAA;IAC/E,IAAI,CAACD,SAAS,OAAO,IAAA;AAErB,IAAA,qBACIE,GAAA,CAACC,UAAAA,EAAAA;AAIGC,QAAAA,CAAAA,EAAGJ,QAAQI,CAAC;AACZC,QAAAA,CAAAA,EAAGL,QAAQK,CAAC;AACZC,QAAAA,KAAAA,EAAON,QAAQM,KAAK;QACpBL,YAAAA,EAAcA,YAAAA;QACdM,SAAAA,EAAU,aAAA;AACV,QAAA,QAAA,gBAAAL,GAAA,CAACM,KAAAA,EAAAA;YAAID,SAAAA,EAAU,qBAAA;AAAuBP,YAAAA,QAAAA,EAAAA,OAAAA,CAAQS;;AANzCT,KAAAA,EAAAA,OAAAA,CAAQS,IAAI,CAAA;AAS7B;;"}
@@ -0,0 +1,6 @@
1
+ export interface TourCamera {
2
+ x: number;
3
+ y: number;
4
+ zoom: number;
5
+ }
6
+ //# sourceMappingURL=TourCamera.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TourCamera.d.ts","sourceRoot":"","sources":["../../TourCamera.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,UAAU;IAEvB,CAAC,EAAE,MAAM,CAAC;IAGV,CAAC,EAAE,MAAM,CAAC;IAGV,IAAI,EAAE,MAAM,CAAC;CAChB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=TourCamera.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TourCamera.js","sourceRoot":"","sources":["../../TourCamera.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ import type { TourStep } from './TourStep.js';
2
+ export interface TourChapter<TStep extends TourStep = TourStep> {
3
+ id: string;
4
+ title: string;
5
+ summary: string;
6
+ steps: TStep[];
7
+ }
8
+ //# sourceMappingURL=TourChapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TourChapter.d.ts","sourceRoot":"","sources":["../../TourChapter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAQ9C,MAAM,WAAW,WAAW,CAAC,KAAK,SAAS,QAAQ,GAAG,QAAQ;IAE1D,EAAE,EAAE,MAAM,CAAC;IAGX,KAAK,EAAE,MAAM,CAAC;IAGd,OAAO,EAAE,MAAM,CAAC;IAGhB,KAAK,EAAE,KAAK,EAAE,CAAC;CAClB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=TourChapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TourChapter.js","sourceRoot":"","sources":["../../TourChapter.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import type { TimedTourChapter, TimedTourSection } from './tourTimeline.js';
2
+ export interface TourChapterListProps {
3
+ sections: TimedTourSection[];
4
+ chapters: TimedTourChapter[];
5
+ currentChapterIndex: number;
6
+ onSelectChapter: (chapterIndex: number) => void;
7
+ showTimings?: boolean;
8
+ }
9
+ export declare const TourChapterList: ({ sections, chapters, currentChapterIndex, onSelectChapter, showTimings }: TourChapterListProps) => import("react").JSX.Element;
10
+ //# sourceMappingURL=TourChapterList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TourChapterList.d.ts","sourceRoot":"","sources":["../../TourChapterList.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAG5E,MAAM,WAAW,oBAAoB;IAEjC,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAG7B,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAG7B,mBAAmB,EAAE,MAAM,CAAC;IAG5B,eAAe,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAMhD,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAOD,eAAO,MAAM,eAAe,GAAI,2EAAkF,oBAAoB,gCAgCrI,CAAC"}
@@ -0,0 +1,66 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { useCueConfiguration } from './Configuration/CueProvider.js';
3
+ import { formatTourTime } from './tourTimeline.js';
4
+
5
+ /**
6
+ * The tour's table of contents: the sections as headings, their chapters under them, where the viewer is in
7
+ * it all, and a way to skip straight to any part of it. Chapter indices stay global across sections — the
8
+ * clock is flat, sections only group the listing.
9
+ */ const TourChapterList = ({ sections, chapters, currentChapterIndex, onSelectChapter, showTimings = true })=>{
10
+ const { labels } = useCueConfiguration();
11
+ return /*#__PURE__*/ jsxs("aside", {
12
+ className: "cue-chapters",
13
+ children: [
14
+ /*#__PURE__*/ jsx("h2", {
15
+ className: "cue-chapters__heading",
16
+ children: labels.chapters
17
+ }),
18
+ /*#__PURE__*/ jsx("div", {
19
+ className: "cue-chapters__sections",
20
+ children: sections.map((timedSection, sectionIndex)=>/*#__PURE__*/ jsxs("section", {
21
+ children: [
22
+ /*#__PURE__*/ jsx("h3", {
23
+ className: "cue-chapters__section-title",
24
+ children: timedSection.section.title
25
+ }),
26
+ /*#__PURE__*/ jsx("ol", {
27
+ className: "cue-chapters__list",
28
+ children: chapters.map((timed, chapterIndex)=>({
29
+ timed,
30
+ chapterIndex
31
+ })).filter(({ timed })=>timed.sectionIndex === sectionIndex).map(({ timed, chapterIndex })=>/*#__PURE__*/ jsx("li", {
32
+ children: /*#__PURE__*/ jsxs("button", {
33
+ type: "button",
34
+ className: `cue-chapters__item${chapterIndex === currentChapterIndex ? ' cue-chapters__item--current' : ''}`,
35
+ onClick: ()=>onSelectChapter(chapterIndex),
36
+ children: [
37
+ showTimings && /*#__PURE__*/ jsx("span", {
38
+ className: "cue-chapters__time",
39
+ children: formatTourTime(timed.startMs)
40
+ }),
41
+ /*#__PURE__*/ jsxs("span", {
42
+ className: "cue-chapters__text",
43
+ children: [
44
+ /*#__PURE__*/ jsx("span", {
45
+ className: "cue-chapters__title",
46
+ children: timed.chapter.title
47
+ }),
48
+ /*#__PURE__*/ jsx("span", {
49
+ className: "cue-chapters__summary",
50
+ children: timed.chapter.summary
51
+ })
52
+ ]
53
+ })
54
+ ]
55
+ })
56
+ }, timed.chapter.id))
57
+ })
58
+ ]
59
+ }, timedSection.section.id))
60
+ })
61
+ ]
62
+ });
63
+ };
64
+
65
+ export { TourChapterList };
66
+ //# sourceMappingURL=TourChapterList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TourChapterList.js","sources":["../../TourChapterList.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useCueConfiguration } from './Configuration/CueProvider.js';\nimport type { TimedTourChapter, TimedTourSection } from './tourTimeline.js';\nimport { formatTourTime } from './tourTimeline.js';\n\nexport interface TourChapterListProps {\n /** The sections, already placed on the tour's clock. */\n sections: TimedTourSection[];\n\n /** The chapters across all sections in play order, already placed on the tour's clock. */\n chapters: TimedTourChapter[];\n\n /** Which chapter is playing, as an index into {@link chapters}. */\n currentChapterIndex: number;\n\n /** Jumps to the start of a chapter, by its index into {@link chapters}. */\n onSelectChapter: (chapterIndex: number) => void;\n\n /**\n * Whether to show where on the clock each chapter starts. On by default; self-paced reading switches it\n * off, because there is no clock to time against when nobody is playing.\n */\n showTimings?: boolean;\n}\n\n/**\n * The tour's table of contents: the sections as headings, their chapters under them, where the viewer is in\n * it all, and a way to skip straight to any part of it. Chapter indices stay global across sections — the\n * clock is flat, sections only group the listing.\n */\nexport const TourChapterList = ({ sections, chapters, currentChapterIndex, onSelectChapter, showTimings = true }: TourChapterListProps) => {\n const { labels } = useCueConfiguration();\n return (\n <aside className='cue-chapters'>\n <h2 className='cue-chapters__heading'>{labels.chapters}</h2>\n <div className='cue-chapters__sections'>\n {sections.map((timedSection, sectionIndex) => (\n <section key={timedSection.section.id}>\n <h3 className='cue-chapters__section-title'>{timedSection.section.title}</h3>\n <ol className='cue-chapters__list'>\n {chapters.map((timed, chapterIndex) => ({ timed, chapterIndex }))\n .filter(({ timed }) => timed.sectionIndex === sectionIndex)\n .map(({ timed, chapterIndex }) => (\n <li key={timed.chapter.id}>\n <button\n type='button'\n className={`cue-chapters__item${chapterIndex === currentChapterIndex ? ' cue-chapters__item--current' : ''}`}\n onClick={() => onSelectChapter(chapterIndex)}>\n {showTimings && <span className='cue-chapters__time'>{formatTourTime(timed.startMs)}</span>}\n <span className='cue-chapters__text'>\n <span className='cue-chapters__title'>{timed.chapter.title}</span>\n <span className='cue-chapters__summary'>{timed.chapter.summary}</span>\n </span>\n </button>\n </li>\n ))}\n </ol>\n </section>\n ))}\n </div>\n </aside>\n );\n};\n"],"names":["TourChapterList","sections","chapters","currentChapterIndex","onSelectChapter","showTimings","labels","useCueConfiguration","_jsxs","aside","className","_jsx","h2","div","map","timedSection","sectionIndex","section","h3","title","ol","timed","chapterIndex","filter","li","button","type","onClick","span","formatTourTime","startMs","chapter","summary","id"],"mappings":";;;;AA2BA;;;;AAIC,IACM,MAAMA,eAAAA,GAAkB,CAAC,EAAEC,QAAQ,EAAEC,QAAQ,EAAEC,mBAAmB,EAAEC,eAAe,EAAEC,WAAAA,GAAc,IAAI,EAAwB,GAAA;IAClI,MAAM,EAAEC,MAAM,EAAE,GAAGC,mBAAAA,EAAAA;AACnB,IAAA,qBACIC,IAAA,CAACC,OAAAA,EAAAA;QAAMC,SAAAA,EAAU,cAAA;;0BACbC,GAAA,CAACC,IAAAA,EAAAA;gBAAGF,SAAAA,EAAU,uBAAA;AAAyBJ,gBAAAA,QAAAA,EAAAA,MAAAA,CAAOJ;;0BAC9CS,GAAA,CAACE,KAAAA,EAAAA;gBAAIH,SAAAA,EAAU,wBAAA;AACVT,gBAAAA,QAAAA,EAAAA,QAAAA,CAASa,GAAG,CAAC,CAACC,YAAAA,EAAcC,6BACzBR,IAAA,CAACS,SAAAA,EAAAA;;0CACGN,GAAA,CAACO,IAAAA,EAAAA;gCAAGR,SAAAA,EAAU,6BAAA;0CAA+BK,YAAAA,CAAaE,OAAO,CAACE;;0CAClER,GAAA,CAACS,IAAAA,EAAAA;gCAAGV,SAAAA,EAAU,oBAAA;AACTR,gCAAAA,QAAAA,EAAAA,QAAAA,CAASY,GAAG,CAAC,CAACO,KAAAA,EAAOC,gBAAkB;AAAED,wCAAAA,KAAAA;AAAOC,wCAAAA;qCAAa,CAAA,CAAA,CACzDC,MAAM,CAAC,CAAC,EAAEF,KAAK,EAAE,GAAKA,KAAAA,CAAML,YAAY,KAAKA,YAAAA,CAAAA,CAC7CF,GAAG,CAAC,CAAC,EAAEO,KAAK,EAAEC,YAAY,EAAE,iBACzBX,GAAA,CAACa,IAAAA,EAAAA;AACG,wCAAA,QAAA,gBAAAhB,IAAA,CAACiB,QAAAA,EAAAA;4CACGC,IAAAA,EAAK,QAAA;AACLhB,4CAAAA,SAAAA,EAAW,CAAC,kBAAkB,EAAEY,YAAAA,KAAiBnB,mBAAAA,GAAsB,iCAAiC,EAAA,CAAA,CAAI;AAC5GwB,4CAAAA,OAAAA,EAAS,IAAMvB,eAAAA,CAAgBkB,YAAAA,CAAAA;;AAC9BjB,gDAAAA,WAAAA,kBAAeM,GAAA,CAACiB,MAAAA,EAAAA;oDAAKlB,SAAAA,EAAU,oBAAA;AAAsBmB,oDAAAA,QAAAA,EAAAA,cAAAA,CAAeR,MAAMS,OAAO;;8DAClFtB,IAAA,CAACoB,MAAAA,EAAAA;oDAAKlB,SAAAA,EAAU,oBAAA;;sEACZC,GAAA,CAACiB,MAAAA,EAAAA;4DAAKlB,SAAAA,EAAU,qBAAA;sEAAuBW,KAAAA,CAAMU,OAAO,CAACZ;;sEACrDR,GAAA,CAACiB,MAAAA,EAAAA;4DAAKlB,SAAAA,EAAU,uBAAA;sEAAyBW,KAAAA,CAAMU,OAAO,CAACC;;;;;;uCAR1DX,KAAAA,CAAMU,OAAO,CAACE,EAAE,CAAA;;;uBAN3BlB,YAAAA,CAAaE,OAAO,CAACgB,EAAE,CAAA;;;;AAyBzD;;"}
@@ -0,0 +1,21 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ declare const meta: {
3
+ title: string;
4
+ component: ({ sections, chapters, currentChapterIndex, onSelectChapter, showTimings }: import("./TourChapterList.js").TourChapterListProps) => import("react").JSX.Element;
5
+ parameters: {
6
+ layout: string;
7
+ docs: {
8
+ description: {
9
+ component: string;
10
+ };
11
+ };
12
+ };
13
+ tags: string[];
14
+ };
15
+ export default meta;
16
+ type Story = StoryObj<typeof meta>;
17
+ export declare const Playground: Story;
18
+ export declare const AtTheBeginning: Story;
19
+ export declare const InALaterSection: Story;
20
+ export declare const WithoutTimings: Story;
21
+ //# sourceMappingURL=TourChapterList.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TourChapterList.stories.d.ts","sourceRoot":"","sources":["../../TourChapterList.stories.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AASvD,QAAA,MAAM,IAAI;;;;;;;;;;;;CAY8B,CAAC;AAEzC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAGnC,eAAO,MAAM,UAAU,EAAE,KAOxB,CAAC;AAGF,eAAO,MAAM,cAAc,EAAE,KAO5B,CAAC;AAGF,eAAO,MAAM,eAAe,EAAE,KAO7B,CAAC;AAGF,eAAO,MAAM,cAAc,EAAE,KAQ5B,CAAC"}
@@ -0,0 +1,53 @@
1
+ import { fn } from 'storybook/test';
2
+ import { sampleTour } from './given/sampleTour.js';
3
+ import { TourChapterList } from './TourChapterList.js';
4
+ import { buildTourTimeline } from './tourTimeline.js';
5
+ const timeline = buildTourTimeline(sampleTour);
6
+ const meta = {
7
+ title: 'Cue/TourChapterList',
8
+ component: TourChapterList,
9
+ parameters: {
10
+ layout: 'fullscreen',
11
+ docs: {
12
+ description: {
13
+ component: 'The guided tour\'s table of contents — sections as headings with their chapters under them — showing where the viewer is and letting them jump anywhere.',
14
+ },
15
+ },
16
+ },
17
+ tags: ['autodocs'],
18
+ };
19
+ export default meta;
20
+ export const Playground = {
21
+ args: {
22
+ sections: timeline.sections,
23
+ chapters: timeline.chapters,
24
+ currentChapterIndex: 2,
25
+ onSelectChapter: fn(),
26
+ },
27
+ };
28
+ export const AtTheBeginning = {
29
+ args: {
30
+ sections: timeline.sections,
31
+ chapters: timeline.chapters,
32
+ currentChapterIndex: 0,
33
+ onSelectChapter: fn(),
34
+ },
35
+ };
36
+ export const InALaterSection = {
37
+ args: {
38
+ sections: timeline.sections,
39
+ chapters: timeline.chapters,
40
+ currentChapterIndex: timeline.chapters.length - 1,
41
+ onSelectChapter: fn(),
42
+ },
43
+ };
44
+ export const WithoutTimings = {
45
+ args: {
46
+ sections: timeline.sections,
47
+ chapters: timeline.chapters,
48
+ currentChapterIndex: 2,
49
+ onSelectChapter: fn(),
50
+ showTimings: false,
51
+ },
52
+ };
53
+ //# sourceMappingURL=TourChapterList.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TourChapterList.stories.js","sourceRoot":"","sources":["../../TourChapterList.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,QAAQ,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAC;AAE/C,MAAM,IAAI,GAAG;IACT,KAAK,EAAE,qBAAqB;IAC5B,SAAS,EAAE,eAAe;IAC1B,UAAU,EAAE;QACR,MAAM,EAAE,YAAY;QACpB,IAAI,EAAE;YACF,WAAW,EAAE;gBACT,SAAS,EAAE,0JAA0J;aACxK;SACJ;KACJ;IACD,IAAI,EAAE,CAAC,UAAU,CAAC;CACkB,CAAC;AAEzC,eAAe,IAAI,CAAC;AAIpB,MAAM,CAAC,MAAM,UAAU,GAAU;IAC7B,IAAI,EAAE;QACF,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,mBAAmB,EAAE,CAAC;QACtB,eAAe,EAAE,EAAE,EAAE;KACxB;CACJ,CAAC;AAGF,MAAM,CAAC,MAAM,cAAc,GAAU;IACjC,IAAI,EAAE;QACF,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,mBAAmB,EAAE,CAAC;QACtB,eAAe,EAAE,EAAE,EAAE;KACxB;CACJ,CAAC;AAGF,MAAM,CAAC,MAAM,eAAe,GAAU;IAClC,IAAI,EAAE;QACF,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,mBAAmB,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC;QACjD,eAAe,EAAE,EAAE,EAAE;KACxB;CACJ,CAAC;AAGF,MAAM,CAAC,MAAM,cAAc,GAAU;IACjC,IAAI,EAAE;QACF,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,mBAAmB,EAAE,CAAC;QACtB,eAAe,EAAE,EAAE,EAAE;QACrB,WAAW,EAAE,KAAK;KACrB;CACJ,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { TourAnchorSpace } from './TourAnchorSpace.js';
2
+ export interface TourGesture {
3
+ x: number;
4
+ y: number;
5
+ clicks: boolean;
6
+ dragTo?: {
7
+ x: number;
8
+ y: number;
9
+ };
10
+ space?: TourAnchorSpace;
11
+ }
12
+ //# sourceMappingURL=TourGesture.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TourGesture.d.ts","sourceRoot":"","sources":["../../TourGesture.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAO5D,MAAM,WAAW,WAAW;IAExB,CAAC,EAAE,MAAM,CAAC;IAGV,CAAC,EAAE,MAAM,CAAC;IAGV,MAAM,EAAE,OAAO,CAAC;IAOhB,MAAM,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAGlC,KAAK,CAAC,EAAE,eAAe,CAAC;CAC3B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=TourGesture.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TourGesture.js","sourceRoot":"","sources":["../../TourGesture.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import type { TourSection } from './TourSection.js';
3
+ import type { TourStep } from './TourStep.js';
4
+ import { type TourSelfPacedContent } from './tourSelfPaced.js';
5
+ import { type TourPlayback } from './useTourPlayback.js';
6
+ export interface TourOverlayShellProps<TStep extends TourStep = TourStep> {
7
+ sections: TourSection<TStep>[];
8
+ selfPacedContent?: TourSelfPacedContent;
9
+ onClose: () => void;
10
+ children: (playback: TourPlayback<TStep>) => React.ReactNode;
11
+ }
12
+ export declare const TourOverlayShell: <TStep extends TourStep = TourStep>({ sections, selfPacedContent, onClose, children }: TourOverlayShellProps<TStep>) => React.JSX.Element;
13
+ //# sourceMappingURL=TourOverlayShell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TourOverlayShell.d.ts","sourceRoot":"","sources":["../../TourOverlayShell.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAK9C,OAAO,EAAE,KAAK,oBAAoB,EAAyC,MAAM,oBAAoB,CAAC;AACtG,OAAO,EAAE,KAAK,YAAY,EAAmB,MAAM,sBAAsB,CAAC;AAE1E,MAAM,WAAW,qBAAqB,CAAC,KAAK,SAAS,QAAQ,GAAG,QAAQ;IAEpE,QAAQ,EAAE,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;IAM/B,gBAAgB,CAAC,EAAE,oBAAoB,CAAC;IAGxC,OAAO,EAAE,MAAM,IAAI,CAAC;IAOpB,QAAQ,EAAE,CAAC,QAAQ,EAAE,YAAY,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;CAChE;AAeD,eAAO,MAAM,gBAAgB,GAAI,KAAK,SAAS,QAAQ,GAAG,QAAQ,EAAE,mDAAmD,qBAAqB,CAAC,KAAK,CAAC,sBAqDlJ,CAAC"}
@@ -0,0 +1,75 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { useState, useEffect } from 'react';
3
+ import { useCueConfiguration } from './Configuration/CueProvider.js';
4
+ import { TourChapterList } from './TourChapterList.js';
5
+ import { TourSelfPacedPanel } from './TourSelfPacedPanel.js';
6
+ import { TourSubtitles } from './TourSubtitles.js';
7
+ import { TourTimelineBar } from './TourTimelineBar.js';
8
+ import { selfPacedViewFor, hasSelfPacedContent } from './tourSelfPaced.js';
9
+ import { useTourPlayback } from './useTourPlayback.js';
10
+
11
+ /**
12
+ * The chrome every guided tour shares: the full-screen layer, the chapter list, the subtitles, the transport
13
+ * with its stop button, and the playback clock driving them all — parameterized by the tour's script and the
14
+ * stage it plays on. There is deliberately no header: a pill in the corner sat on top of whatever the tour
15
+ * was showing there, and everything it offered lives in the transport.
16
+ *
17
+ * The shell owns playback so a tour only brings its script and its stage. Escape stops the tour, exactly
18
+ * like the transport's stop button.
19
+ *
20
+ * A tour that also brings written chapters can be switched into self-paced reading from the transport: the
21
+ * clock and narration stop, the media controls dim, the chapter timings disappear, and the current chapter's
22
+ * walkthrough shows beside the chapter list — with the chapters themselves as the way to move around.
23
+ */ const TourOverlayShell = ({ sections, selfPacedContent, onClose, children })=>{
24
+ const playback = useTourPlayback(sections);
25
+ const { stageBoundary: StageBoundary } = useCueConfiguration();
26
+ const [isSelfPaced, setIsSelfPaced] = useState(false);
27
+ const currentChapter = playback.timeline.chapters[playback.chapterIndex]?.chapter;
28
+ const selfPaced = selfPacedViewFor(isSelfPaced, selfPacedContent, currentChapter?.id);
29
+ // Reading is silent: entering self-paced mode stops the clock, and the narration with it. Returning to
30
+ // narrated playback stays paused right where the reader is, until they press play themselves.
31
+ const handleToggleSelfPaced = ()=>{
32
+ if (!isSelfPaced) playback.pause();
33
+ setIsSelfPaced(!isSelfPaced);
34
+ };
35
+ useEffect(()=>{
36
+ const closeOnEscape = (event)=>{
37
+ if (event.key === 'Escape') onClose();
38
+ };
39
+ window.addEventListener('keydown', closeOnEscape);
40
+ return ()=>window.removeEventListener('keydown', closeOnEscape);
41
+ }, [
42
+ onClose
43
+ ]);
44
+ return /*#__PURE__*/ jsxs("div", {
45
+ className: "cue-overlay",
46
+ children: [
47
+ /*#__PURE__*/ jsx(StageBoundary, {
48
+ children: children(playback)
49
+ }),
50
+ selfPaced.isSelfPaced && currentChapter && /*#__PURE__*/ jsx(TourSelfPacedPanel, {
51
+ title: currentChapter.title,
52
+ markdown: selfPaced.markdown
53
+ }),
54
+ /*#__PURE__*/ jsx(TourChapterList, {
55
+ sections: playback.timeline.sections,
56
+ chapters: playback.timeline.chapters,
57
+ currentChapterIndex: playback.chapterIndex,
58
+ onSelectChapter: playback.goToChapter,
59
+ showTimings: selfPaced.areTimingsShown
60
+ }),
61
+ !selfPaced.isSelfPaced && playback.areSubtitlesEnabled && /*#__PURE__*/ jsx(TourSubtitles, {
62
+ narration: playback.step?.narration ?? ''
63
+ }),
64
+ /*#__PURE__*/ jsx(TourTimelineBar, {
65
+ playback: playback,
66
+ onStop: onClose,
67
+ isSelfPaced: selfPaced.isSelfPaced,
68
+ onToggleSelfPaced: hasSelfPacedContent(selfPacedContent) ? handleToggleSelfPaced : undefined
69
+ })
70
+ ]
71
+ });
72
+ };
73
+
74
+ export { TourOverlayShell };
75
+ //# sourceMappingURL=TourOverlayShell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TourOverlayShell.js","sources":["../../TourOverlayShell.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport React, { useEffect, useState } from 'react';\nimport { useCueConfiguration } from './Configuration/CueProvider.js';\nimport type { TourSection } from './TourSection.js';\nimport type { TourStep } from './TourStep.js';\nimport { TourChapterList } from './TourChapterList.js';\nimport { TourSelfPacedPanel } from './TourSelfPacedPanel.js';\nimport { TourSubtitles } from './TourSubtitles.js';\nimport { TourTimelineBar } from './TourTimelineBar.js';\nimport { type TourSelfPacedContent, hasSelfPacedContent, selfPacedViewFor } from './tourSelfPaced.js';\nimport { type TourPlayback, useTourPlayback } from './useTourPlayback.js';\n\nexport interface TourOverlayShellProps<TStep extends TourStep = TourStep> {\n /** The scripted sections the tour plays, in order. */\n sections: TourSection<TStep>[];\n\n /**\n * The written walkthrough of each chapter, keyed by chapter id, for anyone who would rather read the\n * tour at their own pace than listen to it. Omitted, the self-paced switch is not offered.\n */\n selfPacedContent?: TourSelfPacedContent;\n\n /** Closes the tour and hands the surface back. */\n onClose: () => void;\n\n /**\n * Renders the tour's stage — the surface the tour drives, such as a board rendered read-only — from the\n * live playback. Called on every playback render; a stage that is expensive to build should read what it\n * needs from the playback inside its own memoized component rather than rebuilding here.\n */\n children: (playback: TourPlayback<TStep>) => React.ReactNode;\n}\n\n/**\n * The chrome every guided tour shares: the full-screen layer, the chapter list, the subtitles, the transport\n * with its stop button, and the playback clock driving them all — parameterized by the tour's script and the\n * stage it plays on. There is deliberately no header: a pill in the corner sat on top of whatever the tour\n * was showing there, and everything it offered lives in the transport.\n *\n * The shell owns playback so a tour only brings its script and its stage. Escape stops the tour, exactly\n * like the transport's stop button.\n *\n * A tour that also brings written chapters can be switched into self-paced reading from the transport: the\n * clock and narration stop, the media controls dim, the chapter timings disappear, and the current chapter's\n * walkthrough shows beside the chapter list — with the chapters themselves as the way to move around.\n */\nexport const TourOverlayShell = <TStep extends TourStep = TourStep>({ sections, selfPacedContent, onClose, children }: TourOverlayShellProps<TStep>) => {\n const playback = useTourPlayback(sections);\n const { stageBoundary: StageBoundary } = useCueConfiguration();\n const [isSelfPaced, setIsSelfPaced] = useState(false);\n const currentChapter = playback.timeline.chapters[playback.chapterIndex]?.chapter;\n const selfPaced = selfPacedViewFor(isSelfPaced, selfPacedContent, currentChapter?.id);\n\n // Reading is silent: entering self-paced mode stops the clock, and the narration with it. Returning to\n // narrated playback stays paused right where the reader is, until they press play themselves.\n const handleToggleSelfPaced = () => {\n if (!isSelfPaced) playback.pause();\n setIsSelfPaced(!isSelfPaced);\n };\n\n useEffect(() => {\n const closeOnEscape = (event: KeyboardEvent) => {\n if (event.key === 'Escape') onClose();\n };\n\n window.addEventListener('keydown', closeOnEscape);\n return () => window.removeEventListener('keydown', closeOnEscape);\n }, [onClose]);\n\n return (\n <div className='cue-overlay'>\n {/* The stage is guarded on its own: a tour that cannot draw its board reports it, and the transport and chapter\n list stay up so the viewer can still stop it, pick another chapter or try again. */}\n <StageBoundary>\n {children(playback)}\n </StageBoundary>\n\n {selfPaced.isSelfPaced && currentChapter && (\n <TourSelfPacedPanel title={currentChapter.title} markdown={selfPaced.markdown} />\n )}\n\n <TourChapterList\n sections={playback.timeline.sections}\n chapters={playback.timeline.chapters}\n currentChapterIndex={playback.chapterIndex}\n onSelectChapter={playback.goToChapter}\n showTimings={selfPaced.areTimingsShown}\n />\n\n {!selfPaced.isSelfPaced && playback.areSubtitlesEnabled && <TourSubtitles narration={playback.step?.narration ?? ''} />}\n\n <TourTimelineBar\n playback={playback}\n onStop={onClose}\n isSelfPaced={selfPaced.isSelfPaced}\n onToggleSelfPaced={hasSelfPacedContent(selfPacedContent) ? handleToggleSelfPaced : undefined}\n />\n </div>\n );\n};\n"],"names":["TourOverlayShell","sections","selfPacedContent","onClose","children","playback","useTourPlayback","stageBoundary","StageBoundary","useCueConfiguration","isSelfPaced","setIsSelfPaced","useState","currentChapter","timeline","chapters","chapterIndex","chapter","selfPaced","selfPacedViewFor","id","handleToggleSelfPaced","pause","useEffect","closeOnEscape","event","key","window","addEventListener","removeEventListener","_jsxs","div","className","_jsx","TourSelfPacedPanel","title","markdown","TourChapterList","currentChapterIndex","onSelectChapter","goToChapter","showTimings","areTimingsShown","areSubtitlesEnabled","TourSubtitles","narration","step","TourTimelineBar","onStop","onToggleSelfPaced","hasSelfPacedContent","undefined"],"mappings":";;;;;;;;;;AAmCA;;;;;;;;;;;;AAYC,IACM,MAAMA,gBAAAA,GAAmB,CAAoC,EAAEC,QAAQ,EAAEC,gBAAgB,EAAEC,OAAO,EAAEC,QAAQ,EAAgC,GAAA;AAC/I,IAAA,MAAMC,WAAWC,eAAAA,CAAgBL,QAAAA,CAAAA;AACjC,IAAA,MAAM,EAAEM,aAAAA,EAAeC,aAAa,EAAE,GAAGC,mBAAAA,EAAAA;AACzC,IAAA,MAAM,CAACC,WAAAA,EAAaC,cAAAA,CAAe,GAAGC,QAAAA,CAAS,KAAA,CAAA;IAC/C,MAAMC,cAAAA,GAAiBR,SAASS,QAAQ,CAACC,QAAQ,CAACV,QAAAA,CAASW,YAAY,CAAC,EAAEC,OAAAA;AAC1E,IAAA,MAAMC,SAAAA,GAAYC,gBAAAA,CAAiBT,WAAAA,EAAaR,gBAAAA,EAAkBW,cAAAA,EAAgBO,EAAAA,CAAAA;;;AAIlF,IAAA,MAAMC,qBAAAA,GAAwB,IAAA;QAC1B,IAAI,CAACX,WAAAA,EAAaL,QAAAA,CAASiB,KAAK,EAAA;AAChCX,QAAAA,cAAAA,CAAe,CAACD,WAAAA,CAAAA;AACpB,IAAA,CAAA;IAEAa,SAAAA,CAAU,IAAA;AACN,QAAA,MAAMC,gBAAgB,CAACC,KAAAA,GAAAA;YACnB,IAAIA,KAAAA,CAAMC,GAAG,KAAK,QAAA,EAAUvB,OAAAA,EAAAA;AAChC,QAAA,CAAA;QAEAwB,MAAAA,CAAOC,gBAAgB,CAAC,SAAA,EAAWJ,aAAAA,CAAAA;AACnC,QAAA,OAAO,IAAMG,MAAAA,CAAOE,mBAAmB,CAAC,SAAA,EAAWL,aAAAA,CAAAA;IACvD,CAAA,EAAG;AAACrB,QAAAA;AAAQ,KAAA,CAAA;AAEZ,IAAA,qBACI2B,IAAA,CAACC,KAAAA,EAAAA;QAAIC,SAAAA,EAAU,aAAA;;0BAGXC,GAAA,CAACzB,aAAAA,EAAAA;0BACIJ,QAAAA,CAASC,QAAAA;;YAGba,SAAAA,CAAUR,WAAW,IAAIG,cAAAA,kBACtBoB,GAAA,CAACC,kBAAAA,EAAAA;AAAmBC,gBAAAA,KAAAA,EAAOtB,eAAesB,KAAK;AAAEC,gBAAAA,QAAAA,EAAUlB,UAAUkB;;0BAGzEH,GAAA,CAACI,eAAAA,EAAAA;gBACGpC,QAAAA,EAAUI,QAAAA,CAASS,QAAQ,CAACb,QAAQ;gBACpCc,QAAAA,EAAUV,QAAAA,CAASS,QAAQ,CAACC,QAAQ;AACpCuB,gBAAAA,mBAAAA,EAAqBjC,SAASW,YAAY;AAC1CuB,gBAAAA,eAAAA,EAAiBlC,SAASmC,WAAW;AACrCC,gBAAAA,WAAAA,EAAavB,UAAUwB;;AAG1B,YAAA,CAACxB,UAAUR,WAAW,IAAIL,QAAAA,CAASsC,mBAAmB,kBAAIV,GAAA,CAACW,aAAAA,EAAAA;gBAAcC,SAAAA,EAAWxC,QAAAA,CAASyC,IAAI,EAAED,SAAAA,IAAa;;0BAEjHZ,GAAA,CAACc,eAAAA,EAAAA;gBACG1C,QAAAA,EAAUA,QAAAA;gBACV2C,MAAAA,EAAQ7C,OAAAA;AACRO,gBAAAA,WAAAA,EAAaQ,UAAUR,WAAW;gBAClCuC,iBAAAA,EAAmBC,mBAAAA,CAAoBhD,oBAAoBmB,qBAAAA,GAAwB8B;;;;AAInG;;"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { BoardTransform } from './tourGeometry.js';
3
+ import type { TourGesture } from './TourGesture.js';
4
+ export interface TourPointerProps {
5
+ gesture: TourGesture | undefined;
6
+ transformRef: React.RefObject<BoardTransform>;
7
+ }
8
+ export declare const TourPointer: ({ gesture, transformRef }: TourPointerProps) => React.JSX.Element | null;
9
+ //# sourceMappingURL=TourPointer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TourPointer.d.ts","sourceRoot":"","sources":["../../TourPointer.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAgBpD,MAAM,WAAW,gBAAgB;IAE7B,OAAO,EAAE,WAAW,GAAG,SAAS,CAAC;IAGjC,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;CACjD;AAQD,eAAO,MAAM,WAAW,GAAI,2BAA2B,gBAAgB,6BA+CtE,CAAC"}
@@ -0,0 +1,72 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { useState, useEffect } from 'react';
3
+ import { TourAnchor } from './TourAnchor.js';
4
+ import { cursorSvg } from './cursorSvg.js';
5
+
6
+ /** How long the press ripple lasts. Must match the animation duration in the stylesheet. */ const PRESS_MS = 520;
7
+ /** How long the cursor takes to travel to whatever the narration has moved on to. */ const TRAVEL_MS = 850;
8
+ /** The pause between pressing down and starting to drag, so the press registers as its own beat. */ const DRAG_GRIP_MS = 250;
9
+ /** How long the held glide of a drag lasts before the pointer releases at its destination. */ const DRAG_MS = 1100;
10
+ /**
11
+ * The tour's stand-in for a mouse: an operating-system-style arrow cursor — white with a black outline, so it
12
+ * reads on any background — that glides to whatever the narration is talking about and presses when the
13
+ * script says it does. The SVG's arrow tip sits exactly on the anchored point, and the press scales the
14
+ * cursor down toward that tip, so what is being pressed never shifts.
15
+ */ const TourPointer = ({ gesture, transformRef })=>{
16
+ const [isPressing, setIsPressing] = useState(false);
17
+ const [dragPosition, setDragPosition] = useState(null);
18
+ useEffect(()=>{
19
+ setDragPosition(null);
20
+ if (gesture?.dragTo) {
21
+ // A drag is press-and-hold: the cursor arrives, grips, glides to the destination while held,
22
+ // and releases there — the same rhythm a real hand would have.
23
+ const destination = gesture.dragTo;
24
+ setIsPressing(false);
25
+ const timers = [
26
+ setTimeout(()=>setIsPressing(true), TRAVEL_MS),
27
+ setTimeout(()=>setDragPosition(destination), TRAVEL_MS + DRAG_GRIP_MS),
28
+ setTimeout(()=>setIsPressing(false), TRAVEL_MS + DRAG_GRIP_MS + DRAG_MS)
29
+ ];
30
+ return ()=>timers.forEach(clearTimeout);
31
+ }
32
+ if (!gesture?.clicks) return;
33
+ // The press lands once the cursor has arrived rather than the moment the step begins, so it reads as
34
+ // the pointer pressing the thing it traveled to. Restarting the class rather than leaving it on is
35
+ // what makes two presses in a row read as two presses instead of one long one.
36
+ setIsPressing(false);
37
+ const start = setTimeout(()=>setIsPressing(true), TRAVEL_MS);
38
+ const end = setTimeout(()=>setIsPressing(false), TRAVEL_MS + PRESS_MS);
39
+ return ()=>{
40
+ clearTimeout(start);
41
+ clearTimeout(end);
42
+ };
43
+ }, [
44
+ gesture
45
+ ]);
46
+ if (!gesture) return null;
47
+ return /*#__PURE__*/ jsx(TourAnchor, {
48
+ x: dragPosition?.x ?? gesture.x,
49
+ y: dragPosition?.y ?? gesture.y,
50
+ space: gesture.space,
51
+ transformRef: transformRef,
52
+ glideMs: TRAVEL_MS,
53
+ className: "cue-pointer",
54
+ children: /*#__PURE__*/ jsxs("div", {
55
+ className: `cue-pointer__cursor${isPressing ? ' cue-pointer__cursor--pressing' : ''}`,
56
+ children: [
57
+ /*#__PURE__*/ jsx("span", {
58
+ className: "cue-pointer__ripple"
59
+ }),
60
+ /*#__PURE__*/ jsx("span", {
61
+ className: "cue-pointer__arrow",
62
+ dangerouslySetInnerHTML: {
63
+ __html: cursorSvg
64
+ }
65
+ })
66
+ ]
67
+ })
68
+ });
69
+ };
70
+
71
+ export { TourPointer };
72
+ //# sourceMappingURL=TourPointer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TourPointer.js","sources":["../../TourPointer.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport React, { useEffect, useState } from 'react';\nimport type { BoardTransform } from './tourGeometry.js';\nimport type { TourGesture } from './TourGesture.js';\nimport { TourAnchor } from './TourAnchor.js';\nimport { cursorSvg } from './cursorSvg.js';\n\n/** How long the press ripple lasts. Must match the animation duration in the stylesheet. */\nconst PRESS_MS = 520;\n\n/** How long the cursor takes to travel to whatever the narration has moved on to. */\nconst TRAVEL_MS = 850;\n\n/** The pause between pressing down and starting to drag, so the press registers as its own beat. */\nconst DRAG_GRIP_MS = 250;\n\n/** How long the held glide of a drag lasts before the pointer releases at its destination. */\nconst DRAG_MS = 1100;\n\nexport interface TourPointerProps {\n /** Where the pointer is going, or undefined before the tour has pointed at anything. */\n gesture: TourGesture | undefined;\n\n /** The board's live pan and zoom. */\n transformRef: React.RefObject<BoardTransform>;\n}\n\n/**\n * The tour's stand-in for a mouse: an operating-system-style arrow cursor — white with a black outline, so it\n * reads on any background — that glides to whatever the narration is talking about and presses when the\n * script says it does. The SVG's arrow tip sits exactly on the anchored point, and the press scales the\n * cursor down toward that tip, so what is being pressed never shifts.\n */\nexport const TourPointer = ({ gesture, transformRef }: TourPointerProps) => {\n const [isPressing, setIsPressing] = useState(false);\n const [dragPosition, setDragPosition] = useState<{ x: number; y: number } | null>(null);\n\n useEffect(() => {\n setDragPosition(null);\n\n if (gesture?.dragTo) {\n // A drag is press-and-hold: the cursor arrives, grips, glides to the destination while held,\n // and releases there — the same rhythm a real hand would have.\n const destination = gesture.dragTo;\n setIsPressing(false);\n const timers = [\n setTimeout(() => setIsPressing(true), TRAVEL_MS),\n setTimeout(() => setDragPosition(destination), TRAVEL_MS + DRAG_GRIP_MS),\n setTimeout(() => setIsPressing(false), TRAVEL_MS + DRAG_GRIP_MS + DRAG_MS),\n ];\n return () => timers.forEach(clearTimeout);\n }\n\n if (!gesture?.clicks) return;\n\n // The press lands once the cursor has arrived rather than the moment the step begins, so it reads as\n // the pointer pressing the thing it traveled to. Restarting the class rather than leaving it on is\n // what makes two presses in a row read as two presses instead of one long one.\n setIsPressing(false);\n const start = setTimeout(() => setIsPressing(true), TRAVEL_MS);\n const end = setTimeout(() => setIsPressing(false), TRAVEL_MS + PRESS_MS);\n return () => { clearTimeout(start); clearTimeout(end); };\n }, [gesture]);\n\n if (!gesture) return null;\n\n return (\n <TourAnchor\n x={dragPosition?.x ?? gesture.x}\n y={dragPosition?.y ?? gesture.y}\n space={gesture.space}\n transformRef={transformRef}\n glideMs={TRAVEL_MS}\n className='cue-pointer'>\n <div className={`cue-pointer__cursor${isPressing ? ' cue-pointer__cursor--pressing' : ''}`}>\n <span className='cue-pointer__ripple' />\n <span className='cue-pointer__arrow' dangerouslySetInnerHTML={{ __html: cursorSvg }} />\n </div>\n </TourAnchor>\n );\n};\n"],"names":["PRESS_MS","TRAVEL_MS","DRAG_GRIP_MS","DRAG_MS","TourPointer","gesture","transformRef","isPressing","setIsPressing","useState","dragPosition","setDragPosition","useEffect","dragTo","destination","timers","setTimeout","forEach","clearTimeout","clicks","start","end","_jsx","TourAnchor","x","y","space","glideMs","className","_jsxs","div","span","dangerouslySetInnerHTML","__html","cursorSvg"],"mappings":";;;;;AASA,6FACA,MAAMA,QAAAA,GAAW,GAAA;AAEjB,sFACA,MAAMC,SAAAA,GAAY,GAAA;AAElB,qGACA,MAAMC,YAAAA,GAAe,GAAA;AAErB,+FACA,MAAMC,OAAAA,GAAU,IAAA;AAUhB;;;;;UAMaC,WAAAA,GAAc,CAAC,EAAEC,OAAO,EAAEC,YAAY,EAAoB,GAAA;AACnE,IAAA,MAAM,CAACC,UAAAA,EAAYC,aAAAA,CAAc,GAAGC,QAAAA,CAAS,KAAA,CAAA;AAC7C,IAAA,MAAM,CAACC,YAAAA,EAAcC,eAAAA,CAAgB,GAAGF,QAAAA,CAA0C,IAAA,CAAA;IAElFG,SAAAA,CAAU,IAAA;QACND,eAAAA,CAAgB,IAAA,CAAA;AAEhB,QAAA,IAAIN,SAASQ,MAAAA,EAAQ;;;YAGjB,MAAMC,WAAAA,GAAcT,QAAQQ,MAAM;YAClCL,aAAAA,CAAc,KAAA,CAAA;AACd,YAAA,MAAMO,MAAAA,GAAS;gBACXC,UAAAA,CAAW,IAAMR,cAAc,IAAA,CAAA,EAAOP,SAAAA,CAAAA;gBACtCe,UAAAA,CAAW,IAAML,eAAAA,CAAgBG,WAAAA,CAAAA,EAAcb,SAAAA,GAAYC,YAAAA,CAAAA;AAC3Dc,gBAAAA,UAAAA,CAAW,IAAMR,aAAAA,CAAc,KAAA,CAAA,EAAQP,SAAAA,GAAYC,YAAAA,GAAeC,OAAAA;AACrE,aAAA;YACD,OAAO,IAAMY,MAAAA,CAAOE,OAAO,CAACC,YAAAA,CAAAA;AAChC,QAAA;QAEA,IAAI,CAACb,SAASc,MAAAA,EAAQ;;;;QAKtBX,aAAAA,CAAc,KAAA,CAAA;AACd,QAAA,MAAMY,KAAAA,GAAQJ,UAAAA,CAAW,IAAMR,aAAAA,CAAc,IAAA,CAAA,EAAOP,SAAAA,CAAAA;AACpD,QAAA,MAAMoB,GAAAA,GAAML,UAAAA,CAAW,IAAMR,aAAAA,CAAc,QAAQP,SAAAA,GAAYD,QAAAA,CAAAA;QAC/D,OAAO,IAAA;YAAQkB,YAAAA,CAAaE,KAAAA,CAAAA;YAAQF,YAAAA,CAAaG,GAAAA,CAAAA;AAAM,QAAA,CAAA;IAC3D,CAAA,EAAG;AAAChB,QAAAA;AAAQ,KAAA,CAAA;IAEZ,IAAI,CAACA,SAAS,OAAO,IAAA;AAErB,IAAA,qBACIiB,GAAA,CAACC,UAAAA,EAAAA;QACGC,CAAAA,EAAGd,YAAAA,EAAcc,CAAAA,IAAKnB,OAAAA,CAAQmB,CAAC;QAC/BC,CAAAA,EAAGf,YAAAA,EAAce,CAAAA,IAAKpB,OAAAA,CAAQoB,CAAC;AAC/BC,QAAAA,KAAAA,EAAOrB,QAAQqB,KAAK;QACpBpB,YAAAA,EAAcA,YAAAA;QACdqB,OAAAA,EAAS1B,SAAAA;QACT2B,SAAAA,EAAU,aAAA;AACV,QAAA,QAAA,gBAAAC,IAAA,CAACC,KAAAA,EAAAA;AAAIF,YAAAA,SAAAA,EAAW,CAAC,mBAAmB,EAAErB,UAAAA,GAAa,mCAAmC,EAAA,CAAA,CAAI;;8BACtFe,GAAA,CAACS,MAAAA,EAAAA;oBAAKH,SAAAA,EAAU;;8BAChBN,GAAA,CAACS,MAAAA,EAAAA;oBAAKH,SAAAA,EAAU,oBAAA;oBAAqBI,uBAAAA,EAAyB;wBAAEC,MAAAA,EAAQC;AAAU;;;;;AAIlG;;"}
@@ -0,0 +1,8 @@
1
+ import type { TourChapter } from './TourChapter.js';
2
+ import type { TourStep } from './TourStep.js';
3
+ export interface TourSection<TStep extends TourStep = TourStep> {
4
+ id: string;
5
+ title: string;
6
+ chapters: TourChapter<TStep>[];
7
+ }
8
+ //# sourceMappingURL=TourSection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TourSection.d.ts","sourceRoot":"","sources":["../../TourSection.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAU9C,MAAM,WAAW,WAAW,CAAC,KAAK,SAAS,QAAQ,GAAG,QAAQ;IAE1D,EAAE,EAAE,MAAM,CAAC;IAGX,KAAK,EAAE,MAAM,CAAC;IAGd,QAAQ,EAAE,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;CAClC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=TourSection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TourSection.js","sourceRoot":"","sources":["../../TourSection.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ export interface TourSelfPacedPanelProps {
2
+ title: string;
3
+ markdown: string;
4
+ }
5
+ export declare const TourSelfPacedPanel: ({ title, markdown }: TourSelfPacedPanelProps) => import("react").JSX.Element;
6
+ //# sourceMappingURL=TourSelfPacedPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TourSelfPacedPanel.d.ts","sourceRoot":"","sources":["../../TourSelfPacedPanel.tsx"],"names":[],"mappings":"AAKA,MAAM,WAAW,uBAAuB;IAEpC,KAAK,EAAE,MAAM,CAAC;IAGd,QAAQ,EAAE,MAAM,CAAC;CACpB;AAOD,eAAO,MAAM,kBAAkB,GAAI,qBAAqB,uBAAuB,gCAO9E,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { CueMarkdown } from './Markdown/CueMarkdown.js';
3
+
4
+ /**
5
+ * The self-paced reading panel: the current chapter's written walkthrough, docked beside the chapter list so
6
+ * reading and navigating sit next to each other. It renders the tour's own authored markdown — screenshots
7
+ * and animations included — and scrolls on its own, since a written chapter is longer than its narration.
8
+ */ const TourSelfPacedPanel = ({ title, markdown })=>/*#__PURE__*/ jsxs("aside", {
9
+ className: "cue-self-paced",
10
+ children: [
11
+ /*#__PURE__*/ jsx("h2", {
12
+ className: "cue-self-paced__title",
13
+ children: title
14
+ }),
15
+ /*#__PURE__*/ jsx("div", {
16
+ className: "cue-self-paced__content",
17
+ children: /*#__PURE__*/ jsx(CueMarkdown, {
18
+ source: markdown
19
+ })
20
+ })
21
+ ]
22
+ });
23
+
24
+ export { TourSelfPacedPanel };
25
+ //# sourceMappingURL=TourSelfPacedPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TourSelfPacedPanel.js","sources":["../../TourSelfPacedPanel.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { CueMarkdown } from './Markdown/CueMarkdown.js';\n\nexport interface TourSelfPacedPanelProps {\n /** The title of the chapter being read. */\n title: string;\n\n /** The chapter's markdown walkthrough. */\n markdown: string;\n}\n\n/**\n * The self-paced reading panel: the current chapter's written walkthrough, docked beside the chapter list so\n * reading and navigating sit next to each other. It renders the tour's own authored markdown — screenshots\n * and animations included — and scrolls on its own, since a written chapter is longer than its narration.\n */\nexport const TourSelfPacedPanel = ({ title, markdown }: TourSelfPacedPanelProps) => (\n <aside className='cue-self-paced'>\n <h2 className='cue-self-paced__title'>{title}</h2>\n <div className='cue-self-paced__content'>\n <CueMarkdown source={markdown} />\n </div>\n </aside>\n);\n"],"names":["TourSelfPacedPanel","title","markdown","_jsxs","aside","className","_jsx","h2","div","CueMarkdown","source"],"mappings":";;;AAaA;;;;IAKO,MAAMA,kBAAAA,GAAqB,CAAC,EAAEC,KAAK,EAAEC,QAAQ,EAA2B,iBAC3EC,IAAA,CAACC,OAAAA,EAAAA;QAAMC,SAAAA,EAAU,gBAAA;;0BACbC,GAAA,CAACC,IAAAA,EAAAA;gBAAGF,SAAAA,EAAU,uBAAA;AAAyBJ,gBAAAA,QAAAA,EAAAA;;0BACvCK,GAAA,CAACE,KAAAA,EAAAA;gBAAIH,SAAAA,EAAU,yBAAA;AACX,gBAAA,QAAA,gBAAAC,GAAA,CAACG,WAAAA,EAAAA;oBAAYC,MAAAA,EAAQR;;;;AAG/B,KAAA;;"}
@@ -0,0 +1,21 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ declare const meta: {
3
+ title: string;
4
+ component: ({ title, markdown }: import("./TourSelfPacedPanel.js").TourSelfPacedPanelProps) => import("react").JSX.Element;
5
+ parameters: {
6
+ layout: string;
7
+ docs: {
8
+ description: {
9
+ component: string;
10
+ };
11
+ };
12
+ };
13
+ tags: string[];
14
+ };
15
+ export default meta;
16
+ type Story = StoryObj<typeof meta>;
17
+ export declare const Playground: Story;
18
+ export declare const WithSteps: Story;
19
+ export declare const WithALink: Story;
20
+ export declare const WithCode: Story;
21
+ //# sourceMappingURL=TourSelfPacedPanel.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TourSelfPacedPanel.stories.d.ts","sourceRoot":"","sources":["../../TourSelfPacedPanel.stories.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAKvD,QAAA,MAAM,IAAI;;;;;;;;;;;;CAYiC,CAAC;AAE5C,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAGnC,eAAO,MAAM,UAAU,EAAE,KAKxB,CAAC;AAGF,eAAO,MAAM,SAAS,EAAE,KAKvB,CAAC;AAGF,eAAO,MAAM,SAAS,EAAE,KAKvB,CAAC;AAGF,eAAO,MAAM,QAAQ,EAAE,KAKtB,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { sampleContent } from './given/sampleTour.js';
2
+ import { TourSelfPacedPanel } from './TourSelfPacedPanel.js';
3
+ const meta = {
4
+ title: 'Cue/TourSelfPacedPanel',
5
+ component: TourSelfPacedPanel,
6
+ parameters: {
7
+ layout: 'fullscreen',
8
+ docs: {
9
+ description: {
10
+ component: 'The self-paced reading panel: the current chapter\'s written walkthrough, docked beside the chapter list when the tour is switched out of narrated playback.',
11
+ },
12
+ },
13
+ },
14
+ tags: ['autodocs'],
15
+ };
16
+ export default meta;
17
+ export const Playground = {
18
+ args: {
19
+ title: 'The desk',
20
+ markdown: sampleContent['the-desk'],
21
+ },
22
+ };
23
+ export const WithSteps = {
24
+ args: {
25
+ title: 'Picking',
26
+ markdown: sampleContent['picking'],
27
+ },
28
+ };
29
+ export const WithALink = {
30
+ args: {
31
+ title: 'The cards',
32
+ markdown: sampleContent['the-cards'],
33
+ },
34
+ };
35
+ export const WithCode = {
36
+ args: {
37
+ title: 'Shipping',
38
+ markdown: sampleContent['shipping'],
39
+ },
40
+ };
41
+ //# sourceMappingURL=TourSelfPacedPanel.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TourSelfPacedPanel.stories.js","sourceRoot":"","sources":["../../TourSelfPacedPanel.stories.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,MAAM,IAAI,GAAG;IACT,KAAK,EAAE,wBAAwB;IAC/B,SAAS,EAAE,kBAAkB;IAC7B,UAAU,EAAE;QACR,MAAM,EAAE,YAAY;QACpB,IAAI,EAAE;YACF,WAAW,EAAE;gBACT,SAAS,EAAE,8JAA8J;aAC5K;SACJ;KACJ;IACD,IAAI,EAAE,CAAC,UAAU,CAAC;CACqB,CAAC;AAE5C,eAAe,IAAI,CAAC;AAIpB,MAAM,CAAC,MAAM,UAAU,GAAU;IAC7B,IAAI,EAAE;QACF,KAAK,EAAE,UAAU;QACjB,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC;KACtC;CACJ,CAAC;AAGF,MAAM,CAAC,MAAM,SAAS,GAAU;IAC5B,IAAI,EAAE;QACF,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,aAAa,CAAC,SAAS,CAAC;KACrC;CACJ,CAAC;AAGF,MAAM,CAAC,MAAM,SAAS,GAAU;IAC5B,IAAI,EAAE;QACF,KAAK,EAAE,WAAW;QAClB,QAAQ,EAAE,aAAa,CAAC,WAAW,CAAC;KACvC;CACJ,CAAC;AAGF,MAAM,CAAC,MAAM,QAAQ,GAAU;IAC3B,IAAI,EAAE;QACF,KAAK,EAAE,UAAU;QACjB,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC;KACtC;CACJ,CAAC"}