@unicom-cloud/utils 0.1.32 → 0.1.34

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 (358) hide show
  1. package/case-name/index.js +1 -1
  2. package/caseName.js +1 -1
  3. package/class-name/index.js +1 -1
  4. package/className.js +1 -1
  5. package/clipboard-copy/index.js +7 -7
  6. package/clipboardCopy.js +1 -1
  7. package/constant/address.js +1 -1
  8. package/constant/chineseCharacters.js +1 -1
  9. package/constant/constellations.js +1 -1
  10. package/constant/domain.js +1 -1
  11. package/constant/emoji.js +1 -1
  12. package/constant/identity.js +1 -1
  13. package/constant/index.js +1 -1
  14. package/constant/isMobile.js +1 -1
  15. package/constant/keyboardCode.js +1 -1
  16. package/constant/licensePlate.js +1 -1
  17. package/constant/name.js +1 -1
  18. package/constant/platform.js +1 -1
  19. package/constant/protocol.js +1 -1
  20. package/constant/string.js +1 -1
  21. package/constant/ui.js +1 -1
  22. package/constant.js +1 -1
  23. package/content-disposition/index.js +1 -1
  24. package/contentDisposition.js +1 -1
  25. package/cookie/index.js +1 -1
  26. package/cookie/src/api.js +1 -1
  27. package/cookie/src/assign.js +1 -1
  28. package/cookie/src/converter.js +1 -1
  29. package/cookie.js +1 -1
  30. package/date/convertTime.js +1 -1
  31. package/date/convertToDuration.js +1 -1
  32. package/date/index.js +5 -5
  33. package/date.js +5 -5
  34. package/decimal/decimal.js +1 -1
  35. package/decimal/index.js +1 -1
  36. package/decimal.js +1 -1
  37. package/dom-helpers/activeElement.js +1 -1
  38. package/dom-helpers/addClass.js +1 -1
  39. package/dom-helpers/addEventListener.js +1 -1
  40. package/dom-helpers/animate.js +1 -1
  41. package/dom-helpers/animationFrame.js +1 -1
  42. package/dom-helpers/attribute.js +1 -1
  43. package/dom-helpers/camelize.js +1 -1
  44. package/dom-helpers/camelizeStyle.js +1 -1
  45. package/dom-helpers/canUseDOM.js +1 -1
  46. package/dom-helpers/childElements.js +1 -1
  47. package/dom-helpers/childNodes.js +1 -1
  48. package/dom-helpers/clear.js +1 -1
  49. package/dom-helpers/closest.js +1 -1
  50. package/dom-helpers/collectElements.js +1 -1
  51. package/dom-helpers/collectSiblings.js +1 -1
  52. package/dom-helpers/contains.js +1 -1
  53. package/dom-helpers/css.js +1 -1
  54. package/dom-helpers/filterEventHandler.js +1 -1
  55. package/dom-helpers/getComputedStyle.js +1 -1
  56. package/dom-helpers/getElementCoordinates.js +46 -0
  57. package/dom-helpers/getScrollAccessor.js +1 -1
  58. package/dom-helpers/hasClass.js +1 -1
  59. package/dom-helpers/height.js +1 -1
  60. package/dom-helpers/hyphenate.js +1 -1
  61. package/dom-helpers/hyphenateStyle.js +1 -1
  62. package/dom-helpers/index.js +87 -84
  63. package/dom-helpers/insertAfter.js +1 -1
  64. package/dom-helpers/isDocument.js +1 -1
  65. package/dom-helpers/isInput.js +1 -1
  66. package/dom-helpers/isTransform.js +1 -1
  67. package/dom-helpers/isVisible.js +1 -1
  68. package/dom-helpers/isWindow.js +1 -1
  69. package/dom-helpers/listen.js +1 -1
  70. package/dom-helpers/matches.js +1 -1
  71. package/dom-helpers/nextUntil.js +1 -1
  72. package/dom-helpers/offset.js +1 -1
  73. package/dom-helpers/offsetParent.js +1 -1
  74. package/dom-helpers/ownerDocument.js +1 -1
  75. package/dom-helpers/ownerWindow.js +1 -1
  76. package/dom-helpers/parents.js +1 -1
  77. package/dom-helpers/position.js +1 -1
  78. package/dom-helpers/prepend.js +1 -1
  79. package/dom-helpers/querySelectorAll.js +1 -1
  80. package/dom-helpers/reflow.js +1 -1
  81. package/dom-helpers/remove.js +1 -1
  82. package/dom-helpers/removeClass.js +1 -1
  83. package/dom-helpers/removeEventListener.js +1 -1
  84. package/dom-helpers/scrollLeft.js +1 -1
  85. package/dom-helpers/scrollParent.js +1 -1
  86. package/dom-helpers/scrollTo.js +1 -1
  87. package/dom-helpers/scrollTop.js +1 -1
  88. package/dom-helpers/scrollbarSize.js +1 -1
  89. package/dom-helpers/siblings.js +1 -1
  90. package/dom-helpers/text.js +1 -1
  91. package/dom-helpers/toggleClass.js +1 -1
  92. package/dom-helpers/transitionEnd.js +2 -2
  93. package/dom-helpers/triggerEvent.js +1 -1
  94. package/dom-helpers/types.js +1 -1
  95. package/dom-helpers/width.js +1 -1
  96. package/domHelpers.js +65 -63
  97. package/emitter/index.js +1 -1
  98. package/emitter/src/index.js +1 -1
  99. package/emitter.js +1 -1
  100. package/escape/index.js +11 -0
  101. package/escape.js +6 -0
  102. package/file/fileToURL.js +14 -21
  103. package/file/index.js +1 -1
  104. package/file/saveAs.js +28 -31
  105. package/file.js +1 -1
  106. package/function/index.js +50 -0
  107. package/function.js +48 -0
  108. package/idb/index.js +1 -1
  109. package/idb.js +1 -1
  110. package/index.js +1 -1
  111. package/invariant/index.js +1 -1
  112. package/invariant.js +1 -1
  113. package/is/index.js +196 -141
  114. package/is/lib/isAscii.js +9 -0
  115. package/is/lib/isBase64.js +13 -0
  116. package/is/lib/isChinese.js +19 -0
  117. package/is/lib/isDataURI.js +25 -0
  118. package/is/lib/isEmail.js +72 -0
  119. package/is/lib/isFQDN.js +27 -0
  120. package/is/lib/isFullWidth.js +10 -0
  121. package/is/lib/isHSL.js +11 -0
  122. package/is/lib/isHalfWidth.js +10 -0
  123. package/is/lib/isHash.js +23 -0
  124. package/is/lib/isHexColor.js +12 -0
  125. package/is/lib/isIMEI.js +20 -0
  126. package/is/lib/isIP.js +21 -0
  127. package/is/lib/isIPRange.js +25 -0
  128. package/is/lib/isIdentityCard.js +190 -0
  129. package/is/lib/isJWT.js +14 -0
  130. package/is/lib/isMACAddress.js +9 -0
  131. package/is/lib/isMD5.js +9 -0
  132. package/is/lib/isMimeType.js +9 -0
  133. package/is/lib/isMobilePhone.js +192 -0
  134. package/is/lib/isPort.js +7 -0
  135. package/is/lib/isRgbColor.js +18 -0
  136. package/is/lib/isSemVer.js +20 -0
  137. package/is/lib/isSlug.js +9 -0
  138. package/is/lib/isStrongPassword.js +48 -0
  139. package/is/lib/isURL.js +78 -0
  140. package/is/lib/isUUID.js +24 -0
  141. package/is/lib/isVariableWidth.js +10 -0
  142. package/is/lib/util/assertString.js +12 -0
  143. package/is.js +122 -66
  144. package/lunar/index.js +1 -1
  145. package/lunar/lib/Holiday.js +1 -1
  146. package/lunar/lib/HolidayUtil.js +1 -1
  147. package/lunar/lib/I18n.js +1 -1
  148. package/lunar/lib/JieQi.js +1 -1
  149. package/lunar/lib/Lunar.js +1 -1
  150. package/lunar/lib/LunarMonth.js +1 -1
  151. package/lunar/lib/LunarTime.js +1 -1
  152. package/lunar/lib/LunarUtil.js +1 -1
  153. package/lunar/lib/LunarYear.js +1 -1
  154. package/lunar/lib/ShouXingUtil.js +1 -1
  155. package/lunar/lib/Solar.js +1 -1
  156. package/lunar/lib/SolarHalfYear.js +1 -1
  157. package/lunar/lib/SolarMonth.js +1 -1
  158. package/lunar/lib/SolarSeason.js +1 -1
  159. package/lunar/lib/SolarUtil.js +1 -1
  160. package/lunar/lib/SolarWeek.js +1 -1
  161. package/lunar/lib/SolarYear.js +1 -1
  162. package/lunar/lib/index.js +1 -1
  163. package/lunar.js +1 -1
  164. package/math/index.js +1 -1
  165. package/math.js +1 -1
  166. package/md5/index.js +1 -1
  167. package/md5.js +1 -1
  168. package/mock/MockWebSocket.js +1 -1
  169. package/mock/MockXMLHttpRequest.js +1 -1
  170. package/mock/index.js +1 -1
  171. package/mock.js +1 -1
  172. package/normalize-wheel/ExecutionEnvironment.js +1 -1
  173. package/normalize-wheel/UserAgent_DEPRECATED.js +1 -1
  174. package/normalize-wheel/index.js +1 -1
  175. package/normalize-wheel/isEventSupported.js +1 -1
  176. package/normalizeWheel.js +1 -1
  177. package/number-to-chinese/index.js +1 -1
  178. package/numberToChinese.js +1 -1
  179. package/nzh/cn.js +1 -1
  180. package/nzh/hk.js +1 -1
  181. package/nzh/index.js +1 -1
  182. package/nzh/nzh.js +1 -1
  183. package/nzh/src/autoGet.js +1 -1
  184. package/nzh/src/index.js +1 -1
  185. package/nzh/src/langs/cn_b.js +1 -1
  186. package/nzh/src/langs/cn_s.js +1 -1
  187. package/nzh/src/langs/hk_b.js +1 -1
  188. package/nzh/src/langs/hk_s.js +1 -1
  189. package/nzh/src/utils.js +1 -1
  190. package/nzh.js +1 -1
  191. package/object-keys-sort/index.js +1 -1
  192. package/object-prototype-to-string-call/index.js +2 -2
  193. package/objectKeysSort.js +1 -1
  194. package/objectPrototypeToStringCall.js +1 -1
  195. package/package.json +1 -1
  196. package/pinyin/index.js +1 -1
  197. package/pinyin/simplified.js +1 -1
  198. package/pinyin/src/core.js +1 -1
  199. package/pinyin/src/simplified.js +6 -6
  200. package/pinyin/src/simplified_dict.js +5 -4
  201. package/pinyin/src/traditional.js +4 -4
  202. package/pinyin/src/traditional_dict.js +4 -3
  203. package/pinyin/traditional.js +1 -1
  204. package/pinyin.js +1 -1
  205. package/query-string/base.js +1 -1
  206. package/query-string/index.js +1 -1
  207. package/query-string/splitOnFirst.js +1 -1
  208. package/queryString.js +1 -1
  209. package/random/address.js +1 -1
  210. package/random/constellation.js +1 -1
  211. package/random/image.js +1 -1
  212. package/random/index.js +1 -1
  213. package/random/licensePlate.js +1 -1
  214. package/random/name.js +1 -1
  215. package/random/number.js +1 -1
  216. package/random/text.js +1 -1
  217. package/random/time.js +1 -1
  218. package/random/web.js +1 -1
  219. package/random.js +1 -1
  220. package/screenfull/index.js +1 -1
  221. package/screenfull.js +1 -1
  222. package/sleep/index.js +1 -1
  223. package/sleep.js +1 -1
  224. package/snapdom/index.js +1 -1
  225. package/snapdom/src/api/preCache.js +1 -1
  226. package/snapdom/src/api/snapdom.js +2 -2
  227. package/snapdom/src/core/cache.js +1 -1
  228. package/snapdom/src/core/capture.js +1 -1
  229. package/snapdom/src/core/clone.js +1 -1
  230. package/snapdom/src/core/context.js +1 -1
  231. package/snapdom/src/core/plugins.js +1 -1
  232. package/snapdom/src/core/prepare.js +1 -1
  233. package/snapdom/src/exporters/download.js +14 -9
  234. package/snapdom/src/exporters/toBlob.js +1 -1
  235. package/snapdom/src/exporters/toCanvas.js +1 -1
  236. package/snapdom/src/exporters/toImg.js +1 -1
  237. package/snapdom/src/modules/CSSVar.js +1 -1
  238. package/snapdom/src/modules/background.js +1 -1
  239. package/snapdom/src/modules/changeCSS.js +1 -1
  240. package/snapdom/src/modules/counter.js +1 -1
  241. package/snapdom/src/modules/fonts.js +1 -1
  242. package/snapdom/src/modules/iconFonts.js +1 -1
  243. package/snapdom/src/modules/images.js +1 -1
  244. package/snapdom/src/modules/lineClamp.js +1 -1
  245. package/snapdom/src/modules/pseudo.js +1 -1
  246. package/snapdom/src/modules/rasterize.js +1 -1
  247. package/snapdom/src/modules/snapFetch.js +1 -1
  248. package/snapdom/src/modules/styles.js +2 -2
  249. package/snapdom/src/modules/svgDefs.js +1 -1
  250. package/snapdom/src/utils/browser.js +1 -1
  251. package/snapdom/src/utils/capture.helpers.js +1 -1
  252. package/snapdom/src/utils/clone.helpers.js +1 -1
  253. package/snapdom/src/utils/css.js +1 -1
  254. package/snapdom/src/utils/helpers.js +1 -1
  255. package/snapdom/src/utils/image.js +1 -1
  256. package/snapdom/src/utils/prepare.helpers.js +1 -1
  257. package/snapdom/src/utils/transforms.helpers.js +1 -1
  258. package/snapdom.js +1 -1
  259. package/string/index.js +1 -1
  260. package/string.js +1 -1
  261. package/tinycolor/index.js +1 -1
  262. package/tinycolor/src/conversion.js +1 -1
  263. package/tinycolor/src/css-color-names.js +1 -1
  264. package/tinycolor/src/format-input.js +1 -1
  265. package/tinycolor/src/from-ratio.js +12 -11
  266. package/tinycolor/src/index.js +1 -1
  267. package/tinycolor/src/random.js +30 -29
  268. package/tinycolor/src/readability.js +1 -1
  269. package/tinycolor/src/to-ms-filter.js +1 -1
  270. package/tinycolor/src/utils.js +1 -1
  271. package/tinycolor.js +1 -1
  272. package/tree/index.js +54 -75
  273. package/tree/search/index.js +1 -1
  274. package/tree.js +9 -11
  275. package/tween/index.js +1 -1
  276. package/tween/src/easing.js +1 -1
  277. package/tween/src/tween.js +15 -14
  278. package/tween.js +1 -1
  279. package/types/clipboard-copy/index.d.ts +1 -1
  280. package/types/date/index.d.ts +3 -3
  281. package/types/dom-helpers/getElementCoordinates.d.ts +40 -0
  282. package/types/dom-helpers/index.d.ts +3 -1
  283. package/types/escape/index.d.ts +2 -0
  284. package/types/file/fileToURL.d.ts +1 -1
  285. package/types/function/index.d.ts +2 -0
  286. package/types/is/index.d.ts +28 -1
  287. package/types/is/lib/isAscii.d.ts +1 -0
  288. package/types/is/lib/isBase64.d.ts +1 -0
  289. package/types/is/lib/isChinese.d.ts +4 -0
  290. package/types/is/lib/isDataURI.d.ts +1 -0
  291. package/types/is/lib/isEmail.d.ts +1 -0
  292. package/types/is/lib/isFQDN.d.ts +1 -0
  293. package/types/is/lib/isFullWidth.d.ts +2 -0
  294. package/types/is/lib/isHSL.d.ts +1 -0
  295. package/types/is/lib/isHalfWidth.d.ts +2 -0
  296. package/types/is/lib/isHash.d.ts +1 -0
  297. package/types/is/lib/isHexColor.d.ts +1 -0
  298. package/types/is/lib/isIMEI.d.ts +1 -0
  299. package/types/is/lib/isIP.d.ts +3 -0
  300. package/types/is/lib/isIPRange.d.ts +1 -0
  301. package/types/is/lib/isIdentityCard.d.ts +1 -0
  302. package/types/is/lib/isJWT.d.ts +1 -0
  303. package/types/is/lib/isMACAddress.d.ts +1 -0
  304. package/types/is/lib/isMD5.d.ts +1 -0
  305. package/types/is/lib/isMimeType.d.ts +1 -0
  306. package/types/is/lib/isMobilePhone.d.ts +2 -0
  307. package/types/is/lib/isOctal.d.ts +1 -0
  308. package/types/is/lib/isPort.d.ts +1 -0
  309. package/types/is/lib/isRgbColor.d.ts +1 -0
  310. package/types/is/lib/isSemVer.d.ts +1 -0
  311. package/types/is/lib/isSlug.d.ts +1 -0
  312. package/types/is/lib/isStrongPassword.d.ts +1 -0
  313. package/types/is/lib/isURL.d.ts +1 -0
  314. package/types/is/lib/isUUID.d.ts +1 -0
  315. package/types/is/lib/isVariableWidth.d.ts +1 -0
  316. package/types/is/lib/util/assertString.d.ts +1 -0
  317. package/types/pinyin/es/main.d.ts +4 -0
  318. package/types/pinyin/es/traditional.d.ts +4 -0
  319. package/types/snapdom/src/api/snapdom.d.ts +1 -0
  320. package/types/tree/index.d.ts +3 -4
  321. package/types/validate/src/index.d.ts +23 -25
  322. package/types/validate/src/interface.d.ts +5 -3
  323. package/types/validate/src/locale/en-US.d.ts +12 -2
  324. package/types/validate/src/locale/index.d.ts +171 -0
  325. package/types/validate/src/locale/zh-CN.d.ts +12 -2
  326. package/types/validate/src/rules/base.d.ts +3 -1
  327. package/types/validate/src/rules/custom.d.ts +1 -1
  328. package/types/validate/src/rules/type.d.ts +10 -0
  329. package/ui-color/compareColorByRange.js +1 -1
  330. package/ui-color/index.js +8 -7
  331. package/uiColor.js +25 -24
  332. package/url-toolkit/index.js +1 -1
  333. package/url-toolkit/src/url-toolkit.js +1 -1
  334. package/urlToolkit.js +1 -1
  335. package/validate/index.js +23 -25
  336. package/validate/src/index.js +116 -73
  337. package/validate/src/locale/en-US.js +12 -2
  338. package/validate/src/locale/index.js +11 -0
  339. package/validate/src/locale/zh-CN.js +12 -2
  340. package/validate/src/rules/array.js +2 -2
  341. package/validate/src/rules/base.js +35 -31
  342. package/validate/src/rules/boolean.js +1 -1
  343. package/validate/src/rules/custom.js +2 -2
  344. package/validate/src/rules/number.js +1 -1
  345. package/validate/src/rules/object.js +1 -1
  346. package/validate/src/rules/string.js +6 -5
  347. package/validate/src/rules/type.js +84 -14
  348. package/validate.js +23 -25
  349. package/version/index.js +1 -1
  350. package/version.js +1 -1
  351. package/xlsx/index.d.ts +4 -8
  352. package/xlsx/index.js +1 -1
  353. package/xlsx/xlsx.js +2 -2
  354. package/xlsx.js +1 -1
  355. package/types/validate/src/message.d.ts +0 -2
  356. package/types/validate/src/utils.d.ts +0 -3
  357. package/validate/src/message.js +0 -5
  358. package/validate/src/utils.js +0 -8
