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
@@ -11,7 +11,7 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- var keyOf = require("./keyOf");
14
+ var keyOf = require('fbjs/lib/keyOf');
15
15
 
16
16
  /**
17
17
  * Module that is injectable into `EventPluginHub`, that specifies a
@@ -22,6 +22,6 @@ var keyOf = require("./keyOf");
22
22
  * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that
23
23
  * preventing default on events is convenient in `SimpleEventPlugin` handlers.
24
24
  */
25
- var DefaultEventPluginOrder = [keyOf({ ResponderEventPlugin: null }), keyOf({ SimpleEventPlugin: null }), keyOf({ TapEventPlugin: null }), keyOf({ EnterLeaveEventPlugin: null }), keyOf({ ChangeEventPlugin: null }), keyOf({ SelectEventPlugin: null }), keyOf({ BeforeInputEventPlugin: null }), keyOf({ AnalyticsEventPlugin: null })];
25
+ var DefaultEventPluginOrder = [keyOf({ ResponderEventPlugin: null }), keyOf({ SimpleEventPlugin: null }), keyOf({ TapEventPlugin: null }), keyOf({ EnterLeaveEventPlugin: null }), keyOf({ ChangeEventPlugin: null }), keyOf({ SelectEventPlugin: null }), keyOf({ BeforeInputEventPlugin: null })];
26
26
 
27
27
  module.exports = DefaultEventPluginOrder;
@@ -12,12 +12,12 @@
12
12
 
13
13
  'use strict';
14
14
 
15
- var EventConstants = require("./EventConstants");
16
- var EventPropagators = require("./EventPropagators");
17
- var SyntheticMouseEvent = require("./SyntheticMouseEvent");
15
+ var EventConstants = require('./EventConstants');
16
+ var EventPropagators = require('./EventPropagators');
17
+ var SyntheticMouseEvent = require('./SyntheticMouseEvent');
18
18
 
19
- var ReactMount = require("./ReactMount");
20
- var keyOf = require("./keyOf");
19
+ var ReactMount = require('./ReactMount');
20
+ var keyOf = require('fbjs/lib/keyOf');
21
21
 
22
22
  var topLevelTypes = EventConstants.topLevelTypes;
23
23
  var getFirstReactDOM = ReactMount.getFirstReactDOM;
@@ -11,7 +11,7 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- var keyMirror = require("./keyMirror");
14
+ var keyMirror = require('fbjs/lib/keyMirror');
15
15
 
16
16
  var PropagationPhases = keyMirror({ bubbled: null, captured: null });
17
17
 
@@ -19,7 +19,10 @@ var PropagationPhases = keyMirror({ bubbled: null, captured: null });
19
19
  * Types of raw signals from the browser caught at the top level.
20
20
  */
