@svgedit/svgcanvas 7.1.5 → 7.2.0
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/common/browser.js +67 -0
- package/common/util.js +198 -0
- package/{blur-event.js → core/blur-event.js} +0 -0
- package/{clear.js → core/clear.js} +0 -0
- package/{coords.js → core/coords.js} +0 -0
- package/{copy-elem.js → core/copy-elem.js} +0 -0
- package/{dataStorage.js → core/dataStorage.js} +0 -0
- package/{draw.js → core/draw.js} +1 -1
- package/{elem-get-set.js → core/elem-get-set.js} +1 -1
- package/{event.js → core/event.js} +19 -5
- package/{history.js → core/history.js} +0 -0
- package/{historyrecording.js → core/historyrecording.js} +0 -0
- package/{json.js → core/json.js} +0 -0
- package/{layer.js → core/layer.js} +0 -0
- package/{math.js → core/math.js} +0 -0
- package/{namespaces.js → core/namespaces.js} +0 -0
- package/{paint.js → core/paint.js} +0 -0
- package/{paste-elem.js → core/paste-elem.js} +0 -0
- package/{path-actions.js → core/path-actions.js} +0 -0
- package/{path-method.js → core/path-method.js} +0 -0
- package/{path.js → core/path.js} +0 -0
- package/{recalculate.js → core/recalculate.js} +17 -5
- package/{sanitize.js → core/sanitize.js} +0 -0
- package/{select.js → core/select.js} +102 -85
- package/{selected-elem.js → core/selected-elem.js} +3 -3
- package/{selection.js → core/selection.js} +2 -2
- package/{svg-exec.js → core/svg-exec.js} +8 -5
- package/{svgroot.js → core/svgroot.js} +0 -0
- package/{text-actions.js → core/text-actions.js} +1 -1
- package/{touch.js → core/touch.js} +0 -0
- package/{undo.js → core/undo.js} +1 -1
- package/{units.js → core/units.js} +0 -0
- package/{utilities.js → core/utilities.js} +19 -9
- package/demos/canvas.html +1 -3
- package/dist/svgcanvas.js +55562 -397
- package/dist/svgcanvas.js.map +1 -1
- package/package.json +5 -3
- package/{rollup.config.js → rollup.config.mjs} +0 -2
- package/svgcanvas.js +27 -27
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@svgedit/svgcanvas",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.0",
|
|
4
4
|
"description": "SVG Canvas",
|
|
5
5
|
"main": "dist/svgcanvas.js",
|
|
6
6
|
"author": "Narendra Sisodiya",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"not OperaMini all"
|
|
39
39
|
],
|
|
40
40
|
"standard": {
|
|
41
|
-
"ignore": [],
|
|
41
|
+
"ignore": ["dist"],
|
|
42
42
|
"globals": [
|
|
43
43
|
"cy",
|
|
44
44
|
"assert"
|
|
@@ -49,6 +49,8 @@
|
|
|
49
49
|
]
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
|
-
"build": "rollup -c"
|
|
52
|
+
"build": "rollup -c",
|
|
53
|
+
"prebuild": "standard . && npm i",
|
|
54
|
+
"prepublishOnly": "npm run build"
|
|
53
55
|
}
|
|
54
56
|
}
|
|
@@ -6,7 +6,6 @@ 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
|
-
import { terser } from 'rollup-plugin-terser'
|
|
10
9
|
// import progress from 'rollup-plugin-progress';
|
|
11
10
|
import filesize from 'rollup-plugin-filesize'
|
|
12
11
|
|
|
@@ -31,7 +30,6 @@ const config = [{
|
|
|
31
30
|
}),
|
|
32
31
|
commonjs(),
|
|
33
32
|
babel({ babelHelpers: 'bundled', exclude: [/\/core-js\//] }), // exclude core-js to avoid circular dependencies.
|
|
34
|
-
terser({ keep_fnames: true }), // keep_fnames is needed to avoid an error when calling extensions.
|
|
35
33
|
filesize()
|
|
36
34
|
]
|
|
37
35
|
}]
|
package/svgcanvas.js
CHANGED
|
@@ -9,36 +9,36 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import 'pathseg' // SVGPathSeg Polyfill (see https://github.com/progers/pathseg)
|
|
11
11
|
|
|
12
|
-
import Paint from './paint.js'
|
|
13
|
-
import * as pathModule from './path.js'
|
|
14
|
-
import * as history from './history.js'
|
|
15
|
-
import * as draw from './draw.js'
|
|
16
|
-
import { init as pasteInit, pasteElementsMethod } from './paste-elem.js'
|
|
17
|
-
import { init as touchInit } from './touch.js'
|
|
18
|
-
import { svgRootElement } from './svgroot.js'
|
|
12
|
+
import Paint from './core/paint.js'
|
|
13
|
+
import * as pathModule from './core/path.js'
|
|
14
|
+
import * as history from './core/history.js'
|
|
15
|
+
import * as draw from './core/draw.js'
|
|
16
|
+
import { init as pasteInit, pasteElementsMethod } from './core/paste-elem.js'
|
|
17
|
+
import { init as touchInit } from './core/touch.js'
|
|
18
|
+
import { svgRootElement } from './core/svgroot.js'
|
|
19
19
|
import {
|
|
20
20
|
init as undoInit,
|
|
21
21
|
changeSelectedAttributeNoUndoMethod,
|
|
22
22
|
changeSelectedAttributeMethod
|
|
23
|
-
} from './undo.js'
|
|
24
|
-
import { init as selectionInit } from './selection.js'
|
|
25
|
-
import { init as textActionsInit, textActionsMethod } from './text-actions.js'
|
|
26
|
-
import { init as eventInit } from './event.js'
|
|
23
|
+
} from './core/undo.js'
|
|
24
|
+
import { init as selectionInit } from './core/selection.js'
|
|
25
|
+
import { init as textActionsInit, textActionsMethod } from './core/text-actions.js'
|
|
26
|
+
import { init as eventInit } from './core/event.js'
|
|
27
27
|
import {
|
|
28
28
|
init as jsonInit,
|
|
29
29
|
getJsonFromSvgElements,
|
|
30
30
|
addSVGElementsFromJson
|
|
31
|
-
} from './json.js'
|
|
32
|
-
import * as elemGetSet from './elem-get-set.js'
|
|
33
|
-
import { init as selectedElemInit } from './selected-elem.js'
|
|
31
|
+
} from './core/json.js'
|
|
32
|
+
import * as elemGetSet from './core/elem-get-set.js'
|
|
33
|
+
import { init as selectedElemInit } from './core/selected-elem.js'
|
|
34
34
|
import {
|
|
35
35
|
init as blurInit,
|
|
36
36
|
setBlurNoUndo,
|
|
37
37
|
setBlurOffsets,
|
|
38
38
|
setBlur
|
|
39
|
-
} from './blur-event.js'
|
|
40
|
-
import { sanitizeSvg } from './sanitize.js'
|
|
41
|
-
import { getReverseNS, NS } from './namespaces.js'
|
|
39
|
+
} from './core/blur-event.js'
|
|
40
|
+
import { sanitizeSvg } from './core/sanitize.js'
|
|
41
|
+
import { getReverseNS, NS } from './core/namespaces.js'
|
|
42
42
|
import {
|
|
43
43
|
assignAttributes,
|
|
44
44
|
cleanupElement,
|
|
@@ -65,28 +65,28 @@ import {
|
|
|
65
65
|
getFeGaussianBlur,
|
|
66
66
|
stringToHTML,
|
|
67
67
|
insertChildAtIndex
|
|
68
|
-
} from './utilities.js'
|
|
68
|
+
} from './core/utilities.js'
|
|
69
69
|
import {
|
|
70
70
|
matrixMultiply,
|
|
71
71
|
hasMatrixTransform,
|
|
72
72
|
transformListToTransform
|
|
73
|
-
} from './math.js'
|
|
74
|
-
import { convertToNum, init as unitsInit, getTypeMap, isValidUnit, convertUnit } from './units.js'
|
|
75
|
-
import { init as svgInit } from './svg-exec.js'
|
|
76
|
-
import { remapElement, init as coordsInit } from './coords.js'
|
|
73
|
+
} from './core/math.js'
|
|
74
|
+
import { convertToNum, init as unitsInit, getTypeMap, isValidUnit, convertUnit } from './core/units.js'
|
|
75
|
+
import { init as svgInit } from './core/svg-exec.js'
|
|
76
|
+
import { remapElement, init as coordsInit } from './core/coords.js'
|
|
77
77
|
import {
|
|
78
78
|
recalculateDimensions,
|
|
79
79
|
init as recalculateInit
|
|
80
|
-
} from './recalculate.js'
|
|
81
|
-
import { getSelectorManager, Selector, init as selectInit } from './select.js'
|
|
82
|
-
import { clearSvgContentElementInit, init as clearInit } from './clear.js'
|
|
80
|
+
} from './core/recalculate.js'
|
|
81
|
+
import { getSelectorManager, Selector, init as selectInit } from './core/select.js'
|
|
82
|
+
import { clearSvgContentElementInit, init as clearInit } from './core/clear.js'
|
|
83
83
|
import {
|
|
84
84
|
getClosest,
|
|
85
85
|
getParents,
|
|
86
86
|
mergeDeep
|
|
87
|
-
} from '
|
|
87
|
+
} from './common/util.js'
|
|
88
88
|
|
|
89
|
-
import dataStorage from './dataStorage.js'
|
|
89
|
+
import dataStorage from './core/dataStorage.js'
|
|
90
90
|
|
|
91
91
|
const visElems =
|
|
92
92
|
'a,circle,ellipse,foreignObject,g,image,line,path,polygon,polyline,rect,svg,text,tspan,use'
|