react 0.13.0 → 0.14.0-alpha1

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 (194) hide show
  1. package/README.md +1 -1
  2. package/addons.js +7 -0
  3. package/addons/CSSTransitionGroup.js +1 -0
  4. package/addons/LinkedStateMixin.js +1 -0
  5. package/addons/Perf.js +1 -0
  6. package/addons/PureRenderMixin.js +1 -0
  7. package/addons/TestUtils.js +1 -0
  8. package/addons/TransitionGroup.js +1 -0
  9. package/addons/batchedUpdates.js +1 -0
  10. package/addons/cloneWithProps.js +1 -0
  11. package/addons/createFragment.js +1 -0
  12. package/addons/renderSubtreeIntoContainer.js +1 -0
  13. package/addons/shallowCompare.js +1 -0
  14. package/addons/update.js +1 -0
  15. package/dist/JSXTransformer.js +3336 -1671
  16. package/dist/react-with-addons.js +3134 -5113
  17. package/dist/react-with-addons.min.js +6 -6
  18. package/dist/react.js +2812 -4567
  19. package/dist/react.min.js +5 -5
  20. package/lib/AutoFocusMixin.js +4 -3
  21. package/lib/BeforeInputEventPlugin.js +30 -118
  22. package/lib/CSSCore.js +12 -23
  23. package/lib/CSSProperty.js +9 -4
  24. package/lib/CSSPropertyOperations.js +14 -30
  25. package/lib/CallbackQueue.js +7 -10
  26. package/lib/ChangeEventPlugin.js +24 -88
  27. package/lib/ClientReactRootIndex.js +2 -2
  28. package/lib/DOMChildrenOperations.js +13 -33
  29. package/lib/DOMProperty.js +41 -65
  30. package/lib/DOMPropertyOperations.js +30 -51
  31. package/lib/Danger.js +19 -60
  32. package/lib/DefaultEventPluginOrder.js +2 -12
  33. package/lib/EnterLeaveEventPlugin.js +11 -33
  34. package/lib/EventConstants.js +2 -2
  35. package/lib/EventListener.js +11 -13
  36. package/lib/EventPluginHub.js +44 -47
  37. package/lib/EventPluginRegistry.js +18 -74
  38. package/lib/EventPluginUtils.js +27 -38
  39. package/lib/EventPropagators.js +23 -26
  40. package/lib/ExecutionEnvironment.js +4 -8
  41. package/lib/FallbackCompositionState.js +3 -3
  42. package/lib/HTMLDOMPropertyConfig.js +12 -18
  43. package/lib/LinkedStateMixin.js +3 -6
  44. package/lib/LinkedValueUtils.js +34 -64
  45. package/lib/LocalEventTrapMixin.js +9 -16
  46. package/lib/Object.assign.js +1 -1
  47. package/lib/PooledClass.js +8 -11
  48. package/lib/React.js +20 -38
  49. package/lib/ReactBrowserComponentMixin.js +9 -2
  50. package/lib/ReactBrowserEventEmitter.js +26 -82
  51. package/lib/ReactCSSTransitionGroup.js +13 -24
  52. package/lib/ReactCSSTransitionGroupChild.js +18 -28
  53. package/lib/ReactChildReconciler.js +11 -19
  54. package/lib/ReactChildren.js +7 -16
  55. package/lib/ReactClass.js +78 -231
  56. package/lib/ReactComponent.js +17 -33
  57. package/lib/ReactComponentBrowserEnvironment.js +4 -6
  58. package/lib/ReactComponentEnvironment.js +6 -12
  59. package/lib/ReactComponentWithPureRenderMixin.js +4 -5
  60. package/lib/ReactCompositeComponent.js +85 -297
  61. package/lib/ReactContext.js +2 -44
  62. package/lib/ReactCurrentOwner.js +1 -3
  63. package/lib/ReactDOM.js +4 -2
  64. package/lib/ReactDOMButton.js +3 -4
  65. package/lib/ReactDOMComponent.js +185 -146
  66. package/lib/ReactDOMForm.js +3 -3
  67. package/lib/ReactDOMIDOperations.js +11 -20
  68. package/lib/ReactDOMIframe.js +3 -3
  69. package/lib/ReactDOMImg.js +3 -3
  70. package/lib/ReactDOMInput.js +22 -35
  71. package/lib/ReactDOMOption.js +52 -10
  72. package/lib/ReactDOMSelect.js +53 -29
  73. package/lib/ReactDOMSelection.js +5 -20
  74. package/lib/ReactDOMTextComponent.js +17 -18
  75. package/lib/ReactDOMTextarea.js +15 -27
  76. package/lib/ReactDefaultBatchingStrategy.js +9 -13
  77. package/lib/ReactDefaultInjection.js +21 -40
  78. package/lib/ReactDefaultPerf.js +41 -72
  79. package/lib/ReactDefaultPerfAnalysis.js +8 -14
  80. package/lib/ReactElement.js +35 -72
  81. package/lib/ReactElementValidator.js +51 -110
  82. package/lib/ReactEmptyComponent.js +7 -11
  83. package/lib/ReactErrorUtils.js +2 -2
  84. package/lib/ReactEventEmitterMixin.js +3 -12
  85. package/lib/ReactEventListener.js +16 -38
  86. package/lib/ReactFragment.js +23 -54
  87. package/lib/ReactInjection.js +1 -1
  88. package/lib/ReactInputSelection.js +11 -21
  89. package/lib/ReactInstanceHandles.js +27 -57
  90. package/lib/ReactInstanceMap.js +5 -5
  91. package/lib/ReactLifeCycle.js +1 -1
  92. package/lib/ReactLink.js +2 -4
  93. package/lib/ReactMarkupChecksum.js +5 -10
  94. package/lib/ReactMount.js +136 -260
  95. package/lib/ReactMultiChild.js +19 -45
  96. package/lib/ReactMultiChildUpdateTypes.js +1 -1
  97. package/lib/ReactNativeComponent.js +7 -11
  98. package/lib/ReactOwner.js +7 -24
  99. package/lib/ReactPerf.js +8 -12
  100. package/lib/ReactPropTransferer.js +4 -4
  101. package/lib/ReactPropTypeLocationNames.js +2 -2
  102. package/lib/ReactPropTypeLocations.js +1 -1
  103. package/lib/ReactPropTypes.js +13 -46
  104. package/lib/ReactReconcileTransaction.js +9 -34
  105. package/lib/ReactReconciler.js +9 -19
  106. package/lib/ReactRef.js +5 -8
  107. package/lib/ReactRootIndex.js +2 -2
  108. package/lib/ReactServerRendering.js +7 -15
  109. package/lib/ReactServerRenderingTransaction.js +7 -32
  110. package/lib/ReactStateSetters.js +6 -6
  111. package/lib/ReactTestUtils.js +94 -166
  112. package/lib/ReactTransitionChildMapping.js +5 -7
  113. package/lib/ReactTransitionEvents.js +5 -5
  114. package/lib/ReactTransitionGroup.js +30 -52
  115. package/lib/ReactUpdateQueue.js +27 -90
  116. package/lib/ReactUpdates.js +27 -79
  117. package/lib/ReactWithAddons.js +7 -6
  118. package/lib/SVGDOMPropertyConfig.js +41 -2
  119. package/lib/SelectEventPlugin.js +28 -29
  120. package/lib/ServerReactRootIndex.js +2 -2
  121. package/lib/SimpleEventPlugin.js +136 -128
  122. package/lib/SyntheticClipboardEvent.js +3 -7
  123. package/lib/SyntheticCompositionEvent.js +3 -9
  124. package/lib/SyntheticDragEvent.js +1 -1
  125. package/lib/SyntheticEvent.js +8 -10
  126. package/lib/SyntheticFocusEvent.js +1 -1
  127. package/lib/SyntheticInputEvent.js +3 -9
  128. package/lib/SyntheticKeyboardEvent.js +4 -4
  129. package/lib/SyntheticMouseEvent.js +8 -14
  130. package/lib/SyntheticTouchEvent.js +1 -1
  131. package/lib/SyntheticUIEvent.js +3 -3
  132. package/lib/SyntheticWheelEvent.js +11 -15
  133. package/lib/Transaction.js +12 -24
  134. package/lib/ViewportMetrics.js +2 -2
  135. package/lib/accumulateInto.js +2 -5
  136. package/lib/adler32.js +2 -2
  137. package/lib/camelize.js +4 -2
  138. package/lib/camelizeStyleName.js +2 -2
  139. package/lib/cloneWithProps.js +5 -11
  140. package/lib/containsNode.js +29 -16
  141. package/lib/createArrayFromMixed.js +17 -16
  142. package/lib/createFullPageComponent.js +5 -11
  143. package/lib/createNodesFromMarkup.js +6 -8
  144. package/lib/dangerousStyleValue.js +2 -3
  145. package/lib/emptyFunction.js +10 -4
  146. package/lib/emptyObject.js +1 -1
  147. package/lib/escapeTextContentForBrowser.js +1 -1
  148. package/lib/findDOMNode.js +5 -24
  149. package/lib/flattenChildren.js +4 -10
  150. package/lib/focusNode.js +2 -3
  151. package/lib/forEachAccumulated.js +2 -2
  152. package/lib/getActiveElement.js +4 -2
  153. package/lib/getEventCharCode.js +1 -1
  154. package/lib/getEventKey.js +1 -1
  155. package/lib/getEventModifierState.js +1 -1
  156. package/lib/getEventTarget.js +1 -1
  157. package/lib/getIteratorFn.js +2 -4
  158. package/lib/getMarkupWrap.js +7 -5
  159. package/lib/getNodeForCharacterOffset.js +1 -1
  160. package/lib/getTextContentAccessor.js +2 -4
  161. package/lib/getUnboundedScrollPosition.js +1 -1
  162. package/lib/hyphenate.js +3 -1
  163. package/lib/hyphenateStyleName.js +2 -2
  164. package/lib/instantiateReactComponent.js +14 -37
  165. package/lib/invariant.js +8 -12
  166. package/lib/isEventSupported.js +7 -10
  167. package/lib/isNode.js +4 -6
  168. package/lib/isTextInputElement.js +2 -4
  169. package/lib/isTextNode.js +3 -1
  170. package/lib/joinClasses.js +2 -2
  171. package/lib/keyMirror.js +3 -6
  172. package/lib/keyOf.js +4 -3
  173. package/lib/mapObject.js +1 -1
  174. package/lib/memoizeStringOnly.js +2 -2
  175. package/lib/onlyChild.js +2 -5
  176. package/lib/performance.js +2 -5
  177. package/lib/performanceNow.js +3 -1
  178. package/lib/quoteAttributeValueForBrowser.js +1 -1
  179. package/lib/renderSubtreeIntoContainer.js +16 -0
  180. package/lib/setInnerHTML.js +11 -8
  181. package/lib/setTextContent.js +3 -3
  182. package/lib/shallowCompare.js +24 -0
  183. package/lib/shallowEqual.js +17 -11
  184. package/lib/shouldUpdateReactComponent.js +3 -64
  185. package/lib/toArray.js +8 -19
  186. package/lib/traverseAllChildren.js +19 -82
  187. package/lib/update.js +33 -90
  188. package/lib/validateDOMNesting.js +264 -0
  189. package/lib/warning.js +17 -15
  190. package/package.json +3 -3
  191. package/lib/MobileSafariClickEventPlugin.js +0 -56
  192. package/lib/ReactPutListenerQueue.js +0 -54
  193. package/lib/cx.js +0 -52
  194. package/lib/getReactRootElementInContainer.js +0 -33
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "react",
3
3
  "description": "React is a JavaScript library for building user interfaces.",
