Skip to content

Commit 7192ac9

Browse files
committedMar 18, 2020
Initial release
1 parent 5a9e4f9 commit 7192ac9

13 files changed

+1162
-75
lines changed
 

‎.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
snippets/cson
2+
.vscode-test/
3+
*.vsix

‎CHANGELOG.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# Change Log
22

3-
All notable changes to the "nativescript-angular-snippets" extension will be documented in this file.
3+
## v0.1.0 (2020-3-17)
44

5-
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
6-
7-
## [Unreleased]
8-
9-
- Initial release
5+
- Initial release

‎LICENSE.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2020 John James G. Ermita¤o
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), to deal in
7+
the Software without restriction, including without limitation the rights to
8+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
the Software, and to permit persons to whom the Software is furnished to do so,
10+
subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

‎README.md

Lines changed: 198 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,202 @@
1-
# nativescript-angular-snippets README
1+
# Nativescript: Angular HTML Snippets (vscode extension)
22

3-
This is the README for your extension "nativescript-angular-snippets". After writing up a brief description, we recommend including the following sections.
3+
**Updated for Nativescript v6.4.0 and Angular v9.0.0 release**
44

5-
## Features
6-
7-
Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file.
8-
9-
For example if there is an image subfolder under your extension project workspace:
10-
11-
\!\[feature X\]\(images/feature-x.png\)
12-
13-
> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow.
14-
15-
## Requirements
16-
17-
If you have any requirements or dependencies, add a section describing those and how to install and configure them.
18-
19-
## Extension Settings
20-
21-
Include if your extension adds any VS Code settings through the `contributes.configuration` extension point.
22-
23-
For example:
24-
25-
This extension contributes the following settings:
26-
27-
* `myExtension.enable`: enable/disable this extension
28-
* `myExtension.thing`: set to `blah` to do something
29-
30-
## Known Issues
31-
32-
Calling out known issues can help limit users opening duplicate issues against your extension.
5+
This extension adds all HTML Nativescript UI Components, Layouts and Gestures snippets.
336

34-
## Release Notes
35-
36-
Users appreciate release notes as you update your extension.
37-
38-
### 1.0.0
39-
40-
Initial release of ...
41-
42-
### 1.0.1
43-
44-
Fixed issue #.
45-
46-
### 1.1.0
47-
48-
Added features X, Y, and Z.
49-
50-
-----------------------------------------------------------------------------------------------------------
51-
52-
## Working with Markdown
53-
54-
**Note:** You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:
55-
56-
* Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux)
57-
* Toggle preview (`Shift+CMD+V` on macOS or `Shift+Ctrl+V` on Windows and Linux)
58-
* Press `Ctrl+Space` (Windows, Linux) or `Cmd+Space` (macOS) to see a list of Markdown snippets
59-
60-
### For more information
61-
62-
* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown)
63-
* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/)
7+
## Features
648

