Commit graph

31 commits

Author SHA1 Message Date
ParaN3xus
b2e286dfb5
fix: fix preview viewport & scrolling to use the preview container instead of window (#2269)
This is a follow-up to #2145 that fixes a series of resulting issues,
including #2267.
2025-11-23 21:02:30 +08:00
Copilot
0714d19e29
feat: add c alias for compile command (#2261)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
Adds `c` as an alias for the `compile` subcommand to match `typst-cli`
behavior where `c = compile`.

## Changes

- Added `#[clap(alias = "c")]` attribute to the `Compile` command
variant
- Added test coverage for `tinymist c --help` and actual compilation via
alias

## Usage

```bash
# Both commands now work identically
tinymist compile input.typ output.pdf
tinymist c input.typ output.pdf
```

<!-- START COPILOT CODING AGENT SUFFIX -->



<details>

<summary>Original prompt</summary>

> 
> ----
> 
> *This section details on the original issue you should resolve*
> 
> <issue_title>Support command alias `c` in tinymist-cli</issue_title>
> <issue_description>### Motivation
> 
> As `typst-cli` has a alias `c = compile`, `tinymist compile` receives
exactly same arguments as `typst compile`, it will be suprise if the
alias itself is not supported.
> 
> May not also applies to other subcommands.
> 
> If this is feasible, I'd be willing to write a PR. This should be
easy.
> 
> ### Description
> 
> _No response_
> 
> ### More Examples/Questions
> 
> _No response_</issue_description>
> 
> ## Comments on the Issue (you are @copilot in this section)
> 
> <comments>
> </comments>
> 


</details>

- Fixes Myriad-Dreamin/tinymist#2259

<!-- START COPILOT CODING AGENT TIPS -->
---

 Let Copilot coding agent [set things up for
you](https://github.com/Myriad-Dreamin/tinymist/issues/new?title=+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Myriad-Dreamin <35292584+Myriad-Dreamin@users.noreply.github.com>
2025-11-20 03:29:31 +08:00
ParaN3xus
70d3443656
feat: replace window global with windowElem in preview web frontend (#2145)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
The preview feature heavily relies on the global `window` object. This
forces the preview to be used only as a standalone page.

In this PR, I replaced `window` with `windowElem` to make the preview
component modular and reusable.

TODO:
- [x] Fix `handleTypstLocation`
- [x] Fix zoon center
- [x] Fix drag
- [ ] Do a comprehensive test
  - [x] `handleTypstLocation` under both canvas mode and SVG mode
  - [ ] other stuff (idk what yet)
2025-11-02 17:34:20 +08:00
Myriad-Dreamin
f2a10fec2f
build: bump version to 0.14.0-rc1 (#2189)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
+tag v0.14.0-rc1
2025-10-29 12:22:35 +08:00
Myriad-Dreamin
cba1d34064
build: bump version to 0.13.30-rc2 (#2195)
+tag v0.13.30-rc2
2025-10-27 13:54:11 +08:00
hyrious
c7b10d1b6c
feat: preview page remove extra space and do not invert background (#2094)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
| Before | After |
| ------ | ----- |
| <img width="300" height="246" alt="image"
src="https://github.com/user-attachments/assets/3f1e9d69-390c-46ce-8469-52d90c052fed"
/> | <img width="303" height="243" alt="image"
src="https://github.com/user-attachments/assets/4b70a9d2-07c6-496e-82df-d0ad27bd582e"
/> |

1. The `svg` element by default has `display: inline`, which adds extra
space at bottom (line height), change that to `block` can remove the
space.
2. The `svg` element and its outer `div` both set background color,
which will be inverted to another color that are not equal to the whole
page's background (I was setting `--main-margin` to see the outside).
This PR prevents the background from getting inverted.

There's another tiny thing: `#typst-container.mode-doc` has `margin-top:
-1px` which shifts the whole Typst doc 1px up. That will cause the page
always has 1px margin at bottom because the SVG element has the full
height. One possible fix is to always `- 1px` on the SVG `height`
attribute but I'm not sure if this affects some calculation. So I'm not
adding this trivial change.
2025-09-02 12:55:12 +08:00
Myriad-Dreamin
40cbe07ea5
build: bump reflexo to 0.6.1-rc3 (#2074) 2025-08-25 05:22:30 +08:00
Myriad-Dreamin
3c40385cd2
build: bump version to 0.13.16-rc2 (#1919)
* build: bump version to 0.13.16-rc2

* docs: update changelog

* fix: update reflexo versions

* build: bump asset crates
2025-07-24 01:37:42 +08:00
Myriad-Dreamin
e6c1894ce4
build: bump world crates to 0.13.16-rc1 (#1905)
* docs: update changelog

* build: bump world crates to 0.13.16-rc1

* build: bump reflexo crates to pre v0.6.1-rc2
2025-07-16 12:28:05 +08:00
Myriad-Dreamin
9bb784e6f0
feat: run prettier correctly (#1893) 2025-07-09 19:34:57 +08:00
Myriad-Dreamin
2b7482b263
fix: bidirectional jump in slide mode (#1873)
Some checks are pending
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2022) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-07-06 00:34:24 +08:00
Myriad-Dreamin
32bd813be6
refactor: fmt (#1872) 2025-07-05 23:25:27 +08:00
Myriad-Dreamin
f33ea4913c
build: bump typst.ts to v0.6.0-rc1 (#1707)
* build: bump typst.ts to v0.6.0-rc1

* build: update lock and docs
2025-04-29 12:46:16 +08:00
Myriad-Dreamin
51530034f7
fix: use the background rect to calculate cursor position in the page (#1427) 2025-02-28 01:40:19 +08:00
Myriad-Dreamin
7faef58186
build: bump reflexo to v0.5.5-rc7 (#1414) 2025-02-27 11:41:45 +08:00
Myriad-Dreamin
21c6492254
feat: use jump_from_click from typst-ide (#1399) 2025-02-25 19:15:05 +08:00
Myriad-Dreamin
15f2329bc1
fix: use new wasm renderer (#1398) 2025-02-25 14:47:54 +08:00
Myriad-Dreamin
5659b0bc6c
dev: move package to reflexo_world part (#1177)
* dev: move package to reflexo_world part

fix: compile error

* dev: update the package.json

* fix: compile error

* dev: remove dry compile
2025-01-16 10:13:37 +08:00
tmistele
6813a1081e
feat: rescale with ctrl/cmd + =/- in browser (#1110)
* feat: Rescaling with Ctrl+=/- in browser (in addition to ctrl+wheel)

* Change function name also in comment

* Use Command instead of Ctrl on Macs

to match default key bindings in browsers
2025-01-13 10:05:17 +08:00
b18c3ca71c
fix: compatibility for some old chromium core (#995)
* fix: compatibility for some old chromium core

* feat: resolve relative URL manually

* dev: revert the change

* dev: add some comment

* fix: wrong regrex in 50228956

* dev: upgrade version to use

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2024-12-14 14:41:28 +08:00
Caleb Maclennan
6f4aba4aa8 chore: Fix typos throughout code base (automatic)
This is all the typos that `typos` is confident can just be fixed
automatically, minus the overrides added to the manifest for the false
positives I found.
2024-11-25 09:26:53 +08:00
Myriad-Dreamin
52a8d0e678
build: bump version to 0.12.2-rc1 (#827)
* build: bump packages

* docs: update changelog

* build: bump version to 0.12.2-rc1

* chore: wording

* fix: errors

* fix: wording
2024-11-15 15:19:59 +08:00
Myriad-Dreamin
66fff06dfe
build: bump tinymist to 0.12.0-rc1 (#708)
* feat: support nightly typst (#600)

* feat: support for custom certificate configuration (#592)

* feat: add certificate option

* refactor: move SystemCompilerFeat into tinymist-world

* feat: move HttpRegistry as HttpsRegistry into tinymist-world

* feat: add reading pem file

* feat: update LspUniverseBuilder::build

* feat: fill missing argument of LspUniverseBuilder::build

* chore: update lock file for additional dependencies

* chore:  refine comment for certification

* refactor: simplify by new constructor

* refactor: sort arguments for threaded_http

* refactor: split https.rs from lib.rs in tinymist-world

* feat: provide package view and local documentation (#596)

* feat: move featured components

* feat: provide package view and local documentation

* stage

* fix: compile error by merged commits

* fix: ignore system fonts correctly (#597)

* feat: adapt nightly typst

chore: use mainline typst

fix: `leaf_at` second parameter

fix: build `Engine`

fix: `interpret_mode_at` converage

feat: use my typst

fix: use `typst::trace` to trace

fix: frameitem

fix: new kinds

fix: new scope

fix: lazyhash

fix: result

fix: new SyntaxKinds

fix: utils, lazyhash

chore: remove useless imports

fix: sink

feat: frameitem

fix: export svg with page

fix: deref span

styl:

deps

fix: lazyhash

deps: use my typstyle

fix: enable contenthint with feature

fix: leaf_at side

fix: compile.output

deps

fix: warnings

deps: use new branch name

fix: fix merge error

ci: update ci branch

test: accept new test snap

fix: fix compile

deps: update typst

fix: fix compilation for latest tinymist

fix: fix tests

fix: fix tests

* chore: clean useless imports

---------

Co-authored-by: ricOC3 <100465762+ricOC3@users.noreply.github.com>
Co-authored-by: Myriad-Dreamin <35292584+Myriad-Dreamin@users.noreply.github.com>

* fix: compile warnings and errors

* fix: add round_2 back

* fix: pdf options

* build: bump version to 0.11.33

build: bump version to 0.11.31 (#652)

build: lock git branches

build: bump version to 0.11.23-rc1

dev: update cargo.toml

deps: update typst, typst.ts, typstyle to tagged version (#624)

build: bump version to 0.11.29 (#628)

dev: nightly-0.11.31 (#649)

* deps: update typst

* test: fix snapshot

fix: dependencies

dev: nightly 0.11.33 (#655)

* deps: update typst, typst.ts, typstyle

* test: fix test hash

* fix: compile error

* fix: errors

* build: bump typst to 0.12.0

* dev: final bumps

* build: bump version to 0.11.34-rc1

* build: update cargo.lock

* test: update snapshot

---------

Co-authored-by: ParaN3xus <136563585+ParaN3xus@users.noreply.github.com>
Co-authored-by: ricOC3 <100465762+ricOC3@users.noreply.github.com>
2024-10-19 18:32:37 +08:00
Myriad-Dreamin
3aa8f1233d
fix: check existence of requestIdleCallback before uses (#643) 2024-10-07 14:18:45 +08:00
Myriad-Dreamin
fbd22d2601
build: bump typst.ts to v0.5.0-rc7 (#554)
* dev: sync typ_server code

* build: bump typst.ts to v0.5.0-rc7
2024-08-25 17:43:54 +08:00
Myriad-Dreamin
22aea0e075
dev: intern vscode-variable package (#460)
* dev: intern vscode-variable package

* dev: add vitest

* dev: add tests

* fix: a bug

* dev: less global state

* dev: less bug-prone construction
2024-07-26 12:47:26 +08:00
Myriad-Dreamin
0d84553390
fix: broken content preview (#413)
* fix: broken outline

* fix: render mode
2024-07-14 19:00:13 +08:00
Myriad-Dreamin
27a0aa9e2b
feat: use requestIdleCallback to wait for updating canvas pages when editor is in idle (#412)
* dev: use local frontend files

* very lazy
2024-07-14 17:52:55 +08:00
Myriad-Dreamin
46f6342a50
dev: reformat code (#369) 2024-07-14 15:15:30 +08:00
Myriad-Dreamin
7f1de87765
build: bump version to 0.11.12 (#352)
* build: bump dependencies

* docs: update changelog

* build: bump version to 0.11.12

* chore: stupid patch
2024-06-28 09:08:09 +08:00
Myriad-Dreamin
bb9f30fcdf
feat: move typst-preview to tinymist (#323)
* merge preview crates

Co-authored-by: mgt <mgt@oi-wiki.org>
Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
Co-authored-by: slanterns <slanterns.w@gmail.com>
Co-authored-by: Bubbleioa <1342130847@QQ.com>
Co-authored-by: 7mile <i@7li.moe>
Co-authored-by: 7sDream <7822577+7sDream@users.noreply.github.com>
Co-authored-by: Aldric.li <31800073+Parsifa1@users.noreply.github.com>
Co-authored-by: Andrew Voynov <37143421+Andrew15-5@users.noreply.github.com>
Co-authored-by: AsukaMinato <i@asukaminato.eu.org>
Co-authored-by: Banson <xzcxzcyy@126.com>
Co-authored-by: Kian-Meng Ang <kianmeng.ang@gmail.com>
Co-authored-by: Marlon Regenhardt <marlon.r@hotmail.de>
Co-authored-by: OrangeX4 <34951714+OrangeX4@users.noreply.github.com>
Co-authored-by: Severi Salminen <severi.salminen@iki.fi>
Co-authored-by: Wisha W <49518157+wishawa@users.noreply.github.com>
Co-authored-by: werifu <wohu1363195380@outlook.com>

* chore: minimize images

* feat: move typst-preview to tinymist

* build: merge npm dependencies

* build: merge npm dependencies 2

* build: use assets TYPST_PREVIEW_HTML

* build(ci): bundle typst-preview package

* dev: add convenient script for building

* build: update yarn.lock

---------

Co-authored-by: mgt <mgt@oi-wiki.org>
Co-authored-by: slanterns <slanterns.w@gmail.com>
Co-authored-by: Bubbleioa <1342130847@QQ.com>
Co-authored-by: 7mile <i@7li.moe>
Co-authored-by: 7sDream <7822577+7sDream@users.noreply.github.com>
Co-authored-by: Aldric.li <31800073+Parsifa1@users.noreply.github.com>
Co-authored-by: Andrew Voynov <37143421+Andrew15-5@users.noreply.github.com>
Co-authored-by: AsukaMinato <i@asukaminato.eu.org>
Co-authored-by: Banson <xzcxzcyy@126.com>
Co-authored-by: Kian-Meng Ang <kianmeng.ang@gmail.com>
Co-authored-by: Marlon Regenhardt <marlon.r@hotmail.de>
Co-authored-by: OrangeX4 <34951714+OrangeX4@users.noreply.github.com>
Co-authored-by: Severi Salminen <severi.salminen@iki.fi>
Co-authored-by: Wisha W <49518157+wishawa@users.noreply.github.com>
Co-authored-by: werifu <wohu1363195380@outlook.com>
2024-06-17 17:22:45 +08:00