@nativescript/template-blank-solid-vision 8.6.0

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.
Files changed (33) hide show
  1. package/App_Resources/visionOS/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Content.imageset/Back.png +0 -0
  2. package/App_Resources/visionOS/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Content.imageset/Contents.json +13 -0
  3. package/App_Resources/visionOS/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Contents.json +6 -0
  4. package/App_Resources/visionOS/Assets.xcassets/AppIcon.solidimagestack/Contents.json +17 -0
  5. package/App_Resources/visionOS/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Content.imageset/Contents.json +13 -0
  6. package/App_Resources/visionOS/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Content.imageset/Front.png +0 -0
  7. package/App_Resources/visionOS/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Contents.json +6 -0
  8. package/App_Resources/visionOS/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Content.imageset/Contents.json +13 -0
  9. package/App_Resources/visionOS/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Content.imageset/Middle.png +0 -0
  10. package/App_Resources/visionOS/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Contents.json +6 -0
  11. package/App_Resources/visionOS/Assets.xcassets/Contents.json +6 -0
  12. package/App_Resources/visionOS/Info.plist +45 -0
  13. package/App_Resources/visionOS/build.xcconfig +3 -0
  14. package/App_Resources/visionOS/src/NativeScriptApp.swift +9 -0
  15. package/README.md +5 -0
  16. package/hooks/after-createProject/after-createProject.js +65 -0
  17. package/package.json +66 -0
  18. package/patches/@nativescript-community+solid-js+0.0.4-alpha.5.patch +233 -0
  19. package/patches/dominative+0.0.9-alpha.4.patch +746 -0
  20. package/src/app.css +3 -0
  21. package/src/app.tsx +73 -0
  22. package/src/assets/solid.png +0 -0
  23. package/src/components/collectionview.tsx +95 -0
  24. package/src/components/list.tsx +81 -0
  25. package/src/index.js +14 -0
  26. package/src/router.ts +14 -0
  27. package/src/routes/home.tsx +23 -0
  28. package/src/routes/settings.tsx +31 -0
  29. package/tailwind.config.js +15 -0
  30. package/tools/dot.gitignore +28 -0
  31. package/tools/vscode.extensions.json +3 -0
  32. package/tsconfig.json +35 -0
  33. package/webpack.config.js +9 -0
