@design-edito/tools 0.3.9 → 0.3.11

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 (387) hide show
  1. package/agnostic/arrays/index.d.ts +2 -2
  2. package/agnostic/arrays/index.js +2 -2
  3. package/agnostic/arrays/is-array-of/index.d.ts +1 -1
  4. package/agnostic/arrays/is-array-of/index.js +2 -2
  5. package/agnostic/booleans/is-falsy/index.d.ts +1 -1
  6. package/agnostic/colors/channels/index.d.ts +1 -1
  7. package/agnostic/colors/contrast/index.d.ts +1 -1
  8. package/agnostic/colors/convert/index.d.ts +1 -1
  9. package/agnostic/colors/convert/index.js +14 -17
  10. package/agnostic/colors/cssColorsMap.d.ts +9 -0
  11. package/agnostic/colors/distance/index.d.ts +1 -1
  12. package/agnostic/colors/index.d.ts +3 -3
  13. package/agnostic/colors/index.js +3 -3
  14. package/agnostic/colors/invert/index.d.ts +1 -1
  15. package/agnostic/colors/luminance/index.d.ts +1 -1
  16. package/agnostic/colors/palette/index.js +2 -0
  17. package/agnostic/colors/tidy/index.js +2 -1
  18. package/agnostic/colors/typechecks/index.d.ts +1 -1
  19. package/agnostic/colors/typechecks/index.js +1 -3
  20. package/agnostic/colors/types.d.ts +0 -7
  21. package/agnostic/colors/types.js +0 -154
  22. package/agnostic/css/bem/index.d.ts +3 -3
  23. package/agnostic/css/bem/index.js +6 -5
  24. package/agnostic/css/clss/index.d.ts +54 -1
  25. package/agnostic/css/clss/index.js +3 -3
  26. package/agnostic/css/generate-nice-color/index.js +1 -0
  27. package/agnostic/css/index.d.ts +1 -1
  28. package/agnostic/css/index.js +1 -1
  29. package/agnostic/css/styles-set/index.d.ts +4 -4
  30. package/agnostic/css/styles-set/index.js +1 -1
  31. package/agnostic/errors/index.d.ts +1 -1
  32. package/agnostic/errors/index.js +1 -1
  33. package/agnostic/errors/register/index.js +4 -2
  34. package/agnostic/html/get-node-ancestors/index.js +1 -1
  35. package/agnostic/html/get-position-inside-parent/index.js +1 -1
  36. package/agnostic/html/hyper-json/cast/index.d.ts +1 -1
  37. package/agnostic/html/hyper-json/method/index.d.ts +2 -2
  38. package/agnostic/html/hyper-json/serialize/index.d.ts +1 -1
  39. package/agnostic/html/hyper-json/serialize/index.js +1 -1
  40. package/agnostic/html/hyper-json/smart-tags/coalesced/and/index.d.ts +1 -1
  41. package/agnostic/html/hyper-json/smart-tags/coalesced/append/index.d.ts +1 -1
  42. package/agnostic/html/hyper-json/smart-tags/coalesced/at/index.d.ts +1 -1
  43. package/agnostic/html/hyper-json/smart-tags/coalesced/call/index.d.ts +1 -1
  44. package/agnostic/html/hyper-json/smart-tags/coalesced/call/index.js +1 -1
  45. package/agnostic/html/hyper-json/smart-tags/coalesced/clone/index.d.ts +1 -1
  46. package/agnostic/html/hyper-json/smart-tags/coalesced/deleteproperties/index.d.ts +1 -1
  47. package/agnostic/html/hyper-json/smart-tags/coalesced/deleteproperties/index.js +5 -2
  48. package/agnostic/html/hyper-json/smart-tags/coalesced/equals/index.d.ts +1 -1
  49. package/agnostic/html/hyper-json/smart-tags/coalesced/getproperties/index.d.ts +1 -1
  50. package/agnostic/html/hyper-json/smart-tags/coalesced/getproperty/index.d.ts +1 -1
  51. package/agnostic/html/hyper-json/smart-tags/coalesced/getproperty/index.js +5 -2
  52. package/agnostic/html/hyper-json/smart-tags/coalesced/hjparse/index.d.ts +1 -1
  53. package/agnostic/html/hyper-json/smart-tags/coalesced/hjstringify/index.d.ts +1 -1
  54. package/agnostic/html/hyper-json/smart-tags/coalesced/if/index.d.ts +1 -1
  55. package/agnostic/html/hyper-json/smart-tags/coalesced/index.d.ts +14 -14
  56. package/agnostic/html/hyper-json/smart-tags/coalesced/index.js +14 -14
  57. package/agnostic/html/hyper-json/smart-tags/coalesced/initialize/index.d.ts +1 -1
  58. package/agnostic/html/hyper-json/smart-tags/coalesced/join/index.d.ts +1 -1
  59. package/agnostic/html/hyper-json/smart-tags/coalesced/length/index.d.ts +1 -1
  60. package/agnostic/html/hyper-json/smart-tags/coalesced/map/index.d.ts +2 -2
  61. package/agnostic/html/hyper-json/smart-tags/coalesced/map/index.js +1 -1
  62. package/agnostic/html/hyper-json/smart-tags/coalesced/or/index.d.ts +1 -1
  63. package/agnostic/html/hyper-json/smart-tags/coalesced/pickrandom/index.d.ts +1 -1
  64. package/agnostic/html/hyper-json/smart-tags/coalesced/populate/index.d.ts +1 -1
  65. package/agnostic/html/hyper-json/smart-tags/coalesced/print/index.d.ts +1 -1
  66. package/agnostic/html/hyper-json/smart-tags/coalesced/push/index.d.ts +1 -1
  67. package/agnostic/html/hyper-json/smart-tags/coalesced/pusheach/index.d.ts +2 -2
  68. package/agnostic/html/hyper-json/smart-tags/coalesced/recordtoarray/index.d.ts +1 -1
  69. package/agnostic/html/hyper-json/smart-tags/coalesced/removeattribute/index.d.ts +2 -2
  70. package/agnostic/html/hyper-json/smart-tags/coalesced/removeattribute/index.js +7 -4
  71. package/agnostic/html/hyper-json/smart-tags/coalesced/renameproperty/index.d.ts +1 -1
  72. package/agnostic/html/hyper-json/smart-tags/coalesced/replace/index.d.ts +1 -1
  73. package/agnostic/html/hyper-json/smart-tags/coalesced/set/index.d.ts +1 -1
  74. package/agnostic/html/hyper-json/smart-tags/coalesced/setattribute/index.d.ts +2 -2
  75. package/agnostic/html/hyper-json/smart-tags/coalesced/setattribute/index.js +7 -4
  76. package/agnostic/html/hyper-json/smart-tags/coalesced/setproperty/index.d.ts +1 -1
  77. package/agnostic/html/hyper-json/smart-tags/coalesced/setproperty/index.js +9 -9
  78. package/agnostic/html/hyper-json/smart-tags/coalesced/sorton/index.d.ts +2 -2
  79. package/agnostic/html/hyper-json/smart-tags/coalesced/spread/index.d.ts +1 -1
  80. package/agnostic/html/hyper-json/smart-tags/coalesced/toarray/index.d.ts +1 -1
  81. package/agnostic/html/hyper-json/smart-tags/coalesced/toboolean/index.d.ts +1 -1
  82. package/agnostic/html/hyper-json/smart-tags/coalesced/toelement/index.d.ts +1 -1
  83. package/agnostic/html/hyper-json/smart-tags/coalesced/tonodelist/index.d.ts +1 -1
  84. package/agnostic/html/hyper-json/smart-tags/coalesced/tonull/index.d.ts +1 -1
  85. package/agnostic/html/hyper-json/smart-tags/coalesced/tonumber/index.d.ts +1 -1
  86. package/agnostic/html/hyper-json/smart-tags/coalesced/torecord/index.d.ts +1 -1
  87. package/agnostic/html/hyper-json/smart-tags/coalesced/toref/index.d.ts +1 -1
  88. package/agnostic/html/hyper-json/smart-tags/coalesced/tostring/index.d.ts +1 -1
  89. package/agnostic/html/hyper-json/smart-tags/coalesced/totext/index.d.ts +1 -1
  90. package/agnostic/html/hyper-json/smart-tags/coalesced/transformselected/index.d.ts +1 -1
  91. package/agnostic/html/hyper-json/smart-tags/coalesced/transformselected/index.js +0 -1
  92. package/agnostic/html/hyper-json/smart-tags/coalesced/trim/index.js +1 -1
  93. package/agnostic/html/hyper-json/smart-tags/index.d.ts +1 -1
  94. package/agnostic/html/hyper-json/smart-tags/isolated/any/index.d.ts +1 -1
  95. package/agnostic/html/hyper-json/smart-tags/isolated/array/index.d.ts +1 -1
  96. package/agnostic/html/hyper-json/smart-tags/isolated/get/index.d.ts +1 -1
  97. package/agnostic/html/hyper-json/smart-tags/isolated/global/index.d.ts +1 -1
  98. package/agnostic/html/hyper-json/smart-tags/isolated/guess/index.d.ts +1 -1
  99. package/agnostic/html/hyper-json/smart-tags/isolated/guess/index.js +1 -1
  100. package/agnostic/html/hyper-json/smart-tags/isolated/index.d.ts +3 -3
  101. package/agnostic/html/hyper-json/smart-tags/isolated/index.js +3 -3
  102. package/agnostic/html/hyper-json/smart-tags/isolated/nodelist/index.d.ts +1 -1
  103. package/agnostic/html/hyper-json/smart-tags/isolated/null/index.d.ts +1 -1
  104. package/agnostic/html/hyper-json/smart-tags/isolated/record/index.d.ts +1 -1
  105. package/agnostic/html/hyper-json/smart-tags/isolated/ref/index.d.ts +1 -1
  106. package/agnostic/html/hyper-json/smart-tags/isolated/text/index.js +3 -1
  107. package/agnostic/html/hyper-json/transformer/index.d.ts +2 -2
  108. package/agnostic/html/hyper-json/transformer/index.js +6 -9
  109. package/agnostic/html/hyper-json/tree/index.d.ts +1 -1
  110. package/agnostic/html/hyper-json/tree/index.js +14 -10
  111. package/agnostic/html/hyper-json/types/index.d.ts +9 -13
  112. package/agnostic/html/hyper-json/utils/index.d.ts +7 -7
  113. package/agnostic/html/hyper-json/utils/index.js +1 -1
  114. package/agnostic/html/index.d.ts +1 -1
  115. package/agnostic/html/index.js +1 -1
  116. package/agnostic/html/placeholders/index.d.ts +1 -1
  117. package/agnostic/html/selector-to-element/index.js +1 -1
  118. package/agnostic/index.d.ts +6 -6
  119. package/agnostic/index.js +6 -6
  120. package/agnostic/misc/assert/index.d.ts +5 -2
  121. package/agnostic/misc/assert/index.js +4 -4
  122. package/agnostic/misc/cast/index.d.ts +1 -1
  123. package/agnostic/misc/connection/index.js +0 -1
  124. package/agnostic/misc/crawler/index.d.ts +2 -2
  125. package/agnostic/misc/crossenv/detect-runtime/index.js +4 -4
  126. package/agnostic/misc/crossenv/index.d.ts +1 -1
  127. package/agnostic/misc/crossenv/index.js +1 -1
  128. package/agnostic/misc/crossenv/window/index.d.ts +1 -1
  129. package/agnostic/misc/crossenv/window/index.js +2 -2
  130. package/agnostic/misc/data-size/index.js +2 -2
  131. package/agnostic/misc/index.d.ts +6 -6
  132. package/agnostic/misc/index.js +6 -6
  133. package/agnostic/misc/is-constructor-function/index.d.ts +1 -1
  134. package/agnostic/misc/logs/logger/index.d.ts +11 -1
  135. package/agnostic/misc/logs/logger/index.js +40 -10
  136. package/agnostic/misc/logs/styles/index.d.ts +1 -0
  137. package/agnostic/misc/logs/styles/index.js +27 -9
  138. package/agnostic/misc/outcome/index.d.ts +7 -7
  139. package/agnostic/numbers/approximate-rational/index.js +4 -2
  140. package/agnostic/numbers/index.d.ts +3 -3
  141. package/agnostic/numbers/index.js +3 -3
  142. package/agnostic/objects/deep-get-property/index.js +2 -2
  143. package/agnostic/objects/flatten-getters/index.js +2 -1
  144. package/agnostic/objects/index.d.ts +5 -4
  145. package/agnostic/objects/index.js +5 -4
  146. package/agnostic/objects/record-format/index.js +1 -0
  147. package/agnostic/objects/sort-keys/index.d.ts +11 -0
  148. package/agnostic/objects/sort-keys/index.js +12 -0
  149. package/agnostic/objects/sort-keys/index.test.d.ts +1 -0
  150. package/agnostic/optim/memoize/index.js +1 -1
  151. package/agnostic/optim/throttle-debounce/index.d.ts +12 -10
  152. package/agnostic/optim/throttle-debounce/index.js +2 -2
  153. package/agnostic/optim/throttle-debounce/types.d.ts +1 -1
  154. package/agnostic/random/index.d.ts +1 -1
  155. package/agnostic/random/index.js +1 -1
  156. package/agnostic/random/random/index.js +1 -1
  157. package/agnostic/sanitization/html/index.js +7 -7
  158. package/agnostic/sanitization/index.d.ts +1 -1
  159. package/agnostic/sanitization/index.js +1 -1
  160. package/agnostic/sanitization/types.d.ts +2 -6
  161. package/agnostic/strings/char-codes/index.d.ts +5 -5
  162. package/agnostic/strings/char-codes/index.js +2 -2
  163. package/agnostic/strings/index.d.ts +3 -3
  164. package/agnostic/strings/index.js +3 -3
  165. package/agnostic/strings/matches/index.d.ts +2 -2
  166. package/agnostic/time/dates/format-date/index.js +23 -9
  167. package/agnostic/time/duration/index.d.ts +23 -2
  168. package/agnostic/time/duration/index.js +36 -4
  169. package/agnostic/time/index.d.ts +2 -2
  170. package/agnostic/time/index.js +2 -2
  171. package/agnostic/time/timeout/index.js +2 -2
  172. package/agnostic/time/transitions/index.d.ts +3 -3
  173. package/agnostic/time/transitions/index.js +4 -4
  174. package/agnostic/time/wait/index.d.ts +2 -2
  175. package/agnostic/time/wait/index.js +1 -1
  176. package/components/Disclaimer/index.d.ts +45 -0
  177. package/components/Disclaimer/index.js +70 -0
  178. package/components/Drawer/index.d.ts +45 -0
  179. package/components/Drawer/index.js +82 -0
  180. package/components/Drawer/styles.module.css +0 -0
  181. package/components/EventListener/index.d.ts +20 -3
  182. package/components/EventListener/index.js +15 -22
  183. package/components/Gallery/index.d.ts +67 -0
  184. package/components/Gallery/index.js +173 -0
  185. package/components/Gallery/styles.module.css +33 -0
  186. package/components/Gallery/utils.d.ts +1 -0
  187. package/components/Image/index.d.ts +60 -0
  188. package/components/Image/index.js +99 -0
  189. package/components/Image/styles.module.css +0 -0
  190. package/components/IntersectionObserver/index.d.ts +48 -11
  191. package/components/IntersectionObserver/index.js +13 -22
  192. package/components/Paginator/index.d.ts +72 -0
  193. package/components/Paginator/index.js +116 -0
  194. package/components/Paginator/styles.module.css +9 -0
  195. package/components/ResizeObserver/index.d.ts +27 -0
  196. package/components/ResizeObserver/index.js +81 -0
  197. package/components/Scrllgngn/index.d.ts +123 -0
  198. package/components/Scrllgngn/index.js +175 -0
  199. package/components/Scrllgngn/styles.module.css +74 -0
  200. package/components/Sequencer/index.controlled.d.ts +78 -0
  201. package/components/Sequencer/index.d.ts +85 -0
  202. package/components/Sequencer/index.js +109 -0
  203. package/components/Sequencer/styles.module.css +0 -0
  204. package/components/ShadowRoot/index.d.ts +35 -0
  205. package/components/ShadowRoot/index.js +56 -0
  206. package/components/ShadowRoot/styles.module.css +0 -0
  207. package/components/Subtitles/index.d.ts +58 -0
  208. package/components/Subtitles/index.js +111 -0
  209. package/components/Subtitles/styles.module.css +0 -0
  210. package/components/Subtitles/types.d.ts +10 -0
  211. package/components/Subtitles/types.js +0 -0
  212. package/components/Subtitles/utils.d.ts +28 -0
  213. package/components/Theatre/index.d.ts +64 -0
  214. package/components/Theatre/index.js +97 -0
  215. package/components/Theatre/styles.module.css +0 -0
  216. package/components/Video/index.d.ts +119 -0
  217. package/components/Video/index.js +358 -0
  218. package/components/Video/styles.module.css +0 -0
  219. package/components/Video/utils.d.ts +10 -0
  220. package/components/_WIP_AudioQuote/index.d.ts +1 -0
  221. package/components/_WIP_AudioQuote/index.js +0 -0
  222. package/components/_WIP_Icon/index.d.ts +1 -0
  223. package/components/_WIP_Icon/index.js +0 -0
  224. package/components/index.d.ts +15 -1
  225. package/components/index.js +15 -1
  226. package/components/public-classnames.d.ts +14 -3
  227. package/components/utils/index.d.ts +1 -0
  228. package/components/utils/index.js +12 -0
  229. package/components/utils/types.d.ts +3 -0
  230. package/components/utils/types.js +0 -0
  231. package/node/@aws-s3/index.test.d.ts +1 -0
  232. package/node/@aws-s3/storage/directory/copy-dir/index.d.ts +2 -2
  233. package/node/@aws-s3/storage/directory/copy-dir/index.js +3 -3
  234. package/node/@aws-s3/storage/directory/index.d.ts +1 -1
  235. package/node/@aws-s3/storage/directory/index.js +1 -1
  236. package/node/@aws-s3/storage/directory/list/index.d.ts +2 -2
  237. package/node/@aws-s3/storage/directory/list/index.js +1 -1
  238. package/node/@aws-s3/storage/directory/move-dir/index.d.ts +3 -3
  239. package/node/@aws-s3/storage/directory/move-dir/index.js +3 -3
  240. package/node/@aws-s3/storage/directory/remove-dir/index.d.ts +2 -2
  241. package/node/@aws-s3/storage/directory/remove-dir/index.js +4 -4
  242. package/node/@aws-s3/storage/file/copy/index.d.ts +1 -1
  243. package/node/@aws-s3/storage/file/download/index.d.ts +3 -3
  244. package/node/@aws-s3/storage/file/exists/index.d.ts +2 -2
  245. package/node/@aws-s3/storage/file/exists/index.js +1 -2
  246. package/node/@aws-s3/storage/file/index.d.ts +2 -2
  247. package/node/@aws-s3/storage/file/index.js +2 -2
  248. package/node/@aws-s3/storage/file/move/index.d.ts +2 -2
  249. package/node/@aws-s3/storage/file/remove/index.d.ts +1 -1
  250. package/node/@aws-s3/storage/file/stat/index.d.ts +1 -1
  251. package/node/@aws-s3/storage/file/upload/index.d.ts +2 -2
  252. package/node/@aws-s3/storage/index.d.ts +1 -1
  253. package/node/@aws-s3/storage/index.js +1 -1
  254. package/node/@express/@multer/index.d.ts +1 -1
  255. package/node/@google-cloud/storage/bucket/get-metadata/index.d.ts +1 -1
  256. package/node/@google-cloud/storage/directory/copy-dir/index.d.ts +1 -1
  257. package/node/@google-cloud/storage/directory/index.d.ts +1 -1
  258. package/node/@google-cloud/storage/directory/index.js +1 -1
  259. package/node/@google-cloud/storage/directory/list/index.d.ts +1 -1
  260. package/node/@google-cloud/storage/directory/move-dir/index.d.ts +1 -1
  261. package/node/@google-cloud/storage/directory/remove-dir/index.d.ts +1 -1
  262. package/node/@google-cloud/storage/file/copy/index.d.ts +2 -2
  263. package/node/@google-cloud/storage/file/download/index.d.ts +2 -2
  264. package/node/@google-cloud/storage/file/exists/index.d.ts +1 -1
  265. package/node/@google-cloud/storage/file/generate-signed-url/index.d.ts +1 -1
  266. package/node/@google-cloud/storage/file/get-metadata/index.d.ts +1 -1
  267. package/node/@google-cloud/storage/file/get-permissions/index.d.ts +1 -1
  268. package/node/@google-cloud/storage/file/index.d.ts +6 -6
  269. package/node/@google-cloud/storage/file/index.js +6 -6
  270. package/node/@google-cloud/storage/file/move/index.d.ts +1 -1
  271. package/node/@google-cloud/storage/file/remove/index.d.ts +1 -1
  272. package/node/@google-cloud/storage/file/revoke-signed-urls/index.d.ts +4 -4
  273. package/node/@google-cloud/storage/file/stat/index.d.ts +1 -1
  274. package/node/@google-cloud/storage/file/stat/index.js +2 -2
  275. package/node/@google-cloud/storage/file/update-metadata/index.d.ts +1 -1
  276. package/node/@google-cloud/storage/file/upload/index.d.ts +2 -2
  277. package/node/@google-cloud/storage/index.d.ts +1 -1
  278. package/node/@google-cloud/storage/index.js +1 -1
  279. package/node/cloud-storage/operations/copy-dir/index.d.ts +8 -8
  280. package/node/cloud-storage/operations/copy-dir/index.js +4 -4
  281. package/node/cloud-storage/operations/copy-file/index.d.ts +8 -8
  282. package/node/cloud-storage/operations/copy-file/index.js +4 -4
  283. package/node/cloud-storage/operations/download-file/index.d.ts +9 -9
  284. package/node/cloud-storage/operations/download-file/index.js +4 -4
  285. package/node/cloud-storage/operations/exists-file/index.d.ts +6 -6
  286. package/node/cloud-storage/operations/exists-file/index.js +4 -4
  287. package/node/cloud-storage/operations/index.d.ts +1 -1
  288. package/node/cloud-storage/operations/index.js +1 -1
  289. package/node/cloud-storage/operations/list-dir/index.d.ts +6 -6
  290. package/node/cloud-storage/operations/list-dir/index.js +4 -4
  291. package/node/cloud-storage/operations/move-dir/index.d.ts +8 -8
  292. package/node/cloud-storage/operations/move-dir/index.js +4 -4
  293. package/node/cloud-storage/operations/move-file/index.d.ts +8 -8
  294. package/node/cloud-storage/operations/move-file/index.js +4 -4
  295. package/node/cloud-storage/operations/remove-dir/index.d.ts +8 -8
  296. package/node/cloud-storage/operations/remove-dir/index.js +4 -4
  297. package/node/cloud-storage/operations/remove-file/index.d.ts +8 -8
  298. package/node/cloud-storage/operations/remove-file/index.js +4 -4
  299. package/node/cloud-storage/operations/stat-file/index.d.ts +8 -8
  300. package/node/cloud-storage/operations/stat-file/index.js +4 -4
  301. package/node/cloud-storage/operations/upload-file/index.d.ts +9 -9
  302. package/node/cloud-storage/operations/upload-file/index.js +4 -4
  303. package/node/encryption/index.d.ts +1 -1
  304. package/node/encryption/index.js +1 -1
  305. package/node/files/index.d.ts +1 -1
  306. package/node/files/index.js +1 -1
  307. package/node/files/read-write/index.js +1 -1
  308. package/node/files/subpaths/index.d.ts +3 -3
  309. package/node/files/subpaths/index.js +6 -6
  310. package/node/ftps/directory/copy-dir/index.d.ts +1 -1
  311. package/node/ftps/directory/copy-dir/index.js +1 -1
  312. package/node/ftps/directory/index.d.ts +2 -2
  313. package/node/ftps/directory/index.js +2 -2
  314. package/node/ftps/directory/list/index.d.ts +1 -1
  315. package/node/ftps/directory/move-dir/index.d.ts +1 -1
  316. package/node/ftps/directory/move-dir/index.js +1 -3
  317. package/node/ftps/directory/remove-dir/index.d.ts +2 -2
  318. package/node/ftps/file/copy/index.d.ts +1 -1
  319. package/node/ftps/file/copy/index.js +1 -1
  320. package/node/ftps/file/download/index.d.ts +2 -2
  321. package/node/ftps/file/exists/index.d.ts +2 -2
  322. package/node/ftps/file/exists/index.js +1 -1
  323. package/node/ftps/file/index.d.ts +1 -1
  324. package/node/ftps/file/index.js +1 -1
  325. package/node/ftps/file/move/index.d.ts +3 -3
  326. package/node/ftps/file/move/index.js +1 -1
  327. package/node/ftps/file/remove/index.d.ts +1 -1
  328. package/node/ftps/file/stat/index.d.ts +1 -1
  329. package/node/ftps/file/stat/index.js +2 -2
  330. package/node/ftps/file/upload/index.d.ts +2 -2
  331. package/node/images/format/index.d.ts +1 -1
  332. package/node/images/format/index.js +9 -9
  333. package/node/images/index.d.ts +1 -1
  334. package/node/images/index.js +1 -1
  335. package/node/images/metadata/index.d.ts +1 -1
  336. package/node/images/metadata/index.js +1 -1
  337. package/node/images/transform/index.d.ts +2 -2
  338. package/node/images/transform/index.js +26 -21
  339. package/node/images/transform/operations/blur/index.d.ts +1 -1
  340. package/node/images/transform/operations/brighten/index.d.ts +1 -1
  341. package/node/images/transform/operations/extend/index.d.ts +1 -1
  342. package/node/images/transform/operations/extract/index.d.ts +1 -1
  343. package/node/images/transform/operations/flatten/index.d.ts +1 -1
  344. package/node/images/transform/operations/flatten/index.js +1 -1
  345. package/node/images/transform/operations/flip/index.d.ts +1 -1
  346. package/node/images/transform/operations/flop/index.d.ts +1 -1
  347. package/node/images/transform/operations/hue/index.d.ts +1 -1
  348. package/node/images/transform/operations/index.d.ts +5 -5
  349. package/node/images/transform/operations/index.js +5 -5
  350. package/node/images/transform/operations/level/index.d.ts +1 -1
  351. package/node/images/transform/operations/lighten/index.d.ts +1 -1
  352. package/node/images/transform/operations/normalize/index.d.ts +1 -1
  353. package/node/images/transform/operations/overlay/index.js +1 -1
  354. package/node/images/transform/operations/resize/index.d.ts +1 -1
  355. package/node/images/transform/operations/rotate/index.d.ts +1 -1
  356. package/node/images/transform/operations/saturate/index.d.ts +1 -1
  357. package/node/index.d.ts +2 -2
  358. package/node/index.js +2 -2
  359. package/node/process/prompt-continue/index.js +1 -1
  360. package/node/process/spawner/index.d.ts +61 -10
  361. package/node/process/spawner/index.js +15 -13
  362. package/node/sftp/directory/copy-dir/index.d.ts +2 -1
  363. package/node/sftp/directory/copy-dir/index.js +2 -2
  364. package/node/sftp/directory/index.d.ts +1 -1
  365. package/node/sftp/directory/index.js +1 -1
  366. package/node/sftp/directory/list/index.d.ts +1 -1
  367. package/node/sftp/directory/move-dir/index.d.ts +1 -1
  368. package/node/sftp/directory/move-dir/index.js +2 -4
  369. package/node/sftp/directory/remove-dir/index.d.ts +2 -2
  370. package/node/sftp/file/copy/index.d.ts +2 -1
  371. package/node/sftp/file/copy/index.js +2 -2
  372. package/node/sftp/file/download/index.d.ts +3 -3
  373. package/node/sftp/file/exists/index.d.ts +1 -1
  374. package/node/sftp/file/index.d.ts +2 -2
  375. package/node/sftp/file/index.js +2 -2
  376. package/node/sftp/file/move/index.d.ts +3 -3
  377. package/node/sftp/file/move/index.js +3 -5
  378. package/node/sftp/file/remove/index.d.ts +1 -1
  379. package/node/sftp/file/remove/index.js +1 -1
  380. package/node/sftp/file/stat/index.d.ts +1 -1
  381. package/node/sftp/file/stat/index.js +1 -1
  382. package/node/sftp/file/upload/index.d.ts +3 -2
  383. package/node/sftp/file/upload/index.js +1 -1
  384. package/package.json +2265 -14
  385. package/components/Input/index.d.ts +0 -7
  386. package/components/Input/index.js +0 -29
  387. /package/components/{Input → Disclaimer}/styles.module.css +0 -0
