@cratis/showrunner.cue.react 0.0.0-stage → 2.10.1

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,74 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var react = require('react');
5
+ var TourAnchor = require('./TourAnchor.js');
6
+ var cursorSvg = require('./cursorSvg.js');
7
+
8
+ /** How long the press ripple lasts. Must match the animation duration in the stylesheet. */ const PRESS_MS = 520;
9
+ /** How long the cursor takes to travel to whatever the narration has moved on to. */ const TRAVEL_MS = 850;
10
+ /** The pause between pressing down and starting to drag, so the press registers as its own beat. */ const DRAG_GRIP_MS = 250;
11
+ /** How long the held glide of a drag lasts before the pointer releases at its destination. */ const DRAG_MS = 1100;
12
+ /**
13
+ * The tour's stand-in for a mouse: an operating-system-style arrow cursor — white with a black outline, so it
14
+ * reads on any background — that glides to whatever the narration is talking about and presses when the
15
+ * script says it does. The SVG's arrow tip sits exactly on the anchored point, and the press scales the
16
+ * cursor down toward that tip, so what is being pressed never shifts.
17
+ */ const TourPointer = ({ gesture, transformRef })=>{
18
+ const [isPressing, setIsPressing] = react.useState(false);
19
+ const [dragPosition, setDragPosition] = react.useState(null);
20
+ react.useEffect(()=>{
21
+ setDragPosition(null);
22
+ if (gesture?.dragTo) {
23
+ // A drag is press-and-hold: the cursor arrives, grips, glides to the destination while held,
24
+ // and releases there — the same rhythm a real hand would have.
25
+ const destination = gesture.dragTo;
26
+ setIsPressing(false);
27
+ const timers = [
28
+ setTimeout(()=>setIsPressing(true), TRAVEL_MS),
29
+ setTimeout(()=>setDragPosition(destination), TRAVEL_MS + DRAG_GRIP_MS),
30
+ setTimeout(()=>setIsPressing(false), TRAVEL_MS + DRAG_GRIP_MS + DRAG_MS)
31
+ ];
32
+ return ()=>timers.forEach(clearTimeout);
33
+ }
34
+ if (!gesture?.clicks) return;
35
+ // The press lands once the cursor has arrived rather than the moment the step begins, so it reads as
36
+ // the pointer pressing the thing it traveled to. Restarting the class rather than leaving it on is
37
+ // what makes two presses in a row read as two presses instead of one long one.
38
+ setIsPressing(false);
39
+ const start = setTimeout(()=>setIsPressing(true), TRAVEL_MS);
40
+ const end = setTimeout(()=>setIsPressing(false), TRAVEL_MS + PRESS_MS);
41
+ return ()=>{
42
+ clearTimeout(start);
43
+ clearTimeout(end);
44
+ };
45
+ }, [
46
+ gesture
47
+ ]);
48
+ if (!gesture) return null;
49
+ return /*#__PURE__*/ jsxRuntime.jsx(TourAnchor.TourAnchor, {
50
+ x: dragPosition?.x ?? gesture.x,
51
+ y: dragPosition?.y ?? gesture.y,
52
+ space: gesture.space,
53
+ transformRef: transformRef,
54
+ glideMs: TRAVEL_MS,
55
+ className: "cue-pointer",
56
+ children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
57
+ className: `cue-pointer__cursor${isPressing ? ' cue-pointer__cursor--pressing' : ''}`,
58
+ children: [
59
+ /*#__PURE__*/ jsxRuntime.jsx("span", {
60
+ className: "cue-pointer__ripple"
61
+ }),
62
+ /*#__PURE__*/ jsxRuntime.jsx("span", {
63
+ className: "cue-pointer__arrow",
64
+ dangerouslySetInnerHTML: {
65
+ __html: cursorSvg.cursorSvg
66
+ }
67
+ })
68
+ ]
69
+ })
70
+ });
71
+ };
72
+
73
+ exports.TourPointer = TourPointer;
74
+ //# 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,cAAAA,CAAS,KAAA,CAAA;AAC7C,IAAA,MAAM,CAACC,YAAAA,EAAcC,eAAAA,CAAgB,GAAGF,cAAAA,CAA0C,IAAA,CAAA;IAElFG,eAAAA,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,SAAA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;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,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,27 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var CueMarkdown = require('./Markdown/CueMarkdown.js');
5
+
6
+ /**
7
+ * The self-paced reading panel: the current chapter's written walkthrough, docked beside the chapter list so
8
+ * reading and navigating sit next to each other. It renders the tour's own authored markdown — screenshots
9
+ * and animations included — and scrolls on its own, since a written chapter is longer than its narration.
10
+ */ const TourSelfPacedPanel = ({ title, markdown })=>/*#__PURE__*/ jsxRuntime.jsxs("aside", {
11
+ className: "cue-self-paced",
12
+ children: [
13
+ /*#__PURE__*/ jsxRuntime.jsx("h2", {
14
+ className: "cue-self-paced__title",
15
+ children: title
16
+ }),
17
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
18
+ className: "cue-self-paced__content",
19
+ children: /*#__PURE__*/ jsxRuntime.jsx(CueMarkdown.CueMarkdown, {
20
+ source: markdown
21
+ })
22
+ })
23
+ ]
24
+ });
25
+
26
+ exports.TourSelfPacedPanel = TourSelfPacedPanel;
27
+ //# 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,eAAA,CAACC,OAAAA,EAAAA;QAAMC,SAAAA,EAAU,gBAAA;;0BACbC,cAAA,CAACC,IAAAA,EAAAA;gBAAGF,SAAAA,EAAU,uBAAA;AAAyBJ,gBAAAA,QAAAA,EAAAA;;0BACvCK,cAAA,CAACE,KAAAA,EAAAA;gBAAIH,SAAAA,EAAU,yBAAA;AACX,gBAAA,QAAA,gBAAAC,cAAA,CAACG,uBAAAA,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,12 @@
1
+ import type { TourCallout } from './TourCallout.js';
2
+ import type { TourCamera } from './TourCamera.js';
3
+ import type { TourGesture } from './TourGesture.js';
4
+ export interface TourStep {
5
+ narration: string;
6
+ stage: number;
7
+ camera?: TourCamera;
8
+ gesture?: TourGesture;
9
+ callout?: TourCallout;
10
+ durationMs?: number;
11
+ }
12
+ //# sourceMappingURL=TourStep.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TourStep.d.ts","sourceRoot":"","sources":["../../TourStep.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAUpD,MAAM,WAAW,QAAQ;IAErB,SAAS,EAAE,MAAM,CAAC;IAMlB,KAAK,EAAE,MAAM,CAAC;IAGd,MAAM,CAAC,EAAE,UAAU,CAAC;IAGpB,OAAO,CAAC,EAAE,WAAW,CAAC;IAGtB,OAAO,CAAC,EAAE,WAAW,CAAC;IAMtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB"}
@@ -0,0 +1,5 @@
1
+ export interface TourSubtitlesProps {
2
+ narration: string;
3
+ }
4
+ export declare const TourSubtitles: ({ narration }: TourSubtitlesProps) => import("react").JSX.Element | null;
5
+ //# sourceMappingURL=TourSubtitles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TourSubtitles.d.ts","sourceRoot":"","sources":["../../TourSubtitles.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,kBAAkB;IAE/B,SAAS,EAAE,MAAM,CAAC;CACrB;AAMD,eAAO,MAAM,aAAa,GAAI,eAAe,kBAAkB,uCAQ9D,CAAC"}
@@ -0,0 +1,24 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+
5
+ // Copyright (c) Cratis. All rights reserved.
6
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
7
+ /**
8
+ * Shows what the voice-over is saying, so the tour works with the sound off, on a muted tab, or for anyone
9
+ * who would rather read it.
10
+ */ const TourSubtitles = ({ narration })=>{
11
+ if (narration.length === 0) return null;
12
+ return /*#__PURE__*/ jsxRuntime.jsx("div", {
13
+ className: "cue-subtitles",
14
+ role: "status",
15
+ "aria-live": "polite",
16
+ children: /*#__PURE__*/ jsxRuntime.jsx("p", {
17
+ className: "cue-subtitles__line",
18
+ children: narration
19
+ })
20
+ });
21
+ };
22
+
23
+ exports.TourSubtitles = TourSubtitles;
24
+ //# sourceMappingURL=TourSubtitles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TourSubtitles.js","sources":["../../TourSubtitles.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\n\nexport interface TourSubtitlesProps {\n /** The line being narrated right now. */\n narration: string;\n}\n\n/**\n * Shows what the voice-over is saying, so the tour works with the sound off, on a muted tab, or for anyone\n * who would rather read it.\n */\nexport const TourSubtitles = ({ narration }: TourSubtitlesProps) => {\n if (narration.length === 0) return null;\n\n return (\n <div className='cue-subtitles' role='status' aria-live='polite'>\n <p className='cue-subtitles__line'>{narration}</p>\n </div>\n );\n};\n"],"names":["TourSubtitles","narration","length","_jsx","div","className","role","aria-live","p"],"mappings":";;;;AAAA;AACA;AAQA;;;AAGC,IACM,MAAMA,aAAAA,GAAgB,CAAC,EAAEC,SAAS,EAAsB,GAAA;AAC3D,IAAA,IAAIA,SAAAA,CAAUC,MAAM,KAAK,CAAA,EAAG,OAAO,IAAA;AAEnC,IAAA,qBACIC,cAAA,CAACC,KAAAA,EAAAA;QAAIC,SAAAA,EAAU,eAAA;QAAgBC,IAAAA,EAAK,QAAA;QAASC,WAAAA,EAAU,QAAA;AACnD,QAAA,QAAA,gBAAAJ,cAAA,CAACK,GAAAA,EAAAA;YAAEH,SAAAA,EAAU,qBAAA;AAAuBJ,YAAAA,QAAAA,EAAAA;;;AAGhD;;"}
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { TourPlayback } from './useTourPlayback.js';
3
+ export interface TourTimelineBarProps {
4
+ playback: TourPlayback;
5
+ onStop?: () => void;
6
+ isSelfPaced?: boolean;
7
+ onToggleSelfPaced?: () => void;
8
+ }
9
+ export declare const TourTimelineBar: ({ playback, onStop, isSelfPaced, onToggleSelfPaced }: TourTimelineBarProps) => React.JSX.Element;
10
+ //# sourceMappingURL=TourTimelineBar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TourTimelineBar.d.ts","sourceRoot":"","sources":["../../TourTimelineBar.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGzD,MAAM,WAAW,oBAAoB;IAEjC,QAAQ,EAAE,YAAY,CAAC;IAGvB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IAMpB,WAAW,CAAC,EAAE,OAAO,CAAC;IAGtB,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;CAClC;AASD,eAAO,MAAM,eAAe,GAAI,sDAA8D,oBAAoB,sBA6FjH,CAAC"}
@@ -0,0 +1,134 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ require('react');
5
+ var CueProvider = require('./Configuration/CueProvider.js');
6
+ var Icons = require('./Icons.js');
7
+ var tourTimeline = require('./tourTimeline.js');
8
+
9
+ /**
10
+ * The tour's transport: play and pause, where it has got to, chapter skipping, and the two switches for how
11
+ * the narration is delivered. When the voice-over has failed, the audio switch carries a quiet warning and
12
+ * pressing it retries — the tour itself never stops for a lost voice. A tour that also has written chapters
13
+ * carries one more switch, into self-paced reading — the transport then stops being a media player: only
14
+ * chapter skipping and the reading switch stay live.
15
+ */ const TourTimelineBar = ({ playback, onStop, isSelfPaced = false, onToggleSelfPaced })=>{
16
+ const { labels: tourStrings, unlockAudio: unlockAudioPlayback } = CueProvider.useCueConfiguration();
17
+ const progress = playback.timeline.durationMs > 0 ? playback.timeMs / playback.timeline.durationMs * 100 : 0;
18
+ const handleScrub = (event)=>playback.seekTo(Number(event.target.value));
19
+ // Browsers only allow programmatic audio on media activated by a real user gesture, and narration keeps
20
+ // starting long after any click — so the gestures that lead to narration unlock playback on the way.
21
+ const handlePlayClick = ()=>{
22
+ unlockAudioPlayback();
23
+ playback.togglePlay();
24
+ };
25
+ const handleAudioClick = ()=>{
26
+ unlockAudioPlayback();
27
+ playback.toggleAudio();
28
+ };
29
+ const audioTitle = playback.hasNarrationFailed ? tourStrings.narrationFailed : !playback.isSpeechAvailable ? tourStrings.narrationUnavailable : playback.isAudioEnabled ? tourStrings.muteNarration : tourStrings.unmuteNarration;
30
+ return /*#__PURE__*/ jsxRuntime.jsxs("div", {
31
+ className: `cue-transport${isSelfPaced ? ' cue-transport--self-paced' : ''}`,
32
+ children: [
33
+ /*#__PURE__*/ jsxRuntime.jsx("button", {
34
+ type: "button",
35
+ className: "cue-transport__button",
36
+ title: tourStrings.previousChapter,
37
+ onClick: playback.goToPreviousChapter,
38
+ children: /*#__PURE__*/ jsxRuntime.jsx(Icons.CueIcon, {
39
+ name: "previous"
40
+ })
41
+ }),
42
+ /*#__PURE__*/ jsxRuntime.jsx("button", {
43
+ type: "button",
44
+ className: "cue-transport__button cue-transport__button--primary",
45
+ title: playback.isPlaying ? tourStrings.pause : tourStrings.play,
46
+ disabled: isSelfPaced,
47
+ onClick: handlePlayClick,
48
+ children: /*#__PURE__*/ jsxRuntime.jsx(Icons.CueIcon, {
49
+ name: playback.isPlaying ? 'pause' : 'play'
50
+ })
51
+ }),
52
+ /*#__PURE__*/ jsxRuntime.jsx("button", {
53
+ type: "button",
54
+ className: "cue-transport__button",
55
+ title: tourStrings.nextChapter,
56
+ onClick: playback.goToNextChapter,
57
+ children: /*#__PURE__*/ jsxRuntime.jsx(Icons.CueIcon, {
58
+ name: "next"
59
+ })
60
+ }),
61
+ /*#__PURE__*/ jsxRuntime.jsx("span", {
62
+ className: "cue-transport__time",
63
+ children: tourTimeline.formatTourTime(playback.timeMs)
64
+ }),
65
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
66
+ className: "cue-transport__track",
67
+ children: [
68
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
69
+ className: "cue-transport__elapsed",
70
+ style: {
71
+ width: `${progress}%`
72
+ }
73
+ }),
74
+ /*#__PURE__*/ jsxRuntime.jsx("input", {
75
+ type: "range",
76
+ className: "cue-transport__scrubber",
77
+ "aria-label": tourStrings.progress,
78
+ min: 0,
79
+ max: playback.timeline.durationMs,
80
+ step: 100,
81
+ value: playback.timeMs,
82
+ disabled: isSelfPaced,
83
+ onChange: handleScrub
84
+ })
85
+ ]
86
+ }),
87
+ /*#__PURE__*/ jsxRuntime.jsx("span", {
88
+ className: "cue-transport__time",
89
+ children: tourTimeline.formatTourTime(playback.timeline.durationMs)
90
+ }),
91
+ /*#__PURE__*/ jsxRuntime.jsx("button", {
92
+ type: "button",
93
+ className: `cue-transport__button${playback.isAudioEnabled && playback.isSpeechAvailable ? '' : ' cue-transport__button--off'}${playback.hasNarrationFailed ? ' cue-transport__button--warning' : ''}`,
94
+ title: audioTitle,
95
+ disabled: !playback.isSpeechAvailable || isSelfPaced,
96
+ onClick: handleAudioClick,
97
+ children: /*#__PURE__*/ jsxRuntime.jsx(Icons.CueIcon, {
98
+ name: playback.isAudioEnabled && playback.isSpeechAvailable ? 'volumeOn' : 'volumeOff'
99
+ })
100
+ }),
101
+ /*#__PURE__*/ jsxRuntime.jsx("button", {
102
+ type: "button",
103
+ className: `cue-transport__button${playback.areSubtitlesEnabled ? '' : ' cue-transport__button--off'}`,
104
+ title: playback.areSubtitlesEnabled ? tourStrings.hideSubtitles : tourStrings.showSubtitles,
105
+ disabled: isSelfPaced,
106
+ onClick: playback.toggleSubtitles,
107
+ children: /*#__PURE__*/ jsxRuntime.jsx(Icons.CueIcon, {
108
+ name: "subtitles"
109
+ })
110
+ }),
111
+ onToggleSelfPaced && /*#__PURE__*/ jsxRuntime.jsx("button", {
112
+ type: "button",
113
+ className: `cue-transport__button${isSelfPaced ? ' cue-transport__button--active' : ''}`,
114
+ title: isSelfPaced ? tourStrings.resumeNarrated : tourStrings.readSelfPaced,
115
+ onClick: onToggleSelfPaced,
116
+ children: /*#__PURE__*/ jsxRuntime.jsx(Icons.CueIcon, {
117
+ name: "book"
118
+ })
119
+ }),
120
+ onStop && /*#__PURE__*/ jsxRuntime.jsx("button", {
121
+ type: "button",
122
+ className: "cue-transport__button",
123
+ title: tourStrings.close,
124
+ onClick: onStop,
125
+ children: /*#__PURE__*/ jsxRuntime.jsx(Icons.CueIcon, {
126
+ name: "close"
127
+ })
128
+ })
129
+ ]
130
+ });
131
+ };
132
+
133
+ exports.TourTimelineBar = TourTimelineBar;
134
+ //# sourceMappingURL=TourTimelineBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TourTimelineBar.js","sources":["../../TourTimelineBar.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 { useCueConfiguration } from './Configuration/CueProvider.js';\nimport { CueIcon } from './Icons.js';\nimport type { TourPlayback } from './useTourPlayback.js';\nimport { formatTourTime } from './tourTimeline.js';\n\nexport interface TourTimelineBarProps {\n /** The tour's playback state and controls. */\n playback: TourPlayback;\n\n /** Stops the tour and hands the surface back. Omitted, no stop button is shown. */\n onStop?: () => void;\n\n /**\n * Whether the tour is being read self-paced. The media playback controls — play, scrubbing, narration\n * and subtitles — dim, while chapter skipping stays live as the way to move through the tour.\n */\n isSelfPaced?: boolean;\n\n /** Switches between narrated playback and self-paced reading. Omitted, no switch is shown. */\n onToggleSelfPaced?: () => void;\n}\n\n/**\n * The tour's transport: play and pause, where it has got to, chapter skipping, and the two switches for how\n * the narration is delivered. When the voice-over has failed, the audio switch carries a quiet warning and\n * pressing it retries — the tour itself never stops for a lost voice. A tour that also has written chapters\n * carries one more switch, into self-paced reading — the transport then stops being a media player: only\n * chapter skipping and the reading switch stay live.\n */\nexport const TourTimelineBar = ({ playback, onStop, isSelfPaced = false, onToggleSelfPaced }: TourTimelineBarProps) => {\n const { labels: tourStrings, unlockAudio: unlockAudioPlayback } = useCueConfiguration();\n const progress = playback.timeline.durationMs > 0\n ? (playback.timeMs / playback.timeline.durationMs) * 100\n : 0;\n\n const handleScrub = (event: React.ChangeEvent<HTMLInputElement>) =>\n playback.seekTo(Number(event.target.value));\n\n // Browsers only allow programmatic audio on media activated by a real user gesture, and narration keeps\n // starting long after any click — so the gestures that lead to narration unlock playback on the way.\n const handlePlayClick = () => {\n unlockAudioPlayback();\n playback.togglePlay();\n };\n\n const handleAudioClick = () => {\n unlockAudioPlayback();\n playback.toggleAudio();\n };\n\n const audioTitle = playback.hasNarrationFailed\n ? tourStrings.narrationFailed\n : !playback.isSpeechAvailable\n ? tourStrings.narrationUnavailable\n : playback.isAudioEnabled ? tourStrings.muteNarration : tourStrings.unmuteNarration;\n\n return (\n <div className={`cue-transport${isSelfPaced ? ' cue-transport--self-paced' : ''}`}>\n <button type='button' className='cue-transport__button' title={tourStrings.previousChapter} onClick={playback.goToPreviousChapter}>\n <CueIcon name='previous' />\n </button>\n <button\n type='button'\n className='cue-transport__button cue-transport__button--primary'\n title={playback.isPlaying ? tourStrings.pause : tourStrings.play}\n disabled={isSelfPaced}\n onClick={handlePlayClick}>\n <CueIcon name={playback.isPlaying ? 'pause' : 'play'} />\n </button>\n <button type='button' className='cue-transport__button' title={tourStrings.nextChapter} onClick={playback.goToNextChapter}>\n <CueIcon name='next' />\n </button>\n\n <span className='cue-transport__time'>{formatTourTime(playback.timeMs)}</span>\n <div className='cue-transport__track'>\n <div className='cue-transport__elapsed' style={{ width: `${progress}%` }} />\n <input\n type='range'\n className='cue-transport__scrubber'\n aria-label={tourStrings.progress}\n min={0}\n max={playback.timeline.durationMs}\n step={100}\n value={playback.timeMs}\n disabled={isSelfPaced}\n onChange={handleScrub}\n />\n </div>\n <span className='cue-transport__time'>{formatTourTime(playback.timeline.durationMs)}</span>\n\n <button\n type='button'\n className={`cue-transport__button${playback.isAudioEnabled && playback.isSpeechAvailable ? '' : ' cue-transport__button--off'}${playback.hasNarrationFailed ? ' cue-transport__button--warning' : ''}`}\n title={audioTitle}\n disabled={!playback.isSpeechAvailable || isSelfPaced}\n onClick={handleAudioClick}>\n <CueIcon name={playback.isAudioEnabled && playback.isSpeechAvailable ? 'volumeOn' : 'volumeOff'} />\n </button>\n <button\n type='button'\n className={`cue-transport__button${playback.areSubtitlesEnabled ? '' : ' cue-transport__button--off'}`}\n title={playback.areSubtitlesEnabled ? tourStrings.hideSubtitles : tourStrings.showSubtitles}\n disabled={isSelfPaced}\n onClick={playback.toggleSubtitles}>\n <CueIcon name='subtitles' />\n </button>\n {onToggleSelfPaced && (\n <button\n type='button'\n className={`cue-transport__button${isSelfPaced ? ' cue-transport__button--active' : ''}`}\n title={isSelfPaced ? tourStrings.resumeNarrated : tourStrings.readSelfPaced}\n onClick={onToggleSelfPaced}>\n <CueIcon name='book' />\n </button>\n )}\n {onStop && (\n <button type='button' className='cue-transport__button' title={tourStrings.close} onClick={onStop}>\n <CueIcon name='close' />\n </button>\n )}\n </div>\n );\n};\n"],"names":["TourTimelineBar","playback","onStop","isSelfPaced","onToggleSelfPaced","labels","tourStrings","unlockAudio","unlockAudioPlayback","useCueConfiguration","progress","timeline","durationMs","timeMs","handleScrub","event","seekTo","Number","target","value","handlePlayClick","togglePlay","handleAudioClick","toggleAudio","audioTitle","hasNarrationFailed","narrationFailed","isSpeechAvailable","narrationUnavailable","isAudioEnabled","muteNarration","unmuteNarration","_jsxs","div","className","_jsx","button","type","title","previousChapter","onClick","goToPreviousChapter","CueIcon","name","isPlaying","pause","play","disabled","nextChapter","goToNextChapter","span","formatTourTime","style","width","input","aria-label","min","max","step","onChange","areSubtitles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tD,YAAYuD,aAAa,GAAGvD,YAAYwD,aAAa;gBAC3Ff,QAAAA,EAAU5C,WAAAA;AACVqC,gBAAAA,OAAAA,EAASvC,SAAS8D,eAAe;AACjC,gBAAA,QAAA,gBAAA5B,cAAA,CAACO,aAAAA,EAAAA;oBAAQC,IAAAA,EAAK;;;AAEjBvC,YAAAA,iBAAAA,kBACG+B,cAAA,CAACC,QAAAA,EAAAA;gBACGC,IAAAA,EAAK,QAAA;AACLH,gBAAAA,SAAAA,EAAW,CAAC,qBAAqB,EAAE/B,WAAAA,GAAc,mCAAmC,EAAA,CAAA,CAAI;AACxFmC,gBAAAA,KAAAA,EAAOnC,WAAAA,GAAcG,WAAAA,CAAY0D,cAAc,GAAG1D,YAAY2D,aAAa;gBAC3EzB,OAAAA,EAASpC,iBAAAA;AACT,gBAAA,QAAA,gBAAA+B,cAAA,CAACO,aAAAA,EAAAA;oBAAQC,IAAAA,EAAK;;;AAGrBzC,YAAAA,MAAAA,kBACGiC,cAAA,CAACC,QAAAA,EAAAA;gBAAOC,IAAAA,EAAK,QAAA;gBAASH,SAAAA,EAAU,uBAAA;AAAwBI,gBAAAA,KAAAA,EAAOhC,YAAY4D,KAAK;gBAAE1B,OAAAA,EAAStC,MAAAA;AACvF,gBAAA,QAAA,gBAAAiC,cAAA,CAACO,aAAAA,EAAAA;oBAAQC,IAAAA,EAAK;;;;;AAKlC;;"}
@@ -0,0 +1,24 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ declare const meta: {
3
+ title: string;
4
+ component: ({ playback, onStop, isSelfPaced, onToggleSelfPaced }: import("./TourTimelineBar.js").TourTimelineBarProps) => 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 Paused: Story;
19
+ export declare const Silenced: Story;
20
+ export declare const WithoutSpeech: Story;
21
+ export declare const NarrationFailed: Story;
22
+ export declare const WithSelfPacedSwitch: Story;
23
+ export declare const SelfPaced: Story;
24
+ //# sourceMappingURL=TourTimelineBar.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TourTimelineBar.stories.d.ts","sourceRoot":"","sources":["../../TourTimelineBar.stories.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAgCvD,QAAA,MAAM,IAAI;;;;;;;;;;;;CAY8B,CAAC;AAEzC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAGnC,eAAO,MAAM,UAAU,EAAE,KAExB,CAAC;AAGF,eAAO,MAAM,MAAM,EAAE,KAEpB,CAAC;AAGF,eAAO,MAAM,QAAQ,EAAE,KAEtB,CAAC;AAGF,eAAO,MAAM,aAAa,EAAE,KAE3B,CAAC;AAGF,eAAO,MAAM,eAAe,EAAE,KAE7B,CAAC;AAGF,eAAO,MAAM,mBAAmB,EAAE,KAEjC,CAAC;AAGF,eAAO,MAAM,SAAS,EAAE,KAEvB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './useCueTours.js';
2
+ export * from './useTourNudge.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../Tours/index.ts"],"names":[],"mappings":"AAGA,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,7 @@
1
+ export interface CueTours {
2
+ isLoaded: boolean;
3
+ hasStarted(tour: string): boolean;
4
+ recordStart(tour: string): Promise<void>;
5
+ }
6
+ export declare const useCueTours: () => CueTours;
7
+ //# sourceMappingURL=useCueTours.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCueTours.d.ts","sourceRoot":"","sources":["../../../Tours/useCueTours.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,QAAQ;IAMrB,QAAQ,EAAE,OAAO,CAAC;IAOlB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAQlC,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5C;AAOD,eAAO,MAAM,WAAW,QAAO,QAwB9B,CAAC"}
@@ -0,0 +1,46 @@
1
+ 'use strict';
2
+
3
+ var showrunner_cue = require('@cratis/showrunner.cue');
4
+ var react = require('react');
5
+
6
+ // Copyright (c) Cratis. All rights reserved.
7
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
8
+ /**
9
+ * Knows which guided tours the signed-in person has started, and records the next one. Must be used inside Arc's
10
+ * context, like every generated query.
11
+ * @returns The {@link CueTours}.
12
+ */ const useCueTours = ()=>{
13
+ const [result] = showrunner_cue.ByMe.use();
14
+ const [recorded, setRecorded] = react.useState(()=>new Set());
15
+ const started = react.useMemo(()=>new Set([
16
+ ...(result.data ?? []).map((tour)=>tour.id),
17
+ ...recorded
18
+ ]), [
19
+ result.data,
20
+ recorded
21
+ ]);
22
+ const hasStarted = react.useCallback((tour)=>started.has(tour), [
23
+ started
24
+ ]);
25
+ const recordStart = react.useCallback(async (tour)=>{
26
+ if (started.has(tour)) {
27
+ return;
28
+ }
29
+ // The answer is held here the moment the tour starts: what the query returns follows the event log and may not
30
+ // have caught up yet.
31
+ setRecorded((current)=>new Set(current).add(tour));
32
+ const command = new showrunner_cue.StartTour();
33
+ command.tour = tour;
34
+ await command.execute();
35
+ }, [
36
+ started
37
+ ]);
38
+ return {
39
+ isLoaded: result.isReady,
40
+ hasStarted,
41
+ recordStart
42
+ };
43
+ };
44
+
45
+ exports.useCueTours = useCueTours;
46
+ //# sourceMappingURL=useCueTours.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCueTours.js","sources":["../../../Tours/useCueTours.ts"],"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 { StartTour, StartedTour, ByMe } from '@cratis/showrunner.cue';\nimport { useCallback, useMemo, useState } from 'react';\n\n/**\n * What {@link useCueTours} gives a component.\n */\nexport interface CueTours {\n /**\n * Whether what the signed-in person has started has arrived. Until it has, {@link hasStarted} knows nothing, so a\n * surface that points at a tour should wait: pointing and then taking the pointer away again is worse than a\n * beat of nothing.\n */\n isLoaded: boolean;\n\n /**\n * Gets whether the person has started a tour, on this device or any other.\n * @param tour The name of the tour.\n * @returns True when they have; false when they have not, or when it has not arrived yet.\n */\n hasStarted(tour: string): boolean;\n\n /**\n * Records that the person started a tour. It counts at once on this device and is recorded for every other; starting\n * a tour again changes nothing.\n * @param tour The name of the tour.\n * @returns Resolves when it has been recorded.\n */\n recordStart(tour: string): Promise<void>;\n}\n\n/**\n * Knows which guided tours the signed-in person has started, and records the next one. Must be used inside Arc's\n * context, like every generated query.\n * @returns The {@link CueTours}.\n */\nexport const useCueTours = (): CueTours => {\n const [result] = ByMe.use();\n const [recorded, setRecorded] = useState<ReadonlySet<string>>(() => new Set());\n\n const started = useMemo(\n () => new Set([...(result.data ?? []).map((tour: StartedTour) => tour.id), ...recorded]),\n [result.data, recorded]);\n\n const hasStarted = useCallback((tour: string) => started.has(tour), [started]);\n\n const recordStart = useCallback(async (tour: string) => {\n if (started.has(tour)) {\n return;\n }\n\n // The answer is held here the moment the tour starts: what the query returns follows the event log and may not\n // have caught up yet.\n setRecorded(current => new Set(current).add(tour));\n const command = new StartTour();\n command.tour = tour;\n await command.execute();\n }, [started]);\n\n return { isLoaded: result.isReady, hasStarted, recordStart };\n};\n"],"names":["useCueTours","result","ByMe","use","recorded","setRecorded","useState","Set","started","useMemo","data","map","tour","id","hasStarted","useCallback","has","recordStart","current","add","command","StartTour","execute","isLoaded","isReady"],"mappings":";;;;;AAAA;AACA;AAgCA;;;;UAKaA,WAAAA,GAAc,IAAA;AACvB,IAAA,MAAM,CAACC,MAAAA,C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+ recordStart(): void;
4
+ }
5
+ export declare const useTourNudge: (tour: string, isSuppressed?: boolean) => TourNudge;
6
+ //# sourceMappingURL=useTourNudge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTourNudge.d.ts","sourceRoot":"","sources":["../../../Tours/useTourNudge.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,SAAS;IAEtB,YAAY,EAAE,OAAO,CAAC;IAMtB,WAAW,IAAI,IAAI,CAAC;CACvB;AAaD,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,EAAE,sBAAoB,KAAG,SAMjE,CAAC"}
@@ -0,0 +1,28 @@
1
+ 'use strict';
2
+
3
+ var useCueTours = require('./useCueTours.js');
4
+
5
+ // Copyright (c) Cratis. All rights reserved.
6
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
7
+ /**
8
+ * Drives one surface's start-here pointer from what the signed-in person has already done: it points at a tour they have
9
+ * never started, and stops once they have, on every device. Must be used inside Arc's context.
10
+ * @param tour The name of the tour the surface offers.
11
+ * @param isSuppressed Whether the surface's own signals say the pointer must not show, such as the person having already
12
+ * done the work the tour teaches. Defaults to false.
13
+ * @returns The {@link TourNudge} for the surface's button.
14
+ * @remarks
15
+ * What the person started has to arrive before the pointer is shown: pointing and then taking the pointer away again is
16
+ * worse than a beat of nothing.
17
+ */ const useTourNudge = (tour, isSuppressed = false)=>{
18
+ const { isLoaded, hasStarted, recordStart } = useCueTours.useCueTours();
19
+ return {
20
+ isNudgeShown: !isSuppressed && isLoaded && !hasStarted(tour),
21
+ recordStart: ()=>{
22
+ void recordStart(tour);
23
+ }
24
+ };
25
+ };
26
+
27
+ exports.useTourNudge = useTourNudge;
28
+ //# sourceMappingURL=useTourNudge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTourNudge.js","sources":["../../../Tours/useTourNudge.ts"],"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 { useCueTours } from './useCueTours.js';\n\n/**\n * What a tour's button gets back from {@link useTourNudge}: whether to point at the tour, and what to do when it starts.\n */\nexport interface TourNudge {\n /** Whether the start-here pointer should be shown right now. */\n isNudgeShown: boolean;\n\n /**\n * Records that the person started the tour. The pointer goes away at once on this device and is recorded for every\n * other; call it when the tour starts.\n */\n recordStart(): void;\n}\n\n/**\n * Drives one surface's start-here pointer from what the signed-in person has already done: it points at a tour they have\n * never started, and stops once they have, on every device. Must be used inside Arc's context.\n * @param tour The name of the tour the surface offers.\n * @param isSuppressed Whether the surface's own signals say the pointer must not show, such as the person having already\n * done the work the tour teaches. Defaults to false.\n * @returns The {@link TourNudge} for the surface's button.\n * @remarks\n * What the person started has to arrive before the pointer is shown: pointing and then taking the pointer away again is\n * worse than a beat of nothing.\n */\nexport const useTourNudge = (tour: string, isSuppressed = false): TourNudge => {\n const { isLoaded, hasStarted, recordStart } = useCueTours();\n return {\n isNudgeShown: !isSuppressed && isLoaded && !hasStarted(tour),\n recordStart: () => { void recordStart(tour); }\n };\n};\n"],"names":["useTourNudge","tour","isSuppressed","isLoaded","hasStarted","recordStart","useCueTours","isNudgeShown"],"mappings":";;;;AAAA;AACA;AAkBA;;;;;;;;;;AAUC,IACM,MAAMA,YAAAA,GAAe,CAACC,IAAAA,EAAcC,eAAe,KAAK,GAAA;AAC3D,IAAA,MAAM,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,WAAW,EAAE,GAAGC,uBAAAA,EAAAA;IAC9C,OAAO;AACHC,QAAAA,YAAAA,EAAc,CAACL,YAAAA,IAAgBC,QAAAA,IAAY,CAACC,UAAAA,CAAWH,IAAAA,CAAAA;QACvDI,WAAAA,EAAa,IAAA;AAAQ,YAAA,KAAKA,WAAAA,CAAYJ,IAAAA,CAAAA;AAAO,QAAA;AACjD,KAAA;AACJ;;"}
@@ -0,0 +1,2 @@
1
+ export declare const cursorSvg = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 24\" width=\"20\" height=\"24\">\n <path\n d=\"M 1.5 1 L 1.5 17.2 L 5.4 13.5 L 8.2 19.9 L 11.1 18.6 L 8.4 12.4 L 13.8 12.4 Z\"\n fill=\"#ffffff\"\n stroke=\"#000000\"\n stroke-width=\"1.4\"\n stroke-linejoin=\"round\" />\n</svg>";
2
+ //# sourceMappingURL=cursorSvg.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cursorSvg.d.ts","sourceRoot":"","sources":["../../cursorSvg.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS,0UAOf,CAAC"}
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ // Copyright (c) Cratis. All rights reserved.
4
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
5
+ /** The pointer the tour moves around: a plain arrow, white with a dark outline so it shows on any surface. */ const cursorSvg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 24" width="20" height="24">
6
+ <path
7
+ d="M 1.5 1 L 1.5 17.2 L 5.4 13.5 L 8.2 19.9 L 11.1 18.6 L 8.4 12.4 L 13.8 12.4 Z"
8
+ fill="#ffffff"
9
+ stroke="#000000"
10
+ stroke-width="1.4"
11
+ stroke-linejoin="round" />
12
+ </svg>`;
13
+
14
+ exports.cursorSvg = cursorSvg;
15
+ //# sourceMappingURL=cursorSvg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cursorSvg.js","sources":["../../cursorSvg.ts"],"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\n/** The pointer the tour moves around: a plain arrow, white with a dark outline so it shows on any surface. */\nexport const cursorSvg = `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 24\" width=\"20\" height=\"24\">\n <path\n d=\"M 1.5 1 L 1.5 17.2 L 5.4 13.5 L 8.2 19.9 L 11.1 18.6 L 8.4 12.4 L 13.8 12.4 Z\"\n fill=\"#ffffff\"\n stroke=\"#000000\"\n stroke-width=\"1.4\"\n stroke-linejoin=\"round\" />\n</svg>`;\n"],"names":["cursorSvg"],"mappings":";;AAAA;AACA;AAEA,+GACO,MAAMA,SAAAA,GAAY,CAAC;;;;;;;AAOpB,MAAA;;"}