65-
**Enjoy!**
9+
* Default syntax - Plain Nativescript tag.
10+
* Property syntax - Includes all properties from Angular Nativescript [documentation].
11+
* Complete syntax - Includes all properties, all events and documentation.
12+
* Layout snippets
13+
* Gesture snippets
14+
* System Icon snippets
15+
16+
### Description
17+
18+
| | snippet | entered by user | output | description |
19+
| --------------- | ---------------- | --------- | -------------------------- | -----------------------------------------|
20+
| default | `ns-button` | `nsbutt` | `<Button></Button>` | plain |
21+
| property (prop) | `ns-button-prop` | `nsbutpr` | with *prop | With all properties |
22+
| complete (comp) | `ns-button-comp` | `nsbu-c` | with *prop, *events, *docs | All properties, events and documentation |
23+
| layout snippets | `ns-dock-layout-snippet-2` | `nsdocnip2` | [snippet 2] | Sample snippet from [site docs]. |
24+
| gestures | `ns-tap` | `nstap` | `(tap)=""` | Gesture Snippets |
25+
| setting icon | `ns-icon-stop` | `nsicost` | `14` | [Setting Icon] snippets |
26+
27+
For complete snippet reference and more examples [check this].
28+
29+
### `ns-button`: In Action
30+
31+
#### Default output
32+
33+
``` html
34+
<Button></Button>
35+
```
36+
37+
#### Property output
38+
39+
``` html
40+
<Button text=""></Button>
41+
```
42+
43+
#### Complete output
44+
45+
``` html
46+
<Button
47+
text="string"
48+
(tap)=""
49+
(loaded)=""
50+
(unloaded)=""
51+
(layoutChanged)="">
52+
</Button>
53+
<!--
54+
Properties
55+
NAME TYPE DESCRIPTION
56+
text string Gets or sets the label of the button.
57+
58+
Events
59+
NAME DESCRIPTION
60+
tap Emitted when the button is tapped.
61+
loaded Emitted when the view is loaded.
62+
unloaded Emitted when the view is unloaded.
63+
layoutChanged Emitted when the layout bounds of a view changes due to layout processing.
64+
-->
65+
```
66+
67+
### `ns-dock-layout-snippet-2`: In Action
68+
69+
``` html
70+
<DockLayout width="210" height="210" backgroundColor="lightgray" stretchLastChild="true">
71+
<Label text="left" dock="left" backgroundColor="red"></Label>
72+
<Label text="top" dock="top" backgroundColor="green"></Label>
73+
<Label text="right" dock="right" backgroundColor="blue"></Label>
74+
<Label text="bottom" dock="bottom" backgroundColor="yellow"></Label>
75+
</DockLayout>
76+
```
77+
78+
### Demo
79+
80+
HTML snippet `ns-text-field` in action; _default_, _property_ (prop) and _complete_ (comp) syntax demo.
81+
82+
![nativescript-angular-html-snippet-demo](images/playback.gif "Nativescript: Angular HTML Snippets demo")
83+
84+
### Snippets: User Interface > Layouts
85+
86+
* ns-absolute-layout
87+
* ns-dock-layout
88+
* ns-grid-layout
89+
* ns-stack-layout
90+
* ns-wrap-layout
91+
* ns-flexbox-layout
92+
93+
### Snippets: User Interface > Components
94+
95+
* ns-actionbar
96+
* ns-actionbarextension
97+
* ns-actionitem
98+
* ns-navigationbutton
99+
* ns-activityindicator
100+
* ns-button
101+
* ns-datepicker
102+
* ns-formattedstring
103+
* ns-htmlview
104+
* ns-image
105+
* ns-label
106+
* ns-listpicker
107+
* ns-listview
108+
* ns-progress
109+
* ns-scroll-view
110+
* ns-search-bar
111+
* ns-segmented-bar
112+
* ns-segmented-bar-item
113+
* ns-slider
114+
* ns-switch
115+
* ns-bottom-navigation
116+
* ns-tab-strip
117+
* ns-tab-strip-item
118+
* ns-tab-content-item
119+
* ns-tabs
120+
* ns-tab-view
121+
* ns-tab-view-item
122+
* ns-text-field
123+
* ns-text-view
124+
* ns-time-picker
125+
* ns-web-view
126+
127+
### Snippets: Gestures
128+
129+
| Snippet | Output |
130+
|----------------|------------------|
131+
| `ns-tap` | `(tap)=""` |
132+
| `ns-doubleTap` | `(doubleTap)=""` |
133+
| `ns-longPress` | `(longPress)=""` |
134+
| `ns-swipe` | `(swipe)=""` |
135+
| `ns-pan` | `(pan)=""` |
136+
| `ns-pinch` | `(pinch)=""` |
137+
| `ns-rotation` | `(rotation)=""` |
138+
| `ns-touch` | `(touch)=""` |
139+
140+
### Snippets: Setting Icons
141+
142+
| Snippet | Output |
143+
|------------------|--------|
144+
|`ns-icon-action` | `9` |
145+
|`ns-icon-undo` | `21` |
146+
147+
#### List
148+
149+
| ICON | VALUE | ICON | VALUE |
150+
|---------------|-------|-------------|-------|
151+
| Done | 0 | Search | 12 |
152+
| Cancel | 1 | Refresh | 13 |
153+
| Edit | 2 | Stop | 14 |
154+
| Save | 3 | Camera | 15 |
155+
| Add | 4 | Trash | 16 |
156+
| FlexibleSpace | 5 | Play | 17 |
157+
| FixedSpace | 6 | Pause | 18 |
158+
| Compose | 7 | Rewind | 19 |
159+
| Reply | 8 | FastForward | 20 |
160+
| Action | 9 | Undo | 21 |
161+
| Organize | 10 | Redo | 22 |
162+
| Bookmarks | 11 | PageCurl | 23 |
163+
164+
Reference: https://docs.nativescript.org/angular/ui/action-bar#setting-icons
165+
166+
## Installation
167+
168+
1. Install Visual Studio Code v1.30.0 or higher
169+
1. Launch Code
170+
1. From the command palette `Ctrl+Shift+P` (Windows, Linux) or `Cmd+Shift+P` (OSX)
171+
1. Select Install Extensions
172+
1. Choose **Nativescript: Angular HTML Snippets** by _ElecTreeFrying_
173+
1. Reload Visual Studio Code
174+
175+
## Changelog
176+
177+
See [CHANGELOG] for more information.
178+
179+
## Contributing
180+
181+
* File bugs, feature requests in [GitHub Issues].
182+
* Leave a review on [Visual Studio Marketplace].
183+
184+
## Related
185+
186+
[More extensions of mine]
187+
188+
## License
189+
190+
MIT
191+
192+
[Link]: https://github.com/ElecTreeFrying/nativescript-angular-html-snippets/blob/master/reference.md
193+
[check this]: https://github.com/ElecTreeFrying/nativescript-angular-html-snippets/blob/master/reference.md
194+
[documentation]: https://docs.nativescript.org/angular/start/introduction
195+
[Setting Icon]: https://docs.nativescript.org/angular/ui/action-bar#setting-icons
196+
[snippet 2]: https://docs.nativescript.org/angular/ui/layouts/layout-containers#docklayout
197+
[site docs]: https://docs.nativescript.org/angular/ui/layouts/layout-containers#docklayout
198+
199+
[CHANGELOG]: https://marketplace.visualstudio.com/items/ElecTreeFrying.nativescript-angular-html-snippets/changelog
200+
[Github Issues]: https://github.com/ElecTreeFrying/nativescript-angular-html-snippets/issues
201+
[Visual Studio Marketplace]: https://marketplace.visualstudio.com/items?itemName=ElecTreeFrying.nativescript-angular-html-snippets&ssr=false#review-details
202+
[More extensions of mine]: https://marketplace.visualstudio.com/publishers/ElecTreeFrying

