Skip to content

Latest commit

 

History

History
22 lines (15 loc) · 1.68 KB

README.md

File metadata and controls

22 lines (15 loc) · 1.68 KB

This project is a fork of Draw2D by FreeGroup.

Changes I've made:

  1. Added 2 new commands:

    • src\command\CommandSetImage.js through which you can change the image of a draw2d.shape.basic.Image node.
    • src\command\CommandUnmarshal.js used for situations when you want to add nodes to the canvas that are marshaled.
  2. Added in peerDependencies a minimum jQuery version of 3.0.0 since I have updated src\lib\jquery.contextmenu.js to 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.
  3. Fixed a bug in src/command/CommandStack.js in the off method where it was not actually removing the event listener callback it was supposed to remove.

  4. Replaced the canvg-browser package with canvg since canvg-browser is no longer maintained and had security issues. I also had to update src\io\png\Writer.js.

  5. Updated libraryTarget and globalObject in webpack.config.js to fix some import issues and make the library compatible with various environments.

    • libraryTarget was updated to ensure the library can be used in different module systems (e.g., CommonJS, AMD, UMD).
    • globalObject was set to this to make the library compatible with both browser and Node.js environments.
  6. In src\io\json\Reader.js I have replaced Function(...)() 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 Function constructor and instead uses safer alternatives to achieve the same functionality.