react 0.14.0-beta1 → 0.14.0

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 (173) hide show
  1. package/addons.js +8 -3
  2. package/dist/react-with-addons.js +5048 -4095
  3. package/dist/react-with-addons.min.js +6 -6
  4. package/dist/react.js +4555 -3729
  5. package/dist/react.min.js +6 -5
  6. package/lib/AutoFocusUtils.js +3 -3
  7. package/lib/BeforeInputEventPlugin.js +13 -13
  8. package/lib/CSSProperty.js +18 -3
  9. package/lib/CSSPropertyOperations.js +27 -14
  10. package/lib/CallbackQueue.js +4 -4
  11. package/lib/ChangeEventPlugin.js +15 -14
  12. package/lib/DOMChildrenOperations.js +22 -7
  13. package/lib/DOMProperty.js +8 -8
  14. package/lib/DOMPropertyOperations.js +23 -10
  15. package/lib/Danger.js +21 -16
  16. package/lib/DefaultEventPluginOrder.js +2 -2
  17. package/lib/EnterLeaveEventPlugin.js +18 -10
  18. package/lib/EventConstants.js +23 -1
  19. package/lib/EventPluginHub.js +29 -21
  20. package/lib/EventPluginRegistry.js +8 -8
  21. package/lib/EventPluginUtils.js +34 -38
  22. package/lib/EventPropagators.js +8 -8
  23. package/lib/FallbackCompositionState.js +9 -3
  24. package/lib/HTMLDOMPropertyConfig.js +24 -4
  25. package/lib/LinkedStateMixin.js +2 -2
  26. package/lib/LinkedValueUtils.js +8 -8
  27. package/lib/MetaMatchers.js +118 -0
  28. package/lib/OrderedMap.js +453 -0
  29. package/lib/PooledClass.js +3 -5
  30. package/lib/React.js +18 -7
  31. package/lib/ReactBrowserComponentMixin.js +4 -4
  32. package/lib/ReactBrowserEventEmitter.js +36 -7
  33. package/lib/ReactCSSTransitionGroup.js +35 -9
  34. package/lib/ReactCSSTransitionGroupChild.js +48 -30
  35. package/lib/ReactChildReconciler.js +24 -19
  36. package/lib/ReactChildren.js +72 -32
  37. package/lib/ReactClass.js +46 -46
  38. package/lib/ReactComponent.js +18 -16
  39. package/lib/ReactComponentBrowserEnvironment.js +2 -2
  40. package/lib/ReactComponentEnvironment.js +2 -2
  41. package/lib/ReactComponentWithPureRenderMixin.js +1 -1
  42. package/lib/ReactCompositeComponent.js +95 -44
  43. package/lib/ReactDOM.js +74 -159
  44. package/lib/ReactDOMComponent.js +235 -93
  45. package/lib/ReactDOMFactories.js +177 -0
  46. package/lib/{emptyObject.js → ReactDOMFeatureFlags.js} +6 -8
  47. package/lib/ReactDOMIDOperations.js +8 -81
  48. package/lib/ReactDOMInput.js +18 -9
  49. package/lib/ReactDOMOption.js +7 -7
  50. package/lib/ReactDOMSelect.js +9 -9
  51. package/lib/ReactDOMSelection.js +19 -3
  52. package/lib/ReactDOMServer.js +5 -3
  53. package/lib/ReactDOMTextComponent.js +33 -20
  54. package/lib/ReactDOMTextarea.js +14 -12
  55. package/lib/ReactDefaultBatchingStrategy.js +4 -4
  56. package/lib/ReactDefaultInjection.js +23 -25
  57. package/lib/ReactDefaultPerf.js +17 -11
  58. package/lib/ReactDefaultPerfAnalysis.js +13 -12
  59. package/lib/ReactElement.js +85 -39
  60. package/lib/ReactElementValidator.js +47 -90
  61. package/lib/ReactEmptyComponent.js +26 -62
  62. package/lib/ReactEmptyComponentRegistry.js +48 -0
  63. package/lib/ReactErrorUtils.js +53 -9
  64. package/lib/ReactEventEmitterMixin.js +2 -2
  65. package/lib/ReactEventListener.js +33 -21
  66. package/lib/ReactFragment.js +27 -118
  67. package/lib/ReactInjection.js +10 -12
  68. package/lib/ReactInputSelection.js +4 -4
  69. package/lib/ReactInstanceHandles.js +10 -11
  70. package/lib/ReactIsomorphic.js +15 -11
  71. package/lib/ReactLink.js +2 -2
  72. package/lib/ReactMarkupChecksum.js +6 -2
  73. package/lib/ReactMount.js +186 -85
  74. package/lib/ReactMultiChild.js +119 -25
  75. package/lib/ReactMultiChildUpdateTypes.js +2 -1
  76. package/lib/ReactNativeComponent.js +3 -3
  77. package/lib/ReactNoopUpdateQueue.js +3 -3
  78. package/lib/ReactOwner.js +3 -3
  79. package/lib/ReactPerf.js +2 -2
  80. package/lib/ReactPropTransferer.js +3 -3
  81. package/lib/ReactPropTypeLocationNames.js +1 -1
  82. package/lib/ReactPropTypeLocations.js +1 -1
  83. package/lib/ReactPropTypes.js +38 -9
  84. package/lib/ReactReconcileTransaction.js +10 -8
  85. package/lib/ReactReconciler.js +5 -6
  86. package/lib/ReactRef.js +14 -2
  87. package/lib/ReactServerBatchingStrategy.js +5 -5
  88. package/lib/ReactServerRendering.js +12 -12
  89. package/lib/ReactServerRenderingTransaction.js +6 -5
  90. package/lib/ReactTestUtils.js +47 -39
  91. package/lib/ReactTransitionChildMapping.js +3 -6
  92. package/lib/ReactTransitionEvents.js +1 -1
  93. package/lib/ReactTransitionGroup.js +5 -6
  94. package/lib/ReactUpdateQueue.js +19 -19
  95. package/lib/ReactUpdates.js +15 -15
  96. package/lib/{performance.js → ReactVersion.js} +3 -12
  97. package/lib/ReactWithAddons.js +24 -15
  98. package/lib/ResponderEventPlugin.js +514 -0
  99. package/lib/ResponderSyntheticEvent.js +40 -0
  100. package/lib/ResponderTouchHistoryStore.js +180 -0
  101. package/lib/SVGDOMPropertyConfig.js +1 -1
  102. package/lib/SelectEventPlugin.js +19 -9
  103. package/lib/SimpleEventPlugin.js +198 -43
  104. package/lib/SyntheticClipboardEvent.js +1 -1
  105. package/lib/SyntheticCompositionEvent.js +1 -1
  106. package/lib/SyntheticDragEvent.js +1 -1
  107. package/lib/SyntheticEvent.js +18 -4
  108. package/lib/SyntheticFocusEvent.js +1 -1
  109. package/lib/SyntheticInputEvent.js +1 -1
  110. package/lib/SyntheticKeyboardEvent.js +4 -4
  111. package/lib/SyntheticMouseEvent.js +3 -3
  112. package/lib/SyntheticTouchEvent.js +2 -2
  113. package/lib/SyntheticUIEvent.js +2 -2
  114. package/lib/SyntheticWheelEvent.js +1 -1
  115. package/lib/TapEventPlugin.js +119 -0
  116. package/lib/Transaction.js +7 -7
  117. package/lib/accumulate.js +44 -0
  118. package/lib/accumulateInto.js +2 -2
  119. package/lib/adler32.js +19 -7
  120. package/lib/cloneWithProps.js +11 -6
  121. package/lib/createHierarchyRenderer.js +85 -0
  122. package/lib/dangerousStyleValue.js +1 -1
  123. package/lib/deprecated.js +7 -6
  124. package/lib/findDOMNode.js +9 -9
  125. package/lib/flattenChildren.js +4 -4
  126. package/lib/getEventKey.js +1 -1
  127. package/lib/{isTextNode.js → getTestDocument.js} +7 -11
  128. package/lib/getTextContentAccessor.js +1 -1
  129. package/lib/instantiateReactComponent.js +15 -17
  130. package/lib/isEventSupported.js +1 -1
  131. package/lib/onlyChild.js +3 -3
  132. package/lib/quoteAttributeValueForBrowser.js +1 -1
  133. package/lib/reactComponentExpect.js +216 -0
  134. package/lib/renderSubtreeIntoContainer.js +1 -1
  135. package/lib/setInnerHTML.js +1 -1
  136. package/lib/setTextContent.js +3 -3
  137. package/lib/shallowCompare.js +1 -1
  138. package/lib/shouldUpdateReactComponent.js +12 -8
  139. package/lib/sliceChildren.js +34 -0
  140. package/lib/traverseAllChildren.js +25 -18
  141. package/lib/update.js +13 -13
  142. package/lib/validateDOMNesting.js +6 -6
  143. package/lib/webcomponents.js +6379 -0
  144. package/package.json +4 -6
  145. package/react.js +1 -51
  146. package/dist/JSXTransformer.js +0 -17588
  147. package/lib/CSSCore.js +0 -97
  148. package/lib/EventListener.js +0 -84
  149. package/lib/ExecutionEnvironment.js +0 -38
  150. package/lib/ReactDOMClient.js +0 -90
  151. package/lib/camelize.js +0 -32
  152. package/lib/camelizeStyleName.js +0 -40
  153. package/lib/containsNode.js +0 -55
  154. package/lib/createArrayFromMixed.js +0 -85
  155. package/lib/createNodesFromMarkup.js +0 -84
  156. package/lib/emptyFunction.js +0 -38
  157. package/lib/focusNode.js +0 -26
  158. package/lib/getActiveElement.js +0 -29
  159. package/lib/getMarkupWrap.js +0 -93
  160. package/lib/getUnboundedScrollPosition.js +0 -38
  161. package/lib/hyphenate.js +0 -33
  162. package/lib/hyphenateStyleName.js +0 -39
  163. package/lib/invariant.js +0 -49
  164. package/lib/isNode.js +0 -23
  165. package/lib/joinClasses.js +0 -39
  166. package/lib/keyMirror.js +0 -48
  167. package/lib/keyOf.js +0 -35
  168. package/lib/mapObject.js +0 -51
  169. package/lib/memoizeStringOnly.js +0 -31
  170. package/lib/performanceNow.js +0 -28
  171. package/lib/shallowEqual.js +0 -48
  172. package/lib/toArray.js +0 -57
  173. package/lib/warning.js +0 -57
