react 0.13.3 → 0.14.0-beta1

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 (189) hide show
  1. package/README.md +5 -2
  2. package/addons.js +7 -0
  3. package/dist/JSXTransformer.js +4101 -2432
  4. package/dist/react-with-addons.js +4389 -6277
  5. package/dist/react-with-addons.min.js +6 -8
  6. package/dist/react.js +4028 -5697
  7. package/dist/react.min.js +5 -6
  8. package/lib/{AutoFocusMixin.js → AutoFocusUtils.js} +16 -5
  9. package/lib/BeforeInputEventPlugin.js +30 -118
  10. package/lib/CSSCore.js +12 -23
  11. package/lib/CSSProperty.js +4 -3
  12. package/lib/CSSPropertyOperations.js +14 -30
  13. package/lib/CallbackQueue.js +7 -10
  14. package/lib/ChangeEventPlugin.js +26 -88
  15. package/lib/ClientReactRootIndex.js +2 -2
  16. package/lib/DOMChildrenOperations.js +13 -33
  17. package/lib/DOMProperty.js +86 -147
  18. package/lib/DOMPropertyOperations.js +91 -67
  19. package/lib/Danger.js +19 -62
  20. package/lib/DefaultEventPluginOrder.js +2 -12
  21. package/lib/EnterLeaveEventPlugin.js +11 -33
  22. package/lib/EventConstants.js +2 -2
  23. package/lib/EventListener.js +11 -13
  24. package/lib/EventPluginHub.js +44 -47
  25. package/lib/EventPluginRegistry.js +18 -74
  26. package/lib/EventPluginUtils.js +33 -44
  27. package/lib/EventPropagators.js +23 -26
  28. package/lib/ExecutionEnvironment.js +4 -8
  29. package/lib/FallbackCompositionState.js +3 -3
  30. package/lib/HTMLDOMPropertyConfig.js +15 -20
  31. package/lib/LinkedStateMixin.js +3 -6
  32. package/lib/LinkedValueUtils.js +71 -89
  33. package/lib/Object.assign.js +1 -1
  34. package/lib/PooledClass.js +20 -11
  35. package/lib/React.js +9 -129
  36. package/lib/ReactBrowserComponentMixin.js +9 -2
  37. package/lib/ReactBrowserEventEmitter.js +26 -82
  38. package/lib/ReactCSSTransitionGroup.js +13 -24
  39. package/lib/ReactCSSTransitionGroupChild.js +26 -28
  40. package/lib/ReactChildReconciler.js +11 -19
  41. package/lib/ReactChildren.js +24 -31
  42. package/lib/ReactClass.js +96 -267
  43. package/lib/ReactComponent.js +28 -57
  44. package/lib/ReactComponentBrowserEnvironment.js +4 -8
  45. package/lib/ReactComponentEnvironment.js +6 -12
  46. package/lib/ReactComponentWithPureRenderMixin.js +6 -7
  47. package/lib/ReactCompositeComponent.js +115 -381
  48. package/lib/ReactCurrentOwner.js +1 -3
  49. package/lib/ReactDOM.js +4 -2
  50. package/lib/ReactDOMButton.js +16 -28
  51. package/lib/ReactDOMClient.js +90 -0
  52. package/lib/ReactDOMComponent.js +468 -156
  53. package/lib/ReactDOMIDOperations.js +25 -22
  54. package/lib/ReactDOMInput.js +79 -108
  55. package/lib/ReactDOMOption.js +58 -20
  56. package/lib/ReactDOMSelect.js +95 -83
  57. package/lib/ReactDOMSelection.js +5 -20
  58. package/lib/ReactDOMServer.js +24 -0
  59. package/lib/ReactDOMTextComponent.js +17 -18
  60. package/lib/ReactDOMTextarea.js +44 -69
  61. package/lib/ReactDefaultBatchingStrategy.js +9 -13
  62. package/lib/ReactDefaultInjection.js +20 -76
  63. package/lib/ReactDefaultPerf.js +36 -69
  64. package/lib/ReactDefaultPerfAnalysis.js +8 -14
  65. package/lib/ReactElement.js +26 -120
  66. package/lib/ReactElementValidator.js +56 -192
  67. package/lib/ReactEmptyComponent.js +7 -11
  68. package/lib/ReactErrorUtils.js +3 -3
  69. package/lib/ReactEventEmitterMixin.js +3 -13
  70. package/lib/ReactEventListener.js +58 -40
  71. package/lib/ReactFragment.js +33 -59
  72. package/lib/ReactInjection.js +1 -1
  73. package/lib/ReactInputSelection.js +14 -23
  74. package/lib/ReactInstanceHandles.js +29 -58
  75. package/lib/ReactInstanceMap.js +5 -5
  76. package/lib/ReactIsomorphic.js +70 -0
  77. package/lib/ReactLink.js +2 -4
  78. package/lib/ReactMarkupChecksum.js +5 -10
  79. package/lib/ReactMount.js +142 -285
  80. package/lib/ReactMultiChild.js +19 -45
  81. package/lib/ReactMultiChildUpdateTypes.js +1 -1
  82. package/lib/ReactNativeComponent.js +6 -15
  83. package/lib/ReactNoopUpdateQueue.js +118 -0
  84. package/lib/ReactOwner.js +7 -24
  85. package/lib/ReactPerf.js +8 -12
  86. package/lib/ReactPropTransferer.js +4 -4
  87. package/lib/ReactPropTypeLocationNames.js +2 -2
  88. package/lib/ReactPropTypeLocations.js +1 -1
  89. package/lib/ReactPropTypes.js +41 -61
  90. package/lib/ReactReconcileTransaction.js +11 -36
  91. package/lib/ReactReconciler.js +14 -26
  92. package/lib/ReactRef.js +5 -8
  93. package/lib/ReactRootIndex.js +2 -2
  94. package/lib/ReactServerBatchingStrategy.js +23 -0
  95. package/lib/ReactServerRendering.js +20 -15
  96. package/lib/ReactServerRenderingTransaction.js +9 -34
  97. package/lib/ReactStateSetters.js +6 -6
  98. package/lib/ReactTestUtils.js +137 -190
  99. package/lib/ReactTransitionChildMapping.js +5 -7
  100. package/lib/ReactTransitionEvents.js +5 -5
  101. package/lib/ReactTransitionGroup.js +30 -52
  102. package/lib/ReactUpdateQueue.js +69 -107
  103. package/lib/ReactUpdates.js +26 -81
  104. package/lib/ReactWithAddons.js +5 -6
  105. package/lib/SVGDOMPropertyConfig.js +39 -4
  106. package/lib/SelectEventPlugin.js +31 -33
  107. package/lib/ServerReactRootIndex.js +2 -2
  108. package/lib/SimpleEventPlugin.js +138 -130
  109. package/lib/SyntheticClipboardEvent.js +5 -9
  110. package/lib/SyntheticCompositionEvent.js +4 -10
  111. package/lib/SyntheticDragEvent.js +3 -3
  112. package/lib/SyntheticEvent.js +14 -15
  113. package/lib/SyntheticFocusEvent.js +3 -3
  114. package/lib/SyntheticInputEvent.js +4 -10
  115. package/lib/SyntheticKeyboardEvent.js +6 -6
  116. package/lib/SyntheticMouseEvent.js +10 -16
  117. package/lib/SyntheticTouchEvent.js +3 -3
  118. package/lib/SyntheticUIEvent.js +5 -5
  119. package/lib/SyntheticWheelEvent.js +13 -17
  120. package/lib/Transaction.js +22 -28
  121. package/lib/ViewportMetrics.js +2 -2
  122. package/lib/accumulateInto.js +2 -5
  123. package/lib/adler32.js +2 -4
  124. package/lib/camelize.js +4 -2
  125. package/lib/camelizeStyleName.js +2 -2
  126. package/lib/cloneWithProps.js +6 -12
  127. package/lib/containsNode.js +29 -16
  128. package/lib/createArrayFromMixed.js +17 -16
  129. package/lib/createNodesFromMarkup.js +6 -8
  130. package/lib/dangerousStyleValue.js +2 -3
  131. package/lib/deprecated.js +47 -0
  132. package/lib/emptyFunction.js +10 -4
  133. package/lib/emptyObject.js +1 -1
  134. package/lib/escapeTextContentForBrowser.js +1 -1
  135. package/lib/findDOMNode.js +7 -27
  136. package/lib/flattenChildren.js +4 -10
  137. package/lib/focusNode.js +2 -3
  138. package/lib/forEachAccumulated.js +3 -3
  139. package/lib/getActiveElement.js +4 -2
  140. package/lib/getEventCharCode.js +2 -2
  141. package/lib/getEventKey.js +1 -1
  142. package/lib/getEventModifierState.js +1 -2
  143. package/lib/getEventTarget.js +1 -1
  144. package/lib/getIteratorFn.js +2 -4
  145. package/lib/getMarkupWrap.js +18 -40
  146. package/lib/getNodeForCharacterOffset.js +1 -1
  147. package/lib/getTextContentAccessor.js +2 -4
  148. package/lib/getUnboundedScrollPosition.js +1 -1
  149. package/lib/hyphenate.js +3 -1
  150. package/lib/hyphenateStyleName.js +2 -2
  151. package/lib/instantiateReactComponent.js +23 -43
  152. package/lib/invariant.js +8 -12
  153. package/lib/isEventSupported.js +7 -10
  154. package/lib/isNode.js +4 -6
  155. package/lib/isTextInputElement.js +3 -4
  156. package/lib/isTextNode.js +3 -1
  157. package/lib/joinClasses.js +3 -3
  158. package/lib/keyMirror.js +3 -6
  159. package/lib/keyOf.js +4 -3
  160. package/lib/mapObject.js +1 -1
  161. package/lib/memoizeStringOnly.js +2 -2
  162. package/lib/onlyChild.js +2 -5
  163. package/lib/performance.js +2 -5
  164. package/lib/performanceNow.js +3 -1
  165. package/lib/quoteAttributeValueForBrowser.js +1 -1
  166. package/lib/renderSubtreeIntoContainer.js +16 -0
  167. package/lib/setInnerHTML.js +11 -8
  168. package/lib/setTextContent.js +3 -3
  169. package/lib/shallowCompare.js +24 -0
  170. package/lib/shallowEqual.js +17 -11
  171. package/lib/shouldUpdateReactComponent.js +3 -64
  172. package/lib/toArray.js +8 -19
  173. package/lib/traverseAllChildren.js +23 -90
  174. package/lib/update.js +25 -85
  175. package/lib/validateDOMNesting.js +363 -0
  176. package/lib/warning.js +15 -17
  177. package/package.json +3 -3
  178. package/react.js +53 -1
  179. package/lib/LocalEventTrapMixin.js +0 -53
  180. package/lib/MobileSafariClickEventPlugin.js +0 -56
  181. package/lib/ReactContext.js +0 -74
  182. package/lib/ReactDOMForm.js +0 -47
  183. package/lib/ReactDOMIframe.js +0 -43
  184. package/lib/ReactDOMImg.js +0 -44
  185. package/lib/ReactLifeCycle.js +0 -35
  186. package/lib/ReactPutListenerQueue.js +0 -54
  187. package/lib/createFullPageComponent.js +0 -58
  188. package/lib/cx.js +0 -52
  189. package/lib/getReactRootElementInContainer.js +0 -33
