html2canvas-pro 2.4.4 → 2.5.0

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 (228) hide show
  1. package/README.md +115 -13
  2. package/dist/html2canvas-pro.cjs +3246 -1601
  3. package/dist/html2canvas-pro.cjs.map +1 -1
  4. package/dist/html2canvas-pro.esm.js +3246 -1601
  5. package/dist/html2canvas-pro.esm.js.map +1 -1
  6. package/dist/html2canvas-pro.js +3242 -1597
  7. package/dist/html2canvas-pro.js.map +1 -1
  8. package/dist/html2canvas-pro.min.js +5 -5
  9. package/dist/types/core/cache-storage.d.ts +4 -1
  10. package/dist/types/core/context.d.ts +10 -1
  11. package/dist/types/core/render-element.d.ts +11 -0
  12. package/dist/types/core/util.d.ts +6 -0
  13. package/dist/types/css/index.d.ts +77 -46
  14. package/dist/types/css/parse.d.ts +15 -0
  15. package/dist/types/css/property-descriptors/accent-color.d.ts +5 -0
  16. package/dist/types/css/property-descriptors/backdrop-filter.d.ts +9 -0
  17. package/dist/types/css/property-descriptors/background-blend-mode.d.ts +16 -16
  18. package/dist/types/css/property-descriptors/border-image-width.d.ts +36 -0
  19. package/dist/types/css/property-descriptors/clip-path.d.ts +16 -2
  20. package/dist/types/css/property-descriptors/isolation.d.ts +6 -0
  21. package/dist/types/css/property-descriptors/mask.d.ts +25 -0
  22. package/dist/types/css/property-descriptors/mix-blend-mode.d.ts +16 -16
  23. package/dist/types/css/property-descriptors/outline.d.ts +15 -0
  24. package/dist/types/css/property-descriptors/text-emphasis.d.ts +22 -0
  25. package/dist/types/css/property-descriptors/text-shadow.d.ts +1 -1
  26. package/dist/types/css/property-descriptors/webkit-box-reflect.d.ts +19 -0
  27. package/dist/types/css/property-descriptors/webkit-text-fill-color.d.ts +9 -0
  28. package/dist/types/css/syntax/token-constants.d.ts +1 -1
  29. package/dist/types/css/types/color-math.d.ts +7 -1
  30. package/dist/types/css/types/color-spaces/a98.d.ts +2 -1
  31. package/dist/types/css/types/color-spaces/p3.d.ts +5 -4
  32. package/dist/types/css/types/color-spaces/pro-photo.d.ts +5 -4
  33. package/dist/types/css/types/color-spaces/rec2020.d.ts +5 -4
  34. package/dist/types/css/types/color-spaces/srgb.d.ts +5 -4
  35. package/dist/types/css/types/color-utilities.d.ts +11 -11
  36. package/dist/types/css/types/color.d.ts +1 -0
  37. package/dist/types/css/types/functions/conic-gradient.d.ts +11 -0
  38. package/dist/types/css/types/functions/image-set.d.ts +11 -0
  39. package/dist/types/css/types/functions/repeating-radial-gradient.d.ts +8 -0
  40. package/dist/types/css/types/image.d.ts +15 -2
  41. package/dist/types/css/types/safe-eval.d.ts +0 -6
  42. package/dist/types/dom/copy-css-styles.d.ts +8 -0
  43. package/dist/types/dom/document-cloner.d.ts +3 -13
  44. package/dist/types/dom/iframe-mount.d.ts +37 -0
  45. package/dist/types/dom/pseudo-content.d.ts +33 -0
  46. package/dist/types/dom/replaced-elements/iframe-element-container.d.ts +2 -2
  47. package/dist/types/options.d.ts +8 -2
  48. package/dist/types/render/canvas/background-renderer.d.ts +19 -0
  49. package/dist/types/render/canvas/border-image-renderer.d.ts +50 -1
  50. package/dist/types/render/canvas/box-shadow-geometry.d.ts +3 -0
  51. package/dist/types/render/canvas/box-shadow-painter.d.ts +13 -0
  52. package/dist/types/render/canvas/box-shadow-transform.d.ts +16 -0
  53. package/dist/types/render/canvas/canvas-renderer.d.ts +21 -15
  54. package/dist/types/render/canvas/mask-renderer.d.ts +36 -0
  55. package/dist/types/render/canvas/text-clip-renderer.d.ts +36 -0
  56. package/dist/types/render/canvas/text-renderer.d.ts +22 -0
  57. package/dist/types/render/stacking-context.d.ts +4 -1
  58. package/package.json +39 -40
  59. package/dist/lib/config.js +0 -49
  60. package/dist/lib/core/abort-helper.js +0 -20
  61. package/dist/lib/core/background-parser.js +0 -41
  62. package/dist/lib/core/bitwise.js +0 -5
  63. package/dist/lib/core/cache-storage.js +0 -283
  64. package/dist/lib/core/config-assembler.js +0 -88
  65. package/dist/lib/core/constants.js +0 -25
  66. package/dist/lib/core/context.js +0 -19
  67. package/dist/lib/core/debugger.js +0 -27
  68. package/dist/lib/core/features.js +0 -190
  69. package/dist/lib/core/logger.js +0 -56
  70. package/dist/lib/core/lru-map.js +0 -66
  71. package/dist/lib/core/origin-checker.js +0 -53
  72. package/dist/lib/core/performance-monitor.js +0 -185
  73. package/dist/lib/core/render-element.js +0 -131
  74. package/dist/lib/core/util.js +0 -4
  75. package/dist/lib/core/validator.js +0 -500
  76. package/dist/lib/css/grouped/background-styles.js +0 -36
  77. package/dist/lib/css/grouped/border-styles.js +0 -75
  78. package/dist/lib/css/grouped/font-styles.js +0 -93
  79. package/dist/lib/css/grouped/layout-styles.js +0 -127
  80. package/dist/lib/css/index.js +0 -339
  81. package/dist/lib/css/layout/bounds.js +0 -52
  82. package/dist/lib/css/layout/text.js +0 -133
  83. package/dist/lib/css/property-descriptor.js +0 -2
  84. package/dist/lib/css/property-descriptors/background-blend-mode.js +0 -41
  85. package/dist/lib/css/property-descriptors/background-clip.js +0 -25
  86. package/dist/lib/css/property-descriptors/background-color.js +0 -10
  87. package/dist/lib/css/property-descriptors/background-image.js +0 -24
  88. package/dist/lib/css/property-descriptors/background-origin.js +0 -23
  89. package/dist/lib/css/property-descriptors/background-position.js +0 -19
  90. package/dist/lib/css/property-descriptors/background-repeat.js +0 -33
  91. package/dist/lib/css/property-descriptors/background-size.js +0 -23
  92. package/dist/lib/css/property-descriptors/border-color.js +0 -14
  93. package/dist/lib/css/property-descriptors/border-image-repeat.js +0 -42
  94. package/dist/lib/css/property-descriptors/border-image-slice.js +0 -45
  95. package/dist/lib/css/property-descriptors/border-image-source.js +0 -22
  96. package/dist/lib/css/property-descriptors/border-radius.js +0 -15
  97. package/dist/lib/css/property-descriptors/border-style.js +0 -26
  98. package/dist/lib/css/property-descriptors/border-width.js +0 -20
  99. package/dist/lib/css/property-descriptors/box-decoration-break.js +0 -18
  100. package/dist/lib/css/property-descriptors/box-shadow.js +0 -54
  101. package/dist/lib/css/property-descriptors/clip-path.js +0 -189
  102. package/dist/lib/css/property-descriptors/color.js +0 -10
  103. package/dist/lib/css/property-descriptors/content.js +0 -19
  104. package/dist/lib/css/property-descriptors/counter-increment.js +0 -35
  105. package/dist/lib/css/property-descriptors/counter-reset.js +0 -18
  106. package/dist/lib/css/property-descriptors/direction.js +0 -18
  107. package/dist/lib/css/property-descriptors/display.js +0 -81
  108. package/dist/lib/css/property-descriptors/duration.js +0 -14
  109. package/dist/lib/css/property-descriptors/filter.js +0 -86
  110. package/dist/lib/css/property-descriptors/float.js +0 -22
  111. package/dist/lib/css/property-descriptors/font-family.js +0 -47
  112. package/dist/lib/css/property-descriptors/font-size.js +0 -10
  113. package/dist/lib/css/property-descriptors/font-style.js +0 -20
  114. package/dist/lib/css/property-descriptors/font-variant-ligatures.js +0 -34
  115. package/dist/lib/css/property-descriptors/font-variant.js +0 -13
  116. package/dist/lib/css/property-descriptors/font-weight.js +0 -25
  117. package/dist/lib/css/property-descriptors/image-rendering.js +0 -33
  118. package/dist/lib/css/property-descriptors/letter-spacing.js +0 -21
  119. package/dist/lib/css/property-descriptors/line-break.js +0 -23
  120. package/dist/lib/css/property-descriptors/line-height.js +0 -24
  121. package/dist/lib/css/property-descriptors/list-style-image.js +0 -17
  122. package/dist/lib/css/property-descriptors/list-style-position.js +0 -18
  123. package/dist/lib/css/property-descriptors/list-style-type.js +0 -122
  124. package/dist/lib/css/property-descriptors/margin.js +0 -13
  125. package/dist/lib/css/property-descriptors/mix-blend-mode.js +0 -31
  126. package/dist/lib/css/property-descriptors/object-fit.js +0 -28
  127. package/dist/lib/css/property-descriptors/object-position.js +0 -42
  128. package/dist/lib/css/property-descriptors/opacity.js +0 -16
  129. package/dist/lib/css/property-descriptors/overflow-wrap.js +0 -18
  130. package/dist/lib/css/property-descriptors/overflow.js +0 -27
  131. package/dist/lib/css/property-descriptors/padding.js +0 -14
  132. package/dist/lib/css/property-descriptors/paint-order.js +0 -33
  133. package/dist/lib/css/property-descriptors/position.js +0 -22
  134. package/dist/lib/css/property-descriptors/quotes.js +0 -41
  135. package/dist/lib/css/property-descriptors/rotate.js +0 -27
  136. package/dist/lib/css/property-descriptors/text-align.js +0 -21
  137. package/dist/lib/css/property-descriptors/text-decoration-color.js +0 -10
  138. package/dist/lib/css/property-descriptors/text-decoration-line.js +0 -28
  139. package/dist/lib/css/property-descriptors/text-decoration-style.js +0 -24
  140. package/dist/lib/css/property-descriptors/text-decoration-thickness.js +0 -26
  141. package/dist/lib/css/property-descriptors/text-overflow.js +0 -18
  142. package/dist/lib/css/property-descriptors/text-shadow.js +0 -46
  143. package/dist/lib/css/property-descriptors/text-transform.js +0 -20
  144. package/dist/lib/css/property-descriptors/text-underline-offset.js +0 -23
  145. package/dist/lib/css/property-descriptors/transform-origin.js +0 -24
  146. package/dist/lib/css/property-descriptors/transform.js +0 -57
  147. package/dist/lib/css/property-descriptors/visibility.js +0 -20
  148. package/dist/lib/css/property-descriptors/webkit-line-clamp.js +0 -26
  149. package/dist/lib/css/property-descriptors/webkit-text-stroke-color.js +0 -10
  150. package/dist/lib/css/property-descriptors/webkit-text-stroke-width.js +0 -16
  151. package/dist/lib/css/property-descriptors/white-space.js +0 -32
  152. package/dist/lib/css/property-descriptors/word-break.js +0 -26
  153. package/dist/lib/css/property-descriptors/writing-mode.js +0 -28
  154. package/dist/lib/css/property-descriptors/z-index.js +0 -19
  155. package/dist/lib/css/property-descriptors/zoom.js +0 -18
  156. package/dist/lib/css/syntax/parser.js +0 -141
  157. package/dist/lib/css/syntax/token-constants.js +0 -214
  158. package/dist/lib/css/syntax/token-singletons.js +0 -36
  159. package/dist/lib/css/syntax/token-types.js +0 -10
  160. package/dist/lib/css/syntax/tokenizer.js +0 -502
  161. package/dist/lib/css/type-descriptor.js +0 -2
  162. package/dist/lib/css/types/angle.js +0 -80
  163. package/dist/lib/css/types/color-math.js +0 -25
  164. package/dist/lib/css/types/color-spaces/a98.js +0 -78
  165. package/dist/lib/css/types/color-spaces/p3.js +0 -86
  166. package/dist/lib/css/types/color-spaces/pro-photo.js +0 -83
  167. package/dist/lib/css/types/color-spaces/rec2020.js +0 -85
  168. package/dist/lib/css/types/color-spaces/srgb.js +0 -79
  169. package/dist/lib/css/types/color-utilities.js +0 -342
  170. package/dist/lib/css/types/color.js +0 -400
  171. package/dist/lib/css/types/functions/-prefix-linear-gradient.js +0 -32
  172. package/dist/lib/css/types/functions/-prefix-radial-gradient.js +0 -83
  173. package/dist/lib/css/types/functions/-webkit-gradient.js +0 -59
  174. package/dist/lib/css/types/functions/counter.js +0 -367
  175. package/dist/lib/css/types/functions/gradient.js +0 -163
  176. package/dist/lib/css/types/functions/linear-gradient.js +0 -27
  177. package/dist/lib/css/types/functions/radial-gradient.js +0 -90
  178. package/dist/lib/css/types/functions/repeating-linear-gradient.js +0 -9
  179. package/dist/lib/css/types/image.js +0 -62
  180. package/dist/lib/css/types/index.js +0 -2
  181. package/dist/lib/css/types/length-percentage.js +0 -197
  182. package/dist/lib/css/types/length.js +0 -5
  183. package/dist/lib/css/types/safe-eval.js +0 -80
  184. package/dist/lib/css/types/time.js +0 -17
  185. package/dist/lib/dom/document-cloner.js +0 -618
  186. package/dist/lib/dom/dom-normalizer.js +0 -115
  187. package/dist/lib/dom/element-container.js +0 -71
  188. package/dist/lib/dom/elements/li-element-container.js +0 -11
  189. package/dist/lib/dom/elements/ol-element-container.js +0 -12
  190. package/dist/lib/dom/elements/select-element-container.js +0 -12
  191. package/dist/lib/dom/elements/textarea-element-container.js +0 -11
  192. package/dist/lib/dom/node-parser.js +0 -125
  193. package/dist/lib/dom/node-type-guards.js +0 -81
  194. package/dist/lib/dom/replaced-elements/canvas-element-container.js +0 -13
  195. package/dist/lib/dom/replaced-elements/iframe-element-container.js +0 -38
  196. package/dist/lib/dom/replaced-elements/image-element-container.js +0 -14
  197. package/dist/lib/dom/replaced-elements/index.js +0 -2
  198. package/dist/lib/dom/replaced-elements/input-element-container.js +0 -89
  199. package/dist/lib/dom/replaced-elements/svg-element-container.js +0 -57
  200. package/dist/lib/dom/slot-cloner.js +0 -176
  201. package/dist/lib/dom/text-container.js +0 -35
  202. package/dist/lib/index.js +0 -49
  203. package/dist/lib/options.js +0 -2
  204. package/dist/lib/render/background.js +0 -188
  205. package/dist/lib/render/bezier-curve.js +0 -34
  206. package/dist/lib/render/border.js +0 -104
  207. package/dist/lib/render/bound-curves.js +0 -188
  208. package/dist/lib/render/box-sizing.js +0 -20
  209. package/dist/lib/render/canvas/background-renderer.js +0 -338
  210. package/dist/lib/render/canvas/border-image-renderer.js +0 -153
  211. package/dist/lib/render/canvas/border-renderer.js +0 -184
  212. package/dist/lib/render/canvas/canvas-path.js +0 -25
  213. package/dist/lib/render/canvas/canvas-renderer.js +0 -633
  214. package/dist/lib/render/canvas/content-renderer.js +0 -270
  215. package/dist/lib/render/canvas/effects-renderer.js +0 -171
  216. package/dist/lib/render/canvas/filter-surface.js +0 -270
  217. package/dist/lib/render/canvas/font-utils.js +0 -46
  218. package/dist/lib/render/canvas/foreignobject-renderer.js +0 -38
  219. package/dist/lib/render/canvas/surface-bounds.js +0 -64
  220. package/dist/lib/render/canvas/text/text-decoration-renderer.js +0 -99
  221. package/dist/lib/render/canvas/text-renderer.js +0 -486
  222. package/dist/lib/render/effects.js +0 -231
  223. package/dist/lib/render/font-metrics.js +0 -53
  224. package/dist/lib/render/object-fit.js +0 -91
  225. package/dist/lib/render/path.js +0 -26
  226. package/dist/lib/render/renderer-interface.js +0 -2
  227. package/dist/lib/render/stacking-context.js +0 -341
  228. package/dist/lib/render/vector.js +0 -16
