fundus 0.0.2 → 0.0.3

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 (300) hide show
  1. package/README.md +58 -0
  2. package/build/client/_app/immutable/assets/0.DLhIsYA_.css.br +0 -0
  3. package/build/client/_app/immutable/assets/0.DLhIsYA_.css.gz +0 -0
  4. package/build/client/_app/immutable/assets/2.wavcNhPC.css +1 -0
  5. package/build/client/_app/immutable/assets/2.wavcNhPC.css.br +0 -0
  6. package/build/client/_app/immutable/assets/2.wavcNhPC.css.gz +0 -0
  7. package/build/client/_app/immutable/assets/3.Cjh_fXPY.css +1 -0
  8. package/build/client/_app/immutable/assets/3.Cjh_fXPY.css.br +0 -0
  9. package/build/client/_app/immutable/assets/3.Cjh_fXPY.css.gz +0 -0
  10. package/build/client/_app/immutable/assets/4.p004hmEN.css +1 -0
  11. package/build/client/_app/immutable/assets/4.p004hmEN.css.br +0 -0
  12. package/build/client/_app/immutable/assets/4.p004hmEN.css.gz +0 -0
  13. package/build/client/_app/immutable/assets/ConfirmDialog.BdKlitwi.css +1 -0
  14. package/build/client/_app/immutable/assets/ConfirmDialog.BdKlitwi.css.br +0 -0
  15. package/build/client/_app/immutable/assets/ConfirmDialog.BdKlitwi.css.gz +0 -0
  16. package/build/client/_app/immutable/assets/LibraryContextMenu.zyZtpKzC.css +1 -0
  17. package/build/client/_app/immutable/assets/LibraryContextMenu.zyZtpKzC.css.br +0 -0
  18. package/build/client/_app/immutable/assets/LibraryContextMenu.zyZtpKzC.css.gz +0 -0
  19. package/build/client/_app/immutable/chunks/BiIto6ft.js +1 -0
  20. package/build/client/_app/immutable/chunks/BiIto6ft.js.br +0 -0
  21. package/build/client/_app/immutable/chunks/BiIto6ft.js.gz +0 -0
  22. package/build/client/_app/immutable/chunks/Bjy-W4x2.js.br +0 -0
  23. package/build/client/_app/immutable/chunks/Bjy-W4x2.js.gz +0 -0
  24. package/build/client/_app/immutable/chunks/CNRz3sSw.js.br +0 -0
  25. package/build/client/_app/immutable/chunks/CNRz3sSw.js.gz +0 -0
  26. package/build/client/_app/immutable/chunks/CO4RBJfa.js.br +0 -0
  27. package/build/client/_app/immutable/chunks/CO4RBJfa.js.gz +0 -0
  28. package/{dist/editor/_app/immutable/chunks/DjvOiDmq.js → build/client/_app/immutable/chunks/CvY6YsFE.js} +1 -1
  29. package/build/client/_app/immutable/chunks/CvY6YsFE.js.br +0 -0
  30. package/build/client/_app/immutable/chunks/CvY6YsFE.js.gz +0 -0
  31. package/build/client/_app/immutable/chunks/DL0_39Ys.js +5 -0
  32. package/build/client/_app/immutable/chunks/DL0_39Ys.js.br +0 -0
  33. package/build/client/_app/immutable/chunks/DL0_39Ys.js.gz +0 -0
  34. package/{dist/editor/_app/immutable/chunks/BfPE5wdt.js → build/client/_app/immutable/chunks/DQ8SXFaX.js} +1 -1
  35. package/build/client/_app/immutable/chunks/DQ8SXFaX.js.br +0 -0
  36. package/build/client/_app/immutable/chunks/DQ8SXFaX.js.gz +0 -0
  37. package/build/client/_app/immutable/chunks/DjdrdRzT.js.br +0 -0
  38. package/build/client/_app/immutable/chunks/DjdrdRzT.js.gz +0 -0
  39. package/build/client/_app/immutable/chunks/xihTtKlq.js.br +1 -0
  40. package/build/client/_app/immutable/chunks/xihTtKlq.js.gz +0 -0
  41. package/{dist/editor/_app/immutable/entry/app.BkqbfI8n.js → build/client/_app/immutable/entry/app.ubN0v9bN.js} +2 -2
  42. package/build/client/_app/immutable/entry/app.ubN0v9bN.js.br +0 -0
  43. package/build/client/_app/immutable/entry/app.ubN0v9bN.js.gz +0 -0
  44. package/build/client/_app/immutable/entry/start.BW8dBDh6.js +1 -0
  45. package/build/client/_app/immutable/entry/start.BW8dBDh6.js.br +0 -0
  46. package/build/client/_app/immutable/entry/start.BW8dBDh6.js.gz +0 -0
  47. package/{dist/editor/_app/immutable/nodes/0.xdMI5GEU.js → build/client/_app/immutable/nodes/0.Dr5ijCIl.js} +1 -1
  48. package/build/client/_app/immutable/nodes/0.Dr5ijCIl.js.br +0 -0
  49. package/build/client/_app/immutable/nodes/0.Dr5ijCIl.js.gz +0 -0
  50. package/{dist/editor/_app/immutable/nodes/1.D9p2tfoJ.js → build/client/_app/immutable/nodes/1.DiIGIRAb.js} +1 -1
  51. package/build/client/_app/immutable/nodes/1.DiIGIRAb.js.br +3 -0
  52. package/build/client/_app/immutable/nodes/1.DiIGIRAb.js.gz +0 -0
  53. package/{dist/editor/_app/immutable/nodes/2.BrA0Hyzu.js → build/client/_app/immutable/nodes/2.B8KYmQcV.js} +3 -3
  54. package/build/client/_app/immutable/nodes/2.B8KYmQcV.js.br +0 -0
  55. package/build/client/_app/immutable/nodes/2.B8KYmQcV.js.gz +0 -0
  56. package/build/client/_app/immutable/nodes/3.B1jc7arT.js +104 -0
  57. package/build/client/_app/immutable/nodes/3.B1jc7arT.js.br +0 -0
  58. package/build/client/_app/immutable/nodes/3.B1jc7arT.js.gz +0 -0
  59. package/build/client/_app/immutable/nodes/4.BPK9n1mH.js +2 -0
  60. package/build/client/_app/immutable/nodes/4.BPK9n1mH.js.br +0 -0
  61. package/build/client/_app/immutable/nodes/4.BPK9n1mH.js.gz +0 -0
  62. package/build/client/_app/version.json +1 -0
  63. package/build/client/_app/version.json.br +0 -0
  64. package/build/client/_app/version.json.gz +0 -0
  65. package/build/env.js +100 -0
  66. package/build/env.js.map +1 -0
  67. package/build/handler.js +22 -0
  68. package/build/handler.js.map +1 -0
  69. package/build/index.js +145 -0
  70. package/build/index.js.map +1 -0
  71. package/build/server/chunks/chunks/context.js-Bw4WWLhG.js +443 -0
  72. package/build/server/chunks/chunks/context.js-Bw4WWLhG.js.map +1 -0
  73. package/build/server/chunks/chunks/core.js-DDntpb72.js +409 -0
  74. package/build/server/chunks/chunks/core.js-DDntpb72.js.map +1 -0
  75. package/build/server/chunks/chunks/env.js-l0sNRNKZ.js +2 -0
  76. package/build/server/chunks/chunks/env.js-l0sNRNKZ.js.map +1 -0
  77. package/build/server/chunks/chunks/exports.js-CLTzaOxn.js +152 -0
  78. package/build/server/chunks/chunks/exports.js-CLTzaOxn.js.map +1 -0
  79. package/build/server/chunks/chunks/folder-path.js-ytx9ucgg.js +64 -0
  80. package/build/server/chunks/chunks/folder-path.js-ytx9ucgg.js.map +1 -0
  81. package/build/server/chunks/chunks/http.js-Dxoa-jtP.js +100 -0
  82. package/build/server/chunks/chunks/http.js-Dxoa-jtP.js.map +1 -0
  83. package/build/server/chunks/chunks/internal.js-BDBSzJId.js +5753 -0
  84. package/build/server/chunks/chunks/internal.js-BDBSzJId.js.map +1 -0
  85. package/build/server/chunks/chunks/internal2.js-BlXt2rfE.js +22 -0
  86. package/build/server/chunks/chunks/internal2.js-BlXt2rfE.js.map +1 -0
  87. package/{dist/operations-DYM-5KVl.js → build/server/chunks/chunks/library-store.js-BP8cL-qD.js} +344 -444
  88. package/build/server/chunks/chunks/library-store.js-BP8cL-qD.js.map +1 -0
  89. package/build/server/chunks/chunks/manifest-appearance.js-DTk355LQ.js +146 -0
  90. package/build/server/chunks/chunks/manifest-appearance.js-DTk355LQ.js.map +1 -0
  91. package/build/server/chunks/chunks/routing.js-y-tryuip.js +213 -0
  92. package/build/server/chunks/chunks/routing.js-y-tryuip.js.map +1 -0
  93. package/build/server/chunks/chunks/shared.js-BWXgl1Xf.js +255 -0
  94. package/build/server/chunks/chunks/shared.js-BWXgl1Xf.js.map +1 -0
  95. package/build/server/chunks/chunks/utils.js-9oI5Oz0w.js +1048 -0
  96. package/build/server/chunks/chunks/utils.js-9oI5Oz0w.js.map +1 -0
  97. package/build/server/chunks/entries/endpoints/api/_...path_/_server.ts.js-WknZVW_S.js +27 -0
  98. package/build/server/chunks/entries/endpoints/api/_...path_/_server.ts.js-WknZVW_S.js.map +1 -0
  99. package/build/server/chunks/entries/endpoints/api/assets/_id_/_server.ts.js-BrZ__-HZ.js +24 -0
  100. package/build/server/chunks/entries/endpoints/api/assets/_id_/_server.ts.js-BrZ__-HZ.js.map +1 -0
  101. package/build/server/chunks/entries/endpoints/api/assets/_server.ts.js-PqADGPXc.js +45 -0
  102. package/build/server/chunks/entries/endpoints/api/assets/_server.ts.js-PqADGPXc.js.map +1 -0
  103. package/build/server/chunks/entries/endpoints/api/assets/delete/_server.ts.js-OqoE5PN-.js +31 -0
  104. package/build/server/chunks/entries/endpoints/api/assets/delete/_server.ts.js-OqoE5PN-.js.map +1 -0
  105. package/build/server/chunks/entries/endpoints/api/assets/move/_server.ts.js-CJ08e1ho.js +31 -0
  106. package/build/server/chunks/entries/endpoints/api/assets/move/_server.ts.js-CJ08e1ho.js.map +1 -0
  107. package/build/server/chunks/entries/endpoints/api/folders/_path_/_server.ts.js-DdF3eK2I.js +38 -0
  108. package/build/server/chunks/entries/endpoints/api/folders/_path_/_server.ts.js-DdF3eK2I.js.map +1 -0
  109. package/build/server/chunks/entries/endpoints/api/folders/_server.ts.js-Cxt6jsJ5.js +31 -0
  110. package/build/server/chunks/entries/endpoints/api/folders/_server.ts.js-Cxt6jsJ5.js.map +1 -0
  111. package/build/server/chunks/entries/endpoints/api/manifests/_name_/_server.ts.js-BWVM2Ntl.js +24 -0
  112. package/build/server/chunks/entries/endpoints/api/manifests/_name_/_server.ts.js-BWVM2Ntl.js.map +1 -0
  113. package/build/server/chunks/entries/endpoints/api/manifests/_server.ts.js-Z2bM-qHM.js +31 -0
  114. package/build/server/chunks/entries/endpoints/api/manifests/_server.ts.js-Z2bM-qHM.js.map +1 -0
  115. package/build/server/chunks/entries/endpoints/api/state/_server.ts.js-BX9H2Z34.js +24 -0
  116. package/build/server/chunks/entries/endpoints/api/state/_server.ts.js-BX9H2Z34.js.map +1 -0
  117. package/build/server/chunks/entries/endpoints/files/_...path_/_server.ts.js-BWHDZ8mz.js +27 -0
  118. package/build/server/chunks/entries/endpoints/files/_...path_/_server.ts.js-BWHDZ8mz.js.map +1 -0
  119. package/build/server/chunks/entries/endpoints/files/proxy/_...path_/_server.ts.js-CR_7mndO.js +24 -0
  120. package/build/server/chunks/entries/endpoints/files/proxy/_...path_/_server.ts.js-CR_7mndO.js.map +1 -0
  121. package/build/server/chunks/entries/endpoints/files/raw/_...path_/_server.ts.js-Cw1PDBvb.js +24 -0
  122. package/build/server/chunks/entries/endpoints/files/raw/_...path_/_server.ts.js-Cw1PDBvb.js.map +1 -0
  123. package/build/server/chunks/entries/hooks.server.js-BHoE0yBi.js +23 -0
  124. package/build/server/chunks/entries/hooks.server.js-BHoE0yBi.js.map +1 -0
  125. package/build/server/chunks/handler-10cx4zHn.js +1475 -0
  126. package/build/server/chunks/handler-10cx4zHn.js.map +1 -0
  127. package/build/server/chunks/index.js-DvPfiC00.js +3789 -0
  128. package/build/server/chunks/index.js-DvPfiC00.js.map +1 -0
  129. package/build/server/chunks/manifest.js-DoPjUnzD.js +149 -0
  130. package/build/server/chunks/manifest.js-DoPjUnzD.js.map +1 -0
  131. package/build/server/chunks/nodes/0.js-Di3qgAtW.js +11 -0
  132. package/build/server/chunks/nodes/0.js-Di3qgAtW.js.map +1 -0
  133. package/build/server/chunks/nodes/1.js-BlWSFIA8.js +7 -0
  134. package/build/server/chunks/nodes/1.js-BlWSFIA8.js.map +1 -0
  135. package/build/server/chunks/nodes/2.js-CO9nSPUN.js +7 -0
  136. package/build/server/chunks/nodes/2.js-CO9nSPUN.js.map +1 -0
  137. package/build/server/chunks/nodes/3.js-C2D6xpEO.js +7 -0
  138. package/build/server/chunks/nodes/3.js-C2D6xpEO.js.map +1 -0
  139. package/build/server/chunks/nodes/4.js-B3IuagJW.js +7 -0
  140. package/build/server/chunks/nodes/4.js-B3IuagJW.js.map +1 -0
  141. package/build/shims.js +33 -0
  142. package/build/shims.js.map +1 -0
  143. package/dist/cli.d.ts +2 -1
  144. package/dist/cli.js +109 -1332
  145. package/dist/config.d.ts +3 -2
  146. package/dist/config.js +2 -2
  147. package/dist/core/api-types.d.ts +141 -0
  148. package/dist/core/api-types.js +1 -0
  149. package/dist/core/asset-id.d.ts +28 -0
  150. package/dist/core/asset-id.js +59 -0
  151. package/dist/core/asset-reference.d.ts +23 -0
  152. package/dist/core/asset-reference.js +15 -0
  153. package/dist/core/canonicalize.d.ts +9 -0
  154. package/dist/core/canonicalize.js +36 -0
  155. package/dist/core/chroma-key.d.ts +30 -0
  156. package/dist/core/chroma-key.js +55 -0
  157. package/dist/core/config.d.ts +35 -0
  158. package/dist/core/config.js +4 -0
  159. package/dist/core/folder-path.d.ts +19 -0
  160. package/dist/core/folder-path.js +86 -0
  161. package/dist/core/index.d.ts +33 -499
  162. package/dist/core/index.js +17 -962
  163. package/dist/core/ingest.d.ts +18 -0
  164. package/dist/core/ingest.js +58 -0
  165. package/dist/core/library.d.ts +54 -0
  166. package/dist/core/library.js +138 -0
  167. package/dist/core/manifest-appearance.d.ts +35 -0
  168. package/dist/core/manifest-appearance.js +123 -0
  169. package/dist/core/manifest-entry.d.ts +104 -0
  170. package/dist/core/manifest-entry.js +1 -0
  171. package/dist/core/manifest-membership.d.ts +56 -0
  172. package/dist/core/manifest-membership.js +54 -0
  173. package/dist/core/plugins/audio.d.ts +26 -0
  174. package/dist/core/plugins/audio.js +44 -0
  175. package/dist/core/plugins/chroma-key-video.d.ts +29 -0
  176. package/dist/core/plugins/chroma-key-video.js +69 -0
  177. package/dist/core/plugins/contract.d.ts +35 -0
  178. package/dist/core/plugins/contract.js +1 -0
  179. package/dist/core/plugins/image.d.ts +30 -0
  180. package/dist/core/plugins/image.js +45 -0
  181. package/dist/core/plugins/slice.d.ts +22 -0
  182. package/dist/core/plugins/slice.js +60 -0
  183. package/dist/core/plugins/video.d.ts +45 -0
  184. package/dist/core/plugins/video.js +77 -0
  185. package/dist/core/reference-graph.d.ts +41 -0
  186. package/dist/core/reference-graph.js +138 -0
  187. package/dist/core/slice-data.d.ts +61 -0
  188. package/dist/core/slice-data.js +49 -0
  189. package/dist/runtime/chroma-key-gl.d.ts +40 -22
  190. package/dist/runtime/chroma-key-gl.js +189 -183
  191. package/dist/runtime/components/ChromaKeyVideo.svelte +3 -3
  192. package/dist/runtime/components/ChromaKeyVideo.svelte.d.ts +21 -0
  193. package/dist/runtime/components/Image.svelte +1 -1
  194. package/dist/runtime/components/Image.svelte.d.ts +9 -0
  195. package/dist/runtime/components/Slice.svelte +1 -1
  196. package/dist/runtime/components/Slice.svelte.d.ts +19 -0
  197. package/dist/runtime/components/SliceCanvas.svelte +3 -3
  198. package/dist/runtime/components/SliceCanvas.svelte.d.ts +10 -0
  199. package/dist/runtime/components/SliceDom.svelte +3 -3
  200. package/dist/runtime/components/SliceDom.svelte.d.ts +10 -0
  201. package/dist/runtime/components/Video.svelte +2 -2
  202. package/dist/runtime/components/Video.svelte.d.ts +18 -0
  203. package/dist/runtime/geometry.d.ts +55 -35
  204. package/dist/runtime/geometry.js +186 -191
  205. package/dist/runtime/index.d.ts +9 -9
  206. package/dist/runtime/index.js +9 -9
  207. package/dist/runtime/kind-handlers.d.ts +33 -24
  208. package/dist/runtime/kind-handlers.js +74 -65
  209. package/dist/runtime/manifest.d.ts +53 -47
  210. package/dist/runtime/manifest.js +133 -113
  211. package/dist/runtime/observe-border-box-size.d.ts +1 -4
  212. package/dist/runtime/observe-border-box-size.js +9 -10
  213. package/dist/runtime/preload-registry.d.ts +22 -8
  214. package/dist/runtime/preload-registry.js +65 -62
  215. package/dist/server/build.d.ts +8 -0
  216. package/dist/server/build.js +25 -0
  217. package/dist/server/check.d.ts +24 -0
  218. package/dist/server/check.js +199 -0
  219. package/dist/server/cli-commands.d.ts +25 -0
  220. package/dist/server/cli-commands.js +1178 -0
  221. package/dist/server/cli-init.d.ts +3 -0
  222. package/dist/server/cli-init.js +53 -0
  223. package/dist/server/cli-io.d.ts +46 -0
  224. package/dist/server/cli-io.js +105 -0
  225. package/dist/server/codegen.d.ts +58 -0
  226. package/dist/server/codegen.js +185 -0
  227. package/dist/server/config-loader.d.ts +34 -0
  228. package/dist/server/config-loader.js +103 -0
  229. package/dist/server/context.d.ts +8 -0
  230. package/dist/server/context.js +19 -0
  231. package/dist/server/folder-filesystem.d.ts +7 -0
  232. package/dist/server/folder-filesystem.js +39 -0
  233. package/dist/server/http.d.ts +12 -0
  234. package/dist/server/http.js +100 -0
  235. package/dist/server/index.d.ts +16 -0
  236. package/dist/server/index.js +9 -0
  237. package/dist/server/job-hash.d.ts +10 -0
  238. package/dist/server/job-hash.js +23 -0
  239. package/dist/server/library-store.d.ts +82 -0
  240. package/dist/server/library-store.js +763 -0
  241. package/dist/server/operations.d.ts +87 -0
  242. package/dist/server/operations.js +427 -0
  243. package/dist/server/plugins/audio.d.ts +7 -0
  244. package/dist/server/plugins/audio.js +27 -0
  245. package/dist/server/plugins/chroma-key-video.d.ts +9 -0
  246. package/dist/server/plugins/chroma-key-video.js +38 -0
  247. package/dist/server/plugins/contract.d.ts +100 -0
  248. package/dist/server/plugins/contract.js +16 -0
  249. package/dist/server/plugins/image.d.ts +8 -0
  250. package/dist/server/plugins/image.js +30 -0
  251. package/dist/server/plugins/slice.d.ts +14 -0
  252. package/dist/server/plugins/slice.js +63 -0
  253. package/dist/server/plugins/video.d.ts +6 -0
  254. package/dist/server/plugins/video.js +29 -0
  255. package/dist/server/plugins.d.ts +23 -0
  256. package/dist/server/plugins.js +33 -0
  257. package/dist/server/processing/audio-processing.d.ts +17 -0
  258. package/dist/server/processing/audio-processing.js +46 -0
  259. package/dist/server/processing/ffmpeg.d.ts +9 -0
  260. package/dist/server/processing/ffmpeg.js +50 -0
  261. package/dist/server/processing/image-processing.d.ts +16 -0
  262. package/dist/server/processing/image-processing.js +26 -0
  263. package/dist/server/processing/media-probe.d.ts +15 -0
  264. package/dist/server/processing/media-probe.js +27 -0
  265. package/dist/server/processing/processor.d.ts +50 -0
  266. package/dist/server/processing/processor.js +158 -0
  267. package/dist/server/processing/video-processing.d.ts +35 -0
  268. package/dist/server/processing/video-processing.js +87 -0
  269. package/dist/server/server.d.ts +13 -0
  270. package/dist/server/server.js +57 -0
  271. package/dist/server/start.d.ts +1 -0
  272. package/dist/server/start.js +33 -0
  273. package/package.json +29 -16
  274. package/dist/build-CZYFLLvl.js +0 -191
  275. package/dist/core/image-Dqmz8FXS.js +0 -54
  276. package/dist/core/reference-graph-CjuHbLDw.d.ts +0 -280
  277. package/dist/core/testing.d.ts +0 -27
  278. package/dist/core/testing.js +0 -80
  279. package/dist/editor/200.html +0 -37
  280. package/dist/editor/_app/immutable/assets/2.DIbbW7U1.css +0 -1
  281. package/dist/editor/_app/immutable/assets/3.C-9vFQ9A.css +0 -1
  282. package/dist/editor/_app/immutable/assets/4.BS8ElpOV.css +0 -1
  283. package/dist/editor/_app/immutable/assets/ConfirmDialog.CHEISE-L.css +0 -1
  284. package/dist/editor/_app/immutable/assets/LibraryContextMenu.CDjCmdV-.css +0 -1
  285. package/dist/editor/_app/immutable/chunks/Cx6qtxJg.js +0 -1
  286. package/dist/editor/_app/immutable/chunks/n7mvYc42.js +0 -5
  287. package/dist/editor/_app/immutable/entry/start.C8HHOLly.js +0 -1
  288. package/dist/editor/_app/immutable/nodes/3.WO7tZH_d.js +0 -104
  289. package/dist/editor/_app/immutable/nodes/4.DQtx17aW.js +0 -2
  290. package/dist/editor/_app/version.json +0 -1
  291. package/dist/index.d.ts +0 -370
  292. package/dist/index.js +0 -4
  293. package/dist/start-Bhnqt9Dc.js +0 -279
  294. package/dist/start-D2IXOrni.js +0 -2
  295. /package/{dist/editor → build/client}/_app/immutable/assets/0.DLhIsYA_.css +0 -0
  296. /package/{dist/editor → build/client}/_app/immutable/chunks/Bjy-W4x2.js +0 -0
  297. /package/{dist/editor → build/client}/_app/immutable/chunks/CNRz3sSw.js +0 -0
  298. /package/{dist/editor → build/client}/_app/immutable/chunks/CO4RBJfa.js +0 -0
  299. /package/{dist/editor → build/client}/_app/immutable/chunks/DjdrdRzT.js +0 -0
  300. /package/{dist/editor → build/client}/_app/immutable/chunks/xihTtKlq.js +0 -0
