react 16.0.0-alpha.5 → 16.0.0-alpha.9
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/README.md +0 -7
- package/cjs/react.development.js +2161 -0
- package/cjs/react.production.min.js +1 -0
- package/index.js +7 -0
- package/package.json +10 -9
- package/{dist/react.js → umd/react.development.js} +2960 -3263
- package/umd/react.production.min.js +4 -0
- package/dist/react.min.js +0 -17
- package/lib/KeyEscapeUtils.js +0 -58
- package/lib/PooledClass.js +0 -111
- package/lib/React.js +0 -84
- package/lib/ReactBaseClasses.js +0 -136
- package/lib/ReactChildren.js +0 -190
- package/lib/ReactClass.js +0 -698
- package/lib/ReactComponentTreeHook.js +0 -342
- package/lib/ReactComponentTreeHookUMDShim.js +0 -17
- package/lib/ReactCurrentOwner.js +0 -28
- package/lib/ReactCurrentOwnerUMDShim.js +0 -17
- package/lib/ReactDOMFactories.js +0 -169
- package/lib/ReactDebugCurrentFrame.js +0 -55
- package/lib/ReactElement.js +0 -340
- package/lib/ReactElementSymbol.js +0 -19
- package/lib/ReactElementType.js +0 -12
- package/lib/ReactElementValidator.js +0 -269
- package/lib/ReactFiberComponentTreeHook.js +0 -62
- package/lib/ReactNoopUpdateQueue.js +0 -90
- package/lib/ReactPropTypes.js +0 -458
- package/lib/ReactPropTypesSecret.js +0 -16
- package/lib/ReactTypeOfWork.js +0 -26
- package/lib/ReactUMDEntry.js +0 -31
- package/lib/ReactUMDShim.js +0 -15
- package/lib/ReactVersion.js +0 -13
- package/lib/canDefineProperty.js +0 -25
- package/lib/checkPropTypes.js +0 -64
- package/lib/checkReactTypeSpec.js +0 -22
- package/lib/deprecated.js +0 -56
- package/lib/flattenChildren.js +0 -75
- package/lib/getComponentName.js +0 -35
- package/lib/getIteratorFn.js +0 -40
- package/lib/getNextDebugID.js +0 -20
- package/lib/onlyChild.js +0 -37
- package/lib/reactProdInvariant.js +0 -38
- package/lib/traverseAllChildren.js +0 -164
- package/react.js +0 -3
|
@@ -1,342 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2016-present, 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
|
-
*
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
var _prodInvariant = require('./reactProdInvariant');
|
|
15
|
-
|
|
16
|
-
var ReactCurrentOwner = require('./ReactCurrentOwner');
|
|
17
|
-
|
|
18
|
-
var _require = require('./ReactFiberComponentTreeHook'),
|
|
19
|
-
getStackAddendumByWorkInProgressFiber = _require.getStackAddendumByWorkInProgressFiber,
|
|
20
|
-
describeComponentFrame = _require.describeComponentFrame;
|
|
21
|
-
|
|
22
|
-
var invariant = require('fbjs/lib/invariant');
|
|
23
|
-
var warning = require('fbjs/lib/warning');
|
|
24
|
-
var getComponentName = require('./getComponentName');
|
|
25
|
-
|
|
26
|
-
function isNative(fn) {
|
|
27
|
-
// Based on isNative() from Lodash
|
|
28
|
-
var funcToString = Function.prototype.toString;
|
|
29
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
30
|
-
var reIsNative = RegExp('^' + funcToString
|
|
31
|
-
// Take an example native function source for comparison
|
|
32
|
-
.call(hasOwnProperty)
|
|
33
|
-
// Strip regex characters so we can use it for regex
|
|
34
|
-
.replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
|
|
35
|
-
// Remove hasOwnProperty from the template to make it generic
|
|
36
|
-
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
|
|
37
|
-
try {
|
|
38
|
-
var source = funcToString.call(fn);
|
|
39
|
-
return reIsNative.test(source);
|
|
40
|
-
} catch (err) {
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
var canUseCollections =
|
|
46
|
-
// Array.from
|
|
47
|
-
typeof Array.from === 'function' &&
|
|
48
|
-
// Map
|
|
49
|
-
typeof Map === 'function' && isNative(Map) &&
|
|
50
|
-
// Map.prototype.keys
|
|
51
|
-
Map.prototype != null && typeof Map.prototype.keys === 'function' && isNative(Map.prototype.keys) &&
|
|
52
|
-
// Set
|
|
53
|
-
typeof Set === 'function' && isNative(Set) &&
|
|
54
|
-
// Set.prototype.keys
|
|
55
|
-
Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys);
|
|
56
|
-
|
|
57
|
-
var setItem;
|
|
58
|
-
var getItem;
|
|
59
|
-
var removeItem;
|
|
60
|
-
var getItemIDs;
|
|
61
|
-
var addRoot;
|
|
62
|
-
var removeRoot;
|
|
63
|
-
var getRootIDs;
|
|
64
|
-
|
|
65
|
-
if (canUseCollections) {
|
|
66
|
-
var itemMap = new Map();
|
|
67
|
-
var rootIDSet = new Set();
|
|
68
|
-
|
|
69
|
-
setItem = function (id, item) {
|
|
70
|
-
itemMap.set(id, item);
|
|
71
|
-
};
|
|
72
|
-
getItem = function (id) {
|
|
73
|
-
return itemMap.get(id);
|
|
74
|
-
};
|
|
75
|
-
removeItem = function (id) {
|
|
76
|
-
itemMap['delete'](id);
|
|
77
|
-
};
|
|
78
|
-
getItemIDs = function () {
|
|
79
|
-
return Array.from(itemMap.keys());
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
addRoot = function (id) {
|
|
83
|
-
rootIDSet.add(id);
|
|
84
|
-
};
|
|
85
|
-
removeRoot = function (id) {
|
|
86
|
-
rootIDSet['delete'](id);
|
|
87
|
-
};
|
|
88
|
-
getRootIDs = function () {
|
|
89
|
-
return Array.from(rootIDSet.keys());
|
|
90
|
-
};
|
|
91
|
-
} else {
|
|
92
|
-
var itemByKey = {};
|
|
93
|
-
var rootByKey = {};
|
|
94
|
-
|
|
95
|
-
// Use non-numeric keys to prevent V8 performance issues:
|
|
96
|
-
// https://github.com/facebook/react/pull/7232
|
|
97
|
-
var getKeyFromID = function (id) {
|
|
98
|
-
return '.' + id;
|
|
99
|
-
};
|
|
100
|
-
var getIDFromKey = function (key) {
|
|
101
|
-
return parseInt(key.substr(1), 10);
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
setItem = function (id, item) {
|
|
105
|
-
var key = getKeyFromID(id);
|
|
106
|
-
itemByKey[key] = item;
|
|
107
|
-
};
|
|
108
|
-
getItem = function (id) {
|
|
109
|
-
var key = getKeyFromID(id);
|
|
110
|
-
return itemByKey[key];
|
|
111
|
-
};
|
|
112
|
-
removeItem = function (id) {
|
|
113
|
-
var key = getKeyFromID(id);
|
|
114
|
-
delete itemByKey[key];
|
|
115
|
-
};
|
|
116
|
-
getItemIDs = function () {
|
|
117
|
-
return Object.keys(itemByKey).map(getIDFromKey);
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
addRoot = function (id) {
|
|
121
|
-
var key = getKeyFromID(id);
|
|
122
|
-
rootByKey[key] = true;
|
|
123
|
-
};
|
|
124
|
-
removeRoot = function (id) {
|
|
125
|
-
var key = getKeyFromID(id);
|
|
126
|
-
delete rootByKey[key];
|
|
127
|
-
};
|
|
128
|
-
getRootIDs = function () {
|
|
129
|
-
return Object.keys(rootByKey).map(getIDFromKey);
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
var unmountedIDs = [];
|
|
134
|
-
|
|
135
|
-
function purgeDeep(id) {
|
|
136
|
-
var item = getItem(id);
|
|
137
|
-
if (item) {
|
|
138
|
-
var childIDs = item.childIDs;
|
|
139
|
-
|
|
140
|
-
removeItem(id);
|
|
141
|
-
childIDs.forEach(purgeDeep);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
function getDisplayName(element) {
|
|
146
|
-
if (element == null) {
|
|
147
|
-
return '#empty';
|
|
148
|
-
} else if (typeof element === 'string' || typeof element === 'number') {
|
|
149
|
-
return '#text';
|
|
150
|
-
} else if (typeof element.type === 'string') {
|
|
151
|
-
return element.type;
|
|
152
|
-
} else {
|
|
153
|
-
return element.type.displayName || element.type.name || 'Unknown';
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
function describeID(id) {
|
|
158
|
-
var name = ReactComponentTreeHook.getDisplayName(id);
|
|
159
|
-
var element = ReactComponentTreeHook.getElement(id);
|
|
160
|
-
var ownerID = ReactComponentTreeHook.getOwnerID(id);
|
|
161
|
-
var ownerName = void 0;
|
|
162
|
-
|
|
163
|
-
if (ownerID) {
|
|
164
|
-
ownerName = ReactComponentTreeHook.getDisplayName(ownerID);
|
|
165
|
-
}
|
|
166
|
-
process.env.NODE_ENV !== 'production' ? warning(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id) : void 0;
|
|
167
|
-
return describeComponentFrame(name || '', element && element._source, ownerName || '');
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
var ReactComponentTreeHook = {
|
|
171
|
-
onSetChildren: function (id, nextChildIDs) {
|
|
172
|
-
var item = getItem(id);
|
|
173
|
-
invariant(item, 'Item must have been set');
|
|
174
|
-
item.childIDs = nextChildIDs;
|
|
175
|
-
|
|
176
|
-
for (var i = 0; i < nextChildIDs.length; i++) {
|
|
177
|
-
var nextChildID = nextChildIDs[i];
|
|
178
|
-
var nextChild = getItem(nextChildID);
|
|
179
|
-
!nextChild ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected hook events to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('140') : void 0;
|
|
180
|
-
!(nextChild.childIDs != null || typeof nextChild.element !== 'object' || nextChild.element == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onSetChildren() to fire for a container child before its parent includes it in onSetChildren().') : _prodInvariant('141') : void 0;
|
|
181
|
-
!nextChild.isMounted ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('71') : void 0;
|
|
182
|
-
if (nextChild.parentID == null) {
|
|
183
|
-
nextChild.parentID = id;
|
|
184
|
-
// TODO: This shouldn't be necessary but mounting a new root during in
|
|
185
|
-
// componentWillMount currently causes not-yet-mounted components to
|
|
186
|
-
// be purged from our tree data so their parent id is missing.
|
|
187
|
-
}
|
|
188
|
-
!(nextChild.parentID === id) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onBeforeMountComponent() parent and onSetChildren() to be consistent (%s has parents %s and %s).', nextChildID, nextChild.parentID, id) : _prodInvariant('142', nextChildID, nextChild.parentID, id) : void 0;
|
|
189
|
-
}
|
|
190
|
-
},
|
|
191
|
-
onBeforeMountComponent: function (id, element, parentID) {
|
|
192
|
-
var item = {
|
|
193
|
-
element: element,
|
|
194
|
-
parentID: parentID,
|
|
195
|
-
text: null,
|
|
196
|
-
childIDs: [],
|
|
197
|
-
isMounted: false,
|
|
198
|
-
updateCount: 0
|
|
199
|
-
};
|
|
200
|
-
setItem(id, item);
|
|
201
|
-
},
|
|
202
|
-
onBeforeUpdateComponent: function (id, element) {
|
|
203
|
-
var item = getItem(id);
|
|
204
|
-
if (!item || !item.isMounted) {
|
|
205
|
-
// We may end up here as a result of setState() in componentWillUnmount().
|
|
206
|
-
// In this case, ignore the element.
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
item.element = element;
|
|
210
|
-
},
|
|
211
|
-
onMountComponent: function (id) {
|
|
212
|
-
var item = getItem(id);
|
|
213
|
-
invariant(item, 'Item must have been set');
|
|
214
|
-
item.isMounted = true;
|
|
215
|
-
var isRoot = item.parentID === 0;
|
|
216
|
-
if (isRoot) {
|
|
217
|
-
addRoot(id);
|
|
218
|
-
}
|
|
219
|
-
},
|
|
220
|
-
onUpdateComponent: function (id) {
|
|
221
|
-
var item = getItem(id);
|
|
222
|
-
if (!item || !item.isMounted) {
|
|
223
|
-
// We may end up here as a result of setState() in componentWillUnmount().
|
|
224
|
-
// In this case, ignore the element.
|
|
225
|
-
return;
|
|
226
|
-
}
|
|
227
|
-
item.updateCount++;
|
|
228
|
-
},
|
|
229
|
-
onUnmountComponent: function (id) {
|
|
230
|
-
var item = getItem(id);
|
|
231
|
-
if (item) {
|
|
232
|
-
// We need to check if it exists.
|
|
233
|
-
// `item` might not exist if it is inside an error boundary, and a sibling
|
|
234
|
-
// error boundary child threw while mounting. Then this instance never
|
|
235
|
-
// got a chance to mount, but it still gets an unmounting event during
|
|
236
|
-
// the error boundary cleanup.
|
|
237
|
-
item.isMounted = false;
|
|
238
|
-
var isRoot = item.parentID === 0;
|
|
239
|
-
if (isRoot) {
|
|
240
|
-
removeRoot(id);
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
unmountedIDs.push(id);
|
|
244
|
-
},
|
|
245
|
-
purgeUnmountedComponents: function () {
|
|
246
|
-
if (ReactComponentTreeHook._preventPurging) {
|
|
247
|
-
// Should only be used for testing.
|
|
248
|
-
return;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
for (var i = 0; i < unmountedIDs.length; i++) {
|
|
252
|
-
var id = unmountedIDs[i];
|
|
253
|
-
purgeDeep(id);
|
|
254
|
-
}
|
|
255
|
-
unmountedIDs.length = 0;
|
|
256
|
-
},
|
|
257
|
-
isMounted: function (id) {
|
|
258
|
-
var item = getItem(id);
|
|
259
|
-
return item ? item.isMounted : false;
|
|
260
|
-
},
|
|
261
|
-
getCurrentStackAddendum: function (topElement) {
|
|
262
|
-
var info = '';
|
|
263
|
-
if (topElement) {
|
|
264
|
-
var name = getDisplayName(topElement);
|
|
265
|
-
var owner = topElement._owner;
|
|
266
|
-
info += describeComponentFrame(name, topElement._source, owner && getComponentName(owner));
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
var currentOwner = ReactCurrentOwner.current;
|
|
270
|
-
if (currentOwner) {
|
|
271
|
-
if (typeof currentOwner.tag === 'number') {
|
|
272
|
-
var workInProgress = currentOwner;
|
|
273
|
-
// Safe because if current owner exists, we are reconciling,
|
|
274
|
-
// and it is guaranteed to be the work-in-progress version.
|
|
275
|
-
info += getStackAddendumByWorkInProgressFiber(workInProgress);
|
|
276
|
-
} else if (typeof currentOwner._debugID === 'number') {
|
|
277
|
-
info += ReactComponentTreeHook.getStackAddendumByID(currentOwner._debugID);
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
return info;
|
|
281
|
-
},
|
|
282
|
-
getStackAddendumByID: function (id) {
|
|
283
|
-
var info = '';
|
|
284
|
-
while (id) {
|
|
285
|
-
info += describeID(id);
|
|
286
|
-
id = ReactComponentTreeHook.getParentID(id);
|
|
287
|
-
}
|
|
288
|
-
return info;
|
|
289
|
-
},
|
|
290
|
-
getChildIDs: function (id) {
|
|
291
|
-
var item = getItem(id);
|
|
292
|
-
return item ? item.childIDs : [];
|
|
293
|
-
},
|
|
294
|
-
getDisplayName: function (id) {
|
|
295
|
-
var element = ReactComponentTreeHook.getElement(id);
|
|
296
|
-
if (!element) {
|
|
297
|
-
return null;
|
|
298
|
-
}
|
|
299
|
-
return getDisplayName(element);
|
|
300
|
-
},
|
|
301
|
-
getElement: function (id) {
|
|
302
|
-
var item = getItem(id);
|
|
303
|
-
return item ? item.element : null;
|
|
304
|
-
},
|
|
305
|
-
getOwnerID: function (id) {
|
|
306
|
-
var element = ReactComponentTreeHook.getElement(id);
|
|
307
|
-
if (!element || !element._owner) {
|
|
308
|
-
return null;
|
|
309
|
-
}
|
|
310
|
-
return element._owner._debugID;
|
|
311
|
-
},
|
|
312
|
-
getParentID: function (id) {
|
|
313
|
-
var item = getItem(id);
|
|
314
|
-
return item ? item.parentID : null;
|
|
315
|
-
},
|
|
316
|
-
getSource: function (id) {
|
|
317
|
-
var item = getItem(id);
|
|
318
|
-
var element = item ? item.element : null;
|
|
319
|
-
var source = element != null ? element._source : null;
|
|
320
|
-
return source;
|
|
321
|
-
},
|
|
322
|
-
getText: function (id) {
|
|
323
|
-
var element = ReactComponentTreeHook.getElement(id);
|
|
324
|
-
if (typeof element === 'string') {
|
|
325
|
-
return element;
|
|
326
|
-
} else if (typeof element === 'number') {
|
|
327
|
-
return '' + element;
|
|
328
|
-
} else {
|
|
329
|
-
return null;
|
|
330
|
-
}
|
|
331
|
-
},
|
|
332
|
-
getUpdateCount: function (id) {
|
|
333
|
-
var item = getItem(id);
|
|
334
|
-
return item ? item.updateCount : 0;
|
|
335
|
-
},
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
getRootIDs: getRootIDs,
|
|
339
|
-
getRegisteredIDs: getItemIDs
|
|
340
|
-
};
|
|
341
|
-
|
|
342
|
-
module.exports = ReactComponentTreeHook;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013-present, 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
|
-
*/
|
|
10
|
-
|
|
11
|
-
/* globals React */
|
|
12
|
-
|
|
13
|
-
'use strict';
|
|
14
|
-
|
|
15
|
-
var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
16
|
-
|
|
17
|
-
module.exports = ReactInternals.ReactComponentTreeHook;
|
package/lib/ReactCurrentOwner.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013-present, 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
|
-
*
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Keeps track of the current owner.
|
|
16
|
-
*
|
|
17
|
-
* The current owner is the component who should own any components that are
|
|
18
|
-
* currently being constructed.
|
|
19
|
-
*/
|
|
20
|
-
var ReactCurrentOwner = {
|
|
21
|
-
/**
|
|
22
|
-
* @internal
|
|
23
|
-
* @type {ReactComponent}
|
|
24
|
-
*/
|
|
25
|
-
current: null
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
module.exports = ReactCurrentOwner;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013-present, 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
|
-
*/
|
|
10
|
-
|
|
11
|
-
/* globals React */
|
|
12
|
-
|
|
13
|
-
'use strict';
|
|
14
|
-
|
|
15
|
-
var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
16
|
-
|
|
17
|
-
module.exports = ReactInternals.ReactCurrentOwner;
|
package/lib/ReactDOMFactories.js
DELETED
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013-present, 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
|
-
*/
|
|
10
|
-
|
|
11
|
-
'use strict';
|
|
12
|
-
|
|
13
|
-
var ReactElement = require('./ReactElement');
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Create a factory that creates HTML tag elements.
|
|
17
|
-
*
|
|
18
|
-
* @private
|
|
19
|
-
*/
|
|
20
|
-
var createDOMFactory = ReactElement.createFactory;
|
|
21
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
22
|
-
var ReactElementValidator = require('./ReactElementValidator');
|
|
23
|
-
createDOMFactory = ReactElementValidator.createFactory;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Creates a mapping from supported HTML tags to `ReactDOMComponent` classes.
|
|
28
|
-
* This is also accessible via `React.DOM`.
|
|
29
|
-
*
|
|
30
|
-
* @public
|
|
31
|
-
*/
|
|
32
|
-
var ReactDOMFactories = {
|
|
33
|
-
a: createDOMFactory('a'),
|
|
34
|
-
abbr: createDOMFactory('abbr'),
|
|
35
|
-
address: createDOMFactory('address'),
|
|
36
|
-
area: createDOMFactory('area'),
|
|
37
|
-
article: createDOMFactory('article'),
|
|
38
|
-
aside: createDOMFactory('aside'),
|
|
39
|
-
audio: createDOMFactory('audio'),
|
|
40
|
-
b: createDOMFactory('b'),
|
|
41
|
-
base: createDOMFactory('base'),
|
|
42
|
-
bdi: createDOMFactory('bdi'),
|
|
43
|
-
bdo: createDOMFactory('bdo'),
|
|
44
|
-
big: createDOMFactory('big'),
|
|
45
|
-
blockquote: createDOMFactory('blockquote'),
|
|
46
|
-
body: createDOMFactory('body'),
|
|
47
|
-
br: createDOMFactory('br'),
|
|
48
|
-
button: createDOMFactory('button'),
|
|
49
|
-
canvas: createDOMFactory('canvas'),
|
|
50
|
-
caption: createDOMFactory('caption'),
|
|
51
|
-
cite: createDOMFactory('cite'),
|
|
52
|
-
code: createDOMFactory('code'),
|
|
53
|
-
col: createDOMFactory('col'),
|
|
54
|
-
colgroup: createDOMFactory('colgroup'),
|
|
55
|
-
data: createDOMFactory('data'),
|
|
56
|
-
datalist: createDOMFactory('datalist'),
|
|
57
|
-
dd: createDOMFactory('dd'),
|
|
58
|
-
del: createDOMFactory('del'),
|
|
59
|
-
details: createDOMFactory('details'),
|
|
60
|
-
dfn: createDOMFactory('dfn'),
|
|
61
|
-
dialog: createDOMFactory('dialog'),
|
|
62
|
-
div: createDOMFactory('div'),
|
|
63
|
-
dl: createDOMFactory('dl'),
|
|
64
|
-
dt: createDOMFactory('dt'),
|
|
65
|
-
em: createDOMFactory('em'),
|
|
66
|
-
embed: createDOMFactory('embed'),
|
|
67
|
-
fieldset: createDOMFactory('fieldset'),
|
|
68
|
-
figcaption: createDOMFactory('figcaption'),
|
|
69
|
-
figure: createDOMFactory('figure'),
|
|
70
|
-
footer: createDOMFactory('footer'),
|
|
71
|
-
form: createDOMFactory('form'),
|
|
72
|
-
h1: createDOMFactory('h1'),
|
|
73
|
-
h2: createDOMFactory('h2'),
|
|
74
|
-
h3: createDOMFactory('h3'),
|
|
75
|
-
h4: createDOMFactory('h4'),
|
|
76
|
-
h5: createDOMFactory('h5'),
|
|
77
|
-
h6: createDOMFactory('h6'),
|
|
78
|
-
head: createDOMFactory('head'),
|
|
79
|
-
header: createDOMFactory('header'),
|
|
80
|
-
hgroup: createDOMFactory('hgroup'),
|
|
81
|
-
hr: createDOMFactory('hr'),
|
|
82
|
-
html: createDOMFactory('html'),
|
|
83
|
-
i: createDOMFactory('i'),
|
|
84
|
-
iframe: createDOMFactory('iframe'),
|
|
85
|
-
img: createDOMFactory('img'),
|
|
86
|
-
input: createDOMFactory('input'),
|
|
87
|
-
ins: createDOMFactory('ins'),
|
|
88
|
-
kbd: createDOMFactory('kbd'),
|
|
89
|
-
keygen: createDOMFactory('keygen'),
|
|
90
|
-
label: createDOMFactory('label'),
|
|
91
|
-
legend: createDOMFactory('legend'),
|
|
92
|
-
li: createDOMFactory('li'),
|
|
93
|
-
link: createDOMFactory('link'),
|
|
94
|
-
main: createDOMFactory('main'),
|
|
95
|
-
map: createDOMFactory('map'),
|
|
96
|
-
mark: createDOMFactory('mark'),
|
|
97
|
-
menu: createDOMFactory('menu'),
|
|
98
|
-
menuitem: createDOMFactory('menuitem'),
|
|
99
|
-
meta: createDOMFactory('meta'),
|
|
100
|
-
meter: createDOMFactory('meter'),
|
|
101
|
-
nav: createDOMFactory('nav'),
|
|
102
|
-
noscript: createDOMFactory('noscript'),
|
|
103
|
-
object: createDOMFactory('object'),
|
|
104
|
-
ol: createDOMFactory('ol'),
|
|
105
|
-
optgroup: createDOMFactory('optgroup'),
|
|
106
|
-
option: createDOMFactory('option'),
|
|
107
|
-
output: createDOMFactory('output'),
|
|
108
|
-
p: createDOMFactory('p'),
|
|
109
|
-
param: createDOMFactory('param'),
|
|
110
|
-
picture: createDOMFactory('picture'),
|
|
111
|
-
pre: createDOMFactory('pre'),
|
|
112
|
-
progress: createDOMFactory('progress'),
|
|
113
|
-
q: createDOMFactory('q'),
|
|
114
|
-
rp: createDOMFactory('rp'),
|
|
115
|
-
rt: createDOMFactory('rt'),
|
|
116
|
-
ruby: createDOMFactory('ruby'),
|
|
117
|
-
s: createDOMFactory('s'),
|
|
118
|
-
samp: createDOMFactory('samp'),
|
|
119
|
-
script: createDOMFactory('script'),
|
|
120
|
-
section: createDOMFactory('section'),
|
|
121
|
-
select: createDOMFactory('select'),
|
|
122
|
-
small: createDOMFactory('small'),
|
|
123
|
-
source: createDOMFactory('source'),
|
|
124
|
-
span: createDOMFactory('span'),
|
|
125
|
-
strong: createDOMFactory('strong'),
|
|
126
|
-
style: createDOMFactory('style'),
|
|
127
|
-
sub: createDOMFactory('sub'),
|
|
128
|
-
summary: createDOMFactory('summary'),
|
|
129
|
-
sup: createDOMFactory('sup'),
|
|
130
|
-
table: createDOMFactory('table'),
|
|
131
|
-
tbody: createDOMFactory('tbody'),
|
|
132
|
-
td: createDOMFactory('td'),
|
|
133
|
-
textarea: createDOMFactory('textarea'),
|
|
134
|
-
tfoot: createDOMFactory('tfoot'),
|
|
135
|
-
th: createDOMFactory('th'),
|
|
136
|
-
thead: createDOMFactory('thead'),
|
|
137
|
-
time: createDOMFactory('time'),
|
|
138
|
-
title: createDOMFactory('title'),
|
|
139
|
-
tr: createDOMFactory('tr'),
|
|
140
|
-
track: createDOMFactory('track'),
|
|
141
|
-
u: createDOMFactory('u'),
|
|
142
|
-
ul: createDOMFactory('ul'),
|
|
143
|
-
'var': createDOMFactory('var'),
|
|
144
|
-
video: createDOMFactory('video'),
|
|
145
|
-
wbr: createDOMFactory('wbr'),
|
|
146
|
-
|
|
147
|
-
// SVG
|
|
148
|
-
circle: createDOMFactory('circle'),
|
|
149
|
-
clipPath: createDOMFactory('clipPath'),
|
|
150
|
-
defs: createDOMFactory('defs'),
|
|
151
|
-
ellipse: createDOMFactory('ellipse'),
|
|
152
|
-
g: createDOMFactory('g'),
|
|
153
|
-
image: createDOMFactory('image'),
|
|
154
|
-
line: createDOMFactory('line'),
|
|
155
|
-
linearGradient: createDOMFactory('linearGradient'),
|
|
156
|
-
mask: createDOMFactory('mask'),
|
|
157
|
-
path: createDOMFactory('path'),
|
|
158
|
-
pattern: createDOMFactory('pattern'),
|
|
159
|
-
polygon: createDOMFactory('polygon'),
|
|
160
|
-
polyline: createDOMFactory('polyline'),
|
|
161
|
-
radialGradient: createDOMFactory('radialGradient'),
|
|
162
|
-
rect: createDOMFactory('rect'),
|
|
163
|
-
stop: createDOMFactory('stop'),
|
|
164
|
-
svg: createDOMFactory('svg'),
|
|
165
|
-
text: createDOMFactory('text'),
|
|
166
|
-
tspan: createDOMFactory('tspan')
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
module.exports = ReactDOMFactories;
|