@akylas/nativescript 9.0.25 → 9.1.4
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/abortcontroller/abortsignal.js.map +1 -1
- package/abortcontroller/index.js.map +1 -1
- package/accessibility/accessibility-common.js.map +1 -1
- package/accessibility/accessibility-css-helper.js.map +1 -1
- package/accessibility/accessibility-properties.js.map +1 -1
- package/accessibility/accessibility-service-common.js.map +1 -1
- package/accessibility/accessibility-service.android.js.map +1 -1
- package/accessibility/accessibility-service.ios.js.map +1 -1
- package/accessibility/accessibility-types.js.map +1 -1
- package/accessibility/font-scale-common.js.map +1 -1
- package/accessibility/font-scale.android.js.map +1 -1
- package/accessibility/font-scale.ios.js.map +1 -1
- package/accessibility/index.android.js.map +1 -1
- package/accessibility/index.ios.js.map +1 -1
- package/animation-frame/animation-native.android.js.map +1 -1
- package/animation-frame/animation-native.ios.js.map +1 -1
- package/animation-frame/index.js.map +1 -1
- package/application/application-common.d.ts +199 -3
- package/application/application-common.js +425 -55
- package/application/application-common.js.map +1 -1
- package/application/application-interfaces.d.ts +67 -1
- package/application/application-interfaces.js.map +1 -1
- package/application/application-shims.js.map +1 -1
- package/application/application.android.d.ts +39 -0
- package/application/application.android.js +242 -17
- package/application/application.android.js.map +1 -1
- package/application/application.d.ts +161 -54
- package/application/application.ios.d.ts +189 -28
- package/application/application.ios.js +885 -379
- package/application/application.ios.js.map +1 -1
- package/application/helpers-common.d.ts +5 -0
- package/application/helpers-common.js +23 -1
- package/application/helpers-common.js.map +1 -1
- package/application/helpers.android.js.map +1 -1
- package/application/helpers.ios.js.map +1 -1
- package/application/index.android.js.map +1 -1
- package/application/index.ios.js.map +1 -1
- package/application/scene-delegate-bridge.d.ts +60 -0
- package/application/scene-delegate-bridge.js +138 -0
- package/application/scene-delegate-bridge.js.map +1 -0
- package/application-settings/application-settings-common.js.map +1 -1
- package/application-settings/index.android.js.map +1 -1
- package/application-settings/index.ios.js.map +1 -1
- package/bundle-entry-points.js.map +1 -1
- package/cli-hooks/before-checkForChanges.mjs +0 -11
- package/color/color-common.js +16 -5
- package/color/color-common.js.map +1 -1
- package/color/color-types.js.map +1 -1
- package/color/color-utils.d.ts +4 -1
- package/color/color-utils.js +14 -9
- package/color/color-utils.js.map +1 -1
- package/color/index.android.js.map +1 -1
- package/color/index.ios.js.map +1 -1
- package/color/known-colors.js.map +1 -1
- package/config/config.interface.d.ts +44 -2
- package/config/config.interface.js.map +1 -1
- package/config/index.js.map +1 -1
- package/connectivity/index.android.js.map +1 -1
- package/connectivity/index.ios.js.map +1 -1
- package/console/index.js.map +1 -1
- package/core-types/animation-types.js.map +1 -1
- package/core-types/index.d.ts +25 -2
- package/core-types/index.js +23 -0
- package/core-types/index.js.map +1 -1
- package/core-types/validators.js.map +1 -1
- package/css/CSS3Parser.js +3 -2
- package/css/CSS3Parser.js.map +1 -1
- package/css/CSSNativeScript.js.map +1 -1
- package/css/css-tree-parser.js +5 -1
- package/css/css-tree-parser.js.map +1 -1
- package/css/lib/parse/index.js +5 -1
- package/css/lib/parse/index.js.map +1 -1
- package/css/parser.js +20 -3
- package/css/parser.js.map +1 -1
- package/css/reworkcss.js.map +1 -1
- package/css/system-classes.d.ts +9 -0
- package/css/system-classes.js +23 -0
- package/css/system-classes.js.map +1 -1
- package/css-mediaquery/index.js +4 -4
- package/css-mediaquery/index.js.map +1 -1
- package/css-value/reworkcss-value.js.map +1 -1
- package/data/observable/index.d.ts +23 -0
- package/data/observable/index.js +50 -9
- package/data/observable/index.js.map +1 -1
- package/data/observable-array/index.js.map +1 -1
- package/data/virtual-array/index.js.map +1 -1
- package/debugger/InspectorBackendCommands.js.map +1 -1
- package/debugger/devtools-elements-interfaces.js.map +1 -1
- package/debugger/devtools-elements.common.js.map +1 -1
- package/debugger/devtools-elements.js.map +1 -1
- package/debugger/dom-types.js +31 -1
- package/debugger/dom-types.js.map +1 -1
- package/debugger/index.js.map +1 -1
- package/debugger/webinspector-css.js.map +1 -1
- package/debugger/webinspector-dom.js.map +1 -1
- package/debugger/webinspector-network.android.js.map +1 -1
- package/debugger/webinspector-network.ios.js.map +1 -1
- package/file-system/file-system-access.android.js.map +1 -1
- package/file-system/file-system-access.ios.js +21 -13
- package/file-system/file-system-access.ios.js.map +1 -1
- package/file-system/index.d.ts +3 -3
- package/file-system/index.js.map +1 -1
- package/fps-meter/fps-native.android.js.map +1 -1
- package/fps-meter/fps-native.ios.js.map +1 -1
- package/fps-meter/index.js.map +1 -1
- package/global-types.d.ts +39 -33
- package/globals/global-utils.d.ts +6 -1
- package/globals/global-utils.js +10 -5
- package/globals/global-utils.js.map +1 -1
- package/globals/index.js +18 -5
- package/globals/index.js.map +1 -1
- package/globals/polyfills/polyfill-xhr.js.map +1 -1
- package/globals/polyfills/utils.js +2 -0
- package/globals/polyfills/utils.js.map +1 -1
- package/http/http-interfaces.js.map +1 -1
- package/http/http-request/http-request-common.js.map +1 -1
- package/http/http-request/index.android.js.map +1 -1
- package/http/http-request/index.ios.js.map +1 -1
- package/http/http-request-internal/http-request-internal-common.d.ts +5 -1
- package/http/http-request-internal/http-request-internal-common.js +10 -0
- package/http/http-request-internal/http-request-internal-common.js.map +1 -1
- package/http/http-request-internal/index.android.d.ts +7 -1
- package/http/http-request-internal/index.android.js +2 -2
- package/http/http-request-internal/index.android.js.map +1 -1
- package/http/http-request-internal/index.ios.d.ts +7 -1
- package/http/http-request-internal/index.ios.js +2 -2
- package/http/http-request-internal/index.ios.js.map +1 -1
- package/http/index.js.map +1 -1
- package/image-asset/image-asset-common.js.map +1 -1
- package/image-asset/index.android.js.map +1 -1
- package/image-asset/index.ios.js.map +1 -1
- package/image-source/image-source-common.js.map +1 -1
- package/image-source/index.android.js.map +1 -1
- package/image-source/index.ios.js.map +1 -1
- package/index.d.ts +2 -0
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/inspector_modules.js +1 -1
- package/inspector_modules.js.map +1 -1
- package/matrix/index.js.map +1 -1
- package/media-query-list/index.js.map +1 -1
- package/module-name-resolver/helpers.js.map +1 -1
- package/module-name-resolver/index.js.map +1 -1
- package/module-name-resolver/non-bundle-workflow-compat.js.map +1 -1
- package/module-name-resolver/qualifier-matcher/index.js.map +1 -1
- package/native-window/index.d.ts +426 -0
- package/native-window/index.js +4 -0
- package/native-window/index.js.map +1 -0
- package/native-window/native-window-common.d.ts +153 -0
- package/native-window/native-window-common.js +340 -0
- package/native-window/native-window-common.js.map +1 -0
- package/native-window/native-window-interfaces.d.ts +186 -0
- package/native-window/native-window-interfaces.js +90 -0
- package/native-window/native-window-interfaces.js.map +1 -0
- package/native-window/native-window.android.d.ts +59 -0
- package/native-window/native-window.android.js +175 -0
- package/native-window/native-window.android.js.map +1 -0
- package/native-window/native-window.ios.d.ts +61 -0
- package/native-window/native-window.ios.js +220 -0
- package/native-window/native-window.ios.js.map +1 -0
- package/native-window/window-base.d.ts +111 -0
- package/native-window/window-base.js +91 -0
- package/native-window/window-base.js.map +1 -0
- package/package.json +3 -2
- package/platform/common.js.map +1 -1
- package/platform/device/index.android.js.map +1 -1
- package/platform/device/index.ios.js.map +1 -1
- package/platform/index.js.map +1 -1
- package/platform/screen/index.android.js.map +1 -1
- package/platform/screen/index.ios.d.ts +1 -0
- package/platform/screen/index.ios.js +6 -2
- package/platform/screen/index.ios.js.map +1 -1
- package/platforms/android/java/org/nativescript/widgets/BorderDrawable.java +5 -6
- package/platforms/android/java/org/nativescript/widgets/BoxShadowDrawable.java +0 -6
- package/platforms/android/java/org/nativescript/widgets/CommonLayoutParams.java +56 -0
- package/platforms/android/java/org/nativescript/widgets/ContentLayout.java +20 -4
- package/platforms/android/java/org/nativescript/widgets/CustomTransition.java +26 -9
- package/platforms/android/java/org/nativescript/widgets/FlexLine.java +3 -3
- package/platforms/android/java/org/nativescript/widgets/FlexboxLayout.java +194 -731
- package/platforms/android/java/org/nativescript/widgets/ImageView.java +2 -2
- package/platforms/android/java/org/nativescript/widgets/Utils.java +37 -9
- package/platforms/android/java/org/nativescript/widgets/ViewHelper.java +78 -0
- package/platforms/android/java/org/nativescript/widgets/image/BitmapOwner.java +1 -4
- package/platforms/android/java/org/nativescript/widgets/image/Worker.java +99 -76
- package/platforms/android/native-api-usage.json +11 -0
- package/platforms/ios/src/NativeScriptMainWindow.swift +72 -39
- package/profiling/index.js.map +1 -1
- package/references.d.ts +5 -2
- package/text/formatted-string.js.map +1 -1
- package/text/index.android.js.map +1 -1
- package/text/index.ios.js.map +1 -1
- package/text/span.js.map +1 -1
- package/text/text-common.js +1 -1
- package/text/text-common.js.map +1 -1
- package/timer/index.android.js.map +1 -1
- package/timer/index.ios.js.map +1 -1
- package/trace/index.d.ts +2 -2
- package/trace/index.js.map +1 -1
- package/ui/action-bar/action-bar-common.js.map +1 -1
- package/ui/action-bar/index.android.js +2 -7
- package/ui/action-bar/index.android.js.map +1 -1
- package/ui/action-bar/index.d.ts +13 -1
- package/ui/action-bar/index.ios.js +26 -0
- package/ui/action-bar/index.ios.js.map +1 -1
- package/ui/activity-indicator/activity-indicator-common.js.map +1 -1
- package/ui/activity-indicator/index.android.js.map +1 -1
- package/ui/activity-indicator/index.ios.js.map +1 -1
- package/ui/animation/animation-common.js.map +1 -1
- package/ui/animation/animation-interfaces.js.map +1 -1
- package/ui/animation/animation-shared.js.map +1 -1
- package/ui/animation/animation-types.js.map +1 -1
- package/ui/animation/index.android.js.map +1 -1
- package/ui/animation/index.ios.js.map +1 -1
- package/ui/animation/keyframe-animation.d.ts +3 -1
- package/ui/animation/keyframe-animation.js +72 -3
- package/ui/animation/keyframe-animation.js.map +1 -1
- package/ui/builder/binding-builder.js.map +1 -1
- package/ui/builder/component-builder/index.js.map +1 -1
- package/ui/builder/index.js +9 -1
- package/ui/builder/index.js.map +1 -1
- package/ui/button/button-common.js.map +1 -1
- package/ui/button/index.android.js.map +1 -1
- package/ui/button/index.ios.js.map +1 -1
- package/ui/content-view/index.js.map +1 -1
- package/ui/core/bindable/bindable-expressions.js.map +1 -1
- package/ui/core/bindable/bindable-resources.js.map +1 -1
- package/ui/core/bindable/bindable-types.js.map +1 -1
- package/ui/core/bindable/index.js +2 -1
- package/ui/core/bindable/index.js.map +1 -1
- package/ui/core/control-state-change/index.android.js.map +1 -1
- package/ui/core/control-state-change/index.ios.js.map +1 -1
- package/ui/core/properties/index.d.ts +37 -2
- package/ui/core/properties/index.js +205 -29
- package/ui/core/properties/index.js.map +1 -1
- package/ui/core/properties/property-shared.js +11 -2
- package/ui/core/properties/property-shared.js.map +1 -1
- package/ui/core/view/index.android.d.ts +5 -0
- package/ui/core/view/index.android.js +78 -6
- package/ui/core/view/index.android.js.map +1 -1
- package/ui/core/view/index.d.ts +58 -1
- package/ui/core/view/index.ios.d.ts +1 -0
- package/ui/core/view/index.ios.js +48 -11
- package/ui/core/view/index.ios.js.map +1 -1
- package/ui/core/view/view-common.d.ts +37 -0
- package/ui/core/view/view-common.js +81 -0
- package/ui/core/view/view-common.js.map +1 -1
- package/ui/core/view/view-helper/index.android.d.ts +1 -0
- package/ui/core/view/view-helper/index.android.js +8 -0
- package/ui/core/view/view-helper/index.android.js.map +1 -1
- package/ui/core/view/view-helper/index.d.ts +46 -0
- package/ui/core/view/view-helper/index.ios.d.ts +42 -0
- package/ui/core/view/view-helper/index.ios.js +170 -5
- package/ui/core/view/view-helper/index.ios.js.map +1 -1
- package/ui/core/view/view-helper/view-helper-common.js +21 -3
- package/ui/core/view/view-helper/view-helper-common.js.map +1 -1
- package/ui/core/view/view-helper/view-helper-shared.js.map +1 -1
- package/ui/core/view/view-interfaces.js.map +1 -1
- package/ui/core/view-base/index.js +75 -36
- package/ui/core/view-base/index.js.map +1 -1
- package/ui/core/view-base/utils.js.map +1 -1
- package/ui/core/weak-event-listener/index.js.map +1 -1
- package/ui/date-picker/date-picker-common.js.map +1 -1
- package/ui/date-picker/index.android.js.map +1 -1
- package/ui/date-picker/index.ios.js.map +1 -1
- package/ui/dialogs/dialogs-common.js.map +1 -1
- package/ui/dialogs/index.android.js +5 -5
- package/ui/dialogs/index.android.js.map +1 -1
- package/ui/dialogs/index.ios.js.map +1 -1
- package/ui/editable-text-base/editable-text-base-common.js.map +1 -1
- package/ui/editable-text-base/index.android.js +2 -1
- package/ui/editable-text-base/index.android.js.map +1 -1
- package/ui/editable-text-base/index.ios.js.map +1 -1
- package/ui/embedding/index.android.js.map +1 -1
- package/ui/embedding/index.ios.js.map +1 -1
- package/ui/enums/enums.js.map +1 -1
- package/ui/enums/index.js.map +1 -1
- package/ui/frame/activity.android.js.map +1 -1
- package/ui/frame/fragment.android.js.map +1 -1
- package/ui/frame/fragment.ios.js.map +1 -1
- package/ui/frame/fragment.transitions.android.d.ts +4 -4
- package/ui/frame/fragment.transitions.android.js +95 -78
- package/ui/frame/fragment.transitions.android.js.map +1 -1
- package/ui/frame/fragment.transitions.types.js.map +1 -1
- package/ui/frame/frame-common.d.ts +14 -2
- package/ui/frame/frame-common.js +51 -24
- package/ui/frame/frame-common.js.map +1 -1
- package/ui/frame/frame-constants.d.ts +9 -0
- package/ui/frame/frame-constants.js +10 -0
- package/ui/frame/frame-constants.js.map +1 -0
- package/ui/frame/frame-helper-for-android.d.ts +2 -2
- package/ui/frame/frame-helper-for-android.js +14 -5
- package/ui/frame/frame-helper-for-android.js.map +1 -1
- package/ui/frame/frame-helpers.js.map +1 -1
- package/ui/frame/frame-interfaces.d.ts +1 -1
- package/ui/frame/frame-interfaces.js.map +1 -1
- package/ui/frame/frame-stack.d.ts +22 -1
- package/ui/frame/frame-stack.js +43 -5
- package/ui/frame/frame-stack.js.map +1 -1
- package/ui/frame/index.android.d.ts +1 -2
- package/ui/frame/index.android.js +152 -53
- package/ui/frame/index.android.js.map +1 -1
- package/ui/frame/index.d.ts +15 -5
- package/ui/frame/index.ios.d.ts +1 -1
- package/ui/frame/index.ios.js +86 -26
- package/ui/frame/index.ios.js.map +1 -1
- package/ui/gestures/gestures-common.js.map +1 -1
- package/ui/gestures/gestures-types.d.ts +2 -0
- package/ui/gestures/gestures-types.js.map +1 -1
- package/ui/gestures/index.android.d.ts +1 -1
- package/ui/gestures/index.android.js +159 -124
- package/ui/gestures/index.android.js.map +1 -1
- package/ui/gestures/index.ios.js +30 -1
- package/ui/gestures/index.ios.js.map +1 -1
- package/ui/gestures/touch-manager.d.ts +1 -2
- package/ui/gestures/touch-manager.js +79 -50
- package/ui/gestures/touch-manager.js.map +1 -1
- package/ui/html-view/html-view-common.js.map +1 -1
- package/ui/html-view/index.android.js.map +1 -1
- package/ui/html-view/index.ios.js.map +1 -1
- package/ui/image/image-common.js +1 -1
- package/ui/image/image-common.js.map +1 -1
- package/ui/image/index.android.js +13 -1
- package/ui/image/index.android.js.map +1 -1
- package/ui/image/index.ios.js.map +1 -1
- package/ui/image/symbol-effects-common.js.map +1 -1
- package/ui/image/symbol-effects.android.js.map +1 -1
- package/ui/image/symbol-effects.ios.js.map +1 -1
- package/ui/image-cache/image-cache-common.js.map +1 -1
- package/ui/image-cache/index.android.js.map +1 -1
- package/ui/image-cache/index.ios.js.map +1 -1
- package/ui/index.d.ts +1 -1
- package/ui/index.js.map +1 -1
- package/ui/label/index.android.js.map +1 -1
- package/ui/label/index.ios.js.map +1 -1
- package/ui/layouts/absolute-layout/absolute-layout-common.js.map +1 -1
- package/ui/layouts/absolute-layout/index.android.js.map +1 -1
- package/ui/layouts/absolute-layout/index.ios.js +3 -0
- package/ui/layouts/absolute-layout/index.ios.js.map +1 -1
- package/ui/layouts/dock-layout/dock-layout-common.js.map +1 -1
- package/ui/layouts/dock-layout/index.android.js.map +1 -1
- package/ui/layouts/dock-layout/index.ios.js +3 -0
- package/ui/layouts/dock-layout/index.ios.js.map +1 -1
- package/ui/layouts/flexbox-layout/flexbox-layout-common.d.ts +7 -0
- package/ui/layouts/flexbox-layout/flexbox-layout-common.js +18 -0
- package/ui/layouts/flexbox-layout/flexbox-layout-common.js.map +1 -1
- package/ui/layouts/flexbox-layout/index.android.d.ts +5 -0
- package/ui/layouts/flexbox-layout/index.android.js +15 -0
- package/ui/layouts/flexbox-layout/index.android.js.map +1 -1
- package/ui/layouts/flexbox-layout/index.d.ts +19 -1
- package/ui/layouts/flexbox-layout/index.ios.d.ts +2 -0
- package/ui/layouts/flexbox-layout/index.ios.js +246 -195
- package/ui/layouts/flexbox-layout/index.ios.js.map +1 -1
- package/ui/layouts/grid-layout/grid-layout-common.js.map +1 -1
- package/ui/layouts/grid-layout/index.android.js.map +1 -1
- package/ui/layouts/grid-layout/index.ios.js +3 -0
- package/ui/layouts/grid-layout/index.ios.js.map +1 -1
- package/ui/layouts/index.js.map +1 -1
- package/ui/layouts/layout-base-common.d.ts +1 -0
- package/ui/layouts/layout-base-common.js +23 -1
- package/ui/layouts/layout-base-common.js.map +1 -1
- package/ui/layouts/layout-base.android.js.map +1 -1
- package/ui/layouts/layout-base.ios.js.map +1 -1
- package/ui/layouts/liquid-glass/index.android.js.map +1 -1
- package/ui/layouts/liquid-glass/index.ios.d.ts +0 -1
- package/ui/layouts/liquid-glass/index.ios.js +2 -43
- package/ui/layouts/liquid-glass/index.ios.js.map +1 -1
- package/ui/layouts/liquid-glass/liquid-glass-common.js.map +1 -1
- package/ui/layouts/liquid-glass-container/index.android.js.map +1 -1
- package/ui/layouts/liquid-glass-container/index.ios.d.ts +0 -1
- package/ui/layouts/liquid-glass-container/index.ios.js +2 -43
- package/ui/layouts/liquid-glass-container/index.ios.js.map +1 -1
- package/ui/layouts/liquid-glass-container/liquid-glass-container-common.js.map +1 -1
- package/ui/layouts/root-layout/index.android.js.map +1 -1
- package/ui/layouts/root-layout/index.ios.js.map +1 -1
- package/ui/layouts/root-layout/root-layout-common.js.map +1 -1
- package/ui/layouts/root-layout/root-layout-stack.js.map +1 -1
- package/ui/layouts/stack-layout/index.android.js.map +1 -1
- package/ui/layouts/stack-layout/index.ios.js +3 -0
- package/ui/layouts/stack-layout/index.ios.js.map +1 -1
- package/ui/layouts/stack-layout/stack-layout-common.js.map +1 -1
- package/ui/layouts/wrap-layout/index.android.js.map +1 -1
- package/ui/layouts/wrap-layout/index.ios.js +3 -0
- package/ui/layouts/wrap-layout/index.ios.js.map +1 -1
- package/ui/layouts/wrap-layout/wrap-layout-common.js.map +1 -1
- package/ui/list-picker/index.android.js.map +1 -1
- package/ui/list-picker/index.ios.js.map +1 -1
- package/ui/list-picker/list-picker-common.js.map +1 -1
- package/ui/list-view/index.android.js +2 -2
- package/ui/list-view/index.android.js.map +1 -1
- package/ui/list-view/index.d.ts +47 -3
- package/ui/list-view/index.ios.d.ts +13 -3
- package/ui/list-view/index.ios.js +132 -41
- package/ui/list-view/index.ios.js.map +1 -1
- package/ui/list-view/list-view-common.d.ts +19 -0
- package/ui/list-view/list-view-common.js +30 -0
- package/ui/list-view/list-view-common.js.map +1 -1
- package/ui/page/events.js.map +1 -1
- package/ui/page/index.android.js.map +1 -1
- package/ui/page/index.d.ts +1 -1
- package/ui/page/index.ios.d.ts +3 -1
- package/ui/page/index.ios.js +26 -17
- package/ui/page/index.ios.js.map +1 -1
- package/ui/page/page-common.d.ts +5 -1
- package/ui/page/page-common.js.map +1 -1
- package/ui/placeholder/index.android.js.map +1 -1
- package/ui/placeholder/index.js.map +1 -1
- package/ui/placeholder/placeholder-common.js.map +1 -1
- package/ui/progress/index.android.js.map +1 -1
- package/ui/progress/index.ios.js.map +1 -1
- package/ui/progress/progress-common.js.map +1 -1
- package/ui/proxy-view-container/index.js.map +1 -1
- package/ui/repeater/index.d.ts +2 -1
- package/ui/repeater/index.js.map +1 -1
- package/ui/scroll-view/index.android.d.ts +2 -1
- package/ui/scroll-view/index.android.js +4 -1
- package/ui/scroll-view/index.android.js.map +1 -1
- package/ui/scroll-view/index.d.ts +53 -0
- package/ui/scroll-view/index.ios.d.ts +13 -1
- package/ui/scroll-view/index.ios.js +100 -20
- package/ui/scroll-view/index.ios.js.map +1 -1
- package/ui/scroll-view/scroll-view-common.d.ts +13 -0
- package/ui/scroll-view/scroll-view-common.js +27 -0
- package/ui/scroll-view/scroll-view-common.js.map +1 -1
- package/ui/search-bar/index.android.js.map +1 -1
- package/ui/search-bar/index.ios.js.map +1 -1
- package/ui/search-bar/search-bar-common.js.map +1 -1
- package/ui/segmented-bar/index.android.js.map +1 -1
- package/ui/segmented-bar/index.ios.js.map +1 -1
- package/ui/segmented-bar/segmented-bar-common.d.ts +5 -1
- package/ui/segmented-bar/segmented-bar-common.js +6 -1
- package/ui/segmented-bar/segmented-bar-common.js.map +1 -1
- package/ui/slider/index.android.js.map +1 -1
- package/ui/slider/index.ios.js.map +1 -1
- package/ui/slider/slider-common.js.map +1 -1
- package/ui/split-view/index.android.js.map +1 -1
- package/ui/split-view/index.ios.js.map +1 -1
- package/ui/split-view/split-view-common.js.map +1 -1
- package/ui/styling/background-common.d.ts +2 -0
- package/ui/styling/background-common.js +8 -0
- package/ui/styling/background-common.js.map +1 -1
- package/ui/styling/background.android.d.ts +4 -1
- package/ui/styling/background.android.js +5 -2
- package/ui/styling/background.android.js.map +1 -1
- package/ui/styling/background.d.ts +1 -1
- package/ui/styling/background.ios.js +9 -2
- package/ui/styling/background.ios.js.map +1 -1
- package/ui/styling/box-shadow.js.map +1 -1
- package/ui/styling/clip-path-function.js.map +1 -1
- package/ui/styling/converters.js.map +1 -1
- package/ui/styling/css-animation-parser.js.map +1 -1
- package/ui/styling/css-selector.d.ts +60 -13
- package/ui/styling/css-selector.js +311 -50
- package/ui/styling/css-selector.js.map +1 -1
- package/ui/styling/css-shadow.js.map +1 -1
- package/ui/styling/css-stroke.js.map +1 -1
- package/ui/styling/css-transform.js.map +1 -1
- package/ui/styling/css-utils.d.ts +16 -0
- package/ui/styling/css-utils.js +121 -7
- package/ui/styling/css-utils.js.map +1 -1
- package/ui/styling/font-common.js.map +1 -1
- package/ui/styling/font-interfaces.js.map +1 -1
- package/ui/styling/font.android.js.map +1 -1
- package/ui/styling/font.ios.js.map +1 -1
- package/ui/styling/length-shared.d.ts +2 -0
- package/ui/styling/length-shared.js +29 -2
- package/ui/styling/length-shared.js.map +1 -1
- package/ui/styling/linear-gradient.js.map +1 -1
- package/ui/styling/style/index.d.ts +16 -0
- package/ui/styling/style/index.js +1 -0
- package/ui/styling/style/index.js.map +1 -1
- package/ui/styling/style-properties.d.ts +5 -0
- package/ui/styling/style-properties.js +172 -101
- package/ui/styling/style-properties.js.map +1 -1
- package/ui/styling/style-scope.d.ts +24 -3
- package/ui/styling/style-scope.js +455 -63
- package/ui/styling/style-scope.js.map +1 -1
- package/ui/styling/styling-profile.js.map +1 -1
- package/ui/styling/styling-shared.js.map +1 -1
- package/ui/switch/index.android.js.map +1 -1
- package/ui/switch/index.ios.js +5 -1
- package/ui/switch/index.ios.js.map +1 -1
- package/ui/switch/switch-common.js.map +1 -1
- package/ui/tab-view/index.android.js +4 -1
- package/ui/tab-view/index.android.js.map +1 -1
- package/ui/tab-view/index.d.ts +5 -3
- package/ui/tab-view/index.ios.d.ts +2 -1
- package/ui/tab-view/index.ios.js +81 -18
- package/ui/tab-view/index.ios.js.map +1 -1
- package/ui/tab-view/tab-view-common.d.ts +6 -1
- package/ui/tab-view/tab-view-common.js +17 -1
- package/ui/tab-view/tab-view-common.js.map +1 -1
- package/ui/text-base/formatted-string.js.map +1 -1
- package/ui/text-base/index.android.js +5 -8
- package/ui/text-base/index.android.js.map +1 -1
- package/ui/text-base/index.ios.d.ts +3 -0
- package/ui/text-base/index.ios.js +25 -3
- package/ui/text-base/index.ios.js.map +1 -1
- package/ui/text-base/span.js.map +1 -1
- package/ui/text-base/text-base-common.js.map +1 -1
- package/ui/text-field/index.android.js.map +1 -1
- package/ui/text-field/index.ios.js +13 -5
- package/ui/text-field/index.ios.js.map +1 -1
- package/ui/text-field/text-field-common.js.map +1 -1
- package/ui/text-view/index.android.js.map +1 -1
- package/ui/text-view/index.ios.js.map +1 -1
- package/ui/text-view/text-view-common.js.map +1 -1
- package/ui/time-picker/index.android.js.map +1 -1
- package/ui/time-picker/index.ios.js.map +1 -1
- package/ui/time-picker/time-picker-common.js.map +1 -1
- package/ui/transition/fade-transition.android.js.map +1 -1
- package/ui/transition/fade-transition.ios.js.map +1 -1
- package/ui/transition/flip-transition.android.js.map +1 -1
- package/ui/transition/index.android.js.map +1 -1
- package/ui/transition/index.d.ts +2 -1
- package/ui/transition/index.ios.js.map +1 -1
- package/ui/transition/modal-transition.android.js.map +1 -1
- package/ui/transition/modal-transition.ios.js +33 -5
- package/ui/transition/modal-transition.ios.js.map +1 -1
- package/ui/transition/page-transition.android.d.ts +4 -0
- package/ui/transition/page-transition.android.js +174 -45
- package/ui/transition/page-transition.android.js.map +1 -1
- package/ui/transition/page-transition.ios.d.ts +5 -0
- package/ui/transition/page-transition.ios.js +298 -36
- package/ui/transition/page-transition.ios.js.map +1 -1
- package/ui/transition/shared-transition-helper.android.d.ts +3 -0
- package/ui/transition/shared-transition-helper.android.js +9 -0
- package/ui/transition/shared-transition-helper.android.js.map +1 -1
- package/ui/transition/shared-transition-helper.d.ts +7 -0
- package/ui/transition/shared-transition-helper.ios.d.ts +48 -0
- package/ui/transition/shared-transition-helper.ios.js +977 -95
- package/ui/transition/shared-transition-helper.ios.js.map +1 -1
- package/ui/transition/shared-transition.d.ts +134 -0
- package/ui/transition/shared-transition.js +90 -2
- package/ui/transition/shared-transition.js.map +1 -1
- package/ui/transition/slide-transition.android.js.map +1 -1
- package/ui/transition/slide-transition.ios.js.map +1 -1
- package/ui/utils.android.js.map +1 -1
- package/ui/utils.d.ts +2 -0
- package/ui/utils.ios.js.map +1 -1
- package/ui/web-view/index.android.js.map +1 -1
- package/ui/web-view/index.ios.js.map +1 -1
- package/ui/web-view/web-view-common.js.map +1 -1
- package/ui/web-view/web-view-interfaces.js.map +1 -1
- package/utils/animation-helpers.js.map +1 -1
- package/utils/common.js.map +1 -1
- package/utils/constants.android.js.map +1 -1
- package/utils/constants.ios.js.map +1 -1
- package/utils/debug-source.js.map +1 -1
- package/utils/debug.js.map +1 -1
- package/utils/index.android.js.map +1 -1
- package/utils/index.ios.js.map +1 -1
- package/utils/layout-helper/index.android.js.map +1 -1
- package/utils/layout-helper/index.ios.js +11 -3
- package/utils/layout-helper/index.ios.js.map +1 -1
- package/utils/layout-helper/layout-helper-common.js.map +1 -1
- package/utils/layout-helper/layout-helper-shared.js.map +1 -1
- package/utils/lazy.js.map +1 -1
- package/utils/macrotask-scheduler.js.map +1 -1
- package/utils/mainthread-helper.android.js.map +1 -1
- package/utils/mainthread-helper.ios.js.map +1 -1
- package/utils/module-merge.js.map +1 -1
- package/utils/native-helper-for-android.js +6 -2
- package/utils/native-helper-for-android.js.map +1 -1
- package/utils/native-helper.android.d.ts +66 -2
- package/utils/native-helper.android.js.map +1 -1
- package/utils/native-helper.d.ts +2 -2
- package/utils/native-helper.ios.d.ts +52 -2
- package/utils/native-helper.ios.js +35 -5
- package/utils/native-helper.ios.js.map +1 -1
- package/utils/native-helper.types.d.ts +2 -0
- package/utils/number-utils.js.map +1 -1
- package/utils/platform-check.d.ts +1 -1
- package/utils/platform-check.js.map +1 -1
- package/utils/shared.js.map +1 -1
- package/utils/types.js.map +1 -1
- package/utils/utils-shared.js.map +1 -1
- package/wgc/atob.js.map +1 -1
- package/wgc/btoa.js.map +1 -1
- package/wgc/crypto/SubtleCrypto.js.map +1 -1
- package/wgc/crypto/index.d.ts +1 -1
- package/wgc/crypto/index.js +12 -8
- package/wgc/crypto/index.js.map +1 -1
- package/wgc/index.js.map +1 -1
- package/xhr/index.js.map +1 -1
- package/xml/index.js.map +1 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { CoreTypes } from '../core-types';
|
|
2
1
|
import { CSSUtils } from '../css/system-classes';
|
|
3
2
|
import { Device, Screen } from '../platform';
|
|
4
3
|
import { profile } from '../profiling';
|
|
@@ -6,47 +5,75 @@ import { Trace } from '../trace';
|
|
|
6
5
|
import { clearResolverCache, prepareAppForModuleResolver, _setResolver } from '../module-name-resolver/helpers';
|
|
7
6
|
import { Builder } from '../ui/builder';
|
|
8
7
|
import * as bindableResources from '../ui/core/bindable/bindable-resources';
|
|
9
|
-
import { getAppMainEntry, isAppInBackground, setAppInBackground, setAppMainEntry } from './helpers-common';
|
|
8
|
+
import { getActiveWindow, getAppMainEntry, getAutoSystemAppearanceChanged, isAppInBackground, setActiveWindow, setAppInBackground, setAppMainEntry, setAutoSystemAppearanceChanged } from './helpers-common';
|
|
10
9
|
import { getNativeScriptGlobals } from '../globals/global-utils';
|
|
11
10
|
import { SDK_VERSION } from '../utils/constants';
|
|
12
|
-
|
|
13
|
-
const ORIENTATION_CSS_CLASSES =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
`${CSSUtils.CLASS_PREFIX}${CoreTypes.DeviceOrientation.unknown}`,
|
|
17
|
-
];
|
|
18
|
-
// prettier-ignore
|
|
19
|
-
const SYSTEM_APPEARANCE_CSS_CLASSES = [
|
|
20
|
-
`${CSSUtils.CLASS_PREFIX}${CoreTypes.SystemAppearance.light}`,
|
|
21
|
-
`${CSSUtils.CLASS_PREFIX}${CoreTypes.SystemAppearance.dark}`,
|
|
22
|
-
];
|
|
23
|
-
// prettier-ignore
|
|
24
|
-
const LAYOUT_DIRECTION_CSS_CLASSES = [
|
|
25
|
-
`${CSSUtils.CLASS_PREFIX}${CoreTypes.LayoutDirection.ltr}`,
|
|
26
|
-
`${CSSUtils.CLASS_PREFIX}${CoreTypes.LayoutDirection.rtl}`,
|
|
27
|
-
];
|
|
11
|
+
import { NativeWindowEvents, WindowEvents } from '../native-window/native-window-interfaces';
|
|
12
|
+
const ORIENTATION_CSS_CLASSES = CSSUtils.ORIENTATION_CSS_CLASSES;
|
|
13
|
+
const SYSTEM_APPEARANCE_CSS_CLASSES = CSSUtils.SYSTEM_APPEARANCE_CSS_CLASSES;
|
|
14
|
+
const LAYOUT_DIRECTION_CSS_CLASSES = CSSUtils.LAYOUT_DIRECTION_CSS_CLASSES;
|
|
28
15
|
const globalEvents = getNativeScriptGlobals().events;
|
|
29
16
|
// Scene lifecycle event names
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated Use `NativeWindowEvents` from `@nativescript/core/native-window` instead.
|
|
19
|
+
*/
|
|
30
20
|
export const SceneEvents = {
|
|
21
|
+
/** @deprecated Use `NativeWindowEvents.sceneWillConnect` instead. */
|
|
31
22
|
sceneWillConnect: 'sceneWillConnect',
|
|
23
|
+
/** @deprecated Use `NativeWindowEvents.sceneDidActivate` instead. */
|
|
32
24
|
sceneDidActivate: 'sceneDidActivate',
|
|
25
|
+
/** @deprecated Use `NativeWindowEvents.sceneWillResignActive` instead. */
|
|
33
26
|
sceneWillResignActive: 'sceneWillResignActive',
|
|
27
|
+
/** @deprecated Use `NativeWindowEvents.sceneWillEnterForeground` instead. */
|
|
34
28
|
sceneWillEnterForeground: 'sceneWillEnterForeground',
|
|
29
|
+
/** @deprecated Use `NativeWindowEvents.sceneDidEnterBackground` instead. */
|
|
35
30
|
sceneDidEnterBackground: 'sceneDidEnterBackground',
|
|
31
|
+
/** @deprecated Use `NativeWindowEvents.sceneDidDisconnect` instead. */
|
|
36
32
|
sceneDidDisconnect: 'sceneDidDisconnect',
|
|
33
|
+
/** @deprecated Use the Application 'windowOpen' event and NativeWindow.setContent() instead. */
|
|
37
34
|
sceneContentSetup: 'sceneContentSetup',
|
|
38
35
|
};
|
|
39
36
|
export class ApplicationCommon {
|
|
37
|
+
/**
|
|
38
|
+
* Boolean to enable/disable systemAppearanceChanged
|
|
39
|
+
*/
|
|
40
|
+
get autoSystemAppearanceChanged() {
|
|
41
|
+
return getAutoSystemAppearanceChanged();
|
|
42
|
+
}
|
|
43
|
+
set autoSystemAppearanceChanged(value) {
|
|
44
|
+
setAutoSystemAppearanceChanged(value);
|
|
45
|
+
}
|
|
40
46
|
/**
|
|
41
47
|
* @internal - should not be constructed by the user.
|
|
42
48
|
*/
|
|
43
49
|
constructor() {
|
|
50
|
+
/**
|
|
51
|
+
* @deprecated Use the 'ready' event for application initialization and Application.setWindowContentResolver() to provide window UI. 'launch' continues to fire before the first window's content is created, and its 'root' property is still honored, for backwards compatibility. It never fires for additional windows. In a scene-based app it fires with the first window's content, so a background launch that connects no scene does not raise it.
|
|
52
|
+
*/
|
|
44
53
|
this.launchEvent = 'launch';
|
|
54
|
+
/**
|
|
55
|
+
* Raised once per JS context, as soon as the context is initialized. It is never deferred,
|
|
56
|
+
* so it also fires on a background launch where no window is created.
|
|
57
|
+
*
|
|
58
|
+
* Guaranteed ordering: `ready` -> `windowOpen` -> raw connect/create events -> content
|
|
59
|
+
* resolution (the legacy `launch` bridge runs here, for the first window only) ->
|
|
60
|
+
* `contentLoaded` -> `activate`/`displayed`.
|
|
61
|
+
*/
|
|
62
|
+
this.readyEvent = 'ready';
|
|
63
|
+
/**
|
|
64
|
+
* Reflects whole-app state: with multiple windows it is raised once the app itself is
|
|
65
|
+
* no longer in the foreground, not when an individual window backgrounds. Listen on a
|
|
66
|
+
* NativeWindow for per-window state.
|
|
67
|
+
*/
|
|
45
68
|
this.suspendEvent = 'suspend';
|
|
46
69
|
this.displayedEvent = 'displayed';
|
|
47
70
|
this.backgroundEvent = 'background';
|
|
48
71
|
this.foregroundEvent = 'foreground';
|
|
49
72
|
this.resumeEvent = 'resume';
|
|
73
|
+
/**
|
|
74
|
+
* On Android, raised when the last window closes; the process may stay alive.
|
|
75
|
+
* On iOS, raised when the process itself terminates.
|
|
76
|
+
*/
|
|
50
77
|
this.exitEvent = 'exit';
|
|
51
78
|
this.lowMemoryEvent = 'lowMemory';
|
|
52
79
|
this.uncaughtErrorEvent = 'uncaughtError';
|
|
@@ -59,6 +86,9 @@ export class ApplicationCommon {
|
|
|
59
86
|
this.loadAppCssEvent = 'loadAppCss';
|
|
60
87
|
this.cssChangedEvent = 'cssChanged';
|
|
61
88
|
this.initRootViewEvent = 'initRootView';
|
|
89
|
+
this.windowOpenEvent = WindowEvents.windowOpen;
|
|
90
|
+
this.windowCloseEvent = WindowEvents.windowClose;
|
|
91
|
+
this.primaryWindowChangedEvent = WindowEvents.primaryWindowChanged;
|
|
62
92
|
// Application events go through the global events.
|
|
63
93
|
this.on = globalEvents.on.bind(globalEvents);
|
|
64
94
|
this.off = globalEvents.off.bind(globalEvents);
|
|
@@ -68,11 +98,15 @@ export class ApplicationCommon {
|
|
|
68
98
|
this._inBackground = false;
|
|
69
99
|
this._suspended = false;
|
|
70
100
|
this._cssFile = './app.css';
|
|
101
|
+
this._readyNotified = false;
|
|
102
|
+
this._appCssLoaded = false;
|
|
103
|
+
this._launchBridgeConsumed = false;
|
|
104
|
+
this._windowContentResolver = null;
|
|
71
105
|
this.started = false;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
this.
|
|
106
|
+
// --- NativeWindow registry ---
|
|
107
|
+
this._windows = [];
|
|
108
|
+
// --- Primary window traits ---
|
|
109
|
+
this._traitsWindow = null;
|
|
76
110
|
getNativeScriptGlobals().appInstanceReady = true;
|
|
77
111
|
global.__onUncaughtError = (error) => {
|
|
78
112
|
this.notify({
|
|
@@ -150,18 +184,37 @@ export class ApplicationCommon {
|
|
|
150
184
|
CSSUtils.removeSystemCssClass(cssClass);
|
|
151
185
|
rootView.cssClasses.delete(cssClass);
|
|
152
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* Same as {@link applyCssClass}, minus the system class list: window-scoped classes
|
|
189
|
+
* must not leak into it, because it seeds every window's root view.
|
|
190
|
+
*/
|
|
191
|
+
applyWindowScopedCssClass(rootView, cssClasses, newCssClass) {
|
|
192
|
+
if (rootView.cssClasses.has(newCssClass)) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
cssClasses.forEach((cssClass) => rootView.cssClasses.delete(cssClass));
|
|
196
|
+
rootView.cssClasses.add(newCssClass);
|
|
197
|
+
this.increaseStyleScopeApplicationCssSelectorVersion(rootView);
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* The modal registry is process-wide, so only the modals presented over this root
|
|
201
|
+
* view may follow its window-scoped classes.
|
|
202
|
+
*/
|
|
203
|
+
getOwnedModalViews(rootView) {
|
|
204
|
+
return rootView._getRootModalViews().filter((modalView) => modalView._getRootModalHost() === rootView);
|
|
205
|
+
}
|
|
153
206
|
increaseStyleScopeApplicationCssSelectorVersion(rootView) {
|
|
154
207
|
const styleScope = rootView._styleScope ?? rootView?.currentPage?._styleScope;
|
|
155
208
|
if (styleScope) {
|
|
156
209
|
styleScope._increaseApplicationCssSelectorVersion();
|
|
157
210
|
}
|
|
158
211
|
}
|
|
159
|
-
setRootViewCSSClasses(rootView) {
|
|
212
|
+
setRootViewCSSClasses(rootView, window) {
|
|
160
213
|
const platform = Device.os.toLowerCase();
|
|
161
214
|
const deviceType = Device.deviceType.toLowerCase();
|
|
162
|
-
const orientation = this.orientation();
|
|
163
|
-
const systemAppearance = this.systemAppearance();
|
|
164
|
-
const layoutDirection = this.layoutDirection();
|
|
215
|
+
const orientation = window ? window.orientation() : this.orientation();
|
|
216
|
+
const systemAppearance = window ? window.systemAppearance() : this.systemAppearance();
|
|
217
|
+
const layoutDirection = window ? window.layoutDirection() : this.layoutDirection();
|
|
165
218
|
if (platform) {
|
|
166
219
|
CSSUtils.pushToSystemCssClasses(`${CSSUtils.CLASS_PREFIX}${platform}`);
|
|
167
220
|
// SDK Version CSS classes
|
|
@@ -173,18 +226,20 @@ export class ApplicationCommon {
|
|
|
173
226
|
if (deviceType) {
|
|
174
227
|
CSSUtils.pushToSystemCssClasses(`${CSSUtils.CLASS_PREFIX}${deviceType}`);
|
|
175
228
|
}
|
|
229
|
+
rootView.cssClasses.add(CSSUtils.ROOT_VIEW_CSS_CLASS);
|
|
230
|
+
const rootViewCssClasses = CSSUtils.getSystemCssClasses();
|
|
231
|
+
rootViewCssClasses.forEach((c) => rootView.cssClasses.add(c));
|
|
232
|
+
// Two windows can disagree on these, so they never reach the process-wide
|
|
233
|
+
// system class list — see CSSUtils.WINDOW_SCOPED_CSS_CLASSES.
|
|
176
234
|
if (orientation) {
|
|
177
|
-
|
|
235
|
+
rootView.cssClasses.add(`${CSSUtils.CLASS_PREFIX}${orientation}`);
|
|
178
236
|
}
|
|
179
237
|
if (systemAppearance) {
|
|
180
|
-
|
|
238
|
+
rootView.cssClasses.add(`${CSSUtils.CLASS_PREFIX}${systemAppearance}`);
|
|
181
239
|
}
|
|
182
240
|
if (layoutDirection) {
|
|
183
|
-
|
|
241
|
+
rootView.cssClasses.add(`${CSSUtils.CLASS_PREFIX}${layoutDirection}`);
|
|
184
242
|
}
|
|
185
|
-
rootView.cssClasses.add(CSSUtils.ROOT_VIEW_CSS_CLASS);
|
|
186
|
-
const rootViewCssClasses = CSSUtils.getSystemCssClasses();
|
|
187
|
-
rootViewCssClasses.forEach((c) => rootView.cssClasses.add(c));
|
|
188
243
|
this.increaseStyleScopeApplicationCssSelectorVersion(rootView);
|
|
189
244
|
rootView._onCssStateChange();
|
|
190
245
|
if (Trace.isEnabled()) {
|
|
@@ -214,7 +269,314 @@ export class ApplicationCommon {
|
|
|
214
269
|
getMainEntry() {
|
|
215
270
|
return getAppMainEntry();
|
|
216
271
|
}
|
|
272
|
+
/**
|
|
273
|
+
* Sets the callback that supplies the UI for windows that need content.
|
|
274
|
+
* Pass `null` to remove a previously set resolver.
|
|
275
|
+
*/
|
|
276
|
+
setWindowContentResolver(resolver) {
|
|
277
|
+
this._windowContentResolver = resolver ?? null;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* @returns The callback currently supplying window content, if any.
|
|
281
|
+
*/
|
|
282
|
+
getWindowContentResolver() {
|
|
283
|
+
return this._windowContentResolver;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Get the primary NativeWindow.
|
|
287
|
+
*/
|
|
288
|
+
get primaryWindow() {
|
|
289
|
+
return this._windows.find((nw) => nw.isPrimary);
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Get the NativeWindow the user is currently interacting with - the one that activated most
|
|
293
|
+
* recently and is still attached. Falls back to the primary window while no window holds
|
|
294
|
+
* activation, which is the case before the first window activates and on a platform that
|
|
295
|
+
* never raises `activate`.
|
|
296
|
+
*/
|
|
297
|
+
get activeWindow() {
|
|
298
|
+
const active = getActiveWindow();
|
|
299
|
+
if (active && active.state === 'attached' && this._windows.indexOf(active) !== -1) {
|
|
300
|
+
return active;
|
|
301
|
+
}
|
|
302
|
+
return this.primaryWindow;
|
|
303
|
+
}
|
|
304
|
+
getWindows(role) {
|
|
305
|
+
if (role === 'all') {
|
|
306
|
+
return [...this._windows];
|
|
307
|
+
}
|
|
308
|
+
const roles = role ? (Array.isArray(role) ? role : [role]) : ['application', 'embedded'];
|
|
309
|
+
return this._windows.filter((nw) => roles.indexOf(nw.role) !== -1);
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Get a registered NativeWindow by its id.
|
|
313
|
+
*/
|
|
314
|
+
getWindowById(id) {
|
|
315
|
+
return this._windows.find((nw) => nw.id === id);
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Opens a new window.
|
|
319
|
+
*
|
|
320
|
+
* @param options Options for the new window, including data to hand to it.
|
|
321
|
+
*/
|
|
322
|
+
openWindow(options) {
|
|
323
|
+
throw new Error('openWindow() is not supported on this platform.');
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* @internal - Get all registered NativeWindows, whatever their role.
|
|
327
|
+
*/
|
|
328
|
+
_getWindows() {
|
|
329
|
+
return [...this._windows];
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* @internal - Register a NativeWindow created by the platform lifecycle.
|
|
333
|
+
*/
|
|
334
|
+
_registerWindow(nativeWindow) {
|
|
335
|
+
this._windows.push(nativeWindow);
|
|
336
|
+
// A closing window drops its own listeners, so this is never explicitly removed.
|
|
337
|
+
nativeWindow.on(NativeWindowEvents.activate, this.onWindowActivated, this);
|
|
338
|
+
if (nativeWindow.isPrimary) {
|
|
339
|
+
this.trackPrimaryWindowTraits(nativeWindow);
|
|
340
|
+
}
|
|
341
|
+
this._onWindowRegistered(nativeWindow);
|
|
342
|
+
this.notify({
|
|
343
|
+
eventName: this.windowOpenEvent,
|
|
344
|
+
object: this,
|
|
345
|
+
window: nativeWindow,
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* @internal - retire the windows behind discarded window-session ids.
|
|
350
|
+
*
|
|
351
|
+
* A session id can only stand in for a window whose native surface is already gone.
|
|
352
|
+
* iOS reports sessions discarded while the app was not running on the next launch,
|
|
353
|
+
* and such an id can name the session driving the app now, so an id match alone is
|
|
354
|
+
* no evidence that the window is finished with. Retiring an attached window tears
|
|
355
|
+
* down the UI in use - its root view unloads and nothing ever reloads it - so only
|
|
356
|
+
* detached windows are retired. Ids matching no window are ignored: they routinely
|
|
357
|
+
* belong to windows this JS context has never seen.
|
|
358
|
+
*/
|
|
359
|
+
_retireDiscardedWindows(ids) {
|
|
360
|
+
for (const id of ids) {
|
|
361
|
+
const nativeWindow = id ? this.getWindowById(id) : undefined;
|
|
362
|
+
if (!nativeWindow) {
|
|
363
|
+
continue;
|
|
364
|
+
}
|
|
365
|
+
if (nativeWindow.state === 'attached') {
|
|
366
|
+
Trace.write(`Ignoring a discarded session for window '${id}': its surface is still attached.`, Trace.categories.NativeLifecycle, Trace.messageType.warn);
|
|
367
|
+
continue;
|
|
368
|
+
}
|
|
369
|
+
nativeWindow._notifyEvent(NativeWindowEvents.close);
|
|
370
|
+
this._unregisterWindow(nativeWindow);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* @internal - Unregister a NativeWindow when its native surface is gone for good.
|
|
375
|
+
*/
|
|
376
|
+
_unregisterWindow(nativeWindow) {
|
|
377
|
+
if (!nativeWindow._surfaceGone) {
|
|
378
|
+
Trace.write(`Unregistering window '${nativeWindow.id}' while its native surface is still live. A window may only be retired once the platform has reported the surface gone.`, Trace.categories.NativeLifecycle, Trace.messageType.error);
|
|
379
|
+
}
|
|
380
|
+
const idx = this._windows.indexOf(nativeWindow);
|
|
381
|
+
if (idx >= 0) {
|
|
382
|
+
this._windows.splice(idx, 1);
|
|
383
|
+
}
|
|
384
|
+
if (getActiveWindow() === nativeWindow) {
|
|
385
|
+
setActiveWindow(undefined);
|
|
386
|
+
}
|
|
387
|
+
this.notify({
|
|
388
|
+
eventName: this.windowCloseEvent,
|
|
389
|
+
object: this,
|
|
390
|
+
window: nativeWindow,
|
|
391
|
+
});
|
|
392
|
+
// If primary was removed, promote the next window that can actually host content
|
|
393
|
+
if (nativeWindow.isPrimary) {
|
|
394
|
+
nativeWindow._setIsPrimary(false);
|
|
395
|
+
const promoted = this.getWindows().find((nw) => nw.state === 'attached');
|
|
396
|
+
this.trackPrimaryWindowTraits(promoted);
|
|
397
|
+
if (promoted) {
|
|
398
|
+
promoted._setIsPrimary(true);
|
|
399
|
+
this._onPrimaryWindowPromoted(promoted);
|
|
400
|
+
this.notify({
|
|
401
|
+
eventName: this.primaryWindowChangedEvent,
|
|
402
|
+
object: this,
|
|
403
|
+
window: promoted,
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
nativeWindow._destroy();
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Hook for platform-specific bookkeeping right after a window joins the registry,
|
|
411
|
+
* before `windowOpen` is raised.
|
|
412
|
+
*/
|
|
413
|
+
_onWindowRegistered(nativeWindow) {
|
|
414
|
+
// noop
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Hook for platform-specific bookkeeping right after a window takes over the primary
|
|
418
|
+
* role, before `primaryWindowChanged` is raised.
|
|
419
|
+
*/
|
|
420
|
+
_onPrimaryWindowPromoted(nativeWindow) {
|
|
421
|
+
// noop
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Points the application-level orientation, appearance and layout direction at the
|
|
425
|
+
* primary window, which owns those values now that each window has its own.
|
|
426
|
+
*/
|
|
427
|
+
trackPrimaryWindowTraits(nativeWindow) {
|
|
428
|
+
const target = nativeWindow ?? null;
|
|
429
|
+
if (this._traitsWindow === target) {
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
432
|
+
const previous = this._traitsWindow;
|
|
433
|
+
if (previous) {
|
|
434
|
+
previous.off(NativeWindowEvents.orientationChanged, this.onWindowOrientationChanged, this);
|
|
435
|
+
previous.off(NativeWindowEvents.systemAppearanceChanged, this.onWindowSystemAppearanceChanged, this);
|
|
436
|
+
previous.off(NativeWindowEvents.layoutDirectionChanged, this.onWindowLayoutDirectionChanged, this);
|
|
437
|
+
}
|
|
438
|
+
this._traitsWindow = target;
|
|
439
|
+
if (!target) {
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
442
|
+
target.on(NativeWindowEvents.orientationChanged, this.onWindowOrientationChanged, this);
|
|
443
|
+
target.on(NativeWindowEvents.systemAppearanceChanged, this.onWindowSystemAppearanceChanged, this);
|
|
444
|
+
target.on(NativeWindowEvents.layoutDirectionChanged, this.onWindowLayoutDirectionChanged, this);
|
|
445
|
+
this.syncTraitsFromWindow(target);
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* Adopts the window's values. The very first window seeds them quietly — there is no
|
|
449
|
+
* previous application state for it to differ from — while a later promotion raises
|
|
450
|
+
* the change events, because app code observed the outgoing window's values.
|
|
451
|
+
*/
|
|
452
|
+
syncTraitsFromWindow(nativeWindow) {
|
|
453
|
+
const orientation = nativeWindow.orientation();
|
|
454
|
+
if (orientation) {
|
|
455
|
+
if (this._orientation === undefined) {
|
|
456
|
+
this._orientation = orientation;
|
|
457
|
+
}
|
|
458
|
+
else {
|
|
459
|
+
this.setOrientation(orientation);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
const systemAppearance = nativeWindow.systemAppearance();
|
|
463
|
+
if (systemAppearance) {
|
|
464
|
+
if (this._systemAppearance === undefined) {
|
|
465
|
+
this._systemAppearance = systemAppearance;
|
|
466
|
+
}
|
|
467
|
+
else {
|
|
468
|
+
this.setSystemAppearance(systemAppearance);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
const layoutDirection = nativeWindow.layoutDirection();
|
|
472
|
+
if (layoutDirection) {
|
|
473
|
+
if (this._layoutDirection === undefined) {
|
|
474
|
+
this._layoutDirection = layoutDirection;
|
|
475
|
+
}
|
|
476
|
+
else {
|
|
477
|
+
this.setLayoutDirection(layoutDirection);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
onWindowActivated(data) {
|
|
482
|
+
setActiveWindow(data.window);
|
|
483
|
+
}
|
|
484
|
+
onWindowOrientationChanged(data) {
|
|
485
|
+
this.setOrientation(data.newValue);
|
|
486
|
+
}
|
|
487
|
+
onWindowSystemAppearanceChanged(data) {
|
|
488
|
+
this.setSystemAppearance(data.newValue);
|
|
489
|
+
}
|
|
490
|
+
onWindowLayoutDirectionChanged(data) {
|
|
491
|
+
this.setLayoutDirection(data.newValue);
|
|
492
|
+
}
|
|
493
|
+
/**
|
|
494
|
+
* @internal - raises `ready` at most once per JS context.
|
|
495
|
+
*/
|
|
496
|
+
notifyReady() {
|
|
497
|
+
if (this._readyNotified) {
|
|
498
|
+
return;
|
|
499
|
+
}
|
|
500
|
+
this._readyNotified = true;
|
|
501
|
+
getNativeScriptGlobals().setLaunched();
|
|
502
|
+
this.notify({
|
|
503
|
+
eventName: this.readyEvent,
|
|
504
|
+
object: this,
|
|
505
|
+
ios: this.ios,
|
|
506
|
+
android: this.android,
|
|
507
|
+
});
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* @internal - produces the content for a window that has none.
|
|
511
|
+
*
|
|
512
|
+
* Resolution order: the window content resolver, then the legacy `launch` event
|
|
513
|
+
* (offered to the first window that asks for content and to no other), then the
|
|
514
|
+
* application main entry. A resolver or a `launch` handler returning `null` takes
|
|
515
|
+
* ownership of the content, so nothing else is tried. A missing main entry leaves
|
|
516
|
+
* the window empty instead of throwing, because content can still arrive later
|
|
517
|
+
* through `run()`/`resetRootView()`.
|
|
518
|
+
*
|
|
519
|
+
* @param options.install `false` returns the resolved view instead of applying it,
|
|
520
|
+
* for platform pipelines that install the root view on the native surface themselves.
|
|
521
|
+
* @param options.launchData platform payload merged into the legacy `launch` event args.
|
|
522
|
+
* @returns The resolved view, or `null` when no content was produced.
|
|
523
|
+
*/
|
|
524
|
+
_resolveWindowContent(window, request, options) {
|
|
525
|
+
const content = this.resolveWindowContent(request, options?.launchData);
|
|
526
|
+
if (content == null) {
|
|
527
|
+
return null;
|
|
528
|
+
}
|
|
529
|
+
if (options?.install === false) {
|
|
530
|
+
return this.buildContentView(content);
|
|
531
|
+
}
|
|
532
|
+
window.setContent(content);
|
|
533
|
+
return window.rootView;
|
|
534
|
+
}
|
|
535
|
+
resolveWindowContent(request, launchData) {
|
|
536
|
+
const launchBridgeAvailable = !this._launchBridgeConsumed;
|
|
537
|
+
this._launchBridgeConsumed = true;
|
|
538
|
+
const resolver = this._windowContentResolver;
|
|
539
|
+
if (resolver) {
|
|
540
|
+
const resolved = resolver(request);
|
|
541
|
+
// `null` means the resolver supplies the content itself; only `undefined` falls through.
|
|
542
|
+
if (resolved !== undefined) {
|
|
543
|
+
this._ensureAppCssLoaded();
|
|
544
|
+
return resolved;
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
if (launchBridgeAvailable) {
|
|
548
|
+
const root = this.notifyLaunch(launchData);
|
|
549
|
+
if (root === null) {
|
|
550
|
+
return null;
|
|
551
|
+
}
|
|
552
|
+
if (root) {
|
|
553
|
+
return root;
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
this._ensureAppCssLoaded();
|
|
557
|
+
const mainEntry = getAppMainEntry();
|
|
558
|
+
return mainEntry ? Builder.createViewFromEntry(mainEntry) : undefined;
|
|
559
|
+
}
|
|
560
|
+
buildContentView(content) {
|
|
561
|
+
if (typeof content === 'string') {
|
|
562
|
+
return Builder.createViewFromEntry({ moduleName: content });
|
|
563
|
+
}
|
|
564
|
+
const entry = content;
|
|
565
|
+
return entry.moduleName || entry.create ? Builder.createViewFromEntry(entry) : content;
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* Loads the app CSS once per JS context. On the legacy `launch` path this has to run
|
|
569
|
+
* after the handlers, which are allowed to call `setCssFileName()`.
|
|
570
|
+
*/
|
|
571
|
+
_ensureAppCssLoaded() {
|
|
572
|
+
if (this._appCssLoaded) {
|
|
573
|
+
return;
|
|
574
|
+
}
|
|
575
|
+
this._appCssLoaded = true;
|
|
576
|
+
this.loadAppCss();
|
|
577
|
+
}
|
|
217
578
|
notifyLaunch(additionalLanchEventData) {
|
|
579
|
+
this._launchBridgeConsumed = true;
|
|
218
580
|
const launchArgs = {
|
|
219
581
|
eventName: this.launchEvent,
|
|
220
582
|
object: this,
|
|
@@ -223,7 +585,7 @@ export class ApplicationCommon {
|
|
|
223
585
|
...additionalLanchEventData,
|
|
224
586
|
};
|
|
225
587
|
this.notify(launchArgs);
|
|
226
|
-
this.
|
|
588
|
+
this._ensureAppCssLoaded();
|
|
227
589
|
return launchArgs.root;
|
|
228
590
|
}
|
|
229
591
|
createRootView(view, fireLaunchEvent = false, additionalLanchEventData) {
|
|
@@ -253,8 +615,12 @@ export class ApplicationCommon {
|
|
|
253
615
|
setAppMainEntry(typeof entry === 'string' ? { moduleName: entry } : entry);
|
|
254
616
|
// rest of implementation is platform specific
|
|
255
617
|
}
|
|
256
|
-
|
|
257
|
-
|
|
618
|
+
/**
|
|
619
|
+
* @param window the window the root view belongs to. Supplies the window-scoped CSS
|
|
620
|
+
* classes; without it they come from the primary window.
|
|
621
|
+
*/
|
|
622
|
+
initRootView(rootView, window) {
|
|
623
|
+
this.setRootViewCSSClasses(rootView, window);
|
|
258
624
|
// ensure css is "loaded" on the rootview so that user rootview can access css variables right away
|
|
259
625
|
rootView._onCssStateChange(true);
|
|
260
626
|
this.notify({ eventName: this.initRootViewEvent, rootView });
|
|
@@ -348,18 +714,20 @@ export class ApplicationCommon {
|
|
|
348
714
|
object: this,
|
|
349
715
|
});
|
|
350
716
|
}
|
|
717
|
+
/**
|
|
718
|
+
* @deprecated Use Application.primaryWindow?.orientation() - or the NativeWindow of the relevant view - instead. Continues to reflect the primary window.
|
|
719
|
+
*/
|
|
351
720
|
orientation() {
|
|
352
|
-
return (this._orientation ?? (this._orientation = this.getOrientation()));
|
|
721
|
+
return this.primaryWindow?.orientation() ?? (this._orientation ?? (this._orientation = this.getOrientation()));
|
|
353
722
|
}
|
|
354
723
|
orientationChanged(rootView, newOrientation) {
|
|
355
724
|
if (!rootView) {
|
|
356
725
|
return;
|
|
357
726
|
}
|
|
358
727
|
const newOrientationCssClass = `${CSSUtils.CLASS_PREFIX}${newOrientation}`;
|
|
359
|
-
this.
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
this.applyCssClass(rootModalView, ORIENTATION_CSS_CLASSES, newOrientationCssClass, true);
|
|
728
|
+
this.applyWindowScopedCssClass(rootView, ORIENTATION_CSS_CLASSES, newOrientationCssClass);
|
|
729
|
+
this.getOwnedModalViews(rootView).forEach((rootModalView) => {
|
|
730
|
+
this.applyWindowScopedCssClass(rootModalView, ORIENTATION_CSS_CLASSES, newOrientationCssClass);
|
|
363
731
|
// Trigger state change for root modal view classes and media queries
|
|
364
732
|
rootModalView._onCssStateChange();
|
|
365
733
|
});
|
|
@@ -391,19 +759,21 @@ export class ApplicationCommon {
|
|
|
391
759
|
object: this,
|
|
392
760
|
};
|
|
393
761
|
this.notify(args);
|
|
394
|
-
if (args.cancel === false) {
|
|
762
|
+
if (args.cancel === false && this.autoSystemAppearanceChanged) {
|
|
395
763
|
this.systemAppearanceChanged(this.getRootView(), value);
|
|
396
764
|
}
|
|
397
765
|
}
|
|
766
|
+
/**
|
|
767
|
+
* @deprecated Use Application.primaryWindow?.systemAppearance() - or the NativeWindow of the relevant view - instead. Continues to reflect the primary window.
|
|
768
|
+
*/
|
|
398
769
|
systemAppearance() {
|
|
399
|
-
|
|
400
|
-
return (this._systemAppearance ?? (this._systemAppearance = this.getSystemAppearance()));
|
|
770
|
+
return this.primaryWindow?.systemAppearance() ?? (this._systemAppearance ?? (this._systemAppearance = this.getSystemAppearance()));
|
|
401
771
|
}
|
|
402
772
|
/**
|
|
403
773
|
* enable/disable systemAppearanceChanged
|
|
404
774
|
*/
|
|
405
775
|
setAutoSystemAppearanceChanged(value) {
|
|
406
|
-
|
|
776
|
+
setAutoSystemAppearanceChanged(value);
|
|
407
777
|
}
|
|
408
778
|
/**
|
|
409
779
|
* Updates root view classes including those of modals
|
|
@@ -411,14 +781,13 @@ export class ApplicationCommon {
|
|
|
411
781
|
* @param newSystemAppearance the new appearance change
|
|
412
782
|
*/
|
|
413
783
|
systemAppearanceChanged(rootView, newSystemAppearance) {
|
|
414
|
-
if (!rootView
|
|
784
|
+
if (!rootView) {
|
|
415
785
|
return;
|
|
416
786
|
}
|
|
417
787
|
const newSystemAppearanceCssClass = `${CSSUtils.CLASS_PREFIX}${newSystemAppearance}`;
|
|
418
|
-
this.
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
this.applyCssClass(rootModalView, SYSTEM_APPEARANCE_CSS_CLASSES, newSystemAppearanceCssClass, true);
|
|
788
|
+
this.applyWindowScopedCssClass(rootView, SYSTEM_APPEARANCE_CSS_CLASSES, newSystemAppearanceCssClass);
|
|
789
|
+
this.getOwnedModalViews(rootView).forEach((rootModalView) => {
|
|
790
|
+
this.applyWindowScopedCssClass(rootModalView, SYSTEM_APPEARANCE_CSS_CLASSES, newSystemAppearanceCssClass);
|
|
422
791
|
// Trigger state change for root modal view classes and media queries
|
|
423
792
|
rootModalView._onCssStateChange();
|
|
424
793
|
});
|
|
@@ -443,9 +812,11 @@ export class ApplicationCommon {
|
|
|
443
812
|
object: this,
|
|
444
813
|
});
|
|
445
814
|
}
|
|
815
|
+
/**
|
|
816
|
+
* @deprecated Use Application.primaryWindow?.layoutDirection() - or the NativeWindow of the relevant view - instead. Continues to reflect the primary window.
|
|
817
|
+
*/
|
|
446
818
|
layoutDirection() {
|
|
447
|
-
|
|
448
|
-
return (this._layoutDirection ?? (this._layoutDirection = this.getLayoutDirection()));
|
|
819
|
+
return this.primaryWindow?.layoutDirection() ?? (this._layoutDirection ?? (this._layoutDirection = this.getLayoutDirection()));
|
|
449
820
|
}
|
|
450
821
|
/**
|
|
451
822
|
* Updates root view classes including those of modals
|
|
@@ -457,10 +828,9 @@ export class ApplicationCommon {
|
|
|
457
828
|
return;
|
|
458
829
|
}
|
|
459
830
|
const newLayoutDirectionCssClass = `${CSSUtils.CLASS_PREFIX}${newLayoutDirection}`;
|
|
460
|
-
this.
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
this.applyCssClass(rootModalView, LAYOUT_DIRECTION_CSS_CLASSES, newLayoutDirectionCssClass, true);
|
|
831
|
+
this.applyWindowScopedCssClass(rootView, LAYOUT_DIRECTION_CSS_CLASSES, newLayoutDirectionCssClass);
|
|
832
|
+
this.getOwnedModalViews(rootView).forEach((rootModalView) => {
|
|
833
|
+
this.applyWindowScopedCssClass(rootModalView, LAYOUT_DIRECTION_CSS_CLASSES, newLayoutDirectionCssClass);
|
|
464
834
|
// Trigger state change for root modal view classes and media queries
|
|
465
835
|
rootModalView._onCssStateChange();
|
|
466
836
|
});
|