From 843c0c8eb394b175381b97c590a16c94d61f1cad Mon Sep 17 00:00:00 2001 From: SirBlobby Date: Sun, 19 Jul 2026 12:15:50 -0400 Subject: [PATCH] Update Typst Version to Latest --- README.md | 2 +- bun.lock | 4 ++-- package.json | 28 ++++++++++++++-------------- src-tauri/Cargo.toml | 4 ++-- src-tauri/src/compiler.rs | 7 ++++--- src-tauri/src/lib.rs | 2 +- 6 files changed, 24 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 3b9e61e..e5bf4a6 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Version](https://img.shields.io/badge/version-1.0.0-blue.svg)](https://github.com/sirblobby/typst-desktop) [![License](https://img.shields.io/badge/license-Apache_2.0-green.svg)](LICENSE) -[![Typst Version](https://img.shields.io/badge/Typst-0.14.2-239dad?logo=typst&logoColor=white)](https://typst.app/) +[![Typst Version](https://img.shields.io/badge/Typst-0.15.1-239dad?logo=typst&logoColor=white)](https://typst.app/) [![Rust](https://img.shields.io/badge/Rust-1.82+-orange?logo=rust&logoColor=white)](https://www.rust-lang.org/) [![Tauri](https://img.shields.io/badge/Tauri-2-24C8DB?logo=tauri&logoColor=white)](https://tauri.app/) [![SvelteKit](https://img.shields.io/badge/SvelteKit-5-ff3e00?logo=svelte)](https://kit.svelte.dev/) diff --git a/bun.lock b/bun.lock index 55f3723..8b70148 100644 --- a/bun.lock +++ b/bun.lock @@ -190,7 +190,7 @@ "@sveltejs/adapter-static": ["@sveltejs/adapter-static@3.0.10", "", { "peerDependencies": { "@sveltejs/kit": "^2.0.0" } }, "sha512-7D9lYFWJmB7zxZyTE/qxjksvMqzMuYrrsyh1f4AlZqeZeACPRySjbC3aFiY55wb1tWUaKOQG9PVbm74JcN2Iew=="], - "@sveltejs/kit": ["@sveltejs/kit@2.70.0", "", { "dependencies": { "@standard-schema/spec": "^1.0.0", "@sveltejs/acorn-typescript": "^1.0.9", "@types/cookie": "^0.6.0", "acorn": "^8.16.0", "cookie": "^0.6.0", "devalue": "^5.8.1", "esm-env": "^1.2.2", "kleur": "^4.1.5", "magic-string": "^0.30.5", "mrmime": "^2.0.0", "set-cookie-parser": "^3.0.0", "sirv": "^3.0.0" }, "peerDependencies": { "@opentelemetry/api": "^1.0.0", "@sveltejs/vite-plugin-svelte": "^3.0.0 || ^4.0.0-next.1 || ^5.0.0 || ^6.0.0-next.0 || ^7.0.0", "svelte": "^4.0.0 || ^5.0.0-next.0", "typescript": "^5.3.3 || ^6.0.0", "vite": "^5.0.3 || ^6.0.0 || ^7.0.0-beta.0 || ^8.0.0" }, "optionalPeers": ["@opentelemetry/api", "typescript"], "bin": { "svelte-kit": "svelte-kit.js" } }, "sha512-5pBnJwdNzxbrxp1TLK1NPMFF0Cx57iZUDKInznKcfifYR9m9poWfZI2Tfhw6BZIjYor5dXvcibt4EQgar3k6ww=="], + "@sveltejs/kit": ["@sveltejs/kit@2.70.1", "", { "dependencies": { "@standard-schema/spec": "^1.0.0", "@sveltejs/acorn-typescript": "^1.0.9", "@types/cookie": "^0.6.0", "acorn": "^8.16.0", "cookie": "^0.6.0", "devalue": "^5.8.1", "esm-env": "^1.2.2", "kleur": "^4.1.5", "magic-string": "^0.30.5", "mrmime": "^2.0.0", "set-cookie-parser": "^3.0.0", "sirv": "^3.0.0" }, "peerDependencies": { "@opentelemetry/api": "^1.0.0", "@sveltejs/vite-plugin-svelte": "^3.0.0 || ^4.0.0-next.1 || ^5.0.0 || ^6.0.0-next.0 || ^7.0.0", "svelte": "^4.0.0 || ^5.0.0-next.0", "typescript": "^5.3.3 || ^6.0.0", "vite": "^5.0.3 || ^6.0.0 || ^7.0.0-beta.0 || ^8.0.0" }, "optionalPeers": ["@opentelemetry/api", "typescript"], "bin": { "svelte-kit": "svelte-kit.js" } }, "sha512-nY9SPHGOZro3doud9vZXDBwl9tCZIouuJztjgSHs6PAIrv9M/z5O7eOhPV5xU7CgVHA976Jwu3BA1hIFvXztkA=="], "@sveltejs/load-config": ["@sveltejs/load-config@0.2.0", "", {}, "sha512-1LgZ/qUqSoq+QorD83lk2hka79Px0wXNW2q5V1nZlxGhQgw1jrsIbVz5YiCeucVLo4XvFLjXukUaQjIiqowkcg=="], @@ -286,7 +286,7 @@ "@tauri-apps/cli-win32-x64-msvc": ["@tauri-apps/cli-win32-x64-msvc@2.11.4", "", { "os": "win32", "cpu": "x64" }, "sha512-+vDiqBIU5dMISg/wNvX3sF+ZHfgJGJ5T0AcO+EHNXV9GGAG+P5fzodlDXD3QdKCRgZxMoCm5PPvj3BqLNjBthw=="], - "@tauri-apps/plugin-dialog": ["@tauri-apps/plugin-dialog@2.7.1", "", { "dependencies": { "@tauri-apps/api": "^2.11.0" } }, "sha512-OK1UBXYt+ojcmxMktzzuyonYIFta8CmAASpX+CA+DTGK24KlHjhYI6x2iOJ/TjZF4N7/ACK1oFmEOjIY9IhzOQ=="], + "@tauri-apps/plugin-dialog": ["@tauri-apps/plugin-dialog@2.7.2", "", { "dependencies": { "@tauri-apps/api": "^2.11.0" } }, "sha512-pX0IGm1I3I6wc+zeKYcq1GSqogK6okCNX5fOdaNU5ab1AjGS6l1E5wFNjEb7meg7ZFSp0JUs+0jQGQNyOvLrsg=="], "@tauri-apps/plugin-opener": ["@tauri-apps/plugin-opener@2.5.4", "", { "dependencies": { "@tauri-apps/api": "^2.11.0" } }, "sha512-1HnPkb+AmgO29HBazm4uPLKB+r7zzcTBW1d0fyYp1uP+jwtpoiNDGKMMzz58SFp49nOIrxdE3aUJtT57lfO9CQ=="], diff --git a/package.json b/package.json index a5de52b..d22d63a 100644 --- a/package.json +++ b/package.json @@ -14,27 +14,27 @@ }, "license": "Apache-2.0", "dependencies": { - "@codemirror/autocomplete": "^6.20.2", - "@codemirror/commands": "^6.10.3", - "@codemirror/language": "^6.10.8", - "@codemirror/legacy-modes": "^6.5.1", - "@codemirror/lint": "^6.9.6", - "@codemirror/lsp-client": "^6.2.4", - "@codemirror/state": "^6.6.0", - "@codemirror/view": "^6.43.0", - "@iconify/svelte": "^5.2.1", - "@lezer/highlight": "^1.2.1", + "@codemirror/autocomplete": "^6.20.3", + "@codemirror/commands": "^6.10.4", + "@codemirror/language": "^6.12.4", + "@codemirror/legacy-modes": "^6.5.3", + "@codemirror/lint": "^6.9.7", + "@codemirror/lsp-client": "^6.2.5", + "@codemirror/state": "^6.7.1", + "@codemirror/view": "^6.43.6", + "@iconify/svelte": "^5.2.2", + "@lezer/highlight": "^1.2.3", "@tauri-apps/api": "^2.11.1", - "@tauri-apps/plugin-dialog": "^2.4.1", + "@tauri-apps/plugin-dialog": "^2.7.2", "@tauri-apps/plugin-opener": "^2.5.4", "codemirror": "^6.0.2", "codemirror-lang-typst": "^0.4.0" }, "devDependencies": { "@sveltejs/adapter-static": "^3.0.10", - "@tailwindcss/vite": "^4.3.0", - "tailwindcss": "^4.3.0", - "@sveltejs/kit": "^2.70.0", + "@tailwindcss/vite": "^4.3.3", + "tailwindcss": "^4.3.3", + "@sveltejs/kit": "^2.70.1", "@sveltejs/vite-plugin-svelte": "^5.1.1", "svelte": "^5.56.6", "svelte-check": "^4.7.3", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index eccd063..214202e 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -26,14 +26,14 @@ serde = { version = "1", features = ["derive"] } serde_json = "1" rusqlite = { version = "0.32", features = ["bundled"] } -typst = { version = "0.14.2", path = "../../typstdrive/typst/crates/typst" } +typst = { version = "0.15.1", path = "../../typstdrive/typst/crates/typst" } typst-kit = { path = "../../typstdrive/typst/crates/typst-kit", features = ["system-downloader", "system-packages", "embedded-fonts"] } typst-pdf = { path = "../../typstdrive/typst/crates/typst-pdf" } typst-render = { path = "../../typstdrive/typst/crates/typst-render" } typst-svg = { path = "../../typstdrive/typst/crates/typst-svg" } typst-html = { path = "../../typstdrive/typst/crates/typst-html" } typst-layout = { path = "../../typstdrive/typst/crates/typst-layout" } -typst-assets = { version = "0.14.2", features = ["fonts"] } +typst-assets = { version = "0.15.1", features = ["fonts"] } chrono = { version = "0.4", features = ["serde"] } sha2 = "0.10" diff --git a/src-tauri/src/compiler.rs b/src-tauri/src/compiler.rs index 80f1133..8b39bdc 100644 --- a/src-tauri/src/compiler.rs +++ b/src-tauri/src/compiler.rs @@ -2,8 +2,9 @@ use serde::Serialize; use std::collections::HashMap; use typst::diag::Warned; use typst::layout::{Frame, FrameItem}; +use typst::utils::Scalar; use typst::WorldExt; -use typst_html::HtmlDocument; +use typst_html::{HtmlDocument, HtmlOptions}; use typst_layout::PagedDocument; use typst_pdf::{pdf, PdfOptions}; use typst_render::{render, RenderOptions}; @@ -174,7 +175,7 @@ pub fn export_png( warnings: _, } => { let options = RenderOptions { - pixel_per_pt: 2.0, + pixel_per_pt: Scalar::new(2.0), ..RenderOptions::default() }; match document.pages().first() { @@ -207,7 +208,7 @@ pub fn export_html( } => return Err(collect_diagnostics(&world, &source_text, errors)), }; - typst_html::html(&document) + typst_html::html(&document, &HtmlOptions::default()) .map(|html| html.into_bytes()) .map_err(|errors| collect_diagnostics(&world, &source_text, errors)) } diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 74b60dc..5d52f50 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -70,7 +70,7 @@ pub struct AppInfo { fn app_info() -> AppInfo { AppInfo { version: env!("CARGO_PKG_VERSION").to_string(), - typst_version: "0.14.2".to_string(), + typst_version: "0.15.1".to_string(), authors: "SirBlobby".to_string(), license: "Apache-2.0".to_string(), tauri_version: tauri::VERSION.to_string(),