Skip to content

Commit bf87dd2

Browse files
chore: update Ref dependency to latest version (#4023)
* chore(MountNode|Sidebar): update Ref dependency to latest version The @stardust-ui/{react-component-event-listener, react-component-ref} components have been moved to @fluentui/{react-component-event-listener, react-component-ref}. Change dependency so that the new packages are used, and upgrade to their latest versions. One wrinkle: `toRefObject()` was removed from `react-component-ref` (see microsoft/fluent-ui-react#2287). I've rewritten the code that depended on this function. * fix import * Update package.json * fix yarn.lock Co-authored-by: Oleksandr Fediashov <[email protected]>
1 parent 4dba2f1 commit bf87dd2

File tree

22 files changed

+44
-46
lines changed

22 files changed

+44
-46
lines changed

Diff for: index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Third party
22

3-
export { Ref, RefProps } from '@stardust-ui/react-component-ref'
3+
export { Ref, RefProps } from '@fluentui/react-component-ref'
44

55
// Addons
66

Diff for: package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@
6868
"homepage": "https://github.com/Semantic-Org/Semantic-UI-React#readme",
6969
"dependencies": {
7070
"@babel/runtime": "^7.10.5",
71+
"@fluentui/react-component-event-listener": "~0.51.0",
72+
"@fluentui/react-component-ref": "~0.51.0",
7173
"@semantic-ui-react/event-stack": "^3.1.0",
72-
"@stardust-ui/react-component-event-listener": "~0.38.0",
73-
"@stardust-ui/react-component-ref": "~0.38.0",
7474
"clsx": "^1.1.1",
7575
"keyboard-key": "^1.1.0",
7676
"lodash": "^4.17.19",

Diff for: src/addons/Portal/Portal.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import EventStack from '@semantic-ui-react/event-stack'
2-
import { handleRef, Ref } from '@stardust-ui/react-component-ref'
2+
import { handleRef, Ref } from '@fluentui/react-component-ref'
33
import keyboardKey from 'keyboard-key'
44
import _ from 'lodash'
55
import PropTypes from 'prop-types'

Diff for: src/addons/Portal/PortalInner.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { handleRef, Ref } from '@stardust-ui/react-component-ref'
1+
import { handleRef, Ref } from '@fluentui/react-component-ref'
22
import _ from 'lodash'
33
import PropTypes from 'prop-types'
44
import React, { Component } from 'react'

Diff for: src/addons/TextArea/TextArea.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Ref } from '@stardust-ui/react-component-ref'
1+
import { Ref } from '@fluentui/react-component-ref'
22
import _ from 'lodash'
33
import PropTypes from 'prop-types'
44
import React, { Component, createRef } from 'react'

Diff for: src/behaviors/Visibility/Visibility.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Ref } from '@stardust-ui/react-component-ref'
1+
import { Ref } from '@fluentui/react-component-ref'
22
import _ from 'lodash'
33
import PropTypes from 'prop-types'
44
import React, { Component, createRef } from 'react'

Diff for: src/elements/Button/Button.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Ref } from '@stardust-ui/react-component-ref'
1+
import { Ref } from '@fluentui/react-component-ref'
22
import cx from 'clsx'
33
import _ from 'lodash'
44
import PropTypes from 'prop-types'

Diff for: src/elements/Input/Input.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { handleRef } from '@stardust-ui/react-component-ref'
1+
import { handleRef } from '@fluentui/react-component-ref'
22
import cx from 'clsx'
33
import _ from 'lodash'
44
import PropTypes from 'prop-types'

Diff for: src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Third party
2-
export { Ref } from '@stardust-ui/react-component-ref'
2+
export { Ref } from '@fluentui/react-component-ref'
33

44
// Addons
55
export Confirm from './addons/Confirm'

Diff for: src/lib/hooks/useClassNamesOnNode.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { isRefObject } from '@fluentui/react-component-ref'
12
import React from 'react'
2-
import { isRefObject } from '@stardust-ui/react-component-ref'
33

44
import useIsomorphicLayoutEffect from './useIsomorphicLayoutEffect'
55

Diff for: src/modules/Checkbox/Checkbox.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Ref } from '@stardust-ui/react-component-ref'
1+
import { Ref } from '@fluentui/react-component-ref'
22
import cx from 'clsx'
33
import _ from 'lodash'
44
import PropTypes from 'prop-types'

