@allyhub/sdk 0.1.0-alpha.7 → 0.2.0-next.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 (370) hide show
  1. package/NOTICE +85 -0
  2. package/client.d.ts +45 -1
  3. package/dist/anim.js +2 -75
  4. package/dist/define.d.ts +10 -4
  5. package/dist/define.js +2 -95
  6. package/dist/dom.d.ts +1 -1
  7. package/dist/dom.js +2 -457
  8. package/dist/fit.js +2 -60
  9. package/dist/free.d.ts +18 -0
  10. package/dist/free.js +2 -0
  11. package/dist/index.d.ts +28 -13
  12. package/dist/index.js +2 -11
  13. package/dist/input.d.ts +306 -0
  14. package/dist/input.js +2 -0
  15. package/dist/media.d.ts +3 -6
  16. package/dist/media.js +2 -27
  17. package/dist/messages.d.ts +3 -2
  18. package/dist/messages.js +2 -2
  19. package/dist/module.d.ts +24 -0
  20. package/dist/module.js +2 -0
  21. package/dist/noise.js +2 -233
  22. package/dist/parts.d.ts +97 -21
  23. package/dist/parts.js +2 -414
  24. package/dist/paths.d.ts +1 -1
  25. package/dist/paths.js +2 -720
  26. package/dist/phone.d.ts +26 -0
  27. package/dist/phone.js +2 -0
  28. package/dist/piece.d.ts +106 -35
  29. package/dist/piece.js +2 -38
  30. package/dist/props.d.ts +1 -1
  31. package/dist/props.js +2 -35
  32. package/dist/scenery.d.ts +2 -0
  33. package/dist/scenery.js +2 -0
  34. package/dist/text.js +2 -38
  35. package/dist/written.d.ts +12 -0
  36. package/dist/written.js +2 -0
  37. package/docs/README.md +18 -0
  38. package/docs/batches.md +148 -0
  39. package/docs/contract.md +51 -0
  40. package/docs/defaults.md +703 -0
  41. package/docs/docs.md +148 -0
  42. package/docs/footage.md +249 -0
  43. package/docs/layers.md +317 -0
  44. package/docs/modeling.md +143 -0
  45. package/docs/project.md +265 -0
  46. package/docs/scenery.md +308 -0
  47. package/docs/sheets.md +119 -0
  48. package/docs/slides.md +111 -0
  49. package/docs/sound.md +170 -0
  50. package/docs/speech.md +289 -0
  51. package/docs/video.md +265 -0
  52. package/node_modules/@allyhub-next/audio/dist/at-cut.d.ts +52 -0
  53. package/node_modules/@allyhub-next/audio/dist/at-cut.js +2 -0
  54. package/node_modules/@allyhub-next/audio/dist/decode.d.ts +33 -0
  55. package/node_modules/@allyhub-next/audio/dist/decode.js +2 -0
  56. package/node_modules/@allyhub-next/audio/dist/envelope.d.ts +37 -0
  57. package/node_modules/@allyhub-next/audio/dist/envelope.js +2 -0
  58. package/node_modules/@allyhub-next/audio/dist/index.d.ts +17 -0
  59. package/node_modules/@allyhub-next/audio/dist/index.js +2 -0
  60. package/node_modules/@allyhub-next/audio/dist/levels.d.ts +97 -0
  61. package/node_modules/@allyhub-next/audio/dist/levels.js +2 -0
  62. package/node_modules/@allyhub-next/audio/dist/master.d.ts +29 -0
  63. package/node_modules/@allyhub-next/audio/dist/master.js +2 -0
  64. package/node_modules/@allyhub-next/audio/dist/music.d.ts +11 -0
  65. package/node_modules/@allyhub-next/audio/dist/music.js +2 -0
  66. package/node_modules/@allyhub-next/audio/dist/node/decode.d.ts +39 -0
  67. package/node_modules/@allyhub-next/audio/dist/node/decode.js +2 -0
  68. package/node_modules/@allyhub-next/audio/dist/node/ebur128.d.ts +25 -0
  69. package/node_modules/@allyhub-next/audio/dist/node/ebur128.js +2 -0
  70. package/node_modules/@allyhub-next/audio/dist/node/ffmpeg.d.ts +31 -0
  71. package/node_modules/@allyhub-next/audio/dist/node/ffmpeg.js +2 -0
  72. package/node_modules/@allyhub-next/audio/dist/node/index.d.ts +8 -0
  73. package/node_modules/@allyhub-next/audio/dist/node/index.js +2 -0
  74. package/node_modules/@allyhub-next/audio/dist/node/loudness.d.ts +18 -0
  75. package/node_modules/@allyhub-next/audio/dist/node/loudness.js +2 -0
  76. package/node_modules/@allyhub-next/audio/dist/node/master.d.ts +42 -0
  77. package/node_modules/@allyhub-next/audio/dist/node/master.js +2 -0
  78. package/node_modules/@allyhub-next/audio/dist/node/measure.d.ts +60 -0
  79. package/node_modules/@allyhub-next/audio/dist/node/measure.js +2 -0
  80. package/node_modules/@allyhub-next/audio/dist/node/mix.d.ts +31 -0
  81. package/node_modules/@allyhub-next/audio/dist/node/mix.js +2 -0
  82. package/node_modules/@allyhub-next/audio/dist/plan.d.ts +143 -0
  83. package/node_modules/@allyhub-next/audio/dist/plan.js +2 -0
  84. package/node_modules/@allyhub-next/audio/dist/recorded.d.ts +26 -0
  85. package/node_modules/@allyhub-next/audio/dist/recorded.js +2 -0
  86. package/node_modules/@allyhub-next/audio/dist/recording/bandwidth.d.ts +47 -0
  87. package/node_modules/@allyhub-next/audio/dist/recording/bandwidth.js +2 -0
  88. package/node_modules/@allyhub-next/audio/dist/recording/chain.d.ts +89 -0
  89. package/node_modules/@allyhub-next/audio/dist/recording/chain.js +2 -0
  90. package/node_modules/@allyhub-next/audio/dist/recording/dynamics.d.ts +64 -0
  91. package/node_modules/@allyhub-next/audio/dist/recording/dynamics.js +2 -0
  92. package/node_modules/@allyhub-next/audio/dist/recording/fft.d.ts +26 -0
  93. package/node_modules/@allyhub-next/audio/dist/recording/fft.js +2 -0
  94. package/node_modules/@allyhub-next/audio/dist/recording/filters.d.ts +42 -0
  95. package/node_modules/@allyhub-next/audio/dist/recording/filters.js +2 -0
  96. package/node_modules/@allyhub-next/audio/dist/recording/fit.d.ts +56 -0
  97. package/node_modules/@allyhub-next/audio/dist/recording/fit.js +2 -0
  98. package/node_modules/@allyhub-next/audio/dist/recording/index.d.ts +10 -0
  99. package/node_modules/@allyhub-next/audio/dist/recording/index.js +2 -0
  100. package/node_modules/@allyhub-next/audio/dist/recording/loudness.d.ts +12 -0
  101. package/node_modules/@allyhub-next/audio/dist/recording/loudness.js +2 -0
  102. package/node_modules/@allyhub-next/audio/dist/recording/measure.d.ts +67 -0
  103. package/node_modules/@allyhub-next/audio/dist/recording/measure.js +2 -0
  104. package/node_modules/@allyhub-next/audio/dist/recording/mic.d.ts +32 -0
  105. package/node_modules/@allyhub-next/audio/dist/recording/mic.js +2 -0
  106. package/node_modules/@allyhub-next/audio/dist/recording/noise.d.ts +27 -0
  107. package/node_modules/@allyhub-next/audio/dist/recording/noise.js +2 -0
  108. package/node_modules/@allyhub-next/audio/dist/recording/presets.d.ts +64 -0
  109. package/node_modules/@allyhub-next/audio/dist/recording/presets.js +2 -0
  110. package/node_modules/@allyhub-next/audio/dist/recording/room.d.ts +78 -0
  111. package/node_modules/@allyhub-next/audio/dist/recording/room.js +2 -0
  112. package/node_modules/@allyhub-next/audio/dist/recording/setup.d.ts +111 -0
  113. package/node_modules/@allyhub-next/audio/dist/recording/setup.js +2 -0
  114. package/node_modules/@allyhub-next/audio/dist/recording/vec.d.ts +3 -0
  115. package/node_modules/@allyhub-next/audio/dist/recording/vec.js +2 -0
  116. package/node_modules/@allyhub-next/audio/dist/render.d.ts +26 -0
  117. package/node_modules/@allyhub-next/audio/dist/render.js +2 -0
  118. package/node_modules/@allyhub-next/audio/dist/sfx.d.ts +10 -0
  119. package/node_modules/@allyhub-next/audio/dist/sfx.js +2 -0
  120. package/node_modules/@allyhub-next/audio/dist/shape.d.ts +118 -0
  121. package/node_modules/@allyhub-next/audio/dist/shape.js +2 -0
  122. package/node_modules/@allyhub-next/audio/dist/voice.d.ts +45 -0
  123. package/node_modules/@allyhub-next/audio/dist/voice.js +2 -0
  124. package/node_modules/@allyhub-next/audio/package.json +17 -0
  125. package/node_modules/@allyhub-next/formats/dist/data/comments.d.ts +94 -0
  126. package/node_modules/@allyhub-next/formats/dist/data/comments.js +2 -0
  127. package/node_modules/@allyhub-next/formats/dist/data/config.d.ts +10 -0
  128. package/node_modules/@allyhub-next/formats/dist/data/config.js +2 -0
  129. package/node_modules/@allyhub-next/formats/dist/data/edits.d.ts +28 -0
  130. package/node_modules/@allyhub-next/formats/dist/data/edits.js +2 -0
  131. package/node_modules/@allyhub-next/formats/dist/data/elements.d.ts +6 -0
  132. package/node_modules/@allyhub-next/formats/dist/data/elements.js +2 -0
  133. package/node_modules/@allyhub-next/formats/dist/data/faces.d.ts +38 -0
  134. package/node_modules/@allyhub-next/formats/dist/data/faces.js +2 -0
  135. package/node_modules/@allyhub-next/formats/dist/data/file.d.ts +11 -0
  136. package/node_modules/@allyhub-next/formats/dist/data/file.js +2 -0
  137. package/node_modules/@allyhub-next/formats/dist/data/gen.d.ts +31 -0
  138. package/node_modules/@allyhub-next/formats/dist/data/gen.js +2 -0
  139. package/node_modules/@allyhub-next/formats/dist/data/messages.d.ts +34 -0
  140. package/node_modules/@allyhub-next/formats/dist/data/messages.js +2 -0
  141. package/node_modules/@allyhub-next/formats/dist/data/reference.d.ts +676 -0
  142. package/node_modules/@allyhub-next/formats/dist/data/reference.js +2 -0
  143. package/node_modules/@allyhub-next/formats/dist/data/script.d.ts +37 -0
  144. package/node_modules/@allyhub-next/formats/dist/data/script.js +2 -0
  145. package/node_modules/@allyhub-next/formats/dist/data/sheet.d.ts +214 -0
  146. package/node_modules/@allyhub-next/formats/dist/data/sheet.js +2 -0
  147. package/node_modules/@allyhub-next/formats/dist/data/words.d.ts +25 -0
  148. package/node_modules/@allyhub-next/formats/dist/data/words.js +2 -0
  149. package/node_modules/@allyhub-next/formats/dist/index.d.ts +16 -0
  150. package/node_modules/@allyhub-next/formats/dist/index.js +2 -0
  151. package/node_modules/@allyhub-next/formats/dist/items.d.ts +94 -0
  152. package/node_modules/@allyhub-next/formats/dist/items.js +2 -0
  153. package/node_modules/@allyhub-next/formats/dist/layout.d.ts +50 -0
  154. package/node_modules/@allyhub-next/formats/dist/layout.js +5 -0
  155. package/node_modules/@allyhub-next/formats/dist/schemas.d.ts +301 -0
  156. package/node_modules/@allyhub-next/formats/dist/schemas.js +2 -0
  157. package/node_modules/@allyhub-next/formats/package.json +14 -0
  158. package/node_modules/@allyhub-next/formats/schemas/comments.schema.json +152 -0
  159. package/node_modules/@allyhub-next/formats/schemas/config.schema.json +43 -0
  160. package/node_modules/@allyhub-next/formats/schemas/edits.schema.json +112 -0
  161. package/node_modules/@allyhub-next/formats/schemas/elements.schema.json +33 -0
  162. package/node_modules/@allyhub-next/formats/schemas/gen.schema.json +97 -0
  163. package/node_modules/@allyhub-next/formats/schemas/interpretation.schema.json +125 -0
  164. package/node_modules/@allyhub-next/formats/schemas/items.json +75 -0
  165. package/node_modules/@allyhub-next/formats/schemas/messages.schema.json +11 -0
  166. package/node_modules/@allyhub-next/formats/schemas/script.schema.json +162 -0
  167. package/node_modules/@allyhub-next/formats/schemas/sheet.schema.json +395 -0
  168. package/node_modules/@allyhub-next/formats/schemas/words.schema.json +63 -0
  169. package/node_modules/@allyhub-next/protocol/dist/app.d.ts +98 -0
  170. package/node_modules/@allyhub-next/protocol/dist/app.js +2 -0
  171. package/node_modules/@allyhub-next/protocol/dist/auth.d.ts +116 -0
  172. package/node_modules/@allyhub-next/protocol/dist/auth.js +2 -0
  173. package/node_modules/@allyhub-next/protocol/dist/cli.d.ts +59 -0
  174. package/node_modules/@allyhub-next/protocol/dist/cli.js +2 -0
  175. package/node_modules/@allyhub-next/protocol/dist/cloud.d.ts +272 -0
  176. package/node_modules/@allyhub-next/protocol/dist/cloud.js +2 -0
  177. package/node_modules/@allyhub-next/protocol/dist/editor.d.ts +405 -0
  178. package/node_modules/@allyhub-next/protocol/dist/editor.js +2 -0
  179. package/node_modules/@allyhub-next/protocol/dist/files.d.ts +101 -0
  180. package/node_modules/@allyhub-next/protocol/dist/files.js +2 -0
  181. package/node_modules/@allyhub-next/protocol/dist/index.d.ts +12 -0
  182. package/node_modules/@allyhub-next/protocol/dist/index.js +2 -0
  183. package/node_modules/@allyhub-next/protocol/dist/jsonrpc.d.ts +83 -0
  184. package/node_modules/@allyhub-next/protocol/dist/jsonrpc.js +2 -0
  185. package/node_modules/@allyhub-next/protocol/dist/registry.d.ts +53 -0
  186. package/node_modules/@allyhub-next/protocol/dist/registry.js +2 -0
  187. package/node_modules/@allyhub-next/protocol/dist/runtimes.d.ts +93 -0
  188. package/node_modules/@allyhub-next/protocol/dist/runtimes.js +2 -0
  189. package/node_modules/@allyhub-next/protocol/dist/teams.d.ts +67 -0
  190. package/node_modules/@allyhub-next/protocol/dist/teams.js +2 -0
  191. package/node_modules/@allyhub-next/protocol/dist/tools.d.ts +345 -0
  192. package/node_modules/@allyhub-next/protocol/dist/tools.js +2 -0
  193. package/node_modules/@allyhub-next/protocol/package.json +13 -0
  194. package/node_modules/@allyhub-next/runtimes/dist/bundled.d.ts +10 -0
  195. package/node_modules/@allyhub-next/runtimes/dist/bundled.js +2 -0
  196. package/node_modules/@allyhub-next/runtimes/dist/download.d.ts +15 -0
  197. package/node_modules/@allyhub-next/runtimes/dist/download.js +2 -0
  198. package/node_modules/@allyhub-next/runtimes/dist/errors.d.ts +16 -0
  199. package/node_modules/@allyhub-next/runtimes/dist/errors.js +2 -0
  200. package/node_modules/@allyhub-next/runtimes/dist/home.d.ts +2 -0
  201. package/node_modules/@allyhub-next/runtimes/dist/home.js +2 -0
  202. package/node_modules/@allyhub-next/runtimes/dist/index.d.ts +9 -0
  203. package/node_modules/@allyhub-next/runtimes/dist/index.js +2 -0
  204. package/node_modules/@allyhub-next/runtimes/dist/lock.d.ts +6 -0
  205. package/node_modules/@allyhub-next/runtimes/dist/lock.js +2 -0
  206. package/node_modules/@allyhub-next/runtimes/dist/manifest.d.ts +3 -0
  207. package/node_modules/@allyhub-next/runtimes/dist/manifest.js +2 -0
  208. package/node_modules/@allyhub-next/runtimes/dist/runtimes.d.ts +63 -0
  209. package/node_modules/@allyhub-next/runtimes/dist/runtimes.js +3 -0
  210. package/node_modules/@allyhub-next/runtimes/dist/unpack.d.ts +7 -0
  211. package/node_modules/@allyhub-next/runtimes/dist/unpack.js +2 -0
  212. package/node_modules/@allyhub-next/runtimes/manifest.json +395 -0
  213. package/node_modules/@allyhub-next/runtimes/package.json +14 -0
  214. package/node_modules/@allyhub-next/runtimes/schemas/runtimes.schema.json +153 -0
  215. package/node_modules/@allyhub-next/scenery/NOTICE +42 -0
  216. package/node_modules/@allyhub-next/scenery/dist/aim.d.ts +55 -0
  217. package/node_modules/@allyhub-next/scenery/dist/aim.js +2 -0
  218. package/node_modules/@allyhub-next/scenery/dist/bake.d.ts +203 -0
  219. package/node_modules/@allyhub-next/scenery/dist/bake.js +2 -0
  220. package/node_modules/@allyhub-next/scenery/dist/camera.d.ts +150 -0
  221. package/node_modules/@allyhub-next/scenery/dist/camera.js +2 -0
  222. package/node_modules/@allyhub-next/scenery/dist/curve.d.ts +40 -0
  223. package/node_modules/@allyhub-next/scenery/dist/curve.js +2 -0
  224. package/node_modules/@allyhub-next/scenery/dist/define.d.ts +164 -0
  225. package/node_modules/@allyhub-next/scenery/dist/define.js +2 -0
  226. package/node_modules/@allyhub-next/scenery/dist/fit.d.ts +64 -0
  227. package/node_modules/@allyhub-next/scenery/dist/fit.js +2 -0
  228. package/node_modules/@allyhub-next/scenery/dist/glass.d.ts +34 -0
  229. package/node_modules/@allyhub-next/scenery/dist/glass.js +2 -0
  230. package/node_modules/@allyhub-next/scenery/dist/handheld.d.ts +184 -0
  231. package/node_modules/@allyhub-next/scenery/dist/handheld.js +2 -0
  232. package/node_modules/@allyhub-next/scenery/dist/hull.d.ts +23 -0
  233. package/node_modules/@allyhub-next/scenery/dist/hull.js +2 -0
  234. package/node_modules/@allyhub-next/scenery/dist/index.d.ts +22 -0
  235. package/node_modules/@allyhub-next/scenery/dist/index.js +2 -0
  236. package/node_modules/@allyhub-next/scenery/dist/lens.d.ts +48 -0
  237. package/node_modules/@allyhub-next/scenery/dist/lens.js +2 -0
  238. package/node_modules/@allyhub-next/scenery/dist/moire.d.ts +136 -0
  239. package/node_modules/@allyhub-next/scenery/dist/moire.js +93 -0
  240. package/node_modules/@allyhub-next/scenery/dist/motion.d.ts +48 -0
  241. package/node_modules/@allyhub-next/scenery/dist/motion.js +2 -0
  242. package/node_modules/@allyhub-next/scenery/dist/move.d.ts +260 -0
  243. package/node_modules/@allyhub-next/scenery/dist/move.js +2 -0
  244. package/node_modules/@allyhub-next/scenery/dist/noise.d.ts +41 -0
  245. package/node_modules/@allyhub-next/scenery/dist/noise.js +2 -0
  246. package/node_modules/@allyhub-next/scenery/dist/phone.d.ts +34 -0
  247. package/node_modules/@allyhub-next/scenery/dist/phone.js +2 -0
  248. package/node_modules/@allyhub-next/scenery/dist/report.d.ts +677 -0
  249. package/node_modules/@allyhub-next/scenery/dist/report.js +2 -0
  250. package/node_modules/@allyhub-next/scenery/dist/screen-focus.d.ts +55 -0
  251. package/node_modules/@allyhub-next/scenery/dist/screen-focus.js +2 -0
  252. package/node_modules/@allyhub-next/scenery/dist/screen.d.ts +71 -0
  253. package/node_modules/@allyhub-next/scenery/dist/screen.js +2 -0
  254. package/node_modules/@allyhub-next/scenery/dist/solve.d.ts +82 -0
  255. package/node_modules/@allyhub-next/scenery/dist/solve.js +2 -0
  256. package/node_modules/@allyhub-next/scenery/dist/timing.d.ts +26 -0
  257. package/node_modules/@allyhub-next/scenery/dist/timing.js +2 -0
  258. package/node_modules/@allyhub-next/scenery/dist/vec.d.ts +19 -0
  259. package/node_modules/@allyhub-next/scenery/dist/vec.js +2 -0
  260. package/node_modules/@allyhub-next/scenery/package.json +13 -0
  261. package/node_modules/@allyhub-next/video-core/dist/anchors.d.ts +164 -0
  262. package/node_modules/@allyhub-next/video-core/dist/anchors.js +2 -0
  263. package/node_modules/@allyhub-next/video-core/dist/audio-types.d.ts +148 -0
  264. package/node_modules/@allyhub-next/video-core/dist/audio-types.js +2 -0
  265. package/node_modules/@allyhub-next/video-core/dist/backdrop.d.ts +87 -0
  266. package/node_modules/@allyhub-next/video-core/dist/backdrop.js +2 -0
  267. package/node_modules/@allyhub-next/video-core/dist/captions.d.ts +122 -0
  268. package/node_modules/@allyhub-next/video-core/dist/captions.js +11 -0
  269. package/node_modules/@allyhub-next/video-core/dist/console.d.ts +91 -0
  270. package/node_modules/@allyhub-next/video-core/dist/console.js +2 -0
  271. package/node_modules/@allyhub-next/video-core/dist/contrast.d.ts +98 -0
  272. package/node_modules/@allyhub-next/video-core/dist/contrast.js +2 -0
  273. package/node_modules/@allyhub-next/video-core/dist/cut-report.d.ts +77 -0
  274. package/node_modules/@allyhub-next/video-core/dist/cut-report.js +2 -0
  275. package/node_modules/@allyhub-next/video-core/dist/edit.d.ts +77 -0
  276. package/node_modules/@allyhub-next/video-core/dist/edit.js +13 -0
  277. package/node_modules/@allyhub-next/video-core/dist/edits.d.ts +163 -0
  278. package/node_modules/@allyhub-next/video-core/dist/edits.js +2 -0
  279. package/node_modules/@allyhub-next/video-core/dist/export.d.ts +96 -0
  280. package/node_modules/@allyhub-next/video-core/dist/export.js +2 -0
  281. package/node_modules/@allyhub-next/video-core/dist/fact.d.ts +965 -0
  282. package/node_modules/@allyhub-next/video-core/dist/fact.js +2 -0
  283. package/node_modules/@allyhub-next/video-core/dist/footage-motion.d.ts +168 -0
  284. package/node_modules/@allyhub-next/video-core/dist/footage-motion.js +2 -0
  285. package/node_modules/@allyhub-next/video-core/dist/formats.d.ts +240 -0
  286. package/node_modules/@allyhub-next/video-core/dist/formats.js +2 -0
  287. package/node_modules/@allyhub-next/video-core/dist/gen.d.ts +37 -0
  288. package/node_modules/@allyhub-next/video-core/dist/gen.js +2 -0
  289. package/node_modules/@allyhub-next/video-core/dist/index.d.ts +40 -0
  290. package/node_modules/@allyhub-next/video-core/dist/index.js +2 -0
  291. package/node_modules/@allyhub-next/video-core/dist/look.d.ts +66 -0
  292. package/node_modules/@allyhub-next/video-core/dist/look.js +2 -0
  293. package/node_modules/@allyhub-next/video-core/dist/marks.d.ts +34 -0
  294. package/node_modules/@allyhub-next/video-core/dist/marks.js +2 -0
  295. package/node_modules/@allyhub-next/video-core/dist/matrix.d.ts +289 -0
  296. package/node_modules/@allyhub-next/video-core/dist/matrix.js +2 -0
  297. package/node_modules/@allyhub-next/video-core/dist/measure.d.ts +465 -0
  298. package/node_modules/@allyhub-next/video-core/dist/measure.js +5 -0
  299. package/node_modules/@allyhub-next/video-core/dist/media.d.ts +226 -0
  300. package/node_modules/@allyhub-next/video-core/dist/media.js +2 -0
  301. package/node_modules/@allyhub-next/video-core/dist/messages.d.ts +88 -0
  302. package/node_modules/@allyhub-next/video-core/dist/messages.js +2 -0
  303. package/node_modules/@allyhub-next/video-core/dist/motion.d.ts +56 -0
  304. package/node_modules/@allyhub-next/video-core/dist/motion.js +2 -0
  305. package/node_modules/@allyhub-next/video-core/dist/music.d.ts +110 -0
  306. package/node_modules/@allyhub-next/video-core/dist/music.js +2 -0
  307. package/node_modules/@allyhub-next/video-core/dist/piece.d.ts +1146 -0
  308. package/node_modules/@allyhub-next/video-core/dist/piece.js +2 -0
  309. package/node_modules/@allyhub-next/video-core/dist/placement.d.ts +37 -0
  310. package/node_modules/@allyhub-next/video-core/dist/placement.js +2 -0
  311. package/node_modules/@allyhub-next/video-core/dist/problem.d.ts +262 -0
  312. package/node_modules/@allyhub-next/video-core/dist/problem.js +2 -0
  313. package/node_modules/@allyhub-next/video-core/dist/render-types.d.ts +49 -0
  314. package/node_modules/@allyhub-next/video-core/dist/render-types.js +2 -0
  315. package/node_modules/@allyhub-next/video-core/dist/schema.d.ts +352 -0
  316. package/node_modules/@allyhub-next/video-core/dist/schema.js +2 -0
  317. package/node_modules/@allyhub-next/video-core/dist/script-edit.d.ts +176 -0
  318. package/node_modules/@allyhub-next/video-core/dist/script-edit.js +2 -0
  319. package/node_modules/@allyhub-next/video-core/dist/script.d.ts +67 -0
  320. package/node_modules/@allyhub-next/video-core/dist/script.js +2 -0
  321. package/node_modules/@allyhub-next/video-core/dist/seams.d.ts +214 -0
  322. package/node_modules/@allyhub-next/video-core/dist/seams.js +2 -0
  323. package/node_modules/@allyhub-next/video-core/dist/slides.d.ts +37 -0
  324. package/node_modules/@allyhub-next/video-core/dist/slides.js +2 -0
  325. package/node_modules/@allyhub-next/video-core/dist/sound-under.d.ts +72 -0
  326. package/node_modules/@allyhub-next/video-core/dist/sound-under.js +2 -0
  327. package/node_modules/@allyhub-next/video-core/dist/speech.d.ts +83 -0
  328. package/node_modules/@allyhub-next/video-core/dist/speech.js +5 -0
  329. package/node_modules/@allyhub-next/video-core/dist/timeline.d.ts +616 -0
  330. package/node_modules/@allyhub-next/video-core/dist/timeline.js +2 -0
  331. package/node_modules/@allyhub-next/video-core/dist/timing.d.ts +88 -0
  332. package/node_modules/@allyhub-next/video-core/dist/timing.js +2 -0
  333. package/node_modules/@allyhub-next/video-core/dist/transcript.d.ts +288 -0
  334. package/node_modules/@allyhub-next/video-core/dist/transcript.js +2 -0
  335. package/node_modules/@allyhub-next/video-core/dist/transition.d.ts +289 -0
  336. package/node_modules/@allyhub-next/video-core/dist/transition.js +2 -0
  337. package/node_modules/@allyhub-next/video-core/dist/voice.d.ts +175 -0
  338. package/node_modules/@allyhub-next/video-core/dist/voice.js +2 -0
  339. package/node_modules/@allyhub-next/video-core/dist/words.d.ts +128 -0
  340. package/node_modules/@allyhub-next/video-core/dist/words.js +2 -0
  341. package/node_modules/@allyhub-next/video-core/package.json +14 -0
  342. package/package.json +52 -41
  343. package/README.md +0 -17
  344. package/dist/anim.d.ts.map +0 -1
  345. package/dist/anim.js.map +0 -1
  346. package/dist/define.d.ts.map +0 -1
  347. package/dist/define.js.map +0 -1
  348. package/dist/dom.d.ts.map +0 -1
  349. package/dist/dom.js.map +0 -1
  350. package/dist/fit.d.ts.map +0 -1
  351. package/dist/fit.js.map +0 -1
  352. package/dist/index.d.ts.map +0 -1
  353. package/dist/index.js.map +0 -1
  354. package/dist/media.d.ts.map +0 -1
  355. package/dist/media.js.map +0 -1
  356. package/dist/messages.d.ts.map +0 -1
  357. package/dist/messages.js.map +0 -1
  358. package/dist/noise.d.ts.map +0 -1
  359. package/dist/noise.js.map +0 -1
  360. package/dist/parts.d.ts.map +0 -1
  361. package/dist/parts.js.map +0 -1
  362. package/dist/paths.d.ts.map +0 -1
  363. package/dist/paths.js.map +0 -1
  364. package/dist/piece.d.ts.map +0 -1
  365. package/dist/piece.js.map +0 -1
  366. package/dist/props.d.ts.map +0 -1
  367. package/dist/props.js.map +0 -1
  368. package/dist/text.d.ts.map +0 -1
  369. package/dist/text.js.map +0 -1
  370. /package/{LICENSE → LICENSE.md} +0 -0
