Skip to content

Commit b08add1

Browse files
committed
chore: added ui-svg to the monorepo
1 parent cb6f821 commit b08add1

31 files changed

+8284
-56
lines changed

demo-snippets/assets/svgs/Ghostscript_Tiger.svg

+725
Loading
+9
Loading
Loading
+23
Loading

demo-snippets/assets/svgs/test.svg

+36
Loading

demo-snippets/vue/SVG.vue

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<template>
2+
<Page>
3+
<ActionBar title="Image Demo" />
4+
5+
<GridLayout rows="auto,*">
6+
<SVGView blendingMode="lighten" height="30%" src="~/assets/svgs/Ghostscript_Tiger.svg" stretch="aspectFit" backgroundColor="transparent" @tap="onTap"/>
7+
<CollectionView row="1" rowHeight="180" ref="listView" :items="itemList" @itemTap="onItemTap" itemIdGenerator="index">
8+
<v-template>
9+
<GridLayout>
10+
<CanvasSVG @tap="refreshCanvas">
11+
<Rectangle left="0" width="50" height="100%" color="red" horizontalAlignment="left" />
12+
13+
<Line id="line" :antiAlias="true" color="yellow" startX="10%" startY="34%" stopX="90%" stopY="90%" strokeCap="round" strokeJoin="round" strokeWidth="4" dash="1 10 0" />
14+
<CSVG cache="false" horizontalAlignment="center" src="~/assets/svgs/MenuButton.svg" width="10" height="30" stretch="aspectFit" />
15+
<CSVG horizontalAlignment="left" src="~/assets/svgs/ShareButton.svg" height="100%" stretch="aspectFit" />
16+
</CanvasSVG>
17+
</GridLayout>
18+
</v-template>
19+
</CollectionView>
20+
</GridLayout>
21+
</Page>
22+
</template>
23+
24+
<script lang="ts">
25+
import { CanvasView } from '@nativescript-community/ui-canvas';
26+
import Vue from 'nativescript-vue';
27+
import { Component } from 'vue-property-decorator';
28+
29+
@Component
30+
export default class Image extends Vue {
31+
itemList=new Array(1000).fill(null).map((v, i) => ({
32+
index: i,
33+
}))
34+
refreshCanvas(event) {
35+
(event.object as CanvasView).redraw();
36+
}
37+
onItemTap({ index, item }) {
38+
console.log(`Tapped on ${index} ${item.title}`);
39+
}
40+
onTap(e) {
41+
e.object.src = '~/assets/svgs/MenuButton.svg'
42+
}
43+
logEvent(e) {
44+
console.log('logEvent', e.eventName, e.extraData);
45+
}
46+
}
47+
</script>

demo-snippets/vue/install.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Animation from './Animation.vue';
44
import Shapes from './Shapes.vue';
55
import Image from './Image.vue';
66
import Complex from './Complex.vue';
7+
import SVG from './SVG.vue';
78
import CanvasPlugin from '@nativescript-community/ui-canvas/vue';
89

910
export function installPlugin() {
@@ -15,5 +16,6 @@ export const demos = [
1516
{ name: 'Animation', path: 'Animation', component: Animation },
1617
{ name: 'Shapes', path: 'Shapes', component: Shapes },
1718
{ name: 'Image', path: 'Image', component: Image },
18-
{ name: 'Complex', path: 'Complex', component: Complex }
19+
{ name: 'Complex', path: 'Complex', component: Complex },
20+
{ name: 'SVG', path: 'SVG', component: SVG }
1921
];

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"plugin.watch.android": "npm i && npm-watch build.android",
2020
"plugin.watch.ios": "npm i && npm-watch build.ios",
2121
"plugin.watch": "npm run plugin.watch.tsc & npm run plugin.watch.android & npm run plugin.watch.ios",
22-
"publish": "npm run clean && npm run build.all && npm run readme && npm run doc && lerna publish --no-private --create-release=github --force-publish",
22+
"publish": "npm run clean && npm run build.all && npm run readme && npm run doc && lerna publish",
2323
"sync": "node ./tools/sync.js",
2424
"commitmsg": "commitlint -e $GIT_PARAMS",
2525
"build.all": "npm run build",
@@ -37,7 +37,8 @@
3737
"devDependencies": {
3838
"@nativescript-community/arraybuffers": "1.1.1",
3939
"@nativescript-community/plugin-seed-tools": "file:tools",
40-
"@nativescript-community/template-snippet": "file:demo-snippets"
40+
"@nativescript-community/template-snippet": "file:demo-snippets",
41+
"@nativescript-community/text": "^1.5.11"
4142
},
4243
"repository": {
4344
"type": "git",

0 commit comments

Comments
 (0)