package/screenfull.js CHANGED
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  import "./constant/platform.js";
3
3
  import { default as e } from "./screenfull/index.js";
4
4
  export {
package/sleep/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  function r(e) {
3
3
  return new Promise((t) => setTimeout(t, e));
4
4
  }
package/sleep.js CHANGED
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  import { default as o } from "./sleep/index.js";
3
3
  export {
4
4
  o as default
package/snapdom/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  import { preCache as e } from "./src/api/preCache.js";
3
3
  import { snapdom as m } from "./src/api/snapdom.js";
4
4
  export {
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  import { applyCachePolicy as h, cache as t } from "../core/cache.js";
3
3
  import { inlineBackgroundImages as g } from "../modules/background.js";
4
4
  import { collectUsedFontVariants as p, collectUsedCodepoints as S, ensureFontsReady as A, embedCustomFonts as w } from "../modules/fonts.js";
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  import { captureDOM as x } from "../core/capture.js";
3
3
  import { createContext as P } from "../core/context.js";
4
4
  import { attachSessionPlugins as F, runAll as N, registerPlugins as A, runHook as y } from "../core/plugins.js";
@@ -207,7 +207,7 @@ async function O(a, n) {
207
207
  }
208
208
  const l = performance.now();
209
209
  for (; !(c.complete && c.naturalWidth > 0) && performance.now() - l < 900; )
210
- await new Promise((f) => setTimeout(f, 50));
210
+ await new Promise((f) => setTimeout(f, 200));
211
211
  await new Promise((f) => requestAnimationFrame(f));
212
212
  try {
213
213
  c.remove();
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  const e = {
3
3
  image: /* @__PURE__ */ new Map(),
4
4
  background: /* @__PURE__ */ new Map(),
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  import { applyCachePolicy as Se, cache as j } from "./cache.js";
3
3
  import { inlineBackgroundImages as ye } from "../modules/background.js";
4
4
  import { collectUsedFontVariants as ve, collectUsedCodepoints as Ce, ensureFontsReady as Me, embedCustomFonts as Fe } from "../modules/fonts.js";
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  import { resolveCSSVars as T } from "../modules/CSSVar.js";
3
3
  import { inlineAllStyles as p } from "../modules/styles.js";
4
4
  import { rasterizeIframe as M, freezeImgSrcset as v, nextShadowScopeId as $, extractShadowCSS as L, rewriteShadowCSS as R, collectCustomPropsFromCSS as k, buildSeedCustomPropsRule as I, injectScopedStyle as H, idleCallback as x, markSlottedSubtree as C } from "../utils/clone.helpers.js";
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  function a(e) {
3
3
  if (typeof e == "string") {
4
4
  const l = e.toLowerCase().trim();
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  const e = [];
3
3
  function a(n) {
4
4
  if (!n) return null;
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  import { cache as c } from "./cache.js";
3
3
  import { freezeSticky as h } from "../modules/changeCSS.js";
4
4
  import { inlinePseudoElements as g } from "../modules/pseudo.js";
@@ -1,14 +1,19 @@
1
- /* 2025-11-27 12:11:03 */
2
- import { toBlob as n } from "./toBlob.js";
3
- import { toCanvas as l } from "./toCanvas.js";
4
- async function b(c, a) {
5
- if (a.dpr = 1, a.format === "svg") {
6
- const m = await n(c, { ...a, type: "svg" }), r = URL.createObjectURL(m), t = document.createElement("a");
7
- t.href = r, t.download = a.filename, t.click(), URL.revokeObjectURL(r);
1
+ /* 2025-12-19 15:35:18 */
2
+ import { toBlob as f } from "./toBlob.js";
3
+ import { toCanvas as i } from "./toCanvas.js";
4
+ async function b(c, t) {
5
+ const r = (t?.format || t?.type || "").toLowerCase(), e = r === "jpg" ? "jpeg" : r || "png", m = t?.filename || `snapdom.${e}`, a = {
6
+ ...t || {},
7
+ format: e,
8
+ type: e
9
+ };
10
+ if (a.dpr = 1, e === "svg") {
11
+ const d = await f(c, { ...a, type: "svg" }), s = URL.createObjectURL(d), n = document.createElement("a");
12
+ n.href = s, n.download = m, n.click(), URL.revokeObjectURL(s);
8
13
  return;
9
14
  }
10
- const o = await l(c, a), e = document.createElement("a");
11
- e.href = o.toDataURL(`image/${a.format}`, a.quality), e.download = a.filename, e.click();
15
+ const l = await i(c, a), o = document.createElement("a");
16
+ o.href = l.toDataURL(`image/${e}`, t?.quality), o.download = m, o.click();
12
17
  }
13
18
  export {
14
19
  b as download
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  import { toCanvas as c } from "./toCanvas.js";
3
3
  async function m(o, t) {
4
4
  const n = t.type;
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  import { isSafari as y } from "../utils/browser.js";
3
3
  function S(e) {
4
4
  return typeof e == "string" && /^data:image\/svg\+xml/i.test(e);
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  import { rasterize as p } from "../modules/rasterize.js";
3
3
  import { isSafari as f } from "../utils/browser.js";
4
4
  async function x(i, g) {
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  const f = ["fill", "stroke", "color", "background-color", "stop-color"], p = /* @__PURE__ */ new Map();
3
3
  function y(r, c) {
4
4
  const l = c + "::" + r.toLowerCase();
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  import { getStyle as h, splitBackgroundImage as w } from "../utils/css.js";
3
3
  import { inlineSingleBackgroundEntry as O } from "../utils/image.js";
4
4
  async function _(k, d, s, l = {}) {
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  function F(t, n) {
3
3
  if (!t || !n) return;
4
4
  const o = t.scrollTop || 0;
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  import { cache as F } from "../core/cache.js";
3
3
  function D(e) {
4
4
  return /\bcounter\s*\(|\bcounters\s*\(/.test(e || "");
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  import { cache as w } from "../core/cache.js";
3
3
  import { isIconFont as k } from "./iconFonts.js";
4
4
  import { extractURL as X } from "../utils/helpers.js";
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  const v = [
3
3
  // /uicons/i,
4
4
  /font\s*awesome/i,
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  import { snapFetch as d } from "./snapFetch.js";
3
3
  function u(e) {
4
4
  const n = parseInt(e.dataset?.snapdomWidth || "", 10) || 0, h = parseInt(e.dataset?.snapdomHeight || "", 10) || 0, l = parseInt(e.getAttribute("width") || "", 10) || 0, t = parseInt(e.getAttribute("height") || "", 10) || 0, s = parseFloat(e.style?.width || "") || 0, c = parseFloat(e.style?.height || "") || 0, i = n || s || l || e.width || e.naturalWidth || 100, r = h || c || t || e.height || e.naturalHeight || 100;
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  function h(t) {
3
3
  if (!t) return () => {
4
4
  };
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  import { cache as st } from "../core/cache.js";
3
3
  import { buildCounterContext as it, hasCounters as lt, resolveCountersInContent as ct } from "./counter.js";
4
4
  import { iconToImage as at } from "./fonts.js";
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  import { toCanvas as i } from "../exporters/toCanvas.js";
3
3
  async function d(r, a) {
4
4
  const e = await i(r, a), t = new Image();
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  import { safeEncodeURI as U } from "../utils/helpers.js";
3
3
  function E(t = "[snapDOM]", { ttlMs: e = 5 * 6e4, maxEntries: n = 12 } = {}) {
4
4
  const r = /* @__PURE__ */ new Map();
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  import { cache as s } from "../core/cache.js";
3
3
  import { NO_DEFAULTS_TAGS as S, getStyleKey as E } from "../utils/css.js";
4
4
  const b = /* @__PURE__ */ new WeakMap(), p = /* @__PURE__ */ new Map();
@@ -158,7 +158,7 @@ function N(t, e) {
158
158
  function H(t, e, i) {
159
159
  if (t instanceof HTMLElement && t.style && t.style.height) return;
160
160
  const n = t.tagName && t.tagName.toLowerCase();
161
- if (!n || n !== "div" && n !== "section" && n !== "article" && n !== "main" && n !== "aside" && n !== "header" && n !== "footer" && n !== "nav")
161
+ if (!n || n !== "div" && n !== "section" && n !== "article" && n !== "main" && n !== "aside" && n !== "header" && n !== "footer" && n !== "nav" && n !== "ol" && n !== "ul" && n !== "li")
162
162
  return;
163
163
  const o = e.display || "";
164
164
  if (o.includes("flex") || o.includes("grid") || C(t)) return;
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  function R(o, N) {
3
3
  if (!o || !(o instanceof Element)) return;
4
4
  const w = o.ownerDocument || document, v = w, y = o instanceof SVGSVGElement ? [o] : Array.from(o.querySelectorAll("svg"));
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  function d(e, { fast: i = !1 } = {}) {
3
3
  if (i) return e();
4
4
  "requestIdleCallback" in window ? requestIdleCallback(e, { timeout: 50 }) : setTimeout(e, 1);
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  function M(e, t) {
3
3
  if (!e || !t || !t.style) return;
4
4
  const o = getComputedStyle(e);
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  import { cache as y } from "../core/cache.js";
3
3
  import { snapFetch as w } from "../modules/snapFetch.js";
4
4
  import { inlineAllStyles as b } from "../modules/styles.js";
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  import { cache as s } from "../core/cache.js";
3
3
  const p = /* @__PURE__ */ new Set([
4
4
  "meta",
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  function c(t) {
3
3
  const e = t.match(/url\((['"]?)(.*?)(\1)\)/);
4
4
  if (!e) return null;
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  import { cache as a } from "../core/cache.js";
3
3
  import { snapFetch as c } from "../modules/snapFetch.js";
4
4
  import { extractURL as i, safeEncodeURI as u } from "./helpers.js";
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  function d(o) {
3
3
  const t = getComputedStyle(o), n = t.outlineStyle, e = t.outlineWidth, r = t.borderStyle, i = t.borderWidth, l = n !== "none" && parseFloat(e) > 0, s = r === "none" || parseFloat(i) === 0;
4
4
  l && s && (o.style.border = `${e} solid transparent`);
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  import { limitDecimals as v } from "./capture.helpers.js";
3
3
  function X(e) {
4
4
  const t = e.boxShadow || "";
package/snapdom.js CHANGED
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  import { preCache as e } from "./snapdom/src/api/preCache.js";
3
3
  import { snapdom as m } from "./snapdom/src/api/snapdom.js";
4
4
  export {
package/string/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  import e from "lodash/isNil";
3
3
  import t from "lodash/isString";
4
4
  import { HYPHEN as o } from "../constant/string.js";
package/string.js CHANGED
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  import "lodash/isNil";
3
3
  import "lodash/isString";
4
4
  import "./constant/string.js";
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  import { cmykToRgb as e, convertDecimalToHex as t, convertHexToDecimal as a, hslToRgb as n, hsvToRgb as b, numberInputToObject as m, parseIntFromHex as T, rgbToCmyk as i, rgbToHex as g, rgbToHsl as p, rgbToHsv as l, rgbToRgb as s, rgbaToArgbHex as x, rgbaToHex as c } from "./src/conversion.js";
3
3
  import { names as f } from "./src/css-color-names.js";
4
4
  import { inputToRGB as u, isValidCSSUnit as H, stringInputToObject as y } from "./src/format-input.js";
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  import { bound01 as s, pad2 as h } from "./utils.js";
3
3
  function A(n, r, t) {
4
4
  return {
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  const e = {
3
3
  aliceblue: "#f0f8ff",
4
4
  antiquewhite: "#faebd7",
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  import { rgbToRgb as S, hsvToRgb as v, hslToRgb as E, cmykToRgb as F, convertHexToDecimal as A, parseIntFromHex as s } from "./conversion.js";
3
3
  import { names as R } from "./css-color-names.js";
4
4
  import { convertToPercentage as g, boundAlpha as T } from "./utils.js";
@@ -1,15 +1,16 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
+ import t from "lodash/isUndefined.js";
2
3
  import { TinyColor as e } from "./index.js";
3
- import { convertToPercentage as o } from "./utils.js";
4
- function c(n, m) {
5
- const r = {
6
- r: o(n.r),
7
- g: o(n.g),
8
- b: o(n.b)
4
+ import { convertToPercentage as r } from "./utils.js";
5
+ function d(n, m) {
6
+ const o = {
7
+ r: r(n.r),
8
+ g: r(n.g),
9
+ b: r(n.b)
9
10
  };
10
- return n.a !== void 0 && (r.a = Number(n.a)), new e(r, m);
11
+ return t(n.a) || (o.a = Number(n.a)), new e(o, m);
11
12
  }
12
- function f() {
13
+ function i() {
13
14
  return new e({
14
15
  r: Math.random(),
15
16
  g: Math.random(),
@@ -17,6 +18,6 @@ function f() {
17
18
  });
18
19
  }
19
20
  export {
20
- c as fromRatio,
21
- f as legacyRandom
21
+ d as fromRatio,
22
+ i as legacyRandom
22
23
  };
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  import { numberInputToObject as d, rgbToHsv as g, rgbToHsl as u, rgbToHex as b, rgbaToHex as m, rgbToCmyk as c } from "./conversion.js";
3
3
  import { names as $ } from "./css-color-names.js";
4
4
  import { inputToRGB as f } from "./format-input.js";
@@ -1,26 +1,27 @@
1
- /* 2025-11-27 12:11:03 */
2
- import { TinyColor as l } from "./index.js";
3
- function g(e = {}) {
4
- if (e.count !== void 0 && e.count !== null) {
1
+ /* 2025-12-19 15:35:18 */
2
+ import c from "lodash/isUndefined.js";
3
+ import { TinyColor as i } from "./index.js";
4
+ function w(e = {}) {
5
+ if (!c(e.count) && e.count !== null) {
5
6
  const a = e.count, u = [];
6
7
  for (e.count = void 0; a > u.length; )
7
- e.count = null, e.seed && (e.seed += 1), u.push(g(e));
8
+ e.count = null, e.seed && (e.seed += 1), u.push(w(e));
8
9
  return e.count = a, u;
9
10
  }
10
- const n = w(e.hue, e.seed), o = R(n, e), r = B(n, o, e), t = { h: n, s: o, v: r };
11
- return e.alpha !== void 0 && (t.a = e.alpha), new l(t);
11
+ const n = R(e.hue, e.seed), o = B(n, e), r = k(n, o, e), t = { h: n, s: o, v: r };
12
+ return c(e.alpha) || (t.a = e.alpha), new i(t);
12
13
  }
13
- function w(e, n) {
14
- const o = M(e);
14
+ function R(e, n) {
15
+ const o = b(e);
15
16
  let r = s(o, n);
16
17
  return r < 0 && (r = 360 + r), r;
17
18
  }
18
- function R(e, n) {
19
+ function B(e, n) {
19
20
  if (n.hue === "monochrome")
20
21
  return 0;
21
22
  if (n.luminosity === "random")
22
23
  return s([0, 100], n.seed);
23
- const { saturationRange: o } = i(e);
24
+ const { saturationRange: o } = h(e);
24
25
  let r = o[0], t = o[1];
25
26
  switch (n.luminosity) {
26
27
  case "bright":
@@ -35,8 +36,8 @@ function R(e, n) {
35
36
  }
36
37
  return s([r, t], n.seed);
37
38
  }
38
- function B(e, n, o) {
39
- let r = k(e, n), t = 100;
39
+ function k(e, n, o) {
40
+ let r = M(e, n), t = 100;
40
41
  switch (o.luminosity) {
41
42
  case "dark":
42
43
  t = r + 20;
@@ -50,29 +51,29 @@ function B(e, n, o) {
50
51
  }
51
52
  return s([r, t], o.seed);
52
53
  }
53
- function k(e, n) {
54
- const { lowerBounds: o } = i(e);
54
+ function M(e, n) {
55
+ const { lowerBounds: o } = h(e);
55
56
  for (let r = 0; r < o.length - 1; r++) {
56
57
  const t = o[r][0], a = o[r][1], u = o[r + 1][0], d = o[r + 1][1];
57
58
  if (n >= t && n <= u) {
58
- const c = (d - a) / (u - t), m = a - c * t;
59
- return c * n + m;
59
+ const l = (d - a) / (u - t), g = a - l * t;
60
+ return l * n + g;
60
61
  }
61
62
  }
62
63
  return 0;
63
64
  }
64
- function M(e) {
65
+ function b(e) {
65
66
  const n = parseInt(e, 10);
66
67
  if (!Number.isNaN(n) && n < 360 && n > 0)
67
68
  return [n, n];
68
69
  if (typeof e == "string") {
69
- const o = f.find((t) => t.name === e);
70
+ const o = m.find((t) => t.name === e);
70
71
  if (o) {
71
- const t = h(o);
72
+ const t = f(o);
72
73
  if (t.hueRange)
73
74
  return t.hueRange;
74
75
  }
75
- const r = new l(e);
76
+ const r = new i(e);
76
77
  if (r.isValid) {
77
78
  const t = r.toHsv().h;
78
79
  return [t, t];
@@ -80,24 +81,24 @@ function M(e) {
80
81
  }
81
82
  return [0, 360];
82
83
  }
83
- function i(e) {
84
+ function h(e) {
84
85
  e >= 334 && e <= 360 && (e -= 360);
85
- for (const n of f) {
86
- const o = h(n);
86
+ for (const n of m) {
87
+ const o = f(n);
87
88
  if (o.hueRange && e >= o.hueRange[0] && e <= o.hueRange[1])
88
89
  return o;
89
90
  }
90
91
  throw Error("Color not found");
91
92
  }
92
93
  function s(e, n) {
93
- if (n === void 0)
94
+ if (c(n))
94
95
  return Math.floor(e[0] + Math.random() * (e[1] + 1 - e[0]));
95
96
  const o = e[1] || 1, r = e[0] || 0;
96
97
  n = (n * 9301 + 49297) % 233280;
97
98
  const t = n / 233280;
98
99
  return Math.floor(r + t * (o - r));
99
100
  }
100
- function h(e) {
101
+ function f(e) {
101
102
  const n = e.lowerBounds[0][0], o = e.lowerBounds[e.lowerBounds.length - 1][0], r = e.lowerBounds[e.lowerBounds.length - 1][1], t = e.lowerBounds[0][1];
102
103
  return {
103
104
  name: e.name,
@@ -107,7 +108,7 @@ function h(e) {
107
108
  brightnessRange: [r, t]
108
109
  };
109
110
  }
110
- const f = [
111
+ const m = [
111
112
  {
112
113
  name: "monochrome",
113
114
  hueRange: null,
@@ -217,6 +218,6 @@ const f = [
217
218
  }
218
219
  ];
219
220
  export {
220
- f as bounds,
221
- g as random
221
+ m as bounds,
222
+ w as random
222
223
  };
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  import { TinyColor as a } from "./index.js";
3
3
  function i(n, t) {
4
4
  const l = new a(n), e = new a(t);
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  import { rgbaToArgbHex as i } from "./conversion.js";
3
3
  import { TinyColor as g } from "./index.js";
4
4
  function d(s, o) {
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  function o(t, r) {
3
3
  i(t) && (t = "100%");
4
4
  const e = n(t);
package/tinycolor.js CHANGED
@@ -1,4 +1,4 @@
1
- /* 2025-11-27 12:11:03 */
1
+ /* 2025-12-19 15:35:18 */
2
2
  import { cmykToRgb as e, convertDecimalToHex as t, convertHexToDecimal as a, hslToRgb as n, hsvToRgb as b, numberInputToObject as m, parseIntFromHex as T, rgbToCmyk as i, rgbToHex as g, rgbToHsl as p, rgbToHsv as l, rgbToRgb as s, rgbaToArgbHex as x, rgbaToHex as c } from "./tinycolor/src/conversion.js";
3
3
  import { names as f } from "./tinycolor/src/css-color-names.js";
4
4
  import { inputToRGB as u, isValidCSSUnit as H, stringInputToObject as y } from "./tinycolor/src/format-input.js";