@@ -0,0 +1,10 @@
1
+ import type { SliceManifestEntry } from '../../core/index.js';
2
+ interface Props {
3
+ src: SliceManifestEntry;
4
+ /** Accessible label for the rendered graphic. */
5
+ alt?: string;
6
+ class?: string;
7
+ }
8
+ declare const SliceCanvas: import("svelte").Component<Props, {}, "">;
9
+ type SliceCanvas = ReturnType<typeof SliceCanvas>;
10
+ export default SliceCanvas;
@@ -15,9 +15,9 @@
15
15
  layout box.
16
16
  -->
17
17
  <script lang="ts">
18
- import type { SliceManifestEntry } from '#fundus/core';
19
- import { computeRenderCells, effectiveOverdraw } from '../geometry';
20
- import { observeBorderBoxSize } from '../observe-border-box-size';
18
+ import type { SliceManifestEntry } from '../../core/index.js';
19
+ import { computeRenderCells, effectiveOverdraw } from '../geometry.js';
20
+ import { observeBorderBoxSize } from '../observe-border-box-size.js';
21
21
 
22
22
  interface Props {
23
23
  src: SliceManifestEntry;
@@ -0,0 +1,10 @@
1
+ import type { SliceManifestEntry } from '../../core/index.js';
2
+ interface Props {
3
+ src: SliceManifestEntry;
4
+ /** Accessible label for the rendered graphic. */
5
+ alt?: string;
6
+ class?: string;
7
+ }
8
+ declare const SliceDom: import("svelte").Component<Props, {}, "">;
9
+ type SliceDom = ReturnType<typeof SliceDom>;
10
+ export default SliceDom;
@@ -5,8 +5,8 @@
5
5
  where and how it plays is host behavior, so loop/playing/muted/controls stay props.
6
6
  -->
7
7
  <script lang="ts">
8
- import type { VideoManifestEntry } from '#fundus/core';
9
- import { resolveRetainedSource } from '../preload-registry';
8
+ import type { VideoManifestEntry } from '../../core/index.js';
9
+ import { resolveRetainedSource } from '../preload-registry.js';
10
10
 
11
11
  interface Props {
12
12
  src: VideoManifestEntry;
@@ -0,0 +1,18 @@
1
+ import type { VideoManifestEntry } from '../../core/index.js';
2
+ interface Props {
3
+ src: VideoManifestEntry;
4
+ /** Loop playback (default false — a plain clip ends unless the host says otherwise). */
5
+ loop?: boolean;
6
+ /** Playback on/off (default true). */
7
+ playing?: boolean;
8
+ /** Muted (default true — required for autoplay in every mobile browser). */
9
+ muted?: boolean;
10
+ /** Show native playback controls (default false). */
11
+ controls?: boolean;
12
+ /** Bindable handle on the underlying element, so a host can drive playback itself. */
13
+ videoElement?: HTMLVideoElement;
14
+ class?: string;
15
+ }
16
+ declare const Video: import("svelte").Component<Props, {}, "videoElement">;
17
+ type Video = ReturnType<typeof Video>;
18
+ export default Video;
@@ -1,31 +1,53 @@
1
- import { SliceInsets, SliceManifestEntry } from "#fundus/core";
2
-
3
- //#region src/geometry.d.ts
1
+ /**
2
+ * Pure slice geometry operating on a `SliceManifestEntry` (slicing + source
3
+ * dimensions). Given an entry and the box (container) size in
4
+ * CSS pixels, it returns the cells to paint — each with its SOURCE rect
5
+ * (pixels, for sampling the image) and DEST rect (CSS pixels within the box).
6
+ * One function covers all modes:
7
+ *
8
+ * - `nine` — corners are fixed at their logical size (inset ÷
9
+ * pixelRatio); edges stretch one axis, the center stretches both.
10
+ * - `three-horizontal` — left/right caps fill the box height (cross axis) keeping
11
+ * their aspect ratio (so they scale with the box); the center stretches across
12
+ * the remaining width.
13
+ * - `three-vertical` — top/bottom caps fill the box width keeping their aspect
14
+ * ratio; the middle stretches down the remaining height.
15
+ * - `one` — no slicing: the whole image is one cell stretched to
16
+ * fill the box on both axes (per-axis scale, like a plain `<img>`).
17
+ *
18
+ * **Overdraw** (`slicing.overdraw`): a baked-in drop shadow / glow band around
19
+ * the actual element. The image minus the overdraw is the element core; the core
20
+ * fills the layout box and the overdraw is painted outside it. Implemented by
21
+ * rendering into a virtual box expanded by the overdraw's destination size on
22
+ * each side and shifting every cell back by that amount — so cells can have
23
+ * negative `dx`/`dy` and extend past the box (like a CSS `box-shadow`).
24
+ */
25
+ import type { SliceInsets, SliceManifestEntry } from '../core/index.js';
4
26
  /** One cell to paint: a source rect (px) drawn into a dest rect (CSS px). */
5
- interface RenderCell {
6
- key: string;
7
- /** Source rect, in source pixels. */
8
- sx: number;
9
- sy: number;
10
- sw: number;
11
- sh: number;
12
- /** Destination rect within the box, in CSS pixels (integers, abutting). */
13
- dx: number;
14
- dy: number;
15
- dw: number;
16
- dh: number;
27
+ export interface RenderCell {
28
+ key: string;
29
+ /** Source rect, in source pixels. */
30
+ sx: number;
31
+ sy: number;
32
+ sw: number;
33
+ sh: number;
34
+ /** Destination rect within the box, in CSS pixels (integers, abutting). */
35
+ dx: number;
36
+ dy: number;
37
+ dw: number;
38
+ dh: number;
17
39
  }
18
40
  /**
19
41
  * The insets that actually apply for the entry's mode: a 3-slice mode zeroes out
20
42
  * the axis it does not use (and `one` uses none at all), so callers never have
21
43
  * to special-case the mode.
22
44
  */
23
- declare function effectiveInsets(entry: SliceManifestEntry): SliceInsets;
45
+ export declare function effectiveInsets(entry: SliceManifestEntry): SliceInsets;
24
46
  /**
25
47
  * The overdraw that actually applies: zeros when absent, clamped so a core of at
26
48
  * least one source pixel remains on each axis.
27
49
  */
28
- declare function effectiveOverdraw(entry: SliceManifestEntry): SliceInsets;
50
+ export declare function effectiveOverdraw(entry: SliceManifestEntry): SliceInsets;
29
51
  /**
30
52
  * The overdraw's per-side destination size in CSS pixels for a box — how far the
31
53
  * painted slice extends past the layout box on each side. Rounded to integers so
@@ -34,7 +56,7 @@ declare function effectiveOverdraw(entry: SliceManifestEntry): SliceInsets;
34
56
  * the caps: box cross-axis ÷ the layout box (image minus overdraw). In `one`
35
57
  * mode the image stretches per axis, so each axis scales independently.
36
58
  */
37
- declare function computeOverdrawDestination(entry: SliceManifestEntry, boxWidth: number, boxHeight: number): SliceInsets;
59
+ export declare function computeOverdrawDestination(entry: SliceManifestEntry, boxWidth: number, boxHeight: number): SliceInsets;
38
60
  /**
39
61
  * How the canvas backend's `<canvas>` relates to the layout box: with overdraw
40
62
  * the canvas is enlarged by the overdraw's destination size and offset
@@ -44,32 +66,30 @@ declare function computeOverdrawDestination(entry: SliceManifestEntry, boxWidth:
44
66
  * origin sits at the layout box's top-left in device pixels — so the (possibly
45
67
  * negative) cell coordinates from `computeRenderCells` apply directly.
46
68
  */
47
- interface CanvasPaintLayout {
48
- /** CSS offset of the canvas within the wrapper (0 or negative — overdraw). */
49
- cssLeft: number;
50
- cssTop: number;
51
- /** CSS size of the canvas (box expanded by the overdraw's destination size). */
52
- cssWidth: number;
53
- cssHeight: number;
54
- /** Backing-store size in device pixels (CSS size × devicePixelRatio). */
55
- backingWidth: number;
56
- backingHeight: number;
57
- /** Paint origin (the layout box's top-left) in device pixels. */
58
- originX: number;
59
- originY: number;
69
+ export interface CanvasPaintLayout {
70
+ /** CSS offset of the canvas within the wrapper (0 or negative — overdraw). */
71
+ cssLeft: number;
72
+ cssTop: number;
73
+ /** CSS size of the canvas (box expanded by the overdraw's destination size). */
74
+ cssWidth: number;
75
+ cssHeight: number;
76
+ /** Backing-store size in device pixels (CSS size × devicePixelRatio). */
77
+ backingWidth: number;
78
+ backingHeight: number;
79
+ /** Paint origin (the layout box's top-left) in device pixels. */
80
+ originX: number;
81
+ originY: number;
60
82
  }
61
83
  /**
62
84
  * The canvas geometry for a slice filling a `boxWidth × boxHeight` layout box
63
85
  * at the given `devicePixelRatio` (the display's, not the asset's export
64
86
  * scale). Pure — the canvas backend derives every size and offset from this.
65
87
  */
66
- declare function computeCanvasPaintLayout(entry: SliceManifestEntry, boxWidth: number, boxHeight: number, devicePixelRatio: number): CanvasPaintLayout;
88
+ export declare function computeCanvasPaintLayout(entry: SliceManifestEntry, boxWidth: number, boxHeight: number, devicePixelRatio: number): CanvasPaintLayout;
67
89
  /**
68
90
  * Compute the cells to paint for a slice filling a `boxWidth × boxHeight` box.
69
91
  * Returns an empty array for a zero-size box. With overdraw the cells cover the
70
92
  * box expanded by `computeOverdrawDestination` on each side, so `dx`/`dy` can be
71
93
  * negative and cells can extend past the box.
72
94
  */
73
- declare function computeRenderCells(entry: SliceManifestEntry, boxWidth: number, boxHeight: number): RenderCell[];
74
- //#endregion
75
- export { CanvasPaintLayout, RenderCell, computeCanvasPaintLayout, computeOverdrawDestination, computeRenderCells, effectiveInsets, effectiveOverdraw };
95
+ export declare function computeRenderCells(entry: SliceManifestEntry, boxWidth: number, boxHeight: number): RenderCell[];
@@ -1,209 +1,204 @@
1
- import { createZeroInsets, slicedAxesFor } from "#fundus/core";
2
- //#region src/geometry.ts
1
+ import { createZeroInsets, slicedAxesFor } from '../core/index.js';
3
2
  function clamp(value, min, max) {
4
- return Math.max(min, Math.min(max, value));
3
+ return Math.max(min, Math.min(max, value));
5
4
  }
6
5
  /**
7
- * The insets that actually apply for the entry's mode: a 3-slice mode zeroes out
8
- * the axis it does not use (and `one` uses none at all), so callers never have
9
- * to special-case the mode.
10
- */
11
- function effectiveInsets(entry) {
12
- const { mode, insets } = entry.slicing;
13
- const axes = slicedAxesFor(mode);
14
- return {
15
- top: axes.vertical ? insets.top : 0,
16
- bottom: axes.vertical ? insets.bottom : 0,
17
- left: axes.horizontal ? insets.left : 0,
18
- right: axes.horizontal ? insets.right : 0
19
- };
6
+ * The insets that actually apply for the entry's mode: a 3-slice mode zeroes out
7
+ * the axis it does not use (and `one` uses none at all), so callers never have
8
+ * to special-case the mode.
9
+ */
10
+ export function effectiveInsets(entry) {
11
+ const { mode, insets } = entry.slicing;
12
+ const axes = slicedAxesFor(mode);
13
+ return {
14
+ top: axes.vertical ? insets.top : 0,
15
+ bottom: axes.vertical ? insets.bottom : 0,
16
+ left: axes.horizontal ? insets.left : 0,
17
+ right: axes.horizontal ? insets.right : 0
18
+ };
20
19
  }
21
20
  /**
22
- * The overdraw that actually applies: zeros when absent, clamped so a core of at
23
- * least one source pixel remains on each axis.
24
- */
25
- function effectiveOverdraw(entry) {
26
- const overdraw = entry.slicing.overdraw;
27
- if (!overdraw) return createZeroInsets();
28
- const width = entry.sourceWidth;
29
- const height = entry.sourceHeight;
30
- const left = clamp(overdraw.left, 0, Math.max(0, width - 1));
31
- const right = clamp(overdraw.right, 0, Math.max(0, width - left - 1));
32
- const top = clamp(overdraw.top, 0, Math.max(0, height - 1));
33
- return {
34
- top,
35
- right,
36
- bottom: clamp(overdraw.bottom, 0, Math.max(0, height - top - 1)),
37
- left
38
- };
21
+ * The overdraw that actually applies: zeros when absent, clamped so a core of at
22
+ * least one source pixel remains on each axis.
23
+ */
24
+ export function effectiveOverdraw(entry) {
25
+ const overdraw = entry.slicing.overdraw;
26
+ if (!overdraw)
27
+ return createZeroInsets();
28
+ // Mirrors core's authoring `maxOverdraw` bound; this survives hand-edited libraries.
29
+ const width = entry.sourceWidth;
30
+ const height = entry.sourceHeight;
31
+ const left = clamp(overdraw.left, 0, Math.max(0, width - 1));
32
+ const right = clamp(overdraw.right, 0, Math.max(0, width - left - 1));
33
+ const top = clamp(overdraw.top, 0, Math.max(0, height - 1));
34
+ const bottom = clamp(overdraw.bottom, 0, Math.max(0, height - top - 1));
35
+ return { top, right, bottom, left };
39
36
  }
40
37
  /**
41
- * The layout box — the image minus its effective overdraw — in **source pixels**
42
- * Never smaller than one source pixel per axis (`effectiveOverdraw` guarantees
43
- * a remaining box).
44
- */
38
+ * The layout box — the image minus its effective overdraw — in **source pixels**
39
+ * Never smaller than one source pixel per axis (`effectiveOverdraw` guarantees
40
+ * a remaining box).
41
+ */
45
42
  function sourceLayoutSize(entry) {
46
- const overdraw = effectiveOverdraw(entry);
47
- return {
48
- width: Math.max(1, entry.sourceWidth - overdraw.left - overdraw.right),
49
- height: Math.max(1, entry.sourceHeight - overdraw.top - overdraw.bottom)
50
- };
43
+ const overdraw = effectiveOverdraw(entry);
44
+ return {
45
+ width: Math.max(1, entry.sourceWidth - overdraw.left - overdraw.right),
46
+ height: Math.max(1, entry.sourceHeight - overdraw.top - overdraw.bottom)
47
+ };
51
48
  }
52
49
  /**
53
- * The overdraw's per-side destination size in CSS pixels for a box — how far the
54
- * painted slice extends past the layout box on each side. Rounded to integers so
55
- * cells keep abutting on integer pixels. For a 9-slice the overdraw is a fixed
56
- * band (÷ `pixelRatio`, like the corners); for the 3-slice modes it scales with
57
- * the caps: box cross-axis ÷ the layout box (image minus overdraw). In `one`
58
- * mode the image stretches per axis, so each axis scales independently.
59
- */
60
- function computeOverdrawDestination(entry, boxWidth, boxHeight) {
61
- const overdraw = effectiveOverdraw(entry);
62
- if (overdraw.top === 0 && overdraw.right === 0 && overdraw.bottom === 0 && overdraw.left === 0) return overdraw;
63
- const pixelRatio = entry.slicing.pixelRatio > 0 ? entry.slicing.pixelRatio : 1;
64
- const sourceLayout = sourceLayoutSize(entry);
65
- let horizontalScale;
66
- let verticalScale;
67
- if (entry.slicing.mode === "three-horizontal") horizontalScale = verticalScale = boxHeight / sourceLayout.height;
68
- else if (entry.slicing.mode === "three-vertical") horizontalScale = verticalScale = boxWidth / sourceLayout.width;
69
- else if (entry.slicing.mode === "one") {
70
- horizontalScale = boxWidth / sourceLayout.width;
71
- verticalScale = boxHeight / sourceLayout.height;
72
- } else horizontalScale = verticalScale = 1 / pixelRatio;
73
- return {
74
- top: Math.round(overdraw.top * verticalScale),
75
- right: Math.round(overdraw.right * horizontalScale),
76
- bottom: Math.round(overdraw.bottom * verticalScale),
77
- left: Math.round(overdraw.left * horizontalScale)
78
- };
50
+ * The overdraw's per-side destination size in CSS pixels for a box — how far the
51
+ * painted slice extends past the layout box on each side. Rounded to integers so
52
+ * cells keep abutting on integer pixels. For a 9-slice the overdraw is a fixed
53
+ * band (÷ `pixelRatio`, like the corners); for the 3-slice modes it scales with
54
+ * the caps: box cross-axis ÷ the layout box (image minus overdraw). In `one`
55
+ * mode the image stretches per axis, so each axis scales independently.
56
+ */
57
+ export function computeOverdrawDestination(entry, boxWidth, boxHeight) {
58
+ const overdraw = effectiveOverdraw(entry);
59
+ if (overdraw.top === 0 && overdraw.right === 0 && overdraw.bottom === 0 && overdraw.left === 0) {
60
+ return overdraw;
61
+ }
62
+ const pixelRatio = entry.slicing.pixelRatio > 0 ? entry.slicing.pixelRatio : 1;
63
+ const sourceLayout = sourceLayoutSize(entry);
64
+ let horizontalScale;
65
+ let verticalScale;
66
+ if (entry.slicing.mode === 'three-horizontal') {
67
+ horizontalScale = verticalScale = boxHeight / sourceLayout.height;
68
+ }
69
+ else if (entry.slicing.mode === 'three-vertical') {
70
+ horizontalScale = verticalScale = boxWidth / sourceLayout.width;
71
+ }
72
+ else if (entry.slicing.mode === 'one') {
73
+ horizontalScale = boxWidth / sourceLayout.width;
74
+ verticalScale = boxHeight / sourceLayout.height;
75
+ }
76
+ else {
77
+ horizontalScale = verticalScale = 1 / pixelRatio;
78
+ }
79
+ return {
80
+ top: Math.round(overdraw.top * verticalScale),
81
+ right: Math.round(overdraw.right * horizontalScale),
82
+ bottom: Math.round(overdraw.bottom * verticalScale),
83
+ left: Math.round(overdraw.left * horizontalScale)
84
+ };
79
85
  }
80
86
  /**
81
- * The canvas geometry for a slice filling a `boxWidth × boxHeight` layout box
82
- * at the given `devicePixelRatio` (the display's, not the asset's export
83
- * scale). Pure — the canvas backend derives every size and offset from this.
84
- */
85
- function computeCanvasPaintLayout(entry, boxWidth, boxHeight, devicePixelRatio) {
86
- const overdrawDestination = computeOverdrawDestination(entry, boxWidth, boxHeight);
87
- const cssWidth = boxWidth + overdrawDestination.left + overdrawDestination.right;
88
- const cssHeight = boxHeight + overdrawDestination.top + overdrawDestination.bottom;
89
- return {
90
- cssLeft: -overdrawDestination.left + 0,
91
- cssTop: -overdrawDestination.top + 0,
92
- cssWidth,
93
- cssHeight,
94
- backingWidth: Math.round(cssWidth * devicePixelRatio),
95
- backingHeight: Math.round(cssHeight * devicePixelRatio),
96
- originX: overdrawDestination.left * devicePixelRatio,
97
- originY: overdrawDestination.top * devicePixelRatio
98
- };
87
+ * The canvas geometry for a slice filling a `boxWidth × boxHeight` layout box
88
+ * at the given `devicePixelRatio` (the display's, not the asset's export
89
+ * scale). Pure — the canvas backend derives every size and offset from this.
90
+ */
91
+ export function computeCanvasPaintLayout(entry, boxWidth, boxHeight, devicePixelRatio) {
92
+ const overdrawDestination = computeOverdrawDestination(entry, boxWidth, boxHeight);
93
+ const cssWidth = boxWidth + overdrawDestination.left + overdrawDestination.right;
94
+ const cssHeight = boxHeight + overdrawDestination.top + overdrawDestination.bottom;
95
+ return {
96
+ // `+ 0` normalizes the negative zero a zero overdraw would produce.
97
+ cssLeft: -overdrawDestination.left + 0,
98
+ cssTop: -overdrawDestination.top + 0,
99
+ cssWidth,
100
+ cssHeight,
101
+ backingWidth: Math.round(cssWidth * devicePixelRatio),
102
+ backingHeight: Math.round(cssHeight * devicePixelRatio),
103
+ originX: overdrawDestination.left * devicePixelRatio,
104
+ originY: overdrawDestination.top * devicePixelRatio
105
+ };
99
106
  }
100
107
  /** Cumulative, rounded edges so adjacent cells abut exactly on integer pixels. */
101
108
  function cumulativeEdges(sizes) {
102
- let accumulated = 0;
103
- const edges = [0];
104
- for (const size of sizes) {
105
- accumulated += size;
106
- edges.push(Math.round(accumulated));
107
- }
108
- return edges;
109
+ let accumulated = 0;
110
+ const edges = [0];
111
+ for (const size of sizes) {
112
+ accumulated += size;
113
+ edges.push(Math.round(accumulated));
114
+ }
115
+ return edges;
109
116
  }
110
117
  /**
111
- * Compute the cells to paint for a slice filling a `boxWidth × boxHeight` box.
112
- * Returns an empty array for a zero-size box. With overdraw the cells cover the
113
- * box expanded by `computeOverdrawDestination` on each side, so `dx`/`dy` can be
114
- * negative and cells can extend past the box.
115
- */
116
- function computeRenderCells(entry, boxWidth, boxHeight) {
117
- if (boxWidth <= 0 || boxHeight <= 0) return [];
118
- const overdrawDestination = computeOverdrawDestination(entry, boxWidth, boxHeight);
119
- const paintWidth = boxWidth + overdrawDestination.left + overdrawDestination.right;
120
- const paintHeight = boxHeight + overdrawDestination.top + overdrawDestination.bottom;
121
- const width = entry.sourceWidth;
122
- const height = entry.sourceHeight;
123
- const pixelRatio = entry.slicing.pixelRatio > 0 ? entry.slicing.pixelRatio : 1;
124
- const mode = entry.slicing.mode;
125
- const insets = effectiveInsets(entry);
126
- const left = clamp(insets.left, 0, width);
127
- const right = clamp(insets.right, 0, Math.max(0, width - left));
128
- const top = clamp(insets.top, 0, height);
129
- const bottom = clamp(insets.bottom, 0, Math.max(0, height - top));
130
- const centerWidth = Math.max(0, width - left - right);
131
- const centerHeight = Math.max(0, height - top - bottom);
132
- let leftDestination;
133
- let rightDestination;
134
- if (mode === "three-horizontal") {
135
- const scale = paintHeight / height;
136
- leftDestination = left * scale;
137
- rightDestination = right * scale;
138
- } else {
139
- leftDestination = left / pixelRatio;
140
- rightDestination = right / pixelRatio;
141
- }
142
- const centerDestinationWidth = Math.max(0, paintWidth - leftDestination - rightDestination);
143
- let topDestination;
144
- let bottomDestination;
145
- if (mode === "three-vertical") {
146
- const scale = paintWidth / width;
147
- topDestination = top * scale;
148
- bottomDestination = bottom * scale;
149
- } else {
150
- topDestination = top / pixelRatio;
151
- bottomDestination = bottom / pixelRatio;
152
- }
153
- const centerDestinationHeight = Math.max(0, paintHeight - topDestination - bottomDestination);
154
- const sourceColumns = [
155
- left,
156
- centerWidth,
157
- right
158
- ];
159
- const sourceRows = [
160
- top,
161
- centerHeight,
162
- bottom
163
- ];
164
- const sourceColumnStarts = [
165
- 0,
166
- left,
167
- left + centerWidth
168
- ];
169
- const sourceRowStarts = [
170
- 0,
171
- top,
172
- top + centerHeight
173
- ];
174
- const columnEdges = cumulativeEdges([
175
- leftDestination,
176
- centerDestinationWidth,
177
- rightDestination
178
- ]);
179
- const rowEdges = cumulativeEdges([
180
- topDestination,
181
- centerDestinationHeight,
182
- bottomDestination
183
- ]);
184
- const cells = [];
185
- for (let row = 0; row < 3; row++) for (let column = 0; column < 3; column++) {
186
- const sw = sourceColumns[column];
187
- const sh = sourceRows[row];
188
- if (sw <= 0 || sh <= 0) continue;
189
- const dx = columnEdges[column];
190
- const dw = columnEdges[column + 1] - dx;
191
- const dy = rowEdges[row];
192
- const dh = rowEdges[row + 1] - dy;
193
- if (dw <= 0 || dh <= 0) continue;
194
- cells.push({
195
- key: `${row}-${column}`,
196
- sx: sourceColumnStarts[column],
197
- sy: sourceRowStarts[row],
198
- sw,
199
- sh,
200
- dx: dx - overdrawDestination.left,
201
- dy: dy - overdrawDestination.top,
202
- dw,
203
- dh
204
- });
205
- }
206
- return cells;
118
+ * Compute the cells to paint for a slice filling a `boxWidth × boxHeight` box.
119
+ * Returns an empty array for a zero-size box. With overdraw the cells cover the
120
+ * box expanded by `computeOverdrawDestination` on each side, so `dx`/`dy` can be
121
+ * negative and cells can extend past the box.
122
+ */
123
+ export function computeRenderCells(entry, boxWidth, boxHeight) {
124
+ if (boxWidth <= 0 || boxHeight <= 0)
125
+ return [];
126
+ // Render into a virtual box expanded by the overdraw, then shift every cell
127
+ // back so the element core lands exactly in the layout box.
128
+ const overdrawDestination = computeOverdrawDestination(entry, boxWidth, boxHeight);
129
+ const paintWidth = boxWidth + overdrawDestination.left + overdrawDestination.right;
130
+ const paintHeight = boxHeight + overdrawDestination.top + overdrawDestination.bottom;
131
+ const width = entry.sourceWidth;
132
+ const height = entry.sourceHeight;
133
+ const pixelRatio = entry.slicing.pixelRatio > 0 ? entry.slicing.pixelRatio : 1;
134
+ const mode = entry.slicing.mode;
135
+ const insets = effectiveInsets(entry);
136
+ const left = clamp(insets.left, 0, width);
137
+ const right = clamp(insets.right, 0, Math.max(0, width - left));
138
+ const top = clamp(insets.top, 0, height);
139
+ const bottom = clamp(insets.bottom, 0, Math.max(0, height - top));
140
+ const centerWidth = Math.max(0, width - left - right);
141
+ const centerHeight = Math.max(0, height - top - bottom);
142
+ // Horizontal dest sizes for [left, center, right].
143
+ let leftDestination;
144
+ let rightDestination;
145
+ if (mode === 'three-horizontal') {
146
+ // Caps fill the box height (cross axis), scaling uniformly to keep aspect.
147
+ const scale = paintHeight / height;
148
+ leftDestination = left * scale;
149
+ rightDestination = right * scale;
150
+ }
151
+ else {
152
+ // 9-slice: fixed corners at logical size. three-vertical: left = right = 0.
153
+ leftDestination = left / pixelRatio;
154
+ rightDestination = right / pixelRatio;
155
+ }
156
+ const centerDestinationWidth = Math.max(0, paintWidth - leftDestination - rightDestination);
157
+ // Vertical dest sizes for [top, center, bottom].
158
+ let topDestination;
159
+ let bottomDestination;
160
+ if (mode === 'three-vertical') {
161
+ // Caps fill the box width (cross axis), scaling uniformly to keep aspect.
162
+ const scale = paintWidth / width;
163
+ topDestination = top * scale;
164
+ bottomDestination = bottom * scale;
165
+ }
166
+ else {
167
+ topDestination = top / pixelRatio;
168
+ bottomDestination = bottom / pixelRatio;
169
+ }
170
+ const centerDestinationHeight = Math.max(0, paintHeight - topDestination - bottomDestination);
171
+ const sourceColumns = [left, centerWidth, right];
172
+ const sourceRows = [top, centerHeight, bottom];
173
+ const sourceColumnStarts = [0, left, left + centerWidth];
174
+ const sourceRowStarts = [0, top, top + centerHeight];
175
+ const columnEdges = cumulativeEdges([leftDestination, centerDestinationWidth, rightDestination]);
176
+ const rowEdges = cumulativeEdges([topDestination, centerDestinationHeight, bottomDestination]);
177
+ const cells = [];
178
+ for (let row = 0; row < 3; row++) {
179
+ for (let column = 0; column < 3; column++) {
180
+ const sw = sourceColumns[column];
181
+ const sh = sourceRows[row];
182
+ if (sw <= 0 || sh <= 0)
183
+ continue;
184
+ const dx = columnEdges[column];
185
+ const dw = columnEdges[column + 1] - dx;
186
+ const dy = rowEdges[row];
187
+ const dh = rowEdges[row + 1] - dy;
188
+ if (dw <= 0 || dh <= 0)
189
+ continue;
190
+ cells.push({
191
+ key: `${row}-${column}`,
192
+ sx: sourceColumnStarts[column],
193
+ sy: sourceRowStarts[row],
194
+ sw,
195
+ sh,
196
+ dx: dx - overdrawDestination.left,
197
+ dy: dy - overdrawDestination.top,
198
+ dw,
199
+ dh
200
+ });
201
+ }
202
+ }
203
+ return cells;
207
204
  }
208
- //#endregion
209
- export { computeCanvasPaintLayout, computeOverdrawDestination, computeRenderCells, effectiveInsets, effectiveOverdraw };
@@ -1,9 +1,9 @@
1
- import { Manifest, createManifest } from "./manifest.js";
2
- import { resolveRetainedSource } from "./preload-registry.js";
3
- import { audioSourceOf } from "./kind-handlers.js";
4
- import { AudioManifestEntry, AudioPreloadOptions, ChromaKeyParameters, ChromaKeyVideoManifestEntry, ChromaKeyVideoPreloadOptions, DEFAULT_CHROMA_KEY_PARAMETERS, ImageManifestEntry, ImagePreloadOptions, ManifestEntry, PreloadOptions, SliceManifestEntry, SlicePreloadOptions, VideoManifestEntry, VideoPreloadOptions } from "#fundus/core";
5
- import Image from "./components/Image.svelte";
6
- import Slice from "./components/Slice.svelte";
7
- import Video from "./components/Video.svelte";
8
- import ChromaKeyVideo from "./components/ChromaKeyVideo.svelte";
9
- export { type AudioManifestEntry, type AudioPreloadOptions, type ChromaKeyParameters, ChromaKeyVideo, type ChromaKeyVideoManifestEntry, type ChromaKeyVideoPreloadOptions, DEFAULT_CHROMA_KEY_PARAMETERS, Image, type ImageManifestEntry, type ImagePreloadOptions, Manifest, type ManifestEntry, type PreloadOptions, Slice, type SliceManifestEntry, type SlicePreloadOptions, Video, type VideoManifestEntry, type VideoPreloadOptions, audioSourceOf, createManifest, resolveRetainedSource };
1
+ export { Manifest, createManifest } from './manifest.js';
2
+ export { default as Image } from './components/Image.svelte';
3
+ export { default as Slice } from './components/Slice.svelte';
4
+ export { default as Video } from './components/Video.svelte';
5
+ export { default as ChromaKeyVideo } from './components/ChromaKeyVideo.svelte';
6
+ export { resolveRetainedSource } from './preload-registry.js';
7
+ export { audioSourceOf } from './kind-handlers.js';
8
+ export type { ImageManifestEntry, SliceManifestEntry, VideoManifestEntry, ChromaKeyVideoManifestEntry, AudioManifestEntry, ManifestEntry, ChromaKeyParameters, ImagePreloadOptions, SlicePreloadOptions, VideoPreloadOptions, ChromaKeyVideoPreloadOptions, AudioPreloadOptions, PreloadOptions } from '../core/index.js';
9
+ export { DEFAULT_CHROMA_KEY_PARAMETERS } from '../core/index.js';