yeet
This commit is contained in:
19
node_modules/react-native-reanimated/lib/module/derived/__mocks__/evaluateOnce.js
generated
vendored
Normal file
19
node_modules/react-native-reanimated/lib/module/derived/__mocks__/evaluateOnce.js
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
import { always } from '../../base';
|
||||
export function evaluateOnce(node, children = [], callback) {
|
||||
if (!Array.isArray(children)) {
|
||||
children = [children];
|
||||
}
|
||||
|
||||
const alwaysNode = always(node);
|
||||
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
alwaysNode.__addChild(children[i]);
|
||||
}
|
||||
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
alwaysNode.__removeChild(children[i]);
|
||||
}
|
||||
|
||||
callback && callback();
|
||||
}
|
||||
//# sourceMappingURL=evaluateOnce.js.map
|
1
node_modules/react-native-reanimated/lib/module/derived/__mocks__/evaluateOnce.js.map
generated
vendored
Normal file
1
node_modules/react-native-reanimated/lib/module/derived/__mocks__/evaluateOnce.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["evaluateOnce.js"],"names":["always","evaluateOnce","node","children","callback","Array","isArray","alwaysNode","i","length","__addChild","__removeChild"],"mappings":"AAAA,SAASA,MAAT,QAAuB,YAAvB;AACA,OAAO,SAASC,YAAT,CAAsBC,IAAtB,EAA4BC,QAAQ,GAAG,EAAvC,EAA2CC,QAA3C,EAAqD;AAC1D,MAAI,CAACC,KAAK,CAACC,OAAN,CAAcH,QAAd,CAAL,EAA8B;AAC5BA,IAAAA,QAAQ,GAAG,CAACA,QAAD,CAAX;AACD;;AACD,QAAMI,UAAU,GAAGP,MAAM,CAACE,IAAD,CAAzB;;AACA,OAAK,IAAIM,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGL,QAAQ,CAACM,MAA7B,EAAqCD,CAAC,EAAtC,EAA0C;AACxCD,IAAAA,UAAU,CAACG,UAAX,CAAsBP,QAAQ,CAACK,CAAD,CAA9B;AACD;;AACD,OAAK,IAAIA,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGL,QAAQ,CAACM,MAA7B,EAAqCD,CAAC,EAAtC,EAA0C;AACxCD,IAAAA,UAAU,CAACI,aAAX,CAAyBR,QAAQ,CAACK,CAAD,CAAjC;AACD;;AACDJ,EAAAA,QAAQ,IAAIA,QAAQ,EAApB;AACD","sourcesContent":["import { always } from '../../base';\nexport function evaluateOnce(node, children = [], callback) {\n if (!Array.isArray(children)) {\n children = [children];\n }\n const alwaysNode = always(node);\n for (let i = 0; i < children.length; i++) {\n alwaysNode.__addChild(children[i]);\n }\n for (let i = 0; i < children.length; i++) {\n alwaysNode.__removeChild(children[i]);\n }\n callback && callback();\n}\n"]}
|
10
node_modules/react-native-reanimated/lib/module/derived/acc.js
generated
vendored
Normal file
10
node_modules/react-native-reanimated/lib/module/derived/acc.js
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
import { set, add, proc } from '../base';
|
||||
import AnimatedValue from '../core/InternalAnimatedValue';
|
||||
const procAcc = proc(function (v, acc) {
|
||||
return set(acc, add(acc, v));
|
||||
});
|
||||
export default function acc(v) {
|
||||
const acc = new AnimatedValue(0);
|
||||
return procAcc(v, acc);
|
||||
}
|
||||
//# sourceMappingURL=acc.js.map
|
1
node_modules/react-native-reanimated/lib/module/derived/acc.js.map
generated
vendored
Normal file
1
node_modules/react-native-reanimated/lib/module/derived/acc.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["acc.js"],"names":["set","add","proc","AnimatedValue","procAcc","v","acc"],"mappings":"AAAA,SAASA,GAAT,EAAcC,GAAd,EAAmBC,IAAnB,QAA+B,SAA/B;AACA,OAAOC,aAAP,MAA0B,+BAA1B;AAEA,MAAMC,OAAO,GAAGF,IAAI,CAAC,UAASG,CAAT,EAAYC,GAAZ,EAAiB;AACpC,SAAON,GAAG,CAACM,GAAD,EAAML,GAAG,CAACK,GAAD,EAAMD,CAAN,CAAT,CAAV;AACD,CAFmB,CAApB;AAIA,eAAe,SAASC,GAAT,CAAaD,CAAb,EAAgB;AAC7B,QAAMC,GAAG,GAAG,IAAIH,aAAJ,CAAkB,CAAlB,CAAZ;AACA,SAAOC,OAAO,CAACC,CAAD,EAAIC,GAAJ,CAAd;AACD","sourcesContent":["import { set, add, proc } from '../base';\nimport AnimatedValue from '../core/InternalAnimatedValue';\n\nconst procAcc = proc(function(v, acc) {\n return set(acc, add(acc, v));\n});\n\nexport default function acc(v) {\n const acc = new AnimatedValue(0);\n return procAcc(v, acc);\n}\n"]}
|
28
node_modules/react-native-reanimated/lib/module/derived/color.js
generated
vendored
Normal file
28
node_modules/react-native-reanimated/lib/module/derived/color.js
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
import { Platform } from 'react-native';
|
||||
import { add, cond, concat, lessThan, multiply, round, sub, proc } from '../base';
|
||||
import AnimatedNode from '../core/AnimatedNode';
|
||||
const procColor = proc(function (r, g, b, a) {
|
||||
const color = add(multiply(a, 1 << 24), multiply(round(r), 1 << 16), multiply(round(g), 1 << 8), round(b));
|
||||
|
||||
if (Platform.OS === 'android') {
|
||||
// on Android color is represented as signed 32 bit int
|
||||
return cond(lessThan(color, 1 << 31 >>> 0), color, sub(color, Math.pow(2, 32)));
|
||||
}
|
||||
|
||||
return color;
|
||||
});
|
||||
export default function color(r, g, b, a = 1) {
|
||||
if (Platform.OS === 'web') {
|
||||
// doesn't support bit shifting
|
||||
return concat('rgba(', r, ',', g, ',', b, ',', a, ')');
|
||||
}
|
||||
|
||||
if (a instanceof AnimatedNode) {
|
||||
a = round(multiply(a, 255));
|
||||
} else {
|
||||
a = Math.round(a * 255);
|
||||
}
|
||||
|
||||
return procColor(r, g, b, a);
|
||||
}
|
||||
//# sourceMappingURL=color.js.map
|
1
node_modules/react-native-reanimated/lib/module/derived/color.js.map
generated
vendored
Normal file
1
node_modules/react-native-reanimated/lib/module/derived/color.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["color.js"],"names":["Platform","add","cond","conc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GAArC,CAAb;AACD;;AAED,MAAIA,CAAC,YAAYL,YAAjB,EAA+B;AAC7BK,IAAAA,CAAC,GAAGR,KAAK,CAACD,QAAQ,CAACS,CAAD,EAAI,GAAJ,CAAT,CAAT;AACD,GAFD,MAEO;AACLA,IAAAA,CAAC,GAAGG,IAAI,CAACX,KAAL,CAAWQ,CAAC,GAAG,GAAf,CAAJ;AACD;;AAED,SAAOJ,SAAS,CAACC,CAAD,EAAIC,CAAJ,EAAOC,CAAP,EAAUC,CAAV,CAAhB;AACD","sourcesContent":["import { Platform } from 'react-native';\n\nimport { add, cond, concat, lessThan, multiply, round, sub, proc } from '../base';\nimport AnimatedNode from '../core/AnimatedNode';\n\nconst procColor = proc(function(r, g, b, a) {\n const color = add(\n multiply(a, 1 << 24),\n multiply(round(r), 1 << 16),\n multiply(round(g), 1 << 8),\n round(b)\n );\n \n if (Platform.OS === 'android') {\n // on Android color is represented as signed 32 bit int\n return cond(\n lessThan(color, (1 << 31) >>> 0),\n color,\n sub(color, Math.pow(2, 32))\n );\n }\n return color;\n});\n\nexport default function color(r, g, b, a = 1) {\n if (Platform.OS === 'web') {\n // doesn't support bit shifting\n return concat('rgba(', r, ',', g, ',', b, ',', a, ')');\n }\n\n if (a instanceof AnimatedNode) {\n a = round(multiply(a, 255));\n } else {\n a = Math.round(a * 255);\n }\n\n return procColor(r, g, b, a);\n}\n"]}
|
11
node_modules/react-native-reanimated/lib/module/derived/diff.js
generated
vendored
Normal file
11
node_modules/react-native-reanimated/lib/module/derived/diff.js
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
import { cond, block, defined, sub, set, proc } from '../base';
|
||||
import AnimatedValue from '../core/InternalAnimatedValue';
|
||||
const procDiff = proc(function (v, stash, prev) {
|
||||
return block([set(stash, cond(defined(prev), sub(v, prev), 0)), set(prev, v), stash]);
|
||||
});
|
||||
export default function diff(v) {
|
||||
const stash = new AnimatedValue(0);
|
||||
const prev = new AnimatedValue();
|
||||
return procDiff(v, stash, prev);
|
||||
}
|
||||
//# sourceMappingURL=diff.js.map
|
1
node_modules/react-native-reanimated/lib/module/derived/diff.js.map
generated
vendored
Normal file
1
node_modules/react-native-reanimated/lib/module/derived/diff.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["diff.js"],"names":["cond","block","defined","sub","set","proc","AnimatedValue","procDiff","v","stash","prev","diff"],"mappings":"AAAA,SAASA,IAAT,EAAeC,KAAf,EAAsBC,OAAtB,EAA+BC,GAA/B,EAAoCC,GAApC,EAAyCC,IAAzC,QAAqD,SAArD;AACA,OAAOC,aAAP,MAA0B,+BAA1B;AAEA,MAAMC,QAAQ,GAAGF,IAAI,CAAC,UAASG,CAAT,EAAYC,KAAZ,EAAmBC,IAAnB,EAAyB;AAC7C,SAAOT,KAAK,CAAC,CACXG,GAAG,CAACK,KAAD,EAAQT,IAAI,CAACE,OAAO,CAACQ,IAAD,CAAR,EAAgBP,GAAG,CAACK,CAAD,EAAIE,IAAJ,CAAnB,EAA8B,CAA9B,CAAZ,CADQ,EAEXN,GAAG,CAACM,IAAD,EAAOF,CAAP,CAFQ,EAGXC,KAHW,CAAD,CAAZ;AAKD,CANoB,CAArB;AAQA,eAAe,SAASE,IAAT,CAAcH,CAAd,EAAiB;AAC9B,QAAMC,KAAK,GAAG,IAAIH,aAAJ,CAAkB,CAAlB,CAAd;AACA,QAAMI,IAAI,GAAG,IAAIJ,aAAJ,EAAb;AACA,SAAOC,QAAQ,CAACC,CAAD,EAAIC,KAAJ,EAAWC,IAAX,CAAf;AACD","sourcesContent":["import { cond, block, defined, sub, set, proc } from '../base';\nimport AnimatedValue from '../core/InternalAnimatedValue';\n\nconst procDiff = proc(function(v, stash, prev) {\n return block([\n set(stash, cond(defined(prev), sub(v, prev), 0)),\n set(prev, v),\n stash,\n ]);\n});\n\nexport default function diff(v) {\n const stash = new AnimatedValue(0);\n const prev = new AnimatedValue();\n return procDiff(v, stash, prev);\n}\n"]}
|
8
node_modules/react-native-reanimated/lib/module/derived/diffClamp.js
generated
vendored
Normal file
8
node_modules/react-native-reanimated/lib/module/derived/diffClamp.js
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
import { cond, defined, set, add, min, max } from '../base';
|
||||
import AnimatedValue from '../core/InternalAnimatedValue';
|
||||
import diff from './diff';
|
||||
export default function diffClamp(a, minVal, maxVal) {
|
||||
const value = new AnimatedValue();
|
||||
return set(value, min(max(add(cond(defined(value), value, a), diff(a)), minVal), maxVal));
|
||||
}
|
||||
//# sourceMappingURL=diffClamp.js.map
|
1
node_modules/react-native-reanimated/lib/module/derived/diffClamp.js.map
generated
vendored
Normal file
1
node_modules/react-native-reanimated/lib/module/derived/diffClamp.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["diffClamp.js"],"names":["cond","defined","set","add","min","max","AnimatedValue","diff","diffClamp","a","minVal","maxVal","value"],"mappings":"AAAA,SAASA,IAAT,EAAeC,OAAf,EAAwBC,GAAxB,EAA6BC,GAA7B,EAAkCC,GAAlC,EAAuCC,GAAvC,QAAkD,SAAlD;AACA,OAAOC,aAAP,MAA0B,+BAA1B;AACA,OAAOC,IAAP,MAAiB,QAAjB;AAEA,eAAe,SAASC,SAAT,CAAmBC,CAAnB,EAAsBC,MAAtB,EAA8BC,MAA9B,EAAsC;AACnD,QAAMC,KAAK,GAAG,IAAIN,aAAJ,EAAd;AACA,SAAOJ,GAAG,CACRU,KADQ,EAERR,GAAG,CAACC,GAAG,CAACF,GAAG,CAACH,IAAI,CAACC,OAAO,CAACW,KAAD,CAAR,EAAiBA,KAAjB,EAAwBH,CAAxB,CAAL,EAAiCF,IAAI,CAACE,CAAD,CAArC,CAAJ,EAA+CC,MAA/C,CAAJ,EAA4DC,MAA5D,CAFK,CAAV;AAID","sourcesContent":["import { cond, defined, set, add, min, max } from '../base';\nimport AnimatedValue from '../core/InternalAnimatedValue';\nimport diff from './diff';\n\nexport default function diffClamp(a, minVal, maxVal) {\n const value = new AnimatedValue();\n return set(\n value,\n min(max(add(cond(defined(value), value, a), diff(a)), minVal), maxVal)\n );\n}\n"]}
|
36
node_modules/react-native-reanimated/lib/module/derived/evaluateOnce.js
generated
vendored
Normal file
36
node_modules/react-native-reanimated/lib/module/derived/evaluateOnce.js
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
import AnimatedValue from '../core/InternalAnimatedValue';
|
||||
import { createAnimatedSet as set } from '../core/AnimatedSet';
|
||||
import { createAnimatedCall as call } from '../core/AnimatedCall';
|
||||
import { createAnimatedAlways as always } from '../core/AnimatedAlways';
|
||||
import { createAnimatedCond as cond } from '../core/AnimatedCond';
|
||||
/**
|
||||
* evaluate given node and notify children
|
||||
* @param node - node to be evaluated
|
||||
* @param input - nodes (or one node) representing values which states input for node.
|
||||
* @param callback - after callback
|
||||
*/
|
||||
|
||||
export function evaluateOnce(node, input = [], callback) {
|
||||
if (!Array.isArray(input)) {
|
||||
input = [input];
|
||||
}
|
||||
|
||||
const done = new AnimatedValue(0);
|
||||
const evalNode = cond(done, 0, call([node, set(done, 1)], () => {
|
||||
callback && callback();
|
||||
|
||||
for (let i = 0; i < input.length; i++) {
|
||||
input[i].__removeChild(alwaysNode);
|
||||
|
||||
alwaysNode.__detach();
|
||||
}
|
||||
}));
|
||||
const alwaysNode = always(evalNode);
|
||||
|
||||
for (let i = 0; i < input.length; i++) {
|
||||
input[i].__addChild(alwaysNode);
|
||||
|
||||
alwaysNode.__attach();
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=evaluateOnce.js.map
|
1
node_modules/react-native-reanimated/lib/module/derived/evaluateOnce.js.map
generated
vendored
Normal file
1
node_modules/react-native-reanimated/lib/module/derived/evaluateOnce.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["evaluateOnce.js"],"names":["AnimatedValue","createAnimatedSet","set","createAnimatedCall","call","createAnimatedAlways","always","createAnimatedCond","cond","evaluateOnce","node","input","callback","Array","isArray","done","evalNode","i","length","__removeChild","alwaysN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ourcesContent":["import AnimatedValue from '../core/InternalAnimatedValue';\nimport { createAnimatedSet as set } from '../core/AnimatedSet';\nimport { createAnimatedCall as call } from '../core/AnimatedCall';\nimport { createAnimatedAlways as always } from '../core/AnimatedAlways';\nimport { createAnimatedCond as cond } from '../core/AnimatedCond';\n\n/**\n * evaluate given node and notify children\n * @param node - node to be evaluated\n * @param input - nodes (or one node) representing values which states input for node.\n * @param callback - after callback\n */\n\nexport function evaluateOnce(node, input = [], callback) {\n if (!Array.isArray(input)) {\n input = [input];\n }\n const done = new AnimatedValue(0);\n const evalNode = cond(\n done,\n 0,\n call([node, set(done, 1)], () => {\n callback && callback();\n for (let i = 0; i < input.length; i++) {\n input[i].__removeChild(alwaysNode);\n alwaysNode.__detach();\n }\n })\n );\n const alwaysNode = always(evalNode);\n for (let i = 0; i < input.length; i++) {\n input[i].__addChild(alwaysNode);\n alwaysNode.__attach();\n }\n}\n"]}
|
9
node_modules/react-native-reanimated/lib/module/derived/index.js
generated
vendored
Normal file
9
node_modules/react-native-reanimated/lib/module/derived/index.js
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
export { default as acc } from './acc';
|
||||
export { default as color } from './color';
|
||||
export { default as diff } from './diff';
|
||||
export { default as diffClamp } from './diffClamp';
|
||||
export { default as interpolate, Extrapolate } from './interpolate';
|
||||
export { default as interpolateColors } from './interpolateColors';
|
||||
export { default as onChange } from './onChange';
|
||||
export { default as useCode } from './useCode';
|
||||
//# sourceMappingURL=index.js.map
|
1
node_modules/react-native-reanimated/lib/module/derived/index.js.map
generated
vendored
Normal file
1
node_modules/react-native-reanimated/lib/module/derived/index.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["index.js"],"names":["default","acc","color","diff","diffClamp","interpolate","Extrapolate","interpolateColors","onChange","useCode"],"mappings":"AAAA,SAASA,OAAO,IAAIC,GAApB,QAA+B,OAA/B;AACA,SAASD,OAAO,IAAIE,KAApB,QAAiC,SAAjC;AACA,SAASF,OAAO,IAAIG,IAApB,QAAgC,QAAhC;AACA,SAASH,OAAO,IAAII,SAApB,QAAqC,aAArC;AACA,SAASJ,OAAO,IAAIK,WAApB,EAAiCC,WAAjC,QAAoD,eAApD;AACA,SAASN,OAAO,IAAIO,iBAApB,QAA6C,qBAA7C;AACA,SAASP,OAAO,IAAIQ,QAApB,QAAoC,YAApC;AACA,SAASR,OAAO,IAAIS,OAApB,QAAmC,WAAnC","sourcesContent":["export { default as acc } from './acc';\nexport { default as color } from './color';\nexport { default as diff } from './diff';\nexport { default as diffClamp } from './diffClamp';\nexport { default as interpolate, Extrapolate } from './interpolate';\nexport { default as interpolateColors } from './interpolateColors';\nexport { default as onChange } from './onChange';\nexport { default as useCode } from './useCode';\n"]}
|
99
node_modules/react-native-reanimated/lib/module/derived/interpolate.js
generated
vendored
Normal file
99
node_modules/react-native-reanimated/lib/module/derived/interpolate.js
generated
vendored
Normal file
@ -0,0 +1,99 @@
|
||||
import { lessThan, multiply, sub, add, divide, greaterThan, lessOrEq, eq } from '../operators';
|
||||
import invariant from 'fbjs/lib/invariant';
|
||||
import AnimatedNode from '../core/AnimatedNode';
|
||||
import { createAnimatedCond as cond } from '../core/AnimatedCond';
|
||||
import { createAnimatedFunction as proc } from '../core/AnimatedFunction';
|
||||
const interpolateInternalSingleProc = proc(function (value, inS, inE, outS, outE) {
|
||||
const progress = divide(sub(value, inS), sub(inE, inS)); // logic below was made in order to provide a compatibility witn an Animated API
|
||||
|
||||
const resultForNonZeroRange = add(outS, multiply(progress, sub(outE, outS)));
|
||||
const result = cond(eq(inS, inE), cond(lessOrEq(value, inS), outS, outE), resultForNonZeroRange);
|
||||
return result;
|
||||
});
|
||||
|
||||
function interpolateInternalSingle(value, inputRange, outputRange, offset) {
|
||||
const inS = inputRange[offset];
|
||||
const inE = inputRange[offset + 1];
|
||||
const outS = outputRange[offset];
|
||||
const outE = outputRange[offset + 1];
|
||||
return interpolateInternalSingleProc(value, inS, inE, outS, outE);
|
||||
}
|
||||
|
||||
function interpolateInternal(value, inputRange, outputRange, offset = 0) {
|
||||
if (inputRange.length - offset === 2) {
|
||||
return interpolateInternalSingle(value, inputRange, outputRange, offset);
|
||||
}
|
||||
|
||||
return cond(lessThan(value, inputRange[offset + 1]), interpolateInternalSingle(value, inputRange, outputRange, offset), interpolateInternal(value, inputRange, outputRange, offset + 1));
|
||||
}
|
||||
|
||||
export const Extrapolate = {
|
||||
EXTEND: 'extend',
|
||||
CLAMP: 'clamp',
|
||||
IDENTITY: 'identity'
|
||||
};
|
||||
|
||||
function checkNonDecreasing(name, arr) {
|
||||
for (let i = 1; i < arr.length; ++i) {
|
||||
// We can't validate animated nodes in JS.
|
||||
if (arr[i] instanceof AnimatedNode || arr[i - 1] instanceof AnimatedNode) continue;
|
||||
invariant(arr[i] >= arr[i - 1], '%s must be monotonically non-decreasing. (%s)', name, arr);
|
||||
}
|
||||
}
|
||||
|
||||
function checkMinElements(name, arr) {
|
||||
invariant(arr.length >= 2, '%s must have at least 2 elements. (%s)', name, arr);
|
||||
}
|
||||
|
||||
function checkValidNumbers(name, arr) {
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
// We can't validate animated nodes in JS.
|
||||
if (arr[i] instanceof AnimatedNode || typeof arr[i] !== 'number') continue;
|
||||
invariant(Number.isFinite(arr[i]), '%s cannot include %s. (%s)', name, arr[i], arr);
|
||||
}
|
||||
}
|
||||
|
||||
function convertToRadians(outputRange) {
|
||||
for (const [i, value] of outputRange.entries()) {
|
||||
if (typeof value === 'string' && value.endsWith('deg')) {
|
||||
outputRange[i] = parseFloat(value) * (Math.PI / 180);
|
||||
} else if (typeof value === 'string' && value.endsWith('rad')) {
|
||||
outputRange[i] = parseFloat(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default function interpolate(value, config) {
|
||||
const {
|
||||
inputRange,
|
||||
outputRange,
|
||||
extrapolate = Extrapolate.EXTEND,
|
||||
extrapolateLeft,
|
||||
extrapolateRight
|
||||
} = config;
|
||||
checkMinElements('inputRange', inputRange);
|
||||
checkValidNumbers('inputRange', inputRange);
|
||||
checkMinElements('outputRange', outputRange);
|
||||
checkValidNumbers('outputRange', outputRange);
|
||||
checkNonDecreasing('inputRange', inputRange);
|
||||
invariant(inputRange.length === outputRange.length, 'inputRange and outputRange must be the same length.');
|
||||
convertToRadians(outputRange);
|
||||
const left = extrapolateLeft || extrapolate;
|
||||
const right = extrapolateRight || extrapolate;
|
||||
let output = interpolateInternal(value, inputRange, outputRange);
|
||||
|
||||
if (left === Extrapolate.EXTEND) {} else if (left === Extrapolate.CLAMP) {
|
||||
output = cond(lessThan(value, inputRange[0]), outputRange[0], output);
|
||||
} else if (left === Extrapolate.IDENTITY) {
|
||||
output = cond(lessThan(value, inputRange[0]), value, output);
|
||||
}
|
||||
|
||||
if (right === Extrapolate.EXTEND) {} else if (right === Extrapolate.CLAMP) {
|
||||
output = cond(greaterThan(value, inputRange[inputRange.length - 1]), outputRange[outputRange.length - 1], output);
|
||||
} else if (right === Extrapolate.IDENTITY) {
|
||||
output = cond(greaterThan(value, inputRange[inputRange.length - 1]), value, output);
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
//# sourceMappingURL=interpolate.js.map
|
1
node_modules/react-native-reanimated/lib/module/derived/interpolate.js.map
generated
vendored
Normal file
1
node_modules/react-native-reanimated/lib/module/derived/interpolate.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
62
node_modules/react-native-reanimated/lib/module/derived/interpolateColors.js
generated
vendored
Normal file
62
node_modules/react-native-reanimated/lib/module/derived/interpolateColors.js
generated
vendored
Normal file
@ -0,0 +1,62 @@
|
||||
import { processColor } from 'react-native';
|
||||
import { round } from '../base';
|
||||
import color from './color';
|
||||
import interpolate, { Extrapolate } from './interpolate';
|
||||
|
||||
function red(c) {
|
||||
return c >> 16 & 255;
|
||||
}
|
||||
|
||||
function green(c) {
|
||||
return c >> 8 & 255;
|
||||
}
|
||||
|
||||
function blue(c) {
|
||||
return c & 255;
|
||||
}
|
||||
|
||||
function opacity(c) {
|
||||
return (c >> 24 & 255) / 255;
|
||||
}
|
||||
/**
|
||||
* Use this if you want to interpolate an `Animated.Value` into color values.
|
||||
*
|
||||
* #### Why is this needed?
|
||||
*
|
||||
* Unfortunately, if you'll pass color values directly into the `outputRange` option
|
||||
* of `interpolate()` function, that won't really work (at least at the moment).
|
||||
* See https://github.com/software-mansion/react-native-reanimated/issues/181 .
|
||||
*
|
||||
* So, for now you can just use this helper instead.
|
||||
*/
|
||||
|
||||
|
||||
export default function interpolateColors(animationValue, options) {
|
||||
const {
|
||||
inputRange,
|
||||
outputColorRange
|
||||
} = options;
|
||||
const colors = outputColorRange.map(processColor);
|
||||
const r = round(interpolate(animationValue, {
|
||||
inputRange,
|
||||
outputRange: colors.map(red),
|
||||
extrapolate: Extrapolate.CLAMP
|
||||
}));
|
||||
const g = round(interpolate(animationValue, {
|
||||
inputRange,
|
||||
outputRange: colors.map(green),
|
||||
extrapolate: Extrapolate.CLAMP
|
||||
}));
|
||||
const b = round(interpolate(animationValue, {
|
||||
inputRange,
|
||||
outputRange: colors.map(blue),
|
||||
extrapolate: Extrapolate.CLAMP
|
||||
}));
|
||||
const a = interpolate(animationValue, {
|
||||
inputRange,
|
||||
outputRange: colors.map(opacity),
|
||||
extrapolate: Extrapolate.CLAMP
|
||||
});
|
||||
return color(r, g, b, a);
|
||||
}
|
||||
//# sourceMappingURL=interpolateColors.js.map
|
1
node_modules/react-native-reanimated/lib/module/derived/interpolateColors.js.map
generated
vendored
Normal file
1
node_modules/react-native-reanimated/lib/module/derived/interpolateColors.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["interpolateColors.js"],"names":["processColor","round","color","interpolate","Extrapolate","red","c","green","blue","opacity","interpolateColors","animationValue","options","inputRange","outputColorRange","colors","map","r","outputRange","extrapolate","CLAMP","g","b","a"],"mappings":"AAAA,SAASA,YAAT,QAA6B,cAA7B;AACA,SAASC,KAAT,QAAsB,SAAtB;AACA,OA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CAAWR,IAAX,CAFa;AAG1BW,IAAAA,WAAW,EAAEf,WAAW,CAACgB;AAHC,GAAjB,CADE,CAAf;AAOA,QAAMG,CAAC,GAAGpB,WAAW,CAACQ,cAAD,EAAiB;AACpCE,IAAAA,UADoC;AAEpCK,IAAAA,WAAW,EAAEH,MAAM,CAACC,GAAP,CAAWP,OAAX,CAFuB;AAGpCU,IAAAA,WAAW,EAAEf,WAAW,CAACgB;AAHW,GAAjB,CAArB;AAMA,SAAOlB,KAAK,CAACe,CAAD,EAAII,CAAJ,EAAOC,CAAP,EAAUC,CAAV,CAAZ;AACD","sourcesContent":["import { processColor } from 'react-native';\nimport { round } from '../base';\nimport color from './color';\nimport interpolate, { Extrapolate } from './interpolate';\n\nfunction red(c) {\n return (c >> 16) & 255;\n}\nfunction green(c) {\n return (c >> 8) & 255;\n}\nfunction blue(c) {\n return c & 255;\n}\nfunction opacity(c) {\n return ((c >> 24) & 255) / 255;\n}\n\n/**\n * Use this if you want to interpolate an `Animated.Value` into color values.\n *\n * #### Why is this needed?\n *\n * Unfortunately, if you'll pass color values directly into the `outputRange` option\n * of `interpolate()` function, that won't really work (at least at the moment).\n * See https://github.com/software-mansion/react-native-reanimated/issues/181 .\n *\n * So, for now you can just use this helper instead.\n */\nexport default function interpolateColors(animationValue, options) {\n const { inputRange, outputColorRange } = options;\n const colors = outputColorRange.map(processColor);\n\n const r = round(\n interpolate(animationValue, {\n inputRange,\n outputRange: colors.map(red),\n extrapolate: Extrapolate.CLAMP,\n })\n );\n const g = round(\n interpolate(animationValue, {\n inputRange,\n outputRange: colors.map(green),\n extrapolate: Extrapolate.CLAMP,\n })\n );\n const b = round(\n interpolate(animationValue, {\n inputRange,\n outputRange: colors.map(blue),\n extrapolate: Extrapolate.CLAMP,\n })\n );\n const a = interpolate(animationValue, {\n inputRange,\n outputRange: colors.map(opacity),\n extrapolate: Extrapolate.CLAMP,\n });\n\n return color(r, g, b, a);\n}\n"]}
|
10
node_modules/react-native-reanimated/lib/module/derived/onChange.js
generated
vendored
Normal file
10
node_modules/react-native-reanimated/lib/module/derived/onChange.js
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
import { block, cond, defined, neq, not, set, proc } from '../base';
|
||||
import AnimatedValue from '../core/InternalAnimatedValue';
|
||||
const procOnChange = proc(function (value, action, prevValue) {
|
||||
return block([cond(not(defined(prevValue)), set(prevValue, value)), cond(neq(value, prevValue), [set(prevValue, value), action])]);
|
||||
});
|
||||
export default function onChange(value, action) {
|
||||
const prevValue = new AnimatedValue();
|
||||
return procOnChange(value, action, prevValue);
|
||||
}
|
||||
//# sourceMappingURL=onChange.js.map
|
1
node_modules/react-native-reanimated/lib/module/derived/onChange.js.map
generated
vendored
Normal file
1
node_modules/react-native-reanimated/lib/module/derived/onChange.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["onChange.js"],"names":["block","cond","defined","neq","not","set","proc","AnimatedValue","procOnChange","value","action","prevValue","onChange"],"mappings":"AAAA,SAASA,KAAT,EAAgBC,IAAhB,EAAsBC,OAAtB,EAA+BC,GAA/B,EAAoCC,GAApC,EAAyCC,GAAzC,EAA8CC,IAA9C,QAA0D,SAA1D;AACA,OAAOC,aAAP,MAA0B,+BAA1B;AAEA,MAAMC,YAAY,GAAGF,IAAI,CAAC,UAASG,KAAT,EAAgBC,MAAhB,EAAwBC,SAAxB,EAAmC;AAC3D,SAAOX,KAAK,CAAC,CACXC,IAAI,CAACG,GAAG,CAACF,OAAO,CAACS,SAAD,CAAR,CAAJ,EAA0BN,GAAG,CAACM,SAAD,EAAYF,KAAZ,CAA7B,CADO,EAEXR,IAAI,CAACE,GAAG,CAACM,KAAD,EAAQE,SAAR,CAAJ,EAAwB,CAACN,GAAG,CAACM,SAAD,EAAYF,KAAZ,CAAJ,EAAwBC,MAAxB,CAAxB,CAFO,CAAD,CAAZ;AAID,CALwB,CAAzB;AAOA,eAAe,SAASE,QAAT,CAAkBH,KAAlB,EAAyBC,MAAzB,EAAiC;AAC9C,QAAMC,SAAS,GAAG,IAAIJ,aAAJ,EAAlB;AACA,SAAOC,YAAY,CAACC,KAAD,EAAQC,MAAR,EAAgBC,SAAhB,CAAnB;AACD","sourcesContent":["import { block, cond, defined, neq, not, set, proc } from '../base';\nimport AnimatedValue from '../core/InternalAnimatedValue';\n\nconst procOnChange = proc(function(value, action, prevValue) {\n return block([\n cond(not(defined(prevValue)), set(prevValue, value)),\n cond(neq(value, prevValue), [set(prevValue, value), action]),\n ]);\n});\n\nexport default function onChange(value, action) {\n const prevValue = new AnimatedValue();\n return procOnChange(value, action, prevValue);\n}\n"]}
|
40
node_modules/react-native-reanimated/lib/module/derived/useCode.js
generated
vendored
Normal file
40
node_modules/react-native-reanimated/lib/module/derived/useCode.js
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
import React from 'react';
|
||||
import { always, block } from '../base';
|
||||
/**
|
||||
* @callback NodeFactory
|
||||
* Function to create a node or an array of nodes.
|
||||
* @returns {(Node[] | Node | null | undefined | Boolean)}
|
||||
*/
|
||||
|
||||
/**
|
||||
* React hook to run a node.
|
||||
* @param {NodeFactory} nodeFactory Function to build the node to run.
|
||||
* @param dependencies Array of dependencies. Refresh the node on changes.
|
||||
*/
|
||||
|
||||
export default function useCode(nodeFactory, dependencies) {
|
||||
if (!(React.useEffect instanceof Function)) return;
|
||||
React.useEffect(() => {
|
||||
// check and correct 1st parameter
|
||||
if (!(nodeFactory instanceof Function)) {
|
||||
console.warn('useCode() first argument should be a function that returns an animation node.');
|
||||
const node = nodeFactory;
|
||||
|
||||
nodeFactory = () => node;
|
||||
}
|
||||
|
||||
let node = nodeFactory();
|
||||
|
||||
if (node) {
|
||||
// allow factory to return array
|
||||
if (node instanceof Array) node = block(node);
|
||||
const animatedAlways = always(node);
|
||||
|
||||
animatedAlways.__attach(); // return undo function
|
||||
|
||||
|
||||
return () => animatedAlways.__detach();
|
||||
}
|
||||
}, dependencies);
|
||||
}
|
||||
//# sourceMappingURL=useCode.js.map
|
1
node_modules/react-native-reanimated/lib/module/derived/useCode.js.map
generated
vendored
Normal file
1
node_modules/react-native-reanimated/lib/module/derived/useCode.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["useCode.js"],"names":["React","always","block","useCode","nodeFactory","dependencies","useEffect","Function","console","warn","node","Array","animatedAlways","__attach","__detach"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,MAAT,EAAiBC,KAAjB,QAA8B,SAA9B;AAEA;;;;;;AAMA;;;;;;AAKA,eAAe,SAASC,OAAT,CAAiBC,WAAjB,EAA8BC,YAA9B,EAA4C;AACzD,MAAI,EAAEL,KAAK,CAACM,SAAN,YAA2BC,QAA7B,CAAJ,EAA4C;AAE5CP,EAAAA,KAAK,CAACM,SAAN,CAAgB,MAAM;AACpB;AACA,QAAI,EAAEF,WAAW,YAAYG,QAAzB,CAAJ,EAAwC;AACtCC,MAAAA,OAAO,CAACC,IAAR,CACE,+EADF;AAIA,YAAMC,IAAI,GAAGN,WAAb;;AACAA,MAAAA,WAAW,GAAG,MAAMM,IAApB;AACD;;AAED,QAAIA,IAAI,GAAGN,WAAW,EAAtB;;AACA,QAAIM,IAAJ,EAAU;AACR;AACA,UAAIA,IAAI,YAAYC,KAApB,EAA2BD,IAAI,GAAGR,KAAK,CAACQ,IAAD,CAAZ;AAE3B,YAAME,cAAc,GAAGX,MAAM,CAACS,IAAD,CAA7B;;AACAE,MAAAA,cAAc,CAACC,QAAf,GALQ,CAOR;;;AACA,aAAO,MAAMD,cAAc,CAACE,QAAf,EAAb;AACD;AACF,GAtBD,EAsBGT,YAtBH;AAuBD","sourcesContent":["import React from 'react';\nimport { always, block } from '../base';\n\n/**\n * @callback NodeFactory\n * Function to create a node or an array of nodes.\n * @returns {(Node[] | Node | null | undefined | Boolean)}\n */\n\n/**\n * React hook to run a node.\n * @param {NodeFactory} nodeFactory Function to build the node to run.\n * @param dependencies Array of dependencies. Refresh the node on changes.\n */\nexport default function useCode(nodeFactory, dependencies) {\n if (!(React.useEffect instanceof Function)) return;\n\n React.useEffect(() => {\n // check and correct 1st parameter\n if (!(nodeFactory instanceof Function)) {\n console.warn(\n 'useCode() first argument should be a function that returns an animation node.'\n );\n\n const node = nodeFactory;\n nodeFactory = () => node;\n }\n\n let node = nodeFactory();\n if (node) {\n // allow factory to return array\n if (node instanceof Array) node = block(node);\n\n const animatedAlways = always(node);\n animatedAlways.__attach();\n\n // return undo function\n return () => animatedAlways.__detach();\n }\n }, dependencies);\n}\n"]}
|
Reference in New Issue
Block a user