@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
@@ -0,0 +1,82 @@
1
+ // src/components/Drawer/index.tsx
2
+ import {
3
+ useState,
4
+ useRef,
5
+ useEffect
6
+ } from "react";
7
+ import { clss } from "../../agnostic/css/clss/index.js";
8
+ import { mergeClassNames } from "../utils/index.js";
9
+ import { drawer as publicClassName } from "../public-classnames.js";
10
+ import cssModule from "./styles.module.css";
11
+ import {
12
+ ResizeObserverComponent
13
+ } from "../ResizeObserver/index.js";
14
+ import { jsx, jsxs } from "react/jsx-runtime";
15
+ var Drawer = ({
16
+ openerContent,
17
+ closerContent,
18
+ initialIsOpened = false,
19
+ isOpened: isOpenedProp,
20
+ stateHandlers,
21
+ className,
22
+ children
23
+ }) => {
24
+ const [internalIsOpened, setInternalIsOpened] = useState(isOpenedProp ?? initialIsOpened);
25
+ const isOpened = isOpenedProp ?? internalIsOpened;
26
+ const pIsOpened = useRef(isOpened);
27
+ const [{ width, height }, setContentDimensions] = useState({});
28
+ useEffect(() => {
29
+ if (pIsOpened.current === isOpened) return;
30
+ pIsOpened.current = isOpened;
31
+ stateHandlers?.toggled?.(isOpened);
32
+ }, [isOpened]);
33
+ const handleOpenerClick = () => {
34
+ if (isOpenedProp !== void 0) return;
35
+ setInternalIsOpened(true);
36
+ };
37
+ const handleCloserClick = () => {
38
+ if (isOpenedProp !== void 0) return;
39
+ setInternalIsOpened(false);
40
+ };
41
+ const handleROCompResize = ({ entry }) => {
42
+ const { width: width2, height: height2 } = entry?.contentRect ?? {};
43
+ setContentDimensions({ width: width2, height: height2 });
44
+ };
45
+ const c = clss(publicClassName, { cssModule });
46
+ const rootClss = mergeClassNames(c(null, {
47
+ "opened": isOpened,
48
+ "closed": !isOpened
49
+ }), className);
50
+ const openerClss = c("opener");
51
+ const closerClss = c("closer");
52
+ const contentClss = c("content");
53
+ const dimensions = { width, height };
54
+ const customCssProps = Object.entries(dimensions).reduce((acc, [key, val]) => {
55
+ if (val === void 0) return acc;
56
+ return {
57
+ ...acc,
58
+ [`--${publicClassName}-content-${key}`]: `${val}`,
59
+ [`--${publicClassName}-content-${key}-px`]: `${val}px`
60
+ };
61
+ }, {});
62
+ const dataAttributes = Object.entries(dimensions).reduce((acc, [key, val]) => {
63
+ if (val === void 0) return acc;
64
+ return { ...acc, [`data-content-${key}`]: `${val}` };
65
+ }, {});
66
+ return /* @__PURE__ */ jsxs(
67
+ "div",
68
+ {
69
+ className: rootClss,
70
+ ...dataAttributes,
71
+ style: { ...customCssProps },
72
+ children: [
73
+ /* @__PURE__ */ jsx("div", { className: openerClss, onClick: handleOpenerClick, children: openerContent }),
74
+ /* @__PURE__ */ jsx("div", { className: closerClss, onClick: handleCloserClick, children: closerContent }),
75
+ /* @__PURE__ */ jsx("div", { className: contentClss, children: /* @__PURE__ */ jsx(ResizeObserverComponent, { onResized: handleROCompResize, children }) })
76
+ ]
77
+ }
78
+ );
79
+ };
80
+ export {
81
+ Drawer
82
+ };
File without changes
@@ -1,10 +1,27 @@
1
- import { type ReactNode } from 'react';
1
+ import { type ReactNode, type FunctionComponent } from 'react';
2
+ /**
3
+ * Props for the EventListenerComponent.
4
+ *
5
+ * @property className - Optional additional class name(s) applied to the root element.
6
+ * @property type - Event type or list of event types to listen to (e.g. "click", ["mouseenter", "focus"]).
7
+ * @property targetSelector - Optional CSS selector used to match descendant elements
8
+ * within the root element. If omitted, the listener is attached to the root element itself.
9
+ * @property onEvent - Callback invoked when one of the specified events is triggered.
10
+ * Receives the native DOM Event object.
11
+ * @property children - React children rendered inside the root element.
12
+ */
2
13
  export type Props = {
3
14
  className?: string;
4
15
  type?: string | string[];
5
16
  targetSelector?: string;
6
17
  onEvent?: (e: Event) => void;
7
- content?: ReactNode;
8
18
  children?: ReactNode;
9
19
  };
