deps: drop @atlaskit/layer-manager dependency

We no longer need it since Rect 16 takes care of passing the context around.
It's also deprecated: https://atlaskit.atlassian.com/packages/core/layer-manager
This commit is contained in:
Saúl Ibarra Corretgé 2019-01-04 10:49:04 +01:00
parent ce01b31514
commit 8ac701ab74
3 changed files with 10 additions and 46 deletions

12
package-lock.json generated
View File

@ -691,18 +691,6 @@
"react-scrolllock": "^3.0.2" "react-scrolllock": "^3.0.2"
} }
}, },
"@atlaskit/layer-manager": {
"version": "5.0.19",
"resolved": "https://registry.npmjs.org/@atlaskit/layer-manager/-/layer-manager-5.0.19.tgz",
"integrity": "sha512-2NvSNEERS9uW/oExF7ltj/h8akJvJRJnhEleKGx1JXqnbCUwQHtGkiP+06cX9JriGnhPEySt26dfQS5dAA0sKg==",
"requires": {
"@babel/runtime": "^7.0.0",
"prop-types": "^15.5.10",
"react-focus-lock": "^1.11.3",
"react-scrolllock": "^3.0.2",
"react-transition-group": "^2.2.1"
}
},
"@atlaskit/lozenge": { "@atlaskit/lozenge": {
"version": "6.2.4", "version": "6.2.4",
"resolved": "https://registry.npmjs.org/@atlaskit/lozenge/-/lozenge-6.2.4.tgz", "resolved": "https://registry.npmjs.org/@atlaskit/lozenge/-/lozenge-6.2.4.tgz",

View File

@ -25,7 +25,6 @@
"@atlaskit/icon": "15.0.3", "@atlaskit/icon": "15.0.3",
"@atlaskit/inline-dialog": "5.3.0", "@atlaskit/inline-dialog": "5.3.0",
"@atlaskit/inline-message": "7.0.10", "@atlaskit/inline-message": "7.0.10",
"@atlaskit/layer-manager": "5.0.19",
"@atlaskit/lozenge": "6.2.4", "@atlaskit/lozenge": "6.2.4",
"@atlaskit/modal-dialog": "7.1.2", "@atlaskit/modal-dialog": "7.1.2",
"@atlaskit/multi-select": "11.0.13", "@atlaskit/multi-select": "11.0.13",

View File

@ -1,7 +1,6 @@
// @flow // @flow
import Button, { ButtonGroup } from '@atlaskit/button'; import Button, { ButtonGroup } from '@atlaskit/button';
import { withContextFromProps } from '@atlaskit/layer-manager';
import Modal, { ModalFooter } from '@atlaskit/modal-dialog'; import Modal, { ModalFooter } from '@atlaskit/modal-dialog';
import _ from 'lodash'; import _ from 'lodash';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
@ -71,17 +70,6 @@ type Props = {
width: string width: string
}; };
/**
* ContexTypes is used as a workaround for Atlaskit's modal being displayed
* outside of the normal App hierarchy, thereby losing context. ContextType
* is responsible for taking its props and passing them into children.
*
* @type {ReactElement}
*/
const ContextProvider = withContextFromProps({
i18n: PropTypes.object
});
/** /**
* Web dialog that uses atlaskit modal-dialog to display dialogs. * Web dialog that uses atlaskit modal-dialog to display dialogs.
*/ */
@ -136,27 +124,16 @@ class StatelessDialog extends Component<Props> {
onDialogDismissed = { this._onDialogDismissed } onDialogDismissed = { this._onDialogDismissed }
shouldCloseOnEscapePress = { true } shouldCloseOnEscapePress = { true }
width = { width || 'medium' }> width = { width || 'medium' }>
{ <div
onKeyDown = { this._onKeyDown }
/** ref = { this._setDialogElement }>
* Wrapping the contents of {@link Modal} with <form
* {@link ContextProvider} is a workaround for the className = 'modal-dialog-form'
* i18n context becoming undefined as modal gets rendered id = 'modal-dialog-form'
* outside of the normal react app context. onSubmit = { this._onSubmit }>
*/ { children }
} </form>
<ContextProvider i18n = { this.props.i18n }> </div>
<div
onKeyDown = { this._onKeyDown }
ref = { this._setDialogElement }>
<form
className = 'modal-dialog-form'
id = 'modal-dialog-form'
onSubmit = { this._onSubmit }>
{ children }
</form>
</div>
</ContextProvider>
</Modal> </Modal>
); );
} }