Commit graph

68 commits

Author SHA1 Message Date
JK
ba4689aa28 fix: cast types to unknown for compatibility in TikzJaxLoader and worker functions 2026-06-06 12:04:08 +02:00
JK
ba4f64eeb4 Refactor documentation and enhance features for TeXcore plugin
- Updated PDF export documentation to clarify features and settings.
- Improved quick preview functionality with detailed technical architecture.
- Enhanced equation search and autocomplete sections for better user guidance.
- Streamlined snippets documentation for command usage and text transformations.
- Revamped TikZ diagrams section to include graphical editor details and usage instructions.
- Revised getting started guide for clearer step-by-step setup instructions.
- Added new navigation and configuration options in the documentation structure.
- Updated plugin manifest files with improved descriptions for clarity.
2026-06-06 11:50:35 +02:00
JK
e979252b6c refactor: remove unused dependencies and improve error handling in TikZ components 2026-06-06 11:04:01 +02:00
JK
515ffed7f5 feat(tikz): refine column layout handling for improved responsiveness and alignment 2026-06-06 10:49:25 +02:00
JK
075eb559be Refactor TikZ editor components and improve code readability
- Updated asset manager to use window.setTimeout for better compatibility.
- Refactored class CanvasGrid to use template literals for class names and styles.
- Replaced inline style assignments with setCssStyles method for consistency.
- Enhanced left sidebar button titles and tooltips for better accessibility.
- Removed unnecessary console logs for cleaner code.
- Improved modal styling and text consistency in TikZ editor modal.
- Updated history manager to ensure type safety with EditorElement.
- Enhanced TikzCodec for better clarity in node naming.
- Improved live preview overlay button titles for consistency.
2026-06-06 00:52:28 +02:00
JK
29a717ad4e featr: Enhance selection handling and UI updates
- Updated CanvasGrid to support lasso selection for multiple vertices.
- Modified RightSidebar to handle multiple selected elements for shared style properties.
- Refactored TikzEditorModal to manage selected vertices instead of a single element ID.
- Improved element update methods to accommodate batch updates for selected elements.
- Cleaned up code formatting and removed unnecessary lines for better readability.
2026-06-06 00:52:28 +02:00
JK
f17bc66c4e feat: enhance TikZ editor with tooltips for keyboard shortcuts, add thickness control, and improve snapping functionality
- Updated left sidebar tool buttons to include keyboard shortcuts in titles.
- Added a thickness slider in the right sidebar for adjusting element thickness.
- Refactored snapping functionality to allow for different modes (grid, half, none) and updated related UI elements.
- Improved error handling in TikZ code generation and added support for new shapes (circles, rectangles, triangles).
- Enhanced CSS for better layout and user experience, including adjustments for canvas controls and element interactions.
2026-06-06 00:52:05 +02:00
JK
2bf059a65f feat(tikz): implement dynamic column width calculation and update row layout for improved rendering 2026-06-05 18:40:01 +02:00
JK
4b10591bbc feat(tikz): enhance SVG bounding box calculation and layout adjustments for improved rendering 2026-06-05 18:36:11 +02:00
JK
c4c59f0b6d fix(tikz): correct symbol rendering shift, compact layout spacing, and resolve dependencies
- fix(fonts): override the DVI parser's `machine.putText` to use the split character code offset mappings from `tikzjax.js`. Maps codes 0-9 starting at 161 (corrects Γ rendering as Θ) and codes 10-19 starting at 173 (resolves Ω and ⊗ soft-hyphen rendering collisions).
- feat(packages): add robust package dependency resolution in `loader.ts` for `tikz-cd`, `tikz-feynhand`, and `pgfcalendar` to ensure all library files and keys load properly on-demand.
- style(layout): compact layout by reducing margins (`1.5em 0` -> `0.3em 0`) and removing padding (`1rem 0` -> `0`) on `.block-language-tikz` container class in `renderer.ts`.
- fix(layout): adjust SVG inline styles to use `position: relative` with `overflow: visible` to prevent page clipping at the top.
2026-06-05 18:17:46 +02:00
JK
658276073b fix(tikz): webassembly initialization 2026-06-05 15:50:54 +02:00
JK
bf83c2a9d7 feat(tikz): transition to on-demand lazy asset loading model
- Excluded `tikzjax-assets/` directory from production release configurations in `package.json` to reduce package size from ~11MB to under 1.2MB.
- Generated `assets-manifest.ts` containing static list of 210+ LaTeX dependencies to resolve package lists statically.
- Implemented dynamic downloader in `loader.ts` using Obsidian `requestUrl` to fetch missing TeX files on-demand from CDN and save them locally.
- Integrated `showNotice` notifications to notify users about download initiation, completion, and error states.
- Implemented lazy font loading in `renderer.ts` to download `tikzjax.css` dynamically on first render.
- Resolved worker typescript type overload matching compiler issue.
- Satisfied Obsidian release policies by removing unnecessary console logs and direct `Notice` constructor calls.
2026-06-05 15:27:19 +02:00
JK
bea33c7cac feat(tikz): decouple TikZJax loader and assets for fully offline, worker-based rendering
- Extracted 214 TeX libraries, packages, core formats, and WebAssembly binaries from monolithic `tikzjax.js` into local `tikzjax-assets/` folder.
- Replaced monolithic 7MB runtime JS asset download from GitHub with a lightweight loader and Web Worker compilation engine.
- Implemented `tikzjax.worker.ts` to execute the TeX engine in a background Web Worker thread using modern Web standard APIs, preventing main-thread UI locks.
- Implemented `TikzJaxLoader` to parse code block preambles, lazily load/decompress assets synchronously via native `zlib`, cache core buffers in memory, and compile diagrams via the worker.
- Refactored `renderer.ts` and `live-preview-overlay.ts` to utilize the async loader, removing DOM-polluting `<script>` tags, global mutation observers, and custom window hooks.
- Swapped unsafe `.innerHTML` DOM writes with secure browser `DOMParser` APIs for SVG parsing.
- Configured `esbuild` and `package.json` to recursively copy `tikzjax-assets/` to both development and production release locations.
- Removed temporary extraction scripts to keep runtime codebase clean.
- Added asset origin citations to module README, project root README, and MkDocs features documentation.
- Fixed all 111 ESLint type check and style errors, ensuring clean linter execution.
2026-06-05 15:19:32 +02:00
JK
4aa6d9cdac Updated Naming Convention 2026-06-05 14:50:35 +02:00
JK
2cf270523a feat: redesign settings UI, add Integrations tab, and support dynamic Zotero cleanup command
- Renamed TikZJax tab to Integrations and consolidated PDF Export, TikZJax, and Zotero cleanup under it
- Grouped PDF Export, TikZJax, and Zotero cleanup configurations inside modular gear-button modals using SettingsGroupModal
- Added an "Enable Zotero cleanup" toggle to dynamically register/unregister the `remove-duplicate-zotero-annotations` command
- Restructured headers, line separators, and vertical spacing in CSS to match the full-calendar design
- Updated translation keys in en.json and corrected casing across settings descriptions
- Verified that all lint checks, type check compilations, and Jest tests pass with zero errors
2026-06-05 14:43:16 +02:00
JK
7c08b356d4 feat(settings): redesign settings tab with categories, search, i18n, and what's new modal
- Redesigned the settings tab to support structured categories (General, PDF Export, TikZJax, Custom Notes, and What's New)
- Implemented a search-based filter in settings that dynamically hides/shows items and highlights matching terms
- Added i18n support with `en.json` and a type-safe `t()` utility to handle localized sentence-case labels
- Integrated a startup check and "What's New" modal to display the latest updates on first launch or version updates
- Declared global `activeDocument` and `activeWindow` properties on the Window interface to ensure strict TypeScript type-safety
- Fixed all ESLint issues including deprecated `display()` calls, manual HTML headings, sentence case warnings, and unused variables
- Added documentation links support and a feedback footer at the bottom of the settings tab
2026-06-05 14:29:35 +02:00
JK
3dc3333ab6 css important may backfire 2026-06-04 21:31:18 +02:00
JK
e427438d1f fix lint II 2026-06-04 21:26:06 +02:00
JK
157c0b57ab lin fix I 2026-06-04 21:01:36 +02:00
JK
b6392a5523 refactor: reorganize src into modular structure and increase test coverage 2026-06-04 20:50:07 +02:00
JK
0f00ee5f90 setting up prod release 2026-06-04 20:26:28 +02:00
JK
88cb4e38d5 fix lint more updating 2026-06-04 20:12:07 +02:00
JK
bcc1be7933 updating the plugin 2026-06-04 20:12:07 +02:00
JK
ad4ad7969b feat(tikz): add export SVG functionality and enhance overlay header 2026-06-04 20:12:07 +02:00
JK
4fb6142978 Fix tikz for PDF printing 2026-06-04 20:12:06 +02:00
JK
f1d2e81e85 feat(row-layout): enhance column formatting and width handling in row layout 2026-06-04 20:12:06 +02:00
JK
ff059cdf28 fix(tikz): prevent uncaught null reference errors in tikzjax-load-finished event 2026-06-04 20:12:06 +02:00
JK
efa8d8f94a feat(tikz): add TikZ live preview overlay functionality 2026-06-04 20:12:06 +02:00
JK
096e18bd3c fix flickering when typing outside the live render 2026-06-04 20:12:06 +02:00
JK
57f99e33fd feat(tikz): add support for fetching and applying TikZJax CSS styles 2026-06-04 20:12:06 +02:00
JK
c548bac003 feat(row-layout): aggressively compress vertical spacing for row layout
- Adds a `tightenColumn` helper to override and clear margins/paddings on all inner elements (paragraphs, math blocks, code wrappers, SVGs, MathJax containers).
- Executes spacing compression at delayed intervals (0ms, 50ms, 150ms, 500ms) to ensure late-rendered asynchronous elements are properly shrunk.
- Pulls surrounding paragraph text closer by setting the row element margin to `-0.5em 0`.
- Ensures proper component cleanups via `ctx.addChild` and `destroy()` to prevent memory leaks.
2026-06-04 20:12:06 +02:00
JK
2c48c019f0 feat(row-layout): add side-by-side row layout for Reading View and Live Preview
- Implements support for `;;;row: [widths]` and `;;` columns to render side-by-side layouts dynamically.
- Integrates a CodeMirror 6 `StateField` using `Decoration.replace` for Live Preview, enabling seamless inline layout folding.
- Adds click-to-edit handling which dispatches selection to the raw source code when clicking a rendered layout.
- Ensures robust component lifecycle management: tracks and unloads rendering components via `destroy()` in Live Preview widgets and `ctx.addChild` in Reading View to prevent memory leaks.
- Bumps manifest.json to v2.3.0.
2026-06-04 20:12:06 +02:00
JK
a460ca5bea feat: implement robust offline-first TikZ diagram rendering support
- Added a modular `TikzRenderer` in `src/features/tikz/renderer.ts` to process `tikz` code blocks.
- Fetches and caches the offline-friendly, self-contained 7MB TikZJax JS engine from artisticat1/obsidian-tikzjax.
- Dynamically patches the engine's initialization to execute immediately (bypassing window.onload and document.readyState race conditions).
- Implements a programmatic `TikzJaxCleanup` function that terminates WebAssembly worker pools and disconnects MutationObservers when the plugin unloads, supporting safe Hot Reloads.
- Simplifies block element styling to render transparently and center-aligned, matching standard notes.
- Added Settings UI controls (`enableTikzjax` and `invertColorsInDarkMode`) to manage diagram color inversion and toggle rendering status.
- Integrated `TikzRenderer` setup and cleanup into the main plugin lifecycle.
2026-06-04 20:12:06 +02:00
JK
451ff80edf feat: implement custom note management with hotkey support 2026-06-04 20:12:06 +02:00
JK
ed45018fdc fix: update regex for equation links to correctly handle sub-indices 2026-06-04 20:12:05 +02:00
JK
c5786a8913 fix lazy multiline latex in callout leads to corrupt live preview 2026-06-04 20:12:05 +02:00
JK
6018bd89a5 feat: add Zotero cleanup feature to remove duplicate annotations from active note 2026-06-04 20:12:05 +02:00
JK
e1f8b1831b feat(snippets): add 'Clean Double Dollar Symbols' text transform snippet 2026-06-04 20:12:05 +02:00
JK
80f7042a57 feat(snippets): streamline snippet management and introduce text transformation features 2026-06-04 20:12:05 +02:00
JK
d1d809f029 fix(live-preview): fixed cursor kicking when editing referenced block 2026-06-04 20:12:05 +02:00
JK
bcc862731a feat(equation-cache): NO VAULT WIDE scans at startup; remove EquationCache and integrate equation processing directly in LatexLinkProvider 2026-06-04 20:12:05 +02:00
JK
bd877592c0 fix(equations): enhance handling of list sections in equation processing 2026-06-04 20:12:05 +02:00
JK
a3d9e1e494 fix(callout): Implement custom rendering for equation links and numbers in dynamically rendered callouts. 2026-06-04 20:12:05 +02:00
JK
94cd23a4c3 Added docs 2026-06-04 20:12:04 +02:00
JK
02da857384 Docs updating 2026-06-04 20:12:04 +02:00
JK
9d9889e99c feat(pdf-export): improve modal layout and preview sizing
- Refactor export modal to use a 2-column flex layout (preview left, settings right).
- Increase modal dimensions to 90vw width and 90vh height for better visibility.
- Fix PDF preview sizing to ensure full width and height are visible by calculating webview height from physical page dimensions.
- Remove padding and alignment constraints from the preview container to maximize space.
2026-06-04 20:12:04 +02:00
JK
8512d8158b feat: add custom LaTeX snippets feature with hotkey support
- Add `Snippet` interface and persistent storage in settings
- Implement `SnippetManager` to handle snippet logic and command registration
- Add settings UI for creating, editing, and deleting snippets
- Add `SnippetSuggestModal` for fuzzy searching and inserting snippets
- Register "Insert Snippet" command and individual commands for each snippet to enable custom hotkey assignments
2026-06-04 20:12:04 +02:00
JK
9d5f3aa68b version bump 2026-06-04 20:12:04 +02:00
JK
138e40e4b2 fix: resolve pdf export issues and callout math formatting validation
Major fixes including:
- fix(pdf): remove legacy rendering hack that caused export failures in newer Obsidian versions
- fix(core): ensure auto-injected IDs and tags correctly inherit callout indentation (fixes "zombie lines" and broken previews)
- feat: add "Fix callout equations in active note" command to repair existing malformed content
- refactor: centralize callout parsing logic in `src/utils/parse.ts` for SOLID/DRY compliance
2026-06-04 20:12:04 +02:00
JK
a35f355956 fixed mathblock obsidian problem when mathJax inside codeblock doesnt start with > 2026-06-04 20:12:04 +02:00