react-rails 1.5.0 → 1.6.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +202 -0
- data/README.md +23 -4
- data/lib/assets/javascripts/react_ujs.js.erb +4 -1
- data/lib/assets/react-source/development-with-addons/react-server.js +16565 -16557
- data/lib/assets/react-source/development-with-addons/react.js +16564 -16556
- data/lib/assets/react-source/development/react-addons-clone-with-props.js +888 -0
- data/lib/assets/react-source/development/react-addons-create-fragment.js +1656 -0
- data/lib/assets/react-source/development/react-addons-css-transition-group.js +20429 -0
- data/lib/assets/react-source/development/react-addons-linked-state-mixin.js +19872 -0
- data/lib/assets/react-source/development/react-addons-perf.js +7634 -0
- data/lib/assets/react-source/development/react-addons-pure-render-mixin.js +199 -0
- data/lib/assets/react-source/development/react-addons-test-utils.js +20135 -0
- data/lib/assets/react-source/development/react-addons-transition-group.js +19969 -0
- data/lib/assets/react-source/development/react-addons-update.js +424 -0
- data/lib/assets/react-source/development/react-server.js +10794 -10786
- data/lib/assets/react-source/development/react.js +10787 -10753
- data/lib/assets/react-source/production-with-addons/react-server.js +6 -6
- data/lib/assets/react-source/production-with-addons/react.js +6 -6
- data/lib/assets/react-source/production/react-addons-clone-with-props.js +1 -0
- data/lib/assets/react-source/production/react-addons-create-fragment.js +1 -0
- data/lib/assets/react-source/production/react-addons-css-transition-group.js +19 -0
- data/lib/assets/react-source/production/react-addons-linked-state-mixin.js +19 -0
- data/lib/assets/react-source/production/react-addons-perf.js +15 -0
- data/lib/assets/react-source/production/react-addons-pure-render-mixin.js +1 -0
- data/lib/assets/react-source/production/react-addons-test-utils.js +19 -0
- data/lib/assets/react-source/production/react-addons-transition-group.js +19 -0
- data/lib/assets/react-source/production/react-addons-update.js +1 -0
- data/lib/assets/react-source/production/react-server.js +6 -5
- data/lib/assets/react-source/production/react.js +6 -5
- data/lib/generators/react/install_generator.rb +4 -5
- data/lib/react/rails/controller_lifecycle.rb +5 -3
- data/lib/react/rails/version.rb +1 -1
- data/lib/react/server_rendering/environment_container.rb +18 -0
- data/lib/react/server_rendering/exec_js_renderer.rb +4 -4
- data/lib/react/server_rendering/manifest_container.rb +19 -0
- data/lib/react/server_rendering/sprockets_renderer.rb +34 -27
- data/lib/react/server_rendering/sprockets_renderer/console_polyfill.js +6 -0
- data/lib/react/server_rendering/sprockets_renderer/console_replay.js +9 -0
- metadata +25 -2
|
@@ -0,0 +1,1656 @@
|
|
|
1
|
+
/******/ (function(modules) { // webpackBootstrap
|
|
2
|
+
/******/ // The module cache
|
|
3
|
+
/******/ var installedModules = {};
|
|
4
|
+
|
|
5
|
+
/******/ // The require function
|
|
6
|
+
/******/ function __webpack_require__(moduleId) {
|
|
7
|
+
|
|
8
|
+
/******/ // Check if module is in cache
|
|
9
|
+
/******/ if(installedModules[moduleId])
|
|
10
|
+
/******/ return installedModules[moduleId].exports;
|
|
11
|
+
|
|
12
|
+
/******/ // Create a new module (and put it into the cache)
|
|
13
|
+
/******/ var module = installedModules[moduleId] = {
|
|
14
|
+
/******/ exports: {},
|
|
15
|
+
/******/ id: moduleId,
|
|
16
|
+
/******/ loaded: false
|
|
17
|
+
/******/ };
|
|
18
|
+
|
|
19
|
+
/******/ // Execute the module function
|
|
20
|
+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
21
|
+
|
|
22
|
+
/******/ // Flag the module as loaded
|
|
23
|
+
/******/ module.loaded = true;
|
|
24
|
+
|
|
25
|
+
/******/ // Return the exports of the module
|
|
26
|
+
/******/ return module.exports;
|
|
27
|
+
/******/ }
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
/******/ // expose the modules object (__webpack_modules__)
|
|
31
|
+
/******/ __webpack_require__.m = modules;
|
|
32
|
+
|
|
33
|
+
/******/ // expose the module cache
|
|
34
|
+
/******/ __webpack_require__.c = installedModules;
|
|
35
|
+
|
|
36
|
+
/******/ // __webpack_public_path__
|
|
37
|
+
/******/ __webpack_require__.p = "";
|
|
38
|
+
|
|
39
|
+
/******/ // Load entry module and return exports
|
|
40
|
+
/******/ return __webpack_require__(0);
|
|
41
|
+
/******/ })
|
|
42
|
+
/************************************************************************/
|
|
43
|
+
/******/ ([
|
|
44
|
+
/* 0 */
|
|
45
|
+
/***/ function(module, exports, __webpack_require__) {
|
|
46
|
+
|
|
47
|
+
window.React.addons = window.React.addons || {};
|
|
48
|
+
window.React.addons.createFragment = __webpack_require__(13);
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
/***/ },
|
|
52
|
+
/* 1 */,
|
|
53
|
+
/* 2 */,
|
|
54
|
+
/* 3 */
|
|
55
|
+
/***/ function(module, exports) {
|
|
56
|
+
|
|
57
|
+
// shim for using process in browser
|
|
58
|
+
|
|
59
|
+
var process = module.exports = {};
|
|
60
|
+
var queue = [];
|
|
61
|
+
var draining = false;
|
|
62
|
+
var currentQueue;
|
|
63
|
+
var queueIndex = -1;
|
|
64
|
+
|
|
65
|
+
function cleanUpNextTick() {
|
|
66
|
+
draining = false;
|
|
67
|
+
if (currentQueue.length) {
|
|
68
|
+
queue = currentQueue.concat(queue);
|
|
69
|
+
} else {
|
|
70
|
+
queueIndex = -1;
|
|
71
|
+
}
|
|
72
|
+
if (queue.length) {
|
|
73
|
+
drainQueue();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function drainQueue() {
|
|
78
|
+
if (draining) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
var timeout = setTimeout(cleanUpNextTick);
|
|
82
|
+
draining = true;
|
|
83
|
+
|
|
84
|
+
var len = queue.length;
|
|
85
|
+
while(len) {
|
|
86
|
+
currentQueue = queue;
|
|
87
|
+
queue = [];
|
|
88
|
+
while (++queueIndex < len) {
|
|
89
|
+
if (currentQueue) {
|
|
90
|
+
currentQueue[queueIndex].run();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
queueIndex = -1;
|
|
94
|
+
len = queue.length;
|
|
95
|
+
}
|
|
96
|
+
currentQueue = null;
|
|
97
|
+
draining = false;
|
|
98
|
+
clearTimeout(timeout);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
process.nextTick = function (fun) {
|
|
102
|
+
var args = new Array(arguments.length - 1);
|
|
103
|
+
if (arguments.length > 1) {
|
|
104
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
105
|
+
args[i - 1] = arguments[i];
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
queue.push(new Item(fun, args));
|
|
109
|
+
if (queue.length === 1 && !draining) {
|
|
110
|
+
setTimeout(drainQueue, 0);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
// v8 likes predictible objects
|
|
115
|
+
function Item(fun, array) {
|
|
116
|
+
this.fun = fun;
|
|
117
|
+
this.array = array;
|
|
118
|
+
}
|
|
119
|
+
Item.prototype.run = function () {
|
|
120
|
+
this.fun.apply(null, this.array);
|
|
121
|
+
};
|
|
122
|
+
process.title = 'browser';
|
|
123
|
+
process.browser = true;
|
|
124
|
+
process.env = {};
|
|
125
|
+
process.argv = [];
|
|
126
|
+
process.version = ''; // empty string to avoid regexp issues
|
|
127
|
+
process.versions = {};
|
|
128
|
+
|
|
129
|
+
function noop() {}
|
|
130
|
+
|
|
131
|
+
process.on = noop;
|
|
132
|
+
process.addListener = noop;
|
|
133
|
+
process.once = noop;
|
|
134
|
+
process.off = noop;
|
|
135
|
+
process.removeListener = noop;
|
|
136
|
+
process.removeAllListeners = noop;
|
|
137
|
+
process.emit = noop;
|
|
138
|
+
|
|
139
|
+
process.binding = function (name) {
|
|
140
|
+
throw new Error('process.binding is not supported');
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
process.cwd = function () { return '/' };
|
|
144
|
+
process.chdir = function (dir) {
|
|
145
|
+
throw new Error('process.chdir is not supported');
|
|
146
|
+
};
|
|
147
|
+
process.umask = function() { return 0; };
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
/***/ },
|
|
151
|
+
/* 4 */
|
|
152
|
+
/***/ function(module, exports, __webpack_require__) {
|
|
153
|
+
|
|
154
|
+
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
155
|
+
* Copyright 2014-2015, Facebook, Inc.
|
|
156
|
+
* All rights reserved.
|
|
157
|
+
*
|
|
158
|
+
* This source code is licensed under the BSD-style license found in the
|
|
159
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
160
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
161
|
+
*
|
|
162
|
+
* @providesModule ReactElement
|
|
163
|
+
*/
|
|
164
|
+
|
|
165
|
+
'use strict';
|
|
166
|
+
|
|
167
|
+
var ReactCurrentOwner = __webpack_require__(5);
|
|
168
|
+
|
|
169
|
+
var assign = __webpack_require__(6);
|
|
170
|
+
var canDefineProperty = __webpack_require__(7);
|
|
171
|
+
|
|
172
|
+
// The Symbol used to tag the ReactElement type. If there is no native Symbol
|
|
173
|
+
// nor polyfill, then a plain number is used for performance.
|
|
174
|
+
var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
|
|
175
|
+
|
|
176
|
+
var RESERVED_PROPS = {
|
|
177
|
+
key: true,
|
|
178
|
+
ref: true,
|
|
179
|
+
__self: true,
|
|
180
|
+
__source: true
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Base constructor for all React elements. This is only used to make this
|
|
185
|
+
* work with a dynamic instanceof check. Nothing should live on this prototype.
|
|
186
|
+
*
|
|
187
|
+
* @param {*} type
|
|
188
|
+
* @param {*} key
|
|
189
|
+
* @param {string|object} ref
|
|
190
|
+
* @param {*} self A *temporary* helper to detect places where `this` is
|
|
191
|
+
* different from the `owner` when React.createElement is called, so that we
|
|
192
|
+
* can warn. We want to get rid of owner and replace string `ref`s with arrow
|
|
193
|
+
* functions, and as long as `this` and owner are the same, there will be no
|
|
194
|
+
* change in behavior.
|
|
195
|
+
* @param {*} source An annotation object (added by a transpiler or otherwise)
|
|
196
|
+
* indicating filename, line number, and/or other information.
|
|
197
|
+
* @param {*} owner
|
|
198
|
+
* @param {*} props
|
|
199
|
+
* @internal
|
|
200
|
+
*/
|
|
201
|
+
var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
202
|
+
var element = {
|
|
203
|
+
// This tag allow us to uniquely identify this as a React Element
|
|
204
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
205
|
+
|
|
206
|
+
// Built-in properties that belong on the element
|
|
207
|
+
type: type,
|
|
208
|
+
key: key,
|
|
209
|
+
ref: ref,
|
|
210
|
+
props: props,
|
|
211
|
+
|
|
212
|
+
// Record the component responsible for creating this element.
|
|
213
|
+
_owner: owner
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
217
|
+
// The validation flag is currently mutative. We put it on
|
|
218
|
+
// an external backing store so that we can freeze the whole object.
|
|
219
|
+
// This can be replaced with a WeakMap once they are implemented in
|
|
220
|
+
// commonly used development environments.
|
|
221
|
+
element._store = {};
|
|
222
|
+
|
|
223
|
+
// To make comparing ReactElements easier for testing purposes, we make
|
|
224
|
+
// the validation flag non-enumerable (where possible, which should
|
|
225
|
+
// include every environment we run tests in), so the test framework
|
|
226
|
+
// ignores it.
|
|
227
|
+
if (canDefineProperty) {
|
|
228
|
+
Object.defineProperty(element._store, 'validated', {
|
|
229
|
+
configurable: false,
|
|
230
|
+
enumerable: false,
|
|
231
|
+
writable: true,
|
|
232
|
+
value: false
|
|
233
|
+
});
|
|
234
|
+
// self and source are DEV only properties.
|
|
235
|
+
Object.defineProperty(element, '_self', {
|
|
236
|
+
configurable: false,
|
|
237
|
+
enumerable: false,
|
|
238
|
+
writable: false,
|
|
239
|
+
value: self
|
|
240
|
+
});
|
|
241
|
+
// Two elements created in two different places should be considered
|
|
242
|
+
// equal for testing purposes and therefore we hide it from enumeration.
|
|
243
|
+
Object.defineProperty(element, '_source', {
|
|
244
|
+
configurable: false,
|
|
245
|
+
enumerable: false,
|
|
246
|
+
writable: false,
|
|
247
|
+
value: source
|
|
248
|
+
});
|
|
249
|
+
} else {
|
|
250
|
+
element._store.validated = false;
|
|
251
|
+
element._self = self;
|
|
252
|
+
element._source = source;
|
|
253
|
+
}
|
|
254
|
+
Object.freeze(element.props);
|
|
255
|
+
Object.freeze(element);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
return element;
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
ReactElement.createElement = function (type, config, children) {
|
|
262
|
+
var propName;
|
|
263
|
+
|
|
264
|
+
// Reserved names are extracted
|
|
265
|
+
var props = {};
|
|
266
|
+
|
|
267
|
+
var key = null;
|
|
268
|
+
var ref = null;
|
|
269
|
+
var self = null;
|
|
270
|
+
var source = null;
|
|
271
|
+
|
|
272
|
+
if (config != null) {
|
|
273
|
+
ref = config.ref === undefined ? null : config.ref;
|
|
274
|
+
key = config.key === undefined ? null : '' + config.key;
|
|
275
|
+
self = config.__self === undefined ? null : config.__self;
|
|
276
|
+
source = config.__source === undefined ? null : config.__source;
|
|
277
|
+
// Remaining properties are added to a new props object
|
|
278
|
+
for (propName in config) {
|
|
279
|
+
if (config.hasOwnProperty(propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
280
|
+
props[propName] = config[propName];
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// Children can be more than one argument, and those are transferred onto
|
|
286
|
+
// the newly allocated props object.
|
|
287
|
+
var childrenLength = arguments.length - 2;
|
|
288
|
+
if (childrenLength === 1) {
|
|
289
|
+
props.children = children;
|
|
290
|
+
} else if (childrenLength > 1) {
|
|
291
|
+
var childArray = Array(childrenLength);
|
|
292
|
+
for (var i = 0; i < childrenLength; i++) {
|
|
293
|
+
childArray[i] = arguments[i + 2];
|
|
294
|
+
}
|
|
295
|
+
props.children = childArray;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// Resolve default props
|
|
299
|
+
if (type && type.defaultProps) {
|
|
300
|
+
var defaultProps = type.defaultProps;
|
|
301
|
+
for (propName in defaultProps) {
|
|
302
|
+
if (typeof props[propName] === 'undefined') {
|
|
303
|
+
props[propName] = defaultProps[propName];
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
ReactElement.createFactory = function (type) {
|
|
312
|
+
var factory = ReactElement.createElement.bind(null, type);
|
|
313
|
+
// Expose the type on the factory and the prototype so that it can be
|
|
314
|
+
// easily accessed on elements. E.g. `<Foo />.type === Foo`.
|
|
315
|
+
// This should not be named `constructor` since this may not be the function
|
|
316
|
+
// that created the element, and it may not even be a constructor.
|
|
317
|
+
// Legacy hook TODO: Warn if this is accessed
|
|
318
|
+
factory.type = type;
|
|
319
|
+
return factory;
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
ReactElement.cloneAndReplaceKey = function (oldElement, newKey) {
|
|
323
|
+
var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
|
|
324
|
+
|
|
325
|
+
return newElement;
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
ReactElement.cloneAndReplaceProps = function (oldElement, newProps) {
|
|
329
|
+
var newElement = ReactElement(oldElement.type, oldElement.key, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, newProps);
|
|
330
|
+
|
|
331
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
332
|
+
// If the key on the original is valid, then the clone is valid
|
|
333
|
+
newElement._store.validated = oldElement._store.validated;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
return newElement;
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
ReactElement.cloneElement = function (element, config, children) {
|
|
340
|
+
var propName;
|
|
341
|
+
|
|
342
|
+
// Original props are copied
|
|
343
|
+
var props = assign({}, element.props);
|
|
344
|
+
|
|
345
|
+
// Reserved names are extracted
|
|
346
|
+
var key = element.key;
|
|
347
|
+
var ref = element.ref;
|
|
348
|
+
// Self is preserved since the owner is preserved.
|
|
349
|
+
var self = element._self;
|
|
350
|
+
// Source is preserved since cloneElement is unlikely to be targeted by a
|
|
351
|
+
// transpiler, and the original source is probably a better indicator of the
|
|
352
|
+
// true owner.
|
|
353
|
+
var source = element._source;
|
|
354
|
+
|
|
355
|
+
// Owner will be preserved, unless ref is overridden
|
|
356
|
+
var owner = element._owner;
|
|
357
|
+
|
|
358
|
+
if (config != null) {
|
|
359
|
+
if (config.ref !== undefined) {
|
|
360
|
+
// Silently steal the ref from the parent.
|
|
361
|
+
ref = config.ref;
|
|
362
|
+
owner = ReactCurrentOwner.current;
|
|
363
|
+
}
|
|
364
|
+
if (config.key !== undefined) {
|
|
365
|
+
key = '' + config.key;
|
|
366
|
+
}
|
|
367
|
+
// Remaining properties override existing props
|
|
368
|
+
for (propName in config) {
|
|
369
|
+
if (config.hasOwnProperty(propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
370
|
+
props[propName] = config[propName];
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
// Children can be more than one argument, and those are transferred onto
|
|
376
|
+
// the newly allocated props object.
|
|
377
|
+
var childrenLength = arguments.length - 2;
|
|
378
|
+
if (childrenLength === 1) {
|
|
379
|
+
props.children = children;
|
|
380
|
+
} else if (childrenLength > 1) {
|
|
381
|
+
var childArray = Array(childrenLength);
|
|
382
|
+
for (var i = 0; i < childrenLength; i++) {
|
|
383
|
+
childArray[i] = arguments[i + 2];
|
|
384
|
+
}
|
|
385
|
+
props.children = childArray;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
return ReactElement(element.type, key, ref, self, source, owner, props);
|
|
389
|
+
};
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* @param {?object} object
|
|
393
|
+
* @return {boolean} True if `object` is a valid component.
|
|
394
|
+
* @final
|
|
395
|
+
*/
|
|
396
|
+
ReactElement.isValidElement = function (object) {
|
|
397
|
+
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
398
|
+
};
|
|
399
|
+
|
|
400
|
+
module.exports = ReactElement;
|
|
401
|
+
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
402
|
+
|
|
403
|
+
/***/ },
|
|
404
|
+
/* 5 */
|
|
405
|
+
/***/ function(module, exports) {
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
409
|
+
* All rights reserved.
|
|
410
|
+
*
|
|
411
|
+
* This source code is licensed under the BSD-style license found in the
|
|
412
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
413
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
414
|
+
*
|
|
415
|
+
* @providesModule ReactCurrentOwner
|
|
416
|
+
*/
|
|
417
|
+
|
|
418
|
+
'use strict';
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* Keeps track of the current owner.
|
|
422
|
+
*
|
|
423
|
+
* The current owner is the component who should own any components that are
|
|
424
|
+
* currently being constructed.
|
|
425
|
+
*/
|
|
426
|
+
var ReactCurrentOwner = {
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* @internal
|
|
430
|
+
* @type {ReactComponent}
|
|
431
|
+
*/
|
|
432
|
+
current: null
|
|
433
|
+
|
|
434
|
+
};
|
|
435
|
+
|
|
436
|
+
module.exports = ReactCurrentOwner;
|
|
437
|
+
|
|
438
|
+
/***/ },
|
|
439
|
+
/* 6 */
|
|
440
|
+
/***/ function(module, exports) {
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* Copyright 2014-2015, Facebook, Inc.
|
|
444
|
+
* All rights reserved.
|
|
445
|
+
*
|
|
446
|
+
* This source code is licensed under the BSD-style license found in the
|
|
447
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
448
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
449
|
+
*
|
|
450
|
+
* @providesModule Object.assign
|
|
451
|
+
*/
|
|
452
|
+
|
|
453
|
+
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign
|
|
454
|
+
|
|
455
|
+
'use strict';
|
|
456
|
+
|
|
457
|
+
function assign(target, sources) {
|
|
458
|
+
if (target == null) {
|
|
459
|
+
throw new TypeError('Object.assign target cannot be null or undefined');
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
var to = Object(target);
|
|
463
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
464
|
+
|
|
465
|
+
for (var nextIndex = 1; nextIndex < arguments.length; nextIndex++) {
|
|
466
|
+
var nextSource = arguments[nextIndex];
|
|
467
|
+
if (nextSource == null) {
|
|
468
|
+
continue;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
var from = Object(nextSource);
|
|
472
|
+
|
|
473
|
+
// We don't currently support accessors nor proxies. Therefore this
|
|
474
|
+
// copy cannot throw. If we ever supported this then we must handle
|
|
475
|
+
// exceptions and side-effects. We don't support symbols so they won't
|
|
476
|
+
// be transferred.
|
|
477
|
+
|
|
478
|
+
for (var key in from) {
|
|
479
|
+
if (hasOwnProperty.call(from, key)) {
|
|
480
|
+
to[key] = from[key];
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
return to;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
module.exports = assign;
|
|
489
|
+
|
|
490
|
+
/***/ },
|
|
491
|
+
/* 7 */
|
|
492
|
+
/***/ function(module, exports, __webpack_require__) {
|
|
493
|
+
|
|
494
|
+
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
495
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
496
|
+
* All rights reserved.
|
|
497
|
+
*
|
|
498
|
+
* This source code is licensed under the BSD-style license found in the
|
|
499
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
500
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
501
|
+
*
|
|
502
|
+
* @providesModule canDefineProperty
|
|
503
|
+
*/
|
|
504
|
+
|
|
505
|
+
'use strict';
|
|
506
|
+
|
|
507
|
+
var canDefineProperty = false;
|
|
508
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
509
|
+
try {
|
|
510
|
+
Object.defineProperty({}, 'x', { get: function () {} });
|
|
511
|
+
canDefineProperty = true;
|
|
512
|
+
} catch (x) {
|
|
513
|
+
// IE will fail on defineProperty
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
module.exports = canDefineProperty;
|
|
518
|
+
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
519
|
+
|
|
520
|
+
/***/ },
|
|
521
|
+
/* 8 */,
|
|
522
|
+
/* 9 */
|
|
523
|
+
/***/ function(module, exports) {
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
527
|
+
* All rights reserved.
|
|
528
|
+
*
|
|
529
|
+
* This source code is licensed under the BSD-style license found in the
|
|
530
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
531
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
532
|
+
*
|
|
533
|
+
* @providesModule emptyFunction
|
|
534
|
+
*/
|
|
535
|
+
|
|
536
|
+
"use strict";
|
|
537
|
+
|
|
538
|
+
function makeEmptyFunction(arg) {
|
|
539
|
+
return function () {
|
|
540
|
+
return arg;
|
|
541
|
+
};
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
* This function accepts and discards inputs; it has no side effects. This is
|
|
546
|
+
* primarily useful idiomatically for overridable function endpoints which
|
|
547
|
+
* always need to be callable, since JS lacks a null-call idiom ala Cocoa.
|
|
548
|
+
*/
|
|
549
|
+
function emptyFunction() {}
|
|
550
|
+
|
|
551
|
+
emptyFunction.thatReturns = makeEmptyFunction;
|
|
552
|
+
emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
|
|
553
|
+
emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
|
|
554
|
+
emptyFunction.thatReturnsNull = makeEmptyFunction(null);
|
|
555
|
+
emptyFunction.thatReturnsThis = function () {
|
|
556
|
+
return this;
|
|
557
|
+
};
|
|
558
|
+
emptyFunction.thatReturnsArgument = function (arg) {
|
|
559
|
+
return arg;
|
|
560
|
+
};
|
|
561
|
+
|
|
562
|
+
module.exports = emptyFunction;
|
|
563
|
+
|
|
564
|
+
/***/ },
|
|
565
|
+
/* 10 */,
|
|
566
|
+
/* 11 */,
|
|
567
|
+
/* 12 */
|
|
568
|
+
/***/ function(module, exports, __webpack_require__) {
|
|
569
|
+
|
|
570
|
+
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
571
|
+
* Copyright 2014-2015, Facebook, Inc.
|
|
572
|
+
* All rights reserved.
|
|
573
|
+
*
|
|
574
|
+
* This source code is licensed under the BSD-style license found in the
|
|
575
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
576
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
577
|
+
*
|
|
578
|
+
* @providesModule warning
|
|
579
|
+
*/
|
|
580
|
+
|
|
581
|
+
'use strict';
|
|
582
|
+
|
|
583
|
+
var emptyFunction = __webpack_require__(9);
|
|
584
|
+
|
|
585
|
+
/**
|
|
586
|
+
* Similar to invariant but only logs a warning if the condition is not met.
|
|
587
|
+
* This can be used to log issues in development environments in critical
|
|
588
|
+
* paths. Removing the logging code for production environments will keep the
|
|
589
|
+
* same logic and follow the same code paths.
|
|
590
|
+
*/
|
|
591
|
+
|
|
592
|
+
var warning = emptyFunction;
|
|
593
|
+
|
|
594
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
595
|
+
warning = function (condition, format) {
|
|
596
|
+
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
597
|
+
args[_key - 2] = arguments[_key];
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
if (format === undefined) {
|
|
601
|
+
throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
if (format.indexOf('Failed Composite propType: ') === 0) {
|
|
605
|
+
return; // Ignore CompositeComponent proptype check.
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
if (!condition) {
|
|
609
|
+
var argIndex = 0;
|
|
610
|
+
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
|
611
|
+
return args[argIndex++];
|
|
612
|
+
});
|
|
613
|
+
if (typeof console !== 'undefined') {
|
|
614
|
+
console.error(message);
|
|
615
|
+
}
|
|
616
|
+
try {
|
|
617
|
+
// --- Welcome to debugging React ---
|
|
618
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
619
|
+
// to find the callsite that caused this warning to fire.
|
|
620
|
+
throw new Error(message);
|
|
621
|
+
} catch (x) {}
|
|
622
|
+
}
|
|
623
|
+
};
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
module.exports = warning;
|
|
627
|
+
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
628
|
+
|
|
629
|
+
/***/ },
|
|
630
|
+
/* 13 */
|
|
631
|
+
/***/ function(module, exports, __webpack_require__) {
|
|
632
|
+
|
|
633
|
+
module.exports = __webpack_require__(14).create;
|
|
634
|
+
|
|
635
|
+
/***/ },
|
|
636
|
+
/* 14 */
|
|
637
|
+
/***/ function(module, exports, __webpack_require__) {
|
|
638
|
+
|
|
639
|
+
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
640
|
+
* Copyright 2015, Facebook, Inc.
|
|
641
|
+
* All rights reserved.
|
|
642
|
+
*
|
|
643
|
+
* This source code is licensed under the BSD-style license found in the
|
|
644
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
645
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
646
|
+
*
|
|
647
|
+
* @providesModule ReactFragment
|
|
648
|
+
*/
|
|
649
|
+
|
|
650
|
+
'use strict';
|
|
651
|
+
|
|
652
|
+
var ReactChildren = __webpack_require__(15);
|
|
653
|
+
var ReactElement = __webpack_require__(4);
|
|
654
|
+
|
|
655
|
+
var emptyFunction = __webpack_require__(9);
|
|
656
|
+
var invariant = __webpack_require__(17);
|
|
657
|
+
var warning = __webpack_require__(12);
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* We used to allow keyed objects to serve as a collection of ReactElements,
|
|
661
|
+
* or nested sets. This allowed us a way to explicitly key a set a fragment of
|
|
662
|
+
* components. This is now being replaced with an opaque data structure.
|
|
663
|
+
* The upgrade path is to call React.addons.createFragment({ key: value }) to
|
|
664
|
+
* create a keyed fragment. The resulting data structure is an array.
|
|
665
|
+
*/
|
|
666
|
+
|
|
667
|
+
var numericPropertyRegex = /^\d+$/;
|
|
668
|
+
|
|
669
|
+
var warnedAboutNumeric = false;
|
|
670
|
+
|
|
671
|
+
var ReactFragment = {
|
|
672
|
+
// Wrap a keyed object in an opaque proxy that warns you if you access any
|
|
673
|
+
// of its properties.
|
|
674
|
+
create: function (object) {
|
|
675
|
+
if (typeof object !== 'object' || !object || Array.isArray(object)) {
|
|
676
|
+
process.env.NODE_ENV !== 'production' ? warning(false, 'React.addons.createFragment only accepts a single object. Got: %s', object) : undefined;
|
|
677
|
+
return object;
|
|
678
|
+
}
|
|
679
|
+
if (ReactElement.isValidElement(object)) {
|
|
680
|
+
process.env.NODE_ENV !== 'production' ? warning(false, 'React.addons.createFragment does not accept a ReactElement ' + 'without a wrapper object.') : undefined;
|
|
681
|
+
return object;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
!(object.nodeType !== 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'React.addons.createFragment(...): Encountered an invalid child; DOM ' + 'elements are not valid children of React components.') : invariant(false) : undefined;
|
|
685
|
+
|
|
686
|
+
var result = [];
|
|
687
|
+
|
|
688
|
+
for (var key in object) {
|
|
689
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
690
|
+
if (!warnedAboutNumeric && numericPropertyRegex.test(key)) {
|
|
691
|
+
process.env.NODE_ENV !== 'production' ? warning(false, 'React.addons.createFragment(...): Child objects should have ' + 'non-numeric keys so ordering is preserved.') : undefined;
|
|
692
|
+
warnedAboutNumeric = true;
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
ReactChildren.mapIntoWithKeyPrefixInternal(object[key], result, key, emptyFunction.thatReturnsArgument);
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
return result;
|
|
699
|
+
}
|
|
700
|
+
};
|
|
701
|
+
|
|
702
|
+
module.exports = ReactFragment;
|
|
703
|
+
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
704
|
+
|
|
705
|
+
/***/ },
|
|
706
|
+
/* 15 */
|
|
707
|
+
/***/ function(module, exports, __webpack_require__) {
|
|
708
|
+
|
|
709
|
+
/**
|
|
710
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
711
|
+
* All rights reserved.
|
|
712
|
+
*
|
|
713
|
+
* This source code is licensed under the BSD-style license found in the
|
|
714
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
715
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
716
|
+
*
|
|
717
|
+
* @providesModule ReactChildren
|
|
718
|
+
*/
|
|
719
|
+
|
|
720
|
+
'use strict';
|
|
721
|
+
|
|
722
|
+
var PooledClass = __webpack_require__(16);
|
|
723
|
+
var ReactElement = __webpack_require__(4);
|
|
724
|
+
|
|
725
|
+
var emptyFunction = __webpack_require__(9);
|
|
726
|
+
var traverseAllChildren = __webpack_require__(18);
|
|
727
|
+
|
|
728
|
+
var twoArgumentPooler = PooledClass.twoArgumentPooler;
|
|
729
|
+
var fourArgumentPooler = PooledClass.fourArgumentPooler;
|
|
730
|
+
|
|
731
|
+
var userProvidedKeyEscapeRegex = /\/(?!\/)/g;
|
|
732
|
+
function escapeUserProvidedKey(text) {
|
|
733
|
+
return ('' + text).replace(userProvidedKeyEscapeRegex, '//');
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
/**
|
|
737
|
+
* PooledClass representing the bookkeeping associated with performing a child
|
|
738
|
+
* traversal. Allows avoiding binding callbacks.
|
|
739
|
+
*
|
|
740
|
+
* @constructor ForEachBookKeeping
|
|
741
|
+
* @param {!function} forEachFunction Function to perform traversal with.
|
|
742
|
+
* @param {?*} forEachContext Context to perform context with.
|
|
743
|
+
*/
|
|
744
|
+
function ForEachBookKeeping(forEachFunction, forEachContext) {
|
|
745
|
+
this.func = forEachFunction;
|
|
746
|
+
this.context = forEachContext;
|
|
747
|
+
this.count = 0;
|
|
748
|
+
}
|
|
749
|
+
ForEachBookKeeping.prototype.destructor = function () {
|
|
750
|
+
this.func = null;
|
|
751
|
+
this.context = null;
|
|
752
|
+
this.count = 0;
|
|
753
|
+
};
|
|
754
|
+
PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);
|
|
755
|
+
|
|
756
|
+
function forEachSingleChild(bookKeeping, child, name) {
|
|
757
|
+
var func = bookKeeping.func;
|
|
758
|
+
var context = bookKeeping.context;
|
|
759
|
+
|
|
760
|
+
func.call(context, child, bookKeeping.count++);
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* Iterates through children that are typically specified as `props.children`.
|
|
765
|
+
*
|
|
766
|
+
* The provided forEachFunc(child, index) will be called for each
|
|
767
|
+
* leaf child.
|
|
768
|
+
*
|
|
769
|
+
* @param {?*} children Children tree container.
|
|
770
|
+
* @param {function(*, int)} forEachFunc
|
|
771
|
+
* @param {*} forEachContext Context for forEachContext.
|
|
772
|
+
*/
|
|
773
|
+
function forEachChildren(children, forEachFunc, forEachContext) {
|
|
774
|
+
if (children == null) {
|
|
775
|
+
return children;
|
|
776
|
+
}
|
|
777
|
+
var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext);
|
|
778
|
+
traverseAllChildren(children, forEachSingleChild, traverseContext);
|
|
779
|
+
ForEachBookKeeping.release(traverseContext);
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
/**
|
|
783
|
+
* PooledClass representing the bookkeeping associated with performing a child
|
|
784
|
+
* mapping. Allows avoiding binding callbacks.
|
|
785
|
+
*
|
|
786
|
+
* @constructor MapBookKeeping
|
|
787
|
+
* @param {!*} mapResult Object containing the ordered map of results.
|
|
788
|
+
* @param {!function} mapFunction Function to perform mapping with.
|
|
789
|
+
* @param {?*} mapContext Context to perform mapping with.
|
|
790
|
+
*/
|
|
791
|
+
function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
|
|
792
|
+
this.result = mapResult;
|
|
793
|
+
this.keyPrefix = keyPrefix;
|
|
794
|
+
this.func = mapFunction;
|
|
795
|
+
this.context = mapContext;
|
|
796
|
+
this.count = 0;
|
|
797
|
+
}
|
|
798
|
+
MapBookKeeping.prototype.destructor = function () {
|
|
799
|
+
this.result = null;
|
|
800
|
+
this.keyPrefix = null;
|
|
801
|
+
this.func = null;
|
|
802
|
+
this.context = null;
|
|
803
|
+
this.count = 0;
|
|
804
|
+
};
|
|
805
|
+
PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler);
|
|
806
|
+
|
|
807
|
+
function mapSingleChildIntoContext(bookKeeping, child, childKey) {
|
|
808
|
+
var result = bookKeeping.result;
|
|
809
|
+
var keyPrefix = bookKeeping.keyPrefix;
|
|
810
|
+
var func = bookKeeping.func;
|
|
811
|
+
var context = bookKeeping.context;
|
|
812
|
+
|
|
813
|
+
var mappedChild = func.call(context, child, bookKeeping.count++);
|
|
814
|
+
if (Array.isArray(mappedChild)) {
|
|
815
|
+
mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument);
|
|
816
|
+
} else if (mappedChild != null) {
|
|
817
|
+
if (ReactElement.isValidElement(mappedChild)) {
|
|
818
|
+
mappedChild = ReactElement.cloneAndReplaceKey(mappedChild,
|
|
819
|
+
// Keep both the (mapped) and old keys if they differ, just as
|
|
820
|
+
// traverseAllChildren used to do for objects as children
|
|
821
|
+
keyPrefix + (mappedChild !== child ? escapeUserProvidedKey(mappedChild.key || '') + '/' : '') + childKey);
|
|
822
|
+
}
|
|
823
|
+
result.push(mappedChild);
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
|
|
828
|
+
var escapedPrefix = '';
|
|
829
|
+
if (prefix != null) {
|
|
830
|
+
escapedPrefix = escapeUserProvidedKey(prefix) + '/';
|
|
831
|
+
}
|
|
832
|
+
var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context);
|
|
833
|
+
traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
|
|
834
|
+
MapBookKeeping.release(traverseContext);
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
/**
|
|
838
|
+
* Maps children that are typically specified as `props.children`.
|
|
839
|
+
*
|
|
840
|
+
* The provided mapFunction(child, key, index) will be called for each
|
|
841
|
+
* leaf child.
|
|
842
|
+
*
|
|
843
|
+
* @param {?*} children Children tree container.
|
|
844
|
+
* @param {function(*, int)} func The map function.
|
|
845
|
+
* @param {*} context Context for mapFunction.
|
|
846
|
+
* @return {object} Object containing the ordered map of results.
|
|
847
|
+
*/
|
|
848
|
+
function mapChildren(children, func, context) {
|
|
849
|
+
if (children == null) {
|
|
850
|
+
return children;
|
|
851
|
+
}
|
|
852
|
+
var result = [];
|
|
853
|
+
mapIntoWithKeyPrefixInternal(children, result, null, func, context);
|
|
854
|
+
return result;
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
function forEachSingleChildDummy(traverseContext, child, name) {
|
|
858
|
+
return null;
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
/**
|
|
862
|
+
* Count the number of children that are typically specified as
|
|
863
|
+
* `props.children`.
|
|
864
|
+
*
|
|
865
|
+
* @param {?*} children Children tree container.
|
|
866
|
+
* @return {number} The number of children.
|
|
867
|
+
*/
|
|
868
|
+
function countChildren(children, context) {
|
|
869
|
+
return traverseAllChildren(children, forEachSingleChildDummy, null);
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
/**
|
|
873
|
+
* Flatten a children object (typically specified as `props.children`) and
|
|
874
|
+
* return an array with appropriately re-keyed children.
|
|
875
|
+
*/
|
|
876
|
+
function toArray(children) {
|
|
877
|
+
var result = [];
|
|
878
|
+
mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);
|
|
879
|
+
return result;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
var ReactChildren = {
|
|
883
|
+
forEach: forEachChildren,
|
|
884
|
+
map: mapChildren,
|
|
885
|
+
mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal,
|
|
886
|
+
count: countChildren,
|
|
887
|
+
toArray: toArray
|
|
888
|
+
};
|
|
889
|
+
|
|
890
|
+
module.exports = ReactChildren;
|
|
891
|
+
|
|
892
|
+
/***/ },
|
|
893
|
+
/* 16 */
|
|
894
|
+
/***/ function(module, exports, __webpack_require__) {
|
|
895
|
+
|
|
896
|
+
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
897
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
898
|
+
* All rights reserved.
|
|
899
|
+
*
|
|
900
|
+
* This source code is licensed under the BSD-style license found in the
|
|
901
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
902
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
903
|
+
*
|
|
904
|
+
* @providesModule PooledClass
|
|
905
|
+
*/
|
|
906
|
+
|
|
907
|
+
'use strict';
|
|
908
|
+
|
|
909
|
+
var invariant = __webpack_require__(17);
|
|
910
|
+
|
|
911
|
+
/**
|
|
912
|
+
* Static poolers. Several custom versions for each potential number of
|
|
913
|
+
* arguments. A completely generic pooler is easy to implement, but would
|
|
914
|
+
* require accessing the `arguments` object. In each of these, `this` refers to
|
|
915
|
+
* the Class itself, not an instance. If any others are needed, simply add them
|
|
916
|
+
* here, or in their own files.
|
|
917
|
+
*/
|
|
918
|
+
var oneArgumentPooler = function (copyFieldsFrom) {
|
|
919
|
+
var Klass = this;
|
|
920
|
+
if (Klass.instancePool.length) {
|
|
921
|
+
var instance = Klass.instancePool.pop();
|
|
922
|
+
Klass.call(instance, copyFieldsFrom);
|
|
923
|
+
return instance;
|
|
924
|
+
} else {
|
|
925
|
+
return new Klass(copyFieldsFrom);
|
|
926
|
+
}
|
|
927
|
+
};
|
|
928
|
+
|
|
929
|
+
var twoArgumentPooler = function (a1, a2) {
|
|
930
|
+
var Klass = this;
|
|
931
|
+
if (Klass.instancePool.length) {
|
|
932
|
+
var instance = Klass.instancePool.pop();
|
|
933
|
+
Klass.call(instance, a1, a2);
|
|
934
|
+
return instance;
|
|
935
|
+
} else {
|
|
936
|
+
return new Klass(a1, a2);
|
|
937
|
+
}
|
|
938
|
+
};
|
|
939
|
+
|
|
940
|
+
var threeArgumentPooler = function (a1, a2, a3) {
|
|
941
|
+
var Klass = this;
|
|
942
|
+
if (Klass.instancePool.length) {
|
|
943
|
+
var instance = Klass.instancePool.pop();
|
|
944
|
+
Klass.call(instance, a1, a2, a3);
|
|
945
|
+
return instance;
|
|
946
|
+
} else {
|
|
947
|
+
return new Klass(a1, a2, a3);
|
|
948
|
+
}
|
|
949
|
+
};
|
|
950
|
+
|
|
951
|
+
var fourArgumentPooler = function (a1, a2, a3, a4) {
|
|
952
|
+
var Klass = this;
|
|
953
|
+
if (Klass.instancePool.length) {
|
|
954
|
+
var instance = Klass.instancePool.pop();
|
|
955
|
+
Klass.call(instance, a1, a2, a3, a4);
|
|
956
|
+
return instance;
|
|
957
|
+
} else {
|
|
958
|
+
return new Klass(a1, a2, a3, a4);
|
|
959
|
+
}
|
|
960
|
+
};
|
|
961
|
+
|
|
962
|
+
var fiveArgumentPooler = function (a1, a2, a3, a4, a5) {
|
|
963
|
+
var Klass = this;
|
|
964
|
+
if (Klass.instancePool.length) {
|
|
965
|
+
var instance = Klass.instancePool.pop();
|
|
966
|
+
Klass.call(instance, a1, a2, a3, a4, a5);
|
|
967
|
+
return instance;
|
|
968
|
+
} else {
|
|
969
|
+
return new Klass(a1, a2, a3, a4, a5);
|
|
970
|
+
}
|
|
971
|
+
};
|
|
972
|
+
|
|
973
|
+
var standardReleaser = function (instance) {
|
|
974
|
+
var Klass = this;
|
|
975
|
+
!(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : invariant(false) : undefined;
|
|
976
|
+
instance.destructor();
|
|
977
|
+
if (Klass.instancePool.length < Klass.poolSize) {
|
|
978
|
+
Klass.instancePool.push(instance);
|
|
979
|
+
}
|
|
980
|
+
};
|
|
981
|
+
|
|
982
|
+
var DEFAULT_POOL_SIZE = 10;
|
|
983
|
+
var DEFAULT_POOLER = oneArgumentPooler;
|
|
984
|
+
|
|
985
|
+
/**
|
|
986
|
+
* Augments `CopyConstructor` to be a poolable class, augmenting only the class
|
|
987
|
+
* itself (statically) not adding any prototypical fields. Any CopyConstructor
|
|
988
|
+
* you give this may have a `poolSize` property, and will look for a
|
|
989
|
+
* prototypical `destructor` on instances (optional).
|
|
990
|
+
*
|
|
991
|
+
* @param {Function} CopyConstructor Constructor that can be used to reset.
|
|
992
|
+
* @param {Function} pooler Customizable pooler.
|
|
993
|
+
*/
|
|
994
|
+
var addPoolingTo = function (CopyConstructor, pooler) {
|
|
995
|
+
var NewKlass = CopyConstructor;
|
|
996
|
+
NewKlass.instancePool = [];
|
|
997
|
+
NewKlass.getPooled = pooler || DEFAULT_POOLER;
|
|
998
|
+
if (!NewKlass.poolSize) {
|
|
999
|
+
NewKlass.poolSize = DEFAULT_POOL_SIZE;
|
|
1000
|
+
}
|
|
1001
|
+
NewKlass.release = standardReleaser;
|
|
1002
|
+
return NewKlass;
|
|
1003
|
+
};
|
|
1004
|
+
|
|
1005
|
+
var PooledClass = {
|
|
1006
|
+
addPoolingTo: addPoolingTo,
|
|
1007
|
+
oneArgumentPooler: oneArgumentPooler,
|
|
1008
|
+
twoArgumentPooler: twoArgumentPooler,
|
|
1009
|
+
threeArgumentPooler: threeArgumentPooler,
|
|
1010
|
+
fourArgumentPooler: fourArgumentPooler,
|
|
1011
|
+
fiveArgumentPooler: fiveArgumentPooler
|
|
1012
|
+
};
|
|
1013
|
+
|
|
1014
|
+
module.exports = PooledClass;
|
|
1015
|
+
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
1016
|
+
|
|
1017
|
+
/***/ },
|
|
1018
|
+
/* 17 */
|
|
1019
|
+
/***/ function(module, exports, __webpack_require__) {
|
|
1020
|
+
|
|
1021
|
+
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
1022
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
1023
|
+
* All rights reserved.
|
|
1024
|
+
*
|
|
1025
|
+
* This source code is licensed under the BSD-style license found in the
|
|
1026
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
1027
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
1028
|
+
*
|
|
1029
|
+
* @providesModule invariant
|
|
1030
|
+
*/
|
|
1031
|
+
|
|
1032
|
+
'use strict';
|
|
1033
|
+
|
|
1034
|
+
/**
|
|
1035
|
+
* Use invariant() to assert state which your program assumes to be true.
|
|
1036
|
+
*
|
|
1037
|
+
* Provide sprintf-style format (only %s is supported) and arguments
|
|
1038
|
+
* to provide information about what broke and what you were
|
|
1039
|
+
* expecting.
|
|
1040
|
+
*
|
|
1041
|
+
* The invariant message will be stripped in production, but the invariant
|
|
1042
|
+
* will remain to ensure logic does not differ in production.
|
|
1043
|
+
*/
|
|
1044
|
+
|
|
1045
|
+
function invariant(condition, format, a, b, c, d, e, f) {
|
|
1046
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1047
|
+
if (format === undefined) {
|
|
1048
|
+
throw new Error('invariant requires an error message argument');
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
if (!condition) {
|
|
1053
|
+
var error;
|
|
1054
|
+
if (format === undefined) {
|
|
1055
|
+
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
|
1056
|
+
} else {
|
|
1057
|
+
var args = [a, b, c, d, e, f];
|
|
1058
|
+
var argIndex = 0;
|
|
1059
|
+
error = new Error(format.replace(/%s/g, function () {
|
|
1060
|
+
return args[argIndex++];
|
|
1061
|
+
}));
|
|
1062
|
+
error.name = 'Invariant Violation';
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
error.framesToPop = 1; // we don't care about invariant's own frame
|
|
1066
|
+
throw error;
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
module.exports = invariant;
|
|
1071
|
+
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
1072
|
+
|
|
1073
|
+
/***/ },
|
|
1074
|
+
/* 18 */
|
|
1075
|
+
/***/ function(module, exports, __webpack_require__) {
|
|
1076
|
+
|
|
1077
|
+
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
1078
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
1079
|
+
* All rights reserved.
|
|
1080
|
+
*
|
|
1081
|
+
* This source code is licensed under the BSD-style license found in the
|
|
1082
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
1083
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
1084
|
+
*
|
|
1085
|
+
* @providesModule traverseAllChildren
|
|
1086
|
+
*/
|
|
1087
|
+
|
|
1088
|
+
'use strict';
|
|
1089
|
+
|
|
1090
|
+
var ReactCurrentOwner = __webpack_require__(5);
|
|
1091
|
+
var ReactElement = __webpack_require__(4);
|
|
1092
|
+
var ReactInstanceHandles = __webpack_require__(19);
|
|
1093
|
+
|
|
1094
|
+
var getIteratorFn = __webpack_require__(21);
|
|
1095
|
+
var invariant = __webpack_require__(17);
|
|
1096
|
+
var warning = __webpack_require__(12);
|
|
1097
|
+
|
|
1098
|
+
var SEPARATOR = ReactInstanceHandles.SEPARATOR;
|
|
1099
|
+
var SUBSEPARATOR = ':';
|
|
1100
|
+
|
|
1101
|
+
/**
|
|
1102
|
+
* TODO: Test that a single child and an array with one item have the same key
|
|
1103
|
+
* pattern.
|
|
1104
|
+
*/
|
|
1105
|
+
|
|
1106
|
+
var userProvidedKeyEscaperLookup = {
|
|
1107
|
+
'=': '=0',
|
|
1108
|
+
'.': '=1',
|
|
1109
|
+
':': '=2'
|
|
1110
|
+
};
|
|
1111
|
+
|
|
1112
|
+
var userProvidedKeyEscapeRegex = /[=.:]/g;
|
|
1113
|
+
|
|
1114
|
+
var didWarnAboutMaps = false;
|
|
1115
|
+
|
|
1116
|
+
function userProvidedKeyEscaper(match) {
|
|
1117
|
+
return userProvidedKeyEscaperLookup[match];
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
/**
|
|
1121
|
+
* Generate a key string that identifies a component within a set.
|
|
1122
|
+
*
|
|
1123
|
+
* @param {*} component A component that could contain a manual key.
|
|
1124
|
+
* @param {number} index Index that is used if a manual key is not provided.
|
|
1125
|
+
* @return {string}
|
|
1126
|
+
*/
|
|
1127
|
+
function getComponentKey(component, index) {
|
|
1128
|
+
if (component && component.key != null) {
|
|
1129
|
+
// Explicit key
|
|
1130
|
+
return wrapUserProvidedKey(component.key);
|
|
1131
|
+
}
|
|
1132
|
+
// Implicit key determined by the index in the set
|
|
1133
|
+
return index.toString(36);
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
/**
|
|
1137
|
+
* Escape a component key so that it is safe to use in a reactid.
|
|
1138
|
+
*
|
|
1139
|
+
* @param {*} text Component key to be escaped.
|
|
1140
|
+
* @return {string} An escaped string.
|
|
1141
|
+
*/
|
|
1142
|
+
function escapeUserProvidedKey(text) {
|
|
1143
|
+
return ('' + text).replace(userProvidedKeyEscapeRegex, userProvidedKeyEscaper);
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
/**
|
|
1147
|
+
* Wrap a `key` value explicitly provided by the user to distinguish it from
|
|
1148
|
+
* implicitly-generated keys generated by a component's index in its parent.
|
|
1149
|
+
*
|
|
1150
|
+
* @param {string} key Value of a user-provided `key` attribute
|
|
1151
|
+
* @return {string}
|
|
1152
|
+
*/
|
|
1153
|
+
function wrapUserProvidedKey(key) {
|
|
1154
|
+
return '$' + escapeUserProvidedKey(key);
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
/**
|
|
1158
|
+
* @param {?*} children Children tree container.
|
|
1159
|
+
* @param {!string} nameSoFar Name of the key path so far.
|
|
1160
|
+
* @param {!function} callback Callback to invoke with each child found.
|
|
1161
|
+
* @param {?*} traverseContext Used to pass information throughout the traversal
|
|
1162
|
+
* process.
|
|
1163
|
+
* @return {!number} The number of children in this subtree.
|
|
1164
|
+
*/
|
|
1165
|
+
function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
|
|
1166
|
+
var type = typeof children;
|
|
1167
|
+
|
|
1168
|
+
if (type === 'undefined' || type === 'boolean') {
|
|
1169
|
+
// All of the above are perceived as null.
|
|
1170
|
+
children = null;
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
if (children === null || type === 'string' || type === 'number' || ReactElement.isValidElement(children)) {
|
|
1174
|
+
callback(traverseContext, children,
|
|
1175
|
+
// If it's the only child, treat the name as if it was wrapped in an array
|
|
1176
|
+
// so that it's consistent if the number of children grows.
|
|
1177
|
+
nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
|
|
1178
|
+
return 1;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
var child;
|
|
1182
|
+
var nextName;
|
|
1183
|
+
var subtreeCount = 0; // Count of children found in the current subtree.
|
|
1184
|
+
var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
|
1185
|
+
|
|
1186
|
+
if (Array.isArray(children)) {
|
|
1187
|
+
for (var i = 0; i < children.length; i++) {
|
|
1188
|
+
child = children[i];
|
|
1189
|
+
nextName = nextNamePrefix + getComponentKey(child, i);
|
|
1190
|
+
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
|
1191
|
+
}
|
|
1192
|
+
} else {
|
|
1193
|
+
var iteratorFn = getIteratorFn(children);
|
|
1194
|
+
if (iteratorFn) {
|
|
1195
|
+
var iterator = iteratorFn.call(children);
|
|
1196
|
+
var step;
|
|
1197
|
+
if (iteratorFn !== children.entries) {
|
|
1198
|
+
var ii = 0;
|
|
1199
|
+
while (!(step = iterator.next()).done) {
|
|
1200
|
+
child = step.value;
|
|
1201
|
+
nextName = nextNamePrefix + getComponentKey(child, ii++);
|
|
1202
|
+
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
|
1203
|
+
}
|
|
1204
|
+
} else {
|
|
1205
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1206
|
+
process.env.NODE_ENV !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.') : undefined;
|
|
1207
|
+
didWarnAboutMaps = true;
|
|
1208
|
+
}
|
|
1209
|
+
// Iterator will provide entry [k,v] tuples rather than values.
|
|
1210
|
+
while (!(step = iterator.next()).done) {
|
|
1211
|
+
var entry = step.value;
|
|
1212
|
+
if (entry) {
|
|
1213
|
+
child = entry[1];
|
|
1214
|
+
nextName = nextNamePrefix + wrapUserProvidedKey(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0);
|
|
1215
|
+
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
} else if (type === 'object') {
|
|
1220
|
+
var addendum = '';
|
|
1221
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1222
|
+
addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.';
|
|
1223
|
+
if (children._isReactElement) {
|
|
1224
|
+
addendum = ' It looks like you\'re using an element created by a different ' + 'version of React. Make sure to use only one copy of React.';
|
|
1225
|
+
}
|
|
1226
|
+
if (ReactCurrentOwner.current) {
|
|
1227
|
+
var name = ReactCurrentOwner.current.getName();
|
|
1228
|
+
if (name) {
|
|
1229
|
+
addendum += ' Check the render method of `' + name + '`.';
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
}
|
|
1233
|
+
var childrenString = String(children);
|
|
1234
|
+
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : invariant(false) : undefined;
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
return subtreeCount;
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
/**
|
|
1242
|
+
* Traverses children that are typically specified as `props.children`, but
|
|
1243
|
+
* might also be specified through attributes:
|
|
1244
|
+
*
|
|
1245
|
+
* - `traverseAllChildren(this.props.children, ...)`
|
|
1246
|
+
* - `traverseAllChildren(this.props.leftPanelChildren, ...)`
|
|
1247
|
+
*
|
|
1248
|
+
* The `traverseContext` is an optional argument that is passed through the
|
|
1249
|
+
* entire traversal. It can be used to store accumulations or anything else that
|
|
1250
|
+
* the callback might find relevant.
|
|
1251
|
+
*
|
|
1252
|
+
* @param {?*} children Children tree object.
|
|
1253
|
+
* @param {!function} callback To invoke upon traversing each child.
|
|
1254
|
+
* @param {?*} traverseContext Context for traversal.
|
|
1255
|
+
* @return {!number} The number of children in this subtree.
|
|
1256
|
+
*/
|
|
1257
|
+
function traverseAllChildren(children, callback, traverseContext) {
|
|
1258
|
+
if (children == null) {
|
|
1259
|
+
return 0;
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
return traverseAllChildrenImpl(children, '', callback, traverseContext);
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
module.exports = traverseAllChildren;
|
|
1266
|
+
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
1267
|
+
|
|
1268
|
+
/***/ },
|
|
1269
|
+
/* 19 */
|
|
1270
|
+
/***/ function(module, exports, __webpack_require__) {
|
|
1271
|
+
|
|
1272
|
+
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
1273
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
1274
|
+
* All rights reserved.
|
|
1275
|
+
*
|
|
1276
|
+
* This source code is licensed under the BSD-style license found in the
|
|
1277
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
1278
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
1279
|
+
*
|
|
1280
|
+
* @providesModule ReactInstanceHandles
|
|
1281
|
+
* @typechecks static-only
|
|
1282
|
+
*/
|
|
1283
|
+
|
|
1284
|
+
'use strict';
|
|
1285
|
+
|
|
1286
|
+
var ReactRootIndex = __webpack_require__(20);
|
|
1287
|
+
|
|
1288
|
+
var invariant = __webpack_require__(17);
|
|
1289
|
+
|
|
1290
|
+
var SEPARATOR = '.';
|
|
1291
|
+
var SEPARATOR_LENGTH = SEPARATOR.length;
|
|
1292
|
+
|
|
1293
|
+
/**
|
|
1294
|
+
* Maximum depth of traversals before we consider the possibility of a bad ID.
|
|
1295
|
+
*/
|
|
1296
|
+
var MAX_TREE_DEPTH = 10000;
|
|
1297
|
+
|
|
1298
|
+
/**
|
|
1299
|
+
* Creates a DOM ID prefix to use when mounting React components.
|
|
1300
|
+
*
|
|
1301
|
+
* @param {number} index A unique integer
|
|
1302
|
+
* @return {string} React root ID.
|
|
1303
|
+
* @internal
|
|
1304
|
+
*/
|
|
1305
|
+
function getReactRootIDString(index) {
|
|
1306
|
+
return SEPARATOR + index.toString(36);
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
/**
|
|
1310
|
+
* Checks if a character in the supplied ID is a separator or the end.
|
|
1311
|
+
*
|
|
1312
|
+
* @param {string} id A React DOM ID.
|
|
1313
|
+
* @param {number} index Index of the character to check.
|
|
1314
|
+
* @return {boolean} True if the character is a separator or end of the ID.
|
|
1315
|
+
* @private
|
|
1316
|
+
*/
|
|
1317
|
+
function isBoundary(id, index) {
|
|
1318
|
+
return id.charAt(index) === SEPARATOR || index === id.length;
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
/**
|
|
1322
|
+
* Checks if the supplied string is a valid React DOM ID.
|
|
1323
|
+
*
|
|
1324
|
+
* @param {string} id A React DOM ID, maybe.
|
|
1325
|
+
* @return {boolean} True if the string is a valid React DOM ID.
|
|
1326
|
+
* @private
|
|
1327
|
+
*/
|
|
1328
|
+
function isValidID(id) {
|
|
1329
|
+
return id === '' || id.charAt(0) === SEPARATOR && id.charAt(id.length - 1) !== SEPARATOR;
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
/**
|
|
1333
|
+
* Checks if the first ID is an ancestor of or equal to the second ID.
|
|
1334
|
+
*
|
|
1335
|
+
* @param {string} ancestorID
|
|
1336
|
+
* @param {string} descendantID
|
|
1337
|
+
* @return {boolean} True if `ancestorID` is an ancestor of `descendantID`.
|
|
1338
|
+
* @internal
|
|
1339
|
+
*/
|
|
1340
|
+
function isAncestorIDOf(ancestorID, descendantID) {
|
|
1341
|
+
return descendantID.indexOf(ancestorID) === 0 && isBoundary(descendantID, ancestorID.length);
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
/**
|
|
1345
|
+
* Gets the parent ID of the supplied React DOM ID, `id`.
|
|
1346
|
+
*
|
|
1347
|
+
* @param {string} id ID of a component.
|
|
1348
|
+
* @return {string} ID of the parent, or an empty string.
|
|
1349
|
+
* @private
|
|
1350
|
+
*/
|
|
1351
|
+
function getParentID(id) {
|
|
1352
|
+
return id ? id.substr(0, id.lastIndexOf(SEPARATOR)) : '';
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
/**
|
|
1356
|
+
* Gets the next DOM ID on the tree path from the supplied `ancestorID` to the
|
|
1357
|
+
* supplied `destinationID`. If they are equal, the ID is returned.
|
|
1358
|
+
*
|
|
1359
|
+
* @param {string} ancestorID ID of an ancestor node of `destinationID`.
|
|
1360
|
+
* @param {string} destinationID ID of the destination node.
|
|
1361
|
+
* @return {string} Next ID on the path from `ancestorID` to `destinationID`.
|
|
1362
|
+
* @private
|
|
1363
|
+
*/
|
|
1364
|
+
function getNextDescendantID(ancestorID, destinationID) {
|
|
1365
|
+
!(isValidID(ancestorID) && isValidID(destinationID)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNextDescendantID(%s, %s): Received an invalid React DOM ID.', ancestorID, destinationID) : invariant(false) : undefined;
|
|
1366
|
+
!isAncestorIDOf(ancestorID, destinationID) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNextDescendantID(...): React has made an invalid assumption about ' + 'the DOM hierarchy. Expected `%s` to be an ancestor of `%s`.', ancestorID, destinationID) : invariant(false) : undefined;
|
|
1367
|
+
if (ancestorID === destinationID) {
|
|
1368
|
+
return ancestorID;
|
|
1369
|
+
}
|
|
1370
|
+
// Skip over the ancestor and the immediate separator. Traverse until we hit
|
|
1371
|
+
// another separator or we reach the end of `destinationID`.
|
|
1372
|
+
var start = ancestorID.length + SEPARATOR_LENGTH;
|
|
1373
|
+
var i;
|
|
1374
|
+
for (i = start; i < destinationID.length; i++) {
|
|
1375
|
+
if (isBoundary(destinationID, i)) {
|
|
1376
|
+
break;
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
return destinationID.substr(0, i);
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
/**
|
|
1383
|
+
* Gets the nearest common ancestor ID of two IDs.
|
|
1384
|
+
*
|
|
1385
|
+
* Using this ID scheme, the nearest common ancestor ID is the longest common
|
|
1386
|
+
* prefix of the two IDs that immediately preceded a "marker" in both strings.
|
|
1387
|
+
*
|
|
1388
|
+
* @param {string} oneID
|
|
1389
|
+
* @param {string} twoID
|
|
1390
|
+
* @return {string} Nearest common ancestor ID, or the empty string if none.
|
|
1391
|
+
* @private
|
|
1392
|
+
*/
|
|
1393
|
+
function getFirstCommonAncestorID(oneID, twoID) {
|
|
1394
|
+
var minLength = Math.min(oneID.length, twoID.length);
|
|
1395
|
+
if (minLength === 0) {
|
|
1396
|
+
return '';
|
|
1397
|
+
}
|
|
1398
|
+
var lastCommonMarkerIndex = 0;
|
|
1399
|
+
// Use `<=` to traverse until the "EOL" of the shorter string.
|
|
1400
|
+
for (var i = 0; i <= minLength; i++) {
|
|
1401
|
+
if (isBoundary(oneID, i) && isBoundary(twoID, i)) {
|
|
1402
|
+
lastCommonMarkerIndex = i;
|
|
1403
|
+
} else if (oneID.charAt(i) !== twoID.charAt(i)) {
|
|
1404
|
+
break;
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
var longestCommonID = oneID.substr(0, lastCommonMarkerIndex);
|
|
1408
|
+
!isValidID(longestCommonID) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getFirstCommonAncestorID(%s, %s): Expected a valid React DOM ID: %s', oneID, twoID, longestCommonID) : invariant(false) : undefined;
|
|
1409
|
+
return longestCommonID;
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1412
|
+
/**
|
|
1413
|
+
* Traverses the parent path between two IDs (either up or down). The IDs must
|
|
1414
|
+
* not be the same, and there must exist a parent path between them. If the
|
|
1415
|
+
* callback returns `false`, traversal is stopped.
|
|
1416
|
+
*
|
|
1417
|
+
* @param {?string} start ID at which to start traversal.
|
|
1418
|
+
* @param {?string} stop ID at which to end traversal.
|
|
1419
|
+
* @param {function} cb Callback to invoke each ID with.
|
|
1420
|
+
* @param {*} arg Argument to invoke the callback with.
|
|
1421
|
+
* @param {?boolean} skipFirst Whether or not to skip the first node.
|
|
1422
|
+
* @param {?boolean} skipLast Whether or not to skip the last node.
|
|
1423
|
+
* @private
|
|
1424
|
+
*/
|
|
1425
|
+
function traverseParentPath(start, stop, cb, arg, skipFirst, skipLast) {
|
|
1426
|
+
start = start || '';
|
|
1427
|
+
stop = stop || '';
|
|
1428
|
+
!(start !== stop) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'traverseParentPath(...): Cannot traverse from and to the same ID, `%s`.', start) : invariant(false) : undefined;
|
|
1429
|
+
var traverseUp = isAncestorIDOf(stop, start);
|
|
1430
|
+
!(traverseUp || isAncestorIDOf(start, stop)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'traverseParentPath(%s, %s, ...): Cannot traverse from two IDs that do ' + 'not have a parent path.', start, stop) : invariant(false) : undefined;
|
|
1431
|
+
// Traverse from `start` to `stop` one depth at a time.
|
|
1432
|
+
var depth = 0;
|
|
1433
|
+
var traverse = traverseUp ? getParentID : getNextDescendantID;
|
|
1434
|
+
for (var id = start;; /* until break */id = traverse(id, stop)) {
|
|
1435
|
+
var ret;
|
|
1436
|
+
if ((!skipFirst || id !== start) && (!skipLast || id !== stop)) {
|
|
1437
|
+
ret = cb(id, traverseUp, arg);
|
|
1438
|
+
}
|
|
1439
|
+
if (ret === false || id === stop) {
|
|
1440
|
+
// Only break //after// visiting `stop`.
|
|
1441
|
+
break;
|
|
1442
|
+
}
|
|
1443
|
+
!(depth++ < MAX_TREE_DEPTH) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'traverseParentPath(%s, %s, ...): Detected an infinite loop while ' + 'traversing the React DOM ID tree. This may be due to malformed IDs: %s', start, stop, id) : invariant(false) : undefined;
|
|
1444
|
+
}
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1447
|
+
/**
|
|
1448
|
+
* Manages the IDs assigned to DOM representations of React components. This
|
|
1449
|
+
* uses a specific scheme in order to traverse the DOM efficiently (e.g. in
|
|
1450
|
+
* order to simulate events).
|
|
1451
|
+
*
|
|
1452
|
+
* @internal
|
|
1453
|
+
*/
|
|
1454
|
+
var ReactInstanceHandles = {
|
|
1455
|
+
|
|
1456
|
+
/**
|
|
1457
|
+
* Constructs a React root ID
|
|
1458
|
+
* @return {string} A React root ID.
|
|
1459
|
+
*/
|
|
1460
|
+
createReactRootID: function () {
|
|
1461
|
+
return getReactRootIDString(ReactRootIndex.createReactRootIndex());
|
|
1462
|
+
},
|
|
1463
|
+
|
|
1464
|
+
/**
|
|
1465
|
+
* Constructs a React ID by joining a root ID with a name.
|
|
1466
|
+
*
|
|
1467
|
+
* @param {string} rootID Root ID of a parent component.
|
|
1468
|
+
* @param {string} name A component's name (as flattened children).
|
|
1469
|
+
* @return {string} A React ID.
|
|
1470
|
+
* @internal
|
|
1471
|
+
*/
|
|
1472
|
+
createReactID: function (rootID, name) {
|
|
1473
|
+
return rootID + name;
|
|
1474
|
+
},
|
|
1475
|
+
|
|
1476
|
+
/**
|
|
1477
|
+
* Gets the DOM ID of the React component that is the root of the tree that
|
|
1478
|
+
* contains the React component with the supplied DOM ID.
|
|
1479
|
+
*
|
|
1480
|
+
* @param {string} id DOM ID of a React component.
|
|
1481
|
+
* @return {?string} DOM ID of the React component that is the root.
|
|
1482
|
+
* @internal
|
|
1483
|
+
*/
|
|
1484
|
+
getReactRootIDFromNodeID: function (id) {
|
|
1485
|
+
if (id && id.charAt(0) === SEPARATOR && id.length > 1) {
|
|
1486
|
+
var index = id.indexOf(SEPARATOR, 1);
|
|
1487
|
+
return index > -1 ? id.substr(0, index) : id;
|
|
1488
|
+
}
|
|
1489
|
+
return null;
|
|
1490
|
+
},
|
|
1491
|
+
|
|
1492
|
+
/**
|
|
1493
|
+
* Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that
|
|
1494
|
+
* should would receive a `mouseEnter` or `mouseLeave` event.
|
|
1495
|
+
*
|
|
1496
|
+
* NOTE: Does not invoke the callback on the nearest common ancestor because
|
|
1497
|
+
* nothing "entered" or "left" that element.
|
|
1498
|
+
*
|
|
1499
|
+
* @param {string} leaveID ID being left.
|
|
1500
|
+
* @param {string} enterID ID being entered.
|
|
1501
|
+
* @param {function} cb Callback to invoke on each entered/left ID.
|
|
1502
|
+
* @param {*} upArg Argument to invoke the callback with on left IDs.
|
|
1503
|
+
* @param {*} downArg Argument to invoke the callback with on entered IDs.
|
|
1504
|
+
* @internal
|
|
1505
|
+
*/
|
|
1506
|
+
traverseEnterLeave: function (leaveID, enterID, cb, upArg, downArg) {
|
|
1507
|
+
var ancestorID = getFirstCommonAncestorID(leaveID, enterID);
|
|
1508
|
+
if (ancestorID !== leaveID) {
|
|
1509
|
+
traverseParentPath(leaveID, ancestorID, cb, upArg, false, true);
|
|
1510
|
+
}
|
|
1511
|
+
if (ancestorID !== enterID) {
|
|
1512
|
+
traverseParentPath(ancestorID, enterID, cb, downArg, true, false);
|
|
1513
|
+
}
|
|
1514
|
+
},
|
|
1515
|
+
|
|
1516
|
+
/**
|
|
1517
|
+
* Simulates the traversal of a two-phase, capture/bubble event dispatch.
|
|
1518
|
+
*
|
|
1519
|
+
* NOTE: This traversal happens on IDs without touching the DOM.
|
|
1520
|
+
*
|
|
1521
|
+
* @param {string} targetID ID of the target node.
|
|
1522
|
+
* @param {function} cb Callback to invoke.
|
|
1523
|
+
* @param {*} arg Argument to invoke the callback with.
|
|
1524
|
+
* @internal
|
|
1525
|
+
*/
|
|
1526
|
+
traverseTwoPhase: function (targetID, cb, arg) {
|
|
1527
|
+
if (targetID) {
|
|
1528
|
+
traverseParentPath('', targetID, cb, arg, true, false);
|
|
1529
|
+
traverseParentPath(targetID, '', cb, arg, false, true);
|
|
1530
|
+
}
|
|
1531
|
+
},
|
|
1532
|
+
|
|
1533
|
+
/**
|
|
1534
|
+
* Same as `traverseTwoPhase` but skips the `targetID`.
|
|
1535
|
+
*/
|
|
1536
|
+
traverseTwoPhaseSkipTarget: function (targetID, cb, arg) {
|
|
1537
|
+
if (targetID) {
|
|
1538
|
+
traverseParentPath('', targetID, cb, arg, true, true);
|
|
1539
|
+
traverseParentPath(targetID, '', cb, arg, true, true);
|
|
1540
|
+
}
|
|
1541
|
+
},
|
|
1542
|
+
|
|
1543
|
+
/**
|
|
1544
|
+
* Traverse a node ID, calling the supplied `cb` for each ancestor ID. For
|
|
1545
|
+
* example, passing `.0.$row-0.1` would result in `cb` getting called
|
|
1546
|
+
* with `.0`, `.0.$row-0`, and `.0.$row-0.1`.
|
|
1547
|
+
*
|
|
1548
|
+
* NOTE: This traversal happens on IDs without touching the DOM.
|
|
1549
|
+
*
|
|
1550
|
+
* @param {string} targetID ID of the target node.
|
|
1551
|
+
* @param {function} cb Callback to invoke.
|
|
1552
|
+
* @param {*} arg Argument to invoke the callback with.
|
|
1553
|
+
* @internal
|
|
1554
|
+
*/
|
|
1555
|
+
traverseAncestors: function (targetID, cb, arg) {
|
|
1556
|
+
traverseParentPath('', targetID, cb, arg, true, false);
|
|
1557
|
+
},
|
|
1558
|
+
|
|
1559
|
+
getFirstCommonAncestorID: getFirstCommonAncestorID,
|
|
1560
|
+
|
|
1561
|
+
/**
|
|
1562
|
+
* Exposed for unit testing.
|
|
1563
|
+
* @private
|
|
1564
|
+
*/
|
|
1565
|
+
_getNextDescendantID: getNextDescendantID,
|
|
1566
|
+
|
|
1567
|
+
isAncestorIDOf: isAncestorIDOf,
|
|
1568
|
+
|
|
1569
|
+
SEPARATOR: SEPARATOR
|
|
1570
|
+
|
|
1571
|
+
};
|
|
1572
|
+
|
|
1573
|
+
module.exports = ReactInstanceHandles;
|
|
1574
|
+
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
1575
|
+
|
|
1576
|
+
/***/ },
|
|
1577
|
+
/* 20 */
|
|
1578
|
+
/***/ function(module, exports) {
|
|
1579
|
+
|
|
1580
|
+
/**
|
|
1581
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
1582
|
+
* All rights reserved.
|
|
1583
|
+
*
|
|
1584
|
+
* This source code is licensed under the BSD-style license found in the
|
|
1585
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
1586
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
1587
|
+
*
|
|
1588
|
+
* @providesModule ReactRootIndex
|
|
1589
|
+
* @typechecks
|
|
1590
|
+
*/
|
|
1591
|
+
|
|
1592
|
+
'use strict';
|
|
1593
|
+
|
|
1594
|
+
var ReactRootIndexInjection = {
|
|
1595
|
+
/**
|
|
1596
|
+
* @param {function} _createReactRootIndex
|
|
1597
|
+
*/
|
|
1598
|
+
injectCreateReactRootIndex: function (_createReactRootIndex) {
|
|
1599
|
+
ReactRootIndex.createReactRootIndex = _createReactRootIndex;
|
|
1600
|
+
}
|
|
1601
|
+
};
|
|
1602
|
+
|
|
1603
|
+
var ReactRootIndex = {
|
|
1604
|
+
createReactRootIndex: null,
|
|
1605
|
+
injection: ReactRootIndexInjection
|
|
1606
|
+
};
|
|
1607
|
+
|
|
1608
|
+
module.exports = ReactRootIndex;
|
|
1609
|
+
|
|
1610
|
+
/***/ },
|
|
1611
|
+
/* 21 */
|
|
1612
|
+
/***/ function(module, exports) {
|
|
1613
|
+
|
|
1614
|
+
/**
|
|
1615
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
1616
|
+
* All rights reserved.
|
|
1617
|
+
*
|
|
1618
|
+
* This source code is licensed under the BSD-style license found in the
|
|
1619
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
1620
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
1621
|
+
*
|
|
1622
|
+
* @providesModule getIteratorFn
|
|
1623
|
+
* @typechecks static-only
|
|
1624
|
+
*/
|
|
1625
|
+
|
|
1626
|
+
'use strict';
|
|
1627
|
+
|
|
1628
|
+
/* global Symbol */
|
|
1629
|
+
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
1630
|
+
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
|
1631
|
+
|
|
1632
|
+
/**
|
|
1633
|
+
* Returns the iterator method function contained on the iterable object.
|
|
1634
|
+
*
|
|
1635
|
+
* Be sure to invoke the function with the iterable as context:
|
|
1636
|
+
*
|
|
1637
|
+
* var iteratorFn = getIteratorFn(myIterable);
|
|
1638
|
+
* if (iteratorFn) {
|
|
1639
|
+
* var iterator = iteratorFn.call(myIterable);
|
|
1640
|
+
* ...
|
|
1641
|
+
* }
|
|
1642
|
+
*
|
|
1643
|
+
* @param {?object} maybeIterable
|
|
1644
|
+
* @return {?function}
|
|
1645
|
+
*/
|
|
1646
|
+
function getIteratorFn(maybeIterable) {
|
|
1647
|
+
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
1648
|
+
if (typeof iteratorFn === 'function') {
|
|
1649
|
+
return iteratorFn;
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1653
|
+
module.exports = getIteratorFn;
|
|
1654
|
+
|
|
1655
|
+
/***/ }
|
|
1656
|
+
/******/ ]);
|