Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu.../js/dist
File: components.js
[21500] Fix | Delete
[21501] Fix | Delete
[21502] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/setters.mjs
[21503] Fix | Delete
[21504] Fix | Delete
[21505] Fix | Delete
[21506] Fix | Delete
[21507] Fix | Delete
/**
[21508] Fix | Delete
* Set VisualElement's MotionValue, creating a new MotionValue for it if
[21509] Fix | Delete
* it doesn't exist.
[21510] Fix | Delete
*/
[21511] Fix | Delete
function setMotionValue(visualElement, key, value) {
[21512] Fix | Delete
if (visualElement.hasValue(key)) {
[21513] Fix | Delete
visualElement.getValue(key).set(value);
[21514] Fix | Delete
}
[21515] Fix | Delete
else {
[21516] Fix | Delete
visualElement.addValue(key, motionValue(value));
[21517] Fix | Delete
}
[21518] Fix | Delete
}
[21519] Fix | Delete
function setTarget(visualElement, definition) {
[21520] Fix | Delete
const resolved = resolveVariant(visualElement, definition);
[21521] Fix | Delete
let { transitionEnd = {}, transition = {}, ...target } = resolved || {};
[21522] Fix | Delete
target = { ...target, ...transitionEnd };
[21523] Fix | Delete
for (const key in target) {
[21524] Fix | Delete
const value = resolveFinalValueInKeyframes(target[key]);
[21525] Fix | Delete
setMotionValue(visualElement, key, value);
[21526] Fix | Delete
}
[21527] Fix | Delete
}
[21528] Fix | Delete
[21529] Fix | Delete
[21530] Fix | Delete
[21531] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs
[21532] Fix | Delete
[21533] Fix | Delete
[21534] Fix | Delete
[21535] Fix | Delete
[21536] Fix | Delete
[21537] Fix | Delete
[21538] Fix | Delete
[21539] Fix | Delete
[21540] Fix | Delete
/**
[21541] Fix | Delete
* Decide whether we should block this animation. Previously, we achieved this
[21542] Fix | Delete
* just by checking whether the key was listed in protectedKeys, but this
[21543] Fix | Delete
* posed problems if an animation was triggered by afterChildren and protectedKeys
[21544] Fix | Delete
* had been set to true in the meantime.
[21545] Fix | Delete
*/
[21546] Fix | Delete
function shouldBlockAnimation({ protectedKeys, needsAnimating }, key) {
[21547] Fix | Delete
const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true;
[21548] Fix | Delete
needsAnimating[key] = false;
[21549] Fix | Delete
return shouldBlock;
[21550] Fix | Delete
}
[21551] Fix | Delete
function animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) {
[21552] Fix | Delete
var _a;
[21553] Fix | Delete
let { transition = visualElement.getDefaultTransition(), transitionEnd, ...target } = targetAndTransition;
[21554] Fix | Delete
const willChange = visualElement.getValue("willChange");
[21555] Fix | Delete
if (transitionOverride)
[21556] Fix | Delete
transition = transitionOverride;
[21557] Fix | Delete
const animations = [];
[21558] Fix | Delete
const animationTypeState = type &&
[21559] Fix | Delete
visualElement.animationState &&
[21560] Fix | Delete
visualElement.animationState.getState()[type];
[21561] Fix | Delete
for (const key in target) {
[21562] Fix | Delete
const value = visualElement.getValue(key, (_a = visualElement.latestValues[key]) !== null && _a !== void 0 ? _a : null);
[21563] Fix | Delete
const valueTarget = target[key];
[21564] Fix | Delete
if (valueTarget === undefined ||
[21565] Fix | Delete
(animationTypeState &&
[21566] Fix | Delete
shouldBlockAnimation(animationTypeState, key))) {
[21567] Fix | Delete
continue;
[21568] Fix | Delete
}
[21569] Fix | Delete
const valueTransition = {
[21570] Fix | Delete
delay,
[21571] Fix | Delete
elapsed: 0,
[21572] Fix | Delete
...getValueTransition(transition || {}, key),
[21573] Fix | Delete
};
[21574] Fix | Delete
/**
[21575] Fix | Delete
* If this is the first time a value is being animated, check
[21576] Fix | Delete
* to see if we're handling off from an existing animation.
[21577] Fix | Delete
*/
[21578] Fix | Delete
let isHandoff = false;
[21579] Fix | Delete
if (window.HandoffAppearAnimations) {
[21580] Fix | Delete
const props = visualElement.getProps();
[21581] Fix | Delete
const appearId = props[optimizedAppearDataAttribute];
[21582] Fix | Delete
if (appearId) {
[21583] Fix | Delete
const elapsed = window.HandoffAppearAnimations(appearId, key, value, frame_frame);
[21584] Fix | Delete
if (elapsed !== null) {
[21585] Fix | Delete
valueTransition.elapsed = elapsed;
[21586] Fix | Delete
isHandoff = true;
[21587] Fix | Delete
}
[21588] Fix | Delete
}
[21589] Fix | Delete
}
[21590] Fix | Delete
value.start(animateMotionValue(key, value, valueTarget, visualElement.shouldReduceMotion && transformProps.has(key)
[21591] Fix | Delete
? { type: false }
[21592] Fix | Delete
: valueTransition, visualElement, isHandoff));
[21593] Fix | Delete
const animation = value.animation;
[21594] Fix | Delete
if (animation) {
[21595] Fix | Delete
if (isWillChangeMotionValue(willChange)) {
[21596] Fix | Delete
willChange.add(key);
[21597] Fix | Delete
animation.then(() => willChange.remove(key));
[21598] Fix | Delete
}
[21599] Fix | Delete
animations.push(animation);
[21600] Fix | Delete
}
[21601] Fix | Delete
}
[21602] Fix | Delete
if (transitionEnd) {
[21603] Fix | Delete
Promise.all(animations).then(() => {
[21604] Fix | Delete
frame_frame.update(() => {
[21605] Fix | Delete
transitionEnd && setTarget(visualElement, transitionEnd);
[21606] Fix | Delete
});
[21607] Fix | Delete
});
[21608] Fix | Delete
}
[21609] Fix | Delete
return animations;
[21610] Fix | Delete
}
[21611] Fix | Delete
[21612] Fix | Delete
[21613] Fix | Delete
[21614] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/interfaces/visual-element-variant.mjs
[21615] Fix | Delete
[21616] Fix | Delete
[21617] Fix | Delete
[21618] Fix | Delete
function animateVariant(visualElement, variant, options = {}) {
[21619] Fix | Delete
var _a;
[21620] Fix | Delete
const resolved = resolveVariant(visualElement, variant, options.type === "exit"
[21621] Fix | Delete
? (_a = visualElement.presenceContext) === null || _a === void 0 ? void 0 : _a.custom
[21622] Fix | Delete
: undefined);
[21623] Fix | Delete
let { transition = visualElement.getDefaultTransition() || {} } = resolved || {};
[21624] Fix | Delete
if (options.transitionOverride) {
[21625] Fix | Delete
transition = options.transitionOverride;
[21626] Fix | Delete
}
[21627] Fix | Delete
/**
[21628] Fix | Delete
* If we have a variant, create a callback that runs it as an animation.
[21629] Fix | Delete
* Otherwise, we resolve a Promise immediately for a composable no-op.
[21630] Fix | Delete
*/
[21631] Fix | Delete
const getAnimation = resolved
[21632] Fix | Delete
? () => Promise.all(animateTarget(visualElement, resolved, options))
[21633] Fix | Delete
: () => Promise.resolve();
[21634] Fix | Delete
/**
[21635] Fix | Delete
* If we have children, create a callback that runs all their animations.
[21636] Fix | Delete
* Otherwise, we resolve a Promise immediately for a composable no-op.
[21637] Fix | Delete
*/
[21638] Fix | Delete
const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size
[21639] Fix | Delete
? (forwardDelay = 0) => {
[21640] Fix | Delete
const { delayChildren = 0, staggerChildren, staggerDirection, } = transition;
[21641] Fix | Delete
return animateChildren(visualElement, variant, delayChildren + forwardDelay, staggerChildren, staggerDirection, options);
[21642] Fix | Delete
}
[21643] Fix | Delete
: () => Promise.resolve();
[21644] Fix | Delete
/**
[21645] Fix | Delete
* If the transition explicitly defines a "when" option, we need to resolve either
[21646] Fix | Delete
* this animation or all children animations before playing the other.
[21647] Fix | Delete
*/
[21648] Fix | Delete
const { when } = transition;
[21649] Fix | Delete
if (when) {
[21650] Fix | Delete
const [first, last] = when === "beforeChildren"
[21651] Fix | Delete
? [getAnimation, getChildAnimations]
[21652] Fix | Delete
: [getChildAnimations, getAnimation];
[21653] Fix | Delete
return first().then(() => last());
[21654] Fix | Delete
}
[21655] Fix | Delete
else {
[21656] Fix | Delete
return Promise.all([getAnimation(), getChildAnimations(options.delay)]);
[21657] Fix | Delete
}
[21658] Fix | Delete
}
[21659] Fix | Delete
function animateChildren(visualElement, variant, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) {
[21660] Fix | Delete
const animations = [];
[21661] Fix | Delete
const maxStaggerDuration = (visualElement.variantChildren.size - 1) * staggerChildren;
[21662] Fix | Delete
const generateStaggerDuration = staggerDirection === 1
[21663] Fix | Delete
? (i = 0) => i * staggerChildren
[21664] Fix | Delete
: (i = 0) => maxStaggerDuration - i * staggerChildren;
[21665] Fix | Delete
Array.from(visualElement.variantChildren)
[21666] Fix | Delete
.sort(sortByTreeOrder)
[21667] Fix | Delete
.forEach((child, i) => {
[21668] Fix | Delete
child.notify("AnimationStart", variant);
[21669] Fix | Delete
animations.push(animateVariant(child, variant, {
[21670] Fix | Delete
...options,
[21671] Fix | Delete
delay: delayChildren + generateStaggerDuration(i),
[21672] Fix | Delete
}).then(() => child.notify("AnimationComplete", variant)));
[21673] Fix | Delete
});
[21674] Fix | Delete
return Promise.all(animations);
[21675] Fix | Delete
}
[21676] Fix | Delete
function sortByTreeOrder(a, b) {
[21677] Fix | Delete
return a.sortNodePosition(b);
[21678] Fix | Delete
}
[21679] Fix | Delete
[21680] Fix | Delete
[21681] Fix | Delete
[21682] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/interfaces/visual-element.mjs
[21683] Fix | Delete
[21684] Fix | Delete
[21685] Fix | Delete
[21686] Fix | Delete
[21687] Fix | Delete
[21688] Fix | Delete
function animateVisualElement(visualElement, definition, options = {}) {
[21689] Fix | Delete
visualElement.notify("AnimationStart", definition);
[21690] Fix | Delete
let animation;
[21691] Fix | Delete
if (Array.isArray(definition)) {
[21692] Fix | Delete
const animations = definition.map((variant) => animateVariant(visualElement, variant, options));
[21693] Fix | Delete
animation = Promise.all(animations);
[21694] Fix | Delete
}
[21695] Fix | Delete
else if (typeof definition === "string") {
[21696] Fix | Delete
animation = animateVariant(visualElement, definition, options);
[21697] Fix | Delete
}
[21698] Fix | Delete
else {
[21699] Fix | Delete
const resolvedDefinition = typeof definition === "function"
[21700] Fix | Delete
? resolveVariant(visualElement, definition, options.custom)
[21701] Fix | Delete
: definition;
[21702] Fix | Delete
animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options));
[21703] Fix | Delete
}
[21704] Fix | Delete
return animation.then(() => {
[21705] Fix | Delete
frame_frame.postRender(() => {
[21706] Fix | Delete
visualElement.notify("AnimationComplete", definition);
[21707] Fix | Delete
});
[21708] Fix | Delete
});
[21709] Fix | Delete
}
[21710] Fix | Delete
[21711] Fix | Delete
[21712] Fix | Delete
[21713] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/animation-state.mjs
[21714] Fix | Delete
[21715] Fix | Delete
[21716] Fix | Delete
[21717] Fix | Delete
[21718] Fix | Delete
[21719] Fix | Delete
[21720] Fix | Delete
[21721] Fix | Delete
[21722] Fix | Delete
const reversePriorityOrder = [...variantPriorityOrder].reverse();
[21723] Fix | Delete
const numAnimationTypes = variantPriorityOrder.length;
[21724] Fix | Delete
function animateList(visualElement) {
[21725] Fix | Delete
return (animations) => Promise.all(animations.map(({ animation, options }) => animateVisualElement(visualElement, animation, options)));
[21726] Fix | Delete
}
[21727] Fix | Delete
function createAnimationState(visualElement) {
[21728] Fix | Delete
let animate = animateList(visualElement);
[21729] Fix | Delete
const state = createState();
[21730] Fix | Delete
let isInitialRender = true;
[21731] Fix | Delete
/**
[21732] Fix | Delete
* This function will be used to reduce the animation definitions for
[21733] Fix | Delete
* each active animation type into an object of resolved values for it.
[21734] Fix | Delete
*/
[21735] Fix | Delete
const buildResolvedTypeValues = (type) => (acc, definition) => {
[21736] Fix | Delete
var _a;
[21737] Fix | Delete
const resolved = resolveVariant(visualElement, definition, type === "exit"
[21738] Fix | Delete
? (_a = visualElement.presenceContext) === null || _a === void 0 ? void 0 : _a.custom
[21739] Fix | Delete
: undefined);
[21740] Fix | Delete
if (resolved) {
[21741] Fix | Delete
const { transition, transitionEnd, ...target } = resolved;
[21742] Fix | Delete
acc = { ...acc, ...target, ...transitionEnd };
[21743] Fix | Delete
}
[21744] Fix | Delete
return acc;
[21745] Fix | Delete
};
[21746] Fix | Delete
/**
[21747] Fix | Delete
* This just allows us to inject mocked animation functions
[21748] Fix | Delete
* @internal
[21749] Fix | Delete
*/
[21750] Fix | Delete
function setAnimateFunction(makeAnimator) {
[21751] Fix | Delete
animate = makeAnimator(visualElement);
[21752] Fix | Delete
}
[21753] Fix | Delete
/**
[21754] Fix | Delete
* When we receive new props, we need to:
[21755] Fix | Delete
* 1. Create a list of protected keys for each type. This is a directory of
[21756] Fix | Delete
* value keys that are currently being "handled" by types of a higher priority
[21757] Fix | Delete
* so that whenever an animation is played of a given type, these values are
[21758] Fix | Delete
* protected from being animated.
[21759] Fix | Delete
* 2. Determine if an animation type needs animating.
[21760] Fix | Delete
* 3. Determine if any values have been removed from a type and figure out
[21761] Fix | Delete
* what to animate those to.
[21762] Fix | Delete
*/
[21763] Fix | Delete
function animateChanges(changedActiveType) {
[21764] Fix | Delete
const props = visualElement.getProps();
[21765] Fix | Delete
const context = visualElement.getVariantContext(true) || {};
[21766] Fix | Delete
/**
[21767] Fix | Delete
* A list of animations that we'll build into as we iterate through the animation
[21768] Fix | Delete
* types. This will get executed at the end of the function.
[21769] Fix | Delete
*/
[21770] Fix | Delete
const animations = [];
[21771] Fix | Delete
/**
[21772] Fix | Delete
* Keep track of which values have been removed. Then, as we hit lower priority
[21773] Fix | Delete
* animation types, we can check if they contain removed values and animate to that.
[21774] Fix | Delete
*/
[21775] Fix | Delete
const removedKeys = new Set();
[21776] Fix | Delete
/**
[21777] Fix | Delete
* A dictionary of all encountered keys. This is an object to let us build into and
[21778] Fix | Delete
* copy it without iteration. Each time we hit an animation type we set its protected
[21779] Fix | Delete
* keys - the keys its not allowed to animate - to the latest version of this object.
[21780] Fix | Delete
*/
[21781] Fix | Delete
let encounteredKeys = {};
[21782] Fix | Delete
/**
[21783] Fix | Delete
* If a variant has been removed at a given index, and this component is controlling
[21784] Fix | Delete
* variant animations, we want to ensure lower-priority variants are forced to animate.
[21785] Fix | Delete
*/
[21786] Fix | Delete
let removedVariantIndex = Infinity;
[21787] Fix | Delete
/**
[21788] Fix | Delete
* Iterate through all animation types in reverse priority order. For each, we want to
[21789] Fix | Delete
* detect which values it's handling and whether or not they've changed (and therefore
[21790] Fix | Delete
* need to be animated). If any values have been removed, we want to detect those in
[21791] Fix | Delete
* lower priority props and flag for animation.
[21792] Fix | Delete
*/
[21793] Fix | Delete
for (let i = 0; i < numAnimationTypes; i++) {
[21794] Fix | Delete
const type = reversePriorityOrder[i];
[21795] Fix | Delete
const typeState = state[type];
[21796] Fix | Delete
const prop = props[type] !== undefined
[21797] Fix | Delete
? props[type]
[21798] Fix | Delete
: context[type];
[21799] Fix | Delete
const propIsVariant = isVariantLabel(prop);
[21800] Fix | Delete
/**
[21801] Fix | Delete
* If this type has *just* changed isActive status, set activeDelta
[21802] Fix | Delete
* to that status. Otherwise set to null.
[21803] Fix | Delete
*/
[21804] Fix | Delete
const activeDelta = type === changedActiveType ? typeState.isActive : null;
[21805] Fix | Delete
if (activeDelta === false)
[21806] Fix | Delete
removedVariantIndex = i;
[21807] Fix | Delete
/**
[21808] Fix | Delete
* If this prop is an inherited variant, rather than been set directly on the
[21809] Fix | Delete
* component itself, we want to make sure we allow the parent to trigger animations.
[21810] Fix | Delete
*
[21811] Fix | Delete
* TODO: Can probably change this to a !isControllingVariants check
[21812] Fix | Delete
*/
[21813] Fix | Delete
let isInherited = prop === context[type] &&
[21814] Fix | Delete
prop !== props[type] &&
[21815] Fix | Delete
propIsVariant;
[21816] Fix | Delete
/**
[21817] Fix | Delete
*
[21818] Fix | Delete
*/
[21819] Fix | Delete
if (isInherited &&
[21820] Fix | Delete
isInitialRender &&
[21821] Fix | Delete
visualElement.manuallyAnimateOnMount) {
[21822] Fix | Delete
isInherited = false;
[21823] Fix | Delete
}
[21824] Fix | Delete
/**
[21825] Fix | Delete
* Set all encountered keys so far as the protected keys for this type. This will
[21826] Fix | Delete
* be any key that has been animated or otherwise handled by active, higher-priortiy types.
[21827] Fix | Delete
*/
[21828] Fix | Delete
typeState.protectedKeys = { ...encounteredKeys };
[21829] Fix | Delete
// Check if we can skip analysing this prop early
[21830] Fix | Delete
if (
[21831] Fix | Delete
// If it isn't active and hasn't *just* been set as inactive
[21832] Fix | Delete
(!typeState.isActive && activeDelta === null) ||
[21833] Fix | Delete
// If we didn't and don't have any defined prop for this animation type
[21834] Fix | Delete
(!prop && !typeState.prevProp) ||
[21835] Fix | Delete
// Or if the prop doesn't define an animation
[21836] Fix | Delete
isAnimationControls(prop) ||
[21837] Fix | Delete
typeof prop === "boolean") {
[21838] Fix | Delete
continue;
[21839] Fix | Delete
}
[21840] Fix | Delete
/**
[21841] Fix | Delete
* As we go look through the values defined on this type, if we detect
[21842] Fix | Delete
* a changed value or a value that was removed in a higher priority, we set
[21843] Fix | Delete
* this to true and add this prop to the animation list.
[21844] Fix | Delete
*/
[21845] Fix | Delete
const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop);
[21846] Fix | Delete
let shouldAnimateType = variantDidChange ||
[21847] Fix | Delete
// If we're making this variant active, we want to always make it active
[21848] Fix | Delete
(type === changedActiveType &&
[21849] Fix | Delete
typeState.isActive &&
[21850] Fix | Delete
!isInherited &&
[21851] Fix | Delete
propIsVariant) ||
[21852] Fix | Delete
// If we removed a higher-priority variant (i is in reverse order)
[21853] Fix | Delete
(i > removedVariantIndex && propIsVariant);
[21854] Fix | Delete
let handledRemovedValues = false;
[21855] Fix | Delete
/**
[21856] Fix | Delete
* As animations can be set as variant lists, variants or target objects, we
[21857] Fix | Delete
* coerce everything to an array if it isn't one already
[21858] Fix | Delete
*/
[21859] Fix | Delete
const definitionList = Array.isArray(prop) ? prop : [prop];
[21860] Fix | Delete
/**
[21861] Fix | Delete
* Build an object of all the resolved values. We'll use this in the subsequent
[21862] Fix | Delete
* animateChanges calls to determine whether a value has changed.
[21863] Fix | Delete
*/
[21864] Fix | Delete
let resolvedValues = definitionList.reduce(buildResolvedTypeValues(type), {});
[21865] Fix | Delete
if (activeDelta === false)
[21866] Fix | Delete
resolvedValues = {};
[21867] Fix | Delete
/**
[21868] Fix | Delete
* Now we need to loop through all the keys in the prev prop and this prop,
[21869] Fix | Delete
* and decide:
[21870] Fix | Delete
* 1. If the value has changed, and needs animating
[21871] Fix | Delete
* 2. If it has been removed, and needs adding to the removedKeys set
[21872] Fix | Delete
* 3. If it has been removed in a higher priority type and needs animating
[21873] Fix | Delete
* 4. If it hasn't been removed in a higher priority but hasn't changed, and
[21874] Fix | Delete
* needs adding to the type's protectedKeys list.
[21875] Fix | Delete
*/
[21876] Fix | Delete
const { prevResolvedValues = {} } = typeState;
[21877] Fix | Delete
const allKeys = {
[21878] Fix | Delete
...prevResolvedValues,
[21879] Fix | Delete
...resolvedValues,
[21880] Fix | Delete
};
[21881] Fix | Delete
const markToAnimate = (key) => {
[21882] Fix | Delete
shouldAnimateType = true;
[21883] Fix | Delete
if (removedKeys.has(key)) {
[21884] Fix | Delete
handledRemovedValues = true;
[21885] Fix | Delete
removedKeys.delete(key);
[21886] Fix | Delete
}
[21887] Fix | Delete
typeState.needsAnimating[key] = true;
[21888] Fix | Delete
const motionValue = visualElement.getValue(key);
[21889] Fix | Delete
if (motionValue)
[21890] Fix | Delete
motionValue.liveStyle = false;
[21891] Fix | Delete
};
[21892] Fix | Delete
for (const key in allKeys) {
[21893] Fix | Delete
const next = resolvedValues[key];
[21894] Fix | Delete
const prev = prevResolvedValues[key];
[21895] Fix | Delete
// If we've already handled this we can just skip ahead
[21896] Fix | Delete
if (encounteredKeys.hasOwnProperty(key))
[21897] Fix | Delete
continue;
[21898] Fix | Delete
/**
[21899] Fix | Delete
* If the value has changed, we probably want to animate it.
[21900] Fix | Delete
*/
[21901] Fix | Delete
let valueHasChanged = false;
[21902] Fix | Delete
if (isKeyframesTarget(next) && isKeyframesTarget(prev)) {
[21903] Fix | Delete
valueHasChanged = !shallowCompare(next, prev);
[21904] Fix | Delete
}
[21905] Fix | Delete
else {
[21906] Fix | Delete
valueHasChanged = next !== prev;
[21907] Fix | Delete
}
[21908] Fix | Delete
if (valueHasChanged) {
[21909] Fix | Delete
if (next !== undefined && next !== null) {
[21910] Fix | Delete
// If next is defined and doesn't equal prev, it needs animating
[21911] Fix | Delete
markToAnimate(key);
[21912] Fix | Delete
}
[21913] Fix | Delete
else {
[21914] Fix | Delete
// If it's undefined, it's been removed.
[21915] Fix | Delete
removedKeys.add(key);
[21916] Fix | Delete
}
[21917] Fix | Delete
}
[21918] Fix | Delete
else if (next !== undefined && removedKeys.has(key)) {
[21919] Fix | Delete
/**
[21920] Fix | Delete
* If next hasn't changed and it isn't undefined, we want to check if it's
[21921] Fix | Delete
* been removed by a higher priority
[21922] Fix | Delete
*/
[21923] Fix | Delete
markToAnimate(key);
[21924] Fix | Delete
}
[21925] Fix | Delete
else {
[21926] Fix | Delete
/**
[21927] Fix | Delete
* If it hasn't changed, we add it to the list of protected values
[21928] Fix | Delete
* to ensure it doesn't get animated.
[21929] Fix | Delete
*/
[21930] Fix | Delete
typeState.protectedKeys[key] = true;
[21931] Fix | Delete
}
[21932] Fix | Delete
}
[21933] Fix | Delete
/**
[21934] Fix | Delete
* Update the typeState so next time animateChanges is called we can compare the
[21935] Fix | Delete
* latest prop and resolvedValues to these.
[21936] Fix | Delete
*/
[21937] Fix | Delete
typeState.prevProp = prop;
[21938] Fix | Delete
typeState.prevResolvedValues = resolvedValues;
[21939] Fix | Delete
/**
[21940] Fix | Delete
*
[21941] Fix | Delete
*/
[21942] Fix | Delete
if (typeState.isActive) {
[21943] Fix | Delete
encounteredKeys = { ...encounteredKeys, ...resolvedValues };
[21944] Fix | Delete
}
[21945] Fix | Delete
if (isInitialRender && visualElement.blockInitialAnimation) {
[21946] Fix | Delete
shouldAnimateType = false;
[21947] Fix | Delete
}
[21948] Fix | Delete
/**
[21949] Fix | Delete
* If this is an inherited prop we want to hard-block animations
[21950] Fix | Delete
*/
[21951] Fix | Delete
if (shouldAnimateType && (!isInherited || handledRemovedValues)) {
[21952] Fix | Delete
animations.push(...definitionList.map((animation) => ({
[21953] Fix | Delete
animation: animation,
[21954] Fix | Delete
options: { type },
[21955] Fix | Delete
})));
[21956] Fix | Delete
}
[21957] Fix | Delete
}
[21958] Fix | Delete
/**
[21959] Fix | Delete
* If there are some removed value that haven't been dealt with,
[21960] Fix | Delete
* we need to create a new animation that falls back either to the value
[21961] Fix | Delete
* defined in the style prop, or the last read value.
[21962] Fix | Delete
*/
[21963] Fix | Delete
if (removedKeys.size) {
[21964] Fix | Delete
const fallbackAnimation = {};
[21965] Fix | Delete
removedKeys.forEach((key) => {
[21966] Fix | Delete
const fallbackTarget = visualElement.getBaseTarget(key);
[21967] Fix | Delete
const motionValue = visualElement.getValue(key);
[21968] Fix | Delete
if (motionValue)
[21969] Fix | Delete
motionValue.liveStyle = true;
[21970] Fix | Delete
// @ts-expect-error - @mattgperry to figure if we should do something here
[21971] Fix | Delete
fallbackAnimation[key] = fallbackTarget !== null && fallbackTarget !== void 0 ? fallbackTarget : null;
[21972] Fix | Delete
});
[21973] Fix | Delete
animations.push({ animation: fallbackAnimation });
[21974] Fix | Delete
}
[21975] Fix | Delete
let shouldAnimate = Boolean(animations.length);
[21976] Fix | Delete
if (isInitialRender &&
[21977] Fix | Delete
(props.initial === false || props.initial === props.animate) &&
[21978] Fix | Delete
!visualElement.manuallyAnimateOnMount) {
[21979] Fix | Delete
shouldAnimate = false;
[21980] Fix | Delete
}
[21981] Fix | Delete
isInitialRender = false;
[21982] Fix | Delete
return shouldAnimate ? animate(animations) : Promise.resolve();
[21983] Fix | Delete
}
[21984] Fix | Delete
/**
[21985] Fix | Delete
* Change whether a certain animation type is active.
[21986] Fix | Delete
*/
[21987] Fix | Delete
function setActive(type, isActive) {
[21988] Fix | Delete
var _a;
[21989] Fix | Delete
// If the active state hasn't changed, we can safely do nothing here
[21990] Fix | Delete
if (state[type].isActive === isActive)
[21991] Fix | Delete
return Promise.resolve();
[21992] Fix | Delete
// Propagate active change to children
[21993] Fix | Delete
(_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.forEach((child) => { var _a; return (_a = child.animationState) === null || _a === void 0 ? void 0 : _a.setActive(type, isActive); });
[21994] Fix | Delete
state[type].isActive = isActive;
[21995] Fix | Delete
const animations = animateChanges(type);
[21996] Fix | Delete
for (const key in state) {
[21997] Fix | Delete
state[key].protectedKeys = {};
[21998] Fix | Delete
}
[21999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function