@@ -0,0 +1,13 @@
1
+ {
2
+ "images" : [
3
+ {
4
+ "filename" : "Back.png",
5
+ "idiom" : "reality",
6
+ "scale" : "2x"
7
+ }
8
+ ],
9
+ "info" : {
10
+ "author" : "xcode",
11
+ "version" : 1
12
+ }
13
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "info" : {
3
+ "author" : "xcode",
4
+ "version" : 1
5
+ }
6
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "info" : {
3
+ "author" : "xcode",
4
+ "version" : 1
5
+ },
6
+ "layers" : [
7
+ {
8
+ "filename" : "Front.solidimagestacklayer"
9
+ },
10
+ {
11
+ "filename" : "Middle.solidimagestacklayer"
12
+ },
13
+ {
14
+ "filename" : "Back.solidimagestacklayer"
15
+ }
16
+ ]
17
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "images" : [
3
+ {
4
+ "filename" : "Front.png",
5
+ "idiom" : "reality",
6
+ "scale" : "2x"
7
+ }
8
+ ],
9
+ "info" : {
10
+ "author" : "xcode",
11
+ "version" : 1
12
+ }
13
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "info" : {
3
+ "author" : "xcode",
4
+ "version" : 1
5
+ }
6
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "images" : [
3
+ {
4
+ "filename" : "Middle.png",
5
+ "idiom" : "reality",
6
+ "scale" : "2x"
7
+ }
8
+ ],
9
+ "info" : {
10
+ "author" : "xcode",
11
+ "version" : 1
12
+ }
13
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "info" : {
3
+ "author" : "xcode",
4
+ "version" : 1
5
+ }
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "info" : {
3
+ "version" : 1,
4
+ "author" : "xcode"
5
+ }
6
+ }
@@ -0,0 +1,45 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>CFBundleDevelopmentRegion</key>
6
+ <string>en</string>
7
+ <key>CFBundleDisplayName</key>
8
+ <string>${PRODUCT_NAME}</string>
9
+ <key>CFBundleExecutable</key>
10
+ <string>${EXECUTABLE_NAME}</string>
11
+ <key>CFBundleInfoDictionaryVersion</key>
12
+ <string>6.0</string>
13
+ <key>CFBundleName</key>
14
+ <string>${PRODUCT_NAME}</string>
15
+ <key>CFBundlePackageType</key>
16
+ <string>APPL</string>
17
+ <key>CFBundleShortVersionString</key>
18
+ <string>1.0</string>
19
+ <key>CFBundleSignature</key>
20
+ <string>????</string>
21
+ <key>CFBundleVersion</key>∂
22
+ <string>1.0</string>
23
+ <key>LSRequiresIPhoneOS</key>
24
+ <true/>
25
+ <key>UIRequiresFullScreen</key>
26
+ <true/>
27
+ <key>UIRequiredDeviceCapabilities</key>
28
+ <array>
29
+ <string>armv7</string>
30
+ </array>
31
+ <key>UISupportedInterfaceOrientations</key>
32
+ <array>
33
+ <string>UIInterfaceOrientationPortrait</string>
34
+ <string>UIInterfaceOrientationLandscapeLeft</string>
35
+ <string>UIInterfaceOrientationLandscapeRight</string>
36
+ </array>
37
+ <key>UISupportedInterfaceOrientations~ipad</key>
38
+ <array>
39
+ <string>UIInterfaceOrientationPortrait</string>
40
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
41
+ <string>UIInterfaceOrientationLandscapeLeft</string>
42
+ <string>UIInterfaceOrientationLandscapeRight</string>
43
+ </array>
44
+ </dict>
45
+ </plist>
@@ -0,0 +1,3 @@
1
+ // DEVELOPMENT_TEAM = YOUR_TEAM_ID;
2
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
3
+ IPHONEOS_DEPLOYMENT_TARGET = 17.0;
@@ -0,0 +1,9 @@
1
+ import SwiftUI
2
+
3
+ @main
4
+ struct NativeScriptApp: App {
5
+
6
+ var body: some Scene {
7
+ NativeScriptMainWindow()
8
+ }
9
+ }
package/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # NativeScript with Vue for visionOS
2
+
3
+ ```
4
+ ns run visionos --no-hmr
5
+ ```
@@ -0,0 +1,65 @@
1
+ const fs = require('fs')
2
+ const path = require('path')
3
+ const { execSync } = require('child_process')
4
+
5
+ module.exports = function (hookArgs) {
6
+ const appRootFolder = hookArgs.projectDir
7
+ const toolsDir = path.join(appRootFolder, 'tools')
8
+ const vscodeDir = path.join(appRootFolder, '.vscode')
9
+ const srcGitignore = path.join(toolsDir, 'dot.gitignore')
10
+ const destGitignore = path.join(appRootFolder, '.gitignore')
11
+ const srcVscodeExtensions = path.join(toolsDir, 'vscode.extensions.json')
12
+ const destVscodeExtensions = path.join(vscodeDir, 'extensions.json')
13
+
14
+ try {
15
+ fs.mkdirSync(vscodeDir)
16
+ fs.copyFileSync(srcVscodeExtensions, destVscodeExtensions)
17
+ fs.copyFileSync(srcGitignore, destGitignore)
18
+ initWebpackConfig(appRootFolder)
19
+ } catch (error) {
20
+ console.log(error)
21
+ }
22
+ try {
23
+ deleteFolderSync(toolsDir)
24
+
25
+ const readme = path.join(appRootFolder, 'README.md')
26
+ fs.unlinkSync(readme)
27
+
28
+ deleteFolderSync(__dirname)
29
+ } catch (error) {
30
+ console.log(error)
31
+ }
32
+
33
+ function deleteFolderSync(folderPath) {
34
+ if (fs.statSync(folderPath).isDirectory()) {
35
+ fs.readdirSync(folderPath).forEach((file) => {
36
+ const content = path.join(folderPath, file)
37
+ const contentDirs = fs.statSync(content).isDirectory()
38
+
39
+ if (contentDirs) {
40
+ deleteFolderSync(content)
41
+ } else {
42
+ fs.unlinkSync(content)
43
+ }
44
+ })
45
+
46
+ fs.rmdirSync(folderPath)
47
+ }
48
+ }
49
+
50
+ function initWebpackConfig(appRootFolder) {
51
+ const binPath = path.resolve(
52
+ require
53
+ .resolve('@nativescript/webpack/package.json', {
54
+ paths: [appRootFolder],
55
+ })
56
+ .replace('package.json', 'dist/bin/index.js')
57
+ )
58
+
59
+ // init webpack config
60
+ execSync(`node "${binPath}" init`, {
61
+ cwd: appRootFolder,
62
+ stdio: 'inherit',
63
+ })
64
+ }
65
+ }
package/package.json ADDED
@@ -0,0 +1,66 @@
1
+ {
2
+ "name": "@nativescript/template-blank-solid-vision",
3
+ "main": "src/index.js",
4
+ "version": "8.6.0",
5
+ "description": "Nativescript visionOS Starter with Solid",
6
+ "author": "NativeScript Team <oss@nativescript.org>",
7
+ "license": "Apache-2.0",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/NativeScript/nativescript-app-templates"
11
+ },
12
+ "homepage": "https://github.com/NativeScript/nativescript-app-templates",
13
+ "bugs": {
14
+ "url": "https://github.com/NativeScript/NativeScript/issues"
15
+ },
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "files": [
20
+ "src",
21
+ "App_Resources",
22
+ "hooks",
23
+ "tools",
24
+ "!tools/assets",
25
+ "patches",
26
+ "types",
27
+ ".editorconfig",
28
+ "tailwind.config.js",
29
+ "tsconfig.json",
30
+ "webpack.config.js"
31
+ ],
32
+ "keywords": [
33
+ "nstudio",
34
+ "nativescript",
35
+ "mobile",
36
+ "{N}",
37
+ "vue",
38
+ "visionOS",
39
+ "Vision Pro"
40
+ ],
41
+ "dependencies": {
42
+ "@nativescript-community/solid-js": "^0.0.4-alpha.5",
43
+ "@nativescript-community/ui-collectionview": "^5.2.0",
44
+ "@nativescript/core": "vision",
45
+ "dominative": "^0.0.9-alpha.4",
46
+ "solid-js": "^1.7.12",
47
+ "solid-navigation": "^1.0.0-alpha.8",
48
+ "undom-ng": "^1.0.10"
49
+ },
50
+ "devDependencies": {
51
+ "@babel/core": "^7.22.10",
52
+ "@babel/preset-env": "^7.20.2",
53
+ "@babel/preset-typescript": "^7.22.5",
54
+ "@nativescript-dom/core-types": "^1.0.29",
55
+ "@nativescript-dom/solidjs-types": "^1.0.15",
56
+ "@nativescript/tailwind": "^2.0.1",
57
+ "@nativescript/webpack": "vision",
58
+ "babel": "^6.23.0",
59
+ "babel-loader": "^9.1.3",
60
+ "babel-preset-solid": "^1.7.12",
61
+ "patch-package": "^8.0.0",
62
+ "solid-refresh": "^0.5.3",
63
+ "tailwindcss": "~3.2.0",
64
+ "typescript": "~5.1.6"
65
+ }
66
+ }
@@ -0,0 +1,233 @@
1
+ diff --git a/node_modules/@nativescript-community/solid-js/index.d.ts b/node_modules/@nativescript-community/solid-js/index.d.ts
2
+ deleted file mode 100644
3
+ index e9d469b..0000000
4
+ --- a/node_modules/@nativescript-community/solid-js/index.d.ts
5
+ +++ /dev/null
6
+ @@ -1,227 +0,0 @@
7
+ -import { Style, ViewBase } from "@nativescript/core";
8
+ -import {
9
+ - Document,
10
+ - DOMEvent,
11
+ - HTMLElementTagNameMap,
12
+ - Node,
13
+ - NSComponentsMap,
14
+ - NSCustomComponentsMap,
15
+ - PseudoElementsMap,
16
+ -} from "dominative";
17
+ -import { JSX as SolidJSX } from "solid-js";
18
+ -
19
+ -/**
20
+ - * This is the app entry point. Provide a top-level component function and
21
+ - * an element to mount to. It is recommended this element be empty: while render
22
+ - * will just append children, the returned dispose function will remove all children.
23
+ - * For example:
24
+ - ```tsx
25
+ - import { render } from "@nativescript-community/solid-js";
26
+ - import { document } from "dominative";
27
+ - render(() => <App />, document.body);
28
+ - ```
29
+ - * The root node can be any NativeScript node. By default `document.body` is a `Frame` element. However
30
+ - * you can do something like below to render something different as root element.
31
+ - ```tsx
32
+ - document.body.appendChild(document.createElement("ContentView"));
33
+ - render(() => <App />, document.body.firstElementChild);
34
+ - ```
35
+ - * Read more about the render function here:
36
+ - * @link https://www.solidjs.com/docs/latest#render
37
+ - */
38
+ -export function render(app: () => JSX.Element, root: Node): void;
39
+ -
40
+ -export type Filter<
41
+ - Set,
42
+ - Needle extends string
43
+ -> = Set extends `${Needle}${infer _X}` ? never : Set;
44
+ -
45
+ -export type MapNativeViewEvents<T, C> = {
46
+ - [K in T as `on:${K}`]: (event: DOMEvent<C>) => void;
47
+ -};
48
+ -
49
+ -export type MapPseudoElementEvents<T> = {
50
+ - [K in T as `on:${K}`]: (event: {
51
+ - view?: ViewBase;
52
+ - index?: number;
53
+ - item?: any;
54
+ - data?: any;
55
+ - }) => void;
56
+ -};
57
+ -
58
+ -type NSComponentEventsMap = {
59
+ - [K in keyof NSComponentsMap]: MapNativeViewEvents<
60
+ - HTMLElementTagNameMap[K]["eventNames"],
61
+ - HTMLElementTagNameMap[K]
62
+ - >;
63
+ -} & {
64
+ - [K in keyof NSCustomComponentsMap]: MapNativeViewEvents<
65
+ - NSCustomComponentsMap[K]["eventNames"],
66
+ - NSCustomComponentsMap[K]
67
+ - >;
68
+ -} & {
69
+ - ItemTemplate: MapPseudoElementEvents<"createView" | "itemLoading">;
70
+ -} & {
71
+ - [K in keyof Omit<PseudoElementsMap, "ItemTemplate">]: {};
72
+ -};
73
+ -
74
+ -export type IgnoredKeys =
75
+ - | "cssType"
76
+ - | "requestLayout"
77
+ - | "layoutNativeView"
78
+ - | "goBack"
79
+ - | "replacePage"
80
+ - | "firstElementChild"
81
+ - | "lastElementChild"
82
+ - | "children"
83
+ - | "childNodes"
84
+ - | "append"
85
+ - | "insertBefore"
86
+ - | "replaceChild"
87
+ - | "appendChild"
88
+ - | "textContent"
89
+ - | "removeChild"
90
+ - | "childElementCount"
91
+ - | "innerHTML"
92
+ - | "outerHTML"
93
+ - | "insertBefore"
94
+ - | "setAttribute"
95
+ - | "getAttribute"
96
+ - | "removeAttribute"
97
+ - | "removeAttributeNS"
98
+ - | "setAttributeNS"
99
+ - | "namespaceURI"
100
+ - | "dispatchEvent"
101
+ - | "getAttributeNS"
102
+ - | "localName"
103
+ - | "nodeName"
104
+ - | "tagName"
105
+ - | "attributes"
106
+ - | "hasChildNodes"
107
+ - | "firstChild"
108
+ - | "lastChild"
109
+ - | "replaceWith"
110
+ - | "cloneNode"
111
+ - | "remove"
112
+ - | "parentNode"
113
+ - | "height"
114
+ - | "width"
115
+ - | "appendData";
116
+ -
117
+ -export type PickedNSComponentKeys<T> = Omit<
118
+ - T,
119
+ - Filter<
120
+ - keyof T,
121
+ - | "_"
122
+ - | "set"
123
+ - | "get"
124
+ - | "has"
125
+ - | "change"
126
+ - | "each"
127
+ - | "can"
128
+ - | "create"
129
+ - | "send"
130
+ - | "perform"
131
+ - | "go"
132
+ - | "on"
133
+ - >
134
+ ->;
135
+ -type OverrideProperties = {
136
+ - style: Partial<
137
+ - | Style
138
+ - | {
139
+ - color: string;
140
+ - width: number | string;
141
+ - height: number | string;
142
+ - backgroundColor: string;
143
+ - borderTopColor: string;
144
+ - borderRightColor: string;
145
+ - borderBottomColor: string;
146
+ - borderLeftColor: string;
147
+ - boxShadow: string;
148
+ - textShadow: string;
149
+ - }
150
+ - >;
151
+ - height: string | number;
152
+ - width: string | number;
153
+ - class: string;
154
+ -};
155
+ -
156
+ -export type DefineNSComponent<T, E> = Partial<
157
+ - Omit<
158
+ - T,
159
+ - IgnoredKeys | keyof OverrideProperties | keyof PickedNSComponentKeys<T>
160
+ - > &
161
+ - E
162
+ ->;
163
+ -
164
+ -declare global {
165
+ - var document: Document;
166
+ -}
167
+ -
168
+ -declare global {
169
+ - namespace JSX {
170
+ - function mapElementTag<K extends keyof NSDefaultComponents>(
171
+ - tag: K
172
+ - ): NSDefaultComponents[K];
173
+ -
174
+ - function createElement<
175
+ - Element extends NSDefaultComponents,
176
+ - Key extends keyof NSDefaultComponents
177
+ - >(element: Key | undefined | null, attrs: Element[Key]): Element[Key];
178
+ -
179
+ - function createElement<
180
+ - Element extends NSDefaultComponents,
181
+ - Key extends keyof NSDefaultComponents,
182
+ - T
183
+ - >(
184
+ - element: Key | undefined | null,
185
+ - attrsEnhancers: T,
186
+ - attrs: Element[Key] & T
187
+ - ): Element[Key];
188
+ -
189
+ - type Element = SolidJSX.Element;
190
+ - interface ArrayElement extends Array<Element> {}
191
+ - interface FunctionElement {
192
+ - (): Element;
193
+ - }
194
+ - interface ElementClass {
195
+ - // empty, libs can define requirements downstream
196
+ - }
197
+ - interface ElementAttributesProperty {
198
+ - // empty, libs can define requirements downstream
199
+ - }
200
+ - interface ElementChildrenAttribute {
201
+ - children: {};
202
+ - }
203
+ -
204
+ - interface IntrinsicAttributes {
205
+ - ref?: unknown | ((e: unknown) => void);
206
+ - }
207
+ -
208
+ - type Accessor<T> = () => T;
209
+ - interface Directives {}
210
+ - interface DirectiveFunctions {
211
+ - [x: string]: (el: Element, accessor: Accessor<any>) => void;
212
+ - }
213
+ - interface ExplicitProperties {}
214
+ - interface ExplicitAttributes {}
215
+ - interface CustomEvents {}
216
+ - interface CustomCaptureEvents {}
217
+ -
218
+ - type JSXElementAttributes<K> = SolidJSX.CustomAttributes<
219
+ - NSComponentsMap[K]
220
+ - > &
221
+ - Partial<
222
+ - DefineNSComponent<HTMLElementTagNameMap[K], NSComponentEventsMap[K]> &
223
+ - OverrideProperties & {
224
+ - children: Element;
225
+ - }
226
+ - >;
227
+ -
228
+ - type NSDefaultComponents = {
229
+ - [K in keyof HTMLElementTagNameMap as `${Lowercase<K>}`]: JSXElementAttributes<K>;
230
+ - };
231
+ - interface IntrinsicElements extends NSDefaultComponents {}
232
+ - }
233
+ -}