@nstudio/nativescript-compiler 9.2.0-alpha.17 → 9.2.0-alpha.18
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/dist/kotlin/access.js +8 -7
- 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 +2 -2
- 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/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/signals.js +11 -0
- package/dist/semantics/states/missing.js +7 -0
- package/dist/semantics/tdz.js +54 -15
- package/dist/semantics/throws.js +1 -1
- package/dist/semantics/translator-methods.js +1 -1
- package/dist/swift/access.js +7 -9
- package/dist/swift/assignment.js +20 -14
- package/dist/swift/calls.js +6 -3
- 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/literals.js +8 -3
- package/dist/swift/modules.js +3 -3
- package/dist/swift/names.js +3 -3
- package/dist/swift/native/calls.js +1 -1
- package/dist/swift/object-classes.js +84 -1
- package/dist/swift/operators.js +31 -29
- package/dist/swift/placement.js +4 -3
- package/dist/swift/state-backend.js +3 -2
- package/dist/swift/static-calls.js +2 -3
- package/dist/swift/syntax.js +9 -5
- package/dist/swift/translator.js +1 -1
- package/dist/swift/type-facts.js +3 -3
- package/dist/swift/types.js +3 -3
- 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/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 +1 -1
- 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 +2 -2
- package/kit-apple/Sources/NativeScriptKit/Core/file-system.file-system-access.ios.swift +52 -43
- 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 +66 -51
- package/kit-apple/Sources/NativeScriptKit/Core/image-source.index.ios.swift +67 -51
- package/kit-apple/Sources/NativeScriptKit/Core/kit-index.json +143 -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.animation.index.ios.swift +77 -65
- package/kit-apple/Sources/NativeScriptKit/Core/ui.builder.index.swift +4 -4
- package/kit-apple/Sources/NativeScriptKit/Core/ui.core.properties.index.swift +1272 -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 +8 -8
- package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view.view-common.swift +1 -1
- 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.layouts.flexbox-layout.index.ios.swift +22 -21
- package/kit-apple/Sources/NativeScriptKit/Core/ui.page.index.ios.swift +202 -188
- package/kit-apple/Sources/NativeScriptKit/Core/ui.repeater.index.swift +2 -6
- package/kit-apple/Sources/NativeScriptKit/Core/ui.split-view.index.ios.swift +3 -3
- 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.text-base.formatted-string.swift +1 -2
- package/kit-apple/Sources/NativeScriptKit/Core/ui.text-view.text-view-common.swift +1 -1
- 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 +17 -17
- 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/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/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 +2 -2
|
@@ -23,7 +23,8 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
23
23
|
/// so it also fires on a background launch where no window is created.
|
|
24
24
|
///
|
|
25
25
|
/// Guaranteed ordering: `ready` -> `windowOpen` -> raw connect/create events -> content
|
|
26
|
-
/// resolution (the legacy `launch` bridge runs here, for the first window
|
|
26
|
+
/// resolution (the legacy `launch` bridge runs here, for the first window and the first
|
|
27
|
+
/// one after `exit`) ->
|
|
27
28
|
/// `contentLoaded` -> `activate`/`displayed`.
|
|
28
29
|
open var readyEvent: String = "ready"
|
|
29
30
|
/// Reflects whole-app state: with multiple windows it is raised once the app itself is
|
|
@@ -117,45 +118,45 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
117
118
|
jsCallMethod(
|
|
118
119
|
jsGet(Core_application_application_common.globalEvents, "hasListeners"), "bind",
|
|
119
120
|
Core_application_application_common.globalEvents))
|
|
120
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
121
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:250)
|
|
121
122
|
try jsSet(Core_globals_global_utils.getNativeScriptGlobals(), "appInstanceReady", true)
|
|
122
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
123
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:252)
|
|
123
124
|
try jsSet(
|
|
124
125
|
jsGlobalThis, "__onUncaughtError",
|
|
125
126
|
FunctionCell_AnyOpt_to_Void.scriptOrNil(
|
|
126
127
|
"", 1,
|
|
127
128
|
{ (error: Any?) throws -> Void in
|
|
128
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
129
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:253)
|
|
129
130
|
try jsCallable(self.notify, "this.notify")(
|
|
130
131
|
JSObject([
|
|
131
132
|
("eventName", self.uncaughtErrorEvent), ("object", self), ("android", error),
|
|
132
133
|
("ios", error), ("error", error),
|
|
133
134
|
]))
|
|
134
135
|
}))
|
|
135
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
136
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:262)
|
|
136
137
|
try jsSet(
|
|
137
138
|
jsGlobalThis, "__onDiscardedError",
|
|
138
139
|
FunctionCell_AnyOpt_to_Void.scriptOrNil(
|
|
139
140
|
"", 1,
|
|
140
141
|
{ (error: Any?) throws -> Void in
|
|
141
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
142
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:263)
|
|
142
143
|
try jsCallable(self.notify, "this.notify")(
|
|
143
144
|
JSObject([("eventName", self.discardedErrorEvent), ("object", self), ("error", error)]))
|
|
144
145
|
}))
|
|
145
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
146
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:270)
|
|
146
147
|
try jsSet(
|
|
147
148
|
jsGlobalThis, "__onLiveSync",
|
|
148
149
|
FunctionCell_AnyOpt_to_Void.scriptOrNil(
|
|
149
150
|
"", 1,
|
|
150
151
|
{ (context: Any?) throws -> Void in
|
|
151
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
152
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:271)
|
|
152
153
|
if self.suspended {
|
|
153
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
154
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:272)
|
|
154
155
|
return
|
|
155
156
|
}
|
|
156
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:274)
|
|
157
|
-
let rootView: View? = try self.getRootView()
|
|
158
157
|
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:275)
|
|
158
|
+
let rootView: View? = try self.getRootView()
|
|
159
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:276)
|
|
159
160
|
try self.livesync(rootView, context)
|
|
160
161
|
}))
|
|
161
162
|
}
|
|
@@ -163,13 +164,13 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
163
164
|
/// Boolean to enable/disable systemAppearanceChanged
|
|
164
165
|
open var autoSystemAppearanceChanged: Bool {
|
|
165
166
|
get {
|
|
166
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
167
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:239)
|
|
167
168
|
return Core_application_helpers_common.getAutoSystemAppearanceChanged()
|
|
168
169
|
}
|
|
169
170
|
set {
|
|
170
171
|
let value = newValue
|
|
171
172
|
do {
|
|
172
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
173
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:243)
|
|
173
174
|
Core_application_helpers_common.setAutoSystemAppearanceChanged(value)
|
|
174
175
|
}
|
|
175
176
|
}
|
|
@@ -178,10 +179,10 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
178
179
|
/// Get the primary NativeWindow.
|
|
179
180
|
open var primaryWindow: NativeWindow? {
|
|
180
181
|
get throws {
|
|
181
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
182
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:464)
|
|
182
183
|
return try jsImplicit(
|
|
183
184
|
jsUnwrap(self._windows, "find").find({ (nw: NativeWindow?) throws -> Bool in
|
|
184
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
185
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:464)
|
|
185
186
|
return try jsUnwrap(nw, "isPrimary").isPrimary
|
|
186
187
|
}))
|
|
187
188
|
}
|
|
@@ -193,9 +194,9 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
193
194
|
/// never raises `activate`.
|
|
194
195
|
open var activeWindow: NativeWindow? {
|
|
195
196
|
get throws {
|
|
196
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:473)
|
|
197
|
-
let active: NativeWindow? = Core_application_helpers_common.getActiveWindow()
|
|
198
197
|
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:474)
|
|
198
|
+
let active: NativeWindow? = Core_application_helpers_common.getActiveWindow()
|
|
199
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:475)
|
|
199
200
|
if try
|
|
200
201
|
({ () throws -> Bool in
|
|
201
202
|
let __v_1 = active
|
|
@@ -203,41 +204,41 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
203
204
|
? try jsStringEquals(jsUnwrap(active, "state").state, "attached") : jsTruthy(__v_1)
|
|
204
205
|
}()) && jsUnwrap(self._windows, "indexOf").indexOf(jsObjectRequired(active)) != -1
|
|
205
206
|
{
|
|
206
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
207
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:476)
|
|
207
208
|
return active
|
|
208
209
|
}
|
|
209
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
210
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:479)
|
|
210
211
|
return try self.primaryWindow
|
|
211
212
|
}
|
|
212
213
|
}
|
|
213
214
|
#sourceLocation()
|
|
214
215
|
open var inBackground: Bool {
|
|
215
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
216
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1150)
|
|
216
217
|
return Core_application_helpers_common.isAppInBackground()
|
|
217
218
|
}
|
|
218
219
|
#sourceLocation()
|
|
219
220
|
open var suspended: Bool {
|
|
220
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
221
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1166)
|
|
221
222
|
return self._suspended
|
|
222
223
|
}
|
|
223
224
|
#sourceLocation()
|
|
224
225
|
open var android: Any? {
|
|
225
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
226
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1183)
|
|
226
227
|
return nil
|
|
227
228
|
}
|
|
228
229
|
#sourceLocation()
|
|
229
230
|
open var ios: iOSApplication? {
|
|
230
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
231
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1187)
|
|
231
232
|
return nil
|
|
232
233
|
}
|
|
233
234
|
#sourceLocation()
|
|
234
235
|
open var AndroidApplication: Any? {
|
|
235
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
236
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1191)
|
|
236
237
|
return self.android
|
|
237
238
|
}
|
|
238
239
|
#sourceLocation()
|
|
239
240
|
open var iOSApplication: iOSApplication? {
|
|
240
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
241
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1195)
|
|
241
242
|
return self.ios
|
|
242
243
|
}
|
|
243
244
|
#sourceLocation()
|
|
@@ -251,34 +252,34 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
251
252
|
open func jsDeleteOwn(_ key: String) -> Bool { jsExpando?.delete(key) ?? true }
|
|
252
253
|
/// @internal
|
|
253
254
|
open func livesync(_ rootView: View?, _ context: Any? = nil) throws {
|
|
254
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
255
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:284)
|
|
255
256
|
try jsCallable(self.notify, "this.notify")(
|
|
256
257
|
EventData(jsObject: EventData(jsObject: JSObject([("eventName", self.livesyncEvent), ("object", self)]))))
|
|
257
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:284)
|
|
258
|
-
let liveSyncCore: Any? = try jsGet(jsGlobalThis, "__onLiveSyncCore")
|
|
259
258
|
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:285)
|
|
259
|
+
let liveSyncCore: Any? = try jsGet(jsGlobalThis, "__onLiveSyncCore")
|
|
260
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:286)
|
|
260
261
|
var reapplyAppStyles: Bool = false
|
|
261
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
262
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:289)
|
|
262
263
|
if try (jsTruthy(context) && jsTruthy(jsGet(context, "path"))) {
|
|
263
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:289)
|
|
264
|
-
let styleExtensions: JSArray<String> = JSArray<String>(["css", "scss"])
|
|
265
264
|
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:290)
|
|
266
|
-
let
|
|
265
|
+
let styleExtensions: JSArray<String> = JSArray<String>(["css", "scss"])
|
|
267
266
|
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:291)
|
|
267
|
+
let appStylesFullFileName: String = self.getCssFileName()
|
|
268
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:292)
|
|
268
269
|
let appStylesFileName: String = jsSubstring(
|
|
269
270
|
appStylesFullFileName, 0, jsLastIndexOf(appStylesFullFileName, ".") + 1)
|
|
270
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
271
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:293)
|
|
271
272
|
reapplyAppStyles = try styleExtensions.some({ (ext: String) throws -> Bool in
|
|
272
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
273
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:293)
|
|
273
274
|
return try jsStrictEquals(jsGet(context, "path"), (appStylesFileName + ext))
|
|
274
275
|
})
|
|
275
276
|
}
|
|
276
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
277
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:297)
|
|
277
278
|
if jsTruthy(rootView) && reapplyAppStyles {
|
|
278
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
279
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:298)
|
|
279
280
|
try jsUnwrap(rootView, "_onCssStateChange")._onCssStateChange()
|
|
280
281
|
} else if jsTruthy(liveSyncCore) {
|
|
281
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
282
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:300)
|
|
282
283
|
_ = try jsCall(liveSyncCore, context)
|
|
283
284
|
}
|
|
284
285
|
}
|
|
@@ -292,28 +293,28 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
292
293
|
open func applyCssClass(
|
|
293
294
|
_ rootView: View?, _ cssClasses: JSArray<String>?, _ newCssClass: String, _ skipCssUpdate: Bool = false
|
|
294
295
|
) throws {
|
|
295
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
296
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:313)
|
|
296
297
|
if try !(jsUnwrap(jsUnwrap(rootView, "cssClasses").cssClasses, "has").has(newCssClass)) {
|
|
297
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
298
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:314)
|
|
298
299
|
try jsUnwrap(cssClasses, "forEach").forEach({ (cssClass: String) throws -> Void in
|
|
299
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
300
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:314)
|
|
300
301
|
try self.removeCssClass(rootView, cssClass)
|
|
301
302
|
})
|
|
302
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:314)
|
|
303
|
-
try self.addCssClass(rootView, newCssClass)
|
|
304
303
|
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:315)
|
|
304
|
+
try self.addCssClass(rootView, newCssClass)
|
|
305
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:316)
|
|
305
306
|
try self.increaseStyleScopeApplicationCssSelectorVersion(rootView)
|
|
306
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
307
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:318)
|
|
307
308
|
if !skipCssUpdate {
|
|
308
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
309
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:319)
|
|
309
310
|
try jsUnwrap(rootView, "_onCssStateChange")._onCssStateChange()
|
|
310
311
|
}
|
|
311
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
312
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:322)
|
|
312
313
|
if NativeScriptKit.Trace.isEnabled() {
|
|
313
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
314
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:323)
|
|
314
315
|
let rootCssClasses: JSArray<String>? = try JSArray<String>.from(
|
|
315
316
|
jsObjectRequired(jsUnwrap(rootView, "cssClasses").cssClasses))
|
|
316
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
317
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:324)
|
|
317
318
|
try NativeScriptKit.Trace.write(
|
|
318
319
|
"Applying root css class: \(newCssClass). rootView css classes: \(jsUnwrap(rootCssClasses, "join").join(" "))",
|
|
319
320
|
NativeScriptKit.Trace.categories.Style)
|
|
@@ -322,16 +323,16 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
322
323
|
}
|
|
323
324
|
#sourceLocation()
|
|
324
325
|
open func addCssClass(_ rootView: View?, _ cssClass: String) throws {
|
|
325
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:329)
|
|
326
|
-
_ = NativeScriptKit.CSSUtils.pushToSystemCssClasses(cssClass)
|
|
327
326
|
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:330)
|
|
327
|
+
_ = NativeScriptKit.CSSUtils.pushToSystemCssClasses(cssClass)
|
|
328
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:331)
|
|
328
329
|
_ = try jsUnwrap(jsUnwrap(rootView, "cssClasses").cssClasses, "add").add(cssClass)
|
|
329
330
|
}
|
|
330
331
|
#sourceLocation()
|
|
331
332
|
open func removeCssClass(_ rootView: View?, _ cssClass: String) throws {
|
|
332
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:334)
|
|
333
|
-
_ = (NativeScriptKit.CSSUtils.removeSystemCssClass(cssClass) ?? "undefined")
|
|
334
333
|
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:335)
|
|
334
|
+
_ = (NativeScriptKit.CSSUtils.removeSystemCssClass(cssClass) ?? "undefined")
|
|
335
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:336)
|
|
335
336
|
_ = try jsUnwrap(jsUnwrap(rootView, "cssClasses").cssClasses, "delete").delete(cssClass)
|
|
336
337
|
}
|
|
337
338
|
#sourceLocation()
|
|
@@ -339,117 +340,117 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
339
340
|
/// must not leak into it, because it seeds every window's root view.
|
|
340
341
|
open func applyWindowScopedCssClass(_ rootView: View?, _ cssClasses: JSArray<String>?, _ newCssClass: String) throws
|
|
341
342
|
{
|
|
342
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
343
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:344)
|
|
343
344
|
if try jsUnwrap(jsUnwrap(rootView, "cssClasses").cssClasses, "has").has(newCssClass) {
|
|
344
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
345
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:345)
|
|
345
346
|
return
|
|
346
347
|
}
|
|
347
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
348
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:348)
|
|
348
349
|
try jsUnwrap(cssClasses, "forEach").forEach({ (cssClass: String) throws -> Void in
|
|
349
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
350
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:348)
|
|
350
351
|
try _ = jsUnwrap(jsUnwrap(rootView, "cssClasses").cssClasses, "delete").delete(cssClass)
|
|
351
352
|
})
|
|
352
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:348)
|
|
353
|
-
_ = try jsUnwrap(jsUnwrap(rootView, "cssClasses").cssClasses, "add").add(newCssClass)
|
|
354
353
|
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:349)
|
|
354
|
+
_ = try jsUnwrap(jsUnwrap(rootView, "cssClasses").cssClasses, "add").add(newCssClass)
|
|
355
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:350)
|
|
355
356
|
try self.increaseStyleScopeApplicationCssSelectorVersion(rootView)
|
|
356
357
|
}
|
|
357
358
|
#sourceLocation()
|
|
358
359
|
/// The modal registry is process-wide, so only the modals presented over this root
|
|
359
360
|
/// view may follow its window-scoped classes.
|
|
360
361
|
open func getOwnedModalViews(_ rootView: View?) throws -> JSArray<View>? {
|
|
361
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
362
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:358)
|
|
362
363
|
return try jsUnwrap(
|
|
363
364
|
((try jsArrayFrom(jsUnwrap(rootView, "_getRootModalViews")._getRootModalViews()) {
|
|
364
365
|
try (jsCastPresent($0) as View)
|
|
365
366
|
} as JSArray<View>)), "filter"
|
|
366
367
|
).filter({ (modalView: View?) throws -> Bool in
|
|
367
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
368
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:358)
|
|
368
369
|
return try jsStrictEquals(jsUnwrap(modalView, "_getRootModalHost")._getRootModalHost(), rootView)
|
|
369
370
|
})
|
|
370
371
|
}
|
|
371
372
|
#sourceLocation()
|
|
372
373
|
open func increaseStyleScopeApplicationCssSelectorVersion(_ rootView: View?) throws {
|
|
373
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
374
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:362)
|
|
374
375
|
let styleScope: StyleScope? =
|
|
375
376
|
try
|
|
376
377
|
(jsUnwrap(rootView, "_styleScope")._styleScope ?? ((rootView as? Frame) as Frame?)?.currentPage?._styleScope)
|
|
377
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
378
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:364)
|
|
378
379
|
if jsTruthy(styleScope) {
|
|
379
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
380
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:365)
|
|
380
381
|
try jsUnwrap(styleScope, "_increaseApplicationCssSelectorVersion")._increaseApplicationCssSelectorVersion()
|
|
381
382
|
}
|
|
382
383
|
}
|
|
383
384
|
#sourceLocation()
|
|
384
385
|
open func setRootViewCSSClasses(_ rootView: View?, _ window: NativeWindow? = nil) throws {
|
|
385
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:369)
|
|
386
|
-
let platform: String = try jsUnwrap(Core_platform_device_index.Device, "os").os.lowercased()
|
|
387
386
|
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:370)
|
|
388
|
-
let
|
|
387
|
+
let platform: String = try jsUnwrap(Core_platform_device_index.Device, "os").os.lowercased()
|
|
389
388
|
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:371)
|
|
389
|
+
let deviceType: String = try jsUnwrap(Core_platform_device_index.Device, "deviceType").deviceType.lowercased()
|
|
390
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:372)
|
|
390
391
|
let orientation: String =
|
|
391
392
|
try (jsTruthy(window as Any?) ? jsUnwrap(window, "orientation").orientation() : self.orientation())
|
|
392
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
393
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:373)
|
|
393
394
|
let systemAppearance: String? =
|
|
394
395
|
try
|
|
395
396
|
(jsTruthy(window as Any?)
|
|
396
397
|
? jsUnwrap(window, "systemAppearance").systemAppearance() : self.systemAppearance())
|
|
397
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
398
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:374)
|
|
398
399
|
let layoutDirection: String? =
|
|
399
400
|
try
|
|
400
401
|
(jsTruthy(window as Any?) ? jsUnwrap(window, "layoutDirection").layoutDirection() : self.layoutDirection())
|
|
401
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
402
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:376)
|
|
402
403
|
if jsTruthy(platform) {
|
|
403
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
404
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:377)
|
|
404
405
|
_ = NativeScriptKit.CSSUtils.pushToSystemCssClasses("\(NativeScriptKit.CSSUtils.CLASS_PREFIX)\(platform)")
|
|
405
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
406
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:383)
|
|
406
407
|
_ = NativeScriptKit.CSSUtils.pushToSystemCssClasses(
|
|
407
408
|
"\(NativeScriptKit.CSSUtils.CLASS_PREFIX)\(platform)-\(js(Foundation.floor(Core_utils_constants.SDK_VERSION)))"
|
|
408
409
|
)
|
|
409
410
|
}
|
|
410
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
411
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:386)
|
|
411
412
|
if jsTruthy(deviceType) {
|
|
412
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
413
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:387)
|
|
413
414
|
_ = NativeScriptKit.CSSUtils.pushToSystemCssClasses("\(NativeScriptKit.CSSUtils.CLASS_PREFIX)\(deviceType)")
|
|
414
415
|
}
|
|
415
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
416
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:390)
|
|
416
417
|
_ = try jsUnwrap(jsUnwrap(rootView, "cssClasses").cssClasses, "add").add(
|
|
417
418
|
NativeScriptKit.CSSUtils.ROOT_VIEW_CSS_CLASS)
|
|
418
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:390)
|
|
419
|
-
let rootViewCssClasses: JSArray<String>? = NativeScriptKit.CSSUtils.getSystemCssClasses()
|
|
420
419
|
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:391)
|
|
420
|
+
let rootViewCssClasses: JSArray<String>? = NativeScriptKit.CSSUtils.getSystemCssClasses()
|
|
421
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:392)
|
|
421
422
|
try jsUnwrap(rootViewCssClasses, "forEach").forEach({ (c: String) throws -> Void in
|
|
422
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
423
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:392)
|
|
423
424
|
try _ = jsObjectRequired(jsUnwrap(jsUnwrap(rootView, "cssClasses").cssClasses, "add").add(c))
|
|
424
425
|
})
|
|
425
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
426
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:396)
|
|
426
427
|
if jsTruthy(orientation) {
|
|
427
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
428
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:397)
|
|
428
429
|
_ = try jsUnwrap(jsUnwrap(rootView, "cssClasses").cssClasses, "add").add(
|
|
429
430
|
"\(NativeScriptKit.CSSUtils.CLASS_PREFIX)\(orientation)")
|
|
430
431
|
}
|
|
431
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
432
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:400)
|
|
432
433
|
if jsTruthy(systemAppearance as Any?) {
|
|
433
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
434
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:401)
|
|
434
435
|
_ = try jsUnwrap(jsUnwrap(rootView, "cssClasses").cssClasses, "add").add(
|
|
435
436
|
"\(NativeScriptKit.CSSUtils.CLASS_PREFIX)\(jsToString(systemAppearance as Any?))")
|
|
436
437
|
}
|
|
437
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
438
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:404)
|
|
438
439
|
if jsTruthy(layoutDirection as Any?) {
|
|
439
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
440
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:405)
|
|
440
441
|
_ = try jsUnwrap(jsUnwrap(rootView, "cssClasses").cssClasses, "add").add(
|
|
441
442
|
"\(NativeScriptKit.CSSUtils.CLASS_PREFIX)\(jsToString(layoutDirection as Any?))")
|
|
442
443
|
}
|
|
443
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:407)
|
|
444
|
-
try self.increaseStyleScopeApplicationCssSelectorVersion(rootView)
|
|
445
444
|
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:408)
|
|
445
|
+
try self.increaseStyleScopeApplicationCssSelectorVersion(rootView)
|
|
446
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:409)
|
|
446
447
|
try jsUnwrap(rootView, "_onCssStateChange")._onCssStateChange()
|
|
447
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
448
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:411)
|
|
448
449
|
if NativeScriptKit.Trace.isEnabled() {
|
|
449
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
450
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:412)
|
|
450
451
|
let rootCssClasses: JSArray<String>? = try JSArray<String>.from(
|
|
451
452
|
jsObjectRequired(jsUnwrap(rootView, "cssClasses").cssClasses))
|
|
452
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
453
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:413)
|
|
453
454
|
try NativeScriptKit.Trace.write(
|
|
454
455
|
"Setting root css classes: \(jsUnwrap(rootCssClasses, "join").join(" "))",
|
|
455
456
|
NativeScriptKit.Trace.categories.Style)
|
|
@@ -475,20 +476,20 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
475
476
|
}
|
|
476
477
|
/// @returns The main entry of the application
|
|
477
478
|
open func getMainEntry() -> Any? {
|
|
478
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
479
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:438)
|
|
479
480
|
return Core_application_helpers_common.getAppMainEntry()
|
|
480
481
|
}
|
|
481
482
|
#sourceLocation()
|
|
482
483
|
/// Sets the callback that supplies the UI for windows that need content.
|
|
483
484
|
/// Pass `null` to remove a previously set resolver.
|
|
484
485
|
open func setWindowContentResolver(_ resolver: ((Any?) throws -> Any?)?) {
|
|
485
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
486
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:446)
|
|
486
487
|
self._windowContentResolver = (resolver ?? nil)
|
|
487
488
|
}
|
|
488
489
|
#sourceLocation()
|
|
489
490
|
/// @returns The callback currently supplying window content, if any.
|
|
490
491
|
open func getWindowContentResolver() -> ((Any?) throws -> Any?)? {
|
|
491
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
492
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:453)
|
|
492
493
|
return self._windowContentResolver
|
|
493
494
|
}
|
|
494
495
|
#sourceLocation()
|
|
@@ -497,23 +498,23 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
497
498
|
/// Defaults to the view-carrying app windows (`application` and `embedded`).
|
|
498
499
|
/// Pass `'all'` to include every registered surface, including ones that carry no view tree.
|
|
499
500
|
open func getWindows(_ role: Any? = nil) throws -> JSArray<WindowBase>? {
|
|
500
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
501
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:492)
|
|
501
502
|
if jsStrictEquals(role, "all") {
|
|
502
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
503
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:493)
|
|
503
504
|
return try jsImplicit(
|
|
504
505
|
JSArray<WindowBase>(Array(jsIterated(self._windows, "this._windows is not iterable")))
|
|
505
506
|
).map { JSArray<WindowBase>($0.storage.map { $0 as WindowBase }) }
|
|
506
507
|
}
|
|
507
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
508
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:495)
|
|
508
509
|
let roles: JSArray<String>? =
|
|
509
510
|
(jsTruthy(role)
|
|
510
511
|
? ((JSArray<Any?>.isArray(role)
|
|
511
512
|
? jsArrayOrNil(role, { jsLenientString($0) }) : JSArray<String>([jsLenientString(role)])))
|
|
512
513
|
: JSArray<String>(["application", "embedded"]))
|
|
513
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
514
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:496)
|
|
514
515
|
return try jsImplicit(
|
|
515
516
|
jsUnwrap(self._windows, "filter").filter({ (nw: NativeWindow?) throws -> Bool in
|
|
516
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
517
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:496)
|
|
517
518
|
return try jsUnwrap(roles, "indexOf").indexOf(jsUnwrap(nw, "role").role) != -1
|
|
518
519
|
})
|
|
519
520
|
).map { JSArray<WindowBase>($0.storage.map { $0 as WindowBase }) }
|
|
@@ -521,10 +522,10 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
521
522
|
#sourceLocation()
|
|
522
523
|
/// Get a registered NativeWindow by its id.
|
|
523
524
|
open func getWindowById(_ id: String) throws -> NativeWindow? {
|
|
524
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
525
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:503)
|
|
525
526
|
return try jsImplicit(
|
|
526
527
|
jsUnwrap(self._windows, "find").find({ (nw: NativeWindow?) throws -> Bool in
|
|
527
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
528
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:503)
|
|
528
529
|
return try jsStringEquals(jsUnwrap(nw, "id").id, id)
|
|
529
530
|
}))
|
|
530
531
|
}
|
|
@@ -533,26 +534,26 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
533
534
|
///
|
|
534
535
|
/// @param options Options for the new window, including data to hand to it.
|
|
535
536
|
open func openWindow(_ options: Any? = nil) throws {
|
|
536
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
537
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:512)
|
|
537
538
|
throw JSException(value: JSError("openWindow() is not supported on this platform."))
|
|
538
539
|
}
|
|
539
540
|
#sourceLocation()
|
|
540
541
|
public final func openWindow__ApplicationCommon(_ options: Any? = nil) throws {
|
|
541
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
542
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:512)
|
|
542
543
|
throw JSException(value: JSError("openWindow() is not supported on this platform."))
|
|
543
544
|
}
|
|
544
545
|
#sourceLocation()
|
|
545
546
|
/// @internal - Get all registered NativeWindows, whatever their role.
|
|
546
547
|
open func _getWindows() throws -> JSArray<NativeWindow>? {
|
|
547
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
548
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:519)
|
|
548
549
|
return try JSArray<NativeWindow>(Array(jsIterated(self._windows, "this._windows is not iterable")))
|
|
549
550
|
}
|
|
550
551
|
#sourceLocation()
|
|
551
552
|
/// @internal - Register a NativeWindow created by the platform lifecycle.
|
|
552
553
|
open func _registerWindow(_ nativeWindow: NativeWindow?) throws {
|
|
553
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
554
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:526)
|
|
554
555
|
_ = try jsUnwrap(self._windows, "push").push(jsObjectRequired(nativeWindow))
|
|
555
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
556
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:529)
|
|
556
557
|
try jsUnwrap(nativeWindow, "on").on(
|
|
557
558
|
jsUnwrap(Core_native_window_native_window_interfaces.NativeWindowEvents, "activate").activate,
|
|
558
559
|
FunctionCell_EventDataOpt_to_Void.adapting(
|
|
@@ -562,14 +563,14 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
562
563
|
try withExtendedLifetime(__i) { () throws -> Void in try __r.onWindowActivated(__p0) }
|
|
563
564
|
})
|
|
564
565
|
}.f), self)
|
|
565
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
566
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:531)
|
|
566
567
|
if try jsUnwrap(nativeWindow, "isPrimary").isPrimary {
|
|
567
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
568
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:532)
|
|
568
569
|
try self.trackPrimaryWindowTraits(nativeWindow)
|
|
569
570
|
}
|
|
570
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
571
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:535)
|
|
571
572
|
try self._onWindowRegistered(nativeWindow)
|
|
572
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
573
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:537)
|
|
573
574
|
try jsCallable(self.notify, "this.notify")(
|
|
574
575
|
Object_eventName_object_window(eventName: self.windowOpenEvent, object: self, window: nativeWindow))
|
|
575
576
|
}
|
|
@@ -584,84 +585,84 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
584
585
|
/// detached windows are retired. Ids matching no window are ignored: they routinely
|
|
585
586
|
/// belong to windows this JS context has never seen.
|
|
586
587
|
open func _retireDiscardedWindows(_ ids: JSArray<String>?) throws {
|
|
587
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
588
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:556)
|
|
588
589
|
for id in try jsIterated(ids, "ids is not iterable") {
|
|
589
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
590
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:557)
|
|
590
591
|
let nativeWindow: NativeWindow? = try (jsTruthy(id) ? self.getWindowById(id) : nil)
|
|
591
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
592
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:559)
|
|
592
593
|
if !jsTruthy(nativeWindow as Any?) {
|
|
593
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
594
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:560)
|
|
594
595
|
continue
|
|
595
596
|
}
|
|
596
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
597
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:563)
|
|
597
598
|
if try jsStringEquals(jsUnwrap(nativeWindow, "state").state, "attached") {
|
|
598
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
599
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:564)
|
|
599
600
|
try NativeScriptKit.Trace.write(
|
|
600
601
|
"Ignoring a discarded session for window '\(id)': its surface is still attached.",
|
|
601
602
|
NativeScriptKit.Trace.categories.NativeLifecycle, NativeScriptKit.Trace.messageType.warn)
|
|
602
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
603
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:566)
|
|
603
604
|
continue
|
|
604
605
|
}
|
|
605
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
606
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:569)
|
|
606
607
|
try jsUnwrap(nativeWindow, "_notifyEvent")._notifyEvent(
|
|
607
608
|
jsUnwrap(Core_native_window_native_window_interfaces.NativeWindowEvents, "close").close)
|
|
608
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
609
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:570)
|
|
609
610
|
try self._unregisterWindow(nativeWindow)
|
|
610
611
|
}
|
|
611
612
|
}
|
|
612
613
|
#sourceLocation()
|
|
613
614
|
/// @internal - Unregister a NativeWindow when its native surface is gone for good.
|
|
614
615
|
open func _unregisterWindow(_ nativeWindow: NativeWindow?) throws {
|
|
615
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
616
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:578)
|
|
616
617
|
if try !(jsUnwrap(nativeWindow, "_surfaceGone")._surfaceGone) {
|
|
617
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
618
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:579)
|
|
618
619
|
try NativeScriptKit.Trace.write(
|
|
619
620
|
"Unregistering window '\(jsUnwrap(nativeWindow, "id").id)' while its native surface is still live. A window may only be retired once the platform has reported the surface gone.",
|
|
620
621
|
NativeScriptKit.Trace.categories.NativeLifecycle, NativeScriptKit.Trace.messageType.error)
|
|
621
622
|
}
|
|
622
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:581)
|
|
623
|
-
let idx: Double = try jsUnwrap(self._windows, "indexOf").indexOf(jsObjectRequired(nativeWindow))
|
|
624
623
|
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:582)
|
|
624
|
+
let idx: Double = try jsUnwrap(self._windows, "indexOf").indexOf(jsObjectRequired(nativeWindow))
|
|
625
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:583)
|
|
625
626
|
if idx >= 0 {
|
|
626
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
627
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:584)
|
|
627
628
|
_ = try jsUnwrap(self._windows, "splice").splice(idx, 1)
|
|
628
629
|
}
|
|
629
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
630
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:587)
|
|
630
631
|
if Core_application_helpers_common.getActiveWindow() === nativeWindow {
|
|
631
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
632
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:588)
|
|
632
633
|
Core_application_helpers_common.setActiveWindow(nil)
|
|
633
634
|
}
|
|
634
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
635
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:591)
|
|
635
636
|
try jsCallable(self.notify, "this.notify")(
|
|
636
637
|
Object_eventName_object_window(eventName: self.windowCloseEvent, object: self, window: nativeWindow))
|
|
637
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
638
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:598)
|
|
638
639
|
if try jsUnwrap(nativeWindow, "isPrimary").isPrimary {
|
|
639
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
640
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:599)
|
|
640
641
|
try jsUnwrap(nativeWindow, "_setIsPrimary")._setIsPrimary(false)
|
|
641
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
642
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:601)
|
|
642
643
|
let promoted: NativeWindow? = try jsUnwrap(
|
|
643
644
|
try jsImplicit(self.getWindows()).map {
|
|
644
645
|
JSArray<NativeWindow>(try $0.storage.map { try (jsCastPresent($0) as NativeWindow) })
|
|
645
646
|
}, "find"
|
|
646
647
|
).find({ (nw: NativeWindow?) throws -> Bool in
|
|
647
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
648
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:601)
|
|
648
649
|
return try jsStringEquals(jsUnwrap(nw, "state").state, "attached")
|
|
649
650
|
})
|
|
650
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
651
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:602)
|
|
651
652
|
try self.trackPrimaryWindowTraits(promoted)
|
|
652
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
653
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:604)
|
|
653
654
|
if jsTruthy(promoted as Any?) {
|
|
654
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:604)
|
|
655
|
-
try jsUnwrap(promoted, "_setIsPrimary")._setIsPrimary(true)
|
|
656
655
|
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:605)
|
|
657
|
-
try
|
|
656
|
+
try jsUnwrap(promoted, "_setIsPrimary")._setIsPrimary(true)
|
|
658
657
|
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:606)
|
|
658
|
+
try self._onPrimaryWindowPromoted(promoted)
|
|
659
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:607)
|
|
659
660
|
try jsCallable(self.notify, "this.notify")(
|
|
660
661
|
Object_eventName_object_window(
|
|
661
662
|
eventName: self.primaryWindowChangedEvent, object: self, window: promoted))
|
|
662
663
|
}
|
|
663
664
|
}
|
|
664
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
665
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:615)
|
|
665
666
|
try jsUnwrap(nativeWindow, "_destroy")._destroy()
|
|
666
667
|
}
|
|
667
668
|
#sourceLocation()
|
|
@@ -684,18 +685,18 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
684
685
|
/// Points the application-level orientation, appearance and layout direction at the
|
|
685
686
|
/// primary window, which owns those values now that each window has its own.
|
|
686
687
|
open func trackPrimaryWindowTraits(_ nativeWindow: NativeWindow?) throws {
|
|
687
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:642)
|
|
688
|
-
let target: NativeWindow? = (nativeWindow ?? nil)
|
|
689
688
|
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:643)
|
|
689
|
+
let target: NativeWindow? = (nativeWindow ?? nil)
|
|
690
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:644)
|
|
690
691
|
if self._traitsWindow === target {
|
|
691
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
692
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:645)
|
|
692
693
|
return
|
|
693
694
|
}
|
|
694
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:647)
|
|
695
|
-
let previous: NativeWindow? = self._traitsWindow
|
|
696
695
|
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:648)
|
|
696
|
+
let previous: NativeWindow? = self._traitsWindow
|
|
697
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:649)
|
|
697
698
|
if jsTruthy(previous) {
|
|
698
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
699
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:650)
|
|
699
700
|
try jsUnwrap(previous, "off").off(
|
|
700
701
|
jsUnwrap(Core_native_window_native_window_interfaces.NativeWindowEvents, "orientationChanged")
|
|
701
702
|
.orientationChanged,
|
|
@@ -708,7 +709,7 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
708
709
|
}
|
|
709
710
|
})
|
|
710
711
|
}.f), self)
|
|
711
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
712
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:651)
|
|
712
713
|
try jsUnwrap(previous, "off").off(
|
|
713
714
|
jsUnwrap(Core_native_window_native_window_interfaces.NativeWindowEvents, "systemAppearanceChanged")
|
|
714
715
|
.systemAppearanceChanged,
|
|
@@ -721,7 +722,7 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
721
722
|
}
|
|
722
723
|
})
|
|
723
724
|
}.f), self)
|
|
724
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
725
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:652)
|
|
725
726
|
try jsUnwrap(previous, "off").off(
|
|
726
727
|
jsUnwrap(Core_native_window_native_window_interfaces.NativeWindowEvents, "layoutDirectionChanged")
|
|
727
728
|
.layoutDirectionChanged,
|
|
@@ -735,14 +736,14 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
735
736
|
})
|
|
736
737
|
}.f), self)
|
|
737
738
|
}
|
|
738
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
739
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:655)
|
|
739
740
|
self._traitsWindow = target
|
|
740
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
741
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:657)
|
|
741
742
|
if !jsTruthy(target) {
|
|
742
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
743
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:658)
|
|
743
744
|
return
|
|
744
745
|
}
|
|
745
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
746
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:661)
|
|
746
747
|
try jsUnwrap(target, "on").on(
|
|
747
748
|
jsUnwrap(Core_native_window_native_window_interfaces.NativeWindowEvents, "orientationChanged")
|
|
748
749
|
.orientationChanged,
|
|
@@ -753,7 +754,7 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
753
754
|
try withExtendedLifetime(__i) { () throws -> Void in try __r.onWindowOrientationChanged(__p0) }
|
|
754
755
|
})
|
|
755
756
|
}.f), self)
|
|
756
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
757
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:662)
|
|
757
758
|
try jsUnwrap(target, "on").on(
|
|
758
759
|
jsUnwrap(Core_native_window_native_window_interfaces.NativeWindowEvents, "systemAppearanceChanged")
|
|
759
760
|
.systemAppearanceChanged,
|
|
@@ -766,7 +767,7 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
766
767
|
}
|
|
767
768
|
})
|
|
768
769
|
}.f), self)
|
|
769
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
770
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:663)
|
|
770
771
|
try jsUnwrap(target, "on").on(
|
|
771
772
|
jsUnwrap(Core_native_window_native_window_interfaces.NativeWindowEvents, "layoutDirectionChanged")
|
|
772
773
|
.layoutDirectionChanged,
|
|
@@ -779,7 +780,7 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
779
780
|
}
|
|
780
781
|
})
|
|
781
782
|
}.f), self)
|
|
782
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
783
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:665)
|
|
783
784
|
try self.syncTraitsFromWindow(target)
|
|
784
785
|
}
|
|
785
786
|
#sourceLocation()
|
|
@@ -787,88 +788,104 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
787
788
|
/// previous application state for it to differ from — while a later promotion raises
|
|
788
789
|
/// the change events, because app code observed the outgoing window's values.
|
|
789
790
|
open func syncTraitsFromWindow(_ nativeWindow: NativeWindow?) throws {
|
|
790
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:673)
|
|
791
|
-
let orientation: String = try jsUnwrap(nativeWindow, "orientation").orientation()
|
|
792
791
|
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:674)
|
|
792
|
+
let orientation: String = try jsUnwrap(nativeWindow, "orientation").orientation()
|
|
793
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:675)
|
|
793
794
|
if jsTruthy(orientation) {
|
|
794
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
795
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:676)
|
|
795
796
|
if self._orientation == nil {
|
|
796
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
797
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:677)
|
|
797
798
|
self._orientation = orientation
|
|
798
799
|
} else {
|
|
799
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
800
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:679)
|
|
800
801
|
try self.setOrientation(orientation)
|
|
801
802
|
}
|
|
802
803
|
}
|
|
803
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:682)
|
|
804
|
-
let systemAppearance: String? = try jsUnwrap(nativeWindow, "systemAppearance").systemAppearance()
|
|
805
804
|
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:683)
|
|
805
|
+
let systemAppearance: String? = try jsUnwrap(nativeWindow, "systemAppearance").systemAppearance()
|
|
806
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:684)
|
|
806
807
|
if jsTruthy(systemAppearance as Any?) {
|
|
807
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
808
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:685)
|
|
808
809
|
if self._systemAppearance == nil {
|
|
809
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
810
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:686)
|
|
810
811
|
self._systemAppearance = systemAppearance
|
|
811
812
|
} else {
|
|
812
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
813
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:688)
|
|
813
814
|
try self.setSystemAppearance((systemAppearance ?? "undefined"))
|
|
814
815
|
}
|
|
815
816
|
}
|
|
816
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:691)
|
|
817
|
-
let layoutDirection: String? = try jsUnwrap(nativeWindow, "layoutDirection").layoutDirection()
|
|
818
817
|
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:692)
|
|
818
|
+
let layoutDirection: String? = try jsUnwrap(nativeWindow, "layoutDirection").layoutDirection()
|
|
819
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:693)
|
|
819
820
|
if jsTruthy(layoutDirection as Any?) {
|
|
820
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
821
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:694)
|
|
821
822
|
if self._layoutDirection == nil {
|
|
822
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
823
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:695)
|
|
823
824
|
self._layoutDirection = layoutDirection
|
|
824
825
|
} else {
|
|
825
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
826
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:697)
|
|
826
827
|
try self.setLayoutDirection((layoutDirection ?? "undefined"))
|
|
827
828
|
}
|
|
828
829
|
}
|
|
829
830
|
}
|
|
830
831
|
#sourceLocation()
|
|
831
832
|
open func onWindowActivated(_ data: Any?) throws {
|
|
832
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
833
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:703)
|
|
833
834
|
try Core_application_helpers_common.setActiveWindow((jsCast(jsGet(data, "window"), NativeWindow.self)))
|
|
834
835
|
}
|
|
835
836
|
#sourceLocation()
|
|
836
837
|
open func onWindowOrientationChanged(_ data: Any?) throws {
|
|
837
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
838
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:707)
|
|
838
839
|
try self.setOrientation(jsConvertedString(jsGet(data, "newValue")))
|
|
839
840
|
}
|
|
840
841
|
#sourceLocation()
|
|
841
842
|
open func onWindowSystemAppearanceChanged(_ data: Any?) throws {
|
|
842
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
843
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:711)
|
|
843
844
|
try self.setSystemAppearance(jsConvertedString(jsGet(data, "newValue")))
|
|
844
845
|
}
|
|
845
846
|
#sourceLocation()
|
|
846
847
|
open func onWindowLayoutDirectionChanged(_ data: Any?) throws {
|
|
847
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
848
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:715)
|
|
848
849
|
try self.setLayoutDirection(jsConvertedString(jsGet(data, "newValue")))
|
|
849
850
|
}
|
|
850
851
|
#sourceLocation()
|
|
851
852
|
/// @internal - raises `ready` at most once per JS context.
|
|
852
853
|
open func notifyReady() throws {
|
|
853
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
854
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:722)
|
|
854
855
|
if self._readyNotified {
|
|
855
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
856
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:723)
|
|
856
857
|
return
|
|
857
858
|
}
|
|
858
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:724)
|
|
859
|
-
self._readyNotified = true
|
|
860
859
|
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:725)
|
|
860
|
+
self._readyNotified = true
|
|
861
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:726)
|
|
861
862
|
_ = try jsCallMethod(Core_globals_global_utils.getNativeScriptGlobals(), "setLaunched")
|
|
862
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
863
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:728)
|
|
863
864
|
try jsCallable(self.notify, "this.notify")(
|
|
864
865
|
JSObject([("eventName", self.readyEvent), ("object", self), ("ios", self.ios), ("android", self.android)]))
|
|
865
866
|
}
|
|
866
867
|
#sourceLocation()
|
|
868
|
+
/// @internal - raises `exit` and re-arms the legacy `launch` bridge, since the process
|
|
869
|
+
/// can outlive the exit and open a new first window.
|
|
870
|
+
open func notifyExit(_ data: Any? = nil) throws {
|
|
871
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:741)
|
|
872
|
+
self._launchBridgeConsumed = false
|
|
873
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:743)
|
|
874
|
+
try jsCallable(self.notify, "this.notify")(
|
|
875
|
+
{ () -> JSObject in
|
|
876
|
+
let __o_1 = JSObject()
|
|
877
|
+
__o_1["eventName"] = self.exitEvent
|
|
878
|
+
__o_1["object"] = self
|
|
879
|
+
jsObjectSpread(__o_1, data)
|
|
880
|
+
return __o_1
|
|
881
|
+
}())
|
|
882
|
+
}
|
|
883
|
+
#sourceLocation()
|
|
867
884
|
/// @internal - produces the content for a window that has none.
|
|
868
885
|
///
|
|
869
886
|
/// Resolution order: the window content resolver, then the legacy `launch` event
|
|
870
|
-
/// (offered to the first window that asks for content and to
|
|
871
|
-
/// application main entry. A resolver or a `launch` handler returning `null` takes
|
|
887
|
+
/// (offered to the first window that asks for content, and again to the first one after
|
|
888
|
+
/// `exit`), then the application main entry. A resolver or a `launch` handler returning `null` takes
|
|
872
889
|
/// ownership of the content, so nothing else is tried. A missing main entry leaves
|
|
873
890
|
/// the window empty instead of throwing, because content can still arrive later
|
|
874
891
|
/// through `run()`/`resetRootView()`.
|
|
@@ -878,75 +895,75 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
878
895
|
/// @param options.launchData platform payload merged into the legacy `launch` event args.
|
|
879
896
|
/// @returns The resolved view, or `null` when no content was produced.
|
|
880
897
|
open func _resolveWindowContent(_ window: NativeWindow?, _ request: Any?, _ options: Any? = nil) throws -> View? {
|
|
881
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
898
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:766)
|
|
882
899
|
let content: Any? = try self.resolveWindowContent(request, jsGetIfPresent(options, "launchData"))
|
|
883
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
900
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:768)
|
|
884
901
|
if jsIsNullish(content) {
|
|
885
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
902
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:769)
|
|
886
903
|
return nil
|
|
887
904
|
}
|
|
888
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
905
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:772)
|
|
889
906
|
if try jsStrictEquals(jsGetIfPresent(options, "install"), false) {
|
|
890
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
907
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:773)
|
|
891
908
|
return try self.buildContentView(content)
|
|
892
909
|
}
|
|
893
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
910
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:776)
|
|
894
911
|
try jsUnwrap(window, "setContent").setContent(content)
|
|
895
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
912
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:778)
|
|
896
913
|
return try jsUnwrap(window, "rootView").rootView
|
|
897
914
|
}
|
|
898
915
|
#sourceLocation()
|
|
899
916
|
open func resolveWindowContent(_ request: Any?, _ launchData: Any? = nil) throws -> Any? {
|
|
900
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
917
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:782)
|
|
901
918
|
let launchBridgeAvailable: Bool = !self._launchBridgeConsumed
|
|
902
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
919
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:783)
|
|
903
920
|
self._launchBridgeConsumed = true
|
|
904
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
921
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:785)
|
|
905
922
|
let resolver: ((Any?) throws -> Any?)? = self._windowContentResolver
|
|
906
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
923
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:786)
|
|
907
924
|
if jsTruthy(resolver) {
|
|
908
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
925
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:787)
|
|
909
926
|
let resolved: Any? = try jsCallable(resolver, "resolver")(request)
|
|
910
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
927
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:790)
|
|
911
928
|
if !jsStrictEquals(resolved, nil) {
|
|
912
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
929
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:791)
|
|
913
930
|
try self._ensureAppCssLoaded()
|
|
914
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
931
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:793)
|
|
915
932
|
return resolved
|
|
916
933
|
}
|
|
917
934
|
}
|
|
918
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
935
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:797)
|
|
919
936
|
if launchBridgeAvailable {
|
|
920
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
937
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:798)
|
|
921
938
|
let root: View? = try self.notifyLaunch(launchData)
|
|
922
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
939
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:800)
|
|
923
940
|
if false {
|
|
924
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
941
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:801)
|
|
925
942
|
return jsNull
|
|
926
943
|
}
|
|
927
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
944
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:804)
|
|
928
945
|
if jsTruthy(root) {
|
|
929
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
946
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:805)
|
|
930
947
|
return root
|
|
931
948
|
}
|
|
932
949
|
}
|
|
933
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
950
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:809)
|
|
934
951
|
try self._ensureAppCssLoaded()
|
|
935
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
952
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:811)
|
|
936
953
|
let mainEntry: Any? = Core_application_helpers_common.getAppMainEntry()
|
|
937
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
954
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:813)
|
|
938
955
|
return try ((jsTruthy(mainEntry) ? Builder.createViewFromEntry(mainEntry) : nil) as Any?)
|
|
939
956
|
}
|
|
940
957
|
#sourceLocation()
|
|
941
958
|
open func buildContentView(_ content: Any?) throws -> View? {
|
|
942
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
959
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:817)
|
|
943
960
|
if jsStringEquals(jsTypeof(content), "string") {
|
|
944
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
961
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:818)
|
|
945
962
|
return try jsImplicit(Builder.createViewFromEntry(JSObject([("moduleName", jsLenientString(content))])))
|
|
946
963
|
}
|
|
947
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
964
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:821)
|
|
948
965
|
let entry: Any? = content
|
|
949
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
966
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:823)
|
|
950
967
|
return try
|
|
951
968
|
((jsTruthy(jsGet(entry, "moduleName")) || jsTruthy(jsGet(entry, "create")))
|
|
952
969
|
? jsImplicit(Builder.createViewFromEntry(entry)) : (try jsCast(content, View.self)))
|
|
@@ -955,90 +972,90 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
955
972
|
/// Loads the app CSS once per JS context. On the legacy `launch` path this has to run
|
|
956
973
|
/// after the handlers, which are allowed to call `setCssFileName()`.
|
|
957
974
|
open func _ensureAppCssLoaded() throws {
|
|
958
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
975
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:831)
|
|
959
976
|
if self._appCssLoaded {
|
|
960
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
977
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:832)
|
|
961
978
|
return
|
|
962
979
|
}
|
|
963
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
980
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:834)
|
|
964
981
|
self._appCssLoaded = true
|
|
965
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
982
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:836)
|
|
966
983
|
try self.loadAppCss()
|
|
967
984
|
}
|
|
968
985
|
#sourceLocation()
|
|
969
986
|
open func notifyLaunch(_ additionalLanchEventData: Any? = nil) throws -> View? {
|
|
970
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
987
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:841)
|
|
971
988
|
self._launchBridgeConsumed = true
|
|
972
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
989
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:843)
|
|
973
990
|
let launchArgs: Any? = { () -> JSObject in
|
|
974
|
-
let
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
jsObjectSpread(
|
|
980
|
-
return
|
|
991
|
+
let __o_2 = JSObject()
|
|
992
|
+
__o_2["eventName"] = self.launchEvent
|
|
993
|
+
__o_2["object"] = self
|
|
994
|
+
__o_2["ios"] = self.ios
|
|
995
|
+
__o_2["android"] = self.android
|
|
996
|
+
jsObjectSpread(__o_2, additionalLanchEventData)
|
|
997
|
+
return __o_2
|
|
981
998
|
}()
|
|
982
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
999
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:850)
|
|
983
1000
|
try jsCallable(self.notify, "this.notify")(launchArgs)
|
|
984
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1001
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:851)
|
|
985
1002
|
try self._ensureAppCssLoaded()
|
|
986
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1003
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:853)
|
|
987
1004
|
return try (jsCast(jsGet(launchArgs, "root"), View.self))
|
|
988
1005
|
}
|
|
989
1006
|
#sourceLocation()
|
|
990
1007
|
open func createRootView(
|
|
991
1008
|
_ view: View? = nil, _ fireLaunchEvent: Bool = false, _ additionalLanchEventData: Any? = nil
|
|
992
1009
|
) throws -> View? {
|
|
993
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1010
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:858)
|
|
994
1011
|
var rootView: View? = view
|
|
995
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1012
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:860)
|
|
996
1013
|
if !jsTruthy(rootView as Any?) {
|
|
997
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1014
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:861)
|
|
998
1015
|
if fireLaunchEvent {
|
|
999
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1016
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:862)
|
|
1000
1017
|
rootView = try self.notifyLaunch(additionalLanchEventData)
|
|
1001
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1018
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:865)
|
|
1002
1019
|
if rootView == nil {
|
|
1003
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1020
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:866)
|
|
1004
1021
|
return nil
|
|
1005
1022
|
}
|
|
1006
1023
|
}
|
|
1007
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1024
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:870)
|
|
1008
1025
|
if !jsTruthy(rootView as Any?) {
|
|
1009
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1026
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:872)
|
|
1010
1027
|
if !jsTruthy(Core_application_helpers_common.getAppMainEntry()) {
|
|
1011
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1028
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:873)
|
|
1012
1029
|
throw JSException(
|
|
1013
1030
|
value: JSError("Main entry is missing. App cannot be started. Verify app bootstrap."))
|
|
1014
1031
|
}
|
|
1015
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1032
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:876)
|
|
1016
1033
|
rootView = try Builder.createViewFromEntry(Core_application_helpers_common.getAppMainEntry())
|
|
1017
1034
|
}
|
|
1018
1035
|
}
|
|
1019
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1036
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:880)
|
|
1020
1037
|
return rootView
|
|
1021
1038
|
}
|
|
1022
1039
|
#sourceLocation()
|
|
1023
1040
|
open func getRootView() throws -> View? {
|
|
1024
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1041
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:884)
|
|
1025
1042
|
throw JSException(value: JSError("getRootView() Not implemented."))
|
|
1026
1043
|
}
|
|
1027
1044
|
#sourceLocation()
|
|
1028
1045
|
public final func getRootView__ApplicationCommon() throws -> View? {
|
|
1029
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1046
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:884)
|
|
1030
1047
|
throw JSException(value: JSError("getRootView() Not implemented."))
|
|
1031
1048
|
}
|
|
1032
1049
|
#sourceLocation()
|
|
1033
1050
|
open func resetRootView(_ entry: Any? = nil) throws {
|
|
1034
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1051
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:888)
|
|
1035
1052
|
Core_application_helpers_common.setAppMainEntry(
|
|
1036
1053
|
(jsStringEquals(jsTypeof(entry), "string")
|
|
1037
1054
|
? (JSObject([("moduleName", jsLenientString(entry))]) as Any?) : entry))
|
|
1038
1055
|
}
|
|
1039
1056
|
#sourceLocation()
|
|
1040
1057
|
public final func resetRootView__ApplicationCommon(_ entry: Any? = nil) throws {
|
|
1041
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1058
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:888)
|
|
1042
1059
|
Core_application_helpers_common.setAppMainEntry(
|
|
1043
1060
|
(jsStringEquals(jsTypeof(entry), "string")
|
|
1044
1061
|
? (JSObject([("moduleName", jsLenientString(entry))]) as Any?) : entry))
|
|
@@ -1047,43 +1064,43 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
1047
1064
|
/// @param window the window the root view belongs to. Supplies the window-scoped CSS
|
|
1048
1065
|
/// classes; without it they come from the primary window.
|
|
1049
1066
|
open func initRootView(_ rootView: View?, _ window: NativeWindow? = nil) throws {
|
|
1050
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1067
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:897)
|
|
1051
1068
|
try self.setRootViewCSSClasses(rootView, jsImplicit(window))
|
|
1052
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1069
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:898)
|
|
1053
1070
|
try Core_accessibility_accessibility_common.readyInitAccessibilityCssHelper()
|
|
1054
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1071
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:899)
|
|
1055
1072
|
try Core_accessibility_accessibility_common.readyInitFontScale()
|
|
1056
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1073
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:900)
|
|
1057
1074
|
try Core_accessibility_accessibility_common.applyAccessibilityCssToRoot(rootView)
|
|
1058
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1075
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:901)
|
|
1059
1076
|
try jsCallable(self.notify, "this.notify")(
|
|
1060
1077
|
JSObject([("eventName", self.initRootViewEvent), ("rootView", rootView as Any?)]))
|
|
1061
1078
|
}
|
|
1062
1079
|
#sourceLocation()
|
|
1063
1080
|
/// Get application level static resources.
|
|
1064
1081
|
open func getResources() throws -> Any? {
|
|
1065
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1082
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:908)
|
|
1066
1083
|
return try Core_ui_core_bindable_bindable_resources.get()
|
|
1067
1084
|
}
|
|
1068
1085
|
#sourceLocation()
|
|
1069
1086
|
/// Set application level static resources.
|
|
1070
1087
|
open func setResources(_ res: Any?) throws {
|
|
1071
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1088
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:915)
|
|
1072
1089
|
try Core_ui_core_bindable_bindable_resources.set(res)
|
|
1073
1090
|
}
|
|
1074
1091
|
#sourceLocation()
|
|
1075
1092
|
/// Sets css file name for the application.
|
|
1076
1093
|
open func setCssFileName(_ cssFileName: String) throws {
|
|
1077
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1094
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:922)
|
|
1078
1095
|
self._cssFile = cssFileName
|
|
1079
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1096
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:923)
|
|
1080
1097
|
try jsCallable(self.notify, "this.notify")(
|
|
1081
1098
|
JSObject([("eventName", self.cssChangedEvent), ("object", self), ("cssFile", cssFileName)]))
|
|
1082
1099
|
}
|
|
1083
1100
|
#sourceLocation()
|
|
1084
1101
|
/// Gets css file name for the application.
|
|
1085
1102
|
open func getCssFileName() -> String {
|
|
1086
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1103
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:934)
|
|
1087
1104
|
return self._cssFile
|
|
1088
1105
|
}
|
|
1089
1106
|
#sourceLocation()
|
|
@@ -1092,18 +1109,18 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
1092
1109
|
/// For the Android snapshot the CSS can be parsed during the snapshot generation,
|
|
1093
1110
|
/// as the CSS does not depend on runtime APIs, and loadAppCss will be called explicitly.
|
|
1094
1111
|
open func loadAppCss() throws {
|
|
1095
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1112
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:944)
|
|
1096
1113
|
do {
|
|
1097
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1114
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:945)
|
|
1098
1115
|
try jsCallable(self.notify, "this.notify")(
|
|
1099
1116
|
JSObject([
|
|
1100
1117
|
("eventName", self.loadAppCssEvent), ("object", self), ("ios", self.ios), ("android", self.android),
|
|
1101
1118
|
("cssFile", self.getCssFileName()),
|
|
1102
1119
|
]))
|
|
1103
1120
|
} catch {
|
|
1104
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1121
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:953)
|
|
1105
1122
|
if NativeScriptKit.Trace.isEnabled() {
|
|
1106
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1123
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:954)
|
|
1107
1124
|
try NativeScriptKit.Trace.write(
|
|
1108
1125
|
"The app CSS file \(self.getCssFileName()) couldn't be loaded!",
|
|
1109
1126
|
NativeScriptKit.Trace.categories.Style, NativeScriptKit.Trace.messageType.warn)
|
|
@@ -1112,54 +1129,54 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
1112
1129
|
}
|
|
1113
1130
|
#sourceLocation()
|
|
1114
1131
|
open func addCss(_ cssText: String, _ attributeScoped: Bool? = nil) throws {
|
|
1115
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1132
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:960)
|
|
1116
1133
|
try jsCallable(self.notify, "this.notify")(
|
|
1117
1134
|
JSObject([("eventName", self.cssChangedEvent), ("object", self), ("cssText", cssText)]))
|
|
1118
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1135
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:965)
|
|
1119
1136
|
if !jsTruthy(attributeScoped as Any?) {
|
|
1120
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1137
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:966)
|
|
1121
1138
|
let rootView: View? = try self.getRootView()
|
|
1122
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1139
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:967)
|
|
1123
1140
|
if jsTruthy(rootView) {
|
|
1124
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1141
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:968)
|
|
1125
1142
|
try jsUnwrap(rootView, "_onCssStateChange")._onCssStateChange()
|
|
1126
1143
|
}
|
|
1127
1144
|
}
|
|
1128
1145
|
}
|
|
1129
1146
|
#sourceLocation()
|
|
1130
1147
|
open func run(_ entry: Any? = nil) throws {
|
|
1131
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1148
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:974)
|
|
1132
1149
|
throw JSException(value: JSError("run() Not implemented."))
|
|
1133
1150
|
}
|
|
1134
1151
|
#sourceLocation()
|
|
1135
1152
|
public final func run__ApplicationCommon(_ entry: Any? = nil) throws {
|
|
1136
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1153
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:974)
|
|
1137
1154
|
throw JSException(value: JSError("run() Not implemented."))
|
|
1138
1155
|
}
|
|
1139
1156
|
#sourceLocation()
|
|
1140
1157
|
open func getOrientation() throws -> String {
|
|
1141
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1158
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:979)
|
|
1142
1159
|
throw JSException(value: JSError("getOrientation() not implemented"))
|
|
1143
1160
|
}
|
|
1144
1161
|
#sourceLocation()
|
|
1145
1162
|
public final func getOrientation__ApplicationCommon() throws -> String {
|
|
1146
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1163
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:979)
|
|
1147
1164
|
throw JSException(value: JSError("getOrientation() not implemented"))
|
|
1148
1165
|
}
|
|
1149
1166
|
#sourceLocation()
|
|
1150
1167
|
open func setOrientation(_ value: String) throws {
|
|
1151
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1168
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:983)
|
|
1152
1169
|
if jsStringEquals(self._orientation, value) {
|
|
1153
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1170
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:984)
|
|
1154
1171
|
return
|
|
1155
1172
|
}
|
|
1156
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1173
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:987)
|
|
1157
1174
|
self._orientation = value
|
|
1158
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1175
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:991)
|
|
1159
1176
|
try jsUnwrap(Screen.mainScreen, "_updateMetrics")._updateMetrics()
|
|
1160
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1177
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:993)
|
|
1161
1178
|
try self.orientationChanged(self.getRootView(), value)
|
|
1162
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1179
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:994)
|
|
1163
1180
|
try jsCallable(self.notify, "this.notify")(
|
|
1164
1181
|
JSObject([
|
|
1165
1182
|
("eventName", self.orientationChangedEvent), ("android", self.android), ("ios", self.ios),
|
|
@@ -1169,7 +1186,7 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
1169
1186
|
#sourceLocation()
|
|
1170
1187
|
/// @deprecated Use Application.primaryWindow?.orientation() - or the NativeWindow of the relevant view - instead. Continues to reflect the primary window.
|
|
1171
1188
|
open func orientation() throws -> String {
|
|
1172
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1189
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1007)
|
|
1173
1190
|
return try
|
|
1174
1191
|
(((self.primaryWindow as NativeWindow?)?.orientation())
|
|
1175
1192
|
?? (({ () throws -> String in
|
|
@@ -1179,67 +1196,67 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
1179
1196
|
}
|
|
1180
1197
|
#sourceLocation()
|
|
1181
1198
|
open func orientationChanged(_ rootView: View?, _ newOrientation: String) throws {
|
|
1182
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1199
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1011)
|
|
1183
1200
|
if !jsTruthy(rootView) {
|
|
1184
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1201
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1012)
|
|
1185
1202
|
return
|
|
1186
1203
|
}
|
|
1187
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1204
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1015)
|
|
1188
1205
|
let newOrientationCssClass: String = "\(NativeScriptKit.CSSUtils.CLASS_PREFIX)\(newOrientation)"
|
|
1189
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1206
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1016)
|
|
1190
1207
|
try self.applyWindowScopedCssClass(
|
|
1191
1208
|
rootView, Core_application_application_common.ORIENTATION_CSS_CLASSES, newOrientationCssClass)
|
|
1192
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1209
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1018)
|
|
1193
1210
|
try jsUnwrap(self.getOwnedModalViews(rootView), "forEach").forEach({ (rootModalView: View?) throws -> Void in
|
|
1194
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1211
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1019)
|
|
1195
1212
|
try self.applyWindowScopedCssClass(
|
|
1196
1213
|
rootModalView, Core_application_application_common.ORIENTATION_CSS_CLASSES, newOrientationCssClass)
|
|
1197
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1214
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1022)
|
|
1198
1215
|
try jsUnwrap(rootModalView, "_onCssStateChange")._onCssStateChange()
|
|
1199
1216
|
})
|
|
1200
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1217
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1026)
|
|
1201
1218
|
try jsUnwrap(rootView, "_onCssStateChange")._onCssStateChange()
|
|
1202
1219
|
}
|
|
1203
1220
|
#sourceLocation()
|
|
1204
1221
|
open func getNativeApplication() throws -> Any? {
|
|
1205
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1222
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1031)
|
|
1206
1223
|
throw JSException(value: JSError("getNativeApplication() not implemented"))
|
|
1207
1224
|
}
|
|
1208
1225
|
#sourceLocation()
|
|
1209
1226
|
public final func getNativeApplication__ApplicationCommon() throws -> Any? {
|
|
1210
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1227
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1031)
|
|
1211
1228
|
throw JSException(value: JSError("getNativeApplication() not implemented"))
|
|
1212
1229
|
}
|
|
1213
1230
|
#sourceLocation()
|
|
1214
1231
|
open func hasLaunched() throws -> Bool {
|
|
1215
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1232
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1035)
|
|
1216
1233
|
return try jsConvertedBool(jsGet(Core_globals_global_utils.getNativeScriptGlobals(), "launched"))
|
|
1217
1234
|
}
|
|
1218
1235
|
#sourceLocation()
|
|
1219
1236
|
open func getSystemAppearance() throws -> String? {
|
|
1220
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1237
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1040)
|
|
1221
1238
|
throw JSException(value: JSError("getSystemAppearance() not implemented"))
|
|
1222
1239
|
}
|
|
1223
1240
|
#sourceLocation()
|
|
1224
1241
|
public final func getSystemAppearance__ApplicationCommon() throws -> String? {
|
|
1225
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1242
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1040)
|
|
1226
1243
|
throw JSException(value: JSError("getSystemAppearance() not implemented"))
|
|
1227
1244
|
}
|
|
1228
1245
|
#sourceLocation()
|
|
1229
1246
|
open func setSystemAppearance(_ value: String) throws {
|
|
1230
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1247
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1044)
|
|
1231
1248
|
if jsStringEquals(self._systemAppearance, value) {
|
|
1232
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1249
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1045)
|
|
1233
1250
|
return
|
|
1234
1251
|
}
|
|
1235
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1252
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1047)
|
|
1236
1253
|
self._systemAppearance = value
|
|
1237
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1254
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1048)
|
|
1238
1255
|
if self.autoSystemAppearanceChanged {
|
|
1239
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1256
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1049)
|
|
1240
1257
|
try self.systemAppearanceChanged(self.getRootView(), value)
|
|
1241
1258
|
}
|
|
1242
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1259
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1051)
|
|
1243
1260
|
try jsCallable(self.notify, "this.notify")(
|
|
1244
1261
|
JSObject([
|
|
1245
1262
|
("eventName", self.systemAppearanceChangedEvent), ("android", self.android), ("ios", self.ios),
|
|
@@ -1249,7 +1266,7 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
1249
1266
|
#sourceLocation()
|
|
1250
1267
|
/// @deprecated Use Application.primaryWindow?.systemAppearance() - or the NativeWindow of the relevant view - instead. Continues to reflect the primary window.
|
|
1251
1268
|
open func systemAppearance() throws -> String? {
|
|
1252
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1269
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1064)
|
|
1253
1270
|
return try
|
|
1254
1271
|
((self.primaryWindow as NativeWindow?)?.systemAppearance()
|
|
1255
1272
|
?? ({ () throws -> String? in
|
|
@@ -1260,7 +1277,7 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
1260
1277
|
#sourceLocation()
|
|
1261
1278
|
/// enable/disable systemAppearanceChanged
|
|
1262
1279
|
open func setAutoSystemAppearanceChanged(_ value: Bool) {
|
|
1263
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1280
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1071)
|
|
1264
1281
|
Core_application_helpers_common.setAutoSystemAppearanceChanged(value)
|
|
1265
1282
|
}
|
|
1266
1283
|
#sourceLocation()
|
|
@@ -1268,50 +1285,50 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
1268
1285
|
/// @param rootView the root view
|
|
1269
1286
|
/// @param newSystemAppearance the new appearance change
|
|
1270
1287
|
open func systemAppearanceChanged(_ rootView: View?, _ newSystemAppearance: String) throws {
|
|
1271
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1288
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1080)
|
|
1272
1289
|
if !jsTruthy(rootView) {
|
|
1273
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1290
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1081)
|
|
1274
1291
|
return
|
|
1275
1292
|
}
|
|
1276
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1293
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1084)
|
|
1277
1294
|
let newSystemAppearanceCssClass: String = "\(NativeScriptKit.CSSUtils.CLASS_PREFIX)\(newSystemAppearance)"
|
|
1278
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1295
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1085)
|
|
1279
1296
|
try self.applyWindowScopedCssClass(
|
|
1280
1297
|
rootView, Core_application_application_common.SYSTEM_APPEARANCE_CSS_CLASSES, newSystemAppearanceCssClass)
|
|
1281
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1298
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1087)
|
|
1282
1299
|
try jsUnwrap(self.getOwnedModalViews(rootView), "forEach").forEach({ (rootModalView: View?) throws -> Void in
|
|
1283
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1300
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1088)
|
|
1284
1301
|
try self.applyWindowScopedCssClass(
|
|
1285
1302
|
rootModalView, Core_application_application_common.SYSTEM_APPEARANCE_CSS_CLASSES,
|
|
1286
1303
|
newSystemAppearanceCssClass)
|
|
1287
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1304
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1091)
|
|
1288
1305
|
try jsUnwrap(rootModalView, "_onCssStateChange")._onCssStateChange()
|
|
1289
1306
|
})
|
|
1290
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1307
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1095)
|
|
1291
1308
|
try jsUnwrap(rootView, "_onCssStateChange")._onCssStateChange()
|
|
1292
1309
|
}
|
|
1293
1310
|
#sourceLocation()
|
|
1294
1311
|
open func getLayoutDirection() throws -> String? {
|
|
1295
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1312
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1100)
|
|
1296
1313
|
throw JSException(value: JSError("getLayoutDirection() not implemented"))
|
|
1297
1314
|
}
|
|
1298
1315
|
#sourceLocation()
|
|
1299
1316
|
public final func getLayoutDirection__ApplicationCommon() throws -> String? {
|
|
1300
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1317
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1100)
|
|
1301
1318
|
throw JSException(value: JSError("getLayoutDirection() not implemented"))
|
|
1302
1319
|
}
|
|
1303
1320
|
#sourceLocation()
|
|
1304
1321
|
open func setLayoutDirection(_ value: String) throws {
|
|
1305
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1322
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1104)
|
|
1306
1323
|
if jsStringEquals(self._layoutDirection, value) {
|
|
1307
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1324
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1105)
|
|
1308
1325
|
return
|
|
1309
1326
|
}
|
|
1310
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1327
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1107)
|
|
1311
1328
|
self._layoutDirection = value
|
|
1312
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1329
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1108)
|
|
1313
1330
|
try self.layoutDirectionChanged(self.getRootView(), value)
|
|
1314
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1331
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1109)
|
|
1315
1332
|
try jsCallable(self.notify, "this.notify")(
|
|
1316
1333
|
JSObject([
|
|
1317
1334
|
("eventName", self.layoutDirectionChangedEvent), ("android", self.android), ("ios", self.ios),
|
|
@@ -1321,7 +1338,7 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
1321
1338
|
#sourceLocation()
|
|
1322
1339
|
/// @deprecated Use Application.primaryWindow?.layoutDirection() - or the NativeWindow of the relevant view - instead. Continues to reflect the primary window.
|
|
1323
1340
|
open func layoutDirection() throws -> String? {
|
|
1324
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1341
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1122)
|
|
1325
1342
|
return try
|
|
1326
1343
|
((self.primaryWindow as NativeWindow?)?.layoutDirection()
|
|
1327
1344
|
?? ({ () throws -> String? in
|
|
@@ -1334,57 +1351,57 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
1334
1351
|
/// @param rootView the root view
|
|
1335
1352
|
/// @param newLayoutDirection the new layout direction change
|
|
1336
1353
|
open func layoutDirectionChanged(_ rootView: View?, _ newLayoutDirection: String) throws {
|
|
1337
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1354
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1131)
|
|
1338
1355
|
if !jsTruthy(rootView) {
|
|
1339
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1356
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1132)
|
|
1340
1357
|
return
|
|
1341
1358
|
}
|
|
1342
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1359
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1135)
|
|
1343
1360
|
let newLayoutDirectionCssClass: String = "\(NativeScriptKit.CSSUtils.CLASS_PREFIX)\(newLayoutDirection)"
|
|
1344
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1361
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1136)
|
|
1345
1362
|
try self.applyWindowScopedCssClass(
|
|
1346
1363
|
rootView, Core_application_application_common.LAYOUT_DIRECTION_CSS_CLASSES, newLayoutDirectionCssClass)
|
|
1347
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1364
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1138)
|
|
1348
1365
|
try jsUnwrap(self.getOwnedModalViews(rootView), "forEach").forEach({ (rootModalView: View?) throws -> Void in
|
|
1349
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1366
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1139)
|
|
1350
1367
|
try self.applyWindowScopedCssClass(
|
|
1351
1368
|
rootModalView, Core_application_application_common.LAYOUT_DIRECTION_CSS_CLASSES,
|
|
1352
1369
|
newLayoutDirectionCssClass)
|
|
1353
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1370
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1142)
|
|
1354
1371
|
try jsUnwrap(rootModalView, "_onCssStateChange")._onCssStateChange()
|
|
1355
1372
|
})
|
|
1356
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1373
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1146)
|
|
1357
1374
|
try jsUnwrap(rootView, "_onCssStateChange")._onCssStateChange()
|
|
1358
1375
|
}
|
|
1359
1376
|
#sourceLocation()
|
|
1360
1377
|
open func setInBackground(_ value: Bool, _ additonalData: Any? = nil) throws {
|
|
1361
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1378
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1154)
|
|
1362
1379
|
Core_application_helpers_common.setAppInBackground(value)
|
|
1363
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1380
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1156)
|
|
1364
1381
|
try jsCallable(self.notify, "this.notify")(
|
|
1365
1382
|
{ () -> JSObject in
|
|
1366
|
-
let
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
jsObjectSpread(
|
|
1371
|
-
return
|
|
1383
|
+
let __o_3 = JSObject()
|
|
1384
|
+
__o_3["eventName"] = (value ? self.backgroundEvent : self.foregroundEvent)
|
|
1385
|
+
__o_3["object"] = self
|
|
1386
|
+
__o_3["ios"] = self.ios
|
|
1387
|
+
jsObjectSpread(__o_3, additonalData)
|
|
1388
|
+
return __o_3
|
|
1372
1389
|
}())
|
|
1373
1390
|
}
|
|
1374
1391
|
#sourceLocation()
|
|
1375
1392
|
open func setSuspended(_ value: Bool, _ additonalData: Any? = nil) throws {
|
|
1376
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1393
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1170)
|
|
1377
1394
|
self._suspended = value
|
|
1378
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
1395
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1172)
|
|
1379
1396
|
try jsCallable(self.notify, "this.notify")(
|
|
1380
1397
|
{ () -> JSObject in
|
|
1381
|
-
let
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
jsObjectSpread(
|
|
1387
|
-
return
|
|
1398
|
+
let __o_4 = JSObject()
|
|
1399
|
+
__o_4["eventName"] = (value ? self.suspendEvent : self.resumeEvent)
|
|
1400
|
+
__o_4["object"] = self
|
|
1401
|
+
__o_4["ios"] = self.ios
|
|
1402
|
+
__o_4["android"] = self.android
|
|
1403
|
+
jsObjectSpread(__o_4, additonalData)
|
|
1404
|
+
return __o_4
|
|
1388
1405
|
}())
|
|
1389
1406
|
}
|
|
1390
1407
|
#sourceLocation()
|
|
@@ -1463,6 +1480,7 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
1463
1480
|
case "getWindows":
|
|
1464
1481
|
return FunctionCell_AnyOpt_to_JSArray_WindowBase_Opt.script("getWindows", 1, self.getWindows)
|
|
1465
1482
|
case "openWindow": return FunctionCell_AnyOpt_to_Void.script("openWindow", 1, self.openWindow)
|
|
1483
|
+
case "notifyExit": return FunctionCell_AnyOpt_to_Void.script("notifyExit", 1, self.notifyExit)
|
|
1466
1484
|
case "loadAppCss": return FunctionCell_none_to_Void.script("loadAppCss", 0, self.loadAppCss)
|
|
1467
1485
|
default: break
|
|
1468
1486
|
}
|
|
@@ -2090,20 +2108,20 @@ public func __init_Core_application_application_common() {
|
|
|
2090
2108
|
jsCallMethod(
|
|
2091
2109
|
jsGet(Core_application_application_common.globalEvents, "hasListeners"), "bind",
|
|
2092
2110
|
Core_application_application_common.globalEvents))
|
|
2093
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
2111
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1199)
|
|
2094
2112
|
Core_module_name_resolver_helpers.prepareAppForModuleResolver({ () throws -> Void in
|
|
2095
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
2113
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1200)
|
|
2096
2114
|
try jsCallable(ApplicationCommon.on, "ApplicationCommon.on")(
|
|
2097
2115
|
"livesync",
|
|
2098
2116
|
{ (args: Any?) throws -> Void in
|
|
2099
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
2117
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1200)
|
|
2100
2118
|
try Core_module_name_resolver_helpers.clearResolverCache()
|
|
2101
2119
|
}, nil)
|
|
2102
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
2120
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1201)
|
|
2103
2121
|
try jsCallable(ApplicationCommon.on, "ApplicationCommon.on")(
|
|
2104
2122
|
"orientationChanged",
|
|
2105
2123
|
{ (args: Any?) -> Void in
|
|
2106
|
-
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:
|
|
2124
|
+
#sourceLocation(file:"@nativescript/core/application.application-common.ts",line:1202)
|
|
2107
2125
|
Core_module_name_resolver_helpers._setResolver(nil)
|
|
2108
2126
|
}, nil)
|
|
2109
2127
|
})
|