@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,9 +1,9 @@
|
|
|
1
1
|
import { parse as convertToCSSWhatSelector } from 'css-what';
|
|
2
2
|
import '../../globals';
|
|
3
|
-
import { isCssVariable } from '../core/properties';
|
|
3
|
+
import { _expandCssShorthand, _pendingCssShorthandSubstitution, isCssVariable } from '../core/properties';
|
|
4
4
|
import { isNullOrUndefined } from '../../utils/types';
|
|
5
|
+
import { cleanupImportantFlags } from './css-utils';
|
|
5
6
|
import { checkIfMediaQueryMatches } from '../../media-query-list';
|
|
6
|
-
export const MEDIA_QUERY_SEPARATOR = '&&';
|
|
7
7
|
var Combinator;
|
|
8
8
|
(function (Combinator) {
|
|
9
9
|
Combinator["descendant"] = " ";
|
|
@@ -60,12 +60,48 @@ function getNodePreviousDirectSibling(node) {
|
|
|
60
60
|
}
|
|
61
61
|
return node.parent.getChildAt(nodeIndex - 1);
|
|
62
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* `<attribute>Change` is only raised by properties defined as prototype accessors;
|
|
65
|
+
* a plain instance value (e.g. Angular's `_ngcontent-*` markers) never notifies,
|
|
66
|
+
* so subscribing to its change event would be pure overhead.
|
|
67
|
+
*/
|
|
68
|
+
const notifyingAttributes = new WeakMap();
|
|
69
|
+
function attributeNotifiesChanges(node, attribute) {
|
|
70
|
+
const prototype = Object.getPrototypeOf(node);
|
|
71
|
+
if (!prototype) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
let cache = notifyingAttributes.get(prototype);
|
|
75
|
+
if (cache) {
|
|
76
|
+
const cached = cache.get(attribute);
|
|
77
|
+
if (cached !== undefined) {
|
|
78
|
+
return cached;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
cache = new Map();
|
|
83
|
+
notifyingAttributes.set(prototype, cache);
|
|
84
|
+
}
|
|
85
|
+
let notifies = false;
|
|
86
|
+
for (let current = prototype; current; current = Object.getPrototypeOf(current)) {
|
|
87
|
+
const descriptor = Object.getOwnPropertyDescriptor(current, attribute);
|
|
88
|
+
if (descriptor) {
|
|
89
|
+
notifies = !!descriptor.set;
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
cache.set(attribute, notifies);
|
|
94
|
+
return notifies;
|
|
95
|
+
}
|
|
63
96
|
function SelectorProperties(specificity, rarity, dynamic = false) {
|
|
64
97
|
return (cls) => {
|
|
65
98
|
cls.prototype.specificity = specificity;
|
|
66
99
|
cls.prototype.rarity = rarity;
|
|
67
100
|
cls.prototype.combinator = undefined;
|
|
68
101
|
cls.prototype.dynamic = dynamic;
|
|
102
|
+
cls.prototype.hasAdjacentCombinator = false;
|
|
103
|
+
cls.prototype.hasSiblingCombinator = false;
|
|
104
|
+
cls.prototype.tier = 0 /* SelectorTier.Application */;
|
|
69
105
|
return cls;
|
|
70
106
|
};
|
|
71
107
|
}
|
|
@@ -75,6 +111,8 @@ function FunctionalPseudoClassProperties(specificity, rarity, pseudoSelectorList
|
|
|
75
111
|
cls.prototype.rarity = rarity;
|
|
76
112
|
cls.prototype.combinator = undefined;
|
|
77
113
|
cls.prototype.dynamic = false;
|
|
114
|
+
cls.prototype.hasAdjacentCombinator = false;
|
|
115
|
+
cls.prototype.hasSiblingCombinator = false;
|
|
78
116
|
cls.prototype.pseudoSelectorListType = pseudoSelectorListType;
|
|
79
117
|
return cls;
|
|
80
118
|
};
|
|
@@ -213,6 +251,10 @@ let AttributeSelector = class AttributeSelector extends SimpleSelector {
|
|
|
213
251
|
this.test = test;
|
|
214
252
|
this.value = value;
|
|
215
253
|
this.ignoreCase = ignoreCase;
|
|
254
|
+
// Normalize once at construction instead of on every match
|
|
255
|
+
if (ignoreCase && value) {
|
|
256
|
+
this.value = value.toLowerCase();
|
|
257
|
+
}
|
|
216
258
|
}
|
|
217
259
|
toString() {
|
|
218
260
|
return `[${this.attribute}${wrap(AttributeSelectorOperator[this.test] ?? this.test)}${this.value || ''}]${wrap(this.combinator)}`;
|
|
@@ -229,7 +271,6 @@ let AttributeSelector = class AttributeSelector extends SimpleSelector {
|
|
|
229
271
|
attr += '';
|
|
230
272
|
if (this.ignoreCase) {
|
|
231
273
|
attr = attr.toLowerCase();
|
|
232
|
-
this.value = this.value.toLowerCase();
|
|
233
274
|
}
|
|
234
275
|
// =
|
|
235
276
|
if (this.test === 'equals') {
|
|
@@ -259,10 +300,15 @@ let AttributeSelector = class AttributeSelector extends SimpleSelector {
|
|
|
259
300
|
return false;
|
|
260
301
|
}
|
|
261
302
|
mayMatch(node) {
|
|
262
|
-
|
|
303
|
+
// Registered properties live on the prototype and anything already assigned is
|
|
304
|
+
// an own value; an attribute on neither can never start matching without the
|
|
305
|
+
// css state being invalidated anyway.
|
|
306
|
+
return this.attribute in node;
|
|
263
307
|
}
|
|
264
308
|
trackChanges(node, map) {
|
|
265
|
-
|
|
309
|
+
if (attributeNotifiesChanges(node, this.attribute)) {
|
|
310
|
+
map.addAttribute(node, this.attribute);
|
|
311
|
+
}
|
|
266
312
|
}
|
|
267
313
|
};
|
|
268
314
|
AttributeSelector = __decorate([
|
|
@@ -322,6 +368,8 @@ export class FunctionalPseudoClassSelector extends PseudoClassSelector {
|
|
|
322
368
|
this.specificity = specificity;
|
|
323
369
|
// Functional pseudo-classes become dynamic based on selectors in selector list
|
|
324
370
|
this.dynamic = this.selectors.some((sel) => sel.dynamic);
|
|
371
|
+
this.hasAdjacentCombinator = this.selectors.some((sel) => sel.hasAdjacentCombinator);
|
|
372
|
+
this.hasSiblingCombinator = this.selectors.some((sel) => sel.hasSiblingCombinator);
|
|
325
373
|
}
|
|
326
374
|
toString() {
|
|
327
375
|
return `:${this.cssPseudoClass}(${this.selectors.join(', ')})${wrap(this.combinator)}`;
|
|
@@ -388,18 +436,35 @@ export class SimpleSelectorSequence extends SimpleSelector {
|
|
|
388
436
|
this.specificity = selectors.reduce((sum, sel) => sel.specificity + sum, 0);
|
|
389
437
|
this.head = selectors.reduce((prev, curr) => (!prev || curr.rarity > prev.rarity ? curr : prev), null);
|
|
390
438
|
this.dynamic = selectors.some((sel) => sel.dynamic);
|
|
439
|
+
this.hasAdjacentCombinator = selectors.some((sel) => sel.hasAdjacentCombinator);
|
|
440
|
+
this.hasSiblingCombinator = selectors.some((sel) => sel.hasSiblingCombinator);
|
|
391
441
|
}
|
|
392
442
|
toString() {
|
|
393
443
|
return `${this.selectors.join('')}${wrap(this.combinator)}`;
|
|
394
444
|
}
|
|
395
445
|
match(node) {
|
|
396
|
-
|
|
446
|
+
const selectors = this.selectors;
|
|
447
|
+
for (let i = 0, length = selectors.length; i < length; i++) {
|
|
448
|
+
if (!selectors[i].match(node)) {
|
|
449
|
+
return false;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
return true;
|
|
397
453
|
}
|
|
398
454
|
mayMatch(node) {
|
|
399
|
-
|
|
455
|
+
const selectors = this.selectors;
|
|
456
|
+
for (let i = 0, length = selectors.length; i < length; i++) {
|
|
457
|
+
if (!selectors[i].mayMatch(node)) {
|
|
458
|
+
return false;
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
return true;
|
|
400
462
|
}
|
|
401
463
|
trackChanges(node, map) {
|
|
402
|
-
|
|
464
|
+
const selectors = this.selectors;
|
|
465
|
+
for (let i = 0, length = selectors.length; i < length; i++) {
|
|
466
|
+
selectors[i].trackChanges(node, map);
|
|
467
|
+
}
|
|
403
468
|
}
|
|
404
469
|
lookupSort(sorter, base) {
|
|
405
470
|
this.head.lookupSort(sorter, base || this);
|
|
@@ -414,6 +479,8 @@ export class ComplexSelector extends SelectorCore {
|
|
|
414
479
|
const groups = [];
|
|
415
480
|
this.specificity = 0;
|
|
416
481
|
this.dynamic = false;
|
|
482
|
+
this.hasAdjacentCombinator = false;
|
|
483
|
+
this.hasSiblingCombinator = false;
|
|
417
484
|
for (let i = selectors.length - 1; i >= 0; i--) {
|
|
418
485
|
const sel = selectors[i];
|
|
419
486
|
switch (sel.combinator) {
|
|
@@ -428,7 +495,10 @@ export class ComplexSelector extends SelectorCore {
|
|
|
428
495
|
currentGroup.push(siblingsToGroup);
|
|
429
496
|
break;
|
|
430
497
|
case Combinator.adjacent:
|
|
498
|
+
this.hasAdjacentCombinator = true;
|
|
499
|
+
break;
|
|
431
500
|
case Combinator.sibling:
|
|
501
|
+
this.hasSiblingCombinator = true;
|
|
432
502
|
break;
|
|
433
503
|
default:
|
|
434
504
|
throw new Error(`Unsupported combinator "${sel.combinator}" for selector ${sel}.`);
|
|
@@ -437,6 +507,12 @@ export class ComplexSelector extends SelectorCore {
|
|
|
437
507
|
if (sel.dynamic) {
|
|
438
508
|
this.dynamic = true;
|
|
439
509
|
}
|
|
510
|
+
if (sel.hasAdjacentCombinator) {
|
|
511
|
+
this.hasAdjacentCombinator = true;
|
|
512
|
+
}
|
|
513
|
+
if (sel.hasSiblingCombinator) {
|
|
514
|
+
this.hasSiblingCombinator = true;
|
|
515
|
+
}
|
|
440
516
|
siblingsToGroup.push(sel);
|
|
441
517
|
}
|
|
442
518
|
this.groups = groups.map((g) => new Selector.ChildGroup(g.map((selectors) => (selectors.length > 1 ? new Selector.SiblingGroup(selectors) : selectors[0]))));
|
|
@@ -446,27 +522,39 @@ export class ComplexSelector extends SelectorCore {
|
|
|
446
522
|
return this.selectors.join('');
|
|
447
523
|
}
|
|
448
524
|
match(node) {
|
|
449
|
-
|
|
525
|
+
const groups = this.groups;
|
|
526
|
+
for (let i = 0, length = groups.length; i < length; i++) {
|
|
527
|
+
const group = groups[i];
|
|
450
528
|
if (i === 0) {
|
|
451
529
|
node = group.getMatchingNode(node, true);
|
|
452
|
-
|
|
530
|
+
if (!node) {
|
|
531
|
+
return false;
|
|
532
|
+
}
|
|
453
533
|
}
|
|
454
534
|
else {
|
|
455
535
|
let ancestor = node;
|
|
536
|
+
let matched = false;
|
|
456
537
|
while ((ancestor = ancestor.parent ?? ancestor._modalParent)) {
|
|
457
538
|
if ((node = group.getMatchingNode(ancestor, true))) {
|
|
458
|
-
|
|
539
|
+
matched = true;
|
|
540
|
+
break;
|
|
459
541
|
}
|
|
460
542
|
}
|
|
461
|
-
|
|
543
|
+
if (!matched) {
|
|
544
|
+
return false;
|
|
545
|
+
}
|
|
462
546
|
}
|
|
463
|
-
}
|
|
547
|
+
}
|
|
548
|
+
return true;
|
|
464
549
|
}
|
|
465
550
|
mayMatch(node) {
|
|
466
551
|
return false;
|
|
467
552
|
}
|
|
468
553
|
trackChanges(node, map) {
|
|
469
|
-
|
|
554
|
+
const selectors = this.selectors;
|
|
555
|
+
for (let i = 0, length = selectors.length; i < length; i++) {
|
|
556
|
+
selectors[i].trackChanges(node, map);
|
|
557
|
+
}
|
|
470
558
|
}
|
|
471
559
|
lookupSort(sorter, base) {
|
|
472
560
|
this.last.lookupSort(sorter, base || this);
|
|
@@ -529,8 +617,20 @@ export var Selector;
|
|
|
529
617
|
this.dynamic = selectors.some((sel) => sel.dynamic);
|
|
530
618
|
}
|
|
531
619
|
getMatchingNode(node, strict) {
|
|
532
|
-
const
|
|
533
|
-
|
|
620
|
+
const selectors = this.selectors;
|
|
621
|
+
for (let i = 0, length = selectors.length; i < length; i++) {
|
|
622
|
+
if (i !== 0) {
|
|
623
|
+
node = node.parent;
|
|
624
|
+
}
|
|
625
|
+
if (!node) {
|
|
626
|
+
return null;
|
|
627
|
+
}
|
|
628
|
+
const sel = selectors[i];
|
|
629
|
+
if (!(strict ? sel.match(node) : sel.mayMatch(node))) {
|
|
630
|
+
return null;
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
return node;
|
|
534
634
|
}
|
|
535
635
|
match(node) {
|
|
536
636
|
return this.getMatchingNode(node, true) != null;
|
|
@@ -647,12 +747,39 @@ export class RuleSet {
|
|
|
647
747
|
}
|
|
648
748
|
}
|
|
649
749
|
export function fromAstNode(astRule) {
|
|
650
|
-
const declarations =
|
|
750
|
+
const declarations = [];
|
|
751
|
+
const nodes = astRule.declarations;
|
|
752
|
+
for (let i = 0, length = nodes.length; i < length; i++) {
|
|
753
|
+
const node = nodes[i];
|
|
754
|
+
if (isDeclaration(node)) {
|
|
755
|
+
appendDeclaration(declarations, node);
|
|
756
|
+
}
|
|
757
|
+
}
|
|
651
758
|
const selectors = astRule.selectors.map(createSelector);
|
|
652
759
|
return new RuleSet(selectors, declarations);
|
|
653
760
|
}
|
|
654
|
-
function
|
|
655
|
-
|
|
761
|
+
function appendDeclaration(declarations, decl) {
|
|
762
|
+
const property = isCssVariable(decl.property) ? decl.property : decl.property.toLowerCase();
|
|
763
|
+
const value = cleanupImportantFlags(decl.value, decl.property);
|
|
764
|
+
// The cascade is defined on longhands: a shorthand declares each of its
|
|
765
|
+
// longhands in its place, so it is expanded here to keep source order meaningful.
|
|
766
|
+
const expanded = _expandCssShorthand(property, value);
|
|
767
|
+
if (expanded) {
|
|
768
|
+
for (let i = 0, length = expanded.length; i < length; i++) {
|
|
769
|
+
declarations.push({ property: expanded[i][0], value: expanded[i][1] });
|
|
770
|
+
}
|
|
771
|
+
return;
|
|
772
|
+
}
|
|
773
|
+
// A var()/calc() shorthand cannot be expanded yet - cascade one
|
|
774
|
+
// pending-substitution value per longhand instead.
|
|
775
|
+
const pending = _pendingCssShorthandSubstitution(property, value);
|
|
776
|
+
if (pending) {
|
|
777
|
+
for (let i = 0, length = pending.length; i < length; i++) {
|
|
778
|
+
declarations.push({ property: pending[i][0], value: pending[i][1] });
|
|
779
|
+
}
|
|
780
|
+
return;
|
|
781
|
+
}
|
|
782
|
+
declarations.push({ property, value });
|
|
656
783
|
}
|
|
657
784
|
function createSimpleSelectorFromAst(ast) {
|
|
658
785
|
if (ast.type === 'attribute') {
|
|
@@ -759,22 +886,40 @@ function isDeclaration(node) {
|
|
|
759
886
|
return node.type === 'declaration';
|
|
760
887
|
}
|
|
761
888
|
export function matchMediaQueryString(mediaQueryString, cachedQueries) {
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
889
|
+
if (!mediaQueryString) {
|
|
890
|
+
return false;
|
|
891
|
+
}
|
|
892
|
+
if (typeof mediaQueryString === 'string') {
|
|
893
|
+
// Query has already been validated
|
|
894
|
+
if (cachedQueries.includes(mediaQueryString)) {
|
|
895
|
+
return true;
|
|
896
|
+
}
|
|
897
|
+
const result = checkIfMediaQueryMatches(mediaQueryString);
|
|
898
|
+
if (result) {
|
|
899
|
+
cachedQueries.push(mediaQueryString);
|
|
900
|
+
return result;
|
|
901
|
+
}
|
|
902
|
+
return false;
|
|
903
|
+
}
|
|
904
|
+
for (let i = 0, length = mediaQueryString.length; i < length; i++) {
|
|
905
|
+
const mq = mediaQueryString[i];
|
|
766
906
|
// Query has already been validated
|
|
767
907
|
if (cachedQueries.includes(mq)) {
|
|
768
|
-
|
|
908
|
+
continue;
|
|
769
909
|
}
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
910
|
+
if (!checkIfMediaQueryMatches(mq)) {
|
|
911
|
+
return false;
|
|
912
|
+
}
|
|
913
|
+
cachedQueries.push(mq);
|
|
914
|
+
}
|
|
915
|
+
return true;
|
|
916
|
+
}
|
|
917
|
+
function appendSelectorCandidates(candidates, selectors) {
|
|
918
|
+
if (selectors) {
|
|
919
|
+
for (let i = 0, length = selectors.length; i < length; i++) {
|
|
920
|
+
candidates.push(selectors[i]);
|
|
775
921
|
}
|
|
776
|
-
|
|
777
|
-
});
|
|
922
|
+
}
|
|
778
923
|
}
|
|
779
924
|
export class SelectorScope {
|
|
780
925
|
constructor() {
|
|
@@ -783,14 +928,32 @@ export class SelectorScope {
|
|
|
783
928
|
this.type = {};
|
|
784
929
|
this.universal = [];
|
|
785
930
|
this.position = 0;
|
|
786
|
-
|
|
787
|
-
|
|
931
|
+
this.tier = 0 /* SelectorTier.Application */;
|
|
932
|
+
/**
|
|
933
|
+
* True when any selector in the scope contains an adjacent sibling ('+') combinator.
|
|
934
|
+
*/
|
|
935
|
+
this.hasAdjacentCombinatorSelectors = false;
|
|
936
|
+
/**
|
|
937
|
+
* True when any selector in the scope contains a general sibling ('~') combinator.
|
|
938
|
+
*/
|
|
939
|
+
this.hasSiblingCombinatorSelectors = false;
|
|
940
|
+
}
|
|
941
|
+
getSelectorCandidates(node, candidates = []) {
|
|
788
942
|
const { cssClasses, id, cssType } = node;
|
|
789
|
-
|
|
943
|
+
appendSelectorCandidates(candidates, this.universal);
|
|
944
|
+
if (id) {
|
|
945
|
+
appendSelectorCandidates(candidates, this.id[id]);
|
|
946
|
+
}
|
|
947
|
+
if (cssType) {
|
|
948
|
+
appendSelectorCandidates(candidates, this.type[cssType]);
|
|
949
|
+
}
|
|
790
950
|
if (cssClasses && cssClasses.size) {
|
|
791
|
-
|
|
951
|
+
const classSelectors = this.class;
|
|
952
|
+
for (const cssClass of cssClasses) {
|
|
953
|
+
appendSelectorCandidates(candidates, classSelectors[cssClass]);
|
|
954
|
+
}
|
|
792
955
|
}
|
|
793
|
-
return
|
|
956
|
+
return candidates;
|
|
794
957
|
}
|
|
795
958
|
sortById(id, sel) {
|
|
796
959
|
this.addToMap(this.id, id, sel);
|
|
@@ -811,26 +974,42 @@ export class SelectorScope {
|
|
|
811
974
|
map[head].push(this.makeDocSelector(sel));
|
|
812
975
|
}
|
|
813
976
|
makeDocSelector(sel) {
|
|
977
|
+
if (sel.hasAdjacentCombinator) {
|
|
978
|
+
this.hasAdjacentCombinatorSelectors = true;
|
|
979
|
+
}
|
|
980
|
+
if (sel.hasSiblingCombinator) {
|
|
981
|
+
this.hasSiblingCombinatorSelectors = true;
|
|
982
|
+
}
|
|
814
983
|
sel.pos = this.position++;
|
|
984
|
+
sel.tier = this.tier;
|
|
815
985
|
return sel;
|
|
816
986
|
}
|
|
817
987
|
}
|
|
818
988
|
export class MediaQuerySelectorScope extends SelectorScope {
|
|
819
|
-
constructor(mediaQueryString) {
|
|
989
|
+
constructor(mediaQueryString, tier) {
|
|
820
990
|
super();
|
|
821
991
|
this._mediaQueryString = mediaQueryString;
|
|
992
|
+
this.tier = tier;
|
|
822
993
|
}
|
|
823
994
|
get mediaQueryString() {
|
|
824
995
|
return this._mediaQueryString;
|
|
825
996
|
}
|
|
826
997
|
}
|
|
827
998
|
export class StyleSheetSelectorScope extends SelectorScope {
|
|
828
|
-
constructor(rulesets) {
|
|
999
|
+
constructor(rulesets, tier = 0 /* SelectorTier.Application */) {
|
|
829
1000
|
super();
|
|
1001
|
+
this.tier = tier;
|
|
830
1002
|
this.lookupRulesets(rulesets);
|
|
831
1003
|
}
|
|
1004
|
+
/**
|
|
1005
|
+
* Index rulesets added after this scope was built; the rules already indexed
|
|
1006
|
+
* keep their positions.
|
|
1007
|
+
*/
|
|
1008
|
+
appendRulesets(rulesets, from) {
|
|
1009
|
+
this.lookupRulesets(rulesets, from);
|
|
1010
|
+
}
|
|
832
1011
|
createMediaQuerySelectorScope(mediaQueryString) {
|
|
833
|
-
const selectorScope = new MediaQuerySelectorScope(mediaQueryString);
|
|
1012
|
+
const selectorScope = new MediaQuerySelectorScope(mediaQueryString, this.tier);
|
|
834
1013
|
selectorScope.position = this.position;
|
|
835
1014
|
if (this.mediaQuerySelectorScopes) {
|
|
836
1015
|
this.mediaQuerySelectorScopes.push(selectorScope);
|
|
@@ -840,9 +1019,9 @@ export class StyleSheetSelectorScope extends SelectorScope {
|
|
|
840
1019
|
}
|
|
841
1020
|
return selectorScope;
|
|
842
1021
|
}
|
|
843
|
-
lookupRulesets(rulesets) {
|
|
1022
|
+
lookupRulesets(rulesets, from = 0) {
|
|
844
1023
|
let lastMediaSelectorScope;
|
|
845
|
-
for (let i =
|
|
1024
|
+
for (let i = from, length = rulesets.length; i < length; i++) {
|
|
846
1025
|
const ruleset = rulesets[i];
|
|
847
1026
|
if (lastMediaSelectorScope && lastMediaSelectorScope.mediaQueryString !== ruleset.mediaQueryString) {
|
|
848
1027
|
// Once done with current media query scope, update stylesheet scope position
|
|
@@ -865,10 +1044,24 @@ export class StyleSheetSelectorScope extends SelectorScope {
|
|
|
865
1044
|
this.position = lastMediaSelectorScope.position;
|
|
866
1045
|
lastMediaSelectorScope = null;
|
|
867
1046
|
}
|
|
1047
|
+
// Media query scopes are queried through this scope, so their combinator flags roll up
|
|
1048
|
+
if (this.mediaQuerySelectorScopes) {
|
|
1049
|
+
for (const selectorScope of this.mediaQuerySelectorScopes) {
|
|
1050
|
+
if (selectorScope.hasAdjacentCombinatorSelectors) {
|
|
1051
|
+
this.hasAdjacentCombinatorSelectors = true;
|
|
1052
|
+
}
|
|
1053
|
+
if (selectorScope.hasSiblingCombinatorSelectors) {
|
|
1054
|
+
this.hasSiblingCombinatorSelectors = true;
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
868
1058
|
}
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
1059
|
+
/**
|
|
1060
|
+
* Append every selector that could match the node, matching media query scopes
|
|
1061
|
+
* included, for `matchSelectorCandidates` to resolve.
|
|
1062
|
+
*/
|
|
1063
|
+
collectCandidates(node, candidates = []) {
|
|
1064
|
+
this.getSelectorCandidates(node, candidates);
|
|
872
1065
|
// Validate media queries and include their selectors if needed
|
|
873
1066
|
if (this.mediaQuerySelectorScopes) {
|
|
874
1067
|
// Cache media query results to avoid validations of other identical queries
|
|
@@ -877,18 +1070,49 @@ export class StyleSheetSelectorScope extends SelectorScope {
|
|
|
877
1070
|
const selectorScope = this.mediaQuerySelectorScopes[i];
|
|
878
1071
|
const isMatchingAllQueries = matchMediaQueryString(selectorScope.mediaQueryString, validatedMediaQueries);
|
|
879
1072
|
if (isMatchingAllQueries) {
|
|
880
|
-
|
|
881
|
-
selectors.push(...mediaQuerySelectors);
|
|
1073
|
+
selectorScope.getSelectorCandidates(node, candidates);
|
|
882
1074
|
}
|
|
883
1075
|
}
|
|
884
1076
|
}
|
|
885
|
-
|
|
886
|
-
|
|
1077
|
+
return candidates;
|
|
1078
|
+
}
|
|
1079
|
+
query(node) {
|
|
1080
|
+
return matchSelectorCandidates(node, this.collectCandidates(node));
|
|
887
1081
|
}
|
|
888
1082
|
}
|
|
1083
|
+
/** Cascade order: specificity, then source order - (tier, position) across stylesheets. */
|
|
1084
|
+
function compareSelectors(a, b) {
|
|
1085
|
+
return a.specificity - b.specificity || a.tier - b.tier || a.pos - b.pos;
|
|
1086
|
+
}
|
|
1087
|
+
/**
|
|
1088
|
+
* Resolve collected candidates against a node, compacting the array in place.
|
|
1089
|
+
* `scopedTags` filters out rules registered on behalf of a stylesheet this scope
|
|
1090
|
+
* never loaded; pass it only when such rules exist - it costs a lookup per candidate.
|
|
1091
|
+
*/
|
|
1092
|
+
export function matchSelectorCandidates(node, candidates, scopedTags) {
|
|
1093
|
+
const selectorsMatch = new SelectorsMatch();
|
|
1094
|
+
let matched = 0;
|
|
1095
|
+
for (let i = 0, length = candidates.length; i < length; i++) {
|
|
1096
|
+
const selector = candidates[i];
|
|
1097
|
+
if (scopedTags) {
|
|
1098
|
+
const scopedTag = selector.ruleset?.scopedTag;
|
|
1099
|
+
if (scopedTag && !scopedTags.has(scopedTag)) {
|
|
1100
|
+
continue;
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
if (selector.accumulateChanges(node, selectorsMatch)) {
|
|
1104
|
+
candidates[matched++] = selector;
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
candidates.length = matched;
|
|
1108
|
+
selectorsMatch.selectors = candidates.sort(compareSelectors);
|
|
1109
|
+
return selectorsMatch;
|
|
1110
|
+
}
|
|
1111
|
+
/** Shared by matches that track nothing; a real map is materialized on first write. */
|
|
1112
|
+
const emptyChangeMap = new Map();
|
|
889
1113
|
export class SelectorsMatch {
|
|
890
1114
|
constructor() {
|
|
891
|
-
this.changeMap =
|
|
1115
|
+
this.changeMap = emptyChangeMap;
|
|
892
1116
|
}
|
|
893
1117
|
addAttribute(node, attribute) {
|
|
894
1118
|
const deps = this.properties(node);
|
|
@@ -905,9 +1129,13 @@ export class SelectorsMatch {
|
|
|
905
1129
|
deps.pseudoClasses.add(pseudoClass);
|
|
906
1130
|
}
|
|
907
1131
|
properties(node) {
|
|
908
|
-
let
|
|
1132
|
+
let changeMap = this.changeMap;
|
|
1133
|
+
if (changeMap === emptyChangeMap) {
|
|
1134
|
+
this.changeMap = changeMap = new Map();
|
|
1135
|
+
}
|
|
1136
|
+
let set = changeMap.get(node);
|
|
909
1137
|
if (!set) {
|
|
910
|
-
|
|
1138
|
+
changeMap.set(node, (set = {}));
|
|
911
1139
|
}
|
|
912
1140
|
return set;
|
|
913
1141
|
}
|
|
@@ -930,5 +1158,6 @@ export const CSSHelper = {
|
|
|
930
1158
|
StyleSheetSelectorScope,
|
|
931
1159
|
fromAstNode,
|
|
932
1160
|
SelectorsMatch,
|
|
1161
|
+
matchSelectorCandidates,
|
|
933
1162
|
};
|
|
934
1163
|
//# sourceMappingURL=css-selector.js.map
|