@unicom-cloud/utils 0.1.24 → 0.1.25

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 (290) 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 +1 -1
  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/keyboardCode.js +1 -1
  15. package/constant/licensePlate.js +1 -1
  16. package/constant/name.js +1 -1
  17. package/constant/platform.js +1 -1
  18. package/constant/protocol.js +1 -1
  19. package/constant/ui.js +1 -1
  20. package/constant.js +1 -1
  21. package/content-disposition/index.js +1 -1
  22. package/contentDisposition.js +1 -1
  23. package/cookie/index.js +1 -1
  24. package/cookie/src/index.js +1 -1
  25. package/cookie.js +1 -1
  26. package/date/convertTime.js +1 -1
  27. package/date/convertToDuration.js +1 -1
  28. package/date/index.js +1 -1
  29. package/date.js +1 -1
  30. package/decimal/decimal.js +22 -22
  31. package/decimal/index.js +1 -1
  32. package/decimal.js +1 -1
  33. package/dom-helpers/activeElement.js +1 -1
  34. package/dom-helpers/addClass.js +1 -1
  35. package/dom-helpers/addEventListener.js +1 -1
  36. package/dom-helpers/animate.js +1 -1
  37. package/dom-helpers/animationFrame.js +1 -1
  38. package/dom-helpers/attribute.js +1 -1
  39. package/dom-helpers/camelize.js +1 -1
  40. package/dom-helpers/camelizeStyle.js +1 -1
  41. package/dom-helpers/canUseDOM.js +1 -1
  42. package/dom-helpers/childElements.js +1 -1
  43. package/dom-helpers/childNodes.js +1 -1
  44. package/dom-helpers/clear.js +1 -1
  45. package/dom-helpers/closest.js +1 -1
  46. package/dom-helpers/collectElements.js +1 -1
  47. package/dom-helpers/collectSiblings.js +1 -1
  48. package/dom-helpers/contains.js +1 -1
  49. package/dom-helpers/css.js +1 -1
  50. package/dom-helpers/filterEventHandler.js +1 -1
  51. package/dom-helpers/getComputedStyle.js +1 -1
  52. package/dom-helpers/getScrollAccessor.js +1 -1
  53. package/dom-helpers/hasClass.js +1 -1
  54. package/dom-helpers/height.js +1 -1
  55. package/dom-helpers/hyphenate.js +1 -1
  56. package/dom-helpers/hyphenateStyle.js +1 -1
  57. package/dom-helpers/index.js +1 -1
  58. package/dom-helpers/insertAfter.js +1 -1
  59. package/dom-helpers/isDocument.js +1 -1
  60. package/dom-helpers/isInput.js +1 -1
  61. package/dom-helpers/isTransform.js +1 -1
  62. package/dom-helpers/isVisible.js +1 -1
  63. package/dom-helpers/isWindow.js +1 -1
  64. package/dom-helpers/listen.js +1 -1
  65. package/dom-helpers/matches.js +1 -1
  66. package/dom-helpers/nextUntil.js +1 -1
  67. package/dom-helpers/offset.js +1 -1
  68. package/dom-helpers/offsetParent.js +1 -1
  69. package/dom-helpers/ownerDocument.js +1 -1
  70. package/dom-helpers/ownerWindow.js +1 -1
  71. package/dom-helpers/parents.js +1 -1
  72. package/dom-helpers/position.js +1 -1
  73. package/dom-helpers/prepend.js +1 -1
  74. package/dom-helpers/querySelectorAll.js +1 -1
  75. package/dom-helpers/reflow.js +1 -1
  76. package/dom-helpers/remove.js +1 -1
  77. package/dom-helpers/removeClass.js +1 -1
  78. package/dom-helpers/removeEventListener.js +1 -1
  79. package/dom-helpers/scrollLeft.js +1 -1
  80. package/dom-helpers/scrollParent.js +1 -1
  81. package/dom-helpers/scrollTo.js +1 -1
  82. package/dom-helpers/scrollTop.js +1 -1
  83. package/dom-helpers/scrollbarSize.js +1 -1
  84. package/dom-helpers/siblings.js +1 -1
  85. package/dom-helpers/text.js +1 -1
  86. package/dom-helpers/toggleClass.js +1 -1
  87. package/dom-helpers/transitionEnd.js +1 -1
  88. package/dom-helpers/triggerEvent.js +1 -1
  89. package/dom-helpers/types.js +5 -1
  90. package/dom-helpers/width.js +1 -1
  91. package/domHelpers.js +1 -1
  92. package/emitter/index.js +1 -1
  93. package/emitter/src/index.js +1 -1
  94. package/emitter.js +1 -1
  95. package/file/fileToURL.js +1 -1
  96. package/file/index.js +1 -1
  97. package/file/saveAs.js +1 -1
  98. package/file.js +1 -1
  99. package/idb/index.js +1 -1
  100. package/idb.js +1 -1
  101. package/index.js +1 -1
  102. package/invariant/index.js +1 -1
  103. package/invariant.js +1 -1
  104. package/is/index.js +1 -1
  105. package/is.js +1 -1
  106. package/js-cookie/index.js +1 -1
  107. package/js-cookie/src/api.js +1 -1
  108. package/js-cookie/src/assign.js +1 -1
  109. package/js-cookie/src/converter.js +1 -1
  110. package/jsCookie.js +1 -1
  111. package/lunar/index.js +1 -1
  112. package/lunar/lib/Holiday.js +1 -1
  113. package/lunar/lib/HolidayUtil.js +1 -1
  114. package/lunar/lib/I18n.js +1 -1
  115. package/lunar/lib/JieQi.js +1 -1
  116. package/lunar/lib/Lunar.js +1 -1
  117. package/lunar/lib/LunarMonth.js +1 -1
  118. package/lunar/lib/LunarTime.js +1 -1
  119. package/lunar/lib/LunarUtil.js +1 -1
  120. package/lunar/lib/LunarYear.js +1 -1
  121. package/lunar/lib/ShouXingUtil.js +1 -1
  122. package/lunar/lib/Solar.js +1 -1
  123. package/lunar/lib/SolarHalfYear.js +1 -1
  124. package/lunar/lib/SolarMonth.js +1 -1
  125. package/lunar/lib/SolarSeason.js +1 -1
  126. package/lunar/lib/SolarUtil.js +1 -1
  127. package/lunar/lib/SolarWeek.js +1 -1
  128. package/lunar/lib/SolarYear.js +1 -1
  129. package/lunar/lib/index.js +1 -1
  130. package/lunar.js +1 -1
  131. package/math/index.js +1 -1
  132. package/math.js +1 -1
  133. package/md5/index.js +1 -1
  134. package/md5.js +1 -1
  135. package/mock/MockWebSocket.js +1 -1
  136. package/mock/MockXMLHttpRequest.js +1 -1
  137. package/mock/index.js +1 -1
  138. package/mock.js +1 -1
  139. package/normalize-wheel/ExecutionEnvironment.js +1 -1
  140. package/normalize-wheel/UserAgent_DEPRECATED.js +1 -1
  141. package/normalize-wheel/index.js +1 -1
  142. package/normalize-wheel/isEventSupported.js +10 -14
  143. package/normalizeWheel.js +1 -1
  144. package/number-to-chinese/index.js +1 -1
  145. package/numberToChinese.js +1 -1
  146. package/nzh/cn.js +1 -1
  147. package/nzh/hk.js +1 -1
  148. package/nzh/index.js +1 -1
  149. package/nzh/nzh.js +1 -1
  150. package/nzh/src/autoGet.js +1 -1
  151. package/nzh/src/index.js +1 -1
  152. package/nzh/src/langs/cn_b.js +1 -1
  153. package/nzh/src/langs/cn_s.js +1 -1
  154. package/nzh/src/langs/hk_b.js +1 -1
  155. package/nzh/src/langs/hk_s.js +1 -1
  156. package/nzh/src/utils.js +1 -1
  157. package/nzh.js +1 -1
  158. package/object-keys-sort/index.js +1 -1
  159. package/objectKeysSort.js +1 -1
  160. package/package.json +1 -1
  161. package/pinyin/index.js +1 -1
  162. package/pinyin/simplified.js +1 -1
  163. package/pinyin/src/core.js +1 -1
  164. package/pinyin/src/simplified.js +1 -1
  165. package/pinyin/src/simplified_dict.js +1 -1
  166. package/pinyin/src/traditional.js +1 -1
  167. package/pinyin/src/traditional_dict.js +1 -1
  168. package/pinyin/traditional.js +1 -1
  169. package/pinyin.js +1 -1
  170. package/query-string/base.js +1 -1
  171. package/query-string/index.js +1 -1
  172. package/query-string/splitOnFirst.js +1 -1
  173. package/queryString.js +1 -1
  174. package/random/address.js +1 -1
  175. package/random/constellation.js +1 -1
  176. package/random/image.js +1 -1
  177. package/random/index.js +1 -1
  178. package/random/licensePlate.js +1 -1
  179. package/random/name.js +1 -1
  180. package/random/number.js +1 -1
  181. package/random/text.js +1 -1
  182. package/random/time.js +1 -1
  183. package/random/web.js +1 -1
  184. package/random.js +1 -1
  185. package/screenfull/index.js +1 -1
  186. package/screenfull.js +1 -1
  187. package/sleep/index.js +1 -1
  188. package/sleep.js +1 -1
  189. package/snapdom/index.js +1 -1
  190. package/snapdom/src/api/preCache.js +51 -49
  191. package/snapdom/src/api/snapdom.js +171 -67
  192. package/snapdom/src/core/cache.js +2 -2
  193. package/snapdom/src/core/capture.js +249 -234
  194. package/snapdom/src/core/clone.js +151 -120
  195. package/snapdom/src/core/context.js +10 -8
  196. package/snapdom/src/core/plugins.js +69 -0
  197. package/snapdom/src/core/prepare.js +2 -2
  198. package/snapdom/src/exporters/download.js +1 -1
  199. package/snapdom/src/exporters/toBlob.js +1 -1
  200. package/snapdom/src/exporters/toCanvas.js +40 -40
  201. package/snapdom/src/exporters/toImg.js +1 -1
  202. package/snapdom/src/modules/CSSVar.js +66 -40
  203. package/snapdom/src/modules/background.js +39 -23
  204. package/snapdom/src/modules/changeCSS.js +1 -1
  205. package/snapdom/src/modules/counter.js +100 -86
  206. package/snapdom/src/modules/fonts.js +4 -4
  207. package/snapdom/src/modules/iconFonts.js +98 -14
  208. package/snapdom/src/modules/images.js +1 -1
  209. package/snapdom/src/modules/lineClamp.js +1 -1
  210. package/snapdom/src/modules/pseudo.js +147 -138
  211. package/snapdom/src/modules/rasterize.js +1 -1
  212. package/snapdom/src/modules/snapFetch.js +1 -1
  213. package/snapdom/src/modules/styles.js +1 -1
  214. package/snapdom/src/modules/svgDefs.js +86 -39
  215. package/snapdom/src/utils/browser.js +1 -1
  216. package/snapdom/src/utils/css.js +1 -1
  217. package/snapdom/src/utils/helpers.js +1 -1
  218. package/snapdom/src/utils/image.js +1 -1
  219. package/snapdom/types/snapdom.d.ts +253 -184
  220. package/snapdom.js +1 -1
  221. package/tinycolor/index.js +1 -1
  222. package/tinycolor/src/conversion.js +1 -1
  223. package/tinycolor/src/css-color-names.js +1 -1
  224. package/tinycolor/src/format-input.js +1 -1
  225. package/tinycolor/src/from-ratio.js +1 -1
  226. package/tinycolor/src/index.js +1 -1
  227. package/tinycolor/src/random.js +1 -1
  228. package/tinycolor/src/readability.js +1 -1
  229. package/tinycolor/src/to-ms-filter.js +1 -1
  230. package/tinycolor/src/utils.js +1 -1
  231. package/tinycolor.js +1 -1
  232. package/tree/index.js +1 -1
  233. package/tree/search/index.js +1 -1
  234. package/tree.js +1 -1
  235. package/tween/index.js +8 -0
  236. package/tween/src/easing.js +62 -0
  237. package/tween/src/tween.js +46 -0
  238. package/tween.js +8 -0
  239. package/types/dom-helpers/types.d.ts +2 -0
  240. package/types/normalize-wheel/index.d.ts +1 -1
  241. package/types/snapdom/src/api/snapdom.d.ts +4 -0
  242. package/types/snapdom/src/core/capture.d.ts +4 -18
  243. package/types/snapdom/src/core/context.d.ts +4 -4
  244. package/types/snapdom/src/core/exporters.d.ts +33 -0
  245. package/types/snapdom/src/core/plugins.d.ts +59 -0
  246. package/types/snapdom/src/modules/CSSVar.d.ts +3 -7
  247. package/types/snapdom/src/modules/iconFonts.d.ts +34 -0
  248. package/types/snapdom/src/modules/svgDefs.d.ts +9 -15
  249. package/types/tween/index.d.ts +1 -0
  250. package/types/tween/src/easing.d.ts +22 -0
  251. package/types/tween/src/index.d.ts +3 -0
  252. package/types/tween/src/tween.d.ts +22 -0
  253. package/types/validate/index.d.ts +3 -0
  254. package/types/validate/src/index.d.ts +39 -0
  255. package/types/validate/src/interface.d.ts +53 -0
  256. package/types/validate/src/locale/en-US.d.ts +47 -0
  257. package/types/validate/src/locale/zh-CN.d.ts +47 -0
  258. package/types/validate/src/message.d.ts +2 -0
  259. package/types/validate/src/rules/array.d.ts +12 -0
  260. package/types/validate/src/rules/base.d.ts +25 -0
  261. package/types/validate/src/rules/boolean.d.ts +8 -0
  262. package/types/validate/src/rules/custom.d.ts +7 -0
  263. package/types/validate/src/rules/number.d.ts +12 -0
  264. package/types/validate/src/rules/object.d.ts +9 -0
  265. package/types/validate/src/rules/string.d.ts +12 -0
  266. package/types/validate/src/rules/type.d.ts +9 -0
  267. package/types/validate/src/utils.d.ts +3 -0
  268. package/ui-color/compareColorByRange.js +1 -1
  269. package/ui-color/index.js +1 -1
  270. package/uiColor.js +1 -1
  271. package/url-toolkit/index.js +1 -1
  272. package/url-toolkit/src/url-toolkit.js +1 -1
  273. package/urlToolkit.js +1 -1
  274. package/validate/index.js +28 -0
  275. package/validate/src/index.js +106 -0
  276. package/validate/src/locale/en-US.js +50 -0
  277. package/validate/src/locale/zh-CN.js +50 -0
  278. package/validate/src/message.js +5 -0
  279. package/validate/src/rules/array.js +73 -0
  280. package/validate/src/rules/base.js +69 -0
  281. package/validate/src/rules/boolean.js +29 -0
  282. package/validate/src/rules/custom.js +26 -0
  283. package/validate/src/rules/number.js +54 -0
  284. package/validate/src/rules/object.js +39 -0
  285. package/validate/src/rules/string.js +54 -0
  286. package/validate/src/rules/type.js +35 -0
  287. package/validate/src/utils.js +8 -0
  288. package/validate.js +28 -0
  289. package/version/index.js +1 -1
  290. package/version.js +1 -1
