You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ro...@apache.org on 2015/06/04 14:51:47 UTC
[1/3] fauxton commit: updated refs/heads/master to 2652c98
Repository: couchdb-fauxton
Updated Branches:
refs/heads/master b4e5f5353 -> 2652c9814
tests: fix for react 13
PR: #453
PR-URL: https://github.com/apache/couchdb-fauxton/pull/453
Reviewed-By: garren smith <ga...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/2652c981
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/2652c981
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/2652c981
Branch: refs/heads/master
Commit: 2652c9814c7a663b84dd778a1e8cd91485b78e05
Parents: 95d9964
Author: Robert Kowalski <ro...@apache.org>
Authored: Wed May 13 16:05:24 2015 +0200
Committer: Robert Kowalski <ro...@apache.org>
Committed: Thu Jun 4 14:47:59 2015 +0200
----------------------------------------------------------------------
.../databases/tests/componentsSpec.react.jsx | 6 ++---
.../tests/changes.componentsSpec.react.jsx | 24 ++++++++++++--------
app/core/tests/routeObjectSpec.js | 3 ++-
3 files changed, 19 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2652c981/app/addons/databases/tests/componentsSpec.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/databases/tests/componentsSpec.react.jsx b/app/addons/databases/tests/componentsSpec.react.jsx
index 0fe4ded..099ab91 100644
--- a/app/addons/databases/tests/componentsSpec.react.jsx
+++ b/app/addons/databases/tests/componentsSpec.react.jsx
@@ -83,7 +83,7 @@ define([
];
};
container = document.createElement('div');
- dbEl = React.renderComponent(React.createElement(Views.DatabasesController, {}), container);
+ dbEl = React.render(React.createElement(Views.DatabasesController, {}), container);
});
afterEach(function () {
@@ -116,7 +116,7 @@ define([
passedDbName = dbName;
};
container = document.createElement('div');
- addEl = React.renderComponent(React.createElement(Views.AddDatabaseWidget, {}), container);
+ addEl = React.render(React.createElement(Views.AddDatabaseWidget, {}), container);
});
afterEach(function () {
@@ -158,7 +158,7 @@ define([
return ["db1", "db2"];
};
container = document.createElement('div');
- jumpEl = React.renderComponent(React.createElement(Views.JumpToDatabaseWidget, {}), container);
+ jumpEl = React.render(React.createElement(Views.JumpToDatabaseWidget, {}), container);
});
afterEach(function () {
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2652c981/app/addons/documents/changes/tests/changes.componentsSpec.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/documents/changes/tests/changes.componentsSpec.react.jsx b/app/addons/documents/changes/tests/changes.componentsSpec.react.jsx
index 155206c..049e95c 100644
--- a/app/addons/documents/changes/tests/changes.componentsSpec.react.jsx
+++ b/app/addons/documents/changes/tests/changes.componentsSpec.react.jsx
@@ -175,8 +175,8 @@ define([
it('should not add the same filter twice', function () {
var $el = $(changesFilterEl.getDOMNode()),
- submitBtn = $el.find('[type="submit"]')[0],
- addItemField = $el.find('.js-changes-filter-field')[0];
+ submitBtn = $el.find('[type="submit"]')[0],
+ addItemField = $el.find('.js-changes-filter-field')[0];
var filter = 'I am unique in the whole wide world';
addItemField.value = filter;
@@ -194,7 +194,7 @@ define([
// tests Changes Controller; includes tests in conjunction with ChangesHeaderController
describe('ChangesController', function () {
- var containerEl, headerEl, $headerEl, changesEl, $changesEl;
+ var container, container2, headerEl, $headerEl, changesEl, $changesEl;
var results = [
{ id: 'doc_1', seq: 4, deleted: false, changes: { code: 'here' } },
@@ -209,17 +209,20 @@ define([
});
beforeEach(function () {
+ container = document.createElement('div');
+ container2 = document.createElement('div');
Actions.initChanges({ databaseName: 'testDatabase' });
- headerEl = TestUtils.renderIntoDocument(<Changes.ChangesHeaderController />, containerEl);
+ headerEl = TestUtils.renderIntoDocument(<Changes.ChangesHeaderController />, container);
$headerEl = $(headerEl.getDOMNode());
- changesEl = TestUtils.renderIntoDocument(<Changes.ChangesController />, containerEl);
+ changesEl = TestUtils.renderIntoDocument(<Changes.ChangesController />, container2);
$changesEl = $(changesEl.getDOMNode());
Actions.updateChanges(changesResponse);
});
afterEach(function () {
Stores.changesStore.reset();
- React.unmountComponentAtNode(containerEl);
+ React.unmountComponentAtNode(container);
+ React.unmountComponentAtNode(container2);
});
@@ -290,11 +293,12 @@ define([
describe('ChangesController max results', function () {
- var containerEl, changesEl;
+ var changesEl;
+ var container;
var maxChanges = 10;
beforeEach(function () {
-
+ container = document.createElement('div');
var changes = [];
_.times(maxChanges + 10, function (i) {
changes.push({ id: 'doc_' + i, seq: 1, changes: { code: 'here' } });
@@ -311,12 +315,12 @@ define([
Stores.changesStore.setMaxChanges(maxChanges);
Actions.updateChanges(response);
- changesEl = TestUtils.renderIntoDocument(<Changes.ChangesController />, containerEl);
+ changesEl = TestUtils.renderIntoDocument(<Changes.ChangesController />, container);
});
afterEach(function () {
Stores.changesStore.reset();
- React.unmountComponentAtNode(containerEl);
+ React.unmountComponentAtNode(container);
});
it('should truncate the number of results with very large # of changes', function () {
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2652c981/app/core/tests/routeObjectSpec.js
----------------------------------------------------------------------
diff --git a/app/core/tests/routeObjectSpec.js b/app/core/tests/routeObjectSpec.js
index fbac6b6..a3fb115 100644
--- a/app/core/tests/routeObjectSpec.js
+++ b/app/core/tests/routeObjectSpec.js
@@ -198,7 +198,7 @@ define([
});
it('removes existing component via react', function () {
- var spy = sinon.spy(React, 'unmountComponentAtNode');
+ var spy = sinon.stub(React, 'unmountComponentAtNode');
var fakeSelector = 'remove-selector';
testRouteObject.reactComponents[fakeSelector] = React.createElement('div');
@@ -209,6 +209,7 @@ define([
});
it('removes existing components key', function () {
+ var spy = sinon.stub(React, 'unmountComponentAtNode');
var fakeSelector = 'remove-selector';
testRouteObject.reactComponents[fakeSelector] = React.createElement('div');
[3/3] fauxton commit: updated refs/heads/master to 2652c98
Posted by ro...@apache.org.
react: update to react (with addons) 13.3
src: https://fb.me/react-with-addons-0.13.3.js
PR: #453
PR-URL: https://github.com/apache/couchdb-fauxton/pull/453
Reviewed-By: garren smith <ga...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/95d9964b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/95d9964b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/95d9964b
Branch: refs/heads/master
Commit: 95d9964b25b420bb58e43036fc6f0b842b13c727
Parents: b4e5f53
Author: Robert Kowalski <ro...@apache.org>
Authored: Wed May 13 15:40:54 2015 +0200
Committer: Robert Kowalski <ro...@apache.org>
Committed: Thu Jun 4 14:47:59 2015 +0200
----------------------------------------------------------------------
assets/js/libs/react.js | 11018 ++++++++++++++++++++++++-----------------
1 file changed, 6419 insertions(+), 4599 deletions(-)
----------------------------------------------------------------------
[2/3] fauxton commit: updated refs/heads/master to 2652c98
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/95d9964b/assets/js/libs/react.js
----------------------------------------------------------------------
diff --git a/assets/js/libs/react.js b/assets/js/libs/react.js
index da04de6..c1578b7 100644
--- a/assets/js/libs/react.js
+++ b/assets/js/libs/react.js
@@ -1,9 +1,9 @@
/**
- * React (with addons) v0.12.2
+ * React (with addons) v0.13.3
*/
-!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.React=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
+(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.React = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
/**
- * Copyright 2013-2014, Facebook, Inc.
+ * Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@@ -20,19 +20,20 @@
* place to live inside React core.
*/
-"use strict";
+'use strict';
-var LinkedStateMixin = _dereq_("./LinkedStateMixin");
-var React = _dereq_("./React");
+var LinkedStateMixin = _dereq_(25);
+var React = _dereq_(31);
var ReactComponentWithPureRenderMixin =
- _dereq_("./ReactComponentWithPureRenderMixin");
-var ReactCSSTransitionGroup = _dereq_("./ReactCSSTransitionGroup");
-var ReactTransitionGroup = _dereq_("./ReactTransitionGroup");
-var ReactUpdates = _dereq_("./ReactUpdates");
+ _dereq_(42);
+var ReactCSSTransitionGroup = _dereq_(34);
+var ReactFragment = _dereq_(69);
+var ReactTransitionGroup = _dereq_(98);
+var ReactUpdates = _dereq_(100);
-var cx = _dereq_("./cx");
-var cloneWithProps = _dereq_("./cloneWithProps");
-var update = _dereq_("./update");
+var cx = _dereq_(127);
+var cloneWithProps = _dereq_(122);
+var update = _dereq_(170);
React.addons = {
CSSTransitionGroup: ReactCSSTransitionGroup,
@@ -43,19 +44,20 @@ React.addons = {
batchedUpdates: ReactUpdates.batchedUpdates,
classSet: cx,
cloneWithProps: cloneWithProps,
+ createFragment: ReactFragment.create,
update: update
};
if ("production" !== "development") {
- React.addons.Perf = _dereq_("./ReactDefaultPerf");
- React.addons.TestUtils = _dereq_("./ReactTestUtils");
+ React.addons.Perf = _dereq_(61);
+ React.addons.TestUtils = _dereq_(95);
}
module.exports = React;
-},{"./LinkedStateMixin":25,"./React":31,"./ReactCSSTransitionGroup":34,"./ReactComponentWithPureRenderMixin":39,"./ReactDefaultPerf":56,"./ReactTestUtils":86,"./ReactTransitionGroup":90,"./ReactUpdates":91,"./cloneWithProps":113,"./cx":118,"./update":159}],2:[function(_dereq_,module,exports){
+},{"100":100,"122":122,"127":127,"170":170,"25":25,"31":31,"34":34,"42":42,"61":61,"69":69,"95":95,"98":98}],2:[function(_dereq_,module,exports){
/**
- * Copyright 2013-2014, Facebook, Inc.
+ * Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@@ -66,9 +68,9 @@ module.exports = React;
* @typechecks static-only
*/
-"use strict";
+'use strict';
-var focusNode = _dereq_("./focusNode");
+var focusNode = _dereq_(134);
var AutoFocusMixin = {
componentDidMount: function() {
@@ -80,9 +82,9 @@ var AutoFocusMixin = {
module.exports = AutoFocusMixin;
-},{"./focusNode":125}],3:[function(_dereq_,module,exports){
+},{"134":134}],3:[function(_dereq_,module,exports){
/**
- * Copyright 2013 Facebook, Inc.
+ * Copyright 2013-2015 Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@@ -93,19 +95,48 @@ module.exports = AutoFocusMixin;
* @typechecks static-only
*/
-"use strict";
+'use strict';
+
+var EventConstants = _dereq_(16);
+var EventPropagators = _dereq_(21);
+var ExecutionEnvironment = _dereq_(22);
+var FallbackCompositionState = _dereq_(23);
+var SyntheticCompositionEvent = _dereq_(106);
+var SyntheticInputEvent = _dereq_(110);
+
+var keyOf = _dereq_(157);
-var EventConstants = _dereq_("./EventConstants");
-var EventPropagators = _dereq_("./EventPropagators");
-var ExecutionEnvironment = _dereq_("./ExecutionEnvironment");
-var SyntheticInputEvent = _dereq_("./SyntheticInputEvent");
+var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
+var START_KEYCODE = 229;
+
+var canUseCompositionEvent = (
+ ExecutionEnvironment.canUseDOM &&
+ 'CompositionEvent' in window
+);
-var keyOf = _dereq_("./keyOf");
+var documentMode = null;
+if (ExecutionEnvironment.canUseDOM && 'documentMode' in document) {
+ documentMode = document.documentMode;
+}
+// Webkit offers a very useful `textInput` event that can be used to
+// directly represent `beforeInput`. The IE `textinput` event is not as
+// useful, so we don't use it.
var canUseTextInputEvent = (
ExecutionEnvironment.canUseDOM &&
'TextEvent' in window &&
- !('documentMode' in document || isPresto())
+ !documentMode &&
+ !isPresto()
+);
+
+// In IE9+, we have access to composition events, but the data supplied
+// by the native compositionend event may be incorrect. Japanese ideographic
+// spaces, for instance (\u3000) are not recorded correctly.
+var useFallbackCompositionData = (
+ ExecutionEnvironment.canUseDOM &&
+ (
+ (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11)
+ )
);
/**
@@ -139,12 +170,51 @@ var eventTypes = {
topLevelTypes.topTextInput,
topLevelTypes.topPaste
]
+ },
+ compositionEnd: {
+ phasedRegistrationNames: {
+ bubbled: keyOf({onCompositionEnd: null}),
+ captured: keyOf({onCompositionEndCapture: null})
+ },
+ dependencies: [
+ topLevelTypes.topBlur,
+ topLevelTypes.topCompositionEnd,
+ topLevelTypes.topKeyDown,
+ topLevelTypes.topKeyPress,
+ topLevelTypes.topKeyUp,
+ topLevelTypes.topMouseDown
+ ]
+ },
+ compositionStart: {
+ phasedRegistrationNames: {
+ bubbled: keyOf({onCompositionStart: null}),
+ captured: keyOf({onCompositionStartCapture: null})
+ },
+ dependencies: [
+ topLevelTypes.topBlur,
+ topLevelTypes.topCompositionStart,
+ topLevelTypes.topKeyDown,
+ topLevelTypes.topKeyPress,
+ topLevelTypes.topKeyUp,
+ topLevelTypes.topMouseDown
+ ]
+ },
+ compositionUpdate: {
+ phasedRegistrationNames: {
+ bubbled: keyOf({onCompositionUpdate: null}),
+ captured: keyOf({onCompositionUpdateCapture: null})
+ },
+ dependencies: [
+ topLevelTypes.topBlur,
+ topLevelTypes.topCompositionUpdate,
+ topLevelTypes.topKeyDown,
+ topLevelTypes.topKeyPress,
+ topLevelTypes.topKeyUp,
+ topLevelTypes.topMouseDown
+ ]
}
};
-// Track characters inserted via keypress and composition events.
-var fallbackChars = null;
-
// Track whether we've ever handled a keypress on the space key.
var hasSpaceKeypress = false;
@@ -161,6 +231,297 @@ function isKeypressCommand(nativeEvent) {
);
}
+
+/**
+ * Translate native top level events into event types.
+ *
+ * @param {string} topLevelType
+ * @return {object}
+ */
+function getCompositionEventType(topLevelType) {
+ switch (topLevelType) {
+ case topLevelTypes.topCompositionStart:
+ return eventTypes.compositionStart;
+ case topLevelTypes.topCompositionEnd:
+ return eventTypes.compositionEnd;
+ case topLevelTypes.topCompositionUpdate:
+ return eventTypes.compositionUpdate;
+ }
+}
+
+/**
+ * Does our fallback best-guess model think this event signifies that
+ * composition has begun?
+ *
+ * @param {string} topLevelType
+ * @param {object} nativeEvent
+ * @return {boolean}
+ */
+function isFallbackCompositionStart(topLevelType, nativeEvent) {
+ return (
+ topLevelType === topLevelTypes.topKeyDown &&
+ nativeEvent.keyCode === START_KEYCODE
+ );
+}
+
+/**
+ * Does our fallback mode think that this event is the end of composition?
+ *
+ * @param {string} topLevelType
+ * @param {object} nativeEvent
+ * @return {boolean}
+ */
+function isFallbackCompositionEnd(topLevelType, nativeEvent) {
+ switch (topLevelType) {
+ case topLevelTypes.topKeyUp:
+ // Command keys insert or clear IME input.
+ return (END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1);
+ case topLevelTypes.topKeyDown:
+ // Expect IME keyCode on each keydown. If we get any other
+ // code we must have exited earlier.
+ return (nativeEvent.keyCode !== START_KEYCODE);
+ case topLevelTypes.topKeyPress:
+ case topLevelTypes.topMouseDown:
+ case topLevelTypes.topBlur:
+ // Events are not possible without cancelling IME.
+ return true;
+ default:
+ return false;
+ }
+}
+
+/**
+ * Google Input Tools provides composition data via a CustomEvent,
+ * with the `data` property populated in the `detail` object. If this
+ * is available on the event object, use it. If not, this is a plain
+ * composition event and we have nothing special to extract.
+ *
+ * @param {object} nativeEvent
+ * @return {?string}
+ */
+function getDataFromCustomEvent(nativeEvent) {
+ var detail = nativeEvent.detail;
+ if (typeof detail === 'object' && 'data' in detail) {
+ return detail.data;
+ }
+ return null;
+}
+
+// Track the current IME composition fallback object, if any.
+var currentComposition = null;
+
+/**
+ * @param {string} topLevelType Record from `EventConstants`.
+ * @param {DOMEventTarget} topLevelTarget The listening component root node.
+ * @param {string} topLevelTargetID ID of `topLevelTarget`.
+ * @param {object} nativeEvent Native browser event.
+ * @return {?object} A SyntheticCompositionEvent.
+ */
+function extractCompositionEvent(
+ topLevelType,
+ topLevelTarget,
+ topLevelTargetID,
+ nativeEvent
+) {
+ var eventType;
+ var fallbackData;
+
+ if (canUseCompositionEvent) {
+ eventType = getCompositionEventType(topLevelType);
+ } else if (!currentComposition) {
+ if (isFallbackCompositionStart(topLevelType, nativeEvent)) {
+ eventType = eventTypes.compositionStart;
+ }
+ } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {
+ eventType = eventTypes.compositionEnd;
+ }
+
+ if (!eventType) {
+ return null;
+ }
+
+ if (useFallbackCompositionData) {
+ // The current composition is stored statically and must not be
+ // overwritten while composition continues.
+ if (!currentComposition && eventType === eventTypes.compositionStart) {
+ currentComposition = FallbackCompositionState.getPooled(topLevelTarget);
+ } else if (eventType === eventTypes.compositionEnd) {
+ if (currentComposition) {
+ fallbackData = currentComposition.getData();
+ }
+ }
+ }
+
+ var event = SyntheticCompositionEvent.getPooled(
+ eventType,
+ topLevelTargetID,
+ nativeEvent
+ );
+
+ if (fallbackData) {
+ // Inject data generated from fallback path into the synthetic event.
+ // This matches the property of native CompositionEventInterface.
+ event.data = fallbackData;
+ } else {
+ var customData = getDataFromCustomEvent(nativeEvent);
+ if (customData !== null) {
+ event.data = customData;
+ }
+ }
+
+ EventPropagators.accumulateTwoPhaseDispatches(event);
+ return event;
+}
+
+/**
+ * @param {string} topLevelType Record from `EventConstants`.
+ * @param {object} nativeEvent Native browser event.
+ * @return {?string} The string corresponding to this `beforeInput` event.
+ */
+function getNativeBeforeInputChars(topLevelType, nativeEvent) {
+ switch (topLevelType) {
+ case topLevelTypes.topCompositionEnd:
+ return getDataFromCustomEvent(nativeEvent);
+ case topLevelTypes.topKeyPress:
+ /**
+ * If native `textInput` events are available, our goal is to make
+ * use of them. However, there is a special case: the spacebar key.
+ * In Webkit, preventing default on a spacebar `textInput` event
+ * cancels character insertion, but it *also* causes the browser
+ * to fall back to its default spacebar behavior of scrolling the
+ * page.
+ *
+ * Tracking at:
+ * https://code.google.com/p/chromium/issues/detail?id=355103
+ *
+ * To avoid this issue, use the keypress event as if no `textInput`
+ * event is available.
+ */
+ var which = nativeEvent.which;
+ if (which !== SPACEBAR_CODE) {
+ return null;
+ }
+
+ hasSpaceKeypress = true;
+ return SPACEBAR_CHAR;
+
+ case topLevelTypes.topTextInput:
+ // Record the characters to be added to the DOM.
+ var chars = nativeEvent.data;
+
+ // If it's a spacebar character, assume that we have already handled
+ // it at the keypress level and bail immediately. Android Chrome
+ // doesn't give us keycodes, so we need to blacklist it.
+ if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
+ return null;
+ }
+
+ return chars;
+
+ default:
+ // For other native event types, do nothing.
+ return null;
+ }
+}
+
+/**
+ * For browsers that do not provide the `textInput` event, extract the
+ * appropriate string to use for SyntheticInputEvent.
+ *
+ * @param {string} topLevelType Record from `EventConstants`.
+ * @param {object} nativeEvent Native browser event.
+ * @return {?string} The fallback string for this `beforeInput` event.
+ */
+function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
+ // If we are currently composing (IME) and using a fallback to do so,
+ // try to extract the composed characters from the fallback object.
+ if (currentComposition) {
+ if (
+ topLevelType === topLevelTypes.topCompositionEnd ||
+ isFallbackCompositionEnd(topLevelType, nativeEvent)
+ ) {
+ var chars = currentComposition.getData();
+ FallbackCompositionState.release(currentComposition);
+ currentComposition = null;
+ return chars;
+ }
+ return null;
+ }
+
+ switch (topLevelType) {
+ case topLevelTypes.topPaste:
+ // If a paste event occurs after a keypress, throw out the input
+ // chars. Paste events should not lead to BeforeInput events.
+ return null;
+ case topLevelTypes.topKeyPress:
+ /**
+ * As of v27, Firefox may fire keypress events even when no character
+ * will be inserted. A few possibilities:
+ *
+ * - `which` is `0`. Arrow keys, Esc key, etc.
+ *
+ * - `which` is the pressed key code, but no char is available.
+ * Ex: 'AltGr + d` in Polish. There is no modified character for
+ * this key combination and no character is inserted into the
+ * document, but FF fires the keypress for char code `100` anyway.
+ * No `input` event will occur.
+ *
+ * - `which` is the pressed key code, but a command combination is
+ * being used. Ex: `Cmd+C`. No character is inserted, and no
+ * `input` event will occur.
+ */
+ if (nativeEvent.which && !isKeypressCommand(nativeEvent)) {
+ return String.fromCharCode(nativeEvent.which);
+ }
+ return null;
+ case topLevelTypes.topCompositionEnd:
+ return useFallbackCompositionData ? null : nativeEvent.data;
+ default:
+ return null;
+ }
+}
+
+/**
+ * Extract a SyntheticInputEvent for `beforeInput`, based on either native
+ * `textInput` or fallback behavior.
+ *
+ * @param {string} topLevelType Record from `EventConstants`.
+ * @param {DOMEventTarget} topLevelTarget The listening component root node.
+ * @param {string} topLevelTargetID ID of `topLevelTarget`.
+ * @param {object} nativeEvent Native browser event.
+ * @return {?object} A SyntheticInputEvent.
+ */
+function extractBeforeInputEvent(
+ topLevelType,
+ topLevelTarget,
+ topLevelTargetID,
+ nativeEvent
+) {
+ var chars;
+
+ if (canUseTextInputEvent) {
+ chars = getNativeBeforeInputChars(topLevelType, nativeEvent);
+ } else {
+ chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);
+ }
+
+ // If no characters are being inserted, no BeforeInput event should
+ // be fired.
+ if (!chars) {
+ return null;
+ }
+
+ var event = SyntheticInputEvent.getPooled(
+ eventTypes.beforeInput,
+ topLevelTargetID,
+ nativeEvent
+ );
+
+ event.data = chars;
+ EventPropagators.accumulateTwoPhaseDispatches(event);
+ return event;
+}
+
/**
* Create an `onBeforeInput` event to match
* http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.
@@ -174,6 +535,10 @@ function isKeypressCommand(nativeEvent) {
* actually been added, contrary to the spec. Thus, `textInput` is the best
* available event to identify the characters that have actually been inserted
* into the target node.
+ *
+ * This plugin is also responsible for emitting `composition` events, thus
+ * allowing us to share composition fallback code for both `beforeInput` and
+ * `composition` event types.
*/
var BeforeInputEventPlugin = {
@@ -188,144 +553,54 @@ var BeforeInputEventPlugin = {
* @see {EventPluginHub.extractEvents}
*/
extractEvents: function(
- topLevelType,
- topLevelTarget,
- topLevelTargetID,
- nativeEvent) {
+ topLevelType,
+ topLevelTarget,
+ topLevelTargetID,
+ nativeEvent
+ ) {
+ return [
+ extractCompositionEvent(
+ topLevelType,
+ topLevelTarget,
+ topLevelTargetID,
+ nativeEvent
+ ),
+ extractBeforeInputEvent(
+ topLevelType,
+ topLevelTarget,
+ topLevelTargetID,
+ nativeEvent
+ )
+ ];
+ }
+};
- var chars;
-
- if (canUseTextInputEvent) {
- switch (topLevelType) {
- case topLevelTypes.topKeyPress:
- /**
- * If native `textInput` events are available, our goal is to make
- * use of them. However, there is a special case: the spacebar key.
- * In Webkit, preventing default on a spacebar `textInput` event
- * cancels character insertion, but it *also* causes the browser
- * to fall back to its default spacebar behavior of scrolling the
- * page.
- *
- * Tracking at:
- * https://code.google.com/p/chromium/issues/detail?id=355103
- *
- * To avoid this issue, use the keypress event as if no `textInput`
- * event is available.
- */
- var which = nativeEvent.which;
- if (which !== SPACEBAR_CODE) {
- return;
- }
+module.exports = BeforeInputEventPlugin;
- hasSpaceKeypress = true;
- chars = SPACEBAR_CHAR;
- break;
+},{"106":106,"110":110,"157":157,"16":16,"21":21,"22":22,"23":23}],4:[function(_dereq_,module,exports){
+/**
+ * Copyright 2013-2015, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ * @providesModule CSSCore
+ * @typechecks
+ */
- case topLevelTypes.topTextInput:
- // Record the characters to be added to the DOM.
- chars = nativeEvent.data;
+var invariant = _dereq_(150);
- // If it's a spacebar character, assume that we have already handled
- // it at the keypress level and bail immediately. Android Chrome
- // doesn't give us keycodes, so we need to blacklist it.
- if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
- return;
- }
+/**
+ * The CSSCore module specifies the API (and implements most of the methods)
+ * that should be used when dealing with the display of elements (via their
+ * CSS classes and visibility on screen. It is an API focused on mutating the
+ * display and not reading it as no logical state should be encoded in the
+ * display of elements.
+ */
- // Otherwise, carry on.
- break;
-
- default:
- // For other native event types, do nothing.
- return;
- }
- } else {
- switch (topLevelType) {
- case topLevelTypes.topPaste:
- // If a paste event occurs after a keypress, throw out the input
- // chars. Paste events should not lead to BeforeInput events.
- fallbackChars = null;
- break;
- case topLevelTypes.topKeyPress:
- /**
- * As of v27, Firefox may fire keypress events even when no character
- * will be inserted. A few possibilities:
- *
- * - `which` is `0`. Arrow keys, Esc key, etc.
- *
- * - `which` is the pressed key code, but no char is available.
- * Ex: 'AltGr + d` in Polish. There is no modified character for
- * this key combination and no character is inserted into the
- * document, but FF fires the keypress for char code `100` anyway.
- * No `input` event will occur.
- *
- * - `which` is the pressed key code, but a command combination is
- * being used. Ex: `Cmd+C`. No character is inserted, and no
- * `input` event will occur.
- */
- if (nativeEvent.which && !isKeypressCommand(nativeEvent)) {
- fallbackChars = String.fromCharCode(nativeEvent.which);
- }
- break;
- case topLevelTypes.topCompositionEnd:
- fallbackChars = nativeEvent.data;
- break;
- }
-
- // If no changes have occurred to the fallback string, no relevant
- // event has fired and we're done.
- if (fallbackChars === null) {
- return;
- }
-
- chars = fallbackChars;
- }
-
- // If no characters are being inserted, no BeforeInput event should
- // be fired.
- if (!chars) {
- return;
- }
-
- var event = SyntheticInputEvent.getPooled(
- eventTypes.beforeInput,
- topLevelTargetID,
- nativeEvent
- );
-
- event.data = chars;
- fallbackChars = null;
- EventPropagators.accumulateTwoPhaseDispatches(event);
- return event;
- }
-};
-
-module.exports = BeforeInputEventPlugin;
-
-},{"./EventConstants":17,"./EventPropagators":22,"./ExecutionEnvironment":23,"./SyntheticInputEvent":101,"./keyOf":147}],4:[function(_dereq_,module,exports){
-/**
- * Copyright 2013-2014, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- * @providesModule CSSCore
- * @typechecks
- */
-
-var invariant = _dereq_("./invariant");
-
-/**
- * The CSSCore module specifies the API (and implements most of the methods)
- * that should be used when dealing with the display of elements (via their
- * CSS classes and visibility on screen. It is an API focused on mutating the
- * display and not reading it as no logical state should be encoded in the
- * display of elements.
- */
-
-var CSSCore = {
+var CSSCore = {
/**
* Adds the class passed in to the element if it doesn't already have it.
@@ -412,9 +687,9 @@ var CSSCore = {
module.exports = CSSCore;
-},{"./invariant":140}],5:[function(_dereq_,module,exports){
+},{"150":150}],5:[function(_dereq_,module,exports){
/**
- * Copyright 2013-2014, Facebook, Inc.
+ * Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@@ -424,16 +699,20 @@ module.exports = CSSCore;
* @providesModule CSSProperty
*/
-"use strict";
+'use strict';
/**
* CSS properties which accept numbers but are not in units of "px".
*/
var isUnitlessNumber = {
+ boxFlex: true,
+ boxFlexGroup: true,
columnCount: true,
flex: true,
flexGrow: true,
+ flexPositive: true,
flexShrink: true,
+ flexNegative: true,
fontWeight: true,
lineClamp: true,
lineHeight: true,
@@ -446,7 +725,9 @@ var isUnitlessNumber = {
// SVG-related properties
fillOpacity: true,
- strokeOpacity: true
+ strokeDashoffset: true,
+ strokeOpacity: true,
+ strokeWidth: true
};
/**
@@ -533,7 +814,7 @@ module.exports = CSSProperty;
},{}],6:[function(_dereq_,module,exports){
/**
- * Copyright 2013-2014, Facebook, Inc.
+ * Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@@ -544,16 +825,16 @@ module.exports = CSSProperty;
* @typechecks static-only
*/
-"use strict";
+'use strict';
-var CSSProperty = _dereq_("./CSSProperty");
-var ExecutionEnvironment = _dereq_("./ExecutionEnvironment");
+var CSSProperty = _dereq_(5);
+var ExecutionEnvironment = _dereq_(22);
-var camelizeStyleName = _dereq_("./camelizeStyleName");
-var dangerousStyleValue = _dereq_("./dangerousStyleValue");
-var hyphenateStyleName = _dereq_("./hyphenateStyleName");
-var memoizeStringOnly = _dereq_("./memoizeStringOnly");
-var warning = _dereq_("./warning");
+var camelizeStyleName = _dereq_(121);
+var dangerousStyleValue = _dereq_(128);
+var hyphenateStyleName = _dereq_(148);
+var memoizeStringOnly = _dereq_(159);
+var warning = _dereq_(171);
var processStyleName = memoizeStringOnly(function(styleName) {
return hyphenateStyleName(styleName);
@@ -568,7 +849,14 @@ if (ExecutionEnvironment.canUseDOM) {
}
if ("production" !== "development") {
+ // 'msTransform' is correct, but the other prefixes should be capitalized
+ var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
+
+ // style values shouldn't contain a semicolon
+ var badStyleValueWithSemicolonPattern = /;\s*$/;
+
var warnedStyleNames = {};
+ var warnedStyleValues = {};
var warnHyphenatedStyleName = function(name) {
if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
@@ -578,10 +866,54 @@ if ("production" !== "development") {
warnedStyleNames[name] = true;
("production" !== "development" ? warning(
false,
- 'Unsupported style property ' + name + '. Did you mean ' +
- camelizeStyleName(name) + '?'
+ 'Unsupported style property %s. Did you mean %s?',
+ name,
+ camelizeStyleName(name)
+ ) : null);
+ };
+
+ var warnBadVendoredStyleName = function(name) {
+ if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
+ return;
+ }
+
+ warnedStyleNames[name] = true;
+ ("production" !== "development" ? warning(
+ false,
+ 'Unsupported vendor-prefixed style property %s. Did you mean %s?',
+ name,
+ name.charAt(0).toUpperCase() + name.slice(1)
+ ) : null);
+ };
+
+ var warnStyleValueWithSemicolon = function(name, value) {
+ if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
+ return;
+ }
+
+ warnedStyleValues[value] = true;
+ ("production" !== "development" ? warning(
+ false,
+ 'Style property values shouldn\'t contain a semicolon. ' +
+ 'Try "%s: %s" instead.',
+ name,
+ value.replace(badStyleValueWithSemicolonPattern, '')
) : null);
};
+
+ /**
+ * @param {string} name
+ * @param {*} value
+ */
+ var warnValidStyle = function(name, value) {
+ if (name.indexOf('-') > -1) {
+ warnHyphenatedStyleName(name);
+ } else if (badVendoredStyleNamePattern.test(name)) {
+ warnBadVendoredStyleName(name);
+ } else if (badStyleValueWithSemicolonPattern.test(value)) {
+ warnStyleValueWithSemicolon(name, value);
+ }
+ };
}
/**
@@ -607,12 +939,10 @@ var CSSPropertyOperations = {
if (!styles.hasOwnProperty(styleName)) {
continue;
}
+ var styleValue = styles[styleName];
if ("production" !== "development") {
- if (styleName.indexOf('-') > -1) {
- warnHyphenatedStyleName(styleName);
- }
+ warnValidStyle(styleName, styleValue);
}
- var styleValue = styles[styleName];
if (styleValue != null) {
serialized += processStyleName(styleName) + ':';
serialized += dangerousStyleValue(styleName, styleValue) + ';';
@@ -635,9 +965,7 @@ var CSSPropertyOperations = {
continue;
}
if ("production" !== "development") {
- if (styleName.indexOf('-') > -1) {
- warnHyphenatedStyleName(styleName);
- }
+ warnValidStyle(styleName, styles[styleName]);
}
var styleValue = dangerousStyleValue(styleName, styles[styleName]);
if (styleName === 'float') {
@@ -664,9 +992,9 @@ var CSSPropertyOperations = {
module.exports = CSSPropertyOperations;
-},{"./CSSProperty":5,"./ExecutionEnvironment":23,"./camelizeStyleName":112,"./dangerousStyleValue":119,"./hyphenateStyleName":138,"./memoizeStringOnly":149,"./warning":160}],7:[function(_dereq_,module,exports){
+},{"121":121,"128":128,"148":148,"159":159,"171":171,"22":22,"5":5}],7:[function(_dereq_,module,exports){
/**
- * Copyright 2013-2014, Facebook, Inc.
+ * Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@@ -676,12 +1004,12 @@ module.exports = CSSPropertyOperations;
* @providesModule CallbackQueue
*/
-"use strict";
+'use strict';
-var PooledClass = _dereq_("./PooledClass");
+var PooledClass = _dereq_(30);
-var assign = _dereq_("./Object.assign");
-var invariant = _dereq_("./invariant");
+var assign = _dereq_(29);
+var invariant = _dereq_(150);
/**
* A specialized pseudo-event module to help keep track of components waiting to
@@ -727,7 +1055,7 @@ assign(CallbackQueue.prototype, {
if (callbacks) {
("production" !== "development" ? invariant(
callbacks.length === contexts.length,
- "Mismatched list of contexts in callback queue"
+ 'Mismatched list of contexts in callback queue'
) : invariant(callbacks.length === contexts.length));
this._callbacks = null;
this._contexts = null;
@@ -762,9 +1090,9 @@ PooledClass.addPoolingTo(CallbackQueue);
module.exports = CallbackQueue;
-},{"./Object.assign":29,"./PooledClass":30,"./invariant":140}],8:[function(_dereq_,module,exports){
+},{"150":150,"29":29,"30":30}],8:[function(_dereq_,module,exports){
/**
- * Copyright 2013-2014, Facebook, Inc.
+ * Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@@ -774,18 +1102,18 @@ module.exports = CallbackQueue;
* @providesModule ChangeEventPlugin
*/
-"use strict";
+'use strict';
-var EventConstants = _dereq_("./EventConstants");
-var EventPluginHub = _dereq_("./EventPluginHub");
-var EventPropagators = _dereq_("./EventPropagators");
-var ExecutionEnvironment = _dereq_("./ExecutionEnvironment");
-var ReactUpdates = _dereq_("./ReactUpdates");
-var SyntheticEvent = _dereq_("./SyntheticEvent");
+var EventConstants = _dereq_(16);
+var EventPluginHub = _dereq_(18);
+var EventPropagators = _dereq_(21);
+var ExecutionEnvironment = _dereq_(22);
+var ReactUpdates = _dereq_(100);
+var SyntheticEvent = _dereq_(108);
-var isEventSupported = _dereq_("./isEventSupported");
-var isTextInputElement = _dereq_("./isTextInputElement");
-var keyOf = _dereq_("./keyOf");
+var isEventSupported = _dereq_(151);
+var isTextInputElement = _dereq_(153);
+var keyOf = _dereq_(157);
var topLevelTypes = EventConstants.topLevelTypes;
@@ -830,7 +1158,7 @@ var doesChangeEventBubble = false;
if (ExecutionEnvironment.canUseDOM) {
// See `handleChange` comment below
doesChangeEventBubble = isEventSupported('change') && (
- !('documentMode' in document) || document.documentMode > 8
+ (!('documentMode' in document) || document.documentMode > 8)
);
}
@@ -907,7 +1235,7 @@ if (ExecutionEnvironment.canUseDOM) {
// IE9 claims to support the input event but fails to trigger it when
// deleting text, so we ignore its input events
isInputEventSupported = isEventSupported('input') && (
- !('documentMode' in document) || document.documentMode > 9
+ (!('documentMode' in document) || document.documentMode > 9)
);
}
@@ -1144,9 +1472,9 @@ var ChangeEventPlugin = {
module.exports = ChangeEventPlugin;
-},{"./EventConstants":17,"./EventPluginHub":19,"./EventPropagators":22,"./ExecutionEnvironment":23,"./ReactUpdates":91,"./SyntheticEvent":99,"./isEventSupported":141,"./isTextInputElement":143,"./keyOf":147}],9:[function(_dereq_,module,exports){
+},{"100":100,"108":108,"151":151,"153":153,"157":157,"16":16,"18":18,"21":21,"22":22}],9:[function(_dereq_,module,exports){
/**
- * Copyright 2013-2014, Facebook, Inc.
+ * Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@@ -1157,7 +1485,7 @@ module.exports = ChangeEventPlugin;
* @typechecks
*/
-"use strict";
+'use strict';
var nextReactRootIndex = 0;
@@ -1171,358 +1499,60 @@ module.exports = ClientReactRootIndex;
},{}],10:[function(_dereq_,module,exports){
/**
- * Copyright 2013-2014, Facebook, Inc.
+ * Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
- * @providesModule CompositionEventPlugin
+ * @providesModule DOMChildrenOperations
* @typechecks static-only
*/
-"use strict";
-
-var EventConstants = _dereq_("./EventConstants");
-var EventPropagators = _dereq_("./EventPropagators");
-var ExecutionEnvironment = _dereq_("./ExecutionEnvironment");
-var ReactInputSelection = _dereq_("./ReactInputSelection");
-var SyntheticCompositionEvent = _dereq_("./SyntheticCompositionEvent");
-
-var getTextContentAccessor = _dereq_("./getTextContentAccessor");
-var keyOf = _dereq_("./keyOf");
-
-var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
-var START_KEYCODE = 229;
-
-var useCompositionEvent = (
- ExecutionEnvironment.canUseDOM &&
- 'CompositionEvent' in window
-);
-
-// In IE9+, we have access to composition events, but the data supplied
-// by the native compositionend event may be incorrect. In Korean, for example,
-// the compositionend event contains only one character regardless of
-// how many characters have been composed since compositionstart.
-// We therefore use the fallback data while still using the native
-// events as triggers.
-var useFallbackData = (
- !useCompositionEvent ||
- (
- 'documentMode' in document &&
- document.documentMode > 8 &&
- document.documentMode <= 11
- )
-);
-
-var topLevelTypes = EventConstants.topLevelTypes;
-var currentComposition = null;
+'use strict';
-// Events and their corresponding property names.
-var eventTypes = {
- compositionEnd: {
- phasedRegistrationNames: {
- bubbled: keyOf({onCompositionEnd: null}),
- captured: keyOf({onCompositionEndCapture: null})
- },
- dependencies: [
- topLevelTypes.topBlur,
- topLevelTypes.topCompositionEnd,
- topLevelTypes.topKeyDown,
- topLevelTypes.topKeyPress,
- topLevelTypes.topKeyUp,
- topLevelTypes.topMouseDown
- ]
- },
- compositionStart: {
- phasedRegistrationNames: {
- bubbled: keyOf({onCompositionStart: null}),
- captured: keyOf({onCompositionStartCapture: null})
- },
- dependencies: [
- topLevelTypes.topBlur,
- topLevelTypes.topCompositionStart,
- topLevelTypes.topKeyDown,
- topLevelTypes.topKeyPress,
- topLevelTypes.topKeyUp,
- topLevelTypes.topMouseDown
- ]
- },
- compositionUpdate: {
- phasedRegistrationNames: {
- bubbled: keyOf({onCompositionUpdate: null}),
- captured: keyOf({onCompositionUpdateCapture: null})
- },
- dependencies: [
- topLevelTypes.topBlur,
- topLevelTypes.topCompositionUpdate,
- topLevelTypes.topKeyDown,
- topLevelTypes.topKeyPress,
- topLevelTypes.topKeyUp,
- topLevelTypes.topMouseDown
- ]
- }
-};
+var Danger = _dereq_(13);
+var ReactMultiChildUpdateTypes = _dereq_(79);
-/**
- * Translate native top level events into event types.
- *
- * @param {string} topLevelType
- * @return {object}
- */
-function getCompositionEventType(topLevelType) {
- switch (topLevelType) {
- case topLevelTypes.topCompositionStart:
- return eventTypes.compositionStart;
- case topLevelTypes.topCompositionEnd:
- return eventTypes.compositionEnd;
- case topLevelTypes.topCompositionUpdate:
- return eventTypes.compositionUpdate;
- }
-}
+var setTextContent = _dereq_(165);
+var invariant = _dereq_(150);
/**
- * Does our fallback best-guess model think this event signifies that
- * composition has begun?
+ * Inserts `childNode` as a child of `parentNode` at the `index`.
*
- * @param {string} topLevelType
- * @param {object} nativeEvent
- * @return {boolean}
+ * @param {DOMElement} parentNode Parent node in which to insert.
+ * @param {DOMElement} childNode Child node to insert.
+ * @param {number} index Index at which to insert the child.
+ * @internal
*/
-function isFallbackStart(topLevelType, nativeEvent) {
- return (
- topLevelType === topLevelTypes.topKeyDown &&
- nativeEvent.keyCode === START_KEYCODE
+function insertChildAt(parentNode, childNode, index) {
+ // By exploiting arrays returning `undefined` for an undefined index, we can
+ // rely exclusively on `insertBefore(node, null)` instead of also using
+ // `appendChild(node)`. However, using `undefined` is not allowed by all
+ // browsers so we must replace it with `null`.
+ parentNode.insertBefore(
+ childNode,
+ parentNode.childNodes[index] || null
);
}
/**
- * Does our fallback mode think that this event is the end of composition?
- *
- * @param {string} topLevelType
- * @param {object} nativeEvent
- * @return {boolean}
- */
-function isFallbackEnd(topLevelType, nativeEvent) {
- switch (topLevelType) {
- case topLevelTypes.topKeyUp:
- // Command keys insert or clear IME input.
- return (END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1);
- case topLevelTypes.topKeyDown:
- // Expect IME keyCode on each keydown. If we get any other
- // code we must have exited earlier.
- return (nativeEvent.keyCode !== START_KEYCODE);
- case topLevelTypes.topKeyPress:
- case topLevelTypes.topMouseDown:
- case topLevelTypes.topBlur:
- // Events are not possible without cancelling IME.
- return true;
- default:
- return false;
- }
-}
-
-/**
- * Helper class stores information about selection and document state
- * so we can figure out what changed at a later date.
- *
- * @param {DOMEventTarget} root
- */
-function FallbackCompositionState(root) {
- this.root = root;
- this.startSelection = ReactInputSelection.getSelection(root);
- this.startValue = this.getText();
-}
-
-/**
- * Get current text of input.
- *
- * @return {string}
- */
-FallbackCompositionState.prototype.getText = function() {
- return this.root.value || this.root[getTextContentAccessor()];
-};
-
-/**
- * Text that has changed since the start of composition.
- *
- * @return {string}
+ * Operations for updating with DOM children.
*/
-FallbackCompositionState.prototype.getData = function() {
- var endValue = this.getText();
- var prefixLength = this.startSelection.start;
- var suffixLength = this.startValue.length - this.startSelection.end;
-
- return endValue.substr(
- prefixLength,
- endValue.length - suffixLength - prefixLength
- );
-};
+var DOMChildrenOperations = {
-/**
- * This plugin creates `onCompositionStart`, `onCompositionUpdate` and
- * `onCompositionEnd` events on inputs, textareas and contentEditable
- * nodes.
- */
-var CompositionEventPlugin = {
+ dangerouslyReplaceNodeWithMarkup: Danger.dangerouslyReplaceNodeWithMarkup,
- eventTypes: eventTypes,
+ updateTextContent: setTextContent,
/**
- * @param {string} topLevelType Record from `EventConstants`.
- * @param {DOMEventTarget} topLevelTarget The listening component root node.
- * @param {string} topLevelTargetID ID of `topLevelTarget`.
- * @param {object} nativeEvent Native browser event.
- * @return {*} An accumulation of synthetic events.
- * @see {EventPluginHub.extractEvents}
- */
- extractEvents: function(
- topLevelType,
- topLevelTarget,
- topLevelTargetID,
- nativeEvent) {
-
- var eventType;
- var data;
-
- if (useCompositionEvent) {
- eventType = getCompositionEventType(topLevelType);
- } else if (!currentComposition) {
- if (isFallbackStart(topLevelType, nativeEvent)) {
- eventType = eventTypes.compositionStart;
- }
- } else if (isFallbackEnd(topLevelType, nativeEvent)) {
- eventType = eventTypes.compositionEnd;
- }
-
- if (useFallbackData) {
- // The current composition is stored statically and must not be
- // overwritten while composition continues.
- if (!currentComposition && eventType === eventTypes.compositionStart) {
- currentComposition = new FallbackCompositionState(topLevelTarget);
- } else if (eventType === eventTypes.compositionEnd) {
- if (currentComposition) {
- data = currentComposition.getData();
- currentComposition = null;
- }
- }
- }
-
- if (eventType) {
- var event = SyntheticCompositionEvent.getPooled(
- eventType,
- topLevelTargetID,
- nativeEvent
- );
- if (data) {
- // Inject data generated from fallback path into the synthetic event.
- // This matches the property of native CompositionEventInterface.
- event.data = data;
- }
- EventPropagators.accumulateTwoPhaseDispatches(event);
- return event;
- }
- }
-};
-
-module.exports = CompositionEventPlugin;
-
-},{"./EventConstants":17,"./EventPropagators":22,"./ExecutionEnvironment":23,"./ReactInputSelection":65,"./SyntheticCompositionEvent":97,"./getTextContentAccessor":135,"./keyOf":147}],11:[function(_dereq_,module,exports){
-/**
- * Copyright 2013-2014, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- * @providesModule DOMChildrenOperations
- * @typechecks static-only
- */
-
-"use strict";
-
-var Danger = _dereq_("./Danger");
-var ReactMultiChildUpdateTypes = _dereq_("./ReactMultiChildUpdateTypes");
-
-var getTextContentAccessor = _dereq_("./getTextContentAccessor");
-var invariant = _dereq_("./invariant");
-
-/**
- * The DOM property to use when setting text content.
- *
- * @type {string}
- * @private
- */
-var textContentAccessor = getTextContentAccessor();
-
-/**
- * Inserts `childNode` as a child of `parentNode` at the `index`.
- *
- * @param {DOMElement} parentNode Parent node in which to insert.
- * @param {DOMElement} childNode Child node to insert.
- * @param {number} index Index at which to insert the child.
- * @internal
- */
-function insertChildAt(parentNode, childNode, index) {
- // By exploiting arrays returning `undefined` for an undefined index, we can
- // rely exclusively on `insertBefore(node, null)` instead of also using
- // `appendChild(node)`. However, using `undefined` is not allowed by all
- // browsers so we must replace it with `null`.
- parentNode.insertBefore(
- childNode,
- parentNode.childNodes[index] || null
- );
-}
-
-var updateTextContent;
-if (textContentAccessor === 'textContent') {
- /**
- * Sets the text content of `node` to `text`.
- *
- * @param {DOMElement} node Node to change
- * @param {string} text New text content
- */
- updateTextContent = function(node, text) {
- node.textContent = text;
- };
-} else {
- /**
- * Sets the text content of `node` to `text`.
- *
- * @param {DOMElement} node Node to change
- * @param {string} text New text content
- */
- updateTextContent = function(node, text) {
- // In order to preserve newlines correctly, we can't use .innerText to set
- // the contents (see #1080), so we empty the element then append a text node
- while (node.firstChild) {
- node.removeChild(node.firstChild);
- }
- if (text) {
- var doc = node.ownerDocument || document;
- node.appendChild(doc.createTextNode(text));
- }
- };
-}
-
-/**
- * Operations for updating with DOM children.
- */
-var DOMChildrenOperations = {
-
- dangerouslyReplaceNodeWithMarkup: Danger.dangerouslyReplaceNodeWithMarkup,
-
- updateTextContent: updateTextContent,
-
- /**
- * Updates a component's children by processing a series of updates. The
- * update configurations are each expected to have a `parentNode` property.
- *
- * @param {array<object>} updates List of update configurations.
- * @param {array<string>} markupList List of markup strings.
- * @internal
+ * Updates a component's children by processing a series of updates. The
+ * update configurations are each expected to have a `parentNode` property.
+ *
+ * @param {array<object>} updates List of update configurations.
+ * @param {array<string>} markupList List of markup strings.
+ * @internal
*/
processUpdates: function(updates, markupList) {
var update;
@@ -1531,7 +1561,8 @@ var DOMChildrenOperations = {
// List of children that will be moved or removed.
var updatedChildren = null;
- for (var i = 0; update = updates[i]; i++) {
+ for (var i = 0; i < updates.length; i++) {
+ update = updates[i];
if (update.type === ReactMultiChildUpdateTypes.MOVE_EXISTING ||
update.type === ReactMultiChildUpdateTypes.REMOVE_NODE) {
var updatedIndex = update.fromIndex;
@@ -1543,7 +1574,7 @@ var DOMChildrenOperations = {
'processUpdates(): Unable to find child %s of element. This ' +
'probably means the DOM was unexpectedly mutated (e.g., by the ' +
'browser), usually due to forgetting a <tbody> when using tables, ' +
- 'nesting tags like <form>, <p>, or <a>, or using non-SVG elements '+
+ 'nesting tags like <form>, <p>, or <a>, or using non-SVG elements ' +
'in an <svg> parent. Try inspecting the child nodes of the element ' +
'with React ID `%s`.',
updatedIndex,
@@ -1568,7 +1599,8 @@ var DOMChildrenOperations = {
}
}
- for (var k = 0; update = updates[k]; k++) {
+ for (var k = 0; k < updates.length; k++) {
+ update = updates[k];
switch (update.type) {
case ReactMultiChildUpdateTypes.INSERT_MARKUP:
insertChildAt(
@@ -1585,7 +1617,7 @@ var DOMChildrenOperations = {
);
break;
case ReactMultiChildUpdateTypes.TEXT_CONTENT:
- updateTextContent(
+ setTextContent(
update.parentNode,
update.textContent
);
@@ -1601,9 +1633,9 @@ var DOMChildrenOperations = {
module.exports = DOMChildrenOperations;
-},{"./Danger":14,"./ReactMultiChildUpdateTypes":72,"./getTextContentAccessor":135,"./invariant":140}],12:[function(_dereq_,module,exports){
+},{"13":13,"150":150,"165":165,"79":79}],11:[function(_dereq_,module,exports){
/**
- * Copyright 2013-2014, Facebook, Inc.
+ * Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@@ -1616,9 +1648,9 @@ module.exports = DOMChildrenOperations;
/*jslint bitwise: true */
-"use strict";
+'use strict';
-var invariant = _dereq_("./invariant");
+var invariant = _dereq_(150);
function checkMask(value, bitmask) {
return (value & bitmask) === bitmask;
@@ -1898,9 +1930,9 @@ var DOMProperty = {
module.exports = DOMProperty;
-},{"./invariant":140}],13:[function(_dereq_,module,exports){
+},{"150":150}],12:[function(_dereq_,module,exports){
/**
- * Copyright 2013-2014, Facebook, Inc.
+ * Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@@ -1911,13 +1943,12 @@ module.exports = DOMProperty;
* @typechecks static-only
*/
-"use strict";
+'use strict';
-var DOMProperty = _dereq_("./DOMProperty");
+var DOMProperty = _dereq_(11);
-var escapeTextForBrowser = _dereq_("./escapeTextForBrowser");
-var memoizeStringOnly = _dereq_("./memoizeStringOnly");
-var warning = _dereq_("./warning");
+var quoteAttributeValueForBrowser = _dereq_(163);
+var warning = _dereq_(171);
function shouldIgnoreValue(name, value) {
return value == null ||
@@ -1927,10 +1958,6 @@ function shouldIgnoreValue(name, value) {
(DOMProperty.hasOverloadedBooleanValue[name] && value === false);
}
-var processAttributeNameAndPrefix = memoizeStringOnly(function(name) {
- return escapeTextForBrowser(name) + '="';
-});
-
if ("production" !== "development") {
var reactProps = {
children: true,
@@ -1962,7 +1989,9 @@ if ("production" !== "development") {
// logging too much when using transferPropsTo.
("production" !== "development" ? warning(
standardName == null,
- 'Unknown DOM property ' + name + '. Did you mean ' + standardName + '?'
+ 'Unknown DOM property %s. Did you mean %s?',
+ name,
+ standardName
) : null);
};
@@ -1980,8 +2009,8 @@ var DOMPropertyOperations = {
* @return {string} Markup string.
*/
createMarkupForID: function(id) {
- return processAttributeNameAndPrefix(DOMProperty.ID_ATTRIBUTE_NAME) +
- escapeTextForBrowser(id) + '"';
+ return DOMProperty.ID_ATTRIBUTE_NAME + '=' +
+ quoteAttributeValueForBrowser(id);
},
/**
@@ -2000,16 +2029,14 @@ var DOMPropertyOperations = {
var attributeName = DOMProperty.getAttributeName[name];
if (DOMProperty.hasBooleanValue[name] ||
(DOMProperty.hasOverloadedBooleanValue[name] && value === true)) {
- return escapeTextForBrowser(attributeName);
+ return attributeName;
}
- return processAttributeNameAndPrefix(attributeName) +
- escapeTextForBrowser(value) + '"';
+ return attributeName + '=' + quoteAttributeValueForBrowser(value);
} else if (DOMProperty.isCustomAttribute(name)) {
if (value == null) {
return '';
}
- return processAttributeNameAndPrefix(name) +
- escapeTextForBrowser(value) + '"';
+ return name + '=' + quoteAttributeValueForBrowser(value);
} else if ("production" !== "development") {
warnUnknownProperty(name);
}
@@ -2093,9 +2120,9 @@ var DOMPropertyOperations = {
module.exports = DOMPropertyOperations;
-},{"./DOMProperty":12,"./escapeTextForBrowser":123,"./memoizeStringOnly":149,"./warning":160}],14:[function(_dereq_,module,exports){
+},{"11":11,"163":163,"171":171}],13:[function(_dereq_,module,exports){
/**
- * Copyright 2013-2014, Facebook, Inc.
+ * Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@@ -2108,14 +2135,14 @@ module.exports = DOMPropertyOperations;
/*jslint evil: true, sub: true */
-"use strict";
+'use strict';
-var ExecutionEnvironment = _dereq_("./ExecutionEnvironment");
+var ExecutionEnvironment = _dereq_(22);
-var createNodesFromMarkup = _dereq_("./createNodesFromMarkup");
-var emptyFunction = _dereq_("./emptyFunction");
-var getMarkupWrap = _dereq_("./getMarkupWrap");
-var invariant = _dereq_("./invariant");
+var createNodesFromMarkup = _dereq_(126);
+var emptyFunction = _dereq_(129);
+var getMarkupWrap = _dereq_(142);
+var invariant = _dereq_(150);
var OPEN_TAG_NAME_EXP = /^(<[^ \/>]+)/;
var RESULT_INDEX_ATTR = 'data-danger-index';
@@ -2178,7 +2205,8 @@ var Danger = {
// This for-in loop skips the holes of the sparse array. The order of
// iteration should follow the order of assignment, which happens to match
// numerical index order, but we don't rely on that.
- for (var resultIndex in markupListByNodeName) {
+ var resultIndex;
+ for (resultIndex in markupListByNodeName) {
if (markupListByNodeName.hasOwnProperty(resultIndex)) {
var markup = markupListByNodeName[resultIndex];
@@ -2199,8 +2227,8 @@ var Danger = {
emptyFunction // Do nothing special with <script> tags.
);
- for (i = 0; i < renderNodes.length; ++i) {
- var renderNode = renderNodes[i];
+ for (var j = 0; j < renderNodes.length; ++j) {
+ var renderNode = renderNodes[j];
if (renderNode.hasAttribute &&
renderNode.hasAttribute(RESULT_INDEX_ATTR)) {
@@ -2220,7 +2248,7 @@ var Danger = {
} else if ("production" !== "development") {
console.error(
- "Danger: Discarding unexpected node:",
+ 'Danger: Discarding unexpected node:',
renderNode
);
}
@@ -2266,7 +2294,7 @@ var Danger = {
'dangerouslyReplaceNodeWithMarkup(...): Cannot replace markup of the ' +
'<html> node. This is because browser quirks make this unreliable ' +
'and/or slow. If you want to render to the root you must use ' +
- 'server rendering. See renderComponentToString().'
+ 'server rendering. See React.renderToString().'
) : invariant(oldChild.tagName.toLowerCase() !== 'html'));
var newChild = createNodesFromMarkup(markup, emptyFunction)[0];
@@ -2277,9 +2305,9 @@ var Danger = {
module.exports = Danger;
-},{"./ExecutionEnvironment":23,"./createNodesFromMarkup":117,"./emptyFunction":121,"./getMarkupWrap":132,"./invariant":140}],15:[function(_dereq_,module,exports){
+},{"126":126,"129":129,"142":142,"150":150,"22":22}],14:[function(_dereq_,module,exports){
/**
- * Copyright 2013-2014, Facebook, Inc.
+ * Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@@ -2289,9 +2317,9 @@ module.exports = Danger;
* @providesModule DefaultEventPluginOrder
*/
-"use strict";
+'use strict';
- var keyOf = _dereq_("./keyOf");
+var keyOf = _dereq_(157);
/**
* Module that is injectable into `EventPluginHub`, that specifies a
@@ -2309,7 +2337,6 @@ var DefaultEventPluginOrder = [
keyOf({EnterLeaveEventPlugin: null}),
keyOf({ChangeEventPlugin: null}),
keyOf({SelectEventPlugin: null}),
- keyOf({CompositionEventPlugin: null}),
keyOf({BeforeInputEventPlugin: null}),
keyOf({AnalyticsEventPlugin: null}),
keyOf({MobileSafariClickEventPlugin: null})
@@ -2317,9 +2344,9 @@ var DefaultEventPluginOrder = [
module.exports = DefaultEventPluginOrder;
-},{"./keyOf":147}],16:[function(_dereq_,module,exports){
+},{"157":157}],15:[function(_dereq_,module,exports){
/**
- * Copyright 2013-2014, Facebook, Inc.
+ * Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@@ -2330,14 +2357,14 @@ module.exports = DefaultEventPluginOrder;
* @typechecks static-only
*/
-"use strict";
+'use strict';
-var EventConstants = _dereq_("./EventConstants");
-var EventPropagators = _dereq_("./EventPropagators");
-var SyntheticMouseEvent = _dereq_("./SyntheticMouseEvent");
+var EventConstants = _dereq_(16);
+var EventPropagators = _dereq_(21);
+var SyntheticMouseEvent = _dereq_(112);
-var ReactMount = _dereq_("./ReactMount");
-var keyOf = _dereq_("./keyOf");
+var ReactMount = _dereq_(77);
+var keyOf = _dereq_(157);
var topLevelTypes = EventConstants.topLevelTypes;
var getFirstReactDOM = ReactMount.getFirstReactDOM;
@@ -2457,9 +2484,9 @@ var EnterLeaveEventPlugin = {
module.exports = EnterLeaveEventPlugin;
-},{"./EventConstants":17,"./EventPropagators":22,"./ReactMount":70,"./SyntheticMouseEvent":103,"./keyOf":147}],17:[function(_dereq_,module,exports){
+},{"112":112,"157":157,"16":16,"21":21,"77":77}],16:[function(_dereq_,module,exports){
/**
- * Copyright 2013-2014, Facebook, Inc.
+ * Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@@ -2469,9 +2496,9 @@ module.exports = EnterLeaveEventPlugin;
* @providesModule EventConstants
*/
-"use strict";
+'use strict';
-var keyMirror = _dereq_("./keyMirror");
+var keyMirror = _dereq_(156);
var PropagationPhases = keyMirror({bubbled: null, captured: null});
@@ -2529,9 +2556,9 @@ var EventConstants = {
module.exports = EventConstants;
-},{"./keyMirror":146}],18:[function(_dereq_,module,exports){
+},{"156":156}],17:[function(_dereq_,module,exports){
/**
- * Copyright 2013-2014 Facebook, Inc.
+ * Copyright 2013-2015, Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -2549,7 +2576,7 @@ module.exports = EventConstants;
* @typechecks
*/
-var emptyFunction = _dereq_("./emptyFunction");
+var emptyFunction = _dereq_(129);
/**
* Upstream version of event listener. Does not take into account specific
@@ -2617,9 +2644,9 @@ var EventListener = {
module.exports = EventListener;
-},{"./emptyFunction":121}],19:[function(_dereq_,module,exports){
+},{"129":129}],18:[function(_dereq_,module,exports){
/**
- * Copyright 2013-2014, Facebook, Inc.
+ * Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@@ -2629,14 +2656,14 @@ module.exports = EventListener;
* @providesModule EventPluginHub
*/
-"use strict";
+'use strict';
-var EventPluginRegistry = _dereq_("./EventPluginRegistry");
-var EventPluginUtils = _dereq_("./EventPluginUtils");
+var EventPluginRegistry = _dereq_(19);
+var EventPluginUtils = _dereq_(20);
-var accumulateInto = _dereq_("./accumulateInto");
-var forEachAccumulated = _dereq_("./forEachAccumulated");
-var invariant = _dereq_("./invariant");
+var accumulateInto = _dereq_(118);
+var forEachAccumulated = _dereq_(135);
+var invariant = _dereq_(150);
/**
* Internal store for event listeners
@@ -2678,12 +2705,14 @@ var executeDispatchesAndRelease = function(event) {
var InstanceHandle = null;
function validateInstanceHandle() {
- var invalid = !InstanceHandle||
- !InstanceHandle.traverseTwoPhase ||
- !InstanceHandle.traverseEnterLeave;
- if (invalid) {
- throw new Error('InstanceHandle not injected before use!');
- }
+ var valid =
+ InstanceHandle &&
+ InstanceHandle.traverseTwoPhase &&
+ InstanceHandle.traverseEnterLeave;
+ ("production" !== "development" ? invariant(
+ valid,
+ 'InstanceHandle not injected before use!'
+ ) : invariant(valid));
}
/**
@@ -2891,9 +2920,9 @@ var EventPluginHub = {
module.exports = EventPluginHub;
-},{"./EventPluginRegistry":20,"./EventPluginUtils":21,"./accumulateInto":109,"./forEachAccumulated":126,"./invariant":140}],20:[function(_dereq_,module,exports){
+},{"118":118,"135":135,"150":150,"19":19,"20":20}],19:[function(_dereq_,module,exports){
/**
- * Copyright 2013-2014, Facebook, Inc.
+ * Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@@ -2904,9 +2933,9 @@ module.exports = EventPluginHub;
* @typechecks static-only
*/
-"use strict";
+'use strict';
-var invariant = _dereq_("./invariant");
+var invariant = _dereq_(150);
/**
* Injectable ordering of event plugins.
@@ -3169,9 +3198,9 @@ var EventPluginRegistry = {
module.exports = EventPluginRegistry;
-},{"./invariant":140}],21:[function(_dereq_,module,exports){
+},{"150":150}],20:[function(_dereq_,module,exports){
/**
- * Copyright 2013-2014, Facebook, Inc.
+ * Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@@ -3181,11 +3210,11 @@ module.exports = EventPluginRegistry;
* @providesModule EventPluginUtils
*/
-"use strict";
+'use strict';
-var EventConstants = _dereq_("./EventConstants");
+var EventConstants = _dereq_(16);
-var invariant = _dereq_("./invariant");
+var invariant = _dereq_(150);
/**
* Injected dependencies:
@@ -3287,8 +3316,8 @@ function executeDispatch(event, listener, domID) {
/**
* Standard/simple iteration through an event's collected dispatches.
*/
-function executeDispatchesInOrder(event, executeDispatch) {
- forEachEventDispatch(event, executeDispatch);
+function executeDispatchesInOrder(event, cb) {
+ forEachEventDispatch(event, cb);
event._dispatchListeners = null;
event._dispatchIDs = null;
}
@@ -3388,9 +3417,9 @@ var EventPluginUtils = {
module.exports = EventPluginUtils;
-},{"./EventConstants":17,"./invariant":140}],22:[function(_dereq_,module,exports){
+},{"150":150,"16":16}],21:[function(_dereq_,module,exports){
/**
- * Copyright 2013-2014, Facebook, Inc.
+ * Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@@ -3400,13 +3429,13 @@ module.exports = EventPluginUtils;
* @providesModule EventPropagators
*/
-"use strict";
+'use strict';
-var EventConstants = _dereq_("./EventConstants");
-var EventPluginHub = _dereq_("./EventPluginHub");
+var EventConstants = _dereq_(16);
+var EventPluginHub = _dereq_(18);
-var accumulateInto = _dereq_("./accumulateInto");
-var forEachAccumulated = _dereq_("./forEachAccumulated");
+var accumulateInto = _dereq_(118);
+var forEachAccumulated = _dereq_(135);
var PropagationPhases = EventConstants.PropagationPhases;
var getListener = EventPluginHub.getListener;
@@ -3528,9 +3557,9 @@ var EventPropagators = {
module.exports = EventPropagators;
-},{"./EventConstants":17,"./EventPluginHub":19,"./accumulateInto":109,"./forEachAccumulated":126}],23:[function(_dereq_,module,exports){
+},{"118":118,"135":135,"16":16,"18":18}],22:[function(_dereq_,module,exports){
/**
- * Copyright 2013-2014, Facebook, Inc.
+ * Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@@ -3545,9 +3574,8 @@ module.exports = EventPropagators;
"use strict";
var canUseDOM = !!(
- typeof window !== 'undefined' &&
- window.document &&
- window.document.createElement
+ (typeof window !== 'undefined' &&
+ window.document && window.document.createElement)
);
/**
@@ -3573,9 +3601,100 @@ var ExecutionEnvironment = {
module.exports = ExecutionEnvironment;
-},{}],24:[function(_dereq_,module,exports){
+},{}],23:[function(_dereq_,module,exports){
+/**
+ * Copyright 2013-2015, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ * @providesModule FallbackCompositionState
+ * @typechecks static-only
+ */
+
+'use strict';
+
+var PooledClass = _dereq_(30);
+
+var assign = _dereq_(29);
+var getTextContentAccessor = _dereq_(145);
+
+/**
+ * This helper class stores information about text content of a target node,
+ * allowing comparison of content before and after a given event.
+ *
+ * Identify the node where selection currently begins, then observe
+ * both its text content and its current position in the DOM. Since the
+ * browser may natively replace the target node during composition, we can
+ * use its position to find its replacement.
+ *
+ * @param {DOMEventTarget} root
+ */
+function FallbackCompositionState(root) {
+ this._root = root;
+ this._startText = this.getText();
+ this._fallbackText = null;
+}
+
+assign(FallbackCompositionState.prototype, {
+ /**
+ * Get current text of input.
+ *
+ * @return {string}
+ */
+ getText: function() {
+ if ('value' in this._root) {
+ return this._root.value;
+ }
+ return this._root[getTextContentAccessor()];
+ },
+
+ /**
+ * Determine the differing substring between the initially stored
+ * text content and the current content.
+ *
+ * @return {string}
+ */
+ getData: function() {
+ if (this._fallbackText) {
+ return this._fallbackText;
+ }
+
+ var start;
+ var startValue = this._startText;
+ var startLength = startValue.length;
+ var end;
+ var endValue = this.getText();
+ var endLength = endValue.length;
+
+ for (start = 0; start < startLength; start++) {
+ if (startValue[start] !== endValue[start]) {
+ break;
+ }
+ }
+
+ var minEnd = startLength - start;
+ for (end = 1; end <= minEnd; end++) {
+ if (startValue[startLength - end] !== endValue[endLength - end]) {
+ break;
+ }
+ }
+
+ var sliceTail = end > 1 ? 1 - end : undefined;
+ this._fallbackText = endValue.slice(start, sliceTail);
+ return this._fallbackText;
+ }
+});
+
+PooledClass.addPoolingTo(FallbackCompositionState);
+
+module.exports = FallbackCompositionState;
+
+},{"145":145,"29":29,"30":30}],24:[function(_dereq_,module,exports){
/**
- * Copyright 2013-2014, Facebook, Inc.
+ * Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@@ -3587,10 +3706,10 @@ module.exports = ExecutionEnvironment;
/*jslint bitwise: true*/
-"use strict";
+'use strict';
-var DOMProperty = _dereq_("./DOMProperty");
-var ExecutionEnvironment = _dereq_("./ExecutionEnvironment");
+var DOMProperty = _dereq_(11);
+var ExecutionEnvironment = _dereq_(22);
var MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE;
var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY;
@@ -3670,8 +3789,10 @@ var HTMLDOMPropertyConfig = {
formNoValidate: HAS_BOOLEAN_VALUE,
formTarget: MUST_USE_ATTRIBUTE,
frameBorder: MUST_USE_ATTRIBUTE,
+ headers: null,
height: MUST_USE_ATTRIBUTE,
hidden: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
+ high: null,
href: null,
hrefLang: null,
htmlFor: null,
@@ -3682,6 +3803,7 @@ var HTMLDOMPropertyConfig = {
lang: null,
list: MUST_USE_ATTRIBUTE,
loop: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
+ low: null,
manifest: MUST_USE_ATTRIBUTE,
marginHeight: null,
marginWidth: null,
@@ -3695,7 +3817,8 @@ var HTMLDOMPropertyConfig = {
muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
name: null,
noValidate: HAS_BOOLEAN_VALUE,
- open: null,
+ open: HAS_BOOLEAN_VALUE,
+ optimum: null,
pattern: null,
placeholder: null,
poster: null,
@@ -3709,6 +3832,7 @@ var HTMLDOMPropertyConfig = {
rowSpan: null,
sandbox: null,
scope: null,
+ scoped: HAS_BOOLEAN_VALUE,
scrolling: null,
seamless: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
@@ -3735,12 +3859,24 @@ var HTMLDOMPropertyConfig = {
/**
* Non-standard Properties
*/
- autoCapitalize: null, // Supported in Mobile Safari for keyboard hints
- autoCorrect: null, // Supported in Mobile Safari for keyboard hints
- itemProp: MUST_USE_ATTRIBUTE, // Microdata: http://schema.org/docs/gs.html
- itemScope: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE, // Microdata: http://schema.org/docs/gs.html
- itemType: MUST_USE_ATTRIBUTE, // Microdata: http://schema.org/docs/gs.html
- property: null // Supports OG in meta tags
+ // autoCapitalize and autoCorrect are supported in Mobile Safari for
+ // keyboard hints.
+ autoCapitalize: null,
+ autoCorrect: null,
+ // itemProp, itemScope, itemType are for
+ // Microdata support. See http://schema.org/docs/gs.html
+ itemProp: MUST_USE_ATTRIBUTE,
+ itemScope: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
+ itemType: MUST_USE_ATTRIBUTE,
+ // itemID and itemRef are for Microdata support as well but
+ // only specified in the the WHATWG spec document. See
+ // https://html.spec.whatwg.org/multipage/microdata.html#microdata-dom-api
+ itemID: MUST_USE_ATTRIBUTE,
+ itemRef: MUST_USE_ATTRIBUTE,
+ // property is supported for OpenGraph in meta tags.
+ property: null,
+ // IE-only attribute that controls focus behavior
+ unselectable: MUST_USE_ATTRIBUTE
},
DOMAttributeNames: {
acceptCharset: 'accept-charset',
@@ -3754,7 +3890,9 @@ var HTMLDOMPropertyConfig = {
autoCorrect: 'autocorrect',
autoFocus: 'autofocus',
autoPlay: 'autoplay',
- encType: 'enctype',
+ // `encoding` is equivalent to `enctype`, IE8 lacks an `enctype` setter.
+ // http://www.w3.org/TR/html5/forms.html#dom-fs-encoding
+ encType: 'encoding',
hrefLang: 'hreflang',
radioGroup: 'radiogroup',
spellCheck: 'spellcheck',
@@ -3765,9 +3903,9 @@ var HTMLDOMPropertyConfig = {
module.exports = HTMLDOMPropertyConfig;
-},{"./DOMProperty":12,"./ExecutionEnvironment":23}],25:[function(_dereq_,module,exports){
+},{"11":11,"22":22}],25:[function(_dereq_,module,exports){
/**
- * Copyright 2013-2014, Facebook, Inc.
+ * Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@@ -3778,10 +3916,10 @@ module.exports = HTMLDOMPropertyConfig;
* @typechecks static-only
*/
-"use strict";
+'use strict';
-var ReactLink = _dereq_("./ReactLink");
-var ReactStateSetters = _dereq_("./ReactStateSetters");
+var ReactLink = _dereq_(75);
+var ReactStateSetters = _dereq_(94);
/**
* A simple mixin around ReactLink.forState().
@@ -3806,9 +3944,9 @@ var LinkedStateMixin = {
module.exports = LinkedStateMixin;
-},{"./ReactLink":68,"./ReactStateSetters":85}],26:[function(_dereq_,module,exports){
+},{"75":75,"94":94}],26:[function(_dereq_,module,exports){
/**
- * Copyright 2013-2014, Facebook, Inc.
+ * Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@@ -3819,11 +3957,11 @@ module.exports = LinkedStateMixin;
* @typechecks static-only
*/
-"use strict";
+'use strict';
-var ReactPropTypes = _dereq_("./ReactPropTypes");
+var ReactPropTypes = _dereq_(86);
-var invariant = _dereq_("./invariant");
+var invariant = _dereq_(150);
var hasReadOnlyValue = {
'button': true,
@@ -3890,7 +4028,7 @@ var LinkedValueUtils = {
props.onChange ||
props.readOnly ||
props.disabled) {
- return;
+ return null;
}
return new Error(
'You provided a `value` prop to a form field without an ' +
@@ -3904,7 +4042,7 @@ var LinkedValueUtils = {
props.onChange ||
props.readOnly ||
props.disabled) {
- return;
+ return null;
}
return new Error(
'You provided a `checked` prop to a form field without an ' +
@@ -3960,9 +4098,9 @@ var LinkedValueUtils = {
module.exports = LinkedValueUtils;
-},{"./ReactPropTypes":79,"./invariant":140}],27:[function(_dereq_,module,exports){
+},{"150":150,"86":86}],27:[function(_dereq_,module,exports){
/**
- * Copyright 2014, Facebook, Inc.
+ * Copyright 2014-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@@ -3972,13 +4110,13 @@ module.exports = LinkedValueUtils;
* @providesModule LocalEventTrapMixin
*/
-"use strict";
+'use strict';
-var ReactBrowserEventEmitter = _dereq_("./ReactBrowserEventEmitter");
+var ReactBrowserEventEmitter = _dereq_(33);
-var accumulateInto = _dereq_("./accumulateInto");
-var forEachAccumulated = _dereq_("./forEachAccumulated");
-var invariant = _dereq_("./invariant");
+var accumulateInto = _dereq_(118);
+var forEachAccumulated = _dereq_(135);
+var invariant = _dereq_(150);
function remove(event) {
event.remove();
@@ -3987,10 +4125,17 @@ function remove(event) {
var LocalEventTrapMixin = {
trapBubbledEvent:function(topLevelType, handlerBaseName) {
("production" !== "development" ? invariant(this.isMounted(), 'Must be mounted to trap events') : invariant(this.isMounted()));
+ // If a component renders to null or if another component fatals and causes
+ // the state of the tree to be corrupted, `node` here can be null.
+ var node = this.getDOMNode();
+ ("production" !== "development" ? invariant(
+ node,
+ 'LocalEventTrapMixin.trapBubbledEvent(...): Requires node to be rendered.'
+ ) : invariant(node));
var listener = ReactBrowserEventEmitter.trapBubbledEvent(
topLevelType,
handlerBaseName,
- this.getDOMNode()
+ node
);
this._localEventListeners =
accumulateInto(this._localEventListeners, listener);
@@ -4008,9 +4153,9 @@ var LocalEventTrapMixin = {
module.exports = LocalEventTrapMixin;
-},{"./ReactBrowserEventEmitter":33,"./accumulateInto":109,"./forEachAccumulated":126,"./invariant":140}],28:[function(_dereq_,module,exports){
+},{"118":118,"135":135,"150":150,"33":33}],28:[function(_dereq_,module,exports){
/**
- * Copyright 2013-2014, Facebook, Inc.
+ * Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@@ -4021,11 +4166,11 @@ module.exports = LocalEventTrapMixin;
* @typechecks static-only
*/
-"use strict";
+'use strict';
-var EventConstants = _dereq_("./EventConstants");
+var EventConstants = _dereq_(16);
-var emptyFunction = _dereq_("./emptyFunction");
+var emptyFunction = _dereq_(129);
var topLevelTypes = EventConstants.topLevelTypes;
@@ -4066,9 +4211,9 @@ var MobileSafariClickEventPlugin = {
module.exports = MobileSafariClickEventPlugin;
-},{"./EventConstants":17,"./emptyFunction":121}],29:[function(_dereq_,module,exports){
+},{"129":129,"16":16}],29:[function(_dereq_,module,exports){
/**
- * Copyright 2014, Facebook, Inc.
+ * Copyright 2014-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@@ -4080,6 +4225,8 @@ module.exports = MobileSafariClickEventPlugin;
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign
+'use strict';
+
function assign(target, sources) {
if (target == null) {
throw new TypeError('Object.assign target cannot be null or undefined');
@@ -4109,13 +4256,13 @@ function assign(target, sources) {
}
return to;
-};
+}
module.exports = assign;
},{}],30:[function(_dereq_,module,exports){
/**
- * Copyright 2013-2014, Facebook, Inc.
+ * Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@@ -4125,9 +4272,9 @@ module.exports = assign;
* @providesModule PooledClass
*/
-"use strict";
+'use strict';
-var invariant = _dereq_("./invariant");
+var invariant = _dereq_(150);
/**
* Static poolers. Several custom versions for each potential number of
@@ -4227,9 +4374,9 @@ var PooledClass = {
module.exports = PooledClass;
-},{"./invariant":140}],31:[function(_dereq_,module,exports){
+},{"150":150}],31:[function(_dereq_,module,exports){
/**
- * Copyright 2013-2014, Facebook, Inc.
+ * Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@@ -4239,51 +4386,44 @@ module.exports = PooledClass;
* @providesModule React
*/
-"use strict";
+/* globals __REACT_DEVTOOLS_GLOBAL_HOOK__*/
+
+'use strict';
-var DOMPropertyOperations = _dereq_("./DOMPropertyOperations");
-var EventPluginUtils = _dereq_("./EventPluginUtils");
-var ReactChildren = _dereq_("./ReactChildren");
-var ReactComponent = _dereq_("./ReactComponent");
-var ReactCompositeComponent = _dereq_("./ReactCompositeComponent");
-var ReactContext = _dereq_("./ReactContext");
-var ReactCurrentOwner = _dereq_("./ReactCurrentOwner");
-var ReactElement = _dereq_("./ReactElement");
-var ReactElementValidator = _dereq_("./ReactElementValidator");
-var ReactDOM = _dereq_("./ReactDOM");
-var ReactDOMComponent = _dereq_("./ReactDOMComponent");
-var ReactDefaultInjection = _dereq_("./ReactDefaultInjection");
-var ReactInstanceHandles = _dereq_("./ReactInstanceHandles");
-var ReactLegacyElement = _dereq_("./ReactLegacyElement");
-var ReactMount = _dereq_("./ReactMount");
-var ReactMultiChild = _dereq_("./ReactMultiChild");
-var ReactPerf = _dereq_("./ReactPerf");
-var ReactPropTypes = _dereq_("./ReactPropTypes");
-var ReactServerRendering = _dereq_("./ReactServerRendering");
-var ReactTextComponent = _dereq_("./ReactTextComponent");
-
-var assign = _dereq_("./Object.assign");
-var deprecated = _dereq_("./deprecated");
-var onlyChild = _dereq_("./onlyChild");
+var EventPluginUtils = _dereq_(20);
+var ReactChildren = _dereq_(37);
+var ReactComponent = _dereq_(39);
+var ReactClass = _dereq_(38);
+var ReactContext = _dereq_(44);
+var ReactCurrentOwner = _dereq_(45);
+var ReactElement = _dereq_(63);
+var ReactElementValidator = _dereq_(64);
+var ReactDOM = _dereq_(46);
+var ReactDOMTextComponent = _dereq_(57);
+var ReactDefaultInjection = _dereq_(60);
+var ReactInstanceHandles = _dereq_(72);
+var ReactMount = _dereq_(77);
+var ReactPerf = _dereq_(82);
+var ReactPropTypes = _dereq_(86);
+var ReactReconciler = _dereq_(89);
+var ReactServerRendering = _dereq_(92);
+
+var assign = _dereq_(29);
+var findDOMNode = _dereq_(132);
+var onlyChild = _dereq_(160);
ReactDefaultInjection.inject();
var createElement = ReactElement.createElement;
var createFactory = ReactElement.createFactory;
+var cloneElement = ReactElement.cloneElement;
if ("production" !== "development") {
createElement = ReactElementValidator.createElement;
createFactory = ReactElementValidator.createFactory;
+ cloneElement = ReactElementValidator.cloneElement;
}
-// TODO: Drop legacy elements once classes no longer export these factories
-createElement = ReactLegacyElement.wrapCreateElement(
- createElement
-);
-createFactory = ReactLegacyElement.wrapCreateFactory(
- createFactory
-);
-
var render = ReactPerf.measure('React', 'render', ReactMount.render);
var React = {
@@ -4293,56 +4433,32 @@ var React = {
count: ReactChildren.count,
only: onlyChild
},
+ Component: ReactComponent,
DOM: ReactDOM,
PropTypes: ReactPropTypes,
initializeTouchEvents: function(shouldUseTouch) {
EventPluginUtils.useTouchEvents = shouldUseTouch;
},
- createClass: ReactCompositeComponent.createClass,
+ createClass: ReactClass.createClass,
createElement: createElement,
+ cloneElement: cloneElement,
createFactory: createFactory,
+ createMixin: function(mixin) {
+ // Currently a noop. Will be used to validate and trace mixins.
+ return mixin;
+ },
constructAndRenderComponent: ReactMount.constructAndRenderComponent,
constructAndRenderComponentByID: ReactMount.constructAndRenderComponentByID,
+ findDOMNode: findDOMNode,
render: render,
renderToString: ReactServerRendering.renderToString,
renderToStaticMarkup: ReactServerRendering.renderToStaticMarkup,
unmountComponentAtNode: ReactMount.unmountComponentAtNode,
- isValidClass: ReactLegacyElement.isValidClass,
isValidElement: ReactElement.isValidElement,
withContext: ReactContext.withContext,
// Hook for JSX spread, don't use this for anything else.
- __spread: assign,
-
- // Deprecations (remove for 0.13)
- renderComponent: deprecated(
- 'React',
- 'renderComponent',
- 'render',
- this,
- render
- ),
- renderComponentToString: deprecated(
- 'React',
- 'renderComponentToString',
- 'renderToString',
- this,
- ReactServerRendering.renderToString
- ),
- renderComponentToStaticMarkup: deprecated(
- 'React',
- 'renderComponentToStaticMarkup',
- 'renderToStaticMarkup',
- this,
- ReactServerRendering.renderToStaticMarkup
- ),
- isValidComponent: deprecated(
- 'React',
- 'isValidComponent',
- 'isValidElement',
- this,
- ReactElement.isValidElement
- )
+ __spread: assign
};
// Inject the runtime into a devtools global hook regardless of browser.
@@ -4351,19 +4467,16 @@ if (
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') {
__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({
- Component: ReactComponent,
CurrentOwner: ReactCurrentOwner,
- DOMComponent: ReactDOMComponent,
- DOMPropertyOperations: DOMPropertyOperations,
InstanceHandles: ReactInstanceHandles,
Mount: ReactMount,
- MultiChild: ReactMultiChild,
- TextComponent: ReactTextComponent
+ Reconciler: ReactReconciler,
+ TextComponent: ReactDOMTextComponent
});
}
if ("production" !== "development") {
- var ExecutionEnvironment = _dereq_("./ExecutionEnvironment");
+ var ExecutionEnvironment = _dereq_(22);
if (ExecutionEnvironment.canUseDOM && window.top === window.self) {
// If we're in Chrome, look for the devtools marker and provide a download
@@ -4372,7 +4485,7 @@ if ("production" !== "development") {
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
console.debug(
'Download the React DevTools for a better development experience: ' +
- 'http://fb.me/react-devtools'
+ 'https://fb.me/react-devtools'
);
}
}
@@ -4399,7 +4512,7 @@ if ("production" !== "development") {
if (!expectedFeatures[i]) {
console.error(
'One or more ES5 shim/shams expected by React are not available: ' +
- 'http://fb.me/react-warning-polyfills'
+ 'https://fb.me/react-warning-polyfills'
);
break;
}
@@ -4407,15 +4520,13 @@ if ("production" !== "development") {
}
}
-// Version exists only in the open-source version of React, not in Facebook's
-// internal version.
-React.version = '0.12.2';
+React.version = '0.13.3';
module.exports = React;
-},{"./DOMPropertyOperations":13,"./EventPluginUtils":21,"./ExecutionEnvironment":23,"./Object.assign":29,"./ReactChildren":36,"./ReactComponent":37,"./ReactCompositeComponent":40,"./ReactContext":41,"./ReactCurrentOwner":42,"./ReactDOM":43,"./ReactDOMComponent":45,"./ReactDefaultInjection":55,"./ReactElement":58,"./ReactElementValidator":59,"./ReactInstanceHandles":66,"./ReactLegacyElement":67,"./ReactMount":70,"./ReactMultiChild":71,"./ReactPerf":75,"./ReactPropTypes":79,"./ReactServerRendering":83,"./ReactTextComponent":87,"./deprecated":120,"./onlyChild":151}],32:[function(_dereq_,module,exports){
+},{"132":132,"160":160,"20":20,"22":22,"29":29,"37":37,"38":38,"39":39,"44":44,"45":45,"46":46,"57":57,"60":60,"63":63,"64":64,"72":72,"77":77,"82":82,"86":86,"89":89,"92":92}],32:[function(_dereq_,module,exports){
/**
- * Copyright 2013-2014, Facebook, Inc.
+ * Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@@ -4425,12 +4536,9 @@ module.exports = React;
* @providesModule ReactBrowserComponentMixin
*/
-"use strict";
-
-var ReactEmptyComponent = _dereq_("./ReactEmptyComponent");
-var ReactMount = _dereq_("./ReactMount");
+'use strict';
-var invariant = _dereq_("./invariant");
+var findDOMNode = _dereq_(132);
var ReactBrowserComponentMixin = {
/**
@@ -4441,22 +4549,15 @@ var ReactBrowserComponentMixin = {
* @protected
*/
getDOMNode: function() {
- ("production" !== "development" ? invariant(
- this.isMounted(),
- 'getDOMNode(): A component must be mounted to have a DOM node.'
- ) : invariant(this.isMounted()));
- if (ReactEmptyComponent.isNullComponentID(this._rootNodeID)) {
- return null;
- }
- return ReactMount.getNode(this._rootNodeID);
+ return findDOMNode(this);
}
};
module.exports = ReactBrowserComponentMixin;
-},{"./ReactEmptyComponent":60,"./ReactMount":70,"./invariant":140}],33:[function(_dereq_,module,exports){
+},{"132":132}],33:[function(_dereq_,module,exports){
/**
- * Copyright 2013-2014, Facebook, Inc.
+ * Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@@ -4467,16 +4568,16 @@ module.exports = ReactBrowserComponentMixin;
* @typechecks static-only
*/
-"use strict";
+'use strict';
-var EventConstants = _dereq_("./EventConstants");
-var EventPluginHub = _dereq_("./EventPluginHub");
-var EventPluginRegistry = _dereq_("./EventPluginRegistry");
-var ReactEventEmitterMixin = _dereq_("./ReactEventEmitterMixin");
-var ViewportMetrics = _dereq_("./ViewportMetrics");
+var EventConstants = _dereq_(16);
+var EventPluginHub = _dereq_(18);
+var EventPluginRegistry = _dereq_(19);
+var ReactEventEmitterMixin = _dereq_(67);
+var ViewportMetrics = _dereq_(117);
-var assign = _dereq_("./Object.assign");
-var isEventSupported = _dereq_("./isEventSupported");
+var assign = _dereq_(29);
+var isEventSupported = _dereq_(151);
/**
* Summary of `ReactBrowserEventEmitter` event handling:
@@ -4583,7 +4684,7 @@ var topEventMapping = {
/**
* To ensure no conflicts with other potential React instances on the page
*/
-var topListenersIDKey = "_reactListenersID" + String(Math.random()).slice(2);
+var topListenersIDKey = '_reactListenersID' + String(Math.random()).slice(2);
function getListeningForDocument(mountAt) {
// In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty`
@@ -4640,8 +4741,7 @@ var ReactBrowserEventEmitter = assign({}, ReactEventEmitterMixin, {
*/
isEnabled: function() {
return !!(
- ReactBrowserEventEmitter.ReactEventListener &&
- ReactBrowserEventEmitter.ReactEventListener.isEnabled()
+ (ReactBrowserEventEmitter.ReactEventListener && ReactBrowserEventEmitter.ReactEventListener.isEnabled())
);
},
@@ -4676,8 +4776,7 @@ var ReactBrowserEventEmitter = assign({}, ReactEventEmitterMixin, {
for (var i = 0, l = dependencies.length; i < l; i++) {
var dependency = dependencies[i];
if (!(
- isListening.hasOwnProperty(dependency) &&
- isListening[dependency]
+ (isListening.hasOwnProperty(dependency) && isListening[dependency])
)) {
if (dependency === topLevelTypes.topWheel) {
if (isEventSupported('wheel')) {
@@ -4785,7 +4884,7 @@ var ReactBrowserEventEmitter = assign({}, ReactEventEmitterMixin, {
*
* @see http://www.quirksmode.org/dom/events/scroll.html
*/
- ensureScrollValueMonitoring: function(){
+ ensureScrollValueMonitoring: function() {
if (!isMonitoringScrollValue) {
var refresh = ViewportMetrics.refreshScrollValues;
ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(refresh);
@@ -4809,9 +4908,9 @@ var ReactBrowserEventEmitter = assign({}, ReactEventEmitterMixin, {
module.exports = ReactBrowserEventEmitter;
-},{"./EventConstants":17,"./EventPluginHub":19,"./EventPluginRegistry":20,"./Object.assign":29,"./ReactEventEmitterMixin":62,"./ViewportMetrics":108,"./isEventSupported":141}],34:[function(_dereq_,module,exports){
+},{"117":117,"151":151,"16":16,"18":18,"19":19,"29":29,"67":67}],34:[function(_dereq_,module,exports){
/**
- * Copyright 2013-2014, Facebook, Inc.
+ * Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@@ -4822,17 +4921,17 @@ module.exports = ReactBrowserEventEmitter;
* @providesModule ReactCSSTransitionGroup
*/
-"use strict";
+'use strict';
-var React = _dereq_("./React");
+var React = _dereq_(31);
-var assign = _dereq_("./Object.assign");
+var assign = _dereq_(29);
var ReactTransitionGroup = React.createFactory(
- _dereq_("./ReactTransitionGroup")
+ _dereq_(98)
);
var ReactCSSTransitionGroupChild = React.createFactory(
- _dereq_("./ReactCSSTransitionGroupChild")
+ _dereq_(35)
);
var ReactCSSTransitionGroup = React.createClass({
@@ -4840,12 +4939,14 @@ var ReactCSSTransitionGroup = React.creat
<TRUNCATED>