‎images/ns-ng.png

89.6 KB
Loading

‎images/playback.gif

620 KB
Loading

‎package.json

Lines changed: 47 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,59 @@
11
{
2-
"name": "nativescript-angular-snippets",
3-
"displayName": "Nativescript Angular Snippets",
4-
"description": "test",
5-
"version": "0.0.1",
6-
"engines": {
7-
"vscode": "^1.43.0"
2+
"name": "nativescript-angular-html-snippets",
3+
"publisher": "ElecTreeFrying",
4+
"author": {
5+
"name": "John James Ermitaño",
6+
"email": "jjgermitano@gmail.com"
87
},
8+
"displayName": "Nativescript: Angular HTML Snippets",
9+
"description": "This extension adds all HTML Nativescript UI Components, Layouts and Gestures snippets.",
10+
"version": "0.0.1",
11+
"icon": "images/ns-ns.png",
912
"categories": [
1013
"Snippets"
1114
],
15+
"keywords": [
16+
"nativescript",
17+
"snippets",
18+
"anuglar",
19+
"snipet"
20+
],
21+
"galleryBanner": {
22+
"color": "#494949",
23+
"theme": "dark"
24+
},
25+
"homepage": "https://github.com/ElecTreeFrying/nativescript-angular-html-snippets/blob/master/README.md",
26+
"readme": "",
27+
"repository": {
28+
"type": "git",
29+
"url": "https://github.com/ElecTreeFrying/nativescript-angular-html-snippets.git"
30+
},
31+
"bugs": {
32+
"email": "electreefrying.git@gmail.com",
33+
"url": "https://github.com/ElecTreeFrying/nativescript-angular-html-snippets/issues"
34+
},
35+
"license": "MIT",
36+
"engines": {
37+
"vscode": "^1.43.0"
38+
},
1239
"contributes": {
1340
"snippets": [
1441
{
1542
"language": "html",
16-
"path": "./snippets/snippet.json"
43+
"path": "./snippets/ns-components.json"
44+
},
45+
{
46+
"language": "html",
47+
"path": "./snippets/ns-layouts.json"
48+
},
49+
{
50+
"language": "html",
51+
"path": "./snippets/ns-gestures.json"
52+
},
53+
{
54+
"language": "html",
55+
"path": "./snippets/ns-settings-icon.json"
1756
}
1857
]
1958
}
20-
}
59+
}

