@svgedit/svgcanvas 7.2.2 → 7.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGES.md +3 -0
- package/core/draw.js +159 -149
- package/core/event.js +5 -3
- package/core/json.js +1 -1
- package/dist/svgcanvas.js +975 -1316
- package/dist/svgcanvas.js.map +1 -1
- package/package.json +1 -1
- package/rollup.config.mjs +1 -0
- package/svgcanvas.js +17 -0
package/package.json
CHANGED
package/rollup.config.mjs
CHANGED
|
@@ -6,6 +6,7 @@ import { rimraf } from 'rimraf'
|
|
|
6
6
|
import babel from '@rollup/plugin-babel'
|
|
7
7
|
import { nodeResolve } from '@rollup/plugin-node-resolve'
|
|
8
8
|
import commonjs from '@rollup/plugin-commonjs'
|
|
9
|
+
|
|
9
10
|
// import progress from 'rollup-plugin-progress';
|
|
10
11
|
import filesize from 'rollup-plugin-filesize'
|
|
11
12
|
|
package/svgcanvas.js
CHANGED
|
@@ -308,6 +308,9 @@ class SvgCanvas {
|
|
|
308
308
|
this.contentW = this.getResolution().w
|
|
309
309
|
this.contentH = this.getResolution().h
|
|
310
310
|
this.clear()
|
|
311
|
+
|
|
312
|
+
// creates custom modeEvent for editor
|
|
313
|
+
this.modeChangeEvent()
|
|
311
314
|
} // End constructor
|
|
312
315
|
|
|
313
316
|
getSvgOption () {
|
|
@@ -827,6 +830,11 @@ class SvgCanvas {
|
|
|
827
830
|
? this.curText
|
|
828
831
|
: this.curShape
|
|
829
832
|
this.currentMode = name
|
|
833
|
+
|
|
834
|
+
// fires modeChange event for the editor
|
|
835
|
+
if (this.modeEvent) {
|
|
836
|
+
document.dispatchEvent(this.modeEvent)
|
|
837
|
+
}
|
|
830
838
|
}
|
|
831
839
|
|
|
832
840
|
/**
|
|
@@ -1283,6 +1291,7 @@ class SvgCanvas {
|
|
|
1283
1291
|
this.hasMatrixTransform = hasMatrixTransform
|
|
1284
1292
|
this.transformListToTransform = transformListToTransform
|
|
1285
1293
|
this.convertToNum = convertToNum
|
|
1294
|
+
this.convertUnit = convertUnit
|
|
1286
1295
|
this.findDefs = findDefs
|
|
1287
1296
|
this.getUrlFromAttr = getUrlFromAttr
|
|
1288
1297
|
this.getHref = getHref
|
|
@@ -1328,6 +1337,14 @@ class SvgCanvas {
|
|
|
1328
1337
|
this.decode64 = decode64
|
|
1329
1338
|
this.mergeDeep = mergeDeep
|
|
1330
1339
|
}
|
|
1340
|
+
|
|
1341
|
+
/**
|
|
1342
|
+
* Creates modeChange event, adds it as an svgCanvas property
|
|
1343
|
+
* **/
|
|
1344
|
+
modeChangeEvent () {
|
|
1345
|
+
const modeEvent = new CustomEvent('modeChange', { detail: { getMode: () => this.getMode() } })
|
|
1346
|
+
this.modeEvent = modeEvent
|
|
1347
|
+
}
|
|
1331
1348
|
} // End class
|
|
1332
1349
|
|
|
1333
1350
|
// attach utilities function to the class that are used by SvgEdit so
|