@unicom-cloud/utils 0.1.24 → 0.1.26

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 (416) hide show
  1. package/axios/index.d.ts +791 -0
  2. package/axios/index.js +41 -0
  3. package/axios/lib/adapters/adapters.js +65 -0
  4. package/axios/lib/adapters/fetch.js +186 -0
  5. package/axios/lib/adapters/xhr.js +105 -0
  6. package/axios/lib/axios.js +47 -0
  7. package/axios/lib/cancel/CancelToken.js +78 -0
  8. package/axios/lib/cancel/CanceledError.js +18 -0
  9. package/axios/lib/cancel/isCancel.js +7 -0
  10. package/axios/lib/core/Axios.js +170 -0
  11. package/axios/lib/core/AxiosError.js +64 -0
  12. package/axios/lib/core/AxiosHeaders.js +192 -0
  13. package/axios/lib/core/InterceptorManager.js +59 -0
  14. package/axios/lib/core/buildFullPath.js +10 -0
  15. package/axios/lib/core/dispatchRequest.js +35 -0
  16. package/axios/lib/core/mergeConfig.js +74 -0
  17. package/axios/lib/core/settle.js +17 -0
  18. package/axios/lib/core/transformData.js +19 -0
  19. package/axios/lib/defaults/index.js +103 -0
  20. package/axios/lib/defaults/transitional.js +9 -0
  21. package/axios/lib/env/data.js +5 -0
  22. package/axios/lib/helpers/AxiosURLSearchParams.js +37 -0
  23. package/axios/lib/helpers/HttpStatusCode.js +78 -0
  24. package/axios/lib/helpers/bind.js +9 -0
  25. package/axios/lib/helpers/buildURL.js +24 -0
  26. package/axios/lib/helpers/combineURLs.js +7 -0
  27. package/axios/lib/helpers/composeSignals.js +38 -0
  28. package/axios/lib/helpers/cookies.js +37 -0
  29. package/axios/lib/helpers/formDataToJSON.js +32 -0
  30. package/axios/lib/helpers/isAbsoluteURL.js +7 -0
  31. package/axios/lib/helpers/isAxiosError.js +8 -0
  32. package/axios/lib/helpers/isURLSameOrigin.js +9 -0
  33. package/axios/lib/helpers/parseHeaders.js +31 -0
  34. package/axios/lib/helpers/parseProtocol.js +8 -0
  35. package/axios/lib/helpers/progressEventReducer.js +39 -0
  36. package/axios/lib/helpers/resolveConfig.js +44 -0
  37. package/axios/lib/helpers/speedometer.js +20 -0
  38. package/axios/lib/helpers/spread.js +9 -0
  39. package/axios/lib/helpers/throttle.js +16 -0
  40. package/axios/lib/helpers/toFormData.js +91 -0
  41. package/axios/lib/helpers/toURLEncodedForm.js +15 -0
  42. package/axios/lib/helpers/trackStream.js +67 -0
  43. package/axios/lib/helpers/validator.js +66 -0
  44. package/axios/lib/platform/browser/classes/Blob.js +5 -0
  45. package/axios/lib/platform/browser/classes/FormData.js +5 -0
  46. package/axios/lib/platform/browser/classes/URLSearchParams.js +6 -0
  47. package/axios/lib/platform/browser/index.js +16 -0
  48. package/axios/lib/platform/common/utils.js +9 -0
  49. package/axios/lib/platform/index.js +10 -0
  50. package/axios/lib/utils.js +248 -0
  51. package/axios-mock-adapter/index.d.ts +59 -0
  52. package/axios-mock-adapter/index.js +206 -0
  53. package/axios-mock-adapter/request.js +51 -0
  54. package/axios-mock-adapter/utils.js +129 -0
  55. package/axios.js +24 -0
  56. package/axiosMockAdapter.js +9 -0
  57. package/case-name/index.js +1 -1
  58. package/caseName.js +1 -1
  59. package/class-name/index.js +1 -1
  60. package/className.js +1 -1
  61. package/clipboard-copy/index.js +1 -1
  62. package/clipboardCopy.js +1 -1
  63. package/constant/address.js +1 -1
  64. package/constant/chineseCharacters.js +1 -1
  65. package/constant/constellations.js +1 -1
  66. package/constant/domain.js +1 -1
  67. package/constant/emoji.js +1 -1
  68. package/constant/identity.js +1 -1
  69. package/constant/index.js +1 -1
  70. package/constant/keyboardCode.js +1 -1
  71. package/constant/licensePlate.js +1 -1
  72. package/constant/name.js +1 -1
  73. package/constant/platform.js +1 -1
  74. package/constant/protocol.js +1 -1
  75. package/constant/ui.js +1 -1
  76. package/constant.js +1 -1
  77. package/content-disposition/index.js +1 -1
  78. package/contentDisposition.js +1 -1
  79. package/cookie/index.js +1 -1
  80. package/cookie/src/index.js +1 -1
  81. package/cookie.js +1 -1
  82. package/date/convertTime.js +1 -1
  83. package/date/convertToDuration.js +1 -1
  84. package/date/index.js +1 -1
  85. package/date.js +1 -1
  86. package/decimal/decimal.js +22 -22
  87. package/decimal/index.js +1 -1
  88. package/decimal.js +1 -1
  89. package/dom-helpers/activeElement.js +1 -1
  90. package/dom-helpers/addClass.js +1 -1
  91. package/dom-helpers/addEventListener.js +1 -1
  92. package/dom-helpers/animate.js +1 -1
  93. package/dom-helpers/animationFrame.js +1 -1
  94. package/dom-helpers/attribute.js +1 -1
  95. package/dom-helpers/camelize.js +1 -1
  96. package/dom-helpers/camelizeStyle.js +1 -1
  97. package/dom-helpers/canUseDOM.js +1 -1
  98. package/dom-helpers/childElements.js +1 -1
  99. package/dom-helpers/childNodes.js +1 -1
  100. package/dom-helpers/clear.js +1 -1
  101. package/dom-helpers/closest.js +1 -1
  102. package/dom-helpers/collectElements.js +1 -1
  103. package/dom-helpers/collectSiblings.js +1 -1
  104. package/dom-helpers/contains.js +1 -1
  105. package/dom-helpers/css.js +1 -1
  106. package/dom-helpers/filterEventHandler.js +1 -1
  107. package/dom-helpers/getComputedStyle.js +1 -1
  108. package/dom-helpers/getScrollAccessor.js +1 -1
  109. package/dom-helpers/hasClass.js +1 -1
  110. package/dom-helpers/height.js +1 -1
  111. package/dom-helpers/hyphenate.js +1 -1
  112. package/dom-helpers/hyphenateStyle.js +1 -1
  113. package/dom-helpers/index.js +1 -1
  114. package/dom-helpers/insertAfter.js +1 -1
  115. package/dom-helpers/isDocument.js +1 -1
  116. package/dom-helpers/isInput.js +1 -1
  117. package/dom-helpers/isTransform.js +1 -1
  118. package/dom-helpers/isVisible.js +1 -1
  119. package/dom-helpers/isWindow.js +1 -1
  120. package/dom-helpers/listen.js +1 -1
  121. package/dom-helpers/matches.js +1 -1
  122. package/dom-helpers/nextUntil.js +1 -1
  123. package/dom-helpers/offset.js +1 -1
  124. package/dom-helpers/offsetParent.js +1 -1
  125. package/dom-helpers/ownerDocument.js +1 -1
  126. package/dom-helpers/ownerWindow.js +1 -1
  127. package/dom-helpers/parents.js +1 -1
  128. package/dom-helpers/position.js +1 -1
  129. package/dom-helpers/prepend.js +1 -1
  130. package/dom-helpers/querySelectorAll.js +1 -1
  131. package/dom-helpers/reflow.js +1 -1
  132. package/dom-helpers/remove.js +1 -1
  133. package/dom-helpers/removeClass.js +1 -1
  134. package/dom-helpers/removeEventListener.js +1 -1
  135. package/dom-helpers/scrollLeft.js +1 -1
  136. package/dom-helpers/scrollParent.js +1 -1
  137. package/dom-helpers/scrollTo.js +1 -1
  138. package/dom-helpers/scrollTop.js +1 -1
  139. package/dom-helpers/scrollbarSize.js +1 -1
  140. package/dom-helpers/siblings.js +1 -1
  141. package/dom-helpers/text.js +1 -1
  142. package/dom-helpers/toggleClass.js +1 -1
  143. package/dom-helpers/transitionEnd.js +1 -1
  144. package/dom-helpers/triggerEvent.js +1 -1
  145. package/dom-helpers/types.js +5 -1
  146. package/dom-helpers/width.js +1 -1
  147. package/domHelpers.js +1 -1
  148. package/emitter/index.js +1 -1
  149. package/emitter/src/index.js +1 -1
  150. package/emitter.js +1 -1
  151. package/file/fileToURL.js +1 -1
  152. package/file/index.js +1 -1
  153. package/file/saveAs.js +1 -1
  154. package/file.js +1 -1
  155. package/idb/index.js +1 -1
  156. package/idb.js +1 -1
  157. package/index.js +1 -1
  158. package/invariant/index.js +1 -1
  159. package/invariant.js +1 -1
  160. package/is/index.js +140 -123
  161. package/is.js +77 -76
  162. package/js-cookie/index.js +1 -1
  163. package/js-cookie/src/api.js +1 -1
  164. package/js-cookie/src/assign.js +1 -1
  165. package/js-cookie/src/converter.js +1 -1
  166. package/jsCookie.js +1 -1
  167. package/lunar/index.js +1 -1
  168. package/lunar/lib/Holiday.js +1 -1
  169. package/lunar/lib/HolidayUtil.js +1 -1
  170. package/lunar/lib/I18n.js +1 -1
  171. package/lunar/lib/JieQi.js +1 -1
  172. package/lunar/lib/Lunar.js +1 -1
  173. package/lunar/lib/LunarMonth.js +1 -1
  174. package/lunar/lib/LunarTime.js +1 -1
  175. package/lunar/lib/LunarUtil.js +1 -1
  176. package/lunar/lib/LunarYear.js +1 -1
  177. package/lunar/lib/ShouXingUtil.js +1 -1
  178. package/lunar/lib/Solar.js +1 -1
  179. package/lunar/lib/SolarHalfYear.js +1 -1
  180. package/lunar/lib/SolarMonth.js +1 -1
  181. package/lunar/lib/SolarSeason.js +1 -1
  182. package/lunar/lib/SolarUtil.js +1 -1
  183. package/lunar/lib/SolarWeek.js +1 -1
  184. package/lunar/lib/SolarYear.js +1 -1
  185. package/lunar/lib/index.js +1 -1
  186. package/lunar.js +1 -1
  187. package/math/index.js +1 -1
  188. package/math.js +1 -1
  189. package/md5/index.js +1 -1
  190. package/md5.js +1 -1
  191. package/mock/MockWebSocket.js +1 -1
  192. package/mock/MockXMLHttpRequest.js +1 -1
  193. package/mock/index.js +1 -1
  194. package/mock.js +1 -1
  195. package/normalize-wheel/ExecutionEnvironment.js +1 -1
  196. package/normalize-wheel/UserAgent_DEPRECATED.js +1 -1
  197. package/normalize-wheel/index.js +1 -1
  198. package/normalize-wheel/isEventSupported.js +10 -14
  199. package/normalizeWheel.js +1 -1
  200. package/number-to-chinese/index.js +1 -1
  201. package/numberToChinese.js +1 -1
  202. package/nzh/cn.js +1 -1
  203. package/nzh/hk.js +1 -1
  204. package/nzh/index.js +1 -1
  205. package/nzh/nzh.js +1 -1
  206. package/nzh/src/autoGet.js +1 -1
  207. package/nzh/src/index.js +1 -1
  208. package/nzh/src/langs/cn_b.js +1 -1
  209. package/nzh/src/langs/cn_s.js +1 -1
  210. package/nzh/src/langs/hk_b.js +1 -1
  211. package/nzh/src/langs/hk_s.js +1 -1
  212. package/nzh/src/utils.js +1 -1
  213. package/nzh.js +1 -1
  214. package/object-keys-sort/index.js +1 -1
  215. package/object-prototype-to-string-call/index.js +7 -0
  216. package/objectKeysSort.js +1 -1
  217. package/objectPrototypeToStringCall.js +5 -0
  218. package/package.json +1 -1
  219. package/pinyin/index.js +1 -1
  220. package/pinyin/simplified.js +1 -1
  221. package/pinyin/src/core.js +1 -1
  222. package/pinyin/src/simplified.js +1 -1
  223. package/pinyin/src/simplified_dict.js +1 -1
  224. package/pinyin/src/traditional.js +1 -1
  225. package/pinyin/src/traditional_dict.js +1 -1
  226. package/pinyin/traditional.js +1 -1
  227. package/pinyin.js +1 -1
  228. package/query-string/base.js +1 -1
  229. package/query-string/index.js +1 -1
  230. package/query-string/splitOnFirst.js +1 -1
  231. package/queryString.js +1 -1
  232. package/random/address.js +1 -1
  233. package/random/constellation.js +1 -1
  234. package/random/image.js +1 -1
  235. package/random/index.js +1 -1
  236. package/random/licensePlate.js +1 -1
  237. package/random/name.js +1 -1
  238. package/random/number.js +1 -1
  239. package/random/text.js +12 -11
  240. package/random/time.js +1 -1
  241. package/random/web.js +1 -1
  242. package/random.js +1 -1
  243. package/screenfull/index.js +21 -20
  244. package/screenfull.js +4 -3
  245. package/sleep/index.js +1 -1
  246. package/sleep.js +1 -1
  247. package/snapdom/index.js +1 -1
  248. package/snapdom/src/api/preCache.js +51 -49
  249. package/snapdom/src/api/snapdom.js +171 -67
  250. package/snapdom/src/core/cache.js +2 -2
  251. package/snapdom/src/core/capture.js +249 -234
  252. package/snapdom/src/core/clone.js +151 -120
  253. package/snapdom/src/core/context.js +10 -8
  254. package/snapdom/src/core/plugins.js +69 -0
  255. package/snapdom/src/core/prepare.js +2 -2
  256. package/snapdom/src/exporters/download.js +1 -1
  257. package/snapdom/src/exporters/toBlob.js +1 -1
  258. package/snapdom/src/exporters/toCanvas.js +40 -40
  259. package/snapdom/src/exporters/toImg.js +1 -1
  260. package/snapdom/src/modules/CSSVar.js +66 -40
  261. package/snapdom/src/modules/background.js +39 -23
  262. package/snapdom/src/modules/changeCSS.js +1 -1
  263. package/snapdom/src/modules/counter.js +100 -86
  264. package/snapdom/src/modules/fonts.js +4 -4
  265. package/snapdom/src/modules/iconFonts.js +98 -14
  266. package/snapdom/src/modules/images.js +1 -1
  267. package/snapdom/src/modules/lineClamp.js +1 -1
  268. package/snapdom/src/modules/pseudo.js +147 -138
  269. package/snapdom/src/modules/rasterize.js +1 -1
  270. package/snapdom/src/modules/snapFetch.js +1 -1
  271. package/snapdom/src/modules/styles.js +1 -1
  272. package/snapdom/src/modules/svgDefs.js +86 -39
  273. package/snapdom/src/utils/browser.js +1 -1
  274. package/snapdom/src/utils/css.js +1 -1
  275. package/snapdom/src/utils/helpers.js +1 -1
  276. package/snapdom/src/utils/image.js +1 -1
  277. package/snapdom/types/snapdom.d.ts +253 -184
  278. package/snapdom.js +1 -1
  279. package/tinycolor/index.js +1 -1
  280. package/tinycolor/src/conversion.js +1 -1
  281. package/tinycolor/src/css-color-names.js +1 -1
  282. package/tinycolor/src/format-input.js +1 -1
  283. package/tinycolor/src/from-ratio.js +1 -1
  284. package/tinycolor/src/index.js +1 -1
  285. package/tinycolor/src/random.js +1 -1
  286. package/tinycolor/src/readability.js +1 -1
  287. package/tinycolor/src/to-ms-filter.js +1 -1
  288. package/tinycolor/src/utils.js +1 -1
  289. package/tinycolor.js +1 -1
  290. package/tree/index.js +31 -30
  291. package/tree/search/index.js +1 -1
  292. package/tree.js +13 -12
  293. package/tween/index.js +8 -0
  294. package/tween/src/easing.js +62 -0
  295. package/tween/src/tween.js +46 -0
  296. package/tween.js +8 -0
  297. package/types/axios/index.d.ts +19 -0
  298. package/types/axios/lib/adapters/adapters.d.ts +28 -0
  299. package/types/axios/lib/adapters/fetch.d.ts +3 -0
  300. package/types/axios/lib/adapters/http.d.ts +12 -0
  301. package/types/axios/lib/adapters/xhr.d.ts +2 -0
  302. package/types/axios/lib/axios.d.ts +3 -0
  303. package/types/axios/lib/cancel/CancelToken.d.ts +34 -0
  304. package/types/axios/lib/cancel/CanceledError.d.ts +24 -0
  305. package/types/axios/lib/cancel/isCancel.d.ts +1 -0
  306. package/types/axios/lib/core/Axios.d.ts +28 -0
  307. package/types/axios/lib/core/AxiosError.d.ts +38 -0
  308. package/types/axios/lib/core/AxiosHeaders.d.ts +23 -0
  309. package/types/axios/lib/core/InterceptorManager.d.ts +38 -0
  310. package/types/axios/lib/core/buildFullPath.d.ts +11 -0
  311. package/types/axios/lib/core/dispatchRequest.d.ts +8 -0
  312. package/types/axios/lib/core/mergeConfig.d.ts +10 -0
  313. package/types/axios/lib/core/settle.d.ts +10 -0
  314. package/types/axios/lib/core/transformData.d.ts +9 -0
  315. package/types/axios/lib/defaults/index.d.ts +30 -0
  316. package/types/axios/lib/defaults/transitional.d.ts +6 -0
  317. package/types/axios/lib/env/classes/FormData.d.ts +2 -0
  318. package/types/axios/lib/env/data.d.ts +1 -0
  319. package/types/axios/lib/helpers/AxiosTransformStream.d.ts +19 -0
  320. package/types/axios/lib/helpers/AxiosURLSearchParams.d.ts +30 -0
  321. package/types/axios/lib/helpers/HttpStatusCode.d.ts +72 -0
  322. package/types/axios/lib/helpers/ZlibHeaderTransformStream.d.ts +5 -0
  323. package/types/axios/lib/helpers/bind.d.ts +8 -0
  324. package/types/axios/lib/helpers/buildURL.d.ts +10 -0
  325. package/types/axios/lib/helpers/callbackify.d.ts +2 -0
  326. package/types/axios/lib/helpers/combineURLs.d.ts +9 -0
  327. package/types/axios/lib/helpers/composeSignals.d.ts +2 -0
  328. package/types/axios/lib/helpers/cookies.d.ts +6 -0
  329. package/types/axios/lib/helpers/deprecatedMethod.d.ts +11 -0
  330. package/types/axios/lib/helpers/estimateDataURLDecodedBytes.d.ts +10 -0
  331. package/types/axios/lib/helpers/formDataToJSON.d.ts +11 -0
  332. package/types/axios/lib/helpers/formDataToStream.d.ts +2 -0
  333. package/types/axios/lib/helpers/fromDataURI.d.ts +11 -0
  334. package/types/axios/lib/helpers/isAbsoluteURL.d.ts +8 -0
  335. package/types/axios/lib/helpers/isAxiosError.d.ts +8 -0
  336. package/types/axios/lib/helpers/isURLSameOrigin.d.ts +2 -0
  337. package/types/axios/lib/helpers/null.d.ts +2 -0
  338. package/types/axios/lib/helpers/parseHeaders.d.ts +2 -0
  339. package/types/axios/lib/helpers/parseProtocol.d.ts +1 -0
  340. package/types/axios/lib/helpers/progressEventReducer.d.ts +3 -0
  341. package/types/axios/lib/helpers/readBlob.d.ts +2 -0
  342. package/types/axios/lib/helpers/resolveConfig.d.ts +2 -0
  343. package/types/axios/lib/helpers/speedometer.d.ts +8 -0
  344. package/types/axios/lib/helpers/spread.d.ts +22 -0
  345. package/types/axios/lib/helpers/throttle.d.ts +8 -0
  346. package/types/axios/lib/helpers/toFormData.d.ts +26 -0
  347. package/types/axios/lib/helpers/toURLEncodedForm.d.ts +1 -0
  348. package/types/axios/lib/helpers/trackStream.d.ts +3 -0
  349. package/types/axios/lib/helpers/validator.d.ts +28 -0
  350. package/types/axios/lib/platform/browser/classes/Blob.d.ts +5 -0
  351. package/types/axios/lib/platform/browser/classes/FormData.d.ts +5 -0
  352. package/types/axios/lib/platform/browser/classes/URLSearchParams.d.ts +6 -0
  353. package/types/axios/lib/platform/browser/index.d.ts +13 -0
  354. package/types/axios/lib/platform/common/utils.d.ts +32 -0
  355. package/types/axios/lib/platform/index.d.ts +24 -0
  356. package/types/axios/lib/platform/node/classes/FormData.d.ts +1 -0
  357. package/types/axios/lib/platform/node/classes/URLSearchParams.d.ts +2 -0
  358. package/types/axios/lib/platform/node/index.d.ts +25 -0
  359. package/types/axios/lib/utils.d.ts +289 -0
  360. package/types/axios-mock-adapter/index.d.ts +19 -0
  361. package/types/axios-mock-adapter/request.d.ts +2 -0
  362. package/types/axios-mock-adapter/utils.d.ts +31 -0
  363. package/types/dom-helpers/types.d.ts +2 -0
  364. package/types/is/index.d.ts +16 -16
  365. package/types/normalize-wheel/index.d.ts +1 -1
  366. package/types/object-prototype-to-string-call/index.d.ts +2 -0
  367. package/types/snapdom/src/api/snapdom.d.ts +4 -0
  368. package/types/snapdom/src/core/capture.d.ts +4 -18
  369. package/types/snapdom/src/core/context.d.ts +5 -5
  370. package/types/snapdom/src/core/exporters.d.ts +33 -0
  371. package/types/snapdom/src/core/plugins.d.ts +59 -0
  372. package/types/snapdom/src/modules/CSSVar.d.ts +3 -7
  373. package/types/snapdom/src/modules/iconFonts.d.ts +34 -0
  374. package/types/snapdom/src/modules/svgDefs.d.ts +9 -15
  375. package/types/tween/index.d.ts +1 -0
  376. package/types/tween/src/easing.d.ts +22 -0
  377. package/types/tween/src/index.d.ts +3 -0
  378. package/types/tween/src/tween.d.ts +22 -0
  379. package/types/validate/index.d.ts +3 -0
  380. package/types/validate/src/index.d.ts +39 -0
  381. package/types/validate/src/interface.d.ts +53 -0
  382. package/types/validate/src/locale/en-US.d.ts +47 -0
  383. package/types/validate/src/locale/zh-CN.d.ts +47 -0
  384. package/types/validate/src/message.d.ts +2 -0
  385. package/types/validate/src/rules/array.d.ts +12 -0
  386. package/types/validate/src/rules/base.d.ts +25 -0
  387. package/types/validate/src/rules/boolean.d.ts +8 -0
  388. package/types/validate/src/rules/custom.d.ts +7 -0
  389. package/types/validate/src/rules/number.d.ts +12 -0
  390. package/types/validate/src/rules/object.d.ts +9 -0
  391. package/types/validate/src/rules/string.d.ts +12 -0
  392. package/types/validate/src/rules/type.d.ts +9 -0
  393. package/types/validate/src/utils.d.ts +3 -0
  394. package/ui-color/compareColorByRange.js +1 -1
  395. package/ui-color/index.js +1 -1
  396. package/uiColor.js +1 -1
  397. package/url-toolkit/index.js +1 -1
  398. package/url-toolkit/src/url-toolkit.js +1 -1
  399. package/urlToolkit.js +1 -1
  400. package/validate/index.js +28 -0
  401. package/validate/src/index.js +106 -0
  402. package/validate/src/locale/en-US.js +50 -0
  403. package/validate/src/locale/zh-CN.js +50 -0
  404. package/validate/src/message.js +5 -0
  405. package/validate/src/rules/array.js +73 -0
  406. package/validate/src/rules/base.js +69 -0
  407. package/validate/src/rules/boolean.js +29 -0
  408. package/validate/src/rules/custom.js +26 -0
  409. package/validate/src/rules/number.js +54 -0
  410. package/validate/src/rules/object.js +39 -0
  411. package/validate/src/rules/string.js +54 -0
  412. package/validate/src/rules/type.js +35 -0
  413. package/validate/src/utils.js +8 -0
  414. package/validate.js +28 -0
  415. package/version/index.js +1 -1
  416. package/version.js +1 -1
