@nstudio/nativescript-compiler 9.2.0-alpha.17 → 9.2.0-alpha.19

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 (207) hide show
  1. package/README.md +3 -0
  2. package/config.js +1 -0
  3. package/dist/kotlin/access.js +8 -7
  4. package/dist/kotlin/arguments.js +6 -0
  5. package/dist/kotlin/assignment.js +22 -13
  6. package/dist/kotlin/builtins.js +67 -0
  7. package/dist/kotlin/calls.js +3 -2
  8. package/dist/kotlin/class-declaration.js +4 -9
  9. package/dist/kotlin/class-methods.js +2 -2
  10. package/dist/kotlin/core-api.js +1 -1
  11. package/dist/kotlin/declarations.js +1 -1
  12. package/dist/kotlin/expression-statements.js +13 -1
  13. package/dist/kotlin/functions.js +1 -0
  14. package/dist/kotlin/literals.js +4 -8
  15. package/dist/kotlin/names.js +4 -4
  16. package/dist/kotlin/native/api.js +1 -1
  17. package/dist/kotlin/operators.js +25 -25
  18. package/dist/kotlin/optional-chains.js +1 -1
  19. package/dist/kotlin/overrides.js +3 -3
  20. package/dist/kotlin/state-backend.js +6 -2
  21. package/dist/kotlin/translator.js +1 -1
  22. package/dist/kotlin/types.js +4 -4
  23. package/dist/semantics/classes.js +15 -0
  24. package/dist/semantics/conversion.js +9 -1
  25. package/dist/semantics/facts.js +1 -1
  26. package/dist/semantics/lang.js +10 -0
  27. package/dist/semantics/lower.js +54 -0
  28. package/dist/semantics/lowering-methods.js +5 -0
  29. package/dist/semantics/placement.js +9 -3
  30. package/dist/semantics/runtime.js +1 -0
  31. package/dist/semantics/signals.js +11 -0
  32. package/dist/semantics/states/missing.js +7 -0
  33. package/dist/semantics/tdz.js +54 -15
  34. package/dist/semantics/throws.js +2 -2
  35. package/dist/semantics/translator-methods.js +1 -1
  36. package/dist/swift/access.js +7 -9
  37. package/dist/swift/arguments.js +14 -9
  38. package/dist/swift/assignment.js +26 -15
  39. package/dist/swift/calls.js +13 -5
  40. package/dist/swift/class-methods.js +2 -1
  41. package/dist/swift/classes.js +7 -9
  42. package/dist/swift/components.js +3 -3
  43. package/dist/swift/control-flow.js +1 -1
  44. package/dist/swift/conversion.js +5 -2
  45. package/dist/swift/core-api.js +2 -2
  46. package/dist/swift/declarations.js +1 -1
  47. package/dist/swift/expressions.js +6 -2
  48. package/dist/swift/from-any.js +1 -1
  49. package/dist/swift/functions.js +5 -6
  50. package/dist/swift/global-calls.js +1 -1
  51. package/dist/swift/lenient.js +1 -6
  52. package/dist/swift/library.js +2 -2
  53. package/dist/swift/literals.js +8 -3
  54. package/dist/swift/method-values.js +2 -1
  55. package/dist/swift/modules.js +3 -3
  56. package/dist/swift/names.js +7 -7
  57. package/dist/swift/native/calls.js +10 -4
  58. package/dist/swift/object-classes.js +84 -1
  59. package/dist/swift/operators.js +31 -29
  60. package/dist/swift/placement.js +22 -6
  61. package/dist/swift/state-backend.js +3 -2
  62. package/dist/swift/static-calls.js +3 -4
  63. package/dist/swift/syntax.js +10 -6
  64. package/dist/swift/translator.js +1 -1
  65. package/dist/swift/type-facts.js +3 -3
  66. package/dist/swift/types.js +5 -5
  67. package/dist/targets/ios/build.js +1 -1
  68. package/kit-android/generated/kotlin/org/nativescript/kit/__Modules.kt +1 -0
  69. package/kit-android/generated/kotlin/org/nativescript/kit/__Objects.kt +525 -99
  70. package/kit-android/generated/kotlin/org/nativescript/kit/accessibility_accessibility_common.kt +2 -2
  71. package/kit-android/generated/kotlin/org/nativescript/kit/application_application_common.kt +29 -6
  72. package/kit-android/generated/kotlin/org/nativescript/kit/application_helpers_common.kt +14 -0
  73. package/kit-android/generated/kotlin/org/nativescript/kit/color_color_utils.kt +3 -3
  74. package/kit-android/generated/kotlin/org/nativescript/kit/css_mediaquery_index.kt +49 -1
  75. package/kit-android/generated/kotlin/org/nativescript/kit/data_observable_array_index.kt +0 -8
  76. package/kit-android/generated/kotlin/org/nativescript/kit/data_observable_index.kt +0 -16
  77. package/kit-android/generated/kotlin/org/nativescript/kit/data_virtual_array_index.kt +6 -4
  78. package/kit-android/generated/kotlin/org/nativescript/kit/http_http_request_index.kt +19 -7
  79. package/kit-android/generated/kotlin/org/nativescript/kit/http_http_request_internal_http_request_internal_common.kt +14 -0
  80. package/kit-android/generated/kotlin/org/nativescript/kit/http_http_request_internal_index.kt +19 -10
  81. package/kit-android/generated/kotlin/org/nativescript/kit/matrix_index.kt +17 -29
  82. package/kit-android/generated/kotlin/org/nativescript/kit/media_query_list_index.kt +144 -22
  83. package/kit-android/generated/kotlin/org/nativescript/kit/npm_css_what_src_parse.kt +8 -3
  84. package/kit-android/generated/kotlin/org/nativescript/kit/org.nativescript.NativeScriptLifecycleCallbacks.kt +2 -10
  85. package/kit-android/generated/kotlin/org/nativescript/kit/ui_builder_index.kt +0 -2
  86. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_bindable_expression_parser.kt +6 -10
  87. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_properties_index.kt +531 -8
  88. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_view_base_index.kt +0 -9
  89. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_weak_event_listener_index.kt +3 -3
  90. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_style_index.kt +19 -0
  91. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_style_properties.kt +5 -2
  92. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_style_scope.kt +232 -174
  93. package/kit-android/generated/kotlin/org/nativescript/kit/ui_text_view_text_view_common.kt +1 -1
  94. package/kit-android/generated/kotlin/org/nativescript/kit/utils_android_runtime_version.kt +75 -0
  95. package/kit-android/generated/manifest.json +21 -18
  96. package/kit-android/generated/source-lines.json +1 -1
  97. package/kit-android/src/fromcore/kotlin/org/nativescript/kit/NativeScriptApplication.kt +9 -0
  98. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Array.kt +497 -42
  99. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Intl.kt +1 -1
  100. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/JSON.kt +22 -2
  101. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Strings.kt +32 -18
  102. package/kit-apple/Overlays/xml-free/Core/ui.builder.index.swift +7 -3
  103. package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity1.swift +14 -10
  104. package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity2.swift +3 -9
  105. package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity3Plus.swift +20 -21
  106. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_index_section_view_ios_android.swift +5 -7
  107. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_ios_android_.swift +130 -0
  108. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_oldIndex_newIndex.swift +2 -4
  109. package/kit-apple/Sources/NativeScriptKit/Core/Object_specified_substituted_reads.swift +115 -0
  110. package/kit-apple/Sources/NativeScriptKit/Core/Object_substituted_values_reads.swift +113 -0
  111. package/kit-apple/Sources/NativeScriptKit/Core/Object_substituted_values_reads_.swift +113 -0
  112. package/kit-apple/Sources/NativeScriptKit/Core/application.application-common.swift +348 -330
  113. package/kit-apple/Sources/NativeScriptKit/Core/application.application.ios.swift +358 -359
  114. package/kit-apple/Sources/NativeScriptKit/Core/application.helpers-common.swift +47 -29
  115. package/kit-apple/Sources/NativeScriptKit/Core/connectivity.index.ios.swift +3 -1
  116. package/kit-apple/Sources/NativeScriptKit/Core/css-mediaquery.index.swift +95 -53
  117. package/kit-apple/Sources/NativeScriptKit/Core/css.CSS3Parser.swift +1 -1
  118. package/kit-apple/Sources/NativeScriptKit/Core/css.parser.swift +1 -1
  119. package/kit-apple/Sources/NativeScriptKit/Core/data.observable-array.index.swift +3 -3
  120. package/kit-apple/Sources/NativeScriptKit/Core/file-system.file-system-access.ios.swift +58 -49
  121. package/kit-apple/Sources/NativeScriptKit/Core/file-system.index.swift +10 -10
  122. package/kit-apple/Sources/NativeScriptKit/Core/http.http-request-internal.http-request-internal-common.swift +18 -0
  123. package/kit-apple/Sources/NativeScriptKit/Core/http.http-request-internal.index.ios.swift +67 -52
  124. package/kit-apple/Sources/NativeScriptKit/Core/http.index.swift +3 -3
  125. package/kit-apple/Sources/NativeScriptKit/Core/image-source.index.ios.swift +69 -53
  126. package/kit-apple/Sources/NativeScriptKit/Core/js-libs.easysax.easysax.swift +4 -22
  127. package/kit-apple/Sources/NativeScriptKit/Core/kit-index.json +144 -32
  128. package/kit-apple/Sources/NativeScriptKit/Core/manifest.json +30 -19
  129. package/kit-apple/Sources/NativeScriptKit/Core/media-query-list.index.swift +190 -78
  130. package/kit-apple/Sources/NativeScriptKit/Core/native-window.native-window.ios.swift +1 -1
  131. package/kit-apple/Sources/NativeScriptKit/Core/npm.css-what.src.parse.swift +205 -201
  132. package/kit-apple/Sources/NativeScriptKit/Core/npm.css-what.src.stringify.swift +41 -42
  133. package/kit-apple/Sources/NativeScriptKit/Core/npm.css-what.src.types.swift +1 -1
  134. package/kit-apple/Sources/NativeScriptKit/Core/trace.index.swift +2 -2
  135. package/kit-apple/Sources/NativeScriptKit/Core/ui.action-bar.index.ios.swift +33 -21
  136. package/kit-apple/Sources/NativeScriptKit/Core/ui.activity-indicator.index.ios.swift +12 -6
  137. package/kit-apple/Sources/NativeScriptKit/Core/ui.animation.index.ios.swift +77 -65
  138. package/kit-apple/Sources/NativeScriptKit/Core/ui.animation.keyframe-animation.swift +1 -1
  139. package/kit-apple/Sources/NativeScriptKit/Core/ui.builder.index.swift +10 -6
  140. package/kit-apple/Sources/NativeScriptKit/Core/ui.button.index.ios.swift +14 -13
  141. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.properties.index.swift +1273 -824
  142. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view-base.index.swift +2 -2
  143. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view.index.ios.swift +87 -67
  144. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view.view-common.swift +1 -1
  145. package/kit-apple/Sources/NativeScriptKit/Core/ui.date-picker.index.ios.swift +17 -16
  146. package/kit-apple/Sources/NativeScriptKit/Core/ui.dialogs.index.ios.swift +2 -2
  147. package/kit-apple/Sources/NativeScriptKit/Core/ui.editable-text-base.index.ios.swift +27 -18
  148. package/kit-apple/Sources/NativeScriptKit/Core/ui.frame.frame-common.swift +2 -1
  149. package/kit-apple/Sources/NativeScriptKit/Core/ui.frame.index.ios.swift +6 -6
  150. package/kit-apple/Sources/NativeScriptKit/Core/ui.html-view.index.ios.swift +9 -9
  151. package/kit-apple/Sources/NativeScriptKit/Core/ui.image.index.ios.swift +6 -6
  152. package/kit-apple/Sources/NativeScriptKit/Core/ui.label.index.ios.swift +8 -8
  153. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.flexbox-layout.index.ios.swift +22 -21
  154. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.layout-base.ios.swift +4 -3
  155. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.liquid-glass-container.index.ios.swift +1 -1
  156. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.liquid-glass.index.ios.swift +1 -1
  157. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.root-layout.index.ios.swift +2 -2
  158. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.root-layout.root-layout-common.swift +9 -9
  159. package/kit-apple/Sources/NativeScriptKit/Core/ui.list-picker.index.ios.swift +9 -6
  160. package/kit-apple/Sources/NativeScriptKit/Core/ui.list-view.index.ios.swift +38 -20
  161. package/kit-apple/Sources/NativeScriptKit/Core/ui.page.index.ios.swift +204 -190
  162. package/kit-apple/Sources/NativeScriptKit/Core/ui.progress.index.ios.swift +12 -10
  163. package/kit-apple/Sources/NativeScriptKit/Core/ui.repeater.index.swift +2 -6
  164. package/kit-apple/Sources/NativeScriptKit/Core/ui.scroll-view.index.ios.swift +18 -9
  165. package/kit-apple/Sources/NativeScriptKit/Core/ui.search-bar.index.ios.swift +28 -18
  166. package/kit-apple/Sources/NativeScriptKit/Core/ui.segmented-bar.index.ios.swift +19 -12
  167. package/kit-apple/Sources/NativeScriptKit/Core/ui.slider.index.ios.swift +14 -12
  168. package/kit-apple/Sources/NativeScriptKit/Core/ui.split-view.index.ios.swift +17 -12
  169. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.background.ios.swift +2 -2
  170. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.clip-path-function.swift +1 -1
  171. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.css-animation-parser.swift +1 -1
  172. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.css-selector.swift +2 -2
  173. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.font-common.swift +2 -2
  174. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.style-scope.swift +869 -838
  175. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.style.index.swift +46 -31
  176. package/kit-apple/Sources/NativeScriptKit/Core/ui.switch.index.ios.swift +12 -10
  177. package/kit-apple/Sources/NativeScriptKit/Core/ui.tab-view.index.ios.swift +36 -20
  178. package/kit-apple/Sources/NativeScriptKit/Core/ui.text-base.formatted-string.swift +3 -4
  179. package/kit-apple/Sources/NativeScriptKit/Core/ui.text-base.index.ios.swift +25 -22
  180. package/kit-apple/Sources/NativeScriptKit/Core/ui.text-base.text-base-common.swift +2 -3
  181. package/kit-apple/Sources/NativeScriptKit/Core/ui.text-field.index.ios.swift +21 -14
  182. package/kit-apple/Sources/NativeScriptKit/Core/ui.text-view.index.ios.swift +33 -21
  183. package/kit-apple/Sources/NativeScriptKit/Core/ui.text-view.text-view-common.swift +1 -1
  184. package/kit-apple/Sources/NativeScriptKit/Core/ui.time-picker.index.ios.swift +22 -18
  185. package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.index.ios.swift +2 -2
  186. package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.modal-transition.ios.swift +4 -4
  187. package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.page-transition.ios.swift +2 -2
  188. package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.shared-transition-helper.ios.swift +32 -32
  189. package/kit-apple/Sources/NativeScriptKit/Core/ui.web-view.index.ios.swift +1 -1
  190. package/kit-apple/Sources/NativeScriptKit/Core/ui.web-view.web-view-common.swift +2 -2
  191. package/kit-apple/Sources/NativeScriptKit/Core/utils.android-runtime-version.swift +77 -0
  192. package/kit-apple/Sources/NativeScriptKit/Core/utils.debug-source.swift +2 -2
  193. package/kit-apple/Sources/NativeScriptKit/Core/utils.index.ios.swift +2 -2
  194. package/kit-apple/Sources/NativeScriptKit/Core/xhr.index.swift +62 -61
  195. package/kit-apple/Sources/NativeScriptKit/Runtime/Array.swift +4 -0
  196. package/kit-apple/Sources/NativeScriptKit/Runtime/Dynamic.swift +2 -0
  197. package/kit-apple/Sources/NativeScriptKit/Runtime/Interop.swift +1 -1
  198. package/kit-apple/Sources/NativeScriptKit/Runtime/Intl.swift +1 -1
  199. package/kit-apple/Sources/NativeScriptKit/Runtime/Iterators.swift +1 -1
  200. package/kit-apple/Sources/NativeScriptKit/Runtime/JSON.swift +280 -9
  201. package/kit-apple/Sources/NativeScriptKit/Runtime/Lowering.swift +3 -2
  202. package/kit-apple/Sources/NativeScriptKit/Runtime/Native.swift +2 -1
  203. package/kit-apple/Sources/NativeScriptKit/Runtime/Prototypes.swift +1 -0
  204. package/kit-apple/Sources/NativeScriptKit/Runtime/Symbol.swift +1 -0
  205. package/kit-apple/Sources/NativeScriptKit/Runtime/Values.swift +1 -0
  206. package/kit-apple/Sources/NativeScriptKit/Runtime/Views.swift +2 -0
  207. package/package.json +6 -4
