@triniwiz/nativescript-masonkit 1.0.0-alpha.6 → 1.0.0-alpha.8

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 (343) hide show
  1. package/common.d.ts +53 -28
  2. package/common.js +355 -704
  3. package/common.js.map +1 -1
  4. package/helpers.d.ts +98 -98
  5. package/helpers.js +395 -2945
  6. package/helpers.js.map +1 -1
  7. package/index.android.d.ts +28 -24
  8. package/index.android.js +109 -82
  9. package/index.android.js.map +1 -1
  10. package/index.d.ts +56 -19
  11. package/index.ios.d.ts +42 -24
  12. package/index.ios.js +279 -121
  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/masonkit-release.aar +0 -0
  19. package/platforms/ios/Mason.xcframework/Info.plist +4 -0
  20. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/Mason-Swift.h +251 -267
  21. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/Mason.h +11 -0
  22. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/mason_native.h +213 -843
  23. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Info.plist +0 -0
  24. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Mason +0 -0
  25. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
  26. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.abi.json +17954 -22685
  27. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.private.swiftinterface +404 -310
  28. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  29. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftinterface +404 -310
  30. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/module.modulemap +1 -1
  31. package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
  32. package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +1937 -0
  33. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/Mason-Swift.h +502 -534
  34. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/Mason.h +11 -0
  35. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/mason_native.h +213 -843
  36. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Info.plist +0 -0
  37. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Mason +0 -0
  38. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
  39. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
  40. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.abi.json +17954 -22685
  41. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +404 -310
  42. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  43. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftinterface +404 -310
  44. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.abi.json +17954 -22685
  45. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +404 -310
  46. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  47. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +404 -310
  48. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/module.modulemap +1 -1
  49. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/_CodeSignature/CodeResources +33 -97
  50. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
  51. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +1937 -0
  52. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/x86_64/Mason.yml +1888 -0
  53. package/platforms/ios/Podfile +1 -1
  54. package/platforms/ios/build.xcconfig +5 -1
  55. package/platforms/ios/prebuild.sh +101 -0
  56. package/{pods → src-native/pods}/NativeScript.podspec +1 -1
  57. package/style.d.ts +166 -0
  58. package/style.js +1686 -0
  59. package/style.js.map +1 -0
  60. package/platforms/ios/src/MasonV8Module.h +0 -583
  61. package/platforms/ios/src/MasonV8Module.mm +0 -1005
  62. package/platforms/ios/src/cpp/include/mason_native.h +0 -972
  63. package/platforms/ios/src/cpp/include/robin_hood.h +0 -2544
  64. package/platforms/ios/src/module.modulemap +0 -4
  65. /package/{pods → src-native/pods}/Headers/include/APIDesign.md +0 -0
  66. /package/{pods → src-native/pods}/Headers/include/DEPS +0 -0
  67. /package/{pods → src-native/pods}/Headers/include/DIR_METADATA +0 -0
  68. /package/{pods → src-native/pods}/Headers/include/OWNERS +0 -0
  69. /package/{pods → src-native/pods}/Headers/include/cppgc/DEPS +0 -0
  70. /package/{pods → src-native/pods}/Headers/include/cppgc/OWNERS +0 -0
  71. /package/{pods → src-native/pods}/Headers/include/cppgc/README.md +0 -0
  72. /package/{pods → src-native/pods}/Headers/include/cppgc/allocation.h +0 -0
  73. /package/{pods → src-native/pods}/Headers/include/cppgc/common.h +0 -0
  74. /package/{pods → src-native/pods}/Headers/include/cppgc/cross-thread-persistent.h +0 -0
  75. /package/{pods → src-native/pods}/Headers/include/cppgc/custom-space.h +0 -0
  76. /package/{pods → src-native/pods}/Headers/include/cppgc/default-platform.h +0 -0
  77. /package/{pods → src-native/pods}/Headers/include/cppgc/ephemeron-pair.h +0 -0
  78. /package/{pods → src-native/pods}/Headers/include/cppgc/explicit-management.h +0 -0
  79. /package/{pods → src-native/pods}/Headers/include/cppgc/garbage-collected.h +0 -0
  80. /package/{pods → src-native/pods}/Headers/include/cppgc/heap-consistency.h +0 -0
  81. /package/{pods → src-native/pods}/Headers/include/cppgc/heap-state.h +0 -0
  82. /package/{pods → src-native/pods}/Headers/include/cppgc/heap-statistics.h +0 -0
  83. /package/{pods → src-native/pods}/Headers/include/cppgc/heap.h +0 -0
  84. /package/{pods → src-native/pods}/Headers/include/cppgc/internal/api-constants.h +0 -0
  85. /package/{pods → src-native/pods}/Headers/include/cppgc/internal/atomic-entry-flag.h +0 -0
  86. /package/{pods → src-native/pods}/Headers/include/cppgc/internal/caged-heap-local-data.h +0 -0
  87. /package/{pods → src-native/pods}/Headers/include/cppgc/internal/compiler-specific.h +0 -0
  88. /package/{pods → src-native/pods}/Headers/include/cppgc/internal/finalizer-trait.h +0 -0
  89. /package/{pods → src-native/pods}/Headers/include/cppgc/internal/gc-info.h +0 -0
  90. /package/{pods → src-native/pods}/Headers/include/cppgc/internal/logging.h +0 -0
  91. /package/{pods → src-native/pods}/Headers/include/cppgc/internal/name-trait.h +0 -0
  92. /package/{pods → src-native/pods}/Headers/include/cppgc/internal/persistent-node.h +0 -0
  93. /package/{pods → src-native/pods}/Headers/include/cppgc/internal/pointer-policies.h +0 -0
  94. /package/{pods → src-native/pods}/Headers/include/cppgc/internal/write-barrier.h +0 -0
  95. /package/{pods → src-native/pods}/Headers/include/cppgc/liveness-broker.h +0 -0
  96. /package/{pods → src-native/pods}/Headers/include/cppgc/macros.h +0 -0
  97. /package/{pods → src-native/pods}/Headers/include/cppgc/member.h +0 -0
  98. /package/{pods → src-native/pods}/Headers/include/cppgc/name-provider.h +0 -0
  99. /package/{pods → src-native/pods}/Headers/include/cppgc/object-size-trait.h +0 -0
  100. /package/{pods → src-native/pods}/Headers/include/cppgc/persistent.h +0 -0
  101. /package/{pods → src-native/pods}/Headers/include/cppgc/platform.h +0 -0
  102. /package/{pods → src-native/pods}/Headers/include/cppgc/prefinalizer.h +0 -0
  103. /package/{pods → src-native/pods}/Headers/include/cppgc/process-heap-statistics.h +0 -0
  104. /package/{pods → src-native/pods}/Headers/include/cppgc/sentinel-pointer.h +0 -0
  105. /package/{pods → src-native/pods}/Headers/include/cppgc/source-location.h +0 -0
  106. /package/{pods → src-native/pods}/Headers/include/cppgc/testing.h +0 -0
  107. /package/{pods → src-native/pods}/Headers/include/cppgc/trace-trait.h +0 -0
  108. /package/{pods → src-native/pods}/Headers/include/cppgc/type-traits.h +0 -0
  109. /package/{pods → src-native/pods}/Headers/include/cppgc/visitor.h +0 -0
  110. /package/{pods → src-native/pods}/Headers/include/js_protocol-1.2.json +0 -0
  111. /package/{pods → src-native/pods}/Headers/include/js_protocol-1.3.json +0 -0
  112. /package/{pods → src-native/pods}/Headers/include/js_protocol.pdl +0 -0
  113. /package/{pods → src-native/pods}/Headers/include/libffi/arm64/ffi.h +0 -0
  114. /package/{pods → src-native/pods}/Headers/include/libffi/arm64/ffitarget.h +0 -0
  115. /package/{pods → src-native/pods}/Headers/include/libffi/x86_64/ffi.h +0 -0
  116. /package/{pods → src-native/pods}/Headers/include/libffi/x86_64/ffitarget.h +0 -0
  117. /package/{pods → src-native/pods}/Headers/include/libffi.h +0 -0
  118. /package/{pods → src-native/pods}/Headers/include/libplatform/DEPS +0 -0
  119. /package/{pods → src-native/pods}/Headers/include/libplatform/libplatform-export.h +0 -0
  120. /package/{pods → src-native/pods}/Headers/include/libplatform/libplatform.h +0 -0
  121. /package/{pods → src-native/pods}/Headers/include/libplatform/v8-tracing.h +0 -0
  122. /package/{pods → src-native/pods}/Headers/include/v8-array-buffer.h +0 -0
  123. /package/{pods → src-native/pods}/Headers/include/v8-callbacks.h +0 -0
  124. /package/{pods → src-native/pods}/Headers/include/v8-container.h +0 -0
  125. /package/{pods → src-native/pods}/Headers/include/v8-context.h +0 -0
  126. /package/{pods → src-native/pods}/Headers/include/v8-cppgc.h +0 -0
  127. /package/{pods → src-native/pods}/Headers/include/v8-data.h +0 -0
  128. /package/{pods → src-native/pods}/Headers/include/v8-date.h +0 -0
  129. /package/{pods → src-native/pods}/Headers/include/v8-debug.h +0 -0
  130. /package/{pods → src-native/pods}/Headers/include/v8-embedder-heap.h +0 -0
  131. /package/{pods → src-native/pods}/Headers/include/v8-embedder-state-scope.h +0 -0
  132. /package/{pods → src-native/pods}/Headers/include/v8-exception.h +0 -0
  133. /package/{pods → src-native/pods}/Headers/include/v8-extension.h +0 -0
  134. /package/{pods → src-native/pods}/Headers/include/v8-external.h +0 -0
  135. /package/{pods → src-native/pods}/Headers/include/v8-fast-api-calls.h +0 -0
  136. /package/{pods → src-native/pods}/Headers/include/v8-forward.h +0 -0
  137. /package/{pods → src-native/pods}/Headers/include/v8-function-callback.h +0 -0
  138. /package/{pods → src-native/pods}/Headers/include/v8-function.h +0 -0
  139. /package/{pods → src-native/pods}/Headers/include/v8-initialization.h +0 -0
  140. /package/{pods → src-native/pods}/Headers/include/v8-inspector-protocol.h +0 -0
  141. /package/{pods → src-native/pods}/Headers/include/v8-inspector.h +0 -0
  142. /package/{pods → src-native/pods}/Headers/include/v8-internal.h +0 -0
  143. /package/{pods → src-native/pods}/Headers/include/v8-isolate.h +0 -0
  144. /package/{pods → src-native/pods}/Headers/include/v8-json.h +0 -0
  145. /package/{pods → src-native/pods}/Headers/include/v8-local-handle.h +0 -0
  146. /package/{pods → src-native/pods}/Headers/include/v8-locker.h +0 -0
  147. /package/{pods → src-native/pods}/Headers/include/v8-maybe.h +0 -0
  148. /package/{pods → src-native/pods}/Headers/include/v8-memory-span.h +0 -0
  149. /package/{pods → src-native/pods}/Headers/include/v8-message.h +0 -0
  150. /package/{pods → src-native/pods}/Headers/include/v8-metrics.h +0 -0
  151. /package/{pods → src-native/pods}/Headers/include/v8-microtask-queue.h +0 -0
  152. /package/{pods → src-native/pods}/Headers/include/v8-microtask.h +0 -0
  153. /package/{pods → src-native/pods}/Headers/include/v8-object.h +0 -0
  154. /package/{pods → src-native/pods}/Headers/include/v8-persistent-handle.h +0 -0
  155. /package/{pods → src-native/pods}/Headers/include/v8-platform.h +0 -0
  156. /package/{pods → src-native/pods}/Headers/include/v8-primitive-object.h +0 -0
  157. /package/{pods → src-native/pods}/Headers/include/v8-primitive.h +0 -0
  158. /package/{pods → src-native/pods}/Headers/include/v8-profiler.h +0 -0
  159. /package/{pods → src-native/pods}/Headers/include/v8-promise.h +0 -0
  160. /package/{pods → src-native/pods}/Headers/include/v8-proxy.h +0 -0
  161. /package/{pods → src-native/pods}/Headers/include/v8-regexp.h +0 -0
  162. /package/{pods → src-native/pods}/Headers/include/v8-script.h +0 -0
  163. /package/{pods → src-native/pods}/Headers/include/v8-snapshot.h +0 -0
  164. /package/{pods → src-native/pods}/Headers/include/v8-statistics.h +0 -0
  165. /package/{pods → src-native/pods}/Headers/include/v8-template.h +0 -0
  166. /package/{pods → src-native/pods}/Headers/include/v8-traced-handle.h +0 -0
  167. /package/{pods → src-native/pods}/Headers/include/v8-typed-array.h +0 -0
  168. /package/{pods → src-native/pods}/Headers/include/v8-unwinder-state.h +0 -0
  169. /package/{pods → src-native/pods}/Headers/include/v8-unwinder.h +0 -0
  170. /package/{pods → src-native/pods}/Headers/include/v8-util.h +0 -0
  171. /package/{pods → src-native/pods}/Headers/include/v8-value-serializer-version.h +0 -0
  172. /package/{pods → src-native/pods}/Headers/include/v8-value-serializer.h +0 -0
  173. /package/{pods → src-native/pods}/Headers/include/v8-value.h +0 -0
  174. /package/{pods → src-native/pods}/Headers/include/v8-version-string.h +0 -0
  175. /package/{pods → src-native/pods}/Headers/include/v8-version.h +0 -0
  176. /package/{pods → src-native/pods}/Headers/include/v8-wasm-trap-handler-posix.h +0 -0
  177. /package/{pods → src-native/pods}/Headers/include/v8-wasm-trap-handler-win.h +0 -0
  178. /package/{pods → src-native/pods}/Headers/include/v8-wasm.h +0 -0
  179. /package/{pods → src-native/pods}/Headers/include/v8-weak-callback-info.h +0 -0
  180. /package/{pods → src-native/pods}/Headers/include/v8.h +0 -0
  181. /package/{pods → src-native/pods}/Headers/include/v8config.h +0 -0
  182. /package/{pods → src-native/pods}/Headers/inspector/InspectorServer.h +0 -0
  183. /package/{pods → src-native/pods}/Headers/inspector/JsV8InspectorClient.h +0 -0
  184. /package/{pods → src-native/pods}/Headers/inspector/base/trace_event/common/trace_event_common.h +0 -0
  185. /package/{pods → src-native/pods}/Headers/inspector/base64.h +0 -0
  186. /package/{pods → src-native/pods}/Headers/inspector/src/base/address-region.h +0 -0
  187. /package/{pods → src-native/pods}/Headers/inspector/src/base/atomic-utils.h +0 -0
  188. /package/{pods → src-native/pods}/Headers/inspector/src/base/atomicops.h +0 -0
  189. /package/{pods → src-native/pods}/Headers/inspector/src/base/atomicops_internals_atomicword_compat.h +0 -0
  190. /package/{pods → src-native/pods}/Headers/inspector/src/base/base-export.h +0 -0
  191. /package/{pods → src-native/pods}/Headers/inspector/src/base/bits.h +0 -0
  192. /package/{pods → src-native/pods}/Headers/inspector/src/base/build_config.h +0 -0
  193. /package/{pods → src-native/pods}/Headers/inspector/src/base/compiler-specific.h +0 -0
  194. /package/{pods → src-native/pods}/Headers/inspector/src/base/export-template.h +0 -0
  195. /package/{pods → src-native/pods}/Headers/inspector/src/base/flags.h +0 -0
  196. /package/{pods → src-native/pods}/Headers/inspector/src/base/immediate-crash.h +0 -0
  197. /package/{pods → src-native/pods}/Headers/inspector/src/base/lazy-instance.h +0 -0
  198. /package/{pods → src-native/pods}/Headers/inspector/src/base/logging.h +0 -0
  199. /package/{pods → src-native/pods}/Headers/inspector/src/base/macros.h +0 -0
  200. /package/{pods → src-native/pods}/Headers/inspector/src/base/memory.h +0 -0
  201. /package/{pods → src-native/pods}/Headers/inspector/src/base/once.h +0 -0
  202. /package/{pods → src-native/pods}/Headers/inspector/src/base/optional.h +0 -0
  203. /package/{pods → src-native/pods}/Headers/inspector/src/base/platform/mutex.h +0 -0
  204. /package/{pods → src-native/pods}/Headers/inspector/src/base/platform/platform.h +0 -0
  205. /package/{pods → src-native/pods}/Headers/inspector/src/base/platform/semaphore.h +0 -0
  206. /package/{pods → src-native/pods}/Headers/inspector/src/base/platform/v8-time.h +0 -0
  207. /package/{pods → src-native/pods}/Headers/inspector/src/base/platform/wrappers.h +0 -0
  208. /package/{pods → src-native/pods}/Headers/inspector/src/base/safe_conversions.h +0 -0
  209. /package/{pods → src-native/pods}/Headers/inspector/src/base/safe_conversions_impl.h +0 -0
  210. /package/{pods → src-native/pods}/Headers/inspector/src/base/template-utils.h +0 -0
  211. /package/{pods → src-native/pods}/Headers/inspector/src/base/v8-fallthrough.h +0 -0
  212. /package/{pods → src-native/pods}/Headers/inspector/src/common/checks.h +0 -0
  213. /package/{pods → src-native/pods}/Headers/inspector/src/common/globals.h +0 -0
  214. /package/{pods → src-native/pods}/Headers/inspector/src/debug/debug-interface.h +0 -0
  215. /package/{pods → src-native/pods}/Headers/inspector/src/debug/interface-types.h +0 -0
  216. /package/{pods → src-native/pods}/Headers/inspector/src/init/v8.h +0 -0
  217. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/custom-preview.h +0 -0
  218. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/injected-script.h +0 -0
  219. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/inspected-context.h +0 -0
  220. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/protocol/CSS.h +0 -0
  221. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/protocol/Console.h +0 -0
  222. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/protocol/DOM.h +0 -0
  223. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/protocol/Debugger.h +0 -0
  224. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/protocol/Forward.h +0 -0
  225. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/protocol/HeapProfiler.h +0 -0
  226. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/protocol/Log.h +0 -0
  227. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/protocol/Network.h +0 -0
  228. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/protocol/Overlay.h +0 -0
  229. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/protocol/Page.h +0 -0
  230. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/protocol/Profiler.h +0 -0
  231. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/protocol/Protocol.h +0 -0
  232. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/protocol/Runtime.h +0 -0
  233. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/protocol/Schema.h +0 -0
  234. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/protocol/Security.h +0 -0
  235. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/remote-object-id.h +0 -0
  236. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/search-util.h +0 -0
  237. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/string-16.h +0 -0
  238. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/string-util.h +0 -0
  239. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/v8-console-agent-impl.h +0 -0
  240. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/v8-console-message.h +0 -0
  241. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/v8-console.h +0 -0
  242. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/v8-css-agent-impl.h +0 -0
  243. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/v8-debugger-agent-impl.h +0 -0
  244. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/v8-debugger-id.h +0 -0
  245. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/v8-debugger-script.h +0 -0
  246. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/v8-debugger.h +0 -0
  247. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/v8-dom-agent-impl.h +0 -0
  248. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/v8-heap-profiler-agent-impl.h +0 -0
  249. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/v8-inspector-impl.h +0 -0
  250. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/v8-inspector-session-impl.h +0 -0
  251. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/v8-log-agent-impl.h +0 -0
  252. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/v8-network-agent-impl.h +0 -0
  253. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/v8-ns-debugger-agent-impl.h +0 -0
  254. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/v8-overlay-agent-impl.h +0 -0
  255. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/v8-page-agent-impl.h +0 -0
  256. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/v8-profiler-agent-impl.h +0 -0
  257. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/v8-regex.h +0 -0
  258. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/v8-runtime-agent-impl.h +0 -0
  259. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/v8-schema-agent-impl.h +0 -0
  260. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/v8-stack-trace-impl.h +0 -0
  261. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/v8-string-conversions.h +0 -0
  262. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/v8-value-utils.h +0 -0
  263. /package/{pods → src-native/pods}/Headers/inspector/src/inspector/value-mirror.h +0 -0
  264. /package/{pods → src-native/pods}/Headers/inspector/src/libplatform/default-platform.h +0 -0
  265. /package/{pods → src-native/pods}/Headers/inspector/src/logging/tracing-flags.h +0 -0
  266. /package/{pods → src-native/pods}/Headers/inspector/src/numbers/conversions.h +0 -0
  267. /package/{pods → src-native/pods}/Headers/inspector/src/tracing/trace-event.h +0 -0
  268. /package/{pods → src-native/pods}/Headers/inspector/src/utils/allocation.h +0 -0
  269. /package/{pods → src-native/pods}/Headers/inspector/src/utils/vector.h +0 -0
  270. /package/{pods → src-native/pods}/Headers/inspector/third_party/inspector_protocol/crdtp/cbor.h +0 -0
  271. /package/{pods → src-native/pods}/Headers/inspector/third_party/inspector_protocol/crdtp/dispatch.h +0 -0
  272. /package/{pods → src-native/pods}/Headers/inspector/third_party/inspector_protocol/crdtp/error_support.h +0 -0
  273. /package/{pods → src-native/pods}/Headers/inspector/third_party/inspector_protocol/crdtp/export.h +0 -0
  274. /package/{pods → src-native/pods}/Headers/inspector/third_party/inspector_protocol/crdtp/find_by_first.h +0 -0
  275. /package/{pods → src-native/pods}/Headers/inspector/third_party/inspector_protocol/crdtp/frontend_channel.h +0 -0
  276. /package/{pods → src-native/pods}/Headers/inspector/third_party/inspector_protocol/crdtp/glue.h +0 -0
  277. /package/{pods → src-native/pods}/Headers/inspector/third_party/inspector_protocol/crdtp/json.h +0 -0
  278. /package/{pods → src-native/pods}/Headers/inspector/third_party/inspector_protocol/crdtp/json_platform.h +0 -0
  279. /package/{pods → src-native/pods}/Headers/inspector/third_party/inspector_protocol/crdtp/maybe.h +0 -0
  280. /package/{pods → src-native/pods}/Headers/inspector/third_party/inspector_protocol/crdtp/parser_handler.h +0 -0
  281. /package/{pods → src-native/pods}/Headers/inspector/third_party/inspector_protocol/crdtp/protocol_core.h +0 -0
  282. /package/{pods → src-native/pods}/Headers/inspector/third_party/inspector_protocol/crdtp/serializable.h +0 -0
  283. /package/{pods → src-native/pods}/Headers/inspector/third_party/inspector_protocol/crdtp/serializer_traits.h +0 -0
  284. /package/{pods → src-native/pods}/Headers/inspector/third_party/inspector_protocol/crdtp/span.h +0 -0
  285. /package/{pods → src-native/pods}/Headers/inspector/third_party/inspector_protocol/crdtp/status.h +0 -0
  286. /package/{pods → src-native/pods}/Headers/inspector/utils.h +0 -0
  287. /package/{pods → src-native/pods}/Headers/inspector/v8-inspector-platform.h +0 -0
  288. /package/{pods → src-native/pods}/Headers/jsi/decorator.h +0 -0
  289. /package/{pods → src-native/pods}/Headers/jsi/instrumentation.h +0 -0
  290. /package/{pods → src-native/pods}/Headers/jsi/jsi-inl.h +0 -0
  291. /package/{pods → src-native/pods}/Headers/jsi/jsi.h +0 -0
  292. /package/{pods → src-native/pods}/Headers/jsi/jsilib.h +0 -0
  293. /package/{pods → src-native/pods}/Headers/jsi/threadsafe.h +0 -0
  294. /package/{pods → src-native/pods}/Headers/runtime/ArgConverter.h +0 -0
  295. /package/{pods → src-native/pods}/Headers/runtime/ArrayAdapter.h +0 -0
  296. /package/{pods → src-native/pods}/Headers/runtime/Caches.h +0 -0
  297. /package/{pods → src-native/pods}/Headers/runtime/ClassBuilder.h +0 -0
  298. /package/{pods → src-native/pods}/Headers/runtime/Common.h +0 -0
  299. /package/{pods → src-native/pods}/Headers/runtime/ConcurrentMap.h +0 -0
  300. /package/{pods → src-native/pods}/Headers/runtime/ConcurrentQueue.h +0 -0
  301. /package/{pods → src-native/pods}/Headers/runtime/Console.h +0 -0
  302. /package/{pods → src-native/pods}/Headers/runtime/Constants.h +0 -0
  303. /package/{pods → src-native/pods}/Headers/runtime/DataWrapper.h +0 -0
  304. /package/{pods → src-native/pods}/Headers/runtime/DictionaryAdapter.h +0 -0
  305. /package/{pods → src-native/pods}/Headers/runtime/ExtVector.h +0 -0
  306. /package/{pods → src-native/pods}/Headers/runtime/FFICall.h +0 -0
  307. /package/{pods → src-native/pods}/Headers/runtime/FastEnumerationAdapter.h +0 -0
  308. /package/{pods → src-native/pods}/Headers/runtime/FunctionReference.h +0 -0
  309. /package/{pods → src-native/pods}/Headers/runtime/Helpers.h +0 -0
  310. /package/{pods → src-native/pods}/Headers/runtime/InlineFunctions.h +0 -0
  311. /package/{pods → src-native/pods}/Headers/runtime/Interop.h +0 -0
  312. /package/{pods → src-native/pods}/Headers/runtime/KnownUnknownClassPair.h +0 -0
  313. /package/{pods → src-native/pods}/Headers/runtime/Metadata.h +0 -0
  314. /package/{pods → src-native/pods}/Headers/runtime/MetadataBuilder.h +0 -0
  315. /package/{pods → src-native/pods}/Headers/runtime/MetadataInlines.h +0 -0
  316. /package/{pods → src-native/pods}/Headers/runtime/ModuleInternal.h +0 -0
  317. /package/{pods → src-native/pods}/Headers/runtime/NSDataAdapter.h +0 -0
  318. /package/{pods → src-native/pods}/Headers/runtime/NativeScriptException.h +0 -0
  319. /package/{pods → src-native/pods}/Headers/runtime/ObjectManager.h +0 -0
  320. /package/{pods → src-native/pods}/Headers/runtime/OneByteStringResource.h +0 -0
  321. /package/{pods → src-native/pods}/Headers/runtime/Pointer.h +0 -0
  322. /package/{pods → src-native/pods}/Headers/runtime/PromiseProxy.h +0 -0
  323. /package/{pods → src-native/pods}/Headers/runtime/Reference.h +0 -0
  324. /package/{pods → src-native/pods}/Headers/runtime/Runtime.h +0 -0
  325. /package/{pods → src-native/pods}/Headers/runtime/RuntimeConfig.h +0 -0
  326. /package/{pods → src-native/pods}/Headers/runtime/SetTimeout.h +0 -0
  327. /package/{pods → src-native/pods}/Headers/runtime/SimpleAllocator.h +0 -0
  328. /package/{pods → src-native/pods}/Headers/runtime/StringHasher.h +0 -0
  329. /package/{pods → src-native/pods}/Headers/runtime/SymbolIterator.h +0 -0
  330. /package/{pods → src-native/pods}/Headers/runtime/SymbolLoader.h +0 -0
  331. /package/{pods → src-native/pods}/Headers/runtime/TNSDerivedClass.h +0 -0
  332. /package/{pods → src-native/pods}/Headers/runtime/TSHelpers.h +0 -0
  333. /package/{pods → src-native/pods}/Headers/runtime/Tasks.h +0 -0
  334. /package/{pods → src-native/pods}/Headers/runtime/UnmanagedType.h +0 -0
  335. /package/{pods → src-native/pods}/Headers/runtime/WeakRef.h +0 -0
  336. /package/{pods → src-native/pods}/Headers/runtime/Worker.h +0 -0
  337. /package/{pods → src-native/pods}/Headers/runtime/robin_hood.h +0 -0
  338. /package/{pods → src-native/pods}/Headers/v8runtime/HostProxy.h +0 -0
  339. /package/{pods → src-native/pods}/Headers/v8runtime/JSIV8ValueConverter.h +0 -0
  340. /package/{pods → src-native/pods}/Headers/v8runtime/V8PointerValue.h +0 -0
  341. /package/{pods → src-native/pods}/Headers/v8runtime/V8Runtime.h +0 -0
  342. /package/{pods → src-native/pods}/Headers/v8runtime/V8RuntimeConfig.h +0 -0
  343. /package/{pods → src-native/pods}/Headers/v8runtime/V8RuntimeFactory.h +0 -0