@@ -1,48 +1,48 @@
1
- /* 2025-10-28 09:57:10 */
1
+ /* 2025-11-04 10:32:44 */
2
2
  import { resolveCSSVars as N } from "../modules/CSSVar.js";
3
- import { inlineAllStyles as w } from "../modules/styles.js";
3
+ import { inlineAllStyles as b } from "../modules/styles.js";
4
4
  import { NO_CAPTURE_TAGS as v } from "../utils/css.js";
5
5
  import { idle as M } from "../utils/browser.js";
6
6
  function E(t, r, n) {
7
7
  return Promise.all(
8
8
  t.map((e) => new Promise((o) => {
9
- function u() {
9
+ function s() {
10
10
  M(
11
- (c) => {
12
- (c && typeof c.timeRemaining == "function" ? c.timeRemaining() > 0 : !0) ? r(e, o) : u();
11
+ (l) => {
12
+ (l && typeof l.timeRemaining == "function" ? l.timeRemaining() > 0 : !0) ? r(e, o) : s();
13
13
  },
14
14
  { fast: n }
15
15
  );
16
16
  }
17
- u();
17
+ s();
18
18
  }))
19
19
  );
20
20
  }
21
21
  function R(t) {
22
22
  return t = t.trim(), !t || /:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(t) ? t : `${t}:not([data-sd-slotted])`;
23
23
  }
24
- function T(t, r, n = !0) {
24
+ function C(t, r, n = !0) {
25
25
  return t.split(",").map((e) => e.trim()).filter(Boolean).map((e) => {
26
26
  if (e.startsWith(":where(") || e.startsWith("@")) return e;
27
27
  const o = n ? R(e) : e;
28
28
  return `:where(${r} ${o})`;
29
29
  }).join(", ");
30
30
  }
31
- function k(t, r) {
31
+ function T(t, r) {
32
32
  return t ? (t = t.replace(/:host\(([^)]+)\)/g, (n, e) => `:where(${r}:is(${e.trim()}))`), t = t.replace(/:host\b/g, `:where(${r})`), t = t.replace(/:host-context\(([^)]+)\)/g, (n, e) => `:where(:where(${e.trim()}) ${r})`), t = t.replace(/::slotted\(([^)]+)\)/g, (n, e) => `:where(${r} ${e.trim()})`), t = t.replace(
33
33
  /(^|})(\s*)([^@}{]+){/g,
34
- (n, e, o, u) => {
35
- const c = T(
36
- u,
34
+ (n, e, o, s) => {
35
+ const l = C(
36
+ s,
37
37
  r,
38
38
  /*excludeSlotted*/
39
39
  !0
40
40
  );
41
- return `${e}${o}${c}{`;
41
+ return `${e}${o}${l}{`;
42
42
  }
43
43
  ), t) : "";
44
44
  }
45
- function C(t) {
45
+ function k(t) {
46
46
  return t.shadowScopeSeq = (t.shadowScopeSeq || 0) + 1, `s${t.shadowScopeSeq}`;
47
47
  }
48
48
  function L(t) {
@@ -64,12 +64,12 @@ function L(t) {
64
64
  }
65
65
  return r;
66
66
  }
67
- function W(t, r, n) {
67
+ function I(t, r, n) {
68
68
  if (!r) return;
69
69
  const e = document.createElement("style");
70
70
  e.setAttribute("data-sd", n), e.textContent = r, t.insertBefore(e, t.firstChild || null);
71
71
  }
72
- function I(t, r) {
72
+ function W(t, r) {
73
73
  try {
74
74
  const n = t.currentSrc || t.src || "";
75
75
  if (!n) return;
@@ -77,7 +77,7 @@ function I(t, r) {
77
77
  } catch {
78
78
  }
79
79
  }
80
- function H(t) {
80
+ function D(t) {
81
81
  const r = /* @__PURE__ */ new Set();
82
82
  if (!t) return r;
83
83
  const n = /var\(\s*(--[A-Za-z0-9_-]+)\b/g;
@@ -85,7 +85,7 @@ function H(t) {
85
85
  for (; e = n.exec(t); ) r.add(e[1]);
86
86
  return r;
87
87
  }
88
- function B(t, r) {
88
+ function F(t, r) {
89
89
  try {
90
90
  let e = getComputedStyle(t).getPropertyValue(r).trim();
91
91
  if (e) return e;
@@ -98,19 +98,19 @@ function B(t, r) {
98
98
  }
99
99
  return "";
100
100
  }
101
- function D(t, r, n) {
101
+ function H(t, r, n) {
102
102
  const e = [];
103
103
  for (const o of r) {
104
- const u = B(t, o);
105
- u && e.push(`${o}: ${u};`);
104
+ const s = F(t, o);
105
+ s && e.push(`${o}: ${s};`);
106
106
  }
107
107
  return e.length ? `${n}{${e.join("")}}
108
108
  ` : "";
109
109
  }
110
- function F(t) {
110
+ function P(t) {
111
111
  t && (t.nodeType === Node.ELEMENT_NODE && t.setAttribute("data-sd-slotted", ""), t.querySelectorAll && t.querySelectorAll("*").forEach((r) => r.setAttribute("data-sd-slotted", "")));
112
112
  }
113
- async function P(t, r = 3) {
113
+ async function B(t, r = 3) {
114
114
  const n = () => {
115
115
  try {
116
116
  return t.contentDocument || t.contentWindow?.document || null;
@@ -120,21 +120,21 @@ async function P(t, r = 3) {
120
120
  };
121
121
  let e = n(), o = 0;
122
122
  for (; o < r && (!e || !e.body && !e.documentElement); )
123
- await new Promise((u) => setTimeout(u, 0)), e = n(), o++;
123
+ await new Promise((s) => setTimeout(s, 0)), e = n(), o++;
124
124
  return e && (e.body || e.documentElement) ? e : null;
125
125
  }
126
126
  function _(t) {
127
127
  const r = t.getBoundingClientRect();
128
- let n = 0, e = 0, o = 0, u = 0;
128
+ let n = 0, e = 0, o = 0, s = 0;
129
129
  try {
130
- const h = getComputedStyle(t);
131
- n = parseFloat(h.borderLeftWidth) || 0, e = parseFloat(h.borderRightWidth) || 0, o = parseFloat(h.borderTopWidth) || 0, u = parseFloat(h.borderBottomWidth) || 0;
130
+ const f = getComputedStyle(t);
131
+ n = parseFloat(f.borderLeftWidth) || 0, e = parseFloat(f.borderRightWidth) || 0, o = parseFloat(f.borderTopWidth) || 0, s = parseFloat(f.borderBottomWidth) || 0;
132
132
  } catch {
133
133
  }
134
- const c = Math.max(0, Math.round(r.width - (n + e))), s = Math.max(0, Math.round(r.height - (o + u)));
135
- return { contentWidth: c, contentHeight: s, rect: r };
134
+ const l = Math.max(0, Math.round(r.width - (n + e))), h = Math.max(0, Math.round(r.height - (o + s)));
135
+ return { contentWidth: l, contentHeight: h, rect: r };
136
136
  }
137
- function z(t, r, n) {
137
+ function q(t, r, n) {
138
138
  const e = t.createElement("style");
139
139
  return e.setAttribute("data-sd-iframe-pin", ""), e.textContent = `html, body {margin: 0 !important;padding: 0 !important;width: ${r}px !important;height: ${n}px !important;min-width: ${r}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`, (t.head || t.documentElement).appendChild(e), () => {
140
140
  try {
@@ -143,190 +143,221 @@ function z(t, r, n) {
143
143
  }
144
144
  };
145
145
  }
146
- async function O(t, r, n) {
147
- const e = await P(t, 3);
146
+ async function z(t, r, n) {
147
+ const e = await B(t, 3);
148
148
  if (!e) throw new Error("iframe document not accessible/ready");
149
- const { contentWidth: o, contentHeight: u, rect: c } = _(t), s = n?.snap;
150
- if (!s || typeof s.toPng != "function")
149
+ const { contentWidth: o, contentHeight: s, rect: l } = _(t), h = n?.snap;
150
+ if (!h || typeof h.toPng != "function")
151
151
  throw new Error("snapdom.toPng not available in iframe or window");
152
- const h = { ...n, scale: 1 }, a = z(e, o, u);
153
- let i;
152
+ const f = { ...n, scale: 1 }, i = q(e, o, s);
153
+ let a;
154
154
  try {
155
- i = await s.toPng(e.documentElement, h);
155
+ a = await h.toPng(e.documentElement, f);
156
156
  } finally {
157
- a();
157
+ i();
158
158
  }
159
- i.style.display = "block", i.style.width = `${o}px`, i.style.height = `${u}px`;
160
- const l = document.createElement("div");
161
- return r.nodeMap.set(l, t), w(t, l, r, n), l.style.overflow = "hidden", l.style.display = "block", l.style.width || (l.style.width = `${Math.round(c.width)}px`), l.style.height || (l.style.height = `${Math.round(c.height)}px`), l.appendChild(i), l;
159
+ a.style.display = "block", a.style.width = `${o}px`, a.style.height = `${s}px`;
160
+ const c = document.createElement("div");
161
+ return r.nodeMap.set(c, t), b(t, c, r, n), c.style.overflow = "hidden", c.style.display = "block", c.style.width || (c.style.width = `${Math.round(l.width)}px`), c.style.height || (c.style.height = `${Math.round(l.height)}px`), c.appendChild(a), c;
162
162
  }
163
163
  async function A(t, r, n) {
164
164
  if (!t) throw new Error("Invalid node");
165
165
  const e = /* @__PURE__ */ new Set();
166
- let o = null, u = null;
166
+ let o = null, s = null;
167
167
  if (t.nodeType === Node.ELEMENT_NODE) {
168
- const a = (t.localName || t.tagName || "").toLowerCase();
169
- if (t.id === "snapdom-sandbox" || t.hasAttribute("data-snapdom-sandbox") || v.has(a))
168
+ const i = (t.localName || t.tagName || "").toLowerCase();
169
+ if (t.id === "snapdom-sandbox" || t.hasAttribute("data-snapdom-sandbox") || v.has(i))
170
170
  return null;
171
171
  }
172
172
  if (t.nodeType === Node.TEXT_NODE || t.nodeType !== Node.ELEMENT_NODE)
173
173
  return t.cloneNode(!0);
174
174
  if (t.getAttribute("data-capture") === "exclude") {
175
175
  if (n.excludeMode === "hide") {
176
- const a = document.createElement("div"), i = t.getBoundingClientRect();
177
- return a.style.cssText = `display:inline-block;width:${i.width}px;height:${i.height}px;visibility:hidden;`, a;
176
+ const i = document.createElement("div"), a = t.getBoundingClientRect();
177
+ return i.style.cssText = `display:inline-block;width:${a.width}px;height:${a.height}px;visibility:hidden;`, i;
178
178
  } else if (n.excludeMode === "remove")
179
179
  return null;
180
180
  }
181
181
  if (n.exclude && Array.isArray(n.exclude))
182
- for (const a of n.exclude)
182
+ for (const i of n.exclude)
183
183
  try {
184
- if (t.matches?.(a)) {
184
+ if (t.matches?.(i)) {
185
185
  if (n.excludeMode === "hide") {
186
- const i = document.createElement("div"), l = t.getBoundingClientRect();
187
- return i.style.cssText = `display:inline-block;width:${l.width}px;height:${l.height}px;visibility:hidden;`, i;
186
+ const a = document.createElement("div"), c = t.getBoundingClientRect();
187
+ return a.style.cssText = `display:inline-block;width:${c.width}px;height:${c.height}px;visibility:hidden;`, a;
188
188
  } else if (n.excludeMode === "remove")
189
189
  return null;
190
190
  }
191
- } catch (i) {
192
- console.warn(`Invalid selector in exclude option: ${a}`, i);
191
+ } catch (a) {
192
+ console.warn(`Invalid selector in exclude option: ${i}`, a);
193
193
  }
194
194
  if (typeof n.filter == "function")
195
195
  try {
196
196
  if (!n.filter(t)) {
197
197
  if (n.filterMode === "hide") {
198
- const a = document.createElement("div"), i = t.getBoundingClientRect();
199
- return a.style.cssText = `display:inline-block;width:${i.width}px;height:${i.height}px;visibility:hidden;`, a;
198
+ const i = document.createElement("div"), a = t.getBoundingClientRect();
199
+ return i.style.cssText = `display:inline-block;width:${a.width}px;height:${a.height}px;visibility:hidden;`, i;
200
200
  } else if (n.filterMode === "remove")
201
201
  return null;
202
202
  }
203
- } catch (a) {
204
- console.warn("Error in filter function:", a);
203
+ } catch (i) {
204
+ console.warn("Error in filter function:", i);
205
205
  }
206
206
  if (t.tagName === "IFRAME") {
207
- let a = !1;
207
+ let i = !1;
208
208
  try {
209
- a = !!(t.contentDocument || t.contentWindow?.document);
209
+ i = !!(t.contentDocument || t.contentWindow?.document);
210
210
  } catch {
211
- a = !1;
211
+ i = !1;
212
212
  }
213
- if (a)
213
+ if (i)
214
214
  try {
215
- return await O(t, r, n);
216
- } catch (i) {
217
- console.warn("[SnapDOM] iframe rasterization failed, fallback:", i);
215
+ return await z(t, r, n);
216
+ } catch (a) {
217
+ console.warn("[SnapDOM] iframe rasterization failed, fallback:", a);
218
218
  }
219
219
  if (n.placeholders) {
220
- const i = document.createElement("div");
221
- return i.style.cssText = `width:${t.offsetWidth}px;height:${t.offsetHeight}px;background-image:repeating-linear-gradient(45deg,#ddd,#ddd 5px,#f9f9f9 5px,#f9f9f9 10px);display:flex;align-items:center;justify-content:center;font-size:12px;color:#555;border:1px solid #aaa;`, w(t, i, r, n), i;
220
+ const a = document.createElement("div");
221
+ return a.style.cssText = `width:${t.offsetWidth}px;height:${t.offsetHeight}px;background-image:repeating-linear-gradient(45deg,#ddd,#ddd 5px,#f9f9f9 5px,#f9f9f9 10px);display:flex;align-items:center;justify-content:center;font-size:12px;color:#555;border:1px solid #aaa;`, b(t, a, r, n), a;
222
222
  } else {
223
- const i = t.getBoundingClientRect(), l = document.createElement("div");
224
- return l.style.cssText = `display:inline-block;width:${i.width}px;height:${i.height}px;visibility:hidden;`, w(t, l, r, n), l;
223
+ const a = t.getBoundingClientRect(), c = document.createElement("div");
224
+ return c.style.cssText = `display:inline-block;width:${a.width}px;height:${a.height}px;visibility:hidden;`, b(t, c, r, n), c;
225
225
  }
226
226
  }
227
227
  if (t.getAttribute("data-capture") === "placeholder") {
228
- const a = t.cloneNode(!1);
229
- r.nodeMap.set(a, t), w(t, a, r, n);
230
- const i = document.createElement("div");
231
- return i.textContent = t.getAttribute("data-placeholder-text") || "", i.style.cssText = "color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;", a.appendChild(i), a;
228
+ const i = t.cloneNode(!1);
229
+ r.nodeMap.set(i, t), b(t, i, r, n);
230
+ const a = document.createElement("div");
231
+ return a.textContent = t.getAttribute("data-placeholder-text") || "", a.style.cssText = "color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;", i.appendChild(a), i;
232
232
  }
233
233
  if (t.tagName === "CANVAS") {
234
- const a = t.toDataURL(), i = document.createElement("img");
235
- return i.src = a, i.width = t.width, i.height = t.height, r.nodeMap.set(i, t), w(t, i, r, n), i;
234
+ let i = "";
235
+ try {
236
+ const c = t.getContext("2d", { willReadFrequently: !0 });
237
+ try {
238
+ c && c.getImageData(0, 0, 1, 1);
239
+ } catch {
240
+ }
241
+ if (await new Promise((u) => requestAnimationFrame(u)), i = t.toDataURL("image/png"), !i || i === "data:,") {
242
+ try {
243
+ c && c.getImageData(0, 0, 1, 1);
244
+ } catch {
245
+ }
246
+ if (await new Promise((u) => requestAnimationFrame(u)), i = t.toDataURL("image/png"), !i || i === "data:,") {
247
+ const u = document.createElement("canvas");
248
+ u.width = t.width, u.height = t.height;
249
+ const m = u.getContext("2d");
250
+ m && (m.drawImage(t, 0, 0), i = u.toDataURL("image/png"));
251
+ }
252
+ }
253
+ } catch {
254
+ }
255
+ const a = document.createElement("img");
256
+ try {
257
+ a.decoding = "sync", a.loading = "eager";
258
+ } catch {
259
+ }
260
+ i && (a.src = i), a.width = t.width, a.height = t.height;
261
+ try {
262
+ const c = getComputedStyle(t);
263
+ c.width && (a.style.width = c.width), c.height && (a.style.height = c.height);
264
+ } catch {
265
+ }
266
+ return r.nodeMap.set(a, t), b(t, a, r, n), a;
236
267
  }
237
- let c;
268
+ let l;
238
269
  try {
239
- if (c = t.cloneNode(!1), N(t, c), r.nodeMap.set(c, t), t.tagName === "IMG") {
240
- I(t, c);
270
+ if (l = t.cloneNode(!1), N(t, l), r.nodeMap.set(l, t), t.tagName === "IMG") {
271
+ W(t, l);
241
272
  try {
242
- const a = t.getBoundingClientRect();
243
- let i = Math.round(a.width || 0), l = Math.round(a.height || 0);
244
- if (!i || !l) {
245
- const y = window.getComputedStyle(t), b = parseFloat(y.width) || 0, f = parseFloat(y.height) || 0, m = parseInt(t.getAttribute("width") || "", 10) || 0, p = parseInt(t.getAttribute("height") || "", 10) || 0, S = t.width || t.naturalWidth || 0, d = t.height || t.naturalHeight || 0;
246
- i = Math.round(i || b || m || S || 0), l = Math.round(l || f || p || d || 0);
273
+ const i = t.getBoundingClientRect();
274
+ let a = Math.round(i.width || 0), c = Math.round(i.height || 0);
275
+ if (!a || !c) {
276
+ const u = window.getComputedStyle(t), m = parseFloat(u.width) || 0, g = parseFloat(u.height) || 0, p = parseInt(t.getAttribute("width") || "", 10) || 0, y = parseInt(t.getAttribute("height") || "", 10) || 0, S = t.width || t.naturalWidth || 0, d = t.height || t.naturalHeight || 0;
277
+ a = Math.round(a || m || p || S || 0), c = Math.round(c || g || y || d || 0);
247
278
  }
248
- i && (c.dataset.snapdomWidth = String(i)), l && (c.dataset.snapdomHeight = String(l));
279
+ a && (l.dataset.snapdomWidth = String(a)), c && (l.dataset.snapdomHeight = String(c));
249
280
  } catch {
250
281
  }
251
282
  }
252
- } catch (a) {
253
- throw console.error("[Snapdom] Failed to clone node:", t, a), a;
283
+ } catch (i) {
284
+ throw console.error("[Snapdom] Failed to clone node:", t, i), i;
254
285
  }
255
286
  if (t instanceof HTMLTextAreaElement) {
256
- const a = t.getBoundingClientRect();
257
- c.style.width = `${a.width}px`, c.style.height = `${a.height}px`;
287
+ const i = t.getBoundingClientRect();
288
+ l.style.width = `${i.width}px`, l.style.height = `${i.height}px`;
258
289
  }
259
- if (t instanceof HTMLInputElement && (c.value = t.value, c.setAttribute("value", t.value), t.checked !== void 0 && (c.checked = t.checked, t.checked && c.setAttribute("checked", ""), t.indeterminate && (c.indeterminate = t.indeterminate))), t instanceof HTMLSelectElement && (o = t.value), t instanceof HTMLTextAreaElement && (u = t.value), w(t, c, r, n), t.shadowRoot) {
260
- let p = function(d, g) {
290
+ if (t instanceof HTMLInputElement && (l.value = t.value, l.setAttribute("value", t.value), t.checked !== void 0 && (l.checked = t.checked, t.checked && l.setAttribute("checked", ""), t.indeterminate && (l.indeterminate = t.indeterminate))), t instanceof HTMLSelectElement && (o = t.value), t instanceof HTMLTextAreaElement && (s = t.value), b(t, l, r, n), t.shadowRoot) {
291
+ let y = function(d, w) {
261
292
  if (d.nodeType === Node.ELEMENT_NODE && d.tagName === "STYLE")
262
- return g(null);
293
+ return w(null);
263
294
  A(d, r, n).then((x) => {
264
- g(x || null);
295
+ w(x || null);
265
296
  }).catch(() => {
266
- g(null);
297
+ w(null);
267
298
  });
268
299
  };
269
300
  try {
270
301
  const d = t.shadowRoot.querySelectorAll("slot");
271
- for (const g of d) {
302
+ for (const w of d) {
272
303
  let x = [];
273
304
  try {
274
- x = g.assignedNodes?.({ flatten: !0 }) || g.assignedNodes?.() || [];
305
+ x = w.assignedNodes?.({ flatten: !0 }) || w.assignedNodes?.() || [];
275
306
  } catch {
276
- x = g.assignedNodes?.() || [];
307
+ x = w.assignedNodes?.() || [];
277
308
  }
278
309
  for (const $ of x) e.add($);
279
310
  }
280
311
  } catch {
281
312
  }
282
- const a = C(r), i = `[data-sd="${a}"]`;
313
+ const i = k(r), a = `[data-sd="${i}"]`;
283
314
  try {
284
- c.setAttribute("data-sd", a);
315
+ l.setAttribute("data-sd", i);
285
316
  } catch {
286
317
  }
287
- const l = L(t.shadowRoot), y = k(l, i), b = H(l), f = D(t, b, i);
288
- W(c, f + y, a);
289
- const m = document.createDocumentFragment(), S = await E(
318
+ const c = L(t.shadowRoot), u = T(c, a), m = D(c), g = H(t, m, a);
319
+ I(l, g + u, i);
320
+ const p = document.createDocumentFragment(), S = await E(
290
321
  Array.from(t.shadowRoot.childNodes),
291
- p,
322
+ y,
292
323
  n.fast
293
324
  );
294
- m.append(...S.filter((d) => !!d)), c.appendChild(m);
325
+ p.append(...S.filter((d) => !!d)), l.appendChild(p);
295
326
  }
296
327
  if (t.tagName === "SLOT") {
297
- let y = function(f, m) {
298
- A(f, r, n).then((p) => {
299
- p && F(p), m(p || null);
328
+ let u = function(g, p) {
329
+ A(g, r, n).then((y) => {
330
+ y && P(y), p(y || null);
300
331
  }).catch(() => {
301
- m(null);
332
+ p(null);
302
333
  });
303
334
  };
304
- const a = t.assignedNodes?.({ flatten: !0 }) || [], i = a.length > 0 ? a : Array.from(t.childNodes), l = document.createDocumentFragment(), b = await E(
305
- Array.from(i),
306
- y,
335
+ const i = t.assignedNodes?.({ flatten: !0 }) || [], a = i.length > 0 ? i : Array.from(t.childNodes), c = document.createDocumentFragment(), m = await E(
336
+ Array.from(a),
337
+ u,
307
338
  n.fast
308
339
  );
309
- return l.append(...b.filter((f) => !!f)), l;
340
+ return c.append(...m.filter((g) => !!g)), c;
310
341
  }
311
- function s(a, i) {
312
- if (e.has(a)) return i(null);
313
- A(a, r, n).then((l) => {
314
- i(l || null);
342
+ function h(i, a) {
343
+ if (e.has(i)) return a(null);
344
+ A(i, r, n).then((c) => {
345
+ a(c || null);
315
346
  }).catch(() => {
316
- i(null);
347
+ a(null);
317
348
  });
318
349
  }
319
- const h = await E(
350
+ const f = await E(
320
351
  Array.from(t.childNodes),
321
- s,
352
+ h,
322
353
  n.fast
323
354
  );
324
- if (c.append(...h.filter((a) => !!a)), o !== null && c instanceof HTMLSelectElement) {
325
- c.value = o;
326
- for (const a of c.options)
327
- a.value === o ? a.setAttribute("selected", "") : a.removeAttribute("selected");
355
+ if (l.append(...f.filter((i) => !!i)), o !== null && l instanceof HTMLSelectElement) {
356
+ l.value = o;
357
+ for (const i of l.options)
358
+ i.value === o ? i.setAttribute("selected", "") : i.removeAttribute("selected");
328
359
  }
329
- return u !== null && c instanceof HTMLTextAreaElement && (c.textContent = u), c;
360
+ return s !== null && l instanceof HTMLTextAreaElement && (l.textContent = s), l;
330
361
  }
331
362
  export {
332
363
  A as deepClone
@@ -1,5 +1,5 @@
1
- /* 2025-10-28 09:57:10 */
2
- function r(e) {
1
+ /* 2025-11-04 10:32:44 */
2
+ function a(e) {
3
3
  if (typeof e == "string") {
4
4
  const l = e.toLowerCase().trim();
5
5
  if (l === "disabled" || l === "full" || l === "auto" || l === "soft")
@@ -11,7 +11,9 @@ function r(e) {
11
11
  return "soft";
12
12
  }
13
13
  function c(e = {}) {
14
- const l = e.format ?? "png", a = r(e.cache);
14
+ let l = e.format ?? "png";
15
+ l === "jpg" && (l = "jpeg");
16
+ const r = a(e.cache);
15
17
  return {
16
18
  // Debug & perf
17
19
  debug: e.debug ?? !1,
@@ -32,7 +34,7 @@ function c(e = {}) {
32
34
  excludeFonts: e.excludeFonts ?? void 0,
33
35
  fallbackURL: e.fallbackURL ?? void 0,
34
36
  /** @type {CachePolicy} */
35
- cache: a,
37
+ cache: r,
36
38
  // Network
37
39
  useProxy: typeof e.useProxy == "string" ? e.useProxy : "",
38
40
  // Output
@@ -42,16 +44,16 @@ function c(e = {}) {
42
44
  type: e.type ?? "svg",
43
45
  quality: e.quality ?? 0.92,
44
46
  dpr: e.dpr ?? (window.devicePixelRatio || 1),
45
- backgroundColor: e.backgroundColor ?? (["jpg", "jpeg", "webp"].includes(l) ? "#ffffff" : null),
47
+ backgroundColor: e.backgroundColor ?? (["jpeg", "webp"].includes(l) ? "#ffffff" : null),
46
48
  filename: e.filename ?? "snapDOM",
47
49
  // NEW flags (user-friendly)
48
- straighten: e.straighten ?? !1,
49
- noShadows: e.noShadows ?? !1
50
+ outerTransforms: e.outerTransforms ?? !0,
51
+ outerShadows: e.outerShadows ?? !1
50
52
  // Plugins (reservado)
51
53
  // plugins: normalizePlugins(...),
52
54
  };
53
55
  }
54
56
  export {
55
57
  c as createContext,
56
- r as normalizeCachePolicy
58
+ a as normalizeCachePolicy
57
59
  };
@@ -0,0 +1,69 @@
1
+ /* 2025-11-04 10:32:44 */
2
+ const e = [];
3
+ function a(n) {
4
+ if (!n) return null;
5
+ if (Array.isArray(n)) {
6
+ const [t, o] = n;
7
+ return typeof t == "function" ? t(o) : t;
8
+ }
9
+ if (typeof n == "object" && "plugin" in n) {
10
+ const { plugin: t, options: o } = n;
11
+ return typeof t == "function" ? t(o) : t;
12
+ }
13
+ return typeof n == "function" ? n() : n;
14
+ }
15
+ function y(...n) {
16
+ const t = n.flat();
17
+ for (const o of t) {
18
+ const i = a(o);
19
+ i && (e.some((f) => f && f.name && i.name && f.name === i.name) || e.push(i));
20
+ }
21
+ }
22
+ function c(n) {
23
+ return (n && Array.isArray(n.plugins) ? n.plugins : e) || e;
24
+ }
25
+ async function g(n, t, o) {
26
+ let i = o;
27
+ const f = c(t);
28
+ for (const u of f) {
29
+ const r = u && typeof u[n] == "function" ? u[n] : null;
30
+ if (!r) continue;
31
+ const s = await r(t, i);
32
+ typeof s < "u" && (i = s);
33
+ }
34
+ return i;
35
+ }
36
+ async function p(n, t, o) {
37
+ const i = [], f = c(t);
38
+ for (const u of f) {
39
+ const r = u && typeof u[n] == "function" ? u[n] : null;
40
+ if (!r) continue;
41
+ const s = await r(t, o);
42
+ typeof s < "u" && i.push(s);
43
+ }
44
+ return i;
45
+ }
46
+ function l(n) {
47
+ const t = [];
48
+ if (Array.isArray(n))
49
+ for (const o of n) {
50
+ const i = a(o);
51
+ if (!i || !i.name) continue;
52
+ const f = t.findIndex((u) => u && u.name === i.name);
53
+ f >= 0 && t.splice(f, 1), t.push(i);
54
+ }
55
+ for (const o of e)
56
+ o && o.name && !t.some((i) => i.name === o.name) && t.push(o);
57
+ return Object.freeze(t);
58
+ }
59
+ function m(n, t, o = !1) {
60
+ return !n || n.plugins && !o || (n.plugins = l(t)), n;
61
+ }
62
+ export {
63
+ m as attachSessionPlugins,
64
+ l as mergePlugins,
65
+ a as normalizePlugin,
66
+ y as registerPlugins,
67
+ p as runAll,
68
+ g as runHook
69
+ };
@@ -1,11 +1,11 @@
1
- /* 2025-10-28 09:57:10 */
1
+ /* 2025-11-04 10:32:44 */
2
+ import { cache as h } from "./cache.js";
2
3
  import { freezeSticky as b } from "../modules/changeCSS.js";
3
4
  import { inlinePseudoElements as w } from "../modules/pseudo.js";
4
5
  import { snapFetch as A } from "../modules/snapFetch.js";
5
6
  import { inlineExternalDefsAndSymbols as C } from "../modules/svgDefs.js";
6
7
  import { generateCSSClasses as E } from "../utils/css.js";
7
8
  import { stripTranslate as M } from "../utils/helpers.js";
8
- import { cache as h } from "./cache.js";
9
9
  import { deepClone as N } from "./clone.js";
10
10
  async function H(t, r = {}) {
11
11
  const o = {
@@ -1,4 +1,4 @@
1
- /* 2025-10-28 09:57:10 */
1
+ /* 2025-11-04 10:32:44 */
2
2
  import { createBackground as l } from "../utils/image.js";
3
3
  import { toBlob as d } from "./toBlob.js";
4
4
  import { toCanvas as f } from "./toCanvas.js";
@@ -1,4 +1,4 @@
1
- /* 2025-10-28 09:57:10 */
1
+ /* 2025-11-04 10:32:44 */
2
2
  import { createBackground as m } from "../utils/image.js";
3
3
  import { toCanvas as s } from "./toCanvas.js";
4
4
  async function i(a, o) {