react 0.14.0-beta1 → 0.14.0-beta2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/addons.js +5 -2
  2. package/dist/JSXTransformer.js +588 -227
  3. package/dist/react-with-addons.js +3118 -2707
  4. package/dist/react-with-addons.min.js +6 -6
  5. package/dist/react.js +3713 -3317
  6. package/dist/react.min.js +6 -5
  7. package/lib/AutoFocusUtils.js +3 -3
  8. package/lib/BeforeInputEventPlugin.js +13 -13
  9. package/lib/CSSProperty.js +3 -0
  10. package/lib/CSSPropertyOperations.js +13 -13
  11. package/lib/CallbackQueue.js +4 -4
  12. package/lib/ChangeEventPlugin.js +12 -12
  13. package/lib/DOMChildrenOperations.js +10 -6
  14. package/lib/DOMProperty.js +8 -8
  15. package/lib/DOMPropertyOperations.js +9 -9
  16. package/lib/Danger.js +14 -14
  17. package/lib/DefaultEventPluginOrder.js +2 -2
  18. package/lib/EnterLeaveEventPlugin.js +5 -5
  19. package/lib/EventConstants.js +23 -1
  20. package/lib/EventPluginHub.js +11 -11
  21. package/lib/EventPluginRegistry.js +8 -8
  22. package/lib/EventPluginUtils.js +11 -11
  23. package/lib/EventPropagators.js +7 -7
  24. package/lib/FallbackCompositionState.js +3 -3
  25. package/lib/HTMLDOMPropertyConfig.js +4 -2
  26. package/lib/LinkedStateMixin.js +2 -2
  27. package/lib/LinkedValueUtils.js +8 -8
  28. package/lib/MetaMatchers.js +118 -0
  29. package/lib/OrderedMap.js +453 -0
  30. package/lib/PooledClass.js +2 -2
  31. package/lib/React.js +6 -6
  32. package/lib/ReactBrowserComponentMixin.js +4 -4
  33. package/lib/ReactBrowserEventEmitter.js +30 -7
  34. package/lib/ReactCSSTransitionGroup.js +16 -5
  35. package/lib/ReactCSSTransitionGroupChild.js +12 -11
  36. package/lib/ReactChildReconciler.js +25 -18
  37. package/lib/ReactChildren.js +6 -6
  38. package/lib/ReactClass.js +42 -42
  39. package/lib/ReactComponent.js +13 -13
  40. package/lib/ReactComponentBrowserEnvironment.js +2 -2
  41. package/lib/ReactComponentEnvironment.js +2 -2
  42. package/lib/ReactComponentWithPureRenderMixin.js +1 -1
  43. package/lib/ReactCompositeComponent.js +38 -38
  44. package/lib/ReactDOM.js +72 -159
  45. package/lib/ReactDOMComponent.js +104 -60
  46. package/lib/ReactDOMFactories.js +177 -0
  47. package/lib/ReactDOMIDOperations.js +10 -24
  48. package/lib/ReactDOMInput.js +8 -8
  49. package/lib/ReactDOMOption.js +7 -7
  50. package/lib/ReactDOMSelect.js +8 -8
  51. package/lib/ReactDOMSelection.js +3 -3
  52. package/lib/ReactDOMServer.js +2 -2
  53. package/lib/ReactDOMTextComponent.js +11 -11
  54. package/lib/ReactDOMTextarea.js +11 -11
  55. package/lib/ReactDefaultBatchingStrategy.js +4 -4
  56. package/lib/ReactDefaultInjection.js +24 -24
  57. package/lib/ReactDefaultPerf.js +7 -7
  58. package/lib/ReactDefaultPerfAnalysis.js +6 -9
  59. package/lib/ReactElement.js +4 -4
  60. package/lib/ReactElementValidator.js +21 -21
  61. package/lib/ReactEmptyComponent.js +4 -4
  62. package/lib/ReactEventEmitterMixin.js +1 -1
  63. package/lib/ReactEventListener.js +19 -14
  64. package/lib/ReactFragment.js +11 -11
  65. package/lib/ReactInjection.js +11 -11
  66. package/lib/ReactInputSelection.js +4 -4
  67. package/lib/ReactInstanceHandles.js +10 -11
  68. package/lib/ReactIsomorphic.js +11 -11
  69. package/lib/ReactLink.js +1 -1
  70. package/lib/ReactMarkupChecksum.js +6 -2
  71. package/lib/ReactMount.js +68 -48
  72. package/lib/ReactMultiChild.js +83 -22
  73. package/lib/ReactMultiChildUpdateTypes.js +2 -1
  74. package/lib/ReactNativeComponent.js +3 -3
  75. package/lib/ReactNoopUpdateQueue.js +3 -3
  76. package/lib/ReactOwner.js +3 -3
  77. package/lib/ReactPerf.js +2 -2
  78. package/lib/ReactPropTransferer.js +3 -3
  79. package/lib/ReactPropTypeLocationNames.js +1 -1
  80. package/lib/ReactPropTypeLocations.js +1 -1
  81. package/lib/ReactPropTypes.js +34 -8
  82. package/lib/ReactReconcileTransaction.js +6 -6
  83. package/lib/ReactReconciler.js +12 -12
  84. package/lib/ReactRef.js +1 -1
  85. package/lib/ReactServerBatchingStrategy.js +5 -5
  86. package/lib/ReactServerRendering.js +12 -12
  87. package/lib/ReactServerRenderingTransaction.js +5 -5
  88. package/lib/ReactTestUtils.js +26 -27
  89. package/lib/ReactTransitionChildMapping.js +2 -2
  90. package/lib/ReactTransitionEvents.js +1 -1
  91. package/lib/ReactTransitionGroup.js +5 -6
  92. package/lib/ReactUpdateQueue.js +17 -17
  93. package/lib/ReactUpdates.js +14 -14
  94. package/lib/ReactWithAddons.js +14 -14
  95. package/lib/ResponderEventPlugin.js +514 -0
  96. package/lib/ResponderSyntheticEvent.js +40 -0
  97. package/lib/ResponderTouchHistoryStore.js +180 -0
  98. package/lib/SVGDOMPropertyConfig.js +1 -1
  99. package/lib/SelectEventPlugin.js +9 -9
  100. package/lib/SimpleEventPlugin.js +201 -25
  101. package/lib/SyntheticClipboardEvent.js +1 -1
  102. package/lib/SyntheticCompositionEvent.js +1 -1
  103. package/lib/SyntheticDragEvent.js +1 -1
  104. package/lib/SyntheticEvent.js +3 -3
  105. package/lib/SyntheticFocusEvent.js +1 -1
  106. package/lib/SyntheticInputEvent.js +1 -1
  107. package/lib/SyntheticKeyboardEvent.js +4 -4
  108. package/lib/SyntheticMouseEvent.js +3 -3
  109. package/lib/SyntheticTouchEvent.js +2 -2
  110. package/lib/SyntheticUIEvent.js +2 -2
  111. package/lib/SyntheticWheelEvent.js +1 -1
  112. package/lib/TapEventPlugin.js +119 -0
  113. package/lib/Transaction.js +6 -6
  114. package/lib/accumulate.js +44 -0
  115. package/lib/accumulateInto.js +2 -2
  116. package/lib/adler32.js +19 -7
  117. package/lib/cloneWithProps.js +11 -6
  118. package/lib/createHierarchyRenderer.js +85 -0
  119. package/lib/dangerousStyleValue.js +1 -1
  120. package/lib/deprecated.js +4 -4
  121. package/lib/findDOMNode.js +9 -9
  122. package/lib/flattenChildren.js +4 -4
  123. package/lib/getEventKey.js +1 -1
  124. package/lib/getTestDocument.js +28 -0
  125. package/lib/getTextContentAccessor.js +1 -1
  126. package/lib/instantiateReactComponent.js +12 -12
  127. package/lib/isEventSupported.js +1 -1
  128. package/lib/onlyChild.js +3 -3
  129. package/lib/quoteAttributeValueForBrowser.js +1 -1
  130. package/lib/reactComponentExpect.js +210 -0
  131. package/lib/renderSubtreeIntoContainer.js +1 -1
  132. package/lib/setInnerHTML.js +1 -1
  133. package/lib/setTextContent.js +3 -3
  134. package/lib/shallowCompare.js +1 -1
  135. package/lib/sliceChildren.js +51 -0
  136. package/lib/traverseAllChildren.js +14 -13
  137. package/lib/update.js +13 -13
  138. package/lib/validateDOMNesting.js +6 -6
  139. package/lib/webcomponents.js +6379 -0
  140. package/package.json +4 -6
  141. package/react.js +1 -1
  142. package/lib/CSSCore.js +0 -97
  143. package/lib/EventListener.js +0 -84
  144. package/lib/ExecutionEnvironment.js +0 -38
  145. package/lib/ReactDOMClient.js +0 -90
  146. package/lib/camelize.js +0 -32
  147. package/lib/camelizeStyleName.js +0 -40
  148. package/lib/containsNode.js +0 -55
  149. package/lib/createArrayFromMixed.js +0 -85
  150. package/lib/createNodesFromMarkup.js +0 -84
  151. package/lib/emptyFunction.js +0 -38
  152. package/lib/emptyObject.js +0 -20
  153. package/lib/focusNode.js +0 -26
  154. package/lib/getActiveElement.js +0 -29
  155. package/lib/getMarkupWrap.js +0 -93
  156. package/lib/getUnboundedScrollPosition.js +0 -38
  157. package/lib/hyphenate.js +0 -33
  158. package/lib/hyphenateStyleName.js +0 -39
  159. package/lib/invariant.js +0 -49
  160. package/lib/isNode.js +0 -23
  161. package/lib/isTextNode.js +0 -25
  162. package/lib/keyMirror.js +0 -48
  163. package/lib/keyOf.js +0 -35
  164. package/lib/mapObject.js +0 -51
  165. package/lib/performance.js +0 -23
  166. package/lib/performanceNow.js +0 -28
  167. package/lib/shallowEqual.js +0 -48
  168. package/lib/toArray.js +0 -57
  169. package/lib/warning.js +0 -57
