@triniwiz/nativescript-masonkit 1.0.0-alpha.0 → 1.0.0-alpha.10

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 (358) hide show
  1. package/common.d.ts +57 -25
  2. package/common.js +490 -1081
  3. package/common.js.map +1 -1
  4. package/helpers.d.ts +116 -94
  5. package/helpers.js +474 -2538
  6. package/helpers.js.map +1 -1
  7. package/index.android.d.ts +28 -20
  8. package/index.android.js +107 -49
  9. package/index.android.js.map +1 -1
  10. package/index.d.ts +112 -18
  11. package/index.ios.d.ts +42 -21
  12. package/index.ios.js +313 -81
  13. package/index.ios.js.map +1 -1
  14. package/node.d.ts +2 -0
  15. package/node.js +3 -0
  16. package/node.js.map +1 -0
  17. package/package.json +3 -3
  18. package/platforms/android/include.gradle +18 -1
  19. package/platforms/android/masonkit-release.aar +0 -0
  20. package/platforms/ios/Mason.xcframework/Info.plist +4 -0
  21. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/Mason-Swift.h +345 -314
  22. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/Mason.h +11 -0
  23. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/mason_native.h +215 -818
  24. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Info.plist +0 -0
  25. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Mason +0 -0
  26. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
  27. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.abi.json +23676 -16086
  28. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.private.swiftinterface +444 -308
  29. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  30. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftinterface +444 -308
  31. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/module.modulemap +1 -1
  32. package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
  33. package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +1937 -0
  34. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/Mason-Swift.h +690 -628
  35. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/Mason.h +11 -0
  36. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/mason_native.h +215 -818
  37. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Info.plist +0 -0
  38. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Mason +0 -0
  39. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
  40. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
  41. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.abi.json +23676 -16086
  42. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +444 -308
  43. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  44. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftinterface +444 -308
  45. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.abi.json +23676 -16086
  46. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +444 -308
  47. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  48. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +444 -308
  49. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/module.modulemap +1 -1
  50. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/_CodeSignature/CodeResources +33 -97
  51. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
  52. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +1937 -0
  53. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/x86_64/Mason.yml +1888 -0
  54. package/platforms/ios/Podfile +1 -1
  55. package/platforms/ios/build.xcconfig +4 -1
  56. package/platforms/ios/prebuild.sh +101 -0
  57. package/platforms/new_native_src/cpp/Caches.cpp +36 -0
  58. package/platforms/new_native_src/cpp/Caches.h +42 -0
  59. package/platforms/new_native_src/cpp/Common.h +34 -0
  60. package/platforms/new_native_src/cpp/ConcurrentMap.h +57 -0
  61. package/platforms/new_native_src/cpp/Helpers.cpp +101 -0
  62. package/platforms/new_native_src/cpp/Helpers.h +364 -0
  63. package/platforms/new_native_src/cpp/MasonImpl.cpp +68 -0
  64. package/platforms/new_native_src/cpp/MasonImpl.h +40 -0
  65. package/platforms/new_native_src/cpp/MasonNodeImpl.cpp +89 -0
  66. package/platforms/new_native_src/cpp/MasonNodeImpl.h +47 -0
  67. package/platforms/new_native_src/cpp/MasonStyleImpl.cpp +2181 -0
  68. package/platforms/new_native_src/cpp/MasonStyleImpl.h +420 -0
  69. package/platforms/{ios/src → new_native_src/cpp}/include/mason_native.h +47 -20
  70. package/platforms/new_native_src/cpp/include/robin_hood.h +2544 -0
  71. package/src-native/pods/Headers/include/APIDesign.md +72 -0
  72. package/src-native/pods/Headers/include/DEPS +10 -0
  73. package/src-native/pods/Headers/include/DIR_METADATA +11 -0
  74. package/src-native/pods/Headers/include/OWNERS +23 -0
  75. package/src-native/pods/Headers/include/cppgc/DEPS +8 -0
  76. package/src-native/pods/Headers/include/cppgc/OWNERS +2 -0
  77. package/src-native/pods/Headers/include/cppgc/README.md +133 -0
  78. package/src-native/pods/Headers/include/cppgc/allocation.h +310 -0
  79. package/src-native/pods/Headers/include/cppgc/common.h +29 -0
  80. package/src-native/pods/Headers/include/cppgc/cross-thread-persistent.h +465 -0
  81. package/src-native/pods/Headers/include/cppgc/custom-space.h +97 -0
  82. package/src-native/pods/Headers/include/cppgc/default-platform.h +67 -0
  83. package/src-native/pods/Headers/include/cppgc/ephemeron-pair.h +30 -0
  84. package/src-native/pods/Headers/include/cppgc/explicit-management.h +100 -0
  85. package/src-native/pods/Headers/include/cppgc/garbage-collected.h +106 -0
  86. package/src-native/pods/Headers/include/cppgc/heap-consistency.h +266 -0
  87. package/src-native/pods/Headers/include/cppgc/heap-state.h +82 -0
  88. package/src-native/pods/Headers/include/cppgc/heap-statistics.h +120 -0
  89. package/src-native/pods/Headers/include/cppgc/heap.h +206 -0
  90. package/src-native/pods/Headers/include/cppgc/internal/api-constants.h +55 -0
  91. package/src-native/pods/Headers/include/cppgc/internal/atomic-entry-flag.h +48 -0
  92. package/src-native/pods/Headers/include/cppgc/internal/caged-heap-local-data.h +79 -0
  93. package/src-native/pods/Headers/include/cppgc/internal/compiler-specific.h +38 -0
  94. package/src-native/pods/Headers/include/cppgc/internal/finalizer-trait.h +93 -0
  95. package/src-native/pods/Headers/include/cppgc/internal/gc-info.h +156 -0
  96. package/src-native/pods/Headers/include/cppgc/internal/logging.h +50 -0
  97. package/src-native/pods/Headers/include/cppgc/internal/name-trait.h +122 -0
  98. package/src-native/pods/Headers/include/cppgc/internal/persistent-node.h +216 -0
  99. package/src-native/pods/Headers/include/cppgc/internal/pointer-policies.h +186 -0
  100. package/src-native/pods/Headers/include/cppgc/internal/write-barrier.h +435 -0
  101. package/src-native/pods/Headers/include/cppgc/liveness-broker.h +77 -0
  102. package/src-native/pods/Headers/include/cppgc/macros.h +26 -0
  103. package/src-native/pods/Headers/include/cppgc/member.h +291 -0
  104. package/src-native/pods/Headers/include/cppgc/name-provider.h +65 -0
  105. package/src-native/pods/Headers/include/cppgc/object-size-trait.h +58 -0
  106. package/src-native/pods/Headers/include/cppgc/persistent.h +370 -0
  107. package/src-native/pods/Headers/include/cppgc/platform.h +156 -0
  108. package/src-native/pods/Headers/include/cppgc/prefinalizer.h +75 -0
  109. package/src-native/pods/Headers/include/cppgc/process-heap-statistics.h +36 -0
  110. package/src-native/pods/Headers/include/cppgc/sentinel-pointer.h +32 -0
  111. package/src-native/pods/Headers/include/cppgc/source-location.h +92 -0
  112. package/src-native/pods/Headers/include/cppgc/testing.h +106 -0
  113. package/src-native/pods/Headers/include/cppgc/trace-trait.h +116 -0
  114. package/src-native/pods/Headers/include/cppgc/type-traits.h +240 -0
  115. package/src-native/pods/Headers/include/cppgc/visitor.h +379 -0
  116. package/src-native/pods/Headers/include/js_protocol-1.2.json +936 -0
  117. package/src-native/pods/Headers/include/js_protocol-1.3.json +1112 -0
  118. package/src-native/pods/Headers/include/js_protocol.pdl +1709 -0
  119. package/src-native/pods/Headers/include/libffi/arm64/ffi.h +524 -0
  120. package/src-native/pods/Headers/include/libffi/arm64/ffitarget.h +92 -0
  121. package/src-native/pods/Headers/include/libffi/x86_64/ffi.h +524 -0
  122. package/src-native/pods/Headers/include/libffi/x86_64/ffitarget.h +147 -0
  123. package/src-native/pods/Headers/include/libffi.h +12 -0
  124. package/src-native/pods/Headers/include/libplatform/DEPS +9 -0
  125. package/src-native/pods/Headers/include/libplatform/libplatform-export.h +29 -0
  126. package/src-native/pods/Headers/include/libplatform/libplatform.h +106 -0
  127. package/src-native/pods/Headers/include/libplatform/v8-tracing.h +333 -0
  128. package/src-native/pods/Headers/include/v8-array-buffer.h +433 -0
  129. package/src-native/pods/Headers/include/v8-callbacks.h +397 -0
  130. package/src-native/pods/Headers/include/v8-container.h +129 -0
  131. package/src-native/pods/Headers/include/v8-context.h +407 -0
  132. package/src-native/pods/Headers/include/v8-cppgc.h +215 -0
  133. package/src-native/pods/Headers/include/v8-data.h +80 -0
  134. package/src-native/pods/Headers/include/v8-date.h +43 -0
  135. package/src-native/pods/Headers/include/v8-debug.h +168 -0
  136. package/src-native/pods/Headers/include/v8-embedder-heap.h +218 -0
  137. package/src-native/pods/Headers/include/v8-embedder-state-scope.h +51 -0
  138. package/src-native/pods/Headers/include/v8-exception.h +217 -0
  139. package/src-native/pods/Headers/include/v8-extension.h +62 -0
  140. package/src-native/pods/Headers/include/v8-external.h +37 -0
  141. package/src-native/pods/Headers/include/v8-fast-api-calls.h +939 -0
  142. package/src-native/pods/Headers/include/v8-forward.h +81 -0
  143. package/src-native/pods/Headers/include/v8-function-callback.h +475 -0
  144. package/src-native/pods/Headers/include/v8-function.h +125 -0
  145. package/src-native/pods/Headers/include/v8-initialization.h +315 -0
  146. package/src-native/pods/Headers/include/v8-inspector-protocol.h +13 -0
  147. package/src-native/pods/Headers/include/v8-inspector.h +376 -0
  148. package/src-native/pods/Headers/include/v8-internal.h +661 -0
  149. package/src-native/pods/Headers/include/v8-isolate.h +1709 -0
  150. package/src-native/pods/Headers/include/v8-json.h +47 -0
  151. package/src-native/pods/Headers/include/v8-local-handle.h +455 -0
  152. package/src-native/pods/Headers/include/v8-locker.h +149 -0
  153. package/src-native/pods/Headers/include/v8-maybe.h +137 -0
  154. package/src-native/pods/Headers/include/v8-memory-span.h +43 -0
  155. package/src-native/pods/Headers/include/v8-message.h +216 -0
  156. package/src-native/pods/Headers/include/v8-metrics.h +255 -0
  157. package/src-native/pods/Headers/include/v8-microtask-queue.h +152 -0
  158. package/src-native/pods/Headers/include/v8-microtask.h +28 -0
  159. package/src-native/pods/Headers/include/v8-object.h +775 -0
  160. package/src-native/pods/Headers/include/v8-persistent-handle.h +590 -0
  161. package/src-native/pods/Headers/include/v8-platform.h +1092 -0
  162. package/src-native/pods/Headers/include/v8-primitive-object.h +118 -0
  163. package/src-native/pods/Headers/include/v8-primitive.h +866 -0
  164. package/src-native/pods/Headers/include/v8-profiler.h +1198 -0
  165. package/src-native/pods/Headers/include/v8-promise.h +174 -0
  166. package/src-native/pods/Headers/include/v8-proxy.h +50 -0
  167. package/src-native/pods/Headers/include/v8-regexp.h +105 -0
  168. package/src-native/pods/Headers/include/v8-script.h +748 -0
  169. package/src-native/pods/Headers/include/v8-snapshot.h +196 -0
  170. package/src-native/pods/Headers/include/v8-statistics.h +217 -0
  171. package/src-native/pods/Headers/include/v8-template.h +1079 -0
  172. package/src-native/pods/Headers/include/v8-traced-handle.h +420 -0
  173. package/src-native/pods/Headers/include/v8-typed-array.h +282 -0
  174. package/src-native/pods/Headers/include/v8-unwinder-state.h +31 -0
  175. package/src-native/pods/Headers/include/v8-unwinder.h +132 -0
  176. package/src-native/pods/Headers/include/v8-util.h +658 -0
  177. package/src-native/pods/Headers/include/v8-value-serializer-version.h +24 -0
  178. package/src-native/pods/Headers/include/v8-value-serializer.h +279 -0
  179. package/src-native/pods/Headers/include/v8-value.h +526 -0
  180. package/src-native/pods/Headers/include/v8-version-string.h +38 -0
  181. package/src-native/pods/Headers/include/v8-version.h +20 -0
  182. package/src-native/pods/Headers/include/v8-wasm-trap-handler-posix.h +31 -0
  183. package/src-native/pods/Headers/include/v8-wasm-trap-handler-win.h +28 -0
  184. package/src-native/pods/Headers/include/v8-wasm.h +257 -0
  185. package/src-native/pods/Headers/include/v8-weak-callback-info.h +86 -0
  186. package/src-native/pods/Headers/include/v8.h +88 -0
  187. package/src-native/pods/Headers/include/v8config.h +605 -0
  188. package/src-native/pods/Headers/inspector/InspectorServer.h +20 -0
  189. package/src-native/pods/Headers/inspector/JsV8InspectorClient.h +66 -0
  190. package/src-native/pods/Headers/inspector/base/trace_event/common/trace_event_common.h +1123 -0
  191. package/src-native/pods/Headers/inspector/base64.h +9 -0
  192. package/src-native/pods/Headers/inspector/src/base/address-region.h +95 -0
  193. package/src-native/pods/Headers/inspector/src/base/atomic-utils.h +219 -0
  194. package/src-native/pods/Headers/inspector/src/base/atomicops.h +332 -0
  195. package/src-native/pods/Headers/inspector/src/base/atomicops_internals_atomicword_compat.h +89 -0
  196. package/src-native/pods/Headers/inspector/src/base/base-export.h +31 -0
  197. package/src-native/pods/Headers/inspector/src/base/bits.h +343 -0
  198. package/src-native/pods/Headers/inspector/src/base/build_config.h +234 -0
  199. package/src-native/pods/Headers/inspector/src/base/compiler-specific.h +136 -0
  200. package/src-native/pods/Headers/inspector/src/base/export-template.h +163 -0
  201. package/src-native/pods/Headers/inspector/src/base/flags.h +130 -0
  202. package/src-native/pods/Headers/inspector/src/base/immediate-crash.h +162 -0
  203. package/src-native/pods/Headers/inspector/src/base/lazy-instance.h +258 -0
  204. package/src-native/pods/Headers/inspector/src/base/logging.h +417 -0
  205. package/src-native/pods/Headers/inspector/src/base/macros.h +423 -0
  206. package/src-native/pods/Headers/inspector/src/base/memory.h +89 -0
  207. package/src-native/pods/Headers/inspector/src/base/once.h +108 -0
  208. package/src-native/pods/Headers/inspector/src/base/optional.h +882 -0
  209. package/src-native/pods/Headers/inspector/src/base/platform/mutex.h +370 -0
  210. package/src-native/pods/Headers/inspector/src/base/platform/platform.h +476 -0
  211. package/src-native/pods/Headers/inspector/src/base/platform/semaphore.h +108 -0
  212. package/src-native/pods/Headers/inspector/src/base/platform/v8-time.h +513 -0
  213. package/src-native/pods/Headers/inspector/src/base/platform/wrappers.h +73 -0
  214. package/src-native/pods/Headers/inspector/src/base/safe_conversions.h +389 -0
  215. package/src-native/pods/Headers/inspector/src/base/safe_conversions_impl.h +822 -0
  216. package/src-native/pods/Headers/inspector/src/base/template-utils.h +113 -0
  217. package/src-native/pods/Headers/inspector/src/base/v8-fallthrough.h +21 -0
  218. package/src-native/pods/Headers/inspector/src/common/checks.h +38 -0
  219. package/src-native/pods/Headers/inspector/src/common/globals.h +1842 -0
  220. package/src-native/pods/Headers/inspector/src/debug/debug-interface.h +667 -0
  221. package/src-native/pods/Headers/inspector/src/debug/interface-types.h +175 -0
  222. package/src-native/pods/Headers/inspector/src/init/v8.h +52 -0
  223. package/src-native/pods/Headers/inspector/src/inspector/custom-preview.h +24 -0
  224. package/src-native/pods/Headers/inspector/src/inspector/injected-script.h +251 -0
  225. package/src-native/pods/Headers/inspector/src/inspector/inspected-context.h +79 -0
  226. package/src-native/pods/Headers/inspector/src/inspector/protocol/CSS.h +2148 -0
  227. package/src-native/pods/Headers/inspector/src/inspector/protocol/Console.h +211 -0
  228. package/src-native/pods/Headers/inspector/src/inspector/protocol/DOM.h +1008 -0
  229. package/src-native/pods/Headers/inspector/src/inspector/protocol/Debugger.h +892 -0
  230. package/src-native/pods/Headers/inspector/src/inspector/protocol/Forward.h +75 -0
  231. package/src-native/pods/Headers/inspector/src/inspector/protocol/HeapProfiler.h +346 -0
  232. package/src-native/pods/Headers/inspector/src/inspector/protocol/Log.h +342 -0
  233. package/src-native/pods/Headers/inspector/src/inspector/protocol/Network.h +2528 -0
  234. package/src-native/pods/Headers/inspector/src/inspector/protocol/Overlay.h +281 -0
  235. package/src-native/pods/Headers/inspector/src/inspector/protocol/Page.h +1189 -0
  236. package/src-native/pods/Headers/inspector/src/inspector/protocol/Profiler.h +1001 -0
  237. package/src-native/pods/Headers/inspector/src/inspector/protocol/Protocol.h +617 -0
  238. package/src-native/pods/Headers/inspector/src/inspector/protocol/Runtime.h +1696 -0
  239. package/src-native/pods/Headers/inspector/src/inspector/protocol/Schema.h +146 -0
  240. package/src-native/pods/Headers/inspector/src/inspector/protocol/Security.h +793 -0
  241. package/src-native/pods/Headers/inspector/src/inspector/remote-object-id.h +54 -0
  242. package/src-native/pods/Headers/inspector/src/inspector/search-util.h +26 -0
  243. package/src-native/pods/Headers/inspector/src/inspector/string-16.h +180 -0
  244. package/src-native/pods/Headers/inspector/src/inspector/string-util.h +128 -0
  245. package/src-native/pods/Headers/inspector/src/inspector/v8-console-agent-impl.h +48 -0
  246. package/src-native/pods/Headers/inspector/src/inspector/v8-console-message.h +147 -0
  247. package/src-native/pods/Headers/inspector/src/inspector/v8-console.h +173 -0
  248. package/src-native/pods/Headers/inspector/src/inspector/v8-css-agent-impl.h +62 -0
  249. package/src-native/pods/Headers/inspector/src/inspector/v8-debugger-agent-impl.h +248 -0
  250. package/src-native/pods/Headers/inspector/src/inspector/v8-debugger-id.h +44 -0
  251. package/src-native/pods/Headers/inspector/src/inspector/v8-debugger-script.h +123 -0
  252. package/src-native/pods/Headers/inspector/src/inspector/v8-debugger.h +257 -0
  253. package/src-native/pods/Headers/inspector/src/inspector/v8-dom-agent-impl.h +91 -0
  254. package/src-native/pods/Headers/inspector/src/inspector/v8-heap-profiler-agent-impl.h +80 -0
  255. package/src-native/pods/Headers/inspector/src/inspector/v8-inspector-impl.h +191 -0
  256. package/src-native/pods/Headers/inspector/src/inspector/v8-inspector-session-impl.h +156 -0
  257. package/src-native/pods/Headers/inspector/src/inspector/v8-log-agent-impl.h +34 -0
  258. package/src-native/pods/Headers/inspector/src/inspector/v8-network-agent-impl.h +71 -0
  259. package/src-native/pods/Headers/inspector/src/inspector/v8-ns-debugger-agent-impl.h +24 -0
  260. package/src-native/pods/Headers/inspector/src/inspector/v8-overlay-agent-impl.h +70 -0
  261. package/src-native/pods/Headers/inspector/src/inspector/v8-page-agent-impl.h +88 -0
  262. package/src-native/pods/Headers/inspector/src/inspector/v8-profiler-agent-impl.h +104 -0
  263. package/src-native/pods/Headers/inspector/src/inspector/v8-regex.h +38 -0
  264. package/src-native/pods/Headers/inspector/src/inspector/v8-runtime-agent-impl.h +157 -0
  265. package/src-native/pods/Headers/inspector/src/inspector/v8-schema-agent-impl.h +38 -0
  266. package/src-native/pods/Headers/inspector/src/inspector/v8-stack-trace-impl.h +164 -0
  267. package/src-native/pods/Headers/inspector/src/inspector/v8-string-conversions.h +17 -0
  268. package/src-native/pods/Headers/inspector/src/inspector/v8-value-utils.h +23 -0
  269. package/src-native/pods/Headers/inspector/src/inspector/value-mirror.h +87 -0
  270. package/src-native/pods/Headers/inspector/src/libplatform/default-platform.h +92 -0
  271. package/src-native/pods/Headers/inspector/src/logging/tracing-flags.h +50 -0
  272. package/src-native/pods/Headers/inspector/src/numbers/conversions.h +183 -0
  273. package/src-native/pods/Headers/inspector/src/tracing/trace-event.h +664 -0
  274. package/src-native/pods/Headers/inspector/src/utils/allocation.h +367 -0
  275. package/src-native/pods/Headers/inspector/src/utils/vector.h +324 -0
  276. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/cbor.h +305 -0
  277. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/dispatch.h +314 -0
  278. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/error_support.h +62 -0
  279. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/export.h +6 -0
  280. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/find_by_first.h +58 -0
  281. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/frontend_channel.h +47 -0
  282. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/glue.h +80 -0
  283. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/json.h +52 -0
  284. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/json_platform.h +26 -0
  285. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/maybe.h +104 -0
  286. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/parser_handler.h +39 -0
  287. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/protocol_core.h +406 -0
  288. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/serializable.h +32 -0
  289. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/serializer_traits.h +158 -0
  290. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/span.h +99 -0
  291. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/status.h +139 -0
  292. package/src-native/pods/Headers/inspector/utils.h +32 -0
  293. package/src-native/pods/Headers/inspector/v8-inspector-platform.h +44 -0
  294. package/src-native/pods/Headers/jsi/decorator.h +762 -0
  295. package/src-native/pods/Headers/jsi/instrumentation.h +117 -0
  296. package/src-native/pods/Headers/jsi/jsi-inl.h +322 -0
  297. package/src-native/pods/Headers/jsi/jsi.h +1387 -0
  298. package/src-native/pods/Headers/jsi/jsilib.h +59 -0
  299. package/src-native/pods/Headers/jsi/threadsafe.h +79 -0
  300. package/src-native/pods/Headers/runtime/ArgConverter.h +61 -0
  301. package/src-native/pods/Headers/runtime/ArrayAdapter.h +13 -0
  302. package/src-native/pods/Headers/runtime/Caches.h +98 -0
  303. package/src-native/pods/Headers/runtime/ClassBuilder.h +61 -0
  304. package/src-native/pods/Headers/runtime/Common.h +9 -0
  305. package/src-native/pods/Headers/runtime/ConcurrentMap.h +55 -0
  306. package/src-native/pods/Headers/runtime/ConcurrentQueue.h +28 -0
  307. package/src-native/pods/Headers/runtime/Console.h +27 -0
  308. package/src-native/pods/Headers/runtime/Constants.h +15 -0
  309. package/src-native/pods/Headers/runtime/DataWrapper.h +671 -0
  310. package/src-native/pods/Headers/runtime/DictionaryAdapter.h +13 -0
  311. package/src-native/pods/Headers/runtime/ExtVector.h +21 -0
  312. package/src-native/pods/Headers/runtime/FFICall.h +105 -0
  313. package/src-native/pods/Headers/runtime/FastEnumerationAdapter.h +13 -0
  314. package/src-native/pods/Headers/runtime/FunctionReference.h +18 -0
  315. package/src-native/pods/Headers/runtime/Helpers.h +84 -0
  316. package/src-native/pods/Headers/runtime/InlineFunctions.h +16 -0
  317. package/src-native/pods/Headers/runtime/Interop.h +202 -0
  318. package/src-native/pods/Headers/runtime/KnownUnknownClassPair.h +35 -0
  319. package/src-native/pods/Headers/runtime/Metadata.h +981 -0
  320. package/src-native/pods/Headers/runtime/MetadataBuilder.h +72 -0
  321. package/src-native/pods/Headers/runtime/MetadataInlines.h +157 -0
  322. package/src-native/pods/Headers/runtime/ModuleInternal.h +59 -0
  323. package/src-native/pods/Headers/runtime/NSDataAdapter.h +13 -0
  324. package/src-native/pods/Headers/runtime/NativeScriptException.h +27 -0
  325. package/src-native/pods/Headers/runtime/ObjectManager.h +31 -0
  326. package/src-native/pods/Headers/runtime/OneByteStringResource.h +21 -0
  327. package/src-native/pods/Headers/runtime/Pointer.h +26 -0
  328. package/src-native/pods/Headers/runtime/PromiseProxy.h +15 -0
  329. package/src-native/pods/Headers/runtime/Reference.h +38 -0
  330. package/src-native/pods/Headers/runtime/Runtime.h +67 -0
  331. package/src-native/pods/Headers/runtime/RuntimeConfig.h +17 -0
  332. package/src-native/pods/Headers/runtime/SetTimeout.h +34 -0
  333. package/src-native/pods/Headers/runtime/SimpleAllocator.h +23 -0
  334. package/src-native/pods/Headers/runtime/StringHasher.h +315 -0
  335. package/src-native/pods/Headers/runtime/SymbolIterator.h +18 -0
  336. package/src-native/pods/Headers/runtime/SymbolLoader.h +27 -0
  337. package/src-native/pods/Headers/runtime/TNSDerivedClass.h +8 -0
  338. package/src-native/pods/Headers/runtime/TSHelpers.h +15 -0
  339. package/src-native/pods/Headers/runtime/Tasks.h +19 -0
  340. package/src-native/pods/Headers/runtime/UnmanagedType.h +21 -0
  341. package/src-native/pods/Headers/runtime/WeakRef.h +15 -0
  342. package/src-native/pods/Headers/runtime/Worker.h +26 -0
  343. package/src-native/pods/Headers/runtime/robin_hood.h +2184 -0
  344. package/src-native/pods/Headers/v8runtime/HostProxy.h +71 -0
  345. package/src-native/pods/Headers/v8runtime/JSIV8ValueConverter.h +70 -0
  346. package/src-native/pods/Headers/v8runtime/V8PointerValue.h +44 -0
  347. package/src-native/pods/Headers/v8runtime/V8Runtime.h +215 -0
  348. package/src-native/pods/Headers/v8runtime/V8RuntimeConfig.h +26 -0
  349. package/src-native/pods/Headers/v8runtime/V8RuntimeFactory.h +21 -0
  350. package/src-native/pods/NativeScript.podspec +68 -0
  351. package/style.d.ts +166 -0
  352. package/style.js +1686 -0
  353. package/style.js.map +1 -0
  354. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/PrivateHeaders/mason_native.h +0 -676
  355. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/PrivateHeaders/mason_native.h +0 -676
  356. package/platforms/ios/src/JSIModule.h +0 -217
  357. package/platforms/ios/src/JSIModule.mm +0 -2788
  358. package/platforms/ios/src/module.modulemap +0 -4
