@akylas/nativescript 8.7.2 → 8.8.3
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/font-scale.android.js +2 -1
- package/accessibility/font-scale.android.js.map +1 -1
- package/application/application-common.d.ts +2 -1
- package/application/application-common.js +22 -8
- package/application/application-common.js.map +1 -1
- package/application/application.android.d.ts +3 -2
- package/application/application.android.js +34 -9
- package/application/application.android.js.map +1 -1
- package/application/application.ios.js +3 -2
- package/application/application.ios.js.map +1 -1
- package/application-settings/index.android.d.ts +1 -1
- package/application-settings/index.android.js +6 -5
- package/application-settings/index.android.js.map +1 -1
- package/application-settings/index.d.ts +1 -1
- package/application-settings/index.ios.d.ts +1 -1
- package/application-settings/index.ios.js +2 -2
- package/application-settings/index.ios.js.map +1 -1
- package/config/config.interface.d.ts +30 -0
- package/css/parser.d.ts +0 -38
- package/css/parser.js +0 -108
- package/css/parser.js.map +1 -1
- package/css/reworkcss.d.ts +15 -1
- package/css-mediaquery/index.d.ts +27 -0
- package/css-mediaquery/index.js +118 -0
- package/css-mediaquery/index.js.map +1 -0
- package/data/observable/index.d.ts +60 -19
- package/data/observable/index.js +148 -155
- package/data/observable/index.js.map +1 -1
- package/data/observable-array/index.d.ts +10 -6
- package/data/virtual-array/index.d.ts +9 -5
- package/file-system/file-system-access.android.js +125 -69
- package/file-system/file-system-access.android.js.map +1 -1
- package/file-system/file-system-access.ios.js +3 -3
- package/file-system/file-system-access.ios.js.map +1 -1
- package/file-system/index.js +34 -8
- package/file-system/index.js.map +1 -1
- package/globals/index.js +9 -0
- package/globals/index.js.map +1 -1
- package/http/http-request/index.android.js +1 -1
- package/http/http-request/index.android.js.map +1 -1
- package/http/http-request/index.ios.js +1 -1
- package/http/http-request/index.ios.js.map +1 -1
- package/image-source/index.android.d.ts +4 -1
- package/image-source/index.android.js +9 -0
- package/image-source/index.android.js.map +1 -1
- package/image-source/index.d.ts +24 -0
- package/image-source/index.ios.d.ts +4 -1
- package/image-source/index.ios.js +49 -2
- package/image-source/index.ios.js.map +1 -1
- package/media-query-list/index.d.ts +21 -0
- package/media-query-list/index.js +169 -0
- package/media-query-list/index.js.map +1 -0
- package/package.json +16 -4
- package/platform/{index.android.d.ts → device/index.android.d.ts} +1 -16
- package/platform/{index.android.js → device/index.android.js} +4 -47
- package/platform/device/index.android.js.map +1 -0
- package/platform/device/index.d.ts +70 -0
- package/platform/{index.ios.d.ts → device/index.ios.d.ts} +1 -14
- package/platform/{index.ios.js → device/index.ios.js} +1 -34
- package/platform/device/index.ios.js.map +1 -0
- package/platform/index.d.ts +2 -144
- package/platform/index.js +4 -0
- package/platform/index.js.map +1 -0
- package/platform/screen/index.android.d.ts +15 -0
- package/platform/screen/index.android.js +39 -0
- package/platform/screen/index.android.js.map +1 -0
- package/platform/screen/index.d.ts +48 -0
- package/platform/screen/index.ios.d.ts +15 -0
- package/platform/screen/index.ios.js +35 -0
- package/platform/screen/index.ios.js.map +1 -0
- package/platforms/android/native-api-usage.json +2 -0
- package/platforms/android/widgets-release.aar +0 -0
- package/platforms/ios/NSCWinterCG.xcframework/Info.plist +102 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64/NSCWinterCG.framework/Headers/NSCCrypto.h +79 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64/NSCWinterCG.framework/Headers/NSCWinterCG.h +20 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64/NSCWinterCG.framework/Headers/NSString+WinterCG.h +21 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64/NSCWinterCG.framework/Info.plist +0 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64/NSCWinterCG.framework/Modules/module.modulemap +6 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64/NSCWinterCG.framework/NSCWinterCG +0 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64/dSYMs/NSCWinterCG.framework.dSYM/Contents/Info.plist +20 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64/dSYMs/NSCWinterCG.framework.dSYM/Contents/Resources/DWARF/NSCWinterCG +0 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64/dSYMs/NSCWinterCG.framework.dSYM/Contents/Resources/Relocations/aarch64/NSCWinterCG.yml +40 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterCG.framework/Headers/NSCCrypto.h +79 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterCG.framework/Headers/NSCWinterCG.h +20 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterCG.framework/Headers/NSString+WinterCG.h +21 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterCG.framework/Modules/module.modulemap +6 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterCG.framework/NSCWinterCG +0 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterCG.framework/Resources/Info.plist +52 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterCG.framework/Versions/A/Headers/NSCCrypto.h +79 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterCG.framework/Versions/A/Headers/NSCWinterCG.h +20 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterCG.framework/Versions/A/Headers/NSString+WinterCG.h +21 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterCG.framework/Versions/A/Modules/module.modulemap +6 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterCG.framework/Versions/A/NSCWinterCG +0 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterCG.framework/Versions/A/Resources/Info.plist +52 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterCG.framework/Versions/Current/NSCWinterCG +0 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/NSCWinterCG.framework.dSYM/Contents/Info.plist +20 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/NSCWinterCG.framework.dSYM/Contents/Resources/DWARF/NSCWinterCG +0 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/NSCWinterCG.framework.dSYM/Contents/Resources/Relocations/aarch64/NSCWinterCG.yml +40 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/NSCWinterCG.framework.dSYM/Contents/Resources/Relocations/x86_64/NSCWinterCG.yml +40 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-simulator/NSCWinterCG.framework/Headers/NSCCrypto.h +79 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-simulator/NSCWinterCG.framework/Headers/NSCWinterCG.h +20 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-simulator/NSCWinterCG.framework/Headers/NSString+WinterCG.h +21 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-simulator/NSCWinterCG.framework/Info.plist +0 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-simulator/NSCWinterCG.framework/Modules/module.modulemap +6 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-simulator/NSCWinterCG.framework/NSCWinterCG +0 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-simulator/NSCWinterCG.framework/_CodeSignature/CodeResources +146 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-simulator/dSYMs/NSCWinterCG.framework.dSYM/Contents/Info.plist +20 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-simulator/dSYMs/NSCWinterCG.framework.dSYM/Contents/Resources/DWARF/NSCWinterCG +0 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-simulator/dSYMs/NSCWinterCG.framework.dSYM/Contents/Resources/Relocations/aarch64/NSCWinterCG.yml +40 -0
- package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-simulator/dSYMs/NSCWinterCG.framework.dSYM/Contents/Resources/Relocations/x86_64/NSCWinterCG.yml +40 -0
- package/platforms/ios/NSCWinterCG.xcframework/xros-arm64/NSCWinterCG.framework/Headers/NSCCrypto.h +79 -0
- package/platforms/ios/NSCWinterCG.xcframework/xros-arm64/NSCWinterCG.framework/Headers/NSCWinterCG.h +20 -0
- package/platforms/ios/NSCWinterCG.xcframework/xros-arm64/NSCWinterCG.framework/Headers/NSString+WinterCG.h +21 -0
- package/platforms/ios/NSCWinterCG.xcframework/xros-arm64/NSCWinterCG.framework/Info.plist +0 -0
- package/platforms/ios/NSCWinterCG.xcframework/xros-arm64/NSCWinterCG.framework/Modules/module.modulemap +6 -0
- package/platforms/ios/NSCWinterCG.xcframework/xros-arm64/NSCWinterCG.framework/NSCWinterCG +0 -0
- package/platforms/ios/NSCWinterCG.xcframework/xros-arm64/dSYMs/NSCWinterCG.framework.dSYM/Contents/Info.plist +20 -0
- package/platforms/ios/NSCWinterCG.xcframework/xros-arm64/dSYMs/NSCWinterCG.framework.dSYM/Contents/Resources/DWARF/NSCWinterCG +0 -0
- package/platforms/ios/NSCWinterCG.xcframework/xros-arm64/dSYMs/NSCWinterCG.framework.dSYM/Contents/Resources/Relocations/aarch64/NSCWinterCG.yml +40 -0
- package/platforms/ios/NSCWinterCG.xcframework/xros-arm64_x86_64-simulator/NSCWinterCG.framework/Headers/NSCCrypto.h +79 -0
- package/platforms/ios/NSCWinterCG.xcframework/xros-arm64_x86_64-simulator/NSCWinterCG.framework/Headers/NSCWinterCG.h +20 -0
- package/platforms/ios/NSCWinterCG.xcframework/xros-arm64_x86_64-simulator/NSCWinterCG.framework/Headers/NSString+WinterCG.h +21 -0
- package/platforms/ios/NSCWinterCG.xcframework/xros-arm64_x86_64-simulator/NSCWinterCG.framework/Info.plist +0 -0
- package/platforms/ios/NSCWinterCG.xcframework/xros-arm64_x86_64-simulator/NSCWinterCG.framework/Modules/module.modulemap +6 -0
- package/platforms/ios/NSCWinterCG.xcframework/xros-arm64_x86_64-simulator/NSCWinterCG.framework/NSCWinterCG +0 -0
- package/platforms/ios/NSCWinterCG.xcframework/xros-arm64_x86_64-simulator/NSCWinterCG.framework/_CodeSignature/CodeResources +146 -0
- package/platforms/ios/NSCWinterCG.xcframework/xros-arm64_x86_64-simulator/dSYMs/NSCWinterCG.framework.dSYM/Contents/Info.plist +20 -0
- package/platforms/ios/NSCWinterCG.xcframework/xros-arm64_x86_64-simulator/dSYMs/NSCWinterCG.framework.dSYM/Contents/Resources/DWARF/NSCWinterCG +0 -0
- package/platforms/ios/NSCWinterCG.xcframework/xros-arm64_x86_64-simulator/dSYMs/NSCWinterCG.framework.dSYM/Contents/Resources/Relocations/aarch64/NSCWinterCG.yml +40 -0
- package/platforms/ios/NSCWinterCG.xcframework/xros-arm64_x86_64-simulator/dSYMs/NSCWinterCG.framework.dSYM/Contents/Resources/Relocations/x86_64/NSCWinterCG.yml +40 -0
- package/platforms/ios/TNSWidgets.xcframework/Info.plist +18 -18
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers/NSCCrypto.h +60 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers/NSFileHandle+Async.h +1 -1
- 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 +77 -77
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/NSCCrypto.h +60 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/NSFileHandle+Async.h +1 -1
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Resources/Info.plist +6 -6
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/NSCCrypto.h +60 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/NSFileHandle+Async.h +1 -1
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Resources/Info.plist +6 -6
- 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/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 +77 -77
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/x86_64/TNSWidgets.yml +77 -77
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSCCrypto.h +60 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSFileHandle+Async.h +1 -1
- 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 +3 -3
- 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 +77 -77
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/x86_64/TNSWidgets.yml +77 -77
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/NSCCrypto.h +60 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/NSFileHandle+Async.h +1 -1
- 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 +77 -77
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSCCrypto.h +60 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSFileHandle+Async.h +1 -1
- 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 +3 -3
- 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 +77 -77
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/x86_64/TNSWidgets.yml +77 -77
- package/profiling/index.js.map +1 -1
- package/references.d.ts +3 -1
- package/trace/index.d.ts +1 -0
- package/trace/index.js +2 -1
- package/trace/index.js.map +1 -1
- package/ui/action-bar/index.android.d.ts +0 -2
- package/ui/action-bar/index.android.js +3 -28
- package/ui/action-bar/index.android.js.map +1 -1
- package/ui/action-bar/index.d.ts +10 -6
- package/ui/action-bar/index.ios.js +8 -9
- package/ui/action-bar/index.ios.js.map +1 -1
- package/ui/activity-indicator/index.android.js +3 -2
- package/ui/activity-indicator/index.android.js.map +1 -1
- package/ui/activity-indicator/index.ios.js +2 -3
- package/ui/activity-indicator/index.ios.js.map +1 -1
- package/ui/animation/keyframe-animation.d.ts +4 -1
- package/ui/animation/keyframe-animation.js +6 -2
- package/ui/animation/keyframe-animation.js.map +1 -1
- package/ui/builder/index.js.map +1 -1
- package/ui/builder/xml2ui.js.map +1 -1
- package/ui/button/index.android.d.ts +0 -2
- package/ui/button/index.android.js +3 -29
- package/ui/button/index.android.js.map +1 -1
- package/ui/button/index.d.ts +9 -5
- package/ui/core/bindable/index.d.ts +13 -0
- package/ui/core/bindable/index.js +27 -6
- package/ui/core/bindable/index.js.map +1 -1
- package/ui/core/properties/index.js +3 -2
- package/ui/core/properties/index.js.map +1 -1
- package/ui/core/view/index.android.js +86 -66
- package/ui/core/view/index.android.js.map +1 -1
- package/ui/core/view/index.d.ts +19 -12
- package/ui/core/view/index.ios.js +3 -3
- package/ui/core/view/index.ios.js.map +1 -1
- package/ui/core/view/view-common.d.ts +6 -6
- package/ui/core/view/view-common.js +71 -59
- package/ui/core/view/view-common.js.map +1 -1
- package/ui/core/view/view-helper/index.android.d.ts +7 -0
- package/ui/core/view/view-helper/index.android.js +53 -0
- package/ui/core/view/view-helper/index.android.js.map +1 -1
- package/ui/core/view/view-helper/index.d.ts +10 -0
- package/ui/core/view/view-helper/index.ios.d.ts +1 -0
- package/ui/core/view/view-helper/index.ios.js +1 -0
- package/ui/core/view/view-helper/index.ios.js.map +1 -1
- package/ui/core/view-base/index.d.ts +12 -0
- package/ui/core/view-base/index.js +11 -2
- package/ui/core/view-base/index.js.map +1 -1
- package/ui/dialogs/dialogs-common.d.ts +4 -0
- package/ui/dialogs/dialogs-common.js.map +1 -1
- package/ui/dialogs/index.ios.js +70 -32
- package/ui/dialogs/index.ios.js.map +1 -1
- package/ui/embedding/index.android.d.ts +4 -0
- package/ui/embedding/index.android.js +14 -0
- package/ui/embedding/index.android.js.map +1 -0
- package/ui/embedding/index.d.ts +10 -0
- package/ui/embedding/index.ios.d.ts +1 -0
- package/ui/embedding/index.ios.js +4 -0
- package/ui/embedding/index.ios.js.map +1 -0
- package/ui/frame/activity.android.js +106 -47
- package/ui/frame/activity.android.js.map +1 -1
- package/ui/frame/callbacks/activity-callbacks.d.ts +20 -0
- package/ui/frame/callbacks/activity-callbacks.js +301 -0
- package/ui/frame/callbacks/activity-callbacks.js.map +1 -0
- package/ui/frame/callbacks/fragment-callbacks.d.ts +19 -0
- package/ui/frame/callbacks/fragment-callbacks.js +273 -0
- package/ui/frame/callbacks/fragment-callbacks.js.map +1 -0
- package/ui/frame/fragment.android.d.ts +3 -1
- package/ui/frame/fragment.android.js +40 -3
- package/ui/frame/fragment.android.js.map +1 -1
- package/ui/frame/fragment.d.ts +5 -0
- package/ui/frame/fragment.ios.d.ts +3 -0
- package/ui/frame/fragment.ios.js +4 -0
- package/ui/frame/fragment.ios.js.map +1 -0
- package/ui/frame/index.android.d.ts +3 -2
- package/ui/frame/index.android.js +7 -560
- package/ui/frame/index.android.js.map +1 -1
- package/ui/frame/index.d.ts +27 -5
- package/ui/frame/index.ios.js +3 -4
- package/ui/frame/index.ios.js.map +1 -1
- package/ui/gestures/gestures-common.d.ts +10 -7
- package/ui/gestures/gestures-common.js +40 -68
- package/ui/gestures/gestures-common.js.map +1 -1
- package/ui/gestures/index.android.js +60 -46
- package/ui/gestures/index.android.js.map +1 -1
- package/ui/gestures/index.d.ts +3 -1
- package/ui/gestures/index.ios.d.ts +20 -2
- package/ui/gestures/index.ios.js +88 -66
- package/ui/gestures/index.ios.js.map +1 -1
- package/ui/gestures/touch-manager.js +2 -2
- package/ui/gestures/touch-manager.js.map +1 -1
- package/ui/html-view/index.ios.js +2 -3
- package/ui/html-view/index.ios.js.map +1 -1
- package/ui/image/image-common.d.ts +12 -1
- package/ui/image/image-common.js +28 -2
- package/ui/image/image-common.js.map +1 -1
- package/ui/image/index.d.ts +1 -0
- package/ui/image/index.ios.d.ts +1 -0
- package/ui/image/index.ios.js +29 -2
- package/ui/image/index.ios.js.map +1 -1
- package/ui/image/symbol-effects-common.d.ts +36 -0
- package/ui/image/symbol-effects-common.js +35 -0
- package/ui/image/symbol-effects-common.js.map +1 -0
- package/ui/image/symbol-effects.android.d.ts +5 -0
- package/ui/image/symbol-effects.android.js +8 -0
- package/ui/image/symbol-effects.android.js.map +1 -0
- package/ui/image/symbol-effects.d.ts +13 -0
- package/ui/image/symbol-effects.ios.d.ts +6 -0
- package/ui/image/symbol-effects.ios.js +79 -0
- package/ui/image/symbol-effects.ios.js.map +1 -0
- package/ui/image-cache/index.d.ts +10 -6
- package/ui/index.d.ts +3 -2
- package/ui/index.js +3 -2
- package/ui/index.js.map +1 -1
- package/ui/layouts/grid-layout/index.android.js +12 -11
- package/ui/layouts/grid-layout/index.android.js.map +1 -1
- package/ui/list-picker/index.android.js.map +1 -1
- package/ui/list-view/index.d.ts +10 -6
- package/ui/page/index.d.ts +10 -6
- package/ui/progress/index.android.js +5 -4
- package/ui/progress/index.android.js.map +1 -1
- package/ui/scroll-view/index.d.ts +9 -5
- package/ui/scroll-view/index.ios.js +2 -3
- package/ui/scroll-view/index.ios.js.map +1 -1
- package/ui/search-bar/index.d.ts +9 -5
- package/ui/search-bar/index.ios.js +2 -3
- package/ui/search-bar/index.ios.js.map +1 -1
- package/ui/segmented-bar/index.android.js +4 -13
- package/ui/segmented-bar/index.android.js.map +1 -1
- package/ui/segmented-bar/index.d.ts +9 -5
- package/ui/slider/index.android.js +7 -4
- package/ui/slider/index.android.js.map +1 -1
- package/ui/styling/css-selector.d.ts +88 -32
- package/ui/styling/css-selector.js +479 -129
- package/ui/styling/css-selector.js.map +1 -1
- package/ui/styling/font-common.js.map +1 -1
- package/ui/styling/style-properties.js +3 -3
- package/ui/styling/style-properties.js.map +1 -1
- package/ui/styling/style-scope.d.ts +8 -3
- package/ui/styling/style-scope.js +275 -131
- package/ui/styling/style-scope.js.map +1 -1
- package/ui/switch/index.android.js +7 -6
- package/ui/switch/index.android.js.map +1 -1
- package/ui/switch/index.ios.js +4 -5
- package/ui/switch/index.ios.js.map +1 -1
- package/ui/tab-view/index.android.js +4 -12
- package/ui/tab-view/index.android.js.map +1 -1
- package/ui/tab-view/index.d.ts +10 -6
- package/ui/text-base/index.ios.js +4 -5
- package/ui/text-base/index.ios.js.map +1 -1
- package/ui/text-base/text-base-common.d.ts +3 -1
- package/ui/text-base/text-base-common.js +6 -0
- package/ui/text-base/text-base-common.js.map +1 -1
- package/ui/text-view/index.ios.js +3 -4
- package/ui/text-view/index.ios.js.map +1 -1
- package/ui/transition/page-transition.android.js.map +1 -1
- package/ui/utils.d.ts +5 -1
- package/ui/utils.ios.d.ts +1 -10
- package/ui/utils.ios.js.map +1 -1
- package/ui/web-view/index.android.js +2 -1
- package/ui/web-view/index.android.js.map +1 -1
- package/ui/web-view/index.d.ts +10 -6
- package/ui/web-view/index.ios.js +3 -2
- package/ui/web-view/index.ios.js.map +1 -1
- package/ui/web-view/web-view-common.js +3 -2
- package/ui/web-view/web-view-common.js.map +1 -1
- package/utils/common.d.ts +4 -1
- package/utils/common.js +9 -3
- package/utils/common.js.map +1 -1
- package/utils/index.android.d.ts +1 -1
- package/utils/index.android.js +6 -3
- package/utils/index.android.js.map +1 -1
- package/utils/index.d.ts +2 -2
- package/utils/index.ios.d.ts +1 -1
- package/utils/index.ios.js +6 -3
- package/utils/index.ios.js.map +1 -1
- package/utils/ios/index.js +30 -27
- package/utils/ios/index.js.map +1 -1
- package/wgc/atob.d.ts +1 -0
- package/wgc/atob.js +9 -0
- package/wgc/atob.js.map +1 -0
- package/wgc/btoa.d.ts +1 -0
- package/wgc/btoa.js +9 -0
- package/wgc/btoa.js.map +1 -0
- package/wgc/crypto/SubtleCrypto.d.ts +63 -0
- package/wgc/crypto/SubtleCrypto.js +551 -0
- package/wgc/crypto/SubtleCrypto.js.map +1 -0
- package/wgc/crypto/index.d.ts +8 -0
- package/wgc/crypto/index.js +31 -0
- package/wgc/crypto/index.js.map +1 -0
- package/wgc/index.d.ts +2 -0
- package/wgc/index.js +3 -0
- package/wgc/index.js.map +1 -0
- package/css-value/UPGRADING.md +0 -26
- package/platform/index.android.js.map +0 -1
- package/platform/index.ios.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CssAnimationProperty, unsetValue, _evaluateCssVariableExpression, _evaluateCssCalcExpression, isCssVariable, isCssVariableExpression, isCssCalcExpression } from '../core/properties';
|
|
2
|
-
import {
|
|
2
|
+
import { StyleSheetSelectorScope, fromAstNode, MEDIA_QUERY_SEPARATOR, matchMediaQueryString } from './css-selector';
|
|
3
3
|
import { Trace } from '../../trace';
|
|
4
4
|
import { File, knownFolders, path } from '../../file-system';
|
|
5
5
|
import { Application } from '../../application';
|
|
@@ -34,6 +34,18 @@ try {
|
|
|
34
34
|
catch (e) {
|
|
35
35
|
//
|
|
36
36
|
}
|
|
37
|
+
let mergedApplicationCssSelectors = [];
|
|
38
|
+
let applicationCssSelectors = [];
|
|
39
|
+
const applicationAdditionalSelectors = [];
|
|
40
|
+
let mergedApplicationCssKeyframes = [];
|
|
41
|
+
let applicationCssKeyframes = [];
|
|
42
|
+
const applicationAdditionalKeyframes = [];
|
|
43
|
+
let applicationCssSelectorVersion = 0;
|
|
44
|
+
const tagToScopeTag = new Map();
|
|
45
|
+
let currentScopeTag = null;
|
|
46
|
+
const animationsSymbol = Symbol('animations');
|
|
47
|
+
const kebabCasePattern = /-([a-z])/g;
|
|
48
|
+
const pattern = /('|")(.*?)\1/;
|
|
37
49
|
/**
|
|
38
50
|
* Evaluate css-variable and css-calc expressions
|
|
39
51
|
*/
|
|
@@ -53,34 +65,27 @@ function evaluateCssExpressions(view, property, value) {
|
|
|
53
65
|
return value;
|
|
54
66
|
}
|
|
55
67
|
export function mergeCssSelectors() {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
68
|
+
mergedApplicationCssSelectors = applicationCssSelectors.slice();
|
|
69
|
+
mergedApplicationCssSelectors.push(...applicationAdditionalSelectors);
|
|
70
|
+
}
|
|
71
|
+
export function mergeCssKeyframes() {
|
|
72
|
+
mergedApplicationCssKeyframes = applicationCssKeyframes.slice();
|
|
73
|
+
mergedApplicationCssKeyframes.push(...applicationAdditionalKeyframes);
|
|
59
74
|
}
|
|
60
|
-
let applicationCssSelectors = [];
|
|
61
|
-
let applicationCssSelectorVersion = 0;
|
|
62
|
-
let applicationSelectors = [];
|
|
63
|
-
const tagToScopeTag = new Map();
|
|
64
|
-
let currentScopeTag = null;
|
|
65
|
-
const applicationAdditionalSelectors = [];
|
|
66
|
-
const applicationKeyframes = {};
|
|
67
|
-
const animationsSymbol = Symbol('animations');
|
|
68
|
-
const kebabCasePattern = /-([a-z])/g;
|
|
69
|
-
const pattern = /('|")(.*?)\1/;
|
|
70
75
|
class CSSSource {
|
|
71
|
-
constructor(_ast, _url, _file,
|
|
76
|
+
constructor(_ast, _url, _file, _source) {
|
|
72
77
|
this._ast = _ast;
|
|
73
78
|
this._url = _url;
|
|
74
79
|
this._file = _file;
|
|
75
|
-
this._keyframes = _keyframes;
|
|
76
80
|
this._source = _source;
|
|
77
81
|
this._selectors = [];
|
|
82
|
+
this._keyframes = [];
|
|
78
83
|
this.parse();
|
|
79
84
|
}
|
|
80
|
-
static fromDetect(cssOrAst,
|
|
85
|
+
static fromDetect(cssOrAst, fileName) {
|
|
81
86
|
if (typeof cssOrAst === 'string') {
|
|
82
87
|
// raw-loader
|
|
83
|
-
return CSSSource.fromSource(cssOrAst,
|
|
88
|
+
return CSSSource.fromSource(cssOrAst, fileName);
|
|
84
89
|
}
|
|
85
90
|
else if (typeof cssOrAst === 'object') {
|
|
86
91
|
if (cssOrAst.default) {
|
|
@@ -88,13 +93,13 @@ class CSSSource {
|
|
|
88
93
|
}
|
|
89
94
|
if (cssOrAst.type === 'stylesheet' && cssOrAst.stylesheet && cssOrAst.stylesheet.rules) {
|
|
90
95
|
// css-loader
|
|
91
|
-
return CSSSource.fromAST(cssOrAst,
|
|
96
|
+
return CSSSource.fromAST(cssOrAst, fileName);
|
|
92
97
|
}
|
|
93
98
|
}
|
|
94
99
|
// css2json-loader
|
|
95
|
-
return CSSSource.fromSource(cssOrAst.toString(),
|
|
100
|
+
return CSSSource.fromSource(cssOrAst.toString(), fileName);
|
|
96
101
|
}
|
|
97
|
-
static fromURI(uri
|
|
102
|
+
static fromURI(uri) {
|
|
98
103
|
// webpack modules require all file paths to be relative to /app folder
|
|
99
104
|
const appRelativeUri = CSSSource.pathRelativeToApp(uri);
|
|
100
105
|
const sanitizedModuleName = sanitizeModuleName(appRelativeUri);
|
|
@@ -102,7 +107,7 @@ class CSSSource {
|
|
|
102
107
|
try {
|
|
103
108
|
const cssOrAst = global.loadModule(resolvedModuleName, true);
|
|
104
109
|
if (cssOrAst) {
|
|
105
|
-
return CSSSource.fromDetect(cssOrAst,
|
|
110
|
+
return CSSSource.fromDetect(cssOrAst, resolvedModuleName);
|
|
106
111
|
}
|
|
107
112
|
}
|
|
108
113
|
catch (e) {
|
|
@@ -110,7 +115,7 @@ class CSSSource {
|
|
|
110
115
|
Trace.write(`Could not load CSS from ${uri}: ${e}`, Trace.categories.Error, Trace.messageType.warn);
|
|
111
116
|
}
|
|
112
117
|
}
|
|
113
|
-
return CSSSource.fromFile(appRelativeUri
|
|
118
|
+
return CSSSource.fromFile(appRelativeUri);
|
|
114
119
|
}
|
|
115
120
|
static pathRelativeToApp(uri) {
|
|
116
121
|
if (!uri.startsWith('/')) {
|
|
@@ -121,39 +126,42 @@ class CSSSource {
|
|
|
121
126
|
Trace.write(`${uri} does not start with ${appPath}`, Trace.categories.Error, Trace.messageType.error);
|
|
122
127
|
return uri;
|
|
123
128
|
}
|
|
124
|
-
const relativeUri = `.${uri.
|
|
129
|
+
const relativeUri = `.${uri.substring(appPath.length)}`;
|
|
125
130
|
return relativeUri;
|
|
126
131
|
}
|
|
127
|
-
static fromFile(url
|
|
132
|
+
static fromFile(url) {
|
|
128
133
|
// .scss, .sass, etc. css files in vanilla app are usually compiled to .css so we will try to load a compiled file first.
|
|
129
134
|
const cssFileUrl = url.replace(/\..\w+$/, '.css');
|
|
130
135
|
if (cssFileUrl !== url) {
|
|
131
136
|
const cssFile = CSSSource.resolveCSSPathFromURL(cssFileUrl);
|
|
132
137
|
if (cssFile) {
|
|
133
|
-
return new CSSSource(undefined, url, cssFile,
|
|
138
|
+
return new CSSSource(undefined, url, cssFile, undefined);
|
|
134
139
|
}
|
|
135
140
|
}
|
|
136
141
|
const file = CSSSource.resolveCSSPathFromURL(url);
|
|
137
|
-
return new CSSSource(undefined, url, file,
|
|
142
|
+
return new CSSSource(undefined, url, file, undefined);
|
|
138
143
|
}
|
|
139
|
-
static fromFileImport(url,
|
|
144
|
+
static fromFileImport(url, importSource) {
|
|
140
145
|
const file = CSSSource.resolveCSSPathFromURL(url, importSource);
|
|
141
|
-
return new CSSSource(undefined, url, file,
|
|
146
|
+
return new CSSSource(undefined, url, file, undefined);
|
|
142
147
|
}
|
|
143
148
|
static resolveCSSPathFromURL(url, importSource) {
|
|
144
149
|
const app = knownFolders.currentApp().path;
|
|
145
150
|
const file = resolveFileNameFromUrl(url, app, File.exists, importSource);
|
|
146
151
|
return file;
|
|
147
152
|
}
|
|
148
|
-
static fromSource(source,
|
|
149
|
-
return new CSSSource(undefined, url, undefined,
|
|
153
|
+
static fromSource(source, url) {
|
|
154
|
+
return new CSSSource(undefined, url, undefined, source);
|
|
150
155
|
}
|
|
151
|
-
static fromAST(ast,
|
|
152
|
-
return new CSSSource(ast, url, undefined,
|
|
156
|
+
static fromAST(ast, url) {
|
|
157
|
+
return new CSSSource(ast, url, undefined, undefined);
|
|
153
158
|
}
|
|
154
159
|
get selectors() {
|
|
155
160
|
return this._selectors;
|
|
156
161
|
}
|
|
162
|
+
get keyframes() {
|
|
163
|
+
return this._keyframes;
|
|
164
|
+
}
|
|
157
165
|
get source() {
|
|
158
166
|
return this._source;
|
|
159
167
|
}
|
|
@@ -173,7 +181,7 @@ class CSSSource {
|
|
|
173
181
|
}
|
|
174
182
|
}
|
|
175
183
|
if (this._ast) {
|
|
176
|
-
this.
|
|
184
|
+
this.createSelectorsAndKeyframes();
|
|
177
185
|
}
|
|
178
186
|
else {
|
|
179
187
|
this._selectors = [];
|
|
@@ -206,42 +214,23 @@ class CSSSource {
|
|
|
206
214
|
}
|
|
207
215
|
}
|
|
208
216
|
}
|
|
209
|
-
|
|
217
|
+
createSelectorsAndKeyframes() {
|
|
210
218
|
if (this._ast) {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
});
|
|
226
|
-
const getCssFile = ({ url, source }) => (source ? CSSSource.fromFileImport(url, this._keyframes, source) : CSSSource.fromURI(url, this._keyframes));
|
|
227
|
-
const cssFiles = imports
|
|
228
|
-
.map(toUrlSourcePair)
|
|
229
|
-
.filter(({ url }) => !!url)
|
|
230
|
-
.map(getCssFile);
|
|
231
|
-
const selectors = cssFiles.map((file) => (file && file.selectors) || []);
|
|
232
|
-
return selectors.reduce((acc, val) => acc.concat(val), []);
|
|
233
|
-
}
|
|
234
|
-
createSelectorsFromSyntaxTree() {
|
|
235
|
-
const nodes = this._ast.stylesheet.rules;
|
|
236
|
-
nodes.filter(isKeyframe).forEach((node) => (this._keyframes[node.name] = node));
|
|
237
|
-
const rulesets = fromAstNodes(nodes);
|
|
238
|
-
if (rulesets && rulesets.length) {
|
|
239
|
-
ensureCssAnimationParserModule();
|
|
240
|
-
rulesets.forEach((rule) => {
|
|
241
|
-
rule[animationsSymbol] = cssAnimationParserModule.CssAnimationParser.keyframeAnimationsFromCSSDeclarations(rule.declarations);
|
|
242
|
-
});
|
|
219
|
+
const nodes = this._ast.stylesheet.rules;
|
|
220
|
+
const rulesets = [];
|
|
221
|
+
const keyframes = [];
|
|
222
|
+
// When css2json-loader is enabled, imports are handled there and removed from AST rules
|
|
223
|
+
populateRulesFromImports(nodes, rulesets, keyframes);
|
|
224
|
+
_populateRules(nodes, rulesets, keyframes);
|
|
225
|
+
if (rulesets && rulesets.length) {
|
|
226
|
+
ensureCssAnimationParserModule();
|
|
227
|
+
rulesets.forEach((rule) => {
|
|
228
|
+
rule[animationsSymbol] = cssAnimationParserModule.CssAnimationParser.keyframeAnimationsFromCSSDeclarations(rule.declarations);
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
this._selectors = rulesets;
|
|
232
|
+
this._keyframes = keyframes;
|
|
243
233
|
}
|
|
244
|
-
return rulesets;
|
|
245
234
|
}
|
|
246
235
|
toString() {
|
|
247
236
|
return this._file || this._url || '(in-memory)';
|
|
@@ -258,50 +247,144 @@ __decorate([
|
|
|
258
247
|
], CSSSource.prototype, "parseCSSAst", null);
|
|
259
248
|
__decorate([
|
|
260
249
|
profile
|
|
261
|
-
], CSSSource.prototype, "
|
|
250
|
+
], CSSSource.prototype, "createSelectorsAndKeyframes", null);
|
|
262
251
|
__decorate([
|
|
263
252
|
profile
|
|
264
253
|
], CSSSource, "resolveCSSPathFromURL", null);
|
|
254
|
+
function populateRulesFromImports(nodes, rulesets, keyframes) {
|
|
255
|
+
const imports = nodes.filter((r) => r.type === 'import');
|
|
256
|
+
if (!imports.length) {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
const urlFromImportObject = (importObject) => {
|
|
260
|
+
const importItem = importObject['import'];
|
|
261
|
+
const urlMatch = importItem && importItem.match(pattern);
|
|
262
|
+
return urlMatch && urlMatch[2];
|
|
263
|
+
};
|
|
264
|
+
const sourceFromImportObject = (importObject) => importObject['position'] && importObject['position']['source'];
|
|
265
|
+
const toUrlSourcePair = (importObject) => ({
|
|
266
|
+
url: urlFromImportObject(importObject),
|
|
267
|
+
source: sourceFromImportObject(importObject),
|
|
268
|
+
});
|
|
269
|
+
const getCssFile = ({ url, source }) => (source ? CSSSource.fromFileImport(url, source) : CSSSource.fromURI(url));
|
|
270
|
+
const cssFiles = imports
|
|
271
|
+
.map(toUrlSourcePair)
|
|
272
|
+
.filter(({ url }) => !!url)
|
|
273
|
+
.map(getCssFile);
|
|
274
|
+
for (const cssFile of cssFiles) {
|
|
275
|
+
if (cssFile) {
|
|
276
|
+
rulesets.push(...cssFile.selectors);
|
|
277
|
+
keyframes.push(...cssFile.keyframes);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
export function _populateRules(nodes, rulesets, keyframes, mediaQueryString) {
|
|
282
|
+
for (const node of nodes) {
|
|
283
|
+
if (isKeyframe(node)) {
|
|
284
|
+
const keyframeRule = {
|
|
285
|
+
name: node.name,
|
|
286
|
+
keyframes: node.keyframes,
|
|
287
|
+
mediaQueryString: mediaQueryString,
|
|
288
|
+
};
|
|
289
|
+
keyframes.push(keyframeRule);
|
|
290
|
+
}
|
|
291
|
+
else if (isMedia(node)) {
|
|
292
|
+
// Media query is composite in the case of nested media queries
|
|
293
|
+
const compositeMediaQuery = mediaQueryString ? mediaQueryString + MEDIA_QUERY_SEPARATOR + node.media : node.media;
|
|
294
|
+
_populateRules(node.rules, rulesets, keyframes, compositeMediaQuery);
|
|
295
|
+
}
|
|
296
|
+
else if (isRule(node)) {
|
|
297
|
+
const ruleset = fromAstNode(node);
|
|
298
|
+
ruleset.mediaQueryString = mediaQueryString;
|
|
299
|
+
rulesets.push(ruleset);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
265
303
|
export function removeTaggedAdditionalCSS(tag) {
|
|
266
|
-
let
|
|
304
|
+
let selectorsChanged = false;
|
|
305
|
+
let keyframesChanged = false;
|
|
306
|
+
let updated = false;
|
|
267
307
|
for (let i = 0; i < applicationAdditionalSelectors.length; i++) {
|
|
268
308
|
if (applicationAdditionalSelectors[i].tag === tag) {
|
|
269
309
|
applicationAdditionalSelectors.splice(i, 1);
|
|
270
310
|
i--;
|
|
271
|
-
|
|
311
|
+
selectorsChanged = true;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
for (let i = 0; i < applicationAdditionalKeyframes.length; i++) {
|
|
315
|
+
if (applicationAdditionalKeyframes[i].tag === tag) {
|
|
316
|
+
applicationAdditionalKeyframes.splice(i, 1);
|
|
317
|
+
i--;
|
|
318
|
+
keyframesChanged = true;
|
|
272
319
|
}
|
|
273
320
|
}
|
|
274
|
-
if (
|
|
321
|
+
if (selectorsChanged) {
|
|
275
322
|
mergeCssSelectors();
|
|
323
|
+
updated = true;
|
|
324
|
+
}
|
|
325
|
+
if (keyframesChanged) {
|
|
326
|
+
mergeCssKeyframes();
|
|
327
|
+
updated = true;
|
|
328
|
+
}
|
|
329
|
+
if (updated) {
|
|
330
|
+
applicationCssSelectorVersion++;
|
|
276
331
|
}
|
|
277
|
-
return
|
|
332
|
+
return updated;
|
|
278
333
|
}
|
|
279
334
|
export function addTaggedAdditionalCSS(cssText, tag) {
|
|
280
|
-
const
|
|
335
|
+
const { selectors, keyframes } = CSSSource.fromDetect(cssText, undefined);
|
|
281
336
|
const tagScope = currentScopeTag || (tag && tagToScopeTag.has(tag) && tagToScopeTag.get(tag)) || null;
|
|
282
337
|
if (tagScope && tag) {
|
|
283
338
|
tagToScopeTag.set(tag, tagScope);
|
|
284
339
|
}
|
|
285
|
-
let
|
|
286
|
-
|
|
287
|
-
|
|
340
|
+
let selectorsChanged = false;
|
|
341
|
+
let keyframesChanged = false;
|
|
342
|
+
let updated = false;
|
|
343
|
+
if (selectors && selectors.length) {
|
|
344
|
+
selectorsChanged = true;
|
|
288
345
|
if (tag != null || tagScope != null) {
|
|
289
|
-
for (let i = 0; i <
|
|
290
|
-
|
|
291
|
-
|
|
346
|
+
for (let i = 0, length = selectors.length; i < length; i++) {
|
|
347
|
+
selectors[i].tag = tag;
|
|
348
|
+
selectors[i].scopedTag = tagScope;
|
|
292
349
|
}
|
|
293
350
|
}
|
|
294
|
-
applicationAdditionalSelectors.push(...
|
|
351
|
+
applicationAdditionalSelectors.push(...selectors);
|
|
295
352
|
mergeCssSelectors();
|
|
353
|
+
updated = true;
|
|
354
|
+
}
|
|
355
|
+
if (keyframes && keyframes.length) {
|
|
356
|
+
keyframesChanged = true;
|
|
357
|
+
if (tag != null || tagScope != null) {
|
|
358
|
+
for (let i = 0, length = keyframes.length; i < length; i++) {
|
|
359
|
+
keyframes[i].tag = tag;
|
|
360
|
+
keyframes[i].scopedTag = tagScope;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
applicationAdditionalKeyframes.push(...keyframes);
|
|
364
|
+
mergeCssKeyframes();
|
|
365
|
+
updated = true;
|
|
296
366
|
}
|
|
297
|
-
|
|
367
|
+
if (updated) {
|
|
368
|
+
applicationCssSelectorVersion++;
|
|
369
|
+
}
|
|
370
|
+
return updated;
|
|
298
371
|
}
|
|
299
372
|
const onCssChanged = profile('"style-scope".onCssChanged', (args) => {
|
|
300
373
|
if (args.cssText) {
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
|
|
374
|
+
const { selectors, keyframes } = CSSSource.fromSource(args.cssText, args.cssFile);
|
|
375
|
+
let updated = false;
|
|
376
|
+
if (selectors) {
|
|
377
|
+
applicationAdditionalSelectors.push(...selectors);
|
|
304
378
|
mergeCssSelectors();
|
|
379
|
+
updated = true;
|
|
380
|
+
}
|
|
381
|
+
if (keyframes) {
|
|
382
|
+
applicationAdditionalKeyframes.push(...keyframes);
|
|
383
|
+
mergeCssKeyframes();
|
|
384
|
+
updated = true;
|
|
385
|
+
}
|
|
386
|
+
if (updated) {
|
|
387
|
+
applicationCssSelectorVersion++;
|
|
305
388
|
}
|
|
306
389
|
}
|
|
307
390
|
else if (args.cssFile) {
|
|
@@ -313,16 +396,28 @@ function onLiveSync(args) {
|
|
|
313
396
|
}
|
|
314
397
|
const loadCss = profile(`"style-scope".loadCss`, (cssModule) => {
|
|
315
398
|
if (!cssModule) {
|
|
316
|
-
return
|
|
399
|
+
return;
|
|
317
400
|
}
|
|
318
401
|
// safely remove "./" as global CSS should be resolved relative to app folder
|
|
319
402
|
if (cssModule.startsWith('./')) {
|
|
320
|
-
cssModule = cssModule.
|
|
403
|
+
cssModule = cssModule.substring(2);
|
|
321
404
|
}
|
|
322
|
-
const
|
|
323
|
-
|
|
324
|
-
|
|
405
|
+
const { selectors, keyframes } = CSSSource.fromURI(cssModule);
|
|
406
|
+
let updated = false;
|
|
407
|
+
// Check for existing application css selectors too in case the app is undergoing a live-sync
|
|
408
|
+
if (selectors.length > 0 || applicationCssSelectors.length > 0) {
|
|
409
|
+
applicationCssSelectors = selectors;
|
|
325
410
|
mergeCssSelectors();
|
|
411
|
+
updated = true;
|
|
412
|
+
}
|
|
413
|
+
// Check for existing application css keyframes too in case the app is undergoing a live-sync
|
|
414
|
+
if (keyframes.length > 0 || applicationCssKeyframes.length > 0) {
|
|
415
|
+
applicationCssKeyframes = keyframes;
|
|
416
|
+
mergeCssKeyframes();
|
|
417
|
+
updated = true;
|
|
418
|
+
}
|
|
419
|
+
if (updated) {
|
|
420
|
+
applicationCssSelectorVersion++;
|
|
326
421
|
}
|
|
327
422
|
});
|
|
328
423
|
global.NativeScriptGlobals.events.on('cssChanged', onCssChanged);
|
|
@@ -390,7 +485,7 @@ export class CssState {
|
|
|
390
485
|
updateMatch() {
|
|
391
486
|
const view = this.viewRef.get();
|
|
392
487
|
if (view && view._styleScope) {
|
|
393
|
-
this._match = view._styleScope.matchSelectors(view);
|
|
488
|
+
this._match = view._styleScope.matchSelectors(view) ?? CssState.emptyMatch;
|
|
394
489
|
this._appliedSelectorsVersion = view._styleScope.getSelectorsVersion();
|
|
395
490
|
}
|
|
396
491
|
else {
|
|
@@ -405,12 +500,12 @@ export class CssState {
|
|
|
405
500
|
return;
|
|
406
501
|
}
|
|
407
502
|
const matchingSelectors = this._match.selectors.filter((sel) => (sel.dynamic ? sel.match(view) : true));
|
|
408
|
-
if
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
}
|
|
503
|
+
// Ideally we should return here if there are no matching selectors, however
|
|
504
|
+
// if there are property removals, returning here would not remove them
|
|
505
|
+
// this is seen in STYLE test in automated.
|
|
506
|
+
// if (!matchingSelectors || matchingSelectors.length === 0) {
|
|
507
|
+
// return;
|
|
508
|
+
// }
|
|
414
509
|
view._batchUpdate(() => {
|
|
415
510
|
this.stopKeyframeAnimations();
|
|
416
511
|
this.setPropertyValues(matchingSelectors);
|
|
@@ -420,7 +515,7 @@ export class CssState {
|
|
|
420
515
|
playKeyframeAnimations(matchingSelectors) {
|
|
421
516
|
const animations = [];
|
|
422
517
|
matchingSelectors.forEach((selector) => {
|
|
423
|
-
const ruleAnimations = selector.ruleset[animationsSymbol];
|
|
518
|
+
const ruleAnimations = selector.ruleset?.[animationsSymbol];
|
|
424
519
|
if (ruleAnimations) {
|
|
425
520
|
ensureKeyframeAnimationModule();
|
|
426
521
|
for (const animationInfo of ruleAnimations) {
|
|
@@ -618,10 +713,10 @@ export class StyleScope {
|
|
|
618
713
|
constructor() {
|
|
619
714
|
this._css = '';
|
|
620
715
|
this._localCssSelectors = [];
|
|
716
|
+
this._localCssKeyframes = [];
|
|
621
717
|
this._localCssSelectorVersion = 0;
|
|
622
718
|
this._localCssSelectorsAppliedVersion = 0;
|
|
623
719
|
this._applicationCssSelectorsAppliedVersion = 0;
|
|
624
|
-
this._keyframes = new Map();
|
|
625
720
|
this._cssFiles = [];
|
|
626
721
|
}
|
|
627
722
|
get css() {
|
|
@@ -642,17 +737,19 @@ export class StyleScope {
|
|
|
642
737
|
}
|
|
643
738
|
this._cssFiles.push(cssFileName);
|
|
644
739
|
currentScopeTag = cssFileName;
|
|
645
|
-
const
|
|
740
|
+
const cssFile = CSSSource.fromURI(cssFileName);
|
|
646
741
|
currentScopeTag = null;
|
|
647
|
-
this._css =
|
|
648
|
-
this._localCssSelectors =
|
|
742
|
+
this._css = cssFile.source;
|
|
743
|
+
this._localCssSelectors = cssFile.selectors;
|
|
744
|
+
this._localCssKeyframes = cssFile.keyframes;
|
|
649
745
|
this._localCssSelectorVersion++;
|
|
650
746
|
this.ensureSelectors();
|
|
651
747
|
}
|
|
652
748
|
setCss(cssString, cssFileName) {
|
|
653
749
|
this._css = cssString;
|
|
654
|
-
const cssFile = CSSSource.fromSource(cssString,
|
|
750
|
+
const cssFile = CSSSource.fromSource(cssString, cssFileName);
|
|
655
751
|
this._localCssSelectors = cssFile.selectors;
|
|
752
|
+
this._localCssKeyframes = cssFile.keyframes;
|
|
656
753
|
this._localCssSelectorVersion++;
|
|
657
754
|
this.ensureSelectors();
|
|
658
755
|
}
|
|
@@ -664,22 +761,23 @@ export class StyleScope {
|
|
|
664
761
|
this._cssFiles.push(cssFileName);
|
|
665
762
|
currentScopeTag = cssFileName;
|
|
666
763
|
}
|
|
667
|
-
const
|
|
764
|
+
const cssFile = cssString ? CSSSource.fromSource(cssString, cssFileName) : CSSSource.fromURI(cssFileName);
|
|
668
765
|
currentScopeTag = null;
|
|
669
|
-
this._css = this._css +
|
|
670
|
-
this._localCssSelectors.push(...
|
|
766
|
+
this._css = this._css + cssFile.source;
|
|
767
|
+
this._localCssSelectors.push(...cssFile.selectors);
|
|
768
|
+
this._localCssKeyframes.push(...cssFile.keyframes);
|
|
671
769
|
this._localCssSelectorVersion++;
|
|
672
770
|
this.ensureSelectors();
|
|
673
771
|
}
|
|
674
772
|
getKeyframeAnimationWithName(animationName) {
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
return;
|
|
773
|
+
if (!this._mergedCssKeyframes) {
|
|
774
|
+
return null;
|
|
678
775
|
}
|
|
776
|
+
const keyframeRule = this.findKeyframeRule(animationName);
|
|
679
777
|
ensureKeyframeAnimationModule();
|
|
680
778
|
const animation = new keyframeAnimationModule.KeyframeAnimationInfo();
|
|
681
779
|
ensureCssAnimationParserModule();
|
|
682
|
-
animation.keyframes = cssAnimationParserModule.CssAnimationParser.keyframesArrayFromCSS(
|
|
780
|
+
animation.keyframes = keyframeRule ? cssAnimationParserModule.CssAnimationParser.keyframesArrayFromCSS(keyframeRule.keyframes) : null;
|
|
683
781
|
return animation;
|
|
684
782
|
}
|
|
685
783
|
ensureSelectors() {
|
|
@@ -699,46 +797,61 @@ export class StyleScope {
|
|
|
699
797
|
}
|
|
700
798
|
_createSelectors() {
|
|
701
799
|
const toMerge = [];
|
|
702
|
-
|
|
800
|
+
const toMergeKeyframes = [];
|
|
801
|
+
toMerge.push(...mergedApplicationCssSelectors.filter((v) => !v.scopedTag || this._cssFiles.indexOf(v.scopedTag) >= 0));
|
|
802
|
+
toMergeKeyframes.push(...mergedApplicationCssKeyframes.filter((v) => !v.scopedTag || this._cssFiles.indexOf(v.scopedTag) >= 0));
|
|
703
803
|
this._applicationCssSelectorsAppliedVersion = applicationCssSelectorVersion;
|
|
704
|
-
toMerge.push(this._localCssSelectors);
|
|
804
|
+
toMerge.push(...this._localCssSelectors);
|
|
805
|
+
toMergeKeyframes.push(...this._localCssKeyframes);
|
|
705
806
|
this._localCssSelectorsAppliedVersion = this._localCssSelectorVersion;
|
|
706
|
-
for (const keyframe in applicationKeyframes) {
|
|
707
|
-
this._keyframes[keyframe] = applicationKeyframes[keyframe];
|
|
708
|
-
}
|
|
709
807
|
if (toMerge.length > 0) {
|
|
710
|
-
this._mergedCssSelectors = toMerge
|
|
711
|
-
this.
|
|
712
|
-
|
|
808
|
+
this._mergedCssSelectors = toMerge;
|
|
809
|
+
this._selectorScope = new StyleSheetSelectorScope(this._mergedCssSelectors);
|
|
810
|
+
}
|
|
811
|
+
else {
|
|
812
|
+
this._mergedCssSelectors = null;
|
|
813
|
+
this._selectorScope = null;
|
|
713
814
|
}
|
|
815
|
+
this._mergedCssKeyframes = toMergeKeyframes.length > 0 ? toMergeKeyframes : null;
|
|
714
816
|
}
|
|
715
817
|
// HACK: This @profile decorator creates a circular dependency
|
|
716
818
|
// HACK: because the function parameter type is evaluated with 'typeof'
|
|
717
819
|
matchSelectors(view) {
|
|
820
|
+
let match;
|
|
718
821
|
// should be (view: ViewBase): SelectorsMatch<ViewBase>
|
|
719
822
|
this.ensureSelectors();
|
|
720
|
-
|
|
823
|
+
if (this._selectorScope) {
|
|
824
|
+
match = this._selectorScope.query(view);
|
|
825
|
+
// Make sure to re-apply keyframes to matching selectors as a media query keyframe might be applicable at this point
|
|
826
|
+
this._applyKeyframesToSelectors(match.selectors);
|
|
827
|
+
}
|
|
828
|
+
else {
|
|
829
|
+
match = null;
|
|
830
|
+
}
|
|
831
|
+
return match;
|
|
721
832
|
}
|
|
722
833
|
query(node) {
|
|
723
834
|
this.ensureSelectors();
|
|
724
|
-
|
|
835
|
+
const match = this.matchSelectors(node);
|
|
836
|
+
return match ? match.selectors : [];
|
|
725
837
|
}
|
|
726
838
|
getSelectorsVersion() {
|
|
727
839
|
// The counters can only go up. So we can return just appVersion + localVersion
|
|
728
840
|
// The 100000 * appVersion is just for easier debugging
|
|
729
841
|
return 100000 * this._applicationCssSelectorsAppliedVersion + this._localCssSelectorsAppliedVersion;
|
|
730
842
|
}
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
843
|
+
_applyKeyframesToSelectors(selectors) {
|
|
844
|
+
if (!selectors?.length) {
|
|
845
|
+
return;
|
|
846
|
+
}
|
|
847
|
+
for (let i = selectors.length - 1; i >= 0; i--) {
|
|
848
|
+
const ruleset = selectors[i].ruleset;
|
|
734
849
|
const animations = ruleset[animationsSymbol];
|
|
735
|
-
if (animations
|
|
850
|
+
if (animations != null && animations.length) {
|
|
736
851
|
ensureCssAnimationParserModule();
|
|
737
852
|
for (const animation of animations) {
|
|
738
|
-
const
|
|
739
|
-
|
|
740
|
-
animation.keyframes = cssAnimationParserModule.CssAnimationParser.keyframesArrayFromCSS(cssKeyframe.keyframes);
|
|
741
|
-
}
|
|
853
|
+
const keyframeRule = this.findKeyframeRule(animation.name);
|
|
854
|
+
animation.keyframes = keyframeRule ? cssAnimationParserModule.CssAnimationParser.keyframesArrayFromCSS(keyframeRule.keyframes) : null;
|
|
742
855
|
}
|
|
743
856
|
}
|
|
744
857
|
}
|
|
@@ -746,6 +859,31 @@ export class StyleScope {
|
|
|
746
859
|
getAnimations(ruleset) {
|
|
747
860
|
return ruleset[animationsSymbol];
|
|
748
861
|
}
|
|
862
|
+
findKeyframeRule(animationName) {
|
|
863
|
+
if (!this._mergedCssKeyframes) {
|
|
864
|
+
return null;
|
|
865
|
+
}
|
|
866
|
+
// Cache media query results to avoid validations of other identical queries
|
|
867
|
+
let validatedMediaQueries;
|
|
868
|
+
// Iterate in reverse order as the last usable keyframe rule matters the most
|
|
869
|
+
for (let i = this._mergedCssKeyframes.length - 1; i >= 0; i--) {
|
|
870
|
+
const rule = this._mergedCssKeyframes[i];
|
|
871
|
+
if (rule.name !== animationName) {
|
|
872
|
+
continue;
|
|
873
|
+
}
|
|
874
|
+
if (!rule.mediaQueryString) {
|
|
875
|
+
return rule;
|
|
876
|
+
}
|
|
877
|
+
if (!validatedMediaQueries) {
|
|
878
|
+
validatedMediaQueries = [];
|
|
879
|
+
}
|
|
880
|
+
const isMatchingAllQueries = matchMediaQueryString(rule.mediaQueryString, validatedMediaQueries);
|
|
881
|
+
if (isMatchingAllQueries) {
|
|
882
|
+
return rule;
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
return null;
|
|
886
|
+
}
|
|
749
887
|
}
|
|
750
888
|
__decorate([
|
|
751
889
|
profile
|
|
@@ -771,7 +909,7 @@ export function resolveFileNameFromUrl(url, appDirectory, fileExists, importSour
|
|
|
771
909
|
}
|
|
772
910
|
if (!isAbsolutePath) {
|
|
773
911
|
if (fileName[0] === '~' && fileName[1] !== '/' && fileName[1] !== '"') {
|
|
774
|
-
fileName = fileName.
|
|
912
|
+
fileName = fileName.substring(1);
|
|
775
913
|
}
|
|
776
914
|
if (importSource) {
|
|
777
915
|
const importFile = resolveFilePathFromImport(importSource, fileName);
|
|
@@ -800,8 +938,8 @@ function resolveFilePathFromImport(importSource, fileName) {
|
|
|
800
938
|
}
|
|
801
939
|
export const applyInlineStyle = profile(function applyInlineStyle(view, styleStr) {
|
|
802
940
|
const localStyle = `local { ${styleStr} }`;
|
|
803
|
-
const inlineRuleSet = CSSSource.fromSource(localStyle
|
|
804
|
-
const oldInlineRuleSet = view['oldInlineStyle'] ? CSSSource.fromSource(`local { ${view['oldInlineStyle']} }
|
|
941
|
+
const inlineRuleSet = CSSSource.fromSource(localStyle).selectors;
|
|
942
|
+
const oldInlineRuleSet = view['oldInlineStyle'] ? CSSSource.fromSource(`local { ${view['oldInlineStyle']} }`).selectors : null;
|
|
805
943
|
// Reset unscoped css-variables
|
|
806
944
|
view.style.resetUnscopedCssVariables();
|
|
807
945
|
const declarations = inlineRuleSet?.[0]?.declarations || [];
|
|
@@ -867,7 +1005,13 @@ function isCurrentDirectory(uriPart) {
|
|
|
867
1005
|
function isParentDirectory(uriPart) {
|
|
868
1006
|
return uriPart === '..';
|
|
869
1007
|
}
|
|
1008
|
+
function isMedia(node) {
|
|
1009
|
+
return node.type === 'media';
|
|
1010
|
+
}
|
|
870
1011
|
function isKeyframe(node) {
|
|
871
1012
|
return node.type === 'keyframes';
|
|
872
1013
|
}
|
|
1014
|
+
function isRule(node) {
|
|
1015
|
+
return node.type === 'rule';
|
|
1016
|
+
}
|
|
873
1017
|
//# sourceMappingURL=style-scope.js.map
|