@@ -1,85 +0,0 @@
1
- /**
2
- * Copyright 2013-2015, Facebook, Inc.
3
- * All rights reserved.
4
- *
5
- * This source code is licensed under the BSD-style license found in the
6
- * LICENSE file in the root directory of this source tree. An additional grant
7
- * of patent rights can be found in the PATENTS file in the same directory.
8
- *
9
- * @providesModule createArrayFromMixed
10
- * @typechecks
11
- */
12
-
13
- 'use strict';
14
-
15
- var toArray = require("./toArray");
16
-
17
- /**
18
- * Perform a heuristic test to determine if an object is "array-like".
19
- *
20
- * A monk asked Joshu, a Zen master, "Has a dog Buddha nature?"
21
- * Joshu replied: "Mu."
22
- *
23
- * This function determines if its argument has "array nature": it returns
24
- * true if the argument is an actual array, an `arguments' object, or an
25
- * HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()).
26
- *
27
- * It will return false for other array-like objects like Filelist.
28
- *
29
- * @param {*} obj
30
- * @return {boolean}
31
- */
32
- function hasArrayNature(obj) {
33
- return (
34
- // not null/false
35
- !!obj && (typeof obj == 'object' || typeof obj == 'function') && 'length' in obj &&
36
- // not window
37
- !('setInterval' in obj) && typeof obj.nodeType != 'number' && (
38
- // a real array
39
- (Array.isArray(obj) || 'callee' in obj || 'item' in obj))
40
- );
41
- }
42
-
43
- /**
44
- * Ensure that the argument is an array by wrapping it in an array if it is not.
45
- * Creates a copy of the argument if it is already an array.
46
- *
47
- * This is mostly useful idiomatically:
48
- *
49
- * var createArrayFromMixed = require('createArrayFromMixed');
50
- *
51
- * function takesOneOrMoreThings(things) {
52
- * things = createArrayFromMixed(things);
53
- * ...
54
- * }
55
- *
56
- * This allows you to treat `things' as an array, but accept scalars in the API.
57
- *
58
- * If you need to convert an array-like object, like `arguments`, into an array
59
- * use toArray instead.
60
- *
61
- * @param {*} obj
62
- * @return {array}
63
- */
64
- function createArrayFromMixed(obj) {
65
- if (!hasArrayNature(obj)) {
66
- return [obj];
67
- } else if (Array.isArray(obj)) {
68
- return obj.slice();
69
- } else {
70
- return toArray(obj);
71
- }
72
- }
73
-
74
- module.exports = createArrayFromMixed;
75
-
76
- // arrays are objects, NodeLists are functions in Safari
77
-
78
- // quacks like an array
79
-
80
- // no DOM node should be considered an array-like
81
- // a 'select' element has 'length' and 'item' properties on IE8
82
-
83
- // arguments
84
-
85
- // HTMLCollection/NodeList
@@ -1,84 +0,0 @@
1
- /**
2
- * Copyright 2013-2015, Facebook, Inc.
3
- * All rights reserved.
4
- *
5
- * This source code is licensed under the BSD-style license found in the
6
- * LICENSE file in the root directory of this source tree. An additional grant
7
- * of patent rights can be found in the PATENTS file in the same directory.
8
- *
9
- * @providesModule createNodesFromMarkup
10
- * @typechecks
11
- */
12
-
13
- /*jslint evil: true, sub: true */
14
-
15
- 'use strict';
16
-
17
- var ExecutionEnvironment = require("./ExecutionEnvironment");
18
-
19
- var createArrayFromMixed = require("./createArrayFromMixed");
20
- var getMarkupWrap = require("./getMarkupWrap");
21
- var invariant = require("./invariant");
22
-
23
- /**
24
- * Dummy container used to render all markup.
25
- */
26
- var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
27
-
28
- /**
29
- * Pattern used by `getNodeName`.
30
- */
31
- var nodeNamePattern = /^\s*<(\w+)/;
32
-
33
- /**
34
- * Extracts the `nodeName` of the first element in a string of markup.
35
- *
36
- * @param {string} markup String of markup.
37
- * @return {?string} Node name of the supplied markup.
38
- */
39
- function getNodeName(markup) {
40
- var nodeNameMatch = markup.match(nodeNamePattern);
41
- return nodeNameMatch && nodeNameMatch[1].toLowerCase();
42
- }
43
-
44
- /**
45
- * Creates an array containing the nodes rendered from the supplied markup. The
46
- * optionally supplied `handleScript` function will be invoked once for each
47
- * <script> element that is rendered. If no `handleScript` function is supplied,
48
- * an exception is thrown if any <script> elements are rendered.
49
- *
50
- * @param {string} markup A string of valid HTML markup.
51
- * @param {?function} handleScript Invoked once for each rendered <script>.
52
- * @return {array<DOMElement|DOMTextNode>} An array of rendered nodes.
53
- */
54
- function createNodesFromMarkup(markup, handleScript) {
55
- var node = dummyNode;
56
- !!!dummyNode ? 'production' !== process.env.NODE_ENV ? invariant(false, 'createNodesFromMarkup dummy not initialized') : invariant(false) : undefined;
57
- var nodeName = getNodeName(markup);
58
-
59
- var wrap = nodeName && getMarkupWrap(nodeName);
60
- if (wrap) {
61
- node.innerHTML = wrap[1] + markup + wrap[2];
62
-
63
- var wrapDepth = wrap[0];
64
- while (wrapDepth--) {
65
- node = node.lastChild;
66
- }
67
- } else {
68
- node.innerHTML = markup;
69
- }
70
-
71
- var scripts = node.getElementsByTagName('script');
72
- if (scripts.length) {
73
- !handleScript ? 'production' !== process.env.NODE_ENV ? invariant(false, 'createNodesFromMarkup(...): Unexpected <script> element rendered.') : invariant(false) : undefined;
74
- createArrayFromMixed(scripts).forEach(handleScript);
75
- }
76
-
77
- var nodes = createArrayFromMixed(node.childNodes);
78
- while (node.lastChild) {
79
- node.removeChild(node.lastChild);
80
- }
81
- return nodes;
82
- }
83
-
84
- module.exports = createNodesFromMarkup;
@@ -1,38 +0,0 @@
1
- /**
2
- * Copyright 2013-2015, Facebook, Inc.
3
- * All rights reserved.
4
- *
5
- * This source code is licensed under the BSD-style license found in the
6
- * LICENSE file in the root directory of this source tree. An additional grant
7
- * of patent rights can be found in the PATENTS file in the same directory.
8
- *
9
- * @providesModule emptyFunction
10
- */
11
-
12
- "use strict";
13
-
14
- function makeEmptyFunction(arg) {
15
- return function () {
16
- return arg;
17
- };
18
- }
19
-
20
- /**
21
- * This function accepts and discards inputs; it has no side effects. This is
22
- * primarily useful idiomatically for overridable function endpoints which
23
- * always need to be callable, since JS lacks a null-call idiom ala Cocoa.
24
- */
25
- function emptyFunction() {}
26
-
27
- emptyFunction.thatReturns = makeEmptyFunction;
28
- emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
29
- emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
30
- emptyFunction.thatReturnsNull = makeEmptyFunction(null);
31
- emptyFunction.thatReturnsThis = function () {
32
- return this;
33
- };
34
- emptyFunction.thatReturnsArgument = function (arg) {
35
- return arg;
36
- };
37
-
38
- module.exports = emptyFunction;
@@ -1,20 +0,0 @@
1
- /**
2
- * Copyright 2013-2015, Facebook, Inc.
3
- * All rights reserved.
4
- *
5
- * This source code is licensed under the BSD-style license found in the
6
- * LICENSE file in the root directory of this source tree. An additional grant
7
- * of patent rights can be found in the PATENTS file in the same directory.
8
- *
9
- * @providesModule emptyObject
10
- */
11
-
12
- "use strict";
13
-
14
- var emptyObject = {};
15
-
16
- if ("production" !== process.env.NODE_ENV) {
17
- Object.freeze(emptyObject);
18
- }
19
-
20
- module.exports = emptyObject;
package/lib/focusNode.js DELETED
@@ -1,26 +0,0 @@
1
- /**
2
- * Copyright 2014-2015, Facebook, Inc.
3
- * All rights reserved.
4
- *
5
- * This source code is licensed under the BSD-style license found in the
6
- * LICENSE file in the root directory of this source tree. An additional grant
7
- * of patent rights can be found in the PATENTS file in the same directory.
8
- *
9
- * @providesModule focusNode
10
- */
11
-
12
- "use strict";
13
-
14
- /**
15
- * @param {DOMElement} node input/textarea to focus
16
- */
17
- function focusNode(node) {
18
- // IE8 can throw "Can't move focus to the control because it is invisible,
19
- // not enabled, or of a type that does not accept the focus." for all kinds of
20
- // reasons that are too expensive and fragile to test.
21
- try {
22
- node.focus();
23
- } catch (e) {}
24
- }
25
-
26
- module.exports = focusNode;
@@ -1,29 +0,0 @@
1
- /**
2
- * Copyright 2013-2015, Facebook, Inc.
3
- * All rights reserved.
4
- *
5
- * This source code is licensed under the BSD-style license found in the
6
- * LICENSE file in the root directory of this source tree. An additional grant
7
- * of patent rights can be found in the PATENTS file in the same directory.
8
- *
9
- * @providesModule getActiveElement
10
- * @typechecks
11
- */
12
-
13
- /**
14
- * Same as document.activeElement but wraps in a try-catch block. In IE it is
15
- * not safe to call document.activeElement if there is nothing focused.
16
- *
17
- * The activeElement will be null only if the document body is not yet defined.
18
- */
19
- "use strict";
20
-
21
- function getActiveElement() /*?DOMElement*/{
22
- try {
23
- return document.activeElement || document.body;
24
- } catch (e) {
25
- return document.body;
26
- }
27
- }
28
-
29
- module.exports = getActiveElement;
@@ -1,93 +0,0 @@
1
- /**
2
- * Copyright 2013-2015, Facebook, Inc.
3
- * All rights reserved.
4
- *
5
- * This source code is licensed under the BSD-style license found in the
6
- * LICENSE file in the root directory of this source tree. An additional grant
7
- * of patent rights can be found in the PATENTS file in the same directory.
8
- *
9
- * @providesModule getMarkupWrap
10
- */
11
-
12
- 'use strict';
13
-
14
- var ExecutionEnvironment = require("./ExecutionEnvironment");
15
-
16
- var invariant = require("./invariant");
17
-
18
- /**
19
- * Dummy container used to detect which wraps are necessary.
20
- */
21
- var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
22
-
23
- /**
24
- * Some browsers cannot use `innerHTML` to render certain elements standalone,
25
- * so we wrap them, render the wrapped nodes, then extract the desired node.
26
- *
27
- * In IE8, certain elements cannot render alone, so wrap all elements ('*').
28
- */
29
-
30
- var shouldWrap = {};
31
-
32
- var selectWrap = [1, '<select multiple="true">', '</select>'];
33
- var tableWrap = [1, '<table>', '</table>'];
34
- var trWrap = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
35
-
36
- var svgWrap = [1, '<svg xmlns="http://www.w3.org/2000/svg">', '</svg>'];
37
-
38
- var markupWrap = {
39
- '*': [1, '?<div>', '</div>'],
40
-
41
- 'area': [1, '<map>', '</map>'],
42
- 'col': [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
43
- 'legend': [1, '<fieldset>', '</fieldset>'],
44
- 'param': [1, '<object>', '</object>'],
45
- 'tr': [2, '<table><tbody>', '</tbody></table>'],
46
-
47
- 'optgroup': selectWrap,
48
- 'option': selectWrap,
49
-
50
- 'caption': tableWrap,
51
- 'colgroup': tableWrap,
52
- 'tbody': tableWrap,
53
- 'tfoot': tableWrap,
54
- 'thead': tableWrap,
55
-
56
- 'td': trWrap,
57
- 'th': trWrap
58
- };
59
-
60
- // Initilize the SVG elements since we know they'll always need to be wrapped
61
- // consistently. If they are created inside a <div> they will be initialized in
62
- // the wrong namespace (and will not display).
63
- var svgElements = ['circle', 'clipPath', 'defs', 'ellipse', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'text', 'tspan'];
64
- svgElements.forEach(function (nodeName) {
65
- markupWrap[nodeName] = svgWrap;
66
- shouldWrap[nodeName] = true;
67
- });
68
-
69
- /**
70
- * Gets the markup wrap configuration for the supplied `nodeName`.
71
- *
72
- * NOTE: This lazily detects which wraps are necessary for the current browser.
73
- *
74
- * @param {string} nodeName Lowercase `nodeName`.
75
- * @return {?array} Markup wrap configuration, if applicable.
76
- */
77
- function getMarkupWrap(nodeName) {
78
- !!!dummyNode ? 'production' !== process.env.NODE_ENV ? invariant(false, 'Markup wrapping node not initialized') : invariant(false) : undefined;
79
- if (!markupWrap.hasOwnProperty(nodeName)) {
80
- nodeName = '*';
81
- }
82
- if (!shouldWrap.hasOwnProperty(nodeName)) {
83
- if (nodeName === '*') {
84
- dummyNode.innerHTML = '<link />';
85
- } else {
86
- dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>';
87
- }
88
- shouldWrap[nodeName] = !dummyNode.firstChild;
89
- }
90
- return shouldWrap[nodeName] ? markupWrap[nodeName] : null;
91
- }
92
-
93
- module.exports = getMarkupWrap;
@@ -1,38 +0,0 @@
1
- /**
2
- * Copyright 2013-2015, Facebook, Inc.
3
- * All rights reserved.
4
- *
5
- * This source code is licensed under the BSD-style license found in the
6
- * LICENSE file in the root directory of this source tree. An additional grant
7
- * of patent rights can be found in the PATENTS file in the same directory.
8
- *
9
- * @providesModule getUnboundedScrollPosition
10
- * @typechecks
11
- */
12
-
13
- "use strict";
14
-
15
- /**
16
- * Gets the scroll position of the supplied element or window.
17
- *
18
- * The return values are unbounded, unlike `getScrollPosition`. This means they
19
- * may be negative or exceed the element boundaries (which is possible using
20
- * inertial scrolling).
21
- *
22
- * @param {DOMWindow|DOMElement} scrollable
23
- * @return {object} Map with `x` and `y` keys.
24
- */
25
- function getUnboundedScrollPosition(scrollable) {
26
- if (scrollable === window) {
27
- return {
28
- x: window.pageXOffset || document.documentElement.scrollLeft,
29
- y: window.pageYOffset || document.documentElement.scrollTop
30
- };
31
- }
32
- return {
33
- x: scrollable.scrollLeft,
34
- y: scrollable.scrollTop
35
- };
36
- }
37
-
38
- module.exports = getUnboundedScrollPosition;
package/lib/hyphenate.js DELETED
@@ -1,33 +0,0 @@
1
- /**
2
- * Copyright 2013-2015, Facebook, Inc.
3
- * All rights reserved.
4
- *
5
- * This source code is licensed under the BSD-style license found in the
6
- * LICENSE file in the root directory of this source tree. An additional grant
7
- * of patent rights can be found in the PATENTS file in the same directory.
8
- *
9
- * @providesModule hyphenate
10
- * @typechecks
11
- */
12
-
13
- 'use strict';
14
-
15
- var _uppercasePattern = /([A-Z])/g;
16
-
17
- /**
18
- * Hyphenates a camelcased string, for example:
19
- *
20
- * > hyphenate('backgroundColor')
21
- * < "background-color"
22
- *
23
- * For CSS style names, use `hyphenateStyleName` instead which works properly
24
- * with all vendor prefixes, including `ms`.
25
- *
26
- * @param {string} string
27
- * @return {string}
28
- */
29
- function hyphenate(string) {
30
- return string.replace(_uppercasePattern, '-$1').toLowerCase();
31
- }
32
-
33
- module.exports = hyphenate;