Skip to content

Commit 91cf7fa

Browse files
authored
feat: flavor snippets (#151)
2 parents f10c794 + ed3a1bc commit 91cf7fa

File tree

295 files changed

+47582
-1011
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

295 files changed

+47582
-1011
lines changed

.vitepress/theme/cliLanguage.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// https://mysticmind.dev/vitepress-fenced-code-block-syntax-highlighting-quirks-with-net-or-other-languages
2-
import { BUNDLED_LANGUAGES } from "shiki";
3-
import cliLanguageGrammar from "./shiki/cli.tmLanguage.json";
2+
import { bundledLanguages } from 'shiki'
3+
import cliLanguageGrammar from './shiki/cli.tmLanguage.json'
44

5-
BUNDLED_LANGUAGES.push({
6-
id: "cli",
7-
scopeName: "source.cli",
8-
// @ts-ignore
5+
bundledLanguages['cli'] = {
6+
id: 'cli',
7+
scopeName: 'source.cli',
98
grammar: cliLanguageGrammar,
10-
});
9+
}
10+
// bundledLanguages.push()

content/dev-reference.md

Lines changed: 104 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,18 +100,116 @@ For example:
100100
![some image](../assets/images/setup/windows/<some_image>.png)
101101
```
102102

103-
<!-- <Tabs>
104-
<Tab name="Vue">
103+
## Tabs
105104

106-
SOMETHING SOMETHING
105+
:::warning
107106

108-
```ts
109-
asd
107+
In order to render Markdown inside a tab, you **must** have one line break above and below the markdown content.
108+
109+
For example:
110+
111+
```xml
112+
<Tab>
113+
# Test
114+
</Tab>
110115
```
111116

117+
Will render `# Test` literally, while
118+
119+
```xml
120+
<Tab>
121+
122+
# Test
123+
112124
</Tab>
125+
```
126+
127+
Will render a `h1` Test title.
128+
129+
:::
130+
131+
<Tabs>
132+
<Tab title="Simple Tab">
133+
This is the most basic tab there is. Pure html content or whatever.
134+
</Tab>
135+
136+
<Tab title="With Code Block">
137+
138+
```ts
139+
console.log('Hello World!')
140+
```
141+
142+
</Tab>
143+
144+
<Tab title="With External Code Block">
145+
146+
<<< @/../examples/typescript/src/ui/ActionBar/page.xml#example
147+
148+
</Tab>
149+
150+
<Tab title="With Two Ext-Code Blocks">
151+
152+
<<< @/../examples/typescript/src/ui/ActionBar/page.xml#example
153+
154+
And another one:
155+
156+
<<< @/../examples/typescript/src/ui/ActionBar/page.xml#example
113157

114-
</Tabs> -->
158+
</Tab>
159+
</Tabs>
160+
161+
### Flavor Tabs
162+
163+
<Tabs>
164+
<Tab flavor="vue">
165+
This is the vue tab
166+
</Tab>
167+
<Tab flavor="typescript">
168+
This is the typescript tab
169+
</Tab>
170+
<Tab flavor="javascript">
171+
This is the javascript tab
172+
</Tab>
173+
<Tab flavor="angular">
174+
This is the angular tab
175+
</Tab>
176+
<Tab flavor="svelte">
177+
This is the svelte tab
178+
</Tab>
179+
<Tab flavor="react">
180+
This is the react tab
181+
</Tab>
182+
<Tab flavor="solid">
183+
This is the solid tab
184+
</Tab>
185+
186+
</Tabs>
187+
188+
All Flavor tabs will be synchronized and ordered consistently:
189+
190+
<Tabs>
191+
<Tab flavor="typescript">
192+
This is the typescript tab
193+
</Tab>
194+
<Tab flavor="javascript">
195+
This is the javascript tab
196+
</Tab>
197+
<Tab flavor="angular">
198+
This is the angular tab
199+
</Tab>
200+
<Tab flavor="svelte">
201+
This is the svelte tab
202+
</Tab>
203+
<Tab flavor="react">
204+
This is the react tab
205+
</Tab>
206+
<Tab flavor="vue">
207+
This is the vue tab
208+
</Tab>
209+
<Tab flavor="solid">
210+
This is the solid tab
211+
</Tab>
212+
</Tabs>
115213

116214
## StepList
117215

content/ui/action-bar.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ Views also part of the ActionBar abstraction:
2020
<img src="../assets/images/screenshots/android/ActionBar.png"/>
2121
</DeviceFrame>
2222

23-
<<< @/../examples/src/ui/ActionBar/page.xml#example
23+
<<< @/../examples/typescript/src/ui/ActionBar/page.xml#example
24+
<<< @/../examples/angular/src/ui/ActionBar/component.html#example
25+
<<< @/../examples/react/src/components/ui/actionbar.tsx#example
26+
<<< @/../examples/solid/src/ui/actionbar.tsx#example
27+
<<< @/../examples/svelte/app/components/ui/ActionBar.svelte#example
28+
<<< @/../examples/vue/src/ui/Actionbar/component.vue#example
2429

2530
## Examples
2631

content/ui/activity-indicator.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,43 @@ contributors:
1515
<img src="../assets/images/screenshots/android/ActivityIndicator.png"/>
1616
</DeviceFrame>
1717

18-
<<< @/../examples/src/ui/ActivityIndicator/template.xml#example
18+
<Tabs>
19+
<Tab flavor="vue">
20+
21+
<<< @/../examples/vue/src/ui/ActivityIndicator/component.vue#example
22+
23+
</Tab>
24+
<Tab flavor="typescript">
25+
26+
<<< @/../examples/typescript/src/ui/ActivityIndicator/template.xml#example
27+
28+
</Tab>
29+
<Tab flavor="javascript">
30+
31+
<<< @/../examples/typescript/src/ui/ActivityIndicator/template.xml#example
32+
33+
</Tab>
34+
<Tab flavor="angular">
35+
36+
<<< @/../examples/angular/src/ui/ActivityIndicator/component.html#example
37+
38+
</Tab>
39+
<Tab flavor="svelte">
40+
41+
<<< @/../examples/svelte/app/components/ui/ActivityIndicator.svelte#example
42+
43+
</Tab>
44+
<Tab flavor="react">
45+
46+
<<< @/../examples/react/src/components/ui/activityindicator.tsx#example
47+
48+
</Tab>
49+
<Tab flavor="solid">
50+
51+
<<< @/../examples/solid/src/ui/activityindicator.tsx#example
52+
53+
</Tab>
54+
</Tabs>
1955

2056
## Examples
2157

content/ui/button.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ For more information about the available gestures, see [Gestures](/guide/gesture
1717
<img src="../assets/images/screenshots/android/Button.png"/>
1818
</DeviceFrame>
1919

20-
<<< @/../examples/src/ui/Button/template.xml#example
20+
<<< @/../examples/typescript/src/ui/Button/template.xml#example
21+
<<< @/../examples/angular/src/ui/Button/component.html#example
22+
<<< @/../examples/react/src/components/ui/button.tsx#example
23+
<<< @/../examples/solid/src/ui/button.tsx#example
24+
<<< @/../examples/svelte/app/components/ui/Button.svelte#example
25+
<<< @/../examples/vue/src/ui/Button/component.vue#example
2126

2227
## Examples
2328

content/ui/date-picker.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ See also: [TimePicker](/ui/time-picker).
1717
<img src="../assets/images/screenshots/android/DatePicker.png"/>
1818
</DeviceFrame>
1919

20-
<<< @/../examples/src/ui/DatePicker/template.xml#example
20+
<<< @/../examples/typescript/src/ui/DatePicker/template.xml#example
21+
<<< @/../examples/angular/src/ui/DatePicker/component.html#example
22+
<<< @/../examples/react/src/components/ui/datepicker.tsx#example
23+
<<< @/../examples/solid/src/ui/datepicker.tsx#example
24+
<<< @/../examples/svelte/app/components/ui/DatePicker.svelte#example
25+
<<< @/../examples/vue/src/ui/DatePicker/component.vue#example
2126

2227
```xml
2328
<DatePicker

content/ui/dialogs.md

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ See [DialogOptions](/api/interface/DialogOptions), [R.style](https://developer.a
4545
<img src="../assets/images/screenshots/android/Dialogs-Alert.png"/>
4646
</DeviceFrame>
4747

48-
<<< @/../examples/src/ui/Dialogs/template.ts#example-alert
48+
<<< @/../examples/typescript/src/ui/Dialogs/template.ts#example-alert
49+
<<< @/../examples/angular/src/ui/Dialogs/component.html#example-alert
50+
<<< @/../examples/react/src/components/ui/dialogs.tsx#example-alert
51+
<<< @/../examples/solid/src/ui/dialogs.tsx#example-alert
52+
<<< @/../examples/svelte/app/components/ui/Dialogs.svelte#example-alert
53+
<<< @/../examples/vue/src/ui/Dialogs/component.vue#example-alert
4954

5055
A dialog for alerting the user.
5156

@@ -60,7 +65,12 @@ See [alert()](/api/#alert).
6065
<img src="../assets/images/screenshots/android/Dialogs-Action.png"/>
6166
</DeviceFrame>
6267

63-
<<< @/../examples/src/ui/Dialogs/template.ts#example-action
68+
<<< @/../examples/typescript/src/ui/Dialogs/template.ts#example-action
69+
<<< @/../examples/angular/src/ui/Dialogs/component.html#example-action
70+
<<< @/../examples/react/src/components/ui/dialogs.tsx#example-action
71+
<<< @/../examples/solid/src/ui/dialogs.tsx#example-action
72+
<<< @/../examples/svelte/app/components/ui/Dialogs.svelte#example-action
73+
<<< @/../examples/vue/src/ui/Dialogs/component.vue#example-action
6474

6575
A dialog for prompting the user to choose.
6676

@@ -77,7 +87,12 @@ See [action()](/api/#action).
7787
<img src="../assets/images/screenshots/android/Dialogs-Confirm.png"/>
7888
</DeviceFrame>
7989

80-
<<< @/../examples/src/ui/Dialogs/template.ts#example-confirm
90+
<<< @/../examples/typescript/src/ui/Dialogs/template.ts#example-confirm
91+
<<< @/../examples/angular/src/ui/Dialogs/component.html#example-confirm
92+
<<< @/../examples/react/src/components/ui/dialogs.tsx#example-confirm
93+
<<< @/../examples/solid/src/ui/dialogs.tsx#example-confirm
94+
<<< @/../examples/svelte/app/components/ui/Dialogs.svelte#example-confirm
95+
<<< @/../examples/vue/src/ui/Dialogs/component.vue#example-confirm
8196

8297
A dialog for prompting the user to confirm.
8398

@@ -92,7 +107,12 @@ See [confirm()](/api/#confirm).
92107
<img src="../assets/images/screenshots/android/Dialogs-Prompt.png"/>
93108
</DeviceFrame>
94109

95-
<<< @/../examples/src/ui/Dialogs/template.ts#example-prompt
110+
<<< @/../examples/typescript/src/ui/Dialogs/template.ts#example-prompt
111+
<<< @/../examples/angular/src/ui/Dialogs/component.html#example-prompt
112+
<<< @/../examples/react/src/components/ui/dialogs.tsx#example-prompt
113+
<<< @/../examples/solid/src/ui/dialogs.tsx#example-prompt
114+
<<< @/../examples/svelte/app/components/ui/Dialogs.svelte#example-prompt
115+
<<< @/../examples/vue/src/ui/Dialogs/component.vue#example-prompt
96116

97117
A dialog for prompting the user for input.
98118

@@ -111,7 +131,12 @@ See [prompt()](/api/#prompt), [CoreTypes.AutocapitalizationType](/api/namespace/
111131
<img src="../assets/images/screenshots/android/Dialogs-Login.png"/>
112132
</DeviceFrame>
113133

114-
<<< @/../examples/src/ui/Dialogs/template.ts#example-login
134+
<<< @/../examples/typescript/src/ui/Dialogs/template.ts#example-login
135+
<<< @/../examples/angular/src/ui/Dialogs/component.html#example-login
136+
<<< @/../examples/react/src/components/ui/dialogs.tsx#example-login
137+
<<< @/../examples/solid/src/ui/dialogs.tsx#example-login
138+
<<< @/../examples/svelte/app/components/ui/Dialogs.svelte#example-login
139+
<<< @/../examples/vue/src/ui/Dialogs/component.vue#example-login
115140

116141
A dialog for prompting the user for credentials.
117142

content/ui/html-view.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,15 @@ See also: [WebView](/ui/web-view).
2222
<img src="../assets/images/screenshots/android/HtmlView.png"/>
2323
</DeviceFrame>
2424

25-
<<< @/../examples/src/ui/HtmlView/template.xml#example
26-
<<< @/../examples/src/ui/HtmlView/template.ts#example{xml}
25+
<<< @/../examples/typescript/src/ui/HtmlView/template.xml#example
26+
<<< @/../examples/typescript/src/ui/HtmlView/template.ts#example{xml}
27+
28+
<<< @/../examples/angular/src/ui/HtmlView/component.html#example
29+
<<< @/../examples/angular/src/ui/HtmlView/component.ts#example{html}
30+
<<< @/../examples/react/src/components/ui/htmlview.tsx#example
31+
<<< @/../examples/solid/src/ui/htmlview.tsx#example
32+
<<< @/../examples/svelte/app/components/ui/HtmlView.svelte#example
33+
<<< @/../examples/vue/src/ui/HtmlView/component.vue#example
2734

2835
## Props
2936

content/ui/image.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ When working with images, consider following [the best practices](/performance.h
1616

1717
Working with many images can quickly become a memory hog, for improved image handling it's recommended to use an Image caching library. Here are a few plugins from our community:
1818

19-
- [@triniwiz/image-cache-it](https://triniwiz.github.io/nativescript-plugins/api-reference/image-cache-it.html)
19+
- [@triniwiz/nativescript-image-cache-it](https://triniwiz.github.io/nativescript-plugins/api-reference/image-cache-it.html)
2020
- [@nativescript-community/ui-image](https://github.com/nativescript-community/ui-image)
2121

2222
:::
@@ -28,7 +28,7 @@ Working with many images can quickly become a memory hog, for improved image han
2828
<img src="../assets/images/screenshots/android/Image.png"/>
2929
</DeviceFrame>
3030

31-
<<< @/../examples/src/ui/Image/template.xml#example
31+
<<< @/../examples/typescript/src/ui/Image/template.xml#example
3232

3333
## Examples
3434

content/ui/label.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ The NativeScript `<Label>` is not the same as the HTML `<Label>`.
2121
<img src="../assets/images/screenshots/android/Label.png"/>
2222
</DeviceFrame>
2323

24-
<<< @/../examples/src/ui/Label/template.xml#example
24+
<<< @/../examples/typescript/src/ui/Label/template.xml#example
25+
26+
<<< @/../examples/angular/src/ui/Label/component.html#example
27+
<<< @/../examples/react/src/components/ui/label.tsx#example
28+
<<< @/../examples/solid/src/ui/label.tsx#example
29+
<<< @/../examples/svelte/app/components/ui/Label.svelte#example
30+
<<< @/../examples/vue/src/ui/Label/component.vue#example
2531

2632
## Examples
2733

0 commit comments

Comments
 (0)