package/dist/dom.js CHANGED
@@ -1,457 +1,2 @@
1
- import { contentEdges, markRuns, normText, readMarks, WordStream, } from "@allyhub/engine/stage";
2
- import { largestFit, lineOf, lineSpans } from "./fit.js";
3
- export function h(tag, style = {}, children = [], cls) {
4
- const el = document.createElement(tag);
5
- if (cls)
6
- el.className = cls;
7
- css(el, style);
8
- for (const c of children) {
9
- el.append(typeof c === "string" ? document.createTextNode(c) : c);
10
- }
11
- return el;
12
- }
13
- export function css(el, style) {
14
- for (const [k, v] of Object.entries(style)) {
15
- if (v === undefined)
16
- continue;
17
- const value = typeof v === "number" && !UNITLESS.has(k) ? `${v}px` : String(v);
18
- if (k.startsWith("--"))
19
- el.style.setProperty(k, value);
20
- else
21
- el.style.setProperty(k.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`), value);
22
- }
23
- }
24
- const UNITLESS = new Set([
25
- "opacity",
26
- "zIndex",
27
- "fontWeight",
28
- "lineHeight",
29
- "flex",
30
- "flexGrow",
31
- "flexShrink",
32
- ]);
33
- const CJK_RE = /[\u3400-\u9fff\uf900-\ufaff]/;
34
- /**
35
- * Chinese has no spaces, so a line can break inside a word. Mark word
36
- * boundaries (Intl.Segmenter, the browser's own dictionary) with zero-width
37
- * spaces; with `word-break: keep-all` lines then break only between words.
38
- */
39
- export function wordBreaks(value) {
40
- if (!CJK_RE.test(value) || typeof Intl.Segmenter !== "function")
41
- return value;
42
- const seg = new Intl.Segmenter("zh", { granularity: "word" });
43
- let out = "";
44
- for (const s of seg.segment(value)) {
45
- // Break before words only: punctuation stays with the word before it.
46
- if (out && s.isWordLike)
47
- out += "\u200b";
48
- out += s.segment;
49
- }
50
- return out;
51
- }
52
- export const text = (v) => typeof v === "string" || typeof v === "number" || typeof v === "boolean"
53
- ? String(v)
54
- : "";
55
- export const list = (v) => Array.isArray(v) ? v.map(text) : v === undefined ? [] : [text(v)];
56
- /**
57
- * Layout of the stage for the current format: the type scale and the
58
- * content box (the same box as ctx.content). With the defaults, in
59
- * pixels: pad = max(margin, safe.left, safe.right), with margin 120 × k
60
- * in a landscape frame and 84 × k otherwise; top = max(pad, safe.top +
61
- * 30 × k); bottom = H − max(pad, safe.bottom + 20 × k); left = pad;
62
- * right = W − pad. `opts` changes the margin and the gaps.
63
- */
64
- export function layout(ctx, opts = {}) {
65
- const { width: W, height: H, orient } = ctx.dims;
66
- return { W, H, orient, ...contentEdges(ctx.dims, opts) };
67
- }
68
- /** A full-stage absolutely positioned box over the content area. */
69
- export function contentBox(L, style = {}) {
70
- return h("div", {
71
- position: "absolute",
72
- left: L.left,
73
- top: L.top,
74
- width: L.right - L.left,
75
- height: L.bottom - L.top,
76
- display: "flex",
77
- flexDirection: "column",
78
- justifyContent: "center",
79
- ...style,
80
- });
81
- }
82
- /** Text block that keeps its words together and wraps by width. */
83
- export function textBlock(value, { size, weight = 700, color = "var(--ak-color-fg)", font = "var(--ak-font-display)", lineHeight = 1.15, align = "left", }) {
84
- return h("div", {
85
- fontFamily: font,
86
- fontSize: size,
87
- fontWeight: weight,
88
- color,
89
- lineHeight,
90
- textAlign: align,
91
- overflowWrap: "break-word",
92
- // Even lines read better than one long line and a stub, especially
93
- // in Chinese, where a break can fall anywhere.
94
- textWrap: "balance",
95
- lineBreak: "strict",
96
- wordBreak: "keep-all",
97
- letterSpacing: weight >= 700 ? "-0.01em" : "0",
98
- }, [wordBreaks(value)]);
99
- }
100
- /** How marked() draws each kind of mark, unless it is given another style. */
101
- export const MARK_STYLES = {
102
- strong: { fontWeight: 700 },
103
- // The look's fonts may have no italic face: stress is a colour.
104
- em: { color: "var(--ak-color-accent)" },
105
- strike: { textDecoration: "line-through" },
106
- code: { fontFamily: "var(--ak-font-mono)", fontSize: "0.9em" },
107
- };
108
- /**
109
- * A line with its marks drawn: a span holding the line's runs in order,
110
- * a plain run as text and a marked one as a span with `data-mark` (its
111
- * kinds, "strong", "strong em"…) and the style of each kind, `styles`
112
- * over MARK_STYLES. A string is read with readMarks() (`**strong**`,
113
- * `*em*`, `~~struck~~`, `` `code` ``); a text already read is taken with
114
- * the marks it has. Put it in any block: textBlock("", { size }).append(…),
115
- * h("div", style, [marked(line)]).
116
- */
117
- export function marked(value, styles = {}) {
118
- const line = typeof value === "string" ? readMarks(value) : value;
119
- const el = h("span");
120
- for (const run of markRuns(line.text, line.marks)) {
121
- const words = wordBreaks(run.text);
122
- if (run.kinds.length === 0) {
123
- el.append(words);
124
- continue;
125
- }
126
- const style = {};
127
- for (const k of run.kinds) {
128
- Object.assign(style, styles[k] ?? MARK_STYLES[k]);
129
- }
130
- const piece = h("span", style, [words]);
131
- piece.dataset["mark"] = run.kinds.join(" ");
132
- el.append(piece);
133
- }
134
- return el;
135
- }
136
- /** Children of el by data-ak attribute, in document order. */
137
- export function all(el, name) {
138
- return Array.from(el.querySelectorAll(`[data-ak="${name}"]`));
139
- }
140
- export function one(el, name) {
141
- return el.querySelector(`[data-ak="${name}"]`);
142
- }
143
- export function tag(el, name) {
144
- el.dataset["ak"] = name;
145
- return el;
146
- }
147
- /**
148
- * The largest font size in [min, max] at which el fits its width and is at
149
- * most maxHeight tall. Layout depends only on the format and the text, so
150
- * mount calls this once.
151
- */
152
- export function fitTo(el, { min, max, maxHeight }) {
153
- const fits = () => el.scrollWidth <= el.clientWidth + 1 && el.offsetHeight <= maxHeight + 1;
154
- el.style.fontSize = `${max}px`;
155
- if (fits())
156
- return max;
157
- let lo = min;
158
- let hi = max;
159
- while (hi - lo > 0.5) {
160
- const mid = (lo + hi) / 2;
161
- el.style.fontSize = `${mid}px`;
162
- if (fits())
163
- lo = mid;
164
- else
165
- hi = mid;
166
- }
167
- el.style.fontSize = `${lo}px`;
168
- return lo;
169
- }
170
- export const FIT_LINES_PRECISION = 0.5;
171
- function textNodes(el) {
172
- const walker = document.createTreeWalker(el, NodeFilter.SHOW_TEXT);
173
- const out = [];
174
- for (let n = walker.nextNode(); n; n = walker.nextNode()) {
175
- if (n instanceof Text)
176
- out.push(n);
177
- }
178
- return out;
179
- }
180
- function lineBoxes(el) {
181
- const range = document.createRange();
182
- const rects = [];
183
- for (const node of textNodes(el)) {
184
- range.selectNodeContents(node);
185
- for (const r of range.getClientRects())
186
- rects.push(r);
187
- }
188
- return lineSpans(rects);
189
- }
190
- /**
191
- * The text of each line of el as the browser broke it, top to bottom:
192
- * spaces collapsed, zero-width spaces (`wordBreaks`) left out. el must be
193
- * in the page.
194
- */
195
- export function textLines(el) {
196
- const lines = lineBoxes(el);
197
- if (lines.length === 0)
198
- return [];
199
- const out = lines.map(() => "");
200
- const range = document.createRange();
201
- let at = 0;
202
- for (const node of textNodes(el)) {
203
- const value = node.data;
204
- for (let i = 0; i < value.length;) {
205
- const size = (value.codePointAt(i) ?? 0) > 0xffff ? 2 : 1;
206
- range.setStart(node, i);
207
- range.setEnd(node, i + size);
208
- const r = range.getBoundingClientRect();
209
- if (r.height > 0) {
210
- const found = lineOf(r, lines);
211
- if (found >= 0)
212
- at = found;
213
- }
214
- out[at] = (out[at] ?? "") + value.slice(i, i + size);
215
- i += size;
216
- }
217
- }
218
- return out.map((line) => line
219
- .replace(/\u200b/g, "")
220
- .replace(/\s+/g, " ")
221
- .trim());
222
- }
223
- export function fitLines(target, opts) {
224
- if (typeof target === "string") {
225
- if (opts.width === undefined)
226
- throw new Error("fitLines: a text needs a width");
227
- const probe = h("div", opts.style ?? {}, [target]);
228
- const holder = h("div", {
229
- position: "absolute",
230
- left: 0,
231
- top: 0,
232
- visibility: "hidden",
233
- pointerEvents: "none",
234
- }, [probe]);
235
- document.body.append(holder);
236
- try {
237
- return fitLines(probe, opts);
238
- }
239
- finally {
240
- holder.remove();
241
- }
242
- }
243
- const el = target;
244
- const { lines, min, max, width, height } = opts;
245
- if (width !== undefined)
246
- el.style.width = `${width}px`;
247
- const fits = (size) => {
248
- el.style.fontSize = `${size}px`;
249
- if (el.scrollWidth > el.clientWidth + 1)
250
- return false;
251
- if (height !== undefined &&
252
- (el.offsetHeight > height + 1 || el.scrollHeight > el.clientHeight + 1))
253
- return false;
254
- return lineBoxes(el).length <= lines;
255
- };
256
- const found = largestFit(min, max, opts.precision ?? FIT_LINES_PRECISION, fits);
257
- el.style.fontSize = `${found.size}px`;
258
- return { ...found, lines: textLines(el) };
259
- }
260
- /** Pixels two boxes share. */
261
- const overlapArea = (a, b) => Math.max(0, Math.min(a[0] + a[2], b[0] + b[2]) - Math.max(a[0], b[0])) *
262
- Math.max(0, Math.min(a[1] + a[3], b[1] + b[3]) - Math.max(a[1], b[1]));
263
- /**
264
- * The empty areas of the frame at part time t: bands across `within`
265
- * (the content box by default) where no face, other layer's text or
266
- * covered area is, each `[x, y, w, h]` in the frame's pixels, tallest
267
- * first. A measurement: use it, or not, as you place things. Draws the
268
- * layers listed before this one, so call it in mount.
269
- */
270
- export function freeAreas(ctx, t, opts = {}) {
271
- const L = layout(ctx);
272
- const [x, top, w, h] = opts.within ?? [
273
- L.left,
274
- L.top,
275
- L.right - L.left,
276
- L.bottom - L.top,
277
- ];
278
- const bottom = top + h;
279
- const margin = opts.margin ?? 24 * L.k;
280
- const avoid = [
281
- ...(opts.faces === false ? [] : ctx.faces(t).map((f) => f.box)),
282
- ...(opts.texts === false ? [] : ctx.texts(t).map((b) => b.box)),
283
- ...(opts.covered === false ? [] : ctx.covered),
284
- ];
285
- // What each obstacle blocks: its rows, widened by the margin, where it
286
- // reaches into the band's columns.
287
- const blocked = avoid
288
- .filter((b) => b[0] < x + w && b[0] + b[2] > x)
289
- .map((b) => [b[1] - margin, b[1] + b[3] + margin])
290
- .sort((a, b) => a[0] - b[0]);
291
- const out = [];
292
- let y = top;
293
- for (const [a, b] of blocked) {
294
- if (a > y)
295
- out.push([x, y, w, Math.min(a, bottom) - y]);
296
- y = Math.max(y, b);
297
- if (y >= bottom)
298
- break;
299
- }
300
- if (y < bottom)
301
- out.push([x, y, w, bottom - y]);
302
- return out
303
- .filter((r) => r[3] > 0 && r[3] >= (opts.minHeight ?? 0))
304
- .sort((a, b) => b[3] - a[3]);
305
- }
306
- /**
307
- * Where a caption block w × h pixels (centred across the frame) can go
308
- * for one cue: the first spot in `prefer`, else just above or below
309
- * another layer's text, clear of that text and of the faces over the
310
- * whole cue; when none is clear of both, the least text covered, then
311
- * the least face. Returns the block's top in pixels, inside the content
312
- * box. A tool: call it in mount, once per cue, if you want a measured
313
- * place; nothing places captions on its own.
314
- */
315
- export function captionTop(ctx, L, cue, w, h, opts = {}) {
316
- const fit = (y) => Math.min(Math.max(y, L.top), Math.max(L.top, L.bottom - h));
317
- const spotY = (s) => s === "top"
318
- ? fit(L.top)
319
- : s === "middle"
320
- ? fit((L.top + L.bottom - h) / 2)
321
- : s === "bottom"
322
- ? fit(L.bottom - h)
323
- : fit(s);
324
- const prefer = (opts.prefer ?? ["bottom", "top", "middle"]).map(spotY);
325
- const step = Math.max(0.02, opts.step ?? 0.1);
326
- const len = Math.max(0, cue.end - cue.start);
327
- const n = Math.min(200, Math.max(1, Math.ceil(len / step)));
328
- const texts = [];
329
- const faces = [];
330
- for (let i = 0; i < n; i++) {
331
- const t = cue.start + (len * i) / n;
332
- if (opts.texts !== false)
333
- texts.push(...ctx.texts(t).map((b) => b.box));
334
- if (opts.faces !== false)
335
- faces.push(...ctx.faces(t).map((f) => f.box));
336
- }
337
- const x = (L.W - w) / 2;
338
- const textGap = opts.textGap ?? 48 * L.k;
339
- const faceGap = opts.faceGap ?? 24 * L.k;
340
- const over = (y, boxes, gap) => boxes.reduce((sum, b) => sum + overlapArea([x, y - gap, w, h + 2 * gap], b), 0);
341
- const near = texts
342
- .flatMap(([, by, , bh]) => [fit(by - textGap - h), fit(by + bh + textGap)])
343
- .sort((a, b) => Math.abs(a - (prefer[0] ?? 0)) - Math.abs(b - (prefer[0] ?? 0)));
344
- let best = prefer[0] ?? fit(L.bottom - h);
345
- let least = [Infinity, Infinity];
346
- for (const y of [...prefer, ...near]) {
347
- const c = [
348
- over(y, texts, textGap),
349
- over(y, faces, faceGap),
350
- ];
351
- if (c[0] === 0 && c[1] === 0)
352
- return y;
353
- if (c[0] < least[0] || (c[0] === least[0] && c[1] < least[1])) {
354
- least = c;
355
- best = y;
356
- }
357
- }
358
- return best;
359
- }
360
- /**
361
- * The look's background and text colours sorted into the lighter and the
362
- * darker, as variables: text over footage can be light on a dark outline
363
- * in any look. Measures the look, so call it in mount.
364
- */
365
- export function lightDark(el) {
366
- const bg = "var(--ak-color-bg)";
367
- const fg = "var(--ak-color-fg)";
368
- const luminance = (value) => {
369
- const probe = h("span", { color: value, display: "none" });
370
- el.append(probe);
371
- const rgb = /^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)/.exec(getComputedStyle(probe).color);
372
- probe.remove();
373
- if (!rgb)
374
- return undefined;
375
- const [r = 0, g = 0, b = 0] = rgb.slice(1, 4).map((c) => {
376
- const s = Number(c) / 255;
377
- return s <= 0.04045 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4;
378
- });
379
- return 0.2126 * r + 0.7152 * g + 0.0722 * b;
380
- };
381
- const lb = luminance(bg);
382
- const lf = luminance(fg);
383
- return lb !== undefined && lf !== undefined && lf > lb
384
- ? { light: fg, dark: bg }
385
- : { light: bg, dark: fg };
386
- }
387
- const CJK_WORD = /[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u;
388
- /** Every match of ref in the words, as [first, last] word indices. */
389
- function matches(stream, ref) {
390
- const needle = normText(ref);
391
- const out = [];
392
- const end = stream.words.length - 1;
393
- for (let nth = 1;; nth++) {
394
- const m = stream.span(needle, 0, end, nth);
395
- if (!m)
396
- return out;
397
- // Latin matches whole words: the match ends where a word ends.
398
- if (CJK_WORD.test(needle) ||
399
- stream.charOf(m.first) + needle.length === stream.charOf(m.last + 1)) {
400
- out.push([m.first, m.last]);
401
- }
402
- }
403
- }
404
- /** For each of a cue's words, whether `emphasis` names it. */
405
- export function emphasized(words, emphasis) {
406
- const out = words.map(() => false);
407
- if (!emphasis?.length)
408
- return out;
409
- const stream = new WordStream(words);
410
- for (const ref of emphasis) {
411
- for (const [first, last] of matches(stream, ref)) {
412
- out.fill(true, first, last + 1);
413
- }
414
- }
415
- return out;
416
- }
417
- /**
418
- * For each of a cue's words, the emoji it brings ("" for none): a phrase's
419
- * goes to its last word, and the first key that names a word wins.
420
- */
421
- export function wordEmoji(words, emoji) {
422
- const out = words.map(() => "");
423
- if (!emoji)
424
- return out;
425
- const stream = new WordStream(words);
426
- for (const [ref, value] of Object.entries(emoji)) {
427
- for (const [, last] of matches(stream, ref)) {
428
- if (!out[last])
429
- out[last] = value;
430
- }
431
- }
432
- return out;
433
- }
434
- /**
435
- * An emoji to draw beside or above a word: in the look's emoji font
436
- * (`var(--ak-font-emoji)`, colour emoji the stage has, the same on every
437
- * computer), upright at regular weight, without the capitals or the
438
- * outline of the line it sits in.
439
- */
440
- export function emojiEl(value, style = {}) {
441
- const el = h("span", {
442
- display: "inline-block",
443
- fontFamily: "var(--ak-font-emoji)",
444
- fontWeight: 400,
445
- fontStyle: "normal",
446
- fontSynthesis: "none",
447
- textTransform: "none",
448
- letterSpacing: "0",
449
- lineHeight: 1,
450
- WebkitTextStroke: "0",
451
- textShadow: "none",
452
- ...style,
453
- }, [value]);
454
- el.setAttribute("aria-hidden", "true");
455
- return el;
456
- }
457
- //# sourceMappingURL=dom.js.map
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{contentEdges as N,markRuns as I,normText as $,readMarks as C,WordStream as M}from"@allyhub-next/video-core";import{largestFit as O,lineOf as R,lineSpans as j}from"./fit.js";export function h(t,n={},e=[],o){const r=document.createElement(t);o&&(r.className=o),css(r,n);for(const i of e)r.append(typeof i=="string"?document.createTextNode(i):i);return r}export function css(t,n){for(const[e,o]of Object.entries(n)){if(o===void 0)continue;const r=typeof o=="number"&&!B.has(e)?`${String(o)}px`:String(o);e.startsWith("--")?t.style.setProperty(e,r):t.style.setProperty(e.replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`),r)}}const B=new Set(["opacity","zIndex","fontWeight","lineHeight","flex","flexGrow","flexShrink"]),F=/[\u3400-\u9fff\uf900-\ufaff]/;export function wordBreaks(t){if(!F.test(t)||typeof Intl.Segmenter!="function")return t;const n=new Intl.Segmenter("zh",{granularity:"word"});let e="";for(const o of n.segment(t))e&&o.isWordLike&&(e+="​"),e+=o.segment;return e}export const text=t=>typeof t=="string"||typeof t=="number"||typeof t=="boolean"?String(t):"",list=t=>Array.isArray(t)?t.map(text):t===void 0?[]:[text(t)];export function layout(t,n={}){const{width:e,height:o,orient:r}=t.dims;return{W:e,H:o,orient:r,...N(t.dims,n)}}export function contentBox(t,n={}){return h("div",{position:"absolute",left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top,display:"flex",flexDirection:"column",justifyContent:"center",...n})}export function textBlock(t,{size:n,weight:e=700,color:o="var(--ak-color-fg)",font:r="var(--ak-font-display)",lineHeight:i=1.15,align:s="left"}){return h("div",{fontFamily:r,fontSize:n,fontWeight:e,color:o,lineHeight:i,textAlign:s,overflowWrap:"break-word",textWrap:"balance",lineBreak:"strict",wordBreak:"keep-all",letterSpacing:e>=700?"-0.01em":"0"},[wordBreaks(t)])}export const MARK_STYLES={strong:{fontWeight:700},em:{color:"var(--ak-color-accent)"},strike:{textDecoration:"line-through"},code:{fontFamily:"var(--ak-font-mono)",fontSize:"0.9em"}};export function marked(t,n={}){const e=typeof t=="string"?C(t):t,o=h("span");for(const r of I(e.text,e.marks)){const i=wordBreaks(r.text);if(r.kinds.length===0){o.append(i);continue}const s={};for(const l of r.kinds)Object.assign(s,n[l]??MARK_STYLES[l]);const f=h("span",s,[i]);f.dataset.mark=r.kinds.join(" "),o.append(f)}return o}export function all(t,n){return Array.from(t.querySelectorAll(`[data-ak="${n}"]`))}export function one(t,n){return t.querySelector(`[data-ak="${n}"]`)}export function tag(t,n){return t.dataset.ak=n,t}export function fitTo(t,{min:n,max:e,maxHeight:o}){const r=()=>t.scrollWidth<=t.clientWidth+1&&t.offsetHeight<=o+1;if(t.style.fontSize=`${String(e)}px`,r())return e;let i=n,s=e;for(;s-i>.5;){const f=(i+s)/2;t.style.fontSize=`${String(f)}px`,r()?i=f:s=f}return t.style.fontSize=`${String(i)}px`,i}export const FIT_LINES_PRECISION=.5;function W(t){const n=document.createTreeWalker(t,NodeFilter.SHOW_TEXT),e=[];for(let o=n.nextNode();o;o=n.nextNode())o instanceof Text&&e.push(o);return e}function v(t){const n=document.createRange(),e=[];for(const o of W(t)){n.selectNodeContents(o);for(const r of n.getClientRects())e.push(r)}return j(e)}export function textLines(t){const n=v(t);if(n.length===0)return[];const e=n.map(()=>""),o=document.createRange();let r=0;for(const i of W(t)){const s=i.data;for(let f=0;f<s.length;){const l=(s.codePointAt(f)??0)>65535?2:1;o.setStart(i,f),o.setEnd(i,f+l);const m=o.getBoundingClientRect();if(m.height>0){const d=R(m,n);d>=0&&(r=d)}e[r]=(e[r]??"")+s.slice(f,f+l),f+=l}}return e.map(i=>i.replace(/\u200b/g,"").replace(/\s+/g," ").trim())}export function fitLines(t,n){if(typeof t=="string"){if(n.width===void 0)throw new Error("fitLines: a text needs a width");const d=h("div",n.style??{},[t]),x=h("div",{position:"absolute",left:0,top:0,visibility:"hidden",pointerEvents:"none"},[d]);document.body.append(x);try{return fitLines(d,n)}finally{x.remove()}}const e=t,{lines:o,min:r,max:i,width:s,height:f}=n;s!==void 0&&(e.style.width=`${String(s)}px`);const l=d=>(e.style.fontSize=`${String(d)}px`,e.scrollWidth>e.clientWidth+1||f!==void 0&&(e.offsetHeight>f+1||e.scrollHeight>e.clientHeight+1)?!1:v(e).length<=o),m=O(r,i,n.precision??FIT_LINES_PRECISION,l);return e.style.fontSize=`${String(m.size)}px`,{...m,lines:textLines(e)}}const _=(t,n)=>Math.max(0,Math.min(t[0]+t[2],n[0]+n[2])-Math.max(t[0],n[0]))*Math.max(0,Math.min(t[1]+t[3],n[1]+n[3])-Math.max(t[1],n[1]));export function freeAreas(t,n,e={}){const o=layout(t),[r,i,s,f]=e.within??[o.left,o.top,o.right-o.left,o.bottom-o.top],l=i+f,m=e.margin??24*o.k,x=[...e.faces===!1?[]:t.faces(n).map(a=>a.box),...e.texts===!1?[]:t.texts(n).map(a=>a.box),...e.covered===!1?[]:t.covered].filter(a=>a[0]<r+s&&a[0]+a[2]>r).map(a=>[a[1]-m,a[1]+a[3]+m]).sort((a,y)=>a[0]-y[0]),g=[];let p=i;for(const[a,y]of x)if(a>p&&g.push([r,p,s,Math.min(a,l)-p]),p=Math.max(p,y),p>=l)break;return p<l&&g.push([r,p,s,l-p]),g.filter(a=>a[3]>0&&a[3]>=(e.minHeight??0)).sort((a,y)=>y[3]-a[3])}export function captionTop(t,n,e,o,r,i={}){const s=c=>Math.min(Math.max(c,n.top),Math.max(n.top,n.bottom-r)),f=c=>s(c==="top"?n.top:c==="middle"?(n.top+n.bottom-r)/2:c==="bottom"?n.bottom-r:c),l=(i.prefer??["bottom","top","middle"]).map(f),m=Math.max(.02,i.step??.1),d=Math.max(0,e.end-e.start),x=Math.min(200,Math.max(1,Math.ceil(d/m))),g=[],p=[];for(let c=0;c<x;c++){const u=e.start+d*c/x;i.texts!==!1&&g.push(...t.texts(u).map(k=>k.box)),i.faces!==!1&&p.push(...t.faces(u).map(k=>k.box))}const a=(n.W-o)/2,y=i.textGap??48*n.k,T=i.faceGap??24*n.k,b=(c,u,k)=>u.reduce((H,A)=>H+_([a,c-k,o,r+2*k],A),0),z=g.flatMap(([,c,,u])=>[s(c-y-r),s(c+u+y)]).sort((c,u)=>Math.abs(c-(l[0]??0))-Math.abs(u-(l[0]??0)));let w=l[0]??s(n.bottom-r),S=[1/0,1/0];for(const c of[...l,...z]){const u=[b(c,g,y),b(c,p,T)];if(u[0]===0&&u[1]===0)return c;(u[0]<S[0]||u[0]===S[0]&&u[1]<S[1])&&(S=u,w=c)}return w}export function lightDark(t){const n="var(--ak-color-bg)",e="var(--ak-color-fg)",o=s=>{const f=h("span",{color:s,display:"none"});t.append(f);const l=/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)/.exec(getComputedStyle(f).color);if(f.remove(),!l)return;const[m=0,d=0,x=0]=l.slice(1,4).map(g=>{const p=Number(g)/255;return p<=.04045?p/12.92:((p+.055)/1.055)**2.4});return .2126*m+.7152*d+.0722*x},r=o(n),i=o(e);return r!==void 0&&i!==void 0&&i>r?{light:e,dark:n}:{light:n,dark:e}}const G=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u;function E(t,n){const e=$(n),o=[],r=t.words.length-1;for(let i=1;;i++){const s=t.span(e,0,r,i);if(!s)return o;(G.test(e)||t.charOf(s.first)+e.length===t.charOf(s.last+1))&&o.push([s.first,s.last])}}export function emphasized(t,n){const e=t.map(()=>!1);if(!n?.length)return e;const o=new M(t);for(const r of n)for(const[i,s]of E(o,r))e.fill(!0,i,s+1);return e}export function wordEmoji(t,n){const e=t.map(()=>"");if(!n)return e;const o=new M(t);for(const[r,i]of Object.entries(n))for(const[,s]of E(o,r))(e[s]??"")===""&&(e[s]=i);return e}export function emojiEl(t,n={}){const e=h("span",{display:"inline-block",fontFamily:"var(--ak-font-emoji)",fontWeight:400,fontStyle:"normal",fontSynthesis:"none",textTransform:"none",letterSpacing:"0",lineHeight:1,WebkitTextStroke:"0",textShadow:"none",...n},[t]);return e.setAttribute("aria-hidden","true"),e}
package/dist/fit.js CHANGED
@@ -1,60 +1,2 @@
1
- // The arithmetic behind fitLines and textLines (dom.ts), apart from the DOM
2
- // so it can be tested without a browser: text's boxes grouped into lines,
3
- // and the largest size a test passes at.
4
- //
5
- // fitLines is after Remotion's fitTextOnNLines and fillTextBox in
6
- // @remotion/layout-utils
7
- // (https://github.com/remotion-dev/remotion/tree/main/packages/layout-utils,
8
- // MIT): a binary search on the font size for the largest at which the text
9
- // takes at most n lines of a width. Written again here, measuring in the
10
- // stage's own DOM rather than word by word on a canvas. See NOTICE.
11
- /** Whether a box is on a line: it shares at least half its height with it. */
12
- function onLine(rect, line) {
13
- const overlap = Math.min(rect.bottom, line.bottom) - Math.max(rect.top, line.top);
14
- const height = Math.min(rect.bottom - rect.top, line.bottom - line.top);
15
- return overlap > height / 2;
16
- }
17
- /**
18
- * The lines a text's boxes are on, top to bottom: each the extent of the
19
- * first box found on it. Boxes with no height (collapsed spaces) are left
20
- * out. A box shares a line with another when they overlap by more than half
21
- * the shorter one's height, which holds for line heights above about 0.6.
22
- */
23
- export function lineSpans(rects) {
24
- const sorted = [...rects]
25
- .filter((r) => r.bottom - r.top > 0)
26
- .sort((a, b) => a.top - b.top);
27
- const lines = [];
28
- for (const r of sorted) {
29
- if (!lines.some((line) => onLine(r, line)))
30
- lines.push({ top: r.top, bottom: r.bottom });
31
- }
32
- return lines.sort((a, b) => a.top - b.top);
33
- }
34
- /** The index of the line a box is on, or -1. */
35
- export function lineOf(rect, lines) {
36
- return lines.findIndex((line) => onLine(rect, line));
37
- }
38
- /**
39
- * The largest size in [min, max] at which `fits` holds, to within
40
- * `precision`, assuming a smaller size fits whenever a larger one does.
41
- * `fits` is false, and the size `min`, when even `min` does not.
42
- */
43
- export function largestFit(min, max, precision, fits) {
44
- if (fits(max))
45
- return { size: max, fits: true };
46
- if (!fits(min))
47
- return { size: min, fits: false };
48
- let lo = min;
49
- let hi = max;
50
- const step = Math.max(precision, 1e-3);
51
- while (hi - lo > step) {
52
- const mid = (lo + hi) / 2;
53
- if (fits(mid))
54
- lo = mid;
55
- else
56
- hi = mid;
57
- }
58
- return { size: lo, fits: true };
59
- }
60
- //# sourceMappingURL=fit.js.map
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ function p(o,e){const s=Math.min(o.bottom,e.bottom)-Math.max(o.top,e.top),t=Math.min(o.bottom-o.top,e.bottom-e.top);return s>t/2}export function lineSpans(o){const e=[...o].filter(t=>t.bottom-t.top>0).sort((t,n)=>t.top-n.top),s=[];for(const t of e)s.some(n=>p(t,n))||s.push({top:t.top,bottom:t.bottom});return s.sort((t,n)=>t.top-n.top)}export function lineOf(o,e){return e.findIndex(s=>p(o,s))}export function largestFit(o,e,s,t){if(t(e))return{size:e,fits:!0};if(!t(o))return{size:o,fits:!1};let n=o,r=e;const f=Math.max(s,.001);for(;r-n>f;){const i=(n+r)/2;t(i)?n=i:r=i}return{size:n,fits:!0}}
package/dist/free.d.ts ADDED
@@ -0,0 +1,18 @@
1
+ export { clamp, ease, fitText, lerp, progress, rand, stagger, tween, type Ease, type FitTextOptions, type TweenOptions, } from "./anim.js";
2
+ export { noise2D, noise3D, noise4D } from "./noise.js";
3
+ export { drag, fittsTime, INPUT_DEFAULTS, pointer, reach, scroll, tap, typing, type Drag, type DragOptions, type Movement, type Point, type Pointer, type PointerOptions, type PointerState, type PointerStep, type ReachOptions, type Scroll, type ScrollOptions, type Tap, type TapOptions, type Typed, type TypingOptions, } from "./input.js";
4
+ export { aimed, type AimOptions } from "@allyhub-next/scenery";
5
+ export { drawOn, interpolatePath, normalizePath, pathLength, pointAtLength, tangentAtLength, trimPath, type DrawOn, type PathCommand, type PathPoint, } from "./paths.js";
6
+ export { FIT_LINES_PRECISION, fitLines, textLines, type FitLines, type FitLinesOptions, } from "./dom.js";
7
+ export { custom, defineComponent, LAYER_OPTIONS, type Component, type ComponentDefinition, type ComponentInfo, type CustomOptions, type Label, type LayerOptions, type StageContext, } from "./define.js";
8
+ export { say, type BoxKey, type FootageBackground, type FootageBox, type PerOrient, type PunchIn, type Pullback, type Reframe, type FootageLayer, type FootageOptions, type GraphicLayer, type Layer, type LayerSpec, type LayerTiming, type PartAnchors, type PartOptions, type PartSpec, type Rect, type RoomTone, type SayOptions, type SaySpeech, type SoundSpec, type SpeechSpec, type Take, type TakeSpeech, type VideoSpeech, type VideoTake, type Direction, type TransitionChannel, type TransitionInput, type TransitionPicture, type TransitionSpec, type TransitionType, type WordRef, } from "./parts.js";
9
+ export type { InlineMark, MarkedText } from "@allyhub-next/video-core";
10
+ /** What ctx.video(piece, el) gives: another video item, drawn inside an element. */
11
+ export type { EmbeddedVideo } from "@allyhub-next/video-core";
12
+ export { defineConfig, definePiece, paged, type Combo, type Dims, type Format, type FormatEntry, type FormatSpec, type ItemPiece, type Matrix, type MediaRef, type MessageHint, type MotionBlur, type MusicOptions, type PagedBuild, type PagedOptions, type PagedPiece, type PieceContext, type PieceDefinition, type PieceOptions, type PieceWritten, type PostProcess, type CaptureOptions, type ProjectConfig, type Slides, type SlidesOptions, type Video, type VideoBuild, type VideoItem, type VideoOptions, type VideoPiece, type VideoPieceOptions, } from "./piece.js";
13
+ export type { ListItem, ListPrefix, MessageInputs, MessageKey, MessageLists, MessageReader, Messages, } from "./messages.js";
14
+ export { asset, boolean, color, list, number, object, text, time, type PropSchema, type Time, type Timed, } from "./props.js";
15
+ export { countText, splitText } from "./text.js";
16
+ export { markRuns, readMarks, withoutMarks, type MarkRun, } from "@allyhub-next/video-core";
17
+ export type { Box, CaptionOptions, CaptionTrackCue, CaptionWord, EditList, EditRange, FaceOnFrame, FaceTrack, MediaInfo, MediaKind, PixelRect, TrackedFace, Word, } from "@allyhub-next/video-core";
18
+ //# sourceMappingURL=free.d.ts.map
package/dist/free.js ADDED
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ export{clamp,ease,fitText,lerp,progress,rand,stagger,tween}from"./anim.js";export{noise2D,noise3D,noise4D}from"./noise.js";export{drag,fittsTime,INPUT_DEFAULTS,pointer,reach,scroll,tap,typing}from"./input.js";export{aimed}from"@allyhub-next/scenery";export{drawOn,interpolatePath,normalizePath,pathLength,pointAtLength,tangentAtLength,trimPath}from"./paths.js";export{FIT_LINES_PRECISION,fitLines,textLines}from"./dom.js";export{custom,defineComponent,LAYER_OPTIONS}from"./define.js";export{say}from"./parts.js";export{defineConfig,definePiece,paged}from"./piece.js";export{asset,boolean,color,list,number,object,text,time}from"./props.js";export{countText,splitText}from"./text.js";export{markRuns,readMarks,withoutMarks}from"@allyhub-next/video-core";
package/dist/index.d.ts CHANGED
@@ -1,14 +1,29 @@
1
- export { clamp, ease, fitText, lerp, progress, rand, stagger, tween, type Ease, type FitTextOptions, type TweenOptions, } from "./anim.js";
2
- export { noise2D, noise3D, noise4D } from "./noise.js";
3
- export { drawOn, interpolatePath, normalizePath, pathLength, pointAtLength, tangentAtLength, trimPath, type DrawOn, type PathCommand, type PathPoint, } from "./paths.js";
4
- export { FIT_LINES_PRECISION, fitLines, textLines, type FitLines, type FitLinesOptions, } from "./dom.js";
5
- export { custom, defineComponent, LAYER_OPTIONS, type Component, type ComponentDefinition, type ComponentInfo, type CustomOptions, type Label, type LayerOptions, type StageContext, } from "./define.js";
6
- export { footage, part, say, take, type BoxKey, type FootageBackground, type FootageBox, type PerOrient, type PunchIn, type Pullback, type Reframe, type FootageLayer, type FootageOptions, type GraphicLayer, type LayerSpec, type LayerTiming, type PartAnchors, type PartOptions, type PartSpec, type Rect, type SayOptions, type SaySpeech, type SoundSpec, type SpeechSpec, type Take, type TakeSpeech, type Direction, type TransitionChannel, type TransitionInput, type TransitionPicture, type TransitionSpec, type TransitionType, type WordRef, } from "./parts.js";
7
- export type { InlineMark, MarkedText } from "@allyhub/engine/stage";
8
- export { defineConfig, definePiece, paged, video, type Combo, type Dims, type Format, type FormatEntry, type FormatSpec, type Matrix, type MediaRef, type MessageHint, type MotionBlur, type MusicOptions, type PagedBuild, type PagedOptions, type PieceContext, type PieceDefinition, type PieceOptions, type PostProcess, type ProjectConfig, type VideoBuild, type VideoOptions, } from "./piece.js";
9
- export type { ListItem, ListPrefix, MessageInputs, MessageKey, MessageLists, MessageReader, Messages, } from "./messages.js";
10
- export { asset, boolean, color, list, number, object, text, time, type PropSchema, type Time, type Timed, } from "./props.js";
11
- export { countText, splitText } from "./text.js";
12
- export { markRuns, readMarks, withoutMarks, type MarkRun, } from "@allyhub/engine/stage";
13
- export type { Box, CaptionOptions, CaptionTrackCue, CaptionWord, EditList, EditRange, FaceOnFrame, FaceTrack, MediaInfo, MediaKind, PixelRect, TrackedFace, Word, } from "@allyhub/engine/stage";
1
+ export * from "./free.js";
2
+ export { BOUND, sdkFor, type BoundSdk, type Sdk, type SdkModule, } from "./module.js";
3
+ export type { FootageFn, PartFn, TakeFn } from "./parts.js";
4
+ export type { SlidesFn, VideoFn } from "./piece.js";
5
+ /**
6
+ * A video: the default export of an item's video.ts. The function returns
7
+ * its parts, in order.
8
+ */
9
+ export declare const video: import("./piece.js").VideoFn;
10
+ /**
11
+ * Pages of one format, each one still frame: a single image, a carousel,
12
+ * slides, a PDF document; the default export of an item's slides.ts.
13
+ * `notes: true` reads each page's speaker notes from
14
+ * `<prefix>.<page>.notes`.
15
+ */
16
+ export declare const slides: import("./piece.js").SlidesFn;
17
+ /** A part of a video, or a page of a paged output. */
18
+ export declare const part: import("./parts.js").PartFn;
19
+ /**
20
+ * Speech from a recording (an import, or a path) with its word times
21
+ * beside it, or a stretch of another video item of the project.
22
+ */
23
+ export declare const take: import("./parts.js").TakeFn;
24
+ /**
25
+ * A video on the part: footage("./broll.mp4", { at: "inbox", dur: 1.5 }).
26
+ * Without a file it is the part's own take, in sync with its speech.
27
+ */
28
+ export declare const footage: import("./parts.js").FootageFn;
14
29
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,11 +1,2 @@
1
- export { clamp, ease, fitText, lerp, progress, rand, stagger, tween, } from "./anim.js";
2
- export { noise2D, noise3D, noise4D } from "./noise.js";
3
- export { drawOn, interpolatePath, normalizePath, pathLength, pointAtLength, tangentAtLength, trimPath, } from "./paths.js";
4
- export { FIT_LINES_PRECISION, fitLines, textLines, } from "./dom.js";
5
- export { custom, defineComponent, LAYER_OPTIONS, } from "./define.js";
6
- export { footage, part, say, take, } from "./parts.js";
7
- export { defineConfig, definePiece, paged, video, } from "./piece.js";
8
- export { asset, boolean, color, list, number, object, text, time, } from "./props.js";
9
- export { countText, splitText } from "./text.js";
10
- export { markRuns, readMarks, withoutMarks, } from "@allyhub/engine/stage";
11
- //# sourceMappingURL=index.js.map
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{footageFor as r,partFor as t,takeFor as e}from"./parts.js";import{slidesFor as p,videoFor as s}from"./piece.js";import{writtenIn as i}from"./written.js";export*from"./free.js";export{BOUND,sdkFor}from"./module.js";const o=i({file:""});export const video=s(o),slides=p(o),part=t(o),take=e(o),footage=r(o);