Skip to content

Commit

Permalink
Merge pull request #44 from NativeScript/v1.0.0-alpha.0
Browse files Browse the repository at this point in the history
feat: 1.0.0-alpha.0
  • Loading branch information
triniwiz committed Jul 13, 2021
2 parents f0da24c + 5c4d9c7 commit 1e4ea6a
Show file tree
Hide file tree
Showing 145 changed files with 1,780 additions and 3,230 deletions.
2 changes: 1 addition & 1 deletion CanvasNative.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Pod::Spec.new do |s|

s.name = "CanvasNative"

s.version = "0.9.19"
s.version = "1.0.0-alpha.0"

s.summary = "A Canvas library"

Expand Down
12 changes: 6 additions & 6 deletions apps/demo/src/plugin-demos/canvas.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
</ActionBar>
</Page.actionBar>
<GridLayout loaded="{{ gridLoaded }}" rows="*,*" columns="*,*" iosOverflowSafeArea="false" width="100%" height="100%">
<canvas:Canvas rowSpan="2" colSpan="2" width="100%" height="100%" ready="{{ canvasLoaded }}"
layoutChanged="{{ onLayout }}"/>
<!-- <canvas:Svg id="1" width="100%" height="100%" src="{{src1}}" loaded="{{svgViewLoaded}}"/>
<canvas:Svg id="2" col="1" width="100%" height="100%" src="{{src2}}" loaded="{{svgViewLoaded}}"/>
<canvas:Svg id="3" row="1" width="100%" height="100%" src="{{src3}}" loaded="{{svgViewLoaded}}"/>
<canvas:Svg id="4" row="1" col="1" width="100%" height="100%" src="{{src4}}" loaded="{{svgViewLoaded}}"/> -->
<!-- <canvas:Canvas rowSpan="2" colSpan="2" width="100%" height="100%" ready="{{ canvasLoaded }}"
layoutChanged="{{ onLayout }}"/> -->
<canvas:Svg ignorePixelScaling="true" id="1" width="100%" height="100%" src="{{src1}}" loaded="{{svgViewLoaded}}"/>
<canvas:Svg ignorePixelScaling="true" id="2" col="1" width="100%" height="100%" src="{{src2}}" loaded="{{svgViewLoaded}}"/>
<canvas:Svg ignorePixelScaling="true" id="3" row="1" width="100%" height="100%" src="{{src3}}" loaded="{{svgViewLoaded}}"/>
<canvas:Svg ignorePixelScaling="true" id="4" row="1" col="1" width="100%" height="100%" src="{{src4}}" loaded="{{svgViewLoaded}}"/>
<Button height="40" tap="{{ draw }}" text="Draw"/>