@@ -6,18 +6,16 @@ import {
6
6
  useCallback
7
7
  } from "react";
8
8
  import { clss } from "../../agnostic/css/clss/index.js";
9
- import { isNotFalsy } from "../../agnostic/booleans/is-falsy/index.js";
10
- import { intersectionObserver } from "../public-classnames.js";
9
+ import { mergeClassNames } from "../utils/index.js";
10
+ import { intersectionObserver as publicClassName } from "../public-classnames.js";
11
11
  import cssModule from "./styles.module.css";
12
- import { jsxs } from "react/jsx-runtime";
12
+ import { jsx } from "react/jsx-runtime";
13
13
  var IntersectionObserverComponent = ({
14
- className,
15
- render,
16
- content,
17
- onIntersection,
14
+ onIntersected,
18
15
  root,
19
16
  rootMargin,
20
17
  threshold,
18
+ className,
21
19
  children
22
20
  }) => {
23
21
  const [ioEntry, setIoEntry] = useState(null);
@@ -26,12 +24,9 @@ var IntersectionObserverComponent = ({
26
24
  const observation = useCallback((entries, observer) => {
27
25
  const thisEntry = entries[0];
28
26
  if (thisEntry === void 0) return setIoEntry(null);
29
- if (onIntersection !== void 0) onIntersection({
30
- ioEntry: thisEntry,
31
- observer
32
- });
27
+ onIntersected?.({ ioEntry: thisEntry, observer });
33
28
  setIoEntry(thisEntry);
34
- }, [onIntersection]);
29
+ }, [onIntersected]);
35
30
  const forceObservation = useCallback(() => {
36
31
  const rootEl = rootRef.current;
37
32
  const observer = observerRef.current;
@@ -55,22 +50,18 @@ var IntersectionObserverComponent = ({
55
50
  window.clearTimeout(timeout2);
56
51
  };
57
52
  }, [forceObservation]);
58
- const c = clss(intersectionObserver, { cssModule });
53
+ const c = clss(publicClassName, { cssModule });
59
54
  const isIntersecting = ioEntry?.isIntersecting ?? false;
60
- const wrapperClassName = [
55
+ const rootClss = mergeClassNames(
61
56
  c(null, { "is-intersecting": isIntersecting }),
62
57
  className
63
- ].filter(isNotFalsy).join(" ");
64
- return /* @__PURE__ */ jsxs(
58
+ );
59
+ return /* @__PURE__ */ jsx(
65
60
  "div",
66
61
  {
62
+ className: rootClss,
67
63
  ref: rootRef,
68
- className: wrapperClassName,
69
- children: [
70
- render ?? null,
71
- children,
72
- content
73
- ]
64
+ children
74
65
  }
75
66
  );
76
67
  };
@@ -0,0 +1,72 @@
1
+ import { type PropsWithChildren, type FunctionComponent } from 'react';
2
+ import type { WithClassName } from '../utils/types.js';
3
+ /**
4
+ * State associated with a single page slot.
5
+ *
6
+ * @property position - The current position of the page relative to the viewport:
7
+ * - `'prev'` — the page has been scrolled past.
8
+ * - `'curr'` — the page is currently visible in the viewport.
9
+ * - `'next'` — the page has not yet been reached.
10
+ * @property currCount - The number of times this page has entered the `'curr'` position.
11
+ */
12
+ type PageState = {
13
+ position: 'prev' | 'curr' | 'next';
14
+ currCount: number;
15
+ };
16
+ /**
17
+ * Represents the scroll direction state of the paginator.
18
+ * - `'forwards'` — the user is scrolling down.
19
+ * - `'backwards'` — the user is scrolling up.
20
+ * - `null` — no scroll has been detected yet.
21
+ */
22
+ type DirectionState = 'forwards' | 'backwards' | null;
23
+ /**
24
+ * Props for the {@link Paginator} component.
25
+ *
26
+ * @property thresholdOffsetPercent - Optional percentage offset used to compute
27
+ * the {@link IntersectionObserver} root margin. Determines how far into the viewport
28
+ * a page must be before it is considered `'curr'`. Defaults to `0`.
29
+ *
30
+ * @property stateHandlers - Callbacks called after the internal state changed
31
+ * @property stateHandlers.directionChanged - Callback invoked when the scroll direction changes.
32
+ * Receives the new {@link DirectionState}. Only fires when the direction actually
33
+ * changes — repeated scrolls in the same direction do not trigger it again.
34
+ *
35
+ * @property stateHandlers.pageChanged - Callback invoked whenever any page's {@link PageState}
36
+ * changes. Receives a flat array of all pages' states, ordered by position.
37
+ *
38
+ * @property className - Optional additional class name(s) applied to the root element.
39
+ * @property children - Each direct child is treated as an individual page slot.
40
+ */
41
+ export type Props = PropsWithChildren<WithClassName<{
42
+ thresholdOffsetPercent?: number;
43
+ stateHandlers?: {
44
+ directionChanged?: (direction: DirectionState) => void;
45
+ pageChanged?: (pages: PageState[]) => void;
46
+ };
47
+ }>>;
48
+ /**
49
+ * A scroll-driven pagination component that tracks which child page is currently
50
+ * visible in the viewport and the direction of scroll.
51
+ *
52
+ * Each direct child is wrapped in a page slot and observed via
53
+ * {@link IntersectionObserver}. Page slots receive `'prev'`, `'curr'`, or `'next'`
54
+ * positional modifier classes based on their visibility.
55
+ *
56
+ * @param props - Component properties.
57
+ * @see {@link Props}
58
+ *
59
+ * @returns A root div containing a pages wrapper, with each child isolated in
60
+ * its own observed page slot div.
61
+ *
62
+ * @remarks
63
+ * - Scroll direction is throttled to one update per 100ms and only dispatched
64
+ * when the direction actually changes, using an internal ref to avoid stale
65
+ * closure comparisons.
66
+ * - Page visibility is tracked via a single {@link IntersectionObserver} instance
67
+ * that is recreated when `thresholdOffsetPercent` or `children` change.
68
+ * - `currCount` on each {@link PageState} increments each time a page transitions
69
+ * into the `'curr'` position, making it useful as a re-entry counter.
70
+ */
71
+ export declare const Paginator: FunctionComponent<Props>;
72
+ export {};
@@ -0,0 +1,116 @@
1
+ // src/components/Paginator/index.tsx
2
+ import {
3
+ useEffect,
4
+ useRef,
5
+ Children,
6
+ useState
7
+ } from "react";
8
+ import { clss } from "../../agnostic/css/clss/index.js";
9
+ import { mergeClassNames } from "../utils/index.js";
10
+ import { paginator as publicClassName } from "../public-classnames.js";
11
+ import cssModule from "./styles.module.css";
12
+ import { jsx } from "react/jsx-runtime";
13
+ var Paginator = ({
14
+ thresholdOffsetPercent,
15
+ stateHandlers,
16
+ className,
17
+ children
18
+ }) => {
19
+ const [pagesState, setPagesState] = useState(/* @__PURE__ */ new Map());
20
+ const [directionState, setDirectionState] = useState(null);
21
+ const pagesRef = useRef(null);
22
+ const directionRef = useRef(null);
23
+ useEffect(() => {
24
+ stateHandlers?.pageChanged?.(Array.from(pagesState).map(([, state]) => state));
25
+ }, [pagesState]);
26
+ useEffect(() => {
27
+ stateHandlers?.directionChanged?.(directionState);
28
+ }, [directionState]);
29
+ useEffect(() => {
30
+ let lastCall = 0;
31
+ let lastScrollY = window.scrollY;
32
+ const handleScroll = (e) => {
33
+ const now = Date.now();
34
+ if (now - lastCall < 100) return;
35
+ lastCall = now;
36
+ const currentScrollY = window.scrollY;
37
+ const direction = currentScrollY > lastScrollY ? "forwards" : "backwards";
38
+ lastScrollY = currentScrollY;
39
+ if (direction !== directionRef.current) {
40
+ directionRef.current = direction;
41
+ setDirectionState(direction);
42
+ }
43
+ };
44
+ window.addEventListener("scroll", handleScroll);
45
+ window.addEventListener("resize", handleScroll);
46
+ return () => {
47
+ window.removeEventListener("scroll", handleScroll);
48
+ window.removeEventListener("resize", handleScroll);
49
+ };
50
+ }, []);
51
+ useEffect(() => {
52
+ if (pagesRef.current === null) return;
53
+ const pages = Array.from(pagesRef.current.children);
54
+ const observerRootMargin = `-${thresholdOffsetPercent ?? 0}% 0px -${100 - (thresholdOffsetPercent ?? 0)}% 0px`;
55
+ const observer = new IntersectionObserver((entries) => {
56
+ setPagesState((prevState) => {
57
+ const nextState = new Map(prevState);
58
+ entries.forEach((entry) => {
59
+ const index = pageIndexMap.get(entry.target);
60
+ if (index === void 0) return;
61
+ const prev = prevState.get(index);
62
+ const position = entry.isIntersecting ? "curr" : entry.boundingClientRect.bottom < (entry.rootBounds?.top ?? 0) ? "prev" : "next";
63
+ const currCount = position === "curr" && prev?.position !== "curr" ? (prev?.currCount ?? 0) + 1 : prev?.currCount ?? 0;
64
+ nextState.set(index, { position, currCount });
65
+ });
66
+ return nextState;
67
+ });
68
+ }, { rootMargin: observerRootMargin });
69
+ const pageIndexMap = /* @__PURE__ */ new Map();
70
+ pages.forEach((page, index) => {
71
+ pageIndexMap.set(page, index);
72
+ observer.observe(page);
73
+ });
74
+ return () => observer.disconnect();
75
+ }, [thresholdOffsetPercent, children]);
76
+ const c = clss(publicClassName, { cssModule });
77
+ const rootClss = mergeClassNames(
78
+ c(null, {
79
+ forwards: directionState === "forwards",
80
+ backwards: directionState === "backwards"
81
+ }),
82
+ className
83
+ );
84
+ const pagesClss = c("pages");
85
+ const childrenArr = Children.toArray(children);
86
+ return /* @__PURE__ */ jsx("div", { className: rootClss, children: /* @__PURE__ */ jsx(
87
+ "div",
88
+ {
89
+ className: pagesClss,
90
+ ref: pagesRef,
91
+ children: childrenArr.map((child, pos) => {
92
+ const state = pagesState.get(pos);
93
+ const pageClss = c("page", {
94
+ first: pos === 0,
95
+ last: pos === childrenArr.length - 1,
96
+ prev: state?.position === "prev",
97
+ curr: state?.position === "curr",
98
+ next: state?.position === "next"
99
+ });
100
+ return /* @__PURE__ */ jsx(
101
+ "div",
102
+ {
103
+ className: pageClss,
104
+ "data-page": pos,
105
+ "data-curr-count": state?.currCount ?? 0,
106
+ children: child
107
+ },
108
+ pos
109
+ );
110
+ })
111
+ }
112
+ ) });
113
+ };
114
+ export {
115
+ Paginator
116
+ };
@@ -0,0 +1,9 @@
1
+ .threshold {
2
+ position: fixed;
3
+ left: 0px;
4
+ right: 0px;
5
+ height: 0px;
6
+ user-select: none;
7
+ pointer-events: none;
8
+ z-index: -9999;
9
+ }
@@ -0,0 +1,27 @@
1
+ import { type PropsWithChildren, type FunctionComponent } from 'react';
2
+ import type { WithClassName } from '../utils/types.js';
3
+ type ROEntryWithBoundingRect = {
4
+ entry: ResizeObserverEntry;
5
+ boundingClientRect: DOMRect;
6
+ };
7
+ /**
8
+ * Props for the ResizeObserverComponent.
9
+ *
10
+ * @property className - Optional additional class name(s) applied to the root element.
11
+ * @property onResized - Callback invoked when the element is resized.
12
+ * Receives the `ResizeObserverEntry` from the observed element, or `undefined` if none.
13
+ * @property children - React children rendered inside the root element. Only the root element is observed
14
+ */
15
+ export type Props = PropsWithChildren<WithClassName<{
16
+ onResized?: (entry: ROEntryWithBoundingRect) => void;
17
+ }>>;
18
+ /**
19
+ * Component that observes its own size changes and exposes the dimensions.
20
+ * Updates are exposed both via data attributes (e.g., `data-width`) and CSS custom properties
21
+ * (e.g., `--<prefix>-width`, `--<prefix>-width-px`) for styling or scripting purposes.
22
+ * @param props - Component properties
23
+ * @see {@link Props}
24
+ * @returns A div wrapping `children`, with resize observation applied.
25
+ */
26
+ export declare const ResizeObserverComponent: FunctionComponent<Props>;
27
+ export {};
@@ -0,0 +1,81 @@
1
+ // src/components/ResizeObserver/index.tsx
2
+ import {
3
+ useRef,
4
+ useEffect,
5
+ useState
6
+ } from "react";
7
+ import { clss } from "../../agnostic/css/clss/index.js";
8
+ import { mergeClassNames } from "../utils/index.js";
9
+ import { resizeObserver as publicClassName } from "../public-classnames.js";
10
+ import cssModule from "./style.module.css";
11
+ import { jsx } from "react/jsx-runtime";
12
+ var ResizeObserverComponent = ({
13
+ className,
14
+ onResized,
15
+ children
16
+ }) => {
17
+ const [roEntry, setRoEntry] = useState();
18
+ const rootRef = useRef(null);
19
+ const observerRef = useRef(null);
20
+ const createObserver = () => {
21
+ const root = rootRef.current;
22
+ observerRef.current?.disconnect();
23
+ if (root === null) return;
24
+ observerRef.current = new ResizeObserver((entries) => {
25
+ const firstEntry = entries[0];
26
+ if (firstEntry !== void 0) {
27
+ const boundingClientRect = firstEntry.target.getBoundingClientRect();
28
+ const fullEntry = {
29
+ entry: firstEntry,
30
+ boundingClientRect
31
+ };
32
+ setRoEntry(fullEntry);
33
+ if (onResized === void 0) return;
34
+ onResized(fullEntry);
35
+ }
36
+ });
37
+ observerRef.current.observe(root);
38
+ };
39
+ useEffect(() => {
40
+ createObserver();
41
+ return () => observerRef.current?.disconnect();
42
+ }, [onResized]);
43
+ const {
44
+ x,
45
+ y,
46
+ top,
47
+ left,
48
+ bottom,
49
+ right,
50
+ width,
51
+ height
52
+ } = roEntry?.entry.contentRect ?? {};
53
+ const contentRect = { x, y, top, left, bottom, right, width, height };
54
+ const dataAttributes = Object.entries(contentRect).reduce((acc, [key, val]) => {
55
+ if (val === void 0) return acc;
56
+ return { ...acc, [`data-${key}`]: val.toString() };
57
+ }, {});
58
+ const cssCustomProps = Object.entries(contentRect).reduce((acc, [key, val]) => {
59
+ if (val === void 0) return acc;
60
+ return {
61
+ ...acc,
62
+ [`--${publicClassName}-${key}`]: val.toString(),
63
+ [`--${publicClassName}-${key}-px`]: `${val.toString()}px`
64
+ };
65
+ }, {});
66
+ const c = clss(publicClassName, { cssModule });
67
+ const rootClss = mergeClassNames(c(null), className);
68
+ return /* @__PURE__ */ jsx(
69
+ "div",
70
+ {
71
+ ...dataAttributes,
72
+ className: rootClss,
73
+ ref: rootRef,
74
+ style: { ...cssCustomProps },
75
+ children
76
+ }
77
+ );
78
+ };
79
+ export {
80
+ ResizeObserverComponent
81
+ };
@@ -0,0 +1,123 @@
1
+ import { type PropsWithChildren, type FunctionComponent } from 'react';
2
+ import type { WithClassName } from '../utils/types.js';
3
+ /**
4
+ * Common properties shared by all block types.
5
+ *
6
+ * @property id - Optional stable identifier for the block. Used to consolidate
7
+ * blocks with the same id across multiple pages into a single sticky block
8
+ * displayed across those pages.
9
+ * @property trackScroll - Whether scroll tracking is enabled for this block.
10
+ * @property children - Content rendered inside the block.
11
+ */
12
+ type PropsCommonBlock = PropsWithChildren<{
13
+ id?: string;
14
+ trackScroll?: boolean;
15
+ }>;
16
+ /**
17
+ * A block that scrolls with the page content.
18
+ *
19
+ * @property depth - When set to `'scroll'` or omitted, the block is rendered
20
+ * inline in the scrolling content layer.
21
+ */
22
+ type PropsScrollBlock = PropsCommonBlock & {
23
+ depth?: 'scroll';
24
+ };
25
+ /**
26
+ * A block that sticks to the viewport, rendered outside the scroll flow.
27
+ *
28
+ * @property depth - `'back'` renders the block behind the scrolling content;
29
+ * `'front'` renders it in front.
30
+ * @property zIndex - Optional explicit z-index. Sticky blocks are otherwise
31
+ * stacked in the order they appear across pages (ascending).
32
+ */
33
+ type PropsStickyBlock = PropsCommonBlock & {
34
+ depth: 'back' | 'front';
35
+ zIndex?: number;
36
+ };
37
+ /**
38
+ * Union of all block variants accepted by a {@link PropsPage}.
39
+ *
40
+ * @see {@link PropsScrollBlock}
41
+ * @see {@link PropsStickyBlock}
42
+ */
43
+ type PropsBlock = PropsScrollBlock | PropsStickyBlock;
44
+ /**
45
+ * Describes a single page in the scrollytelling sequence.
46
+ *
47
+ * @property id - Optional identifier for the page.
48
+ * @property blocks - Ordered list of blocks belonging to this page.
49
+ * Scroll blocks are rendered inline; sticky blocks (`'back'` / `'front'`) are
50
+ * lifted into their respective layer and consolidated with same-id blocks from
51
+ * other pages.
52
+ */
53
+ type PropsPage = {
54
+ id?: string;
55
+ blocks?: PropsBlock[];
56
+ };
57
+ /**
58
+ * Props for the {@link Scrllgngn} component.
59
+ *
60
+ * @property pages - Ordered list of pages that compose the scrollytelling
61
+ * sequence. Each page may contain any mix of {@link PropsBlock} variants.
62
+ * @property thresholdOffsetPercent - Forwarded to the internal
63
+ * {@link Paginator}. Defines the viewport offset percentage used to determine
64
+ * which page is considered current.
65
+ * @property stickyBlocksLazyLoadDistance - Number of pages around the current
66
+ * page within which sticky blocks are mounted. Blocks outside this window are
67
+ * unmounted to save resources. Defaults to `2`.
68
+ * @property forceStickBlocks - Controls which out-of-range sticky blocks are
69
+ * forced into a stuck state regardless of the current page:
70
+ * - `'before'` — forces blocks from pages before the current one.
71
+ * - `'after'` — forces blocks from pages after the current one.
72
+ * - `'both'` — forces blocks on both sides.
73
+ * - `'none'` — no forcing (default behaviour).
74
+ * @property className - Optional additional class name(s) applied to the root element.
75
+ */
76
+ export type Props = WithClassName<{
77
+ pages?: PropsPage[];
78
+ thresholdOffsetPercent?: number;
79
+ stickyBlocksLazyLoadDistance?: number;
80
+ forceStickBlocks?: 'before' | 'after' | 'both' | 'none';
81
+ }>;
82
+ /**
83
+ * Scrollytelling engine component. Orchestrates layered sticky blocks (`back`
84
+ * and `front`) over a paginated scrolling content area, with lazy loading,
85
+ * viewport bound detection, and dimension tracking.
86
+ *
87
+ * ### Root element modifiers
88
+ * The root `<div>` receives the public class name defined by `scrllgngn` and
89
+ * the following BEM-style modifier classes when active:
90
+ * - `--top-visible` — the top boundary sentinel is intersecting the viewport.
91
+ * - `--content-visible` — the scrolling content area is intersecting the viewport.
92
+ * - `--bottom-visible` — the bottom boundary sentinel is intersecting the viewport.
93
+ * - `--force-stick-blocks-before` — when `forceStickBlocks === 'before'`.
94
+ * - `--force-stick-blocks-after` — when `forceStickBlocks === 'after'`.
95
+ * - `--force-stick-blocks-both` — when `forceStickBlocks === 'both'`.
96
+ *
97
+ * ### Data attributes
98
+ * - `data-current-page-pos` — zero-based index of the page currently in view,
99
+ * updated on every page change reported by the internal {@link Paginator}.
100
+ *
101
+ * ### CSS custom properties
102
+ * Exposed on the root element and updated on resize via the internal
103
+ * {@link ResizeObserverComponent}:
104
+ * - `--scrllgngn-screen-left` / `--PRIVATE-left` — left edge of the bounding rect (px).
105
+ * - `--scrllgngn-screen-right` / `--PRIVATE-right` — right edge (px).
106
+ * - `--scrllgngn-screen-width` / `--PRIVATE-width` — total width (px).
107
+ * - `--scrllgngn-screen-height` / `--PRIVATE-height` — total height (px).
108
+ *
109
+ * ### Sticky block elements
110
+ * Each lazy-loaded sticky block receives:
111
+ * - `--active` modifier when the block's page range includes the current page.
112
+ * - `--lazy-loaded` modifier when the block is mounted but not on the current page.
113
+ * - An inline `z-index` derived from the block's position in the sorted stack
114
+ * (overridden by {@link PropsStickyBlock.zIndex} if provided).
115
+ *
116
+ * @param props - Component properties.
117
+ * @see {@link Props}
118
+ * @returns A div wrapping the full scrollytelling structure: top-bound sentinel,
119
+ * back-blocks layer, front-blocks layer, paginated scrolling content, and
120
+ * bottom-bound sentinel.
121
+ */
122
+ export declare const Scrllgngn: FunctionComponent<Props>;
123
+ export {};
@@ -0,0 +1,175 @@
1
+ // src/components/Scrllgngn/index.tsx
2
+ import {
3
+ useState,
4
+ useEffect
5
+ } from "react";
6
+ import { clss } from "../../agnostic/css/clss/index.js";
7
+ import { randomHash } from "../../agnostic/random/uuid/index.js";
8
+ import {
9
+ IntersectionObserverComponent
10
+ } from "../IntersectionObserver/index.js";
11
+ import {
12
+ Paginator
13
+ } from "../Paginator/index.js";
14
+ import {
15
+ ResizeObserverComponent
16
+ } from "../ResizeObserver/index.js";
17
+ import { mergeClassNames } from "../utils/index.js";
18
+ import { scrllgngn as publicClassName } from "../public-classnames.js";
19
+ import cssModule from "./styles.module.css";
20
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
21
+ var Scrllgngn = ({
22
+ pages,
23
+ thresholdOffsetPercent,
24
+ stickyBlocksLazyLoadDistance = 2,
25
+ forceStickBlocks,
26
+ className
27
+ }) => {
28
+ const [topVisible, setTopVis] = useState(false);
29
+ const [contentVisible, setCntVis] = useState(false);
30
+ const [bottomVisible, setBtmVis] = useState(false);
31
+ const [currentPagePos, setCurrentPagePos] = useState(0);
32
+ const [stickyBlocks, setStickyBlocks] = useState(/* @__PURE__ */ new Map());
33
+ const [partialBoundingRect, setPartialBoundingRect] = useState();
34
+ useEffect(() => {
35
+ const consolidatedBlocks = /* @__PURE__ */ new Map();
36
+ for (const page of pages ?? []) {
37
+ const pageIndex = pages?.indexOf(page) ?? -1;
38
+ for (const block of page.blocks ?? []) {
39
+ const blockId = block.id ?? randomHash(12);
40
+ const found = consolidatedBlocks.get(blockId);
41
+ if (found !== void 0) consolidatedBlocks.set(blockId, {
42
+ ...found,
43
+ ...block,
44
+ displayOnPages: [
45
+ ...found.displayOnPages,
46
+ pageIndex
47
+ ]
48
+ });
49
+ else consolidatedBlocks.set(blockId, {
50
+ ...block,
51
+ displayOnPages: [pageIndex]
52
+ });
53
+ }
54
+ }
55
+ const consolidatedStickyBlocks = new Map(Array.from(consolidatedBlocks).filter((e) => {
56
+ const block = e[1];
57
+ return block.depth === "back" || block.depth === "front";
58
+ }));
59
+ setStickyBlocks(consolidatedStickyBlocks);
60
+ }, [pages]);
61
+ const lazyLoadedBackBlocks = Array.from(stickyBlocks).filter(
62
+ ([, block]) => block.depth === "back" && block.displayOnPages.some((dispPage) => {
63
+ const absDiff = Math.abs(dispPage - currentPagePos);
64
+ return absDiff <= stickyBlocksLazyLoadDistance;
65
+ })
66
+ ).map(([, block]) => block).sort((a, b) => {
67
+ return (a.zIndex ?? -Infinity) - (b.zIndex ?? -Infinity);
68
+ });
69
+ const lazyLoadedFrontBlocks = Array.from(stickyBlocks).filter(
70
+ ([, block]) => block.depth === "front" && block.displayOnPages.some((dispPage) => {
71
+ const absDiff = Math.abs(dispPage - currentPagePos);
72
+ return absDiff <= stickyBlocksLazyLoadDistance;
73
+ })
74
+ ).map(([, block]) => block).sort((a, b) => {
75
+ return (a.zIndex ?? -Infinity) - (b.zIndex ?? -Infinity);
76
+ });
77
+ const handleTopBoundDetect = (e) => setTopVis(e.ioEntry?.isIntersecting ?? false);
78
+ const handleCntDetect = (e) => setCntVis(e.ioEntry?.isIntersecting ?? false);
79
+ const handleBtmBoundDetect = (e) => setBtmVis(e.ioEntry?.isIntersecting ?? false);
80
+ const handlePageChange = (pages2) => {
81
+ const curPagePos = pages2.findIndex((page) => page.position === "curr");
82
+ if (curPagePos === -1) return;
83
+ return setCurrentPagePos(curPagePos);
84
+ };
85
+ const handleResize = ({ boundingClientRect }) => {
86
+ if (partialBoundingRect === void 0 || boundingClientRect.left !== partialBoundingRect.left || boundingClientRect.right !== partialBoundingRect.right || boundingClientRect.height !== partialBoundingRect.height || boundingClientRect.width !== partialBoundingRect.width) setPartialBoundingRect(boundingClientRect);
87
+ };
88
+ const c = clss(publicClassName, { cssModule });
89
+ const rootClss = mergeClassNames(
90
+ c(null, {
91
+ "top-visible": topVisible,
92
+ "content-visible": contentVisible,
93
+ "bottom-visible": bottomVisible,
94
+ "force-stick-blocks-before": forceStickBlocks === "before",
95
+ "force-stick-blocks-after": forceStickBlocks === "after",
96
+ "force-stick-blocks-both": forceStickBlocks === "both"
97
+ }),
98
+ className
99
+ );
100
+ const customCssProps = {};
101
+ if (partialBoundingRect?.left !== void 0) {
102
+ customCssProps[`--${publicClassName}-screen-left`] = `${partialBoundingRect.left}px`;
103
+ customCssProps["--PRIVATE-left"] = `${partialBoundingRect.left}px`;
104
+ }
105
+ if (partialBoundingRect?.right !== void 0) {
106
+ customCssProps[`--${publicClassName}-screen-right`] = `${partialBoundingRect.right}px`;
107
+ customCssProps["--PRIVATE-right"] = `${partialBoundingRect.right}px`;
108
+ }
109
+ if (partialBoundingRect?.width !== void 0) {
110
+ customCssProps[`--${publicClassName}-screen-width`] = `${partialBoundingRect.width}px`;
111
+ customCssProps["--PRIVATE-width"] = `${partialBoundingRect.width}px`;
112
+ }
113
+ if (partialBoundingRect?.height !== void 0) {
114
+ customCssProps[`--${publicClassName}-screen-height`] = `${partialBoundingRect.height}px`;
115
+ customCssProps["--PRIVATE-height"] = `${partialBoundingRect.height}px`;
116
+ }
117
+ return /* @__PURE__ */ jsx(
118
+ "div",
119
+ {
120
+ className: rootClss,
121
+ "data-current-page-pos": currentPagePos,
122
+ style: { ...customCssProps },
123
+ children: /* @__PURE__ */ jsxs(ResizeObserverComponent, { onResized: handleResize, children: [
124
+ /* @__PURE__ */ jsx("div", { className: c("top-bound"), children: /* @__PURE__ */ jsx(IntersectionObserverComponent, { onIntersected: handleTopBoundDetect }) }),
125
+ /* @__PURE__ */ jsx("div", { className: c("back-blocks"), children: lazyLoadedBackBlocks.map((block, blockPos) => {
126
+ const isActive = block.displayOnPages.includes(currentPagePos);
127
+ const blockClss = c("back-block", {
128
+ active: isActive,
129
+ "lazy-loaded": !isActive
130
+ });
131
+ return /* @__PURE__ */ jsx(
132
+ "div",
133
+ {
134
+ className: blockClss,
135
+ style: { zIndex: blockPos },
136
+ children: block.children
137
+ }
138
+ );
139
+ }) }),
140
+ /* @__PURE__ */ jsx("div", { className: c("front-blocks"), children: lazyLoadedFrontBlocks.map((block, blockPos) => {
141
+ const isActive = block.displayOnPages.includes(currentPagePos);
142
+ const blockClss = c("front-block", {
143
+ active: isActive,
144
+ "lazy-loaded": !isActive
145
+ });
146
+ return /* @__PURE__ */ jsx(
147
+ "div",
148
+ {
149
+ className: blockClss,
150
+ style: { zIndex: blockPos },
151
+ children: block.children
152
+ }
153
+ );
154
+ }) }),
155
+ /* @__PURE__ */ jsx("div", { className: c("scrolling-content"), children: /* @__PURE__ */ jsx(IntersectionObserverComponent, { onIntersected: handleCntDetect, children: /* @__PURE__ */ jsx(
156
+ Paginator,
157
+ {
158
+ thresholdOffsetPercent,
159
+ stateHandlers: {
160
+ pageChanged: handlePageChange
161
+ },
162
+ children: pages?.map((page) => {
163
+ const scrollBlocks = page.blocks?.filter((b) => b.depth === "scroll" || b.depth === void 0) ?? [];
164
+ return /* @__PURE__ */ jsx(Fragment, { children: scrollBlocks.map((b) => b.children) });
165
+ })
166
+ }
167
+ ) }) }),
168
+ /* @__PURE__ */ jsx("div", { className: c("bottom-bound"), children: /* @__PURE__ */ jsx(IntersectionObserverComponent, { onIntersected: handleBtmBoundDetect }) })
169
+ ] })
170
+ }
171
+ );
172
+ };
173
+ export {
174
+ Scrllgngn
175
+ };