Implementation relies on both the declaration of aliases and the
introduction of dedicated codecs.
`Codec.getCodecByName` now takes aliases into account, so that importing
is fully functional.
The code of some `CodecRegistry` and `Codec` methods has been simplified
(check for nullity of method parameters).
The cell style is converted thanks to a specific utility function that
can serve as an example for those wishing to migrate their applications
from mxGraph to maxGraph.
test
- The `Codec` example has been restored from the stashed directory. It
is now available as a story written in TypeScript.
- The `ModelChecker` utility class was previously used only to validate
the imported model after import from the maxGraph model. It is now
shared and also used in mxGraph import tests. It has also been enhanced
to check the total number of cells in the model.
It was incorrectly defined as DIRECTION after the migration from
mxGraph.
Also improve the type signature and JSDoc of
mathUtils.getPortConstraints which is the only function that uses the
`portConstraintRotation` property in maxGraph.
The release process of the "examples" repository is directly documented
and managed in the repository.
This makes the 2 repositories more independent, and provides more
flexibility.
This class was previously only available in test. It simplifies maxGraph
model import/export as:
- it hides `Codec` and `HTMLElement` management
- it registers codecs automagically
Previously, codec classes were defined and registered in the same file
as the class they targeted. This prevented efficient tree-shaking: as
soon as the target class was imported (e.g. `StyleSheet`), the
corresponding codec was also imported (`StyleSheetCodec`). As a result,
a large amount of codec code (and dependent code) was present in
applications incorporating maxGraph, even if they didn't use the codec
function. As there are currently many problems with the codec function
that make it almost unusable, this was a great waste.
Codecs are no longer registered by default, which reduces side effects
and coupling.
It also greatly improves tree-shaking.
For example, in the `ts-example` application included in this repository
which doesn't use the "codec" feature, the size of the minified
`maxGraph` chunk goes from `568.58 kB` to `467.90 kB`, which corresponds
to a size reduction of `17.7%`!
BREAKING CHANGE: Codecs supplied by `maxGraph` are no longer registered
by default. They MUST be registered before performing an `encode` or
`decode`. You can use one of the following functions to register codecs:
- `registerAllCodecs`
- `registerCoreCodecs`
- `registerEditorCodecs`
Provide various improvements
- fix `InternalEvent`
- improve `Client`
- improve explanations about plugins
- removed `mxUtils` methods
- removed `isVisible` methods
Also use more admonitions.
Initiate the website with Docusaurus v3.
Setup the site and includes the content that was already available in
the `docs` package.
The currently implementation mainly uses the default theme available
when using the Docusaurus scaffolding. It was initiated with:
`npx create-docusaurus@3.0.0 my-website classic`