@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,14 @@
1
+ import React from 'react';
2
+ import type { TourAnchorSpace } from './TourAnchorSpace.js';
3
+ import { type BoardTransform } from './tourGeometry.js';
4
+ export interface TourAnchorProps {
5
+ x: number;
6
+ y: number;
7
+ space?: TourAnchorSpace;
8
+ transformRef: React.RefObject<BoardTransform>;
9
+ glideMs?: number;
10
+ className?: string;
11
+ children: React.ReactNode;
12
+ }
13
+ export declare const TourAnchor: ({ x, y, space, transformRef, glideMs, className, children }: TourAnchorProps) => React.JSX.Element;
14
+ //# sourceMappingURL=TourAnchor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TourAnchor.d.ts","sourceRoot":"","sources":["../../TourAnchor.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAElE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,KAAK,cAAc,EAA8F,MAAM,mBAAmB,CAAC;AAkBpJ,MAAM,WAAW,eAAe;IAE5B,CAAC,EAAE,MAAM,CAAC;IAGV,CAAC,EAAE,MAAM,CAAC;IAGV,KAAK,CAAC,EAAE,eAAe,CAAC;IAGxB,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAO9C,OAAO,CAAC,EAAE,MAAM,CAAC;IAGjB,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAeD,eAAO,MAAM,UAAU,GAAI,6DAA2E,eAAe,sBAiGpH,CAAC"}
@@ -0,0 +1,150 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var react = require('react');
5
+ var Canvas = require('@cratis/components/Canvas');
6
+ var tourGeometry = require('./tourGeometry.js');
7
+
8
+ /**
9
+ * Where a target currently sits on screen, whatever space it is expressed in. Editor-space targets project
10
+ * against the live viewport size, so the anchor keeps sitting on its spot in the panel through a resize.
11
+ */ function projectTarget(target, transform) {
12
+ switch(target.space){
13
+ case 'world':
14
+ return tourGeometry.projectToScreen(target.x, target.y, transform);
15
+ case 'editor':
16
+ return tourGeometry.projectEditorPointToScreen(target.x, target.y, window.innerWidth, window.innerHeight);
17
+ case 'toolbar':
18
+ return tourGeometry.projectToolbarPointToScreen(target.x, target.y, window.innerHeight);
19
+ case 'screen':
20
+ return {
21
+ x: target.x,
22
+ y: target.y
23
+ };
24
+ }
25
+ }
26
+ // How close, in screen pixels, a glide has to get before it counts as arrived and the loop suspends.
27
+ const GLIDE_SETTLE_DISTANCE = 0.5;
28
+ /**
29
+ * Holds its children at a place on the board — or on the tour's own chrome — and, when asked, takes its time
30
+ * getting to a new one.
31
+ *
32
+ * The travel is eased in screen space, against where the target currently sits on screen, rather than in
33
+ * board space. This is what keeps the pointer's movement its own: while the camera pans, a board-space glide
34
+ * would compose with the camera and sweep the pointer across the screen, whereas the screen-space easing lets
35
+ * it drift calmly after its target no matter what the camera is doing underneath.
36
+ *
37
+ * The position is written straight to the DOM on every animation frame rather than held in React state: the
38
+ * camera glides for the best part of a second on every step, and re-rendering the tour's overlay at frame
39
+ * rate for the whole of it would compete with the board's own per-frame transform writes.
40
+ */ const TourAnchor = ({ x, y, space = 'world', transformRef, glideMs = 0, className, children })=>{
41
+ const anchorRef = react.useRef(null);
42
+ const targetRef = react.useRef({
43
+ x,
44
+ y,
45
+ space
46
+ });
47
+ const currentRef = react.useRef(null);
48
+ targetRef.current = {
49
+ x,
50
+ y,
51
+ space
52
+ };
53
+ // The follower below only places the element from the first animation frame on — without this, the
54
+ // element would be visible at the board's top-left corner for the frames before that, which is exactly
55
+ // where a freshly appeared callout was seen flashing. Place it where it belongs before the first paint.
56
+ react.useLayoutEffect(()=>{
57
+ const anchor = anchorRef.current;
58
+ if (!anchor) return;
59
+ const target = targetRef.current;
60
+ const onScreen = projectTarget(target, transformRef.current);
61
+ currentRef.current = onScreen;
62
+ anchor.style.transform = `translate3d(${onScreen.x}px, ${onScreen.y}px, 0)`;
63
+ // Mount-only by design: every later placement belongs to the follower.
64
+ }, []);
65
+ // The follower runs as a self-suspending loop rather than a permanent per-frame one: it glides while there is travel left, then stops, and wakes again whenever
66
+ // the camera applies a transform frame, the window resizes (editor/toolbar spaces project against
67
+ // the viewport), or the target itself moves to a new spot.
68
+ const previousRef = react.useRef(performance.now());
69
+ const step = (now)=>{
70
+ const elapsed = now - previousRef.current;
71
+ previousRef.current = now;
72
+ const target = targetRef.current;
73
+ const onScreen = projectTarget(target, transformRef.current);
74
+ // Exponential easing toward the target's current screen position, so the travel is smooth at any
75
+ // frame rate and settles rather than arriving abruptly. The first placement is not traveled to —
76
+ // there is nowhere to have come from.
77
+ const current = currentRef.current;
78
+ let traveling = false;
79
+ if (current === null || glideMs <= 0) {
80
+ currentRef.current = onScreen;
81
+ } else {
82
+ const factor = 1 - Math.exp(-elapsed / (glideMs / 3));
83
+ const next = {
84
+ x: current.x + (onScreen.x - current.x) * factor,
85
+ y: current.y + (onScreen.y - current.y) * factor
86
+ };
87
+ // Within a hair of the target the glide has visually arrived — rest exactly on it so the
88
+ // loop can suspend instead of easing asymptotically forever.
89
+ traveling = Math.abs(next.x - onScreen.x) >= GLIDE_SETTLE_DISTANCE || Math.abs(next.y - onScreen.y) >= GLIDE_SETTLE_DISTANCE;
90
+ currentRef.current = traveling ? next : onScreen;
91
+ }
92
+ const anchor = anchorRef.current;
93
+ if (anchor) {
94
+ anchor.style.transform = `translate3d(${currentRef.current.x}px, ${currentRef.current.y}px, 0)`;
95
+ }
96
+ return traveling;
97
+ };
98
+ const stepRef = react.useRef(step);
99
+ stepRef.current = step;
100
+ const loopRef = react.useRef(null);
101
+ loopRef.current ??= Canvas.createSelfSuspendingFrameLoop((now)=>stepRef.current(now));
102
+ const loop = loopRef.current;
103
+ react.useEffect(()=>{
104
+ const wake = ()=>{
105
+ // A suspended loop's elapsed time restarts at its wake — measured from the frame it last
106
+ // ran, the first glide step after a pause would leap most of the way in one jump.
107
+ if (!loop.isRunning) {
108
+ previousRef.current = performance.now();
109
+ }
110
+ loop.wake();
111
+ };
112
+ wake();
113
+ const unsubscribe = Canvas.canvasTransformActivity.subscribe(wake);
114
+ window.addEventListener('resize', wake);
115
+ return ()=>{
116
+ unsubscribe();
117
+ window.removeEventListener('resize', wake);
118
+ loop.stop();
119
+ };
120
+ }, [
121
+ loop
122
+ ]);
123
+ // A new target (or glide behavior) has to restart a suspended glide.
124
+ react.useEffect(()=>{
125
+ if (!loop.isRunning) {
126
+ previousRef.current = performance.now();
127
+ }
128
+ loop.wake();
129
+ }, [
130
+ loop,
131
+ x,
132
+ y,
133
+ space,
134
+ glideMs
135
+ ]);
136
+ return /*#__PURE__*/ jsxRuntime.jsx("div", {
137
+ ref: anchorRef,
138
+ className: className,
139
+ style: {
140
+ position: 'absolute',
141
+ top: 0,
142
+ left: 0,
143
+ willChange: 'transform'
144
+ },
145
+ children: children
146
+ });
147
+ };
148
+
149
+ exports.TourAnchor = TourAnchor;
150
+ //# sourceMappingURL=TourAnchor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TourAnchor.js","sources":["../../TourAnchor.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, useLayoutEffect, useRef } from 'react';\nimport { canvasTransformActivity, createSelfSuspendingFrameLoop, type SelfSuspendingFrameLoop } from '@cratis/components/Canvas';\nimport type { TourAnchorSpace } from './TourAnchorSpace.js';\nimport { type BoardTransform, type ScreenPoint, projectEditorPointToScreen, projectToScreen, projectToolbarPointToScreen } from './tourGeometry.js';\n\n/**\n * Where a target currently sits on screen, whatever space it is expressed in. Editor-space targets project\n * against the live viewport size, so the anchor keeps sitting on its spot in the panel through a resize.\n */\nfunction projectTarget(target: { x: number; y: number; space: TourAnchorSpace }, transform: BoardTransform): ScreenPoint {\n switch (target.space) {\n case 'world': return projectToScreen(target.x, target.y, transform);\n case 'editor': return projectEditorPointToScreen(target.x, target.y, window.innerWidth, window.innerHeight);\n case 'toolbar': return projectToolbarPointToScreen(target.x, target.y, window.innerHeight);\n case 'screen': return { x: target.x, y: target.y };\n }\n}\n\n// How close, in screen pixels, a glide has to get before it counts as arrived and the loop suspends.\nconst GLIDE_SETTLE_DISTANCE = 0.5;\n\nexport interface TourAnchorProps {\n /** The horizontal coordinate to sit at, in the anchor's space. */\n x: number;\n\n /** The vertical coordinate to sit at, in the anchor's space. */\n y: number;\n\n /** The space the coordinates are expressed in. Board coordinates when omitted. */\n space?: TourAnchorSpace;\n\n /** The board's live pan and zoom. */\n transformRef: React.RefObject<BoardTransform>;\n\n /**\n * How long to take travelling to where the target currently is on screen. Left out, the anchor is simply\n * placed there every frame — which is what a label wants, where gliding would only look like the label\n * had come loose from the board.\n */\n glideMs?: number;\n\n /** A class applied to the anchored element. */\n className?: string;\n\n /** What to draw at that place. */\n children: React.ReactNode;\n}\n\n/**\n * Holds its children at a place on the board — or on the tour's own chrome — and, when asked, takes its time\n * getting to a new one.\n *\n * The travel is eased in screen space, against where the target currently sits on screen, rather than in\n * board space. This is what keeps the pointer's movement its own: while the camera pans, a board-space glide\n * would compose with the camera and sweep the pointer across the screen, whereas the screen-space easing lets\n * it drift calmly after its target no matter what the camera is doing underneath.\n *\n * The position is written straight to the DOM on every animation frame rather than held in React state: the\n * camera glides for the best part of a second on every step, and re-rendering the tour's overlay at frame\n * rate for the whole of it would compete with the board's own per-frame transform writes.\n */\nexport const TourAnchor = ({ x, y, space = 'world', transformRef, glideMs = 0, className, children }: TourAnchorProps) => {\n const anchorRef = useRef<HTMLDivElement>(null);\n const targetRef = useRef({ x, y, space });\n const currentRef = useRef<{ x: number; y: number } | null>(null);\n targetRef.current = { x, y, space };\n\n // The follower below only places the element from the first animation frame on — without this, the\n // element would be visible at the board's top-left corner for the frames before that, which is exactly\n // where a freshly appeared callout was seen flashing. Place it where it belongs before the first paint.\n useLayoutEffect(() => {\n const anchor = anchorRef.current;\n if (!anchor) return;\n\n const target = targetRef.current;\n const onScreen = projectTarget(target, transformRef.current);\n currentRef.current = onScreen;\n anchor.style.transform = `translate3d(${onScreen.x}px, ${onScreen.y}px, 0)`;\n // Mount-only by design: every later placement belongs to the follower.\n }, []);\n\n // The follower runs as a self-suspending loop rather than a permanent per-frame one: it glides while there is travel left, then stops, and wakes again whenever\n // the camera applies a transform frame, the window resizes (editor/toolbar spaces project against\n // the viewport), or the target itself moves to a new spot.\n const previousRef = useRef(performance.now());\n const step = (now: number): boolean => {\n const elapsed = now - previousRef.current;\n previousRef.current = now;\n\n const target = targetRef.current;\n const onScreen = projectTarget(target, transformRef.current);\n\n // Exponential easing toward the target's current screen position, so the travel is smooth at any\n // frame rate and settles rather than arriving abruptly. The first placement is not traveled to —\n // there is nowhere to have come from.\n const current = currentRef.current;\n let traveling = false;\n if (current === null || glideMs <= 0) {\n currentRef.current = onScreen;\n } else {\n const factor = 1 - Math.exp(-elapsed / (glideMs / 3));\n const next = {\n x: current.x + (onScreen.x - current.x) * factor,\n y: current.y + (onScreen.y - current.y) * factor,\n };\n // Within a hair of the target the glide has visually arrived — rest exactly on it so the\n // loop can suspend instead of easing asymptotically forever.\n traveling = Math.abs(next.x - onScreen.x) >= GLIDE_SETTLE_DISTANCE || Math.abs(next.y - onScreen.y) >= GLIDE_SETTLE_DISTANCE;\n currentRef.current = traveling ? next : onScreen;\n }\n\n const anchor = anchorRef.current;\n if (anchor) {\n anchor.style.transform = `translate3d(${currentRef.current.x}px, ${currentRef.current.y}px, 0)`;\n }\n\n return traveling;\n };\n const stepRef = useRef(step);\n stepRef.current = step;\n\n const loopRef = useRef<SelfSuspendingFrameLoop | null>(null);\n loopRef.current ??= createSelfSuspendingFrameLoop(now => stepRef.current(now));\n const loop = loopRef.current;\n\n useEffect(() => {\n const wake = () => {\n // A suspended loop's elapsed time restarts at its wake — measured from the frame it last\n // ran, the first glide step after a pause would leap most of the way in one jump.\n if (!loop.isRunning) {\n previousRef.current = performance.now();\n }\n loop.wake();\n };\n\n wake();\n const unsubscribe = canvasTransformActivity.subscribe(wake);\n window.addEventListener('resize', wake);\n return () => {\n unsubscribe();\n window.removeEventListener('resize', wake);\n loop.stop();\n };\n }, [loop]);\n\n // A new target (or glide behavior) has to restart a suspended glide.\n useEffect(() => {\n if (!loop.isRunning) {\n previousRef.current = performance.now();\n }\n loop.wake();\n }, [loop, x, y, space, glideMs]);\n\n return (\n <div ref={anchorRef} className={className} style={{ position: 'absolute', top: 0, left: 0, willChange: 'transform' }}>\n {children}\n </div>\n );\n};\n"],"names":["projectTarget","target","transform","space","projectToScreen","x","y","projectEditorPointToScreen","window","innerWidth","innerHeight","projectToolbarPointToScreen","GLIDE_SETTLE_DISTANCE","TourAnchor","transformRef","glideMs","className","children","anchorRef","useRef","targetRef","currentRef","current","useLayoutEffect","anchor","onScreen","style","previousRef","performance","now","step","elapsed","traveling","factor","Math","exp","next","abs","stepRef","loopRef","createSelfSuspendingFrameLoop","loop","useEffect","wake","isRunning","unsubscribe","canvasTransformActivity","subscribe","addEventListener","removeEventListener","stop","_jsx","div","ref","position","top","left","willChange"],"mappings":";;;;;;;AAQA;;;AAGC,IACD,SAASA,aAAAA,CAAcC,MAAwD,EAAEC,SAAyB,EAAA;AACtG,IAAA,OAAQD,OAAOE,KAAK;QAChB,KAAK,OAAA;AAAS,YAAA,OAAOC,6BAAgBH,MAAAA,CAAOI,CAAC,EAAEJ,MAAAA,CAAOK,CAAC,EAAEJ,SAAAA,CAAAA;QACzD,KAAK,QAAA;YAAU,OAAOK,uCAAAA,CAA2BN,MAAAA,CAAOI,CAAC,EAAEJ,MAAAA,CAAOK,CAAC,EAAEE,MAAAA,CAAOC,UAAU,EAAED,MAAAA,CAAOE,WAAW,CAAA;QAC1G,KAAK,SAAA;YAAW,OAAOC,wCAAAA,CAA4BV,OAAOI,CAAC,EAAEJ,OAAOK,CAAC,EAAEE,OAAOE,WAAW,CAAA;QACzF,KAAK,QAAA;YAAU,OAAO;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,CAAA;;IAGTC,eAAAA,CAAU,IAAA;QACN,IAAI,CAACD,IAAAA,CAAKG,SAAS,EAAE;YACjBjB,WAAAA,CAAYL,OAAO,GAAGM,WAAAA,CAAYC,GAAG,EAAA;AACzC,QAAA;AACAY,QAAAA,IAAAA,CAAKE,IAAI,EAAA;IACb,CAAA,EAAG;AAACF,QAAAA,IAAAA;AAAMpC,QAAAA,CAAAA;AAAGC,QAAAA,CAAAA;AAAGH,QAAAA,KAAAA;AAAOY,QAAAA;AAAQ,KAAA,CAAA;AAE/B,IAAA,qBACIoC,cAAA,CAACC,KAAAA,EAAAA;QAAIC,GAAAA,EAAKnC,SAAAA;QAAWF,SAAAA,EAAWA,SAAAA;QAAWU,KAAAA,EAAO;YAAE4B,QAAAA,EAAU,UAAA;YAAYC,GAAAA,EAAK,CAAA;YAAGC,IAAAA,EAAM,CAAA;YAAGC,UAAAA,EAAY;AAAY,SAAA;AAC9GxC,QAAAA,QAAAA,EAAAA;;AAGb;;"}
@@ -0,0 +1,2 @@
1
+ export type TourAnchorSpace = 'world' | 'screen' | 'editor' | 'toolbar';
2
+ //# sourceMappingURL=TourAnchorSpace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TourAnchorSpace.d.ts","sourceRoot":"","sources":["../../TourAnchorSpace.ts"],"names":[],"mappings":"AAcA,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { TourAnchorSpace } from './TourAnchorSpace.js';
2
+ export interface TourCallout {
3
+ x: number;
4
+ y: number;
5
+ text: string;
6
+ space?: TourAnchorSpace;
7
+ }
8
+ //# sourceMappingURL=TourCallout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TourCallout.d.ts","sourceRoot":"","sources":["../../TourCallout.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAM5D,MAAM,WAAW,WAAW;IAExB,CAAC,EAAE,MAAM,CAAC;IAGV,CAAC,EAAE,MAAM,CAAC;IAGV,IAAI,EAAE,MAAM,CAAC;IAGb,KAAK,CAAC,EAAE,eAAe,CAAC;CAC3B"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { BoardTransform } from './tourGeometry.js';
3
+ import type { TourCallout } from './TourCallout.js';
4
+ export interface TourCalloutBubbleProps {
5
+ callout: TourCallout | undefined;
6
+ transformRef: React.RefObject<BoardTransform>;
7
+ }
8
+ export declare const TourCalloutBubble: ({ callout, transformRef }: TourCalloutBubbleProps) => React.JSX.Element | null;
9
+ //# sourceMappingURL=TourCalloutBubble.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TourCalloutBubble.d.ts","sourceRoot":"","sources":["../../TourCalloutBubble.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGpD,MAAM,WAAW,sBAAsB;IAEnC,OAAO,EAAE,WAAW,GAAG,SAAS,CAAC;IAGjC,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;CACjD;AAOD,eAAO,MAAM,iBAAiB,GAAI,2BAA2B,sBAAsB,6BAgBlF,CAAC"}
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ require('react');
5
+ var TourAnchor = require('./TourAnchor.js');
6
+
7
+ /**
8
+ * Names the thing the narration is talking about, pinned just above it on the board with its caret pointing
9
+ * down at it. The script is responsible for anchoring callouts above their subjects — the bubble always
10
+ * renders upward from its anchor.
11
+ */ const TourCalloutBubble = ({ callout, transformRef })=>{
12
+ if (!callout) return null;
13
+ return /*#__PURE__*/ jsxRuntime.jsx(TourAnchor.TourAnchor, {
14
+ x: callout.x,
15
+ y: callout.y,
16
+ space: callout.space,
17
+ transformRef: transformRef,
18
+ className: "cue-callout",
19
+ children: /*#__PURE__*/ jsxRuntime.jsx("div", {
20
+ className: "cue-callout__bubble",
21
+ children: callout.text
22
+ })
23
+ }, callout.text);
24
+ };
25
+
26
+ exports.TourCalloutBubble = TourCalloutBubble;
27
+ //# sourceMappingURL=TourCalloutBubble.js.map
@@ -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,cAAA,CAACC,qBAAAA,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,cAAA,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,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,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,68 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var CueProvider = require('./Configuration/CueProvider.js');
5
+ var tourTimeline = require('./tourTimeline.js');
6
+
7
+ /**
8
+ * The tour's table of contents: the sections as headings, their chapters under them, where the viewer is in
9
+ * it all, and a way to skip straight to any part of it. Chapter indices stay global across sections — the
10
+ * clock is flat, sections only group the listing.
11
+ */ const TourChapterList = ({ sections, chapters, currentChapterIndex, onSelectChapter, showTimings = true })=>{
12
+ const { labels } = CueProvider.useCueConfiguration();
13
+ return /*#__PURE__*/ jsxRuntime.jsxs("aside", {
14
+ className: "cue-chapters",
15
+ children: [
16
+ /*#__PURE__*/ jsxRuntime.jsx("h2", {
17
+ className: "cue-chapters__heading",
18
+ children: labels.chapters
19
+ }),
20
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
21
+ className: "cue-chapters__sections",
22
+ children: sections.map((timedSection, sectionIndex)=>/*#__PURE__*/ jsxRuntime.jsxs("section", {
23
+ children: [
24
+ /*#__PURE__*/ jsxRuntime.jsx("h3", {
25
+ className: "cue-chapters__section-title",
26
+ children: timedSection.section.title
27
+ }),
28
+ /*#__PURE__*/ jsxRuntime.jsx("ol", {
29
+ className: "cue-chapters__list",
30
+ children: chapters.map((timed, chapterIndex)=>({
31
+ timed,
32
+ chapterIndex
33
+ })).filter(({ timed })=>timed.sectionIndex === sectionIndex).map(({ timed, chapterIndex })=>/*#__PURE__*/ jsxRuntime.jsx("li", {
34
+ children: /*#__PURE__*/ jsxRuntime.jsxs("button", {
35
+ type: "button",
36
+ className: `cue-chapters__item${chapterIndex === currentChapterIndex ? ' cue-chapters__item--current' : ''}`,
37
+ onClick: ()=>onSelectChapter(chapterIndex),
38
+ children: [
39
+ showTimings && /*#__PURE__*/ jsxRuntime.jsx("span", {
40
+ className: "cue-chapters__time",
41
+ children: tourTimeline.formatTourTime(timed.startMs)
42
+ }),
43
+ /*#__PURE__*/ jsxRuntime.jsxs("span", {
44
+ className: "cue-chapters__text",
45
+ children: [
46
+ /*#__PURE__*/ jsxRuntime.jsx("span", {
47
+ className: "cue-chapters__title",
48
+ children: timed.chapter.title
49
+ }),
50
+ /*#__PURE__*/ jsxRuntime.jsx("span", {
51
+ className: "cue-chapters__summary",
52
+ children: timed.chapter.summary
53
+ })
54
+ ]
55
+ })
56
+ ]
57
+ })
58
+ }, timed.chapter.id))
59
+ })
60
+ ]
61
+ }, timedSection.section.id))
62
+ })
63
+ ]
64
+ });
65
+ };
66
+
67
+ exports.TourChapterList = TourChapterList;
68
+ //# 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,+BAAAA,EAAAA;AACnB,IAAA,qBACIC,eAAA,CAACC,OAAAA,EAAAA;QAAMC,SAAAA,EAAU,cAAA;;0BACbC,cAAA,CAACC,IAAAA,EAAAA;gBAAGF,SAAAA,EAAU,uBAAA;AAAyBJ,gBAAAA,QAAAA,EAAAA,MAAAA,CAAOJ;;0BAC9CS,cAAA,CAACE,KAAAA,EAAAA;gBAAIH,SAAAA,EAAU,wBAAA;AACVT,gBAAAA,QAAAA,EAAAA,QAAAA,CAASa,GAAG,CAAC,CAACC,YAAAA,EAAcC,6BACzBR,eAAA,CAACS,SAAAA,EAAAA;;0CACGN,cAAA,CAACO,IAAAA,EAAAA;gCAAGR,SAAAA,EAAU,6BAAA;0CAA+BK,YAAAA,CAAaE,OAAO,CAACE;;0CAClER,cAAA,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,cAAA,CAACa,IAAAA,EAAAA;AACG,wCAAA,QAAA,gBAAAhB,eAAA,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,cAAA,CAACiB,MAAAA,EAAAA;oDAAKlB,SAAAA,EAAU,oBAAA;AAAsBmB,oDAAAA,QAAAA,EAAAA,2BAAAA,CAAeR,MAAMS,OAAO;;8DAClFtB,eAAA,CAACoB,MAAAA,EAAAA;oDAAKlB,SAAAA,EAAU,oBAAA;;sEACZC,cAAA,CAACiB,MAAAA,EAAAA;4DAAKlB,SAAAA,EAAU,qBAAA;sEAAuBW,KAAAA,CAAMU,OAAO,CAACZ;;sEACrDR,cAAA,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,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,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,77 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var react = require('react');
5
+ var CueProvider = require('./Configuration/CueProvider.js');
6
+ var TourChapterList = require('./TourChapterList.js');
7
+ var TourSelfPacedPanel = require('./TourSelfPacedPanel.js');
8
+ var TourSubtitles = require('./TourSubtitles.js');
9
+ var TourTimelineBar = require('./TourTimelineBar.js');
10
+ var tourSelfPaced = require('./tourSelfPaced.js');
11
+ var useTourPlayback = require('./useTourPlayback.js');
12
+
13
+ /**
14
+ * The chrome every guided tour shares: the full-screen layer, the chapter list, the subtitles, the transport
15
+ * with its stop button, and the playback clock driving them all — parameterized by the tour's script and the
16
+ * stage it plays on. There is deliberately no header: a pill in the corner sat on top of whatever the tour
17
+ * was showing there, and everything it offered lives in the transport.
18
+ *
19
+ * The shell owns playback so a tour only brings its script and its stage. Escape stops the tour, exactly
20
+ * like the transport's stop button.
21
+ *
22
+ * A tour that also brings written chapters can be switched into self-paced reading from the transport: the
23
+ * clock and narration stop, the media controls dim, the chapter timings disappear, and the current chapter's
24
+ * walkthrough shows beside the chapter list — with the chapters themselves as the way to move around.
25
+ */ const TourOverlayShell = ({ sections, selfPacedContent, onClose, children })=>{
26
+ const playback = useTourPlayback.useTourPlayback(sections);
27
+ const { stageBoundary: StageBoundary } = CueProvider.useCueConfiguration();
28
+ const [isSelfPaced, setIsSelfPaced] = react.useState(false);
29
+ const currentChapter = playback.timeline.chapters[playback.chapterIndex]?.chapter;
30
+ const selfPaced = tourSelfPaced.selfPacedViewFor(isSelfPaced, selfPacedContent, currentChapter?.id);
31
+ // Reading is silent: entering self-paced mode stops the clock, and the narration with it. Returning to
32
+ // narrated playback stays paused right where the reader is, until they press play themselves.
33
+ const handleToggleSelfPaced = ()=>{
34
+ if (!isSelfPaced) playback.pause();
35
+ setIsSelfPaced(!isSelfPaced);
36
+ };
37
+ react.useEffect(()=>{
38
+ const closeOnEscape = (event)=>{
39
+ if (event.key === 'Escape') onClose();
40
+ };
41
+ window.addEventListener('keydown', closeOnEscape);
42
+ return ()=>window.removeEventListener('keydown', closeOnEscape);
43
+ }, [
44
+ onClose
45
+ ]);
46
+ return /*#__PURE__*/ jsxRuntime.jsxs("div", {
47
+ className: "cue-overlay",
48
+ children: [
49
+ /*#__PURE__*/ jsxRuntime.jsx(StageBoundary, {
50
+ children: children(playback)
51
+ }),
52
+ selfPaced.isSelfPaced && currentChapter && /*#__PURE__*/ jsxRuntime.jsx(TourSelfPacedPanel.TourSelfPacedPanel, {
53
+ title: currentChapter.title,
54
+ markdown: selfPaced.markdown
55
+ }),
56
+ /*#__PURE__*/ jsxRuntime.jsx(TourChapterList.TourChapterList, {
57
+ sections: playback.timeline.sections,
58
+ chapters: playback.timeline.chapters,
59
+ currentChapterIndex: playback.chapterIndex,
60
+ onSelectChapter: playback.goToChapter,
61
+ showTimings: selfPaced.areTimingsShown
62
+ }),
63
+ !selfPaced.isSelfPaced && playback.areSubtitlesEnabled && /*#__PURE__*/ jsxRuntime.jsx(TourSubtitles.TourSubtitles, {
64
+ narration: playback.step?.narration ?? ''
65
+ }),
66
+ /*#__PURE__*/ jsxRuntime.jsx(TourTimelineBar.TourTimelineBar, {
67
+ playback: playback,
68
+ onStop: onClose,
69
+ isSelfPaced: selfPaced.isSelfPaced,
70
+ onToggleSelfPaced: tourSelfPaced.hasSelfPacedContent(selfPacedContent) ? handleToggleSelfPaced : undefined
71
+ })
72
+ ]
73
+ });
74
+ };
75
+
76
+ exports.TourOverlayShell = TourOverlayShell;
77
+ //# 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"],"mapp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,QAAAA,CAASC,QAAAA;;YAGba,SAAAA,CAAUR,WAAW,IAAIG,cAAAA,kBACtBoB,cAAA,CAACC,qCAAAA,EAAAA;AAAmBC,gBAAAA,KAAAA,EAAOtB,eAAesB,KAAK;AAAEC,gBAAAA,QAAAA,EAAUlB,UAAUkB;;0BAGzEH,cAAA,CAACI,+BAAAA,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,cAAA,CAACW,2BAAAA,EAAAA;gBAAcC,SAAAA,EAAWxC,QAAAA,CAASyC,IAAI,EAAED,SAAAA,IAAa;;0BAEjHZ,cAAA,CAACc,+BAAAA,EAAAA;gBACG1C,QAAAA,EAAUA,QAAAA;gBACV2C,MAAAA,EAAQ7C,OAAAA;AACRO,gBAAAA,WAAAA,EAAaQ,UAAUR,WAAW;gBAClCuC,iBAAAA,EAAmBC,iCAAAA,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"}