react 0.12.0 → 0.13.0-alpha.2

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 (153) hide show
  1. package/dist/JSXTransformer.js +2345 -910
  2. package/dist/react-with-addons.js +5273 -4111
  3. package/dist/react-with-addons.min.js +5 -6
  4. package/dist/react.js +4840 -3940
  5. package/dist/react.min.js +5 -6
  6. package/lib/AutoFocusMixin.js +1 -1
  7. package/lib/BeforeInputEventPlugin.js +389 -112
  8. package/lib/CSSProperty.js +6 -3
  9. package/lib/CSSPropertyOperations.js +21 -1
  10. package/lib/CallbackQueue.js +2 -2
  11. package/lib/ChangeEventPlugin.js +3 -3
  12. package/lib/ClientReactRootIndex.js +1 -1
  13. package/lib/DOMChildrenOperations.js +6 -4
  14. package/lib/DOMProperty.js +1 -1
  15. package/lib/DOMPropertyOperations.js +1 -1
  16. package/lib/Danger.js +7 -6
  17. package/lib/DefaultEventPluginOrder.js +1 -2
  18. package/lib/EnterLeaveEventPlugin.js +1 -1
  19. package/lib/EventConstants.js +1 -1
  20. package/lib/EventPluginHub.js +9 -7
  21. package/lib/EventPluginRegistry.js +1 -1
  22. package/lib/EventPluginUtils.js +1 -1
  23. package/lib/EventPropagators.js +1 -1
  24. package/lib/ExecutionEnvironment.js +2 -3
  25. package/lib/FallbackCompositionState.js +89 -0
  26. package/lib/HTMLDOMPropertyConfig.js +19 -7
  27. package/lib/LinkedStateMixin.js +1 -1
  28. package/lib/LinkedValueUtils.js +3 -3
  29. package/lib/LocalEventTrapMixin.js +1 -1
  30. package/lib/MobileSafariClickEventPlugin.js +1 -1
  31. package/lib/Object.assign.js +3 -1
  32. package/lib/PooledClass.js +1 -1
  33. package/lib/React.js +17 -50
  34. package/lib/ReactBrowserComponentMixin.js +3 -13
  35. package/lib/ReactBrowserEventEmitter.js +4 -6
  36. package/lib/ReactCSSTransitionGroup.js +4 -1
  37. package/lib/ReactCSSTransitionGroupChild.js +12 -2
  38. package/lib/ReactChildReconciler.js +121 -0
  39. package/lib/ReactChildren.js +10 -8
  40. package/lib/ReactClass.js +874 -0
  41. package/lib/ReactComponent.js +45 -286
  42. package/lib/ReactComponentBase.js +126 -0
  43. package/lib/ReactComponentBrowserEnvironment.js +10 -83
  44. package/lib/ReactComponentEnvironment.js +57 -0
  45. package/lib/ReactComponentWithPureRenderMixin.js +1 -1
  46. package/lib/ReactCompositeComponent.js +700 -1045
  47. package/lib/ReactContext.js +6 -2
  48. package/lib/ReactCurrentOwner.js +1 -1
  49. package/lib/ReactDOM.js +3 -8
  50. package/lib/ReactDOMButton.js +5 -6
  51. package/lib/ReactDOMComponent.js +120 -77
  52. package/lib/ReactDOMForm.js +5 -6
  53. package/lib/ReactDOMIDOperations.js +56 -74
  54. package/lib/ReactDOMImg.js +4 -6
  55. package/lib/ReactDOMInput.js +5 -6
  56. package/lib/ReactDOMOption.js +5 -6
  57. package/lib/ReactDOMSelect.js +57 -65
  58. package/lib/ReactDOMSelection.js +6 -2
  59. package/lib/ReactDOMTextComponent.js +124 -0
  60. package/lib/ReactDOMTextarea.js +5 -6
  61. package/lib/ReactDefaultBatchingStrategy.js +1 -1
  62. package/lib/ReactDefaultInjection.js +14 -8
  63. package/lib/ReactDefaultPerf.js +8 -7
  64. package/lib/ReactDefaultPerfAnalysis.js +1 -1
  65. package/lib/ReactElement.js +22 -15
  66. package/lib/ReactElementValidator.js +192 -53
  67. package/lib/ReactEmptyComponent.js +29 -11
  68. package/lib/ReactEventEmitterMixin.js +1 -1
  69. package/lib/ReactEventListener.js +3 -3
  70. package/lib/ReactInjection.js +7 -5
  71. package/lib/ReactInputSelection.js +3 -4
  72. package/lib/ReactInstanceHandles.js +3 -2
  73. package/lib/ReactInstanceMap.js +47 -0
  74. package/lib/ReactLink.js +1 -1
  75. package/lib/ReactMarkupChecksum.js +1 -1
  76. package/lib/ReactMount.js +202 -66
  77. package/lib/ReactMultiChild.js +44 -45
  78. package/lib/ReactMultiChildUpdateTypes.js +1 -1
  79. package/lib/ReactNativeComponent.js +47 -10
  80. package/lib/ReactOwner.js +4 -48
  81. package/lib/ReactPerf.js +21 -1
  82. package/lib/ReactPropTransferer.js +2 -57
  83. package/lib/ReactPropTypeLocationNames.js +1 -1
  84. package/lib/ReactPropTypeLocations.js +1 -1
  85. package/lib/ReactPropTypes.js +14 -22
  86. package/lib/ReactPutListenerQueue.js +1 -1
  87. package/lib/ReactReconcileTransaction.js +1 -1
  88. package/lib/ReactRef.js +96 -0
  89. package/lib/ReactRootIndex.js +1 -1
  90. package/lib/ReactServerRendering.js +5 -3
  91. package/lib/ReactServerRenderingTransaction.js +1 -1
  92. package/lib/ReactStateSetters.js +1 -1
  93. package/lib/ReactTestUtils.js +83 -26
  94. package/lib/ReactTransitionChildMapping.js +1 -1
  95. package/lib/ReactTransitionEvents.js +1 -1
  96. package/lib/ReactTransitionGroup.js +48 -7
  97. package/lib/ReactUpdates.js +46 -45
  98. package/lib/ReactWithAddons.js +1 -1
  99. package/lib/SVGDOMPropertyConfig.js +1 -1
  100. package/lib/SelectEventPlugin.js +3 -3
  101. package/lib/ServerReactRootIndex.js +1 -1
  102. package/lib/SimpleEventPlugin.js +1 -1
  103. package/lib/SyntheticClipboardEvent.js +1 -2
  104. package/lib/SyntheticCompositionEvent.js +1 -2
  105. package/lib/SyntheticDragEvent.js +1 -1
  106. package/lib/SyntheticEvent.js +11 -3
  107. package/lib/SyntheticFocusEvent.js +1 -1
  108. package/lib/SyntheticInputEvent.js +1 -2
  109. package/lib/SyntheticKeyboardEvent.js +1 -1
  110. package/lib/SyntheticMouseEvent.js +2 -4
  111. package/lib/SyntheticTouchEvent.js +1 -1
  112. package/lib/SyntheticUIEvent.js +1 -1
  113. package/lib/SyntheticWheelEvent.js +1 -1
  114. package/lib/Transaction.js +3 -3
  115. package/lib/ViewportMetrics.js +2 -5
  116. package/lib/accumulate.js +47 -0
  117. package/lib/accumulateInto.js +1 -1
  118. package/lib/adler32.js +1 -1
  119. package/lib/cloneWithProps.js +3 -3
  120. package/lib/copyProperties.js +2 -0
  121. package/lib/createFullPageComponent.js +3 -3
  122. package/lib/dangerousStyleValue.js +1 -1
  123. package/lib/escapeTextForBrowser.js +6 -6
  124. package/lib/findDOMNode.js +51 -0
  125. package/lib/flattenChildren.js +11 -22
  126. package/lib/forEachAccumulated.js +1 -1
  127. package/lib/getEventCharCode.js +1 -1
  128. package/lib/getEventKey.js +1 -1
  129. package/lib/getEventModifierState.js +1 -1
  130. package/lib/getEventTarget.js +1 -1
  131. package/lib/getIteratorFn.js +42 -0
  132. package/lib/getNodeForCharacterOffset.js +2 -2
  133. package/lib/getReactRootElementInContainer.js +1 -1
  134. package/lib/getTextContentAccessor.js +1 -1
  135. package/lib/instantiateReactComponent.js +89 -66
  136. package/lib/isEventSupported.js +1 -1
  137. package/lib/isNode.js +3 -4
  138. package/lib/isTextInputElement.js +2 -3
  139. package/lib/joinClasses.js +1 -1
  140. package/lib/keyMirror.js +1 -1
  141. package/lib/memoizeStringOnly.js +4 -5
  142. package/lib/onlyChild.js +1 -1
  143. package/lib/setInnerHTML.js +12 -1
  144. package/lib/shallowEqual.js +1 -1
  145. package/lib/shouldUpdateReactComponent.js +48 -6
  146. package/lib/traverseAllChildren.js +111 -55
  147. package/lib/update.js +1 -1
  148. package/lib/warning.js +9 -2
  149. package/package.json +1 -1
  150. package/lib/CompositionEventPlugin.js +0 -257
  151. package/lib/ReactLegacyElement.js +0 -243
  152. package/lib/ReactTextComponent.js +0 -104
  153. package/lib/deprecated.js +0 -47
