Skip to content

Commit

Permalink
Merge branch 'master' into svg-typing
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomura authored Jan 14, 2024
2 parents 8333376 + e01dff4 commit 5edb4c9
Show file tree
Hide file tree
Showing 183 changed files with 4,068 additions and 20,720 deletions.
5 changes: 5 additions & 0 deletions .changeset/eighty-boats-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@react-pdf/layout': minor
---

Upgraded yoga to v2 and dropped bundled yoga v1 package
5 changes: 5 additions & 0 deletions .changeset/eighty-lizards-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@react-pdf/types": patch
---

fix: add clipPath to typing for SVGPresentationAttributes
9 changes: 9 additions & 0 deletions .changeset/gorgeous-dragons-brake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@react-pdf/examples': patch
'@react-pdf/textkit': patch
'@react-pdf/layout': patch
'@react-pdf/pdfkit': patch
'@react-pdf/image': patch
---

fix linting
5 changes: 5 additions & 0 deletions .changeset/mean-taxis-sing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@react-pdf/examples': major
---

add dev script
5 changes: 5 additions & 0 deletions .changeset/moody-jars-relax.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@react-pdf/pdfkit': patch
---

fix: copy-paste for registered font
5 changes: 5 additions & 0 deletions .changeset/wise-parrots-compete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@react-pdf/types": patch
---

Updated svg.d.ts to include strokeLinejoin
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
node_modules
lib
rollup.config.js
packages/yoga/dist
4 changes: 3 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module.exports = {
},
plugins: ['react', 'jest'],
rules: {
'func-names': 0,
'no-continue': 1,
'no-cond-assign': 1,
'react/prop-types': 0,
Expand All @@ -37,7 +38,8 @@ module.exports = {
'import/no-named-as-default': 0,
'react/state-in-constructor': 0,
'react/jsx-filename-extension': 0,
'react/jsx-props-no-spreading': 1,
'react/jsx-props-no-spreading': 0,
'react/destructuring-assignment': 0,
'import/no-unresolved': ['error', { ignore: ['^yoga-layout'] }],
},
};
6 changes: 3 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ We welcome any type of contribution, not only code. You can help with

## Your First Contribution

