Skip to content

Commit

Permalink
Update snippet/examples dependencies to tabris 3.0.0-beta1
Browse files Browse the repository at this point in the history
Change-Id: I888c928c8635c9d7494d4e7e74ad425823d96560
  • Loading branch information
tbuschto committed Oct 2, 2018
1 parent 1d70b85 commit 617dfb2
Show file tree
Hide file tree
Showing 22 changed files with 46 additions and 26 deletions.
2 changes: 1 addition & 1 deletion doc/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ See [package.json | npm documentation](https://docs.npmjs.com/files/package.json
// ...
"main": "src/app.js",
"dependencies": {
"tabris": "^2.0.0",
"tabris": "^3.0.0",
"left-pad": "^1.1.3",
// ...
}
Expand Down
2 changes: 1 addition & 1 deletion examples/animation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"description": "Animations can be used to change properties",
"main": "app.js",
"dependencies": {
"tabris": "^2.3.0"
"tabris": "3.0.0-beta1"
}
}
2 changes: 1 addition & 1 deletion examples/automata/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"main": "automata.js",
"dependencies": {
"tabris": "^2.3.0"
"tabris": "3.0.0-beta1"
}
}
2 changes: 1 addition & 1 deletion examples/bookstore/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "An example of a bookstore app",
"main": "bookstore.js",
"dependencies": {
"tabris": "^2.3.0"
"tabris": "3.0.0-beta1"
}

}
2 changes: 1 addition & 1 deletion examples/canvas/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"category": "Web APIs",
"main": "app.js",
"dependencies": {
"tabris": "file:../../build/tabris"
"tabris": "3.0.0-beta1"
}
}
2 changes: 1 addition & 1 deletion examples/chart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"category": "Web APIs",
"dependencies": {
"chart.js": "1.0.1",
"tabris": "^2.3.0"
"tabris": "3.0.0-beta1"
},
"main": "chartdemo.js"
}
2 changes: 1 addition & 1 deletion examples/cordova/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"category": "Cordova",
"main": "app.js",
"dependencies": {
"tabris": "^2.3.0"
"tabris": "3.0.0-beta1"
}
}
2 changes: 1 addition & 1 deletion examples/fetch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"category": "Web APIs",
"main": "fetch.js",
"dependencies": {
"tabris": "^2.3.0"
"tabris": "3.0.0-beta1"
}
}
2 changes: 1 addition & 1 deletion examples/gallery/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"description": "Demonstrates how to display and scale images",
"main": "gallery.js",
"dependencies": {
"tabris": "^2.4.0"
"tabris": "3.0.0-beta1"
}
}
2 changes: 1 addition & 1 deletion examples/hello/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"start": "tabris serve"
},
"dependencies": {
"tabris": "^2.3.0"
"tabris": "3.0.0-beta1"
}
}
2 changes: 1 addition & 1 deletion examples/i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"category": "Small Apps",
"main": "i18n.js",
"dependencies": {
"tabris": "^2.3.0"
"tabris": "3.0.0-beta1"
}
}
2 changes: 1 addition & 1 deletion examples/input-tsx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"serve": "tabris serve"
},
"dependencies": {
"tabris": "^2.3.0"
"tabris": "3.0.0-beta1"
},
"devDependencies": {
"typescript": "^2.3.3"
Expand Down
2 changes: 1 addition & 1 deletion examples/input/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"category": "Small Apps",
"main": "input.js",
"dependencies": {
"tabris": "^2.3.0"
"tabris": "3.0.0-beta1"
}
}
2 changes: 1 addition & 1 deletion examples/parallax/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"description": "Provides a sample implementation for a parallax scrolling effect",
"main": "parallax.js",
"dependencies": {
"tabris": "^2.3.0"
"tabris": "3.0.0-beta1"
}
}
2 changes: 1 addition & 1 deletion examples/reddit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"category": "Small Apps",
"main": "reddit.js",
"dependencies": {
"tabris": "^2.4.0"
"tabris": "3.0.0-beta1"
}
}
2 changes: 1 addition & 1 deletion examples/swipe-to-dismiss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"category": "Small Apps",
"main": "swipe-to-dismiss.js",
"dependencies": {
"tabris": "^2.3.0"
"tabris": "3.0.0-beta1"
}
}
2 changes: 1 addition & 1 deletion examples/timer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"description": "Demonstrates using the Tabris.js timer with the window.timer API",
"main": "timer.js",
"dependencies": {
"tabris": "^2.3.0"
"tabris": "3.0.0-beta1"
}
}
2 changes: 1 addition & 1 deletion examples/timezones/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"dependencies": {
"moment": "^2.19.2",
"moment-timezone": "^0.5.14",
"tabris": "^2.3.0"
"tabris": "3.0.0-beta1"
}
}
2 changes: 1 addition & 1 deletion examples/typescript-weather-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"tabris": "^2.3.0"
},
"devDependencies": {
"typescript": "^2.1.5"
"tabris": "3.0.0-beta1"
}
}
2 changes: 1 addition & 1 deletion examples/web-socket/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"server": "cd server && npm i && npm start"
},
"dependencies": {
"tabris": "^2.3.0"
"tabris": "3.0.0-beta1"
}
}
30 changes: 25 additions & 5 deletions snippets/actionsheet.jsx → snippets/actionsheet.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
import {ActionSheet, ActionSheetItem, TextView, Button, WidgetCollection} from 'tabris';
import {ActionSheet, ActionSheetItem, TextView, Button, WidgetCollection, ui} from 'tabris';

tabris.ui.contentView.append(
const StyledText = (properties: TextView['jsxProperties']) =>
<TextView textColor='red' {...properties} />;

ui.contentView.append(
<WidgetCollection>
<Button left={16} right={16} top={16} onSelect={showActionSheet}>Show ActionSheet</Button>
<TextView left={16} right={16} top='prev() 16' alignment='center'/>
<StyledText left={16} right={16} top='prev() 16' alignment='center'/>
</WidgetCollection>
);

const textView = tabris.ui.contentView.find(TextView).first();
const textView = ui.contentView.find(TextView).first();
const onSelect = ({target, index}) => textView.text = `"${target.actions[index].title}" selected`;
const onClose = () => console.log('ActionSheet closed');

function showActionSheet() {
function showActionSheet(...args) {
console.log(args);
ActionSheet.open(
<ActionSheet title='Actions' onSelect={onSelect} onClose={onClose}>
Select any of the actions below to proceed.
Expand All @@ -23,3 +27,19 @@ function showActionSheet() {
</ActionSheet>
);
}

type LinearGradient = string | {angle: number, colors: string[]};
type LinearGradientShader = {linearGradient: LinearGradient};
type ColorShader = {color: string};

class Foo {

background: LinearGradientShader | ColorShader;
backgroundGradient: LinearGradient;
backgroundColor: string;

}

new Foo().background = {color: 'foo', linearGradient: {}};
new Color({r})
[255, 255, 0]
2 changes: 1 addition & 1 deletion snippets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "tabris-js-snippets",
"version": "3.0.0",
"dependencies": {
"tabris": "^2.6.1",
"tabris": "3.0.0-beta1",
"typescript": "^2.9.2"
},
"scripts": {
Expand Down

0 comments on commit 617dfb2

Please sign in to comment.