Diff for: src/modules/Dimmer/DimmerInner.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Ref } from '@stardust-ui/react-component-ref'
1+
import { Ref } from '@fluentui/react-component-ref'
22
import cx from 'clsx'
33
import _ from 'lodash'
44
import PropTypes from 'prop-types'

Diff for: src/modules/Dropdown/Dropdown.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import EventStack from '@semantic-ui-react/event-stack'
2-
import { Ref } from '@stardust-ui/react-component-ref'
2+
import { Ref } from '@fluentui/react-component-ref'
33
import cx from 'clsx'
44
import keyboardKey from 'keyboard-key'
55
import _ from 'lodash'

Diff for: src/modules/Modal/Modal.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Ref } from '@stardust-ui/react-component-ref'
1+
import { Ref } from '@fluentui/react-component-ref'
22
import cx from 'clsx'
33
import _ from 'lodash'
44
import PropTypes from 'prop-types'

Diff for: src/modules/Modal/ModalDimmer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Ref } from '@stardust-ui/react-component-ref'
1+
import { Ref } from '@fluentui/react-component-ref'
22
import cx from 'clsx'
33
import PropTypes from 'prop-types'
44
import React from 'react'

Diff for: src/modules/Popup/Popup.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import EventStack from '@semantic-ui-react/event-stack'
2-
import { Ref } from '@stardust-ui/react-component-ref'
2+
import { Ref } from '@fluentui/react-component-ref'
33
import cx from 'clsx'
44
import _ from 'lodash'
55
import PropTypes from 'prop-types'

Diff for: src/modules/Popup/lib/createReferenceProxy.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { isRefObject, toRefObject } from '@stardust-ui/react-component-ref'
1+
import { isRefObject, toRefObject } from '@fluentui/react-component-ref'
22
import _ from 'lodash'
33

44
class ReferenceProxy {

Diff for: src/modules/Sidebar/Sidebar.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { EventListener, documentRef } from '@stardust-ui/react-component-event-listener'
2-
import { isRefObject, toRefObject, Ref } from '@stardust-ui/react-component-ref'
1+
import { EventListener, documentRef } from '@fluentui/react-component-event-listener'
2+
import { Ref, isRefObject } from '@fluentui/react-component-ref'
33
import cx from 'clsx'
44
import _ from 'lodash'
55
import PropTypes from 'prop-types'
@@ -106,14 +106,14 @@ class Sidebar extends Component {
106106
)
107107
const rest = getUnhandledProps(Sidebar, this.props)
108108
const ElementType = getElementType(Sidebar, this.props)
109-
const targetRef = isRefObject(target) ? target : toRefObject(target)
109+
const targetProp = isRefObject(target) ? { targetRef: target } : { target }
110110

111111
return (
112112
<Ref innerRef={this.ref}>
113113
<ElementType {...rest} className={classes}>
114114
{childrenUtils.isNil(children) ? content : children}
115115
{visible && (
116-
<EventListener listener={this.handleDocumentClick} targetRef={targetRef} type='click' />
116+
<EventListener listener={this.handleDocumentClick} type='click' {...targetProp} />
117117
)}
118118
</ElementType>
119119
</Ref>

Diff for: src/modules/Sticky/Sticky.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { isRefObject } from '@stardust-ui/react-component-ref'
1+
import { isRefObject } from '@fluentui/react-component-ref'
22
import cx from 'clsx'
33
import _ from 'lodash'
44
import PropTypes from 'prop-types'

Diff for: test/specs/modules/Sidebar/Sidebar-test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ describe('Sidebar', () => {
137137
const wrapper = shallow(<Sidebar target={target} visible />)
138138
const listener = wrapper.find('EventListener')
139139

140-
listener.should.have.prop('targetRef').that.eql({ current: target })
140+
listener.should.have.prop('target').that.eql(target)
141141
})
142142
})
143143
})

Diff for: test/utils/nestedShallow.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Ref } from '@stardust-ui/react-component-ref'
1+
import { Ref } from '@fluentui/react-component-ref'
22
import enzyme from 'enzyme'
33
import _ from 'lodash'
44

Diff for: yarn.lock

+19-21
Original file line numberDiff line numberDiff line change
@@ -969,10 +969,10 @@
969969
core-js-pure "^3.0.0"
970970
regenerator-runtime "^0.13.4"
971971