10
- export declare const EventListenerComponent: ({ className, type, targetSelector, onEvent, content, children }: Props) => import("react/jsx-runtime").JSX.Element;
20
+ /**
21
+ * Component that attaches one or multiple DOM event listeners to its root element
22
+ * or to matching descendants.
23
+ * @param props - Component properties
24
+ * @see {@link Props}
25
+ * @returns A span element wrapping `children`, with configured event listeners.
26
+ */
27
+ export declare const EventListenerComponent: FunctionComponent<Props>;
@@ -4,16 +4,15 @@ import {
4
4
  useEffect
5
5
  } from "react";
6
6
  import { clss } from "../../agnostic/css/clss/index.js";
7
- import { isNotFalsy } from "../../agnostic/booleans/is-falsy/index.js";
8
- import { eventListener } from "../public-classnames.js";
7
+ import { mergeClassNames } from "../utils/index.js";
8
+ import { eventListener as publicClassName } from "../public-classnames.js";
9
9
  import cssModule from "./styles.module.css";
10
- import { jsxs } from "react/jsx-runtime";
10
+ import { jsx } from "react/jsx-runtime";
11
11
  var EventListenerComponent = ({
12
12
  className,
13
13
  type,
14
14
  targetSelector,
15
15
  onEvent,
16
- content,
17
16
  children
18
17
  }) => {
19
18
  const rootRef = useRef(null);
@@ -22,25 +21,19 @@ var EventListenerComponent = ({
22
21
  if (onEvent === void 0 || type === void 0 || root === null) return;
23
22
  const typeArr = Array.isArray(type) ? type : [type];
24
23
  const elements = Array.from(targetSelector === void 0 ? [root] : root.querySelectorAll(targetSelector));
25
- elements.forEach(
26
- (elt) => typeArr.forEach((type2) => {
27
- elt.addEventListener(type2, onEvent);
28
- })
29
- );
30
- return () => {
31
- elements.forEach(
32
- (elt) => typeArr.forEach((type2) => {
33
- elt.removeEventListener(type2, onEvent);
34
- })
35
- );
36
- };
24
+ elements.forEach((e) => typeArr.forEach((t) => e.addEventListener(t, onEvent)));
25
+ return () => elements.forEach((e) => typeArr.forEach((t) => e.removeEventListener(t, onEvent)));
37
26
  }, [targetSelector, type, onEvent]);
38
- const c = clss(eventListener, { cssModule });
39
- const wrapperClassName = [c(null), className].filter(isNotFalsy).join(" ");
40
- return /* @__PURE__ */ jsxs("span", { className: wrapperClassName, ref: rootRef, children: [
41
- children,
42
- content
43
- ] });
27
+ const c = clss(publicClassName, { cssModule });
28
+ const rootClss = mergeClassNames(c(), className);
29
+ return /* @__PURE__ */ jsx(
30
+ "div",
31
+ {
32
+ className: rootClss,
33
+ ref: rootRef,
34
+ children
35
+ }
36
+ );
44
37
  };
