@teamturing/react-kit 2.51.1 → 2.51.3

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.
@@ -1,39 +0,0 @@
1
- import { __module as reactDom } from '../../_virtual/index2.js';
2
- import { __require as requireReactDom_production_min } from './cjs/react-dom.production.min.js';
3
- import { __require as requireReactDom_development } from './cjs/react-dom.development.js';
4
-
5
- function checkDCE() {
6
- /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
7
- if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function') {
8
- return;
9
- }
10
- if (process.env.NODE_ENV !== 'production') {
11
- // This branch is unreachable because this function is only called
12
- // in production, but the condition is true only in development.
13
- // Therefore if the branch is still here, dead code elimination wasn't
14
- // properly applied.
15
- // Don't change the message. React DevTools relies on it. Also make sure
16
- // this message doesn't occur elsewhere in this function, or it will cause
17
- // a false positive.
18
- throw new Error('^_^');
19
- }
20
- try {
21
- // Verify that the code above has been dead code eliminated (DCE'd).
22
- __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
23
- } catch (err) {
24
- // DevTools shouldn't crash React, no matter what.
25
- // We should still report in case we break this code.
26
- console.error(err);
27
- }
28
- }
29
- if (process.env.NODE_ENV === 'production') {
30
- // DCE check should happen before ReactDOM bundle executes so that
31
- // DevTools can report bad minification during injection.
32
- checkDCE();
33
- reactDom.exports = requireReactDom_production_min();
34
- } else {
35
- reactDom.exports = requireReactDom_development();
36
- }
37
- var reactDomExports = reactDom.exports;
38
-
39
- export { reactDomExports as r };
@@ -1,528 +0,0 @@
1
- import { __exports as scheduler_development } from '../../../_virtual/scheduler.development.js';
2
-
3
- /**
4
- * @license React
5
- * scheduler.development.js
6
- *
7
- * Copyright (c) Facebook, Inc. and its affiliates.
8
- *
9
- * This source code is licensed under the MIT license found in the
10
- * LICENSE file in the root directory of this source tree.
11
- */
12
- var hasRequiredScheduler_development;
13
- function requireScheduler_development() {
14
- if (hasRequiredScheduler_development) return scheduler_development;
15
- hasRequiredScheduler_development = 1;
16
- (function (exports) {
17
-
18
- if (process.env.NODE_ENV !== "production") {
19
- (function () {
20
-
21
- /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
22
- if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === 'function') {
23
- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
24
- }
25
- var enableSchedulerDebugging = false;
26
- var enableProfiling = false;
27
- var frameYieldMs = 5;
28
- function push(heap, node) {
29
- var index = heap.length;
30
- heap.push(node);
31
- siftUp(heap, node, index);
32
- }
33
- function peek(heap) {
34
- return heap.length === 0 ? null : heap[0];
35
- }
36
- function pop(heap) {
37
- if (heap.length === 0) {
38
- return null;
39
- }
40
- var first = heap[0];
41
- var last = heap.pop();
42
- if (last !== first) {
43
- heap[0] = last;
44
- siftDown(heap, last, 0);
45
- }
46
- return first;
47
- }
48
- function siftUp(heap, node, i) {
49
- var index = i;
50
- while (index > 0) {
51
- var parentIndex = index - 1 >>> 1;
52
- var parent = heap[parentIndex];
53
- if (compare(parent, node) > 0) {
54
- // The parent is larger. Swap positions.
55
- heap[parentIndex] = node;
56
- heap[index] = parent;
57
- index = parentIndex;
58
- } else {
59
- // The parent is smaller. Exit.
60
- return;
61
- }
62
- }
63
- }
64
- function siftDown(heap, node, i) {
65
- var index = i;
66
- var length = heap.length;
67
- var halfLength = length >>> 1;
68
- while (index < halfLength) {
69
- var leftIndex = (index + 1) * 2 - 1;
70
- var left = heap[leftIndex];
71
- var rightIndex = leftIndex + 1;
72
- var right = heap[rightIndex]; // If the left or right node is smaller, swap with the smaller of those.
73
-
74
- if (compare(left, node) < 0) {
75
- if (rightIndex < length && compare(right, left) < 0) {
76
- heap[index] = right;
77
- heap[rightIndex] = node;
78
- index = rightIndex;
79
- } else {
80
- heap[index] = left;
81
- heap[leftIndex] = node;
82
- index = leftIndex;
83
- }
84
- } else if (rightIndex < length && compare(right, node) < 0) {
85
- heap[index] = right;
86
- heap[rightIndex] = node;
87
- index = rightIndex;
88
- } else {
89
- // Neither child is smaller. Exit.
90
- return;
91
- }
92
- }
93
- }
94
- function compare(a, b) {
95
- // Compare sort index first, then task id.
96
- var diff = a.sortIndex - b.sortIndex;
97
- return diff !== 0 ? diff : a.id - b.id;
98
- }
99
-
100
- // TODO: Use symbols?
101
- var ImmediatePriority = 1;
102
- var UserBlockingPriority = 2;
103
- var NormalPriority = 3;
104
- var LowPriority = 4;
105
- var IdlePriority = 5;
106
- function markTaskErrored(task, ms) {}
107
-
108
- /* eslint-disable no-var */
109
-
110
- var hasPerformanceNow = typeof performance === 'object' && typeof performance.now === 'function';
111
- if (hasPerformanceNow) {
112
- var localPerformance = performance;
113
- exports.unstable_now = function () {
114
- return localPerformance.now();
115
- };
116
- } else {
117
- var localDate = Date;
118
- var initialTime = localDate.now();
119
- exports.unstable_now = function () {
120
- return localDate.now() - initialTime;
121
- };
122
- } // Max 31 bit integer. The max integer size in V8 for 32-bit systems.
123
- // Math.pow(2, 30) - 1
124
- // 0b111111111111111111111111111111
125
-
126
- var maxSigned31BitInt = 1073741823; // Times out immediately
127
-
128
- var IMMEDIATE_PRIORITY_TIMEOUT = -1; // Eventually times out
129
-
130
- var USER_BLOCKING_PRIORITY_TIMEOUT = 250;
131
- var NORMAL_PRIORITY_TIMEOUT = 5000;
132
- var LOW_PRIORITY_TIMEOUT = 10000; // Never times out
133
-
134
- var IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt; // Tasks are stored on a min heap
135
-
136
- var taskQueue = [];
137
- var timerQueue = []; // Incrementing id counter. Used to maintain insertion order.
138
-
139
- var taskIdCounter = 1; // Pausing the scheduler is useful for debugging.
140
- var currentTask = null;
141
- var currentPriorityLevel = NormalPriority; // This is set while performing work, to prevent re-entrance.
142
-
143
- var isPerformingWork = false;
144
- var isHostCallbackScheduled = false;
145
- var isHostTimeoutScheduled = false; // Capture local references to native APIs, in case a polyfill overrides them.
146
-
147
- var localSetTimeout = typeof setTimeout === 'function' ? setTimeout : null;
148
- var localClearTimeout = typeof clearTimeout === 'function' ? clearTimeout : null;
149
- var localSetImmediate = typeof setImmediate !== 'undefined' ? setImmediate : null; // IE and Node.js + jsdom
150
-
151
- typeof navigator !== 'undefined' && navigator.scheduling !== undefined && navigator.scheduling.isInputPending !== undefined ? navigator.scheduling.isInputPending.bind(navigator.scheduling) : null;
152
- function advanceTimers(currentTime) {
153
- // Check for tasks that are no longer delayed and add them to the queue.
154
- var timer = peek(timerQueue);
155
- while (timer !== null) {
156
- if (timer.callback === null) {
157
- // Timer was cancelled.
158
- pop(timerQueue);
159
- } else if (timer.startTime <= currentTime) {
160
- // Timer fired. Transfer to the task queue.
161
- pop(timerQueue);
162
- timer.sortIndex = timer.expirationTime;
163
- push(taskQueue, timer);
164
- } else {
165
- // Remaining timers are pending.
166
- return;
167
- }
168
- timer = peek(timerQueue);
169
- }
170
- }
171
- function handleTimeout(currentTime) {
172
- isHostTimeoutScheduled = false;
173
- advanceTimers(currentTime);
174
- if (!isHostCallbackScheduled) {
175
- if (peek(taskQueue) !== null) {
176
- isHostCallbackScheduled = true;
177
- requestHostCallback(flushWork);
178
- } else {
179
- var firstTimer = peek(timerQueue);
180
- if (firstTimer !== null) {
181
- requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
182
- }
183
- }
184
- }
185
- }
186
- function flushWork(hasTimeRemaining, initialTime) {
187
- isHostCallbackScheduled = false;
188
- if (isHostTimeoutScheduled) {
189
- // We scheduled a timeout but it's no longer needed. Cancel it.
190
- isHostTimeoutScheduled = false;
191
- cancelHostTimeout();
192
- }
193
- isPerformingWork = true;
194
- var previousPriorityLevel = currentPriorityLevel;
195
- try {
196
- var currentTime; if (enableProfiling) ; else {
197
- // No catch in prod code path.
198
- return workLoop(hasTimeRemaining, initialTime);
199
- }
200
- } finally {
201
- currentTask = null;
202
- currentPriorityLevel = previousPriorityLevel;
203
- isPerformingWork = false;
204
- }
205
- }
206
- function workLoop(hasTimeRemaining, initialTime) {
207
- var currentTime = initialTime;
208
- advanceTimers(currentTime);
209
- currentTask = peek(taskQueue);
210
- while (currentTask !== null && !enableSchedulerDebugging) {
211
- if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {
212
- // This currentTask hasn't expired, and we've reached the deadline.
213
- break;
214
- }
215
- var callback = currentTask.callback;
216
- if (typeof callback === 'function') {
217
- currentTask.callback = null;
218
- currentPriorityLevel = currentTask.priorityLevel;
219
- var didUserCallbackTimeout = currentTask.expirationTime <= currentTime;
220
- var continuationCallback = callback(didUserCallbackTimeout);
221
- currentTime = exports.unstable_now();
222
- if (typeof continuationCallback === 'function') {
223
- currentTask.callback = continuationCallback;
224
- } else {
225
- if (currentTask === peek(taskQueue)) {
226
- pop(taskQueue);
227
- }
228
- }
229
- advanceTimers(currentTime);
230
- } else {
231
- pop(taskQueue);
232
- }
233
- currentTask = peek(taskQueue);
234
- } // Return whether there's additional work
235
-
236
- if (currentTask !== null) {
237
- return true;
238
- } else {
239
- var firstTimer = peek(timerQueue);
240
- if (firstTimer !== null) {
241
- requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
242
- }
243
- return false;
244
- }
245
- }
246
- function unstable_runWithPriority(priorityLevel, eventHandler) {
247
- switch (priorityLevel) {
248
- case ImmediatePriority:
249
- case UserBlockingPriority:
250
- case NormalPriority:
251
- case LowPriority:
252
- case IdlePriority:
253
- break;
254
- default:
255
- priorityLevel = NormalPriority;
256
- }
257
- var previousPriorityLevel = currentPriorityLevel;
258
- currentPriorityLevel = priorityLevel;
259
- try {
260
- return eventHandler();
261
- } finally {
262
- currentPriorityLevel = previousPriorityLevel;
263
- }
264
- }
265
- function unstable_next(eventHandler) {
266
- var priorityLevel;
267
- switch (currentPriorityLevel) {
268
- case ImmediatePriority:
269
- case UserBlockingPriority:
270
- case NormalPriority:
271
- // Shift down to normal priority
272
- priorityLevel = NormalPriority;
273
- break;
274
- default:
275
- // Anything lower than normal priority should remain at the current level.
276
- priorityLevel = currentPriorityLevel;
277
- break;
278
- }
279
- var previousPriorityLevel = currentPriorityLevel;
280
- currentPriorityLevel = priorityLevel;
281
- try {
282
- return eventHandler();
283
- } finally {
284
- currentPriorityLevel = previousPriorityLevel;
285
- }
286
- }
287
- function unstable_wrapCallback(callback) {
288
- var parentPriorityLevel = currentPriorityLevel;
289
- return function () {
290
- // This is a fork of runWithPriority, inlined for performance.
291
- var previousPriorityLevel = currentPriorityLevel;
292
- currentPriorityLevel = parentPriorityLevel;
293
- try {
294
- return callback.apply(this, arguments);
295
- } finally {
296
- currentPriorityLevel = previousPriorityLevel;
297
- }
298
- };
299
- }
300
- function unstable_scheduleCallback(priorityLevel, callback, options) {
301
- var currentTime = exports.unstable_now();
302
- var startTime;
303
- if (typeof options === 'object' && options !== null) {
304
- var delay = options.delay;
305
- if (typeof delay === 'number' && delay > 0) {
306
- startTime = currentTime + delay;
307
- } else {
308
- startTime = currentTime;
309
- }
310
- } else {
311
- startTime = currentTime;
312
- }
313
- var timeout;
314
- switch (priorityLevel) {
315
- case ImmediatePriority:
316
- timeout = IMMEDIATE_PRIORITY_TIMEOUT;
317
- break;
318
- case UserBlockingPriority:
319
- timeout = USER_BLOCKING_PRIORITY_TIMEOUT;
320
- break;
321
- case IdlePriority:
322
- timeout = IDLE_PRIORITY_TIMEOUT;
323
- break;
324
- case LowPriority:
325
- timeout = LOW_PRIORITY_TIMEOUT;
326
- break;
327
- case NormalPriority:
328
- default:
329
- timeout = NORMAL_PRIORITY_TIMEOUT;
330
- break;
331
- }
332
- var expirationTime = startTime + timeout;
333
- var newTask = {
334
- id: taskIdCounter++,
335
- callback: callback,
336
- priorityLevel: priorityLevel,
337
- startTime: startTime,
338
- expirationTime: expirationTime,
339
- sortIndex: -1
340
- };
341
- if (startTime > currentTime) {
342
- // This is a delayed task.
343
- newTask.sortIndex = startTime;
344
- push(timerQueue, newTask);
345
- if (peek(taskQueue) === null && newTask === peek(timerQueue)) {
346
- // All tasks are delayed, and this is the task with the earliest delay.
347
- if (isHostTimeoutScheduled) {
348
- // Cancel an existing timeout.
349
- cancelHostTimeout();
350
- } else {
351
- isHostTimeoutScheduled = true;
352
- } // Schedule a timeout.
353
-
354
- requestHostTimeout(handleTimeout, startTime - currentTime);
355
- }
356
- } else {
357
- newTask.sortIndex = expirationTime;
358
- push(taskQueue, newTask);
359
- // wait until the next time we yield.
360
-
361
- if (!isHostCallbackScheduled && !isPerformingWork) {
362
- isHostCallbackScheduled = true;
363
- requestHostCallback(flushWork);
364
- }
365
- }
366
- return newTask;
367
- }
368
- function unstable_pauseExecution() {}
369
- function unstable_continueExecution() {
370
- if (!isHostCallbackScheduled && !isPerformingWork) {
371
- isHostCallbackScheduled = true;
372
- requestHostCallback(flushWork);
373
- }
374
- }
375
- function unstable_getFirstCallbackNode() {
376
- return peek(taskQueue);
377
- }
378
- function unstable_cancelCallback(task) {
379
- // remove from the queue because you can't remove arbitrary nodes from an
380
- // array based heap, only the first one.)
381
-
382
- task.callback = null;
383
- }
384
- function unstable_getCurrentPriorityLevel() {
385
- return currentPriorityLevel;
386
- }
387
- var isMessageLoopRunning = false;
388
- var scheduledHostCallback = null;
389
- var taskTimeoutID = -1; // Scheduler periodically yields in case there is other work on the main
390
- // thread, like user events. By default, it yields multiple times per frame.
391
- // It does not attempt to align with frame boundaries, since most tasks don't
392
- // need to be frame aligned; for those that do, use requestAnimationFrame.
393
-
394
- var frameInterval = frameYieldMs;
395
- var startTime = -1;
396
- function shouldYieldToHost() {
397
- var timeElapsed = exports.unstable_now() - startTime;
398
- if (timeElapsed < frameInterval) {
399
- // The main thread has only been blocked for a really short amount of time;
400
- // smaller than a single frame. Don't yield yet.
401
- return false;
402
- } // The main thread has been blocked for a non-negligible amount of time. We
403
-
404
- return true;
405
- }
406
- function requestPaint() {}
407
- function forceFrameRate(fps) {
408
- if (fps < 0 || fps > 125) {
409
- // Using console['error'] to evade Babel and ESLint
410
- console['error']('forceFrameRate takes a positive int between 0 and 125, ' + 'forcing frame rates higher than 125 fps is not supported');
411
- return;
412
- }
413
- if (fps > 0) {
414
- frameInterval = Math.floor(1000 / fps);
415
- } else {
416
- // reset the framerate
417
- frameInterval = frameYieldMs;
418
- }
419
- }
420
- var performWorkUntilDeadline = function () {
421
- if (scheduledHostCallback !== null) {
422
- var currentTime = exports.unstable_now(); // Keep track of the start time so we can measure how long the main thread
423
- // has been blocked.
424
-
425
- startTime = currentTime;
426
- var hasTimeRemaining = true; // If a scheduler task throws, exit the current browser task so the
427
- // error can be observed.
428
- //
429
- // Intentionally not using a try-catch, since that makes some debugging
430
- // techniques harder. Instead, if `scheduledHostCallback` errors, then
431
- // `hasMoreWork` will remain true, and we'll continue the work loop.
432
-
433
- var hasMoreWork = true;
434
- try {
435
- hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime);
436
- } finally {
437
- if (hasMoreWork) {
438
- // If there's more work, schedule the next message event at the end
439
- // of the preceding one.
440
- schedulePerformWorkUntilDeadline();
441
- } else {
442
- isMessageLoopRunning = false;
443
- scheduledHostCallback = null;
444
- }
445
- }
446
- } else {
447
- isMessageLoopRunning = false;
448
- } // Yielding to the browser will give it a chance to paint, so we can
449
- };
450
-
451
- var schedulePerformWorkUntilDeadline;
452
- if (typeof localSetImmediate === 'function') {
453
- // Node.js and old IE.
454
- // There's a few reasons for why we prefer setImmediate.
455
- //
456
- // Unlike MessageChannel, it doesn't prevent a Node.js process from exiting.
457
- // (Even though this is a DOM fork of the Scheduler, you could get here
458
- // with a mix of Node.js 15+, which has a MessageChannel, and jsdom.)
459
- // https://github.com/facebook/react/issues/20756
460
- //
461
- // But also, it runs earlier which is the semantic we want.
462
- // If other browsers ever implement it, it's better to use it.
463
- // Although both of these would be inferior to native scheduling.
464
- schedulePerformWorkUntilDeadline = function () {
465
- localSetImmediate(performWorkUntilDeadline);
466
- };
467
- } else if (typeof MessageChannel !== 'undefined') {
468
- // DOM and Worker environments.
469
- // We prefer MessageChannel because of the 4ms setTimeout clamping.
470
- var channel = new MessageChannel();
471
- var port = channel.port2;
472
- channel.port1.onmessage = performWorkUntilDeadline;
473
- schedulePerformWorkUntilDeadline = function () {
474
- port.postMessage(null);
475
- };
476
- } else {
477
- // We should only fallback here in non-browser environments.
478
- schedulePerformWorkUntilDeadline = function () {
479
- localSetTimeout(performWorkUntilDeadline, 0);
480
- };
481
- }
482
- function requestHostCallback(callback) {
483
- scheduledHostCallback = callback;
484
- if (!isMessageLoopRunning) {
485
- isMessageLoopRunning = true;
486
- schedulePerformWorkUntilDeadline();
487
- }
488
- }
489
- function requestHostTimeout(callback, ms) {
490
- taskTimeoutID = localSetTimeout(function () {
491
- callback(exports.unstable_now());
492
- }, ms);
493
- }
494
- function cancelHostTimeout() {
495
- localClearTimeout(taskTimeoutID);
496
- taskTimeoutID = -1;
497
- }
498
- var unstable_requestPaint = requestPaint;
499
- var unstable_Profiling = null;
500
- exports.unstable_IdlePriority = IdlePriority;
501
- exports.unstable_ImmediatePriority = ImmediatePriority;
502
- exports.unstable_LowPriority = LowPriority;
503
- exports.unstable_NormalPriority = NormalPriority;
504
- exports.unstable_Profiling = unstable_Profiling;
505
- exports.unstable_UserBlockingPriority = UserBlockingPriority;
506
- exports.unstable_cancelCallback = unstable_cancelCallback;
507
- exports.unstable_continueExecution = unstable_continueExecution;
508
- exports.unstable_forceFrameRate = forceFrameRate;
509
- exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;
510
- exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;
511
- exports.unstable_next = unstable_next;
512
- exports.unstable_pauseExecution = unstable_pauseExecution;
513
- exports.unstable_requestPaint = unstable_requestPaint;
514
- exports.unstable_runWithPriority = unstable_runWithPriority;
515
- exports.unstable_scheduleCallback = unstable_scheduleCallback;
516
- exports.unstable_shouldYield = shouldYieldToHost;
517
- exports.unstable_wrapCallback = unstable_wrapCallback;
518
- /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
519
- if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === 'function') {
520
- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
521
- }
522
- })();
523
- }
524
- })(scheduler_development);
525
- return scheduler_development;
526
- }
527
-
528
- export { requireScheduler_development as __require };