@nativescript/core 9.1.0-dev.0 → 9.1.0-next.0
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/accessibility/accessibility-common.d.ts +8 -0
- package/accessibility/accessibility-common.js +28 -0
- package/accessibility/accessibility-common.js.map +1 -1
- package/application/application-common.d.ts +188 -6
- package/application/application-common.js +402 -98
- package/application/application-common.js.map +1 -1
- package/application/application-interfaces.d.ts +59 -1
- package/application/application.android.d.ts +38 -1
- package/application/application.android.js +195 -12
- package/application/application.android.js.map +1 -1
- package/application/application.d.ts +121 -75
- package/application/application.ios.d.ts +106 -28
- package/application/application.ios.js +619 -343
- 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/scene-delegate-bridge.d.ts +55 -0
- package/application/scene-delegate-bridge.js +122 -0
- package/application/scene-delegate-bridge.js.map +1 -0
- package/color/index.d.ts +0 -5
- package/config/config.interface.d.ts +44 -2
- package/core-types/index.d.ts +9 -2
- package/core-types/index.js +7 -0
- package/core-types/index.js.map +1 -1
- package/css/CSS3Parser.js +3 -2
- package/css/CSS3Parser.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/data/observable/index.d.ts +5 -0
- package/data/observable/index.js +46 -9
- package/data/observable/index.js.map +1 -1
- package/debugger/dom-types.js +31 -1
- package/debugger/dom-types.js.map +1 -1
- package/fetch/index.mjs +2 -2
- package/file-system/file-system-access.ios.js +18 -10
- package/file-system/file-system-access.ios.js.map +1 -1
- package/file-system/index.d.ts +3 -3
- package/global-types.d.ts +39 -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 +18 -5
- package/globals/index.js.map +1 -1
- package/globals/polyfills/utils.js +2 -0
- package/globals/polyfills/utils.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/index.android.d.ts +7 -1
- 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.map +1 -1
- package/image-source/index.android.d.ts +0 -1
- package/image-source/index.android.js.map +1 -1
- package/image-source/index.d.ts +0 -5
- package/image-source/index.ios.d.ts +0 -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/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 +57 -0
- package/native-window/native-window.ios.js +208 -0
- package/native-window/native-window.ios.js.map +1 -0
- package/native-window/window-base.d.ts +103 -0
- package/native-window/window-base.js +78 -0
- package/native-window/window-base.js.map +1 -0
- package/package.json +4 -6
- package/platform/common.d.ts +0 -2
- package/platform/common.js +0 -2
- package/platform/common.js.map +1 -1
- package/platforms/android/widgets-release.aar +0 -0
- package/platforms/ios/TNSWidgets.xcframework/Info.plist +14 -14
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Info.plist +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +78 -78
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Resources/Info.plist +7 -7
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Resources/Info.plist +7 -7
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Resources/Info.plist +7 -7
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +78 -78
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/x86_64/TNSWidgets.yml +78 -78
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Info.plist +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/_CodeSignature/CodeResources +1 -1
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +78 -78
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/x86_64/TNSWidgets.yml +78 -78
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Info.plist +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +78 -78
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Info.plist +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/_CodeSignature/CodeResources +1 -1
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +78 -78
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/x86_64/TNSWidgets.yml +78 -78
- package/platforms/ios/src/NativeScriptMainWindow.swift +72 -39
- package/references.d.ts +0 -4
- package/trace/index.d.ts +2 -2
- package/ui/action-bar/action-bar-common.js +0 -1
- package/ui/action-bar/action-bar-common.js.map +1 -1
- package/ui/action-bar/index.ios.js +0 -1
- package/ui/action-bar/index.ios.js.map +1 -1
- package/ui/animation/keyframe-animation.d.ts +1 -1
- package/ui/builder/index.d.ts +0 -1
- package/ui/builder/index.js +10 -3
- package/ui/builder/index.js.map +1 -1
- package/ui/button/index.android.d.ts +2 -9
- package/ui/button/index.android.js +7 -24
- package/ui/button/index.android.js.map +1 -1
- package/ui/button/index.ios.d.ts +2 -9
- package/ui/button/index.ios.js +17 -72
- package/ui/button/index.ios.js.map +1 -1
- package/ui/core/bindable/index.js +2 -1
- package/ui/core/bindable/index.js.map +1 -1
- package/ui/core/properties/index.d.ts +24 -1
- package/ui/core/properties/index.js +96 -10
- 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 +1 -0
- package/ui/core/view/index.android.js +42 -11
- 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 +28 -6
- package/ui/core/view/index.ios.js.map +1 -1
- package/ui/core/view/view-common.d.ts +37 -2
- package/ui/core/view/view-common.js +82 -6
- package/ui/core/view/view-common.js.map +1 -1
- package/ui/core/view/view-helper/index.d.ts +1 -0
- package/ui/core/view/view-helper/index.ios.d.ts +10 -0
- package/ui/core/view/view-helper/index.ios.js +33 -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-base/index.d.ts +37 -18
- package/ui/core/view-base/index.js +104 -65
- package/ui/core/view-base/index.js.map +1 -1
- package/ui/frame/fragment.transitions.android.d.ts +13 -13
- package/ui/frame/fragment.transitions.android.js.map +1 -1
- package/ui/frame/frame-common.d.ts +16 -3
- package/ui/frame/frame-common.js +19 -7
- 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 +6 -6
- package/ui/frame/frame-helper-for-android.js +31 -13
- package/ui/frame/frame-helper-for-android.js.map +1 -1
- package/ui/frame/frame-interfaces.d.ts +1 -1
- package/ui/frame/frame-stack.d.ts +17 -1
- package/ui/frame/frame-stack.js +32 -5
- package/ui/frame/frame-stack.js.map +1 -1
- package/ui/frame/index.android.d.ts +7 -12
- package/ui/frame/index.android.js +157 -97
- package/ui/frame/index.android.js.map +1 -1
- package/ui/frame/index.d.ts +27 -26
- package/ui/frame/index.ios.d.ts +2 -2
- package/ui/frame/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/label/index.ios.d.ts +2 -5
- package/ui/label/index.ios.js +12 -44
- package/ui/label/index.ios.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/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 +9 -17
- package/ui/layouts/flexbox-layout/flexbox-layout-common.js +11 -64
- 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 +244 -193
- package/ui/layouts/flexbox-layout/index.ios.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/layout-base-common.d.ts +1 -0
- package/ui/layouts/layout-base-common.js +21 -0
- package/ui/layouts/layout-base-common.js.map +1 -1
- package/ui/layouts/layout-base.android.d.ts +3 -10
- package/ui/layouts/layout-base.android.js +7 -24
- package/ui/layouts/layout-base.android.js.map +1 -1
- package/ui/layouts/layout-base.ios.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/wrap-layout/index.ios.js +3 -0
- package/ui/layouts/wrap-layout/index.ios.js.map +1 -1
- package/ui/list-view/index.android.js +3 -2
- package/ui/list-view/index.android.js.map +1 -1
- package/ui/list-view/index.d.ts +13 -1
- package/ui/list-view/index.ios.d.ts +5 -3
- package/ui/list-view/index.ios.js +63 -27
- package/ui/list-view/index.ios.js.map +1 -1
- package/ui/list-view/list-view-common.d.ts +15 -0
- package/ui/list-view/list-view-common.js +19 -0
- package/ui/list-view/list-view-common.js.map +1 -1
- package/ui/page/index.android.d.ts +1 -0
- package/ui/page/index.android.js +4 -0
- 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 +23 -6
- package/ui/page/index.ios.js.map +1 -1
- package/ui/page/page-common.d.ts +5 -2
- package/ui/page/page-common.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.d.ts +11 -0
- package/ui/scroll-view/index.ios.d.ts +3 -1
- package/ui/scroll-view/index.ios.js +28 -8
- package/ui/scroll-view/index.ios.js.map +1 -1
- package/ui/scroll-view/scroll-view-common.d.ts +6 -0
- package/ui/scroll-view/scroll-view-common.js +8 -0
- package/ui/scroll-view/scroll-view-common.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/styling/background-common.d.ts +2 -0
- package/ui/styling/background-common.js +9 -0
- package/ui/styling/background-common.js.map +1 -1
- package/ui/styling/background.ios.js +2 -0
- package/ui/styling/background.ios.js.map +1 -1
- package/ui/styling/css-selector.d.ts +57 -13
- package/ui/styling/css-selector.js +280 -51
- package/ui/styling/css-selector.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.d.ts +0 -4
- package/ui/styling/style/index.d.ts +12 -0
- package/ui/styling/style/index.js.map +1 -1
- package/ui/styling/style-properties.d.ts +6 -0
- package/ui/styling/style-properties.js +175 -106
- package/ui/styling/style-properties.js.map +1 -1
- package/ui/styling/style-scope.d.ts +15 -3
- package/ui/styling/style-scope.js +300 -65
- package/ui/styling/style-scope.js.map +1 -1
- package/ui/switch/index.ios.js +2 -1
- package/ui/switch/index.ios.js.map +1 -1
- package/ui/tab-view/index.android.d.ts +3 -1
- package/ui/tab-view/index.android.js +56 -46
- package/ui/tab-view/index.android.js.map +1 -1
- package/ui/tab-view/index.ios.d.ts +10 -1
- package/ui/tab-view/index.ios.js +22 -4
- 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 +16 -3
- package/ui/tab-view/tab-view-common.js.map +1 -1
- package/ui/text-base/index.android.d.ts +3 -10
- package/ui/text-base/index.android.js +15 -32
- package/ui/text-base/index.android.js.map +1 -1
- package/ui/text-base/index.ios.js +5 -3
- package/ui/text-base/index.ios.js.map +1 -1
- package/ui/text-field/index.ios.d.ts +2 -9
- package/ui/text-field/index.ios.js +2 -23
- package/ui/text-field/index.ios.js.map +1 -1
- package/ui/text-view/index.ios.d.ts +2 -9
- package/ui/text-view/index.ios.js +20 -72
- package/ui/text-view/index.ios.js.map +1 -1
- package/ui/transition/index.d.ts +2 -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.ios.d.ts +5 -0
- package/ui/transition/page-transition.ios.js +296 -33
- 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 +36 -0
- package/ui/transition/shared-transition-helper.ios.js +765 -89
- package/ui/transition/shared-transition-helper.ios.js.map +1 -1
- package/ui/transition/shared-transition.d.ts +67 -0
- package/ui/transition/shared-transition.js +62 -2
- package/ui/transition/shared-transition.js.map +1 -1
- package/utils/debug-source.js +0 -3
- package/utils/debug-source.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/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 +105 -2
- package/utils/native-helper.ios.js +15 -4
- package/utils/native-helper.ios.js.map +1 -1
- package/utils/native-helper.types.d.ts +2 -0
- package/utils/platform-check.d.ts +1 -1
- package/utils/platform-check.js.map +1 -1
- package/animation-frame/animation-native.windows.d.ts +0 -1
- package/animation-frame/animation-native.windows.js +0 -4
- package/animation-frame/animation-native.windows.js.map +0 -1
- package/application/application.windows.d.ts +0 -27
- package/application/application.windows.js +0 -331
- package/application/application.windows.js.map +0 -1
- package/application/helpers.windows.d.ts +0 -8
- package/application/helpers.windows.js +0 -12
- package/application/helpers.windows.js.map +0 -1
- package/application/index.windows.d.ts +0 -2
- package/application/index.windows.js +0 -3
- package/application/index.windows.js.map +0 -1
- package/application/window-helper.windows.d.ts +0 -29
- package/application/window-helper.windows.js +0 -159
- package/application/window-helper.windows.js.map +0 -1
- package/application-settings/index.windows.d.ts +0 -11
- package/application-settings/index.windows.js +0 -93
- package/application-settings/index.windows.js.map +0 -1
- package/color/index.windows.d.ts +0 -8
- package/color/index.windows.js +0 -19
- package/color/index.windows.js.map +0 -1
- package/connectivity/index.windows.d.ts +0 -11
- package/connectivity/index.windows.js +0 -50
- package/connectivity/index.windows.js.map +0 -1
- package/debugger/webinspector-network.windows.d.ts +0 -79
- package/debugger/webinspector-network.windows.js +0 -307
- package/debugger/webinspector-network.windows.js.map +0 -1
- package/file-system/file-system-access.windows.d.ts +0 -76
- package/file-system/file-system-access.windows.js +0 -476
- package/file-system/file-system-access.windows.js.map +0 -1
- package/fps-meter/fps-native.windows.d.ts +0 -8
- package/fps-meter/fps-native.windows.js +0 -40
- package/fps-meter/fps-native.windows.js.map +0 -1
- package/http/http-request/index.windows.d.ts +0 -2
- package/http/http-request/index.windows.js +0 -41
- package/http/http-request/index.windows.js.map +0 -1
- package/http/http-request-internal/index.windows.d.ts +0 -4
- package/http/http-request-internal/index.windows.js +0 -134
- package/http/http-request-internal/index.windows.js.map +0 -1
- package/image-asset/index.windows.d.ts +0 -9
- package/image-asset/index.windows.js +0 -34
- package/image-asset/index.windows.js.map +0 -1
- package/image-source/index.windows.d.ts +0 -52
- package/image-source/index.windows.js +0 -498
- package/image-source/index.windows.js.map +0 -1
- package/platform/device/index.windows.d.ts +0 -18
- package/platform/device/index.windows.js +0 -94
- package/platform/device/index.windows.js.map +0 -1
- package/platform/screen/index.windows.d.ts +0 -13
- package/platform/screen/index.windows.js +0 -25
- package/platform/screen/index.windows.js.map +0 -1
- package/platforms/windows/arm64/NativeScript.Widgets.dll +0 -0
- package/platforms/windows/arm64/NativeScript.Widgets.winmd +0 -0
- package/platforms/windows/x64/NativeScript.Widgets.dll +0 -0
- package/platforms/windows/x64/NativeScript.Widgets.winmd +0 -0
- package/plugin.props +0 -12
- package/plugin.targets +0 -71
- package/text/index.windows.d.ts +0 -9
- package/text/index.windows.js +0 -12
- package/text/index.windows.js.map +0 -1
- package/timer/index.windows.d.ts +0 -4
- package/timer/index.windows.js +0 -14
- package/timer/index.windows.js.map +0 -1
- package/ui/action-bar/index.windows.d.ts +0 -12
- package/ui/action-bar/index.windows.js +0 -36
- package/ui/action-bar/index.windows.js.map +0 -1
- package/ui/activity-indicator/index.windows.d.ts +0 -15
- package/ui/activity-indicator/index.windows.js +0 -65
- package/ui/activity-indicator/index.windows.js.map +0 -1
- package/ui/animation/index.windows.d.ts +0 -19
- package/ui/animation/index.windows.js +0 -603
- package/ui/animation/index.windows.js.map +0 -1
- package/ui/button/index.windows.d.ts +0 -13
- package/ui/button/index.windows.js +0 -73
- package/ui/button/index.windows.js.map +0 -1
- package/ui/core/control-state-change/index.windows.d.ts +0 -4
- package/ui/core/control-state-change/index.windows.js +0 -6
- package/ui/core/control-state-change/index.windows.js.map +0 -1
- package/ui/core/view/index.windows.d.ts +0 -120
- package/ui/core/view/index.windows.js +0 -2178
- package/ui/core/view/index.windows.js.map +0 -1
- package/ui/core/view/view-helper/index.windows.d.ts +0 -3
- package/ui/core/view/view-helper/index.windows.js +0 -4
- package/ui/core/view/view-helper/index.windows.js.map +0 -1
- package/ui/date-picker/index.windows.d.ts +0 -22
- package/ui/date-picker/index.windows.js +0 -97
- package/ui/date-picker/index.windows.js.map +0 -1
- package/ui/dialogs/index.windows.d.ts +0 -17
- package/ui/dialogs/index.windows.js +0 -471
- package/ui/dialogs/index.windows.js.map +0 -1
- package/ui/editable-text-base/index.windows.d.ts +0 -27
- package/ui/editable-text-base/index.windows.js +0 -165
- package/ui/editable-text-base/index.windows.js.map +0 -1
- package/ui/embedding/index.windows.d.ts +0 -1
- package/ui/embedding/index.windows.js +0 -4
- package/ui/embedding/index.windows.js.map +0 -1
- package/ui/frame/index.windows.d.ts +0 -52
- package/ui/frame/index.windows.js +0 -778
- package/ui/frame/index.windows.js.map +0 -1
- package/ui/gestures/index.windows.d.ts +0 -35
- package/ui/gestures/index.windows.js +0 -483
- package/ui/gestures/index.windows.js.map +0 -1
- package/ui/html-view/index.windows.d.ts +0 -18
- package/ui/html-view/index.windows.js +0 -191
- package/ui/html-view/index.windows.js.map +0 -1
- package/ui/image/index.windows.d.ts +0 -17
- package/ui/image/index.windows.js +0 -132
- package/ui/image/index.windows.js.map +0 -1
- package/ui/image/symbol-effects.windows.d.ts +0 -5
- package/ui/image/symbol-effects.windows.js +0 -8
- package/ui/image/symbol-effects.windows.js.map +0 -1
- package/ui/image-cache/index.windows.d.ts +0 -11
- package/ui/image-cache/index.windows.js +0 -48
- package/ui/image-cache/index.windows.js.map +0 -1
- package/ui/label/index.windows.d.ts +0 -15
- package/ui/label/index.windows.js +0 -66
- package/ui/label/index.windows.js.map +0 -1
- package/ui/layouts/absolute-layout/index.windows.d.ts +0 -8
- package/ui/layouts/absolute-layout/index.windows.js +0 -47
- package/ui/layouts/absolute-layout/index.windows.js.map +0 -1
- package/ui/layouts/dock-layout/index.windows.d.ts +0 -19
- package/ui/layouts/dock-layout/index.windows.js +0 -202
- package/ui/layouts/dock-layout/index.windows.js.map +0 -1
- package/ui/layouts/flexbox-layout/index.windows.d.ts +0 -27
- package/ui/layouts/flexbox-layout/index.windows.js +0 -188
- package/ui/layouts/flexbox-layout/index.windows.js.map +0 -1
- package/ui/layouts/grid-layout/index.windows.d.ts +0 -20
- package/ui/layouts/grid-layout/index.windows.js +0 -130
- package/ui/layouts/grid-layout/index.windows.js.map +0 -1
- package/ui/layouts/layout-base.windows.d.ts +0 -4
- package/ui/layouts/layout-base.windows.js +0 -5
- package/ui/layouts/layout-base.windows.js.map +0 -1
- package/ui/layouts/liquid-glass/index.windows.d.ts +0 -4
- package/ui/layouts/liquid-glass/index.windows.js +0 -5
- package/ui/layouts/liquid-glass/index.windows.js.map +0 -1
- package/ui/layouts/liquid-glass-container/index.windows.d.ts +0 -4
- package/ui/layouts/liquid-glass-container/index.windows.js +0 -5
- package/ui/layouts/liquid-glass-container/index.windows.js.map +0 -1
- package/ui/layouts/root-layout/index.windows.d.ts +0 -13
- package/ui/layouts/root-layout/index.windows.js +0 -160
- package/ui/layouts/root-layout/index.windows.js.map +0 -1
- package/ui/layouts/stack-layout/index.windows.d.ts +0 -13
- package/ui/layouts/stack-layout/index.windows.js +0 -63
- package/ui/layouts/stack-layout/index.windows.js.map +0 -1
- package/ui/layouts/wrap-layout/index.windows.d.ts +0 -20
- package/ui/layouts/wrap-layout/index.windows.js +0 -182
- package/ui/layouts/wrap-layout/index.windows.js.map +0 -1
- package/ui/list-picker/index.windows.d.ts +0 -19
- package/ui/list-picker/index.windows.js +0 -75
- package/ui/list-picker/index.windows.js.map +0 -1
- package/ui/list-view/index.windows.d.ts +0 -60
- package/ui/list-view/index.windows.js +0 -842
- package/ui/list-view/index.windows.js.map +0 -1
- package/ui/page/index.windows.d.ts +0 -12
- package/ui/page/index.windows.js +0 -42
- package/ui/page/index.windows.js.map +0 -1
- package/ui/progress/index.windows.d.ts +0 -20
- package/ui/progress/index.windows.js +0 -65
- package/ui/progress/index.windows.js.map +0 -1
- package/ui/scroll-view/index.windows.d.ts +0 -29
- package/ui/scroll-view/index.windows.js +0 -192
- package/ui/scroll-view/index.windows.js.map +0 -1
- package/ui/search-bar/index.windows.d.ts +0 -19
- package/ui/search-bar/index.windows.js +0 -91
- package/ui/search-bar/index.windows.js.map +0 -1
- package/ui/segmented-bar/index.windows.d.ts +0 -23
- package/ui/segmented-bar/index.windows.js +0 -117
- package/ui/segmented-bar/index.windows.js.map +0 -1
- package/ui/slider/index.windows.d.ts +0 -25
- package/ui/slider/index.windows.js +0 -134
- package/ui/slider/index.windows.js.map +0 -1
- package/ui/split-view/index.windows.d.ts +0 -49
- package/ui/split-view/index.windows.js +0 -549
- package/ui/split-view/index.windows.js.map +0 -1
- package/ui/styling/background.windows.d.ts +0 -2
- package/ui/styling/background.windows.js +0 -2
- package/ui/styling/background.windows.js.map +0 -1
- package/ui/styling/font.windows.d.ts +0 -25
- package/ui/styling/font.windows.js +0 -213
- package/ui/styling/font.windows.js.map +0 -1
- package/ui/switch/index.windows.d.ts +0 -20
- package/ui/switch/index.windows.js +0 -97
- package/ui/switch/index.windows.js.map +0 -1
- package/ui/tab-view/index.windows.d.ts +0 -29
- package/ui/tab-view/index.windows.js +0 -268
- package/ui/tab-view/index.windows.js.map +0 -1
- package/ui/text-base/index.windows.d.ts +0 -47
- package/ui/text-base/index.windows.js +0 -639
- package/ui/text-base/index.windows.js.map +0 -1
- package/ui/text-field/index.windows.d.ts +0 -23
- package/ui/text-field/index.windows.js +0 -186
- package/ui/text-field/index.windows.js.map +0 -1
- package/ui/text-view/index.windows.d.ts +0 -12
- package/ui/text-view/index.windows.js +0 -47
- package/ui/text-view/index.windows.js.map +0 -1
- package/ui/time-picker/index.windows.d.ts +0 -18
- package/ui/time-picker/index.windows.js +0 -77
- package/ui/time-picker/index.windows.js.map +0 -1
- package/ui/transition/fade-transition.windows.d.ts +0 -3
- package/ui/transition/fade-transition.windows.js +0 -4
- package/ui/transition/fade-transition.windows.js.map +0 -1
- package/ui/transition/index.windows.d.ts +0 -20
- package/ui/transition/index.windows.js +0 -30
- package/ui/transition/index.windows.js.map +0 -1
- package/ui/transition/modal-transition.windows.d.ts +0 -3
- package/ui/transition/modal-transition.windows.js +0 -4
- package/ui/transition/modal-transition.windows.js.map +0 -1
- package/ui/transition/page-transition.windows.d.ts +0 -3
- package/ui/transition/page-transition.windows.js +0 -4
- package/ui/transition/page-transition.windows.js.map +0 -1
- package/ui/transition/shared-transition-helper.windows.d.ts +0 -30
- package/ui/transition/shared-transition-helper.windows.js +0 -155
- package/ui/transition/shared-transition-helper.windows.js.map +0 -1
- package/ui/transition/slide-transition.windows.d.ts +0 -3
- package/ui/transition/slide-transition.windows.js +0 -4
- package/ui/transition/slide-transition.windows.js.map +0 -1
- package/ui/utils.windows.d.ts +0 -9
- package/ui/utils.windows.js +0 -21
- package/ui/utils.windows.js.map +0 -1
- package/ui/web-view/index.windows.d.ts +0 -23
- package/ui/web-view/index.windows.js +0 -115
- package/ui/web-view/index.windows.js.map +0 -1
- package/utils/constants.windows.d.ts +0 -2
- package/utils/constants.windows.js +0 -5
- package/utils/constants.windows.js.map +0 -1
- package/utils/index.windows.d.ts +0 -20
- package/utils/index.windows.js +0 -94
- package/utils/index.windows.js.map +0 -1
- package/utils/layout-helper/index.windows.d.ts +0 -25
- package/utils/layout-helper/index.windows.js +0 -74
- package/utils/layout-helper/index.windows.js.map +0 -1
- package/utils/mainthread-helper.windows.d.ts +0 -3
- package/utils/mainthread-helper.windows.js +0 -18
- package/utils/mainthread-helper.windows.js.map +0 -1
- package/utils/native-helper.windows.d.ts +0 -8
- package/utils/native-helper.windows.js +0 -101
- package/utils/native-helper.windows.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getNativeScriptGlobals } from '../../globals/global-utils';
|
|
2
|
-
import { _evaluateCssVariableExpression, _evaluateCssCalcExpression, isCssVariable, isCssVariableExpression, isCssCalcExpression } from '../core/properties';
|
|
2
|
+
import { _evaluateCssVariableExpression, _evaluateCssCalcExpression, _expandCssShorthand, _isCssPendingSubstitution, isCssVariable, isCssVariableExpression, isCssCalcExpression } from '../core/properties';
|
|
3
3
|
import { unsetValue } from '../core/properties/property-shared';
|
|
4
|
-
import { StyleSheetSelectorScope, SelectorsMatch, fromAstNode,
|
|
4
|
+
import { StyleSheetSelectorScope, SelectorsMatch, fromAstNode, matchMediaQueryString, matchSelectorCandidates } from './css-selector';
|
|
5
5
|
import { Trace } from './styling-shared';
|
|
6
6
|
import { File, knownFolders, path } from '../../file-system';
|
|
7
7
|
import { Application } from '../../application';
|
|
@@ -10,7 +10,6 @@ import { KeyframeAnimationInfo, KeyframeAnimation } from '../animation/keyframe-
|
|
|
10
10
|
import { CssAnimationParser } from './css-animation-parser';
|
|
11
11
|
import { sanitizeModuleName } from '../../utils/common';
|
|
12
12
|
import { resolveModuleName } from '../../module-name-resolver';
|
|
13
|
-
import { cleanupImportantFlags } from './css-utils';
|
|
14
13
|
import { cssTreeParse } from '../../css/css-tree-parser';
|
|
15
14
|
import { CSS3Parser } from '../../css/CSS3Parser';
|
|
16
15
|
import { CSSNativeScript } from '../../css/CSSNativeScript';
|
|
@@ -34,15 +33,49 @@ catch (e) {
|
|
|
34
33
|
let mergedApplicationCssSelectors = [];
|
|
35
34
|
let applicationCssSelectors = [];
|
|
36
35
|
const applicationAdditionalSelectors = [];
|
|
36
|
+
let mergedApplicationCssSelectorsInvalid = false;
|
|
37
37
|
let mergedApplicationCssKeyframes = [];
|
|
38
38
|
let applicationCssKeyframes = [];
|
|
39
39
|
const applicationAdditionalKeyframes = [];
|
|
40
|
+
let mergedApplicationCssKeyframesInvalid = false;
|
|
40
41
|
let applicationCssSelectorVersion = 0;
|
|
42
|
+
/**
|
|
43
|
+
* Shared index over the application stylesheets, built once for all style scopes.
|
|
44
|
+
* Tagged rules stay in it and are filtered out at match time - see `matchSelectorCandidates`.
|
|
45
|
+
*/
|
|
46
|
+
let applicationSelectorScope = null;
|
|
47
|
+
let applicationSelectorScopeVersion = -1;
|
|
48
|
+
let applicationSelectorScopeRuleCount = 0;
|
|
49
|
+
let applicationSelectorsHaveScopedTags = false;
|
|
50
|
+
/** Bumped when the application rules change in a way an append cannot express. */
|
|
51
|
+
let applicationSelectorsResetVersion = 0;
|
|
52
|
+
let applicationSelectorScopeResetVersion = -1;
|
|
41
53
|
const tagToScopeTag = new Map();
|
|
42
54
|
let currentScopeTag = null;
|
|
43
55
|
const animationsSymbol = Symbol('animations');
|
|
44
56
|
const kebabCasePattern = /-([a-z])/g;
|
|
57
|
+
const kebabCaseReplacementFunc = (g) => g[1].toUpperCase();
|
|
45
58
|
const pattern = /('|")(.*?)\1/;
|
|
59
|
+
/**
|
|
60
|
+
* Parse a pending-substitution shorthand once its expression has been evaluated
|
|
61
|
+
* against the view; a value that does not survive evaluation leaves its longhands unset.
|
|
62
|
+
*/
|
|
63
|
+
function resolvePendingSubstitution(view, pending) {
|
|
64
|
+
const value = evaluateCssExpressions(view, pending.shorthand, pending.value);
|
|
65
|
+
if (value === unsetValue) {
|
|
66
|
+
return CssState.emptyPropertyBag;
|
|
67
|
+
}
|
|
68
|
+
const expanded = _expandCssShorthand(pending.shorthand, value);
|
|
69
|
+
if (!expanded) {
|
|
70
|
+
Trace.write(`Failed to expand shorthand [${pending.shorthand}] resolved to [${value}] for ${view}.`, Trace.categories.Style, Trace.messageType.warn);
|
|
71
|
+
return CssState.emptyPropertyBag;
|
|
72
|
+
}
|
|
73
|
+
const resolved = {};
|
|
74
|
+
for (let i = 0, length = expanded.length; i < length; i++) {
|
|
75
|
+
resolved[expanded[i][0]] = expanded[i][1];
|
|
76
|
+
}
|
|
77
|
+
return resolved;
|
|
78
|
+
}
|
|
46
79
|
/**
|
|
47
80
|
* Evaluate css-variable and css-calc expressions
|
|
48
81
|
*/
|
|
@@ -61,13 +94,66 @@ function evaluateCssExpressions(view, property, value) {
|
|
|
61
94
|
}
|
|
62
95
|
return value;
|
|
63
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Only marks the merged list dirty - it is rebuilt on next read, since frameworks
|
|
99
|
+
* register stylesheets one call at a time.
|
|
100
|
+
*/
|
|
64
101
|
export function mergeCssSelectors() {
|
|
65
|
-
|
|
66
|
-
mergedApplicationCssSelectors.push(...applicationAdditionalSelectors);
|
|
102
|
+
mergedApplicationCssSelectorsInvalid = true;
|
|
67
103
|
}
|
|
68
104
|
export function mergeCssKeyframes() {
|
|
69
|
-
|
|
70
|
-
|
|
105
|
+
mergedApplicationCssKeyframesInvalid = true;
|
|
106
|
+
}
|
|
107
|
+
function getMergedApplicationCssSelectors() {
|
|
108
|
+
if (mergedApplicationCssSelectorsInvalid) {
|
|
109
|
+
mergedApplicationCssSelectorsInvalid = false;
|
|
110
|
+
mergedApplicationCssSelectors = concatRuleSets(applicationCssSelectors, applicationAdditionalSelectors);
|
|
111
|
+
}
|
|
112
|
+
return mergedApplicationCssSelectors;
|
|
113
|
+
}
|
|
114
|
+
function getMergedApplicationCssKeyframes() {
|
|
115
|
+
if (mergedApplicationCssKeyframesInvalid) {
|
|
116
|
+
mergedApplicationCssKeyframesInvalid = false;
|
|
117
|
+
mergedApplicationCssKeyframes = concatRuleSets(applicationCssKeyframes, applicationAdditionalKeyframes);
|
|
118
|
+
}
|
|
119
|
+
return mergedApplicationCssKeyframes;
|
|
120
|
+
}
|
|
121
|
+
function getApplicationSelectorScope() {
|
|
122
|
+
if (applicationSelectorScopeVersion === applicationCssSelectorVersion) {
|
|
123
|
+
return applicationSelectorScope;
|
|
124
|
+
}
|
|
125
|
+
const rulesets = getMergedApplicationCssSelectors();
|
|
126
|
+
const canAppend = applicationSelectorScope && applicationSelectorScopeResetVersion === applicationSelectorsResetVersion && rulesets.length >= applicationSelectorScopeRuleCount;
|
|
127
|
+
if (canAppend) {
|
|
128
|
+
applicationSelectorScope.appendRulesets(rulesets, applicationSelectorScopeRuleCount);
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
applicationSelectorScope = rulesets.length > 0 ? new StyleSheetSelectorScope(rulesets, 0 /* SelectorTier.Application */) : null;
|
|
132
|
+
applicationSelectorsHaveScopedTags = false;
|
|
133
|
+
applicationSelectorScopeRuleCount = 0;
|
|
134
|
+
}
|
|
135
|
+
for (let i = applicationSelectorScopeRuleCount, length = rulesets.length; i < length; i++) {
|
|
136
|
+
if (rulesets[i].scopedTag) {
|
|
137
|
+
applicationSelectorsHaveScopedTags = true;
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
applicationSelectorScopeRuleCount = rulesets.length;
|
|
142
|
+
applicationSelectorScopeVersion = applicationCssSelectorVersion;
|
|
143
|
+
applicationSelectorScopeResetVersion = applicationSelectorsResetVersion;
|
|
144
|
+
return applicationSelectorScope;
|
|
145
|
+
}
|
|
146
|
+
/** Avoids `push(...arr)`, which blows the stack past the engine's argument limit. */
|
|
147
|
+
function concatRuleSets(base, additional) {
|
|
148
|
+
const baseLength = base.length;
|
|
149
|
+
const merged = new Array(baseLength + additional.length);
|
|
150
|
+
for (let i = 0; i < baseLength; i++) {
|
|
151
|
+
merged[i] = base[i];
|
|
152
|
+
}
|
|
153
|
+
for (let i = 0, length = additional.length; i < length; i++) {
|
|
154
|
+
merged[baseLength + i] = additional[i];
|
|
155
|
+
}
|
|
156
|
+
return merged;
|
|
71
157
|
}
|
|
72
158
|
class CSSSource {
|
|
73
159
|
constructor(_ast, _url, _file, _source) {
|
|
@@ -163,14 +249,6 @@ class CSSSource {
|
|
|
163
249
|
return this._source;
|
|
164
250
|
}
|
|
165
251
|
load() {
|
|
166
|
-
// The resolved CSS path may not exist on disk — e.g. on Windows app.css is bundled into the
|
|
167
|
-
// JS (applied via addTaggedAdditionalCSS) and never deployed as a standalone file, so
|
|
168
|
-
// resolveFileNameFromUrl falls back to a non-existent candidate path. Calling readTextSync()
|
|
169
|
-
// on a missing file aborts the runtime (a native panic that bypasses JS try/catch) rather than
|
|
170
|
-
// throwing a catchable error, so guard with File.exists() before reading.
|
|
171
|
-
if (!this._file || !File.exists(this._file)) {
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
252
|
const file = File.fromPath(this._file);
|
|
175
253
|
this._source = file.readTextSync();
|
|
176
254
|
}
|
|
@@ -199,7 +277,7 @@ class CSSSource {
|
|
|
199
277
|
this._selectors = [];
|
|
200
278
|
}
|
|
201
279
|
}
|
|
202
|
-
|
|
280
|
+
parseCSSAst() {
|
|
203
281
|
if (this._source) {
|
|
204
282
|
if (__CSS_PARSER__ === 'css-tree') {
|
|
205
283
|
this._ast = cssTreeParse(this._source, this._file);
|
|
@@ -252,7 +330,7 @@ __decorate([
|
|
|
252
330
|
profile,
|
|
253
331
|
__metadata("design:type", Function),
|
|
254
332
|
__metadata("design:paramtypes", []),
|
|
255
|
-
__metadata("design:returntype",
|
|
333
|
+
__metadata("design:returntype", void 0)
|
|
256
334
|
], CSSSource.prototype, "parseCSSAst", null);
|
|
257
335
|
__decorate([
|
|
258
336
|
profile,
|
|
@@ -304,8 +382,20 @@ export function _populateRules(nodes, rulesets, keyframes, mediaQueryString) {
|
|
|
304
382
|
keyframes.push(keyframeRule);
|
|
305
383
|
}
|
|
306
384
|
else if (isMedia(node)) {
|
|
307
|
-
// Media query
|
|
308
|
-
|
|
385
|
+
// Media query can be an array of strings in case of nested queries
|
|
386
|
+
let compositeMediaQuery;
|
|
387
|
+
if (mediaQueryString) {
|
|
388
|
+
if (typeof mediaQueryString === 'string') {
|
|
389
|
+
compositeMediaQuery = [mediaQueryString, node.media];
|
|
390
|
+
}
|
|
391
|
+
else {
|
|
392
|
+
mediaQueryString.push(node.media);
|
|
393
|
+
compositeMediaQuery = mediaQueryString;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
else {
|
|
397
|
+
compositeMediaQuery = node.media;
|
|
398
|
+
}
|
|
309
399
|
_populateRules(node.rules, rulesets, keyframes, compositeMediaQuery);
|
|
310
400
|
}
|
|
311
401
|
else if (isRule(node)) {
|
|
@@ -334,6 +424,8 @@ export function removeTaggedAdditionalCSS(tag) {
|
|
|
334
424
|
}
|
|
335
425
|
}
|
|
336
426
|
if (selectorsChanged) {
|
|
427
|
+
// Rules were dropped from the middle of the list, so the index has to be rebuilt.
|
|
428
|
+
applicationSelectorsResetVersion++;
|
|
337
429
|
mergeCssSelectors();
|
|
338
430
|
updated = true;
|
|
339
431
|
}
|
|
@@ -421,6 +513,8 @@ const loadCss = profile(`"style-scope".loadCss`, (cssModule) => {
|
|
|
421
513
|
let updated = false;
|
|
422
514
|
// Check for existing application css selectors too in case the app is undergoing a live-sync
|
|
423
515
|
if (selectors.length > 0 || applicationCssSelectors.length > 0) {
|
|
516
|
+
// The base stylesheet is replaced rather than appended to.
|
|
517
|
+
applicationSelectorsResetVersion++;
|
|
424
518
|
applicationCssSelectors = selectors;
|
|
425
519
|
mergeCssSelectors();
|
|
426
520
|
updated = true;
|
|
@@ -456,6 +550,36 @@ if (Application.hasLaunched()) {
|
|
|
456
550
|
else {
|
|
457
551
|
getNativeScriptGlobals().events.on('loadAppCss', loadAppCSS);
|
|
458
552
|
}
|
|
553
|
+
function trackedNamesEqual(a, b) {
|
|
554
|
+
if (a === b) {
|
|
555
|
+
return true;
|
|
556
|
+
}
|
|
557
|
+
if (!a || !b || a.size !== b.size) {
|
|
558
|
+
return false;
|
|
559
|
+
}
|
|
560
|
+
for (const name of a) {
|
|
561
|
+
if (!b.has(name)) {
|
|
562
|
+
return false;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
return true;
|
|
566
|
+
}
|
|
567
|
+
/** Two empty maps compare equal even when they are different objects. */
|
|
568
|
+
function changeMapsEqual(applied, current) {
|
|
569
|
+
if (applied === current) {
|
|
570
|
+
return true;
|
|
571
|
+
}
|
|
572
|
+
if (applied.size !== current.size) {
|
|
573
|
+
return false;
|
|
574
|
+
}
|
|
575
|
+
for (const [view, changes] of applied) {
|
|
576
|
+
const currentChanges = current.get(view);
|
|
577
|
+
if (!currentChanges || !trackedNamesEqual(changes.attributes, currentChanges.attributes) || !trackedNamesEqual(changes.pseudoClasses, currentChanges.pseudoClasses)) {
|
|
578
|
+
return false;
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
return true;
|
|
582
|
+
}
|
|
459
583
|
export class CssState {
|
|
460
584
|
constructor(viewRef) {
|
|
461
585
|
this.viewRef = viewRef;
|
|
@@ -469,9 +593,13 @@ export class CssState {
|
|
|
469
593
|
onChange() {
|
|
470
594
|
const view = this.viewRef.get();
|
|
471
595
|
if (view && view.isLoaded) {
|
|
472
|
-
|
|
596
|
+
// Matching does not read the subscriptions, so re-subscribe only when the
|
|
597
|
+
// dependencies actually changed - they are usually identical.
|
|
473
598
|
this.updateMatch();
|
|
474
|
-
this.
|
|
599
|
+
if (!changeMapsEqual(this._appliedChangeMap, this._match.changeMap)) {
|
|
600
|
+
this.unsubscribeFromDynamicUpdates();
|
|
601
|
+
this.subscribeForDynamicUpdates();
|
|
602
|
+
}
|
|
475
603
|
this.updateDynamicState();
|
|
476
604
|
}
|
|
477
605
|
else {
|
|
@@ -517,7 +645,14 @@ export class CssState {
|
|
|
517
645
|
Trace.write(`updateDynamicState not executed to view because ".viewRef" is cleared`, Trace.categories.Style, Trace.messageType.warn);
|
|
518
646
|
return;
|
|
519
647
|
}
|
|
520
|
-
const
|
|
648
|
+
const selectors = this._match.selectors;
|
|
649
|
+
const matchingSelectors = [];
|
|
650
|
+
for (let i = 0, length = selectors.length; i < length; i++) {
|
|
651
|
+
const sel = selectors[i];
|
|
652
|
+
if (!sel.dynamic || sel.match(view)) {
|
|
653
|
+
matchingSelectors.push(sel);
|
|
654
|
+
}
|
|
655
|
+
}
|
|
521
656
|
// Ideally we should return here if there are no matching selectors, however
|
|
522
657
|
// if there are property removals, returning here would not remove them
|
|
523
658
|
// this is seen in STYLE test in automated.
|
|
@@ -594,53 +729,117 @@ export class CssState {
|
|
|
594
729
|
const oldProperties = this._appliedPropertyValues;
|
|
595
730
|
// Update values for the scope's css-variables
|
|
596
731
|
view.style.resetScopedCssVariables();
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
732
|
+
let valuesToApply;
|
|
733
|
+
let cssExpsProperties;
|
|
734
|
+
let pendingProperties;
|
|
600
735
|
for (const property in newPropertyValues) {
|
|
601
|
-
const value =
|
|
602
|
-
|
|
736
|
+
const value = newPropertyValues[property];
|
|
737
|
+
if (_isCssPendingSubstitution(value)) {
|
|
738
|
+
// Resolvable only after the css variables below are up to date.
|
|
739
|
+
if (!pendingProperties) {
|
|
740
|
+
pendingProperties = {};
|
|
741
|
+
}
|
|
742
|
+
pendingProperties[property] = value;
|
|
743
|
+
continue;
|
|
744
|
+
}
|
|
745
|
+
// Expanded shorthand values are already converted and may not be strings.
|
|
746
|
+
const isCssExp = typeof value === 'string' && (isCssVariableExpression(value) || isCssCalcExpression(value));
|
|
603
747
|
if (isCssExp) {
|
|
604
748
|
// we handle css exp separately because css vars must be evaluated first
|
|
749
|
+
if (!cssExpsProperties) {
|
|
750
|
+
cssExpsProperties = {};
|
|
751
|
+
}
|
|
605
752
|
cssExpsProperties[property] = value;
|
|
606
753
|
continue;
|
|
607
754
|
}
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
755
|
+
// Whatever is left in oldProperties after these loops was removed and gets unset.
|
|
756
|
+
const hadOldValue = property in oldProperties;
|
|
757
|
+
const unchanged = hadOldValue && oldProperties[property] === value;
|
|
758
|
+
if (hadOldValue) {
|
|
759
|
+
delete oldProperties[property];
|
|
612
760
|
}
|
|
613
761
|
if (isCssVariable(property)) {
|
|
762
|
+
// The scoped css-variables were just reset, so they always have to be re-registered.
|
|
614
763
|
view.style.setScopedCssVariable(property, value);
|
|
615
764
|
delete newPropertyValues[property];
|
|
616
765
|
continue;
|
|
617
766
|
}
|
|
767
|
+
if (unchanged) {
|
|
768
|
+
continue;
|
|
769
|
+
}
|
|
770
|
+
if (!valuesToApply) {
|
|
771
|
+
valuesToApply = {};
|
|
772
|
+
}
|
|
618
773
|
valuesToApply[property] = value;
|
|
619
774
|
}
|
|
620
775
|
//we need to parse CSS vars first before evaluating css expressions
|
|
621
776
|
for (const property in cssExpsProperties) {
|
|
622
|
-
|
|
777
|
+
const hadOldValue = property in oldProperties;
|
|
778
|
+
const oldValue = hadOldValue ? oldProperties[property] : undefined;
|
|
779
|
+
if (hadOldValue) {
|
|
780
|
+
delete oldProperties[property];
|
|
781
|
+
}
|
|
623
782
|
const value = evaluateCssExpressions(view, property, cssExpsProperties[property]);
|
|
624
|
-
if (property
|
|
625
|
-
|
|
783
|
+
if (isCssVariable(property)) {
|
|
784
|
+
view.style.setScopedCssVariable(property, value);
|
|
785
|
+
delete newPropertyValues[property];
|
|
626
786
|
continue;
|
|
627
787
|
}
|
|
628
788
|
if (value === unsetValue) {
|
|
629
789
|
delete newPropertyValues[property];
|
|
630
790
|
}
|
|
631
|
-
|
|
632
|
-
|
|
791
|
+
else {
|
|
792
|
+
// Record the evaluated value - the next diff compares against it.
|
|
793
|
+
newPropertyValues[property] = value;
|
|
794
|
+
}
|
|
795
|
+
if (hadOldValue && oldValue === value) {
|
|
796
|
+
continue;
|
|
797
|
+
}
|
|
798
|
+
if (!valuesToApply) {
|
|
799
|
+
valuesToApply = {};
|
|
800
|
+
}
|
|
801
|
+
valuesToApply[property] = value;
|
|
802
|
+
}
|
|
803
|
+
// Each shorthand is resolved once, however many longhands point at it.
|
|
804
|
+
let resolvedShorthands;
|
|
805
|
+
for (const property in pendingProperties) {
|
|
806
|
+
const pending = pendingProperties[property];
|
|
807
|
+
if (!resolvedShorthands) {
|
|
808
|
+
resolvedShorthands = new Map();
|
|
809
|
+
}
|
|
810
|
+
let resolved = resolvedShorthands.get(pending);
|
|
811
|
+
if (!resolved) {
|
|
812
|
+
resolved = resolvePendingSubstitution(view, pending);
|
|
813
|
+
resolvedShorthands.set(pending, resolved);
|
|
814
|
+
}
|
|
815
|
+
const value = property in resolved ? resolved[property] : unsetValue;
|
|
816
|
+
const hadOldValue = property in oldProperties;
|
|
817
|
+
const oldValue = hadOldValue ? oldProperties[property] : undefined;
|
|
818
|
+
if (hadOldValue) {
|
|
819
|
+
delete oldProperties[property];
|
|
820
|
+
}
|
|
821
|
+
if (value === unsetValue) {
|
|
633
822
|
delete newPropertyValues[property];
|
|
634
823
|
}
|
|
824
|
+
else {
|
|
825
|
+
newPropertyValues[property] = value;
|
|
826
|
+
}
|
|
827
|
+
if (hadOldValue && oldValue === value) {
|
|
828
|
+
continue;
|
|
829
|
+
}
|
|
830
|
+
if (!valuesToApply) {
|
|
831
|
+
valuesToApply = {};
|
|
832
|
+
}
|
|
635
833
|
valuesToApply[property] = value;
|
|
636
834
|
}
|
|
637
|
-
// Unset removed values
|
|
835
|
+
// Unset removed values - the bag is keyed by longhands only, so unsetting
|
|
836
|
+
// one entry cannot clear a value another one set.
|
|
638
837
|
for (const property in oldProperties) {
|
|
639
838
|
if (property in view.style) {
|
|
640
839
|
view.style[`css:${property}`] = unsetValue;
|
|
641
840
|
}
|
|
642
841
|
else {
|
|
643
|
-
const camelCasedProperty = property.replace(kebabCasePattern,
|
|
842
|
+
const camelCasedProperty = property.replace(kebabCasePattern, kebabCaseReplacementFunc);
|
|
644
843
|
view[camelCasedProperty] = unsetValue;
|
|
645
844
|
}
|
|
646
845
|
}
|
|
@@ -652,7 +851,7 @@ export class CssState {
|
|
|
652
851
|
view.style[`css:${property}`] = value;
|
|
653
852
|
}
|
|
654
853
|
else {
|
|
655
|
-
const camelCasedProperty = property.replace(kebabCasePattern,
|
|
854
|
+
const camelCasedProperty = property.replace(kebabCasePattern, kebabCaseReplacementFunc);
|
|
656
855
|
view[camelCasedProperty] = value;
|
|
657
856
|
}
|
|
658
857
|
}
|
|
@@ -738,12 +937,13 @@ CssState.prototype._matchInvalid = true;
|
|
|
738
937
|
export class StyleScope {
|
|
739
938
|
constructor() {
|
|
740
939
|
this._css = '';
|
|
940
|
+
this._hasSelectors = false;
|
|
741
941
|
this._localCssSelectors = [];
|
|
742
942
|
this._localCssKeyframes = [];
|
|
743
943
|
this._localCssSelectorVersion = 0;
|
|
744
944
|
this._localCssSelectorsAppliedVersion = 0;
|
|
745
945
|
this._applicationCssSelectorsAppliedVersion = 0;
|
|
746
|
-
this._cssFiles =
|
|
946
|
+
this._cssFiles = new Set();
|
|
747
947
|
}
|
|
748
948
|
get css() {
|
|
749
949
|
return this._css;
|
|
@@ -761,7 +961,7 @@ export class StyleScope {
|
|
|
761
961
|
if (!cssFileName) {
|
|
762
962
|
return;
|
|
763
963
|
}
|
|
764
|
-
this._cssFiles.
|
|
964
|
+
this._cssFiles.add(cssFileName);
|
|
765
965
|
currentScopeTag = cssFileName;
|
|
766
966
|
const cssFile = CSSSource.fromURI(cssFileName);
|
|
767
967
|
currentScopeTag = null;
|
|
@@ -784,7 +984,7 @@ export class StyleScope {
|
|
|
784
984
|
return;
|
|
785
985
|
}
|
|
786
986
|
if (cssFileName) {
|
|
787
|
-
this._cssFiles.
|
|
987
|
+
this._cssFiles.add(cssFileName);
|
|
788
988
|
currentScopeTag = cssFileName;
|
|
789
989
|
}
|
|
790
990
|
const cssFile = cssString ? CSSSource.fromSource(cssString, cssFileName) : CSSSource.fromURI(cssFileName);
|
|
@@ -805,11 +1005,25 @@ export class StyleScope {
|
|
|
805
1005
|
return animation;
|
|
806
1006
|
}
|
|
807
1007
|
ensureSelectors() {
|
|
808
|
-
if (!this.isApplicationCssSelectorsLatestVersionApplied() || !this.isLocalCssSelectorsLatestVersionApplied()
|
|
1008
|
+
if (!this.isApplicationCssSelectorsLatestVersionApplied() || !this.isLocalCssSelectorsLatestVersionApplied()) {
|
|
809
1009
|
this._createSelectors();
|
|
810
1010
|
}
|
|
811
1011
|
return this.getSelectorsVersion();
|
|
812
1012
|
}
|
|
1013
|
+
/**
|
|
1014
|
+
* True when any selector in the scope contains an adjacent sibling ('+') combinator.
|
|
1015
|
+
*/
|
|
1016
|
+
get hasAdjacentCombinatorSelectors() {
|
|
1017
|
+
this.ensureSelectors();
|
|
1018
|
+
return !!applicationSelectorScope?.hasAdjacentCombinatorSelectors || !!this._localSelectorScope?.hasAdjacentCombinatorSelectors;
|
|
1019
|
+
}
|
|
1020
|
+
/**
|
|
1021
|
+
* True when any selector in the scope contains a general sibling ('~') combinator.
|
|
1022
|
+
*/
|
|
1023
|
+
get hasSiblingCombinatorSelectors() {
|
|
1024
|
+
this.ensureSelectors();
|
|
1025
|
+
return !!applicationSelectorScope?.hasSiblingCombinatorSelectors || !!this._localSelectorScope?.hasSiblingCombinatorSelectors;
|
|
1026
|
+
}
|
|
813
1027
|
/**
|
|
814
1028
|
* Increase the application CSS selector version.
|
|
815
1029
|
*/
|
|
@@ -823,38 +1037,43 @@ export class StyleScope {
|
|
|
823
1037
|
return this._localCssSelectorsAppliedVersion === this._localCssSelectorVersion;
|
|
824
1038
|
}
|
|
825
1039
|
_createSelectors() {
|
|
826
|
-
const
|
|
827
|
-
const
|
|
828
|
-
toMerge.push(...mergedApplicationCssSelectors.filter((v) => !v.scopedTag || this._cssFiles.indexOf(v.scopedTag) >= 0));
|
|
829
|
-
toMergeKeyframes.push(...mergedApplicationCssKeyframes.filter((v) => !v.scopedTag || this._cssFiles.indexOf(v.scopedTag) >= 0));
|
|
1040
|
+
const cssFiles = this._cssFiles;
|
|
1041
|
+
const applicationScope = getApplicationSelectorScope();
|
|
830
1042
|
this._applicationCssSelectorsAppliedVersion = applicationCssSelectorVersion;
|
|
831
|
-
|
|
832
|
-
|
|
1043
|
+
if (!this.isLocalCssSelectorsLatestVersionApplied() || (!this._localSelectorScope && this._localCssSelectors.length > 0)) {
|
|
1044
|
+
this._localSelectorScope = this._localCssSelectors.length > 0 ? new StyleSheetSelectorScope(this._localCssSelectors, 1 /* SelectorTier.Local */) : null;
|
|
1045
|
+
}
|
|
833
1046
|
this._localCssSelectorsAppliedVersion = this._localCssSelectorVersion;
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
1047
|
+
this._hasSelectors = !!applicationScope || !!this._localSelectorScope;
|
|
1048
|
+
const toMergeKeyframes = [];
|
|
1049
|
+
const applicationKeyframes = getMergedApplicationCssKeyframes();
|
|
1050
|
+
for (let i = 0, length = applicationKeyframes.length; i < length; i++) {
|
|
1051
|
+
const keyframe = applicationKeyframes[i];
|
|
1052
|
+
if (!keyframe.scopedTag || cssFiles.has(keyframe.scopedTag)) {
|
|
1053
|
+
toMergeKeyframes.push(keyframe);
|
|
1054
|
+
}
|
|
837
1055
|
}
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
1056
|
+
const localKeyframes = this._localCssKeyframes;
|
|
1057
|
+
for (let i = 0, length = localKeyframes.length; i < length; i++) {
|
|
1058
|
+
toMergeKeyframes.push(localKeyframes[i]);
|
|
841
1059
|
}
|
|
842
1060
|
this._mergedCssKeyframes = toMergeKeyframes.length > 0 ? toMergeKeyframes : null;
|
|
843
1061
|
}
|
|
844
1062
|
// HACK: This @profile decorator creates a circular dependency
|
|
845
1063
|
// HACK: because the function parameter type is evaluated with 'typeof'
|
|
846
1064
|
matchSelectors(view) {
|
|
847
|
-
let match;
|
|
848
1065
|
// should be (view: ViewBase): SelectorsMatch<ViewBase>
|
|
849
1066
|
this.ensureSelectors();
|
|
850
|
-
if (this.
|
|
851
|
-
|
|
852
|
-
// Make sure to re-apply keyframes to matching selectors as a media query keyframe might be applicable at this point
|
|
853
|
-
this._applyKeyframesToSelectors(match.selectors);
|
|
854
|
-
}
|
|
855
|
-
else {
|
|
856
|
-
match = null;
|
|
1067
|
+
if (!this._hasSelectors) {
|
|
1068
|
+
return null;
|
|
857
1069
|
}
|
|
1070
|
+
// The cascade has to see the application and local candidates as a single ordered set.
|
|
1071
|
+
const candidates = [];
|
|
1072
|
+
applicationSelectorScope?.collectCandidates(view, candidates);
|
|
1073
|
+
this._localSelectorScope?.collectCandidates(view, candidates);
|
|
1074
|
+
const match = matchSelectorCandidates(view, candidates, applicationSelectorsHaveScopedTags ? this._cssFiles : undefined);
|
|
1075
|
+
// Make sure to re-apply keyframes to matching selectors as a media query keyframe might be applicable at this point
|
|
1076
|
+
this._applyKeyframesToSelectors(match.selectors);
|
|
858
1077
|
return match;
|
|
859
1078
|
}
|
|
860
1079
|
query(node) {
|
|
@@ -974,7 +1193,7 @@ function resolveFilePathFromImport(importSource, fileName) {
|
|
|
974
1193
|
fileNameParts.forEach((p) => (isParentDirectory(p) ? importSourceParts.pop() : importSourceParts.push(p)));
|
|
975
1194
|
return importSourceParts.join(path.separator);
|
|
976
1195
|
}
|
|
977
|
-
export const applyInlineStyle = profile(function applyInlineStyle(view, styleStr) {
|
|
1196
|
+
export const applyInlineStyle = profile('applyInlineStyle', function applyInlineStyle(view, styleStr) {
|
|
978
1197
|
const localStyle = `local { ${styleStr} }`;
|
|
979
1198
|
const inlineRuleSet = CSSSource.fromSource(localStyle).selectors;
|
|
980
1199
|
// Reset unscoped css-variables
|
|
@@ -987,6 +1206,8 @@ export const applyInlineStyle = profile(function applyInlineStyle(view, styleStr
|
|
|
987
1206
|
view.style.setUnscopedCssVariable(property, d.value);
|
|
988
1207
|
}
|
|
989
1208
|
});
|
|
1209
|
+
// Pending-substitution longhands share one placeholder - resolve it once.
|
|
1210
|
+
let resolvedShorthands;
|
|
990
1211
|
inlineRuleSet[0].declarations.forEach((d) => {
|
|
991
1212
|
// Use the actual property name so that a local value is set.
|
|
992
1213
|
const property = d.property;
|
|
@@ -995,7 +1216,21 @@ export const applyInlineStyle = profile(function applyInlineStyle(view, styleStr
|
|
|
995
1216
|
// Skip css-variables, they have been handled
|
|
996
1217
|
return;
|
|
997
1218
|
}
|
|
998
|
-
|
|
1219
|
+
let value;
|
|
1220
|
+
if (_isCssPendingSubstitution(d.value)) {
|
|
1221
|
+
if (!resolvedShorthands) {
|
|
1222
|
+
resolvedShorthands = new Map();
|
|
1223
|
+
}
|
|
1224
|
+
let resolved = resolvedShorthands.get(d.value);
|
|
1225
|
+
if (!resolved) {
|
|
1226
|
+
resolved = resolvePendingSubstitution(view, d.value);
|
|
1227
|
+
resolvedShorthands.set(d.value, resolved);
|
|
1228
|
+
}
|
|
1229
|
+
value = property in resolved ? resolved[property] : unsetValue;
|
|
1230
|
+
}
|
|
1231
|
+
else {
|
|
1232
|
+
value = evaluateCssExpressions(view, property, d.value);
|
|
1233
|
+
}
|
|
999
1234
|
if (property in view.style) {
|
|
1000
1235
|
view.style[property] = value;
|
|
1001
1236
|
}
|