Skip to content
Draft
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
c5d282d
Mathlive
Meinzzzz Nov 19, 2025
497ec2a
Merge branch 'main' of https://github.com/Meinzzzz/Trilium-Mathlive
Meinzzzz Nov 20, 2025
e777b06
Math
Meinzzzz Nov 20, 2025
49e90c0
Better Names for Math UI Components
Meinzzzz Nov 20, 2025
39838c2
Fixed chaching problems
Meinzzzz Nov 21, 2025
569b096
Remove mathlive dependency and chunking
Meinzzzz Nov 21, 2025
4eef30f
Fix names
Meinzzzz Nov 21, 2025
e225794
Better window focus handling in MathFormView
Meinzzzz Nov 22, 2025
48a4b81
remove automated screenshot files
Meinzzzz Nov 22, 2025
de80eb4
Improve mathform.css styling for better visual integration
Meinzzzz Nov 22, 2025
a0f16f9
Fix typos in mathform.css
Meinzzzz Nov 23, 2025
56834cb
Improve MathLive and Raw LaTeX input views to propagate mousedown events
Meinzzzz Nov 23, 2025
1471a72
refactor: avoid recursive updates in mathLiveInput by normalizing val…
Meinzzzz Nov 23, 2025
edba818
Fix dark selection colors in MathLive math-field
Meinzzzz Nov 23, 2025
5821c35
Fixing class property initialization order
Meinzzzz Nov 23, 2025
4f044c4
Use icons form CKEditor5 icons, instead of testing icons.
Meinzzzz Nov 23, 2025
d5e601e
Simpliyfied resize logic for math input form and improved css
Meinzzzz Nov 24, 2025
4110fec
Removed unnecessary declare keyboard
Meinzzzz Nov 24, 2025
e7355dc
remove gitignore unneccesary changes
Meinzzzz Nov 24, 2025
9c43014
Remove unused icons from ckeditor5-math package
Meinzzzz Nov 24, 2025
d2052ad
Disable mathlive sound effects
Meinzzzz Nov 24, 2025
51db729
Improve and simplify Mathfield integration
Meinzzzz Nov 25, 2025
c8d34e6
Improve max window size
Meinzzzz Nov 26, 2025
a6de104
Fix bug in math rendering where old content was not cleared
Meinzzzz Nov 26, 2025
64ab1c4
Imrovement for Latex
Meinzzzz Nov 26, 2025
c46cf41
Small improvements
Meinzzzz Nov 26, 2025
f8d8481
Fix differential d problems
Meinzzzz Nov 26, 2025
acca22f
Improve Synchronization Between Mathlive and rawlatex input
Meinzzzz Dec 2, 2025
9386465
Added mathrender error class for better error handling in math rendering
Meinzzzz Dec 2, 2025
162c076
Improve MathLive integration and lazy loading
Meinzzzz Dec 2, 2025
827c8e0
Refactor: Combine MathLive and LaTeX inputs into one single component
Meinzzzz Dec 7, 2025
28dd85c
Merge upstream changes and resolve conflicts
Meinzzzz Dec 7, 2025
8a38597
Close Virtual Keyboard when Mathinput is closed
Meinzzzz Dec 8, 2025
f1b2d0b
Increas Mathfield font size and ensure virtual keyboard appears above…
Meinzzzz Dec 8, 2025
70f46de
MathLive virtual keyboard only appears when focusing the mathfield
Meinzzzz Dec 8, 2025
b1d92c4
Fix Tab issues
Meinzzzz Dec 8, 2025
30ea81d
Improve virtual keyboard logic and fix Tab issues
Meinzzzz Dec 8, 2025
60debca
Improve comments
Meinzzzz Dec 10, 2025
29f0881
Fix clicking issue in Mathfield
Meinzzzz Dec 10, 2025
633a09d
Fix sync bug
Meinzzzz Dec 11, 2025
22941a9
Fix sync issues
Meinzzzz Dec 12, 2025
a6ede8f
Improve mathinputview
Meinzzzz Dec 12, 2025
c02491d
Remove unnecessary any casts in math plugin
Meinzzzz Dec 12, 2025
07de353
Adding comments and improving code quality in math input views
Meinzzzz Dec 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ upload
.svelte-kit

# docs
site/
**/__screenshots__/
2 changes: 1 addition & 1 deletion packages/ckeditor5-math/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@
]
},
"dependencies": {
"@ckeditor/ckeditor5-icons": "47.2.0"
"mathlive": "0.108.2"
}
}
3 changes: 3 additions & 0 deletions packages/ckeditor5-math/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import ckeditor from './../theme/icons/math.svg?raw';
import './augmentation.js';
import "../theme/mathform.css";
import 'mathlive';
import 'mathlive/fonts.css';
import 'mathlive/static.css';

export { default as Math } from './math.js';
export { default as MathUI } from './mathui.js';
Expand Down
33 changes: 15 additions & 18 deletions packages/ckeditor5-math/src/mathui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default class MathUI extends Plugin {
this._balloon.showStack( 'main' );

requestAnimationFrame(() => {
this.formView?.mathInputView.fieldView.element?.focus();
this.formView?.mathLiveInputView.focus();
});
}

Expand Down Expand Up @@ -89,13 +89,22 @@ export default class MathUI extends Plugin {
mathConfig.katexRenderOptions!
);

formView.mathInputView.bind( 'value' ).to( mathCommand, 'value' );
formView.mathLiveInputView.bind( 'value' ).to( mathCommand, 'value' );
formView.displayButtonView.bind( 'isOn' ).to( mathCommand, 'display' );

// Form elements should be read-only when corresponding commands are disabled.
formView.mathInputView.bind( 'isReadOnly' ).to( mathCommand, 'isEnabled', value => !value );
formView.saveButtonView.bind( 'isEnabled' ).to( mathCommand );
formView.displayButtonView.bind( 'isEnabled' ).to( mathCommand );
formView.mathLiveInputView.bind( 'isReadOnly' ).to( mathCommand, 'isEnabled', value => !value );
formView.saveButtonView.bind( 'isEnabled' ).to(
mathCommand,
'isEnabled',
formView.mathLiveInputView,
'value',
( commandEnabled, equation ) => {
const normalizedEquation = ( equation ?? '' ).trim();
return commandEnabled && normalizedEquation.length > 0;
}
);
formView.displayButtonView.bind( 'isEnabled' ).to( mathCommand, 'isEnabled' );

// Listen to submit button click
this.listenTo( formView, 'submit', () => {
Expand All @@ -122,18 +131,6 @@ export default class MathUI extends Plugin {
}
});

// Allow the textarea to be resizable
formView.mathInputView.fieldView.once('render', () => {
const textarea = formView.mathInputView.fieldView.element;
if (!textarea) return;
Object.assign(textarea.style, {
resize: 'both',
height: '100px',
width: '400px',
minWidth: '100%',
});
});

return formView;
}

Expand Down Expand Up @@ -162,7 +159,7 @@ export default class MathUI extends Plugin {
} );

if ( this._balloon.visibleView === this.formView ) {
this.formView.mathInputView.fieldView.element?.select();
this.formView.mathLiveInputView.focus();
}

// Show preview element
Expand Down
Loading