@ng-native/template 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +4 -2
- package/app.json +2 -1
- package/package.json +9 -8
- package/src/app/app.ts +13 -11
package/AGENTS.md
CHANGED
|
@@ -8,7 +8,7 @@ The whole documentation, for reading before a change: https://ng-native.com/llms
|
|
|
8
8
|
outline with a line per page: https://ng-native.com/llms.txt.
|
|
9
9
|
|
|
10
10
|
Angular's own rules apply as well: https://angular.dev/assets/context/best-practices.md. Its
|
|
11
|
-
browser-only parts do not: there is no `NgOptimizedImage` (use `<image>`), and no AXE
|
|
11
|
+
browser-only parts do not: there is no `NgOptimizedImage` (use `<image>`), and no AXE
|
|
12
12
|
(accessibility is the props below). Where the two disagree, this file wins.
|
|
13
13
|
|
|
14
14
|
## Commands
|
|
@@ -41,7 +41,9 @@ change; both are fast.
|
|
|
41
41
|
- **No backticks inside an inline template**, even in an HTML comment: they end the template string
|
|
42
42
|
and the build fails with a misleading parse error.
|
|
43
43
|
- **Accessibility is props:** `accessibilityRole="button"`, `accessibilityLabel`,
|
|
44
|
-
`[accessibilityState]`.
|
|
44
|
+
`[accessibilityState]`. The web spellings work too, as aliases: `role`, and the `aria-*` names
|
|
45
|
+
React Native maps (`aria-label`, `aria-checked`, `aria-hidden` and so on). Screen readers and
|
|
46
|
+
the testing library's `getByRole` both read them.
|
|
45
47
|
|
|
46
48
|
## Styling
|
|
47
49
|
|
package/app.json
CHANGED
package/package.json
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-native/template",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "An Angular app rendering real native views. Use with create-expo-app --template.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "src/main.ts",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@angular/common": "^22.0.0",
|
|
9
9
|
"@angular/core": "^22.0.0",
|
|
10
|
-
"expo": "~57.0.
|
|
10
|
+
"expo": "~57.0.26",
|
|
11
11
|
"expo-status-bar": "~57.0.1",
|
|
12
|
+
"expo-system-ui": "~57.0.4",
|
|
12
13
|
"react": "19.2.3",
|
|
13
14
|
"react-native": "0.86.3",
|
|
14
15
|
"react-native-safe-area-context": "~5.7.0",
|
|
15
|
-
"@ng-native/components": "0.1.
|
|
16
|
-
"@ng-native/
|
|
17
|
-
"@ng-native/fabric": "0.1.
|
|
18
|
-
"@ng-native/
|
|
19
|
-
"@ng-native/
|
|
16
|
+
"@ng-native/components": "0.1.3",
|
|
17
|
+
"@ng-native/device": "0.1.3",
|
|
18
|
+
"@ng-native/fabric": "0.1.3",
|
|
19
|
+
"@ng-native/metro": "0.1.3",
|
|
20
|
+
"@ng-native/platform": "0.1.3"
|
|
20
21
|
},
|
|
21
22
|
"devDependencies": {
|
|
22
23
|
"@angular/compiler-cli": "^22.0.0",
|
|
@@ -24,7 +25,7 @@
|
|
|
24
25
|
"@types/react": "~19.2.2",
|
|
25
26
|
"typescript": "~6.0.3",
|
|
26
27
|
"vitest": "^5.0.0",
|
|
27
|
-
"@ng-native/testing": "0.1.
|
|
28
|
+
"@ng-native/testing": "0.1.3"
|
|
28
29
|
},
|
|
29
30
|
"repository": {
|
|
30
31
|
"type": "git",
|
package/src/app/app.ts
CHANGED
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
import { Component, signal } from '@angular/core';
|
|
2
|
-
import { Pressable, SafeAreaView, Text, View } from '@ng-native/components';
|
|
2
|
+
import { Pressable, SafeAreaProvider, SafeAreaView, Text, View } from '@ng-native/components';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Element names are lowercase, and that is load-bearing rather than style: an uppercase name is
|
|
6
6
|
* read as an unknown Angular component and commits as a plain view with nothing in it.
|
|
7
7
|
*/
|
|
8
8
|
@Component({
|
|
9
|
-
imports: [Pressable, SafeAreaView, Text, View],
|
|
9
|
+
imports: [Pressable, SafeAreaProvider, SafeAreaView, Text, View],
|
|
10
10
|
selector: 'app-root',
|
|
11
11
|
template: `
|
|
12
|
-
<safe-area-
|
|
13
|
-
<view class="
|
|
14
|
-
<
|
|
15
|
-
|
|
12
|
+
<safe-area-provider>
|
|
13
|
+
<safe-area-view class="screen">
|
|
14
|
+
<view class="body">
|
|
15
|
+
<text class="title">Angular, natively</text>
|
|
16
|
+
<text class="hint">Real native views. React is never in the render path.</text>
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
<pressable accessibilityRole="button" class="button" (press)="count.set(count() + 1)">
|
|
19
|
+
<text class="label">Tapped {{ count() }} times</text>
|
|
20
|
+
</pressable>
|
|
21
|
+
</view>
|
|
22
|
+
</safe-area-view>
|
|
23
|
+
</safe-area-provider>
|
|
22
24
|
`,
|
|
23
25
|
styles: `
|
|
24
26
|
:host {
|