init 3
This commit is contained in:
22
node_modules/motion-utils/dist/es/array.mjs
generated
vendored
Normal file
22
node_modules/motion-utils/dist/es/array.mjs
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
function addUniqueItem(arr, item) {
|
||||
if (arr.indexOf(item) === -1)
|
||||
arr.push(item);
|
||||
}
|
||||
function removeItem(arr, item) {
|
||||
const index = arr.indexOf(item);
|
||||
if (index > -1)
|
||||
arr.splice(index, 1);
|
||||
}
|
||||
// Adapted from array-move
|
||||
function moveItem([...arr], fromIndex, toIndex) {
|
||||
const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex;
|
||||
if (startIndex >= 0 && startIndex < arr.length) {
|
||||
const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex;
|
||||
const [item] = arr.splice(fromIndex, 1);
|
||||
arr.splice(endIndex, 0, item);
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
export { addUniqueItem, moveItem, removeItem };
|
||||
//# sourceMappingURL=array.mjs.map
|
||||
1
node_modules/motion-utils/dist/es/easing/modifiers/mirror.mjs.map
generated
vendored
Normal file
1
node_modules/motion-utils/dist/es/easing/modifiers/mirror.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"mirror.mjs","sources":["../../../../src/easing/modifiers/mirror.ts"],"sourcesContent":["// Accepts an easing function and returns a new one that outputs mirrored values for\n\nimport { EasingModifier } from \"../types\"\n\n// the second half of the animation. Turns easeIn into easeInOut.\nexport const mirrorEasing: EasingModifier = (easing) => (p) =>\n p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2\n"],"names":[],"mappings":"AAAA;AAIA;MACa,YAAY,GAAmB,CAAC,MAAM,KAAK,CAAC,CAAC,KACtD,CAAC,IAAI,GAAG,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI;;;;"}
|
||||
20
node_modules/motion-utils/dist/es/errors.mjs
generated
vendored
Normal file
20
node_modules/motion-utils/dist/es/errors.mjs
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
import { formatErrorMessage } from './format-error-message.mjs';
|
||||
|
||||
let warning = () => { };
|
||||
let invariant = () => { };
|
||||
if (typeof process !== "undefined" &&
|
||||
process.env?.NODE_ENV !== "production") {
|
||||
warning = (check, message, errorCode) => {
|
||||
if (!check && typeof console !== "undefined") {
|
||||
console.warn(formatErrorMessage(message, errorCode));
|
||||
}
|
||||
};
|
||||
invariant = (check, message, errorCode) => {
|
||||
if (!check) {
|
||||
throw new Error(formatErrorMessage(message, errorCode));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export { invariant, warning };
|
||||
//# sourceMappingURL=errors.mjs.map
|
||||
7
node_modules/motion-utils/dist/es/is-numerical-string.mjs
generated
vendored
Normal file
7
node_modules/motion-utils/dist/es/is-numerical-string.mjs
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* Check if value is a numerical string, ie a string that is purely a number eg "100" or "-100.1"
|
||||
*/
|
||||
const isNumericalString = (v) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(v);
|
||||
|
||||
export { isNumericalString };
|
||||
//# sourceMappingURL=is-numerical-string.mjs.map
|
||||
41
node_modules/motion-utils/dist/es/subscription-manager.mjs
generated
vendored
Normal file
41
node_modules/motion-utils/dist/es/subscription-manager.mjs
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
import { addUniqueItem, removeItem } from './array.mjs';
|
||||
|
||||
class SubscriptionManager {
|
||||
constructor() {
|
||||
this.subscriptions = [];
|
||||
}
|
||||
add(handler) {
|
||||
addUniqueItem(this.subscriptions, handler);
|
||||
return () => removeItem(this.subscriptions, handler);
|
||||
}
|
||||
notify(a, b, c) {
|
||||
const numSubscriptions = this.subscriptions.length;
|
||||
if (!numSubscriptions)
|
||||
return;
|
||||
if (numSubscriptions === 1) {
|
||||
/**
|
||||
* If there's only a single handler we can just call it without invoking a loop.
|
||||
*/
|
||||
this.subscriptions[0](a, b, c);
|
||||
}
|
||||
else {
|
||||
for (let i = 0; i < numSubscriptions; i++) {
|
||||
/**
|
||||
* Check whether the handler exists before firing as it's possible
|
||||
* the subscriptions were modified during this loop running.
|
||||
*/
|
||||
const handler = this.subscriptions[i];
|
||||
handler && handler(a, b, c);
|
||||
}
|
||||
}
|
||||
}
|
||||
getSize() {
|
||||
return this.subscriptions.length;
|
||||
}
|
||||
clear() {
|
||||
this.subscriptions.length = 0;
|
||||
}
|
||||
}
|
||||
|
||||
export { SubscriptionManager };
|
||||
//# sourceMappingURL=subscription-manager.mjs.map
|
||||
Reference in New Issue
Block a user