<!-- <ScrollView rowSpan="4" visibility="{{ show ? 'visible': 'collapse' }}" orientation="vertical">
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@nativescript/core": "~7.0.0",
"@nativescript/types": "~7.0.0",
"@nativescript/webpack": "~3.0.0",
"@nativescript-community/gesturehandler": "^0.1.45",
"@ngtools/webpack": "~10.1.0",
"@nrwl/eslint-plugin-nx": "~10.1.0",
"@nrwl/jest": "~10.1.0",
Expand Down Expand Up @@ -73,8 +74,7 @@
"typescript": "~3.9.3",
"vexflow": "^3.0.9",
"xml2js": "^0.4.23",
"xmldom": "^0.3.0",
"xmldom-qsa": "^1.0.3",
"xmldom": "~0.6.0",
"zen-3d": "0.0.3",
"zone.js": "0.11.1"
},
Expand All @@ -87,6 +87,5 @@
"**/*": [
"nx format:write --files"
]
},
"dependencies": {}
}
}
2 changes: 1 addition & 1 deletion packages/canvas-babylon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"readmeFilename": "README.md",
"bootstrapper": "@nativescript/plugin-seed",
"peerDependencies": {
"@nativescript/canvas": "~0.9.2",
"@nativescript/canvas": "~1.0.0-alpha.0",
"babylonjs": "^4.1.0"
}
}
4 changes: 2 additions & 2 deletions packages/canvas-phaser-ce/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nativescript/canvas-phaser-ce",
"version": "1.0.0-alpha7",
"version": "1.0.0-beta.0",
"description": "Tools for using Phaser-ce to build native 2D games in NativeScript 👾",
"main": "index",
"typings": "index.d.ts",
Expand Down Expand Up @@ -33,7 +33,7 @@
"readmeFilename": "README.md",
"bootstrapper": "@nativescript/plugin-seed",
"peerDependencies": {
"@nativescript/canvas": "~0.9.2",
"@nativescript/canvas": "~1.0.0-alpha.0",
"phaser-ce": "2.15.0"
}
}
4 changes: 2 additions & 2 deletions packages/canvas-phaser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nativescript/canvas-phaser",
"version": "1.0.0-alpha6",
"version": "1.0.0-beta.0",
"description": "Build awesome 2D games with Phaser.js and NativeScript",
"main": "index",
"typings": "index.d.ts",
Expand Down Expand Up @@ -33,7 +33,7 @@
"readmeFilename": "README.md",
"bootstrapper": "@nativescript/plugin-seed",
"peerDependencies": {
"@nativescript/canvas": "~0.9.2",
"@nativescript/canvas": "~1.0.0-alpha.0",
"phaser": "^3.24.1"
}
}
4 changes: 2 additions & 2 deletions packages/canvas-pixi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nativescript/canvas-pixi",
"version": "1.0.0-alpha6",
"version": "1.0.0-beta.0",
"description": "Plugin for using pixi.js in NativeScript",
"main": "index",
"typings": "index.d.ts",
Expand Down Expand Up @@ -33,7 +33,7 @@
"readmeFilename": "README.md",
"bootstrapper": "nativescript-plugin-seed",
"peerDependencies": {
"@nativescript/canvas": "~0.9.2",
"@nativescript/canvas": "~1.0.0-alpha.0",
"pixi.js": "^5.3.3"
}
}
15 changes: 11 additions & 4 deletions packages/canvas-polyfill/DOM/Document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Element } from './Element';
import { HTMLVideoElement } from './HTMLVideoElement';
import { HTMLImageElement } from './HTMLImageElement';
import { HTMLCanvasElement } from './HTMLCanvasElement';
import { SVGElement, SVGCircleElement, SVGRectElement , SVGGElement, SVGPathElement} from './svg';
import { Text } from './Text';
import { Canvas } from '@nativescript/canvas';
import { Frame } from '@nativescript/core';
Expand Down Expand Up @@ -33,6 +34,16 @@ export class Document extends Element {
case 'iframe':
// Return nothing to keep firebase working.
return null;
case 'svg':
return new SVGElement();
case 'rect':
return new SVGRectElement();
case 'circle':
return new SVGCircleElement();
case 'g':
return new SVGGElement();
case 'path':
return new SVGPathElement();
default:
return new Element(tagName);
}
Expand Down Expand Up @@ -76,8 +87,4 @@ export class Document extends Element {
}
return new Element('div');
}

querySelector(selector) {
return new Element(selector);
}
}
18 changes: 16 additions & 2 deletions packages/canvas-polyfill/DOM/Element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ export class Element extends Node {
return this.nodeName;
}

setAttribute() {}
setAttribute(key, value) {
console.log(this.className,'setAttribute', key, value);
}

removeAttribute() {}
removeAttribute(key, value) {
console.log(this.className,'removeAttribute', key, value);
}

setAttributeNS() {}

Expand Down Expand Up @@ -77,4 +81,14 @@ export class Element extends Node {
get ontouchstart() {
return {};
}

querySelectorAll(selector) {
console.log('querySelectorAll', 'selector', selector);
return [];
}

querySelector(selector) {
/// return new Element(selector);
console.log(this.__internalElement._dom);
}
}
Loading

0 comments on commit 1e4ea6a

Please sign in to comment.