📚 Documentação inicial do ALETHEIA
- MANUAL-PRODUTO.md: Manual do usuário final - MANUAL-VENDAS.md: Estratégia comercial e vendas - MANUAL-TECNICO.md: Infraestrutura e deploy - README.md: Visão geral do projeto
This commit is contained in:
59
frontend/node_modules/framer-motion/dist/es/render/utils/motion-values.mjs
generated
vendored
Normal file
59
frontend/node_modules/framer-motion/dist/es/render/utils/motion-values.mjs
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
import { warnOnce } from '../../utils/warn-once.mjs';
|
||||
import { motionValue } from '../../value/index.mjs';
|
||||
import { isMotionValue } from '../../value/utils/is-motion-value.mjs';
|
||||
|
||||
function updateMotionValuesFromProps(element, next, prev) {
|
||||
for (const key in next) {
|
||||
const nextValue = next[key];
|
||||
const prevValue = prev[key];
|
||||
if (isMotionValue(nextValue)) {
|
||||
/**
|
||||
* If this is a motion value found in props or style, we want to add it
|
||||
* to our visual element's motion value map.
|
||||
*/
|
||||
element.addValue(key, nextValue);
|
||||
/**
|
||||
* Check the version of the incoming motion value with this version
|
||||
* and warn against mismatches.
|
||||
*/
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
warnOnce(nextValue.version === "11.18.2", `Attempting to mix Motion versions ${nextValue.version} with 11.18.2 may not work as expected.`);
|
||||
}
|
||||
}
|
||||
else if (isMotionValue(prevValue)) {
|
||||
/**
|
||||
* If we're swapping from a motion value to a static value,
|
||||
* create a new motion value from that
|
||||
*/
|
||||
element.addValue(key, motionValue(nextValue, { owner: element }));
|
||||
}
|
||||
else if (prevValue !== nextValue) {
|
||||
/**
|
||||
* If this is a flat value that has changed, update the motion value
|
||||
* or create one if it doesn't exist. We only want to do this if we're
|
||||
* not handling the value with our animation state.
|
||||
*/
|
||||
if (element.hasValue(key)) {
|
||||
const existingValue = element.getValue(key);
|
||||
if (existingValue.liveStyle === true) {
|
||||
existingValue.jump(nextValue);
|
||||
}
|
||||
else if (!existingValue.hasAnimated) {
|
||||
existingValue.set(nextValue);
|
||||
}
|
||||
}
|
||||
else {
|
||||
const latestValue = element.getStaticValue(key);
|
||||
element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element }));
|
||||
}
|
||||
}
|
||||
}
|
||||
// Handle removed values
|
||||
for (const key in prev) {
|
||||
if (next[key] === undefined)
|
||||
element.removeValue(key);
|
||||
}
|
||||
return next;
|
||||
}
|
||||
|
||||
export { updateMotionValuesFromProps };
|
||||
Reference in New Issue
Block a user