merge release-4.11.1

This commit is contained in:
Ely Lucas
2019-10-14 11:36:08 -06:00
committed by GitHub
15 changed files with 59 additions and 29 deletions

View File

@@ -278,6 +278,9 @@ function updateDependency(pkg, dependency, version) {
if (pkg.devDependencies && pkg.devDependencies[dependency]) {
pkg.devDependencies[dependency] = version;
}
if (pkg.peerDependencies && pkg.peerDependencies[dependency]) {
pkg.peerDependencies[dependency] = version;
}
}
function isVersionGreater(oldVersion, newVersion) {

View File

@@ -1,3 +1,15 @@
## [4.11.1](https://github.com/ionic-team/ionic/compare/v4.11.0...v4.11.1) (2019-10-14)
### Bug Fixes
* **build:** properly update peer dependencies ([#19639](https://github.com/ionic-team/ionic/issues/19639)) ([b552daa](https://github.com/ionic-team/ionic/commit/b552daa))
* **react:** add IonPicker as controller component, fixes [#19620](https://github.com/ionic-team/ionic/issues/19620) ([#19643](https://github.com/ionic-team/ionic/issues/19643)) ([ed98d9e](https://github.com/ionic-team/ionic/commit/ed98d9e))
* **react:** handle tab back nav better, fixes [#19646](https://github.com/ionic-team/ionic/issues/19646) ([#19647](https://github.com/ionic-team/ionic/issues/19647)) ([8776556](https://github.com/ionic-team/ionic/commit/8776556))
* **react:** moving tslint and friends to devDependencies ([#19624](https://github.com/ionic-team/ionic/issues/19624)) ([7f4b77d](https://github.com/ionic-team/ionic/commit/7f4b77d))
# [4.11.0 Sodium](https://github.com/ionic-team/ionic/compare/v4.10.3...v4.11.0) (2019-10-09)
Ionic React! Enjoy! 🧂 🌊 🐼

View File

@@ -1,6 +1,6 @@
{
"name": "@ionic/angular",
"version": "4.11.0",
"version": "4.11.1",
"description": "Angular specific wrappers for @ionic/core",
"keywords": [
"ionic",
@@ -49,7 +49,7 @@
"css/"
],
"dependencies": {
"@ionic/core": "4.11.0",
"@ionic/core": "4.11.1",
"tslib": "^1.9.3"
},
"peerDependencies": {

View File

@@ -1,4 +1,4 @@
// @ts-check
// @ts-check
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts

View File

@@ -1,6 +1,6 @@
{
"name": "@ionic/core",
"version": "4.11.0",
"version": "4.11.1",
"description": "Base components for Ionic",
"keywords": [
"ionic",

View File

@@ -1,6 +1,6 @@
{
"name": "@ionic/docs",
"version": "4.11.0",
"version": "4.11.1",
"description": "Pre-packaged API documentation for the Ionic docs.",
"main": "core.json",
"types": "core.d.ts",

View File

@@ -1,6 +1,6 @@
{
"name": "@ionic/react-router",
"version": "4.11.0",
"version": "4.11.1",
"description": "React Router wrapper for @ionic/react",
"keywords": [
"ionic",
@@ -36,22 +36,19 @@
"dist/"
],
"dependencies": {
"tslib": "*",
"tslint": "^5.20.0",
"tslint-ionic-rules": "0.0.21",
"tslint-react": "^4.1.0"
"tslib": "*"
},
"peerDependencies": {
"@ionic/core": "^4.10.0",
"@ionic/react": "4.10.0-rc.3",
"@ionic/core": "4.11.1",
"@ionic/react": "4.11.1",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-router": "^5.0.1",
"react-router-dom": "^5.0.1"
},
"devDependencies": {
"@ionic/core": "4.11.0",
"@ionic/react": "4.11.0",
"@ionic/core": "4.11.1",
"@ionic/react": "4.11.1",
"@types/jest": "^23.3.9",
"@types/node": "12.6.9",
"@types/react": "^16.9.2",
@@ -70,6 +67,9 @@
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-sourcemaps": "^0.4.2",
"ts-jest": "^24.0.2",
"tslint": "^5.20.0",
"tslint-ionic-rules": "0.0.21",
"tslint-react": "^4.1.0",
"typescript": "3.5.3"
},
"jest": {

View File

@@ -33,7 +33,8 @@ export class NavManager extends React.Component<NavManagerProps, NavContextState
getStackManager: this.getStackManager.bind(this),
getPageManager: this.getPageManager.bind(this),
currentPath: this.props.location.pathname,
registerIonPage: () => { return; } // overridden in View for each IonPage
registerIonPage: () => { return; }, // overridden in View for each IonPage
tabNavigate: this.tabNavigate.bind(this)
};
this.listenUnregisterCallback = this.props.history.listen((location: HistoryLocation) => {
@@ -93,6 +94,10 @@ export class NavManager extends React.Component<NavManagerProps, NavContextState
this.props.history.push(path, { direction });
}
tabNavigate(url: string) {
this.props.history.replace(url, { direction: 'back' });
}
getPageManager() {
return (children: any) => children;
}

View File

@@ -1,6 +1,6 @@
{
"name": "@ionic/react",
"version": "4.11.0",
"version": "4.11.1",
"description": "React specific wrapper for @ionic/core",
"keywords": [
"ionic",
@@ -39,7 +39,7 @@
"css/"
],
"dependencies": {
"@ionic/core": "4.11.0",
"@ionic/core": "4.11.1",
"tslib": "*"
},
"peerDependencies": {

View File

@@ -0,0 +1,5 @@
import { PickerOptions, pickerController } from '@ionic/core';
import { createControllerComponent } from './createControllerComponent';
export const IonPicker = /*@__PURE__*/createControllerComponent<PickerOptions, HTMLIonPickerElement>('IonPicker', pickerController);

View File

@@ -10,7 +10,7 @@ describe('IonTabs', () => {
const { container } = render(
<IonTabs>
<IonRouterOutlet></IonRouterOutlet>
<IonTabBar slot="bottom" currentPath={'/'} navigate={() => {}}>
<IonTabBar slot="bottom" currentPath={'/'}>
<IonTabButton tab="schedule">
<IonLabel>Schedule</IonLabel>
<IonIcon name="schedule"></IonIcon>
@@ -44,7 +44,7 @@ describe('IonTabs', () => {
const { container } = render(
<IonTabs>
<IonRouterOutlet></IonRouterOutlet>
<IonTabBar slot="bottom" currentPath={'/'} navigate={() => {}}>
<IonTabBar slot="bottom" currentPath={'/'}>
{false &&
<IonTabButton tab="schedule">
<IonLabel>Schedule</IonLabel>

View File

@@ -9,6 +9,7 @@ export * from './proxies';
export { IonAlert } from './IonAlert';
export { IonLoading } from './IonLoading';
export { IonToast } from './IonToast';
export { IonPicker } from './IonPicker';
// createOverlayComponent
export { IonActionSheet } from './IonActionSheet';

View File

@@ -6,7 +6,6 @@ import { IonTabBarInner } from '../inner-proxies';
import { IonTabButton } from '../proxies';
type Props = LocalJSX.IonTabBar & {
navigate?: (path: string, direction: 'back' | 'none') => void;
currentPath?: string;
slot?: 'bottom' | 'top';
};
@@ -22,6 +21,7 @@ interface State {
}
const IonTabBarUnwrapped = /*@__PURE__*/(() => class extends React.Component<Props, State> {
context!: React.ContextType<typeof NavContext>;
constructor(props: Props) {
super(props);
@@ -67,13 +67,15 @@ const IonTabBarUnwrapped = /*@__PURE__*/(() => class extends React.Component<Pro
}
private onTabButtonClick = (e: CustomEvent<{ href: string, selected: boolean, tab: string }>) => {
const { navigate } = this.props;
if (navigate) {
if (this.state.activeTab === e.detail.tab) {
navigate(this.state.tabs[e.detail.tab].originalHref, 'back');
if (this.state.activeTab === e.detail.tab) {
const originalHref = this.state.tabs[e.detail.tab].originalHref;
if (this.context.hasIonicRouter()) {
this.context.tabNavigate(originalHref);
} else {
navigate(this.state.tabs[e.detail.tab].currentHref, 'none');
this.context.navigate(originalHref, 'back');
}
} else {
this.context.navigate(this.state.tabs[e.detail.tab].currentHref, 'none');
}
}
@@ -96,6 +98,10 @@ const IonTabBarUnwrapped = /*@__PURE__*/(() => class extends React.Component<Pro
</IonTabBarInner>
);
}
static get contextType() {
return NavContext;
}
})();
export const IonTabBar: React.FC<Props> = props => {
@@ -103,9 +109,6 @@ export const IonTabBar: React.FC<Props> = props => {
return (
<IonTabBarUnwrapped
{...props as any}
navigate={props.navigate || ((path: string, direction: 'back' | 'none') => {
context.navigate(path, direction);
})}
currentPath={props.currentPath || context.currentPath}
>
{props.children}

View File

@@ -50,7 +50,6 @@ export const IonMenu = /*@__PURE__*/createReactComponent<JSX.IonMenu, HTMLIonMen
export const IonMenuButton = /*@__PURE__*/createReactComponent<JSX.IonMenuButton, HTMLIonMenuButtonElement>('ion-menu-button');
export const IonMenuToggle = /*@__PURE__*/createReactComponent<JSX.IonMenuToggle, HTMLIonMenuToggleElement>('ion-menu-toggle');
export const IonNote = /*@__PURE__*/createReactComponent<JSX.IonNote, HTMLIonNoteElement>('ion-note');
export const IonPicker = /*@__PURE__*/createReactComponent<JSX.IonPicker, HTMLIonPickerElement>('ion-picker');
export const IonPickerColumn = /*@__PURE__*/createReactComponent<JSX.IonPickerColumn, HTMLIonPickerColumnElement>('ion-picker-column');
export const IonNav = /*@__PURE__*/createReactComponent<JSX.IonNav, HTMLIonNavElement>('ion-nav');
export const IonProgressBar = /*@__PURE__*/createReactComponent<JSX.IonProgressBar, HTMLIonProgressBarElement>('ion-progress-bar');

View File

@@ -10,6 +10,7 @@ export interface NavContextState {
navigate: (path: string, direction?: RouterDirection | 'none') => void;
hasIonicRouter: () => boolean;
registerIonPage: (page: HTMLElement) => void;
tabNavigate: (url: string) => void;
currentPath: string | undefined;
}
@@ -26,6 +27,7 @@ export const NavContext = /*@__PURE__*/React.createContext<NavContextState>({
}
},
navigate: (path: string) => { window.location.pathname = path; },
tabNavigate: () => undefined,
hasIonicRouter: () => false,
registerIonPage: () => undefined,
currentPath: undefined