Commit Graph

128 Commits (aeea27dcc87a8866be9f90cebffbb855eabe65bb)

Author SHA1 Message Date
Thomas Bouffard 9e7a6034c7
Apply eslint and prettier autofixes on codebase (#133)
Refactor code based on eslint and prettier rules
2022-11-20 17:03:20 +01:00
Anatoliy Mayorov 53eb5c91a9 fix: typescript transpile error (#138) 2022-11-20 15:00:16 +03:00
Anatoliy Mayorov a3102afa74 refactor: abstract classes, empty methods
Add abstract definition to abstract classes
Fill empty methods blocks with return
Remove unnecessary escapes in regexes
2022-11-20 14:05:46 +03:00
Anatoliy Mayorov 5a29d2fa1a refactor: fix eslint errors
Eliminate unnecessary code
Eliminate var usage
2022-11-20 14:02:48 +03:00
Thomas Bouffard d30e3a239d
Fix edge segment handles not being rendered (#120)
Fixed rendering of handles on segments of edges
2022-11-14 07:23:34 +01:00
Thomas Bouffard 27f75a59f3
docs: set the minimum TypeScript requirement to 3.8 (#128)
We use a recent TypeScript version to build maxGraph but applications
that integrates it may be forced to use old TypeScript versions.
We never explain what is the minimum TypeScript version requires to use
`maxGraph`. The changes proposed here are a first step to make this
information available.
It is only informative for now (mentioned in the README) and the minimum
TypeScript version is tested in the `ts-support` package (part of the
'build' GitHub workflow).
2022-11-07 18:31:40 +01:00
Anatoliy Mayorov 2ad1395aab refactor: run eslint and prettier on codebase 2022-10-29 22:53:09 +03:00
Анатолий Майоров 9428ba2a4a
fix: DynamicLoading story, Codec and parseXml (#125)
Fix `DynamicLoading` story
Restored backward compatibility when using `parseXml`
Possible fix for `Codec.decode` method issue
2022-10-28 15:37:02 +02:00
Anatoliy Mayorov d53ea1ad2b chore(tsconfig): move baseUrl to base tsconfig 2022-10-23 11:56:07 +03:00
Anatoliy Mayorov 7e5360ad97 chore(tsconfig): add base tsconfig.json 2022-10-23 10:33:45 +03:00
Thomas Bouffard ef76a1db87
Merge branch 'development' into development 2022-10-22 10:41:32 +02:00
Thomas Bouffard 5b1369b019
Merge pull request #119 from mayorovad/edge-mixin-typo
Fix wrong method signature in EdgeMixin (resetEdgesOnMove).
2022-10-10 07:22:42 +02:00
Thomas Bouffard f08b041c3d
Merge pull request #121 from mayorovad/overlays-stories-fix
Fix stories with overlays usage
2022-10-10 07:14:30 +02:00
Thomas Bouffard 4622527af8
Merge pull request #124 from mayorovad/issue-96 2022-10-09 22:32:39 +02:00
Thomas Bouffard a617bb644a
Merge pull request #113 from mayorovad/visibility-story-fix
Fixed `Visibility` story
2022-10-09 20:05:57 +02:00
Thomas Bouffard 4804767baf
Merge pull request #117 from mayorovad/guides-fix
Fixed `Guides` story.
2022-10-09 20:05:29 +02:00
Thomas Bouffard 57a8d63ff3
Merge pull request #108 from maxGraph/svgcanvas
Fixes null checks in SvgCanvas2D.
2022-10-09 19:39:49 +02:00
Thomas Bouffard c4f537203b Move layout types to a dedicated types file
These types are only used in the layout classes, so keep them located closed in the folder where they are used.
2022-10-09 19:08:12 +02:00
Thomas Bouffard 7c4b1111ee Apply prettier rules on layout types 2022-10-09 19:02:24 +02:00
Thomas Bouffard b16fa54411
Merge branch 'development' into development 2022-10-09 18:31:25 +02:00
Thomas Bouffard d0a01c2d44
Merge branch 'development' into edge-mixin-typo 2022-10-09 18:30:35 +02:00
Anatoliy Mayorov 1603729a9b fix: types of Hierarchical and Swimlane Layout #96 2022-10-08 21:43:35 +03:00
Anatoliy Mayorov deda3ec03f Fix absolute import path to relative (PR #109) 2022-10-06 16:38:08 +03:00
Anatoliy Mayorov eee2fc8509 Fix stories with overlays usage 2022-10-06 10:58:33 +03:00
Anatoliy Mayorov 572af8c459 Fix edge segment handles not being rendered
Combination of side-effects when porting broke
edge segment handles rendering, fixed some of them
2022-10-05 18:43:29 +03:00
Anatoliy Mayorov 19273293a1 Fixed typo in typings of EdgeMixin 2022-10-05 16:50:46 +03:00
mayorovad 38117aefb2 Fixed Guides story 2022-10-04 11:47:03 +03:00
mayorovad 699fbc9590 Fixed Visibility story 2022-10-03 11:07:39 +03:00
mayorovad f84a4a5836 Changed the type of cells map in GraphDataModel 2022-09-26 11:54:20 +03:00
Anatoliy Mayorov b62eb538f7 deps: bump typescript to 4.8.3, fix Dictionary typings
When running `generate-types` script in core package
there is typescript error TS2345 in src/util/Dictionary.ts,
added changes to fix it.

- Moved types IdentityObject and IdentityFunction to types.ts
- Renamed const FIELD_NAME to IDENTITY_FIELD_NAME and
moved it to util/Constants.ts
- Set Cell and CellOverlay to implement IdentityObject
2022-09-24 14:20:53 +03:00
Thomas Bouffard b7cfeebd23 ts-example: restore the rounded shape in the custom rectangle 2022-09-24 11:16:26 +02:00
Thomas Bouffard 8c29223b98 Remove remaining commented method signatures including types (dated from the JS to TS migration) 2022-09-24 11:10:04 +02:00
Junsik Shim e986c8ea31 Fixes null checks in SvgCanvas2D #107 2022-09-24 10:58:41 +09:00
Junsik Shim 0a1e797bbc Remove CellArray leftovers. 2022-09-17 19:33:16 +09:00
Junsik Shim ec7a525ea0 Change CellArray to cellArrayUtils. 2022-09-17 18:58:30 +09:00
Junsik Shim 722021006d Fix CellArray related warnings. #96 2022-09-17 18:57:00 +09:00
Thomas Bouffard ea836a1fb5
chore: improve vite config in ts-example (#104)
bump vite from 2.9.12 to 3.1.0
add vite config to generate a dedicated chunk for maxgraph@core. It lets know the size the produced bundle in an
external application and if tree shaking works.
2022-09-14 13:15:04 +02:00
Thomas Bouffard f9d757548e
doc: update copyright and license in source file headers (#100)
Ensure that all source files contain the Apache-2.0 license and that the 'maxGraph Contributors' are mentioned.
2022-08-30 17:36:33 +02:00
Thomas Bouffard 311514dca3
refactor: clean the Client class (#94)
Remove unused static properties
  - mxForceIncludes: it was used to force loading the JavaScript files in development mode in mxGraph. We are not managing development mode in that way anymore.
  - mxLoadResource: not used anymore
  - mxLoadStylesheets: not used anymore
  - mxResourceExtension: it was only used in Translations, so only keep the Translations settings

Move and rename the link function. It is not a general function, so move it as `domUtils#addLinkToHead`

Fix documentation of static properties
2022-07-16 07:15:04 +02:00
Thomas Bouffard 893ad44ff2
chore: improve the configuration to build the npm package (#87)
Root and all package.json files
  - Fix license, version and authors
  - Remove the non-relevant .npmignore file at the project. It was designed for mxgraph, the whole directory structure
  changed, and we don't plan to publish the root package

`core` package
  - Generate type definition and javascript files for ESM output
    - dedicated folder for `esm` and `types` in the `dist` folder to clearly separate concerns
    - exported in the package.json
  - Add npm script for `npm pack` configuration
  - Drop the `postinstall` npm script that built the `core` bundle. It would have been run when the package is installed
  in dependent projects at dependencies install. And it would have failed as it tries to build the project from TypeScript
  sources that are not available in the npm package.

fix: ConstraintHandler now loads image as everywhere else in the code using `Client.imageBasePath`
Using import doesn't work as the image is not available in the npm package. It generated error like this in ViteJS
project:
Failed to resolve import "../../../images/point.gif" from "../core/dist/esm/view/handler/ConstraintHandler.js". Does the file exist?
This gif import had been introduced to make `Anchors.stories.js` retrieve the gif file. Configuring `imageBasePath` as
already done in other stories fixes the issue.

Don't export EditorCodec and StylesheetCodec as they generate errors.
This is a temporary solution to avoid error in dependent project (at least, with ViteJS projects).
2022-07-05 08:08:25 +02:00
Junsik Shim 3991e7ab1e
Merge pull request #82 from maxGraph/cellstyle
Changed the type of cell style from string to CellStyle.
2022-05-20 09:38:08 +09:00
Thomas Bouffard 760cbd3f05
chore: clean tsconfig.json (#86)
Remove `allowJs` (the whole code is now migrated to TypeScript) and `jsx` (we are not using it).
Don't `skipLibCheck` for stronger type checks.
2022-05-17 12:24:48 +02:00
Junsik Shim 8f80956d0e Changed baseStyleName to baseStyleNames. 2022-05-08 18:18:53 +09:00
Junsik Shim 91d9c13286 Changed baseStyleName to baseStyleNames. 2022-05-08 18:05:22 +09:00
Junsik Shim a284987daf Updated comments. 2022-04-28 20:42:12 +09:00
Junsik Shim 07565aae9b Changed the type of cell style from string to CellStyle. 2022-04-17 20:49:09 +09:00
Junsik Shim b51504d7bb Changed the type of cell style from string to CellStyle. 2022-04-17 15:58:35 +09:00
Junsik Shim 0340b72c10 Changed the type of cell style from string to CellStyle. 2022-04-14 14:23:37 +09:00
Thomas Bouffard 443ebf7a52
chore: GitHub workflow generates TypeScript declarations (#80)
This ensures we don't have type errors in the code.

Update tsconfig to only include source TS files.
Previous configuration prevented to run the type generation twice.
The generated d.ts files were considered as source files, so we got file override errors.

Add a dedicated npm script to generate scripts.
We cannot directly call the tsc or lerna commands on the macOS GH actions runner, so introduce the script.
2022-04-03 13:09:24 +02:00
CD Yang 7fa2b433c3
fix: edge handlers use style.edgeStyle (#78)
Use the `edgeStyle` property of `CellStateStyles` in `ElbowEdgeHandler` and `EdgeHandler`.
2022-02-20 17:44:37 +01:00