Skip to content

Commit 28f85a7

Browse files
fix: change the widthMatch typechecking method in borders resolve helper
- fixes Invalid border width: undefined
1 parent fea5c0d commit 28f85a7

6 files changed

Lines changed: 24 additions & 9 deletions

File tree

packages/layout/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ats-form-react-pdf-layout",
3-
"version": "4.4.2",
3+
"version": "4.4.3",
44
"license": "MIT",
55
"description": "Resolve document component's layout",
66
"author": "Diego Muracciole <diegomuracciole@gmail.com>",
@@ -23,7 +23,7 @@
2323
"@react-pdf/fns": "3.1.2",
2424
"@react-pdf/image": "^3.0.3",
2525
"@react-pdf/primitives": "^4.1.1",
26-
"@react-pdf/stylesheet": "^6.1.1",
26+
"ats-form-react-pdf-stylesheet": "^6.1.2",
2727
"@react-pdf/textkit": "^6.0.0",
2828
"@react-pdf/types": "^2.9.1",
2929
"emoji-regex-xs": "^1.0.0",

packages/renderer/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ats-form-react-pdf-renderer",
3-
"version": "4.3.2",
3+
"version": "4.3.3",
44
"license": "MIT",
55
"description": "Create PDF files on the browser and server",
66
"author": "Diego Muracciole <diegomuracciole@gmail.com>",
@@ -26,7 +26,7 @@
2626
"@babel/runtime": "^7.20.13",
2727
"@react-pdf/fns": "3.1.2",
2828
"@react-pdf/font": "^4.0.3",
29-
"ats-form-react-pdf-layout": "^4.4.2",
29+
"ats-form-react-pdf-layout": "^4.4.3",
3030
"@react-pdf/pdfkit": "^4.0.4",
3131
"@react-pdf/primitives": "^4.1.1",
3232
"@react-pdf/reconciler": "^1.1.4",

packages/stylesheet/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "@react-pdf/stylesheet",
3-
"version": "6.1.1",
2+
"name": "ats-form-react-pdf-stylesheet",
3+
"version": "6.1.2",
44
"license": "MIT",
55
"description": "A styles engine for Node and the browser",
66
"author": "Diego Muracciole <diegomuracciole@gmail.com>",

packages/stylesheet/src/resolve/borders.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,15 @@ const resolveBorderShorthand = <K extends BorderKey>(
2525

2626
if (match) {
2727
const widthMatch = match[1] || value;
28-
const styleMatch = match[4] || value;
28+
const styleMatch = match[4] || value || 'solid';
2929
const colorMatch = match[5] || value;
3030

3131
const style = styleMatch as BorderStyleValue;
3232
const color = colorMatch ? transformColor(colorMatch as string) : undefined;
33-
const width = widthMatch ? transformUnit(container, widthMatch) : undefined;
33+
const width =
34+
typeof widthMatch !== 'undefined'
35+
? transformUnit(container, widthMatch)
36+
: undefined;
3437

3538
if (key.match(/(Top|Right|Bottom|Left)$/)) {
3639
return {

packages/types/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
"dependencies": {
1515
"@react-pdf/font": "^4.0.3",
1616
"@react-pdf/primitives": "^4.1.1",
17-
"@react-pdf/stylesheet": "^6.1.1"
17+
"ats-form-react-pdf-stylesheet": "^6.1.2"
1818
}
1919
}

yarn.lock

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2220,6 +2220,18 @@
22202220
prop-types "^15.6.2"
22212221
queue "^6.0.1"
22222222

2223+
"@react-pdf/stylesheet@^6.1.1":
2224+
version "6.1.1"
2225+
resolved "https://registry.yarnpkg.com/@react-pdf/stylesheet/-/stylesheet-6.1.1.tgz#ade1174e43ce8fc5fe3f8f6598a9426d853050ac"
2226+
integrity sha512-Iyw0A3wRIeQLN4EkaKf8yF9MvdMxiZ8JjoyzLzDHSxnKYoOA4UGu84veCb8dT9N8MxY5x7a0BUv/avTe586Plg==
2227+
dependencies:
2228+
"@react-pdf/fns" "3.1.2"
2229+
"@react-pdf/types" "^2.9.1"
2230+
color-string "^1.9.1"
2231+
hsl-to-hex "^1.0.0"
2232+
media-engine "^1.0.3"
2233+
postcss-value-parser "^4.1.0"
2234+
22232235
"@rollup/plugin-alias@^5.1.0":
22242236
version "5.1.0"
22252237
resolved "https://registry.yarnpkg.com/@rollup/plugin-alias/-/plugin-alias-5.1.0.tgz#99a94accc4ff9a3483be5baeedd5d7da3b597e93"

0 commit comments

Comments
 (0)