‎reference.md

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# Snipppet Reference
2+
3+
## Layouts
4+
5+
* ns-absolute-layout
6+
* ns-absolute-layout-1
7+
* ns-absolute-layout-2
8+
* ns-absolute-layout-comp
9+
* ns-dock-layout
10+
* ns-dock-layout-snippet-1
11+
* ns-dock-layout-snippet-2
12+
* ns-dock-layout-snippet-3
13+
* ns-dock-layout-snippet-4
14+
* ns-dock-layout-comp
15+
* ns-grid-layout
16+
* ns-grid-layout-snippet-1
17+
* ns-grid-layout-snippet-2
18+
* ns-grid-layout-snippet-3
19+
* ns-grid-layout-snippet-4
20+
* ns-grid-layout-snippet-5
21+
* ns-grid-layout-snippet-6
22+
* ns-grid-layout-comp
23+
* ns-stack-layout
24+
* ns-stack-layout-snippet-1
25+
* ns-stack-layout-snippet-2
26+
* ns-stack-layout-snippet-3
27+
* ns-stack-layout-snippet-4
28+
* ns-stack-layout-comp
29+
* ns-wrap-layout
30+
* ns-wrap-layout-snippet-1
31+
* ns-wrap-layout-snippet-2
32+
* ns-wrap-layout-snippet-3
33+
* ns-wrap-layout-snippet-4
34+
* ns-wrap-layout-comp
35+
* ns-flexbox-layout
36+
* ns-flexbox-layout-snippet-1
37+
* ns-flexbox-layout-snippet-2
38+
* ns-flexbox-layout-snippet-3
39+
* ns-flexbox-layout-snippet-4
40+
* ns-flexbox-layout-snippet-5
41+
* ns-flexbox-layout-snippet-6
42+
* ns-flexbox-layout-comp
43+
44+
## Components
45+
46+
* ns-actionbar
47+
* ns-actionbar-comp
48+
* ns-actionbarextension
49+
* ns-actionitem
50+
* ns-actionitem-prop
51+
* ns-actionitem-comp
52+
* ns-navigationbutton
53+
* ns-navigationbutton-prop
54+
* ns-navigationbutton-comp
55+
* ns-activityindicator
56+
* ns-activityindicator-prop
57+
* ns-activityindicator-comp
58+
* ns-button
59+
* ns-button-prop
60+
* ns-button-comp
61+
* ns-datepicker
62+
* ns-datepicker-prop
63+
* ns-datepicker-comp
64+
* ns-formattedstring
65+
* ns-formattedstring-comp
66+
* ns-htmlview
67+
* ns-htmlview-comp
68+
* ns-image
69+
* ns-image-comp
70+
* ns-label
71+
* ns-label-prop
72+
* ns-label-comp
73+
* ns-listpicker
74+
* ns-listpicker-prop
75+
* ns-listpicker-comp
76+
* ns-listview
77+
* ns-listview-prop
78+
* ns-listview-comp
79+
* ns-progress
80+
* ns-progress-comp
81+
* ns-scroll-view
82+
* ns-scroll-view-prop
83+
* ns-scroll-view-comp
84+
* ns-search-bar
85+
* ns-search-bar-prop
86+
* ns-search-bar-comp
87+
* ns-segmented-bar
88+
* ns-segmented-bar-prop
89+
* ns-segmented-bar-comp
90+
* ns-segmented-bar-item
91+
* ns-slider
92+
* ns-slider-comp
93+
* ns-switch
94+
* ns-switch-prop
95+
* ns-switch-comp
96+
* ns-bottom-navigation
97+
* ns-bottom-navigation-prop
98+
* ns-bottom-navigation-comp
99+
* ns-tab-strip
100+
* ns-tab-strip-prop
101+
* ns-tab-strip-comp
102+
* ns-tab-strip-item
103+
* ns-tab-strip-item-prop
104+
* ns-tab-strip-item-comp
105+
* ns-tab-content-item
106+
* ns-tabs
107+
* ns-tabs-prop
108+
* ns-tabs-comp
109+
* ns-tab-view
110+
* ns-tab-view-prop
111+
* ns-tab-view-comp
112+
* ns-tab-view-item
113+
* ns-tab-view-item-comp
114+
* ns-text-field
115+
* ns-text-field-prop
116+
* ns-text-field-comp
117+
* ns-text-view
118+
* ns-text-view-prop
119+
* ns-text-view-comp
120+
* ns-time-picker
121+
* ns-time-picker-prop
122+
* ns-time-picker-comp
123+
* ns-web-view
124+
* ns-web-view-prop
125+
* ns-web-view-comp
126+
127+
## System Icons
128+
129+
| ICON | VALUE | ICON | VALUE |
130+
|---------------|-------|-------------|-------|
131+
| Done | 0 | Search | 12 |
132+
| Cancel | 1 | Refresh | 13 |
133+
| Edit | 2 | Stop | 14 |
134+
| Save | 3 | Camera | 15 |
135+
| Add | 4 | Trash | 16 |
136+
| FlexibleSpace | 5 | Play | 17 |
137+
| FixedSpace | 6 | Pause | 18 |
138+
| Compose | 7 | Rewind | 19 |
139+
| Reply | 8 | FastForward | 20 |
140+
| Action | 9 | Undo | 21 |
141+
| Organize | 10 | Redo | 22 |
142+
| Bookmarks | 11 | PageCurl | 23 |
143+
144+
Reference: https://docs.nativescript.org/angular/ui/action-bar#setting-icons