45
38
  export {
46
39
  EventListenerComponent
@@ -0,0 +1,67 @@
1
+ import { type FunctionComponent, type PropsWithChildren, type ReactNode } from 'react';
2
+ import type { WithClassName } from '../utils/types.js';
3
+ /**
4
+ * Props for the Gallery component.
5
+ *
6
+ * @property paddingLeft - Left padding applied to the first slot. Accepts a number (pixels) or any valid CSS length value.
7
+ * If not provided, falls back to `padding` or `0px`.
8
+ * @property paddingRight - Right padding applied to the last slot. Accepts a number (pixels) or any valid CSS length value.
9
+ * If not provided, falls back to `padding` or `0px`.
10
+ * @property padding - Shorthand horizontal padding applied to both ends when `paddingLeft` and/or `paddingRight`
11
+ * are not explicitly defined. Accepts a number (pixels) or any valid CSS length value.
12
+ * @property prevButtonContent - Content rendered inside the "previous" navigation control.
13
+ * Defaults to the string `"prev"` when not provided.
14
+ * @property nextButtonContent - Content rendered inside the "next" navigation control.
15
+ * Defaults to the string `"next"` when not provided.
16
+ * @property paginationContent - Content rendered inside each pagination item.
17
+ * Can be:
18
+ * - A ReactNode used for all pages,
19
+ * - A function receiving the page index and returning a ReactNode,
20
+ * - Undefined, in which case the page index is displayed.
21
+ * @property initActive - Optional. When uncontrolled mode, sets the default active slot at mount
22
+ * @property active - Optional controlled index. When provided, the active slot is driven by this
23
+ * value instead of internal scroll-derived state. When omitted, the component manages its own
24
+ * active index based on scroll position.
25
+ * @property noSnap - Optional, defines if scroll is free in side the scroller or not (defaults to false)
26
+ * @property stateHandlers - Callbacks called after the state changed
27
+ * @property stateHandlers.slotChanged - Called when the active slot changes due to scrolling. Receives the new active index.
28
+ * @property actionHandlers - Callbacks called after a user interaction
29
+ * @property actionHandlers.prevClick - Called when the "previous" control is clicked. Receives the current active index before navigation occurs.
30
+ * @property actionHandlers.nextClick - Called when the "next" control is clicked. Receives the current active index before navigation occurs.
31
+ * @property actionHandlers.paginationClick - Called when a pagination item is clicked. Receives the current active index and the target index.
32
+ * @property className - Optional additional class name(s) applied to the root element.
33
+ * @property children - Elements rendered as gallery slots. Each child is wrapped in a slot container.
34
+ */
35
+ export type Props = PropsWithChildren<WithClassName<{
36
+ paddingLeft?: string | number;
37
+ paddingRight?: string | number;
38
+ padding?: string | number;
39
+ prevButtonContent?: ReactNode;
40
+ nextButtonContent?: ReactNode;
41
+ paginationContent?: ReactNode | ((page: number) => ReactNode);
42
+ initActive?: number;
43
+ active?: number;
44
+ noSnap?: boolean;
45
+ stateHandlers?: {
46
+ slotChanged?: (activePos: number) => void;
47
+ };
48
+ actionHandlers?: {
49
+ prevClick?: (activePos: number) => void;
50
+ nextClick?: (activePos: number) => void;
51
+ paginationClick?: (activePos: number, targetPos: number) => void;
52
+ };
53
+ }>>;
54
+ /**
55
+ * Horizontally scrollable gallery component with navigation controls and pagination.
56
+ *
57
+ * Tracks the active slot based on scroll position and exposes state through CSS class names
58
+ * and a `data-active` attribute on the root element.
59
+ *
60
+ * @param props - Component properties.
61
+ * @see {@link Props}
62
+ * @returns A container element wrapping:
63
+ * - A scrollable area containing each child in a slot wrapper,
64
+ * - Previous/next navigation controls,
65
+ * - Pagination controls allowing direct slot activation.
66
+ */
67
+ export declare const Gallery: FunctionComponent<Props>;
@@ -0,0 +1,173 @@
1
+ // src/components/Gallery/index.tsx
2
+ import {
3
+ Children,
4
+ useEffect,
5
+ useState,
6
+ useRef
7
+ } from "react";
8
+ import { clss } from "../../agnostic/css/clss/index.js";
9
+ import { mergeClassNames } from "../utils/index.js";
10
+ import { gallery as publicClassName } from "../public-classnames.js";
11
+ import { forceActivateSlot } from "./utils.js";
12
+ import cssModule from "./styles.module.css";
13
+ import { jsx, jsxs } from "react/jsx-runtime";
14
+ var Gallery = ({
15
+ paddingLeft,
16
+ paddingRight,
17
+ padding,
18
+ prevButtonContent,
19
+ nextButtonContent,
20
+ paginationContent,
21
+ initActive,
22
+ active,
23
+ noSnap,
24
+ stateHandlers,
25
+ actionHandlers,
26
+ children,
27
+ className
28
+ }) => {
29
+ const scrollerRef = useRef(null);
30
+ const [activeIndex, setActiveIndex] = useState(0);
31
+ const [canGoLeft, setCanGoLeft] = useState(false);
32
+ const [canGoRight, setCanGoRight] = useState(false);
33
+ const childrenCount = Children.count(children);
34
+ useEffect(() => {
35
+ stateHandlers?.slotChanged?.(activeIndex);
36
+ }, [activeIndex]);
37
+ const handlePrevClick = () => {
38
+ actionHandlers?.prevClick?.(activeIndex);
39
+ if (active === void 0) forceActivateSlot(scrollerRef.current, activeIndex - 1);
40
+ };
41
+ const handleNextClick = () => {
42
+ actionHandlers?.nextClick?.(activeIndex);
43
+ if (active === void 0) forceActivateSlot(scrollerRef.current, activeIndex + 1);
44
+ };
45
+ const handlePaginationClick = (pos) => {
46
+ actionHandlers?.paginationClick?.(activeIndex, pos);
47
+ if (active === void 0) forceActivateSlot(scrollerRef.current, pos);
48
+ };
49
+ useEffect(() => {
50
+ const scrollerElt = scrollerRef.current;
51
+ if (scrollerElt === null) return;
52
+ scrollerElt.scrollBy(-1, 0);
53
+ let animationFrame = null;
54
+ const update = () => {
55
+ animationFrame = null;
56
+ const { scrollLeft, clientWidth, scrollWidth } = scrollerElt;
57
+ const center = scrollLeft + clientWidth / 2;
58
+ const children2 = Array.from(scrollerElt.children);
59
+ let closestIndex = 0;
60
+ let closestDistance = Infinity;
61
+ children2.forEach((child, index) => {
62
+ const childCenter = child.offsetLeft + child.offsetWidth / 2;
63
+ const distance = Math.abs(center - childCenter);
64
+ if (distance < closestDistance) {
65
+ closestDistance = distance;
66
+ closestIndex = index;
67
+ }
68
+ });
69
+ setActiveIndex(closestIndex);
70
+ setCanGoLeft(scrollLeft > 0);
71
+ setCanGoRight(scrollLeft + clientWidth < scrollWidth);
72
+ };
73
+ const onScroll = () => {
74
+ if (animationFrame !== null) return;
75
+ animationFrame = requestAnimationFrame(update);
76
+ };
77
+ scrollerElt.addEventListener("scroll", onScroll, { passive: true });
78
+ update();
79
+ return () => {
80
+ scrollerElt.removeEventListener("scroll", onScroll);
81
+ if (animationFrame !== null) cancelAnimationFrame(animationFrame);
82
+ };
83
+ }, []);
84
+ useEffect(() => {
85
+ const toActivate = active ?? initActive;
86
+ if (toActivate === void 0) return;
87
+ const id = setTimeout(() => forceActivateSlot(scrollerRef.current, toActivate, false), 50);
88
+ return () => clearTimeout(id);
89
+ }, []);
90
+ useEffect(() => {
91
+ if (active === void 0) return;
92
+ forceActivateSlot(scrollerRef.current, active);
93
+ }, [active]);
94
+ const c = clss(publicClassName, { cssModule });
95
+ const rootClss = mergeClassNames(
96
+ c(null, {
97
+ "controlled": active !== void 0,
98
+ "no-snap": noSnap === true,
99
+ "at-first": activeIndex === 0,
100
+ "at-last": activeIndex === childrenCount - 1,
101
+ "can-go-left": canGoLeft,
102
+ "can-go-right": canGoRight
103
+ }),
104
+ className
105
+ );
106
+ const scrollerClss = c("scroller");
107
+ const actionsClss = c("actions");
108
+ const prevBtnClss = c("prev");
109
+ const nextBtnClss = c("next");
110
+ const paginationClss = c("pagination");
111
+ const dataAttributes = { "data-active": `${activeIndex}` };
112
+ const actualPaddingLeft = typeof paddingLeft === "number" ? `${paddingLeft}px` : typeof paddingLeft === "string" ? paddingLeft : typeof padding === "number" ? `${padding}px` : padding ?? "0px";
113
+ const actualPaddingRight = typeof paddingRight === "number" ? `${paddingRight}px` : typeof paddingRight === "string" ? paddingRight : typeof padding === "number" ? `${padding}px` : padding ?? "0px";
114
+ return /* @__PURE__ */ jsxs(
115
+ "div",
116
+ {
117
+ className: rootClss,
118
+ ...dataAttributes,
119
+ children: [
120
+ /* @__PURE__ */ jsx("div", { className: scrollerClss, ref: scrollerRef, children: Children.map(children, (child, pos) => {
121
+ const slotClss = c("slot", { active: pos === activeIndex });
122
+ const style = {
123
+ "margin-left": pos === 0 ? actualPaddingLeft : void 0,
124
+ "margin-right": pos === Children.count(children) - 1 ? actualPaddingRight : void 0
125
+ };
126
+ return /* @__PURE__ */ jsx(
127
+ "div",
128
+ {
129
+ className: `${slotClss}`,
130
+ style: { ...style },
131
+ "data-slot": pos,
132
+ children: child
133
+ },
134
+ pos
135
+ );
136
+ }) }),
137
+ /* @__PURE__ */ jsxs("div", { className: actionsClss, children: [
138
+ /* @__PURE__ */ jsx(
139
+ "div",
140
+ {
141
+ className: prevBtnClss,
142
+ onClick: handlePrevClick,
143
+ children: prevButtonContent ?? "prev"
144
+ }
145
+ ),
146
+ /* @__PURE__ */ jsx(
147
+ "div",
148
+ {
149
+ className: nextBtnClss,
150
+ onClick: handleNextClick,
151
+ children: nextButtonContent ?? "next"
152
+ }
153
+ )
154
+ ] }),
155
+ /* @__PURE__ */ jsx("div", { className: paginationClss, children: Children.map(children, (_, pos) => {
156
+ const pageClss = c("page", { active: pos === activeIndex });
157
+ return /* @__PURE__ */ jsx(
158
+ "div",
159
+ {
160
+ className: pageClss,
161
+ "data-page": pos,
162
+ onClick: () => handlePaginationClick(pos),
163
+ children: typeof paginationContent === "string" ? paginationContent : typeof paginationContent === "function" ? paginationContent(pos) : pos
164
+ }
165
+ );
166
+ }) })
167
+ ]
168
+ }
169
+ );
170
+ };
171
+ export {
172
+ Gallery
173
+ };
@@ -0,0 +1,33 @@
1
+ .scroller {
2
+ display: flex;
3
+ overflow-x: auto;
4
+ scroll-snap-type: x mandatory;
5
+ scroll-behavior: smooth;
6
+ -webkit-overflow-scrolling: touch;
7
+ scrollbar-width: none;
8
+ -ms-overflow-style: none;
9
+ scrollbar-color: transparent transparent;
10
+ }
11
+
12
+ .scroller::-webkit-scrollbar {
13
+ display: none;
14
+ height: 0;
15
+ }
16
+
17
+ .scroller::-webkit-scrollbar-track,
18
+ .scroller::-webkit-scrollbar-thumb {
19
+ background: transparent;
20
+ }
21
+
22
+ .root.root--controlled .scroller {
23
+ overflow-x: hidden;
24
+ }
25
+
26
+ .root.root--no-snap .scroller {
27
+ scroll-snap-type: unset;
28
+ scroll-behavior: unset;
29
+ }
30
+
31
+ .slot {
32
+ scroll-snap-align: center;
33
+ }
@@ -0,0 +1 @@
1
+ export declare const forceActivateSlot: (div: HTMLDivElement | null, targetPos: number, smooth?: boolean) => void;
@@ -0,0 +1,60 @@
1
+ import { type FunctionComponent, type ImgHTMLAttributes } from 'react';
2
+ import { type Props as DisclaimerProps } from '../Disclaimer/index.js';
3
+ import { type Props as TheatreProps } from '../Theatre/index.js';
4
+ import type { WithClassName } from '../utils/types.js';
5
+ /**
6
+ * Describes a single responsive image source for use in a `<picture>` element.
7
+ *
8
+ * @property srcSet - One or more image URLs with optional width/density descriptors
9
+ * (e.g. `'img@2x.png 2x'`).
10
+ * @property type - MIME type hint for the source (e.g. `'image/webp'`).
11
+ * @property media - Media condition under which this source is selected
12
+ * (e.g. `'(max-width: 768px)'`).
13
+ * @property sizes - Sizes attribute forwarded to the `<source>` element.
14
+ */
15
+ type SourceData = {
16
+ srcSet?: string;
17
+ type?: string;
18
+ media?: string;
19
+ sizes?: string;
20
+ };
21
+ /**
22
+ * Props for the {@link Image} component.
23
+ *
24
+ * Extends all native `ImgHTMLAttributes<HTMLImageElement>`, so any standard
25
+ * img attribute (`alt`, `loading`, `sizes`, `srcSet`, etc.) can be passed
26
+ * and will be forwarded to the underlying `<img>` element.
27
+ *
28
+ * @property sources - One or more responsive sources rendered as `<source>`
29
+ * elements inside a wrapping `<picture>`. Accepts:
30
+ * - a single srcSet string,
31
+ * - an array of srcSet strings,
32
+ * - an array of {@link SourceData} objects for full `<source>` control.
33
+ * @property disclaimer - Props forwarded to the internal {@link Disclaimer} component.
34
+ * While the disclaimer is active the `<img>` is hidden.
35
+ * @property theatre - Props forwarded to the internal {@link Theatre} component.
36
+ * @property className - Optional additional class name(s) applied to the root element.
37
+ */
38
+ export type Props = WithClassName<{
39
+ sources?: string | string[] | SourceData[];
40
+ disclaimer?: DisclaimerProps;
41
+ theatre?: TheatreProps;
42
+ }> & ImgHTMLAttributes<HTMLImageElement>;
43
+ /**
44
+ * Image component. Wraps a native `<img>` (or `<picture>`) element with
45
+ * optional responsive sources, an optional disclaimer gate, and
46
+ * viewport-driven visibility tracking.
47
+ *
48
+ *
49
+ * ### Child elements
50
+ * - `__picture` — wrapping `<picture>` element, always rendered. Contains the
51
+ * `<source>` elements (if any) and the `<img>`.
52
+ * - `__img` — the native `<img>` element.
53
+ *
54
+ * @param props - Component properties.
55
+ * @see {@link Props}
56
+ * @returns A `<figure>` element containing a `<picture>` with the image,
57
+ * and an optional disclaimer overlay.
58
+ */
59
+ export declare const Image: FunctionComponent<Props>;
60
+ export {};
@@ -0,0 +1,99 @@
1
+ // src/components/Image/index.tsx
2
+ import {
3
+ useState,
4
+ useMemo,
5
+ useCallback
6
+ } from "react";
7
+ import { clss } from "../../agnostic/css/clss/index.js";
8
+ import {
9
+ Disclaimer
10
+ } from "../Disclaimer/index.js";
11
+ import {
12
+ Theatre
13
+ } from "../Theatre/index.js";
14
+ import { mergeClassNames } from "../utils/index.js";
15
+ import { image as publicClassName } from "../public-classnames.js";
16
+ import cssModule from "./styles.module.css";
17
+ import { jsx, jsxs } from "react/jsx-runtime";
18
+ var Image = ({
19
+ sources,
20
+ disclaimer,
21
+ theatre,
22
+ className,
23
+ ...intrinsicImgAttributes
24
+ }) => {
25
+ const [isDisclaimerOn, setIsDisclaimerOn] = useState(
26
+ disclaimer?.isOn === true || disclaimer?.defaultIsOn === true || disclaimer !== void 0 && disclaimer.defaultIsOn === void 0
27
+ );
28
+ let shouldDisclaimerBeOn = isDisclaimerOn;
29
+ if (disclaimer?.isOn === true) shouldDisclaimerBeOn = true;
30
+ if (disclaimer?.isOn === false) shouldDisclaimerBeOn = false;
31
+ const parsedSources = useMemo(() => {
32
+ if (sources === void 0) return [];
33
+ if (typeof sources === "string") return [{ srcSet: sources }];
34
+ if (Array.isArray(sources)) {
35
+ if (sources.length === 0) return [];
36
+ if (typeof sources[0] === "string") return sources.map((srcSet) => ({ srcSet }));
37
+ return sources;
38
+ }
39
+ return [];
40
+ }, [sources]);
41
+ const handleDisclaimerDismissClick = useCallback(() => {
42
+ disclaimer?.actionHandlers?.dismissClick?.(isDisclaimerOn);
43
+ setIsDisclaimerOn(false);
44
+ }, []);
45
+ const c = clss(publicClassName, { cssModule });
46
+ const rootClss = mergeClassNames(c(), className);
47
+ const rootAttributes = {};
48
+ const pictureClss = c("picture");
49
+ const imgClss = c("image");
50
+ const sensitiveContent = /* @__PURE__ */ jsxs("picture", { className: pictureClss, children: [
51
+ parsedSources.map(
52
+ (source, index) => /* @__PURE__ */ jsx(
53
+ "source",
54
+ {
55
+ srcSet: typeof source === "string" ? source : source.srcSet,
56
+ type: typeof source === "string" ? void 0 : source.type,
57
+ media: typeof source === "string" ? void 0 : source.media,
58
+ sizes: typeof source === "string" ? void 0 : source.sizes
59
+ },
60
+ index
61
+ )
62
+ ),
63
+ /* @__PURE__ */ jsx(
64
+ "img",
65
+ {
66
+ className: imgClss,
67
+ ...intrinsicImgAttributes
68
+ }
69
+ )
70
+ ] });
71
+ const theatricalContent = theatre !== void 0 ? /* @__PURE__ */ jsx(
72
+ Theatre,
73
+ {
74
+ defaultIsOn: false,
75
+ ...theatre,
76
+ children: sensitiveContent
77
+ }
78
+ ) : sensitiveContent;
79
+ const disclaimedContent = disclaimer !== void 0 ? /* @__PURE__ */ jsx(
80
+ Disclaimer,
81
+ {
82
+ ...disclaimer,
83
+ isOn: shouldDisclaimerBeOn,
84
+ actionHandlers: { dismissClick: handleDisclaimerDismissClick },
85
+ children: theatricalContent
86
+ }
87
+ ) : theatricalContent;
88
+ return /* @__PURE__ */ jsx(
89
+ "figure",
90
+ {
91
+ className: rootClss,
92
+ ...rootAttributes,
93
+ children: disclaimedContent
94
+ }
95
+ );
96
+ };
97
+ export {
98
+ Image
99
+ };
File without changes
@@ -1,20 +1,57 @@
1
- import { type ReactNode } from 'react';
1
+ import { type PropsWithChildren, type FunctionComponent } from 'react';
2
+ import type { WithClassName } from '../utils/types.js';
3
+ /** Alias for the native IntersectionObserver interface. */
2
4
  export type IO = IntersectionObserver;
5
+ /** Alias for the native IntersectionObserverEntry interface. */
3
6
  export type IOE = IntersectionObserverEntry;
4
- type ObserverOptions = {
7
+ /**
8
+ * Configuration options for the underlying IntersectionObserver instance.
9
+ *
10
+ * @property root - The element used as the viewport for checking visibility.
11
+ * If not provided, the browser viewport is used.
12
+ * @property rootMargin - Margin around the root, in CSS margin format
13
+ * (e.g. "10px 20px"). Expands or shrinks the effective root bounds.
14
+ * @property threshold - A single number or an array of numbers indicating
15
+ * at what percentage(s) of the target's visibility the observer callback
16
+ * should be executed.
17
+ */
18
+ export type ObserverOptions = {
5
19
  root?: HTMLElement;
6
20
  rootMargin?: string;
7
21
  threshold?: number[] | number;
8
22
  };
9
- export type Props = {
10
- className?: string;
11
- render?: ReactNode;
12
- onIntersection?: (details: {
23
+ /**
24
+ * Props for the IntersectionObserverComponent.
25
+ *
26
+ * @property onIntersected - Callback invoked whenever an intersection change
27
+ * is reported. Receives an object containing the current
28
+ * {@link IntersectionObserverEntry} (if available) and the active
29
+ * {@link IntersectionObserver} instance.
30
+ *
31
+ * @property root - See {@link ObserverOptions.root}.
32
+ * @property rootMargin - See {@link ObserverOptions.rootMargin}.
33
+ * @property threshold - See {@link ObserverOptions.threshold}.
34
+ * @property className - Optional additional class name(s) applied to the root element.
35
+ * @property children - React children rendered inside the observed element.
36
+ */
37
+ export type Props = PropsWithChildren<WithClassName<{
38
+ onIntersected?: (details: {
13
39
  ioEntry?: IOE | undefined;
14
40
  observer: IO;
15
41
  }) => void;
16
- content?: ReactNode;
17
- children?: ReactNode;
18
- } & ObserverOptions;
19
- export declare const IntersectionObserverComponent: ({ className, render, content, onIntersection, root, rootMargin, threshold, children }: Props) => import("react/jsx-runtime").JSX.Element;
20
- export {};
42
+ } & ObserverOptions>>;
43
+ /**
44
+ * Component that observes its root element using the IntersectionObserver API
45
+ * and notifies consumers about visibility changes.
46
+ *
47
+ * @param props - Component properties.
48
+ * @see {@link Props}
49
+ *
50
+ * @returns A div element wrapping `children`, observed for intersection changes.
51
+ *
52
+ * @remarks
53
+ * - Automatically creates and disconnects the {@link IntersectionObserver} instance.
54
+ * - Re-observes the element shortly after mount to handle late layout changes.
55
+ * - Adds an `is-intersecting` modifier class when the element is intersecting.
56
+ */
57
+ export declare const IntersectionObserverComponent: FunctionComponent<Props>;