package/lib/warning.js CHANGED
@@ -9,7 +9,7 @@
9
9
  * @providesModule warning
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
14
  var emptyFunction = require("./emptyFunction");
15
15
 
@@ -22,20 +22,14 @@ var emptyFunction = require("./emptyFunction");
22
22
 
23
23
  var warning = emptyFunction;
24
24
 
25
- if ("production" !== process.env.NODE_ENV) {
26
- warning = function(condition, format ) {for (var args=[],$__0=2,$__1=arguments.length;$__0<$__1;$__0++) args.push(arguments[$__0]);
27
- if (format === undefined) {
28
- throw new Error(
29
- '`warning(condition, format, ...args)` requires a warning ' +
30
- 'message argument'
31
- );
25
+ if ('production' !== process.env.NODE_ENV) {
26
+ warning = function (condition, format) {
27
+ for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
28
+ args[_key - 2] = arguments[_key];
32
29
  }
33
30
 
34
- if (format.length < 10 || /^[s\W]*$/.test(format)) {
35
- throw new Error(
36
- 'The warning format should be able to uniquely identify this ' +
37
- 'warning. Please, use a more descriptive format than: ' + format
38
- );
31
+ if (format === undefined) {
32
+ throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
39
33
  }
40
34
 
41
35
  if (format.indexOf('Failed Composite propType: ') === 0) {
@@ -44,16 +38,20 @@ if ("production" !== process.env.NODE_ENV) {
44
38
 
45
39
  if (!condition) {
46
40
  var argIndex = 0;
47
- var message = 'Warning: ' + format.replace(/%s/g, function() {return args[argIndex++];});
48
- console.warn(message);
41
+ var message = 'Warning: ' + format.replace(/%s/g, function () {
42
+ return args[argIndex++];
43
+ });
44
+ if (typeof console !== 'undefined') {
45
+ console.error(message);
46
+ }
49
47
  try {
50
48
  // --- Welcome to debugging React ---
51
49
  // This error was thrown as a convenience so that you can use this stack
52
50
  // to find the callsite that caused this warning to fire.
53
51
  throw new Error(message);
54
- } catch(x) {}
52
+ } catch (x) {}
55
53
  }
56
54
  };
57
55
  }
58
56
 
59
- module.exports = warning;
57
+ module.exports = warning;
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.3",
4
+ "version": "0.14.0-beta1",
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
  ],
package/react.js CHANGED
@@ -1 +1,53 @@
1
- module.exports = require('./lib/React');
1
+ 'use strict';
2
+
3
+ var React = require('./lib/React');
4
+
5
+ var assign = require('./lib/Object.assign');
6
+ var deprecated = require('./lib/deprecated');
7
+
8
+ // We want to warn once when any of these methods are used.
9
+ if (process.env.NODE_ENV !== 'production') {
10
+ var deprecations = {
11
+ // ReactDOMClient
12
+ findDOMNode: deprecated(
13
+ 'findDOMNode',
14
+ 'react-dom',
15
+ React,
16
+ React.findDOMNode
17
+ ),
18
+ render: deprecated(
19
+ 'render',
20
+ 'react-dom',
21
+ React,
22
+ React.render
23
+ ),
24
+ unmountComponentAtNode: deprecated(
25
+ 'unmountComponentAtNode',
26
+ 'react-dom',
27
+ React,
28
+ React.unmountComponentAtNode
29
+ ),
30
+ // ReactDOMServer
31
+ renderToString: deprecated(
32
+ 'renderToString',
33
+ 'react-dom/server',
34
+ React,
35
+ React.renderToString
36
+ ),
37
+ renderToStaticMarkup: deprecated(
38
+ 'renderToStaticMarkup',
39
+ 'react-dom/server',
40
+ React,
41
+ React.renderToStaticMarkup
42
+ ),
43
+ };
44
+ // Export a wrapped object. We'll use assign and take advantage of the fact
45
+ // that this will override the original methods in React.
46
+ module.exports = assign(
47
+ {},
48
+ React,
49
+ deprecations
50
+ );
51
+ } else {
52
+ module.exports = React;
53
+ }
@@ -1,53 +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 LocalEventTrapMixin
10
- */
11
-
12
- 'use strict';
13
-
14
- var ReactBrowserEventEmitter = require("./ReactBrowserEventEmitter");
15
-
16
- var accumulateInto = require("./accumulateInto");
17
- var forEachAccumulated = require("./forEachAccumulated");
18
- var invariant = require("./invariant");
19
-
20
- function remove(event) {
21
- event.remove();
22
- }
23
-
24
- var LocalEventTrapMixin = {
25
- trapBubbledEvent:function(topLevelType, handlerBaseName) {
26
- ("production" !== process.env.NODE_ENV ? invariant(this.isMounted(), 'Must be mounted to trap events') : invariant(this.isMounted()));
27
- // If a component renders to null or if another component fatals and causes
28
- // the state of the tree to be corrupted, `node` here can be null.
29
- var node = this.getDOMNode();
30
- ("production" !== process.env.NODE_ENV ? invariant(
31
- node,
32
- 'LocalEventTrapMixin.trapBubbledEvent(...): Requires node to be rendered.'
33
- ) : invariant(node));
34
- var listener = ReactBrowserEventEmitter.trapBubbledEvent(
35
- topLevelType,
36
- handlerBaseName,
37
- node
38
- );
39
- this._localEventListeners =
40
- accumulateInto(this._localEventListeners, listener);
41
- },
42
-
43
- // trapCapturedEvent would look nearly identical. We don't implement that
44
- // method because it isn't currently needed.
45
-
46
- componentWillUnmount:function() {
47
- if (this._localEventListeners) {
48
- forEachAccumulated(this._localEventListeners, remove);
49
- }
50
- }
51
- };
52
-
53
- module.exports = LocalEventTrapMixin;
@@ -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,74 +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 ReactContext
10
- */
11
-
12
- 'use strict';
13
-
14
- var assign = require("./Object.assign");
15
- var emptyObject = require("./emptyObject");
16
- var warning = require("./warning");
17
-
18
- var didWarn = false;
19
-
20
- /**
21
- * Keeps track of the current context.
22
- *
23
- * The context is automatically passed down the component ownership hierarchy
24
- * and is accessible via `this.context` on ReactCompositeComponents.
25
- */
26
- var ReactContext = {
27
-
28
- /**
29
- * @internal
30
- * @type {object}
31
- */
32
- current: emptyObject,
33
-
34
- /**
35
- * Temporarily extends the current context while executing scopedCallback.
36
- *
37
- * A typical use case might look like
38
- *
39
- * render: function() {
40
- * var children = ReactContext.withContext({foo: 'foo'}, () => (
41
- *
42
- * ));
43
- * return <div>{children}</div>;
44
- * }
45
- *
46
- * @param {object} newContext New context to merge into the existing context
47
- * @param {function} scopedCallback Callback to run with the new context
48
- * @return {ReactComponent|array<ReactComponent>}
49
- */
50
- withContext: function(newContext, scopedCallback) {
51
- if ("production" !== process.env.NODE_ENV) {
52
- ("production" !== process.env.NODE_ENV ? warning(
53
- didWarn,
54
- 'withContext is deprecated and will be removed in a future version. ' +
55
- 'Use a wrapper component with getChildContext instead.'
56
- ) : null);
57
-
58
- didWarn = true;
59
- }
60
-
61
- var result;
62
- var previousContext = ReactContext.current;
63
- ReactContext.current = assign({}, previousContext, newContext);
64
- try {
65
- result = scopedCallback();
66
- } finally {
67
- ReactContext.current = previousContext;
68
- }
69
- return result;
70
- }
71
-
72
- };
73
-
74
- module.exports = ReactContext;
@@ -1,47 +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 ReactDOMForm
10
- */
11
-
12
- 'use strict';
13
-
14
- var EventConstants = require("./EventConstants");
15
- var LocalEventTrapMixin = require("./LocalEventTrapMixin");
16
- var ReactBrowserComponentMixin = require("./ReactBrowserComponentMixin");
17
- var ReactClass = require("./ReactClass");
18
- var ReactElement = require("./ReactElement");
19
-
20
- var form = ReactElement.createFactory('form');
21
-
22
- /**
23
- * Since onSubmit doesn't bubble OR capture on the top level in IE8, we need
24
- * to capture it on the <form> element itself. There are lots of hacks we could
25
- * do to accomplish this, but the most reliable is to make <form> a
26
- * composite component and use `componentDidMount` to attach the event handlers.
27
- */
28
- var ReactDOMForm = ReactClass.createClass({
29
- displayName: 'ReactDOMForm',
30
- tagName: 'FORM',
31
-
32
- mixins: [ReactBrowserComponentMixin, LocalEventTrapMixin],
33
-
34
- render: function() {
35
- // TODO: Instead of using `ReactDOM` directly, we should use JSX. However,
36
- // `jshint` fails to parse JSX so in order for linting to work in the open
37
- // source repo, we need to just use `ReactDOM.form`.
38
- return form(this.props);
39
- },
40
-
41
- componentDidMount: function() {
42
- this.trapBubbledEvent(EventConstants.topLevelTypes.topReset, 'reset');
43
- this.trapBubbledEvent(EventConstants.topLevelTypes.topSubmit, 'submit');
44
- }
45
- });
46
-
47
- module.exports = ReactDOMForm;
@@ -1,43 +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 ReactDOMIframe
10
- */
11
-
12
- 'use strict';
13
-
14
- var EventConstants = require("./EventConstants");
15
- var LocalEventTrapMixin = require("./LocalEventTrapMixin");
16
- var ReactBrowserComponentMixin = require("./ReactBrowserComponentMixin");
17
- var ReactClass = require("./ReactClass");
18
- var ReactElement = require("./ReactElement");
19
-
20
- var iframe = ReactElement.createFactory('iframe');
21
-
22
- /**
23
- * Since onLoad doesn't bubble OR capture on the top level in IE8, we need to
24
- * capture it on the <iframe> element itself. There are lots of hacks we could
25
- * do to accomplish this, but the most reliable is to make <iframe> a composite
26
- * component and use `componentDidMount` to attach the event handlers.
27
- */
28
- var ReactDOMIframe = ReactClass.createClass({
29
- displayName: 'ReactDOMIframe',
30
- tagName: 'IFRAME',
31
-
32
- mixins: [ReactBrowserComponentMixin, LocalEventTrapMixin],
33
-
34
- render: function() {
35
- return iframe(this.props);
36
- },
37
-
38
- componentDidMount: function() {
39
- this.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load');
40
- }
41
- });
42
-
43
- module.exports = ReactDOMIframe;
@@ -1,44 +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 ReactDOMImg
10
- */
11
-
12
- 'use strict';
13
-
14
- var EventConstants = require("./EventConstants");
15
- var LocalEventTrapMixin = require("./LocalEventTrapMixin");
16
- var ReactBrowserComponentMixin = require("./ReactBrowserComponentMixin");
17
- var ReactClass = require("./ReactClass");
18
- var ReactElement = require("./ReactElement");
19
-
20
- var img = ReactElement.createFactory('img');
21
-
22
- /**
23
- * Since onLoad doesn't bubble OR capture on the top level in IE8, we need to
24
- * capture it on the <img> element itself. There are lots of hacks we could do
25
- * to accomplish this, but the most reliable is to make <img> a composite
26
- * component and use `componentDidMount` to attach the event handlers.
27
- */
28
- var ReactDOMImg = ReactClass.createClass({
29
- displayName: 'ReactDOMImg',
30
- tagName: 'IMG',
31
-
32
- mixins: [ReactBrowserComponentMixin, LocalEventTrapMixin],
33
-
34
- render: function() {
35
- return img(this.props);
36
- },
37
-
38
- componentDidMount: function() {
39
- this.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load');
40
- this.trapBubbledEvent(EventConstants.topLevelTypes.topError, 'error');
41
- }
42
- });
43
-
44
- module.exports = ReactDOMImg;