Working on your first Pull Request? You can learn how from this *free* series, [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github).
Working on your first Pull Request? You can learn how from this *free* series, [How to Contribute to an Open Source Project on GitHub](https://app.egghead.io/series/how-to-contribute-to-an-open-source-project-on-github).

## Set up your development environment

Expand All @@ -30,12 +30,12 @@ git clone https://github.com/diegomura/react-pdf.git
cd react-pdf
```

### 2. Install Node 14
### 2. Install Node 18

If you have `nvm` installed all you have to do is

```sh
nvm install 14
nvm install 18
nvm use
```

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI

env:
FORCE_COLOR: 2
NODE: 14
NODE: 18

on:
pull_request:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Release

env:
FORCE_COLOR: 2
NODE: 14
NODE: 18

on:
push:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ coverage
.idea
.DS_Store
.cache
.parcel-cache
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14
18
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<a href="https://github.com/prettier/prettier">
<img src="https://img.shields.io/badge/styled_with-prettier-ff69b4.svg" />
</a>
<a href="https://app.fossa.com/projects/git%2Bgithub.com%2Fdiegomura%2Freact-pdf?ref=badge_shield" alt="FOSSA Status"><img src="https://app.fossa.com/api/projects/git%2Bgithub.com%2Fdiegomura%2Freact-pdf.svg?type=shield"/></a>
</p>
</p>

Expand Down Expand Up @@ -106,7 +105,5 @@ Thank you to all our backers! [[Become a backer](https://opencollective.com/reac

MIT © [Diego Muracciole](http://github.com/diegomura)

[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fdiegomura%2Freact-pdf.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fdiegomura%2Freact-pdf?ref=badge_large)

---
![](https://img.shields.io/npm/dt/@react-pdf/renderer.svg?style=flat)
1 change: 0 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module.exports = {
projects: [
'<rootDir>packages/fns',
'<rootDir>packages/yoga',
'<rootDir>packages/font',
'<rootDir>packages/image',
'<rootDir>packages/render',
Expand Down
1 change: 0 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
"packages": [
"packages/*"
],
"useWorkspaces": true,
"npmClient": "yarn"
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"prepublish": "lerna run build",
"lint": "eslint packages",
"test": "jest",
"examples": "lerna run start --scope @react-pdf/examples",
"dev": "lerna run dev --scope @react-pdf/examples",
"changeset": "changeset",
"version-packages": "changeset version",
"release": "changeset publish"
Expand Down Expand Up @@ -59,9 +59,9 @@
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"jest-image-snapshot": "^6.1.0",
"lerna": "^3.21.0",
"lerna": "^8.0.2",
"lint-staged": "^10.5.4",
"pdfjs-dist": "3.1.81",
"pdfjs-dist": "3.2.146",
"prettier": "^1.16.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
7 changes: 7 additions & 0 deletions packages/examples/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
extends: ['../../.eslintrc.js', 'plugin:react/recommended'],
rules: {
'react/prop-types': 0,
'jsx-a11y/anchor-is-valid': 0,
},
};
21 changes: 21 additions & 0 deletions packages/examples/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# @react-pdf/examples

## 2.0.14

### Patch Changes

- Updated dependencies []:
- @react-pdf/renderer@3.1.15

## 2.0.13

### Patch Changes

- Updated dependencies []:
- @react-pdf/renderer@3.1.14

## 2.0.12

### Patch Changes

- Updated dependencies [[`3b5e1c7`](https://github.com/diegomura/react-pdf/commit/3b5e1c7c71a0f830ae2b70da8aac2b2bd5015ca3)]:
- @react-pdf/renderer@3.1.13

## 2.0.11

### Patch Changes
Expand Down
1 change: 0 additions & 1 deletion packages/examples/babel.config.js

This file was deleted.

12 changes: 7 additions & 5 deletions packages/examples/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
{
"name": "@react-pdf/examples",
"version": "2.0.11",
"version": "2.0.14",
"license": "MIT",
"private": true,
"author": "Diego Muracciole <diegomuracciole@gmail.com>",
"homepage": "https://github.com/diegomura/react-pdf#readme",
"repository": "git@github.com:diegomura/react-pdf.git",
"main": "lib",
"scripts": {
"test": "jest"
"dev": "vite ./src --open"
},
"dependencies": {
"@react-pdf/renderer": "^3.1.12",
"camelcase": "^6.2.0"
"@react-pdf/renderer": "^3.1.15"
},
"devDependencies": {
"@vitejs/plugin-react": "^4.2.1",
"vite": "^5.0.11"
},
"peerDependencies": {
"react": "^16.8.6 || ^17.0.0",
Expand Down
Binary file added packages/examples/public/Cairo-Regular.ttf
Binary file not shown.
Binary file removed packages/examples/public/NotoSans-Regular.ttf
Binary file not shown.
Binary file added packages/examples/public/Rubik-Regular.ttf
Binary file not shown.
52 changes: 0 additions & 52 deletions packages/examples/public/chart.svg

This file was deleted.

Binary file removed packages/examples/public/font.ttc
Binary file not shown.
Binary file removed packages/examples/public/keifont.ttf
Binary file not shown.
Binary file removed packages/examples/public/miller-banner.ttf
Binary file not shown.
Binary file removed packages/examples/public/test.jpg
Binary file not shown.
Binary file removed packages/examples/public/test2.jpg
Binary file not shown.
63 changes: 63 additions & 0 deletions packages/examples/src/duplicatedImages/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/* eslint react/prop-types: 0 */
/* eslint react/jsx-sort-props: 0 */

import React from 'react'
import { Document, Page, Image, StyleSheet } from '@react-pdf/renderer'

import Quijote1 from '../../public/quijote1.jpg'

const styles = StyleSheet.create({
body: {
paddingTop: 35,
paddingBottom: 65,
paddingHorizontal: 35,
},
image: {
marginVertical: 15,
marginHorizontal: 0,
width: 520,
height: 200,
backgroundColor: 'red',
objectFit: 'fill',
objectPositionX: 'center',
objectPositionY: 'center',
borderWith: 2,
padding: 2,
borderColor: 'blue',
borderStyle: 'solid',
},
image2: {
marginVertical: 15,
marginHorizontal: 0,
width: 300,
backgroundColor: 'green',
objectFit: 'fill',
objectPositionX: 'center',
objectPositionY: 'center',
borderWith: 2,
padding: 2,
borderColor: 'blue',
borderStyle: 'solid',
},
})

const MyDoc = () => {
return (
<Page style={styles.body}>
<Image style={styles.image} src={Quijote1} />
<Image style={styles.image2} src={Quijote1} />
<Image style={styles.image} src={Quijote1} />
<Image style={styles.image2} src={Quijote1} />
</Page>
)
}

const App = () => {
return (
<Document>
<MyDoc />
</Document>
)
}

export default App
52 changes: 52 additions & 0 deletions packages/examples/src/ellipsis/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/* eslint react/prop-types: 0 */
/* eslint react/jsx-sort-props: 0 */

import React from 'react'
import { Document, Page, Text, View, StyleSheet, Font } from '@react-pdf/renderer'

import RobotoFont from "../../public/Roboto-Regular.ttf";

const styles = StyleSheet.create({
body: {
paddingTop: 35,
paddingBottom: 65,
paddingHorizontal: 35,
},
text: {
fontSize: 15,
maxLines: 1,
fontColor: '#000000',
textOverflow: 'ellipsis',
fontFamily: 'Roboto'
},
})

Font.register({
family: "Roboto",
fonts: [
{
src: RobotoFont,
fontWeight: 400,
},
]
});

const MyDoc = () => {
return (
<Page style={styles.body}>
<View style={{ width: 70 }}>
<Text style={styles.text}>And here here</Text>
</View>
</Page>
)
}

const App = () => {
return (
<Document>
<MyDoc />
</Document>
)
}

export default App
Loading

0 comments on commit 5edb4c9

Please sign in to comment.