‎snippets/ns-components.json

Lines changed: 402 additions & 0 deletions
Large diffs are not rendered by default.

‎snippets/ns-gestures.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"Nativescript Gesture - Tap": {
3+
"prefix": "ns-tap",
4+
"body": "(tap)=\"\"",
5+
"description": "Action: Briefly touch the screen.\n\nSource: https://docs.nativescript.org/angular/ui/ng-components/gestures#tap"
6+
},
7+
"Nativescript Gesture - Double Tap": {
8+
"prefix": "ns-doubleTap",
9+
"body": "(doubleTap)=\"\"",
10+
"description": "Action: Two taps in a quick succession.\n\nSource: https://docs.nativescript.org/angular/ui/ng-components/gestures#double-tap"
11+
},
12+
"Nativescript Gesture - Long Press": {
13+
"prefix": "ns-longPress",
14+
"body": "(longPress)=\"\"",
15+
"description": "Action: Press your finger against the screen for a few moments.\n\nSource: https://docs.nativescript.org/angular/ui/ng-components/gestures#long-press"
16+
},
17+
"Nativescript Gesture - Swipe": {
18+
"prefix": "ns-swipe",
19+
"body": "(swipe)=\"\"",
20+
"description": "Action: Swiftly slide your finger across the screen. Swipes are quick and affect the screen even after the finger is lifted off the screen.\n\nSource: https://docs.nativescript.org/angular/ui/ng-components/gestures#swipe"
21+
},
22+
"Nativescript Gesture - Pan": {
23+
"prefix": "ns-pan",
24+
"body": "(pan)=\"\"",
25+
"description": "Action: Press your finger down and immediately start moving it around. Pans are executed more slowly and allow for more precision and the screen stops responding as soon as the finger is lifted off it.\n\nSource: https://docs.nativescript.org/angular/ui/ng-components/gestures#pan"
26+
},
27+
"Nativescript Gesture - Pinch": {
28+
"prefix": "ns-pinch",
29+
"body": "(pinch)=\"\"",
30+
"description": "Action: Touch the screen using two of your fingers, then move them towards each other or away from each other.\n\nSource: https://docs.nativescript.org/angular/ui/ng-components/gestures#pinch"
31+
},
32+
"Nativescript Gesture - Rotation": {
33+
"prefix": "ns-rotation",
34+
"body": "(rotation)=\"\"",
35+
"description": "Action: Touch the screen using two of your fingers, then rotate them simultaneously left or right.\n\nSource: https://docs.nativescript.org/angular/ui/ng-components/gestures#rotation"
36+
},
37+
"Nativescript Gesture - Touch": {
38+
"prefix": "ns-touch",
39+
"body": "(touch)=\"\"",
40+
"description": "Action: A finger action was performed.\n\nSource: https://docs.nativescript.org/angular/ui/ng-components/gestures#touch"
41+
}
42+
}

‎snippets/ns-layouts.json

Lines changed: 182 additions & 0 deletions
Large diffs are not rendered by default.

‎snippets/ns-settings-icon.json

Lines changed: 122 additions & 0 deletions
Large diffs are not rendered by default.

‎snippets/snippet.json

Whitespace-only changes.

0 commit comments

Comments
 (0)
Please sign in to comment.