package/tween/index.js ADDED
@@ -0,0 +1,8 @@
1
+ /* 2025-11-03 10:27:31 */
2
+ import * as e from "./src/easing.js";
3
+ import { default as r, default as t } from "./src/tween.js";
4
+ export {
5
+ r as Tween,
6
+ t as default,
7
+ e as easing
8
+ };
@@ -0,0 +1,62 @@
1
+ /* 2025-11-03 10:27:31 */
2
+ function u(n) {
3
+ return function(t) {
4
+ return Math.pow(t, n);
5
+ };
6
+ }
7
+ function r(n) {
8
+ return function(t) {
9
+ return 1 - Math.abs(Math.pow(t - 1, n));
10
+ };
11
+ }
12
+ function c(n) {
13
+ return function(t) {
14
+ return t < 0.5 ? u(n)(t * 2) / 2 : r(n)(t * 2 - 1) / 2 + 0.5;
15
+ };
16
+ }
17
+ function s(n) {
18
+ return n;
19
+ }
20
+ const a = u(2), I = r(2), f = c(2), O = u(3), h = r(3), M = c(3), p = u(4), q = r(4), b = c(4), P = u(5), d = r(5), l = c(5);
21
+ function y(n) {
22
+ return 1 + Math.sin(Math.PI / 2 * n - Math.PI / 2);
23
+ }
24
+ function B(n) {
25
+ return Math.sin(Math.PI / 2 * n);
26
+ }
27
+ function w(n) {
28
+ return (1 + Math.sin(Math.PI * n - Math.PI / 2)) / 2;
29
+ }
30
+ function e(n) {
31
+ return n < 1 / 2.75 ? 7.5625 * n * n : n < 2 / 2.75 ? (n -= 1.5 / 2.75, 7.5625 * n * n + 0.75) : n < 2.5 / 2.75 ? (n -= 2.25 / 2.75, 7.5625 * n * n + 0.9375) : (n -= 2.625 / 2.75, 7.5625 * n * n + 0.984375);
32
+ }
33
+ function o(n) {
34
+ return 1 - e(1 - n);
35
+ }
36
+ function x(n) {
37
+ return n < 0.5 ? o(n * 2) * 0.5 : e(n * 2 - 1) * 0.5 + 0.5;
38
+ }
39
+ export {
40
+ o as bounceIn,
41
+ x as bounceInOut,
42
+ e as bounceOut,
43
+ O as cubicIn,
44
+ M as cubicInOut,
45
+ h as cubicOut,
46
+ u as easeInBy,
47
+ c as easeInOutBy,
48
+ r as easeOutBy,
49
+ s as linear,
50
+ a as quadIn,
51
+ f as quadInOut,
52
+ I as quadOut,
53
+ p as quartIn,
54
+ b as quartInOut,
55
+ q as quartOut,
56
+ P as quintIn,
57
+ l as quintInOut,
58
+ d as quintOut,
59
+ y as sineIn,
60
+ w as sineInOut,
61
+ B as sineOut
62
+ };
@@ -0,0 +1,46 @@
1
+ /* 2025-11-03 10:27:31 */
2
+ import n from "lodash/isFunction.js";
3
+ import d from "lodash/isString.js";
4
+ import * as l from "./easing.js";
5
+ import { linear as u } from "./easing.js";
6
+ class F {
7
+ constructor(i) {
8
+ const {
9
+ from: s,
10
+ to: e,
11
+ duration: a = 500,
12
+ delay: r = 0,
13
+ easing: h,
14
+ onStart: o,
15
+ onUpdate: f = function() {
16
+ },
17
+ onFinish: m
18
+ } = i;
19
+ for (const t in s)
20
+ e[t] === void 0 && (e[t] = s[t]);
21
+ for (const t in e)
22
+ s[t] === void 0 && (s[t] = e[t]);
23
+ this.from = s, this.to = e, this.duration = a, this.delay = r, n(h) ? this.easing = h : d(h) && (this.easing = l[h]), this.easing ||= u, this.onStart = o, this.onUpdate = f, this.onFinish = m, this.startTime = Date.now() + this.delay, this.started = !1, this.finished = !1, this.timer = null, this.keys = {};
24
+ }
25
+ update() {
26
+ if (this.time = Date.now(), !(this.time < this.startTime) && !this.finished) {
27
+ this.elapsed = this.time - this.startTime, this.elapsed = Math.min(this.elapsed, this.duration);
28
+ for (const i in this.to)
29
+ this.keys[i] = this.from[i] + (this.to[i] - this.from[i]) * this.easing(this.elapsed / this.duration);
30
+ this.started || (n(this.onStart) && this.onStart(this.keys), this.started = !0), n(this.onUpdate) && this.onUpdate(this.keys), this.elapsed === this.duration && !this.finished && (this.finished = !0, n(this.onFinish) && this.onFinish(this.keys));
31
+ }
32
+ }
33
+ start() {
34
+ this.startTime = Date.now() + this.delay, this.started = !1, this.finished = !1;
35
+ const i = () => {
36
+ this.update(), this.finished ? this.timer && (cancelAnimationFrame(this.timer), this.timer = null) : this.timer = requestAnimationFrame(i);
37
+ };
38
+ this.timer = requestAnimationFrame(i);
39
+ }
40
+ stop() {
41
+ this.timer && (cancelAnimationFrame(this.timer), this.timer = null), this.finished = !0;
42
+ }
43
+ }
44
+ export {
45
+ F as default
46
+ };
package/tween.js ADDED
@@ -0,0 +1,8 @@
1
+ /* 2025-11-03 10:27:31 */
2
+ import * as e from "./tween/src/easing.js";
3
+ import { default as r, default as t } from "./tween/src/tween.js";
4
+ export {
5
+ r as Tween,
6
+ t as default,
7
+ e as easing
8
+ };
@@ -2,3 +2,5 @@ import * as CSS from 'csstype';
2
2
  export type HyphenProperty = keyof CSS.PropertiesHyphen;
