html2canvas-pro 2.5.3 → 2.5.4

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.
@@ -16,12 +16,23 @@ export declare const DEFAULT_IMAGE_TIMEOUT_MS = 15000;
16
16
  export declare const SHADOW_MASK_OFFSET = 10000;
17
17
  /** Polling interval (ms) when waiting for the cloned iframe to become ready. */
18
18
  export declare const IFRAME_READY_POLL_MS = 50;
19
+ /** Polling interval (ms) when waiting for clone stylesheets to apply. */
20
+ export declare const STYLESHEET_READY_POLL_MS = 50;
19
21
  /**
20
22
  * Total time (ms) to wait for the cloned iframe document to become ready
21
23
  * after its load event. A missed deadline resolves with a warning (the
22
24
  * capture continues with a possibly incomplete document).
23
25
  */
24
26
  export declare const CLONE_READY_TIMEOUT_MS = 30000;
27
+ /**
28
+ * Total time (ms) to wait for the clone's external stylesheets (link and
29
+ * @import chains) to apply. Shorter than the document readiness window: a
30
+ * stylesheet that needs longer usually means a hung CDN, and rendering with
31
+ * a 10s-old layout beats blocking the capture for 30s. A missed deadline
32
+ * resolves with a warning (the capture continues with a possibly unstyled
33
+ * clone).
34
+ */
35
+ export declare const STYLESHEET_READY_TIMEOUT_MS = 10000;
25
36
  /**
26
37
  * Hard ceiling (ms) for the cloned iframe's load event itself. If the event
27
38
  * never fires, the mount is rejected instead of hanging forever.
@@ -41,7 +41,7 @@ type TrustedTypePolicyLike = {
41
41
  export declare const resolveTrustedTypesPolicy: (ownerWindow: Window | null) => TrustedTypePolicyLike | null;
42
42
  export declare const createIFrameContainer: (ownerDocument: Document, bounds: Bounds, customContainer?: HTMLElement | ShadowRoot) => HTMLIFrameElement;
43
43
  /**
44
- * Wait until every external stylesheet link of the clone has been applied or
44
+ * Wait until every external stylesheet of the clone has been applied or
45
45
  * definitively failed, or the readiness budget expires.
46
46
  *
47
47
  * The clone is mounted by adoptNode() into an already-closed document
@@ -54,6 +54,12 @@ export declare const createIFrameContainer: (ownerDocument: Document, bounds: Bo
54
54
  * an unstyled layout (issue #245). Inline <style> clones apply
55
55
  * synchronously and document-level adopted stylesheets are serialised at
56
56
  * clone time, so neither needs this wait.
57
+ *
58
+ * Readiness is polled rather than purely event-driven because a <style>
59
+ * clone serialised from `createStyleClone` re-fetches its external @import
60
+ * rules without firing link load/error events, and shadow-root links are
61
+ * equally event-hostile in some engines. The poll covers both; link events
62
+ * remain as the settle path for plain <link> fetches.
57
63
  * @internal – exported for testing only.
58
64
  */
59
65
  export declare const stylesheetsReady: (documentClone: Document, logger?: {
package/package.json CHANGED
@@ -19,7 +19,7 @@
19
19
  "default": "./dist/html2canvas-pro.esm.js"
20
20
  }
21
21
  },
22
- "version": "2.5.3",
22
+ "version": "2.5.4",
23
23
  "author": {
24
24
  "name": "yorickshan",
25
25
  "email": "yorickshan@gmail.com",