Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions 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 = "1.0.0-alpha.3"
s.version = "1.0.0-alpha.11"

s.summary = "A Canvas library"

Expand All @@ -18,11 +18,11 @@ Pod::Spec.new do |s|
s.source = { :git => "https://github.com/nativescript/canvas.git", :tag => "#{s.version}" }

s.pod_target_xcconfig = {
'FRAMEWORK_SEARCH_PATHS' => '$(inherited) "${PODS_ROOT}/CanvasNative/Dist"',
'FRAMEWORK_SEARCH_PATHS' => '$(inherited) "${PODS_ROOT}/dist"',
'ENABLE_BITCODE' => 'YES',
'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => '"arm64"',
}
s.swift_versions = ['4.0','4.2', '5.0']
s.vendored_frameworks = 'packages/canvas/src-native/canvas-ios/CanvasNative/Dist/CanvasNative.xcframework'
s.preserve_paths = 'packages/canvas/src-native/canvas-ios/CanvasNative/Dist/CanvasNative.xcframework'
s.vendored_frameworks = 'packages/canvas/src-native/canvas-ios/dist/CanvasNative.xcframework'
s.preserve_paths = 'packages/canvas/src-native/canvas-ios/dist/CanvasNative.xcframework'
end
4 changes: 2 additions & 2 deletions apps/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"zen-3d": "file:../../node_modules/zen-3d"
},
"devDependencies": {
"@nativescript/android": "8.2.0-alpha.2",
"@nativescript/ios": "8.0.0"
"@nativescript/android": "8.1.1",
"@nativescript/ios": "8.1.0"
}
}
1 change: 1 addition & 0 deletions apps/demo/src/app.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
require('@nativescript/canvas-polyfill');
import { Application } from '@nativescript/core';
Application.run({ moduleName: 'app-root' });
51 changes: 49 additions & 2 deletions apps/demo/src/plugin-demos/canvas.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,57 @@
import {EventData, Page} from '@nativescript/core';
import {DemoSharedCanvas} from '@demo/shared';
import { EventData, Page, WebView } from '@nativescript/core';
import { DemoSharedCanvas } from '@demo/shared';

export function navigatingTo(args: EventData) {
const page = <Page>args.object;
page.bindingContext = new DemoModel();
}

export function loaded(args) {
const view = <WebView>args.object;
view.src = `
<script>

document.addEventListener('DOMContentLoaded', ()=>{
const canvas = document.createElement('canvas');
canvas.style = "width:100%;height:100%;background-color:red;";
document.body.appendChild(canvas);
canvas.addEventListener('touchstart', e =>{
console.log('touchstart',e);
});
canvas.addEventListener('pointerdown', e =>{
console.log('pointerdown',e);
});
canvas.addEventListener('pointermove', e =>{
console.log('pointermove',e);
});
canvas.addEventListener('touchmove', e =>{
console.log('touchmove',e);
});
canvas.addEventListener('pointerup', e =>{
console.log('pointerup',e);
});
canvas.addEventListener('touchend', e =>{
console.log('touchend',e);
});
canvas.addEventListener('pointercancel', e =>{
console.log('pointercancel',e);
});
canvas.addEventListener('touchcancel', e =>{
console.log('touchcancel',e);
});
canvas.addEventListener('wheel', e =>{
console.log('wheel',e);
});
}, false);

</script>
<!DOCTYPE html>
<html>
<body>
</body>
</html>
`;
}