package/index.d.ts CHANGED
@@ -1,16 +1,19 @@
1
1
  import { CoreTypes } from '@nativescript/core';
2
2
 
3
- import { TSCViewBase } from './common';
3
+ import { TextBase, ViewBase } from './common';
4
+ import { LengthPercentage } from '@nativescript/core/css/parser';
4
5
 
5
- export type Length = CoreTypes.dip | CoreTypes.LengthDipUnit | CoreTypes.LengthPxUnit;
6
+ export type Length = CoreTypes.dip | CoreTypes.LengthDipUnit | CoreTypes.LengthPxUnit | CoreTypes.LengthPercentUnit;
6
7
 
7
- export type LengthAuto = CoreTypes.dip | CoreTypes.LengthDipUnit | CoreTypes.LengthPxUnit | 'auto';
8
+ export type LengthAuto = CoreTypes.dip | CoreTypes.LengthDipUnit | CoreTypes.LengthPxUnit | CoreTypes.LengthPercentUnit | 'auto';
8
9
 
9
10
  export type SizeLength = { width: LengthType; height: LengthType };
10
11
 
11
12
  export type Position = 'absolute' | 'relative';
12
13
 
13
- export type Display = 'none' | 'flex' | 'grid';
14
+ export type Display = 'none' | 'flex' | 'grid' | 'block';
15
+
16
+ export type Overflow = 'visible' | 'hidden' | 'scroll';
14
17
 
15
18
  export type FlexWrap = 'no-wrap' | 'wrap' | 'wrap-reverse';
16
19
 
@@ -32,17 +35,101 @@ export type JustifySelf = AlignSelf;
32
35
 
33
36
  export type JustifyContent = AlignContent;
34
37
 
35
- export type GridAutoFlow = 'row' | 'column' | 'row-dense' | 'column-dense';
36
-
37
- export { applyMixins } from './helpers';
38
-
39
- export class TSCView extends TSCViewBase {}
40
-
41
- export class Grid extends TSCView {}
42
-
43
- export class Flex extends TSCView {}
38
+ export type GridAutoFlow = 'row' | 'column' | 'row dense' | 'column dense' | 'dense';
39
+
40
+ export class View extends ViewBase {
41
+ display: Display;
42
+ position: Position;
43
+ flexDirection: FlexDirection;
44
+ flexWrap: FlexWrap;
45
+ flex: string | 'auto' | 'none' | number | 'initial';
46
+ flexFlow: string;
47
+ width: LengthAuto;
48
+ height: LengthAuto;
49
+ maxWidth: LengthAuto;
50
+ maxHeight: LengthAuto;
51
+ left: Length;
52
+ right: Length;
53
+ top: Length;
54
+ bottom: Length;
55
+ gridGap: Gap;
56
+ gap: Gap;
57
+ rowGap: Length;
58
+ columnGap: Length;
59
+ aspectRatio: number;
60
+ flexBasis: Length;
61
+ alignItems: AlignItems;
62
+ alignSelf: AlignSelf;
63
+ alignContent: AlignContent;
64
+ justifyItems: JustifyItems;
65
+ justifySelf: JustifySelf;
66
+ justifyContent: JustifyContent;
67
+ gridAutoRows: string;
68
+ gridAutoColumns: string;
69
+ gridAutoFlow: GridAutoFlow;
70
+ gridRowGap: Gap;
71
+ gridColumnGap: Gap;
72
+ gridArea: string;
73
+ gridColumn: string;
74
+ gridColumnStart: string;
75
+ gridColumnEnd: string;
76
+ gridRow: string;
77
+ gridRowStart: string;
78
+ gridRowEnd: string;
79
+ gridTemplateRows: string;
80
+ gridTemplateColumns: string;
81
+ overflow: Overflow;
82
+ overflowX: Overflow;
83
+ overflowY: Overflow;
84
+ scrollBarWidth: number | CoreTypes.LengthType;
85
+ }
44
86
 
45
- export class Container extends TSCView {}
87
+ export class Text extends TextBase {
88
+ display: Display;
89
+ position: Position;
90
+ flexDirection: FlexDirection;
91
+ flexWrap: FlexWrap;
92
+ flex: string | 'auto' | 'none' | number | 'initial';
93
+ flexFlow: string;
94
+ width: LengthAuto;
95
+ height: LengthAuto;
96
+ maxWidth: LengthAuto;
97
+ maxHeight: LengthAuto;
98
+ left: Length;
99
+ right: Length;
100
+ top: Length;
101
+ bottom: Length;
102
+ gridGap: Gap;
103
+ gap: Gap;
104
+ rowGap: Length;
105
+ columnGap: Length;
106
+ aspectRatio: number;
107
+ flexBasis: Length;
108
+ alignItems: AlignItems;
109
+ alignSelf: AlignSelf;
110
+ alignContent: AlignContent;
111
+ justifyItems: JustifyItems;
112
+ justifySelf: JustifySelf;
113
+ justifyContent: JustifyContent;
114
+ gridAutoRows: string;
115
+ gridAutoColumns: string;
116
+ gridAutoFlow: GridAutoFlow;
117
+ gridRowGap: Gap;
118
+ gridColumnGap: Gap;
119
+ gridArea: string;
120
+ gridColumn: string;
121
+ gridColumnStart: string;
122
+ gridColumnEnd: string;
123
+ gridRow: string;
124
+ gridRowStart: string;
125
+ gridRowEnd: string;
126
+ gridTemplateRows: string;
127
+ gridTemplateColumns: string;
128
+ overflow: Overflow;
129
+ overflowX: Overflow;
130
+ overflowY: Overflow;
131
+ scrollBarWidth: number | CoreTypes.LengthType;
132
+ }
46
133
 
47
134
  declare module '@nativescript/core/ui/styling/style' {
48
135
  interface Style {
@@ -50,10 +137,12 @@ declare module '@nativescript/core/ui/styling/style' {
50
137
  position: Position;
51
138
  flexDirection: FlexDirection;
52
139
  flexWrap: FlexWrap;
53
- width: Length;
54
- height: Length;
55
- maxWidth: Length;
56
- maxHeight: Length;
140
+ flex: string | 'auto' | 'none' | number | 'initial';
141
+ flexFlow: string;
142
+ width: LengthPercentage | string | number;
143
+ height: LengthPercentage | string | number;
144
+ maxWidth: LengthPercentage | string | number;
145
+ maxHeight: LengthPercentage | string | number;
57
146
  left: Length;
58
147
  right: Length;
59
148
  top: Length;
@@ -63,6 +152,7 @@ declare module '@nativescript/core/ui/styling/style' {
63
152
  rowGap: Length;
64
153
  columnGap: Length;
65
154
  aspectRatio: number;
155
+ flexBasis: LengthPercentage | string | number;
66
156
  alignItems: AlignItems;
67
157
  alignSelf: AlignSelf;
68
158
  alignContent: AlignContent;
@@ -83,5 +173,9 @@ declare module '@nativescript/core/ui/styling/style' {
83
173
  gridRowEnd: string;
84
174
  gridTemplateRows: string;
85
175
  gridTemplateColumns: string;
176
+ overflow: Overflow;
177
+ overflowX: Overflow;
178
+ overflowY: Overflow;
179
+ scrollBarWidth: number | CoreTypes.LengthType;
86
180
  }
87
181
  }
package/index.ios.d.ts CHANGED
@@ -1,27 +1,48 @@
1
- import { ViewBase } from '@nativescript/core';
2
- import { TSCViewBase } from './common';
3
- export declare class TSCView extends TSCViewBase {
4
- __masonStylePtr: number;
5
- get _masonStylePtr(): number;
6
- __masonNodePtr: number;
7
- get _masonNodePtr(): number;
8
- __masonPtr: number;
9
- get _masonPtr(): number;
1
+ import { Color } from '@nativescript/core';
2
+ import { MasonChild, style_, TextBase, ViewBase } from './common';
3
+ export declare class Tree {
4
+ _base: NSCMason;
5
+ private static _tree;
6
+ constructor();
7
+ static get instance(): Tree;
8
+ get native(): NSCMason;
9
+ createView(): MasonUIView;
10
+ createTextView(): MasonText;
11
+ }
12
+ export declare class View extends ViewBase {
13
+ [style_]: any;
14
+ private _view;
15
+ constructor();
16
+ get _styleHelper(): any;
10
17
  _hasNativeView: boolean;
11
- createNativeView(): UIView;
18
+ _inBatch: boolean;
19
+ createNativeView(): MasonUIView;
12
20
  disposeNativeView(): void;
13
- get ios(): UIView;
21
+ get ios(): MasonUIView;
14
22
  onLayout(left: number, top: number, right: number, bottom: number): void;
15
23
  onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void;
16
- layoutNativeView(): void;
17
- _addViewToNativeVisualTree(view: ViewBase, atIndex?: number): boolean;
18
- _removeViewFromNativeVisualTree(view: ViewBase): void;
19
- }
20
- export declare class Grid extends TSCView {
21
- createNativeView(): any;
22
- }
23
- export declare class Flex extends TSCView {
24
- createNativeView(): any;
24
+ _setNativeViewFrame(nativeView: any, frame: CGRect): void;
25
+ _addViewToNativeVisualTree(child: MasonChild, atIndex?: number): boolean;
26
+ _removeViewFromNativeVisualTree(view: MasonChild): void;
25
27
  }
26
- export declare class Container extends TSCView {
28
+ export declare class Text extends TextBase {
29
+ [style_]: any;
30
+ _hasNativeView: boolean;
31
+ _inBatch: boolean;
32
+ _isText: boolean;
33
+ private _view;
34
+ constructor();
35
+ get ios(): MasonText;
36
+ get _styleHelper(): any;
37
+ createNativeView(): MasonText;
38
+ get text(): string;
39
+ set text(value: string);
40
+ set backgroundColor(value: Color | number);
41
+ get backgroundColor(): Color | number;
42
+ onLayout(left: number, top: number, right: number, bottom: number): void;
43
+ onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void;
44
+ _addViewToNativeVisualTree(child: MasonChild & {
45
+ text?: string;
46
+ }, atIndex?: number): boolean;
47
+ _setNativeViewFrame(nativeView: any, frame: CGRect): void;
27
48
  }
package/index.ios.js CHANGED
@@ -1,124 +1,356 @@
1
- import { Utils, View } from '@nativescript/core';
2
- import { TSCViewBase } from './common';
3
- export class TSCView extends TSCViewBase {
1
+ var _a;
2
+ import { Color, colorProperty, Utils } from '@nativescript/core';
3
+ import { Style } from './style';
4
+ import { style_, TextBase, ViewBase, textWrapProperty } from './common';
5
+ function parseLength(length, parent = 0) {
6
+ switch (length.unit) {
7
+ case '%':
8
+ return length.value * parent;
9
+ case 'dip':
10
+ return Utils.layout.toDevicePixels(length.value);
11
+ case 'px':
12
+ return length.value;
13
+ }
14
+ }
15
+ export class Tree {
4
16
  constructor() {
5
- super(...arguments);
6
- this.__masonStylePtr = 0;
7
- this.__masonNodePtr = 0;
8
- this.__masonPtr = 0;
9
- this._hasNativeView = false;
17
+ this._base = NSCMason.shared;
10
18
  }
11
- get _masonStylePtr() {
12
- if (this.__masonStylePtr === 0) {
13
- this.__masonStylePtr = String(this.ios?.masonStylePtr ?? 0); // cast as string for now
14
- }
15
- return this.__masonStylePtr;
19
+ static get instance() {
20
+ return Tree._tree;
16
21
  }
17
- get _masonNodePtr() {
18
- if (this.__masonNodePtr === 0) {
19
- this.__masonNodePtr = String(this.ios?.masonNodePtr ?? 0); // cast as string for now
20
- }
21
- return this.__masonNodePtr;
22
+ get native() {
23
+ return this._base;
24
+ }
25
+ createView() {
26
+ return this.native.createView();
22
27
  }
23
- get _masonPtr() {
24
- if (this.__masonPtr === 0) {
25
- this.__masonPtr = String(UIView.masonPtr ?? 0); // cast as string for now
28
+ createTextView() {
29
+ return this.native.createTextView();
30
+ }
31
+ }
32
+ _a = Tree;
33
+ (() => {
34
+ _a._tree = new Tree();
35
+ })();
36
+ export class View extends ViewBase {
37
+ constructor() {
38
+ super();
39
+ this._hasNativeView = false;
40
+ this._inBatch = false;
41
+ const view = Tree.instance.createView();
42
+ this._hasNativeView = true;
43
+ this._view = view;
44
+ }
45
+ get _styleHelper() {
46
+ if (this[style_] === undefined) {
47
+ this[style_] = Style.fromView(this, this._view);
26
48
  }
27
- return this.__masonPtr;
49
+ return this[style_];
28
50
  }
29
51
  createNativeView() {
30
- this._hasNativeView = true;
31
- const view = UIView.alloc().initWithFrame(CGRectZero);
32
- view.mason.isEnabled = true;
33
- return view;
52
+ return this._view;
34
53
  }
35
54
  disposeNativeView() {
36
55
  this._hasNativeView = false;
37
56
  super.disposeNativeView();
38
57
  }
39
- //@ts-ignore
58
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
59
+ // @ts-ignore
40
60
  get ios() {
41
- return this.nativeViewProtected;
61
+ return this._view;
42
62
  }
43
63
  onLayout(left, top, right, bottom) {
44
64
  super.onLayout(left, top, right, bottom);
45
- const nativeView = this.nativeView;
46
- if (nativeView) {
47
- this.eachLayoutChild((child) => {
48
- const layout = child.ios.mason.layout();
49
- child.setMeasuredDimension(layout.width, layout.height);
50
- View.layoutChild(this, child, layout.x, layout.y, layout.width, layout.height);
51
- return true;
52
- });
65
+ let layout = this._view.node.layoutCache ?? this._view.node.layout();
66
+ const children = layout.children;
67
+ let i = 0;
68
+ for (const child of this._children) {
69
+ layout = children.objectAtIndex(i);
70
+ const x = layout.x;
71
+ const y = layout.y;
72
+ const width = x + layout.width;
73
+ const height = y + layout.height;
74
+ View.layoutChild(this, child, x, y, width, height);
75
+ i++;
53
76
  }
54
77
  }
55
78
  onMeasure(widthMeasureSpec, heightMeasureSpec) {
56
- const nativeView = this.nativeView;
79
+ const nativeView = this._view;
57
80
  if (nativeView) {
58
- const width = Utils.layout.getMeasureSpecSize(widthMeasureSpec);
59
- const height = Utils.layout.getMeasureSpecSize(heightMeasureSpec);
60
- if (!this._masonParent) {
61
- this.ios.setSize(width, height);
62
- }
81
+ const specWidth = Utils.layout.getMeasureSpecSize(widthMeasureSpec);
82
+ const widthMode = Utils.layout.getMeasureSpecMode(widthMeasureSpec);
83
+ const specHeight = Utils.layout.getMeasureSpecSize(heightMeasureSpec);
84
+ const heightMode = Utils.layout.getMeasureSpecMode(heightMeasureSpec);
63
85
  if (!this._isMasonChild) {
64
86
  // only call compute on the parent
65
- this.ios.mason.computeWithMaxContent();
87
+ if (this.width === 'auto' && this.height === 'auto') {
88
+ this.ios.node.computeWithSize(specWidth, specHeight);
89
+ const layout = this.ios.node.layout();
90
+ const w = Utils.layout.makeMeasureSpec(layout.width, Utils.layout.EXACTLY);
91
+ const h = Utils.layout.makeMeasureSpec(layout.height, Utils.layout.EXACTLY);
92
+ this.eachLayoutChild((child) => {
93
+ ViewBase.measureChild(this, child, child._currentWidthMeasureSpec, child._currentHeightMeasureSpec);
94
+ });
95
+ this.setMeasuredDimension(w, h);
96
+ return;
97
+ }
98
+ else {
99
+ this.ios.node.computeWithMaxContent();
100
+ const layout = this.ios.node.layoutCache ?? this.ios.node.layout();
101
+ const w = Utils.layout.makeMeasureSpec(layout.width, Utils.layout.EXACTLY);
102
+ const h = Utils.layout.makeMeasureSpec(layout.height, Utils.layout.EXACTLY);
103
+ this.setMeasuredDimension(w, h);
104
+ this.eachLayoutChild((child) => {
105
+ ViewBase.measureChild(this, child, child._currentWidthMeasureSpec, child._currentHeightMeasureSpec);
106
+ });
107
+ }
108
+ }
109
+ else {
110
+ const layout = this.ios.node.layoutCache ?? this.ios.node.layout();
111
+ const w = Utils.layout.makeMeasureSpec(layout.width, Utils.layout.EXACTLY);
112
+ const h = Utils.layout.makeMeasureSpec(layout.height, Utils.layout.EXACTLY);
113
+ this.setMeasuredDimension(w, h);
114
+ this.eachLayoutChild((child) => {
115
+ ViewBase.measureChild(this, child, child._currentWidthMeasureSpec, child._currentHeightMeasureSpec);
116
+ });
66
117
  }
67
- const layout = this.ios.mason.layout();
68
- this.setMeasuredDimension(layout.width, layout.height);
69
118
  }
70
119
  }
71
- layoutNativeView() {
72
- // noop
73
- }
74
- _addViewToNativeVisualTree(view, atIndex) {
75
- const nativeView = this.nativeView;
76
- view._masonParent = this;
77
- super._addViewToNativeVisualTree(view, atIndex);
78
- // if (nativeView && view.nativeViewProtected) {
79
- // console.log(view.nativeViewProtected);
80
- // nativeView.addSubview(view.nativeViewProtected);
81
- // }
82
- const index = atIndex ?? Infinity;
83
- if (nativeView && view.nativeViewProtected) {
84
- view['_hasNativeView'] = true;
85
- view['_isMasonChild'] = true;
86
- if (index >= nativeView.subviews.count) {
87
- nativeView.addSubview(view.nativeViewProtected);
120
+ _setNativeViewFrame(nativeView, frame) {
121
+ nativeView.frame = frame;
122
+ }
123
+ _addViewToNativeVisualTree(child, atIndex = -1) {
124
+ const nativeView = this._view;
125
+ child._masonParent = this;
126
+ if (nativeView && child.nativeViewProtected) {
127
+ child._hasNativeView = true;
128
+ child._isMasonChild = true;
129
+ if (atIndex <= -1) {
130
+ nativeView.addView(child.nativeViewProtected);
88
131
  }
89
132
  else {
90
- nativeView.insertSubviewAtIndex(view.nativeViewProtected, index);
133
+ nativeView.addViewAt(child.nativeViewProtected, atIndex);
91
134
  }
135
+ return true;
92
136
  }
93
- return true;
137
+ return false;
94
138
  }
95
139
  _removeViewFromNativeVisualTree(view) {
96
- const nativeView = this.viewController.view;
97
140
  view._masonParent = undefined;
98
141
  view._isMasonView = false;
99
142
  view._isMasonChild = false;
100
143
  super._removeViewFromNativeVisualTree(view);
101
- if (view.nativeViewProtected) {
102
- if (view.nativeViewProtected.superview === nativeView) {
103
- view.nativeViewProtected.removeFromSuperview();
104
- }
105
- }
106
144
  }
107
145
  }
108
- export class Grid extends TSCView {
109
- createNativeView() {
110
- const view = UIView.createGridView();
146
+ export class Text extends TextBase {
147
+ constructor() {
148
+ super();
149
+ this._hasNativeView = false;
150
+ this._inBatch = false;
151
+ this._isText = true;
152
+ const view = Tree.instance.createTextView();
153
+ this._view = view;
111
154
  this._hasNativeView = true;
112
- return view;
155
+ this[style_] = Style.fromView(this, view, true);
156
+ }
157
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
158
+ // @ts-ignore
159
+ get ios() {
160
+ return this._view;
161
+ }
162
+ get _styleHelper() {
163
+ if (this[style_] === undefined) {
164
+ this[style_] = Style.fromView(this, this._view);
165
+ }
166
+ return this[style_];
113
167
  }
114
- }
115
- export class Flex extends TSCView {
116
168
  createNativeView() {
117
- const view = UIView.createFlexView();
118
- this._hasNativeView = true;
119
- return view;
169
+ return this._view;
170
+ }
171
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
172
+ //@ts-ignore
173
+ get text() {
174
+ return this._view.text;
175
+ }
176
+ set text(value) {
177
+ const nativeView = this._view;
178
+ if (nativeView) {
179
+ nativeView.updateText(value);
180
+ }
181
+ }
182
+ // [textProperty.setNative](value) {
183
+ // const nativeView = this._view;
184
+ // console.log('text:setNative', value);
185
+ // if (nativeView) {
186
+ // nativeView.updateText(value);
187
+ // }
188
+ // }
189
+ [colorProperty.setNative](value) {
190
+ switch (typeof value) {
191
+ case 'number':
192
+ this[style_].color = value;
193
+ this[style_].syncStyle(true);
194
+ break;
195
+ case 'string':
196
+ {
197
+ this[style_].color = new Color(value).argb;
198
+ this[style_].syncStyle(true);
199
+ }
200
+ break;
201
+ case 'object':
202
+ {
203
+ this[style_].color = value.argb;
204
+ this[style_].syncStyle(true);
205
+ }
206
+ break;
207
+ }
208
+ }
209
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
210
+ // @ts-ignore
211
+ set backgroundColor(value) {
212
+ switch (typeof value) {
213
+ case 'number':
214
+ this[style_].backgroundColor = value;
215
+ this[style_].syncStyle(true);
216
+ break;
217
+ case 'string':
218
+ {
219
+ this[style_].backgroundColor = new Color(value).argb;
220
+ this[style_].syncStyle(true);
221
+ }
222
+ break;
223
+ case 'object':
224
+ this[style_].backgroundColor = value.argb;
225
+ this[style_].syncStyle(true);
226
+ break;
227
+ }
228
+ }
229
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
230
+ // @ts-ignore
231
+ get backgroundColor() {
232
+ return new Color(this[style_].backgroundColor);
233
+ }
234
+ // [backgroundColorProperty.setNative](value) {
235
+ // console.log('backgroundColorProperty.setNative', value);
236
+ // // if (typeof value === 'number') {
237
+ // // this[style_].backgroundColor = value;
238
+ // // this[style_].syncStyle(true);
239
+ // // } else if (value instanceof Color) {
240
+ // // this[style_].backgroundColor = value.argb;
241
+ // // this[style_].syncStyle(true);
242
+ // // }
243
+ // }
244
+ [textWrapProperty.setNative](value) {
245
+ switch (value) {
246
+ case 'false':
247
+ case false:
248
+ case 'nowrap':
249
+ this[style_].textWrap = 0 /* TextWrap.NoWrap */;
250
+ this[style_].syncStyle(true);
251
+ break;
252
+ case true:
253
+ case 'true':
254
+ case 'wrap':
255
+ this[style_].textWrap = 1 /* TextWrap.Wrap */;
256
+ this[style_].syncStyle(true);
257
+ break;
258
+ case 'balance':
259
+ this[style_].textWrap = 2 /* TextWrap.Balance */;
260
+ this[style_].syncStyle(true);
261
+ break;
262
+ }
263
+ }
264
+ onLayout(left, top, right, bottom) {
265
+ super.onLayout(left, top, right, bottom);
266
+ let layout = this._view.node.layoutCache ?? this._view.node.layout();
267
+ const children = layout.children;
268
+ let i = 1;
269
+ for (const child of this._children) {
270
+ layout = children.objectAtIndex(i);
271
+ const x = layout.x;
272
+ const y = layout.y;
273
+ const width = layout.width;
274
+ const height = layout.height;
275
+ View.layoutChild(this, child, x, y, width, height);
276
+ i++;
277
+ }
278
+ }
279
+ onMeasure(widthMeasureSpec, heightMeasureSpec) {
280
+ const nativeView = this._view;
281
+ if (nativeView) {
282
+ const specWidth = Utils.layout.getMeasureSpecSize(widthMeasureSpec);
283
+ const widthMode = Utils.layout.getMeasureSpecMode(widthMeasureSpec);
284
+ const specHeight = Utils.layout.getMeasureSpecSize(heightMeasureSpec);
285
+ const heightMode = Utils.layout.getMeasureSpecMode(heightMeasureSpec);
286
+ if (!this._isMasonChild) {
287
+ // only call compute on the parent
288
+ if (this.width === 'auto' && this.height === 'auto') {
289
+ this.ios.node.computeWithMaxContent();
290
+ const layout = this.ios.node.layout();
291
+ const w = Utils.layout.makeMeasureSpec(layout.width, Utils.layout.EXACTLY);
292
+ const h = Utils.layout.makeMeasureSpec(layout.height, Utils.layout.EXACTLY);
293
+ this.setMeasuredDimension(w, h);
294
+ return;
295
+ }
296
+ else {
297
+ let width;
298
+ switch (typeof this.width) {
299
+ case 'object': {
300
+ const parent = this.parent;
301
+ const mw = parent?.getMeasuredWidth?.() || Utils.layout.toDevicePixels(parent?.nativeView?.frame?.size?.width ?? 0);
302
+ width = parseLength(this.width, mw);
303
+ break;
304
+ }
305
+ case 'string':
306
+ width = -2;
307
+ break;
308
+ case 'number':
309
+ width = Utils.layout.toDevicePixels(this.width);
310
+ break;
311
+ }
312
+ let height;
313
+ switch (typeof this.height) {
314
+ case 'object': {
315
+ const parent = this.parent;
316
+ const mh = parent?.getMeasuredHeight?.() || Utils.layout.toDevicePixels(parent?.nativeView?.frame?.size?.height ?? 0);
317
+ height = parseLength(this.height, mh);
318
+ break;
319
+ }
320
+ case 'string':
321
+ height = -2;
322
+ break;
323
+ case 'number':
324
+ height = Utils.layout.toDevicePixels(this.height);
325
+ break;
326
+ }
327
+ this.ios.node.computeWithSize(width, height);
328
+ const layout = this.ios.node.layout();
329
+ const w = Utils.layout.makeMeasureSpec(layout.width, Utils.layout.EXACTLY);
330
+ const h = Utils.layout.makeMeasureSpec(layout.height, Utils.layout.EXACTLY);
331
+ this.setMeasuredDimension(w, h);
332
+ }
333
+ }
334
+ else {
335
+ const layout = nativeView.node.layoutCache ?? nativeView.node.layout();
336
+ const w = Utils.layout.makeMeasureSpec(layout.width, Utils.layout.EXACTLY);
337
+ const h = Utils.layout.makeMeasureSpec(layout.height, Utils.layout.EXACTLY);
338
+ this.setMeasuredDimension(w, h);
339
+ }
340
+ }
341
+ }
342
+ _addViewToNativeVisualTree(child, atIndex = -1) {
343
+ const nativeView = this._view;
344
+ if (nativeView && child.nativeViewProtected) {
345
+ child._hasNativeView = true;
346
+ child._isMasonChild = true;
347
+ nativeView.addView(child.nativeViewProtected, atIndex ?? -1);
348
+ return true;
349
+ }
350
+ return false;
351
+ }
352
+ _setNativeViewFrame(nativeView, frame) {
353
+ nativeView.frame = frame;
120
354
  }
121
- }
122
- export class Container extends TSCView {
123
355
  }
124
356
  //# sourceMappingURL=index.ios.js.map