react-side-sheet-pro 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -2
- package/dist/index.css +111 -111
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.d.ts +1 -1
- package/dist/index.esm.js +1203 -901
- package/dist/index.js +1203 -901
- package/dist/index.umd.d.ts +1 -1
- package/dist/index.umd.js +1203 -901
- package/dist/index.umd.min.d.ts +1 -1
- package/dist/index.umd.min.js +5 -5
- package/package.json +3 -3
- package/src/components/SideSheetProvider.tsx +2 -2
- package/dist/index.html +0 -102
package/dist/index.js
CHANGED
|
@@ -98,16 +98,16 @@ function HiX(props) {
|
|
|
98
98
|
})(props);
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
var SideSheetHeader = React__default.memo(function (
|
|
102
|
-
var title =
|
|
103
|
-
onClose =
|
|
104
|
-
actions =
|
|
105
|
-
return React__default.createElement("header", {
|
|
101
|
+
var SideSheetHeader = /*#__PURE__*/React__default.memo(function (_ref) {
|
|
102
|
+
var title = _ref.title,
|
|
103
|
+
onClose = _ref.onClose,
|
|
104
|
+
actions = _ref.actions;
|
|
105
|
+
return /*#__PURE__*/React__default.createElement("header", {
|
|
106
106
|
className: "sidesheet-header"
|
|
107
|
-
}, onClose && React__default.createElement("button", {
|
|
107
|
+
}, onClose && (/*#__PURE__*/React__default.createElement("button", {
|
|
108
108
|
className: "sidesheet-header-close sidesheet-header-btn",
|
|
109
109
|
onClick: onClose
|
|
110
|
-
}, React__default.createElement(HiX, null)), React__default.createElement("div", {
|
|
110
|
+
}, /*#__PURE__*/React__default.createElement(HiX, null))), /*#__PURE__*/React__default.createElement("div", {
|
|
111
111
|
className: "sidesheet-header-title"
|
|
112
112
|
}, title), actions);
|
|
113
113
|
});
|
|
@@ -117,13 +117,12 @@ function createCommonjsModule(fn, module) {
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
var classnames = createCommonjsModule(function (module) {
|
|
120
|
-
/*!
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
120
|
+
/*!
|
|
121
|
+
Copyright (c) 2018 Jed Watson.
|
|
122
|
+
Licensed under the MIT License (MIT), see
|
|
123
|
+
http://jedwatson.github.io/classnames
|
|
124
124
|
*/
|
|
125
125
|
/* global define */
|
|
126
|
-
|
|
127
126
|
(function () {
|
|
128
127
|
|
|
129
128
|
var hasOwn = {}.hasOwnProperty;
|
|
@@ -176,168 +175,467 @@ var classnames = createCommonjsModule(function (module) {
|
|
|
176
175
|
})();
|
|
177
176
|
});
|
|
178
177
|
|
|
179
|
-
var SideSheetContent = function (
|
|
180
|
-
var children =
|
|
181
|
-
className =
|
|
182
|
-
return React__default.createElement("section", {
|
|
178
|
+
var SideSheetContent = function SideSheetContent(_ref) {
|
|
179
|
+
var children = _ref.children,
|
|
180
|
+
className = _ref.className;
|
|
181
|
+
return /*#__PURE__*/React__default.createElement("section", {
|
|
183
182
|
className: classnames('sidesheet-content', className)
|
|
184
183
|
}, children);
|
|
185
184
|
};
|
|
186
185
|
|
|
187
|
-
var SideSheetFooter = function (
|
|
188
|
-
var children =
|
|
189
|
-
className =
|
|
190
|
-
return React__default.createElement("footer", {
|
|
186
|
+
var SideSheetFooter = function SideSheetFooter(_ref) {
|
|
187
|
+
var children = _ref.children,
|
|
188
|
+
className = _ref.className;
|
|
189
|
+
return /*#__PURE__*/React__default.createElement("footer", {
|
|
191
190
|
className: classnames('sidesheet-footer', className)
|
|
192
191
|
}, children);
|
|
193
192
|
};
|
|
194
193
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
function
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
194
|
+
function _arrayLikeToArray(r, a) {
|
|
195
|
+
(null == a || a > r.length) && (a = r.length);
|
|
196
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
197
|
+
return n;
|
|
198
|
+
}
|
|
199
|
+
function _arrayWithHoles(r) {
|
|
200
|
+
if (Array.isArray(r)) return r;
|
|
201
|
+
}
|
|
202
|
+
function _arrayWithoutHoles(r) {
|
|
203
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
204
|
+
}
|
|
205
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
206
|
+
try {
|
|
207
|
+
var i = n[a](c),
|
|
208
|
+
u = i.value;
|
|
209
|
+
} catch (n) {
|
|
210
|
+
return void e(n);
|
|
211
|
+
}
|
|
212
|
+
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
213
|
+
}
|
|
214
|
+
function _asyncToGenerator(n) {
|
|
215
|
+
return function () {
|
|
216
|
+
var t = this,
|
|
217
|
+
e = arguments;
|
|
218
|
+
return new Promise(function (r, o) {
|
|
219
|
+
var a = n.apply(t, e);
|
|
220
|
+
function _next(n) {
|
|
221
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
222
|
+
}
|
|
223
|
+
function _throw(n) {
|
|
224
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
225
|
+
}
|
|
226
|
+
_next(void 0);
|
|
223
227
|
});
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
function _createForOfIteratorHelper(r, e) {
|
|
231
|
+
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
232
|
+
if (!t) {
|
|
233
|
+
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
|
|
234
|
+
t && (r = t);
|
|
235
|
+
var n = 0,
|
|
236
|
+
F = function () {};
|
|
237
|
+
return {
|
|
238
|
+
s: F,
|
|
239
|
+
n: function () {
|
|
240
|
+
return n >= r.length ? {
|
|
241
|
+
done: !0
|
|
242
|
+
} : {
|
|
243
|
+
done: !1,
|
|
244
|
+
value: r[n++]
|
|
245
|
+
};
|
|
246
|
+
},
|
|
247
|
+
e: function (r) {
|
|
248
|
+
throw r;
|
|
249
|
+
},
|
|
250
|
+
f: F
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
224
254
|
}
|
|
225
|
-
|
|
226
|
-
|
|
255
|
+
var o,
|
|
256
|
+
a = !0,
|
|
257
|
+
u = !1;
|
|
258
|
+
return {
|
|
259
|
+
s: function () {
|
|
260
|
+
t = t.call(r);
|
|
261
|
+
},
|
|
262
|
+
n: function () {
|
|
263
|
+
var r = t.next();
|
|
264
|
+
return a = r.done, r;
|
|
265
|
+
},
|
|
266
|
+
e: function (r) {
|
|
267
|
+
u = !0, o = r;
|
|
268
|
+
},
|
|
269
|
+
f: function () {
|
|
227
270
|
try {
|
|
228
|
-
|
|
229
|
-
}
|
|
230
|
-
|
|
271
|
+
a || null == t.return || t.return();
|
|
272
|
+
} finally {
|
|
273
|
+
if (u) throw o;
|
|
231
274
|
}
|
|
232
275
|
}
|
|
233
|
-
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
function _defineProperty(e, r, t) {
|
|
279
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
280
|
+
value: t,
|
|
281
|
+
enumerable: !0,
|
|
282
|
+
configurable: !0,
|
|
283
|
+
writable: !0
|
|
284
|
+
}) : e[r] = t, e;
|
|
285
|
+
}
|
|
286
|
+
function _iterableToArray(r) {
|
|
287
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
288
|
+
}
|
|
289
|
+
function _iterableToArrayLimit(r, l) {
|
|
290
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
291
|
+
if (null != t) {
|
|
292
|
+
var e,
|
|
293
|
+
n,
|
|
294
|
+
i,
|
|
295
|
+
u,
|
|
296
|
+
a = [],
|
|
297
|
+
f = !0,
|
|
298
|
+
o = !1;
|
|
299
|
+
try {
|
|
300
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
301
|
+
if (Object(t) !== t) return;
|
|
302
|
+
f = !1;
|
|
303
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
304
|
+
} catch (r) {
|
|
305
|
+
o = !0, n = r;
|
|
306
|
+
} finally {
|
|
234
307
|
try {
|
|
235
|
-
|
|
236
|
-
}
|
|
237
|
-
|
|
308
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
309
|
+
} finally {
|
|
310
|
+
if (o) throw n;
|
|
238
311
|
}
|
|
239
312
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
}
|
|
243
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
244
|
-
});
|
|
313
|
+
return a;
|
|
314
|
+
}
|
|
245
315
|
}
|
|
246
|
-
function
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
t,
|
|
259
|
-
|
|
260
|
-
return
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
316
|
+
function _nonIterableRest() {
|
|
317
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
318
|
+
}
|
|
319
|
+
function _nonIterableSpread() {
|
|
320
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
321
|
+
}
|
|
322
|
+
function ownKeys(e, r) {
|
|
323
|
+
var t = Object.keys(e);
|
|
324
|
+
if (Object.getOwnPropertySymbols) {
|
|
325
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
326
|
+
r && (o = o.filter(function (r) {
|
|
327
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
328
|
+
})), t.push.apply(t, o);
|
|
329
|
+
}
|
|
330
|
+
return t;
|
|
331
|
+
}
|
|
332
|
+
function _objectSpread2(e) {
|
|
333
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
334
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
335
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
336
|
+
_defineProperty(e, r, t[r]);
|
|
337
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
338
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
return e;
|
|
342
|
+
}
|
|
343
|
+
function _regeneratorRuntime() {
|
|
344
|
+
_regeneratorRuntime = function () {
|
|
345
|
+
return r;
|
|
346
|
+
};
|
|
347
|
+
var t,
|
|
348
|
+
r = {},
|
|
349
|
+
e = Object.prototype,
|
|
350
|
+
n = e.hasOwnProperty,
|
|
351
|
+
o = "function" == typeof Symbol ? Symbol : {},
|
|
352
|
+
i = o.iterator || "@@iterator",
|
|
353
|
+
a = o.asyncIterator || "@@asyncIterator",
|
|
354
|
+
u = o.toStringTag || "@@toStringTag";
|
|
355
|
+
function c(t, r, e, n) {
|
|
356
|
+
return Object.defineProperty(t, r, {
|
|
357
|
+
value: e,
|
|
358
|
+
enumerable: !n,
|
|
359
|
+
configurable: !n,
|
|
360
|
+
writable: !n
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
try {
|
|
364
|
+
c({}, "");
|
|
365
|
+
} catch (t) {
|
|
366
|
+
c = function (t, r, e) {
|
|
367
|
+
return t[r] = e;
|
|
266
368
|
};
|
|
267
369
|
}
|
|
268
|
-
function
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
break;
|
|
278
|
-
case 4:
|
|
279
|
-
_.label++;
|
|
370
|
+
function h(r, e, n, o) {
|
|
371
|
+
var i = e && e.prototype instanceof Generator ? e : Generator,
|
|
372
|
+
a = Object.create(i.prototype);
|
|
373
|
+
return c(a, "_invoke", function (r, e, n) {
|
|
374
|
+
var o = 1;
|
|
375
|
+
return function (i, a) {
|
|
376
|
+
if (3 === o) throw Error("Generator is already running");
|
|
377
|
+
if (4 === o) {
|
|
378
|
+
if ("throw" === i) throw a;
|
|
280
379
|
return {
|
|
281
|
-
value:
|
|
282
|
-
done:
|
|
380
|
+
value: t,
|
|
381
|
+
done: !0
|
|
283
382
|
};
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
default:
|
|
294
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
295
|
-
_ = 0;
|
|
296
|
-
continue;
|
|
297
|
-
}
|
|
298
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
299
|
-
_.label = op[1];
|
|
300
|
-
break;
|
|
301
|
-
}
|
|
302
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
303
|
-
_.label = t[1];
|
|
304
|
-
t = op;
|
|
305
|
-
break;
|
|
383
|
+
}
|
|
384
|
+
for (n.method = i, n.arg = a;;) {
|
|
385
|
+
var u = n.delegate;
|
|
386
|
+
if (u) {
|
|
387
|
+
var c = d(u, n);
|
|
388
|
+
if (c) {
|
|
389
|
+
if (c === f) continue;
|
|
390
|
+
return c;
|
|
391
|
+
}
|
|
306
392
|
}
|
|
307
|
-
if (
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
393
|
+
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
394
|
+
if (1 === o) throw o = 4, n.arg;
|
|
395
|
+
n.dispatchException(n.arg);
|
|
396
|
+
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
397
|
+
o = 3;
|
|
398
|
+
var h = s(r, e, n);
|
|
399
|
+
if ("normal" === h.type) {
|
|
400
|
+
if (o = n.done ? 4 : 2, h.arg === f) continue;
|
|
401
|
+
return {
|
|
402
|
+
value: h.arg,
|
|
403
|
+
done: n.done
|
|
404
|
+
};
|
|
311
405
|
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
406
|
+
"throw" === h.type && (o = 4, n.method = "throw", n.arg = h.arg);
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
}(r, n, new Context(o || [])), !0), a;
|
|
410
|
+
}
|
|
411
|
+
function s(t, r, e) {
|
|
412
|
+
try {
|
|
413
|
+
return {
|
|
414
|
+
type: "normal",
|
|
415
|
+
arg: t.call(r, e)
|
|
416
|
+
};
|
|
417
|
+
} catch (t) {
|
|
418
|
+
return {
|
|
419
|
+
type: "throw",
|
|
420
|
+
arg: t
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
r.wrap = h;
|
|
425
|
+
var f = {};
|
|
426
|
+
function Generator() {}
|
|
427
|
+
function GeneratorFunction() {}
|
|
428
|
+
function GeneratorFunctionPrototype() {}
|
|
429
|
+
var l = {};
|
|
430
|
+
c(l, i, function () {
|
|
431
|
+
return this;
|
|
432
|
+
});
|
|
433
|
+
var p = Object.getPrototypeOf,
|
|
434
|
+
y = p && p(p(x([])));
|
|
435
|
+
y && y !== e && n.call(y, i) && (l = y);
|
|
436
|
+
var v = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(l);
|
|
437
|
+
function g(t) {
|
|
438
|
+
["next", "throw", "return"].forEach(function (r) {
|
|
439
|
+
c(t, r, function (t) {
|
|
440
|
+
return this._invoke(r, t);
|
|
441
|
+
});
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
function AsyncIterator(t, r) {
|
|
445
|
+
function e(o, i, a, u) {
|
|
446
|
+
var c = s(t[o], t, i);
|
|
447
|
+
if ("throw" !== c.type) {
|
|
448
|
+
var h = c.arg,
|
|
449
|
+
f = h.value;
|
|
450
|
+
return f && "object" == typeof f && n.call(f, "__await") ? r.resolve(f.__await).then(function (t) {
|
|
451
|
+
e("next", t, a, u);
|
|
452
|
+
}, function (t) {
|
|
453
|
+
e("throw", t, a, u);
|
|
454
|
+
}) : r.resolve(f).then(function (t) {
|
|
455
|
+
h.value = t, a(h);
|
|
456
|
+
}, function (t) {
|
|
457
|
+
return e("throw", t, a, u);
|
|
458
|
+
});
|
|
459
|
+
}
|
|
460
|
+
u(c.arg);
|
|
461
|
+
}
|
|
462
|
+
var o;
|
|
463
|
+
c(this, "_invoke", function (t, n) {
|
|
464
|
+
function i() {
|
|
465
|
+
return new r(function (r, o) {
|
|
466
|
+
e(t, n, r, o);
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
return o = o ? o.then(i, i) : i();
|
|
470
|
+
}, !0);
|
|
471
|
+
}
|
|
472
|
+
function d(r, e) {
|
|
473
|
+
var n = e.method,
|
|
474
|
+
o = r.i[n];
|
|
475
|
+
if (o === t) return e.delegate = null, "throw" === n && r.i.return && (e.method = "return", e.arg = t, d(r, e), "throw" === e.method) || "return" !== n && (e.method = "throw", e.arg = new TypeError("The iterator does not provide a '" + n + "' method")), f;
|
|
476
|
+
var i = s(o, r.i, e.arg);
|
|
477
|
+
if ("throw" === i.type) return e.method = "throw", e.arg = i.arg, e.delegate = null, f;
|
|
478
|
+
var a = i.arg;
|
|
479
|
+
return a ? a.done ? (e[r.r] = a.value, e.next = r.n, "return" !== e.method && (e.method = "next", e.arg = t), e.delegate = null, f) : a : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, f);
|
|
480
|
+
}
|
|
481
|
+
function w(t) {
|
|
482
|
+
this.tryEntries.push(t);
|
|
483
|
+
}
|
|
484
|
+
function m(r) {
|
|
485
|
+
var e = r[4] || {};
|
|
486
|
+
e.type = "normal", e.arg = t, r[4] = e;
|
|
487
|
+
}
|
|
488
|
+
function Context(t) {
|
|
489
|
+
this.tryEntries = [[-1]], t.forEach(w, this), this.reset(!0);
|
|
490
|
+
}
|
|
491
|
+
function x(r) {
|
|
492
|
+
if (null != r) {
|
|
493
|
+
var e = r[i];
|
|
494
|
+
if (e) return e.call(r);
|
|
495
|
+
if ("function" == typeof r.next) return r;
|
|
496
|
+
if (!isNaN(r.length)) {
|
|
497
|
+
var o = -1,
|
|
498
|
+
a = function e() {
|
|
499
|
+
for (; ++o < r.length;) if (n.call(r, o)) return e.value = r[o], e.done = !1, e;
|
|
500
|
+
return e.value = t, e.done = !0, e;
|
|
501
|
+
};
|
|
502
|
+
return a.next = a;
|
|
315
503
|
}
|
|
316
|
-
op = body.call(thisArg, _);
|
|
317
|
-
} catch (e) {
|
|
318
|
-
op = [6, e];
|
|
319
|
-
y = 0;
|
|
320
|
-
} finally {
|
|
321
|
-
f = t = 0;
|
|
322
504
|
}
|
|
323
|
-
|
|
505
|
+
throw new TypeError(typeof r + " is not iterable");
|
|
506
|
+
}
|
|
507
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, c(v, "constructor", GeneratorFunctionPrototype), c(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = c(GeneratorFunctionPrototype, u, "GeneratorFunction"), r.isGeneratorFunction = function (t) {
|
|
508
|
+
var r = "function" == typeof t && t.constructor;
|
|
509
|
+
return !!r && (r === GeneratorFunction || "GeneratorFunction" === (r.displayName || r.name));
|
|
510
|
+
}, r.mark = function (t) {
|
|
511
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, c(t, u, "GeneratorFunction")), t.prototype = Object.create(v), t;
|
|
512
|
+
}, r.awrap = function (t) {
|
|
324
513
|
return {
|
|
325
|
-
|
|
326
|
-
done: true
|
|
514
|
+
__await: t
|
|
327
515
|
};
|
|
516
|
+
}, g(AsyncIterator.prototype), c(AsyncIterator.prototype, a, function () {
|
|
517
|
+
return this;
|
|
518
|
+
}), r.AsyncIterator = AsyncIterator, r.async = function (t, e, n, o, i) {
|
|
519
|
+
void 0 === i && (i = Promise);
|
|
520
|
+
var a = new AsyncIterator(h(t, e, n, o), i);
|
|
521
|
+
return r.isGeneratorFunction(e) ? a : a.next().then(function (t) {
|
|
522
|
+
return t.done ? t.value : a.next();
|
|
523
|
+
});
|
|
524
|
+
}, g(v), c(v, u, "Generator"), c(v, i, function () {
|
|
525
|
+
return this;
|
|
526
|
+
}), c(v, "toString", function () {
|
|
527
|
+
return "[object Generator]";
|
|
528
|
+
}), r.keys = function (t) {
|
|
529
|
+
var r = Object(t),
|
|
530
|
+
e = [];
|
|
531
|
+
for (var n in r) e.unshift(n);
|
|
532
|
+
return function t() {
|
|
533
|
+
for (; e.length;) if ((n = e.pop()) in r) return t.value = n, t.done = !1, t;
|
|
534
|
+
return t.done = !0, t;
|
|
535
|
+
};
|
|
536
|
+
}, r.values = x, Context.prototype = {
|
|
537
|
+
constructor: Context,
|
|
538
|
+
reset: function (r) {
|
|
539
|
+
if (this.prev = this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(m), !r) for (var e in this) "t" === e.charAt(0) && n.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = t);
|
|
540
|
+
},
|
|
541
|
+
stop: function () {
|
|
542
|
+
this.done = !0;
|
|
543
|
+
var t = this.tryEntries[0][4];
|
|
544
|
+
if ("throw" === t.type) throw t.arg;
|
|
545
|
+
return this.rval;
|
|
546
|
+
},
|
|
547
|
+
dispatchException: function (r) {
|
|
548
|
+
if (this.done) throw r;
|
|
549
|
+
var e = this;
|
|
550
|
+
function n(t) {
|
|
551
|
+
a.type = "throw", a.arg = r, e.next = t;
|
|
552
|
+
}
|
|
553
|
+
for (var o = e.tryEntries.length - 1; o >= 0; --o) {
|
|
554
|
+
var i = this.tryEntries[o],
|
|
555
|
+
a = i[4],
|
|
556
|
+
u = this.prev,
|
|
557
|
+
c = i[1],
|
|
558
|
+
h = i[2];
|
|
559
|
+
if (-1 === i[0]) return n("end"), !1;
|
|
560
|
+
if (!c && !h) throw Error("try statement without catch or finally");
|
|
561
|
+
if (null != i[0] && i[0] <= u) {
|
|
562
|
+
if (u < c) return this.method = "next", this.arg = t, n(c), !0;
|
|
563
|
+
if (u < h) return n(h), !1;
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
},
|
|
567
|
+
abrupt: function (t, r) {
|
|
568
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
569
|
+
var n = this.tryEntries[e];
|
|
570
|
+
if (n[0] > -1 && n[0] <= this.prev && this.prev < n[2]) {
|
|
571
|
+
var o = n;
|
|
572
|
+
break;
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
o && ("break" === t || "continue" === t) && o[0] <= r && r <= o[2] && (o = null);
|
|
576
|
+
var i = o ? o[4] : {};
|
|
577
|
+
return i.type = t, i.arg = r, o ? (this.method = "next", this.next = o[2], f) : this.complete(i);
|
|
578
|
+
},
|
|
579
|
+
complete: function (t, r) {
|
|
580
|
+
if ("throw" === t.type) throw t.arg;
|
|
581
|
+
return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && r && (this.next = r), f;
|
|
582
|
+
},
|
|
583
|
+
finish: function (t) {
|
|
584
|
+
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
585
|
+
var e = this.tryEntries[r];
|
|
586
|
+
if (e[2] === t) return this.complete(e[4], e[3]), m(e), f;
|
|
587
|
+
}
|
|
588
|
+
},
|
|
589
|
+
catch: function (t) {
|
|
590
|
+
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
591
|
+
var e = this.tryEntries[r];
|
|
592
|
+
if (e[0] === t) {
|
|
593
|
+
var n = e[4];
|
|
594
|
+
if ("throw" === n.type) {
|
|
595
|
+
var o = n.arg;
|
|
596
|
+
m(e);
|
|
597
|
+
}
|
|
598
|
+
return o;
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
throw Error("illegal catch attempt");
|
|
602
|
+
},
|
|
603
|
+
delegateYield: function (r, e, n) {
|
|
604
|
+
return this.delegate = {
|
|
605
|
+
i: x(r),
|
|
606
|
+
r: e,
|
|
607
|
+
n: n
|
|
608
|
+
}, "next" === this.method && (this.arg = t), f;
|
|
609
|
+
}
|
|
610
|
+
}, r;
|
|
611
|
+
}
|
|
612
|
+
function _slicedToArray(r, e) {
|
|
613
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
614
|
+
}
|
|
615
|
+
function _toConsumableArray(r) {
|
|
616
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
617
|
+
}
|
|
618
|
+
function _toPrimitive(t, r) {
|
|
619
|
+
if ("object" != typeof t || !t) return t;
|
|
620
|
+
var e = t[Symbol.toPrimitive];
|
|
621
|
+
if (void 0 !== e) {
|
|
622
|
+
var i = e.call(t, r || "default");
|
|
623
|
+
if ("object" != typeof i) return i;
|
|
624
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
625
|
+
}
|
|
626
|
+
return ("string" === r ? String : Number)(t);
|
|
627
|
+
}
|
|
628
|
+
function _toPropertyKey(t) {
|
|
629
|
+
var i = _toPrimitive(t, "string");
|
|
630
|
+
return "symbol" == typeof i ? i : i + "";
|
|
631
|
+
}
|
|
632
|
+
function _unsupportedIterableToArray(r, a) {
|
|
633
|
+
if (r) {
|
|
634
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
635
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
636
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
328
637
|
}
|
|
329
638
|
}
|
|
330
|
-
|
|
331
|
-
/** @deprecated */
|
|
332
|
-
function __spreadArrays() {
|
|
333
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
334
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];
|
|
335
|
-
return r;
|
|
336
|
-
}
|
|
337
|
-
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
338
|
-
var e = new Error(message);
|
|
339
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
340
|
-
};
|
|
341
639
|
|
|
342
640
|
var scheduler_production_min = createCommonjsModule(function (module, exports) {
|
|
343
641
|
|
|
@@ -664,7 +962,6 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
664
962
|
var left = heap[leftIndex];
|
|
665
963
|
var rightIndex = leftIndex + 1;
|
|
666
964
|
var right = heap[rightIndex]; // If the left or right node is smaller, swap with the smaller of those.
|
|
667
|
-
|
|
668
965
|
if (compare(left, node) < 0) {
|
|
669
966
|
if (rightIndex < length && compare(right, left) < 0) {
|
|
670
967
|
heap[index] = right;
|
|
@@ -690,7 +987,6 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
690
987
|
var diff = a.sortIndex - b.sortIndex;
|
|
691
988
|
return diff !== 0 ? diff : a.id - b.id;
|
|
692
989
|
}
|
|
693
|
-
|
|
694
990
|
// TODO: Use symbols?
|
|
695
991
|
var ImmediatePriority = 1;
|
|
696
992
|
var UserBlockingPriority = 2;
|
|
@@ -698,9 +994,7 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
698
994
|
var LowPriority = 4;
|
|
699
995
|
var IdlePriority = 5;
|
|
700
996
|
function markTaskErrored(task, ms) {}
|
|
701
|
-
|
|
702
997
|
/* eslint-disable no-var */
|
|
703
|
-
|
|
704
998
|
var hasPerformanceNow = typeof performance === 'object' && typeof performance.now === 'function';
|
|
705
999
|
if (hasPerformanceNow) {
|
|
706
1000
|
var localPerformance = performance;
|
|
@@ -716,32 +1010,23 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
716
1010
|
} // Max 31 bit integer. The max integer size in V8 for 32-bit systems.
|
|
717
1011
|
// Math.pow(2, 30) - 1
|
|
718
1012
|
// 0b111111111111111111111111111111
|
|
719
|
-
|
|
720
1013
|
var maxSigned31BitInt = 1073741823; // Times out immediately
|
|
721
|
-
|
|
722
1014
|
var IMMEDIATE_PRIORITY_TIMEOUT = -1; // Eventually times out
|
|
723
|
-
|
|
724
1015
|
var USER_BLOCKING_PRIORITY_TIMEOUT = 250;
|
|
725
1016
|
var NORMAL_PRIORITY_TIMEOUT = 5000;
|
|
726
1017
|
var LOW_PRIORITY_TIMEOUT = 10000; // Never times out
|
|
727
|
-
|
|
728
1018
|
var IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt; // Tasks are stored on a min heap
|
|
729
|
-
|
|
730
1019
|
var taskQueue = [];
|
|
731
1020
|
var timerQueue = []; // Incrementing id counter. Used to maintain insertion order.
|
|
732
|
-
|
|
733
1021
|
var taskIdCounter = 1; // Pausing the scheduler is useful for debugging.
|
|
734
1022
|
var currentTask = null;
|
|
735
1023
|
var currentPriorityLevel = NormalPriority; // This is set while performing work, to prevent re-entrance.
|
|
736
|
-
|
|
737
1024
|
var isPerformingWork = false;
|
|
738
1025
|
var isHostCallbackScheduled = false;
|
|
739
1026
|
var isHostTimeoutScheduled = false; // Capture local references to native APIs, in case a polyfill overrides them.
|
|
740
|
-
|
|
741
1027
|
var localSetTimeout = typeof setTimeout === 'function' ? setTimeout : null;
|
|
742
1028
|
var localClearTimeout = typeof clearTimeout === 'function' ? clearTimeout : null;
|
|
743
1029
|
var localSetImmediate = typeof setImmediate !== 'undefined' ? setImmediate : null; // IE and Node.js + jsdom
|
|
744
|
-
|
|
745
1030
|
var isInputPending = typeof navigator !== 'undefined' && navigator.scheduling !== undefined && navigator.scheduling.isInputPending !== undefined ? navigator.scheduling.isInputPending.bind(navigator.scheduling) : null;
|
|
746
1031
|
function advanceTimers(currentTime) {
|
|
747
1032
|
// Check for tasks that are no longer delayed and add them to the queue.
|
|
@@ -837,7 +1122,6 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
837
1122
|
}
|
|
838
1123
|
currentTask = peek(taskQueue);
|
|
839
1124
|
} // Return whether there's additional work
|
|
840
|
-
|
|
841
1125
|
if (currentTask !== null) {
|
|
842
1126
|
return true;
|
|
843
1127
|
} else {
|
|
@@ -955,14 +1239,12 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
955
1239
|
} else {
|
|
956
1240
|
isHostTimeoutScheduled = true;
|
|
957
1241
|
} // Schedule a timeout.
|
|
958
|
-
|
|
959
1242
|
requestHostTimeout(handleTimeout, startTime - currentTime);
|
|
960
1243
|
}
|
|
961
1244
|
} else {
|
|
962
1245
|
newTask.sortIndex = expirationTime;
|
|
963
1246
|
push(taskQueue, newTask);
|
|
964
1247
|
// wait until the next time we yield.
|
|
965
|
-
|
|
966
1248
|
if (!isHostCallbackScheduled && !isPerformingWork) {
|
|
967
1249
|
isHostCallbackScheduled = true;
|
|
968
1250
|
requestHostCallback(flushWork);
|
|
@@ -983,7 +1265,6 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
983
1265
|
function unstable_cancelCallback(task) {
|
|
984
1266
|
// remove from the queue because you can't remove arbitrary nodes from an
|
|
985
1267
|
// array based heap, only the first one.)
|
|
986
|
-
|
|
987
1268
|
task.callback = null;
|
|
988
1269
|
}
|
|
989
1270
|
function unstable_getCurrentPriorityLevel() {
|
|
@@ -995,7 +1276,6 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
995
1276
|
// thread, like user events. By default, it yields multiple times per frame.
|
|
996
1277
|
// It does not attempt to align with frame boundaries, since most tasks don't
|
|
997
1278
|
// need to be frame aligned; for those that do, use requestAnimationFrame.
|
|
998
|
-
|
|
999
1279
|
var frameInterval = frameYieldMs;
|
|
1000
1280
|
var startTime = -1;
|
|
1001
1281
|
function shouldYieldToHost() {
|
|
@@ -1005,7 +1285,6 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
1005
1285
|
// smaller than a single frame. Don't yield yet.
|
|
1006
1286
|
return false;
|
|
1007
1287
|
} // The main thread has been blocked for a non-negligible amount of time. We
|
|
1008
|
-
|
|
1009
1288
|
return true;
|
|
1010
1289
|
}
|
|
1011
1290
|
function requestPaint() {}
|
|
@@ -1026,7 +1305,6 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
1026
1305
|
if (scheduledHostCallback !== null) {
|
|
1027
1306
|
var currentTime = exports.unstable_now(); // Keep track of the start time so we can measure how long the main thread
|
|
1028
1307
|
// has been blocked.
|
|
1029
|
-
|
|
1030
1308
|
startTime = currentTime;
|
|
1031
1309
|
var hasTimeRemaining = true; // If a scheduler task throws, exit the current browser task so the
|
|
1032
1310
|
// error can be observed.
|
|
@@ -1034,7 +1312,6 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
1034
1312
|
// Intentionally not using a try-catch, since that makes some debugging
|
|
1035
1313
|
// techniques harder. Instead, if `scheduledHostCallback` errors, then
|
|
1036
1314
|
// `hasMoreWork` will remain true, and we'll continue the work loop.
|
|
1037
|
-
|
|
1038
1315
|
var hasMoreWork = true;
|
|
1039
1316
|
try {
|
|
1040
1317
|
hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime);
|
|
@@ -8329,23 +8606,23 @@ var warnAboutStringRefs=true;// ------------------------------------------------
|
|
|
8329
8606
|
var enableSchedulingProfiler=true;// Helps identify side effects in render-phase lifecycle hooks and setState
|
|
8330
8607
|
var enableProfilerTimer=true;// Record durations for commit and passive effects phases.
|
|
8331
8608
|
var enableProfilerCommitHooks=true;// Phase param passed to onRender callback differentiates between an "update" and a "cascading-update".
|
|
8332
|
-
var allNativeEvents=new Set();/**
|
|
8333
|
-
|
|
8334
|
-
|
|
8335
|
-
|
|
8336
|
-
|
|
8337
|
-
|
|
8338
|
-
|
|
8339
|
-
|
|
8340
|
-
function registerTwoPhaseEvent(registrationName,dependencies){registerDirectEvent(registrationName,dependencies);registerDirectEvent(registrationName+'Capture',dependencies);}function registerDirectEvent(registrationName,dependencies){{if(registrationNameDependencies[registrationName]){error('EventRegistry: More than one plugin attempted to publish the same '+'registration name, `%s`.',registrationName);}}registrationNameDependencies[registrationName]=dependencies;{var lowerCasedName=registrationName.toLowerCase();possibleRegistrationNames[lowerCasedName]=registrationName;if(registrationName==='onDoubleClick'){possibleRegistrationNames.ondblclick=registrationName;}}for(var i=0;i<dependencies.length;i++){allNativeEvents.add(dependencies[i]);}}var canUseDOM=!!(typeof window!=='undefined'&&typeof window.document!=='undefined'&&typeof window.document.createElement!=='undefined');var hasOwnProperty=Object.prototype.hasOwnProperty;/*
|
|
8341
|
-
|
|
8342
|
-
|
|
8343
|
-
|
|
8344
|
-
|
|
8345
|
-
|
|
8346
|
-
|
|
8347
|
-
|
|
8348
|
-
|
|
8609
|
+
var allNativeEvents=new Set();/**
|
|
8610
|
+
* Mapping from registration name to event name
|
|
8611
|
+
*/var registrationNameDependencies={};/**
|
|
8612
|
+
* Mapping from lowercase registration names to the properly cased version,
|
|
8613
|
+
* used to warn in the case of missing event handlers. Available
|
|
8614
|
+
* only in true.
|
|
8615
|
+
* @type {Object}
|
|
8616
|
+
*/var possibleRegistrationNames={};// Trust the developer to only use possibleRegistrationNames in true
|
|
8617
|
+
function registerTwoPhaseEvent(registrationName,dependencies){registerDirectEvent(registrationName,dependencies);registerDirectEvent(registrationName+'Capture',dependencies);}function registerDirectEvent(registrationName,dependencies){{if(registrationNameDependencies[registrationName]){error('EventRegistry: More than one plugin attempted to publish the same '+'registration name, `%s`.',registrationName);}}registrationNameDependencies[registrationName]=dependencies;{var lowerCasedName=registrationName.toLowerCase();possibleRegistrationNames[lowerCasedName]=registrationName;if(registrationName==='onDoubleClick'){possibleRegistrationNames.ondblclick=registrationName;}}for(var i=0;i<dependencies.length;i++){allNativeEvents.add(dependencies[i]);}}var canUseDOM=!!(typeof window!=='undefined'&&typeof window.document!=='undefined'&&typeof window.document.createElement!=='undefined');var hasOwnProperty=Object.prototype.hasOwnProperty;/*
|
|
8618
|
+
* The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
|
|
8619
|
+
* and Temporal.* types. See https://github.com/facebook/react/pull/22064.
|
|
8620
|
+
*
|
|
8621
|
+
* The functions in this module will throw an easier-to-understand,
|
|
8622
|
+
* easier-to-debug exception with a clear errors message message explaining the
|
|
8623
|
+
* problem. (Instead of a confusing exception thrown inside the implementation
|
|
8624
|
+
* of the `value` object).
|
|
8625
|
+
*/// $FlowFixMe only called in DEV, so void return is not possible.
|
|
8349
8626
|
function typeName(value){{// toStringTag is needed for namespaced types like Temporal.Instant
|
|
8350
8627
|
var hasToStringTag=typeof Symbol==='function'&&Symbol.toStringTag;var type=hasToStringTag&&value[Symbol.toStringTag]||value.constructor.name||'Object';return type;}}// $FlowFixMe only called in DEV, so void return is not possible.
|
|
8351
8628
|
function willCoercionThrow(value){{try{testStringCoercion(value);return false;}catch(e){return true;}}}function testStringCoercion(value){// If you ended up here by following an exception call stack, here's what's
|
|
@@ -8402,8 +8679,7 @@ return true;case'boolean':{if(isCustomComponentTag){return false;}if(propertyInf
|
|
|
8402
8679
|
// the `possibleStandardNames` module to ensure casing and incorrect
|
|
8403
8680
|
// name warnings.
|
|
8404
8681
|
var properties={};// These props are reserved by React. They shouldn't be written to the DOM.
|
|
8405
|
-
var reservedProps=['children','dangerouslySetInnerHTML',//
|
|
8406
|
-
// elements (not just inputs). Now that ReactDOMInput assigns to the
|
|
8682
|
+
var reservedProps=['children','dangerouslySetInnerHTML',// elements (not just inputs). Now that ReactDOMInput assigns to the
|
|
8407
8683
|
// defaultValue property -- do we need this?
|
|
8408
8684
|
'defaultValue','defaultChecked','innerHTML','suppressContentEditableWarning','suppressHydrationWarning','style'];reservedProps.forEach(function(name){properties[name]=new PropertyInfoRecord(name,RESERVED,false,// mustUseProperty
|
|
8409
8685
|
name,// attributeName
|
|
@@ -8431,17 +8707,14 @@ name,// attributeName
|
|
|
8431
8707
|
null,// attributeNamespace
|
|
8432
8708
|
false,// sanitizeURL
|
|
8433
8709
|
false);});// These are HTML boolean attributes.
|
|
8434
|
-
['allowFullScreen','async',//
|
|
8435
|
-
|
|
8436
|
-
'autoFocus','autoPlay','controls','default','defer','disabled','disablePictureInPicture','disableRemotePlayback','formNoValidate','hidden','loop','noModule','noValidate','open','playsInline','readOnly','required','reversed','scoped','seamless',// Microdata
|
|
8437
|
-
'itemScope'].forEach(function(name){properties[name]=new PropertyInfoRecord(name,BOOLEAN,false,// mustUseProperty
|
|
8710
|
+
['allowFullScreen','async',// on the client side because the browsers are inconsistent. Instead we call focus().
|
|
8711
|
+
'autoFocus','autoPlay','controls','default','defer','disabled','disablePictureInPicture','disableRemotePlayback','formNoValidate','hidden','loop','noModule','noValidate','open','playsInline','readOnly','required','reversed','scoped','seamless','itemScope'].forEach(function(name){properties[name]=new PropertyInfoRecord(name,BOOLEAN,false,// mustUseProperty
|
|
8438
8712
|
name.toLowerCase(),// attributeName
|
|
8439
8713
|
null,// attributeNamespace
|
|
8440
8714
|
false,// sanitizeURL
|
|
8441
8715
|
false);});// These are the few React props that we set as DOM properties
|
|
8442
8716
|
// rather than attributes. These are all booleans.
|
|
8443
|
-
['checked',//
|
|
8444
|
-
// disabled with `removeAttribute`. We have special logic for handling this.
|
|
8717
|
+
['checked',// disabled with `removeAttribute`. We have special logic for handling this.
|
|
8445
8718
|
'multiple','muted','selected'// NOTE: if you add a camelCased prop to this list,
|
|
8446
8719
|
// you'll need to set attributeName to name.toLowerCase()
|
|
8447
8720
|
// instead in the assignment below.
|
|
@@ -8516,11 +8789,11 @@ true);});// and any newline or tab are filtered out as if they're not part of th
|
|
|
8516
8789
|
// A C0 control is a code point in the range \u0000 NULL to \u001F
|
|
8517
8790
|
// INFORMATION SEPARATOR ONE, inclusive:
|
|
8518
8791
|
// https://infra.spec.whatwg.org/#c0-control-or-space
|
|
8519
|
-
/* eslint-disable max-len */var isJavaScriptProtocol=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;var didWarn=false;function sanitizeURL(url){{if(!didWarn&&isJavaScriptProtocol.test(url)){didWarn=true;error('A future version of React will block javascript: URLs as a security precaution. '+'Use event handlers instead if you can. If you need to generate unsafe HTML try '+'using dangerouslySetInnerHTML instead. React was passed %s.',JSON.stringify(url));}}}/**
|
|
8520
|
-
|
|
8521
|
-
|
|
8522
|
-
|
|
8523
|
-
|
|
8792
|
+
/* eslint-disable max-len */var isJavaScriptProtocol=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;var didWarn=false;function sanitizeURL(url){{if(!didWarn&&isJavaScriptProtocol.test(url)){didWarn=true;error('A future version of React will block javascript: URLs as a security precaution. '+'Use event handlers instead if you can. If you need to generate unsafe HTML try '+'using dangerouslySetInnerHTML instead. React was passed %s.',JSON.stringify(url));}}}/**
|
|
8793
|
+
* Get the value for a property on a node. Only used in DEV for SSR validation.
|
|
8794
|
+
* The "expected" argument is used as a hint of what the expected value is.
|
|
8795
|
+
* Some properties have multiple equivalent values.
|
|
8796
|
+
*/function getValueForProperty(node,name,expected,propertyInfo){{if(propertyInfo.mustUseProperty){var propertyName=propertyInfo.propertyName;return node[propertyName];}else {// This check protects multiple uses of `expected`, which is why the
|
|
8524
8797
|
// react-internal/safe-string-coercion rule is disabled in several spots
|
|
8525
8798
|
// below.
|
|
8526
8799
|
{checkAttributeStringCoercion(expected,name);}if(propertyInfo.sanitizeURL){// If we haven't fully disabled javascript: URLs, and if
|
|
@@ -8537,17 +8810,17 @@ return expected;}// Even if this property uses a namespace we use getAttribute
|
|
|
8537
8810
|
// To use getAttributeNS we need the local name which we don't have
|
|
8538
8811
|
// in our config atm.
|
|
8539
8812
|
stringValue=node.getAttribute(attributeName);}if(shouldRemoveAttribute(name,expected,propertyInfo,false)){return stringValue===null?expected:stringValue;// eslint-disable-next-line react-internal/safe-string-coercion
|
|
8540
|
-
}else if(stringValue===''+expected){return expected;}else {return stringValue;}}}}/**
|
|
8541
|
-
|
|
8542
|
-
|
|
8543
|
-
|
|
8544
|
-
|
|
8545
|
-
|
|
8546
|
-
|
|
8547
|
-
|
|
8548
|
-
|
|
8549
|
-
|
|
8550
|
-
|
|
8813
|
+
}else if(stringValue===''+expected){return expected;}else {return stringValue;}}}}/**
|
|
8814
|
+
* Get the value for a attribute on a node. Only used in DEV for SSR validation.
|
|
8815
|
+
* The third argument is used as a hint of what the expected value is. Some
|
|
8816
|
+
* attributes have multiple equivalent values.
|
|
8817
|
+
*/function getValueForAttribute(node,name,expected,isCustomComponentTag){{if(!isAttributeNameSafe(name)){return;}if(!node.hasAttribute(name)){return expected===undefined?undefined:null;}var value=node.getAttribute(name);{checkAttributeStringCoercion(expected,name);}if(value===''+expected){return expected;}return value;}}/**
|
|
8818
|
+
* Sets the value for a property on a node.
|
|
8819
|
+
*
|
|
8820
|
+
* @param {DOMElement} node
|
|
8821
|
+
* @param {string} name
|
|
8822
|
+
* @param {*} value
|
|
8823
|
+
*/function setValueForProperty(node,name,value,isCustomComponentTag){var propertyInfo=getPropertyInfo(name);if(shouldIgnoreAttribute(name,propertyInfo,isCustomComponentTag)){return;}if(shouldRemoveAttribute(name,value,propertyInfo,isCustomComponentTag)){value=null;}if(isCustomComponentTag||propertyInfo===null){if(isAttributeNameSafe(name)){var _attributeName=name;if(value===null){node.removeAttribute(_attributeName);}else {{checkAttributeStringCoercion(value,name);}node.setAttribute(_attributeName,''+value);}}return;}var mustUseProperty=propertyInfo.mustUseProperty;if(mustUseProperty){var propertyName=propertyInfo.propertyName;if(value===null){var type=propertyInfo.type;node[propertyName]=type===BOOLEAN?false:'';}else {// Contrary to `setAttribute`, object properties are properly
|
|
8551
8824
|
// `toString`ed by IE8/9.
|
|
8552
8825
|
node[propertyName]=value;}return;}// The rest are treated as attributes with special cases.
|
|
8553
8826
|
var attributeName=propertyInfo.attributeName,attributeNamespace=propertyInfo.attributeNamespace;if(value===null){node.removeAttribute(attributeName);}else {var _type=propertyInfo.type;var attributeValue;if(_type===BOOLEAN||_type===OVERLOADED_BOOLEAN&&value===true){// If attribute type is boolean, we know for sure it won't be an execution sink
|
|
@@ -8632,22 +8905,22 @@ if(node.hasOwnProperty(valueField)||typeof descriptor==='undefined'||typeof desc
|
|
|
8632
8905
|
Object.defineProperty(node,valueField,{enumerable:descriptor.enumerable});var tracker={getValue:function(){return currentValue;},setValue:function(value){{checkFormFieldValueStringCoercion(value);}currentValue=''+value;},stopTracking:function(){detachTracker(node);delete node[valueField];}};return tracker;}function track(node){if(getTracker(node)){return;}// TODO: Once it's just Fiber we can move this to node._wrapperState
|
|
8633
8906
|
node._valueTracker=trackValueOnNode(node);}function updateValueIfChanged(node){if(!node){return false;}var tracker=getTracker(node);// if there is no tracker at this point it's unlikely
|
|
8634
8907
|
// that trying again will succeed
|
|
8635
|
-
if(!tracker){return true;}var lastValue=tracker.getValue();var nextValue=getValueFromNode(node);if(nextValue!==lastValue){tracker.setValue(nextValue);return true;}return false;}function getActiveElement(doc){doc=doc||(typeof document!=='undefined'?document:undefined);if(typeof doc==='undefined'){return null;}try{return doc.activeElement||doc.body;}catch(e){return doc.body;}}var didWarnValueDefaultValue=false;var didWarnCheckedDefaultChecked=false;var didWarnControlledToUncontrolled=false;var didWarnUncontrolledToControlled=false;function isControlled(props){var usesChecked=props.type==='checkbox'||props.type==='radio';return usesChecked?props.checked!=null:props.value!=null;}/**
|
|
8636
|
-
|
|
8637
|
-
|
|
8638
|
-
|
|
8639
|
-
|
|
8640
|
-
|
|
8641
|
-
|
|
8642
|
-
|
|
8643
|
-
|
|
8644
|
-
|
|
8645
|
-
|
|
8646
|
-
|
|
8647
|
-
|
|
8648
|
-
|
|
8649
|
-
|
|
8650
|
-
|
|
8908
|
+
if(!tracker){return true;}var lastValue=tracker.getValue();var nextValue=getValueFromNode(node);if(nextValue!==lastValue){tracker.setValue(nextValue);return true;}return false;}function getActiveElement(doc){doc=doc||(typeof document!=='undefined'?document:undefined);if(typeof doc==='undefined'){return null;}try{return doc.activeElement||doc.body;}catch(e){return doc.body;}}var didWarnValueDefaultValue=false;var didWarnCheckedDefaultChecked=false;var didWarnControlledToUncontrolled=false;var didWarnUncontrolledToControlled=false;function isControlled(props){var usesChecked=props.type==='checkbox'||props.type==='radio';return usesChecked?props.checked!=null:props.value!=null;}/**
|
|
8909
|
+
* Implements an <input> host component that allows setting these optional
|
|
8910
|
+
* props: `checked`, `value`, `defaultChecked`, and `defaultValue`.
|
|
8911
|
+
*
|
|
8912
|
+
* If `checked` or `value` are not supplied (or null/undefined), user actions
|
|
8913
|
+
* that affect the checked state or value will trigger updates to the element.
|
|
8914
|
+
*
|
|
8915
|
+
* If they are supplied (and not null/undefined), the rendered element will not
|
|
8916
|
+
* trigger updates to the element. Instead, the props must change in order for
|
|
8917
|
+
* the rendered element to be updated.
|
|
8918
|
+
*
|
|
8919
|
+
* The rendered element will be initialized as unchecked (or `defaultChecked`)
|
|
8920
|
+
* with an empty value (or `defaultValue`).
|
|
8921
|
+
*
|
|
8922
|
+
* See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html
|
|
8923
|
+
*/function getHostProps(element,props){var node=element;var checked=props.checked;var hostProps=assign({},props,{defaultChecked:undefined,defaultValue:undefined,value:undefined,checked:checked!=null?checked:node._wrapperState.initialChecked});return hostProps;}function initWrapperState(element,props){{checkControlledValueProps('input',props);if(props.checked!==undefined&&props.defaultChecked!==undefined&&!didWarnCheckedDefaultChecked){error('%s contains an input of type %s with both checked and defaultChecked props. '+'Input elements must be either controlled or uncontrolled '+'(specify either the checked prop, or the defaultChecked prop, but not '+'both). Decide between using a controlled or uncontrolled input '+'element and remove one of these props. More info: '+'https://reactjs.org/link/controlled-components',getCurrentFiberOwnerNameInDevOrNull()||'A component',props.type);didWarnCheckedDefaultChecked=true;}if(props.value!==undefined&&props.defaultValue!==undefined&&!didWarnValueDefaultValue){error('%s contains an input of type %s with both value and defaultValue props. '+'Input elements must be either controlled or uncontrolled '+'(specify either the value prop, or the defaultValue prop, but not '+'both). Decide between using a controlled or uncontrolled input '+'element and remove one of these props. More info: '+'https://reactjs.org/link/controlled-components',getCurrentFiberOwnerNameInDevOrNull()||'A component',props.type);didWarnValueDefaultValue=true;}}var node=element;var defaultValue=props.defaultValue==null?'':props.defaultValue;node._wrapperState={initialChecked:props.checked!=null?props.checked:props.defaultChecked,initialValue:getToStringValue(props.value!=null?props.value:defaultValue),controlled:isControlled(props)};}function updateChecked(element,props){var node=element;var checked=props.checked;if(checked!=null){setValueForProperty(node,'checked',checked,false);}}function updateWrapper(element,props){var node=element;{var controlled=isControlled(props);if(!node._wrapperState.controlled&&controlled&&!didWarnUncontrolledToControlled){error('A component is changing an uncontrolled input to be controlled. '+'This is likely caused by the value changing from undefined to '+'a defined value, which should not happen. '+'Decide between using a controlled or uncontrolled input '+'element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components');didWarnUncontrolledToControlled=true;}if(node._wrapperState.controlled&&!controlled&&!didWarnControlledToUncontrolled){error('A component is changing a controlled input to be uncontrolled. '+'This is likely caused by the value changing from a defined to '+'undefined, which should not happen. '+'Decide between using a controlled or uncontrolled input '+'element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components');didWarnControlledToUncontrolled=true;}}updateChecked(element,props);var value=getToStringValue(props.value);var type=props.type;if(value!=null){if(type==='number'){if(value===0&&node.value===''||// We explicitly want to coerce to number here if possible.
|
|
8651
8924
|
// eslint-disable-next-line
|
|
8652
8925
|
node.value!=value){node.value=toString(value);}}else if(node.value!==toString(value)){node.value=toString(value);}}else if(type==='submit'||type==='reset'){// Submit/reset inputs need the attribute removed completely to avoid
|
|
8653
8926
|
// blank-text buttons.
|
|
@@ -8709,48 +8982,48 @@ updateWrapper(otherNode,otherProps);}}}// In Chrome, assigning defaultValue to c
|
|
|
8709
8982
|
//
|
|
8710
8983
|
// https://github.com/facebook/react/issues/7253
|
|
8711
8984
|
function setDefaultValue(node,type,value){if(// Focused number inputs synchronize on blur. See ChangeEventPlugin.js
|
|
8712
|
-
type!=='number'||getActiveElement(node.ownerDocument)!==node){if(value==null){node.defaultValue=toString(node._wrapperState.initialValue);}else if(node.defaultValue!==toString(value)){node.defaultValue=toString(value);}}}var didWarnSelectedSetOnOption=false;var didWarnInvalidChild=false;var didWarnInvalidInnerHTML=false;/**
|
|
8713
|
-
|
|
8714
|
-
|
|
8985
|
+
type!=='number'||getActiveElement(node.ownerDocument)!==node){if(value==null){node.defaultValue=toString(node._wrapperState.initialValue);}else if(node.defaultValue!==toString(value)){node.defaultValue=toString(value);}}}var didWarnSelectedSetOnOption=false;var didWarnInvalidChild=false;var didWarnInvalidInnerHTML=false;/**
|
|
8986
|
+
* Implements an <option> host component that warns when `selected` is set.
|
|
8987
|
+
*/function validateProps(element,props){{// If a value is not provided, then the children must be simple.
|
|
8715
8988
|
if(props.value==null){if(typeof props.children==='object'&&props.children!==null){React.Children.forEach(props.children,function(child){if(child==null){return;}if(typeof child==='string'||typeof child==='number'){return;}if(!didWarnInvalidChild){didWarnInvalidChild=true;error('Cannot infer the option value of complex children. '+'Pass a `value` prop or use a plain string as children to <option>.');}});}else if(props.dangerouslySetInnerHTML!=null){if(!didWarnInvalidInnerHTML){didWarnInvalidInnerHTML=true;error('Pass a `value` prop if you set dangerouslyInnerHTML so React knows '+'which value should be selected.');}}}// TODO: Remove support for `selected` in <option>.
|
|
8716
8989
|
if(props.selected!=null&&!didWarnSelectedSetOnOption){error('Use the `defaultValue` or `value` props on <select> instead of '+'setting `selected` on <option>.');didWarnSelectedSetOnOption=true;}}}function postMountWrapper$1(element,props){// value="" should make a value attribute (#6219)
|
|
8717
8990
|
if(props.value!=null){element.setAttribute('value',toString(getToStringValue(props.value)));}}var isArrayImpl=Array.isArray;// eslint-disable-next-line no-redeclare
|
|
8718
|
-
function isArray(a){return isArrayImpl(a);}var didWarnValueDefaultValue$1;{didWarnValueDefaultValue$1=false;}function getDeclarationErrorAddendum(){var ownerName=getCurrentFiberOwnerNameInDevOrNull();if(ownerName){return '\n\nCheck the render method of `'+ownerName+'`.';}return '';}var valuePropNames=['value','defaultValue'];/**
|
|
8719
|
-
|
|
8720
|
-
|
|
8991
|
+
function isArray(a){return isArrayImpl(a);}var didWarnValueDefaultValue$1;{didWarnValueDefaultValue$1=false;}function getDeclarationErrorAddendum(){var ownerName=getCurrentFiberOwnerNameInDevOrNull();if(ownerName){return '\n\nCheck the render method of `'+ownerName+'`.';}return '';}var valuePropNames=['value','defaultValue'];/**
|
|
8992
|
+
* Validation function for `value` and `defaultValue`.
|
|
8993
|
+
*/function checkSelectPropTypes(props){{checkControlledValueProps('select',props);for(var i=0;i<valuePropNames.length;i++){var propName=valuePropNames[i];if(props[propName]==null){continue;}var propNameIsArray=isArray(props[propName]);if(props.multiple&&!propNameIsArray){error('The `%s` prop supplied to <select> must be an array if '+'`multiple` is true.%s',propName,getDeclarationErrorAddendum());}else if(!props.multiple&&propNameIsArray){error('The `%s` prop supplied to <select> must be a scalar '+'value if `multiple` is false.%s',propName,getDeclarationErrorAddendum());}}}}function updateOptions(node,multiple,propValue,setDefaultSelected){var options=node.options;if(multiple){var selectedValues=propValue;var selectedValue={};for(var i=0;i<selectedValues.length;i++){// Prefix to avoid chaos with special keys.
|
|
8721
8994
|
selectedValue['$'+selectedValues[i]]=true;}for(var _i=0;_i<options.length;_i++){var selected=selectedValue.hasOwnProperty('$'+options[_i].value);if(options[_i].selected!==selected){options[_i].selected=selected;}if(selected&&setDefaultSelected){options[_i].defaultSelected=true;}}}else {// Do not set `select.value` as exact behavior isn't consistent across all
|
|
8722
8995
|
// browsers for all cases.
|
|
8723
|
-
var _selectedValue=toString(getToStringValue(propValue));var defaultSelected=null;for(var _i2=0;_i2<options.length;_i2++){if(options[_i2].value===_selectedValue){options[_i2].selected=true;if(setDefaultSelected){options[_i2].defaultSelected=true;}return;}if(defaultSelected===null&&!options[_i2].disabled){defaultSelected=options[_i2];}}if(defaultSelected!==null){defaultSelected.selected=true;}}}/**
|
|
8724
|
-
|
|
8725
|
-
|
|
8726
|
-
|
|
8727
|
-
|
|
8728
|
-
|
|
8729
|
-
|
|
8730
|
-
|
|
8731
|
-
|
|
8732
|
-
|
|
8733
|
-
|
|
8734
|
-
|
|
8735
|
-
|
|
8736
|
-
|
|
8737
|
-
|
|
8996
|
+
var _selectedValue=toString(getToStringValue(propValue));var defaultSelected=null;for(var _i2=0;_i2<options.length;_i2++){if(options[_i2].value===_selectedValue){options[_i2].selected=true;if(setDefaultSelected){options[_i2].defaultSelected=true;}return;}if(defaultSelected===null&&!options[_i2].disabled){defaultSelected=options[_i2];}}if(defaultSelected!==null){defaultSelected.selected=true;}}}/**
|
|
8997
|
+
* Implements a <select> host component that allows optionally setting the
|
|
8998
|
+
* props `value` and `defaultValue`. If `multiple` is false, the prop must be a
|
|
8999
|
+
* stringable. If `multiple` is true, the prop must be an array of stringables.
|
|
9000
|
+
*
|
|
9001
|
+
* If `value` is not supplied (or null/undefined), user actions that change the
|
|
9002
|
+
* selected option will trigger updates to the rendered options.
|
|
9003
|
+
*
|
|
9004
|
+
* If it is supplied (and not null/undefined), the rendered options will not
|
|
9005
|
+
* update in response to user actions. Instead, the `value` prop must change in
|
|
9006
|
+
* order for the rendered options to update.
|
|
9007
|
+
*
|
|
9008
|
+
* If `defaultValue` is provided, any options with the supplied values will be
|
|
9009
|
+
* selected.
|
|
9010
|
+
*/function getHostProps$1(element,props){return assign({},props,{value:undefined});}function initWrapperState$1(element,props){var node=element;{checkSelectPropTypes(props);}node._wrapperState={wasMultiple:!!props.multiple};{if(props.value!==undefined&&props.defaultValue!==undefined&&!didWarnValueDefaultValue$1){error('Select elements must be either controlled or uncontrolled '+'(specify either the value prop, or the defaultValue prop, but not '+'both). Decide between using a controlled or uncontrolled select '+'element and remove one of these props. More info: '+'https://reactjs.org/link/controlled-components');didWarnValueDefaultValue$1=true;}}}function postMountWrapper$2(element,props){var node=element;node.multiple=!!props.multiple;var value=props.value;if(value!=null){updateOptions(node,!!props.multiple,value,false);}else if(props.defaultValue!=null){updateOptions(node,!!props.multiple,props.defaultValue,true);}}function postUpdateWrapper(element,props){var node=element;var wasMultiple=node._wrapperState.wasMultiple;node._wrapperState.wasMultiple=!!props.multiple;var value=props.value;if(value!=null){updateOptions(node,!!props.multiple,value,false);}else if(wasMultiple!==!!props.multiple){// For simplicity, reapply `defaultValue` if `multiple` is toggled.
|
|
8738
9011
|
if(props.defaultValue!=null){updateOptions(node,!!props.multiple,props.defaultValue,true);}else {// Revert the select back to its default unselected state.
|
|
8739
|
-
updateOptions(node,!!props.multiple,props.multiple?[]:'',false);}}}function restoreControlledState$1(element,props){var node=element;var value=props.value;if(value!=null){updateOptions(node,!!props.multiple,value,false);}}var didWarnValDefaultVal=false;/**
|
|
8740
|
-
|
|
8741
|
-
|
|
8742
|
-
|
|
8743
|
-
|
|
8744
|
-
|
|
8745
|
-
|
|
8746
|
-
|
|
8747
|
-
|
|
8748
|
-
|
|
8749
|
-
|
|
8750
|
-
|
|
8751
|
-
|
|
8752
|
-
|
|
8753
|
-
|
|
9012
|
+
updateOptions(node,!!props.multiple,props.multiple?[]:'',false);}}}function restoreControlledState$1(element,props){var node=element;var value=props.value;if(value!=null){updateOptions(node,!!props.multiple,value,false);}}var didWarnValDefaultVal=false;/**
|
|
9013
|
+
* Implements a <textarea> host component that allows setting `value`, and
|
|
9014
|
+
* `defaultValue`. This differs from the traditional DOM API because value is
|
|
9015
|
+
* usually set as PCDATA children.
|
|
9016
|
+
*
|
|
9017
|
+
* If `value` is not supplied (or null/undefined), user actions that affect the
|
|
9018
|
+
* value will trigger updates to the element.
|
|
9019
|
+
*
|
|
9020
|
+
* If `value` is supplied (and not null/undefined), the rendered element will
|
|
9021
|
+
* not trigger updates to the element. Instead, the `value` prop must change in
|
|
9022
|
+
* order for the rendered element to be updated.
|
|
9023
|
+
*
|
|
9024
|
+
* The rendered element will be initialized with an empty value, the prop
|
|
9025
|
+
* `defaultValue` if specified, or the children content (deprecated).
|
|
9026
|
+
*/function getHostProps$2(element,props){var node=element;if(props.dangerouslySetInnerHTML!=null){throw new Error('`dangerouslySetInnerHTML` does not make sense on <textarea>.');}// Always set children to the same thing. In IE9, the selection range will
|
|
8754
9027
|
// get reset if `textContent` is mutated. We could add a check in setTextContent
|
|
8755
9028
|
// to only set the value if/when the value differs from the node value (which would
|
|
8756
9029
|
// completely solve this IE9 bug), but Sebastian+Sophie seemed to like this
|
|
@@ -8771,51 +9044,51 @@ updateWrapper$1(element,props);}var HTML_NAMESPACE='http://www.w3.org/1999/xhtml
|
|
|
8771
9044
|
function getIntrinsicNamespace(type){switch(type){case'svg':return SVG_NAMESPACE;case'math':return MATH_NAMESPACE;default:return HTML_NAMESPACE;}}function getChildNamespace(parentNamespace,type){if(parentNamespace==null||parentNamespace===HTML_NAMESPACE){// No (or default) parent namespace: potential entry point.
|
|
8772
9045
|
return getIntrinsicNamespace(type);}if(parentNamespace===SVG_NAMESPACE&&type==='foreignObject'){// We're leaving SVG.
|
|
8773
9046
|
return HTML_NAMESPACE;}// By default, pass namespace below.
|
|
8774
|
-
return parentNamespace;}/* globals MSApp *//**
|
|
8775
|
-
|
|
8776
|
-
|
|
8777
|
-
|
|
8778
|
-
|
|
8779
|
-
|
|
8780
|
-
|
|
8781
|
-
|
|
8782
|
-
|
|
9047
|
+
return parentNamespace;}/* globals MSApp *//**
|
|
9048
|
+
* Create a function which has 'unsafe' privileges (required by windows8 apps)
|
|
9049
|
+
*/var createMicrosoftUnsafeLocalFunction=function(func){if(typeof MSApp!=='undefined'&&MSApp.execUnsafeLocalFunction){return function(arg0,arg1,arg2,arg3){MSApp.execUnsafeLocalFunction(function(){return func(arg0,arg1,arg2,arg3);});};}else {return func;}};var reusableSVGContainer;/**
|
|
9050
|
+
* Set the innerHTML property of a node
|
|
9051
|
+
*
|
|
9052
|
+
* @param {DOMElement} node
|
|
9053
|
+
* @param {string} html
|
|
9054
|
+
* @internal
|
|
9055
|
+
*/var setInnerHTML=createMicrosoftUnsafeLocalFunction(function(node,html){if(node.namespaceURI===SVG_NAMESPACE){if(!('innerHTML'in node)){// IE does not have innerHTML for SVG nodes, so instead we inject the
|
|
8783
9056
|
// new markup in a temp node and then move the child nodes across into
|
|
8784
9057
|
// the target node
|
|
8785
|
-
reusableSVGContainer=reusableSVGContainer||document.createElement('div');reusableSVGContainer.innerHTML='<svg>'+html.valueOf().toString()+'</svg>';var svgNode=reusableSVGContainer.firstChild;while(node.firstChild){node.removeChild(node.firstChild);}while(svgNode.firstChild){node.appendChild(svgNode.firstChild);}return;}}node.innerHTML=html;});/**
|
|
8786
|
-
|
|
8787
|
-
|
|
8788
|
-
|
|
8789
|
-
|
|
8790
|
-
|
|
8791
|
-
|
|
8792
|
-
|
|
8793
|
-
|
|
8794
|
-
|
|
8795
|
-
|
|
9058
|
+
reusableSVGContainer=reusableSVGContainer||document.createElement('div');reusableSVGContainer.innerHTML='<svg>'+html.valueOf().toString()+'</svg>';var svgNode=reusableSVGContainer.firstChild;while(node.firstChild){node.removeChild(node.firstChild);}while(svgNode.firstChild){node.appendChild(svgNode.firstChild);}return;}}node.innerHTML=html;});/**
|
|
9059
|
+
* HTML nodeType values that represent the type of the node
|
|
9060
|
+
*/var ELEMENT_NODE=1;var TEXT_NODE=3;var COMMENT_NODE=8;var DOCUMENT_NODE=9;var DOCUMENT_FRAGMENT_NODE=11;/**
|
|
9061
|
+
* Set the textContent property of a node. For text updates, it's faster
|
|
9062
|
+
* to set the `nodeValue` of the Text node directly instead of using
|
|
9063
|
+
* `.textContent` which will remove the existing node and create a new one.
|
|
9064
|
+
*
|
|
9065
|
+
* @param {DOMElement} node
|
|
9066
|
+
* @param {string} text
|
|
9067
|
+
* @internal
|
|
9068
|
+
*/var setTextContent=function(node,text){if(text){var firstChild=node.firstChild;if(firstChild&&firstChild===node.lastChild&&firstChild.nodeType===TEXT_NODE){firstChild.nodeValue=text;return;}}node.textContent=text;};// List derived from Gecko source code:
|
|
8796
9069
|
// https://github.com/mozilla/gecko-dev/blob/4e638efc71/layout/style/test/property_database.js
|
|
8797
|
-
var shorthandToLonghand={animation:['animationDelay','animationDirection','animationDuration','animationFillMode','animationIterationCount','animationName','animationPlayState','animationTimingFunction'],background:['backgroundAttachment','backgroundClip','backgroundColor','backgroundImage','backgroundOrigin','backgroundPositionX','backgroundPositionY','backgroundRepeat','backgroundSize'],backgroundPosition:['backgroundPositionX','backgroundPositionY'],border:['borderBottomColor','borderBottomStyle','borderBottomWidth','borderImageOutset','borderImageRepeat','borderImageSlice','borderImageSource','borderImageWidth','borderLeftColor','borderLeftStyle','borderLeftWidth','borderRightColor','borderRightStyle','borderRightWidth','borderTopColor','borderTopStyle','borderTopWidth'],borderBlockEnd:['borderBlockEndColor','borderBlockEndStyle','borderBlockEndWidth'],borderBlockStart:['borderBlockStartColor','borderBlockStartStyle','borderBlockStartWidth'],borderBottom:['borderBottomColor','borderBottomStyle','borderBottomWidth'],borderColor:['borderBottomColor','borderLeftColor','borderRightColor','borderTopColor'],borderImage:['borderImageOutset','borderImageRepeat','borderImageSlice','borderImageSource','borderImageWidth'],borderInlineEnd:['borderInlineEndColor','borderInlineEndStyle','borderInlineEndWidth'],borderInlineStart:['borderInlineStartColor','borderInlineStartStyle','borderInlineStartWidth'],borderLeft:['borderLeftColor','borderLeftStyle','borderLeftWidth'],borderRadius:['borderBottomLeftRadius','borderBottomRightRadius','borderTopLeftRadius','borderTopRightRadius'],borderRight:['borderRightColor','borderRightStyle','borderRightWidth'],borderStyle:['borderBottomStyle','borderLeftStyle','borderRightStyle','borderTopStyle'],borderTop:['borderTopColor','borderTopStyle','borderTopWidth'],borderWidth:['borderBottomWidth','borderLeftWidth','borderRightWidth','borderTopWidth'],columnRule:['columnRuleColor','columnRuleStyle','columnRuleWidth'],columns:['columnCount','columnWidth'],flex:['flexBasis','flexGrow','flexShrink'],flexFlow:['flexDirection','flexWrap'],font:['fontFamily','fontFeatureSettings','fontKerning','fontLanguageOverride','fontSize','fontSizeAdjust','fontStretch','fontStyle','fontVariant','fontVariantAlternates','fontVariantCaps','fontVariantEastAsian','fontVariantLigatures','fontVariantNumeric','fontVariantPosition','fontWeight','lineHeight'],fontVariant:['fontVariantAlternates','fontVariantCaps','fontVariantEastAsian','fontVariantLigatures','fontVariantNumeric','fontVariantPosition'],gap:['columnGap','rowGap'],grid:['gridAutoColumns','gridAutoFlow','gridAutoRows','gridTemplateAreas','gridTemplateColumns','gridTemplateRows'],gridArea:['gridColumnEnd','gridColumnStart','gridRowEnd','gridRowStart'],gridColumn:['gridColumnEnd','gridColumnStart'],gridColumnGap:['columnGap'],gridGap:['columnGap','rowGap'],gridRow:['gridRowEnd','gridRowStart'],gridRowGap:['rowGap'],gridTemplate:['gridTemplateAreas','gridTemplateColumns','gridTemplateRows'],listStyle:['listStyleImage','listStylePosition','listStyleType'],margin:['marginBottom','marginLeft','marginRight','marginTop'],marker:['markerEnd','markerMid','markerStart'],mask:['maskClip','maskComposite','maskImage','maskMode','maskOrigin','maskPositionX','maskPositionY','maskRepeat','maskSize'],maskPosition:['maskPositionX','maskPositionY'],outline:['outlineColor','outlineStyle','outlineWidth'],overflow:['overflowX','overflowY'],padding:['paddingBottom','paddingLeft','paddingRight','paddingTop'],placeContent:['alignContent','justifyContent'],placeItems:['alignItems','justifyItems'],placeSelf:['alignSelf','justifySelf'],textDecoration:['textDecorationColor','textDecorationLine','textDecorationStyle'],textEmphasis:['textEmphasisColor','textEmphasisStyle'],transition:['transitionDelay','transitionDuration','transitionProperty','transitionTimingFunction'],wordWrap:['overflowWrap']};/**
|
|
8798
|
-
|
|
8799
|
-
|
|
8800
|
-
fillOpacity:true,floodOpacity:true,stopOpacity:true,strokeDasharray:true,strokeDashoffset:true,strokeMiterlimit:true,strokeOpacity:true,strokeWidth:true};/**
|
|
8801
|
-
|
|
8802
|
-
|
|
8803
|
-
|
|
8804
|
-
|
|
8805
|
-
|
|
8806
|
-
|
|
8807
|
-
|
|
8808
|
-
|
|
9070
|
+
var shorthandToLonghand={animation:['animationDelay','animationDirection','animationDuration','animationFillMode','animationIterationCount','animationName','animationPlayState','animationTimingFunction'],background:['backgroundAttachment','backgroundClip','backgroundColor','backgroundImage','backgroundOrigin','backgroundPositionX','backgroundPositionY','backgroundRepeat','backgroundSize'],backgroundPosition:['backgroundPositionX','backgroundPositionY'],border:['borderBottomColor','borderBottomStyle','borderBottomWidth','borderImageOutset','borderImageRepeat','borderImageSlice','borderImageSource','borderImageWidth','borderLeftColor','borderLeftStyle','borderLeftWidth','borderRightColor','borderRightStyle','borderRightWidth','borderTopColor','borderTopStyle','borderTopWidth'],borderBlockEnd:['borderBlockEndColor','borderBlockEndStyle','borderBlockEndWidth'],borderBlockStart:['borderBlockStartColor','borderBlockStartStyle','borderBlockStartWidth'],borderBottom:['borderBottomColor','borderBottomStyle','borderBottomWidth'],borderColor:['borderBottomColor','borderLeftColor','borderRightColor','borderTopColor'],borderImage:['borderImageOutset','borderImageRepeat','borderImageSlice','borderImageSource','borderImageWidth'],borderInlineEnd:['borderInlineEndColor','borderInlineEndStyle','borderInlineEndWidth'],borderInlineStart:['borderInlineStartColor','borderInlineStartStyle','borderInlineStartWidth'],borderLeft:['borderLeftColor','borderLeftStyle','borderLeftWidth'],borderRadius:['borderBottomLeftRadius','borderBottomRightRadius','borderTopLeftRadius','borderTopRightRadius'],borderRight:['borderRightColor','borderRightStyle','borderRightWidth'],borderStyle:['borderBottomStyle','borderLeftStyle','borderRightStyle','borderTopStyle'],borderTop:['borderTopColor','borderTopStyle','borderTopWidth'],borderWidth:['borderBottomWidth','borderLeftWidth','borderRightWidth','borderTopWidth'],columnRule:['columnRuleColor','columnRuleStyle','columnRuleWidth'],columns:['columnCount','columnWidth'],flex:['flexBasis','flexGrow','flexShrink'],flexFlow:['flexDirection','flexWrap'],font:['fontFamily','fontFeatureSettings','fontKerning','fontLanguageOverride','fontSize','fontSizeAdjust','fontStretch','fontStyle','fontVariant','fontVariantAlternates','fontVariantCaps','fontVariantEastAsian','fontVariantLigatures','fontVariantNumeric','fontVariantPosition','fontWeight','lineHeight'],fontVariant:['fontVariantAlternates','fontVariantCaps','fontVariantEastAsian','fontVariantLigatures','fontVariantNumeric','fontVariantPosition'],gap:['columnGap','rowGap'],grid:['gridAutoColumns','gridAutoFlow','gridAutoRows','gridTemplateAreas','gridTemplateColumns','gridTemplateRows'],gridArea:['gridColumnEnd','gridColumnStart','gridRowEnd','gridRowStart'],gridColumn:['gridColumnEnd','gridColumnStart'],gridColumnGap:['columnGap'],gridGap:['columnGap','rowGap'],gridRow:['gridRowEnd','gridRowStart'],gridRowGap:['rowGap'],gridTemplate:['gridTemplateAreas','gridTemplateColumns','gridTemplateRows'],listStyle:['listStyleImage','listStylePosition','listStyleType'],margin:['marginBottom','marginLeft','marginRight','marginTop'],marker:['markerEnd','markerMid','markerStart'],mask:['maskClip','maskComposite','maskImage','maskMode','maskOrigin','maskPositionX','maskPositionY','maskRepeat','maskSize'],maskPosition:['maskPositionX','maskPositionY'],outline:['outlineColor','outlineStyle','outlineWidth'],overflow:['overflowX','overflowY'],padding:['paddingBottom','paddingLeft','paddingRight','paddingTop'],placeContent:['alignContent','justifyContent'],placeItems:['alignItems','justifyItems'],placeSelf:['alignSelf','justifySelf'],textDecoration:['textDecorationColor','textDecorationLine','textDecorationStyle'],textEmphasis:['textEmphasisColor','textEmphasisStyle'],transition:['transitionDelay','transitionDuration','transitionProperty','transitionTimingFunction'],wordWrap:['overflowWrap']};/**
|
|
9071
|
+
* CSS properties which accept numbers but are not in units of "px".
|
|
9072
|
+
*/var isUnitlessNumber={animationIterationCount:true,aspectRatio:true,borderImageOutset:true,borderImageSlice:true,borderImageWidth:true,boxFlex:true,boxFlexGroup:true,boxOrdinalGroup:true,columnCount:true,columns:true,flex:true,flexGrow:true,flexPositive:true,flexShrink:true,flexNegative:true,flexOrder:true,gridArea:true,gridRow:true,gridRowEnd:true,gridRowSpan:true,gridRowStart:true,gridColumn:true,gridColumnEnd:true,gridColumnSpan:true,gridColumnStart:true,fontWeight:true,lineClamp:true,lineHeight:true,opacity:true,order:true,orphans:true,tabSize:true,widows:true,zIndex:true,zoom:true,// SVG-related properties
|
|
9073
|
+
fillOpacity:true,floodOpacity:true,stopOpacity:true,strokeDasharray:true,strokeDashoffset:true,strokeMiterlimit:true,strokeOpacity:true,strokeWidth:true};/**
|
|
9074
|
+
* @param {string} prefix vendor-specific prefix, eg: Webkit
|
|
9075
|
+
* @param {string} key style name, eg: transitionDuration
|
|
9076
|
+
* @return {string} style name prefixed with `prefix`, properly camelCased, eg:
|
|
9077
|
+
* WebkitTransitionDuration
|
|
9078
|
+
*/function prefixKey(prefix,key){return prefix+key.charAt(0).toUpperCase()+key.substring(1);}/**
|
|
9079
|
+
* Support style names that may come passed in prefixed by adding permutations
|
|
9080
|
+
* of vendor prefixes.
|
|
9081
|
+
*/var prefixes=['Webkit','ms','Moz','O'];// Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
|
|
8809
9082
|
// infinite loop, because it iterates over the newly added props too.
|
|
8810
|
-
Object.keys(isUnitlessNumber).forEach(function(prop){prefixes.forEach(function(prefix){isUnitlessNumber[prefixKey(prefix,prop)]=isUnitlessNumber[prop];});});/**
|
|
8811
|
-
|
|
8812
|
-
|
|
8813
|
-
|
|
8814
|
-
|
|
8815
|
-
|
|
8816
|
-
|
|
8817
|
-
|
|
8818
|
-
|
|
9083
|
+
Object.keys(isUnitlessNumber).forEach(function(prop){prefixes.forEach(function(prefix){isUnitlessNumber[prefixKey(prefix,prop)]=isUnitlessNumber[prop];});});/**
|
|
9084
|
+
* Convert a value into the proper css writable value. The style name `name`
|
|
9085
|
+
* should be logical (no hyphens), as specified
|
|
9086
|
+
* in `CSSProperty.isUnitlessNumber`.
|
|
9087
|
+
*
|
|
9088
|
+
* @param {string} name CSS property name such as `topMargin`.
|
|
9089
|
+
* @param {*} value CSS property value such as `10px`.
|
|
9090
|
+
* @return {string} Normalized style value with dimensions applied.
|
|
9091
|
+
*/function dangerousStyleValue(name,value,isCustomProperty){// Note that we've removed escapeTextForBrowser() calls here since the
|
|
8819
9092
|
// whole string will be escaped when the attribute is injected into
|
|
8820
9093
|
// the markup. If you provide unsafe user data here they can inject
|
|
8821
9094
|
// arbitrary CSS which may be problematic (I couldn't repro this):
|
|
@@ -8825,57 +9098,57 @@ Object.keys(isUnitlessNumber).forEach(function(prop){prefixes.forEach(function(p
|
|
|
8825
9098
|
// which has lead to a greater discussion about how we're going to
|
|
8826
9099
|
// trust URLs moving forward. See #2115901
|
|
8827
9100
|
var isEmpty=value==null||typeof value==='boolean'||value==='';if(isEmpty){return '';}if(!isCustomProperty&&typeof value==='number'&&value!==0&&!(isUnitlessNumber.hasOwnProperty(name)&&isUnitlessNumber[name])){return value+'px';// Presumes implicit 'px' suffix for unitless numbers
|
|
8828
|
-
}{checkCSSPropertyStringCoercion(value,name);}return (''+value).trim();}var uppercasePattern=/([A-Z])/g;var msPattern=/^ms-/;/**
|
|
8829
|
-
|
|
8830
|
-
|
|
8831
|
-
|
|
8832
|
-
|
|
8833
|
-
|
|
8834
|
-
|
|
8835
|
-
|
|
8836
|
-
|
|
8837
|
-
|
|
8838
|
-
|
|
8839
|
-
|
|
8840
|
-
|
|
9101
|
+
}{checkCSSPropertyStringCoercion(value,name);}return (''+value).trim();}var uppercasePattern=/([A-Z])/g;var msPattern=/^ms-/;/**
|
|
9102
|
+
* Hyphenates a camelcased CSS property name, for example:
|
|
9103
|
+
*
|
|
9104
|
+
* > hyphenateStyleName('backgroundColor')
|
|
9105
|
+
* < "background-color"
|
|
9106
|
+
* > hyphenateStyleName('MozTransition')
|
|
9107
|
+
* < "-moz-transition"
|
|
9108
|
+
* > hyphenateStyleName('msTransition')
|
|
9109
|
+
* < "-ms-transition"
|
|
9110
|
+
*
|
|
9111
|
+
* As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
|
|
9112
|
+
* is converted to `-ms-`.
|
|
9113
|
+
*/function hyphenateStyleName(name){return name.replace(uppercasePattern,'-$1').toLowerCase().replace(msPattern,'-ms-');}var warnValidStyle=function(){};{// 'msTransform' is correct, but the other prefixes should be capitalized
|
|
8841
9114
|
var badVendoredStyleNamePattern=/^(?:webkit|moz|o)[A-Z]/;var msPattern$1=/^-ms-/;var hyphenPattern=/-(.)/g;// style values shouldn't contain a semicolon
|
|
8842
9115
|
var badStyleValueWithSemicolonPattern=/;\s*$/;var warnedStyleNames={};var warnedStyleValues={};var warnedForNaNValue=false;var warnedForInfinityValue=false;var camelize=function(string){return string.replace(hyphenPattern,function(_,character){return character.toUpperCase();});};var warnHyphenatedStyleName=function(name){if(warnedStyleNames.hasOwnProperty(name)&&warnedStyleNames[name]){return;}warnedStyleNames[name]=true;error('Unsupported style property %s. Did you mean %s?',name,// As Andi Smith suggests
|
|
8843
9116
|
// (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
|
|
8844
9117
|
// is converted to lowercase `ms`.
|
|
8845
|
-
camelize(name.replace(msPattern$1,'ms-')));};var warnBadVendoredStyleName=function(name){if(warnedStyleNames.hasOwnProperty(name)&&warnedStyleNames[name]){return;}warnedStyleNames[name]=true;error('Unsupported vendor-prefixed style property %s. Did you mean %s?',name,name.charAt(0).toUpperCase()+name.slice(1));};var warnStyleValueWithSemicolon=function(name,value){if(warnedStyleValues.hasOwnProperty(value)&&warnedStyleValues[value]){return;}warnedStyleValues[value]=true;error("Style property values shouldn't contain a semicolon. "+'Try "%s: %s" instead.',name,value.replace(badStyleValueWithSemicolonPattern,''));};var warnStyleValueIsNaN=function(name,value){if(warnedForNaNValue){return;}warnedForNaNValue=true;error('`NaN` is an invalid value for the `%s` css style property.',name);};var warnStyleValueIsInfinity=function(name,value){if(warnedForInfinityValue){return;}warnedForInfinityValue=true;error('`Infinity` is an invalid value for the `%s` css style property.',name);};warnValidStyle=function(name,value){if(name.indexOf('-')>-1){warnHyphenatedStyleName(name);}else if(badVendoredStyleNamePattern.test(name)){warnBadVendoredStyleName(name);}else if(badStyleValueWithSemicolonPattern.test(value)){warnStyleValueWithSemicolon(name,value);}if(typeof value==='number'){if(isNaN(value)){warnStyleValueIsNaN(name,value);}else if(!isFinite(value)){warnStyleValueIsInfinity(name,value);}}};}var warnValidStyle$1=warnValidStyle;/**
|
|
8846
|
-
|
|
8847
|
-
|
|
8848
|
-
|
|
8849
|
-
|
|
8850
|
-
|
|
8851
|
-
|
|
8852
|
-
|
|
8853
|
-
|
|
8854
|
-
|
|
8855
|
-
|
|
8856
|
-
|
|
8857
|
-
|
|
8858
|
-
|
|
8859
|
-
|
|
8860
|
-
|
|
8861
|
-
|
|
8862
|
-
|
|
8863
|
-
|
|
8864
|
-
|
|
8865
|
-
|
|
8866
|
-
|
|
8867
|
-
|
|
8868
|
-
|
|
8869
|
-
|
|
8870
|
-
|
|
8871
|
-
|
|
8872
|
-
|
|
8873
|
-
|
|
8874
|
-
|
|
8875
|
-
|
|
8876
|
-
|
|
8877
|
-
|
|
8878
|
-
|
|
9118
|
+
camelize(name.replace(msPattern$1,'ms-')));};var warnBadVendoredStyleName=function(name){if(warnedStyleNames.hasOwnProperty(name)&&warnedStyleNames[name]){return;}warnedStyleNames[name]=true;error('Unsupported vendor-prefixed style property %s. Did you mean %s?',name,name.charAt(0).toUpperCase()+name.slice(1));};var warnStyleValueWithSemicolon=function(name,value){if(warnedStyleValues.hasOwnProperty(value)&&warnedStyleValues[value]){return;}warnedStyleValues[value]=true;error("Style property values shouldn't contain a semicolon. "+'Try "%s: %s" instead.',name,value.replace(badStyleValueWithSemicolonPattern,''));};var warnStyleValueIsNaN=function(name,value){if(warnedForNaNValue){return;}warnedForNaNValue=true;error('`NaN` is an invalid value for the `%s` css style property.',name);};var warnStyleValueIsInfinity=function(name,value){if(warnedForInfinityValue){return;}warnedForInfinityValue=true;error('`Infinity` is an invalid value for the `%s` css style property.',name);};warnValidStyle=function(name,value){if(name.indexOf('-')>-1){warnHyphenatedStyleName(name);}else if(badVendoredStyleNamePattern.test(name)){warnBadVendoredStyleName(name);}else if(badStyleValueWithSemicolonPattern.test(value)){warnStyleValueWithSemicolon(name,value);}if(typeof value==='number'){if(isNaN(value)){warnStyleValueIsNaN(name,value);}else if(!isFinite(value)){warnStyleValueIsInfinity(name,value);}}};}var warnValidStyle$1=warnValidStyle;/**
|
|
9119
|
+
* Operations for dealing with CSS properties.
|
|
9120
|
+
*//**
|
|
9121
|
+
* This creates a string that is expected to be equivalent to the style
|
|
9122
|
+
* attribute generated by server-side rendering. It by-passes warnings and
|
|
9123
|
+
* security checks so it's not safe to use this value for anything other than
|
|
9124
|
+
* comparison. It is only used in DEV for SSR validation.
|
|
9125
|
+
*/function createDangerousStringForStyles(styles){{var serialized='';var delimiter='';for(var styleName in styles){if(!styles.hasOwnProperty(styleName)){continue;}var styleValue=styles[styleName];if(styleValue!=null){var isCustomProperty=styleName.indexOf('--')===0;serialized+=delimiter+(isCustomProperty?styleName:hyphenateStyleName(styleName))+':';serialized+=dangerousStyleValue(styleName,styleValue,isCustomProperty);delimiter=';';}}return serialized||null;}}/**
|
|
9126
|
+
* Sets the value for multiple styles on a node. If a value is specified as
|
|
9127
|
+
* '' (empty string), the corresponding style property will be unset.
|
|
9128
|
+
*
|
|
9129
|
+
* @param {DOMElement} node
|
|
9130
|
+
* @param {object} styles
|
|
9131
|
+
*/function setValueForStyles(node,styles){var style=node.style;for(var styleName in styles){if(!styles.hasOwnProperty(styleName)){continue;}var isCustomProperty=styleName.indexOf('--')===0;{if(!isCustomProperty){warnValidStyle$1(styleName,styles[styleName]);}}var styleValue=dangerousStyleValue(styleName,styles[styleName],isCustomProperty);if(styleName==='float'){styleName='cssFloat';}if(isCustomProperty){style.setProperty(styleName,styleValue);}else {style[styleName]=styleValue;}}}function isValueEmpty(value){return value==null||typeof value==='boolean'||value==='';}/**
|
|
9132
|
+
* Given {color: 'red', overflow: 'hidden'} returns {
|
|
9133
|
+
* color: 'color',
|
|
9134
|
+
* overflowX: 'overflow',
|
|
9135
|
+
* overflowY: 'overflow',
|
|
9136
|
+
* }. This can be read as "the overflowY property was set by the overflow
|
|
9137
|
+
* shorthand". That is, the values are the property that each was derived from.
|
|
9138
|
+
*/function expandShorthandMap(styles){var expanded={};for(var key in styles){var longhands=shorthandToLonghand[key]||[key];for(var i=0;i<longhands.length;i++){expanded[longhands[i]]=key;}}return expanded;}/**
|
|
9139
|
+
* When mixing shorthand and longhand property names, we warn during updates if
|
|
9140
|
+
* we expect an incorrect result to occur. In particular, we warn for:
|
|
9141
|
+
*
|
|
9142
|
+
* Updating a shorthand property (longhand gets overwritten):
|
|
9143
|
+
* {font: 'foo', fontVariant: 'bar'} -> {font: 'baz', fontVariant: 'bar'}
|
|
9144
|
+
* becomes .style.font = 'baz'
|
|
9145
|
+
* Removing a shorthand property (longhand gets lost too):
|
|
9146
|
+
* {font: 'foo', fontVariant: 'bar'} -> {fontVariant: 'bar'}
|
|
9147
|
+
* becomes .style.font = ''
|
|
9148
|
+
* Removing a longhand property (should revert to shorthand; doesn't):
|
|
9149
|
+
* {font: 'foo', fontVariant: 'bar'} -> {font: 'foo'}
|
|
9150
|
+
* becomes .style.fontVariant = ''
|
|
9151
|
+
*/function validateShorthandPropertyCollisionInDev(styleUpdates,nextStyles){{if(!nextStyles){return;}var expandedUpdates=expandShorthandMap(styleUpdates);var expandedStyles=expandShorthandMap(nextStyles);var warnedAbout={};for(var key in expandedUpdates){var originalKey=expandedUpdates[key];var correctOriginalKey=expandedStyles[key];if(correctOriginalKey&&originalKey!==correctOriginalKey){var warningKey=originalKey+','+correctOriginalKey;if(warnedAbout[warningKey]){continue;}warnedAbout[warningKey]=true;error('%s a style property during rerender (%s) when a '+'conflicting property is set (%s) can lead to styling bugs. To '+"avoid this, don't mix shorthand and non-shorthand properties "+'for the same value; instead, replace the shorthand with '+'separate values.',isValueEmpty(styleUpdates[originalKey])?'Removing':'Updating',originalKey,correctOriginalKey);}}}}// For HTML, certain tags should omit their close tag. We keep a list for
|
|
8879
9152
|
// those special-case tags.
|
|
8880
9153
|
var omittedCloseTags={area:true,base:true,br:true,col:true,embed:true,hr:true,img:true,input:true,keygen:true,link:true,meta:true,param:true,source:true,track:true,wbr:true// NOTE: menuitem's close tag should be omitted, but that causes problems.
|
|
8881
9154
|
};// `omittedCloseTags` except that `menuitem` should still have its closing tag.
|
|
@@ -8921,13 +9194,13 @@ if((value==='false'||value==='true')&&propertyInfo!==null&&propertyInfo.type===B
|
|
|
8921
9194
|
// We also don't want to defer during event replaying.
|
|
8922
9195
|
var SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS=IS_EVENT_HANDLE_NON_MANAGED_NODE|IS_NON_DELEGATED|IS_CAPTURE_PHASE;// This exists to avoid circular dependency between ReactDOMEventReplaying
|
|
8923
9196
|
// and DOMPluginEventSystem.
|
|
8924
|
-
var currentReplayingEvent=null;function setReplayingEvent(event){{if(currentReplayingEvent!==null){error('Expected currently replaying event to be null. This error '+'is likely caused by a bug in React. Please file an issue.');}}currentReplayingEvent=event;}function resetReplayingEvent(){{if(currentReplayingEvent===null){error('Expected currently replaying event to not be null. This error '+'is likely caused by a bug in React. Please file an issue.');}}currentReplayingEvent=null;}function isReplayingEvent(event){return event===currentReplayingEvent;}/**
|
|
8925
|
-
|
|
8926
|
-
|
|
8927
|
-
|
|
8928
|
-
|
|
8929
|
-
|
|
8930
|
-
|
|
9197
|
+
var currentReplayingEvent=null;function setReplayingEvent(event){{if(currentReplayingEvent!==null){error('Expected currently replaying event to be null. This error '+'is likely caused by a bug in React. Please file an issue.');}}currentReplayingEvent=event;}function resetReplayingEvent(){{if(currentReplayingEvent===null){error('Expected currently replaying event to not be null. This error '+'is likely caused by a bug in React. Please file an issue.');}}currentReplayingEvent=null;}function isReplayingEvent(event){return event===currentReplayingEvent;}/**
|
|
9198
|
+
* Gets the target node from a native browser event by accounting for
|
|
9199
|
+
* inconsistencies in browser DOM APIs.
|
|
9200
|
+
*
|
|
9201
|
+
* @param {object} nativeEvent Native browser event.
|
|
9202
|
+
* @return {DOMEventTarget} Target node.
|
|
9203
|
+
*/function getEventTarget(nativeEvent){// Fallback to nativeEvent.srcElement for IE9
|
|
8931
9204
|
// https://github.com/facebook/react/issues/12506
|
|
8932
9205
|
var target=nativeEvent.target||nativeEvent.srcElement||window;// Normalize SVG <use> element events #4963
|
|
8933
9206
|
if(target.correspondingUseElement){target=target.correspondingUseElement;}// Safari may fire events on text nodes (Node.TEXT_NODE is 3).
|
|
@@ -8953,11 +9226,11 @@ var controlledComponentsHavePendingUpdates=needsStateRestore();if(controlledComp
|
|
|
8953
9226
|
flushSyncImpl();restoreStateIfNeeded();}}function batchedUpdates(fn,a,b){if(isInsideEventHandler){// If we are currently inside another batch, we need to wait until it
|
|
8954
9227
|
// fully completes before restoring state.
|
|
8955
9228
|
return fn(a,b);}isInsideEventHandler=true;try{return batchedUpdatesImpl(fn,a,b);}finally{isInsideEventHandler=false;finishEventHandler();}}// TODO: Replace with flushSync
|
|
8956
|
-
function setBatchingImplementation(_batchedUpdatesImpl,_discreteUpdatesImpl,_flushSyncImpl){batchedUpdatesImpl=_batchedUpdatesImpl;flushSyncImpl=_flushSyncImpl;}function isInteractive(tag){return tag==='button'||tag==='input'||tag==='select'||tag==='textarea';}function shouldPreventMouseEvent(name,type,props){switch(name){case'onClick':case'onClickCapture':case'onDoubleClick':case'onDoubleClickCapture':case'onMouseDown':case'onMouseDownCapture':case'onMouseMove':case'onMouseMoveCapture':case'onMouseUp':case'onMouseUpCapture':case'onMouseEnter':return !!(props.disabled&&isInteractive(type));default:return false;}}/**
|
|
8957
|
-
|
|
8958
|
-
|
|
8959
|
-
|
|
8960
|
-
|
|
9229
|
+
function setBatchingImplementation(_batchedUpdatesImpl,_discreteUpdatesImpl,_flushSyncImpl){batchedUpdatesImpl=_batchedUpdatesImpl;flushSyncImpl=_flushSyncImpl;}function isInteractive(tag){return tag==='button'||tag==='input'||tag==='select'||tag==='textarea';}function shouldPreventMouseEvent(name,type,props){switch(name){case'onClick':case'onClickCapture':case'onDoubleClick':case'onDoubleClickCapture':case'onMouseDown':case'onMouseDownCapture':case'onMouseMove':case'onMouseMoveCapture':case'onMouseUp':case'onMouseUpCapture':case'onMouseEnter':return !!(props.disabled&&isInteractive(type));default:return false;}}/**
|
|
9230
|
+
* @param {object} inst The instance, which is the source of events.
|
|
9231
|
+
* @param {string} registrationName Name of listener (e.g. `onClick`).
|
|
9232
|
+
* @return {?function} The stored callback.
|
|
9233
|
+
*/function getListener(inst,registrationName){var stateNode=inst.stateNode;if(stateNode===null){// Work in progress (ex: onload events in incremental mode).
|
|
8961
9234
|
return null;}var props=getFiberCurrentPropsFromNode(stateNode);if(props===null){// Work in progress.
|
|
8962
9235
|
return null;}var listener=props[registrationName];if(shouldPreventMouseEvent(registrationName,inst.type,props)){return null;}if(listener&&typeof listener!=='function'){throw new Error("Expected `"+registrationName+"` listener to be a function, instead got a value of `"+typeof listener+"` type.");}return listener;}var passiveBrowserEventsSupported=false;// Check if browser support events with passive listeners
|
|
8963
9236
|
// https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support
|
|
@@ -9037,39 +9310,39 @@ window.removeEventListener('error',handleWindowError);if(!didCall){// Something
|
|
|
9037
9310
|
// https://github.com/facebook/react/issues/16585
|
|
9038
9311
|
// Fall back to the production implementation.
|
|
9039
9312
|
restoreAfterDispatch();return invokeGuardedCallbackProd.apply(this,arguments);}};}}var invokeGuardedCallbackImpl$1=invokeGuardedCallbackImpl;var hasError=false;var caughtError=null;// Used by event system to capture/rethrow the first error.
|
|
9040
|
-
var hasRethrowError=false;var rethrowError=null;var reporter={onError:function(error){hasError=true;caughtError=error;}};/**
|
|
9041
|
-
|
|
9042
|
-
|
|
9043
|
-
|
|
9044
|
-
|
|
9045
|
-
|
|
9046
|
-
|
|
9047
|
-
|
|
9048
|
-
|
|
9049
|
-
|
|
9050
|
-
|
|
9051
|
-
|
|
9052
|
-
|
|
9053
|
-
|
|
9054
|
-
|
|
9055
|
-
|
|
9056
|
-
|
|
9057
|
-
|
|
9058
|
-
|
|
9059
|
-
|
|
9060
|
-
|
|
9061
|
-
|
|
9062
|
-
|
|
9063
|
-
|
|
9064
|
-
|
|
9065
|
-
|
|
9066
|
-
|
|
9067
|
-
|
|
9068
|
-
|
|
9069
|
-
|
|
9070
|
-
|
|
9071
|
-
|
|
9072
|
-
|
|
9313
|
+
var hasRethrowError=false;var rethrowError=null;var reporter={onError:function(error){hasError=true;caughtError=error;}};/**
|
|
9314
|
+
* Call a function while guarding against errors that happens within it.
|
|
9315
|
+
* Returns an error if it throws, otherwise null.
|
|
9316
|
+
*
|
|
9317
|
+
* In production, this is implemented using a try-catch. The reason we don't
|
|
9318
|
+
* use a try-catch directly is so that we can swap out a different
|
|
9319
|
+
* implementation in DEV mode.
|
|
9320
|
+
*
|
|
9321
|
+
* @param {String} name of the guard to use for logging or debugging
|
|
9322
|
+
* @param {Function} func The function to invoke
|
|
9323
|
+
* @param {*} context The context to use when calling the function
|
|
9324
|
+
* @param {...*} args Arguments for function
|
|
9325
|
+
*/function invokeGuardedCallback(name,func,context,a,b,c,d,e,f){hasError=false;caughtError=null;invokeGuardedCallbackImpl$1.apply(reporter,arguments);}/**
|
|
9326
|
+
* Same as invokeGuardedCallback, but instead of returning an error, it stores
|
|
9327
|
+
* it in a global so it can be rethrown by `rethrowCaughtError` later.
|
|
9328
|
+
* TODO: See if caughtError and rethrowError can be unified.
|
|
9329
|
+
*
|
|
9330
|
+
* @param {String} name of the guard to use for logging or debugging
|
|
9331
|
+
* @param {Function} func The function to invoke
|
|
9332
|
+
* @param {*} context The context to use when calling the function
|
|
9333
|
+
* @param {...*} args Arguments for function
|
|
9334
|
+
*/function invokeGuardedCallbackAndCatchFirstError(name,func,context,a,b,c,d,e,f){invokeGuardedCallback.apply(this,arguments);if(hasError){var error=clearCaughtError();if(!hasRethrowError){hasRethrowError=true;rethrowError=error;}}}/**
|
|
9335
|
+
* During execution of guarded functions we will capture the first error which
|
|
9336
|
+
* we will rethrow to be handled by the top level error handler.
|
|
9337
|
+
*/function rethrowCaughtError(){if(hasRethrowError){var error=rethrowError;hasRethrowError=false;rethrowError=null;throw error;}}function hasCaughtError(){return hasError;}function clearCaughtError(){if(hasError){var error=caughtError;hasError=false;caughtError=null;return error;}else {throw new Error('clearCaughtError was called but no error was captured. This error '+'is likely caused by a bug in React. Please file an issue.');}}/**
|
|
9338
|
+
* `ReactInstanceMap` maintains a mapping from a public facing stateful
|
|
9339
|
+
* instance (key) and the internal representation (value). This allows public
|
|
9340
|
+
* methods to accept the user facing instance as an argument and map them back
|
|
9341
|
+
* to internal methods.
|
|
9342
|
+
*
|
|
9343
|
+
* Note that this module is currently shared and assumed to be stateless.
|
|
9344
|
+
* If this becomes an actual Map, that will break.
|
|
9345
|
+
*/function get(key){return key._reactInternals;}function has(key){return key._reactInternals!==undefined;}function set(key,value){key._reactInternals=value;}// Don't change these two values. They're used by React Dev Tools.
|
|
9073
9346
|
var NoFlags=/* */0;var PerformedWork=/* */1;// You can change the rest (and add more).
|
|
9074
9347
|
var Placement=/* */2;var Update=/* */4;var ChildDeletion=/* */16;var ContentReset=/* */32;var Callback=/* */64;var DidCapture=/* */128;var ForceClientRender=/* */256;var Ref=/* */512;var Snapshot=/* */1024;var Passive=/* */2048;var Hydrating=/* */4096;var Visibility=/* */8192;var StoreConsistency=/* */16384;var LifecycleEffectMask=Passive|Update|Callback|Ref|Snapshot|StoreConsistency;// Union of all commit flags (flags with the lifetime of a particular commit)
|
|
9075
9348
|
var HostEffectMask=/* */32767;// These are not really side effects, but we still reuse this field.
|
|
@@ -9290,8 +9563,7 @@ var queuedDiscreteEvents=[];// Indicates if any continuous event targets are non
|
|
|
9290
9563
|
// if the last target was dehydrated.
|
|
9291
9564
|
var queuedFocus=null;var queuedDrag=null;var queuedMouse=null;// For pointer events there can be one latest event per pointerId.
|
|
9292
9565
|
var queuedPointers=new Map();var queuedPointerCaptures=new Map();// We could consider replaying selectionchange and touchmoves too.
|
|
9293
|
-
var queuedExplicitHydrationTargets=[];var discreteReplayableEvents=['mousedown','mouseup','touchcancel','touchend','touchstart','auxclick','dblclick','pointercancel','pointerdown','pointerup','dragend','dragstart','drop','compositionend','compositionstart','keydown','keypress','keyup','input','textInput'
|
|
9294
|
-
'copy','cut','paste','click','change','contextmenu','reset','submit'];function isDiscreteEventThatRequiresHydration(eventType){return discreteReplayableEvents.indexOf(eventType)>-1;}function createQueuedReplayableEvent(blockedOn,domEventName,eventSystemFlags,targetContainer,nativeEvent){return {blockedOn:blockedOn,domEventName:domEventName,eventSystemFlags:eventSystemFlags,nativeEvent:nativeEvent,targetContainers:[targetContainer]};}function clearIfContinuousEvent(domEventName,nativeEvent){switch(domEventName){case'focusin':case'focusout':queuedFocus=null;break;case'dragenter':case'dragleave':queuedDrag=null;break;case'mouseover':case'mouseout':queuedMouse=null;break;case'pointerover':case'pointerout':{var pointerId=nativeEvent.pointerId;queuedPointers.delete(pointerId);break;}case'gotpointercapture':case'lostpointercapture':{var _pointerId=nativeEvent.pointerId;queuedPointerCaptures.delete(_pointerId);break;}}}function accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent,blockedOn,domEventName,eventSystemFlags,targetContainer,nativeEvent){if(existingQueuedEvent===null||existingQueuedEvent.nativeEvent!==nativeEvent){var queuedEvent=createQueuedReplayableEvent(blockedOn,domEventName,eventSystemFlags,targetContainer,nativeEvent);if(blockedOn!==null){var _fiber2=getInstanceFromNode(blockedOn);if(_fiber2!==null){// Attempt to increase the priority of this target.
|
|
9566
|
+
var queuedExplicitHydrationTargets=[];var discreteReplayableEvents=['mousedown','mouseup','touchcancel','touchend','touchstart','auxclick','dblclick','pointercancel','pointerdown','pointerup','dragend','dragstart','drop','compositionend','compositionstart','keydown','keypress','keyup','input','textInput','copy','cut','paste','click','change','contextmenu','reset','submit'];function isDiscreteEventThatRequiresHydration(eventType){return discreteReplayableEvents.indexOf(eventType)>-1;}function createQueuedReplayableEvent(blockedOn,domEventName,eventSystemFlags,targetContainer,nativeEvent){return {blockedOn:blockedOn,domEventName:domEventName,eventSystemFlags:eventSystemFlags,nativeEvent:nativeEvent,targetContainers:[targetContainer]};}function clearIfContinuousEvent(domEventName,nativeEvent){switch(domEventName){case'focusin':case'focusout':queuedFocus=null;break;case'dragenter':case'dragleave':queuedDrag=null;break;case'mouseover':case'mouseout':queuedMouse=null;break;case'pointerover':case'pointerout':{var pointerId=nativeEvent.pointerId;queuedPointers.delete(pointerId);break;}case'gotpointercapture':case'lostpointercapture':{var _pointerId=nativeEvent.pointerId;queuedPointerCaptures.delete(_pointerId);break;}}}function accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent,blockedOn,domEventName,eventSystemFlags,targetContainer,nativeEvent){if(existingQueuedEvent===null||existingQueuedEvent.nativeEvent!==nativeEvent){var queuedEvent=createQueuedReplayableEvent(blockedOn,domEventName,eventSystemFlags,targetContainer,nativeEvent);if(blockedOn!==null){var _fiber2=getInstanceFromNode(blockedOn);if(_fiber2!==null){// Attempt to increase the priority of this target.
|
|
9295
9567
|
attemptContinuousHydration(_fiber2);}}return queuedEvent;}// If we have already queued this exact event, then it's because
|
|
9296
9568
|
// the different event systems have different DOM event listeners.
|
|
9297
9569
|
// We can accumulate the flags, and the targetContainers, and
|
|
@@ -9361,26 +9633,26 @@ case'mouseenter':case'mouseleave':case'pointerenter':case'pointerleave':return C
|
|
|
9361
9633
|
// Eventually this mechanism will be replaced by a check
|
|
9362
9634
|
// of the current priority on the native scheduler.
|
|
9363
9635
|
var schedulerPriority=getCurrentPriorityLevel();switch(schedulerPriority){case ImmediatePriority:return DiscreteEventPriority;case UserBlockingPriority:return ContinuousEventPriority;case NormalPriority:case LowPriority:// TODO: Handle LowSchedulerPriority, somehow. Maybe the same lane as hydration.
|
|
9364
|
-
return DefaultEventPriority;case IdlePriority:return IdleEventPriority;default:return DefaultEventPriority;}}default:return DefaultEventPriority;}}function addEventBubbleListener(target,eventType,listener){target.addEventListener(eventType,listener,false);return listener;}function addEventCaptureListener(target,eventType,listener){target.addEventListener(eventType,listener,true);return listener;}function addEventCaptureListenerWithPassiveFlag(target,eventType,listener,passive){target.addEventListener(eventType,listener,{capture:true,passive:passive});return listener;}function addEventBubbleListenerWithPassiveFlag(target,eventType,listener,passive){target.addEventListener(eventType,listener,{passive:passive});return listener;}/**
|
|
9365
|
-
|
|
9366
|
-
|
|
9367
|
-
|
|
9368
|
-
|
|
9369
|
-
|
|
9370
|
-
|
|
9371
|
-
|
|
9372
|
-
|
|
9373
|
-
|
|
9374
|
-
|
|
9375
|
-
|
|
9376
|
-
|
|
9377
|
-
|
|
9378
|
-
|
|
9379
|
-
|
|
9380
|
-
|
|
9381
|
-
|
|
9382
|
-
|
|
9383
|
-
|
|
9636
|
+
return DefaultEventPriority;case IdlePriority:return IdleEventPriority;default:return DefaultEventPriority;}}default:return DefaultEventPriority;}}function addEventBubbleListener(target,eventType,listener){target.addEventListener(eventType,listener,false);return listener;}function addEventCaptureListener(target,eventType,listener){target.addEventListener(eventType,listener,true);return listener;}function addEventCaptureListenerWithPassiveFlag(target,eventType,listener,passive){target.addEventListener(eventType,listener,{capture:true,passive:passive});return listener;}function addEventBubbleListenerWithPassiveFlag(target,eventType,listener,passive){target.addEventListener(eventType,listener,{passive:passive});return listener;}/**
|
|
9637
|
+
* These variables store information about text content of a target node,
|
|
9638
|
+
* allowing comparison of content before and after a given event.
|
|
9639
|
+
*
|
|
9640
|
+
* Identify the node where selection currently begins, then observe
|
|
9641
|
+
* both its text content and its current position in the DOM. Since the
|
|
9642
|
+
* browser may natively replace the target node during composition, we can
|
|
9643
|
+
* use its position to find its replacement.
|
|
9644
|
+
*
|
|
9645
|
+
*
|
|
9646
|
+
*/var root=null;var startText=null;var fallbackText=null;function initialize(nativeEventTarget){root=nativeEventTarget;startText=getText();return true;}function reset(){root=null;startText=null;fallbackText=null;}function getData(){if(fallbackText){return fallbackText;}var start;var startValue=startText;var startLength=startValue.length;var end;var endValue=getText();var endLength=endValue.length;for(start=0;start<startLength;start++){if(startValue[start]!==endValue[start]){break;}}var minEnd=startLength-start;for(end=1;end<=minEnd;end++){if(startValue[startLength-end]!==endValue[endLength-end]){break;}}var sliceTail=end>1?1-end:undefined;fallbackText=endValue.slice(start,sliceTail);return fallbackText;}function getText(){if('value'in root){return root.value;}return root.textContent;}/**
|
|
9647
|
+
* `charCode` represents the actual "character code" and is safe to use with
|
|
9648
|
+
* `String.fromCharCode`. As such, only keys that correspond to printable
|
|
9649
|
+
* characters produce a valid `charCode`, the only exception to this is Enter.
|
|
9650
|
+
* The Tab-key is considered non-printable and does not have a `charCode`,
|
|
9651
|
+
* presumably because it does not produce a tab-character in browsers.
|
|
9652
|
+
*
|
|
9653
|
+
* @param {object} nativeEvent Native browser event.
|
|
9654
|
+
* @return {number} Normalized `charCode` property.
|
|
9655
|
+
*/function getEventCharCode(nativeEvent){var charCode;var keyCode=nativeEvent.keyCode;if('charCode'in nativeEvent){charCode=nativeEvent.charCode;// FF does not set `charCode` for the Enter-key, check against `keyCode`.
|
|
9384
9656
|
if(charCode===0&&keyCode===13){charCode=13;}}else {// IE8 does not implement `charCode`, but `keyCode` has the correct value.
|
|
9385
9657
|
charCode=keyCode;}// IE and Edge (on Windows) and Chrome / Safari (on Windows and Linux)
|
|
9386
9658
|
// report Enter as charCode 10 when ctrl is pressed.
|
|
@@ -9388,75 +9660,74 @@ if(charCode===10){charCode=13;}// Some non-printable keys are reported in `charC
|
|
|
9388
9660
|
// Must not discard the (non-)printable Enter-key.
|
|
9389
9661
|
if(charCode>=32||charCode===13){return charCode;}return 0;}function functionThatReturnsTrue(){return true;}function functionThatReturnsFalse(){return false;}// This is intentionally a factory so that we have different returned constructors.
|
|
9390
9662
|
// If we had a single constructor, it would be megamorphic and engines would deopt.
|
|
9391
|
-
function createSyntheticEvent(Interface){/**
|
|
9392
|
-
|
|
9393
|
-
|
|
9394
|
-
|
|
9395
|
-
|
|
9396
|
-
|
|
9397
|
-
|
|
9398
|
-
|
|
9399
|
-
|
|
9400
|
-
|
|
9401
|
-
|
|
9402
|
-
|
|
9403
|
-
|
|
9663
|
+
function createSyntheticEvent(Interface){/**
|
|
9664
|
+
* Synthetic events are dispatched by event plugins, typically in response to a
|
|
9665
|
+
* top-level event delegation handler.
|
|
9666
|
+
*
|
|
9667
|
+
* These systems should generally use pooling to reduce the frequency of garbage
|
|
9668
|
+
* collection. The system should check `isPersistent` to determine whether the
|
|
9669
|
+
* event should be released into the pool after being dispatched. Users that
|
|
9670
|
+
* need a persisted event should invoke `persist`.
|
|
9671
|
+
*
|
|
9672
|
+
* Synthetic events (and subclasses) implement the DOM Level 3 Events API by
|
|
9673
|
+
* normalizing browser quirks. Subclasses do not necessarily have to implement a
|
|
9674
|
+
* DOM interface; custom application-specific events can also subclass this.
|
|
9675
|
+
*/function SyntheticBaseEvent(reactName,reactEventType,targetInst,nativeEvent,nativeEventTarget){this._reactName=reactName;this._targetInst=targetInst;this.type=reactEventType;this.nativeEvent=nativeEvent;this.target=nativeEventTarget;this.currentTarget=null;for(var _propName in Interface){if(!Interface.hasOwnProperty(_propName)){continue;}var normalize=Interface[_propName];if(normalize){this[_propName]=normalize(nativeEvent);}else {this[_propName]=nativeEvent[_propName];}}var defaultPrevented=nativeEvent.defaultPrevented!=null?nativeEvent.defaultPrevented:nativeEvent.returnValue===false;if(defaultPrevented){this.isDefaultPrevented=functionThatReturnsTrue;}else {this.isDefaultPrevented=functionThatReturnsFalse;}this.isPropagationStopped=functionThatReturnsFalse;return this;}assign(SyntheticBaseEvent.prototype,{preventDefault:function(){this.defaultPrevented=true;var event=this.nativeEvent;if(!event){return;}if(event.preventDefault){event.preventDefault();// $FlowFixMe - flow is not aware of `unknown` in IE
|
|
9404
9676
|
}else if(typeof event.returnValue!=='unknown'){event.returnValue=false;}this.isDefaultPrevented=functionThatReturnsTrue;},stopPropagation:function(){var event=this.nativeEvent;if(!event){return;}if(event.stopPropagation){event.stopPropagation();// $FlowFixMe - flow is not aware of `unknown` in IE
|
|
9405
9677
|
}else if(typeof event.cancelBubble!=='unknown'){// The ChangeEventPlugin registers a "propertychange" event for
|
|
9406
9678
|
// IE. This event does not support bubbling or cancelling, and
|
|
9407
9679
|
// any references to cancelBubble throw "Member not found". A
|
|
9408
9680
|
// typeof check of "unknown" circumvents this issue (and is also
|
|
9409
9681
|
// IE specific).
|
|
9410
|
-
event.cancelBubble=true;}this.isPropagationStopped=functionThatReturnsTrue;},/**
|
|
9411
|
-
|
|
9412
|
-
|
|
9413
|
-
|
|
9414
|
-
|
|
9415
|
-
|
|
9416
|
-
|
|
9417
|
-
|
|
9418
|
-
|
|
9419
|
-
|
|
9420
|
-
|
|
9421
|
-
|
|
9422
|
-
|
|
9423
|
-
|
|
9424
|
-
|
|
9425
|
-
*/var MouseEventInterface=assign({},UIEventInterface,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:getEventModifierState,button:0,buttons:0,relatedTarget:function(event){if(event.relatedTarget===undefined)return event.fromElement===event.srcElement?event.toElement:event.fromElement;return event.relatedTarget;},movementX:function(event){if('movementX'in event){return event.movementX;}updateMouseMovementPolyfillState(event);return lastMovementX;},movementY:function(event){if('movementY'in event){return event.movementY;}// Don't need to call updateMouseMovementPolyfillState() here
|
|
9682
|
+
event.cancelBubble=true;}this.isPropagationStopped=functionThatReturnsTrue;},/**
|
|
9683
|
+
* We release all dispatched `SyntheticEvent`s after each event loop, adding
|
|
9684
|
+
* them back into the pool. This allows a way to hold onto a reference that
|
|
9685
|
+
* won't be added back into the pool.
|
|
9686
|
+
*/persist:function(){},/**
|
|
9687
|
+
* Checks if this event should be released back into the pool.
|
|
9688
|
+
*
|
|
9689
|
+
* @return {boolean} True if this should not be released, false otherwise.
|
|
9690
|
+
*/isPersistent:functionThatReturnsTrue});return SyntheticBaseEvent;}/**
|
|
9691
|
+
* @interface Event
|
|
9692
|
+
* @see http://www.w3.org/TR/DOM-Level-3-Events/
|
|
9693
|
+
*/var EventInterface={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(event){return event.timeStamp||Date.now();},defaultPrevented:0,isTrusted:0};var SyntheticEvent=createSyntheticEvent(EventInterface);var UIEventInterface=assign({},EventInterface,{view:0,detail:0});var SyntheticUIEvent=createSyntheticEvent(UIEventInterface);var lastMovementX;var lastMovementY;var lastMouseEvent;function updateMouseMovementPolyfillState(event){if(event!==lastMouseEvent){if(lastMouseEvent&&event.type==='mousemove'){lastMovementX=event.screenX-lastMouseEvent.screenX;lastMovementY=event.screenY-lastMouseEvent.screenY;}else {lastMovementX=0;lastMovementY=0;}lastMouseEvent=event;}}/**
|
|
9694
|
+
* @interface MouseEvent
|
|
9695
|
+
* @see http://www.w3.org/TR/DOM-Level-3-Events/
|
|
9696
|
+
*/var MouseEventInterface=assign({},UIEventInterface,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:getEventModifierState,button:0,buttons:0,relatedTarget:function(event){if(event.relatedTarget===undefined)return event.fromElement===event.srcElement?event.toElement:event.fromElement;return event.relatedTarget;},movementX:function(event){if('movementX'in event){return event.movementX;}updateMouseMovementPolyfillState(event);return lastMovementX;},movementY:function(event){if('movementY'in event){return event.movementY;}// Don't need to call updateMouseMovementPolyfillState() here
|
|
9426
9697
|
// because it's guaranteed to have already run when movementX
|
|
9427
9698
|
// was copied.
|
|
9428
|
-
return lastMovementY;}});var SyntheticMouseEvent=createSyntheticEvent(MouseEventInterface);/**
|
|
9429
|
-
|
|
9430
|
-
|
|
9431
|
-
|
|
9432
|
-
|
|
9433
|
-
|
|
9434
|
-
|
|
9435
|
-
|
|
9436
|
-
|
|
9437
|
-
|
|
9438
|
-
|
|
9439
|
-
|
|
9440
|
-
|
|
9441
|
-
|
|
9442
|
-
|
|
9443
|
-
|
|
9444
|
-
|
|
9445
|
-
|
|
9446
|
-
|
|
9447
|
-
|
|
9448
|
-
|
|
9449
|
-
var SyntheticInputEvent=SyntheticCompositionEvent;/**
|
|
9450
|
-
|
|
9451
|
-
|
|
9452
|
-
|
|
9453
|
-
|
|
9454
|
-
|
|
9455
|
-
|
|
9456
|
-
|
|
9457
|
-
|
|
9458
|
-
|
|
9459
|
-
|
|
9699
|
+
return lastMovementY;}});var SyntheticMouseEvent=createSyntheticEvent(MouseEventInterface);/**
|
|
9700
|
+
* @interface DragEvent
|
|
9701
|
+
* @see http://www.w3.org/TR/DOM-Level-3-Events/
|
|
9702
|
+
*/var DragEventInterface=assign({},MouseEventInterface,{dataTransfer:0});var SyntheticDragEvent=createSyntheticEvent(DragEventInterface);/**
|
|
9703
|
+
* @interface FocusEvent
|
|
9704
|
+
* @see http://www.w3.org/TR/DOM-Level-3-Events/
|
|
9705
|
+
*/var FocusEventInterface=assign({},UIEventInterface,{relatedTarget:0});var SyntheticFocusEvent=createSyntheticEvent(FocusEventInterface);/**
|
|
9706
|
+
* @interface Event
|
|
9707
|
+
* @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface
|
|
9708
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent
|
|
9709
|
+
*/var AnimationEventInterface=assign({},EventInterface,{animationName:0,elapsedTime:0,pseudoElement:0});var SyntheticAnimationEvent=createSyntheticEvent(AnimationEventInterface);/**
|
|
9710
|
+
* @interface Event
|
|
9711
|
+
* @see http://www.w3.org/TR/clipboard-apis/
|
|
9712
|
+
*/var ClipboardEventInterface=assign({},EventInterface,{clipboardData:function(event){return 'clipboardData'in event?event.clipboardData:window.clipboardData;}});var SyntheticClipboardEvent=createSyntheticEvent(ClipboardEventInterface);/**
|
|
9713
|
+
* @interface Event
|
|
9714
|
+
* @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents
|
|
9715
|
+
*/var CompositionEventInterface=assign({},EventInterface,{data:0});var SyntheticCompositionEvent=createSyntheticEvent(CompositionEventInterface);/**
|
|
9716
|
+
* @interface Event
|
|
9717
|
+
* @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105
|
|
9718
|
+
* /#events-inputevents
|
|
9719
|
+
*/// Happens to share the same list for now.
|
|
9720
|
+
var SyntheticInputEvent=SyntheticCompositionEvent;/**
|
|
9721
|
+
* Normalization of deprecated HTML5 `key` values
|
|
9722
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
|
|
9723
|
+
*/var normalizeKey={Esc:'Escape',Spacebar:' ',Left:'ArrowLeft',Up:'ArrowUp',Right:'ArrowRight',Down:'ArrowDown',Del:'Delete',Win:'OS',Menu:'ContextMenu',Apps:'ContextMenu',Scroll:'ScrollLock',MozPrintableKey:'Unidentified'};/**
|
|
9724
|
+
* Translation from legacy `keyCode` to HTML5 `key`
|
|
9725
|
+
* Only special keys supported, all others depend on keyboard layout or browser
|
|
9726
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
|
|
9727
|
+
*/var translateToKey={'8':'Backspace','9':'Tab','12':'Clear','13':'Enter','16':'Shift','17':'Control','18':'Alt','19':'Pause','20':'CapsLock','27':'Escape','32':' ','33':'PageUp','34':'PageDown','35':'End','36':'Home','37':'ArrowLeft','38':'ArrowUp','39':'ArrowRight','40':'ArrowDown','45':'Insert','46':'Delete','112':'F1','113':'F2','114':'F3','115':'F4','116':'F5','117':'F6','118':'F7','119':'F8','120':'F9','121':'F10','122':'F11','123':'F12','144':'NumLock','145':'ScrollLock','224':'Meta'};/**
|
|
9728
|
+
* @param {object} nativeEvent Native browser event.
|
|
9729
|
+
* @return {string} Normalized `key` property.
|
|
9730
|
+
*/function getEventKey(nativeEvent){if(nativeEvent.key){// Normalize inconsistent values reported by browsers due to
|
|
9460
9731
|
// implementations of a working draft specification.
|
|
9461
9732
|
// FireFox implements `key` but returns `MozPrintableKey` for all
|
|
9462
9733
|
// printable characters (normalized to `Unidentified`), ignore it.
|
|
@@ -9465,16 +9736,16 @@ if(nativeEvent.type==='keypress'){var charCode=getEventCharCode(nativeEvent);//
|
|
|
9465
9736
|
// thus be captured by `keypress`, no other non-printable key should.
|
|
9466
9737
|
return charCode===13?'Enter':String.fromCharCode(charCode);}if(nativeEvent.type==='keydown'||nativeEvent.type==='keyup'){// While user keyboard layout determines the actual meaning of each
|
|
9467
9738
|
// `keyCode` value, almost all function keys have a universal value.
|
|
9468
|
-
return translateToKey[nativeEvent.keyCode]||'Unidentified';}return '';}/**
|
|
9469
|
-
|
|
9470
|
-
|
|
9471
|
-
|
|
9739
|
+
return translateToKey[nativeEvent.keyCode]||'Unidentified';}return '';}/**
|
|
9740
|
+
* Translation from modifier key to the associated property in the event.
|
|
9741
|
+
* @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers
|
|
9742
|
+
*/var modifierKeyToProp={Alt:'altKey',Control:'ctrlKey',Meta:'metaKey',Shift:'shiftKey'};// Older browsers (Safari <= 10, iOS Safari <= 10.2) do not support
|
|
9472
9743
|
// getModifierState. If getModifierState is not supported, we map it to a set of
|
|
9473
9744
|
// modifier keys exposed by the event. In this case, Lock-keys are not supported.
|
|
9474
|
-
function modifierStateGetter(keyArg){var syntheticEvent=this;var nativeEvent=syntheticEvent.nativeEvent;if(nativeEvent.getModifierState){return nativeEvent.getModifierState(keyArg);}var keyProp=modifierKeyToProp[keyArg];return keyProp?!!nativeEvent[keyProp]:false;}function getEventModifierState(nativeEvent){return modifierStateGetter;}/**
|
|
9475
|
-
|
|
9476
|
-
|
|
9477
|
-
|
|
9745
|
+
function modifierStateGetter(keyArg){var syntheticEvent=this;var nativeEvent=syntheticEvent.nativeEvent;if(nativeEvent.getModifierState){return nativeEvent.getModifierState(keyArg);}var keyProp=modifierKeyToProp[keyArg];return keyProp?!!nativeEvent[keyProp]:false;}function getEventModifierState(nativeEvent){return modifierStateGetter;}/**
|
|
9746
|
+
* @interface KeyboardEvent
|
|
9747
|
+
* @see http://www.w3.org/TR/DOM-Level-3-Events/
|
|
9748
|
+
*/var KeyboardEventInterface=assign({},UIEventInterface,{key:getEventKey,code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:getEventModifierState,// Legacy Interface
|
|
9478
9749
|
charCode:function(event){// `charCode` is the result of a KeyPress event and represents the value of
|
|
9479
9750
|
// the actual printable character.
|
|
9480
9751
|
// KeyPress is deprecated, but its replacement is not yet final and not
|
|
@@ -9487,20 +9758,20 @@ if(event.type==='keypress'){return getEventCharCode(event);}return 0;},keyCode:f
|
|
|
9487
9758
|
// Due to this, it is left to the user to implement at this time.
|
|
9488
9759
|
if(event.type==='keydown'||event.type==='keyup'){return event.keyCode;}return 0;},which:function(event){// `which` is an alias for either `keyCode` or `charCode` depending on the
|
|
9489
9760
|
// type of the event.
|
|
9490
|
-
if(event.type==='keypress'){return getEventCharCode(event);}if(event.type==='keydown'||event.type==='keyup'){return event.keyCode;}return 0;}});var SyntheticKeyboardEvent=createSyntheticEvent(KeyboardEventInterface);/**
|
|
9491
|
-
|
|
9492
|
-
|
|
9493
|
-
|
|
9494
|
-
|
|
9495
|
-
|
|
9496
|
-
|
|
9497
|
-
|
|
9498
|
-
|
|
9499
|
-
|
|
9500
|
-
|
|
9501
|
-
|
|
9502
|
-
|
|
9503
|
-
|
|
9761
|
+
if(event.type==='keypress'){return getEventCharCode(event);}if(event.type==='keydown'||event.type==='keyup'){return event.keyCode;}return 0;}});var SyntheticKeyboardEvent=createSyntheticEvent(KeyboardEventInterface);/**
|
|
9762
|
+
* @interface PointerEvent
|
|
9763
|
+
* @see http://www.w3.org/TR/pointerevents/
|
|
9764
|
+
*/var PointerEventInterface=assign({},MouseEventInterface,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0});var SyntheticPointerEvent=createSyntheticEvent(PointerEventInterface);/**
|
|
9765
|
+
* @interface TouchEvent
|
|
9766
|
+
* @see http://www.w3.org/TR/touch-events/
|
|
9767
|
+
*/var TouchEventInterface=assign({},UIEventInterface,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:getEventModifierState});var SyntheticTouchEvent=createSyntheticEvent(TouchEventInterface);/**
|
|
9768
|
+
* @interface Event
|
|
9769
|
+
* @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events-
|
|
9770
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent
|
|
9771
|
+
*/var TransitionEventInterface=assign({},EventInterface,{propertyName:0,elapsedTime:0,pseudoElement:0});var SyntheticTransitionEvent=createSyntheticEvent(TransitionEventInterface);/**
|
|
9772
|
+
* @interface WheelEvent
|
|
9773
|
+
* @see http://www.w3.org/TR/DOM-Level-3-Events/
|
|
9774
|
+
*/var WheelEventInterface=assign({},MouseEventInterface,{deltaX:function(event){return 'deltaX'in event?event.deltaX:// Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
|
|
9504
9775
|
'wheelDeltaX'in event?-event.wheelDeltaX:0;},deltaY:function(event){return 'deltaY'in event?event.deltaY:// Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
|
|
9505
9776
|
'wheelDeltaY'in event?-event.wheelDeltaY:// Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
|
|
9506
9777
|
'wheelDelta'in event?-event.wheelDelta:0;},deltaZ:0,// Browsers without "deltaMode" is reporting in raw wheel delta where one
|
|
@@ -9515,138 +9786,138 @@ var canUseTextInputEvent=canUseDOM&&'TextEvent'in window&&!documentMode;// In IE
|
|
|
9515
9786
|
// by the native compositionend event may be incorrect. Japanese ideographic
|
|
9516
9787
|
// spaces, for instance (\u3000) are not recorded correctly.
|
|
9517
9788
|
var useFallbackCompositionData=canUseDOM&&(!canUseCompositionEvent||documentMode&&documentMode>8&&documentMode<=11);var SPACEBAR_CODE=32;var SPACEBAR_CHAR=String.fromCharCode(SPACEBAR_CODE);function registerEvents(){registerTwoPhaseEvent('onBeforeInput',['compositionend','keypress','textInput','paste']);registerTwoPhaseEvent('onCompositionEnd',['compositionend','focusout','keydown','keypress','keyup','mousedown']);registerTwoPhaseEvent('onCompositionStart',['compositionstart','focusout','keydown','keypress','keyup','mousedown']);registerTwoPhaseEvent('onCompositionUpdate',['compositionupdate','focusout','keydown','keypress','keyup','mousedown']);}// Track whether we've ever handled a keypress on the space key.
|
|
9518
|
-
var hasSpaceKeypress=false;/**
|
|
9519
|
-
|
|
9520
|
-
|
|
9521
|
-
|
|
9522
|
-
|
|
9523
|
-
!(nativeEvent.ctrlKey&&nativeEvent.altKey);}/**
|
|
9524
|
-
|
|
9525
|
-
|
|
9526
|
-
|
|
9527
|
-
|
|
9528
|
-
|
|
9529
|
-
|
|
9530
|
-
|
|
9789
|
+
var hasSpaceKeypress=false;/**
|
|
9790
|
+
* Return whether a native keypress event is assumed to be a command.
|
|
9791
|
+
* This is required because Firefox fires `keypress` events for key commands
|
|
9792
|
+
* (cut, copy, select-all, etc.) even though no character is inserted.
|
|
9793
|
+
*/function isKeypressCommand(nativeEvent){return (nativeEvent.ctrlKey||nativeEvent.altKey||nativeEvent.metaKey)&&// ctrlKey && altKey is equivalent to AltGr, and is not a command.
|
|
9794
|
+
!(nativeEvent.ctrlKey&&nativeEvent.altKey);}/**
|
|
9795
|
+
* Translate native top level events into event types.
|
|
9796
|
+
*/function getCompositionEventType(domEventName){switch(domEventName){case'compositionstart':return 'onCompositionStart';case'compositionend':return 'onCompositionEnd';case'compositionupdate':return 'onCompositionUpdate';}}/**
|
|
9797
|
+
* Does our fallback best-guess model think this event signifies that
|
|
9798
|
+
* composition has begun?
|
|
9799
|
+
*/function isFallbackCompositionStart(domEventName,nativeEvent){return domEventName==='keydown'&&nativeEvent.keyCode===START_KEYCODE;}/**
|
|
9800
|
+
* Does our fallback mode think that this event is the end of composition?
|
|
9801
|
+
*/function isFallbackCompositionEnd(domEventName,nativeEvent){switch(domEventName){case'keyup':// Command keys insert or clear IME input.
|
|
9531
9802
|
return END_KEYCODES.indexOf(nativeEvent.keyCode)!==-1;case'keydown':// Expect IME keyCode on each keydown. If we get any other
|
|
9532
9803
|
// code we must have exited earlier.
|
|
9533
9804
|
return nativeEvent.keyCode!==START_KEYCODE;case'keypress':case'mousedown':case'focusout':// Events are not possible without cancelling IME.
|
|
9534
|
-
return true;default:return false;}}/**
|
|
9535
|
-
|
|
9536
|
-
|
|
9537
|
-
|
|
9538
|
-
|
|
9539
|
-
|
|
9540
|
-
|
|
9541
|
-
|
|
9542
|
-
|
|
9543
|
-
|
|
9544
|
-
|
|
9545
|
-
|
|
9546
|
-
|
|
9547
|
-
|
|
9548
|
-
|
|
9549
|
-
|
|
9550
|
-
|
|
9551
|
-
|
|
9552
|
-
var isComposing=false;/**
|
|
9553
|
-
|
|
9554
|
-
|
|
9805
|
+
return true;default:return false;}}/**
|
|
9806
|
+
* Google Input Tools provides composition data via a CustomEvent,
|
|
9807
|
+
* with the `data` property populated in the `detail` object. If this
|
|
9808
|
+
* is available on the event object, use it. If not, this is a plain
|
|
9809
|
+
* composition event and we have nothing special to extract.
|
|
9810
|
+
*
|
|
9811
|
+
* @param {object} nativeEvent
|
|
9812
|
+
* @return {?string}
|
|
9813
|
+
*/function getDataFromCustomEvent(nativeEvent){var detail=nativeEvent.detail;if(typeof detail==='object'&&'data'in detail){return detail.data;}return null;}/**
|
|
9814
|
+
* Check if a composition event was triggered by Korean IME.
|
|
9815
|
+
* Our fallback mode does not work well with IE's Korean IME,
|
|
9816
|
+
* so just use native composition events when Korean IME is used.
|
|
9817
|
+
* Although CompositionEvent.locale property is deprecated,
|
|
9818
|
+
* it is available in IE, where our fallback mode is enabled.
|
|
9819
|
+
*
|
|
9820
|
+
* @param {object} nativeEvent
|
|
9821
|
+
* @return {boolean}
|
|
9822
|
+
*/function isUsingKoreanIME(nativeEvent){return nativeEvent.locale==='ko';}// Track the current IME composition status, if any.
|
|
9823
|
+
var isComposing=false;/**
|
|
9824
|
+
* @return {?object} A SyntheticCompositionEvent.
|
|
9825
|
+
*/function extractCompositionEvent(dispatchQueue,domEventName,targetInst,nativeEvent,nativeEventTarget){var eventType;var fallbackData;if(canUseCompositionEvent){eventType=getCompositionEventType(domEventName);}else if(!isComposing){if(isFallbackCompositionStart(domEventName,nativeEvent)){eventType='onCompositionStart';}}else if(isFallbackCompositionEnd(domEventName,nativeEvent)){eventType='onCompositionEnd';}if(!eventType){return null;}if(useFallbackCompositionData&&!isUsingKoreanIME(nativeEvent)){// The current composition is stored statically and must not be
|
|
9555
9826
|
// overwritten while composition continues.
|
|
9556
9827
|
if(!isComposing&&eventType==='onCompositionStart'){isComposing=initialize(nativeEventTarget);}else if(eventType==='onCompositionEnd'){if(isComposing){fallbackData=getData();}}}var listeners=accumulateTwoPhaseListeners(targetInst,eventType);if(listeners.length>0){var event=new SyntheticCompositionEvent(eventType,domEventName,null,nativeEvent,nativeEventTarget);dispatchQueue.push({event:event,listeners:listeners});if(fallbackData){// Inject data generated from fallback path into the synthetic event.
|
|
9557
9828
|
// This matches the property of native CompositionEventInterface.
|
|
9558
|
-
event.data=fallbackData;}else {var customData=getDataFromCustomEvent(nativeEvent);if(customData!==null){event.data=customData;}}}}function getNativeBeforeInputChars(domEventName,nativeEvent){switch(domEventName){case'compositionend':return getDataFromCustomEvent(nativeEvent);case'keypress':/**
|
|
9559
|
-
|
|
9560
|
-
|
|
9561
|
-
|
|
9562
|
-
|
|
9563
|
-
|
|
9564
|
-
|
|
9565
|
-
|
|
9566
|
-
|
|
9567
|
-
|
|
9568
|
-
|
|
9569
|
-
|
|
9570
|
-
|
|
9571
|
-
|
|
9829
|
+
event.data=fallbackData;}else {var customData=getDataFromCustomEvent(nativeEvent);if(customData!==null){event.data=customData;}}}}function getNativeBeforeInputChars(domEventName,nativeEvent){switch(domEventName){case'compositionend':return getDataFromCustomEvent(nativeEvent);case'keypress':/**
|
|
9830
|
+
* If native `textInput` events are available, our goal is to make
|
|
9831
|
+
* use of them. However, there is a special case: the spacebar key.
|
|
9832
|
+
* In Webkit, preventing default on a spacebar `textInput` event
|
|
9833
|
+
* cancels character insertion, but it *also* causes the browser
|
|
9834
|
+
* to fall back to its default spacebar behavior of scrolling the
|
|
9835
|
+
* page.
|
|
9836
|
+
*
|
|
9837
|
+
* Tracking at:
|
|
9838
|
+
* https://code.google.com/p/chromium/issues/detail?id=355103
|
|
9839
|
+
*
|
|
9840
|
+
* To avoid this issue, use the keypress event as if no `textInput`
|
|
9841
|
+
* event is available.
|
|
9842
|
+
*/var which=nativeEvent.which;if(which!==SPACEBAR_CODE){return null;}hasSpaceKeypress=true;return SPACEBAR_CHAR;case'textInput':// Record the characters to be added to the DOM.
|
|
9572
9843
|
var chars=nativeEvent.data;// If it's a spacebar character, assume that we have already handled
|
|
9573
9844
|
// it at the keypress level and bail immediately. Android Chrome
|
|
9574
9845
|
// doesn't give us keycodes, so we need to ignore it.
|
|
9575
9846
|
if(chars===SPACEBAR_CHAR&&hasSpaceKeypress){return null;}return chars;default:// For other native event types, do nothing.
|
|
9576
|
-
return null;}}/**
|
|
9577
|
-
|
|
9578
|
-
|
|
9579
|
-
|
|
9847
|
+
return null;}}/**
|
|
9848
|
+
* For browsers that do not provide the `textInput` event, extract the
|
|
9849
|
+
* appropriate string to use for SyntheticInputEvent.
|
|
9850
|
+
*/function getFallbackBeforeInputChars(domEventName,nativeEvent){// If we are currently composing (IME) and using a fallback to do so,
|
|
9580
9851
|
// try to extract the composed characters from the fallback object.
|
|
9581
9852
|
// If composition event is available, we extract a string only at
|
|
9582
9853
|
// compositionevent, otherwise extract it at fallback events.
|
|
9583
9854
|
if(isComposing){if(domEventName==='compositionend'||!canUseCompositionEvent&&isFallbackCompositionEnd(domEventName,nativeEvent)){var chars=getData();reset();isComposing=false;return chars;}return null;}switch(domEventName){case'paste':// If a paste event occurs after a keypress, throw out the input
|
|
9584
9855
|
// chars. Paste events should not lead to BeforeInput events.
|
|
9585
|
-
return null;case'keypress':/**
|
|
9586
|
-
|
|
9587
|
-
|
|
9588
|
-
|
|
9589
|
-
|
|
9590
|
-
|
|
9591
|
-
|
|
9592
|
-
|
|
9593
|
-
|
|
9594
|
-
|
|
9595
|
-
|
|
9596
|
-
|
|
9597
|
-
|
|
9598
|
-
|
|
9599
|
-
|
|
9600
|
-
|
|
9856
|
+
return null;case'keypress':/**
|
|
9857
|
+
* As of v27, Firefox may fire keypress events even when no character
|
|
9858
|
+
* will be inserted. A few possibilities:
|
|
9859
|
+
*
|
|
9860
|
+
* - `which` is `0`. Arrow keys, Esc key, etc.
|
|
9861
|
+
*
|
|
9862
|
+
* - `which` is the pressed key code, but no char is available.
|
|
9863
|
+
* Ex: 'AltGr + d` in Polish. There is no modified character for
|
|
9864
|
+
* this key combination and no character is inserted into the
|
|
9865
|
+
* document, but FF fires the keypress for char code `100` anyway.
|
|
9866
|
+
* No `input` event will occur.
|
|
9867
|
+
*
|
|
9868
|
+
* - `which` is the pressed key code, but a command combination is
|
|
9869
|
+
* being used. Ex: `Cmd+C`. No character is inserted, and no
|
|
9870
|
+
* `input` event will occur.
|
|
9871
|
+
*/if(!isKeypressCommand(nativeEvent)){// IE fires the `keypress` event when a user types an emoji via
|
|
9601
9872
|
// Touch keyboard of Windows. In such a case, the `char` property
|
|
9602
9873
|
// holds an emoji character like `\uD83D\uDE0A`. Because its length
|
|
9603
9874
|
// is 2, the property `which` does not represent an emoji correctly.
|
|
9604
9875
|
// In such a case, we directly return the `char` property instead of
|
|
9605
9876
|
// using `which`.
|
|
9606
|
-
if(nativeEvent.char&&nativeEvent.char.length>1){return nativeEvent.char;}else if(nativeEvent.which){return String.fromCharCode(nativeEvent.which);}}return null;case'compositionend':return useFallbackCompositionData&&!isUsingKoreanIME(nativeEvent)?null:nativeEvent.data;default:return null;}}/**
|
|
9607
|
-
|
|
9608
|
-
|
|
9609
|
-
|
|
9610
|
-
|
|
9611
|
-
|
|
9877
|
+
if(nativeEvent.char&&nativeEvent.char.length>1){return nativeEvent.char;}else if(nativeEvent.which){return String.fromCharCode(nativeEvent.which);}}return null;case'compositionend':return useFallbackCompositionData&&!isUsingKoreanIME(nativeEvent)?null:nativeEvent.data;default:return null;}}/**
|
|
9878
|
+
* Extract a SyntheticInputEvent for `beforeInput`, based on either native
|
|
9879
|
+
* `textInput` or fallback behavior.
|
|
9880
|
+
*
|
|
9881
|
+
* @return {?object} A SyntheticInputEvent.
|
|
9882
|
+
*/function extractBeforeInputEvent(dispatchQueue,domEventName,targetInst,nativeEvent,nativeEventTarget){var chars;if(canUseTextInputEvent){chars=getNativeBeforeInputChars(domEventName,nativeEvent);}else {chars=getFallbackBeforeInputChars(domEventName,nativeEvent);}// If no characters are being inserted, no BeforeInput event should
|
|
9612
9883
|
// be fired.
|
|
9613
|
-
if(!chars){return null;}var listeners=accumulateTwoPhaseListeners(targetInst,'onBeforeInput');if(listeners.length>0){var event=new SyntheticInputEvent('onBeforeInput','beforeinput',null,nativeEvent,nativeEventTarget);dispatchQueue.push({event:event,listeners:listeners});event.data=chars;}}/**
|
|
9614
|
-
|
|
9615
|
-
|
|
9616
|
-
|
|
9617
|
-
|
|
9618
|
-
|
|
9619
|
-
|
|
9620
|
-
|
|
9621
|
-
|
|
9622
|
-
|
|
9623
|
-
|
|
9624
|
-
|
|
9625
|
-
|
|
9626
|
-
|
|
9627
|
-
|
|
9628
|
-
|
|
9629
|
-
|
|
9630
|
-
|
|
9631
|
-
|
|
9632
|
-
|
|
9633
|
-
|
|
9634
|
-
|
|
9635
|
-
|
|
9636
|
-
|
|
9637
|
-
|
|
9638
|
-
|
|
9639
|
-
|
|
9640
|
-
|
|
9641
|
-
|
|
9642
|
-
|
|
9643
|
-
|
|
9644
|
-
|
|
9645
|
-
enqueueStateRestore(target);var listeners=accumulateTwoPhaseListeners(inst,'onChange');if(listeners.length>0){var event=new SyntheticEvent('onChange','change',null,nativeEvent,target);dispatchQueue.push({event:event,listeners:listeners});}}/**
|
|
9646
|
-
|
|
9647
|
-
|
|
9648
|
-
|
|
9649
|
-
|
|
9884
|
+
if(!chars){return null;}var listeners=accumulateTwoPhaseListeners(targetInst,'onBeforeInput');if(listeners.length>0){var event=new SyntheticInputEvent('onBeforeInput','beforeinput',null,nativeEvent,nativeEventTarget);dispatchQueue.push({event:event,listeners:listeners});event.data=chars;}}/**
|
|
9885
|
+
* Create an `onBeforeInput` event to match
|
|
9886
|
+
* http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.
|
|
9887
|
+
*
|
|
9888
|
+
* This event plugin is based on the native `textInput` event
|
|
9889
|
+
* available in Chrome, Safari, Opera, and IE. This event fires after
|
|
9890
|
+
* `onKeyPress` and `onCompositionEnd`, but before `onInput`.
|
|
9891
|
+
*
|
|
9892
|
+
* `beforeInput` is spec'd but not implemented in any browsers, and
|
|
9893
|
+
* the `input` event does not provide any useful information about what has
|
|
9894
|
+
* actually been added, contrary to the spec. Thus, `textInput` is the best
|
|
9895
|
+
* available event to identify the characters that have actually been inserted
|
|
9896
|
+
* into the target node.
|
|
9897
|
+
*
|
|
9898
|
+
* This plugin is also responsible for emitting `composition` events, thus
|
|
9899
|
+
* allowing us to share composition fallback code for both `beforeInput` and
|
|
9900
|
+
* `composition` event types.
|
|
9901
|
+
*/function extractEvents(dispatchQueue,domEventName,targetInst,nativeEvent,nativeEventTarget,eventSystemFlags,targetContainer){extractCompositionEvent(dispatchQueue,domEventName,targetInst,nativeEvent,nativeEventTarget);extractBeforeInputEvent(dispatchQueue,domEventName,targetInst,nativeEvent,nativeEventTarget);}/**
|
|
9902
|
+
* @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
|
|
9903
|
+
*/var supportedInputTypes={color:true,date:true,datetime:true,'datetime-local':true,email:true,month:true,number:true,password:true,range:true,search:true,tel:true,text:true,time:true,url:true,week:true};function isTextInputElement(elem){var nodeName=elem&&elem.nodeName&&elem.nodeName.toLowerCase();if(nodeName==='input'){return !!supportedInputTypes[elem.type];}if(nodeName==='textarea'){return true;}return false;}/**
|
|
9904
|
+
* Checks if an event is supported in the current execution environment.
|
|
9905
|
+
*
|
|
9906
|
+
* NOTE: This will not work correctly for non-generic events such as `change`,
|
|
9907
|
+
* `reset`, `load`, `error`, and `select`.
|
|
9908
|
+
*
|
|
9909
|
+
* Borrows from Modernizr.
|
|
9910
|
+
*
|
|
9911
|
+
* @param {string} eventNameSuffix Event name, e.g. "click".
|
|
9912
|
+
* @return {boolean} True if the event is supported.
|
|
9913
|
+
* @internal
|
|
9914
|
+
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
|
9915
|
+
*/function isEventSupported(eventNameSuffix){if(!canUseDOM){return false;}var eventName='on'+eventNameSuffix;var isSupported=eventName in document;if(!isSupported){var element=document.createElement('div');element.setAttribute(eventName,'return;');isSupported=typeof element[eventName]==='function';}return isSupported;}function registerEvents$1(){registerTwoPhaseEvent('onChange',['change','click','focusin','focusout','input','keydown','keyup','selectionchange']);}function createAndAccumulateChangeEvent(dispatchQueue,inst,nativeEvent,target){// Flag this event loop as needing state restore.
|
|
9916
|
+
enqueueStateRestore(target);var listeners=accumulateTwoPhaseListeners(inst,'onChange');if(listeners.length>0){var event=new SyntheticEvent('onChange','change',null,nativeEvent,target);dispatchQueue.push({event:event,listeners:listeners});}}/**
|
|
9917
|
+
* For IE shims
|
|
9918
|
+
*/var activeElement=null;var activeElementInst=null;/**
|
|
9919
|
+
* SECTION: handle `change` event
|
|
9920
|
+
*/function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}function manualDispatchChangeEvent(nativeEvent){var dispatchQueue=[];createAndAccumulateChangeEvent(dispatchQueue,activeElementInst,nativeEvent,getEventTarget(nativeEvent));// If change and propertychange bubbled, we'd just bind to it like all the
|
|
9650
9921
|
// other events and have it go through ReactBrowserEventEmitter. Since it
|
|
9651
9922
|
// doesn't, we manually listen for the events and so we have to enqueue and
|
|
9652
9923
|
// process the abstract event manually.
|
|
@@ -9657,21 +9928,21 @@ enqueueStateRestore(target);var listeners=accumulateTwoPhaseListeners(inst,'onCh
|
|
|
9657
9928
|
// components don't work properly in conjunction with event bubbling because
|
|
9658
9929
|
// the component is rerendered and the value reverted before all the event
|
|
9659
9930
|
// handlers can run. See https://github.com/facebook/react/issues/708.
|
|
9660
|
-
batchedUpdates(runEventInBatch,dispatchQueue);}function runEventInBatch(dispatchQueue){processDispatchQueue(dispatchQueue,0);}function getInstIfValueChanged(targetInst){var targetNode=getNodeFromInstance(targetInst);if(updateValueIfChanged(targetNode)){return targetInst;}}function getTargetInstForChangeEvent(domEventName,targetInst){if(domEventName==='change'){return targetInst;}}/**
|
|
9661
|
-
|
|
9662
|
-
|
|
9931
|
+
batchedUpdates(runEventInBatch,dispatchQueue);}function runEventInBatch(dispatchQueue){processDispatchQueue(dispatchQueue,0);}function getInstIfValueChanged(targetInst){var targetNode=getNodeFromInstance(targetInst);if(updateValueIfChanged(targetNode)){return targetInst;}}function getTargetInstForChangeEvent(domEventName,targetInst){if(domEventName==='change'){return targetInst;}}/**
|
|
9932
|
+
* SECTION: handle `input` event
|
|
9933
|
+
*/var isInputEventSupported=false;if(canUseDOM){// IE9 claims to support the input event but fails to trigger it when
|
|
9663
9934
|
// deleting text, so we ignore its input events.
|
|
9664
|
-
isInputEventSupported=isEventSupported('input')&&(!document.documentMode||document.documentMode>9);}/**
|
|
9665
|
-
|
|
9666
|
-
|
|
9667
|
-
|
|
9668
|
-
|
|
9669
|
-
|
|
9670
|
-
|
|
9671
|
-
|
|
9672
|
-
|
|
9673
|
-
|
|
9674
|
-
|
|
9935
|
+
isInputEventSupported=isEventSupported('input')&&(!document.documentMode||document.documentMode>9);}/**
|
|
9936
|
+
* (For IE <=9) Starts tracking propertychange events on the passed-in element
|
|
9937
|
+
* and override the value property so that we can distinguish user events from
|
|
9938
|
+
* value changes in JS.
|
|
9939
|
+
*/function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}/**
|
|
9940
|
+
* (For IE <=9) Removes the event listeners from the currently-tracked element,
|
|
9941
|
+
* if any exists.
|
|
9942
|
+
*/function stopWatchingForValueChange(){if(!activeElement){return;}activeElement.detachEvent('onpropertychange',handlePropertyChange);activeElement=null;activeElementInst=null;}/**
|
|
9943
|
+
* (For IE <=9) Handles a propertychange event, sending a `change` event if
|
|
9944
|
+
* the value of the active element has changed.
|
|
9945
|
+
*/function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}if(getInstIfValueChanged(activeElementInst)){manualDispatchChangeEvent(nativeEvent);}}function handleEventsForInputEventPolyfill(domEventName,target,targetInst){if(domEventName==='focusin'){// In IE9, propertychange fires for most input events but is buggy and
|
|
9675
9946
|
// doesn't fire when text is deleted, but conveniently, selectionchange
|
|
9676
9947
|
// appears to fire in all of the remaining cases so we catch those and
|
|
9677
9948
|
// forward the event if the value has changed
|
|
@@ -9692,29 +9963,29 @@ function getTargetInstForInputEventPolyfill(domEventName,targetInst){if(domEvent
|
|
|
9692
9963
|
// keystroke if user does a key repeat (it'll be a little delayed: right
|
|
9693
9964
|
// before the second keystroke). Other input methods (e.g., paste) seem to
|
|
9694
9965
|
// fire selectionchange normally.
|
|
9695
|
-
return getInstIfValueChanged(activeElementInst);}}/**
|
|
9696
|
-
|
|
9697
|
-
|
|
9966
|
+
return getInstIfValueChanged(activeElementInst);}}/**
|
|
9967
|
+
* SECTION: handle `click` event
|
|
9968
|
+
*/function shouldUseClickEvent(elem){// Use the `click` event to detect changes to checkbox and radio inputs.
|
|
9698
9969
|
// This approach works across all browsers, whereas `change` does not fire
|
|
9699
9970
|
// until `blur` in IE8.
|
|
9700
9971
|
var nodeName=elem.nodeName;return nodeName&&nodeName.toLowerCase()==='input'&&(elem.type==='checkbox'||elem.type==='radio');}function getTargetInstForClickEvent(domEventName,targetInst){if(domEventName==='click'){return getInstIfValueChanged(targetInst);}}function getTargetInstForInputOrChangeEvent(domEventName,targetInst){if(domEventName==='input'||domEventName==='change'){return getInstIfValueChanged(targetInst);}}function handleControlledInputBlur(node){var state=node._wrapperState;if(!state||!state.controlled||node.type!=='number'){return;}{// If controlled, assign the value attribute to the current value on blur
|
|
9701
|
-
setDefaultValue(node,'number',node.value);}}/**
|
|
9702
|
-
|
|
9703
|
-
|
|
9704
|
-
|
|
9705
|
-
|
|
9706
|
-
|
|
9707
|
-
|
|
9708
|
-
|
|
9709
|
-
|
|
9710
|
-
|
|
9711
|
-
if(domEventName==='focusout'){handleControlledInputBlur(targetNode);}}function registerEvents$2(){registerDirectEvent('onMouseEnter',['mouseout','mouseover']);registerDirectEvent('onMouseLeave',['mouseout','mouseover']);registerDirectEvent('onPointerEnter',['pointerout','pointerover']);registerDirectEvent('onPointerLeave',['pointerout','pointerover']);}/**
|
|
9712
|
-
|
|
9713
|
-
|
|
9714
|
-
|
|
9715
|
-
|
|
9716
|
-
|
|
9717
|
-
|
|
9972
|
+
setDefaultValue(node,'number',node.value);}}/**
|
|
9973
|
+
* This plugin creates an `onChange` event that normalizes change events
|
|
9974
|
+
* across form elements. This event fires at a time when it's possible to
|
|
9975
|
+
* change the element's value without seeing a flicker.
|
|
9976
|
+
*
|
|
9977
|
+
* Supported elements are:
|
|
9978
|
+
* - input (see `isTextInputElement`)
|
|
9979
|
+
* - textarea
|
|
9980
|
+
* - select
|
|
9981
|
+
*/function extractEvents$1(dispatchQueue,domEventName,targetInst,nativeEvent,nativeEventTarget,eventSystemFlags,targetContainer){var targetNode=targetInst?getNodeFromInstance(targetInst):window;var getTargetInstFunc,handleEventFunc;if(shouldUseChangeEvent(targetNode)){getTargetInstFunc=getTargetInstForChangeEvent;}else if(isTextInputElement(targetNode)){if(isInputEventSupported){getTargetInstFunc=getTargetInstForInputOrChangeEvent;}else {getTargetInstFunc=getTargetInstForInputEventPolyfill;handleEventFunc=handleEventsForInputEventPolyfill;}}else if(shouldUseClickEvent(targetNode)){getTargetInstFunc=getTargetInstForClickEvent;}if(getTargetInstFunc){var inst=getTargetInstFunc(domEventName,targetInst);if(inst){createAndAccumulateChangeEvent(dispatchQueue,inst,nativeEvent,nativeEventTarget);return;}}if(handleEventFunc){handleEventFunc(domEventName,targetNode,targetInst);}// When blurring, set the value attribute for number inputs
|
|
9982
|
+
if(domEventName==='focusout'){handleControlledInputBlur(targetNode);}}function registerEvents$2(){registerDirectEvent('onMouseEnter',['mouseout','mouseover']);registerDirectEvent('onMouseLeave',['mouseout','mouseover']);registerDirectEvent('onPointerEnter',['pointerout','pointerover']);registerDirectEvent('onPointerLeave',['pointerout','pointerover']);}/**
|
|
9983
|
+
* For almost every interaction we care about, there will be both a top-level
|
|
9984
|
+
* `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that
|
|
9985
|
+
* we do not extract duplicate events. However, moving the mouse into the
|
|
9986
|
+
* browser from outside will not fire a `mouseout` event. In this case, we use
|
|
9987
|
+
* the `mouseover` top-level event.
|
|
9988
|
+
*/function extractEvents$2(dispatchQueue,domEventName,targetInst,nativeEvent,nativeEventTarget,eventSystemFlags,targetContainer){var isOverEvent=domEventName==='mouseover'||domEventName==='pointerover';var isOutEvent=domEventName==='mouseout'||domEventName==='pointerout';if(isOverEvent&&!isReplayingEvent(nativeEvent)){// If this is an over event with a target, we might have already dispatched
|
|
9718
9989
|
// the event in the out event of the other target. If this is replayed,
|
|
9719
9990
|
// then it's because we couldn't dispatch against this target previously
|
|
9720
9991
|
// so we have to do it now instead.
|
|
@@ -9728,51 +9999,51 @@ var doc=nativeEventTarget.ownerDocument;if(doc){win=doc.defaultView||doc.parentW
|
|
|
9728
9999
|
from=null;to=targetInst;}if(from===to){// Nothing pertains to our managed components.
|
|
9729
10000
|
return;}var SyntheticEventCtor=SyntheticMouseEvent;var leaveEventType='onMouseLeave';var enterEventType='onMouseEnter';var eventTypePrefix='mouse';if(domEventName==='pointerout'||domEventName==='pointerover'){SyntheticEventCtor=SyntheticPointerEvent;leaveEventType='onPointerLeave';enterEventType='onPointerEnter';eventTypePrefix='pointer';}var fromNode=from==null?win:getNodeFromInstance(from);var toNode=to==null?win:getNodeFromInstance(to);var leave=new SyntheticEventCtor(leaveEventType,eventTypePrefix+'leave',from,nativeEvent,nativeEventTarget);leave.target=fromNode;leave.relatedTarget=toNode;var enter=null;// We should only process this nativeEvent if we are processing
|
|
9730
10001
|
// the first ancestor. Next time, we will ignore the event.
|
|
9731
|
-
var nativeTargetInst=getClosestInstanceFromNode(nativeEventTarget);if(nativeTargetInst===targetInst){var enterEvent=new SyntheticEventCtor(enterEventType,eventTypePrefix+'enter',to,nativeEvent,nativeEventTarget);enterEvent.target=toNode;enterEvent.relatedTarget=fromNode;enter=enterEvent;}accumulateEnterLeaveTwoPhaseListeners(dispatchQueue,leave,enter,from,to);}/**
|
|
9732
|
-
|
|
9733
|
-
|
|
9734
|
-
|
|
9735
|
-
;}var objectIs=typeof Object.is==='function'?Object.is:is;/**
|
|
9736
|
-
|
|
9737
|
-
|
|
9738
|
-
|
|
9739
|
-
|
|
9740
|
-
for(var i=0;i<keysA.length;i++){var currentKey=keysA[i];if(!hasOwnProperty.call(objB,currentKey)||!objectIs(objA[currentKey],objB[currentKey])){return false;}}return true;}/**
|
|
9741
|
-
|
|
9742
|
-
|
|
9743
|
-
|
|
9744
|
-
|
|
9745
|
-
|
|
9746
|
-
|
|
9747
|
-
|
|
9748
|
-
|
|
9749
|
-
|
|
9750
|
-
|
|
9751
|
-
|
|
9752
|
-
|
|
9753
|
-
|
|
9754
|
-
|
|
9755
|
-
|
|
9756
|
-
|
|
9757
|
-
|
|
9758
|
-
|
|
9759
|
-
|
|
9760
|
-
|
|
10002
|
+
var nativeTargetInst=getClosestInstanceFromNode(nativeEventTarget);if(nativeTargetInst===targetInst){var enterEvent=new SyntheticEventCtor(enterEventType,eventTypePrefix+'enter',to,nativeEvent,nativeEventTarget);enterEvent.target=toNode;enterEvent.relatedTarget=fromNode;enter=enterEvent;}accumulateEnterLeaveTwoPhaseListeners(dispatchQueue,leave,enter,from,to);}/**
|
|
10003
|
+
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
10004
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
10005
|
+
*/function is(x,y){return x===y&&(x!==0||1/x===1/y)||x!==x&&y!==y// eslint-disable-line no-self-compare
|
|
10006
|
+
;}var objectIs=typeof Object.is==='function'?Object.is:is;/**
|
|
10007
|
+
* Performs equality by iterating through keys on an object and returning false
|
|
10008
|
+
* when any key has values which are not strictly equal between the arguments.
|
|
10009
|
+
* Returns true when the values of all keys are strictly equal.
|
|
10010
|
+
*/function shallowEqual(objA,objB){if(objectIs(objA,objB)){return true;}if(typeof objA!=='object'||objA===null||typeof objB!=='object'||objB===null){return false;}var keysA=Object.keys(objA);var keysB=Object.keys(objB);if(keysA.length!==keysB.length){return false;}// Test for A's keys different from B.
|
|
10011
|
+
for(var i=0;i<keysA.length;i++){var currentKey=keysA[i];if(!hasOwnProperty.call(objB,currentKey)||!objectIs(objA[currentKey],objB[currentKey])){return false;}}return true;}/**
|
|
10012
|
+
* Given any node return the first leaf node without children.
|
|
10013
|
+
*
|
|
10014
|
+
* @param {DOMElement|DOMTextNode} node
|
|
10015
|
+
* @return {DOMElement|DOMTextNode}
|
|
10016
|
+
*/function getLeafNode(node){while(node&&node.firstChild){node=node.firstChild;}return node;}/**
|
|
10017
|
+
* Get the next sibling within a container. This will walk up the
|
|
10018
|
+
* DOM if a node's siblings have been exhausted.
|
|
10019
|
+
*
|
|
10020
|
+
* @param {DOMElement|DOMTextNode} node
|
|
10021
|
+
* @return {?DOMElement|DOMTextNode}
|
|
10022
|
+
*/function getSiblingNode(node){while(node){if(node.nextSibling){return node.nextSibling;}node=node.parentNode;}}/**
|
|
10023
|
+
* Get object describing the nodes which contain characters at offset.
|
|
10024
|
+
*
|
|
10025
|
+
* @param {DOMElement|DOMTextNode} root
|
|
10026
|
+
* @param {number} offset
|
|
10027
|
+
* @return {?object}
|
|
10028
|
+
*/function getNodeForCharacterOffset(root,offset){var node=getLeafNode(root);var nodeStart=0;var nodeEnd=0;while(node){if(node.nodeType===TEXT_NODE){nodeEnd=nodeStart+node.textContent.length;if(nodeStart<=offset&&nodeEnd>=offset){return {node:node,offset:offset-nodeStart};}nodeStart=nodeEnd;}node=getLeafNode(getSiblingNode(node));}}/**
|
|
10029
|
+
* @param {DOMElement} outerNode
|
|
10030
|
+
* @return {?object}
|
|
10031
|
+
*/function getOffsets(outerNode){var ownerDocument=outerNode.ownerDocument;var win=ownerDocument&&ownerDocument.defaultView||window;var selection=win.getSelection&&win.getSelection();if(!selection||selection.rangeCount===0){return null;}var anchorNode=selection.anchorNode,anchorOffset=selection.anchorOffset,focusNode=selection.focusNode,focusOffset=selection.focusOffset;// In Firefox, anchorNode and focusNode can be "anonymous divs", e.g. the
|
|
9761
10032
|
// up/down buttons on an <input type="number">. Anonymous divs do not seem to
|
|
9762
10033
|
// expose properties, triggering a "Permission denied error" if any of its
|
|
9763
10034
|
// properties are accessed. The only seemingly possible way to avoid erroring
|
|
9764
10035
|
// is to access a property that typically works for non-anonymous divs and
|
|
9765
10036
|
// catch any error that may otherwise arise. See
|
|
9766
10037
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=208427
|
|
9767
|
-
try{/* eslint-disable no-unused-expressions */anchorNode.nodeType;focusNode.nodeType;/* eslint-enable no-unused-expressions */}catch(e){return null;}return getModernOffsetsFromPoints(outerNode,anchorNode,anchorOffset,focusNode,focusOffset);}/**
|
|
9768
|
-
|
|
9769
|
-
|
|
9770
|
-
|
|
9771
|
-
|
|
9772
|
-
|
|
9773
|
-
|
|
9774
|
-
|
|
9775
|
-
|
|
10038
|
+
try{/* eslint-disable no-unused-expressions */anchorNode.nodeType;focusNode.nodeType;/* eslint-enable no-unused-expressions */}catch(e){return null;}return getModernOffsetsFromPoints(outerNode,anchorNode,anchorOffset,focusNode,focusOffset);}/**
|
|
10039
|
+
* Returns {start, end} where `start` is the character/codepoint index of
|
|
10040
|
+
* (anchorNode, anchorOffset) within the textContent of `outerNode`, and
|
|
10041
|
+
* `end` is the index of (focusNode, focusOffset).
|
|
10042
|
+
*
|
|
10043
|
+
* Returns null if you pass in garbage input but we should probably just crash.
|
|
10044
|
+
*
|
|
10045
|
+
* Exported only for testing.
|
|
10046
|
+
*/function getModernOffsetsFromPoints(outerNode,anchorNode,anchorOffset,focusNode,focusOffset){var length=0;var start=-1;var end=-1;var indexWithinAnchor=0;var indexWithinFocus=0;var node=outerNode;var parentNode=null;outer:while(true){var next=null;while(true){if(node===anchorNode&&(anchorOffset===0||node.nodeType===TEXT_NODE)){start=length+anchorOffset;}if(node===focusNode&&(focusOffset===0||node.nodeType===TEXT_NODE)){end=length+focusOffset;}if(node.nodeType===TEXT_NODE){length+=node.nodeValue.length;}if((next=node.firstChild)===null){break;}// Moving from `node` to its first child `next`.
|
|
9776
10047
|
parentNode=node;node=next;}while(true){if(node===outerNode){// If `outerNode` has children, this is always the second time visiting
|
|
9777
10048
|
// it. If it has no children, this is still the first loop, and the only
|
|
9778
10049
|
// valid selection is anchorNode and focusNode both equal to this node
|
|
@@ -9780,18 +10051,18 @@ parentNode=node;node=next;}while(true){if(node===outerNode){// If `outerNode` ha
|
|
|
9780
10051
|
break outer;}if(parentNode===anchorNode&&++indexWithinAnchor===anchorOffset){start=length;}if(parentNode===focusNode&&++indexWithinFocus===focusOffset){end=length;}if((next=node.nextSibling)!==null){break;}node=parentNode;parentNode=node.parentNode;}// Moving from `node` to its next sibling `next`.
|
|
9781
10052
|
node=next;}if(start===-1||end===-1){// This should never happen. (Would happen if the anchor/focus nodes aren't
|
|
9782
10053
|
// actually inside the passed-in node.)
|
|
9783
|
-
return null;}return {start:start,end:end};}/**
|
|
9784
|
-
|
|
9785
|
-
|
|
9786
|
-
|
|
9787
|
-
|
|
9788
|
-
|
|
9789
|
-
|
|
9790
|
-
|
|
9791
|
-
|
|
9792
|
-
|
|
9793
|
-
|
|
9794
|
-
|
|
10054
|
+
return null;}return {start:start,end:end};}/**
|
|
10055
|
+
* In modern non-IE browsers, we can support both forward and backward
|
|
10056
|
+
* selections.
|
|
10057
|
+
*
|
|
10058
|
+
* Note: IE10+ supports the Selection object, but it does not support
|
|
10059
|
+
* the `extend` method, which means that even in modern IE, it's not possible
|
|
10060
|
+
* to programmatically create a backward selection. Thus, for all IE
|
|
10061
|
+
* versions, we use the old IE API to create our selections.
|
|
10062
|
+
*
|
|
10063
|
+
* @param {DOMElement|DOMTextNode} node
|
|
10064
|
+
* @param {object} offsets
|
|
10065
|
+
*/function setOffsets(node,offsets){var doc=node.ownerDocument||document;var win=doc&&doc.defaultView||window;// Edge fails with "Object expected" in some scenarios.
|
|
9795
10066
|
// (For instance: TinyMCE editor used in a list component that supports pasting to add more,
|
|
9796
10067
|
// fails when pasting 100+ items)
|
|
9797
10068
|
if(!win.getSelection){return;}var selection=win.getSelection();var length=node.textContent.length;var start=Math.min(offsets.start,length);var end=offsets.end===undefined?start:Math.min(offsets.end,length);// IE 11 uses modern selection, but doesn't support the extend method.
|
|
@@ -9803,64 +10074,64 @@ if(!selection.extend&&start>end){var temp=end;end=start;start=temp;}var startMar
|
|
|
9803
10074
|
// A safety way is to access one of the cross origin properties: Window or Location
|
|
9804
10075
|
// Which might result in "SecurityError" DOM Exception and it is compatible to Safari.
|
|
9805
10076
|
// https://html.spec.whatwg.org/multipage/browsers.html#integration-with-idl
|
|
9806
|
-
return typeof iframe.contentWindow.location.href==='string';}catch(err){return false;}}function getActiveElementDeep(){var win=window;var element=getActiveElement();while(element instanceof win.HTMLIFrameElement){if(isSameOriginFrame(element)){win=element.contentWindow;}else {return element;}element=getActiveElement(win.document);}return element;}/**
|
|
9807
|
-
|
|
9808
|
-
|
|
9809
|
-
|
|
9810
|
-
|
|
9811
|
-
|
|
9812
|
-
|
|
9813
|
-
|
|
9814
|
-
|
|
9815
|
-
|
|
9816
|
-
|
|
9817
|
-
|
|
9818
|
-
|
|
9819
|
-
|
|
9820
|
-
var ancestors=[];var ancestor=priorFocusedElem;while(ancestor=ancestor.parentNode){if(ancestor.nodeType===ELEMENT_NODE){ancestors.push({element:ancestor,left:ancestor.scrollLeft,top:ancestor.scrollTop});}}if(typeof priorFocusedElem.focus==='function'){priorFocusedElem.focus();}for(var i=0;i<ancestors.length;i++){var info=ancestors[i];info.element.scrollLeft=info.left;info.element.scrollTop=info.top;}}}/**
|
|
9821
|
-
|
|
9822
|
-
|
|
9823
|
-
|
|
9824
|
-
|
|
9825
|
-
|
|
10077
|
+
return typeof iframe.contentWindow.location.href==='string';}catch(err){return false;}}function getActiveElementDeep(){var win=window;var element=getActiveElement();while(element instanceof win.HTMLIFrameElement){if(isSameOriginFrame(element)){win=element.contentWindow;}else {return element;}element=getActiveElement(win.document);}return element;}/**
|
|
10078
|
+
* @ReactInputSelection: React input selection module. Based on Selection.js,
|
|
10079
|
+
* but modified to be suitable for react and has a couple of bug fixes (doesn't
|
|
10080
|
+
* assume buttons have range selections allowed).
|
|
10081
|
+
* Input selection module for React.
|
|
10082
|
+
*//**
|
|
10083
|
+
* @hasSelectionCapabilities: we get the element types that support selection
|
|
10084
|
+
* from https://html.spec.whatwg.org/#do-not-apply, looking at `selectionStart`
|
|
10085
|
+
* and `selectionEnd` rows.
|
|
10086
|
+
*/function hasSelectionCapabilities(elem){var nodeName=elem&&elem.nodeName&&elem.nodeName.toLowerCase();return nodeName&&(nodeName==='input'&&(elem.type==='text'||elem.type==='search'||elem.type==='tel'||elem.type==='url'||elem.type==='password')||nodeName==='textarea'||elem.contentEditable==='true');}function getSelectionInformation(){var focusedElem=getActiveElementDeep();return {focusedElem:focusedElem,selectionRange:hasSelectionCapabilities(focusedElem)?getSelection(focusedElem):null};}/**
|
|
10087
|
+
* @restoreSelection: If any selection information was potentially lost,
|
|
10088
|
+
* restore it. This is useful when performing operations that could remove dom
|
|
10089
|
+
* nodes and place them back in, resulting in focus being lost.
|
|
10090
|
+
*/function restoreSelection(priorSelectionInformation){var curFocusedElem=getActiveElementDeep();var priorFocusedElem=priorSelectionInformation.focusedElem;var priorSelectionRange=priorSelectionInformation.selectionRange;if(curFocusedElem!==priorFocusedElem&&isInDocument(priorFocusedElem)){if(priorSelectionRange!==null&&hasSelectionCapabilities(priorFocusedElem)){setSelection(priorFocusedElem,priorSelectionRange);}// Focusing a node can change the scroll position, which is undesirable
|
|
10091
|
+
var ancestors=[];var ancestor=priorFocusedElem;while(ancestor=ancestor.parentNode){if(ancestor.nodeType===ELEMENT_NODE){ancestors.push({element:ancestor,left:ancestor.scrollLeft,top:ancestor.scrollTop});}}if(typeof priorFocusedElem.focus==='function'){priorFocusedElem.focus();}for(var i=0;i<ancestors.length;i++){var info=ancestors[i];info.element.scrollLeft=info.left;info.element.scrollTop=info.top;}}}/**
|
|
10092
|
+
* @getSelection: Gets the selection bounds of a focused textarea, input or
|
|
10093
|
+
* contentEditable node.
|
|
10094
|
+
* -@input: Look up selection bounds of this input
|
|
10095
|
+
* -@return {start: selectionStart, end: selectionEnd}
|
|
10096
|
+
*/function getSelection(input){var selection;if('selectionStart'in input){// Modern browser with input or textarea.
|
|
9826
10097
|
selection={start:input.selectionStart,end:input.selectionEnd};}else {// Content editable or old IE textarea.
|
|
9827
|
-
selection=getOffsets(input);}return selection||{start:0,end:0};}/**
|
|
9828
|
-
|
|
9829
|
-
|
|
9830
|
-
|
|
9831
|
-
|
|
9832
|
-
|
|
9833
|
-
|
|
9834
|
-
|
|
9835
|
-
|
|
9836
|
-
|
|
9837
|
-
|
|
9838
|
-
|
|
9839
|
-
|
|
9840
|
-
|
|
9841
|
-
|
|
9842
|
-
|
|
9843
|
-
|
|
9844
|
-
|
|
9845
|
-
|
|
10098
|
+
selection=getOffsets(input);}return selection||{start:0,end:0};}/**
|
|
10099
|
+
* @setSelection: Sets the selection bounds of a textarea or input and focuses
|
|
10100
|
+
* the input.
|
|
10101
|
+
* -@input Set selection bounds of this input or textarea
|
|
10102
|
+
* -@offsets Object of same form that is returned from get*
|
|
10103
|
+
*/function setSelection(input,offsets){var start=offsets.start;var end=offsets.end;if(end===undefined){end=start;}if('selectionStart'in input){input.selectionStart=start;input.selectionEnd=Math.min(end,input.value.length);}else {setOffsets(input,offsets);}}var skipSelectionChangeEvent=canUseDOM&&'documentMode'in document&&document.documentMode<=11;function registerEvents$3(){registerTwoPhaseEvent('onSelect',['focusout','contextmenu','dragend','focusin','keydown','keyup','mousedown','mouseup','selectionchange']);}var activeElement$1=null;var activeElementInst$1=null;var lastSelection=null;var mouseDown=false;/**
|
|
10104
|
+
* Get an object which is a unique representation of the current selection.
|
|
10105
|
+
*
|
|
10106
|
+
* The return value will not be consistent across nodes or browsers, but
|
|
10107
|
+
* two identical selections on the same node will return identical objects.
|
|
10108
|
+
*/function getSelection$1(node){if('selectionStart'in node&&hasSelectionCapabilities(node)){return {start:node.selectionStart,end:node.selectionEnd};}else {var win=node.ownerDocument&&node.ownerDocument.defaultView||window;var selection=win.getSelection();return {anchorNode:selection.anchorNode,anchorOffset:selection.anchorOffset,focusNode:selection.focusNode,focusOffset:selection.focusOffset};}}/**
|
|
10109
|
+
* Get document associated with the event target.
|
|
10110
|
+
*/function getEventTargetDocument(eventTarget){return eventTarget.window===eventTarget?eventTarget.document:eventTarget.nodeType===DOCUMENT_NODE?eventTarget:eventTarget.ownerDocument;}/**
|
|
10111
|
+
* Poll selection to see whether it's changed.
|
|
10112
|
+
*
|
|
10113
|
+
* @param {object} nativeEvent
|
|
10114
|
+
* @param {object} nativeEventTarget
|
|
10115
|
+
* @return {?SyntheticEvent}
|
|
10116
|
+
*/function constructSelectEvent(dispatchQueue,nativeEvent,nativeEventTarget){// Ensure we have the right element, and that the user is not dragging a
|
|
9846
10117
|
// selection (this matches native `select` event behavior). In HTML5, select
|
|
9847
10118
|
// fires only on input and textarea thus if there's no focused element we
|
|
9848
10119
|
// won't dispatch.
|
|
9849
10120
|
var doc=getEventTargetDocument(nativeEventTarget);if(mouseDown||activeElement$1==null||activeElement$1!==getActiveElement(doc)){return;}// Only fire when selection has actually changed.
|
|
9850
|
-
var currentSelection=getSelection$1(activeElement$1);if(!lastSelection||!shallowEqual(lastSelection,currentSelection)){lastSelection=currentSelection;var listeners=accumulateTwoPhaseListeners(activeElementInst$1,'onSelect');if(listeners.length>0){var event=new SyntheticEvent('onSelect','select',null,nativeEvent,nativeEventTarget);dispatchQueue.push({event:event,listeners:listeners});event.target=activeElement$1;}}}/**
|
|
9851
|
-
|
|
9852
|
-
|
|
9853
|
-
|
|
9854
|
-
|
|
9855
|
-
|
|
9856
|
-
|
|
9857
|
-
|
|
9858
|
-
|
|
9859
|
-
|
|
9860
|
-
|
|
9861
|
-
|
|
9862
|
-
|
|
9863
|
-
|
|
10121
|
+
var currentSelection=getSelection$1(activeElement$1);if(!lastSelection||!shallowEqual(lastSelection,currentSelection)){lastSelection=currentSelection;var listeners=accumulateTwoPhaseListeners(activeElementInst$1,'onSelect');if(listeners.length>0){var event=new SyntheticEvent('onSelect','select',null,nativeEvent,nativeEventTarget);dispatchQueue.push({event:event,listeners:listeners});event.target=activeElement$1;}}}/**
|
|
10122
|
+
* This plugin creates an `onSelect` event that normalizes select events
|
|
10123
|
+
* across form elements.
|
|
10124
|
+
*
|
|
10125
|
+
* Supported elements are:
|
|
10126
|
+
* - input (see `isTextInputElement`)
|
|
10127
|
+
* - textarea
|
|
10128
|
+
* - contentEditable
|
|
10129
|
+
*
|
|
10130
|
+
* This differs from native browser implementations in the following ways:
|
|
10131
|
+
* - Fires on contentEditable fields as well as inputs.
|
|
10132
|
+
* - Fires for collapsed selection.
|
|
10133
|
+
* - Fires after user input.
|
|
10134
|
+
*/function extractEvents$3(dispatchQueue,domEventName,targetInst,nativeEvent,nativeEventTarget,eventSystemFlags,targetContainer){var targetNode=targetInst?getNodeFromInstance(targetInst):window;switch(domEventName){// Track the input node that has focus.
|
|
9864
10135
|
case'focusin':if(isTextInputElement(targetNode)||targetNode.contentEditable==='true'){activeElement$1=targetNode;activeElementInst$1=targetInst;lastSelection=null;}break;case'focusout':activeElement$1=null;activeElementInst$1=null;lastSelection=null;break;// Don't fire the event while the user is dragging. This matches the
|
|
9865
10136
|
// semantics of the native select event.
|
|
9866
10137
|
case'mousedown':mouseDown=true;break;case'contextmenu':case'mouseup':case'dragend':mouseDown=false;constructSelectEvent(dispatchQueue,nativeEvent,nativeEventTarget);break;// Chrome and IE fire non-standard event when selection is changed (and
|
|
@@ -9873,31 +10144,31 @@ case'mousedown':mouseDown=true;break;case'contextmenu':case'mouseup':case'dragen
|
|
|
9873
10144
|
// key, when multiple keydown events are fired but only one keyup is.
|
|
9874
10145
|
// This is also our approach for IE handling, for the reason above.
|
|
9875
10146
|
case'selectionchange':if(skipSelectionChangeEvent){break;}// falls through
|
|
9876
|
-
case'keydown':case'keyup':constructSelectEvent(dispatchQueue,nativeEvent,nativeEventTarget);}}/**
|
|
9877
|
-
|
|
9878
|
-
|
|
9879
|
-
|
|
9880
|
-
|
|
9881
|
-
|
|
9882
|
-
|
|
9883
|
-
|
|
9884
|
-
|
|
9885
|
-
|
|
9886
|
-
|
|
9887
|
-
|
|
9888
|
-
|
|
9889
|
-
|
|
9890
|
-
|
|
10147
|
+
case'keydown':case'keyup':constructSelectEvent(dispatchQueue,nativeEvent,nativeEventTarget);}}/**
|
|
10148
|
+
* Generate a mapping of standard vendor prefixes using the defined style property and event name.
|
|
10149
|
+
*
|
|
10150
|
+
* @param {string} styleProp
|
|
10151
|
+
* @param {string} eventName
|
|
10152
|
+
* @returns {object}
|
|
10153
|
+
*/function makePrefixMap(styleProp,eventName){var prefixes={};prefixes[styleProp.toLowerCase()]=eventName.toLowerCase();prefixes['Webkit'+styleProp]='webkit'+eventName;prefixes['Moz'+styleProp]='moz'+eventName;return prefixes;}/**
|
|
10154
|
+
* A list of event names to a configurable list of vendor prefixes.
|
|
10155
|
+
*/var vendorPrefixes={animationend:makePrefixMap('Animation','AnimationEnd'),animationiteration:makePrefixMap('Animation','AnimationIteration'),animationstart:makePrefixMap('Animation','AnimationStart'),transitionend:makePrefixMap('Transition','TransitionEnd')};/**
|
|
10156
|
+
* Event names that have already been detected and prefixed (if applicable).
|
|
10157
|
+
*/var prefixedEventNames={};/**
|
|
10158
|
+
* Element to check for prefixes on.
|
|
10159
|
+
*/var style={};/**
|
|
10160
|
+
* Bootstrap if a DOM exists.
|
|
10161
|
+
*/if(canUseDOM){style=document.createElement('div').style;// On some platforms, in particular some releases of Android 4.x,
|
|
9891
10162
|
// the un-prefixed "animation" and "transition" properties are defined on the
|
|
9892
10163
|
// style object but the events that fire will still be prefixed, so we need
|
|
9893
10164
|
// to check if the un-prefixed events are usable, and if not remove them from the map.
|
|
9894
10165
|
if(!('AnimationEvent'in window)){delete vendorPrefixes.animationend.animation;delete vendorPrefixes.animationiteration.animation;delete vendorPrefixes.animationstart.animation;}// Same as above
|
|
9895
|
-
if(!('TransitionEvent'in window)){delete vendorPrefixes.transitionend.transition;}}/**
|
|
9896
|
-
|
|
9897
|
-
|
|
9898
|
-
|
|
9899
|
-
|
|
9900
|
-
|
|
10166
|
+
if(!('TransitionEvent'in window)){delete vendorPrefixes.transitionend.transition;}}/**
|
|
10167
|
+
* Attempts to determine the correct vendor prefixed event name.
|
|
10168
|
+
*
|
|
10169
|
+
* @param {string} eventName
|
|
10170
|
+
* @returns {string}
|
|
10171
|
+
*/function getVendorPrefixedEventName(eventName){if(prefixedEventNames[eventName]){return prefixedEventNames[eventName];}else if(!vendorPrefixes[eventName]){return eventName;}var prefixMap=vendorPrefixes[eventName];for(var styleProp in prefixMap){if(prefixMap.hasOwnProperty(styleProp)&&styleProp in style){return prefixedEventNames[eventName]=prefixMap[styleProp];}}return eventName;}var ANIMATION_END=getVendorPrefixedEventName('animationend');var ANIMATION_ITERATION=getVendorPrefixedEventName('animationiteration');var ANIMATION_START=getVendorPrefixedEventName('animationstart');var TRANSITION_END=getVendorPrefixedEventName('transitionend');var topLevelEventsToReactNames=new Map();// NOTE: Capitalization is important in this list!
|
|
9901
10172
|
//
|
|
9902
10173
|
// E.g. it needs "pointerDown", not "pointerdown".
|
|
9903
10174
|
// This is because we derive both React name ("onPointerDown")
|
|
@@ -10011,10 +10282,10 @@ if(tag===HostComponent&&stateNode!==null){var currentTarget=stateNode;var captur
|
|
|
10011
10282
|
// events to their parent. We could also go through parentNode on the
|
|
10012
10283
|
// host node but that wouldn't work for React Native and doesn't let us
|
|
10013
10284
|
// do the portal feature.
|
|
10014
|
-
}while(inst&&inst.tag!==HostComponent);if(inst){return inst;}return null;}/**
|
|
10015
|
-
|
|
10016
|
-
|
|
10017
|
-
|
|
10285
|
+
}while(inst&&inst.tag!==HostComponent);if(inst){return inst;}return null;}/**
|
|
10286
|
+
* Return the lowest common ancestor of A and B, or null if they are in
|
|
10287
|
+
* different trees.
|
|
10288
|
+
*/function getLowestCommonAncestor(instA,instB){var nodeA=instA;var nodeB=instB;var depthA=0;for(var tempA=nodeA;tempA;tempA=getParent(tempA)){depthA++;}var depthB=0;for(var tempB=nodeB;tempB;tempB=getParent(tempB)){depthB++;}// If A is deeper, crawl up.
|
|
10018
10289
|
while(depthA-depthB>0){nodeA=getParent(nodeA);depthA--;}// If B is deeper, crawl up.
|
|
10019
10290
|
while(depthB-depthA>0){nodeB=getParent(nodeB);depthB--;}// Walk in lockstep until we find a match.
|
|
10020
10291
|
var depth=depthA;while(depth--){if(nodeA===nodeB||nodeB!==null&&nodeA===nodeB.alternate){return nodeA;}nodeA=getParent(nodeA);nodeB=getParent(nodeB);}return null;}function accumulateEnterLeaveListenersForEvent(dispatchQueue,event,target,common,inCapturePhase){var registrationName=event._reactName;var listeners=[];var instance=target;while(instance!==null){if(instance===common){break;}var _instance4=instance,alternate=_instance4.alternate,stateNode=_instance4.stateNode,tag=_instance4.tag;if(alternate!==null&&alternate===common){break;}if(tag===HostComponent&&stateNode!==null){var currentTarget=stateNode;if(inCapturePhase){var captureListener=getListener(instance,registrationName);if(captureListener!=null){listeners.unshift(createDispatchListener(instance,captureListener,currentTarget));}}else if(!inCapturePhase){var bubbleListener=getListener(instance,registrationName);if(bubbleListener!=null){listeners.push(createDispatchListener(instance,bubbleListener,currentTarget));}}}instance=instance.return;}if(listeners.length!==0){dispatchQueue.push({event:event,listeners:listeners});}}// We should only use this function for:
|
|
@@ -10215,16 +10486,15 @@ return;}if(didWarnInvalidHydration){return;}didWarnInvalidHydration=true;error('
|
|
|
10215
10486
|
// first, causing a confusing mess.
|
|
10216
10487
|
// https://html.spec.whatwg.org/multipage/syntax.html#special
|
|
10217
10488
|
var specialTags=['address','applet','area','article','aside','base','basefont','bgsound','blockquote','body','br','button','caption','center','col','colgroup','dd','details','dir','div','dl','dt','embed','fieldset','figcaption','figure','footer','form','frame','frameset','h1','h2','h3','h4','h5','h6','head','header','hgroup','hr','html','iframe','img','input','isindex','li','link','listing','main','marquee','menu','menuitem','meta','nav','noembed','noframes','noscript','object','ol','p','param','plaintext','pre','script','section','select','source','style','summary','table','tbody','td','template','textarea','tfoot','th','thead','title','tr','track','ul','wbr','xmp'];// https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
|
|
10218
|
-
var inScopeTags=['applet','caption','html','table','td','th','marquee','object','template',//
|
|
10219
|
-
// TODO: Distinguish by namespace here -- for <title>, including it here
|
|
10489
|
+
var inScopeTags=['applet','caption','html','table','td','th','marquee','object','template',// TODO: Distinguish by namespace here -- for <title>, including it here
|
|
10220
10490
|
// errs on the side of fewer warnings
|
|
10221
10491
|
'foreignObject','desc','title'];// https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope
|
|
10222
10492
|
var buttonScopeTags=inScopeTags.concat(['button']);// https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags
|
|
10223
10493
|
var impliedEndTags=['dd','dt','li','option','optgroup','p','rp','rt'];var emptyAncestorInfo={current:null,formTag:null,aTagInScope:null,buttonTagInScope:null,nobrTagInScope:null,pTagInButtonScope:null,listItemTagAutoclosing:null,dlItemTagAutoclosing:null};updatedAncestorInfo=function(oldInfo,tag){var ancestorInfo=assign({},oldInfo||emptyAncestorInfo);var info={tag:tag};if(inScopeTags.indexOf(tag)!==-1){ancestorInfo.aTagInScope=null;ancestorInfo.buttonTagInScope=null;ancestorInfo.nobrTagInScope=null;}if(buttonScopeTags.indexOf(tag)!==-1){ancestorInfo.pTagInButtonScope=null;}// See rules for 'li', 'dd', 'dt' start tags in
|
|
10224
10494
|
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
|
|
10225
|
-
if(specialTags.indexOf(tag)!==-1&&tag!=='address'&&tag!=='div'&&tag!=='p'){ancestorInfo.listItemTagAutoclosing=null;ancestorInfo.dlItemTagAutoclosing=null;}ancestorInfo.current=info;if(tag==='form'){ancestorInfo.formTag=info;}if(tag==='a'){ancestorInfo.aTagInScope=info;}if(tag==='button'){ancestorInfo.buttonTagInScope=info;}if(tag==='nobr'){ancestorInfo.nobrTagInScope=info;}if(tag==='p'){ancestorInfo.pTagInButtonScope=info;}if(tag==='li'){ancestorInfo.listItemTagAutoclosing=info;}if(tag==='dd'||tag==='dt'){ancestorInfo.dlItemTagAutoclosing=info;}return ancestorInfo;};/**
|
|
10226
|
-
|
|
10227
|
-
|
|
10495
|
+
if(specialTags.indexOf(tag)!==-1&&tag!=='address'&&tag!=='div'&&tag!=='p'){ancestorInfo.listItemTagAutoclosing=null;ancestorInfo.dlItemTagAutoclosing=null;}ancestorInfo.current=info;if(tag==='form'){ancestorInfo.formTag=info;}if(tag==='a'){ancestorInfo.aTagInScope=info;}if(tag==='button'){ancestorInfo.buttonTagInScope=info;}if(tag==='nobr'){ancestorInfo.nobrTagInScope=info;}if(tag==='p'){ancestorInfo.pTagInButtonScope=info;}if(tag==='li'){ancestorInfo.listItemTagAutoclosing=info;}if(tag==='dd'||tag==='dt'){ancestorInfo.dlItemTagAutoclosing=info;}return ancestorInfo;};/**
|
|
10496
|
+
* Returns whether
|
|
10497
|
+
*/var isTagValidWithParent=function(tag,parentTag){// First, let's check if we're in an unusual parsing mode...
|
|
10228
10498
|
switch(parentTag){// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect
|
|
10229
10499
|
case'select':return tag==='option'||tag==='optgroup'||tag==='#text';case'optgroup':return tag==='option'||tag==='#text';// Strictly speaking, seeing an <option> doesn't mean we're in a <select>
|
|
10230
10500
|
// but
|
|
@@ -10245,9 +10515,9 @@ switch(tag){case'h1':case'h2':case'h3':case'h4':case'h5':case'h6':return parentT
|
|
|
10245
10515
|
// parsing rules -- if we're down here, then none of those matched and
|
|
10246
10516
|
// so we allow it only if we don't know what the parent is, as all other
|
|
10247
10517
|
// cases are invalid.
|
|
10248
|
-
return parentTag==null;}return true;};/**
|
|
10249
|
-
|
|
10250
|
-
|
|
10518
|
+
return parentTag==null;}return true;};/**
|
|
10519
|
+
* Returns whether
|
|
10520
|
+
*/var findInvalidAncestorForTag=function(tag,ancestorInfo){switch(tag){case'address':case'article':case'aside':case'blockquote':case'center':case'details':case'dialog':case'dir':case'div':case'dl':case'fieldset':case'figcaption':case'figure':case'footer':case'header':case'hgroup':case'main':case'menu':case'nav':case'ol':case'p':case'section':case'summary':case'ul':case'pre':case'listing':case'table':case'hr':case'xmp':case'h1':case'h2':case'h3':case'h4':case'h5':case'h6':return ancestorInfo.pTagInButtonScope;case'form':return ancestorInfo.formTag||ancestorInfo.pTagInButtonScope;case'li':return ancestorInfo.listItemTagAutoclosing;case'dd':case'dt':return ancestorInfo.dlItemTagAutoclosing;case'button':return ancestorInfo.buttonTagInScope;case'a':// Spec says something about storing a list of markers, but it sounds
|
|
10251
10521
|
// equivalent to this check.
|
|
10252
10522
|
return ancestorInfo.aTagInScope;case'nobr':return ancestorInfo.nobrTagInScope;}return null;};var didWarn$1={};validateDOMNesting=function(childTag,childText,ancestorInfo){ancestorInfo=ancestorInfo||emptyAncestorInfo;var parentInfo=ancestorInfo.current;var parentTag=parentInfo&&parentInfo.tag;if(childText!=null){if(childTag!=null){error('validateDOMNesting: when childText is passed, childTag should be null');}childTag='#text';}var invalidParent=isTagValidWithParent(childTag,parentTag)?null:parentInfo;var invalidAncestor=invalidParent?null:findInvalidAncestorForTag(childTag,ancestorInfo);var invalidParentOrAncestor=invalidParent||invalidAncestor;if(!invalidParentOrAncestor){return;}var ancestorTag=invalidParentOrAncestor.tag;var warnKey=!!invalidParent+'|'+childTag+'|'+ancestorTag;if(didWarn$1[warnKey]){return;}didWarn$1[warnKey]=true;var tagDisplayName=childTag;var whitespaceInfo='';if(childTag==='#text'){if(/\S/.test(childText)){tagDisplayName='Text nodes';}else {tagDisplayName='Whitespace text nodes';whitespaceInfo=" Make sure you don't have any extra whitespace between tags on "+'each line of your source code.';}}else {tagDisplayName='<'+childTag+'>';}if(invalidParent){var info='';if(ancestorTag==='table'&&childTag==='tr'){info+=' Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by '+'the browser.';}error('validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s',tagDisplayName,ancestorTag,whitespaceInfo,info);}else {error('validateDOMNesting(...): %s cannot appear as a descendant of '+'<%s>.',tagDisplayName,ancestorTag);}};}var SUPPRESS_HYDRATION_WARNING$1='suppressHydrationWarning';var SUSPENSE_START_DATA='$';var SUSPENSE_END_DATA='/$';var SUSPENSE_PENDING_START_DATA='$?';var SUSPENSE_FALLBACK_START_DATA='$!';var STYLE$1='style';var eventsEnabled=null;var selectionInformation=null;function getRootHostContext(rootContainerInstance){var type;var namespace;var nodeType=rootContainerInstance.nodeType;switch(nodeType){case DOCUMENT_NODE:case DOCUMENT_FRAGMENT_NODE:{type=nodeType===DOCUMENT_NODE?'#document':'#fragment';var root=rootContainerInstance.documentElement;namespace=root?root.namespaceURI:getChildNamespace(null,'');break;}default:{var container=nodeType===COMMENT_NODE?rootContainerInstance.parentNode:rootContainerInstance;var ownNamespace=container.namespaceURI||null;type=container.tagName;namespace=getChildNamespace(ownNamespace,type);break;}}{var validatedTag=type.toLowerCase();var ancestorInfo=updatedAncestorInfo(null,validatedTag);return {namespace:namespace,ancestorInfo:ancestorInfo};}}function getChildHostContext(parentHostContext,type,rootContainerInstance){{var parentHostContextDev=parentHostContext;var namespace=getChildNamespace(parentHostContextDev.namespace,type);var ancestorInfo=updatedAncestorInfo(parentHostContextDev.ancestorInfo,type);return {namespace:namespace,ancestorInfo:ancestorInfo};}}function getPublicInstance(instance){return instance;}function prepareForCommit(containerInfo){eventsEnabled=isEnabled();selectionInformation=getSelectionInformation();var activeInstance=null;setEnabled(false);return activeInstance;}function resetAfterCommit(containerInfo){restoreSelection(selectionInformation);setEnabled(eventsEnabled);eventsEnabled=null;selectionInformation=null;}function createInstance(type,props,rootContainerInstance,hostContext,internalInstanceHandle){var parentNamespace;{// TODO: take namespace into account when validating.
|
|
10253
10523
|
var hostContextDev=hostContext;validateDOMNesting(type,null,hostContextDev.ancestorInfo);if(typeof props.children==='string'||typeof props.children==='number'){var string=''+props.children;var ownAncestorInfo=updatedAncestorInfo(hostContextDev.ancestorInfo,type);validateDOMNesting(null,string,ownAncestorInfo);}parentNamespace=hostContextDev.namespace;}var domElement=createElement(type,props,rootContainerInstance,parentNamespace);precacheFiberNode(internalInstanceHandle,domElement);updateFiberProps(domElement,props);return domElement;}function appendInitialChild(parentInstance,child){parentInstance.appendChild(child);}function finalizeInitialChildren(domElement,type,props,rootContainerInstance,hostContext){setInitialProperties(domElement,type,props,rootContainerInstance);switch(type){case'button':case'input':case'select':case'textarea':return !!props.autoFocus;case'img':return true;default:return false;}}function prepareUpdate(domElement,type,oldProps,newProps,rootContainerInstance,hostContext){{var hostContextDev=hostContext;if(typeof newProps.children!==typeof oldProps.children&&(typeof newProps.children==='string'||typeof newProps.children==='number')){var string=''+newProps.children;var ownAncestorInfo=updatedAncestorInfo(hostContextDev.ancestorInfo,type);validateDOMNesting(null,string,ownAncestorInfo);}}return diffProperties(domElement,type,oldProps,newProps);}function shouldSetTextContent(type,props){return type==='textarea'||type==='noscript'||typeof props.children==='string'||typeof props.children==='number'||typeof props.dangerouslySetInnerHTML==='object'&&props.dangerouslySetInnerHTML!==null&&props.dangerouslySetInnerHTML.__html!=null;}function createTextInstance(text,rootContainerInstance,hostContext,internalInstanceHandle){{var hostContextDev=hostContext;validateDOMNesting(null,text,hostContextDev.ancestorInfo);}var textNode=createTextNode(text,rootContainerInstance);precacheFiberNode(internalInstanceHandle,textNode);return textNode;}function getCurrentEventPriority(){var currentEvent=window.event;if(currentEvent===undefined){return DefaultEventPriority;}return getEventPriority(currentEvent.type);}// if a component just imports ReactDOM (e.g. for findDOMNode).
|
|
@@ -10373,13 +10643,13 @@ var targetSuspenseInst=suspenseInstance[internalInstanceKey];if(targetSuspenseIn
|
|
|
10373
10643
|
suspenseInstance=getParentSuspenseInstance(suspenseInstance);// If we don't find one, then that should mean that the parent
|
|
10374
10644
|
// host component also hasn't hydrated yet. We can return it
|
|
10375
10645
|
// below since it will bail out on the isMounted check later.
|
|
10376
|
-
}}return targetInst;}targetNode=parentNode;parentNode=targetNode.parentNode;}return null;}/**
|
|
10377
|
-
|
|
10378
|
-
|
|
10379
|
-
|
|
10380
|
-
|
|
10381
|
-
|
|
10382
|
-
|
|
10646
|
+
}}return targetInst;}targetNode=parentNode;parentNode=targetNode.parentNode;}return null;}/**
|
|
10647
|
+
* Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent
|
|
10648
|
+
* instance, or null if the node was not rendered by this React.
|
|
10649
|
+
*/function getInstanceFromNode(node){var inst=node[internalInstanceKey]||node[internalContainerInstanceKey];if(inst){if(inst.tag===HostComponent||inst.tag===HostText||inst.tag===SuspenseComponent||inst.tag===HostRoot){return inst;}else {return null;}}return null;}/**
|
|
10650
|
+
* Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding
|
|
10651
|
+
* DOM node.
|
|
10652
|
+
*/function getNodeFromInstance(inst){if(inst.tag===HostComponent||inst.tag===HostText){// In Fiber this, is just the state node right now. We assume it will be
|
|
10383
10653
|
// a host component or host text.
|
|
10384
10654
|
return inst.stateNode;}// Without this first invariant, passing a non-DOM-component triggers the next
|
|
10385
10655
|
// invariant for a missing parent, which is super confusing.
|
|
@@ -10536,11 +10806,11 @@ var componentWillMountUniqueNames=new Set();if(pendingComponentWillMountWarnings
|
|
|
10536
10806
|
// UNSAFE_ ones before the deprecated ones, since they'll be 'louder'
|
|
10537
10807
|
if(UNSAFE_componentWillMountUniqueNames.size>0){var sortedNames=setToSortedString(UNSAFE_componentWillMountUniqueNames);error('Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. '+'See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n'+'* Move code with side effects to componentDidMount, and set initial state in the constructor.\n'+'\nPlease update the following components: %s',sortedNames);}if(UNSAFE_componentWillReceivePropsUniqueNames.size>0){var _sortedNames=setToSortedString(UNSAFE_componentWillReceivePropsUniqueNames);error('Using UNSAFE_componentWillReceiveProps in strict mode is not recommended '+'and may indicate bugs in your code. '+'See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n'+'* Move data fetching code or side effects to componentDidUpdate.\n'+"* If you're updating state whenever props change, "+'refactor your code to use memoization techniques or move it to '+'static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n'+'\nPlease update the following components: %s',_sortedNames);}if(UNSAFE_componentWillUpdateUniqueNames.size>0){var _sortedNames2=setToSortedString(UNSAFE_componentWillUpdateUniqueNames);error('Using UNSAFE_componentWillUpdate in strict mode is not recommended '+'and may indicate bugs in your code. '+'See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n'+'* Move data fetching code or side effects to componentDidUpdate.\n'+'\nPlease update the following components: %s',_sortedNames2);}if(componentWillMountUniqueNames.size>0){var _sortedNames3=setToSortedString(componentWillMountUniqueNames);warn('componentWillMount has been renamed, and is not recommended for use. '+'See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n'+'* Move code with side effects to componentDidMount, and set initial state in the constructor.\n'+'* Rename componentWillMount to UNSAFE_componentWillMount to suppress '+'this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. '+'To rename all deprecated lifecycles to their new names, you can run '+'`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n'+'\nPlease update the following components: %s',_sortedNames3);}if(componentWillReceivePropsUniqueNames.size>0){var _sortedNames4=setToSortedString(componentWillReceivePropsUniqueNames);warn('componentWillReceiveProps has been renamed, and is not recommended for use. '+'See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n'+'* Move data fetching code or side effects to componentDidUpdate.\n'+"* If you're updating state whenever props change, refactor your "+'code to use memoization techniques or move it to '+'static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n'+'* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress '+'this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. '+'To rename all deprecated lifecycles to their new names, you can run '+'`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n'+'\nPlease update the following components: %s',_sortedNames4);}if(componentWillUpdateUniqueNames.size>0){var _sortedNames5=setToSortedString(componentWillUpdateUniqueNames);warn('componentWillUpdate has been renamed, and is not recommended for use. '+'See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n'+'* Move data fetching code or side effects to componentDidUpdate.\n'+'* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress '+'this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. '+'To rename all deprecated lifecycles to their new names, you can run '+'`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n'+'\nPlease update the following components: %s',_sortedNames5);}};var pendingLegacyContextWarning=new Map();// Tracks components we have already warned about.
|
|
10538
10808
|
var didWarnAboutLegacyContext=new Set();ReactStrictModeWarnings.recordLegacyContextWarning=function(fiber,instance){var strictRoot=findStrictRoot(fiber);if(strictRoot===null){error('Expected to find a StrictMode component in a strict mode tree. '+'This error is likely caused by a bug in React. Please file an issue.');return;}// Dedup strategy: Warn once per component.
|
|
10539
|
-
if(didWarnAboutLegacyContext.has(fiber.type)){return;}var warningsForRoot=pendingLegacyContextWarning.get(strictRoot);if(fiber.type.contextTypes!=null||fiber.type.childContextTypes!=null||instance!==null&&typeof instance.getChildContext==='function'){if(warningsForRoot===undefined){warningsForRoot=[];pendingLegacyContextWarning.set(strictRoot,warningsForRoot);}warningsForRoot.push(fiber);}};ReactStrictModeWarnings.flushLegacyContextWarning=function(){pendingLegacyContextWarning.forEach(function(fiberArray,strictRoot){if(fiberArray.length===0){return;}var firstFiber=fiberArray[0];var uniqueNames=new Set();fiberArray.forEach(function(fiber){uniqueNames.add(getComponentNameFromFiber(fiber)||'Component');didWarnAboutLegacyContext.add(fiber.type);});var sortedNames=setToSortedString(uniqueNames);try{setCurrentFiber(firstFiber);error('Legacy context API has been detected within a strict-mode tree.'+'\n\nThe old API will be supported in all 16.x releases, but applications '+'using it should migrate to the new version.'+'\n\nPlease update the following components: %s'+'\n\nLearn more about this warning here: https://reactjs.org/link/legacy-context',sortedNames);}finally{resetCurrentFiber();}});};ReactStrictModeWarnings.discardPendingWarnings=function(){pendingComponentWillMountWarnings=[];pendingUNSAFE_ComponentWillMountWarnings=[];pendingComponentWillReceivePropsWarnings=[];pendingUNSAFE_ComponentWillReceivePropsWarnings=[];pendingComponentWillUpdateWarnings=[];pendingUNSAFE_ComponentWillUpdateWarnings=[];pendingLegacyContextWarning=new Map();};}var didWarnAboutMaps;var didWarnAboutGenerators;var didWarnAboutStringRefs;var ownerHasKeyUseWarning;var ownerHasFunctionTypeWarning;var warnForMissingKey=function(child,returnFiber){};{didWarnAboutMaps=false;didWarnAboutGenerators=false;didWarnAboutStringRefs={};/**
|
|
10540
|
-
|
|
10541
|
-
|
|
10542
|
-
|
|
10543
|
-
|
|
10809
|
+
if(didWarnAboutLegacyContext.has(fiber.type)){return;}var warningsForRoot=pendingLegacyContextWarning.get(strictRoot);if(fiber.type.contextTypes!=null||fiber.type.childContextTypes!=null||instance!==null&&typeof instance.getChildContext==='function'){if(warningsForRoot===undefined){warningsForRoot=[];pendingLegacyContextWarning.set(strictRoot,warningsForRoot);}warningsForRoot.push(fiber);}};ReactStrictModeWarnings.flushLegacyContextWarning=function(){pendingLegacyContextWarning.forEach(function(fiberArray,strictRoot){if(fiberArray.length===0){return;}var firstFiber=fiberArray[0];var uniqueNames=new Set();fiberArray.forEach(function(fiber){uniqueNames.add(getComponentNameFromFiber(fiber)||'Component');didWarnAboutLegacyContext.add(fiber.type);});var sortedNames=setToSortedString(uniqueNames);try{setCurrentFiber(firstFiber);error('Legacy context API has been detected within a strict-mode tree.'+'\n\nThe old API will be supported in all 16.x releases, but applications '+'using it should migrate to the new version.'+'\n\nPlease update the following components: %s'+'\n\nLearn more about this warning here: https://reactjs.org/link/legacy-context',sortedNames);}finally{resetCurrentFiber();}});};ReactStrictModeWarnings.discardPendingWarnings=function(){pendingComponentWillMountWarnings=[];pendingUNSAFE_ComponentWillMountWarnings=[];pendingComponentWillReceivePropsWarnings=[];pendingUNSAFE_ComponentWillReceivePropsWarnings=[];pendingComponentWillUpdateWarnings=[];pendingUNSAFE_ComponentWillUpdateWarnings=[];pendingLegacyContextWarning=new Map();};}var didWarnAboutMaps;var didWarnAboutGenerators;var didWarnAboutStringRefs;var ownerHasKeyUseWarning;var ownerHasFunctionTypeWarning;var warnForMissingKey=function(child,returnFiber){};{didWarnAboutMaps=false;didWarnAboutGenerators=false;didWarnAboutStringRefs={};/**
|
|
10810
|
+
* Warn if there's no key explicitly set on dynamic arrays of children or
|
|
10811
|
+
* object keys are not valid. This allows us to keep track of children between
|
|
10812
|
+
* updates.
|
|
10813
|
+
*/ownerHasKeyUseWarning={};ownerHasFunctionTypeWarning={};warnForMissingKey=function(child,returnFiber){if(child===null||typeof child!=='object'){return;}if(!child._store||child._store.validated||child.key!=null){return;}if(typeof child._store!=='object'){throw new Error('React Component in warnForMissingKey should have a _store. '+'This error is likely caused by a bug in React. Please file an issue.');}child._store.validated=true;var componentName=getComponentNameFromFiber(returnFiber)||'Component';if(ownerHasKeyUseWarning[componentName]){return;}ownerHasKeyUseWarning[componentName]=true;error('Each child in a list should have a unique '+'"key" prop. See https://reactjs.org/link/warning-keys for '+'more information.');};}function isReactClass(type){return type.prototype&&type.prototype.isReactComponent;}function coerceRef(returnFiber,current,element){var mixedRef=element.ref;if(mixedRef!==null&&typeof mixedRef!=='function'&&typeof mixedRef!=='object'){{// TODO: Clean this up once we turn on the string ref warning for
|
|
10544
10814
|
// everyone, because the strict mode case will no longer be relevant
|
|
10545
10815
|
if((returnFiber.mode&StrictLegacyMode||warnAboutStringRefs)&&// We warn in ReactElement.js if owner and self are equal for string refs
|
|
10546
10816
|
// because these cannot be automatically converted to an arrow function
|
|
@@ -10592,9 +10862,9 @@ var key=oldFiber!==null?oldFiber.key:null;if(typeof newChild==='string'&&newChil
|
|
|
10592
10862
|
// node.
|
|
10593
10863
|
if(key!==null){return null;}return updateTextNode(returnFiber,oldFiber,''+newChild,lanes);}if(typeof newChild==='object'&&newChild!==null){switch(newChild.$$typeof){case REACT_ELEMENT_TYPE:{if(newChild.key===key){return updateElement(returnFiber,oldFiber,newChild,lanes);}else {return null;}}case REACT_PORTAL_TYPE:{if(newChild.key===key){return updatePortal(returnFiber,oldFiber,newChild,lanes);}else {return null;}}case REACT_LAZY_TYPE:{var payload=newChild._payload;var init=newChild._init;return updateSlot(returnFiber,oldFiber,init(payload),lanes);}}if(isArray(newChild)||getIteratorFn(newChild)){if(key!==null){return null;}return updateFragment(returnFiber,oldFiber,newChild,lanes,null);}throwOnInvalidObjectType(returnFiber,newChild);}{if(typeof newChild==='function'){warnOnFunctionType(returnFiber);}}return null;}function updateFromMap(existingChildren,returnFiber,newIdx,newChild,lanes){if(typeof newChild==='string'&&newChild!==''||typeof newChild==='number'){// Text nodes don't have keys, so we neither have to check the old nor
|
|
10594
10864
|
// new node for the key. If both are text nodes, they match.
|
|
10595
|
-
var matchedFiber=existingChildren.get(newIdx)||null;return updateTextNode(returnFiber,matchedFiber,''+newChild,lanes);}if(typeof newChild==='object'&&newChild!==null){switch(newChild.$$typeof){case REACT_ELEMENT_TYPE:{var _matchedFiber=existingChildren.get(newChild.key===null?newIdx:newChild.key)||null;return updateElement(returnFiber,_matchedFiber,newChild,lanes);}case REACT_PORTAL_TYPE:{var _matchedFiber2=existingChildren.get(newChild.key===null?newIdx:newChild.key)||null;return updatePortal(returnFiber,_matchedFiber2,newChild,lanes);}case REACT_LAZY_TYPE:var payload=newChild._payload;var init=newChild._init;return updateFromMap(existingChildren,returnFiber,newIdx,init(payload),lanes);}if(isArray(newChild)||getIteratorFn(newChild)){var _matchedFiber3=existingChildren.get(newIdx)||null;return updateFragment(returnFiber,_matchedFiber3,newChild,lanes,null);}throwOnInvalidObjectType(returnFiber,newChild);}{if(typeof newChild==='function'){warnOnFunctionType(returnFiber);}}return null;}/**
|
|
10596
|
-
|
|
10597
|
-
|
|
10865
|
+
var matchedFiber=existingChildren.get(newIdx)||null;return updateTextNode(returnFiber,matchedFiber,''+newChild,lanes);}if(typeof newChild==='object'&&newChild!==null){switch(newChild.$$typeof){case REACT_ELEMENT_TYPE:{var _matchedFiber=existingChildren.get(newChild.key===null?newIdx:newChild.key)||null;return updateElement(returnFiber,_matchedFiber,newChild,lanes);}case REACT_PORTAL_TYPE:{var _matchedFiber2=existingChildren.get(newChild.key===null?newIdx:newChild.key)||null;return updatePortal(returnFiber,_matchedFiber2,newChild,lanes);}case REACT_LAZY_TYPE:var payload=newChild._payload;var init=newChild._init;return updateFromMap(existingChildren,returnFiber,newIdx,init(payload),lanes);}if(isArray(newChild)||getIteratorFn(newChild)){var _matchedFiber3=existingChildren.get(newIdx)||null;return updateFragment(returnFiber,_matchedFiber3,newChild,lanes,null);}throwOnInvalidObjectType(returnFiber,newChild);}{if(typeof newChild==='function'){warnOnFunctionType(returnFiber);}}return null;}/**
|
|
10866
|
+
* Warns if there is a duplicate or missing key
|
|
10867
|
+
*/function warnOnInvalidKey(child,knownKeys,returnFiber){{if(typeof child!=='object'||child===null){return knownKeys;}switch(child.$$typeof){case REACT_ELEMENT_TYPE:case REACT_PORTAL_TYPE:warnForMissingKey(child,returnFiber);var key=child.key;if(typeof key!=='string'){break;}if(knownKeys===null){knownKeys=new Set();knownKeys.add(key);break;}if(!knownKeys.has(key)){knownKeys.add(key);break;}error('Encountered two children with the same key, `%s`. '+'Keys should be unique so that components maintain their identity '+'across updates. Non-unique keys may cause children to be '+'duplicated and/or omitted — the behavior is unsupported and '+'could change in a future version.',key);break;case REACT_LAZY_TYPE:var payload=child._payload;var init=child._init;warnOnInvalidKey(init(payload),knownKeys,returnFiber);break;}}return knownKeys;}function reconcileChildrenArray(returnFiber,currentFirstChild,newChildren,lanes){// This algorithm can't optimize by searching from both ends since we
|
|
10598
10868
|
// don't have backpointers on fibers. I'm trying to see how far we can get
|
|
10599
10869
|
// with that model. If it ends up not being worth the tradeoffs, we can
|
|
10600
10870
|
// add it later.
|
|
@@ -11067,8 +11337,7 @@ return subscribe(handleStoreChange);}function checkIfSnapshotChanged(inst){var l
|
|
|
11067
11337
|
initialState=initialState();}hook.memoizedState=hook.baseState=initialState;var queue={pending:null,interleaved:null,lanes:NoLanes,dispatch:null,lastRenderedReducer:basicStateReducer,lastRenderedState:initialState};hook.queue=queue;var dispatch=queue.dispatch=dispatchSetState.bind(null,currentlyRenderingFiber$1,queue);return [hook.memoizedState,dispatch];}function updateState(initialState){return updateReducer(basicStateReducer);}function rerenderState(initialState){return rerenderReducer(basicStateReducer);}function pushEffect(tag,create,destroy,deps){var effect={tag:tag,create:create,destroy:destroy,deps:deps,// Circular
|
|
11068
11338
|
next:null};var componentUpdateQueue=currentlyRenderingFiber$1.updateQueue;if(componentUpdateQueue===null){componentUpdateQueue=createFunctionComponentUpdateQueue();currentlyRenderingFiber$1.updateQueue=componentUpdateQueue;componentUpdateQueue.lastEffect=effect.next=effect;}else {var lastEffect=componentUpdateQueue.lastEffect;if(lastEffect===null){componentUpdateQueue.lastEffect=effect.next=effect;}else {var firstEffect=lastEffect.next;lastEffect.next=effect;effect.next=firstEffect;componentUpdateQueue.lastEffect=effect;}}return effect;}function mountRef(initialValue){var hook=mountWorkInProgressHook();{var _ref2={current:initialValue};hook.memoizedState=_ref2;return _ref2;}}function updateRef(initialValue){var hook=updateWorkInProgressHook();return hook.memoizedState;}function mountEffectImpl(fiberFlags,hookFlags,create,deps){var hook=mountWorkInProgressHook();var nextDeps=deps===undefined?null:deps;currentlyRenderingFiber$1.flags|=fiberFlags;hook.memoizedState=pushEffect(HasEffect|hookFlags,create,undefined,nextDeps);}function updateEffectImpl(fiberFlags,hookFlags,create,deps){var hook=updateWorkInProgressHook();var nextDeps=deps===undefined?null:deps;var destroy=undefined;if(currentHook!==null){var prevEffect=currentHook.memoizedState;destroy=prevEffect.destroy;if(nextDeps!==null){var prevDeps=prevEffect.deps;if(areHookInputsEqual(nextDeps,prevDeps)){hook.memoizedState=pushEffect(hookFlags,create,destroy,nextDeps);return;}}}currentlyRenderingFiber$1.flags|=fiberFlags;hook.memoizedState=pushEffect(HasEffect|hookFlags,create,destroy,nextDeps);}function mountEffect(create,deps){if((currentlyRenderingFiber$1.mode&StrictEffectsMode)!==NoMode){return mountEffectImpl(MountPassiveDev|Passive|PassiveStatic,Passive$1,create,deps);}else {return mountEffectImpl(Passive|PassiveStatic,Passive$1,create,deps);}}function updateEffect(create,deps){return updateEffectImpl(Passive,Passive$1,create,deps);}function mountInsertionEffect(create,deps){return mountEffectImpl(Update,Insertion,create,deps);}function updateInsertionEffect(create,deps){return updateEffectImpl(Update,Insertion,create,deps);}function mountLayoutEffect(create,deps){var fiberFlags=Update;{fiberFlags|=LayoutStatic;}if((currentlyRenderingFiber$1.mode&StrictEffectsMode)!==NoMode){fiberFlags|=MountLayoutDev;}return mountEffectImpl(fiberFlags,Layout,create,deps);}function updateLayoutEffect(create,deps){return updateEffectImpl(Update,Layout,create,deps);}function imperativeHandleEffect(create,ref){if(typeof ref==='function'){var refCallback=ref;var _inst=create();refCallback(_inst);return function(){refCallback(null);};}else if(ref!==null&&ref!==undefined){var refObject=ref;{if(!refObject.hasOwnProperty('current')){error('Expected useImperativeHandle() first argument to either be a '+'ref callback or React.createRef() object. Instead received: %s.','an object with keys {'+Object.keys(refObject).join(', ')+'}');}}var _inst2=create();refObject.current=_inst2;return function(){refObject.current=null;};}}function mountImperativeHandle(ref,create,deps){{if(typeof create!=='function'){error('Expected useImperativeHandle() second argument to be a function '+'that creates a handle. Instead received: %s.',create!==null?typeof create:'null');}}// TODO: If deps are provided, should we skip comparing the ref itself?
|
|
11069
11339
|
var effectDeps=deps!==null&&deps!==undefined?deps.concat([ref]):null;var fiberFlags=Update;{fiberFlags|=LayoutStatic;}if((currentlyRenderingFiber$1.mode&StrictEffectsMode)!==NoMode){fiberFlags|=MountLayoutDev;}return mountEffectImpl(fiberFlags,Layout,imperativeHandleEffect.bind(null,create,ref),effectDeps);}function updateImperativeHandle(ref,create,deps){{if(typeof create!=='function'){error('Expected useImperativeHandle() second argument to be a function '+'that creates a handle. Instead received: %s.',create!==null?typeof create:'null');}}// TODO: If deps are provided, should we skip comparing the ref itself?
|
|
11070
|
-
var effectDeps=deps!==null&&deps!==undefined?deps.concat([ref]):null;return updateEffectImpl(Update,Layout,imperativeHandleEffect.bind(null,create,ref),effectDeps);}function mountDebugValue(value,formatterFn){//
|
|
11071
|
-
// The react-debug-hooks package injects its own implementation
|
|
11340
|
+
var effectDeps=deps!==null&&deps!==undefined?deps.concat([ref]):null;return updateEffectImpl(Update,Layout,imperativeHandleEffect.bind(null,create,ref),effectDeps);}function mountDebugValue(value,formatterFn){// The react-debug-hooks package injects its own implementation
|
|
11072
11341
|
// so that e.g. DevTools can display custom hook values.
|
|
11073
11342
|
}var updateDebugValue=mountDebugValue;function mountCallback(callback,deps){var hook=mountWorkInProgressHook();var nextDeps=deps===undefined?null:deps;hook.memoizedState=[callback,nextDeps];return callback;}function updateCallback(callback,deps){var hook=updateWorkInProgressHook();var nextDeps=deps===undefined?null:deps;var prevState=hook.memoizedState;if(prevState!==null){if(nextDeps!==null){var prevDeps=prevState[1];if(areHookInputsEqual(nextDeps,prevDeps)){return prevState[0];}}}hook.memoizedState=[callback,nextDeps];return callback;}function mountMemo(nextCreate,deps){var hook=mountWorkInProgressHook();var nextDeps=deps===undefined?null:deps;var nextValue=nextCreate();hook.memoizedState=[nextValue,nextDeps];return nextValue;}function updateMemo(nextCreate,deps){var hook=updateWorkInProgressHook();var nextDeps=deps===undefined?null:deps;var prevState=hook.memoizedState;if(prevState!==null){// Assume these are defined. If they're not, areHookInputsEqual will warn.
|
|
11074
11343
|
if(nextDeps!==null){var prevDeps=prevState[1];if(areHookInputsEqual(nextDeps,prevDeps)){return prevState[0];}}}var nextValue=nextCreate();hook.memoizedState=[nextValue,nextDeps];return nextValue;}function mountDeferredValue(value){var hook=mountWorkInProgressHook();hook.memoizedState=value;return value;}function updateDeferredValue(value){var hook=updateWorkInProgressHook();var resolvedCurrentHook=currentHook;var prevValue=resolvedCurrentHook.memoizedState;return updateDeferredValueImpl(hook,prevValue,value);}function rerenderDeferredValue(value){var hook=updateWorkInProgressHook();if(currentHook===null){// This is a rerender during a mount.
|
|
@@ -11128,22 +11397,22 @@ queueLanes=intersectLanes(queueLanes,root.pendingLanes);// Entangle the new tran
|
|
|
11128
11397
|
var newQueueLanes=mergeLanes(queueLanes,lane);queue.lanes=newQueueLanes;// Even if queue.lanes already include lane, we don't know for certain if
|
|
11129
11398
|
// the lane finished since the last time we entangled it. So we need to
|
|
11130
11399
|
// entangle it again, just to be sure.
|
|
11131
|
-
markRootEntangled(root,newQueueLanes);}}function markUpdateInDevTools(fiber,lane,action){{markStateUpdateScheduled(fiber,lane);}}var ContextOnlyDispatcher={readContext:readContext,useCallback:throwInvalidHookError,useContext:throwInvalidHookError,useEffect:throwInvalidHookError,useImperativeHandle:throwInvalidHookError,useInsertionEffect:throwInvalidHookError,useLayoutEffect:throwInvalidHookError,useMemo:throwInvalidHookError,useReducer:throwInvalidHookError,useRef:throwInvalidHookError,useState:throwInvalidHookError,useDebugValue:throwInvalidHookError,useDeferredValue:throwInvalidHookError,useTransition:throwInvalidHookError,useMutableSource:throwInvalidHookError,useSyncExternalStore:throwInvalidHookError,useId:throwInvalidHookError,unstable_isNewReconciler:enableNewReconciler};var HooksDispatcherOnMountInDEV=null;var HooksDispatcherOnMountWithHookTypesInDEV=null;var HooksDispatcherOnUpdateInDEV=null;var HooksDispatcherOnRerenderInDEV=null;var InvalidNestedHooksDispatcherOnMountInDEV=null;var InvalidNestedHooksDispatcherOnUpdateInDEV=null;var InvalidNestedHooksDispatcherOnRerenderInDEV=null;{var warnInvalidContextAccess=function(){error('Context can only be read while React is rendering. '+'In classes, you can read it in the render method or getDerivedStateFromProps. '+'In function components, you can read it directly in the function body, but not '+'inside Hooks like useReducer() or useMemo().');};var warnInvalidHookAccess=function(){error('Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. '+'You can only call Hooks at the top level of your React function. '+'For more information, see '+'https://reactjs.org/link/rules-of-hooks');};HooksDispatcherOnMountInDEV={readContext:function(context){return readContext(context);},useCallback:function(callback,deps){currentHookNameInDev='useCallback';mountHookTypesDev();checkDepsAreArrayDev(deps);return mountCallback(callback,deps);},useContext:function(context){currentHookNameInDev='useContext';mountHookTypesDev();return readContext(context);},useEffect:function(create,deps){currentHookNameInDev='useEffect';mountHookTypesDev();checkDepsAreArrayDev(deps);return mountEffect(create,deps);},useImperativeHandle:function(ref,create,deps){currentHookNameInDev='useImperativeHandle';mountHookTypesDev();checkDepsAreArrayDev(deps);return mountImperativeHandle(ref,create,deps);},useInsertionEffect:function(create,deps){currentHookNameInDev='useInsertionEffect';mountHookTypesDev();checkDepsAreArrayDev(deps);return mountInsertionEffect(create,deps);},useLayoutEffect:function(create,deps){currentHookNameInDev='useLayoutEffect';mountHookTypesDev();checkDepsAreArrayDev(deps);return mountLayoutEffect(create,deps);},useMemo:function(create,deps){currentHookNameInDev='useMemo';mountHookTypesDev();checkDepsAreArrayDev(deps);var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnMountInDEV;try{return mountMemo(create,deps);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useReducer:function(reducer,initialArg,init){currentHookNameInDev='useReducer';mountHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnMountInDEV;try{return mountReducer(reducer,initialArg,init);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useRef:function(initialValue){currentHookNameInDev='useRef';mountHookTypesDev();return mountRef(initialValue);},useState:function(initialState){currentHookNameInDev='useState';mountHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnMountInDEV;try{return mountState(initialState);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useDebugValue:function(value,formatterFn){currentHookNameInDev='useDebugValue';mountHookTypesDev();return mountDebugValue();},useDeferredValue:function(value){currentHookNameInDev='useDeferredValue';mountHookTypesDev();return mountDeferredValue(value);},useTransition:function(){currentHookNameInDev='useTransition';mountHookTypesDev();return mountTransition();},useMutableSource:function(source,getSnapshot,subscribe){currentHookNameInDev='useMutableSource';mountHookTypesDev();return mountMutableSource();},useSyncExternalStore:function(subscribe,getSnapshot,getServerSnapshot){currentHookNameInDev='useSyncExternalStore';mountHookTypesDev();return mountSyncExternalStore(subscribe,getSnapshot,getServerSnapshot);},useId:function(){currentHookNameInDev='useId';mountHookTypesDev();return mountId();},unstable_isNewReconciler:enableNewReconciler};HooksDispatcherOnMountWithHookTypesInDEV={readContext:function(context){return readContext(context);},useCallback:function(callback,deps){currentHookNameInDev='useCallback';updateHookTypesDev();return mountCallback(callback,deps);},useContext:function(context){currentHookNameInDev='useContext';updateHookTypesDev();return readContext(context);},useEffect:function(create,deps){currentHookNameInDev='useEffect';updateHookTypesDev();return mountEffect(create,deps);},useImperativeHandle:function(ref,create,deps){currentHookNameInDev='useImperativeHandle';updateHookTypesDev();return mountImperativeHandle(ref,create,deps);},useInsertionEffect:function(create,deps){currentHookNameInDev='useInsertionEffect';updateHookTypesDev();return mountInsertionEffect(create,deps);},useLayoutEffect:function(create,deps){currentHookNameInDev='useLayoutEffect';updateHookTypesDev();return mountLayoutEffect(create,deps);},useMemo:function(create,deps){currentHookNameInDev='useMemo';updateHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnMountInDEV;try{return mountMemo(create,deps);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useReducer:function(reducer,initialArg,init){currentHookNameInDev='useReducer';updateHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnMountInDEV;try{return mountReducer(reducer,initialArg,init);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useRef:function(initialValue){currentHookNameInDev='useRef';updateHookTypesDev();return mountRef(initialValue);},useState:function(initialState){currentHookNameInDev='useState';updateHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnMountInDEV;try{return mountState(initialState);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useDebugValue:function(value,formatterFn){currentHookNameInDev='useDebugValue';updateHookTypesDev();return mountDebugValue();},useDeferredValue:function(value){currentHookNameInDev='useDeferredValue';updateHookTypesDev();return mountDeferredValue(value);},useTransition:function(){currentHookNameInDev='useTransition';updateHookTypesDev();return mountTransition();},useMutableSource:function(source,getSnapshot,subscribe){currentHookNameInDev='useMutableSource';updateHookTypesDev();return mountMutableSource();},useSyncExternalStore:function(subscribe,getSnapshot,getServerSnapshot){currentHookNameInDev='useSyncExternalStore';updateHookTypesDev();return mountSyncExternalStore(subscribe,getSnapshot,getServerSnapshot);},useId:function(){currentHookNameInDev='useId';updateHookTypesDev();return mountId();},unstable_isNewReconciler:enableNewReconciler};HooksDispatcherOnUpdateInDEV={readContext:function(context){return readContext(context);},useCallback:function(callback,deps){currentHookNameInDev='useCallback';updateHookTypesDev();return updateCallback(callback,deps);},useContext:function(context){currentHookNameInDev='useContext';updateHookTypesDev();return readContext(context);},useEffect:function(create,deps){currentHookNameInDev='useEffect';updateHookTypesDev();return updateEffect(create,deps);},useImperativeHandle:function(ref,create,deps){currentHookNameInDev='useImperativeHandle';updateHookTypesDev();return updateImperativeHandle(ref,create,deps);},useInsertionEffect:function(create,deps){currentHookNameInDev='useInsertionEffect';updateHookTypesDev();return updateInsertionEffect(create,deps);},useLayoutEffect:function(create,deps){currentHookNameInDev='useLayoutEffect';updateHookTypesDev();return updateLayoutEffect(create,deps);},useMemo:function(create,deps){currentHookNameInDev='useMemo';updateHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnUpdateInDEV;try{return updateMemo(create,deps);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useReducer:function(reducer,initialArg,init){currentHookNameInDev='useReducer';updateHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnUpdateInDEV;try{return updateReducer(reducer,initialArg,init);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useRef:function(initialValue){currentHookNameInDev='useRef';updateHookTypesDev();return updateRef();},useState:function(initialState){currentHookNameInDev='useState';updateHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnUpdateInDEV;try{return updateState(initialState);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useDebugValue:function(value,formatterFn){currentHookNameInDev='useDebugValue';updateHookTypesDev();return updateDebugValue();},useDeferredValue:function(value){currentHookNameInDev='useDeferredValue';updateHookTypesDev();return updateDeferredValue(value);},useTransition:function(){currentHookNameInDev='useTransition';updateHookTypesDev();return updateTransition();},useMutableSource:function(source,getSnapshot,subscribe){currentHookNameInDev='useMutableSource';updateHookTypesDev();return updateMutableSource();},useSyncExternalStore:function(subscribe,getSnapshot,getServerSnapshot){currentHookNameInDev='useSyncExternalStore';updateHookTypesDev();return updateSyncExternalStore(subscribe,getSnapshot);},useId:function(){currentHookNameInDev='useId';updateHookTypesDev();return updateId();},unstable_isNewReconciler:enableNewReconciler};HooksDispatcherOnRerenderInDEV={readContext:function(context){return readContext(context);},useCallback:function(callback,deps){currentHookNameInDev='useCallback';updateHookTypesDev();return updateCallback(callback,deps);},useContext:function(context){currentHookNameInDev='useContext';updateHookTypesDev();return readContext(context);},useEffect:function(create,deps){currentHookNameInDev='useEffect';updateHookTypesDev();return updateEffect(create,deps);},useImperativeHandle:function(ref,create,deps){currentHookNameInDev='useImperativeHandle';updateHookTypesDev();return updateImperativeHandle(ref,create,deps);},useInsertionEffect:function(create,deps){currentHookNameInDev='useInsertionEffect';updateHookTypesDev();return updateInsertionEffect(create,deps);},useLayoutEffect:function(create,deps){currentHookNameInDev='useLayoutEffect';updateHookTypesDev();return updateLayoutEffect(create,deps);},useMemo:function(create,deps){currentHookNameInDev='useMemo';updateHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnRerenderInDEV;try{return updateMemo(create,deps);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useReducer:function(reducer,initialArg,init){currentHookNameInDev='useReducer';updateHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnRerenderInDEV;try{return rerenderReducer(reducer,initialArg,init);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useRef:function(initialValue){currentHookNameInDev='useRef';updateHookTypesDev();return updateRef();},useState:function(initialState){currentHookNameInDev='useState';updateHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnRerenderInDEV;try{return rerenderState(initialState);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useDebugValue:function(value,formatterFn){currentHookNameInDev='useDebugValue';updateHookTypesDev();return updateDebugValue();},useDeferredValue:function(value){currentHookNameInDev='useDeferredValue';updateHookTypesDev();return rerenderDeferredValue(value);},useTransition:function(){currentHookNameInDev='useTransition';updateHookTypesDev();return rerenderTransition();},useMutableSource:function(source,getSnapshot,subscribe){currentHookNameInDev='useMutableSource';updateHookTypesDev();return updateMutableSource();},useSyncExternalStore:function(subscribe,getSnapshot,getServerSnapshot){currentHookNameInDev='useSyncExternalStore';updateHookTypesDev();return updateSyncExternalStore(subscribe,getSnapshot);},useId:function(){currentHookNameInDev='useId';updateHookTypesDev();return updateId();},unstable_isNewReconciler:enableNewReconciler};InvalidNestedHooksDispatcherOnMountInDEV={readContext:function(context){warnInvalidContextAccess();return readContext(context);},useCallback:function(callback,deps){currentHookNameInDev='useCallback';warnInvalidHookAccess();mountHookTypesDev();return mountCallback(callback,deps);},useContext:function(context){currentHookNameInDev='useContext';warnInvalidHookAccess();mountHookTypesDev();return readContext(context);},useEffect:function(create,deps){currentHookNameInDev='useEffect';warnInvalidHookAccess();mountHookTypesDev();return mountEffect(create,deps);},useImperativeHandle:function(ref,create,deps){currentHookNameInDev='useImperativeHandle';warnInvalidHookAccess();mountHookTypesDev();return mountImperativeHandle(ref,create,deps);},useInsertionEffect:function(create,deps){currentHookNameInDev='useInsertionEffect';warnInvalidHookAccess();mountHookTypesDev();return mountInsertionEffect(create,deps);},useLayoutEffect:function(create,deps){currentHookNameInDev='useLayoutEffect';warnInvalidHookAccess();mountHookTypesDev();return mountLayoutEffect(create,deps);},useMemo:function(create,deps){currentHookNameInDev='useMemo';warnInvalidHookAccess();mountHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnMountInDEV;try{return mountMemo(create,deps);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useReducer:function(reducer,initialArg,init){currentHookNameInDev='useReducer';warnInvalidHookAccess();mountHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnMountInDEV;try{return mountReducer(reducer,initialArg,init);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useRef:function(initialValue){currentHookNameInDev='useRef';warnInvalidHookAccess();mountHookTypesDev();return mountRef(initialValue);},useState:function(initialState){currentHookNameInDev='useState';warnInvalidHookAccess();mountHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnMountInDEV;try{return mountState(initialState);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useDebugValue:function(value,formatterFn){currentHookNameInDev='useDebugValue';warnInvalidHookAccess();mountHookTypesDev();return mountDebugValue();},useDeferredValue:function(value){currentHookNameInDev='useDeferredValue';warnInvalidHookAccess();mountHookTypesDev();return mountDeferredValue(value);},useTransition:function(){currentHookNameInDev='useTransition';warnInvalidHookAccess();mountHookTypesDev();return mountTransition();},useMutableSource:function(source,getSnapshot,subscribe){currentHookNameInDev='useMutableSource';warnInvalidHookAccess();mountHookTypesDev();return mountMutableSource();},useSyncExternalStore:function(subscribe,getSnapshot,getServerSnapshot){currentHookNameInDev='useSyncExternalStore';warnInvalidHookAccess();mountHookTypesDev();return mountSyncExternalStore(subscribe,getSnapshot,getServerSnapshot);},useId:function(){currentHookNameInDev='useId';warnInvalidHookAccess();mountHookTypesDev();return mountId();},unstable_isNewReconciler:enableNewReconciler};InvalidNestedHooksDispatcherOnUpdateInDEV={readContext:function(context){warnInvalidContextAccess();return readContext(context);},useCallback:function(callback,deps){currentHookNameInDev='useCallback';warnInvalidHookAccess();updateHookTypesDev();return updateCallback(callback,deps);},useContext:function(context){currentHookNameInDev='useContext';warnInvalidHookAccess();updateHookTypesDev();return readContext(context);},useEffect:function(create,deps){currentHookNameInDev='useEffect';warnInvalidHookAccess();updateHookTypesDev();return updateEffect(create,deps);},useImperativeHandle:function(ref,create,deps){currentHookNameInDev='useImperativeHandle';warnInvalidHookAccess();updateHookTypesDev();return updateImperativeHandle(ref,create,deps);},useInsertionEffect:function(create,deps){currentHookNameInDev='useInsertionEffect';warnInvalidHookAccess();updateHookTypesDev();return updateInsertionEffect(create,deps);},useLayoutEffect:function(create,deps){currentHookNameInDev='useLayoutEffect';warnInvalidHookAccess();updateHookTypesDev();return updateLayoutEffect(create,deps);},useMemo:function(create,deps){currentHookNameInDev='useMemo';warnInvalidHookAccess();updateHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnUpdateInDEV;try{return updateMemo(create,deps);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useReducer:function(reducer,initialArg,init){currentHookNameInDev='useReducer';warnInvalidHookAccess();updateHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnUpdateInDEV;try{return updateReducer(reducer,initialArg,init);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useRef:function(initialValue){currentHookNameInDev='useRef';warnInvalidHookAccess();updateHookTypesDev();return updateRef();},useState:function(initialState){currentHookNameInDev='useState';warnInvalidHookAccess();updateHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnUpdateInDEV;try{return updateState(initialState);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useDebugValue:function(value,formatterFn){currentHookNameInDev='useDebugValue';warnInvalidHookAccess();updateHookTypesDev();return updateDebugValue();},useDeferredValue:function(value){currentHookNameInDev='useDeferredValue';warnInvalidHookAccess();updateHookTypesDev();return updateDeferredValue(value);},useTransition:function(){currentHookNameInDev='useTransition';warnInvalidHookAccess();updateHookTypesDev();return updateTransition();},useMutableSource:function(source,getSnapshot,subscribe){currentHookNameInDev='useMutableSource';warnInvalidHookAccess();updateHookTypesDev();return updateMutableSource();},useSyncExternalStore:function(subscribe,getSnapshot,getServerSnapshot){currentHookNameInDev='useSyncExternalStore';warnInvalidHookAccess();updateHookTypesDev();return updateSyncExternalStore(subscribe,getSnapshot);},useId:function(){currentHookNameInDev='useId';warnInvalidHookAccess();updateHookTypesDev();return updateId();},unstable_isNewReconciler:enableNewReconciler};InvalidNestedHooksDispatcherOnRerenderInDEV={readContext:function(context){warnInvalidContextAccess();return readContext(context);},useCallback:function(callback,deps){currentHookNameInDev='useCallback';warnInvalidHookAccess();updateHookTypesDev();return updateCallback(callback,deps);},useContext:function(context){currentHookNameInDev='useContext';warnInvalidHookAccess();updateHookTypesDev();return readContext(context);},useEffect:function(create,deps){currentHookNameInDev='useEffect';warnInvalidHookAccess();updateHookTypesDev();return updateEffect(create,deps);},useImperativeHandle:function(ref,create,deps){currentHookNameInDev='useImperativeHandle';warnInvalidHookAccess();updateHookTypesDev();return updateImperativeHandle(ref,create,deps);},useInsertionEffect:function(create,deps){currentHookNameInDev='useInsertionEffect';warnInvalidHookAccess();updateHookTypesDev();return updateInsertionEffect(create,deps);},useLayoutEffect:function(create,deps){currentHookNameInDev='useLayoutEffect';warnInvalidHookAccess();updateHookTypesDev();return updateLayoutEffect(create,deps);},useMemo:function(create,deps){currentHookNameInDev='useMemo';warnInvalidHookAccess();updateHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnUpdateInDEV;try{return updateMemo(create,deps);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useReducer:function(reducer,initialArg,init){currentHookNameInDev='useReducer';warnInvalidHookAccess();updateHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnUpdateInDEV;try{return rerenderReducer(reducer,initialArg,init);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useRef:function(initialValue){currentHookNameInDev='useRef';warnInvalidHookAccess();updateHookTypesDev();return updateRef();},useState:function(initialState){currentHookNameInDev='useState';warnInvalidHookAccess();updateHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnUpdateInDEV;try{return rerenderState(initialState);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useDebugValue:function(value,formatterFn){currentHookNameInDev='useDebugValue';warnInvalidHookAccess();updateHookTypesDev();return updateDebugValue();},useDeferredValue:function(value){currentHookNameInDev='useDeferredValue';warnInvalidHookAccess();updateHookTypesDev();return rerenderDeferredValue(value);},useTransition:function(){currentHookNameInDev='useTransition';warnInvalidHookAccess();updateHookTypesDev();return rerenderTransition();},useMutableSource:function(source,getSnapshot,subscribe){currentHookNameInDev='useMutableSource';warnInvalidHookAccess();updateHookTypesDev();return updateMutableSource();},useSyncExternalStore:function(subscribe,getSnapshot,getServerSnapshot){currentHookNameInDev='useSyncExternalStore';warnInvalidHookAccess();updateHookTypesDev();return updateSyncExternalStore(subscribe,getSnapshot);},useId:function(){currentHookNameInDev='useId';warnInvalidHookAccess();updateHookTypesDev();return updateId();},unstable_isNewReconciler:enableNewReconciler};}var now$1=Scheduler.unstable_now;var commitTime=0;var layoutEffectStartTime=-1;var profilerStartTime=-1;var passiveEffectStartTime=-1;/**
|
|
11132
|
-
|
|
11133
|
-
|
|
11134
|
-
|
|
11135
|
-
|
|
11136
|
-
|
|
11137
|
-
|
|
11138
|
-
|
|
11139
|
-
|
|
11140
|
-
|
|
11141
|
-
|
|
11142
|
-
|
|
11143
|
-
|
|
11144
|
-
|
|
11145
|
-
|
|
11146
|
-
|
|
11400
|
+
markRootEntangled(root,newQueueLanes);}}function markUpdateInDevTools(fiber,lane,action){{markStateUpdateScheduled(fiber,lane);}}var ContextOnlyDispatcher={readContext:readContext,useCallback:throwInvalidHookError,useContext:throwInvalidHookError,useEffect:throwInvalidHookError,useImperativeHandle:throwInvalidHookError,useInsertionEffect:throwInvalidHookError,useLayoutEffect:throwInvalidHookError,useMemo:throwInvalidHookError,useReducer:throwInvalidHookError,useRef:throwInvalidHookError,useState:throwInvalidHookError,useDebugValue:throwInvalidHookError,useDeferredValue:throwInvalidHookError,useTransition:throwInvalidHookError,useMutableSource:throwInvalidHookError,useSyncExternalStore:throwInvalidHookError,useId:throwInvalidHookError,unstable_isNewReconciler:enableNewReconciler};var HooksDispatcherOnMountInDEV=null;var HooksDispatcherOnMountWithHookTypesInDEV=null;var HooksDispatcherOnUpdateInDEV=null;var HooksDispatcherOnRerenderInDEV=null;var InvalidNestedHooksDispatcherOnMountInDEV=null;var InvalidNestedHooksDispatcherOnUpdateInDEV=null;var InvalidNestedHooksDispatcherOnRerenderInDEV=null;{var warnInvalidContextAccess=function(){error('Context can only be read while React is rendering. '+'In classes, you can read it in the render method or getDerivedStateFromProps. '+'In function components, you can read it directly in the function body, but not '+'inside Hooks like useReducer() or useMemo().');};var warnInvalidHookAccess=function(){error('Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. '+'You can only call Hooks at the top level of your React function. '+'For more information, see '+'https://reactjs.org/link/rules-of-hooks');};HooksDispatcherOnMountInDEV={readContext:function(context){return readContext(context);},useCallback:function(callback,deps){currentHookNameInDev='useCallback';mountHookTypesDev();checkDepsAreArrayDev(deps);return mountCallback(callback,deps);},useContext:function(context){currentHookNameInDev='useContext';mountHookTypesDev();return readContext(context);},useEffect:function(create,deps){currentHookNameInDev='useEffect';mountHookTypesDev();checkDepsAreArrayDev(deps);return mountEffect(create,deps);},useImperativeHandle:function(ref,create,deps){currentHookNameInDev='useImperativeHandle';mountHookTypesDev();checkDepsAreArrayDev(deps);return mountImperativeHandle(ref,create,deps);},useInsertionEffect:function(create,deps){currentHookNameInDev='useInsertionEffect';mountHookTypesDev();checkDepsAreArrayDev(deps);return mountInsertionEffect(create,deps);},useLayoutEffect:function(create,deps){currentHookNameInDev='useLayoutEffect';mountHookTypesDev();checkDepsAreArrayDev(deps);return mountLayoutEffect(create,deps);},useMemo:function(create,deps){currentHookNameInDev='useMemo';mountHookTypesDev();checkDepsAreArrayDev(deps);var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnMountInDEV;try{return mountMemo(create,deps);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useReducer:function(reducer,initialArg,init){currentHookNameInDev='useReducer';mountHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnMountInDEV;try{return mountReducer(reducer,initialArg,init);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useRef:function(initialValue){currentHookNameInDev='useRef';mountHookTypesDev();return mountRef(initialValue);},useState:function(initialState){currentHookNameInDev='useState';mountHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnMountInDEV;try{return mountState(initialState);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useDebugValue:function(value,formatterFn){currentHookNameInDev='useDebugValue';mountHookTypesDev();return mountDebugValue();},useDeferredValue:function(value){currentHookNameInDev='useDeferredValue';mountHookTypesDev();return mountDeferredValue(value);},useTransition:function(){currentHookNameInDev='useTransition';mountHookTypesDev();return mountTransition();},useMutableSource:function(source,getSnapshot,subscribe){currentHookNameInDev='useMutableSource';mountHookTypesDev();return mountMutableSource();},useSyncExternalStore:function(subscribe,getSnapshot,getServerSnapshot){currentHookNameInDev='useSyncExternalStore';mountHookTypesDev();return mountSyncExternalStore(subscribe,getSnapshot,getServerSnapshot);},useId:function(){currentHookNameInDev='useId';mountHookTypesDev();return mountId();},unstable_isNewReconciler:enableNewReconciler};HooksDispatcherOnMountWithHookTypesInDEV={readContext:function(context){return readContext(context);},useCallback:function(callback,deps){currentHookNameInDev='useCallback';updateHookTypesDev();return mountCallback(callback,deps);},useContext:function(context){currentHookNameInDev='useContext';updateHookTypesDev();return readContext(context);},useEffect:function(create,deps){currentHookNameInDev='useEffect';updateHookTypesDev();return mountEffect(create,deps);},useImperativeHandle:function(ref,create,deps){currentHookNameInDev='useImperativeHandle';updateHookTypesDev();return mountImperativeHandle(ref,create,deps);},useInsertionEffect:function(create,deps){currentHookNameInDev='useInsertionEffect';updateHookTypesDev();return mountInsertionEffect(create,deps);},useLayoutEffect:function(create,deps){currentHookNameInDev='useLayoutEffect';updateHookTypesDev();return mountLayoutEffect(create,deps);},useMemo:function(create,deps){currentHookNameInDev='useMemo';updateHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnMountInDEV;try{return mountMemo(create,deps);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useReducer:function(reducer,initialArg,init){currentHookNameInDev='useReducer';updateHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnMountInDEV;try{return mountReducer(reducer,initialArg,init);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useRef:function(initialValue){currentHookNameInDev='useRef';updateHookTypesDev();return mountRef(initialValue);},useState:function(initialState){currentHookNameInDev='useState';updateHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnMountInDEV;try{return mountState(initialState);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useDebugValue:function(value,formatterFn){currentHookNameInDev='useDebugValue';updateHookTypesDev();return mountDebugValue();},useDeferredValue:function(value){currentHookNameInDev='useDeferredValue';updateHookTypesDev();return mountDeferredValue(value);},useTransition:function(){currentHookNameInDev='useTransition';updateHookTypesDev();return mountTransition();},useMutableSource:function(source,getSnapshot,subscribe){currentHookNameInDev='useMutableSource';updateHookTypesDev();return mountMutableSource();},useSyncExternalStore:function(subscribe,getSnapshot,getServerSnapshot){currentHookNameInDev='useSyncExternalStore';updateHookTypesDev();return mountSyncExternalStore(subscribe,getSnapshot,getServerSnapshot);},useId:function(){currentHookNameInDev='useId';updateHookTypesDev();return mountId();},unstable_isNewReconciler:enableNewReconciler};HooksDispatcherOnUpdateInDEV={readContext:function(context){return readContext(context);},useCallback:function(callback,deps){currentHookNameInDev='useCallback';updateHookTypesDev();return updateCallback(callback,deps);},useContext:function(context){currentHookNameInDev='useContext';updateHookTypesDev();return readContext(context);},useEffect:function(create,deps){currentHookNameInDev='useEffect';updateHookTypesDev();return updateEffect(create,deps);},useImperativeHandle:function(ref,create,deps){currentHookNameInDev='useImperativeHandle';updateHookTypesDev();return updateImperativeHandle(ref,create,deps);},useInsertionEffect:function(create,deps){currentHookNameInDev='useInsertionEffect';updateHookTypesDev();return updateInsertionEffect(create,deps);},useLayoutEffect:function(create,deps){currentHookNameInDev='useLayoutEffect';updateHookTypesDev();return updateLayoutEffect(create,deps);},useMemo:function(create,deps){currentHookNameInDev='useMemo';updateHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnUpdateInDEV;try{return updateMemo(create,deps);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useReducer:function(reducer,initialArg,init){currentHookNameInDev='useReducer';updateHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnUpdateInDEV;try{return updateReducer(reducer,initialArg,init);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useRef:function(initialValue){currentHookNameInDev='useRef';updateHookTypesDev();return updateRef();},useState:function(initialState){currentHookNameInDev='useState';updateHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnUpdateInDEV;try{return updateState(initialState);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useDebugValue:function(value,formatterFn){currentHookNameInDev='useDebugValue';updateHookTypesDev();return updateDebugValue();},useDeferredValue:function(value){currentHookNameInDev='useDeferredValue';updateHookTypesDev();return updateDeferredValue(value);},useTransition:function(){currentHookNameInDev='useTransition';updateHookTypesDev();return updateTransition();},useMutableSource:function(source,getSnapshot,subscribe){currentHookNameInDev='useMutableSource';updateHookTypesDev();return updateMutableSource();},useSyncExternalStore:function(subscribe,getSnapshot,getServerSnapshot){currentHookNameInDev='useSyncExternalStore';updateHookTypesDev();return updateSyncExternalStore(subscribe,getSnapshot);},useId:function(){currentHookNameInDev='useId';updateHookTypesDev();return updateId();},unstable_isNewReconciler:enableNewReconciler};HooksDispatcherOnRerenderInDEV={readContext:function(context){return readContext(context);},useCallback:function(callback,deps){currentHookNameInDev='useCallback';updateHookTypesDev();return updateCallback(callback,deps);},useContext:function(context){currentHookNameInDev='useContext';updateHookTypesDev();return readContext(context);},useEffect:function(create,deps){currentHookNameInDev='useEffect';updateHookTypesDev();return updateEffect(create,deps);},useImperativeHandle:function(ref,create,deps){currentHookNameInDev='useImperativeHandle';updateHookTypesDev();return updateImperativeHandle(ref,create,deps);},useInsertionEffect:function(create,deps){currentHookNameInDev='useInsertionEffect';updateHookTypesDev();return updateInsertionEffect(create,deps);},useLayoutEffect:function(create,deps){currentHookNameInDev='useLayoutEffect';updateHookTypesDev();return updateLayoutEffect(create,deps);},useMemo:function(create,deps){currentHookNameInDev='useMemo';updateHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnRerenderInDEV;try{return updateMemo(create,deps);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useReducer:function(reducer,initialArg,init){currentHookNameInDev='useReducer';updateHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnRerenderInDEV;try{return rerenderReducer(reducer,initialArg,init);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useRef:function(initialValue){currentHookNameInDev='useRef';updateHookTypesDev();return updateRef();},useState:function(initialState){currentHookNameInDev='useState';updateHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnRerenderInDEV;try{return rerenderState(initialState);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useDebugValue:function(value,formatterFn){currentHookNameInDev='useDebugValue';updateHookTypesDev();return updateDebugValue();},useDeferredValue:function(value){currentHookNameInDev='useDeferredValue';updateHookTypesDev();return rerenderDeferredValue(value);},useTransition:function(){currentHookNameInDev='useTransition';updateHookTypesDev();return rerenderTransition();},useMutableSource:function(source,getSnapshot,subscribe){currentHookNameInDev='useMutableSource';updateHookTypesDev();return updateMutableSource();},useSyncExternalStore:function(subscribe,getSnapshot,getServerSnapshot){currentHookNameInDev='useSyncExternalStore';updateHookTypesDev();return updateSyncExternalStore(subscribe,getSnapshot);},useId:function(){currentHookNameInDev='useId';updateHookTypesDev();return updateId();},unstable_isNewReconciler:enableNewReconciler};InvalidNestedHooksDispatcherOnMountInDEV={readContext:function(context){warnInvalidContextAccess();return readContext(context);},useCallback:function(callback,deps){currentHookNameInDev='useCallback';warnInvalidHookAccess();mountHookTypesDev();return mountCallback(callback,deps);},useContext:function(context){currentHookNameInDev='useContext';warnInvalidHookAccess();mountHookTypesDev();return readContext(context);},useEffect:function(create,deps){currentHookNameInDev='useEffect';warnInvalidHookAccess();mountHookTypesDev();return mountEffect(create,deps);},useImperativeHandle:function(ref,create,deps){currentHookNameInDev='useImperativeHandle';warnInvalidHookAccess();mountHookTypesDev();return mountImperativeHandle(ref,create,deps);},useInsertionEffect:function(create,deps){currentHookNameInDev='useInsertionEffect';warnInvalidHookAccess();mountHookTypesDev();return mountInsertionEffect(create,deps);},useLayoutEffect:function(create,deps){currentHookNameInDev='useLayoutEffect';warnInvalidHookAccess();mountHookTypesDev();return mountLayoutEffect(create,deps);},useMemo:function(create,deps){currentHookNameInDev='useMemo';warnInvalidHookAccess();mountHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnMountInDEV;try{return mountMemo(create,deps);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useReducer:function(reducer,initialArg,init){currentHookNameInDev='useReducer';warnInvalidHookAccess();mountHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnMountInDEV;try{return mountReducer(reducer,initialArg,init);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useRef:function(initialValue){currentHookNameInDev='useRef';warnInvalidHookAccess();mountHookTypesDev();return mountRef(initialValue);},useState:function(initialState){currentHookNameInDev='useState';warnInvalidHookAccess();mountHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnMountInDEV;try{return mountState(initialState);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useDebugValue:function(value,formatterFn){currentHookNameInDev='useDebugValue';warnInvalidHookAccess();mountHookTypesDev();return mountDebugValue();},useDeferredValue:function(value){currentHookNameInDev='useDeferredValue';warnInvalidHookAccess();mountHookTypesDev();return mountDeferredValue(value);},useTransition:function(){currentHookNameInDev='useTransition';warnInvalidHookAccess();mountHookTypesDev();return mountTransition();},useMutableSource:function(source,getSnapshot,subscribe){currentHookNameInDev='useMutableSource';warnInvalidHookAccess();mountHookTypesDev();return mountMutableSource();},useSyncExternalStore:function(subscribe,getSnapshot,getServerSnapshot){currentHookNameInDev='useSyncExternalStore';warnInvalidHookAccess();mountHookTypesDev();return mountSyncExternalStore(subscribe,getSnapshot,getServerSnapshot);},useId:function(){currentHookNameInDev='useId';warnInvalidHookAccess();mountHookTypesDev();return mountId();},unstable_isNewReconciler:enableNewReconciler};InvalidNestedHooksDispatcherOnUpdateInDEV={readContext:function(context){warnInvalidContextAccess();return readContext(context);},useCallback:function(callback,deps){currentHookNameInDev='useCallback';warnInvalidHookAccess();updateHookTypesDev();return updateCallback(callback,deps);},useContext:function(context){currentHookNameInDev='useContext';warnInvalidHookAccess();updateHookTypesDev();return readContext(context);},useEffect:function(create,deps){currentHookNameInDev='useEffect';warnInvalidHookAccess();updateHookTypesDev();return updateEffect(create,deps);},useImperativeHandle:function(ref,create,deps){currentHookNameInDev='useImperativeHandle';warnInvalidHookAccess();updateHookTypesDev();return updateImperativeHandle(ref,create,deps);},useInsertionEffect:function(create,deps){currentHookNameInDev='useInsertionEffect';warnInvalidHookAccess();updateHookTypesDev();return updateInsertionEffect(create,deps);},useLayoutEffect:function(create,deps){currentHookNameInDev='useLayoutEffect';warnInvalidHookAccess();updateHookTypesDev();return updateLayoutEffect(create,deps);},useMemo:function(create,deps){currentHookNameInDev='useMemo';warnInvalidHookAccess();updateHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnUpdateInDEV;try{return updateMemo(create,deps);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useReducer:function(reducer,initialArg,init){currentHookNameInDev='useReducer';warnInvalidHookAccess();updateHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnUpdateInDEV;try{return updateReducer(reducer,initialArg,init);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useRef:function(initialValue){currentHookNameInDev='useRef';warnInvalidHookAccess();updateHookTypesDev();return updateRef();},useState:function(initialState){currentHookNameInDev='useState';warnInvalidHookAccess();updateHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnUpdateInDEV;try{return updateState(initialState);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useDebugValue:function(value,formatterFn){currentHookNameInDev='useDebugValue';warnInvalidHookAccess();updateHookTypesDev();return updateDebugValue();},useDeferredValue:function(value){currentHookNameInDev='useDeferredValue';warnInvalidHookAccess();updateHookTypesDev();return updateDeferredValue(value);},useTransition:function(){currentHookNameInDev='useTransition';warnInvalidHookAccess();updateHookTypesDev();return updateTransition();},useMutableSource:function(source,getSnapshot,subscribe){currentHookNameInDev='useMutableSource';warnInvalidHookAccess();updateHookTypesDev();return updateMutableSource();},useSyncExternalStore:function(subscribe,getSnapshot,getServerSnapshot){currentHookNameInDev='useSyncExternalStore';warnInvalidHookAccess();updateHookTypesDev();return updateSyncExternalStore(subscribe,getSnapshot);},useId:function(){currentHookNameInDev='useId';warnInvalidHookAccess();updateHookTypesDev();return updateId();},unstable_isNewReconciler:enableNewReconciler};InvalidNestedHooksDispatcherOnRerenderInDEV={readContext:function(context){warnInvalidContextAccess();return readContext(context);},useCallback:function(callback,deps){currentHookNameInDev='useCallback';warnInvalidHookAccess();updateHookTypesDev();return updateCallback(callback,deps);},useContext:function(context){currentHookNameInDev='useContext';warnInvalidHookAccess();updateHookTypesDev();return readContext(context);},useEffect:function(create,deps){currentHookNameInDev='useEffect';warnInvalidHookAccess();updateHookTypesDev();return updateEffect(create,deps);},useImperativeHandle:function(ref,create,deps){currentHookNameInDev='useImperativeHandle';warnInvalidHookAccess();updateHookTypesDev();return updateImperativeHandle(ref,create,deps);},useInsertionEffect:function(create,deps){currentHookNameInDev='useInsertionEffect';warnInvalidHookAccess();updateHookTypesDev();return updateInsertionEffect(create,deps);},useLayoutEffect:function(create,deps){currentHookNameInDev='useLayoutEffect';warnInvalidHookAccess();updateHookTypesDev();return updateLayoutEffect(create,deps);},useMemo:function(create,deps){currentHookNameInDev='useMemo';warnInvalidHookAccess();updateHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnUpdateInDEV;try{return updateMemo(create,deps);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useReducer:function(reducer,initialArg,init){currentHookNameInDev='useReducer';warnInvalidHookAccess();updateHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnUpdateInDEV;try{return rerenderReducer(reducer,initialArg,init);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useRef:function(initialValue){currentHookNameInDev='useRef';warnInvalidHookAccess();updateHookTypesDev();return updateRef();},useState:function(initialState){currentHookNameInDev='useState';warnInvalidHookAccess();updateHookTypesDev();var prevDispatcher=ReactCurrentDispatcher$1.current;ReactCurrentDispatcher$1.current=InvalidNestedHooksDispatcherOnUpdateInDEV;try{return rerenderState(initialState);}finally{ReactCurrentDispatcher$1.current=prevDispatcher;}},useDebugValue:function(value,formatterFn){currentHookNameInDev='useDebugValue';warnInvalidHookAccess();updateHookTypesDev();return updateDebugValue();},useDeferredValue:function(value){currentHookNameInDev='useDeferredValue';warnInvalidHookAccess();updateHookTypesDev();return rerenderDeferredValue(value);},useTransition:function(){currentHookNameInDev='useTransition';warnInvalidHookAccess();updateHookTypesDev();return rerenderTransition();},useMutableSource:function(source,getSnapshot,subscribe){currentHookNameInDev='useMutableSource';warnInvalidHookAccess();updateHookTypesDev();return updateMutableSource();},useSyncExternalStore:function(subscribe,getSnapshot,getServerSnapshot){currentHookNameInDev='useSyncExternalStore';warnInvalidHookAccess();updateHookTypesDev();return updateSyncExternalStore(subscribe,getSnapshot);},useId:function(){currentHookNameInDev='useId';warnInvalidHookAccess();updateHookTypesDev();return updateId();},unstable_isNewReconciler:enableNewReconciler};}var now$1=Scheduler.unstable_now;var commitTime=0;var layoutEffectStartTime=-1;var profilerStartTime=-1;var passiveEffectStartTime=-1;/**
|
|
11401
|
+
* Tracks whether the current update was a nested/cascading update (scheduled from a layout effect).
|
|
11402
|
+
*
|
|
11403
|
+
* The overall sequence is:
|
|
11404
|
+
* 1. render
|
|
11405
|
+
* 2. commit (and call `onRender`, `onCommit`)
|
|
11406
|
+
* 3. check for nested updates
|
|
11407
|
+
* 4. flush passive effects (and call `onPostCommit`)
|
|
11408
|
+
*
|
|
11409
|
+
* Nested updates are identified in step 3 above,
|
|
11410
|
+
* but step 4 still applies to the work that was just committed.
|
|
11411
|
+
* We use two flags to track nested updates then:
|
|
11412
|
+
* one tracks whether the upcoming update is a nested update,
|
|
11413
|
+
* and the other tracks whether the current update was a nested update.
|
|
11414
|
+
* The first value gets synced to the second at the start of the render phase.
|
|
11415
|
+
*/var currentUpdateIsNested=false;var nestedUpdateScheduled=false;function isCurrentUpdateNested(){return currentUpdateIsNested;}function markNestedUpdateScheduled(){{nestedUpdateScheduled=true;}}function resetNestedUpdateFlag(){{currentUpdateIsNested=false;nestedUpdateScheduled=false;}}function syncNestedUpdateFlag(){{currentUpdateIsNested=nestedUpdateScheduled;nestedUpdateScheduled=false;}}function getCommitTime(){return commitTime;}function recordCommitTime(){commitTime=now$1();}function startProfilerTimer(fiber){profilerStartTime=now$1();if(fiber.actualStartTime<0){fiber.actualStartTime=now$1();}}function stopProfilerTimerIfRunning(fiber){profilerStartTime=-1;}function stopProfilerTimerIfRunningAndRecordDelta(fiber,overrideBaseTime){if(profilerStartTime>=0){var elapsedTime=now$1()-profilerStartTime;fiber.actualDuration+=elapsedTime;if(overrideBaseTime){fiber.selfBaseDuration=elapsedTime;}profilerStartTime=-1;}}function recordLayoutEffectDuration(fiber){if(layoutEffectStartTime>=0){var elapsedTime=now$1()-layoutEffectStartTime;layoutEffectStartTime=-1;// Store duration on the next nearest Profiler ancestor
|
|
11147
11416
|
// Or the root (for the DevTools Profiler to read)
|
|
11148
11417
|
var parentFiber=fiber.return;while(parentFiber!==null){switch(parentFiber.tag){case HostRoot:var root=parentFiber.stateNode;root.effectDuration+=elapsedTime;return;case Profiler:var parentStateNode=parentFiber.stateNode;parentStateNode.effectDuration+=elapsedTime;return;}parentFiber=parentFiber.return;}}}function recordPassiveEffectDuration(fiber){if(passiveEffectStartTime>=0){var elapsedTime=now$1()-passiveEffectStartTime;passiveEffectStartTime=-1;// Store duration on the next nearest Profiler ancestor
|
|
11149
11418
|
// Or the root (for the DevTools Profiler to read)
|
|
@@ -11925,8 +12194,7 @@ var _resolvedProps3=resolveDefaultProps(_type2,_unresolvedProps3);{if(workInProg
|
|
|
11925
12194
|
workInProgress.flags|=Update;}function markRef$1(workInProgress){workInProgress.flags|=Ref;{workInProgress.flags|=RefStatic;}}var appendAllChildren;var updateHostContainer;var updateHostComponent$1;var updateHostText$1;{// Mutation mode
|
|
11926
12195
|
appendAllChildren=function(parent,workInProgress,needsVisibilityToggle,isHidden){// We only have the top Fiber that was created but we need recurse down its
|
|
11927
12196
|
// children to find all the terminal nodes.
|
|
11928
|
-
var node=workInProgress.child;while(node!==null){if(node.tag===HostComponent||node.tag===HostText){appendInitialChild(parent,node.stateNode);}else if(node.tag===HostPortal);else if(node.child!==null){node.child.return=node;node=node.child;continue;}if(node===workInProgress){return;}while(node.sibling===null){if(node.return===null||node.return===workInProgress){return;}node=node.return;}node.sibling.return=node.return;node=node.sibling;}};updateHostContainer=function(current,workInProgress){//
|
|
11929
|
-
};updateHostComponent$1=function(current,workInProgress,type,newProps,rootContainerInstance){// If we have an alternate, that means this is an update and we need to
|
|
12197
|
+
var node=workInProgress.child;while(node!==null){if(node.tag===HostComponent||node.tag===HostText){appendInitialChild(parent,node.stateNode);}else if(node.tag===HostPortal);else if(node.child!==null){node.child.return=node;node=node.child;continue;}if(node===workInProgress){return;}while(node.sibling===null){if(node.return===null||node.return===workInProgress){return;}node=node.return;}node.sibling.return=node.return;node=node.sibling;}};updateHostContainer=function(current,workInProgress){};updateHostComponent$1=function(current,workInProgress,type,newProps,rootContainerInstance){// If we have an alternate, that means this is an update and we need to
|
|
11930
12198
|
// schedule a side-effect to do the updates.
|
|
11931
12199
|
var oldProps=current.memoizedProps;if(oldProps===newProps){// In mutation mode, this is sufficient for a bailout because
|
|
11932
12200
|
// we won't touch this node even if children changed.
|
|
@@ -13201,8 +13469,7 @@ var hydrationCallbacks=options!=null?options:null;// TODO: Delete this option
|
|
|
13201
13469
|
var mutableSources=options!=null&&options.hydratedSources||null;var isStrictMode=false;var concurrentUpdatesByDefaultOverride=false;var identifierPrefix='';var onRecoverableError=defaultOnRecoverableError;if(options!==null&&options!==undefined){if(options.unstable_strictMode===true){isStrictMode=true;}if(options.identifierPrefix!==undefined){identifierPrefix=options.identifierPrefix;}if(options.onRecoverableError!==undefined){onRecoverableError=options.onRecoverableError;}}var root=createHydrationContainer(initialChildren,null,container,ConcurrentRoot,hydrationCallbacks,isStrictMode,concurrentUpdatesByDefaultOverride,identifierPrefix,onRecoverableError);markContainerAsRoot(root.current,container);// This can't be a comment node since hydration doesn't work on comment nodes anyway.
|
|
13202
13470
|
listenToAllSupportedEvents(container);if(mutableSources){for(var i=0;i<mutableSources.length;i++){var mutableSource=mutableSources[i];registerMutableSourceForHydration(root,mutableSource);}}return new ReactDOMHydrationRoot(root);}function isValidContainer(node){return !!(node&&(node.nodeType===ELEMENT_NODE||node.nodeType===DOCUMENT_NODE||node.nodeType===DOCUMENT_FRAGMENT_NODE||!disableCommentsAsDOMContainers));}// TODO: Remove this function which also includes comment nodes.
|
|
13203
13471
|
// We only use it in places that are currently more relaxed.
|
|
13204
|
-
function isValidContainerLegacy(node){return !!(node&&(node.nodeType===ELEMENT_NODE||node.nodeType===DOCUMENT_NODE||node.nodeType===DOCUMENT_FRAGMENT_NODE||node.nodeType===COMMENT_NODE&&node.nodeValue===' react-mount-point-unstable '));}function warnIfReactDOMContainerInDEV(container){{if(container.nodeType===ELEMENT_NODE&&container.tagName&&container.tagName.toUpperCase()==='BODY'){error('createRoot(): Creating roots directly with document.body is '+'discouraged, since its children are often manipulated by third-party '+'scripts and browser extensions. This may lead to subtle '+'reconciliation issues. Try using a container element created '+'for your app.');}if(isContainerMarkedAsRoot(container)){if(container._reactRootContainer){error('You are calling ReactDOMClient.createRoot() on a container that was previously '+'passed to ReactDOM.render(). This is not supported.');}else {error('You are calling ReactDOMClient.createRoot() on a container that '+'has already been passed to createRoot() before. Instead, call '+'root.render() on the existing root instead if you want to update it.');}}}}var ReactCurrentOwner$3=ReactSharedInternals.ReactCurrentOwner;var topLevelUpdateWarnings;{topLevelUpdateWarnings=function(container){if(container._reactRootContainer&&container.nodeType!==COMMENT_NODE){var hostInstance=findHostInstanceWithNoPortals(container._reactRootContainer.current);if(hostInstance){if(hostInstance.parentNode!==container){error('render(...): It looks like the React-rendered content of this '+'container was removed without using React. This is not '+'supported and will cause errors. Instead, call '+'ReactDOM.unmountComponentAtNode to empty a container.');}}}var isRootRenderedBySomeReact=!!container._reactRootContainer;var rootEl=getReactRootElementInContainer(container);var hasNonRootReactChild=!!(rootEl&&getInstanceFromNode(rootEl));if(hasNonRootReactChild&&!isRootRenderedBySomeReact){error('render(...): Replacing React-rendered children with a new root '+'component. If you intended to update the children of this node, '+'you should instead have the existing children update their state '+'and render the new components instead of calling ReactDOM.render.');}if(container.nodeType===ELEMENT_NODE&&container.tagName&&container.tagName.toUpperCase()==='BODY'){error('render(): Rendering components directly into document.body is '+'discouraged, since its children are often manipulated by third-party '+'scripts and browser extensions. This may lead to subtle '+'reconciliation issues. Try rendering into a container element created '+'for your app.');}};}function getReactRootElementInContainer(container){if(!container){return null;}if(container.nodeType===DOCUMENT_NODE){return container.documentElement;}else {return container.firstChild;}}function noopOnRecoverableError(){//
|
|
13205
|
-
// legacy API.
|
|
13472
|
+
function isValidContainerLegacy(node){return !!(node&&(node.nodeType===ELEMENT_NODE||node.nodeType===DOCUMENT_NODE||node.nodeType===DOCUMENT_FRAGMENT_NODE||node.nodeType===COMMENT_NODE&&node.nodeValue===' react-mount-point-unstable '));}function warnIfReactDOMContainerInDEV(container){{if(container.nodeType===ELEMENT_NODE&&container.tagName&&container.tagName.toUpperCase()==='BODY'){error('createRoot(): Creating roots directly with document.body is '+'discouraged, since its children are often manipulated by third-party '+'scripts and browser extensions. This may lead to subtle '+'reconciliation issues. Try using a container element created '+'for your app.');}if(isContainerMarkedAsRoot(container)){if(container._reactRootContainer){error('You are calling ReactDOMClient.createRoot() on a container that was previously '+'passed to ReactDOM.render(). This is not supported.');}else {error('You are calling ReactDOMClient.createRoot() on a container that '+'has already been passed to createRoot() before. Instead, call '+'root.render() on the existing root instead if you want to update it.');}}}}var ReactCurrentOwner$3=ReactSharedInternals.ReactCurrentOwner;var topLevelUpdateWarnings;{topLevelUpdateWarnings=function(container){if(container._reactRootContainer&&container.nodeType!==COMMENT_NODE){var hostInstance=findHostInstanceWithNoPortals(container._reactRootContainer.current);if(hostInstance){if(hostInstance.parentNode!==container){error('render(...): It looks like the React-rendered content of this '+'container was removed without using React. This is not '+'supported and will cause errors. Instead, call '+'ReactDOM.unmountComponentAtNode to empty a container.');}}}var isRootRenderedBySomeReact=!!container._reactRootContainer;var rootEl=getReactRootElementInContainer(container);var hasNonRootReactChild=!!(rootEl&&getInstanceFromNode(rootEl));if(hasNonRootReactChild&&!isRootRenderedBySomeReact){error('render(...): Replacing React-rendered children with a new root '+'component. If you intended to update the children of this node, '+'you should instead have the existing children update their state '+'and render the new components instead of calling ReactDOM.render.');}if(container.nodeType===ELEMENT_NODE&&container.tagName&&container.tagName.toUpperCase()==='BODY'){error('render(): Rendering components directly into document.body is '+'discouraged, since its children are often manipulated by third-party '+'scripts and browser extensions. This may lead to subtle '+'reconciliation issues. Try rendering into a container element created '+'for your app.');}};}function getReactRootElementInContainer(container){if(!container){return null;}if(container.nodeType===DOCUMENT_NODE){return container.documentElement;}else {return container.firstChild;}}function noopOnRecoverableError(){// legacy API.
|
|
13206
13473
|
}function legacyCreateRootFromDOMContainer(container,initialChildren,parentComponent,callback,isHydrationContainer){if(isHydrationContainer){if(typeof callback==='function'){var originalCallback=callback;callback=function(){var instance=getPublicRootInstance(root);originalCallback.call(instance);};}var root=createHydrationContainer(initialChildren,callback,container,LegacyRoot,null,// hydrationCallbacks
|
|
13207
13474
|
false,// isStrictMode
|
|
13208
13475
|
false,// concurrentUpdatesByDefaultOverride,
|
|
@@ -13295,32 +13562,42 @@ var DEFAULT_SHEET_OPTIONS = {
|
|
|
13295
13562
|
className: '',
|
|
13296
13563
|
confirmBeforeClose: false,
|
|
13297
13564
|
confirmMessage: 'Are you sure you want to close?',
|
|
13298
|
-
confirmCallback: function (
|
|
13299
|
-
|
|
13300
|
-
return
|
|
13301
|
-
|
|
13302
|
-
|
|
13303
|
-
|
|
13304
|
-
|
|
13565
|
+
confirmCallback: function () {
|
|
13566
|
+
var _confirmCallback = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(msg) {
|
|
13567
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
13568
|
+
while (1) switch (_context.prev = _context.next) {
|
|
13569
|
+
case 0:
|
|
13570
|
+
return _context.abrupt("return", typeof window !== 'undefined' ? Promise.resolve(window.confirm(msg)) : Promise.resolve(true));
|
|
13571
|
+
case 1:
|
|
13572
|
+
case "end":
|
|
13573
|
+
return _context.stop();
|
|
13574
|
+
}
|
|
13575
|
+
}, _callee);
|
|
13576
|
+
}));
|
|
13577
|
+
function confirmCallback(_x) {
|
|
13578
|
+
return _confirmCallback.apply(this, arguments);
|
|
13579
|
+
}
|
|
13580
|
+
return confirmCallback;
|
|
13581
|
+
}(),
|
|
13305
13582
|
closeOnOverlayClick: true,
|
|
13306
13583
|
closeOnEsc: true,
|
|
13307
13584
|
animationDuration: 240,
|
|
13308
|
-
onOpen: function () {},
|
|
13309
|
-
onClose: function () {}
|
|
13585
|
+
onOpen: function onOpen() {},
|
|
13586
|
+
onClose: function onClose() {}
|
|
13310
13587
|
};
|
|
13311
13588
|
|
|
13312
|
-
var SideSheetContainer = function (
|
|
13313
|
-
var stack =
|
|
13314
|
-
open =
|
|
13315
|
-
close =
|
|
13316
|
-
update =
|
|
13317
|
-
config =
|
|
13589
|
+
var SideSheetContainer = function SideSheetContainer(_ref) {
|
|
13590
|
+
var stack = _ref.stack,
|
|
13591
|
+
open = _ref.open,
|
|
13592
|
+
close = _ref.close,
|
|
13593
|
+
update = _ref.update,
|
|
13594
|
+
config = _ref.config;
|
|
13318
13595
|
React.useEffect(function () {
|
|
13319
|
-
var onKeyDown = function (e) {
|
|
13596
|
+
var onKeyDown = function onKeyDown(e) {
|
|
13320
13597
|
if (e.key === 'Escape') {
|
|
13321
|
-
var
|
|
13322
|
-
if (
|
|
13323
|
-
close(
|
|
13598
|
+
var top = stack[stack.length - 1];
|
|
13599
|
+
if (top !== null && top !== void 0 && top.options.closeOnEsc && top.state === 'open') {
|
|
13600
|
+
close(top.id);
|
|
13324
13601
|
}
|
|
13325
13602
|
}
|
|
13326
13603
|
};
|
|
@@ -13329,33 +13606,33 @@ var SideSheetContainer = function (_a) {
|
|
|
13329
13606
|
document.removeEventListener('keydown', onKeyDown);
|
|
13330
13607
|
};
|
|
13331
13608
|
}, [stack, close]);
|
|
13332
|
-
return React__default.createElement(React__default.Fragment, null, stack.map(function (item, idx) {
|
|
13333
|
-
var
|
|
13609
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, stack.map(function (item, idx) {
|
|
13610
|
+
var _stack;
|
|
13334
13611
|
var isTop = idx === stack.length - 1;
|
|
13335
|
-
var isPrevClosing = ((
|
|
13336
|
-
var
|
|
13337
|
-
width =
|
|
13338
|
-
closeOnOverlayClick =
|
|
13339
|
-
className =
|
|
13612
|
+
var isPrevClosing = ((_stack = stack[idx - 1]) === null || _stack === void 0 ? void 0 : _stack.state) === 'closing';
|
|
13613
|
+
var _item$options = item.options,
|
|
13614
|
+
width = _item$options.width,
|
|
13615
|
+
closeOnOverlayClick = _item$options.closeOnOverlayClick,
|
|
13616
|
+
className = _item$options.className;
|
|
13340
13617
|
if (config.mountStrategy === 'top-only' && !isTop && !isPrevClosing) return null;
|
|
13341
|
-
return React__default.createElement(React__default.Fragment, {
|
|
13618
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
13342
13619
|
key: item.id
|
|
13343
|
-
}, React__default.createElement("div", {
|
|
13620
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
13344
13621
|
className: "sidesheet-overlay",
|
|
13345
|
-
onClick: function () {
|
|
13622
|
+
onClick: function onClick() {
|
|
13346
13623
|
if (closeOnOverlayClick && item.state === 'open') {
|
|
13347
13624
|
close(item.id);
|
|
13348
13625
|
}
|
|
13349
13626
|
}
|
|
13350
|
-
}), React__default.createElement("div", {
|
|
13627
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
13351
13628
|
role: "dialog",
|
|
13352
13629
|
"aria-modal": "true",
|
|
13353
|
-
className: classnames('sidesheet', "sidesheet-animation-"
|
|
13630
|
+
className: classnames('sidesheet', "sidesheet-animation-".concat(item.state), {
|
|
13354
13631
|
'sidesheet-left': config.side === 'left',
|
|
13355
13632
|
'sidesheet-right': config.side === 'right'
|
|
13356
13633
|
}, className),
|
|
13357
13634
|
style: {
|
|
13358
|
-
width: ""
|
|
13635
|
+
width: "".concat(isTop || isPrevClosing ? "".concat(width, "px") : '100%')
|
|
13359
13636
|
}
|
|
13360
13637
|
}, item.element({
|
|
13361
13638
|
sideId: item.id,
|
|
@@ -13367,19 +13644,19 @@ var SideSheetContainer = function (_a) {
|
|
|
13367
13644
|
}));
|
|
13368
13645
|
};
|
|
13369
13646
|
|
|
13370
|
-
var SideSheetReducer = function (state, action) {
|
|
13647
|
+
var SideSheetReducer = function SideSheetReducer(state, action) {
|
|
13371
13648
|
switch (action.type) {
|
|
13372
13649
|
case 'OPEN':
|
|
13373
|
-
return
|
|
13650
|
+
return [].concat(_toConsumableArray(state), [action.payload]);
|
|
13374
13651
|
case 'SET_OPEN':
|
|
13375
13652
|
return state.map(function (item) {
|
|
13376
|
-
return item.id === action.id ?
|
|
13653
|
+
return item.id === action.id ? _objectSpread2(_objectSpread2({}, item), {}, {
|
|
13377
13654
|
state: 'open'
|
|
13378
13655
|
}) : item;
|
|
13379
13656
|
});
|
|
13380
13657
|
case 'CLOSE':
|
|
13381
13658
|
return state.map(function (item) {
|
|
13382
|
-
return action.id === null || item.id === action.id ?
|
|
13659
|
+
return action.id === null || item.id === action.id ? _objectSpread2(_objectSpread2({}, item), {}, {
|
|
13383
13660
|
state: 'closing'
|
|
13384
13661
|
}) : item;
|
|
13385
13662
|
});
|
|
@@ -13389,8 +13666,8 @@ var SideSheetReducer = function (state, action) {
|
|
|
13389
13666
|
});
|
|
13390
13667
|
case 'UPDATE':
|
|
13391
13668
|
return state.map(function (item) {
|
|
13392
|
-
return item.id === action.id ?
|
|
13393
|
-
options:
|
|
13669
|
+
return item.id === action.id ? _objectSpread2(_objectSpread2({}, item), {}, {
|
|
13670
|
+
options: _objectSpread2(_objectSpread2({}, item.options), action.options)
|
|
13394
13671
|
}) : item;
|
|
13395
13672
|
});
|
|
13396
13673
|
default:
|
|
@@ -13398,24 +13675,23 @@ var SideSheetReducer = function (state, action) {
|
|
|
13398
13675
|
}
|
|
13399
13676
|
};
|
|
13400
13677
|
|
|
13401
|
-
var SideSheetContext = React.createContext(null);
|
|
13402
|
-
var SideSheetProvider = function (
|
|
13403
|
-
var children =
|
|
13404
|
-
configuration =
|
|
13405
|
-
var
|
|
13406
|
-
|
|
13407
|
-
|
|
13678
|
+
var SideSheetContext = /*#__PURE__*/React.createContext(null);
|
|
13679
|
+
var SideSheetProvider = function SideSheetProvider(_ref) {
|
|
13680
|
+
var children = _ref.children,
|
|
13681
|
+
configuration = _ref.configuration;
|
|
13682
|
+
var _useReducer = React.useReducer(SideSheetReducer, []),
|
|
13683
|
+
_useReducer2 = _slicedToArray(_useReducer, 2),
|
|
13684
|
+
stack = _useReducer2[0],
|
|
13685
|
+
dispatch = _useReducer2[1];
|
|
13408
13686
|
var idRef = React.useRef(0);
|
|
13409
13687
|
var stackRef = React.useRef(stack);
|
|
13410
13688
|
React.useEffect(function () {
|
|
13411
13689
|
stackRef.current = stack;
|
|
13412
13690
|
}, [stack]);
|
|
13413
|
-
var open = React.useCallback(function (element
|
|
13414
|
-
|
|
13415
|
-
opts = {};
|
|
13416
|
-
}
|
|
13691
|
+
var open = React.useCallback(function (element) {
|
|
13692
|
+
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
13417
13693
|
var id = ++idRef.current;
|
|
13418
|
-
var options =
|
|
13694
|
+
var options = _objectSpread2(_objectSpread2({}, DEFAULT_SHEET_OPTIONS), opts);
|
|
13419
13695
|
dispatch({
|
|
13420
13696
|
type: 'OPEN',
|
|
13421
13697
|
payload: {
|
|
@@ -13426,44 +13702,65 @@ var SideSheetProvider = function (_a) {
|
|
|
13426
13702
|
}
|
|
13427
13703
|
});
|
|
13428
13704
|
setTimeout(function () {
|
|
13429
|
-
var
|
|
13705
|
+
var _options$onOpen;
|
|
13430
13706
|
dispatch({
|
|
13431
13707
|
type: 'SET_OPEN',
|
|
13432
13708
|
id: id
|
|
13433
13709
|
});
|
|
13434
|
-
(
|
|
13710
|
+
(_options$onOpen = options.onOpen) === null || _options$onOpen === void 0 || _options$onOpen.call(options, id);
|
|
13435
13711
|
}, options.animationDuration);
|
|
13436
13712
|
return id;
|
|
13437
13713
|
}, []);
|
|
13438
|
-
var close = React.useCallback(function (
|
|
13439
|
-
|
|
13440
|
-
var
|
|
13441
|
-
var
|
|
13442
|
-
return
|
|
13443
|
-
switch (
|
|
13714
|
+
var close = React.useCallback(/*#__PURE__*/function () {
|
|
13715
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(id) {
|
|
13716
|
+
var _itemsToClose;
|
|
13717
|
+
var itemsToClose, _iterator, _step, _item$options$onClose, _item$options, item, confirmed, duration;
|
|
13718
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
13719
|
+
while (1) switch (_context.prev = _context.next) {
|
|
13444
13720
|
case 0:
|
|
13445
|
-
itemsToClose = id === null ?
|
|
13721
|
+
itemsToClose = id === null ? _toConsumableArray(stackRef.current) : stackRef.current.filter(function (i) {
|
|
13446
13722
|
return i.id === id;
|
|
13447
13723
|
});
|
|
13448
|
-
|
|
13449
|
-
|
|
13450
|
-
|
|
13451
|
-
if (!(_i < itemsToClose_1.length)) return [3 /*break*/, 5];
|
|
13452
|
-
item = itemsToClose_1[_i];
|
|
13453
|
-
if (!item.options.confirmBeforeClose) return [3 /*break*/, 3];
|
|
13454
|
-
return [4 /*yield*/, item.options.confirmCallback(item.options.confirmMessage)];
|
|
13455
|
-
case 2:
|
|
13456
|
-
confirmed = _d.sent();
|
|
13457
|
-
if (!confirmed) return [2 /*return*/];
|
|
13458
|
-
_d.label = 3;
|
|
13459
|
-
case 3:
|
|
13460
|
-
(_b = (_a = item.options).onClose) === null || _b === void 0 ? void 0 : _b.call(_a, item.id);
|
|
13461
|
-
_d.label = 4;
|
|
13724
|
+
_iterator = _createForOfIteratorHelper(itemsToClose);
|
|
13725
|
+
_context.prev = 2;
|
|
13726
|
+
_iterator.s();
|
|
13462
13727
|
case 4:
|
|
13463
|
-
|
|
13464
|
-
|
|
13465
|
-
|
|
13466
|
-
|
|
13728
|
+
if ((_step = _iterator.n()).done) {
|
|
13729
|
+
_context.next = 15;
|
|
13730
|
+
break;
|
|
13731
|
+
}
|
|
13732
|
+
item = _step.value;
|
|
13733
|
+
if (!item.options.confirmBeforeClose) {
|
|
13734
|
+
_context.next = 12;
|
|
13735
|
+
break;
|
|
13736
|
+
}
|
|
13737
|
+
_context.next = 9;
|
|
13738
|
+
return item.options.confirmCallback(item.options.confirmMessage);
|
|
13739
|
+
case 9:
|
|
13740
|
+
confirmed = _context.sent;
|
|
13741
|
+
if (confirmed) {
|
|
13742
|
+
_context.next = 12;
|
|
13743
|
+
break;
|
|
13744
|
+
}
|
|
13745
|
+
return _context.abrupt("return");
|
|
13746
|
+
case 12:
|
|
13747
|
+
(_item$options$onClose = (_item$options = item.options).onClose) === null || _item$options$onClose === void 0 || _item$options$onClose.call(_item$options, item.id);
|
|
13748
|
+
case 13:
|
|
13749
|
+
_context.next = 4;
|
|
13750
|
+
break;
|
|
13751
|
+
case 15:
|
|
13752
|
+
_context.next = 20;
|
|
13753
|
+
break;
|
|
13754
|
+
case 17:
|
|
13755
|
+
_context.prev = 17;
|
|
13756
|
+
_context.t0 = _context["catch"](2);
|
|
13757
|
+
_iterator.e(_context.t0);
|
|
13758
|
+
case 20:
|
|
13759
|
+
_context.prev = 20;
|
|
13760
|
+
_iterator.f();
|
|
13761
|
+
return _context.finish(20);
|
|
13762
|
+
case 23:
|
|
13763
|
+
duration = (_itemsToClose = itemsToClose[itemsToClose.length - 1]) === null || _itemsToClose === void 0 ? void 0 : _itemsToClose.options.animationDuration;
|
|
13467
13764
|
dispatch({
|
|
13468
13765
|
type: 'CLOSE',
|
|
13469
13766
|
id: id
|
|
@@ -13483,11 +13780,16 @@ var SideSheetProvider = function (_a) {
|
|
|
13483
13780
|
});
|
|
13484
13781
|
}
|
|
13485
13782
|
}, duration);
|
|
13486
|
-
|
|
13783
|
+
case 26:
|
|
13784
|
+
case "end":
|
|
13785
|
+
return _context.stop();
|
|
13487
13786
|
}
|
|
13488
|
-
});
|
|
13489
|
-
});
|
|
13490
|
-
|
|
13787
|
+
}, _callee, null, [[2, 17, 20, 23]]);
|
|
13788
|
+
}));
|
|
13789
|
+
return function (_x) {
|
|
13790
|
+
return _ref2.apply(this, arguments);
|
|
13791
|
+
};
|
|
13792
|
+
}(), []);
|
|
13491
13793
|
var update = React.useCallback(function (id, options) {
|
|
13492
13794
|
dispatch({
|
|
13493
13795
|
type: 'UPDATE',
|
|
@@ -13495,15 +13797,15 @@ var SideSheetProvider = function (_a) {
|
|
|
13495
13797
|
options: options
|
|
13496
13798
|
});
|
|
13497
13799
|
}, []);
|
|
13498
|
-
var config =
|
|
13499
|
-
return React__default.createElement(SideSheetContext.Provider, {
|
|
13800
|
+
var config = _objectSpread2(_objectSpread2({}, DEFAULT_OPTIONS), configuration);
|
|
13801
|
+
return /*#__PURE__*/React__default.createElement(SideSheetContext.Provider, {
|
|
13500
13802
|
value: {
|
|
13501
13803
|
open: open,
|
|
13502
13804
|
close: close,
|
|
13503
13805
|
update: update,
|
|
13504
13806
|
config: config
|
|
13505
13807
|
}
|
|
13506
|
-
}, children, reactDom_1(React__default.createElement(SideSheetContainer, {
|
|
13808
|
+
}, children, /*#__PURE__*/reactDom_1(/*#__PURE__*/React__default.createElement(SideSheetContainer, {
|
|
13507
13809
|
stack: stack,
|
|
13508
13810
|
close: close,
|
|
13509
13811
|
open: open,
|
|
@@ -13512,7 +13814,7 @@ var SideSheetProvider = function (_a) {
|
|
|
13512
13814
|
}), document.body));
|
|
13513
13815
|
};
|
|
13514
13816
|
|
|
13515
|
-
var useSideSheet = function () {
|
|
13817
|
+
var useSideSheet = function useSideSheet() {
|
|
13516
13818
|
var context = React.useContext(SideSheetContext);
|
|
13517
13819
|
if (!context) {
|
|
13518
13820
|
throw new Error('useSideSheet must be used within SideSheetProvider');
|