@nativescript/canvas 2.0.0-beta.2 → 2.0.0-beta.20
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/Canvas/common.d.ts +23 -15
- package/Canvas/common.js +127 -55
- package/Canvas/common.js.map +1 -1
- package/Canvas/index.android.d.ts +1 -0
- package/Canvas/index.android.js +53 -88
- package/Canvas/index.android.js.map +1 -1
- package/Canvas/index.d.ts +2 -0
- package/Canvas/index.ios.d.ts +4 -1
- package/Canvas/index.ios.js +58 -52
- package/Canvas/index.ios.js.map +1 -1
- package/Canvas2D/CanvasRenderingContext2D/index.d.ts +14 -0
- package/Canvas2D/CanvasRenderingContext2D/index.js +207 -19
- package/Canvas2D/CanvasRenderingContext2D/index.js.map +1 -1
- package/Canvas2D/DOMMatrix/index.d.ts +14 -0
- package/Canvas2D/DOMMatrix/index.js +62 -0
- package/Canvas2D/DOMMatrix/index.js.map +1 -1
- package/Canvas2D/ImageData/index.js +4 -6
- package/Canvas2D/ImageData/index.js.map +1 -1
- package/Canvas2D/Path2D/index.d.ts +2 -1
- package/Canvas2D/Path2D/index.js +3 -12
- package/Canvas2D/Path2D/index.js.map +1 -1
- package/Dom/Dom.d.ts +20 -1
- package/Dom/Dom.js +78 -10
- package/Dom/Dom.js.map +1 -1
- package/Dom/Group.d.ts +5 -0
- package/Dom/Group.js +15 -0
- package/Dom/Group.js.map +1 -1
- package/Dom/Image.d.ts +1 -0
- package/Dom/Image.js +20 -0
- package/Dom/Image.js.map +1 -1
- package/Dom/Paint.d.ts +4 -0
- package/Dom/Paint.js +19 -7
- package/Dom/Paint.js.map +1 -1
- package/Dom/Shadow.js +9 -0
- package/Dom/Shadow.js.map +1 -1
- package/Dom/Text.js +11 -1
- package/Dom/Text.js.map +1 -1
- package/Dom/index.d.ts +1 -0
- package/Dom/index.js +1 -0
- package/Dom/index.js.map +1 -1
- package/Dom/shaders/Gradients.d.ts +3 -0
- package/Dom/shaders/Gradients.js +4 -0
- package/Dom/shaders/Gradients.js.map +1 -0
- package/Dom/shaders/LinearGradient.d.ts +14 -0
- package/Dom/shaders/LinearGradient.js +44 -0
- package/Dom/shaders/LinearGradient.js.map +1 -0
- package/Dom/shaders/TwoPointConicalGradient.d.ts +16 -0
- package/Dom/shaders/TwoPointConicalGradient.js +60 -0
- package/Dom/shaders/TwoPointConicalGradient.js.map +1 -0
- package/Dom/shaders/index.d.ts +2 -0
- package/Dom/shaders/index.js +3 -0
- package/Dom/shaders/index.js.map +1 -0
- package/Dom/shapes/Atlas.d.ts +22 -0
- package/Dom/shapes/Atlas.js +60 -0
- package/Dom/shapes/Atlas.js.map +1 -0
- package/Dom/shapes/Circle.js +11 -0
- package/Dom/shapes/Circle.js.map +1 -1
- package/Dom/shapes/Line.d.ts +16 -4
- package/Dom/shapes/Line.js +13 -8
- package/Dom/shapes/Line.js.map +1 -1
- package/Dom/shapes/Oval.d.ts +12 -0
- package/Dom/shapes/Oval.js +87 -0
- package/Dom/shapes/Oval.js.map +1 -0
- package/Dom/shapes/Path.d.ts +19 -2
- package/Dom/shapes/Path.js +68 -4
- package/Dom/shapes/Path.js.map +1 -1
- package/Dom/shapes/Points.js +9 -1
- package/Dom/shapes/Points.js.map +1 -1
- package/Dom/shapes/Rect.js +27 -5
- package/Dom/shapes/Rect.js.map +1 -1
- package/Dom/shapes/RoundedRect.d.ts +2 -1
- package/Dom/shapes/RoundedRect.js +13 -2
- package/Dom/shapes/RoundedRect.js.map +1 -1
- package/Dom/shapes/index.d.ts +17 -0
- package/Dom/shapes/index.js +31 -0
- package/Dom/shapes/index.js.map +1 -1
- package/WebGL/WebGLRenderingContext/index.d.ts +1 -0
- package/WebGL/WebGLRenderingContext/index.js +104 -14
- package/WebGL/WebGLRenderingContext/index.js.map +1 -1
- package/WebGL2/WebGL2RenderingContext/index.d.ts +1 -0
- package/WebGL2/WebGL2RenderingContext/index.js +2 -3
- package/WebGL2/WebGL2RenderingContext/index.js.map +1 -1
- package/index.d.ts +0 -1
- package/index.js +14 -15
- package/index.js.map +1 -1
- package/package.json +1 -4
- package/platforms/android/canvas-release.aar +0 -0
- package/platforms/ios/CanvasNative.xcframework/Info.plist +4 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative-Swift.h +35 -25
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_ios.h +50 -4
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +139 -16
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Info.plist +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.abi.json +982 -3319
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.private.swiftinterface +18 -33
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftinterface +18 -33
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/module.modulemap +1 -1
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/NSCCanvas.nib +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +622 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/CanvasNative-Swift.h +70 -50
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_ios.h +50 -4
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +139 -16
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Info.plist +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.abi.json +982 -3319
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +18 -33
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftinterface +18 -33
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +982 -3319
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +18 -33
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +18 -33
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/module.modulemap +1 -1
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/NSCCanvas.nib +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +35 -35
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +624 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/x86_64/CanvasNative.yml +624 -0
- package/platforms/ios/src/cpp/CanvasJSIModule.cpp +297 -397
- package/platforms/ios/src/cpp/Helpers.h +3 -4
- package/platforms/ios/src/cpp/ImageAssetImpl.cpp +30 -30
- package/platforms/ios/src/cpp/ImageAssetImpl.h +8 -5
- package/platforms/ios/src/cpp/URLImpl.cpp +73 -0
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.cpp +339 -33
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.h +150 -55
- package/platforms/ios/src/cpp/canvas2d/MatrixImpl.cpp +409 -3
- package/platforms/ios/src/cpp/canvas2d/MatrixImpl.h +27 -0
- package/platforms/ios/src/cpp/canvas2d/Path2D.cpp +19 -48
- package/platforms/ios/src/cpp/canvas2d/Path2D.h +19 -0
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.cpp +105 -119
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContextBase.cpp +37 -7
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContextBase.h +10 -0
- package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.cpp +1766 -1659
- package/src-native/ios/NativeScript.podspec +1 -1
- package/SVG/Circle.d.ts +0 -11
- package/SVG/Circle.js +0 -21
- package/SVG/Circle.js.map +0 -1
- package/SVG/ClipPath.d.ts +0 -4
- package/SVG/ClipPath.js +0 -9
- package/SVG/ClipPath.js.map +0 -1
- package/SVG/Defs.d.ts +0 -4
- package/SVG/Defs.js +0 -9
- package/SVG/Defs.js.map +0 -1
- package/SVG/Ellipse.d.ts +0 -13
- package/SVG/Ellipse.js +0 -26
- package/SVG/Ellipse.js.map +0 -1
- package/SVG/G.d.ts +0 -7
- package/SVG/G.js +0 -9
- package/SVG/G.js.map +0 -1
- package/SVG/Image.d.ts +0 -11
- package/SVG/Image.js +0 -40
- package/SVG/Image.js.map +0 -1
- package/SVG/Line.d.ts +0 -13
- package/SVG/Line.js +0 -26
- package/SVG/Line.js.map +0 -1
- package/SVG/LinearGradient.d.ts +0 -10
- package/SVG/LinearGradient.js +0 -13
- package/SVG/LinearGradient.js.map +0 -1
- package/SVG/Path.d.ts +0 -7
- package/SVG/Path.js +0 -14
- package/SVG/Path.js.map +0 -1
- package/SVG/Pattern.d.ts +0 -4
- package/SVG/Pattern.js +0 -9
- package/SVG/Pattern.js.map +0 -1
- package/SVG/Polygon.d.ts +0 -7
- package/SVG/Polygon.js +0 -14
- package/SVG/Polygon.js.map +0 -1
- package/SVG/Polyline.d.ts +0 -7
- package/SVG/Polyline.js +0 -14
- package/SVG/Polyline.js.map +0 -1
- package/SVG/Rect.d.ts +0 -8
- package/SVG/Rect.js +0 -13
- package/SVG/Rect.js.map +0 -1
- package/SVG/SVG.d.ts +0 -31
- package/SVG/SVG.js +0 -190
- package/SVG/SVG.js.map +0 -1
- package/SVG/SVGItem.d.ts +0 -5
- package/SVG/SVGItem.js +0 -8
- package/SVG/SVGItem.js.map +0 -1
- package/SVG/Stop.d.ts +0 -5
- package/SVG/Stop.js +0 -9
- package/SVG/Stop.js.map +0 -1
- package/SVG/Symbol.d.ts +0 -4
- package/SVG/Symbol.js +0 -9
- package/SVG/Symbol.js.map +0 -1
- package/SVG/Text.d.ts +0 -14
- package/SVG/Text.js +0 -26
- package/SVG/Text.js.map +0 -1
- package/SVG/Use.d.ts +0 -4
- package/SVG/Use.js +0 -9
- package/SVG/Use.js.map +0 -1
- package/SVG/index.d.ts +0 -18
- package/SVG/index.js +0 -19
- package/SVG/index.js.map +0 -1
- package/platforms/ios/src/cpp/PerIsolateData.cpp +0 -49
- package/platforms/ios/src/cpp/PerIsolateData.h +0 -54
|
@@ -6,7 +6,7 @@ Pod::Spec.new do |s|
|
|
|
6
6
|
|
|
7
7
|
s.authors = "Ammar Ahmed"
|
|
8
8
|
s.homepage = "https://github.com/ammarahm-ed/nativescript-v8-module"
|
|
9
|
-
s.platforms = { :ios => "12.
|
|
9
|
+
s.platforms = { :ios => "12.0" }
|
|
10
10
|
s.source = { :git => "https://github.com/ammarahm-ed/nativescript-v8-module.git", :tag => "v1.0.0" }
|
|
11
11
|
s.cocoapods_version = ">= 1.10.1"
|
|
12
12
|
s.vendored_frameworks = "NativeScript.xcframework"
|
package/SVG/Circle.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Property } from '@nativescript/core';
|
|
2
|
-
import { SVGItem } from './SVGItem';
|
|
3
|
-
export declare const cxProperty: Property<Circle, any>;
|
|
4
|
-
export declare const cyProperty: Property<Circle, any>;
|
|
5
|
-
export declare const rProperty: Property<Circle, any>;
|
|
6
|
-
export declare class Circle extends SVGItem {
|
|
7
|
-
cx: any;
|
|
8
|
-
cy: any;
|
|
9
|
-
r: any;
|
|
10
|
-
constructor();
|
|
11
|
-
}
|
package/SVG/Circle.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Property } from '@nativescript/core';
|
|
2
|
-
import { SVGItem } from './SVGItem';
|
|
3
|
-
import { DOMParser } from 'xmldom';
|
|
4
|
-
export const cxProperty = new Property({
|
|
5
|
-
name: 'cx',
|
|
6
|
-
});
|
|
7
|
-
export const cyProperty = new Property({
|
|
8
|
-
name: 'cy',
|
|
9
|
-
});
|
|
10
|
-
export const rProperty = new Property({
|
|
11
|
-
name: 'r',
|
|
12
|
-
});
|
|
13
|
-
export class Circle extends SVGItem {
|
|
14
|
-
constructor() {
|
|
15
|
-
super();
|
|
16
|
-
this._dom = new DOMParser().parseFromString('<circle></circle>');
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
cxProperty.register(Circle);
|
|
20
|
-
cyProperty.register(Circle);
|
|
21
|
-
//# sourceMappingURL=Circle.js.map
|
package/SVG/Circle.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Circle.js","sourceRoot":"","sources":["../../../../packages/canvas/SVG/Circle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,QAAQ,CAAc;IACnD,IAAI,EAAE,IAAI;CACV,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,QAAQ,CAAc;IACnD,IAAI,EAAE,IAAI;CACV,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,QAAQ,CAAc;IAClD,IAAI,EAAE,GAAG;CACT,CAAC,CAAC;AAEH,MAAM,OAAO,MAAO,SAAQ,OAAO;IAIlC;QACC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,mBAAmB,CAAC,CAAC;IAClE,CAAC;CACD;AAED,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC5B,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC"}
|
package/SVG/ClipPath.d.ts
DELETED
package/SVG/ClipPath.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { SVGItem } from "./SVGItem";
|
|
2
|
-
import { DOMParser } from 'xmldom';
|
|
3
|
-
export class ClipPath extends SVGItem {
|
|
4
|
-
constructor() {
|
|
5
|
-
super();
|
|
6
|
-
this._dom = new DOMParser().parseFromString('<clip-path></clip-path>');
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=ClipPath.js.map
|
package/SVG/ClipPath.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ClipPath.js","sourceRoot":"","sources":["../../../../packages/canvas/SVG/ClipPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,MAAM,OAAO,QAAS,SAAQ,OAAO;IACjC;QACF,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,yBAAyB,CAAC,CAAC;IACxE,CAAC;CACD"}
|
package/SVG/Defs.d.ts
DELETED
package/SVG/Defs.js
DELETED
package/SVG/Defs.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Defs.js","sourceRoot":"","sources":["../../../../packages/canvas/SVG/Defs.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,MAAM,OAAO,IAAK,SAAQ,OAAO;IAC7B;QACF,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;IAC7D,CAAC;CACD"}
|
package/SVG/Ellipse.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Property } from "@nativescript/core";
|
|
2
|
-
import { SVGItem } from "./SVGItem";
|
|
3
|
-
export declare const cxProperty: Property<Ellipse, any>;
|
|
4
|
-
export declare const cyProperty: Property<Ellipse, any>;
|
|
5
|
-
export declare const rxProperty: Property<Ellipse, any>;
|
|
6
|
-
export declare const ryProperty: Property<Ellipse, any>;
|
|
7
|
-
export declare class Ellipse extends SVGItem {
|
|
8
|
-
cx: any;
|
|
9
|
-
cy: any;
|
|
10
|
-
rx: any;
|
|
11
|
-
ry: any;
|
|
12
|
-
constructor();
|
|
13
|
-
}
|
package/SVG/Ellipse.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Property } from "@nativescript/core";
|
|
2
|
-
import { SVGItem } from "./SVGItem";
|
|
3
|
-
export const cxProperty = new Property({
|
|
4
|
-
name: 'cx'
|
|
5
|
-
});
|
|
6
|
-
export const cyProperty = new Property({
|
|
7
|
-
name: 'cy'
|
|
8
|
-
});
|
|
9
|
-
export const rxProperty = new Property({
|
|
10
|
-
name: 'rx'
|
|
11
|
-
});
|
|
12
|
-
export const ryProperty = new Property({
|
|
13
|
-
name: 'ry'
|
|
14
|
-
});
|
|
15
|
-
import { DOMParser } from 'xmldom';
|
|
16
|
-
export class Ellipse extends SVGItem {
|
|
17
|
-
constructor() {
|
|
18
|
-
super();
|
|
19
|
-
this._dom = new DOMParser().parseFromString('<ellipse></ellipse>');
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
cxProperty.register(Ellipse);
|
|
23
|
-
cyProperty.register(Ellipse);
|
|
24
|
-
rxProperty.register(Ellipse);
|
|
25
|
-
ryProperty.register(Ellipse);
|
|
26
|
-
//# sourceMappingURL=Ellipse.js.map
|
package/SVG/Ellipse.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Ellipse.js","sourceRoot":"","sources":["../../../../packages/canvas/SVG/Ellipse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,oBAAoB,CAAC;AAE5C,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,QAAQ,CAAe;IACpD,IAAI,EAAE,IAAI;CACV,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,QAAQ,CAAe;IACpD,IAAI,EAAE,IAAI;CACV,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,QAAQ,CAAe;IACpD,IAAI,EAAE,IAAI;CACV,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,QAAQ,CAAe;IACpD,IAAI,EAAE,IAAI;CACV,CAAC,CAAC;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,MAAM,OAAO,OAAQ,SAAQ,OAAO;IAMnC;QACC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,qBAAqB,CAAC,CAAC;IACpE,CAAC;CACD;AAED,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC7B,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC7B,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC7B,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC"}
|
package/SVG/G.d.ts
DELETED
package/SVG/G.js
DELETED
package/SVG/G.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"G.js","sourceRoot":"","sources":["../../../../packages/canvas/SVG/G.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,MAAM,OAAO,CAAE,SAAQ,OAAO;IAK1B;QACF,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;IACxD,CAAC;CACD"}
|
package/SVG/Image.d.ts
DELETED
package/SVG/Image.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
var _Image_loadedSrc, _Image_asset;
|
|
2
|
-
import { ImageAsset } from "@nativescript/canvas";
|
|
3
|
-
import { SVGItem } from "./SVGItem";
|
|
4
|
-
const b64Extensions = {
|
|
5
|
-
"/": "jpg",
|
|
6
|
-
i: "png",
|
|
7
|
-
R: "gif",
|
|
8
|
-
U: "webp",
|
|
9
|
-
};
|
|
10
|
-
function b64WithoutPrefix(b64) {
|
|
11
|
-
return b64.split(",")[1];
|
|
12
|
-
}
|
|
13
|
-
function getMIMEforBase64String(b64) {
|
|
14
|
-
let input = b64;
|
|
15
|
-
if (b64.includes(",")) {
|
|
16
|
-
input = b64WithoutPrefix(b64);
|
|
17
|
-
}
|
|
18
|
-
const first = input.charAt(0);
|
|
19
|
-
const mime = b64Extensions[first];
|
|
20
|
-
if (!mime) {
|
|
21
|
-
throw new Error("Unknown Base64 MIME type: " + b64);
|
|
22
|
-
}
|
|
23
|
-
return mime;
|
|
24
|
-
}
|
|
25
|
-
import { DOMParser } from 'xmldom';
|
|
26
|
-
export class Image extends SVGItem {
|
|
27
|
-
constructor() {
|
|
28
|
-
super();
|
|
29
|
-
this.xlink = {};
|
|
30
|
-
this.x = 0;
|
|
31
|
-
this.y = 0;
|
|
32
|
-
// @ts-ignore
|
|
33
|
-
_Image_loadedSrc.set(this, void 0);
|
|
34
|
-
// @ts-ignore
|
|
35
|
-
_Image_asset.set(this, new ImageAsset());
|
|
36
|
-
this._dom = new DOMParser().parseFromString('<image></image>');
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
_Image_loadedSrc = new WeakMap(), _Image_asset = new WeakMap();
|
|
40
|
-
//# sourceMappingURL=Image.js.map
|
package/SVG/Image.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Image.js","sourceRoot":"","sources":["../../../../packages/canvas/SVG/Image.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,aAAa,GAAG;IACrB,GAAG,EAAE,KAAK;IACV,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,MAAM;CACT,CAAC;AAEF,SAAS,gBAAgB,CAAC,GAAG;IAC5B,OAAO,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1B,CAAC;AAED,SAAS,sBAAsB,CAAC,GAAG;IAClC,IAAI,KAAK,GAAG,GAAG,CAAC;IAChB,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACtB,KAAK,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC;KAC9B;IACD,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAC9B,MAAM,IAAI,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IAClC,IAAI,CAAC,IAAI,EAAE;QACV,MAAM,IAAI,KAAK,CAAC,4BAA4B,GAAG,GAAG,CAAC,CAAC;KACpD;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AACD,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,MAAM,OAAO,KAAM,SAAQ,OAAO;IAUjC;QACC,KAAK,EAAE,CAAC;QAVT,UAAK,GAAsB,EAAE,CAAC;QAE9B,MAAC,GAAQ,CAAC,CAAC;QACX,MAAC,GAAQ,CAAC,CAAC;QACX,aAAa;QACb,mCAAmB;QACnB,aAAa;QACb,uBAAS,IAAI,UAAU,EAAE,EAAC;QAIzB,IAAI,CAAC,IAAI,GAAG,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC;IAChE,CAAC;CACD"}
|
package/SVG/Line.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Property } from "@nativescript/core/ui/core/view";
|
|
2
|
-
import { SVGItem } from "./SVGItem";
|
|
3
|
-
export declare const x1Property: Property<Line, any>;
|
|
4
|
-
export declare const y1Property: Property<Line, any>;
|
|
5
|
-
export declare const x2Property: Property<Line, any>;
|
|
6
|
-
export declare const y2Property: Property<Line, any>;
|
|
7
|
-
export declare class Line extends SVGItem {
|
|
8
|
-
x1: any;
|
|
9
|
-
y1: any;
|
|
10
|
-
x2: any;
|
|
11
|
-
y2: any;
|
|
12
|
-
constructor();
|
|
13
|
-
}
|
package/SVG/Line.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Property } from "@nativescript/core/ui/core/view";
|
|
2
|
-
import { SVGItem } from "./SVGItem";
|
|
3
|
-
export const x1Property = new Property({
|
|
4
|
-
name: 'x1'
|
|
5
|
-
});
|
|
6
|
-
export const y1Property = new Property({
|
|
7
|
-
name: 'y1'
|
|
8
|
-
});
|
|
9
|
-
export const x2Property = new Property({
|
|
10
|
-
name: 'x2'
|
|
11
|
-
});
|
|
12
|
-
export const y2Property = new Property({
|
|
13
|
-
name: 'y2'
|
|
14
|
-
});
|
|
15
|
-
import { DOMParser } from 'xmldom';
|
|
16
|
-
export class Line extends SVGItem {
|
|
17
|
-
constructor() {
|
|
18
|
-
super();
|
|
19
|
-
this._dom = new DOMParser().parseFromString('<line></line>');
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
x1Property.register(Line);
|
|
23
|
-
x2Property.register(Line);
|
|
24
|
-
y1Property.register(Line);
|
|
25
|
-
y2Property.register(Line);
|
|
26
|
-
//# sourceMappingURL=Line.js.map
|
package/SVG/Line.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Line.js","sourceRoot":"","sources":["../../../../packages/canvas/SVG/Line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,iCAAiC,CAAC;AAEzD,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,QAAQ,CAAY;IACjD,IAAI,EAAE,IAAI;CACV,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,QAAQ,CAAY;IACjD,IAAI,EAAE,IAAI;CACV,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,QAAQ,CAAY;IACjD,IAAI,EAAE,IAAI;CACV,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,QAAQ,CAAY;IACjD,IAAI,EAAE,IAAI;CACV,CAAC,CAAC;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,MAAM,OAAO,IAAK,SAAQ,OAAO;IAMhC;QACC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,eAAe,CAAC,CAAC;IAC9D,CAAC;CACD;AAED,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC1B,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC1B,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC1B,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC"}
|
package/SVG/LinearGradient.d.ts
DELETED
package/SVG/LinearGradient.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { SVGItem } from "./SVGItem";
|
|
2
|
-
import { DOMParser } from 'xmldom';
|
|
3
|
-
export class LinearGradient extends SVGItem {
|
|
4
|
-
constructor() {
|
|
5
|
-
super();
|
|
6
|
-
this.x1 = '0%';
|
|
7
|
-
this.y1 = '0%';
|
|
8
|
-
this.x2 = '100%';
|
|
9
|
-
this.y2 = '0%';
|
|
10
|
-
this._dom = new DOMParser().parseFromString('<linear-gradient></linear-gradient>');
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=LinearGradient.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LinearGradient.js","sourceRoot":"","sources":["../../../../packages/canvas/SVG/LinearGradient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAIlC,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,MAAM,OAAO,cAAe,SAAQ,OAAO;IAS1C;QACC,KAAK,EAAE,CAAC;QART,OAAE,GAAQ,IAAI,CAAC;QACf,OAAE,GAAQ,IAAI,CAAC;QACf,OAAE,GAAQ,MAAM,CAAC;QACjB,OAAE,GAAQ,IAAI,CAAC;QAMd,IAAI,CAAC,IAAI,GAAG,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,qCAAqC,CAAC,CAAC;IACpF,CAAC;CACD"}
|
package/SVG/Path.d.ts
DELETED
package/SVG/Path.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Property } from "@nativescript/core";
|
|
2
|
-
import { SVGItem } from "./SVGItem";
|
|
3
|
-
export const dProperty = new Property({
|
|
4
|
-
name: 'd'
|
|
5
|
-
});
|
|
6
|
-
import { DOMParser } from 'xmldom';
|
|
7
|
-
export class Path extends SVGItem {
|
|
8
|
-
constructor() {
|
|
9
|
-
super();
|
|
10
|
-
this._dom = new DOMParser().parseFromString('<path></path>');
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
dProperty.register(Path);
|
|
14
|
-
//# sourceMappingURL=Path.js.map
|
package/SVG/Path.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Path.js","sourceRoot":"","sources":["../../../../packages/canvas/SVG/Path.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,QAAQ,CAAe;IACnD,IAAI,EAAE,GAAG;CACT,CAAC,CAAC;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,MAAM,OAAO,IAAK,SAAQ,OAAO;IAGhC;QACC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,eAAe,CAAC,CAAC;IAC9D,CAAC;CACD;AAED,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC"}
|
package/SVG/Pattern.d.ts
DELETED
package/SVG/Pattern.js
DELETED
package/SVG/Pattern.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Pattern.js","sourceRoot":"","sources":["../../../../packages/canvas/SVG/Pattern.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAIlC,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,MAAM,OAAO,OAAQ,SAAQ,OAAO;IACnC;QACC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,qBAAqB,CAAC,CAAC;IACpE,CAAC;CACD"}
|
package/SVG/Polygon.d.ts
DELETED
package/SVG/Polygon.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Property } from "@nativescript/core";
|
|
2
|
-
import { SVGItem } from "./SVGItem";
|
|
3
|
-
export const pointsProperty = new Property({
|
|
4
|
-
name: 'points'
|
|
5
|
-
});
|
|
6
|
-
import { DOMParser } from 'xmldom';
|
|
7
|
-
export class Polygon extends SVGItem {
|
|
8
|
-
constructor() {
|
|
9
|
-
super();
|
|
10
|
-
this._dom = new DOMParser().parseFromString('<polygon></polygon>');
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
pointsProperty.register(Polygon);
|
|
14
|
-
//# sourceMappingURL=Polygon.js.map
|
package/SVG/Polygon.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Polygon.js","sourceRoot":"","sources":["../../../../packages/canvas/SVG/Polygon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,oBAAoB,CAAC;AAE5C,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,QAAQ,CAAe;IACxD,IAAI,EAAE,QAAQ;CACd,CAAC,CAAC;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,MAAM,OAAO,OAAQ,SAAQ,OAAO;IAGnC;QACC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,qBAAqB,CAAC,CAAC;IACpE,CAAC;CACD;AAED,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC"}
|
package/SVG/Polyline.d.ts
DELETED
package/SVG/Polyline.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Property } from "@nativescript/core/ui/core/view";
|
|
2
|
-
import { SVGItem } from "./SVGItem";
|
|
3
|
-
export const pointsProperty = new Property({
|
|
4
|
-
name: 'points'
|
|
5
|
-
});
|
|
6
|
-
import { DOMParser } from 'xmldom';
|
|
7
|
-
export class Polyline extends SVGItem {
|
|
8
|
-
constructor() {
|
|
9
|
-
super();
|
|
10
|
-
this._dom = new DOMParser().parseFromString('<polyline></polyline>');
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
pointsProperty.register(Polyline);
|
|
14
|
-
//# sourceMappingURL=Polyline.js.map
|
package/SVG/Polyline.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Polyline.js","sourceRoot":"","sources":["../../../../packages/canvas/SVG/Polyline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,iCAAiC,CAAC;AAEzD,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,QAAQ,CAAgB;IACzD,IAAI,EAAE,QAAQ;CACd,CAAC,CAAC;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,MAAM,OAAO,QAAS,SAAQ,OAAO;IAGpC;QACC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,uBAAuB,CAAC,CAAC;IACtE,CAAC;CACD;AAED,cAAc,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC"}
|
package/SVG/Rect.d.ts
DELETED
package/SVG/Rect.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { SVGItem } from "./SVGItem";
|
|
2
|
-
import { DOMParser } from 'xmldom';
|
|
3
|
-
export class Rect extends SVGItem {
|
|
4
|
-
constructor() {
|
|
5
|
-
super();
|
|
6
|
-
this.x = 0;
|
|
7
|
-
this.y = 0;
|
|
8
|
-
this.rx = 0;
|
|
9
|
-
this.ry = 0;
|
|
10
|
-
this._dom = new DOMParser().parseFromString('<rect></rect>');
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=Rect.js.map
|
package/SVG/Rect.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Rect.js","sourceRoot":"","sources":["../../../../packages/canvas/SVG/Rect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,MAAM,OAAO,IAAK,SAAQ,OAAO;IAMhC;QACC,KAAK,EAAE,CAAC;QANT,MAAC,GAAQ,CAAC,CAAC;QACX,MAAC,GAAQ,CAAC,CAAC;QACX,OAAE,GAAQ,CAAC,CAAC;QACZ,OAAE,GAAQ,CAAC,CAAC;QAIX,IAAI,CAAC,IAAI,GAAG,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,eAAe,CAAC,CAAC;IAC9D,CAAC;CACD"}
|
package/SVG/SVG.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { View, Style, CssProperty } from '@nativescript/core';
|
|
2
|
-
export declare const strokeProperty: CssProperty<Style, any>;
|
|
3
|
-
export declare const strokeWidthProperty: CssProperty<Style, number>;
|
|
4
|
-
export declare const fillProperty: CssProperty<Style, any>;
|
|
5
|
-
export declare const fillRuleProperty: CssProperty<Style, any>;
|
|
6
|
-
export declare const fillOpacityProperty: CssProperty<Style, any>;
|
|
7
|
-
export declare const stopColorProperty: CssProperty<Style, any>;
|
|
8
|
-
export declare const strokeLinecapProperty: CssProperty<Style, any>;
|
|
9
|
-
export declare const strokeLinejoinProperty: CssProperty<Style, any>;
|
|
10
|
-
export declare const strokeMiterlimitProperty: CssProperty<Style, any>;
|
|
11
|
-
export declare const srcProperty: any;
|
|
12
|
-
import { SVGItem } from './SVGItem';
|
|
13
|
-
export declare class Svg extends View {
|
|
14
|
-
static readyEvent: string;
|
|
15
|
-
_dom: any;
|
|
16
|
-
_serializer: any;
|
|
17
|
-
_svg: any;
|
|
18
|
-
src: string;
|
|
19
|
-
__children: any[];
|
|
20
|
-
__attachedToDom: boolean;
|
|
21
|
-
constructor();
|
|
22
|
-
onLayout(left: number, top: number, right: number, bottom: number): void;
|
|
23
|
-
onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void;
|
|
24
|
-
__redraw(): void;
|
|
25
|
-
onLoaded(): void;
|
|
26
|
-
onUnloaded(): void;
|
|
27
|
-
createNativeView(): Object;
|
|
28
|
-
initNativeView(): void;
|
|
29
|
-
addChild(view: SVGItem): void;
|
|
30
|
-
removeChild(view: SVGItem): void;
|
|
31
|
-
}
|
package/SVG/SVG.js
DELETED
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
import { Http, View, Style, CssProperty, Property, path, knownFolders, CSSType, Application, Utils } from '@nativescript/core';
|
|
11
|
-
export const strokeProperty = new CssProperty({
|
|
12
|
-
name: 'stroke',
|
|
13
|
-
cssName: 'stroke',
|
|
14
|
-
defaultValue: undefined,
|
|
15
|
-
});
|
|
16
|
-
export const strokeWidthProperty = new CssProperty({
|
|
17
|
-
name: 'strokeWidth',
|
|
18
|
-
cssName: 'stroke-width',
|
|
19
|
-
defaultValue: 1,
|
|
20
|
-
});
|
|
21
|
-
export const fillProperty = new CssProperty({
|
|
22
|
-
name: 'fill',
|
|
23
|
-
cssName: 'fill',
|
|
24
|
-
defaultValue: undefined,
|
|
25
|
-
});
|
|
26
|
-
export const fillRuleProperty = new CssProperty({
|
|
27
|
-
name: 'fillRule',
|
|
28
|
-
cssName: 'fill-rule',
|
|
29
|
-
defaultValue: undefined,
|
|
30
|
-
});
|
|
31
|
-
export const fillOpacityProperty = new CssProperty({
|
|
32
|
-
name: 'fillOpacity',
|
|
33
|
-
cssName: 'fill-opacity',
|
|
34
|
-
defaultValue: undefined,
|
|
35
|
-
});
|
|
36
|
-
export const stopColorProperty = new CssProperty({
|
|
37
|
-
name: 'stopColor',
|
|
38
|
-
cssName: 'stop-color',
|
|
39
|
-
defaultValue: undefined,
|
|
40
|
-
});
|
|
41
|
-
export const strokeLinecapProperty = new CssProperty({
|
|
42
|
-
name: 'strokeLinecap',
|
|
43
|
-
cssName: 'stroke-linecap',
|
|
44
|
-
});
|
|
45
|
-
export const strokeLinejoinProperty = new CssProperty({
|
|
46
|
-
name: 'strokeLinejoin',
|
|
47
|
-
cssName: 'stroke-linejoin',
|
|
48
|
-
});
|
|
49
|
-
export const strokeMiterlimitProperty = new CssProperty({
|
|
50
|
-
name: 'strokeMiterlimit',
|
|
51
|
-
cssName: 'stroke-miterlimit',
|
|
52
|
-
});
|
|
53
|
-
export const srcProperty = new Property({
|
|
54
|
-
name: 'src',
|
|
55
|
-
});
|
|
56
|
-
import { DOMParser, XMLSerializer } from 'xmldom';
|
|
57
|
-
const initialSVG = '<svg width="auto" height="auto" xmlns="http://www.w3.org/2000/svg"></svg>';
|
|
58
|
-
let Svg = class Svg extends View {
|
|
59
|
-
constructor() {
|
|
60
|
-
super();
|
|
61
|
-
this.__children = [];
|
|
62
|
-
this.__attachedToDom = false;
|
|
63
|
-
if (global.isAndroid) {
|
|
64
|
-
const activity = Application.android.foregroundActivity || Application.android.startActivity;
|
|
65
|
-
this._svg = new org.nativescript.canvas.NSCSVG(activity);
|
|
66
|
-
}
|
|
67
|
-
else if (global.isIOS) {
|
|
68
|
-
this._svg = TNSSVG.alloc().initWithFrame(CGRectZero);
|
|
69
|
-
this._svg.backgroundColor = UIColor.clearColor;
|
|
70
|
-
}
|
|
71
|
-
this._dom = new DOMParser().parseFromString(initialSVG);
|
|
72
|
-
this._serializer = new XMLSerializer();
|
|
73
|
-
}
|
|
74
|
-
[srcProperty.setNative](value) {
|
|
75
|
-
if (typeof value === 'string') {
|
|
76
|
-
if (value.indexOf('<svg') > -1) {
|
|
77
|
-
if (global.isAndroid) {
|
|
78
|
-
this._svg.setSrc(value);
|
|
79
|
-
}
|
|
80
|
-
else if (global.isIOS) {
|
|
81
|
-
this._svg.src = value;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
if (value.startsWith('~')) {
|
|
86
|
-
if (global.isAndroid) {
|
|
87
|
-
this._svg.setSrcPath(path.join(knownFolders.currentApp().path, value.replace('~', '')));
|
|
88
|
-
}
|
|
89
|
-
else if (global.isIOS) {
|
|
90
|
-
this._svg.srcPath = path.join(knownFolders.currentApp().path, value.replace('~', ''));
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
else if (value.startsWith('/')) {
|
|
94
|
-
if (global.isAndroid) {
|
|
95
|
-
this._svg.setSrcPath(value);
|
|
96
|
-
}
|
|
97
|
-
else if (global.isIOS) {
|
|
98
|
-
this._svg.srcPath = value;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
else if (value.startsWith('http')) {
|
|
102
|
-
Http.getString(value)
|
|
103
|
-
.then((res) => {
|
|
104
|
-
if (global.isAndroid) {
|
|
105
|
-
this._svg.setSrc(res);
|
|
106
|
-
}
|
|
107
|
-
else if (global.isIOS) {
|
|
108
|
-
this._svg.src = res;
|
|
109
|
-
}
|
|
110
|
-
})
|
|
111
|
-
.catch((e) => {
|
|
112
|
-
console.log(e);
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
onLayout(left, top, right, bottom) {
|
|
119
|
-
super.onLayout(left, top, right, bottom);
|
|
120
|
-
this.__redraw();
|
|
121
|
-
}
|
|
122
|
-
onMeasure(widthMeasureSpec, heightMeasureSpec) {
|
|
123
|
-
const nativeView = this.nativeView;
|
|
124
|
-
if (nativeView) {
|
|
125
|
-
const width = Utils.layout.getMeasureSpecSize(widthMeasureSpec);
|
|
126
|
-
const height = Utils.layout.getMeasureSpecSize(heightMeasureSpec);
|
|
127
|
-
this.setMeasuredDimension(width, height);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
__redraw() {
|
|
131
|
-
if (this.__attachedToDom) {
|
|
132
|
-
const domCopy = this._dom.valueOf();
|
|
133
|
-
const serialized = this._serializer.serializeToString(domCopy);
|
|
134
|
-
const width = domCopy.documentElement.getAttribute('width');
|
|
135
|
-
const height = domCopy.documentElement.getAttribute('height');
|
|
136
|
-
if (width === 'auto') {
|
|
137
|
-
domCopy.documentElement.setAttribute('width', `${this.getMeasuredWidth()}px`);
|
|
138
|
-
}
|
|
139
|
-
if (height === 'auto') {
|
|
140
|
-
domCopy.documentElement.setAttribute('height', `${this.getMeasuredHeight()}px`);
|
|
141
|
-
}
|
|
142
|
-
if (serialized !== initialSVG) {
|
|
143
|
-
this.src = serialized;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
onLoaded() {
|
|
148
|
-
super.onLoaded();
|
|
149
|
-
this.__attachedToDom = true;
|
|
150
|
-
}
|
|
151
|
-
onUnloaded() {
|
|
152
|
-
this.__attachedToDom = false;
|
|
153
|
-
super.onUnloaded();
|
|
154
|
-
}
|
|
155
|
-
createNativeView() {
|
|
156
|
-
return this._svg;
|
|
157
|
-
}
|
|
158
|
-
initNativeView() {
|
|
159
|
-
super.initNativeView();
|
|
160
|
-
}
|
|
161
|
-
addChild(view) {
|
|
162
|
-
this._addView(view);
|
|
163
|
-
view.__attached = true;
|
|
164
|
-
this.__children.push(view);
|
|
165
|
-
}
|
|
166
|
-
removeChild(view) {
|
|
167
|
-
if (view.__attached) {
|
|
168
|
-
this._removeView(view);
|
|
169
|
-
view.__attached = false;
|
|
170
|
-
this.__children = this.__children.filter((item) => item !== view);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
};
|
|
174
|
-
Svg.readyEvent = 'ready';
|
|
175
|
-
Svg = __decorate([
|
|
176
|
-
CSSType('Svg'),
|
|
177
|
-
__metadata("design:paramtypes", [])
|
|
178
|
-
], Svg);
|
|
179
|
-
export { Svg };
|
|
180
|
-
srcProperty.register(Svg);
|
|
181
|
-
stopColorProperty.register(Style);
|
|
182
|
-
strokeWidthProperty.register(Style);
|
|
183
|
-
strokeProperty.register(Style);
|
|
184
|
-
fillProperty.register(Style);
|
|
185
|
-
fillOpacityProperty.register(Style);
|
|
186
|
-
fillRuleProperty.register(Style);
|
|
187
|
-
strokeLinecapProperty.register(Style);
|
|
188
|
-
strokeLinejoinProperty.register(Style);
|
|
189
|
-
strokeMiterlimitProperty.register(Style);
|
|
190
|
-
//# sourceMappingURL=SVG.js.map
|