This project is a fork of Draw2D by FreeGroup.
Changes I've made:
-
Added 2 new commands:
src\command\CommandSetImage.js
through which you can change the image of adraw2d.shape.basic.Image
node.src\command\CommandUnmarshal.js
used for situations when you want to add nodes to the canvas that are marshaled.
-
Added in
peerDependencies
a minimum jQuery version of 3.0.0 since I have updatedsrc\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.
-
Fixed a bug in
src/command/CommandStack.js
in theoff
method where it was not actually removing the event listener callback it was supposed to remove. -
Replaced the
canvg-browser
package withcanvg
sincecanvg-browser
is no longer maintained and had security issues. I also had to updatesrc\io\png\Writer.js
. -
Updated
libraryTarget
andglobalObject
inwebpack.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 tothis
to make the library compatible with both browser and Node.js environments.
-
In
src\io\json\Reader.js
I 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
Function
constructor and instead uses safer alternatives to achieve the same functionality.
- The original code used