You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previously it was possible to customize CKEditor5Integration since you could do something like
import MathTypePlugin from '@wiris/mathtype-ckeditor5';
import Integration from '@wiris/mathtype-ckeditor5/src/integration';
class MyIntegration extends Integration {
insertMathml(mathml: string) {
console.log("Custom insertMathml here")
}
}
export default class MyPlugin extends MathTypePlugin {
_addIntegration() {
return new MyIntegration()
}
}
This is not possible anymore with your new installation method (import MathType from '@wiris/mathtype-ckeditor5/dist/index.js';) because CKEditor5Integration (and other classes that are exported in the old installation method, but not in the new one) are not exported from that file.
And combining it with old installation methods doesn't work either, likely because of many reasons, one being that MathTypeCommand throws an error if CKEditor5Integration if the integration extends another class which it is, since the class in the dist version is not the same as the source version
import MathType from '@wiris/mathtype-ckeditor5/dist/index.js';
import Integration from '@wiris/mathtype-ckeditor5/src/integration';
class MyIntegration extends Integration {
insertMathml(mathml: string) {
// Custom handling here
}
}
export default class MyPlugin extends CKEditor5Integration {
_addIntegration() {
return new MyIntegration()
}
}
on Google Chrome, Version 128.0.6613.120 (Official Build) (arm64), MacOS 14.5
Steps to reproduce
Use the example above. In _addIntegration you can add the same code as in the original function but replace integration = new CKEditor5Integration(integrationProperties); with MyIntegration
Expected result
You should be able to use MathType and see Custom insertMathml here in the console when inserting
Actual result
Error in the console: 'Must pass a valid CKEditor5Integration instance as attribute "integration" of options'
Other details
Something like this will likely solve the issue?
export {default as CKEditor5Integration} from './integration'
// And why not export the rest too (since they are available using legacy install method and exported in the package.json file)?
export * from './commands'
Your proposal seems possible. The team will conduct an investigation and let you know what the final solution is once it's released. Any further issues, please feel free to contact us or write an email to our support team at [email protected].
Description
Previously it was possible to customize
CKEditor5Integration
since you could do something likeThis is not possible anymore with your new installation method (
import MathType from '@wiris/mathtype-ckeditor5/dist/index.js';
) becauseCKEditor5Integration
(and other classes that are exported in the old installation method, but not in the new one) are not exported from that file.And combining it with old installation methods doesn't work either, likely because of many reasons, one being that MathTypeCommand throws an error if
CKEditor5Integration
if the integration extends another class which it is, since the class in the dist version is not the same as the source versionEnvironment
Using
on
Google Chrome
,Version 128.0.6613.120 (Official Build) (arm64)
,MacOS 14.5
Steps to reproduce
Use the example above. In
_addIntegration
you can add the same code as in the original function but replaceintegration = new CKEditor5Integration(integrationProperties);
withMyIntegration
Expected result
You should be able to use MathType and see
Custom insertMathml here
in the console when insertingActual result
Error in the console:
'Must pass a valid CKEditor5Integration instance as attribute "integration" of options'
Other details
Something like this will likely solve the issue?
in https://github.com/wiris/html-integrations/blob/4bc9bffd9a87ae2560621777f23e97994027d153/packages/ckeditor5/src/index.js
The text was updated successfully, but these errors were encountered: