@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/common.js CHANGED
@@ -1,533 +1,195 @@
1
- import { CssProperty, Style, Length as NSLength, ShorthandProperty, CSSType, borderBottomWidthProperty, borderLeftWidthProperty, borderRightWidthProperty, borderTopWidthProperty, marginBottomProperty, marginLeftProperty, marginRightProperty, marginTopProperty, paddingBottomProperty, paddingLeftProperty, paddingRightProperty, paddingTopProperty, CustomLayoutView, heightProperty, minHeightProperty, minWidthProperty, widthProperty, View } from '@nativescript/core';
2
- import { _forceStyleUpdate, _getAlignContent, _getAlignItems, _getAlignSelf, _getAspectRatio, _getColumnGap, _getDisplay, _getFlexBasis, _getFlexDirection, _getFlexGrow, _getFlexShrink, _getFlexWrap, _getHeight, _getJustifyContent, _getJustifyItems, _getJustifySelf, _getPosition, _getRowGap, _getWidth, _parseGridTemplates, _setAlignContent, _setAlignItems, _setAlignSelf, _setAspectRatio, _setBorderBottom, _setBorderLeft, _setBorderRight, _setBorderTop, _setBottom, _setColumnGap, _setDisplay, _setFlexBasis, _setFlexDirection, _setFlexGrow, _setFlexShrink, _setFlexWrap, _setGridAutoColumns, _setGridAutoRows, _setGridColumnEnd, _setGridColumnStart, _setGridRowEnd, _setGridRowStart, _setGridTemplateColumns, _setGridTemplateRows, _setHeight, _setJustifyContent, _setJustifyItems, _setJustifySelf, _setLeft, _setMarginBottom, _setMarginLeft, _setMarginRight, _setMarginTop, _setMaxHeight, _setMaxWidth, _setMinHeight, _setMinWidth, _setPaddingBottom, _setPaddingLeft, _setPaddingRight, _setPaddingTop, _setPosition, _setRight, _setRowGap, _setTop, _setWidth, } from './helpers';
3
- // let widgetMasonView: typeof org.nativescript.mason.masonkit.View;
4
- // function ensureNativeTypes() {
5
- // if (!widgetMasonView) {
6
- // widgetMasonView = org.nativescript.mason.masonkit.View;
7
- // }
8
- // }
9
- // function makeNativeSetter<T>(setter: (lp: org.nativescript.widgets.FlexboxLayout.LayoutParams, value: T) => void) {
10
- // return function (this: View, value: T) {
11
- // ensureNativeTypes();
12
- // const nativeView: android.view.View = this.nativeViewProtected;
13
- // const lp = nativeView.getLayoutParams() || new widgetLayoutParams();
14
- // if (lp instanceof widgetLayoutParams) {
15
- // setter(lp, value);
16
- // nativeView.setLayoutParams(lp);
17
- // }
18
- // };
19
- // }
20
- export function applyMixins(derivedCtor, baseCtors, options) {
21
- const omits = options && options.omit ? options.omit : [];
22
- baseCtors.forEach((baseCtor) => {
23
- Object.getOwnPropertyNames(baseCtor.prototype).forEach((name) => {
24
- if (omits.indexOf(name) !== -1) {
25
- return;
26
- }
27
- const descriptor = Object.getOwnPropertyDescriptor(baseCtor.prototype, name);
28
- if (name === 'constructor')
29
- return;
30
- if (descriptor && (descriptor.get || descriptor.set)) {
31
- Object.defineProperty(derivedCtor.prototype, name, descriptor);
32
- }
33
- else {
34
- const oldImpl = derivedCtor.prototype[name];
35
- if (!oldImpl) {
36
- derivedCtor.prototype[name] = baseCtor.prototype[name];
37
- }
38
- else {
39
- derivedCtor.prototype[name] = function (...args) {
40
- if (options) {
41
- if (options.override) {
42
- return baseCtor.prototype[name].apply(this, args);
43
- }
44
- else if (options.after) {
45
- return baseCtor.prototype[name].apply(this, args);
46
- }
47
- else if (options.overrideIfExists) {
48
- if (this[options.overrideIfExists]) {
49
- return baseCtor.prototype[name].apply(this, args);
50
- }
51
- return oldImpl.apply(this, args);
52
- }
53
- else {
54
- baseCtor.prototype[name].apply(this, args);
55
- return oldImpl.apply(this, args);
56
- }
57
- }
58
- else {
59
- baseCtor.prototype[name].apply(this, args);
60
- return oldImpl.apply(this, args);
61
- }
62
- };
63
- }
64
- }
65
- });
66
- Object.getOwnPropertySymbols(baseCtor.prototype).forEach((symbol) => {
67
- if (omits.indexOf(symbol) !== -1) {
68
- return;
69
- }
70
- const oldImpl = derivedCtor.prototype[symbol];
71
- if (!oldImpl) {
72
- derivedCtor.prototype[symbol] = baseCtor.prototype[symbol];
73
- }
74
- else {
75
- derivedCtor.prototype[symbol] = function (...args) {
76
- if (options) {
77
- if (options.override) {
78
- return baseCtor.prototype[symbol].apply(this, args);
79
- }
80
- if (options.overrideIfExists) {
81
- if (this[options.overrideIfExists]) {
82
- return baseCtor.prototype[symbol].apply(this, args);
83
- }
84
- return oldImpl.apply(this, args);
85
- }
86
- else if (options.after) {
87
- oldImpl.apply(this, args);
88
- return baseCtor.prototype[symbol].apply(this, args);
89
- }
90
- else {
91
- baseCtor.prototype[symbol].apply(this, args);
92
- return oldImpl.apply(this, args);
93
- }
94
- }
95
- else {
96
- baseCtor.prototype[symbol].apply(this, args);
97
- return oldImpl.apply(this, args);
98
- }
99
- };
100
- }
101
- });
102
- });
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ /* eslint-disable @typescript-eslint/ban-ts-comment */
3
+ import { CSSType, CssProperty, CustomLayoutView, Length as NSLength, ShorthandProperty, Style, View as NSView, getViewById, unsetValue, Property, widthProperty, heightProperty, CoreTypes, Trace, Length as CoreLength, marginLeftProperty, marginRightProperty, marginTopProperty, marginBottomProperty, minWidthProperty, minHeightProperty } from '@nativescript/core';
4
+ import { _forceStyleUpdate, _parseGridTemplates, _setAlignContent, _setColumnGap, _setDisplay, _setFlexDirection, _setGridColumnEnd, _setGridColumnStart, _setGridRowEnd, _setGridRowStart, _setGridTemplateColumns, _setGridTemplateRows, _setHeight, _setJustifyContent, _setMarginBottom, _setMarginLeft, _setMarginRight, _setMarginTop, _setMinHeight, _setMinWidth, _setPaddingBottom, _setPaddingLeft, _setPaddingRight, _setPaddingTop, _setRowGap, _setWidth } from './helpers';
5
+ import { flexDirectionProperty, flexGrowProperty, flexWrapProperty } from '@nativescript/core/ui/layouts/flexbox-layout';
6
+ export const native_ = Symbol('[[native]]');
7
+ export const style_ = Symbol('[[style]]');
8
+ export const scrollBarWidthProperty = new CssProperty({
9
+ name: 'scrollBarWidth',
10
+ cssName: 'scroll-bar-width',
11
+ defaultValue: 0,
12
+ valueConverter: parseFloat,
13
+ });
14
+ function overflowConverter(value) {
15
+ if (typeof value === 'number') {
16
+ switch (value) {
17
+ case 0:
18
+ return 'visible';
19
+ case 1:
20
+ return 'hidden';
21
+ case 2:
22
+ return 'scroll';
23
+ }
24
+ }
25
+ switch (value) {
26
+ case 'visible':
27
+ case 'hidden':
28
+ case 'scroll':
29
+ return value;
30
+ default:
31
+ return 'visible';
32
+ }
103
33
  }
104
- let mixinInstalled = false;
105
- export function overrideViewBase() {
106
- const NSView = require('@nativescript/core').View;
107
- class ViewOverride extends View {
108
- constructor() {
109
- super(...arguments);
110
- this._isMasonView = false;
111
- this._isMasonChild = false;
112
- }
113
- get _isMasonViewOrChild() {
114
- return this._isMasonView || this._isMasonChild;
115
- }
116
- /* Short Props */
117
- set gridRowGap(value) {
118
- this.style.gridRowGap = value;
119
- }
120
- get gridRowGap() {
121
- return this.style.gridRowGap;
122
- }
123
- set gridGap(value) {
124
- this.style.gridGap = value;
125
- }
126
- get gridGap() {
127
- return this.style.gridGap;
128
- }
129
- set gap(value) {
130
- this.style.gap = value;
131
- }
132
- get gap() {
133
- return this.style.gap;
134
- }
135
- set gridArea(value) {
136
- this.style.gridArea = value;
137
- }
138
- get gridArea() {
139
- return this.style.gridArea;
140
- }
141
- set gridColumn(value) {
142
- this.style.gridColumn = value;
143
- }
144
- get gridColumn() {
145
- return this.style.gridColumn;
146
- }
147
- set gridRow(value) {
148
- this.style.gridRow = value;
149
- }
150
- get gridRow() {
151
- return this.style.gridColumn;
152
- }
153
- /* Short Props */
154
- get display() {
155
- return _getDisplay(this);
156
- }
157
- set display(value) {
158
- this.style.display = value;
159
- }
160
- [displayProperty.setNative](value) {
161
- _setDisplay(value, this);
162
- }
163
- set position(value) {
164
- this.style.position = value;
165
- }
166
- get position() {
167
- return _getPosition(this);
168
- }
169
- [positionProperty.setNative](value) {
170
- _setPosition(value, this);
171
- }
172
- set flexDirection(value) {
173
- this.style.flexDirection = value;
174
- }
175
- get flexDirection() {
176
- return _getFlexDirection(this);
177
- }
178
- [flexDirectionProperty.setNative](value) {
179
- _setFlexDirection(value, this);
180
- }
181
- set flexWrap(value) {
182
- this.style.flexWrap = value;
183
- }
184
- [flexWrapProperty.setNative](value) {
185
- _setFlexWrap(value, this);
186
- }
187
- get flexWrap() {
188
- return _getFlexWrap(this);
189
- }
190
- set alignItems(value) {
191
- this.style.alignItems = value;
192
- }
193
- get alignItems() {
194
- return _getAlignItems(this);
195
- }
196
- [alignItemsProperty.setNative](value) {
197
- _setAlignItems(value, this);
198
- }
199
- //@ts-ignore
200
- set alignSelf(value) {
201
- this.style.alignSelf = value;
202
- }
203
- //@ts-ignore
204
- get alignSelf() {
205
- return _getAlignSelf(this);
206
- }
207
- [alignSelfProperty.setNative](value) {
208
- _setAlignSelf(value, this);
209
- }
210
- set alignContent(value) {
211
- this.style.alignContent = value;
212
- }
213
- [alignContentProperty.setNative](value) {
214
- _setAlignContent(value, this);
215
- }
216
- get alignContent() {
217
- return _getAlignContent(this);
218
- }
219
- set justifyItems(value) {
220
- this.style.justifyItems = value;
221
- }
222
- [justifyItemsProperty.setNative](value) {
223
- _setJustifyItems(value, this);
224
- }
225
- get justifyItems() {
226
- return _getJustifyItems(this);
227
- }
228
- set justifySelf(value) {
229
- this.style.justifySelf = value;
230
- }
231
- [justifySelfProperty.setNative](value) {
232
- _setJustifySelf(value, this);
233
- }
234
- get justifySelf() {
235
- return _getJustifySelf(this);
236
- }
237
- set justifyContent(value) {
238
- this.style.justifyContent = value;
239
- }
240
- [justifyContentProperty.setNative](value) {
241
- _setJustifyContent(value, this);
242
- }
243
- get justifyContent() {
244
- return _getJustifyContent(this);
245
- }
246
- //@ts-ignore
247
- set left(value) {
248
- this.style.left = value;
249
- }
250
- get left() {
251
- return this.style.left;
252
- }
253
- [leftProperty.setNative](value) {
254
- _setLeft(value, this);
255
- }
256
- //@ts-ignore
257
- set right(value) {
258
- this.style.right = value;
259
- }
260
- get right() {
261
- return this.style.right;
262
- }
263
- [rightProperty.setNative](value) {
264
- _setRight(value, this);
265
- }
266
- //@ts-ignore
267
- set top(value) {
268
- this.style.top = value;
269
- }
270
- get top() {
271
- return this.style.top;
272
- }
273
- [topProperty.setNative](value) {
274
- _setTop(value, this);
275
- }
276
- //@ts-ignore
277
- set bottom(value) {
278
- this.style.bottom = value;
279
- }
280
- get bottom() {
281
- return this.style.bottom;
282
- }
283
- [bottomProperty.setNative](value) {
284
- _setBottom(value, this);
285
- }
286
- [marginLeftProperty.setNative](value) {
287
- _setMarginLeft(value, this);
288
- }
289
- [marginRightProperty.setNative](value) {
290
- _setMarginRight(value, this);
291
- }
292
- [marginTopProperty.setNative](value) {
293
- _setMarginTop(value, this);
294
- }
295
- [marginBottomProperty.setNative](value) {
296
- _setMarginBottom(value, this);
297
- }
298
- [borderLeftWidthProperty.setNative](value) {
299
- _setBorderLeft(value, this);
300
- }
301
- [borderRightWidthProperty.setNative](value) {
302
- _setBorderRight(value, this);
303
- }
304
- [borderTopWidthProperty.setNative](value) {
305
- _setBorderTop(value, this);
306
- }
307
- [borderBottomWidthProperty.setNative](value) {
308
- _setBorderBottom(value, this);
309
- }
310
- //@ts-ignore
311
- get flexGrow() {
312
- return _getFlexGrow(this);
313
- }
314
- set flexGrow(value) {
315
- this.style.flexGrow = value;
316
- }
317
- [flexGrowProperty.setNative](value) {
318
- _setFlexGrow(value, this);
319
- }
320
- //@ts-ignore
321
- get flexShrink() {
322
- return _getFlexShrink(this);
323
- }
324
- set flexShrink(value) {
325
- this.style.flexShrink = value;
326
- }
327
- [flexShrinkProperty.setNative](value) {
328
- _setFlexShrink(value, this);
329
- }
330
- //@ts-ignore
331
- get flexBasis() {
332
- return _getFlexBasis(this);
333
- }
334
- [flexBasisProperty.setNative](value) {
335
- _setFlexBasis(value, this);
336
- }
337
- /* faster setter/getter
338
- //@ts-ignore
339
- get gap() {
340
- return _getGap(this as any);
341
- }
342
-
343
- set gap(value) {
344
- this.style.gap = value;
345
- _setGap(value, this as any);
346
- }
347
-
348
- */
349
- set rowGap(value) {
350
- this.style.rowGap = value;
351
- }
352
- get rowGap() {
353
- return _getRowGap(this);
354
- }
355
- [rowGapProperty.setNative](value) {
356
- _setRowGap(value, this);
357
- }
358
- set columnGap(value) {
359
- this.style.columnGap = value;
360
- }
361
- get columnGap() {
362
- return _getColumnGap(this);
363
- }
364
- [columnGapProperty.setNative](value) {
365
- _setColumnGap(value, this);
366
- }
367
- get aspectRatio() {
368
- return _getAspectRatio(this);
369
- }
370
- [aspectRatioProperty.setNative](value) {
371
- _setAspectRatio(value, this);
372
- }
373
- [paddingLeftProperty.setNative](value) {
374
- _setPaddingLeft(value, this);
375
- }
376
- [paddingTopProperty.setNative](value) {
377
- _setPaddingTop(value, this);
378
- }
379
- [paddingRightProperty.setNative](value) {
380
- _setPaddingRight(value, this);
381
- }
382
- [paddingBottomProperty.setNative](value) {
383
- _setPaddingBottom(value, this);
384
- }
385
- //@ts-ignore
386
- set minWidth(value) {
387
- this.style.minWidth = value;
388
- }
389
- [minWidthProperty.setNative](value) {
390
- _setMinWidth(value, this);
391
- }
392
- //@ts-ignore
393
- set minHeight(value) {
394
- this.style.minHeight = value;
395
- }
396
- [minHeightProperty.setNative](value) {
397
- _setMinHeight(value, this);
398
- }
399
- //@ts-ignore
400
- set width(value) {
401
- this.style.width = value;
402
- }
403
- [widthProperty.setNative](value) {
404
- _setWidth(value, this);
405
- }
406
- get width() {
407
- return _getWidth(this);
408
- }
409
- //@ts-ignore
410
- set height(value) {
411
- this.style.height = value;
412
- }
413
- [heightProperty.setNative](value) {
414
- _setHeight(value, this);
415
- }
416
- //@ts-ignore
417
- get height() {
418
- return _getHeight(this);
419
- }
420
- set maxWidth(value) {
421
- this.style.maxWidth = value;
422
- }
423
- [maxWidthProperty.setNative](value) {
424
- _setMaxWidth(value, this);
425
- }
426
- //@ts-ignore
427
- set maxHeight(value) {
428
- this.style.maxHeight = value;
429
- }
430
- [maxHeightProperty.setNative](value) {
431
- _setMaxHeight(value, this);
432
- }
433
- //@ts-ignore
434
- set gridAutoRows(value) {
435
- this.style.gridAutoRows = value;
436
- }
437
- [gridAutoRowsProperty.setNative](value) {
438
- _setGridAutoRows(value, this);
439
- }
440
- //@ts-ignore
441
- get gridAutoRows() {
442
- return this.style.gridAutoRows;
443
- }
444
- //@ts-ignore
445
- set gridAutoColumns(value) {
446
- this.style.gridAutoColumns = value;
447
- }
448
- [gridAutoColumnsProperty.setNative](value) {
449
- _setGridAutoColumns(value, this);
450
- }
451
- get gridAutoColumns() {
452
- return this.style.gridAutoColumns;
453
- }
454
- set gridAutoFlow(value) {
455
- this.style.gridAutoFlow = value;
456
- }
457
- [gridAutoFlowProperty.setNative](value) { }
458
- get gridAutoFlow() {
459
- return this.style.gridAutoFlow;
460
- }
461
- set gridColumnStart(value) {
462
- this.style.gridColumnStart = value;
463
- }
464
- [gridColumnStartProperty.setNative](value) {
465
- _setGridColumnStart(value, this);
466
- }
467
- get gridColumnStart() {
468
- return this.style.gridColumnStart;
469
- }
470
- set gridColumnEnd(value) {
471
- this.style.gridColumnEnd = value;
472
- }
473
- [gridColumnEndProperty.setNative](value) {
474
- _setGridColumnEnd(value, this);
475
- }
476
- get gridColumnEnd() {
477
- return this.style.gridColumnEnd;
34
+ export const overflowProperty = new CssProperty({
35
+ name: 'overflow',
36
+ cssName: 'overflow',
37
+ defaultValue: 'visible',
38
+ valueConverter: overflowConverter,
39
+ });
40
+ export const overflowXProperty = new CssProperty({
41
+ name: 'overflowX',
42
+ cssName: 'overflow-x',
43
+ defaultValue: 'visible',
44
+ valueConverter: overflowConverter,
45
+ });
46
+ export const overflowYProperty = new CssProperty({
47
+ name: 'overflow',
48
+ cssName: 'overflow-y',
49
+ defaultValue: 'visible',
50
+ valueConverter: overflowConverter,
51
+ });
52
+ const paddingProperty = new ShorthandProperty({
53
+ name: 'padding',
54
+ cssName: 'padding',
55
+ getter: function () {
56
+ if (CoreLength.equals(this.paddingTop, this.paddingRight) && CoreLength.equals(this.paddingTop, this.paddingBottom) && CoreLength.equals(this.paddingTop, this.paddingLeft)) {
57
+ return this.paddingTop;
478
58
  }
479
- set gridRowStart(value) {
480
- this.style.gridRowStart = value;
59
+ return `${CoreLength.convertToString(this.paddingTop)} ${CoreLength.convertToString(this.paddingRight)} ${CoreLength.convertToString(this.paddingBottom)} ${CoreLength.convertToString(this.paddingLeft)}`;
60
+ },
61
+ converter: convertToPaddings,
62
+ });
63
+ export const paddingLeftProperty = new CssProperty({
64
+ name: 'paddingLeft',
65
+ cssName: 'padding-left',
66
+ defaultValue: CoreTypes.zeroLength,
67
+ affectsLayout: global.isIOS,
68
+ equalityComparer: CoreLength.equals,
69
+ valueChanged: (target, oldValue, newValue) => {
70
+ const view = target.viewRef.get();
71
+ if (view) {
72
+ view.effectivePaddingLeft = CoreLength.toDevicePixels(newValue, 0);
73
+ }
74
+ else {
75
+ Trace.write(`${newValue} not set to view's property because ".viewRef" is cleared`, Trace.categories.Style, Trace.messageType.warn);
481
76
  }
482
- [gridRowStartProperty.setNative](value) {
483
- _setGridRowStart(value, this);
77
+ },
78
+ valueConverter: CoreLength.parse,
79
+ });
80
+ export const paddingRightProperty = new CssProperty({
81
+ name: 'paddingRight',
82
+ cssName: 'padding-right',
83
+ defaultValue: CoreTypes.zeroLength,
84
+ affectsLayout: global.isIOS,
85
+ equalityComparer: CoreLength.equals,
86
+ valueChanged: (target, oldValue, newValue) => {
87
+ const view = target.viewRef.get();
88
+ if (view) {
89
+ view.effectivePaddingRight = CoreLength.toDevicePixels(newValue, 0);
90
+ }
91
+ else {
92
+ Trace.write(`${newValue} not set to view's property because ".viewRef" is cleared`, Trace.categories.Style, Trace.messageType.warn);
484
93
  }
485
- get gridRowStart() {
486
- return this.style.gridRowStart;
94
+ },
95
+ valueConverter: CoreLength.parse,
96
+ });
97
+ export const paddingTopProperty = new CssProperty({
98
+ name: 'paddingTop',
99
+ cssName: 'padding-top',
100
+ defaultValue: CoreTypes.zeroLength,
101
+ affectsLayout: global.isIOS,
102
+ equalityComparer: CoreLength.equals,
103
+ valueChanged: (target, oldValue, newValue) => {
104
+ const view = target.viewRef.get();
105
+ if (view) {
106
+ view.effectivePaddingTop = CoreLength.toDevicePixels(newValue, 0);
107
+ }
108
+ else {
109
+ Trace.write(`${newValue} not set to view's property because ".viewRef" is cleared`, Trace.categories.Style, Trace.messageType.warn);
487
110
  }
488
- set gridRowEnd(value) {
489
- this.style.gridRowEnd = value;
111
+ },
112
+ valueConverter: CoreLength.parse,
113
+ });
114
+ export const paddingBottomProperty = new CssProperty({
115
+ name: 'paddingBottom',
116
+ cssName: 'padding-bottom',
117
+ defaultValue: CoreTypes.zeroLength,
118
+ affectsLayout: global.isIOS,
119
+ equalityComparer: CoreLength.equals,
120
+ valueChanged: (target, oldValue, newValue) => {
121
+ const view = target.viewRef.get();
122
+ if (view) {
123
+ view.effectivePaddingBottom = CoreLength.toDevicePixels(newValue, 0);
124
+ }
125
+ else {
126
+ Trace.write(`${newValue} not set to view's property because ".viewRef" is cleared`, Trace.categories.Style, Trace.messageType.warn);
490
127
  }
491
- [gridRowEndProperty.setNative](value) {
492
- _setGridRowEnd(value, this);
128
+ },
129
+ valueConverter: CoreLength.parse,
130
+ });
131
+ export const rowGapProperty = new CssProperty({
132
+ name: 'rowGap',
133
+ cssName: 'row-gap',
134
+ defaultValue: 0,
135
+ valueConverter(value) {
136
+ const parsed = CoreLength.parse(value);
137
+ if (typeof parsed === 'string') {
138
+ return 0;
493
139
  }
494
- get gridRowEnd() {
495
- return this.style.gridRowEnd;
140
+ return parsed;
141
+ },
142
+ });
143
+ export const columnGapProperty = new CssProperty({
144
+ name: 'columnGap',
145
+ cssName: 'column-gap',
146
+ defaultValue: 0,
147
+ valueConverter(value) {
148
+ const parsed = CoreLength.parse(value);
149
+ if (typeof parsed === 'string') {
150
+ return 0;
496
151
  }
497
- set gridTemplateRows(value) {
498
- this.style.gridTemplateRows = value;
152
+ return parsed;
153
+ },
154
+ });
155
+ export const gapProperty = new ShorthandProperty({
156
+ name: 'gap',
157
+ cssName: 'gap',
158
+ getter: function () {
159
+ if (this.rowGap === this.columnGap) {
160
+ return this.rowGap;
499
161
  }
500
- [gridTemplateRowsProperty.setNative](value) {
501
- const templates = _parseGridTemplates(value);
502
- if (templates) {
503
- _setGridTemplateRows(templates, this);
162
+ return `${this.rowGap} ${this.columnGap}`;
163
+ },
164
+ converter(value) {
165
+ const properties = [];
166
+ if (typeof value === 'string') {
167
+ const values = value.split(/\s+/).filter((item) => item.trim().length !== 0);
168
+ const length = values.length;
169
+ if (length === 0) {
170
+ return properties;
504
171
  }
505
- }
506
- set gridTemplateColumns(value) {
507
- this.style.gridTemplateColumns = value;
508
- }
509
- [gridTemplateColumnsProperty.setNative](value) {
510
- const templates = _parseGridTemplates(value);
511
- if (templates) {
512
- _setGridTemplateColumns(templates, this);
172
+ if (length === 1) {
173
+ const row = values[0];
174
+ properties.push([rowGapProperty, row]);
175
+ properties.push([columnGapProperty, row]);
176
+ }
177
+ if (length > 1) {
178
+ const row = values[0];
179
+ const column = values[1];
180
+ properties.push([rowGapProperty, row]);
181
+ properties.push([columnGapProperty, column]);
513
182
  }
514
183
  }
515
- }
516
- applyMixins(NSView, [ViewOverride], { overrideIfExists: '_isMasonViewOrChild' });
517
- }
518
- export function installMixins() {
519
- if (!mixinInstalled) {
520
- mixinInstalled = true;
521
- overrideViewBase();
522
- }
523
- }
524
- const emptyArray = new Array();
525
- export const flexGrowProperty = new CssProperty({
526
- name: 'flexGrow',
527
- cssName: 'flex-grow',
528
- defaultValue: 0,
529
- valueConverter: parseFloat,
184
+ return properties;
185
+ },
530
186
  });
187
+ // export const flexGrowProperty = new CssProperty<Style, number>({
188
+ // name: 'flexGrow',
189
+ // cssName: 'flex-grow',
190
+ // defaultValue: 0,
191
+ // valueConverter: parseFloat,
192
+ // });
531
193
  export const flexShrinkProperty = new CssProperty({
532
194
  name: 'flexShrink',
533
195
  cssName: 'flex-shrink',
@@ -537,7 +199,7 @@ export const flexShrinkProperty = new CssProperty({
537
199
  export const displayProperty = new CssProperty({
538
200
  name: 'display',
539
201
  cssName: 'display',
540
- defaultValue: 'flex',
202
+ defaultValue: 'block',
541
203
  valueConverter(value) {
542
204
  if (typeof value === 'number') {
543
205
  switch (value) {
@@ -547,16 +209,19 @@ export const displayProperty = new CssProperty({
547
209
  return 'flex';
548
210
  case 2:
549
211
  return 'grid';
212
+ case 3:
213
+ return 'block';
550
214
  }
551
215
  }
552
216
  switch (value) {
553
217
  case 'none':
554
218
  case 'flex':
555
219
  case 'grid':
220
+ case 'block':
556
221
  return value;
557
222
  default:
558
223
  // todo throw???
559
- return 'flex';
224
+ return 'block';
560
225
  }
561
226
  },
562
227
  });
@@ -564,12 +229,14 @@ export const maxWidthProperty = new CssProperty({
564
229
  name: 'maxWidth',
565
230
  cssName: 'max-width',
566
231
  defaultValue: 'auto',
232
+ // @ts-ignore
567
233
  equalityComparer: NSLength.equals,
568
234
  });
569
235
  export const maxHeightProperty = new CssProperty({
570
236
  name: 'maxHeight',
571
237
  cssName: 'max-height',
572
238
  defaultValue: 'auto',
239
+ // @ts-ignore
573
240
  equalityComparer: NSLength.equals,
574
241
  });
575
242
  export const positionProperty = new CssProperty({
@@ -577,37 +244,41 @@ export const positionProperty = new CssProperty({
577
244
  cssName: 'position',
578
245
  defaultValue: 'relative',
579
246
  });
580
- export const flexDirectionProperty = new CssProperty({
581
- name: 'flexDirection',
582
- cssName: 'flex-direction',
583
- });
584
- export const flexWrapProperty = new CssProperty({
585
- name: 'flexWrap',
586
- cssName: 'flex-wrap',
587
- defaultValue: 'no-wrap',
588
- });
247
+ // export const flexDirectionProperty = new CssProperty<Style, FlexDirection>({
248
+ // name: 'flexDirection',
249
+ // cssName: 'flex-direction',
250
+ // });
251
+ // export const flexWrapProperty = new CssProperty<Style, FlexWrap>({
252
+ // name: 'flexWrap',
253
+ // cssName: 'flex-wrap',
254
+ // defaultValue: 'no-wrap',
255
+ // });
589
256
  export const leftProperty = new CssProperty({
590
257
  name: 'left',
591
258
  cssName: 'left',
592
259
  defaultValue: 'auto',
260
+ // @ts-ignore
593
261
  equalityComparer: NSLength.equals,
594
262
  });
595
263
  export const rightProperty = new CssProperty({
596
264
  name: 'right',
597
265
  cssName: 'right',
598
266
  defaultValue: 'auto',
267
+ // @ts-ignore
599
268
  equalityComparer: NSLength.equals,
600
269
  });
601
270
  export const topProperty = new CssProperty({
602
271
  name: 'top',
603
272
  cssName: 'top',
604
273
  defaultValue: 'auto',
274
+ // @ts-ignore
605
275
  equalityComparer: NSLength.equals,
606
276
  });
607
277
  export const bottomProperty = new CssProperty({
608
278
  name: 'bottom',
609
279
  cssName: 'bottom',
610
280
  defaultValue: 'auto',
281
+ // @ts-ignore
611
282
  equalityComparer: NSLength.equals,
612
283
  });
613
284
  export const flexBasisProperty = new CssProperty({
@@ -635,86 +306,6 @@ export const gridColumnGapProperty = new ShorthandProperty({
635
306
  return [[columnGapProperty, value]];
636
307
  },
637
308
  });
638
- export const rowGapProperty = new CssProperty({
639
- name: 'rowGap',
640
- cssName: 'row-gap',
641
- defaultValue: 0,
642
- });
643
- export const columnGapProperty = new CssProperty({
644
- name: 'columnGap',
645
- cssName: 'column-gap',
646
- defaultValue: 0,
647
- });
648
- export const gridGapProperty = new ShorthandProperty({
649
- name: 'gridGap',
650
- cssName: 'grid-gap',
651
- getter: function () {
652
- if (this.rowGap === this.columnGap) {
653
- return this.rowGap;
654
- }
655
- return `${this.rowGap} ${this.columnGap}`;
656
- },
657
- converter(value) {
658
- if (typeof value === 'string') {
659
- const values = value.split(/\s+/).filter((item) => item.trim().length !== 0);
660
- const length = values.length;
661
- if (length === 0) {
662
- return emptyArray;
663
- }
664
- if (length === 1) {
665
- const row = values[0];
666
- return [
667
- [rowGapProperty, row],
668
- [columnGapProperty, row],
669
- ];
670
- }
671
- if (length > 1) {
672
- const row = values[0];
673
- const column = values[1];
674
- return [
675
- [rowGapProperty, row],
676
- [columnGapProperty, column],
677
- ];
678
- }
679
- }
680
- return emptyArray;
681
- },
682
- });
683
- export const gapProperty = new ShorthandProperty({
684
- name: 'gap',
685
- cssName: 'gap',
686
- getter: function () {
687
- if (this.rowGap === this.columnGap) {
688
- return this.rowGap;
689
- }
690
- return `${this.rowGap} ${this.columnGap}`;
691
- },
692
- converter(value) {
693
- if (typeof value === 'string') {
694
- const values = value.split(/\s+/).filter((item) => item.trim().length !== 0);
695
- const length = values.length;
696
- if (length === 0) {
697
- return emptyArray;
698
- }
699
- if (length === 1) {
700
- const row = values[0];
701
- return [
702
- [rowGapProperty, row],
703
- [columnGapProperty, row],
704
- ];
705
- }
706
- if (length > 1) {
707
- const row = values[0];
708
- const column = values[1];
709
- return [
710
- [rowGapProperty, row],
711
- [columnGapProperty, column],
712
- ];
713
- }
714
- }
715
- return emptyArray;
716
- },
717
- });
718
309
  export const aspectRatioProperty = new CssProperty({
719
310
  name: 'aspectRatio',
720
311
  cssName: 'aspect-ratio',
@@ -809,7 +400,7 @@ export const gridAreaProperty = new ShorthandProperty({
809
400
  // grid-row-start / grid-column-start / grid-row-end / grid-column-end
810
401
  const length = values.length;
811
402
  if (length === 0) {
812
- return emptyArray;
403
+ return [];
813
404
  }
814
405
  if (length === 1) {
815
406
  const parsed = parseGridColumnOrRow(values[0]);
@@ -854,7 +445,7 @@ export const gridAreaProperty = new ShorthandProperty({
854
445
  ];
855
446
  }
856
447
  }
857
- return emptyArray;
448
+ return [];
858
449
  },
859
450
  });
860
451
  export const gridColumnStartProperty = new CssProperty({
@@ -881,7 +472,7 @@ export const gridColumnProperty = new ShorthandProperty({
881
472
  const values = value.split('/').filter((item) => item.trim().length !== 0);
882
473
  const length = values.length;
883
474
  if (length === 0) {
884
- return emptyArray;
475
+ return [];
885
476
  }
886
477
  if (length === 1) {
887
478
  const parsed = parseGridColumnOrRow(values[0]);
@@ -901,7 +492,7 @@ export const gridColumnProperty = new ShorthandProperty({
901
492
  ];
902
493
  }
903
494
  }
904
- return emptyArray;
495
+ return [];
905
496
  },
906
497
  });
907
498
  export const gridRowStartProperty = new CssProperty({
@@ -928,7 +519,7 @@ export const gridRowProperty = new ShorthandProperty({
928
519
  const values = value.split('/').filter((item) => item.trim().length !== 0);
929
520
  const length = values.length;
930
521
  if (length === 0) {
931
- return emptyArray;
522
+ return [];
932
523
  }
933
524
  if (length === 1) {
934
525
  const parsed = parseGridColumnOrRow(values[0]);
@@ -948,20 +539,115 @@ export const gridRowProperty = new ShorthandProperty({
948
539
  ];
949
540
  }
950
541
  }
951
- return emptyArray;
542
+ return [];
952
543
  },
953
544
  });
954
545
  export const gridTemplateRowsProperty = new CssProperty({
955
546
  name: 'gridTemplateRows',
956
547
  cssName: 'grid-template-rows',
957
- defaultValue: '',
548
+ defaultValue: null,
958
549
  });
959
550
  export const gridTemplateColumnsProperty = new CssProperty({
960
551
  name: 'gridTemplateColumns',
961
552
  cssName: 'grid-template-columns',
553
+ defaultValue: null,
554
+ });
555
+ // flex-flow: <flex-direction> || <flex-wrap>
556
+ const flexFlowProperty = new ShorthandProperty({
557
+ name: 'flexFlow',
558
+ cssName: 'flex-flow',
559
+ getter: function () {
560
+ return `${this.flexDirection} ${this.flexWrap}`;
561
+ },
562
+ converter: function (value) {
563
+ const properties = [];
564
+ if (value === unsetValue) {
565
+ properties.push([flexDirectionProperty, value]);
566
+ properties.push([flexWrapProperty, value]);
567
+ }
568
+ else {
569
+ const trimmed = value && value.trim();
570
+ if (trimmed) {
571
+ const values = trimmed.split(/\s+/);
572
+ if (values.length >= 1) {
573
+ properties.push([flexDirectionProperty, values[0]]);
574
+ }
575
+ if (value.length >= 2) {
576
+ properties.push([flexWrapProperty, values[1]]);
577
+ }
578
+ }
579
+ }
580
+ return properties;
581
+ },
582
+ });
583
+ // flex: inital | auto | none | <flex-grow> <flex-shrink> || <flex-basis>
584
+ const flexProperty = new ShorthandProperty({
585
+ name: 'flex',
586
+ cssName: 'flex',
587
+ getter: function () {
588
+ return `${this.flexGrow} ${this.flexShrink} ${this.flexBasis}`;
589
+ },
590
+ converter: function (value) {
591
+ const properties = [];
592
+ if (value === unsetValue) {
593
+ properties.push([flexGrowProperty, value]);
594
+ properties.push([flexShrinkProperty, value]);
595
+ }
596
+ else if (typeof value === 'number') {
597
+ properties.push([flexGrowProperty, value]);
598
+ properties.push([flexShrinkProperty, 1]);
599
+ properties.push([flexBasisProperty, 'auto']);
600
+ }
601
+ else {
602
+ const trimmed = value && value.trim();
603
+ if (trimmed) {
604
+ const values = trimmed.split(/\s+/);
605
+ if (values.length === 1) {
606
+ switch (values[0]) {
607
+ case 'inital':
608
+ properties.push([flexGrowProperty, 0]);
609
+ properties.push([flexShrinkProperty, 1]);
610
+ properties.push([flexBasisProperty, 'auto']);
611
+ break;
612
+ case 'auto':
613
+ properties.push([flexGrowProperty, 1]);
614
+ properties.push([flexShrinkProperty, 1]);
615
+ properties.push([flexBasisProperty, 'auto']);
616
+ break;
617
+ case 'none':
618
+ properties.push([flexGrowProperty, 0]);
619
+ properties.push([flexShrinkProperty, 0]);
620
+ properties.push([flexBasisProperty, 'auto']);
621
+ break;
622
+ default:
623
+ properties.push([flexGrowProperty, values[0]]);
624
+ properties.push([flexShrinkProperty, 1]);
625
+ properties.push([flexBasisProperty, 'auto']);
626
+ }
627
+ }
628
+ if (values.length >= 2) {
629
+ properties.push([flexGrowProperty, values[0]]);
630
+ properties.push([flexShrinkProperty, values[1]]);
631
+ }
632
+ if (value.length >= 3) {
633
+ properties.push({ property: flexBasisProperty, value: values[2] });
634
+ }
635
+ }
636
+ }
637
+ return properties;
638
+ },
639
+ });
640
+ export const textWrapProperty = new Property({
641
+ name: 'textWrap',
642
+ affectsLayout: true,
643
+ defaultValue: 'nowrap',
644
+ });
645
+ export const textProperty = new Property({
646
+ name: 'text',
647
+ affectsLayout: true,
962
648
  defaultValue: '',
963
649
  });
964
- let TSCViewBase = class TSCViewBase extends CustomLayoutView {
650
+ let ViewBase = class ViewBase extends CustomLayoutView {
965
651
  constructor() {
966
652
  super();
967
653
  this._children = [];
@@ -972,541 +658,195 @@ let TSCViewBase = class TSCViewBase extends CustomLayoutView {
972
658
  forceStyleUpdate() {
973
659
  _forceStyleUpdate(this);
974
660
  }
975
- /*
976
- markDirty() {
977
- _markDirty(this as any);
978
- }
979
-
980
- isDirty() {
981
- return _isDirty(this as any);
982
- }
983
-
984
- get display(): Display {
985
- return _getDisplay(this as any);
661
+ eachLayoutChild(callback) {
662
+ let lastChild = null;
663
+ this.eachChildView((cv) => {
664
+ cv._eachLayoutView((lv) => {
665
+ if (lastChild && !lastChild.isCollapsed) {
666
+ callback(lastChild, false);
667
+ }
668
+ lastChild = lv;
669
+ });
670
+ return true;
671
+ });
672
+ if (lastChild && !lastChild.isCollapsed) {
673
+ callback(lastChild, true);
674
+ }
986
675
  }
987
-
988
- set display(value) {
989
- this.style.display = value as any;
676
+ eachChild(callback) {
677
+ for (const child of this._children) {
678
+ callback(child);
679
+ }
990
680
  }
991
-
992
- [displayProperty.setNative](value) {
993
- console.log('displayProperty', 'view');
994
- _setDisplay(value, this as any);
681
+ eachChildView(callback) {
682
+ for (const view of this._children) {
683
+ callback(view);
684
+ }
995
685
  }
996
-
997
- set position(value) {
998
- this.style.position = value;
686
+ _addChildFromBuilder(name, value) {
687
+ if (value instanceof NSView) {
688
+ this.addChild(value);
689
+ }
999
690
  }
1000
-
1001
- get position(): Position {
1002
- return _getPosition(this as any);
691
+ getChildrenCount() {
692
+ return this._children.length;
1003
693
  }
1004
-
1005
- [positionProperty.setNative](value) {
1006
- _setPosition(value, this as any);
694
+ get _childrenCount() {
695
+ return this._children.length;
1007
696
  }
1008
-
1009
- set flexDirection(value) {
1010
- this.style.flexDirection = value;
697
+ getChildAt(index) {
698
+ return this._children[index];
1011
699
  }
1012
-
1013
- get flexDirection() {
1014
- return _getFlexDirection(this as any);
700
+ getChildIndex(child) {
701
+ return this._children.indexOf(child);
1015
702
  }
1016
-
1017
- [flexDirectionProperty.setNative](value) {
1018
- _setFlexDirection(value, this as any);
703
+ getChildById(id) {
704
+ return getViewById(this, id);
1019
705
  }
1020
-
1021
- set flexWrap(value) {
1022
- this.style.flexWrap = value as any;
706
+ addChild(child) {
707
+ this._children.push(child);
708
+ this._addView(child);
1023
709
  }
1024
-
1025
- [flexWrapProperty.setNative](value) {
1026
- _setFlexWrap(value, this as any);
710
+ insertChild(child, atIndex) {
711
+ this._children.splice(atIndex, 0, child);
712
+ this._addView(child, atIndex);
1027
713
  }
1028
-
1029
- get flexWrap() {
1030
- return _getFlexWrap(this as any);
714
+ removeChild(child) {
715
+ const index = this._children.indexOf(child);
716
+ if (index > -1) {
717
+ this._children.splice(index, 1);
718
+ this._removeView(child);
719
+ }
1031
720
  }
1032
-
1033
- set alignItems(value) {
1034
- this.style.alignItems = value as any;
721
+ removeChildren() {
722
+ if (this._children.length === 0) {
723
+ return;
724
+ }
725
+ for (const child of this._children) {
726
+ child._isMasonChild = false;
727
+ this._removeView(child);
728
+ }
729
+ this._children.splice(0);
1035
730
  }
1036
-
1037
- get alignItems() {
1038
- return _getAlignItems(this as any);
731
+ [displayProperty.setNative](value) {
732
+ _setDisplay(value, this);
1039
733
  }
1040
-
1041
- [alignItemsProperty.setNative](value) {
1042
- _setAlignItems(value, this as any);
734
+ [flexDirectionProperty.setNative](value) {
735
+ _setFlexDirection(value, this);
1043
736
  }
1044
-
1045
- //@ts-ignore
1046
- set alignSelf(value: AlignSelf) {
1047
- this.style.alignSelf = value as any;
737
+ [minWidthProperty.setNative](value) {
738
+ _setMinWidth(value, this);
1048
739
  }
1049
-
1050
- //@ts-ignore
1051
- get alignSelf() {
1052
- return _getAlignSelf(this as any);
740
+ [minHeightProperty.setNative](value) {
741
+ _setMinHeight(value, this);
1053
742
  }
1054
-
1055
- [alignSelfProperty.setNative](value) {
1056
- _setAlignSelf(value, this as any);
743
+ [widthProperty.setNative](value) {
744
+ _setWidth(value, this);
1057
745
  }
1058
-
1059
- set alignContent(value) {
1060
- this.style.alignContent = value as any;
746
+ [heightProperty.setNative](value) {
747
+ _setHeight(value, this);
1061
748
  }
1062
-
1063
749
  [alignContentProperty.setNative](value) {
1064
- _setAlignContent(value, this as any);
1065
- }
1066
-
1067
- get alignContent() {
1068
- return _getAlignContent(this as any);
1069
- }
1070
-
1071
- set justifyItems(value) {
1072
- this.style.justifyItems = value as any;
1073
- }
1074
-
1075
- [justifyItemsProperty.setNative](value) {
1076
- _setJustifyItems(value, this as any);
1077
- }
1078
-
1079
- get justifyItems() {
1080
- return _getJustifyItems(this as any);
1081
- }
1082
-
1083
- set justifySelf(value) {
1084
- this.style.justifySelf = value as any;
1085
- }
1086
-
1087
- [justifySelfProperty.setNative](value) {
1088
- _setJustifySelf(value, this as any);
750
+ _setAlignContent(value, this);
1089
751
  }
1090
-
1091
- get justifySelf() {
1092
- return _getJustifySelf(this as any);
1093
- }
1094
-
1095
- set justifyContent(value) {
1096
- this.style.justifyContent = value as any;
1097
- }
1098
-
1099
752
  [justifyContentProperty.setNative](value) {
1100
- _setJustifyContent(value, this as any);
1101
- }
1102
-
1103
- get justifyContent() {
1104
- return _getJustifyContent(this as any);
1105
- }
1106
-
1107
- //@ts-ignore
1108
- set left(value) {
1109
- this.style.left = value;
1110
- }
1111
-
1112
- get left() {
1113
- return this.style.left;
1114
- }
1115
-
1116
- [leftProperty.setNative](value) {
1117
- _setLeft(value, this as any);
1118
- }
1119
-
1120
- //@ts-ignore
1121
- set right(value) {
1122
- this.style.right = value;
1123
- }
1124
-
1125
- get right() {
1126
- return this.style.right;
1127
- }
1128
-
1129
- [rightProperty.setNative](value) {
1130
- _setRight(value, this as any);
1131
- }
1132
-
1133
- //@ts-ignore
1134
- set top(value) {
1135
- this.style.top = value;
1136
- }
1137
-
1138
- get top() {
1139
- return this.style.top;
1140
- }
1141
-
1142
- [topProperty.setNative](value) {
1143
- _setTop(value, this as any);
1144
- }
1145
-
1146
- //@ts-ignore
1147
- set bottom(value) {
1148
- this.style.bottom = value;
753
+ _setJustifyContent(value, this);
1149
754
  }
1150
-
1151
- get bottom() {
1152
- return this.style.bottom;
1153
- }
1154
-
1155
- [bottomProperty.setNative](value) {
1156
- _setBottom(value, this as any);
1157
- }
1158
-
1159
755
  [marginLeftProperty.setNative](value) {
1160
- _setMarginLeft(value, this as any);
756
+ _setMarginLeft(value, this);
1161
757
  }
1162
-
1163
758
  [marginRightProperty.setNative](value) {
1164
- _setMarginRight(value, this as any);
1165
- }
1166
-
1167
- [marginTopProperty.setNative](value) {
1168
- _setMarginTop(value, this as any);
759
+ _setMarginRight(value, this);
1169
760
  }
1170
-
1171
761
  [marginBottomProperty.setNative](value) {
1172
- _setMarginBottom(value, this as any);
1173
- }
1174
-
1175
- [borderLeftWidthProperty.setNative](value) {
1176
- _setBorderLeft(value, this as any);
1177
- }
1178
-
1179
- [borderRightWidthProperty.setNative](value) {
1180
- _setBorderRight(value, this as any);
1181
- }
1182
-
1183
- [borderTopWidthProperty.setNative](value) {
1184
- _setBorderTop(value, this as any);
1185
- }
1186
-
1187
- [borderBottomWidthProperty.setNative](value) {
1188
- _setBorderBottom(value, this as any);
1189
- }
1190
-
1191
- //@ts-ignore
1192
- get flexGrow() {
1193
- return _getFlexGrow(this as any);
1194
- }
1195
-
1196
- set flexGrow(value) {
1197
- this.style.flexGrow = value;
1198
- }
1199
-
1200
- [flexGrowProperty.setNative](value) {
1201
- _setFlexGrow(value, this as any);
1202
- }
1203
-
1204
- //@ts-ignore
1205
- get flexShrink() {
1206
- return _getFlexShrink(this as any);
1207
- }
1208
-
1209
- set flexShrink(value) {
1210
- this.style.flexShrink = value;
1211
- }
1212
-
1213
- [flexShrinkProperty.setNative](value) {
1214
- _setFlexShrink(value, this as any);
762
+ _setMarginBottom(value, this);
1215
763
  }
1216
-
1217
- //@ts-ignore
1218
- get flexBasis() {
1219
- return _getFlexBasis(this as any);
1220
- }
1221
-
1222
- [flexBasisProperty.setNative](value) {
1223
- _setFlexBasis(value, this as any);
1224
- }
1225
-
1226
- // faster setter/getter
1227
- //@ts-ignore
1228
- get gap() {
1229
- return _getGap(this as any);
1230
- }
1231
-
1232
- set gap(value) {
1233
- this.style.gap = value;
1234
- _setGap(value, this as any);
1235
- }
1236
-
1237
-
1238
-
1239
- set rowGap(value) {
1240
- this.style.rowGap = value;
1241
- }
1242
-
1243
- [rowGapProperty.setNative](value) {
1244
- _setRowGap(value, this as any);
1245
- }
1246
-
1247
- set columnGap(value) {
1248
- this.style.columnGap = value;
1249
- }
1250
-
1251
- [columnGapProperty.setNative](value) {
1252
- _setColumnGap(value, this as any);
1253
- }
1254
-
1255
- get aspectRatio() {
1256
- return _getAspectRatio(this as any);
1257
- }
1258
-
1259
- [aspectRatioProperty.setNative](value) {
1260
- _setAspectRatio(value, this as any);
764
+ [marginTopProperty.setNative](value) {
765
+ _setMarginTop(value, this);
1261
766
  }
1262
-
1263
767
  [paddingLeftProperty.setNative](value) {
1264
- _setPaddingLeft(value, this as any);
1265
- }
1266
-
1267
- [paddingTopProperty.setNative](value) {
1268
- _setPaddingTop(value, this as any);
768
+ _setPaddingLeft(value, this);
1269
769
  }
1270
-
1271
770
  [paddingRightProperty.setNative](value) {
1272
- _setPaddingRight(value, this as any);
1273
- }
1274
-
1275
- [paddingBottomProperty.setNative](value) {
1276
- _setPaddingBottom(value, this as any);
1277
- }
1278
-
1279
- //@ts-ignore
1280
- set minWidth(value) {
1281
- this.style.minWidth = value;
1282
- }
1283
-
1284
- [minWidthProperty.setNative](value) {
1285
- _setMinWidth(value, this as any);
1286
- }
1287
-
1288
- //@ts-ignore
1289
- set minHeight(value) {
1290
- this.style.minHeight = value;
1291
- }
1292
-
1293
- [minHeightProperty.setNative](value) {
1294
- _setMinHeight(value, this as any);
1295
- }
1296
-
1297
- //@ts-ignore
1298
- set width(value) {
1299
- this.style.width = value;
1300
- }
1301
-
1302
- [widthProperty.setNative](value) {
1303
- _setWidth(value, this as any);
1304
- }
1305
-
1306
- get width() {
1307
- return _getWidth(this as any);
1308
- }
1309
-
1310
- //@ts-ignore
1311
- set height(value) {
1312
- this.style.height = value;
771
+ _setPaddingRight(value, this);
1313
772
  }
1314
-
1315
- [heightProperty.setNative](value) {
1316
- _setHeight(value, this as any);
1317
- }
1318
-
1319
- //@ts-ignore
1320
- get height() {
1321
- return _getHeight(this as any);
1322
- }
1323
-
1324
- set maxWidth(value) {
1325
- this.style.maxWidth = value;
1326
- }
1327
-
1328
- [maxWidthProperty.setNative](value) {
1329
- _setMaxWidth(value, this as any);
1330
- }
1331
-
1332
- //@ts-ignore
1333
- set maxHeight(value) {
1334
- this.style.maxHeight = value;
1335
- }
1336
-
1337
- [maxHeightProperty.setNative](value) {
1338
- _setMaxHeight(value, this as any);
1339
- }
1340
-
1341
- //@ts-ignore
1342
- set gridAutoRows(value) {
1343
- this.style.gridAutoRows = value;
1344
- }
1345
-
1346
- [gridAutoRowsProperty.setNative](value) {
1347
- _setGridAutoRows(value, this as any);
1348
- }
1349
-
1350
- //@ts-ignore
1351
- get gridAutoRows() {
1352
- return this.style.gridAutoRows;
1353
- }
1354
-
1355
- //@ts-ignore
1356
- set gridAutoColumns(value) {
1357
- this.style.gridAutoColumns = value;
1358
- }
1359
-
1360
- [gridAutoColumnsProperty.setNative](value) {
1361
- _setGridAutoColumns(value, this as any);
1362
- }
1363
-
1364
- get gridAutoColumns() {
1365
- return this.style.gridAutoColumns;
773
+ [paddingTopProperty.setNative](value) {
774
+ _setPaddingTop(value, this);
1366
775
  }
1367
-
1368
- set gridAutoFlow(value) {
1369
- this.style.gridAutoFlow = value;
776
+ [paddingBottomProperty.setNative](value) {
777
+ _setPaddingBottom(value, this);
1370
778
  }
1371
-
1372
- [gridAutoFlowProperty.setNative](value) {}
1373
-
1374
- get gridAutoFlow() {
1375
- return this.style.gridAutoFlow;
779
+ [rowGapProperty.setNative](value) {
780
+ _setRowGap(value, this);
1376
781
  }
1377
-
1378
- set gridColumnStart(value) {
1379
- this.style.gridColumnStart = value;
782
+ [columnGapProperty.setNative](value) {
783
+ _setColumnGap(value, this);
1380
784
  }
1381
-
1382
785
  [gridColumnStartProperty.setNative](value) {
1383
- _setGridColumnStart(value, this as any);
1384
- }
1385
-
1386
- get gridColumnStart() {
1387
- return this.style.gridColumnStart;
786
+ _setGridColumnStart(value, this);
1388
787
  }
1389
-
1390
- set gridColumnEnd(value) {
1391
- this.style.gridColumnEnd = value;
1392
- }
1393
-
1394
788
  [gridColumnEndProperty.setNative](value) {
1395
- _setGridColumnEnd(value, this as any);
1396
- }
1397
-
1398
- get gridColumnEnd() {
1399
- return this.style.gridColumnEnd;
1400
- }
1401
-
1402
- set gridRowStart(value) {
1403
- this.style.gridRowStart = value;
789
+ _setGridColumnEnd(value, this);
1404
790
  }
1405
-
1406
791
  [gridRowStartProperty.setNative](value) {
1407
- _setGridRowStart(value, this as any);
792
+ _setGridRowStart(value, this);
1408
793
  }
1409
-
1410
- get gridRowStart() {
1411
- return this.style.gridRowStart;
1412
- }
1413
-
1414
- set gridRowEnd(value) {
1415
- this.style.gridRowEnd = value;
1416
- }
1417
-
1418
794
  [gridRowEndProperty.setNative](value) {
1419
- _setGridRowEnd(value, this as any);
1420
- }
1421
-
1422
- get gridRowEnd() {
1423
- return this.style.gridRowEnd;
1424
- }
1425
-
1426
- set gridTemplateRows(value) {
1427
- this.style.gridTemplateRows = value;
795
+ _setGridRowEnd(value, this);
1428
796
  }
1429
-
1430
797
  [gridTemplateRowsProperty.setNative](value) {
1431
- const templates = _parseGridTemplates(value);
1432
- if (templates) {
1433
- _setGridTemplateRows(templates, this as any);
1434
- }
798
+ _setGridTemplateRows(_parseGridTemplates(value), this);
1435
799
  }
1436
-
1437
- set gridTemplateColumns(value) {
1438
- this.style.gridTemplateColumns = value;
1439
- }
1440
-
1441
800
  [gridTemplateColumnsProperty.setNative](value) {
1442
- const templates = _parseGridTemplates(value);
1443
- if (templates) {
1444
- _setGridTemplateColumns(templates, this as any);
1445
- }
1446
- }
1447
- */
1448
- eachLayoutChild(callback) {
1449
- let lastChild = null;
1450
- this.eachChildView((cv) => {
1451
- cv._eachLayoutView((lv) => {
1452
- if (lastChild && !lastChild.isCollapsed) {
1453
- callback(lastChild, false);
1454
- }
1455
- lastChild = lv;
1456
- });
1457
- return true;
1458
- });
1459
- if (lastChild && !lastChild.isCollapsed) {
1460
- callback(lastChild, true);
1461
- }
801
+ _setGridTemplateColumns(_parseGridTemplates(value), this);
1462
802
  }
1463
- eachChild(callback) {
1464
- this._children.forEach((child) => {
1465
- callback(child);
1466
- });
1467
- }
1468
- eachChildView(callback) {
1469
- this._children.forEach((view, key) => {
1470
- callback(view);
1471
- });
1472
- }
1473
- _addChildFromBuilder(name, value) {
1474
- this._children.push(value);
1475
- value._isMasonChild = true;
1476
- this._addView(value);
803
+ };
804
+ ViewBase = __decorate([
805
+ CSSType('View'),
806
+ __metadata("design:paramtypes", [])
807
+ ], ViewBase);
808
+ export { ViewBase };
809
+ let TextBase = class TextBase extends ViewBase {
810
+ constructor() {
811
+ super();
1477
812
  }
1478
813
  };
1479
- TSCViewBase = __decorate([
1480
- CSSType('TSCView'),
814
+ TextBase = __decorate([
815
+ CSSType('Text'),
1481
816
  __metadata("design:paramtypes", [])
1482
- ], TSCViewBase);
1483
- export { TSCViewBase };
817
+ ], TextBase);
818
+ export { TextBase };
819
+ textProperty.register(TextBase);
820
+ textWrapProperty.register(TextBase);
821
+ /**
822
+ * Props are already defined in core flexbox layout,
823
+ * overriding them breaks the core flexbox layout.
824
+ */
825
+ // flexDirectionProperty.register(Style);
826
+ // flexWrapProperty.register(Style);
827
+ // flexGrowProperty.register(Style);
828
+ // flexShrinkProperty.register(Style);
829
+ alignItemsProperty.register(Style);
830
+ alignSelfProperty.register(Style);
831
+ justifyContentProperty.register(Style);
1484
832
  displayProperty.register(Style);
1485
833
  maxWidthProperty.register(Style);
1486
834
  maxHeightProperty.register(Style);
1487
835
  positionProperty.register(Style);
1488
- flexDirectionProperty.register(Style);
1489
- flexWrapProperty.register(Style);
1490
836
  leftProperty.register(Style);
1491
837
  rightProperty.register(Style);
1492
838
  topProperty.register(Style);
1493
839
  bottomProperty.register(Style);
1494
840
  flexBasisProperty.register(Style);
1495
- flexGrowProperty.register(Style);
1496
- flexShrinkProperty.register(Style);
1497
841
  rowGapProperty.register(Style);
1498
842
  columnGapProperty.register(Style);
1499
843
  gridRowGapProperty.register(Style);
1500
844
  gridColumnGapProperty.register(Style);
1501
845
  gapProperty.register(Style);
1502
- gridGapProperty.register(Style);
1503
846
  aspectRatioProperty.register(Style);
1504
- alignItemsProperty.register(Style);
1505
- alignSelfProperty.register(Style);
1506
847
  alignContentProperty.register(Style);
1507
848
  justifyItemsProperty.register(Style);
1508
849
  justifySelfProperty.register(Style);
1509
- justifyContentProperty.register(Style);
1510
850
  gridAutoRowsProperty.register(Style);
1511
851
  gridAutoColumnsProperty.register(Style);
1512
852
  gridAutoFlowProperty.register(Style);
@@ -1519,5 +859,74 @@ gridRowStartProperty.register(Style);
1519
859
  gridRowEndProperty.register(Style);
1520
860
  gridTemplateRowsProperty.register(Style);
1521
861
  gridTemplateColumnsProperty.register(Style);
1522
- installMixins();
862
+ overflowProperty.register(Style);
863
+ overflowXProperty.register(Style);
864
+ overflowYProperty.register(Style);
865
+ scrollBarWidthProperty.register(Style);
866
+ flexFlowProperty.register(Style);
867
+ flexProperty.register(Style);
868
+ function parseShorthandPositioning(value) {
869
+ const arr = value.split(/[ ,]+/);
870
+ let top;
871
+ let right;
872
+ let bottom;
873
+ let left;
874
+ if (arr.length === 1) {
875
+ top = arr[0];
876
+ right = arr[0];
877
+ bottom = arr[0];
878
+ left = arr[0];
879
+ }
880
+ else if (arr.length === 2) {
881
+ top = arr[0];
882
+ bottom = arr[0];
883
+ right = arr[1];
884
+ left = arr[1];
885
+ }
886
+ else if (arr.length === 3) {
887
+ top = arr[0];
888
+ right = arr[1];
889
+ left = arr[1];
890
+ bottom = arr[2];
891
+ }
892
+ else if (arr.length === 4) {
893
+ top = arr[0];
894
+ right = arr[1];
895
+ bottom = arr[2];
896
+ left = arr[3];
897
+ }
898
+ else {
899
+ throw new Error('Expected 1, 2, 3 or 4 parameters. Actual: ' + value);
900
+ }
901
+ return {
902
+ top: top,
903
+ right: right,
904
+ bottom: bottom,
905
+ left: left,
906
+ };
907
+ }
908
+ function convertToPaddings(value) {
909
+ if (typeof value === 'string' && value !== 'auto') {
910
+ const thickness = parseShorthandPositioning(value);
911
+ return [
912
+ [paddingTopProperty, CoreLength.parse(thickness.top)],
913
+ [paddingRightProperty, CoreLength.parse(thickness.right)],
914
+ [paddingBottomProperty, CoreLength.parse(thickness.bottom)],
915
+ [paddingLeftProperty, CoreLength.parse(thickness.left)],
916
+ ];
917
+ }
918
+ else {
919
+ return [
920
+ [paddingTopProperty, value],
921
+ [paddingRightProperty, value],
922
+ [paddingBottomProperty, value],
923
+ [paddingLeftProperty, value],
924
+ ];
925
+ }
926
+ }
927
+ paddingProperty.register(Style);
928
+ paddingLeftProperty.register(Style);
929
+ paddingRightProperty.register(Style);
930
+ paddingTopProperty.register(Style);
931
+ paddingBottomProperty.register(Style);
1523
932
  //# sourceMappingURL=common.js.map