paper 0.12.18 → 0.12.19
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/CHANGELOG.md +32 -0
- package/dist/docs/assets/js/paper.js +91 -53
- package/dist/docs/classes/Color.html +2 -2
- package/dist/docs/classes/CompoundPath.html +2 -2
- package/dist/docs/classes/Curve.html +2 -2
- package/dist/docs/classes/CurveLocation.html +2 -2
- package/dist/docs/classes/Event.html +2 -2
- package/dist/docs/classes/Gradient.html +2 -2
- package/dist/docs/classes/GradientStop.html +2 -2
- package/dist/docs/classes/Group.html +2 -2
- package/dist/docs/classes/HitResult.html +2 -2
- package/dist/docs/classes/Item.html +2 -2
- package/dist/docs/classes/Key.html +2 -2
- package/dist/docs/classes/KeyEvent.html +2 -2
- package/dist/docs/classes/Layer.html +2 -2
- package/dist/docs/classes/Matrix.html +2 -2
- package/dist/docs/classes/MouseEvent.html +2 -2
- package/dist/docs/classes/PaperScope.html +2 -2
- package/dist/docs/classes/PaperScript.html +2 -2
- package/dist/docs/classes/Path.html +2 -2
- package/dist/docs/classes/PathItem.html +2 -2
- package/dist/docs/classes/Point.html +2 -2
- package/dist/docs/classes/PointText.html +2 -2
- package/dist/docs/classes/Project.html +2 -2
- package/dist/docs/classes/Raster.html +2 -2
- package/dist/docs/classes/Rectangle.html +2 -2
- package/dist/docs/classes/Segment.html +2 -2
- package/dist/docs/classes/Shape.html +2 -2
- package/dist/docs/classes/Size.html +2 -2
- package/dist/docs/classes/Style.html +2 -2
- package/dist/docs/classes/SymbolDefinition.html +2 -2
- package/dist/docs/classes/SymbolItem.html +2 -2
- package/dist/docs/classes/TextItem.html +2 -2
- package/dist/docs/classes/Tool.html +2 -2
- package/dist/docs/classes/ToolEvent.html +2 -2
- package/dist/docs/classes/Tween.html +2 -2
- package/dist/docs/classes/View.html +2 -2
- package/dist/docs/classes/global.html +2 -2
- package/dist/docs/classes/index.html +2 -2
- package/dist/docs/index.html +1 -1
- package/dist/paper-core.js +90 -52
- package/dist/paper-core.min.js +3 -3
- package/dist/paper-full.js +91 -53
- package/dist/paper-full.min.js +3 -3
- package/dist/paper.d.ts +2 -2
- package/package.json +5 -2
- package/dist/paperjs/LICENSE.txt +0 -23
- package/dist/paperjs/dist/node/canvas.js +0 -66
- package/dist/paperjs/dist/node/extend.js +0 -156
- package/dist/paperjs/dist/node/self.js +0 -58
- package/dist/paperjs/dist/node/xml.js +0 -40
- package/dist/paperjs/dist/paper-core.d.ts +0 -1
- package/dist/paperjs/dist/paper-core.js +0 -15703
- package/dist/paperjs/dist/paper-core.min.js +0 -32
- package/dist/paperjs/dist/paper-full.js +0 -17472
- package/dist/paperjs/dist/paper-full.min.js +0 -32
- package/dist/paperjs/dist/paper.d.ts +0 -7394
- package/dist/paperjs/docs/assets/css/docs.css +0 -414
- package/dist/paperjs/docs/assets/js/codemirror.js +0 -4
- package/dist/paperjs/docs/assets/js/docs.js +0 -493
- package/dist/paperjs/docs/assets/js/jquery.js +0 -6
- package/dist/paperjs/docs/assets/js/paper.js +0 -17472
- package/dist/paperjs/docs/classes/Color.html +0 -2188
- package/dist/paperjs/docs/classes/CompoundPath.html +0 -8877
- package/dist/paperjs/docs/classes/Curve.html +0 -2323
- package/dist/paperjs/docs/classes/CurveLocation.html +0 -672
- package/dist/paperjs/docs/classes/Event.html +0 -176
- package/dist/paperjs/docs/classes/Gradient.html +0 -240
- package/dist/paperjs/docs/classes/GradientStop.html +0 -273
- package/dist/paperjs/docs/classes/Group.html +0 -6864
- package/dist/paperjs/docs/classes/HitResult.html +0 -239
- package/dist/paperjs/docs/classes/Item.html +0 -6628
- package/dist/paperjs/docs/classes/Key.html +0 -139
- package/dist/paperjs/docs/classes/KeyEvent.html +0 -308
- package/dist/paperjs/docs/classes/Layer.html +0 -6850
- package/dist/paperjs/docs/classes/Matrix.html +0 -1744
- package/dist/paperjs/docs/classes/MouseEvent.html +0 -355
- package/dist/paperjs/docs/classes/PaperScope.html +0 -459
- package/dist/paperjs/docs/classes/PaperScript.html +0 -198
- package/dist/paperjs/docs/classes/Path.html +0 -11775
- package/dist/paperjs/docs/classes/PathItem.html +0 -8639
- package/dist/paperjs/docs/classes/Point.html +0 -2699
- package/dist/paperjs/docs/classes/PointText.html +0 -7029
- package/dist/paperjs/docs/classes/Project.html +0 -1305
- package/dist/paperjs/docs/classes/Raster.html +0 -7843
- package/dist/paperjs/docs/classes/Rectangle.html +0 -1654
- package/dist/paperjs/docs/classes/Segment.html +0 -939
- package/dist/paperjs/docs/classes/Shape.html +0 -7363
- package/dist/paperjs/docs/classes/Size.html +0 -1825
- package/dist/paperjs/docs/classes/Style.html +0 -919
- package/dist/paperjs/docs/classes/SymbolDefinition.html +0 -311
- package/dist/paperjs/docs/classes/SymbolItem.html +0 -6755
- package/dist/paperjs/docs/classes/TextItem.html +0 -6869
- package/dist/paperjs/docs/classes/Tool.html +0 -761
- package/dist/paperjs/docs/classes/ToolEvent.html +0 -446
- package/dist/paperjs/docs/classes/Tween.html +0 -374
- package/dist/paperjs/docs/classes/View.html +0 -1772
- package/dist/paperjs/docs/classes/global.html +0 -425
- package/dist/paperjs/docs/classes/index.html +0 -88
- package/dist/paperjs/docs/index.html +0 -11
- package/dist/paperjs/examples/Animated/AnimatedStar.html +0 -53
- package/dist/paperjs/examples/Animated/BooleanOperations.html +0 -115
- package/dist/paperjs/examples/Animated/CandyCrash.html +0 -151
- package/dist/paperjs/examples/Animated/Extruded.html +0 -50
- package/dist/paperjs/examples/Animated/Lines.html +0 -53
- package/dist/paperjs/examples/Animated/Smoothing.html +0 -70
- package/dist/paperjs/examples/Animated/Space.html +0 -86
- package/dist/paperjs/examples/Animated/SpaceUsingShapes.html +0 -79
- package/dist/paperjs/examples/Games/Paperoids.html +0 -569
- package/dist/paperjs/examples/JSON/Circle Testing.html +0 -34
- package/dist/paperjs/examples/JSON/Compound Path.html +0 -25
- package/dist/paperjs/examples/JSON/Empty Path Testing.html +0 -31
- package/dist/paperjs/examples/JSON/Gradients.html +0 -34
- package/dist/paperjs/examples/JSON/Group Transform.html +0 -28
- package/dist/paperjs/examples/JSON/Line Testing.html +0 -44
- package/dist/paperjs/examples/JSON/Random Path Testing.html +0 -42
- package/dist/paperjs/examples/JSON/Raster.html +0 -29
- package/dist/paperjs/examples/JSON/Rect and Attribute Testing.html +0 -56
- package/dist/paperjs/examples/JSON/Rotated Primitives.html +0 -55
- package/dist/paperjs/examples/JSON/Selection.html +0 -43
- package/dist/paperjs/examples/JSON/Shapes.html +0 -54
- package/dist/paperjs/examples/JSON/Symbols.html +0 -30
- package/dist/paperjs/examples/JSON/Text Testing.html +0 -38
- package/dist/paperjs/examples/JSON/Tiger.html +0 -19
- package/dist/paperjs/examples/JSON/Transform Test 1.html +0 -32
- package/dist/paperjs/examples/JSON/Transform Test 2.html +0 -30
- package/dist/paperjs/examples/Node.js/AnimatedStar.js +0 -52
- package/dist/paperjs/examples/Node.js/BooleanOperations.js +0 -36
- package/dist/paperjs/examples/Node.js/JSONtoPDF.js +0 -20
- package/dist/paperjs/examples/Node.js/Raster.js +0 -32
- package/dist/paperjs/examples/Node.js/RasterRemote.js +0 -33
- package/dist/paperjs/examples/Node.js/SvgExport.js +0 -52
- package/dist/paperjs/examples/Node.js/SvgImport.js +0 -23
- package/dist/paperjs/examples/Node.js/Tadpoles.js +0 -16
- package/dist/paperjs/examples/Node.js/Tadpoles.pjs +0 -278
- package/dist/paperjs/examples/Node.js/in.json +0 -1
- package/dist/paperjs/examples/Node.js/in.svg +0 -16
- package/dist/paperjs/examples/Paperjs.org/BooleanOperattions.html +0 -115
- package/dist/paperjs/examples/Paperjs.org/BouncingBalls.html +0 -103
- package/dist/paperjs/examples/Paperjs.org/Chain.html +0 -54
- package/dist/paperjs/examples/Paperjs.org/DivisionRaster.html +0 -72
- package/dist/paperjs/examples/Paperjs.org/FutureSplash.html +0 -122
- package/dist/paperjs/examples/Paperjs.org/HitTesting.html +0 -103
- package/dist/paperjs/examples/Paperjs.org/InteractiveTiger.html +0 -777
- package/dist/paperjs/examples/Paperjs.org/MetaBalls.html +0 -132
- package/dist/paperjs/examples/Paperjs.org/NyanRainbow.html +0 -202
- package/dist/paperjs/examples/Paperjs.org/PathIntersections.html +0 -76
- package/dist/paperjs/examples/Paperjs.org/Qbertify.html +0 -146
- package/dist/paperjs/examples/Paperjs.org/RadialRainbows.html +0 -80
- package/dist/paperjs/examples/Paperjs.org/RoundedRectangles.html +0 -41
- package/dist/paperjs/examples/Paperjs.org/SatieLikedToDraw.html +0 -140
- package/dist/paperjs/examples/Paperjs.org/Simplify.html +0 -63
- package/dist/paperjs/examples/Paperjs.org/SpiralRaster.html +0 -120
- package/dist/paperjs/examples/Paperjs.org/Tadpoles.html +0 -283
- package/dist/paperjs/examples/Paperjs.org/Voronoi.html +0 -134
- package/dist/paperjs/examples/Rasters/PhyllotaxisRaster.html +0 -96
- package/dist/paperjs/examples/Rasters/Raster.html +0 -34
- package/dist/paperjs/examples/Rasters/RotationRaster.html +0 -44
- package/dist/paperjs/examples/Rasters/Smoothing.html +0 -36
- package/dist/paperjs/examples/SVG Export/Circle Testing.html +0 -32
- package/dist/paperjs/examples/SVG Export/Clipping.html +0 -17
- package/dist/paperjs/examples/SVG Export/Compound Path.html +0 -22
- package/dist/paperjs/examples/SVG Export/Empty Path Testing.html +0 -28
- package/dist/paperjs/examples/SVG Export/Gradients.html +0 -52
- package/dist/paperjs/examples/SVG Export/Group Transform.html +0 -25
- package/dist/paperjs/examples/SVG Export/Line Testing.html +0 -41
- package/dist/paperjs/examples/SVG Export/Random Path Testing.html +0 -39
- package/dist/paperjs/examples/SVG Export/Raster.html +0 -21
- package/dist/paperjs/examples/SVG Export/Rect and Attribute Testing.html +0 -53
- package/dist/paperjs/examples/SVG Export/Rotated Primitives.html +0 -80
- package/dist/paperjs/examples/SVG Export/Shapes.html +0 -58
- package/dist/paperjs/examples/SVG Export/Symbols.html +0 -27
- package/dist/paperjs/examples/SVG Export/Text Testing.html +0 -45
- package/dist/paperjs/examples/SVG Export/Tiger.html +0 -23
- package/dist/paperjs/examples/SVG Export/Transform Test 1.html +0 -29
- package/dist/paperjs/examples/SVG Export/Transform Test 2.html +0 -27
- package/dist/paperjs/examples/SVG Import/Arcs.html +0 -78
- package/dist/paperjs/examples/SVG Import/Butterfly.html +0 -223
- package/dist/paperjs/examples/SVG Import/Circle and Ellipse Testing.html +0 -26
- package/dist/paperjs/examples/SVG Import/Clipping.html +0 -100
- package/dist/paperjs/examples/SVG Import/From File.html +0 -30
- package/dist/paperjs/examples/SVG Import/Gradient.html +0 -138
- package/dist/paperjs/examples/SVG Import/Gradients.html +0 -30
- package/dist/paperjs/examples/SVG Import/Inkscape Pivot.html +0 -52
- package/dist/paperjs/examples/SVG Import/Inkscape.html +0 -88
- package/dist/paperjs/examples/SVG Import/Line Testing.html +0 -24
- package/dist/paperjs/examples/SVG Import/MoreGradients.html +0 -107
- package/dist/paperjs/examples/SVG Import/Multiple Paths Test 1.html +0 -42
- package/dist/paperjs/examples/SVG Import/Multiple Paths Test 2.html +0 -33
- package/dist/paperjs/examples/SVG Import/Nested Groups Test.html +0 -78
- package/dist/paperjs/examples/SVG Import/Polybezier.html +0 -43
- package/dist/paperjs/examples/SVG Import/Rect Testing.html +0 -25
- package/dist/paperjs/examples/SVG Import/Symbols.html +0 -24
- package/dist/paperjs/examples/SVG Import/Testing.html +0 -40
- package/dist/paperjs/examples/SVG Import/Text Testing.html +0 -19
- package/dist/paperjs/examples/SVG Import/Tiger.html +0 -742
- package/dist/paperjs/examples/SVG Import/Transform Testing.html +0 -22
- package/dist/paperjs/examples/SVG Import/Viewbox.html +0 -38
- package/dist/paperjs/examples/Scripts/Arcs.html +0 -39
- package/dist/paperjs/examples/Scripts/BlendModes.html +0 -77
- package/dist/paperjs/examples/Scripts/BooleanOperations.html +0 -937
- package/dist/paperjs/examples/Scripts/CompoundPath.html +0 -19
- package/dist/paperjs/examples/Scripts/CurveTimeParameterization.html +0 -61
- package/dist/paperjs/examples/Scripts/HslColor.html +0 -53
- package/dist/paperjs/examples/Scripts/PathStructure.html +0 -82
- package/dist/paperjs/examples/Scripts/PathTangents.html +0 -73
- package/dist/paperjs/examples/Scripts/Resize.html +0 -42
- package/dist/paperjs/examples/Scripts/RoundRectangle.html +0 -28
- package/dist/paperjs/examples/Scripts/Shapes.html +0 -54
- package/dist/paperjs/examples/Scripts/StrokeBounds.html +0 -101
- package/dist/paperjs/examples/Scripts/StrokeScaling.html +0 -65
- package/dist/paperjs/examples/Tools/BezierTool.html +0 -90
- package/dist/paperjs/examples/Tools/Circles.html +0 -28
- package/dist/paperjs/examples/Tools/Clouds.html +0 -35
- package/dist/paperjs/examples/Tools/DrippingBrush.html +0 -73
- package/dist/paperjs/examples/Tools/FancyBrush.html +0 -82
- package/dist/paperjs/examples/Tools/Grid.html +0 -44
- package/dist/paperjs/examples/Tools/MultiLines.html +0 -44
- package/dist/paperjs/examples/Tools/MultipleTools.html +0 -44
- package/dist/paperjs/examples/Tools/PathEditing.html +0 -95
- package/dist/paperjs/examples/Tools/SquareRounded.html +0 -76
- package/dist/paperjs/examples/Tools/Stars.html +0 -38
- package/dist/paperjs/examples/Tools/Vektor.html +0 -200
- package/dist/paperjs/examples/Tools/Wave.html +0 -50
- package/dist/paperjs/examples/Tools/WormFarm.html +0 -88
- package/dist/paperjs/examples/Worker/Main.html +0 -53
- package/dist/paperjs/examples/Worker/Worker.js +0 -14
- package/dist/paperjs/examples/css/style.css +0 -12
package/dist/paper-full.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Paper.js v0.12.
|
|
2
|
+
* Paper.js v0.12.19 - The Swiss Army Knife of Vector Graphics Scripting.
|
|
3
3
|
* http://paperjs.org/
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2011 - 2020, Jürg Lehni & Jonathan Puckey
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
* All rights reserved.
|
|
11
11
|
*
|
|
12
|
-
* Date:
|
|
12
|
+
* Date: Sun Oct 18 13:05:31 2026 +0200
|
|
13
13
|
*
|
|
14
14
|
***
|
|
15
15
|
*
|
|
@@ -821,7 +821,7 @@ var PaperScope = Base.extend({
|
|
|
821
821
|
}
|
|
822
822
|
},
|
|
823
823
|
|
|
824
|
-
version: "0.12.
|
|
824
|
+
version: "0.12.19",
|
|
825
825
|
|
|
826
826
|
getView: function() {
|
|
827
827
|
var project = this.project;
|
|
@@ -1919,7 +1919,9 @@ var Rectangle = Base.extend({
|
|
|
1919
1919
|
} else if (type === 'undefined' || arg0 === null) {
|
|
1920
1920
|
this._set(0, 0, 0, 0);
|
|
1921
1921
|
read = arg0 === null ? 1 : 0;
|
|
1922
|
-
} else if (args.length === 1
|
|
1922
|
+
} else if (args.length === 1
|
|
1923
|
+
|| Array.isArray(arg0) && arg0.length === 4
|
|
1924
|
+
|| arg0.x !== undefined && arg0.width !== undefined) {
|
|
1923
1925
|
if (Array.isArray(arg0)) {
|
|
1924
1926
|
this._set.apply(this, arg0);
|
|
1925
1927
|
read = 1;
|
|
@@ -4647,6 +4649,7 @@ new function() {
|
|
|
4647
4649
|
|
|
4648
4650
|
fitBounds: function(rectangle, fill) {
|
|
4649
4651
|
rectangle = Rectangle.read(arguments);
|
|
4652
|
+
fill = Base.read(arguments);
|
|
4650
4653
|
var bounds = this.getBounds(),
|
|
4651
4654
|
itemRatio = bounds.height / bounds.width,
|
|
4652
4655
|
rectRatio = rectangle.height / rectangle.width,
|
|
@@ -5102,7 +5105,11 @@ var Shape = Item.extend({
|
|
|
5102
5105
|
return;
|
|
5103
5106
|
var size = radius * 2;
|
|
5104
5107
|
this._radius = radius;
|
|
5105
|
-
this._size
|
|
5108
|
+
if (this._size) {
|
|
5109
|
+
this._size._set(size, size);
|
|
5110
|
+
} else {
|
|
5111
|
+
this._size = new Size(size, size);
|
|
5112
|
+
}
|
|
5106
5113
|
} else {
|
|
5107
5114
|
radius = Size.read(arguments);
|
|
5108
5115
|
if (!this._radius) {
|
|
@@ -5379,7 +5386,7 @@ var Raster = Item.extend({
|
|
|
5379
5386
|
|
|
5380
5387
|
initialize: function Raster(source, position) {
|
|
5381
5388
|
if (!this._initialize(source,
|
|
5382
|
-
position !== undefined && Point.read(
|
|
5389
|
+
position !== undefined && Point.read([position]))) {
|
|
5383
5390
|
var image,
|
|
5384
5391
|
type = typeof source,
|
|
5385
5392
|
object = type === 'string'
|
|
@@ -10086,12 +10093,10 @@ Path.inject({ statics: new function() {
|
|
|
10086
10093
|
from = Point.readNamed(args, 'from'),
|
|
10087
10094
|
through = Point.readNamed(args, 'through'),
|
|
10088
10095
|
to = Point.readNamed(args, 'to'),
|
|
10089
|
-
|
|
10090
|
-
|
|
10091
|
-
|
|
10092
|
-
|
|
10093
|
-
path.arcTo(through, to);
|
|
10094
|
-
return path.set(props);
|
|
10096
|
+
arc = new Path(Item.NO_INSERT);
|
|
10097
|
+
arc.moveTo(from);
|
|
10098
|
+
arc.arcTo(through, to);
|
|
10099
|
+
return createPath(arc._segments, false, args);
|
|
10095
10100
|
},
|
|
10096
10101
|
|
|
10097
10102
|
RegularPolygon: function() {
|
|
@@ -13111,7 +13116,7 @@ var View = Base.extend(Emitter, {
|
|
|
13111
13116
|
pixels = parseFloat(DomElement.getStyles(temp).fontSize);
|
|
13112
13117
|
parent.removeChild(temp);
|
|
13113
13118
|
} else {
|
|
13114
|
-
pixels = parseFloat(
|
|
13119
|
+
pixels = parseFloat(size);
|
|
13115
13120
|
}
|
|
13116
13121
|
return pixels;
|
|
13117
13122
|
},
|
|
@@ -13935,8 +13940,8 @@ var ToolEvent = Event.extend({
|
|
|
13935
13940
|
},
|
|
13936
13941
|
|
|
13937
13942
|
setCount: function(count) {
|
|
13938
|
-
this.tool[/^mouse(down|up)$/.test(this.type)
|
|
13939
|
-
|
|
13943
|
+
this.tool[/^mouse(down|up)$/.test(this.type)
|
|
13944
|
+
? '_downCount' : '_moveCount'] = count;
|
|
13940
13945
|
},
|
|
13941
13946
|
|
|
13942
13947
|
getItem: function() {
|
|
@@ -14201,8 +14206,8 @@ var Tween = Base.extend(Emitter, {
|
|
|
14201
14206
|
var key = keys[i],
|
|
14202
14207
|
from = getValue(this._from[key]),
|
|
14203
14208
|
to = getValue(this._to[key]),
|
|
14204
|
-
value = (from && to && from.
|
|
14205
|
-
? to.
|
|
14209
|
+
value = (from && to && from.multiply && to.multiply)
|
|
14210
|
+
? to.subtract(from).multiply(factor).add(from)
|
|
14206
14211
|
: ((to - from) * factor) + from;
|
|
14207
14212
|
this._setProperty(this._parsedKeys[key], value);
|
|
14208
14213
|
}
|
|
@@ -14283,7 +14288,16 @@ var Tween = Base.extend(Emitter, {
|
|
|
14283
14288
|
},
|
|
14284
14289
|
|
|
14285
14290
|
_calculate: function(left, operator, right) {
|
|
14286
|
-
|
|
14291
|
+
var name = { '+': 'add', '-': 'subtract', '*': 'multiply',
|
|
14292
|
+
'/': 'divide' }[operator];
|
|
14293
|
+
if (left && left[name])
|
|
14294
|
+
return left[name](right);
|
|
14295
|
+
switch (operator) {
|
|
14296
|
+
case '+': return left + right;
|
|
14297
|
+
case '-': return left - right;
|
|
14298
|
+
case '*': return left * right;
|
|
14299
|
+
case '/': return left / right;
|
|
14300
|
+
}
|
|
14287
14301
|
},
|
|
14288
14302
|
|
|
14289
14303
|
_parseKeys: function(keys) {
|
|
@@ -15545,10 +15559,27 @@ new function() {
|
|
|
15545
15559
|
return res;
|
|
15546
15560
|
}
|
|
15547
15561
|
|
|
15562
|
+
var sandbox;
|
|
15563
|
+
|
|
15564
|
+
function getSandbox() {
|
|
15565
|
+
if (!(sandbox && sandbox.contentDocument)) {
|
|
15566
|
+
sandbox = document.createElement('iframe');
|
|
15567
|
+
sandbox.setAttribute('sandbox', 'allow-same-origin');
|
|
15568
|
+
sandbox.style.cssText = 'position: absolute; visibility: hidden;'
|
|
15569
|
+
+ ' width: 0; height: 0; border: 0';
|
|
15570
|
+
document.body.appendChild(sandbox);
|
|
15571
|
+
var doc = sandbox.contentDocument,
|
|
15572
|
+
meta = doc.createElement('meta');
|
|
15573
|
+
meta.httpEquiv = 'Content-Security-Policy';
|
|
15574
|
+
meta.content = "default-src 'none'; style-src 'unsafe-inline'";
|
|
15575
|
+
doc.head.appendChild(meta);
|
|
15576
|
+
}
|
|
15577
|
+
return sandbox.contentDocument.body;
|
|
15578
|
+
}
|
|
15579
|
+
|
|
15548
15580
|
function importNode(node, options, isRoot) {
|
|
15549
15581
|
var type = node.nodeName.toLowerCase(),
|
|
15550
15582
|
isElement = type !== '#document',
|
|
15551
|
-
body = document.body,
|
|
15552
15583
|
container,
|
|
15553
15584
|
parent,
|
|
15554
15585
|
next;
|
|
@@ -15561,46 +15592,53 @@ new function() {
|
|
|
15561
15592
|
parent = node.parentNode;
|
|
15562
15593
|
next = node.nextSibling;
|
|
15563
15594
|
container.appendChild(node);
|
|
15564
|
-
|
|
15595
|
+
getSandbox().appendChild(container);
|
|
15565
15596
|
}
|
|
15566
15597
|
var settings = paper.settings,
|
|
15567
15598
|
applyMatrix = settings.applyMatrix,
|
|
15568
|
-
insertItems = settings.insertItems
|
|
15569
|
-
|
|
15570
|
-
|
|
15571
|
-
|
|
15572
|
-
|
|
15573
|
-
|
|
15574
|
-
|
|
15575
|
-
|
|
15576
|
-
|
|
15577
|
-
|
|
15578
|
-
|
|
15579
|
-
|
|
15580
|
-
|
|
15581
|
-
|
|
15582
|
-
|
|
15583
|
-
|
|
15584
|
-
|
|
15585
|
-
|
|
15586
|
-
|
|
15587
|
-
|
|
15588
|
-
|
|
15589
|
-
|
|
15590
|
-
|
|
15591
|
-
|
|
15592
|
-
if (
|
|
15593
|
-
|
|
15594
|
-
|
|
15595
|
-
|
|
15599
|
+
insertItems = settings.insertItems,
|
|
15600
|
+
item;
|
|
15601
|
+
try {
|
|
15602
|
+
settings.applyMatrix = false;
|
|
15603
|
+
settings.insertItems = false;
|
|
15604
|
+
try {
|
|
15605
|
+
var importer = importers[type];
|
|
15606
|
+
item = importer && importer(node, type, options, isRoot)
|
|
15607
|
+
|| null;
|
|
15608
|
+
} finally {
|
|
15609
|
+
settings.insertItems = insertItems;
|
|
15610
|
+
settings.applyMatrix = applyMatrix;
|
|
15611
|
+
}
|
|
15612
|
+
if (item) {
|
|
15613
|
+
if (isElement && !(item instanceof Group))
|
|
15614
|
+
item = applyAttributes(item, node, isRoot);
|
|
15615
|
+
var onImport = options.onImport,
|
|
15616
|
+
data = isElement && node.getAttribute('data-paper-data');
|
|
15617
|
+
if (onImport)
|
|
15618
|
+
item = onImport(node, item, options) || item;
|
|
15619
|
+
if (options.expandShapes && item instanceof Shape) {
|
|
15620
|
+
item.remove();
|
|
15621
|
+
item = item.toPath();
|
|
15622
|
+
}
|
|
15623
|
+
if (data)
|
|
15624
|
+
item._data = JSON.parse(data);
|
|
15625
|
+
}
|
|
15626
|
+
} finally {
|
|
15627
|
+
if (container) {
|
|
15628
|
+
container.parentNode.removeChild(container);
|
|
15629
|
+
if (parent) {
|
|
15630
|
+
if (next) {
|
|
15631
|
+
parent.insertBefore(node, next);
|
|
15632
|
+
} else {
|
|
15633
|
+
parent.appendChild(node);
|
|
15634
|
+
}
|
|
15596
15635
|
}
|
|
15597
15636
|
}
|
|
15637
|
+
if (isRoot)
|
|
15638
|
+
definitions = {};
|
|
15598
15639
|
}
|
|
15599
|
-
if (isRoot)
|
|
15600
|
-
|
|
15601
|
-
if (item && Base.pick(options.applyMatrix, applyMatrix))
|
|
15602
|
-
item.matrix.apply(true, true);
|
|
15603
|
-
}
|
|
15640
|
+
if (isRoot && item && Base.pick(options.applyMatrix, applyMatrix))
|
|
15641
|
+
item.matrix.apply(true, true);
|
|
15604
15642
|
return item;
|
|
15605
15643
|
}
|
|
15606
15644
|
|