Commit Graph

14 Commits (c45b78a4daf526ef528239a9bda38133e869cbe7)

Author SHA1 Message Date
Thomas Bouffard 835bfe7ce9
feat: allow to load an XML-stored model produced by `mxGraph` (#300)
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.
2024-01-16 11:03:56 +01:00
Thomas Bouffard 41a3fbfd55
ci: automate npm publish (#305)
Add a workflow that performs the publishing when a new Git tag is
pushed.
2024-01-14 16:28:29 +01:00
Thomas Bouffard 20c31f9bc6
fix: define CellStyle.portConstraintRotation as boolean (#299)
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.
2024-01-10 07:56:55 +01:00
Thomas Bouffard 7c94e0c3af
ci: automate the creation of the draft GitHub release (#303)
Provide a template that will ease the GitHub release writing.
This will also ensure that the content of all release notes is
consistent.
2024-01-10 06:41:09 +01:00
Thomas Bouffard 2cd17f1a3e
docs: skip release of the examples repository (#302)
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.
2024-01-10 06:11:44 +01:00
Thomas Bouffard 7544da2da3 chore(release): prepare version 0.6.0
Also improve the release procedure.
2023-12-22 08:26:38 +01:00
Thomas Bouffard 99ffdfa29b
feat: add `ModelXmlSerializer` to import/export the model (#290)
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
2023-12-18 15:53:43 +01:00
Thomas Bouffard f9b2d7d19a
refactor!: move codecs to dedicated files and reduce side effects (#289)
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`
2023-12-13 17:39:40 +01:00
Thomas Bouffard 1507490c72
docs(release): improve the "examples repository update" paragraph (#285)
Changes are based on the feedback collected during the  `0.5.0` release:
  - Use Dependabot to update `maxGraph`
  - Fix link to GitHub releases.
2023-12-11 08:49:27 +01:00
Thomas Bouffard 9463e1e21e chore(release): prepare version 0.5.0
Also improve the documentation of the release procedure.
2023-12-07 16:57:36 +01:00
Thomas Bouffard 068a50f35c
docs: remove extra "markdown-page" page (#274)
This page is an example from the Docusaurus initialization. It has been
kept by mistake.
2023-12-04 02:35:28 +01:00
Thomas Bouffard d46e99a114
docs: improve the migration guide from mxGraph (#271)
Provide various improvements
  - fix `InternalEvent`
  - improve `Client`
  - improve explanations about plugins
  - removed `mxUtils` methods
  - removed `isVisible` methods

Also use more admonitions.
2023-12-04 00:57:50 +01:00
Thomas Bouffard 17f31fcc5c
chore: clean before pack (#270)
This simplifies the release procedure. No manual cleaning is required,
this reduces the risk of errors.
2023-12-03 21:50:14 +01:00
Thomas Bouffard 6e6009aebd
docs: build the user documentation with Docusaurus (#264)
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`
2023-11-27 18:53:52 +01:00