├── .prettierignore ├── public ├── resources │ └── .gitkeep ├── icon.ico ├── icon.png ├── transparent.png ├── transparent-64.png ├── transparent.svg └── icon.svg ├── python ├── README.md ├── .python-version ├── src │ └── tyx_schema │ │ └── __init__.py ├── pyproject.toml └── tests │ └── test_examples.py ├── docs ├── CHANGELOG.md ├── _static │ ├── icon.ico │ ├── icon.png │ ├── keyboard-map.gif │ ├── keyboard-map.mp4 │ ├── math-editor.gif │ ├── math-editor.mp4 │ ├── function-calls.png │ └── keyboard-shortcuts.png ├── pyproject.toml ├── requirements.txt ├── getting-started.md ├── configuration.md └── index.md ├── .github ├── FUNDING.yml └── workflows │ ├── lint.yml │ └── publish.yml ├── src ├── backend │ ├── index.ts │ ├── base.ts │ └── common.ts ├── vite-env.d.ts ├── state.ts ├── components │ ├── plugins │ │ ├── updateLocalStorage.ts │ │ ├── tableCommands.ts │ │ ├── utilities.ts │ │ ├── CodeHighlightPlugin.tsx │ │ ├── keyboardMap.ts │ │ ├── CurrentEditorPlugin.tsx │ │ ├── ImagePlugin.tsx │ │ ├── tyxCommands.ts │ │ ├── UpdateLocalStoragePlugin.tsx │ │ ├── RemoveDefaultShortcutsPlugin.tsx │ │ ├── RTLPlugin.tsx │ │ ├── TableCommandsPlugin.tsx │ │ ├── image.ts │ │ ├── typstCode.ts │ │ ├── math.ts │ │ ├── TypstCodePlugin.tsx │ │ └── NestedEditorPlugin.tsx │ ├── CommandButton.tsx │ ├── SaveAsModal.tsx │ ├── CommandActionIcon.tsx │ ├── TyXLengthEditor.tsx │ ├── MathInlineShortcutEditor.tsx │ ├── TyXValueEditor.tsx │ ├── KeyboardShortcutEditor.tsx │ ├── UpdateChecker.tsx │ ├── DocumentTabs.tsx │ ├── Editor.tsx │ └── WelcomeScreen.tsx ├── models │ ├── index.ts │ ├── functions.ts │ ├── settings.ts │ ├── values.ts │ └── document.ts ├── translations │ ├── index.ts │ ├── he.json │ └── en.json ├── settings.ts ├── resources │ └── playground-ext.tsx ├── main.tsx ├── functions.ts ├── format.ts ├── utilities │ ├── hooks.ts │ └── index.tsx ├── config.ts ├── App.tsx ├── index.css └── shortcuts.ts ├── src-tauri ├── build.rs ├── icons │ ├── icon.ico │ ├── icon.png │ ├── 32x32.png │ ├── icon.icns │ ├── 128x128.png │ ├── StoreLogo.png │ ├── 128x128@2x.png │ ├── Square30x30Logo.png │ ├── Square44x44Logo.png │ ├── Square71x71Logo.png │ ├── Square89x89Logo.png │ ├── Square107x107Logo.png │ ├── Square142x142Logo.png │ ├── Square150x150Logo.png │ ├── Square284x284Logo.png │ ├── Square310x310Logo.png │ ├── ios │ │ ├── AppIcon-512@2x.png │ │ ├── AppIcon-20x20@1x.png │ │ ├── AppIcon-20x20@2x.png │ │ ├── AppIcon-20x20@3x.png │ │ ├── AppIcon-29x29@1x.png │ │ ├── AppIcon-29x29@2x.png │ │ ├── AppIcon-29x29@3x.png │ │ ├── AppIcon-40x40@1x.png │ │ ├── AppIcon-40x40@2x.png │ │ ├── AppIcon-40x40@3x.png │ │ ├── AppIcon-60x60@2x.png │ │ ├── AppIcon-60x60@3x.png │ │ ├── AppIcon-76x76@1x.png │ │ ├── AppIcon-76x76@2x.png │ │ ├── AppIcon-20x20@2x-1.png │ │ ├── AppIcon-29x29@2x-1.png │ │ ├── AppIcon-40x40@2x-1.png │ │ └── AppIcon-83.5x83.5@2x.png │ └── android │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_round.png │ │ └── ic_launcher_foreground.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_round.png │ │ └── ic_launcher_foreground.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_round.png │ │ └── ic_launcher_foreground.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_round.png │ │ └── ic_launcher_foreground.png │ │ └── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_round.png │ │ └── ic_launcher_foreground.png ├── gen │ └── android │ │ ├── settings.gradle │ │ ├── app │ │ ├── src │ │ │ └── main │ │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── tyx_editor │ │ │ │ │ └── tyx │ │ │ │ │ └── MainActivity.kt │ │ │ │ ├── res │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ ├── values │ │ │ │ │ ├── strings.xml │ │ │ │ │ ├── themes.xml │ │ │ │ │ └── colors.xml │ │ │ │ ├── xml │ │ │ │ │ └── file_paths.xml │ │ │ │ ├── values-night │ │ │ │ │ └── themes.xml │ │ │ │ ├── layout │ │ │ │ │ └── activity_main.xml │ │ │ │ └── drawable-v24 │ │ │ │ │ └── ic_launcher_foreground.xml │ │ │ │ └── AndroidManifest.xml │ │ ├── .gitignore │ │ ├── proguard-rules.pro │ │ └── build.gradle.kts │ │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ │ ├── .editorconfig │ │ ├── .gitignore │ │ ├── buildSrc │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── noamzaks │ │ │ └── tyx │ │ │ └── kotlin │ │ │ ├── BuildTask.kt │ │ │ └── RustPlugin.kt │ │ ├── build.gradle.kts │ │ ├── gradle.properties │ │ └── gradlew.bat ├── .gitignore ├── relic.conf ├── src │ ├── main.rs │ ├── utils.rs │ ├── pdf.rs │ ├── cli.rs │ └── lib.rs ├── capabilities │ ├── desktop.json │ └── default.json ├── tauri.conf.json └── Cargo.toml ├── crates ├── tyx-converters │ ├── src │ │ ├── fixtures │ │ │ └── integration │ │ │ │ ├── link.typ │ │ │ │ ├── base.typ │ │ │ │ └── snaps │ │ │ │ ├── convert@link.typ.snap │ │ │ │ └── convert@base.typ.snap │ │ ├── lib.rs │ │ └── tests.rs │ ├── README.md │ └── Cargo.toml ├── tyx-schema │ ├── README.md │ ├── Cargo.toml │ ├── src │ │ └── lib.rs │ └── build.rs ├── tyx-converters-wasm │ ├── README.md │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── tyx-version │ ├── src │ │ └── lib.rs │ ├── Cargo.toml │ └── build.rs ├── tyx-to-typst │ └── Cargo.toml └── typst-to-tyx │ └── Cargo.toml ├── .vscode └── extensions.json ├── test └── specs │ └── splash.e2e.ts ├── tsconfig.node.json ├── .readthedocs.yaml ├── eslint.config.mjs ├── .gitignore ├── scripts ├── get-current-changelog.ts └── create-json-schemas.ts ├── mkdocs.yml ├── tsconfig.json ├── LICENSE.md ├── vite.config.ts ├── CONTRIBUTING.md ├── wdio.conf.ts ├── index.html ├── package.json ├── README.md ├── Cargo.toml └── schemas └── tyx-settings.schema.json /.prettierignore: -------------------------------------------------------------------------------- 1 | src-tauri/gen -------------------------------------------------------------------------------- /public/resources/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /python/README.md: -------------------------------------------------------------------------------- 1 | ../README.md -------------------------------------------------------------------------------- /docs/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ../CHANGELOG.md -------------------------------------------------------------------------------- /python/.python-version: -------------------------------------------------------------------------------- 1 | 3.14 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: noamzaks 2 | -------------------------------------------------------------------------------- /docs/_static/icon.ico: -------------------------------------------------------------------------------- 1 | ../../public/icon.ico -------------------------------------------------------------------------------- /src/backend/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./tauri" 2 | -------------------------------------------------------------------------------- /docs/_static/icon.png: -------------------------------------------------------------------------------- 1 | ../../public/transparent-64.png -------------------------------------------------------------------------------- /src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /src-tauri/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | tauri_build::build(); 3 | } 4 | -------------------------------------------------------------------------------- /crates/tyx-converters/src/fixtures/integration/link.typ: -------------------------------------------------------------------------------- 1 | https://example.com -------------------------------------------------------------------------------- /src/state.ts: -------------------------------------------------------------------------------- 1 | export const state = { 2 | wasmInitialized: false, 3 | } 4 | -------------------------------------------------------------------------------- /public/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/public/icon.ico -------------------------------------------------------------------------------- /public/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/public/icon.png -------------------------------------------------------------------------------- /crates/tyx-schema/README.md: -------------------------------------------------------------------------------- 1 | # TyX Schema 2 | 3 | The strong-typed JSON schema for TyX. 4 | -------------------------------------------------------------------------------- /public/transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/public/transparent.png -------------------------------------------------------------------------------- /src-tauri/icons/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/icon.ico -------------------------------------------------------------------------------- /src-tauri/icons/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/icon.png -------------------------------------------------------------------------------- /public/transparent-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/public/transparent-64.png -------------------------------------------------------------------------------- /src-tauri/gen/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | apply from: 'tauri.settings.gradle' 4 | -------------------------------------------------------------------------------- /src-tauri/icons/32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/32x32.png -------------------------------------------------------------------------------- /src-tauri/icons/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/icon.icns -------------------------------------------------------------------------------- /crates/tyx-converters/src/fixtures/integration/base.typ: -------------------------------------------------------------------------------- 1 | = Hello, World! 2 | This is a typst document. 3 | -------------------------------------------------------------------------------- /docs/_static/keyboard-map.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/docs/_static/keyboard-map.gif -------------------------------------------------------------------------------- /docs/_static/keyboard-map.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/docs/_static/keyboard-map.mp4 -------------------------------------------------------------------------------- /docs/_static/math-editor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/docs/_static/math-editor.gif -------------------------------------------------------------------------------- /docs/_static/math-editor.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/docs/_static/math-editor.mp4 -------------------------------------------------------------------------------- /src-tauri/icons/128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/128x128.png -------------------------------------------------------------------------------- /src-tauri/icons/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/StoreLogo.png -------------------------------------------------------------------------------- /docs/_static/function-calls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/docs/_static/function-calls.png -------------------------------------------------------------------------------- /src-tauri/icons/128x128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/128x128@2x.png -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["tauri-apps.tauri-vscode", "rust-lang.rust-analyzer"] 3 | } 4 | -------------------------------------------------------------------------------- /crates/tyx-converters/README.md: -------------------------------------------------------------------------------- 1 | # TyX Converters 2 | 3 | This crates provides converters between Typst and TyX. 4 | -------------------------------------------------------------------------------- /docs/_static/keyboard-shortcuts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/docs/_static/keyboard-shortcuts.png -------------------------------------------------------------------------------- /src-tauri/icons/Square30x30Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/Square30x30Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square44x44Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/Square44x44Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square71x71Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/Square71x71Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square89x89Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/Square89x89Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square107x107Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/Square107x107Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square142x142Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/Square142x142Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square150x150Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/Square150x150Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square284x284Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/Square284x284Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square310x310Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/Square310x310Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/ios/AppIcon-512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/ios/AppIcon-512@2x.png -------------------------------------------------------------------------------- /src-tauri/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Generated by Tauri 3 | # will have schema files for capabilities auto-completion 4 | /gen/schemas 5 | -------------------------------------------------------------------------------- /src-tauri/icons/ios/AppIcon-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/ios/AppIcon-20x20@1x.png -------------------------------------------------------------------------------- /src-tauri/icons/ios/AppIcon-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/ios/AppIcon-20x20@2x.png -------------------------------------------------------------------------------- /src-tauri/icons/ios/AppIcon-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/ios/AppIcon-20x20@3x.png -------------------------------------------------------------------------------- /src-tauri/icons/ios/AppIcon-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/ios/AppIcon-29x29@1x.png -------------------------------------------------------------------------------- /src-tauri/icons/ios/AppIcon-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/ios/AppIcon-29x29@2x.png -------------------------------------------------------------------------------- /src-tauri/icons/ios/AppIcon-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/ios/AppIcon-29x29@3x.png -------------------------------------------------------------------------------- /src-tauri/icons/ios/AppIcon-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/ios/AppIcon-40x40@1x.png -------------------------------------------------------------------------------- /src-tauri/icons/ios/AppIcon-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/ios/AppIcon-40x40@2x.png -------------------------------------------------------------------------------- /src-tauri/icons/ios/AppIcon-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/ios/AppIcon-40x40@3x.png -------------------------------------------------------------------------------- /src-tauri/icons/ios/AppIcon-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/ios/AppIcon-60x60@2x.png -------------------------------------------------------------------------------- /src-tauri/icons/ios/AppIcon-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/ios/AppIcon-60x60@3x.png -------------------------------------------------------------------------------- /src-tauri/icons/ios/AppIcon-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/ios/AppIcon-76x76@1x.png -------------------------------------------------------------------------------- /src-tauri/icons/ios/AppIcon-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/ios/AppIcon-76x76@2x.png -------------------------------------------------------------------------------- /src-tauri/icons/ios/AppIcon-20x20@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/ios/AppIcon-20x20@2x-1.png -------------------------------------------------------------------------------- /src-tauri/icons/ios/AppIcon-29x29@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/ios/AppIcon-29x29@2x-1.png -------------------------------------------------------------------------------- /src-tauri/icons/ios/AppIcon-40x40@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/ios/AppIcon-40x40@2x-1.png -------------------------------------------------------------------------------- /src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png -------------------------------------------------------------------------------- /crates/tyx-converters-wasm/README.md: -------------------------------------------------------------------------------- 1 | # WASM bindings for TyX Converters 2 | 3 | This crates provides WASM bindings for tyx-converters. 4 | -------------------------------------------------------------------------------- /src-tauri/gen/android/app/src/main/java/com/tyx_editor/tyx/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.tyx_editor.tyx 2 | 3 | class MainActivity : TauriActivity() -------------------------------------------------------------------------------- /crates/tyx-version/src/lib.rs: -------------------------------------------------------------------------------- 1 | //! Automatically generated from Tauri configuration 2 | 3 | ///The version of TyX 4 | pub const VERSION: &str = "0.2.16"; -------------------------------------------------------------------------------- /src-tauri/icons/android/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /src-tauri/icons/android/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /src-tauri/gen/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/gen/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /src-tauri/relic.conf: -------------------------------------------------------------------------------- 1 | tokens: 2 | azure: 3 | type: azure 4 | 5 | keys: 6 | azure: 7 | token: azure 8 | id: https://tyx-editor.vault.azure.net/certificates/TyX -------------------------------------------------------------------------------- /src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /src-tauri/gen/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/gen/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /src-tauri/gen/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/gen/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /src-tauri/gen/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/gen/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /src-tauri/gen/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/gen/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /src-tauri/gen/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/gen/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /src-tauri/gen/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | TyX 3 | TyX 4 | -------------------------------------------------------------------------------- /src-tauri/gen/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/gen/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /src-tauri/gen/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/gen/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /src-tauri/gen/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/gen/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /src-tauri/gen/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/gen/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /src-tauri/gen/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/gen/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /src/components/plugins/updateLocalStorage.ts: -------------------------------------------------------------------------------- 1 | import { createCommand, LexicalCommand } from "lexical" 2 | 3 | export const UPDATE_LOCAL_STORAGE_COMMAND: LexicalCommand = 4 | createCommand() 5 | -------------------------------------------------------------------------------- /src-tauri/gen/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/gen/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /src-tauri/gen/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/gen/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /src-tauri/gen/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/gen/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /src-tauri/gen/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/gen/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /src-tauri/gen/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tyx-editor/TyX/HEAD/src-tauri/gen/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /src-tauri/gen/android/app/.gitignore: -------------------------------------------------------------------------------- 1 | /src/main/java/com/tyx_editor/tyx/generated 2 | /src/main/jniLibs/**/*.so 3 | /src/main/assets/tauri.conf.json 4 | /tauri.build.gradle.kts 5 | /proguard-tauri.pro 6 | /tauri.properties -------------------------------------------------------------------------------- /src-tauri/src/main.rs: -------------------------------------------------------------------------------- 1 | // Prevents additional console window on Windows in release, DO NOT REMOVE!! 2 | #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] 3 | 4 | fn main() { 5 | tyx_lib::run() 6 | } 7 | -------------------------------------------------------------------------------- /crates/tyx-converters/src/lib.rs: -------------------------------------------------------------------------------- 1 | //! Convertions between TyX and other formats. 2 | //! Currently only Typst is supported. 3 | 4 | pub use typst_to_tyx::*; 5 | pub use tyx_to_typst::*; 6 | 7 | #[cfg(test)] 8 | mod tests; 9 | -------------------------------------------------------------------------------- /src-tauri/capabilities/desktop.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../gen/schemas/desktop-schema.json", 3 | "windows": ["main"], 4 | "identifier": "desktop-capability", 5 | "platforms": ["macOS", "windows", "linux"], 6 | "permissions": ["updater:default"] 7 | } 8 | -------------------------------------------------------------------------------- /test/specs/splash.e2e.ts: -------------------------------------------------------------------------------- 1 | describe("Splash screen tests", () => { 2 | it("should show TyX when opening", async () => { 3 | const header = await $("body h2") 4 | const text = await header.getText() 5 | expect(text).toMatch(/TyX/) 6 | }) 7 | }) 8 | -------------------------------------------------------------------------------- /tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "skipLibCheck": true, 5 | "module": "ESNext", 6 | "moduleResolution": "bundler", 7 | "allowSyntheticDefaultImports": true 8 | }, 9 | "include": ["vite.config.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /src-tauri/gen/android/app/src/main/res/xml/file_paths.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src-tauri/capabilities/default.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../gen/schemas/desktop-schema.json", 3 | "identifier": "default", 4 | "description": "Capability for the main window", 5 | "windows": ["main"], 6 | "permissions": ["core:default", "dialog:default", "process:default"] 7 | } 8 | -------------------------------------------------------------------------------- /src-tauri/src/utils.rs: -------------------------------------------------------------------------------- 1 | use std::path::PathBuf; 2 | 3 | pub(crate) const IDENTIFIER: &str = "com.tyx-editor.tyx"; 4 | 5 | pub(crate) fn get_tyx_config_dir() -> PathBuf { 6 | let base_dirs = directories::BaseDirs::new().unwrap(); 7 | 8 | base_dirs.config_dir().join(IDENTIFIER) 9 | } 10 | -------------------------------------------------------------------------------- /src-tauri/gen/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue May 10 19:22:52 CST 2022 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /src-tauri/gen/android/.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: https://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | [*] 7 | indent_style = space 8 | indent_size = 2 9 | end_of_line = lf 10 | charset = utf-8 11 | trim_trailing_whitespace = false 12 | insert_final_newline = false -------------------------------------------------------------------------------- /src-tauri/gen/android/app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | -------------------------------------------------------------------------------- /src-tauri/gen/android/app/src/main/res/values-night/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | -------------------------------------------------------------------------------- /docs/pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "docs" 3 | version = "0.1.0" 4 | description = "Add your description here" 5 | readme = "README.md" 6 | requires-python = ">=3.14" 7 | dependencies = [ 8 | "markdown-include>=0.8.1", 9 | "mkdocs>=1.6.1", 10 | "mkdocs-video>=1.5.0", 11 | "mkdocstrings[python]>=1.0.0", 12 | ] 13 | -------------------------------------------------------------------------------- /src/models/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @file TypeScript models used by TyX. 3 | */ 4 | 5 | export * from "./content" 6 | export * from "./document" 7 | export * from "./functions" 8 | export * from "./settings" 9 | export * from "./values" 10 | 11 | /** The type of TyX commands which can be executed on the current document. */ 12 | export type TyXCommand = [string, ...any] 13 | -------------------------------------------------------------------------------- /src-tauri/gen/android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | local.properties 16 | key.properties 17 | 18 | /.tauri 19 | /tauri.settings.gradle -------------------------------------------------------------------------------- /python/src/tyx_schema/__init__.py: -------------------------------------------------------------------------------- 1 | import json 2 | from pathlib import Path 3 | 4 | from tyx_schema.schema import * 5 | 6 | 7 | def get_document(path: Path): 8 | document = json.loads(path.read_bytes()) 9 | return TyXDocument(**document) 10 | 11 | 12 | def get_settings(path: Path): 13 | settings = json.loads(path.read_bytes()) 14 | return TyXSettings(**settings) 15 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | # .readthedocs.yaml 2 | # Read the Docs configuration file 3 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 4 | 5 | version: 2 6 | 7 | build: 8 | os: ubuntu-24.04 9 | tools: 10 | python: "3.12" 11 | 12 | mkdocs: 13 | configuration: mkdocs.yml 14 | 15 | python: 16 | install: 17 | - requirements: docs/requirements.txt 18 | -------------------------------------------------------------------------------- /crates/tyx-version/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "tyx-version" 3 | description = "The automatically generated version of TyX." 4 | version.workspace = true 5 | authors.workspace = true 6 | edition.workspace = true 7 | license.workspace = true 8 | rust-version.workspace = true 9 | 10 | [build-dependencies] 11 | serde.workspace = true 12 | serde_json.workspace = true 13 | 14 | [lints] 15 | workspace = true 16 | -------------------------------------------------------------------------------- /src/backend/base.ts: -------------------------------------------------------------------------------- 1 | import type { Update as TauriUpdate } from "@tauri-apps/plugin-updater" 2 | import { TyXDocument } from "../models" 3 | 4 | export type Update = TauriUpdate 5 | 6 | export const serializeDocument = (document: TyXDocument) => { 7 | return JSON.stringify({ 8 | $schema: "https://tyx-editor.com/schemas/tyx-document.schema.json", 9 | ...document, 10 | dirty: undefined, 11 | filename: undefined, 12 | }) 13 | } 14 | -------------------------------------------------------------------------------- /src/components/plugins/tableCommands.ts: -------------------------------------------------------------------------------- 1 | import { createCommand, LexicalCommand } from "lexical" 2 | 3 | export const TABLE_INSERT_ROW_BELOW_COMMAND: LexicalCommand = 4 | createCommand() 5 | export const TABLE_INSERT_COLUMN_RIGHT_COMMAND: LexicalCommand = 6 | createCommand() 7 | export const TABLE_REMOVE_ROW_COMMAND: LexicalCommand = createCommand() 8 | export const TABLE_REMOVE_COLUMN_COMMAND: LexicalCommand = createCommand() 9 | -------------------------------------------------------------------------------- /crates/tyx-to-typst/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "tyx-to-typst" 3 | description = "Converts TyX to Typst." 4 | version.workspace = true 5 | authors.workspace = true 6 | edition.workspace = true 7 | license.workspace = true 8 | rust-version.workspace = true 9 | 10 | [dependencies] 11 | serde.workspace = true 12 | serde_json.workspace = true 13 | tyx-schema.workspace = true 14 | regex = { version = "1.12.2" } 15 | 16 | [lints] 17 | workspace = true 18 | -------------------------------------------------------------------------------- /src/components/plugins/utilities.ts: -------------------------------------------------------------------------------- 1 | import { $getSelection, $isNodeSelection, $isRangeSelection } from "lexical" 2 | import { $isParentElementRTL } from "../../resources/playground" 3 | 4 | export const $isRTL = () => { 5 | const selection = $getSelection() 6 | if ($isNodeSelection(selection)) { 7 | return false 8 | } 9 | if ($isRangeSelection(selection)) { 10 | return $isParentElementRTL(selection) 11 | } 12 | return false 13 | } 14 | -------------------------------------------------------------------------------- /src-tauri/gen/android/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFBB86FC 4 | #FF6200EE 5 | #FF3700B3 6 | #FF03DAC5 7 | #FF018786 8 | #FF000000 9 | #FFFFFFFF 10 | -------------------------------------------------------------------------------- /src-tauri/gen/android/buildSrc/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | `kotlin-dsl` 3 | } 4 | 5 | gradlePlugin { 6 | plugins { 7 | create("pluginsForCoolKids") { 8 | id = "rust" 9 | implementationClass = "RustPlugin" 10 | } 11 | } 12 | } 13 | 14 | repositories { 15 | google() 16 | mavenCentral() 17 | } 18 | 19 | dependencies { 20 | compileOnly(gradleApi()) 21 | implementation("com.android.tools.build:gradle:8.5.1") 22 | } 23 | 24 | -------------------------------------------------------------------------------- /python/pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "tyx_schema" 3 | version = "0.2.11" 4 | description = "Safe Pydantic schema for interacting with TyX configurations" 5 | readme = "README.md" 6 | requires-python = ">=3.9" 7 | dependencies = ["pydantic>=2.12.3"] 8 | 9 | [dependency-groups] 10 | dev = [ 11 | "black>=25.9.0", 12 | "datamodel-code-generator>=0.40.0", 13 | "pytest>=8.4.2", 14 | ] 15 | 16 | [build-system] 17 | requires = ["uv_build>=0.9.5,<0.10.0"] 18 | build-backend = "uv_build" 19 | -------------------------------------------------------------------------------- /src-tauri/gen/android/build.gradle.kts: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | mavenCentral() 5 | } 6 | dependencies { 7 | classpath("com.android.tools.build:gradle:8.5.1") 8 | classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.25") 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | mavenCentral() 16 | } 17 | } 18 | 19 | tasks.register("clean").configure { 20 | delete("build") 21 | } 22 | 23 | -------------------------------------------------------------------------------- /crates/tyx-converters-wasm/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "tyx-converters-wasm" 3 | description = "WASM bindings for converters between TyX and other formats." 4 | version.workspace = true 5 | authors.workspace = true 6 | edition.workspace = true 7 | license.workspace = true 8 | rust-version.workspace = true 9 | repository.workspace = true 10 | 11 | [dependencies] 12 | wasm-bindgen = "0.2" 13 | web-sys = "0.3" 14 | js-sys = "0.3" 15 | tyx-to-typst.workspace = true 16 | 17 | [lib] 18 | crate-type = ["cdylib"] 19 | -------------------------------------------------------------------------------- /eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import eslint from "@eslint/js" 2 | import reactRefresh from "eslint-plugin-react-refresh" 3 | import tseslint from "typescript-eslint" 4 | 5 | export default tseslint.config( 6 | eslint.configs.recommended, 7 | tseslint.configs.recommended, 8 | reactRefresh.configs.recommended, 9 | { 10 | rules: { 11 | "@typescript-eslint/no-explicit-any": "off", 12 | "@typescript-eslint/ban-ts-comment": "off", 13 | "@typescript-eslint/no-namespace": "off", 14 | }, 15 | }, 16 | ) 17 | -------------------------------------------------------------------------------- /src/components/plugins/CodeHighlightPlugin.tsx: -------------------------------------------------------------------------------- 1 | import { registerCodeHighlighting } from "@lexical/code" 2 | import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext" 3 | import { useEffect } from "react" 4 | import "../../resources/prism-theme.css" 5 | 6 | const CodeHighlightPlugin = () => { 7 | const [editor] = useLexicalComposerContext() 8 | 9 | useEffect(() => { 10 | return registerCodeHighlighting(editor) 11 | }, [editor]) 12 | 13 | return null 14 | } 15 | 16 | export default CodeHighlightPlugin 17 | -------------------------------------------------------------------------------- /src/translations/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @file Provide translations for strings in the React app. 3 | */ 4 | 5 | import i18n from "i18next" 6 | import { initReactI18next } from "react-i18next" 7 | import en from "./en.json" 8 | import he from "./he.json" 9 | 10 | i18n.use(initReactI18next).init({ 11 | resources: { 12 | en, 13 | he, 14 | }, 15 | lng: "en", 16 | }) 17 | 18 | export const TRANSLATIONS = [ 19 | { label: "English", value: "en" }, 20 | { label: "עברית", value: "he" }, 21 | ] 22 | 23 | export const RTL_LANGUAGES = ["he"] 24 | -------------------------------------------------------------------------------- /crates/tyx-schema/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "tyx-schema" 3 | description = "The strong-typed JSON schema for TyX." 4 | version.workspace = true 5 | authors.workspace = true 6 | edition.workspace = true 7 | license.workspace = true 8 | rust-version.workspace = true 9 | 10 | [dependencies] 11 | serde.workspace = true 12 | serde_json.workspace = true 13 | 14 | [build-dependencies] 15 | serde.workspace = true 16 | serde_json.workspace = true 17 | prettyplease = "0.2" 18 | schemars = "0.8" 19 | syn = "2.0" 20 | typify = "0.5.0" 21 | 22 | [lints] 23 | workspace = true 24 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | click==8.3.1 2 | colorama==0.4.6 3 | ghp-import==2.1.0 4 | griffe==1.15.0 5 | jinja2==3.1.6 6 | lxml==6.0.2 7 | markdown==3.10 8 | markdown-include==0.8.1 9 | markupsafe==3.0.3 10 | mergedeep==1.3.4 11 | mkdocs==1.6.1 12 | mkdocs-autorefs==1.4.3 13 | mkdocs-get-deps==0.2.0 14 | mkdocs-video==1.5.0 15 | mkdocstrings==1.0.0 16 | mkdocstrings-python==2.0.1 17 | packaging==25.0 18 | pathspec==0.12.1 19 | platformdirs==4.5.1 20 | pymdown-extensions==10.18 21 | python-dateutil==2.9.0.post0 22 | pyyaml==6.0.3 23 | pyyaml-env-tag==1.1 24 | six==1.17.0 25 | watchdog==6.0.0 26 | -------------------------------------------------------------------------------- /src/settings.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @file The implementation for TyX settings. 3 | */ 4 | 5 | import { TyXSettings } from "./models" 6 | import { getLocalStorage, setLocalStorage } from "./utilities/hooks" 7 | 8 | export const DEFAULT_MATH_INLINE_SHORTCUTS: [string, string][] = [] 9 | 10 | export const getSettings = (): TyXSettings => { 11 | const settings = TyXSettings.safeParse( 12 | getLocalStorage("Settings"), 13 | ) 14 | 15 | if (!settings.success) { 16 | setLocalStorage("Settings", {} as TyXSettings) 17 | } 18 | 19 | return settings.data ?? {} 20 | } 21 | -------------------------------------------------------------------------------- /src/resources/playground-ext.tsx: -------------------------------------------------------------------------------- 1 | import { createEmptyHistoryState } from "@lexical/react/LexicalHistoryPlugin" 2 | import { ReactNode, useMemo } from "react" 3 | import { HistoryContext } from "./playground" 4 | 5 | export const SharedHistoryContext = ({ 6 | children, 7 | }: { 8 | children: ReactNode 9 | }): JSX.Element => { 10 | const historyContext = useMemo( 11 | () => ({ historyState: createEmptyHistoryState() }), 12 | [], 13 | ) 14 | return ( 15 | 16 | {children} 17 | 18 | ) 19 | } 20 | -------------------------------------------------------------------------------- /crates/tyx-converters-wasm/src/lib.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | pub fn serialized_tyx_to_typst(document: &str) -> String { 5 | tyx_to_typst::serialized_tyx_to_typst(document) 6 | } 7 | 8 | #[wasm_bindgen] 9 | pub fn serialized_stringify_function( 10 | name: &str, 11 | position_parameters: &str, 12 | named_parameters: &str, 13 | include_content: bool, 14 | ) -> String { 15 | tyx_to_typst::serialized_stringify_function( 16 | Some(name.into()), 17 | position_parameters, 18 | named_parameters, 19 | include_content, 20 | ) 21 | } 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | 26 | # Generated by Cargo 27 | # will have compiled files and executables 28 | /target/ 29 | 30 | src-tauri/bin 31 | # Local Netlify folder 32 | .netlify 33 | 34 | docs/_build 35 | __pycache__ 36 | src/converters 37 | examples/*.typ 38 | examples/*.pdf -------------------------------------------------------------------------------- /python/tests/test_examples.py: -------------------------------------------------------------------------------- 1 | import json 2 | import os 3 | from pathlib import Path 4 | 5 | import pytest 6 | import tyx_schema 7 | 8 | EXAMPLE_DIRECTORY = os.path.join(os.path.dirname(__file__), "..", "..", "examples") 9 | 10 | 11 | def test_examples(examples): 12 | for example in examples: 13 | content = Path(example).read_text() 14 | tyx_schema.TyXDocument(**json.loads(content)) 15 | 16 | 17 | @pytest.fixture 18 | def examples(): 19 | return [ 20 | os.path.join(EXAMPLE_DIRECTORY, f) 21 | for f in os.listdir(EXAMPLE_DIRECTORY) 22 | if f.endswith(".tyx") 23 | ] 24 | -------------------------------------------------------------------------------- /crates/tyx-converters/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "tyx-converters" 3 | description = "Converters between TyX and other formats." 4 | version.workspace = true 5 | authors.workspace = true 6 | edition.workspace = true 7 | license.workspace = true 8 | rust-version.workspace = true 9 | 10 | [dependencies] 11 | tyx-to-typst.workspace = true 12 | typst-to-tyx.workspace = true 13 | 14 | [dev-dependencies] 15 | insta.workspace = true 16 | tinymist-tests.workspace = true 17 | tinymist-project.workspace = true 18 | serde.workspace = true 19 | serde_json.workspace = true 20 | tyx-schema.workspace = true 21 | 22 | [lints] 23 | workspace = true 24 | -------------------------------------------------------------------------------- /crates/tyx-converters/src/fixtures/integration/snaps/convert@link.typ.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: crates/tyx-converters/src/tests.rs 3 | expression: conv(world) 4 | input_file: crates/tyx-converters/src/fixtures/integration/link.typ 5 | --- 6 | { 7 | "root": { 8 | "type": "root", 9 | "children": [ 10 | { 11 | "type": "paragraph", 12 | "children": [ 13 | { 14 | "type": "link", 15 | "children": [ 16 | { 17 | "type": "text", 18 | "format": 0, 19 | "text": "https://example.com" 20 | } 21 | ], 22 | "url": "https://example.com" 23 | } 24 | ], 25 | "format": "" 26 | } 27 | ] 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /scripts/get-current-changelog.ts: -------------------------------------------------------------------------------- 1 | import { readFileSync } from "fs" 2 | 3 | const version: string = JSON.parse( 4 | readFileSync("./src-tauri/tauri.conf.json").toString(), 5 | ).version 6 | 7 | const changelog = readFileSync("CHANGELOG.md").toString() 8 | 9 | const changelogLines = changelog.split("\n") 10 | const startLine = changelogLines.findIndex((line) => 11 | line.startsWith(`## [${version}]`), 12 | ) 13 | const endLine = changelogLines.findIndex( 14 | (line, index) => index > startLine && line.startsWith("## ["), 15 | ) 16 | const description = changelogLines 17 | .slice(startLine + 1, endLine) 18 | .join("\n") 19 | .trim() 20 | 21 | console.log(description) 22 | -------------------------------------------------------------------------------- /mkdocs.yml: -------------------------------------------------------------------------------- 1 | site_name: TyX 2 | theme: 3 | name: readthedocs 4 | highlightjs: true 5 | logo: _static/icon.png 6 | site_favicon: _static/icon.ico 7 | plugins: 8 | - search 9 | - mkdocstrings: 10 | handlers: 11 | python: 12 | options: 13 | docstring_style: sphinx 14 | - mkdocs-video: 15 | is_video: True 16 | css_style: 17 | width: "100%" 18 | height: "auto" 19 | markdown_extensions: 20 | - markdown_include.include: 21 | base_path: docs 22 | - admonition 23 | nav: 24 | - Introduction: 25 | - getting-started.md 26 | - configuration.md 27 | - API Docs: 28 | - commands.md 29 | - CHANGELOG.md 30 | -------------------------------------------------------------------------------- /src/components/CommandButton.tsx: -------------------------------------------------------------------------------- 1 | import { Button, ButtonProps } from "@mantine/core" 2 | import { executeCommandSequence } from "../commands" 3 | import { setLocalStorage } from "../utilities/hooks" 4 | 5 | const CommandButton = (props: ButtonProps & { command: string }) => { 6 | return ( 7 | 32 | 33 | ) 34 | } 35 | 36 | export default SaveAsModal 37 | -------------------------------------------------------------------------------- /src/components/plugins/keyboardMap.ts: -------------------------------------------------------------------------------- 1 | import { createCommand, LexicalCommand } from "lexical" 2 | 3 | export const TOGGLE_KEYBOARD_MAP_COMMAND: LexicalCommand = 4 | createCommand() 5 | 6 | export const KEYBOARD_MAPS: Record> = { 7 | Hebrew: { 8 | a: "ש", 9 | b: "נ", 10 | c: "ב", 11 | d: "ג", 12 | e: "ק", 13 | f: "כ", 14 | g: "ע", 15 | h: "י", 16 | i: "ן", 17 | j: "ח", 18 | k: "ל", 19 | l: "ך", 20 | m: "צ", 21 | n: "מ", 22 | o: "ם", 23 | p: "פ", 24 | q: "/", 25 | r: "ר", 26 | s: "ד", 27 | t: "א", 28 | u: "ו", 29 | v: "ה", 30 | w: "'", 31 | x: "ס", 32 | y: "ט", 33 | z: "ז", 34 | ",": "ת", 35 | ".": "ץ", 36 | ";": "ף", 37 | "'": ",", 38 | "/": ".", 39 | "`": ";", 40 | "(": ")", 41 | ")": "(", 42 | "[": "]", 43 | "]": "[", 44 | "{": "}", 45 | "}": "{", 46 | "<": ">", 47 | ">": "<", 48 | }, 49 | } 50 | -------------------------------------------------------------------------------- /crates/tyx-schema/build.rs: -------------------------------------------------------------------------------- 1 | //! Based on https://github.com/oxidecomputer/typify/blob/main/example-build/build.rs 2 | use typify::{TypeSpace, TypeSpaceSettings}; 3 | 4 | const SCHEMA_PATH: &str = "../../schemas/tyx.schema.json"; 5 | const OUTPUT_PATH: &str = "./src/generated.rs"; 6 | 7 | fn main() { 8 | let content = std::fs::read_to_string(SCHEMA_PATH).unwrap(); 9 | let schema = serde_json::from_str::(&content).unwrap(); 10 | 11 | let mut type_space = TypeSpace::new(&TypeSpaceSettings::default()); 12 | type_space.add_root_schema(schema).unwrap(); 13 | 14 | let contents = String::from("#![allow(missing_docs)]\n#![allow(clippy::all)]\n") 15 | + prettyplease::unparse(&syn::parse2::(type_space.to_stream()).unwrap()) 16 | .as_str(); 17 | 18 | let current = std::fs::read_to_string(OUTPUT_PATH).unwrap_or_default(); 19 | if current != contents { 20 | std::fs::write(OUTPUT_PATH, contents).unwrap(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright 2025 Noam Zaks and TyX Contributors 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /src/components/CommandActionIcon.tsx: -------------------------------------------------------------------------------- 1 | import { ActionIcon, ActionIconProps, Tooltip } from "@mantine/core" 2 | import { forwardRef } from "react" 3 | import { executeCommandSequence } from "../commands" 4 | import { setLocalStorage } from "../utilities/hooks" 5 | 6 | const CommandActionIcon = forwardRef( 7 | ( 8 | props: ActionIconProps & { 9 | component?: any 10 | command: string 11 | label?: string 12 | }, 13 | ref, 14 | ) => { 15 | const icon = ( 16 | setLocalStorage("Hover Command", props.command)} 19 | onMouseLeave={() => setLocalStorage("Hover Command", null)} 20 | onClick={(e: any) => { 21 | e.preventDefault() 22 | e.stopPropagation() 23 | executeCommandSequence(props.command) 24 | }} 25 | {...props} 26 | /> 27 | ) 28 | 29 | if (props.label) { 30 | return {icon} 31 | } 32 | 33 | return icon 34 | }, 35 | ) 36 | 37 | export default CommandActionIcon 38 | -------------------------------------------------------------------------------- /src/backend/common.ts: -------------------------------------------------------------------------------- 1 | import { t } from "i18next" 2 | import { TyXDocument } from "../models" 3 | import { showConfirmModal } from "../utilities" 4 | import { getLocalStorage, setLocalStorage } from "../utilities/hooks" 5 | 6 | const close = ( 7 | openDocuments: TyXDocument[], 8 | index: number, 9 | currentDocument: number, 10 | ) => { 11 | openDocuments.splice(index, 1) 12 | setLocalStorage("Open Documents", openDocuments) 13 | if (index <= currentDocument && currentDocument !== 0) { 14 | setLocalStorage("Current Document", currentDocument - 1) 15 | } 16 | } 17 | 18 | export const onClose = (fileIndex?: number) => { 19 | const openDocuments = getLocalStorage("Open Documents", []) 20 | const currentDocument = getLocalStorage("Current Document") 21 | const index = fileIndex ?? currentDocument 22 | 23 | if (openDocuments[index]?.dirty) { 24 | showConfirmModal(t("theChangesWontBeSaved") + "!", () => 25 | close(openDocuments, index, currentDocument), 26 | ) 27 | return 28 | } 29 | 30 | close(openDocuments, index, currentDocument) 31 | } 32 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | on: push 2 | name: Lint 3 | 4 | env: 5 | RUSTFLAGS: "-Dwarnings" 6 | 7 | jobs: 8 | lint: 9 | runs-on: ubuntu-22.04 10 | steps: 11 | - uses: actions/checkout@v4 12 | 13 | - uses: actions/checkout@v4 14 | - uses: actions-rust-lang/setup-rust-toolchain@v1 15 | with: 16 | toolchain: 1.88.0 17 | components: clippy 18 | 19 | - name: install ubuntu dependencies 20 | run: | 21 | sudo apt-get update 22 | sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev libsoup-3.0-dev libjavascriptcoregtk-4.1-dev libwebkit2gtk-4.1-dev 23 | 24 | - name: setup bun 25 | uses: oven-sh/setup-bun@v2 26 | with: 27 | bun-version: latest 28 | 29 | - name: install frontend dependencies 30 | run: bun install 31 | 32 | - name: run clippy 33 | run: cargo clippy --all-targets --all-features 34 | 35 | - name: run tests (Rust) 36 | run: cargo test --workspace 37 | 38 | - name: run prettier 39 | run: bun run prettier --check . 40 | -------------------------------------------------------------------------------- /src/components/plugins/CurrentEditorPlugin.tsx: -------------------------------------------------------------------------------- 1 | import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext" 2 | import { 3 | COMMAND_PRIORITY_NORMAL, 4 | CommandListenerPriority, 5 | FOCUS_COMMAND, 6 | NodeKey, 7 | } from "lexical" 8 | import { useEffect } from "react" 9 | 10 | const CurrentEditorPlugin = ({ 11 | priority, 12 | nodeKey, 13 | }: { 14 | priority?: CommandListenerPriority 15 | nodeKey?: NodeKey 16 | }) => { 17 | const [editor] = useLexicalComposerContext() 18 | 19 | useEffect(() => { 20 | window.currentEditor = editor 21 | window.currentNodeKey = nodeKey 22 | 23 | return () => { 24 | if (window.currentEditor === editor) { 25 | window.currentEditor = undefined 26 | } 27 | } 28 | }, [editor]) 29 | 30 | useEffect(() => { 31 | return editor.registerCommand( 32 | FOCUS_COMMAND, 33 | () => { 34 | window.currentEditor = editor 35 | window.currentNodeKey = nodeKey 36 | 37 | return true 38 | }, 39 | priority ?? COMMAND_PRIORITY_NORMAL, 40 | ) 41 | }, [editor]) 42 | 43 | return null 44 | } 45 | 46 | export default CurrentEditorPlugin 47 | -------------------------------------------------------------------------------- /src/components/TyXLengthEditor.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * @file A component for accepting TyX length values. 3 | */ 4 | 5 | import { Select, TextInput, TextInputProps } from "@mantine/core" 6 | import { TyXLength } from "../models" 7 | 8 | const TyXLengthEditor = ({ 9 | value, 10 | onChange, 11 | props, 12 | }: { 13 | value: TyXLength 14 | onChange: (v: TyXLength) => void 15 | props?: TextInputProps 16 | }) => { 17 | return ( 18 |
19 | 25 | onChange({ value: e.currentTarget.value, unit: value.unit }) 26 | } 27 | /> 28 |