package/README.md CHANGED
@@ -15,26 +15,45 @@ Next generation JavaScript screenshot tool.
15
15
  <a href="https://deepwiki.com/yorickshan/html2canvas-pro"><img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki"></a>
16
16
  </p>
17
17
  <p align="center">
18
- <a href="https://yorickshan.github.io/html2canvas-pro/getting-started.html">Getting Started</a>
18
+ <a href="https://yorickshan.github.io/html2canvas-pro/getting-started.html">Getting Started</a> ·
19
+ <a href="https://yorickshan.github.io/html2canvas-pro/configuration.html">Configuration</a> ·
20
+ <a href="https://yorickshan.github.io/html2canvas-pro/features.html">Features</a> ·
21
+ <a href="https://yorickshan.github.io/html2canvas-pro/faq.html">FAQ</a>
19
22
  </p>
20
23
  <br>
21
24
 
22
25
  ## Why html2canvas-pro?
23
26
 
24
27
  html2canvas-pro is a fork of [niklasvh/html2canvas](https://github.com/niklasvh/html2canvas) that includes various fixes and new features. It offers several advantages over the original html2canvas:
28
+
29
+ **Modern CSS support**
25
30
  - Color functions `color()` (incl. relative colors), `lab()`, `lch()`, `oklab()`, `oklch()`
26
31
  - `background-clip: text` support
27
- - `mix-blend-mode` support
32
+ - `mix-blend-mode` and `background-blend-mode` support
28
33
  - `object-fit` support for `<img/>`
29
- - CSS `clip-path` support (inset, circle, ellipse, polygon, path)
34
+ - CSS `clip-path` support (inset, rect, xywh, circle, ellipse, polygon, path)
30
35
  - CSS `writing-mode` support (horizontal-tb, vertical-rl, vertical-lr)
31
- - Native `drop-shadow()` filter rendering via the canvas shadow API
32
- - **Image smoothing control** — CSS `image-rendering` property and `imageSmoothing`/`imageSmoothingQuality` options
33
- - **Security validation** — Built-in input validation (XSS/SSRF protection)
34
- - **Performance monitoring** — Built-in performance measurement API
35
- - **Progress & error callbacks** — `onProgress` / `onError` options and `AbortSignal` cancellation
36
- - **Performance optimizations** — deferred CSS parsing and LRU caches for gradients & CSS parsing
37
- - Various bug fixes from the [changelog](./CHANGELOG.md)
36
+ - `mask-image` alpha masks with position/size/repeat (see [mask support](docs/features.md#mask-support))
37
+ - `backdrop-filter: blur()` for frosted-glass captures (see [backdrop-filter support](docs/features.md#backdrop-filter-support))
38
+ - `conic-gradient()` and `repeating-radial-gradient()` — complete gradient family
39
+ - `text-emphasis` (CJK emphasis marks), `-webkit-box-reflect`, `image-set()`, `border-image-outset` / `border-image-width`
40
+ - `accent-color`, `outline`, `-webkit-text-fill-color`, `isolation`
41
+ - `filter` compositing for eligible layers — `blur()` / `drop-shadow()` rendered on a dedicated surface with correct layer `opacity` (see [filter support notes](docs/filter-support.md))
42
+ - Faithful `box-shadow` rendering, including inset shadows, blur scaling, and shadows through transformed ancestors
43
+ - `image-rendering` CSS property plus `imageSmoothing` / `imageSmoothingQuality` options for pixel-perfect output
44
+ - Border image, counters & quotes, `direction`, `line-height`, `transform-origin`, and more — see the full [feature list](docs/features.md)
45
+
46
+ **Developer experience**
47
+ - **Security validation** — Built-in input validation (`Validator` API, XSS/SSRF protection)
48
+ - **Performance monitoring** — Built-in `PerformanceMonitor` with per-phase timings
49
+ - **Error, progress & cancellation hooks** — `onError` for failed resources, `onProgress` for pipeline milestones (incl. per-batch image preload progress), `AbortSignal` cancellation
50
+ - **TypeScript** — First-class type definitions included
51
+ - **Shadow DOM & Web Components** — slot assignment, shadow-root cloning, and automatic iframe placement
52
+
53
+ **Performance**
54
+ - Deferred (batched, parallel) image preloading
55
+ - LRU caches for CSS parsing and gradient patterns
56
+ - Native canvas filter fast path with verified SVG fallback
38
57
 
39
58
  If you found this helpful, don't forget to
40
59
  leave a star 🌟.
@@ -48,11 +67,12 @@ yarn add html2canvas-pro
48
67
  ```
49
68
 
50
69
  ## Usage
70
+
51
71
  ```javascript
52
72
  import html2canvas from 'html2canvas-pro';
53
73
  ```
54
74
 
55
- To render an `element` with html2canvas-pro with some (optional) [options](/docs/configuration.md), simply call `html2canvas(element, options);`
75
+ To render an `element` with html2canvas-pro with some (optional) [options](docs/configuration.md), simply call `html2canvas(element, options);`
56
76
 
57
77
  ### Basic Example
58
78
 
@@ -62,9 +82,20 @@ html2canvas(document.body).then(function(canvas) {
62
82
  });
63
83
  ```
64
84
 
85
+ ### Script tag / CDN
86
+
87
+ A browser bundle is also available (exposes the global `window.html2canvas`):
88
+
89
+ ```html
90
+ <script src="https://cdn.jsdelivr.net/npm/html2canvas-pro/dist/html2canvas-pro.min.js"></script>
91
+ <script>
92
+ html2canvas(document.body).then((canvas) => document.body.appendChild(canvas));
93
+ </script>
94
+ ```
95
+
65
96
  ### Controlling Output Dimensions
66
97
 
67
- ⚠️ **Important**: By default, the output canvas dimensions are affected by `devicePixelRatio`.
98
+ ⚠️ **Important**: By default, the output canvas dimensions are affected by `devicePixelRatio`.
68
99
 
69
100
  ```javascript
70
101
  // If you need exact pixel dimensions (e.g., for a specific file size):
@@ -78,7 +109,78 @@ html2canvas(element, {
78
109
  });
79
110
  ```
80
111
 
81
- See the [Configuration Guide](/docs/configuration.md#canvas-dimensions) for more details.
112
+ See the [Configuration Guide](docs/configuration.md#canvas-dimensions) for more details.
113
+
114
+ ### Error Handling & Cancellation
115
+
116
+ ```javascript
117
+ const controller = new AbortController();
118
+
119
+ html2canvas(element, {
120
+ useCORS: true,
121
+ onError: (error) => {
122
+ // Called when a resource (image, font, …) fails to load.
123
+ // The render continues — this is a notification hook, not an abort.
124
+ console.warn('Resource failed:', error);
125
+ },
126
+ signal: controller.signal // Rejects with an AbortError when aborted
127
+ }).then(canvas => {
128
+ document.body.appendChild(canvas);
129
+ });
130
+
131
+ // Cancel an in-progress capture:
132
+ controller.abort();
133
+ ```
134
+
135
+ ### Pixel-Perfect Capture
136
+
137
+ ```javascript
138
+ html2canvas(element, {
139
+ imageSmoothing: false, // Disable anti-aliasing globally
140
+ scale: 2 // Upscale without blur
141
+ });
142
+ // Or per-element via CSS: style="image-rendering: pixelated"
143
+ ```
144
+
145
+ ## API
146
+
147
+ The package exports `html2canvas` (default), plus the following named exports:
148
+
149
+ | Export | Description |
150
+ | --- | --- |
151
+ | `html2canvas` | Render an element to a `<canvas>` |
152
+ | `Html2CanvasConfig` | Per-call runtime config (CSP nonce, shared cache) |
153
+ | `Validator` / `createDefaultValidator` | Input validation (URLs, proxy allow-list, element checks) |
154
+ | `PerformanceMonitor` | Phase-level timing metrics |
155
+ | `Options` | The full options type |
156
+
157
+ Full type definitions ship with the package — your editor's IntelliSense covers every option. An HTML API reference can be generated locally with `corepack pnpm docs:api` (TypeDoc).
158
+
159
+ ## Documentation
160
+
161
+ The full documentation site lives at [yorickshan.github.io/html2canvas-pro](https://yorickshan.github.io/html2canvas-pro/):
162
+
163
+ - [Getting Started](docs/getting-started.md) — installation, usage, live demo
164
+ - [Configuration](docs/configuration.md) — every option with defaults and examples
165
+ - [Features](docs/features.md) — supported CSS properties and values
166
+ - [Proxy](docs/proxy.md) — cross-origin image handling
167
+ - [FAQ](docs/faq.md) — canvas size, tainted canvas, browser limits
168
+ - [Architecture](docs/ARCHITECTURE.md) — how the rendering pipeline works
169
+
170
+ ## Development
171
+
172
+ The project uses [pnpm](https://pnpm.io) (the version is pinned via the `packageManager` field — Corepack handles it automatically). Unit tests require **Node.js 24** (jsdom 30).
173
+
174
+ ```sh
175
+ corepack pnpm install
176
+ corepack pnpm build # tsc + Rolldown bundles (CJS/ESM/UMD)
177
+ corepack pnpm unittest # Vitest unit tests
178
+ corepack pnpm test # lint + unit tests + browser (Karma) tests
179
+ corepack pnpm docs:dev # VitePress dev server
180
+ corepack pnpm docs:api # Generate the TypeDoc API reference
181
+ ```
182
+
183
+ See [CONTRIBUTING.md](docs/CONTRIBUTING.md) for the full guide, including how to add a new CSS property.
82
184
 
83
185
  ## Contribution
84
186