Skip to content

Commit

Permalink
Rename experimental react-ui => react-interactions (#16842)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Sep 20, 2019
1 parent 57a5805 commit cef47cb
Show file tree
Hide file tree
Showing 81 changed files with 139 additions and 131 deletions.
@@ -1,4 +1,4 @@
# `react-ui`
# `react-interactions`

This package is experimental. It is intended for use with the experimental React
flags for internal testing.
Expand Up @@ -8,11 +8,11 @@
*/

import type {ReactScopeMethods} from 'shared/ReactTypes';
import type {KeyboardEvent} from 'react-ui/events/keyboard';
import type {KeyboardEvent} from 'react-interactions/events/keyboard';

import React from 'react';
import {tabFocusableImpl} from 'react-ui/accessibility/tabbable-scope';
import {useKeyboard} from 'react-ui/events/keyboard';
import {tabFocusableImpl} from 'react-interactions/accessibility/tabbable-scope';
import {useKeyboard} from 'react-interactions/events/keyboard';

type FocusCellProps = {
children?: React.Node,
Expand Down
Expand Up @@ -8,11 +8,11 @@
*/

import type {ReactScopeMethods} from 'shared/ReactTypes';
import type {KeyboardEvent} from 'react-ui/events/keyboard';
import type {KeyboardEvent} from 'react-interactions/events/keyboard';

import React from 'react';
import {TabbableScope} from 'react-ui/accessibility/tabbable-scope';
import {useKeyboard} from 'react-ui/events/keyboard';
import {TabbableScope} from 'react-interactions/accessibility/tabbable-scope';
import {useKeyboard} from 'react-interactions/events/keyboard';

type TabFocusControllerProps = {
children: React.Node,
Expand Down
Expand Up @@ -7,7 +7,7 @@
* @flow
*/

import {createEventTarget} from 'react-ui/events/src/dom/testing-library';
import {createEventTarget} from 'react-interactions/events/src/dom/testing-library';

let React;
let ReactFeatureFlags;
Expand Down
Expand Up @@ -7,7 +7,7 @@
* @flow
*/

import {createEventTarget} from 'react-ui/events/src/dom/testing-library';
import {createEventTarget} from 'react-interactions/events/src/dom/testing-library';

let React;
let ReactFeatureFlags;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -10,8 +10,8 @@
import type {PointerType} from 'shared/ReactDOMTypes';

import React from 'react';
import {useTap} from 'react-ui/events/tap';
import {useKeyboard} from 'react-ui/events/keyboard';
import {useTap} from 'react-interactions/events/tap';
import {useKeyboard} from 'react-interactions/events/keyboard';

const emptyObject = {};

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -28,7 +28,8 @@ function initializeModules(hasPointerEvents) {
ReactFeatureFlags.enableFlareAPI = true;
React = require('react');
ReactDOM = require('react-dom');
useContextMenu = require('react-ui/events/context-menu').useContextMenu;
useContextMenu = require('react-interactions/events/context-menu')
.useContextMenu;
}

const forcePointerEvents = true;
Expand Down
Expand Up @@ -23,7 +23,7 @@ describe('Drag event responder', () => {
ReactFeatureFlags.enableFlareAPI = true;
React = require('react');
ReactDOM = require('react-dom');
useDrag = require('react-ui/events/drag').useDrag;
useDrag = require('react-interactions/events/drag').useDrag;

container = document.createElement('div');
document.body.appendChild(container);
Expand Down
Expand Up @@ -24,8 +24,8 @@ function initializeModules(hasPointerEvents) {
ReactFeatureFlags.enableFlareAPI = true;
React = require('react');
ReactDOM = require('react-dom');
FocusResponder = require('react-ui/events/focus').FocusResponder;
useFocus = require('react-ui/events/focus').useFocus;
FocusResponder = require('react-interactions/events/focus').FocusResponder;
useFocus = require('react-interactions/events/focus').useFocus;
}

const forcePointerEvents = true;
Expand Down
Expand Up @@ -24,8 +24,9 @@ const initializeModules = hasPointerEvents => {
ReactFeatureFlags.enableFlareAPI = true;
React = require('react');
ReactDOM = require('react-dom');
FocusWithinResponder = require('react-ui/events/focus').FocusWithinResponder;
useFocusWithin = require('react-ui/events/focus').useFocusWithin;
FocusWithinResponder = require('react-interactions/events/focus')
.FocusWithinResponder;
useFocusWithin = require('react-interactions/events/focus').useFocusWithin;
};

const forcePointerEvents = true;
Expand Down
Expand Up @@ -25,8 +25,8 @@ function initializeModules(hasPointerEvents) {
ReactFeatureFlags.enableUserBlockingEvents = true;
React = require('react');
ReactDOM = require('react-dom');
HoverResponder = require('react-ui/events/hover').HoverResponder;
useHover = require('react-ui/events/hover').useHover;
HoverResponder = require('react-interactions/events/hover').HoverResponder;
useHover = require('react-interactions/events/hover').useHover;
}

const forcePointerEvents = true;
Expand Down
Expand Up @@ -39,8 +39,8 @@ const modulesInit = () => {
React = require('react');
ReactDOM = require('react-dom');
Scheduler = require('scheduler');
InputResponder = require('react-ui/events/input').InputResponder;
useInput = require('react-ui/events/input').useInput;
InputResponder = require('react-interactions/events/input').InputResponder;
useInput = require('react-interactions/events/input').useInput;
};

describe('Input event responder', () => {
Expand Down
Expand Up @@ -22,7 +22,7 @@ function initializeModules(hasPointerEvents) {
ReactFeatureFlags.enableFlareAPI = true;
React = require('react');
ReactDOM = require('react-dom');
useKeyboard = require('react-ui/events/keyboard').useKeyboard;
useKeyboard = require('react-interactions/events/keyboard').useKeyboard;
}

describe('Keyboard responder', () => {
Expand Down
Expand Up @@ -35,7 +35,7 @@ describe('mixing responders with the heritage event system', () => {
});

it('should properly only flush sync once when the event systems are mixed', () => {
const useTap = require('react-ui/events/tap').useTap;
const useTap = require('react-interactions/events/tap').useTap;
const ref = React.createRef();
let renderCounts = 0;

Expand Down Expand Up @@ -104,7 +104,7 @@ describe('mixing responders with the heritage event system', () => {
});

it('should properly flush sync when the event systems are mixed with unstable_flushDiscreteUpdates', () => {
const useTap = require('react-ui/events/tap').useTap;
const useTap = require('react-interactions/events/tap').useTap;
const ref = React.createRef();
let renderCounts = 0;

Expand Down Expand Up @@ -177,7 +177,7 @@ describe('mixing responders with the heritage event system', () => {
'event systems',
async () => {
const {useState} = React;
const useTap = require('react-ui/events/tap').useTap;
const useTap = require('react-interactions/events/tap').useTap;

const button = React.createRef();

Expand Down Expand Up @@ -237,8 +237,8 @@ describe('mixing responders with the heritage event system', () => {
it('is async for non-input events', () => {
ReactFeatureFlags.debugRenderPhaseSideEffectsForStrictMode = false;
ReactFeatureFlags.enableUserBlockingEvents = true;
const useTap = require('react-ui/events/tap').useTap;
const useInput = require('react-ui/events/input').useInput;
const useTap = require('react-interactions/events/tap').useTap;
const useInput = require('react-interactions/events/input').useInput;
const root = ReactDOM.unstable_createRoot(container);
let input;

Expand Down
Expand Up @@ -28,7 +28,7 @@ function initializeModules(hasPointerEvents) {
ReactFeatureFlags.enableFlareAPI = true;
React = require('react');
ReactDOM = require('react-dom');
usePress = require('react-ui/events/press').usePress;
usePress = require('react-interactions/events/press').usePress;
}

const pointerTypesTable = [['mouse'], ['touch']];
Expand Down
Expand Up @@ -28,8 +28,9 @@ function initializeModules(hasPointerEvents) {
ReactFeatureFlags.enableFlareAPI = true;
React = require('react');
ReactDOM = require('react-dom');
PressResponder = require('react-ui/events/press-legacy').PressResponder;
usePress = require('react-ui/events/press-legacy').usePress;
PressResponder = require('react-interactions/events/press-legacy')
.PressResponder;
usePress = require('react-interactions/events/press-legacy').usePress;
}

function removePressMoveStrings(eventString) {
Expand Down
Expand Up @@ -26,7 +26,7 @@ const initializeModules = hasPointerEvents => {
ReactFeatureFlags.enableFlareAPI = true;
React = require('react');
ReactDOM = require('react-dom');
useScroll = require('react-ui/events/scroll').useScroll;
useScroll = require('react-interactions/events/scroll').useScroll;
};

describe.each(table)('Scroll responder', hasPointerEvents => {
Expand Down
Expand Up @@ -29,7 +29,7 @@ function initializeModules(hasPointerEvents) {
ReactFeatureFlags.enableFlareAPI = true;
React = require('react');
ReactDOM = require('react-dom');
useTap = require('react-ui/events/tap').useTap;
useTap = require('react-interactions/events/tap').useTap;
}

const coordinatesInside = {x: 51, y: 51};
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions packages/react-interactions/npm/drag.js
@@ -0,0 +1,7 @@
'use strict';

if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-interactions-events/drag.production.min.js');
} else {
module.exports = require('./cjs/react-interactions-events/drag.development.js');
}
7 changes: 7 additions & 0 deletions packages/react-interactions/npm/focus.js
@@ -0,0 +1,7 @@
'use strict';

if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-interactions-events/focus.production.min.js');
} else {
module.exports = require('./cjs/react-interactions-events/focus.development.js');
}
7 changes: 7 additions & 0 deletions packages/react-interactions/npm/hover.js
@@ -0,0 +1,7 @@
'use strict';

if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-interactions-events/hover.production.min.js');
} else {
module.exports = require('./cjs/react-interactions-events/hover.development.js');
}
7 changes: 7 additions & 0 deletions packages/react-interactions/npm/input.js
@@ -0,0 +1,7 @@
'use strict';

if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-interactions-events/input.production.min.js');
} else {
module.exports = require('./cjs/react-interactions-events/input.development.js');
}
7 changes: 7 additions & 0 deletions packages/react-interactions/npm/keyboard.js
@@ -0,0 +1,7 @@
'use strict';

if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-interactions-events/keyboard.production.min.js');
} else {
module.exports = require('./cjs/react-interactions-events/keyboard.development.js');
}
7 changes: 7 additions & 0 deletions packages/react-interactions/npm/press-legacy.js
@@ -0,0 +1,7 @@
'use strict';

if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-interactions-events/press-legacy.production.min.js');
} else {
module.exports = require('./cjs/react-interactions-events/press-legacy.development.js');
}
7 changes: 7 additions & 0 deletions packages/react-interactions/npm/press.js
@@ -0,0 +1,7 @@
'use strict';

if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-interactions-events/press.production.min.js');
} else {
module.exports = require('./cjs/react-interactions-events/press.development.js');
}
7 changes: 7 additions & 0 deletions packages/react-interactions/npm/scroll.js
@@ -0,0 +1,7 @@
'use strict';

if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-interactions-events/scroll.production.min.js');
} else {
module.exports = require('./cjs/react-interactions-events/scroll.development.js');
}
7 changes: 7 additions & 0 deletions packages/react-interactions/npm/swipe.js
@@ -0,0 +1,7 @@
'use strict';

if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-interactions-events/swipe.production.min.js');
} else {
module.exports = require('./cjs/react-interactions-events/swipe.development.js');
}
7 changes: 7 additions & 0 deletions packages/react-interactions/npm/tap.js
@@ -0,0 +1,7 @@
'use strict';

if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-interactions-events/tap.production.min.js');
} else {
module.exports = require('./cjs/react-interactions-events/tap.development.js');
}
@@ -1,5 +1,5 @@
{
"name": "react-ui",
"name": "react-interactions",
"private": true,
"description": "React is a JavaScript library for building user interfaces.",
"keywords": [
Expand Down
Expand Up @@ -9,7 +9,7 @@

'use strict';

import {createEventTarget} from 'react-ui/events/src/dom/testing-library';
import {createEventTarget} from 'react-interactions/events/src/dom/testing-library';

let React;
let ReactFeatureFlags;
Expand Down Expand Up @@ -204,7 +204,8 @@ describe('ReactScope', () => {
let onKeyDown = jest.fn();
const TestScope = React.unstable_createScope((type, props) => true);
const ref = React.createRef();
const useKeyboard = require('react-ui/events/keyboard').useKeyboard;
const useKeyboard = require('react-interactions/events/keyboard')
.useKeyboard;
let Component = () => {
const listener = useKeyboard({
onKeyDown,
Expand Down
7 changes: 0 additions & 7 deletions packages/react-ui/npm/drag.js

This file was deleted.

7 changes: 0 additions & 7 deletions packages/react-ui/npm/focus.js

This file was deleted.

7 changes: 0 additions & 7 deletions packages/react-ui/npm/hover.js

This file was deleted.

7 changes: 0 additions & 7 deletions packages/react-ui/npm/input.js

This file was deleted.

7 changes: 0 additions & 7 deletions packages/react-ui/npm/keyboard.js

This file was deleted.

7 changes: 0 additions & 7 deletions packages/react-ui/npm/press-legacy.js

This file was deleted.

7 changes: 0 additions & 7 deletions packages/react-ui/npm/press.js

This file was deleted.

7 changes: 0 additions & 7 deletions packages/react-ui/npm/scroll.js

This file was deleted.

7 changes: 0 additions & 7 deletions packages/react-ui/npm/swipe.js

This file was deleted.

0 comments on commit cef47cb

Please sign in to comment.