@@ -1,104 +0,0 @@
1
- /**
2
- * Copyright 2013-2014, 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 ReactTextComponent
10
- * @typechecks static-only
11
- */
12
-
13
- "use strict";
14
-
15
- var DOMPropertyOperations = require("./DOMPropertyOperations");
16
- var ReactComponent = require("./ReactComponent");
17
- var ReactElement = require("./ReactElement");
18
-
19
- var assign = require("./Object.assign");
20
- var escapeTextForBrowser = require("./escapeTextForBrowser");
21
-
22
- /**
23
- * Text nodes violate a couple assumptions that React makes about components:
24
- *
25
- * - When mounting text into the DOM, adjacent text nodes are merged.
26
- * - Text nodes cannot be assigned a React root ID.
27
- *
28
- * This component is used to wrap strings in elements so that they can undergo
29
- * the same reconciliation that is applied to elements.
30
- *
31
- * TODO: Investigate representing React components in the DOM with text nodes.
32
- *
33
- * @class ReactTextComponent
34
- * @extends ReactComponent
35
- * @internal
36
- */
37
- var ReactTextComponent = function(props) {
38
- // This constructor and it's argument is currently used by mocks.
39
- };
40
-
41
- assign(ReactTextComponent.prototype, ReactComponent.Mixin, {
42
-
43
- /**
44
- * Creates the markup for this text node. This node is not intended to have
45
- * any features besides containing text content.
46
- *
47
- * @param {string} rootID DOM ID of the root node.
48
- * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
49
- * @param {number} mountDepth number of components in the owner hierarchy
50
- * @return {string} Markup for this text node.
51
- * @internal
52
- */
53
- mountComponent: function(rootID, transaction, mountDepth) {
54
- ReactComponent.Mixin.mountComponent.call(
55
- this,
56
- rootID,
57
- transaction,
58
- mountDepth
59
- );
60
-
61
- var escapedText = escapeTextForBrowser(this.props);
62
-
63
- if (transaction.renderToStaticMarkup) {
64
- // Normally we'd wrap this in a `span` for the reasons stated above, but
65
- // since this is a situation where React won't take over (static pages),
66
- // we can simply return the text as it is.
67
- return escapedText;
68
- }
69
-
70
- return (
71
- '<span ' + DOMPropertyOperations.createMarkupForID(rootID) + '>' +
72
- escapedText +
73
- '</span>'
74
- );
75
- },
76
-
77
- /**
78
- * Updates this component by updating the text content.
79
- *
80
- * @param {object} nextComponent Contains the next text content.
81
- * @param {ReactReconcileTransaction} transaction
82
- * @internal
83
- */
84
- receiveComponent: function(nextComponent, transaction) {
85
- var nextProps = nextComponent.props;
86
- if (nextProps !== this.props) {
87
- this.props = nextProps;
88
- ReactComponent.BackendIDOperations.updateTextContentByID(
89
- this._rootNodeID,
90
- nextProps
91
- );
92
- }
93
- }
94
-
95
- });
96
-
97
- var ReactTextComponentFactory = function(text) {
98
- // Bypass validation and configuration
99
- return new ReactElement(ReactTextComponent, null, null, null, null, text);
100
- };
101
-
102
- ReactTextComponentFactory.type = ReactTextComponent;
103
-
104
- module.exports = ReactTextComponentFactory;
package/lib/deprecated.js DELETED
@@ -1,47 +0,0 @@
1
- /**
2
- * Copyright 2013-2014, 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 deprecated
10
- */
11
-
12
- var assign = require("./Object.assign");
13
- var warning = require("./warning");
14
-
15
- /**
16
- * This will log a single deprecation notice per function and forward the call
17
- * on to the new API.
18
- *
19
- * @param {string} namespace The namespace of the call, eg 'React'
20
- * @param {string} oldName The old function name, eg 'renderComponent'
21
- * @param {string} newName The new function name, eg 'render'
22
- * @param {*} ctx The context this forwarded call should run in
23
- * @param {function} fn The function to forward on to
24
- * @return {*} Will be the value as returned from `fn`
25
- */
26
- function deprecated(namespace, oldName, newName, ctx, fn) {
27
- var warned = false;
28
- if ("production" !== process.env.NODE_ENV) {
29
- var newFn = function() {
30
- ("production" !== process.env.NODE_ENV ? warning(
31
- warned,
32
- (namespace + "." + oldName + " will be deprecated in a future version. ") +
33
- ("Use " + namespace + "." + newName + " instead.")
34
- ) : null);
35
- warned = true;
36
- return fn.apply(ctx, arguments);
37
- };
38
- newFn.displayName = (namespace + "_" + oldName);
39
- // We need to make sure all properties of the original fn are copied over.
40
- // In particular, this is needed to support PropTypes
41
- return assign(newFn, fn);
42
- }
43
-
44
- return fn;
45
- }
46
-
47
- module.exports = deprecated;