react 0.14.0-beta1 → 0.14.0
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.
- package/addons.js +8 -3
- package/dist/react-with-addons.js +5048 -4095
- package/dist/react-with-addons.min.js +6 -6
- package/dist/react.js +4555 -3729
- package/dist/react.min.js +6 -5
- package/lib/AutoFocusUtils.js +3 -3
- package/lib/BeforeInputEventPlugin.js +13 -13
- package/lib/CSSProperty.js +18 -3
- package/lib/CSSPropertyOperations.js +27 -14
- package/lib/CallbackQueue.js +4 -4
- package/lib/ChangeEventPlugin.js +15 -14
- package/lib/DOMChildrenOperations.js +22 -7
- package/lib/DOMProperty.js +8 -8
- package/lib/DOMPropertyOperations.js +23 -10
- package/lib/Danger.js +21 -16
- package/lib/DefaultEventPluginOrder.js +2 -2
- package/lib/EnterLeaveEventPlugin.js +18 -10
- package/lib/EventConstants.js +23 -1
- package/lib/EventPluginHub.js +29 -21
- package/lib/EventPluginRegistry.js +8 -8
- package/lib/EventPluginUtils.js +34 -38
- package/lib/EventPropagators.js +8 -8
- package/lib/FallbackCompositionState.js +9 -3
- package/lib/HTMLDOMPropertyConfig.js +24 -4
- package/lib/LinkedStateMixin.js +2 -2
- package/lib/LinkedValueUtils.js +8 -8
- package/lib/MetaMatchers.js +118 -0
- package/lib/OrderedMap.js +453 -0
- package/lib/PooledClass.js +3 -5
- package/lib/React.js +18 -7
- package/lib/ReactBrowserComponentMixin.js +4 -4
- package/lib/ReactBrowserEventEmitter.js +36 -7
- package/lib/ReactCSSTransitionGroup.js +35 -9
- package/lib/ReactCSSTransitionGroupChild.js +48 -30
- package/lib/ReactChildReconciler.js +24 -19
- package/lib/ReactChildren.js +72 -32
- package/lib/ReactClass.js +46 -46
- package/lib/ReactComponent.js +18 -16
- package/lib/ReactComponentBrowserEnvironment.js +2 -2
- package/lib/ReactComponentEnvironment.js +2 -2
- package/lib/ReactComponentWithPureRenderMixin.js +1 -1
- package/lib/ReactCompositeComponent.js +95 -44
- package/lib/ReactDOM.js +74 -159
- package/lib/ReactDOMComponent.js +235 -93
- package/lib/ReactDOMFactories.js +177 -0
- package/lib/{emptyObject.js → ReactDOMFeatureFlags.js} +6 -8
- package/lib/ReactDOMIDOperations.js +8 -81
- package/lib/ReactDOMInput.js +18 -9
- package/lib/ReactDOMOption.js +7 -7
- package/lib/ReactDOMSelect.js +9 -9
- package/lib/ReactDOMSelection.js +19 -3
- package/lib/ReactDOMServer.js +5 -3
- package/lib/ReactDOMTextComponent.js +33 -20
- package/lib/ReactDOMTextarea.js +14 -12
- package/lib/ReactDefaultBatchingStrategy.js +4 -4
- package/lib/ReactDefaultInjection.js +23 -25
- package/lib/ReactDefaultPerf.js +17 -11
- package/lib/ReactDefaultPerfAnalysis.js +13 -12
- package/lib/ReactElement.js +85 -39
- package/lib/ReactElementValidator.js +47 -90
- package/lib/ReactEmptyComponent.js +26 -62
- package/lib/ReactEmptyComponentRegistry.js +48 -0
- package/lib/ReactErrorUtils.js +53 -9
- package/lib/ReactEventEmitterMixin.js +2 -2
- package/lib/ReactEventListener.js +33 -21
- package/lib/ReactFragment.js +27 -118
- package/lib/ReactInjection.js +10 -12
- package/lib/ReactInputSelection.js +4 -4
- package/lib/ReactInstanceHandles.js +10 -11
- package/lib/ReactIsomorphic.js +15 -11
- package/lib/ReactLink.js +2 -2
- package/lib/ReactMarkupChecksum.js +6 -2
- package/lib/ReactMount.js +186 -85
- package/lib/ReactMultiChild.js +119 -25
- package/lib/ReactMultiChildUpdateTypes.js +2 -1
- package/lib/ReactNativeComponent.js +3 -3
- package/lib/ReactNoopUpdateQueue.js +3 -3
- package/lib/ReactOwner.js +3 -3
- package/lib/ReactPerf.js +2 -2
- package/lib/ReactPropTransferer.js +3 -3
- package/lib/ReactPropTypeLocationNames.js +1 -1
- package/lib/ReactPropTypeLocations.js +1 -1
- package/lib/ReactPropTypes.js +38 -9
- package/lib/ReactReconcileTransaction.js +10 -8
- package/lib/ReactReconciler.js +5 -6
- package/lib/ReactRef.js +14 -2
- package/lib/ReactServerBatchingStrategy.js +5 -5
- package/lib/ReactServerRendering.js +12 -12
- package/lib/ReactServerRenderingTransaction.js +6 -5
- package/lib/ReactTestUtils.js +47 -39
- package/lib/ReactTransitionChildMapping.js +3 -6
- package/lib/ReactTransitionEvents.js +1 -1
- package/lib/ReactTransitionGroup.js +5 -6
- package/lib/ReactUpdateQueue.js +19 -19
- package/lib/ReactUpdates.js +15 -15
- package/lib/{performance.js → ReactVersion.js} +3 -12
- package/lib/ReactWithAddons.js +24 -15
- package/lib/ResponderEventPlugin.js +514 -0
- package/lib/ResponderSyntheticEvent.js +40 -0
- package/lib/ResponderTouchHistoryStore.js +180 -0
- package/lib/SVGDOMPropertyConfig.js +1 -1
- package/lib/SelectEventPlugin.js +19 -9
- package/lib/SimpleEventPlugin.js +198 -43
- package/lib/SyntheticClipboardEvent.js +1 -1
- package/lib/SyntheticCompositionEvent.js +1 -1
- package/lib/SyntheticDragEvent.js +1 -1
- package/lib/SyntheticEvent.js +18 -4
- package/lib/SyntheticFocusEvent.js +1 -1
- package/lib/SyntheticInputEvent.js +1 -1
- package/lib/SyntheticKeyboardEvent.js +4 -4
- package/lib/SyntheticMouseEvent.js +3 -3
- package/lib/SyntheticTouchEvent.js +2 -2
- package/lib/SyntheticUIEvent.js +2 -2
- package/lib/SyntheticWheelEvent.js +1 -1
- package/lib/TapEventPlugin.js +119 -0
- package/lib/Transaction.js +7 -7
- package/lib/accumulate.js +44 -0
- package/lib/accumulateInto.js +2 -2
- package/lib/adler32.js +19 -7
- package/lib/cloneWithProps.js +11 -6
- package/lib/createHierarchyRenderer.js +85 -0
- package/lib/dangerousStyleValue.js +1 -1
- package/lib/deprecated.js +7 -6
- package/lib/findDOMNode.js +9 -9
- package/lib/flattenChildren.js +4 -4
- package/lib/getEventKey.js +1 -1
- package/lib/{isTextNode.js → getTestDocument.js} +7 -11
- package/lib/getTextContentAccessor.js +1 -1
- package/lib/instantiateReactComponent.js +15 -17
- package/lib/isEventSupported.js +1 -1
- package/lib/onlyChild.js +3 -3
- package/lib/quoteAttributeValueForBrowser.js +1 -1
- package/lib/reactComponentExpect.js +216 -0
- package/lib/renderSubtreeIntoContainer.js +1 -1
- package/lib/setInnerHTML.js +1 -1
- package/lib/setTextContent.js +3 -3
- package/lib/shallowCompare.js +1 -1
- package/lib/shouldUpdateReactComponent.js +12 -8
- package/lib/sliceChildren.js +34 -0
- package/lib/traverseAllChildren.js +25 -18
- package/lib/update.js +13 -13
- package/lib/validateDOMNesting.js +6 -6
- package/lib/webcomponents.js +6379 -0
- package/package.json +4 -6
- package/react.js +1 -51
- package/dist/JSXTransformer.js +0 -17588
- package/lib/CSSCore.js +0 -97
- package/lib/EventListener.js +0 -84
- package/lib/ExecutionEnvironment.js +0 -38
- package/lib/ReactDOMClient.js +0 -90
- package/lib/camelize.js +0 -32
- package/lib/camelizeStyleName.js +0 -40
- package/lib/containsNode.js +0 -55
- package/lib/createArrayFromMixed.js +0 -85
- package/lib/createNodesFromMarkup.js +0 -84
- package/lib/emptyFunction.js +0 -38
- package/lib/focusNode.js +0 -26
- package/lib/getActiveElement.js +0 -29
- package/lib/getMarkupWrap.js +0 -93
- package/lib/getUnboundedScrollPosition.js +0 -38
- package/lib/hyphenate.js +0 -33
- package/lib/hyphenateStyleName.js +0 -39
- package/lib/invariant.js +0 -49
- package/lib/isNode.js +0 -23
- package/lib/joinClasses.js +0 -39
- package/lib/keyMirror.js +0 -48
- package/lib/keyOf.js +0 -35
- package/lib/mapObject.js +0 -51
- package/lib/memoizeStringOnly.js +0 -31
- package/lib/performanceNow.js +0 -28
- package/lib/shallowEqual.js +0 -48
- package/lib/toArray.js +0 -57
- package/lib/warning.js +0 -57
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013-2015, Facebook, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the BSD-style license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
-
*
|
|
9
|
-
* @providesModule createNodesFromMarkup
|
|
10
|
-
* @typechecks
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/*jslint evil: true, sub: true */
|
|
14
|
-
|
|
15
|
-
'use strict';
|
|
16
|
-
|
|
17
|
-
var ExecutionEnvironment = require("./ExecutionEnvironment");
|
|
18
|
-
|
|
19
|
-
var createArrayFromMixed = require("./createArrayFromMixed");
|
|
20
|
-
var getMarkupWrap = require("./getMarkupWrap");
|
|
21
|
-
var invariant = require("./invariant");
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Dummy container used to render all markup.
|
|
25
|
-
*/
|
|
26
|
-
var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Pattern used by `getNodeName`.
|
|
30
|
-
*/
|
|
31
|
-
var nodeNamePattern = /^\s*<(\w+)/;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Extracts the `nodeName` of the first element in a string of markup.
|
|
35
|
-
*
|
|
36
|
-
* @param {string} markup String of markup.
|
|
37
|
-
* @return {?string} Node name of the supplied markup.
|
|
38
|
-
*/
|
|
39
|
-
function getNodeName(markup) {
|
|
40
|
-
var nodeNameMatch = markup.match(nodeNamePattern);
|
|
41
|
-
return nodeNameMatch && nodeNameMatch[1].toLowerCase();
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Creates an array containing the nodes rendered from the supplied markup. The
|
|
46
|
-
* optionally supplied `handleScript` function will be invoked once for each
|
|
47
|
-
* <script> element that is rendered. If no `handleScript` function is supplied,
|
|
48
|
-
* an exception is thrown if any <script> elements are rendered.
|
|
49
|
-
*
|
|
50
|
-
* @param {string} markup A string of valid HTML markup.
|
|
51
|
-
* @param {?function} handleScript Invoked once for each rendered <script>.
|
|
52
|
-
* @return {array<DOMElement|DOMTextNode>} An array of rendered nodes.
|
|
53
|
-
*/
|
|
54
|
-
function createNodesFromMarkup(markup, handleScript) {
|
|
55
|
-
var node = dummyNode;
|
|
56
|
-
!!!dummyNode ? 'production' !== process.env.NODE_ENV ? invariant(false, 'createNodesFromMarkup dummy not initialized') : invariant(false) : undefined;
|
|
57
|
-
var nodeName = getNodeName(markup);
|
|
58
|
-
|
|
59
|
-
var wrap = nodeName && getMarkupWrap(nodeName);
|
|
60
|
-
if (wrap) {
|
|
61
|
-
node.innerHTML = wrap[1] + markup + wrap[2];
|
|
62
|
-
|
|
63
|
-
var wrapDepth = wrap[0];
|
|
64
|
-
while (wrapDepth--) {
|
|
65
|
-
node = node.lastChild;
|
|
66
|
-
}
|
|
67
|
-
} else {
|
|
68
|
-
node.innerHTML = markup;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
var scripts = node.getElementsByTagName('script');
|
|
72
|
-
if (scripts.length) {
|
|
73
|
-
!handleScript ? 'production' !== process.env.NODE_ENV ? invariant(false, 'createNodesFromMarkup(...): Unexpected <script> element rendered.') : invariant(false) : undefined;
|
|
74
|
-
createArrayFromMixed(scripts).forEach(handleScript);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
var nodes = createArrayFromMixed(node.childNodes);
|
|
78
|
-
while (node.lastChild) {
|
|
79
|
-
node.removeChild(node.lastChild);
|
|
80
|
-
}
|
|
81
|
-
return nodes;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
module.exports = createNodesFromMarkup;
|
package/lib/emptyFunction.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013-2015, Facebook, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the BSD-style license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
-
*
|
|
9
|
-
* @providesModule emptyFunction
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
"use strict";
|
|
13
|
-
|
|
14
|
-
function makeEmptyFunction(arg) {
|
|
15
|
-
return function () {
|
|
16
|
-
return arg;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* This function accepts and discards inputs; it has no side effects. This is
|
|
22
|
-
* primarily useful idiomatically for overridable function endpoints which
|
|
23
|
-
* always need to be callable, since JS lacks a null-call idiom ala Cocoa.
|
|
24
|
-
*/
|
|
25
|
-
function emptyFunction() {}
|
|
26
|
-
|
|
27
|
-
emptyFunction.thatReturns = makeEmptyFunction;
|
|
28
|
-
emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
|
|
29
|
-
emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
|
|
30
|
-
emptyFunction.thatReturnsNull = makeEmptyFunction(null);
|
|
31
|
-
emptyFunction.thatReturnsThis = function () {
|
|
32
|
-
return this;
|
|
33
|
-
};
|
|
34
|
-
emptyFunction.thatReturnsArgument = function (arg) {
|
|
35
|
-
return arg;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
module.exports = emptyFunction;
|
package/lib/focusNode.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2014-2015, Facebook, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the BSD-style license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
-
*
|
|
9
|
-
* @providesModule focusNode
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
"use strict";
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @param {DOMElement} node input/textarea to focus
|
|
16
|
-
*/
|
|
17
|
-
function focusNode(node) {
|
|
18
|
-
// IE8 can throw "Can't move focus to the control because it is invisible,
|
|
19
|
-
// not enabled, or of a type that does not accept the focus." for all kinds of
|
|
20
|
-
// reasons that are too expensive and fragile to test.
|
|
21
|
-
try {
|
|
22
|
-
node.focus();
|
|
23
|
-
} catch (e) {}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
module.exports = focusNode;
|
package/lib/getActiveElement.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013-2015, Facebook, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the BSD-style license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
-
*
|
|
9
|
-
* @providesModule getActiveElement
|
|
10
|
-
* @typechecks
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Same as document.activeElement but wraps in a try-catch block. In IE it is
|
|
15
|
-
* not safe to call document.activeElement if there is nothing focused.
|
|
16
|
-
*
|
|
17
|
-
* The activeElement will be null only if the document body is not yet defined.
|
|
18
|
-
*/
|
|
19
|
-
"use strict";
|
|
20
|
-
|
|
21
|
-
function getActiveElement() /*?DOMElement*/{
|
|
22
|
-
try {
|
|
23
|
-
return document.activeElement || document.body;
|
|
24
|
-
} catch (e) {
|
|
25
|
-
return document.body;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
module.exports = getActiveElement;
|
package/lib/getMarkupWrap.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013-2015, Facebook, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the BSD-style license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
-
*
|
|
9
|
-
* @providesModule getMarkupWrap
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
var ExecutionEnvironment = require("./ExecutionEnvironment");
|
|
15
|
-
|
|
16
|
-
var invariant = require("./invariant");
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Dummy container used to detect which wraps are necessary.
|
|
20
|
-
*/
|
|
21
|
-
var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Some browsers cannot use `innerHTML` to render certain elements standalone,
|
|
25
|
-
* so we wrap them, render the wrapped nodes, then extract the desired node.
|
|
26
|
-
*
|
|
27
|
-
* In IE8, certain elements cannot render alone, so wrap all elements ('*').
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
var shouldWrap = {};
|
|
31
|
-
|
|
32
|
-
var selectWrap = [1, '<select multiple="true">', '</select>'];
|
|
33
|
-
var tableWrap = [1, '<table>', '</table>'];
|
|
34
|
-
var trWrap = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
|
|
35
|
-
|
|
36
|
-
var svgWrap = [1, '<svg xmlns="http://www.w3.org/2000/svg">', '</svg>'];
|
|
37
|
-
|
|
38
|
-
var markupWrap = {
|
|
39
|
-
'*': [1, '?<div>', '</div>'],
|
|
40
|
-
|
|
41
|
-
'area': [1, '<map>', '</map>'],
|
|
42
|
-
'col': [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
|
|
43
|
-
'legend': [1, '<fieldset>', '</fieldset>'],
|
|
44
|
-
'param': [1, '<object>', '</object>'],
|
|
45
|
-
'tr': [2, '<table><tbody>', '</tbody></table>'],
|
|
46
|
-
|
|
47
|
-
'optgroup': selectWrap,
|
|
48
|
-
'option': selectWrap,
|
|
49
|
-
|
|
50
|
-
'caption': tableWrap,
|
|
51
|
-
'colgroup': tableWrap,
|
|
52
|
-
'tbody': tableWrap,
|
|
53
|
-
'tfoot': tableWrap,
|
|
54
|
-
'thead': tableWrap,
|
|
55
|
-
|
|
56
|
-
'td': trWrap,
|
|
57
|
-
'th': trWrap
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
// Initilize the SVG elements since we know they'll always need to be wrapped
|
|
61
|
-
// consistently. If they are created inside a <div> they will be initialized in
|
|
62
|
-
// the wrong namespace (and will not display).
|
|
63
|
-
var svgElements = ['circle', 'clipPath', 'defs', 'ellipse', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'text', 'tspan'];
|
|
64
|
-
svgElements.forEach(function (nodeName) {
|
|
65
|
-
markupWrap[nodeName] = svgWrap;
|
|
66
|
-
shouldWrap[nodeName] = true;
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Gets the markup wrap configuration for the supplied `nodeName`.
|
|
71
|
-
*
|
|
72
|
-
* NOTE: This lazily detects which wraps are necessary for the current browser.
|
|
73
|
-
*
|
|
74
|
-
* @param {string} nodeName Lowercase `nodeName`.
|
|
75
|
-
* @return {?array} Markup wrap configuration, if applicable.
|
|
76
|
-
*/
|
|
77
|
-
function getMarkupWrap(nodeName) {
|
|
78
|
-
!!!dummyNode ? 'production' !== process.env.NODE_ENV ? invariant(false, 'Markup wrapping node not initialized') : invariant(false) : undefined;
|
|
79
|
-
if (!markupWrap.hasOwnProperty(nodeName)) {
|
|
80
|
-
nodeName = '*';
|
|
81
|
-
}
|
|
82
|
-
if (!shouldWrap.hasOwnProperty(nodeName)) {
|
|
83
|
-
if (nodeName === '*') {
|
|
84
|
-
dummyNode.innerHTML = '<link />';
|
|
85
|
-
} else {
|
|
86
|
-
dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>';
|
|
87
|
-
}
|
|
88
|
-
shouldWrap[nodeName] = !dummyNode.firstChild;
|
|
89
|
-
}
|
|
90
|
-
return shouldWrap[nodeName] ? markupWrap[nodeName] : null;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
module.exports = getMarkupWrap;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013-2015, Facebook, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the BSD-style license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
-
*
|
|
9
|
-
* @providesModule getUnboundedScrollPosition
|
|
10
|
-
* @typechecks
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
"use strict";
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Gets the scroll position of the supplied element or window.
|
|
17
|
-
*
|
|
18
|
-
* The return values are unbounded, unlike `getScrollPosition`. This means they
|
|
19
|
-
* may be negative or exceed the element boundaries (which is possible using
|
|
20
|
-
* inertial scrolling).
|
|
21
|
-
*
|
|
22
|
-
* @param {DOMWindow|DOMElement} scrollable
|
|
23
|
-
* @return {object} Map with `x` and `y` keys.
|
|
24
|
-
*/
|
|
25
|
-
function getUnboundedScrollPosition(scrollable) {
|
|
26
|
-
if (scrollable === window) {
|
|
27
|
-
return {
|
|
28
|
-
x: window.pageXOffset || document.documentElement.scrollLeft,
|
|
29
|
-
y: window.pageYOffset || document.documentElement.scrollTop
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
return {
|
|
33
|
-
x: scrollable.scrollLeft,
|
|
34
|
-
y: scrollable.scrollTop
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
module.exports = getUnboundedScrollPosition;
|
package/lib/hyphenate.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013-2015, Facebook, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the BSD-style license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
-
*
|
|
9
|
-
* @providesModule hyphenate
|
|
10
|
-
* @typechecks
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
'use strict';
|
|
14
|
-
|
|
15
|
-
var _uppercasePattern = /([A-Z])/g;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Hyphenates a camelcased string, for example:
|
|
19
|
-
*
|
|
20
|
-
* > hyphenate('backgroundColor')
|
|
21
|
-
* < "background-color"
|
|
22
|
-
*
|
|
23
|
-
* For CSS style names, use `hyphenateStyleName` instead which works properly
|
|
24
|
-
* with all vendor prefixes, including `ms`.
|
|
25
|
-
*
|
|
26
|
-
* @param {string} string
|
|
27
|
-
* @return {string}
|
|
28
|
-
*/
|
|
29
|
-
function hyphenate(string) {
|
|
30
|
-
return string.replace(_uppercasePattern, '-$1').toLowerCase();
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
module.exports = hyphenate;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013-2015, Facebook, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the BSD-style license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
-
*
|
|
9
|
-
* @providesModule hyphenateStyleName
|
|
10
|
-
* @typechecks
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
'use strict';
|
|
14
|
-
|
|
15
|
-
var hyphenate = require("./hyphenate");
|
|
16
|
-
|
|
17
|
-
var msPattern = /^ms-/;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Hyphenates a camelcased CSS property name, for example:
|
|
21
|
-
*
|
|
22
|
-
* > hyphenateStyleName('backgroundColor')
|
|
23
|
-
* < "background-color"
|
|
24
|
-
* > hyphenateStyleName('MozTransition')
|
|
25
|
-
* < "-moz-transition"
|
|
26
|
-
* > hyphenateStyleName('msTransition')
|
|
27
|
-
* < "-ms-transition"
|
|
28
|
-
*
|
|
29
|
-
* As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
|
|
30
|
-
* is converted to `-ms-`.
|
|
31
|
-
*
|
|
32
|
-
* @param {string} string
|
|
33
|
-
* @return {string}
|
|
34
|
-
*/
|
|
35
|
-
function hyphenateStyleName(string) {
|
|
36
|
-
return hyphenate(string).replace(msPattern, '-ms-');
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
module.exports = hyphenateStyleName;
|
package/lib/invariant.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013-2015, Facebook, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the BSD-style license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
-
*
|
|
9
|
-
* @providesModule invariant
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Use invariant() to assert state which your program assumes to be true.
|
|
16
|
-
*
|
|
17
|
-
* Provide sprintf-style format (only %s is supported) and arguments
|
|
18
|
-
* to provide information about what broke and what you were
|
|
19
|
-
* expecting.
|
|
20
|
-
*
|
|
21
|
-
* The invariant message will be stripped in production, but the invariant
|
|
22
|
-
* will remain to ensure logic does not differ in production.
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
var invariant = function (condition, format, a, b, c, d, e, f) {
|
|
26
|
-
if ('production' !== process.env.NODE_ENV) {
|
|
27
|
-
if (format === undefined) {
|
|
28
|
-
throw new Error('invariant requires an error message argument');
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
if (!condition) {
|
|
33
|
-
var error;
|
|
34
|
-
if (format === undefined) {
|
|
35
|
-
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
|
36
|
-
} else {
|
|
37
|
-
var args = [a, b, c, d, e, f];
|
|
38
|
-
var argIndex = 0;
|
|
39
|
-
error = new Error('Invariant Violation: ' + format.replace(/%s/g, function () {
|
|
40
|
-
return args[argIndex++];
|
|
41
|
-
}));
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
error.framesToPop = 1; // we don't care about invariant's own frame
|
|
45
|
-
throw error;
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
module.exports = invariant;
|
package/lib/isNode.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013-2015, Facebook, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the BSD-style license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
-
*
|
|
9
|
-
* @providesModule isNode
|
|
10
|
-
* @typechecks
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @param {*} object The object to check.
|
|
15
|
-
* @return {boolean} Whether or not the object is a DOM node.
|
|
16
|
-
*/
|
|
17
|
-
'use strict';
|
|
18
|
-
|
|
19
|
-
function isNode(object) {
|
|
20
|
-
return !!(object && (typeof Node === 'function' ? object instanceof Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
module.exports = isNode;
|