Skip to content

Commit 77faa60

Browse files
committed
fix(html2canvas): the operation is insecure
1 parent 45adb3a commit 77faa60

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"file-saver": "^2.0.5",
6565
"html-react-parser": "^5.1.12",
6666
"html-to-image": "^1.11.11",
67-
"html2canvas": "^1.4.1",
67+
"html2canvas-pro": "^1.5.8",
6868
"jszip": "^3.10.1",
6969
"lucide": "^0.428.0",
7070
"lucide-react": "^0.428.0",

pnpm-lock.yaml

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/header/header.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export function Header(props: HeaderProps) {
7474
const [imageDialogOpen, setImageDialogOpen] = useState(false)
7575
const [dialogType, setDialogType] = useState<DialogType>('save_file')
7676
const [isExporting, setIsExporting] = useState(true)
77-
const [scale, setScale] = useState('1')
77+
const [scale, setScale] = useState('3')
7878
const platform = usePlatform()
7979
const { contents, setContents, previewRef, templateName, theme, setTemplateName, setTheme, setTableValue } = props
8080
const { toast } = useToast()
@@ -260,7 +260,7 @@ export function Header(props: HeaderProps) {
260260
async function handleImageExportDialogOpen() {
261261
setImageDialogOpen(true)
262262
setIsExporting(true)
263-
setScale('1')
263+
setScale('3')
264264
// open preview
265265
setTableValue && setTableValue('preview')
266266
}

src/components/header/utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import html2canvas from 'html2canvas'
1+
import html2canvas from 'html2canvas-pro'
22
import { toBlob } from 'html-to-image'
33
import UPNG from '@pdf-lib/upng'
44
import ExifReader from 'exifreader'

0 commit comments

Comments
 (0)