@nativescript/core 8.9.0-next-01-17-2025-12834437745 → 8.9.0-next-01-18-2025-12839190246

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (309) hide show
  1. package/accessibility/accessibility-service.d.ts +10 -0
  2. package/accessibility/font-scale.d.ts +9 -0
  3. package/accessibility/index.d.ts +37 -0
  4. package/animation-frame/animation-native.d.ts +4 -0
  5. package/animation-frame/index.d.ts +17 -3
  6. package/application/application.d.ts +194 -0
  7. package/application/index.d.ts +2 -0
  8. package/application-settings/index.d.ts +70 -0
  9. package/cli-hooks/before-checkForChanges.js +60 -0
  10. package/cli-hooks/postinstall.js +2 -0
  11. package/cli-hooks/preuninstall.js +2 -0
  12. package/color/index.d.ts +206 -0
  13. package/connectivity/index.d.ts +52 -0
  14. package/css/css-tree-parser.js +21 -17
  15. package/css/lib/parse/index.js +602 -0
  16. package/css/package.json +36 -0
  17. package/css/reworkcss.d.ts +47 -0
  18. package/css/reworkcss.js +1 -0
  19. package/css-value/package.json +23 -0
  20. package/css-value/reworkcss-value.d.ts +8 -0
  21. package/css-value/reworkcss-value.js +113 -0
  22. package/debugger/css-agent.d.ts +59 -0
  23. package/debugger/devtools-elements.d.ts +23 -5
  24. package/debugger/dom-node.d.ts +23 -20
  25. package/fetch/index.js +539 -0
  26. package/file-system/file-system-access.d.ts +441 -0
  27. package/file-system/index.d.ts +370 -95
  28. package/fps-meter/fps-native.d.ts +24 -0
  29. package/fps-meter/index.d.ts +24 -7
  30. package/global-types.d.ts +393 -0
  31. package/globals/index.d.ts +4 -19
  32. package/http/http-request/index.d.ts +3 -0
  33. package/http/index.d.ts +149 -73
  34. package/image-asset/index.d.ts +17 -0
  35. package/image-source/index.d.ts +350 -0
  36. package/index.d.ts +24 -7
  37. package/js-libs/easysax/easysax.d.ts +8 -0
  38. package/js-libs/easysax/easysax.js +782 -0
  39. package/js-libs/easysax/package.json +35 -0
  40. package/matrix/index.d.ts +32 -5
  41. package/module-name-resolver/index.d.ts +21 -13
  42. package/module-name-resolver/qualifier-matcher/index.d.ts +12 -6
  43. package/package.json +1 -1
  44. package/platform/device/index.d.ts +70 -0
  45. package/platform/index.d.ts +26 -0
  46. package/platform/screen/index.d.ts +48 -0
  47. package/platforms/android/native-api-usage.json +32 -0
  48. package/platforms/android/res/values/ids.xml +4 -0
  49. package/platforms/android/widgets-release.aar +0 -0
  50. package/platforms/android/winter_tc-release.aar +0 -0
  51. package/platforms/ios/NSCWinterTC.xcframework/Info.plist +102 -0
  52. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64/NSCWinterTC.framework/Headers/NSCCrypto.h +79 -0
  53. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64/NSCWinterTC.framework/Headers/NSCWinterTC.h +20 -0
  54. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64/NSCWinterTC.framework/Headers/NSString+WinterTC.h +21 -0
  55. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64/NSCWinterTC.framework/Info.plist +0 -0
  56. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64/NSCWinterTC.framework/Modules/module.modulemap +6 -0
  57. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64/NSCWinterTC.framework/NSCWinterTC +0 -0
  58. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64/dSYMs/NSCWinterTC.framework.dSYM/Contents/Info.plist +20 -0
  59. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64/dSYMs/NSCWinterTC.framework.dSYM/Contents/Resources/DWARF/NSCWinterTC +0 -0
  60. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64/dSYMs/NSCWinterTC.framework.dSYM/Contents/Resources/Relocations/aarch64/NSCWinterTC.yml +40 -0
  61. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Headers/NSCCrypto.h +79 -0
  62. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Headers/NSCWinterTC.h +20 -0
  63. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Headers/NSString+WinterTC.h +21 -0
  64. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Modules/module.modulemap +6 -0
  65. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/NSCWinterTC +0 -0
  66. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Resources/Info.plist +52 -0
  67. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Versions/A/Headers/NSCCrypto.h +79 -0
  68. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Versions/A/Headers/NSCWinterTC.h +20 -0
  69. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Versions/A/Headers/NSString+WinterTC.h +21 -0
  70. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Versions/A/Modules/module.modulemap +6 -0
  71. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Versions/A/NSCWinterTC +0 -0
  72. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Versions/A/Resources/Info.plist +52 -0
  73. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterTC.framework/Versions/Current/NSCWinterTC +0 -0
  74. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/NSCWinterTC.framework.dSYM/Contents/Info.plist +20 -0
  75. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/NSCWinterTC.framework.dSYM/Contents/Resources/DWARF/NSCWinterTC +0 -0
  76. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/NSCWinterTC.framework.dSYM/Contents/Resources/Relocations/aarch64/NSCWinterTC.yml +40 -0
  77. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/NSCWinterTC.framework.dSYM/Contents/Resources/Relocations/x86_64/NSCWinterTC.yml +40 -0
  78. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-simulator/NSCWinterTC.framework/Headers/NSCCrypto.h +79 -0
  79. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-simulator/NSCWinterTC.framework/Headers/NSCWinterTC.h +20 -0
  80. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-simulator/NSCWinterTC.framework/Headers/NSString+WinterTC.h +21 -0
  81. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-simulator/NSCWinterTC.framework/Info.plist +0 -0
  82. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-simulator/NSCWinterTC.framework/Modules/module.modulemap +6 -0
  83. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-simulator/NSCWinterTC.framework/NSCWinterTC +0 -0
  84. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-simulator/NSCWinterTC.framework/_CodeSignature/CodeResources +146 -0
  85. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-simulator/dSYMs/NSCWinterTC.framework.dSYM/Contents/Info.plist +20 -0
  86. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-simulator/dSYMs/NSCWinterTC.framework.dSYM/Contents/Resources/DWARF/NSCWinterTC +0 -0
  87. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-simulator/dSYMs/NSCWinterTC.framework.dSYM/Contents/Resources/Relocations/aarch64/NSCWinterTC.yml +40 -0
  88. package/platforms/ios/NSCWinterTC.xcframework/ios-arm64_x86_64-simulator/dSYMs/NSCWinterTC.framework.dSYM/Contents/Resources/Relocations/x86_64/NSCWinterTC.yml +40 -0
  89. package/platforms/ios/NSCWinterTC.xcframework/xros-arm64/NSCWinterTC.framework/Headers/NSCCrypto.h +79 -0
  90. package/platforms/ios/NSCWinterTC.xcframework/xros-arm64/NSCWinterTC.framework/Headers/NSCWinterTC.h +20 -0
  91. package/platforms/ios/NSCWinterTC.xcframework/xros-arm64/NSCWinterTC.framework/Headers/NSString+WinterTC.h +21 -0
  92. package/platforms/ios/NSCWinterTC.xcframework/xros-arm64/NSCWinterTC.framework/Info.plist +0 -0
  93. package/platforms/ios/NSCWinterTC.xcframework/xros-arm64/NSCWinterTC.framework/Modules/module.modulemap +6 -0
  94. package/platforms/ios/NSCWinterTC.xcframework/xros-arm64/NSCWinterTC.framework/NSCWinterTC +0 -0
  95. package/platforms/ios/NSCWinterTC.xcframework/xros-arm64/dSYMs/NSCWinterTC.framework.dSYM/Contents/Info.plist +20 -0
  96. package/platforms/ios/NSCWinterTC.xcframework/xros-arm64/dSYMs/NSCWinterTC.framework.dSYM/Contents/Resources/DWARF/NSCWinterTC +0 -0
  97. package/platforms/ios/NSCWinterTC.xcframework/xros-arm64/dSYMs/NSCWinterTC.framework.dSYM/Contents/Resources/Relocations/aarch64/NSCWinterTC.yml +40 -0
  98. package/platforms/ios/NSCWinterTC.xcframework/xros-arm64_x86_64-simulator/NSCWinterTC.framework/Headers/NSCCrypto.h +79 -0
  99. package/platforms/ios/NSCWinterTC.xcframework/xros-arm64_x86_64-simulator/NSCWinterTC.framework/Headers/NSCWinterTC.h +20 -0
  100. package/platforms/ios/NSCWinterTC.xcframework/xros-arm64_x86_64-simulator/NSCWinterTC.framework/Headers/NSString+WinterTC.h +21 -0
  101. package/platforms/ios/NSCWinterTC.xcframework/xros-arm64_x86_64-simulator/NSCWinterTC.framework/Info.plist +0 -0
  102. package/platforms/ios/NSCWinterTC.xcframework/xros-arm64_x86_64-simulator/NSCWinterTC.framework/Modules/module.modulemap +6 -0
  103. package/platforms/ios/NSCWinterTC.xcframework/xros-arm64_x86_64-simulator/NSCWinterTC.framework/NSCWinterTC +0 -0
  104. package/platforms/ios/NSCWinterTC.xcframework/xros-arm64_x86_64-simulator/NSCWinterTC.framework/_CodeSignature/CodeResources +146 -0
  105. package/platforms/ios/NSCWinterTC.xcframework/xros-arm64_x86_64-simulator/dSYMs/NSCWinterTC.framework.dSYM/Contents/Info.plist +20 -0
  106. package/platforms/ios/NSCWinterTC.xcframework/xros-arm64_x86_64-simulator/dSYMs/NSCWinterTC.framework.dSYM/Contents/Resources/DWARF/NSCWinterTC +0 -0
  107. package/platforms/ios/NSCWinterTC.xcframework/xros-arm64_x86_64-simulator/dSYMs/NSCWinterTC.framework.dSYM/Contents/Resources/Relocations/aarch64/NSCWinterTC.yml +40 -0
  108. package/platforms/ios/NSCWinterTC.xcframework/xros-arm64_x86_64-simulator/dSYMs/NSCWinterTC.framework.dSYM/Contents/Resources/Relocations/x86_64/NSCWinterTC.yml +40 -0
  109. package/platforms/ios/TNSWidgets.xcframework/Info.plist +102 -0
  110. package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers/NSCCrypto.h +60 -0
  111. package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers/NSData+Async.h +24 -0
  112. package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers/NSFileHandle+Async.h +22 -0
  113. package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers/NSString+Async.h +25 -0
  114. package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers/TNSLabel.h +16 -0
  115. package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers/TNSProcess.h +29 -0
  116. package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers/TNSWidgets.h +25 -0
  117. package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers/UIImage+TNSBlocks.h +26 -0
  118. package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers/UIView+PassThroughParent.h +17 -0
  119. package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Info.plist +0 -0
  120. package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Modules/module.modulemap +6 -0
  121. package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/PrivateHeaders/NSObject+Swizzling.h +17 -0
  122. package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/PrivateHeaders/UIView+PropertyBag.h +18 -0
  123. package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/TNSWidgets +0 -0
  124. package/platforms/ios/TNSWidgets.xcframework/ios-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Info.plist +20 -0
  125. package/platforms/ios/TNSWidgets.xcframework/ios-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
  126. package/platforms/ios/TNSWidgets.xcframework/ios-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +82 -0
  127. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/NSCCrypto.h +60 -0
  128. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/NSData+Async.h +24 -0
  129. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/NSFileHandle+Async.h +22 -0
  130. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/NSString+Async.h +25 -0
  131. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/TNSLabel.h +16 -0
  132. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/TNSProcess.h +29 -0
  133. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/TNSWidgets.h +25 -0
  134. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/UIImage+TNSBlocks.h +26 -0
  135. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/UIView+PassThroughParent.h +17 -0
  136. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Modules/module.modulemap +6 -0
  137. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/PrivateHeaders/NSObject+Swizzling.h +17 -0
  138. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/PrivateHeaders/UIView+PropertyBag.h +18 -0
  139. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Resources/Info.plist +52 -0
  140. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/TNSWidgets +0 -0
  141. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/NSCCrypto.h +60 -0
  142. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/NSData+Async.h +24 -0
  143. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/NSFileHandle+Async.h +22 -0
  144. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/NSString+Async.h +25 -0
  145. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/TNSLabel.h +16 -0
  146. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/TNSProcess.h +29 -0
  147. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/TNSWidgets.h +25 -0
  148. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/UIImage+TNSBlocks.h +26 -0
  149. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/UIView+PassThroughParent.h +17 -0
  150. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Modules/module.modulemap +6 -0
  151. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/PrivateHeaders/NSObject+Swizzling.h +17 -0
  152. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/PrivateHeaders/UIView+PropertyBag.h +18 -0
  153. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Resources/Info.plist +52 -0
  154. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/TNSWidgets +0 -0
  155. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/TNSWidgets +0 -0
  156. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/TNSWidgets.framework.dSYM/Contents/Info.plist +20 -0
  157. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
  158. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +82 -0
  159. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/x86_64/TNSWidgets.yml +82 -0
  160. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSCCrypto.h +60 -0
  161. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSData+Async.h +24 -0
  162. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSFileHandle+Async.h +22 -0
  163. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSString+Async.h +25 -0
  164. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/TNSLabel.h +16 -0
  165. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/TNSProcess.h +29 -0
  166. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/TNSWidgets.h +25 -0
  167. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/UIImage+TNSBlocks.h +26 -0
  168. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/UIView+PassThroughParent.h +17 -0
  169. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Info.plist +0 -0
  170. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Modules/module.modulemap +6 -0
  171. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/PrivateHeaders/NSObject+Swizzling.h +17 -0
  172. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/PrivateHeaders/UIView+PropertyBag.h +18 -0
  173. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/TNSWidgets +0 -0
  174. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/_CodeSignature/CodeResources +223 -0
  175. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Info.plist +20 -0
  176. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
  177. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +82 -0
  178. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/x86_64/TNSWidgets.yml +82 -0
  179. package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/NSCCrypto.h +60 -0
  180. package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/NSData+Async.h +24 -0
  181. package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/NSFileHandle+Async.h +22 -0
  182. package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/NSString+Async.h +25 -0
  183. package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/TNSLabel.h +16 -0
  184. package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/TNSProcess.h +29 -0
  185. package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/TNSWidgets.h +25 -0
  186. package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/UIImage+TNSBlocks.h +26 -0
  187. package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/UIView+PassThroughParent.h +17 -0
  188. package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Info.plist +0 -0
  189. package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Modules/module.modulemap +6 -0
  190. package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/PrivateHeaders/NSObject+Swizzling.h +17 -0
  191. package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/PrivateHeaders/UIView+PropertyBag.h +18 -0
  192. package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/TNSWidgets +0 -0
  193. package/platforms/ios/TNSWidgets.xcframework/xros-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Info.plist +20 -0
  194. package/platforms/ios/TNSWidgets.xcframework/xros-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
  195. package/platforms/ios/TNSWidgets.xcframework/xros-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +82 -0
  196. package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSCCrypto.h +60 -0
  197. package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSData+Async.h +24 -0
  198. package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSFileHandle+Async.h +22 -0
  199. package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSString+Async.h +25 -0
  200. package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/TNSLabel.h +16 -0
  201. package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/TNSProcess.h +29 -0
  202. package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/TNSWidgets.h +25 -0
  203. package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/UIImage+TNSBlocks.h +26 -0
  204. package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/UIView+PassThroughParent.h +17 -0
  205. package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Info.plist +0 -0
  206. package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Modules/module.modulemap +6 -0
  207. package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/PrivateHeaders/NSObject+Swizzling.h +17 -0
  208. package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/PrivateHeaders/UIView+PropertyBag.h +18 -0
  209. package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/TNSWidgets +0 -0
  210. package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/_CodeSignature/CodeResources +223 -0
  211. package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Info.plist +20 -0
  212. package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
  213. package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +82 -0
  214. package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/x86_64/TNSWidgets.yml +82 -0
  215. package/platforms/ios/native-api-usage.json +41 -0
  216. package/platforms/ios/src/NativeScriptEmbedder.h +31 -0
  217. package/platforms/ios/src/NativeScriptEmbedder.m +43 -0
  218. package/platforms/ios/src/NativeScriptMainWindow.swift +196 -0
  219. package/platforms/ios/src/NativeScriptUtils.h +16 -0
  220. package/platforms/ios/src/NativeScriptUtils.m +137 -0
  221. package/platforms/ios/src/UIView+NativeScript.h +15 -0
  222. package/platforms/ios/src/UIView+NativeScript.m +148 -0
  223. package/platforms/ios/src/module.modulemap +14 -0
  224. package/platforms/ios/typings/objc!MaterialComponents.d.ts +808 -0
  225. package/platforms/ios/typings/objc!NativeScriptUtils.d.ts +18 -0
  226. package/profiling/index.d.ts +153 -26
  227. package/references.d.ts +10 -0
  228. package/text/formatted-string.d.ts +1 -1
  229. package/text/index.d.ts +36 -0
  230. package/text/span.d.ts +1 -1
  231. package/timer/index.d.ts +27 -0
  232. package/trace/index.d.ts +131 -105
  233. package/ui/action-bar/index.d.ts +304 -0
  234. package/ui/activity-indicator/index.d.ts +25 -0
  235. package/ui/animation/index.d.ts +139 -0
  236. package/ui/animation/keyframe-animation.d.ts +118 -67
  237. package/ui/builder/binding-builder.d.ts +15 -12
  238. package/ui/builder/index.d.ts +69 -27
  239. package/ui/button/index.d.ts +50 -0
  240. package/ui/content-view/index.d.ts +11 -21
  241. package/ui/core/control-state-change/index.d.ts +17 -0
  242. package/ui/core/view/index.d.ts +1216 -0
  243. package/ui/core/view/view-helper/index.d.ts +76 -0
  244. package/ui/core/weak-event-listener/index.d.ts +18 -2
  245. package/ui/date-picker/index.d.ts +95 -0
  246. package/ui/dialogs/index.d.ts +311 -0
  247. package/ui/editable-text-base/index.d.ts +142 -0
  248. package/ui/embedding/index.d.ts +10 -0
  249. package/ui/frame/fragment.d.ts +5 -0
  250. package/ui/frame/fragment.transitions.d.ts +43 -0
  251. package/ui/frame/index.d.ts +590 -0
  252. package/ui/frame/transition-definitions.android.d.ts +54 -0
  253. package/ui/gestures/index.d.ts +59 -0
  254. package/ui/html-view/index.d.ts +41 -0
  255. package/ui/image/index.d.ts +119 -0
  256. package/ui/image/symbol-effects.d.ts +13 -0
  257. package/ui/image-cache/index.d.ts +147 -0
  258. package/ui/label/index.d.ts +25 -0
  259. package/ui/layouts/absolute-layout/index.d.ts +42 -0
  260. package/ui/layouts/dock-layout/index.d.ts +39 -0
  261. package/ui/layouts/flexbox-layout/index.d.ts +98 -0
  262. package/ui/layouts/grid-layout/index.d.ts +201 -0
  263. package/ui/layouts/index.d.ts +1 -2
  264. package/ui/layouts/layout-base.d.ts +119 -0
  265. package/ui/layouts/root-layout/index.d.ts +48 -0
  266. package/ui/layouts/stack-layout/index.d.ts +22 -0
  267. package/ui/layouts/wrap-layout/index.d.ts +51 -0
  268. package/ui/list-picker/index.d.ts +43 -0
  269. package/ui/list-view/index.d.ts +232 -0
  270. package/ui/page/index.d.ts +241 -0
  271. package/ui/placeholder/index.d.ts +46 -8
  272. package/ui/progress/index.d.ts +50 -0
  273. package/ui/scroll-view/index.d.ts +99 -0
  274. package/ui/search-bar/index.d.ts +103 -0
  275. package/ui/segmented-bar/index.d.ts +122 -0
  276. package/ui/slider/index.d.ts +99 -0
  277. package/ui/styling/background.d.ts +95 -0
  278. package/ui/styling/converters.d.ts +2 -2
  279. package/ui/styling/font.d.ts +62 -0
  280. package/ui/styling/style-properties.d.ts +101 -81
  281. package/ui/styling/style-scope.d.ts +48 -79
  282. package/ui/switch/index.d.ts +46 -0
  283. package/ui/tab-view/index.d.ts +213 -0
  284. package/ui/text-base/formatted-string.d.ts +97 -36
  285. package/ui/text-base/index.d.ts +208 -0
  286. package/ui/text-base/span.d.ts +111 -36
  287. package/ui/text-field/index.d.ts +54 -0
  288. package/ui/text-view/index.d.ts +35 -0
  289. package/ui/time-picker/index.d.ts +107 -0
  290. package/ui/transition/fade-transition.d.ts +3 -0
  291. package/ui/transition/flip-transition.d.ts +5 -0
  292. package/ui/transition/index.d.ts +59 -0
  293. package/ui/transition/modal-transition.d.ts +2 -0
  294. package/ui/transition/page-transition.d.ts +4 -0
  295. package/ui/transition/shared-transition-helper.d.ts +14 -0
  296. package/ui/transition/slide-transition.d.ts +5 -0
  297. package/ui/utils.d.ts +44 -0
  298. package/ui/web-view/index.d.ts +142 -0
  299. package/utils/constants.d.ts +1 -0
  300. package/utils/debug.d.ts +61 -17
  301. package/utils/index.d.ts +183 -0
  302. package/utils/layout-helper/index.d.ts +82 -0
  303. package/utils/lazy.d.ts +5 -0
  304. package/utils/macrotask-scheduler.d.ts +5 -1
  305. package/utils/mainthread-helper.d.ts +16 -0
  306. package/utils/native-helper.d.ts +280 -0
  307. package/utils/types.d.ts +115 -23
  308. package/utils/typescript-utils.d.ts +6 -0
  309. 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
@@ -0,0 +1,14 @@
1
+ module NativeScriptEmbedder {
2
+ header "NativeScriptEmbedder.h"
3
+ export *
4
+ }
5
+
6
+ module NativeScriptUtils {
7
+ header "NativeScriptUtils.h"
8
+ export *
9
+ }
10
+
11
+ module UIViewNativeScript {
12
+ header "UIView+NativeScript.h"
13
+ export *
14
+ }