export class DemoModel extends DemoSharedCanvas {
}
5 changes: 3 additions & 2 deletions apps/demo/src/plugin-demos/canvas.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
</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 }}"/>
<WebView rowSpan="2" colSpan="2" height="100%" width="100%" loaded="loaded"/>
<!-- <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}}"/>
Expand Down
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@
"sync-packages-with-demos": "nx g @nativescript/plugin-tools:sync-packages-with-demos",
"postinstall": "husky install && npx ts-patch install",
"remove-package": "nx g @nativescript/plugin-tools:remove-package",
"add-demo": "nx g @nativescript/plugin-tools:add-demo"
"add-demo": "nx g @nativescript/plugin-tools:add-demo",
"build.canvas.android.release": "nx run canvas:build.native.android.release",
"build.canvas.android.debug": "nx run canvas:build.native.android.debug",
"build.canvas.ios.release": "nx run canvas:build.native.ios.release",
"build.canvas.ios.debug": "nx run canvas:build.native.ios.debug",
"build.canvas.ios.framework.release": "nx run canvas:build.native.ios.framework.release",
"build.canvas.ios.framework.debug": "nx run canvas:build.native.ios.framework.debug"
},
"private": true,
"devDependencies": {
Expand All @@ -25,7 +31,6 @@
"@angular/platform-browser": "^12.0.0",
"@angular/platform-browser-dynamic": "^12.0.0",
"@angular/router": "^12.0.0",
"@nativescript-community/gesturehandler": "^0.1.45",
"@nativescript/angular": "^12.0.0",
"@nativescript/core": "~8.1.0",
"@nativescript/plugin-tools": "2.1.0",
Expand Down Expand Up @@ -56,7 +61,7 @@
"rimraf": "^3.0.2",
"rxjs": "~6.6.0",
"svelte-native": "^0.9.3",
"three": "^0.123.0",
"three": "^0.133.1",
"typescript": "~4.3.0",
"vexflow": "^3.0.9",
"xmldom": "~0.6.0",
Expand Down
6 changes: 4 additions & 2 deletions packages/canvas-babylon/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nativescript/canvas-babylon",
"version": "1.0.0-beta.1",
"version": "1.0.0-beta.5",
"description": "",
"main": "index",
"typings": "index.d.ts",
Expand Down Expand Up @@ -32,8 +32,10 @@
"homepage": "https://github.com/NativeScript/canvas",
"readmeFilename": "README.md",
"bootstrapper": "@nativescript/plugin-seed",
"dependencies": {
"@nativescript/canvas-polyfill": "beta"
},
"peerDependencies": {
"@nativescript/canvas": "alpha",
"babylonjs": "^4.1.0"
}
}
2 changes: 1 addition & 1 deletion packages/canvas-media/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nativescript/canvas-media",
"version": "0.12.0",
"version": "0.13.2",
"description": "Canvas media",
"main": "index",
"typings": "index.d.ts",
Expand Down
6 changes: 4 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-beta.1",
"version": "1.0.0-beta.5",
"description": "Tools for using Phaser-ce to build native 2D games in NativeScript 👾",
"main": "index",
"typings": "index.d.ts",
Expand Down Expand Up @@ -32,8 +32,10 @@
"homepage": "https://github.com/NativeScript/canvas",
"readmeFilename": "README.md",
"bootstrapper": "@nativescript/plugin-seed",
"dependencies": {
"@nativescript/canvas-polyfill": "beta"
},
"peerDependencies": {
"@nativescript/canvas": "alpha",
"phaser-ce": "2.15.0"
}
}
6 changes: 4 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-beta.1",
"version": "1.0.0-beta.5",
"description": "Build awesome 2D games with Phaser.js and NativeScript",
"main": "index",
"typings": "index.d.ts",
Expand Down Expand Up @@ -32,8 +32,10 @@
"homepage": "https://github.com/NativeScript/canvas",
"readmeFilename": "README.md",
"bootstrapper": "@nativescript/plugin-seed",
"dependencies": {
"@nativescript/canvas-polyfill": "beta"
},
"peerDependencies": {
"@nativescript/canvas": "alpha",
"phaser": "^3.24.1"
}
}
6 changes: 4 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-beta.1",
"version": "1.0.0-beta.5",
"description": "Plugin for using pixi.js in NativeScript",
"main": "index",
"typings": "index.d.ts",
Expand Down Expand Up @@ -32,8 +32,10 @@
"homepage": "https://github.com/NativeScript/canvas",
"readmeFilename": "README.md",
"bootstrapper": "nativescript-plugin-seed",
"dependencies": {
"@nativescript/canvas-polyfill": "beta"
},
"peerDependencies": {
"@nativescript/canvas": "alpha",
"pixi.js": "^5.3.3"
}
}
Loading