@nstudio/nativescript-compiler 9.2.0-alpha.11 → 9.2.0-alpha.13
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/dist/cli/runtime.cjs +7 -1
- package/dist/css/css.js +30 -6
- package/dist/driver/compile.js +1 -0
- package/dist/driver/paths.js +7 -0
- package/dist/kotlin/access.js +1 -1
- package/dist/kotlin/arguments.js +1 -20
- package/dist/kotlin/conversion.js +17 -5
- package/dist/kotlin/expressions.js +8 -3
- package/dist/kotlin/literals.js +7 -9
- package/dist/kotlin/native/calls.js +84 -3
- package/dist/kotlin/operators.js +0 -12
- package/dist/kotlin/overrides.js +7 -5
- package/dist/kotlin/placement.js +3 -1
- package/dist/kotlin/statements.js +1 -16
- package/dist/kotlin/static-calls.js +6 -4
- package/dist/kotlin/translator.js +31 -17
- package/dist/kotlin/type-facts.js +10 -2
- package/dist/plugins/native-android.js +173 -4
- package/dist/program/program.js +35 -26
- package/dist/semantics/facts.js +28 -1
- package/dist/semantics/lowering-methods.js +56 -0
- package/dist/semantics/shapes.js +21 -1
- package/dist/swift/arguments.js +1 -20
- package/dist/swift/conversion.js +1 -1
- package/dist/swift/from-any.js +2 -2
- package/dist/swift/literals.js +4 -4
- package/dist/swift/modules.js +1 -1
- package/dist/swift/placement.js +2 -3
- package/dist/swift/statements.js +1 -16
- package/dist/swift/static-calls.js +5 -3
- package/dist/swift/translator.js +1 -19
- package/dist/targets/android/build.js +5 -3
- package/docs/cli/compile-ios.md +4 -0
- package/kit-android/generated/kotlin/org/nativescript/kit/application_application.kt +4 -4
- package/kit-android/generated/kotlin/org/nativescript/kit/image_source_index.kt +1 -1
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_animation_animation_common.kt +7 -3
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_animation_index.kt +3 -1
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_view_base_index.kt +2 -4
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_view_index.kt +5 -6
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_dialogs_index.kt +11 -6
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_fragment_transitions.kt +1 -1
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_frame_common.kt +1 -1
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_frame_helper_for_android.kt +7 -5
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_index.kt +6 -3
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_gestures_touch_manager.kt +1 -1
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_flexbox_layout_index.kt +1 -1
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_search_bar_index.kt +4 -3
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_segmented_bar_index.kt +2 -2
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_text_base_formatted_string.kt +1 -3
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_text_base_index.kt +1 -1
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_transition_fade_transition.kt +1 -1
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_transition_flip_transition.kt +8 -8
- package/kit-android/generated/kotlin/org/nativescript/kit/utils_index.kt +1 -1
- package/kit-android/generated/source-lines.json +1 -1
- package/kit-android/gradlew.bat +94 -0
- package/kit-android/src/main/kotlin/org/nativescript/kit/Signals.kt +15 -2
- package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity1.swift +2 -15
- package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity2.swift +9 -3
- package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity3Plus.swift +11 -7
- package/kit-apple/Sources/NativeScriptKit/Core/Object_callback_thisArg_once.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_index_section_view_ios_android.swift +7 -5
- package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_oldIndex_newIndex.swift +4 -2
- package/kit-apple/Sources/NativeScriptKit/Core/data.observable.index.swift +3 -3
- package/kit-apple/Sources/NativeScriptKit/Core/kit-index.json +6 -2
- package/kit-apple/Sources/NativeScriptKit/Core/ui.core.weak-event-listener.index.swift +3 -3
- package/kit-apple/Sources/NativeScriptKit/Core/ui.gestures.index.ios.swift +2 -2
- package/kit-apple/Sources/NativeScriptKit/Core/ui.repeater.index.swift +6 -2
- package/kit-apple/Sources/NativeScriptKit/Core/ui.text-base.formatted-string.swift +2 -1
- package/kit-apple/Sources/NativeScriptKit/Signals.swift +20 -2
- package/package.json +2 -1
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
@rem
|
|
2
|
+
@rem Copyright 2015 the original author or authors.
|
|
3
|
+
@rem
|
|
4
|
+
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
@rem you may not use this file except in compliance with the License.
|
|
6
|
+
@rem You may obtain a copy of the License at
|
|
7
|
+
@rem
|
|
8
|
+
@rem https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
@rem
|
|
10
|
+
@rem Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
@rem See the License for the specific language governing permissions and
|
|
14
|
+
@rem limitations under the License.
|
|
15
|
+
@rem
|
|
16
|
+
@rem SPDX-License-Identifier: Apache-2.0
|
|
17
|
+
@rem
|
|
18
|
+
|
|
19
|
+
@if "%DEBUG%"=="" @echo off
|
|
20
|
+
@rem ##########################################################################
|
|
21
|
+
@rem
|
|
22
|
+
@rem Gradle startup script for Windows
|
|
23
|
+
@rem
|
|
24
|
+
@rem ##########################################################################
|
|
25
|
+
|
|
26
|
+
@rem Set local scope for the variables with windows NT shell
|
|
27
|
+
if "%OS%"=="Windows_NT" setlocal
|
|
28
|
+
|
|
29
|
+
set DIRNAME=%~dp0
|
|
30
|
+
if "%DIRNAME%"=="" set DIRNAME=.
|
|
31
|
+
@rem This is normally unused
|
|
32
|
+
set APP_BASE_NAME=%~n0
|
|
33
|
+
set APP_HOME=%DIRNAME%
|
|
34
|
+
|
|
35
|
+
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
|
36
|
+
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
|
37
|
+
|
|
38
|
+
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
39
|
+
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
|
40
|
+
|
|
41
|
+
@rem Find java.exe
|
|
42
|
+
if defined JAVA_HOME goto findJavaFromJavaHome
|
|
43
|
+
|
|
44
|
+
set JAVA_EXE=java.exe
|
|
45
|
+
%JAVA_EXE% -version >NUL 2>&1
|
|
46
|
+
if %ERRORLEVEL% equ 0 goto execute
|
|
47
|
+
|
|
48
|
+
echo. 1>&2
|
|
49
|
+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
|
50
|
+
echo. 1>&2
|
|
51
|
+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
|
52
|
+
echo location of your Java installation. 1>&2
|
|
53
|
+
|
|
54
|
+
goto fail
|
|
55
|
+
|
|
56
|
+
:findJavaFromJavaHome
|
|
57
|
+
set JAVA_HOME=%JAVA_HOME:"=%
|
|
58
|
+
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|
59
|
+
|
|
60
|
+
if exist "%JAVA_EXE%" goto execute
|
|
61
|
+
|
|
62
|
+
echo. 1>&2
|
|
63
|
+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
|
64
|
+
echo. 1>&2
|
|
65
|
+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
|
66
|
+
echo location of your Java installation. 1>&2
|
|
67
|
+
|
|
68
|
+
goto fail
|
|
69
|
+
|
|
70
|
+
:execute
|
|
71
|
+
@rem Setup the command line
|
|
72
|
+
|
|
73
|
+
set CLASSPATH=
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
@rem Execute Gradle
|
|
77
|
+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
|
78
|
+
|
|
79
|
+
:end
|
|
80
|
+
@rem End local scope for the variables with windows NT shell
|
|
81
|
+
if %ERRORLEVEL% equ 0 goto mainEnd
|
|
82
|
+
|
|
83
|
+
:fail
|
|
84
|
+
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
|
85
|
+
rem the _cmd.exe /c_ return code!
|
|
86
|
+
set EXIT_CODE=%ERRORLEVEL%
|
|
87
|
+
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
|
88
|
+
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
|
89
|
+
exit /b %EXIT_CODE%
|
|
90
|
+
|
|
91
|
+
:mainEnd
|
|
92
|
+
if "%OS%"=="Windows_NT" endlocal
|
|
93
|
+
|
|
94
|
+
:omega
|
|
@@ -433,7 +433,7 @@ interface MemoReader {
|
|
|
433
433
|
* next read. A result `same` as the kept one (Object.is) keeps the kept one and its version. Nothing it read holds it: a
|
|
434
434
|
* reader asks for its value.
|
|
435
435
|
*/
|
|
436
|
-
class Memo<T>(private val compute: () -> T, private val same: (T, T) -> Boolean = ::jsSame) : Versioned, MemoReader {
|
|
436
|
+
class Memo<T>(private val compute: () -> T, private val same: (T, T) -> Boolean = ::jsSame) : Versioned, MemoReader, JSDynamic {
|
|
437
437
|
private var cached: Result<T>? = null
|
|
438
438
|
private val sources = mutableListOf<Pair<Versioned, Int>>()
|
|
439
439
|
override var version = 0
|
|
@@ -493,6 +493,11 @@ class Memo<T>(private val compute: () -> T, private val same: (T, T) -> Boolean
|
|
|
493
493
|
|
|
494
494
|
/** A function's local `computed()` (`val total by Memo(…)`): each read of the local is the memo's value. */
|
|
495
495
|
operator fun getValue(thisRef: Any?, property: kotlin.reflect.KProperty<*>): T = value
|
|
496
|
+
|
|
497
|
+
override val jsKeys: List<String> get() = listOf("value")
|
|
498
|
+
override val jsClassName: String? get() = null
|
|
499
|
+
override fun jsGet(key: String): Any? = if (key == "value") value else null
|
|
500
|
+
override fun jsSet(key: String, value: Any?) {}
|
|
496
501
|
}
|
|
497
502
|
|
|
498
503
|
/**
|
|
@@ -500,7 +505,7 @@ class Memo<T>(private val compute: () -> T, private val same: (T, T) -> Boolean
|
|
|
500
505
|
* (`equals`, by default `==`: Object.is for numbers and strings, identity for
|
|
501
506
|
* the runtime's objects) is ignored.
|
|
502
507
|
*/
|
|
503
|
-
class Signal<T>(private var stored: T, private val equals: ((T, T) -> Boolean)? = null) : Versioned {
|
|
508
|
+
class Signal<T>(private var stored: T, private val equals: ((T, T) -> Boolean)? = null) : Versioned, JSDynamic {
|
|
504
509
|
private val subscribers = LinkedHashSet<Subscriber>()
|
|
505
510
|
override var version = 0
|
|
506
511
|
private set
|
|
@@ -625,6 +630,14 @@ class Signal<T>(private var stored: T, private val equals: ((T, T) -> Boolean)?
|
|
|
625
630
|
link?.let { for (s in it.sources.toList()) s.first.subscribe(effect) }
|
|
626
631
|
}
|
|
627
632
|
|
|
633
|
+
override val jsKeys: List<String> get() = listOf("value")
|
|
634
|
+
override val jsClassName: String? get() = null
|
|
635
|
+
override fun jsGet(key: String): Any? = if (key == "value") value else null
|
|
636
|
+
@Suppress("UNCHECKED_CAST")
|
|
637
|
+
override fun jsSet(key: String, value: Any?) {
|
|
638
|
+
if (key == "value") this.value = (if (value === JSNull) null else value) as T
|
|
639
|
+
}
|
|
640
|
+
|
|
628
641
|
/**
|
|
629
642
|
* A `linkedSignal`'s computation, run as a memo's is: on the first read or write, and on each one after a value it
|
|
630
643
|
* read has a new version. [compute] is handed whether the signal holds a value (computed or written; not on the
|
|
@@ -570,7 +570,7 @@ public struct FunctionCell_EventDataOpt_to_Void {
|
|
|
570
570
|
{
|
|
571
571
|
jsBoxedFunction(Self(f: __f)) {
|
|
572
572
|
jsFunction(name, length) { (__a: [Any?]) throws -> Any? in
|
|
573
|
-
try __f((jsArg(__a, 0) as? EventData))
|
|
573
|
+
try __f(jsUnlessNullish(jsArg(__a, 0), { (jsFlat($0) as? EventData) ?? EventData(jsObject: $0) }))
|
|
574
574
|
return nil
|
|
575
575
|
}
|
|
576
576
|
}
|
|
@@ -590,19 +590,6 @@ public struct FunctionCell_EventDataOpt_to_Void {
|
|
|
590
590
|
public static func fromScriptOrNil(_ __f: Any?) -> ((EventData?) throws -> Void)? {
|
|
591
591
|
jsIsNullish(__f) ? nil : fromScript(__f)
|
|
592
592
|
}
|
|
593
|
-
public static func lenientScript(_ name: String, _ length: Int, _ __f: @escaping (EventData?) throws -> Void)
|
|
594
|
-
-> JSFunctionObject
|
|
595
|
-
{
|
|
596
|
-
jsBoxedFunction(Self(f: __f)) {
|
|
597
|
-
jsFunction(name, length) { (__a: [Any?]) throws -> Any? in
|
|
598
|
-
try __f(jsUnlessNullish(jsArg(__a, 0), { (jsFlat($0) as? EventData) ?? EventData(jsObject: $0) }))
|
|
599
|
-
return nil
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
public static func lenientScriptOrNil(_ name: String, _ length: Int, _ __f: ((EventData?) throws -> Void)?)
|
|
604
|
-
-> JSFunctionObject?
|
|
605
|
-
{ if let __f { return lenientScript(name, length, __f) } else { return nil } }
|
|
606
593
|
public static func adapting(_ __h: @escaping (Any?) throws -> Void) -> (EventData?) throws -> Void {
|
|
607
594
|
let __i = JSFunctionAlias(cell: FunctionCell_AnyOpt_to_Void(f: __h))
|
|
608
595
|
return jsIdentified(
|
|
@@ -6358,7 +6345,7 @@ public struct FunctionCell_ListViewBaseOpt_to_Void {
|
|
|
6358
6345
|
{
|
|
6359
6346
|
jsBoxedFunction(Self(f: __f)) {
|
|
6360
6347
|
jsFunction(name, length) { (__a: [Any?]) throws -> Any? in
|
|
6361
|
-
try __f((
|
|
6348
|
+
try __f(jsUnlessNullish(jsArg(__a, 0), { (jsFlat($0) as? ListViewBase) ?? ListViewBase(jsObject: $0) }))
|
|
6362
6349
|
return nil
|
|
6363
6350
|
}
|
|
6364
6351
|
}
|
|
@@ -3752,7 +3752,9 @@ public struct FunctionCell_ListViewBaseOpt_AnyOpt_to_AnyOpt {
|
|
|
3752
3752
|
{
|
|
3753
3753
|
jsBoxedFunction(Self(f: __f)) {
|
|
3754
3754
|
jsFunction(name, length) { (__a: [Any?]) throws -> Any? in
|
|
3755
|
-
return try __f(
|
|
3755
|
+
return try __f(
|
|
3756
|
+
jsUnlessNullish(jsArg(__a, 0), { (jsFlat($0) as? ListViewBase) ?? ListViewBase(jsObject: $0) }),
|
|
3757
|
+
jsArg(__a, 1))
|
|
3756
3758
|
}
|
|
3757
3759
|
}
|
|
3758
3760
|
}
|
|
@@ -4010,7 +4012,9 @@ public struct FunctionCell_SegmentedBarBaseOpt_Double_to_Double {
|
|
|
4010
4012
|
jsBoxedFunction(Self(f: __f)) {
|
|
4011
4013
|
jsFunction(name, length) { (__a: [Any?]) throws -> Any? in
|
|
4012
4014
|
return try __f(
|
|
4013
|
-
(
|
|
4015
|
+
jsUnlessNullish(
|
|
4016
|
+
jsArg(__a, 0), { (jsFlat($0) as? SegmentedBarBase) ?? SegmentedBarBase(jsObject: $0) }),
|
|
4017
|
+
(try jsConvertedNumber(jsArg(__a, 1))))
|
|
4014
4018
|
}
|
|
4015
4019
|
}
|
|
4016
4020
|
}
|
|
@@ -4195,7 +4199,9 @@ public struct FunctionCell_TabViewBaseOpt_Double_to_Double {
|
|
|
4195
4199
|
{
|
|
4196
4200
|
jsBoxedFunction(Self(f: __f)) {
|
|
4197
4201
|
jsFunction(name, length) { (__a: [Any?]) throws -> Any? in
|
|
4198
|
-
return try __f(
|
|
4202
|
+
return try __f(
|
|
4203
|
+
jsUnlessNullish(jsArg(__a, 0), { (jsFlat($0) as? TabViewBase) ?? TabViewBase(jsObject: $0) }),
|
|
4204
|
+
(try jsConvertedNumber(jsArg(__a, 1))))
|
|
4199
4205
|
}
|
|
4200
4206
|
}
|
|
4201
4207
|
}
|
|
@@ -4320,7 +4320,9 @@ public struct FunctionCell_ListViewBaseOpt_AnyOpt_AnyOpt_to_Void {
|
|
|
4320
4320
|
) -> JSFunctionObject {
|
|
4321
4321
|
jsBoxedFunction(Self(f: __f)) {
|
|
4322
4322
|
jsFunction(name, length) { (__a: [Any?]) throws -> Any? in
|
|
4323
|
-
try __f(
|
|
4323
|
+
try __f(
|
|
4324
|
+
jsUnlessNullish(jsArg(__a, 0), { (jsFlat($0) as? ListViewBase) ?? ListViewBase(jsObject: $0) }),
|
|
4325
|
+
jsArg(__a, 1), jsArg(__a, 2))
|
|
4324
4326
|
return nil
|
|
4325
4327
|
}
|
|
4326
4328
|
}
|
|
@@ -4611,8 +4613,9 @@ public struct FunctionCell_SegmentedBarBaseOpt_Double_Double_to_Void {
|
|
|
4611
4613
|
jsBoxedFunction(Self(f: __f)) {
|
|
4612
4614
|
jsFunction(name, length) { (__a: [Any?]) throws -> Any? in
|
|
4613
4615
|
try __f(
|
|
4614
|
-
(
|
|
4615
|
-
|
|
4616
|
+
jsUnlessNullish(
|
|
4617
|
+
jsArg(__a, 0), { (jsFlat($0) as? SegmentedBarBase) ?? SegmentedBarBase(jsObject: $0) }),
|
|
4618
|
+
(try jsConvertedNumber(jsArg(__a, 1))), (try jsConvertedNumber(jsArg(__a, 2))))
|
|
4616
4619
|
return nil
|
|
4617
4620
|
}
|
|
4618
4621
|
}
|
|
@@ -4652,7 +4655,8 @@ public struct FunctionCell_SegmentedBarBaseOpt_JSArray_SegmentedBarItem_Opt_JSAr
|
|
|
4652
4655
|
jsBoxedFunction(Self(f: __f)) {
|
|
4653
4656
|
jsFunction(name, length) { (__a: [Any?]) throws -> Any? in
|
|
4654
4657
|
try __f(
|
|
4655
|
-
(
|
|
4658
|
+
jsUnlessNullish(
|
|
4659
|
+
jsArg(__a, 0), { (jsFlat($0) as? SegmentedBarBase) ?? SegmentedBarBase(jsObject: $0) }),
|
|
4656
4660
|
try jsArrayOrNil(
|
|
4657
4661
|
jsArg(__a, 1), as: JSArray<SegmentedBarItem>.self,
|
|
4658
4662
|
{ try (jsCastPresent($0) as SegmentedBarItem) }),
|
|
@@ -4789,8 +4793,8 @@ public struct FunctionCell_TabViewBaseOpt_Double_Double_to_Void {
|
|
|
4789
4793
|
jsBoxedFunction(Self(f: __f)) {
|
|
4790
4794
|
jsFunction(name, length) { (__a: [Any?]) throws -> Any? in
|
|
4791
4795
|
try __f(
|
|
4792
|
-
(
|
|
4793
|
-
(try jsConvertedNumber(jsArg(__a, 2))))
|
|
4796
|
+
jsUnlessNullish(jsArg(__a, 0), { (jsFlat($0) as? TabViewBase) ?? TabViewBase(jsObject: $0) }),
|
|
4797
|
+
(try jsConvertedNumber(jsArg(__a, 1))), (try jsConvertedNumber(jsArg(__a, 2))))
|
|
4794
4798
|
return nil
|
|
4795
4799
|
}
|
|
4796
4800
|
}
|
|
@@ -4830,7 +4834,7 @@ public struct FunctionCell_TabViewBaseOpt_JSArray_TabViewItem_Opt_JSArray_TabVie
|
|
|
4830
4834
|
jsBoxedFunction(Self(f: __f)) {
|
|
4831
4835
|
jsFunction(name, length) { (__a: [Any?]) throws -> Any? in
|
|
4832
4836
|
try __f(
|
|
4833
|
-
(
|
|
4837
|
+
jsUnlessNullish(jsArg(__a, 0), { (jsFlat($0) as? TabViewBase) ?? TabViewBase(jsObject: $0) }),
|
|
4834
4838
|
try jsArrayOrNil(
|
|
4835
4839
|
jsArg(__a, 1), as: JSArray<TabViewItem>.self, { try (jsCastPresent($0) as TabViewItem) }),
|
|
4836
4840
|
try jsArrayOrNil(
|
|
@@ -73,7 +73,7 @@ public final class Object_callback_thisArg_once: JSDynamic, JSObjectConvertible
|
|
|
73
73
|
}
|
|
74
74
|
case 8:
|
|
75
75
|
switch key {
|
|
76
|
-
case "callback": return FunctionCell_EventDataOpt_to_Void.
|
|
76
|
+
case "callback": return FunctionCell_EventDataOpt_to_Void.scriptOrNil("", 1, self.callback)
|
|
77
77
|
default: break
|
|
78
78
|
}
|
|
79
79
|
default: break
|
|
@@ -43,10 +43,11 @@ public final class Object_eventName_object_index_section_view_ios_android: JSDyn
|
|
|
43
43
|
public convenience init(jsObject: Any?) {
|
|
44
44
|
self.init(
|
|
45
45
|
eventName: jsLenientString(jsField(jsObject, "eventName")),
|
|
46
|
-
object: (
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
object: jsUnlessNullish(
|
|
47
|
+
jsField(jsObject, "object"), { (jsFlat($0) as? ListViewBase) ?? ListViewBase(jsObject: $0) }),
|
|
48
|
+
index: jsLenientNumber(jsField(jsObject, "index")), section: jsLenientNumber(jsField(jsObject, "section")),
|
|
49
|
+
view: (jsField(jsObject, "view") as? View), ios: jsField(jsObject, "ios"),
|
|
50
|
+
android: jsField(jsObject, "android"), jsOrder: (jsObject as? JSDynamic)?.jsKeys)
|
|
50
51
|
jsUnset = jsUnsetKeys(jsObject, ["ios", "android"])
|
|
51
52
|
jsExtra = jsObject as? JSDynamic
|
|
52
53
|
}
|
|
@@ -138,7 +139,8 @@ public final class Object_eventName_object_index_section_view_ios_android: JSDyn
|
|
|
138
139
|
case 6:
|
|
139
140
|
switch key {
|
|
140
141
|
case "object":
|
|
141
|
-
self.object = (
|
|
142
|
+
self.object = jsUnlessNullish(
|
|
143
|
+
newValue, { (jsFlat($0) as? ListViewBase) ?? ListViewBase(jsObject: $0) })
|
|
142
144
|
return
|
|
143
145
|
default: break
|
|
144
146
|
}
|
package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_oldIndex_newIndex.swift
CHANGED
|
@@ -35,7 +35,8 @@ public final class Object_eventName_object_oldIndex_newIndex: JSDynamic, JSObjec
|
|
|
35
35
|
public convenience init(jsObject: Any?) {
|
|
36
36
|
self.init(
|
|
37
37
|
eventName: jsLenientString(jsField(jsObject, "eventName")),
|
|
38
|
-
object: (
|
|
38
|
+
object: jsUnlessNullish(
|
|
39
|
+
jsField(jsObject, "object"), { (jsFlat($0) as? SegmentedBarBase) ?? SegmentedBarBase(jsObject: $0) }),
|
|
39
40
|
oldIndex: jsLenientNumber(jsField(jsObject, "oldIndex")),
|
|
40
41
|
newIndex: jsLenientNumber(jsField(jsObject, "newIndex")), jsOrder: (jsObject as? JSDynamic)?.jsKeys)
|
|
41
42
|
jsExtra = jsObject as? JSDynamic
|
|
@@ -74,7 +75,8 @@ public final class Object_eventName_object_oldIndex_newIndex: JSDynamic, JSObjec
|
|
|
74
75
|
case 6:
|
|
75
76
|
switch key {
|
|
76
77
|
case "object":
|
|
77
|
-
self.object = (
|
|
78
|
+
self.object = jsUnlessNullish(
|
|
79
|
+
newValue, { (jsFlat($0) as? SegmentedBarBase) ?? SegmentedBarBase(jsObject: $0) })
|
|
78
80
|
return
|
|
79
81
|
default: break
|
|
80
82
|
}
|
|
@@ -352,7 +352,7 @@ open class Observable: JSDynamic, JSExpando, JSConstructibleType, JSKeysMade, JS
|
|
|
352
352
|
#sourceLocation(file:"@nativescript/core/data.observable.index.ts",line:246)
|
|
353
353
|
_ = try jsUnwrap(list, "push").push(
|
|
354
354
|
JSObject([
|
|
355
|
-
("callback", FunctionCell_EventDataOpt_to_Void.
|
|
355
|
+
("callback", FunctionCell_EventDataOpt_to_Void.scriptOrNil("", 1, callback) as Any?),
|
|
356
356
|
("thisArg", thisArg as Any?), ("once", (once as Any?) as Any?),
|
|
357
357
|
]))
|
|
358
358
|
}
|
|
@@ -390,7 +390,7 @@ open class Observable: JSDynamic, JSExpando, JSConstructibleType, JSKeysMade, JS
|
|
|
390
390
|
#sourceLocation(file:"@nativescript/core/data.observable.index.ts",line:246)
|
|
391
391
|
_ = try jsUnwrap(list, "push").push(
|
|
392
392
|
JSObject([
|
|
393
|
-
("callback", FunctionCell_EventDataOpt_to_Void.
|
|
393
|
+
("callback", FunctionCell_EventDataOpt_to_Void.scriptOrNil("", 1, callback) as Any?),
|
|
394
394
|
("thisArg", thisArg as Any?), ("once", (once as Any?) as Any?),
|
|
395
395
|
]))
|
|
396
396
|
}
|
|
@@ -647,7 +647,7 @@ open class Observable: JSDynamic, JSExpando, JSConstructibleType, JSKeysMade, JS
|
|
|
647
647
|
jsUnwrap(Core_data_observable_index._globalEventHandlers[eventClass], "eventName")[eventName], "push"
|
|
648
648
|
).push(
|
|
649
649
|
JSObject([
|
|
650
|
-
("callback", FunctionCell_EventDataOpt_to_Void.
|
|
650
|
+
("callback", FunctionCell_EventDataOpt_to_Void.scriptOrNil("", 1, callback) as Any?),
|
|
651
651
|
("thisArg", thisArg as Any?), ("once", (once as Any?) as Any?),
|
|
652
652
|
]))
|
|
653
653
|
#sourceLocation(file:"@nativescript/core/data.observable.index.ts",line:412)
|
|
@@ -8564,8 +8564,6 @@
|
|
|
8564
8564
|
"fromScript": [{"kind":"func","static":true,"type":"(EventData?) throws -> Void","params":[{"label":"_","name":"__f","type":"Any?"}]}],
|
|
8565
8565
|
"fromScriptOrNil": [{"kind":"func","static":true,"type":"((EventData?) throws -> Void)?","params":[{"label":"_","name":"__f","type":"Any?"}]}],
|
|
8566
8566
|
"implicit": [{"kind":"func","static":true,"type":"((EventData?) throws -> Void)?","params":[{"label":"_","name":"value","type":"((EventData?) throws -> Void)?"}]}],
|
|
8567
|
-
"lenientScript": [{"kind":"func","static":true,"type":"JSFunctionObject","params":[{"label":"_","name":"name","type":"String"},{"label":"_","name":"length","type":"Int"},{"label":"_","name":"__f","type":"@escaping (EventData?) throws -> Void"}]}],
|
|
8568
|
-
"lenientScriptOrNil": [{"kind":"func","static":true,"type":"JSFunctionObject?","params":[{"label":"_","name":"name","type":"String"},{"label":"_","name":"length","type":"Int"},{"label":"_","name":"__f","type":"((EventData?) throws -> Void)?"}]}],
|
|
8569
8567
|
"present": [{"kind":"func","static":true,"type":"(EventData?) throws -> Void","params":[{"label":"_","name":"value","type":"((EventData?) throws -> Void)?"}],"throws":true}],
|
|
8570
8568
|
"script": [{"kind":"func","static":true,"type":"JSFunctionObject","params":[{"label":"_","name":"name","type":"String"},{"label":"_","name":"length","type":"Int"},{"label":"_","name":"__f","type":"@escaping (EventData?) throws -> Void"}]}],
|
|
8571
8569
|
"scriptOrNil": [{"kind":"func","static":true,"type":"JSFunctionObject?","params":[{"label":"_","name":"name","type":"String"},{"label":"_","name":"length","type":"Int"},{"label":"_","name":"__f","type":"((EventData?) throws -> Void)?"}]}]
|
|
@@ -17057,7 +17055,10 @@
|
|
|
17057
17055
|
"origin": "runtime",
|
|
17058
17056
|
"members": {
|
|
17059
17057
|
"init": [{"kind":"init","static":true,"type":"Memo","params":[{"label":"_","name":"compute","type":"@escaping () throws -> T"},{"label":"equals","name":"same","type":"@escaping (T, T) throws -> Bool"}]}, {"kind":"init","static":true,"type":"Memo","params":[{"label":"_","name":"compute","type":"@escaping () throws -> T"}]}],
|
|
17058
|
+
"jsClassName": [{"kind":"var","type":"String?"}],
|
|
17059
|
+
"jsKeys": [{"kind":"var","type":"[String]"}],
|
|
17060
17060
|
"read": [{"kind":"func","type":"T","params":[],"throws":true}],
|
|
17061
|
+
"subscript": [{"kind":"subscript","type":"Any?","params":[{"label":"jsKey","name":"key","type":"String"}]}],
|
|
17061
17062
|
"value": [{"kind":"var","type":"T"}]
|
|
17062
17063
|
}
|
|
17063
17064
|
},
|
|
@@ -26005,8 +26006,11 @@
|
|
|
26005
26006
|
"origin": "runtime",
|
|
26006
26007
|
"members": {
|
|
26007
26008
|
"init": [{"kind":"init","static":true,"type":"Signal","params":[{"label":"_","name":"value","type":"T"}]}, {"kind":"init","static":true,"type":"Signal","params":[{"label":"_","name":"value","type":"T"},{"label":"equals","name":"equals","type":"@escaping (T, T) throws -> Bool"}]}, {"kind":"init","static":true,"type":"Signal","params":[{"label":"unset","name":"error","type":"String"}]}, {"kind":"init","static":true,"type":"Signal","params":[{"label":"unset","name":"error","type":"String"},{"label":"equals","name":"equals","type":"@escaping (T, T) throws -> Bool"}]}, {"kind":"init","static":true,"type":"Signal","params":[{"label":"computing","name":"compute","type":"@escaping () throws -> T"}]}, {"kind":"init","static":true,"type":"Signal","params":[{"label":"_","name":"memo","type":"Memo<T>"}]}, {"kind":"init","static":true,"type":"Signal","params":[{"label":"linked","name":"compute","type":"@escaping () throws -> T"}]}, {"kind":"init","static":true,"type":"Signal","params":[{"label":"linked","name":"compute","type":"@escaping () throws -> T"},{"label":"equals","name":"equals","type":"@escaping (T, T) throws -> Bool"}]}, {"kind":"init","static":true,"type":"Signal","params":[{"label":"source","name":"source","type":"@escaping () throws -> S"},{"label":"computation","name":"computation","type":"@escaping (S, (source: S?, value: T)?) throws -> T"},{"label":"equals","name":"equals","type":"@escaping (T, T) throws -> Bool"}]}],
|
|
26009
|
+
"jsClassName": [{"kind":"var","type":"String?"}],
|
|
26010
|
+
"jsKeys": [{"kind":"var","type":"[String]"}],
|
|
26008
26011
|
"requiredValue": [{"kind":"func","type":"T","params":[],"throws":true}],
|
|
26009
26012
|
"setThrowing": [{"kind":"func","type":"Void","params":[{"label":"_","name":"newValue","type":"T"}],"throws":true}],
|
|
26013
|
+
"subscript": [{"kind":"subscript","type":"Any?","params":[{"label":"jsKey","name":"key","type":"String"}]}],
|
|
26010
26014
|
"update": [{"kind":"func","type":"Void","params":[{"label":"_","name":"transform","type":"(T) throws -> T"}]}],
|
|
26011
26015
|
"updateThrowing": [{"kind":"func","type":"Void","params":[{"label":"_","name":"transform","type":"(T) throws -> T"}],"throws":true}],
|
|
26012
26016
|
"value": [{"kind":"var","type":"T"}]
|
|
@@ -41,7 +41,7 @@ open class TargetHandlerPair: JSDynamic, JSExpando, JSStaticKeyed {
|
|
|
41
41
|
switch key.utf8.count {
|
|
42
42
|
case 7:
|
|
43
43
|
switch key {
|
|
44
|
-
case "handler": return FunctionCell_EventDataOpt_to_Void.
|
|
44
|
+
case "handler": return FunctionCell_EventDataOpt_to_Void.scriptOrNil("", 1, self.handler)
|
|
45
45
|
default: break
|
|
46
46
|
}
|
|
47
47
|
case 8:
|
|
@@ -160,8 +160,8 @@ public enum Core_ui_core_weak_event_listener_index {
|
|
|
160
160
|
#sourceLocation(file:"@nativescript/core/ui.core.weak-event-listener.index.ts",line:57)
|
|
161
161
|
_ = try Core_ui_core_weak_event_listener_index.handlersForEventName.set(
|
|
162
162
|
eventName,
|
|
163
|
-
FunctionCell_EventDataOpt_to_Void.
|
|
164
|
-
|
|
163
|
+
FunctionCell_EventDataOpt_to_Void.scriptOrNil("", 1, FunctionCell_EventDataOpt_to_Void.present(handler))
|
|
164
|
+
)
|
|
165
165
|
}
|
|
166
166
|
#sourceLocation(file:"@nativescript/core/ui.core.weak-event-listener.index.ts",line:60)
|
|
167
167
|
return handler
|
|
@@ -508,7 +508,7 @@ open class GesturesObserver: GesturesObserverBase {
|
|
|
508
508
|
switch key {
|
|
509
509
|
case "_onTargetLoaded":
|
|
510
510
|
if !(jsMadeBits0 & (1 << 1) != 0) { return nil }
|
|
511
|
-
return FunctionCell_EventDataOpt_to_Void.
|
|
511
|
+
return FunctionCell_EventDataOpt_to_Void.scriptOrNil("", 1, self._onTargetLoaded)
|
|
512
512
|
default: break
|
|
513
513
|
}
|
|
514
514
|
case 16:
|
|
@@ -521,7 +521,7 @@ open class GesturesObserver: GesturesObserverBase {
|
|
|
521
521
|
switch key {
|
|
522
522
|
case "_onTargetUnloaded":
|
|
523
523
|
if !(jsMadeBits0 & (1 << 2) != 0) { return nil }
|
|
524
|
-
return FunctionCell_EventDataOpt_to_Void.
|
|
524
|
+
return FunctionCell_EventDataOpt_to_Void.scriptOrNil("", 1, self._onTargetUnloaded)
|
|
525
525
|
case "_createRecognizer":
|
|
526
526
|
return
|
|
527
527
|
FunctionCell_Double_AnyOpt_to_Void_Opt_UISwipeGestureRecognizer_DirectionOpt_to_UIGestureRecognizerOpt
|
|
@@ -467,7 +467,9 @@ public func __init_Core_ui_repeater_index() {
|
|
|
467
467
|
if oldValue is ObservableArray {
|
|
468
468
|
#sourceLocation(file:"@nativescript/core/ui.repeater.index.ts",line:258)
|
|
469
469
|
try Core_ui_core_weak_event_listener_index.removeWeakEventListener(
|
|
470
|
-
(
|
|
470
|
+
{ (__o: Any?) -> ObservableArray in
|
|
471
|
+
(jsFlat(__o) as? ObservableArray) ?? ObservableArray(jsObject: __o)
|
|
472
|
+
}(oldValue), ObservableArray.changeEvent,
|
|
471
473
|
FunctionCell_EventDataOpt_to_Void.adapting(
|
|
472
474
|
jsMethodValue(jsUnwrap(target, "_onItemsChanged"), "_onItemsChanged") {
|
|
473
475
|
__r, __i in
|
|
@@ -483,7 +485,9 @@ public func __init_Core_ui_repeater_index() {
|
|
|
483
485
|
if newValue is ObservableArray {
|
|
484
486
|
#sourceLocation(file:"@nativescript/core/ui.repeater.index.ts",line:262)
|
|
485
487
|
try Core_ui_core_weak_event_listener_index.addWeakEventListener(
|
|
486
|
-
(
|
|
488
|
+
{ (__o: Any?) -> ObservableArray in
|
|
489
|
+
(jsFlat(__o) as? ObservableArray) ?? ObservableArray(jsObject: __o)
|
|
490
|
+
}(newValue), ObservableArray.changeEvent,
|
|
487
491
|
FunctionCell_EventDataOpt_to_Void.adapting(
|
|
488
492
|
jsMethodValue(jsUnwrap(target, "_onItemsChanged"), "_onItemsChanged") {
|
|
489
493
|
__r, __i in
|
|
@@ -661,7 +661,8 @@ open class FormattedString: ViewBase {
|
|
|
661
661
|
case 6:
|
|
662
662
|
switch key {
|
|
663
663
|
case "_spans":
|
|
664
|
-
self._spans = (
|
|
664
|
+
self._spans = jsUnlessNullish(
|
|
665
|
+
newValue, { (jsFlat($0) as? ObservableArray) ?? ObservableArray(jsObject: $0) })
|
|
665
666
|
return
|
|
666
667
|
default: break
|
|
667
668
|
}
|
|
@@ -419,7 +419,7 @@ protocol MemoReader: AnyObject {
|
|
|
419
419
|
/// A computed value: kept, so reads share it, until a value it read has a new version; then it is computed again on
|
|
420
420
|
/// the next read. A result `same` as the kept one keeps the kept one and its version. Nothing it read holds it: a
|
|
421
421
|
/// reader asks for its value.
|
|
422
|
-
public final class Memo<T>: Versioned, MemoReader {
|
|
422
|
+
public final class Memo<T>: Versioned, MemoReader, JSDynamic {
|
|
423
423
|
nonisolated deinit {}
|
|
424
424
|
private let compute: () throws -> T
|
|
425
425
|
private let same: (T, T) throws -> Bool
|
|
@@ -483,6 +483,13 @@ public final class Memo<T>: Versioned, MemoReader {
|
|
|
483
483
|
}
|
|
484
484
|
|
|
485
485
|
public var value: T { jsReportedOrZero(read) }
|
|
486
|
+
|
|
487
|
+
public var jsKeys: [String] { ["value"] }
|
|
488
|
+
public var jsClassName: String? { nil }
|
|
489
|
+
public subscript(jsKey key: String) -> Any? {
|
|
490
|
+
get { key == "value" ? value : nil }
|
|
491
|
+
set {}
|
|
492
|
+
}
|
|
486
493
|
}
|
|
487
494
|
|
|
488
495
|
/// The `equal` of a signal's options, read by name; `default` when they give none.
|
|
@@ -497,7 +504,7 @@ public func jsReportingEquals<T>(_ equal: @escaping (T, T) throws -> Bool) -> (T
|
|
|
497
504
|
}
|
|
498
505
|
|
|
499
506
|
/// A value that notifies the effects that read it.
|
|
500
|
-
public final class Signal<T>: Versioned, Holding {
|
|
507
|
+
public final class Signal<T>: Versioned, Holding, JSDynamic {
|
|
501
508
|
nonisolated deinit {}
|
|
502
509
|
private enum Backing {
|
|
503
510
|
case stored(T)
|
|
@@ -742,6 +749,17 @@ public final class Signal<T>: Versioned, Holding {
|
|
|
742
749
|
}
|
|
743
750
|
|
|
744
751
|
func unsubscribe(_ subscriber: Subscriber) { subscribers[ObjectIdentifier(subscriber)] = nil }
|
|
752
|
+
|
|
753
|
+
public var jsKeys: [String] { ["value"] }
|
|
754
|
+
public var jsClassName: String? { nil }
|
|
755
|
+
public subscript(jsKey key: String) -> Any? {
|
|
756
|
+
get { key == "value" ? value : nil }
|
|
757
|
+
set {
|
|
758
|
+
guard key == "value" else { return }
|
|
759
|
+
let unwrapped: Any? = jsIsNullish(newValue) ? nil : newValue
|
|
760
|
+
if let v = unwrapped as? T { value = v }
|
|
761
|
+
}
|
|
762
|
+
}
|
|
745
763
|
}
|
|
746
764
|
|
|
747
765
|
/// State the handlers of a render read as it rendered (untracked reads see the last flush) until the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nstudio/nativescript-compiler",
|
|
3
|
-
"version": "9.2.0-alpha.
|
|
3
|
+
"version": "9.2.0-alpha.13",
|
|
4
4
|
"description": "NativeScript CLI plugin (`ns compile`) and compiler turning a NativeScript app into native Swift (iOS) or Kotlin (Android) with no JavaScript runtime; framework adapters (`@nstudio/nativescript-compiler-<framework>`) compile each framework.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
"kit-android/build.gradle.kts",
|
|
55
55
|
"kit-android/consumer-rules.pro",
|
|
56
56
|
"kit-android/gradlew",
|
|
57
|
+
"kit-android/gradlew.bat",
|
|
57
58
|
"kit-android/gradle/",
|
|
58
59
|
"kit-android/src/",
|
|
59
60
|
"kit-android/generated/",
|