react-rails 2.4.4 → 2.4.5
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 +5 -5
- data/CHANGELOG.md +10 -0
- data/README.md +20 -1
- data/lib/assets/react-source/development/react-server.js +978 -699
- data/lib/assets/react-source/development/react.js +7985 -6713
- data/lib/assets/react-source/production/react-server.js +4 -4
- data/lib/assets/react-source/production/react.js +7 -6
- data/lib/generators/react/component_generator.rb +1 -1
- data/lib/react/rails/version.rb +1 -1
- data/lib/react/server_rendering/webpacker_manifest_container.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0cda1e3195b0f783b36713deb6688010e94823f8d582e9e3e0589bf3048ecce7
|
4
|
+
data.tar.gz: d997b158a3785b20e154382ed54de7a2c18b6486b5109e1a8392d399579f90d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4875d0236291a42bc58e355b31da559226814df39bb0b9bbb4850c68c6ff9e7417037f8bea385d81e98e575cd0bea4db55c2d97702cc05e9d79a903fce9480ba
|
7
|
+
data.tar.gz: 27d0d5e45daf3b842c5dd3343690dbe225b3ea83bd4972f41c109018cfceacdc1d9a13956e4324370e113edd3a6e5c86bae7fadf9515f9aa45f561f1ee68324c
|
data/CHANGELOG.md
CHANGED
@@ -12,6 +12,16 @@
|
|
12
12
|
|
13
13
|
#### New Features
|
14
14
|
|
15
|
+
- React 16.3.2 prebundled #908
|
16
|
+
- Supports Webpacker 4.x #895
|
17
|
+
- Enhanced generator to create components in subdirectories #890
|
18
|
+
- Explicitly support Rails 5.2 #893
|
19
|
+
- Enhanced documentation for Turbolinks usage #900
|
20
|
+
|
21
|
+
## 2.4.4
|
22
|
+
|
23
|
+
#### New Features
|
24
|
+
|
15
25
|
- React 16.2 prebundled #856, #874
|
16
26
|
- Use Fragments instead of Divs by default #856
|
17
27
|
- Explicitly support Ruby 2.5 #857
|
data/README.md
CHANGED
@@ -87,6 +87,12 @@ $ rails g react:component HelloWorld greeting:string
|
|
87
87
|
|
88
88
|
Your component is added to `app/javascript/components/` by default.
|
89
89
|
|
90
|
+
You can also generate your component in a subdirectory:
|
91
|
+
|
92
|
+
```
|
93
|
+
$ rails g react:component my_subdirectory/HelloWorld greeting:string
|
94
|
+
```
|
95
|
+
|
90
96
|
[Render it in a Rails view](#view-helper):
|
91
97
|
|
92
98
|
```erb
|
@@ -135,7 +141,7 @@ $ bundle exec rails webpacker:install:typescript
|
|
135
141
|
$ yarn add @types/react @types/react-dom
|
136
142
|
```
|
137
143
|
|
138
|
-
Doing this will allow React-Rails to support the .tsx extension.
|
144
|
+
Doing this will allow React-Rails to support the .tsx extension.
|
139
145
|
|
140
146
|
## Use with Asset Pipeline
|
141
147
|
|
@@ -304,6 +310,19 @@ ReactRailsUJS.detectEvents()
|
|
304
310
|
|
305
311
|
For example, if `Turbolinks` is loaded _after_ `ReactRailsUJS`, you'll need to call this again. This function removes previous handlers before adding new ones, so it's safe to call as often as needed.
|
306
312
|
|
313
|
+
If `Turbolinks` is `import`ed via Webpacker (and thus not available globally), `ReactRailsUJS` will be unable to locate it. To fix this, you can temporarily add it to the global namespace:
|
314
|
+
|
315
|
+
```js
|
316
|
+
// Order is particular. First start Turbolinks:
|
317
|
+
Turbolinks.start();
|
318
|
+
// Add Turbolinks to the global namespace:
|
319
|
+
window.Turbolinks = Turbolinks;
|
320
|
+
// Remove previous event handlers and add new ones:
|
321
|
+
ReactRailsUJS.detectEvents();
|
322
|
+
// (Optional) Clean up global namespace:
|
323
|
+
delete window.Turbolinks;
|
324
|
+
```
|
325
|
+
|
307
326
|
### `getConstructor`
|
308
327
|
|
309
328
|
Components are loaded with `ReactRailsUJS.getConstructor(className)`. This function has two built-in implementations:
|
@@ -45,9 +45,9 @@
|
|
45
45
|
/***/ (function(module, exports, __webpack_require__) {
|
46
46
|
|
47
47
|
/* WEBPACK VAR INJECTION */(function(global) {var React = __webpack_require__(1);
|
48
|
-
var ReactDOMServer = __webpack_require__(
|
49
|
-
var createReactClass = __webpack_require__(
|
50
|
-
var PropTypes = __webpack_require__(
|
48
|
+
var ReactDOMServer = __webpack_require__(30);
|
49
|
+
var createReactClass = __webpack_require__(25);
|
50
|
+
var PropTypes = __webpack_require__(27);
|
51
51
|
|
52
52
|
global.React = React;
|
53
53
|
global.ReactDOMServer = ReactDOMServer;
|
@@ -65,7 +65,7 @@
|
|
65
65
|
if (process.env.NODE_ENV === 'production') {
|
66
66
|
module.exports = __webpack_require__(3);
|
67
67
|
} else {
|
68
|
-
module.exports = __webpack_require__(
|
68
|
+
module.exports = __webpack_require__(8);
|
69
69
|
}
|
70
70
|
|
71
71
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))
|
@@ -264,7 +264,7 @@
|
|
264
264
|
/* 3 */
|
265
265
|
/***/ (function(module, exports, __webpack_require__) {
|
266
266
|
|
267
|
-
/** @license React v16.2
|
267
|
+
/** @license React v16.3.2
|
268
268
|
* react.production.min.js
|
269
269
|
*
|
270
270
|
* Copyright (c) 2013-present, Facebook, Inc.
|
@@ -273,18 +273,19 @@
|
|
273
273
|
* LICENSE file in the root directory of this source tree.
|
274
274
|
*/
|
275
275
|
|
276
|
-
'use strict';var m=__webpack_require__(4),n=__webpack_require__(5),p=__webpack_require__(6),q="function"===typeof Symbol&&Symbol["for"],r
|
277
|
-
function
|
278
|
-
|
279
|
-
|
280
|
-
function
|
281
|
-
function escape(a){var b={"\x3d":"\x3d0",":":"\x3d2"};return"$"+(""+a).replace(/[=:]/g,function(a){return b[a]})}var
|
282
|
-
function
|
283
|
-
|
284
|
-
function
|
285
|
-
var
|
286
|
-
d=a.
|
287
|
-
isValidElement:
|
276
|
+
'use strict';var m=__webpack_require__(4),n=__webpack_require__(5),p=__webpack_require__(6),q=__webpack_require__(7),r="function"===typeof Symbol&&Symbol["for"],t=r?Symbol["for"]("react.element"):60103,u=r?Symbol["for"]("react.portal"):60106,v=r?Symbol["for"]("react.fragment"):60107,w=r?Symbol["for"]("react.strict_mode"):60108,x=r?Symbol["for"]("react.provider"):60109,y=r?Symbol["for"]("react.context"):60110,z=r?Symbol["for"]("react.async_mode"):60111,A=r?Symbol["for"]("react.forward_ref"):
|
277
|
+
60112,B="function"===typeof Symbol&&Symbol.iterator;function C(a){for(var b=arguments.length-1,e="http://reactjs.org/docs/error-decoder.html?invariant\x3d"+a,c=0;c<b;c++)e+="\x26args[]\x3d"+encodeURIComponent(arguments[c+1]);n(!1,"Minified React error #"+a+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",e)}var D={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}};
|
278
|
+
function E(a,b,e){this.props=a;this.context=b;this.refs=p;this.updater=e||D}E.prototype.isReactComponent={};E.prototype.setState=function(a,b){"object"!==typeof a&&"function"!==typeof a&&null!=a?C("85"):void 0;this.updater.enqueueSetState(this,a,b,"setState")};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate")};function F(){}F.prototype=E.prototype;function G(a,b,e){this.props=a;this.context=b;this.refs=p;this.updater=e||D}var H=G.prototype=new F;
|
279
|
+
H.constructor=G;m(H,E.prototype);H.isPureReactComponent=!0;var I={current:null},J=Object.prototype.hasOwnProperty,K={key:!0,ref:!0,__self:!0,__source:!0};
|
280
|
+
function L(a,b,e){var c=void 0,d={},g=null,h=null;if(null!=b)for(c in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(g=""+b.key),b)J.call(b,c)&&!K.hasOwnProperty(c)&&(d[c]=b[c]);var f=arguments.length-2;if(1===f)d.children=e;else if(1<f){for(var k=Array(f),l=0;l<f;l++)k[l]=arguments[l+2];d.children=k}if(a&&a.defaultProps)for(c in f=a.defaultProps,f)void 0===d[c]&&(d[c]=f[c]);return{$$typeof:t,type:a,key:g,ref:h,props:d,_owner:I.current}}
|
281
|
+
function M(a){return"object"===typeof a&&null!==a&&a.$$typeof===t}function escape(a){var b={"\x3d":"\x3d0",":":"\x3d2"};return"$"+(""+a).replace(/[=:]/g,function(a){return b[a]})}var N=/\/+/g,O=[];function P(a,b,e,c){if(O.length){var d=O.pop();d.result=a;d.keyPrefix=b;d.func=e;d.context=c;d.count=0;return d}return{result:a,keyPrefix:b,func:e,context:c,count:0}}function Q(a){a.result=null;a.keyPrefix=null;a.func=null;a.context=null;a.count=0;10>O.length&&O.push(a)}
|
282
|
+
function R(a,b,e,c){var d=typeof a;if("undefined"===d||"boolean"===d)a=null;var g=!1;if(null===a)g=!0;else switch(d){case "string":case "number":g=!0;break;case "object":switch(a.$$typeof){case t:case u:g=!0}}if(g)return e(c,a,""===b?"."+S(a,0):b),1;g=0;b=""===b?".":b+":";if(Array.isArray(a))for(var h=0;h<a.length;h++){d=a[h];var f=b+S(d,h);g+=R(d,f,e,c)}else if(null===a||"undefined"===typeof a?f=null:(f=B&&a[B]||a["@@iterator"],f="function"===typeof f?f:null),"function"===typeof f)for(a=f.call(a),
|
283
|
+
h=0;!(d=a.next()).done;)d=d.value,f=b+S(d,h++),g+=R(d,f,e,c);else"object"===d&&(e=""+a,C("31","[object Object]"===e?"object with keys {"+Object.keys(a).join(", ")+"}":e,""));return g}function S(a,b){return"object"===typeof a&&null!==a&&null!=a.key?escape(a.key):b.toString(36)}function T(a,b){a.func.call(a.context,b,a.count++)}
|
284
|
+
function U(a,b,e){var c=a.result,d=a.keyPrefix;a=a.func.call(a.context,b,a.count++);Array.isArray(a)?V(a,c,e,q.thatReturnsArgument):null!=a&&(M(a)&&(b=d+(!a.key||b&&b.key===a.key?"":(""+a.key).replace(N,"$\x26/")+"/")+e,a={$$typeof:t,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}),c.push(a))}function V(a,b,e,c,d){var g="";null!=e&&(g=(""+e).replace(N,"$\x26/")+"/");b=P(b,g,c,d);null==a||R(a,"",U,b);Q(b)}
|
285
|
+
var W={Children:{map:function(a,b,e){if(null==a)return a;var c=[];V(a,c,null,b,e);return c},forEach:function(a,b,e){if(null==a)return a;b=P(null,null,b,e);null==a||R(a,"",T,b);Q(b)},count:function(a){return null==a?0:R(a,"",q.thatReturnsNull,null)},toArray:function(a){var b=[];V(a,b,null,q.thatReturnsArgument);return b},only:function(a){M(a)?void 0:C("143");return a}},createRef:function(){return{current:null}},Component:E,PureComponent:G,createContext:function(a,b){void 0===b&&(b=null);a={$$typeof:y,
|
286
|
+
_calculateChangedBits:b,_defaultValue:a,_currentValue:a,_changedBits:0,Provider:null,Consumer:null};a.Provider={$$typeof:x,_context:a};return a.Consumer=a},forwardRef:function(a){return{$$typeof:A,render:a}},Fragment:v,StrictMode:w,unstable_AsyncMode:z,createElement:L,cloneElement:function(a,b,e){null===a||void 0===a?C("267",a):void 0;var c=void 0,d=m({},a.props),g=a.key,h=a.ref,f=a._owner;if(null!=b){void 0!==b.ref&&(h=b.ref,f=I.current);void 0!==b.key&&(g=""+b.key);var k=void 0;a.type&&a.type.defaultProps&&
|
287
|
+
(k=a.type.defaultProps);for(c in b)J.call(b,c)&&!K.hasOwnProperty(c)&&(d[c]=void 0===b[c]&&void 0!==k?k[c]:b[c])}c=arguments.length-2;if(1===c)d.children=e;else if(1<c){k=Array(c);for(var l=0;l<c;l++)k[l]=arguments[l+2];d.children=k}return{$$typeof:t,type:a.type,key:g,ref:h,props:d,_owner:f}},createFactory:function(a){var b=L.bind(null,a);b.type=a;return b},isValidElement:M,version:"16.3.2",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:I,assign:m}},X=Object.freeze({default:W}),
|
288
|
+
Y=X&&W||X;module.exports=Y["default"]?Y["default"]:Y;
|
288
289
|
|
289
290
|
|
290
291
|
/***/ }),
|
@@ -397,6 +398,65 @@
|
|
397
398
|
|
398
399
|
'use strict';
|
399
400
|
|
401
|
+
/**
|
402
|
+
* Use invariant() to assert state which your program assumes to be true.
|
403
|
+
*
|
404
|
+
* Provide sprintf-style format (only %s is supported) and arguments
|
405
|
+
* to provide information about what broke and what you were
|
406
|
+
* expecting.
|
407
|
+
*
|
408
|
+
* The invariant message will be stripped in production, but the invariant
|
409
|
+
* will remain to ensure logic does not differ in production.
|
410
|
+
*/
|
411
|
+
|
412
|
+
var validateFormat = function validateFormat(format) {};
|
413
|
+
|
414
|
+
if (process.env.NODE_ENV !== 'production') {
|
415
|
+
validateFormat = function validateFormat(format) {
|
416
|
+
if (format === undefined) {
|
417
|
+
throw new Error('invariant requires an error message argument');
|
418
|
+
}
|
419
|
+
};
|
420
|
+
}
|
421
|
+
|
422
|
+
function invariant(condition, format, a, b, c, d, e, f) {
|
423
|
+
validateFormat(format);
|
424
|
+
|
425
|
+
if (!condition) {
|
426
|
+
var error;
|
427
|
+
if (format === undefined) {
|
428
|
+
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
429
|
+
} else {
|
430
|
+
var args = [a, b, c, d, e, f];
|
431
|
+
var argIndex = 0;
|
432
|
+
error = new Error(format.replace(/%s/g, function () {
|
433
|
+
return args[argIndex++];
|
434
|
+
}));
|
435
|
+
error.name = 'Invariant Violation';
|
436
|
+
}
|
437
|
+
|
438
|
+
error.framesToPop = 1; // we don't care about invariant's own frame
|
439
|
+
throw error;
|
440
|
+
}
|
441
|
+
}
|
442
|
+
|
443
|
+
module.exports = invariant;
|
444
|
+
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))
|
445
|
+
|
446
|
+
/***/ }),
|
447
|
+
/* 6 */
|
448
|
+
/***/ (function(module, exports, __webpack_require__) {
|
449
|
+
|
450
|
+
/* WEBPACK VAR INJECTION */(function(process) {/**
|
451
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
452
|
+
*
|
453
|
+
* This source code is licensed under the MIT license found in the
|
454
|
+
* LICENSE file in the root directory of this source tree.
|
455
|
+
*
|
456
|
+
*/
|
457
|
+
|
458
|
+
'use strict';
|
459
|
+
|
400
460
|
var emptyObject = {};
|
401
461
|
|
402
462
|
if (process.env.NODE_ENV !== 'production') {
|
@@ -407,7 +467,7 @@
|
|
407
467
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))
|
408
468
|
|
409
469
|
/***/ }),
|
410
|
-
/*
|
470
|
+
/* 7 */
|
411
471
|
/***/ (function(module, exports) {
|
412
472
|
|
413
473
|
"use strict";
|
@@ -448,10 +508,10 @@
|
|
448
508
|
module.exports = emptyFunction;
|
449
509
|
|
450
510
|
/***/ }),
|
451
|
-
/*
|
511
|
+
/* 8 */
|
452
512
|
/***/ (function(module, exports, __webpack_require__) {
|
453
513
|
|
454
|
-
/* WEBPACK VAR INJECTION */(function(process) {/** @license React v16.2
|
514
|
+
/* WEBPACK VAR INJECTION */(function(process) {/** @license React v16.3.2
|
455
515
|
* react.development.js
|
456
516
|
*
|
457
517
|
* Copyright (c) 2013-present, Facebook, Inc.
|
@@ -469,15 +529,15 @@
|
|
469
529
|
'use strict';
|
470
530
|
|
471
531
|
var _assign = __webpack_require__(4);
|
472
|
-
var
|
473
|
-
var
|
532
|
+
var invariant = __webpack_require__(5);
|
533
|
+
var emptyObject = __webpack_require__(6);
|
474
534
|
var warning = __webpack_require__(9);
|
475
|
-
var emptyFunction = __webpack_require__(
|
535
|
+
var emptyFunction = __webpack_require__(7);
|
476
536
|
var checkPropTypes = __webpack_require__(10);
|
477
537
|
|
478
538
|
// TODO: this is special because it gets imported during build.
|
479
539
|
|
480
|
-
var ReactVersion = '16.2
|
540
|
+
var ReactVersion = '16.3.2';
|
481
541
|
|
482
542
|
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
483
543
|
// nor polyfill, then a plain number is used for performance.
|
@@ -488,6 +548,11 @@
|
|
488
548
|
var REACT_RETURN_TYPE = hasSymbol ? Symbol['for']('react.return') : 0xeac9;
|
489
549
|
var REACT_PORTAL_TYPE = hasSymbol ? Symbol['for']('react.portal') : 0xeaca;
|
490
550
|
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol['for']('react.fragment') : 0xeacb;
|
551
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol['for']('react.strict_mode') : 0xeacc;
|
552
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol['for']('react.provider') : 0xeacd;
|
553
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol['for']('react.context') : 0xeace;
|
554
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol['for']('react.async_mode') : 0xeacf;
|
555
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol['for']('react.forward_ref') : 0xead0;
|
491
556
|
|
492
557
|
var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
493
558
|
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
@@ -503,12 +568,8 @@
|
|
503
568
|
return null;
|
504
569
|
}
|
505
570
|
|
506
|
-
|
507
|
-
|
508
|
-
* This is a replacement for `invariant(...)` used by the error code system
|
509
|
-
* and will _only_ be required by the corresponding babel pass.
|
510
|
-
* It always throws.
|
511
|
-
*/
|
571
|
+
// Relying on the `invariant()` implementation lets us
|
572
|
+
// have preserve the format and params in the www builds.
|
512
573
|
|
513
574
|
/**
|
514
575
|
* Forked from fbjs/warning:
|
@@ -567,13 +628,13 @@
|
|
567
628
|
|
568
629
|
function warnNoop(publicInstance, callerName) {
|
569
630
|
{
|
570
|
-
var
|
571
|
-
var componentName =
|
631
|
+
var _constructor = publicInstance.constructor;
|
632
|
+
var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
|
572
633
|
var warningKey = componentName + '.' + callerName;
|
573
634
|
if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
|
574
635
|
return;
|
575
636
|
}
|
576
|
-
warning(false, '%s
|
637
|
+
warning(false, "Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);
|
577
638
|
didWarnStateUpdateForUnmountedComponent[warningKey] = true;
|
578
639
|
}
|
579
640
|
}
|
@@ -733,46 +794,36 @@
|
|
733
794
|
}
|
734
795
|
}
|
735
796
|
|
797
|
+
function ComponentDummy() {}
|
798
|
+
ComponentDummy.prototype = Component.prototype;
|
799
|
+
|
736
800
|
/**
|
737
|
-
*
|
801
|
+
* Convenience component with default shallow equality check for sCU.
|
738
802
|
*/
|
739
803
|
function PureComponent(props, context, updater) {
|
740
|
-
// Duplicated from Component.
|
741
804
|
this.props = props;
|
742
805
|
this.context = context;
|
743
806
|
this.refs = emptyObject;
|
744
|
-
// We initialize the default updater but the real one gets injected by the
|
745
|
-
// renderer.
|
746
807
|
this.updater = updater || ReactNoopUpdateQueue;
|
747
808
|
}
|
748
809
|
|
749
|
-
function ComponentDummy() {}
|
750
|
-
ComponentDummy.prototype = Component.prototype;
|
751
810
|
var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
752
811
|
pureComponentPrototype.constructor = PureComponent;
|
753
812
|
// Avoid an extra prototype jump for these methods.
|
754
813
|
_assign(pureComponentPrototype, Component.prototype);
|
755
814
|
pureComponentPrototype.isPureReactComponent = true;
|
756
815
|
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
816
|
+
// an immutable object with a single mutable value
|
817
|
+
function createRef() {
|
818
|
+
var refObject = {
|
819
|
+
current: null
|
820
|
+
};
|
821
|
+
{
|
822
|
+
Object.seal(refObject);
|
823
|
+
}
|
824
|
+
return refObject;
|
765
825
|
}
|
766
826
|
|
767
|
-
var asyncComponentPrototype = AsyncComponent.prototype = new ComponentDummy();
|
768
|
-
asyncComponentPrototype.constructor = AsyncComponent;
|
769
|
-
// Avoid an extra prototype jump for these methods.
|
770
|
-
_assign(asyncComponentPrototype, Component.prototype);
|
771
|
-
asyncComponentPrototype.unstable_isAsyncReactComponent = true;
|
772
|
-
asyncComponentPrototype.render = function () {
|
773
|
-
return this.props.children;
|
774
|
-
};
|
775
|
-
|
776
827
|
/**
|
777
828
|
* Keeps track of the current owner.
|
778
829
|
*
|
@@ -796,8 +847,8 @@
|
|
796
847
|
__source: true
|
797
848
|
};
|
798
849
|
|
799
|
-
var specialPropKeyWarningShown;
|
800
|
-
var specialPropRefWarningShown;
|
850
|
+
var specialPropKeyWarningShown = void 0;
|
851
|
+
var specialPropRefWarningShown = void 0;
|
801
852
|
|
802
853
|
function hasValidRef(config) {
|
803
854
|
{
|
@@ -873,7 +924,7 @@
|
|
873
924
|
*/
|
874
925
|
var ReactElement = function (type, key, ref, self, source, owner, props) {
|
875
926
|
var element = {
|
876
|
-
// This tag
|
927
|
+
// This tag allows us to uniquely identify this as a React Element
|
877
928
|
$$typeof: REACT_ELEMENT_TYPE,
|
878
929
|
|
879
930
|
// Built-in properties that belong on the element
|
@@ -932,7 +983,7 @@
|
|
932
983
|
* See https://reactjs.org/docs/react-api.html#createelement
|
933
984
|
*/
|
934
985
|
function createElement(type, config, children) {
|
935
|
-
var propName;
|
986
|
+
var propName = void 0;
|
936
987
|
|
937
988
|
// Reserved names are extracted
|
938
989
|
var props = {};
|
@@ -1020,7 +1071,9 @@
|
|
1020
1071
|
* See https://reactjs.org/docs/react-api.html#cloneelement
|
1021
1072
|
*/
|
1022
1073
|
function cloneElement(element, config, children) {
|
1023
|
-
|
1074
|
+
!!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;
|
1075
|
+
|
1076
|
+
var propName = void 0;
|
1024
1077
|
|
1025
1078
|
// Original props are copied
|
1026
1079
|
var props = _assign({}, element.props);
|
@@ -1049,7 +1102,7 @@
|
|
1049
1102
|
}
|
1050
1103
|
|
1051
1104
|
// Remaining properties override existing props
|
1052
|
-
var defaultProps;
|
1105
|
+
var defaultProps = void 0;
|
1053
1106
|
if (element.type && element.type.defaultProps) {
|
1054
1107
|
defaultProps = element.type.defaultProps;
|
1055
1108
|
}
|
@@ -1203,8 +1256,6 @@
|
|
1203
1256
|
case 'object':
|
1204
1257
|
switch (children.$$typeof) {
|
1205
1258
|
case REACT_ELEMENT_TYPE:
|
1206
|
-
case REACT_CALL_TYPE:
|
1207
|
-
case REACT_RETURN_TYPE:
|
1208
1259
|
case REACT_PORTAL_TYPE:
|
1209
1260
|
invokeCallback = true;
|
1210
1261
|
}
|
@@ -1219,8 +1270,8 @@
|
|
1219
1270
|
return 1;
|
1220
1271
|
}
|
1221
1272
|
|
1222
|
-
var child;
|
1223
|
-
var nextName;
|
1273
|
+
var child = void 0;
|
1274
|
+
var nextName = void 0;
|
1224
1275
|
var subtreeCount = 0; // Count of children found in the current subtree.
|
1225
1276
|
var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
1226
1277
|
|
@@ -1236,13 +1287,13 @@
|
|
1236
1287
|
{
|
1237
1288
|
// Warn about using Maps as children
|
1238
1289
|
if (iteratorFn === children.entries) {
|
1239
|
-
warning(
|
1290
|
+
!didWarnAboutMaps ? warning(false, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.%s', ReactDebugCurrentFrame.getStackAddendum()) : void 0;
|
1240
1291
|
didWarnAboutMaps = true;
|
1241
1292
|
}
|
1242
1293
|
}
|
1243
1294
|
|
1244
1295
|
var iterator = iteratorFn.call(children);
|
1245
|
-
var step;
|
1296
|
+
var step = void 0;
|
1246
1297
|
var ii = 0;
|
1247
1298
|
while (!(step = iterator.next()).done) {
|
1248
1299
|
child = step.value;
|
@@ -1429,18 +1480,85 @@
|
|
1429
1480
|
return children;
|
1430
1481
|
}
|
1431
1482
|
|
1483
|
+
function createContext(defaultValue, calculateChangedBits) {
|
1484
|
+
if (calculateChangedBits === undefined) {
|
1485
|
+
calculateChangedBits = null;
|
1486
|
+
} else {
|
1487
|
+
{
|
1488
|
+
!(calculateChangedBits === null || typeof calculateChangedBits === 'function') ? warning(false, 'createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits) : void 0;
|
1489
|
+
}
|
1490
|
+
}
|
1491
|
+
|
1492
|
+
var context = {
|
1493
|
+
$$typeof: REACT_CONTEXT_TYPE,
|
1494
|
+
_calculateChangedBits: calculateChangedBits,
|
1495
|
+
_defaultValue: defaultValue,
|
1496
|
+
_currentValue: defaultValue,
|
1497
|
+
_changedBits: 0,
|
1498
|
+
// These are circular
|
1499
|
+
Provider: null,
|
1500
|
+
Consumer: null
|
1501
|
+
};
|
1502
|
+
|
1503
|
+
context.Provider = {
|
1504
|
+
$$typeof: REACT_PROVIDER_TYPE,
|
1505
|
+
_context: context
|
1506
|
+
};
|
1507
|
+
context.Consumer = context;
|
1508
|
+
|
1509
|
+
{
|
1510
|
+
context._currentRenderer = null;
|
1511
|
+
}
|
1512
|
+
|
1513
|
+
return context;
|
1514
|
+
}
|
1515
|
+
|
1516
|
+
function forwardRef(render) {
|
1517
|
+
{
|
1518
|
+
!(typeof render === 'function') ? warning(false, 'forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render) : void 0;
|
1519
|
+
}
|
1520
|
+
|
1521
|
+
return {
|
1522
|
+
$$typeof: REACT_FORWARD_REF_TYPE,
|
1523
|
+
render: render
|
1524
|
+
};
|
1525
|
+
}
|
1526
|
+
|
1432
1527
|
var describeComponentFrame = function (name, source, ownerName) {
|
1433
1528
|
return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
|
1434
1529
|
};
|
1435
1530
|
|
1531
|
+
function isValidElementType(type) {
|
1532
|
+
return typeof type === 'string' || typeof type === 'function' ||
|
1533
|
+
// Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
1534
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_ASYNC_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE);
|
1535
|
+
}
|
1536
|
+
|
1436
1537
|
function getComponentName(fiber) {
|
1437
1538
|
var type = fiber.type;
|
1438
1539
|
|
1540
|
+
if (typeof type === 'function') {
|
1541
|
+
return type.displayName || type.name;
|
1542
|
+
}
|
1439
1543
|
if (typeof type === 'string') {
|
1440
1544
|
return type;
|
1441
1545
|
}
|
1442
|
-
|
1443
|
-
|
1546
|
+
switch (type) {
|
1547
|
+
case REACT_FRAGMENT_TYPE:
|
1548
|
+
return 'ReactFragment';
|
1549
|
+
case REACT_PORTAL_TYPE:
|
1550
|
+
return 'ReactPortal';
|
1551
|
+
case REACT_CALL_TYPE:
|
1552
|
+
return 'ReactCall';
|
1553
|
+
case REACT_RETURN_TYPE:
|
1554
|
+
return 'ReactReturn';
|
1555
|
+
}
|
1556
|
+
if (typeof type === 'object' && type !== null) {
|
1557
|
+
switch (type.$$typeof) {
|
1558
|
+
case REACT_FORWARD_REF_TYPE:
|
1559
|
+
var functionName = type.render.displayName || type.render.name || '';
|
1560
|
+
return functionName !== '' ? 'ForwardRef(' + functionName + ')' : 'ForwardRef';
|
1561
|
+
}
|
1444
1562
|
}
|
1445
1563
|
return null;
|
1446
1564
|
}
|
@@ -1452,12 +1570,18 @@
|
|
1452
1570
|
* that support it.
|
1453
1571
|
*/
|
1454
1572
|
|
1573
|
+
var currentlyValidatingElement = void 0;
|
1574
|
+
var propTypesMisspellWarningShown = void 0;
|
1575
|
+
|
1576
|
+
var getDisplayName = function () {};
|
1577
|
+
var getStackAddendum = function () {};
|
1578
|
+
|
1455
1579
|
{
|
1456
|
-
|
1580
|
+
currentlyValidatingElement = null;
|
1457
1581
|
|
1458
|
-
|
1582
|
+
propTypesMisspellWarningShown = false;
|
1459
1583
|
|
1460
|
-
|
1584
|
+
getDisplayName = function (element) {
|
1461
1585
|
if (element == null) {
|
1462
1586
|
return '#empty';
|
1463
1587
|
} else if (typeof element === 'string' || typeof element === 'number') {
|
@@ -1471,7 +1595,7 @@
|
|
1471
1595
|
}
|
1472
1596
|
};
|
1473
1597
|
|
1474
|
-
|
1598
|
+
getStackAddendum = function () {
|
1475
1599
|
var stack = '';
|
1476
1600
|
if (currentlyValidatingElement) {
|
1477
1601
|
var name = getDisplayName(currentlyValidatingElement);
|
@@ -1481,8 +1605,6 @@
|
|
1481
1605
|
stack += ReactDebugCurrentFrame.getStackAddendum() || '';
|
1482
1606
|
return stack;
|
1483
1607
|
};
|
1484
|
-
|
1485
|
-
var VALID_FRAGMENT_PROPS = new Map([['children', true], ['key', true]]);
|
1486
1608
|
}
|
1487
1609
|
|
1488
1610
|
function getDeclarationErrorAddendum() {
|
@@ -1595,7 +1717,7 @@
|
|
1595
1717
|
// but now we print a separate warning for them later.
|
1596
1718
|
if (iteratorFn !== node.entries) {
|
1597
1719
|
var iterator = iteratorFn.call(node);
|
1598
|
-
var step;
|
1720
|
+
var step = void 0;
|
1599
1721
|
while (!(step = iterator.next()).done) {
|
1600
1722
|
if (isValidElement(step.value)) {
|
1601
1723
|
validateExplicitKey(step.value, parentType);
|
@@ -1628,7 +1750,7 @@
|
|
1628
1750
|
warning(false, 'Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown');
|
1629
1751
|
}
|
1630
1752
|
if (typeof componentClass.getDefaultProps === 'function') {
|
1631
|
-
|
1753
|
+
!componentClass.getDefaultProps.isReactClassApproved ? warning(false, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
|
1632
1754
|
}
|
1633
1755
|
}
|
1634
1756
|
|
@@ -1639,31 +1761,12 @@
|
|
1639
1761
|
function validateFragmentProps(fragment) {
|
1640
1762
|
currentlyValidatingElement = fragment;
|
1641
1763
|
|
1642
|
-
var
|
1643
|
-
var
|
1644
|
-
|
1645
|
-
|
1646
|
-
|
1647
|
-
|
1648
|
-
var key = _step.value;
|
1649
|
-
|
1650
|
-
if (!VALID_FRAGMENT_PROPS.has(key)) {
|
1651
|
-
warning(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.%s', key, getStackAddendum());
|
1652
|
-
break;
|
1653
|
-
}
|
1654
|
-
}
|
1655
|
-
} catch (err) {
|
1656
|
-
_didIteratorError = true;
|
1657
|
-
_iteratorError = err;
|
1658
|
-
} finally {
|
1659
|
-
try {
|
1660
|
-
if (!_iteratorNormalCompletion && _iterator['return']) {
|
1661
|
-
_iterator['return']();
|
1662
|
-
}
|
1663
|
-
} finally {
|
1664
|
-
if (_didIteratorError) {
|
1665
|
-
throw _iteratorError;
|
1666
|
-
}
|
1764
|
+
var keys = Object.keys(fragment.props);
|
1765
|
+
for (var i = 0; i < keys.length; i++) {
|
1766
|
+
var key = keys[i];
|
1767
|
+
if (key !== 'children' && key !== 'key') {
|
1768
|
+
warning(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.%s', key, getStackAddendum());
|
1769
|
+
break;
|
1667
1770
|
}
|
1668
1771
|
}
|
1669
1772
|
|
@@ -1675,7 +1778,8 @@
|
|
1675
1778
|
}
|
1676
1779
|
|
1677
1780
|
function createElementWithValidation(type, props, children) {
|
1678
|
-
var validType =
|
1781
|
+
var validType = isValidElementType(type);
|
1782
|
+
|
1679
1783
|
// We warn in this case but don't throw. We expect the element creation to
|
1680
1784
|
// succeed and there will likely be errors in render.
|
1681
1785
|
if (!validType) {
|
@@ -1693,7 +1797,16 @@
|
|
1693
1797
|
|
1694
1798
|
info += getStackAddendum() || '';
|
1695
1799
|
|
1696
|
-
|
1800
|
+
var typeString = void 0;
|
1801
|
+
if (type === null) {
|
1802
|
+
typeString = 'null';
|
1803
|
+
} else if (Array.isArray(type)) {
|
1804
|
+
typeString = 'array';
|
1805
|
+
} else {
|
1806
|
+
typeString = typeof type;
|
1807
|
+
}
|
1808
|
+
|
1809
|
+
warning(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
|
1697
1810
|
}
|
1698
1811
|
|
1699
1812
|
var element = createElement.apply(this, arguments);
|
@@ -1715,7 +1828,7 @@
|
|
1715
1828
|
}
|
1716
1829
|
}
|
1717
1830
|
|
1718
|
-
if (
|
1831
|
+
if (type === REACT_FRAGMENT_TYPE) {
|
1719
1832
|
validateFragmentProps(element);
|
1720
1833
|
} else {
|
1721
1834
|
validatePropTypes(element);
|
@@ -1726,9 +1839,8 @@
|
|
1726
1839
|
|
1727
1840
|
function createFactoryWithValidation(type) {
|
1728
1841
|
var validatedFactory = createElementWithValidation.bind(null, type);
|
1729
|
-
// Legacy hook TODO: Warn if this is accessed
|
1730
1842
|
validatedFactory.type = type;
|
1731
|
-
|
1843
|
+
// Legacy hook: remove it
|
1732
1844
|
{
|
1733
1845
|
Object.defineProperty(validatedFactory, 'type', {
|
1734
1846
|
enumerable: false,
|
@@ -1763,11 +1875,16 @@
|
|
1763
1875
|
only: onlyChild
|
1764
1876
|
},
|
1765
1877
|
|
1878
|
+
createRef: createRef,
|
1766
1879
|
Component: Component,
|
1767
1880
|
PureComponent: PureComponent,
|
1768
|
-
|
1881
|
+
|
1882
|
+
createContext: createContext,
|
1883
|
+
forwardRef: forwardRef,
|
1769
1884
|
|
1770
1885
|
Fragment: REACT_FRAGMENT_TYPE,
|
1886
|
+
StrictMode: REACT_STRICT_MODE_TYPE,
|
1887
|
+
unstable_AsyncMode: REACT_ASYNC_MODE_TYPE,
|
1771
1888
|
|
1772
1889
|
createElement: createElementWithValidation,
|
1773
1890
|
cloneElement: cloneElementWithValidation,
|
@@ -1811,65 +1928,6 @@
|
|
1811
1928
|
|
1812
1929
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))
|
1813
1930
|
|
1814
|
-
/***/ }),
|
1815
|
-
/* 8 */
|
1816
|
-
/***/ (function(module, exports, __webpack_require__) {
|
1817
|
-
|
1818
|
-
/* WEBPACK VAR INJECTION */(function(process) {/**
|
1819
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
1820
|
-
*
|
1821
|
-
* This source code is licensed under the MIT license found in the
|
1822
|
-
* LICENSE file in the root directory of this source tree.
|
1823
|
-
*
|
1824
|
-
*/
|
1825
|
-
|
1826
|
-
'use strict';
|
1827
|
-
|
1828
|
-
/**
|
1829
|
-
* Use invariant() to assert state which your program assumes to be true.
|
1830
|
-
*
|
1831
|
-
* Provide sprintf-style format (only %s is supported) and arguments
|
1832
|
-
* to provide information about what broke and what you were
|
1833
|
-
* expecting.
|
1834
|
-
*
|
1835
|
-
* The invariant message will be stripped in production, but the invariant
|
1836
|
-
* will remain to ensure logic does not differ in production.
|
1837
|
-
*/
|
1838
|
-
|
1839
|
-
var validateFormat = function validateFormat(format) {};
|
1840
|
-
|
1841
|
-
if (process.env.NODE_ENV !== 'production') {
|
1842
|
-
validateFormat = function validateFormat(format) {
|
1843
|
-
if (format === undefined) {
|
1844
|
-
throw new Error('invariant requires an error message argument');
|
1845
|
-
}
|
1846
|
-
};
|
1847
|
-
}
|
1848
|
-
|
1849
|
-
function invariant(condition, format, a, b, c, d, e, f) {
|
1850
|
-
validateFormat(format);
|
1851
|
-
|
1852
|
-
if (!condition) {
|
1853
|
-
var error;
|
1854
|
-
if (format === undefined) {
|
1855
|
-
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
1856
|
-
} else {
|
1857
|
-
var args = [a, b, c, d, e, f];
|
1858
|
-
var argIndex = 0;
|
1859
|
-
error = new Error(format.replace(/%s/g, function () {
|
1860
|
-
return args[argIndex++];
|
1861
|
-
}));
|
1862
|
-
error.name = 'Invariant Violation';
|
1863
|
-
}
|
1864
|
-
|
1865
|
-
error.framesToPop = 1; // we don't care about invariant's own frame
|
1866
|
-
throw error;
|
1867
|
-
}
|
1868
|
-
}
|
1869
|
-
|
1870
|
-
module.exports = invariant;
|
1871
|
-
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))
|
1872
|
-
|
1873
1931
|
/***/ }),
|
1874
1932
|
/* 9 */
|
1875
1933
|
/***/ (function(module, exports, __webpack_require__) {
|
@@ -1884,7 +1942,7 @@
|
|
1884
1942
|
|
1885
1943
|
'use strict';
|
1886
1944
|
|
1887
|
-
var emptyFunction = __webpack_require__(
|
1945
|
+
var emptyFunction = __webpack_require__(7);
|
1888
1946
|
|
1889
1947
|
/**
|
1890
1948
|
* Similar to invariant but only logs a warning if the condition is not met.
|
@@ -1951,11 +2009,24 @@
|
|
1951
2009
|
|
1952
2010
|
'use strict';
|
1953
2011
|
|
2012
|
+
var printWarning = function() {};
|
2013
|
+
|
1954
2014
|
if (process.env.NODE_ENV !== 'production') {
|
1955
|
-
var invariant = __webpack_require__(8);
|
1956
|
-
var warning = __webpack_require__(9);
|
1957
2015
|
var ReactPropTypesSecret = __webpack_require__(11);
|
1958
2016
|
var loggedTypeFailures = {};
|
2017
|
+
|
2018
|
+
printWarning = function(text) {
|
2019
|
+
var message = 'Warning: ' + text;
|
2020
|
+
if (typeof console !== 'undefined') {
|
2021
|
+
console.error(message);
|
2022
|
+
}
|
2023
|
+
try {
|
2024
|
+
// --- Welcome to debugging React ---
|
2025
|
+
// This error was thrown as a convenience so that you can use this stack
|
2026
|
+
// to find the callsite that caused this warning to fire.
|
2027
|
+
throw new Error(message);
|
2028
|
+
} catch (x) {}
|
2029
|
+
};
|
1959
2030
|
}
|
1960
2031
|
|
1961
2032
|
/**
|
@@ -1980,12 +2051,29 @@
|
|
1980
2051
|
try {
|
1981
2052
|
// This is intentionally an invariant that gets caught. It's the same
|
1982
2053
|
// behavior as without this statement except with a better message.
|
1983
|
-
|
2054
|
+
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
2055
|
+
var err = Error(
|
2056
|
+
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
|
2057
|
+
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
|
2058
|
+
);
|
2059
|
+
err.name = 'Invariant Violation';
|
2060
|
+
throw err;
|
2061
|
+
}
|
1984
2062
|
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
1985
2063
|
} catch (ex) {
|
1986
2064
|
error = ex;
|
1987
2065
|
}
|
1988
|
-
|
2066
|
+
if (error && !(error instanceof Error)) {
|
2067
|
+
printWarning(
|
2068
|
+
(componentName || 'React class') + ': type specification of ' +
|
2069
|
+
location + ' `' + typeSpecName + '` is invalid; the type checker ' +
|
2070
|
+
'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
|
2071
|
+
'You may have forgotten to pass an argument to the type checker ' +
|
2072
|
+
'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
|
2073
|
+
'shape all require an argument).'
|
2074
|
+
)
|
2075
|
+
|
2076
|
+
}
|
1989
2077
|
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
1990
2078
|
// Only monitor this failure once because there tends to be a lot of the
|
1991
2079
|
// same error.
|
@@ -1993,7 +2081,9 @@
|
|
1993
2081
|
|
1994
2082
|
var stack = getStack ? getStack() : '';
|
1995
2083
|
|
1996
|
-
|
2084
|
+
printWarning(
|
2085
|
+
'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
|
2086
|
+
);
|
1997
2087
|
}
|
1998
2088
|
}
|
1999
2089
|
}
|
@@ -2032,9 +2122,7 @@
|
|
2032
2122
|
/* 18 */,
|
2033
2123
|
/* 19 */,
|
2034
2124
|
/* 20 */,
|
2035
|
-
/* 21
|
2036
|
-
/* 22 */,
|
2037
|
-
/* 23 */
|
2125
|
+
/* 21 */
|
2038
2126
|
/***/ (function(module, exports, __webpack_require__) {
|
2039
2127
|
|
2040
2128
|
/**
|
@@ -2048,7 +2136,7 @@
|
|
2048
2136
|
|
2049
2137
|
'use strict';
|
2050
2138
|
|
2051
|
-
var hyphenate = __webpack_require__(
|
2139
|
+
var hyphenate = __webpack_require__(22);
|
2052
2140
|
|
2053
2141
|
var msPattern = /^ms-/;
|
2054
2142
|
|
@@ -2075,7 +2163,7 @@
|
|
2075
2163
|
module.exports = hyphenateStyleName;
|
2076
2164
|
|
2077
2165
|
/***/ }),
|
2078
|
-
/*
|
2166
|
+
/* 22 */
|
2079
2167
|
/***/ (function(module, exports) {
|
2080
2168
|
|
2081
2169
|
'use strict';
|
@@ -2110,7 +2198,7 @@
|
|
2110
2198
|
module.exports = hyphenate;
|
2111
2199
|
|
2112
2200
|
/***/ }),
|
2113
|
-
/*
|
2201
|
+
/* 23 */
|
2114
2202
|
/***/ (function(module, exports, __webpack_require__) {
|
2115
2203
|
|
2116
2204
|
/**
|
@@ -2124,7 +2212,7 @@
|
|
2124
2212
|
|
2125
2213
|
'use strict';
|
2126
2214
|
|
2127
|
-
var camelize = __webpack_require__(
|
2215
|
+
var camelize = __webpack_require__(24);
|
2128
2216
|
|
2129
2217
|
var msPattern = /^-ms-/;
|
2130
2218
|
|
@@ -2152,7 +2240,7 @@
|
|
2152
2240
|
module.exports = camelizeStyleName;
|
2153
2241
|
|
2154
2242
|
/***/ }),
|
2155
|
-
/*
|
2243
|
+
/* 24 */
|
2156
2244
|
/***/ (function(module, exports) {
|
2157
2245
|
|
2158
2246
|
"use strict";
|
@@ -2186,7 +2274,7 @@
|
|
2186
2274
|
module.exports = camelize;
|
2187
2275
|
|
2188
2276
|
/***/ }),
|
2189
|
-
/*
|
2277
|
+
/* 25 */
|
2190
2278
|
/***/ (function(module, exports, __webpack_require__) {
|
2191
2279
|
|
2192
2280
|
/**
|
@@ -2200,7 +2288,7 @@
|
|
2200
2288
|
'use strict';
|
2201
2289
|
|
2202
2290
|
var React = __webpack_require__(1);
|
2203
|
-
var factory = __webpack_require__(
|
2291
|
+
var factory = __webpack_require__(26);
|
2204
2292
|
|
2205
2293
|
if (typeof React === 'undefined') {
|
2206
2294
|
throw Error(
|
@@ -2220,7 +2308,7 @@
|
|
2220
2308
|
|
2221
2309
|
|
2222
2310
|
/***/ }),
|
2223
|
-
/*
|
2311
|
+
/* 26 */
|
2224
2312
|
/***/ (function(module, exports, __webpack_require__) {
|
2225
2313
|
|
2226
2314
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
@@ -2235,8 +2323,8 @@
|
|
2235
2323
|
|
2236
2324
|
var _assign = __webpack_require__(4);
|
2237
2325
|
|
2238
|
-
var emptyObject = __webpack_require__(
|
2239
|
-
var _invariant = __webpack_require__(
|
2326
|
+
var emptyObject = __webpack_require__(6);
|
2327
|
+
var _invariant = __webpack_require__(5);
|
2240
2328
|
|
2241
2329
|
if (process.env.NODE_ENV !== 'production') {
|
2242
2330
|
var warning = __webpack_require__(9);
|
@@ -3153,7 +3241,7 @@
|
|
3153
3241
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))
|
3154
3242
|
|
3155
3243
|
/***/ }),
|
3156
|
-
/*
|
3244
|
+
/* 27 */
|
3157
3245
|
/***/ (function(module, exports, __webpack_require__) {
|
3158
3246
|
|
3159
3247
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
@@ -3178,17 +3266,17 @@
|
|
3178
3266
|
// By explicitly using `prop-types` you are opting into new development behavior.
|
3179
3267
|
// http://fb.me/prop-types-in-prod
|
3180
3268
|
var throwOnDirectAccess = true;
|
3181
|
-
module.exports = __webpack_require__(
|
3269
|
+
module.exports = __webpack_require__(28)(isValidElement, throwOnDirectAccess);
|
3182
3270
|
} else {
|
3183
3271
|
// By explicitly using `prop-types` you are opting into new production behavior.
|
3184
3272
|
// http://fb.me/prop-types-in-prod
|
3185
|
-
module.exports = __webpack_require__(
|
3273
|
+
module.exports = __webpack_require__(29)();
|
3186
3274
|
}
|
3187
3275
|
|
3188
3276
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))
|
3189
3277
|
|
3190
3278
|
/***/ }),
|
3191
|
-
/*
|
3279
|
+
/* 28 */
|
3192
3280
|
/***/ (function(module, exports, __webpack_require__) {
|
3193
3281
|
|
3194
3282
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
@@ -3200,14 +3288,32 @@
|
|
3200
3288
|
|
3201
3289
|
'use strict';
|
3202
3290
|
|
3203
|
-
var emptyFunction = __webpack_require__(6);
|
3204
|
-
var invariant = __webpack_require__(8);
|
3205
|
-
var warning = __webpack_require__(9);
|
3206
3291
|
var assign = __webpack_require__(4);
|
3207
3292
|
|
3208
3293
|
var ReactPropTypesSecret = __webpack_require__(11);
|
3209
3294
|
var checkPropTypes = __webpack_require__(10);
|
3210
3295
|
|
3296
|
+
var printWarning = function() {};
|
3297
|
+
|
3298
|
+
if (process.env.NODE_ENV !== 'production') {
|
3299
|
+
printWarning = function(text) {
|
3300
|
+
var message = 'Warning: ' + text;
|
3301
|
+
if (typeof console !== 'undefined') {
|
3302
|
+
console.error(message);
|
3303
|
+
}
|
3304
|
+
try {
|
3305
|
+
// --- Welcome to debugging React ---
|
3306
|
+
// This error was thrown as a convenience so that you can use this stack
|
3307
|
+
// to find the callsite that caused this warning to fire.
|
3308
|
+
throw new Error(message);
|
3309
|
+
} catch (x) {}
|
3310
|
+
};
|
3311
|
+
}
|
3312
|
+
|
3313
|
+
function emptyFunctionThatReturnsNull() {
|
3314
|
+
return null;
|
3315
|
+
}
|
3316
|
+
|
3211
3317
|
module.exports = function(isValidElement, throwOnDirectAccess) {
|
3212
3318
|
/* global Symbol */
|
3213
3319
|
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
@@ -3350,12 +3456,13 @@
|
|
3350
3456
|
if (secret !== ReactPropTypesSecret) {
|
3351
3457
|
if (throwOnDirectAccess) {
|
3352
3458
|
// New behavior only for users of `prop-types` package
|
3353
|
-
|
3354
|
-
false,
|
3459
|
+
var err = new Error(
|
3355
3460
|
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
3356
3461
|
'Use `PropTypes.checkPropTypes()` to call them. ' +
|
3357
3462
|
'Read more at http://fb.me/use-check-prop-types'
|
3358
3463
|
);
|
3464
|
+
err.name = 'Invariant Violation';
|
3465
|
+
throw err;
|
3359
3466
|
} else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
|
3360
3467
|
// Old behavior for people using React.PropTypes
|
3361
3468
|
var cacheKey = componentName + ':' + propName;
|
@@ -3364,15 +3471,12 @@
|
|
3364
3471
|
// Avoid spamming the console because they are often not actionable except for lib authors
|
3365
3472
|
manualPropTypeWarningCount < 3
|
3366
3473
|
) {
|
3367
|
-
|
3368
|
-
false,
|
3474
|
+
printWarning(
|
3369
3475
|
'You are manually calling a React.PropTypes validation ' +
|
3370
|
-
'function for the
|
3476
|
+
'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
|
3371
3477
|
'and will throw in the standalone `prop-types` package. ' +
|
3372
3478
|
'You may be seeing this warning due to a third-party PropTypes ' +
|
3373
|
-
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
|
3374
|
-
propFullName,
|
3375
|
-
componentName
|
3479
|
+
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
|
3376
3480
|
);
|
3377
3481
|
manualPropTypeCallCache[cacheKey] = true;
|
3378
3482
|
manualPropTypeWarningCount++;
|
@@ -3416,7 +3520,7 @@
|
|
3416
3520
|
}
|
3417
3521
|
|
3418
3522
|
function createAnyTypeChecker() {
|
3419
|
-
return createChainableTypeChecker(
|
3523
|
+
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
3420
3524
|
}
|
3421
3525
|
|
3422
3526
|
function createArrayOfTypeChecker(typeChecker) {
|
@@ -3466,8 +3570,8 @@
|
|
3466
3570
|
|
3467
3571
|
function createEnumTypeChecker(expectedValues) {
|
3468
3572
|
if (!Array.isArray(expectedValues)) {
|
3469
|
-
process.env.NODE_ENV !== 'production' ?
|
3470
|
-
return
|
3573
|
+
process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOf, expected an instance of array.') : void 0;
|
3574
|
+
return emptyFunctionThatReturnsNull;
|
3471
3575
|
}
|
3472
3576
|
|
3473
3577
|
function validate(props, propName, componentName, location, propFullName) {
|
@@ -3509,21 +3613,18 @@
|
|
3509
3613
|
|
3510
3614
|
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
3511
3615
|
if (!Array.isArray(arrayOfTypeCheckers)) {
|
3512
|
-
process.env.NODE_ENV !== 'production' ?
|
3513
|
-
return
|
3616
|
+
process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
|
3617
|
+
return emptyFunctionThatReturnsNull;
|
3514
3618
|
}
|
3515
3619
|
|
3516
3620
|
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
3517
3621
|
var checker = arrayOfTypeCheckers[i];
|
3518
3622
|
if (typeof checker !== 'function') {
|
3519
|
-
|
3520
|
-
false,
|
3623
|
+
printWarning(
|
3521
3624
|
'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
|
3522
|
-
'received
|
3523
|
-
getPostfixForTypeWarning(checker),
|
3524
|
-
i
|
3625
|
+
'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
|
3525
3626
|
);
|
3526
|
-
return
|
3627
|
+
return emptyFunctionThatReturnsNull;
|
3527
3628
|
}
|
3528
3629
|
}
|
3529
3630
|
|
@@ -3737,7 +3838,7 @@
|
|
3737
3838
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))
|
3738
3839
|
|
3739
3840
|
/***/ }),
|
3740
|
-
/*
|
3841
|
+
/* 29 */
|
3741
3842
|
/***/ (function(module, exports, __webpack_require__) {
|
3742
3843
|
|
3743
3844
|
/**
|
@@ -3749,22 +3850,23 @@
|
|
3749
3850
|
|
3750
3851
|
'use strict';
|
3751
3852
|
|
3752
|
-
var emptyFunction = __webpack_require__(6);
|
3753
|
-
var invariant = __webpack_require__(8);
|
3754
3853
|
var ReactPropTypesSecret = __webpack_require__(11);
|
3755
3854
|
|
3855
|
+
function emptyFunction() {}
|
3856
|
+
|
3756
3857
|
module.exports = function() {
|
3757
3858
|
function shim(props, propName, componentName, location, propFullName, secret) {
|
3758
3859
|
if (secret === ReactPropTypesSecret) {
|
3759
3860
|
// It is still safe when called from React.
|
3760
3861
|
return;
|
3761
3862
|
}
|
3762
|
-
|
3763
|
-
false,
|
3863
|
+
var err = new Error(
|
3764
3864
|
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
3765
3865
|
'Use PropTypes.checkPropTypes() to call them. ' +
|
3766
3866
|
'Read more at http://fb.me/use-check-prop-types'
|
3767
3867
|
);
|
3868
|
+
err.name = 'Invariant Violation';
|
3869
|
+
throw err;
|
3768
3870
|
};
|
3769
3871
|
shim.isRequired = shim;
|
3770
3872
|
function getShim() {
|
@@ -3801,24 +3903,24 @@
|
|
3801
3903
|
|
3802
3904
|
|
3803
3905
|
/***/ }),
|
3804
|
-
/*
|
3906
|
+
/* 30 */
|
3805
3907
|
/***/ (function(module, exports, __webpack_require__) {
|
3806
3908
|
|
3807
3909
|
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
|
3808
3910
|
|
3809
3911
|
if (process.env.NODE_ENV === 'production') {
|
3810
|
-
module.exports = __webpack_require__(
|
3912
|
+
module.exports = __webpack_require__(31);
|
3811
3913
|
} else {
|
3812
|
-
module.exports = __webpack_require__(
|
3914
|
+
module.exports = __webpack_require__(33);
|
3813
3915
|
}
|
3814
3916
|
|
3815
3917
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))
|
3816
3918
|
|
3817
3919
|
/***/ }),
|
3818
|
-
/*
|
3920
|
+
/* 31 */
|
3819
3921
|
/***/ (function(module, exports, __webpack_require__) {
|
3820
3922
|
|
3821
|
-
/** @license React v16.2
|
3923
|
+
/** @license React v16.3.2
|
3822
3924
|
* react-dom-server.browser.production.min.js
|
3823
3925
|
*
|
3824
3926
|
* Copyright (c) 2013-present, Facebook, Inc.
|
@@ -3827,43 +3929,42 @@
|
|
3827
3929
|
* LICENSE file in the root directory of this source tree.
|
3828
3930
|
*/
|
3829
3931
|
|
3830
|
-
'use strict';var
|
3831
|
-
function
|
3832
|
-
var
|
3833
|
-
|
3834
|
-
|
3835
|
-
|
3836
|
-
function
|
3837
|
-
|
3838
|
-
|
3839
|
-
b)}
|
3840
|
-
|
3841
|
-
|
3842
|
-
|
3843
|
-
|
3844
|
-
var
|
3845
|
-
function
|
3846
|
-
function
|
3847
|
-
|
3848
|
-
|
3849
|
-
|
3850
|
-
function
|
3851
|
-
|
3852
|
-
|
3853
|
-
|
3854
|
-
|
3855
|
-
|
3856
|
-
|
3857
|
-
|
3858
|
-
|
3859
|
-
|
3860
|
-
|
3861
|
-
|
3862
|
-
!1)).read(Infinity)},renderToStaticMarkup:function(a){return(new ya(a,!0)).read(Infinity)},renderToNodeStream:function(){w("207")},renderToStaticNodeStream:function(){w("208")},version:"16.2.0"},Aa=Object.freeze({default:za}),Z=Aa&&za||Aa;module.exports=Z["default"]?Z["default"]:Z;
|
3932
|
+
'use strict';var p=__webpack_require__(5),q=__webpack_require__(4),t=__webpack_require__(1),w=__webpack_require__(7),x=__webpack_require__(6),y=__webpack_require__(21),z=__webpack_require__(32);
|
3933
|
+
function A(a){for(var b=arguments.length-1,d="http://reactjs.org/docs/error-decoder.html?invariant\x3d"+a,c=0;c<b;c++)d+="\x26args[]\x3d"+encodeURIComponent(arguments[c+1]);p(!1,"Minified React error #"+a+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",d)}
|
3934
|
+
var C="function"===typeof Symbol&&Symbol["for"],aa=C?Symbol["for"]("react.call"):60104,ba=C?Symbol["for"]("react.return"):60105,ca=C?Symbol["for"]("react.portal"):60106,E=C?Symbol["for"]("react.fragment"):60107,da=C?Symbol["for"]("react.strict_mode"):60108,F=C?Symbol["for"]("react.provider"):60109,ea=C?Symbol["for"]("react.context"):60110,fa=C?Symbol["for"]("react.async_mode"):60111,ha=C?Symbol["for"]("react.forward_ref"):60112,ia=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,
|
3935
|
+
G={},H={};function ja(a){if(H.hasOwnProperty(a))return!0;if(G.hasOwnProperty(a))return!1;if(ia.test(a))return H[a]=!0;G[a]=!0;return!1}function ka(a,b,d,c){if(null!==d&&0===d.type)return!1;switch(typeof b){case "function":case "symbol":return!0;case "boolean":if(c)return!1;if(null!==d)return!d.acceptsBooleans;a=a.toLowerCase().slice(0,5);return"data-"!==a&&"aria-"!==a;default:return!1}}
|
3936
|
+
function la(a,b,d,c){if(null===b||"undefined"===typeof b||ka(a,b,d,c))return!0;if(null!==d)switch(d.type){case 3:return!b;case 4:return!1===b;case 5:return isNaN(b);case 6:return isNaN(b)||1>b}return!1}function I(a,b,d,c,k){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=c;this.attributeNamespace=k;this.mustUseProperty=d;this.propertyName=a;this.type=b}var J={};
|
3937
|
+
"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){J[a]=new I(a,0,!1,a,null)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];J[b]=new I(b,1,!1,a[1],null)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){J[a]=new I(a,2,!1,a.toLowerCase(),null)});
|
3938
|
+
["autoReverse","externalResourcesRequired","preserveAlpha"].forEach(function(a){J[a]=new I(a,2,!1,a,null)});"allowFullScreen async autoFocus autoPlay controls default defer disabled formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){J[a]=new I(a,3,!1,a.toLowerCase(),null)});["checked","multiple","muted","selected"].forEach(function(a){J[a]=new I(a,3,!0,a.toLowerCase(),null)});
|
3939
|
+
["capture","download"].forEach(function(a){J[a]=new I(a,4,!1,a.toLowerCase(),null)});["cols","rows","size","span"].forEach(function(a){J[a]=new I(a,6,!1,a.toLowerCase(),null)});["rowSpan","start"].forEach(function(a){J[a]=new I(a,5,!1,a.toLowerCase(),null)});var K=/[\-:]([a-z])/g;function L(a){return a[1].toUpperCase()}
|
3940
|
+
"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var b=a.replace(K,
|
3941
|
+
L);J[b]=new I(b,1,!1,a,null)});"xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var b=a.replace(K,L);J[b]=new I(b,1,!1,a,"http://www.w3.org/1999/xlink")});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(K,L);J[b]=new I(b,1,!1,a,"http://www.w3.org/XML/1998/namespace")});J.tabIndex=new I("tabIndex",1,!1,"tabindex",null);var ma=/["'&<>]/;
|
3942
|
+
function M(a){if("boolean"===typeof a||"number"===typeof a)return""+a;a=""+a;var b=ma.exec(a);if(b){var d="",c,k=0;for(c=b.index;c<a.length;c++){switch(a.charCodeAt(c)){case 34:b="\x26quot;";break;case 38:b="\x26amp;";break;case 39:b="\x26#x27;";break;case 60:b="\x26lt;";break;case 62:b="\x26gt;";break;default:continue}k!==c&&(d+=a.substring(k,c));k=c+1;d+=b}a=k!==c?d+a.substring(k,c):d}return a}var N={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};
|
3943
|
+
function O(a){switch(a){case "svg":return"http://www.w3.org/2000/svg";case "math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}
|
3944
|
+
var P={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},na=q({menuitem:!0},P),Q={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,
|
3945
|
+
fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},oa=["Webkit","ms","Moz","O"];Object.keys(Q).forEach(function(a){oa.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);Q[b]=Q[a]})});var R=t.Children.toArray,S=w.thatReturns("");w.thatReturns("");var pa={listing:!0,pre:!0,textarea:!0};
|
3946
|
+
function T(a){return"string"===typeof a?a:"function"===typeof a?a.displayName||a.name:null}var qa=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,U={},ra=z(function(a){return y(a)});function sa(a){var b="";t.Children.forEach(a,function(a){null==a||"string"!==typeof a&&"number"!==typeof a||(b+=a)});return b}function ta(a,b){if(a=a.contextTypes){var d={},c;for(c in a)d[c]=b[c];b=d}else b=x;return b}var ua={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null,suppressHydrationWarning:null};
|
3947
|
+
function V(a,b){void 0===a&&A("152",T(b)||"Component")}
|
3948
|
+
function va(a,b){function d(c,k){var d=ta(k,b),f=[],h=!1,g={isMounted:function(){return!1},enqueueForceUpdate:function(){if(null===f)return null},enqueueReplaceState:function(a,b){h=!0;f=[b]},enqueueSetState:function(a,b){if(null===f)return null;f.push(b)}},e=void 0;if(k.prototype&&k.prototype.isReactComponent){if(e=new k(c.props,d,g),"function"===typeof k.getDerivedStateFromProps){var v=k.getDerivedStateFromProps.call(null,c.props,e.state);null!=v&&(e.state=q({},e.state,v))}}else if(e=k(c.props,
|
3949
|
+
d,g),null==e||null==e.render){a=e;V(a,k);return}e.props=c.props;e.context=d;e.updater=g;g=e.state;void 0===g&&(e.state=g=null);if("function"===typeof e.UNSAFE_componentWillMount||"function"===typeof e.componentWillMount)if("function"===typeof e.componentWillMount&&"function"!==typeof k.getDerivedStateFromProps&&e.componentWillMount(),"function"===typeof e.UNSAFE_componentWillMount&&"function"!==typeof k.getDerivedStateFromProps&&e.UNSAFE_componentWillMount(),f.length){g=f;var u=h;f=null;h=!1;if(u&&
|
3950
|
+
1===g.length)e.state=g[0];else{v=u?g[0]:e.state;var m=!0;for(u=u?1:0;u<g.length;u++){var n=g[u];n="function"===typeof n?n.call(e,v,c.props,d):n;null!=n&&(m?(m=!1,v=q({},v,n)):q(v,n))}e.state=v}}else f=null;a=e.render();V(a,k);c=void 0;if("function"===typeof e.getChildContext&&(d=k.childContextTypes,"object"===typeof d)){c=e.getChildContext();for(var r in c)r in d?void 0:A("108",T(k)||"Unknown",r)}c&&(b=q({},b,c))}for(;t.isValidElement(a);){var c=a,k=c.type;if("function"!==typeof k)break;d(c,k)}return{child:a,
|
3951
|
+
context:b}}
|
3952
|
+
var W=function(){function a(b,d){if(!(this instanceof a))throw new TypeError("Cannot call a class as a function");t.isValidElement(b)?b.type!==E?b=[b]:(b=b.props.children,b=t.isValidElement(b)?[b]:R(b)):b=R(b);this.stack=[{type:null,domNamespace:N.html,children:b,childIndex:0,context:x,footer:""}];this.exhausted=!1;this.currentSelectValue=null;this.previousWasTextNode=!1;this.makeStaticMarkup=d;this.providerStack=[];this.providerIndex=-1}a.prototype.pushProvider=function(a){this.providerIndex+=1;
|
3953
|
+
this.providerStack[this.providerIndex]=a;a.type._context._currentValue=a.props.value};a.prototype.popProvider=function(a){this.providerStack[this.providerIndex]=null;--this.providerIndex;a=a.type._context;a._currentValue=0>this.providerIndex?a._defaultValue:this.providerStack[this.providerIndex].props.value};a.prototype.read=function(a){if(this.exhausted)return null;for(var b="";b.length<a;){if(0===this.stack.length){this.exhausted=!0;break}var c=this.stack[this.stack.length-1];if(c.childIndex>=c.children.length){var k=
|
3954
|
+
c.footer;b+=k;""!==k&&(this.previousWasTextNode=!1);this.stack.pop();"select"===c.type?this.currentSelectValue=null:null!=c.type&&null!=c.type.type&&c.type.type.$$typeof===F&&this.popProvider(c.type)}else k=c.children[c.childIndex++],b+=this.render(k,c.context,c.domNamespace)}return b};a.prototype.render=function(a,d,c){if("string"===typeof a||"number"===typeof a){c=""+a;if(""===c)return"";if(this.makeStaticMarkup)return M(c);if(this.previousWasTextNode)return"\x3c!-- --\x3e"+M(c);this.previousWasTextNode=
|
3955
|
+
!0;return M(c)}d=va(a,d);a=d.child;d=d.context;if(null===a||!1===a)return"";if(!t.isValidElement(a)){if(null!=a&&null!=a.$$typeof){var b=a.$$typeof;b===ca?A("257"):void 0;A("258",b.toString())}a=R(a);this.stack.push({type:null,domNamespace:c,children:a,childIndex:0,context:d,footer:""});return""}b=a.type;if("string"===typeof b)return this.renderDOM(a,d,c);switch(b){case da:case fa:case E:return a=R(a.props.children),this.stack.push({type:null,domNamespace:c,children:a,childIndex:0,context:d,footer:""}),
|
3956
|
+
"";case aa:case ba:A("259")}if("object"===typeof b&&null!==b)switch(b.$$typeof){case ha:return a=R(b.render(a.props,a.ref)),this.stack.push({type:null,domNamespace:c,children:a,childIndex:0,context:d,footer:""}),"";case F:return b=R(a.props.children),c={type:a,domNamespace:c,children:b,childIndex:0,context:d,footer:""},this.pushProvider(a),this.stack.push(c),"";case ea:return b=R(a.props.children(a.type._currentValue)),this.stack.push({type:a,domNamespace:c,children:b,childIndex:0,context:d,footer:""}),
|
3957
|
+
""}A("130",null==b?b:typeof b,"")};a.prototype.renderDOM=function(a,d,c){var b=a.type.toLowerCase();c===N.html&&O(b);U.hasOwnProperty(b)||(qa.test(b)?void 0:A("65",b),U[b]=!0);var f=a.props;if("input"===b)f=q({type:void 0},f,{defaultChecked:void 0,defaultValue:void 0,value:null!=f.value?f.value:f.defaultValue,checked:null!=f.checked?f.checked:f.defaultChecked});else if("textarea"===b){var h=f.value;if(null==h){h=f.defaultValue;var l=f.children;null!=l&&(null!=h?A("92"):void 0,Array.isArray(l)&&(1>=
|
3958
|
+
l.length?void 0:A("93"),l=l[0]),h=""+l);null==h&&(h="")}f=q({},f,{value:void 0,children:""+h})}else if("select"===b)this.currentSelectValue=null!=f.value?f.value:f.defaultValue,f=q({},f,{value:void 0});else if("option"===b){l=this.currentSelectValue;var D=sa(f.children);if(null!=l){var B=null!=f.value?f.value+"":D;h=!1;if(Array.isArray(l))for(var g=0;g<l.length;g++){if(""+l[g]===B){h=!0;break}}else h=""+l===B;f=q({selected:void 0,children:void 0},f,{selected:h,children:D})}}if(h=f)na[b]&&(null!=h.children||
|
3959
|
+
null!=h.dangerouslySetInnerHTML?A("137",b,S()):void 0),null!=h.dangerouslySetInnerHTML&&(null!=h.children?A("60"):void 0,"object"===typeof h.dangerouslySetInnerHTML&&"__html"in h.dangerouslySetInnerHTML?void 0:A("61")),null!=h.style&&"object"!==typeof h.style?A("62",S()):void 0;h=f;l=this.makeStaticMarkup;D=1===this.stack.length;B="\x3c"+a.type;for(r in h)if(h.hasOwnProperty(r)){var e=h[r];if(null!=e){if("style"===r){g=void 0;var v="",u="";for(g in e)if(e.hasOwnProperty(g)){var m=0===g.indexOf("--"),
|
3960
|
+
n=e[g];null!=n&&(v+=u+ra(g)+":",u=g,m=null==n||"boolean"===typeof n||""===n?"":m||"number"!==typeof n||0===n||Q.hasOwnProperty(u)&&Q[u]?(""+n).trim():n+"px",v+=m,u=";")}e=v||null}g=null;b:if(m=b,n=h,-1===m.indexOf("-"))m="string"===typeof n.is;else switch(m){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":m=!1;break b;default:m=!0}if(m)ua.hasOwnProperty(r)||(g=r,g=ja(g)&&null!=
|
3961
|
+
e?g+"\x3d"+('"'+M(e)+'"'):"");else{m=r;g=e;e=J.hasOwnProperty(m)?J[m]:null;if(n="style"!==m)n=null!==e?0===e.type:!(2<m.length)||"o"!==m[0]&&"O"!==m[0]||"n"!==m[1]&&"N"!==m[1]?!1:!0;n||la(m,g,e,!1)?g="":null!==e?(m=e.attributeName,e=e.type,g=3===e||4===e&&!0===g?m+'\x3d""':m+"\x3d"+('"'+M(g)+'"')):g=m+"\x3d"+('"'+M(g)+'"')}g&&(B+=" "+g)}}l||D&&(B+=' data-reactroot\x3d""');var r=B;h="";P.hasOwnProperty(b)?r+="/\x3e":(r+="\x3e",h="\x3c/"+a.type+"\x3e");a:{l=f.dangerouslySetInnerHTML;if(null!=l){if(null!=
|
3962
|
+
l.__html){l=l.__html;break a}}else if(l=f.children,"string"===typeof l||"number"===typeof l){l=M(l);break a}l=null}null!=l?(f=[],pa[b]&&"\n"===l.charAt(0)&&(r+="\n"),r+=l):f=R(f.children);a=a.type;c=null==c||"http://www.w3.org/1999/xhtml"===c?O(a):"http://www.w3.org/2000/svg"===c&&"foreignObject"===a?"http://www.w3.org/1999/xhtml":c;this.stack.push({domNamespace:c,type:b,children:f,childIndex:0,context:d,footer:h});this.previousWasTextNode=!1;return r};return a}(),X={renderToString:function(a){return(new W(a,
|
3963
|
+
!1)).read(Infinity)},renderToStaticMarkup:function(a){return(new W(a,!0)).read(Infinity)},renderToNodeStream:function(){A("207")},renderToStaticNodeStream:function(){A("208")},version:"16.3.2"},Y=Object.freeze({default:X}),Z=Y&&X||Y;module.exports=Z["default"]?Z["default"]:Z;
|
3863
3964
|
|
3864
3965
|
|
3865
3966
|
/***/ }),
|
3866
|
-
/*
|
3967
|
+
/* 32 */
|
3867
3968
|
/***/ (function(module, exports) {
|
3868
3969
|
|
3869
3970
|
/**
|
@@ -3895,10 +3996,10 @@
|
|
3895
3996
|
module.exports = memoizeStringOnly;
|
3896
3997
|
|
3897
3998
|
/***/ }),
|
3898
|
-
/*
|
3999
|
+
/* 33 */
|
3899
4000
|
/***/ (function(module, exports, __webpack_require__) {
|
3900
4001
|
|
3901
|
-
/* WEBPACK VAR INJECTION */(function(process) {/** @license React v16.2
|
4002
|
+
/* WEBPACK VAR INJECTION */(function(process) {/** @license React v16.3.2
|
3902
4003
|
* react-dom-server.browser.development.js
|
3903
4004
|
*
|
3904
4005
|
* Copyright (c) 2013-present, Facebook, Inc.
|
@@ -3915,411 +4016,398 @@
|
|
3915
4016
|
(function() {
|
3916
4017
|
'use strict';
|
3917
4018
|
|
3918
|
-
var invariant = __webpack_require__(
|
4019
|
+
var invariant = __webpack_require__(5);
|
3919
4020
|
var _assign = __webpack_require__(4);
|
3920
4021
|
var React = __webpack_require__(1);
|
3921
|
-
var emptyFunction = __webpack_require__(
|
3922
|
-
var emptyObject = __webpack_require__(
|
3923
|
-
var hyphenateStyleName = __webpack_require__(
|
3924
|
-
var memoizeStringOnly = __webpack_require__(
|
4022
|
+
var emptyFunction = __webpack_require__(7);
|
4023
|
+
var emptyObject = __webpack_require__(6);
|
4024
|
+
var hyphenateStyleName = __webpack_require__(21);
|
4025
|
+
var memoizeStringOnly = __webpack_require__(32);
|
3925
4026
|
var warning = __webpack_require__(9);
|
3926
4027
|
var checkPropTypes = __webpack_require__(10);
|
3927
|
-
var camelizeStyleName = __webpack_require__(
|
4028
|
+
var camelizeStyleName = __webpack_require__(23);
|
4029
|
+
|
4030
|
+
// Relying on the `invariant()` implementation lets us
|
4031
|
+
// have preserve the format and params in the www builds.
|
4032
|
+
|
4033
|
+
// TODO: this is special because it gets imported during build.
|
4034
|
+
|
4035
|
+
var ReactVersion = '16.3.2';
|
3928
4036
|
|
3929
4037
|
/**
|
3930
|
-
*
|
3931
|
-
*
|
3932
|
-
*
|
3933
|
-
*
|
4038
|
+
* Forked from fbjs/warning:
|
4039
|
+
* https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
|
4040
|
+
*
|
4041
|
+
* Only change is we use console.warn instead of console.error,
|
4042
|
+
* and do nothing when 'console' is not supported.
|
4043
|
+
* This really simplifies the code.
|
4044
|
+
* ---
|
4045
|
+
* Similar to invariant but only logs a warning if the condition is not met.
|
4046
|
+
* This can be used to log issues in development environments in critical
|
4047
|
+
* paths. Removing the logging code for production environments will keep the
|
4048
|
+
* same logic and follow the same code paths.
|
3934
4049
|
*/
|
3935
4050
|
|
3936
|
-
|
3937
|
-
// case insensitive checks
|
3938
|
-
var RESERVED_PROPS = {
|
3939
|
-
children: true,
|
3940
|
-
dangerouslySetInnerHTML: true,
|
3941
|
-
defaultValue: true,
|
3942
|
-
defaultChecked: true,
|
3943
|
-
innerHTML: true,
|
3944
|
-
suppressContentEditableWarning: true,
|
3945
|
-
suppressHydrationWarning: true,
|
3946
|
-
style: true
|
3947
|
-
};
|
4051
|
+
var lowPriorityWarning = function () {};
|
3948
4052
|
|
3949
|
-
|
3950
|
-
|
4053
|
+
{
|
4054
|
+
var printWarning = function (format) {
|
4055
|
+
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
4056
|
+
args[_key - 1] = arguments[_key];
|
4057
|
+
}
|
4058
|
+
|
4059
|
+
var argIndex = 0;
|
4060
|
+
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
4061
|
+
return args[argIndex++];
|
4062
|
+
});
|
4063
|
+
if (typeof console !== 'undefined') {
|
4064
|
+
console.warn(message);
|
4065
|
+
}
|
4066
|
+
try {
|
4067
|
+
// --- Welcome to debugging React ---
|
4068
|
+
// This error was thrown as a convenience so that you can use this stack
|
4069
|
+
// to find the callsite that caused this warning to fire.
|
4070
|
+
throw new Error(message);
|
4071
|
+
} catch (x) {}
|
4072
|
+
};
|
4073
|
+
|
4074
|
+
lowPriorityWarning = function (condition, format) {
|
4075
|
+
if (format === undefined) {
|
4076
|
+
throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
|
4077
|
+
}
|
4078
|
+
if (!condition) {
|
4079
|
+
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
4080
|
+
args[_key2 - 2] = arguments[_key2];
|
4081
|
+
}
|
4082
|
+
|
4083
|
+
printWarning.apply(undefined, [format].concat(args));
|
4084
|
+
}
|
4085
|
+
};
|
3951
4086
|
}
|
3952
4087
|
|
3953
|
-
var
|
3954
|
-
/**
|
3955
|
-
* Mapping from normalized, camelcased property names to a configuration that
|
3956
|
-
* specifies how the associated DOM property should be accessed or rendered.
|
3957
|
-
*/
|
3958
|
-
MUST_USE_PROPERTY: 0x1,
|
3959
|
-
HAS_BOOLEAN_VALUE: 0x4,
|
3960
|
-
HAS_NUMERIC_VALUE: 0x8,
|
3961
|
-
HAS_POSITIVE_NUMERIC_VALUE: 0x10 | 0x8,
|
3962
|
-
HAS_OVERLOADED_BOOLEAN_VALUE: 0x20,
|
3963
|
-
HAS_STRING_BOOLEAN_VALUE: 0x40,
|
4088
|
+
var lowPriorityWarning$1 = lowPriorityWarning;
|
3964
4089
|
|
3965
|
-
|
3966
|
-
|
3967
|
-
|
3968
|
-
*
|
3969
|
-
* Properties: object mapping DOM property name to one of the
|
3970
|
-
* DOMPropertyInjection constants or null. If your attribute isn't in here,
|
3971
|
-
* it won't get written to the DOM.
|
3972
|
-
*
|
3973
|
-
* DOMAttributeNames: object mapping React attribute name to the DOM
|
3974
|
-
* attribute name. Attribute names not specified use the **lowercase**
|
3975
|
-
* normalized name.
|
3976
|
-
*
|
3977
|
-
* DOMAttributeNamespaces: object mapping React attribute name to the DOM
|
3978
|
-
* attribute namespace URL. (Attribute names not specified use no namespace.)
|
3979
|
-
*
|
3980
|
-
* DOMPropertyNames: similar to DOMAttributeNames but for DOM properties.
|
3981
|
-
* Property names not specified use the normalized name.
|
3982
|
-
*
|
3983
|
-
* DOMMutationMethods: Properties that require special mutation methods. If
|
3984
|
-
* `value` is undefined, the mutation method should unset the property.
|
3985
|
-
*
|
3986
|
-
* @param {object} domPropertyConfig the config as described above.
|
3987
|
-
*/
|
3988
|
-
injectDOMPropertyConfig: function (domPropertyConfig) {
|
3989
|
-
var Injection = DOMPropertyInjection;
|
3990
|
-
var Properties = domPropertyConfig.Properties || {};
|
3991
|
-
var DOMAttributeNamespaces = domPropertyConfig.DOMAttributeNamespaces || {};
|
3992
|
-
var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {};
|
3993
|
-
var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {};
|
3994
|
-
|
3995
|
-
for (var propName in Properties) {
|
3996
|
-
!!properties.hasOwnProperty(propName) ? invariant(false, "injectDOMPropertyConfig(...): You're trying to inject DOM property '%s' which has already been injected. You may be accidentally injecting the same DOM property config twice, or you may be injecting two configs that have conflicting property names.", propName) : void 0;
|
3997
|
-
|
3998
|
-
var lowerCased = propName.toLowerCase();
|
3999
|
-
var propConfig = Properties[propName];
|
4000
|
-
|
4001
|
-
var propertyInfo = {
|
4002
|
-
attributeName: lowerCased,
|
4003
|
-
attributeNamespace: null,
|
4004
|
-
propertyName: propName,
|
4005
|
-
mutationMethod: null,
|
4006
|
-
|
4007
|
-
mustUseProperty: checkMask(propConfig, Injection.MUST_USE_PROPERTY),
|
4008
|
-
hasBooleanValue: checkMask(propConfig, Injection.HAS_BOOLEAN_VALUE),
|
4009
|
-
hasNumericValue: checkMask(propConfig, Injection.HAS_NUMERIC_VALUE),
|
4010
|
-
hasPositiveNumericValue: checkMask(propConfig, Injection.HAS_POSITIVE_NUMERIC_VALUE),
|
4011
|
-
hasOverloadedBooleanValue: checkMask(propConfig, Injection.HAS_OVERLOADED_BOOLEAN_VALUE),
|
4012
|
-
hasStringBooleanValue: checkMask(propConfig, Injection.HAS_STRING_BOOLEAN_VALUE)
|
4013
|
-
};
|
4014
|
-
!(propertyInfo.hasBooleanValue + propertyInfo.hasNumericValue + propertyInfo.hasOverloadedBooleanValue <= 1) ? invariant(false, "DOMProperty: Value can be one of boolean, overloaded boolean, or numeric value, but not a combination: %s", propName) : void 0;
|
4090
|
+
var describeComponentFrame = function (name, source, ownerName) {
|
4091
|
+
return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
|
4092
|
+
};
|
4015
4093
|
|
4016
|
-
|
4017
|
-
var attributeName = DOMAttributeNames[propName];
|
4094
|
+
var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
4018
4095
|
|
4019
|
-
|
4020
|
-
|
4096
|
+
var ReactCurrentOwner = ReactInternals.ReactCurrentOwner;
|
4097
|
+
var ReactDebugCurrentFrame = ReactInternals.ReactDebugCurrentFrame;
|
4021
4098
|
|
4022
|
-
|
4023
|
-
propertyInfo.attributeNamespace = DOMAttributeNamespaces[propName];
|
4024
|
-
}
|
4099
|
+
// Exports ReactDOM.createRoot
|
4025
4100
|
|
4026
|
-
if (DOMMutationMethods.hasOwnProperty(propName)) {
|
4027
|
-
propertyInfo.mutationMethod = DOMMutationMethods[propName];
|
4028
|
-
}
|
4029
4101
|
|
4030
|
-
|
4031
|
-
|
4032
|
-
|
4033
|
-
|
4034
|
-
|
4035
|
-
|
4036
|
-
|
4037
|
-
|
4102
|
+
// Mutating mode (React DOM, React ART, React Native):
|
4103
|
+
|
4104
|
+
// Experimental noop mode (currently unused):
|
4105
|
+
|
4106
|
+
// Experimental persistent mode (Fabric):
|
4107
|
+
|
4108
|
+
// Experimental error-boundary API that can recover from errors within a single
|
4109
|
+
// render phase
|
4110
|
+
|
4111
|
+
// Helps identify side effects in begin-phase lifecycle hooks and setState reducers:
|
4112
|
+
|
4113
|
+
|
4114
|
+
// In some cases, StrictMode should also double-render lifecycles.
|
4115
|
+
// This can be confusing for tests though,
|
4116
|
+
// And it can be bad for performance in production.
|
4117
|
+
// This feature flag can be used to control the behavior:
|
4118
|
+
|
4119
|
+
|
4120
|
+
// To preserve the "Pause on caught exceptions" behavior of the debugger, we
|
4121
|
+
// replay the begin phase of a failed component inside invokeGuardedCallback.
|
4122
|
+
|
4123
|
+
|
4124
|
+
// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
|
4125
|
+
var warnAboutDeprecatedLifecycles = false;
|
4126
|
+
|
4127
|
+
|
4128
|
+
|
4129
|
+
// Only used in www builds.
|
4130
|
+
|
4131
|
+
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
4132
|
+
// nor polyfill, then a plain number is used for performance.
|
4133
|
+
var hasSymbol = typeof Symbol === 'function' && Symbol['for'];
|
4134
|
+
|
4135
|
+
|
4136
|
+
var REACT_CALL_TYPE = hasSymbol ? Symbol['for']('react.call') : 0xeac8;
|
4137
|
+
var REACT_RETURN_TYPE = hasSymbol ? Symbol['for']('react.return') : 0xeac9;
|
4138
|
+
var REACT_PORTAL_TYPE = hasSymbol ? Symbol['for']('react.portal') : 0xeaca;
|
4139
|
+
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol['for']('react.fragment') : 0xeacb;
|
4140
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol['for']('react.strict_mode') : 0xeacc;
|
4141
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol['for']('react.provider') : 0xeacd;
|
4142
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol['for']('react.context') : 0xeace;
|
4143
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol['for']('react.async_mode') : 0xeacf;
|
4144
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol['for']('react.forward_ref') : 0xead0;
|
4145
|
+
|
4146
|
+
// A reserved attribute.
|
4147
|
+
// It is handled by React separately and shouldn't be written to the DOM.
|
4148
|
+
var RESERVED = 0;
|
4149
|
+
|
4150
|
+
// A simple string attribute.
|
4151
|
+
// Attributes that aren't in the whitelist are presumed to have this type.
|
4152
|
+
var STRING = 1;
|
4153
|
+
|
4154
|
+
// A string attribute that accepts booleans in React. In HTML, these are called
|
4155
|
+
// "enumerated" attributes with "true" and "false" as possible values.
|
4156
|
+
// When true, it should be set to a "true" string.
|
4157
|
+
// When false, it should be set to a "false" string.
|
4158
|
+
var BOOLEANISH_STRING = 2;
|
4159
|
+
|
4160
|
+
// A real boolean attribute.
|
4161
|
+
// When true, it should be present (set either to an empty string or its name).
|
4162
|
+
// When false, it should be omitted.
|
4163
|
+
var BOOLEAN = 3;
|
4164
|
+
|
4165
|
+
// An attribute that can be used as a flag as well as with a value.
|
4166
|
+
// When true, it should be present (set either to an empty string or its name).
|
4167
|
+
// When false, it should be omitted.
|
4168
|
+
// For any other value, should be present with that value.
|
4169
|
+
var OVERLOADED_BOOLEAN = 4;
|
4170
|
+
|
4171
|
+
// An attribute that must be numeric or parse as a numeric.
|
4172
|
+
// When falsy, it should be removed.
|
4173
|
+
var NUMERIC = 5;
|
4174
|
+
|
4175
|
+
// An attribute that must be positive numeric or parse as a positive numeric.
|
4176
|
+
// When falsy, it should be removed.
|
4177
|
+
var POSITIVE_NUMERIC = 6;
|
4038
4178
|
|
4039
4179
|
/* eslint-disable max-len */
|
4040
|
-
var ATTRIBUTE_NAME_START_CHAR =
|
4180
|
+
var ATTRIBUTE_NAME_START_CHAR = ':A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD';
|
4041
4181
|
/* eslint-enable max-len */
|
4042
|
-
var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR +
|
4182
|
+
var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040';
|
4043
4183
|
|
4044
4184
|
|
4045
4185
|
var ROOT_ATTRIBUTE_NAME = 'data-reactroot';
|
4186
|
+
var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');
|
4046
4187
|
|
4047
|
-
|
4048
|
-
|
4049
|
-
* the property in the DOM. Each object contains:
|
4050
|
-
*
|
4051
|
-
* attributeName:
|
4052
|
-
* Used when rendering markup or with `*Attribute()`.
|
4053
|
-
* attributeNamespace
|
4054
|
-
* propertyName:
|
4055
|
-
* Used on DOM node instances. (This includes properties that mutate due to
|
4056
|
-
* external factors.)
|
4057
|
-
* mutationMethod:
|
4058
|
-
* If non-null, used instead of the property or `setAttribute()` after
|
4059
|
-
* initial render.
|
4060
|
-
* mustUseProperty:
|
4061
|
-
* Whether the property must be accessed and mutated as an object property.
|
4062
|
-
* hasBooleanValue:
|
4063
|
-
* Whether the property should be removed when set to a falsey value.
|
4064
|
-
* hasNumericValue:
|
4065
|
-
* Whether the property must be numeric or parse as a numeric and should be
|
4066
|
-
* removed when set to a falsey value.
|
4067
|
-
* hasPositiveNumericValue:
|
4068
|
-
* Whether the property must be positive numeric or parse as a positive
|
4069
|
-
* numeric and should be removed when set to a falsey value.
|
4070
|
-
* hasOverloadedBooleanValue:
|
4071
|
-
* Whether the property can be used as a flag as well as with a value.
|
4072
|
-
* Removed when strictly equal to false; present without a value when
|
4073
|
-
* strictly equal to true; present with a value otherwise.
|
4074
|
-
*/
|
4075
|
-
var properties = {};
|
4188
|
+
var illegalAttributeNameCache = {};
|
4189
|
+
var validatedAttributeNameCache = {};
|
4076
4190
|
|
4077
|
-
|
4078
|
-
|
4079
|
-
|
4080
|
-
|
4081
|
-
|
4082
|
-
if (isReservedProp(name)) {
|
4191
|
+
function isAttributeNameSafe(attributeName) {
|
4192
|
+
if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {
|
4193
|
+
return true;
|
4194
|
+
}
|
4195
|
+
if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {
|
4083
4196
|
return false;
|
4084
4197
|
}
|
4085
|
-
if (
|
4198
|
+
if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
|
4199
|
+
validatedAttributeNameCache[attributeName] = true;
|
4200
|
+
return true;
|
4201
|
+
}
|
4202
|
+
illegalAttributeNameCache[attributeName] = true;
|
4203
|
+
{
|
4204
|
+
warning(false, 'Invalid attribute name: `%s`', attributeName);
|
4205
|
+
}
|
4206
|
+
return false;
|
4207
|
+
}
|
4208
|
+
|
4209
|
+
function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {
|
4210
|
+
if (propertyInfo !== null) {
|
4211
|
+
return propertyInfo.type === RESERVED;
|
4212
|
+
}
|
4213
|
+
if (isCustomComponentTag) {
|
4086
4214
|
return false;
|
4087
4215
|
}
|
4088
|
-
if (
|
4216
|
+
if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {
|
4089
4217
|
return true;
|
4090
4218
|
}
|
4219
|
+
return false;
|
4220
|
+
}
|
4221
|
+
|
4222
|
+
function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {
|
4223
|
+
if (propertyInfo !== null && propertyInfo.type === RESERVED) {
|
4224
|
+
return false;
|
4225
|
+
}
|
4091
4226
|
switch (typeof value) {
|
4092
|
-
case '
|
4093
|
-
|
4094
|
-
case '
|
4095
|
-
|
4096
|
-
case 'string':
|
4097
|
-
case 'object':
|
4227
|
+
case 'function':
|
4228
|
+
// $FlowIssue symbol is perfectly valid here
|
4229
|
+
case 'symbol':
|
4230
|
+
// eslint-disable-line
|
4098
4231
|
return true;
|
4232
|
+
case 'boolean':
|
4233
|
+
{
|
4234
|
+
if (isCustomComponentTag) {
|
4235
|
+
return false;
|
4236
|
+
}
|
4237
|
+
if (propertyInfo !== null) {
|
4238
|
+
return !propertyInfo.acceptsBooleans;
|
4239
|
+
} else {
|
4240
|
+
var prefix = name.toLowerCase().slice(0, 5);
|
4241
|
+
return prefix !== 'data-' && prefix !== 'aria-';
|
4242
|
+
}
|
4243
|
+
}
|
4099
4244
|
default:
|
4100
|
-
// function, symbol
|
4101
4245
|
return false;
|
4102
4246
|
}
|
4103
4247
|
}
|
4104
4248
|
|
4105
|
-
function
|
4106
|
-
|
4107
|
-
}
|
4108
|
-
|
4109
|
-
function shouldAttributeAcceptBooleanValue(name) {
|
4110
|
-
if (isReservedProp(name)) {
|
4249
|
+
function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
|
4250
|
+
if (value === null || typeof value === 'undefined') {
|
4111
4251
|
return true;
|
4112
4252
|
}
|
4113
|
-
|
4114
|
-
|
4115
|
-
return propertyInfo.hasBooleanValue || propertyInfo.hasStringBooleanValue || propertyInfo.hasOverloadedBooleanValue;
|
4253
|
+
if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
|
4254
|
+
return true;
|
4116
4255
|
}
|
4117
|
-
|
4118
|
-
|
4119
|
-
|
4120
|
-
|
4121
|
-
|
4122
|
-
|
4123
|
-
|
4124
|
-
|
4125
|
-
|
4126
|
-
|
4127
|
-
* @param {string} name
|
4128
|
-
* @return {boolean} If the name is within reserved props
|
4129
|
-
*/
|
4130
|
-
function isReservedProp(name) {
|
4131
|
-
return RESERVED_PROPS.hasOwnProperty(name);
|
4132
|
-
}
|
4133
|
-
|
4134
|
-
var injection = DOMPropertyInjection;
|
4135
|
-
|
4136
|
-
var MUST_USE_PROPERTY = injection.MUST_USE_PROPERTY;
|
4137
|
-
var HAS_BOOLEAN_VALUE = injection.HAS_BOOLEAN_VALUE;
|
4138
|
-
var HAS_NUMERIC_VALUE = injection.HAS_NUMERIC_VALUE;
|
4139
|
-
var HAS_POSITIVE_NUMERIC_VALUE = injection.HAS_POSITIVE_NUMERIC_VALUE;
|
4140
|
-
var HAS_OVERLOADED_BOOLEAN_VALUE = injection.HAS_OVERLOADED_BOOLEAN_VALUE;
|
4141
|
-
var HAS_STRING_BOOLEAN_VALUE = injection.HAS_STRING_BOOLEAN_VALUE;
|
4142
|
-
|
4143
|
-
var HTMLDOMPropertyConfig = {
|
4144
|
-
// When adding attributes to this list, be sure to also add them to
|
4145
|
-
// the `possibleStandardNames` module to ensure casing and incorrect
|
4146
|
-
// name warnings.
|
4147
|
-
Properties: {
|
4148
|
-
allowFullScreen: HAS_BOOLEAN_VALUE,
|
4149
|
-
// specifies target context for links with `preload` type
|
4150
|
-
async: HAS_BOOLEAN_VALUE,
|
4151
|
-
// Note: there is a special case that prevents it from being written to the DOM
|
4152
|
-
// on the client side because the browsers are inconsistent. Instead we call focus().
|
4153
|
-
autoFocus: HAS_BOOLEAN_VALUE,
|
4154
|
-
autoPlay: HAS_BOOLEAN_VALUE,
|
4155
|
-
capture: HAS_OVERLOADED_BOOLEAN_VALUE,
|
4156
|
-
checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
|
4157
|
-
cols: HAS_POSITIVE_NUMERIC_VALUE,
|
4158
|
-
contentEditable: HAS_STRING_BOOLEAN_VALUE,
|
4159
|
-
controls: HAS_BOOLEAN_VALUE,
|
4160
|
-
'default': HAS_BOOLEAN_VALUE,
|
4161
|
-
defer: HAS_BOOLEAN_VALUE,
|
4162
|
-
disabled: HAS_BOOLEAN_VALUE,
|
4163
|
-
download: HAS_OVERLOADED_BOOLEAN_VALUE,
|
4164
|
-
draggable: HAS_STRING_BOOLEAN_VALUE,
|
4165
|
-
formNoValidate: HAS_BOOLEAN_VALUE,
|
4166
|
-
hidden: HAS_BOOLEAN_VALUE,
|
4167
|
-
loop: HAS_BOOLEAN_VALUE,
|
4168
|
-
// Caution; `option.selected` is not updated if `select.multiple` is
|
4169
|
-
// disabled with `removeAttribute`.
|
4170
|
-
multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
|
4171
|
-
muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
|
4172
|
-
noValidate: HAS_BOOLEAN_VALUE,
|
4173
|
-
open: HAS_BOOLEAN_VALUE,
|
4174
|
-
playsInline: HAS_BOOLEAN_VALUE,
|
4175
|
-
readOnly: HAS_BOOLEAN_VALUE,
|
4176
|
-
required: HAS_BOOLEAN_VALUE,
|
4177
|
-
reversed: HAS_BOOLEAN_VALUE,
|
4178
|
-
rows: HAS_POSITIVE_NUMERIC_VALUE,
|
4179
|
-
rowSpan: HAS_NUMERIC_VALUE,
|
4180
|
-
scoped: HAS_BOOLEAN_VALUE,
|
4181
|
-
seamless: HAS_BOOLEAN_VALUE,
|
4182
|
-
selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
|
4183
|
-
size: HAS_POSITIVE_NUMERIC_VALUE,
|
4184
|
-
start: HAS_NUMERIC_VALUE,
|
4185
|
-
// support for projecting regular DOM Elements via V1 named slots ( shadow dom )
|
4186
|
-
span: HAS_POSITIVE_NUMERIC_VALUE,
|
4187
|
-
spellCheck: HAS_STRING_BOOLEAN_VALUE,
|
4188
|
-
// Style must be explicitly set in the attribute list. React components
|
4189
|
-
// expect a style object
|
4190
|
-
style: 0,
|
4191
|
-
// Keep it in the whitelist because it is case-sensitive for SVG.
|
4192
|
-
tabIndex: 0,
|
4193
|
-
// itemScope is for for Microdata support.
|
4194
|
-
// See http://schema.org/docs/gs.html
|
4195
|
-
itemScope: HAS_BOOLEAN_VALUE,
|
4196
|
-
// These attributes must stay in the white-list because they have
|
4197
|
-
// different attribute names (see DOMAttributeNames below)
|
4198
|
-
acceptCharset: 0,
|
4199
|
-
className: 0,
|
4200
|
-
htmlFor: 0,
|
4201
|
-
httpEquiv: 0,
|
4202
|
-
// Attributes with mutation methods must be specified in the whitelist
|
4203
|
-
// Set the string boolean flag to allow the behavior
|
4204
|
-
value: HAS_STRING_BOOLEAN_VALUE
|
4205
|
-
},
|
4206
|
-
DOMAttributeNames: {
|
4207
|
-
acceptCharset: 'accept-charset',
|
4208
|
-
className: 'class',
|
4209
|
-
htmlFor: 'for',
|
4210
|
-
httpEquiv: 'http-equiv'
|
4211
|
-
},
|
4212
|
-
DOMMutationMethods: {
|
4213
|
-
value: function (node, value) {
|
4214
|
-
if (value == null) {
|
4215
|
-
return node.removeAttribute('value');
|
4216
|
-
}
|
4217
|
-
|
4218
|
-
// Number inputs get special treatment due to some edge cases in
|
4219
|
-
// Chrome. Let everything else assign the value attribute as normal.
|
4220
|
-
// https://github.com/facebook/react/issues/7253#issuecomment-236074326
|
4221
|
-
if (node.type !== 'number' || node.hasAttribute('value') === false) {
|
4222
|
-
node.setAttribute('value', '' + value);
|
4223
|
-
} else if (node.validity && !node.validity.badInput && node.ownerDocument.activeElement !== node) {
|
4224
|
-
// Don't assign an attribute if validation reports bad
|
4225
|
-
// input. Chrome will clear the value. Additionally, don't
|
4226
|
-
// operate on inputs that have focus, otherwise Chrome might
|
4227
|
-
// strip off trailing decimal places and cause the user's
|
4228
|
-
// cursor position to jump to the beginning of the input.
|
4229
|
-
//
|
4230
|
-
// In ReactDOMInput, we have an onBlur event that will trigger
|
4231
|
-
// this function again when focus is lost.
|
4232
|
-
node.setAttribute('value', '' + value);
|
4233
|
-
}
|
4256
|
+
if (propertyInfo !== null) {
|
4257
|
+
switch (propertyInfo.type) {
|
4258
|
+
case BOOLEAN:
|
4259
|
+
return !value;
|
4260
|
+
case OVERLOADED_BOOLEAN:
|
4261
|
+
return value === false;
|
4262
|
+
case NUMERIC:
|
4263
|
+
return isNaN(value);
|
4264
|
+
case POSITIVE_NUMERIC:
|
4265
|
+
return isNaN(value) || value < 1;
|
4234
4266
|
}
|
4235
4267
|
}
|
4236
|
-
|
4237
|
-
|
4238
|
-
var HAS_STRING_BOOLEAN_VALUE$1 = injection.HAS_STRING_BOOLEAN_VALUE;
|
4239
|
-
|
4268
|
+
return false;
|
4269
|
+
}
|
4240
4270
|
|
4241
|
-
|
4242
|
-
|
4243
|
-
|
4244
|
-
};
|
4271
|
+
function getPropertyInfo(name) {
|
4272
|
+
return properties.hasOwnProperty(name) ? properties[name] : null;
|
4273
|
+
}
|
4245
4274
|
|
4246
|
-
|
4247
|
-
|
4248
|
-
|
4249
|
-
|
4250
|
-
|
4251
|
-
|
4252
|
-
|
4253
|
-
|
4254
|
-
* SVG Attributes List:
|
4255
|
-
* https://www.w3.org/TR/SVG/attindex.html
|
4256
|
-
* SMIL Spec:
|
4257
|
-
* https://www.w3.org/TR/smil
|
4258
|
-
*/
|
4259
|
-
var ATTRS = ['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'x-height', 'xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type', 'xml:base', 'xmlns:xlink', 'xml:lang', 'xml:space'];
|
4275
|
+
function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace) {
|
4276
|
+
this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
|
4277
|
+
this.attributeName = attributeName;
|
4278
|
+
this.attributeNamespace = attributeNamespace;
|
4279
|
+
this.mustUseProperty = mustUseProperty;
|
4280
|
+
this.propertyName = name;
|
4281
|
+
this.type = type;
|
4282
|
+
}
|
4260
4283
|
|
4261
|
-
|
4262
|
-
|
4263
|
-
|
4264
|
-
|
4265
|
-
preserveAlpha: HAS_STRING_BOOLEAN_VALUE$1
|
4266
|
-
},
|
4267
|
-
DOMAttributeNames: {
|
4268
|
-
autoReverse: 'autoReverse',
|
4269
|
-
externalResourcesRequired: 'externalResourcesRequired',
|
4270
|
-
preserveAlpha: 'preserveAlpha'
|
4271
|
-
},
|
4272
|
-
DOMAttributeNamespaces: {
|
4273
|
-
xlinkActuate: NS.xlink,
|
4274
|
-
xlinkArcrole: NS.xlink,
|
4275
|
-
xlinkHref: NS.xlink,
|
4276
|
-
xlinkRole: NS.xlink,
|
4277
|
-
xlinkShow: NS.xlink,
|
4278
|
-
xlinkTitle: NS.xlink,
|
4279
|
-
xlinkType: NS.xlink,
|
4280
|
-
xmlBase: NS.xml,
|
4281
|
-
xmlLang: NS.xml,
|
4282
|
-
xmlSpace: NS.xml
|
4283
|
-
}
|
4284
|
-
};
|
4284
|
+
// When adding attributes to this list, be sure to also add them to
|
4285
|
+
// the `possibleStandardNames` module to ensure casing and incorrect
|
4286
|
+
// name warnings.
|
4287
|
+
var properties = {};
|
4285
4288
|
|
4286
|
-
|
4287
|
-
|
4288
|
-
|
4289
|
-
|
4289
|
+
// These props are reserved by React. They shouldn't be written to the DOM.
|
4290
|
+
['children', 'dangerouslySetInnerHTML',
|
4291
|
+
// TODO: This prevents the assignment of defaultValue to regular
|
4292
|
+
// elements (not just inputs). Now that ReactDOMInput assigns to the
|
4293
|
+
// defaultValue property -- do we need this?
|
4294
|
+
'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'].forEach(function (name) {
|
4295
|
+
properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty
|
4296
|
+
name, // attributeName
|
4297
|
+
null);
|
4298
|
+
});
|
4290
4299
|
|
4291
|
-
|
4292
|
-
|
4300
|
+
// A few React string attributes have a different name.
|
4301
|
+
// This is a mapping from React prop names to the attribute names.
|
4302
|
+
[['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {
|
4303
|
+
var name = _ref[0],
|
4304
|
+
attributeName = _ref[1];
|
4293
4305
|
|
4294
|
-
|
4295
|
-
|
4306
|
+
properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
|
4307
|
+
attributeName, // attributeName
|
4308
|
+
null);
|
4296
4309
|
});
|
4297
4310
|
|
4298
|
-
|
4299
|
-
|
4311
|
+
// These are "enumerated" HTML attributes that accept "true" and "false".
|
4312
|
+
// In React, we let users pass `true` and `false` even though technically
|
4313
|
+
// these aren't boolean attributes (they are coerced to strings).
|
4314
|
+
['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) {
|
4315
|
+
properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
|
4316
|
+
name.toLowerCase(), // attributeName
|
4317
|
+
null);
|
4318
|
+
});
|
4300
4319
|
|
4301
|
-
//
|
4320
|
+
// These are "enumerated" SVG attributes that accept "true" and "false".
|
4321
|
+
// In React, we let users pass `true` and `false` even though technically
|
4322
|
+
// these aren't boolean attributes (they are coerced to strings).
|
4323
|
+
// Since these are SVG attributes, their attribute names are case-sensitive.
|
4324
|
+
['autoReverse', 'externalResourcesRequired', 'preserveAlpha'].forEach(function (name) {
|
4325
|
+
properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
|
4326
|
+
name, // attributeName
|
4327
|
+
null);
|
4328
|
+
});
|
4302
4329
|
|
4303
|
-
|
4330
|
+
// These are HTML boolean attributes.
|
4331
|
+
['allowFullScreen', 'async',
|
4332
|
+
// Note: there is a special case that prevents it from being written to the DOM
|
4333
|
+
// on the client side because the browsers are inconsistent. Instead we call focus().
|
4334
|
+
'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless',
|
4335
|
+
// Microdata
|
4336
|
+
'itemScope'].forEach(function (name) {
|
4337
|
+
properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty
|
4338
|
+
name.toLowerCase(), // attributeName
|
4339
|
+
null);
|
4340
|
+
});
|
4304
4341
|
|
4305
|
-
|
4306
|
-
|
4307
|
-
|
4342
|
+
// These are the few React props that we set as DOM properties
|
4343
|
+
// rather than attributes. These are all booleans.
|
4344
|
+
['checked',
|
4345
|
+
// Note: `option.selected` is not updated if `select.multiple` is
|
4346
|
+
// disabled with `removeAttribute`. We have special logic for handling this.
|
4347
|
+
'multiple', 'muted', 'selected'].forEach(function (name) {
|
4348
|
+
properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty
|
4349
|
+
name.toLowerCase(), // attributeName
|
4350
|
+
null);
|
4351
|
+
});
|
4308
4352
|
|
4309
|
-
|
4353
|
+
// These are HTML attributes that are "overloaded booleans": they behave like
|
4354
|
+
// booleans, but can also accept a string value.
|
4355
|
+
['capture', 'download'].forEach(function (name) {
|
4356
|
+
properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty
|
4357
|
+
name.toLowerCase(), // attributeName
|
4358
|
+
null);
|
4359
|
+
});
|
4310
4360
|
|
4311
|
-
|
4312
|
-
|
4361
|
+
// These are HTML attributes that must be positive numbers.
|
4362
|
+
['cols', 'rows', 'size', 'span'].forEach(function (name) {
|
4363
|
+
properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty
|
4364
|
+
name.toLowerCase(), // attributeName
|
4365
|
+
null);
|
4366
|
+
});
|
4313
4367
|
|
4314
|
-
//
|
4315
|
-
|
4316
|
-
|
4368
|
+
// These are HTML attributes that must be numbers.
|
4369
|
+
['rowSpan', 'start'].forEach(function (name) {
|
4370
|
+
properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty
|
4371
|
+
name.toLowerCase(), // attributeName
|
4372
|
+
null);
|
4373
|
+
});
|
4317
4374
|
|
4375
|
+
var CAMELIZE = /[\-\:]([a-z])/g;
|
4376
|
+
var capitalize = function (token) {
|
4377
|
+
return token[1].toUpperCase();
|
4378
|
+
};
|
4318
4379
|
|
4380
|
+
// This is a list of all SVG attributes that need special casing, namespacing,
|
4381
|
+
// or boolean value assignment. Regular attributes that just accept strings
|
4382
|
+
// and have the same names are omitted, just like in the HTML whitelist.
|
4383
|
+
// Some of these attributes can be hard to find. This list was created by
|
4384
|
+
// scrapping the MDN documentation.
|
4385
|
+
['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height'].forEach(function (attributeName) {
|
4386
|
+
var name = attributeName.replace(CAMELIZE, capitalize);
|
4387
|
+
properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
|
4388
|
+
attributeName, null);
|
4389
|
+
});
|
4319
4390
|
|
4391
|
+
// String SVG attributes with the xlink namespace.
|
4392
|
+
['xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type'].forEach(function (attributeName) {
|
4393
|
+
var name = attributeName.replace(CAMELIZE, capitalize);
|
4394
|
+
properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
|
4395
|
+
attributeName, 'http://www.w3.org/1999/xlink');
|
4396
|
+
});
|
4320
4397
|
|
4398
|
+
// String SVG attributes with the xml namespace.
|
4399
|
+
['xml:base', 'xml:lang', 'xml:space'].forEach(function (attributeName) {
|
4400
|
+
var name = attributeName.replace(CAMELIZE, capitalize);
|
4401
|
+
properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
|
4402
|
+
attributeName, 'http://www.w3.org/XML/1998/namespace');
|
4403
|
+
});
|
4321
4404
|
|
4322
|
-
|
4405
|
+
// Special case: this attribute exists both in HTML and SVG.
|
4406
|
+
// Its "tabindex" attribute name is case-sensitive in SVG so we can't just use
|
4407
|
+
// its React `tabIndex` name, like we do for attributes that exist only in HTML.
|
4408
|
+
properties.tabIndex = new PropertyInfoRecord('tabIndex', STRING, false, // mustUseProperty
|
4409
|
+
'tabindex', // attributeName
|
4410
|
+
null);
|
4323
4411
|
|
4324
4412
|
// code copied and modified from escape-html
|
4325
4413
|
/**
|
@@ -4345,7 +4433,7 @@
|
|
4345
4433
|
return str;
|
4346
4434
|
}
|
4347
4435
|
|
4348
|
-
var escape;
|
4436
|
+
var escape = void 0;
|
4349
4437
|
var html = '';
|
4350
4438
|
var index = 0;
|
4351
4439
|
var lastIndex = 0;
|
@@ -4414,35 +4502,6 @@
|
|
4414
4502
|
return '"' + escapeTextForBrowser(value) + '"';
|
4415
4503
|
}
|
4416
4504
|
|
4417
|
-
// isAttributeNameSafe() is currently duplicated in DOMPropertyOperations.
|
4418
|
-
// TODO: Find a better place for this.
|
4419
|
-
var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');
|
4420
|
-
var illegalAttributeNameCache = {};
|
4421
|
-
var validatedAttributeNameCache = {};
|
4422
|
-
function isAttributeNameSafe(attributeName) {
|
4423
|
-
if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {
|
4424
|
-
return true;
|
4425
|
-
}
|
4426
|
-
if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {
|
4427
|
-
return false;
|
4428
|
-
}
|
4429
|
-
if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
|
4430
|
-
validatedAttributeNameCache[attributeName] = true;
|
4431
|
-
return true;
|
4432
|
-
}
|
4433
|
-
illegalAttributeNameCache[attributeName] = true;
|
4434
|
-
{
|
4435
|
-
warning(false, 'Invalid attribute name: `%s`', attributeName);
|
4436
|
-
}
|
4437
|
-
return false;
|
4438
|
-
}
|
4439
|
-
|
4440
|
-
// shouldIgnoreValue() is currently duplicated in DOMPropertyOperations.
|
4441
|
-
// TODO: Find a better place for this.
|
4442
|
-
function shouldIgnoreValue(propertyInfo, value) {
|
4443
|
-
return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false;
|
4444
|
-
}
|
4445
|
-
|
4446
4505
|
/**
|
4447
4506
|
* Operations for dealing with DOM properties.
|
4448
4507
|
*/
|
@@ -4468,23 +4527,24 @@
|
|
4468
4527
|
*/
|
4469
4528
|
function createMarkupForProperty(name, value) {
|
4470
4529
|
var propertyInfo = getPropertyInfo(name);
|
4471
|
-
if (propertyInfo) {
|
4472
|
-
|
4473
|
-
|
4474
|
-
|
4530
|
+
if (name !== 'style' && shouldIgnoreAttribute(name, propertyInfo, false)) {
|
4531
|
+
return '';
|
4532
|
+
}
|
4533
|
+
if (shouldRemoveAttribute(name, value, propertyInfo, false)) {
|
4534
|
+
return '';
|
4535
|
+
}
|
4536
|
+
if (propertyInfo !== null) {
|
4475
4537
|
var attributeName = propertyInfo.attributeName;
|
4476
|
-
|
4538
|
+
var type = propertyInfo.type;
|
4539
|
+
|
4540
|
+
if (type === BOOLEAN || type === OVERLOADED_BOOLEAN && value === true) {
|
4477
4541
|
return attributeName + '=""';
|
4478
|
-
} else
|
4542
|
+
} else {
|
4479
4543
|
return attributeName + '=' + quoteAttributeValueForBrowser(value);
|
4480
4544
|
}
|
4481
|
-
} else
|
4482
|
-
if (value == null) {
|
4483
|
-
return '';
|
4484
|
-
}
|
4545
|
+
} else {
|
4485
4546
|
return name + '=' + quoteAttributeValueForBrowser(value);
|
4486
4547
|
}
|
4487
|
-
return null;
|
4488
4548
|
}
|
4489
4549
|
|
4490
4550
|
/**
|
@@ -4618,7 +4678,7 @@
|
|
4618
4678
|
!(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML) ? invariant(false, '`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information.') : void 0;
|
4619
4679
|
}
|
4620
4680
|
{
|
4621
|
-
|
4681
|
+
!(props.suppressContentEditableWarning || !props.contentEditable || props.children == null) ? warning(false, 'A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.%s', getStack()) : void 0;
|
4622
4682
|
}
|
4623
4683
|
!(props.style == null || typeof props.style === 'object') ? invariant(false, 'The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + \'em\'}} when using JSX.%s', getStack()) : void 0;
|
4624
4684
|
}
|
@@ -5150,6 +5210,7 @@
|
|
5150
5210
|
multiple: 'multiple',
|
5151
5211
|
muted: 'muted',
|
5152
5212
|
name: 'name',
|
5213
|
+
nomodule: 'noModule',
|
5153
5214
|
nonce: 'nonce',
|
5154
5215
|
novalidate: 'noValidate',
|
5155
5216
|
open: 'open',
|
@@ -5542,16 +5603,18 @@
|
|
5542
5603
|
return stack != null ? stack : '';
|
5543
5604
|
}
|
5544
5605
|
|
5606
|
+
var validateProperty$1 = function () {};
|
5607
|
+
|
5545
5608
|
{
|
5546
5609
|
var warnedProperties$1 = {};
|
5547
|
-
var
|
5610
|
+
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
5548
5611
|
var EVENT_NAME_REGEX = /^on./;
|
5549
5612
|
var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;
|
5550
5613
|
var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
|
5551
5614
|
var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');
|
5552
5615
|
|
5553
|
-
|
5554
|
-
if (
|
5616
|
+
validateProperty$1 = function (tagName, name, value, canUseEventSystem) {
|
5617
|
+
if (_hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) {
|
5555
5618
|
return true;
|
5556
5619
|
}
|
5557
5620
|
|
@@ -5618,7 +5681,8 @@
|
|
5618
5681
|
return true;
|
5619
5682
|
}
|
5620
5683
|
|
5621
|
-
var
|
5684
|
+
var propertyInfo = getPropertyInfo(name);
|
5685
|
+
var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED;
|
5622
5686
|
|
5623
5687
|
// Known attributes should match the casing specified in the property config.
|
5624
5688
|
if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {
|
@@ -5636,7 +5700,7 @@
|
|
5636
5700
|
return true;
|
5637
5701
|
}
|
5638
5702
|
|
5639
|
-
if (typeof value === 'boolean' &&
|
5703
|
+
if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
|
5640
5704
|
if (value) {
|
5641
5705
|
warning(false, 'Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.%s', value, name, name, value, name, getStackAddendum$3());
|
5642
5706
|
} else {
|
@@ -5653,7 +5717,7 @@
|
|
5653
5717
|
}
|
5654
5718
|
|
5655
5719
|
// Warn when a known attribute is a bad type
|
5656
|
-
if (
|
5720
|
+
if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
|
5657
5721
|
warnedProperties$1[name] = true;
|
5658
5722
|
return false;
|
5659
5723
|
}
|
@@ -5694,16 +5758,25 @@
|
|
5694
5758
|
|
5695
5759
|
var toArray = React.Children.toArray;
|
5696
5760
|
|
5761
|
+
var currentDebugStack = void 0;
|
5762
|
+
var currentDebugElementStack = void 0;
|
5763
|
+
|
5697
5764
|
var getStackAddendum = emptyFunction.thatReturns('');
|
5765
|
+
var describeStackFrame = emptyFunction.thatReturns('');
|
5766
|
+
|
5767
|
+
var validatePropertiesInDevelopment = function (type, props) {};
|
5768
|
+
var setCurrentDebugStack = function (stack) {};
|
5769
|
+
var pushElementToDebugStack = function (element) {};
|
5770
|
+
var resetCurrentDebugStack = function () {};
|
5698
5771
|
|
5699
5772
|
{
|
5700
|
-
|
5773
|
+
validatePropertiesInDevelopment = function (type, props) {
|
5701
5774
|
validateProperties(type, props);
|
5702
5775
|
validateProperties$1(type, props);
|
5703
5776
|
validateProperties$2(type, props, /* canUseEventSystem */false);
|
5704
5777
|
};
|
5705
5778
|
|
5706
|
-
|
5779
|
+
describeStackFrame = function (element) {
|
5707
5780
|
var source = element._source;
|
5708
5781
|
var type = element.type;
|
5709
5782
|
var name = getComponentName(type);
|
@@ -5711,9 +5784,9 @@
|
|
5711
5784
|
return describeComponentFrame(name, source, ownerName);
|
5712
5785
|
};
|
5713
5786
|
|
5714
|
-
|
5715
|
-
|
5716
|
-
|
5787
|
+
currentDebugStack = null;
|
5788
|
+
currentDebugElementStack = null;
|
5789
|
+
setCurrentDebugStack = function (stack) {
|
5717
5790
|
var frame = stack[stack.length - 1];
|
5718
5791
|
currentDebugElementStack = frame.debugElementStack;
|
5719
5792
|
// We are about to enter a new composite stack, reset the array.
|
@@ -5721,12 +5794,12 @@
|
|
5721
5794
|
currentDebugStack = stack;
|
5722
5795
|
ReactDebugCurrentFrame.getCurrentStack = getStackAddendum;
|
5723
5796
|
};
|
5724
|
-
|
5797
|
+
pushElementToDebugStack = function (element) {
|
5725
5798
|
if (currentDebugElementStack !== null) {
|
5726
5799
|
currentDebugElementStack.push(element);
|
5727
5800
|
}
|
5728
5801
|
};
|
5729
|
-
|
5802
|
+
resetCurrentDebugStack = function () {
|
5730
5803
|
currentDebugElementStack = null;
|
5731
5804
|
currentDebugStack = null;
|
5732
5805
|
ReactDebugCurrentFrame.getCurrentStack = null;
|
@@ -5754,6 +5827,10 @@
|
|
5754
5827
|
var didWarnDefaultTextareaValue = false;
|
5755
5828
|
var didWarnInvalidOptionChildren = false;
|
5756
5829
|
var didWarnAboutNoopUpdateForComponent = {};
|
5830
|
+
var didWarnAboutBadClass = {};
|
5831
|
+
var didWarnAboutDeprecatedWillMount = {};
|
5832
|
+
var didWarnAboutUndefinedDerivedState = {};
|
5833
|
+
var didWarnAboutUninitializedState = {};
|
5757
5834
|
var valuePropNames = ['value', 'defaultValue'];
|
5758
5835
|
var newlineEatingTags = {
|
5759
5836
|
listing: true,
|
@@ -5807,8 +5884,8 @@
|
|
5807
5884
|
|
5808
5885
|
function warnNoop(publicInstance, callerName) {
|
5809
5886
|
{
|
5810
|
-
var
|
5811
|
-
var componentName =
|
5887
|
+
var _constructor = publicInstance.constructor;
|
5888
|
+
var componentName = _constructor && getComponentName(_constructor) || 'ReactClass';
|
5812
5889
|
var warningKey = componentName + '.' + callerName;
|
5813
5890
|
if (didWarnAboutNoopUpdateForComponent[warningKey]) {
|
5814
5891
|
return;
|
@@ -5905,7 +5982,7 @@
|
|
5905
5982
|
}
|
5906
5983
|
|
5907
5984
|
var STYLE = 'style';
|
5908
|
-
var RESERVED_PROPS
|
5985
|
+
var RESERVED_PROPS = {
|
5909
5986
|
children: null,
|
5910
5987
|
dangerouslySetInnerHTML: null,
|
5911
5988
|
suppressContentEditableWarning: null,
|
@@ -5928,7 +6005,7 @@
|
|
5928
6005
|
}
|
5929
6006
|
var markup = null;
|
5930
6007
|
if (isCustomComponent(tagLowercase, props)) {
|
5931
|
-
if (!RESERVED_PROPS
|
6008
|
+
if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
|
5932
6009
|
markup = createMarkupForCustomAttribute(propKey, propValue);
|
5933
6010
|
}
|
5934
6011
|
} else {
|
@@ -5961,15 +6038,20 @@
|
|
5961
6038
|
while (React.isValidElement(child)) {
|
5962
6039
|
// Safe because we just checked it's an element.
|
5963
6040
|
var element = child;
|
6041
|
+
var Component = element.type;
|
5964
6042
|
{
|
5965
6043
|
pushElementToDebugStack(element);
|
5966
6044
|
}
|
5967
|
-
var Component = element.type;
|
5968
6045
|
if (typeof Component !== 'function') {
|
5969
6046
|
break;
|
5970
6047
|
}
|
6048
|
+
processChild(element, Component);
|
6049
|
+
}
|
6050
|
+
|
6051
|
+
// Extra closure so queue and replace can be captured properly
|
6052
|
+
function processChild(element, Component) {
|
5971
6053
|
var publicContext = processContext(Component, context);
|
5972
|
-
|
6054
|
+
|
5973
6055
|
var queue = [];
|
5974
6056
|
var replace = false;
|
5975
6057
|
var updater = {
|
@@ -5986,23 +6068,62 @@
|
|
5986
6068
|
replace = true;
|
5987
6069
|
queue = [completeState];
|
5988
6070
|
},
|
5989
|
-
enqueueSetState: function (publicInstance,
|
6071
|
+
enqueueSetState: function (publicInstance, currentPartialState) {
|
5990
6072
|
if (queue === null) {
|
5991
6073
|
warnNoop(publicInstance, 'setState');
|
5992
6074
|
return null;
|
5993
6075
|
}
|
5994
|
-
queue.push(
|
6076
|
+
queue.push(currentPartialState);
|
5995
6077
|
}
|
5996
6078
|
};
|
5997
6079
|
|
6080
|
+
var inst = void 0;
|
5998
6081
|
if (shouldConstruct(Component)) {
|
5999
6082
|
inst = new Component(element.props, publicContext, updater);
|
6083
|
+
|
6084
|
+
if (typeof Component.getDerivedStateFromProps === 'function') {
|
6085
|
+
{
|
6086
|
+
if (inst.state === null || inst.state === undefined) {
|
6087
|
+
var componentName = getComponentName(Component) || 'Unknown';
|
6088
|
+
if (!didWarnAboutUninitializedState[componentName]) {
|
6089
|
+
warning(false, '%s: Did not properly initialize state during construction. ' + 'Expected state to be an object, but it was %s.', componentName, inst.state === null ? 'null' : 'undefined');
|
6090
|
+
didWarnAboutUninitializedState[componentName] = true;
|
6091
|
+
}
|
6092
|
+
}
|
6093
|
+
}
|
6094
|
+
|
6095
|
+
var partialState = Component.getDerivedStateFromProps.call(null, element.props, inst.state);
|
6096
|
+
|
6097
|
+
{
|
6098
|
+
if (partialState === undefined) {
|
6099
|
+
var _componentName = getComponentName(Component) || 'Unknown';
|
6100
|
+
if (!didWarnAboutUndefinedDerivedState[_componentName]) {
|
6101
|
+
warning(false, '%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', _componentName);
|
6102
|
+
didWarnAboutUndefinedDerivedState[_componentName] = true;
|
6103
|
+
}
|
6104
|
+
}
|
6105
|
+
}
|
6106
|
+
|
6107
|
+
if (partialState != null) {
|
6108
|
+
inst.state = _assign({}, inst.state, partialState);
|
6109
|
+
}
|
6110
|
+
}
|
6000
6111
|
} else {
|
6112
|
+
{
|
6113
|
+
if (Component.prototype && typeof Component.prototype.render === 'function') {
|
6114
|
+
var _componentName2 = getComponentName(Component) || 'Unknown';
|
6115
|
+
|
6116
|
+
if (!didWarnAboutBadClass[_componentName2]) {
|
6117
|
+
warning(false, "The <%s /> component appears to have a render method, but doesn't extend React.Component. " + 'This is likely to cause errors. Change %s to extend React.Component instead.', _componentName2, _componentName2);
|
6118
|
+
didWarnAboutBadClass[_componentName2] = true;
|
6119
|
+
}
|
6120
|
+
}
|
6121
|
+
}
|
6001
6122
|
inst = Component(element.props, publicContext, updater);
|
6002
6123
|
if (inst == null || inst.render == null) {
|
6003
6124
|
child = inst;
|
6004
6125
|
validateRenderResult(child, Component);
|
6005
|
-
|
6126
|
+
return;
|
6006
6127
|
}
|
6007
6128
|
}
|
6008
6129
|
|
@@ -6014,8 +6135,30 @@
|
|
6014
6135
|
if (initialState === undefined) {
|
6015
6136
|
inst.state = initialState = null;
|
6016
6137
|
}
|
6017
|
-
if (inst.componentWillMount) {
|
6018
|
-
inst.componentWillMount
|
6138
|
+
if (typeof inst.UNSAFE_componentWillMount === 'function' || typeof inst.componentWillMount === 'function') {
|
6139
|
+
if (typeof inst.componentWillMount === 'function') {
|
6140
|
+
{
|
6141
|
+
if (warnAboutDeprecatedLifecycles && inst.componentWillMount.__suppressDeprecationWarning !== true) {
|
6142
|
+
var _componentName3 = getComponentName(Component) || 'Unknown';
|
6143
|
+
|
6144
|
+
if (!didWarnAboutDeprecatedWillMount[_componentName3]) {
|
6145
|
+
lowPriorityWarning$1(false, '%s: componentWillMount() is deprecated and will be ' + 'removed in the next major version. Read about the motivations ' + 'behind this change: ' + 'https://fb.me/react-async-component-lifecycle-hooks' + '\n\n' + 'As a temporary workaround, you can rename to ' + 'UNSAFE_componentWillMount instead.', _componentName3);
|
6146
|
+
didWarnAboutDeprecatedWillMount[_componentName3] = true;
|
6147
|
+
}
|
6148
|
+
}
|
6149
|
+
}
|
6150
|
+
|
6151
|
+
// In order to support react-lifecycles-compat polyfilled components,
|
6152
|
+
// Unsafe lifecycles should not be invoked for any component with the new gDSFP.
|
6153
|
+
if (typeof Component.getDerivedStateFromProps !== 'function') {
|
6154
|
+
inst.componentWillMount();
|
6155
|
+
}
|
6156
|
+
}
|
6157
|
+
if (typeof inst.UNSAFE_componentWillMount === 'function' && typeof Component.getDerivedStateFromProps !== 'function') {
|
6158
|
+
// In order to support react-lifecycles-compat polyfilled components,
|
6159
|
+
// Unsafe lifecycles should not be invoked for any component with the new gDSFP.
|
6160
|
+
inst.UNSAFE_componentWillMount();
|
6161
|
+
}
|
6019
6162
|
if (queue.length) {
|
6020
6163
|
var oldQueue = queue;
|
6021
6164
|
var oldReplace = replace;
|
@@ -6029,13 +6172,13 @@
|
|
6029
6172
|
var dontMutate = true;
|
6030
6173
|
for (var i = oldReplace ? 1 : 0; i < oldQueue.length; i++) {
|
6031
6174
|
var partial = oldQueue[i];
|
6032
|
-
var
|
6033
|
-
if (
|
6175
|
+
var _partialState = typeof partial === 'function' ? partial.call(inst, nextState, element.props, publicContext) : partial;
|
6176
|
+
if (_partialState != null) {
|
6034
6177
|
if (dontMutate) {
|
6035
6178
|
dontMutate = false;
|
6036
|
-
nextState = _assign({}, nextState,
|
6179
|
+
nextState = _assign({}, nextState, _partialState);
|
6037
6180
|
} else {
|
6038
|
-
_assign(nextState,
|
6181
|
+
_assign(nextState, _partialState);
|
6039
6182
|
}
|
6040
6183
|
}
|
6041
6184
|
}
|
@@ -6056,7 +6199,7 @@
|
|
6056
6199
|
}
|
6057
6200
|
validateRenderResult(child, Component);
|
6058
6201
|
|
6059
|
-
var childContext;
|
6202
|
+
var childContext = void 0;
|
6060
6203
|
if (typeof inst.getChildContext === 'function') {
|
6061
6204
|
var childContextTypes = Component.childContextTypes;
|
6062
6205
|
if (typeof childContextTypes === 'object') {
|
@@ -6082,6 +6225,7 @@
|
|
6082
6225
|
var flatChildren = flattenTopLevelChildren(children);
|
6083
6226
|
|
6084
6227
|
var topFrame = {
|
6228
|
+
type: null,
|
6085
6229
|
// Assume all trees start in the HTML namespace (not totally true, but
|
6086
6230
|
// this is what we did historically)
|
6087
6231
|
domNamespace: Namespaces.html,
|
@@ -6098,10 +6242,37 @@
|
|
6098
6242
|
this.currentSelectValue = null;
|
6099
6243
|
this.previousWasTextNode = false;
|
6100
6244
|
this.makeStaticMarkup = makeStaticMarkup;
|
6245
|
+
|
6246
|
+
// Context (new API)
|
6247
|
+
this.providerStack = []; // Stack of provider objects
|
6248
|
+
this.providerIndex = -1;
|
6101
6249
|
}
|
6102
6250
|
// TODO: type this more strictly:
|
6103
6251
|
|
6104
6252
|
|
6253
|
+
ReactDOMServerRenderer.prototype.pushProvider = function pushProvider(provider) {
|
6254
|
+
this.providerIndex += 1;
|
6255
|
+
this.providerStack[this.providerIndex] = provider;
|
6256
|
+
var context = provider.type._context;
|
6257
|
+
context._currentValue = provider.props.value;
|
6258
|
+
};
|
6259
|
+
|
6260
|
+
ReactDOMServerRenderer.prototype.popProvider = function popProvider(provider) {
|
6261
|
+
{
|
6262
|
+
!(this.providerIndex > -1 && provider === this.providerStack[this.providerIndex]) ? warning(false, 'Unexpected pop.') : void 0;
|
6263
|
+
}
|
6264
|
+
this.providerStack[this.providerIndex] = null;
|
6265
|
+
this.providerIndex -= 1;
|
6266
|
+
var context = provider.type._context;
|
6267
|
+
if (this.providerIndex < 0) {
|
6268
|
+
context._currentValue = context._defaultValue;
|
6269
|
+
} else {
|
6270
|
+
// We assume this type is correct because of the index check above.
|
6271
|
+
var previousProvider = this.providerStack[this.providerIndex];
|
6272
|
+
context._currentValue = previousProvider.props.value;
|
6273
|
+
}
|
6274
|
+
};
|
6275
|
+
|
6105
6276
|
ReactDOMServerRenderer.prototype.read = function read(bytes) {
|
6106
6277
|
if (this.exhausted) {
|
6107
6278
|
return null;
|
@@ -6115,14 +6286,17 @@
|
|
6115
6286
|
}
|
6116
6287
|
var frame = this.stack[this.stack.length - 1];
|
6117
6288
|
if (frame.childIndex >= frame.children.length) {
|
6118
|
-
var
|
6119
|
-
out +=
|
6120
|
-
if (
|
6289
|
+
var _footer = frame.footer;
|
6290
|
+
out += _footer;
|
6291
|
+
if (_footer !== '') {
|
6121
6292
|
this.previousWasTextNode = false;
|
6122
6293
|
}
|
6123
6294
|
this.stack.pop();
|
6124
|
-
if (frame.
|
6295
|
+
if (frame.type === 'select') {
|
6125
6296
|
this.currentSelectValue = null;
|
6297
|
+
} else if (frame.type != null && frame.type.type != null && frame.type.type.$$typeof === REACT_PROVIDER_TYPE) {
|
6298
|
+
var provider = frame.type;
|
6299
|
+
this.popProvider(provider);
|
6126
6300
|
}
|
6127
6301
|
continue;
|
6128
6302
|
}
|
@@ -6154,7 +6328,7 @@
|
|
6154
6328
|
this.previousWasTextNode = true;
|
6155
6329
|
return escapeTextForBrowser(text);
|
6156
6330
|
} else {
|
6157
|
-
var nextChild;
|
6331
|
+
var nextChild = void 0;
|
6158
6332
|
|
6159
6333
|
var _resolve = resolve(child, context);
|
6160
6334
|
|
@@ -6164,8 +6338,16 @@
|
|
6164
6338
|
if (nextChild === null || nextChild === false) {
|
6165
6339
|
return '';
|
6166
6340
|
} else if (!React.isValidElement(nextChild)) {
|
6341
|
+
if (nextChild != null && nextChild.$$typeof != null) {
|
6342
|
+
// Catch unexpected special types early.
|
6343
|
+
var $$typeof = nextChild.$$typeof;
|
6344
|
+
!($$typeof !== REACT_PORTAL_TYPE) ? invariant(false, 'Portals are not currently supported by the server renderer. Render them conditionally so that they only appear on the client render.') : void 0;
|
6345
|
+
// Catch-all to prevent an infinite loop if React.Children.toArray() supports some new type.
|
6346
|
+
invariant(false, 'Unknown element-like object type: %s. This is likely a bug in React. Please file an issue.', $$typeof.toString());
|
6347
|
+
}
|
6167
6348
|
var nextChildren = toArray(nextChild);
|
6168
6349
|
var frame = {
|
6350
|
+
type: null,
|
6169
6351
|
domNamespace: parentNamespace,
|
6170
6352
|
children: nextChildren,
|
6171
6353
|
childIndex: 0,
|
@@ -6177,25 +6359,122 @@
|
|
6177
6359
|
}
|
6178
6360
|
this.stack.push(frame);
|
6179
6361
|
return '';
|
6180
|
-
}
|
6181
|
-
|
6182
|
-
|
6183
|
-
|
6184
|
-
|
6185
|
-
|
6186
|
-
context: context,
|
6187
|
-
footer: ''
|
6188
|
-
};
|
6189
|
-
{
|
6190
|
-
_frame.debugElementStack = [];
|
6191
|
-
}
|
6192
|
-
this.stack.push(_frame);
|
6193
|
-
return '';
|
6194
|
-
} else {
|
6195
|
-
// Safe because we just checked it's an element.
|
6196
|
-
var nextElement = nextChild;
|
6362
|
+
}
|
6363
|
+
// Safe because we just checked it's an element.
|
6364
|
+
var nextElement = nextChild;
|
6365
|
+
var elementType = nextElement.type;
|
6366
|
+
|
6367
|
+
if (typeof elementType === 'string') {
|
6197
6368
|
return this.renderDOM(nextElement, context, parentNamespace);
|
6198
6369
|
}
|
6370
|
+
|
6371
|
+
switch (elementType) {
|
6372
|
+
case REACT_STRICT_MODE_TYPE:
|
6373
|
+
case REACT_ASYNC_MODE_TYPE:
|
6374
|
+
case REACT_FRAGMENT_TYPE:
|
6375
|
+
{
|
6376
|
+
var _nextChildren = toArray(nextChild.props.children);
|
6377
|
+
var _frame = {
|
6378
|
+
type: null,
|
6379
|
+
domNamespace: parentNamespace,
|
6380
|
+
children: _nextChildren,
|
6381
|
+
childIndex: 0,
|
6382
|
+
context: context,
|
6383
|
+
footer: ''
|
6384
|
+
};
|
6385
|
+
{
|
6386
|
+
_frame.debugElementStack = [];
|
6387
|
+
}
|
6388
|
+
this.stack.push(_frame);
|
6389
|
+
return '';
|
6390
|
+
}
|
6391
|
+
case REACT_CALL_TYPE:
|
6392
|
+
case REACT_RETURN_TYPE:
|
6393
|
+
invariant(false, 'The experimental Call and Return types are not currently supported by the server renderer.');
|
6394
|
+
// eslint-disable-next-line-no-fallthrough
|
6395
|
+
default:
|
6396
|
+
break;
|
6397
|
+
}
|
6398
|
+
if (typeof elementType === 'object' && elementType !== null) {
|
6399
|
+
switch (elementType.$$typeof) {
|
6400
|
+
case REACT_FORWARD_REF_TYPE:
|
6401
|
+
{
|
6402
|
+
var element = nextChild;
|
6403
|
+
var _nextChildren2 = toArray(elementType.render(element.props, element.ref));
|
6404
|
+
var _frame2 = {
|
6405
|
+
type: null,
|
6406
|
+
domNamespace: parentNamespace,
|
6407
|
+
children: _nextChildren2,
|
6408
|
+
childIndex: 0,
|
6409
|
+
context: context,
|
6410
|
+
footer: ''
|
6411
|
+
};
|
6412
|
+
{
|
6413
|
+
_frame2.debugElementStack = [];
|
6414
|
+
}
|
6415
|
+
this.stack.push(_frame2);
|
6416
|
+
return '';
|
6417
|
+
}
|
6418
|
+
case REACT_PROVIDER_TYPE:
|
6419
|
+
{
|
6420
|
+
var provider = nextChild;
|
6421
|
+
var nextProps = provider.props;
|
6422
|
+
var _nextChildren3 = toArray(nextProps.children);
|
6423
|
+
var _frame3 = {
|
6424
|
+
type: provider,
|
6425
|
+
domNamespace: parentNamespace,
|
6426
|
+
children: _nextChildren3,
|
6427
|
+
childIndex: 0,
|
6428
|
+
context: context,
|
6429
|
+
footer: ''
|
6430
|
+
};
|
6431
|
+
{
|
6432
|
+
_frame3.debugElementStack = [];
|
6433
|
+
}
|
6434
|
+
|
6435
|
+
this.pushProvider(provider);
|
6436
|
+
|
6437
|
+
this.stack.push(_frame3);
|
6438
|
+
return '';
|
6439
|
+
}
|
6440
|
+
case REACT_CONTEXT_TYPE:
|
6441
|
+
{
|
6442
|
+
var consumer = nextChild;
|
6443
|
+
var _nextProps = consumer.props;
|
6444
|
+
var nextValue = consumer.type._currentValue;
|
6445
|
+
|
6446
|
+
var _nextChildren4 = toArray(_nextProps.children(nextValue));
|
6447
|
+
var _frame4 = {
|
6448
|
+
type: nextChild,
|
6449
|
+
domNamespace: parentNamespace,
|
6450
|
+
children: _nextChildren4,
|
6451
|
+
childIndex: 0,
|
6452
|
+
context: context,
|
6453
|
+
footer: ''
|
6454
|
+
};
|
6455
|
+
{
|
6456
|
+
_frame4.debugElementStack = [];
|
6457
|
+
}
|
6458
|
+
this.stack.push(_frame4);
|
6459
|
+
return '';
|
6460
|
+
}
|
6461
|
+
default:
|
6462
|
+
break;
|
6463
|
+
}
|
6464
|
+
}
|
6465
|
+
|
6466
|
+
var info = '';
|
6467
|
+
{
|
6468
|
+
var owner = nextElement._owner;
|
6469
|
+
if (elementType === undefined || typeof elementType === 'object' && elementType !== null && Object.keys(elementType).length === 0) {
|
6470
|
+
info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and " + 'named imports.';
|
6471
|
+
}
|
6472
|
+
var ownerName = owner ? getComponentName(owner) : null;
|
6473
|
+
if (ownerName) {
|
6474
|
+
info += '\n\nCheck the render method of `' + ownerName + '`.';
|
6475
|
+
}
|
6476
|
+
}
|
6477
|
+
invariant(false, 'Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s', elementType == null ? elementType : typeof elementType, info);
|
6199
6478
|
}
|
6200
6479
|
};
|
6201
6480
|
|
@@ -6211,7 +6490,7 @@
|
|
6211
6490
|
if (namespace === Namespaces.html) {
|
6212
6491
|
// Should this check be gated by parent namespace? Not sure we want to
|
6213
6492
|
// allow <SVG> or <mATH>.
|
6214
|
-
|
6493
|
+
!(tag === element.type) ? warning(false, '<%s /> is using incorrect casing. ' + 'Use PascalCase for React components, ' + 'or lowercase for HTML elements.', element.type) : void 0;
|
6215
6494
|
}
|
6216
6495
|
}
|
6217
6496
|
|
@@ -6307,7 +6586,7 @@
|
|
6307
6586
|
var selectValue = this.currentSelectValue;
|
6308
6587
|
var optionChildren = flattenOptionChildren(props.children);
|
6309
6588
|
if (selectValue != null) {
|
6310
|
-
var value;
|
6589
|
+
var value = void 0;
|
6311
6590
|
if (props.value != null) {
|
6312
6591
|
value = props.value + '';
|
6313
6592
|
} else {
|
@@ -6350,7 +6629,7 @@
|
|
6350
6629
|
out += '>';
|
6351
6630
|
footer = '</' + element.type + '>';
|
6352
6631
|
}
|
6353
|
-
var children;
|
6632
|
+
var children = void 0;
|
6354
6633
|
var innerMarkup = getNonChildrenInnerMarkup(props);
|
6355
6634
|
if (innerMarkup != null) {
|
6356
6635
|
children = [];
|
@@ -6373,7 +6652,7 @@
|
|
6373
6652
|
}
|
6374
6653
|
var frame = {
|
6375
6654
|
domNamespace: getChildNamespace(parentNamespace, element.type),
|
6376
|
-
|
6655
|
+
type: tag,
|
6377
6656
|
children: children,
|
6378
6657
|
childIndex: 0,
|
6379
6658
|
context: context,
|