@canonical/motion-control 0.0.0-stage → 0.47.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 (310) hide show
  1. package/README.md +300 -2
  2. package/cast.schema.json +101 -0
  3. package/dist/esm/cli.js +30 -0
  4. package/dist/esm/cli.js.map +1 -0
  5. package/dist/esm/global.js +7 -0
  6. package/dist/esm/global.js.map +1 -0
  7. package/dist/esm/index.js +2 -0
  8. package/dist/esm/index.js.map +1 -0
  9. package/dist/esm/lib/cast/checkCasts.js +34 -0
  10. package/dist/esm/lib/cast/checkCasts.js.map +1 -0
  11. package/dist/esm/lib/cast/checkScene.js +58 -0
  12. package/dist/esm/lib/cast/checkScene.js.map +1 -0
  13. package/dist/esm/lib/cast/checkStep.js +73 -0
  14. package/dist/esm/lib/cast/checkStep.js.map +1 -0
  15. package/dist/esm/lib/cast/constants.js +53 -0
  16. package/dist/esm/lib/cast/constants.js.map +1 -0
  17. package/dist/esm/lib/cast/formatReport.js +22 -0
  18. package/dist/esm/lib/cast/formatReport.js.map +1 -0
  19. package/dist/esm/lib/cast/index.js +10 -0
  20. package/dist/esm/lib/cast/index.js.map +1 -0
  21. package/dist/esm/lib/cast/listFrameNames.js +19 -0
  22. package/dist/esm/lib/cast/listFrameNames.js.map +1 -0
  23. package/dist/esm/lib/cast/measureScene.js +11 -0
  24. package/dist/esm/lib/cast/measureScene.js.map +1 -0
  25. package/dist/esm/lib/cast/measureStep.js +21 -0
  26. package/dist/esm/lib/cast/measureStep.js.map +1 -0
  27. package/dist/esm/lib/cast/measureTyping.js +13 -0
  28. package/dist/esm/lib/cast/measureTyping.js.map +1 -0
  29. package/dist/esm/lib/cast/types.js +2 -0
  30. package/dist/esm/lib/cast/types.js.map +1 -0
  31. package/dist/esm/lib/gif/compressLzw.js +61 -0
  32. package/dist/esm/lib/gif/compressLzw.js.map +1 -0
  33. package/dist/esm/lib/gif/constants.js +9 -0
  34. package/dist/esm/lib/gif/constants.js.map +1 -0
  35. package/dist/esm/lib/gif/encodeGif.js +45 -0
  36. package/dist/esm/lib/gif/encodeGif.js.map +1 -0
  37. package/dist/esm/lib/gif/index.js +6 -0
  38. package/dist/esm/lib/gif/index.js.map +1 -0
  39. package/dist/esm/lib/gif/mergeStills.js +32 -0
  40. package/dist/esm/lib/gif/mergeStills.js.map +1 -0
  41. package/dist/esm/lib/gif/quantizePictures.js +75 -0
  42. package/dist/esm/lib/gif/quantizePictures.js.map +1 -0
  43. package/dist/esm/lib/gif/types.js +2 -0
  44. package/dist/esm/lib/gif/types.js.map +1 -0
  45. package/dist/esm/lib/index.js +3 -0
  46. package/dist/esm/lib/index.js.map +1 -0
  47. package/dist/esm/lib/moment/constants.js +33 -0
  48. package/dist/esm/lib/moment/constants.js.map +1 -0
  49. package/dist/esm/lib/moment/describeAction.js +20 -0
  50. package/dist/esm/lib/moment/describeAction.js.map +1 -0
  51. package/dist/esm/lib/moment/describeKeyRun.js +53 -0
  52. package/dist/esm/lib/moment/describeKeyRun.js.map +1 -0
  53. package/dist/esm/lib/moment/describeMoment.js +323 -0
  54. package/dist/esm/lib/moment/describeMoment.js.map +1 -0
  55. package/dist/esm/lib/moment/easeInOut.js +12 -0
  56. package/dist/esm/lib/moment/easeInOut.js.map +1 -0
  57. package/dist/esm/lib/moment/index.js +8 -0
  58. package/dist/esm/lib/moment/index.js.map +1 -0
  59. package/dist/esm/lib/moment/resolveStates.js +82 -0
  60. package/dist/esm/lib/moment/resolveStates.js.map +1 -0
  61. package/dist/esm/lib/moment/takeSpan.js +12 -0
  62. package/dist/esm/lib/moment/takeSpan.js.map +1 -0
  63. package/dist/esm/lib/moment/types.js +2 -0
  64. package/dist/esm/lib/moment/types.js.map +1 -0
  65. package/dist/esm/lib/player/Player.js +498 -0
  66. package/dist/esm/lib/player/Player.js.map +1 -0
  67. package/dist/esm/lib/player/announceHeight.js +30 -0
  68. package/dist/esm/lib/player/announceHeight.js.map +1 -0
  69. package/dist/esm/lib/player/applyMoment.js +155 -0
  70. package/dist/esm/lib/player/applyMoment.js.map +1 -0
  71. package/dist/esm/lib/player/assertPresent.js +14 -0
  72. package/dist/esm/lib/player/assertPresent.js.map +1 -0
  73. package/dist/esm/lib/player/collectFrames.js +30 -0
  74. package/dist/esm/lib/player/collectFrames.js.map +1 -0
  75. package/dist/esm/lib/player/collectStyles.js +24 -0
  76. package/dist/esm/lib/player/collectStyles.js.map +1 -0
  77. package/dist/esm/lib/player/constants.js +101 -0
  78. package/dist/esm/lib/player/constants.js.map +1 -0
  79. package/dist/esm/lib/player/defaultProfile.js +50 -0
  80. package/dist/esm/lib/player/defaultProfile.js.map +1 -0
  81. package/dist/esm/lib/player/drawMarkup.js +36 -0
  82. package/dist/esm/lib/player/drawMarkup.js.map +1 -0
  83. package/dist/esm/lib/player/drawScene.js +32 -0
  84. package/dist/esm/lib/player/drawScene.js.map +1 -0
  85. package/dist/esm/lib/player/drawSprites.js +122 -0
  86. package/dist/esm/lib/player/drawSprites.js.map +1 -0
  87. package/dist/esm/lib/player/fitEmbeds.js +42 -0
  88. package/dist/esm/lib/player/fitEmbeds.js.map +1 -0
  89. package/dist/esm/lib/player/fitSlide.js +27 -0
  90. package/dist/esm/lib/player/fitSlide.js.map +1 -0
  91. package/dist/esm/lib/player/formatKey.js +13 -0
  92. package/dist/esm/lib/player/formatKey.js.map +1 -0
  93. package/dist/esm/lib/player/formatKeySign.js +12 -0
  94. package/dist/esm/lib/player/formatKeySign.js.map +1 -0
  95. package/dist/esm/lib/player/formatSpeed.js +11 -0
  96. package/dist/esm/lib/player/formatSpeed.js.map +1 -0
  97. package/dist/esm/lib/player/formatTime.js +18 -0
  98. package/dist/esm/lib/player/formatTime.js.map +1 -0
  99. package/dist/esm/lib/player/index.js +30 -0
  100. package/dist/esm/lib/player/index.js.map +1 -0
  101. package/dist/esm/lib/player/installStateRules.js +25 -0
  102. package/dist/esm/lib/player/installStateRules.js.map +1 -0
  103. package/dist/esm/lib/player/listHidden.js +24 -0
  104. package/dist/esm/lib/player/listHidden.js.map +1 -0
  105. package/dist/esm/lib/player/makeElement.js +15 -0
  106. package/dist/esm/lib/player/makeElement.js.map +1 -0
  107. package/dist/esm/lib/player/mergeProfile.js +17 -0
  108. package/dist/esm/lib/player/mergeProfile.js.map +1 -0
  109. package/dist/esm/lib/player/mirrorStates.js +23 -0
  110. package/dist/esm/lib/player/mirrorStates.js.map +1 -0
  111. package/dist/esm/lib/player/mountScenes.js +100 -0
  112. package/dist/esm/lib/player/mountScenes.js.map +1 -0
  113. package/dist/esm/lib/player/readLayerBox.js +20 -0
  114. package/dist/esm/lib/player/readLayerBox.js.map +1 -0
  115. package/dist/esm/lib/player/recordGif.js +63 -0
  116. package/dist/esm/lib/player/recordGif.js.map +1 -0
  117. package/dist/esm/lib/player/recordVideo.js +114 -0
  118. package/dist/esm/lib/player/recordVideo.js.map +1 -0
  119. package/dist/esm/lib/player/renderLegend.js +27 -0
  120. package/dist/esm/lib/player/renderLegend.js.map +1 -0
  121. package/dist/esm/lib/player/saveFile.js +22 -0
  122. package/dist/esm/lib/player/saveFile.js.map +1 -0
  123. package/dist/esm/lib/player/serializeElement.js +36 -0
  124. package/dist/esm/lib/player/serializeElement.js.map +1 -0
  125. package/dist/esm/lib/player/types.js +2 -0
  126. package/dist/esm/lib/player/types.js.map +1 -0
  127. package/dist/esm/lib/player/wrapSlide.js +28 -0
  128. package/dist/esm/lib/player/wrapSlide.js.map +1 -0
  129. package/dist/esm/lib/timeline/advanceClock.js +24 -0
  130. package/dist/esm/lib/timeline/advanceClock.js.map +1 -0
  131. package/dist/esm/lib/timeline/buildTimeline.js +47 -0
  132. package/dist/esm/lib/timeline/buildTimeline.js.map +1 -0
  133. package/dist/esm/lib/timeline/constants.js +3 -0
  134. package/dist/esm/lib/timeline/constants.js.map +1 -0
  135. package/dist/esm/lib/timeline/findKeyframe.js +11 -0
  136. package/dist/esm/lib/timeline/findKeyframe.js.map +1 -0
  137. package/dist/esm/lib/timeline/index.js +7 -0
  138. package/dist/esm/lib/timeline/index.js.map +1 -0
  139. package/dist/esm/lib/timeline/locateTime.js +21 -0
  140. package/dist/esm/lib/timeline/locateTime.js.map +1 -0
  141. package/dist/esm/lib/timeline/stepKeyframe.js +20 -0
  142. package/dist/esm/lib/timeline/stepKeyframe.js.map +1 -0
  143. package/dist/esm/lib/timeline/types.js +2 -0
  144. package/dist/esm/lib/timeline/types.js.map +1 -0
  145. package/dist/esm/lib/video/constants.js +7 -0
  146. package/dist/esm/lib/video/constants.js.map +1 -0
  147. package/dist/esm/lib/video/index.js +4 -0
  148. package/dist/esm/lib/video/index.js.map +1 -0
  149. package/dist/esm/lib/video/types.js +2 -0
  150. package/dist/esm/lib/video/types.js.map +1 -0
  151. package/dist/esm/lib/video/writeBox.js +21 -0
  152. package/dist/esm/lib/video/writeBox.js.map +1 -0
  153. package/dist/esm/lib/video/writeMp4.js +45 -0
  154. package/dist/esm/lib/video/writeMp4.js.map +1 -0
  155. package/dist/motion.css +581 -0
  156. package/dist/motion.global.js +1534 -0
  157. package/dist/types/cli.d.ts +3 -0
  158. package/dist/types/cli.d.ts.map +1 -0
  159. package/dist/types/global.d.ts +2 -0
  160. package/dist/types/global.d.ts.map +1 -0
  161. package/dist/types/index.d.ts +17 -0
  162. package/dist/types/index.d.ts.map +1 -0
  163. package/dist/types/lib/cast/checkCasts.d.ts +15 -0
  164. package/dist/types/lib/cast/checkCasts.d.ts.map +1 -0
  165. package/dist/types/lib/cast/checkScene.d.ts +11 -0
  166. package/dist/types/lib/cast/checkScene.d.ts.map +1 -0
  167. package/dist/types/lib/cast/checkStep.d.ts +12 -0
  168. package/dist/types/lib/cast/checkStep.d.ts.map +1 -0
  169. package/dist/types/lib/cast/constants.d.ts +20 -0
  170. package/dist/types/lib/cast/constants.d.ts.map +1 -0
  171. package/dist/types/lib/cast/formatReport.d.ts +11 -0
  172. package/dist/types/lib/cast/formatReport.d.ts.map +1 -0
  173. package/dist/types/lib/cast/index.d.ts +11 -0
  174. package/dist/types/lib/cast/index.d.ts.map +1 -0
  175. package/dist/types/lib/cast/listFrameNames.d.ts +8 -0
  176. package/dist/types/lib/cast/listFrameNames.d.ts.map +1 -0
  177. package/dist/types/lib/cast/measureScene.d.ts +9 -0
  178. package/dist/types/lib/cast/measureScene.d.ts.map +1 -0
  179. package/dist/types/lib/cast/measureStep.d.ts +13 -0
  180. package/dist/types/lib/cast/measureStep.d.ts.map +1 -0
  181. package/dist/types/lib/cast/measureTyping.d.ts +12 -0
  182. package/dist/types/lib/cast/measureTyping.d.ts.map +1 -0
  183. package/dist/types/lib/cast/types.d.ts +87 -0
  184. package/dist/types/lib/cast/types.d.ts.map +1 -0
  185. package/dist/types/lib/gif/compressLzw.d.ts +9 -0
  186. package/dist/types/lib/gif/compressLzw.d.ts.map +1 -0
  187. package/dist/types/lib/gif/constants.d.ts +9 -0
  188. package/dist/types/lib/gif/constants.d.ts.map +1 -0
  189. package/dist/types/lib/gif/encodeGif.d.ts +13 -0
  190. package/dist/types/lib/gif/encodeGif.d.ts.map +1 -0
  191. package/dist/types/lib/gif/index.d.ts +7 -0
  192. package/dist/types/lib/gif/index.d.ts.map +1 -0
  193. package/dist/types/lib/gif/mergeStills.d.ts +12 -0
  194. package/dist/types/lib/gif/mergeStills.d.ts.map +1 -0
  195. package/dist/types/lib/gif/quantizePictures.d.ts +13 -0
  196. package/dist/types/lib/gif/quantizePictures.d.ts.map +1 -0
  197. package/dist/types/lib/gif/types.d.ts +22 -0
  198. package/dist/types/lib/gif/types.d.ts.map +1 -0
  199. package/dist/types/lib/index.d.ts +3 -0
  200. package/dist/types/lib/index.d.ts.map +1 -0
  201. package/dist/types/lib/moment/constants.d.ts +33 -0
  202. package/dist/types/lib/moment/constants.d.ts.map +1 -0
  203. package/dist/types/lib/moment/describeAction.d.ts +9 -0
  204. package/dist/types/lib/moment/describeAction.d.ts.map +1 -0
  205. package/dist/types/lib/moment/describeKeyRun.d.ts +18 -0
  206. package/dist/types/lib/moment/describeKeyRun.d.ts.map +1 -0
  207. package/dist/types/lib/moment/describeMoment.d.ts +16 -0
  208. package/dist/types/lib/moment/describeMoment.d.ts.map +1 -0
  209. package/dist/types/lib/moment/easeInOut.d.ts +8 -0
  210. package/dist/types/lib/moment/easeInOut.d.ts.map +1 -0
  211. package/dist/types/lib/moment/index.d.ts +9 -0
  212. package/dist/types/lib/moment/index.d.ts.map +1 -0
  213. package/dist/types/lib/moment/resolveStates.d.ts +18 -0
  214. package/dist/types/lib/moment/resolveStates.d.ts.map +1 -0
  215. package/dist/types/lib/moment/takeSpan.d.ts +10 -0
  216. package/dist/types/lib/moment/takeSpan.d.ts.map +1 -0
  217. package/dist/types/lib/moment/types.d.ts +187 -0
  218. package/dist/types/lib/moment/types.d.ts.map +1 -0
  219. package/dist/types/lib/player/Player.d.ts +134 -0
  220. package/dist/types/lib/player/Player.d.ts.map +1 -0
  221. package/dist/types/lib/player/announceHeight.d.ts +12 -0
  222. package/dist/types/lib/player/announceHeight.d.ts.map +1 -0
  223. package/dist/types/lib/player/applyMoment.d.ts +21 -0
  224. package/dist/types/lib/player/applyMoment.d.ts.map +1 -0
  225. package/dist/types/lib/player/assertPresent.d.ts +10 -0
  226. package/dist/types/lib/player/assertPresent.d.ts.map +1 -0
  227. package/dist/types/lib/player/collectFrames.d.ts +11 -0
  228. package/dist/types/lib/player/collectFrames.d.ts.map +1 -0
  229. package/dist/types/lib/player/collectStyles.d.ts +12 -0
  230. package/dist/types/lib/player/collectStyles.d.ts.map +1 -0
  231. package/dist/types/lib/player/constants.d.ts +80 -0
  232. package/dist/types/lib/player/constants.d.ts.map +1 -0
  233. package/dist/types/lib/player/defaultProfile.d.ts +8 -0
  234. package/dist/types/lib/player/defaultProfile.d.ts.map +1 -0
  235. package/dist/types/lib/player/drawMarkup.d.ts +15 -0
  236. package/dist/types/lib/player/drawMarkup.d.ts.map +1 -0
  237. package/dist/types/lib/player/drawScene.d.ts +23 -0
  238. package/dist/types/lib/player/drawScene.d.ts.map +1 -0
  239. package/dist/types/lib/player/drawSprites.d.ts +35 -0
  240. package/dist/types/lib/player/drawSprites.d.ts.map +1 -0
  241. package/dist/types/lib/player/fitEmbeds.d.ts +13 -0
  242. package/dist/types/lib/player/fitEmbeds.d.ts.map +1 -0
  243. package/dist/types/lib/player/fitSlide.d.ts +24 -0
  244. package/dist/types/lib/player/fitSlide.d.ts.map +1 -0
  245. package/dist/types/lib/player/formatKey.d.ts +9 -0
  246. package/dist/types/lib/player/formatKey.d.ts.map +1 -0
  247. package/dist/types/lib/player/formatKeySign.d.ts +9 -0
  248. package/dist/types/lib/player/formatKeySign.d.ts.map +1 -0
  249. package/dist/types/lib/player/formatSpeed.d.ts +9 -0
  250. package/dist/types/lib/player/formatSpeed.d.ts.map +1 -0
  251. package/dist/types/lib/player/formatTime.d.ts +12 -0
  252. package/dist/types/lib/player/formatTime.d.ts.map +1 -0
  253. package/dist/types/lib/player/index.d.ts +31 -0
  254. package/dist/types/lib/player/index.d.ts.map +1 -0
  255. package/dist/types/lib/player/installStateRules.d.ts +12 -0
  256. package/dist/types/lib/player/installStateRules.d.ts.map +1 -0
  257. package/dist/types/lib/player/listHidden.d.ts +12 -0
  258. package/dist/types/lib/player/listHidden.d.ts.map +1 -0
  259. package/dist/types/lib/player/makeElement.d.ts +10 -0
  260. package/dist/types/lib/player/makeElement.d.ts.map +1 -0
  261. package/dist/types/lib/player/mergeProfile.d.ts +9 -0
  262. package/dist/types/lib/player/mergeProfile.d.ts.map +1 -0
  263. package/dist/types/lib/player/mirrorStates.d.ts +12 -0
  264. package/dist/types/lib/player/mirrorStates.d.ts.map +1 -0
  265. package/dist/types/lib/player/mountScenes.d.ts +25 -0
  266. package/dist/types/lib/player/mountScenes.d.ts.map +1 -0
  267. package/dist/types/lib/player/readLayerBox.d.ts +23 -0
  268. package/dist/types/lib/player/readLayerBox.d.ts.map +1 -0
  269. package/dist/types/lib/player/recordGif.d.ts +16 -0
  270. package/dist/types/lib/player/recordGif.d.ts.map +1 -0
  271. package/dist/types/lib/player/recordVideo.d.ts +19 -0
  272. package/dist/types/lib/player/recordVideo.d.ts.map +1 -0
  273. package/dist/types/lib/player/renderLegend.d.ts +8 -0
  274. package/dist/types/lib/player/renderLegend.d.ts.map +1 -0
  275. package/dist/types/lib/player/saveFile.d.ts +13 -0
  276. package/dist/types/lib/player/saveFile.d.ts.map +1 -0
  277. package/dist/types/lib/player/serializeElement.d.ts +14 -0
  278. package/dist/types/lib/player/serializeElement.d.ts.map +1 -0
  279. package/dist/types/lib/player/types.d.ts +321 -0
  280. package/dist/types/lib/player/types.d.ts.map +1 -0
  281. package/dist/types/lib/player/wrapSlide.d.ts +17 -0
  282. package/dist/types/lib/player/wrapSlide.d.ts.map +1 -0
  283. package/dist/types/lib/timeline/advanceClock.d.ts +16 -0
  284. package/dist/types/lib/timeline/advanceClock.d.ts.map +1 -0
  285. package/dist/types/lib/timeline/buildTimeline.d.ts +15 -0
  286. package/dist/types/lib/timeline/buildTimeline.d.ts.map +1 -0
  287. package/dist/types/lib/timeline/constants.d.ts +3 -0
  288. package/dist/types/lib/timeline/constants.d.ts.map +1 -0
  289. package/dist/types/lib/timeline/findKeyframe.d.ts +10 -0
  290. package/dist/types/lib/timeline/findKeyframe.d.ts.map +1 -0
  291. package/dist/types/lib/timeline/index.d.ts +8 -0
  292. package/dist/types/lib/timeline/index.d.ts.map +1 -0
  293. package/dist/types/lib/timeline/locateTime.d.ts +10 -0
  294. package/dist/types/lib/timeline/locateTime.d.ts.map +1 -0
  295. package/dist/types/lib/timeline/stepKeyframe.d.ts +12 -0
  296. package/dist/types/lib/timeline/stepKeyframe.d.ts.map +1 -0
  297. package/dist/types/lib/timeline/types.d.ts +40 -0
  298. package/dist/types/lib/timeline/types.d.ts.map +1 -0
  299. package/dist/types/lib/video/constants.d.ts +5 -0
  300. package/dist/types/lib/video/constants.d.ts.map +1 -0
  301. package/dist/types/lib/video/index.d.ts +5 -0
  302. package/dist/types/lib/video/index.d.ts.map +1 -0
  303. package/dist/types/lib/video/types.d.ts +21 -0
  304. package/dist/types/lib/video/types.d.ts.map +1 -0
  305. package/dist/types/lib/video/writeBox.d.ts +9 -0
  306. package/dist/types/lib/video/writeBox.d.ts.map +1 -0
  307. package/dist/types/lib/video/writeMp4.d.ts +10 -0
  308. package/dist/types/lib/video/writeMp4.d.ts.map +1 -0
  309. package/package.json +105 -4
  310. package/skills/design-motion-frames/SKILL.md +183 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"takeSpan.d.ts","sourceRoot":"","sources":["../../../../src/lib/moment/takeSpan.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAC9B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,GACT,MAAM,CAER"}