package/lib/CSSCore.js DELETED
@@ -1,97 +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 CSSCore
10
- * @typechecks
11
- */
12
-
13
- 'use strict';
14
-
15
- var invariant = require("./invariant");
16
-
17
- /**
18
- * The CSSCore module specifies the API (and implements most of the methods)
19
- * that should be used when dealing with the display of elements (via their
20
- * CSS classes and visibility on screen. It is an API focused on mutating the
21
- * display and not reading it as no logical state should be encoded in the
22
- * display of elements.
23
- */
24
-
25
- var CSSCore = {
26
-
27
- /**
28
- * Adds the class passed in to the element if it doesn't already have it.
29
- *
30
- * @param {DOMElement} element the element to set the class on
31
- * @param {string} className the CSS className
32
- * @return {DOMElement} the element passed in
33
- */
34
- addClass: function (element, className) {
35
- !!/\s/.test(className) ? 'production' !== process.env.NODE_ENV ? invariant(false, 'CSSCore.addClass takes only a single class name. "%s" contains ' + 'multiple classes.', className) : invariant(false) : undefined;
36
-
37
- if (className) {
38
- if (element.classList) {
39
- element.classList.add(className);
40
- } else if (!CSSCore.hasClass(element, className)) {
41
- element.className = element.className + ' ' + className;
42
- }
43
- }
44
- return element;
45
- },
46
-
47
- /**
48
- * Removes the class passed in from the element
49
- *
50
- * @param {DOMElement} element the element to set the class on
51
- * @param {string} className the CSS className
52
- * @return {DOMElement} the element passed in
53
- */
54
- removeClass: function (element, className) {
55
- !!/\s/.test(className) ? 'production' !== process.env.NODE_ENV ? invariant(false, 'CSSCore.removeClass takes only a single class name. "%s" contains ' + 'multiple classes.', className) : invariant(false) : undefined;
56
-
57
- if (className) {
58
- if (element.classList) {
59
- element.classList.remove(className);
60
- } else if (CSSCore.hasClass(element, className)) {
61
- element.className = element.className.replace(new RegExp('(^|\\s)' + className + '(?:\\s|$)', 'g'), '$1').replace(/\s+/g, ' ') // multiple spaces to one
62
- .replace(/^\s*|\s*$/g, ''); // trim the ends
63
- }
64
- }
65
- return element;
66
- },
67
-
68
- /**
69
- * Helper to add or remove a class from an element based on a condition.
70
- *
71
- * @param {DOMElement} element the element to set the class on
72
- * @param {string} className the CSS className
73
- * @param {*} bool condition to whether to add or remove the class
74
- * @return {DOMElement} the element passed in
75
- */
76
- conditionClass: function (element, className, bool) {
77
- return (bool ? CSSCore.addClass : CSSCore.removeClass)(element, className);
78
- },
79
-
80
- /**
81
- * Tests whether the element has the class specified.
82
- *
83
- * @param {DOMNode|DOMWindow} element the element to set the class on
84
- * @param {string} className the CSS className
85
- * @return {boolean} true if the element has the class, false if not
86
- */
87
- hasClass: function (element, className) {
88
- !!/\s/.test(className) ? 'production' !== process.env.NODE_ENV ? invariant(false, 'CSS.hasClass takes only a single class name.') : invariant(false) : undefined;
89
- if (element.classList) {
90
- return !!className && element.classList.contains(className);
91
- }
92
- return (' ' + element.className + ' ').indexOf(' ' + className + ' ') > -1;
93
- }
94
-
95
- };
96
-
97
- module.exports = CSSCore;
@@ -1,84 +0,0 @@
1
- /**
2
- * Copyright 2013-2015, Facebook, Inc.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- *
16
- * @providesModule EventListener
17
- * @typechecks
18
- */
19
-
20
- 'use strict';
21
-
22
- var emptyFunction = require("./emptyFunction");
23
-
24
- /**
25
- * Upstream version of event listener. Does not take into account specific
26
- * nature of platform.
27
- */
28
- var EventListener = {
29
- /**
30
- * Listen to DOM events during the bubble phase.
31
- *
32
- * @param {DOMEventTarget} target DOM element to register listener on.
33
- * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
34
- * @param {function} callback Callback function.
35
- * @return {object} Object with a `remove` method.
36
- */
37
- listen: function (target, eventType, callback) {
38
- if (target.addEventListener) {
39
- target.addEventListener(eventType, callback, false);
40
- return {
41
- remove: function () {
42
- target.removeEventListener(eventType, callback, false);
43
- }
44
- };
45
- } else if (target.attachEvent) {
46
- target.attachEvent('on' + eventType, callback);
47
- return {
48
- remove: function () {
49
- target.detachEvent('on' + eventType, callback);
50
- }
51
- };
52
- }
53
- },
54
-
55
- /**
56
- * Listen to DOM events during the capture phase.
57
- *
58
- * @param {DOMEventTarget} target DOM element to register listener on.
59
- * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
60
- * @param {function} callback Callback function.
61
- * @return {object} Object with a `remove` method.
62
- */
63
- capture: function (target, eventType, callback) {
64
- if (!target.addEventListener) {
65
- if ('production' !== process.env.NODE_ENV) {
66
- console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.');
67
- }
68
- return {
69
- remove: emptyFunction
70
- };
71
- } else {
72
- target.addEventListener(eventType, callback, true);
73
- return {
74
- remove: function () {
75
- target.removeEventListener(eventType, callback, true);
76
- }
77
- };
78
- }
79
- },
80
-
81
- registerDefault: function () {}
82
- };
83
-
84
- module.exports = EventListener;
@@ -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 ExecutionEnvironment
10
- */
11
-
12
- /*jslint evil: true */
13
-
14
- 'use strict';
15
-
16
- var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
17
-
18
- /**
19
- * Simple, lightweight module assisting with the detection and context of
20
- * Worker. Helps avoid circular dependencies and allows code to reason about
21
- * whether or not they are in a Worker, even if they never include the main
22
- * `ReactWorker` dependency.
23
- */
24
- var ExecutionEnvironment = {
25
-
26
- canUseDOM: canUseDOM,
27
-
28
- canUseWorkers: typeof Worker !== 'undefined',
29
-
30
- canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
31
-
32
- canUseViewport: canUseDOM && !!window.screen,
33
-
34
- isInWorker: !canUseDOM // For now, this is true - might change in the future.
35
-
36
- };
37
-
38
- module.exports = ExecutionEnvironment;
@@ -1,90 +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 ReactDOMClient
10
- */
11
-
12
- /* globals __REACT_DEVTOOLS_GLOBAL_HOOK__*/
13
-
14
- 'use strict';
15
-
16
- var ReactCurrentOwner = require("./ReactCurrentOwner");
17
- var ReactDOMTextComponent = require("./ReactDOMTextComponent");
18
- var ReactDefaultInjection = require("./ReactDefaultInjection");
19
- var ReactInstanceHandles = require("./ReactInstanceHandles");
20
- var ReactMount = require("./ReactMount");
21
- var ReactPerf = require("./ReactPerf");
22
- var ReactReconciler = require("./ReactReconciler");
23
- var ReactUpdates = require("./ReactUpdates");
24
-
25
- var findDOMNode = require("./findDOMNode");
26
- var renderSubtreeIntoContainer = require("./renderSubtreeIntoContainer");
27
- var warning = require("./warning");
28
-
29
- ReactDefaultInjection.inject();
30
-
31
- var render = ReactPerf.measure('React', 'render', ReactMount.render);
32
-
33
- var React = {
34
- findDOMNode: findDOMNode,
35
- render: render,
36
- unmountComponentAtNode: ReactMount.unmountComponentAtNode,
37
-
38
- /* eslint-disable camelcase */
39
- unstable_batchedUpdates: ReactUpdates.batchedUpdates,
40
- unstable_renderSubtreeIntoContainer: renderSubtreeIntoContainer
41
- };
42
-
43
- // Inject the runtime into a devtools global hook regardless of browser.
44
- // Allows for debugging when the hook is injected on the page.
45
- if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') {
46
- __REACT_DEVTOOLS_GLOBAL_HOOK__.inject({
47
- CurrentOwner: ReactCurrentOwner,
48
- InstanceHandles: ReactInstanceHandles,
49
- Mount: ReactMount,
50
- Reconciler: ReactReconciler,
51
- TextComponent: ReactDOMTextComponent
52
- });
53
- }
54
-
55
- if ('production' !== process.env.NODE_ENV) {
56
- var ExecutionEnvironment = require("./ExecutionEnvironment");
57
- if (ExecutionEnvironment.canUseDOM && window.top === window.self) {
58
-
59
- // If we're in Chrome, look for the devtools marker and provide a download
60
- // link if not installed.
61
- if (navigator.userAgent.indexOf('Chrome') > -1) {
62
- if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
63
- console.debug('Download the React DevTools for a better development experience: ' + 'https://fb.me/react-devtools');
64
- }
65
- }
66
-
67
- // If we're in IE8, check to see if we are in combatibility mode and provide
68
- // information on preventing compatibility mode
69
- var ieCompatibilityMode = document.documentMode && document.documentMode < 8;
70
-
71
- 'production' !== process.env.NODE_ENV ? warning(!ieCompatibilityMode, 'Internet Explorer is running in compatibility mode; please add the ' + 'following tag to your HTML to prevent this from happening: ' + '<meta http-equiv="X-UA-Compatible" content="IE=edge" />') : undefined;
72
-
73
- var expectedFeatures = [
74
- // shims
75
- Array.isArray, Array.prototype.every, Array.prototype.forEach, Array.prototype.indexOf, Array.prototype.map, Date.now, Function.prototype.bind, Object.keys, String.prototype.split, String.prototype.trim,
76
-
77
- // shams
78
- Object.create, Object.freeze];
79
-
80
- for (var i = 0; i < expectedFeatures.length; i++) {
81
- if (!expectedFeatures[i]) {
82
- console.error('One or more ES5 shim/shams expected by React are not available: ' + 'https://fb.me/react-warning-polyfills');
83
- break;
84
- }
85
- }
86
- }
87
- }
88
-
89
- module.exports = React;
90
- /* eslint-enable camelcase */
package/lib/camelize.js DELETED
@@ -1,32 +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 camelize
10
- * @typechecks
11
- */
12
-
13
- "use strict";
14
-
15
- var _hyphenPattern = /-(.)/g;
16
-
17
- /**
18
- * Camelcases a hyphenated string, for example:
19
- *
20
- * > camelize('background-color')
21
- * < "backgroundColor"
22
- *
23
- * @param {string} string
24
- * @return {string}
25
- */
26
- function camelize(string) {
27
- return string.replace(_hyphenPattern, function (_, character) {
28
- return character.toUpperCase();
29
- });
30
- }
31
-
32
- module.exports = camelize;
@@ -1,40 +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 camelizeStyleName
10
- * @typechecks
11
- */
12
-
13
- 'use strict';
14
-
15
- var camelize = require("./camelize");
16
-
17
- var msPattern = /^-ms-/;
18
-
19
- /**
20
- * Camelcases a hyphenated CSS property name, for example:
21
- *
22
- * > camelizeStyleName('background-color')
23
- * < "backgroundColor"
24
- * > camelizeStyleName('-moz-transition')
25
- * < "MozTransition"
26
- * > camelizeStyleName('-ms-transition')
27
- * < "msTransition"
28
- *
29
- * As Andi Smith suggests
30
- * (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
31
- * is converted to lowercase `ms`.
32
- *
33
- * @param {string} string
34
- * @return {string}
35
- */
36
- function camelizeStyleName(string) {
37
- return camelize(string.replace(msPattern, 'ms-'));
38
- }
39
-
40
- module.exports = camelizeStyleName;
@@ -1,55 +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 containsNode
10
- * @typechecks
11
- */
12
-
13
- 'use strict';
14
-
15
- var isTextNode = require("./isTextNode");
16
-
17
- /*jslint bitwise:true */
18
-
19
- /**
20
- * Checks if a given DOM node contains or is another DOM node.
21
- *
22
- * @param {?DOMNode} outerNode Outer DOM node.
23
- * @param {?DOMNode} innerNode Inner DOM node.
24
- * @return {boolean} True if `outerNode` contains or is `innerNode`.
25
- */
26
- function containsNode(_x, _x2) {
27
- var _again = true;
28
-
29
- _function: while (_again) {
30
- var outerNode = _x,
31
- innerNode = _x2;
32
- _again = false;
33
-
34
- if (!outerNode || !innerNode) {
35
- return false;
36
- } else if (outerNode === innerNode) {
37
- return true;
38
- } else if (isTextNode(outerNode)) {
39
- return false;
40
- } else if (isTextNode(innerNode)) {
41
- _x = outerNode;
42
- _x2 = innerNode.parentNode;
43
- _again = true;
44
- continue _function;
45
- } else if (outerNode.contains) {
46
- return outerNode.contains(innerNode);
47
- } else if (outerNode.compareDocumentPosition) {
48
- return !!(outerNode.compareDocumentPosition(innerNode) & 16);
49
- } else {
50
- return false;
51
- }
52
- }
53
- }
54
-
55
- module.exports = containsNode;
@@ -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