@@ -765,6 +765,19 @@ open class Style : Observable, JSStringConvertible {
765
765
  jsMadeNote1(1L shl 58, "_localValueVersion")
766
766
  }
767
767
 
768
+ /**
769
+ * Local values specified with var()/calc(), by css name, with the variables their last
770
+ * substitution read and what it produced. The cascade substitutes them again when those
771
+ * variables change.
772
+ */
773
+ @get:JvmName("__get__localCssExpressions")
774
+ @set:JvmName("__set__localCssExpressions")
775
+ var _localCssExpressions: JSMap<String, Any?>? = null
776
+ set(value) {
777
+ field = value
778
+ jsMadeNote1(1L shl 59, "_localCssExpressions")
779
+ }
780
+
768
781
  constructor(ownerView: Any?) : super() {
769
782
  if (
770
783
  jsIndexOf(
@@ -1000,6 +1013,8 @@ open class Style : Observable, JSStringConvertible {
1000
1013
  (if ((jsMadeBits1 and (1L shl 56)) != 0L) listOf("PropertyBag") else listOf()) +
1001
1014
  (if ((jsMadeBits1 and (1L shl 57)) != 0L) listOf("viewRef") else listOf()) +
1002
1015
  (if ((jsMadeBits1 and (1L shl 58)) != 0L) listOf("_localValueVersion")
1016
+ else listOf()) +
1017
+ (if ((jsMadeBits1 and (1L shl 59)) != 0L) listOf("_localCssExpressions")
1003
1018
  else listOf())
1004
1019
 
1005
1020
  override val jsClassName: String?
@@ -1132,6 +1147,8 @@ open class Style : Observable, JSStringConvertible {
1132
1147
  "PropertyBag" -> this.PropertyBag
1133
1148
  "viewRef" -> if ((jsMadeBits1 and (1L shl 57)) != 0L) this.viewRef else null
1134
1149
  "_localValueVersion" -> this._localValueVersion
1150
+ "_localCssExpressions" ->
1151
+ if ((jsMadeBits1 and (1L shl 59)) != 0L) this._localCssExpressions else null
1135
1152
  "view" -> this.view
1136
1153
  "setScopedCssVariable" ->
1137
1154
  jsFunction { __a ->
@@ -1309,6 +1326,8 @@ open class Style : Observable, JSStringConvertible {
1309
1326
  "viewRef" -> this.viewRef = jsAs<JSWeakRef<ViewBase>?>(jsJavaArgument(value))
1310
1327
  "_localValueVersion" ->
1311
1328
  this._localValueVersion = jsConvertedNumberOrNull(value, "_localValueVersion")
1329
+ "_localCssExpressions" ->
1330
+ this._localCssExpressions = jsAs<JSMap<String, Any?>?>(jsJavaArgument(value))
1312
1331
  else -> super.jsSet(key, value)
1313
1332
  }
1314
1333
  }
@@ -1959,7 +1959,8 @@ object Core_ui_styling_style_properties {
1959
1959
  ?: jsCannotRead("get"))
1960
1960
  .get()
1961
1961
  if (jsTruthy(view)) {
1962
- (view ?: jsCannotSet("effectiveBorderBottomWidth"))
1962
+ (view
1963
+ ?: jsCannotSet("effectiveBorderBottomWidth"))
1963
1964
  .effectiveBorderBottomWidth = value
1964
1965
  } else {
1965
1966
  org.nativescript.kit.Trace.write(
@@ -2457,7 +2458,9 @@ object Core_ui_styling_style_properties {
2457
2458
  },
2458
2459
  )
2459
2460
  )
2460
- Core_ui_styling_style_properties.zIndexProperty.register(Style::class.java)
2461
+ Core_ui_styling_style_properties.zIndexProperty.register(
2462
+ Style::class.java
2463
+ )
2461
2464
  opacityProperty =
2462
2465
  CssAnimationProperty(
2463
2466
  jsObjectOf(
@@ -841,7 +841,7 @@ open class CssState : JSStringConvertible, JSExpando, JSKeysMade {
841
841
  continue
842
842
  }
843
843
  val value: Any? =
844
- Core_ui_styling_style_scope.evaluateCssExpressions(
844
+ Core_ui_core_properties_index._evaluateCssExpressions(
845
845
  view,
846
846
  property,
847
847
  (cssExpsProperties ?: jsCannotRead(property))[property],
@@ -883,7 +883,12 @@ open class CssState : JSStringConvertible, JSExpando, JSKeysMade {
883
883
  )
884
884
  if (!jsTruthy(resolved)) {
885
885
  resolved =
886
- Core_ui_styling_style_scope.resolvePendingSubstitution(view, pending)
886
+ jsRecordOrNull<Any?>(
887
+ jsGet(
888
+ Core_ui_core_properties_index._substituteCssShorthand(view, pending),
889
+ "values",
890
+ )
891
+ )
887
892
  (resolvedShorthands ?: jsCannotRead("set")).set(
888
893
  jsUnchecked<CssPendingSubstitution>(pending),
889
894
  jsUnchecked<JSRecord<Any?>>(resolved),
@@ -1013,6 +1018,14 @@ open class CssState : JSStringConvertible, JSExpando, JSKeysMade {
1013
1018
  this._appliedLocalValueVersion =
1014
1019
  (((view ?: jsCannotRead("style")).style ?: jsCannotRead("_localValueVersion"))
1015
1020
  ._localValueVersion ?: Double.NaN)
1021
+ if (
1022
+ jsTruthy(
1023
+ ((view ?: jsCannotRead("style")).style ?: jsCannotRead("_localCssExpressions"))
1024
+ ._localCssExpressions
1025
+ )
1026
+ ) {
1027
+ Core_ui_core_properties_index._reevaluateLocalCssExpressions(view)
1028
+ }
1016
1029
  }
1017
1030
 
1018
1031
  open fun subscribeForDynamicUpdates() {
@@ -1839,7 +1852,12 @@ open class StyleScope : JSExpando, JSKeysMade {
1839
1852
  @UiThread
1840
1853
  object Core_ui_styling_style_scope {
1841
1854
  init {
1842
- jsLexical("animationsSymbol", "animationVariablesSymbol", "keyframeVariablesSymbol")
1855
+ jsLexical(
1856
+ "animationsSymbol",
1857
+ "animationVariablesSymbol",
1858
+ "keyframeVariablesSymbol",
1859
+ "inlineStyleProperties",
1860
+ )
1843
1861
  }
1844
1862
 
1845
1863
  @JvmField var parser: String = "css-tree"
@@ -1946,80 +1964,9 @@ object Core_ui_styling_style_scope {
1946
1964
  }
1947
1965
  @JvmField var pattern: JSRegExp? = null
1948
1966
 
1949
- /**
1950
- * Parse a pending-substitution shorthand once its expression has been evaluated against the
1951
- * view; a value that does not survive evaluation leaves its longhands unset.
1952
- */
1953
- fun resolvePendingSubstitution(
1954
- view: ViewBase?,
1955
- pending: CssPendingSubstitution?,
1956
- ): JSRecord<Any?>? {
1957
- val value: Any? =
1958
- Core_ui_styling_style_scope.evaluateCssExpressions(
1959
- view,
1960
- (pending ?: jsCannotRead("shorthand")).shorthand,
1961
- (pending ?: jsCannotRead("value")).value,
1962
- )
1963
- if (
1964
- jsStrictEquals(value, Core_ui_core_properties_property_shared.unsetValue)
1965
- ) {
1966
- return CssState.emptyPropertyBag
1967
- }
1968
- val expanded: JSArray<Pair<String, Any?>>? =
1969
- Core_ui_core_properties_index._expandCssShorthand(
1970
- (pending ?: jsCannotRead("shorthand")).shorthand,
1971
- jsConvertedStringOrNull(value),
1972
- )
1973
- if (!jsTruthy(expanded)) {
1974
- org.nativescript.kit.Trace.write(
1975
- "Failed to expand shorthand [${jsToString(((pending ?: jsCannotRead("shorthand")).shorthand ?: "undefined"))}] resolved to [${jsToStringThrowing(value)}] for ${jsToStringThrowing(view)}.",
1976
- org.nativescript.kit.Trace.categories.Style,
1977
- org.nativescript.kit.Trace.messageType.warn,
1978
- )
1979
- return CssState.emptyPropertyBag
1980
- }
1981
- val resolved: JSRecord<Any?> =
1982
- (jsAsOrNull<JSRecord<Any?>>(JSRecord<Any?>()) ?: JSRecord<Any?>())
1983
- var i: Double = 0.0
1984
- val length: Double = (expanded ?: jsCannotRead("length")).length
1985
- while (i < length) {
1986
- resolved[
1987
- ((expanded ?: jsCannotRead(js(i))).element(i) ?: jsCannotRead("0")).first] =
1988
- ((expanded ?: jsCannotRead(js(i))).element(i) ?: jsCannotRead("1")).second
1989
- i += 1.0
1990
- }
1991
- return resolved
1992
- }
1993
-
1994
- /** Evaluate css-variable and css-calc expressions */
1995
- fun evaluateCssExpressions(view: ViewBase?, property: String?, value: String?): Any? {
1996
- var value = value
1997
- val newValue: String =
1998
- Core_ui_core_properties_index._evaluateCssVariableExpression(view, property, value)
1999
- if (newValue == "unset") {
2000
- return Core_ui_core_properties_property_shared.unsetValue
2001
- }
2002
- value = newValue
2003
- try {
2004
- value =
2005
- jsConvertedStringOrNull(
2006
- Core_ui_core_properties_index._evaluateCssCalcExpression(value)
2007
- )
2008
- } catch (__e_1: Throwable) {
2009
- val e: Any? = jsCaught(__e_1)
2010
- org.nativescript.kit.Trace.write(
2011
- "Failed to evaluate css-calc for property [${jsToString((property ?: "undefined"))}] for expression [${jsToString((value ?: "undefined"))}] to ${jsToStringThrowing(view)}. ${jsToStringThrowing(jsGet(e, "stack"))}",
2012
- org.nativescript.kit.Trace.categories.Error,
2013
- org.nativescript.kit.Trace.messageType.error,
2014
- )
2015
- return Core_ui_core_properties_property_shared.unsetValue
2016
- }
2017
- return value
2018
- }
2019
-
2020
1967
  fun evaluateCssVariable(view: ViewBase?, name: String?, value: String?): String? {
2021
1968
  val evaluated: Any? =
2022
- Core_ui_styling_style_scope.evaluateCssExpressions(view, name, value)
1969
+ Core_ui_core_properties_index._evaluateCssExpressions(view, name, value)
2023
1970
  return (if (
2024
1971
  jsStrictEquals(evaluated, Core_ui_core_properties_property_shared.unsetValue)
2025
1972
  )
@@ -2341,6 +2288,18 @@ object Core_ui_styling_style_scope {
2341
2288
  )
2342
2289
  (keyframes ?: jsCannotRead("push")).push(keyframeRule)
2343
2290
  } else if (Core_ui_styling_style_scope.isMedia(node)) {
2291
+ if (
2292
+ !Core_css_mediaquery_index.isEvaluableMediaQuery(
2293
+ jsConvertedStringOrNull(jsGet(node, "media"))
2294
+ )
2295
+ ) {
2296
+ org.nativescript.kit.Trace.write(
2297
+ "Dropping '@media ${jsToStringThrowing(jsGet(node, "media"))}': the runtime cannot evaluate it",
2298
+ org.nativescript.kit.Trace.categories.MediaQuery,
2299
+ org.nativescript.kit.Trace.messageType.warn,
2300
+ )
2301
+ continue
2302
+ }
2344
2303
  val compositeMediaQuery: Any?
2345
2304
  if (jsTruthy(mediaQueryString)) {
2346
2305
  if (jsTypeof(mediaQueryString) == "string") {
@@ -2679,6 +2638,45 @@ object Core_ui_styling_style_scope {
2679
2638
  )
2680
2639
  }
2681
2640
 
2641
+ @get:JvmName("__get_inlineStyleProperties")
2642
+ @set:JvmName("__set_inlineStyleProperties")
2643
+ lateinit var inlineStyleProperties: JSWeakMap<ViewBase, JSSet<String>>
2644
+
2645
+ fun setInlineValue(view: ViewBase?, property: String?, value: Any?) {
2646
+ if (
2647
+ jsHasKey((view ?: jsCannotRead("style")).style, jsToString((property ?: "undefined")))
2648
+ ) {
2649
+ jsSet(
2650
+ ((view ?: jsCannotRead("style")).style ?: jsObjectRequired()),
2651
+ jsToString((property ?: "undefined")),
2652
+ value,
2653
+ )
2654
+ } else {
2655
+ jsSet(
2656
+ (view ?: jsObjectRequired()),
2657
+ jsToString((property ?: "undefined")),
2658
+ value,
2659
+ )
2660
+ }
2661
+ }
2662
+
2663
+ fun unsetInlineValue(view: ViewBase?, property: String?) {
2664
+ try {
2665
+ Core_ui_styling_style_scope.setInlineValue(
2666
+ view,
2667
+ property,
2668
+ Core_ui_core_properties_property_shared.unsetValue,
2669
+ )
2670
+ } catch (__e_1: Throwable) {
2671
+ val e: Any? = jsCaught(__e_1)
2672
+ org.nativescript.kit.Trace.write(
2673
+ "Failed to unset property [${jsToString((property ?: "undefined"))}] on ${jsToStringThrowing(view)}. ${jsToStringThrowing(e)}",
2674
+ org.nativescript.kit.Trace.categories.Error,
2675
+ org.nativescript.kit.Trace.messageType.error,
2676
+ )
2677
+ }
2678
+ }
2679
+
2682
2680
  @JvmField var applyInlineStyle: Any? = null
2683
2681
 
2684
2682
  fun isCurrentDirectory(uriPart: String?): Boolean {
@@ -2889,6 +2887,7 @@ object Core_ui_styling_style_scope {
2889
2887
  "_appliedAnimations",
2890
2888
  CssState.emptyAnimationArray,
2891
2889
  )
2890
+ inlineStyleProperties = JSWeakMap<ViewBase, JSSet<String>>()
2892
2891
  applyInlineStyle =
2893
2892
  Core_profiling_index.profile(
2894
2893
  "applyInlineStyle",
@@ -2898,128 +2897,187 @@ object Core_ui_styling_style_scope {
2898
2897
  val inlineRuleSet: JSArray<RuleSet>? =
2899
2898
  (CSSSource.fromSource(localStyle) ?: jsCannotRead("selectors"))
2900
2899
  .selectors
2900
+ val declarations: JSArray<Any?>? =
2901
+ ((inlineRuleSet ?: jsCannotRead("0")).element(0.0)
2902
+ ?: jsCannotRead("declarations"))
2903
+ .declarations
2901
2904
  ((view ?: jsCannotRead("style")).style
2902
2905
  ?: jsCannotRead("resetUnscopedCssVariables"))
2903
2906
  .resetUnscopedCssVariables()
2904
- (((inlineRuleSet ?: jsCannotRead("0")).element(0.0)
2905
- ?: jsCannotRead("declarations"))
2906
- .declarations ?: jsCannotRead("forEach"))
2907
- .forEach({ d: Any? ->
2908
- val property: String? =
2909
- jsConvertedStringOrNull(jsGet(d, "property"))
2907
+ var declared: JSSet<String>? = null
2908
+ (declarations ?: jsCannotRead("forEach")).forEach({ d: Any? ->
2909
+ val property: String? =
2910
+ jsConvertedStringOrNull(jsGet(d, "property"))
2911
+ if (
2912
+ Core_ui_core_properties_index.isCssVariable(property)
2913
+ ) {
2914
+ ((view ?: jsCannotRead("style")).style
2915
+ ?: jsCannotRead("setUnscopedCssVariable"))
2916
+ .setUnscopedCssVariable(
2917
+ property,
2918
+ jsConvertedStringOrNull(jsGet(d, "value")),
2919
+ )
2920
+ } else {
2921
+ if (!jsTruthy(declared)) {
2922
+ declared = JSSet<String>()
2923
+ }
2924
+ (declared ?: jsCannotRead("add")).add(
2925
+ (property ?: "undefined")
2926
+ )
2927
+ }
2928
+ })
2929
+ val previous: JSSet<String>? =
2930
+ Core_ui_styling_style_scope.inlineStyleProperties.get(
2931
+ (view ?: jsObjectRequired())
2932
+ )
2933
+ if (jsTruthy(previous)) {
2934
+ (previous ?: jsCannotRead("forEach")).forEach({
2935
+ property: Any?,
2936
+ _: String? ->
2910
2937
  if (
2911
- Core_ui_core_properties_index.isCssVariable(property)
2938
+ !jsTruthy(declared?.has(jsConvertedStringOrEmpty(property)))
2912
2939
  ) {
2913
- ((view ?: jsCannotRead("style")).style
2914
- ?: jsCannotRead("setUnscopedCssVariable"))
2915
- .setUnscopedCssVariable(
2916
- property,
2917
- jsConvertedStringOrNull(jsGet(d, "value")),
2918
- )
2940
+ Core_ui_styling_style_scope.unsetInlineValue(
2941
+ view,
2942
+ jsConvertedStringOrNull(property),
2943
+ )
2919
2944
  }
2920
2945
  })
2921
- var resolvedShorthands:
2922
- JSMap<CssPendingSubstitution, JSRecord<Any?>>? =
2946
+ }
2947
+ if (jsTruthy(declared)) {
2948
+ Core_ui_styling_style_scope.inlineStyleProperties.set(
2949
+ jsUnchecked<ViewBase>(view),
2950
+ jsUnchecked<JSSet<String>>(declared),
2951
+ )
2952
+ } else if (jsTruthy(previous)) {
2953
+ Core_ui_styling_style_scope.inlineStyleProperties.delete(
2954
+ jsUnchecked<ViewBase>(view)
2955
+ )
2956
+ }
2957
+ var resolvedShorthands: JSMap<CssPendingSubstitution, Any?>? =
2923
2958
  null
2924
- (((inlineRuleSet ?: jsCannotRead("0")).element(0.0)
2925
- ?: jsCannotRead("declarations"))
2926
- .declarations ?: jsCannotRead("forEach"))
2927
- .forEach(
2928
- fn10@{ d: Any? ->
2929
- val property: String? =
2930
- jsConvertedStringOrNull(jsGet(d, "property"))
2931
- try {
2932
- if (
2933
- Core_ui_core_properties_index.isCssVariable(property)
2934
- ) {
2935
- return@fn10
2959
+ var applied: JSSet<String>? = null
2960
+ (declarations ?: jsCannotRead("forEach")).forEach(
2961
+ fn11@{ d: Any? ->
2962
+ val property: String? =
2963
+ jsConvertedStringOrNull(jsGet(d, "property"))
2964
+ try {
2965
+ if (
2966
+ Core_ui_core_properties_index.isCssVariable(property)
2967
+ ) {
2968
+ return@fn11
2969
+ }
2970
+ if (
2971
+ Core_ui_core_properties_index._isCssPendingSubstitution(
2972
+ jsGet(d, "value")
2973
+ )
2974
+ ) {
2975
+ if (!jsTruthy(resolvedShorthands)) {
2976
+ resolvedShorthands =
2977
+ JSMap<CssPendingSubstitution, Any?>()
2936
2978
  }
2937
- val value: Any?
2938
- if (
2939
- Core_ui_core_properties_index._isCssPendingSubstitution(
2940
- jsGet(d, "value")
2979
+ var resolved: Any? =
2980
+ (resolvedShorthands ?: jsCannotRead("get")).get(
2981
+ jsUnchecked<CssPendingSubstitution>(
2982
+ jsCast(
2983
+ jsGet(d, "value"),
2984
+ CssPendingSubstitution::class.java,
2985
+ )
2986
+ )
2941
2987
  )
2942
- ) {
2943
- if (!jsTruthy(resolvedShorthands)) {
2944
- resolvedShorthands =
2945
- JSMap<CssPendingSubstitution, JSRecord<Any?>>()
2946
- }
2947
- var resolved: JSRecord<Any?>? =
2948
- (resolvedShorthands ?: jsCannotRead("get")).get(
2949
- jsUnchecked<CssPendingSubstitution>(
2988
+ if (!jsTruthy(resolved)) {
2989
+ resolved =
2990
+ Core_ui_core_properties_index
2991
+ ._substituteCssShorthand(
2992
+ view,
2950
2993
  jsCast(
2951
2994
  jsGet(d, "value"),
2952
2995
  CssPendingSubstitution::class.java,
2953
- )
2954
- )
2955
- )
2956
- if (!jsTruthy(resolved)) {
2957
- resolved =
2958
- Core_ui_styling_style_scope
2959
- .resolvePendingSubstitution(
2960
- view,
2961
- jsCast(
2962
- jsGet(d, "value"),
2963
- CssPendingSubstitution::class.java,
2964
- ),
2965
- )
2966
- (resolvedShorthands
2967
- ?: jsCannotRead("set"))
2968
- .set(
2969
- jsUnchecked<CssPendingSubstitution>(
2970
- jsCast(
2971
- jsGet(d, "value"),
2972
- CssPendingSubstitution::class.java,
2973
- )
2974
2996
  ),
2975
- jsUnchecked<JSRecord<Any?>>(resolved),
2976
2997
  )
2977
- }
2978
- value =
2979
- (if (jsHasKey(resolved, jsToString(property)))
2980
- (resolved
2981
- ?: jsCannotRead(jsToString(property)))[
2982
- jsToString(property)]
2983
- else
2984
- Core_ui_core_properties_property_shared
2985
- .unsetValue)
2986
- } else {
2987
- value =
2988
- Core_ui_styling_style_scope.evaluateCssExpressions(
2989
- view,
2990
- property,
2991
- jsConvertedStringOrNull(jsGet(d, "value")),
2998
+ (resolvedShorthands
2999
+ ?: jsCannotRead("set"))
3000
+ .set(
3001
+ jsUnchecked<CssPendingSubstitution>(
3002
+ jsCast(
3003
+ jsGet(d, "value"),
3004
+ CssPendingSubstitution::class.java,
3005
+ )
3006
+ ),
3007
+ resolved,
2992
3008
  )
2993
3009
  }
2994
- if (
2995
- jsHasKey(
3010
+ Core_ui_core_properties_index
3011
+ ._setLocalCssShorthandValue(
2996
3012
  (view ?: jsCannotRead("style")).style,
2997
- jsToString(property),
2998
- )
2999
- ) {
3000
- jsSet(
3001
- ((view ?: jsCannotRead("style")).style
3002
- ?: jsObjectRequired()),
3003
- jsToString(property),
3004
- value,
3013
+ property,
3014
+ jsCast(
3015
+ jsGet(d, "value"),
3016
+ CssPendingSubstitution::class.java,
3017
+ ),
3018
+ resolved,
3005
3019
  )
3006
- } else {
3007
- jsSet(
3008
- (view ?: jsObjectRequired()),
3009
- jsToString(property),
3010
- value,
3011
- )
3012
- }
3013
- } catch (__e_2: Throwable) {
3014
- val e: Any? = jsCaught(__e_2)
3015
- org.nativescript.kit.Trace.write(
3016
- "Failed to apply property [${jsToString(jsConvertedStringOrNull(jsGet(d, "property")))}] with value [${jsToStringThrowing(jsGet(d, "value"))}] to ${jsToStringThrowing(view)}. ${jsToStringThrowing(e)}",
3017
- org.nativescript.kit.Trace.categories.Error,
3018
- org.nativescript.kit.Trace.messageType.error,
3020
+ } else if (
3021
+ jsHasKey(
3022
+ (view ?: jsCannotRead("style")).style,
3023
+ jsToString(property),
3024
+ )
3025
+ ) {
3026
+ jsSet(
3027
+ ((view ?: jsCannotRead("style")).style
3028
+ ?: jsObjectRequired()),
3029
+ jsToString(property),
3030
+ jsGet(d, "value"),
3031
+ )
3032
+ } else {
3033
+ jsSet(
3034
+ (view ?: jsObjectRequired()),
3035
+ jsToString(property),
3036
+ Core_ui_core_properties_index._evaluateCssExpressions(
3037
+ view,
3038
+ property,
3039
+ jsConvertedStringOrNull(jsGet(d, "value")),
3040
+ ),
3019
3041
  )
3020
3042
  }
3043
+ if (!jsTruthy(applied)) {
3044
+ applied = JSSet<String>()
3045
+ }
3046
+ (applied ?: jsCannotRead("add")).add(
3047
+ (property ?: "undefined")
3048
+ )
3049
+ } catch (__e_2: Throwable) {
3050
+ val e: Any? = jsCaught(__e_2)
3051
+ org.nativescript.kit.Trace.write(
3052
+ "Failed to apply property [${jsToString(jsConvertedStringOrNull(jsGet(d, "property")))}] with value [${jsToStringThrowing(jsGet(d, "value"))}] to ${jsToStringThrowing(view)}. ${jsToStringThrowing(e)}",
3053
+ org.nativescript.kit.Trace.categories.Error,
3054
+ org.nativescript.kit.Trace.messageType.error,
3055
+ )
3056
+ }
3057
+ }
3058
+ )
3059
+ declared?.forEach({ property: Any?, _: String? ->
3060
+ if (
3061
+ !jsTruthy(applied?.has(jsConvertedStringOrEmpty(property)))
3062
+ ) {
3063
+ (declared ?: jsCannotRead("delete")).delete(
3064
+ jsConvertedStringOrEmpty(property)
3065
+ )
3066
+ if (
3067
+ jsTruthy(previous?.has(jsConvertedStringOrEmpty(property)))
3068
+ ) {
3069
+ Core_ui_styling_style_scope.unsetInlineValue(
3070
+ view,
3071
+ jsConvertedStringOrNull(property),
3072
+ )
3021
3073
  }
3074
+ }
3075
+ })
3076
+ if (declared?.size == 0.0) {
3077
+ Core_ui_styling_style_scope.inlineStyleProperties.delete(
3078
+ jsUnchecked<ViewBase>(view)
3022
3079
  )
3080
+ }
3023
3081
  (view ?: jsCannotRead("_onCssStateChange"))
3024
3082
  ._onCssStateChange()
3025
3083
  },
@@ -128,7 +128,7 @@ object Core_ui_text_view_text_view_common {
128
128
  Property(
129
129
  jsObjectOf(
130
130
  "name" to "iosWritingToolsAllowedInput",
131
- "defaultValue" to jsArrayOf<Double>(WritingToolsAllowedInput.Default),
131
+ "defaultValue" to JSArray.doublesOf(WritingToolsAllowedInput.Default),
132
132
  )
133
133
  )
134
134
  Core_ui_text_view_text_view_common.iosWritingToolsAllowedInputProperty
@@ -0,0 +1,75 @@
1
+ // Generated from @nativescript/core by tools/kit: edit core, not this file.
2
+ package org.nativescript.kit
3
+
4
+ import androidx.annotation.AnyThread
5
+
6
+ @AnyThread
7
+ object Core_utils_android_runtime_version {
8
+ @JvmField var semverPattern: JSRegExp? = null
9
+
10
+ /**
11
+ * Whether a `major.minor.patch[-prerelease]` version string is at or above the given release.
12
+ * Prereleases of the release itself are lower than it, as in semver.
13
+ *
14
+ * @param version Version to test; anything that is not a parsable version string yields false.
15
+ * @returns True only for a parsable version at or above `major.minor.patch`.
16
+ */
17
+ fun isVersionAtLeast(version: Any?, major: Double, minor: Double, patch: Double): Boolean {
18
+ if (jsTypeof(version) != "string") {
19
+ return false
20
+ }
21
+ val match: JSMatch? =
22
+ (Core_utils_android_runtime_version.semverPattern ?: jsCannotRead("exec")).exec(
23
+ jsConvertedStringOrEmpty(version)
24
+ )
25
+ if (!jsTruthy(match)) {
26
+ return false
27
+ }
28
+ val parts: JSArray<Double> =
29
+ JSArray.doublesOf(
30
+ jsNumberFromString(((match ?: jsCannotRead("1")).get(1.0) ?: "undefined")),
31
+ jsNumberFromString(((match ?: jsCannotRead("2")).get(2.0) ?: "undefined")),
32
+ jsNumberFromString(((match ?: jsCannotRead("3")).get(3.0) ?: "undefined")),
33
+ )
34
+ val target: JSArray<Double> = JSArray.doublesOf(major, minor, patch)
35
+ var i: Double = 0.0
36
+ while (i < parts.length) {
37
+ if (parts.numberAt(i) != target.numberAt(i)) {
38
+ return parts.numberAt(i) > target.numberAt(i)
39
+ }
40
+ i += 1.0
41
+ }
42
+ return (match ?: jsObjectRequired()).get(4.0) == null
43
+ }
44
+
45
+ @JvmField var typedArrayToByteArray: Boolean? = null
46
+
47
+ /**
48
+ * Whether the Android runtime copies a typed array passed to a Java `byte[]` parameter. Older
49
+ * runtimes mis-pass it, so this is gated on the version rather than probed.
50
+ */
51
+ fun runtimeCopiesTypedArraysToByteArrays(): Boolean {
52
+ if (Core_utils_android_runtime_version.typedArrayToByteArray == null) {
53
+ Core_utils_android_runtime_version.typedArrayToByteArray =
54
+ Core_utils_android_runtime_version.isVersionAtLeast(
55
+ jsGet((jsGlobalThis), "__runtimeVersion"),
56
+ 9.0,
57
+ 1.0,
58
+ 2.0,
59
+ )
60
+ }
61
+ return (Core_utils_android_runtime_version.typedArrayToByteArray ?: false)
62
+ }
63
+
64
+ fun __init() {
65
+ try {
66
+ semverPattern =
67
+ jsRegExpLiteral(
68
+ "^(\\d+)\\.(\\d+)\\.(\\d+)(-[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?\$",
69
+ "",
70
+ )
71
+ } catch (__e: Throwable) {
72
+ jsReportThrown(__e)
73
+ }
74
+ }
75
+ }