Skip to content

Commit 7192ac9

Browse files
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": "[email protected]"
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": "[email protected]",
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+
}

0 commit comments

Comments
 (0)