@octane-xplat/nativescript-mason-core 0.0.1 → 1.0.0-beta.1
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 +201 -0
- package/README.md +198 -2
- package/artifact-inventory.json +774 -0
- package/box-shadow.d.ts +10 -0
- package/box-shadow.js +48 -0
- package/common.d.ts +485 -0
- package/common.js +2659 -0
- package/css-colors.d.ts +17 -0
- package/css-colors.js +54 -0
- package/css-environment.d.ts +49 -0
- package/css-environment.js +309 -0
- package/css-filter.d.ts +17 -0
- package/css-filter.js +140 -0
- package/css-keyframes.d.ts +41 -0
- package/css-keyframes.js +437 -0
- package/css-math.d.ts +34 -0
- package/css-math.js +300 -0
- package/css-shorthands.d.ts +65 -0
- package/css-shorthands.js +673 -0
- package/css-transform.d.ts +6 -0
- package/css-transform.js +100 -0
- package/diagnostics.d.ts +51 -0
- package/diagnostics.js +52 -0
- package/display-density.d.ts +9 -0
- package/display-density.js +20 -0
- package/fonts.d.ts +20 -0
- package/fonts.js +88 -0
- package/foreign-layout.d.ts +6 -0
- package/foreign-layout.js +151 -0
- package/gradient-stops.d.ts +25 -0
- package/gradient-stops.js +112 -0
- package/index.android.d.ts +11 -0
- package/index.android.js +9 -0
- package/index.d.ts +12 -0
- package/index.ios.d.ts +11 -0
- package/index.ios.js +9 -0
- package/ios-host-README.md +124 -0
- package/layout-types.d.ts +192 -0
- package/mask.d.ts +54 -0
- package/mask.js +26 -0
- package/native-environment.android.d.ts +3 -0
- package/native-environment.android.js +69 -0
- package/native-environment.d.ts +3 -0
- package/native-environment.ios.d.ts +3 -0
- package/native-environment.ios.js +65 -0
- package/native-types-README.md +51 -0
- package/package.json +47 -6
- package/panel-helpers.d.ts +3 -0
- package/panel-helpers.js +8 -0
- package/platforms/android/MasonCore.aar +0 -0
- package/platforms/android/include.gradle +6 -0
- package/platforms/android/manifest.json +73 -0
- package/platforms/ios/FontManager.LICENSE +201 -0
- package/platforms/ios/MasonCore.xcframework/Info.plist +43 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Headers/Mason.h +25 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Headers/MasonCore-Swift.h +1739 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Headers/mason_native.h +601 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Info.plist +0 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/MasonCore +0 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Modules/MasonCore.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios.abi.json +100095 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios.private.swiftinterface +3174 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios.swiftinterface +3174 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Modules/module.modulemap +9 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/SDWebImage_SDWebImage.bundle/Info.plist +0 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/SDWebImage_SDWebImage.bundle/PrivacyInfo.xcprivacy +23 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Headers/Mason.h +25 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Headers/MasonCore-Swift.h +1739 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Headers/mason_native.h +601 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Info.plist +0 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/MasonCore +0 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Modules/MasonCore.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios-simulator.abi.json +100095 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +3174 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios-simulator.swiftinterface +3174 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Modules/module.modulemap +9 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/SDWebImage_SDWebImage.bundle/Info.plist +0 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/SDWebImage_SDWebImage.bundle/PrivacyInfo.xcprivacy +23 -0
- package/platforms/ios/Package.resolved +24 -0
- package/platforms/ios/SDWebImage.LICENSE +20 -0
- package/platforms/ios/build.xcconfig +4 -0
- package/platforms/ios/device-manifest.json +213 -0
- package/platforms/ios/include/FontManager/NSCFontDescriptors.h +36 -0
- package/platforms/ios/include/FontManager/NSCFontFace.h +98 -0
- package/platforms/ios/include/FontManager/NSCFontFaceSet.h +73 -0
- package/platforms/ios/include/FontManager/NSCFontManagerUmbrella.h +7 -0
- package/platforms/ios/include/FontManager/NSCFontParser.h +22 -0
- package/platforms/ios/include/FontManager/NSCFontRegex.h +4 -0
- package/platforms/ios/include/FontManager/NSCFontResolver.h +43 -0
- package/platforms/ios/include/FontManager/NSCFontStyle.h +27 -0
- package/platforms/ios/include/FontManager/NSCFontTypes.h +41 -0
- package/platforms/ios/include/SDWebImage/NSButton+WebCache.h +340 -0
- package/platforms/ios/include/SDWebImage/NSData+ImageContentType.h +63 -0
- package/platforms/ios/include/SDWebImage/NSImage+Compatibility.h +67 -0
- package/platforms/ios/include/SDWebImage/SDAnimatedImage.h +136 -0
- package/platforms/ios/include/SDWebImage/SDAnimatedImagePlayer.h +113 -0
- package/platforms/ios/include/SDWebImage/SDAnimatedImageRep.h +33 -0
- package/platforms/ios/include/SDWebImage/SDAnimatedImageView+WebCache.h +168 -0
- package/platforms/ios/include/SDWebImage/SDAnimatedImageView.h +125 -0
- package/platforms/ios/include/SDWebImage/SDCallbackQueue.h +59 -0
- package/platforms/ios/include/SDWebImage/SDDiskCache.h +146 -0
- package/platforms/ios/include/SDWebImage/SDGraphicsImageRenderer.h +84 -0
- package/platforms/ios/include/SDWebImage/SDImageAPNGCoder.h +19 -0
- package/platforms/ios/include/SDWebImage/SDImageAWebPCoder.h +23 -0
- package/platforms/ios/include/SDWebImage/SDImageCache.h +482 -0
- package/platforms/ios/include/SDWebImage/SDImageCacheConfig.h +153 -0
- package/platforms/ios/include/SDWebImage/SDImageCacheDefine.h +179 -0
- package/platforms/ios/include/SDWebImage/SDImageCachesManager.h +81 -0
- package/platforms/ios/include/SDWebImage/SDImageCoder.h +347 -0
- package/platforms/ios/include/SDWebImage/SDImageCoderHelper.h +251 -0
- package/platforms/ios/include/SDWebImage/SDImageCodersManager.h +58 -0
- package/platforms/ios/include/SDWebImage/SDImageFrame.h +44 -0
- package/platforms/ios/include/SDWebImage/SDImageGIFCoder.h +22 -0
- package/platforms/ios/include/SDWebImage/SDImageGraphics.h +28 -0
- package/platforms/ios/include/SDWebImage/SDImageHEICCoder.h +25 -0
- package/platforms/ios/include/SDWebImage/SDImageIOAnimatedCoder.h +65 -0
- package/platforms/ios/include/SDWebImage/SDImageIOCoder.h +30 -0
- package/platforms/ios/include/SDWebImage/SDImageLoader.h +146 -0
- package/platforms/ios/include/SDWebImage/SDImageLoadersManager.h +40 -0
- package/platforms/ios/include/SDWebImage/SDImageTransformer.h +283 -0
- package/platforms/ios/include/SDWebImage/SDMemoryCache.h +78 -0
- package/platforms/ios/include/SDWebImage/SDWebImage.h +91 -0
- package/platforms/ios/include/SDWebImage/SDWebImageCacheKeyFilter.h +35 -0
- package/platforms/ios/include/SDWebImage/SDWebImageCacheSerializer.h +39 -0
- package/platforms/ios/include/SDWebImage/SDWebImageCompat.h +102 -0
- package/platforms/ios/include/SDWebImage/SDWebImageDefine.h +420 -0
- package/platforms/ios/include/SDWebImage/SDWebImageDownloader.h +320 -0
- package/platforms/ios/include/SDWebImage/SDWebImageDownloaderConfig.h +113 -0
- package/platforms/ios/include/SDWebImage/SDWebImageDownloaderDecryptor.h +52 -0
- package/platforms/ios/include/SDWebImage/SDWebImageDownloaderOperation.h +191 -0
- package/platforms/ios/include/SDWebImage/SDWebImageDownloaderRequestModifier.h +72 -0
- package/platforms/ios/include/SDWebImage/SDWebImageDownloaderResponseModifier.h +72 -0
- package/platforms/ios/include/SDWebImage/SDWebImageError.h +33 -0
- package/platforms/ios/include/SDWebImage/SDWebImageIndicator.h +119 -0
- package/platforms/ios/include/SDWebImage/SDWebImageManager.h +290 -0
- package/platforms/ios/include/SDWebImage/SDWebImageOperation.h +27 -0
- package/platforms/ios/include/SDWebImage/SDWebImageOptionsProcessor.h +78 -0
- package/platforms/ios/include/SDWebImage/SDWebImagePrefetcher.h +168 -0
- package/platforms/ios/include/SDWebImage/SDWebImageTransition.h +131 -0
- package/platforms/ios/include/SDWebImage/UIButton+WebCache.h +402 -0
- package/platforms/ios/include/SDWebImage/UIImage+ExtendedCacheData.h +24 -0
- package/platforms/ios/include/SDWebImage/UIImage+ForceDecode.h +52 -0
- package/platforms/ios/include/SDWebImage/UIImage+GIF.h +26 -0
- package/platforms/ios/include/SDWebImage/UIImage+MemoryCacheCost.h +27 -0
- package/platforms/ios/include/SDWebImage/UIImage+Metadata.h +104 -0
- package/platforms/ios/include/SDWebImage/UIImage+MultiFormat.h +81 -0
- package/platforms/ios/include/SDWebImage/UIImage+Transform.h +164 -0
- package/platforms/ios/include/SDWebImage/UIImageView+HighlightedWebCache.h +142 -0
- package/platforms/ios/include/SDWebImage/UIImageView+WebCache.h +209 -0
- package/platforms/ios/include/SDWebImage/UIView+WebCache.h +131 -0
- package/platforms/ios/include/SDWebImage/UIView+WebCacheOperation.h +52 -0
- package/platforms/ios/include/SDWebImage/UIView+WebCacheState.h +63 -0
- package/platforms/ios/include/module.modulemap +2 -0
- package/platforms/ios/manifest.json +132 -0
- package/platforms/ios/simulator-manifest.json +213 -0
- package/plugin-README.md +234 -0
- package/properties.d.ts +154 -0
- package/properties.js +2456 -0
- package/pseudo.d.ts +9 -0
- package/pseudo.js +57 -0
- package/scroll/index.android.d.ts +15 -0
- package/scroll/index.android.js +72 -0
- package/scroll/index.d.ts +5 -0
- package/scroll/index.ios.d.ts +18 -0
- package/scroll/index.ios.js +106 -0
- package/style.d.ts +768 -0
- package/style.js +7167 -0
- package/symbols.d.ts +25 -0
- package/symbols.js +41 -0
- package/tree/index.android.d.ts +11 -0
- package/tree/index.android.js +42 -0
- package/tree/index.d.ts +15 -0
- package/tree/index.ios.d.ts +26 -0
- package/tree/index.ios.js +53 -0
- package/typings/android-declarations.d.ts +4 -0
- package/typings/android.d.ts +9730 -0
- package/typings/manifest.json +45 -0
- package/typings/native.d.ts +5 -0
- package/typings/objc!FontManager.d.ts +389 -0
- package/typings/objc!MasonCore.d.ts +2472 -0
- package/typings/objc!SDWebImage.d.ts +3378 -0
- package/units.d.ts +29 -0
- package/units.js +44 -0
- package/utils/index.android.d.ts +211 -0
- package/utils/index.android.js +595 -0
- package/utils/index.ios.d.ts +222 -0
- package/utils/index.ios.js +790 -0
- package/view/index.android.d.ts +13 -0
- package/view/index.android.js +74 -0
- package/view/index.d.ts +2 -0
- package/view/index.ios.d.ts +24 -0
- package/view/index.ios.js +157 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference path="./typings/native.d.ts" />
|
|
2
|
+
export { View } from './view';
|
|
3
|
+
export { Scroll } from './scroll';
|
|
4
|
+
export { ViewBase, Event } from './common';
|
|
5
|
+
export type { ScrollBehavior, ScrollLogicalPosition, ScrollToOptions, ScrollIntoViewOptions } from './common';
|
|
6
|
+
export { Style } from './style';
|
|
7
|
+
export { setCssEnvironment, clearCssEnvironment, bindCssEnvironment, refreshCssEnvironment } from './css-environment';
|
|
8
|
+
export type { CssSafeAreaInsets, CssEnvironmentHost, CssEnvironmentSource } from './css-environment';
|
|
9
|
+
export { setCssDiagnostics, getCssDiagnostics, clearCssDiagnostics, formatCssDiagnostics, cssDiagnosticsEnabled } from './diagnostics';
|
|
10
|
+
export { setCssUnitContext, cssUnits } from './units';
|
|
11
|
+
export { registerAppFontsDirectory } from './fonts';
|
|
12
|
+
export type * from './layout-types';
|
package/index.ios.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { View } from './view';
|
|
2
|
+
export { Scroll } from './scroll';
|
|
3
|
+
export { ViewBase, Event } from './common';
|
|
4
|
+
export type { ScrollBehavior, ScrollLogicalPosition, ScrollToOptions, ScrollIntoViewOptions } from './common';
|
|
5
|
+
export { Style } from './style';
|
|
6
|
+
export { setCssEnvironment, clearCssEnvironment, bindCssEnvironment, refreshCssEnvironment } from './css-environment';
|
|
7
|
+
export type { CssSafeAreaInsets, CssEnvironmentHost, CssEnvironmentSource } from './css-environment';
|
|
8
|
+
export { setCssDiagnostics, getCssDiagnostics, clearCssDiagnostics, formatCssDiagnostics, cssDiagnosticsEnabled } from './diagnostics';
|
|
9
|
+
export { setCssUnitContext, cssUnits } from './units';
|
|
10
|
+
export { registerAppFontsDirectory } from './fonts';
|
|
11
|
+
export type * from './layout-types';
|
package/index.ios.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference path="./typings/native.d.ts" />
|
|
2
|
+
export { View } from './view';
|
|
3
|
+
export { Scroll } from './scroll';
|
|
4
|
+
export { ViewBase, Event } from './common';
|
|
5
|
+
export { Style } from './style';
|
|
6
|
+
export { setCssEnvironment, clearCssEnvironment, bindCssEnvironment, refreshCssEnvironment } from './css-environment';
|
|
7
|
+
export { setCssDiagnostics, getCssDiagnostics, clearCssDiagnostics, formatCssDiagnostics, cssDiagnosticsEnabled } from './diagnostics';
|
|
8
|
+
export { setCssUnitContext, cssUnits } from './units';
|
|
9
|
+
export { registerAppFontsDirectory } from './fonts';
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# Core iOS host prototype
|
|
2
|
+
|
|
3
|
+
The core-only simulator framework builds and runs without MasonKit's HTML
|
|
4
|
+
parser, rich-text renderer, or widget classes. It is a native boundary proof;
|
|
5
|
+
NativeScript metadata and npm plugin packaging are separate proofs; see
|
|
6
|
+
`tools/mason-core/plugin-README.md` in the source checkout.
|
|
7
|
+
|
|
8
|
+
## Build and inspect the artifact
|
|
9
|
+
|
|
10
|
+
On macOS with Xcode and the repository's Rust iOS prerequisites installed:
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
pnpm exec nx run nativescript-mason-core:verify.host.ios.artifact
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The target builds the independent Rust engine, generates the core Swift project
|
|
17
|
+
under `tmp/mason-core-ios-host`, and exports
|
|
18
|
+
`dist/native/mason-core/ios-host/release`. Verification copies the artifact to an
|
|
19
|
+
isolated temporary directory, links Swift and Objective-C consumers, verifies
|
|
20
|
+
all 99 declared C functions are exported, and checks native symbols and headers
|
|
21
|
+
for excluded classes.
|
|
22
|
+
|
|
23
|
+
Build and verify the unsigned arm64 device framework separately:
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
pnpm exec nx run nativescript-mason-core:verify.host.ios.device.artifact
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
This uses `iphoneos`, the device engine archive and separate staging/derived
|
|
30
|
+
folders, exporting `dist/native/mason-core/ios-host/device/release`. The device
|
|
31
|
+
framework and isolated Swift/Objective-C clients compile and link; its Mach-O
|
|
32
|
+
platform and all 99 C exports are verified. This is build evidence only. It does
|
|
33
|
+
not qualify device runtime behavior.
|
|
34
|
+
Both builds require a native-build resource reservation. Assemble the verified
|
|
35
|
+
slices after both builds:
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
pnpm exec nx run nativescript-mason-core:build.host.ios.xcframework
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Assembly requires matching source hashes, dependency locks and public headers.
|
|
42
|
+
It exports `dist/native/mason-core/ios-host/universal`, embedding each platform's
|
|
43
|
+
SDWebImage privacy bundle in its own framework slice. The plugin packages this
|
|
44
|
+
XCFramework; resource paths no longer depend on a simulator-only global bundle.
|
|
45
|
+
|
|
46
|
+
The exported framework retains FontManager for styling/font metrics and
|
|
47
|
+
SDWebImage for container backgrounds and nine-slice images. Their code is
|
|
48
|
+
linked into the framework. Their dependency headers and licenses accompany it;
|
|
49
|
+
FontManager's Clang module is required even for a Swift client that imports
|
|
50
|
+
only `MasonCore`. Removing image/text widgets does not remove these remaining
|
|
51
|
+
callers. The export also carries SwiftPM's SDWebImage resource/privacy bundle.
|
|
52
|
+
The separate isolated NativeScript app verifies resource discovery, core class
|
|
53
|
+
metadata, layout and ownership on an arm64 simulator. Independent public native
|
|
54
|
+
declarations are generated independently; device app coverage remains a gate.
|
|
55
|
+
|
|
56
|
+
## Run native layout tests
|
|
57
|
+
|
|
58
|
+
Build the test bundle first:
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
pnpm exec nx run nativescript-mason-core:build.tests.ios
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Prepare a dedicated simulator and record its identifier. This example uses the
|
|
65
|
+
iOS 27 runtime and iPhone 17 Pro device type used for the current proof; inspect
|
|
66
|
+
`xcrun simctl list` for identifiers installed on another machine.
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
test -f tmp/mason-core-ios-test-device.txt || \
|
|
70
|
+
xcrun simctl create 'Mason core extraction' \
|
|
71
|
+
com.apple.CoreSimulator.SimDeviceType.iPhone-17-Pro \
|
|
72
|
+
com.apple.CoreSimulator.SimRuntime.iOS-27-0 > tmp/mason-core-ios-test-device.txt
|
|
73
|
+
pnpm exec nx run nativescript-mason-core:test.host.ios
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
The runner boots only that dedicated device and shuts it down afterward. It
|
|
77
|
+
runs the 11 existing `CoreLayoutInteropTests` unchanged apart from their module
|
|
78
|
+
import, plus four core regressions. It checks the result bundle contains all
|
|
79
|
+
15 passing tests, with no skips. Results stay under `tmp/mason-core-ios-tests`.
|
|
80
|
+
The tests exercise UIKit directly; they do not capture screenshots.
|
|
81
|
+
|
|
82
|
+
Covered behavior: grid placement, foreign label intrinsic-size invalidation,
|
|
83
|
+
percentage sizing and reset, programmatic scroll clamping, nested roots during
|
|
84
|
+
an outer compute, bounded root measurement, and view/node/listener release.
|
|
85
|
+
Host-driven fixtures give roots explicit bounds and mark their applied compute
|
|
86
|
+
before programmatic seeking, matching the host lifecycle.
|
|
87
|
+
|
|
88
|
+
## Preserve source and the full package
|
|
89
|
+
|
|
90
|
+
The generated project compiles 39 existing Swift files. Of these, 25 retain
|
|
91
|
+
identical source bytes; 14 have explicit core-only adaptations. The manifest
|
|
92
|
+
records each original and projected hash. The 25 unchanged files now live in
|
|
93
|
+
core after byte-preserving `git mv` moves. The full Xcode project changes only
|
|
94
|
+
those source references; its implementation and remaining files retain their
|
|
95
|
+
bytes. No full-to-core runtime dependency is added.
|
|
96
|
+
|
|
97
|
+
`ios-sources.mjs` uses compiler-derived declaration spans from `swift-source.mjs`
|
|
98
|
+
to remove optional factories, HTML conveniences, text-run reconciliation, and
|
|
99
|
+
widget-specific branches. `ios-node-children.swift` supplies the foreign-view
|
|
100
|
+
and container child operations. Shared measurement methods remain unchanged.
|
|
101
|
+
This projection is temporary prototype wiring, not the final upstream seam.
|
|
102
|
+
The native path mapping and baseline hashes live in `native-relocations.json`.
|
|
103
|
+
Generated projects reconstruct the original source layout; both builds resolve
|
|
104
|
+
one tracked copy through `native-sources.mjs`. Keep future fixes separate from
|
|
105
|
+
source moves and avoid parallel edited copies.
|
|
106
|
+
|
|
107
|
+
Container painting and scrolling remain in core. Background text clipping has
|
|
108
|
+
a small native glyph-provider protocol, allowing a renderer to supply outlines
|
|
109
|
+
without embedding MasonKit's text renderer. Ordinary UIKit/NativeScript labels
|
|
110
|
+
do not acquire glyph-provider support from this extraction. The shared Rust
|
|
111
|
+
engine and C interface still contain inline-layout code and convenience node
|
|
112
|
+
constructors; this proof does not claim those costs have been removed.
|
|
113
|
+
|
|
114
|
+
## Remaining qualification
|
|
115
|
+
|
|
116
|
+
The native host exports separate arm64 simulator and device frameworks.
|
|
117
|
+
The plugin packages both slices. Its compiled simulator app qualifies bridge
|
|
118
|
+
metadata, framework-local resources and OS input; the unsigned device app build
|
|
119
|
+
checks device metadata and resource selection separately. Physical iOS device
|
|
120
|
+
execution remains unqualified. Simulator bridge types,
|
|
121
|
+
plugin discovery, compiled components and OS input pass separately; see the
|
|
122
|
+
[plugin proof](plugin-README.md). Matching release app size measurements remain. Core and full MasonKit are separate-host choices;
|
|
123
|
+
coinstallation and native ABI compatibility are not qualified. Windows is not
|
|
124
|
+
qualified by this prototype.
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import type { Color, CoreTypes } from '@nativescript/core';
|
|
2
|
+
import type { LengthPercentage } from '@nativescript/core/css/parser';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A CSS length. `px` is a CSS pixel — the same size as a dip, exactly as on the
|
|
7
|
+
* web — and a bare number is also dip. `dppx` is the escape hatch for a literal
|
|
8
|
+
* device pixel; note this differs from `@nativescript/core`, where `px` itself
|
|
9
|
+
* means a device pixel.
|
|
10
|
+
*/
|
|
11
|
+
export type Length = CoreTypes.dip | CoreTypes.LengthDipUnit | CoreTypes.LengthPxUnit | CoreTypes.LengthPercentUnit | `${number}px` | `${number}%` | `${number}dip` | `${number}dppx`;
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
export type LengthAuto = CoreTypes.dip | CoreTypes.LengthDipUnit | CoreTypes.LengthPxUnit | CoreTypes.LengthPercentUnit | 'auto' | `${number}px` | `${number}%` | `${number}dip` | `${number}dppx`;
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
export type DimensionKeyword = 'min-content' | 'max-content' | 'fit-content' | 'stretch' | 'content' | `fit-content(${string})`;
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
export type DimensionLength = LengthAuto | DimensionKeyword;
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
export type SizeLength = { width: Length; height: Length };
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
export type Position = 'static' | 'relative' | 'absolute' | 'fixed' | 'sticky';
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
export type Display = 'none' | 'flex' | 'grid' | 'block' | 'inline' | 'inline-block' | 'inline-flex' | 'inline-grid';
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
export type BoxSizing = 'border-box' | 'content-box';
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
export type Overflow = 'visible' | 'hidden' | 'scroll' | 'clip' | 'auto';
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
export type FlexWrap = 'nowrap' | 'no-wrap' | 'wrap' | 'wrap-reverse' | 'balance' | 'balance-reverse';
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
export type FlexDirection = 'column' | 'row' | 'column-reverse' | 'row-reverse';
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
export type GapTypeUnit = `px` | 'dip' | '%';
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
export type Gap = Length | `${string}${GapTypeUnit} ${string}${GapTypeUnit}`;
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
export type AlignItems = 'normal' | 'flex-start' | 'flex-end' | 'start' | 'end' | 'center' | 'baseline' | 'stretch';
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
export type AlignSelf = 'normal' | 'flex-start' | 'flex-end' | 'start' | 'end' | 'center' | 'baseline' | 'stretch';
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
export type AlignContent = 'normal' | 'flex-start' | 'flex-end' | 'start' | 'end' | 'center' | 'stretch' | 'space-between' | 'space-around' | 'space-evenly';
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
export type JustifyItems = AlignItems;
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
export type JustifySelf = AlignSelf;
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
export type JustifyContent = AlignContent;
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
export type GridAutoFlow = 'row' | 'column' | 'row dense' | 'column dense' | 'dense';
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
export type VerticalAlign = 'baseline' | 'sub' | 'super' | 'text-top' | 'text-bottom' | 'middle' | 'top' | 'bottom' | Length | number;
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
export type Float = 'left' | 'right' | 'none';
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
export type Clear = 'left' | 'right' | 'both' | 'none';
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
declare module '@nativescript/core/ui/styling/style' {
|
|
81
|
+
interface Style {
|
|
82
|
+
boxSizing: BoxSizing;
|
|
83
|
+
display: Display;
|
|
84
|
+
position: Position;
|
|
85
|
+
flexDirection: FlexDirection;
|
|
86
|
+
flexWrap: FlexWrap;
|
|
87
|
+
flex: string | 'auto' | 'none' | number | 'initial';
|
|
88
|
+
flexFlow: string;
|
|
89
|
+
minWidth: LengthAuto;
|
|
90
|
+
minHeight: LengthAuto;
|
|
91
|
+
width: DimensionLength;
|
|
92
|
+
height: DimensionLength;
|
|
93
|
+
maxWidth: LengthAuto;
|
|
94
|
+
maxHeight: LengthAuto;
|
|
95
|
+
left: LengthAuto;
|
|
96
|
+
right: LengthAuto;
|
|
97
|
+
top: LengthAuto;
|
|
98
|
+
bottom: LengthAuto;
|
|
99
|
+
gridGap: Gap;
|
|
100
|
+
gap: Gap;
|
|
101
|
+
rowGap: Length;
|
|
102
|
+
columnGap: Length;
|
|
103
|
+
aspectRatio: number;
|
|
104
|
+
flexBasis: LengthPercentage | DimensionKeyword | string | number;
|
|
105
|
+
alignItems: AlignItems;
|
|
106
|
+
alignSelf: AlignSelf;
|
|
107
|
+
alignContent: AlignContent;
|
|
108
|
+
justifyItems: JustifyItems;
|
|
109
|
+
justifySelf: JustifySelf;
|
|
110
|
+
justifyContent: JustifyContent;
|
|
111
|
+
gridAutoRows: string;
|
|
112
|
+
gridAutoColumns: string;
|
|
113
|
+
gridAutoFlow: GridAutoFlow;
|
|
114
|
+
gridRowGap: Gap;
|
|
115
|
+
gridColumnGap: Gap;
|
|
116
|
+
gridArea: string;
|
|
117
|
+
gridColumn: string;
|
|
118
|
+
gridColumnStart: string;
|
|
119
|
+
gridColumnEnd: string;
|
|
120
|
+
gridRow: string;
|
|
121
|
+
gridRowStart: string;
|
|
122
|
+
gridRowEnd: string;
|
|
123
|
+
gridTemplateRows: string;
|
|
124
|
+
gridTemplateColumns: string;
|
|
125
|
+
gridTemplateAreas: string;
|
|
126
|
+
textOverflow: 'clip' | 'ellipsis' | string;
|
|
127
|
+
textWrap: 'nowrap' | 'wrap' | 'balance';
|
|
128
|
+
textTransform: 'none' | 'capitalize' | 'uppercase' | 'lowercase';
|
|
129
|
+
overflow: Overflow | `${Overflow} ${Overflow}`;
|
|
130
|
+
overflowX: Overflow;
|
|
131
|
+
overflowY: Overflow;
|
|
132
|
+
scrollBarWidth: Length;
|
|
133
|
+
verticalAlign: VerticalAlign;
|
|
134
|
+
cornerShape: string;
|
|
135
|
+
cornerShapeTopLeft: string;
|
|
136
|
+
cornerShapeTopRight: string;
|
|
137
|
+
cornerShapeBottomRight: string;
|
|
138
|
+
cornerShapeBottomLeft: string;
|
|
139
|
+
objectPosition: string;
|
|
140
|
+
borderStyle: string;
|
|
141
|
+
borderLeftStyle: string;
|
|
142
|
+
borderRightStyle: string;
|
|
143
|
+
borderTopStyle: string;
|
|
144
|
+
borderBottomStyle: string;
|
|
145
|
+
borderImage: string;
|
|
146
|
+
fontStretch: string;
|
|
147
|
+
fontFeatureSettings: string;
|
|
148
|
+
wordSpacing: string;
|
|
149
|
+
hyphens: 'none' | 'manual' | 'auto';
|
|
150
|
+
textIndent: string;
|
|
151
|
+
lineClamp: number | 'none';
|
|
152
|
+
transformOrigin: string;
|
|
153
|
+
placeItems: string;
|
|
154
|
+
placeContent: string;
|
|
155
|
+
placeSelf: string;
|
|
156
|
+
listStyle: string;
|
|
157
|
+
marginInline: string;
|
|
158
|
+
marginBlock: string;
|
|
159
|
+
paddingInline: string;
|
|
160
|
+
paddingBlock: string;
|
|
161
|
+
insetInline: string;
|
|
162
|
+
insetBlock: string;
|
|
163
|
+
inlineSize: string;
|
|
164
|
+
blockSize: string;
|
|
165
|
+
writingMode: 'horizontal-tb' | 'vertical-rl' | 'vertical-lr';
|
|
166
|
+
unicodeBidi: 'normal' | 'embed' | 'bidi-override';
|
|
167
|
+
backdropFilter: string;
|
|
168
|
+
maskImage: string;
|
|
169
|
+
maskSize: string;
|
|
170
|
+
maskPosition: string;
|
|
171
|
+
maskRepeat: string;
|
|
172
|
+
maskOrigin: string;
|
|
173
|
+
maskClip: string;
|
|
174
|
+
maskMode: string;
|
|
175
|
+
maskComposite: string;
|
|
176
|
+
clipPath: string;
|
|
177
|
+
maskBorderSource: string;
|
|
178
|
+
maskBorderSlice: string;
|
|
179
|
+
maskBorderWidth: string;
|
|
180
|
+
maskBorderOutset: string;
|
|
181
|
+
maskBorderRepeat: string;
|
|
182
|
+
maskBorderMode: string;
|
|
183
|
+
caretColor: string | Color;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
export type ScrollBehavior = 'auto' | 'instant' | 'smooth';
|
|
189
|
+
|
|
190
|
+
export type ScrollLogicalPosition = 'start' | 'center' | 'end' | 'nearest';
|
|
191
|
+
|
|
192
|
+
export type BoxShadowRenderMode = 'auto' | 'render-node' | 'software';
|
package/mask.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/** What the encoder needs from the element's style. */
|
|
2
|
+
export interface WindowsMaskContext {
|
|
3
|
+
/** A CSS length (not a percentage) in DIPs, or undefined. */
|
|
4
|
+
length(token: string): number | undefined;
|
|
5
|
+
/** A CSS colour as 0xAARRGGBB, or null. */
|
|
6
|
+
color(value: string): number | null;
|
|
7
|
+
linear(value: string): {
|
|
8
|
+
angle: number;
|
|
9
|
+
corner?: [number, number];
|
|
10
|
+
offsets: number[];
|
|
11
|
+
colors: number[];
|
|
12
|
+
positions?: Array<number | null>;
|
|
13
|
+
lengths?: Array<number | null>;
|
|
14
|
+
} | null;
|
|
15
|
+
radial(value: string): {
|
|
16
|
+
cx: number;
|
|
17
|
+
cy: number;
|
|
18
|
+
rx: number;
|
|
19
|
+
ry: number;
|
|
20
|
+
offsets: number[];
|
|
21
|
+
colors: number[];
|
|
22
|
+
positions?: Array<number | null>;
|
|
23
|
+
lengths?: Array<number | null>;
|
|
24
|
+
circle?: number;
|
|
25
|
+
circleRadius?: number;
|
|
26
|
+
} | null;
|
|
27
|
+
/** A url() target as a path or data URI the native side can load. */
|
|
28
|
+
source(url: string): string;
|
|
29
|
+
}
|
|
30
|
+
/** background-origin / background-clip keywords; the CSS defaults are padding-box and border-box. */
|
|
31
|
+
export interface WindowsBackgroundBoxes {
|
|
32
|
+
origin?: string;
|
|
33
|
+
clip?: string;
|
|
34
|
+
}
|
|
35
|
+
/** The background-* longhands, each a comma-separated per-layer list. */
|
|
36
|
+
export interface WindowsBackgroundLonghands {
|
|
37
|
+
image: string;
|
|
38
|
+
size?: string;
|
|
39
|
+
position?: string;
|
|
40
|
+
repeat?: string;
|
|
41
|
+
origin?: string;
|
|
42
|
+
clip?: string;
|
|
43
|
+
attachment?: string;
|
|
44
|
+
blend?: string;
|
|
45
|
+
}
|
|
46
|
+
export declare const WINDOWS_MASK_PROPERTIES: ReadonlySet<string>;
|
|
47
|
+
export declare function encodeWindowsMask(_css: ReadonlyMap<string, string>, _ctx: WindowsMaskContext): string;
|
|
48
|
+
export declare function encodeWindowsBackground(_url: string, _size: string, _position: string, _repeat: string, _ctx: WindowsMaskContext, _boxes?: WindowsBackgroundBoxes): string;
|
|
49
|
+
export declare function encodeWindowsGradientBackground(_gradient: string, _size: string, _position: string, _repeat: string, _ctx: WindowsMaskContext, _boxes?: WindowsBackgroundBoxes): string;
|
|
50
|
+
export declare function encodeWindowsColorClip(_clip: string, _ctx: WindowsMaskContext): string;
|
|
51
|
+
export declare function needsWindowsBackgroundLayers(_css: WindowsBackgroundLonghands): boolean;
|
|
52
|
+
export declare function encodeWindowsBackgroundLayers(_css: WindowsBackgroundLonghands, _ctx: WindowsMaskContext): string;
|
|
53
|
+
export declare function hasCustomBackgroundBoxes(_boxes: WindowsBackgroundBoxes): boolean;
|
|
54
|
+
export declare function encodeWindowsBorderImage(_value: string, _ctx: WindowsMaskContext): string;
|
package/mask.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Windows only (mask.windows.ts); iOS and Android parse masks natively.
|
|
2
|
+
export const WINDOWS_MASK_PROPERTIES = new Set();
|
|
3
|
+
export function encodeWindowsMask(_css, _ctx) {
|
|
4
|
+
return '';
|
|
5
|
+
}
|
|
6
|
+
export function encodeWindowsBackground(_url, _size, _position, _repeat, _ctx, _boxes = {}) {
|
|
7
|
+
return '';
|
|
8
|
+
}
|
|
9
|
+
export function encodeWindowsGradientBackground(_gradient, _size, _position, _repeat, _ctx, _boxes = {}) {
|
|
10
|
+
return '';
|
|
11
|
+
}
|
|
12
|
+
export function encodeWindowsColorClip(_clip, _ctx) {
|
|
13
|
+
return '';
|
|
14
|
+
}
|
|
15
|
+
export function needsWindowsBackgroundLayers(_css) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
export function encodeWindowsBackgroundLayers(_css, _ctx) {
|
|
19
|
+
return '';
|
|
20
|
+
}
|
|
21
|
+
export function hasCustomBackgroundBoxes(_boxes) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
export function encodeWindowsBorderImage(_value, _ctx) {
|
|
25
|
+
return '';
|
|
26
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
const roots = new WeakMap();
|
|
2
|
+
function readInsets(root) {
|
|
3
|
+
const native = root?.getRootWindowInsets();
|
|
4
|
+
if (!native)
|
|
5
|
+
return null;
|
|
6
|
+
// AndroidX is already a native core dependency. Its systemBars type excludes IME,
|
|
7
|
+
// including on API 23-29 where raw systemWindowInsetBottom can contain the keyboard.
|
|
8
|
+
const compat = androidx.core.view.WindowInsetsCompat.toWindowInsetsCompat(native, root);
|
|
9
|
+
const types = androidx.core.view.WindowInsetsCompat.Type;
|
|
10
|
+
const insets = compat.getInsets(types.systemBars() | types.displayCutout());
|
|
11
|
+
const density = root.getResources().getDisplayMetrics().density;
|
|
12
|
+
return { top: insets.top / density, right: insets.right / density, bottom: insets.bottom / density, left: insets.left / density };
|
|
13
|
+
}
|
|
14
|
+
function observeRoot(root, changed) {
|
|
15
|
+
let observation = roots.get(root);
|
|
16
|
+
if (!observation) {
|
|
17
|
+
const callbacks = new Set();
|
|
18
|
+
let previous = JSON.stringify(readInsets(root));
|
|
19
|
+
const listener = new android.view.ViewTreeObserver.OnPreDrawListener({
|
|
20
|
+
onPreDraw() {
|
|
21
|
+
const next = JSON.stringify(readInsets(root));
|
|
22
|
+
if (next !== previous) {
|
|
23
|
+
previous = next;
|
|
24
|
+
for (const callback of Array.from(callbacks))
|
|
25
|
+
callback();
|
|
26
|
+
}
|
|
27
|
+
return true;
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
const observer = root.getViewTreeObserver();
|
|
31
|
+
observation = { callbacks, observer, listener };
|
|
32
|
+
roots.set(root, observation);
|
|
33
|
+
observer.addOnPreDrawListener(listener);
|
|
34
|
+
// Observe without replacing anyone's OnApplyWindowInsetsListener or consuming insets.
|
|
35
|
+
root.requestApplyInsets();
|
|
36
|
+
}
|
|
37
|
+
observation.callbacks.add(changed);
|
|
38
|
+
const current = observation;
|
|
39
|
+
return () => {
|
|
40
|
+
current.callbacks.delete(changed);
|
|
41
|
+
if (!current.callbacks.size) {
|
|
42
|
+
const observer = current.observer.isAlive() ? current.observer : root.getViewTreeObserver();
|
|
43
|
+
observer.removeOnPreDrawListener(current.listener);
|
|
44
|
+
roots.delete(root);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export function nativeCssEnvironmentSource(view) {
|
|
49
|
+
const rootOfView = () => view.nativeViewProtected?.getRootView();
|
|
50
|
+
return {
|
|
51
|
+
read: () => readInsets(rootOfView()),
|
|
52
|
+
subscribe(changed) {
|
|
53
|
+
let root;
|
|
54
|
+
let stop;
|
|
55
|
+
const select = () => {
|
|
56
|
+
const next = rootOfView();
|
|
57
|
+
if (next !== root) {
|
|
58
|
+
stop?.();
|
|
59
|
+
root = next;
|
|
60
|
+
stop = next ? observeRoot(next, changed) : undefined;
|
|
61
|
+
}
|
|
62
|
+
changed();
|
|
63
|
+
};
|
|
64
|
+
view.on('layoutChanged', select);
|
|
65
|
+
select();
|
|
66
|
+
return () => { view.off('layoutChanged', select); stop?.(); };
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
const windows = new WeakMap();
|
|
2
|
+
let ObserverClass;
|
|
3
|
+
function observeWindow(window, changed) {
|
|
4
|
+
let observation = windows.get(window);
|
|
5
|
+
if (!observation) {
|
|
6
|
+
if (!ObserverClass) {
|
|
7
|
+
var SafeAreaObserver = (function (_super) {
|
|
8
|
+
__extends(SafeAreaObserver, _super);
|
|
9
|
+
function SafeAreaObserver() {
|
|
10
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
11
|
+
}
|
|
12
|
+
SafeAreaObserver.prototype.safeAreaInsetsDidChange = function () { var _a; _super.prototype.safeAreaInsetsDidChange.call(this); (_a = this.changed) === null || _a === void 0 ? void 0 : _a.call(this); };
|
|
13
|
+
SafeAreaObserver.prototype.layoutSubviews = function () { var _a; _super.prototype.layoutSubviews.call(this); (_a = this.changed) === null || _a === void 0 ? void 0 : _a.call(this); };
|
|
14
|
+
return SafeAreaObserver;
|
|
15
|
+
}(UIView));
|
|
16
|
+
ObserverClass = SafeAreaObserver;
|
|
17
|
+
}
|
|
18
|
+
const observer = ObserverClass.new();
|
|
19
|
+
const callbacks = new Set();
|
|
20
|
+
observation = { callbacks, observer };
|
|
21
|
+
windows.set(window, observation);
|
|
22
|
+
observer.frame = window.bounds;
|
|
23
|
+
observer.autoresizingMask = 2 /* UIViewAutoresizing.FlexibleWidth */ | 16 /* UIViewAutoresizing.FlexibleHeight */;
|
|
24
|
+
observer.userInteractionEnabled = false;
|
|
25
|
+
observer.isAccessibilityElement = false;
|
|
26
|
+
observer.changed = () => { for (const callback of Array.from(callbacks))
|
|
27
|
+
callback(); };
|
|
28
|
+
window.addSubview(observer);
|
|
29
|
+
}
|
|
30
|
+
observation.callbacks.add(changed);
|
|
31
|
+
const current = observation;
|
|
32
|
+
return () => {
|
|
33
|
+
current.callbacks.delete(changed);
|
|
34
|
+
if (!current.callbacks.size) {
|
|
35
|
+
current.observer.changed = undefined;
|
|
36
|
+
current.observer.removeFromSuperview();
|
|
37
|
+
windows.delete(window);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export function nativeCssEnvironmentSource(view) {
|
|
42
|
+
const windowOfView = () => view.nativeViewProtected?.window;
|
|
43
|
+
return {
|
|
44
|
+
read() {
|
|
45
|
+
const insets = windowOfView()?.safeAreaInsets;
|
|
46
|
+
return insets ? { top: insets.top, right: insets.right, bottom: insets.bottom, left: insets.left } : null;
|
|
47
|
+
},
|
|
48
|
+
subscribe(changed) {
|
|
49
|
+
let window;
|
|
50
|
+
let stop;
|
|
51
|
+
const select = () => {
|
|
52
|
+
const next = windowOfView();
|
|
53
|
+
if (next !== window) {
|
|
54
|
+
stop?.();
|
|
55
|
+
window = next;
|
|
56
|
+
stop = next ? observeWindow(next, changed) : undefined;
|
|
57
|
+
}
|
|
58
|
+
changed();
|
|
59
|
+
};
|
|
60
|
+
view.on('layoutChanged', select);
|
|
61
|
+
select();
|
|
62
|
+
return () => { view.off('layoutChanged', select); stop?.(); };
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Independent Mason core bridge types
|
|
2
|
+
|
|
3
|
+
The runtime and plugin prototypes ship their own Android/iOS bridge declarations.
|
|
4
|
+
Their compiler inputs contain the standard NativeScript SDK types and core's
|
|
5
|
+
generated declarations, without full MasonKit native types. This is type/build
|
|
6
|
+
evidence; native ABI compatibility and application behavior have separate checks.
|
|
7
|
+
|
|
8
|
+
## Regenerate after changing a native host
|
|
9
|
+
|
|
10
|
+
Keep the generated `packages/nativescript-mason-core/typings/` files in Git so
|
|
11
|
+
ordinary JavaScript builds do not require native build tools. To update them,
|
|
12
|
+
first export both core native hosts and install the independent pinned SDK
|
|
13
|
+
tooling. Neither consumer preparation nor a consumer app build is required. Run this
|
|
14
|
+
target from the repository root under a native-build resource reservation:
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
pnpm exec nx run nativescript-mason-core:prepare.native.sdk
|
|
18
|
+
pnpm exec nx run nativescript-mason-core:generate.native.types
|
|
19
|
+
pnpm exec nx run nativescript-mason-core:verify.runtime
|
|
20
|
+
pnpm exec nx run nativescript-mason-core:verify
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Generation reads `MasonCore.aar` and the exported iOS Simulator framework directly.
|
|
24
|
+
It preserves SDK header discovery so inherited UIKit members are included, then
|
|
25
|
+
copies only MasonCore and its retained FontManager/SDWebImage declarations.
|
|
26
|
+
The manifest records native artifact hashes, generator provenance and every
|
|
27
|
+
declaration hash. Assembly rejects declarations for different native artifacts.
|
|
28
|
+
Consumers still supply NativeScript's platform ambient types and `skipLibCheck`.
|
|
29
|
+
|
|
30
|
+
## Android generator adaptation
|
|
31
|
+
|
|
32
|
+
NativeScript Android 9.1.1's declaration generator produces invalid TypeScript
|
|
33
|
+
for this core AAR: Kotlin parameter names can be invalid identifiers, ignored
|
|
34
|
+
generic types can leave unmatched brackets, and nested class namespaces can
|
|
35
|
+
have unmatched braces. Adding dependency JARs does not correct these syntax
|
|
36
|
+
errors. These are declaration-generation findings, not Android runtime failures.
|
|
37
|
+
|
|
38
|
+
The code-generation-only patch at
|
|
39
|
+
`tools/mason-core/patches/android-dts-generator.patch` applies to
|
|
40
|
+
[NativeScript/android-dts-generator at 5fcf6113](https://github.com/NativeScript/android-dts-generator/blob/5fcf611330bd9eb60d9bb45d5b37251980b127ab/dts-generator/src/main/java/com/telerik/dts/DtsApi.java).
|
|
41
|
+
It makes invalid parameter names positional, balances ignored generic types,
|
|
42
|
+
and emits complete nested namespace blocks. Generation verifies both the SDK
|
|
43
|
+
JAR and original source hashes, compiles the adapted class in an ignored staging
|
|
44
|
+
directory, and puts it before the unchanged SDK JAR on the generator classpath.
|
|
45
|
+
It does not modify the installed SDK or ship generator code in the plugin.
|
|
46
|
+
Review or remove this adaptation when adopting an upstream generator correction.
|
|
47
|
+
|
|
48
|
+
Generated files are parsed before use. The packed consumer checks native host
|
|
49
|
+
factories and rejects optional HTML APIs. Runtime compilation records its actual
|
|
50
|
+
input files and rejects full MasonKit declarations. The build-only Windows facade
|
|
51
|
+
is excluded from the archive; no Windows native host is qualified.
|