21
21
  var topLevelTypes = keyMirror({
22
+ topAbort: null,
22
23
  topBlur: null,
24
+ topCanPlay: null,
25
+ topCanPlayThrough: null,
23
26
  topChange: null,
24
27
  topClick: null,
25
28
  topCompositionEnd: null,
@@ -37,6 +40,9 @@ var topLevelTypes = keyMirror({
37
40
  topDragOver: null,
38
41
  topDragStart: null,
39
42
  topDrop: null,
43
+ topDurationChange: null,
44
+ topEmptied: null,
45
+ topEnded: null,
40
46
  topError: null,
41
47
  topFocus: null,
42
48
  topInput: null,
@@ -44,21 +50,37 @@ var topLevelTypes = keyMirror({
44
50
  topKeyPress: null,
45
51
  topKeyUp: null,
46
52
  topLoad: null,
53
+ topLoadedData: null,
54
+ topLoadedMetadata: null,
55
+ topLoadStart: null,
47
56
  topMouseDown: null,
48
57
  topMouseMove: null,
49
58
  topMouseOut: null,
50
59
  topMouseOver: null,
51
60
  topMouseUp: null,
61
+ topOnEncrypted: null,
52
62
  topPaste: null,
63
+ topPause: null,
64
+ topPlay: null,
65
+ topPlaying: null,
66
+ topProgress: null,
67
+ topRateChange: null,
53
68
  topReset: null,
54
69
  topScroll: null,
70
+ topSeeked: null,
71
+ topSeeking: null,
55
72
  topSelectionChange: null,
73
+ topStalled: null,
74
+ topSuspend: null,
56
75
  topSubmit: null,
57
76
  topTextInput: null,
77
+ topTimeUpdate: null,
58
78
  topTouchCancel: null,
59
79
  topTouchEnd: null,
60
80
  topTouchMove: null,
61
81
  topTouchStart: null,
82
+ topVolumeChange: null,
83
+ topWaiting: null,
62
84
  topWheel: null
63
85
  });
64
86
 
@@ -11,13 +11,13 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- var EventPluginRegistry = require("./EventPluginRegistry");
15
- var EventPluginUtils = require("./EventPluginUtils");
14
+ var EventPluginRegistry = require('./EventPluginRegistry');
15
+ var EventPluginUtils = require('./EventPluginUtils');
16
16
 
17
- var accumulateInto = require("./accumulateInto");
18
- var forEachAccumulated = require("./forEachAccumulated");
19
- var invariant = require("./invariant");
20
- var warning = require("./warning");
17
+ var accumulateInto = require('./accumulateInto');
18
+ var forEachAccumulated = require('./forEachAccumulated');
19
+ var invariant = require('fbjs/lib/invariant');
20
+ var warning = require('fbjs/lib/warning');
21
21
 
22
22
  /**
23
23
  * Internal store for event listeners
@@ -60,7 +60,7 @@ var InstanceHandle = null;
60
60
 
61
61
  function validateInstanceHandle() {
62
62
  var valid = InstanceHandle && InstanceHandle.traverseTwoPhase && InstanceHandle.traverseEnterLeave;
63
- 'production' !== process.env.NODE_ENV ? warning(valid, 'InstanceHandle not injected before use!') : undefined;
63
+ process.env.NODE_ENV !== 'production' ? warning(valid, 'InstanceHandle not injected before use!') : undefined;
64
64
  }
65
65
 
66
66
  /**
@@ -104,13 +104,13 @@ var EventPluginHub = {
104
104
  */
105
105
  injectInstanceHandle: function (InjectedInstanceHandle) {
106
106
  InstanceHandle = InjectedInstanceHandle;
107
- if ('production' !== process.env.NODE_ENV) {
107
+ if (process.env.NODE_ENV !== 'production') {
108
108
  validateInstanceHandle();
109
109
  }
110
110
  },
111
111
 
112
112
  getInstanceHandle: function () {
113
- if ('production' !== process.env.NODE_ENV) {
113
+ if (process.env.NODE_ENV !== 'production') {
114
114
  validateInstanceHandle();
115
115
  }
116
116
  return InstanceHandle;
@@ -141,7 +141,7 @@ var EventPluginHub = {
141
141
  * @param {?function} listener The callback to store.
142
142
  */
143
143
  putListener: function (id, registrationName, listener) {
144
- !(typeof listener === 'function') ? 'production' !== process.env.NODE_ENV ? invariant(false, 'Expected %s listener to be a function, instead got type %s', registrationName, typeof listener) : invariant(false) : undefined;
144
+ !(typeof listener === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected %s listener to be a function, instead got type %s', registrationName, typeof listener) : invariant(false) : undefined;
145
145
 
146
146
  var bankForRegistrationName = listenerBank[registrationName] || (listenerBank[registrationName] = {});
147
147
  bankForRegistrationName[id] = listener;
@@ -252,7 +252,7 @@ var EventPluginHub = {
252
252
  var processingEventQueue = eventQueue;
253
253
  eventQueue = null;
254
254
  forEachAccumulated(processingEventQueue, executeDispatchesAndRelease);
255
- !!eventQueue ? 'production' !== process.env.NODE_ENV ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing ' + 'an event queue. Support for this has not yet been implemented.') : invariant(false) : undefined;
255
+ !!eventQueue ? process.env.NODE_ENV !== 'production' ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing ' + 'an event queue. Support for this has not yet been implemented.') : invariant(false) : undefined;
256
256
  },
257
257
 
258
258
  /**
@@ -12,7 +12,7 @@
12
12
 
13
13
  'use strict';
14
14
 
15
- var invariant = require("./invariant");
15
+ var invariant = require('fbjs/lib/invariant');
16
16
 
17
17
  /**
18
18
  * Injectable ordering of event plugins.
@@ -37,15 +37,15 @@ function recomputePluginOrdering() {
37
37
  for (var pluginName in namesToPlugins) {
38
38
  var PluginModule = namesToPlugins[pluginName];
39
39
  var pluginIndex = EventPluginOrder.indexOf(pluginName);
40
- !(pluginIndex > -1) ? 'production' !== process.env.NODE_ENV ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in ' + 'the plugin ordering, `%s`.', pluginName) : invariant(false) : undefined;
40
+ !(pluginIndex > -1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in ' + 'the plugin ordering, `%s`.', pluginName) : invariant(false) : undefined;
41
41
  if (EventPluginRegistry.plugins[pluginIndex]) {
42
42
  continue;
43
43
  }
44
- !PluginModule.extractEvents ? 'production' !== process.env.NODE_ENV ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` ' + 'method, but `%s` does not.', pluginName) : invariant(false) : undefined;
44
+ !PluginModule.extractEvents ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` ' + 'method, but `%s` does not.', pluginName) : invariant(false) : undefined;
45
45
  EventPluginRegistry.plugins[pluginIndex] = PluginModule;
46
46
  var publishedEvents = PluginModule.eventTypes;
47
47
  for (var eventName in publishedEvents) {
48
- !publishEventForPlugin(publishedEvents[eventName], PluginModule, eventName) ? 'production' !== process.env.NODE_ENV ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : invariant(false) : undefined;
48
+ !publishEventForPlugin(publishedEvents[eventName], PluginModule, eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : invariant(false) : undefined;
49
49
  }
50
50
  }
51
51
  }
@@ -59,7 +59,7 @@ function recomputePluginOrdering() {
59
59
  * @private
60
60
  */
61
61
  function publishEventForPlugin(dispatchConfig, PluginModule, eventName) {
62
- !!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName) ? 'production' !== process.env.NODE_ENV ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same ' + 'event name, `%s`.', eventName) : invariant(false) : undefined;
62
+ !!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same ' + 'event name, `%s`.', eventName) : invariant(false) : undefined;
63
63
  EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig;
64
64
 
65
65
  var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
@@ -87,7 +87,7 @@ function publishEventForPlugin(dispatchConfig, PluginModule, eventName) {
87
87
  * @private
88
88
  */
89
89
  function publishRegistrationName(registrationName, PluginModule, eventName) {
90
- !!EventPluginRegistry.registrationNameModules[registrationName] ? 'production' !== process.env.NODE_ENV ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same ' + 'registration name, `%s`.', registrationName) : invariant(false) : undefined;
90
+ !!EventPluginRegistry.registrationNameModules[registrationName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same ' + 'registration name, `%s`.', registrationName) : invariant(false) : undefined;
91
91
  EventPluginRegistry.registrationNameModules[registrationName] = PluginModule;
92
92
  EventPluginRegistry.registrationNameDependencies[registrationName] = PluginModule.eventTypes[eventName].dependencies;
93
93
  }
@@ -129,7 +129,7 @@ var EventPluginRegistry = {
129
129
  * @see {EventPluginHub.injection.injectEventPluginOrder}
130
130
  */
131
131
  injectEventPluginOrder: function (InjectedEventPluginOrder) {
132
- !!EventPluginOrder ? 'production' !== process.env.NODE_ENV ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than ' + 'once. You are likely trying to load more than one copy of React.') : invariant(false) : undefined;
132
+ !!EventPluginOrder ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than ' + 'once. You are likely trying to load more than one copy of React.') : invariant(false) : undefined;
133
133
  // Clone the ordering so it cannot be dynamically mutated.
134
134
  EventPluginOrder = Array.prototype.slice.call(InjectedEventPluginOrder);
135
135
  recomputePluginOrdering();
@@ -153,7 +153,7 @@ var EventPluginRegistry = {
153
153
  }
154
154
  var PluginModule = injectedNamesToPlugins[pluginName];
155
155
  if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== PluginModule) {
156
- !!namesToPlugins[pluginName] ? 'production' !== process.env.NODE_ENV ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins ' + 'using the same name, `%s`.', pluginName) : invariant(false) : undefined;
156
+ !!namesToPlugins[pluginName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins ' + 'using the same name, `%s`.', pluginName) : invariant(false) : undefined;
157
157
  namesToPlugins[pluginName] = PluginModule;
158
158
  isOrderingDirty = true;
159
159
  }
@@ -11,10 +11,10 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- var EventConstants = require("./EventConstants");
14
+ var EventConstants = require('./EventConstants');
15
15
 
16
- var invariant = require("./invariant");
17
- var warning = require("./warning");
16
+ var invariant = require('fbjs/lib/invariant');
17
+ var warning = require('fbjs/lib/warning');
18
18
 
19
19
  /**
20
20
  * Injected dependencies:
@@ -28,8 +28,8 @@ var injection = {
28
28
  Mount: null,
29
29
  injectMount: function (InjectedMount) {
30
30
  injection.Mount = InjectedMount;
31
- if ('production' !== process.env.NODE_ENV) {
32
- 'production' !== process.env.NODE_ENV ? warning(InjectedMount && InjectedMount.getNode && InjectedMount.getID, 'EventPluginUtils.injection.injectMount(...): Injected Mount ' + 'module is missing getNode or getID.') : undefined;
31
+ if (process.env.NODE_ENV !== 'production') {
32
+ process.env.NODE_ENV !== 'production' ? warning(InjectedMount && InjectedMount.getNode && InjectedMount.getID, 'EventPluginUtils.injection.injectMount(...): Injected Mount ' + 'module is missing getNode or getID.') : undefined;
33
33
  }
34
34
  }
35
35
  };
@@ -48,7 +48,7 @@ function isStartish(topLevelType) {
48
48
  }
49
49
 
50
50
  var validateEventDispatches;
51
- if ('production' !== process.env.NODE_ENV) {
51
+ if (process.env.NODE_ENV !== 'production') {
52
52
  validateEventDispatches = function (event) {
53
53
  var dispatchListeners = event._dispatchListeners;
54
54
  var dispatchIDs = event._dispatchIDs;
@@ -58,7 +58,7 @@ if ('production' !== process.env.NODE_ENV) {
58
58
  var IDsLen = idsIsArr ? dispatchIDs.length : dispatchIDs ? 1 : 0;
59
59
  var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;
60
60
 
61
- 'production' !== process.env.NODE_ENV ? warning(idsIsArr === listenersIsArr && IDsLen === listenersLen, 'EventPluginUtils: Invalid `event`.') : undefined;
61
+ process.env.NODE_ENV !== 'production' ? warning(idsIsArr === listenersIsArr && IDsLen === listenersLen, 'EventPluginUtils: Invalid `event`.') : undefined;
62
62
  };
63
63
  }
64
64
 
@@ -70,7 +70,7 @@ if ('production' !== process.env.NODE_ENV) {
70
70
  function forEachEventDispatch(event, cb) {
71
71
  var dispatchListeners = event._dispatchListeners;
72
72
  var dispatchIDs = event._dispatchIDs;
73
- if ('production' !== process.env.NODE_ENV) {
73
+ if (process.env.NODE_ENV !== 'production') {
74
74
  validateEventDispatches(event);
75
75
  }
76
76
  if (Array.isArray(dispatchListeners)) {
@@ -118,7 +118,7 @@ function executeDispatchesInOrder(event, cb) {
118
118
  function executeDispatchesInOrderStopAtTrueImpl(event) {
119
119
  var dispatchListeners = event._dispatchListeners;
120
120
  var dispatchIDs = event._dispatchIDs;
121
- if ('production' !== process.env.NODE_ENV) {
121
+ if (process.env.NODE_ENV !== 'production') {
122
122
  validateEventDispatches(event);
123
123
  }
124
124
  if (Array.isArray(dispatchListeners)) {
@@ -159,12 +159,12 @@ function executeDispatchesInOrderStopAtTrue(event) {
159
159
  * @return {*} The return value of executing the single dispatch.
160
160
  */
161
161
  function executeDirectDispatch(event) {
162
- if ('production' !== process.env.NODE_ENV) {
162
+ if (process.env.NODE_ENV !== 'production') {
163
163
  validateEventDispatches(event);
164
164
  }
165
165
  var dispatchListener = event._dispatchListeners;
166
166
  var dispatchID = event._dispatchIDs;
167
- !!Array.isArray(dispatchListener) ? 'production' !== process.env.NODE_ENV ? invariant(false, 'executeDirectDispatch(...): Invalid `event`.') : invariant(false) : undefined;
167
+ !!Array.isArray(dispatchListener) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'executeDirectDispatch(...): Invalid `event`.') : invariant(false) : undefined;
168
168
  var res = dispatchListener ? dispatchListener(event, dispatchID) : null;
169
169
  event._dispatchListeners = null;
170
170
  event._dispatchIDs = null;
@@ -11,13 +11,13 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- var EventConstants = require("./EventConstants");
15
- var EventPluginHub = require("./EventPluginHub");
14
+ var EventConstants = require('./EventConstants');
15
+ var EventPluginHub = require('./EventPluginHub');
16
16
 
17
- var warning = require("./warning");
17
+ var warning = require('fbjs/lib/warning');
18
18
 
19
- var accumulateInto = require("./accumulateInto");
20
- var forEachAccumulated = require("./forEachAccumulated");
19
+ var accumulateInto = require('./accumulateInto');
20
+ var forEachAccumulated = require('./forEachAccumulated');
21
21
 
22
22
  var PropagationPhases = EventConstants.PropagationPhases;
23
23
  var getListener = EventPluginHub.getListener;
@@ -38,8 +38,8 @@ function listenerAtPhase(id, event, propagationPhase) {
38
38
  * "dispatch" object that pairs the event with the listener.
39
39
  */
40
40
  function accumulateDirectionalDispatches(domID, upwards, event) {
41
- if ('production' !== process.env.NODE_ENV) {
42
- 'production' !== process.env.NODE_ENV ? warning(domID, 'Dispatching id must not be null') : undefined;
41
+ if (process.env.NODE_ENV !== 'production') {
42
+ process.env.NODE_ENV !== 'production' ? warning(domID, 'Dispatching id must not be null') : undefined;
43
43
  }
44
44
  var phase = upwards ? PropagationPhases.bubbled : PropagationPhases.captured;
45
45
  var listener = listenerAtPhase(domID, event, phase);
@@ -12,10 +12,10 @@
12
12
 
13
13
  'use strict';
14
14
 
15
- var PooledClass = require("./PooledClass");
15
+ var PooledClass = require('./PooledClass');
16
16
 
17
- var assign = require("./Object.assign");
18
- var getTextContentAccessor = require("./getTextContentAccessor");
17
+ var assign = require('./Object.assign');
18
+ var getTextContentAccessor = require('./getTextContentAccessor');
19
19
 
20
20
  /**
21
21
  * This helper class stores information about text content of a target node,
@@ -11,8 +11,8 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- var DOMProperty = require("./DOMProperty");
15
- var ExecutionEnvironment = require("./ExecutionEnvironment");
14
+ var DOMProperty = require('./DOMProperty');
15
+ var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
16
16
 
17
17
  var MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE;
18
18
  var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY;
@@ -92,6 +92,7 @@ var HTMLDOMPropertyConfig = {
92
92
  httpEquiv: null,
93
93
  icon: null,
94
94
  id: MUST_USE_PROPERTY,
95
+ inputMode: MUST_USE_ATTRIBUTE,
95
96
  is: MUST_USE_ATTRIBUTE,
96
97
  keyParams: MUST_USE_ATTRIBUTE,
97
98
  keyType: MUST_USE_ATTRIBUTE,
@@ -152,6 +153,7 @@ var HTMLDOMPropertyConfig = {
152
153
  value: MUST_USE_PROPERTY | HAS_SIDE_EFFECTS,
153
154
  width: MUST_USE_ATTRIBUTE,
154
155
  wmode: MUST_USE_ATTRIBUTE,
156
+ wrap: null,
155
157
 
156
158
  /**
157
159
  * Non-standard Properties
@@ -12,8 +12,8 @@
12
12
 
13
13
  'use strict';
14
14
 
15
- var ReactLink = require("./ReactLink");
16
- var ReactStateSetters = require("./ReactStateSetters");
15
+ var ReactLink = require('./ReactLink');
16
+ var ReactStateSetters = require('./ReactStateSetters');
17
17
 
18
18
  /**
19
19
  * A simple mixin around ReactLink.forState().
@@ -12,11 +12,11 @@
12
12
 
13
13
  'use strict';
14
14
 
15
- var ReactPropTypes = require("./ReactPropTypes");
16
- var ReactPropTypeLocations = require("./ReactPropTypeLocations");
15
+ var ReactPropTypes = require('./ReactPropTypes');
16
+ var ReactPropTypeLocations = require('./ReactPropTypeLocations');
17
17
 
18
- var invariant = require("./invariant");
19
- var warning = require("./warning");
18
+ var invariant = require('fbjs/lib/invariant');
19
+ var warning = require('fbjs/lib/warning');
20
20
 
21
21
  var hasReadOnlyValue = {
22
22
  'button': true,
@@ -29,16 +29,16 @@ var hasReadOnlyValue = {
29
29
  };
30
30
 
31
31
  function _assertSingleLink(inputProps) {
32
- !(inputProps.checkedLink == null || inputProps.valueLink == null) ? 'production' !== process.env.NODE_ENV ? invariant(false, 'Cannot provide a checkedLink and a valueLink. If you want to use ' + 'checkedLink, you probably don\'t want to use valueLink and vice versa.') : invariant(false) : undefined;
32
+ !(inputProps.checkedLink == null || inputProps.valueLink == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a valueLink. If you want to use ' + 'checkedLink, you probably don\'t want to use valueLink and vice versa.') : invariant(false) : undefined;
33
33
  }
34
34
  function _assertValueLink(inputProps) {
35
35
  _assertSingleLink(inputProps);
36
- !(inputProps.value == null && inputProps.onChange == null) ? 'production' !== process.env.NODE_ENV ? invariant(false, 'Cannot provide a valueLink and a value or onChange event. If you want ' + 'to use value or onChange, you probably don\'t want to use valueLink.') : invariant(false) : undefined;
36
+ !(inputProps.value == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a valueLink and a value or onChange event. If you want ' + 'to use value or onChange, you probably don\'t want to use valueLink.') : invariant(false) : undefined;
37
37
  }
38
38
 
39
39
  function _assertCheckedLink(inputProps) {
40
40
  _assertSingleLink(inputProps);
41
- !(inputProps.checked == null && inputProps.onChange == null) ? 'production' !== process.env.NODE_ENV ? invariant(false, 'Cannot provide a checkedLink and a checked property or onChange event. ' + 'If you want to use checked or onChange, you probably don\'t want to ' + 'use checkedLink') : invariant(false) : undefined;
41
+ !(inputProps.checked == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a checked property or onChange event. ' + 'If you want to use checked or onChange, you probably don\'t want to ' + 'use checkedLink') : invariant(false) : undefined;
42
42
  }
43
43
 
44
44
  var propTypes = {
@@ -84,7 +84,7 @@ var LinkedValueUtils = {
84
84
  loggedTypeFailures[error.message] = true;
85
85
 
86
86
  var addendum = getDeclarationErrorAddendum(owner);
87
- 'production' !== process.env.NODE_ENV ? warning(false, 'Failed form propType: %s%s', error.message, addendum) : undefined;
87
+ process.env.NODE_ENV !== 'production' ? warning(false, 'Failed form propType: %s%s', error.message, addendum) : undefined;
88
88
  }
89
89
  }
90
90
  },
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Copyright 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 MetaMatchers
10
+ */
11
+
12
+ 'use strict';
13
+
14
+ /**
15
+ * This modules adds a jasmine matcher toEqualSpecsIn that can be used to
16
+ * compare the specs in two different "describe" functions and their result.
17
+ * It can be used to test a test.
18
+ */
19
+
20
+ function getRunnerWithResults(describeFunction) {
21
+ if (describeFunction._cachedRunner) {
22
+ // Cached result of execution. This is a convenience way to test against
23
+ // the same authorative function multiple times.
24
+ return describeFunction._cachedRunner;
25
+ }
26
+ // Patch the current global environment.
27
+ var env = new jasmine.Env();
28
+ // Execute the tests synchronously.
29
+ env.updateInterval = 0;
30
+ var outerGetEnv = jasmine.getEnv;
31
+ jasmine.getEnv = function () {
32
+ return env;
33
+ };
34
+ // TODO: Bring over matchers from the existing environment.
35
+ var runner = env.currentRunner();
36
+ try {
37
+ env.describe('', describeFunction);
38
+ env.execute();
39
+ } finally {
40
+ // Restore the environment.
41
+ jasmine.getEnv = outerGetEnv;
42
+ }
43
+ describeFunction._cachedRunner = runner;
44
+ return runner;
45
+ }
46
+
47
+ function compareSpec(actual, expected) {
48
+ if (actual.results().totalCount !== expected.results().totalCount) {
49
+ return 'Expected ' + expected.results().totalCount + ' expects, ' + 'but got ' + actual.results().totalCount + ':' + actual.getFullName();
50
+ }
51
+ return null;
52
+ }
53
+
54
+ function includesDescription(specs, description, startIndex) {
55
+ for (var i = startIndex; i < specs.length; i++) {
56
+ if (specs[i].description === description) {
57
+ return true;
58
+ }
59
+ }
60
+ return false;
61
+ }
62
+
63
+ function compareSpecs(actualSpecs, expectedSpecs) {
64
+ for (var i = 0; i < actualSpecs.length && i < expectedSpecs.length; i++) {
65
+ var actual = actualSpecs[i];
66
+ var expected = expectedSpecs[i];
67
+ if (actual.description === expected.description) {
68
+ var errorMessage = compareSpec(actual, expected);
69
+ if (errorMessage) {
70
+ return errorMessage;
71
+ }
72
+ continue;
73
+ } else if (includesDescription(actualSpecs, expected.description, i)) {
74
+ return 'Did not expect the spec:' + actualSpecs[i].getFullName();
75
+ } else {
76
+ return 'Expected an equivalent to:' + expectedSpecs[i].getFullName();
77
+ }
78
+ }
79
+ if (i < actualSpecs.length) {
80
+ return 'Did not expect the spec:' + actualSpecs[i].getFullName();
81
+ }
82
+ if (i < expectedSpecs.length) {
83
+ return 'Expected an equivalent to:' + expectedSpecs[i].getFullName();
84
+ }
85
+ return null;
86
+ }
87
+
88
+ function compareDescription(a, b) {
89
+ if (a.description === b.description) {
90
+ return 0;
91
+ }
92
+ return a.description < b.description ? -1 : 1;
93
+ }
94
+
95
+ function compareRunners(actual, expected) {
96
+ return compareSpecs(actual.specs().sort(compareDescription), expected.specs().sort(compareDescription));
97
+ }
98
+
99
+ var MetaMatchers = {
100
+ toEqualSpecsIn: function (expectedDescribeFunction) {
101
+ var actualDescribeFunction = this.actual;
102
+ if (typeof actualDescribeFunction !== 'function') {
103
+ throw Error('toEqualSpecsIn() should be used on a describe function');
104
+ }
105
+ if (typeof expectedDescribeFunction !== 'function') {
106
+ throw Error('toEqualSpecsIn() should be passed a describe function');
107
+ }
108
+ var actual = getRunnerWithResults(actualDescribeFunction);
109
+ var expected = getRunnerWithResults(expectedDescribeFunction);
110
+ var errorMessage = compareRunners(actual, expected);
111
+ this.message = function () {
112
+ return [errorMessage, 'The specs are equal. Expected them to be different.'];
113
+ };
114
+ return !errorMessage;
115
+ }
116
+ };
117
+
118
+ module.exports = MetaMatchers;