Skip to content

Commit

Permalink
Convert new additions
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Feb 8, 2021
1 parent 620598f commit b3d1a12
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 32 deletions.
11 changes: 2 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/block-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
"lodash": "^4.17.19",
"memize": "^1.1.0",
"react-autosize-textarea": "^7.1.0",
"react-merge-refs": "^1.0.0",
"react-spring": "^8.0.19",
"redux-multi": "^0.1.12",
"rememo": "^3.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/block-editor/src/components/iframe/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* External dependencies
*/
import mergeRefs from 'react-merge-refs';
import { compact, map } from 'lodash';
import tinycolor from 'tinycolor2';

Expand All @@ -16,6 +15,7 @@ import {
forwardRef,
} from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { useMergeRefs } from '@wordpress/compose';

/**
* Internal dependencies
Expand Down Expand Up @@ -211,7 +211,7 @@ function Iframe( { contentRef, editorStyles, children, head, ...props }, ref ) {
return (
<iframe
{ ...props }
ref={ useCallback( mergeRefs( [ ref, setRef ] ), [] ) }
ref={ useMergeRefs( [ ref, setRef ] ) }
tabIndex="0"
title={ __( 'Editor canvas' ) }
name="editor-canvas"
Expand Down
1 change: 0 additions & 1 deletion packages/edit-post/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"classnames": "^2.2.5",
"lodash": "^4.17.19",
"memize": "^1.1.0",
"react-merge-refs": "^1.0.0",
"rememo": "^3.0.0"
},
"publishConfig": {
Expand Down
14 changes: 3 additions & 11 deletions packages/edit-post/src/components/visual-editor/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/**
* External dependencies
*/
import mergeRefs from 'react-merge-refs';

/**
* WordPress dependencies
*/
Expand All @@ -24,7 +19,8 @@ import {
__unstableUseEditorStyles as useEditorStyles,
} from '@wordpress/block-editor';
import { Popover } from '@wordpress/components';
import { useRef, useCallback } from '@wordpress/element';
import { useRef } from '@wordpress/element';
import { useMergeRefs } from '@wordpress/compose';

/**
* Internal dependencies
Expand Down Expand Up @@ -64,17 +60,13 @@ export default function VisualEditor( { styles } ) {
useTypingObserver( ref );
useCanvasClickRedirect( ref );
const editorStylesRef = useEditorStyles( styles );
const mergedRefs = useCallback( mergeRefs( [ ref, editorStylesRef ] ), [
ref,
editorStylesRef,
] );

return (
<div className="edit-post-visual-editor">
<VisualEditorGlobalKeyboardShortcuts />
<Popover.Slot name="block-toolbar" />
<div
ref={ mergedRefs }
ref={ useMergeRefs( [ ref, editorStylesRef ] ) }
className="editor-styles-wrapper"
style={ resizedCanvasStyles || desktopCanvasStyles }
>
Expand Down
4 changes: 2 additions & 2 deletions packages/interface/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"dependencies": {
"@babel/runtime": "^7.12.5",
"@wordpress/components": "file:../components",
"@wordpress/compose": "file:../compose",
"@wordpress/data": "file:../data",
"@wordpress/deprecated": "file:../deprecated",
"@wordpress/element": "file:../element",
Expand All @@ -38,8 +39,7 @@
"@wordpress/plugins": "file:../plugins",
"@wordpress/viewport": "file:../viewport",
"classnames": "^2.2.5",
"lodash": "^4.17.19",
"react-merge-refs": "^1.0.0"
"lodash": "^4.17.19"
},
"publishConfig": {
"access": "public"
Expand Down
9 changes: 3 additions & 6 deletions packages/interface/src/components/interface-skeleton/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
* External dependencies
*/
import classnames from 'classnames';
import mergeRefs from 'react-merge-refs';

/**
* WordPress dependencies
*/
import { forwardRef, useCallback, useEffect, useRef } from '@wordpress/element';
import { forwardRef, useEffect, useRef } from '@wordpress/element';
import { __unstableUseNavigateRegions as useNavigateRegions } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { useMergeRefs } from '@wordpress/compose';

function useHTMLClass( className ) {
useEffect( () => {
Expand Down Expand Up @@ -66,10 +66,7 @@ function InterfaceSkeleton(

return (
<div
ref={ useCallback( mergeRefs( [ ref, fallbackRef ] ), [
ref,
fallbackRef,
] ) }
ref={ useMergeRefs( [ ref, fallbackRef ] ) }
className={ classnames(
className,
'interface-interface-skeleton',
Expand Down

0 comments on commit b3d1a12

Please sign in to comment.