@vidispine/vdt-react-timeline 22.3.0-pre.5 → 22.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +1418 -1174
- package/package.json +21 -21
package/dist/index.es.js
CHANGED
|
@@ -1,54 +1,15 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
|
-
import { useState, useRef,
|
|
3
|
+
import { useState, useRef, createContext, useMemo, useContext, useEffect, memo, Children, cloneElement } from 'react';
|
|
4
4
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
5
5
|
import clamp from 'lodash.clamp';
|
|
6
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
7
|
import { Stage, Layer, Rect, Group, Text, Line } from 'react-konva';
|
|
8
8
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
9
9
|
import sortBy from 'lodash.sortby';
|
|
10
10
|
import uniq from 'lodash.uniq';
|
|
11
11
|
|
|
12
|
-
function
|
|
13
|
-
var k, y, str='';
|
|
14
|
-
|
|
15
|
-
if (typeof mix === 'string' || typeof mix === 'number') {
|
|
16
|
-
str += mix;
|
|
17
|
-
} else if (typeof mix === 'object') {
|
|
18
|
-
if (Array.isArray(mix)) {
|
|
19
|
-
for (k=0; k < mix.length; k++) {
|
|
20
|
-
if (mix[k]) {
|
|
21
|
-
if (y = toVal(mix[k])) {
|
|
22
|
-
str && (str += ' ');
|
|
23
|
-
str += y;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
} else {
|
|
28
|
-
for (k in mix) {
|
|
29
|
-
if (mix[k]) {
|
|
30
|
-
str && (str += ' ');
|
|
31
|
-
str += k;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return str;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function clsx () {
|
|
41
|
-
var i=0, tmp, x, str='';
|
|
42
|
-
while (i < arguments.length) {
|
|
43
|
-
if (tmp = arguments[i++]) {
|
|
44
|
-
if (x = toVal(tmp)) {
|
|
45
|
-
str && (str += ' ');
|
|
46
|
-
str += x;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return str;
|
|
51
|
-
}
|
|
12
|
+
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
52
13
|
|
|
53
14
|
var propTypes = {exports: {}};
|
|
54
15
|
|
|
@@ -64,12 +25,20 @@ var reactIs_production_min = {};
|
|
|
64
25
|
* This source code is licensed under the MIT license found in the
|
|
65
26
|
* LICENSE file in the root directory of this source tree.
|
|
66
27
|
*/
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
28
|
+
|
|
29
|
+
var hasRequiredReactIs_production_min;
|
|
30
|
+
|
|
31
|
+
function requireReactIs_production_min () {
|
|
32
|
+
if (hasRequiredReactIs_production_min) return reactIs_production_min;
|
|
33
|
+
hasRequiredReactIs_production_min = 1;
|
|
34
|
+
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
|
|
35
|
+
Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
|
|
36
|
+
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k;reactIs_production_min.ContextProvider=h;reactIs_production_min.Element=c;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r;reactIs_production_min.Portal=d;
|
|
37
|
+
reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(a){return z(a)===k};reactIs_production_min.isContextProvider=function(a){return z(a)===h};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min.isForwardRef=function(a){return z(a)===n};reactIs_production_min.isFragment=function(a){return z(a)===e};reactIs_production_min.isLazy=function(a){return z(a)===t};
|
|
38
|
+
reactIs_production_min.isMemo=function(a){return z(a)===r};reactIs_production_min.isPortal=function(a){return z(a)===d};reactIs_production_min.isProfiler=function(a){return z(a)===g};reactIs_production_min.isStrictMode=function(a){return z(a)===f};reactIs_production_min.isSuspense=function(a){return z(a)===p};
|
|
39
|
+
reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min.typeOf=z;
|
|
40
|
+
return reactIs_production_min;
|
|
41
|
+
}
|
|
73
42
|
|
|
74
43
|
var reactIs_development = {};
|
|
75
44
|
|
|
@@ -82,180 +51,198 @@ var reactIs_development = {};
|
|
|
82
51
|
* LICENSE file in the root directory of this source tree.
|
|
83
52
|
*/
|
|
84
53
|
|
|
54
|
+
var hasRequiredReactIs_development;
|
|
55
|
+
|
|
56
|
+
function requireReactIs_development () {
|
|
57
|
+
if (hasRequiredReactIs_development) return reactIs_development;
|
|
58
|
+
hasRequiredReactIs_development = 1;
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
if (process.env.NODE_ENV !== "production") {
|
|
63
|
+
(function() {
|
|
64
|
+
|
|
65
|
+
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
66
|
+
// nor polyfill, then a plain number is used for performance.
|
|
67
|
+
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
68
|
+
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
69
|
+
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
70
|
+
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
71
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
72
|
+
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
73
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
74
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
75
|
+
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
76
|
+
|
|
77
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
78
|
+
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
79
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
80
|
+
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
81
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
82
|
+
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
83
|
+
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
84
|
+
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
|
|
85
|
+
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
86
|
+
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
|
87
|
+
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
88
|
+
|
|
89
|
+
function isValidElementType(type) {
|
|
90
|
+
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
91
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
92
|
+
}
|
|
85
93
|
|
|
94
|
+
function typeOf(object) {
|
|
95
|
+
if (typeof object === 'object' && object !== null) {
|
|
96
|
+
var $$typeof = object.$$typeof;
|
|
97
|
+
|
|
98
|
+
switch ($$typeof) {
|
|
99
|
+
case REACT_ELEMENT_TYPE:
|
|
100
|
+
var type = object.type;
|
|
101
|
+
|
|
102
|
+
switch (type) {
|
|
103
|
+
case REACT_ASYNC_MODE_TYPE:
|
|
104
|
+
case REACT_CONCURRENT_MODE_TYPE:
|
|
105
|
+
case REACT_FRAGMENT_TYPE:
|
|
106
|
+
case REACT_PROFILER_TYPE:
|
|
107
|
+
case REACT_STRICT_MODE_TYPE:
|
|
108
|
+
case REACT_SUSPENSE_TYPE:
|
|
109
|
+
return type;
|
|
110
|
+
|
|
111
|
+
default:
|
|
112
|
+
var $$typeofType = type && type.$$typeof;
|
|
113
|
+
|
|
114
|
+
switch ($$typeofType) {
|
|
115
|
+
case REACT_CONTEXT_TYPE:
|
|
116
|
+
case REACT_FORWARD_REF_TYPE:
|
|
117
|
+
case REACT_LAZY_TYPE:
|
|
118
|
+
case REACT_MEMO_TYPE:
|
|
119
|
+
case REACT_PROVIDER_TYPE:
|
|
120
|
+
return $$typeofType;
|
|
121
|
+
|
|
122
|
+
default:
|
|
123
|
+
return $$typeof;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
case REACT_PORTAL_TYPE:
|
|
129
|
+
return $$typeof;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return undefined;
|
|
134
|
+
} // AsyncMode is deprecated along with isAsyncMode
|
|
135
|
+
|
|
136
|
+
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
137
|
+
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
138
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
139
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
140
|
+
var Element = REACT_ELEMENT_TYPE;
|
|
141
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
142
|
+
var Fragment = REACT_FRAGMENT_TYPE;
|
|
143
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
144
|
+
var Memo = REACT_MEMO_TYPE;
|
|
145
|
+
var Portal = REACT_PORTAL_TYPE;
|
|
146
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
147
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
148
|
+
var Suspense = REACT_SUSPENSE_TYPE;
|
|
149
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
|
|
150
|
+
|
|
151
|
+
function isAsyncMode(object) {
|
|
152
|
+
{
|
|
153
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
154
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
155
|
+
|
|
156
|
+
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
161
|
+
}
|
|
162
|
+
function isConcurrentMode(object) {
|
|
163
|
+
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
164
|
+
}
|
|
165
|
+
function isContextConsumer(object) {
|
|
166
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
167
|
+
}
|
|
168
|
+
function isContextProvider(object) {
|
|
169
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
170
|
+
}
|
|
171
|
+
function isElement(object) {
|
|
172
|
+
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
173
|
+
}
|
|
174
|
+
function isForwardRef(object) {
|
|
175
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
176
|
+
}
|
|
177
|
+
function isFragment(object) {
|
|
178
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
179
|
+
}
|
|
180
|
+
function isLazy(object) {
|
|
181
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
182
|
+
}
|
|
183
|
+
function isMemo(object) {
|
|
184
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
185
|
+
}
|
|
186
|
+
function isPortal(object) {
|
|
187
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
188
|
+
}
|
|
189
|
+
function isProfiler(object) {
|
|
190
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
191
|
+
}
|
|
192
|
+
function isStrictMode(object) {
|
|
193
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
194
|
+
}
|
|
195
|
+
function isSuspense(object) {
|
|
196
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
197
|
+
}
|
|
86
198
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
199
|
+
reactIs_development.AsyncMode = AsyncMode;
|
|
200
|
+
reactIs_development.ConcurrentMode = ConcurrentMode;
|
|
201
|
+
reactIs_development.ContextConsumer = ContextConsumer;
|
|
202
|
+
reactIs_development.ContextProvider = ContextProvider;
|
|
203
|
+
reactIs_development.Element = Element;
|
|
204
|
+
reactIs_development.ForwardRef = ForwardRef;
|
|
205
|
+
reactIs_development.Fragment = Fragment;
|
|
206
|
+
reactIs_development.Lazy = Lazy;
|
|
207
|
+
reactIs_development.Memo = Memo;
|
|
208
|
+
reactIs_development.Portal = Portal;
|
|
209
|
+
reactIs_development.Profiler = Profiler;
|
|
210
|
+
reactIs_development.StrictMode = StrictMode;
|
|
211
|
+
reactIs_development.Suspense = Suspense;
|
|
212
|
+
reactIs_development.isAsyncMode = isAsyncMode;
|
|
213
|
+
reactIs_development.isConcurrentMode = isConcurrentMode;
|
|
214
|
+
reactIs_development.isContextConsumer = isContextConsumer;
|
|
215
|
+
reactIs_development.isContextProvider = isContextProvider;
|
|
216
|
+
reactIs_development.isElement = isElement;
|
|
217
|
+
reactIs_development.isForwardRef = isForwardRef;
|
|
218
|
+
reactIs_development.isFragment = isFragment;
|
|
219
|
+
reactIs_development.isLazy = isLazy;
|
|
220
|
+
reactIs_development.isMemo = isMemo;
|
|
221
|
+
reactIs_development.isPortal = isPortal;
|
|
222
|
+
reactIs_development.isProfiler = isProfiler;
|
|
223
|
+
reactIs_development.isStrictMode = isStrictMode;
|
|
224
|
+
reactIs_development.isSuspense = isSuspense;
|
|
225
|
+
reactIs_development.isValidElementType = isValidElementType;
|
|
226
|
+
reactIs_development.typeOf = typeOf;
|
|
227
|
+
})();
|
|
228
|
+
}
|
|
229
|
+
return reactIs_development;
|
|
117
230
|
}
|
|
118
231
|
|
|
119
|
-
|
|
120
|
-
if (typeof object === 'object' && object !== null) {
|
|
121
|
-
var $$typeof = object.$$typeof;
|
|
122
|
-
|
|
123
|
-
switch ($$typeof) {
|
|
124
|
-
case REACT_ELEMENT_TYPE:
|
|
125
|
-
var type = object.type;
|
|
126
|
-
|
|
127
|
-
switch (type) {
|
|
128
|
-
case REACT_ASYNC_MODE_TYPE:
|
|
129
|
-
case REACT_CONCURRENT_MODE_TYPE:
|
|
130
|
-
case REACT_FRAGMENT_TYPE:
|
|
131
|
-
case REACT_PROFILER_TYPE:
|
|
132
|
-
case REACT_STRICT_MODE_TYPE:
|
|
133
|
-
case REACT_SUSPENSE_TYPE:
|
|
134
|
-
return type;
|
|
135
|
-
|
|
136
|
-
default:
|
|
137
|
-
var $$typeofType = type && type.$$typeof;
|
|
138
|
-
|
|
139
|
-
switch ($$typeofType) {
|
|
140
|
-
case REACT_CONTEXT_TYPE:
|
|
141
|
-
case REACT_FORWARD_REF_TYPE:
|
|
142
|
-
case REACT_LAZY_TYPE:
|
|
143
|
-
case REACT_MEMO_TYPE:
|
|
144
|
-
case REACT_PROVIDER_TYPE:
|
|
145
|
-
return $$typeofType;
|
|
146
|
-
|
|
147
|
-
default:
|
|
148
|
-
return $$typeof;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
case REACT_PORTAL_TYPE:
|
|
154
|
-
return $$typeof;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
return undefined;
|
|
159
|
-
} // AsyncMode is deprecated along with isAsyncMode
|
|
160
|
-
|
|
161
|
-
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
162
|
-
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
163
|
-
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
164
|
-
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
165
|
-
var Element = REACT_ELEMENT_TYPE;
|
|
166
|
-
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
167
|
-
var Fragment = REACT_FRAGMENT_TYPE;
|
|
168
|
-
var Lazy = REACT_LAZY_TYPE;
|
|
169
|
-
var Memo = REACT_MEMO_TYPE;
|
|
170
|
-
var Portal = REACT_PORTAL_TYPE;
|
|
171
|
-
var Profiler = REACT_PROFILER_TYPE;
|
|
172
|
-
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
173
|
-
var Suspense = REACT_SUSPENSE_TYPE;
|
|
174
|
-
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
|
|
175
|
-
|
|
176
|
-
function isAsyncMode(object) {
|
|
177
|
-
{
|
|
178
|
-
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
179
|
-
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
180
|
-
|
|
181
|
-
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
186
|
-
}
|
|
187
|
-
function isConcurrentMode(object) {
|
|
188
|
-
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
189
|
-
}
|
|
190
|
-
function isContextConsumer(object) {
|
|
191
|
-
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
192
|
-
}
|
|
193
|
-
function isContextProvider(object) {
|
|
194
|
-
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
195
|
-
}
|
|
196
|
-
function isElement(object) {
|
|
197
|
-
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
198
|
-
}
|
|
199
|
-
function isForwardRef(object) {
|
|
200
|
-
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
201
|
-
}
|
|
202
|
-
function isFragment(object) {
|
|
203
|
-
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
204
|
-
}
|
|
205
|
-
function isLazy(object) {
|
|
206
|
-
return typeOf(object) === REACT_LAZY_TYPE;
|
|
207
|
-
}
|
|
208
|
-
function isMemo(object) {
|
|
209
|
-
return typeOf(object) === REACT_MEMO_TYPE;
|
|
210
|
-
}
|
|
211
|
-
function isPortal(object) {
|
|
212
|
-
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
213
|
-
}
|
|
214
|
-
function isProfiler(object) {
|
|
215
|
-
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
216
|
-
}
|
|
217
|
-
function isStrictMode(object) {
|
|
218
|
-
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
219
|
-
}
|
|
220
|
-
function isSuspense(object) {
|
|
221
|
-
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
222
|
-
}
|
|
232
|
+
var hasRequiredReactIs;
|
|
223
233
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
reactIs_development.Element = Element;
|
|
229
|
-
reactIs_development.ForwardRef = ForwardRef;
|
|
230
|
-
reactIs_development.Fragment = Fragment;
|
|
231
|
-
reactIs_development.Lazy = Lazy;
|
|
232
|
-
reactIs_development.Memo = Memo;
|
|
233
|
-
reactIs_development.Portal = Portal;
|
|
234
|
-
reactIs_development.Profiler = Profiler;
|
|
235
|
-
reactIs_development.StrictMode = StrictMode;
|
|
236
|
-
reactIs_development.Suspense = Suspense;
|
|
237
|
-
reactIs_development.isAsyncMode = isAsyncMode;
|
|
238
|
-
reactIs_development.isConcurrentMode = isConcurrentMode;
|
|
239
|
-
reactIs_development.isContextConsumer = isContextConsumer;
|
|
240
|
-
reactIs_development.isContextProvider = isContextProvider;
|
|
241
|
-
reactIs_development.isElement = isElement;
|
|
242
|
-
reactIs_development.isForwardRef = isForwardRef;
|
|
243
|
-
reactIs_development.isFragment = isFragment;
|
|
244
|
-
reactIs_development.isLazy = isLazy;
|
|
245
|
-
reactIs_development.isMemo = isMemo;
|
|
246
|
-
reactIs_development.isPortal = isPortal;
|
|
247
|
-
reactIs_development.isProfiler = isProfiler;
|
|
248
|
-
reactIs_development.isStrictMode = isStrictMode;
|
|
249
|
-
reactIs_development.isSuspense = isSuspense;
|
|
250
|
-
reactIs_development.isValidElementType = isValidElementType;
|
|
251
|
-
reactIs_development.typeOf = typeOf;
|
|
252
|
-
})();
|
|
253
|
-
}
|
|
234
|
+
function requireReactIs () {
|
|
235
|
+
if (hasRequiredReactIs) return reactIs.exports;
|
|
236
|
+
hasRequiredReactIs = 1;
|
|
237
|
+
(function (module) {
|
|
254
238
|
|
|
255
|
-
if (process.env.NODE_ENV === 'production') {
|
|
256
|
-
|
|
257
|
-
} else {
|
|
258
|
-
|
|
239
|
+
if (process.env.NODE_ENV === 'production') {
|
|
240
|
+
module.exports = requireReactIs_production_min();
|
|
241
|
+
} else {
|
|
242
|
+
module.exports = requireReactIs_development();
|
|
243
|
+
}
|
|
244
|
+
} (reactIs));
|
|
245
|
+
return reactIs.exports;
|
|
259
246
|
}
|
|
260
247
|
|
|
261
248
|
/*
|
|
@@ -263,89 +250,98 @@ object-assign
|
|
|
263
250
|
(c) Sindre Sorhus
|
|
264
251
|
@license MIT
|
|
265
252
|
*/
|
|
266
|
-
/* eslint-disable no-unused-vars */
|
|
267
|
-
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
268
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
269
|
-
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
270
|
-
|
|
271
|
-
function toObject(val) {
|
|
272
|
-
if (val === null || val === undefined) {
|
|
273
|
-
throw new TypeError('Object.assign cannot be called with null or undefined');
|
|
274
|
-
}
|
|
275
253
|
|
|
276
|
-
|
|
277
|
-
|
|
254
|
+
var objectAssign;
|
|
255
|
+
var hasRequiredObjectAssign;
|
|
278
256
|
|
|
279
|
-
function
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
257
|
+
function requireObjectAssign () {
|
|
258
|
+
if (hasRequiredObjectAssign) return objectAssign;
|
|
259
|
+
hasRequiredObjectAssign = 1;
|
|
260
|
+
/* eslint-disable no-unused-vars */
|
|
261
|
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
262
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
263
|
+
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
264
|
+
|
|
265
|
+
function toObject(val) {
|
|
266
|
+
if (val === null || val === undefined) {
|
|
267
|
+
throw new TypeError('Object.assign cannot be called with null or undefined');
|
|
283
268
|
}
|
|
284
269
|
|
|
285
|
-
|
|
270
|
+
return Object(val);
|
|
271
|
+
}
|
|
286
272
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
}
|
|
273
|
+
function shouldUseNative() {
|
|
274
|
+
try {
|
|
275
|
+
if (!Object.assign) {
|
|
276
|
+
return false;
|
|
277
|
+
}
|
|
293
278
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
279
|
+
// Detect buggy property enumeration order in older V8 versions.
|
|
280
|
+
|
|
281
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
|
282
|
+
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
|
283
|
+
test1[5] = 'de';
|
|
284
|
+
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
|
285
|
+
return false;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
289
|
+
var test2 = {};
|
|
290
|
+
for (var i = 0; i < 10; i++) {
|
|
291
|
+
test2['_' + String.fromCharCode(i)] = i;
|
|
292
|
+
}
|
|
293
|
+
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
|
294
|
+
return test2[n];
|
|
295
|
+
});
|
|
296
|
+
if (order2.join('') !== '0123456789') {
|
|
297
|
+
return false;
|
|
298
|
+
}
|
|
305
299
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
300
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
301
|
+
var test3 = {};
|
|
302
|
+
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
|
303
|
+
test3[letter] = letter;
|
|
304
|
+
});
|
|
305
|
+
if (Object.keys(Object.assign({}, test3)).join('') !==
|
|
306
|
+
'abcdefghijklmnopqrst') {
|
|
307
|
+
return false;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
return true;
|
|
311
|
+
} catch (err) {
|
|
312
|
+
// We don't expect any of the above to throw, but better to be safe.
|
|
313
313
|
return false;
|
|
314
314
|
}
|
|
315
|
-
|
|
316
|
-
return true;
|
|
317
|
-
} catch (err) {
|
|
318
|
-
// We don't expect any of the above to throw, but better to be safe.
|
|
319
|
-
return false;
|
|
320
315
|
}
|
|
321
|
-
}
|
|
322
316
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
317
|
+
objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
|
|
318
|
+
var from;
|
|
319
|
+
var to = toObject(target);
|
|
320
|
+
var symbols;
|
|
327
321
|
|
|
328
|
-
|
|
329
|
-
|
|
322
|
+
for (var s = 1; s < arguments.length; s++) {
|
|
323
|
+
from = Object(arguments[s]);
|
|
330
324
|
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
325
|
+
for (var key in from) {
|
|
326
|
+
if (hasOwnProperty.call(from, key)) {
|
|
327
|
+
to[key] = from[key];
|
|
328
|
+
}
|
|
334
329
|
}
|
|
335
|
-
}
|
|
336
330
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
331
|
+
if (getOwnPropertySymbols) {
|
|
332
|
+
symbols = getOwnPropertySymbols(from);
|
|
333
|
+
for (var i = 0; i < symbols.length; i++) {
|
|
334
|
+
if (propIsEnumerable.call(from, symbols[i])) {
|
|
335
|
+
to[symbols[i]] = from[symbols[i]];
|
|
336
|
+
}
|
|
342
337
|
}
|
|
343
338
|
}
|
|
344
339
|
}
|
|
345
|
-
}
|
|
346
340
|
|
|
347
|
-
|
|
348
|
-
};
|
|
341
|
+
return to;
|
|
342
|
+
};
|
|
343
|
+
return objectAssign;
|
|
344
|
+
}
|
|
349
345
|
|
|
350
346
|
/**
|
|
351
347
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
@@ -354,113 +350,139 @@ var objectAssign = shouldUseNative() ? Object.assign : function (target, source)
|
|
|
354
350
|
* LICENSE file in the root directory of this source tree.
|
|
355
351
|
*/
|
|
356
352
|
|
|
357
|
-
var
|
|
353
|
+
var ReactPropTypesSecret_1;
|
|
354
|
+
var hasRequiredReactPropTypesSecret;
|
|
358
355
|
|
|
359
|
-
|
|
356
|
+
function requireReactPropTypesSecret () {
|
|
357
|
+
if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
|
|
358
|
+
hasRequiredReactPropTypesSecret = 1;
|
|
360
359
|
|
|
361
|
-
var
|
|
360
|
+
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
362
361
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
* This source code is licensed under the MIT license found in the
|
|
367
|
-
* LICENSE file in the root directory of this source tree.
|
|
368
|
-
*/
|
|
362
|
+
ReactPropTypesSecret_1 = ReactPropTypesSecret;
|
|
363
|
+
return ReactPropTypesSecret_1;
|
|
364
|
+
}
|
|
369
365
|
|
|
370
|
-
var
|
|
366
|
+
var has;
|
|
367
|
+
var hasRequiredHas;
|
|
371
368
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
printWarning$1 = function(text) {
|
|
378
|
-
var message = 'Warning: ' + text;
|
|
379
|
-
if (typeof console !== 'undefined') {
|
|
380
|
-
console.error(message);
|
|
381
|
-
}
|
|
382
|
-
try {
|
|
383
|
-
// --- Welcome to debugging React ---
|
|
384
|
-
// This error was thrown as a convenience so that you can use this stack
|
|
385
|
-
// to find the callsite that caused this warning to fire.
|
|
386
|
-
throw new Error(message);
|
|
387
|
-
} catch (x) { /**/ }
|
|
388
|
-
};
|
|
369
|
+
function requireHas () {
|
|
370
|
+
if (hasRequiredHas) return has;
|
|
371
|
+
hasRequiredHas = 1;
|
|
372
|
+
has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
373
|
+
return has;
|
|
389
374
|
}
|
|
390
375
|
|
|
391
376
|
/**
|
|
392
|
-
*
|
|
393
|
-
* Error messages are memorized and will only be shown once.
|
|
377
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
394
378
|
*
|
|
395
|
-
*
|
|
396
|
-
*
|
|
397
|
-
* @param {string} location e.g. "prop", "context", "child context"
|
|
398
|
-
* @param {string} componentName Name of the component for error messages.
|
|
399
|
-
* @param {?Function} getStack Returns the component stack.
|
|
400
|
-
* @private
|
|
379
|
+
* This source code is licensed under the MIT license found in the
|
|
380
|
+
* LICENSE file in the root directory of this source tree.
|
|
401
381
|
*/
|
|
402
|
-
function checkPropTypes$1(typeSpecs, values, location, componentName, getStack) {
|
|
403
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
404
|
-
for (var typeSpecName in typeSpecs) {
|
|
405
|
-
if (has$1(typeSpecs, typeSpecName)) {
|
|
406
|
-
var error;
|
|
407
|
-
// Prop type validation may throw. In case they do, we don't want to
|
|
408
|
-
// fail the render phase where it didn't fail before. So we log it.
|
|
409
|
-
// After these have been cleaned up, we'll let them throw.
|
|
410
|
-
try {
|
|
411
|
-
// This is intentionally an invariant that gets caught. It's the same
|
|
412
|
-
// behavior as without this statement except with a better message.
|
|
413
|
-
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
414
|
-
var err = Error(
|
|
415
|
-
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
|
|
416
|
-
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
|
|
417
|
-
'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
|
|
418
|
-
);
|
|
419
|
-
err.name = 'Invariant Violation';
|
|
420
|
-
throw err;
|
|
421
|
-
}
|
|
422
|
-
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$2);
|
|
423
|
-
} catch (ex) {
|
|
424
|
-
error = ex;
|
|
425
|
-
}
|
|
426
|
-
if (error && !(error instanceof Error)) {
|
|
427
|
-
printWarning$1(
|
|
428
|
-
(componentName || 'React class') + ': type specification of ' +
|
|
429
|
-
location + ' `' + typeSpecName + '` is invalid; the type checker ' +
|
|
430
|
-
'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
|
|
431
|
-
'You may have forgotten to pass an argument to the type checker ' +
|
|
432
|
-
'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
|
|
433
|
-
'shape all require an argument).'
|
|
434
|
-
);
|
|
435
|
-
}
|
|
436
|
-
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
437
|
-
// Only monitor this failure once because there tends to be a lot of the
|
|
438
|
-
// same error.
|
|
439
|
-
loggedTypeFailures[error.message] = true;
|
|
440
|
-
|
|
441
|
-
var stack = getStack ? getStack() : '';
|
|
442
382
|
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
}
|
|
383
|
+
var checkPropTypes_1;
|
|
384
|
+
var hasRequiredCheckPropTypes;
|
|
385
|
+
|
|
386
|
+
function requireCheckPropTypes () {
|
|
387
|
+
if (hasRequiredCheckPropTypes) return checkPropTypes_1;
|
|
388
|
+
hasRequiredCheckPropTypes = 1;
|
|
389
|
+
|
|
390
|
+
var printWarning = function() {};
|
|
391
|
+
|
|
392
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
393
|
+
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
394
|
+
var loggedTypeFailures = {};
|
|
395
|
+
var has = requireHas();
|
|
396
|
+
|
|
397
|
+
printWarning = function(text) {
|
|
398
|
+
var message = 'Warning: ' + text;
|
|
399
|
+
if (typeof console !== 'undefined') {
|
|
400
|
+
console.error(message);
|
|
401
|
+
}
|
|
402
|
+
try {
|
|
403
|
+
// --- Welcome to debugging React ---
|
|
404
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
405
|
+
// to find the callsite that caused this warning to fire.
|
|
406
|
+
throw new Error(message);
|
|
407
|
+
} catch (x) { /**/ }
|
|
408
|
+
};
|
|
409
|
+
}
|
|
451
410
|
|
|
452
|
-
/**
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
411
|
+
/**
|
|
412
|
+
* Assert that the values match with the type specs.
|
|
413
|
+
* Error messages are memorized and will only be shown once.
|
|
414
|
+
*
|
|
415
|
+
* @param {object} typeSpecs Map of name to a ReactPropType
|
|
416
|
+
* @param {object} values Runtime values that need to be type-checked
|
|
417
|
+
* @param {string} location e.g. "prop", "context", "child context"
|
|
418
|
+
* @param {string} componentName Name of the component for error messages.
|
|
419
|
+
* @param {?Function} getStack Returns the component stack.
|
|
420
|
+
* @private
|
|
421
|
+
*/
|
|
422
|
+
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
423
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
424
|
+
for (var typeSpecName in typeSpecs) {
|
|
425
|
+
if (has(typeSpecs, typeSpecName)) {
|
|
426
|
+
var error;
|
|
427
|
+
// Prop type validation may throw. In case they do, we don't want to
|
|
428
|
+
// fail the render phase where it didn't fail before. So we log it.
|
|
429
|
+
// After these have been cleaned up, we'll let them throw.
|
|
430
|
+
try {
|
|
431
|
+
// This is intentionally an invariant that gets caught. It's the same
|
|
432
|
+
// behavior as without this statement except with a better message.
|
|
433
|
+
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
434
|
+
var err = Error(
|
|
435
|
+
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
|
|
436
|
+
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
|
|
437
|
+
'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
|
|
438
|
+
);
|
|
439
|
+
err.name = 'Invariant Violation';
|
|
440
|
+
throw err;
|
|
441
|
+
}
|
|
442
|
+
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
|
443
|
+
} catch (ex) {
|
|
444
|
+
error = ex;
|
|
445
|
+
}
|
|
446
|
+
if (error && !(error instanceof Error)) {
|
|
447
|
+
printWarning(
|
|
448
|
+
(componentName || 'React class') + ': type specification of ' +
|
|
449
|
+
location + ' `' + typeSpecName + '` is invalid; the type checker ' +
|
|
450
|
+
'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
|
|
451
|
+
'You may have forgotten to pass an argument to the type checker ' +
|
|
452
|
+
'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
|
|
453
|
+
'shape all require an argument).'
|
|
454
|
+
);
|
|
455
|
+
}
|
|
456
|
+
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
457
|
+
// Only monitor this failure once because there tends to be a lot of the
|
|
458
|
+
// same error.
|
|
459
|
+
loggedTypeFailures[error.message] = true;
|
|
460
|
+
|
|
461
|
+
var stack = getStack ? getStack() : '';
|
|
462
|
+
|
|
463
|
+
printWarning(
|
|
464
|
+
'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
|
|
465
|
+
);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
}
|
|
462
471
|
|
|
463
|
-
|
|
472
|
+
/**
|
|
473
|
+
* Resets warning cache when testing.
|
|
474
|
+
*
|
|
475
|
+
* @private
|
|
476
|
+
*/
|
|
477
|
+
checkPropTypes.resetWarningCache = function() {
|
|
478
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
479
|
+
loggedTypeFailures = {};
|
|
480
|
+
}
|
|
481
|
+
};
|
|
482
|
+
|
|
483
|
+
checkPropTypes_1 = checkPropTypes;
|
|
484
|
+
return checkPropTypes_1;
|
|
485
|
+
}
|
|
464
486
|
|
|
465
487
|
/**
|
|
466
488
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
@@ -469,608 +491,617 @@ var checkPropTypes_1 = checkPropTypes$1;
|
|
|
469
491
|
* LICENSE file in the root directory of this source tree.
|
|
470
492
|
*/
|
|
471
493
|
|
|
472
|
-
var
|
|
473
|
-
var
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
var
|
|
494
|
+
var factoryWithTypeCheckers;
|
|
495
|
+
var hasRequiredFactoryWithTypeCheckers;
|
|
496
|
+
|
|
497
|
+
function requireFactoryWithTypeCheckers () {
|
|
498
|
+
if (hasRequiredFactoryWithTypeCheckers) return factoryWithTypeCheckers;
|
|
499
|
+
hasRequiredFactoryWithTypeCheckers = 1;
|
|
500
|
+
|
|
501
|
+
var ReactIs = requireReactIs();
|
|
502
|
+
var assign = requireObjectAssign();
|
|
503
|
+
|
|
504
|
+
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
505
|
+
var has = requireHas();
|
|
506
|
+
var checkPropTypes = requireCheckPropTypes();
|
|
507
|
+
|
|
508
|
+
var printWarning = function() {};
|
|
509
|
+
|
|
510
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
511
|
+
printWarning = function(text) {
|
|
512
|
+
var message = 'Warning: ' + text;
|
|
513
|
+
if (typeof console !== 'undefined') {
|
|
514
|
+
console.error(message);
|
|
515
|
+
}
|
|
516
|
+
try {
|
|
517
|
+
// --- Welcome to debugging React ---
|
|
518
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
519
|
+
// to find the callsite that caused this warning to fire.
|
|
520
|
+
throw new Error(message);
|
|
521
|
+
} catch (x) {}
|
|
522
|
+
};
|
|
523
|
+
}
|
|
480
524
|
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
if (typeof console !== 'undefined') {
|
|
485
|
-
console.error(message);
|
|
486
|
-
}
|
|
487
|
-
try {
|
|
488
|
-
// --- Welcome to debugging React ---
|
|
489
|
-
// This error was thrown as a convenience so that you can use this stack
|
|
490
|
-
// to find the callsite that caused this warning to fire.
|
|
491
|
-
throw new Error(message);
|
|
492
|
-
} catch (x) {}
|
|
493
|
-
};
|
|
494
|
-
}
|
|
525
|
+
function emptyFunctionThatReturnsNull() {
|
|
526
|
+
return null;
|
|
527
|
+
}
|
|
495
528
|
|
|
496
|
-
function
|
|
497
|
-
|
|
529
|
+
factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
530
|
+
/* global Symbol */
|
|
531
|
+
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
532
|
+
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* Returns the iterator method function contained on the iterable object.
|
|
536
|
+
*
|
|
537
|
+
* Be sure to invoke the function with the iterable as context:
|
|
538
|
+
*
|
|
539
|
+
* var iteratorFn = getIteratorFn(myIterable);
|
|
540
|
+
* if (iteratorFn) {
|
|
541
|
+
* var iterator = iteratorFn.call(myIterable);
|
|
542
|
+
* ...
|
|
543
|
+
* }
|
|
544
|
+
*
|
|
545
|
+
* @param {?object} maybeIterable
|
|
546
|
+
* @return {?function}
|
|
547
|
+
*/
|
|
548
|
+
function getIteratorFn(maybeIterable) {
|
|
549
|
+
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
550
|
+
if (typeof iteratorFn === 'function') {
|
|
551
|
+
return iteratorFn;
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
/**
|
|
556
|
+
* Collection of methods that allow declaration and validation of props that are
|
|
557
|
+
* supplied to React components. Example usage:
|
|
558
|
+
*
|
|
559
|
+
* var Props = require('ReactPropTypes');
|
|
560
|
+
* var MyArticle = React.createClass({
|
|
561
|
+
* propTypes: {
|
|
562
|
+
* // An optional string prop named "description".
|
|
563
|
+
* description: Props.string,
|
|
564
|
+
*
|
|
565
|
+
* // A required enum prop named "category".
|
|
566
|
+
* category: Props.oneOf(['News','Photos']).isRequired,
|
|
567
|
+
*
|
|
568
|
+
* // A prop named "dialog" that requires an instance of Dialog.
|
|
569
|
+
* dialog: Props.instanceOf(Dialog).isRequired
|
|
570
|
+
* },
|
|
571
|
+
* render: function() { ... }
|
|
572
|
+
* });
|
|
573
|
+
*
|
|
574
|
+
* A more formal specification of how these methods are used:
|
|
575
|
+
*
|
|
576
|
+
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
|
|
577
|
+
* decl := ReactPropTypes.{type}(.isRequired)?
|
|
578
|
+
*
|
|
579
|
+
* Each and every declaration produces a function with the same signature. This
|
|
580
|
+
* allows the creation of custom validation functions. For example:
|
|
581
|
+
*
|
|
582
|
+
* var MyLink = React.createClass({
|
|
583
|
+
* propTypes: {
|
|
584
|
+
* // An optional string or URI prop named "href".
|
|
585
|
+
* href: function(props, propName, componentName) {
|
|
586
|
+
* var propValue = props[propName];
|
|
587
|
+
* if (propValue != null && typeof propValue !== 'string' &&
|
|
588
|
+
* !(propValue instanceof URI)) {
|
|
589
|
+
* return new Error(
|
|
590
|
+
* 'Expected a string or an URI for ' + propName + ' in ' +
|
|
591
|
+
* componentName
|
|
592
|
+
* );
|
|
593
|
+
* }
|
|
594
|
+
* }
|
|
595
|
+
* },
|
|
596
|
+
* render: function() {...}
|
|
597
|
+
* });
|
|
598
|
+
*
|
|
599
|
+
* @internal
|
|
600
|
+
*/
|
|
601
|
+
|
|
602
|
+
var ANONYMOUS = '<<anonymous>>';
|
|
603
|
+
|
|
604
|
+
// Important!
|
|
605
|
+
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
|
|
606
|
+
var ReactPropTypes = {
|
|
607
|
+
array: createPrimitiveTypeChecker('array'),
|
|
608
|
+
bigint: createPrimitiveTypeChecker('bigint'),
|
|
609
|
+
bool: createPrimitiveTypeChecker('boolean'),
|
|
610
|
+
func: createPrimitiveTypeChecker('function'),
|
|
611
|
+
number: createPrimitiveTypeChecker('number'),
|
|
612
|
+
object: createPrimitiveTypeChecker('object'),
|
|
613
|
+
string: createPrimitiveTypeChecker('string'),
|
|
614
|
+
symbol: createPrimitiveTypeChecker('symbol'),
|
|
615
|
+
|
|
616
|
+
any: createAnyTypeChecker(),
|
|
617
|
+
arrayOf: createArrayOfTypeChecker,
|
|
618
|
+
element: createElementTypeChecker(),
|
|
619
|
+
elementType: createElementTypeTypeChecker(),
|
|
620
|
+
instanceOf: createInstanceTypeChecker,
|
|
621
|
+
node: createNodeChecker(),
|
|
622
|
+
objectOf: createObjectOfTypeChecker,
|
|
623
|
+
oneOf: createEnumTypeChecker,
|
|
624
|
+
oneOfType: createUnionTypeChecker,
|
|
625
|
+
shape: createShapeTypeChecker,
|
|
626
|
+
exact: createStrictShapeTypeChecker,
|
|
627
|
+
};
|
|
628
|
+
|
|
629
|
+
/**
|
|
630
|
+
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
631
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
632
|
+
*/
|
|
633
|
+
/*eslint-disable no-self-compare*/
|
|
634
|
+
function is(x, y) {
|
|
635
|
+
// SameValue algorithm
|
|
636
|
+
if (x === y) {
|
|
637
|
+
// Steps 1-5, 7-10
|
|
638
|
+
// Steps 6.b-6.e: +0 != -0
|
|
639
|
+
return x !== 0 || 1 / x === 1 / y;
|
|
640
|
+
} else {
|
|
641
|
+
// Step 6.a: NaN == NaN
|
|
642
|
+
return x !== x && y !== y;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
/*eslint-enable no-self-compare*/
|
|
646
|
+
|
|
647
|
+
/**
|
|
648
|
+
* We use an Error-like object for backward compatibility as people may call
|
|
649
|
+
* PropTypes directly and inspect their output. However, we don't use real
|
|
650
|
+
* Errors anymore. We don't inspect their stack anyway, and creating them
|
|
651
|
+
* is prohibitively expensive if they are created too often, such as what
|
|
652
|
+
* happens in oneOfType() for any type before the one that matched.
|
|
653
|
+
*/
|
|
654
|
+
function PropTypeError(message, data) {
|
|
655
|
+
this.message = message;
|
|
656
|
+
this.data = data && typeof data === 'object' ? data: {};
|
|
657
|
+
this.stack = '';
|
|
658
|
+
}
|
|
659
|
+
// Make `instanceof Error` still work for returned errors.
|
|
660
|
+
PropTypeError.prototype = Error.prototype;
|
|
661
|
+
|
|
662
|
+
function createChainableTypeChecker(validate) {
|
|
663
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
664
|
+
var manualPropTypeCallCache = {};
|
|
665
|
+
var manualPropTypeWarningCount = 0;
|
|
666
|
+
}
|
|
667
|
+
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
668
|
+
componentName = componentName || ANONYMOUS;
|
|
669
|
+
propFullName = propFullName || propName;
|
|
670
|
+
|
|
671
|
+
if (secret !== ReactPropTypesSecret) {
|
|
672
|
+
if (throwOnDirectAccess) {
|
|
673
|
+
// New behavior only for users of `prop-types` package
|
|
674
|
+
var err = new Error(
|
|
675
|
+
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
676
|
+
'Use `PropTypes.checkPropTypes()` to call them. ' +
|
|
677
|
+
'Read more at http://fb.me/use-check-prop-types'
|
|
678
|
+
);
|
|
679
|
+
err.name = 'Invariant Violation';
|
|
680
|
+
throw err;
|
|
681
|
+
} else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
|
|
682
|
+
// Old behavior for people using React.PropTypes
|
|
683
|
+
var cacheKey = componentName + ':' + propName;
|
|
684
|
+
if (
|
|
685
|
+
!manualPropTypeCallCache[cacheKey] &&
|
|
686
|
+
// Avoid spamming the console because they are often not actionable except for lib authors
|
|
687
|
+
manualPropTypeWarningCount < 3
|
|
688
|
+
) {
|
|
689
|
+
printWarning(
|
|
690
|
+
'You are manually calling a React.PropTypes validation ' +
|
|
691
|
+
'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
|
|
692
|
+
'and will throw in the standalone `prop-types` package. ' +
|
|
693
|
+
'You may be seeing this warning due to a third-party PropTypes ' +
|
|
694
|
+
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
|
|
695
|
+
);
|
|
696
|
+
manualPropTypeCallCache[cacheKey] = true;
|
|
697
|
+
manualPropTypeWarningCount++;
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
if (props[propName] == null) {
|
|
702
|
+
if (isRequired) {
|
|
703
|
+
if (props[propName] === null) {
|
|
704
|
+
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
|
|
705
|
+
}
|
|
706
|
+
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
|
|
707
|
+
}
|
|
708
|
+
return null;
|
|
709
|
+
} else {
|
|
710
|
+
return validate(props, propName, componentName, location, propFullName);
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
var chainedCheckType = checkType.bind(null, false);
|
|
715
|
+
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
716
|
+
|
|
717
|
+
return chainedCheckType;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
function createPrimitiveTypeChecker(expectedType) {
|
|
721
|
+
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
722
|
+
var propValue = props[propName];
|
|
723
|
+
var propType = getPropType(propValue);
|
|
724
|
+
if (propType !== expectedType) {
|
|
725
|
+
// `propValue` being instance of, say, date/regexp, pass the 'object'
|
|
726
|
+
// check, but we can offer a more precise error message here rather than
|
|
727
|
+
// 'of type `object`'.
|
|
728
|
+
var preciseType = getPreciseType(propValue);
|
|
729
|
+
|
|
730
|
+
return new PropTypeError(
|
|
731
|
+
'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
|
|
732
|
+
{expectedType: expectedType}
|
|
733
|
+
);
|
|
734
|
+
}
|
|
735
|
+
return null;
|
|
736
|
+
}
|
|
737
|
+
return createChainableTypeChecker(validate);
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
function createAnyTypeChecker() {
|
|
741
|
+
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
function createArrayOfTypeChecker(typeChecker) {
|
|
745
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
746
|
+
if (typeof typeChecker !== 'function') {
|
|
747
|
+
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
|
|
748
|
+
}
|
|
749
|
+
var propValue = props[propName];
|
|
750
|
+
if (!Array.isArray(propValue)) {
|
|
751
|
+
var propType = getPropType(propValue);
|
|
752
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
|
753
|
+
}
|
|
754
|
+
for (var i = 0; i < propValue.length; i++) {
|
|
755
|
+
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
|
|
756
|
+
if (error instanceof Error) {
|
|
757
|
+
return error;
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
return null;
|
|
761
|
+
}
|
|
762
|
+
return createChainableTypeChecker(validate);
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
function createElementTypeChecker() {
|
|
766
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
767
|
+
var propValue = props[propName];
|
|
768
|
+
if (!isValidElement(propValue)) {
|
|
769
|
+
var propType = getPropType(propValue);
|
|
770
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
|
|
771
|
+
}
|
|
772
|
+
return null;
|
|
773
|
+
}
|
|
774
|
+
return createChainableTypeChecker(validate);
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
function createElementTypeTypeChecker() {
|
|
778
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
779
|
+
var propValue = props[propName];
|
|
780
|
+
if (!ReactIs.isValidElementType(propValue)) {
|
|
781
|
+
var propType = getPropType(propValue);
|
|
782
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
|
|
783
|
+
}
|
|
784
|
+
return null;
|
|
785
|
+
}
|
|
786
|
+
return createChainableTypeChecker(validate);
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
function createInstanceTypeChecker(expectedClass) {
|
|
790
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
791
|
+
if (!(props[propName] instanceof expectedClass)) {
|
|
792
|
+
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
793
|
+
var actualClassName = getClassName(props[propName]);
|
|
794
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
|
|
795
|
+
}
|
|
796
|
+
return null;
|
|
797
|
+
}
|
|
798
|
+
return createChainableTypeChecker(validate);
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
function createEnumTypeChecker(expectedValues) {
|
|
802
|
+
if (!Array.isArray(expectedValues)) {
|
|
803
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
804
|
+
if (arguments.length > 1) {
|
|
805
|
+
printWarning(
|
|
806
|
+
'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
|
|
807
|
+
'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
|
|
808
|
+
);
|
|
809
|
+
} else {
|
|
810
|
+
printWarning('Invalid argument supplied to oneOf, expected an array.');
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
return emptyFunctionThatReturnsNull;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
817
|
+
var propValue = props[propName];
|
|
818
|
+
for (var i = 0; i < expectedValues.length; i++) {
|
|
819
|
+
if (is(propValue, expectedValues[i])) {
|
|
820
|
+
return null;
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
825
|
+
var type = getPreciseType(value);
|
|
826
|
+
if (type === 'symbol') {
|
|
827
|
+
return String(value);
|
|
828
|
+
}
|
|
829
|
+
return value;
|
|
830
|
+
});
|
|
831
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
|
832
|
+
}
|
|
833
|
+
return createChainableTypeChecker(validate);
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
function createObjectOfTypeChecker(typeChecker) {
|
|
837
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
838
|
+
if (typeof typeChecker !== 'function') {
|
|
839
|
+
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
|
|
840
|
+
}
|
|
841
|
+
var propValue = props[propName];
|
|
842
|
+
var propType = getPropType(propValue);
|
|
843
|
+
if (propType !== 'object') {
|
|
844
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
|
845
|
+
}
|
|
846
|
+
for (var key in propValue) {
|
|
847
|
+
if (has(propValue, key)) {
|
|
848
|
+
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
849
|
+
if (error instanceof Error) {
|
|
850
|
+
return error;
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
return null;
|
|
855
|
+
}
|
|
856
|
+
return createChainableTypeChecker(validate);
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
860
|
+
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
861
|
+
process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
|
|
862
|
+
return emptyFunctionThatReturnsNull;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
866
|
+
var checker = arrayOfTypeCheckers[i];
|
|
867
|
+
if (typeof checker !== 'function') {
|
|
868
|
+
printWarning(
|
|
869
|
+
'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
|
|
870
|
+
'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
|
|
871
|
+
);
|
|
872
|
+
return emptyFunctionThatReturnsNull;
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
877
|
+
var expectedTypes = [];
|
|
878
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
879
|
+
var checker = arrayOfTypeCheckers[i];
|
|
880
|
+
var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
|
|
881
|
+
if (checkerResult == null) {
|
|
882
|
+
return null;
|
|
883
|
+
}
|
|
884
|
+
if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
|
|
885
|
+
expectedTypes.push(checkerResult.data.expectedType);
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
|
|
889
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
|
|
890
|
+
}
|
|
891
|
+
return createChainableTypeChecker(validate);
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
function createNodeChecker() {
|
|
895
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
896
|
+
if (!isNode(props[propName])) {
|
|
897
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
|
898
|
+
}
|
|
899
|
+
return null;
|
|
900
|
+
}
|
|
901
|
+
return createChainableTypeChecker(validate);
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
905
|
+
return new PropTypeError(
|
|
906
|
+
(componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
|
|
907
|
+
'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
|
|
908
|
+
);
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
function createShapeTypeChecker(shapeTypes) {
|
|
912
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
913
|
+
var propValue = props[propName];
|
|
914
|
+
var propType = getPropType(propValue);
|
|
915
|
+
if (propType !== 'object') {
|
|
916
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
917
|
+
}
|
|
918
|
+
for (var key in shapeTypes) {
|
|
919
|
+
var checker = shapeTypes[key];
|
|
920
|
+
if (typeof checker !== 'function') {
|
|
921
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
922
|
+
}
|
|
923
|
+
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
924
|
+
if (error) {
|
|
925
|
+
return error;
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
return null;
|
|
929
|
+
}
|
|
930
|
+
return createChainableTypeChecker(validate);
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
function createStrictShapeTypeChecker(shapeTypes) {
|
|
934
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
935
|
+
var propValue = props[propName];
|
|
936
|
+
var propType = getPropType(propValue);
|
|
937
|
+
if (propType !== 'object') {
|
|
938
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
939
|
+
}
|
|
940
|
+
// We need to check all keys in case some are required but missing from props.
|
|
941
|
+
var allKeys = assign({}, props[propName], shapeTypes);
|
|
942
|
+
for (var key in allKeys) {
|
|
943
|
+
var checker = shapeTypes[key];
|
|
944
|
+
if (has(shapeTypes, key) && typeof checker !== 'function') {
|
|
945
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
946
|
+
}
|
|
947
|
+
if (!checker) {
|
|
948
|
+
return new PropTypeError(
|
|
949
|
+
'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
|
|
950
|
+
'\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
|
|
951
|
+
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
|
|
952
|
+
);
|
|
953
|
+
}
|
|
954
|
+
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
955
|
+
if (error) {
|
|
956
|
+
return error;
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
return null;
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
return createChainableTypeChecker(validate);
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
function isNode(propValue) {
|
|
966
|
+
switch (typeof propValue) {
|
|
967
|
+
case 'number':
|
|
968
|
+
case 'string':
|
|
969
|
+
case 'undefined':
|
|
970
|
+
return true;
|
|
971
|
+
case 'boolean':
|
|
972
|
+
return !propValue;
|
|
973
|
+
case 'object':
|
|
974
|
+
if (Array.isArray(propValue)) {
|
|
975
|
+
return propValue.every(isNode);
|
|
976
|
+
}
|
|
977
|
+
if (propValue === null || isValidElement(propValue)) {
|
|
978
|
+
return true;
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
var iteratorFn = getIteratorFn(propValue);
|
|
982
|
+
if (iteratorFn) {
|
|
983
|
+
var iterator = iteratorFn.call(propValue);
|
|
984
|
+
var step;
|
|
985
|
+
if (iteratorFn !== propValue.entries) {
|
|
986
|
+
while (!(step = iterator.next()).done) {
|
|
987
|
+
if (!isNode(step.value)) {
|
|
988
|
+
return false;
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
} else {
|
|
992
|
+
// Iterator will provide entry [k,v] tuples rather than values.
|
|
993
|
+
while (!(step = iterator.next()).done) {
|
|
994
|
+
var entry = step.value;
|
|
995
|
+
if (entry) {
|
|
996
|
+
if (!isNode(entry[1])) {
|
|
997
|
+
return false;
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
} else {
|
|
1003
|
+
return false;
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
return true;
|
|
1007
|
+
default:
|
|
1008
|
+
return false;
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
function isSymbol(propType, propValue) {
|
|
1013
|
+
// Native Symbol.
|
|
1014
|
+
if (propType === 'symbol') {
|
|
1015
|
+
return true;
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
// falsy value can't be a Symbol
|
|
1019
|
+
if (!propValue) {
|
|
1020
|
+
return false;
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
|
|
1024
|
+
if (propValue['@@toStringTag'] === 'Symbol') {
|
|
1025
|
+
return true;
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
// Fallback for non-spec compliant Symbols which are polyfilled.
|
|
1029
|
+
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
|
|
1030
|
+
return true;
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
return false;
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
// Equivalent of `typeof` but with special handling for array and regexp.
|
|
1037
|
+
function getPropType(propValue) {
|
|
1038
|
+
var propType = typeof propValue;
|
|
1039
|
+
if (Array.isArray(propValue)) {
|
|
1040
|
+
return 'array';
|
|
1041
|
+
}
|
|
1042
|
+
if (propValue instanceof RegExp) {
|
|
1043
|
+
// Old webkits (at least until Android 4.0) return 'function' rather than
|
|
1044
|
+
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
|
|
1045
|
+
// passes PropTypes.object.
|
|
1046
|
+
return 'object';
|
|
1047
|
+
}
|
|
1048
|
+
if (isSymbol(propType, propValue)) {
|
|
1049
|
+
return 'symbol';
|
|
1050
|
+
}
|
|
1051
|
+
return propType;
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
// This handles more types than `getPropType`. Only used for error messages.
|
|
1055
|
+
// See `createPrimitiveTypeChecker`.
|
|
1056
|
+
function getPreciseType(propValue) {
|
|
1057
|
+
if (typeof propValue === 'undefined' || propValue === null) {
|
|
1058
|
+
return '' + propValue;
|
|
1059
|
+
}
|
|
1060
|
+
var propType = getPropType(propValue);
|
|
1061
|
+
if (propType === 'object') {
|
|
1062
|
+
if (propValue instanceof Date) {
|
|
1063
|
+
return 'date';
|
|
1064
|
+
} else if (propValue instanceof RegExp) {
|
|
1065
|
+
return 'regexp';
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
return propType;
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
// Returns a string that is postfixed to a warning about an invalid type.
|
|
1072
|
+
// For example, "undefined" or "of type array"
|
|
1073
|
+
function getPostfixForTypeWarning(value) {
|
|
1074
|
+
var type = getPreciseType(value);
|
|
1075
|
+
switch (type) {
|
|
1076
|
+
case 'array':
|
|
1077
|
+
case 'object':
|
|
1078
|
+
return 'an ' + type;
|
|
1079
|
+
case 'boolean':
|
|
1080
|
+
case 'date':
|
|
1081
|
+
case 'regexp':
|
|
1082
|
+
return 'a ' + type;
|
|
1083
|
+
default:
|
|
1084
|
+
return type;
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
// Returns class name of the object, if any.
|
|
1089
|
+
function getClassName(propValue) {
|
|
1090
|
+
if (!propValue.constructor || !propValue.constructor.name) {
|
|
1091
|
+
return ANONYMOUS;
|
|
1092
|
+
}
|
|
1093
|
+
return propValue.constructor.name;
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
1097
|
+
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
1098
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
1099
|
+
|
|
1100
|
+
return ReactPropTypes;
|
|
1101
|
+
};
|
|
1102
|
+
return factoryWithTypeCheckers;
|
|
498
1103
|
}
|
|
499
1104
|
|
|
500
|
-
var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
501
|
-
/* global Symbol */
|
|
502
|
-
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
503
|
-
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
|
504
|
-
|
|
505
|
-
/**
|
|
506
|
-
* Returns the iterator method function contained on the iterable object.
|
|
507
|
-
*
|
|
508
|
-
* Be sure to invoke the function with the iterable as context:
|
|
509
|
-
*
|
|
510
|
-
* var iteratorFn = getIteratorFn(myIterable);
|
|
511
|
-
* if (iteratorFn) {
|
|
512
|
-
* var iterator = iteratorFn.call(myIterable);
|
|
513
|
-
* ...
|
|
514
|
-
* }
|
|
515
|
-
*
|
|
516
|
-
* @param {?object} maybeIterable
|
|
517
|
-
* @return {?function}
|
|
518
|
-
*/
|
|
519
|
-
function getIteratorFn(maybeIterable) {
|
|
520
|
-
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
521
|
-
if (typeof iteratorFn === 'function') {
|
|
522
|
-
return iteratorFn;
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
/**
|
|
527
|
-
* Collection of methods that allow declaration and validation of props that are
|
|
528
|
-
* supplied to React components. Example usage:
|
|
529
|
-
*
|
|
530
|
-
* var Props = require('ReactPropTypes');
|
|
531
|
-
* var MyArticle = React.createClass({
|
|
532
|
-
* propTypes: {
|
|
533
|
-
* // An optional string prop named "description".
|
|
534
|
-
* description: Props.string,
|
|
535
|
-
*
|
|
536
|
-
* // A required enum prop named "category".
|
|
537
|
-
* category: Props.oneOf(['News','Photos']).isRequired,
|
|
538
|
-
*
|
|
539
|
-
* // A prop named "dialog" that requires an instance of Dialog.
|
|
540
|
-
* dialog: Props.instanceOf(Dialog).isRequired
|
|
541
|
-
* },
|
|
542
|
-
* render: function() { ... }
|
|
543
|
-
* });
|
|
544
|
-
*
|
|
545
|
-
* A more formal specification of how these methods are used:
|
|
546
|
-
*
|
|
547
|
-
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
|
|
548
|
-
* decl := ReactPropTypes.{type}(.isRequired)?
|
|
549
|
-
*
|
|
550
|
-
* Each and every declaration produces a function with the same signature. This
|
|
551
|
-
* allows the creation of custom validation functions. For example:
|
|
552
|
-
*
|
|
553
|
-
* var MyLink = React.createClass({
|
|
554
|
-
* propTypes: {
|
|
555
|
-
* // An optional string or URI prop named "href".
|
|
556
|
-
* href: function(props, propName, componentName) {
|
|
557
|
-
* var propValue = props[propName];
|
|
558
|
-
* if (propValue != null && typeof propValue !== 'string' &&
|
|
559
|
-
* !(propValue instanceof URI)) {
|
|
560
|
-
* return new Error(
|
|
561
|
-
* 'Expected a string or an URI for ' + propName + ' in ' +
|
|
562
|
-
* componentName
|
|
563
|
-
* );
|
|
564
|
-
* }
|
|
565
|
-
* }
|
|
566
|
-
* },
|
|
567
|
-
* render: function() {...}
|
|
568
|
-
* });
|
|
569
|
-
*
|
|
570
|
-
* @internal
|
|
571
|
-
*/
|
|
572
|
-
|
|
573
|
-
var ANONYMOUS = '<<anonymous>>';
|
|
574
|
-
|
|
575
|
-
// Important!
|
|
576
|
-
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
|
|
577
|
-
var ReactPropTypes = {
|
|
578
|
-
array: createPrimitiveTypeChecker('array'),
|
|
579
|
-
bigint: createPrimitiveTypeChecker('bigint'),
|
|
580
|
-
bool: createPrimitiveTypeChecker('boolean'),
|
|
581
|
-
func: createPrimitiveTypeChecker('function'),
|
|
582
|
-
number: createPrimitiveTypeChecker('number'),
|
|
583
|
-
object: createPrimitiveTypeChecker('object'),
|
|
584
|
-
string: createPrimitiveTypeChecker('string'),
|
|
585
|
-
symbol: createPrimitiveTypeChecker('symbol'),
|
|
586
|
-
|
|
587
|
-
any: createAnyTypeChecker(),
|
|
588
|
-
arrayOf: createArrayOfTypeChecker,
|
|
589
|
-
element: createElementTypeChecker(),
|
|
590
|
-
elementType: createElementTypeTypeChecker(),
|
|
591
|
-
instanceOf: createInstanceTypeChecker,
|
|
592
|
-
node: createNodeChecker(),
|
|
593
|
-
objectOf: createObjectOfTypeChecker,
|
|
594
|
-
oneOf: createEnumTypeChecker,
|
|
595
|
-
oneOfType: createUnionTypeChecker,
|
|
596
|
-
shape: createShapeTypeChecker,
|
|
597
|
-
exact: createStrictShapeTypeChecker,
|
|
598
|
-
};
|
|
599
|
-
|
|
600
|
-
/**
|
|
601
|
-
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
602
|
-
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
603
|
-
*/
|
|
604
|
-
/*eslint-disable no-self-compare*/
|
|
605
|
-
function is(x, y) {
|
|
606
|
-
// SameValue algorithm
|
|
607
|
-
if (x === y) {
|
|
608
|
-
// Steps 1-5, 7-10
|
|
609
|
-
// Steps 6.b-6.e: +0 != -0
|
|
610
|
-
return x !== 0 || 1 / x === 1 / y;
|
|
611
|
-
} else {
|
|
612
|
-
// Step 6.a: NaN == NaN
|
|
613
|
-
return x !== x && y !== y;
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
/*eslint-enable no-self-compare*/
|
|
617
|
-
|
|
618
|
-
/**
|
|
619
|
-
* We use an Error-like object for backward compatibility as people may call
|
|
620
|
-
* PropTypes directly and inspect their output. However, we don't use real
|
|
621
|
-
* Errors anymore. We don't inspect their stack anyway, and creating them
|
|
622
|
-
* is prohibitively expensive if they are created too often, such as what
|
|
623
|
-
* happens in oneOfType() for any type before the one that matched.
|
|
624
|
-
*/
|
|
625
|
-
function PropTypeError(message, data) {
|
|
626
|
-
this.message = message;
|
|
627
|
-
this.data = data && typeof data === 'object' ? data: {};
|
|
628
|
-
this.stack = '';
|
|
629
|
-
}
|
|
630
|
-
// Make `instanceof Error` still work for returned errors.
|
|
631
|
-
PropTypeError.prototype = Error.prototype;
|
|
632
|
-
|
|
633
|
-
function createChainableTypeChecker(validate) {
|
|
634
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
635
|
-
var manualPropTypeCallCache = {};
|
|
636
|
-
var manualPropTypeWarningCount = 0;
|
|
637
|
-
}
|
|
638
|
-
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
639
|
-
componentName = componentName || ANONYMOUS;
|
|
640
|
-
propFullName = propFullName || propName;
|
|
641
|
-
|
|
642
|
-
if (secret !== ReactPropTypesSecret$1) {
|
|
643
|
-
if (throwOnDirectAccess) {
|
|
644
|
-
// New behavior only for users of `prop-types` package
|
|
645
|
-
var err = new Error(
|
|
646
|
-
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
647
|
-
'Use `PropTypes.checkPropTypes()` to call them. ' +
|
|
648
|
-
'Read more at http://fb.me/use-check-prop-types'
|
|
649
|
-
);
|
|
650
|
-
err.name = 'Invariant Violation';
|
|
651
|
-
throw err;
|
|
652
|
-
} else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
|
|
653
|
-
// Old behavior for people using React.PropTypes
|
|
654
|
-
var cacheKey = componentName + ':' + propName;
|
|
655
|
-
if (
|
|
656
|
-
!manualPropTypeCallCache[cacheKey] &&
|
|
657
|
-
// Avoid spamming the console because they are often not actionable except for lib authors
|
|
658
|
-
manualPropTypeWarningCount < 3
|
|
659
|
-
) {
|
|
660
|
-
printWarning(
|
|
661
|
-
'You are manually calling a React.PropTypes validation ' +
|
|
662
|
-
'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
|
|
663
|
-
'and will throw in the standalone `prop-types` package. ' +
|
|
664
|
-
'You may be seeing this warning due to a third-party PropTypes ' +
|
|
665
|
-
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
|
|
666
|
-
);
|
|
667
|
-
manualPropTypeCallCache[cacheKey] = true;
|
|
668
|
-
manualPropTypeWarningCount++;
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
}
|
|
672
|
-
if (props[propName] == null) {
|
|
673
|
-
if (isRequired) {
|
|
674
|
-
if (props[propName] === null) {
|
|
675
|
-
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
|
|
676
|
-
}
|
|
677
|
-
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
|
|
678
|
-
}
|
|
679
|
-
return null;
|
|
680
|
-
} else {
|
|
681
|
-
return validate(props, propName, componentName, location, propFullName);
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
var chainedCheckType = checkType.bind(null, false);
|
|
686
|
-
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
687
|
-
|
|
688
|
-
return chainedCheckType;
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
function createPrimitiveTypeChecker(expectedType) {
|
|
692
|
-
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
693
|
-
var propValue = props[propName];
|
|
694
|
-
var propType = getPropType(propValue);
|
|
695
|
-
if (propType !== expectedType) {
|
|
696
|
-
// `propValue` being instance of, say, date/regexp, pass the 'object'
|
|
697
|
-
// check, but we can offer a more precise error message here rather than
|
|
698
|
-
// 'of type `object`'.
|
|
699
|
-
var preciseType = getPreciseType(propValue);
|
|
700
|
-
|
|
701
|
-
return new PropTypeError(
|
|
702
|
-
'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
|
|
703
|
-
{expectedType: expectedType}
|
|
704
|
-
);
|
|
705
|
-
}
|
|
706
|
-
return null;
|
|
707
|
-
}
|
|
708
|
-
return createChainableTypeChecker(validate);
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
function createAnyTypeChecker() {
|
|
712
|
-
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
function createArrayOfTypeChecker(typeChecker) {
|
|
716
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
717
|
-
if (typeof typeChecker !== 'function') {
|
|
718
|
-
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
|
|
719
|
-
}
|
|
720
|
-
var propValue = props[propName];
|
|
721
|
-
if (!Array.isArray(propValue)) {
|
|
722
|
-
var propType = getPropType(propValue);
|
|
723
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
|
724
|
-
}
|
|
725
|
-
for (var i = 0; i < propValue.length; i++) {
|
|
726
|
-
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret$1);
|
|
727
|
-
if (error instanceof Error) {
|
|
728
|
-
return error;
|
|
729
|
-
}
|
|
730
|
-
}
|
|
731
|
-
return null;
|
|
732
|
-
}
|
|
733
|
-
return createChainableTypeChecker(validate);
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
function createElementTypeChecker() {
|
|
737
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
738
|
-
var propValue = props[propName];
|
|
739
|
-
if (!isValidElement(propValue)) {
|
|
740
|
-
var propType = getPropType(propValue);
|
|
741
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
|
|
742
|
-
}
|
|
743
|
-
return null;
|
|
744
|
-
}
|
|
745
|
-
return createChainableTypeChecker(validate);
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
function createElementTypeTypeChecker() {
|
|
749
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
750
|
-
var propValue = props[propName];
|
|
751
|
-
if (!ReactIs$1.isValidElementType(propValue)) {
|
|
752
|
-
var propType = getPropType(propValue);
|
|
753
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
|
|
754
|
-
}
|
|
755
|
-
return null;
|
|
756
|
-
}
|
|
757
|
-
return createChainableTypeChecker(validate);
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
function createInstanceTypeChecker(expectedClass) {
|
|
761
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
762
|
-
if (!(props[propName] instanceof expectedClass)) {
|
|
763
|
-
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
764
|
-
var actualClassName = getClassName(props[propName]);
|
|
765
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
|
|
766
|
-
}
|
|
767
|
-
return null;
|
|
768
|
-
}
|
|
769
|
-
return createChainableTypeChecker(validate);
|
|
770
|
-
}
|
|
771
|
-
|
|
772
|
-
function createEnumTypeChecker(expectedValues) {
|
|
773
|
-
if (!Array.isArray(expectedValues)) {
|
|
774
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
775
|
-
if (arguments.length > 1) {
|
|
776
|
-
printWarning(
|
|
777
|
-
'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
|
|
778
|
-
'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
|
|
779
|
-
);
|
|
780
|
-
} else {
|
|
781
|
-
printWarning('Invalid argument supplied to oneOf, expected an array.');
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
return emptyFunctionThatReturnsNull;
|
|
785
|
-
}
|
|
786
|
-
|
|
787
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
788
|
-
var propValue = props[propName];
|
|
789
|
-
for (var i = 0; i < expectedValues.length; i++) {
|
|
790
|
-
if (is(propValue, expectedValues[i])) {
|
|
791
|
-
return null;
|
|
792
|
-
}
|
|
793
|
-
}
|
|
794
|
-
|
|
795
|
-
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
796
|
-
var type = getPreciseType(value);
|
|
797
|
-
if (type === 'symbol') {
|
|
798
|
-
return String(value);
|
|
799
|
-
}
|
|
800
|
-
return value;
|
|
801
|
-
});
|
|
802
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
|
803
|
-
}
|
|
804
|
-
return createChainableTypeChecker(validate);
|
|
805
|
-
}
|
|
806
|
-
|
|
807
|
-
function createObjectOfTypeChecker(typeChecker) {
|
|
808
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
809
|
-
if (typeof typeChecker !== 'function') {
|
|
810
|
-
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
|
|
811
|
-
}
|
|
812
|
-
var propValue = props[propName];
|
|
813
|
-
var propType = getPropType(propValue);
|
|
814
|
-
if (propType !== 'object') {
|
|
815
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
|
816
|
-
}
|
|
817
|
-
for (var key in propValue) {
|
|
818
|
-
if (has(propValue, key)) {
|
|
819
|
-
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
|
|
820
|
-
if (error instanceof Error) {
|
|
821
|
-
return error;
|
|
822
|
-
}
|
|
823
|
-
}
|
|
824
|
-
}
|
|
825
|
-
return null;
|
|
826
|
-
}
|
|
827
|
-
return createChainableTypeChecker(validate);
|
|
828
|
-
}
|
|
829
|
-
|
|
830
|
-
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
831
|
-
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
832
|
-
process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
|
|
833
|
-
return emptyFunctionThatReturnsNull;
|
|
834
|
-
}
|
|
835
|
-
|
|
836
|
-
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
837
|
-
var checker = arrayOfTypeCheckers[i];
|
|
838
|
-
if (typeof checker !== 'function') {
|
|
839
|
-
printWarning(
|
|
840
|
-
'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
|
|
841
|
-
'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
|
|
842
|
-
);
|
|
843
|
-
return emptyFunctionThatReturnsNull;
|
|
844
|
-
}
|
|
845
|
-
}
|
|
846
|
-
|
|
847
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
848
|
-
var expectedTypes = [];
|
|
849
|
-
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
850
|
-
var checker = arrayOfTypeCheckers[i];
|
|
851
|
-
var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret$1);
|
|
852
|
-
if (checkerResult == null) {
|
|
853
|
-
return null;
|
|
854
|
-
}
|
|
855
|
-
if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
|
|
856
|
-
expectedTypes.push(checkerResult.data.expectedType);
|
|
857
|
-
}
|
|
858
|
-
}
|
|
859
|
-
var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
|
|
860
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
|
|
861
|
-
}
|
|
862
|
-
return createChainableTypeChecker(validate);
|
|
863
|
-
}
|
|
864
|
-
|
|
865
|
-
function createNodeChecker() {
|
|
866
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
867
|
-
if (!isNode(props[propName])) {
|
|
868
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
|
869
|
-
}
|
|
870
|
-
return null;
|
|
871
|
-
}
|
|
872
|
-
return createChainableTypeChecker(validate);
|
|
873
|
-
}
|
|
874
|
-
|
|
875
|
-
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
876
|
-
return new PropTypeError(
|
|
877
|
-
(componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
|
|
878
|
-
'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
|
|
879
|
-
);
|
|
880
|
-
}
|
|
881
|
-
|
|
882
|
-
function createShapeTypeChecker(shapeTypes) {
|
|
883
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
884
|
-
var propValue = props[propName];
|
|
885
|
-
var propType = getPropType(propValue);
|
|
886
|
-
if (propType !== 'object') {
|
|
887
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
888
|
-
}
|
|
889
|
-
for (var key in shapeTypes) {
|
|
890
|
-
var checker = shapeTypes[key];
|
|
891
|
-
if (typeof checker !== 'function') {
|
|
892
|
-
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
893
|
-
}
|
|
894
|
-
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
|
|
895
|
-
if (error) {
|
|
896
|
-
return error;
|
|
897
|
-
}
|
|
898
|
-
}
|
|
899
|
-
return null;
|
|
900
|
-
}
|
|
901
|
-
return createChainableTypeChecker(validate);
|
|
902
|
-
}
|
|
903
|
-
|
|
904
|
-
function createStrictShapeTypeChecker(shapeTypes) {
|
|
905
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
906
|
-
var propValue = props[propName];
|
|
907
|
-
var propType = getPropType(propValue);
|
|
908
|
-
if (propType !== 'object') {
|
|
909
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
910
|
-
}
|
|
911
|
-
// We need to check all keys in case some are required but missing from props.
|
|
912
|
-
var allKeys = assign({}, props[propName], shapeTypes);
|
|
913
|
-
for (var key in allKeys) {
|
|
914
|
-
var checker = shapeTypes[key];
|
|
915
|
-
if (has(shapeTypes, key) && typeof checker !== 'function') {
|
|
916
|
-
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
917
|
-
}
|
|
918
|
-
if (!checker) {
|
|
919
|
-
return new PropTypeError(
|
|
920
|
-
'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
|
|
921
|
-
'\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
|
|
922
|
-
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
|
|
923
|
-
);
|
|
924
|
-
}
|
|
925
|
-
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
|
|
926
|
-
if (error) {
|
|
927
|
-
return error;
|
|
928
|
-
}
|
|
929
|
-
}
|
|
930
|
-
return null;
|
|
931
|
-
}
|
|
932
|
-
|
|
933
|
-
return createChainableTypeChecker(validate);
|
|
934
|
-
}
|
|
935
|
-
|
|
936
|
-
function isNode(propValue) {
|
|
937
|
-
switch (typeof propValue) {
|
|
938
|
-
case 'number':
|
|
939
|
-
case 'string':
|
|
940
|
-
case 'undefined':
|
|
941
|
-
return true;
|
|
942
|
-
case 'boolean':
|
|
943
|
-
return !propValue;
|
|
944
|
-
case 'object':
|
|
945
|
-
if (Array.isArray(propValue)) {
|
|
946
|
-
return propValue.every(isNode);
|
|
947
|
-
}
|
|
948
|
-
if (propValue === null || isValidElement(propValue)) {
|
|
949
|
-
return true;
|
|
950
|
-
}
|
|
951
|
-
|
|
952
|
-
var iteratorFn = getIteratorFn(propValue);
|
|
953
|
-
if (iteratorFn) {
|
|
954
|
-
var iterator = iteratorFn.call(propValue);
|
|
955
|
-
var step;
|
|
956
|
-
if (iteratorFn !== propValue.entries) {
|
|
957
|
-
while (!(step = iterator.next()).done) {
|
|
958
|
-
if (!isNode(step.value)) {
|
|
959
|
-
return false;
|
|
960
|
-
}
|
|
961
|
-
}
|
|
962
|
-
} else {
|
|
963
|
-
// Iterator will provide entry [k,v] tuples rather than values.
|
|
964
|
-
while (!(step = iterator.next()).done) {
|
|
965
|
-
var entry = step.value;
|
|
966
|
-
if (entry) {
|
|
967
|
-
if (!isNode(entry[1])) {
|
|
968
|
-
return false;
|
|
969
|
-
}
|
|
970
|
-
}
|
|
971
|
-
}
|
|
972
|
-
}
|
|
973
|
-
} else {
|
|
974
|
-
return false;
|
|
975
|
-
}
|
|
976
|
-
|
|
977
|
-
return true;
|
|
978
|
-
default:
|
|
979
|
-
return false;
|
|
980
|
-
}
|
|
981
|
-
}
|
|
982
|
-
|
|
983
|
-
function isSymbol(propType, propValue) {
|
|
984
|
-
// Native Symbol.
|
|
985
|
-
if (propType === 'symbol') {
|
|
986
|
-
return true;
|
|
987
|
-
}
|
|
988
|
-
|
|
989
|
-
// falsy value can't be a Symbol
|
|
990
|
-
if (!propValue) {
|
|
991
|
-
return false;
|
|
992
|
-
}
|
|
993
|
-
|
|
994
|
-
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
|
|
995
|
-
if (propValue['@@toStringTag'] === 'Symbol') {
|
|
996
|
-
return true;
|
|
997
|
-
}
|
|
998
|
-
|
|
999
|
-
// Fallback for non-spec compliant Symbols which are polyfilled.
|
|
1000
|
-
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
|
|
1001
|
-
return true;
|
|
1002
|
-
}
|
|
1003
|
-
|
|
1004
|
-
return false;
|
|
1005
|
-
}
|
|
1006
|
-
|
|
1007
|
-
// Equivalent of `typeof` but with special handling for array and regexp.
|
|
1008
|
-
function getPropType(propValue) {
|
|
1009
|
-
var propType = typeof propValue;
|
|
1010
|
-
if (Array.isArray(propValue)) {
|
|
1011
|
-
return 'array';
|
|
1012
|
-
}
|
|
1013
|
-
if (propValue instanceof RegExp) {
|
|
1014
|
-
// Old webkits (at least until Android 4.0) return 'function' rather than
|
|
1015
|
-
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
|
|
1016
|
-
// passes PropTypes.object.
|
|
1017
|
-
return 'object';
|
|
1018
|
-
}
|
|
1019
|
-
if (isSymbol(propType, propValue)) {
|
|
1020
|
-
return 'symbol';
|
|
1021
|
-
}
|
|
1022
|
-
return propType;
|
|
1023
|
-
}
|
|
1024
|
-
|
|
1025
|
-
// This handles more types than `getPropType`. Only used for error messages.
|
|
1026
|
-
// See `createPrimitiveTypeChecker`.
|
|
1027
|
-
function getPreciseType(propValue) {
|
|
1028
|
-
if (typeof propValue === 'undefined' || propValue === null) {
|
|
1029
|
-
return '' + propValue;
|
|
1030
|
-
}
|
|
1031
|
-
var propType = getPropType(propValue);
|
|
1032
|
-
if (propType === 'object') {
|
|
1033
|
-
if (propValue instanceof Date) {
|
|
1034
|
-
return 'date';
|
|
1035
|
-
} else if (propValue instanceof RegExp) {
|
|
1036
|
-
return 'regexp';
|
|
1037
|
-
}
|
|
1038
|
-
}
|
|
1039
|
-
return propType;
|
|
1040
|
-
}
|
|
1041
|
-
|
|
1042
|
-
// Returns a string that is postfixed to a warning about an invalid type.
|
|
1043
|
-
// For example, "undefined" or "of type array"
|
|
1044
|
-
function getPostfixForTypeWarning(value) {
|
|
1045
|
-
var type = getPreciseType(value);
|
|
1046
|
-
switch (type) {
|
|
1047
|
-
case 'array':
|
|
1048
|
-
case 'object':
|
|
1049
|
-
return 'an ' + type;
|
|
1050
|
-
case 'boolean':
|
|
1051
|
-
case 'date':
|
|
1052
|
-
case 'regexp':
|
|
1053
|
-
return 'a ' + type;
|
|
1054
|
-
default:
|
|
1055
|
-
return type;
|
|
1056
|
-
}
|
|
1057
|
-
}
|
|
1058
|
-
|
|
1059
|
-
// Returns class name of the object, if any.
|
|
1060
|
-
function getClassName(propValue) {
|
|
1061
|
-
if (!propValue.constructor || !propValue.constructor.name) {
|
|
1062
|
-
return ANONYMOUS;
|
|
1063
|
-
}
|
|
1064
|
-
return propValue.constructor.name;
|
|
1065
|
-
}
|
|
1066
|
-
|
|
1067
|
-
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
1068
|
-
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
1069
|
-
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
1070
|
-
|
|
1071
|
-
return ReactPropTypes;
|
|
1072
|
-
};
|
|
1073
|
-
|
|
1074
1105
|
/**
|
|
1075
1106
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
1076
1107
|
*
|
|
@@ -1078,60 +1109,69 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
1078
1109
|
* LICENSE file in the root directory of this source tree.
|
|
1079
1110
|
*/
|
|
1080
1111
|
|
|
1081
|
-
var
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
function
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1112
|
+
var factoryWithThrowingShims;
|
|
1113
|
+
var hasRequiredFactoryWithThrowingShims;
|
|
1114
|
+
|
|
1115
|
+
function requireFactoryWithThrowingShims () {
|
|
1116
|
+
if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
|
|
1117
|
+
hasRequiredFactoryWithThrowingShims = 1;
|
|
1118
|
+
|
|
1119
|
+
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
1120
|
+
|
|
1121
|
+
function emptyFunction() {}
|
|
1122
|
+
function emptyFunctionWithReset() {}
|
|
1123
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
1124
|
+
|
|
1125
|
+
factoryWithThrowingShims = function() {
|
|
1126
|
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
1127
|
+
if (secret === ReactPropTypesSecret) {
|
|
1128
|
+
// It is still safe when called from React.
|
|
1129
|
+
return;
|
|
1130
|
+
}
|
|
1131
|
+
var err = new Error(
|
|
1132
|
+
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
1133
|
+
'Use PropTypes.checkPropTypes() to call them. ' +
|
|
1134
|
+
'Read more at http://fb.me/use-check-prop-types'
|
|
1135
|
+
);
|
|
1136
|
+
err.name = 'Invariant Violation';
|
|
1137
|
+
throw err;
|
|
1138
|
+
} shim.isRequired = shim;
|
|
1139
|
+
function getShim() {
|
|
1140
|
+
return shim;
|
|
1141
|
+
} // Important!
|
|
1142
|
+
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
1143
|
+
var ReactPropTypes = {
|
|
1144
|
+
array: shim,
|
|
1145
|
+
bigint: shim,
|
|
1146
|
+
bool: shim,
|
|
1147
|
+
func: shim,
|
|
1148
|
+
number: shim,
|
|
1149
|
+
object: shim,
|
|
1150
|
+
string: shim,
|
|
1151
|
+
symbol: shim,
|
|
1152
|
+
|
|
1153
|
+
any: shim,
|
|
1154
|
+
arrayOf: getShim,
|
|
1155
|
+
element: shim,
|
|
1156
|
+
elementType: shim,
|
|
1157
|
+
instanceOf: getShim,
|
|
1158
|
+
node: shim,
|
|
1159
|
+
objectOf: getShim,
|
|
1160
|
+
oneOf: getShim,
|
|
1161
|
+
oneOfType: getShim,
|
|
1162
|
+
shape: getShim,
|
|
1163
|
+
exact: getShim,
|
|
1164
|
+
|
|
1165
|
+
checkPropTypes: emptyFunctionWithReset,
|
|
1166
|
+
resetWarningCache: emptyFunction
|
|
1167
|
+
};
|
|
1168
|
+
|
|
1169
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
1170
|
+
|
|
1171
|
+
return ReactPropTypes;
|
|
1172
|
+
};
|
|
1173
|
+
return factoryWithThrowingShims;
|
|
1174
|
+
}
|
|
1135
1175
|
|
|
1136
1176
|
/**
|
|
1137
1177
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
@@ -1141,20 +1181,18 @@ var factoryWithThrowingShims = function() {
|
|
|
1141
1181
|
*/
|
|
1142
1182
|
|
|
1143
1183
|
if (process.env.NODE_ENV !== 'production') {
|
|
1144
|
-
var ReactIs =
|
|
1184
|
+
var ReactIs = requireReactIs();
|
|
1145
1185
|
|
|
1146
1186
|
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
1147
1187
|
// http://fb.me/prop-types-in-prod
|
|
1148
1188
|
var throwOnDirectAccess = true;
|
|
1149
|
-
propTypes.exports =
|
|
1189
|
+
propTypes.exports = requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
|
|
1150
1190
|
} else {
|
|
1151
1191
|
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
1152
1192
|
// http://fb.me/prop-types-in-prod
|
|
1153
|
-
propTypes.exports =
|
|
1193
|
+
propTypes.exports = requireFactoryWithThrowingShims()();
|
|
1154
1194
|
}
|
|
1155
1195
|
|
|
1156
|
-
var PropTypes = propTypes.exports;
|
|
1157
|
-
|
|
1158
1196
|
var interpolate = function interpolate(y0, y1, x0, x1, x) {
|
|
1159
1197
|
return y0 + (x - x0) * (y1 - y0) / (x1 - x0);
|
|
1160
1198
|
};
|
|
@@ -1329,9 +1367,9 @@ function useTimelinePerspective(_ref) {
|
|
|
1329
1367
|
};
|
|
1330
1368
|
}
|
|
1331
1369
|
|
|
1332
|
-
function ownKeys$
|
|
1370
|
+
function ownKeys$a(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1333
1371
|
|
|
1334
|
-
function _objectSpread$
|
|
1372
|
+
function _objectSpread$a(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$a(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$a(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1335
1373
|
var TimelineContext = /*#__PURE__*/createContext();
|
|
1336
1374
|
function TimelineProvider(_ref) {
|
|
1337
1375
|
var start = _ref.start,
|
|
@@ -1351,7 +1389,7 @@ function TimelineProvider(_ref) {
|
|
|
1351
1389
|
defaultPerspective: defaultPerspective
|
|
1352
1390
|
});
|
|
1353
1391
|
var contextValue = useMemo(function () {
|
|
1354
|
-
return _objectSpread$
|
|
1392
|
+
return _objectSpread$a(_objectSpread$a({}, timelinePerspective), {}, {
|
|
1355
1393
|
start: start,
|
|
1356
1394
|
end: end,
|
|
1357
1395
|
time: time,
|
|
@@ -1368,24 +1406,24 @@ function useTimeline() {
|
|
|
1368
1406
|
return useContext(TimelineContext);
|
|
1369
1407
|
}
|
|
1370
1408
|
TimelineContext.propTypes = {
|
|
1371
|
-
start:
|
|
1372
|
-
end:
|
|
1373
|
-
time:
|
|
1374
|
-
children:
|
|
1375
|
-
onChangeTime:
|
|
1376
|
-
timelineRef:
|
|
1377
|
-
current:
|
|
1409
|
+
start: propTypes.exports.number.isRequired,
|
|
1410
|
+
end: propTypes.exports.number.isRequired,
|
|
1411
|
+
time: propTypes.exports.number,
|
|
1412
|
+
children: propTypes.exports.oneOfType([propTypes.exports.arrayOf(propTypes.exports.element), propTypes.exports.element]),
|
|
1413
|
+
onChangeTime: propTypes.exports.func,
|
|
1414
|
+
timelineRef: propTypes.exports.shape({
|
|
1415
|
+
current: propTypes.exports.instanceOf(Element)
|
|
1378
1416
|
}),
|
|
1379
|
-
perspective:
|
|
1380
|
-
start:
|
|
1381
|
-
end:
|
|
1417
|
+
perspective: propTypes.exports.shape({
|
|
1418
|
+
start: propTypes.exports.number,
|
|
1419
|
+
end: propTypes.exports.number
|
|
1382
1420
|
}),
|
|
1383
|
-
onChangePerspective:
|
|
1384
|
-
defaultPerspective:
|
|
1385
|
-
start:
|
|
1386
|
-
end:
|
|
1421
|
+
onChangePerspective: propTypes.exports.func,
|
|
1422
|
+
defaultPerspective: propTypes.exports.shape({
|
|
1423
|
+
start: propTypes.exports.number,
|
|
1424
|
+
end: propTypes.exports.number
|
|
1387
1425
|
}),
|
|
1388
|
-
zoomMultiplier:
|
|
1426
|
+
zoomMultiplier: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.func])
|
|
1389
1427
|
};
|
|
1390
1428
|
TimelineContext.defaultProps = {
|
|
1391
1429
|
children: undefined,
|
|
@@ -1403,11 +1441,11 @@ var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r
|
|
|
1403
1441
|
var css$7 = ":root {\n --vdt-timeline-palette-primary:#ba67c8;;\n --vdt-timeline-palette-primary-dark: rgb(130, 72, 140);\n --vdt-timeline-palette-secondary:#f50057;\n --vdt-timeline-palette-background-primary:#20232a;\n --vdt-timeline-palette-background-secondary:#282c34;\n --vdt-timeline-palette-background-hover: rgba(255, 255, 255, 0.08);\n --vdt-timeline-palette-text-primary:#fff;\n --vdt-timeline-palette-text-secondary:rgba(255, 255, 255, 0.7);\n}\n\n.VdtTimeline-root {\n display: flex;\n flex-direction: column;\n padding: 0 8px 8px 8px;\n background-color: var(--vdt-timeline-palette-background-primary);\n}";
|
|
1404
1442
|
n(css$7,{});
|
|
1405
1443
|
|
|
1406
|
-
var _excluded$
|
|
1444
|
+
var _excluded$9 = ["start", "end", "time", "onChangeTime", "children", "className", "perspective", "onChangePerspective", "defaultPerspective", "zoomMultiplier"];
|
|
1407
1445
|
|
|
1408
|
-
function ownKeys$
|
|
1446
|
+
function ownKeys$9(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1409
1447
|
|
|
1410
|
-
function _objectSpread$
|
|
1448
|
+
function _objectSpread$9(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$9(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$9(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1411
1449
|
function Timeline(_ref) {
|
|
1412
1450
|
var start = _ref.start,
|
|
1413
1451
|
end = _ref.end,
|
|
@@ -1419,7 +1457,7 @@ function Timeline(_ref) {
|
|
|
1419
1457
|
onChangePerspective = _ref.onChangePerspective,
|
|
1420
1458
|
defaultPerspective = _ref.defaultPerspective,
|
|
1421
1459
|
zoomMultiplier = _ref.zoomMultiplier,
|
|
1422
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
1460
|
+
props = _objectWithoutProperties(_ref, _excluded$9);
|
|
1423
1461
|
|
|
1424
1462
|
var timelineRef = useRef();
|
|
1425
1463
|
return /*#__PURE__*/jsx(TimelineProvider, {
|
|
@@ -1432,7 +1470,7 @@ function Timeline(_ref) {
|
|
|
1432
1470
|
onChangePerspective: onChangePerspective,
|
|
1433
1471
|
defaultPerspective: defaultPerspective,
|
|
1434
1472
|
zoomMultiplier: zoomMultiplier,
|
|
1435
|
-
children: /*#__PURE__*/jsx("div", _objectSpread$
|
|
1473
|
+
children: /*#__PURE__*/jsx("div", _objectSpread$9(_objectSpread$9({
|
|
1436
1474
|
ref: timelineRef,
|
|
1437
1475
|
className: clsx('VdtTimeline-root', className) // eslint-disable-next-line react/jsx-props-no-spreading
|
|
1438
1476
|
|
|
@@ -1445,22 +1483,22 @@ Timeline.propTypes = {
|
|
|
1445
1483
|
/**
|
|
1446
1484
|
* @ignore
|
|
1447
1485
|
*/
|
|
1448
|
-
className:
|
|
1449
|
-
start:
|
|
1450
|
-
end:
|
|
1451
|
-
time:
|
|
1452
|
-
children:
|
|
1453
|
-
onChangeTime:
|
|
1454
|
-
perspective:
|
|
1455
|
-
start:
|
|
1456
|
-
end:
|
|
1486
|
+
className: propTypes.exports.string,
|
|
1487
|
+
start: propTypes.exports.number.isRequired,
|
|
1488
|
+
end: propTypes.exports.number.isRequired,
|
|
1489
|
+
time: propTypes.exports.number,
|
|
1490
|
+
children: propTypes.exports.oneOfType([propTypes.exports.arrayOf(propTypes.exports.node), propTypes.exports.node]),
|
|
1491
|
+
onChangeTime: propTypes.exports.func,
|
|
1492
|
+
perspective: propTypes.exports.shape({
|
|
1493
|
+
start: propTypes.exports.number,
|
|
1494
|
+
end: propTypes.exports.number
|
|
1457
1495
|
}),
|
|
1458
|
-
onChangePerspective:
|
|
1459
|
-
defaultPerspective:
|
|
1460
|
-
start:
|
|
1461
|
-
end:
|
|
1496
|
+
onChangePerspective: propTypes.exports.func,
|
|
1497
|
+
defaultPerspective: propTypes.exports.shape({
|
|
1498
|
+
start: propTypes.exports.number,
|
|
1499
|
+
end: propTypes.exports.number
|
|
1462
1500
|
}),
|
|
1463
|
-
zoomMultiplier:
|
|
1501
|
+
zoomMultiplier: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.func])
|
|
1464
1502
|
};
|
|
1465
1503
|
Timeline.defaultProps = {
|
|
1466
1504
|
className: undefined,
|
|
@@ -1479,15 +1517,15 @@ var DEFAULT_PLAYHEAD_ZINDEX = 100;
|
|
|
1479
1517
|
var css$6 = ":root {\n --vdt-timeline-palette-primary:#ba67c8;;\n --vdt-timeline-palette-primary-dark: rgb(130, 72, 140);\n --vdt-timeline-palette-secondary:#f50057;\n --vdt-timeline-palette-background-primary:#20232a;\n --vdt-timeline-palette-background-secondary:#282c34;\n --vdt-timeline-palette-background-hover: rgba(255, 255, 255, 0.08);\n --vdt-timeline-palette-text-primary:#fff;\n --vdt-timeline-palette-text-secondary:rgba(255, 255, 255, 0.7);\n}\n\n.VdtTimelinePlayhead-root {\n background-color: var(--vdt-timeline-palette-secondary);\n position: absolute;\n}\n\n\n.VdtTimelinePlayhead-root:hover {\n cursor: ew-resize;\n}";
|
|
1480
1518
|
n(css$6,{});
|
|
1481
1519
|
|
|
1482
|
-
var _excluded$
|
|
1520
|
+
var _excluded$8 = ["className", "perspective", "time", "lineWidth", "headWidth", "headHeight", "style", "onDrag", "HeadProps"];
|
|
1483
1521
|
|
|
1484
|
-
function ownKeys$
|
|
1522
|
+
function ownKeys$8(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1485
1523
|
|
|
1486
|
-
function _objectSpread$
|
|
1524
|
+
function _objectSpread$8(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$8(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$8(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1487
1525
|
|
|
1488
|
-
var _getStyleProperties$
|
|
1489
|
-
_getStyleProperties2$
|
|
1490
|
-
paletteSecondary$1 = _getStyleProperties2$
|
|
1526
|
+
var _getStyleProperties$4 = getStyleProperties('--vdt-timeline-palette-secondary'),
|
|
1527
|
+
_getStyleProperties2$4 = _slicedToArray(_getStyleProperties$4, 1),
|
|
1528
|
+
paletteSecondary$1 = _getStyleProperties2$4[0];
|
|
1491
1529
|
|
|
1492
1530
|
function TimelinePlayhead(_ref) {
|
|
1493
1531
|
var _ref$current;
|
|
@@ -1501,7 +1539,7 @@ function TimelinePlayhead(_ref) {
|
|
|
1501
1539
|
style = _ref.style,
|
|
1502
1540
|
onDrag = _ref.onDrag,
|
|
1503
1541
|
HeadProps = _ref.HeadProps,
|
|
1504
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
1542
|
+
props = _objectWithoutProperties(_ref, _excluded$8);
|
|
1505
1543
|
|
|
1506
1544
|
var _ref2 = useTimeline() || {
|
|
1507
1545
|
perspective: propPerspective,
|
|
@@ -1550,10 +1588,10 @@ function TimelinePlayhead(_ref) {
|
|
|
1550
1588
|
return onChangeTime.apply(void 0, args);
|
|
1551
1589
|
};
|
|
1552
1590
|
|
|
1553
|
-
return /*#__PURE__*/jsx("div", _objectSpread$
|
|
1591
|
+
return /*#__PURE__*/jsx("div", _objectSpread$8(_objectSpread$8({
|
|
1554
1592
|
ref: ref,
|
|
1555
1593
|
className: clsx('VdtTimelinePlayhead-root', className),
|
|
1556
|
-
style: _objectSpread$
|
|
1594
|
+
style: _objectSpread$8({
|
|
1557
1595
|
width: lineWidth,
|
|
1558
1596
|
left: markerLeft,
|
|
1559
1597
|
display: hide && 'none',
|
|
@@ -1587,7 +1625,7 @@ function TimelinePlayhead(_ref) {
|
|
|
1587
1625
|
} // eslint-disable-next-line react/jsx-props-no-spreading
|
|
1588
1626
|
|
|
1589
1627
|
}, props), {}, {
|
|
1590
|
-
children: /*#__PURE__*/jsx("div", _objectSpread$
|
|
1628
|
+
children: /*#__PURE__*/jsx("div", _objectSpread$8({
|
|
1591
1629
|
className: "VdtTimelinePlayhead-head",
|
|
1592
1630
|
style: {
|
|
1593
1631
|
position: 'absolute',
|
|
@@ -1606,18 +1644,18 @@ TimelinePlayhead.propTypes = {
|
|
|
1606
1644
|
/**
|
|
1607
1645
|
* @ignore
|
|
1608
1646
|
*/
|
|
1609
|
-
className:
|
|
1610
|
-
style:
|
|
1611
|
-
headHeight:
|
|
1612
|
-
headWidth:
|
|
1613
|
-
lineWidth:
|
|
1614
|
-
perspective:
|
|
1615
|
-
start:
|
|
1616
|
-
end:
|
|
1647
|
+
className: propTypes.exports.string,
|
|
1648
|
+
style: propTypes.exports.instanceOf(Object),
|
|
1649
|
+
headHeight: propTypes.exports.number,
|
|
1650
|
+
headWidth: propTypes.exports.number,
|
|
1651
|
+
lineWidth: propTypes.exports.number,
|
|
1652
|
+
perspective: propTypes.exports.shape({
|
|
1653
|
+
start: propTypes.exports.number,
|
|
1654
|
+
end: propTypes.exports.number
|
|
1617
1655
|
}),
|
|
1618
|
-
time:
|
|
1619
|
-
onDrag:
|
|
1620
|
-
HeadProps:
|
|
1656
|
+
time: propTypes.exports.number,
|
|
1657
|
+
onDrag: propTypes.exports.func,
|
|
1658
|
+
HeadProps: propTypes.exports.instanceOf(Object)
|
|
1621
1659
|
};
|
|
1622
1660
|
TimelinePlayhead.defaultProps = {
|
|
1623
1661
|
className: undefined,
|
|
@@ -1669,23 +1707,23 @@ n(css$5,{});
|
|
|
1669
1707
|
var css$4 = ".VdtTimelineWaveform-root {\n height: 40px;\n}";
|
|
1670
1708
|
n(css$4,{});
|
|
1671
1709
|
|
|
1672
|
-
var _excluded$
|
|
1673
|
-
_excluded2$
|
|
1710
|
+
var _excluded$7 = ["amplitudeSegments", "pxPerTimeUnit", "start", "height"],
|
|
1711
|
+
_excluded2$3 = ["className", "waveform", "start", "end", "perspective", "StageProps", "LayerProps", "RectProps", "WaveRectProps"];
|
|
1674
1712
|
|
|
1675
|
-
function ownKeys$
|
|
1713
|
+
function ownKeys$7(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1676
1714
|
|
|
1677
|
-
function _objectSpread$
|
|
1715
|
+
function _objectSpread$7(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$7(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$7(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1678
1716
|
|
|
1679
|
-
var _getStyleProperties$
|
|
1680
|
-
_getStyleProperties2$
|
|
1681
|
-
palettePrimary = _getStyleProperties2$
|
|
1717
|
+
var _getStyleProperties$3 = getStyleProperties('--vdt-timeline-palette-primary'),
|
|
1718
|
+
_getStyleProperties2$3 = _slicedToArray(_getStyleProperties$3, 1),
|
|
1719
|
+
palettePrimary$1 = _getStyleProperties2$3[0];
|
|
1682
1720
|
|
|
1683
1721
|
var TimelineWaveFormRects = /*#__PURE__*/memo(function (_ref) {
|
|
1684
1722
|
var amplitudeSegments = _ref.amplitudeSegments,
|
|
1685
1723
|
pxPerTimeUnit = _ref.pxPerTimeUnit,
|
|
1686
1724
|
start = _ref.start,
|
|
1687
1725
|
height = _ref.height,
|
|
1688
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
1726
|
+
props = _objectWithoutProperties(_ref, _excluded$7);
|
|
1689
1727
|
|
|
1690
1728
|
return amplitudeSegments.map(function (_ref2, i) {
|
|
1691
1729
|
var amplitude = _ref2.amplitude,
|
|
@@ -1696,12 +1734,12 @@ var TimelineWaveFormRects = /*#__PURE__*/memo(function (_ref) {
|
|
|
1696
1734
|
var rectHeight = height * amplitude;
|
|
1697
1735
|
var centeredY = (height - rectHeight) / 2;
|
|
1698
1736
|
return /*#__PURE__*/jsx(Rect // eslint-disable-next-line react/no-array-index-key
|
|
1699
|
-
, _objectSpread$
|
|
1737
|
+
, _objectSpread$7({
|
|
1700
1738
|
x: rectX,
|
|
1701
1739
|
y: centeredY,
|
|
1702
1740
|
height: rectHeight,
|
|
1703
1741
|
width: rectWidth,
|
|
1704
|
-
fill: palettePrimary // eslint-disable-next-line react/jsx-props-no-spreading
|
|
1742
|
+
fill: palettePrimary$1 // eslint-disable-next-line react/jsx-props-no-spreading
|
|
1705
1743
|
|
|
1706
1744
|
}, props), i);
|
|
1707
1745
|
});
|
|
@@ -1717,7 +1755,7 @@ function TimelineWaveform(_ref3) {
|
|
|
1717
1755
|
LayerProps = _ref3.LayerProps,
|
|
1718
1756
|
RectProps = _ref3.RectProps,
|
|
1719
1757
|
WaveRectProps = _ref3.WaveRectProps,
|
|
1720
|
-
props = _objectWithoutProperties(_ref3, _excluded2$
|
|
1758
|
+
props = _objectWithoutProperties(_ref3, _excluded2$3);
|
|
1721
1759
|
|
|
1722
1760
|
var _ref4 = useTimeline() || {
|
|
1723
1761
|
start: propStart,
|
|
@@ -1752,29 +1790,29 @@ function TimelineWaveform(_ref3) {
|
|
|
1752
1790
|
var pxPerTimeUnit = width / (end - start);
|
|
1753
1791
|
var scaleX = (end - start) / (perspective.end - perspective.start);
|
|
1754
1792
|
var offsetX = interpolate(0, scaleX * width, start, end, perspective.start);
|
|
1755
|
-
return /*#__PURE__*/jsx("div", _objectSpread$
|
|
1793
|
+
return /*#__PURE__*/jsx("div", _objectSpread$7(_objectSpread$7({
|
|
1756
1794
|
ref: ref,
|
|
1757
1795
|
className: clsx('VdtTimelineWaveform-root', className) // eslint-disable-next-line react/jsx-props-no-spreading
|
|
1758
1796
|
|
|
1759
1797
|
}, props), {}, {
|
|
1760
|
-
children: /*#__PURE__*/jsx(Stage, _objectSpread$
|
|
1798
|
+
children: /*#__PURE__*/jsx(Stage, _objectSpread$7(_objectSpread$7({
|
|
1761
1799
|
height: height,
|
|
1762
1800
|
width: width,
|
|
1763
1801
|
x: -offsetX,
|
|
1764
1802
|
scaleX: scaleX // eslint-disable-next-line react/jsx-props-no-spreading
|
|
1765
1803
|
|
|
1766
1804
|
}, StageProps), {}, {
|
|
1767
|
-
children: /*#__PURE__*/jsxs(Layer, _objectSpread$
|
|
1805
|
+
children: /*#__PURE__*/jsxs(Layer, _objectSpread$7(_objectSpread$7({
|
|
1768
1806
|
listening: false // eslint-disable-next-line react/jsx-props-no-spreading
|
|
1769
1807
|
|
|
1770
1808
|
}, LayerProps), {}, {
|
|
1771
|
-
children: [/*#__PURE__*/jsx(Rect, _objectSpread$
|
|
1809
|
+
children: [/*#__PURE__*/jsx(Rect, _objectSpread$7({
|
|
1772
1810
|
x: 0,
|
|
1773
1811
|
y: 0,
|
|
1774
1812
|
width: width,
|
|
1775
1813
|
height: height // eslint-disable-next-line react/jsx-props-no-spreading
|
|
1776
1814
|
|
|
1777
|
-
}, RectProps)), /*#__PURE__*/jsx(TimelineWaveFormRects, _objectSpread$
|
|
1815
|
+
}, RectProps)), /*#__PURE__*/jsx(TimelineWaveFormRects, _objectSpread$7({
|
|
1778
1816
|
amplitudeSegments: amplitudeSegments,
|
|
1779
1817
|
pxPerTimeUnit: pxPerTimeUnit,
|
|
1780
1818
|
start: start,
|
|
@@ -1789,18 +1827,18 @@ TimelineWaveform.propTypes = {
|
|
|
1789
1827
|
/**
|
|
1790
1828
|
* @ignore
|
|
1791
1829
|
*/
|
|
1792
|
-
className:
|
|
1793
|
-
waveform:
|
|
1794
|
-
start:
|
|
1795
|
-
end:
|
|
1796
|
-
perspective:
|
|
1797
|
-
start:
|
|
1798
|
-
end:
|
|
1830
|
+
className: propTypes.exports.string,
|
|
1831
|
+
waveform: propTypes.exports.arrayOf(propTypes.exports.number),
|
|
1832
|
+
start: propTypes.exports.number,
|
|
1833
|
+
end: propTypes.exports.number,
|
|
1834
|
+
perspective: propTypes.exports.shape({
|
|
1835
|
+
start: propTypes.exports.number,
|
|
1836
|
+
end: propTypes.exports.number
|
|
1799
1837
|
}),
|
|
1800
|
-
StageProps:
|
|
1801
|
-
LayerProps:
|
|
1802
|
-
RectProps:
|
|
1803
|
-
WaveRectProps:
|
|
1838
|
+
StageProps: propTypes.exports.instanceOf(Object),
|
|
1839
|
+
LayerProps: propTypes.exports.instanceOf(Object),
|
|
1840
|
+
RectProps: propTypes.exports.instanceOf(Object),
|
|
1841
|
+
WaveRectProps: propTypes.exports.instanceOf(Object)
|
|
1804
1842
|
};
|
|
1805
1843
|
TimelineWaveform.defaultProps = {
|
|
1806
1844
|
className: undefined,
|
|
@@ -1843,6 +1881,212 @@ function useHover() {
|
|
|
1843
1881
|
};
|
|
1844
1882
|
}
|
|
1845
1883
|
|
|
1884
|
+
var _excluded$6 = ["onClick", "x", "width", "y", "height", "padding", "start", "end", "onHover", "onMove", "onMoveStart", "onMoveEnd", "onResize", "onResizeStart", "onResizeEnd"],
|
|
1885
|
+
_excluded2$2 = ["isHovering"],
|
|
1886
|
+
_excluded3 = ["isHovering"];
|
|
1887
|
+
|
|
1888
|
+
function ownKeys$6(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1889
|
+
|
|
1890
|
+
function _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$6(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$6(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1891
|
+
|
|
1892
|
+
var _getStyleProperties$2 = getStyleProperties('--vdt-timeline-palette-primary', '--vdt-timeline-palette-primary-dark'),
|
|
1893
|
+
_getStyleProperties2$2 = _slicedToArray(_getStyleProperties$2, 2),
|
|
1894
|
+
palettePrimary = _getStyleProperties2$2[0],
|
|
1895
|
+
palettePrimaryDark = _getStyleProperties2$2[1];
|
|
1896
|
+
|
|
1897
|
+
var EVENT_RESIZER_THUMB_WIDTH = 5;
|
|
1898
|
+
function TimelineEvent(_ref) {
|
|
1899
|
+
var onClick = _ref.onClick,
|
|
1900
|
+
x = _ref.x,
|
|
1901
|
+
width = _ref.width,
|
|
1902
|
+
y = _ref.y,
|
|
1903
|
+
height = _ref.height,
|
|
1904
|
+
padding = _ref.padding,
|
|
1905
|
+
start = _ref.start,
|
|
1906
|
+
end = _ref.end,
|
|
1907
|
+
onHover = _ref.onHover,
|
|
1908
|
+
onMove = _ref.onMove,
|
|
1909
|
+
onMoveStart = _ref.onMoveStart,
|
|
1910
|
+
onMoveEnd = _ref.onMoveEnd,
|
|
1911
|
+
onResize = _ref.onResize,
|
|
1912
|
+
onResizeStart = _ref.onResizeStart,
|
|
1913
|
+
onResizeEnd = _ref.onResizeEnd,
|
|
1914
|
+
props = _objectWithoutProperties(_ref, _excluded$6);
|
|
1915
|
+
|
|
1916
|
+
if ([x, width, y, height].some(function (v) {
|
|
1917
|
+
return v === undefined;
|
|
1918
|
+
})) {
|
|
1919
|
+
vLog.error('VdtTimelineEvent', "missing 'x', 'width', 'y', or 'height' props. If the component is not used as a direct child of VdtTimelineTrack, 'x', 'width', 'y', or 'height' must be passed explicitly");
|
|
1920
|
+
}
|
|
1921
|
+
|
|
1922
|
+
var eventRef = useRef();
|
|
1923
|
+
|
|
1924
|
+
var _useHover = useHover({
|
|
1925
|
+
hoverEffect: function hoverEffect(e) {
|
|
1926
|
+
if (onHover) onHover(e, true);
|
|
1927
|
+
return function () {
|
|
1928
|
+
if (onHover) onHover(e, false);
|
|
1929
|
+
};
|
|
1930
|
+
}
|
|
1931
|
+
}),
|
|
1932
|
+
isHovering = _useHover.isHovering,
|
|
1933
|
+
hoverProps = _objectWithoutProperties(_useHover, _excluded2$2);
|
|
1934
|
+
|
|
1935
|
+
var _useHover2 = useHover({
|
|
1936
|
+
hoverEffect: function hoverEffect(e) {
|
|
1937
|
+
if (onResize) {
|
|
1938
|
+
e.target.getStage().container().style.cursor = 'col-resize';
|
|
1939
|
+
}
|
|
1940
|
+
|
|
1941
|
+
return function () {
|
|
1942
|
+
if (onResize) {
|
|
1943
|
+
e.target.getStage().container().style.cursor = 'default';
|
|
1944
|
+
}
|
|
1945
|
+
};
|
|
1946
|
+
}
|
|
1947
|
+
}),
|
|
1948
|
+
isHoveringResize = _useHover2.isHovering,
|
|
1949
|
+
resizeHoverProps = _objectWithoutProperties(_useHover2, _excluded3);
|
|
1950
|
+
|
|
1951
|
+
var _useState = useState(false),
|
|
1952
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1953
|
+
isMoving = _useState2[0],
|
|
1954
|
+
setIsMoving = _useState2[1];
|
|
1955
|
+
|
|
1956
|
+
var hasOnClick = !!onClick;
|
|
1957
|
+
useEffect(function () {
|
|
1958
|
+
if (eventRef.current) {
|
|
1959
|
+
var cursor = function () {
|
|
1960
|
+
if (isMoving) return 'grabbing';
|
|
1961
|
+
if (isHovering && hasOnClick) return 'pointer';
|
|
1962
|
+
return 'default';
|
|
1963
|
+
}();
|
|
1964
|
+
|
|
1965
|
+
eventRef.current.getStage().container().style.cursor = cursor;
|
|
1966
|
+
}
|
|
1967
|
+
}, [isMoving, isHovering, hasOnClick]);
|
|
1968
|
+
var paddedY = y + padding;
|
|
1969
|
+
var paddedHeight = height - 2 * padding;
|
|
1970
|
+
var posProps = {
|
|
1971
|
+
y: paddedY,
|
|
1972
|
+
height: paddedHeight,
|
|
1973
|
+
x: x,
|
|
1974
|
+
width: width
|
|
1975
|
+
};
|
|
1976
|
+
var defaultHoverProps = isHovering || isHoveringResize ? {
|
|
1977
|
+
fill: palettePrimaryDark
|
|
1978
|
+
} : {};
|
|
1979
|
+
|
|
1980
|
+
var resizerProps = function resizerProps(which) {
|
|
1981
|
+
var resizerX = which === 'start' ? x : x + width - EVENT_RESIZER_THUMB_WIDTH;
|
|
1982
|
+
return {
|
|
1983
|
+
onDragStart: function onDragStart() {
|
|
1984
|
+
if (!onResizeStart) return;
|
|
1985
|
+
onResizeStart(which);
|
|
1986
|
+
},
|
|
1987
|
+
draggable: !!onResize,
|
|
1988
|
+
dragBoundFunc: function dragBoundFunc(pos) {
|
|
1989
|
+
return {
|
|
1990
|
+
x: pos.x,
|
|
1991
|
+
y: paddedY
|
|
1992
|
+
};
|
|
1993
|
+
},
|
|
1994
|
+
onDragEnd: function onDragEnd() {
|
|
1995
|
+
if (!onResizeEnd) return;
|
|
1996
|
+
onResizeEnd(which);
|
|
1997
|
+
},
|
|
1998
|
+
width: EVENT_RESIZER_THUMB_WIDTH,
|
|
1999
|
+
x: resizerX,
|
|
2000
|
+
onDragMove: function onDragMove(e) {
|
|
2001
|
+
if (!onResize) return;
|
|
2002
|
+
|
|
2003
|
+
var _e$target$position = e.target.position(),
|
|
2004
|
+
newX = _e$target$position.x;
|
|
2005
|
+
|
|
2006
|
+
e.target.x(resizerX);
|
|
2007
|
+
var newPos = Math.floor(interpolate(start, end, x, x + width, newX + (which === 'start' ? 0 : EVENT_RESIZER_THUMB_WIDTH)));
|
|
2008
|
+
onResize(e, which, newPos);
|
|
2009
|
+
}
|
|
2010
|
+
};
|
|
2011
|
+
};
|
|
2012
|
+
|
|
2013
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
2014
|
+
children: [/*#__PURE__*/jsx(Rect, _objectSpread$6(_objectSpread$6(_objectSpread$6(_objectSpread$6({
|
|
2015
|
+
ref: eventRef,
|
|
2016
|
+
draggable: !!onMove,
|
|
2017
|
+
dragBoundFunc: function dragBoundFunc(pos) {
|
|
2018
|
+
return {
|
|
2019
|
+
x: pos.x,
|
|
2020
|
+
y: paddedY
|
|
2021
|
+
};
|
|
2022
|
+
},
|
|
2023
|
+
onDragStart: function onDragStart(e) {
|
|
2024
|
+
if (!onMove) return;
|
|
2025
|
+
setIsMoving(true);
|
|
2026
|
+
|
|
2027
|
+
if (onMoveStart) {
|
|
2028
|
+
onMoveStart(e);
|
|
2029
|
+
}
|
|
2030
|
+
},
|
|
2031
|
+
onDragEnd: function onDragEnd(e) {
|
|
2032
|
+
if (!onMove) return;
|
|
2033
|
+
setIsMoving(false);
|
|
2034
|
+
|
|
2035
|
+
if (onMoveEnd) {
|
|
2036
|
+
onMoveEnd(e);
|
|
2037
|
+
}
|
|
2038
|
+
},
|
|
2039
|
+
onDragMove: function onDragMove(e) {
|
|
2040
|
+
if (!onMove) return;
|
|
2041
|
+
|
|
2042
|
+
var _e$target$position2 = e.target.position(),
|
|
2043
|
+
newX = _e$target$position2.x;
|
|
2044
|
+
|
|
2045
|
+
e.target.x(x);
|
|
2046
|
+
var newStart = Math.floor(interpolate(start, end, x, x + width, newX));
|
|
2047
|
+
onMove(e, newStart);
|
|
2048
|
+
},
|
|
2049
|
+
fill: palettePrimary,
|
|
2050
|
+
onClick: onClick // eslint-disable-next-line react/jsx-props-no-spreading
|
|
2051
|
+
|
|
2052
|
+
}, posProps), defaultHoverProps), hoverProps), props)), /*#__PURE__*/jsx(Rect // eslint-disable-next-line react/jsx-props-no-spreading
|
|
2053
|
+
, _objectSpread$6(_objectSpread$6(_objectSpread$6({}, posProps), resizeHoverProps), resizerProps('start'))), /*#__PURE__*/jsx(Rect // eslint-disable-next-line react/jsx-props-no-spreading
|
|
2054
|
+
, _objectSpread$6(_objectSpread$6(_objectSpread$6({}, posProps), resizeHoverProps), resizerProps('end')))]
|
|
2055
|
+
});
|
|
2056
|
+
}
|
|
2057
|
+
TimelineEvent.propTypes = {
|
|
2058
|
+
onClick: propTypes.exports.func,
|
|
2059
|
+
onHover: propTypes.exports.func,
|
|
2060
|
+
onMove: propTypes.exports.func,
|
|
2061
|
+
onMoveStart: propTypes.exports.func,
|
|
2062
|
+
onMoveEnd: propTypes.exports.func,
|
|
2063
|
+
onResize: propTypes.exports.func,
|
|
2064
|
+
onResizeStart: propTypes.exports.func,
|
|
2065
|
+
onResizeEnd: propTypes.exports.func,
|
|
2066
|
+
x: propTypes.exports.number,
|
|
2067
|
+
width: propTypes.exports.number,
|
|
2068
|
+
y: propTypes.exports.number,
|
|
2069
|
+
height: propTypes.exports.number,
|
|
2070
|
+
padding: propTypes.exports.number,
|
|
2071
|
+
start: propTypes.exports.number.isRequired,
|
|
2072
|
+
end: propTypes.exports.number.isRequired
|
|
2073
|
+
};
|
|
2074
|
+
TimelineEvent.defaultProps = {
|
|
2075
|
+
onClick: undefined,
|
|
2076
|
+
onHover: undefined,
|
|
2077
|
+
onMove: undefined,
|
|
2078
|
+
onMoveStart: undefined,
|
|
2079
|
+
onMoveEnd: undefined,
|
|
2080
|
+
onResize: undefined,
|
|
2081
|
+
onResizeStart: undefined,
|
|
2082
|
+
onResizeEnd: undefined,
|
|
2083
|
+
x: undefined,
|
|
2084
|
+
width: undefined,
|
|
2085
|
+
y: 0,
|
|
2086
|
+
height: DEFAULT_EVENT_HEIGHT,
|
|
2087
|
+
padding: 1
|
|
2088
|
+
};
|
|
2089
|
+
|
|
1846
2090
|
var _excluded$5 = ["className", "children", "perspective", "onClick", "style", "onHover", "StageProps", "LayerProps", "GroupProps", "RectProps"],
|
|
1847
2091
|
_excluded2$1 = ["isHovering"];
|
|
1848
2092
|
|
|
@@ -1972,8 +2216,8 @@ TimelineTrack.propTypes = {
|
|
|
1972
2216
|
/**
|
|
1973
2217
|
* @ignore
|
|
1974
2218
|
*/
|
|
1975
|
-
className:
|
|
1976
|
-
style:
|
|
2219
|
+
className: propTypes.exports.string,
|
|
2220
|
+
style: propTypes.exports.instanceOf(Object),
|
|
1977
2221
|
|
|
1978
2222
|
/**
|
|
1979
2223
|
* children are positioned within the track according to 'start' and 'end' props passed to them
|
|
@@ -1994,16 +2238,16 @@ TimelineTrack.propTypes = {
|
|
|
1994
2238
|
});
|
|
1995
2239
|
return err;
|
|
1996
2240
|
},
|
|
1997
|
-
perspective:
|
|
1998
|
-
start:
|
|
1999
|
-
end:
|
|
2241
|
+
perspective: propTypes.exports.shape({
|
|
2242
|
+
start: propTypes.exports.number,
|
|
2243
|
+
end: propTypes.exports.number
|
|
2000
2244
|
}),
|
|
2001
|
-
onClick:
|
|
2002
|
-
onHover:
|
|
2003
|
-
StageProps:
|
|
2004
|
-
LayerProps:
|
|
2005
|
-
GroupProps:
|
|
2006
|
-
RectProps:
|
|
2245
|
+
onClick: propTypes.exports.func,
|
|
2246
|
+
onHover: propTypes.exports.func,
|
|
2247
|
+
StageProps: propTypes.exports.instanceOf(Object),
|
|
2248
|
+
LayerProps: propTypes.exports.instanceOf(Object),
|
|
2249
|
+
GroupProps: propTypes.exports.instanceOf(Object),
|
|
2250
|
+
RectProps: propTypes.exports.instanceOf(Object)
|
|
2007
2251
|
};
|
|
2008
2252
|
TimelineTrack.defaultProps = {
|
|
2009
2253
|
className: undefined,
|
|
@@ -2057,11 +2301,11 @@ TimelineRow.propTypes = {
|
|
|
2057
2301
|
/**
|
|
2058
2302
|
* @ignore
|
|
2059
2303
|
*/
|
|
2060
|
-
className:
|
|
2061
|
-
children:
|
|
2062
|
-
label:
|
|
2063
|
-
LabelProps:
|
|
2064
|
-
LabelTextProps:
|
|
2304
|
+
className: propTypes.exports.string,
|
|
2305
|
+
children: propTypes.exports.oneOfType([propTypes.exports.arrayOf(propTypes.exports.node), propTypes.exports.node]),
|
|
2306
|
+
label: propTypes.exports.node,
|
|
2307
|
+
LabelProps: propTypes.exports.instanceOf(Object),
|
|
2308
|
+
LabelTextProps: propTypes.exports.instanceOf(Object)
|
|
2065
2309
|
};
|
|
2066
2310
|
TimelineRow.defaultProps = {
|
|
2067
2311
|
className: undefined,
|
|
@@ -2393,32 +2637,32 @@ TimelinePlayheadTrack.propTypes = {
|
|
|
2393
2637
|
/**
|
|
2394
2638
|
* @ignore
|
|
2395
2639
|
*/
|
|
2396
|
-
className:
|
|
2397
|
-
onClick:
|
|
2398
|
-
onHover:
|
|
2399
|
-
ticks:
|
|
2400
|
-
time:
|
|
2401
|
-
label:
|
|
2402
|
-
})),
|
|
2403
|
-
onWheel:
|
|
2404
|
-
onDrag:
|
|
2405
|
-
children:
|
|
2406
|
-
start:
|
|
2407
|
-
end:
|
|
2408
|
-
perspective:
|
|
2409
|
-
start:
|
|
2410
|
-
end:
|
|
2640
|
+
className: propTypes.exports.string,
|
|
2641
|
+
onClick: propTypes.exports.func,
|
|
2642
|
+
onHover: propTypes.exports.func,
|
|
2643
|
+
ticks: propTypes.exports.oneOfType([propTypes.exports.arrayOf(propTypes.exports.shape({
|
|
2644
|
+
time: propTypes.exports.number,
|
|
2645
|
+
label: propTypes.exports.string
|
|
2646
|
+
})), propTypes.exports.func]),
|
|
2647
|
+
onWheel: propTypes.exports.func,
|
|
2648
|
+
onDrag: propTypes.exports.func,
|
|
2649
|
+
children: propTypes.exports.oneOfType([propTypes.exports.arrayOf(propTypes.exports.node), propTypes.exports.node]),
|
|
2650
|
+
start: propTypes.exports.number,
|
|
2651
|
+
end: propTypes.exports.number,
|
|
2652
|
+
perspective: propTypes.exports.shape({
|
|
2653
|
+
start: propTypes.exports.number,
|
|
2654
|
+
end: propTypes.exports.number
|
|
2411
2655
|
}),
|
|
2412
|
-
timelineRef:
|
|
2413
|
-
current:
|
|
2656
|
+
timelineRef: propTypes.exports.shape({
|
|
2657
|
+
current: propTypes.exports.instanceOf(Element)
|
|
2414
2658
|
}),
|
|
2415
|
-
StageProps:
|
|
2416
|
-
LayerProps:
|
|
2417
|
-
GroupProps:
|
|
2418
|
-
RectProps:
|
|
2419
|
-
TickGroupProps:
|
|
2420
|
-
TickTextProps:
|
|
2421
|
-
TickLineProps:
|
|
2659
|
+
StageProps: propTypes.exports.instanceOf(Object),
|
|
2660
|
+
LayerProps: propTypes.exports.instanceOf(Object),
|
|
2661
|
+
GroupProps: propTypes.exports.instanceOf(Object),
|
|
2662
|
+
RectProps: propTypes.exports.instanceOf(Object),
|
|
2663
|
+
TickGroupProps: propTypes.exports.instanceOf(Object),
|
|
2664
|
+
TickTextProps: propTypes.exports.instanceOf(Object),
|
|
2665
|
+
TickLineProps: propTypes.exports.instanceOf(Object)
|
|
2422
2666
|
};
|
|
2423
2667
|
TimelinePlayheadTrack.defaultProps = {
|
|
2424
2668
|
className: undefined,
|
|
@@ -2642,19 +2886,19 @@ TimelineScroll.propTypes = {
|
|
|
2642
2886
|
/**
|
|
2643
2887
|
* @ignore
|
|
2644
2888
|
*/
|
|
2645
|
-
className:
|
|
2646
|
-
onScroll:
|
|
2647
|
-
onClick:
|
|
2648
|
-
start:
|
|
2649
|
-
end:
|
|
2650
|
-
perspective:
|
|
2651
|
-
start:
|
|
2652
|
-
end:
|
|
2889
|
+
className: propTypes.exports.string,
|
|
2890
|
+
onScroll: propTypes.exports.func,
|
|
2891
|
+
onClick: propTypes.exports.func,
|
|
2892
|
+
start: propTypes.exports.number,
|
|
2893
|
+
end: propTypes.exports.number,
|
|
2894
|
+
perspective: propTypes.exports.shape({
|
|
2895
|
+
start: propTypes.exports.number,
|
|
2896
|
+
end: propTypes.exports.number
|
|
2653
2897
|
}),
|
|
2654
|
-
style:
|
|
2655
|
-
StageProps:
|
|
2656
|
-
LayerProps:
|
|
2657
|
-
RectProps:
|
|
2898
|
+
style: propTypes.exports.instanceOf(Object),
|
|
2899
|
+
StageProps: propTypes.exports.instanceOf(Object),
|
|
2900
|
+
LayerProps: propTypes.exports.instanceOf(Object),
|
|
2901
|
+
RectProps: propTypes.exports.instanceOf(Object)
|
|
2658
2902
|
};
|
|
2659
2903
|
TimelineScroll.defaultProps = {
|
|
2660
2904
|
className: undefined,
|
|
@@ -2735,11 +2979,11 @@ TimelineScrollContainer.propTypes = {
|
|
|
2735
2979
|
/**
|
|
2736
2980
|
* @ignore
|
|
2737
2981
|
*/
|
|
2738
|
-
className:
|
|
2739
|
-
children:
|
|
2740
|
-
getScrollDistance:
|
|
2741
|
-
RowProps:
|
|
2742
|
-
ScrollProps:
|
|
2982
|
+
className: propTypes.exports.string,
|
|
2983
|
+
children: propTypes.exports.oneOfType([propTypes.exports.arrayOf(propTypes.exports.node), propTypes.exports.node]),
|
|
2984
|
+
getScrollDistance: propTypes.exports.func,
|
|
2985
|
+
RowProps: propTypes.exports.instanceOf(Object),
|
|
2986
|
+
ScrollProps: propTypes.exports.instanceOf(Object)
|
|
2743
2987
|
};
|
|
2744
2988
|
TimelineScrollContainer.defaultProps = {
|
|
2745
2989
|
className: undefined,
|
|
@@ -2749,4 +2993,4 @@ TimelineScrollContainer.defaultProps = {
|
|
|
2749
2993
|
ScrollProps: {}
|
|
2750
2994
|
};
|
|
2751
2995
|
|
|
2752
|
-
export { Timeline, TimelineContext, TimelinePlayhead, TimelinePlayheadTrack, TimelineProvider, TimelineRow, TimelineScroll, TimelineScrollContainer, TimelineTrack, TimelineWaveform, getStackOverlappingEventProps, useTimeline };
|
|
2996
|
+
export { Timeline, TimelineContext, TimelineEvent, TimelinePlayhead, TimelinePlayheadTrack, TimelineProvider, TimelineRow, TimelineScroll, TimelineScrollContainer, TimelineTrack, TimelineWaveform, getStackOverlappingEventProps, useTimeline };
|