972-
"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.10.5", "@babel/runtime@^7.4.5", "@babel/runtime@^7.8.4":
973-
version "7.10.5"
974-
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.10.5.tgz#303d8bd440ecd5a491eae6117fd3367698674c5c"
975-
integrity sha512-otddXKhdNn7d0ptoFRHtMLa8LqDxLYwTjB4nYgM1yy5N6gU/MUf8zqyyLltCH3yAVitBzmwK4us+DD0l/MauAg==
972+
"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.10.4", "@babel/runtime@^7.10.5", "@babel/runtime@^7.4.5", "@babel/runtime@^7.8.4":
973+
version "7.11.2"
974+
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.11.2.tgz#f549c13c754cc40b87644b9fa9f09a6a95fe0736"
975+
integrity sha512-TeWkU52so0mPtDcaCTxNBI/IHiz0pZgr8VEFqXFtZWpYD08ZB6FaSwVAS8MKRQAP3bYKiVjwysOJgMFY28o6Tw==
976976
dependencies:
977977
regenerator-runtime "^0.13.4"
978978

@@ -1049,6 +1049,21 @@
10491049
lodash "^4.17.19"
10501050
to-fast-properties "^2.0.0"
10511051

1052+
"@fluentui/react-component-event-listener@~0.51.0":
1053+
version "0.51.0"
1054+
resolved "https://registry.yarnpkg.com/@fluentui/react-component-event-listener/-/react-component-event-listener-0.51.0.tgz#29701f875a37870e168b99b0198d3518866a7f84"
1055+
integrity sha512-YzvtrqSOQIr19V5hLQ71Zt2HnBpHsPbgE6YNRI0fYkld1YbZWggiPSpk6nhmjB5U30h3EqwZzvsuQTvHbuP2Iw==
1056+
dependencies:
1057+
"@babel/runtime" "^7.10.4"
1058+
1059+
"@fluentui/react-component-ref@~0.51.0":
1060+
version "0.51.0"
1061+
resolved "https://registry.yarnpkg.com/@fluentui/react-component-ref/-/react-component-ref-0.51.0.tgz#e27e50e36a7d96586bc814c16bd84f9da53b3029"
1062+
integrity sha512-eYTiZCGmcsU1RuKeHepd8i6XksnroSF5b2lqHJaQO9x+Ec62d7+M2i9FW/nhe2Mpb5f96inL0Oz3zzVMrSwJdw==
1063+
dependencies:
1064+
"@babel/runtime" "^7.10.4"
1065+
react-is "^16.6.3"
1066+
10521067
"@istanbuljs/load-nyc-config@^1.0.0":
10531068
version "1.1.0"
10541069
resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced"
@@ -1176,23 +1191,6 @@
11761191
dependencies:
11771192
semver "7.3.2"
11781193

1179-
"@stardust-ui/react-component-event-listener@~0.38.0":
1180-
version "0.38.0"
1181-
resolved "https://registry.yarnpkg.com/@stardust-ui/react-component-event-listener/-/react-component-event-listener-0.38.0.tgz#1787faded94b40ad41226e6289baf13e701c6e7f"
1182-
integrity sha512-sIP/e0dyOrrlb8K7KWumfMxj/gAifswTBC4o68Aa+C/GA73ccRp/6W1VlHvF/dlOR4KLsA+5SKnhjH36xzPsWg==
1183-
dependencies:
1184-
"@babel/runtime" "^7.1.2"
1185-
prop-types "^15.7.2"
1186-
1187-
"@stardust-ui/react-component-ref@~0.38.0":
1188-
version "0.38.0"
1189-
resolved "https://registry.yarnpkg.com/@stardust-ui/react-component-ref/-/react-component-ref-0.38.0.tgz#52d555f2d5edd213c923c93a106f7de940e427ef"
1190-
integrity sha512-xjs6WnvJVueSIXMWw0C3oWIgAPpcD03qw43oGOjUXqFktvpNkB73JoKIhS4sCrtQxBdct75qqr4ZL6JiyPcESw==
1191-
dependencies:
1192-
"@babel/runtime" "^7.1.2"
1193-
prop-types "^15.7.2"
1194-
react-is "^16.6.3"
1195-
11961194
"@textlint/ast-node-types@^4.0.3":
11971195
version "4.2.1"
11981196
resolved "https://registry.yarnpkg.com/@textlint/ast-node-types/-/ast-node-types-4.2.1.tgz#978fa10e23468114462fc08ef29f96980c12a8ef"

0 commit comments

Comments
 (0)