@@ -0,0 +1,187 @@
1
+ import type { ActionStep } from "../cast/index.js";
2
+ import type { Timeline } from "../timeline/index.js";
3
+ /** What a page would show as hovered, pressed and focused at one moment of a scene. */
4
+ export interface States {
5
+ /** The selector of what the pointer is over. */
6
+ hover?: string;
7
+ /** The selector of what is being pressed. */
8
+ active?: string;
9
+ /** Where the focus is: the line words are typed into, or the target of a press. */
10
+ focus?: {
11
+ line: true;
12
+ } | {
13
+ on: string;
14
+ };
15
+ /** The selectors of everything pressed so far: a link among them has been followed. */
16
+ visited: string[];
17
+ }
18
+ /** A point in the layer the symbols are drawn in, with the layer's size. */
19
+ export interface Place {
20
+ /** From the layer's left edge, in pixels. */
21
+ x: number;
22
+ /** From the layer's top edge, in pixels. */
23
+ y: number;
24
+ /** The layer's width, in pixels. */
25
+ width: number;
26
+ /** The layer's height, in pixels. */
27
+ height: number;
28
+ }
29
+ /** What a step aims at: an element of the frame in view, and where on it. */
30
+ export type Aim = Pick<ActionStep, "on" | "at">;
31
+ /**
32
+ * Says where an aim lands in the layer. With no element named, or none found, the aim is the screen itself.
33
+ * The second argument is where on the element to land when the aim does not say.
34
+ */
35
+ export type Measure = (aim: Aim, fallback?: [number, number]) => Place;
36
+ /** One symbol drawn over the frame at one moment. Positions are in the layer, in pixels. */
37
+ export type Sprite = {
38
+ kind: "touch";
39
+ x: number;
40
+ y: number;
41
+ /** Whether the finger is down. */
42
+ down: boolean;
43
+ opacity?: number;
44
+ scale?: number;
45
+ /** For a hold: how much of the ring round the finger is filled, from 0 to 100. */
46
+ arc?: number;
47
+ } | {
48
+ kind: "ring";
49
+ x: number;
50
+ y: number;
51
+ /** The small ring of a click, as against the ring of a tap. */
52
+ small: boolean;
53
+ opacity: number;
54
+ scale: number;
55
+ } | {
56
+ kind: "tail";
57
+ x: number;
58
+ y: number;
59
+ /** How long the trail is, in pixels. */
60
+ length: number;
61
+ /** Whether it runs up and down, as against sideways. */
62
+ vertical: boolean;
63
+ /** Whether it fades towards its start, as against its end. */
64
+ reverse: boolean;
65
+ } | {
66
+ kind: "pointer";
67
+ x: number;
68
+ y: number;
69
+ } | {
70
+ kind: "wheel";
71
+ x: number;
72
+ y: number;
73
+ /** How far the mark inside the wheel is moved, in pixels. */
74
+ turn: number;
75
+ } | {
76
+ kind: "key";
77
+ label: string;
78
+ down: boolean;
79
+ opacity: number;
80
+ } | {
81
+ kind: "keys";
82
+ /**
83
+ * The named keys pressed one after another up to this moment, oldest first: the run a sign shows, so a
84
+ * key pressed a moment ago can still be read while the next one comes.
85
+ */
86
+ caps: KeyCap[];
87
+ };
88
+ /** One key of a run of keys, as strong as it is shown. */
89
+ export interface KeyCap {
90
+ /** The key's name, as the step gives it. */
91
+ label: string;
92
+ /** Whether it is being pressed now. */
93
+ down: boolean;
94
+ /** How strongly it shows, from 0 to 1. */
95
+ opacity: number;
96
+ }
97
+ /** One change a step makes to the frame itself at one moment. */
98
+ export type Effect = {
99
+ kind: "carry";
100
+ /** What the finger is on; what is carried is the profile's to say, from there. */
101
+ aim: Aim;
102
+ /** How far it is carried sideways, in pixels. */
103
+ dx: number;
104
+ /** How much of it still shows, when a deep slide fades it. */
105
+ opacity?: number;
106
+ } | {
107
+ kind: "roll";
108
+ /** A selector for what rolls. */
109
+ selector: string;
110
+ /** How far it has moved, in pixels; negative is up. */
111
+ dy: number;
112
+ };
113
+ /**
114
+ * One thing done to the frame's line at one moment: words arriving, a letter taken back, or a key pressed
115
+ * earlier that left the line as it was. A step with words of its own types them at the end of what the line
116
+ * holds; a step with none types the frame's own words into an empty line.
117
+ */
118
+ export interface Typing {
119
+ /** The words, when the step brings its own; the frame's own words otherwise. */
120
+ text?: string;
121
+ /** How much of the words has arrived, from 0 to 1. */
122
+ shown: number;
123
+ /** How many letters a key takes back from the end of what the line holds, in place of typing any. */
124
+ erase?: number;
125
+ /** The name of a key pressed on the frame earlier, which the strip of keystrokes shows by its sign. */
126
+ key?: string;
127
+ }
128
+ /** What the panel beside the screen reads at one moment. */
129
+ export interface Strip {
130
+ /** The short code of the frame in view. */
131
+ code: string;
132
+ /** The name of the frame in view. */
133
+ name: string;
134
+ /** The chapter, or the count of steps. */
135
+ count: string;
136
+ /** The caption. */
137
+ say: string;
138
+ /** The name of the interaction. */
139
+ pattern: string;
140
+ /** How strongly the interaction's name shows, from 0 to 1. */
141
+ patternOpacity: number;
142
+ }
143
+ /** Everything a scene shows at one moment, as data: what to draw, and nothing drawn. */
144
+ export interface Moment {
145
+ /** The step in view. */
146
+ index: number;
147
+ /** How far into it, from 0 to 1. */
148
+ progress: number;
149
+ /** The time, in milliseconds from the start of the scene. */
150
+ time: number;
151
+ /** The name of the frame in view. */
152
+ frame: string;
153
+ /** How strongly the frame shows, from 0 to 1: a frame comes to full strength just after a cut. */
154
+ fade: number;
155
+ /** Words arriving in the frame's line, in the order they are written: the frame's own, then the step's. */
156
+ typing: Typing[];
157
+ /** The symbols over the frame, in the order they are drawn. */
158
+ sprites: Sprite[];
159
+ /** What the step changes in the frame itself. */
160
+ effects: Effect[];
161
+ /** What is hovered, pressed, focused and visited. */
162
+ states: States;
163
+ /** The selector of what a click or a tap in view has pressed, from the press to the end of the step. */
164
+ pressed?: string;
165
+ /** What the panel reads. */
166
+ strip: Strip;
167
+ }
168
+ /** What describing a moment needs to know about the page the scene is drawn on. */
169
+ export interface MomentContext {
170
+ /** The scene laid out in time. */
171
+ timeline: Timeline;
172
+ /** Where an aim lands in the layer. */
173
+ measure: Measure;
174
+ /** Whether the frame's text runs from right to left. */
175
+ rightToLeft: boolean;
176
+ /** The code and the name the panel shows for a frame, by the frame's name. */
177
+ label: (frameName: string) => {
178
+ code: string;
179
+ name: string;
180
+ };
181
+ /** The selectors of what rolls on a scroll by touch and by wheel, when a step names none. */
182
+ scroll: {
183
+ touch: string;
184
+ wheel: string;
185
+ };
186
+ }
187
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/moment/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAErD,uFAAuF;AACvF,MAAM,WAAW,MAAM;IACrB,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mFAAmF;IACnF,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,IAAI,CAAA;KAAE,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC,uFAAuF;IACvF,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,4EAA4E;AAC5E,MAAM,WAAW,KAAK;IACpB,6CAA6C;IAC7C,CAAC,EAAE,MAAM,CAAC;IACV,4CAA4C;IAC5C,CAAC,EAAE,MAAM,CAAC;IACV,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,6EAA6E;AAC7E,MAAM,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,EAAE,IAAI,G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AM,WAAW,MAAM;IACrB,wBAAwB;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,oCAAoC;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,kGAAkG;IAClG,IAAI,EAAE,MAAM,CAAC;IACb,2GAA2G;IAC3G,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,+DAA+D;IAC/D,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,iDAAiD;IACjD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,qDAAqD;IACrD,MAAM,EAAE,MAAM,CAAC;IACf,wGAAwG;IACxG,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4BAA4B;IAC5B,KAAK,EAAE,KAAK,CAAC;CACd;AAED,mFAAmF;AACnF,MAAM,WAAW,aAAa;IAC5B,kCAAkC;IAClC,QAAQ,EAAE,QAAQ,CAAC;IACnB,uCAAuC;IACvC,OAAO,EAAE,OAAO,CAAC;IACjB,wDAAwD;IACxD,WAAW,EAAE,OAAO,CAAC;IACrB,8EAA8E;IAC9E,KAAK,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7D,6FAA6F;IAC7F,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAC1C"}
@@ -0,0 +1,134 @@
1
+ import type { Scene } from "../cast/index.js";
2
+ import { type Timeline } from "../timeline/index.js";
3
+ import type { PlayerContext, TimeMode } from "./types.js";
4
+ /**
5
+ * Plays one scene: a figure with a screen, a layer for the symbols of interactions, a strip that names what is
6
+ * in view, and a bar to play, step and scrub.
7
+ *
8
+ * Every step is drawn from its progress alone. `pose` rebuilds the screen from the frame in view and draws the
9
+ * step at a fraction of its duration, so playing, pausing, stepping and scrubbing are one operation, and any
10
+ * moment can be shown directly.
11
+ *
12
+ * What a moment holds is worked out by `describeMoment`, and when each step happens by the timeline; this
13
+ * class draws the one on the page and runs the clock of the other.
14
+ *
15
+ * @note Impure: it builds and changes elements of the page, and listens to the reader.
16
+ */
17
+ export default class Player {
18
+ /** The scene being played. */
19
+ readonly scene: Scene;
20
+ /** The figure put on the page. */
21
+ readonly root: HTMLElement;
22
+ /** The element that shows the frame in view. */
23
+ readonly screen: HTMLElement;
24
+ /** The scene laid out in time. */
25
+ readonly timeline: Timeline;
26
+ /** How long each step lasts, in milliseconds. */
27
+ readonly durations: number[];
28
+ /** How long the scene lasts, in milliseconds. */
29
+ readonly total: number;
30
+ /** Whether the scene is playing. */
31
+ playing: boolean;
32
+ /** The step in view. */
33
+ at: number;
34
+ /** The moment in view, in milliseconds from the start. */
35
+ clock: number;
36
+ /** How fast the clock runs. */
37
+ speed: number;
38
+ /** The speeds a press of the speed goes through, slowest first. */
39
+ readonly speeds: number[];
40
+ /** Whether the scene starts again at its end; `setLoop` changes it. */
41
+ loop: boolean;
42
+ /** What the time under the clip reads: how far in, how long in all, or how much is left. */
43
+ timeMode: TimeMode;
44
+ /** The step that waits for the reader to do it themselves, when one does. */
45
+ awaiting: number | undefined;
46
+ private readonly frames;
47
+ private readonly profile;
48
+ private readonly context;
49
+ private readonly layer;
50
+ private readonly bar;
51
+ private readonly playButton;
52
+ private readonly timeButton;
53
+ private moment;
54
+ private readonly strip;
55
+ private run;
56
+ private practised;
57
+ /**
58
+ * @param scene - The scene to play. Its first step must show a frame.
59
+ * @param into - The element that receives the figure.
60
+ * @param context - The frames by name, the profile of the page, where the title stands (in a bar above the
61
+ * screen, which is the default, or in the panel below it), the speeds a scene can be played at, what the
62
+ * figure shows beside its screen, whether steps marked for practice wait for the reader, and what to call
63
+ * when the step in view changes or the scene ends.
64
+ * @throws When the scene has no steps or does not start on a frame.
65
+ */
66
+ constructor(scene: Scene, into: HTMLElement, context: PlayerContext);
67
+ /**
68
+ * Gives the screen one height for the whole scene, that of its tallest frame, so nothing jumps between frames.
69
+ * Call it again when fonts arrive or the page changes width.
70
+ */
71
+ fit(): void;
72
+ /**
73
+ * Shows one step at a fraction of its duration.
74
+ *
75
+ * @param index - The step.
76
+ * @param progress - From 0, its start, to 1, its end.
77
+ */
78
+ pose(index: number, progress: number): void;
79
+ /**
80
+ * Shows the moment at a time from the start of the scene.
81
+ *
82
+ * @param time - In milliseconds. Past the end, the last moment is shown.
83
+ */
84
+ poseAt(time: number): void;
85
+ /** Starts the clock. At the end the scene starts again, unless it is set not to loop. */
86
+ play(): void;
87
+ /**
88
+ * Makes the scene start again at its end, or stop there, from now on. The menu's entry says which.
89
+ *
90
+ * @param on - Whether the scene starts again at its end.
91
+ */
92
+ setLoop(on: boolean): void;
93
+ /** Stops the clock where it is. */
94
+ pause(): void;
95
+ /**
96
+ * Goes to the next or the previous keyframe, shown settled, and pauses.
97
+ *
98
+ * @param direction - 1 for the next frame of the sequence, -1 for the previous one. Going back from the middle
99
+ * of an interaction returns first to the frame it started from. Both wrap at the ends.
100
+ */
101
+ goToKeyframe(direction: 1 | -1): void;
102
+ /**
103
+ * Finds what the scene points at that is not there.
104
+ *
105
+ * @returns One sentence per frame that does not exist, and per interaction whose target matches nothing in the
106
+ * frame it acts on.
107
+ */
108
+ audit(): string[];
109
+ /**
110
+ * Stops the scene and takes its figure off the page. The player is of no use afterwards.
111
+ */
112
+ destroy(): void;
113
+ /**
114
+ * Records the scene as an animated GIF, from its first moment to its last, and leaves the player paused where
115
+ * it was.
116
+ *
117
+ * @param onProgress - Called with how far the recording is, from 0 to 1.
118
+ * @returns The bytes of the GIF.
119
+ */
120
+ exportGif(onProgress?: (done: number) => void): Promise<Uint8Array>;
121
+ private part;
122
+ /** What describing a moment needs to know about this page, as it stands now. */
123
+ private describing;
124
+ private waitsAt;
125
+ /** Lets go of a step that was waiting for the reader. */
126
+ private release;
127
+ /** Makes the play button say what a press of it does now. */
128
+ private showPlaying;
129
+ private listen;
130
+ private readLineOf;
131
+ private render;
132
+ private writeTime;
133
+ }
134
+ //# sourceMappingURL=Player.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Player.d.ts","sourceRoot":"","sources":["../../../../src/lib/player/Player.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAOzD,OAAO,EAML,KAAK,QAAQ,EACd,MAAM,sBAAsB,CAAC;AAkB9B,OAAO,KAAK,EAAU,aAAa,EAAW,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3E;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,OAAO,OAAO,MAAM;IACzB,8BAA8B;IAC9B,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,kCAAkC;IAClC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,gDAAgD;IAChD,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,kCAAkC;IAClC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,iDAAiD;IACjD,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC;IAC7B,iDAAiD;IACjD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,oCAAoC;IACpC,OAAO,UAAS;IAChB,wBAAwB;IACxB,EAAE,SAAK;IACP,0DAA0D;IAC1D,KAAK,SAAK;IACV,+BAA+B;IAC/B,KAAK,SAAK;IACV,mEAAmE;IACnE,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;IAC1B,uEAAuE;IACvE,IAAI,EAAE,OAAO,CAAC;IACd,4FAA4F;IAC5F,QAAQ,EAAE,QAAQ,CAAa;IAC/B,6EAA6E;IAC7E,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAE7B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;IAClC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D,OAAO,CAAC,OAAO;IAKf,6DAA6D;IAC7D,OAAO,CAAC,WAAW;IASnB,OAAO,CAAC,MAAM;IAoFd,OAAO,CAAC,UAAU;IASlB,OAAO,CAAC,MAAM;IAad,OAAO,CAAC,SAAS;CAQlB"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Tells the page that embeds this one how tall its content is: now, whenever that changes, and whenever the
3
+ * embedding page asks. The embedding page can then give its iframe the right height. The other side is
4
+ * `fitEmbeds`, which asks when it starts, so it does not matter which of the two pages is ready first.
5
+ *
6
+ * @param element - The element whose height is the content's; the document's root, usually.
7
+ * @param target - The window to tell; the parent, usually.
8
+ * @returns A function that stops telling.
9
+ * @note Impure: it observes the element, listens to the window, and posts messages to another window.
10
+ */
11
+ export default function announceHeight(element: HTMLElement, target?: Window): () => void;
12
+ //# sourceMappingURL=announceHeight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"announceHeight.d.ts","sourceRoot":"","sources":["../../../../src/lib/player/announceHeight.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,OAAO,EAAE,WAAW,EACpB,MAAM,GAAE,MAAsB,GAC7B,MAAM,IAAI,CAmBZ"}
@@ -0,0 +1,21 @@
1
+ import type { Moment } from "../moment/index.js";
2
+ import type { Applied, Outline, Profile } from "./types.js";
3
+ /**
4
+ * Makes a frame show one moment: the words typed so far, what a step carries or rolls, and the marks for what
5
+ * is hovered, pressed, focused and visited.
6
+ *
7
+ * Every change is one the returned function takes back, so a frame that is not drawn afresh for each moment, a
8
+ * part of a living page for instance, can be brought back to how it was before the next moment is applied.
9
+ *
10
+ * @param screen - The element that holds the frame.
11
+ * @param moment - The moment to show.
12
+ * @param profile - What the page says about its frames: where words go, what a slide carries, what stays in
13
+ * place on a scroll.
14
+ * @param outline - What to outline while a step acts on it: what keys go to, unless `keys` is false, and what
15
+ * a click or a tap presses, when `click` is true.
16
+ * @returns Whether words are still arriving in the frame's line, what was typed and pressed on the frame so
17
+ * far, the line, and a function that takes every change back.
18
+ * @note Impure: it changes the frame's elements.
19
+ */
20
+ export default function applyMoment(screen: HTMLElement, moment: Moment, profile: Profile, outline?: Outline): Applied;
21
+ //# sourceMappingURL=applyMoment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"applyMoment.d.ts","sourceRoot":"","sources":["../../../../src/lib/player/applyMoment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AASjD,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CACjC,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,OAAO,GAAE,OAAY,GACpB,OAAO,CA4IT"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Asserts that a value is there.
3
+ *
4
+ * @param value - The value.
5
+ * @param what - What it is, for the message when it is missing.
6
+ * @returns The value, known to be present.
7
+ * @throws When the value is null or undefined.
8
+ */
9
+ export default function assertPresent<T>(value: T | null | undefined, what: string): T;
10
+ //# sourceMappingURL=assertPresent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertPresent.d.ts","sourceRoot":"","sources":["../../../../src/lib/player/assertPresent.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,CAAC,EACrC,KAAK,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,EAC3B,IAAI,EAAE,MAAM,GACX,CAAC,CAGH"}
@@ -0,0 +1,11 @@
1
+ import type { FrameMeta, Frames, Profile } from "./types.js";
2
+ /**
3
+ * Collects the frames of a page: every element with `data-frame`, under its name and under its `data-code`.
4
+ *
5
+ * @param root - Where to look.
6
+ * @param meta - What the page says about frames beyond their own attributes, by id.
7
+ * @param profile - How to tell a frame's shell, and the class that flags a frame as later.
8
+ * @returns The frames by every name they answer to.
9
+ */
10
+ export default function collectFrames(root: ParentNode, meta?: FrameMeta[], profile?: Pick<Profile, "laterClass" | "deviceOf">): Frames;
11
+ //# sourceMappingURL=collectFrames.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collectFrames.d.ts","sourceRoot":"","sources":["../../../../src/lib/player/collectFrames.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE7D;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CACnC,IAAI,EAAE,UAAU,EAChB,IAAI,GAAE,SAAS,EAAO,EACtB,OAAO,GAAE,IAAI,CAAC,OAAO,EAAE,YAAY,GAAG,UAAU,CAAkB,GACjE,MAAM,CAkBR"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Gathers the text of every style rule a document applies, so a part of the page can be drawn elsewhere with
3
+ * the same rules.
4
+ *
5
+ * A stylesheet served by another site does not let its rules be read; it is passed over, and whatever it
6
+ * styled, a web font above all, falls back to the browser's own.
7
+ *
8
+ * @param from - The document.
9
+ * @returns The text of each top-level rule, in order.
10
+ */
11
+ export default function collectStyles(from: Document): string[];
12
+ //# sourceMappingURL=collectStyles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collectStyles.d.ts","sourceRoot":"","sources":["../../../../src/lib/player/collectStyles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,EAAE,CAU9D"}
@@ -0,0 +1,80 @@
1
+ /** The mouse pointer, drawn in the interaction layer's own colour with an edge in the ground's colour. */
2
+ export declare const POINTER_SVG = "<svg viewBox=\"0 0 18 26\" width=\"18\" height=\"26\" aria-hidden=\"true\"><path d=\"M1.5 1.5v19l4.6-4.3 3.3 7.6 3-1.3-3.3-7.5h6.4z\" fill=\"var(--mo, #6a35e8)\" stroke=\"var(--mo-paper, #fff)\" stroke-width=\"1.5\" stroke-linejoin=\"round\"/></svg>";
3
+ /** The ring that fills while a finger holds. Its dash array is set to the part that is full. */
4
+ export declare const ARC_SVG = "<svg viewBox=\"0 0 36 36\"><circle cx=\"18\" cy=\"18\" r=\"16\" pathLength=\"100\" stroke-dasharray=\"0 100\"/></svg>";
5
+ /** The type of the message an embedded page posts to say how tall its content is. */
6
+ export declare const HEIGHT_MESSAGE = "motion:height";
7
+ /** The type of the message an embedding page posts to ask an embedded page for its height. */
8
+ export declare const MEASURE_MESSAGE = "motion:measure";
9
+ /** The readings the time goes through when pressed, in order; the first is the one shown at the start. */
10
+ export declare const TIME_MODES: readonly ["elapsed", "total", "remaining"];
11
+ /** What the play button shows while the scene is still: a press plays it. A drawing, so it is the same size on every system. */
12
+ export declare const PLAY_SIGN = "<svg viewBox=\"0 0 8 8\" aria-hidden=\"true\"><path d=\"M1 0.5 7.5 4 1 7.5z\"/></svg>";
13
+ /** What the play button shows while the scene plays: a press stops it. */
14
+ export declare const PAUSE_SIGN = "<svg viewBox=\"0 0 8 8\" aria-hidden=\"true\"><path d=\"M1 0.5h2v7H1zM5 0.5h2v7H5z\"/></svg>";
15
+ /**
16
+ * The states a page styles through a pointer or through focus, and the mark the player sets in place of each.
17
+ * A frame can carry a mark in its own markup, to be drawn in that state from the start.
18
+ */
19
+ export declare const STATE_MARKS: {
20
+ readonly hover: "data-mo-hover";
21
+ readonly active: "data-mo-active";
22
+ readonly focus: "data-mo-focus";
23
+ readonly "focus-visible": "data-mo-focus-visible";
24
+ readonly "focus-within": "data-mo-focus-within";
25
+ readonly visited: "data-mo-visited";
26
+ };
27
+ /** How far the box of an outline stands from what it outlines, in pixels. */
28
+ export declare const OUTLINE_GAP = 3;
29
+ /** The mark on what a step acts on and the page asked to see outlined: what keys go to, what a click presses. */
30
+ export declare const OUTLINE_MARK = "data-mo-outline";
31
+ /** What can hold the focus, as a browser has it. */
32
+ export declare const FOCUSABLE = "a[href], button, input, select, textarea, summary, [tabindex], [contenteditable=\"\"], [contenteditable=\"true\"]";
33
+ /** What a press can make visited: a link that leads somewhere. */
34
+ export declare const VISITABLE = "a[href], area[href]";
35
+ /** What shows its focus even when the focus came from a press: the places a reader types into. */
36
+ export declare const TYPED_INTO = "textarea, [contenteditable=\"\"], [contenteditable=\"true\"], input:not([type=\"button\"], [type=\"checkbox\"], [type=\"radio\"], [type=\"submit\"], [type=\"reset\"], [type=\"range\"], [type=\"color\"], [type=\"file\"], [type=\"image\"])";
37
+ /** How far into a step that waits for the reader the scene stops: the symbol has arrived and not yet pressed. */
38
+ export declare const PRACTICE_AT = 0.3;
39
+ /** The signs keyboards print on keys that have no letter, by the key's name in lower case. */
40
+ export declare const KEY_SIGNS: Readonly<Record<string, string>>;
41
+ /** How many of the last letters typed the bar of keys shows. */
42
+ export declare const KEYS_SHOWN = 18;
43
+ /** The sections of a figure a page can show or hide, and the parts of each it can choose among. */
44
+ export declare const SECTION_PARTS: {
45
+ readonly title: readonly ["kind", "about", "menu"];
46
+ readonly caption: readonly ["code", "frame", "interaction", "count", "words"];
47
+ readonly timeline: readonly ["steps", "bar", "speed", "time"];
48
+ };
49
+ /** How many pictures a second a recording takes. Enough to follow a gesture; few enough for a small file. */
50
+ export declare const GIF_FPS = 10;
51
+ /** A slide's padding, in hundredths of its height. */
52
+ export declare const SLIDE_PADDING = 6;
53
+ /** The height of a slide's title line, in hundredths of the slide's height. */
54
+ export declare const SLIDE_TITLE_LINE = 6;
55
+ /** The height of a slide's caption line, in hundredths of the slide's height. */
56
+ export declare const SLIDE_CAPTION_LINE = 4.5;
57
+ /** The space between the stage and a slide's title or caption, in hundredths of the slide's height. */
58
+ export declare const SLIDE_GAP = 3;
59
+ /** The part of a figure a bare slide shows: the screen, with the symbols over it. */
60
+ export declare const SLIDE_BARE = ".mo-stage";
61
+ /** How many pictures a second a video takes when none is asked for. */
62
+ export declare const VIDEO_FPS = 30;
63
+ /**
64
+ * The H.264 profile and level a video is encoded with: High, at level 5.2, which takes pictures up to 4096 by
65
+ * 2304 and a little beyond at the usual rates, and which presentation software and players decode.
66
+ */
67
+ export declare const H264_CODEC = "avc1.640034";
68
+ /** How many bits a picture's pixel is given, on average: enough for the flat colours of an interface. */
69
+ export declare const VIDEO_BITS_PER_PIXEL = 0.08;
70
+ /** How often a video carries a picture a player can start from, in seconds. */
71
+ export declare const KEY_EVERY = 2;
72
+ /** The parts of a figure a recording leaves out: the controls, which nobody can press in a picture. */
73
+ export declare const RECORDING_OMITS = ".mo-opt, .mo-nav, .mo-tl, .mo-read, .mo-foot";
74
+ /** The speeds a scene can be played at when a page names none: half, as written, and double. */
75
+ export declare const SPEEDS: number[];
76
+ /** How much of a figure must be in view for it to play, as a fraction. */
77
+ export declare const IN_VIEW = 0.3;
78
+ /** How long to wait after the window stops changing size before fitting again, in milliseconds. */
79
+ export declare const REFIT_DELAY = 150;
80
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/lib/player/constants.ts"],"names":[],"mappings":"AAAA,0GAA0G;AAC1G,eAAO,MAAM,WAAW,8PACmN,CAAC;AAE5O,gGAAgG;AAChG,eAAO,MAAM,OAAO,0HACyF,CAAC;AAE9G,qFAAqF;AACrF,eAAO,MAAM,cAAc,kBAAkB,CAAC;AAE9C,8FAA8F;AAC9F,eAAO,MAAM,eAAe,mBAAmB,CAAC;AAEhD,0GAA0G;AAC1G,eAAO,MAAM,UAAU,YAAI,SAAS,EAAE,OAAO,EAAE,WAAW,CAAU,CAAC;AAErE,gIAAgI;AAChI,eAAO,MAAM,SAAS,0FAC6D,CAAC;AAEpF,0EAA0E;AAC1E,eAAO,MAAM,UAAU,iGACmE,CAAC;AAE3F;;;GAGG;AACH,eAAO,MAAM,WAAW;aACtB,KAAK,EAAE,eAAe;aACtB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G;AACH,eAAO,MAAM,UAAU,gBAAgB,CAAC;AAExC,yGAAyG;AACzG,eAAO,MAAM,oBAAoB,OAAO,CAAC;AAEzC,+EAA+E;AAC/E,eAAO,MAAM,SAAS,IAAI,CAAC;AAE3B,uGAAuG;AACvG,eAAO,MAAM,eAAe,iDAAiD,CAAC;AAE9E,gGAAgG;AAChG,eAAO,MAAM,MAAM,UAAc,CAAC;AAElC,0EAA0E;AAC1E,eAAO,MAAM,OAAO,MAAM,CAAC;AAE3B,mGAAmG;AACnG,eAAO,MAAM,WAAW,MAAM,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { Profile } from "./types.js";
2
+ /**
3
+ * What the player assumes about frames when a page says nothing else: plain shells, typing into an input or an
4
+ * element marked `data-mo-line`, the whole content rolling on a scroll, and nothing staying in place.
5
+ */
6
+ declare const defaultProfile: Profile;
7
+ export default defaultProfile;
8
+ //# sourceMappingURL=defaultProfile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultProfile.d.ts","sourceRoot":"","sources":["../../../../src/lib/player/defaultProfile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C;;;GAGG;AACH,QAAA,MAAM,cAAc,EAAE,OA8CrB,CAAC;eAEa,cAAc"}
@@ -0,0 +1,15 @@
1
+ import type { Drawing } from "./types.js";
2
+ /**
3
+ * Draws markup to pixels, without any library: the markup is set inside an SVG image with the page's style
4
+ * rules beside it, the browser draws the image, and the pixels are read back from a canvas.
5
+ *
6
+ * An image may load nothing from outside itself, so a font or a picture the rules fetch from elsewhere is not
7
+ * drawn; text then shows in a font the browser already has.
8
+ *
9
+ * @param drawing - The markup, the rules, the size, and the root's attributes.
10
+ * @returns The pixels, four bytes each: red, green, blue, alpha.
11
+ * @throws When the browser gives no canvas to draw on, or cannot read the image.
12
+ * @note Impure: it creates an image and a canvas.
13
+ */
14
+ export default function drawMarkup(drawing: Drawing): Promise<Uint8ClampedArray>;
15
+ //# sourceMappingURL=drawMarkup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drawMarkup.d.ts","sourceRoot":"","sources":["../../../../src/lib/player/drawMarkup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAK1C;;;;;;;;;;;GAWG;AACH,wBAA8B,UAAU,CACtC,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,iBAAiB,CAAC,CAqB5B"}
@@ -0,0 +1,23 @@
1
+ import type { Slide } from "./types.js";
2
+ /** What a recorder draws for one moment: the markup, and the size it is drawn at. */
3
+ export interface SceneDrawing {
4
+ markup: string;
5
+ width: number;
6
+ height: number;
7
+ }
8
+ /**
9
+ * Writes what a recorder draws of a figure at one moment: the figure without its controls, or, for a slide, the
10
+ * figure or its screen set on the slide.
11
+ *
12
+ * @param figure - The figure, showing the moment.
13
+ * @param options - The slide to set it on, and the size asked, when there are.
14
+ * @returns The markup, and the size to draw it at: the slide's, the size asked, or the figure's own.
15
+ */
16
+ export default function drawScene(figure: HTMLElement, options: {
17
+ slide?: Slide;
18
+ size?: {
19
+ width: number;
20
+ height: number;
21
+ };
22
+ }): SceneDrawing;
23
+ //# sourceMappingURL=drawScene.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drawScene.d.ts","sourceRoot":"","sources":["../../../../src/lib/player/drawScene.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGxC,qFAAqF;AACrF,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE;IAAE,KAAK,CAAC,EAAE,KAAK,CAAC;IAAC,IAAI,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,GACnE,YAAY,CAyBd"}
@@ -0,0 +1,35 @@
1
+ import type { Sprite } from "../moment/index.js";
2
+ import type { KeysMode } from "./types.js";
3
+ /** What `drawSprites` may be told about the keys of the moment. */
4
+ interface KeysDrawn {
5
+ /** Whether words are arriving in the frame's line. */
6
+ typing: boolean;
7
+ /** What was typed and pressed on the frame so far: letters as they are, keys by their sign. */
8
+ strokes: string;
9
+ /** How keys are shown: a sign, when left out, or the letters themselves. */
10
+ keys?: KeysMode;
11
+ /**
12
+ * The frame's line, to stand the keys shown as letters just over it: a strip on the line would hide the words
13
+ * it is about. With no line, the strip stands at the foot of the screen.
14
+ */
15
+ line?: HTMLElement | null;
16
+ /** What to outline, each with a box drawn round it, in the colour of the interactions. */
17
+ outlined: HTMLElement[];
18
+ }
19
+ /**
20
+ * Draws the symbols of one moment into the layer over a screen, in place of whatever the layer held.
21
+ *
22
+ * Keys come last. As a sign, typing is a small mark that words are arriving, and a named key a keycap in a
23
+ * corner. As letters, both are one strip of keystrokes, the way a recording of a screen shows them: the mark,
24
+ * then what was typed and pressed on the frame, keys by their sign so a typo taken back reads `bikr⌫e`, the
25
+ * newest marked; a key being pressed stands at the end as a cap with its name. The strip stands just over the
26
+ * frame's line, so the words being typed stay in view; how far over is the stylesheet's `--mo-keys-gap`.
27
+ *
28
+ * @param layer - The element laid over the screen.
29
+ * @param sprites - The symbols, in the order they are drawn.
30
+ * @param drawn - Whether words are arriving, what was typed and pressed, how keys are shown, and what to outline.
31
+ * @note Impure: it replaces the layer's children.
32
+ */
33
+ export default function drawSprites(layer: HTMLElement, sprites: Sprite[], drawn?: KeysDrawn): void;
34
+ export {};
35
+ //# sourceMappingURL=drawSprites.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drawSprites.d.ts","sourceRoot":"","sources":["../../../../src/lib/player/drawSprites.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAKzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAgF3C,mEAAmE;AACnE,UAAU,SAAS;IACjB,sDAAsD;IACtD,MAAM,EAAE,OAAO,CAAC;IAChB,+FAA+F;IAC/F,OAAO,EAAE,MAAM,CAAC;IAChB,4EAA4E;IAC5E,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;;OAGG;IACH,IAAI,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC1B,0FAA0F;IAC1F,QAAQ,EAAE,WAAW,EAAE,CAAC;CACzB;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CACjC,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,MAAM,EAAE,EACjB,KAAK,GAAE,SAAwD,GAC9D,IAAI,CA0DN"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Gives each iframe the height its page announces, so an embedded clip takes exactly the room it needs and
3
+ * never scrolls inside its frame. The other side is `announceHeight`, or `mountScenes` with `embedded`.
4
+ *
5
+ * It asks every iframe for its height when it starts and each time an iframe loads, so it does not matter which
6
+ * of the two pages is ready first.
7
+ *
8
+ * @param root - Where the iframes are.
9
+ * @returns A function that stops listening.
10
+ * @note Impure: it listens to the window and to iframes, posts messages to them, and sets their height.
11
+ */
12
+ export default function fitEmbeds(root?: ParentNode): () => void;
13
+ //# sourceMappingURL=fitEmbeds.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fitEmbeds.d.ts","sourceRoot":"","sources":["../../../../src/lib/player/fitEmbeds.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,IAAI,GAAE,UAAqB,GAAG,MAAM,IAAI,CA2BzE"}