@geastack/apple 0.2.8
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/LICENSE +202 -0
- package/README.md +54 -0
- package/dist/index.d.ts +127 -0
- package/dist/index.js +3076 -0
- package/generated/AVFoundation.d.ts +112 -0
- package/generated/ActivityKit.d.ts +7 -0
- package/generated/AppKit.d.ts +268 -0
- package/generated/CoreGraphics.d.ts +18 -0
- package/generated/CoreLocation.d.ts +28 -0
- package/generated/CoreMedia.d.ts +8 -0
- package/generated/Dispatch.d.ts +2 -0
- package/generated/Foundation.d.ts +13 -0
- package/generated/MapKit.d.ts +28 -0
- package/generated/Metal.d.ts +91 -0
- package/generated/MetalKit.d.ts +22 -0
- package/generated/Photos.d.ts +5 -0
- package/generated/QuartzCore.d.ts +12 -0
- package/generated/SwiftData.d.ts +11 -0
- package/generated/UIKit.d.ts +187 -0
- package/package.json +123 -0
- package/runtime/AVFoundation.js +136 -0
- package/runtime/ActivityKit.js +18 -0
- package/runtime/AppKit.js +313 -0
- package/runtime/CoreGraphics.js +15 -0
- package/runtime/CoreLocation.js +30 -0
- package/runtime/CoreMedia.js +7 -0
- package/runtime/Dispatch.js +11 -0
- package/runtime/Foundation.js +21 -0
- package/runtime/MapKit.js +22 -0
- package/runtime/Metal.js +126 -0
- package/runtime/MetalKit.js +15 -0
- package/runtime/Photos.js +9 -0
- package/runtime/QuartzCore.js +9 -0
- package/runtime/SwiftData.js +29 -0
- package/runtime/UIKit.js +242 -0
- package/runtime/empty.js +1 -0
- package/targets/ios/Info.plist.in +25 -0
- package/targets/ios/README.md +46 -0
- package/targets/ios/build-ios.sh +395 -0
- package/targets/ios/detect-development-team.mjs +109 -0
- package/targets/ios/generate-resident-entry.mjs +67 -0
- package/targets/ios/generate-resident-registry.mjs +162 -0
- package/targets/ios/generate-xcode-project.mjs +520 -0
- package/targets/ios/main/canvas_view.h +7 -0
- package/targets/ios/main/canvas_view.mm +94 -0
- package/targets/ios/main/font_registry.h +17 -0
- package/targets/ios/main/font_registry.mm +129 -0
- package/targets/ios/main/image_bridge.h +13 -0
- package/targets/ios/main/image_bridge.mm +53 -0
- package/targets/ios/main/ios_apps.c +28 -0
- package/targets/ios/main/ios_camera.mm +446 -0
- package/targets/ios/main/ios_display.mm +344 -0
- package/targets/ios/main/ios_main.mm +811 -0
- package/targets/ios/main/ios_memory.cpp +55 -0
- package/targets/ios/main/ios_renderer.h +20 -0
- package/targets/ios/main/ios_renderer.mm +27 -0
- package/targets/ios/main/ios_root_background.cpp +20 -0
- package/targets/ios/main/ios_root_background.h +11 -0
- package/targets/ios/main/ios_sensors.mm +244 -0
- package/targets/ios/main/ios_timers.mm +53 -0
- package/targets/ios/main/renderer/ios_renderer_internal.h +65 -0
- package/targets/ios/main/renderer/ios_renderer_support.mm +111 -0
- package/targets/ios/main/renderer/native_button.mm +179 -0
- package/targets/ios/main/renderer/native_label.mm +161 -0
- package/targets/ios/main/renderer/native_scroll_container.mm +279 -0
- package/targets/ios/main/renderer/view_reconciler.mm +274 -0
- package/targets/macos/Info.plist.in +26 -0
- package/targets/macos/README.md +131 -0
- package/targets/macos/build-child-lifecycle.sh +119 -0
- package/targets/macos/build-macos.sh +2156 -0
- package/targets/macos/check-module-graph-freshness.mjs +82 -0
- package/targets/macos/compiler-input-fingerprint.mjs +32 -0
- package/targets/macos/finalize-apple-native-output.mjs +77 -0
- package/targets/macos/generate-resident-entry.mjs +80 -0
- package/targets/macos/generate-resident-registry.mjs +141 -0
- package/targets/macos/heavy-build-lock.sh +176 -0
- package/targets/macos/main/canvas_view.h +9 -0
- package/targets/macos/main/canvas_view.mm +176 -0
- package/targets/macos/main/color_convert.h +18 -0
- package/targets/macos/main/color_convert.mm +39 -0
- package/targets/macos/main/font_registry.h +35 -0
- package/targets/macos/main/font_registry.mm +350 -0
- package/targets/macos/main/image_bridge.h +16 -0
- package/targets/macos/main/image_bridge.mm +52 -0
- package/targets/macos/main/macos_app_platform.mm +95 -0
- package/targets/macos/main/macos_apps.c +31 -0
- package/targets/macos/main/macos_device_control.mm +56 -0
- package/targets/macos/main/macos_display.mm +484 -0
- package/targets/macos/main/macos_host_device_control.mm +95 -0
- package/targets/macos/main/macos_main.mm +839 -0
- package/targets/macos/main/macos_memory.cpp +31 -0
- package/targets/macos/main/macos_native_shell.h +31 -0
- package/targets/macos/main/macos_native_shell.mm +396 -0
- package/targets/macos/main/macos_network.mm +253 -0
- package/targets/macos/main/macos_renderer.h +39 -0
- package/targets/macos/main/macos_renderer.mm +1969 -0
- package/targets/macos/main/macos_sensors.cpp +148 -0
- package/targets/macos/main/macos_smoke_app.cpp +65 -0
- package/targets/macos/main/macos_timers.mm +52 -0
- package/targets/macos/main/press_bridge.h +21 -0
- package/targets/macos/main/press_bridge.mm +72 -0
- package/targets/macos/main/thermalright_hid_display.h +14 -0
- package/targets/macos/main/thermalright_hid_display.mm +995 -0
- package/targets/macos/native-artifact-provenance.mjs +421 -0
- package/targets/macos/order-compile-edges.mjs +64 -0
- package/targets/macos/preflight-hard-muted-artifact.mjs +93 -0
- package/targets/macos/prune-generated-modules.mjs +147 -0
- package/targets/macos/sync-resources.mjs +153 -0
- package/targets/shared/analyze-audio-capture.mjs +131 -0
- package/targets/shared/apple_audio.mm +1194 -0
- package/targets/shared/apple_audio_selftest.mm +602 -0
- package/targets/shared/apple_audio_testing.h +34 -0
- package/targets/shared/build-audio-selftest.sh +50 -0
package/runtime/UIKit.js
ADDED
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
function geaAppleUIKitNativeOnly(name) {
|
|
2
|
+
throw new Error(`@geajs/apple/UIKit ${name} is native-only and must be lowered by @geastack/geatsc-plugin-apple-native.`)
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export const UIAlertActionStyleDefault = 0
|
|
6
|
+
export const UIAlertActionStyleCancel = 1
|
|
7
|
+
export const UIAlertActionStyleDestructive = 2
|
|
8
|
+
export const UIAlertControllerStyleActionSheet = 0
|
|
9
|
+
export const UIAlertControllerStyleAlert = 1
|
|
10
|
+
export const UIModalPresentationFullScreen = 0
|
|
11
|
+
export const UIControlEventTouchDown = 1
|
|
12
|
+
export const UIControlEventTouchUpInside = 64
|
|
13
|
+
export const UIControlEventTouchUpOutside = 128
|
|
14
|
+
export const UIControlEventTouchCancel = 256
|
|
15
|
+
export const UIControlEventValueChanged = 4096
|
|
16
|
+
export const ObjCTargetAction = "invoke:"
|
|
17
|
+
|
|
18
|
+
export function installRootView() {
|
|
19
|
+
return geaAppleUIKitNativeOnly("installRootView")
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export class UIColor {
|
|
23
|
+
static systemBackgroundColor() {
|
|
24
|
+
return geaAppleUIKitNativeOnly("UIColor.systemBackgroundColor")
|
|
25
|
+
}
|
|
26
|
+
static systemGroupedBackgroundColor() {
|
|
27
|
+
return geaAppleUIKitNativeOnly("UIColor.systemGroupedBackgroundColor")
|
|
28
|
+
}
|
|
29
|
+
static secondarySystemGroupedBackgroundColor() {
|
|
30
|
+
return geaAppleUIKitNativeOnly("UIColor.secondarySystemGroupedBackgroundColor")
|
|
31
|
+
}
|
|
32
|
+
static labelColor() {
|
|
33
|
+
return geaAppleUIKitNativeOnly("UIColor.labelColor")
|
|
34
|
+
}
|
|
35
|
+
static secondaryLabelColor() {
|
|
36
|
+
return geaAppleUIKitNativeOnly("UIColor.secondaryLabelColor")
|
|
37
|
+
}
|
|
38
|
+
static systemBlueColor() {
|
|
39
|
+
return geaAppleUIKitNativeOnly("UIColor.systemBlueColor")
|
|
40
|
+
}
|
|
41
|
+
static systemIndigoColor() {
|
|
42
|
+
return geaAppleUIKitNativeOnly("UIColor.systemIndigoColor")
|
|
43
|
+
}
|
|
44
|
+
static systemPurpleColor() {
|
|
45
|
+
return geaAppleUIKitNativeOnly("UIColor.systemPurpleColor")
|
|
46
|
+
}
|
|
47
|
+
static systemTealColor() {
|
|
48
|
+
return geaAppleUIKitNativeOnly("UIColor.systemTealColor")
|
|
49
|
+
}
|
|
50
|
+
static systemGreenColor() {
|
|
51
|
+
return geaAppleUIKitNativeOnly("UIColor.systemGreenColor")
|
|
52
|
+
}
|
|
53
|
+
static systemOrangeColor() {
|
|
54
|
+
return geaAppleUIKitNativeOnly("UIColor.systemOrangeColor")
|
|
55
|
+
}
|
|
56
|
+
static systemGray5Color() {
|
|
57
|
+
return geaAppleUIKitNativeOnly("UIColor.systemGray5Color")
|
|
58
|
+
}
|
|
59
|
+
static whiteColor() {
|
|
60
|
+
return geaAppleUIKitNativeOnly("UIColor.whiteColor")
|
|
61
|
+
}
|
|
62
|
+
static blackColor() {
|
|
63
|
+
return geaAppleUIKitNativeOnly("UIColor.blackColor")
|
|
64
|
+
}
|
|
65
|
+
static colorWithRed() {
|
|
66
|
+
return geaAppleUIKitNativeOnly("UIColor.colorWithRed")
|
|
67
|
+
}
|
|
68
|
+
static colorWithRedGreenBlueAlpha() {
|
|
69
|
+
return geaAppleUIKitNativeOnly("UIColor.colorWithRedGreenBlueAlpha")
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export class UIFont {
|
|
74
|
+
static systemFontOfSize() {
|
|
75
|
+
return geaAppleUIKitNativeOnly("UIFont.systemFontOfSize")
|
|
76
|
+
}
|
|
77
|
+
static systemFontOfSizeWeight() {
|
|
78
|
+
return geaAppleUIKitNativeOnly("UIFont.systemFontOfSizeWeight")
|
|
79
|
+
}
|
|
80
|
+
static boldSystemFontOfSize() {
|
|
81
|
+
return geaAppleUIKitNativeOnly("UIFont.boldSystemFontOfSize")
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export class UIScreen {
|
|
86
|
+
static mainScreen() {
|
|
87
|
+
return geaAppleUIKitNativeOnly("UIScreen.mainScreen")
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export class UIApplication {
|
|
92
|
+
static sharedApplication() {
|
|
93
|
+
return geaAppleUIKitNativeOnly("UIApplication.sharedApplication")
|
|
94
|
+
}
|
|
95
|
+
openURL() {
|
|
96
|
+
return geaAppleUIKitNativeOnly("UIApplication.openURL")
|
|
97
|
+
}
|
|
98
|
+
openURLOptionsCompletionHandler() {
|
|
99
|
+
return geaAppleUIKitNativeOnly("UIApplication.openURLOptionsCompletionHandler")
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export class UIViewController {
|
|
104
|
+
constructor() {
|
|
105
|
+
geaAppleUIKitNativeOnly("new UIViewController")
|
|
106
|
+
}
|
|
107
|
+
presentViewControllerAnimatedCompletion() {
|
|
108
|
+
return geaAppleUIKitNativeOnly("UIViewController.presentViewControllerAnimatedCompletion")
|
|
109
|
+
}
|
|
110
|
+
dismissViewControllerAnimatedCompletion() {
|
|
111
|
+
return geaAppleUIKitNativeOnly("UIViewController.dismissViewControllerAnimatedCompletion")
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export class UINavigationController {
|
|
116
|
+
constructor(rootViewController) {
|
|
117
|
+
geaAppleUIKitNativeOnly("new UINavigationController")
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export class UIAlertAction {
|
|
122
|
+
static actionWithTitleStyleHandler() {
|
|
123
|
+
return geaAppleUIKitNativeOnly("UIAlertAction.actionWithTitleStyleHandler")
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export class UIAlertController {
|
|
128
|
+
static alertControllerWithTitleMessagePreferredStyle() {
|
|
129
|
+
return geaAppleUIKitNativeOnly("UIAlertController.alertControllerWithTitleMessagePreferredStyle")
|
|
130
|
+
}
|
|
131
|
+
addAction() {
|
|
132
|
+
return geaAppleUIKitNativeOnly("UIAlertController.addAction")
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export class UIAction {
|
|
137
|
+
static actionWithHandler() {
|
|
138
|
+
return geaAppleUIKitNativeOnly("UIAction.actionWithHandler")
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export class ObjCTarget {
|
|
143
|
+
static create() {
|
|
144
|
+
return geaAppleUIKitNativeOnly("ObjCTarget.create")
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export class UIView {
|
|
149
|
+
constructor() {
|
|
150
|
+
geaAppleUIKitNativeOnly("new UIView")
|
|
151
|
+
}
|
|
152
|
+
addSubview() {
|
|
153
|
+
return geaAppleUIKitNativeOnly("UIView.addSubview")
|
|
154
|
+
}
|
|
155
|
+
layoutIfNeeded() {
|
|
156
|
+
return geaAppleUIKitNativeOnly("UIView.layoutIfNeeded")
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export class UIWindow {
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export class UIControl {
|
|
164
|
+
addTarget() {
|
|
165
|
+
return geaAppleUIKitNativeOnly("UIControl.addTarget")
|
|
166
|
+
}
|
|
167
|
+
addAction() {
|
|
168
|
+
return geaAppleUIKitNativeOnly("UIControl.addAction")
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export class UIButton {
|
|
173
|
+
constructor() {
|
|
174
|
+
geaAppleUIKitNativeOnly("new UIButton")
|
|
175
|
+
}
|
|
176
|
+
setTitle() {
|
|
177
|
+
return geaAppleUIKitNativeOnly("UIButton.setTitle")
|
|
178
|
+
}
|
|
179
|
+
setTitleColor() {
|
|
180
|
+
return geaAppleUIKitNativeOnly("UIButton.setTitleColor")
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export class UILabel {
|
|
185
|
+
constructor() {
|
|
186
|
+
geaAppleUIKitNativeOnly("new UILabel")
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export class UIImage {
|
|
191
|
+
static systemImageNamed() {
|
|
192
|
+
return geaAppleUIKitNativeOnly("UIImage.systemImageNamed")
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export class UIImageView {
|
|
197
|
+
constructor() {
|
|
198
|
+
geaAppleUIKitNativeOnly("new UIImageView")
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export class UIStackView {
|
|
203
|
+
constructor() {
|
|
204
|
+
geaAppleUIKitNativeOnly("new UIStackView")
|
|
205
|
+
}
|
|
206
|
+
addArrangedSubview() {
|
|
207
|
+
return geaAppleUIKitNativeOnly("UIStackView.addArrangedSubview")
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export class UIBlurEffect {
|
|
212
|
+
static effectWithStyle() {
|
|
213
|
+
return geaAppleUIKitNativeOnly("UIBlurEffect.effectWithStyle")
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export class UIVisualEffectView {
|
|
218
|
+
constructor() {
|
|
219
|
+
geaAppleUIKitNativeOnly("new UIVisualEffectView")
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export class UISwitch {
|
|
224
|
+
constructor() {
|
|
225
|
+
geaAppleUIKitNativeOnly("new UISwitch")
|
|
226
|
+
}
|
|
227
|
+
setOn() {
|
|
228
|
+
return geaAppleUIKitNativeOnly("UISwitch.setOn")
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export class UIProgressView {
|
|
233
|
+
constructor() {
|
|
234
|
+
geaAppleUIKitNativeOnly("new UIProgressView")
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export class UISlider {
|
|
239
|
+
constructor() {
|
|
240
|
+
geaAppleUIKitNativeOnly("new UISlider")
|
|
241
|
+
}
|
|
242
|
+
}
|
package/runtime/empty.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
@@ -0,0 +1,25 @@
|
|
|
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><string>en</string>
|
|
6
|
+
<key>CFBundleExecutable</key><string>@APP_EXEC@</string>
|
|
7
|
+
<key>CFBundleIdentifier</key><string>@BUNDLE_ID@</string>
|
|
8
|
+
<key>CFBundleInfoDictionaryVersion</key><string>6.0</string>
|
|
9
|
+
<key>CFBundleName</key><string>@APP_NAME@</string>
|
|
10
|
+
<key>CFBundleIconName</key><string>AppIcon</string>
|
|
11
|
+
<key>CFBundlePackageType</key><string>APPL</string>
|
|
12
|
+
<key>CFBundleShortVersionString</key><string>0.1.0</string>
|
|
13
|
+
<key>CFBundleVersion</key><string>1</string>
|
|
14
|
+
<key>LSRequiresIPhoneOS</key><true/>
|
|
15
|
+
<key>NSCameraUsageDescription</key><string>Gea native examples use the camera to demonstrate AVFoundation preview layers from TypeScript.</string>
|
|
16
|
+
<key>NSLocationWhenInUseUsageDescription</key><string>Gea native examples use location to demonstrate CoreLocation and MapKit from TypeScript.</string>
|
|
17
|
+
<key>NSPhotoLibraryAddUsageDescription</key><string>Gea native examples save captured camera photos to demonstrate Photos library writes from TypeScript.</string>
|
|
18
|
+
<key>UIRequiresFullScreen</key><true/>
|
|
19
|
+
<key>UILaunchScreen</key><dict/>
|
|
20
|
+
<key>UISupportedInterfaceOrientations</key>
|
|
21
|
+
<array>
|
|
22
|
+
<string>UIInterfaceOrientationPortrait</string>
|
|
23
|
+
</array>
|
|
24
|
+
</dict>
|
|
25
|
+
</plist>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# iOS target
|
|
2
|
+
|
|
3
|
+
Build a gea-embedded JSX app as a native UIKit app.
|
|
4
|
+
|
|
5
|
+
First milestone:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
targets/ios/build-ios.sh bouncing-balls-jsx simulator
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
The simulator path auto-picks an available iPhone simulator. Set
|
|
12
|
+
`GEA_IOS_SIMULATOR_UDID` to force a specific device. By default, the script
|
|
13
|
+
also opens Simulator.app for the selected device; set
|
|
14
|
+
`GEA_IOS_OPEN_SIMULATOR=0` to leave the simulator GUI alone.
|
|
15
|
+
|
|
16
|
+
For an attached iPhone, the script uses Xcode's last selected development
|
|
17
|
+
team when it can find one. You can also set your Apple development team
|
|
18
|
+
explicitly:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
GEA_IOS_DEVELOPMENT_TEAM=ABCDE12345 targets/ios/build-ios.sh bouncing-balls-jsx device
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
To see the automatically detected team id:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
targets/ios/detect-development-team.mjs
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Signed device builds auto-pick an attached iPhone with Developer Mode enabled,
|
|
31
|
+
install the app with `devicectl`, and launch it in the foreground. Set
|
|
32
|
+
`GEA_IOS_DEVICE_ID` to force a specific device. Signed device builds allow
|
|
33
|
+
Xcode to create or update provisioning profiles by default. Disable that with
|
|
34
|
+
`GEA_IOS_ALLOW_PROVISIONING_UPDATES=0`.
|
|
35
|
+
|
|
36
|
+
To only verify that the app compiles for the iPhone device SDK, skip launch
|
|
37
|
+
without a development team:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
GEA_IOS_SKIP_LAUNCH=1 targets/ios/build-ios.sh bouncing-balls-jsx device
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
The Xcode project is generated under
|
|
44
|
+
`<app>/dist/ios/<app-id>/GeaIos.xcodeproj`. Open it after running the script
|
|
45
|
+
if you want to inspect signing or launch through Xcode. Do not hand-edit it as
|
|
46
|
+
the source of truth.
|