From 39a8faa61ed06bac11c62049e3393c3aaf47a7b5 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 8 Apr 2020 09:59:47 +0200 Subject: [PATCH 1/3] [Popper] Fix links to popper.js --- packages/material-ui/src/Popper/Popper.d.ts | 2 +- packages/material-ui/src/Popper/Popper.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/material-ui/src/Popper/Popper.d.ts b/packages/material-ui/src/Popper/Popper.d.ts index 9161a861b12fd1..875c12ccb040dc 100644 --- a/packages/material-ui/src/Popper/Popper.d.ts +++ b/packages/material-ui/src/Popper/Popper.d.ts @@ -41,7 +41,7 @@ export interface PopperProps extends React.HTMLAttributes { } /** - * Poppers rely on the 3rd party library [Popper.js](https://github.com/FezVrasta/popper.js) for positioning. + * Poppers rely on the 3rd party library [Popper.js](https://popper.js.org/docs/v1/) for positioning. * Demos: * * - [Autocomplete](https://material-ui.com/components/autocomplete/) diff --git a/packages/material-ui/src/Popper/Popper.js b/packages/material-ui/src/Popper/Popper.js index 1c492a2ce08cd9..894332c74c767d 100644 --- a/packages/material-ui/src/Popper/Popper.js +++ b/packages/material-ui/src/Popper/Popper.js @@ -39,7 +39,7 @@ const useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect const defaultPopperOptions = {}; /** - * Poppers rely on the 3rd party library [Popper.js](https://github.com/FezVrasta/popper.js) for positioning. + * Poppers rely on the 3rd party library [Popper.js](https://popper.js.org/docs/v1/) for positioning. */ const Popper = React.forwardRef(function Popper(props, ref) { const { @@ -233,7 +233,7 @@ Popper.propTypes = { * instance. * * The reference element should be an HTML Element instance or a referenceObject: - * https://popper.js.org/popper-documentation.html#referenceObject. + * https://popper.js.org/docs/v1/#referenceObject. */ anchorEl: chainPropTypes(PropTypes.oneOfType([PropTypes.object, PropTypes.func]), (props) => { if (props.open) { @@ -268,7 +268,7 @@ Popper.propTypes = { [ 'Material-UI: the `anchorEl` prop provided to the component is invalid.', 'It should be an HTML Element instance or a referenceObject:', - 'https://popper.js.org/popper-documentation.html#referenceObject.', + 'https://popper.js.org/docs/v1/#referenceObject.', ].join('\n'), ); } @@ -305,7 +305,7 @@ Popper.propTypes = { * A modifier is a function that is called each time Popper.js needs to * compute the position of the popper. * For this reason, modifiers should be very performant to avoid bottlenecks. - * To learn how to create a modifier, [read the modifiers documentation](https://github.com/FezVrasta/popper.js/blob/master/docs/_includes/popper-documentation.md#modifiers--object). + * To learn how to create a modifier, [read the modifiers documentation](https://popper.js.org/docs/v1/#modifiers). */ modifiers: PropTypes.object, /** @@ -330,7 +330,7 @@ Popper.propTypes = { 'top', ]), /** - * Options provided to the [`popper.js`](https://github.com/FezVrasta/popper.js) instance. + * Options provided to the [`popper.js`](https://popper.js.org/docs/v1/) instance. */ popperOptions: PropTypes.object, /** From 562368063ad666d83b6ccd0549c5112837cc7e22 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 8 Apr 2020 10:03:00 +0200 Subject: [PATCH 2/3] yarn docs:api --- docs/pages/api-docs/popper.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/pages/api-docs/popper.md b/docs/pages/api-docs/popper.md index 3215bfb8683845..f5f1b606e839fe 100644 --- a/docs/pages/api-docs/popper.md +++ b/docs/pages/api-docs/popper.md @@ -18,7 +18,7 @@ import { Popper } from '@material-ui/core'; You can learn more about the difference by [reading this guide](/guides/minimizing-bundle-size/). -Poppers rely on the 3rd party library [Popper.js](https://github.com/FezVrasta/popper.js) for positioning. +Poppers rely on the 3rd party library [Popper.js](https://popper.js.org/docs/v1/) for positioning. @@ -26,15 +26,15 @@ Poppers rely on the 3rd party library [Popper.js](https://github.com/FezVrasta/p | Name | Type | Default | Description | |:-----|:-----|:--------|:------------| -| anchorEl | object
| func
| | This is the reference element, or a function that returns the reference element, that may be used to set the position of the popover. The return value will passed as the reference object of the Popper instance.
The reference element should be an HTML Element instance or a referenceObject: https://popper.js.org/popper-documentation.html#referenceObject. | +| anchorEl | object
| func
| | This is the reference element, or a function that returns the reference element, that may be used to set the position of the popover. The return value will passed as the reference object of the Popper instance.
The reference element should be an HTML Element instance or a referenceObject: https://popper.js.org/docs/v1/#referenceObject. | | children * | node
| func
| | Popper render function or node. | | container | object
| func
| | A node, component instance, or function that returns either. The `container` will passed to the Modal component. By default, it uses the body of the anchorEl's top-level document object, so it's simply `document.body` most of the time. | | disablePortal | bool | false | Disable the portal behavior. The children stay within it's parent DOM hierarchy. | | keepMounted | bool | false | Always keep the children in the DOM. This prop can be useful in SEO situation or when you want to maximize the responsiveness of the Popper. | -| modifiers | object | | Popper.js is based on a "plugin-like" architecture, most of its features are fully encapsulated "modifiers".
A modifier is a function that is called each time Popper.js needs to compute the position of the popper. For this reason, modifiers should be very performant to avoid bottlenecks. To learn how to create a modifier, [read the modifiers documentation](https://github.com/FezVrasta/popper.js/blob/master/docs/_includes/popper-documentation.md#modifiers--object). | +| modifiers | object | | Popper.js is based on a "plugin-like" architecture, most of its features are fully encapsulated "modifiers".
A modifier is a function that is called each time Popper.js needs to compute the position of the popper. For this reason, modifiers should be very performant to avoid bottlenecks. To learn how to create a modifier, [read the modifiers documentation](https://popper.js.org/docs/v1/#modifiers). | | open * | bool | | If `true`, the popper is visible. | | placement | 'bottom-end'
| 'bottom-start'
| 'bottom'
| 'left-end'
| 'left-start'
| 'left'
| 'right-end'
| 'right-start'
| 'right'
| 'top-end'
| 'top-start'
| 'top'
| 'bottom' | Popper placement. | -| popperOptions | object | {} | Options provided to the [`popper.js`](https://github.com/FezVrasta/popper.js) instance. | +| popperOptions | object | {} | Options provided to the [`popper.js`](https://popper.js.org/docs/v1/) instance. | | popperRef | ref | | A ref that points to the used popper instance. | | transition | bool | false | Help supporting a react-transition-group/Transition component. | From dec99a675f8798f9ed736fbfda25c7b0a924b412 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 8 Apr 2020 10:18:11 +0200 Subject: [PATCH 3/3] fix: Unambigious links trailing "." causes some UIs to include the "." in the url (e..g github) --- docs/pages/api-docs/popper.md | 2 +- packages/material-ui/src/Popper/Popper.js | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/pages/api-docs/popper.md b/docs/pages/api-docs/popper.md index f5f1b606e839fe..e783feba0ab9fe 100644 --- a/docs/pages/api-docs/popper.md +++ b/docs/pages/api-docs/popper.md @@ -26,7 +26,7 @@ Poppers rely on the 3rd party library [Popper.js](https://popper.js.org/docs/v1/ | Name | Type | Default | Description | |:-----|:-----|:--------|:------------| -| anchorEl | object
| func
| | This is the reference element, or a function that returns the reference element, that may be used to set the position of the popover. The return value will passed as the reference object of the Popper instance.
The reference element should be an HTML Element instance or a referenceObject: https://popper.js.org/docs/v1/#referenceObject. | +| anchorEl | object
| func
| | This is the reference element, or a function that returns the reference element, that may be used to set the position of the popover. The return value will passed as the reference object of the Popper instance.
The reference element should be an HTML Element instance or a [referenceObject](https://popper.js.org/docs/v1/#referenceObject). | | children * | node
| func
| | Popper render function or node. | | container | object
| func
| | A node, component instance, or function that returns either. The `container` will passed to the Modal component. By default, it uses the body of the anchorEl's top-level document object, so it's simply `document.body` most of the time. | | disablePortal | bool | false | Disable the portal behavior. The children stay within it's parent DOM hierarchy. | diff --git a/packages/material-ui/src/Popper/Popper.js b/packages/material-ui/src/Popper/Popper.js index 894332c74c767d..a123c0b61f196a 100644 --- a/packages/material-ui/src/Popper/Popper.js +++ b/packages/material-ui/src/Popper/Popper.js @@ -232,8 +232,7 @@ Popper.propTypes = { * The return value will passed as the reference object of the Popper * instance. * - * The reference element should be an HTML Element instance or a referenceObject: - * https://popper.js.org/docs/v1/#referenceObject. + * The reference element should be an HTML Element instance or a [referenceObject](https://popper.js.org/docs/v1/#referenceObject). */ anchorEl: chainPropTypes(PropTypes.oneOfType([PropTypes.object, PropTypes.func]), (props) => { if (props.open) { @@ -267,8 +266,8 @@ Popper.propTypes = { return new Error( [ 'Material-UI: the `anchorEl` prop provided to the component is invalid.', - 'It should be an HTML Element instance or a referenceObject:', - 'https://popper.js.org/docs/v1/#referenceObject.', + 'It should be an HTML Element instance or a referenceObject ', + '(https://popper.js.org/docs/v1/#referenceObject).', ].join('\n'), ); }