@tanem/react-nprogress 3.0.81 → 4.0.0-beta.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.
- package/README.md +1 -0
- package/dist/createQueue.d.ts +7 -0
- package/dist/createTimeout.d.ts +4 -0
- package/dist/react-nprogress.cjs.development.js +99 -64
- package/dist/react-nprogress.cjs.development.js.map +1 -1
- package/dist/react-nprogress.cjs.production.js +1 -1
- package/dist/react-nprogress.cjs.production.js.map +1 -1
- package/dist/react-nprogress.esm.js +100 -65
- package/dist/react-nprogress.esm.js.map +1 -1
- package/dist/react-nprogress.umd.development.js +111 -176
- package/dist/react-nprogress.umd.development.js.map +1 -1
- package/dist/react-nprogress.umd.production.js +1 -1
- package/dist/react-nprogress.umd.production.js.map +1 -1
- package/dist/useNProgress.d.ts +2 -4
- package/package.json +22 -22
- package/dist/queue.d.ts +0 -5
- package/dist/timeout.d.ts +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-nprogress.esm.js","sources":["../compiled/clamp.js","../compiled/increment.js","../compiled/queue.js","../compiled/timeout.js","../compiled/useNProgress.js","../compiled/NProgress.js","../compiled/withNProgress.js"],"sourcesContent":["export const clamp = (num, lower, upper) => {\n num = num <= upper ? num : upper;\n num = num >= lower ? num : lower;\n return num;\n};\n","import { clamp } from './clamp';\nexport const increment = (progress) => {\n let amount = 0;\n if (progress >= 0 && progress < 0.2) {\n amount = 0.1;\n }\n else if (progress >= 0.2 && progress < 0.5) {\n amount = 0.04;\n }\n else if (progress >= 0.5 && progress < 0.8) {\n amount = 0.02;\n }\n else if (progress >= 0.8 && progress < 0.99) {\n amount = 0.005;\n }\n return clamp(progress + amount, 0, 0.994);\n};\n","let isRunning = false;\nlet pending = [];\nconst next = () => {\n isRunning = true;\n const cb = pending.shift();\n if (cb) {\n return cb(next);\n }\n isRunning = false;\n};\nexport const clear = () => {\n isRunning = false;\n pending = [];\n};\nexport const queue = (cb) => {\n pending.push(cb);\n if (!isRunning && pending.length === 1) {\n next();\n }\n};\n","let handle;\nexport const cancel = () => {\n if (handle) {\n window.cancelAnimationFrame(handle);\n }\n};\nexport const timeout = (callback, delay) => {\n let deltaTime;\n let start;\n const frame = (time) => {\n start = start || time;\n deltaTime = time - start;\n if (deltaTime > delay) {\n callback();\n return;\n }\n handle = window.requestAnimationFrame(frame);\n };\n handle = window.requestAnimationFrame(frame);\n};\n","import { useCallback, useEffect, useRef } from 'react';\nimport { useEffectOnce, useGetSetState, useUpdateEffect } from 'react-use';\nimport { clamp } from './clamp';\nimport { increment } from './increment';\nimport { clear as clearQueue, queue } from './queue';\nimport { cancel as cancelCurrentTimeout, timeout } from './timeout';\n/* istanbul ignore next */\nconst noop = () => undefined;\nconst initialState = {\n isFinished: true,\n progress: 0,\n sideEffect: noop,\n};\nconst cleanup = () => {\n cancelCurrentTimeout();\n clearQueue();\n};\nexport const useNProgress = ({ animationDuration = 200, incrementDuration = 800, isAnimating = false, minimum = 0.08, } = {}) => {\n const [get, setState] = useGetSetState(initialState);\n const set = useCallback((n) => {\n n = clamp(n, minimum, 1);\n if (n === 1) {\n cleanup();\n queue((next) => {\n setState({\n progress: n,\n sideEffect: () => timeout(next, animationDuration),\n });\n });\n queue(() => {\n setState({ isFinished: true, sideEffect: cleanup });\n });\n return;\n }\n queue((next) => {\n setState({\n isFinished: false,\n progress: n,\n sideEffect: () => timeout(next, animationDuration),\n });\n });\n }, [animationDuration, minimum, setState]);\n const trickle = useCallback(() => {\n set(increment(get().progress));\n }, [get, set]);\n const start = useCallback(() => {\n const work = () => {\n trickle();\n queue((next) => {\n timeout(() => {\n work();\n next();\n }, incrementDuration);\n });\n };\n work();\n }, [incrementDuration, trickle]);\n const savedTrickle = useRef(noop);\n const sideEffect = get().sideEffect;\n useEffect(() => {\n savedTrickle.current = trickle;\n });\n useEffectOnce(() => {\n if (isAnimating) {\n start();\n }\n return cleanup;\n });\n useUpdateEffect(() => {\n get().sideEffect();\n }, [get, sideEffect]);\n useUpdateEffect(() => {\n if (!isAnimating) {\n set(1);\n }\n else {\n setState({\n ...initialState,\n sideEffect: start,\n });\n }\n }, [isAnimating, set, setState, start]);\n return {\n animationDuration,\n isFinished: get().isFinished,\n progress: get().progress,\n };\n};\n","import { useNProgress } from './useNProgress';\nexport const NProgress = ({ children, ...restProps }) => {\n const renderProps = useNProgress(restProps);\n return children(renderProps);\n};\n","import hoistNonReactStatics from 'hoist-non-react-statics';\nimport * as React from 'react';\nimport { useNProgress } from './useNProgress';\nexport function withNProgress(BaseComponent) {\n const WithNProgress = (props) => {\n const hookProps = useNProgress(props);\n return React.createElement(BaseComponent, { ...props, ...hookProps });\n };\n hoistNonReactStatics(WithNProgress, BaseComponent);\n return WithNProgress;\n}\n"],"names":["clamp","num","lower","upper","increment","progress","amount","isRunning","pending","next","cb","shift","clear","queue","push","length","handle","cancel","window","cancelAnimationFrame","timeout","callback","delay","deltaTime","start","frame","time","requestAnimationFrame","noop","undefined","initialState","isFinished","sideEffect","cleanup","cancelCurrentTimeout","clearQueue","useNProgress","animationDuration","incrementDuration","isAnimating","minimum","useGetSetState","get","setState","set","useCallback","n","trickle","work","savedTrickle","useRef","useEffect","current","useEffectOnce","useUpdateEffect","NProgress","children","restProps","renderProps","withNProgress","BaseComponent","WithNProgress","props","hookProps","React","createElement","hoistNonReactStatics"],"mappings":";;;;;;;AAAO,IAAMA,KAAK,GAAG,SAARA,KAAQ,CAACC,GAAD,EAAMC,KAAN,EAAaC,KAAb,EAAuB;AACxCF,EAAAA,GAAG,GAAGA,GAAG,IAAIE,KAAP,GAAeF,GAAf,GAAqBE,KAA3B;AACAF,EAAAA,GAAG,GAAGA,GAAG,IAAIC,KAAP,GAAeD,GAAf,GAAqBC,KAA3B;AACA,SAAOD,GAAP;AACH,CAJM;;ACCA,IAAMG,SAAS,GAAG,SAAZA,SAAY,CAACC,QAAD,EAAc;AACnC,MAAIC,MAAM,GAAG,CAAb;;AACA,MAAID,QAAQ,IAAI,CAAZ,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,QAA6B;AAAA,MAAhBC,SAAgB;;AACrD,MAAMC,WAAW,GAAGtB,YAAY,CAACqB,SAAD,CAAhC;AACA,SAAOD,QAAQ,CAACE,WAAD,CAAf;AACH;;ACDM,SAASC,aAAT,CAAuBC,aAAvB,EAAsC;AACzC,MAAMC,aAAa,GAAG,SAAhBA,aAAgB,CAACC,KAAD,EAAW;AAC7B,QAAMC,SAAS,GAAG3B,YAAY,CAAC0B,KAAD,CAA9B;AACA,wBAAOE,KAAK,CAACC,aAAN,CAAoBL,aAApB,eAAwCE,KAAxC,EAAkDC,SAAlD,EAAP;AACH,GAHD;;AAIAG,EAAAA,oBAAoB,CAACL,aAAD,EAAgBD,aAAhB,CAApB;AACA,SAAOC,aAAP;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"react-nprogress.esm.js","sources":["../compiled/clamp.js","../compiled/createQueue.js","../compiled/createTimeout.js","../compiled/increment.js","../compiled/useNProgress.js","../compiled/NProgress.js","../compiled/withNProgress.js"],"sourcesContent":["export const clamp = (num, lower, upper) => {\n num = num <= upper ? num : upper;\n num = num >= lower ? num : lower;\n return num;\n};\n","export const createQueue = () => {\n let isRunning = false;\n let pending = [];\n const next = () => {\n isRunning = true;\n const cb = pending.shift();\n if (cb) {\n return cb(next);\n }\n isRunning = false;\n };\n const clear = () => {\n isRunning = false;\n pending = [];\n };\n const enqueue = (cb) => {\n pending.push(cb);\n if (!isRunning && pending.length === 1) {\n next();\n }\n };\n return {\n clear,\n enqueue,\n };\n};\n","export const createTimeout = () => {\n let handle;\n const cancel = () => {\n if (handle) {\n window.cancelAnimationFrame(handle);\n }\n };\n const schedule = (callback, delay) => {\n let deltaTime;\n let start;\n const frame = (time) => {\n start = start || time;\n deltaTime = time - start;\n if (deltaTime > delay) {\n callback();\n return;\n }\n handle = window.requestAnimationFrame(frame);\n };\n handle = window.requestAnimationFrame(frame);\n };\n return {\n cancel,\n schedule,\n };\n};\n","import { clamp } from './clamp';\nexport const increment = (progress) => {\n let amount = 0;\n if (progress >= 0 && progress < 0.2) {\n amount = 0.1;\n }\n else if (progress >= 0.2 && progress < 0.5) {\n amount = 0.04;\n }\n else if (progress >= 0.5 && progress < 0.8) {\n amount = 0.02;\n }\n else if (progress >= 0.8 && progress < 0.99) {\n amount = 0.005;\n }\n return clamp(progress + amount, 0, 0.994);\n};\n","import { useCallback, useEffect, useRef } from 'react';\nimport { useEffectOnce, useGetSetState, useUpdateEffect } from 'react-use';\nimport { clamp } from './clamp';\nimport { createQueue } from './createQueue';\nimport { createTimeout } from './createTimeout';\nimport { increment } from './increment';\n/* istanbul ignore next */\nconst noop = () => undefined;\nconst initialState = {\n isFinished: true,\n progress: 0,\n sideEffect: noop,\n};\nexport const useNProgress = ({ animationDuration = 200, incrementDuration = 800, isAnimating = false, minimum = 0.08, } = {}) => {\n const [get, setState] = useGetSetState(initialState);\n const queue = useRef(null);\n const timeout = useRef(null);\n useEffectOnce(() => {\n queue.current = createQueue();\n timeout.current = createTimeout();\n });\n const cleanup = useCallback(() => {\n timeout.current?.cancel();\n queue.current?.clear();\n }, []);\n const set = useCallback((n) => {\n n = clamp(n, minimum, 1);\n if (n === 1) {\n cleanup();\n queue.current?.enqueue((next) => {\n setState({\n progress: n,\n sideEffect: () => timeout.current?.schedule(next, animationDuration),\n });\n });\n queue.current?.enqueue(() => {\n setState({ isFinished: true, sideEffect: cleanup });\n });\n return;\n }\n queue.current?.enqueue((next) => {\n setState({\n isFinished: false,\n progress: n,\n sideEffect: () => timeout.current?.schedule(next, animationDuration),\n });\n });\n }, [animationDuration, cleanup, minimum, queue, setState, timeout]);\n const trickle = useCallback(() => {\n set(increment(get().progress));\n }, [get, set]);\n const start = useCallback(() => {\n const work = () => {\n trickle();\n queue.current?.enqueue((next) => {\n timeout.current?.schedule(() => {\n work();\n next();\n }, incrementDuration);\n });\n };\n work();\n }, [incrementDuration, queue, timeout, trickle]);\n const savedTrickle = useRef(noop);\n const sideEffect = get().sideEffect;\n useEffect(() => {\n savedTrickle.current = trickle;\n });\n useEffectOnce(() => {\n if (isAnimating) {\n start();\n }\n return cleanup;\n });\n useUpdateEffect(() => {\n get().sideEffect();\n }, [get, sideEffect]);\n useUpdateEffect(() => {\n if (!isAnimating) {\n set(1);\n }\n else {\n setState({\n ...initialState,\n sideEffect: start,\n });\n }\n }, [isAnimating, set, setState, start]);\n return {\n animationDuration,\n isFinished: get().isFinished,\n progress: get().progress,\n };\n};\n","import { useNProgress } from './useNProgress';\nexport const NProgress = ({ children, ...restProps }) => {\n const renderProps = useNProgress(restProps);\n return children(renderProps);\n};\n","import hoistNonReactStatics from 'hoist-non-react-statics';\nimport * as React from 'react';\nimport { useNProgress } from './useNProgress';\nexport function withNProgress(BaseComponent) {\n const WithNProgress = (props) => {\n const hookProps = useNProgress(props);\n return React.createElement(BaseComponent, { ...props, ...hookProps });\n };\n hoistNonReactStatics(WithNProgress, BaseComponent);\n return WithNProgress;\n}\n"],"names":["clamp","num","lower","upper","createQueue","isRunning","pending","next","cb","shift","clear","enqueue","push","length","createTimeout","handle","cancel","window","cancelAnimationFrame","schedule","callback","delay","deltaTime","start","frame","time","requestAnimationFrame","increment","progress","amount","noop","undefined","initialState","isFinished","sideEffect","useNProgress","animationDuration","incrementDuration","isAnimating","minimum","useGetSetState","get","setState","queue","useRef","timeout","useEffectOnce","current","cleanup","useCallback","set","n","trickle","work","savedTrickle","useEffect","useUpdateEffect","NProgress","children","restProps","renderProps","withNProgress","BaseComponent","WithNProgress","props","hookProps","React","createElement","hoistNonReactStatics"],"mappings":";;;;;;;AAAO,IAAMA,KAAK,GAAG,SAARA,KAAQ,CAACC,GAAD,EAAMC,KAAN,EAAaC,KAAb,EAAuB;AACxCF,EAAAA,GAAG,GAAGA,GAAG,IAAIE,KAAP,GAAeF,GAAf,GAAqBE,KAA3B;AACAF,EAAAA,GAAG,GAAGA,GAAG,IAAIC,KAAP,GAAeD,GAAf,GAAqBC,KAA3B;AACA,SAAOD,GAAP;AACH,CAJM;;ACAA,IAAMG,WAAW,GA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AACzC,MAAMC,aAAa,GAAG,SAAhBA,aAAgB,CAACC,KAAD,EAAW;AAC7B,QAAMC,SAAS,GAAG9B,YAAY,CAAC6B,KAAD,CAA9B;AACA,wBAAOE,KAAK,CAACC,aAAN,CAAoBL,aAApB,eAAwCE,KAAxC,EAAkDC,SAAlD,EAAP;AACH,GAHD;;AAIAG,EAAAA,oBAAoB,CAACL,aAAD,EAAgBD,aAAhB,CAApB;AACA,SAAOC,aAAP;AACH;;;;"}
|
|
@@ -48,8 +48,7 @@
|
|
|
48
48
|
return target;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
module.exports = _objectWithoutPropertiesLoose;
|
|
52
|
-
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
51
|
+
module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
53
52
|
});
|
|
54
53
|
|
|
55
54
|
var _objectWithoutPropertiesLoose = unwrapExports(objectWithoutPropertiesLoose);
|
|
@@ -68,14 +67,11 @@
|
|
|
68
67
|
}
|
|
69
68
|
|
|
70
69
|
return target;
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
70
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
74
71
|
return _extends.apply(this, arguments);
|
|
75
72
|
}
|
|
76
73
|
|
|
77
|
-
module.exports = _extends;
|
|
78
|
-
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
74
|
+
module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
79
75
|
});
|
|
80
76
|
|
|
81
77
|
var _extends = unwrapExports(_extends_1);
|
|
@@ -168,71 +164,88 @@
|
|
|
168
164
|
return num;
|
|
169
165
|
};
|
|
170
166
|
|
|
171
|
-
var
|
|
172
|
-
var
|
|
167
|
+
var createQueue = function createQueue() {
|
|
168
|
+
var isRunning = false;
|
|
169
|
+
var pending = [];
|
|
173
170
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
amount = 0.04;
|
|
178
|
-
} else if (progress >= 0.5 && progress < 0.8) {
|
|
179
|
-
amount = 0.02;
|
|
180
|
-
} else if (progress >= 0.8 && progress < 0.99) {
|
|
181
|
-
amount = 0.005;
|
|
182
|
-
}
|
|
171
|
+
var next = function next() {
|
|
172
|
+
isRunning = true;
|
|
173
|
+
var cb = pending.shift();
|
|
183
174
|
|
|
184
|
-
|
|
185
|
-
|
|
175
|
+
if (cb) {
|
|
176
|
+
return cb(next);
|
|
177
|
+
}
|
|
186
178
|
|
|
187
|
-
|
|
188
|
-
|
|
179
|
+
isRunning = false;
|
|
180
|
+
};
|
|
189
181
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
182
|
+
var clear = function clear() {
|
|
183
|
+
isRunning = false;
|
|
184
|
+
pending = [];
|
|
185
|
+
};
|
|
193
186
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}
|
|
187
|
+
var enqueue = function enqueue(cb) {
|
|
188
|
+
pending.push(cb);
|
|
197
189
|
|
|
198
|
-
|
|
199
|
-
|
|
190
|
+
if (!isRunning && pending.length === 1) {
|
|
191
|
+
next();
|
|
192
|
+
}
|
|
193
|
+
};
|
|
200
194
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
195
|
+
return {
|
|
196
|
+
clear: clear,
|
|
197
|
+
enqueue: enqueue
|
|
198
|
+
};
|
|
204
199
|
};
|
|
205
|
-
var queue = function queue(cb) {
|
|
206
|
-
pending.push(cb);
|
|
207
200
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
}
|
|
211
|
-
};
|
|
201
|
+
var createTimeout = function createTimeout() {
|
|
202
|
+
var handle;
|
|
212
203
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
}
|
|
218
|
-
};
|
|
219
|
-
var timeout = function timeout(callback, delay) {
|
|
220
|
-
var deltaTime;
|
|
221
|
-
var start;
|
|
204
|
+
var cancel = function cancel() {
|
|
205
|
+
if (handle) {
|
|
206
|
+
window.cancelAnimationFrame(handle);
|
|
207
|
+
}
|
|
208
|
+
};
|
|
222
209
|
|
|
223
|
-
var
|
|
224
|
-
|
|
225
|
-
|
|
210
|
+
var schedule = function schedule(callback, delay) {
|
|
211
|
+
var deltaTime;
|
|
212
|
+
var start;
|
|
226
213
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
214
|
+
var frame = function frame(time) {
|
|
215
|
+
start = start || time;
|
|
216
|
+
deltaTime = time - start;
|
|
217
|
+
|
|
218
|
+
if (deltaTime > delay) {
|
|
219
|
+
callback();
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
handle = window.requestAnimationFrame(frame);
|
|
224
|
+
};
|
|
231
225
|
|
|
232
226
|
handle = window.requestAnimationFrame(frame);
|
|
233
227
|
};
|
|
234
228
|
|
|
235
|
-
|
|
229
|
+
return {
|
|
230
|
+
cancel: cancel,
|
|
231
|
+
schedule: schedule
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
var increment = function increment(progress) {
|
|
236
|
+
var amount = 0;
|
|
237
|
+
|
|
238
|
+
if (progress >= 0 && progress < 0.2) {
|
|
239
|
+
amount = 0.1;
|
|
240
|
+
} else if (progress >= 0.2 && progress < 0.5) {
|
|
241
|
+
amount = 0.04;
|
|
242
|
+
} else if (progress >= 0.5 && progress < 0.8) {
|
|
243
|
+
amount = 0.02;
|
|
244
|
+
} else if (progress >= 0.8 && progress < 0.99) {
|
|
245
|
+
amount = 0.005;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
return clamp(progress + amount, 0, 0.994);
|
|
236
249
|
};
|
|
237
250
|
|
|
238
251
|
/* istanbul ignore next */
|
|
@@ -246,12 +259,6 @@
|
|
|
246
259
|
progress: 0,
|
|
247
260
|
sideEffect: noop
|
|
248
261
|
};
|
|
249
|
-
|
|
250
|
-
var cleanup = function cleanup() {
|
|
251
|
-
cancel();
|
|
252
|
-
clear();
|
|
253
|
-
};
|
|
254
|
-
|
|
255
262
|
var useNProgress = function useNProgress(_temp) {
|
|
256
263
|
var _ref = _temp === void 0 ? {} : _temp,
|
|
257
264
|
_ref$animationDuratio = _ref.animationDuration,
|
|
@@ -267,20 +274,38 @@
|
|
|
267
274
|
get = _useGetSetState[0],
|
|
268
275
|
setState = _useGetSetState[1];
|
|
269
276
|
|
|
277
|
+
var queue = React.useRef(null);
|
|
278
|
+
var timeout = React.useRef(null);
|
|
279
|
+
useEffectOnce$1(function () {
|
|
280
|
+
queue.current = createQueue();
|
|
281
|
+
timeout.current = createTimeout();
|
|
282
|
+
});
|
|
283
|
+
var cleanup = React.useCallback(function () {
|
|
284
|
+
var _timeout$current, _queue$current;
|
|
285
|
+
|
|
286
|
+
(_timeout$current = timeout.current) == null ? void 0 : _timeout$current.cancel();
|
|
287
|
+
(_queue$current = queue.current) == null ? void 0 : _queue$current.clear();
|
|
288
|
+
}, []);
|
|
270
289
|
var set = React.useCallback(function (n) {
|
|
290
|
+
var _queue$current4;
|
|
291
|
+
|
|
271
292
|
n = clamp(n, minimum, 1);
|
|
272
293
|
|
|
273
294
|
if (n === 1) {
|
|
295
|
+
var _queue$current2, _queue$current3;
|
|
296
|
+
|
|
274
297
|
cleanup();
|
|
275
|
-
queue(function (next) {
|
|
298
|
+
(_queue$current2 = queue.current) == null ? void 0 : _queue$current2.enqueue(function (next) {
|
|
276
299
|
setState({
|
|
277
300
|
progress: n,
|
|
278
301
|
sideEffect: function sideEffect() {
|
|
279
|
-
|
|
302
|
+
var _timeout$current2;
|
|
303
|
+
|
|
304
|
+
return (_timeout$current2 = timeout.current) == null ? void 0 : _timeout$current2.schedule(next, animationDuration);
|
|
280
305
|
}
|
|
281
306
|
});
|
|
282
307
|
});
|
|
283
|
-
queue(function () {
|
|
308
|
+
(_queue$current3 = queue.current) == null ? void 0 : _queue$current3.enqueue(function () {
|
|
284
309
|
setState({
|
|
285
310
|
isFinished: true,
|
|
286
311
|
sideEffect: cleanup
|
|
@@ -289,24 +314,30 @@
|
|
|
289
314
|
return;
|
|
290
315
|
}
|
|
291
316
|
|
|
292
|
-
queue(function (next) {
|
|
317
|
+
(_queue$current4 = queue.current) == null ? void 0 : _queue$current4.enqueue(function (next) {
|
|
293
318
|
setState({
|
|
294
319
|
isFinished: false,
|
|
295
320
|
progress: n,
|
|
296
321
|
sideEffect: function sideEffect() {
|
|
297
|
-
|
|
322
|
+
var _timeout$current3;
|
|
323
|
+
|
|
324
|
+
return (_timeout$current3 = timeout.current) == null ? void 0 : _timeout$current3.schedule(next, animationDuration);
|
|
298
325
|
}
|
|
299
326
|
});
|
|
300
327
|
});
|
|
301
|
-
}, [animationDuration, minimum, setState]);
|
|
328
|
+
}, [animationDuration, cleanup, minimum, queue, setState, timeout]);
|
|
302
329
|
var trickle = React.useCallback(function () {
|
|
303
330
|
set(increment(get().progress));
|
|
304
331
|
}, [get, set]);
|
|
305
332
|
var start = React.useCallback(function () {
|
|
306
333
|
var work = function work() {
|
|
334
|
+
var _queue$current5;
|
|
335
|
+
|
|
307
336
|
trickle();
|
|
308
|
-
queue(function (next) {
|
|
309
|
-
|
|
337
|
+
(_queue$current5 = queue.current) == null ? void 0 : _queue$current5.enqueue(function (next) {
|
|
338
|
+
var _timeout$current4;
|
|
339
|
+
|
|
340
|
+
(_timeout$current4 = timeout.current) == null ? void 0 : _timeout$current4.schedule(function () {
|
|
310
341
|
work();
|
|
311
342
|
next();
|
|
312
343
|
}, incrementDuration);
|
|
@@ -314,7 +345,7 @@
|
|
|
314
345
|
};
|
|
315
346
|
|
|
316
347
|
work();
|
|
317
|
-
}, [incrementDuration, trickle]);
|
|
348
|
+
}, [incrementDuration, queue, timeout, trickle]);
|
|
318
349
|
var savedTrickle = React.useRef(noop);
|
|
319
350
|
var sideEffect = get().sideEffect;
|
|
320
351
|
React.useEffect(function () {
|
|
@@ -355,45 +386,6 @@
|
|
|
355
386
|
return children(renderProps);
|
|
356
387
|
};
|
|
357
388
|
|
|
358
|
-
var reactIs_production_min = createCommonjsModule(function (module, exports) {
|
|
359
|
-
Object.defineProperty(exports,"__esModule",{value:!0});
|
|
360
|
-
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?Symbol.for("react.suspense_list"):
|
|
361
|
-
60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.fundamental"):60117,w=b?Symbol.for("react.responder"):60118,x=b?Symbol.for("react.scope"):60119;function y(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function z(a){return y(a)===m}
|
|
362
|
-
exports.typeOf=y;exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;
|
|
363
|
-
exports.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===v||a.$$typeof===w||a.$$typeof===x)};exports.isAsyncMode=function(a){return z(a)||y(a)===l};exports.isConcurrentMode=z;exports.isContextConsumer=function(a){return y(a)===k};exports.isContextProvider=function(a){return y(a)===h};
|
|
364
|
-
exports.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return y(a)===n};exports.isFragment=function(a){return y(a)===e};exports.isLazy=function(a){return y(a)===t};exports.isMemo=function(a){return y(a)===r};exports.isPortal=function(a){return y(a)===d};exports.isProfiler=function(a){return y(a)===g};exports.isStrictMode=function(a){return y(a)===f};exports.isSuspense=function(a){return y(a)===p};
|
|
365
|
-
});
|
|
366
|
-
|
|
367
|
-
unwrapExports(reactIs_production_min);
|
|
368
|
-
reactIs_production_min.typeOf;
|
|
369
|
-
reactIs_production_min.AsyncMode;
|
|
370
|
-
reactIs_production_min.ConcurrentMode;
|
|
371
|
-
reactIs_production_min.ContextConsumer;
|
|
372
|
-
reactIs_production_min.ContextProvider;
|
|
373
|
-
reactIs_production_min.Element;
|
|
374
|
-
reactIs_production_min.ForwardRef;
|
|
375
|
-
reactIs_production_min.Fragment;
|
|
376
|
-
reactIs_production_min.Lazy;
|
|
377
|
-
reactIs_production_min.Memo;
|
|
378
|
-
reactIs_production_min.Portal;
|
|
379
|
-
reactIs_production_min.Profiler;
|
|
380
|
-
reactIs_production_min.StrictMode;
|
|
381
|
-
reactIs_production_min.Suspense;
|
|
382
|
-
reactIs_production_min.isValidElementType;
|
|
383
|
-
reactIs_production_min.isAsyncMode;
|
|
384
|
-
reactIs_production_min.isConcurrentMode;
|
|
385
|
-
reactIs_production_min.isContextConsumer;
|
|
386
|
-
reactIs_production_min.isContextProvider;
|
|
387
|
-
reactIs_production_min.isElement;
|
|
388
|
-
reactIs_production_min.isForwardRef;
|
|
389
|
-
reactIs_production_min.isFragment;
|
|
390
|
-
reactIs_production_min.isLazy;
|
|
391
|
-
reactIs_production_min.isMemo;
|
|
392
|
-
reactIs_production_min.isPortal;
|
|
393
|
-
reactIs_production_min.isProfiler;
|
|
394
|
-
reactIs_production_min.isStrictMode;
|
|
395
|
-
reactIs_production_min.isSuspense;
|
|
396
|
-
|
|
397
389
|
var reactIs_development = createCommonjsModule(function (module, exports) {
|
|
398
390
|
|
|
399
391
|
|
|
@@ -401,8 +393,6 @@
|
|
|
401
393
|
{
|
|
402
394
|
(function() {
|
|
403
395
|
|
|
404
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
405
|
-
|
|
406
396
|
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
407
397
|
// nor polyfill, then a plain number is used for performance.
|
|
408
398
|
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
@@ -422,70 +412,16 @@
|
|
|
422
412
|
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
423
413
|
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
424
414
|
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
415
|
+
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
|
|
425
416
|
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
426
417
|
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
|
427
418
|
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
428
419
|
|
|
429
420
|
function isValidElementType(type) {
|
|
430
421
|
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
431
|
-
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE);
|
|
422
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
432
423
|
}
|
|
433
424
|
|
|
434
|
-
/**
|
|
435
|
-
* Forked from fbjs/warning:
|
|
436
|
-
* https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
|
|
437
|
-
*
|
|
438
|
-
* Only change is we use console.warn instead of console.error,
|
|
439
|
-
* and do nothing when 'console' is not supported.
|
|
440
|
-
* This really simplifies the code.
|
|
441
|
-
* ---
|
|
442
|
-
* Similar to invariant but only logs a warning if the condition is not met.
|
|
443
|
-
* This can be used to log issues in development environments in critical
|
|
444
|
-
* paths. Removing the logging code for production environments will keep the
|
|
445
|
-
* same logic and follow the same code paths.
|
|
446
|
-
*/
|
|
447
|
-
var lowPriorityWarningWithoutStack = function () {};
|
|
448
|
-
|
|
449
|
-
{
|
|
450
|
-
var printWarning = function (format) {
|
|
451
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
452
|
-
args[_key - 1] = arguments[_key];
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
var argIndex = 0;
|
|
456
|
-
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
|
457
|
-
return args[argIndex++];
|
|
458
|
-
});
|
|
459
|
-
|
|
460
|
-
if (typeof console !== 'undefined') {
|
|
461
|
-
console.warn(message);
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
try {
|
|
465
|
-
// --- Welcome to debugging React ---
|
|
466
|
-
// This error was thrown as a convenience so that you can use this stack
|
|
467
|
-
// to find the callsite that caused this warning to fire.
|
|
468
|
-
throw new Error(message);
|
|
469
|
-
} catch (x) {}
|
|
470
|
-
};
|
|
471
|
-
|
|
472
|
-
lowPriorityWarningWithoutStack = function (condition, format) {
|
|
473
|
-
if (format === undefined) {
|
|
474
|
-
throw new Error('`lowPriorityWarningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
if (!condition) {
|
|
478
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
|
479
|
-
args[_key2 - 2] = arguments[_key2];
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
printWarning.apply(void 0, [format].concat(args));
|
|
483
|
-
}
|
|
484
|
-
};
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
var lowPriorityWarningWithoutStack$1 = lowPriorityWarningWithoutStack;
|
|
488
|
-
|
|
489
425
|
function typeOf(object) {
|
|
490
426
|
if (typeof object === 'object' && object !== null) {
|
|
491
427
|
var $$typeof = object.$$typeof;
|
|
@@ -546,8 +482,9 @@
|
|
|
546
482
|
function isAsyncMode(object) {
|
|
547
483
|
{
|
|
548
484
|
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
549
|
-
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
|
550
|
-
|
|
485
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
486
|
+
|
|
487
|
+
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
|
|
551
488
|
}
|
|
552
489
|
}
|
|
553
490
|
|
|
@@ -590,7 +527,6 @@
|
|
|
590
527
|
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
591
528
|
}
|
|
592
529
|
|
|
593
|
-
exports.typeOf = typeOf;
|
|
594
530
|
exports.AsyncMode = AsyncMode;
|
|
595
531
|
exports.ConcurrentMode = ConcurrentMode;
|
|
596
532
|
exports.ContextConsumer = ContextConsumer;
|
|
@@ -604,7 +540,6 @@
|
|
|
604
540
|
exports.Profiler = Profiler;
|
|
605
541
|
exports.StrictMode = StrictMode;
|
|
606
542
|
exports.Suspense = Suspense;
|
|
607
|
-
exports.isValidElementType = isValidElementType;
|
|
608
543
|
exports.isAsyncMode = isAsyncMode;
|
|
609
544
|
exports.isConcurrentMode = isConcurrentMode;
|
|
610
545
|
exports.isContextConsumer = isContextConsumer;
|
|
@@ -618,12 +553,11 @@
|
|
|
618
553
|
exports.isProfiler = isProfiler;
|
|
619
554
|
exports.isStrictMode = isStrictMode;
|
|
620
555
|
exports.isSuspense = isSuspense;
|
|
556
|
+
exports.isValidElementType = isValidElementType;
|
|
557
|
+
exports.typeOf = typeOf;
|
|
621
558
|
})();
|
|
622
559
|
}
|
|
623
560
|
});
|
|
624
|
-
|
|
625
|
-
unwrapExports(reactIs_development);
|
|
626
|
-
reactIs_development.typeOf;
|
|
627
561
|
reactIs_development.AsyncMode;
|
|
628
562
|
reactIs_development.ConcurrentMode;
|
|
629
563
|
reactIs_development.ContextConsumer;
|
|
@@ -637,7 +571,6 @@
|
|
|
637
571
|
reactIs_development.Profiler;
|
|
638
572
|
reactIs_development.StrictMode;
|
|
639
573
|
reactIs_development.Suspense;
|
|
640
|
-
reactIs_development.isValidElementType;
|
|
641
574
|
reactIs_development.isAsyncMode;
|
|
642
575
|
reactIs_development.isConcurrentMode;
|
|
643
576
|
reactIs_development.isContextConsumer;
|
|
@@ -651,6 +584,8 @@
|
|
|
651
584
|
reactIs_development.isProfiler;
|
|
652
585
|
reactIs_development.isStrictMode;
|
|
653
586
|
reactIs_development.isSuspense;
|
|
587
|
+
reactIs_development.isValidElementType;
|
|
588
|
+
reactIs_development.typeOf;
|
|
654
589
|
|
|
655
590
|
var reactIs = createCommonjsModule(function (module) {
|
|
656
591
|
|