package/helpers.js CHANGED
@@ -1,96 +1,92 @@
1
- import { Length, Utils, isIOS } from '@nativescript/core';
1
+ // declare const __non_webpack_require__;
2
+ import { Length, Utils } from '@nativescript/core';
3
+ import { style_ } from './common';
2
4
  import { parseUnit } from '@nativescript/core/css/parser';
3
- export let UseV8Module = false;
4
- if (global.isAndroid) {
5
- try {
6
- java.lang.System.loadLibrary('masonnative');
7
- __non_webpack_require__('system_lib://libmasonnativev8.so');
8
- UseV8Module = true;
9
- }
10
- catch (error) {
11
- console.warn('Failed to enable on FastAPI');
12
- }
13
- }
14
- if (global.isIOS) {
15
- TSCMason.alwaysEnable = true;
16
- if (!UseV8Module) {
17
- try {
18
- const installer = global.MasonV8ModuleInstaller.new();
19
- installer.install();
20
- UseV8Module = true;
21
- }
22
- catch (error) {
23
- console.warn('Failed to enable on FastAPI');
24
- }
5
+ // if (__ANDROID__) {
6
+ // try {
7
+ // java.lang.System.loadLibrary('masonnative');
8
+ // __non_webpack_require__('system_lib://libmasonnativev8.so');
9
+ // UseV8Module = true;
10
+ // } catch (error) {
11
+ // console.warn('Failed to enable on FastAPI');
12
+ // }
13
+ // }
14
+ // if (__APPLE__) {
15
+ // NSCMason.alwaysEnable = true;
16
+ // if (!UseV8Module) {
17
+ // try {
18
+ // const installer = MasonV8Module.new();
19
+ // installer.install();
20
+ // UseV8Module = true;
21
+ // } catch (error) {
22
+ // console.warn('Failed to enable on FastAPI');
23
+ // }
24
+ // }
25
+ // }
26
+ function getMasonInstance(instance) {
27
+ const nativeView = instance?.android;
28
+ if (instance._isMasonChild) {
29
+ return org.nativescript.mason.masonkit.Mason.getShared().nodeForView(nativeView);
25
30
  }
31
+ return nativeView.getNode();
26
32
  }
27
- function getMasonInstance(instance) {
28
- const nativeView = instance?.nativeView;
33
+ function getStyleInstance(instance) {
34
+ const nativeView = instance?.android;
35
+ if (instance._isMasonChild) {
36
+ return org.nativescript.mason.masonkit.Mason.getShared()
37
+ .nodeForView(nativeView)
38
+ .getStyle();
39
+ }
40
+ return nativeView.getStyle();
41
+ }
42
+ function getNode(instance) {
43
+ const nativeView = instance?.ios;
29
44
  if (instance._isMasonChild) {
30
- const parent = instance.parent?.nativeView;
31
- return parent?.nodeForView?.(nativeView);
45
+ return NSCMason.shared.nodeForView(nativeView, true);
32
46
  }
33
- return nativeView;
47
+ return nativeView.node;
48
+ }
49
+ function getStyle(instance) {
50
+ const nativeView = instance?.ios;
51
+ if (instance._isMasonChild) {
52
+ return NSCMason.shared.nodeForView(nativeView, true).style;
53
+ }
54
+ return nativeView.style;
34
55
  }
35
56
  export function _forceStyleUpdate(instance) {
36
57
  if (!instance._hasNativeView) {
37
58
  return;
38
59
  }
39
- if (UseV8Module) {
40
- MasonV8Module.updateNodeAndStyle(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr);
41
- }
42
- else {
43
- if (global.isAndroid) {
44
- const nodeOrView = getMasonInstance(instance);
45
- nodeOrView.updateNodeAndStyle();
46
- }
47
- if (global.isIOS) {
48
- instance.ios.mason.updateNodeStyle();
49
- }
50
- }
60
+ // if (__ANDROID__) {
61
+ // const nodeOrView = getMasonInstance(instance) as org.nativescript.mason.masonkit.TextView;
62
+ // nodeOrView.getStyle().updateNodeAndStyle();
63
+ // }
64
+ // if (__APPLE__) {
65
+ // (instance.ios as MasonUIView).node.style.updateNativeStyle();
66
+ // }
51
67
  }
52
68
  export function _markDirty(instance) {
53
69
  if (!instance._hasNativeView) {
54
70
  return;
55
71
  }
56
- if (UseV8Module) {
57
- MasonV8Module.markDirty(instance._masonPtr, instance._masonNodePtr);
72
+ if (__ANDROID__) {
73
+ const nodeOrView = getMasonInstance(instance);
74
+ nodeOrView.dirty();
58
75
  }
59
- else {
60
- if (global.isAndroid) {
61
- const nodeOrView = getMasonInstance(instance);
62
- if (instance._isMasonChild) {
63
- nodeOrView.dirty();
64
- }
65
- else {
66
- nodeOrView.markNodeDirty();
67
- }
68
- }
69
- if (global.isIOS) {
70
- instance.ios.mason.markDirty();
71
- }
76
+ if (__APPLE__) {
77
+ getNode(instance).markDirty();
72
78
  }
73
79
  }
74
80
  export function _isDirty(instance) {
75
81
  if (!instance._hasNativeView) {
76
82
  return;
77
83
  }
78
- if (UseV8Module) {
79
- return MasonV8Module.isDirty(instance._masonPtr, instance._masonNodePtr);
84
+ if (__ANDROID__) {
85
+ const nodeOrView = getMasonInstance(instance);
86
+ return nodeOrView.isDirty();
80
87
  }
81
- else {
82
- if (global.isAndroid) {
83
- const nodeOrView = getMasonInstance(instance);
84
- if (instance._isMasonChild) {
85
- return nodeOrView.isDirty();
86
- }
87
- else {
88
- return nodeOrView.isNodeDirty();
89
- }
90
- }
91
- if (global.isAndroid) {
92
- return instance.ios.mason.isDirty;
93
- }
88
+ if (__APPLE__) {
89
+ return getNode(instance).isDirty;
94
90
  }
95
91
  return false;
96
92
  }
@@ -107,7 +103,7 @@ export function _intoType(type) {
107
103
  }
108
104
  }
109
105
  export function _parseDimension(dim) {
110
- if (global.isIOS) {
106
+ if (__APPLE__) {
111
107
  const type = dim.type;
112
108
  const value = dim.value;
113
109
  switch (type) {
@@ -130,7 +126,7 @@ export function _parseDimension(dim) {
130
126
  }
131
127
  }
132
128
  export function _parseLengthPercentage(dim) {
133
- if (global.isIOS) {
129
+ if (__APPLE__) {
134
130
  const type = dim.type;
135
131
  const value = dim.value;
136
132
  switch (type) {
@@ -151,7 +147,7 @@ export function _parseLengthPercentage(dim) {
151
147
  }
152
148
  }
153
149
  export function _parseLengthPercentageAuto(dim) {
154
- if (global.isIOS) {
150
+ if (__APPLE__) {
155
151
  const type = dim.type;
156
152
  const value = dim.value;
157
153
  switch (type) {
@@ -204,7 +200,7 @@ export function _intoMasonDimension(value) {
204
200
  if (value === undefined || value === null) {
205
201
  return null;
206
202
  }
207
- if (global.isIOS) {
203
+ if (__APPLE__) {
208
204
  if (value === 'auto') {
209
205
  return MasonDimensionCompat.Auto;
210
206
  }
@@ -224,7 +220,7 @@ export function _intoMasonDimension(value) {
224
220
  }
225
221
  return MasonDimensionCompat.alloc().initWithPoints(Utils.layout.toDevicePixels(value));
226
222
  }
227
- if (global.isAndroid) {
223
+ if (__ANDROID__) {
228
224
  if (value === 'auto') {
229
225
  return org.nativescript.mason.masonkit.Dimension.Auto;
230
226
  }
@@ -295,643 +291,120 @@ export function _toLengthPercentage(value) {
295
291
  }
296
292
  return { value: value, type: 'points', native_type: 0 /* MasonLengthPercentageCompatType.Points */ };
297
293
  }
294
+ function syncStyle(instance) {
295
+ // noop
296
+ }
298
297
  export function _setDisplay(value, instance, initial = false) {
299
- if (initial && value === 'flex') {
298
+ if (initial && value === 'block') {
300
299
  return;
301
300
  }
302
301
  if (instance._hasNativeView) {
303
- if (UseV8Module) {
304
- let nativeValue = -1;
305
- switch (value) {
306
- case 'none':
307
- nativeValue = 0 /* Display.None */;
308
- break;
309
- case 'flex':
310
- nativeValue = 1 /* Display.Flex */;
311
- break;
312
- case 'grid':
313
- nativeValue = 2 /* Display.Grid */;
314
- break;
315
- case 'block':
316
- nativeValue = 3 /* Display.Block */;
317
- break;
318
- }
319
- if (nativeValue !== -1) {
320
- MasonV8Module.setDisplay(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, nativeValue, !instance._inBatch);
321
- }
322
- }
323
- else {
324
- if (global.isAndroid) {
325
- let nativeValue = null;
326
- switch (value) {
327
- case 'flex':
328
- nativeValue = org.nativescript.mason.masonkit.Display.Flex;
329
- break;
330
- case 'grid':
331
- nativeValue = org.nativescript.mason.masonkit.Display.Grid;
332
- break;
333
- case 'block':
334
- nativeValue = org.nativescript.mason.masonkit.Display.Block;
335
- break;
336
- case 'none':
337
- nativeValue = org.nativescript.mason.masonkit.Display.None;
338
- break;
339
- }
340
- if (!Utils.isNullOrUndefined(nativeValue)) {
341
- const nodeOrView = getMasonInstance(instance);
342
- if (instance._isMasonChild) {
343
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setDisplay(nodeOrView, nativeValue);
344
- }
345
- else {
346
- nodeOrView.setDisplay(nativeValue);
347
- }
348
- }
349
- }
350
- if (global.isIOS) {
351
- let nativeValue = -1;
352
- switch (value) {
353
- case 'flex':
354
- nativeValue = 1 /* Display.Flex */;
355
- break;
356
- case 'grid':
357
- nativeValue = 2 /* Display.Grid */;
358
- break;
359
- case 'block':
360
- nativeValue = 3 /* Display.Block */;
361
- break;
362
- case 'none':
363
- nativeValue = 0 /* Display.None */;
364
- break;
365
- }
366
- if (nativeValue !== -1) {
367
- instance.ios.display = nativeValue;
368
- }
369
- }
370
- }
302
+ instance._styleHelper.display = value;
303
+ syncStyle(instance);
371
304
  }
372
305
  }
373
306
  export function _getDisplay(instance) {
374
- if (!instance._hasNativeView) {
375
- return instance.style.display;
376
- }
377
- if (UseV8Module) {
378
- const value = MasonV8Module.getDisplay(instance._masonStylePtr);
379
- switch (value) {
380
- case 0:
381
- return 'none';
382
- case 1:
383
- return 'flex';
384
- case 2:
385
- return 'grid';
386
- case 3:
387
- return 'block';
388
- }
389
- }
390
- else {
391
- if (global.isAndroid) {
392
- const nodeOrView = getMasonInstance(instance);
393
- let display;
394
- if (instance._isMasonChild) {
395
- display = org.nativescript.mason.masonkit.NodeHelper.INSTANCE.getDisplay(nodeOrView);
396
- }
397
- else {
398
- display = nodeOrView.getDisplay();
399
- }
400
- switch (display) {
401
- case org.nativescript.mason.masonkit.Display.None:
402
- return 'none';
403
- case org.nativescript.mason.masonkit.Display.Flex:
404
- return 'flex';
405
- case org.nativescript.mason.masonkit.Display.Grid:
406
- return 'grid';
407
- case org.nativescript.mason.masonkit.Display.Block:
408
- return 'block';
409
- }
410
- }
411
- if (global.isIOS) {
412
- switch (instance.ios.display) {
413
- case 0 /* Display.None */:
414
- return 'none';
415
- case 1 /* Display.Flex */:
416
- return 'flex';
417
- case 2 /* Display.Grid */:
418
- return 'grid';
419
- case 3 /* Display.Block */:
420
- return 'block';
421
- }
422
- }
423
- }
424
- return instance.style.display;
307
+ return instance._styleHelper.display;
425
308
  }
426
309
  export function _setMinWidth(value, instance, initial = false) {
427
310
  if (!instance._hasNativeView) {
428
311
  return;
429
312
  }
430
- const val = _toMasonDimension(value);
431
- if (UseV8Module) {
432
- MasonV8Module.setMinWidth(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, val.value, val.native_type, !instance._inBatch);
433
- }
434
- else {
435
- if (global.isAndroid) {
436
- const nodeOrView = getMasonInstance(instance);
437
- if (instance._isMasonChild) {
438
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setMinSizeWidth(nodeOrView, val.value, val.native_type);
439
- }
440
- else {
441
- nodeOrView.setMinSizeWidth(val.value, val.native_type);
442
- }
443
- }
444
- if (global.isIOS) {
445
- instance.ios.setMinSizeWidth(val.value, val.native_type);
446
- }
447
- }
313
+ instance._styleHelper.minWidth = value;
314
+ syncStyle(instance);
448
315
  }
449
316
  export function _getMinWidth(instance) {
450
317
  if (!instance._hasNativeView) {
451
318
  return instance.style.minWidth;
452
319
  }
453
- if (UseV8Module) {
454
- return MasonV8Module.getMinWidth(instance._masonStylePtr);
455
- }
456
- else {
457
- if (global.isAndroid) {
458
- const nodeOrView = getMasonInstance(instance);
459
- let min;
460
- if (instance._isMasonChild) {
461
- min = org.nativescript.mason.masonkit.NodeHelper.INSTANCE.getMinSizeWidth(nodeOrView);
462
- }
463
- else {
464
- min = nodeOrView.getMinSizeWidth();
465
- }
466
- return _parseDimension(min);
467
- }
468
- if (global.isIOS) {
469
- return _parseDimension(instance.ios.getMinSizeWidth());
470
- }
471
- }
320
+ return instance._styleHelper.minWidth;
472
321
  }
473
322
  export function _setMinHeight(value, instance, initial = false) {
474
323
  if (!instance._hasNativeView) {
475
324
  return;
476
325
  }
477
- const val = _toMasonDimension(value);
478
- if (UseV8Module) {
479
- MasonV8Module.setMinHeight(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, val.value, val.native_type, !instance._inBatch);
480
- }
481
- else {
482
- if (global.isAndroid) {
483
- const nodeOrView = getMasonInstance(instance);
484
- if (instance._isMasonChild) {
485
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setMinSizeHeight(nodeOrView, val.value, val.native_type);
486
- }
487
- else {
488
- nodeOrView.setMinSizeHeight(val.value, val.native_type);
489
- }
490
- }
491
- if (global.isIOS) {
492
- instance.ios.setMinSizeHeight(val.value, val.native_type);
493
- }
494
- }
326
+ instance._styleHelper.minHeight = value;
327
+ syncStyle(instance);
495
328
  }
496
329
  export function _getMinHeight(instance) {
497
330
  if (!instance._hasNativeView) {
498
331
  return instance.style.minHeight;
499
332
  }
500
- if (UseV8Module) {
501
- return MasonV8Module.getMinHeight(instance._masonStylePtr);
502
- }
503
- else {
504
- if (global.isAndroid) {
505
- const nodeOrView = getMasonInstance(instance);
506
- let min;
507
- if (instance._isMasonChild) {
508
- min = org.nativescript.mason.masonkit.NodeHelper.INSTANCE.getMinSizeHeight(nodeOrView);
509
- }
510
- else {
511
- min = nodeOrView.getMinSizeHeight();
512
- }
513
- return _parseDimension(min);
514
- }
515
- if (global.isIOS) {
516
- return _parseDimension(instance.ios.getMinSizeHeight());
517
- }
518
- }
333
+ return instance._styleHelper.minHeight;
519
334
  }
520
335
  export function _setWidth(value, instance, initial = false) {
521
336
  if (!instance._hasNativeView) {
522
337
  return;
523
338
  }
524
- const val = _toMasonDimension(value);
525
- if (UseV8Module) {
526
- MasonV8Module.setWidth(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, val.value, val.native_type, !instance._inBatch);
527
- }
528
- else {
529
- if (global.isAndroid) {
530
- const nodeOrView = getMasonInstance(instance);
531
- if (instance._isMasonChild) {
532
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setSizeWidth(nodeOrView, val.value, val.native_type);
533
- }
534
- else {
535
- nodeOrView.setSizeWidth(val.value, val.native_type);
536
- }
537
- }
538
- if (global.isIOS) {
539
- instance.ios.setSizeWidth(val.value, val.native_type);
540
- }
339
+ if (instance._styleHelper) {
340
+ instance._styleHelper.width = value;
541
341
  }
342
+ syncStyle(instance);
542
343
  }
543
344
  export function _getWidth(instance) {
544
345
  if (!instance._hasNativeView) {
545
346
  return instance.style.width;
546
347
  }
547
- if (UseV8Module) {
548
- return MasonV8Module.getWidth(instance._masonStylePtr);
549
- }
550
- else {
551
- if (global.isAndroid) {
552
- const nodeOrView = getMasonInstance(instance);
553
- let size;
554
- if (instance._isMasonChild) {
555
- size = org.nativescript.mason.masonkit.NodeHelper.INSTANCE.getSizeWidth(nodeOrView);
556
- }
557
- else {
558
- size = nodeOrView.getSizeWidth();
559
- }
560
- return _parseDimension(size);
561
- }
562
- if (global.isIOS) {
563
- return _parseDimension(instance.ios.getSizeWidth());
564
- }
565
- }
348
+ return instance._styleHelper.width;
566
349
  }
567
350
  export function _setHeight(value, instance, initial = false) {
568
351
  if (!instance._hasNativeView) {
569
352
  return;
570
353
  }
571
- const val = _toMasonDimension(value);
572
- if (UseV8Module) {
573
- MasonV8Module.setHeight(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, val.value, val.native_type, !instance._inBatch);
574
- }
575
- else {
576
- if (global.isAndroid) {
577
- const nodeOrView = getMasonInstance(instance);
578
- if (instance._isMasonChild) {
579
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setSizeHeight(nodeOrView, val.value, val.native_type);
580
- }
581
- else {
582
- nodeOrView.setSizeHeight(val.value, val.native_type);
583
- }
584
- }
585
- if (global.isIOS) {
586
- instance.ios.setSizeHeight(val.value, val.native_type);
587
- }
588
- }
354
+ instance._styleHelper.height = value;
589
355
  }
590
356
  export function _getHeight(instance) {
591
357
  if (!instance._hasNativeView) {
592
358
  return instance.style.height;
593
359
  }
594
- if (UseV8Module) {
595
- return MasonV8Module.getHeight(instance._masonStylePtr);
596
- }
597
- else {
598
- if (global.isAndroid) {
599
- const nodeOrView = getMasonInstance(instance);
600
- let size;
601
- if (instance._isMasonChild) {
602
- size = org.nativescript.mason.masonkit.NodeHelper.INSTANCE.getSizeHeight(nodeOrView);
603
- }
604
- else {
605
- size = nodeOrView.getSizeHeight();
606
- }
607
- return _parseDimension(size);
608
- }
609
- if (global.isIOS) {
610
- return _parseDimension(instance.ios.getSizeHeight());
611
- }
612
- }
360
+ return instance._styleHelper.height;
613
361
  }
614
362
  export function _setMaxWidth(value, instance, initial = false) {
615
363
  if (!instance._hasNativeView) {
616
364
  return;
617
365
  }
618
- const val = _toMasonDimension(value);
619
- if (UseV8Module) {
620
- MasonV8Module.setMaxWidth(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, val.value, val.native_type, !instance._inBatch);
621
- }
622
- else {
623
- if (global.isAndroid) {
624
- const nodeOrView = getMasonInstance(instance);
625
- if (instance._isMasonChild) {
626
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setMaxSizeWidth(nodeOrView, val.value, val.native_type);
627
- }
628
- else {
629
- nodeOrView.setMaxSizeWidth(val.value, val.native_type);
630
- }
631
- }
632
- if (global.isIOS) {
633
- instance.ios.setMaxSizeWidth(val.value, val.native_type);
634
- }
635
- }
366
+ instance._styleHelper.maxWidth = value;
367
+ syncStyle(instance);
636
368
  }
637
369
  export function _getMaxWidth(instance) {
638
370
  if (!instance._hasNativeView) {
639
371
  return instance.style.maxWidth;
640
372
  }
641
- if (UseV8Module) {
642
- return MasonV8Module.getMaxWidth(instance._masonStylePtr);
643
- }
644
- else {
645
- if (global.isAndroid) {
646
- const nodeOrView = getMasonInstance(instance);
647
- let max;
648
- if (instance._isMasonChild) {
649
- max = org.nativescript.mason.masonkit.NodeHelper.INSTANCE.getMaxSizeWidth(nodeOrView);
650
- }
651
- else {
652
- max = nodeOrView.getMaxSizeWidth();
653
- }
654
- return _parseDimension(max);
655
- }
656
- if (global.isIOS) {
657
- return _parseDimension(instance.ios.getMaxSizeWidth());
658
- }
659
- }
373
+ return instance._styleHelper.maxWidth;
660
374
  }
661
375
  export function _setMaxHeight(value, instance, initial = false) {
662
376
  if (!instance._hasNativeView) {
663
377
  return;
664
378
  }
665
- const val = _toMasonDimension(value);
666
- if (UseV8Module) {
667
- MasonV8Module.setMaxHeight(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, val.value, val.native_type, !instance._inBatch);
668
- }
669
- else {
670
- if (global.isAndroid) {
671
- const nodeOrView = getMasonInstance(instance);
672
- if (instance._isMasonChild) {
673
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setMaxSizeHeight(nodeOrView, val.value, val.native_type);
674
- }
675
- else {
676
- nodeOrView.setMaxSizeHeight(val.value, val.native_type);
677
- }
678
- }
679
- if (global.isIOS) {
680
- instance.ios.setMaxSizeHeight(val.value, val.native_type);
681
- }
682
- }
379
+ instance._styleHelper.maxHeight = value;
380
+ syncStyle(instance);
683
381
  }
684
382
  export function _getMaxHeight(instance) {
685
383
  if (!instance._hasNativeView) {
686
384
  return instance.style.maxHeight;
687
385
  }
688
- if (UseV8Module) {
689
- return MasonV8Module.getMaxHeight(instance._masonStylePtr);
690
- }
691
- else {
692
- if (global.isAndroid) {
693
- const nodeOrView = getMasonInstance(instance);
694
- let max;
695
- if (instance._isMasonChild) {
696
- max = org.nativescript.mason.masonkit.NodeHelper.INSTANCE.getMaxSizeHeight(nodeOrView);
697
- }
698
- else {
699
- max = nodeOrView.getMaxSizeHeight();
700
- }
701
- return _parseDimension(max);
702
- }
703
- if (global.isIOS) {
704
- return _parseDimension(instance.ios.getMaxSizeHeight());
705
- }
706
- }
386
+ return instance._styleHelper.maxHeight;
707
387
  }
708
388
  export function _setFlexDirection(value, instance, initial = false) {
709
389
  if (initial && value === 'row') {
710
390
  return;
711
391
  }
712
392
  if (instance._hasNativeView) {
713
- let nativeValue = null;
714
- switch (value) {
715
- case 'column':
716
- if (UseV8Module) {
717
- nativeValue = 1 /* FlexDirection.Column */;
718
- }
719
- else {
720
- if (global.isAndroid) {
721
- nativeValue = org.nativescript.mason.masonkit.FlexDirection.Column;
722
- }
723
- else if (global.isIOS) {
724
- nativeValue = 1 /* FlexDirection.Column */;
725
- }
726
- }
727
- break;
728
- case 'row':
729
- if (UseV8Module) {
730
- nativeValue = 0 /* FlexDirection.Row */;
731
- }
732
- else {
733
- if (global.isAndroid) {
734
- nativeValue = org.nativescript.mason.masonkit.FlexDirection.Row;
735
- }
736
- else if (global.isIOS) {
737
- nativeValue = 0 /* FlexDirection.Row */;
738
- }
739
- }
740
- break;
741
- case 'column-reverse':
742
- if (UseV8Module) {
743
- nativeValue = 3 /* FlexDirection.ColumnReverse */;
744
- }
745
- else {
746
- if (global.isAndroid) {
747
- nativeValue = org.nativescript.mason.masonkit.FlexDirection.ColumnReverse;
748
- }
749
- else if (global.isIOS) {
750
- nativeValue = 3 /* FlexDirection.ColumnReverse */;
751
- }
752
- }
753
- break;
754
- case 'row-reverse':
755
- if (UseV8Module) {
756
- nativeValue = 2 /* FlexDirection.RowReverse */;
757
- }
758
- else {
759
- if (global.isAndroid) {
760
- nativeValue = org.nativescript.mason.masonkit.FlexDirection.RowReverse;
761
- }
762
- else if (global.isIOS) {
763
- nativeValue = 2 /* FlexDirection.RowReverse */;
764
- }
765
- }
766
- break;
767
- }
768
- if (!Utils.isNullOrUndefined(nativeValue)) {
769
- if (UseV8Module) {
770
- MasonV8Module.setFlexDirection(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, nativeValue, !instance._inBatch);
771
- }
772
- else {
773
- if (global.isAndroid) {
774
- const nodeOrView = getMasonInstance(instance);
775
- if (instance._isMasonChild) {
776
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setFlexDirection(nodeOrView, nativeValue);
777
- }
778
- else {
779
- nodeOrView.setFlexDirection(nativeValue);
780
- }
781
- }
782
- if (global.isIOS) {
783
- instance.ios.flexDirection = nativeValue;
784
- }
785
- }
786
- }
393
+ instance._styleHelper.flexDirection = value;
787
394
  }
788
395
  }
789
396
  export function _getFlexDirection(instance) {
790
- if (instance._hasNativeView) {
791
- if (UseV8Module) {
792
- const value = MasonV8Module.getFlexDirection(instance._masonStylePtr);
793
- switch (value) {
794
- case 0 /* FlexDirection.Row */:
795
- return 'row';
796
- case 1 /* FlexDirection.Column */:
797
- return 'column';
798
- case 2 /* FlexDirection.RowReverse */:
799
- return 'row-reverse';
800
- case 3 /* FlexDirection.ColumnReverse */:
801
- return 'column-reverse';
802
- }
803
- }
804
- else {
805
- if (global.isAndroid) {
806
- const nodeOrView = getMasonInstance(instance);
807
- let value;
808
- if (instance._isMasonChild) {
809
- value = org.nativescript.mason.masonkit.NodeHelper.INSTANCE.getFlexDirection(nodeOrView);
810
- }
811
- else {
812
- value = nodeOrView.getFlexDirection();
813
- }
814
- switch (value) {
815
- case org.nativescript.mason.masonkit.FlexDirection.Row:
816
- return 'row';
817
- case org.nativescript.mason.masonkit.FlexDirection.Column:
818
- return 'column';
819
- case org.nativescript.mason.masonkit.FlexDirection.RowReverse:
820
- return 'row-reverse';
821
- case org.nativescript.mason.masonkit.FlexDirection.ColumnReverse:
822
- return 'column-reverse';
823
- }
824
- }
825
- if (global.isIOS) {
826
- const value = instance.ios.flexDirection;
827
- switch (value) {
828
- case 0 /* FlexDirection.Row */:
829
- return 'row';
830
- case 1 /* FlexDirection.Column */:
831
- return 'column';
832
- case 2 /* FlexDirection.RowReverse */:
833
- return 'row-reverse';
834
- case 3 /* FlexDirection.ColumnReverse */:
835
- return 'column-reverse';
836
- }
837
- }
838
- }
839
- }
840
- return instance.style.flexDirection;
397
+ return instance._styleHelper.flexDirection;
841
398
  }
842
399
  export function _getPosition(instance) {
843
- if (!instance._hasNativeView) {
844
- return instance.style.position;
845
- }
846
- if (UseV8Module) {
847
- const value = MasonV8Module.getPosition(instance._masonStylePtr);
848
- switch (value) {
849
- case 0:
850
- return 'relative';
851
- case 1:
852
- return 'absolute';
853
- }
854
- }
855
- else {
856
- if (global.isAndroid) {
857
- const nodeOrView = getMasonInstance(instance);
858
- let value;
859
- if (instance._isMasonChild) {
860
- value = org.nativescript.mason.masonkit.NodeHelper.INSTANCE.getPosition(nodeOrView);
861
- }
862
- else {
863
- value = nodeOrView.getPosition();
864
- }
865
- switch (value) {
866
- case org.nativescript.mason.masonkit.Position.Absolute:
867
- return 'absolute';
868
- case org.nativescript.mason.masonkit.Position.Relative:
869
- return 'relative';
870
- }
871
- }
872
- if (global.isIOS) {
873
- switch (instance.ios._position) {
874
- case 1 /* Position.Absolute */:
875
- return 'absolute';
876
- case 0 /* Position.Relative */:
877
- return 'relative';
878
- }
879
- }
880
- }
400
+ return instance._styleHelper.position;
881
401
  }
882
402
  export function _setPosition(value, instance, initial = false) {
883
403
  if (initial && value === 'relative') {
884
404
  return;
885
405
  }
886
406
  if (instance._hasNativeView) {
887
- let nativeValue = null;
888
- switch (value) {
889
- case 'absolute':
890
- if (UseV8Module) {
891
- nativeValue = 1 /* PositionType.Absolute */;
892
- }
893
- else {
894
- if (global.isAndroid) {
895
- nativeValue = org.nativescript.mason.masonkit.Position.Absolute;
896
- }
897
- else {
898
- nativeValue = 1;
899
- }
900
- }
901
- break;
902
- case 'relative':
903
- if (UseV8Module) {
904
- nativeValue = 0 /* PositionType.Relative */;
905
- }
906
- else {
907
- if (global.isAndroid) {
908
- nativeValue = org.nativescript.mason.masonkit.Position.Relative;
909
- }
910
- else {
911
- nativeValue = 0;
912
- }
913
- }
914
- break;
915
- }
916
- if (!Utils.isNullOrUndefined(nativeValue)) {
917
- if (UseV8Module) {
918
- MasonV8Module.setPosition(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, nativeValue, !instance._inBatch);
919
- }
920
- else {
921
- if (global.isAndroid) {
922
- const nodeOrView = getMasonInstance(instance);
923
- if (instance._isMasonChild) {
924
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setPosition(nodeOrView, nativeValue);
925
- }
926
- else {
927
- nodeOrView.setPosition(nativeValue);
928
- }
929
- }
930
- if (global.isIOS) {
931
- instance.ios._position = nativeValue;
932
- }
933
- }
934
- }
407
+ instance._styleHelper.position = value;
935
408
  }
936
409
  }
937
410
  export function _setFlexWrap(value, instance, initial = false) {
@@ -939,113 +412,12 @@ export function _setFlexWrap(value, instance, initial = false) {
939
412
  return;
940
413
  }
941
414
  if (instance._hasNativeView) {
942
- let nativeValue = null;
943
- switch (value) {
944
- case 'no-wrap':
945
- if (UseV8Module) {
946
- nativeValue = 0 /* FlexWrap.NoWrap */;
947
- }
948
- else {
949
- if (global.isAndroid) {
950
- nativeValue = org.nativescript.mason.masonkit.FlexWrap.NoWrap;
951
- }
952
- if (global.isIOS) {
953
- nativeValue = 0 /* FlexWrap.NoWrap */;
954
- }
955
- }
956
- break;
957
- case 'wrap':
958
- if (UseV8Module) {
959
- nativeValue = 1 /* FlexWrap.Wrap */;
960
- }
961
- else {
962
- if (global.isAndroid) {
963
- nativeValue = org.nativescript.mason.masonkit.FlexWrap.Wrap;
964
- }
965
- if (global.isIOS) {
966
- nativeValue = 1 /* FlexWrap.Wrap */;
967
- }
968
- }
969
- break;
970
- case 'wrap-reverse':
971
- if (UseV8Module) {
972
- nativeValue = 2 /* FlexWrap.WrapReverse */;
973
- }
974
- else {
975
- if (global.isAndroid) {
976
- nativeValue = org.nativescript.mason.masonkit.FlexWrap.WrapReverse;
977
- }
978
- if (global.isIOS) {
979
- nativeValue = 2 /* FlexWrap.WrapReverse */;
980
- }
981
- }
982
- break;
983
- }
984
- if (!Utils.isNullOrUndefined(nativeValue)) {
985
- if (UseV8Module) {
986
- MasonV8Module.setFlexWrap(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, nativeValue, !instance._inBatch);
987
- }
988
- else {
989
- if (global.isAndroid) {
990
- const nodeOrView = getMasonInstance(instance);
991
- if (instance._isMasonChild) {
992
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setFlexWrap(nodeOrView, nativeValue);
993
- }
994
- else {
995
- nodeOrView.setFlexWrap(nativeValue);
996
- }
997
- }
998
- if (global.isIOS) {
999
- instance.ios.flexWrap = nativeValue;
1000
- }
1001
- }
1002
- }
415
+ instance._styleHelper.flexWrap = value;
1003
416
  }
1004
417
  }
1005
418
  export function _getFlexWrap(instance) {
1006
419
  if (instance._hasNativeView) {
1007
- if (UseV8Module) {
1008
- const value = MasonV8Module.getFlexWrap(instance._masonStylePtr);
1009
- switch (value) {
1010
- case 0:
1011
- return 'no-wrap';
1012
- case 1:
1013
- return 'wrap';
1014
- case 2:
1015
- return 'wrap-reverse';
1016
- }
1017
- }
1018
- else {
1019
- if (global.isAndroid) {
1020
- const nodeOrView = getMasonInstance(instance);
1021
- let value;
1022
- if (instance._isMasonChild) {
1023
- value = org.nativescript.mason.masonkit.NodeHelper.INSTANCE.getFlexWrap(nodeOrView);
1024
- }
1025
- else {
1026
- value = nodeOrView.getFlexWrap();
1027
- }
1028
- switch (value) {
1029
- case org.nativescript.mason.masonkit.FlexWrap.NoWrap:
1030
- return 'no-wrap';
1031
- case org.nativescript.mason.masonkit.FlexWrap.Wrap:
1032
- return 'wrap';
1033
- case org.nativescript.mason.masonkit.FlexWrap.WrapReverse:
1034
- return 'wrap-reverse';
1035
- }
1036
- }
1037
- if (global.isIOS) {
1038
- const value = instance.ios.flexWrap;
1039
- switch (value) {
1040
- case 0 /* FlexWrap.NoWrap */:
1041
- return 'no-wrap';
1042
- case 1 /* FlexWrap.Wrap */:
1043
- return 'wrap';
1044
- case 2 /* FlexWrap.WrapReverse */:
1045
- return 'wrap-reverse';
1046
- }
1047
- }
1048
- }
420
+ return instance._styleHelper.flexWrap;
1049
421
  }
1050
422
  return instance.style.flexWrap;
1051
423
  }
@@ -1054,156 +426,12 @@ export function _setAlignItems(value, instance, initial = false) {
1054
426
  return;
1055
427
  }
1056
428
  if (instance._hasNativeView) {
1057
- let nativeValue = null;
1058
- switch (value) {
1059
- case 'normal':
1060
- if (UseV8Module || global.isIOS) {
1061
- nativeValue = -1 /* AlignItems.Normal */;
1062
- }
1063
- else {
1064
- nativeValue = org.nativescript.mason.masonkit.AlignItems.Normal;
1065
- }
1066
- break;
1067
- case 'baseline':
1068
- if (UseV8Module || global.isIOS) {
1069
- nativeValue = 3 /* AlignItems.Baseline */;
1070
- }
1071
- else {
1072
- nativeValue = org.nativescript.mason.masonkit.AlignItems.Baseline;
1073
- }
1074
- break;
1075
- case 'center':
1076
- if (UseV8Module || global.isIOS) {
1077
- nativeValue = 2 /* AlignItems.Center */;
1078
- }
1079
- else {
1080
- nativeValue = org.nativescript.mason.masonkit.AlignItems.Center;
1081
- }
1082
- break;
1083
- case 'flex-end':
1084
- if (UseV8Module || global.isIOS) {
1085
- nativeValue = 6 /* AlignItems.FlexEnd */;
1086
- }
1087
- else {
1088
- nativeValue = org.nativescript.mason.masonkit.AlignItems.FlexEnd;
1089
- }
1090
- break;
1091
- case 'end':
1092
- if (UseV8Module || global.isIOS) {
1093
- nativeValue = 1 /* AlignItems.End */;
1094
- }
1095
- else {
1096
- nativeValue = org.nativescript.mason.masonkit.AlignItems.End;
1097
- }
1098
- break;
1099
- case 'flex-start':
1100
- if (UseV8Module || global.isIOS) {
1101
- nativeValue = 5 /* AlignItems.FlexStart */;
1102
- }
1103
- else {
1104
- nativeValue = org.nativescript.mason.masonkit.AlignItems.FlexStart;
1105
- }
1106
- break;
1107
- case 'start':
1108
- if (UseV8Module || global.isIOS) {
1109
- nativeValue = 0 /* AlignItems.Start */;
1110
- }
1111
- else {
1112
- nativeValue = org.nativescript.mason.masonkit.AlignItems.Start;
1113
- }
1114
- break;
1115
- case 'stretch':
1116
- if (UseV8Module || global.isIOS) {
1117
- nativeValue = 4 /* AlignItems.Stretch */;
1118
- }
1119
- else {
1120
- nativeValue = org.nativescript.mason.masonkit.AlignItems.Stretch;
1121
- }
1122
- break;
1123
- }
1124
- if (!Utils.isNullOrUndefined(nativeValue)) {
1125
- if (UseV8Module) {
1126
- MasonV8Module.setAlignItems(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, nativeValue, !instance._inBatch);
1127
- }
1128
- else {
1129
- if (global.isAndroid) {
1130
- const nodeOrView = getMasonInstance(instance);
1131
- if (instance._isMasonChild) {
1132
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setAlignItems(nodeOrView, nativeValue);
1133
- }
1134
- else {
1135
- nodeOrView.setAlignItems(nativeValue);
1136
- }
1137
- }
1138
- if (global.isIOS) {
1139
- instance.ios.alignItems = nativeValue;
1140
- }
1141
- }
1142
- }
429
+ instance._styleHelper.alignItems = value;
1143
430
  }
1144
431
  }
1145
432
  export function _getAlignItems(instance) {
1146
433
  if (instance._hasNativeView) {
1147
- if (UseV8Module) {
1148
- const value = MasonV8Module.getAlignItems(instance._masonStylePtr);
1149
- switch (value) {
1150
- case -1 /* AlignItems.Normal */:
1151
- return 'normal';
1152
- case 3 /* AlignItems.Baseline */:
1153
- return 'baseline';
1154
- case 2 /* AlignItems.Center */:
1155
- return 'center';
1156
- case 1 /* AlignItems.End */:
1157
- return 'end';
1158
- case 0 /* AlignItems.Start */:
1159
- return 'start';
1160
- case 4 /* AlignItems.Stretch */:
1161
- return 'stretch';
1162
- }
1163
- }
1164
- else {
1165
- if (global.isAndroid) {
1166
- const nodeOrView = getMasonInstance(instance);
1167
- let value;
1168
- if (instance._isMasonChild) {
1169
- value = org.nativescript.mason.masonkit.NodeHelper.INSTANCE.getAlignItems(nodeOrView);
1170
- }
1171
- else {
1172
- value = nodeOrView.getAlignItems();
1173
- }
1174
- switch (value) {
1175
- case org.nativescript.mason.masonkit.AlignItems.Normal:
1176
- return 'normal';
1177
- case org.nativescript.mason.masonkit.AlignItems.Baseline:
1178
- return 'baseline';
1179
- case org.nativescript.mason.masonkit.AlignItems.Center:
1180
- return 'center';
1181
- case org.nativescript.mason.masonkit.AlignItems.End:
1182
- return 'end';
1183
- case org.nativescript.mason.masonkit.AlignItems.Start:
1184
- return 'start';
1185
- case org.nativescript.mason.masonkit.AlignItems.Stretch:
1186
- return 'stretch';
1187
- }
1188
- }
1189
- if (global.isIOS) {
1190
- const value = instance.ios.alignItems;
1191
- switch (value) {
1192
- case -1 /* AlignItems.Normal */:
1193
- return 'normal';
1194
- case 3 /* AlignItems.Baseline */:
1195
- return 'baseline';
1196
- case 2 /* AlignItems.Center */:
1197
- return 'center';
1198
- case 1 /* AlignItems.End */:
1199
- return 'end';
1200
- case 0 /* AlignItems.Start */:
1201
- return 'start';
1202
- case 4 /* AlignItems.Stretch */:
1203
- return 'stretch';
1204
- }
1205
- }
1206
- }
434
+ return instance._styleHelper.alignItems;
1207
435
  }
1208
436
  return instance.style.alignItems;
1209
437
  }
@@ -1212,156 +440,12 @@ export function _setAlignSelf(value, instance, initial = false) {
1212
440
  return;
1213
441
  }
1214
442
  if (instance._hasNativeView) {
1215
- let nativeValue = null;
1216
- switch (value) {
1217
- case 'normal':
1218
- if (UseV8Module || global.isIOS) {
1219
- nativeValue = -1 /* AlignSelf.Normal */;
1220
- }
1221
- else {
1222
- nativeValue = org.nativescript.mason.masonkit.AlignSelf.Normal;
1223
- }
1224
- break;
1225
- case 'baseline':
1226
- if (UseV8Module || global.isIOS) {
1227
- nativeValue = 3 /* AlignSelf.Baseline */;
1228
- }
1229
- else {
1230
- nativeValue = org.nativescript.mason.masonkit.AlignSelf.Baseline;
1231
- }
1232
- break;
1233
- case 'center':
1234
- if (UseV8Module || global.isIOS) {
1235
- nativeValue = 2 /* AlignSelf.Center */;
1236
- }
1237
- else {
1238
- nativeValue = org.nativescript.mason.masonkit.AlignSelf.Center;
1239
- }
1240
- break;
1241
- case 'flex-end':
1242
- if (UseV8Module || global.isIOS) {
1243
- nativeValue = 6 /* AlignSelf.FlexEnd */;
1244
- }
1245
- else {
1246
- nativeValue = org.nativescript.mason.masonkit.AlignSelf.FlexEnd;
1247
- }
1248
- break;
1249
- case 'end':
1250
- if (UseV8Module || global.isIOS) {
1251
- nativeValue = 1 /* AlignSelf.End */;
1252
- }
1253
- else {
1254
- nativeValue = org.nativescript.mason.masonkit.AlignSelf.End;
1255
- }
1256
- break;
1257
- case 'flex-start':
1258
- if (UseV8Module || global.isIOS) {
1259
- nativeValue = 5 /* AlignSelf.FlexStart */;
1260
- }
1261
- else {
1262
- nativeValue = org.nativescript.mason.masonkit.AlignSelf.FlexStart;
1263
- }
1264
- break;
1265
- case 'start':
1266
- if (UseV8Module || global.isIOS) {
1267
- nativeValue = 0 /* AlignSelf.Start */;
1268
- }
1269
- else {
1270
- nativeValue = org.nativescript.mason.masonkit.AlignSelf.Start;
1271
- }
1272
- break;
1273
- case 'stretch':
1274
- if (UseV8Module || global.isIOS) {
1275
- nativeValue = 4 /* AlignSelf.Stretch */;
1276
- }
1277
- else {
1278
- nativeValue = org.nativescript.mason.masonkit.AlignSelf.Stretch;
1279
- }
1280
- break;
1281
- }
1282
- if (!Utils.isNullOrUndefined(nativeValue)) {
1283
- if (UseV8Module) {
1284
- MasonV8Module.setAlignSelf(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, nativeValue, !instance._inBatch);
1285
- }
1286
- else {
1287
- if (global.isAndroid) {
1288
- const nodeOrView = getMasonInstance(instance);
1289
- if (instance._isMasonChild) {
1290
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setAlignSelf(nodeOrView, nativeValue);
1291
- }
1292
- else {
1293
- nodeOrView.setAlignSelf(nativeValue);
1294
- }
1295
- }
1296
- if (global.isIOS) {
1297
- instance.ios.alignSelf = nativeValue;
1298
- }
1299
- }
1300
- }
443
+ instance._styleHelper.alignSelf = value;
1301
444
  }
1302
445
  }
1303
446
  export function _getAlignSelf(instance) {
1304
447
  if (instance._hasNativeView) {
1305
- if (UseV8Module) {
1306
- const value = MasonV8Module.getAlignSelf(instance._masonStylePtr);
1307
- switch (value) {
1308
- case -1 /* AlignSelf.Normal */:
1309
- return 'normal';
1310
- case 3 /* AlignSelf.Baseline */:
1311
- return 'baseline';
1312
- case 2 /* AlignSelf.Center */:
1313
- return 'center';
1314
- case 1 /* AlignSelf.End */:
1315
- return 'end';
1316
- case 0 /* AlignSelf.Start */:
1317
- return 'start';
1318
- case 4 /* AlignSelf.Stretch */:
1319
- return 'stretch';
1320
- }
1321
- }
1322
- else {
1323
- if (global.isAndroid) {
1324
- const nodeOrView = getMasonInstance(instance);
1325
- let value;
1326
- if (instance._isMasonChild) {
1327
- value = org.nativescript.mason.masonkit.NodeHelper.INSTANCE.getAlignSelf(nodeOrView);
1328
- }
1329
- else {
1330
- value = nodeOrView.getAlignSelf();
1331
- }
1332
- switch (value) {
1333
- case org.nativescript.mason.masonkit.AlignSelf.Normal:
1334
- return 'normal';
1335
- case org.nativescript.mason.masonkit.AlignSelf.Baseline:
1336
- return 'baseline';
1337
- case org.nativescript.mason.masonkit.AlignSelf.Center:
1338
- return 'center';
1339
- case org.nativescript.mason.masonkit.AlignSelf.End:
1340
- return 'end';
1341
- case org.nativescript.mason.masonkit.AlignSelf.Start:
1342
- return 'start';
1343
- case org.nativescript.mason.masonkit.AlignSelf.Stretch:
1344
- return 'stretch';
1345
- }
1346
- }
1347
- if (global.isIOS) {
1348
- const value = instance.ios.alignSelf;
1349
- switch (value) {
1350
- case -1 /* AlignSelf.Normal */:
1351
- return 'normal';
1352
- case 3 /* AlignSelf.Baseline */:
1353
- return 'baseline';
1354
- case 2 /* AlignSelf.Center */:
1355
- return 'center';
1356
- case 1 /* AlignSelf.End */:
1357
- return 'end';
1358
- case 0 /* AlignSelf.Start */:
1359
- return 'start';
1360
- case 4 /* AlignSelf.Stretch */:
1361
- return 'stretch';
1362
- }
1363
- }
1364
- }
448
+ return instance._styleHelper.alignSelf;
1365
449
  }
1366
450
  return instance.style.alignSelf;
1367
451
  }
@@ -1370,234 +454,14 @@ export function _setAlignContent(value, instance, initial = false) {
1370
454
  return;
1371
455
  }
1372
456
  if (instance._hasNativeView) {
1373
- let nativeValue = null;
1374
- switch (value) {
1375
- case 'normal':
1376
- if (UseV8Module) {
1377
- nativeValue = -1 /* AlignContent.Normal */;
1378
- }
1379
- else {
1380
- if (global.isAndroid) {
1381
- nativeValue = org.nativescript.mason.masonkit.AlignContent.Normal;
1382
- }
1383
- if (global.isIOS) {
1384
- nativeValue = -1 /* AlignContent.Normal */;
1385
- }
1386
- }
1387
- break;
1388
- case 'space-around':
1389
- if (UseV8Module) {
1390
- nativeValue = 5 /* AlignContent.SpaceAround */;
1391
- }
1392
- else {
1393
- if (global.isAndroid) {
1394
- nativeValue = org.nativescript.mason.masonkit.AlignContent.SpaceAround;
1395
- }
1396
- if (global.isIOS) {
1397
- nativeValue = 5 /* AlignContent.SpaceAround */;
1398
- }
1399
- }
1400
- break;
1401
- case 'space-between':
1402
- if (UseV8Module) {
1403
- nativeValue = 4 /* AlignContent.SpaceBetween */;
1404
- }
1405
- else {
1406
- if (global.isAndroid) {
1407
- nativeValue = org.nativescript.mason.masonkit.AlignContent.SpaceBetween;
1408
- }
1409
- if (global.isIOS) {
1410
- nativeValue = 4 /* AlignContent.SpaceBetween */;
1411
- }
1412
- }
1413
- break;
1414
- case 'space-evenly':
1415
- if (UseV8Module) {
1416
- nativeValue = 6 /* AlignContent.SpaceEvenly */;
1417
- }
1418
- else {
1419
- if (global.isAndroid) {
1420
- nativeValue = org.nativescript.mason.masonkit.AlignContent.SpaceEvenly;
1421
- }
1422
- if (global.isIOS) {
1423
- nativeValue = 6 /* AlignContent.SpaceEvenly */;
1424
- }
1425
- }
1426
- break;
1427
- case 'center':
1428
- if (UseV8Module) {
1429
- nativeValue = 2 /* AlignContent.Center */;
1430
- }
1431
- else {
1432
- if (global.isAndroid) {
1433
- nativeValue = org.nativescript.mason.masonkit.AlignContent.Center;
1434
- }
1435
- if (global.isIOS) {
1436
- nativeValue = 2 /* AlignContent.Center */;
1437
- }
1438
- }
1439
- break;
1440
- case 'flex-end':
1441
- if (UseV8Module) {
1442
- nativeValue = 8 /* AlignContent.FlexEnd */;
1443
- }
1444
- else {
1445
- if (global.isAndroid) {
1446
- nativeValue = org.nativescript.mason.masonkit.AlignContent.FlexEnd;
1447
- }
1448
- if (global.isIOS) {
1449
- nativeValue = 8 /* AlignContent.FlexEnd */;
1450
- }
1451
- }
1452
- break;
1453
- case 'end':
1454
- if (UseV8Module) {
1455
- nativeValue = 1 /* AlignContent.End */;
1456
- }
1457
- else {
1458
- if (global.isAndroid) {
1459
- nativeValue = org.nativescript.mason.masonkit.AlignContent.End;
1460
- }
1461
- if (global.isIOS) {
1462
- nativeValue = 1 /* AlignContent.End */;
1463
- }
1464
- }
1465
- break;
1466
- case 'flex-start':
1467
- if (UseV8Module) {
1468
- nativeValue = 7 /* AlignContent.FlexStart */;
1469
- }
1470
- else {
1471
- if (global.isAndroid) {
1472
- nativeValue = org.nativescript.mason.masonkit.AlignContent.FlexStart;
1473
- }
1474
- if (global.isIOS) {
1475
- nativeValue = 7 /* AlignContent.FlexStart */;
1476
- }
1477
- }
1478
- break;
1479
- case 'start':
1480
- if (UseV8Module) {
1481
- nativeValue = 0 /* AlignContent.Start */;
1482
- }
1483
- else {
1484
- if (global.isAndroid) {
1485
- nativeValue = org.nativescript.mason.masonkit.AlignContent.Start;
1486
- }
1487
- if (global.isIOS) {
1488
- nativeValue = 0 /* AlignContent.Start */;
1489
- }
1490
- }
1491
- break;
1492
- case 'stretch':
1493
- if (UseV8Module) {
1494
- nativeValue = 3 /* AlignContent.Stretch */;
1495
- }
1496
- else {
1497
- if (global.isAndroid) {
1498
- nativeValue = org.nativescript.mason.masonkit.AlignContent.Stretch;
1499
- }
1500
- if (global.isIOS) {
1501
- nativeValue = 3 /* AlignContent.Stretch */;
1502
- }
1503
- }
1504
- break;
1505
- }
1506
- if (!Utils.isNullOrUndefined(nativeValue)) {
1507
- if (UseV8Module) {
1508
- MasonV8Module.setAlignContent(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, nativeValue, !instance._inBatch);
1509
- }
1510
- else {
1511
- if (global.isAndroid) {
1512
- const nodeOrView = getMasonInstance(instance);
1513
- if (instance._isMasonChild) {
1514
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setAlignContent(nodeOrView, nativeValue);
1515
- }
1516
- else {
1517
- nodeOrView.setAlignContent(nativeValue);
1518
- }
1519
- }
1520
- if (global.isIOS) {
1521
- instance.ios.alignContent = nativeValue;
1522
- }
1523
- }
457
+ if (instance._styleHelper) {
458
+ instance._styleHelper.alignContent = value;
1524
459
  }
1525
460
  }
1526
461
  }
1527
462
  export function _getAlignContent(instance) {
1528
463
  if (instance._hasNativeView) {
1529
- if (UseV8Module) {
1530
- const value = MasonV8Module.getAlignContent(instance._masonStylePtr);
1531
- switch (value) {
1532
- case -1 /* AlignContent.Normal */:
1533
- return 'normal';
1534
- case 5 /* AlignContent.SpaceAround */:
1535
- return 'space-around';
1536
- case 4 /* AlignContent.SpaceBetween */:
1537
- return 'space-between';
1538
- case 6 /* AlignContent.SpaceEvenly */:
1539
- return 'space-evenly';
1540
- case 2 /* AlignContent.Center */:
1541
- return 'center';
1542
- case 1 /* AlignContent.End */:
1543
- return 'end';
1544
- case 0 /* AlignContent.Start */:
1545
- return 'start';
1546
- case 3 /* AlignContent.Stretch */:
1547
- return 'stretch';
1548
- }
1549
- }
1550
- else {
1551
- if (global.isAndroid) {
1552
- const nodeOrView = getMasonInstance(instance);
1553
- let value;
1554
- if (instance._isMasonChild) {
1555
- value = org.nativescript.mason.masonkit.NodeHelper.INSTANCE.getAlignContent(nodeOrView);
1556
- }
1557
- else {
1558
- value = nodeOrView.getAlignContent();
1559
- }
1560
- switch (value) {
1561
- case org.nativescript.mason.masonkit.AlignContent.Normal:
1562
- return 'normal';
1563
- case org.nativescript.mason.masonkit.AlignContent.SpaceAround:
1564
- return 'space-around';
1565
- case org.nativescript.mason.masonkit.AlignContent.SpaceBetween:
1566
- return 'space-between';
1567
- case org.nativescript.mason.masonkit.AlignContent.SpaceEvenly:
1568
- return 'space-evenly';
1569
- case org.nativescript.mason.masonkit.AlignContent.Center:
1570
- return 'center';
1571
- case org.nativescript.mason.masonkit.AlignContent.End:
1572
- return 'end';
1573
- case org.nativescript.mason.masonkit.AlignContent.Start:
1574
- return 'start';
1575
- case org.nativescript.mason.masonkit.AlignContent.Stretch:
1576
- return 'stretch';
1577
- }
1578
- }
1579
- if (global.isIOS) {
1580
- const value = instance.ios.alignContent;
1581
- switch (value) {
1582
- case -1 /* AlignContent.Normal */:
1583
- return 'normal';
1584
- case 5 /* AlignContent.SpaceAround */:
1585
- return 'space-around';
1586
- case 4 /* AlignContent.SpaceBetween */:
1587
- return 'space-between';
1588
- case 6 /* AlignContent.SpaceEvenly */:
1589
- return 'space-evenly';
1590
- case 2 /* AlignContent.Center */:
1591
- return 'center';
1592
- case 1 /* AlignContent.End */:
1593
- return 'end';
1594
- case 0 /* AlignContent.Start */:
1595
- return 'start';
1596
- case 3 /* AlignContent.Stretch */:
1597
- return 'stretch';
1598
- }
1599
- }
1600
- }
464
+ return instance._styleHelper.alignContent;
1601
465
  }
1602
466
  return instance.style.alignContent;
1603
467
  }
@@ -1606,156 +470,12 @@ export function _setJustifyItems(value, instance, initial = false) {
1606
470
  return;
1607
471
  }
1608
472
  if (instance._hasNativeView) {
1609
- let nativeValue = null;
1610
- switch (value) {
1611
- case 'normal':
1612
- if (UseV8Module) {
1613
- nativeValue = -1 /* JustifyItems.Normal */;
1614
- }
1615
- else {
1616
- nativeValue = org.nativescript.mason.masonkit.JustifyItems.Normal;
1617
- }
1618
- break;
1619
- case 'baseline':
1620
- if (UseV8Module) {
1621
- nativeValue = 3 /* JustifyItems.Baseline */;
1622
- }
1623
- else {
1624
- nativeValue = org.nativescript.mason.masonkit.JustifyItems.Baseline;
1625
- }
1626
- break;
1627
- case 'center':
1628
- if (UseV8Module) {
1629
- nativeValue = 2 /* JustifyItems.Center */;
1630
- }
1631
- else {
1632
- nativeValue = org.nativescript.mason.masonkit.JustifyItems.Center;
1633
- }
1634
- break;
1635
- case 'flex-end':
1636
- if (UseV8Module) {
1637
- nativeValue = 6 /* JustifyItems.FlexEnd */;
1638
- }
1639
- else {
1640
- nativeValue = org.nativescript.mason.masonkit.JustifyItems.FlexEnd;
1641
- }
1642
- break;
1643
- case 'end':
1644
- if (UseV8Module) {
1645
- nativeValue = 1 /* JustifyItems.End */;
1646
- }
1647
- else {
1648
- nativeValue = org.nativescript.mason.masonkit.JustifyItems.End;
1649
- }
1650
- break;
1651
- case 'flex-start':
1652
- if (UseV8Module) {
1653
- nativeValue = 5 /* JustifyItems.FlexStart */;
1654
- }
1655
- else {
1656
- nativeValue = org.nativescript.mason.masonkit.JustifyItems.FlexStart;
1657
- }
1658
- break;
1659
- case 'start':
1660
- if (UseV8Module) {
1661
- nativeValue = 0 /* JustifyItems.Start */;
1662
- }
1663
- else {
1664
- nativeValue = org.nativescript.mason.masonkit.JustifyItems.Start;
1665
- }
1666
- break;
1667
- case 'stretch':
1668
- if (UseV8Module) {
1669
- nativeValue = 4 /* JustifyItems.Stretch */;
1670
- }
1671
- else {
1672
- nativeValue = org.nativescript.mason.masonkit.JustifyItems.Stretch;
1673
- }
1674
- break;
1675
- }
1676
- if (!Utils.isNullOrUndefined(nativeValue)) {
1677
- if (UseV8Module) {
1678
- MasonV8Module.setJustifyItems(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, nativeValue, !instance._inBatch);
1679
- }
1680
- else {
1681
- if (global.isAndroid) {
1682
- const nodeOrView = getMasonInstance(instance);
1683
- if (instance._isMasonChild) {
1684
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setJustifyItems(nodeOrView, nativeValue);
1685
- }
1686
- else {
1687
- nodeOrView.setJustifyItems(nativeValue);
1688
- }
1689
- }
1690
- if (global.isIOS) {
1691
- instance.ios.justifyItems = nativeValue;
1692
- }
1693
- }
1694
- }
473
+ instance._styleHelper.justifyItems = value;
1695
474
  }
1696
475
  }
1697
476
  export function _getJustifyItems(instance) {
1698
477
  if (instance._hasNativeView) {
1699
- if (UseV8Module) {
1700
- const value = MasonV8Module.getJustifyItems(instance._masonStylePtr);
1701
- switch (value) {
1702
- case -1 /* JustifyItems.Normal */:
1703
- return 'normal';
1704
- case 3 /* JustifyItems.Baseline */:
1705
- return 'baseline';
1706
- case 2 /* JustifyItems.Center */:
1707
- return 'center';
1708
- case 1 /* JustifyItems.End */:
1709
- return 'end';
1710
- case 0 /* JustifyItems.Start */:
1711
- return 'start';
1712
- case 4 /* JustifyItems.Stretch */:
1713
- return 'stretch';
1714
- }
1715
- }
1716
- else {
1717
- if (global.isAndroid) {
1718
- const nodeOrView = getMasonInstance(instance);
1719
- let value;
1720
- if (instance._isMasonChild) {
1721
- value = org.nativescript.mason.masonkit.NodeHelper.INSTANCE.getJustifyItems(nodeOrView);
1722
- }
1723
- else {
1724
- value = nodeOrView.getJustifyItems();
1725
- }
1726
- switch (value) {
1727
- case org.nativescript.mason.masonkit.JustifyItems.Normal:
1728
- return 'normal';
1729
- case org.nativescript.mason.masonkit.JustifyItems.Baseline:
1730
- return 'baseline';
1731
- case org.nativescript.mason.masonkit.JustifyItems.Center:
1732
- return 'center';
1733
- case org.nativescript.mason.masonkit.JustifyItems.End:
1734
- return 'end';
1735
- case org.nativescript.mason.masonkit.JustifyItems.Start:
1736
- return 'start';
1737
- case org.nativescript.mason.masonkit.JustifyItems.Stretch:
1738
- return 'stretch';
1739
- }
1740
- }
1741
- if (global.isIOS) {
1742
- const value = instance.ios.justifyItems;
1743
- switch (value) {
1744
- case -1 /* JustifyItems.Normal */:
1745
- return 'normal';
1746
- case 3 /* JustifyItems.Baseline */:
1747
- return 'baseline';
1748
- case 2 /* JustifyItems.Center */:
1749
- return 'center';
1750
- case 1 /* JustifyItems.End */:
1751
- return 'end';
1752
- case 0 /* JustifyItems.Start */:
1753
- return 'start';
1754
- case 4 /* JustifyItems.Stretch */:
1755
- return 'stretch';
1756
- }
1757
- }
1758
- }
478
+ return instance._styleHelper.justifyItems;
1759
479
  }
1760
480
  return instance.style.justifyItems;
1761
481
  }
@@ -1764,156 +484,12 @@ export function _setJustifySelf(value, instance, initial = false) {
1764
484
  return;
1765
485
  }
1766
486
  if (instance._hasNativeView) {
1767
- let nativeValue = null;
1768
- switch (value) {
1769
- case 'normal':
1770
- if (UseV8Module) {
1771
- nativeValue = -1 /* JustifySelf.Normal */;
1772
- }
1773
- else {
1774
- nativeValue = org.nativescript.mason.masonkit.JustifySelf.Normal;
1775
- }
1776
- break;
1777
- case 'baseline':
1778
- if (UseV8Module) {
1779
- nativeValue = 3 /* JustifySelf.Baseline */;
1780
- }
1781
- else {
1782
- nativeValue = org.nativescript.mason.masonkit.JustifySelf.Baseline;
1783
- }
1784
- break;
1785
- case 'center':
1786
- if (UseV8Module) {
1787
- nativeValue = 2 /* JustifySelf.Center */;
1788
- }
1789
- else {
1790
- nativeValue = org.nativescript.mason.masonkit.JustifySelf.Center;
1791
- }
1792
- break;
1793
- case 'flex-end':
1794
- if (UseV8Module) {
1795
- nativeValue = 6 /* JustifySelf.FlexEnd */;
1796
- }
1797
- else {
1798
- nativeValue = org.nativescript.mason.masonkit.JustifySelf.FlexEnd;
1799
- }
1800
- break;
1801
- case 'end':
1802
- if (UseV8Module) {
1803
- nativeValue = 1 /* JustifySelf.End */;
1804
- }
1805
- else {
1806
- nativeValue = org.nativescript.mason.masonkit.JustifySelf.End;
1807
- }
1808
- break;
1809
- case 'flex-start':
1810
- if (UseV8Module) {
1811
- nativeValue = 5 /* JustifySelf.FlexStart */;
1812
- }
1813
- else {
1814
- nativeValue = org.nativescript.mason.masonkit.JustifySelf.FlexStart;
1815
- }
1816
- break;
1817
- case 'start':
1818
- if (UseV8Module) {
1819
- nativeValue = 0 /* JustifySelf.Start */;
1820
- }
1821
- else {
1822
- nativeValue = org.nativescript.mason.masonkit.JustifySelf.Start;
1823
- }
1824
- break;
1825
- case 'stretch':
1826
- if (UseV8Module) {
1827
- nativeValue = 4 /* JustifySelf.Stretch */;
1828
- }
1829
- else {
1830
- nativeValue = org.nativescript.mason.masonkit.JustifySelf.Stretch;
1831
- }
1832
- break;
1833
- }
1834
- if (!Utils.isNullOrUndefined(nativeValue)) {
1835
- if (UseV8Module) {
1836
- MasonV8Module.setJustifySelf(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, nativeValue, !instance._inBatch);
1837
- }
1838
- else {
1839
- if (global.isAndroid) {
1840
- const nodeOrView = getMasonInstance(instance);
1841
- if (instance._isMasonChild) {
1842
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setJustifySelf(nodeOrView, nativeValue);
1843
- }
1844
- else {
1845
- nodeOrView.setJustifySelf(nativeValue);
1846
- }
1847
- }
1848
- if (global.isIOS) {
1849
- instance.ios.justifySelf = nativeValue;
1850
- }
1851
- }
1852
- }
487
+ instance._styleHelper.justifySelf = value;
1853
488
  }
1854
489
  }
1855
490
  export function _getJustifySelf(instance) {
1856
491
  if (instance._hasNativeView) {
1857
- if (UseV8Module) {
1858
- const value = MasonV8Module.getJustifySelf(instance._masonStylePtr);
1859
- switch (value) {
1860
- case -1 /* JustifySelf.Normal */:
1861
- return 'normal';
1862
- case 3 /* JustifySelf.Baseline */:
1863
- return 'baseline';
1864
- case 2 /* JustifySelf.Center */:
1865
- return 'center';
1866
- case 1 /* JustifySelf.End */:
1867
- return 'end';
1868
- case 0 /* JustifySelf.Start */:
1869
- return 'start';
1870
- case 4 /* JustifySelf.Stretch */:
1871
- return 'stretch';
1872
- }
1873
- }
1874
- else {
1875
- if (global.isAndroid) {
1876
- const nodeOrView = getMasonInstance(instance);
1877
- let value;
1878
- if (instance._isMasonChild) {
1879
- value = org.nativescript.mason.masonkit.NodeHelper.INSTANCE.getJustifySelf(nodeOrView);
1880
- }
1881
- else {
1882
- value = nodeOrView.getJustifySelf();
1883
- }
1884
- switch (value) {
1885
- case org.nativescript.mason.masonkit.JustifySelf.Normal:
1886
- return 'normal';
1887
- case org.nativescript.mason.masonkit.JustifySelf.Baseline:
1888
- return 'baseline';
1889
- case org.nativescript.mason.masonkit.JustifySelf.Center:
1890
- return 'center';
1891
- case org.nativescript.mason.masonkit.JustifySelf.End:
1892
- return 'end';
1893
- case org.nativescript.mason.masonkit.JustifySelf.Start:
1894
- return 'start';
1895
- case org.nativescript.mason.masonkit.JustifySelf.Stretch:
1896
- return 'stretch';
1897
- }
1898
- }
1899
- if (global.isIOS) {
1900
- const value = instance.ios.justifySelf;
1901
- switch (value) {
1902
- case -1 /* JustifySelf.Normal */:
1903
- return 'normal';
1904
- case 3 /* JustifySelf.Baseline */:
1905
- return 'baseline';
1906
- case 2 /* JustifySelf.Center */:
1907
- return 'center';
1908
- case 1 /* JustifySelf.End */:
1909
- return 'end';
1910
- case 0 /* JustifySelf.Start */:
1911
- return 'start';
1912
- case 4 /* JustifySelf.Stretch */:
1913
- return 'stretch';
1914
- }
1915
- }
1916
- }
492
+ return instance._styleHelper.justifySelf;
1917
493
  }
1918
494
  return instance.style.justifySelf;
1919
495
  }
@@ -1924,230 +500,14 @@ export function _setJustifyContent(value, instance, initial = false) {
1924
500
  if (!value)
1925
501
  value = 'normal';
1926
502
  if (instance._hasNativeView) {
1927
- let nativeValue = null;
1928
- switch (value) {
1929
- case 'normal':
1930
- if (UseV8Module) {
1931
- nativeValue = -1 /* JustifyContent.Normal */;
1932
- }
1933
- else {
1934
- if (global.isAndroid) {
1935
- nativeValue = org.nativescript.mason.masonkit.JustifyContent.Normal;
1936
- }
1937
- if (global.isIOS) {
1938
- nativeValue = -1 /* JustifyContent.Normal */;
1939
- }
1940
- }
1941
- break;
1942
- case 'space-around':
1943
- if (UseV8Module) {
1944
- nativeValue = 5 /* JustifyContent.SpaceAround */;
1945
- }
1946
- else {
1947
- if (global.isAndroid) {
1948
- nativeValue = org.nativescript.mason.masonkit.JustifyContent.SpaceAround;
1949
- }
1950
- if (global.isIOS) {
1951
- nativeValue = 5 /* JustifyContent.SpaceAround */;
1952
- }
1953
- }
1954
- break;
1955
- case 'space-between':
1956
- if (UseV8Module) {
1957
- nativeValue = 4 /* JustifyContent.SpaceBetween */;
1958
- }
1959
- else {
1960
- if (global.isAndroid) {
1961
- nativeValue = org.nativescript.mason.masonkit.JustifyContent.SpaceBetween;
1962
- }
1963
- if (global.isIOS) {
1964
- nativeValue = 4 /* JustifyContent.SpaceBetween */;
1965
- }
1966
- }
1967
- break;
1968
- case 'space-evenly':
1969
- if (UseV8Module) {
1970
- nativeValue = 6 /* JustifyContent.SpaceEvenly */;
1971
- }
1972
- else {
1973
- if (global.isAndroid) {
1974
- nativeValue = org.nativescript.mason.masonkit.JustifyContent.SpaceEvenly;
1975
- }
1976
- if (global.isIOS) {
1977
- nativeValue = 6 /* JustifyContent.SpaceEvenly */;
1978
- }
1979
- }
1980
- break;
1981
- case 'center':
1982
- if (UseV8Module) {
1983
- nativeValue = 2 /* JustifyContent.Center */;
1984
- }
1985
- else {
1986
- if (global.isAndroid) {
1987
- nativeValue = org.nativescript.mason.masonkit.JustifyContent.Center;
1988
- }
1989
- if (global.isIOS) {
1990
- nativeValue = 2 /* JustifyContent.Center */;
1991
- }
1992
- }
1993
- break;
1994
- case 'flex-end':
1995
- if (UseV8Module) {
1996
- nativeValue = 8 /* JustifyContent.FlexEnd */;
1997
- }
1998
- else {
1999
- if (global.isAndroid) {
2000
- nativeValue = org.nativescript.mason.masonkit.JustifyContent.FlexEnd;
2001
- }
2002
- if (global.isIOS) {
2003
- nativeValue = 8 /* JustifyContent.FlexEnd */;
2004
- }
2005
- }
2006
- break;
2007
- case 'end':
2008
- if (UseV8Module) {
2009
- nativeValue = 1 /* JustifyContent.End */;
2010
- }
2011
- else {
2012
- if (global.isAndroid) {
2013
- nativeValue = org.nativescript.mason.masonkit.JustifyContent.End;
2014
- }
2015
- if (global.isIOS) {
2016
- nativeValue = 1 /* JustifyContent.End */;
2017
- }
2018
- }
2019
- break;
2020
- case 'flex-start':
2021
- if (UseV8Module) {
2022
- nativeValue = 7 /* JustifyContent.FlexStart */;
2023
- }
2024
- else {
2025
- if (global.isAndroid) {
2026
- nativeValue = org.nativescript.mason.masonkit.JustifyContent.FlexStart;
2027
- }
2028
- if (global.isIOS) {
2029
- nativeValue = 7 /* JustifyContent.FlexStart */;
2030
- }
2031
- }
2032
- break;
2033
- case 'start':
2034
- if (UseV8Module) {
2035
- nativeValue = 0 /* JustifyContent.Start */;
2036
- }
2037
- else {
2038
- if (global.isAndroid) {
2039
- nativeValue = org.nativescript.mason.masonkit.JustifyContent.Start;
2040
- }
2041
- if (global.isIOS) {
2042
- nativeValue = 0 /* JustifyContent.Start */;
2043
- }
2044
- }
2045
- break;
2046
- case 'stretch':
2047
- if (UseV8Module) {
2048
- nativeValue = 3 /* JustifyContent.Stretch */;
2049
- }
2050
- else {
2051
- if (global.isAndroid) {
2052
- nativeValue = org.nativescript.mason.masonkit.JustifyContent.Stretch;
2053
- }
2054
- if (global.isIOS) {
2055
- nativeValue = 3 /* JustifyContent.Stretch */;
2056
- }
2057
- }
2058
- break;
2059
- }
2060
- if (UseV8Module) {
2061
- MasonV8Module.setJustifyContent(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, nativeValue, !instance._inBatch);
2062
- }
2063
- else {
2064
- if (global.isAndroid) {
2065
- const nodeOrView = getMasonInstance(instance);
2066
- if (instance._isMasonChild) {
2067
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setJustifyContent(nodeOrView, nativeValue);
2068
- }
2069
- else {
2070
- nodeOrView.setJustifyContent(nativeValue);
2071
- }
2072
- }
2073
- if (global.isIOS) {
2074
- instance.ios.justifyContent = nativeValue;
2075
- }
503
+ if (instance._styleHelper) {
504
+ instance._styleHelper.justifyContent = value;
2076
505
  }
2077
506
  }
2078
507
  }
2079
508
  export function _getJustifyContent(instance) {
2080
509
  if (instance._hasNativeView) {
2081
- if (UseV8Module) {
2082
- const value = MasonV8Module.getJustifyContent(instance._masonStylePtr);
2083
- switch (value) {
2084
- case -1 /* JustifyContent.Normal */:
2085
- return 'normal';
2086
- case 5 /* JustifyContent.SpaceAround */:
2087
- return 'space-around';
2088
- case 4 /* JustifyContent.SpaceBetween */:
2089
- return 'space-between';
2090
- case 6 /* JustifyContent.SpaceEvenly */:
2091
- return 'space-evenly';
2092
- case 2 /* JustifyContent.Center */:
2093
- return 'center';
2094
- case 1 /* JustifyContent.End */:
2095
- return 'end';
2096
- case 0 /* JustifyContent.Start */:
2097
- return 'start';
2098
- }
2099
- }
2100
- else {
2101
- if (global.isAndroid) {
2102
- const nodeOrView = getMasonInstance(instance);
2103
- let value;
2104
- if (instance._isMasonChild) {
2105
- value = org.nativescript.mason.masonkit.NodeHelper.INSTANCE.getJustifyContent(nodeOrView);
2106
- }
2107
- else {
2108
- value = nodeOrView.getJustifyContent();
2109
- }
2110
- switch (value) {
2111
- case org.nativescript.mason.masonkit.JustifyContent.Normal:
2112
- return 'normal';
2113
- case org.nativescript.mason.masonkit.JustifyContent.SpaceAround:
2114
- return 'space-around';
2115
- case org.nativescript.mason.masonkit.JustifyContent.SpaceBetween:
2116
- return 'space-between';
2117
- case org.nativescript.mason.masonkit.JustifyContent.SpaceEvenly:
2118
- return 'space-evenly';
2119
- case org.nativescript.mason.masonkit.JustifyContent.Center:
2120
- return 'center';
2121
- case org.nativescript.mason.masonkit.JustifyContent.End:
2122
- return 'end';
2123
- case org.nativescript.mason.masonkit.JustifyContent.Start:
2124
- return 'start';
2125
- case org.nativescript.mason.masonkit.JustifyContent.Stretch:
2126
- return 'stretch';
2127
- }
2128
- }
2129
- if (global.isIOS) {
2130
- const value = instance.ios.justifyContent;
2131
- switch (value) {
2132
- case -1 /* JustifyContent.Normal */:
2133
- return 'normal';
2134
- case 5 /* JustifyContent.SpaceAround */:
2135
- return 'space-around';
2136
- case 4 /* JustifyContent.SpaceBetween */:
2137
- return 'space-between';
2138
- case 6 /* JustifyContent.SpaceEvenly */:
2139
- return 'space-evenly';
2140
- case 2 /* JustifyContent.Center */:
2141
- return 'center';
2142
- case 1 /* JustifyContent.End */:
2143
- return 'end';
2144
- case 0 /* JustifyContent.Start */:
2145
- return 'start';
2146
- case 3 /* JustifyContent.Stretch */:
2147
- return 'stretch';
2148
- }
2149
- }
2150
- }
510
+ return instance._styleHelper.justifyContent;
2151
511
  }
2152
512
  return instance.style.justifyContent;
2153
513
  }
@@ -2155,857 +515,204 @@ export function _setLeft(value, instance, initial = false) {
2155
515
  if (!instance._hasNativeView) {
2156
516
  return;
2157
517
  }
2158
- const val = _toLengthPercentageAuto(value);
2159
- if (UseV8Module) {
2160
- MasonV8Module.setInsetLeft(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, val.value, val.native_type, !instance._inBatch);
2161
- }
2162
- else {
2163
- if (global.isAndroid) {
2164
- const nodeOrView = getMasonInstance(instance);
2165
- if (instance._isMasonChild) {
2166
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setInsetLeft(nodeOrView, val.value, val.native_type);
2167
- }
2168
- else {
2169
- nodeOrView.setInsetLeft(val.value, val.native_type);
2170
- }
2171
- }
2172
- if (global.isIOS) {
2173
- instance.ios.setInsetLeft(val.value, val.native_type);
2174
- }
2175
- }
518
+ instance._styleHelper.left = value;
2176
519
  }
2177
520
  export function _setRight(value, instance, initial = false) {
2178
521
  if (!instance._hasNativeView) {
2179
522
  return;
2180
523
  }
2181
- const val = _toLengthPercentageAuto(value);
2182
- if (UseV8Module) {
2183
- MasonV8Module.setInsetRight(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, val.value, val.native_type, !instance._inBatch);
2184
- }
2185
- else {
2186
- if (global.isAndroid) {
2187
- const nodeOrView = getMasonInstance(instance);
2188
- if (instance._isMasonChild) {
2189
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setInsetRight(nodeOrView, val.value, val.native_type);
2190
- }
2191
- else {
2192
- nodeOrView.setInsetRight(val.value, val.native_type);
2193
- }
2194
- }
2195
- if (global.isIOS) {
2196
- instance.ios.setInsetRight(val.value, val.native_type);
2197
- }
2198
- }
524
+ instance._styleHelper.right = value;
2199
525
  }
2200
526
  export function _setTop(value, instance, initial = false) {
2201
527
  if (!instance._hasNativeView) {
2202
528
  return;
2203
529
  }
2204
- const val = _toLengthPercentageAuto(value);
2205
- if (UseV8Module) {
2206
- MasonV8Module.setInsetTop(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, val.value, val.native_type, !instance._inBatch);
2207
- }
2208
- else {
2209
- if (global.isAndroid) {
2210
- const nodeOrView = getMasonInstance(instance);
2211
- if (instance._isMasonChild) {
2212
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setInsetTop(nodeOrView, val.value, val.native_type);
2213
- }
2214
- else {
2215
- nodeOrView.setInsetTop(val.value, val.native_type);
2216
- }
2217
- }
2218
- if (global.isIOS) {
2219
- instance.ios.setInsetTop(val.value, val.native_type);
2220
- }
2221
- }
530
+ instance._styleHelper.top = value;
2222
531
  }
2223
532
  export function _setBottom(value, instance, initial = false) {
2224
533
  if (!instance._hasNativeView) {
2225
534
  return;
2226
535
  }
2227
- const val = _toLengthPercentageAuto(value);
2228
- if (UseV8Module) {
2229
- MasonV8Module.setInsetBottom(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, val.value, val.native_type, !instance._inBatch);
2230
- }
2231
- else {
2232
- if (global.isAndroid) {
2233
- const nodeOrView = getMasonInstance(instance);
2234
- if (instance._isMasonChild) {
2235
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setInsetBottom(nodeOrView, val.value, val.native_type);
2236
- }
2237
- else {
2238
- nodeOrView.setInsetBottom(val.value, val.native_type);
2239
- }
2240
- }
2241
- if (global.isIOS) {
2242
- instance.ios.setInsetBottom(val.value, val.native_type);
2243
- }
2244
- }
536
+ instance._styleHelper.bottom = value;
2245
537
  }
2246
538
  export function _setMarginLeft(value, instance, initial = false) {
2247
539
  if (!instance._hasNativeView) {
2248
540
  return;
2249
541
  }
2250
- const val = _toLengthPercentageAuto(value);
2251
- if (UseV8Module) {
2252
- MasonV8Module.setMarginLeft(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, val.value, val.native_type, !instance._inBatch);
2253
- }
2254
- else {
2255
- if (global.isAndroid) {
2256
- const nodeOrView = getMasonInstance(instance);
2257
- if (instance._isMasonChild) {
2258
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setMarginLeft(nodeOrView, val.value, val.native_type);
2259
- }
2260
- else {
2261
- nodeOrView.setMarginLeft(val.value, val.native_type);
2262
- }
2263
- }
2264
- if (global.isIOS) {
2265
- instance.ios.setMarginLeft(val.value, val.native_type);
2266
- }
2267
- }
542
+ instance._styleHelper.marginLeft = value;
2268
543
  }
2269
544
  export function _setMarginRight(value, instance, initial = false) {
2270
545
  if (!instance._hasNativeView) {
2271
546
  return;
2272
547
  }
2273
- const val = _toLengthPercentageAuto(value);
2274
- if (UseV8Module) {
2275
- MasonV8Module.setMarginRight(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, val.value, val.native_type, !instance._inBatch);
2276
- }
2277
- else {
2278
- if (global.isAndroid) {
2279
- const nodeOrView = getMasonInstance(instance);
2280
- if (instance._isMasonChild) {
2281
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setMarginRight(nodeOrView, val.value, val.native_type);
2282
- }
2283
- else {
2284
- nodeOrView.setMarginRight(val.value, val.native_type);
2285
- }
2286
- }
2287
- if (global.isIOS) {
2288
- instance.ios.setMarginRight(val.value, val.native_type);
2289
- }
2290
- }
548
+ instance._styleHelper.marginRight = value;
2291
549
  }
2292
550
  export function _setMarginTop(value, instance, initial = false) {
2293
551
  if (!instance._hasNativeView) {
2294
552
  return;
2295
553
  }
2296
- const val = _toLengthPercentageAuto(value);
2297
- if (UseV8Module) {
2298
- MasonV8Module.setMarginTop(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, val.value, val.native_type, !instance._inBatch);
2299
- }
2300
- else {
2301
- if (global.isAndroid) {
2302
- const nodeOrView = getMasonInstance(instance);
2303
- if (instance._isMasonChild) {
2304
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setMarginTop(nodeOrView, val.value, val.native_type);
2305
- }
2306
- else {
2307
- nodeOrView.setMarginTop(val.value, val.native_type);
2308
- }
2309
- }
2310
- if (global.isIOS) {
2311
- instance.ios.setMarginTop(val.value, val.native_type);
2312
- }
2313
- }
554
+ instance._styleHelper.marginTop = value;
2314
555
  }
2315
556
  export function _setMarginBottom(value, instance, initial = false) {
2316
557
  if (!instance._hasNativeView) {
2317
558
  return;
2318
559
  }
2319
- const val = _toLengthPercentageAuto(value);
2320
- if (UseV8Module) {
2321
- MasonV8Module.setMarginBottom(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, val.value, val.native_type, !instance._inBatch);
2322
- }
2323
- else {
2324
- if (global.isAndroid) {
2325
- const nodeOrView = getMasonInstance(instance);
2326
- if (instance._isMasonChild) {
2327
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setMarginBottom(nodeOrView, val.value, val.native_type);
2328
- }
2329
- else {
2330
- nodeOrView.setMarginBottom(val.value, val.native_type);
2331
- }
2332
- }
2333
- if (global.isIOS) {
2334
- instance.ios.setMarginBottom(val.value, val.native_type);
2335
- }
2336
- }
560
+ instance._styleHelper.marginBottom = value;
2337
561
  }
2338
562
  export function _setPaddingLeft(value, instance, initial = false) {
2339
563
  if (!instance._hasNativeView) {
2340
564
  return;
2341
565
  }
2342
- const val = _toLengthPercentage(value);
2343
- if (UseV8Module) {
2344
- MasonV8Module.setPaddingLeft(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, val.value, val.native_type, !instance._inBatch);
2345
- }
2346
- else {
2347
- if (global.isAndroid) {
2348
- const nodeOrView = getMasonInstance(instance);
2349
- if (instance._isMasonChild) {
2350
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setPaddingLeft(nodeOrView, val.value, val.native_type);
2351
- }
2352
- else {
2353
- nodeOrView.setPaddingLeft(val.value, val.native_type);
2354
- }
2355
- }
2356
- if (global.isIOS) {
2357
- instance.ios.setPaddingLeft(val.value, val.native_type);
2358
- }
2359
- }
566
+ instance._styleHelper.paddingLeft = value;
2360
567
  }
2361
568
  export function _setPaddingRight(value, instance, initial = false) {
2362
569
  if (!instance._hasNativeView) {
2363
570
  return;
2364
571
  }
2365
- const val = _toLengthPercentage(value);
2366
- if (UseV8Module) {
2367
- MasonV8Module.setPaddingRight(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, val.value, val.native_type, !instance._inBatch);
2368
- }
2369
- else {
2370
- if (global.isAndroid) {
2371
- const nodeOrView = getMasonInstance(instance);
2372
- if (instance._isMasonChild) {
2373
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setPaddingRight(nodeOrView, val.value, val.native_type);
2374
- }
2375
- else {
2376
- nodeOrView.setPaddingRight(val.value, val.native_type);
2377
- }
2378
- }
2379
- if (global.isIOS) {
2380
- instance.ios.setPaddingRight(val.value, val.native_type);
2381
- }
2382
- }
572
+ instance._styleHelper.paddingRight = value;
2383
573
  }
2384
574
  export function _setPaddingTop(value, instance, initial = false) {
2385
575
  if (!instance._hasNativeView) {
2386
576
  return;
2387
577
  }
2388
- const val = _toLengthPercentage(value);
2389
- if (UseV8Module) {
2390
- MasonV8Module.setPaddingTop(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, val.value, val.native_type, !instance._inBatch);
2391
- }
2392
- else {
2393
- if (global.isAndroid) {
2394
- const nodeOrView = getMasonInstance(instance);
2395
- if (instance._isMasonChild) {
2396
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setPaddingTop(nodeOrView, val.value, val.native_type);
2397
- }
2398
- else {
2399
- nodeOrView.setPaddingTop(val.value, val.native_type);
2400
- }
2401
- }
2402
- if (global.isIOS) {
2403
- instance.ios.setPaddingTop(val.value, val.native_type);
2404
- }
2405
- }
578
+ instance._styleHelper.paddingTop = value;
2406
579
  }
2407
580
  export function _setPaddingBottom(value, instance, initial = false) {
2408
581
  if (!instance._hasNativeView) {
2409
582
  return;
2410
583
  }
2411
- const val = _toLengthPercentage(value);
2412
- if (UseV8Module) {
2413
- MasonV8Module.setPaddingBottom(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, val.value, val.native_type, !instance._inBatch);
2414
- }
2415
- else {
2416
- if (global.isAndroid) {
2417
- const nodeOrView = getMasonInstance(instance);
2418
- if (instance._isMasonChild) {
2419
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setPaddingBottom(nodeOrView, val.value, val.native_type);
2420
- }
2421
- else {
2422
- nodeOrView.setPaddingBottom(val.value, val.native_type);
2423
- }
2424
- }
2425
- if (global.isIOS) {
2426
- instance.ios.setPaddingBottom(val.value, val.native_type);
2427
- }
2428
- }
584
+ instance._styleHelper.paddingBottom = value;
2429
585
  }
2430
586
  export function _setBorderLeft(value, instance, initial = false) {
2431
587
  if (!instance._hasNativeView) {
2432
588
  return;
2433
589
  }
2434
- const val = _toLengthPercentage(value);
2435
- if (UseV8Module) {
2436
- MasonV8Module.setBorderLeft(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, val.value, val.native_type, !instance._inBatch);
2437
- }
2438
- else {
2439
- if (global.isAndroid) {
2440
- const nodeOrView = getMasonInstance(instance);
2441
- if (instance._isMasonChild) {
2442
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setBorderLeft(nodeOrView, val.value, val.native_type);
2443
- }
2444
- else {
2445
- nodeOrView.setBorderLeft(val.value, val.native_type);
2446
- }
2447
- }
2448
- if (global.isIOS) {
2449
- instance.ios.setBorderLeft(val.value, val.native_type);
2450
- }
2451
- }
2452
590
  }
2453
591
  export function _setBorderRight(value, instance, initial = false) {
2454
592
  if (!instance._hasNativeView) {
2455
593
  return;
2456
594
  }
2457
- const val = _toLengthPercentage(value);
2458
- if (UseV8Module) {
2459
- MasonV8Module.setBorderRight(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, val.value, val.native_type, !instance._inBatch);
2460
- }
2461
- else {
2462
- if (global.isAndroid) {
2463
- const nodeOrView = getMasonInstance(instance);
2464
- if (instance._isMasonChild) {
2465
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setBorderRight(nodeOrView, val.value, val.native_type);
2466
- }
2467
- else {
2468
- nodeOrView.setBorderRight(val.value, val.native_type);
2469
- }
2470
- }
2471
- if (global.isIOS) {
2472
- instance.ios.setBorderRight(val.value, val.native_type);
2473
- }
2474
- }
2475
595
  }
2476
596
  export function _setBorderTop(value, instance, initial = false) {
2477
597
  if (!instance._hasNativeView) {
2478
598
  return;
2479
599
  }
2480
- const val = _toLengthPercentage(value);
2481
- if (UseV8Module) {
2482
- MasonV8Module.setBorderTop(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, val.value, val.native_type, !instance._inBatch);
2483
- }
2484
- else {
2485
- if (global.isAndroid) {
2486
- const nodeOrView = getMasonInstance(instance);
2487
- if (instance._isMasonChild) {
2488
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setBorderTop(nodeOrView, val.value, val.native_type);
2489
- }
2490
- else {
2491
- nodeOrView.setBorderTop(val.value, val.native_type);
2492
- }
2493
- }
2494
- if (global.isIOS) {
2495
- instance.ios.setBorderTop(val.value, val.native_type);
2496
- }
2497
- }
2498
600
  }
2499
601
  export function _setBorderBottom(value, instance, initial = false) {
2500
602
  if (!instance._hasNativeView) {
2501
603
  return;
2502
604
  }
2503
- const val = _toLengthPercentage(value);
2504
- if (UseV8Module) {
2505
- MasonV8Module.setBorderBottom(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, val.value, val.native_type, !instance._inBatch);
2506
- }
2507
- else {
2508
- if (global.isAndroid) {
2509
- const nodeOrView = getMasonInstance(instance);
2510
- if (instance._isMasonChild) {
2511
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setBorderBottom(nodeOrView, val.value, val.native_type);
2512
- }
2513
- else {
2514
- nodeOrView.setBorderBottom(val.value, val.native_type);
2515
- }
2516
- }
2517
- if (global.isIOS) {
2518
- instance.ios.setBorderBottom(val.value, val.native_type);
2519
- }
2520
- }
2521
605
  }
2522
606
  export function _setFlexBasis(value, instance, initial = false) {
2523
607
  if (!instance._hasNativeView) {
2524
608
  return;
2525
609
  }
2526
- if (UseV8Module) {
2527
- const val = _toMasonDimension(value);
2528
- MasonV8Module.setFlexBasis(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, val.value, val.native_type, !instance._inBatch);
2529
- }
2530
- else {
2531
- if (global.isAndroid) {
2532
- const val = _toMasonDimension(value);
2533
- const nodeOrView = getMasonInstance(instance);
2534
- if (instance._isMasonChild) {
2535
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setFlexBasis(nodeOrView, val.value, val.native_type);
2536
- }
2537
- else {
2538
- nodeOrView.setFlexBasis(val.value, val.native_type);
2539
- }
2540
- }
2541
- if (global.isIOS) {
2542
- instance.ios.flexBasisCompat = _intoMasonDimension(value);
2543
- }
2544
- }
610
+ instance._styleHelper.flexBasis = value;
2545
611
  }
2546
612
  export function _getFlexBasis(instance) {
2547
613
  if (!instance._hasNativeView) {
2548
614
  return instance.style.flexBasis;
2549
615
  }
2550
- if (UseV8Module) {
2551
- return MasonV8Module.getFlexBasis(instance._masonStylePtr);
2552
- }
2553
- else {
2554
- if (global.isAndroid) {
2555
- const nodeOrView = getMasonInstance(instance);
2556
- let value;
2557
- if (instance._isMasonChild) {
2558
- value = org.nativescript.mason.masonkit.NodeHelper.INSTANCE.getFlexBasis(nodeOrView);
2559
- }
2560
- else {
2561
- value = nodeOrView.getFlexBasis();
2562
- }
2563
- return _parseDimension(value);
2564
- }
2565
- if (global.isIOS) {
2566
- return _parseDimension(instance.ios.flexBasisCompat);
2567
- }
2568
- return instance.style.flexBasis;
2569
- }
616
+ return instance._styleHelper.flexBasis;
2570
617
  }
2571
618
  export function _setGap(value, instance, initial = false) {
2572
619
  if (!instance._hasNativeView) {
2573
620
  return;
2574
621
  }
2575
- const width = _toLengthPercentage(value.width);
2576
- const height = _toLengthPercentage(value.height);
2577
- if (UseV8Module) {
2578
- MasonV8Module.setGap(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, width.value, width.native_type, height.value, height.native_type, !instance._inBatch);
2579
- }
2580
- else {
2581
- if (global.isAndroid) {
2582
- const nodeOrView = getMasonInstance(instance);
2583
- if (instance._isMasonChild) {
2584
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setGap(nodeOrView, width.value, width.native_type, height.value, height.native_type);
2585
- }
2586
- else {
2587
- nodeOrView.setGap(width.value, width.native_type, height.value, height.native_type);
2588
- }
2589
- }
2590
- if (global.isIOS) {
2591
- instance.ios.setGapWithWidthHeightType(width.value, width.native_type, height.value, height.native_type);
2592
- }
2593
- }
2594
622
  }
2595
623
  export function _getGap(instance) {
2596
624
  if (!instance._hasNativeView) {
2597
625
  return instance.style.gap;
2598
626
  }
2599
- if (UseV8Module) {
2600
- return MasonV8Module.getGap(instance._masonStylePtr);
2601
- }
2602
- else {
2603
- if (global.isAndroid) {
2604
- const nodeOrView = getMasonInstance(instance);
2605
- let gap;
2606
- if (instance._isMasonChild) {
2607
- gap = org.nativescript.mason.masonkit.NodeHelper.INSTANCE.getGap(nodeOrView);
2608
- }
2609
- else {
2610
- gap = nodeOrView.getGap();
2611
- }
2612
- const width = _parseLengthPercentage(gap.getWidth());
2613
- const height = _parseLengthPercentage(gap.getHeight());
2614
- return { width, height };
2615
- }
2616
- if (global.isIOS) {
2617
- const gap = instance.ios.getGap();
2618
- const width = _parseLengthPercentage(gap.width);
2619
- const height = _parseLengthPercentage(gap.height);
2620
- return { width, height };
2621
- }
2622
- }
2623
- }
2624
- function toOverflowValue(value) {
2625
- let nativeValue = 0;
2626
- switch (value) {
2627
- case 0:
2628
- nativeValue = 0 /* Overflow.Visible */;
2629
- break;
2630
- case 1:
2631
- nativeValue = 1 /* Overflow.Hidden */;
2632
- break;
2633
- case 2:
2634
- nativeValue = 2 /* Overflow.Scroll */;
2635
- break;
2636
- default:
2637
- nativeValue = 0 /* Overflow.Visible */;
2638
- }
2639
- return nativeValue;
2640
- }
2641
- function toOverflowJSValue(value) {
2642
- if (__IOS__) {
2643
- switch (value) {
2644
- case 0 /* Overflow.Visible */:
2645
- return 'visible';
2646
- case 1 /* Overflow.Hidden */:
2647
- return 'hidden';
2648
- case 2 /* Overflow.Scroll */:
2649
- return 'scroll';
2650
- default:
2651
- return 'visible';
2652
- }
2653
- }
2654
- switch (value) {
2655
- case org.nativescript.mason.masonkit.Overflow.Visible:
2656
- return 'visible';
2657
- case org.nativescript.mason.masonkit.Overflow.Hidden:
2658
- return 'hidden';
2659
- case org.nativescript.mason.masonkit.Overflow.Scroll:
2660
- return 'scroll';
2661
- default:
2662
- return 'visible';
2663
- }
2664
- }
2665
- function toOverflowJavaValue(value) {
2666
- let nativeValue = org.nativescript.mason.masonkit.Overflow.Visible;
2667
- switch (value) {
2668
- case 0:
2669
- nativeValue = org.nativescript.mason.masonkit.Overflow.Visible;
2670
- break;
2671
- case 1:
2672
- nativeValue = org.nativescript.mason.masonkit.Overflow.Hidden;
2673
- break;
2674
- case 2:
2675
- nativeValue = org.nativescript.mason.masonkit.Overflow.Scroll;
2676
- break;
2677
- default:
2678
- nativeValue = org.nativescript.mason.masonkit.Overflow.Visible;
2679
- }
2680
- return nativeValue;
627
+ return {
628
+ row: this._styleHelper.rowGap,
629
+ column: this._styleHelper.columnGap,
630
+ };
2681
631
  }
2682
632
  export function _setOverflow(value, instance) {
2683
633
  if (!instance._hasNativeView) {
2684
634
  return;
2685
635
  }
2686
- if (UseV8Module) {
2687
- const nativeValue = toOverflowValue(value);
2688
- MasonV8Module.setOverflow(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, nativeValue, !instance._inBatch);
2689
- }
2690
- else {
2691
- if (global.isAndroid) {
2692
- const nodeOrView = getMasonInstance(instance);
2693
- if (instance._isMasonChild) {
2694
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setOverflow(nodeOrView, toOverflowJavaValue(value));
2695
- }
2696
- else {
2697
- nodeOrView.setOverflow(toOverflowJavaValue(value));
2698
- }
2699
- }
2700
- if (global.isIOS) {
2701
- const nativeValue = toOverflowValue(value);
2702
- instance.ios.overflow = nativeValue;
2703
- }
2704
- }
636
+ instance._styleHelper.overflow = value;
2705
637
  }
2706
638
  export function _getOverflow(instance) {
2707
639
  if (!instance._hasNativeView) {
2708
640
  return instance.style.flexGrow;
2709
641
  }
2710
- if (UseV8Module) {
2711
- return MasonV8Module.getOverflow(instance._masonStylePtr);
2712
- }
2713
- else {
2714
- if (global.isAndroid) {
2715
- const nodeOrView = getMasonInstance(instance);
2716
- if (instance._isMasonChild) {
2717
- return toOverflowJSValue(org.nativescript.mason.masonkit.NodeHelper.INSTANCE.getOverflow(nodeOrView));
2718
- }
2719
- else {
2720
- return toOverflowJSValue(nodeOrView.getOverflow());
2721
- }
2722
- }
2723
- if (global.isIOS) {
2724
- return toOverflowJSValue(instance.ios.overflow);
2725
- }
2726
- }
642
+ return instance._styleHelper.overflow;
2727
643
  }
2728
- export function _setOverflowX(value, instance) {
2729
- if (!instance._hasNativeView) {
2730
- return;
2731
- }
2732
- if (UseV8Module) {
2733
- const nativeValue = toOverflowValue(value);
2734
- MasonV8Module.setOverflowX(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, nativeValue, !instance._inBatch);
2735
- }
2736
- else {
2737
- if (global.isAndroid) {
2738
- const nodeOrView = getMasonInstance(instance);
2739
- if (instance._isMasonChild) {
2740
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setOverflowX(nodeOrView, toOverflowJavaValue(value));
2741
- }
2742
- else {
2743
- nodeOrView.setOverflowX(toOverflowJavaValue(value));
2744
- }
2745
- }
2746
- if (global.isIOS) {
2747
- const nativeValue = toOverflowValue(value);
2748
- // TODO
2749
- instance.ios.overflowX = nativeValue;
2750
- }
644
+ export function _setOverflowX(value, instance) {
645
+ if (!instance._hasNativeView) {
646
+ return;
2751
647
  }
648
+ instance._styleHelper.overflowX = value;
2752
649
  }
2753
650
  export function _getOverflowX(instance) {
2754
651
  if (!instance._hasNativeView) {
2755
- return instance.style.flexGrow;
2756
- }
2757
- if (UseV8Module) {
2758
- return MasonV8Module.getOverflowX(instance._masonStylePtr);
2759
- }
2760
- else {
2761
- if (global.isAndroid) {
2762
- const nodeOrView = getMasonInstance(instance);
2763
- if (instance._isMasonChild) {
2764
- return toOverflowJSValue(org.nativescript.mason.masonkit.NodeHelper.INSTANCE.getOverflowX(nodeOrView));
2765
- }
2766
- else {
2767
- return toOverflowJSValue(nodeOrView.getOverflowX());
2768
- }
2769
- }
2770
- if (global.isIOS) {
2771
- return toOverflowJSValue(instance.ios.overflowX);
2772
- }
652
+ return instance.style.overflowX;
2773
653
  }
654
+ return instance._styleHelper.overflowX;
2774
655
  }
2775
656
  export function _setOverflowY(value, instance, initial = false) {
2776
657
  if (!instance._hasNativeView) {
2777
658
  return;
2778
659
  }
2779
- if (UseV8Module) {
2780
- const nativeValue = toOverflowValue(value);
2781
- MasonV8Module.setOverflowY(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, nativeValue, !instance._inBatch);
2782
- }
2783
- else {
2784
- if (global.isAndroid) {
2785
- const nodeOrView = getMasonInstance(instance);
2786
- if (instance._isMasonChild) {
2787
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setOverflowY(nodeOrView, toOverflowJavaValue(value));
2788
- }
2789
- else {
2790
- nodeOrView.setOverflowY(toOverflowJavaValue(value));
2791
- }
2792
- }
2793
- if (global.isIOS) {
2794
- const nativeValue = toOverflowValue(value);
2795
- // TODO
2796
- instance.ios.overflowY = nativeValue;
2797
- }
2798
- }
660
+ instance._styleHelper.overflowY = value;
2799
661
  }
2800
662
  export function _getOverflowY(instance) {
2801
663
  if (!instance._hasNativeView) {
2802
- return instance.style.flexGrow;
2803
- }
2804
- if (UseV8Module) {
2805
- return MasonV8Module.getOverflowY(instance._masonStylePtr);
2806
- }
2807
- else {
2808
- if (global.isAndroid) {
2809
- const nodeOrView = getMasonInstance(instance);
2810
- if (instance._isMasonChild) {
2811
- return toOverflowJSValue(org.nativescript.mason.masonkit.NodeHelper.INSTANCE.getOverflowY(nodeOrView));
2812
- }
2813
- else {
2814
- return toOverflowJSValue(nodeOrView.getOverflowY());
2815
- }
2816
- }
2817
- if (global.isIOS) {
2818
- return toOverflowJSValue(instance.ios.overflowY);
2819
- }
664
+ return instance.style.overflowY;
2820
665
  }
666
+ return instance._styleHelper.overflowY;
2821
667
  }
2822
668
  export function _setScrollbarWidth(value, instance, initial = false) {
2823
669
  if (!instance._hasNativeView) {
2824
670
  return;
2825
671
  }
2826
- value = _toMasonDimension(value).value;
2827
- if (UseV8Module) {
2828
- MasonV8Module.setScrollbarWidth(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, value, !instance._inBatch);
2829
- }
2830
- else {
2831
- if (global.isAndroid) {
2832
- const nodeOrView = getMasonInstance(instance);
2833
- if (instance._isMasonChild) {
2834
- return org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setScrollBarWidth(nodeOrView, value);
2835
- }
2836
- else {
2837
- return nodeOrView.setScrollBarWidth(value);
2838
- }
2839
- }
2840
- if (global.isIOS) {
2841
- instance.ios.scrollBarWidthCompat = MasonDimensionCompat.alloc().initWithPoints(value);
2842
- }
2843
- }
672
+ instance._styleHelper.scrollBarWidth = value;
2844
673
  }
2845
674
  export function getScrollbarWidth(instance) {
2846
675
  if (!instance._hasNativeView) {
2847
- return instance.style.flexGrow;
2848
- }
2849
- if (UseV8Module) {
2850
- return MasonV8Module.getScrollbarWidth(instance._masonStylePtr);
2851
- }
2852
- else {
2853
- if (global.isAndroid) {
2854
- const nodeOrView = getMasonInstance(instance);
2855
- if (instance._isMasonChild) {
2856
- return org.nativescript.mason.masonkit.NodeHelper.INSTANCE.getScrollBarWidth(nodeOrView);
2857
- }
2858
- else {
2859
- return nodeOrView.getScrollBarWidth();
2860
- }
2861
- }
2862
- if (global.isIOS) {
2863
- return _parseDimension(instance.ios.scrollBarWidthCompat);
2864
- }
676
+ return instance.style.scrollBarWidth;
2865
677
  }
678
+ return instance._styleHelper.scrollBarWidth;
2866
679
  }
2867
680
  export function _setFlexGrow(value, instance, initial = false) {
2868
681
  if (!instance._hasNativeView) {
2869
682
  return;
2870
683
  }
2871
- if (UseV8Module) {
2872
- MasonV8Module.setFlexGrow(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, value, !instance._inBatch);
2873
- }
2874
- else {
2875
- if (global.isAndroid) {
2876
- const nodeOrView = getMasonInstance(instance);
2877
- if (instance._isMasonChild) {
2878
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setFlexGrow(nodeOrView, value);
2879
- }
2880
- else {
2881
- nodeOrView.setFlexGrow(value);
2882
- }
2883
- }
2884
- if (global.isIOS) {
2885
- instance.ios.flexGrow = value;
2886
- }
2887
- }
684
+ instance._styleHelper.flexGrow = value;
2888
685
  }
2889
686
  export function _getFlexGrow(instance) {
2890
687
  if (!instance._hasNativeView) {
2891
688
  return instance.style.flexGrow;
2892
689
  }
2893
- if (UseV8Module) {
2894
- return MasonV8Module.getFlexGrow(instance._masonStylePtr);
2895
- }
2896
- else {
2897
- if (global.isAndroid) {
2898
- const nodeOrView = getMasonInstance(instance);
2899
- let value;
2900
- if (instance._isMasonChild) {
2901
- value = org.nativescript.mason.masonkit.NodeHelper.INSTANCE.getFlexGrow(nodeOrView);
2902
- }
2903
- else {
2904
- value = nodeOrView.getFlexGrow();
2905
- }
2906
- return value;
2907
- }
2908
- if (global.isiOS) {
2909
- return instance.ios.flexGrow;
2910
- }
2911
- return instance.style.flexGrow;
2912
- }
690
+ return instance._styleHelper.flexGrow;
2913
691
  }
2914
692
  export function _setFlexShrink(value, instance, initial = false) {
2915
693
  if (!instance._hasNativeView) {
2916
694
  return;
2917
695
  }
2918
- if (UseV8Module) {
2919
- MasonV8Module.setFlexShrink(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, value, !instance._inBatch);
2920
- }
2921
- else {
2922
- if (global.isAndroid) {
2923
- const nodeOrView = getMasonInstance(instance);
2924
- if (instance._isMasonChild) {
2925
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setFlexShrink(nodeOrView, value);
2926
- }
2927
- else {
2928
- nodeOrView.setFlexShrink(value);
2929
- }
2930
- }
2931
- if (global.isIOS) {
2932
- instance.ios.flexShrink = value;
2933
- }
2934
- }
696
+ instance._styleHelper.flexShrink = value;
2935
697
  }
2936
698
  export function _getFlexShrink(instance) {
2937
699
  if (!instance._hasNativeView) {
2938
700
  return instance.style.flexShrink;
2939
701
  }
2940
- if (UseV8Module) {
2941
- return MasonV8Module.getFlexShrink(instance._masonStylePtr);
2942
- }
2943
- else {
2944
- if (global.isAndroid) {
2945
- const nodeOrView = getMasonInstance(instance);
2946
- let value;
2947
- if (instance._isMasonChild) {
2948
- value = org.nativescript.mason.masonkit.NodeHelper.INSTANCE.getFlexShrink(nodeOrView);
2949
- }
2950
- else {
2951
- value = nodeOrView.getFlexShrink();
2952
- }
2953
- return value;
2954
- }
2955
- if (global.isIOS) {
2956
- return instance.ios.flexShrink;
2957
- }
2958
- return instance.style.flexShrink;
2959
- }
702
+ return instance._styleHelper.flexShrink;
2960
703
  }
2961
704
  export function _setAspectRatio(value, instance, initial = false) {
2962
705
  if (!instance._hasNativeView) {
2963
706
  return;
2964
707
  }
2965
- if (UseV8Module) {
2966
- MasonV8Module.setAspectRatio(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, value, !instance._inBatch);
2967
- }
2968
- else {
2969
- if (global.isAndroid) {
2970
- const val = Number.isNaN(value) ? null : value;
2971
- const nodeOrView = getMasonInstance(instance);
2972
- if (instance._isMasonChild) {
2973
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setAspectRatio(nodeOrView, val);
2974
- }
2975
- else {
2976
- nodeOrView.setAspectRatio(val);
2977
- }
2978
- }
2979
- if (global.isIOS) {
2980
- instance.ios.aspectRatio = value;
2981
- }
2982
- }
708
+ instance._styleHelper.aspectRatio = value ? value : Number.NaN;
2983
709
  }
2984
710
  export function _getAspectRatio(instance) {
2985
711
  if (!instance._hasNativeView) {
2986
712
  return instance.style.aspectRatio;
2987
713
  }
2988
- if (UseV8Module) {
2989
- return MasonV8Module.getAspectRatio(instance._masonStylePtr);
2990
- }
2991
- else {
2992
- if (global.isAndroid) {
2993
- const nodeOrView = getMasonInstance(instance);
2994
- let value;
2995
- if (instance._isMasonChild) {
2996
- value = org.nativescript.mason.masonkit.NodeHelper.INSTANCE.getAspectRatio(nodeOrView);
2997
- }
2998
- else {
2999
- value = nodeOrView.getAspectRatio();
3000
- }
3001
- return value;
3002
- }
3003
- if (global.isIOS) {
3004
- const ratio = instance.ios.aspectRatio;
3005
- return Number.isNaN(ratio) ? null : ratio;
3006
- }
3007
- return null;
3008
- }
714
+ const ratio = instance._styleHelper.aspectRatio;
715
+ return Number.isNaN(ratio) ? null : ratio;
3009
716
  }
3010
717
  function _parseGridLine(value) {
3011
718
  let parsedValue = undefined;
@@ -3042,48 +749,42 @@ function _parseGridLine(value) {
3042
749
  }
3043
750
  }
3044
751
  if (parsedType === 0) {
3045
- if (!UseV8Module) {
3046
- if (global.isAndroid) {
3047
- parsedType = org.nativescript.mason.masonkit.GridPlacement.Auto;
3048
- nativeValue = org.nativescript.mason.masonkit.GridPlacement.Auto.INSTANCE;
3049
- }
3050
- if (global.isIOS) {
3051
- parsedType = 0 /* GridPlacementCompatType.Auto */;
3052
- nativeValue = GridPlacementCompat.Auto;
3053
- }
752
+ if (__ANDROID__) {
753
+ parsedType = org.nativescript.mason.masonkit.GridPlacement.Auto;
754
+ nativeValue = org.nativescript.mason.masonkit.GridPlacement.Auto.INSTANCE;
755
+ }
756
+ if (__APPLE__) {
757
+ parsedType = 0 /* GridPlacementCompatType.Auto */;
758
+ nativeValue = GridPlacementCompat.Auto;
3054
759
  }
3055
760
  }
3056
761
  else if (parsedType === 1) {
3057
- if (!UseV8Module) {
3058
- const isValid = !Number.isNaN(parsedValue);
3059
- if (global.isAndroid) {
3060
- parsedType = org.nativescript.mason.masonkit.GridPlacement.Line;
3061
- if (isValid) {
3062
- nativeValue = new org.nativescript.mason.masonkit.GridPlacement.Line(parsedValue);
3063
- }
762
+ const isValid = !Number.isNaN(parsedValue);
763
+ if (__ANDROID__) {
764
+ parsedType = org.nativescript.mason.masonkit.GridPlacement.Line;
765
+ if (isValid) {
766
+ nativeValue = new org.nativescript.mason.masonkit.GridPlacement.Line(parsedValue);
3064
767
  }
3065
- if (global.isIOS) {
3066
- parsedType = 1 /* GridPlacementCompatType.Line */;
3067
- if (isValid) {
3068
- nativeValue = GridPlacementCompat.alloc().initWithLine(parsedValue);
3069
- }
768
+ }
769
+ if (__APPLE__) {
770
+ parsedType = 1 /* GridPlacementCompatType.Line */;
771
+ if (isValid) {
772
+ nativeValue = GridPlacementCompat.alloc().initWithLine(parsedValue);
3070
773
  }
3071
774
  }
3072
775
  }
3073
776
  else {
3074
- if (!UseV8Module) {
3075
- const isValid = !Number.isNaN(parsedValue);
3076
- if (global.isAndroid) {
3077
- parsedType = org.nativescript.mason.masonkit.GridPlacement.Span;
3078
- if (isValid) {
3079
- nativeValue = new org.nativescript.mason.masonkit.GridPlacement.Span(parsedValue);
3080
- }
777
+ const isValid = !Number.isNaN(parsedValue);
778
+ if (__ANDROID__) {
779
+ parsedType = org.nativescript.mason.masonkit.GridPlacement.Span;
780
+ if (isValid) {
781
+ nativeValue = new org.nativescript.mason.masonkit.GridPlacement.Span(parsedValue);
3081
782
  }
3082
- if (global.isIOS) {
3083
- parsedType = 2 /* GridPlacementCompatType.Span */;
3084
- if (isValid) {
3085
- nativeValue = GridPlacementCompat.alloc().initWithSpan(parsedValue);
3086
- }
783
+ }
784
+ if (__APPLE__) {
785
+ parsedType = 2 /* GridPlacementCompatType.Span */;
786
+ if (isValid) {
787
+ nativeValue = GridPlacementCompat.alloc().initWithSpan(parsedValue);
3087
788
  }
3088
789
  }
3089
790
  }
@@ -3097,22 +798,12 @@ export function _setGridColumnStart(value, instance, initial = false) {
3097
798
  if (val.value === undefined || val.type === undefined) {
3098
799
  return;
3099
800
  }
3100
- if (UseV8Module) {
3101
- MasonV8Module.setColumnStart(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, val, !instance._inBatch);
801
+ if (__ANDROID__) {
802
+ const nodeOrView = getMasonInstance(instance);
803
+ org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setGridColumnStart(nodeOrView, val.native_value);
3102
804
  }
3103
- else {
3104
- if (global.isAndroid) {
3105
- const nodeOrView = getMasonInstance(instance);
3106
- if (instance._isMasonChild) {
3107
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setGridColumnStart(nodeOrView, val.native_value);
3108
- }
3109
- else {
3110
- nodeOrView.setGridColumnStart(val.native_value);
3111
- }
3112
- }
3113
- if (global.isIOS) {
3114
- instance.ios.gridColumnStartCompat = val.native_value;
3115
- }
805
+ if (__APPLE__) {
806
+ instance.ios.gridColumnStartCompat = val.native_value;
3116
807
  }
3117
808
  }
3118
809
  export function _setGridColumnEnd(value, instance, initial = false) {
@@ -3123,22 +814,12 @@ export function _setGridColumnEnd(value, instance, initial = false) {
3123
814
  if (val.value === undefined || val.type === undefined) {
3124
815
  return;
3125
816
  }
3126
- if (UseV8Module) {
3127
- MasonV8Module.setColumnEnd(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, val, !instance._inBatch);
817
+ if (__ANDROID__) {
818
+ const nodeOrView = getMasonInstance(instance);
819
+ org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setGridColumnEnd(nodeOrView, val.native_value);
3128
820
  }
3129
- else {
3130
- if (global.isAndroid) {
3131
- const nodeOrView = getMasonInstance(instance);
3132
- if (instance._isMasonChild) {
3133
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setGridColumnEnd(nodeOrView, val.native_value);
3134
- }
3135
- else {
3136
- nodeOrView.setGridColumnEnd(val.native_value);
3137
- }
3138
- }
3139
- if (global.isIOS) {
3140
- instance.ios.gridColumnEndCompat = val.native_value;
3141
- }
821
+ if (__APPLE__) {
822
+ instance.ios.gridColumnEndCompat = val.native_value;
3142
823
  }
3143
824
  }
3144
825
  export function _setGridRowStart(value, instance, initial = false) {
@@ -3149,22 +830,12 @@ export function _setGridRowStart(value, instance, initial = false) {
3149
830
  if (val.value === undefined || val.type === undefined) {
3150
831
  return;
3151
832
  }
3152
- if (UseV8Module) {
3153
- MasonV8Module.setRowStart(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, val, !instance._inBatch);
833
+ if (__ANDROID__) {
834
+ const nodeOrView = getMasonInstance(instance);
835
+ org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setGridRowStart(nodeOrView, val.native_value);
3154
836
  }
3155
- else {
3156
- if (global.isAndroid) {
3157
- const nodeOrView = getMasonInstance(instance);
3158
- if (instance._isMasonChild) {
3159
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setGridRowStart(nodeOrView, val.native_value);
3160
- }
3161
- else {
3162
- nodeOrView.setGridRowStart(val.native_value);
3163
- }
3164
- }
3165
- if (global.isIOS) {
3166
- instance.ios.gridRowStartCompat = val.native_value;
3167
- }
837
+ if (__APPLE__) {
838
+ instance.ios.gridRowStartCompat = val.native_value;
3168
839
  }
3169
840
  }
3170
841
  export function _setGridRowEnd(value, instance, initial = false) {
@@ -3175,125 +846,37 @@ export function _setGridRowEnd(value, instance, initial = false) {
3175
846
  if (val.value === undefined || val.type === undefined) {
3176
847
  return;
3177
848
  }
3178
- if (UseV8Module) {
3179
- MasonV8Module.setRowEnd(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, val, !instance._inBatch);
849
+ if (__ANDROID__) {
850
+ const nodeOrView = getMasonInstance(instance);
851
+ org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setGridRowEnd(nodeOrView, val.native_value);
3180
852
  }
3181
- else {
3182
- if (global.isAndroid) {
3183
- const nodeOrView = getMasonInstance(instance);
3184
- if (instance._isMasonChild) {
3185
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setGridRowEnd(nodeOrView, val.native_value);
3186
- }
3187
- else {
3188
- nodeOrView.setGridRowEnd(val.native_value);
3189
- }
3190
- }
3191
- if (global.isIOS) {
3192
- instance.ios.gridRowEndCompat = val.native_value;
3193
- }
853
+ if (__APPLE__) {
854
+ instance.ios.gridRowEndCompat = val.native_value;
3194
855
  }
3195
856
  }
3196
857
  export function _setRowGap(value, instance, initial = false) {
3197
858
  if (!instance._hasNativeView) {
3198
859
  return;
3199
860
  }
3200
- const val = _toLengthPercentage(value);
3201
- if (val.value === undefined || val.type === undefined) {
3202
- return;
3203
- }
3204
- if (UseV8Module) {
3205
- MasonV8Module.setRowGap(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, val.value, val.native_type, !instance._inBatch);
3206
- }
3207
- else {
3208
- if (global.isAndroid) {
3209
- const nodeOrView = getMasonInstance(instance);
3210
- if (instance._isMasonChild) {
3211
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setGapRow(nodeOrView, val.value, val.native_type);
3212
- }
3213
- else {
3214
- nodeOrView.setGapRow(val.value, val.native_type);
3215
- }
3216
- }
3217
- if (global.isIOS) {
3218
- instance.ios.setRowGap(val.value, val.native_type);
3219
- }
3220
- }
861
+ instance._styleHelper.rowGap = value;
3221
862
  }
3222
863
  export function _getRowGap(instance) {
3223
864
  if (!instance._hasNativeView) {
3224
- return instance.style.gap;
3225
- }
3226
- if (UseV8Module) {
3227
- return MasonV8Module.getRowGap(instance._masonStylePtr);
3228
- }
3229
- else {
3230
- if (global.isAndroid) {
3231
- const nodeOrView = getMasonInstance(instance);
3232
- let gap;
3233
- if (instance._isMasonChild) {
3234
- gap = org.nativescript.mason.masonkit.NodeHelper.INSTANCE.getGapRow(nodeOrView);
3235
- }
3236
- else {
3237
- gap = nodeOrView.getGapRow();
3238
- }
3239
- return _parseLengthPercentage(gap);
3240
- }
3241
- if (global.isIOS) {
3242
- const gap = instance.ios.getRowGap();
3243
- return _parseLengthPercentage(gap);
3244
- }
865
+ return instance.style.rowGap;
3245
866
  }
867
+ return instance._styleHelper.rowGap;
3246
868
  }
3247
869
  export function _setColumnGap(value, instance, initial = false) {
3248
870
  if (!instance._hasNativeView) {
3249
871
  return;
3250
872
  }
3251
- const val = _toLengthPercentage(value);
3252
- if (val.value === undefined || val.type === undefined) {
3253
- return;
3254
- }
3255
- if (UseV8Module) {
3256
- MasonV8Module.setColumnGap(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, val.value, val.native_type, !instance._inBatch);
3257
- }
3258
- else {
3259
- if (global.isAndroid) {
3260
- const nodeOrView = getMasonInstance(instance);
3261
- if (instance._isMasonChild) {
3262
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setGapColumn(nodeOrView, val.value, val.native_type);
3263
- }
3264
- else {
3265
- nodeOrView.setGapColumn(val.value, val.native_type);
3266
- }
3267
- }
3268
- if (global.isIOS) {
3269
- instance.ios.setColumnGap(val.value, val.native_type);
3270
- }
3271
- }
873
+ instance._styleHelper.columnGap = value;
3272
874
  }
3273
875
  export function _getColumnGap(instance) {
3274
876
  if (!instance._hasNativeView) {
3275
877
  return instance.style.gap;
3276
878
  }
3277
- if (UseV8Module) {
3278
- return MasonV8Module.getColumnGap(instance._masonStylePtr);
3279
- }
3280
- else {
3281
- if (global.isAndroid) {
3282
- const nodeOrView = getMasonInstance(instance);
3283
- let gap;
3284
- if (instance._isMasonChild) {
3285
- gap = org.nativescript.mason.masonkit.NodeHelper.INSTANCE.getGapColumn(nodeOrView);
3286
- }
3287
- else {
3288
- gap = nodeOrView.getGapColumn();
3289
- }
3290
- return _parseLengthPercentage(gap);
3291
- }
3292
- if (global.isIOS) {
3293
- const gap = instance.ios.getColumnGap();
3294
- return _parseLengthPercentage(gap);
3295
- }
3296
- }
879
+ return instance._styleHelper.columnGap;
3297
880
  }
3298
881
  const Auto = 'auto';
3299
882
  const None = 'none';
@@ -3330,7 +913,7 @@ export function _parseMinMaxValue(value) {
3330
913
  return {
3331
914
  min_type: 0 /* MinSizingType.Auto */,
3332
915
  min_value: 0,
3333
- max_type: 5 /* MaxSizingType.Flex */,
916
+ max_type: 5 /* MaxSizingType.Fraction */,
3334
917
  max_value: flex,
3335
918
  };
3336
919
  }
@@ -3395,15 +978,6 @@ export function _parseMinMaxValue(value) {
3395
978
  max_value: percent,
3396
979
  };
3397
980
  }
3398
- else if (value.indexOf('fr') > -1) {
3399
- const flex = parseFloat(value.replace('fr', ''));
3400
- return {
3401
- min_type: 0 /* MinSizingType.Auto */,
3402
- min_value: 0,
3403
- max_type: 5 /* MaxSizingType.Flex */,
3404
- max_value: flex,
3405
- };
3406
- }
3407
981
  else {
3408
982
  const dip = Utils.layout.toDevicePixels(Number(value));
3409
983
  return {
@@ -3452,11 +1026,13 @@ export function _parseGridTemplates(value) {
3452
1026
  repeating_type = 1 /* TSCGridTrackRepetition.AutoFit */;
3453
1027
  break;
3454
1028
  default:
3455
- const number = parseInt(repetition);
3456
- repeating_type = 2 /* TSCGridTrackRepetition.Count */;
3457
- isValid = !Number.isNaN(number);
3458
- if (isValid) {
3459
- repeat_count = number;
1029
+ {
1030
+ const number = parseInt(repetition);
1031
+ repeating_type = 2 /* TSCGridTrackRepetition.Count */;
1032
+ isValid = !Number.isNaN(number);
1033
+ if (isValid) {
1034
+ repeat_count = number;
1035
+ }
3460
1036
  }
3461
1037
  break;
3462
1038
  }
@@ -3490,189 +1066,172 @@ export function _setGridTemplateRows(value, instance, initial = false) {
3490
1066
  if (!instance._hasNativeView) {
3491
1067
  return;
3492
1068
  }
3493
- if (UseV8Module) {
3494
- MasonV8Module.setGridTemplateRows(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, value, !instance._inBatch);
3495
- }
3496
- else {
3497
- if (global.isAndroid) {
3498
- const array = Array.create('org.nativescript.mason.masonkit.TrackSizingFunction', value.length);
3499
- const length = value.length;
3500
- for (let i = 0; i < length; i++) {
3501
- const item = value[i];
3502
- if (item.is_repeating) {
3503
- const repeating = item.value;
3504
- const tracks = Array.create('org.nativescript.mason.masonkit.MinMax', repeating.length);
3505
- let gridTrackRepetition = null;
3506
- switch (item.repeating_type) {
3507
- case 0 /* TSCGridTrackRepetition.AutoFill */:
3508
- gridTrackRepetition = org.nativescript.mason.masonkit.GridTrackRepetition.AutoFill;
3509
- break;
3510
- case 1 /* TSCGridTrackRepetition.AutoFit */:
3511
- gridTrackRepetition = org.nativescript.mason.masonkit.GridTrackRepetition.AutoFit;
3512
- break;
3513
- case 2 /* TSCGridTrackRepetition.Count */:
3514
- gridTrackRepetition = new org.nativescript.mason.masonkit.GridTrackRepetition.Count(item.repeating_count);
3515
- break;
3516
- }
3517
- if (gridTrackRepetition === null) {
3518
- continue;
3519
- }
3520
- const repeatingLength = repeating.length;
3521
- for (let j = 0; j < repeatingLength; j++) {
3522
- const repeat = repeating[j];
3523
- tracks[j] = org.nativescript.mason.masonkit.MinMax.fromTypeValue(repeat.min_type, repeat.min_value, repeat.max_type, repeat.max_value);
3524
- }
3525
- const repeat = new org.nativescript.mason.masonkit.TrackSizingFunction.AutoRepeat(gridTrackRepetition, tracks);
3526
- array[i] = repeat;
1069
+ if (__ANDROID__) {
1070
+ const array = Array.create('org.nativescript.mason.masonkit.TrackSizingFunction', value.length);
1071
+ const length = value.length;
1072
+ for (let i = 0; i < length; i++) {
1073
+ const item = value[i];
1074
+ if (item.is_repeating) {
1075
+ const repeating = item.value;
1076
+ const tracks = Array.create('org.nativescript.mason.masonkit.MinMax', repeating.length);
1077
+ let gridTrackRepetition = null;
1078
+ switch (item.repeating_type) {
1079
+ case 0 /* TSCGridTrackRepetition.AutoFill */:
1080
+ gridTrackRepetition = org.nativescript.mason.masonkit.GridTrackRepetition.AutoFill;
1081
+ break;
1082
+ case 1 /* TSCGridTrackRepetition.AutoFit */:
1083
+ gridTrackRepetition = org.nativescript.mason.masonkit.GridTrackRepetition.AutoFit;
1084
+ break;
1085
+ case 2 /* TSCGridTrackRepetition.Count */:
1086
+ gridTrackRepetition = new org.nativescript.mason.masonkit.GridTrackRepetition.Count(item.repeating_count);
1087
+ break;
3527
1088
  }
3528
- else {
3529
- const single = item.value;
3530
- const trackSizingFunction = new org.nativescript.mason.masonkit.TrackSizingFunction.Single(org.nativescript.mason.masonkit.MinMax.fromTypeValue(single.min_type, single.min_value, single.max_type, single.max_value));
3531
- array[i] = trackSizingFunction;
1089
+ if (gridTrackRepetition === null) {
1090
+ continue;
3532
1091
  }
3533
- }
3534
- const nodeOrView = getMasonInstance(instance);
3535
- if (instance._isMasonChild) {
3536
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setGridTemplateRows(nodeOrView, array);
1092
+ const repeatingLength = repeating.length;
1093
+ for (let j = 0; j < repeatingLength; j++) {
1094
+ const repeat = repeating[j];
1095
+ tracks[j] = org.nativescript.mason.masonkit.MinMax.fromTypeValue(repeat.min_type, repeat.min_value, repeat.max_type, repeat.max_value);
1096
+ }
1097
+ const repeat = new org.nativescript.mason.masonkit.TrackSizingFunction.AutoRepeat(gridTrackRepetition, tracks);
1098
+ array[i] = repeat;
3537
1099
  }
3538
1100
  else {
3539
- nodeOrView.setGridTemplateRows(array);
1101
+ const single = item.value;
1102
+ const trackSizingFunction = new org.nativescript.mason.masonkit.TrackSizingFunction.Single(org.nativescript.mason.masonkit.MinMax.fromTypeValue(single.min_type, single.min_value, single.max_type, single.max_value));
1103
+ array[i] = trackSizingFunction;
3540
1104
  }
3541
1105
  }
3542
- if (global.isIOS) {
3543
- const length = value.length;
3544
- const array = NSMutableArray.arrayWithCapacity(length);
3545
- for (let i = 0; i < length; i++) {
3546
- const item = value[i];
3547
- if (item.is_repeating) {
3548
- const repeating = item.value;
3549
- const repeatingLength = repeating.length;
3550
- const tracks = NSMutableArray.arrayWithCapacity(repeatingLength);
3551
- let gridTrackRepetition = null;
3552
- switch (item.repeating_type) {
3553
- case 0 /* TSCGridTrackRepetition.AutoFill */:
3554
- gridTrackRepetition = 0 /* TSCGridTrackRepetition.AutoFill */;
3555
- break;
3556
- case 1 /* TSCGridTrackRepetition.AutoFit */:
3557
- gridTrackRepetition = 1 /* TSCGridTrackRepetition.AutoFit */;
3558
- break;
3559
- case 2 /* TSCGridTrackRepetition.Count */:
3560
- gridTrackRepetition = GridTrackRepetition.Count(item.repeating_count);
3561
- break;
3562
- }
3563
- if (gridTrackRepetition === null) {
3564
- continue;
3565
- }
3566
- for (let j = 0; j < repeatingLength; j++) {
3567
- const repeat = repeating[j];
3568
- tracks.addObject(MinMax.fromTypeValue(repeat.min_type, repeat.min_value, repeat.max_type, repeat.max_value));
3569
- }
3570
- const repeat = TrackSizingFunction.AutoRepeat(gridTrackRepetition, tracks);
3571
- array.addObject(repeat);
1106
+ const nodeOrView = getMasonInstance(instance);
1107
+ org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setGridTemplateRows(nodeOrView, array);
1108
+ }
1109
+ if (__APPLE__) {
1110
+ const length = value.length;
1111
+ const array = NSMutableArray.arrayWithCapacity(length);
1112
+ for (let i = 0; i < length; i++) {
1113
+ const item = value[i];
1114
+ if (item.is_repeating) {
1115
+ const repeating = item.value;
1116
+ const repeatingLength = repeating.length;
1117
+ const tracks = NSMutableArray.arrayWithCapacity(repeatingLength);
1118
+ let gridTrackRepetition = null;
1119
+ switch (item.repeating_type) {
1120
+ case 0 /* TSCGridTrackRepetition.AutoFill */:
1121
+ gridTrackRepetition = 0 /* TSCGridTrackRepetition.AutoFill */;
1122
+ break;
1123
+ case 1 /* TSCGridTrackRepetition.AutoFit */:
1124
+ gridTrackRepetition = 1 /* TSCGridTrackRepetition.AutoFit */;
1125
+ break;
1126
+ case 2 /* TSCGridTrackRepetition.Count */:
1127
+ gridTrackRepetition = GridTrackRepetition.Count(item.repeating_count);
1128
+ break;
3572
1129
  }
3573
- else {
3574
- const single = item.value;
3575
- const trackSizingFunction = TrackSizingFunction.Single(MinMax.fromTypeValue(single.min_type, single.min_value, single.max_type, single.max_value));
3576
- array.addObject(trackSizingFunction);
1130
+ if (gridTrackRepetition === null) {
1131
+ continue;
3577
1132
  }
1133
+ for (let j = 0; j < repeatingLength; j++) {
1134
+ const repeat = repeating[j];
1135
+ tracks.addObject(MinMax.fromTypeValue(repeat.min_type, repeat.min_value, repeat.max_type, repeat.max_value));
1136
+ }
1137
+ const repeat = TrackSizingFunction.AutoRepeat(gridTrackRepetition, tracks);
1138
+ array.addObject(repeat);
1139
+ }
1140
+ else {
1141
+ const single = item.value;
1142
+ const trackSizingFunction = TrackSizingFunction.Single(MinMax.fromTypeValue(single.min_type, single.min_value, single.max_type, single.max_value));
1143
+ array.addObject(trackSizingFunction);
3578
1144
  }
3579
- instance.ios.gridTemplateRows = array;
3580
1145
  }
1146
+ instance.ios.gridTemplateRows = array;
3581
1147
  }
3582
1148
  }
3583
1149
  export function _setGridTemplateColumns(value, instance, initial = false) {
3584
1150
  if (!instance._hasNativeView) {
3585
1151
  return;
3586
1152
  }
3587
- if (UseV8Module) {
3588
- MasonV8Module.setGridTemplateColumns(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, value, !instance._inBatch);
3589
- }
3590
- else {
3591
- if (global.isAndroid) {
3592
- const array = Array.create('org.nativescript.mason.masonkit.TrackSizingFunction', value.length);
3593
- const length = value.length;
3594
- for (let i = 0; i < length; i++) {
3595
- const item = value[i];
3596
- if (item.is_repeating) {
3597
- const repeating = item.value;
3598
- const tracks = Array.create('org.nativescript.mason.masonkit.MinMax', repeating.length);
3599
- let gridTrackRepetition = null;
3600
- switch (item.repeating_type) {
3601
- case 0 /* TSCGridTrackRepetition.AutoFill */:
3602
- gridTrackRepetition = org.nativescript.mason.masonkit.GridTrackRepetition.AutoFill.INSTANCE;
3603
- break;
3604
- case 1 /* TSCGridTrackRepetition.AutoFit */:
3605
- gridTrackRepetition = org.nativescript.mason.masonkit.GridTrackRepetition.AutoFit.INSTANCE;
3606
- break;
3607
- case 2 /* TSCGridTrackRepetition.Count */:
3608
- gridTrackRepetition = new org.nativescript.mason.masonkit.GridTrackRepetition.Count(item.repeating_count);
3609
- break;
3610
- }
3611
- if (gridTrackRepetition === null) {
3612
- continue;
3613
- }
3614
- const repeatingLength = repeating.length;
3615
- for (let j = 0; j < repeatingLength; j++) {
3616
- const repeat = repeating[j];
3617
- tracks[j] = org.nativescript.mason.masonkit.MinMax.fromTypeValue(repeat.min_type, repeat.min_value, repeat.max_type, repeat.max_value);
3618
- }
3619
- const repeat = new org.nativescript.mason.masonkit.TrackSizingFunction.AutoRepeat(gridTrackRepetition, tracks);
3620
- array[i] = repeat;
1153
+ if (__ANDROID__) {
1154
+ const array = Array.create('org.nativescript.mason.masonkit.TrackSizingFunction', value.length);
1155
+ const length = value.length;
1156
+ for (let i = 0; i < length; i++) {
1157
+ const item = value[i];
1158
+ if (item.is_repeating) {
1159
+ const repeating = item.value;
1160
+ const tracks = Array.create('org.nativescript.mason.masonkit.MinMax', repeating.length);
1161
+ let gridTrackRepetition = null;
1162
+ switch (item.repeating_type) {
1163
+ case 0 /* TSCGridTrackRepetition.AutoFill */:
1164
+ gridTrackRepetition = org.nativescript.mason.masonkit.GridTrackRepetition.AutoFill.INSTANCE;
1165
+ break;
1166
+ case 1 /* TSCGridTrackRepetition.AutoFit */:
1167
+ gridTrackRepetition = org.nativescript.mason.masonkit.GridTrackRepetition.AutoFit.INSTANCE;
1168
+ break;
1169
+ case 2 /* TSCGridTrackRepetition.Count */:
1170
+ gridTrackRepetition = new org.nativescript.mason.masonkit.GridTrackRepetition.Count(item.repeating_count);
1171
+ break;
3621
1172
  }
3622
- else {
3623
- const single = item.value;
3624
- const minMax = single ? org.nativescript.mason.masonkit.MinMax.fromTypeValue(single.min_type, single.min_value, single.max_type, single.max_value) : org.nativescript.mason.masonkit.MinMax.Auto.INSTANCE;
3625
- const trackSizingFunction = new org.nativescript.mason.masonkit.TrackSizingFunction.Single(minMax);
3626
- array[i] = trackSizingFunction;
1173
+ if (gridTrackRepetition === null) {
1174
+ continue;
3627
1175
  }
3628
- }
3629
- const nodeOrView = getMasonInstance(instance);
3630
- if (instance._isMasonChild) {
3631
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setGridTemplateColumns(nodeOrView, array);
1176
+ const repeatingLength = repeating.length;
1177
+ for (let j = 0; j < repeatingLength; j++) {
1178
+ const repeat = repeating[j];
1179
+ tracks[j] = org.nativescript.mason.masonkit.MinMax.fromTypeValue(repeat.min_type, repeat.min_value, repeat.max_type, repeat.max_value);
1180
+ }
1181
+ const repeat = new org.nativescript.mason.masonkit.TrackSizingFunction.AutoRepeat(gridTrackRepetition, tracks);
1182
+ array[i] = repeat;
3632
1183
  }
3633
1184
  else {
3634
- nodeOrView.setGridTemplateColumns(array);
1185
+ const single = item.value;
1186
+ const minMax = single ? org.nativescript.mason.masonkit.MinMax.fromTypeValue(single.min_type, single.min_value, single.max_type, single.max_value) : org.nativescript.mason.masonkit.MinMax.Auto.INSTANCE;
1187
+ const trackSizingFunction = new org.nativescript.mason.masonkit.TrackSizingFunction.Single(minMax);
1188
+ array[i] = trackSizingFunction;
3635
1189
  }
3636
1190
  }
3637
- if (global.isIOS) {
3638
- const length = value.length;
3639
- const array = NSMutableArray.arrayWithCapacity(length);
3640
- for (let i = 0; i < length; i++) {
3641
- const item = value[i];
3642
- if (item.is_repeating) {
3643
- const repeating = item.value;
3644
- const repeatingLength = repeating.length;
3645
- const tracks = NSMutableArray.arrayWithCapacity(repeatingLength);
3646
- let gridTrackRepetition = null;
3647
- switch (item.repeating_type) {
3648
- case 0 /* TSCGridTrackRepetition.AutoFill */:
3649
- gridTrackRepetition = 0 /* TSCGridTrackRepetition.AutoFill */;
3650
- break;
3651
- case 1 /* TSCGridTrackRepetition.AutoFit */:
3652
- gridTrackRepetition = 1 /* TSCGridTrackRepetition.AutoFit */;
3653
- break;
3654
- case 2 /* TSCGridTrackRepetition.Count */:
3655
- gridTrackRepetition = GridTrackRepetition.Count(item.repeating_count);
3656
- break;
3657
- }
3658
- if (gridTrackRepetition === null) {
3659
- continue;
3660
- }
3661
- for (let j = 0; j < repeatingLength; j++) {
3662
- const repeat = repeating[j];
3663
- tracks.addObject(MinMax.fromTypeValue(repeat.min_type, repeat.min_value, repeat.max_type, repeat.max_value));
3664
- }
3665
- const repeat = TrackSizingFunction.AutoRepeat(gridTrackRepetition, tracks);
3666
- array.addObject(repeat);
1191
+ const nodeOrView = getMasonInstance(instance);
1192
+ org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setGridTemplateColumns(nodeOrView, array);
1193
+ }
1194
+ if (__APPLE__) {
1195
+ const length = value.length;
1196
+ const array = NSMutableArray.new();
1197
+ for (let i = 0; i < length; i++) {
1198
+ const item = value[i];
1199
+ if (item.is_repeating) {
1200
+ const repeating = item.value;
1201
+ const repeatingLength = repeating.length;
1202
+ const tracks = NSMutableArray.arrayWithCapacity(repeatingLength);
1203
+ let gridTrackRepetition = null;
1204
+ switch (item.repeating_type) {
1205
+ case 0 /* TSCGridTrackRepetition.AutoFill */:
1206
+ gridTrackRepetition = 0 /* TSCGridTrackRepetition.AutoFill */;
1207
+ break;
1208
+ case 1 /* TSCGridTrackRepetition.AutoFit */:
1209
+ gridTrackRepetition = 1 /* TSCGridTrackRepetition.AutoFit */;
1210
+ break;
1211
+ case 2 /* TSCGridTrackRepetition.Count */:
1212
+ gridTrackRepetition = GridTrackRepetition.Count(item.repeating_count);
1213
+ break;
3667
1214
  }
3668
- else {
3669
- const single = item.value;
3670
- const trackSizingFunction = TrackSizingFunction.Single(MinMax.fromTypeValue(single.min_type, single.min_value, single.max_type, single.max_value));
3671
- array.addObject(trackSizingFunction);
1215
+ if (gridTrackRepetition === null) {
1216
+ continue;
3672
1217
  }
1218
+ for (let j = 0; j < repeatingLength; j++) {
1219
+ const repeat = repeating[j];
1220
+ tracks.addObject(MinMax.fromTypeValue(repeat.min_type, repeat.min_value, repeat.max_type, repeat.max_value));
1221
+ }
1222
+ const repeat = TrackSizingFunction.AutoRepeat(gridTrackRepetition, tracks);
1223
+ array.addObject(repeat);
1224
+ }
1225
+ else {
1226
+ const single = item.value;
1227
+ const trackSizingFunction = TrackSizingFunction.Single(MinMax.fromTypeValue(single.min_type, single.min_value, single.max_type, single.max_value));
1228
+ array.addObject(trackSizingFunction);
3673
1229
  }
3674
- instance.ios.gridTemplateColumns = array;
3675
1230
  }
1231
+ instance.ios.gridTemplateColumns = array;
1232
+ console.log('gridTemplateColumns', instance.ios.gridTemplateColumns);
1233
+ console.log('gridTemplateColumns', instance.ios.gridTemplateColumns.count);
1234
+ console.log(instance.ios.style);
3676
1235
  }
3677
1236
  }
3678
1237
  export function _parseGridAutoRowsColumns(value) {
@@ -3690,142 +1249,43 @@ export function _parseGridAutoRowsColumns(value) {
3690
1249
  }
3691
1250
  return array;
3692
1251
  }
3693
- function toGridAutoFlow(value) {
3694
- if (isIOS || UseV8Module) {
3695
- switch (value) {
3696
- case 'row':
3697
- return 0 /* FlexGridAutoFlowWrap.Row */;
3698
- case 'column':
3699
- return 1 /* FlexGridAutoFlowWrap.Column */;
3700
- case 'row dense':
3701
- return 2 /* FlexGridAutoFlowWrap.RowDense */;
3702
- case 'column dense':
3703
- return 3 /* FlexGridAutoFlowWrap.ColumnDense */;
3704
- default:
3705
- return 0 /* FlexGridAutoFlowWrap.Row */;
3706
- }
3707
- }
3708
- switch (value) {
3709
- case 'row':
3710
- return org.nativescript.mason.masonkit.GridAutoFlow.Row;
3711
- case 'column':
3712
- return org.nativescript.mason.masonkit.GridAutoFlow.Column;
3713
- case 'row dense':
3714
- return org.nativescript.mason.masonkit.GridAutoFlow.RowDense;
3715
- case 'column dense':
3716
- return org.nativescript.mason.masonkit.GridAutoFlow.ColumnDense;
3717
- default:
3718
- return org.nativescript.mason.masonkit.GridAutoFlow.Row;
3719
- }
3720
- }
3721
1252
  export function _setGridAutoFlow(value, instance) {
3722
1253
  if (!instance._hasNativeView) {
3723
1254
  return;
3724
1255
  }
3725
- const nativeValue = toGridAutoFlow(value);
3726
- if (UseV8Module) {
3727
- MasonV8Module.setGridAutoFlow(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, nativeValue, !instance._inBatch);
3728
- }
3729
- else {
3730
- if (global.isAndroid) {
3731
- const nodeOrView = getMasonInstance(instance);
3732
- if (instance._isMasonChild) {
3733
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setGridAutoFlow(nodeOrView, nativeValue);
3734
- }
3735
- else {
3736
- nodeOrView.setGridAutoFlow(nativeValue);
3737
- }
3738
- }
3739
- if (isIOS) {
3740
- instance.ios.gridAutoFlow = nativeValue;
3741
- }
3742
- }
3743
- }
3744
- function parseGridAutoFlow(value) {
3745
- if (isIOS || UseV8Module) {
3746
- switch (value) {
3747
- case 0 /* FlexGridAutoFlowWrap.Row */:
3748
- return 'row';
3749
- case 1 /* FlexGridAutoFlowWrap.Column */:
3750
- return 'column';
3751
- case 2 /* FlexGridAutoFlowWrap.RowDense */:
3752
- return 'row dense';
3753
- case 3 /* FlexGridAutoFlowWrap.ColumnDense */:
3754
- return 'column dense';
3755
- default:
3756
- return 'row';
3757
- }
3758
- }
3759
- switch (value) {
3760
- case org.nativescript.mason.masonkit.GridAutoFlow.Row:
3761
- return 'row';
3762
- case org.nativescript.mason.masonkit.GridAutoFlow.Column:
3763
- return 'column';
3764
- case org.nativescript.mason.masonkit.GridAutoFlow.RowDense:
3765
- return 'row dense';
3766
- case org.nativescript.mason.masonkit.GridAutoFlow.ColumnDense:
3767
- return 'column dense';
3768
- default:
3769
- return 'row';
3770
- }
1256
+ instance.ios.gridAutoFlow = value;
3771
1257
  }
3772
1258
  export function _getGridAutoFlow(instance) {
3773
1259
  if (!instance._hasNativeView) {
3774
1260
  return;
3775
1261
  }
3776
- if (UseV8Module) {
3777
- return parseGridAutoFlow(MasonV8Module.getGridAutoFlow(instance._masonStylePtr));
3778
- }
3779
- else {
3780
- if (global.isAndroid) {
3781
- const nodeOrView = getMasonInstance(instance);
3782
- if (instance._isMasonChild) {
3783
- return parseGridAutoFlow(org.nativescript.mason.masonkit.NodeHelper.INSTANCE.getGridAutoFlow(nodeOrView));
3784
- }
3785
- else {
3786
- return parseGridAutoFlow(nodeOrView.getGridAutoFlow());
3787
- }
3788
- }
3789
- if (isIOS) {
3790
- return parseGridAutoFlow(instance.ios.gridAutoFlow);
3791
- }
3792
- }
1262
+ return this._styleHelper.gridAutoFlow;
3793
1263
  }
3794
1264
  export function _setGridAutoRows(value, instance, initial = false) {
3795
1265
  if (!instance._hasNativeView) {
3796
1266
  return;
3797
1267
  }
3798
1268
  const values = _parseGridAutoRowsColumns(value);
3799
- if (UseV8Module) {
3800
- MasonV8Module.setGridAutoRows(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, values, !instance._inBatch);
3801
- }
3802
- else {
3803
- if (global.isAndroid) {
3804
- const array = Array.create('org.nativescript.mason.masonkit.MinMax', values.length);
3805
- const length = value.length;
3806
- for (let i = 0; i < length; i++) {
3807
- const item = value[i];
3808
- const minMax = org.nativescript.mason.masonkit.MinMax.fromTypeValue(item.min_type, item.min_value, item.max_type, item.max_value);
3809
- array[i] = minMax;
3810
- }
3811
- const nodeOrView = getMasonInstance(instance);
3812
- if (instance._isMasonChild) {
3813
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setGridAutoRows(nodeOrView, array);
3814
- }
3815
- else {
3816
- nodeOrView.setGridAutoRows(array);
3817
- }
1269
+ if (__ANDROID__) {
1270
+ const array = Array.create('org.nativescript.mason.masonkit.MinMax', values.length);
1271
+ const length = value.length;
1272
+ for (let i = 0; i < length; i++) {
1273
+ const item = value[i];
1274
+ const minMax = org.nativescript.mason.masonkit.MinMax.fromTypeValue(item.min_type, item.min_value, item.max_type, item.max_value);
1275
+ array[i] = minMax;
3818
1276
  }
3819
- if (global.isIOS) {
3820
- const length = value.length;
3821
- const array = NSMutableArray.arrayWithCapacity(length);
3822
- for (let i = 0; i < length; i++) {
3823
- const item = value[i];
3824
- const minMax = MinMax.fromTypeValue(item.min_type, item.min_value, item.max_type, item.max_value);
3825
- array.addObject(minMax);
3826
- }
3827
- instance.ios.gridAutoRows = array;
1277
+ const nodeOrView = getMasonInstance(instance);
1278
+ org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setGridAutoRows(nodeOrView, array);
1279
+ }
1280
+ if (__APPLE__) {
1281
+ const length = value.length;
1282
+ const array = NSMutableArray.arrayWithCapacity(length);
1283
+ for (let i = 0; i < length; i++) {
1284
+ const item = value[i];
1285
+ const minMax = MinMax.fromTypeValue(item.min_type, item.min_value, item.max_type, item.max_value);
1286
+ array.addObject(minMax);
3828
1287
  }
1288
+ instance.ios.gridAutoRows = array;
3829
1289
  }
3830
1290
  }
3831
1291
  export function _setGridAutoColumns(value, instance, initial = false) {
@@ -3833,36 +1293,26 @@ export function _setGridAutoColumns(value, instance, initial = false) {
3833
1293
  return;
3834
1294
  }
3835
1295
  const values = _parseGridAutoRowsColumns(value);
3836
- if (UseV8Module) {
3837
- MasonV8Module.setGridAutoColumns(instance._masonPtr, instance._masonNodePtr, instance._masonStylePtr, values, !instance._inBatch);
3838
- }
3839
- else {
3840
- if (global.isAndroid) {
3841
- const array = Array.create('org.nativescript.mason.masonkit.MinMax', values.length);
3842
- const length = value.length;
3843
- for (let i = 0; i < length; i++) {
3844
- const item = value[i];
3845
- const minMax = org.nativescript.mason.masonkit.MinMax.fromTypeValue(item.min_type, item.min_value, item.max_type, item.max_value);
3846
- array[i] = minMax;
3847
- }
3848
- const nodeOrView = getMasonInstance(instance);
3849
- if (instance._isMasonChild) {
3850
- org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setGridAutoColumns(nodeOrView, array);
3851
- }
3852
- else {
3853
- nodeOrView.setGridAutoColumns(array);
3854
- }
3855
- }
3856
- if (global.isIOS) {
3857
- const length = value.length;
3858
- const array = NSMutableArray.arrayWithCapacity(length);
3859
- for (let i = 0; i < length; i++) {
3860
- const item = value[i];
3861
- const minMax = MinMax.fromTypeValue(item.min_type, item.min_value, item.max_type, item.max_value);
3862
- array.addObject(minMax);
3863
- }
3864
- instance.ios.gridAutoColumns = array;
3865
- }
1296
+ if (__ANDROID__) {
1297
+ const array = Array.create('org.nativescript.mason.masonkit.MinMax', values.length);
1298
+ const length = value.length;
1299
+ for (let i = 0; i < length; i++) {
1300
+ const item = value[i];
1301
+ const minMax = org.nativescript.mason.masonkit.MinMax.fromTypeValue(item.min_type, item.min_value, item.max_type, item.max_value);
1302
+ array[i] = minMax;
1303
+ }
1304
+ const nodeOrView = getMasonInstance(instance);
1305
+ org.nativescript.mason.masonkit.NodeHelper.INSTANCE.setGridAutoColumns(nodeOrView, array);
1306
+ }
1307
+ if (__APPLE__) {
1308
+ const length = value.length;
1309
+ const array = NSMutableArray.arrayWithCapacity(length);
1310
+ for (let i = 0; i < length; i++) {
1311
+ const item = value[i];
1312
+ const minMax = MinMax.fromTypeValue(item.min_type, item.min_value, item.max_type, item.max_value);
1313
+ array.addObject(minMax);
1314
+ }
1315
+ instance.ios.gridAutoColumns = array;
3866
1316
  }
3867
1317
  }
3868
1318
  //# sourceMappingURL=helpers.js.map