diff --git a/packages/font/package.json b/packages/font/package.json index 0a4cd6b43..deca2e7c9 100644 --- a/packages/font/package.json +++ b/packages/font/package.json @@ -23,7 +23,7 @@ }, "dependencies": { "@babel/runtime": "^7.16.4", - "@react-pdf/types": "^2.0.9", + "@react-pdf/types": "stonesthatwhisper/react-pdf#react-pdf-types-v2.1.0-gitpkg", "cross-fetch": "^3.1.5", "fontkit": "^2.0.2", "is-url": "^1.2.4" diff --git a/packages/image/src/resolve.js b/packages/image/src/resolve.js index 4f4592f0e..d9eaee2ef 100644 --- a/packages/image/src/resolve.js +++ b/packages/image/src/resolve.js @@ -144,12 +144,12 @@ const getImageFormat = body => { }; const resolveImageFromUrl = async src => { - const { uri, body, headers, method = 'GET' } = src; + const { uri, body, headers, method = 'GET', credentials = 'omit' } = src; const data = !BROWSER && getAbsoluteLocalPath(uri) ? await fetchLocalFile(uri) - : await fetchRemoteFile(uri, { body, headers, method }); + : await fetchRemoteFile(uri, { body, headers, method, credentials }); const extension = getImageFormat(data); diff --git a/packages/layout/package.json b/packages/layout/package.json index 5a63230db..6fc1afa73 100644 --- a/packages/layout/package.json +++ b/packages/layout/package.json @@ -25,7 +25,7 @@ "@react-pdf/primitives": "^3.0.0", "@react-pdf/stylesheet": "^4.0.0", "@react-pdf/textkit": "^4.1.0", - "@react-pdf/types": "^2.1.0", + "@react-pdf/types": "stonesthatwhisper/react-pdf#react-pdf-types-v2.1.0-gitpkg", "@react-pdf/yoga": "^3.0.0", "cross-fetch": "^3.1.5", "emoji-regex": "^8.0.0", diff --git a/packages/render/package.json b/packages/render/package.json index 201098aa0..d859744c0 100644 --- a/packages/render/package.json +++ b/packages/render/package.json @@ -22,7 +22,7 @@ "@react-pdf/fns": "2.0.0", "@react-pdf/primitives": "^3.0.0", "@react-pdf/textkit": "^4.1.0", - "@react-pdf/types": "^2.1.0", + "@react-pdf/types": "stonesthatwhisper/react-pdf#react-pdf-types-v2.1.0-gitpkg", "abs-svg-path": "^0.1.1", "color-string": "^1.5.3", "normalize-svg-path": "^1.1.0", diff --git a/packages/renderer/package.json b/packages/renderer/package.json index 2fe36d028..2974c22d9 100644 --- a/packages/renderer/package.json +++ b/packages/renderer/package.json @@ -31,7 +31,7 @@ "@react-pdf/pdfkit": "^3.0.0", "@react-pdf/primitives": "^3.0.0", "@react-pdf/render": "^3.2.1", - "@react-pdf/types": "^2.1.0", + "@react-pdf/types": "stonesthatwhisper/react-pdf#react-pdf-types-v2.1.0-gitpkg", "queue": "^6.0.1", "react-reconciler": "^0.23.0", "scheduler": "^0.17.0" diff --git a/packages/stylesheet/package.json b/packages/stylesheet/package.json index 34b832b05..259fbe8a8 100644 --- a/packages/stylesheet/package.json +++ b/packages/stylesheet/package.json @@ -20,7 +20,7 @@ "dependencies": { "@babel/runtime": "^7.16.4", "@react-pdf/fns": "2.0.0", - "@react-pdf/types": "^2.1.0", + "@react-pdf/types": "stonesthatwhisper/react-pdf#react-pdf-types-v2.1.0-gitpkg", "color-string": "^1.5.3", "hsl-to-hex": "^1.0.0", "media-engine": "^1.0.3", diff --git a/packages/types/image.d.ts b/packages/types/image.d.ts index 9cba13a06..d75c6130d 100644 --- a/packages/types/image.d.ts +++ b/packages/types/image.d.ts @@ -6,7 +6,7 @@ type SourceBuffer = Buffer type SourceDataBuffer = { data: Buffer; format: 'png' | 'jpg' } -type SourceURLObject = { uri: string; method: HTTPMethod; body: any; headers: any } +type SourceURLObject = { uri: string; method: HTTPMethod; body: any; headers: any; credentials: string } type Source = | SourceURL diff --git a/yarn.lock b/yarn.lock index f71395229..f0b504a2c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2309,6 +2309,10 @@ dependencies: "@octokit/openapi-types" "^6.0.0" +"@react-pdf/types@stonesthatwhisper/react-pdf#react-pdf-types-v2.1.0-gitpkg": + version "2.1.0" + resolved "https://codeload.github.com/stonesthatwhisper/react-pdf/tar.gz/077a77ad455e70a418b34ccebe3b7995a814691b" + "@rollup/plugin-alias@^3.1.8": version "3.1.8" resolved "https://registry.yarnpkg.com/@rollup/plugin-alias/-/plugin-alias-3.1.8.tgz#645fd84659e08d3d1b059408fcdf69c1dd435a6b"