README.md
December 19, 2024 ยท View on GitHub
This project is a fork of Draw2D by FreeGroup.
Changes I've made:
-
Added 2 new commands:
src\command\CommandSetImage.jsthrough which you can change the image of adraw2d.shape.basic.Imagenode.src\command\CommandUnmarshal.jsused for situations when you want to add nodes to the canvas that are marshaled.
-
Added in
peerDependenciesa minimum jQuery version of 3.0.0 since I have updatedsrc\lib\jquery.contextmenu.jsto use.addBack()instead of.andSelf()as it was removed in jQuery 3.0.0.- This is a breaking change, so the library package version has been updated to 2.0.0.
-
Fixed a bug in
src/command/CommandStack.jsin theoffmethod where it was not actually removing the event listener callback it was supposed to remove. -
Replaced the
canvg-browserpackage withcanvgsincecanvg-browseris no longer maintained and had security issues. I also had to updatesrc\io\png\Writer.js. -
Updated
libraryTargetandglobalObjectinwebpack.config.jsto fix some import issues and make the library compatible with various environments.libraryTargetwas updated to ensure the library can be used in different module systems (e.g., CommonJS, AMD, UMD).globalObjectwas set tothisto make the library compatible with both browser and Node.js environments.
-
In
src\io\json\Reader.jsI have replacedFunction(...)()with a safer version.- The original code used
Function(...)()which can be a security risk as it allows execution of arbitrary code. - The safer version avoids using the
Functionconstructor and instead uses safer alternatives to achieve the same functionality.
- The original code used