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
// If we're not animating on an externally-provided `MotionValue` we can use the
[23000] Fix | Delete
// component's animation controls which will handle interactions with whileHover (etc),
[23001] Fix | Delete
// otherwise we just have to animate the `MotionValue` itself.
[23002] Fix | Delete
return this.startAxisValueAnimation(axis, inertia);
[23003] Fix | Delete
});
[23004] Fix | Delete
// Run all animations and then resolve the new drag constraints.
[23005] Fix | Delete
return Promise.all(momentumAnimations).then(onDragTransitionEnd);
[23006] Fix | Delete
}
[23007] Fix | Delete
startAxisValueAnimation(axis, transition) {
[23008] Fix | Delete
const axisValue = this.getAxisMotionValue(axis);
[23009] Fix | Delete
return axisValue.start(animateMotionValue(axis, axisValue, 0, transition, this.visualElement));
[23010] Fix | Delete
}
[23011] Fix | Delete
stopAnimation() {
[23012] Fix | Delete
eachAxis((axis) => this.getAxisMotionValue(axis).stop());
[23013] Fix | Delete
}
[23014] Fix | Delete
pauseAnimation() {
[23015] Fix | Delete
eachAxis((axis) => { var _a; return (_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.pause(); });
[23016] Fix | Delete
}
[23017] Fix | Delete
getAnimationState(axis) {
[23018] Fix | Delete
var _a;
[23019] Fix | Delete
return (_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.state;
[23020] Fix | Delete
}
[23021] Fix | Delete
/**
[23022] Fix | Delete
* Drag works differently depending on which props are provided.
[23023] Fix | Delete
*
[23024] Fix | Delete
* - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.
[23025] Fix | Delete
* - Otherwise, we apply the delta to the x/y motion values.
[23026] Fix | Delete
*/
[23027] Fix | Delete
getAxisMotionValue(axis) {
[23028] Fix | Delete
const dragKey = `_drag${axis.toUpperCase()}`;
[23029] Fix | Delete
const props = this.visualElement.getProps();
[23030] Fix | Delete
const externalMotionValue = props[dragKey];
[23031] Fix | Delete
return externalMotionValue
[23032] Fix | Delete
? externalMotionValue
[23033] Fix | Delete
: this.visualElement.getValue(axis, (props.initial
[23034] Fix | Delete
? props.initial[axis]
[23035] Fix | Delete
: undefined) || 0);
[23036] Fix | Delete
}
[23037] Fix | Delete
snapToCursor(point) {
[23038] Fix | Delete
eachAxis((axis) => {
[23039] Fix | Delete
const { drag } = this.getProps();
[23040] Fix | Delete
// If we're not dragging this axis, do an early return.
[23041] Fix | Delete
if (!shouldDrag(axis, drag, this.currentDirection))
[23042] Fix | Delete
return;
[23043] Fix | Delete
const { projection } = this.visualElement;
[23044] Fix | Delete
const axisValue = this.getAxisMotionValue(axis);
[23045] Fix | Delete
if (projection && projection.layout) {
[23046] Fix | Delete
const { min, max } = projection.layout.layoutBox[axis];
[23047] Fix | Delete
axisValue.set(point[axis] - mixNumber(min, max, 0.5));
[23048] Fix | Delete
}
[23049] Fix | Delete
});
[23050] Fix | Delete
}
[23051] Fix | Delete
/**
[23052] Fix | Delete
* When the viewport resizes we want to check if the measured constraints
[23053] Fix | Delete
* have changed and, if so, reposition the element within those new constraints
[23054] Fix | Delete
* relative to where it was before the resize.
[23055] Fix | Delete
*/
[23056] Fix | Delete
scalePositionWithinConstraints() {
[23057] Fix | Delete
if (!this.visualElement.current)
[23058] Fix | Delete
return;
[23059] Fix | Delete
const { drag, dragConstraints } = this.getProps();
[23060] Fix | Delete
const { projection } = this.visualElement;
[23061] Fix | Delete
if (!isRefObject(dragConstraints) || !projection || !this.constraints)
[23062] Fix | Delete
return;
[23063] Fix | Delete
/**
[23064] Fix | Delete
* Stop current animations as there can be visual glitching if we try to do
[23065] Fix | Delete
* this mid-animation
[23066] Fix | Delete
*/
[23067] Fix | Delete
this.stopAnimation();
[23068] Fix | Delete
/**
[23069] Fix | Delete
* Record the relative position of the dragged element relative to the
[23070] Fix | Delete
* constraints box and save as a progress value.
[23071] Fix | Delete
*/
[23072] Fix | Delete
const boxProgress = { x: 0, y: 0 };
[23073] Fix | Delete
eachAxis((axis) => {
[23074] Fix | Delete
const axisValue = this.getAxisMotionValue(axis);
[23075] Fix | Delete
if (axisValue && this.constraints !== false) {
[23076] Fix | Delete
const latest = axisValue.get();
[23077] Fix | Delete
boxProgress[axis] = constraints_calcOrigin({ min: latest, max: latest }, this.constraints[axis]);
[23078] Fix | Delete
}
[23079] Fix | Delete
});
[23080] Fix | Delete
/**
[23081] Fix | Delete
* Update the layout of this element and resolve the latest drag constraints
[23082] Fix | Delete
*/
[23083] Fix | Delete
const { transformTemplate } = this.visualElement.getProps();
[23084] Fix | Delete
this.visualElement.current.style.transform = transformTemplate
[23085] Fix | Delete
? transformTemplate({}, "")
[23086] Fix | Delete
: "none";
[23087] Fix | Delete
projection.root && projection.root.updateScroll();
[23088] Fix | Delete
projection.updateLayout();
[23089] Fix | Delete
this.resolveConstraints();
[23090] Fix | Delete
/**
[23091] Fix | Delete
* For each axis, calculate the current progress of the layout axis
[23092] Fix | Delete
* within the new constraints.
[23093] Fix | Delete
*/
[23094] Fix | Delete
eachAxis((axis) => {
[23095] Fix | Delete
if (!shouldDrag(axis, drag, null))
[23096] Fix | Delete
return;
[23097] Fix | Delete
/**
[23098] Fix | Delete
* Calculate a new transform based on the previous box progress
[23099] Fix | Delete
*/
[23100] Fix | Delete
const axisValue = this.getAxisMotionValue(axis);
[23101] Fix | Delete
const { min, max } = this.constraints[axis];
[23102] Fix | Delete
axisValue.set(mixNumber(min, max, boxProgress[axis]));
[23103] Fix | Delete
});
[23104] Fix | Delete
}
[23105] Fix | Delete
addListeners() {
[23106] Fix | Delete
if (!this.visualElement.current)
[23107] Fix | Delete
return;
[23108] Fix | Delete
elementDragControls.set(this.visualElement, this);
[23109] Fix | Delete
const element = this.visualElement.current;
[23110] Fix | Delete
/**
[23111] Fix | Delete
* Attach a pointerdown event listener on this DOM element to initiate drag tracking.
[23112] Fix | Delete
*/
[23113] Fix | Delete
const stopPointerListener = addPointerEvent(element, "pointerdown", (event) => {
[23114] Fix | Delete
const { drag, dragListener = true } = this.getProps();
[23115] Fix | Delete
drag && dragListener && this.start(event);
[23116] Fix | Delete
});
[23117] Fix | Delete
const measureDragConstraints = () => {
[23118] Fix | Delete
const { dragConstraints } = this.getProps();
[23119] Fix | Delete
if (isRefObject(dragConstraints)) {
[23120] Fix | Delete
this.constraints = this.resolveRefConstraints();
[23121] Fix | Delete
}
[23122] Fix | Delete
};
[23123] Fix | Delete
const { projection } = this.visualElement;
[23124] Fix | Delete
const stopMeasureLayoutListener = projection.addEventListener("measure", measureDragConstraints);
[23125] Fix | Delete
if (projection && !projection.layout) {
[23126] Fix | Delete
projection.root && projection.root.updateScroll();
[23127] Fix | Delete
projection.updateLayout();
[23128] Fix | Delete
}
[23129] Fix | Delete
measureDragConstraints();
[23130] Fix | Delete
/**
[23131] Fix | Delete
* Attach a window resize listener to scale the draggable target within its defined
[23132] Fix | Delete
* constraints as the window resizes.
[23133] Fix | Delete
*/
[23134] Fix | Delete
const stopResizeListener = addDomEvent(window, "resize", () => this.scalePositionWithinConstraints());
[23135] Fix | Delete
/**
[23136] Fix | Delete
* If the element's layout changes, calculate the delta and apply that to
[23137] Fix | Delete
* the drag gesture's origin point.
[23138] Fix | Delete
*/
[23139] Fix | Delete
const stopLayoutUpdateListener = projection.addEventListener("didUpdate", (({ delta, hasLayoutChanged }) => {
[23140] Fix | Delete
if (this.isDragging && hasLayoutChanged) {
[23141] Fix | Delete
eachAxis((axis) => {
[23142] Fix | Delete
const motionValue = this.getAxisMotionValue(axis);
[23143] Fix | Delete
if (!motionValue)
[23144] Fix | Delete
return;
[23145] Fix | Delete
this.originPoint[axis] += delta[axis].translate;
[23146] Fix | Delete
motionValue.set(motionValue.get() + delta[axis].translate);
[23147] Fix | Delete
});
[23148] Fix | Delete
this.visualElement.render();
[23149] Fix | Delete
}
[23150] Fix | Delete
}));
[23151] Fix | Delete
return () => {
[23152] Fix | Delete
stopResizeListener();
[23153] Fix | Delete
stopPointerListener();
[23154] Fix | Delete
stopMeasureLayoutListener();
[23155] Fix | Delete
stopLayoutUpdateListener && stopLayoutUpdateListener();
[23156] Fix | Delete
};
[23157] Fix | Delete
}
[23158] Fix | Delete
getProps() {
[23159] Fix | Delete
const props = this.visualElement.getProps();
[23160] Fix | Delete
const { drag = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true, } = props;
[23161] Fix | Delete
return {
[23162] Fix | Delete
...props,
[23163] Fix | Delete
drag,
[23164] Fix | Delete
dragDirectionLock,
[23165] Fix | Delete
dragPropagation,
[23166] Fix | Delete
dragConstraints,
[23167] Fix | Delete
dragElastic,
[23168] Fix | Delete
dragMomentum,
[23169] Fix | Delete
};
[23170] Fix | Delete
}
[23171] Fix | Delete
}
[23172] Fix | Delete
function shouldDrag(direction, drag, currentDirection) {
[23173] Fix | Delete
return ((drag === true || drag === direction) &&
[23174] Fix | Delete
(currentDirection === null || currentDirection === direction));
[23175] Fix | Delete
}
[23176] Fix | Delete
/**
[23177] Fix | Delete
* Based on an x/y offset determine the current drag direction. If both axis' offsets are lower
[23178] Fix | Delete
* than the provided threshold, return `null`.
[23179] Fix | Delete
*
[23180] Fix | Delete
* @param offset - The x/y offset from origin.
[23181] Fix | Delete
* @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction.
[23182] Fix | Delete
*/
[23183] Fix | Delete
function getCurrentDirection(offset, lockThreshold = 10) {
[23184] Fix | Delete
let direction = null;
[23185] Fix | Delete
if (Math.abs(offset.y) > lockThreshold) {
[23186] Fix | Delete
direction = "y";
[23187] Fix | Delete
}
[23188] Fix | Delete
else if (Math.abs(offset.x) > lockThreshold) {
[23189] Fix | Delete
direction = "x";
[23190] Fix | Delete
}
[23191] Fix | Delete
return direction;
[23192] Fix | Delete
}
[23193] Fix | Delete
[23194] Fix | Delete
[23195] Fix | Delete
[23196] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/drag/index.mjs
[23197] Fix | Delete
[23198] Fix | Delete
[23199] Fix | Delete
[23200] Fix | Delete
[23201] Fix | Delete
class DragGesture extends Feature {
[23202] Fix | Delete
constructor(node) {
[23203] Fix | Delete
super(node);
[23204] Fix | Delete
this.removeGroupControls = noop_noop;
[23205] Fix | Delete
this.removeListeners = noop_noop;
[23206] Fix | Delete
this.controls = new VisualElementDragControls(node);
[23207] Fix | Delete
}
[23208] Fix | Delete
mount() {
[23209] Fix | Delete
// If we've been provided a DragControls for manual control over the drag gesture,
[23210] Fix | Delete
// subscribe this component to it on mount.
[23211] Fix | Delete
const { dragControls } = this.node.getProps();
[23212] Fix | Delete
if (dragControls) {
[23213] Fix | Delete
this.removeGroupControls = dragControls.subscribe(this.controls);
[23214] Fix | Delete
}
[23215] Fix | Delete
this.removeListeners = this.controls.addListeners() || noop_noop;
[23216] Fix | Delete
}
[23217] Fix | Delete
unmount() {
[23218] Fix | Delete
this.removeGroupControls();
[23219] Fix | Delete
this.removeListeners();
[23220] Fix | Delete
}
[23221] Fix | Delete
}
[23222] Fix | Delete
[23223] Fix | Delete
[23224] Fix | Delete
[23225] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/pan/index.mjs
[23226] Fix | Delete
[23227] Fix | Delete
[23228] Fix | Delete
[23229] Fix | Delete
[23230] Fix | Delete
[23231] Fix | Delete
[23232] Fix | Delete
[23233] Fix | Delete
const asyncHandler = (handler) => (event, info) => {
[23234] Fix | Delete
if (handler) {
[23235] Fix | Delete
frame_frame.postRender(() => handler(event, info));
[23236] Fix | Delete
}
[23237] Fix | Delete
};
[23238] Fix | Delete
class PanGesture extends Feature {
[23239] Fix | Delete
constructor() {
[23240] Fix | Delete
super(...arguments);
[23241] Fix | Delete
this.removePointerDownListener = noop_noop;
[23242] Fix | Delete
}
[23243] Fix | Delete
onPointerDown(pointerDownEvent) {
[23244] Fix | Delete
this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), {
[23245] Fix | Delete
transformPagePoint: this.node.getTransformPagePoint(),
[23246] Fix | Delete
contextWindow: getContextWindow(this.node),
[23247] Fix | Delete
});
[23248] Fix | Delete
}
[23249] Fix | Delete
createPanHandlers() {
[23250] Fix | Delete
const { onPanSessionStart, onPanStart, onPan, onPanEnd } = this.node.getProps();
[23251] Fix | Delete
return {
[23252] Fix | Delete
onSessionStart: asyncHandler(onPanSessionStart),
[23253] Fix | Delete
onStart: asyncHandler(onPanStart),
[23254] Fix | Delete
onMove: onPan,
[23255] Fix | Delete
onEnd: (event, info) => {
[23256] Fix | Delete
delete this.session;
[23257] Fix | Delete
if (onPanEnd) {
[23258] Fix | Delete
frame_frame.postRender(() => onPanEnd(event, info));
[23259] Fix | Delete
}
[23260] Fix | Delete
},
[23261] Fix | Delete
};
[23262] Fix | Delete
}
[23263] Fix | Delete
mount() {
[23264] Fix | Delete
this.removePointerDownListener = addPointerEvent(this.node.current, "pointerdown", (event) => this.onPointerDown(event));
[23265] Fix | Delete
}
[23266] Fix | Delete
update() {
[23267] Fix | Delete
this.session && this.session.updateHandlers(this.createPanHandlers());
[23268] Fix | Delete
}
[23269] Fix | Delete
unmount() {
[23270] Fix | Delete
this.removePointerDownListener();
[23271] Fix | Delete
this.session && this.session.end();
[23272] Fix | Delete
}
[23273] Fix | Delete
}
[23274] Fix | Delete
[23275] Fix | Delete
[23276] Fix | Delete
[23277] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs
[23278] Fix | Delete
[23279] Fix | Delete
[23280] Fix | Delete
[23281] Fix | Delete
/**
[23282] Fix | Delete
* When a component is the child of `AnimatePresence`, it can use `usePresence`
[23283] Fix | Delete
* to access information about whether it's still present in the React tree.
[23284] Fix | Delete
*
[23285] Fix | Delete
* ```jsx
[23286] Fix | Delete
* import { usePresence } from "framer-motion"
[23287] Fix | Delete
*
[23288] Fix | Delete
* export const Component = () => {
[23289] Fix | Delete
* const [isPresent, safeToRemove] = usePresence()
[23290] Fix | Delete
*
[23291] Fix | Delete
* useEffect(() => {
[23292] Fix | Delete
* !isPresent && setTimeout(safeToRemove, 1000)
[23293] Fix | Delete
* }, [isPresent])
[23294] Fix | Delete
*
[23295] Fix | Delete
* return <div />
[23296] Fix | Delete
* }
[23297] Fix | Delete
* ```
[23298] Fix | Delete
*
[23299] Fix | Delete
* If `isPresent` is `false`, it means that a component has been removed the tree, but
[23300] Fix | Delete
* `AnimatePresence` won't really remove it until `safeToRemove` has been called.
[23301] Fix | Delete
*
[23302] Fix | Delete
* @public
[23303] Fix | Delete
*/
[23304] Fix | Delete
function usePresence() {
[23305] Fix | Delete
const context = (0,external_React_.useContext)(PresenceContext_PresenceContext);
[23306] Fix | Delete
if (context === null)
[23307] Fix | Delete
return [true, null];
[23308] Fix | Delete
const { isPresent, onExitComplete, register } = context;
[23309] Fix | Delete
// It's safe to call the following hooks conditionally (after an early return) because the context will always
[23310] Fix | Delete
// either be null or non-null for the lifespan of the component.
[23311] Fix | Delete
const id = (0,external_React_.useId)();
[23312] Fix | Delete
(0,external_React_.useEffect)(() => register(id), []);
[23313] Fix | Delete
const safeToRemove = () => onExitComplete && onExitComplete(id);
[23314] Fix | Delete
return !isPresent && onExitComplete ? [false, safeToRemove] : [true];
[23315] Fix | Delete
}
[23316] Fix | Delete
/**
[23317] Fix | Delete
* Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.
[23318] Fix | Delete
* There is no `safeToRemove` function.
[23319] Fix | Delete
*
[23320] Fix | Delete
* ```jsx
[23321] Fix | Delete
* import { useIsPresent } from "framer-motion"
[23322] Fix | Delete
*
[23323] Fix | Delete
* export const Component = () => {
[23324] Fix | Delete
* const isPresent = useIsPresent()
[23325] Fix | Delete
*
[23326] Fix | Delete
* useEffect(() => {
[23327] Fix | Delete
* !isPresent && console.log("I've been removed!")
[23328] Fix | Delete
* }, [isPresent])
[23329] Fix | Delete
*
[23330] Fix | Delete
* return <div />
[23331] Fix | Delete
* }
[23332] Fix | Delete
* ```
[23333] Fix | Delete
*
[23334] Fix | Delete
* @public
[23335] Fix | Delete
*/
[23336] Fix | Delete
function useIsPresent() {
[23337] Fix | Delete
return isPresent(useContext(PresenceContext));
[23338] Fix | Delete
}
[23339] Fix | Delete
function isPresent(context) {
[23340] Fix | Delete
return context === null ? true : context.isPresent;
[23341] Fix | Delete
}
[23342] Fix | Delete
[23343] Fix | Delete
[23344] Fix | Delete
[23345] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/node/state.mjs
[23346] Fix | Delete
/**
[23347] Fix | Delete
* This should only ever be modified on the client otherwise it'll
[23348] Fix | Delete
* persist through server requests. If we need instanced states we
[23349] Fix | Delete
* could lazy-init via root.
[23350] Fix | Delete
*/
[23351] Fix | Delete
const globalProjectionState = {
[23352] Fix | Delete
/**
[23353] Fix | Delete
* Global flag as to whether the tree has animated since the last time
[23354] Fix | Delete
* we resized the window
[23355] Fix | Delete
*/
[23356] Fix | Delete
hasAnimatedSinceResize: true,
[23357] Fix | Delete
/**
[23358] Fix | Delete
* We set this to true once, on the first update. Any nodes added to the tree beyond that
[23359] Fix | Delete
* update will be given a `data-projection-id` attribute.
[23360] Fix | Delete
*/
[23361] Fix | Delete
hasEverUpdated: false,
[23362] Fix | Delete
};
[23363] Fix | Delete
[23364] Fix | Delete
[23365] Fix | Delete
[23366] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/styles/scale-border-radius.mjs
[23367] Fix | Delete
[23368] Fix | Delete
[23369] Fix | Delete
function pixelsToPercent(pixels, axis) {
[23370] Fix | Delete
if (axis.max === axis.min)
[23371] Fix | Delete
return 0;
[23372] Fix | Delete
return (pixels / (axis.max - axis.min)) * 100;
[23373] Fix | Delete
}
[23374] Fix | Delete
/**
[23375] Fix | Delete
* We always correct borderRadius as a percentage rather than pixels to reduce paints.
[23376] Fix | Delete
* For example, if you are projecting a box that is 100px wide with a 10px borderRadius
[23377] Fix | Delete
* into a box that is 200px wide with a 20px borderRadius, that is actually a 10%
[23378] Fix | Delete
* borderRadius in both states. If we animate between the two in pixels that will trigger
[23379] Fix | Delete
* a paint each time. If we animate between the two in percentage we'll avoid a paint.
[23380] Fix | Delete
*/
[23381] Fix | Delete
const correctBorderRadius = {
[23382] Fix | Delete
correct: (latest, node) => {
[23383] Fix | Delete
if (!node.target)
[23384] Fix | Delete
return latest;
[23385] Fix | Delete
/**
[23386] Fix | Delete
* If latest is a string, if it's a percentage we can return immediately as it's
[23387] Fix | Delete
* going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number.
[23388] Fix | Delete
*/
[23389] Fix | Delete
if (typeof latest === "string") {
[23390] Fix | Delete
if (px.test(latest)) {
[23391] Fix | Delete
latest = parseFloat(latest);
[23392] Fix | Delete
}
[23393] Fix | Delete
else {
[23394] Fix | Delete
return latest;
[23395] Fix | Delete
}
[23396] Fix | Delete
}
[23397] Fix | Delete
/**
[23398] Fix | Delete
* If latest is a number, it's a pixel value. We use the current viewportBox to calculate that
[23399] Fix | Delete
* pixel value as a percentage of each axis
[23400] Fix | Delete
*/
[23401] Fix | Delete
const x = pixelsToPercent(latest, node.target.x);
[23402] Fix | Delete
const y = pixelsToPercent(latest, node.target.y);
[23403] Fix | Delete
return `${x}% ${y}%`;
[23404] Fix | Delete
},
[23405] Fix | Delete
};
[23406] Fix | Delete
[23407] Fix | Delete
[23408] Fix | Delete
[23409] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/styles/scale-box-shadow.mjs
[23410] Fix | Delete
[23411] Fix | Delete
[23412] Fix | Delete
[23413] Fix | Delete
const correctBoxShadow = {
[23414] Fix | Delete
correct: (latest, { treeScale, projectionDelta }) => {
[23415] Fix | Delete
const original = latest;
[23416] Fix | Delete
const shadow = complex.parse(latest);
[23417] Fix | Delete
// TODO: Doesn't support multiple shadows
[23418] Fix | Delete
if (shadow.length > 5)
[23419] Fix | Delete
return original;
[23420] Fix | Delete
const template = complex.createTransformer(latest);
[23421] Fix | Delete
const offset = typeof shadow[0] !== "number" ? 1 : 0;
[23422] Fix | Delete
// Calculate the overall context scale
[23423] Fix | Delete
const xScale = projectionDelta.x.scale * treeScale.x;
[23424] Fix | Delete
const yScale = projectionDelta.y.scale * treeScale.y;
[23425] Fix | Delete
shadow[0 + offset] /= xScale;
[23426] Fix | Delete
shadow[1 + offset] /= yScale;
[23427] Fix | Delete
/**
[23428] Fix | Delete
* Ideally we'd correct x and y scales individually, but because blur and
[23429] Fix | Delete
* spread apply to both we have to take a scale average and apply that instead.
[23430] Fix | Delete
* We could potentially improve the outcome of this by incorporating the ratio between
[23431] Fix | Delete
* the two scales.
[23432] Fix | Delete
*/
[23433] Fix | Delete
const averageScale = mixNumber(xScale, yScale, 0.5);
[23434] Fix | Delete
// Blur
[23435] Fix | Delete
if (typeof shadow[2 + offset] === "number")
[23436] Fix | Delete
shadow[2 + offset] /= averageScale;
[23437] Fix | Delete
// Spread
[23438] Fix | Delete
if (typeof shadow[3 + offset] === "number")
[23439] Fix | Delete
shadow[3 + offset] /= averageScale;
[23440] Fix | Delete
return template(shadow);
[23441] Fix | Delete
},
[23442] Fix | Delete
};
[23443] Fix | Delete
[23444] Fix | Delete
[23445] Fix | Delete
[23446] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs
[23447] Fix | Delete
[23448] Fix | Delete
[23449] Fix | Delete
[23450] Fix | Delete
[23451] Fix | Delete
[23452] Fix | Delete
[23453] Fix | Delete
[23454] Fix | Delete
[23455] Fix | Delete
[23456] Fix | Delete
[23457] Fix | Delete
[23458] Fix | Delete
[23459] Fix | Delete
class MeasureLayoutWithContext extends external_React_.Component {
[23460] Fix | Delete
/**
[23461] Fix | Delete
* This only mounts projection nodes for components that
[23462] Fix | Delete
* need measuring, we might want to do it for all components
[23463] Fix | Delete
* in order to incorporate transforms
[23464] Fix | Delete
*/
[23465] Fix | Delete
componentDidMount() {
[23466] Fix | Delete
const { visualElement, layoutGroup, switchLayoutGroup, layoutId } = this.props;
[23467] Fix | Delete
const { projection } = visualElement;
[23468] Fix | Delete
addScaleCorrector(defaultScaleCorrectors);
[23469] Fix | Delete
if (projection) {
[23470] Fix | Delete
if (layoutGroup.group)
[23471] Fix | Delete
layoutGroup.group.add(projection);
[23472] Fix | Delete
if (switchLayoutGroup && switchLayoutGroup.register && layoutId) {
[23473] Fix | Delete
switchLayoutGroup.register(projection);
[23474] Fix | Delete
}
[23475] Fix | Delete
projection.root.didUpdate();
[23476] Fix | Delete
projection.addEventListener("animationComplete", () => {
[23477] Fix | Delete
this.safeToRemove();
[23478] Fix | Delete
});
[23479] Fix | Delete
projection.setOptions({
[23480] Fix | Delete
...projection.options,
[23481] Fix | Delete
onExitComplete: () => this.safeToRemove(),
[23482] Fix | Delete
});
[23483] Fix | Delete
}
[23484] Fix | Delete
globalProjectionState.hasEverUpdated = true;
[23485] Fix | Delete
}
[23486] Fix | Delete
getSnapshotBeforeUpdate(prevProps) {
[23487] Fix | Delete
const { layoutDependency, visualElement, drag, isPresent } = this.props;
[23488] Fix | Delete
const projection = visualElement.projection;
[23489] Fix | Delete
if (!projection)
[23490] Fix | Delete
return null;
[23491] Fix | Delete
/**
[23492] Fix | Delete
* TODO: We use this data in relegate to determine whether to
[23493] Fix | Delete
* promote a previous element. There's no guarantee its presence data
[23494] Fix | Delete
* will have updated by this point - if a bug like this arises it will
[23495] Fix | Delete
* have to be that we markForRelegation and then find a new lead some other way,
[23496] Fix | Delete
* perhaps in didUpdate
[23497] Fix | Delete
*/
[23498] Fix | Delete
projection.isPresent = isPresent;
[23499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function