3
3
  export type CamelProperty = keyof CSS.Properties;
4
4
  export type Property = HyphenProperty | CamelProperty;
5
+ declare const _default: {};
6
+ export default _default;
@@ -111,5 +111,5 @@ declare namespace normalizeWheel {
111
111
  * the older DOMMouseScroll for Firefox, as FF does not include wheelDelta with
112
112
  * 'wheel' event, making spin speed determination impossible.
113
113
  */
114
- function getEventType(): "wheel" | "DOMMouseScroll" | "mousewheel";
114
+ function getEventType(): "DOMMouseScroll" | "wheel" | "mousewheel";
115
115
  }
@@ -1,5 +1,7 @@
1
1
  /**
2
2
  * Main function that captures a DOM element and returns export utilities.
3
+ * Local-first plugins: `options.plugins` override globals for this capture.
4
+ *
3
5
  * @param {HTMLElement} element - The DOM element to capture.
4
6
  * @param {object} userOptions - Options for rendering/exporting.
5
7
  * @returns {Promise<object>} Object with exporter methods:
@@ -17,8 +19,10 @@
17
19
  */
18
20
  export function snapdom(element: HTMLElement, userOptions: object): Promise<object>;
19
21
  export namespace snapdom {
22
+ function plugins(...defs: any[]): typeof snapdom;
20
23
  /**
21
24
  * Internal capture method that returns helper methods for transformation/export.
25
+ * Integrates export hooks: beforeExport → work() → afterExport → afterSnap(once per URL)
22
26
  * @private
23
27
  * @param {HTMLElement} el - The DOM element to capture.
24
28
  * @param {object} context - Normalized context options.
@@ -8,22 +8,8 @@
8
8
  * @param {number} [options.scale=1] - Output scale multiplier
9
9
  * @param {string[]} [options.exclude] - CSS selectors for elements to exclude
10
10
  * @param {Function} [options.filter] - Custom filter function
11
- * @param {boolean} [options.straighten=false] - Normalize root by removing translate*rotate* (keep scale/skew)
12
- * @param {boolean} [options.noShadows=false] - Do not expand bleed for shadows/blur/outline on root (and strip root shadows visually)
13
- * @returns {Promise<string>} Promise that resolves to an SVG data URL
14
- */
15
- /**
16
- * Captures an HTML element as an SVG data URL, inlining styles, images, backgrounds, and optionally fonts.
17
- *
18
- * @param {Element} element - DOM element to capture
19
- * @param {Object} [options={}] - Capture options
20
- * @param {boolean} [options.embedFonts=false] - Whether to embed custom fonts
21
- * @param {boolean} [options.fast=true] - Whether to skip idle delay for faster results
22
- * @param {number} [options.scale=1] - Output scale multiplier
23
- * @param {string[]} [options.exclude] - CSS selectors for elements to exclude
24
- * @param {Function} [options.filter] - Custom filter function
25
- * @param {boolean} [options.straighten=false] - Normalize root by removing translate/rotate (keep scale/skew)
26
- * @param {boolean} [options.noShadows=false] - Do not expand bleed for shadows/blur/outline on root (and strip root shadows visually)
11
+ * @param {boolean} [options.outerTransforms=false] - Normalize root by removing translate/rotate (keep scale/skew)
12
+ * @param {boolean} [options.outerShadows=false] - Do not expand bleed for shadows/blur/outline on root (and strip root shadows visually)
27
13
  * @returns {Promise<string>} Promise that resolves to an SVG data URL
28
14
  */
29
15
  export function captureDOM(element: Element, options?: {
@@ -32,6 +18,6 @@ export function captureDOM(element: Element, options?: {
32
18
  scale?: number | undefined;
33
19
  exclude?: string[] | undefined;
34
20
  filter?: Function | undefined;
35
- straighten?: boolean | undefined;
36
- noShadows?: boolean | undefined;
21
+ outerTransforms?: boolean | undefined;
22
+ outerShadows?: boolean | undefined;
37
23
  }): Promise<string>;
@@ -34,8 +34,8 @@ export function normalizeCachePolicy(v: unknown): CachePolicy;
34
34
  * @param {string|null} [options.backgroundColor]
35
35
  * @param {string} [options.filename]
36
36
  * @param {unknown} [options.cache] // "disabled"|"full"|"auto"|"soft"
37
- * @param {boolean} [options.straighten] // NEW
38
- * @param {boolean} [options.noShadows] // NEW
37
+ * @param {boolean} [options.outerTransforms] // NEW
38
+ * @param {boolean} [options.outerShadows] // NEW
39
39
  * @returns {Object}
40
40
  */
41
41
  export function createContext(options?: {
@@ -61,7 +61,7 @@ export function createContext(options?: {
61
61
  backgroundColor?: string | null | undefined;
62
62
  filename?: string | undefined;
63
63
  cache?: unknown;
64
- straighten?: boolean | undefined;
65
- noShadows?: boolean | undefined;
64
+ outerTransforms?: boolean | undefined;
65
+ outerShadows?: boolean | undefined;
66
66
  }): Object;
67
67
  export type CachePolicy = "disabled" | "full" | "auto" | "soft";
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Normalize an exporter def: Factory, [Factory, options], { exporter, options }, instance.
3
+ * @param {any} spec
4
+ * @returns {any|null}
5
+ */
6
+ export function normalizeExporter(spec: any): any | null;
7
+ /**
8
+ * Register one or many exporters.
9
+ * Last one wins on format collision.
10
+ * @param {...any} defs
11
+ */
12
+ export function registerExporters(...defs: any[]): void;
13
+ /**
14
+ * Resolve the exporter for a format (case-insensitive).
15
+ * @param {string} format
16
+ * @returns {any|null}
17
+ */
18
+ export function getExporter(format: string): any | null;
19
+ /** Utilities for tests */
20
+ export function _exportersMap(): Map<any, any>;
21
+ export function _clearExporters(): void;
22
+ /**
23
+ * Runs export-related hooks around a given export task.
24
+ *
25
+ * Flow:
26
+ * beforeExport → work() → afterExport → afterSnap(once per URL)
27
+ *
28
+ * @template T
29
+ * @param {object} ctx - Capture context extended with { export:{ type, options, url } }
30
+ * @param {() => Promise<T>} work - Async exporter function
31
+ * @returns {Promise<T>} - The export result
32
+ */
33
+ export function runExportHooks<T>(ctx: object, work: () => Promise<T>): Promise<T>;
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Normalize any plugin definition form into an instance.
3
+ * Supports plain objects, [factory, options], { plugin, options }, or functions.
4
+ * @param {any} spec
5
+ * @returns {any|null}
6
+ */
7
+ export function normalizePlugin(spec: any): any | null;
8
+ /**
9
+ * Register global plugins (deduped by name, preserves order).
10
+ * @param {...any} defs
11
+ */
12
+ export function registerPlugins(...defs: any[]): void;
13
+ /**
14
+ * Llama un hook y propaga un acumulador (compat con tu runHook actual).
15
+ * Usa los plugins locales si existen, o los globales en fallback.
16
+ * @param {string} name
17
+ * @param {any} context
18
+ * @param {any} payload
19
+ */
20
+ export function runHook(name: string, context: any, payload: any): Promise<any>;
21
+ /**
22
+ * NUEVO: recolecta los valores devueltos por TODOS los plugins para un hook.
23
+ * Útil para `defineExports` (cada plugin devuelve un mapa propio).
24
+ * Usa plugins locales si existen, o los globales en fallback.
25
+ * @param {string} name
26
+ * @param {any} context
27
+ * @param {any} payload
28
+ */
29
+ export function runAll(name: string, context: any, payload: any): Promise<any[]>;
30
+ /**
31
+ * Return a shallow copy of currently registered global plugins.
32
+ * @returns {any[]}
33
+ */
34
+ export function pluginsList(): any[];
35
+ /** Clear all globally registered plugins (mostly for tests). */
36
+ export function clearPlugins(): void;
37
+ /**
38
+ * Merge local (per-capture) plugin defs with the global registry (local-first).
39
+ * - Local plugins override globals by `name`.
40
+ * - Accepts plain instances, factories ([factory, options]) and {plugin, options}.
41
+ * - Returns a frozen array for immutability & GC safety.
42
+ * @param {any[]|undefined} localDefs
43
+ * @returns {ReadonlyArray<any>}
44
+ */
45
+ export function mergePlugins(localDefs: any[] | undefined): ReadonlyArray<any>;
46
+ /**
47
+ * Attach a per-capture plugin list on the given context (local-first).
48
+ * Idempotent: if `context.plugins` already exists, it remains unless `force` is true.
49
+ * @param {any} context
50
+ * @param {any[]|undefined} localDefs
51
+ * @param {boolean} [force=false]
52
+ * @returns {any} the same context (for chaining)
53
+ */
54
+ export function attachSessionPlugins(context: any, localDefs: any[] | undefined, force?: boolean): any;
55
+ /**
56
+ * Shallow copy of current global plugins (handy for tests or introspection).
57
+ * @returns {any[]}
58
+ */
59
+ export function getGlobalPlugins(): any[];
@@ -1,9 +1,5 @@
1
1
  /**
2
- * Resolve any author-specified CSS variable usages (var(...)) into computed values
3
- * on the cloned element. Works for HTML & SVG, inline styles and attributes,
4
- * without relying on tag/attribute whitelists.
5
- *
6
- * @param {Element} sourceEl - Original element in live DOM
7
- * @param {HTMLElement|SVGElement} cloneEl - Cloned element (detached)
2
+ * General: resuelve var() en estilos inline/atributos. Además, si no hay var()
3
+ * pero el valor computado de KEY_PROPS difiere del baseline, inlina ese valor.
8
4
  */
9
- export function resolveCSSVars(sourceEl: Element, cloneEl: HTMLElement | SVGElement): void;
5
+ export function resolveCSSVars(sourceEl: any, cloneEl: any): void;
@@ -1,2 +1,36 @@
1
1
  export function extendIconFonts(fonts: any): void;
2
2
  export function isIconFont(input: any): boolean;
3
+ /**
4
+ * Rasterization helpers for Google Material Icons / Material Symbols that use ligatures.
5
+ * Converts elements that render icons via text ligatures into inline <img> (data URL).
6
+ * This runs on the CLONE tree (never mutates the original).
7
+ *
8
+ * @module materialIcons
9
+ */
10
+ /** True si la familia es Material Icons / Material Symbols */
11
+ export function isMaterialFamily(family?: string): boolean;
12
+ /** Espera a que la fuente esté lista (ligaduras) */
13
+ export function ensureMaterialFontsReady(family?: string, px?: number): Promise<void>;
14
+ /**
15
+ * Dibuja la ligadura (ej. "face") en canvas → dataURL PNG.
16
+ */
17
+ export function materialIconToImage(ligatureText: any, { family, weight, fontSize, color, variation, }?: {
18
+ family?: string | undefined;
19
+ weight?: string | undefined;
20
+ fontSize?: number | undefined;
21
+ color?: string | undefined;
22
+ variation?: string | undefined;
23
+ }): Promise<{
24
+ dataUrl: string;
25
+ width: number;
26
+ height: number;
27
+ }>;
28
+ /**
29
+ * Reemplaza nodos de Material (ligaduras) por <img> en el CLONE.
30
+ * IMPORTANTE: leé estilos del SOURCE para obtener el color correcto.
31
+ *
32
+ * @param {Element} cloneRoot - subárbol clonado
33
+ * @param {Element} sourceRoot - subárbol original (para estilos reales)
34
+ * @returns {Promise<number>}
35
+ */
36
+ export function ligatureIconToImage(cloneRoot: Element, sourceRoot: Element): Promise<number>;
@@ -1,19 +1,13 @@
1
1
  /**
2
- * Ensures that all external <symbol> or <defs> elements referenced by <use>
3
- * inside the given root element are inlined into it.
2
+ * Inline external <defs> and <symbol> dependencies needed by an SVG subtree (or multiple SVGs),
3
+ * so that serialization does not break. Handles:
4
+ * 1) <use href="#..."> targets (symbols/defs)
5
+ * 2) Attributes/inline styles that reference url(#id) (gradients, patterns, filters, clipPath, mask, marker-*)
6
+ * 3) Recursive chains via href/xlink:href and nested url(#...) inside cloned defs
4
7
  *
5
- * This is necessary when capturing or exporting an SVG fragment that relies on
6
- * definitions existing elsewhere in the document, ensuring it remains
7
- * self-contained and renders correctly.
8
+ * Fast path: no computed styles, no layout reads. Only DOM queries + cloning.
8
9
  *
9
- * Process:
10
- * 1. Collect all IDs referenced by <use> elements in the root.
11
- * 2. Look up those IDs in the global document (outside the root).
12
- * 3. Create or reuse a hidden <svg> container inside the root to hold inlined defs.
13
- * 4. Only insert missing <symbol>/<defs> elements that are not already present.
14
- *
15
- * Existing definitions in the root are never modified or removed.
16
- *
17
- * @param {HTMLElement} rootElement - The root element being processed (typically the cloned DOM fragment).
10
+ * @param {Element} element - SVG root or container holding one/more SVGs.
11
+ * @param {Document|ParentNode} [lookupRoot] - Where to search for external defs/symbols (defaults to element.ownerDocument).
18
12
  */
19
- export function inlineExternalDefsAndSymbols(rootElement: HTMLElement): void;
13
+ export function inlineExternalDefsAndSymbols(element: Element, lookupRoot?: Document | ParentNode): void;
@@ -0,0 +1 @@
1
+ export { default, easing, default as Tween } from "./src";
@@ -0,0 +1,22 @@
1
+ export function easeInBy(power: any): (t: any) => number;
2
+ export function easeOutBy(power: any): (t: any) => number;
3
+ export function easeInOutBy(power: any): (t: any) => number;
4
+ export function linear(t: any): any;
5
+ export function sineIn(t: any): number;
6
+ export function sineOut(t: any): number;
7
+ export function sineInOut(t: any): number;
8
+ export function bounceOut(t: any): number;
9
+ export function bounceIn(t: any): number;
10
+ export function bounceInOut(t: any): number;
11
+ export function quadIn(t: any): number;
12
+ export function quadOut(t: any): number;
13
+ export function quadInOut(t: any): number;
14
+ export function cubicIn(t: any): number;
15
+ export function cubicOut(t: any): number;
16
+ export function cubicInOut(t: any): number;
17
+ export function quartIn(t: any): number;
18
+ export function quartOut(t: any): number;
19
+ export function quartInOut(t: any): number;
20
+ export function quintIn(t: any): number;
21
+ export function quintOut(t: any): number;
22
+ export function quintInOut(t: any): number;
@@ -0,0 +1,3 @@
1
+ export { easing };
2
+ export { default } from "./tween";
3
+ import * as easing from './easing';
@@ -0,0 +1,22 @@
1
+ export default Tween;
2
+ declare class Tween {
3
+ constructor(options: any);
4
+ from: any;
5
+ to: any;
6
+ duration: any;
7
+ delay: any;
8
+ easing: any;
9
+ onStart: any;
10
+ onUpdate: any;
11
+ onFinish: any;
12
+ startTime: any;
13
+ started: boolean;
14
+ finished: boolean;
15
+ timer: number | null;
16
+ keys: {};
17
+ update(): void;
18
+ time: number | undefined;
19
+ elapsed: any;
20
+ start(): void;
21
+ stop(): void;
22
+ }
@@ -0,0 +1,3 @@
1
+ export * from './src';
2
+ export { default } from './src';
3
+ export type * from './src';
@@ -0,0 +1,39 @@
1
+ import type { GlobalConfig, InnerValidateOptions, SchemaType, ValidateMessagesType, ValidateOptions } from './interface';
2
+ import enUSValidateLocale from './locale/en-US';
3
+ import zhCNValidateLocale from './locale/zh-CN';
4
+ import DefaultValidateMessage from './message';
5
+ import ArrayValidator from './rules/array';
6
+ import BooleanValidator from './rules/boolean';
7
+ import CustomValidator from './rules/custom';
8
+ import NumberValidator from './rules/number';
9
+ import ObjectValidator from './rules/object';
10
+ import StringValidator from './rules/string';
11
+ import TypeValidator from './rules/type';
12
+ import { mergeTemplate } from './utils';
13
+ declare const PqbValidate: {
14
+ (object: unknown, options: ValidateOptions): Validate;
15
+ globalConfig: GlobalConfig;
16
+ setGlobalConfig(options: GlobalConfig): void;
17
+ };
18
+ declare class Validate {
19
+ number: NumberValidator;
20
+ string: StringValidator;
21
+ array: ArrayValidator;
22
+ object: ObjectValidator;
23
+ boolean: BooleanValidator;
24
+ type: TypeValidator;
25
+ custom: CustomValidator;
26
+ constructor(object: unknown, _options: InnerValidateOptions);
27
+ }
28
+ declare class Schema {
29
+ schema: SchemaType;
30
+ options: ValidateOptions;
31
+ constructor(schema: SchemaType, options?: ValidateOptions);
32
+ messages(validateMessages: ValidateMessagesType): void;
33
+ validate(values: {
34
+ [key: string]: unknown;
35
+ }, callback: any): void;
36
+ }
37
+ export { ArrayValidator, BooleanValidator, CustomValidator, zhCNValidateLocale as defaultValidateLocale, DefaultValidateMessage, enUSValidateLocale, mergeTemplate, NumberValidator, ObjectValidator, Schema, StringValidator, TypeValidator, zhCNValidateLocale, };
38
+ export default PqbValidate;
39
+ export type { CustomValidatorType, GlobalConfig, InnerValidateOptions, RuleType, SchemaRuleType, SchemaType, ValidateMessagesTemplateType, ValidateMessagesType, ValidateOptions, ValidatorError, } from './interface';
@@ -0,0 +1,53 @@
1
+ import ValidateMessages from './message';
2
+ export type ValidateMessagesTemplateType = typeof ValidateMessages;
3
+ export type ValidateMessagesType = Partial<{
4
+ [key in keyof ValidateMessagesTemplateType]: ValidateMessagesTemplateType[key] extends string ? ValidateMessagesTemplateType[key] : Record<keyof ValidateMessagesTemplateType[key], string | ((info: any) => unknown)>;
5
+ }>;
6
+ export type RuleType = 'string' | 'number' | 'boolean' | 'array' | 'object' | 'url' | 'email' | 'ip' | 'type' | 'custom';
7
+ export type GlobalConfig = Pick<ValidateOptions, 'strict' | 'trim' | 'ignoreEmptyString' | 'validateMessages'>;
8
+ export type ValidateOptions = {
9
+ strict?: boolean;
10
+ trim?: boolean;
11
+ ignoreEmptyString?: boolean;
12
+ message?: unknown;
13
+ type?: RuleType;
14
+ validateMessages?: ValidateMessagesType;
15
+ };
16
+ export type InnerValidateOptions = ValidateOptions & {
17
+ field?: string;
18
+ };
19
+ export type CustomValidatorType = (value: unknown, callback: (message?: unknown) => void) => Promise<void> | void;
20
+ export type SchemaRuleType = {
21
+ required?: boolean;
22
+ message?: unknown;
23
+ validator?: CustomValidatorType;
24
+ type?: RuleType;
25
+ true?: boolean;
26
+ false?: boolean;
27
+ deepEqual?: unknown;
28
+ hasKeys?: string[];
29
+ empty?: boolean;
30
+ includes?: unknown;
31
+ maxLength?: number;
32
+ minLength?: number;
33
+ pattern?: RegExp;
34
+ length?: number;
35
+ uppercase?: boolean;
36
+ lowercase?: boolean;
37
+ min?: number;
38
+ max?: number;
39
+ equal?: number;
40
+ positive?: boolean;
41
+ negative?: boolean;
42
+ ignoreEmptyString?: boolean;
43
+ strict?: boolean;
44
+ };
45
+ export type SchemaType = {
46
+ [key: string]: SchemaRuleType[];
47
+ };
48
+ export type ValidatorError = {
49
+ value: unknown;
50
+ type: ValidateOptions['type'];
51
+ requiredError?: boolean;
52
+ message?: unknown;
53
+ };
@@ -0,0 +1,47 @@
1
+ declare const _default: {
2
+ required: string;
3
+ type: {
4
+ ip: string;
5
+ email: string;
6
+ url: string;
7
+ string: string;
8
+ number: string;
9
+ array: string;
10
+ object: string;
11
+ boolean: string;
12
+ };
13
+ number: {
14
+ min: string;
15
+ max: string;
16
+ equal: string;
17
+ range: string;
18
+ positive: string;
19
+ negative: string;
20
+ };
21
+ string: {
22
+ maxLength: string;
23
+ minLength: string;
24
+ length: string;
25
+ match: string;
26
+ uppercase: string;
27
+ lowercase: string;
28
+ };
29
+ array: {
30
+ length: string;
31
+ minLength: string;
32
+ maxLength: string;
33
+ includes: string;
34
+ deepEqual: string;
35
+ empty: string;
36
+ };
37
+ object: {
38
+ deepEqual: string;
39
+ hasKeys: string;
40
+ empty: string;
41
+ };
42
+ boolean: {
43
+ true: string;
44
+ false: string;
45
+ };
46
+ };
47
+ export default _default;
@@ -0,0 +1,47 @@
1
+ declare const _default: {
2
+ required: string;
3
+ type: {
4
+ string: string;
5
+ number: string;
6
+ boolean: string;
7
+ array: string;
8
+ object: string;
9
+ url: string;
10
+ email: string;
11
+ ip: string;
12
+ };
13
+ number: {
14
+ min: string;
15
+ max: string;
16
+ equal: string;
17
+ range: string;
18
+ positive: string;
19
+ negative: string;
20
+ };
21
+ array: {
22
+ length: string;
23
+ minLength: string;
24
+ maxLength: string;
25
+ includes: string;
26
+ deepEqual: string;
27
+ empty: string;
28
+ };
29
+ string: {
30
+ minLength: string;
31
+ maxLength: string;
32
+ length: string;
33
+ match: string;
34
+ uppercase: string;
35
+ lowercase: string;
36
+ };
37
+ object: {
38
+ deepEqual: string;
39
+ hasKeys: string;
40
+ empty: string;
41
+ };
42
+ boolean: {
43
+ true: string;
44
+ false: string;
45
+ };
46
+ };
47
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import defaultValidateLocale from './locale/zh-CN';
2
+ export default defaultValidateLocale;
@@ -0,0 +1,12 @@
1
+ import { InnerValidateOptions } from './../interface';
2
+ import Base from './base';
3
+ declare class ArrayValidator extends Base {
4
+ constructor(object: unknown, options: InnerValidateOptions);
5
+ length(num: number): this;
6
+ minLength(num: number): this;
7
+ maxLength(num: number): this;
8
+ includes(arrays: number[]): this;
9
+ deepEqual(other: number[]): this;
10
+ get empty(): this;
11
+ }
12
+ export default ArrayValidator;