@akylas/nativescript 9.0.25 → 9.1.5
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 +205 -3
- package/application/application-common.js +438 -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 +239 -18
- 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 +892 -390
- package/application/application.ios.js.map +1 -1
- package/application/helpers-common.d.ts +7 -0
- package/application/helpers-common.js +46 -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 +45 -3
- 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.d.ts +6 -1
- package/css-mediaquery/index.js +35 -6
- 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.d.ts +29 -0
- package/debugger/webinspector-network.ios.js.map +1 -1
- package/fetch/index.d.ts +79 -0
- package/fetch/index.js +408 -0
- package/fetch/index.js.map +1 -0
- package/file-system/file-system-access.android.d.ts +1 -0
- package/file-system/file-system-access.android.js +18 -21
- 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 +40 -34
- 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 +22 -9
- 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 +5 -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 +6 -1
- package/http/http-request-internal/http-request-internal-common.js +19 -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 +8 -6
- 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 +34 -17
- 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 +7 -6
- package/image-source/index.ios.js.map +1 -1
- package/index.d.ts +3 -1
- 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/js-libs/easysax/easysax.d.ts +49 -7
- package/js-libs/easysax/easysax.js +631 -747
- package/js-libs/easysax/easysax.js.map +1 -0
- package/matrix/index.js.map +1 -1
- package/media-query-list/index.js +57 -15
- package/media-query-list/index.js.map +1 -1
- package/module-name-resolver/helpers.d.ts +1 -1
- package/module-name-resolver/helpers.js.map +1 -1
- package/module-name-resolver/index.d.ts +2 -2
- 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 +218 -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 -3
- 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 +2 -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 +7 -11
- 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 +6 -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.d.ts +8 -0
- package/ui/builder/binding-builder.js +12 -0
- package/ui/builder/binding-builder.js.map +1 -1
- package/ui/builder/component-builder/index.d.ts +7 -4
- package/ui/builder/component-builder/index.js +13 -7
- package/ui/builder/component-builder/index.js.map +1 -1
- package/ui/builder/index.d.ts +16 -2
- package/ui/builder/index.js +61 -13
- package/ui/builder/index.js.map +1 -1
- package/ui/button/button-common.js.map +1 -1
- package/ui/button/index.android.js +4 -3
- package/ui/button/index.android.js.map +1 -1
- package/ui/button/index.ios.js.map +1 -1
- package/ui/content-view/index.js +2 -0
- 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.d.ts +15 -0
- package/ui/core/bindable/bindable-types.js.map +1 -1
- package/ui/core/bindable/index.d.ts +1 -1
- package/ui/core/bindable/index.js +14 -8
- 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 +89 -15
- 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 +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.d.ts +2 -0
- package/ui/editable-text-base/index.android.js +17 -7
- package/ui/editable-text-base/index.android.js.map +1 -1
- package/ui/editable-text-base/index.d.ts +8 -0
- 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 +12 -9
- package/ui/frame/fragment.transitions.android.js +105 -90
- 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 +2 -2
- package/ui/frame/index.android.js +161 -56
- 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 +177 -133
- package/ui/gestures/index.android.js.map +1 -1
- package/ui/gestures/index.ios.js +36 -7
- 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 +14 -2
- 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 +1 -2
- 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 +2 -2
- 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.d.ts +1 -0
- package/ui/list-picker/index.android.js +6 -5
- 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 +19 -11
- 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 +33 -20
- 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 +2 -2
- 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 +8 -8
- 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 +1 -2
- 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 +10 -2
- 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 +2 -2
- package/ui/styling/background.ios.d.ts +1 -1
- package/ui/styling/background.ios.js +10 -3
- 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 +29 -2
- 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 +461 -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 +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 +13 -17
- 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 +83 -20
- 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 +6 -9
- 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 +26 -4
- 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 +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 +171 -86
- 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 +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/android-runtime-version.d.ts +12 -0
- package/utils/android-runtime-version.js +36 -0
- package/utils/android-runtime-version.js.map +1 -0
- 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 +9 -3
- 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.d.ts +5 -4
- package/xhr/index.js +18 -18
- package/xhr/index.js.map +1 -1
- package/xml/index.d.ts +2 -2
- package/xml/index.js +1 -1
- package/xml/index.js.map +1 -1
- package/LICENSE +0 -19
- package/fetch/index.mjs +0 -535
|
@@ -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,76 @@ 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 and the first
|
|
60
|
+
* one after `exit`) ->
|
|
61
|
+
* `contentLoaded` -> `activate`/`displayed`.
|
|
62
|
+
*/
|
|
63
|
+
this.readyEvent = 'ready';
|
|
64
|
+
/**
|
|
65
|
+
* Reflects whole-app state: with multiple windows it is raised once the app itself is
|
|
66
|
+
* no longer in the foreground, not when an individual window backgrounds. Listen on a
|
|
67
|
+
* NativeWindow for per-window state.
|
|
68
|
+
*/
|
|
45
69
|
this.suspendEvent = 'suspend';
|
|
46
70
|
this.displayedEvent = 'displayed';
|
|
47
71
|
this.backgroundEvent = 'background';
|
|
48
72
|
this.foregroundEvent = 'foreground';
|
|
49
73
|
this.resumeEvent = 'resume';
|
|
74
|
+
/**
|
|
75
|
+
* On Android, raised when the last window closes; the process may stay alive.
|
|
76
|
+
* On iOS, raised when the process itself terminates.
|
|
77
|
+
*/
|
|
50
78
|
this.exitEvent = 'exit';
|
|
51
79
|
this.lowMemoryEvent = 'lowMemory';
|
|
52
80
|
this.uncaughtErrorEvent = 'uncaughtError';
|
|
@@ -59,6 +87,9 @@ export class ApplicationCommon {
|
|
|
59
87
|
this.loadAppCssEvent = 'loadAppCss';
|
|
60
88
|
this.cssChangedEvent = 'cssChanged';
|
|
61
89
|
this.initRootViewEvent = 'initRootView';
|
|
90
|
+
this.windowOpenEvent = WindowEvents.windowOpen;
|
|
91
|
+
this.windowCloseEvent = WindowEvents.windowClose;
|
|
92
|
+
this.primaryWindowChangedEvent = WindowEvents.primaryWindowChanged;
|
|
62
93
|
// Application events go through the global events.
|
|
63
94
|
this.on = globalEvents.on.bind(globalEvents);
|
|
64
95
|
this.off = globalEvents.off.bind(globalEvents);
|
|
@@ -68,11 +99,15 @@ export class ApplicationCommon {
|
|
|
68
99
|
this._inBackground = false;
|
|
69
100
|
this._suspended = false;
|
|
70
101
|
this._cssFile = './app.css';
|
|
102
|
+
this._readyNotified = false;
|
|
103
|
+
this._appCssLoaded = false;
|
|
104
|
+
this._launchBridgeConsumed = false;
|
|
105
|
+
this._windowContentResolver = null;
|
|
71
106
|
this.started = false;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
this.
|
|
107
|
+
// --- NativeWindow registry ---
|
|
108
|
+
this._windows = [];
|
|
109
|
+
// --- Primary window traits ---
|
|
110
|
+
this._traitsWindow = null;
|
|
76
111
|
getNativeScriptGlobals().appInstanceReady = true;
|
|
77
112
|
global.__onUncaughtError = (error) => {
|
|
78
113
|
this.notify({
|
|
@@ -150,18 +185,37 @@ export class ApplicationCommon {
|
|
|
150
185
|
CSSUtils.removeSystemCssClass(cssClass);
|
|
151
186
|
rootView.cssClasses.delete(cssClass);
|
|
152
187
|
}
|
|
188
|
+
/**
|
|
189
|
+
* Same as {@link applyCssClass}, minus the system class list: window-scoped classes
|
|
190
|
+
* must not leak into it, because it seeds every window's root view.
|
|
191
|
+
*/
|
|
192
|
+
applyWindowScopedCssClass(rootView, cssClasses, newCssClass) {
|
|
193
|
+
if (rootView.cssClasses.has(newCssClass)) {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
cssClasses.forEach((cssClass) => rootView.cssClasses.delete(cssClass));
|
|
197
|
+
rootView.cssClasses.add(newCssClass);
|
|
198
|
+
this.increaseStyleScopeApplicationCssSelectorVersion(rootView);
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* The modal registry is process-wide, so only the modals presented over this root
|
|
202
|
+
* view may follow its window-scoped classes.
|
|
203
|
+
*/
|
|
204
|
+
getOwnedModalViews(rootView) {
|
|
205
|
+
return rootView._getRootModalViews().filter((modalView) => modalView._getRootModalHost() === rootView);
|
|
206
|
+
}
|
|
153
207
|
increaseStyleScopeApplicationCssSelectorVersion(rootView) {
|
|
154
208
|
const styleScope = rootView._styleScope ?? rootView?.currentPage?._styleScope;
|
|
155
209
|
if (styleScope) {
|
|
156
210
|
styleScope._increaseApplicationCssSelectorVersion();
|
|
157
211
|
}
|
|
158
212
|
}
|
|
159
|
-
setRootViewCSSClasses(rootView) {
|
|
213
|
+
setRootViewCSSClasses(rootView, window) {
|
|
160
214
|
const platform = Device.os.toLowerCase();
|
|
161
215
|
const deviceType = Device.deviceType.toLowerCase();
|
|
162
|
-
const orientation = this.orientation();
|
|
163
|
-
const systemAppearance = this.systemAppearance();
|
|
164
|
-
const layoutDirection = this.layoutDirection();
|
|
216
|
+
const orientation = window ? window.orientation() : this.orientation();
|
|
217
|
+
const systemAppearance = window ? window.systemAppearance() : this.systemAppearance();
|
|
218
|
+
const layoutDirection = window ? window.layoutDirection() : this.layoutDirection();
|
|
165
219
|
if (platform) {
|
|
166
220
|
CSSUtils.pushToSystemCssClasses(`${CSSUtils.CLASS_PREFIX}${platform}`);
|
|
167
221
|
// SDK Version CSS classes
|
|
@@ -173,18 +227,20 @@ export class ApplicationCommon {
|
|
|
173
227
|
if (deviceType) {
|
|
174
228
|
CSSUtils.pushToSystemCssClasses(`${CSSUtils.CLASS_PREFIX}${deviceType}`);
|
|
175
229
|
}
|
|
230
|
+
rootView.cssClasses.add(CSSUtils.ROOT_VIEW_CSS_CLASS);
|
|
231
|
+
const rootViewCssClasses = CSSUtils.getSystemCssClasses();
|
|
232
|
+
rootViewCssClasses.forEach((c) => rootView.cssClasses.add(c));
|
|
233
|
+
// Two windows can disagree on these, so they never reach the process-wide
|
|
234
|
+
// system class list — see CSSUtils.WINDOW_SCOPED_CSS_CLASSES.
|
|
176
235
|
if (orientation) {
|
|
177
|
-
|
|
236
|
+
rootView.cssClasses.add(`${CSSUtils.CLASS_PREFIX}${orientation}`);
|
|
178
237
|
}
|
|
179
238
|
if (systemAppearance) {
|
|
180
|
-
|
|
239
|
+
rootView.cssClasses.add(`${CSSUtils.CLASS_PREFIX}${systemAppearance}`);
|
|
181
240
|
}
|
|
182
241
|
if (layoutDirection) {
|
|
183
|
-
|
|
242
|
+
rootView.cssClasses.add(`${CSSUtils.CLASS_PREFIX}${layoutDirection}`);
|
|
184
243
|
}
|
|
185
|
-
rootView.cssClasses.add(CSSUtils.ROOT_VIEW_CSS_CLASS);
|
|
186
|
-
const rootViewCssClasses = CSSUtils.getSystemCssClasses();
|
|
187
|
-
rootViewCssClasses.forEach((c) => rootView.cssClasses.add(c));
|
|
188
244
|
this.increaseStyleScopeApplicationCssSelectorVersion(rootView);
|
|
189
245
|
rootView._onCssStateChange();
|
|
190
246
|
if (Trace.isEnabled()) {
|
|
@@ -214,7 +270,326 @@ export class ApplicationCommon {
|
|
|
214
270
|
getMainEntry() {
|
|
215
271
|
return getAppMainEntry();
|
|
216
272
|
}
|
|
273
|
+
/**
|
|
274
|
+
* Sets the callback that supplies the UI for windows that need content.
|
|
275
|
+
* Pass `null` to remove a previously set resolver.
|
|
276
|
+
*/
|
|
277
|
+
setWindowContentResolver(resolver) {
|
|
278
|
+
this._windowContentResolver = resolver ?? null;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* @returns The callback currently supplying window content, if any.
|
|
282
|
+
*/
|
|
283
|
+
getWindowContentResolver() {
|
|
284
|
+
return this._windowContentResolver;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Get the primary NativeWindow.
|
|
288
|
+
*/
|
|
289
|
+
get primaryWindow() {
|
|
290
|
+
return this._windows.find((nw) => nw.isPrimary);
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Get the NativeWindow the user is currently interacting with - the one that activated most
|
|
294
|
+
* recently and is still attached. Falls back to the primary window while no window holds
|
|
295
|
+
* activation, which is the case before the first window activates and on a platform that
|
|
296
|
+
* never raises `activate`.
|
|
297
|
+
*/
|
|
298
|
+
get activeWindow() {
|
|
299
|
+
const active = getActiveWindow();
|
|
300
|
+
if (active && active.state === 'attached' && this._windows.indexOf(active) !== -1) {
|
|
301
|
+
return active;
|
|
302
|
+
}
|
|
303
|
+
return this.primaryWindow;
|
|
304
|
+
}
|
|
305
|
+
getWindows(role) {
|
|
306
|
+
if (role === 'all') {
|
|
307
|
+
return [...this._windows];
|
|
308
|
+
}
|
|
309
|
+
const roles = role ? (Array.isArray(role) ? role : [role]) : ['application', 'embedded'];
|
|
310
|
+
return this._windows.filter((nw) => roles.indexOf(nw.role) !== -1);
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Get a registered NativeWindow by its id.
|
|
314
|
+
*/
|
|
315
|
+
getWindowById(id) {
|
|
316
|
+
return this._windows.find((nw) => nw.id === id);
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Opens a new window.
|
|
320
|
+
*
|
|
321
|
+
* @param options Options for the new window, including data to hand to it.
|
|
322
|
+
*/
|
|
323
|
+
openWindow(options) {
|
|
324
|
+
throw new Error('openWindow() is not supported on this platform.');
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* @internal - Get all registered NativeWindows, whatever their role.
|
|
328
|
+
*/
|
|
329
|
+
_getWindows() {
|
|
330
|
+
return [...this._windows];
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* @internal - Register a NativeWindow created by the platform lifecycle.
|
|
334
|
+
*/
|
|
335
|
+
_registerWindow(nativeWindow) {
|
|
336
|
+
this._windows.push(nativeWindow);
|
|
337
|
+
// A closing window drops its own listeners, so this is never explicitly removed.
|
|
338
|
+
nativeWindow.on(NativeWindowEvents.activate, this.onWindowActivated, this);
|
|
339
|
+
if (nativeWindow.isPrimary) {
|
|
340
|
+
this.trackPrimaryWindowTraits(nativeWindow);
|
|
341
|
+
}
|
|
342
|
+
this._onWindowRegistered(nativeWindow);
|
|
343
|
+
this.notify({
|
|
344
|
+
eventName: this.windowOpenEvent,
|
|
345
|
+
object: this,
|
|
346
|
+
window: nativeWindow,
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* @internal - retire the windows behind discarded window-session ids.
|
|
351
|
+
*
|
|
352
|
+
* A session id can only stand in for a window whose native surface is already gone.
|
|
353
|
+
* iOS reports sessions discarded while the app was not running on the next launch,
|
|
354
|
+
* and such an id can name the session driving the app now, so an id match alone is
|
|
355
|
+
* no evidence that the window is finished with. Retiring an attached window tears
|
|
356
|
+
* down the UI in use - its root view unloads and nothing ever reloads it - so only
|
|
357
|
+
* detached windows are retired. Ids matching no window are ignored: they routinely
|
|
358
|
+
* belong to windows this JS context has never seen.
|
|
359
|
+
*/
|
|
360
|
+
_retireDiscardedWindows(ids) {
|
|
361
|
+
for (const id of ids) {
|
|
362
|
+
const nativeWindow = id ? this.getWindowById(id) : undefined;
|
|
363
|
+
if (!nativeWindow) {
|
|
364
|
+
continue;
|
|
365
|
+
}
|
|
366
|
+
if (nativeWindow.state === 'attached') {
|
|
367
|
+
Trace.write(`Ignoring a discarded session for window '${id}': its surface is still attached.`, Trace.categories.NativeLifecycle, Trace.messageType.warn);
|
|
368
|
+
continue;
|
|
369
|
+
}
|
|
370
|
+
nativeWindow._notifyEvent(NativeWindowEvents.close);
|
|
371
|
+
this._unregisterWindow(nativeWindow);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* @internal - Unregister a NativeWindow when its native surface is gone for good.
|
|
376
|
+
*/
|
|
377
|
+
_unregisterWindow(nativeWindow) {
|
|
378
|
+
if (!nativeWindow._surfaceGone) {
|
|
379
|
+
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);
|
|
380
|
+
}
|
|
381
|
+
const idx = this._windows.indexOf(nativeWindow);
|
|
382
|
+
if (idx >= 0) {
|
|
383
|
+
this._windows.splice(idx, 1);
|
|
384
|
+
}
|
|
385
|
+
if (getActiveWindow() === nativeWindow) {
|
|
386
|
+
setActiveWindow(undefined);
|
|
387
|
+
}
|
|
388
|
+
this.notify({
|
|
389
|
+
eventName: this.windowCloseEvent,
|
|
390
|
+
object: this,
|
|
391
|
+
window: nativeWindow,
|
|
392
|
+
});
|
|
393
|
+
// If primary was removed, promote the next window that can actually host content
|
|
394
|
+
if (nativeWindow.isPrimary) {
|
|
395
|
+
nativeWindow._setIsPrimary(false);
|
|
396
|
+
const promoted = this.getWindows().find((nw) => nw.state === 'attached');
|
|
397
|
+
this.trackPrimaryWindowTraits(promoted);
|
|
398
|
+
if (promoted) {
|
|
399
|
+
promoted._setIsPrimary(true);
|
|
400
|
+
this._onPrimaryWindowPromoted(promoted);
|
|
401
|
+
this.notify({
|
|
402
|
+
eventName: this.primaryWindowChangedEvent,
|
|
403
|
+
object: this,
|
|
404
|
+
window: promoted,
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
nativeWindow._destroy();
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Hook for platform-specific bookkeeping right after a window joins the registry,
|
|
412
|
+
* before `windowOpen` is raised.
|
|
413
|
+
*/
|
|
414
|
+
_onWindowRegistered(nativeWindow) {
|
|
415
|
+
// noop
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* Hook for platform-specific bookkeeping right after a window takes over the primary
|
|
419
|
+
* role, before `primaryWindowChanged` is raised.
|
|
420
|
+
*/
|
|
421
|
+
_onPrimaryWindowPromoted(nativeWindow) {
|
|
422
|
+
// noop
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Points the application-level orientation, appearance and layout direction at the
|
|
426
|
+
* primary window, which owns those values now that each window has its own.
|
|
427
|
+
*/
|
|
428
|
+
trackPrimaryWindowTraits(nativeWindow) {
|
|
429
|
+
const target = nativeWindow ?? null;
|
|
430
|
+
if (this._traitsWindow === target) {
|
|
431
|
+
return;
|
|
432
|
+
}
|
|
433
|
+
const previous = this._traitsWindow;
|
|
434
|
+
if (previous) {
|
|
435
|
+
previous.off(NativeWindowEvents.orientationChanged, this.onWindowOrientationChanged, this);
|
|
436
|
+
previous.off(NativeWindowEvents.systemAppearanceChanged, this.onWindowSystemAppearanceChanged, this);
|
|
437
|
+
previous.off(NativeWindowEvents.layoutDirectionChanged, this.onWindowLayoutDirectionChanged, this);
|
|
438
|
+
}
|
|
439
|
+
this._traitsWindow = target;
|
|
440
|
+
if (!target) {
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
target.on(NativeWindowEvents.orientationChanged, this.onWindowOrientationChanged, this);
|
|
444
|
+
target.on(NativeWindowEvents.systemAppearanceChanged, this.onWindowSystemAppearanceChanged, this);
|
|
445
|
+
target.on(NativeWindowEvents.layoutDirectionChanged, this.onWindowLayoutDirectionChanged, this);
|
|
446
|
+
this.syncTraitsFromWindow(target);
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Adopts the window's values. The very first window seeds them quietly — there is no
|
|
450
|
+
* previous application state for it to differ from — while a later promotion raises
|
|
451
|
+
* the change events, because app code observed the outgoing window's values.
|
|
452
|
+
*/
|
|
453
|
+
syncTraitsFromWindow(nativeWindow) {
|
|
454
|
+
const orientation = nativeWindow.orientation();
|
|
455
|
+
if (orientation) {
|
|
456
|
+
if (this._orientation === undefined) {
|
|
457
|
+
this._orientation = orientation;
|
|
458
|
+
}
|
|
459
|
+
else {
|
|
460
|
+
this.setOrientation(orientation);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
const systemAppearance = nativeWindow.systemAppearance();
|
|
464
|
+
if (systemAppearance) {
|
|
465
|
+
if (this._systemAppearance === undefined) {
|
|
466
|
+
this._systemAppearance = systemAppearance;
|
|
467
|
+
}
|
|
468
|
+
else {
|
|
469
|
+
this.setSystemAppearance(systemAppearance);
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
const layoutDirection = nativeWindow.layoutDirection();
|
|
473
|
+
if (layoutDirection) {
|
|
474
|
+
if (this._layoutDirection === undefined) {
|
|
475
|
+
this._layoutDirection = layoutDirection;
|
|
476
|
+
}
|
|
477
|
+
else {
|
|
478
|
+
this.setLayoutDirection(layoutDirection);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
onWindowActivated(data) {
|
|
483
|
+
setActiveWindow(data.window);
|
|
484
|
+
}
|
|
485
|
+
onWindowOrientationChanged(data) {
|
|
486
|
+
this.setOrientation(data.newValue);
|
|
487
|
+
}
|
|
488
|
+
onWindowSystemAppearanceChanged(data) {
|
|
489
|
+
this.setSystemAppearance(data.newValue);
|
|
490
|
+
}
|
|
491
|
+
onWindowLayoutDirectionChanged(data) {
|
|
492
|
+
this.setLayoutDirection(data.newValue);
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* @internal - raises `ready` at most once per JS context.
|
|
496
|
+
*/
|
|
497
|
+
notifyReady() {
|
|
498
|
+
if (this._readyNotified) {
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
this._readyNotified = true;
|
|
502
|
+
getNativeScriptGlobals().setLaunched();
|
|
503
|
+
this.notify({
|
|
504
|
+
eventName: this.readyEvent,
|
|
505
|
+
object: this,
|
|
506
|
+
ios: this.ios,
|
|
507
|
+
android: this.android,
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* @internal - raises `exit` and re-arms the legacy `launch` bridge, since the process
|
|
512
|
+
* can outlive the exit and open a new first window.
|
|
513
|
+
*/
|
|
514
|
+
notifyExit(data) {
|
|
515
|
+
this._launchBridgeConsumed = false;
|
|
516
|
+
this.notify({
|
|
517
|
+
eventName: this.exitEvent,
|
|
518
|
+
object: this,
|
|
519
|
+
...data,
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* @internal - produces the content for a window that has none.
|
|
524
|
+
*
|
|
525
|
+
* Resolution order: the window content resolver, then the legacy `launch` event
|
|
526
|
+
* (offered to the first window that asks for content, and again to the first one after
|
|
527
|
+
* `exit`), then the application main entry. A resolver or a `launch` handler returning `null` takes
|
|
528
|
+
* ownership of the content, so nothing else is tried. A missing main entry leaves
|
|
529
|
+
* the window empty instead of throwing, because content can still arrive later
|
|
530
|
+
* through `run()`/`resetRootView()`.
|
|
531
|
+
*
|
|
532
|
+
* @param options.install `false` returns the resolved view instead of applying it,
|
|
533
|
+
* for platform pipelines that install the root view on the native surface themselves.
|
|
534
|
+
* @param options.launchData platform payload merged into the legacy `launch` event args.
|
|
535
|
+
* @returns The resolved view, or `null` when no content was produced.
|
|
536
|
+
*/
|
|
537
|
+
_resolveWindowContent(window, request, options) {
|
|
538
|
+
const content = this.resolveWindowContent(request, options?.launchData);
|
|
539
|
+
if (content == null) {
|
|
540
|
+
return null;
|
|
541
|
+
}
|
|
542
|
+
if (options?.install === false) {
|
|
543
|
+
return this.buildContentView(content);
|
|
544
|
+
}
|
|
545
|
+
window.setContent(content);
|
|
546
|
+
return window.rootView;
|
|
547
|
+
}
|
|
548
|
+
resolveWindowContent(request, launchData) {
|
|
549
|
+
const launchBridgeAvailable = !this._launchBridgeConsumed;
|
|
550
|
+
this._launchBridgeConsumed = true;
|
|
551
|
+
const resolver = this._windowContentResolver;
|
|
552
|
+
if (resolver) {
|
|
553
|
+
const resolved = resolver(request);
|
|
554
|
+
// `null` means the resolver supplies the content itself; only `undefined` falls through.
|
|
555
|
+
if (resolved !== undefined) {
|
|
556
|
+
this._ensureAppCssLoaded();
|
|
557
|
+
return resolved;
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
if (launchBridgeAvailable) {
|
|
561
|
+
const root = this.notifyLaunch(launchData);
|
|
562
|
+
if (root === null) {
|
|
563
|
+
return null;
|
|
564
|
+
}
|
|
565
|
+
if (root) {
|
|
566
|
+
return root;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
this._ensureAppCssLoaded();
|
|
570
|
+
const mainEntry = getAppMainEntry();
|
|
571
|
+
return mainEntry ? Builder.createViewFromEntry(mainEntry) : undefined;
|
|
572
|
+
}
|
|
573
|
+
buildContentView(content) {
|
|
574
|
+
if (typeof content === 'string') {
|
|
575
|
+
return Builder.createViewFromEntry({ moduleName: content });
|
|
576
|
+
}
|
|
577
|
+
const entry = content;
|
|
578
|
+
return entry.moduleName || entry.create ? Builder.createViewFromEntry(entry) : content;
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* Loads the app CSS once per JS context. On the legacy `launch` path this has to run
|
|
582
|
+
* after the handlers, which are allowed to call `setCssFileName()`.
|
|
583
|
+
*/
|
|
584
|
+
_ensureAppCssLoaded() {
|
|
585
|
+
if (this._appCssLoaded) {
|
|
586
|
+
return;
|
|
587
|
+
}
|
|
588
|
+
this._appCssLoaded = true;
|
|
589
|
+
this.loadAppCss();
|
|
590
|
+
}
|
|
217
591
|
notifyLaunch(additionalLanchEventData) {
|
|
592
|
+
this._launchBridgeConsumed = true;
|
|
218
593
|
const launchArgs = {
|
|
219
594
|
eventName: this.launchEvent,
|
|
220
595
|
object: this,
|
|
@@ -223,7 +598,7 @@ export class ApplicationCommon {
|
|
|
223
598
|
...additionalLanchEventData,
|
|
224
599
|
};
|
|
225
600
|
this.notify(launchArgs);
|
|
226
|
-
this.
|
|
601
|
+
this._ensureAppCssLoaded();
|
|
227
602
|
return launchArgs.root;
|
|
228
603
|
}
|
|
229
604
|
createRootView(view, fireLaunchEvent = false, additionalLanchEventData) {
|
|
@@ -253,8 +628,12 @@ export class ApplicationCommon {
|
|
|
253
628
|
setAppMainEntry(typeof entry === 'string' ? { moduleName: entry } : entry);
|
|
254
629
|
// rest of implementation is platform specific
|
|
255
630
|
}
|
|
256
|
-
|
|
257
|
-
|
|
631
|
+
/**
|
|
632
|
+
* @param window the window the root view belongs to. Supplies the window-scoped CSS
|
|
633
|
+
* classes; without it they come from the primary window.
|
|
634
|
+
*/
|
|
635
|
+
initRootView(rootView, window) {
|
|
636
|
+
this.setRootViewCSSClasses(rootView, window);
|
|
258
637
|
// ensure css is "loaded" on the rootview so that user rootview can access css variables right away
|
|
259
638
|
rootView._onCssStateChange(true);
|
|
260
639
|
this.notify({ eventName: this.initRootViewEvent, rootView });
|
|
@@ -348,18 +727,20 @@ export class ApplicationCommon {
|
|
|
348
727
|
object: this,
|
|
349
728
|
});
|
|
350
729
|
}
|
|
730
|
+
/**
|
|
731
|
+
* @deprecated Use Application.primaryWindow?.orientation() - or the NativeWindow of the relevant view - instead. Continues to reflect the primary window.
|
|
732
|
+
*/
|
|
351
733
|
orientation() {
|
|
352
|
-
return (this._orientation ?? (this._orientation = this.getOrientation()));
|
|
734
|
+
return this.primaryWindow?.orientation() ?? (this._orientation ?? (this._orientation = this.getOrientation()));
|
|
353
735
|
}
|
|
354
736
|
orientationChanged(rootView, newOrientation) {
|
|
355
737
|
if (!rootView) {
|
|
356
738
|
return;
|
|
357
739
|
}
|
|
358
740
|
const newOrientationCssClass = `${CSSUtils.CLASS_PREFIX}${newOrientation}`;
|
|
359
|
-
this.
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
this.applyCssClass(rootModalView, ORIENTATION_CSS_CLASSES, newOrientationCssClass, true);
|
|
741
|
+
this.applyWindowScopedCssClass(rootView, ORIENTATION_CSS_CLASSES, newOrientationCssClass);
|
|
742
|
+
this.getOwnedModalViews(rootView).forEach((rootModalView) => {
|
|
743
|
+
this.applyWindowScopedCssClass(rootModalView, ORIENTATION_CSS_CLASSES, newOrientationCssClass);
|
|
363
744
|
// Trigger state change for root modal view classes and media queries
|
|
364
745
|
rootModalView._onCssStateChange();
|
|
365
746
|
});
|
|
@@ -391,19 +772,21 @@ export class ApplicationCommon {
|
|
|
391
772
|
object: this,
|
|
392
773
|
};
|
|
393
774
|
this.notify(args);
|
|
394
|
-
if (args.cancel === false) {
|
|
775
|
+
if (args.cancel === false && this.autoSystemAppearanceChanged) {
|
|
395
776
|
this.systemAppearanceChanged(this.getRootView(), value);
|
|
396
777
|
}
|
|
397
778
|
}
|
|
779
|
+
/**
|
|
780
|
+
* @deprecated Use Application.primaryWindow?.systemAppearance() - or the NativeWindow of the relevant view - instead. Continues to reflect the primary window.
|
|
781
|
+
*/
|
|
398
782
|
systemAppearance() {
|
|
399
|
-
|
|
400
|
-
return (this._systemAppearance ?? (this._systemAppearance = this.getSystemAppearance()));
|
|
783
|
+
return this.primaryWindow?.systemAppearance() ?? (this._systemAppearance ?? (this._systemAppearance = this.getSystemAppearance()));
|
|
401
784
|
}
|
|
402
785
|
/**
|
|
403
786
|
* enable/disable systemAppearanceChanged
|
|
404
787
|
*/
|
|
405
788
|
setAutoSystemAppearanceChanged(value) {
|
|
406
|
-
|
|
789
|
+
setAutoSystemAppearanceChanged(value);
|
|
407
790
|
}
|
|
408
791
|
/**
|
|
409
792
|
* Updates root view classes including those of modals
|
|
@@ -411,14 +794,13 @@ export class ApplicationCommon {
|
|
|
411
794
|
* @param newSystemAppearance the new appearance change
|
|
412
795
|
*/
|
|
413
796
|
systemAppearanceChanged(rootView, newSystemAppearance) {
|
|
414
|
-
if (!rootView
|
|
797
|
+
if (!rootView) {
|
|
415
798
|
return;
|
|
416
799
|
}
|
|
417
800
|
const newSystemAppearanceCssClass = `${CSSUtils.CLASS_PREFIX}${newSystemAppearance}`;
|
|
418
|
-
this.
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
this.applyCssClass(rootModalView, SYSTEM_APPEARANCE_CSS_CLASSES, newSystemAppearanceCssClass, true);
|
|
801
|
+
this.applyWindowScopedCssClass(rootView, SYSTEM_APPEARANCE_CSS_CLASSES, newSystemAppearanceCssClass);
|
|
802
|
+
this.getOwnedModalViews(rootView).forEach((rootModalView) => {
|
|
803
|
+
this.applyWindowScopedCssClass(rootModalView, SYSTEM_APPEARANCE_CSS_CLASSES, newSystemAppearanceCssClass);
|
|
422
804
|
// Trigger state change for root modal view classes and media queries
|
|
423
805
|
rootModalView._onCssStateChange();
|
|
424
806
|
});
|
|
@@ -443,9 +825,11 @@ export class ApplicationCommon {
|
|
|
443
825
|
object: this,
|
|
444
826
|
});
|
|
445
827
|
}
|
|
828
|
+
/**
|
|
829
|
+
* @deprecated Use Application.primaryWindow?.layoutDirection() - or the NativeWindow of the relevant view - instead. Continues to reflect the primary window.
|
|
830
|
+
*/
|
|
446
831
|
layoutDirection() {
|
|
447
|
-
|
|
448
|
-
return (this._layoutDirection ?? (this._layoutDirection = this.getLayoutDirection()));
|
|
832
|
+
return this.primaryWindow?.layoutDirection() ?? (this._layoutDirection ?? (this._layoutDirection = this.getLayoutDirection()));
|
|
449
833
|
}
|
|
450
834
|
/**
|
|
451
835
|
* Updates root view classes including those of modals
|
|
@@ -457,10 +841,9 @@ export class ApplicationCommon {
|
|
|
457
841
|
return;
|
|
458
842
|
}
|
|
459
843
|
const newLayoutDirectionCssClass = `${CSSUtils.CLASS_PREFIX}${newLayoutDirection}`;
|
|
460
|
-
this.
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
this.applyCssClass(rootModalView, LAYOUT_DIRECTION_CSS_CLASSES, newLayoutDirectionCssClass, true);
|
|
844
|
+
this.applyWindowScopedCssClass(rootView, LAYOUT_DIRECTION_CSS_CLASSES, newLayoutDirectionCssClass);
|
|
845
|
+
this.getOwnedModalViews(rootView).forEach((rootModalView) => {
|
|
846
|
+
this.applyWindowScopedCssClass(rootModalView, LAYOUT_DIRECTION_CSS_CLASSES, newLayoutDirectionCssClass);
|
|
464
847
|
// Trigger state change for root modal view classes and media queries
|
|
465
848
|
rootModalView._onCssStateChange();
|
|
466
849
|
});
|