diff --git a/package.json b/package.json index 6b22eb9..959828f 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "react-dom": ">=16.8" }, "dependencies": { - "html2canvas": "^1.4.1", + "html2canvas-pro": "^1.5.8", "jspdf": "^3.0.1" }, "publishConfig": { diff --git a/scripts/build.js b/scripts/build.js index 41a0ff8..d56a013 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -20,7 +20,7 @@ configs.forEach((config) => { entryPoints: [entryFile], outfile: `${buildDir}/${config.outFile}`, bundle: true, - external: ["react", "react-dom", "jspdf", "html2canvas"], + external: ["react", "react-dom", "jspdf", "html2canvas-pro"], target: "esnext", format: config.format, platform: "neutral", diff --git a/src/index.ts b/src/index.ts index 322083a..e2cf1b7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,5 @@ import { useRef, useCallback } from "react"; -import html2canvas from "html2canvas"; +import html2canvas from "html2canvas-pro"; import Converter from "./converter"; import { Options, TargetElementFinder, UsePDFResult } from "./types"; diff --git a/src/types.ts b/src/types.ts index f1db942..a120b3a 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,6 +1,6 @@ import { MutableRefObject } from "react"; import { jsPDFOptions } from "jspdf"; -import { Options as Html2CanvasOptions } from "html2canvas"; +import { Options as Html2CanvasOptions } from "html2canvas-pro"; import { Margin, Resolution } from "./constants"; export type DetailedMargin = { diff --git a/yarn.lock b/yarn.lock index 1c2297e..d73ed0a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3034,7 +3034,15 @@ html-encoding-sniffer@^4.0.0: dependencies: whatwg-encoding "^3.1.1" -html2canvas@^1.0.0-rc.5, html2canvas@^1.4.1: +html2canvas-pro@^1.5.8: + version "1.5.8" + resolved "https://registry.yarnpkg.com/html2canvas-pro/-/html2canvas-pro-1.5.8.tgz#d40ba9732c455943fc269f0606895ac00bb0c864" + integrity sha512-bVGAU7IvhBwBlRAmX6QhekX8lsaxmYoF6zIwf/HNlHscjx+KN8jw/U4PQRYqeEVm9+m13hcS1l5ChJB9/e29Lw== + dependencies: + css-line-break "^2.1.0" + text-segmentation "^1.0.3" + +html2canvas@^1.0.0-rc.5: version "1.4.1" resolved "https://registry.yarnpkg.com/html2canvas/-/html2canvas-1.4.1.tgz#7cef1888311b5011d507794a066041b14669a543" integrity sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==