mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-09 16:16:41 +08:00
merge release-4.9.1
Release 4.9.1
This commit is contained in:
@ -1,3 +1,12 @@
|
||||
## [4.9.1](https://github.com/ionic-team/ionic/compare/v4.9.0...v4.9.1) (2019-09-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **platform:** properly detect iPads running iPadOS ([#19258](https://github.com/ionic-team/ionic/issues/19258)) ([4a90096](https://github.com/ionic-team/ionic/commit/4a90096))
|
||||
|
||||
|
||||
|
||||
# [4.9.0 Fluorine](https://github.com/ionic-team/ionic/compare/v4.8.1...v4.9.0) (2019-09-04)
|
||||
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ionic/angular",
|
||||
"version": "4.9.0",
|
||||
"version": "4.9.1",
|
||||
"description": "Angular specific wrappers for @ionic/core",
|
||||
"keywords": [
|
||||
"ionic",
|
||||
@ -49,7 +49,7 @@
|
||||
"css/"
|
||||
],
|
||||
"dependencies": {
|
||||
"@ionic/core": "4.9.0",
|
||||
"@ionic/core": "4.9.1",
|
||||
"tslib": "^1.9.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ionic/core",
|
||||
"version": "4.9.0",
|
||||
"version": "4.9.1",
|
||||
"description": "Base components for Ionic",
|
||||
"keywords": [
|
||||
"ionic",
|
||||
|
||||
@ -33,14 +33,25 @@ const detectPlatforms = (win: Window) =>
|
||||
const isMobileWeb = (win: Window): boolean =>
|
||||
isMobile(win) && !isHybrid(win);
|
||||
|
||||
const isIpad = (win: Window) =>
|
||||
testUserAgent(win, /iPad/i);
|
||||
const isIpad = (win: Window) => {
|
||||
// iOS 12 and below
|
||||
if (testUserAgent(win, /iPad/i)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// iOS 13+
|
||||
if (testUserAgent(win, /Macintosh/i) && isMobile(win)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
const isIphone = (win: Window) =>
|
||||
testUserAgent(win, /iPhone/i);
|
||||
|
||||
const isIOS = (win: Window) =>
|
||||
testUserAgent(win, /iPad|iPhone|iPod/i);
|
||||
testUserAgent(win, /iPhone|iPod/i) || isIpad(win);
|
||||
|
||||
const isAndroid = (win: Window) =>
|
||||
testUserAgent(win, /android|sink/i);
|
||||
|
||||
@ -63,10 +63,11 @@ describe('Platform Tests', () => {
|
||||
expect(isPlatform(win, 'desktop')).toEqual(true);
|
||||
});
|
||||
|
||||
it('should return true for "android" and "tablet" on an android tablet', () => {
|
||||
it('should return true for "android" and "tablet" and false for "ios" on an android tablet', () => {
|
||||
const win = configureBrowser(PlatformConfiguration.AndroidTablet);
|
||||
expect(isPlatform(win, 'android')).toEqual(true);
|
||||
expect(isPlatform(win, 'tablet')).toEqual(true);
|
||||
expect(isPlatform(win, 'ios')).toEqual(false);
|
||||
});
|
||||
|
||||
it('should return true for "cordova" and "hybrid" in a Cordova app', () => {
|
||||
@ -95,10 +96,11 @@ describe('Platform Tests', () => {
|
||||
expect(isPlatform(win, 'desktop')).toEqual(false);
|
||||
});
|
||||
|
||||
it('should return false for "android" and "tablet" on desktop Safari', () => {
|
||||
it('should return false for "android", "tablet", and "ipad" on desktop Safari', () => {
|
||||
const win = configureBrowser(PlatformConfiguration.DesktopSafari);
|
||||
expect(isPlatform(win, 'android')).toEqual(false);
|
||||
expect(isPlatform(win, 'tablet')).toEqual(false);
|
||||
expect(isPlatform(win, 'ipad')).toEqual(false);
|
||||
});
|
||||
|
||||
it('should return false for "android" and "tablet" and false for "desktop" on iPhone', () => {
|
||||
@ -120,5 +122,14 @@ describe('Platform Tests', () => {
|
||||
expect(isPlatform(win, 'pwa')).toEqual(true);
|
||||
expect(isPlatform(win, 'cordova')).toEqual(false);
|
||||
});
|
||||
|
||||
it('should return true for "ios", "ipad", and "tablet" and false for "iphone" and "android"', () => {
|
||||
const win = configureBrowser(PlatformConfiguration.iPadOS);
|
||||
expect(isPlatform(win, 'ios')).toEqual(true);
|
||||
expect(isPlatform(win, 'ipad')).toEqual(true);
|
||||
expect(isPlatform(win, 'tablet')).toEqual(true);
|
||||
expect(isPlatform(win, 'iphone')).toEqual(false);
|
||||
expect(isPlatform(win, 'android')).toEqual(false);
|
||||
});
|
||||
})
|
||||
});
|
||||
@ -85,5 +85,13 @@ export const PlatformConfiguration = {
|
||||
innerWidth: 360,
|
||||
innerHeight: 740,
|
||||
matchMedia: mockMatchMedia(['(any-pointer:coarse)'])
|
||||
},
|
||||
iPadOS: {
|
||||
navigator: {
|
||||
userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Safari/605.1.15'
|
||||
},
|
||||
innerWidth: 1024,
|
||||
innerHeight: 1292,
|
||||
matchMedia: mockMatchMedia(['(any-pointer:coarse)'])
|
||||
}
|
||||
};
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ionic/docs",
|
||||
"version": "4.9.0",
|
||||
"version": "4.9.1",
|
||||
"description": "Pre-packaged API documentation for the Ionic docs.",
|
||||
"main": "core.json",
|
||||
"files": [
|
||||
|
||||
Reference in New Issue
Block a user