@nativescript/core 8.9.0-next-01-17-2025-12834437745 → 8.9.0-next-01-22-2025-12918162303
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/accessibility/accessibility-service.d.ts +10 -0
- package/accessibility/font-scale.d.ts +9 -0
- package/accessibility/index.d.ts +37 -0
- package/animation-frame/animation-native.d.ts +4 -0
- package/animation-frame/index.d.ts +17 -3
- package/application/application.d.ts +194 -0
- package/application/index.d.ts +2 -0
- package/application-settings/index.d.ts +70 -0
- package/cli-hooks/before-checkForChanges.js +60 -0
- package/cli-hooks/postinstall.js +2 -0
- package/cli-hooks/preuninstall.js +2 -0
- package/color/index.d.ts +206 -0
- package/connectivity/index.d.ts +52 -0
- package/css/css-tree-parser.js +21 -17
- package/css/lib/parse/index.js +602 -0
- package/css/package.json +36 -0
- package/css/reworkcss.d.ts +47 -0
- package/css/reworkcss.js +1 -0
- package/css-value/package.json +23 -0
- package/css-value/reworkcss-value.d.ts +8 -0
- package/css-value/reworkcss-value.js +113 -0
- package/debugger/css-agent.d.ts +59 -0
- package/debugger/devtools-elements.d.ts +23 -5
- package/debugger/dom-node.d.ts +23 -20
- package/fetch/index.js +539 -0
- package/file-system/file-system-access.d.ts +441 -0
- package/file-system/index.d.ts +370 -95
- package/fps-meter/fps-native.d.ts +24 -0
- package/fps-meter/index.d.ts +24 -7
- package/global-types.d.ts +393 -0
- package/globals/index.d.ts +4 -19
- package/http/http-request/index.d.ts +3 -0
- package/http/index.d.ts +149 -73
- package/image-asset/index.d.ts +17 -0
- package/image-source/index.d.ts +350 -0
- package/index.d.ts +24 -7
- package/js-libs/easysax/easysax.d.ts +8 -0
- package/js-libs/easysax/easysax.js +782 -0
- package/js-libs/easysax/package.json +35 -0
- package/matrix/index.d.ts +32 -5
- package/module-name-resolver/index.d.ts +21 -13
- package/module-name-resolver/qualifier-matcher/index.d.ts +12 -6
- package/package.json +1 -1
- package/platform/device/index.d.ts +70 -0
- package/platform/index.d.ts +26 -0
- package/platform/screen/index.d.ts +48 -0
- package/platforms/android/native-api-usage.json +32 -0
- package/platforms/android/res/values/ids.xml +4 -0
- package/platforms/android/widgets-release.aar +0 -0
- package/platforms/android/winter_tc-release.aar +0 -0
- package/platforms/ios/NSCWinterTC.xcframework/Info.plist +102 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64/NSCWinterTC.framework/Headers/NSCCrypto.h +79 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64/NSCWinterTC.framework/Headers/NSCWinterTC.h +20 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64/NSCWinterTC.framework/Headers/NSString+WinterTC.h +21 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64/NSCWinterTC.framework/Info.plist +0 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64/NSCWinterTC.framework/Modules/module.modulemap +6 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64/NSCWinterTC.framework/NSCWinterTC +0 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64/dSYMs/NSCWinterTC.framework.dSYM/Contents/Info.plist +20 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64/dSYMs/NSCWinterTC.framework.dSYM/Contents/Resources/DWARF/NSCWinterTC +0 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64/dSYMs/NSCWinterTC.framework.dSYM/Contents/Resources/Relocations/aarch64/NSCWinterTC.yml +40 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Headers/NSCCrypto.h +79 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Headers/NSCWinterTC.h +20 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Headers/NSString+WinterTC.h +21 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Modules/module.modulemap +6 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/NSCWinterTC +0 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Resources/Info.plist +52 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Versions/A/Headers/NSCCrypto.h +79 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Versions/A/Headers/NSCWinterTC.h +20 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Versions/A/Headers/NSString+WinterTC.h +21 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Versions/A/Modules/module.modulemap +6 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Versions/A/NSCWinterTC +0 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Versions/A/Resources/Info.plist +52 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Versions/Current/NSCWinterTC +0 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/NSCWinterTC.framework.dSYM/Contents/Info.plist +20 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/NSCWinterTC.framework.dSYM/Contents/Resources/DWARF/NSCWinterTC +0 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/NSCWinterTC.framework.dSYM/Contents/Resources/Relocations/aarch64/NSCWinterTC.yml +40 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/NSCWinterTC.framework.dSYM/Contents/Resources/Relocations/x86_64/NSCWinterTC.yml +40 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-simulator/NSCWinterTC.framework/Headers/NSCCrypto.h +79 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-simulator/NSCWinterTC.framework/Headers/NSCWinterTC.h +20 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-simulator/NSCWinterTC.framework/Headers/NSString+WinterTC.h +21 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-simulator/NSCWinterTC.framework/Info.plist +0 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-simulator/NSCWinterTC.framework/Modules/module.modulemap +6 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-simulator/NSCWinterTC.framework/NSCWinterTC +0 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-simulator/NSCWinterTC.framework/_CodeSignature/CodeResources +146 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-simulator/dSYMs/NSCWinterTC.framework.dSYM/Contents/Info.plist +20 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-simulator/dSYMs/NSCWinterTC.framework.dSYM/Contents/Resources/DWARF/NSCWinterTC +0 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-simulator/dSYMs/NSCWinterTC.framework.dSYM/Contents/Resources/Relocations/aarch64/NSCWinterTC.yml +40 -0
- package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-simulator/dSYMs/NSCWinterTC.framework.dSYM/Contents/Resources/Relocations/x86_64/NSCWinterTC.yml +40 -0
- package/platforms/ios/NSCWinterTC.xcframework/xros-arm64/NSCWinterTC.framework/Headers/NSCCrypto.h +79 -0
- package/platforms/ios/NSCWinterTC.xcframework/xros-arm64/NSCWinterTC.framework/Headers/NSCWinterTC.h +20 -0
- package/platforms/ios/NSCWinterTC.xcframework/xros-arm64/NSCWinterTC.framework/Headers/NSString+WinterTC.h +21 -0
- package/platforms/ios/NSCWinterTC.xcframework/xros-arm64/NSCWinterTC.framework/Info.plist +0 -0
- package/platforms/ios/NSCWinterTC.xcframework/xros-arm64/NSCWinterTC.framework/Modules/module.modulemap +6 -0
- package/platforms/ios/NSCWinterTC.xcframework/xros-arm64/NSCWinterTC.framework/NSCWinterTC +0 -0
- package/platforms/ios/NSCWinterTC.xcframework/xros-arm64/dSYMs/NSCWinterTC.framework.dSYM/Contents/Info.plist +20 -0
- package/platforms/ios/NSCWinterTC.xcframework/xros-arm64/dSYMs/NSCWinterTC.framework.dSYM/Contents/Resources/DWARF/NSCWinterTC +0 -0
- package/platforms/ios/NSCWinterTC.xcframework/xros-arm64/dSYMs/NSCWinterTC.framework.dSYM/Contents/Resources/Relocations/aarch64/NSCWinterTC.yml +40 -0
- package/platforms/ios/NSCWinterTC.xcframework/xros-arm64_x86_64-simulator/NSCWinterTC.framework/Headers/NSCCrypto.h +79 -0
- package/platforms/ios/NSCWinterTC.xcframework/xros-arm64_x86_64-simulator/NSCWinterTC.framework/Headers/NSCWinterTC.h +20 -0
- package/platforms/ios/NSCWinterTC.xcframework/xros-arm64_x86_64-simulator/NSCWinterTC.framework/Headers/NSString+WinterTC.h +21 -0
- package/platforms/ios/NSCWinterTC.xcframework/xros-arm64_x86_64-simulator/NSCWinterTC.framework/Info.plist +0 -0
- package/platforms/ios/NSCWinterTC.xcframework/xros-arm64_x86_64-simulator/NSCWinterTC.framework/Modules/module.modulemap +6 -0
- package/platforms/ios/NSCWinterTC.xcframework/xros-arm64_x86_64-simulator/NSCWinterTC.framework/NSCWinterTC +0 -0
- package/platforms/ios/NSCWinterTC.xcframework/xros-arm64_x86_64-simulator/NSCWinterTC.framework/_CodeSignature/CodeResources +146 -0
- package/platforms/ios/NSCWinterTC.xcframework/xros-arm64_x86_64-simulator/dSYMs/NSCWinterTC.framework.dSYM/Contents/Info.plist +20 -0
- package/platforms/ios/NSCWinterTC.xcframework/xros-arm64_x86_64-simulator/dSYMs/NSCWinterTC.framework.dSYM/Contents/Resources/DWARF/NSCWinterTC +0 -0
- package/platforms/ios/NSCWinterTC.xcframework/xros-arm64_x86_64-simulator/dSYMs/NSCWinterTC.framework.dSYM/Contents/Resources/Relocations/aarch64/NSCWinterTC.yml +40 -0
- package/platforms/ios/NSCWinterTC.xcframework/xros-arm64_x86_64-simulator/dSYMs/NSCWinterTC.framework.dSYM/Contents/Resources/Relocations/x86_64/NSCWinterTC.yml +40 -0
- package/platforms/ios/TNSWidgets.xcframework/Info.plist +102 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers/NSCCrypto.h +60 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers/NSData+Async.h +24 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers/NSFileHandle+Async.h +22 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers/NSString+Async.h +25 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers/TNSLabel.h +16 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers/TNSProcess.h +29 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers/TNSWidgets.h +25 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers/UIImage+TNSBlocks.h +26 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers/UIView+PassThroughParent.h +17 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Info.plist +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Modules/module.modulemap +6 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/PrivateHeaders/NSObject+Swizzling.h +17 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/PrivateHeaders/UIView+PropertyBag.h +18 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Info.plist +20 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +82 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/NSCCrypto.h +60 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/NSData+Async.h +24 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/NSFileHandle+Async.h +22 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/NSString+Async.h +25 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/TNSLabel.h +16 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/TNSProcess.h +29 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/TNSWidgets.h +25 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/UIImage+TNSBlocks.h +26 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/UIView+PassThroughParent.h +17 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Modules/module.modulemap +6 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/PrivateHeaders/NSObject+Swizzling.h +17 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/PrivateHeaders/UIView+PropertyBag.h +18 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Resources/Info.plist +52 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/NSCCrypto.h +60 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/NSData+Async.h +24 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/NSFileHandle+Async.h +22 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/NSString+Async.h +25 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/TNSLabel.h +16 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/TNSProcess.h +29 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/TNSWidgets.h +25 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/UIImage+TNSBlocks.h +26 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/UIView+PassThroughParent.h +17 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Modules/module.modulemap +6 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/PrivateHeaders/NSObject+Swizzling.h +17 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/PrivateHeaders/UIView+PropertyBag.h +18 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Resources/Info.plist +52 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/TNSWidgets.framework.dSYM/Contents/Info.plist +20 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +82 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/x86_64/TNSWidgets.yml +82 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSCCrypto.h +60 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSData+Async.h +24 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSFileHandle+Async.h +22 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSString+Async.h +25 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/TNSLabel.h +16 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/TNSProcess.h +29 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/TNSWidgets.h +25 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/UIImage+TNSBlocks.h +26 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/UIView+PassThroughParent.h +17 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Info.plist +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Modules/module.modulemap +6 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/PrivateHeaders/NSObject+Swizzling.h +17 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/PrivateHeaders/UIView+PropertyBag.h +18 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/_CodeSignature/CodeResources +223 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Info.plist +20 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +82 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/x86_64/TNSWidgets.yml +82 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/NSCCrypto.h +60 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/NSData+Async.h +24 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/NSFileHandle+Async.h +22 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/NSString+Async.h +25 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/TNSLabel.h +16 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/TNSProcess.h +29 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/TNSWidgets.h +25 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/UIImage+TNSBlocks.h +26 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/UIView+PassThroughParent.h +17 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Info.plist +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Modules/module.modulemap +6 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/PrivateHeaders/NSObject+Swizzling.h +17 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/PrivateHeaders/UIView+PropertyBag.h +18 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Info.plist +20 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +82 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSCCrypto.h +60 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSData+Async.h +24 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSFileHandle+Async.h +22 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSString+Async.h +25 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/TNSLabel.h +16 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/TNSProcess.h +29 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/TNSWidgets.h +25 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/UIImage+TNSBlocks.h +26 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/UIView+PassThroughParent.h +17 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Info.plist +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Modules/module.modulemap +6 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/PrivateHeaders/NSObject+Swizzling.h +17 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/PrivateHeaders/UIView+PropertyBag.h +18 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/_CodeSignature/CodeResources +223 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Info.plist +20 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +82 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/x86_64/TNSWidgets.yml +82 -0
- package/platforms/ios/native-api-usage.json +41 -0
- package/platforms/ios/src/NativeScriptEmbedder.h +31 -0
- package/platforms/ios/src/NativeScriptEmbedder.m +43 -0
- package/platforms/ios/src/NativeScriptMainWindow.swift +196 -0
- package/platforms/ios/src/NativeScriptUtils.h +16 -0
- package/platforms/ios/src/NativeScriptUtils.m +137 -0
- package/platforms/ios/src/UIView+NativeScript.h +15 -0
- package/platforms/ios/src/UIView+NativeScript.m +148 -0
- package/platforms/ios/src/module.modulemap +14 -0
- package/platforms/ios/typings/objc!MaterialComponents.d.ts +808 -0
- package/platforms/ios/typings/objc!NativeScriptUtils.d.ts +18 -0
- package/profiling/index.d.ts +153 -26
- package/references.d.ts +10 -0
- package/text/formatted-string.d.ts +1 -1
- package/text/index.d.ts +36 -0
- package/text/span.d.ts +1 -1
- package/timer/index.d.ts +27 -0
- package/trace/index.d.ts +131 -105
- package/ui/action-bar/index.d.ts +304 -0
- package/ui/activity-indicator/index.d.ts +25 -0
- package/ui/animation/index.d.ts +139 -0
- package/ui/animation/keyframe-animation.d.ts +118 -67
- package/ui/builder/binding-builder.d.ts +15 -12
- package/ui/builder/index.d.ts +69 -27
- package/ui/button/index.d.ts +50 -0
- package/ui/content-view/index.d.ts +11 -21
- package/ui/core/control-state-change/index.d.ts +17 -0
- package/ui/core/view/index.d.ts +1216 -0
- package/ui/core/view/view-helper/index.d.ts +76 -0
- package/ui/core/weak-event-listener/index.d.ts +18 -2
- package/ui/date-picker/index.d.ts +95 -0
- package/ui/dialogs/index.d.ts +311 -0
- package/ui/editable-text-base/index.d.ts +142 -0
- package/ui/embedding/index.d.ts +10 -0
- package/ui/frame/fragment.d.ts +5 -0
- package/ui/frame/fragment.transitions.d.ts +43 -0
- package/ui/frame/frame-common.d.ts +1 -0
- package/ui/frame/frame-common.js +6 -0
- package/ui/frame/frame-common.js.map +1 -1
- package/ui/frame/index.android.d.ts +1 -0
- package/ui/frame/index.android.js +12 -15
- package/ui/frame/index.android.js.map +1 -1
- package/ui/frame/index.d.ts +590 -0
- package/ui/frame/index.ios.js +13 -0
- package/ui/frame/index.ios.js.map +1 -1
- package/ui/frame/transition-definitions.android.d.ts +54 -0
- package/ui/gestures/index.d.ts +59 -0
- package/ui/html-view/index.d.ts +41 -0
- package/ui/image/index.d.ts +119 -0
- package/ui/image/symbol-effects.d.ts +13 -0
- package/ui/image-cache/index.d.ts +147 -0
- package/ui/label/index.d.ts +25 -0
- package/ui/layouts/absolute-layout/index.d.ts +42 -0
- package/ui/layouts/dock-layout/index.d.ts +39 -0
- package/ui/layouts/flexbox-layout/index.d.ts +98 -0
- package/ui/layouts/grid-layout/index.d.ts +201 -0
- package/ui/layouts/index.d.ts +1 -2
- package/ui/layouts/layout-base.d.ts +119 -0
- package/ui/layouts/root-layout/index.d.ts +48 -0
- package/ui/layouts/stack-layout/index.d.ts +22 -0
- package/ui/layouts/wrap-layout/index.d.ts +51 -0
- package/ui/list-picker/index.d.ts +43 -0
- package/ui/list-view/index.d.ts +232 -0
- package/ui/page/index.d.ts +241 -0
- package/ui/placeholder/index.d.ts +46 -8
- package/ui/progress/index.d.ts +50 -0
- package/ui/scroll-view/index.d.ts +99 -0
- package/ui/search-bar/index.d.ts +103 -0
- package/ui/segmented-bar/index.d.ts +122 -0
- package/ui/slider/index.d.ts +99 -0
- package/ui/styling/background.d.ts +95 -0
- package/ui/styling/converters.d.ts +2 -2
- package/ui/styling/font.d.ts +62 -0
- package/ui/styling/style-properties.d.ts +101 -81
- package/ui/styling/style-scope.d.ts +48 -79
- package/ui/switch/index.d.ts +46 -0
- package/ui/tab-view/index.d.ts +213 -0
- package/ui/text-base/formatted-string.d.ts +97 -36
- package/ui/text-base/index.d.ts +208 -0
- package/ui/text-base/span.d.ts +111 -36
- package/ui/text-field/index.d.ts +54 -0
- package/ui/text-view/index.d.ts +35 -0
- package/ui/time-picker/index.d.ts +107 -0
- package/ui/transition/fade-transition.d.ts +3 -0
- package/ui/transition/flip-transition.d.ts +5 -0
- package/ui/transition/index.d.ts +59 -0
- package/ui/transition/modal-transition.d.ts +2 -0
- package/ui/transition/page-transition.d.ts +4 -0
- package/ui/transition/shared-transition-helper.d.ts +14 -0
- package/ui/transition/slide-transition.d.ts +5 -0
- package/ui/utils.d.ts +44 -0
- package/ui/web-view/index.d.ts +142 -0
- package/utils/constants.d.ts +1 -0
- package/utils/debug.d.ts +61 -17
- package/utils/index.d.ts +183 -0
- package/utils/layout-helper/index.d.ts +82 -0
- package/utils/lazy.d.ts +5 -0
- package/utils/macrotask-scheduler.d.ts +5 -1
- package/utils/mainthread-helper.d.ts +16 -0
- package/utils/native-helper.d.ts +280 -0
- package/utils/types.d.ts +115 -23
- package/utils/typescript-utils.d.ts +6 -0
- package/xml/index.d.ts +105 -44
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import SwiftUI
|
|
2
|
+
import NativeScriptEmbedder
|
|
3
|
+
import UIKit
|
|
4
|
+
|
|
5
|
+
// Ensure runtime phases are called only once per app lifecycle
|
|
6
|
+
// In multi-scene apps, we need to ensure runtime doesn't reinit alongside main window
|
|
7
|
+
// For example, if @State is used to drive @Environment at the root level, we need to ensure
|
|
8
|
+
// a rerender of the main body doesn't cause runtime to cycle again
|
|
9
|
+
var hasMainInit = false
|
|
10
|
+
var hasMainBoot = false
|
|
11
|
+
var hasMainSetMainScene = false
|
|
12
|
+
|
|
13
|
+
@available(iOS 14.0, *)
|
|
14
|
+
struct NativeScriptMainWindow: Scene {
|
|
15
|
+
|
|
16
|
+
#if os(visionOS)
|
|
17
|
+
// Environment control
|
|
18
|
+
@Environment(\.openWindow) private var openWindow
|
|
19
|
+
@Environment(\.dismissWindow) private var dismissWindow
|
|
20
|
+
@Environment(\.openImmersiveSpace) private var openImmersiveSpace
|
|
21
|
+
@Environment(\.dismissImmersiveSpace) private var dismissImmersiveSpace
|
|
22
|
+
#endif
|
|
23
|
+
|
|
24
|
+
var body: some Scene {
|
|
25
|
+
#if os(visionOS)
|
|
26
|
+
// windowStyle is only supported on visionOS
|
|
27
|
+
WindowGroup {
|
|
28
|
+
NativeScriptAppView(found: { windowScene in
|
|
29
|
+
if (!hasMainSetMainScene) {
|
|
30
|
+
hasMainSetMainScene = true
|
|
31
|
+
NativeScriptEmbedder.sharedInstance().setWindowScene(windowScene)
|
|
32
|
+
}
|
|
33
|
+
}).onAppear {
|
|
34
|
+
// print("NativeScriptAppView onAppear")
|
|
35
|
+
if (!hasMainBoot) {
|
|
36
|
+
hasMainBoot = true
|
|
37
|
+
DispatchQueue.main.async {
|
|
38
|
+
NativeScriptEmbedder.boot()
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}.onReceive(NotificationCenter.default
|
|
42
|
+
.publisher(for: NSNotification.Name("NativeScriptWindowOpen")), perform: { obj in
|
|
43
|
+
let info = parseWindowInfo(obj: obj)
|
|
44
|
+
let id = info.keys.first
|
|
45
|
+
Task {
|
|
46
|
+
if (info[id!]!) {
|
|
47
|
+
await openImmersiveSpace(id: id!)
|
|
48
|
+
} else {
|
|
49
|
+
openWindow(id: id!)
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}).onReceive(NotificationCenter.default
|
|
53
|
+
.publisher(for: NSNotification.Name("NativeScriptWindowClose")), perform: { obj in
|
|
54
|
+
let info = parseWindowInfo(obj: obj)
|
|
55
|
+
let id = info.keys.first
|
|
56
|
+
Task {
|
|
57
|
+
if (info[id!]!) {
|
|
58
|
+
await dismissImmersiveSpace()
|
|
59
|
+
} else {
|
|
60
|
+
dismissWindow(id: id!)
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
.onOpenURL { (url) in
|
|
65
|
+
NotificationCenter.default.post(name: Notification.Name("NativeScriptOpenURL"), object: nil, userInfo: ["url": url.absoluteString ])
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
.windowStyle(.plain)
|
|
69
|
+
#else
|
|
70
|
+
WindowGroup {
|
|
71
|
+
NativeScriptAppView(found: { windowScene in
|
|
72
|
+
NativeScriptEmbedder.sharedInstance().setWindowScene(windowScene)
|
|
73
|
+
}).onAppear {
|
|
74
|
+
// print("NativeScriptAppView onAppear")
|
|
75
|
+
DispatchQueue.main.async {
|
|
76
|
+
NativeScriptEmbedder.boot()
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
#endif
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
init() {
|
|
85
|
+
if (!hasMainInit) {
|
|
86
|
+
hasMainInit = true
|
|
87
|
+
NativeScriptViewFactory.initShared()
|
|
88
|
+
NativeScriptEmbedder.sharedInstance().setDelegate(NativeScriptViewFactory.shared)
|
|
89
|
+
NativeScriptEmbedder.setup()
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
#if os(visionOS)
|
|
94
|
+
func parseWindowInfo(obj: Notification, close: Bool = false) -> [String:Bool] {
|
|
95
|
+
if let userInfo = obj.userInfo {
|
|
96
|
+
var id: String = ""
|
|
97
|
+
var isImmersive = false
|
|
98
|
+
for (key, value) in userInfo {
|
|
99
|
+
let k = key as! String
|
|
100
|
+
if (k == "type") {
|
|
101
|
+
id = value as! String
|
|
102
|
+
} else if (k == "isImmersive") {
|
|
103
|
+
isImmersive = value as! Bool
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return [id: isImmersive]
|
|
107
|
+
|
|
108
|
+
}
|
|
109
|
+
return ["_": false]
|
|
110
|
+
}
|
|
111
|
+
#endif
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@available(iOS 13.0, *)
|
|
115
|
+
struct NativeScriptAppView: UIViewRepresentable {
|
|
116
|
+
/// A closure that's called when the window is found.
|
|
117
|
+
var found: ((UIWindowScene?) -> Void)
|
|
118
|
+
|
|
119
|
+
func makeUIView(context: Context) -> UIView {
|
|
120
|
+
// print("NativeScriptAppView makeUIView")
|
|
121
|
+
var window: UIWindow? {
|
|
122
|
+
guard let scene = UIApplication.shared.connectedScenes.first,
|
|
123
|
+
let windowSceneDelegate = scene.delegate as? UIWindowSceneDelegate,
|
|
124
|
+
let window = windowSceneDelegate.window else {
|
|
125
|
+
return nil
|
|
126
|
+
}
|
|
127
|
+
return window
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
DispatchQueue.main.async {
|
|
131
|
+
found(window?.windowScene)
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return NativeScriptViewFactory.app!.view
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
func updateUIView(_ uiView: UIView, context: Context) {
|
|
138
|
+
// print("NativeScriptAppView updateUIView")
|
|
139
|
+
// could update data through the controller
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
@available(iOS 13.0, *)
|
|
144
|
+
@objc public class NativeScriptViewFactory: NSObject, NativeScriptEmbedderDelegate {
|
|
145
|
+
@objc static var shared: NativeScriptViewFactory?
|
|
146
|
+
@objc static var app: NativeScriptContainerCtrl?
|
|
147
|
+
|
|
148
|
+
// holds key/value map of views for lifecycle handling
|
|
149
|
+
@objc public var views: NSMutableDictionary?
|
|
150
|
+
|
|
151
|
+
// provided by NativeScript to coordinate view lifecycle
|
|
152
|
+
@objc public var viewCreator: ((String) -> Void)? = nil
|
|
153
|
+
@objc public var viewDestroyer: ((String) -> Void)? = nil
|
|
154
|
+
|
|
155
|
+
// get or create (if needed) NativeScript views to represent in SwiftUI
|
|
156
|
+
@objc public func getViewById(_ id: String) -> UIView {
|
|
157
|
+
let vc = views!.object(forKey: id) as? UIView
|
|
158
|
+
if (vc == nil) {
|
|
159
|
+
// create the NativeScript view
|
|
160
|
+
viewCreator!(id)
|
|
161
|
+
}
|
|
162
|
+
return views!.object(forKey: id) as! UIView
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
@available(iOS 15.0, *)
|
|
166
|
+
@objc public static func getKeyWindow() -> UIWindow? {
|
|
167
|
+
return UIApplication
|
|
168
|
+
.shared
|
|
169
|
+
.connectedScenes
|
|
170
|
+
.compactMap { ($0 as? UIWindowScene)?.keyWindow }
|
|
171
|
+
.last
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
@objc public static func initShared() {
|
|
175
|
+
if (NativeScriptViewFactory.shared == nil) {
|
|
176
|
+
NativeScriptViewFactory.app = NativeScriptContainerCtrl()
|
|
177
|
+
NativeScriptViewFactory.shared = NativeScriptViewFactory()
|
|
178
|
+
NativeScriptViewFactory.shared!.views = NSMutableDictionary()
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
public func presentNativeScriptApp(_ vc: UIViewController!) -> Any! {
|
|
183
|
+
vc.view.frame = NativeScriptViewFactory.app!.view.bounds
|
|
184
|
+
vc.view.autoresizingMask = [.flexibleWidth, .flexibleHeight]
|
|
185
|
+
NativeScriptViewFactory.app!.addChild(vc)
|
|
186
|
+
NativeScriptViewFactory.app!.view.addSubview(vc.view)
|
|
187
|
+
vc.didMove(toParent: NativeScriptViewFactory.app)
|
|
188
|
+
return NativeScriptViewFactory.app
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// UIViewController
|
|
193
|
+
@objc public class NativeScriptContainerCtrl: UIViewController {
|
|
194
|
+
// allow NativeScript to override updateData for custom handling
|
|
195
|
+
@objc public var updateData: ((_ data: NSMutableDictionary) -> Void)? = nil
|
|
196
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// NativeScriptUtils.h
|
|
3
|
+
//
|
|
4
|
+
// Created by Nathan Walker on 2/02/2022.
|
|
5
|
+
#include <UIKit/UIKit.h>
|
|
6
|
+
|
|
7
|
+
@interface NativeScriptUtils : NSObject
|
|
8
|
+
|
|
9
|
+
+(UIFont*) getSystemFont:(CGFloat)size weight:(UIFontWeight)weight italic:(BOOL)italic symbolicTraits:(UIFontDescriptorSymbolicTraits)symbolicTraits;
|
|
10
|
+
+(UIFont*) createUIFont:(NSDictionary*)font;
|
|
11
|
+
+(NSMutableAttributedString*)createMutableStringWithDetails:(NSDictionary*)details;
|
|
12
|
+
+(NSMutableAttributedString*)createMutableStringForSpan:(NSString*)text font:(UIFont*)font color:(UIColor*)color backgroundColor:(UIColor*)backgroundColor textDecoration:(NSString*)textDecoration baselineOffset:(CGFloat)baselineOffset;
|
|
13
|
+
+(UIImage*)scaleImage:(UIImage*)image width:(CGFloat)width height:(CGFloat)height scaleFactor:(CGFloat)scaleFactor;
|
|
14
|
+
+(NSData*)getImageData:(UIImage*)image format:(NSString*)format quality:(CGFloat)quality;
|
|
15
|
+
|
|
16
|
+
@end
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
#import "NativeScriptUtils.h"
|
|
2
|
+
|
|
3
|
+
@implementation NativeScriptUtils
|
|
4
|
+
|
|
5
|
+
+(UIFont*) getSystemFont:(CGFloat)size weight:(UIFontWeight)weight italic:(BOOL)italic symbolicTraits:(UIFontDescriptorSymbolicTraits)symbolicTraits {
|
|
6
|
+
UIFont *result = [UIFont systemFontOfSize:size weight:weight];
|
|
7
|
+
if (italic) {
|
|
8
|
+
result = [UIFont fontWithDescriptor:[result.fontDescriptor fontDescriptorWithSymbolicTraits:symbolicTraits] size:size];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
return result;
|
|
12
|
+
}
|
|
13
|
+
+(UIFont*) createUIFont:(NSDictionary*)font {
|
|
14
|
+
UIFont *result;
|
|
15
|
+
|
|
16
|
+
CGFloat size = [[font valueForKey:@"fontSize"] floatValue];
|
|
17
|
+
|
|
18
|
+
UIFontDescriptorSymbolicTraits symbolicTraits = 0;
|
|
19
|
+
if ([[font valueForKey:@"isBold"] boolValue]) {
|
|
20
|
+
symbolicTraits = symbolicTraits | UIFontDescriptorTraitBold;
|
|
21
|
+
}
|
|
22
|
+
if ([[font valueForKey:@"isItalic"] boolValue]) {
|
|
23
|
+
symbolicTraits = symbolicTraits | UIFontDescriptorTraitItalic;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
NSDictionary *fontDescriptorTraits = @{
|
|
27
|
+
UIFontSymbolicTrait : @(symbolicTraits),
|
|
28
|
+
UIFontWeightTrait : [font valueForKey:@"fontWeight"]
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
for (NSString *family in [NSArray arrayWithArray:[font valueForKey:@"fontFamily"]]) {
|
|
32
|
+
NSString *fontFamily = family;
|
|
33
|
+
if ([family.lowercaseString isEqualToString:@"serif"]) {
|
|
34
|
+
fontFamily = @"Times New Roman";
|
|
35
|
+
} else if ([family.lowercaseString isEqualToString:@"monospace"]) {
|
|
36
|
+
fontFamily = @"Courier New";
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (!fontFamily || [fontFamily isEqualToString:@"sans-serif"] || [fontFamily isEqualToString:@"system"]) {
|
|
40
|
+
result = [NativeScriptUtils getSystemFont:size weight:(UIFontWeight)[[font valueForKey:@"fontWeight"] floatValue] italic:[[font valueForKey:@"isItalic"] boolValue] symbolicTraits:symbolicTraits];
|
|
41
|
+
break;
|
|
42
|
+
} else {
|
|
43
|
+
UIFontDescriptor *descriptor = [UIFontDescriptor fontDescriptorWithFontAttributes:@{
|
|
44
|
+
UIFontDescriptorFamilyAttribute: fontFamily,
|
|
45
|
+
UIFontDescriptorTraitsAttribute: fontDescriptorTraits
|
|
46
|
+
}];
|
|
47
|
+
|
|
48
|
+
result = [UIFont fontWithDescriptor:descriptor size:size];
|
|
49
|
+
|
|
50
|
+
BOOL actualItalic = result.fontDescriptor.symbolicTraits & UIFontDescriptorTraitItalic;
|
|
51
|
+
if ([[font valueForKey:@"isItalic"] boolValue] && !actualItalic) {
|
|
52
|
+
#if TARGET_OS_MACCATALYST
|
|
53
|
+
#else
|
|
54
|
+
// The font we got is not actually italic so emulate that with a matrix
|
|
55
|
+
result = [UIFont fontWithDescriptor:[descriptor fontDescriptorWithMatrix:CGAffineTransformMake(1, 0, 0.2, 1, 0, 0)] size:size];
|
|
56
|
+
#endif
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Check if the resolved font has the correct font-family
|
|
60
|
+
// If not - fallback to the next font-family
|
|
61
|
+
if ([result.familyName isEqualToString:fontFamily]) {
|
|
62
|
+
break;
|
|
63
|
+
} else {
|
|
64
|
+
result = nil;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Couldn't resolve font - fallback to the system font
|
|
70
|
+
if (result == nil) {
|
|
71
|
+
result = [NativeScriptUtils getSystemFont:size weight:(UIFontWeight)[[font valueForKey:@"fontWeight"] floatValue] italic:[[font valueForKey:@"isItalic"] boolValue] symbolicTraits:symbolicTraits];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return result;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
+(NSMutableAttributedString*)createMutableStringWithDetails:(NSDictionary*)details {
|
|
78
|
+
NSMutableAttributedString *mas = [[NSMutableAttributedString alloc] init];
|
|
79
|
+
for (NSDictionary *detail in [NSArray arrayWithArray:[details valueForKey:@"spans"]]) {
|
|
80
|
+
NSMutableAttributedString *attrString = [NativeScriptUtils createMutableStringForSpan:[detail objectForKey:@"text"] font:[detail objectForKey:@"iosFont"] color:[detail objectForKey:@"color"] backgroundColor:[detail objectForKey:@"backgroundColor"] textDecoration:[detail objectForKey:@"textDecoration"] baselineOffset:[[detail valueForKey:@"baselineOffset"] floatValue]];
|
|
81
|
+
[mas insertAttributedString:attrString atIndex:[[detail valueForKey:@"index"] intValue]];
|
|
82
|
+
}
|
|
83
|
+
return mas;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
+(NSMutableAttributedString*)createMutableStringForSpan:(NSString*)text font:(UIFont*)font color:(UIColor*)color backgroundColor:(UIColor*)backgroundColor textDecoration:(NSString*)textDecoration baselineOffset:(CGFloat)baselineOffset {
|
|
87
|
+
NSMutableDictionary *attrDict = [[NSMutableDictionary alloc] init];
|
|
88
|
+
attrDict[NSFontAttributeName] = font;
|
|
89
|
+
|
|
90
|
+
if (color != nil) {
|
|
91
|
+
attrDict[NSForegroundColorAttributeName] = color;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (backgroundColor != nil) {
|
|
95
|
+
attrDict[NSBackgroundColorAttributeName] = backgroundColor;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (textDecoration != nil) {
|
|
99
|
+
if ([textDecoration rangeOfString:@"underline"].location != NSNotFound) {
|
|
100
|
+
attrDict[NSUnderlineStyleAttributeName] = [NSNumber numberWithInt:NSUnderlineStyleSingle];
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if ([textDecoration rangeOfString:@"line-through"].location != NSNotFound) {
|
|
104
|
+
attrDict[NSStrikethroughStyleAttributeName] = [NSNumber numberWithInt:NSUnderlineStyleSingle];
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
attrDict[NSBaselineOffsetAttributeName] = [NSNumber numberWithInt:baselineOffset];
|
|
109
|
+
|
|
110
|
+
return [[NSMutableAttributedString alloc] initWithString:text attributes:attrDict];
|
|
111
|
+
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
+(UIImage*)scaleImage:(UIImage*)image width:(CGFloat)width height:(CGFloat)height scaleFactor:(CGFloat)scaleFactor {
|
|
115
|
+
UIImage *resultImage;
|
|
116
|
+
@autoreleasepool {
|
|
117
|
+
UIGraphicsBeginImageContextWithOptions(CGSizeMake(width, height), NO, scaleFactor);
|
|
118
|
+
[image drawInRect:CGRectMake(0, 0, width, height)];
|
|
119
|
+
resultImage = UIGraphicsGetImageFromCurrentImageContext();
|
|
120
|
+
UIGraphicsEndImageContext();
|
|
121
|
+
}
|
|
122
|
+
return resultImage;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
+(NSData*)getImageData:(UIImage*)image format:(NSString*)format quality:(CGFloat)quality {
|
|
126
|
+
NSData *data;
|
|
127
|
+
@autoreleasepool {
|
|
128
|
+
if ([format.lowercaseString isEqualToString:@"png"]) {
|
|
129
|
+
data = UIImagePNGRepresentation(image);
|
|
130
|
+
} else {
|
|
131
|
+
data = UIImageJPEGRepresentation(image, quality);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return data;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
@end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//
|
|
2
|
+
// UIView+NativeScript.h
|
|
3
|
+
//
|
|
4
|
+
// Created by Nathan Walker on 2/02/2022.
|
|
5
|
+
#include <UIKit/UIKit.h>
|
|
6
|
+
|
|
7
|
+
@interface UIView (NativeScript)
|
|
8
|
+
|
|
9
|
+
- (void)nativeScriptSetTextDecorationAndTransform:(NSString*)text textDecoration:(NSString*)textDecoration letterSpacing:(CGFloat)letterSpacing lineHeight:(CGFloat)lineHeight;
|
|
10
|
+
|
|
11
|
+
-(void)nativeScriptSetFormattedTextDecorationAndTransform:(NSDictionary*)details letterSpacing:(CGFloat)letterSpacing lineHeight:(CGFloat)lineHeight;
|
|
12
|
+
|
|
13
|
+
-(void)nativeScriptSetFormattedTextStroke:(CGFloat)width color:(UIColor*)color;
|
|
14
|
+
|
|
15
|
+
@end
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
#import <UIKit/UIKit.h>
|
|
2
|
+
#import "UIView+NativeScript.h"
|
|
3
|
+
#import "NativeScriptUtils.h"
|
|
4
|
+
|
|
5
|
+
@implementation UIView (NativeScript)
|
|
6
|
+
- (void)nativeScriptSetTextDecorationAndTransform:(NSString*)text textDecoration:(NSString*)textDecoration letterSpacing:(CGFloat)letterSpacing lineHeight:(CGFloat)lineHeight {
|
|
7
|
+
NSMutableDictionary *attrDict = [[NSMutableDictionary alloc] init];
|
|
8
|
+
|
|
9
|
+
if ([textDecoration rangeOfString:@"underline"].location != NSNotFound) {
|
|
10
|
+
attrDict[NSUnderlineStyleAttributeName] = [NSNumber numberWithInt:NSUnderlineStyleSingle];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if ([textDecoration rangeOfString:@"line-through"].location != NSNotFound) {
|
|
14
|
+
attrDict[NSStrikethroughStyleAttributeName] = [NSNumber numberWithInt:NSUnderlineStyleSingle];
|
|
15
|
+
}
|
|
16
|
+
BOOL isTextType = [self isKindOfClass:[UITextField class]] || [self isKindOfClass:[UITextView class]] | [self isKindOfClass:[UILabel class]] | [self isKindOfClass:[UIButton class]];
|
|
17
|
+
|
|
18
|
+
if (letterSpacing != 0 && isTextType && ((UITextView*)self).font != nil) {
|
|
19
|
+
NSNumber *kern = [NSNumber numberWithDouble:letterSpacing * ((UITextView*)self).font.pointSize];
|
|
20
|
+
attrDict[NSKernAttributeName] = kern;
|
|
21
|
+
if ([self isKindOfClass:[UITextField class]]) {
|
|
22
|
+
[((UITextField*)self).defaultTextAttributes setValue:kern forKey:NSKernAttributeName];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
BOOL isTextView = [self isKindOfClass:[UITextView class]];
|
|
27
|
+
if (lineHeight > 0) {
|
|
28
|
+
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
|
|
29
|
+
paragraphStyle.lineSpacing = lineHeight;
|
|
30
|
+
// make sure a possible previously set text alignment setting is not lost when line height is specified
|
|
31
|
+
if ([self isKindOfClass:[UIButton class]]) {
|
|
32
|
+
paragraphStyle.alignment = ((UIButton*)self).titleLabel.textAlignment;
|
|
33
|
+
} else {
|
|
34
|
+
paragraphStyle.alignment = ((UILabel*)self).textAlignment;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if ([self isKindOfClass:[UILabel class]]) {
|
|
38
|
+
// make sure a possible previously set line break mode is not lost when line height is specified
|
|
39
|
+
paragraphStyle.lineBreakMode = ((UILabel*)self).lineBreakMode;
|
|
40
|
+
}
|
|
41
|
+
attrDict[NSParagraphStyleAttributeName] = paragraphStyle;
|
|
42
|
+
} else if (isTextView) {
|
|
43
|
+
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
|
|
44
|
+
paragraphStyle.alignment = ((UITextView*)self).textAlignment;
|
|
45
|
+
attrDict[NSParagraphStyleAttributeName] = paragraphStyle;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (attrDict.count > 0 || isTextView) {
|
|
49
|
+
if (isTextView && ((UITextView*)self).font) {
|
|
50
|
+
// UITextView's font seems to change inside.
|
|
51
|
+
attrDict[NSFontAttributeName] = ((UITextView*)self).font;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
NSMutableAttributedString *result = [[NSMutableAttributedString alloc] initWithString:text];
|
|
55
|
+
[result setAttributes:attrDict range:(NSRange){
|
|
56
|
+
0,
|
|
57
|
+
text.length
|
|
58
|
+
}];
|
|
59
|
+
|
|
60
|
+
if ([self isKindOfClass:[UIButton class]]) {
|
|
61
|
+
[(UIButton*)self setAttributedTitle:result forState:UIControlStateNormal];
|
|
62
|
+
} else {
|
|
63
|
+
((UITextView*)self).attributedText = result;
|
|
64
|
+
}
|
|
65
|
+
} else {
|
|
66
|
+
if ([self isKindOfClass:[UIButton class]]) {
|
|
67
|
+
// Clear attributedText or title won't be affected.
|
|
68
|
+
[(UIButton*)self setAttributedTitle:nil forState:UIControlStateNormal];
|
|
69
|
+
[(UIButton*)self setTitle:text forState:UIControlStateNormal];
|
|
70
|
+
} else {
|
|
71
|
+
// Clear attributedText or text won't be affected.
|
|
72
|
+
((UILabel*)self).attributedText = nil;
|
|
73
|
+
((UILabel*)self).text = text;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
-(void)nativeScriptSetFormattedTextDecorationAndTransform:(NSDictionary*)details letterSpacing:(CGFloat)letterSpacing lineHeight:(CGFloat)lineHeight {
|
|
79
|
+
NSMutableAttributedString *attrText = [NativeScriptUtils createMutableStringWithDetails:details];
|
|
80
|
+
if (letterSpacing != 0) {
|
|
81
|
+
NSNumber *kern = [NSNumber numberWithDouble:letterSpacing * ((UITextView*)self).font.pointSize];
|
|
82
|
+
[attrText addAttribute:NSKernAttributeName value:kern range:(NSRange){
|
|
83
|
+
0,
|
|
84
|
+
attrText.length
|
|
85
|
+
} ];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
BOOL isLabel = [self isKindOfClass:[UILabel class]];
|
|
89
|
+
if (lineHeight > 0) {
|
|
90
|
+
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
|
|
91
|
+
paragraphStyle.lineSpacing = lineHeight;
|
|
92
|
+
// make sure a possible previously set text alignment setting is not lost when line height is specified
|
|
93
|
+
if ([self isKindOfClass:[UIButton class]]) {
|
|
94
|
+
paragraphStyle.alignment = ((UIButton*)self).titleLabel.textAlignment;
|
|
95
|
+
} else {
|
|
96
|
+
// Paragraph alignment is also important for tappable spans as NSTextContainer takes it into account
|
|
97
|
+
paragraphStyle.alignment = ((UILabel*)self).textAlignment;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (isLabel) {
|
|
101
|
+
// make sure a possible previously set line break mode is not lost when line height is specified
|
|
102
|
+
paragraphStyle.lineBreakMode = ((UILabel*)self).lineBreakMode;
|
|
103
|
+
}
|
|
104
|
+
[attrText addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:(NSRange){
|
|
105
|
+
0,
|
|
106
|
+
attrText.length
|
|
107
|
+
}];
|
|
108
|
+
} else if (isLabel || [self isKindOfClass:[UITextView class]]) {
|
|
109
|
+
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
|
|
110
|
+
|
|
111
|
+
if (isLabel) {
|
|
112
|
+
// It's important to set paragraph alignment for link tap to work on multi-line spans as NSTextContainer takes it into account
|
|
113
|
+
paragraphStyle.alignment = ((UILabel*)self).textAlignment;
|
|
114
|
+
} else {
|
|
115
|
+
paragraphStyle.alignment = ((UITextView*)self).textAlignment;
|
|
116
|
+
}
|
|
117
|
+
[attrText addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:(NSRange){
|
|
118
|
+
0,
|
|
119
|
+
attrText.length
|
|
120
|
+
}];
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if ([self isKindOfClass:[UIButton class]]) {
|
|
124
|
+
[(UIButton*)self setAttributedTitle:attrText forState:UIControlStateNormal];
|
|
125
|
+
} else {
|
|
126
|
+
if (@available(iOS 13.0, *)) {
|
|
127
|
+
((UILabel*)self).textColor = [UIColor labelColor];
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
((UILabel*)self).attributedText = attrText;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
-(void)nativeScriptSetFormattedTextStroke:(CGFloat)width color:(UIColor*)color {
|
|
135
|
+
if (width > 0) {
|
|
136
|
+
NSMutableAttributedString *attrText = [[NSMutableAttributedString alloc] initWithAttributedString:((UILabel*)self).attributedText];
|
|
137
|
+
[attrText addAttribute:NSStrokeWidthAttributeName value:[NSNumber numberWithFloat:width] range:(NSRange){
|
|
138
|
+
0,
|
|
139
|
+
attrText.length
|
|
140
|
+
}];
|
|
141
|
+
[attrText addAttribute:NSStrokeColorAttributeName value:color range:(NSRange){
|
|
142
|
+
0,
|
|
143
|
+
attrText.length
|
|
144
|
+
}];
|
|
145
|
+
((UILabel*)self).attributedText = attrText;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
@end
|