4
- "version": "0.13.0",
4
+ "version": "0.14.0-alpha1",
5
5
  "keywords": [
6
6
  "react"
7
7
  ],
8
8
  "homepage": "https://github.com/facebook/react/tree/master/npm-react",
9
- "bugs": "https://github.com/facebook/react/issues?labels=react-core",
9
+ "bugs": "https://github.com/facebook/react/issues",
10
10
  "license": "BSD-3-Clause",
11
11
  "files": [
12
- "README.md",
13
12
  "addons.js",
14
13
  "react.js",
14
+ "addons/",
15
15
  "dist/",
16
16
  "lib/"
17
17
  ],
@@ -1,56 +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 MobileSafariClickEventPlugin
10
- * @typechecks static-only
11
- */
12
-
13
- 'use strict';
14
-
15
- var EventConstants = require("./EventConstants");
16
-
17
- var emptyFunction = require("./emptyFunction");
18
-
19
- var topLevelTypes = EventConstants.topLevelTypes;
20
-
21
- /**
22
- * Mobile Safari does not fire properly bubble click events on non-interactive
23
- * elements, which means delegated click listeners do not fire. The workaround
24
- * for this bug involves attaching an empty click listener on the target node.
25
- *
26
- * This particular plugin works around the bug by attaching an empty click
27
- * listener on `touchstart` (which does fire on every element).
28
- */
29
- var MobileSafariClickEventPlugin = {
30
-
31
- eventTypes: null,
32
-
33
- /**
34
- * @param {string} topLevelType Record from `EventConstants`.
35
- * @param {DOMEventTarget} topLevelTarget The listening component root node.
36
- * @param {string} topLevelTargetID ID of `topLevelTarget`.
37
- * @param {object} nativeEvent Native browser event.
38
- * @return {*} An accumulation of synthetic events.
39
- * @see {EventPluginHub.extractEvents}
40
- */
41
- extractEvents: function(
42
- topLevelType,
43
- topLevelTarget,
44
- topLevelTargetID,
45
- nativeEvent) {
46
- if (topLevelType === topLevelTypes.topTouchStart) {
47
- var target = nativeEvent.target;
48
- if (target && !target.onclick) {
49
- target.onclick = emptyFunction;
50
- }
51
- }
52
- }
53
-
54
- };
55
-
56
- module.exports = MobileSafariClickEventPlugin;
@@ -1,54 +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 ReactPutListenerQueue
10
- */
11
-
12
- 'use strict';
13
-
14
- var PooledClass = require("./PooledClass");
15
- var ReactBrowserEventEmitter = require("./ReactBrowserEventEmitter");
16
-
17
- var assign = require("./Object.assign");
18
-
19
- function ReactPutListenerQueue() {
20
- this.listenersToPut = [];
21
- }
22
-
23
- assign(ReactPutListenerQueue.prototype, {
24
- enqueuePutListener: function(rootNodeID, propKey, propValue) {
25
- this.listenersToPut.push({
26
- rootNodeID: rootNodeID,
27
- propKey: propKey,
28
- propValue: propValue
29
- });
30
- },
31
-
32
- putListeners: function() {
33
- for (var i = 0; i < this.listenersToPut.length; i++) {
34
- var listenerToPut = this.listenersToPut[i];
35
- ReactBrowserEventEmitter.putListener(
36
- listenerToPut.rootNodeID,
37
- listenerToPut.propKey,
38
- listenerToPut.propValue
39
- );
40
- }
41
- },
42
-
43
- reset: function() {
44
- this.listenersToPut.length = 0;
45
- },
46
-
47
- destructor: function() {
48
- this.reset();
49
- }
50
- });
51
-
52
- PooledClass.addPoolingTo(ReactPutListenerQueue);
53
-
54
- module.exports = ReactPutListenerQueue;
package/lib/cx.js DELETED
@@ -1,52 +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 cx
10
- */
11
-
12
- /**
13
- * This function is used to mark string literals representing CSS class names
14
- * so that they can be transformed statically. This allows for modularization
15
- * and minification of CSS class names.
16
- *
17
- * In static_upstream, this function is actually implemented, but it should
18
- * eventually be replaced with something more descriptive, and the transform
19
- * that is used in the main stack should be ported for use elsewhere.
20
- *
21
- * @param string|object className to modularize, or an object of key/values.
22
- * In the object case, the values are conditions that
23
- * determine if the className keys should be included.
24
- * @param [string ...] Variable list of classNames in the string case.
25
- * @return string Renderable space-separated CSS className.
26
- */
27
-
28
- 'use strict';
29
- var warning = require("./warning");
30
-
31
- var warned = false;
32
-
33
- function cx(classNames) {
34
- if ("production" !== process.env.NODE_ENV) {
35
- ("production" !== process.env.NODE_ENV ? warning(
36
- warned,
37
- 'React.addons.classSet will be deprecated in a future version. See ' +
38
- 'http://fb.me/react-addons-classset'
39
- ) : null);
40
- warned = true;
41
- }
42
-
43
- if (typeof classNames == 'object') {
44
- return Object.keys(classNames).filter(function(className) {
45
- return classNames[className];
46
- }).join(' ');
47
- } else {
48
- return Array.prototype.join.call(arguments, ' ');
49
- }
50
- }
51
-
52
- module.exports = cx;
@@ -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 getReactRootElementInContainer
10
- */
11
-
12
- 'use strict';
13
-
14
- var DOC_NODE_TYPE = 9;
15
-
16
- /**
17
- * @param {DOMElement|DOMDocument} container DOM element that may contain
18
- * a React component
19
- * @return {?*} DOM element that may have the reactRoot ID, or null.
20
- */
21
- function getReactRootElementInContainer(container) {
22
- if (!container) {
23
- return null;
24
- }
25
-
26
- if (container.nodeType === DOC_NODE_TYPE) {
27
- return container.documentElement;
28
- } else {
29
- return container.firstChild;
30
- }
31
- }
32
-
33
- module.exports = getReactRootElementInContainer;