@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.
- package/README.md +3 -0
- package/config.js +1 -0
- package/dist/kotlin/access.js +8 -7
- package/dist/kotlin/arguments.js +6 -0
- package/dist/kotlin/assignment.js +22 -13
- package/dist/kotlin/builtins.js +67 -0
- package/dist/kotlin/calls.js +3 -2
- package/dist/kotlin/class-declaration.js +4 -9
- package/dist/kotlin/class-methods.js +2 -2
- package/dist/kotlin/core-api.js +1 -1
- package/dist/kotlin/declarations.js +1 -1
- package/dist/kotlin/expression-statements.js +13 -1
- package/dist/kotlin/functions.js +1 -0
- package/dist/kotlin/literals.js +4 -8
- package/dist/kotlin/names.js +4 -4
- package/dist/kotlin/native/api.js +1 -1
- package/dist/kotlin/operators.js +25 -25
- package/dist/kotlin/optional-chains.js +1 -1
- package/dist/kotlin/overrides.js +3 -3
- package/dist/kotlin/state-backend.js +6 -2
- package/dist/kotlin/translator.js +1 -1
- package/dist/kotlin/types.js +4 -4
- package/dist/semantics/classes.js +15 -0
- package/dist/semantics/conversion.js +9 -1
- package/dist/semantics/facts.js +1 -1
- package/dist/semantics/lang.js +10 -0
- package/dist/semantics/lower.js +54 -0
- package/dist/semantics/lowering-methods.js +5 -0
- package/dist/semantics/placement.js +9 -3
- package/dist/semantics/runtime.js +1 -0
- package/dist/semantics/signals.js +11 -0
- package/dist/semantics/states/missing.js +7 -0
- package/dist/semantics/tdz.js +54 -15
- package/dist/semantics/throws.js +2 -2
- package/dist/semantics/translator-methods.js +1 -1
- package/dist/swift/access.js +7 -9
- package/dist/swift/arguments.js +14 -9
- package/dist/swift/assignment.js +26 -15
- package/dist/swift/calls.js +13 -5
- package/dist/swift/class-methods.js +2 -1
- package/dist/swift/classes.js +7 -9
- package/dist/swift/components.js +3 -3
- package/dist/swift/control-flow.js +1 -1
- package/dist/swift/conversion.js +5 -2
- package/dist/swift/core-api.js +2 -2
- package/dist/swift/declarations.js +1 -1
- package/dist/swift/expressions.js +6 -2
- package/dist/swift/from-any.js +1 -1
- package/dist/swift/functions.js +5 -6
- package/dist/swift/global-calls.js +1 -1
- package/dist/swift/lenient.js +1 -6
- package/dist/swift/library.js +2 -2
- package/dist/swift/literals.js +8 -3
- package/dist/swift/method-values.js +2 -1
- package/dist/swift/modules.js +3 -3
- package/dist/swift/names.js +7 -7
- package/dist/swift/native/calls.js +10 -4
- package/dist/swift/object-classes.js +84 -1
- package/dist/swift/operators.js +31 -29
- package/dist/swift/placement.js +22 -6
- package/dist/swift/state-backend.js +3 -2
- package/dist/swift/static-calls.js +3 -4
- package/dist/swift/syntax.js +10 -6
- package/dist/swift/translator.js +1 -1
- package/dist/swift/type-facts.js +3 -3
- package/dist/swift/types.js +5 -5
- package/dist/targets/ios/build.js +1 -1
- package/kit-android/generated/kotlin/org/nativescript/kit/__Modules.kt +1 -0
- package/kit-android/generated/kotlin/org/nativescript/kit/__Objects.kt +525 -99
- package/kit-android/generated/kotlin/org/nativescript/kit/accessibility_accessibility_common.kt +2 -2
- package/kit-android/generated/kotlin/org/nativescript/kit/application_application_common.kt +29 -6
- package/kit-android/generated/kotlin/org/nativescript/kit/application_helpers_common.kt +14 -0
- package/kit-android/generated/kotlin/org/nativescript/kit/color_color_utils.kt +3 -3
- package/kit-android/generated/kotlin/org/nativescript/kit/css_mediaquery_index.kt +49 -1
- package/kit-android/generated/kotlin/org/nativescript/kit/data_observable_array_index.kt +0 -8
- package/kit-android/generated/kotlin/org/nativescript/kit/data_observable_index.kt +0 -16
- package/kit-android/generated/kotlin/org/nativescript/kit/data_virtual_array_index.kt +6 -4
- package/kit-android/generated/kotlin/org/nativescript/kit/http_http_request_index.kt +19 -7
- package/kit-android/generated/kotlin/org/nativescript/kit/http_http_request_internal_http_request_internal_common.kt +14 -0
- package/kit-android/generated/kotlin/org/nativescript/kit/http_http_request_internal_index.kt +19 -10
- package/kit-android/generated/kotlin/org/nativescript/kit/matrix_index.kt +17 -29
- package/kit-android/generated/kotlin/org/nativescript/kit/media_query_list_index.kt +144 -22
- package/kit-android/generated/kotlin/org/nativescript/kit/npm_css_what_src_parse.kt +8 -3
- package/kit-android/generated/kotlin/org/nativescript/kit/org.nativescript.NativeScriptLifecycleCallbacks.kt +2 -10
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_builder_index.kt +0 -2
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_bindable_expression_parser.kt +6 -10
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_properties_index.kt +531 -8
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_view_base_index.kt +0 -9
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_weak_event_listener_index.kt +3 -3
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_style_index.kt +19 -0
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_style_properties.kt +5 -2
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_style_scope.kt +232 -174
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_text_view_text_view_common.kt +1 -1
- package/kit-android/generated/kotlin/org/nativescript/kit/utils_android_runtime_version.kt +75 -0
- package/kit-android/generated/manifest.json +21 -18
- package/kit-android/generated/source-lines.json +1 -1
- package/kit-android/src/fromcore/kotlin/org/nativescript/kit/NativeScriptApplication.kt +9 -0
- package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Array.kt +497 -42
- package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Intl.kt +1 -1
- package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/JSON.kt +22 -2
- package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Strings.kt +32 -18
- package/kit-apple/Overlays/xml-free/Core/ui.builder.index.swift +7 -3
- package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity1.swift +14 -10
- package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity2.swift +3 -9
- package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity3Plus.swift +20 -21
- package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_index_section_view_ios_android.swift +5 -7
- package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_ios_android_.swift +130 -0
- package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_oldIndex_newIndex.swift +2 -4
- package/kit-apple/Sources/NativeScriptKit/Core/Object_specified_substituted_reads.swift +115 -0
- package/kit-apple/Sources/NativeScriptKit/Core/Object_substituted_values_reads.swift +113 -0
- package/kit-apple/Sources/NativeScriptKit/Core/Object_substituted_values_reads_.swift +113 -0
- package/kit-apple/Sources/NativeScriptKit/Core/application.application-common.swift +348 -330
- package/kit-apple/Sources/NativeScriptKit/Core/application.application.ios.swift +358 -359
- package/kit-apple/Sources/NativeScriptKit/Core/application.helpers-common.swift +47 -29
- package/kit-apple/Sources/NativeScriptKit/Core/connectivity.index.ios.swift +3 -1
- package/kit-apple/Sources/NativeScriptKit/Core/css-mediaquery.index.swift +95 -53
- package/kit-apple/Sources/NativeScriptKit/Core/css.CSS3Parser.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Core/css.parser.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Core/data.observable-array.index.swift +3 -3
- package/kit-apple/Sources/NativeScriptKit/Core/file-system.file-system-access.ios.swift +58 -49
- package/kit-apple/Sources/NativeScriptKit/Core/file-system.index.swift +10 -10
- package/kit-apple/Sources/NativeScriptKit/Core/http.http-request-internal.http-request-internal-common.swift +18 -0
- package/kit-apple/Sources/NativeScriptKit/Core/http.http-request-internal.index.ios.swift +67 -52
- package/kit-apple/Sources/NativeScriptKit/Core/http.index.swift +3 -3
- package/kit-apple/Sources/NativeScriptKit/Core/image-source.index.ios.swift +69 -53
- package/kit-apple/Sources/NativeScriptKit/Core/js-libs.easysax.easysax.swift +4 -22
- package/kit-apple/Sources/NativeScriptKit/Core/kit-index.json +144 -32
- package/kit-apple/Sources/NativeScriptKit/Core/manifest.json +30 -19
- package/kit-apple/Sources/NativeScriptKit/Core/media-query-list.index.swift +190 -78
- package/kit-apple/Sources/NativeScriptKit/Core/native-window.native-window.ios.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Core/npm.css-what.src.parse.swift +205 -201
- package/kit-apple/Sources/NativeScriptKit/Core/npm.css-what.src.stringify.swift +41 -42
- package/kit-apple/Sources/NativeScriptKit/Core/npm.css-what.src.types.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Core/trace.index.swift +2 -2
- package/kit-apple/Sources/NativeScriptKit/Core/ui.action-bar.index.ios.swift +33 -21
- package/kit-apple/Sources/NativeScriptKit/Core/ui.activity-indicator.index.ios.swift +12 -6
- package/kit-apple/Sources/NativeScriptKit/Core/ui.animation.index.ios.swift +77 -65
- package/kit-apple/Sources/NativeScriptKit/Core/ui.animation.keyframe-animation.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Core/ui.builder.index.swift +10 -6
- package/kit-apple/Sources/NativeScriptKit/Core/ui.button.index.ios.swift +14 -13
- package/kit-apple/Sources/NativeScriptKit/Core/ui.core.properties.index.swift +1273 -824
- package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view-base.index.swift +2 -2
- package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view.index.ios.swift +87 -67
- package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view.view-common.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Core/ui.date-picker.index.ios.swift +17 -16
- package/kit-apple/Sources/NativeScriptKit/Core/ui.dialogs.index.ios.swift +2 -2
- package/kit-apple/Sources/NativeScriptKit/Core/ui.editable-text-base.index.ios.swift +27 -18
- package/kit-apple/Sources/NativeScriptKit/Core/ui.frame.frame-common.swift +2 -1
- package/kit-apple/Sources/NativeScriptKit/Core/ui.frame.index.ios.swift +6 -6
- package/kit-apple/Sources/NativeScriptKit/Core/ui.html-view.index.ios.swift +9 -9
- package/kit-apple/Sources/NativeScriptKit/Core/ui.image.index.ios.swift +6 -6
- package/kit-apple/Sources/NativeScriptKit/Core/ui.label.index.ios.swift +8 -8
- package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.flexbox-layout.index.ios.swift +22 -21
- package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.layout-base.ios.swift +4 -3
- package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.liquid-glass-container.index.ios.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.liquid-glass.index.ios.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.root-layout.index.ios.swift +2 -2
- package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.root-layout.root-layout-common.swift +9 -9
- package/kit-apple/Sources/NativeScriptKit/Core/ui.list-picker.index.ios.swift +9 -6
- package/kit-apple/Sources/NativeScriptKit/Core/ui.list-view.index.ios.swift +38 -20
- package/kit-apple/Sources/NativeScriptKit/Core/ui.page.index.ios.swift +204 -190
- package/kit-apple/Sources/NativeScriptKit/Core/ui.progress.index.ios.swift +12 -10
- package/kit-apple/Sources/NativeScriptKit/Core/ui.repeater.index.swift +2 -6
- package/kit-apple/Sources/NativeScriptKit/Core/ui.scroll-view.index.ios.swift +18 -9
- package/kit-apple/Sources/NativeScriptKit/Core/ui.search-bar.index.ios.swift +28 -18
- package/kit-apple/Sources/NativeScriptKit/Core/ui.segmented-bar.index.ios.swift +19 -12
- package/kit-apple/Sources/NativeScriptKit/Core/ui.slider.index.ios.swift +14 -12
- package/kit-apple/Sources/NativeScriptKit/Core/ui.split-view.index.ios.swift +17 -12
- package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.background.ios.swift +2 -2
- package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.clip-path-function.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.css-animation-parser.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.css-selector.swift +2 -2
- package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.font-common.swift +2 -2
- package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.style-scope.swift +869 -838
- package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.style.index.swift +46 -31
- package/kit-apple/Sources/NativeScriptKit/Core/ui.switch.index.ios.swift +12 -10
- package/kit-apple/Sources/NativeScriptKit/Core/ui.tab-view.index.ios.swift +36 -20
- package/kit-apple/Sources/NativeScriptKit/Core/ui.text-base.formatted-string.swift +3 -4
- package/kit-apple/Sources/NativeScriptKit/Core/ui.text-base.index.ios.swift +25 -22
- package/kit-apple/Sources/NativeScriptKit/Core/ui.text-base.text-base-common.swift +2 -3
- package/kit-apple/Sources/NativeScriptKit/Core/ui.text-field.index.ios.swift +21 -14
- package/kit-apple/Sources/NativeScriptKit/Core/ui.text-view.index.ios.swift +33 -21
- package/kit-apple/Sources/NativeScriptKit/Core/ui.text-view.text-view-common.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Core/ui.time-picker.index.ios.swift +22 -18
- package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.index.ios.swift +2 -2
- package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.modal-transition.ios.swift +4 -4
- package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.page-transition.ios.swift +2 -2
- package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.shared-transition-helper.ios.swift +32 -32
- package/kit-apple/Sources/NativeScriptKit/Core/ui.web-view.index.ios.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Core/ui.web-view.web-view-common.swift +2 -2
- package/kit-apple/Sources/NativeScriptKit/Core/utils.android-runtime-version.swift +77 -0
- package/kit-apple/Sources/NativeScriptKit/Core/utils.debug-source.swift +2 -2
- package/kit-apple/Sources/NativeScriptKit/Core/utils.index.ios.swift +2 -2
- package/kit-apple/Sources/NativeScriptKit/Core/xhr.index.swift +62 -61
- package/kit-apple/Sources/NativeScriptKit/Runtime/Array.swift +4 -0
- package/kit-apple/Sources/NativeScriptKit/Runtime/Dynamic.swift +2 -0
- package/kit-apple/Sources/NativeScriptKit/Runtime/Interop.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Runtime/Intl.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Runtime/Iterators.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Runtime/JSON.swift +280 -9
- package/kit-apple/Sources/NativeScriptKit/Runtime/Lowering.swift +3 -2
- package/kit-apple/Sources/NativeScriptKit/Runtime/Native.swift +2 -1
- package/kit-apple/Sources/NativeScriptKit/Runtime/Prototypes.swift +1 -0
- package/kit-apple/Sources/NativeScriptKit/Runtime/Symbol.swift +1 -0
- package/kit-apple/Sources/NativeScriptKit/Runtime/Values.swift +1 -0
- package/kit-apple/Sources/NativeScriptKit/Runtime/Views.swift +2 -0
- package/package.json +6 -4
|
@@ -1411,7 +1411,15 @@ open class CssProperty : JSExpando, JSKeysMade {
|
|
|
1411
1411
|
"enumerable" to true,
|
|
1412
1412
|
"configurable" to true,
|
|
1413
1413
|
"get" to JSMethod(0) { __self, _ -> get(__self) },
|
|
1414
|
-
"set" to
|
|
1414
|
+
"set" to
|
|
1415
|
+
Core_ui_core_properties_index.localCssExpressionSetter(
|
|
1416
|
+
kotlin.run {
|
|
1417
|
+
val __v_4 = jsConvertedStringOrNull(jsGet(options, "cssName"))
|
|
1418
|
+
if (jsTruthy(__v_4)) __v_4
|
|
1419
|
+
else ((propertyName ?: "undefined") ?: "undefined")
|
|
1420
|
+
},
|
|
1421
|
+
::setLocalValue,
|
|
1422
|
+
),
|
|
1415
1423
|
)
|
|
1416
1424
|
jsSet(Core_ui_core_properties_index.cssSymbolPropertyMap, key.key, this)
|
|
1417
1425
|
}
|
|
@@ -1665,8 +1673,8 @@ open class CssAnimationProperty : JSExpando, JSKeysMade {
|
|
|
1665
1673
|
val cssLocalName: String =
|
|
1666
1674
|
jsConvertedStringOrEmpty(
|
|
1667
1675
|
kotlin.run {
|
|
1668
|
-
val
|
|
1669
|
-
if (jsTruthy(
|
|
1676
|
+
val __v_5 = jsConvertedStringOrNull(jsGet(options, "cssName"))
|
|
1677
|
+
if (jsTruthy(__v_5)) __v_5 else ((propertyName ?: "undefined") ?: "undefined")
|
|
1670
1678
|
}
|
|
1671
1679
|
)
|
|
1672
1680
|
this.cssLocalName = cssLocalName
|
|
@@ -1925,6 +1933,18 @@ open class CssAnimationProperty : JSExpando, JSKeysMade {
|
|
|
1925
1933
|
descriptor(cssValue, ValueSource.Css, false, false, false)
|
|
1926
1934
|
val stylePropertyDescriptor: Any? =
|
|
1927
1935
|
descriptor(styleValue, ValueSource.Local, true, true, true)
|
|
1936
|
+
jsSet(
|
|
1937
|
+
stylePropertyDescriptor,
|
|
1938
|
+
"set",
|
|
1939
|
+
jsAs<(Style, Any?) -> Unit>(
|
|
1940
|
+
Core_ui_core_properties_index.localCssExpressionSetter(
|
|
1941
|
+
cssLocalName,
|
|
1942
|
+
jsFunction1<Any?, Unit>(jsGet(stylePropertyDescriptor, "set")).let { __f ->
|
|
1943
|
+
jsAdapt2<Any?, Any?, Unit>(__f) { __a0: Any?, __a1: Any? -> __f(__a0) }
|
|
1944
|
+
},
|
|
1945
|
+
)
|
|
1946
|
+
),
|
|
1947
|
+
)
|
|
1928
1948
|
val keyframePropertyDescriptor: Any? =
|
|
1929
1949
|
descriptor(keyframeValue, ValueSource.Keyframe, false, false, false)
|
|
1930
1950
|
jsSet(Core_ui_core_properties_index.symbolPropertyMap, computedValue.key, this)
|
|
@@ -2455,7 +2475,20 @@ open class InheritedCssProperty : CssProperty {
|
|
|
2455
2475
|
setInheritedFunc = jsCall(setFunc, ValueSource.Inherited)
|
|
2456
2476
|
this.setInheritedValue = setInheritedFunc
|
|
2457
2477
|
jsSet(this.cssValueDescriptor, "set", jsCall(setFunc, ValueSource.Css))
|
|
2458
|
-
jsSet(
|
|
2478
|
+
jsSet(
|
|
2479
|
+
this.localValueDescriptor,
|
|
2480
|
+
"set",
|
|
2481
|
+
Core_ui_core_properties_index.localCssExpressionSetter(
|
|
2482
|
+
kotlin.run {
|
|
2483
|
+
val __v_8 = jsConvertedStringOrNull(jsGet(options, "cssName"))
|
|
2484
|
+
if (jsTruthy(__v_8)) __v_8 else ((propertyName ?: "undefined") ?: "undefined")
|
|
2485
|
+
},
|
|
2486
|
+
kotlin.run {
|
|
2487
|
+
val __f = jsCall(setFunc, ValueSource.Local)
|
|
2488
|
+
jsAs<(Any?, Any?) -> Unit>(jsThisFunction(__f, 2))
|
|
2489
|
+
},
|
|
2490
|
+
),
|
|
2491
|
+
)
|
|
2459
2492
|
Core_ui_core_properties_index.inheritableCssProperties.push(this)
|
|
2460
2493
|
}
|
|
2461
2494
|
|
|
@@ -2548,7 +2581,9 @@ open class ShorthandProperty : JSExpando, JSKeysMade {
|
|
|
2548
2581
|
jsUnlessNullish(jsGet(options, "converter")) {
|
|
2549
2582
|
jsFunction1<Any?, JSArray<Pair<Any?, Any?>>>(it)
|
|
2550
2583
|
}
|
|
2584
|
+
val cssLocalName: String? = this.cssLocalName
|
|
2551
2585
|
fun setLocalValue(__this: Any?, value: Any?) {
|
|
2586
|
+
var value: Any? = value
|
|
2552
2587
|
val view: ViewBase? =
|
|
2553
2588
|
jsUnchecked<JSWeakRef<ViewBase>>(jsJavaArgument(jsGet(__this, "viewRef"))).get()
|
|
2554
2589
|
if (!jsTruthy(view)) {
|
|
@@ -2559,13 +2594,67 @@ open class ShorthandProperty : JSExpando, JSKeysMade {
|
|
|
2559
2594
|
)
|
|
2560
2595
|
return
|
|
2561
2596
|
}
|
|
2597
|
+
val pendingLonghands: JSArray<Pair<String, CssPendingSubstitution>>? =
|
|
2598
|
+
(if (Core_ui_core_properties_index.hasCssExpression(value))
|
|
2599
|
+
Core_ui_core_properties_index._pendingCssShorthandSubstitution(
|
|
2600
|
+
cssLocalName,
|
|
2601
|
+
jsConvertedString(value),
|
|
2602
|
+
)
|
|
2603
|
+
else null)
|
|
2604
|
+
if (jsTruthy(pendingLonghands)) {
|
|
2605
|
+
val pending: CssPendingSubstitution? =
|
|
2606
|
+
((pendingLonghands ?: jsCannotRead("0")).element(0.0) ?: jsCannotRead("1"))
|
|
2607
|
+
.second
|
|
2608
|
+
val shorthand: Any? =
|
|
2609
|
+
Core_ui_core_properties_index._substituteCssShorthand(view, pending)
|
|
2610
|
+
(view ?: jsCannotRead("_batchUpdate"))._batchUpdate({
|
|
2611
|
+
for (__item1 in (pendingLonghands ?: jsObjectRequired())) {
|
|
2612
|
+
val longhand: String? = __item1.first
|
|
2613
|
+
Core_ui_core_properties_index._setLocalCssShorthandValue(
|
|
2614
|
+
jsCast(__this, Style::class.java),
|
|
2615
|
+
longhand,
|
|
2616
|
+
pending,
|
|
2617
|
+
shorthand,
|
|
2618
|
+
)
|
|
2619
|
+
}
|
|
2620
|
+
})
|
|
2621
|
+
return
|
|
2622
|
+
}
|
|
2623
|
+
if (Core_ui_core_properties_index.hasCssExpression(value)) {
|
|
2624
|
+
value =
|
|
2625
|
+
Core_ui_core_properties_index._evaluateCssExpressions(
|
|
2626
|
+
view,
|
|
2627
|
+
cssLocalName,
|
|
2628
|
+
jsConvertedString(value),
|
|
2629
|
+
)
|
|
2630
|
+
}
|
|
2562
2631
|
(view ?: jsCannotRead("_batchUpdate"))._batchUpdate({
|
|
2563
|
-
for (
|
|
2564
|
-
val p: Any? =
|
|
2565
|
-
val v: Any? =
|
|
2632
|
+
for (__item2 in (converter ?: jsNotAFunction("converter"))(value)) {
|
|
2633
|
+
val p: Any? = __item2.first
|
|
2634
|
+
val v: Any? = __item2.second
|
|
2566
2635
|
jsSet(__this, jsPropertyKey(jsGet(p, "name")), v)
|
|
2567
2636
|
}
|
|
2568
2637
|
})
|
|
2638
|
+
if (
|
|
2639
|
+
jsTruthy(
|
|
2640
|
+
jsAs<JSMap<String, Any?>?>(
|
|
2641
|
+
jsJavaArgument(jsGet(__this, "_localCssExpressions"))
|
|
2642
|
+
)
|
|
2643
|
+
)
|
|
2644
|
+
) {
|
|
2645
|
+
val longhands: JSArray<String>? =
|
|
2646
|
+
Core_ui_core_properties_index.getCssShorthandLonghands(cssLocalName)
|
|
2647
|
+
var i: Double = 0.0
|
|
2648
|
+
val length: Double =
|
|
2649
|
+
(if (jsTruthy(longhands)) (longhands ?: jsCannotRead("length")).length else 0.0)
|
|
2650
|
+
while (i < length) {
|
|
2651
|
+
Core_ui_core_properties_index.releaseLocalCssExpression(
|
|
2652
|
+
jsCast(__this, Style::class.java),
|
|
2653
|
+
(longhands ?: jsCannotRead(js(i))).element(i),
|
|
2654
|
+
)
|
|
2655
|
+
i += 1.0
|
|
2656
|
+
}
|
|
2657
|
+
}
|
|
2569
2658
|
}
|
|
2570
2659
|
fun setCssValue(__this: Any?, value: String?) {
|
|
2571
2660
|
val view: ViewBase? =
|
|
@@ -2953,7 +3042,17 @@ object Core_ui_core_properties_index {
|
|
|
2953
3042
|
return jsIncludes((value ?: jsCannotRead("includes")), "var(--")
|
|
2954
3043
|
}
|
|
2955
3044
|
|
|
2956
|
-
|
|
3045
|
+
/**
|
|
3046
|
+
* Substitute the css-variables in a value.
|
|
3047
|
+
*
|
|
3048
|
+
* @param reads Collects every variable looked up, with the value the lookup returned.
|
|
3049
|
+
*/
|
|
3050
|
+
fun _evaluateCssVariableExpression(
|
|
3051
|
+
view: ViewBase?,
|
|
3052
|
+
cssName: String?,
|
|
3053
|
+
value: String?,
|
|
3054
|
+
reads: JSMap<String, String>? = null,
|
|
3055
|
+
): String {
|
|
2957
3056
|
if (jsTypeof(value) != "string") {
|
|
2958
3057
|
return jsConvertedStringOrEmpty(value)
|
|
2959
3058
|
}
|
|
@@ -2982,6 +3081,12 @@ object Core_ui_core_properties_index {
|
|
|
2982
3081
|
var cssVariableValue: String? =
|
|
2983
3082
|
((view ?: jsCannotRead("style")).style ?: jsCannotRead("getCssVariable"))
|
|
2984
3083
|
.getCssVariable(cssVariableName)
|
|
3084
|
+
if (jsTruthy(reads)) {
|
|
3085
|
+
(reads ?: jsCannotRead("set")).set(
|
|
3086
|
+
cssVariableName,
|
|
3087
|
+
(cssVariableValue ?: "undefined"),
|
|
3088
|
+
)
|
|
3089
|
+
}
|
|
2985
3090
|
if (
|
|
2986
3091
|
jsTypeof(cssVariableValue) == "string" &&
|
|
2987
3092
|
jsTrim((cssVariableValue ?: "undefined")) == "initial"
|
|
@@ -2994,6 +3099,7 @@ object Core_ui_core_properties_index {
|
|
|
2994
3099
|
view,
|
|
2995
3100
|
cssName,
|
|
2996
3101
|
fallback,
|
|
3102
|
+
reads,
|
|
2997
3103
|
)
|
|
2998
3104
|
}
|
|
2999
3105
|
if (cssVariableValue.isNullOrEmpty() || cssVariableValue == "unset") {
|
|
@@ -3073,6 +3179,422 @@ object Core_ui_core_properties_index {
|
|
|
3073
3179
|
return (cssValue ?: "undefined")
|
|
3074
3180
|
}
|
|
3075
3181
|
|
|
3182
|
+
fun hasCssExpression(value: Any?): Boolean {
|
|
3183
|
+
return jsTypeof(value) == "string" &&
|
|
3184
|
+
(Core_ui_core_properties_index.isCssVariableExpression(
|
|
3185
|
+
jsConvertedStringOrNull(value)
|
|
3186
|
+
) || Core_ui_core_properties_index.isCssCalcExpression(jsConvertedStringOrNull(value)))
|
|
3187
|
+
}
|
|
3188
|
+
|
|
3189
|
+
/**
|
|
3190
|
+
* Evaluate the css-variable and css-calc expressions of a value against the view, or
|
|
3191
|
+
* `unsetValue` when they do not resolve.
|
|
3192
|
+
*/
|
|
3193
|
+
fun _evaluateCssExpressions(
|
|
3194
|
+
view: ViewBase?,
|
|
3195
|
+
property: String?,
|
|
3196
|
+
value: String?,
|
|
3197
|
+
reads: JSMap<String, String>? = null,
|
|
3198
|
+
): Any? {
|
|
3199
|
+
val newValue: String =
|
|
3200
|
+
Core_ui_core_properties_index._evaluateCssVariableExpression(
|
|
3201
|
+
view,
|
|
3202
|
+
property,
|
|
3203
|
+
value,
|
|
3204
|
+
reads,
|
|
3205
|
+
)
|
|
3206
|
+
if (newValue == "unset") {
|
|
3207
|
+
return Core_ui_core_properties_property_shared.unsetValue
|
|
3208
|
+
}
|
|
3209
|
+
try {
|
|
3210
|
+
return Core_ui_core_properties_index._evaluateCssCalcExpression(newValue)
|
|
3211
|
+
} catch (__e_1: Throwable) {
|
|
3212
|
+
val e: Any? = jsCaught(__e_1)
|
|
3213
|
+
org.nativescript.kit.Trace.write(
|
|
3214
|
+
"Failed to evaluate css-calc for property [${jsToString((property ?: "undefined"))}] for expression [${newValue}] to ${jsToStringThrowing(view)}. ${jsToStringThrowing(jsGet(e, "stack"))}",
|
|
3215
|
+
org.nativescript.kit.Trace.categories.Error,
|
|
3216
|
+
org.nativescript.kit.Trace.messageType.error,
|
|
3217
|
+
)
|
|
3218
|
+
return Core_ui_core_properties_property_shared.unsetValue
|
|
3219
|
+
}
|
|
3220
|
+
}
|
|
3221
|
+
|
|
3222
|
+
@JvmField var NO_LONGHAND_VALUES: JSRecord<Any?>? = null
|
|
3223
|
+
|
|
3224
|
+
fun expandSubstitutedShorthand(
|
|
3225
|
+
view: ViewBase?,
|
|
3226
|
+
shorthand: String?,
|
|
3227
|
+
substituted: Any?,
|
|
3228
|
+
): JSRecord<Any?>? {
|
|
3229
|
+
if (
|
|
3230
|
+
jsStrictEquals(substituted, Core_ui_core_properties_property_shared.unsetValue)
|
|
3231
|
+
) {
|
|
3232
|
+
return Core_ui_core_properties_index.NO_LONGHAND_VALUES
|
|
3233
|
+
}
|
|
3234
|
+
val expanded: JSArray<Pair<String, Any?>>? =
|
|
3235
|
+
Core_ui_core_properties_index._expandCssShorthand(
|
|
3236
|
+
shorthand,
|
|
3237
|
+
jsConvertedString(substituted),
|
|
3238
|
+
)
|
|
3239
|
+
if (!jsTruthy(expanded)) {
|
|
3240
|
+
org.nativescript.kit.Trace.write(
|
|
3241
|
+
"Failed to expand shorthand [${jsToString((shorthand ?: "undefined"))}] resolved to [${jsToStringThrowing(substituted)}] for ${jsToStringThrowing(view)}.",
|
|
3242
|
+
org.nativescript.kit.Trace.categories.Style,
|
|
3243
|
+
org.nativescript.kit.Trace.messageType.warn,
|
|
3244
|
+
)
|
|
3245
|
+
return Core_ui_core_properties_index.NO_LONGHAND_VALUES
|
|
3246
|
+
}
|
|
3247
|
+
val values: JSRecord<Any?> =
|
|
3248
|
+
(jsAsOrNull<JSRecord<Any?>>(JSRecord<Any?>()) ?: JSRecord<Any?>())
|
|
3249
|
+
var i: Double = 0.0
|
|
3250
|
+
val length: Double = (expanded ?: jsCannotRead("length")).length
|
|
3251
|
+
while (i < length) {
|
|
3252
|
+
values[
|
|
3253
|
+
((expanded ?: jsCannotRead(js(i))).element(i) ?: jsCannotRead("0")).first] =
|
|
3254
|
+
((expanded ?: jsCannotRead(js(i))).element(i) ?: jsCannotRead("1")).second
|
|
3255
|
+
i += 1.0
|
|
3256
|
+
}
|
|
3257
|
+
return values
|
|
3258
|
+
}
|
|
3259
|
+
|
|
3260
|
+
fun cssVariablesUnchanged(view: ViewBase?, reads: Any?): Boolean {
|
|
3261
|
+
kotlin.run {
|
|
3262
|
+
val __it1 = jsIteratorOf(reads)
|
|
3263
|
+
try {
|
|
3264
|
+
while (__it1.jsAdvance()) {
|
|
3265
|
+
val name: String? = jsConvertedStringOrEmpty(jsField(__it1.jsCurrent, "0"))
|
|
3266
|
+
val value: String? = jsConvertedStringOrEmpty(jsField(__it1.jsCurrent, "1"))
|
|
3267
|
+
kotlin.run {
|
|
3268
|
+
if (
|
|
3269
|
+
((view ?: jsCannotRead("style")).style
|
|
3270
|
+
?: jsCannotRead("getCssVariable"))
|
|
3271
|
+
.getCssVariable(name) != value
|
|
3272
|
+
) {
|
|
3273
|
+
return false
|
|
3274
|
+
}
|
|
3275
|
+
}
|
|
3276
|
+
}
|
|
3277
|
+
} catch (__thrown: Throwable) {
|
|
3278
|
+
__it1.jsClose()
|
|
3279
|
+
throw __thrown
|
|
3280
|
+
} finally {
|
|
3281
|
+
__it1.jsCloseChecked()
|
|
3282
|
+
}
|
|
3283
|
+
}
|
|
3284
|
+
return true
|
|
3285
|
+
}
|
|
3286
|
+
|
|
3287
|
+
/**
|
|
3288
|
+
* Evaluate a pending-substitution shorthand against the view and parse it; a value that does
|
|
3289
|
+
* not survive evaluation expands to no longhands.
|
|
3290
|
+
*/
|
|
3291
|
+
fun _substituteCssShorthand(view: ViewBase?, pending: CssPendingSubstitution?): Any? {
|
|
3292
|
+
val reads: Any? = JSMap<Any?, Any?>()
|
|
3293
|
+
val substituted: Any? =
|
|
3294
|
+
Core_ui_core_properties_index._evaluateCssExpressions(
|
|
3295
|
+
view,
|
|
3296
|
+
(pending ?: jsCannotRead("shorthand")).shorthand,
|
|
3297
|
+
(pending ?: jsCannotRead("value")).value,
|
|
3298
|
+
jsAs<JSMap<String, String>?>(jsJavaArgument(reads)),
|
|
3299
|
+
)
|
|
3300
|
+
return jsObjectOf(
|
|
3301
|
+
"substituted" to substituted,
|
|
3302
|
+
"values" to
|
|
3303
|
+
Core_ui_core_properties_index.expandSubstitutedShorthand(
|
|
3304
|
+
view,
|
|
3305
|
+
(pending ?: jsCannotRead("shorthand")).shorthand,
|
|
3306
|
+
substituted,
|
|
3307
|
+
),
|
|
3308
|
+
"reads" to reads,
|
|
3309
|
+
)
|
|
3310
|
+
}
|
|
3311
|
+
|
|
3312
|
+
fun keepLocalCssExpression(
|
|
3313
|
+
style: Style?,
|
|
3314
|
+
cssName: String?,
|
|
3315
|
+
specified: Any?,
|
|
3316
|
+
substituted: Any?,
|
|
3317
|
+
reads: Any?,
|
|
3318
|
+
) {
|
|
3319
|
+
if (
|
|
3320
|
+
!jsTruthy((style ?: jsCannotRead("_localCssExpressions"))._localCssExpressions)
|
|
3321
|
+
) {
|
|
3322
|
+
(style ?: jsCannotSet("_localCssExpressions"))._localCssExpressions =
|
|
3323
|
+
JSMap<String, Any?>()
|
|
3324
|
+
}
|
|
3325
|
+
((style ?: jsCannotRead("_localCssExpressions"))._localCssExpressions
|
|
3326
|
+
?: jsCannotRead("set"))
|
|
3327
|
+
.set(
|
|
3328
|
+
(cssName ?: "undefined"),
|
|
3329
|
+
jsObjectOf("specified" to specified, "substituted" to substituted, "reads" to reads),
|
|
3330
|
+
)
|
|
3331
|
+
}
|
|
3332
|
+
|
|
3333
|
+
fun releaseLocalCssExpression(style: Style?, cssName: String?) {
|
|
3334
|
+
val expressions: JSMap<String, Any?>? =
|
|
3335
|
+
(style ?: jsCannotRead("_localCssExpressions"))._localCssExpressions
|
|
3336
|
+
if (
|
|
3337
|
+
(jsTruthy(expressions) &&
|
|
3338
|
+
(expressions ?: jsCannotRead("delete")).delete((cssName ?: "undefined"))) &&
|
|
3339
|
+
(expressions ?: jsCannotRead("size")).size == 0.0
|
|
3340
|
+
) {
|
|
3341
|
+
(style ?: jsCannotSet("_localCssExpressions"))._localCssExpressions = null
|
|
3342
|
+
}
|
|
3343
|
+
}
|
|
3344
|
+
|
|
3345
|
+
/**
|
|
3346
|
+
* Wrap a local setter: a string holding var()/calc() is written substituted and kept for the
|
|
3347
|
+
* cascade to substitute again, any other write releases what was kept.
|
|
3348
|
+
*/
|
|
3349
|
+
fun localCssExpressionSetter(
|
|
3350
|
+
cssName: String?,
|
|
3351
|
+
set: (Any?, Any?) -> Unit,
|
|
3352
|
+
): (Any?, Any?) -> Unit {
|
|
3353
|
+
return fn1@{ __this: Any?, value: Any? ->
|
|
3354
|
+
if (Core_ui_core_properties_index.hasCssExpression(value)) {
|
|
3355
|
+
val view: ViewBase? =
|
|
3356
|
+
jsUnchecked<JSWeakRef<ViewBase>>(jsJavaArgument(jsGet(__this, "viewRef"))).get()
|
|
3357
|
+
if (jsTruthy(view)) {
|
|
3358
|
+
val reads: Any? = JSMap<Any?, Any?>()
|
|
3359
|
+
val substituted: Any? =
|
|
3360
|
+
Core_ui_core_properties_index._evaluateCssExpressions(
|
|
3361
|
+
view,
|
|
3362
|
+
cssName,
|
|
3363
|
+
jsConvertedStringOrNull(value),
|
|
3364
|
+
jsAs<JSMap<String, String>?>(jsJavaArgument(reads)),
|
|
3365
|
+
)
|
|
3366
|
+
set(__this, substituted)
|
|
3367
|
+
Core_ui_core_properties_index.keepLocalCssExpression(
|
|
3368
|
+
jsCast(__this, Style::class.java),
|
|
3369
|
+
cssName,
|
|
3370
|
+
value,
|
|
3371
|
+
substituted,
|
|
3372
|
+
reads,
|
|
3373
|
+
)
|
|
3374
|
+
return@fn1
|
|
3375
|
+
}
|
|
3376
|
+
}
|
|
3377
|
+
set(__this, value)
|
|
3378
|
+
Core_ui_core_properties_index.releaseLocalCssExpression(
|
|
3379
|
+
jsCast(__this, Style::class.java),
|
|
3380
|
+
cssName,
|
|
3381
|
+
)
|
|
3382
|
+
}
|
|
3383
|
+
}
|
|
3384
|
+
|
|
3385
|
+
fun setLocalCssExpression(
|
|
3386
|
+
style: Style?,
|
|
3387
|
+
cssName: String?,
|
|
3388
|
+
specified: Any?,
|
|
3389
|
+
substituted: Any?,
|
|
3390
|
+
reads: Any?,
|
|
3391
|
+
value: Any?,
|
|
3392
|
+
) {
|
|
3393
|
+
jsSet(
|
|
3394
|
+
(style ?: jsObjectRequired()),
|
|
3395
|
+
jsToString((cssName ?: "undefined")),
|
|
3396
|
+
value,
|
|
3397
|
+
)
|
|
3398
|
+
Core_ui_core_properties_index.keepLocalCssExpression(
|
|
3399
|
+
style,
|
|
3400
|
+
cssName,
|
|
3401
|
+
specified,
|
|
3402
|
+
substituted,
|
|
3403
|
+
reads,
|
|
3404
|
+
)
|
|
3405
|
+
}
|
|
3406
|
+
|
|
3407
|
+
/**
|
|
3408
|
+
* Write a longhand's share of a pending-substitution shorthand as a local value, kept for the
|
|
3409
|
+
* cascade to substitute again.
|
|
3410
|
+
*/
|
|
3411
|
+
fun _setLocalCssShorthandValue(
|
|
3412
|
+
style: Style?,
|
|
3413
|
+
longhand: String?,
|
|
3414
|
+
pending: CssPendingSubstitution?,
|
|
3415
|
+
shorthand: Any?,
|
|
3416
|
+
) {
|
|
3417
|
+
Core_ui_core_properties_index.setLocalCssExpression(
|
|
3418
|
+
style,
|
|
3419
|
+
longhand,
|
|
3420
|
+
pending,
|
|
3421
|
+
jsGet(shorthand, "substituted"),
|
|
3422
|
+
jsGet(shorthand, "reads"),
|
|
3423
|
+
(if (jsHasKey(jsGet(shorthand, "values"), jsToString((longhand ?: "undefined"))))
|
|
3424
|
+
(jsAsOrNull<JSRecord<Any?>>(jsGet(shorthand, "values")) ?: JSRecord<Any?>())[
|
|
3425
|
+
jsToString((longhand ?: "undefined"))]
|
|
3426
|
+
else Core_ui_core_properties_property_shared.unsetValue),
|
|
3427
|
+
)
|
|
3428
|
+
}
|
|
3429
|
+
|
|
3430
|
+
/**
|
|
3431
|
+
* Substitute the kept local var()/calc() values again, writing only those whose substitution
|
|
3432
|
+
* changed since they were last written.
|
|
3433
|
+
*/
|
|
3434
|
+
fun _reevaluateLocalCssExpressions(view: ViewBase?) {
|
|
3435
|
+
val style: Style? = (view ?: jsCannotRead("style")).style
|
|
3436
|
+
val expressions: JSMap<String, Any?>? =
|
|
3437
|
+
(style ?: jsCannotRead("_localCssExpressions"))._localCssExpressions
|
|
3438
|
+
if (!jsTruthy(expressions)) {
|
|
3439
|
+
return
|
|
3440
|
+
}
|
|
3441
|
+
var shorthands: JSMap<CssPendingSubstitution, Any?>? = null
|
|
3442
|
+
val entries: JSArray<Pair<String, Any?>>? =
|
|
3443
|
+
JSArray((expressions ?: jsObjectRequired()).entries().toList())
|
|
3444
|
+
var i: Double = 0.0
|
|
3445
|
+
val length: Double = (entries ?: jsCannotRead("length")).length
|
|
3446
|
+
var __first1 = true
|
|
3447
|
+
while (true) {
|
|
3448
|
+
if (!__first1) {
|
|
3449
|
+
i += 1.0
|
|
3450
|
+
}
|
|
3451
|
+
__first1 = false
|
|
3452
|
+
if (!(i < length)) break
|
|
3453
|
+
kotlin.run {
|
|
3454
|
+
val __d_1: Pair<String, Any?> =
|
|
3455
|
+
((entries ?: jsCannotRead(js(i))).element(i) ?: jsObjectRequired())
|
|
3456
|
+
val cssName: String? = __d_1.first
|
|
3457
|
+
val expression: Any? = __d_1.second
|
|
3458
|
+
if (
|
|
3459
|
+
!jsStrictEquals(
|
|
3460
|
+
(style ?: jsCannotRead("_localCssExpressions"))
|
|
3461
|
+
._localCssExpressions
|
|
3462
|
+
?.get((cssName ?: "undefined")),
|
|
3463
|
+
expression,
|
|
3464
|
+
) ||
|
|
3465
|
+
Core_ui_core_properties_index.cssVariablesUnchanged(
|
|
3466
|
+
view,
|
|
3467
|
+
jsGet(expression, "reads"),
|
|
3468
|
+
)
|
|
3469
|
+
) {
|
|
3470
|
+
continue
|
|
3471
|
+
}
|
|
3472
|
+
val specified: Any? = jsGet(expression, "specified")
|
|
3473
|
+
val substituted: Any?
|
|
3474
|
+
var reads: Any?
|
|
3475
|
+
val value: Any?
|
|
3476
|
+
if ((specified is CssPendingSubstitution)) {
|
|
3477
|
+
if (!jsTruthy(shorthands)) {
|
|
3478
|
+
shorthands = JSMap<CssPendingSubstitution, Any?>()
|
|
3479
|
+
}
|
|
3480
|
+
var shorthand: Any? =
|
|
3481
|
+
(shorthands ?: jsCannotRead("get")).get(
|
|
3482
|
+
jsUnchecked<CssPendingSubstitution>(
|
|
3483
|
+
jsCastCarried(specified, CssPendingSubstitution::class.java)
|
|
3484
|
+
)
|
|
3485
|
+
)
|
|
3486
|
+
if (!jsTruthy(shorthand)) {
|
|
3487
|
+
reads = JSMap<Any?, Any?>()
|
|
3488
|
+
shorthand =
|
|
3489
|
+
jsObjectOf(
|
|
3490
|
+
"substituted" to
|
|
3491
|
+
Core_ui_core_properties_index._evaluateCssExpressions(
|
|
3492
|
+
view,
|
|
3493
|
+
jsCastCarried(specified, CssPendingSubstitution::class.java)
|
|
3494
|
+
.shorthand,
|
|
3495
|
+
jsCastCarried(specified, CssPendingSubstitution::class.java)
|
|
3496
|
+
.value,
|
|
3497
|
+
jsAs<JSMap<String, String>?>(jsJavaArgument(reads)),
|
|
3498
|
+
),
|
|
3499
|
+
"values" to null,
|
|
3500
|
+
"reads" to reads,
|
|
3501
|
+
)
|
|
3502
|
+
(shorthands ?: jsCannotRead("set")).set(
|
|
3503
|
+
jsUnchecked<CssPendingSubstitution>(
|
|
3504
|
+
jsCastCarried(specified, CssPendingSubstitution::class.java)
|
|
3505
|
+
),
|
|
3506
|
+
shorthand,
|
|
3507
|
+
)
|
|
3508
|
+
}
|
|
3509
|
+
substituted = jsGet(shorthand, "substituted")
|
|
3510
|
+
reads = jsGet(shorthand, "reads")
|
|
3511
|
+
if (
|
|
3512
|
+
jsStrictEquals(substituted, jsGet(expression, "substituted"))
|
|
3513
|
+
) {
|
|
3514
|
+
jsSet(expression, "reads", reads)
|
|
3515
|
+
continue
|
|
3516
|
+
}
|
|
3517
|
+
if (!jsTruthy(jsRecordOrNull<Any?>(jsGet(shorthand, "values")))) {
|
|
3518
|
+
jsSet(
|
|
3519
|
+
shorthand,
|
|
3520
|
+
"values",
|
|
3521
|
+
Core_ui_core_properties_index.expandSubstitutedShorthand(
|
|
3522
|
+
view,
|
|
3523
|
+
jsCastCarried(specified, CssPendingSubstitution::class.java)
|
|
3524
|
+
.shorthand,
|
|
3525
|
+
substituted,
|
|
3526
|
+
),
|
|
3527
|
+
)
|
|
3528
|
+
}
|
|
3529
|
+
value =
|
|
3530
|
+
(if (
|
|
3531
|
+
jsHasKey(
|
|
3532
|
+
jsGet(shorthand, "values"),
|
|
3533
|
+
jsToString((cssName ?: "undefined")),
|
|
3534
|
+
)
|
|
3535
|
+
)
|
|
3536
|
+
(jsAsOrNull<JSRecord<Any?>>(jsGet(shorthand, "values"))
|
|
3537
|
+
?: JSRecord<Any?>())[jsToString((cssName ?: "undefined"))]
|
|
3538
|
+
else Core_ui_core_properties_property_shared.unsetValue)
|
|
3539
|
+
} else {
|
|
3540
|
+
reads = JSMap<Any?, Any?>()
|
|
3541
|
+
substituted =
|
|
3542
|
+
Core_ui_core_properties_index._evaluateCssExpressions(
|
|
3543
|
+
view,
|
|
3544
|
+
cssName,
|
|
3545
|
+
jsConvertedString(specified),
|
|
3546
|
+
jsAs<JSMap<String, String>?>(jsJavaArgument(reads)),
|
|
3547
|
+
)
|
|
3548
|
+
if (
|
|
3549
|
+
jsStrictEquals(substituted, jsGet(expression, "substituted"))
|
|
3550
|
+
) {
|
|
3551
|
+
jsSet(expression, "reads", reads)
|
|
3552
|
+
continue
|
|
3553
|
+
}
|
|
3554
|
+
value = substituted
|
|
3555
|
+
}
|
|
3556
|
+
try {
|
|
3557
|
+
Core_ui_core_properties_index.setLocalCssExpression(
|
|
3558
|
+
style,
|
|
3559
|
+
cssName,
|
|
3560
|
+
specified,
|
|
3561
|
+
substituted,
|
|
3562
|
+
reads,
|
|
3563
|
+
value,
|
|
3564
|
+
)
|
|
3565
|
+
} catch (__e_1: Throwable) {
|
|
3566
|
+
val e: Any? = jsCaught(__e_1)
|
|
3567
|
+
org.nativescript.kit.Trace.write(
|
|
3568
|
+
"Failed to apply property [${jsToString((cssName ?: "undefined"))}] with value [${jsToStringThrowing(value)}] to ${jsToStringThrowing(view)}. ${jsToStringThrowing(jsGet(e, "stack"))}",
|
|
3569
|
+
org.nativescript.kit.Trace.categories.Error,
|
|
3570
|
+
org.nativescript.kit.Trace.messageType.error,
|
|
3571
|
+
)
|
|
3572
|
+
try {
|
|
3573
|
+
jsSet(
|
|
3574
|
+
(style ?: jsObjectRequired()),
|
|
3575
|
+
jsToString((cssName ?: "undefined")),
|
|
3576
|
+
Core_ui_core_properties_property_shared.unsetValue,
|
|
3577
|
+
)
|
|
3578
|
+
} catch (__e_2: Throwable) {
|
|
3579
|
+
val e: Any? = jsCaught(__e_2)
|
|
3580
|
+
org.nativescript.kit.Trace.write(
|
|
3581
|
+
"Failed to unset property [${jsToString((cssName ?: "undefined"))}] on ${jsToStringThrowing(view)}. ${jsToStringThrowing(jsGet(e, "stack"))}",
|
|
3582
|
+
org.nativescript.kit.Trace.categories.Error,
|
|
3583
|
+
org.nativescript.kit.Trace.messageType.error,
|
|
3584
|
+
)
|
|
3585
|
+
}
|
|
3586
|
+
Core_ui_core_properties_index.keepLocalCssExpression(
|
|
3587
|
+
style,
|
|
3588
|
+
cssName,
|
|
3589
|
+
specified,
|
|
3590
|
+
substituted,
|
|
3591
|
+
reads,
|
|
3592
|
+
)
|
|
3593
|
+
}
|
|
3594
|
+
}
|
|
3595
|
+
}
|
|
3596
|
+
}
|
|
3597
|
+
|
|
3076
3598
|
fun getPropertiesFromMap(map: Any?): Any? {
|
|
3077
3599
|
val symbols: JSArray<JSSymbol>? = jsOwnPropertySymbols(map)
|
|
3078
3600
|
val len: Double = (symbols ?: jsCannotRead("length")).length
|
|
@@ -3554,6 +4076,7 @@ object Core_ui_core_properties_index {
|
|
|
3554
4076
|
inheritableProperties = JSArray<InheritedProperty>()
|
|
3555
4077
|
inheritableCssProperties = JSArray<InheritedCssProperty>()
|
|
3556
4078
|
cssValueSourceKeys = jsRecordOrNull<JSSymbol>(jsObjectCreate(jsNull))
|
|
4079
|
+
NO_LONGHAND_VALUES = jsRecordOrNull<Any?>(jsFreeze(jsObjectOf()))
|
|
3557
4080
|
initNativeView =
|
|
3558
4081
|
Core_profiling_index.profile(
|
|
3559
4082
|
"\"properties\".initNativeView",
|
|
@@ -2341,10 +2341,6 @@ abstract class ViewBase : Observable, JSStringConvertible {
|
|
|
2341
2341
|
"page" -> this.page
|
|
2342
2342
|
"visualState" -> this.visualState
|
|
2343
2343
|
"getEffectivePaddingShorthand" -> jsFunction { this.getEffectivePaddingShorthand() }
|
|
2344
|
-
"getViewById" ->
|
|
2345
|
-
jsFunction { __a -> this.getViewById(jsConvertedStringOrNull(__a.getOrNull(0))) }
|
|
2346
|
-
"getViewByDomId" ->
|
|
2347
|
-
jsFunction { __a -> this.getViewByDomId(jsConvertedNumberOrZero(__a.getOrNull(0))) }
|
|
2348
2344
|
"ensureDomNode" ->
|
|
2349
2345
|
jsFunction {
|
|
2350
2346
|
this.ensureDomNode()
|
|
@@ -2385,8 +2381,6 @@ abstract class ViewBase : Observable, JSStringConvertible {
|
|
|
2385
2381
|
this._resumeNativeUpdates(jsConvertedNumberOrZero(__a.getOrNull(0)))
|
|
2386
2382
|
null
|
|
2387
2383
|
}
|
|
2388
|
-
"_batchUpdate" ->
|
|
2389
|
-
jsFunction { __a -> this._batchUpdate(jsFunction0<Any?>(__a.getOrNull(0))) }
|
|
2390
2384
|
"setFlag" ->
|
|
2391
2385
|
jsFunction { __a ->
|
|
2392
2386
|
this.setFlag(
|
|
@@ -2820,8 +2814,6 @@ abstract class ViewBase : Observable, JSStringConvertible {
|
|
|
2820
2814
|
"page",
|
|
2821
2815
|
"visualState",
|
|
2822
2816
|
"getEffectivePaddingShorthand",
|
|
2823
|
-
"getViewById",
|
|
2824
|
-
"getViewByDomId",
|
|
2825
2817
|
"ensureDomNode",
|
|
2826
2818
|
"set",
|
|
2827
2819
|
"onLoaded",
|
|
@@ -2830,7 +2822,6 @@ abstract class ViewBase : Observable, JSStringConvertible {
|
|
|
2830
2822
|
"_setDefaultPaddings",
|
|
2831
2823
|
"_suspendNativeUpdates",
|
|
2832
2824
|
"_resumeNativeUpdates",
|
|
2833
|
-
"_batchUpdate",
|
|
2834
2825
|
"setFlag",
|
|
2835
2826
|
"isFlagSet",
|
|
2836
2827
|
"callFunctionWithSuper",
|
package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_weak_event_listener_index.kt
CHANGED
|
@@ -215,7 +215,7 @@ object Core_ui_core_weak_event_listener_index {
|
|
|
215
215
|
if (!jsTruthy(targetHandlerPairList)) {
|
|
216
216
|
return
|
|
217
217
|
}
|
|
218
|
-
val targetHandlerPairsToRemove: JSArray<Double> = JSArray
|
|
218
|
+
val targetHandlerPairsToRemove: JSArray<Double> = JSArray.doubles()
|
|
219
219
|
var pair: TargetHandlerPair?
|
|
220
220
|
var registeredTarget: Any?
|
|
221
221
|
var i: Double = 0.0
|
|
@@ -228,7 +228,7 @@ object Core_ui_core_weak_event_listener_index {
|
|
|
228
228
|
(jsStrictEquals(registeredTarget, target) &&
|
|
229
229
|
jsStrictEquals(handler, (pair ?: jsCannotRead("handler")).handler))
|
|
230
230
|
) {
|
|
231
|
-
targetHandlerPairsToRemove.
|
|
231
|
+
targetHandlerPairsToRemove.pushDouble(i)
|
|
232
232
|
}
|
|
233
233
|
i += 1.0
|
|
234
234
|
}
|
|
@@ -247,7 +247,7 @@ object Core_ui_core_weak_event_listener_index {
|
|
|
247
247
|
var j: Double = targetHandlerPairsToRemove.length - 1.0
|
|
248
248
|
while (j >= 0.0) {
|
|
249
249
|
(targetHandlerPairList ?: jsCannotRead("splice")).splice(
|
|
250
|
-
|
|
250
|
+
targetHandlerPairsToRemove.numberAt(j),
|
|
251
251
|
1.0,
|
|
252
252
|
)
|
|
253
253
|
j -= 1.0
|